@bimdata/viewer 2.7.0-beta.5 → 2.7.0

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.
@@ -5498,7 +5498,7 @@ void main() {
5498
5498
  `,t5=class{constructor(i){this.viewer=i,this.config=i.config,this.state=i.state}destroy(){}},ka=new at,pw=new vl(0,0,0,"ZXY"),gFt=class extends t5{constructor(i){super(i)}fovToZoomLevel(i){const e=Math.round((i-this.config.minFov)/(this.config.maxFov-this.config.minFov)*100);return kn.clamp(e-2*(e-50),0,100)}zoomLevelToFov(i){return this.config.maxFov+i/100*(this.config.minFov-this.config.maxFov)}vFovToHFov(i){return kn.radToDeg(2*Math.atan(Math.tan(kn.degToRad(i)/2)*this.state.aspect))}hFovToVFov(i){return kn.radToDeg(2*Math.atan(Math.tan(kn.degToRad(i)/2)/this.state.aspect))}getAnimationProperties(i,e,t){const n=!To(e),o=!To(t),r={};let s=null;if(n){const a=this.viewer.getPosition(),l=yle(a.yaw,e.yaw);r.yaw={start:a.yaw,end:a.yaw+l},r.pitch={start:a.pitch,end:e.pitch},s=RR(i,wle(a,e))}if(o){const a=this.viewer.getZoomLevel(),l=Math.abs(t-a);r.zoom={start:a,end:t},s===null&&(s=RR(i,Math.PI/4*l/100))}return s===null?typeof i=="number"?s=i:s=xR:s=Math.max(xR,s),{duration:s,properties:r}}textureCoordsToSphericalCoords(i){var t;if(!((t=this.state.textureData)!=null&&t.panoData))throw new Wi("Current adapter does not support texture coordinates or no texture has been loaded");const e=this.viewer.adapter.textureCoordsToSphericalCoords(i,this.state.textureData.panoData);return!pw.equals(this.viewer.renderer.panoramaPose)||!pw.equals(this.viewer.renderer.sphereCorrection)?(this.sphericalCoordsToVector3(e,ka),ka.applyEuler(this.viewer.renderer.panoramaPose),ka.applyEuler(this.viewer.renderer.sphereCorrection),this.vector3ToSphericalCoords(ka)):e}sphericalCoordsToTextureCoords(i){var e;if(!((e=this.state.textureData)!=null&&e.panoData))throw new Wi("Current adapter does not support texture coordinates or no texture has been loaded");return(!pw.equals(this.viewer.renderer.panoramaPose)||!pw.equals(this.viewer.renderer.sphereCorrection))&&(this.sphericalCoordsToVector3(i,ka),_R(ka,this.viewer.renderer.sphereCorrection),_R(ka,this.viewer.renderer.panoramaPose),i=this.vector3ToSphericalCoords(ka)),this.viewer.adapter.sphericalCoordsToTextureCoords(i,this.state.textureData.panoData)}sphericalCoordsToVector3(i,e,t=Nh){return e||(e=new at),e.x=t*-Math.cos(i.pitch)*Math.sin(i.yaw),e.y=t*Math.sin(i.pitch),e.z=t*Math.cos(i.pitch)*Math.cos(i.yaw),e}vector3ToSphericalCoords(i){const e=Math.acos(i.y/Math.sqrt(i.x*i.x+i.y*i.y+i.z*i.z)),t=Math.atan2(i.x,i.z);return{yaw:t<0?-t:Math.PI*2-t,pitch:Math.PI/2-e}}viewerCoordsToVector3(i){const e=this.viewer.renderer.getIntersections(i).filter(t=>t.object.userData[sd]);return e.length?e[0].point:null}viewerCoordsToSphericalCoords(i){const e=this.viewerCoordsToVector3(i);return e?this.vector3ToSphericalCoords(e):null}vector3ToViewerCoords(i){const e=i.clone();return e.project(this.viewer.renderer.camera),{x:Math.round((e.x+1)/2*this.state.size.width),y:Math.round((1-e.y)/2*this.state.size.height)}}sphericalCoordsToViewerCoords(i){return this.sphericalCoordsToVector3(i,ka),this.vector3ToViewerCoords(ka)}isPointVisible(i){let e,t;if(i instanceof at)e=i,t=this.vector3ToViewerCoords(i);else if(TR(i))e=this.sphericalCoordsToVector3(i,ka),t=this.vector3ToViewerCoords(e);else return!1;return e.dot(this.viewer.state.direction)>0&&t.x>=0&&t.x<=this.viewer.state.size.width&&t.y>=0&&t.y<=this.viewer.state.size.height}cleanPosition(i){if("yaw"in i||"pitch"in i){if(!("yaw"in i)||!("pitch"in i))throw new Wi("Position is missing 'yaw' or 'pitch'");return{yaw:Ml(i.yaw),pitch:Ml(i.pitch,!0)}}else return this.textureCoordsToSphericalCoords(i)}cleanSphereCorrection(i){return{pan:Ml((i==null?void 0:i.pan)||0),tilt:Ml((i==null?void 0:i.tilt)||0,!0),roll:Ml((i==null?void 0:i.roll)||0,!0,!1)}}cleanPanoramaPose(i){return{pan:kn.degToRad((i==null?void 0:i.poseHeading)||0),tilt:kn.degToRad((i==null?void 0:i.posePitch)||0),roll:kn.degToRad((i==null?void 0:i.poseRoll)||0)}}cleanPanoramaOptions(i,e){return e!=null&&e.isEquirectangular&&(To(i.zoom)&&!To(e.initialFov)&&(i={...i,zoom:this.fovToZoomLevel(this.hFovToVFov(e.initialFov))}),To(i.position)&&!To(e.initialHeading)&&!To(e.initialPitch)&&(i={...i,position:{yaw:Ml(e.initialHeading),pitch:Ml(e.initialPitch,!0)}})),i}},vFt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="currentColor" d="M33.38 33.2a1.96 1.96 0 0 0 1.5-3.23 10.61 10.61 0 0 1 7.18-17.51c.7-.06 1.31-.49 1.61-1.12a13.02 13.02 0 0 1 11.74-7.43c7.14 0 12.96 5.8 12.96 12.9 0 3.07-1.1 6.05-3.1 8.38-.7.82-.61 2.05.21 2.76.83.7 2.07.6 2.78-.22a16.77 16.77 0 0 0 4.04-10.91C72.3 7.54 64.72 0 55.4 0a16.98 16.98 0 0 0-14.79 8.7 14.6 14.6 0 0 0-12.23 14.36c0 3.46 1.25 6.82 3.5 9.45.4.45.94.69 1.5.69m45.74 43.55a22.13 22.13 0 0 1-5.23 12.4c-4 4.55-9.53 6.86-16.42 6.86-12.6 0-20.1-10.8-20.17-10.91a1.82 1.82 0 0 0-.08-.1c-5.3-6.83-14.55-23.82-17.27-28.87-.05-.1 0-.21.02-.23a6.3 6.3 0 0 1 8.24 1.85l9.38 12.59a1.97 1.97 0 0 0 3.54-1.17V25.34a4 4 0 0 1 1.19-2.87 3.32 3.32 0 0 1 2.4-.95c1.88.05 3.4 1.82 3.4 3.94v24.32a1.96 1.96 0 0 0 3.93 0v-33.1a3.5 3.5 0 0 1 7 0v35.39a1.96 1.96 0 0 0 3.93 0v-.44c.05-2.05 1.6-3.7 3.49-3.7 1.93 0 3.5 1.7 3.5 3.82v5.63c0 .24.04.48.13.71l.1.26a1.97 1.97 0 0 0 3.76-.37c.33-1.78 1.77-3.07 3.43-3.07 1.9 0 3.45 1.67 3.5 3.74l-1.77 18.1zM77.39 51c-1.25 0-2.45.32-3.5.9v-.15c0-4.27-3.33-7.74-7.42-7.74-1.26 0-2.45.33-3.5.9V16.69a7.42 7.42 0 0 0-14.85 0v1.86a7 7 0 0 0-3.28-.94 7.21 7.21 0 0 0-5.26 2.07 7.92 7.92 0 0 0-2.38 5.67v37.9l-5.83-7.82a10.2 10.2 0 0 0-13.35-2.92 4.1 4.1 0 0 0-1.53 5.48C20 64.52 28.74 80.45 34.07 87.34c.72 1.04 9.02 12.59 23.4 12.59 7.96 0 14.66-2.84 19.38-8.2a26.06 26.06 0 0 0 6.18-14.6l1.78-18.2v-.2c0-4.26-3.32-7.73-7.42-7.73z"/><!--Created by AomAm from the Noun Project--></svg>
5499
5499
  `,yFt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="10 17 79 79"><path fill="currentColor" d="M38.1 29.27c-.24 0-.44.2-.44.45v10.7a.45.45 0 00.9 0v-10.7c0-.25-.2-.45-.45-.45zm10.2 26.66a11.54 11.54 0 01-8.48-6.14.45.45 0 10-.8.41 12.45 12.45 0 009.22 6.62.45.45 0 00.07-.9zm24.55-13.08a23.04 23.04 0 00-22.56-23v7.07l-.01.05a2.83 2.83 0 012.39 2.78v14.03l.09-.02h8.84v-9.22a.45.45 0 11.9 0v9.22h10.35v-.9zm0 27.33V44.66H62.5c-.02 2.01-.52 4-1.47 5.76a.45.45 0 01-.61.18.45.45 0 01-.19-.61 11.54 11.54 0 001.36-5.33h-8.83l-.1-.01a2.83 2.83 0 01-2.83 2.84h-.04-.04a2.83 2.83 0 01-2.83-2.83v-14.9a2.82 2.82 0 012.47-2.8v-7.11a23.04 23.04 0 00-22.57 23v.91h14.72V29.88a8.2 8.2 0 015.02-7.57c.22-.1.5.01.59.24.1.23-.01.5-.24.6a7.3 7.3 0 00-4.47 6.73v13.88h3.9a.45.45 0 110 .9h-3.9v.15a7.32 7.32 0 0011.23 6.17.45.45 0 01.49.76 8.22 8.22 0 01-12.62-6.93v-.15H26.82v25.52a23.04 23.04 0 0023.01 23.01 23.04 23.04 0 0023.02-23.01zm1.8-27.33v27.33A24.85 24.85 0 0149.84 95a24.85 24.85 0 01-24.82-24.82V42.85a24.85 24.85 0 0124.82-24.82 24.85 24.85 0 0124.83 24.82zM57.98 29.88v9.36a.45.45 0 11-.9 0v-9.36a7.28 7.28 0 00-3.4-6.17.45.45 0 01.49-.76 8.18 8.18 0 013.8 6.93z"/><!-- Created by Icon Island from the Noun Project --></svg>
5500
5500
  `,fw=class E1e{constructor(){this.$=E1e.IDLE}is(...e){return e.some(t=>this.$&t)}set(e){this.$=e}add(e){this.$|=e}remove(e){this.$&=~e}};fw.IDLE=0,fw.CLICK=1,fw.MOVING=2;var lo=fw,wFt=class extends t5{constructor(i){super(i),this.data={startMouseX:0,startMouseY:0,mouseX:0,mouseY:0,pinchDist:0,moveDelta:{yaw:0,pitch:0,zoom:0},accumulatorFactor:0,ctrlKeyDown:!1,dblclickData:null,dblclickTimeout:null,longtouchTimeout:null,twofingersTimeout:null,ctrlZoomTimeout:null},this.step=new lo,this.keyHandler=new cw,this.resizeObserver=new ResizeObserver(BR(()=>this.viewer.autoSize(),50)),this.moveThreshold=dle*Es.pixelRatio}init(){window.addEventListener("keydown",this,{passive:!1}),window.addEventListener("keyup",this),this.viewer.container.addEventListener("mousedown",this),window.addEventListener("mousemove",this,{passive:!1}),window.addEventListener("mouseup",this),this.viewer.container.addEventListener("touchstart",this,{passive:!1}),window.addEventListener("touchmove",this,{passive:!1}),window.addEventListener("touchend",this,{passive:!1}),this.viewer.container.addEventListener("wheel",this,{passive:!1}),document.addEventListener("fullscreenchange",this),this.resizeObserver.observe(this.viewer.container),this.viewer.addEventListener(H4.type,this),this.viewer.addEventListener(Z4.type,this)}destroy(){window.removeEventListener("keydown",this),window.removeEventListener("keyup",this),this.viewer.container.removeEventListener("mousedown",this),window.removeEventListener("mousemove",this),window.removeEventListener("mouseup",this),this.viewer.container.removeEventListener("touchstart",this),window.removeEventListener("touchmove",this),window.removeEventListener("touchend",this),this.viewer.container.removeEventListener("wheel",this),document.removeEventListener("fullscreenchange",this),this.resizeObserver.disconnect(),this.viewer.removeEventListener(H4.type,this),this.viewer.removeEventListener(Z4.type,this),clearTimeout(this.data.dblclickTimeout),clearTimeout(this.data.longtouchTimeout),clearTimeout(this.data.twofingersTimeout),clearTimeout(this.data.ctrlZoomTimeout),super.destroy()}handleEvent(i){switch(i.type){case"keydown":this.__onKeyDown(i);break;case"keyup":this.__onKeyUp();break;case"mousemove":this.__onMouseMove(i);break;case"mouseup":this.__onMouseUp(i);break;case"touchmove":this.__onTouchMove(i);break;case"touchend":this.__onTouchEnd(i);break;case"fullscreenchange":this.__onFullscreenChange();break;case H4.type:this.__applyMoveDelta();break;case Z4.type:this.__clearMoveDelta();break}if(!xle(i,"."+U4))switch(i.type){case"mousedown":this.__onMouseDown(i);break;case"touchstart":this.__onTouchStart(i);break;case"wheel":this.__onMouseWheel(i);break}}__onKeyDown(i){var t;if(this.config.mousewheelCtrlKey&&(this.data.ctrlKeyDown=i.key===Po.Control,this.data.ctrlKeyDown&&(clearTimeout(this.data.ctrlZoomTimeout),this.viewer.overlay.hide(Vo.CTRL_ZOOM))),!this.viewer.dispatchEvent(new ad(i.key,i))||!this.state.keyboardEnabled)return;const e=(t=this.config.keyboardActions)==null?void 0:t[i.key];if(typeof e=="function"){e(this.viewer,i),i.preventDefault();return}if(!(i.ctrlKey||i.altKey||i.shiftKey||i.metaKey)&&e&&!this.keyHandler.pending){switch(e!=="ZOOM_IN"&&e!=="ZOOM_OUT"&&this.viewer.stopAll(),e){case"ROTATE_UP":this.viewer.dynamics.position.roll({pitch:!1});break;case"ROTATE_DOWN":this.viewer.dynamics.position.roll({pitch:!0});break;case"ROTATE_RIGHT":this.viewer.dynamics.position.roll({yaw:!1});break;case"ROTATE_LEFT":this.viewer.dynamics.position.roll({yaw:!0});break;case"ZOOM_IN":this.viewer.dynamics.zoom.roll(!1);break;case"ZOOM_OUT":this.viewer.dynamics.zoom.roll(!0);break}this.keyHandler.down(e),i.preventDefault()}}__onKeyUp(){this.data.ctrlKeyDown=!1,this.state.keyboardEnabled&&this.keyHandler.up(i=>{i==="ZOOM_IN"||i==="ZOOM_OUT"?this.viewer.dynamics.zoom.stop():(this.viewer.dynamics.position.stop(),this.viewer.resetIdleTimer())})}__onMouseDown(i){this.step.add(lo.CLICK),this.data.startMouseX=i.clientX,this.data.startMouseY=i.clientY}__onMouseUp(i){this.step.is(lo.CLICK,lo.MOVING)&&this.__stopMove(i.clientX,i.clientY,i,i.button===2)}__onMouseMove(i){this.config.mousemove&&this.step.is(lo.CLICK,lo.MOVING)&&(i.preventDefault(),this.__doMove(i.clientX,i.clientY)),this.__handleObjectsEvents(i)}__onTouchStart(i){i.touches.length===1?(this.step.add(lo.CLICK),this.data.startMouseX=i.touches[0].clientX,this.data.startMouseY=i.touches[0].clientY,this.data.longtouchTimeout||(this.data.longtouchTimeout=setTimeout(()=>{const e=i.touches[0];this.__stopMove(e.clientX,e.clientY,i,!0),this.data.longtouchTimeout=null},ple))):i.touches.length===2&&(this.step.set(lo.IDLE),this.__cancelLongTouch(),this.config.mousemove&&(this.__cancelTwoFingersOverlay(),this.__startMoveZoom(i),i.preventDefault()))}__onTouchEnd(i){if(this.__cancelLongTouch(),this.step.is(lo.CLICK,lo.MOVING)){if(i.preventDefault(),this.__cancelTwoFingersOverlay(),i.touches.length===1)this.__stopMove(this.data.mouseX,this.data.mouseY);else if(i.touches.length===0){const e=i.changedTouches[0];this.__stopMove(e.clientX,e.clientY,i)}}}__onTouchMove(i){if(this.__cancelLongTouch(),!!this.config.mousemove)if(i.touches.length===1){if(this.config.touchmoveTwoFingers)this.step.is(lo.CLICK)&&!this.data.twofingersTimeout&&(this.data.twofingersTimeout=setTimeout(()=>{this.viewer.overlay.show({id:Vo.TWO_FINGERS,image:vFt,title:this.config.lang.twoFingers})},fle));else if(this.step.is(lo.CLICK,lo.MOVING)){i.preventDefault();const e=i.touches[0];this.__doMove(e.clientX,e.clientY)}}else this.__doMoveZoom(i),this.__cancelTwoFingersOverlay()}__cancelLongTouch(){this.data.longtouchTimeout&&(clearTimeout(this.data.longtouchTimeout),this.data.longtouchTimeout=null)}__cancelTwoFingersOverlay(){this.config.touchmoveTwoFingers&&(this.data.twofingersTimeout&&(clearTimeout(this.data.twofingersTimeout),this.data.twofingersTimeout=null),this.viewer.overlay.hide(Vo.TWO_FINGERS))}__onMouseWheel(i){if(!this.config.mousewheel||!i.deltaY)return;if(this.config.mousewheelCtrlKey&&!this.data.ctrlKeyDown){this.viewer.overlay.show({id:Vo.CTRL_ZOOM,image:yFt,title:this.config.lang.ctrlZoom}),clearTimeout(this.data.ctrlZoomTimeout),this.data.ctrlZoomTimeout=setTimeout(()=>this.viewer.overlay.hide(Vo.CTRL_ZOOM),Ale);return}i.preventDefault(),i.stopPropagation();const e=i.deltaY/Math.abs(i.deltaY)*5*this.config.zoomSpeed;e!==0&&this.viewer.dynamics.zoom.step(-e,5)}__onFullscreenChange(){const i=this.viewer.isFullscreenEnabled();this.config.keyboard==="fullscreen"&&(i?this.viewer.startKeyboardControl():this.viewer.stopKeyboardControl()),this.viewer.dispatchEvent(new z4(i))}__resetMove(){this.step.set(lo.IDLE),this.data.mouseX=0,this.data.mouseY=0,this.data.startMouseX=0,this.data.startMouseY=0}__startMoveZoom(i){this.viewer.stopAll(),this.__resetMove();const e=ER(i);this.step.set(lo.MOVING),this.data.accumulatorFactor=this.config.moveInertia,{distance:this.data.pinchDist,center:{x:this.data.mouseX,y:this.data.mouseY}}=e}__stopMove(i,e,t,n=!1){this.step.is(lo.CLICK)&&!this.__moveThresholdReached(i,e)&&this.__doClick(i,e,t,n),this.config.moveInertia&&(this.data.accumulatorFactor=Math.pow(this.config.moveInertia,.5)),this.__resetMove(),this.viewer.resetIdleTimer()}__doClick(i,e,t,n=!1){const o=this.viewer.container.getBoundingClientRect(),r=i-o.left,s=e-o.top,a=this.viewer.renderer.getIntersections({x:r,y:s}),l=a.find(c=>c.object.userData[sd]);if(l){const c=this.viewer.dataHelper.vector3ToSphericalCoords(l.point),u={rightclick:n,originalEvent:t,target:tw(t),clientX:i,clientY:e,viewerX:r,viewerY:s,yaw:c.yaw,pitch:c.pitch,objects:a.map(d=>d.object).filter(d=>!d.userData[sd])};try{const d=this.viewer.dataHelper.sphericalCoordsToTextureCoords(u);Object.assign(u,d)}catch{}this.data.dblclickTimeout?(Math.abs(this.data.dblclickData.clientX-u.clientX)<this.moveThreshold&&Math.abs(this.data.dblclickData.clientY-u.clientY)<this.moveThreshold&&this.viewer.dispatchEvent(new $le(this.data.dblclickData)),clearTimeout(this.data.dblclickTimeout),this.data.dblclickTimeout=null,this.data.dblclickData=null):(this.viewer.dispatchEvent(new Wle(u)),this.data.dblclickData=nw(u),this.data.dblclickTimeout=setTimeout(()=>{this.data.dblclickTimeout=null,this.data.dblclickData=null},hle))}}__handleObjectsEvents(i){if(!Ple(this.state.objectsObservers)&&i.composedPath().includes(this.viewer.container)){const e=Mle(this.viewer.container),t={x:i.clientX-e.x,y:i.clientY-e.y},n=this.viewer.renderer.getIntersections(t),o=(r,s,a)=>{this.viewer.dispatchEvent(new a(i,r,t,s))};for(const[r,s]of Object.entries(this.state.objectsObservers)){const a=n.find(l=>l.object.userData[r]);a?(s&&a.object!==s&&(o(s,r,UR),this.state.objectsObservers[r]=null),s?o(a.object,r,Lce):(this.state.objectsObservers[r]=a.object,o(a.object,r,Rce))):s&&(o(s,r,UR),this.state.objectsObservers[r]=null)}}}__doMove(i,e){if(this.step.is(lo.CLICK)&&this.__moveThresholdReached(i,e))this.viewer.stopAll(),this.__resetMove(),this.step.set(lo.MOVING),this.data.mouseX=i,this.data.mouseY=e,this.data.accumulatorFactor=this.config.moveInertia;else if(this.step.is(lo.MOVING)){const t=(i-this.data.mouseX)*Math.cos(this.state.roll)-(e-this.data.mouseY)*Math.sin(this.state.roll),n=(e-this.data.mouseY)*Math.cos(this.state.roll)+(i-this.data.mouseX)*Math.sin(this.state.roll),o={yaw:this.config.moveSpeed*(t/this.state.size.width)*kn.degToRad(this.state.hFov),pitch:this.config.moveSpeed*(n/this.state.size.height)*kn.degToRad(this.state.vFov)};this.data.moveDelta.yaw+=o.yaw,this.data.moveDelta.pitch+=o.pitch,this.data.mouseX=i,this.data.mouseY=e}}__moveThresholdReached(i,e){return Math.abs(i-this.data.startMouseX)>=this.moveThreshold||Math.abs(e-this.data.startMouseY)>=this.moveThreshold}__doMoveZoom(i){if(this.step.is(lo.MOVING)){i.preventDefault();const e=ER(i);this.__doMove(e.center.x,e.center.y),this.data.moveDelta.zoom+=this.config.zoomSpeed*((e.distance-this.data.pinchDist)/Es.pixelRatio),this.data.pinchDist=e.distance}}__applyMoveDelta(){if(Math.abs(this.data.moveDelta.yaw)>0||Math.abs(this.data.moveDelta.pitch)>0){const e=this.viewer.getPosition();this.viewer.rotate({yaw:e.yaw-this.data.moveDelta.yaw*(1-this.config.moveInertia),pitch:e.pitch+this.data.moveDelta.pitch*(1-this.config.moveInertia)}),this.data.moveDelta.yaw*=this.data.accumulatorFactor,this.data.moveDelta.pitch*=this.data.accumulatorFactor,Math.abs(this.data.moveDelta.yaw)<=.001&&(this.data.moveDelta.yaw=0),Math.abs(this.data.moveDelta.pitch)<=.001&&(this.data.moveDelta.pitch=0)}if(Math.abs(this.data.moveDelta.zoom)>0){const e=this.viewer.getZoomLevel();this.viewer.zoom(e+this.data.moveDelta.zoom*(1-this.config.moveInertia)),this.data.moveDelta.zoom*=this.config.moveInertia,Math.abs(this.data.moveDelta.zoom)<=.001&&(this.data.moveDelta.zoom=0)}}__clearMoveDelta(){this.data.moveDelta.yaw=0,this.data.moveDelta.pitch=0,this.data.moveDelta.zoom=0}};Gi.enabled=!1;var Aw=new rn,Jce=new Qn,Zce=new W2,CFt=class extends t5{constructor(i){super(i),this.frustumNeedsUpdate=!0,this.renderer=new SLt(this.config.rendererParameters),this.renderer.setPixelRatio(Es.pixelRatio),this.renderer.outputColorSpace=Tc,this.renderer.domElement.className="psv-canvas",this.renderer.domElement.style.background=this.config.canvasBackground,this.scene=new ale,this.camera=new $r(50,16/9,.1,2*Nh),this.camera.matrixAutoUpdate=!1;const e=new Yr(new O4(Nh).scale(-1,1,1),new D4({opacity:0,transparent:!0,depthTest:!1,depthWrite:!1}));e.userData={[sd]:!0},this.scene.add(e),this.raycaster=new TLt,this.frustum=new cR,this.container=document.createElement("div"),this.container.className="psv-canvas-container",this.container.appendChild(this.renderer.domElement),this.viewer.container.appendChild(this.container),this.viewer.addEventListener(J4.type,this),this.viewer.addEventListener(Oc.type,this),this.viewer.addEventListener(G4.type,this),this.viewer.addEventListener(q4.type,this),this.viewer.addEventListener($s.type,this),this.hide()}get panoramaPose(){return this.mesh.rotation}get sphereCorrection(){return this.meshContainer.rotation}init(){this.show(),this.renderer.setAnimationLoop(i=>this.__renderLoop(i))}destroy(){this.renderer.setAnimationLoop(null),this.cleanScene(this.scene),this.renderer.dispose(),this.viewer.container.removeChild(this.container),this.viewer.removeEventListener(J4.type,this),this.viewer.removeEventListener(Oc.type,this),this.viewer.removeEventListener(G4.type,this),this.viewer.removeEventListener(q4.type,this),this.viewer.removeEventListener($s.type,this),super.destroy()}handleEvent(i){switch(i.type){case J4.type:this.__onSizeUpdated();break;case Oc.type:this.__onZoomUpdated();break;case G4.type:this.__onPositionUpdated();break;case q4.type:this.__onPositionUpdated();break;case $s.type:i.containsOptions("fisheye")&&this.__onPositionUpdated(),i.containsOptions("canvasBackground")&&(this.renderer.domElement.style.background=this.config.canvasBackground);break}}hide(){this.container.style.opacity="0"}show(){this.container.style.opacity="1"}setCustomRenderer(i){i?this.customRenderer=i(this.renderer):this.customRenderer=null,this.viewer.needsUpdate()}__onSizeUpdated(){this.renderer.setSize(this.state.size.width,this.state.size.height),this.camera.aspect=this.state.aspect,this.camera.updateProjectionMatrix(),this.viewer.needsUpdate(),this.frustumNeedsUpdate=!0}__onZoomUpdated(){this.camera.fov=this.state.vFov,this.camera.updateProjectionMatrix(),this.viewer.needsUpdate(),this.frustumNeedsUpdate=!0}__onPositionUpdated(){this.camera.position.set(0,0,0),this.camera.lookAt(this.state.direction),this.config.fisheye&&this.camera.position.copy(this.state.direction).multiplyScalar(this.config.fisheye/2).negate(),this.camera.rotateZ(-this.state.roll),this.camera.updateMatrix(),this.camera.updateMatrixWorld(),this.viewer.needsUpdate(),this.frustumNeedsUpdate=!0}__renderLoop(i){const e=this.timestamp?i-this.timestamp:0;this.timestamp=i,this.viewer.dispatchEvent(new H4(i,e)),this.viewer.dynamics.update(e),(this.state.needsUpdate||this.state.continuousUpdateCount>0)&&(this.state.needsUpdate=!1,(this.customRenderer||this.renderer).render(this.scene,this.camera),this.viewer.dispatchEvent(new Cce))}setTexture(i){this.meshContainer||(this.meshContainer=new hm,this.scene.add(this.meshContainer)),this.state.textureData&&this.viewer.adapter.disposeTexture(this.state.textureData),this.mesh&&(this.meshContainer.remove(this.mesh),this.viewer.adapter.disposeMesh(this.mesh)),this.mesh=this.viewer.adapter.createMesh(i.panoData),this.viewer.adapter.setTexture(this.mesh,i,!1),this.meshContainer.add(this.mesh),this.state.textureData=i,this.viewer.needsUpdate()}setPanoramaPose(i,e=this.mesh){const t=this.viewer.dataHelper.cleanPanoramaPose(i),n=(t.pan?1:0)+(t.tilt?1:0)+(t.roll?1:0);!Am.useNewAnglesOrder&&n>1&&(gn("'panoData' Euler angles have changed in version 5.11.0."),gn("Remove your 'useNewAnglesOrder' override to remove this warning (you might have to adapt your poseHeading/posePitch/poseRoll parameters).")),Am.useNewAnglesOrder?e.rotation.set(t.tilt,t.pan,t.roll,"YXZ"):e.rotation.set(-t.tilt,-t.pan,-t.roll,"ZXY")}setSphereCorrection(i,e=this.meshContainer){const t=this.viewer.dataHelper.cleanSphereCorrection(i),n=(t.pan?1:0)+(t.tilt?1:0)+(t.roll?1:0);!Am.useNewAnglesOrder&&n>1&&(gn("'sphereCorrection' Euler angles have changed in version 5.11.0."),gn("Remove your 'useNewAnglesOrder' override to remove this warning (you might have to adapt your poseHeading/posePitch/poseRoll parameters).")),Am.useNewAnglesOrder?e.rotation.set(t.tilt,t.pan,t.roll,"YXZ"):e.rotation.set(t.tilt,t.pan,t.roll,"ZXY")}transition(i,e){const t=!To(e.position),n=!To(e.zoom),o=new FR(t?this.viewer.dataHelper.cleanPosition(e.position):void 0,e.zoom);this.viewer.dispatchEvent(o);const r=new hm,s=this.viewer.adapter.createMesh(i.panoData);if(this.viewer.adapter.setTexture(s,i,!0),this.viewer.adapter.setTextureOpacity(s,0),this.setPanoramaPose(i.panoData,s),this.setSphereCorrection(e.sphereCorrection,r),t&&e.transition==="fade-only"){const u=this.viewer.getPosition(),d=new at(0,1,0);r.rotateOnWorldAxis(d,o.position.yaw-u.yaw);const h=new at(0,1,0).cross(this.camera.getWorldDirection(new at)).normalize();r.rotateOnWorldAxis(h,o.position.pitch-u.pitch)}r.add(s),this.scene.add(r),this.renderer.setRenderTarget(new Wu),this.renderer.render(this.scene,this.camera),this.renderer.setRenderTarget(null);const{duration:a,properties:l}=this.viewer.dataHelper.getAnimationProperties(e.speed,e.transition===!0?o.position:null,o.zoomLevel),c=new lw({properties:{...l,opacity:{start:0,end:1}},duration:a,easing:"inOutCubic",onTick:u=>{this.viewer.adapter.setTextureOpacity(s,u.opacity),t&&e.transition===!0&&this.viewer.dynamics.position.setValue({yaw:u.yaw,pitch:u.pitch}),n&&this.viewer.dynamics.zoom.setValue(u.zoom),this.viewer.needsUpdate()}});return c.then(u=>{r.remove(s),this.scene.remove(r),u?(this.viewer.adapter.disposeTexture(this.state.textureData),this.meshContainer.remove(this.mesh),this.viewer.adapter.disposeMesh(this.mesh),this.mesh=s,this.meshContainer.add(s),this.state.textureData=i,this.setPanoramaPose(i.panoData),this.setSphereCorrection(e.sphereCorrection),t&&e.transition==="fade-only"&&this.viewer.rotate(e.position)):(this.viewer.adapter.disposeTexture(i),this.viewer.adapter.disposeMesh(s))}),c}getIntersections(i){var t;Aw.x=2*i.x/this.state.size.width-1,Aw.y=-2*i.y/this.state.size.height+1,this.raycaster.setFromCamera(Aw,this.camera);const e=this.raycaster.intersectObjects(this.scene.children,!0).filter(n=>n.object.visible).filter(n=>n.object.isMesh&&!!n.object.userData);return(t=this.customRenderer)!=null&&t.getIntersections&&e.push(...this.customRenderer.getIntersections(this.raycaster,Aw)),e}isObjectVisible(i){if(!i)return!1;if(this.frustumNeedsUpdate&&(Jce.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),this.frustum.setFromProjectionMatrix(Jce),this.frustumNeedsUpdate=!1),i.isVector3)return this.frustum.containsPoint(i);if(i.isMesh&&i.geometry){const e=i;return e.geometry.boundingBox||e.geometry.computeBoundingBox(),Zce.copy(e.geometry.boundingBox).applyMatrix4(e.matrixWorld),this.frustum.intersectsBox(Zce)}else return i.isObject3D?this.frustum.intersectsObject(i):!1}addObject(i){this.scene.add(i)}removeObject(i){this.scene.remove(i)}cleanScene(i){const e=t=>{var n;(n=t.map)==null||n.dispose(),t.uniforms&&Object.values(t.uniforms).forEach(o=>{var r,s;(s=(r=o.value)==null?void 0:r.dispose)==null||s.call(r)}),t.dispose()};i.traverse(t=>{var n,o;(n=t.geometry)==null||n.dispose(),t.material&&(Array.isArray(t.material)?t.material.forEach(r=>{e(r)}):e(t.material)),t instanceof ale||(o=t.dispose)==null||o.call(t),t!==i&&this.cleanScene(t)})}},bFt=class extends wR{load(i,e,t,n,o){const r=new Request(i,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"});fetch(r,{signal:o}).then(s=>{if(s.status===200||s.status===0){const a=s.body.getReader(),l=s.headers.get("Content-Length")||s.headers.get("X-File-Size"),c=l?parseInt(l):0,u=c!==0;let d=0;const h=new ReadableStream({start(f){A();function A(){a.read().then(({done:p,value:m})=>{if(p)f.close();else{d+=m.byteLength;const g=new ProgressEvent("progress",{lengthComputable:u,loaded:d,total:c});t(g),f.enqueue(m),A()}}).catch(p=>{n(p)})}}});return new Response(h)}else throw new Error(`fetch for "${s.url}" responded with ${s.status}: ${s.statusText}`)}).then(s=>s.blob()).then(s=>{e(s)}).catch(s=>{n(s)})}},xFt=class extends wR{load(i,e,t,n){const o=document.createElement("img");function r(){l(),e(this)}function s(c){if(l(),n!=null&&n.aborted){const u=new Error;u.name="AbortError",u.message="The operation was aborted.",t(u)}else t(c)}function a(){o.src=""}function l(){o.removeEventListener("load",r,!1),o.removeEventListener("error",s,!1),n==null||n.removeEventListener("abort",a,!1)}return o.addEventListener("load",r,!1),o.addEventListener("error",s,!1),n==null||n.addEventListener("abort",a,!1),!i.startsWith("data:")&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),o.src=i,o}},MFt=class extends t5{constructor(i){super(i),this.abortCtrl={},this.fileLoader=new bFt,this.imageLoader=new xFt,this.config.withCredentials&&(this.fileLoader.setWithCredentials(!0),this.imageLoader.setCrossOrigin("use-credentials"))}destroy(){this.abortLoading(),super.destroy()}abortLoading(){Object.values(this.abortCtrl).forEach(i=>i.abort()),this.abortCtrl={}}loadFile(i,e,t){const n=fm.get(i,t);if(n){if(n instanceof Blob)return e==null||e(100),Promise.resolve(n);fm.remove(i,t)}return this.config.requestHeaders&&this.fileLoader.setRequestHeader(this.config.requestHeaders(i)),new Promise((o,r)=>{let s=0;e==null||e(s),this.fileLoader.load(i,a=>{s=100,e==null||e(s),fm.add(i,t,a),o(a)},a=>{if(a.lengthComputable){const l=a.loaded/a.total*100;l>s&&(s=l,e==null||e(s))}},a=>{r(a)},this.__getAbortSignal(t))})}loadImage(i,e,t){const n=fm.get(i,t);return n?(e==null||e(100),n instanceof Blob?this.blobToImage(n):Promise.resolve(n)):!e&&!this.config.requestHeaders?new Promise((o,r)=>{this.imageLoader.load(i,s=>{fm.add(i,t,s),o(s)},s=>{r(s)},this.__getAbortSignal(t))}):this.loadFile(i,e,t).then(o=>this.blobToImage(o))}blobToImage(i){return new Promise((e,t)=>{const n=document.createElement("img");n.onload=()=>{URL.revokeObjectURL(n.src),e(n)},n.onerror=t,n.src=URL.createObjectURL(i)})}preloadPanorama(i){return this.viewer.adapter.supportsPreload(i)?this.viewer.adapter.loadTexture(i,!1):Promise.reject(new Wi("Current adapter does not support preload"))}__getAbortSignal(i){var e;return i?((e=this.abortCtrl[i])!=null&&e.signal.aborted&&delete this.abortCtrl[i],this.abortCtrl[i]||(this.abortCtrl[i]=new AbortController),this.abortCtrl[i].signal):null}},EFt=class extends t5{constructor(i){super(i),this.zoom=new V4(e=>{this.viewer.state.vFov=this.viewer.dataHelper.zoomLevelToFov(e),this.viewer.state.hFov=this.viewer.dataHelper.vFovToHFov(this.viewer.state.vFov),this.viewer.dispatchEvent(new Oc(e))},{defaultValue:this.viewer.config.defaultZoomLvl,min:0,max:100,wrap:!1}),this.position=new Hle(e=>{this.viewer.dataHelper.sphericalCoordsToVector3(e,this.viewer.state.direction),this.viewer.dispatchEvent(new G4(e))},{yaw:new V4(null,{defaultValue:this.config.defaultYaw,min:0,max:2*Math.PI,wrap:!0}),pitch:new V4(null,{defaultValue:this.config.defaultPitch,min:-Math.PI/2,max:Math.PI/2,wrap:!1})}),this.roll=new V4(e=>{this.viewer.state.roll=e,this.viewer.dispatchEvent(new q4(e))},{defaultValue:0,min:-Math.PI,max:Math.PI,wrap:!1}),this.updateSpeeds()}updateSpeeds(){this.zoom.setSpeed(this.config.zoomSpeed*50),this.position.setSpeed(kn.degToRad(this.config.moveSpeed*50)),this.roll.setSpeed(kn.degToRad(this.config.moveSpeed*50))}update(i){this.zoom.update(i),this.position.update(i),this.roll.update(i)}},BFt=class{constructor(){this.ready=!1,this.needsUpdate=!1,this.continuousUpdateCount=0,this.keyboardEnabled=!1,this.direction=new at(0,0,Nh),this.roll=0,this.vFov=60,this.hFov=60,this.aspect=1,this.animation=null,this.transitionAnimation=null,this.loadingPromise=null,this.idleTime=-1,this.objectsObservers={},this.size={width:0,height:0}}},Am=class extends Gle{constructor(e){var t,n,o;if(super(),this.plugins={},this.children=[],this.onResize=BR(()=>this.navbar.autoSize(),500),this.parent=Cle(e.container),!this.parent)throw new Wi('"container" element not found.');this.parent[sd]=this,this.container=document.createElement("div"),this.container.classList.add("psv-container"),this.parent.appendChild(this.container),Nle(this.parent),Ule(this.container,"core"),this.state=new BFt,this.config=aFt(e),this.__setSize(this.config.size),this.overlay=new hFt(this);try{Es.load()}catch(r){console.error(r),this.showError(this.config.lang.webglError);return}fm.init(),this.adapter=new this.config.adapter[0](this,this.config.adapter[1]),this.renderer=new CFt(this),this.textureLoader=new MFt(this),this.eventsHandler=new wFt(this),this.dataHelper=new gFt(this),this.dynamics=new EFt(this),(n=(t=this.adapter).init)==null||n.call(t),this.loader=new uFt(this),this.navbar=new cFt(this),this.panel=new fFt(this),this.notification=new dFt(this),this.autoSize(),this.setCursor(null),IR(Es.isTouchEnabled,r=>{ew(this.container,"psv--is-touch",r)}),this.config.plugins.forEach(([r,s])=>{this.plugins[r.id]=new r(this,s)});for(const r of Object.values(this.plugins))(o=r.init)==null||o.call(r);this.config.navbar&&this.navbar.setButtons(this.config.navbar),this.state.loadingPromise||(this.config.panorama?this.setPanorama(this.config.panorama):this.loader.show())}destroy(){var e,t,n,o,r,s;this.stopAll(),this.stopKeyboardControl(),this.exitFullscreen();for(const[a,l]of Object.entries(this.plugins))l.destroy(),delete this.plugins[a];this.children.slice().forEach(a=>a.destroy()),this.children.length=0,(e=this.eventsHandler)==null||e.destroy(),(t=this.renderer)==null||t.destroy(),(n=this.textureLoader)==null||n.destroy(),(o=this.dataHelper)==null||o.destroy(),(r=this.adapter)==null||r.destroy(),(s=this.dynamics)==null||s.destroy(),this.parent.removeChild(this.container),delete this.parent[sd]}init(){this.eventsHandler.init(),this.renderer.init(),this.config.navbar&&this.navbar.show(),this.config.keyboard==="always"&&this.startKeyboardControl(),this.resetIdleTimer(),this.state.ready=!0,this.dispatchEvent(new Q4)}resetIdleTimer(){this.state.idleTime=performance.now()}disableIdleTimer(){this.state.idleTime=-1}getPlugin(e){if(typeof e=="string")return this.plugins[e];{const t=zR(e);return t?this.plugins[t.id]:null}}getPosition(){return this.dataHelper.cleanPosition(this.dynamics.position.current)}getZoomLevel(){return this.dynamics.zoom.current}getSize(){return{...this.state.size}}isFullscreenEnabled(){return Ele(this.parent,Es.isIphone)}needsUpdate(){this.state.needsUpdate=!0}needsContinuousUpdate(e){e?this.state.continuousUpdateCount++:this.state.continuousUpdateCount>0&&this.state.continuousUpdateCount--}autoSize(){(this.container.clientWidth!==this.state.size.width||this.container.clientHeight!==this.state.size.height)&&(this.state.size.width=Math.round(this.container.clientWidth),this.state.size.height=Math.round(this.container.clientHeight),this.state.aspect=this.state.size.width/this.state.size.height,this.state.hFov=this.dataHelper.vFovToHFov(this.state.vFov),this.dispatchEvent(new J4(this.getSize())),this.onResize())}setPanorama(e,t={}){var r;this.textureLoader.abortLoading(),(r=this.state.transitionAnimation)==null||r.cancel(),this.state.ready||["sphereCorrection","panoData"].forEach(s=>{s in t||(t[s]=this.config[s])}),t.transition===void 0&&(t.transition=!0),t.speed===void 0&&(t.speed=ule),t.showLoader===void 0&&(t.showLoader=!0),t.caption===void 0&&(t.caption=this.config.caption),t.description===void 0&&(t.description=this.config.description),!t.panoData&&typeof this.config.panoData=="function"&&(t.panoData=this.config.panoData),this.hideError(),this.resetIdleTimer(),this.config.panorama=e,this.config.caption=t.caption,this.config.description=t.description;const n=s=>{if(Rle(s))return!1;if(this.loader.hide(),this.state.loadingPromise=null,s)throw this.navbar.setCaption(""),this.showError(this.config.lang.loadError),console.error(s),this.dispatchEvent(new fce(e,s)),s;return this.navbar.setCaption(this.config.caption),!0};this.navbar.setCaption(`<em>${this.config.lang.loading}</em>`),(t.showLoader||!this.state.ready)&&this.loader.show(),this.dispatchEvent(new dce(e));const o=this.adapter.loadTexture(this.config.panorama,!0,t.panoData).then(s=>{if(s.panorama!==this.config.panorama)throw this.adapter.disposeTexture(s),PR();const a=this.dataHelper.cleanPanoramaOptions(t,s.panoData);return(!To(a.zoom)||!To(a.position))&&this.stopAll(),{textureData:s,cleanOptions:a}});return!t.transition||!this.state.ready||!this.adapter.supportsTransition(this.config.panorama)?this.state.loadingPromise=o.then(({textureData:s,cleanOptions:a})=>{this.renderer.show(),this.renderer.setTexture(s),this.renderer.setPanoramaPose(s.panoData),this.renderer.setSphereCorrection(t.sphereCorrection),this.state.ready||this.init(),this.dispatchEvent(new OR(s)),To(a.zoom)||this.zoom(a.zoom),To(a.position)||this.rotate(a.position)}).then(()=>n(),s=>n(s)):this.state.loadingPromise=o.then(({textureData:s,cleanOptions:a})=>(this.loader.hide(),this.dispatchEvent(new OR(s)),this.state.transitionAnimation=this.renderer.transition(s,a),this.state.transitionAnimation)).then(s=>{if(this.state.transitionAnimation=null,this.dispatchEvent(new mce(s)),!s)throw PR()}).then(()=>n(),s=>n(s)),this.state.loadingPromise}setOptions(e){const t={...this.config,...e};for(let[n,o]of Object.entries(e)){if(!(n in e5)){gn(`Unknown option ${n}`);continue}if(n in Kce){gn(Kce[n]);continue}switch(n in jR&&(o=jR[n](o,{rawConfig:t,defValue:e5[n]})),this.config[n]=o,n){case"mousemove":this.state.cursorOverride||this.setCursor(null);break;case"caption":this.navbar.setCaption(this.config.caption);break;case"size":this.resize(this.config.size);break;case"sphereCorrection":this.renderer.setSphereCorrection(this.config.sphereCorrection);break;case"navbar":case"lang":this.navbar.setButtons(this.config.navbar);break;case"moveSpeed":case"zoomSpeed":this.dynamics.updateSpeeds();break;case"minFov":case"maxFov":this.dynamics.zoom.setValue(this.dataHelper.fovToZoomLevel(this.state.vFov)),this.dispatchEvent(new Oc(this.getZoomLevel()));break;case"keyboard":this.config.keyboard==="always"?this.startKeyboardControl():this.stopKeyboardControl();break}}this.needsUpdate(),this.dispatchEvent(new $s(Object.keys(e)))}setOption(e,t){this.setOptions({[e]:t})}showError(e){this.overlay.show({id:Vo.ERROR,image:mFt,title:e,dissmisable:!1})}hideError(){this.overlay.hide(Vo.ERROR)}rotate(e){const t=new Jle(this.dataHelper.cleanPosition(e));this.dispatchEvent(t),!t.defaultPrevented&&this.dynamics.position.setValue(t.position)}zoom(e){this.dynamics.zoom.setValue(e)}zoomIn(e=1){this.dynamics.zoom.step(e)}zoomOut(e=1){this.dynamics.zoom.step(-e)}animate(e){const t=TR(e),n=!To(e.zoom),o=new FR(t?this.dataHelper.cleanPosition(e):void 0,e.zoom);if(this.dispatchEvent(o),o.defaultPrevented)return;this.stopAll();const{duration:r,properties:s}=this.dataHelper.getAnimationProperties(e.speed,o.position,o.zoomLevel);return r?(this.state.animation=new lw({properties:s,duration:r,easing:e.easing||"inOutSine",onTick:a=>{t&&this.dynamics.position.setValue({yaw:a.yaw,pitch:a.pitch}),n&&this.dynamics.zoom.setValue(a.zoom)}}),this.state.animation.then(()=>{this.state.animation=null,this.resetIdleTimer()}),this.state.animation):(t&&this.rotate(o.position),n&&this.zoom(o.zoomLevel),new lw(null))}stopAnimation(){return this.state.animation?(this.state.animation.cancel(),this.state.animation):Promise.resolve()}resize(e){this.__setSize(e),this.autoSize()}__setSize(e){const t=e;["width","height"].forEach(n=>{e&&t[n]&&(/^[0-9.]+$/.test(t[n])&&(t[n]+="px"),this.parent.style[n]=t[n])})}enterFullscreen(){this.isFullscreenEnabled()||Ble(this.parent,Es.isIphone)}exitFullscreen(){this.isFullscreenEnabled()&&Sle(Es.isIphone)}toggleFullscreen(){this.isFullscreenEnabled()?this.exitFullscreen():this.enterFullscreen()}startKeyboardControl(){this.state.keyboardEnabled=!0}stopKeyboardControl(){this.state.keyboardEnabled=!1}createTooltip(e){return new AFt(this,e)}setCursor(e){this.state.cursorOverride=e,e?this.container.style.cursor=e:this.container.style.cursor=this.config.mousemove?"move":"default"}observeObjects(e){this.state.objectsObservers[e]||(this.state.objectsObservers[e]=null)}unobserveObjects(e){delete this.state.objectsObservers[e]}stopAll(){return this.dispatchEvent(new Z4),this.disableIdleTimer(),this.stopAnimation()}};Am.useNewAnglesOrder=!0;const SFt={class:"annotations-photosphere"},IFt={name:"ViewerPhotosphere",components:{Annotations:z({__name:"AnnotationsPhotosphere",setup(i){const e=mt("$viewer"),{localContext:t}=e,n=t.viewer,o=n.viewer,r=o.renderer.renderer.domElement,s=QB(),a=$e(()=>s.value.filter(u=>!n.selectedStorey||u.z>=n.selectedStorey.absoluteElevation&&u.z<n.selectedStorey.absoluteTopElevation));o.addEventListener("render",()=>rp(a));const l=(u,d)=>{const{x:h,y:f}=r.getBoundingClientRect(),{clientX:A,clientY:p}=d,m=o.dataHelper.viewerCoordsToSphericalCoords({x:A-h,y:p-f}),{textureX:g,textureY:w}=o.dataHelper.sphericalCoordsToTextureCoords(m);u.x=g,u.y=w},c=u=>{const d=o.dataHelper.textureCoordsToSphericalCoords({textureX:u.x,textureY:u.y}),h=o.dataHelper.sphericalCoordsToVector3(d),f=o.dataHelper.sphericalCoordsToViewerCoords(d),{width:A,height:p}=o.state.size;if(!(h.dot(o.state.direction)>0&&f.x>=0&&f.x<=A&&f.y>=0&&f.y<=p))return"display: none;";const{x:g,y:w}=f;return`left: ${g}px; top: ${w}px;`};return(u,d)=>(B(),O("div",SFt,[(B(!0),O(ct,null,St(a.value,h=>(B(),W(KB,{annotation:h,canvas:yt(r),style:ce(c(h)),onAnnotationDrag:f=>l(h,f)},null,8,["annotation","canvas","style","onAnnotationDrag"]))),256))]))}},[["__scopeId","data-v-fd653bd2"]])},data(){var e;const{settings:i}=this.$plugin;return{settings:i,model:null,photosphere:null,selectedStorey:null,loading:!1,modelHeaderShown:((e=this.$options.$cfg)==null?void 0:e.modelLoader)!=="hidden",annotationMode:!1,markerId:1,localContextSubscriptions:[],photoSphereViewerCreated:!1}},watch:{loading(i){i?this.$viewer.localContext.loadingProcessStart():this.$viewer.localContext.loadingProcessEnd()}},created(){this.isMounted=new Promise(i=>{this.setMounted=i})},mounted(){const i=new Am({loadingImg:null,loadingTxt:null,container:this.$refs.canvas,touchmoveTwoFingers:!0,navbar:null,defaultZoomLvl:0,rendererParameters:{alpha:!0,antialias:!0,preserveDrawingBuffer:!0}});i.renderer.renderer.preserveDrawingBuffer=!0,this.viewer=i,this.photoSphereViewerCreated=!0,this.setMounted()},unmounted(){var i;(i=this.viewer)==null||i.destroy(),this.localContextSubscriptions.forEach(e=>this.$viewer.localContext.hub.off(e))},methods:{async loadModels([i]){this.$viewer.localContext.hub.off(this.metaBuildingLocalContextSub),this.loading=!0,await this.isMounted,this.model&&this.unloadModels(),this.model=i,i.type==="PHOTOSPHERE_BUILDING"?(this.metaBuildingLocalContextSub=this.$viewer.localContext.hub.on("storey-selected",async({storey:e})=>{var t;e&&(this.photosphere=(t=e.plans[0])==null?void 0:t.plan,this.photosphere&&await this.viewer.setPanorama(this.photosphere.document.file,{transition:!1}),this.selectedStorey=e)},{getLastEvent:!0}),this.$viewer.localContext.selectStorey(i.storeys[0])):(this.photosphere=i,await this.viewer.setPanorama(i.document.file,{transition:!1})),this.loading=!1,this.$viewer.localContext.hub.emit("photosphere-model-loaded",{model:i,plugin:this}),this.$viewer.globalContext.hub.emit("photosphere-model-loaded",{model:i,plugin:this})},unloadModels(){this.$viewer.localContext.hub.emit("photosphere-model-unloaded",{model:this.model,plugin:this}),this.$viewer.globalContext.hub.emit("photosphere-model-unloaded",{model:this.model,plugin:this}),this.selectedStorey=null,this.model=null},hideUI(){[...this.$viewer.localContext.plugins.entries()].forEach(([,i])=>i.$hide()),this.modelHeaderShown=!1},showUI(){var i;[...this.$viewer.localContext.plugins.entries()].forEach(([,e])=>e.$show()),this.modelHeaderShown=((i=this.$options.$cfg)==null?void 0:i.modelLoader)!=="hidden"},async getSnapshot(){return{snapshot_type:"png",snapshot_data:this.viewer.renderer.renderer.domElement.toDataURL()}},async getViewpoint(){var o;const i=this.viewer.renderer.camera,e=this.viewer.getPosition(),{textureX:t,textureY:n}=this.viewer.dataHelper.sphericalCoordsToTextureCoords(e);return{order:6,originating_system:"photosphere",authoring_tool_id:this.photosphere?String(this.photosphere.id):void 0,models:this.$viewer.localContext.loadedModels.map(r=>r.id),perspective_camera:{camera_direction:{x:t,y:n,z:0},camera_up_vector:{x:0,y:0,z:0},camera_view_point:{x:0,y:0,z:((o=this.selectedStorey)==null?void 0:o.absoluteElevation)??0},field_of_view:i.fov}}},async setViewpoint(i){var s,a,l,c,u;const e=this.$viewer.state.getStoreyFromAbsoluteElevation(this.$viewer.localContext.loadedModels[0],(s=i==null?void 0:i.perspective_camera)==null?void 0:s.camera_view_point.z);if(e&&e.uuid!==((a=this.selectedStorey)==null?void 0:a.uuid)){this.$viewer.localContext.selectStorey(e),await new Promise(h=>this.viewer.addEventListener("panorama-loaded",h,{once:!0}));const d=(l=e.plans.find(h=>h.plan.id===+i.authoring_tool_id))==null?void 0:l.plan;d&&(this.photosphere=d,await this.viewer.setPanorama(d.document.file,{transition:!1}))}const{x:t,y:n}=((c=i==null?void 0:i.perspective_camera)==null?void 0:c.camera_direction)??{x:0,y:0};this.viewer.rotate({textureX:t,textureY:n});const o=(u=i==null?void 0:i.perspective_camera)==null?void 0:u.field_of_view,r=this.viewer.dataHelper.fovToZoomLevel(o);r&&this.viewer.zoom(r)},startAnnotationMode(i){this.annotationMode||(this.annotationMode=!0,this.annotationListener=({data:e})=>{const t=this.selectedStorey;i({x:e.textureX,y:e.textureY,z:(t==null?void 0:t.absoluteElevation)??0,models:this.$viewer.localContext.loadedModels,storey:t})},this.canvasCursor=this.viewer.renderer.renderer.domElement.style.cursor,this.viewer.renderer.renderer.domElement.style.cursor="copy",this.viewer.addEventListener("click",this.annotationListener))},stopAnnotationMode(){this.annotationMode&&(this.viewer.removeEventListener("click",this.annotationListener),this.annotationMode=!1,this.viewer.renderer.renderer.domElement.style.cursor=this.canvasCursor)}}},PFt={class:"bimdata-viewer-photosphere"},TFt={ref:"canvas",class:"bimdata-viewer-photosphere__viewer__canvas"};function kFt(i,e,t,n,o,r){const s=k("NoModelWindowPlaceHolder"),a=k("Annotations"),l=k("ModelsLoader");return B(),O("div",PFt,[b("div",TFt,null,512),!i.model&&!i.loading?(B(),W(s,{key:0})):ne("",!0),i.photoSphereViewerCreated?(B(),W(a,{key:1})):ne("",!0),i.settings.modelLoader!=="disabled"?ft((B(),W(l,{key:2,ref:"header",multi:!1},null,512)),[[qt,i.modelHeaderShown]]):ne("",!0)])}const RFt={name:"photosphere",isViewer:!0,i18n:{en:{window_label:"Photosphere Viewer"},fr:{window_label:"Visionneuse Photosphère"}},component:z(IFt,[["render",kFt],["__scopeId","data-v-6d247701"]]),window:{name:"photosphere",label:"photosphere.window_label",header:!1,plugins:["fullscreen"],icon:{imgUri:X$},modelTypes:["PHOTOSPHERE","PHOTOSPHERE_BUILDING"],multiModel:!1}},DFt={name:"photosphereBuilding",component:{setup(){const i=mt("$viewer"),e=mt("$plugin"),{apiClient:t,cloudId:n,projectId:o}=i.api,r=$e(()=>i.localContext.loadedModels[0]),s=$e(()=>i.localContext.selectedStorey),a=$e(()=>i.localContext.viewer.photosphere),l=$e(()=>{var d;return(d=s.value)==null?void 0:d.plans.find(h=>{var f;return h.plan.id===((f=a.value)==null?void 0:f.id)})});wt([r,()=>e.shown],([{type:d}={}])=>{d==="PHOTOSPHERE_BUILDING"?e.show():e.hide()},{immediate:!0});const c=d=>{r.value&&i.localContext.selectStorey(r.value.storeys.find(h=>h.uuid===d.uuid))},u=d=>{if(!d)return;const{viewer:h}=i.localContext,f=h.viewer;h.photosphere=d.plan,f.setPanorama(d.plan.document.file,{transition:!1})};return()=>Jn(vre,{apiClient:t,space:{id:n},project:{id:o},model:r.value,storey:s.value,plan:l.value,selectable:!0,onStoreySelected:c,onPlanSelected:u})}},addToWindows:["photosphere"],sidePanel:{position:"right",width:400}};function _Ft(i={}){const e=[],t=[cPt,Gvt,h8t,$Ye,vQe,PWe,xet,P8t,pGe,LWe,OYe,qrt,tGe,Xat,Yat,AEt,Ayt,byt,Y3e,hPt,U6t,tPt,XIt,myt,DGe,xEt,_Et,RFt,DFt,Z8t,fet,lQe,a7e,l7e,n4e,c7e,Q8t,zPt],n=[PMt,Hat,d$e,fGe,DSt,Aet,cQe];return t.filter(o=>i.default!==!1&&i[o.name]!==!1||i[o.name]).forEach(o=>e.push(o)),n.filter(o=>i[o.name]).forEach(o=>e.push(o)),e.forEach(o=>{o.settings=i[o.name]??{}}),new Map(e.map(o=>[o.name,o]))}var QR,Wce;function LFt(){if(Wce)return QR;Wce=1;function i(){this.__data__=[],this.size=0}return QR=i,QR}var KR,Xce;function Yce(){if(Xce)return KR;Xce=1;function i(e,t){return e===t||e!==e&&t!==t}return KR=i,KR}var JR,$ce;function mw(){if($ce)return JR;$ce=1;var i=Yce();function e(t,n){for(var o=t.length;o--;)if(i(t[o][0],n))return o;return-1}return JR=e,JR}var ZR,eue;function FFt(){if(eue)return ZR;eue=1;var i=mw(),e=Array.prototype,t=e.splice;function n(o){var r=this.__data__,s=i(r,o);if(s<0)return!1;var a=r.length-1;return s==a?r.pop():t.call(r,s,1),--this.size,!0}return ZR=n,ZR}var WR,tue;function OFt(){if(tue)return WR;tue=1;var i=mw();function e(t){var n=this.__data__,o=i(n,t);return o<0?void 0:n[o][1]}return WR=e,WR}var XR,iue;function UFt(){if(iue)return XR;iue=1;var i=mw();function e(t){return i(this.__data__,t)>-1}return XR=e,XR}var YR,nue;function NFt(){if(nue)return YR;nue=1;var i=mw();function e(t,n){var o=this.__data__,r=i(o,t);return r<0?(++this.size,o.push([t,n])):o[r][1]=n,this}return YR=e,YR}var $R,oue;function gw(){if(oue)return $R;oue=1;var i=LFt(),e=FFt(),t=OFt(),n=UFt(),o=NFt();function r(s){var a=-1,l=s==null?0:s.length;for(this.clear();++a<l;){var c=s[a];this.set(c[0],c[1])}}return r.prototype.clear=i,r.prototype.delete=e,r.prototype.get=t,r.prototype.has=n,r.prototype.set=o,$R=r,$R}var eD,sue;function VFt(){if(sue)return eD;sue=1;var i=gw();function e(){this.__data__=new i,this.size=0}return eD=e,eD}var tD,rue;function HFt(){if(rue)return tD;rue=1;function i(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}return tD=i,tD}var iD,aue;function zFt(){if(aue)return iD;aue=1;function i(e){return this.__data__.get(e)}return iD=i,iD}var nD,lue;function jFt(){if(lue)return nD;lue=1;function i(e){return this.__data__.has(e)}return nD=i,nD}var oD,cue;function i5(){if(cue)return oD;cue=1;function i(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return oD=i,oD}var sD,uue;function due(){if(uue)return sD;uue=1;var i=yg(),e=i5(),t="[object AsyncFunction]",n="[object Function]",o="[object GeneratorFunction]",r="[object Proxy]";function s(a){if(!e(a))return!1;var l=i(a);return l==n||l==o||l==t||l==r}return sD=s,sD}var rD,hue;function GFt(){if(hue)return rD;hue=1;var i=Wa(),e=i["__core-js_shared__"];return rD=e,rD}var aD,pue;function qFt(){if(pue)return aD;pue=1;var i=GFt(),e=function(){var n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function t(n){return!!e&&e in n}return aD=t,aD}var lD,fue;function Aue(){if(fue)return lD;fue=1;var i=Function.prototype,e=i.toString;function t(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return lD=t,lD}var cD,mue;function QFt(){if(mue)return cD;mue=1;var i=due(),e=qFt(),t=i5(),n=Aue(),o=/[\\^$.*+?()[\]{}|]/g,r=/^\[object .+?Constructor\]$/,s=Function.prototype,a=Object.prototype,l=s.toString,c=a.hasOwnProperty,u=RegExp("^"+l.call(c).replace(o,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(h){if(!t(h)||e(h))return!1;var f=i(h)?u:r;return f.test(n(h))}return cD=d,cD}var uD,gue;function KFt(){if(gue)return uD;gue=1;function i(e,t){return e==null?void 0:e[t]}return uD=i,uD}var dD,vue;function Hh(){if(vue)return dD;vue=1;var i=QFt(),e=KFt();function t(n,o){var r=e(n,o);return i(r)?r:void 0}return dD=t,dD}var hD,yue;function pD(){if(yue)return hD;yue=1;var i=Hh(),e=Wa(),t=i(e,"Map");return hD=t,hD}var fD,wue;function vw(){if(wue)return fD;wue=1;var i=Hh(),e=i(Object,"create");return fD=e,fD}var AD,Cue;function JFt(){if(Cue)return AD;Cue=1;var i=vw();function e(){this.__data__=i?i(null):{},this.size=0}return AD=e,AD}var mD,bue;function ZFt(){if(bue)return mD;bue=1;function i(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return mD=i,mD}var gD,xue;function WFt(){if(xue)return gD;xue=1;var i=vw(),e="__lodash_hash_undefined__",t=Object.prototype,n=t.hasOwnProperty;function o(r){var s=this.__data__;if(i){var a=s[r];return a===e?void 0:a}return n.call(s,r)?s[r]:void 0}return gD=o,gD}var vD,Mue;function XFt(){if(Mue)return vD;Mue=1;var i=vw(),e=Object.prototype,t=e.hasOwnProperty;function n(o){var r=this.__data__;return i?r[o]!==void 0:t.call(r,o)}return vD=n,vD}var yD,Eue;function YFt(){if(Eue)return yD;Eue=1;var i=vw(),e="__lodash_hash_undefined__";function t(n,o){var r=this.__data__;return this.size+=this.has(n)?0:1,r[n]=i&&o===void 0?e:o,this}return yD=t,yD}var wD,Bue;function $Ft(){if(Bue)return wD;Bue=1;var i=JFt(),e=ZFt(),t=WFt(),n=XFt(),o=YFt();function r(s){var a=-1,l=s==null?0:s.length;for(this.clear();++a<l;){var c=s[a];this.set(c[0],c[1])}}return r.prototype.clear=i,r.prototype.delete=e,r.prototype.get=t,r.prototype.has=n,r.prototype.set=o,wD=r,wD}var CD,Sue;function eOt(){if(Sue)return CD;Sue=1;var i=$Ft(),e=gw(),t=pD();function n(){this.size=0,this.__data__={hash:new i,map:new(t||e),string:new i}}return CD=n,CD}var bD,Iue;function tOt(){if(Iue)return bD;Iue=1;function i(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return bD=i,bD}var xD,Pue;function yw(){if(Pue)return xD;Pue=1;var i=tOt();function e(t,n){var o=t.__data__;return i(n)?o[typeof n=="string"?"string":"hash"]:o.map}return xD=e,xD}var MD,Tue;function iOt(){if(Tue)return MD;Tue=1;var i=yw();function e(t){var n=i(this,t).delete(t);return this.size-=n?1:0,n}return MD=e,MD}var ED,kue;function nOt(){if(kue)return ED;kue=1;var i=yw();function e(t){return i(this,t).get(t)}return ED=e,ED}var BD,Rue;function oOt(){if(Rue)return BD;Rue=1;var i=yw();function e(t){return i(this,t).has(t)}return BD=e,BD}var SD,Due;function sOt(){if(Due)return SD;Due=1;var i=yw();function e(t,n){var o=i(this,t),r=o.size;return o.set(t,n),this.size+=o.size==r?0:1,this}return SD=e,SD}var ID,_ue;function rOt(){if(_ue)return ID;_ue=1;var i=eOt(),e=iOt(),t=nOt(),n=oOt(),o=sOt();function r(s){var a=-1,l=s==null?0:s.length;for(this.clear();++a<l;){var c=s[a];this.set(c[0],c[1])}}return r.prototype.clear=i,r.prototype.delete=e,r.prototype.get=t,r.prototype.has=n,r.prototype.set=o,ID=r,ID}var PD,Lue;function aOt(){if(Lue)return PD;Lue=1;var i=gw(),e=pD(),t=rOt(),n=200;function o(r,s){var a=this.__data__;if(a instanceof i){var l=a.__data__;if(!e||l.length<n-1)return l.push([r,s]),this.size=++a.size,this;a=this.__data__=new t(l)}return a.set(r,s),this.size=a.size,this}return PD=o,PD}var TD,Fue;function lOt(){if(Fue)return TD;Fue=1;var i=gw(),e=VFt(),t=HFt(),n=zFt(),o=jFt(),r=aOt();function s(a){var l=this.__data__=new i(a);this.size=l.size}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=n,s.prototype.has=o,s.prototype.set=r,TD=s,TD}var kD,Oue;function cOt(){if(Oue)return kD;Oue=1;function i(e,t){for(var n=-1,o=e==null?0:e.length;++n<o&&t(e[n],n,e)!==!1;);return e}return kD=i,kD}var RD,Uue;function uOt(){if(Uue)return RD;Uue=1;var i=Hh(),e=function(){try{var t=i(Object,"defineProperty");return t({},"",{}),t}catch{}}();return RD=e,RD}var DD,Nue;function Vue(){if(Nue)return DD;Nue=1;var i=uOt();function e(t,n,o){n=="__proto__"&&i?i(t,n,{configurable:!0,enumerable:!0,value:o,writable:!0}):t[n]=o}return DD=e,DD}var _D,Hue;function zue(){if(Hue)return _D;Hue=1;var i=Vue(),e=Yce(),t=Object.prototype,n=t.hasOwnProperty;function o(r,s,a){var l=r[s];(!(n.call(r,s)&&e(l,a))||a===void 0&&!(s in r))&&i(r,s,a)}return _D=o,_D}var LD,jue;function ww(){if(jue)return LD;jue=1;var i=zue(),e=Vue();function t(n,o,r,s){var a=!r;r||(r={});for(var l=-1,c=o.length;++l<c;){var u=o[l],d=s?s(r[u],n[u],u,r,n):void 0;d===void 0&&(d=n[u]),a?e(r,u,d):i(r,u,d)}return r}return LD=t,LD}var FD,Gue;function dOt(){if(Gue)return FD;Gue=1;function i(e,t){for(var n=-1,o=Array(e);++n<e;)o[n]=t(n);return o}return FD=i,FD}var OD,que;function hOt(){if(que)return OD;que=1;var i=yg(),e=Ip(),t="[object Arguments]";function n(o){return e(o)&&i(o)==t}return OD=n,OD}var UD,Que;function pOt(){if(Que)return UD;Que=1;var i=hOt(),e=Ip(),t=Object.prototype,n=t.hasOwnProperty,o=t.propertyIsEnumerable,r=i(function(){return arguments}())?i:function(s){return e(s)&&n.call(s,"callee")&&!o.call(s,"callee")};return UD=r,UD}var n5={exports:{}},ND,Kue;function fOt(){if(Kue)return ND;Kue=1;function i(){return!1}return ND=i,ND}n5.exports;var Jue;function Zue(){return Jue||(Jue=1,function(i,e){var t=Wa(),n=fOt(),o=e&&!e.nodeType&&e,r=o&&!0&&i&&!i.nodeType&&i,s=r&&r.exports===o,a=s?t.Buffer:void 0,l=a?a.isBuffer:void 0,c=l||n;i.exports=c}(n5,n5.exports)),n5.exports}var VD,Wue;function AOt(){if(Wue)return VD;Wue=1;var i=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(n,o){var r=typeof n;return o=o??i,!!o&&(r=="number"||r!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<o}return VD=t,VD}var HD,Xue;function Yue(){if(Xue)return HD;Xue=1;var i=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=i}return HD=e,HD}var zD,$ue;function mOt(){if($ue)return zD;$ue=1;var i=yg(),e=Yue(),t=Ip(),n="[object Arguments]",o="[object Array]",r="[object Boolean]",s="[object Date]",a="[object Error]",l="[object Function]",c="[object Map]",u="[object Number]",d="[object Object]",h="[object RegExp]",f="[object Set]",A="[object String]",p="[object WeakMap]",m="[object ArrayBuffer]",g="[object DataView]",w="[object Float32Array]",y="[object Float64Array]",v="[object Int8Array]",x="[object Int16Array]",M="[object Int32Array]",E="[object Uint8Array]",S="[object Uint8ClampedArray]",T="[object Uint16Array]",P="[object Uint32Array]",I={};I[w]=I[y]=I[v]=I[x]=I[M]=I[E]=I[S]=I[T]=I[P]=!0,I[n]=I[o]=I[m]=I[r]=I[g]=I[s]=I[a]=I[l]=I[c]=I[u]=I[d]=I[h]=I[f]=I[A]=I[p]=!1;function R(L){return t(L)&&e(L.length)&&!!I[i(L)]}return zD=R,zD}var jD,ede;function GD(){if(ede)return jD;ede=1;function i(e){return function(t){return e(t)}}return jD=i,jD}var o5={exports:{}};o5.exports;var tde;function qD(){return tde||(tde=1,function(i,e){var t=cz(),n=e&&!e.nodeType&&e,o=n&&!0&&i&&!i.nodeType&&i,r=o&&o.exports===n,s=r&&t.process,a=function(){try{var l=o&&o.require&&o.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}}();i.exports=a}(o5,o5.exports)),o5.exports}var QD,ide;function gOt(){if(ide)return QD;ide=1;var i=mOt(),e=GD(),t=qD(),n=t&&t.isTypedArray,o=n?e(n):i;return QD=o,QD}var KD,nde;function ode(){if(nde)return KD;nde=1;var i=dOt(),e=pOt(),t=I8(),n=Zue(),o=AOt(),r=gOt(),s=Object.prototype,a=s.hasOwnProperty;function l(c,u){var d=t(c),h=!d&&e(c),f=!d&&!h&&n(c),A=!d&&!h&&!f&&r(c),p=d||h||f||A,m=p?i(c.length,String):[],g=m.length;for(var w in c)(u||a.call(c,w))&&!(p&&(w=="length"||f&&(w=="offset"||w=="parent")||A&&(w=="buffer"||w=="byteLength"||w=="byteOffset")||o(w,g)))&&m.push(w);return m}return KD=l,KD}var JD,sde;function ZD(){if(sde)return JD;sde=1;var i=Object.prototype;function e(t){var n=t&&t.constructor,o=typeof n=="function"&&n.prototype||i;return t===o}return JD=e,JD}var WD,rde;function ade(){if(rde)return WD;rde=1;function i(e,t){return function(n){return e(t(n))}}return WD=i,WD}var XD,lde;function vOt(){if(lde)return XD;lde=1;var i=ade(),e=i(Object.keys,Object);return XD=e,XD}var YD,cde;function yOt(){if(cde)return YD;cde=1;var i=ZD(),e=vOt(),t=Object.prototype,n=t.hasOwnProperty;function o(r){if(!i(r))return e(r);var s=[];for(var a in Object(r))n.call(r,a)&&a!="constructor"&&s.push(a);return s}return YD=o,YD}var $D,ude;function dde(){if(ude)return $D;ude=1;var i=due(),e=Yue();function t(n){return n!=null&&e(n.length)&&!i(n)}return $D=t,$D}var e_,hde;function t_(){if(hde)return e_;hde=1;var i=ode(),e=yOt(),t=dde();function n(o){return t(o)?i(o):e(o)}return e_=n,e_}var i_,pde;function wOt(){if(pde)return i_;pde=1;var i=ww(),e=t_();function t(n,o){return n&&i(o,e(o),n)}return i_=t,i_}var n_,fde;function COt(){if(fde)return n_;fde=1;function i(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}return n_=i,n_}var o_,Ade;function bOt(){if(Ade)return o_;Ade=1;var i=i5(),e=ZD(),t=COt(),n=Object.prototype,o=n.hasOwnProperty;function r(s){if(!i(s))return t(s);var a=e(s),l=[];for(var c in s)c=="constructor"&&(a||!o.call(s,c))||l.push(c);return l}return o_=r,o_}var s_,mde;function r_(){if(mde)return s_;mde=1;var i=ode(),e=bOt(),t=dde();function n(o){return t(o)?i(o,!0):e(o)}return s_=n,s_}var a_,gde;function xOt(){if(gde)return a_;gde=1;var i=ww(),e=r_();function t(n,o){return n&&i(o,e(o),n)}return a_=t,a_}var s5={exports:{}};s5.exports;var vde;function MOt(){return vde||(vde=1,function(i,e){var t=Wa(),n=e&&!e.nodeType&&e,o=n&&!0&&i&&!i.nodeType&&i,r=o&&o.exports===n,s=r?t.Buffer:void 0,a=s?s.allocUnsafe:void 0;function l(c,u){if(u)return c.slice();var d=c.length,h=a?a(d):new c.constructor(d);return c.copy(h),h}i.exports=l}(s5,s5.exports)),s5.exports}var l_,yde;function EOt(){if(yde)return l_;yde=1;function i(e,t){var n=-1,o=e.length;for(t||(t=Array(o));++n<o;)t[n]=e[n];return t}return l_=i,l_}var c_,wde;function BOt(){if(wde)return c_;wde=1;function i(e,t){for(var n=-1,o=e==null?0:e.length,r=0,s=[];++n<o;){var a=e[n];t(a,n,e)&&(s[r++]=a)}return s}return c_=i,c_}var u_,Cde;function bde(){if(Cde)return u_;Cde=1;function i(){return[]}return u_=i,u_}var d_,xde;function h_(){if(xde)return d_;xde=1;var i=BOt(),e=bde(),t=Object.prototype,n=t.propertyIsEnumerable,o=Object.getOwnPropertySymbols,r=o?function(s){return s==null?[]:(s=Object(s),i(o(s),function(a){return n.call(s,a)}))}:e;return d_=r,d_}var p_,Mde;function SOt(){if(Mde)return p_;Mde=1;var i=ww(),e=h_();function t(n,o){return i(n,e(n),o)}return p_=t,p_}var f_,Ede;function Bde(){if(Ede)return f_;Ede=1;function i(e,t){for(var n=-1,o=t.length,r=e.length;++n<o;)e[r+n]=t[n];return e}return f_=i,f_}var A_,Sde;function Ide(){if(Sde)return A_;Sde=1;var i=ade(),e=i(Object.getPrototypeOf,Object);return A_=e,A_}var m_,Pde;function Tde(){if(Pde)return m_;Pde=1;var i=Bde(),e=Ide(),t=h_(),n=bde(),o=Object.getOwnPropertySymbols,r=o?function(s){for(var a=[];s;)i(a,t(s)),s=e(s);return a}:n;return m_=r,m_}var g_,kde;function IOt(){if(kde)return g_;kde=1;var i=ww(),e=Tde();function t(n,o){return i(n,e(n),o)}return g_=t,g_}var v_,Rde;function Dde(){if(Rde)return v_;Rde=1;var i=Bde(),e=I8();function t(n,o,r){var s=o(n);return e(n)?s:i(s,r(n))}return v_=t,v_}var y_,_de;function POt(){if(_de)return y_;_de=1;var i=Dde(),e=h_(),t=t_();function n(o){return i(o,t,e)}return y_=n,y_}var w_,Lde;function TOt(){if(Lde)return w_;Lde=1;var i=Dde(),e=Tde(),t=r_();function n(o){return i(o,t,e)}return w_=n,w_}var C_,Fde;function kOt(){if(Fde)return C_;Fde=1;var i=Hh(),e=Wa(),t=i(e,"DataView");return C_=t,C_}var b_,Ode;function ROt(){if(Ode)return b_;Ode=1;var i=Hh(),e=Wa(),t=i(e,"Promise");return b_=t,b_}var x_,Ude;function DOt(){if(Ude)return x_;Ude=1;var i=Hh(),e=Wa(),t=i(e,"Set");return x_=t,x_}var M_,Nde;function _Ot(){if(Nde)return M_;Nde=1;var i=Hh(),e=Wa(),t=i(e,"WeakMap");return M_=t,M_}var E_,Vde;function B_(){if(Vde)return E_;Vde=1;var i=kOt(),e=pD(),t=ROt(),n=DOt(),o=_Ot(),r=yg(),s=Aue(),a="[object Map]",l="[object Object]",c="[object Promise]",u="[object Set]",d="[object WeakMap]",h="[object DataView]",f=s(i),A=s(e),p=s(t),m=s(n),g=s(o),w=r;return(i&&w(new i(new ArrayBuffer(1)))!=h||e&&w(new e)!=a||t&&w(t.resolve())!=c||n&&w(new n)!=u||o&&w(new o)!=d)&&(w=function(y){var v=r(y),x=v==l?y.constructor:void 0,M=x?s(x):"";if(M)switch(M){case f:return h;case A:return a;case p:return c;case m:return u;case g:return d}return v}),E_=w,E_}var S_,Hde;function LOt(){if(Hde)return S_;Hde=1;var i=Object.prototype,e=i.hasOwnProperty;function t(n){var o=n.length,r=new n.constructor(o);return o&&typeof n[0]=="string"&&e.call(n,"index")&&(r.index=n.index,r.input=n.input),r}return S_=t,S_}var I_,zde;function FOt(){if(zde)return I_;zde=1;var i=Wa(),e=i.Uint8Array;return I_=e,I_}var P_,jde;function T_(){if(jde)return P_;jde=1;var i=FOt();function e(t){var n=new t.constructor(t.byteLength);return new i(n).set(new i(t)),n}return P_=e,P_}var k_,Gde;function OOt(){if(Gde)return k_;Gde=1;var i=T_();function e(t,n){var o=n?i(t.buffer):t.buffer;return new t.constructor(o,t.byteOffset,t.byteLength)}return k_=e,k_}var R_,qde;function UOt(){if(qde)return R_;qde=1;var i=/\w*$/;function e(t){var n=new t.constructor(t.source,i.exec(t));return n.lastIndex=t.lastIndex,n}return R_=e,R_}var D_,Qde;function NOt(){if(Qde)return D_;Qde=1;var i=S8(),e=i?i.prototype:void 0,t=e?e.valueOf:void 0;function n(o){return t?Object(t.call(o)):{}}return D_=n,D_}var __,Kde;function VOt(){if(Kde)return __;Kde=1;var i=T_();function e(t,n){var o=n?i(t.buffer):t.buffer;return new t.constructor(o,t.byteOffset,t.length)}return __=e,__}var L_,Jde;function HOt(){if(Jde)return L_;Jde=1;var i=T_(),e=OOt(),t=UOt(),n=NOt(),o=VOt(),r="[object Boolean]",s="[object Date]",a="[object Map]",l="[object Number]",c="[object RegExp]",u="[object Set]",d="[object String]",h="[object Symbol]",f="[object ArrayBuffer]",A="[object DataView]",p="[object Float32Array]",m="[object Float64Array]",g="[object Int8Array]",w="[object Int16Array]",y="[object Int32Array]",v="[object Uint8Array]",x="[object Uint8ClampedArray]",M="[object Uint16Array]",E="[object Uint32Array]";function S(T,P,I){var R=T.constructor;switch(P){case f:return i(T);case r:case s:return new R(+T);case A:return e(T,I);case p:case m:case g:case w:case y:case v:case x:case M:case E:return o(T,I);case a:return new R;case l:case d:return new R(T);case c:return t(T);case u:return new R;case h:return n(T)}}return L_=S,L_}var F_,Zde;function zOt(){if(Zde)return F_;Zde=1;var i=i5(),e=Object.create,t=function(){function n(){}return function(o){if(!i(o))return{};if(e)return e(o);n.prototype=o;var r=new n;return n.prototype=void 0,r}}();return F_=t,F_}var O_,Wde;function jOt(){if(Wde)return O_;Wde=1;var i=zOt(),e=Ide(),t=ZD();function n(o){return typeof o.constructor=="function"&&!t(o)?i(e(o)):{}}return O_=n,O_}var U_,Xde;function GOt(){if(Xde)return U_;Xde=1;var i=B_(),e=Ip(),t="[object Map]";function n(o){return e(o)&&i(o)==t}return U_=n,U_}var N_,Yde;function qOt(){if(Yde)return N_;Yde=1;var i=GOt(),e=GD(),t=qD(),n=t&&t.isMap,o=n?e(n):i;return N_=o,N_}var V_,$de;function QOt(){if($de)return V_;$de=1;var i=B_(),e=Ip(),t="[object Set]";function n(o){return e(o)&&i(o)==t}return V_=n,V_}var H_,ehe;function KOt(){if(ehe)return H_;ehe=1;var i=QOt(),e=GD(),t=qD(),n=t&&t.isSet,o=n?e(n):i;return H_=o,H_}var z_,the;function JOt(){if(the)return z_;the=1;var i=lOt(),e=cOt(),t=zue(),n=wOt(),o=xOt(),r=MOt(),s=EOt(),a=SOt(),l=IOt(),c=POt(),u=TOt(),d=B_(),h=LOt(),f=HOt(),A=jOt(),p=I8(),m=Zue(),g=qOt(),w=i5(),y=KOt(),v=t_(),x=r_(),M=1,E=2,S=4,T="[object Arguments]",P="[object Array]",I="[object Boolean]",R="[object Date]",L="[object Error]",U="[object Function]",H="[object GeneratorFunction]",N="[object Map]",Q="[object Number]",J="[object Object]",te="[object RegExp]",le="[object Set]",Se="[object String]",Ee="[object Symbol]",Ne="[object WeakMap]",Ce="[object ArrayBuffer]",Pe="[object DataView]",Ue="[object Float32Array]",ae="[object Float64Array]",Re="[object Int8Array]",ve="[object Int16Array]",De="[object Int32Array]",Xe="[object Uint8Array]",Ze="[object Uint8ClampedArray]",G="[object Uint16Array]",se="[object Uint32Array]",ie={};ie[T]=ie[P]=ie[Ce]=ie[Pe]=ie[I]=ie[R]=ie[Ue]=ie[ae]=ie[Re]=ie[ve]=ie[De]=ie[N]=ie[Q]=ie[J]=ie[te]=ie[le]=ie[Se]=ie[Ee]=ie[Xe]=ie[Ze]=ie[G]=ie[se]=!0,ie[L]=ie[U]=ie[Ne]=!1;function Ie(me,Z,X,q,j,ee){var fe,$=Z&M,re=Z&E,be=Z&S;if(X&&(fe=j?X(me,q,j,ee):X(me)),fe!==void 0)return fe;if(!w(me))return me;var ge=p(me);if(ge){if(fe=h(me),!$)return s(me,fe)}else{var _e=d(me),Ye=_e==U||_e==H;if(m(me))return r(me,$);if(_e==J||_e==T||Ye&&!j){if(fe=re||Ye?{}:A(me),!$)return re?l(me,o(fe,me)):a(me,n(fe,me))}else{if(!ie[_e])return j?me:{};fe=f(me,_e,$)}}ee||(ee=new i);var de=ee.get(me);if(de)return de;ee.set(me,fe),y(me)?me.forEach(function(ke){fe.add(Ie(ke,Z,X,ke,me,ee))}):g(me)&&me.forEach(function(ke,xe){fe.set(xe,Ie(ke,Z,X,xe,me,ee))});var rt=be?re?u:c:re?x:v,dt=ge?void 0:rt(me);return e(dt||me,function(ke,xe){dt&&(xe=ke,ke=me[xe]),t(fe,xe,Ie(ke,Z,X,xe,me,ee))}),fe}return z_=Ie,z_}var j_,ihe;function ZOt(){if(ihe)return j_;ihe=1;var i=JOt(),e=1,t=4;function n(o){return i(o,e|t)}return j_=n,j_}var WOt=ZOt();const XOt=fg(WOt);class YOt{constructor(e={}){const{name:t,isViewer:n=!1,i18nTokenPrefix:o=null,i18n:r=null,addToWindows:s=[],window:a=null,component:l=null,initiallyShown:c=!0,button:u=null,sidePanel:d=null,startupScript:h=null,settings:f={},...A}=e;if(!t)throw new TypeError("Plugin must have a name.");A&&Object.assign(this,A),this.name=t,this.isViewer=n,this.i18nTokenPrefix=o,this.i18n=r,this.addToWindows=s,this.window=a,this.component=l,this.initiallyShown=c,u?this.button=new $Ot(u):d&&(this.sidePanel=new eUt(d)),this.startupScript=h,this.settings=f}}class $Ot{constructor(e={}){const{position:t="left",stance:n=0,tooltip:o,content:r="free",keepOpen:s,icon:a,iconOpen:l,initiallyOpen:c=!1}=e;this.position=t,this.stance=n,this.tooltip=o,this.content=r,this.keepOpen=s,this.icon=a,this.iconOpen=l,this.initiallyOpen=c}}class eUt{constructor(e={}){const{position:t="left",width:n=300}=e;this.position=t,this.width=n}}let tUt=0;class iUt extends YOt{constructor(e={},t){var n;super(XOt(e)),this.localContext=t,this.id=tUt++,this._shown=we(this.initiallyShown),this._isOpen=we(((n=this.button)==null?void 0:n.initiallyOpen)??!1),this._loading=we(!1),this._componentInstance=we(null),this.button&&(this._buttonText=we(this.button.text)),this.sidePanel&&(this._sidePanelWidth=we(Number.isFinite(this.sidePanel.width)?this.sidePanel.width:300))}get sidePanelWidth(){var e;return(e=this._sidePanelWidth)==null?void 0:e.value}set sidePanelWidth(e=300){if(this._sidePanelWidth){if(!Number.isFinite(e))throw new TypeError("[BIMDataViewer - PluginInstance] sidePanelWidth must be a finite number.");this._sidePanelWidth.value=e}}get shown(){return this._shown.value}show(){this._shown.value=!0}hide(){this._shown.value=!1}get loading(){return this._loading.value}async open(...e){this.isOpen||(await this._onOpenOrClose("open",...e),this._isOpen.value=!0,this.localContext.hub.emit("plugin-open",{name:this.name,plugin:this.componentInstance}),this.localContext.$viewer.globalContext.hub.emit("plugin-open",{name:this.name,plugin:this.componentInstance}))}async close(...e){this.isOpen&&(await this._onOpenOrClose("close",...e),this._isOpen.value=!1,this.localContext.hub.emit("plugin-close",{name:this.name,plugin:this.componentInstance}),this.localContext.$viewer.globalContext.hub.emit("plugin-close",{name:this.name,plugin:this.componentInstance}))}get isOpen(){return this._isOpen.value}_onOpenOrClose(e,...t){if(!this.component){console.warn(`Plugin ${this.name} does not have a component. It cannot be opened or closed.`);return}if(this.loading){console.log(`Plugin ${this.name} is loading. It cannot be opened or closed.`);return}if(typeof this.component[`on${bu(e)}`]!="function")return;const n=this.component[`on${bu(e)}`].call(this.componentInstance,...t);return typeof(n==null?void 0:n.then)=="function"?(this._loading.value=!0,n.then(()=>{this._loading.value=!1})):n}get componentInstance(){return this._componentInstance.value}set componentInstance(e){this._componentInstance.value=e}get buttonText(){return this._buttonText.value}set buttonText(e){this._buttonText.value=e}}class nUt{constructor(e={}){this.registeredPlugins=e!==!1?_Ft(e):new Map,this.cfg=e}getPluginInstance(e,t){return this.registeredPlugins.has(e)?new iUt(this.registeredPlugins.get(e),t):(console.warn(`No plugin with name "${e}". You must register it before accessing it.`),null)}runPluginsScripts(e){this.registeredPlugins.forEach(t=>{var n;try{(n=t.startupScript)==null||n.call(t,e)}catch(o){console.error(`[Viewer] Failed to execute startupScript of plugin ${t.name}.`,o)}})}registerPlugin(e){if(this.registeredPlugins.has(e.name)&&console.warn(`[BIMDataViewer - PluginManager:registerPlugin] Plugin with name "${e.name}" is already registered. It will be overwritten.`),e.button&&e.sidePanel)throw new TypeError(`[BIMDataViewer - PluginManager:registerPlugin] Plugin "${e.name}" has both a button and a side panel. You should choose one or the other.`);this.registeredPlugins.set(e.name,e)}get pluginTranslations(){const e={};return this.registeredPlugins.forEach(t=>{if(t.i18n){const n=t.i18nTokenPrefix||t.name;Object.keys(t.i18n).forEach(o=>{e[o]||(e[o]={}),e[o][n]=t.i18n[o]})}}),e}}class oUt{constructor({name:e,label:t,plugins:n=[],header:o=!0,icon:r,modelTypes:s=[],multiModel:a=!0,logoAndVersion:l=!1,defaultWindow:c=!1,displayedInWindowSelector:u=!0,noModel:d=!1}){this.name=e,this.label=t,this.plugins=n,this.header=o,this.icon=r,this.modelTypes=s,this.multiModel=a,this.logoAndVersion=l,this.default=c,this.displayedInWindowSelector=u,this.noModel=d}}class sUt{constructor(){this.registeredWindows=new Map,this.defaultWindow=null,this.windowContainers=Ls([])}registerWindow(e){var n,o,r;if(!e)throw new TypeError("registerWindow - window is required.");if(e.plugins||(e.plugins=[]),!(typeof e.name=="string"&&((o=(n=e.plugins)==null?void 0:n.every)!=null&&o.call(n,s=>typeof s=="string"))))throw new TypeError("registerWindow - Windows must have a name as string and window.plugins must be an array of plugin names as string.");if(this.registeredWindows.has(e.name))throw new Error(`A window with the name ${e.name} already exist. It must be unique.`);const t=new oUt({name:e.name,label:e.label,plugins:[...e.plugins],header:e.header,icon:{imgUri:(r=e.icon)==null?void 0:r.imgUri},modelTypes:e.modelTypes,multiModel:e.multiModel??!0,logoAndVersion:e.logoAndVersion,defaultWindow:e.defaultWindow,displayedInWindowSelector:e.displayedInWindowSelector??!0,noModel:e.noModel??!1});return this.registeredWindows.set(t.name,t),t.default&&(this.defaultWindow&&(console.warn(`A window with the name ${this.defaultWindow.name} was already set as default and will be replaced by ${t.name}.`),this.defaultWindow.default=!1),this.defaultWindow=t),t}unregisterWindow(e){return this.registeredWindows.delete(e)}registerAndAddPluginsToWindows(e=[]){e.filter(t=>t.window&&!this.registeredWindows.has(t.window)).forEach(t=>{this.registerWindow(t.window).plugins.unshift(t.name)}),e.filter(t=>{var n;return((n=t.addToWindows)==null?void 0:n.length)>0}).forEach(t=>{t.addToWindows.forEach(n=>{const o=this.registeredWindows.get(n);o?o.plugins.push(t.name):console.warn(`[Viewer] Plugin with name ${t.name} can not be added to the window ${n} because it is not registered.`)})})}}const r5=15,G_=30,q_=19,rUt=29,Cw=256,Q_=Cw+1+rUt,nhe=2*Q_+1,a5=256,aUt=7,ohe=16,she=17,rhe=18,K_=8*2,bw=-1,lUt=1,xw=2,cUt=0,mm=0,ahe=1,uUt=3,er=4,Ra=0,lhe=1,Mw=2,Da=-2,dUt=-3,gm=-5;function Ew(i){return Bw(i.map(([e,t])=>new Array(e).fill(t,0,e)))}function Bw(i){return i.reduce((e,t)=>e.concat(Array.isArray(t)?Bw(t):t),[])}const che=[0,1,2,3].concat(...Ew([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function bn(){const i=this;function e(o){const r=i.dyn_tree,s=i.stat_desc.static_tree,a=i.stat_desc.extra_bits,l=i.stat_desc.extra_base,c=i.stat_desc.max_length;let u,d,h,f,A,p,m=0;for(f=0;f<=r5;f++)o.bl_count[f]=0;for(r[o.heap[o.heap_max]*2+1]=0,u=o.heap_max+1;u<nhe;u++)d=o.heap[u],f=r[r[d*2+1]*2+1]+1,f>c&&(f=c,m++),r[d*2+1]=f,!(d>i.max_code)&&(o.bl_count[f]++,A=0,d>=l&&(A=a[d-l]),p=r[d*2],o.opt_len+=p*(f+A),s&&(o.static_len+=p*(s[d*2+1]+A)));if(m!==0){do{for(f=c-1;o.bl_count[f]===0;)f--;o.bl_count[f]--,o.bl_count[f+1]+=2,o.bl_count[c]--,m-=2}while(m>0);for(f=c;f!==0;f--)for(d=o.bl_count[f];d!==0;)h=o.heap[--u],!(h>i.max_code)&&(r[h*2+1]!=f&&(o.opt_len+=(f-r[h*2+1])*r[h*2],r[h*2+1]=f),d--)}}function t(o,r){let s=0;do s|=o&1,o>>>=1,s<<=1;while(--r>0);return s>>>1}function n(o,r,s){const a=[];let l=0,c,u,d;for(c=1;c<=r5;c++)a[c]=l=l+s[c-1]<<1;for(u=0;u<=r;u++)d=o[u*2+1],d!==0&&(o[u*2]=t(a[d]++,d))}i.build_tree=function(o){const r=i.dyn_tree,s=i.stat_desc.static_tree,a=i.stat_desc.elems;let l,c,u=-1,d;for(o.heap_len=0,o.heap_max=nhe,l=0;l<a;l++)r[l*2]!==0?(o.heap[++o.heap_len]=u=l,o.depth[l]=0):r[l*2+1]=0;for(;o.heap_len<2;)d=o.heap[++o.heap_len]=u<2?++u:0,r[d*2]=1,o.depth[d]=0,o.opt_len--,s&&(o.static_len-=s[d*2+1]);for(i.max_code=u,l=Math.floor(o.heap_len/2);l>=1;l--)o.pqdownheap(r,l);d=a;do l=o.heap[1],o.heap[1]=o.heap[o.heap_len--],o.pqdownheap(r,1),c=o.heap[1],o.heap[--o.heap_max]=l,o.heap[--o.heap_max]=c,r[d*2]=r[l*2]+r[c*2],o.depth[d]=Math.max(o.depth[l],o.depth[c])+1,r[l*2+1]=r[c*2+1]=d,o.heap[1]=d++,o.pqdownheap(r,1);while(o.heap_len>=2);o.heap[--o.heap_max]=o.heap[1],e(o),n(r,i.max_code,o.bl_count)}}bn._length_code=[0,1,2,3,4,5,6,7].concat(...Ew([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]])),bn.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0],bn.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576],bn.d_code=function(i){return i<256?che[i]:che[256+(i>>>7)]},bn.extra_lbits=[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],bn.extra_dbits=[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],bn.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],bn.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function Ho(i,e,t,n,o){const r=this;r.static_tree=i,r.extra_bits=e,r.extra_base=t,r.elems=n,r.max_length=o}const hUt=[12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227],pUt=Ew([[144,8],[112,9],[24,7],[8,8]]);Ho.static_ltree=Bw(hUt.map((i,e)=>[i,pUt[e]]));const fUt=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23],AUt=Ew([[30,5]]);Ho.static_dtree=Bw(fUt.map((i,e)=>[i,AUt[e]])),Ho.static_l_desc=new Ho(Ho.static_ltree,bn.extra_lbits,Cw+1,Q_,r5),Ho.static_d_desc=new Ho(Ho.static_dtree,bn.extra_dbits,0,G_,r5),Ho.static_bl_desc=new Ho(null,bn.extra_blbits,0,q_,aUt);const mUt=9,gUt=8;function El(i,e,t,n,o){const r=this;r.good_length=i,r.max_lazy=e,r.nice_length=t,r.max_chain=n,r.func=o}const uhe=0,Sw=1,zh=2,_a=[new El(0,0,0,0,uhe),new El(4,4,8,4,Sw),new El(4,5,16,8,Sw),new El(4,6,32,32,Sw),new El(4,4,16,16,zh),new El(8,16,32,32,zh),new El(8,16,128,128,zh),new El(8,32,128,256,zh),new El(32,128,258,1024,zh),new El(32,258,258,4096,zh)],Iw=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],ta=0,Pw=1,l5=2,Tw=3,vUt=32,J_=42,kw=113,c5=666,Z_=8,yUt=0,W_=1,wUt=2,Rn=3,Rw=258,Ir=Rw+Rn+1;function dhe(i,e,t,n){const o=i[e*2],r=i[t*2];return o<r||o==r&&n[e]<=n[t]}function CUt(){const i=this;let e,t,n,o,r,s,a,l,c,u,d,h,f,A,p,m,g,w,y,v,x,M,E,S,T,P,I,R,L,U,H,N,Q;const J=new bn,te=new bn,le=new bn;i.depth=[];let Se,Ee,Ne,Ce,Pe,Ue;i.bl_count=[],i.heap=[],H=[],N=[],Q=[];function ae(){c=2*r,d[f-1]=0;for(let xe=0;xe<f-1;xe++)d[xe]=0;P=_a[I].max_lazy,L=_a[I].good_length,U=_a[I].nice_length,T=_a[I].max_chain,x=0,g=0,E=0,w=S=Rn-1,v=0,h=0}function Re(){let xe;for(xe=0;xe<Q_;xe++)H[xe*2]=0;for(xe=0;xe<G_;xe++)N[xe*2]=0;for(xe=0;xe<q_;xe++)Q[xe*2]=0;H[a5*2]=1,i.opt_len=i.static_len=0,Ee=Ne=0}function ve(){J.dyn_tree=H,J.stat_desc=Ho.static_l_desc,te.dyn_tree=N,te.stat_desc=Ho.static_d_desc,le.dyn_tree=Q,le.stat_desc=Ho.static_bl_desc,Pe=0,Ue=0,Ce=8,Re()}i.pqdownheap=function(xe,je){const Le=i.heap,Ke=Le[je];let he=je<<1;for(;he<=i.heap_len&&(he<i.heap_len&&dhe(xe,Le[he+1],Le[he],i.depth)&&he++,!dhe(xe,Ke,Le[he],i.depth));)Le[je]=Le[he],je=he,he<<=1;Le[je]=Ke};function De(xe,je){let Le=-1,Ke,he=xe[0*2+1],et=0,Me=7,qe=4;he===0&&(Me=138,qe=3),xe[(je+1)*2+1]=65535;for(let st=0;st<=je;st++)Ke=he,he=xe[(st+1)*2+1],!(++et<Me&&Ke==he)&&(et<qe?Q[Ke*2]+=et:Ke!==0?(Ke!=Le&&Q[Ke*2]++,Q[ohe*2]++):et<=10?Q[she*2]++:Q[rhe*2]++,et=0,Le=Ke,he===0?(Me=138,qe=3):Ke==he?(Me=6,qe=3):(Me=7,qe=4))}function Xe(){let xe;for(De(H,J.max_code),De(N,te.max_code),le.build_tree(i),xe=q_-1;xe>=3&&Q[bn.bl_order[xe]*2+1]===0;xe--);return i.opt_len+=3*(xe+1)+5+5+4,xe}function Ze(xe){i.pending_buf[i.pending++]=xe}function G(xe){Ze(xe&255),Ze(xe>>>8&255)}function se(xe){Ze(xe>>8&255),Ze(xe&255&255)}function ie(xe,je){let Le;const Ke=je;Ue>K_-Ke?(Le=xe,Pe|=Le<<Ue&65535,G(Pe),Pe=Le>>>K_-Ue,Ue+=Ke-K_):(Pe|=xe<<Ue&65535,Ue+=Ke)}function Ie(xe,je){const Le=xe*2;ie(je[Le]&65535,je[Le+1]&65535)}function me(xe,je){let Le,Ke=-1,he,et=xe[0*2+1],Me=0,qe=7,st=4;for(et===0&&(qe=138,st=3),Le=0;Le<=je;Le++)if(he=et,et=xe[(Le+1)*2+1],!(++Me<qe&&he==et)){if(Me<st)do Ie(he,Q);while(--Me!==0);else he!==0?(he!=Ke&&(Ie(he,Q),Me--),Ie(ohe,Q),ie(Me-3,2)):Me<=10?(Ie(she,Q),ie(Me-3,3)):(Ie(rhe,Q),ie(Me-11,7));Me=0,Ke=he,et===0?(qe=138,st=3):he==et?(qe=6,st=3):(qe=7,st=4)}}function Z(xe,je,Le){let Ke;for(ie(xe-257,5),ie(je-1,5),ie(Le-4,4),Ke=0;Ke<Le;Ke++)ie(Q[bn.bl_order[Ke]*2+1],3);me(H,xe-1),me(N,je-1)}function X(){Ue==16?(G(Pe),Pe=0,Ue=0):Ue>=8&&(Ze(Pe&255),Pe>>>=8,Ue-=8)}function q(){ie(W_<<1,3),Ie(a5,Ho.static_ltree),X(),1+Ce+10-Ue<9&&(ie(W_<<1,3),Ie(a5,Ho.static_ltree),X()),Ce=7}function j(xe,je){let Le,Ke,he;if(i.dist_buf[Ee]=xe,i.lc_buf[Ee]=je&255,Ee++,xe===0?H[je*2]++:(Ne++,xe--,H[(bn._length_code[je]+Cw+1)*2]++,N[bn.d_code(xe)*2]++),!(Ee&8191)&&I>2){for(Le=Ee*8,Ke=x-g,he=0;he<G_;he++)Le+=N[he*2]*(5+bn.extra_dbits[he]);if(Le>>>=3,Ne<Math.floor(Ee/2)&&Le<Math.floor(Ke/2))return!0}return Ee==Se-1}function ee(xe,je){let Le,Ke,he=0,et,Me;if(Ee!==0)do Le=i.dist_buf[he],Ke=i.lc_buf[he],he++,Le===0?Ie(Ke,xe):(et=bn._length_code[Ke],Ie(et+Cw+1,xe),Me=bn.extra_lbits[et],Me!==0&&(Ke-=bn.base_length[et],ie(Ke,Me)),Le--,et=bn.d_code(Le),Ie(et,je),Me=bn.extra_dbits[et],Me!==0&&(Le-=bn.base_dist[et],ie(Le,Me)));while(he<Ee);Ie(a5,xe),Ce=xe[a5*2+1]}function fe(){Ue>8?G(Pe):Ue>0&&Ze(Pe&255),Pe=0,Ue=0}function $(xe,je,Le){fe(),Ce=8,G(je),G(~je),i.pending_buf.set(l.subarray(xe,xe+je),i.pending),i.pending+=je}function re(xe,je,Le){ie((yUt<<1)+(Le?1:0),3),$(xe,je)}function be(xe,je,Le){let Ke,he,et=0;I>0?(J.build_tree(i),te.build_tree(i),et=Xe(),Ke=i.opt_len+3+7>>>3,he=i.static_len+3+7>>>3,he<=Ke&&(Ke=he)):Ke=he=je+5,je+4<=Ke&&xe!=-1?re(xe,je,Le):he==Ke?(ie((W_<<1)+(Le?1:0),3),ee(Ho.static_ltree,Ho.static_dtree)):(ie((wUt<<1)+(Le?1:0),3),Z(J.max_code+1,te.max_code+1,et+1),ee(H,N)),Re(),Le&&fe()}function ge(xe){be(g>=0?g:-1,x-g,xe),g=x,e.flush_pending()}function _e(){let xe,je,Le,Ke;do{if(Ke=c-E-x,Ke===0&&x===0&&E===0)Ke=r;else if(Ke==-1)Ke--;else if(x>=r+r-Ir){l.set(l.subarray(r,r+r),0),M-=r,x-=r,g-=r,xe=f,Le=xe;do je=d[--Le]&65535,d[Le]=je>=r?je-r:0;while(--xe!==0);xe=r,Le=xe;do je=u[--Le]&65535,u[Le]=je>=r?je-r:0;while(--xe!==0);Ke+=r}if(e.avail_in===0)return;xe=e.read_buf(l,x+E,Ke),E+=xe,E>=Rn&&(h=l[x]&255,h=(h<<m^l[x+1]&255)&p)}while(E<Ir&&e.avail_in!==0)}function Ye(xe){let je=65535,Le;for(je>n-5&&(je=n-5);;){if(E<=1){if(_e(),E===0&&xe==mm)return ta;if(E===0)break}if(x+=E,E=0,Le=g+je,(x===0||x>=Le)&&(E=x-Le,x=Le,ge(!1),e.avail_out===0)||x-g>=r-Ir&&(ge(!1),e.avail_out===0))return ta}return ge(xe==er),e.avail_out===0?xe==er?l5:ta:xe==er?Tw:Pw}function de(xe){let je=T,Le=x,Ke,he,et=S;const Me=x>r-Ir?x-(r-Ir):0;let qe=U;const st=a,We=x+Rw;let Oe=l[Le+et-1],At=l[Le+et];S>=L&&(je>>=2),qe>E&&(qe=E);do if(Ke=xe,!(l[Ke+et]!=At||l[Ke+et-1]!=Oe||l[Ke]!=l[Le]||l[++Ke]!=l[Le+1])){Le+=2,Ke++;do;while(l[++Le]==l[++Ke]&&l[++Le]==l[++Ke]&&l[++Le]==l[++Ke]&&l[++Le]==l[++Ke]&&l[++Le]==l[++Ke]&&l[++Le]==l[++Ke]&&l[++Le]==l[++Ke]&&l[++Le]==l[++Ke]&&Le<We);if(he=Rw-(We-Le),Le=We-Rw,he>et){if(M=xe,et=he,he>=qe)break;Oe=l[Le+et-1],At=l[Le+et]}}while((xe=u[xe&st]&65535)>Me&&--je!==0);return et<=E?et:E}function rt(xe){let je=0,Le;for(;;){if(E<Ir){if(_e(),E<Ir&&xe==mm)return ta;if(E===0)break}if(E>=Rn&&(h=(h<<m^l[x+(Rn-1)]&255)&p,je=d[h]&65535,u[x&a]=d[h],d[h]=x),je!==0&&(x-je&65535)<=r-Ir&&R!=xw&&(w=de(je)),w>=Rn)if(Le=j(x-M,w-Rn),E-=w,w<=P&&E>=Rn){w--;do x++,h=(h<<m^l[x+(Rn-1)]&255)&p,je=d[h]&65535,u[x&a]=d[h],d[h]=x;while(--w!==0);x++}else x+=w,w=0,h=l[x]&255,h=(h<<m^l[x+1]&255)&p;else Le=j(0,l[x]&255),E--,x++;if(Le&&(ge(!1),e.avail_out===0))return ta}return ge(xe==er),e.avail_out===0?xe==er?l5:ta:xe==er?Tw:Pw}function dt(xe){let je=0,Le,Ke;for(;;){if(E<Ir){if(_e(),E<Ir&&xe==mm)return ta;if(E===0)break}if(E>=Rn&&(h=(h<<m^l[x+(Rn-1)]&255)&p,je=d[h]&65535,u[x&a]=d[h],d[h]=x),S=w,y=M,w=Rn-1,je!==0&&S<P&&(x-je&65535)<=r-Ir&&(R!=xw&&(w=de(je)),w<=5&&(R==lUt||w==Rn&&x-M>4096)&&(w=Rn-1)),S>=Rn&&w<=S){Ke=x+E-Rn,Le=j(x-1-y,S-Rn),E-=S-1,S-=2;do++x<=Ke&&(h=(h<<m^l[x+(Rn-1)]&255)&p,je=d[h]&65535,u[x&a]=d[h],d[h]=x);while(--S!==0);if(v=0,w=Rn-1,x++,Le&&(ge(!1),e.avail_out===0))return ta}else if(v!==0){if(Le=j(0,l[x-1]&255),Le&&ge(!1),x++,E--,e.avail_out===0)return ta}else v=1,x++,E--}return v!==0&&(Le=j(0,l[x-1]&255),v=0),ge(xe==er),e.avail_out===0?xe==er?l5:ta:xe==er?Tw:Pw}function ke(xe){return xe.total_in=xe.total_out=0,xe.msg=null,i.pending=0,i.pending_out=0,t=kw,o=mm,ve(),ae(),Ra}i.deflateInit=function(xe,je,Le,Ke,he,et){return Ke||(Ke=Z_),he||(he=gUt),et||(et=cUt),xe.msg=null,je==bw&&(je=6),he<1||he>mUt||Ke!=Z_||Le<9||Le>15||je<0||je>9||et<0||et>xw?Da:(xe.dstate=i,s=Le,r=1<<s,a=r-1,A=he+7,f=1<<A,p=f-1,m=Math.floor((A+Rn-1)/Rn),l=new Uint8Array(r*2),u=[],d=[],Se=1<<he+6,i.pending_buf=new Uint8Array(Se*4),n=Se*4,i.dist_buf=new Uint16Array(Se),i.lc_buf=new Uint8Array(Se),I=je,R=et,ke(xe))},i.deflateEnd=function(){return t!=J_&&t!=kw&&t!=c5?Da:(i.lc_buf=null,i.dist_buf=null,i.pending_buf=null,d=null,u=null,l=null,i.dstate=null,t==kw?dUt:Ra)},i.deflateParams=function(xe,je,Le){let Ke=Ra;return je==bw&&(je=6),je<0||je>9||Le<0||Le>xw?Da:(_a[I].func!=_a[je].func&&xe.total_in!==0&&(Ke=xe.deflate(ahe)),I!=je&&(I=je,P=_a[I].max_lazy,L=_a[I].good_length,U=_a[I].nice_length,T=_a[I].max_chain),R=Le,Ke)},i.deflateSetDictionary=function(xe,je,Le){let Ke=Le,he,et=0;if(!je||t!=J_)return Da;if(Ke<Rn)return Ra;for(Ke>r-Ir&&(Ke=r-Ir,et=Le-Ke),l.set(je.subarray(et,et+Ke),0),x=Ke,g=Ke,h=l[0]&255,h=(h<<m^l[1]&255)&p,he=0;he<=Ke-Rn;he++)h=(h<<m^l[he+(Rn-1)]&255)&p,u[he&a]=d[h],d[h]=he;return Ra},i.deflate=function(xe,je){let Le,Ke,he,et,Me;if(je>er||je<0)return Da;if(!xe.next_out||!xe.next_in&&xe.avail_in!==0||t==c5&&je!=er)return xe.msg=Iw[Mw-Da],Da;if(xe.avail_out===0)return xe.msg=Iw[Mw-gm],gm;if(e=xe,et=o,o=je,t==J_&&(Ke=Z_+(s-8<<4)<<8,he=(I-1&255)>>1,he>3&&(he=3),Ke|=he<<6,x!==0&&(Ke|=vUt),Ke+=31-Ke%31,t=kw,se(Ke)),i.pending!==0){if(e.flush_pending(),e.avail_out===0)return o=-1,Ra}else if(e.avail_in===0&&je<=et&&je!=er)return e.msg=Iw[Mw-gm],gm;if(t==c5&&e.avail_in!==0)return xe.msg=Iw[Mw-gm],gm;if(e.avail_in!==0||E!==0||je!=mm&&t!=c5){switch(Me=-1,_a[I].func){case uhe:Me=Ye(je);break;case Sw:Me=rt(je);break;case zh:Me=dt(je);break}if((Me==l5||Me==Tw)&&(t=c5),Me==ta||Me==l5)return e.avail_out===0&&(o=-1),Ra;if(Me==Pw){if(je==ahe)q();else if(re(0,0,!1),je==uUt)for(Le=0;Le<f;Le++)d[Le]=0;if(e.flush_pending(),e.avail_out===0)return o=-1,Ra}}return je!=er?Ra:lhe}}function hhe(){const i=this;i.next_in_index=0,i.next_out_index=0,i.avail_in=0,i.total_in=0,i.avail_out=0,i.total_out=0}hhe.prototype={deflateInit(i,e){const t=this;return t.dstate=new CUt,e||(e=r5),t.dstate.deflateInit(t,i,e)},deflate(i){const e=this;return e.dstate?e.dstate.deflate(e,i):Da},deflateEnd(){const i=this;if(!i.dstate)return Da;const e=i.dstate.deflateEnd();return i.dstate=null,e},deflateParams(i,e){const t=this;return t.dstate?t.dstate.deflateParams(t,i,e):Da},deflateSetDictionary(i,e){const t=this;return t.dstate?t.dstate.deflateSetDictionary(t,i,e):Da},read_buf(i,e,t){const n=this;let o=n.avail_in;return o>t&&(o=t),o===0?0:(n.avail_in-=o,i.set(n.next_in.subarray(n.next_in_index,n.next_in_index+o),e),n.next_in_index+=o,n.total_in+=o,o)},flush_pending(){const i=this;let e=i.dstate.pending;e>i.avail_out&&(e=i.avail_out),e!==0&&(i.next_out.set(i.dstate.pending_buf.subarray(i.dstate.pending_out,i.dstate.pending_out+e),i.next_out_index),i.next_out_index+=e,i.dstate.pending_out+=e,i.total_out+=e,i.avail_out-=e,i.dstate.pending-=e,i.dstate.pending===0&&(i.dstate.pending_out=0))}};function bUt(i){const e=this,t=new hhe,n=xUt(i&&i.chunkSize?i.chunkSize:64*1024),o=mm,r=new Uint8Array(n);let s=i?i.level:bw;typeof s>"u"&&(s=bw),t.deflateInit(s),t.next_out=r,e.append=function(a,l){let c,u,d=0,h=0,f=0;const A=[];if(a.length){t.next_in_index=0,t.next_in=a,t.avail_in=a.length;do{if(t.next_out_index=0,t.avail_out=n,c=t.deflate(o),c!=Ra)throw new Error("deflating: "+t.msg);t.next_out_index&&(t.next_out_index==n?A.push(new Uint8Array(r)):A.push(r.subarray(0,t.next_out_index))),f+=t.next_out_index,l&&t.next_in_index>0&&t.next_in_index!=d&&(l(t.next_in_index),d=t.next_in_index)}while(t.avail_in>0||t.avail_out===0);return A.length>1?(u=new Uint8Array(f),A.forEach(function(p){u.set(p,h),h+=p.length})):u=A[0]?new Uint8Array(A[0]):new Uint8Array,u}},e.flush=function(){let a,l,c=0,u=0;const d=[];do{if(t.next_out_index=0,t.avail_out=n,a=t.deflate(er),a!=lhe&&a!=Ra)throw new Error("deflating: "+t.msg);n-t.avail_out>0&&d.push(r.slice(0,t.next_out_index)),u+=t.next_out_index}while(t.avail_in>0||t.avail_out===0);return t.deflateEnd(),l=new Uint8Array(u),d.forEach(function(h){l.set(h,c),c+=h.length}),l}}function xUt(i){return i+5*(Math.floor(i/16383)+1)}const MUt=15,Li=0,Uc=1,EUt=2,tr=-2,xn=-3,phe=-4,Nc=-5,Pr=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],fhe=1440,BUt=0,SUt=4,IUt=9,PUt=5,TUt=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],kUt=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],RUt=[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],DUt=[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,112,112],_Ut=[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],LUt=[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],cd=15;function X_(){const i=this;let e,t,n,o,r,s;function a(c,u,d,h,f,A,p,m,g,w,y){let v,x,M,E,S,T,P,I,R,L,U,H,N,Q,J;L=0,S=d;do n[c[u+L]]++,L++,S--;while(S!==0);if(n[0]==d)return p[0]=-1,m[0]=0,Li;for(I=m[0],T=1;T<=cd&&n[T]===0;T++);for(P=T,I<T&&(I=T),S=cd;S!==0&&n[S]===0;S--);for(M=S,I>S&&(I=S),m[0]=I,Q=1<<T;T<S;T++,Q<<=1)if((Q-=n[T])<0)return xn;if((Q-=n[S])<0)return xn;for(n[S]+=Q,s[1]=T=0,L=1,N=2;--S!==0;)s[N]=T+=n[L],N++,L++;S=0,L=0;do(T=c[u+L])!==0&&(y[s[T]++]=S),L++;while(++S<d);for(d=s[M],s[0]=S=0,L=0,E=-1,H=-I,r[0]=0,U=0,J=0;P<=M;P++)for(v=n[P];v--!==0;){for(;P>H+I;){if(E++,H+=I,J=M-H,J=J>I?I:J,(x=1<<(T=P-H))>v+1&&(x-=v+1,N=P,T<J))for(;++T<J&&!((x<<=1)<=n[++N]);)x-=n[N];if(J=1<<T,w[0]+J>fhe)return xn;r[E]=U=w[0],w[0]+=J,E!==0?(s[E]=S,o[0]=T,o[1]=I,T=S>>>H-I,o[2]=U-r[E-1]-T,g.set(o,(r[E-1]+T)*3)):p[0]=U}for(o[1]=P-H,L>=d?o[0]=192:y[L]<h?(o[0]=y[L]<256?0:96,o[2]=y[L++]):(o[0]=A[y[L]-h]+16+64,o[2]=f[y[L++]-h]),x=1<<P-H,T=S>>>H;T<J;T+=x)g.set(o,(U+T)*3);for(T=1<<P-1;S&T;T>>>=1)S^=T;for(S^=T,R=(1<<H)-1;(S&R)!=s[E];)E--,H-=I,R=(1<<H)-1}return Q!==0&&M!=1?Nc:Li}function l(c){let u;for(e||(e=[],t=[],n=new Int32Array(cd+1),o=[],r=new Int32Array(cd),s=new Int32Array(cd+1)),t.length<c&&(t=[]),u=0;u<c;u++)t[u]=0;for(u=0;u<cd+1;u++)n[u]=0;for(u=0;u<3;u++)o[u]=0;r.set(n.subarray(0,cd),0),s.set(n.subarray(0,cd+1),0)}i.inflate_trees_bits=function(c,u,d,h,f){let A;return l(19),e[0]=0,A=a(c,0,19,19,null,null,d,u,h,e,t),A==xn?f.msg="oversubscribed dynamic bit lengths tree":(A==Nc||u[0]===0)&&(f.msg="incomplete dynamic bit lengths tree",A=xn),A},i.inflate_trees_dynamic=function(c,u,d,h,f,A,p,m,g){let w;return l(288),e[0]=0,w=a(d,0,c,257,RUt,DUt,A,h,m,e,t),w!=Li||h[0]===0?(w==xn?g.msg="oversubscribed literal/length tree":w!=phe&&(g.msg="incomplete literal/length tree",w=xn),w):(l(288),w=a(d,c,u,0,_Ut,LUt,p,f,m,e,t),w!=Li||f[0]===0&&c>257?(w==xn?g.msg="oversubscribed distance tree":w==Nc?(g.msg="incomplete distance tree",w=xn):w!=phe&&(g.msg="empty distance tree with lengths",w=xn),w):Li)}}X_.inflate_trees_fixed=function(i,e,t,n){return i[0]=IUt,e[0]=PUt,t[0]=TUt,n[0]=kUt,Li};const Dw=0,Ahe=1,mhe=2,ghe=3,vhe=4,yhe=5,whe=6,Y_=7,Che=8,_w=9;function FUt(){const i=this;let e,t=0,n,o=0,r=0,s=0,a=0,l=0,c=0,u=0,d,h=0,f,A=0;function p(m,g,w,y,v,x,M,E){let S,T,P,I,R,L,U,H,N,Q,J,te,le,Se,Ee,Ne;U=E.next_in_index,H=E.avail_in,R=M.bitb,L=M.bitk,N=M.write,Q=N<M.read?M.read-N-1:M.end-N,J=Pr[m],te=Pr[g];do{for(;L<20;)H--,R|=(E.read_byte(U++)&255)<<L,L+=8;if(S=R&J,T=w,P=y,Ne=(P+S)*3,(I=T[Ne])===0){R>>=T[Ne+1],L-=T[Ne+1],M.win[N++]=T[Ne+2],Q--;continue}do{if(R>>=T[Ne+1],L-=T[Ne+1],I&16){for(I&=15,le=T[Ne+2]+(R&Pr[I]),R>>=I,L-=I;L<15;)H--,R|=(E.read_byte(U++)&255)<<L,L+=8;S=R&te,T=v,P=x,Ne=(P+S)*3,I=T[Ne];do if(R>>=T[Ne+1],L-=T[Ne+1],I&16){for(I&=15;L<I;)H--,R|=(E.read_byte(U++)&255)<<L,L+=8;if(Se=T[Ne+2]+(R&Pr[I]),R>>=I,L-=I,Q-=le,N>=Se)Ee=N-Se,N-Ee>0&&2>N-Ee?(M.win[N++]=M.win[Ee++],M.win[N++]=M.win[Ee++],le-=2):(M.win.set(M.win.subarray(Ee,Ee+2),N),N+=2,Ee+=2,le-=2);else{Ee=N-Se;do Ee+=M.end;while(Ee<0);if(I=M.end-Ee,le>I){if(le-=I,N-Ee>0&&I>N-Ee)do M.win[N++]=M.win[Ee++];while(--I!==0);else M.win.set(M.win.subarray(Ee,Ee+I),N),N+=I,Ee+=I,I=0;Ee=0}}if(N-Ee>0&&le>N-Ee)do M.win[N++]=M.win[Ee++];while(--le!==0);else M.win.set(M.win.subarray(Ee,Ee+le),N),N+=le,Ee+=le,le=0;break}else if(!(I&64))S+=T[Ne+2],S+=R&Pr[I],Ne=(P+S)*3,I=T[Ne];else return E.msg="invalid distance code",le=E.avail_in-H,le=L>>3<le?L>>3:le,H+=le,U-=le,L-=le<<3,M.bitb=R,M.bitk=L,E.avail_in=H,E.total_in+=U-E.next_in_index,E.next_in_index=U,M.write=N,xn;while(!0);break}if(I&64)return I&32?(le=E.avail_in-H,le=L>>3<le?L>>3:le,H+=le,U-=le,L-=le<<3,M.bitb=R,M.bitk=L,E.avail_in=H,E.total_in+=U-E.next_in_index,E.next_in_index=U,M.write=N,Uc):(E.msg="invalid literal/length code",le=E.avail_in-H,le=L>>3<le?L>>3:le,H+=le,U-=le,L-=le<<3,M.bitb=R,M.bitk=L,E.avail_in=H,E.total_in+=U-E.next_in_index,E.next_in_index=U,M.write=N,xn);if(S+=T[Ne+2],S+=R&Pr[I],Ne=(P+S)*3,(I=T[Ne])===0){R>>=T[Ne+1],L-=T[Ne+1],M.win[N++]=T[Ne+2],Q--;break}}while(!0)}while(Q>=258&&H>=10);return le=E.avail_in-H,le=L>>3<le?L>>3:le,H+=le,U-=le,L-=le<<3,M.bitb=R,M.bitk=L,E.avail_in=H,E.total_in+=U-E.next_in_index,E.next_in_index=U,M.write=N,Li}i.init=function(m,g,w,y,v,x){e=Dw,c=m,u=g,d=w,h=y,f=v,A=x,n=null},i.proc=function(m,g,w){let y,v,x,M=0,E=0,S=0,T,P,I,R;for(S=g.next_in_index,T=g.avail_in,M=m.bitb,E=m.bitk,P=m.write,I=P<m.read?m.read-P-1:m.end-P;;)switch(e){case Dw:if(I>=258&&T>=10&&(m.bitb=M,m.bitk=E,g.avail_in=T,g.total_in+=S-g.next_in_index,g.next_in_index=S,m.write=P,w=p(c,u,d,h,f,A,m,g),S=g.next_in_index,T=g.avail_in,M=m.bitb,E=m.bitk,P=m.write,I=P<m.read?m.read-P-1:m.end-P,w!=Li)){e=w==Uc?Y_:_w;break}r=c,n=d,o=h,e=Ahe;case Ahe:for(y=r;E<y;){if(T!==0)w=Li;else return m.bitb=M,m.bitk=E,g.avail_in=T,g.total_in+=S-g.next_in_index,g.next_in_index=S,m.write=P,m.inflate_flush(g,w);T--,M|=(g.read_byte(S++)&255)<<E,E+=8}if(v=(o+(M&Pr[y]))*3,M>>>=n[v+1],E-=n[v+1],x=n[v],x===0){s=n[v+2],e=whe;break}if(x&16){a=x&15,t=n[v+2],e=mhe;break}if(!(x&64)){r=x,o=v/3+n[v+2];break}if(x&32){e=Y_;break}return e=_w,g.msg="invalid literal/length code",w=xn,m.bitb=M,m.bitk=E,g.avail_in=T,g.total_in+=S-g.next_in_index,g.next_in_index=S,m.write=P,m.inflate_flush(g,w);case mhe:for(y=a;E<y;){if(T!==0)w=Li;else return m.bitb=M,m.bitk=E,g.avail_in=T,g.total_in+=S-g.next_in_index,g.next_in_index=S,m.write=P,m.inflate_flush(g,w);T--,M|=(g.read_byte(S++)&255)<<E,E+=8}t+=M&Pr[y],M>>=y,E-=y,r=u,n=f,o=A,e=ghe;case ghe:for(y=r;E<y;){if(T!==0)w=Li;else return m.bitb=M,m.bitk=E,g.avail_in=T,g.total_in+=S-g.next_in_index,g.next_in_index=S,m.write=P,m.inflate_flush(g,w);T--,M|=(g.read_byte(S++)&255)<<E,E+=8}if(v=(o+(M&Pr[y]))*3,M>>=n[v+1],E-=n[v+1],x=n[v],x&16){a=x&15,l=n[v+2],e=vhe;break}if(!(x&64)){r=x,o=v/3+n[v+2];break}return e=_w,g.msg="invalid distance code",w=xn,m.bitb=M,m.bitk=E,g.avail_in=T,g.total_in+=S-g.next_in_index,g.next_in_index=S,m.write=P,m.inflate_flush(g,w);case vhe:for(y=a;E<y;){if(T!==0)w=Li;else return m.bitb=M,m.bitk=E,g.avail_in=T,g.total_in+=S-g.next_in_index,g.next_in_index=S,m.write=P,m.inflate_flush(g,w);T--,M|=(g.read_byte(S++)&255)<<E,E+=8}l+=M&Pr[y],M>>=y,E-=y,e=yhe;case yhe:for(R=P-l;R<0;)R+=m.end;for(;t!==0;){if(I===0&&(P==m.end&&m.read!==0&&(P=0,I=P<m.read?m.read-P-1:m.end-P),I===0&&(m.write=P,w=m.inflate_flush(g,w),P=m.write,I=P<m.read?m.read-P-1:m.end-P,P==m.end&&m.read!==0&&(P=0,I=P<m.read?m.read-P-1:m.end-P),I===0)))return m.bitb=M,m.bitk=E,g.avail_in=T,g.total_in+=S-g.next_in_index,g.next_in_index=S,m.write=P,m.inflate_flush(g,w);m.win[P++]=m.win[R++],I--,R==m.end&&(R=0),t--}e=Dw;break;case whe:if(I===0&&(P==m.end&&m.read!==0&&(P=0,I=P<m.read?m.read-P-1:m.end-P),I===0&&(m.write=P,w=m.inflate_flush(g,w),P=m.write,I=P<m.read?m.read-P-1:m.end-P,P==m.end&&m.read!==0&&(P=0,I=P<m.read?m.read-P-1:m.end-P),I===0)))return m.bitb=M,m.bitk=E,g.avail_in=T,g.total_in+=S-g.next_in_index,g.next_in_index=S,m.write=P,m.inflate_flush(g,w);w=Li,m.win[P++]=s,I--,e=Dw;break;case Y_:if(E>7&&(E-=8,T++,S--),m.write=P,w=m.inflate_flush(g,w),P=m.write,I=P<m.read?m.read-P-1:m.end-P,m.read!=m.write)return m.bitb=M,m.bitk=E,g.avail_in=T,g.total_in+=S-g.next_in_index,g.next_in_index=S,m.write=P,m.inflate_flush(g,w);e=Che;case Che:return w=Uc,m.bitb=M,m.bitk=E,g.avail_in=T,g.total_in+=S-g.next_in_index,g.next_in_index=S,m.write=P,m.inflate_flush(g,w);case _w:return w=xn,m.bitb=M,m.bitk=E,g.avail_in=T,g.total_in+=S-g.next_in_index,g.next_in_index=S,m.write=P,m.inflate_flush(g,w);default:return w=tr,m.bitb=M,m.bitk=E,g.avail_in=T,g.total_in+=S-g.next_in_index,g.next_in_index=S,m.write=P,m.inflate_flush(g,w)}},i.free=function(){}}const bhe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],vm=0,$_=1,xhe=2,Mhe=3,Ehe=4,Bhe=5,Lw=6,Fw=7,She=8,jh=9;function OUt(i,e){const t=this;let n=vm,o=0,r=0,s=0,a;const l=[0],c=[0],u=new FUt;let d=0,h=new Int32Array(fhe*3);const f=0,A=new X_;t.bitk=0,t.bitb=0,t.win=new Uint8Array(e),t.end=e,t.read=0,t.write=0,t.reset=function(p,m){m&&(m[0]=f),n==Lw&&u.free(p),n=vm,t.bitk=0,t.bitb=0,t.read=t.write=0},t.reset(i,null),t.inflate_flush=function(p,m){let g,w,y;return w=p.next_out_index,y=t.read,g=(y<=t.write?t.write:t.end)-y,g>p.avail_out&&(g=p.avail_out),g!==0&&m==Nc&&(m=Li),p.avail_out-=g,p.total_out+=g,p.next_out.set(t.win.subarray(y,y+g),w),w+=g,y+=g,y==t.end&&(y=0,t.write==t.end&&(t.write=0),g=t.write-y,g>p.avail_out&&(g=p.avail_out),g!==0&&m==Nc&&(m=Li),p.avail_out-=g,p.total_out+=g,p.next_out.set(t.win.subarray(y,y+g),w),w+=g,y+=g),p.next_out_index=w,t.read=y,m},t.proc=function(p,m){let g,w,y,v,x,M,E,S;for(v=p.next_in_index,x=p.avail_in,w=t.bitb,y=t.bitk,M=t.write,E=M<t.read?t.read-M-1:t.end-M;;){let T,P,I,R,L,U,H,N;switch(n){case vm:for(;y<3;){if(x!==0)m=Li;else return t.bitb=w,t.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,t.write=M,t.inflate_flush(p,m);x--,w|=(p.read_byte(v++)&255)<<y,y+=8}switch(g=w&7,d=g&1,g>>>1){case 0:w>>>=3,y-=3,g=y&7,w>>>=g,y-=g,n=$_;break;case 1:T=[],P=[],I=[[]],R=[[]],X_.inflate_trees_fixed(T,P,I,R),u.init(T[0],P[0],I[0],0,R[0],0),w>>>=3,y-=3,n=Lw;break;case 2:w>>>=3,y-=3,n=Mhe;break;case 3:return w>>>=3,y-=3,n=jh,p.msg="invalid block type",m=xn,t.bitb=w,t.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,t.write=M,t.inflate_flush(p,m)}break;case $_:for(;y<32;){if(x!==0)m=Li;else return t.bitb=w,t.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,t.write=M,t.inflate_flush(p,m);x--,w|=(p.read_byte(v++)&255)<<y,y+=8}if((~w>>>16&65535)!=(w&65535))return n=jh,p.msg="invalid stored block lengths",m=xn,t.bitb=w,t.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,t.write=M,t.inflate_flush(p,m);o=w&65535,w=y=0,n=o!==0?xhe:d!==0?Fw:vm;break;case xhe:if(x===0||E===0&&(M==t.end&&t.read!==0&&(M=0,E=M<t.read?t.read-M-1:t.end-M),E===0&&(t.write=M,m=t.inflate_flush(p,m),M=t.write,E=M<t.read?t.read-M-1:t.end-M,M==t.end&&t.read!==0&&(M=0,E=M<t.read?t.read-M-1:t.end-M),E===0)))return t.bitb=w,t.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,t.write=M,t.inflate_flush(p,m);if(m=Li,g=o,g>x&&(g=x),g>E&&(g=E),t.win.set(p.read_buf(v,g),M),v+=g,x-=g,M+=g,E-=g,(o-=g)!==0)break;n=d!==0?Fw:vm;break;case Mhe:for(;y<14;){if(x!==0)m=Li;else return t.bitb=w,t.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,t.write=M,t.inflate_flush(p,m);x--,w|=(p.read_byte(v++)&255)<<y,y+=8}if(r=g=w&16383,(g&31)>29||(g>>5&31)>29)return n=jh,p.msg="too many length or distance symbols",m=xn,t.bitb=w,t.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,t.write=M,t.inflate_flush(p,m);if(g=258+(g&31)+(g>>5&31),!a||a.length<g)a=[];else for(S=0;S<g;S++)a[S]=0;w>>>=14,y-=14,s=0,n=Ehe;case Ehe:for(;s<4+(r>>>10);){for(;y<3;){if(x!==0)m=Li;else return t.bitb=w,t.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,t.write=M,t.inflate_flush(p,m);x--,w|=(p.read_byte(v++)&255)<<y,y+=8}a[bhe[s++]]=w&7,w>>>=3,y-=3}for(;s<19;)a[bhe[s++]]=0;if(l[0]=7,g=A.inflate_trees_bits(a,l,c,h,p),g!=Li)return m=g,m==xn&&(a=null,n=jh),t.bitb=w,t.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,t.write=M,t.inflate_flush(p,m);s=0,n=Bhe;case Bhe:for(;g=r,!(s>=258+(g&31)+(g>>5&31));){let Q,J;for(g=l[0];y<g;){if(x!==0)m=Li;else return t.bitb=w,t.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,t.write=M,t.inflate_flush(p,m);x--,w|=(p.read_byte(v++)&255)<<y,y+=8}if(g=h[(c[0]+(w&Pr[g]))*3+1],J=h[(c[0]+(w&Pr[g]))*3+2],J<16)w>>>=g,y-=g,a[s++]=J;else{for(S=J==18?7:J-14,Q=J==18?11:3;y<g+S;){if(x!==0)m=Li;else return t.bitb=w,t.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,t.write=M,t.inflate_flush(p,m);x--,w|=(p.read_byte(v++)&255)<<y,y+=8}if(w>>>=g,y-=g,Q+=w&Pr[S],w>>>=S,y-=S,S=s,g=r,S+Q>258+(g&31)+(g>>5&31)||J==16&&S<1)return a=null,n=jh,p.msg="invalid bit length repeat",m=xn,t.bitb=w,t.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,t.write=M,t.inflate_flush(p,m);J=J==16?a[S-1]:0;do a[S++]=J;while(--Q!==0);s=S}}if(c[0]=-1,L=[],U=[],H=[],N=[],L[0]=9,U[0]=6,g=r,g=A.inflate_trees_dynamic(257+(g&31),1+(g>>5&31),a,L,U,H,N,h,p),g!=Li)return g==xn&&(a=null,n=jh),m=g,t.bitb=w,t.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,t.write=M,t.inflate_flush(p,m);u.init(L[0],U[0],h,H[0],h,N[0]),n=Lw;case Lw:if(t.bitb=w,t.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,t.write=M,(m=u.proc(t,p,m))!=Uc)return t.inflate_flush(p,m);if(m=Li,u.free(p),v=p.next_in_index,x=p.avail_in,w=t.bitb,y=t.bitk,M=t.write,E=M<t.read?t.read-M-1:t.end-M,d===0){n=vm;break}n=Fw;case Fw:if(t.write=M,m=t.inflate_flush(p,m),M=t.write,E=M<t.read?t.read-M-1:t.end-M,t.read!=t.write)return t.bitb=w,t.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,t.write=M,t.inflate_flush(p,m);n=She;case She:return m=Uc,t.bitb=w,t.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,t.write=M,t.inflate_flush(p,m);case jh:return m=xn,t.bitb=w,t.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,t.write=M,t.inflate_flush(p,m);default:return m=tr,t.bitb=w,t.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,t.write=M,t.inflate_flush(p,m)}}},t.free=function(p){t.reset(p,null),t.win=null,h=null},t.set_dictionary=function(p,m,g){t.win.set(p.subarray(m,m+g),0),t.read=t.write=g},t.sync_point=function(){return n==$_?1:0}}const UUt=32,NUt=8,VUt=0,Ihe=1,Phe=2,The=3,khe=4,Rhe=5,eL=6,u5=7,Dhe=12,ud=13,HUt=[0,0,255,255];function zUt(){const i=this;i.mode=0,i.method=0,i.was=[0],i.need=0,i.marker=0,i.wbits=0;function e(t){return!t||!t.istate?tr:(t.total_in=t.total_out=0,t.msg=null,t.istate.mode=u5,t.istate.blocks.reset(t,null),Li)}i.inflateEnd=function(t){return i.blocks&&i.blocks.free(t),i.blocks=null,Li},i.inflateInit=function(t,n){return t.msg=null,i.blocks=null,n<8||n>15?(i.inflateEnd(t),tr):(i.wbits=n,t.istate.blocks=new OUt(t,1<<n),e(t),Li)},i.inflate=function(t,n){let o,r;if(!t||!t.istate||!t.next_in)return tr;const s=t.istate;for(n=n==SUt?Nc:Li,o=Nc;;)switch(s.mode){case VUt:if(t.avail_in===0)return o;if(o=n,t.avail_in--,t.total_in++,((s.method=t.read_byte(t.next_in_index++))&15)!=NUt){s.mode=ud,t.msg="unknown compression method",s.marker=5;break}if((s.method>>4)+8>s.wbits){s.mode=ud,t.msg="invalid win size",s.marker=5;break}s.mode=Ihe;case Ihe:if(t.avail_in===0)return o;if(o=n,t.avail_in--,t.total_in++,r=t.read_byte(t.next_in_index++)&255,((s.method<<8)+r)%31!==0){s.mode=ud,t.msg="incorrect header check",s.marker=5;break}if(!(r&UUt)){s.mode=u5;break}s.mode=Phe;case Phe:if(t.avail_in===0)return o;o=n,t.avail_in--,t.total_in++,s.need=(t.read_byte(t.next_in_index++)&255)<<24&4278190080,s.mode=The;case The:if(t.avail_in===0)return o;o=n,t.avail_in--,t.total_in++,s.need+=(t.read_byte(t.next_in_index++)&255)<<16&16711680,s.mode=khe;case khe:if(t.avail_in===0)return o;o=n,t.avail_in--,t.total_in++,s.need+=(t.read_byte(t.next_in_index++)&255)<<8&65280,s.mode=Rhe;case Rhe:return t.avail_in===0?o:(o=n,t.avail_in--,t.total_in++,s.need+=t.read_byte(t.next_in_index++)&255,s.mode=eL,EUt);case eL:return s.mode=ud,t.msg="need dictionary",s.marker=0,tr;case u5:if(o=s.blocks.proc(t,o),o==xn){s.mode=ud,s.marker=0;break}if(o==Li&&(o=n),o!=Uc)return o;o=n,s.blocks.reset(t,s.was),s.mode=Dhe;case Dhe:return t.avail_in=0,Uc;case ud:return xn;default:return tr}},i.inflateSetDictionary=function(t,n,o){let r=0,s=o;if(!t||!t.istate||t.istate.mode!=eL)return tr;const a=t.istate;return s>=1<<a.wbits&&(s=(1<<a.wbits)-1,r=o-s),a.blocks.set_dictionary(n,r,s),a.mode=u5,Li},i.inflateSync=function(t){let n,o,r,s,a;if(!t||!t.istate)return tr;const l=t.istate;if(l.mode!=ud&&(l.mode=ud,l.marker=0),(n=t.avail_in)===0)return Nc;for(o=t.next_in_index,r=l.marker;n!==0&&r<4;)t.read_byte(o)==HUt[r]?r++:t.read_byte(o)!==0?r=0:r=4-r,o++,n--;return t.total_in+=o-t.next_in_index,t.next_in_index=o,t.avail_in=n,l.marker=r,r!=4?xn:(s=t.total_in,a=t.total_out,e(t),t.total_in=s,t.total_out=a,l.mode=u5,Li)},i.inflateSyncPoint=function(t){return!t||!t.istate||!t.istate.blocks?tr:t.istate.blocks.sync_point()}}function _he(){}_he.prototype={inflateInit(i){const e=this;return e.istate=new zUt,i||(i=MUt),e.istate.inflateInit(e,i)},inflate(i){const e=this;return e.istate?e.istate.inflate(e,i):tr},inflateEnd(){const i=this;if(!i.istate)return tr;const e=i.istate.inflateEnd(i);return i.istate=null,e},inflateSync(){const i=this;return i.istate?i.istate.inflateSync(i):tr},inflateSetDictionary(i,e){const t=this;return t.istate?t.istate.inflateSetDictionary(t,i,e):tr},read_byte(i){return this.next_in[i]},read_buf(i,e){return this.next_in.subarray(i,i+e)}};function jUt(i){const e=this,t=new _he,n=i&&i.chunkSize?Math.floor(i.chunkSize*2):128*1024,o=BUt,r=new Uint8Array(n);let s=!1;t.inflateInit(),t.next_out=r,e.append=function(a,l){const c=[];let u,d,h=0,f=0,A=0;if(a.length!==0){t.next_in_index=0,t.next_in=a,t.avail_in=a.length;do{if(t.next_out_index=0,t.avail_out=n,t.avail_in===0&&!s&&(t.next_in_index=0,s=!0),u=t.inflate(o),s&&u===Nc){if(t.avail_in!==0)throw new Error("inflating: bad input")}else if(u!==Li&&u!==Uc)throw new Error("inflating: "+t.msg);if((s||u===Uc)&&t.avail_in===a.length)throw new Error("inflating: bad input");t.next_out_index&&(t.next_out_index===n?c.push(new Uint8Array(r)):c.push(r.subarray(0,t.next_out_index))),A+=t.next_out_index,l&&t.next_in_index>0&&t.next_in_index!=h&&(l(t.next_in_index),h=t.next_in_index)}while(t.avail_in>0||t.avail_out===0);return c.length>1?(d=new Uint8Array(A),c.forEach(function(p){d.set(p,f),f+=p.length})):d=c[0]?new Uint8Array(c[0]):new Uint8Array,d}},e.flush=function(){t.inflateEnd()}}const Gh=4294967295,dd=65535,GUt=8,qUt=0,QUt=99,KUt=67324752,JUt=134695760,Lhe=33639248,ZUt=101010256,Fhe=101075792,WUt=117853008,ym=22,tL=20,iL=56,XUt=1,YUt=39169,$Ut=10,eNt=1,tNt=21589,iNt=28789,nNt=25461,oNt=6534,Ohe=1,sNt=6,Uhe=8,Nhe=2048,Vhe=16,rNt="/",Bs=void 0,hd="undefined",d5="function";class Hhe{constructor(e){return class extends TransformStream{constructor(t,n){const o=new e(n);super({transform(r,s){s.enqueue(o.append(r))},flush(r){const s=o.flush();s&&r.enqueue(s)}})}}}}const aNt=64;let zhe=2;try{typeof navigator!=hd&&navigator.hardwareConcurrency&&(zhe=navigator.hardwareConcurrency)}catch{}const lNt={chunkSize:512*1024,maxWorkers:zhe,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:Bs,CompressionStreamNative:typeof CompressionStream!=hd&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=hd&&DecompressionStream},pd=Object.assign({},lNt);function cNt(){return pd}function uNt(i){return Math.max(i.chunkSize,aNt)}function nL(i){const{baseURL:e,chunkSize:t,maxWorkers:n,terminateWorkerTimeout:o,useCompressionStream:r,useWebWorkers:s,Deflate:a,Inflate:l,CompressionStream:c,DecompressionStream:u,workerScripts:d}=i;if(fd("baseURL",e),fd("chunkSize",t),fd("maxWorkers",n),fd("terminateWorkerTimeout",o),fd("useCompressionStream",r),fd("useWebWorkers",s),a&&(pd.CompressionStream=new Hhe(a)),l&&(pd.DecompressionStream=new Hhe(l)),fd("CompressionStream",c),fd("DecompressionStream",u),d!==Bs){const{deflate:h,inflate:f}=d;if((h||f)&&(pd.workerScripts||(pd.workerScripts={})),h){if(!Array.isArray(h))throw new Error("workerScripts.deflate must be an array");pd.workerScripts.deflate=h}if(f){if(!Array.isArray(f))throw new Error("workerScripts.inflate must be an array");pd.workerScripts.inflate=f}}}function fd(i,e){e!==Bs&&(pd[i]=e)}const oL={application:{"andrew-inset":"ez",annodex:"anx","atom+xml":"atom","atomcat+xml":"atomcat","atomserv+xml":"atomsrv",bbolin:"lin","cu-seeme":"cu","davmount+xml":"davmount",dsptype:"tsp",ecmascript:["es","ecma"],futuresplash:"spl",hta:"hta","java-archive":"jar","java-serialized-object":"ser","java-vm":"class",m3g:"m3g","mac-binhex40":"hqx",mathematica:["nb","ma","mb"],msaccess:"mdb",msword:["doc","dot","wiz"],mxf:"mxf",oda:"oda",ogg:"ogx",pdf:"pdf","pgp-keys":"key","pgp-signature":["asc","sig"],"pics-rules":"prf",postscript:["ps","ai","eps","epsi","epsf","eps2","eps3"],rar:"rar","rdf+xml":"rdf","rss+xml":"rss",rtf:"rtf","xhtml+xml":["xhtml","xht"],xml:["xml","xsl","xsd","xpdl"],"xspf+xml":"xspf",zip:"zip","vnd.android.package-archive":"apk","vnd.cinderella":"cdy","vnd.google-earth.kml+xml":"kml","vnd.google-earth.kmz":"kmz","vnd.mozilla.xul+xml":"xul","vnd.ms-excel":["xls","xlb","xlt","xlm","xla","xlc","xlw"],"vnd.ms-pki.seccat":"cat","vnd.ms-pki.stl":"stl","vnd.ms-powerpoint":["ppt","pps","pot","ppa","pwz"],"vnd.oasis.opendocument.chart":"odc","vnd.oasis.opendocument.database":"odb","vnd.oasis.opendocument.formula":"odf","vnd.oasis.opendocument.graphics":"odg","vnd.oasis.opendocument.graphics-template":"otg","vnd.oasis.opendocument.image":"odi","vnd.oasis.opendocument.presentation":"odp","vnd.oasis.opendocument.presentation-template":"otp","vnd.oasis.opendocument.spreadsheet":"ods","vnd.oasis.opendocument.spreadsheet-template":"ots","vnd.oasis.opendocument.text":"odt","vnd.oasis.opendocument.text-master":["odm","otm"],"vnd.oasis.opendocument.text-template":"ott","vnd.oasis.opendocument.text-web":"oth","vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","vnd.openxmlformats-officedocument.spreadsheetml.template":"xltx","vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","vnd.openxmlformats-officedocument.presentationml.slideshow":"ppsx","vnd.openxmlformats-officedocument.presentationml.template":"potx","vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","vnd.openxmlformats-officedocument.wordprocessingml.template":"dotx","vnd.smaf":"mmf","vnd.stardivision.calc":"sdc","vnd.stardivision.chart":"sds","vnd.stardivision.draw":"sda","vnd.stardivision.impress":"sdd","vnd.stardivision.math":["sdf","smf"],"vnd.stardivision.writer":["sdw","vor"],"vnd.stardivision.writer-global":"sgl","vnd.sun.xml.calc":"sxc","vnd.sun.xml.calc.template":"stc","vnd.sun.xml.draw":"sxd","vnd.sun.xml.draw.template":"std","vnd.sun.xml.impress":"sxi","vnd.sun.xml.impress.template":"sti","vnd.sun.xml.math":"sxm","vnd.sun.xml.writer":"sxw","vnd.sun.xml.writer.global":"sxg","vnd.sun.xml.writer.template":"stw","vnd.symbian.install":["sis","sisx"],"vnd.visio":["vsd","vst","vss","vsw","vsdx","vssx","vstx","vssm","vstm"],"vnd.wap.wbxml":"wbxml","vnd.wap.wmlc":"wmlc","vnd.wap.wmlscriptc":"wmlsc","vnd.wordperfect":"wpd","vnd.wordperfect5.1":"wp5","x-123":"wk","x-7z-compressed":"7z","x-abiword":"abw","x-apple-diskimage":"dmg","x-bcpio":"bcpio","x-bittorrent":"torrent","x-cbr":["cbr","cba","cbt","cb7"],"x-cbz":"cbz","x-cdf":["cdf","cda"],"x-cdlink":"vcd","x-chess-pgn":"pgn","x-cpio":"cpio","x-csh":"csh","x-director":["dir","dxr","cst","cct","cxt","w3d","fgd","swa"],"x-dms":"dms","x-doom":"wad","x-dvi":"dvi","x-httpd-eruby":"rhtml","x-font":"pcf.Z","x-freemind":"mm","x-gnumeric":"gnumeric","x-go-sgf":"sgf","x-graphing-calculator":"gcf","x-gtar":["gtar","taz"],"x-hdf":"hdf","x-httpd-php":["phtml","pht","php"],"x-httpd-php-source":"phps","x-httpd-php3":"php3","x-httpd-php3-preprocessed":"php3p","x-httpd-php4":"php4","x-httpd-php5":"php5","x-ica":"ica","x-info":"info","x-internet-signup":["ins","isp"],"x-iphone":"iii","x-iso9660-image":"iso","x-java-jnlp-file":"jnlp","x-jmol":"jmz","x-killustrator":"kil","x-latex":"latex","x-lyx":"lyx","x-lzx":"lzx","x-maker":["frm","fb","fbdoc"],"x-ms-wmd":"wmd","x-msdos-program":["com","exe","bat","dll"],"x-netcdf":["nc"],"x-ns-proxy-autoconfig":["pac","dat"],"x-nwc":"nwc","x-object":"o","x-oz-application":"oza","x-pkcs7-certreqresp":"p7r","x-python-code":["pyc","pyo"],"x-qgis":["qgs","shp","shx"],"x-quicktimeplayer":"qtl","x-redhat-package-manager":["rpm","rpa"],"x-ruby":"rb","x-sh":"sh","x-shar":"shar","x-shockwave-flash":["swf","swfl"],"x-silverlight":"scr","x-stuffit":"sit","x-sv4cpio":"sv4cpio","x-sv4crc":"sv4crc","x-tar":"tar","x-tex-gf":"gf","x-tex-pk":"pk","x-texinfo":["texinfo","texi"],"x-trash":["~","%","bak","old","sik"],"x-ustar":"ustar","x-wais-source":"src","x-wingz":"wz","x-x509-ca-cert":["crt","der","cer"],"x-xcf":"xcf","x-xfig":"fig","x-xpinstall":"xpi",applixware:"aw","atomsvc+xml":"atomsvc","ccxml+xml":"ccxml","cdmi-capability":"cdmia","cdmi-container":"cdmic","cdmi-domain":"cdmid","cdmi-object":"cdmio","cdmi-queue":"cdmiq","docbook+xml":"dbk","dssc+der":"dssc","dssc+xml":"xdssc","emma+xml":"emma","epub+zip":"epub",exi:"exi","font-tdpfr":"pfr","gml+xml":"gml","gpx+xml":"gpx",gxf:"gxf",hyperstudio:"stk","inkml+xml":["ink","inkml"],ipfix:"ipfix","jsonml+json":"jsonml","lost+xml":"lostxml","mads+xml":"mads",marc:"mrc","marcxml+xml":"mrcx","mathml+xml":["mathml","mml"],mbox:"mbox","mediaservercontrol+xml":"mscml","metalink+xml":"metalink","metalink4+xml":"meta4","mets+xml":"mets","mods+xml":"mods",mp21:["m21","mp21"],mp4:"mp4s","oebps-package+xml":"opf","omdoc+xml":"omdoc",onenote:["onetoc","onetoc2","onetmp","onepkg"],oxps:"oxps","patch-ops-error+xml":"xer","pgp-encrypted":"pgp",pkcs10:"p10","pkcs7-mime":["p7m","p7c"],"pkcs7-signature":"p7s",pkcs8:"p8","pkix-attr-cert":"ac","pkix-crl":"crl","pkix-pkipath":"pkipath",pkixcmp:"pki","pls+xml":"pls","prs.cww":"cww","pskc+xml":"pskcxml","reginfo+xml":"rif","relax-ng-compact-syntax":"rnc","resource-lists+xml":"rl","resource-lists-diff+xml":"rld","rls-services+xml":"rs","rpki-ghostbusters":"gbr","rpki-manifest":"mft","rpki-roa":"roa","rsd+xml":"rsd","sbml+xml":"sbml","scvp-cv-request":"scq","scvp-cv-response":"scs","scvp-vp-request":"spq","scvp-vp-response":"spp",sdp:"sdp","set-payment-initiation":"setpay","set-registration-initiation":"setreg","shf+xml":"shf","sparql-query":"rq","sparql-results+xml":"srx",srgs:"gram","srgs+xml":"grxml","sru+xml":"sru","ssdl+xml":"ssdl","ssml+xml":"ssml","tei+xml":["tei","teicorpus"],"thraud+xml":"tfi","timestamped-data":"tsd","vnd.3gpp.pic-bw-large":"plb","vnd.3gpp.pic-bw-small":"psb","vnd.3gpp.pic-bw-var":"pvb","vnd.3gpp2.tcap":"tcap","vnd.3m.post-it-notes":"pwn","vnd.accpac.simply.aso":"aso","vnd.accpac.simply.imp":"imp","vnd.acucobol":"acu","vnd.acucorp":["atc","acutc"],"vnd.adobe.air-application-installer-package+zip":"air","vnd.adobe.formscentral.fcdt":"fcdt","vnd.adobe.fxp":["fxp","fxpl"],"vnd.adobe.xdp+xml":"xdp","vnd.adobe.xfdf":"xfdf","vnd.ahead.space":"ahead","vnd.airzip.filesecure.azf":"azf","vnd.airzip.filesecure.azs":"azs","vnd.amazon.ebook":"azw","vnd.americandynamics.acc":"acc","vnd.amiga.ami":"ami","vnd.anser-web-certificate-issue-initiation":"cii","vnd.anser-web-funds-transfer-initiation":"fti","vnd.antix.game-component":"atx","vnd.apple.installer+xml":"mpkg","vnd.apple.mpegurl":"m3u8","vnd.aristanetworks.swi":"swi","vnd.astraea-software.iota":"iota","vnd.audiograph":"aep","vnd.blueice.multipass":"mpm","vnd.bmi":"bmi","vnd.businessobjects":"rep","vnd.chemdraw+xml":"cdxml","vnd.chipnuts.karaoke-mmd":"mmd","vnd.claymore":"cla","vnd.cloanto.rp9":"rp9","vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"vnd.cluetrust.cartomobile-config":"c11amc","vnd.cluetrust.cartomobile-config-pkg":"c11amz","vnd.commonspace":"csp","vnd.contact.cmsg":"cdbcmsg","vnd.cosmocaller":"cmc","vnd.crick.clicker":"clkx","vnd.crick.clicker.keyboard":"clkk","vnd.crick.clicker.palette":"clkp","vnd.crick.clicker.template":"clkt","vnd.crick.clicker.wordbank":"clkw","vnd.criticaltools.wbs+xml":"wbs","vnd.ctc-posml":"pml","vnd.cups-ppd":"ppd","vnd.curl.car":"car","vnd.curl.pcurl":"pcurl","vnd.dart":"dart","vnd.data-vision.rdz":"rdz","vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"vnd.dece.ttml+xml":["uvt","uvvt"],"vnd.dece.unspecified":["uvx","uvvx"],"vnd.dece.zip":["uvz","uvvz"],"vnd.denovo.fcselayout-link":"fe_launch","vnd.dna":"dna","vnd.dolby.mlp":"mlp","vnd.dpgraph":"dpg","vnd.dreamfactory":"dfac","vnd.ds-keypoint":"kpxx","vnd.dvb.ait":"ait","vnd.dvb.service":"svc","vnd.dynageo":"geo","vnd.ecowin.chart":"mag","vnd.enliven":"nml","vnd.epson.esf":"esf","vnd.epson.msf":"msf","vnd.epson.quickanime":"qam","vnd.epson.salt":"slt","vnd.epson.ssf":"ssf","vnd.eszigno3+xml":["es3","et3"],"vnd.ezpix-album":"ez2","vnd.ezpix-package":"ez3","vnd.fdf":"fdf","vnd.fdsn.mseed":"mseed","vnd.fdsn.seed":["seed","dataless"],"vnd.flographit":"gph","vnd.fluxtime.clip":"ftc","vnd.framemaker":["fm","frame","maker","book"],"vnd.frogans.fnc":"fnc","vnd.frogans.ltf":"ltf","vnd.fsc.weblaunch":"fsc","vnd.fujitsu.oasys":"oas","vnd.fujitsu.oasys2":"oa2","vnd.fujitsu.oasys3":"oa3","vnd.fujitsu.oasysgp":"fg5","vnd.fujitsu.oasysprs":"bh2","vnd.fujixerox.ddd":"ddd","vnd.fujixerox.docuworks":"xdw","vnd.fujixerox.docuworks.binder":"xbd","vnd.fuzzysheet":"fzs","vnd.genomatix.tuxedo":"txd","vnd.geogebra.file":"ggb","vnd.geogebra.tool":"ggt","vnd.geometry-explorer":["gex","gre"],"vnd.geonext":"gxt","vnd.geoplan":"g2w","vnd.geospace":"g3w","vnd.gmx":"gmx","vnd.grafeq":["gqf","gqs"],"vnd.groove-account":"gac","vnd.groove-help":"ghf","vnd.groove-identity-message":"gim","vnd.groove-injector":"grv","vnd.groove-tool-message":"gtm","vnd.groove-tool-template":"tpl","vnd.groove-vcard":"vcg","vnd.hal+xml":"hal","vnd.handheld-entertainment+xml":"zmm","vnd.hbci":"hbci","vnd.hhe.lesson-player":"les","vnd.hp-hpgl":"hpgl","vnd.hp-hpid":"hpid","vnd.hp-hps":"hps","vnd.hp-jlyt":"jlt","vnd.hp-pcl":"pcl","vnd.hp-pclxl":"pclxl","vnd.hydrostatix.sof-data":"sfd-hdstx","vnd.ibm.minipay":"mpy","vnd.ibm.modcap":["afp","listafp","list3820"],"vnd.ibm.rights-management":"irm","vnd.ibm.secure-container":"sc","vnd.iccprofile":["icc","icm"],"vnd.igloader":"igl","vnd.immervision-ivp":"ivp","vnd.immervision-ivu":"ivu","vnd.insors.igm":"igm","vnd.intercon.formnet":["xpw","xpx"],"vnd.intergeo":"i2g","vnd.intu.qbo":"qbo","vnd.intu.qfx":"qfx","vnd.ipunplugged.rcprofile":"rcprofile","vnd.irepository.package+xml":"irp","vnd.is-xpr":"xpr","vnd.isac.fcs":"fcs","vnd.jam":"jam","vnd.jcp.javame.midlet-rms":"rms","vnd.jisp":"jisp","vnd.joost.joda-archive":"joda","vnd.kahootz":["ktz","ktr"],"vnd.kde.karbon":"karbon","vnd.kde.kchart":"chrt","vnd.kde.kformula":"kfo","vnd.kde.kivio":"flw","vnd.kde.kontour":"kon","vnd.kde.kpresenter":["kpr","kpt"],"vnd.kde.kspread":"ksp","vnd.kde.kword":["kwd","kwt"],"vnd.kenameaapp":"htke","vnd.kidspiration":"kia","vnd.kinar":["kne","knp"],"vnd.koan":["skp","skd","skt","skm"],"vnd.kodak-descriptor":"sse","vnd.las.las+xml":"lasxml","vnd.llamagraphics.life-balance.desktop":"lbd","vnd.llamagraphics.life-balance.exchange+xml":"lbe","vnd.lotus-1-2-3":"123","vnd.lotus-approach":"apr","vnd.lotus-freelance":"pre","vnd.lotus-notes":"nsf","vnd.lotus-organizer":"org","vnd.lotus-screencam":"scm","vnd.lotus-wordpro":"lwp","vnd.macports.portpkg":"portpkg","vnd.mcd":"mcd","vnd.medcalcdata":"mc1","vnd.mediastation.cdkey":"cdkey","vnd.mfer":"mwf","vnd.mfmp":"mfm","vnd.micrografx.flo":"flo","vnd.micrografx.igx":"igx","vnd.mif":"mif","vnd.mobius.daf":"daf","vnd.mobius.dis":"dis","vnd.mobius.mbk":"mbk","vnd.mobius.mqy":"mqy","vnd.mobius.msl":"msl","vnd.mobius.plc":"plc","vnd.mobius.txf":"txf","vnd.mophun.application":"mpn","vnd.mophun.certificate":"mpc","vnd.ms-artgalry":"cil","vnd.ms-cab-compressed":"cab","vnd.ms-excel.addin.macroenabled.12":"xlam","vnd.ms-excel.sheet.binary.macroenabled.12":"xlsb","vnd.ms-excel.sheet.macroenabled.12":"xlsm","vnd.ms-excel.template.macroenabled.12":"xltm","vnd.ms-fontobject":"eot","vnd.ms-htmlhelp":"chm","vnd.ms-ims":"ims","vnd.ms-lrm":"lrm","vnd.ms-officetheme":"thmx","vnd.ms-powerpoint.addin.macroenabled.12":"ppam","vnd.ms-powerpoint.presentation.macroenabled.12":"pptm","vnd.ms-powerpoint.slide.macroenabled.12":"sldm","vnd.ms-powerpoint.slideshow.macroenabled.12":"ppsm","vnd.ms-powerpoint.template.macroenabled.12":"potm","vnd.ms-project":["mpp","mpt"],"vnd.ms-word.document.macroenabled.12":"docm","vnd.ms-word.template.macroenabled.12":"dotm","vnd.ms-works":["wps","wks","wcm","wdb"],"vnd.ms-wpl":"wpl","vnd.ms-xpsdocument":"xps","vnd.mseq":"mseq","vnd.musician":"mus","vnd.muvee.style":"msty","vnd.mynfc":"taglet","vnd.neurolanguage.nlu":"nlu","vnd.nitf":["ntf","nitf"],"vnd.noblenet-directory":"nnd","vnd.noblenet-sealer":"nns","vnd.noblenet-web":"nnw","vnd.nokia.n-gage.data":"ngdat","vnd.nokia.n-gage.symbian.install":"n-gage","vnd.nokia.radio-preset":"rpst","vnd.nokia.radio-presets":"rpss","vnd.novadigm.edm":"edm","vnd.novadigm.edx":"edx","vnd.novadigm.ext":"ext","vnd.oasis.opendocument.chart-template":"otc","vnd.oasis.opendocument.formula-template":"odft","vnd.oasis.opendocument.image-template":"oti","vnd.olpc-sugar":"xo","vnd.oma.dd2+xml":"dd2","vnd.openofficeorg.extension":"oxt","vnd.openxmlformats-officedocument.presentationml.slide":"sldx","vnd.osgeo.mapguide.package":"mgp","vnd.osgi.dp":"dp","vnd.osgi.subsystem":"esa","vnd.palm":["pdb","pqa","oprc"],"vnd.pawaafile":"paw","vnd.pg.format":"str","vnd.pg.osasli":"ei6","vnd.picsel":"efif","vnd.pmi.widget":"wg","vnd.pocketlearn":"plf","vnd.powerbuilder6":"pbd","vnd.previewsystems.box":"box","vnd.proteus.magazine":"mgz","vnd.publishare-delta-tree":"qps","vnd.pvi.ptid1":"ptid","vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"vnd.realvnc.bed":"bed","vnd.recordare.musicxml":"mxl","vnd.recordare.musicxml+xml":"musicxml","vnd.rig.cryptonote":"cryptonote","vnd.rn-realmedia":"rm","vnd.rn-realmedia-vbr":"rmvb","vnd.route66.link66+xml":"link66","vnd.sailingtracker.track":"st","vnd.seemail":"see","vnd.sema":"sema","vnd.semd":"semd","vnd.semf":"semf","vnd.shana.informed.formdata":"ifm","vnd.shana.informed.formtemplate":"itp","vnd.shana.informed.interchange":"iif","vnd.shana.informed.package":"ipk","vnd.simtech-mindmapper":["twd","twds"],"vnd.smart.teacher":"teacher","vnd.solent.sdkm+xml":["sdkm","sdkd"],"vnd.spotfire.dxp":"dxp","vnd.spotfire.sfs":"sfs","vnd.stepmania.package":"smzip","vnd.stepmania.stepchart":"sm","vnd.sus-calendar":["sus","susp"],"vnd.svd":"svd","vnd.syncml+xml":"xsm","vnd.syncml.dm+wbxml":"bdm","vnd.syncml.dm+xml":"xdm","vnd.tao.intent-module-archive":"tao","vnd.tcpdump.pcap":["pcap","cap","dmp"],"vnd.tmobile-livetv":"tmo","vnd.trid.tpt":"tpt","vnd.triscape.mxs":"mxs","vnd.trueapp":"tra","vnd.ufdl":["ufd","ufdl"],"vnd.uiq.theme":"utz","vnd.umajin":"umj","vnd.unity":"unityweb","vnd.uoml+xml":"uoml","vnd.vcx":"vcx","vnd.visionary":"vis","vnd.vsf":"vsf","vnd.webturbo":"wtb","vnd.wolfram.player":"nbp","vnd.wqd":"wqd","vnd.wt.stf":"stf","vnd.xara":"xar","vnd.xfdl":"xfdl","vnd.yamaha.hv-dic":"hvd","vnd.yamaha.hv-script":"hvs","vnd.yamaha.hv-voice":"hvp","vnd.yamaha.openscoreformat":"osf","vnd.yamaha.openscoreformat.osfpvg+xml":"osfpvg","vnd.yamaha.smaf-audio":"saf","vnd.yamaha.smaf-phrase":"spf","vnd.yellowriver-custom-menu":"cmp","vnd.zul":["zir","zirz"],"vnd.zzazz.deck+xml":"zaz","voicexml+xml":"vxml",widget:"wgt",winhlp:"hlp","wsdl+xml":"wsdl","wspolicy+xml":"wspolicy","x-ace-compressed":"ace","x-authorware-bin":["aab","x32","u32","vox"],"x-authorware-map":"aam","x-authorware-seg":"aas","x-blorb":["blb","blorb"],"x-bzip":"bz","x-bzip2":["bz2","boz"],"x-cfs-compressed":"cfs","x-chat":"chat","x-conference":"nsc","x-dgc-compressed":"dgc","x-dtbncx+xml":"ncx","x-dtbook+xml":"dtb","x-dtbresource+xml":"res","x-eva":"eva","x-font-bdf":"bdf","x-font-ghostscript":"gsf","x-font-linux-psf":"psf","x-font-pcf":"pcf","x-font-snf":"snf","x-font-ttf":["ttf","ttc"],"x-font-type1":["pfa","pfb","pfm","afm"],"x-freearc":"arc","x-gca-compressed":"gca","x-glulx":"ulx","x-gramps-xml":"gramps","x-install-instructions":"install","x-lzh-compressed":["lzh","lha"],"x-mie":"mie","x-mobipocket-ebook":["prc","mobi"],"x-ms-application":"application","x-ms-shortcut":"lnk","x-ms-xbap":"xbap","x-msbinder":"obd","x-mscardfile":"crd","x-msclip":"clp","application/x-ms-installer":"msi","x-msmediaview":["mvb","m13","m14"],"x-msmetafile":["wmf","wmz","emf","emz"],"x-msmoney":"mny","x-mspublisher":"pub","x-msschedule":"scd","x-msterminal":"trm","x-mswrite":"wri","x-nzb":"nzb","x-pkcs12":["p12","pfx"],"x-pkcs7-certificates":["p7b","spc"],"x-research-info-systems":"ris","x-silverlight-app":"xap","x-sql":"sql","x-stuffitx":"sitx","x-subrip":"srt","x-t3vm-image":"t3","x-tex-tfm":"tfm","x-tgif":"obj","x-xliff+xml":"xlf","x-xz":"xz","x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"xaml+xml":"xaml","xcap-diff+xml":"xdf","xenc+xml":"xenc","xml-dtd":"dtd","xop+xml":"xop","xproc+xml":"xpl","xslt+xml":"xslt","xv+xml":["mxml","xhvml","xvml","xvm"],yang:"yang","yin+xml":"yin",envoy:"evy",fractals:"fif","internet-property-stream":"acx",olescript:"axs","vnd.ms-outlook":"msg","vnd.ms-pkicertstore":"sst","x-compress":"z","x-perfmon":["pma","pmc","pmr","pmw"],"ynd.ms-pkipko":"pko",gzip:["gz","tgz"],"smil+xml":["smi","smil"],"vnd.debian.binary-package":["deb","udeb"],"vnd.hzn-3d-crossword":"x3d","vnd.sqlite3":["db","sqlite","sqlite3","db-wal","sqlite-wal","db-shm","sqlite-shm"],"vnd.wap.sic":"sic","vnd.wap.slc":"slc","x-krita":["kra","krz"],"x-perl":["pm","pl"],yaml:["yaml","yml"]},audio:{amr:"amr","amr-wb":"awb",annodex:"axa",basic:["au","snd"],flac:"flac",midi:["mid","midi","kar","rmi"],mpeg:["mpga","mpega","mp3","m4a","mp2a","m2a","m3a"],mpegurl:"m3u",ogg:["oga","ogg","spx"],"prs.sid":"sid","x-aiff":"aifc","x-gsm":"gsm","x-ms-wma":"wma","x-ms-wax":"wax","x-pn-realaudio":"ram","x-realaudio":"ra","x-sd2":"sd2",adpcm:"adp",mp4:"mp4a",s3m:"s3m",silk:"sil","vnd.dece.audio":["uva","uvva"],"vnd.digital-winds":"eol","vnd.dra":"dra","vnd.dts":"dts","vnd.dts.hd":"dtshd","vnd.lucent.voice":"lvp","vnd.ms-playready.media.pya":"pya","vnd.nuera.ecelp4800":"ecelp4800","vnd.nuera.ecelp7470":"ecelp7470","vnd.nuera.ecelp9600":"ecelp9600","vnd.rip":"rip",webm:"weba","x-caf":"caf","x-matroska":"mka","x-pn-realaudio-plugin":"rmp",xm:"xm",aac:"aac",aiff:["aiff","aif","aff"],opus:"opus",wav:"wav"},chemical:{"x-alchemy":"alc","x-cache":["cac","cache"],"x-cache-csf":"csf","x-cactvs-binary":["cbin","cascii","ctab"],"x-cdx":"cdx","x-chem3d":"c3d","x-cif":"cif","x-cmdf":"cmdf","x-cml":"cml","x-compass":"cpa","x-crossfire":"bsd","x-csml":["csml","csm"],"x-ctx":"ctx","x-cxf":["cxf","cef"],"x-embl-dl-nucleotide":["emb","embl"],"x-gamess-input":["inp","gam","gamin"],"x-gaussian-checkpoint":["fch","fchk"],"x-gaussian-cube":"cub","x-gaussian-input":["gau","gjc","gjf"],"x-gaussian-log":"gal","x-gcg8-sequence":"gcg","x-genbank":"gen","x-hin":"hin","x-isostar":["istr","ist"],"x-jcamp-dx":["jdx","dx"],"x-kinemage":"kin","x-macmolecule":"mcm","x-macromodel-input":"mmod","x-mdl-molfile":"mol","x-mdl-rdfile":"rd","x-mdl-rxnfile":"rxn","x-mdl-sdfile":"sd","x-mdl-tgf":"tgf","x-mmcif":"mcif","x-mol2":"mol2","x-molconn-Z":"b","x-mopac-graph":"gpt","x-mopac-input":["mop","mopcrt","zmt"],"x-mopac-out":"moo","x-ncbi-asn1":"asn","x-ncbi-asn1-ascii":["prt","ent"],"x-ncbi-asn1-binary":"val","x-rosdal":"ros","x-swissprot":"sw","x-vamas-iso14976":"vms","x-vmd":"vmd","x-xtel":"xtel","x-xyz":"xyz"},font:{otf:"otf",woff:"woff",woff2:"woff2"},image:{gif:"gif",ief:"ief",jpeg:["jpeg","jpg","jpe","jfif","jfif-tbnl","jif"],pcx:"pcx",png:"png","svg+xml":["svg","svgz"],tiff:["tiff","tif"],"vnd.djvu":["djvu","djv"],"vnd.wap.wbmp":"wbmp","x-canon-cr2":"cr2","x-canon-crw":"crw","x-cmu-raster":"ras","x-coreldraw":"cdr","x-coreldrawpattern":"pat","x-coreldrawtemplate":"cdt","x-corelphotopaint":"cpt","x-epson-erf":"erf","x-icon":"ico","x-jg":"art","x-jng":"jng","x-nikon-nef":"nef","x-olympus-orf":"orf","x-portable-anymap":"pnm","x-portable-bitmap":"pbm","x-portable-graymap":"pgm","x-portable-pixmap":"ppm","x-rgb":"rgb","x-xbitmap":"xbm","x-xpixmap":"xpm","x-xwindowdump":"xwd",bmp:"bmp",cgm:"cgm",g3fax:"g3",ktx:"ktx","prs.btif":"btif",sgi:"sgi","vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"vnd.dwg":"dwg","vnd.dxf":"dxf","vnd.fastbidsheet":"fbs","vnd.fpx":"fpx","vnd.fst":"fst","vnd.fujixerox.edmics-mmr":"mmr","vnd.fujixerox.edmics-rlc":"rlc","vnd.ms-modi":"mdi","vnd.ms-photo":"wdp","vnd.net-fpx":"npx","vnd.xiff":"xif",webp:"webp","x-3ds":"3ds","x-cmx":"cmx","x-freehand":["fh","fhc","fh4","fh5","fh7"],"x-pict":["pic","pct"],"x-tga":"tga","cis-cod":"cod",avif:"avifs",heic:["heif","heic"],pjpeg:["pjpg"],"vnd.adobe.photoshop":"psd","x-adobe-dng":"dng","x-fuji-raf":"raf","x-icns":"icns","x-kodak-dcr":"dcr","x-kodak-k25":"k25","x-kodak-kdc":"kdc","x-minolta-mrw":"mrw","x-panasonic-raw":["raw","rw2","rwl"],"x-pentax-pef":["pef","ptx"],"x-sigma-x3f":"x3f","x-sony-arw":"arw","x-sony-sr2":"sr2","x-sony-srf":"srf"},message:{rfc822:["eml","mime","mht","mhtml","nws"]},model:{iges:["igs","iges"],mesh:["msh","mesh","silo"],vrml:["wrl","vrml"],"x3d+vrml":["x3dv","x3dvz"],"x3d+xml":"x3dz","x3d+binary":["x3db","x3dbz"],"vnd.collada+xml":"dae","vnd.dwf":"dwf","vnd.gdl":"gdl","vnd.gtw":"gtw","vnd.mts":"mts","vnd.usdz+zip":"usdz","vnd.vtu":"vtu"},text:{"cache-manifest":["manifest","appcache"],calendar:["ics","icz","ifb"],css:"css",csv:"csv",h323:"323",html:["html","htm","shtml","stm"],iuls:"uls",plain:["txt","text","brf","conf","def","list","log","in","bas","diff","ksh"],richtext:"rtx",scriptlet:["sct","wsc"],texmacs:"tm","tab-separated-values":"tsv","vnd.sun.j2me.app-descriptor":"jad","vnd.wap.wml":"wml","vnd.wap.wmlscript":"wmls","x-bibtex":"bib","x-boo":"boo","x-c++hdr":["h++","hpp","hxx","hh"],"x-c++src":["c++","cpp","cxx","cc"],"x-component":"htc","x-dsrc":"d","x-diff":"patch","x-haskell":"hs","x-java":"java","x-literate-haskell":"lhs","x-moc":"moc","x-pascal":["p","pas","pp","inc"],"x-pcs-gcd":"gcd","x-python":"py","x-scala":"scala","x-setext":"etx","x-tcl":["tcl","tk"],"x-tex":["tex","ltx","sty","cls"],"x-vcalendar":"vcs","x-vcard":"vcf",n3:"n3","prs.lines.tag":"dsc",sgml:["sgml","sgm"],troff:["t","tr","roff","man","me","ms"],turtle:"ttl","uri-list":["uri","uris","urls"],vcard:"vcard","vnd.curl":"curl","vnd.curl.dcurl":"dcurl","vnd.curl.scurl":"scurl","vnd.curl.mcurl":"mcurl","vnd.dvb.subtitle":"sub","vnd.fly":"fly","vnd.fmi.flexstor":"flx","vnd.graphviz":"gv","vnd.in3d.3dml":"3dml","vnd.in3d.spot":"spot","x-asm":["s","asm"],"x-c":["c","h","dic"],"x-fortran":["f","for","f77","f90"],"x-opml":"opml","x-nfo":"nfo","x-sfv":"sfv","x-uuencode":"uu",webviewhtml:"htt",javascript:"js",json:"json",markdown:["md","markdown","mdown","markdn"],"vnd.wap.si":"si","vnd.wap.sl":"sl"},video:{avif:"avif","3gpp":"3gp",annodex:"axv",dl:"dl",dv:["dif","dv"],fli:"fli",gl:"gl",mpeg:["mpeg","mpg","mpe","m1v","m2v","mp2","mpa","mpv2"],mp4:["mp4","mp4v","mpg4"],quicktime:["qt","mov"],ogg:"ogv","vnd.mpegurl":["mxu","m4u"],"x-flv":"flv","x-la-asf":["lsf","lsx"],"x-mng":"mng","x-ms-asf":["asf","asx","asr"],"x-ms-wm":"wm","x-ms-wmv":"wmv","x-ms-wmx":"wmx","x-ms-wvx":"wvx","x-msvideo":"avi","x-sgi-movie":"movie","x-matroska":["mpv","mkv","mk3d","mks"],"3gpp2":"3g2",h261:"h261",h263:"h263",h264:"h264",jpeg:"jpgv",jpm:["jpm","jpgm"],mj2:["mj2","mjp2"],"vnd.dece.hd":["uvh","uvvh"],"vnd.dece.mobile":["uvm","uvvm"],"vnd.dece.pd":["uvp","uvvp"],"vnd.dece.sd":["uvs","uvvs"],"vnd.dece.video":["uvv","uvvv"],"vnd.dvb.file":"dvb","vnd.fvt":"fvt","vnd.ms-playready.media.pyv":"pyv","vnd.uvvu.mp4":["uvu","uvvu"],"vnd.vivo":"viv",webm:"webm","x-f4v":"f4v","x-m4v":"m4v","x-ms-vob":"vob","x-smv":"smv",mp2t:"ts"},"x-conference":{"x-cooltalk":"ice"},"x-world":{"x-vrml":["vrm","flr","wrz","xaf","xof"]}};(()=>{const i={};for(const e of Object.keys(oL))for(const t of Object.keys(oL[e])){const n=oL[e][t];if(typeof n=="string")i[n]=e+"/"+t;else for(let o=0;o<n.length;o++)i[n[o]]=e+"/"+t}return i})();const jhe=[];for(let i=0;i<256;i++){let e=i;for(let t=0;t<8;t++)e&1?e=e>>>1^3988292384:e=e>>>1;jhe[i]=e}class Ow{constructor(e){this.crc=e||-1}append(e){let t=this.crc|0;for(let n=0,o=e.length|0;n<o;n++)t=t>>>8^jhe[(t^e[n])&255];this.crc=t}get(){return~this.crc}}class Ghe extends TransformStream{constructor(){let e;const t=new Ow;super({transform(n,o){t.append(n),o.enqueue(n)},flush(){const n=new Uint8Array(4);new DataView(n.buffer).setUint32(0,t.get()),e.value=n}}),e=this}}function dNt(i){if(typeof TextEncoder==hd){i=unescape(encodeURIComponent(i));const e=new Uint8Array(i.length);for(let t=0;t<e.length;t++)e[t]=i.charCodeAt(t);return e}else return new TextEncoder().encode(i)}const Ss={concat(i,e){if(i.length===0||e.length===0)return i.concat(e);const t=i[i.length-1],n=Ss.getPartial(t);return n===32?i.concat(e):Ss._shiftRight(e,n,t|0,i.slice(0,i.length-1))},bitLength(i){const e=i.length;if(e===0)return 0;const t=i[e-1];return(e-1)*32+Ss.getPartial(t)},clamp(i,e){if(i.length*32<e)return i;i=i.slice(0,Math.ceil(e/32));const t=i.length;return e=e&31,t>0&&e&&(i[t-1]=Ss.partial(e,i[t-1]&2147483648>>e-1,1)),i},partial(i,e,t){return i===32?e:(t?e|0:e<<32-i)+i*1099511627776},getPartial(i){return Math.round(i/1099511627776)||32},_shiftRight(i,e,t,n){for(n===void 0&&(n=[]);e>=32;e-=32)n.push(t),t=0;if(e===0)return n.concat(i);for(let s=0;s<i.length;s++)n.push(t|i[s]>>>e),t=i[s]<<32-e;const o=i.length?i[i.length-1]:0,r=Ss.getPartial(o);return n.push(Ss.partial(e+r&31,e+r>32?t:n.pop(),1)),n}},Uw={bytes:{fromBits(i){const t=Ss.bitLength(i)/8,n=new Uint8Array(t);let o;for(let r=0;r<t;r++)r&3||(o=i[r/4]),n[r]=o>>>24,o<<=8;return n},toBits(i){const e=[];let t,n=0;for(t=0;t<i.length;t++)n=n<<8|i[t],(t&3)===3&&(e.push(n),n=0);return t&3&&e.push(Ss.partial(8*(t&3),n)),e}}},qhe={};qhe.sha1=class{constructor(i){const e=this;e.blockSize=512,e._init=[1732584193,4023233417,2562383102,271733878,3285377520],e._key=[1518500249,1859775393,2400959708,3395469782],i?(e._h=i._h.slice(0),e._buffer=i._buffer.slice(0),e._length=i._length):e.reset()}reset(){const i=this;return i._h=i._init.slice(0),i._buffer=[],i._length=0,i}update(i){const e=this;typeof i=="string"&&(i=Uw.utf8String.toBits(i));const t=e._buffer=Ss.concat(e._buffer,i),n=e._length,o=e._length=n+Ss.bitLength(i);if(o>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");const r=new Uint32Array(t);let s=0;for(let a=e.blockSize+n-(e.blockSize+n&e.blockSize-1);a<=o;a+=e.blockSize)e._block(r.subarray(16*s,16*(s+1))),s+=1;return t.splice(0,16*s),e}finalize(){const i=this;let e=i._buffer;const t=i._h;e=Ss.concat(e,[Ss.partial(1,1)]);for(let n=e.length+2;n&15;n++)e.push(0);for(e.push(Math.floor(i._length/4294967296)),e.push(i._length|0);e.length;)i._block(e.splice(0,16));return i.reset(),t}_f(i,e,t,n){if(i<=19)return e&t|~e&n;if(i<=39)return e^t^n;if(i<=59)return e&t|e&n|t&n;if(i<=79)return e^t^n}_S(i,e){return e<<i|e>>>32-i}_block(i){const e=this,t=e._h,n=Array(80);for(let c=0;c<16;c++)n[c]=i[c];let o=t[0],r=t[1],s=t[2],a=t[3],l=t[4];for(let c=0;c<=79;c++){c>=16&&(n[c]=e._S(1,n[c-3]^n[c-8]^n[c-14]^n[c-16]));const u=e._S(5,o)+e._f(c,r,s,a)+l+n[c]+e._key[Math.floor(c/20)]|0;l=a,a=s,s=e._S(30,r),r=o,o=u}t[0]=t[0]+o|0,t[1]=t[1]+r|0,t[2]=t[2]+s|0,t[3]=t[3]+a|0,t[4]=t[4]+l|0}};const Qhe={};Qhe.aes=class{constructor(i){const e=this;e._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],e._tables[0][0][0]||e._precompute();const t=e._tables[0][4],n=e._tables[1],o=i.length;let r,s,a,l=1;if(o!==4&&o!==6&&o!==8)throw new Error("invalid aes key size");for(e._key=[s=i.slice(0),a=[]],r=o;r<4*o+28;r++){let c=s[r-1];(r%o===0||o===8&&r%o===4)&&(c=t[c>>>24]<<24^t[c>>16&255]<<16^t[c>>8&255]<<8^t[c&255],r%o===0&&(c=c<<8^c>>>24^l<<24,l=l<<1^(l>>7)*283)),s[r]=s[r-o]^c}for(let c=0;r;c++,r--){const u=s[c&3?r:r-4];r<=4||c<4?a[c]=u:a[c]=n[0][t[u>>>24]]^n[1][t[u>>16&255]]^n[2][t[u>>8&255]]^n[3][t[u&255]]}}encrypt(i){return this._crypt(i,0)}decrypt(i){return this._crypt(i,1)}_precompute(){const i=this._tables[0],e=this._tables[1],t=i[4],n=e[4],o=[],r=[];let s,a,l,c;for(let u=0;u<256;u++)r[(o[u]=u<<1^(u>>7)*283)^u]=u;for(let u=s=0;!t[u];u^=a||1,s=r[s]||1){let d=s^s<<1^s<<2^s<<3^s<<4;d=d>>8^d&255^99,t[u]=d,n[d]=u,c=o[l=o[a=o[u]]];let h=c*16843009^l*65537^a*257^u*16843008,f=o[d]*257^d*16843008;for(let A=0;A<4;A++)i[A][u]=f=f<<24^f>>>8,e[A][d]=h=h<<24^h>>>8}for(let u=0;u<5;u++)i[u]=i[u].slice(0),e[u]=e[u].slice(0)}_crypt(i,e){if(i.length!==4)throw new Error("invalid aes block size");const t=this._key[e],n=t.length/4-2,o=[0,0,0,0],r=this._tables[e],s=r[0],a=r[1],l=r[2],c=r[3],u=r[4];let d=i[0]^t[0],h=i[e?3:1]^t[1],f=i[2]^t[2],A=i[e?1:3]^t[3],p=4,m,g,w;for(let y=0;y<n;y++)m=s[d>>>24]^a[h>>16&255]^l[f>>8&255]^c[A&255]^t[p],g=s[h>>>24]^a[f>>16&255]^l[A>>8&255]^c[d&255]^t[p+1],w=s[f>>>24]^a[A>>16&255]^l[d>>8&255]^c[h&255]^t[p+2],A=s[A>>>24]^a[d>>16&255]^l[h>>8&255]^c[f&255]^t[p+3],p+=4,d=m,h=g,f=w;for(let y=0;y<4;y++)o[e?3&-y:y]=u[d>>>24]<<24^u[h>>16&255]<<16^u[f>>8&255]<<8^u[A&255]^t[p++],m=d,d=h,h=f,f=A,A=m;return o}};const hNt={getRandomValues(i){const e=new Uint32Array(i.buffer),t=n=>{let o=987654321;const r=4294967295;return function(){return o=36969*(o&65535)+(o>>16)&r,n=18e3*(n&65535)+(n>>16)&r,(((o<<16)+n&r)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let n=0,o;n<i.length;n+=4){const r=t((o||Math.random())*4294967296);o=r()*987654071,e[n/4]=r()*4294967296|0}return i}},Khe={};Khe.ctrGladman=class{constructor(i,e){this._prf=i,this._initIv=e,this._iv=e}reset(){this._iv=this._initIv}update(i){return this.calculate(this._prf,i,this._iv)}incWord(i){if((i>>24&255)===255){let e=i>>16&255,t=i>>8&255,n=i&255;e===255?(e=0,t===255?(t=0,n===255?n=0:++n):++t):++e,i=0,i+=e<<16,i+=t<<8,i+=n}else i+=1<<24;return i}incCounter(i){(i[0]=this.incWord(i[0]))===0&&(i[1]=this.incWord(i[1]))}calculate(i,e,t){let n;if(!(n=e.length))return[];const o=Ss.bitLength(e);for(let r=0;r<n;r+=4){this.incCounter(t);const s=i.encrypt(t);e[r]^=s[0],e[r+1]^=s[1],e[r+2]^=s[2],e[r+3]^=s[3]}return Ss.clamp(e,o)}};const qh={importKey(i){return new qh.hmacSha1(Uw.bytes.toBits(i))},pbkdf2(i,e,t,n){if(t=t||1e4,n<0||t<0)throw new Error("invalid params to pbkdf2");const o=(n>>5)+1<<2;let r,s,a,l,c;const u=new ArrayBuffer(o),d=new DataView(u);let h=0;const f=Ss;for(e=Uw.bytes.toBits(e),c=1;h<(o||1);c++){for(r=s=i.encrypt(f.concat(e,[c])),a=1;a<t;a++)for(s=i.encrypt(s),l=0;l<s.length;l++)r[l]^=s[l];for(a=0;h<(o||1)&&a<r.length;a++)d.setInt32(h,r[a]),h+=4}return u.slice(0,n/8)}};qh.hmacSha1=class{constructor(i){const e=this,t=e._hash=qhe.sha1,n=[[],[]];e._baseHash=[new t,new t];const o=e._baseHash[0].blockSize/32;i.length>o&&(i=new t().update(i).finalize());for(let r=0;r<o;r++)n[0][r]=i[r]^909522486,n[1][r]=i[r]^1549556828;e._baseHash[0].update(n[0]),e._baseHash[1].update(n[1]),e._resultHash=new t(e._baseHash[0])}reset(){const i=this;i._resultHash=new i._hash(i._baseHash[0]),i._updated=!1}update(i){const e=this;e._updated=!0,e._resultHash.update(i)}digest(){const i=this,e=i._resultHash.finalize(),t=new i._hash(i._baseHash[1]).update(e).finalize();return i.reset(),t}encrypt(i){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(i),this.digest(i)}};const pNt=typeof crypto!=hd&&typeof crypto.getRandomValues==d5,Jhe="Invalid password",Zhe="Invalid signature",sL="zipjs-abort-check-password";function Whe(i){return pNt?crypto.getRandomValues(i):hNt.getRandomValues(i)}const wm=16,fNt="raw",Xhe={name:"PBKDF2"},ANt={name:"HMAC"},mNt="SHA-1",gNt=Object.assign({hash:ANt},Xhe),rL=Object.assign({iterations:1e3,hash:{name:mNt}},Xhe),vNt=["deriveBits"],h5=[8,12,16],p5=[16,24,32],Ad=10,yNt=[0,0,0,0],Nw=typeof crypto!=hd,f5=Nw&&crypto.subtle,Yhe=Nw&&typeof f5!=hd,Bl=Uw.bytes,wNt=Qhe.aes,CNt=Khe.ctrGladman,bNt=qh.hmacSha1;let $he=Nw&&Yhe&&typeof f5.importKey==d5,epe=Nw&&Yhe&&typeof f5.deriveBits==d5;class xNt extends TransformStream{constructor({password:e,rawPassword:t,signed:n,encryptionStrength:o,checkPasswordOnly:r}){super({start(){Object.assign(this,{ready:new Promise(s=>this.resolveReady=s),password:npe(e,t),signed:n,strength:o-1,pending:new Uint8Array})},async transform(s,a){const l=this,{password:c,strength:u,resolveReady:d,ready:h}=l;c?(await ENt(l,u,c,ia(s,0,h5[u]+2)),s=ia(s,h5[u]+2),r?a.error(new Error(sL)):d()):await h;const f=new Uint8Array(s.length-Ad-(s.length-Ad)%wm);a.enqueue(tpe(l,s,f,0,Ad,!0))},async flush(s){const{signed:a,ctr:l,hmac:c,pending:u,ready:d}=this;if(c&&l){await d;const h=ia(u,0,u.length-Ad),f=ia(u,u.length-Ad);let A=new Uint8Array;if(h.length){const p=m5(Bl,h);c.update(p);const m=l.update(p);A=A5(Bl,m)}if(a){const p=ia(A5(Bl,c.digest()),0,Ad);for(let m=0;m<Ad;m++)if(p[m]!=f[m])throw new Error(Zhe)}s.enqueue(A)}}})}}class MNt extends TransformStream{constructor({password:e,rawPassword:t,encryptionStrength:n}){let o;super({start(){Object.assign(this,{ready:new Promise(r=>this.resolveReady=r),password:npe(e,t),strength:n-1,pending:new Uint8Array})},async transform(r,s){const a=this,{password:l,strength:c,resolveReady:u,ready:d}=a;let h=new Uint8Array;l?(h=await BNt(a,c,l),u()):await d;const f=new Uint8Array(h.length+r.length-r.length%wm);f.set(h,0),s.enqueue(tpe(a,r,f,h.length,0))},async flush(r){const{ctr:s,hmac:a,pending:l,ready:c}=this;if(a&&s){await c;let u=new Uint8Array;if(l.length){const d=s.update(m5(Bl,l));a.update(d),u=A5(Bl,d)}o.signature=A5(Bl,a.digest()).slice(0,Ad),r.enqueue(aL(u,o.signature))}}}),o=this}}function tpe(i,e,t,n,o,r){const{ctr:s,hmac:a,pending:l}=i,c=e.length-o;l.length&&(e=aL(l,e),t=PNt(t,c-c%wm));let u;for(u=0;u<=c-wm;u+=wm){const d=m5(Bl,ia(e,u,u+wm));r&&a.update(d);const h=s.update(d);r||a.update(h),t.set(A5(Bl,h),u+n)}return i.pending=ia(e,u),t}async function ENt(i,e,t,n){const o=await ipe(i,e,t,ia(n,0,h5[e])),r=ia(n,h5[e]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(Jhe)}async function BNt(i,e,t){const n=Whe(new Uint8Array(h5[e])),o=await ipe(i,e,t,n);return aL(n,o)}async function ipe(i,e,t,n){i.password=null;const o=await SNt(fNt,t,gNt,!1,vNt),r=await INt(Object.assign({salt:n},rL),o,8*(p5[e]*2+2)),s=new Uint8Array(r),a=m5(Bl,ia(s,0,p5[e])),l=m5(Bl,ia(s,p5[e],p5[e]*2)),c=ia(s,p5[e]*2);return Object.assign(i,{keys:{key:a,authentication:l,passwordVerification:c},ctr:new CNt(new wNt(a),Array.from(yNt)),hmac:new bNt(l)}),c}async function SNt(i,e,t,n,o){if($he)try{return await f5.importKey(i,e,t,n,o)}catch{return $he=!1,qh.importKey(e)}else return qh.importKey(e)}async function INt(i,e,t){if(epe)try{return await f5.deriveBits(i,e,t)}catch{return epe=!1,qh.pbkdf2(e,i.salt,rL.iterations,t)}else return qh.pbkdf2(e,i.salt,rL.iterations,t)}function npe(i,e){return e===Bs?dNt(i):e}function aL(i,e){let t=i;return i.length+e.length&&(t=new Uint8Array(i.length+e.length),t.set(i,0),t.set(e,i.length)),t}function PNt(i,e){if(e&&e>i.length){const t=i;i=new Uint8Array(e),i.set(t,0)}return i}function ia(i,e,t){return i.subarray(e,t)}function A5(i,e){return i.fromBits(e)}function m5(i,e){return i.toBits(e)}const Cm=12;class TNt extends TransformStream{constructor({password:e,passwordVerification:t,checkPasswordOnly:n}){super({start(){Object.assign(this,{password:e,passwordVerification:t}),rpe(this,e)},transform(o,r){const s=this;if(s.password){const a=ope(s,o.subarray(0,Cm));if(s.password=null,a[Cm-1]!=s.passwordVerification)throw new Error(Jhe);o=o.subarray(Cm)}n?r.error(new Error(sL)):r.enqueue(ope(s,o))}})}}class kNt extends TransformStream{constructor({password:e,passwordVerification:t}){super({start(){Object.assign(this,{password:e,passwordVerification:t}),rpe(this,e)},transform(n,o){const r=this;let s,a;if(r.password){r.password=null;const l=Whe(new Uint8Array(Cm));l[Cm-1]=r.passwordVerification,s=new Uint8Array(n.length+l.length),s.set(spe(r,l),0),a=Cm}else s=new Uint8Array(n.length),a=0;s.set(spe(r,n),a),o.enqueue(s)}})}}function ope(i,e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=ape(i)^e[n],lL(i,t[n]);return t}function spe(i,e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=ape(i)^e[n],lL(i,e[n]);return t}function rpe(i,e){const t=[305419896,591751049,878082192];Object.assign(i,{keys:t,crcKey0:new Ow(t[0]),crcKey2:new Ow(t[2])});for(let n=0;n<e.length;n++)lL(i,e.charCodeAt(n))}function lL(i,e){let[t,n,o]=i.keys;i.crcKey0.append([e]),t=~i.crcKey0.get(),n=cpe(Math.imul(cpe(n+lpe(t)),134775813)+1),i.crcKey2.append([n>>>24]),o=~i.crcKey2.get(),i.keys=[t,n,o]}function ape(i){const e=i.keys[2]|2;return lpe(Math.imul(e,e^1)>>>8)}function lpe(i){return i&255}function cpe(i){return i&4294967295}const upe="deflate-raw";class RNt extends TransformStream{constructor(e,{chunkSize:t,CompressionStream:n,CompressionStreamNative:o}){super({});const{compressed:r,encrypted:s,useCompressionStream:a,zipCrypto:l,signed:c,level:u}=e,d=this;let h,f,A=dpe(super.readable);(!s||l)&&c&&(h=new Ghe,A=Sl(A,h)),r&&(A=ppe(A,a,{level:u,chunkSize:t},o,n)),s&&(l?A=Sl(A,new kNt(e)):(f=new MNt(e),A=Sl(A,f))),hpe(d,A,()=>{let p;s&&!l&&(p=f.signature),(!s||l)&&c&&(p=new DataView(h.value.buffer).getUint32(0)),d.signature=p})}}class DNt extends TransformStream{constructor(e,{chunkSize:t,DecompressionStream:n,DecompressionStreamNative:o}){super({});const{zipCrypto:r,encrypted:s,signed:a,signature:l,compressed:c,useCompressionStream:u}=e;let d,h,f=dpe(super.readable);s&&(r?f=Sl(f,new TNt(e)):(h=new xNt(e),f=Sl(f,h))),c&&(f=ppe(f,u,{chunkSize:t},o,n)),(!s||r)&&a&&(d=new Ghe,f=Sl(f,d)),hpe(this,f,()=>{if((!s||r)&&a){const A=new DataView(d.value.buffer);if(l!=A.getUint32(0,!1))throw new Error(Zhe)}})}}function dpe(i){return Sl(i,new TransformStream({transform(e,t){e&&e.length&&t.enqueue(e)}}))}function hpe(i,e,t){e=Sl(e,new TransformStream({flush:t})),Object.defineProperty(i,"readable",{get(){return e}})}function ppe(i,e,t,n,o){try{const r=e&&n?n:o;i=Sl(i,new r(upe,t))}catch{if(e)try{i=Sl(i,new o(upe,t))}catch{return i}else return i}return i}function Sl(i,e){return i.pipeThrough(e)}const _Nt="message",LNt="start",FNt="pull",fpe="data",ONt="ack",Ape="close",UNt="deflate",mpe="inflate";class NNt extends TransformStream{constructor(e,t){super({});const n=this,{codecType:o}=e;let r;o.startsWith(UNt)?r=RNt:o.startsWith(mpe)&&(r=DNt);let s=0,a=0;const l=new r(e,t),c=super.readable,u=new TransformStream({transform(h,f){h&&h.length&&(a+=h.length,f.enqueue(h))},flush(){Object.assign(n,{inputSize:a})}}),d=new TransformStream({transform(h,f){h&&h.length&&(s+=h.length,f.enqueue(h))},flush(){const{signature:h}=l;Object.assign(n,{signature:h,outputSize:s,inputSize:a})}});Object.defineProperty(n,"readable",{get(){return c.pipeThrough(u).pipeThrough(l).pipeThrough(d)}})}}class VNt extends TransformStream{constructor(e){let t;super({transform:n,flush(o){t&&t.length&&o.enqueue(t)}});function n(o,r){if(t){const s=new Uint8Array(t.length+o.length);s.set(t),s.set(o,t.length),o=s,t=null}o.length>e?(r.enqueue(o.slice(0,e)),n(o.slice(e),r)):t=o}}}let gpe=typeof Worker!=hd;class cL{constructor(e,{readable:t,writable:n},{options:o,config:r,streamOptions:s,useWebWorkers:a,transferStreams:l,scripts:c},u){const{signal:d}=s;return Object.assign(e,{busy:!0,readable:t.pipeThrough(new VNt(r.chunkSize)).pipeThrough(new HNt(t,s),{signal:d}),writable:n,options:Object.assign({},o),scripts:c,transferStreams:l,terminate(){return new Promise(h=>{const{worker:f,busy:A}=e;f?(A?e.resolveTerminated=h:(f.terminate(),h()),e.interface=null):h()})},onTaskFinished(){const{resolveTerminated:h}=e;h&&(e.resolveTerminated=null,e.terminated=!0,e.worker.terminate(),h()),e.busy=!1,u(e)}}),(a&&gpe?zNt:vpe)(e,r)}}class HNt extends TransformStream{constructor(e,{onstart:t,onprogress:n,size:o,onend:r}){let s=0;super({async start(){t&&await uL(t,o)},async transform(a,l){s+=a.length,n&&await uL(n,s,o),l.enqueue(a)},async flush(){e.size=s,r&&await uL(r,s)}})}}async function uL(i,...e){try{await i(...e)}catch{}}function vpe(i,e){return{run:()=>jNt(i,e)}}function zNt(i,e){const{baseURL:t,chunkSize:n}=e;if(!i.interface){let o;try{o=QNt(i.scripts[0],t,i)}catch{return gpe=!1,vpe(i,e)}Object.assign(i,{worker:o,interface:{run:()=>GNt(i,{chunkSize:n})}})}return i.interface}async function jNt({options:i,readable:e,writable:t,onTaskFinished:n},o){try{const r=new NNt(i,o);await e.pipeThrough(r).pipeTo(t,{preventClose:!0,preventAbort:!0});const{signature:s,inputSize:a,outputSize:l}=r;return{signature:s,inputSize:a,outputSize:l}}finally{n()}}async function GNt(i,e){let t,n;const o=new Promise((h,f)=>{t=h,n=f});Object.assign(i,{reader:null,writer:null,resolveResult:t,rejectResult:n,result:o});const{readable:r,options:s,scripts:a}=i,{writable:l,closed:c}=qNt(i.writable),u=Vw({type:LNt,scripts:a.slice(1),options:s,config:e,readable:r,writable:l},i);u||Object.assign(i,{reader:r.getReader(),writer:l.getWriter()});const d=await o;return u||await l.getWriter().close(),await c,d}function qNt(i){let e;const t=new Promise(o=>e=o);return{writable:new WritableStream({async write(o){const r=i.getWriter();await r.ready,await r.write(o),r.releaseLock()},close(){e()},abort(o){return i.getWriter().abort(o)}}),closed:t}}let ype=!0,wpe=!0;function QNt(i,e,t){const n={type:"module"};let o,r;typeof i==d5&&(i=i());try{o=new URL(i,e)}catch{o=i}if(ype)try{r=new Worker(o)}catch{ype=!1,r=new Worker(o,n)}else r=new Worker(o,n);return r.addEventListener(_Nt,s=>KNt(s,t)),r}function Vw(i,{worker:e,writer:t,onTaskFinished:n,transferStreams:o}){try{let{value:r,readable:s,writable:a}=i;const l=[];if(r&&(r.byteLength<r.buffer.byteLength?i.value=r.buffer.slice(0,r.byteLength):i.value=r.buffer,l.push(i.value)),o&&wpe?(s&&l.push(s),a&&l.push(a)):i.readable=i.writable=null,l.length)try{return e.postMessage(i,l),!0}catch{wpe=!1,i.readable=i.writable=null,e.postMessage(i)}else e.postMessage(i)}catch(r){throw t&&t.releaseLock(),n(),r}}async function KNt({data:i},e){const{type:t,value:n,messageId:o,result:r,error:s}=i,{reader:a,writer:l,resolveResult:c,rejectResult:u,onTaskFinished:d}=e;try{if(s){const{message:f,stack:A,code:p,name:m}=s,g=new Error(f);Object.assign(g,{stack:A,code:p,name:m}),h(g)}else{if(t==FNt){const{value:f,done:A}=await a.read();Vw({type:fpe,value:f,done:A,messageId:o},e)}t==fpe&&(await l.ready,await l.write(new Uint8Array(n)),Vw({type:ONt,messageId:o},e)),t==Ape&&h(null,r)}}catch(f){Vw({type:Ape,messageId:o},e),h(f)}function h(f,A){f?u(f):c(A),l&&l.releaseLock(),d()}}let Qh=[];const dL=[];let Cpe=0;async function JNt(i,e){const{options:t,config:n}=e,{transferStreams:o,useWebWorkers:r,useCompressionStream:s,codecType:a,compressed:l,signed:c,encrypted:u}=t,{workerScripts:d,maxWorkers:h}=n;e.transferStreams=o||o===Bs;const f=!l&&!c&&!u&&!e.transferStreams;return e.useWebWorkers=!f&&(r||r===Bs&&n.useWebWorkers),e.scripts=e.useWebWorkers&&d?d[a]:[],t.useCompressionStream=s||s===Bs&&n.useCompressionStream,(await A()).run();async function A(){const m=Qh.find(g=>!g.busy);if(m)return bpe(m),new cL(m,i,e,p);if(Qh.length<h){const g={indexWorker:Cpe};return Cpe++,Qh.push(g),new cL(g,i,e,p)}else return new Promise(g=>dL.push({resolve:g,stream:i,workerOptions:e}))}function p(m){if(dL.length){const[{resolve:g,stream:w,workerOptions:y}]=dL.splice(0,1);g(new cL(m,w,y,p))}else m.worker?(bpe(m),ZNt(m,e)):Qh=Qh.filter(g=>g!=m)}}function ZNt(i,e){const{config:t}=e,{terminateWorkerTimeout:n}=t;Number.isFinite(n)&&n>=0&&(i.terminated?i.terminated=!1:i.terminateTimeout=setTimeout(async()=>{Qh=Qh.filter(o=>o!=i);try{await i.terminate()}catch{}},n))}function bpe(i){const{terminateTimeout:e}=i;e&&(clearTimeout(e),i.terminateTimeout=null)}function WNt(i,e={}){const t=`const{Array:e,Object:t,Number:n,Math:r,Error:s,Uint8Array:i,Uint16Array:o,Uint32Array:c,Int32Array:f,Map:a,DataView:l,Promise:u,TextEncoder:w,crypto:h,postMessage:d,TransformStream:p,ReadableStream:y,WritableStream:m,CompressionStream:b,DecompressionStream:g}=self,k=void 0,v="undefined",S="function";class z{constructor(e){return class extends p{constructor(t,n){const r=new e(n);super({transform(e,t){t.enqueue(r.append(e))},flush(e){const t=r.flush();t&&e.enqueue(t)}})}}}}const C=[];for(let e=0;256>e;e++){let t=e;for(let e=0;8>e;e++)1&t?t=t>>>1^3988292384:t>>>=1;C[e]=t}class x{constructor(e){this.t=e||-1}append(e){let t=0|this.t;for(let n=0,r=0|e.length;r>n;n++)t=t>>>8^C[255&(t^e[n])];this.t=t}get(){return~this.t}}class A extends p{constructor(){let e;const t=new x;super({transform(e,n){t.append(e),n.enqueue(e)},flush(){const n=new i(4);new l(n.buffer).setUint32(0,t.get()),e.value=n}}),e=this}}const _={concat(e,t){if(0===e.length||0===t.length)return e.concat(t);const n=e[e.length-1],r=_.i(n);return 32===r?e.concat(t):_.o(t,r,0|n,e.slice(0,e.length-1))},l(e){const t=e.length;if(0===t)return 0;const n=e[t-1];return 32*(t-1)+_.i(n)},u(e,t){if(32*e.length<t)return e;const n=(e=e.slice(0,r.ceil(t/32))).length;return t&=31,n>0&&t&&(e[n-1]=_.h(t,e[n-1]&2147483648>>t-1,1)),e},h:(e,t,n)=>32===e?t:(n?0|t:t<<32-e)+1099511627776*e,i:e=>r.round(e/1099511627776)||32,o(e,t,n,r){for(void 0===r&&(r=[]);t>=32;t-=32)r.push(n),n=0;if(0===t)return r.concat(e);for(let s=0;s<e.length;s++)r.push(n|e[s]>>>t),n=e[s]<<32-t;const s=e.length?e[e.length-1]:0,i=_.i(s);return r.push(_.h(t+i&31,t+i>32?n:r.pop(),1)),r}},I={p:{m(e){const t=_.l(e)/8,n=new i(t);let r;for(let s=0;t>s;s++)3&s||(r=e[s/4]),n[s]=r>>>24,r<<=8;return n},k(e){const t=[];let n,r=0;for(n=0;n<e.length;n++)r=r<<8|e[n],3&~n||(t.push(r),r=0);return 3&n&&t.push(_.h(8*(3&n),r)),t}}},P=class{constructor(e){const t=this;t.blockSize=512,t.v=[1732584193,4023233417,2562383102,271733878,3285377520],t.S=[1518500249,1859775393,2400959708,3395469782],e?(t.C=e.C.slice(0),t.A=e.A.slice(0),t._=e._):t.reset()}reset(){const e=this;return e.C=e.v.slice(0),e.A=[],e._=0,e}update(e){const t=this;"string"==typeof e&&(e=I.I.k(e));const n=t.A=_.concat(t.A,e),r=t._,i=t._=r+_.l(e);if(i>9007199254740991)throw new s("Cannot hash more than 2^53 - 1 bits");const o=new c(n);let f=0;for(let e=t.blockSize+r-(t.blockSize+r&t.blockSize-1);i>=e;e+=t.blockSize)t.P(o.subarray(16*f,16*(f+1))),f+=1;return n.splice(0,16*f),t}D(){const e=this;let t=e.A;const n=e.C;t=_.concat(t,[_.h(1,1)]);for(let e=t.length+2;15&e;e++)t.push(0);for(t.push(r.floor(e._/4294967296)),t.push(0|e._);t.length;)e.P(t.splice(0,16));return e.reset(),n}V(e,t,n,r){return e>19?e>39?e>59?e>79?void 0:t^n^r:t&n|t&r|n&r:t^n^r:t&n|~t&r}R(e,t){return t<<e|t>>>32-e}P(t){const n=this,s=n.C,i=e(80);for(let e=0;16>e;e++)i[e]=t[e];let o=s[0],c=s[1],f=s[2],a=s[3],l=s[4];for(let e=0;79>=e;e++){16>e||(i[e]=n.R(1,i[e-3]^i[e-8]^i[e-14]^i[e-16]));const t=n.R(5,o)+n.V(e,c,f,a)+l+i[e]+n.S[r.floor(e/20)]|0;l=a,a=f,f=n.R(30,c),c=o,o=t}s[0]=s[0]+o|0,s[1]=s[1]+c|0,s[2]=s[2]+f|0,s[3]=s[3]+a|0,s[4]=s[4]+l|0}},D={getRandomValues(e){const t=new c(e.buffer),n=e=>{let t=987654321;const n=4294967295;return()=>(t=36969*(65535&t)+(t>>16)&n,(((t<<16)+(e=18e3*(65535&e)+(e>>16)&n)&n)/4294967296+.5)*(r.random()>.5?1:-1))};for(let s,i=0;i<e.length;i+=4){const e=n(4294967296*(s||r.random()));s=987654071*e(),t[i/4]=4294967296*e()|0}return e}},V={importKey:e=>new V.B(I.p.k(e)),M(e,t,n,r){if(n=n||1e4,0>r||0>n)throw new s("invalid params to pbkdf2");const i=1+(r>>5)<<2;let o,c,f,a,u;const w=new ArrayBuffer(i),h=new l(w);let d=0;const p=_;for(t=I.p.k(t),u=1;(i||1)>d;u++){for(o=c=e.encrypt(p.concat(t,[u])),f=1;n>f;f++)for(c=e.encrypt(c),a=0;a<c.length;a++)o[a]^=c[a];for(f=0;(i||1)>d&&f<o.length;f++)h.setInt32(d,o[f]),d+=4}return w.slice(0,r/8)},B:class{constructor(e){const t=this,n=t.U=P,r=[[],[]];t.K=[new n,new n];const s=t.K[0].blockSize/32;e.length>s&&(e=(new n).update(e).D());for(let t=0;s>t;t++)r[0][t]=909522486^e[t],r[1][t]=1549556828^e[t];t.K[0].update(r[0]),t.K[1].update(r[1]),t.N=new n(t.K[0])}reset(){const e=this;e.N=new e.U(e.K[0]),e.O=!1}update(e){this.O=!0,this.N.update(e)}digest(){const e=this,t=e.N.D(),n=new e.U(e.K[1]).update(t).D();return e.reset(),n}encrypt(e){if(this.O)throw new s("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}}},R=typeof h!=v&&typeof h.getRandomValues==S,B="Invalid password",E="Invalid signature",M="zipjs-abort-check-password";function U(e){return R?h.getRandomValues(e):D.getRandomValues(e)}const K=16,N={name:"PBKDF2"},O=t.assign({hash:{name:"HMAC"}},N),T=t.assign({iterations:1e3,hash:{name:"SHA-1"}},N),W=["deriveBits"],j=[8,12,16],H=[16,24,32],L=10,F=[0,0,0,0],q=typeof h!=v,G=q&&h.subtle,J=q&&typeof G!=v,Q=I.p,X=class{constructor(e){const t=this;t.T=[[[],[],[],[],[]],[[],[],[],[],[]]],t.T[0][0][0]||t.W();const n=t.T[0][4],r=t.T[1],i=e.length;let o,c,f,a=1;if(4!==i&&6!==i&&8!==i)throw new s("invalid aes key size");for(t.S=[c=e.slice(0),f=[]],o=i;4*i+28>o;o++){let e=c[o-1];(o%i==0||8===i&&o%i==4)&&(e=n[e>>>24]<<24^n[e>>16&255]<<16^n[e>>8&255]<<8^n[255&e],o%i==0&&(e=e<<8^e>>>24^a<<24,a=a<<1^283*(a>>7))),c[o]=c[o-i]^e}for(let e=0;o;e++,o--){const t=c[3&e?o:o-4];f[e]=4>=o||4>e?t:r[0][n[t>>>24]]^r[1][n[t>>16&255]]^r[2][n[t>>8&255]]^r[3][n[255&t]]}}encrypt(e){return this.j(e,0)}decrypt(e){return this.j(e,1)}W(){const e=this.T[0],t=this.T[1],n=e[4],r=t[4],s=[],i=[];let o,c,f,a;for(let e=0;256>e;e++)i[(s[e]=e<<1^283*(e>>7))^e]=e;for(let l=o=0;!n[l];l^=c||1,o=i[o]||1){let i=o^o<<1^o<<2^o<<3^o<<4;i=i>>8^255&i^99,n[l]=i,r[i]=l,a=s[f=s[c=s[l]]];let u=16843009*a^65537*f^257*c^16843008*l,w=257*s[i]^16843008*i;for(let n=0;4>n;n++)e[n][l]=w=w<<24^w>>>8,t[n][i]=u=u<<24^u>>>8}for(let n=0;5>n;n++)e[n]=e[n].slice(0),t[n]=t[n].slice(0)}j(e,t){if(4!==e.length)throw new s("invalid aes block size");const n=this.S[t],r=n.length/4-2,i=[0,0,0,0],o=this.T[t],c=o[0],f=o[1],a=o[2],l=o[3],u=o[4];let w,h,d,p=e[0]^n[0],y=e[t?3:1]^n[1],m=e[2]^n[2],b=e[t?1:3]^n[3],g=4;for(let e=0;r>e;e++)w=c[p>>>24]^f[y>>16&255]^a[m>>8&255]^l[255&b]^n[g],h=c[y>>>24]^f[m>>16&255]^a[b>>8&255]^l[255&p]^n[g+1],d=c[m>>>24]^f[b>>16&255]^a[p>>8&255]^l[255&y]^n[g+2],b=c[b>>>24]^f[p>>16&255]^a[y>>8&255]^l[255&m]^n[g+3],g+=4,p=w,y=h,m=d;for(let e=0;4>e;e++)i[t?3&-e:e]=u[p>>>24]<<24^u[y>>16&255]<<16^u[m>>8&255]<<8^u[255&b]^n[g++],w=p,p=y,y=m,m=b,b=w;return i}},Y=class{constructor(e,t){this.H=e,this.L=t,this.F=t}reset(){this.F=this.L}update(e){return this.q(this.H,e,this.F)}G(e){if(255&~(e>>24))e+=1<<24;else{let t=e>>16&255,n=e>>8&255,r=255&e;255===t?(t=0,255===n?(n=0,255===r?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}return e}J(e){0===(e[0]=this.G(e[0]))&&(e[1]=this.G(e[1]))}q(e,t,n){let r;if(!(r=t.length))return[];const s=_.l(t);for(let s=0;r>s;s+=4){this.J(n);const r=e.encrypt(n);t[s]^=r[0],t[s+1]^=r[1],t[s+2]^=r[2],t[s+3]^=r[3]}return _.u(t,s)}},Z=V.B;let $=q&&J&&typeof G.importKey==S,ee=q&&J&&typeof G.deriveBits==S;class te extends p{constructor({password:e,rawPassword:n,signed:r,encryptionStrength:o,checkPasswordOnly:c}){super({start(){t.assign(this,{ready:new u((e=>this.X=e)),password:ie(e,n),signed:r,Y:o-1,pending:new i})},async transform(e,t){const n=this,{password:r,Y:o,X:f,ready:a}=n;r?(await(async(e,t,n,r)=>{const i=await se(e,t,n,ce(r,0,j[t])),o=ce(r,j[t]);if(i[0]!=o[0]||i[1]!=o[1])throw new s(B)})(n,o,r,ce(e,0,j[o]+2)),e=ce(e,j[o]+2),c?t.error(new s(M)):f()):await a;const l=new i(e.length-L-(e.length-L)%K);t.enqueue(re(n,e,l,0,L,!0))},async flush(e){const{signed:t,Z:n,$:r,pending:o,ready:c}=this;if(r&&n){await c;const f=ce(o,0,o.length-L),a=ce(o,o.length-L);let l=new i;if(f.length){const e=ae(Q,f);r.update(e);const t=n.update(e);l=fe(Q,t)}if(t){const e=ce(fe(Q,r.digest()),0,L);for(let t=0;L>t;t++)if(e[t]!=a[t])throw new s(E)}e.enqueue(l)}}})}}class ne extends p{constructor({password:e,rawPassword:n,encryptionStrength:r}){let s;super({start(){t.assign(this,{ready:new u((e=>this.X=e)),password:ie(e,n),Y:r-1,pending:new i})},async transform(e,t){const n=this,{password:r,Y:s,X:o,ready:c}=n;let f=new i;r?(f=await(async(e,t,n)=>{const r=U(new i(j[t]));return oe(r,await se(e,t,n,r))})(n,s,r),o()):await c;const a=new i(f.length+e.length-e.length%K);a.set(f,0),t.enqueue(re(n,e,a,f.length,0))},async flush(e){const{Z:t,$:n,pending:r,ready:o}=this;if(n&&t){await o;let c=new i;if(r.length){const e=t.update(ae(Q,r));n.update(e),c=fe(Q,e)}s.signature=fe(Q,n.digest()).slice(0,L),e.enqueue(oe(c,s.signature))}}}),s=this}}function re(e,t,n,r,s,o){const{Z:c,$:f,pending:a}=e,l=t.length-s;let u;for(a.length&&(t=oe(a,t),n=((e,t)=>{if(t&&t>e.length){const n=e;(e=new i(t)).set(n,0)}return e})(n,l-l%K)),u=0;l-K>=u;u+=K){const e=ae(Q,ce(t,u,u+K));o&&f.update(e);const s=c.update(e);o||f.update(s),n.set(fe(Q,s),u+r)}return e.pending=ce(t,u),n}async function se(n,r,s,o){n.password=null;const c=await(async(e,t,n,r,s)=>{if(!$)return V.importKey(t);try{return await G.importKey("raw",t,n,!1,s)}catch(e){return $=!1,V.importKey(t)}})(0,s,O,0,W),f=await(async(e,t,n)=>{if(!ee)return V.M(t,e.salt,T.iterations,n);try{return await G.deriveBits(e,t,n)}catch(r){return ee=!1,V.M(t,e.salt,T.iterations,n)}})(t.assign({salt:o},T),c,8*(2*H[r]+2)),a=new i(f),l=ae(Q,ce(a,0,H[r])),u=ae(Q,ce(a,H[r],2*H[r])),w=ce(a,2*H[r]);return t.assign(n,{keys:{key:l,ee:u,passwordVerification:w},Z:new Y(new X(l),e.from(F)),$:new Z(u)}),w}function ie(e,t){return t===k?(e=>{if(typeof w==v){const t=new i((e=unescape(encodeURIComponent(e))).length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}return(new w).encode(e)})(e):t}function oe(e,t){let n=e;return e.length+t.length&&(n=new i(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function ce(e,t,n){return e.subarray(t,n)}function fe(e,t){return e.m(t)}function ae(e,t){return e.k(t)}class le extends p{constructor({password:e,passwordVerification:n,checkPasswordOnly:r}){super({start(){t.assign(this,{password:e,passwordVerification:n}),de(this,e)},transform(e,t){const n=this;if(n.password){const t=we(n,e.subarray(0,12));if(n.password=null,t[11]!=n.passwordVerification)throw new s(B);e=e.subarray(12)}r?t.error(new s(M)):t.enqueue(we(n,e))}})}}class ue extends p{constructor({password:e,passwordVerification:n}){super({start(){t.assign(this,{password:e,passwordVerification:n}),de(this,e)},transform(e,t){const n=this;let r,s;if(n.password){n.password=null;const t=U(new i(12));t[11]=n.passwordVerification,r=new i(e.length+t.length),r.set(he(n,t),0),s=12}else r=new i(e.length),s=0;r.set(he(n,e),s),t.enqueue(r)}})}}function we(e,t){const n=new i(t.length);for(let r=0;r<t.length;r++)n[r]=ye(e)^t[r],pe(e,n[r]);return n}function he(e,t){const n=new i(t.length);for(let r=0;r<t.length;r++)n[r]=ye(e)^t[r],pe(e,t[r]);return n}function de(e,n){const r=[305419896,591751049,878082192];t.assign(e,{keys:r,te:new x(r[0]),ne:new x(r[2])});for(let t=0;t<n.length;t++)pe(e,n.charCodeAt(t))}function pe(e,t){let[n,s,i]=e.keys;e.te.append([t]),n=~e.te.get(),s=be(r.imul(be(s+me(n)),134775813)+1),e.ne.append([s>>>24]),i=~e.ne.get(),e.keys=[n,s,i]}function ye(e){const t=2|e.keys[2];return me(r.imul(t,1^t)>>>8)}function me(e){return 255&e}function be(e){return 4294967295&e}const ge="deflate-raw";class ke extends p{constructor(e,{chunkSize:t,CompressionStream:n,CompressionStreamNative:r}){super({});const{compressed:s,encrypted:i,useCompressionStream:o,zipCrypto:c,signed:f,level:a}=e,u=this;let w,h,d=Se(super.readable);i&&!c||!f||(w=new A,d=xe(d,w)),s&&(d=Ce(d,o,{level:a,chunkSize:t},r,n)),i&&(c?d=xe(d,new ue(e)):(h=new ne(e),d=xe(d,h))),ze(u,d,(()=>{let e;i&&!c&&(e=h.signature),i&&!c||!f||(e=new l(w.value.buffer).getUint32(0)),u.signature=e}))}}class ve extends p{constructor(e,{chunkSize:t,DecompressionStream:n,DecompressionStreamNative:r}){super({});const{zipCrypto:i,encrypted:o,signed:c,signature:f,compressed:a,useCompressionStream:u}=e;let w,h,d=Se(super.readable);o&&(i?d=xe(d,new le(e)):(h=new te(e),d=xe(d,h))),a&&(d=Ce(d,u,{chunkSize:t},r,n)),o&&!i||!c||(w=new A,d=xe(d,w)),ze(this,d,(()=>{if((!o||i)&&c){const e=new l(w.value.buffer);if(f!=e.getUint32(0,!1))throw new s(E)}}))}}function Se(e){return xe(e,new p({transform(e,t){e&&e.length&&t.enqueue(e)}}))}function ze(e,n,r){n=xe(n,new p({flush:r})),t.defineProperty(e,"readable",{get:()=>n})}function Ce(e,t,n,r,s){try{e=xe(e,new(t&&r?r:s)(ge,n))}catch(r){if(!t)return e;try{e=xe(e,new s(ge,n))}catch(t){return e}}return e}function xe(e,t){return e.pipeThrough(t)}const Ae="data",_e="close";class Ie extends p{constructor(e,n){super({});const r=this,{codecType:s}=e;let i;s.startsWith("deflate")?i=ke:s.startsWith("inflate")&&(i=ve);let o=0,c=0;const f=new i(e,n),a=super.readable,l=new p({transform(e,t){e&&e.length&&(c+=e.length,t.enqueue(e))},flush(){t.assign(r,{inputSize:c})}}),u=new p({transform(e,t){e&&e.length&&(o+=e.length,t.enqueue(e))},flush(){const{signature:e}=f;t.assign(r,{signature:e,outputSize:o,inputSize:c})}});t.defineProperty(r,"readable",{get:()=>a.pipeThrough(l).pipeThrough(f).pipeThrough(u)})}}class Pe extends p{constructor(e){let t;super({transform:function n(r,s){if(t){const e=new i(t.length+r.length);e.set(t),e.set(r,t.length),r=e,t=null}r.length>e?(s.enqueue(r.slice(0,e)),n(r.slice(e),s)):t=r},flush(e){t&&t.length&&e.enqueue(t)}})}}const De=new a,Ve=new a;let Re,Be=0,Ee=!0;async function Me(e){try{const{options:t,scripts:r,config:s}=e;if(r&&r.length)try{Ee?importScripts.apply(k,r):await Ue(r)}catch(e){Ee=!1,await Ue(r)}self.initCodec&&self.initCodec(),s.CompressionStreamNative=self.CompressionStream,s.DecompressionStreamNative=self.DecompressionStream,self.Deflate&&(s.CompressionStream=new z(self.Deflate)),self.Inflate&&(s.DecompressionStream=new z(self.Inflate));const i={highWaterMark:1},o=e.readable||new y({async pull(e){const t=new u((e=>De.set(Be,e)));Ke({type:"pull",messageId:Be}),Be=(Be+1)%n.MAX_SAFE_INTEGER;const{value:r,done:s}=await t;e.enqueue(r),s&&e.close()}},i),c=e.writable||new m({async write(e){let t;const r=new u((e=>t=e));Ve.set(Be,t),Ke({type:Ae,value:e,messageId:Be}),Be=(Be+1)%n.MAX_SAFE_INTEGER,await r}},i),f=new Ie(t,s);Re=new AbortController;const{signal:a}=Re;await o.pipeThrough(f).pipeThrough(new Pe(s.chunkSize)).pipeTo(c,{signal:a,preventClose:!0,preventAbort:!0}),await c.getWriter().close();const{signature:l,inputSize:w,outputSize:h}=f;Ke({type:_e,result:{signature:l,inputSize:w,outputSize:h}})}catch(e){Ne(e)}}async function Ue(e){for(const t of e)await import(t)}function Ke(e){let{value:t}=e;if(t)if(t.length)try{t=new i(t),e.value=t.buffer,d(e,[e.value])}catch(t){d(e)}else d(e);else d(e)}function Ne(e=new s("Unknown error")){const{message:t,stack:n,code:r,name:i}=e;d({error:{message:t,stack:n,code:r,name:i}})}addEventListener("message",(({data:e})=>{const{type:t,messageId:n,value:r,done:s}=e;try{if("start"==t&&Me(e),t==Ae){const e=De.get(n);De.delete(n),e({value:new i(r),done:s})}if("ack"==t){const e=Ve.get(n);Ve.delete(n),e()}t==_e&&Re.abort()}catch(e){Ne(e)}}));const Oe=-2;function Te(t){return We(t.map((([t,n])=>new e(t).fill(n,0,t))))}function We(t){return t.reduce(((t,n)=>t.concat(e.isArray(n)?We(n):n)),[])}const je=[0,1,2,3].concat(...Te([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function He(){const e=this;function t(e,t){let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1}e.re=n=>{const s=e.se,i=e.oe.ie,o=e.oe.ce;let c,f,a,l=-1;for(n.fe=0,n.ae=573,c=0;o>c;c++)0!==s[2*c]?(n.le[++n.fe]=l=c,n.ue[c]=0):s[2*c+1]=0;for(;2>n.fe;)a=n.le[++n.fe]=2>l?++l:0,s[2*a]=1,n.ue[a]=0,n.we--,i&&(n.he-=i[2*a+1]);for(e.de=l,c=r.floor(n.fe/2);c>=1;c--)n.pe(s,c);a=o;do{c=n.le[1],n.le[1]=n.le[n.fe--],n.pe(s,1),f=n.le[1],n.le[--n.ae]=c,n.le[--n.ae]=f,s[2*a]=s[2*c]+s[2*f],n.ue[a]=r.max(n.ue[c],n.ue[f])+1,s[2*c+1]=s[2*f+1]=a,n.le[1]=a++,n.pe(s,1)}while(n.fe>=2);n.le[--n.ae]=n.le[1],(t=>{const n=e.se,r=e.oe.ie,s=e.oe.ye,i=e.oe.me,o=e.oe.be;let c,f,a,l,u,w,h=0;for(l=0;15>=l;l++)t.ge[l]=0;for(n[2*t.le[t.ae]+1]=0,c=t.ae+1;573>c;c++)f=t.le[c],l=n[2*n[2*f+1]+1]+1,l>o&&(l=o,h++),n[2*f+1]=l,f>e.de||(t.ge[l]++,u=0,i>f||(u=s[f-i]),w=n[2*f],t.we+=w*(l+u),r&&(t.he+=w*(r[2*f+1]+u)));if(0!==h){do{for(l=o-1;0===t.ge[l];)l--;t.ge[l]--,t.ge[l+1]+=2,t.ge[o]--,h-=2}while(h>0);for(l=o;0!==l;l--)for(f=t.ge[l];0!==f;)a=t.le[--c],a>e.de||(n[2*a+1]!=l&&(t.we+=(l-n[2*a+1])*n[2*a],n[2*a+1]=l),f--)}})(n),((e,n,r)=>{const s=[];let i,o,c,f=0;for(i=1;15>=i;i++)s[i]=f=f+r[i-1]<<1;for(o=0;n>=o;o++)c=e[2*o+1],0!==c&&(e[2*o]=t(s[c]++,c))})(s,e.de,n.ge)}}function Le(e,t,n,r,s){const i=this;i.ie=e,i.ye=t,i.me=n,i.ce=r,i.be=s}He.ke=[0,1,2,3,4,5,6,7].concat(...Te([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]])),He.ve=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0],He.Se=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576],He.ze=e=>256>e?je[e]:je[256+(e>>>7)],He.Ce=[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],He.xe=[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],He.Ae=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],He._e=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];const Fe=Te([[144,8],[112,9],[24,7],[8,8]]);Le.Ie=We([12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227].map(((e,t)=>[e,Fe[t]])));const qe=Te([[30,5]]);function Ge(e,t,n,r,s){const i=this;i.Pe=e,i.De=t,i.Ve=n,i.Re=r,i.Be=s}Le.Ee=We([0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23].map(((e,t)=>[e,qe[t]]))),Le.Me=new Le(Le.Ie,He.Ce,257,286,15),Le.Ue=new Le(Le.Ee,He.xe,0,30,15),Le.Ke=new Le(null,He.Ae,0,19,7);const Je=[new Ge(0,0,0,0,0),new Ge(4,4,8,4,1),new Ge(4,5,16,8,1),new Ge(4,6,32,32,1),new Ge(4,4,16,16,2),new Ge(8,16,32,32,2),new Ge(8,16,128,128,2),new Ge(8,32,128,256,2),new Ge(32,128,258,1024,2),new Ge(32,258,258,4096,2)],Qe=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],Xe=113,Ye=666,Ze=262;function $e(e,t,n,r){const s=e[2*t],i=e[2*n];return i>s||s==i&&r[t]<=r[n]}function et(){const e=this;let t,n,s,c,f,a,l,u,w,h,d,p,y,m,b,g,k,v,S,z,C,x,A,_,I,P,D,V,R,B,E,M,U;const K=new He,N=new He,O=new He;let T,W,j,H,L,F;function q(){let t;for(t=0;286>t;t++)E[2*t]=0;for(t=0;30>t;t++)M[2*t]=0;for(t=0;19>t;t++)U[2*t]=0;E[512]=1,e.we=e.he=0,W=j=0}function G(e,t){let n,r=-1,s=e[1],i=0,o=7,c=4;0===s&&(o=138,c=3),e[2*(t+1)+1]=65535;for(let f=0;t>=f;f++)n=s,s=e[2*(f+1)+1],++i<o&&n==s||(c>i?U[2*n]+=i:0!==n?(n!=r&&U[2*n]++,U[32]++):i>10?U[36]++:U[34]++,i=0,r=n,0===s?(o=138,c=3):n==s?(o=6,c=3):(o=7,c=4))}function J(t){e.Ne[e.pending++]=t}function Q(e){J(255&e),J(e>>>8&255)}function X(e,t){let n;const r=t;F>16-r?(n=e,L|=n<<F&65535,Q(L),L=n>>>16-F,F+=r-16):(L|=e<<F&65535,F+=r)}function Y(e,t){const n=2*e;X(65535&t[n],65535&t[n+1])}function Z(e,t){let n,r,s=-1,i=e[1],o=0,c=7,f=4;for(0===i&&(c=138,f=3),n=0;t>=n;n++)if(r=i,i=e[2*(n+1)+1],++o>=c||r!=i){if(f>o)do{Y(r,U)}while(0!=--o);else 0!==r?(r!=s&&(Y(r,U),o--),Y(16,U),X(o-3,2)):o>10?(Y(18,U),X(o-11,7)):(Y(17,U),X(o-3,3));o=0,s=r,0===i?(c=138,f=3):r==i?(c=6,f=3):(c=7,f=4)}}function $(){16==F?(Q(L),L=0,F=0):8>F||(J(255&L),L>>>=8,F-=8)}function ee(t,n){let s,i,o;if(e.Oe[W]=t,e.Te[W]=255&n,W++,0===t?E[2*n]++:(j++,t--,E[2*(He.ke[n]+256+1)]++,M[2*He.ze(t)]++),!(8191&W)&&D>2){for(s=8*W,i=C-k,o=0;30>o;o++)s+=M[2*o]*(5+He.xe[o]);if(s>>>=3,j<r.floor(W/2)&&s<r.floor(i/2))return!0}return W==T-1}function te(t,n){let r,s,i,o,c=0;if(0!==W)do{r=e.Oe[c],s=e.Te[c],c++,0===r?Y(s,t):(i=He.ke[s],Y(i+256+1,t),o=He.Ce[i],0!==o&&(s-=He.ve[i],X(s,o)),r--,i=He.ze(r),Y(i,n),o=He.xe[i],0!==o&&(r-=He.Se[i],X(r,o)))}while(W>c);Y(256,t),H=t[513]}function ne(){F>8?Q(L):F>0&&J(255&L),L=0,F=0}function re(t,n,r){X(0+(r?1:0),3),((t,n)=>{ne(),H=8,Q(n),Q(~n),e.Ne.set(u.subarray(t,t+n),e.pending),e.pending+=n})(t,n)}function se(n){((t,n,r)=>{let s,i,o=0;D>0?(K.re(e),N.re(e),o=(()=>{let t;for(G(E,K.de),G(M,N.de),O.re(e),t=18;t>=3&&0===U[2*He._e[t]+1];t--);return e.we+=14+3*(t+1),t})(),s=e.we+3+7>>>3,i=e.he+3+7>>>3,i>s||(s=i)):s=i=n+5,n+4>s||-1==t?i==s?(X(2+(r?1:0),3),te(Le.Ie,Le.Ee)):(X(4+(r?1:0),3),((e,t,n)=>{let r;for(X(e-257,5),X(t-1,5),X(n-4,4),r=0;n>r;r++)X(U[2*He._e[r]+1],3);Z(E,e-1),Z(M,t-1)})(K.de+1,N.de+1,o+1),te(E,M)):re(t,n,r),q(),r&&ne()})(0>k?-1:k,C-k,n),k=C,t.We()}function ie(){let e,n,r,s;do{if(s=w-A-C,0===s&&0===C&&0===A)s=f;else if(-1==s)s--;else if(C>=f+f-Ze){u.set(u.subarray(f,f+f),0),x-=f,C-=f,k-=f,e=y,r=e;do{n=65535&d[--r],d[r]=f>n?0:n-f}while(0!=--e);e=f,r=e;do{n=65535&h[--r],h[r]=f>n?0:n-f}while(0!=--e);s+=f}if(0===t.je)return;e=t.He(u,C+A,s),A+=e,3>A||(p=255&u[C],p=(p<<g^255&u[C+1])&b)}while(Ze>A&&0!==t.je)}function oe(e){let t,n,r=I,s=C,i=_;const o=C>f-Ze?C-(f-Ze):0;let c=B;const a=l,w=C+258;let d=u[s+i-1],p=u[s+i];R>_||(r>>=2),c>A&&(c=A);do{if(t=e,u[t+i]==p&&u[t+i-1]==d&&u[t]==u[s]&&u[++t]==u[s+1]){s+=2,t++;do{}while(u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&w>s);if(n=258-(w-s),s=w-258,n>i){if(x=e,i=n,n>=c)break;d=u[s+i-1],p=u[s+i]}}}while((e=65535&h[e&a])>o&&0!=--r);return i>A?A:i}e.ue=[],e.ge=[],e.le=[],E=[],M=[],U=[],e.pe=(t,n)=>{const r=e.le,s=r[n];let i=n<<1;for(;i<=e.fe&&(i<e.fe&&$e(t,r[i+1],r[i],e.ue)&&i++,!$e(t,s,r[i],e.ue));)r[n]=r[i],n=i,i<<=1;r[n]=s},e.Le=(t,S,x,W,j,G)=>(W||(W=8),j||(j=8),G||(G=0),t.Fe=null,-1==S&&(S=6),1>j||j>9||8!=W||9>x||x>15||0>S||S>9||0>G||G>2?Oe:(t.qe=e,a=x,f=1<<a,l=f-1,m=j+7,y=1<<m,b=y-1,g=r.floor((m+3-1)/3),u=new i(2*f),h=[],d=[],T=1<<j+6,e.Ne=new i(4*T),s=4*T,e.Oe=new o(T),e.Te=new i(T),D=S,V=G,(t=>(t.Ge=t.Je=0,t.Fe=null,e.pending=0,e.Qe=0,n=Xe,c=0,K.se=E,K.oe=Le.Me,N.se=M,N.oe=Le.Ue,O.se=U,O.oe=Le.Ke,L=0,F=0,H=8,q(),(()=>{w=2*f,d[y-1]=0;for(let e=0;y-1>e;e++)d[e]=0;P=Je[D].De,R=Je[D].Pe,B=Je[D].Ve,I=Je[D].Re,C=0,k=0,A=0,v=_=2,z=0,p=0})(),0))(t))),e.Xe=()=>42!=n&&n!=Xe&&n!=Ye?Oe:(e.Te=null,e.Oe=null,e.Ne=null,d=null,h=null,u=null,e.qe=null,n==Xe?-3:0),e.Ye=(e,t,n)=>{let r=0;return-1==t&&(t=6),0>t||t>9||0>n||n>2?Oe:(Je[D].Be!=Je[t].Be&&0!==e.Ge&&(r=e.Ze(1)),D!=t&&(D=t,P=Je[D].De,R=Je[D].Pe,B=Je[D].Ve,I=Je[D].Re),V=n,r)},e.$e=(e,t,r)=>{let s,i=r,o=0;if(!t||42!=n)return Oe;if(3>i)return 0;for(i>f-Ze&&(i=f-Ze,o=r-i),u.set(t.subarray(o,o+i),0),C=i,k=i,p=255&u[0],p=(p<<g^255&u[1])&b,s=0;i-3>=s;s++)p=(p<<g^255&u[s+2])&b,h[s&l]=d[p],d[p]=s;return 0},e.Ze=(r,i)=>{let o,w,m,I,R;if(i>4||0>i)return Oe;if(!r.et||!r.tt&&0!==r.je||n==Ye&&4!=i)return r.Fe=Qe[4],Oe;if(0===r.nt)return r.Fe=Qe[7],-5;var B;if(t=r,I=c,c=i,42==n&&(w=8+(a-8<<4)<<8,m=(D-1&255)>>1,m>3&&(m=3),w|=m<<6,0!==C&&(w|=32),w+=31-w%31,n=Xe,J((B=w)>>8&255),J(255&B)),0!==e.pending){if(t.We(),0===t.nt)return c=-1,0}else if(0===t.je&&I>=i&&4!=i)return t.Fe=Qe[7],-5;if(n==Ye&&0!==t.je)return r.Fe=Qe[7],-5;if(0!==t.je||0!==A||0!=i&&n!=Ye){switch(R=-1,Je[D].Be){case 0:R=(e=>{let n,r=65535;for(r>s-5&&(r=s-5);;){if(1>=A){if(ie(),0===A&&0==e)return 0;if(0===A)break}if(C+=A,A=0,n=k+r,(0===C||C>=n)&&(A=C-n,C=n,se(!1),0===t.nt))return 0;if(C-k>=f-Ze&&(se(!1),0===t.nt))return 0}return se(4==e),0===t.nt?4==e?2:0:4==e?3:1})(i);break;case 1:R=(e=>{let n,r=0;for(;;){if(Ze>A){if(ie(),Ze>A&&0==e)return 0;if(0===A)break}if(3>A||(p=(p<<g^255&u[C+2])&b,r=65535&d[p],h[C&l]=d[p],d[p]=C),0===r||(C-r&65535)>f-Ze||2!=V&&(v=oe(r)),3>v)n=ee(0,255&u[C]),A--,C++;else if(n=ee(C-x,v-3),A-=v,v>P||3>A)C+=v,v=0,p=255&u[C],p=(p<<g^255&u[C+1])&b;else{v--;do{C++,p=(p<<g^255&u[C+2])&b,r=65535&d[p],h[C&l]=d[p],d[p]=C}while(0!=--v);C++}if(n&&(se(!1),0===t.nt))return 0}return se(4==e),0===t.nt?4==e?2:0:4==e?3:1})(i);break;case 2:R=(e=>{let n,r,s=0;for(;;){if(Ze>A){if(ie(),Ze>A&&0==e)return 0;if(0===A)break}if(3>A||(p=(p<<g^255&u[C+2])&b,s=65535&d[p],h[C&l]=d[p],d[p]=C),_=v,S=x,v=2,0!==s&&P>_&&f-Ze>=(C-s&65535)&&(2!=V&&(v=oe(s)),5>=v&&(1==V||3==v&&C-x>4096)&&(v=2)),3>_||v>_)if(0!==z){if(n=ee(0,255&u[C-1]),n&&se(!1),C++,A--,0===t.nt)return 0}else z=1,C++,A--;else{r=C+A-3,n=ee(C-1-S,_-3),A-=_-1,_-=2;do{++C>r||(p=(p<<g^255&u[C+2])&b,s=65535&d[p],h[C&l]=d[p],d[p]=C)}while(0!=--_);if(z=0,v=2,C++,n&&(se(!1),0===t.nt))return 0}}return 0!==z&&(n=ee(0,255&u[C-1]),z=0),se(4==e),0===t.nt?4==e?2:0:4==e?3:1})(i)}if(2!=R&&3!=R||(n=Ye),0==R||2==R)return 0===t.nt&&(c=-1),0;if(1==R){if(1==i)X(2,3),Y(256,Le.Ie),$(),9>1+H+10-F&&(X(2,3),Y(256,Le.Ie),$()),H=7;else if(re(0,0,!1),3==i)for(o=0;y>o;o++)d[o]=0;if(t.We(),0===t.nt)return c=-1,0}}return 4!=i?0:1}}function tt(){const e=this;e.rt=0,e.st=0,e.je=0,e.Ge=0,e.nt=0,e.Je=0}function nt(e){const t=new tt,n=(o=e&&e.chunkSize?e.chunkSize:65536)+5*(r.floor(o/16383)+1);var o;const c=new i(n);let f=e?e.level:-1;void 0===f&&(f=-1),t.Le(f),t.et=c,this.append=(e,r)=>{let o,f,a=0,l=0,u=0;const w=[];if(e.length){t.rt=0,t.tt=e,t.je=e.length;do{if(t.st=0,t.nt=n,o=t.Ze(0),0!=o)throw new s("deflating: "+t.Fe);t.st&&(t.st==n?w.push(new i(c)):w.push(c.subarray(0,t.st))),u+=t.st,r&&t.rt>0&&t.rt!=a&&(r(t.rt),a=t.rt)}while(t.je>0||0===t.nt);return w.length>1?(f=new i(u),w.forEach((e=>{f.set(e,l),l+=e.length}))):f=w[0]?new i(w[0]):new i,f}},this.flush=()=>{let e,r,o=0,f=0;const a=[];do{if(t.st=0,t.nt=n,e=t.Ze(4),1!=e&&0!=e)throw new s("deflating: "+t.Fe);n-t.nt>0&&a.push(c.slice(0,t.st)),f+=t.st}while(t.je>0||0===t.nt);return t.Xe(),r=new i(f),a.forEach((e=>{r.set(e,o),o+=e.length})),r}}tt.prototype={Le(e,t){const n=this;return n.qe=new et,t||(t=15),n.qe.Le(n,e,t)},Ze(e){const t=this;return t.qe?t.qe.Ze(t,e):Oe},Xe(){const e=this;if(!e.qe)return Oe;const t=e.qe.Xe();return e.qe=null,t},Ye(e,t){const n=this;return n.qe?n.qe.Ye(n,e,t):Oe},$e(e,t){const n=this;return n.qe?n.qe.$e(n,e,t):Oe},He(e,t,n){const r=this;let s=r.je;return s>n&&(s=n),0===s?0:(r.je-=s,e.set(r.tt.subarray(r.rt,r.rt+s),t),r.rt+=s,r.Ge+=s,s)},We(){const e=this;let t=e.qe.pending;t>e.nt&&(t=e.nt),0!==t&&(e.et.set(e.qe.Ne.subarray(e.qe.Qe,e.qe.Qe+t),e.st),e.st+=t,e.qe.Qe+=t,e.Je+=t,e.nt-=t,e.qe.pending-=t,0===e.qe.pending&&(e.qe.Qe=0))}};const rt=-2,st=-3,it=-5,ot=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],ct=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],ft=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],at=[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],lt=[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,112,112],ut=[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],wt=[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];function ht(){let e,t,n,r,s,i;function o(e,t,o,c,f,a,l,u,w,h,d){let p,y,m,b,g,k,v,S,z,C,x,A,_,I,P;C=0,g=o;do{n[e[t+C]]++,C++,g--}while(0!==g);if(n[0]==o)return l[0]=-1,u[0]=0,0;for(S=u[0],k=1;15>=k&&0===n[k];k++);for(v=k,k>S&&(S=k),g=15;0!==g&&0===n[g];g--);for(m=g,S>g&&(S=g),u[0]=S,I=1<<k;g>k;k++,I<<=1)if(0>(I-=n[k]))return st;if(0>(I-=n[g]))return st;for(n[g]+=I,i[1]=k=0,C=1,_=2;0!=--g;)i[_]=k+=n[C],_++,C++;g=0,C=0;do{0!==(k=e[t+C])&&(d[i[k]++]=g),C++}while(++g<o);for(o=i[m],i[0]=g=0,C=0,b=-1,A=-S,s[0]=0,x=0,P=0;m>=v;v++)for(p=n[v];0!=p--;){for(;v>A+S;){if(b++,A+=S,P=m-A,P=P>S?S:P,(y=1<<(k=v-A))>p+1&&(y-=p+1,_=v,P>k))for(;++k<P&&(y<<=1)>n[++_];)y-=n[_];if(P=1<<k,h[0]+P>1440)return st;s[b]=x=h[0],h[0]+=P,0!==b?(i[b]=g,r[0]=k,r[1]=S,k=g>>>A-S,r[2]=x-s[b-1]-k,w.set(r,3*(s[b-1]+k))):l[0]=x}for(r[1]=v-A,o>C?d[C]<c?(r[0]=256>d[C]?0:96,r[2]=d[C++]):(r[0]=a[d[C]-c]+16+64,r[2]=f[d[C++]-c]):r[0]=192,y=1<<v-A,k=g>>>A;P>k;k+=y)w.set(r,3*(x+k));for(k=1<<v-1;g&k;k>>>=1)g^=k;for(g^=k,z=(1<<A)-1;(g&z)!=i[b];)b--,A-=S,z=(1<<A)-1}return 0!==I&&1!=m?it:0}function c(o){let c;for(e||(e=[],t=[],n=new f(16),r=[],s=new f(15),i=new f(16)),t.length<o&&(t=[]),c=0;o>c;c++)t[c]=0;for(c=0;16>c;c++)n[c]=0;for(c=0;3>c;c++)r[c]=0;s.set(n.subarray(0,15),0),i.set(n.subarray(0,16),0)}this.it=(n,r,s,i,f)=>{let a;return c(19),e[0]=0,a=o(n,0,19,19,null,null,s,r,i,e,t),a==st?f.Fe="oversubscribed dynamic bit lengths tree":a!=it&&0!==r[0]||(f.Fe="incomplete dynamic bit lengths tree",a=st),a},this.ot=(n,r,s,i,f,a,l,u,w)=>{let h;return c(288),e[0]=0,h=o(s,0,n,257,at,lt,a,i,u,e,t),0!=h||0===i[0]?(h==st?w.Fe="oversubscribed literal/length tree":-4!=h&&(w.Fe="incomplete literal/length tree",h=st),h):(c(288),h=o(s,n,r,0,ut,wt,l,f,u,e,t),0!=h||0===f[0]&&n>257?(h==st?w.Fe="oversubscribed distance tree":h==it?(w.Fe="incomplete distance tree",h=st):-4!=h&&(w.Fe="empty distance tree with lengths",h=st),h):0)}}function dt(){const e=this;let t,n,r,s,i=0,o=0,c=0,f=0,a=0,l=0,u=0,w=0,h=0,d=0;function p(e,t,n,r,s,i,o,c){let f,a,l,u,w,h,d,p,y,m,b,g,k,v,S,z;d=c.rt,p=c.je,w=o.ct,h=o.ft,y=o.write,m=y<o.read?o.read-y-1:o.end-y,b=ot[e],g=ot[t];do{for(;20>h;)p--,w|=(255&c.lt(d++))<<h,h+=8;if(f=w&b,a=n,l=r,z=3*(l+f),0!==(u=a[z]))for(;;){if(w>>=a[z+1],h-=a[z+1],16&u){for(u&=15,k=a[z+2]+(w&ot[u]),w>>=u,h-=u;15>h;)p--,w|=(255&c.lt(d++))<<h,h+=8;for(f=w&g,a=s,l=i,z=3*(l+f),u=a[z];;){if(w>>=a[z+1],h-=a[z+1],16&u){for(u&=15;u>h;)p--,w|=(255&c.lt(d++))<<h,h+=8;if(v=a[z+2]+(w&ot[u]),w>>=u,h-=u,m-=k,v>y){S=y-v;do{S+=o.end}while(0>S);if(u=o.end-S,k>u){if(k-=u,y-S>0&&u>y-S)do{o.ut[y++]=o.ut[S++]}while(0!=--u);else o.ut.set(o.ut.subarray(S,S+u),y),y+=u,S+=u,u=0;S=0}}else S=y-v,y-S>0&&2>y-S?(o.ut[y++]=o.ut[S++],o.ut[y++]=o.ut[S++],k-=2):(o.ut.set(o.ut.subarray(S,S+2),y),y+=2,S+=2,k-=2);if(y-S>0&&k>y-S)do{o.ut[y++]=o.ut[S++]}while(0!=--k);else o.ut.set(o.ut.subarray(S,S+k),y),y+=k,S+=k,k=0;break}if(64&u)return c.Fe="invalid distance code",k=c.je-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ct=w,o.ft=h,c.je=p,c.Ge+=d-c.rt,c.rt=d,o.write=y,st;f+=a[z+2],f+=w&ot[u],z=3*(l+f),u=a[z]}break}if(64&u)return 32&u?(k=c.je-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ct=w,o.ft=h,c.je=p,c.Ge+=d-c.rt,c.rt=d,o.write=y,1):(c.Fe="invalid literal/length code",k=c.je-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ct=w,o.ft=h,c.je=p,c.Ge+=d-c.rt,c.rt=d,o.write=y,st);if(f+=a[z+2],f+=w&ot[u],z=3*(l+f),0===(u=a[z])){w>>=a[z+1],h-=a[z+1],o.ut[y++]=a[z+2],m--;break}}else w>>=a[z+1],h-=a[z+1],o.ut[y++]=a[z+2],m--}while(m>=258&&p>=10);return k=c.je-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ct=w,o.ft=h,c.je=p,c.Ge+=d-c.rt,c.rt=d,o.write=y,0}e.init=(e,i,o,c,f,a)=>{t=0,u=e,w=i,r=o,h=c,s=f,d=a,n=null},e.wt=(e,y,m)=>{let b,g,k,v,S,z,C,x=0,A=0,_=0;for(_=y.rt,v=y.je,x=e.ct,A=e.ft,S=e.write,z=S<e.read?e.read-S-1:e.end-S;;)switch(t){case 0:if(z>=258&&v>=10&&(e.ct=x,e.ft=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,m=p(u,w,r,h,s,d,e,y),_=y.rt,v=y.je,x=e.ct,A=e.ft,S=e.write,z=S<e.read?e.read-S-1:e.end-S,0!=m)){t=1==m?7:9;break}c=u,n=r,o=h,t=1;case 1:for(b=c;b>A;){if(0===v)return e.ct=x,e.ft=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.ht(y,m);m=0,v--,x|=(255&y.lt(_++))<<A,A+=8}if(g=3*(o+(x&ot[b])),x>>>=n[g+1],A-=n[g+1],k=n[g],0===k){f=n[g+2],t=6;break}if(16&k){a=15&k,i=n[g+2],t=2;break}if(!(64&k)){c=k,o=g/3+n[g+2];break}if(32&k){t=7;break}return t=9,y.Fe="invalid literal/length code",m=st,e.ct=x,e.ft=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.ht(y,m);case 2:for(b=a;b>A;){if(0===v)return e.ct=x,e.ft=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.ht(y,m);m=0,v--,x|=(255&y.lt(_++))<<A,A+=8}i+=x&ot[b],x>>=b,A-=b,c=w,n=s,o=d,t=3;case 3:for(b=c;b>A;){if(0===v)return e.ct=x,e.ft=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.ht(y,m);m=0,v--,x|=(255&y.lt(_++))<<A,A+=8}if(g=3*(o+(x&ot[b])),x>>=n[g+1],A-=n[g+1],k=n[g],16&k){a=15&k,l=n[g+2],t=4;break}if(!(64&k)){c=k,o=g/3+n[g+2];break}return t=9,y.Fe="invalid distance code",m=st,e.ct=x,e.ft=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.ht(y,m);case 4:for(b=a;b>A;){if(0===v)return e.ct=x,e.ft=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.ht(y,m);m=0,v--,x|=(255&y.lt(_++))<<A,A+=8}l+=x&ot[b],x>>=b,A-=b,t=5;case 5:for(C=S-l;0>C;)C+=e.end;for(;0!==i;){if(0===z&&(S==e.end&&0!==e.read&&(S=0,z=S<e.read?e.read-S-1:e.end-S),0===z&&(e.write=S,m=e.ht(y,m),S=e.write,z=S<e.read?e.read-S-1:e.end-S,S==e.end&&0!==e.read&&(S=0,z=S<e.read?e.read-S-1:e.end-S),0===z)))return e.ct=x,e.ft=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.ht(y,m);e.ut[S++]=e.ut[C++],z--,C==e.end&&(C=0),i--}t=0;break;case 6:if(0===z&&(S==e.end&&0!==e.read&&(S=0,z=S<e.read?e.read-S-1:e.end-S),0===z&&(e.write=S,m=e.ht(y,m),S=e.write,z=S<e.read?e.read-S-1:e.end-S,S==e.end&&0!==e.read&&(S=0,z=S<e.read?e.read-S-1:e.end-S),0===z)))return e.ct=x,e.ft=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.ht(y,m);m=0,e.ut[S++]=f,z--,t=0;break;case 7:if(A>7&&(A-=8,v++,_--),e.write=S,m=e.ht(y,m),S=e.write,z=S<e.read?e.read-S-1:e.end-S,e.read!=e.write)return e.ct=x,e.ft=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.ht(y,m);t=8;case 8:return m=1,e.ct=x,e.ft=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.ht(y,m);case 9:return m=st,e.ct=x,e.ft=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.ht(y,m);default:return m=rt,e.ct=x,e.ft=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.ht(y,m)}},e.dt=()=>{}}ht.yt=(e,t,n,r)=>(e[0]=9,t[0]=5,n[0]=ct,r[0]=ft,0);const pt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function yt(e,t){const n=this;let r,s=0,o=0,c=0,a=0;const l=[0],u=[0],w=new dt;let h=0,d=new f(4320);const p=new ht;n.ft=0,n.ct=0,n.ut=new i(t),n.end=t,n.read=0,n.write=0,n.reset=(e,t)=>{t&&(t[0]=0),6==s&&w.dt(e),s=0,n.ft=0,n.ct=0,n.read=n.write=0},n.reset(e,null),n.ht=(e,t)=>{let r,s,i;return s=e.st,i=n.read,r=(i>n.write?n.end:n.write)-i,r>e.nt&&(r=e.nt),0!==r&&t==it&&(t=0),e.nt-=r,e.Je+=r,e.et.set(n.ut.subarray(i,i+r),s),s+=r,i+=r,i==n.end&&(i=0,n.write==n.end&&(n.write=0),r=n.write-i,r>e.nt&&(r=e.nt),0!==r&&t==it&&(t=0),e.nt-=r,e.Je+=r,e.et.set(n.ut.subarray(i,i+r),s),s+=r,i+=r),e.st=s,n.read=i,t},n.wt=(e,t)=>{let i,f,y,m,b,g,k,v;for(m=e.rt,b=e.je,f=n.ct,y=n.ft,g=n.write,k=g<n.read?n.read-g-1:n.end-g;;){let S,z,C,x,A,_,I,P;switch(s){case 0:for(;3>y;){if(0===b)return n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);t=0,b--,f|=(255&e.lt(m++))<<y,y+=8}switch(i=7&f,h=1&i,i>>>1){case 0:f>>>=3,y-=3,i=7&y,f>>>=i,y-=i,s=1;break;case 1:S=[],z=[],C=[[]],x=[[]],ht.yt(S,z,C,x),w.init(S[0],z[0],C[0],0,x[0],0),f>>>=3,y-=3,s=6;break;case 2:f>>>=3,y-=3,s=3;break;case 3:return f>>>=3,y-=3,s=9,e.Fe="invalid block type",t=st,n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t)}break;case 1:for(;32>y;){if(0===b)return n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);t=0,b--,f|=(255&e.lt(m++))<<y,y+=8}if((~f>>>16&65535)!=(65535&f))return s=9,e.Fe="invalid stored block lengths",t=st,n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);o=65535&f,f=y=0,s=0!==o?2:0!==h?7:0;break;case 2:if(0===b)return n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);if(0===k&&(g==n.end&&0!==n.read&&(g=0,k=g<n.read?n.read-g-1:n.end-g),0===k&&(n.write=g,t=n.ht(e,t),g=n.write,k=g<n.read?n.read-g-1:n.end-g,g==n.end&&0!==n.read&&(g=0,k=g<n.read?n.read-g-1:n.end-g),0===k)))return n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);if(t=0,i=o,i>b&&(i=b),i>k&&(i=k),n.ut.set(e.He(m,i),g),m+=i,b-=i,g+=i,k-=i,0!=(o-=i))break;s=0!==h?7:0;break;case 3:for(;14>y;){if(0===b)return n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);t=0,b--,f|=(255&e.lt(m++))<<y,y+=8}if(c=i=16383&f,(31&i)>29||(i>>5&31)>29)return s=9,e.Fe="too many length or distance symbols",t=st,n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);if(i=258+(31&i)+(i>>5&31),!r||r.length<i)r=[];else for(v=0;i>v;v++)r[v]=0;f>>>=14,y-=14,a=0,s=4;case 4:for(;4+(c>>>10)>a;){for(;3>y;){if(0===b)return n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);t=0,b--,f|=(255&e.lt(m++))<<y,y+=8}r[pt[a++]]=7&f,f>>>=3,y-=3}for(;19>a;)r[pt[a++]]=0;if(l[0]=7,i=p.it(r,l,u,d,e),0!=i)return(t=i)==st&&(r=null,s=9),n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);a=0,s=5;case 5:for(;i=c,258+(31&i)+(i>>5&31)>a;){let o,w;for(i=l[0];i>y;){if(0===b)return n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);t=0,b--,f|=(255&e.lt(m++))<<y,y+=8}if(i=d[3*(u[0]+(f&ot[i]))+1],w=d[3*(u[0]+(f&ot[i]))+2],16>w)f>>>=i,y-=i,r[a++]=w;else{for(v=18==w?7:w-14,o=18==w?11:3;i+v>y;){if(0===b)return n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);t=0,b--,f|=(255&e.lt(m++))<<y,y+=8}if(f>>>=i,y-=i,o+=f&ot[v],f>>>=v,y-=v,v=a,i=c,v+o>258+(31&i)+(i>>5&31)||16==w&&1>v)return r=null,s=9,e.Fe="invalid bit length repeat",t=st,n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);w=16==w?r[v-1]:0;do{r[v++]=w}while(0!=--o);a=v}}if(u[0]=-1,A=[],_=[],I=[],P=[],A[0]=9,_[0]=6,i=c,i=p.ot(257+(31&i),1+(i>>5&31),r,A,_,I,P,d,e),0!=i)return i==st&&(r=null,s=9),t=i,n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);w.init(A[0],_[0],d,I[0],d,P[0]),s=6;case 6:if(n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,1!=(t=w.wt(n,e,t)))return n.ht(e,t);if(t=0,w.dt(e),m=e.rt,b=e.je,f=n.ct,y=n.ft,g=n.write,k=g<n.read?n.read-g-1:n.end-g,0===h){s=0;break}s=7;case 7:if(n.write=g,t=n.ht(e,t),g=n.write,k=g<n.read?n.read-g-1:n.end-g,n.read!=n.write)return n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);s=8;case 8:return t=1,n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);case 9:return t=st,n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);default:return t=rt,n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t)}}},n.dt=e=>{n.reset(e,null),n.ut=null,d=null},n.bt=(e,t,r)=>{n.ut.set(e.subarray(t,t+r),0),n.read=n.write=r},n.gt=()=>1==s?1:0}const mt=13,bt=[0,0,255,255];function gt(){const e=this;function t(e){return e&&e.kt?(e.Ge=e.Je=0,e.Fe=null,e.kt.mode=7,e.kt.vt.reset(e,null),0):rt}e.mode=0,e.method=0,e.St=[0],e.zt=0,e.marker=0,e.Ct=0,e.xt=t=>(e.vt&&e.vt.dt(t),e.vt=null,0),e.At=(n,r)=>(n.Fe=null,e.vt=null,8>r||r>15?(e.xt(n),rt):(e.Ct=r,n.kt.vt=new yt(n,1<<r),t(n),0)),e._t=(e,t)=>{let n,r;if(!e||!e.kt||!e.tt)return rt;const s=e.kt;for(t=4==t?it:0,n=it;;)switch(s.mode){case 0:if(0===e.je)return n;if(n=t,e.je--,e.Ge++,8!=(15&(s.method=e.lt(e.rt++)))){s.mode=mt,e.Fe="unknown compression method",s.marker=5;break}if(8+(s.method>>4)>s.Ct){s.mode=mt,e.Fe="invalid win size",s.marker=5;break}s.mode=1;case 1:if(0===e.je)return n;if(n=t,e.je--,e.Ge++,r=255&e.lt(e.rt++),((s.method<<8)+r)%31!=0){s.mode=mt,e.Fe="incorrect header check",s.marker=5;break}if(!(32&r)){s.mode=7;break}s.mode=2;case 2:if(0===e.je)return n;n=t,e.je--,e.Ge++,s.zt=(255&e.lt(e.rt++))<<24&4278190080,s.mode=3;case 3:if(0===e.je)return n;n=t,e.je--,e.Ge++,s.zt+=(255&e.lt(e.rt++))<<16&16711680,s.mode=4;case 4:if(0===e.je)return n;n=t,e.je--,e.Ge++,s.zt+=(255&e.lt(e.rt++))<<8&65280,s.mode=5;case 5:return 0===e.je?n:(n=t,e.je--,e.Ge++,s.zt+=255&e.lt(e.rt++),s.mode=6,2);case 6:return s.mode=mt,e.Fe="need dictionary",s.marker=0,rt;case 7:if(n=s.vt.wt(e,n),n==st){s.mode=mt,s.marker=0;break}if(0==n&&(n=t),1!=n)return n;n=t,s.vt.reset(e,s.St),s.mode=12;case 12:return e.je=0,1;case mt:return st;default:return rt}},e.It=(e,t,n)=>{let r=0,s=n;if(!e||!e.kt||6!=e.kt.mode)return rt;const i=e.kt;return s<1<<i.Ct||(s=(1<<i.Ct)-1,r=n-s),i.vt.bt(t,r,s),i.mode=7,0},e.Pt=e=>{let n,r,s,i,o;if(!e||!e.kt)return rt;const c=e.kt;if(c.mode!=mt&&(c.mode=mt,c.marker=0),0===(n=e.je))return it;for(r=e.rt,s=c.marker;0!==n&&4>s;)e.lt(r)==bt[s]?s++:s=0!==e.lt(r)?0:4-s,r++,n--;return e.Ge+=r-e.rt,e.rt=r,e.je=n,c.marker=s,4!=s?st:(i=e.Ge,o=e.Je,t(e),e.Ge=i,e.Je=o,c.mode=7,0)},e.Dt=e=>e&&e.kt&&e.kt.vt?e.kt.vt.gt():rt}function kt(){}function vt(e){const t=new kt,n=e&&e.chunkSize?r.floor(2*e.chunkSize):131072,o=new i(n);let c=!1;t.At(),t.et=o,this.append=(e,r)=>{const f=[];let a,l,u=0,w=0,h=0;if(0!==e.length){t.rt=0,t.tt=e,t.je=e.length;do{if(t.st=0,t.nt=n,0!==t.je||c||(t.rt=0,c=!0),a=t._t(0),c&&a===it){if(0!==t.je)throw new s("inflating: bad input")}else if(0!==a&&1!==a)throw new s("inflating: "+t.Fe);if((c||1===a)&&t.je===e.length)throw new s("inflating: bad input");t.st&&(t.st===n?f.push(new i(o)):f.push(o.subarray(0,t.st))),h+=t.st,r&&t.rt>0&&t.rt!=u&&(r(t.rt),u=t.rt)}while(t.je>0||0===t.nt);return f.length>1?(l=new i(h),f.forEach((e=>{l.set(e,w),w+=e.length}))):l=f[0]?new i(f[0]):new i,l}},this.flush=()=>{t.xt()}}kt.prototype={At(e){const t=this;return t.kt=new gt,e||(e=15),t.kt.At(t,e)},_t(e){const t=this;return t.kt?t.kt._t(t,e):rt},xt(){const e=this;if(!e.kt)return rt;const t=e.kt.xt(e);return e.kt=null,t},Pt(){const e=this;return e.kt?e.kt.Pt(e):rt},It(e,t){const n=this;return n.kt?n.kt.It(n,e,t):rt},lt(e){return this.tt[e]},He(e,t){return this.tt.subarray(e,e+t)}},self.initCodec=()=>{self.Deflate=nt,self.Inflate=vt};
5501
- `,n=()=>e.useDataURI?"data:text/javascript,"+encodeURIComponent(t):URL.createObjectURL(new Blob([t],{type:"text/javascript"}));i({workerScripts:{inflate:[n],deflate:[n]}})}const XNt="Writer iterator completed too soon",YNt="Content-Type",$Nt=64*1024,xpe="writable";class hL{constructor(){this.size=0}init(){this.initialized=!0}}class Mpe extends hL{get readable(){const e=this,{chunkSize:t=$Nt}=e,n=new ReadableStream({start(){this.chunkOffset=0},async pull(o){const{offset:r=0,size:s,diskNumberStart:a}=n,{chunkOffset:l}=this;o.enqueue(await ns(e,r+l,Math.min(t,s-l),a)),l+t>s?o.close():this.chunkOffset+=t}});return n}}class Epe extends Mpe{constructor(e){super(),Object.assign(this,{blob:e,size:e.size})}async readUint8Array(e,t){const n=this,o=e+t;let s=await(e||o<n.size?n.blob.slice(e,o):n.blob).arrayBuffer();return s.byteLength>t&&(s=s.slice(e,o)),new Uint8Array(s)}}class Bpe extends hL{constructor(e){super();const t=this,n=new TransformStream,o=[];e&&o.push([YNt,e]),Object.defineProperty(t,xpe,{get(){return n.writable}}),t.blob=new Response(n.readable,{headers:o}).blob()}getData(){return this.blob}}class eVt extends Bpe{constructor(e){super(e),Object.assign(this,{encoding:e,utf8:!e||e.toLowerCase()=="utf-8"})}async getData(){const{encoding:e,utf8:t}=this,n=await super.getData();if(n.text&&t)return n.text();{const o=new FileReader;return new Promise((r,s)=>{Object.assign(o,{onload:({target:a})=>r(a.result),onerror:()=>s(o.error)}),o.readAsText(n,e)})}}}class tVt extends Mpe{constructor(e){super(),this.readers=e}async init(){const e=this,{readers:t}=e;e.lastDiskNumber=0,e.lastDiskOffset=0,await Promise.all(t.map(async(n,o)=>{await n.init(),o!=t.length-1&&(e.lastDiskOffset+=n.size),e.size+=n.size})),super.init()}async readUint8Array(e,t,n=0){const o=this,{readers:r}=this;let s,a=n;a==-1&&(a=r.length-1);let l=e;for(;l>=r[a].size;)l-=r[a].size,a++;const c=r[a],u=c.size;if(l+t<=u)s=await ns(c,l,t);else{const d=u-l;s=new Uint8Array(t),s.set(await ns(c,l,d)),s.set(await o.readUint8Array(e+d,t-d,n),d)}return o.lastDiskNumber=Math.max(a,o.lastDiskNumber),s}}class Spe extends hL{constructor(e,t=4294967295){super();const n=this;Object.assign(n,{diskNumber:0,diskOffset:0,size:0,maxSize:t,availableSize:t});let o,r,s;const a=new WritableStream({async write(u){const{availableSize:d}=n;if(s)u.length>=d?(await l(u.slice(0,d)),await c(),n.diskOffset+=o.size,n.diskNumber++,s=null,await this.write(u.slice(d))):await l(u);else{const{value:h,done:f}=await e.next();if(f&&!h)throw new Error(XNt);o=h,o.size=0,o.maxSize&&(n.maxSize=o.maxSize),n.availableSize=n.maxSize,await Hw(o),r=h.writable,s=r.getWriter(),await this.write(u)}},async close(){await s.ready,await c()}});Object.defineProperty(n,xpe,{get(){return a}});async function l(u){const d=u.length;d&&(await s.ready,await s.write(u),o.size+=d,n.size+=d,n.availableSize-=d)}async function c(){r.size=o.size,await s.close()}}}async function Hw(i,e){if(i.init&&!i.initialized)await i.init(e);else return Promise.resolve()}function iVt(i){return Array.isArray(i)&&(i=new tVt(i)),i instanceof ReadableStream&&(i={readable:i}),i}function nVt(i){i.writable===Bs&&typeof i.next==d5&&(i=new Spe(i)),i instanceof WritableStream&&(i={writable:i});const{writable:e}=i;return e.size===Bs&&(e.size=0),i instanceof Spe||Object.assign(i,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),i}function ns(i,e,t,n){return i.readUint8Array(e,t,n)}const Ipe="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(""),oVt=Ipe.length==256;function sVt(i){if(oVt){let e="";for(let t=0;t<i.length;t++)e+=Ipe[i[t]];return e}else return new TextDecoder().decode(i)}function zw(i,e){return e&&e.trim().toLowerCase()=="cp437"?sVt(i):new TextDecoder(e).decode(i)}const Ppe="filename",Tpe="rawFilename",kpe="comment",Rpe="rawComment",Dpe="uncompressedSize",_pe="compressedSize",Lpe="offset",pL="diskNumberStart",fL="lastModDate",AL="rawLastModDate",Fpe="lastAccessDate",rVt="rawLastAccessDate",Ope="creationDate",aVt="rawCreationDate",lVt=[Ppe,Tpe,_pe,Dpe,fL,AL,kpe,Rpe,Fpe,Ope,Lpe,pL,pL,"internalFileAttribute","externalFileAttribute","msDosCompatible","zip64","encrypted","version","versionMadeBy","zipCrypto","directory","bitFlag","signature","filenameUTF8","commentUTF8","compressionMethod","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"];class Upe{constructor(e){lVt.forEach(t=>this[t]=e[t])}}const mL="File format is not recognized",cVt="End of central directory not found",uVt="End of Zip64 central directory locator not found",dVt="Central directory header not found",hVt="Local file header not found",pVt="Zip64 extra field not found",fVt="File contains encrypted entry",AVt="Encryption method not supported",Npe="Compression method not supported",Vpe="Split zip file",Hpe="utf-8",zpe="cp437",mVt=[[Dpe,Gh],[_pe,Gh],[Lpe,Gh],[pL,dd]],gVt={[dd]:{getValue:io,bytes:4},[Gh]:{getValue:jw,bytes:8}};class vVt{constructor(e,t={}){Object.assign(this,{reader:iVt(e),options:t,config:cNt()})}async*getEntriesGenerator(e={}){const t=this;let{reader:n}=t;const{config:o}=t;if(await Hw(n),(n.size===Bs||!n.readUint8Array)&&(n=new Epe(await new Response(n.readable).blob()),await Hw(n)),n.size<ym)throw new Error(mL);n.chunkSize=uNt(o);const r=await MVt(n,ZUt,n.size,ym,dd*16);if(!r){const P=await ns(n,0,4),I=Ro(P);throw io(I)==JUt?new Error(Vpe):new Error(cVt)}const s=Ro(r);let a=io(s,12),l=io(s,16);const c=r.offset,u=ko(s,20),d=c+ym+u;let h=ko(s,4);const f=n.lastDiskNumber||0;let A=ko(s,6),p=ko(s,8),m=0,g=0;if(l==Gh||a==Gh||p==dd||A==dd){const P=await ns(n,r.offset-tL,tL),I=Ro(P);if(io(I,0)==WUt){l=jw(I,8);let R=await ns(n,l,iL,-1),L=Ro(R);const U=r.offset-tL-iL;if(io(L,0)!=Fhe&&l!=U){const H=l;l=U,m=l-H,R=await ns(n,l,iL,-1),L=Ro(R)}if(io(L,0)!=Fhe)throw new Error(uVt);h==dd&&(h=io(L,16)),A==dd&&(A=io(L,20)),p==dd&&(p=jw(L,32)),a==Gh&&(a=jw(L,40)),l-=a}}if(l>=n.size&&(m=n.size-l-a-ym,l=n.size-a-ym),f!=h)throw new Error(Vpe);if(l<0)throw new Error(mL);let w=0,y=await ns(n,l,a,A),v=Ro(y);if(a){const P=r.offset-a;if(io(v,w)!=Lhe&&l!=P){const I=l;l=P,m+=l-I,y=await ns(n,l,a,A),v=Ro(y)}}const x=r.offset-l-(n.lastDiskOffset||0);if(a!=x&&x>=0&&(a=x,y=await ns(n,l,a,A),v=Ro(y)),l<0||l>=n.size)throw new Error(mL);const M=Is(t,e,"filenameEncoding"),E=Is(t,e,"commentEncoding");for(let P=0;P<p;P++){const I=new yVt(n,o,t.options);if(io(v,w)!=Lhe)throw new Error(dVt);jpe(I,v,w+6);const R=!!I.bitFlag.languageEncodingFlag,L=w+46,U=L+I.filenameLength,H=U+I.extraFieldLength,N=ko(v,w+4),Q=(N&0)==0,J=y.subarray(L,U),te=ko(v,w+32),le=H+te,Se=y.subarray(H,le),Ee=R,Ne=R,Ce=Q&&(bm(v,w+38)&Vhe)==Vhe,Pe=io(v,w+42)+m;Object.assign(I,{versionMadeBy:N,msDosCompatible:Q,compressedSize:0,uncompressedSize:0,commentLength:te,directory:Ce,offset:Pe,diskNumberStart:ko(v,w+34),internalFileAttribute:ko(v,w+36),externalFileAttribute:io(v,w+38),rawFilename:J,filenameUTF8:Ee,commentUTF8:Ne,rawExtraField:y.subarray(U,H)});const Ue=Is(t,e,"decodeText")||zw,ae=Ee?Hpe:M||zpe,Re=Ne?Hpe:E||zpe;let ve=Ue(J,ae);ve===Bs&&(ve=zw(J,ae));let De=Ue(Se,Re);De===Bs&&(De=zw(Se,Re)),Object.assign(I,{rawComment:Se,filename:ve,comment:De,directory:Ce||ve.endsWith(rNt)}),g=Math.max(Pe,g),await Gpe(I,I,v,w+6),I.zipCrypto=I.encrypted&&!I.extraFieldAES;const Xe=new Upe(I);Xe.getData=(G,se)=>I.getData(G,Xe,se),w=le;const{onprogress:Ze}=e;if(Ze)try{await Ze(P+1,p,new Upe(I))}catch{}yield Xe}const S=Is(t,e,"extractPrependedData"),T=Is(t,e,"extractAppendedData");return S&&(t.prependedData=g>0?await ns(n,0,g):new Uint8Array),t.comment=u?await ns(n,c+ym,u):new Uint8Array,T&&(t.appendedData=d<n.size?await ns(n,d,n.size-d):new Uint8Array),!0}async getEntries(e={}){const t=[];for await(const n of this.getEntriesGenerator(e))t.push(n);return t}async close(){}}class yVt{constructor(e,t,n){Object.assign(this,{reader:e,config:t,options:n})}async getData(e,t,n={}){const o=this,{reader:r,offset:s,diskNumberStart:a,extraFieldAES:l,compressionMethod:c,config:u,bitFlag:d,signature:h,rawLastModDate:f,uncompressedSize:A,compressedSize:p}=o,m=t.localDirectory={},g=await ns(r,s,30,a),w=Ro(g);let y=Is(o,n,"password"),v=Is(o,n,"rawPassword");const x=Is(o,n,"passThrough");if(y=y&&y.length&&y,v=v&&v.length&&v,l&&l.originalCompressionMethod!=QUt)throw new Error(Npe);if(c!=qUt&&c!=GUt&&!x)throw new Error(Npe);if(io(w,0)!=KUt)throw new Error(hVt);jpe(m,w,4),m.rawExtraField=m.extraFieldLength?await ns(r,s+30+m.filenameLength,m.extraFieldLength,a):new Uint8Array,await Gpe(o,m,w,4,!0),Object.assign(t,{lastAccessDate:m.lastAccessDate,creationDate:m.creationDate});const M=o.encrypted&&m.encrypted&&!x,E=M&&!l;if(x||(t.zipCrypto=E),M){if(!E&&l.strength===Bs)throw new Error(AVt);if(!y&&!v)throw new Error(fVt)}const S=s+30+m.filenameLength+m.extraFieldLength,T=p,P=r.readable;Object.assign(P,{diskNumberStart:a,offset:S,size:T});const I=Is(o,n,"signal"),R=Is(o,n,"checkPasswordOnly");R&&(e=new WritableStream),e=nVt(e),await Hw(e,x?p:A);const{writable:L}=e,{onstart:U,onprogress:H,onend:N}=n,Q={options:{codecType:mpe,password:y,rawPassword:v,zipCrypto:E,encryptionStrength:l&&l.strength,signed:Is(o,n,"checkSignature")&&!x,passwordVerification:E&&(d.dataDescriptor?f>>>8&255:h>>>24&255),signature:h,compressed:c!=0&&!x,encrypted:o.encrypted&&!x,useWebWorkers:Is(o,n,"useWebWorkers"),useCompressionStream:Is(o,n,"useCompressionStream"),transferStreams:Is(o,n,"transferStreams"),checkPasswordOnly:R},config:u,streamOptions:{signal:I,size:T,onstart:U,onprogress:H,onend:N}};let J=0;try{({outputSize:J}=await JNt({readable:P,writable:L},Q))}catch(te){if(!R||te.message!=sL)throw te}finally{const te=Is(o,n,"preventClose");L.size+=J,!te&&!L.locked&&await L.getWriter().close()}return R?Bs:e.getData?e.getData():L}}function jpe(i,e,t){const n=i.rawBitFlag=ko(e,t+2),o=(n&Ohe)==Ohe,r=io(e,t+6);Object.assign(i,{encrypted:o,version:ko(e,t),bitFlag:{level:(n&sNt)>>1,dataDescriptor:(n&Uhe)==Uhe,languageEncodingFlag:(n&Nhe)==Nhe},rawLastModDate:r,lastModDate:EVt(r),filenameLength:ko(e,t+22),extraFieldLength:ko(e,t+24)})}async function Gpe(i,e,t,n,o){const{rawExtraField:r}=e,s=e.extraField=new Map,a=Ro(new Uint8Array(r));let l=0;try{for(;l<r.length;){const g=ko(a,l),w=ko(a,l+2);s.set(g,{type:g,data:r.slice(l+4,l+4+w)}),l+=4+w}}catch{}const c=ko(t,n+4);Object.assign(e,{signature:io(t,n+10),uncompressedSize:io(t,n+18),compressedSize:io(t,n+14)});const u=s.get(XUt);u&&(wVt(u,e),e.extraFieldZip64=u);const d=s.get(iNt);d&&(await qpe(d,Ppe,Tpe,e,i),e.extraFieldUnicodePath=d);const h=s.get(nNt);h&&(await qpe(h,kpe,Rpe,e,i),e.extraFieldUnicodeComment=h);const f=s.get(YUt);f?(CVt(f,e,c),e.extraFieldAES=f):e.compressionMethod=c;const A=s.get($Ut);A&&(bVt(A,e),e.extraFieldNTFS=A);const p=s.get(tNt);p&&(xVt(p,e,o),e.extraFieldExtendedTimestamp=p);const m=s.get(oNt);m&&(e.extraFieldUSDZ=m)}function wVt(i,e){e.zip64=!0;const t=Ro(i.data),n=mVt.filter(([o,r])=>e[o]==r);for(let o=0,r=0;o<n.length;o++){const[s,a]=n[o];if(e[s]==a){const l=gVt[a];e[s]=i[s]=l.getValue(t,r),r+=l.bytes}else if(i[s])throw new Error(pVt)}}async function qpe(i,e,t,n,o){const r=Ro(i.data),s=new Ow;s.append(o[t]);const a=Ro(new Uint8Array(4));a.setUint32(0,s.get(),!0);const l=io(r,1);Object.assign(i,{version:bm(r,0),[e]:zw(i.data.subarray(5)),valid:!o.bitFlag.languageEncodingFlag&&l==io(a,0)}),i.valid&&(n[e]=i[e],n[e+"UTF8"]=!0)}function CVt(i,e,t){const n=Ro(i.data),o=bm(n,4);Object.assign(i,{vendorVersion:bm(n,0),vendorId:bm(n,2),strength:o,originalCompressionMethod:t,compressionMethod:ko(n,5)}),e.compressionMethod=i.compressionMethod}function bVt(i,e){const t=Ro(i.data);let n=4,o;try{for(;n<i.data.length&&!o;){const r=ko(t,n),s=ko(t,n+2);r==eNt&&(o=i.data.slice(n+4,n+4+s)),n+=4+s}}catch{}try{if(o&&o.length==24){const r=Ro(o),s=r.getBigUint64(0,!0),a=r.getBigUint64(8,!0),l=r.getBigUint64(16,!0);Object.assign(i,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:l});const c=gL(s),u=gL(a),d=gL(l),h={lastModDate:c,lastAccessDate:u,creationDate:d};Object.assign(i,h),Object.assign(e,h)}}catch{}}function xVt(i,e,t){const n=Ro(i.data),o=bm(n,0),r=[],s=[];t?((o&1)==1&&(r.push(fL),s.push(AL)),(o&2)==2&&(r.push(Fpe),s.push(rVt)),(o&4)==4&&(r.push(Ope),s.push(aVt))):i.data.length>=5&&(r.push(fL),s.push(AL));let a=1;r.forEach((l,c)=>{if(i.data.length>=a+4){const u=io(n,a);e[l]=i[l]=new Date(u*1e3);const d=s[c];i[d]=u}a+=4})}async function MVt(i,e,t,n,o){const r=new Uint8Array(4),s=Ro(r);BVt(s,0,e);const a=n+o;return await l(n)||await l(Math.min(a,t));async function l(c){const u=t-c,d=await ns(i,u,c);for(let h=d.length-n;h>=0;h--)if(d[h]==r[0]&&d[h+1]==r[1]&&d[h+2]==r[2]&&d[h+3]==r[3])return{offset:u+h,buffer:d.slice(h,h+n).buffer}}}function Is(i,e,t){return e[t]===Bs?i.options[t]:e[t]}function EVt(i){const e=(i&4294901760)>>16,t=i&65535;try{return new Date(1980+((e&65024)>>9),((e&480)>>5)-1,e&31,(t&63488)>>11,(t&2016)>>5,(t&31)*2,0)}catch{}}function gL(i){return new Date(Number(i/BigInt(1e4)-BigInt(116444736e5)))}function bm(i,e){return i.getUint8(e)}function ko(i,e){return i.getUint16(e,!0)}function io(i,e){return i.getUint32(e,!0)}function jw(i,e){return Number(i.getBigUint64(e,!0))}function BVt(i,e,t){i.setUint32(e,t,!0)}function Ro(i){return new DataView(i.buffer)}let Qpe;try{Qpe=typeof document>"u"&&typeof HT>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?HT.href:vd&&vd.tagName.toUpperCase()==="SCRIPT"&&vd.src||new URL("bimdata-viewer.umd.cjs",document.baseURI).href}catch{}nL({baseURL:Qpe}),WNt(nL),nL({Deflate:bUt,Inflate:jUt});function SVt(i){return{getDetailedExtensions(e){return[]},getExtensions(e){return[]},getFullTopics(e,t,n,o,r,s,a){return[]},getTopics(e,t,n,o){return[]}}}function IVt(i){return{checkProjectAccess(e,t){return{has_read_permission:!0,has_write_permission:!1,has_admin_permission:!1,token_scopes:["bcf:read","document:read","model:read"],usable_scopes:["bcf:read","document:read","model:read"],user_role:50,user:null}},getProjectDMSTree(e,t){return{}},getDocumentHistories(e,t,n){return[]},getProjectUsers(e,t){return[]}}}function PVt(i){const e=i,t=e.units.reduce((u,d)=>(d.conversion_baseunit=e.units[d.conversion_baseunit_index],delete d.conversion_baseunit_index,u[d.id]=d,u),{}),n=e.definitions.reduce((u,d)=>(d.unit=e.units[d.unit_id],delete d.unit_id,u[d.id]=d,u),{}),o=e.property_sets.reduce((u,d)=>(d.properties.forEach(h=>{h.definition=e.definitions[h.def_id],delete h.def_id}),u[d.id]=d,u),{}),r=e.classifications.reduce((u,d)=>(d.name=d.type,d.title=d.description,u[d.id]=d,u),{}),s=e.layers.reduce((u,d)=>(d.elements=[],u[d.id]=d,u),{}),a=e.systems.reduce((u,d)=>(d.elements=[],u[d.uuid]=d,u),{}),l={};l.materials_data=e.materials.materials_data.reduce((u,d)=>(d.property_sets=d.psets.map(h=>e.property_sets[h]),delete d.psets,delete d.step_id,u[d.id]=d,u),{}),l.list_components=e.materials.list_components.reduce((u,d)=>(d.material=e.materials.materials_data[d.material],d.option=e.materials.options[d.material_option],u[d.id]=d,delete d.id,u),{}),l.options=e.materials.options.reduce((u,d)=>(d.list_components=d.material_list.map(h=>e.materials.list_components[h]),u[d.id]=d,u),{});const c={};return e.elements.forEach(u=>{u.attributes=e.property_sets[u.attributes],u.property_sets=u.psets.map(d=>e.property_sets[d]),delete u.psets,u.classifications=u.classifications.map(d=>e.classifications[d]),u.systems=u.systems.map(d=>{const h=e.systems[d];return h.elements.push(u.uuid),h}),u.layers=u.layers.map(d=>{const h=e.layers[d];return h.elements.push(u.uuid),h}),u.material_list=u.material_list.map(d=>e.materials.list_components[d]),c[u.uuid]=u}),{units:t,definitions:n,property_sets:o,classifications:r,layers:s,systems:a,materials:l,elements:c}}function TVt(i){const e={};return Object.values(i).forEach(t=>{e[t.uuid]={},e[t.uuid].attributes={},t.attributes.properties.forEach(n=>{e[t.uuid].attributes[n.definition.name]=n.value}),t.property_sets.forEach(n=>{e[t.uuid][n.name]={},n.properties.forEach(o=>{e[t.uuid][n.name][o.definition.name]=o.value})})}),e}function kVt(i){return Object.values(i).forEach(e=>{e.formattedRawElements=PVt(e.rawElements)}),{getModels(e,t,n,o,r){let s=Object.values(i).map(a=>a.model);return s=s.filter(a=>!(a.type==="PDF"&&a.parent_id)),(n==null?void 0:n.length)>0&&(s=s.filter(a=>n.includes(a.source))),(o==null?void 0:o.length)>0&&(s=s.filter(a=>o.includes(a.status))),(r==null?void 0:r.length)>0&&(s=s.filter(a=>r.includes(a.type))),s},getModel(e,t,n){return i[t].model},getTileset(e,t,n,o){console.warn("[BIMData Viewer] Offline Warning: `getTileset` is not available in offline mode.")},getBuildings(e,t,n){return i[t].buildings},getBuildingPlanPositioning(e,t,n,o,r){const s=this.getBuilding(t,o,r,e).plans.find(a=>a.plan.id===n);return{translation_x:s.translation_x,translation_y:s.translation_y,rotate_z:s.rotate_z,scale:s.scale,opacity:s.opacity}},getBuilding(e,t,n,o){return i[t].buildings.find(r=>r.uuid===o)},getModelClassifications(e,t,n){return Object.values(i[t].formattedRawElements.classifications)},listClassificationElementRelations(e,t,n){return Object.values(i[t].formattedRawElements.elements).flatMap(r=>r.classifications.map(s=>({element_uuid:r.uuid,classification_id:s.id})))},getElementsFromClassification(e,t,n,o){return i[n].formattedRawElements.classifications[t].elements},getDrawings(e,t,n){return i[t].drawings},getDrawing(e,t,n,o){return this.getDrawings(e,n,o).find(r=>r.id===t)},getElements(e,t,n,o,r,s){return Object.values(i[t].formattedRawElements.elements).filter(l=>s?l.type===s:o?l.classifications.some(c=>c.name===o):r?l.classifications.some(c=>c.notation===r):!0)},getElementLinkedDocuments(e,t,n){return console.warn("[BIMData Viewer] Offline Warning: `getElementLinkedDocuments` is not available in offline mode."),[]},async getRawElements(e,t,n,o,r,s){return i[t].rawElements},getSimpleElements(e,t,n,o,r,s){const a=this.getElements(e,t,n,o,r,s);return TVt(a)},getClassificationsOfElement(e,t,n,o){return this.getElement(e,n,o,t).classifications},getDocumentsOfElement(e,t,n,o){return console.warn("[BIMData Viewer] Offline Warning: `getDocumentsOfElement` is not available in offline mode."),[]},getMaterials(e,t,n,o){return this.getElement(e,n,o,t).material_list.map(r=>r.material)},getMaterial(e,t,n,o,r){return this.getMaterials(e,t,o,r).find(s=>s.id===n)},getElementPropertySets(e,t,n,o){return this.getElement(e,n,o,t).property_sets},getElementPropertySet(e,t,n,o,r){return this.getElementPropertySets(e,t,o,r).find(s=>s.id===n)},getElementPropertySetProperties(e,t,n,o,r){return this.getElementPropertySet(e,t,r,n,o).properties},getElementPropertySetProperty(e,t,n,o,r,s){return this.getElementPropertySetProperties(e,t,o,r,s).find(a=>a.id===n)},getElementPropertySetPropertyDefinitions(e,t,n,o,r,s){return[this.getElementPropertySetProperty(e,t,r,n,o,s).definition]},getElementPropertySetPropertyDefinition(e,t,n,o,r,s,a){const l=this.getElementPropertySetProperty(e,t,s,o,r,a).definition;return l.id===n?l:void 0},getElementPropertySetPropertyDefinitionUnits(e,t,n,o,r,s,a){return[this.getElementPropertySetPropertyDefinition(e,t,s,n,o,r,a).unit]},getElementPropertySetPropertyDefinitionUnit(e,t,n,o,r,s,a,l){const c=this.getElementPropertySetPropertyDefinition(e,t,a,o,r,s,l).unit;return c.id===n?c:void 0},getElement(e,t,n,o){return i[t].formattedRawElements.elements[o]},getSimpleElement(e,t,n,o){return this.getSimpleElements(e,t,n)[o]},getLayers(e,t,n){return Object.values(i[t].formattedRawElements.layers)},getLayer(e,t,n,o){return this.getLayers(e,n,o).find(r=>r.id===t)},getModelMaterials(e,t,n){return Object.values(i[t].formattedRawElements.materials.materials_data)},getModelMaterial(e,t,n,o){return this.getModelMaterials(e,n,o).find(r=>r.id===t)},getProcessorHandlers(e,t,n){return console.warn("[BIMData Viewer] Offline Warning: `getProcessorHandlers` is not available in offline mode."),[]},getProcessorHandler(e,t,n,o){console.warn("[BIMData Viewer] Offline Warning: `getProcessorHandler` is not available in offline mode.")},getModelProperties(e,t,n){return i[t].properties},getModelProperty(e,t,n,o){return i[n].properties.find(r=>r.id===t)},getModelPropertyDefinitions(e,t,n){return Object.values(i[t].formattedRawElements.definitions)},getModelPropertyDefinition(e,t,n,o){return this.getModelPropertyDefinitions(e,n,o).find(r=>r.id===t)},getPropertySets(e,t,n){return Object.values(i[t].formattedRawElements.property_sets)},getPropertySet(e,t,n,o){return this.getPropertySets(e,n,o).find(r=>r.id===t)},getSpaces(e,t,n){return i[t].spaces},getSpace(e,t,n,o){return i[n].spaces.find(r=>r.id===t)},getStoreys(e,t,n){return i[t].storeys},getStoreyPlanPositioning(e,t,n,o,r){const s=this.getStorey(e,n,o,r).plans.find(a=>a.plan.id===t);return{translation_x:s.translation_x,translation_y:s.translation_y,rotate_z:s.rotate_z,scale:s.scale,opacity:s.opacity}},getStorey(e,t,n,o){return i[t].storeys.find(r=>r.uuid===o)},getSystems(e,t,n){return Object.values(i[t].formattedRawElements.systems)},getSystem(e,t,n,o){return this.getSystems(e,t,n).find(r=>r.uuid===o)},getModelUnits(e,t,n){return Object.values(i[t].formattedRawElements.units)},getModelUnit(e,t,n,o){return this.getModelUnits(e,n,o).find(r=>r.id===t)},getZones(e,t,n,o){return i[t].zones.filter(r=>o?r.color===o:!0)},getZone(e,t,n,o){return i[n].zones.find(r=>r.id===t)},getZoneSpaces(e,t,n,o){return this.getZone(e,o,t,n).spaces},getZoneSpace(e,t,n,o,r){return this.getZoneSpaces(e,n,o,r).find(s=>s.id===t)}}}async function RVt(i){const e=i.find(n=>n.filename==="data.json"),t=await(e==null?void 0:e.getData(new eVt));return t?JSON.parse(t):null}async function g5(i,e,t){const n=i.find(r=>r.filename===`${e.id}/${t}`),o=await(n==null?void 0:n.getData(new Bpe));return o?URL.createObjectURL(o):null}async function DVt(i,e){await Promise.all([g5(i,e,"document_file").then(t=>e.document&&(e.document.file=t)),g5(i,e,"structure_file").then(t=>e.structure_file=t),g5(i,e,"map_file").then(t=>e.map_file=t),g5(i,e,"binary_2d_file").then(t=>e.binary_2d_file=t),...e.xkt_files.map((t,n)=>g5(i,e,`xkt_file_v${t.version}`).then(o=>e.xkt_files[n]={version:t.version,file:o}))])}async function _Vt(i){const t=await new vVt(new Epe(i)).getEntries(),n=await RVt(t);return await Promise.all(Object.values(n).flatMap(({model:o,buildings:r,storeys:s})=>[o].concat(o.children).concat(r.flatMap(a=>a.plans).map(a=>a.plan)).concat(s.flatMap(a=>a.plans).map(a=>a.plan))).map(o=>DVt(t,o))),n}function vL(i,e,t){return new Proxy(i[t],{get:function(n,o){if(e[o])return e[o];throw new Error(`[BIMData Viewer] Offline Error: method \`${t}.${o}\` is not mocked.`)}})}async function LVt(i,e,t){var l,c,u;typeof i=="string"&&(i=await fetch(i).then(d=>d.blob()));const n=await _Vt(i),o=SVt(),r=IVt(),s=kVt(n);return Object.assign(o,(l=t.methods)==null?void 0:l.bcfApi),Object.assign(r,(c=t.methods)==null?void 0:c.collaborationApi),Object.assign(s,(u=t.methods)==null?void 0:u.modelApi),Object.assign({},e,{bcfApi:vL(e,o,"bcfApi"),collaborationApi:vL(e,r,"collaborationApi"),modelApi:vL(e,s,"modelApi")})}class FVt{constructor(e={}){const{apiUrl:t,archiveUrl:n,pdfBackendUrl:o,cloudId:r,projectId:s,accessToken:a,offline:l}=e;this.apiUrl=t,this.archiveUrl=n,this.pdfBackendUrl=o,this.cloudId=r,this.projectId=s,this._accessToken=a,this.offline=l??{enabled:!1};const c=UT.makeBIMDataApiClient({apiUrl:t,accessToken:a});this.apiClient=c,this.ready=Promise.resolve(),this.getModelsPromise=null,Object.assign(c,{BcfApi:function(){return console.warn("[BIMData Viewer] DEPRECATED - API - please use `apiClient.bcfApi` instead of `new apiClient.BcfApi()`."),c.bcfApi},CollaborationApi:function(){return console.warn("[BIMData Viewer] DEPRECATED - API - please use `apiClient.collaborationApi` instead of `new apiClient.CollaborationApi()`."),c.collaborationApi},ModelApi:function(){return console.warn("[BIMData Viewer] DEPRECATED - API - please use `apiClient.modelApi` instead of `new apiClient.ModelApi()`."),c.modelApi},IfcApi:function(){return console.warn("[BIMData Viewer] DEPRECATED - API - please use `apiClient.modelApi` instead of `new apiClient.IfcApi()`."),new Proxy(c.modelApi,{get:function(d,h,f){const A=h.replace("Deprecated","").replace("Ifc","Model");return Reflect.get(d,A,f)}})}})}get accessToken(){return this._accessToken}set accessToken(e){this._accessToken=e,this.apiClient.accessToken=e}async getAvailableModels(e=null,t=!1){return t&&(this.getModelsPromise=null),this.getModelsPromise||(this.getModelsPromise=apiClient.modelApi.getModels(cloudId,projectId)),(await this.getModelsPromise).filter(n=>(e==null?void 0:e.includes(n.type))??!0)}getModel(e){const{cloudId:t,projectId:n,apiClient:o}=this;return o.modelApi.getModel(t,e,n)}getIfc(e){return console.warn("[BIMData Viewer] DEPRECATED - API - please use the `getModel` method instead of `getIfc`."),this.getModel(e)}async getModelStructure(e){const o=(await(await fetch(e.structure_file)).json())[0];return xu(o),o}getIfcStructure(e){return console.warn("[BIMData Viewer] DEPRECATED - API - please use the getModelStructure method instead of getIfcStructure."),this.getModelStructure(e)}async getRawElements(e){const{cloudId:t,projectId:n,apiClient:o}=this,r=await o.modelApi.getRawElements(t,e,n);r.units.forEach(a=>{a.conversion_baseunit=r.units[a.conversion_baseunit_index],delete a.conversion_baseunit_index}),r.definitions.forEach(a=>{a.unit=r.units[a.unit_id],delete a.unit_id}),r.property_sets.forEach(a=>{a.properties.forEach(l=>{l.definition=r.definitions[l.def_id],delete l.def_id})});const s={};return r.elements.forEach(a=>{a.attributes=r.property_sets[a.attributes],a.property_sets=a.psets.map(l=>r.property_sets[l]),Object.assign(a,{get propertySets(){return console.warn("propertySets is deprecated, please use property_sets instead."),a.property_sets}}),delete a.psets,a.classifications=a.classifications.map(l=>r.classifications[l]),a.systems=a.systems.map(l=>r.systems[l]),a.layers=a.layers.map(l=>r.layers[l]),s[a.uuid]=a}),s}getStoreys(e){const{cloudId:t,projectId:n,apiClient:o}=this;return o.modelApi.getStoreys(t,e,n)}createModel(e){const{cloudId:t,projectId:n,apiClient:o}=this;return o.modelApi.createModel(t,n,{document_id:e})}async waitForModelProcess(e){const t=["C","E","X"];return t.includes(e.status)?e:new Promise((n,o)=>{const r=setInterval(async()=>{try{let s=await this.getModel(e.id);t.includes(s.status)&&(clearInterval(r),n(s))}catch(s){clearInterval(r),o(s)}},1e3)})}async createStoreyPlan(e,t,n){const{cloudId:o,projectId:r,apiClient:s}=this,a=await this.createModel(n);return await s.modelApi.createStoreyPlan(o,e,r,t,{id:a.id}),a}deleteStoreyPlan(e,t,n){const{cloudId:o,projectId:r,apiClient:s}=this;return s.modelApi.deleteStoreyPlan(o,n,e,r,t)}updatePlanPositioning(e,t,n,o){const{cloudId:r,projectId:s,apiClient:a}=this;return a.modelApi.updateStoreyPlanPositioning(r,n,e,s,t,o)}async enableOfflineMode(e,t={}){let n;this.ready=new Promise(o=>n=o),this.apiClient=await LVt(e,this.apiClient,t),this.offline.enabled=!0,n()}disableOfflineMode(){this.offline.enabled&&(this.apiClient=UT.makeBIMDataApiClient({apiUrl:this.apiUrl,accessToken:this.accessToken}),this.offline.enabled=!1)}}function OVt(i){const e=[{methodName:"selectObjects",property:"selected",value:!0,eventName:"objects-selected",exlusiveIndex:1},{methodName:"deselectObjects",property:"selected",value:!1,eventName:"objects-deselected"},{methodName:"highlightObjects",property:"highlighted",value:!0,eventName:"objects-highlighted"},{methodName:"unhighlightObjects",property:"highlighted",value:!1,eventName:"objects-unhighlighted"},{methodName:"showObjects",property:"visible",value:!0,eventName:"objects-shown"},{methodName:"hideObjects",property:"visible",value:!1,eventName:"objects-hidden"},{methodName:"xrayObjects",property:"xrayed",value:!0,eventName:"objects-xrayed"},{methodName:"unxrayObjects",property:"xrayed",value:!1,eventName:"objects-unxrayed"},{methodName:"setObjectsPickable",property:"pickable",value:!0,eventName:"objects-pickable"},{methodName:"setObjectsUnpickable",property:"pickable",value:!1,eventName:"objects-unpickable"}],t=e.reduce((o,r)=>(o[r.methodName]=function(s,a){n(this,r,a);const{property:l,value:c}=r,u=[];for(const d of s){const h=i.get(d);try{h[l]=c,u.push(h)}catch{console.warn(`object with id ${d} does not exist`)}}this.hub.emit(r.eventName,{objects:u,options:{...a}})},o[`${r.methodName}ByUuids`]=function(s,a){n(this,r,a);const{property:l,value:c}=r,u=s.map(d=>this.uuidsMap.get(d)).filter(d=>(d==null?void 0:d.length)>0).flatMap(d=>d.map(h=>(h[l]=c,h)));this.hub.emit(r.eventName,{objects:u,options:{...a}})},o),{}),n=(o,r,s)=>{if(r.exlusiveIndex!==void 0&&(s!=null&&s.exclusive)){const a=e[r.exlusiveIndex],{property:l,value:c}=r;o[a.methodName](o.objects.filter(u=>u[l]===c).map(u=>u.id),{options:{...s}})}};return{...t,colorizeObjects(o,r,s){const a=[];for(const l of o)try{const c=i.get(l);c.color=r,a.push(c)}catch{console.warn(`object with id ${l} does not exist`)}this.hub.emit("objects-colorized",{objects:a,color:r,options:{...s}})},colorizeObjectsByUuids(o,r,s){const a=o.flatMap(l=>this.uuidsMap.get(l));this.colorizeObjects(a.map(l=>l.id),r,s)},get objects(){return Array.from(i.values())},get objectsIds(){return this.objects.map(o=>o.id)},get objectsUuids(){return Array.from(new Set(this.objects.map(o=>o.uuid)))},get objectsMap(){return i}}}const UVt=Object.freeze({EXA:10**18,PETA:10**15,TERA:10**12,GIGA:10**9,MEGA:10**6,KILO:10**3,HECTO:10**2,DECA:10,DECI:10**-1,CENTI:10**-2,MILLI:10**-3,MICRO:10**-6,NANO:10**-9,PICO:10**-12,FEMTO:10**-15,ATTO:10**-18});async function NVt(i,e,t){async function n(u,d){try{const f=(await i.apiClient.modelApi.getElement(i.cloudId,t,i.projectId,u)).attributes.properties.find(A=>A.definition.name===d);if(f){const A=f.definition.unit;if(A){const{name:p,prefix:m}=A;p!=="METRE"&&console.warn(`[Viewer] Elevation unit other that "METRE" are not supported. Unit "${p}" fallback to "METRE".`);const g=UVt[m];return g===void 0&&console.warn(`[Viewer] Elevation unit prefix "${m}" is unknown and will be ignored.`),(f.value??0)*(g??1)}else return f.value??0}}catch(h){console.warn(`[Models] Cannot get elevation of object with uuid ${u}: ${h}`)}return 0}const o=new Map,r=new Map,s=new Map;function a(){const u=new Set(e.map(d=>{var h,f;return(f=(h=d.object)==null?void 0:h.site)==null?void 0:f.uuid}).filter(Boolean));return v8(u,10,(d,h)=>{n(d,"RefElevation").then(f=>{o.set(d,f),h()},h)})}function l(){const u=new Set(e.map(d=>{var h,f;return(f=(h=d.object)==null?void 0:h.building)==null?void 0:f.uuid}).filter(Boolean));return v8(u,10,(d,h)=>{n(d,"ElevationOfRefHeight").then(f=>{r.set(d,f),h()},h)})}function c(){return v8(e,10,(u,d)=>{n(u.uuid,"Elevation").then(h=>{s.set(u.uuid,h),d()},d)})}await Promise.all([a(),l(),c()]),e.forEach((u,d)=>{var A,p,m,g;const h=s.get(u.uuid)??d;u.elevation=h;const f=r.get((p=(A=u.object)==null?void 0:A.building)==null?void 0:p.uuid);if(f==null){const w=o.get((g=(m=u.object)==null?void 0:m.site)==null?void 0:g.uuid)??0;u.absoluteElevation=h+w}else u.absoluteElevation=h+f}),e.forEach((u,d)=>{var h,f;u.topElevation=((h=e[d+1])==null?void 0:h.elevation)??1/0,u.absoluteTopElevation=((f=e[d+1])==null?void 0:f.absoluteElevation)??1/0})}async function VVt(i,e,t){e.every(n=>n.bimdata_elevation!==null&&n.bimdata_elevation!==void 0)?(e.forEach(n=>{n.elevation=n.bimdata_elevation,n.absoluteElevation=n.bimdata_elevation}),e.forEach((n,o)=>{var r,s;n.topElevation=((r=e[o+1])==null?void 0:r.elevation)??1/0,n.absoluteTopElevation=((s=e[o+1])==null?void 0:s.absoluteElevation)??1/0})):await NVt(i,e,t)}class yL{constructor(e){const{archived:t,binary_2d_file:n,children:o,created_at:r,creator:s,document:a,document_id:l,errors:c,gltf_file:u,id:d,layout_name:h,map_file:f,name:A,north_vector:p,page_number:m,parent_id:g,preview_file:w,project_id:y,recommanded_2d_angle:v,size_ratio:x,source:M,status:E,structure_file:S,systems_file:T,type:P,updated_at:I,version:R,viewer_360_file:L,warnings:U,world_position:H,xkt_file:N,xkt_files:Q}=e;this.id=d,this.name=A,this.type=P,this.archived=t,this.binary_2d_file=n,this.children=(o==null?void 0:o.map(J=>new yL(J)))??[],this.created_at=r,this.creator=s,this.document=a,this.document_id=l,this.errors=c,this.gltf_file=u,this.map_file=f,this.north_vector=p,this.page_number=m,this.parent_id=g,this.preview_file=w,this.project_id=y,this.recommanded_2d_angle=v,this.size_ratio=x,this.source=M,this.status=E,this.structure_file=S,this.systems_file=T,this.updated_at=I,this.version=R,this.viewer_360_file=L,this.warnings=U,this.world_position=H,this.xkt_file=N,this.xkt_files=Q,this.layout_name=h}}class Kpe{constructor(e,t,n,o){this.model=t,this.storey=n,this.index=o,this.key=`${n.key}-${e.plan.id}-${o}`,this.translation_x=e.translation_x??0,this.translation_y=e.translation_y??0,this.rotate_z=e.rotate_z??0,this.scale=e.scale??1,this.opacity=e.opacity??1,this.plan=e.plan}}class HVt{constructor(e,t){this.model=t;const{name:n,uuid:o,plans:r,plans_unreachable_count:s,bimdata_elevation:a}=e;this.name=n,this.uuid=o,this.bimdata_elevation=a,this.key=`${t.id}-${this.uuid}`,this.plans_unreachable_count=s,this.plans=r.map((l,c)=>new Kpe(l,t,this,c)),this.object=t.uuids.get(this.uuid),this.objects=null,this.elevation=null,this.absoluteElevation=null,this.topElevation=null,this.absoluteTopElevation=null}get uuids(){return new Map([...this.objects.values()].map(e=>[e.uuid,e]))}}class wL extends GE{constructor(e,t){super(e,t,"zone");const{id:n,uuid:o,name:r,created_at:s,updated_at:a,parent_id:l,order:c,zones:u=[],spaces:d=[],color:h,storey_uuid:f}=e;this.id=n,this.uuid=o,this.name=r,this.created_at=s,this.updated_at=a,this.parent_id=l,this.order=c,this.zones=u.map(A=>new wL(A,t)),this.spaces=d,this.color=h,this.storey_uuid=f}getContainedSpaces(){const e=Array.from(this.spaces);for(const t of this.zones)e.push(...t.getContainedSpaces());return e}get area(){return this.getContainedSpaces().filter(t=>t.geometry).reduce((t,n)=>t+zVt(n.geometry),0)}get perimeter(){return this.getContainedSpaces().filter(t=>t.geometry).reduce((t,n)=>t+jVt(n.geometry),0)}}function zVt(i){let e=0;const t=i.length;for(let n=0;n<t;n++){const o=(n+1)%t;e+=i[n].x*i[o].y,e-=i[o].x*i[n].y}return Math.abs(e)/2}function jVt(i){let e=0;const t=i.length;for(let n=0;n<t;n++){const o=(n+1)%t;e+=Math.sqrt(Math.pow(i[o].x-i[n].x,2)+Math.pow(i[o].y-i[n].y,2))}return e}class GVt extends yL{constructor(e,t,{structure:n,zones:o,systems:r,storeys:s}={}){var c,u;if(super(t),this._stateObjectMap=e,this.uuids=new Map,n){const d=Rq(n,this,e),h=p$e(d);this.structure=d,this.objects=h,h.forEach(f=>{f.uuid&&this.uuids.set(f.uuid,f)})}else this.structure=null,this.objects=[];this.zones=[],this.setZones(o??[]),r==null||r.forEach(d=>{const h=new GE(d,this,"system");this.uuids.set(h.uuid,h),e.set(h.id,h),this.objects.unshift(h)}),this.storeys=(s==null?void 0:s.map(d=>new HVt(d,this)).sort(Cu("order",!1)))??[];const a=new Map(this.storeys.map(d=>[d.uuid,new Set])),l=this.type==="DWG"?"layout":"storey";for(const d of this.objects)d.type!==l&&a.has((c=d[l])==null?void 0:c.uuid)&&a.get((u=d[l])==null?void 0:u.uuid).add(d);for(const d of this.storeys){const h=a.get(d.uuid);d.objects=h?[...h.values()]:[]}this.objects.forEach(d=>{var h,f;d.parent=this.uuids.get((h=d.parent)==null?void 0:h.uuid),d.children=(f=d.children)==null?void 0:f.map(A=>this.uuids.get(A.uuid)).filter(Boolean)})}setZones(e=[]){this.zones.forEach(t=>{this._stateObjectMap.delete(t.id),this.uuids.delete(t.uuid),this.objects.splice(this.objects.indexOf(t),1)}),this.zones=e.map(t=>{const n=new wL(t,this);return this._stateObjectMap.set(n.id,n),this.uuids.set(n.uuid,n),this.objects.unshift(n),n})}}const qVt=(i,e,t)=>{const{api:n}=t;async function o(r){if(typeof r=="string"&&(console.warn(`[State] 'loadModel' called with id ${r} as string and parsed as integer.`),r=parseInt(r)),i.get(r))return console.warn(`[State] 'loadModel' called with id ${r}}, model already loaded.`),i.get(r);const s=[n.apiClient.modelApi.getZones(n.cloudId,r,n.projectId),n.apiClient.modelApi.getSystems(n.cloudId,r,n.projectId),n.getStoreys(r)],a=await n.getModel(r);a.parent_id&&!i.get(a.parent_id)&&await o(a.parent_id),a.structure_file&&s.push(n.getModelStructure(a));const[l,c,u,d]=await Promise.all(s),h=new GVt(e,a,{structure:d,zones:l,systems:c,storeys:u});return await VVt(n,h.storeys,h.id),i.set(r,h),h}return{get models(){return Array.from(i.values())},get ifcs(){return console.warn("[BIMData Viewer] DEPRECATED - State model - please use the models instead of ifcs."),Array.from(i.values()).filter(r=>!r.type||r.type==="IFC")},get modelsMap(){return i},get ifcsMap(){return console.warn("[BIMData Viewer] DEPRECATED - State model - please use the modelsMap instead of ifcsMap."),new Map([...i].filter(([,r])=>!r.type||r.type==="IFC"))},async loadModels(r){const s=await Promise.allSettled(r.map(o));s.filter(l=>l.status==="rejected").forEach(l=>console.error(l.reason));const a=s.filter(l=>l.status==="fulfilled").map(l=>l.value);if(a.length>0){const l=a.filter(c=>!c.type||c.type==="IFC");l.length&&this.hub.emit("ifcs-loaded",{ifcs:l}),this.hub.emit("models-loaded",{models:a}),t.globalContext.hub.emit("models-loaded",{models:a}),this.hub.emit("objects-added",{objects:a.flatMap(c=>c.objects)})}return a},loadIfcs(r){return console.warn("[BIMData Viewer] DEPRECATED - State model - please use the loadModels method instead of loadIfcs."),this.loadModels(r)},unloadModels(r){const s=[],a=[];if(r.forEach(l=>{const c=i.get(l);c?(i.delete(l),c.objects.map(d=>(a.push(d),d.id)).forEach(d=>e.delete(d)),s.push(c)):console.warn(`[State] Cannot unload model with id ${l} because it is not loaded.`)}),a.length>0&&this.hub.emit("objects-removed",{objects:a}),s.length>0){const l=s.filter(c=>!c.type||c.type==="IFC");l.length&&this.hub.emit("ifcs-unloaded",{ifcs:l}),this.hub.emit("models-unloaded",{models:s})}return s},unloadIfcs(r){return console.warn("[BIMData Viewer] DEPRECATED - State model - please use the unloadModels method instead of unloadIfcs."),this.unloadModels(r)},getStoreyFromAbsoluteElevation(r,s){var a;if(!r.storeys)return null;for(let l=0;l<r.storeys.length;l++)if(s>=r.storeys[l].absoluteElevation&&s<(((a=r.storeys[l+1])==null?void 0:a.absoluteElevation)??1/0))return r.storeys[l];return r.storeys[0]}}};function QVt(i){return{async createPlan(e,t,n,o){const r=await i.api.createStoreyPlan(e.id,t.uuid,n.id);await i.api.updatePlanPositioning(e.id,t.uuid,r.id,o);const s=new Kpe({...o,plan:r},e,t,e.storeys.length);return t.plans.push(s),this.hub.emit("plan-created",{plan:s}),s},async updatePlan(e){const t=await i.api.updatePlanPositioning(e.model.id,e.storey.uuid,e.plan.id,e);return Object.assign(e,t),this.hub.emit("plan-updated",{plan:e}),e},async deletePlan(e){await i.api.deleteStoreyPlan(e.model.id,e.storey.uuid,e.plan.id),e.storey.plans=e.storey.plans.filter(t=>t.key!==e.key),this.hub.emit("plan-deleted",{plan:e})}}}const KVt=(i,e)=>{const t={getObjectsByUuids(n){return n.flatMap(o=>this.uuidsMap.get(o))},getObject(n){return console.warn("[BIMData Viewer] DEPRECATED - State - `getObject` is deprecated, use `objectsMap.get` instead."),e.get(n)},getIfc(n){return console.warn("[BIMData Viewer] DEPRECATED - State - `getIfc` is deprecated, use `modelsMap.get` instead."),i.get(n)},get colorizedObjects(){return Array.from(e.values()).filter(n=>!!n.color)},get colorizedObjectsIds(){return this.colorizedObjects.map(n=>n.id)},get colorizedObjectsUuids(){return Array.from(new Set(this.colorizedObjects.map(n=>n.uuid)))},getObjectsOfType(n){return Array.from(e.values()).filter(o=>o.type===n)},getTypesOf(n){typeof n.map>"u"&&(n=[...n]);const o=new Set;return n.forEach(r=>{const s=e.get(r);s&&s.type&&o.add(s.type)}),Array.from(o).sort()},getObjectsWithTheSameTypeAs(n){const o=this.getTypesOf(n);return[...e.values()].filter(r=>o.includes(r.type))}};return JVt.forEach(n=>{Object.defineProperty(t,n.name,{get(){return Array.from(e.values()).filter(o=>o[n.property]===n.value).map(o=>Object.freeze(Object.defineProperties({},Object.getOwnPropertyDescriptors(o))))}}),Object.defineProperty(t,`${n.name}Ids`,{get(){return this[n.name].map(ZVt)}}),Object.defineProperty(t,`${n.name}Uuids`,{get(){return Array.from(new Set(this[n.name].map(WVt)))}})}),t},JVt=[{name:"selectedObjects",property:"selected",value:!0},{name:"deselectedObjects",property:"selected",value:!1},{name:"highlightedObjects",property:"highlighted",value:!0},{name:"unhighlightedObjects",property:"highlighted",value:!1},{name:"visibleObjects",property:"visible",value:!0},{name:"unvisibleObjects",property:"visible",value:!1},{name:"xrayedObjects",property:"xrayed",value:!0},{name:"unxrayedObjects",property:"xrayed",value:!1},{name:"pickableObjects",property:"pickable",value:!0},{name:"unpickableObjects",property:"pickable",value:!1}];function ZVt(i){return i.id}function WVt(i){return i.uuid}function CL(i,e,t){var n;return(n=i.mixins)!=null&&n.some(o=>o[t])||(i.mixins?i.mixins[i.mixins.length]=e:i.mixins=[e]),i}const Jpe=Symbol("annotation-mixin-id");function XVt(){let i=0;const e=new Map;return{get annotations(){return Array.from(e.values())},addAnnotation({x:t=0,y:n=0,z:o=0,draggable:r=!0,grabberSelector:s,component:a={render(){}},props:l={}}={},c){const u=this,d=i++,h={get id(){return d},get x(){return t},set x(f){t=f,u.hub.emit("annotation-updated",{annotation:h})},get y(){return n},set y(f){n=f,u.hub.emit("annotation-updated",{annotation:h})},get z(){return o},set z(f){o=f,u.hub.emit("annotation-updated",{annotation:h})},draggable:r,grabberSelector:s,component:a,props:l};return CL(h.component,{[Jpe]:!0,inject:["$viewer"]},Jpe),e.set(d,h),this.hub.emit("annotation-added",{annotation:h,options:c}),h},removeAnnotation(t,n){return e.has(t.id)?(e.delete(t.id),this.hub.emit("annotation-removed",{annotation:t,options:n}),!0):!1},clearAnnotations(){e.forEach(t=>this.removeAnnotation(t))}}}function YVt(i){const e=new Map,t=new Map,n={uuidsMap:{get(o){const r=[];return e.forEach(s=>{const a=s.uuids.get(o);a&&r.push(a)}),r}},hub:new uu};return[qVt(e,t,i),OVt(t),QVt(i),XVt(),KVt(e,t)].forEach(o=>Object.defineProperties(n,Object.getOwnPropertyDescriptors(o))),n}function $Vt(i){if((i==null?void 0:i.type)==="container")nHt(i);else if((i==null?void 0:i.type)==="zone")iHt(i);else throw new TypeError("AREAS CORE - Layout first child must be a zone or a container.");return eHt(i),i}function eHt(i){const e=new Set,t=new Set;for(let n of i)if(n.id!=null)if(n.type==="zone"){if(e.has(n.id))throw new Error("AREAS CORE - Cannot add the same zone id twice.");e.add(n.id)}else{if(t.has(n.id))throw new Error("AREAS CORE - Cannot add the same container id twice.");t.add(n.id)}}function tHt(i){Zpe(i.layout,"zone",i.zoneIdManager),Zpe(i.layout,"container",i.containerIdManager)}function Zpe(i,e,t){const n=[...i].filter(r=>r.type===e);n.map(r=>r.id).filter(r=>r!=null).forEach(r=>t.add(r)),n.filter(r=>r.id===void 0||r.id===null).forEach(r=>{r.id=t.nextId()})}function iHt(i){if(typeof i!="object")throw new TypeError("AREAS CORE - Invalid zone. Zone must be an object.");if((i==null?void 0:i.type)!=="zone")throw new TypeError('AREAS CORE - Invalid zone. A zone must be of type "zone".');return i}function nHt(i){var e,t;if(typeof i!="object")throw new TypeError("AREAS CORE - Invalid container. A container must be an object.");if((i==null?void 0:i.type)!=="container")throw new TypeError('AREAS CORE - Invalid container. Container must be of type "container".');if(i!=null&&i.direction&&!["row","column"].includes(i.direction))throw new TypeError('AREAS CORE - Invalid container. Container direction must be of type "row" or "column".');if(((e=i==null?void 0:i.children)==null?void 0:e.length)<2)throw new TypeError("AREAS CORE - Invalid container. Container children must have at least 2 children.");if(((t=i==null?void 0:i.children)==null?void 0:t.reduce((n,o)=>n+(o==null?void 0:o.ratio),0))!==100)throw new TypeError("AREAS CORE - Invalid container. The sum of container children ratios must be equal to 100.");return i}function Wpe(i){var e;return(e=i.children)!=null&&e.length&&i.children.forEach(t=>{Object.defineProperty(t,Symbol.iterator,{value:Wpe(t),configurable:!0})}),function*(){var t;if(yield i,(t=i.children)!=null&&t.length)for(let n of i.children)yield*n}}function xm(i){return Object.defineProperty(i,Symbol.iterator,{value:Wpe(i),configurable:!0}),i}function Xpe(){let i=1;const e=new Set;return{nextId(){for(;!this.isIdAvailable(i);)i++;return e.add(i),i},isIdAvailable(n){return!e.has(n)},add(n){return this.isIdAvailable(n)?(e.add(n),n):!1}}}function Ype(i){var t;if(!i)return;const e=Object.assign({},i);return((t=i.children)==null?void 0:t.length)>0&&(e.children=i.children.map(Ype)),e}function oHt(i){return e=>{const t=i.getZone(e);if(!t)return!1;const n=i.getParent(t);if(!n)throw new Error("AREAS CORE - Cannot delete root Zone");const o=n.children.indexOf(t);if(n.children.length>2){const r=n.children[o-1],s=n.children[o+1];o===0?s.ratio+=t.ratio:o===n.children.length-1?r.ratio+=t.ratio:(r.ratio+=Math.floor(t.ratio/2),s.ratio+=Math.ceil(t.ratio/2)),n.children=n.children.filter(a=>a.type!=="zone"||a.id!==e)}else{const r=n.children[o===1?0:1];r.ratio=n.ratio;const s=i.getParent(n);if(s){const a=s.children.indexOf(n);s.children.splice(a,1,r)}else i.layout=r}return!0}}var sHt=oHt;function rHt(i){return()=>$pe(i.layout,[i.layout])}function $pe(i,e=[]){var t;return(t=i.children)==null||t.forEach(n=>{e.push(n),n.type==="container"&&$pe(n,e)}),e}var aHt=rHt;function lHt(i){return e=>{if(!e)throw new TypeError("AREAS CORE - fail to get parent: container child is null or undefined");return i.layout.type==="zone"?null:efe(i.layout,e)}}function efe(i,e){for(let t of i.children){if(t===e)return i;if(t.type==="container"){const n=efe(t,e);if(n)return n}}return null}var cHt=lHt;function uHt(i){return e=>i.layout.type==="zone"?i.layout.id===e?i.layout:null:tfe(i.layout,e)}function tfe(i,e){for(let t of i.children)if(t.type==="zone"){if(t.id===e)return t}else{const n=tfe(t,e);if(n)return n}return null}var dHt=uHt;function hHt(i){return(t,n)=>{if(typeof n!="number")throw new TypeError("AREAS CORE - resize value must be a number.");const o=i.getParent(t),r=o.children.findIndex(a=>a===t);if(r===-1)return!1;const s=o.children[r+1];if(s){const a=t.ratio+s.ratio;let l=t.ratio+n;return l=l<0?0:l,l=l>a?a:l,t.ratio=l,s.ratio=a-l,!0}else return!1}}var pHt=hHt;function fHt(i){return(e,t=50,n="row",o=!0,r=null)=>{const s=i.getZone(e);if(!s)throw new Error(`AREAS CORE - fail to split zone ${e}: zone does not exist.`);if(typeof t!="number"||t<0||t>100)throw new TypeError(`AREAS CORE - fail to split zone: invalid ratio ${t}, ratio should be a number between 0 and 100.`);if(n!=="row"&&n!=="column")throw new TypeError(`AREAS CORE - fail to split zone: invalid direction ${n}, direction should be 'row' or 'column'.`);const a=i.getParent(s),l=xm({id:i.zoneIdManager.nextId(),type:"zone",...r});if(a){const c=a.children.findIndex(u=>u===s);if(a.direction===n)o?(l.ratio=Math.floor(s.ratio*(100-t)/100),s.ratio=Math.ceil(s.ratio*t/100),a.children.splice(c,1,s,l)):(l.ratio=Math.floor(s.ratio*t/100),s.ratio=Math.ceil(s.ratio*(100-t)/100),a.children.splice(c,1,l,s));else{const u=xm({id:i.containerIdManager.nextId(),type:"container",direction:n,ratio:s.ratio});o?(l.ratio=Math.floor(100-t),s.ratio=Math.ceil(t),u.children=[s,l]):(l.ratio=Math.floor(t),s.ratio=Math.ceil(100-t),u.children=[l,s]),a.children.splice(c,1,u)}}else{const c=xm({id:i.containerIdManager.nextId(),type:"container",direction:n});o?(l.ratio=Math.floor(100-t),s.ratio=Math.ceil(t),c.children=[s,l]):(l.ratio=Math.floor(t),s.ratio=Math.ceil(100-t),c.children=[l,s]),i._layout=c}return l}}var AHt=fHt;function mHt(i){return(e=50,t="row",n=!0,o=null)=>{const r=i.layout;if(typeof e!="number"||e<0||e>100)throw new TypeError(`AREAS CORE - fail to split layout: invalid ratio ${e}, ratio should be a number between 0 and 100.`);if(t!=="row"&&t!=="column")throw new TypeError(`AREAS CORE - fail to split layout: invalid direction ${t}, direction should be 'row' or 'column'.`);const s=xm({id:i.zoneIdManager.nextId(),type:"zone",...o}),a=xm({id:i.containerIdManager.nextId(),type:"container",direction:t});return n?(s.ratio=Math.floor(100-e),r.ratio=Math.ceil(e),a.children=[r,s]):(s.ratio=Math.floor(e),r.ratio=Math.ceil(100-e),a.children=[s,r]),i._layout=a,s}}var gHt=mHt;function vHt(i){return(e,t)=>{const n=i.getZone(e),o=i.getZone(t);if(!n)throw new Error(`AREAS CORE - fail to swap zone ${e}: zone does not exist.`);if(!o)throw new Error(`AREAS CORE - fail to swap to zone ${t}: zone does not exist.`);const r=i.getParent(n),s=i.getParent(o),a=r.children.indexOf(n),l=s.children.indexOf(o),c=n.ratio,u=o.ratio;n.ratio=u,o.ratio=c,r.children[a]=o,s.children[l]=n}}var yHt=vHt;function wHt(i){const e={_layout:null,get layout(){return this._layout},set layout(t){t||(t={type:"zone"}),xm(t),$Vt(t),this._layout=t,tHt(e)},zoneIdManager:Xpe(),containerIdManager:Xpe()};return e.layout=i,e.deleteZone=sHt(e),e.getNodes=aHt(e),e.getParent=cHt(e),e.getZone=dHt(e),e.resize=pHt(e),e.splitZone=AHt(e),e.splitLayout=gHt(e),e.swapZones=yHt(e),e}var CHt=wHt;function ife(i=1,e=0,t=100){return Math.min(Math.max(e,i),t)}function nfe(i,e){const t=i.getParent(e);if(t){const{width:n,height:o}=nfe(i,t),r=t.children.length-1;return t.direction==="column"?{width:n,height:Math.max(0,(o-r*i.separatorSize)*(e.ratio/100))}:{width:Math.max(0,(n-r*i.separatorSize)*(e.ratio/100)),height:o}}else return{width:i.width,height:i.height}}function ofe(i,e,t){const{width:n,height:o}=nfe(i,e),r=e.children.length-1;if(e.direction==="column"){const s=1-r*i.separatorSize/o;return{height:`${ife(t.ratio*s,0,100)}%`,width:"100%"}}else{const s=1-r*i.separatorSize/n;return{height:"100%",width:`${ife(t.ratio*s,0,100)}%`}}}function bHt(i,e){const t={ref:i.contentManager.getRef(e.id),id:`zone-${e.id}`,class:"areas-zone",style:{flexGrow:0,overflow:"hidden"},key:e.id},n=i.getParent(e);if(n){const{width:o,height:r}=ofe(i,n,e);t.style={width:o,height:r}}else t.style={height:"100%"};return i.vue.h("div",t)}var bL=bHt;function xHt(i,e,t){const{separatorSize:n,separatorDetectionMargin:o,separatorDetectionZIndex:r}=i,s=e.direction==="column",a={ref:`separator-${e.id}-${t+1}`,class:"areas-separator",style:{[s?"height":"width"]:`${n}px`,backgroundColor:"var(--areas-separator-color, black)",flexShrink:0,position:"relative"}},l=s?"ns-resize":"ew-resize",c=i.vue.h("div",{style:{position:"absolute",[s?"height":"width"]:`${o*2}px`,[s?"width":"height"]:"100%",[s?"top":"left"]:`${-o+n/2}px`,zIndex:r,cursor:l},onMousedown:u=>MHt(i,e,t,u,l)});return i.vue.h("div",a,i.resizable?[c]:null)}function MHt(i,e,t,n,o){n.preventDefault(),n.stopPropagation(),document.body.style.cursor=o;const r=a=>EHt(i,e,t,a),s=()=>BHt(r,s);document.addEventListener("mousemove",r),document.addEventListener("mouseup",s)}function EHt(i,e,t,n){const o=e.children[t],r=e.direction==="column"?"height":"width",a=i.root.$refs[`separator-${e.id}-${t+1}`].getBoundingClientRect(),{separatorSize:l}=i,c=(e.direction==="column"?n.clientY-a.y:n.clientX-a.x)-l/2,u=i.root.$refs[`container-${e.id}`].getBoundingClientRect()[r],d=c/u*100;i.resize(o,d)}function BHt(i,e){document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",e),document.body.style.cursor=""}var SHt=xHt;function xL(i,e){const t={ref:`container-${e.id}`,id:`container-${e.id}`,class:"areas-container",style:{height:"100%",display:"flex",flexDirection:e.direction}},n=i.getParent(e);if(n){const{width:s,height:a}=ofe(i,n,e);t.style.width=s,t.style.height=a}const o=e.children.length-1,r=e.children.map((s,a)=>a<=o-1?[s.type==="zone"?bL(i,s):xL(i,s),SHt(i,e,a)]:s.type==="zone"?bL(i,s):xL(i,s));return i.vue.h("div",t,[r])}var IHt=xL;function PHt(i){const e=new Map,t=new Map,n=new Map;e.set("default",{component:{render(){return i.vue.h("div","Default component")}}});function o(s){return s&&!e.has(s)&&(console.warn(`[AREAS] Content with name ${s} is not registered, fallback to 'default'.`),s="default"),e.get(s)}return{registerContent(s,a){e.set(s,{name:s,component:a})},renderContent(s){return[...s].filter(a=>a.type==="zone").forEach(a=>{t.set(a.id,Object.assign({},o(a.content??"default"),{ref:i.vue.ref(null),options:{zoneId:a.id,...a.options,key:a.id},name:a.content??"default"}))}),i.vue.h("div",{style:{display:"none"}},[...t.values()].map(a=>i.vue.h(a.component,{...a.options,ref:a.ref})))},link(){[...n.entries()].forEach(([s,a])=>{const l=t.get(s);if(!l)return;const c=l.ref.value.$el,u=a.value;for(;u.lastChild;)u.removeChild(u.lastChild);u.appendChild(c)})},getElementZoneId(s){var a;for(const[l,c]of[...n.entries()])if((a=c.value)!=null&&a.contains(s))return l;return null},getRef(s){let a=n.get(s);return a||(a=i.vue.ref(null),n.set(s,a)),a},deleteZoneContent(s){t.delete(s),n.delete(s)},clean(){t.clear(),n.clear()}}}var THt=PHt;function kHt(i,e,t){const n=e.ref(0),o=e.ref(0),{separatorSize:r=2,separatorDetectionMargin:s=10,separatorDetectionZIndex:a=2,resizable:l=!0}=t??{},c=e.ref(!!l),u={vue:e,core:i,zones:e.ref([]),get resizable(){return c.value},set resizable(h){c.value=h},get width(){return n.value},get height(){return o.value},get separatorSize(){return r},get separatorDetectionMargin(){return s},get separatorDetectionZIndex(){return a},getParent(h){return this.core.getParent(h)},async coreLayoutSync(h=!1){this.layout&&(h?this.layout.value=this.core.layout:e.triggerRef(this.layout),await e.nextTick(),this.contentManager.link())},resize(h,f){this.core.resize(h,f),e.triggerRef(this.layout)},async split(h,f,A,p,m){const g=this.core.splitZone(h,f,A,p,m);return await this.coreLayoutSync(this.zones.value.length===1),g},async splitLayout(h,f,A,p){const m=this.core.splitLayout(h,f,A,p);return await this.coreLayoutSync(!0),m},async delete(h){let f=!1;const A=this.core.getZone(h);if(A){const m=this.core.getParent(A);f=(m==null?void 0:m.children.length)===2&&this.core.getParent(m)===null}this.contentManager.deleteZoneContent(h);const p=this.core.deleteZone(h);return await this.coreLayoutSync(f),p},async swap(h,f){const A=this.core.swapZones(h,f);return await this.coreLayoutSync(),A},destroy(){var h;(h=this.resizeObserver)==null||h.disconnect()},root:null,get component(){return this.layout=e.shallowRef(i.layout),e.watch(this.layout,h=>{this.zones.value=[...h].filter(f=>f.type==="zone")},{immediate:!0}),{created(){u.root=this},mounted(){const{width:h,height:f}=this.$el.getBoundingClientRect();n.value=h,o.value=f,u.resizeObserver=new ResizeObserver(A=>A.forEach(p=>{const{width:m,height:g}=p.target.getBoundingClientRect();n.value=m,o.value=g})),u.resizeObserver.observe(this.$el),u.contentManager.link()},render(){return e.h("div",{class:"areas-root"},[u.contentManager.renderContent(u.layout.value),d(u.layout.value)])}}}};u.contentManager=THt(u);function d(h){return h.type==="zone"?bL(u,h):IHt(u,h)}return u}var RHt=kHt;function DHt(i,e=null,t=null){const n=CHt(e),o=RHt(n,i,t);return Object.freeze({core:n,renderer:o,destroy(){o.destroy()},swap(s,a){return this.renderer.swap(s,a)},split(s,a,l,c,u){return this.renderer.split(s,a,l,c,u)},splitLayout(s,a,l,c){return this.renderer.splitLayout(s,a,l,c)},delete(s){return this.renderer.delete(s)},registerContent(s,a){this.renderer.contentManager.registerContent(s,a)},getElementZoneId(s){return this.renderer.contentManager.getElementZoneId(s)},get layout(){return Ype(this.core.layout)},set layout(s){this.core.layout=s,this.renderer.contentManager.clean(),this.renderer.coreLayoutSync(!0)},get component(){return this.renderer.component},get resizable(){return this.renderer.resizable},set resizable(s){this.renderer.resizable=s}})}var _Ht=DHt;function LHt(i){return Array.isArray(i==null?void 0:i.children)?rfe(i):sfe(i)}function sfe(i,e=100){return{type:"zone",ratio:e,options:typeof i=="string"?{windowName:i}:i}}function rfe(i,e=100){return{type:"container",ratio:e,direction:i.direction,children:i.children.map((t,n)=>Array.isArray(t==null?void 0:t.children)?rfe(t,i.ratios[n]):sfe(t,i.ratios[n]))}}function FHt(i,e,t=!0){return i.type==="zone"?afe(i,e,t):lfe(i,e,t)}function afe(i,e,t=!0){var r,s;const n=e.get(i.id);if(!n)throw new Error(`[Layout parser] Local context with id ${i.id} not found`);return{windowName:((r=n.window)==null?void 0:r.name)??null,windowState:{modelIds:n.loadedModelIds,viewpoint:(t||void 0)&&n.viewer&&n.getViewpoint(),storey:(s=n.selectedStorey)==null?void 0:s.key}}}function lfe(i,e,t=!0){return{direction:i.direction,ratios:i.children.map(n=>n.ratio),children:i.children.map(n=>n.type==="zone"?afe(n,e,t):lfe(n,e,t))}}const OHt={props:{text:{type:String,default:""}},emits:["close"]},UHt={class:"success-modal"},NHt={class:"success-modal__close"},VHt={class:"success-modal__title"},HHt={class:"success-modal__title--icon"},zHt={class:"success-modal__text"},jHt={class:"success-modal__button"};function GHt(i,e,t,n,o,r){const s=k("BIMDataIconClose"),a=k("BIMDataPieSpinner"),l=k("BIMDataIconSuccess"),c=k("BIMDataButton");return B(),O("div",UHt,[b("div",NHt,[D(a,{delay:5,onStop:e[1]||(e[1]=u=>i.$emit("close"))},{default:V(()=>[D(s,{class:"icon-close",size:"xxxs",onClick:e[0]||(e[0]=u=>i.$emit("close"))})]),_:1})]),b("div",VHt,[b("h2",null,K(i.$t("modal.success")),1),b("span",HHt,[D(l,{class:"fill-primary"})])]),b("div",zHt,K(t.text||i.$t("modal.success")),1),b("div",jHt,[D(c,{class:"bimdata-btn__fill bimdata-btn__fill--primary bimdata-btn__radius",onClick:e[2]||(e[2]=u=>i.$emit("close"))},{default:V(()=>[it(K(i.$t("modal.button")),1)]),_:1})])])}const qHt=z(OHt,[["render",GHt],["__scopeId","data-v-79d3a107"]]),cfe=Symbol("modal-mixin-id"),QHt={inject:["$viewer"],data(){return{modals:[]}},computed:{notBlocking(){var i;return((i=this.modal)==null?void 0:i.blocking)===!1},modal(){return this.modals.length?this.modals[0]:null},positionning(){var e;if(!((e=this.modal)!=null&&e.positions))return;const i=this.modal.positions;return{top:i.top?`${i.top}`:"0",right:i.right?`${i.right}`:"0",bottom:i.bottom?`${i.bottom} `:"0",left:i.left?`${i.left}`:"0"}}},created(){document.addEventListener("keydown",e=>{this.notBlocking&&e.key==="Escape"&&this.clearModal()});const i=this;this.mixin={[cfe]:!0,beforeCreate(){!this._.setupState.$viewer&&(this.$plugin=i.$plugin,this.$viewer=i.$viewer)}}},methods:{pushModal(i,e={},{display:t="full",positions:n,blocking:o=!0,exclusive:r=!1}={}){r&&(this.modals=[]),this.inject$viewerRecursively(i),this.modals.push({component:ra(i),props:e,display:t,positions:n,blocking:o})},clearModal(){this.modals.shift()},clearModals(){this.modals=[]},inject$viewerRecursively(i){CL(i,this.mixin,cfe),i.components&&Object.values(i.components).forEach(e=>this.inject$viewerRecursively(e))},getModal(i){const e={success:qHt};if(Object.keys(e).includes(i))return e[i];console.warn(`Modal name unknown : ${i}`)}}},KHt={class:"bimdata-modal-manager__content"};function JHt(i,e,t,n,o,r){const s=pi("click-away");return r.modal?(B(),O("div",{key:0,class:ue(["bimdata-modal-manager",{full:r.modal.display==="full",banner:r.modal.display==="banner"}]),style:ce(r.positionning),onClick:e[0]||(e[0]=pt(a=>r.notBlocking?r.clearModal():null,["self"]))},[ft((B(),O("div",KHt,[(B(),W(vn(r.modal.component),ds(r.modal.props,{onClose:r.clearModal}),null,16,["onClose"]))])),[[s,()=>r.notBlocking?r.clearModal():null,"mousedown"]])],6)):ne("",!0)}const ufe=z(QHt,[["render",JHt]]),ZHt={props:{plugin:{type:Object,required:!0}},setup(i){const e=mt("$viewer"),{plugin:t}=i;cn("$plugin",t),dfe(t.component,e.localContext,t)}},ML=Symbol("plugin-mixin-id");function dfe(i,e,t,n=!0){var s;if(!!((s=i.mixins)!=null&&s.some(a=>a[ML])))return;const r={[ML]:!0,beforeCreate(){!this._.setupState.$viewer&&(this.$plugin=t,this.$viewer=e.$viewer),Object.defineProperties(this,{$isOpen:{get(){return t.isOpen}},$loading:{get(){return t.loading}},$shown:{get(){return t.shown}}}),n&&(t.componentInstance=this,t.isViewer&&(e.viewer=this))},methods:{$open(...a){t.open(...a)},$close(...a){t.close(...a)},$show(){t.show()},$hide(){t.hide()}}};n&&(r.props={plugin:{type:Object,required:!0}},r.provide={pluginInstance:t},r.created=function(){e.hub.emit("plugin-created",{name:t.name,plugin:this}),e.$viewer.globalContext.hub.emit("plugin-created",{name:t.name,plugin:this})},r.unmounted=function(){e.hub.emit("plugin-destroyed",{name:t.name,plugin:this}),e.$viewer.globalContext.hub.emit("plugin-destroyed",{name:t.name,plugin:this})}),CL(i,r,ML),i.components&&Object.values(i.components).forEach(a=>dfe(a,e,t,!1))}function WHt(i,e,t,n,o,r){return ft((B(),W(vn(t.plugin.component),{class:"plugin-component-instance-container",plugin:t.plugin},null,8,["plugin"])),[[qt,t.plugin.shown]])}const v5=z(ZHt,[["render",WHt]]),XHt={components:{PluginComponentInstanceContainer:v5},props:{plugin:{type:Object,required:!0,validator(i){return i.sidePanel.width?typeof i.sidePanel.width=="number":i.sidePanel}}}};function YHt(i,e,t,n,o,r){const s=k("PluginComponentInstanceContainer");return ft((B(),O("div",{class:"side-panel",style:ce(`
5501
+ `,n=()=>e.useDataURI?"data:text/javascript,"+encodeURIComponent(t):URL.createObjectURL(new Blob([t],{type:"text/javascript"}));i({workerScripts:{inflate:[n],deflate:[n]}})}const XNt="Writer iterator completed too soon",YNt="Content-Type",$Nt=64*1024,xpe="writable";class hL{constructor(){this.size=0}init(){this.initialized=!0}}class Mpe extends hL{get readable(){const e=this,{chunkSize:t=$Nt}=e,n=new ReadableStream({start(){this.chunkOffset=0},async pull(o){const{offset:r=0,size:s,diskNumberStart:a}=n,{chunkOffset:l}=this;o.enqueue(await ns(e,r+l,Math.min(t,s-l),a)),l+t>s?o.close():this.chunkOffset+=t}});return n}}class Epe extends Mpe{constructor(e){super(),Object.assign(this,{blob:e,size:e.size})}async readUint8Array(e,t){const n=this,o=e+t;let s=await(e||o<n.size?n.blob.slice(e,o):n.blob).arrayBuffer();return s.byteLength>t&&(s=s.slice(e,o)),new Uint8Array(s)}}class Bpe extends hL{constructor(e){super();const t=this,n=new TransformStream,o=[];e&&o.push([YNt,e]),Object.defineProperty(t,xpe,{get(){return n.writable}}),t.blob=new Response(n.readable,{headers:o}).blob()}getData(){return this.blob}}class eVt extends Bpe{constructor(e){super(e),Object.assign(this,{encoding:e,utf8:!e||e.toLowerCase()=="utf-8"})}async getData(){const{encoding:e,utf8:t}=this,n=await super.getData();if(n.text&&t)return n.text();{const o=new FileReader;return new Promise((r,s)=>{Object.assign(o,{onload:({target:a})=>r(a.result),onerror:()=>s(o.error)}),o.readAsText(n,e)})}}}class tVt extends Mpe{constructor(e){super(),this.readers=e}async init(){const e=this,{readers:t}=e;e.lastDiskNumber=0,e.lastDiskOffset=0,await Promise.all(t.map(async(n,o)=>{await n.init(),o!=t.length-1&&(e.lastDiskOffset+=n.size),e.size+=n.size})),super.init()}async readUint8Array(e,t,n=0){const o=this,{readers:r}=this;let s,a=n;a==-1&&(a=r.length-1);let l=e;for(;l>=r[a].size;)l-=r[a].size,a++;const c=r[a],u=c.size;if(l+t<=u)s=await ns(c,l,t);else{const d=u-l;s=new Uint8Array(t),s.set(await ns(c,l,d)),s.set(await o.readUint8Array(e+d,t-d,n),d)}return o.lastDiskNumber=Math.max(a,o.lastDiskNumber),s}}class Spe extends hL{constructor(e,t=4294967295){super();const n=this;Object.assign(n,{diskNumber:0,diskOffset:0,size:0,maxSize:t,availableSize:t});let o,r,s;const a=new WritableStream({async write(u){const{availableSize:d}=n;if(s)u.length>=d?(await l(u.slice(0,d)),await c(),n.diskOffset+=o.size,n.diskNumber++,s=null,await this.write(u.slice(d))):await l(u);else{const{value:h,done:f}=await e.next();if(f&&!h)throw new Error(XNt);o=h,o.size=0,o.maxSize&&(n.maxSize=o.maxSize),n.availableSize=n.maxSize,await Hw(o),r=h.writable,s=r.getWriter(),await this.write(u)}},async close(){await s.ready,await c()}});Object.defineProperty(n,xpe,{get(){return a}});async function l(u){const d=u.length;d&&(await s.ready,await s.write(u),o.size+=d,n.size+=d,n.availableSize-=d)}async function c(){r.size=o.size,await s.close()}}}async function Hw(i,e){if(i.init&&!i.initialized)await i.init(e);else return Promise.resolve()}function iVt(i){return Array.isArray(i)&&(i=new tVt(i)),i instanceof ReadableStream&&(i={readable:i}),i}function nVt(i){i.writable===Bs&&typeof i.next==d5&&(i=new Spe(i)),i instanceof WritableStream&&(i={writable:i});const{writable:e}=i;return e.size===Bs&&(e.size=0),i instanceof Spe||Object.assign(i,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),i}function ns(i,e,t,n){return i.readUint8Array(e,t,n)}const Ipe="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(""),oVt=Ipe.length==256;function sVt(i){if(oVt){let e="";for(let t=0;t<i.length;t++)e+=Ipe[i[t]];return e}else return new TextDecoder().decode(i)}function zw(i,e){return e&&e.trim().toLowerCase()=="cp437"?sVt(i):new TextDecoder(e).decode(i)}const Ppe="filename",Tpe="rawFilename",kpe="comment",Rpe="rawComment",Dpe="uncompressedSize",_pe="compressedSize",Lpe="offset",pL="diskNumberStart",fL="lastModDate",AL="rawLastModDate",Fpe="lastAccessDate",rVt="rawLastAccessDate",Ope="creationDate",aVt="rawCreationDate",lVt=[Ppe,Tpe,_pe,Dpe,fL,AL,kpe,Rpe,Fpe,Ope,Lpe,pL,pL,"internalFileAttribute","externalFileAttribute","msDosCompatible","zip64","encrypted","version","versionMadeBy","zipCrypto","directory","bitFlag","signature","filenameUTF8","commentUTF8","compressionMethod","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"];class Upe{constructor(e){lVt.forEach(t=>this[t]=e[t])}}const mL="File format is not recognized",cVt="End of central directory not found",uVt="End of Zip64 central directory locator not found",dVt="Central directory header not found",hVt="Local file header not found",pVt="Zip64 extra field not found",fVt="File contains encrypted entry",AVt="Encryption method not supported",Npe="Compression method not supported",Vpe="Split zip file",Hpe="utf-8",zpe="cp437",mVt=[[Dpe,Gh],[_pe,Gh],[Lpe,Gh],[pL,dd]],gVt={[dd]:{getValue:io,bytes:4},[Gh]:{getValue:jw,bytes:8}};class vVt{constructor(e,t={}){Object.assign(this,{reader:iVt(e),options:t,config:cNt()})}async*getEntriesGenerator(e={}){const t=this;let{reader:n}=t;const{config:o}=t;if(await Hw(n),(n.size===Bs||!n.readUint8Array)&&(n=new Epe(await new Response(n.readable).blob()),await Hw(n)),n.size<ym)throw new Error(mL);n.chunkSize=uNt(o);const r=await MVt(n,ZUt,n.size,ym,dd*16);if(!r){const P=await ns(n,0,4),I=Ro(P);throw io(I)==JUt?new Error(Vpe):new Error(cVt)}const s=Ro(r);let a=io(s,12),l=io(s,16);const c=r.offset,u=ko(s,20),d=c+ym+u;let h=ko(s,4);const f=n.lastDiskNumber||0;let A=ko(s,6),p=ko(s,8),m=0,g=0;if(l==Gh||a==Gh||p==dd||A==dd){const P=await ns(n,r.offset-tL,tL),I=Ro(P);if(io(I,0)==WUt){l=jw(I,8);let R=await ns(n,l,iL,-1),L=Ro(R);const U=r.offset-tL-iL;if(io(L,0)!=Fhe&&l!=U){const H=l;l=U,m=l-H,R=await ns(n,l,iL,-1),L=Ro(R)}if(io(L,0)!=Fhe)throw new Error(uVt);h==dd&&(h=io(L,16)),A==dd&&(A=io(L,20)),p==dd&&(p=jw(L,32)),a==Gh&&(a=jw(L,40)),l-=a}}if(l>=n.size&&(m=n.size-l-a-ym,l=n.size-a-ym),f!=h)throw new Error(Vpe);if(l<0)throw new Error(mL);let w=0,y=await ns(n,l,a,A),v=Ro(y);if(a){const P=r.offset-a;if(io(v,w)!=Lhe&&l!=P){const I=l;l=P,m+=l-I,y=await ns(n,l,a,A),v=Ro(y)}}const x=r.offset-l-(n.lastDiskOffset||0);if(a!=x&&x>=0&&(a=x,y=await ns(n,l,a,A),v=Ro(y)),l<0||l>=n.size)throw new Error(mL);const M=Is(t,e,"filenameEncoding"),E=Is(t,e,"commentEncoding");for(let P=0;P<p;P++){const I=new yVt(n,o,t.options);if(io(v,w)!=Lhe)throw new Error(dVt);jpe(I,v,w+6);const R=!!I.bitFlag.languageEncodingFlag,L=w+46,U=L+I.filenameLength,H=U+I.extraFieldLength,N=ko(v,w+4),Q=(N&0)==0,J=y.subarray(L,U),te=ko(v,w+32),le=H+te,Se=y.subarray(H,le),Ee=R,Ne=R,Ce=Q&&(bm(v,w+38)&Vhe)==Vhe,Pe=io(v,w+42)+m;Object.assign(I,{versionMadeBy:N,msDosCompatible:Q,compressedSize:0,uncompressedSize:0,commentLength:te,directory:Ce,offset:Pe,diskNumberStart:ko(v,w+34),internalFileAttribute:ko(v,w+36),externalFileAttribute:io(v,w+38),rawFilename:J,filenameUTF8:Ee,commentUTF8:Ne,rawExtraField:y.subarray(U,H)});const Ue=Is(t,e,"decodeText")||zw,ae=Ee?Hpe:M||zpe,Re=Ne?Hpe:E||zpe;let ve=Ue(J,ae);ve===Bs&&(ve=zw(J,ae));let De=Ue(Se,Re);De===Bs&&(De=zw(Se,Re)),Object.assign(I,{rawComment:Se,filename:ve,comment:De,directory:Ce||ve.endsWith(rNt)}),g=Math.max(Pe,g),await Gpe(I,I,v,w+6),I.zipCrypto=I.encrypted&&!I.extraFieldAES;const Xe=new Upe(I);Xe.getData=(G,se)=>I.getData(G,Xe,se),w=le;const{onprogress:Ze}=e;if(Ze)try{await Ze(P+1,p,new Upe(I))}catch{}yield Xe}const S=Is(t,e,"extractPrependedData"),T=Is(t,e,"extractAppendedData");return S&&(t.prependedData=g>0?await ns(n,0,g):new Uint8Array),t.comment=u?await ns(n,c+ym,u):new Uint8Array,T&&(t.appendedData=d<n.size?await ns(n,d,n.size-d):new Uint8Array),!0}async getEntries(e={}){const t=[];for await(const n of this.getEntriesGenerator(e))t.push(n);return t}async close(){}}class yVt{constructor(e,t,n){Object.assign(this,{reader:e,config:t,options:n})}async getData(e,t,n={}){const o=this,{reader:r,offset:s,diskNumberStart:a,extraFieldAES:l,compressionMethod:c,config:u,bitFlag:d,signature:h,rawLastModDate:f,uncompressedSize:A,compressedSize:p}=o,m=t.localDirectory={},g=await ns(r,s,30,a),w=Ro(g);let y=Is(o,n,"password"),v=Is(o,n,"rawPassword");const x=Is(o,n,"passThrough");if(y=y&&y.length&&y,v=v&&v.length&&v,l&&l.originalCompressionMethod!=QUt)throw new Error(Npe);if(c!=qUt&&c!=GUt&&!x)throw new Error(Npe);if(io(w,0)!=KUt)throw new Error(hVt);jpe(m,w,4),m.rawExtraField=m.extraFieldLength?await ns(r,s+30+m.filenameLength,m.extraFieldLength,a):new Uint8Array,await Gpe(o,m,w,4,!0),Object.assign(t,{lastAccessDate:m.lastAccessDate,creationDate:m.creationDate});const M=o.encrypted&&m.encrypted&&!x,E=M&&!l;if(x||(t.zipCrypto=E),M){if(!E&&l.strength===Bs)throw new Error(AVt);if(!y&&!v)throw new Error(fVt)}const S=s+30+m.filenameLength+m.extraFieldLength,T=p,P=r.readable;Object.assign(P,{diskNumberStart:a,offset:S,size:T});const I=Is(o,n,"signal"),R=Is(o,n,"checkPasswordOnly");R&&(e=new WritableStream),e=nVt(e),await Hw(e,x?p:A);const{writable:L}=e,{onstart:U,onprogress:H,onend:N}=n,Q={options:{codecType:mpe,password:y,rawPassword:v,zipCrypto:E,encryptionStrength:l&&l.strength,signed:Is(o,n,"checkSignature")&&!x,passwordVerification:E&&(d.dataDescriptor?f>>>8&255:h>>>24&255),signature:h,compressed:c!=0&&!x,encrypted:o.encrypted&&!x,useWebWorkers:Is(o,n,"useWebWorkers"),useCompressionStream:Is(o,n,"useCompressionStream"),transferStreams:Is(o,n,"transferStreams"),checkPasswordOnly:R},config:u,streamOptions:{signal:I,size:T,onstart:U,onprogress:H,onend:N}};let J=0;try{({outputSize:J}=await JNt({readable:P,writable:L},Q))}catch(te){if(!R||te.message!=sL)throw te}finally{const te=Is(o,n,"preventClose");L.size+=J,!te&&!L.locked&&await L.getWriter().close()}return R?Bs:e.getData?e.getData():L}}function jpe(i,e,t){const n=i.rawBitFlag=ko(e,t+2),o=(n&Ohe)==Ohe,r=io(e,t+6);Object.assign(i,{encrypted:o,version:ko(e,t),bitFlag:{level:(n&sNt)>>1,dataDescriptor:(n&Uhe)==Uhe,languageEncodingFlag:(n&Nhe)==Nhe},rawLastModDate:r,lastModDate:EVt(r),filenameLength:ko(e,t+22),extraFieldLength:ko(e,t+24)})}async function Gpe(i,e,t,n,o){const{rawExtraField:r}=e,s=e.extraField=new Map,a=Ro(new Uint8Array(r));let l=0;try{for(;l<r.length;){const g=ko(a,l),w=ko(a,l+2);s.set(g,{type:g,data:r.slice(l+4,l+4+w)}),l+=4+w}}catch{}const c=ko(t,n+4);Object.assign(e,{signature:io(t,n+10),uncompressedSize:io(t,n+18),compressedSize:io(t,n+14)});const u=s.get(XUt);u&&(wVt(u,e),e.extraFieldZip64=u);const d=s.get(iNt);d&&(await qpe(d,Ppe,Tpe,e,i),e.extraFieldUnicodePath=d);const h=s.get(nNt);h&&(await qpe(h,kpe,Rpe,e,i),e.extraFieldUnicodeComment=h);const f=s.get(YUt);f?(CVt(f,e,c),e.extraFieldAES=f):e.compressionMethod=c;const A=s.get($Ut);A&&(bVt(A,e),e.extraFieldNTFS=A);const p=s.get(tNt);p&&(xVt(p,e,o),e.extraFieldExtendedTimestamp=p);const m=s.get(oNt);m&&(e.extraFieldUSDZ=m)}function wVt(i,e){e.zip64=!0;const t=Ro(i.data),n=mVt.filter(([o,r])=>e[o]==r);for(let o=0,r=0;o<n.length;o++){const[s,a]=n[o];if(e[s]==a){const l=gVt[a];e[s]=i[s]=l.getValue(t,r),r+=l.bytes}else if(i[s])throw new Error(pVt)}}async function qpe(i,e,t,n,o){const r=Ro(i.data),s=new Ow;s.append(o[t]);const a=Ro(new Uint8Array(4));a.setUint32(0,s.get(),!0);const l=io(r,1);Object.assign(i,{version:bm(r,0),[e]:zw(i.data.subarray(5)),valid:!o.bitFlag.languageEncodingFlag&&l==io(a,0)}),i.valid&&(n[e]=i[e],n[e+"UTF8"]=!0)}function CVt(i,e,t){const n=Ro(i.data),o=bm(n,4);Object.assign(i,{vendorVersion:bm(n,0),vendorId:bm(n,2),strength:o,originalCompressionMethod:t,compressionMethod:ko(n,5)}),e.compressionMethod=i.compressionMethod}function bVt(i,e){const t=Ro(i.data);let n=4,o;try{for(;n<i.data.length&&!o;){const r=ko(t,n),s=ko(t,n+2);r==eNt&&(o=i.data.slice(n+4,n+4+s)),n+=4+s}}catch{}try{if(o&&o.length==24){const r=Ro(o),s=r.getBigUint64(0,!0),a=r.getBigUint64(8,!0),l=r.getBigUint64(16,!0);Object.assign(i,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:l});const c=gL(s),u=gL(a),d=gL(l),h={lastModDate:c,lastAccessDate:u,creationDate:d};Object.assign(i,h),Object.assign(e,h)}}catch{}}function xVt(i,e,t){const n=Ro(i.data),o=bm(n,0),r=[],s=[];t?((o&1)==1&&(r.push(fL),s.push(AL)),(o&2)==2&&(r.push(Fpe),s.push(rVt)),(o&4)==4&&(r.push(Ope),s.push(aVt))):i.data.length>=5&&(r.push(fL),s.push(AL));let a=1;r.forEach((l,c)=>{if(i.data.length>=a+4){const u=io(n,a);e[l]=i[l]=new Date(u*1e3);const d=s[c];i[d]=u}a+=4})}async function MVt(i,e,t,n,o){const r=new Uint8Array(4),s=Ro(r);BVt(s,0,e);const a=n+o;return await l(n)||await l(Math.min(a,t));async function l(c){const u=t-c,d=await ns(i,u,c);for(let h=d.length-n;h>=0;h--)if(d[h]==r[0]&&d[h+1]==r[1]&&d[h+2]==r[2]&&d[h+3]==r[3])return{offset:u+h,buffer:d.slice(h,h+n).buffer}}}function Is(i,e,t){return e[t]===Bs?i.options[t]:e[t]}function EVt(i){const e=(i&4294901760)>>16,t=i&65535;try{return new Date(1980+((e&65024)>>9),((e&480)>>5)-1,e&31,(t&63488)>>11,(t&2016)>>5,(t&31)*2,0)}catch{}}function gL(i){return new Date(Number(i/BigInt(1e4)-BigInt(116444736e5)))}function bm(i,e){return i.getUint8(e)}function ko(i,e){return i.getUint16(e,!0)}function io(i,e){return i.getUint32(e,!0)}function jw(i,e){return Number(i.getBigUint64(e,!0))}function BVt(i,e,t){i.setUint32(e,t,!0)}function Ro(i){return new DataView(i.buffer)}let Qpe;try{Qpe=typeof document>"u"&&typeof HT>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?HT.href:vd&&vd.tagName.toUpperCase()==="SCRIPT"&&vd.src||new URL("bimdata-viewer.umd.cjs",document.baseURI).href}catch{}nL({baseURL:Qpe}),WNt(nL),nL({Deflate:bUt,Inflate:jUt});function SVt(i){return{getDetailedExtensions(e){return[]},getExtensions(e){return[]},getFullTopics(e,t,n,o,r,s,a){return[]},getTopics(e,t,n,o){return[]}}}function IVt(i){return{checkProjectAccess(e,t){return{has_read_permission:!0,has_write_permission:!1,has_admin_permission:!1,token_scopes:["bcf:read","document:read","model:read"],usable_scopes:["bcf:read","document:read","model:read"],user_role:50,user:null}},getProjectDMSTree(e,t){return{}},getDocumentHistories(e,t,n){return[]},getProjectUsers(e,t){return[]}}}function PVt(i){const e=i,t=e.units.reduce((u,d)=>(d.conversion_baseunit=e.units[d.conversion_baseunit_index],delete d.conversion_baseunit_index,u[d.id]=d,u),{}),n=e.definitions.reduce((u,d)=>(d.unit=e.units[d.unit_id],delete d.unit_id,u[d.id]=d,u),{}),o=e.property_sets.reduce((u,d)=>(d.properties.forEach(h=>{h.definition=e.definitions[h.def_id],delete h.def_id}),u[d.id]=d,u),{}),r=e.classifications.reduce((u,d)=>(d.name=d.type,d.title=d.description,u[d.id]=d,u),{}),s=e.layers.reduce((u,d)=>(d.elements=[],u[d.id]=d,u),{}),a=e.systems.reduce((u,d)=>(d.elements=[],u[d.uuid]=d,u),{}),l={};l.materials_data=e.materials.materials_data.reduce((u,d)=>(d.property_sets=d.psets.map(h=>e.property_sets[h]),delete d.psets,delete d.step_id,u[d.id]=d,u),{}),l.list_components=e.materials.list_components.reduce((u,d)=>(d.material=e.materials.materials_data[d.material],d.option=e.materials.options[d.material_option],u[d.id]=d,delete d.id,u),{}),l.options=e.materials.options.reduce((u,d)=>(d.list_components=d.material_list.map(h=>e.materials.list_components[h]),u[d.id]=d,u),{});const c={};return e.elements.forEach(u=>{u.attributes=e.property_sets[u.attributes],u.property_sets=u.psets.map(d=>e.property_sets[d]),delete u.psets,u.classifications=u.classifications.map(d=>e.classifications[d]),u.systems=u.systems.map(d=>{const h=e.systems[d];return h.elements.push(u.uuid),h}),u.layers=u.layers.map(d=>{const h=e.layers[d];return h.elements.push(u.uuid),h}),u.material_list=u.material_list.map(d=>e.materials.list_components[d]),c[u.uuid]=u}),{units:t,definitions:n,property_sets:o,classifications:r,layers:s,systems:a,materials:l,elements:c}}function TVt(i){const e={};return Object.values(i).forEach(t=>{e[t.uuid]={},e[t.uuid].attributes={},t.attributes.properties.forEach(n=>{e[t.uuid].attributes[n.definition.name]=n.value}),t.property_sets.forEach(n=>{e[t.uuid][n.name]={},n.properties.forEach(o=>{e[t.uuid][n.name][o.definition.name]=o.value})})}),e}function kVt(i){return Object.values(i).forEach(e=>{e.formattedRawElements=PVt(e.rawElements)}),{getModels(e,t,n,o,r){let s=Object.values(i).map(a=>a.model);return s=s.filter(a=>!(a.type==="PDF"&&a.parent_id)),(n==null?void 0:n.length)>0&&(s=s.filter(a=>n.includes(a.source))),(o==null?void 0:o.length)>0&&(s=s.filter(a=>o.includes(a.status))),(r==null?void 0:r.length)>0&&(s=s.filter(a=>r.includes(a.type))),s},getModel(e,t,n){return i[t].model},getTileset(e,t,n,o){console.warn("[BIMData Viewer] Offline Warning: `getTileset` is not available in offline mode.")},getBuildings(e,t,n){return i[t].buildings},getBuildingPlanPositioning(e,t,n,o,r){const s=this.getBuilding(t,o,r,e).plans.find(a=>a.plan.id===n);return{translation_x:s.translation_x,translation_y:s.translation_y,rotate_z:s.rotate_z,scale:s.scale,opacity:s.opacity}},getBuilding(e,t,n,o){return i[t].buildings.find(r=>r.uuid===o)},getModelClassifications(e,t,n){return Object.values(i[t].formattedRawElements.classifications)},listClassificationElementRelations(e,t,n){return Object.values(i[t].formattedRawElements.elements).flatMap(r=>r.classifications.map(s=>({element_uuid:r.uuid,classification_id:s.id})))},getElementsFromClassification(e,t,n,o){return i[n].formattedRawElements.classifications[t].elements},getDrawings(e,t,n){return i[t].drawings},getDrawing(e,t,n,o){return this.getDrawings(e,n,o).find(r=>r.id===t)},getElements(e,t,n,o,r,s){return Object.values(i[t].formattedRawElements.elements).filter(l=>s?l.type===s:o?l.classifications.some(c=>c.name===o):r?l.classifications.some(c=>c.notation===r):!0)},getElementLinkedDocuments(e,t,n){return console.warn("[BIMData Viewer] Offline Warning: `getElementLinkedDocuments` is not available in offline mode."),[]},async getRawElements(e,t,n,o,r,s){return i[t].rawElements},getSimpleElements(e,t,n,o,r,s){const a=this.getElements(e,t,n,o,r,s);return TVt(a)},getClassificationsOfElement(e,t,n,o){return this.getElement(e,n,o,t).classifications},getDocumentsOfElement(e,t,n,o){return console.warn("[BIMData Viewer] Offline Warning: `getDocumentsOfElement` is not available in offline mode."),[]},getMaterials(e,t,n,o){return this.getElement(e,n,o,t).material_list.map(r=>r.material)},getMaterial(e,t,n,o,r){return this.getMaterials(e,t,o,r).find(s=>s.id===n)},getElementPropertySets(e,t,n,o){return this.getElement(e,n,o,t).property_sets},getElementPropertySet(e,t,n,o,r){return this.getElementPropertySets(e,t,o,r).find(s=>s.id===n)},getElementPropertySetProperties(e,t,n,o,r){return this.getElementPropertySet(e,t,r,n,o).properties},getElementPropertySetProperty(e,t,n,o,r,s){return this.getElementPropertySetProperties(e,t,o,r,s).find(a=>a.id===n)},getElementPropertySetPropertyDefinitions(e,t,n,o,r,s){return[this.getElementPropertySetProperty(e,t,r,n,o,s).definition]},getElementPropertySetPropertyDefinition(e,t,n,o,r,s,a){const l=this.getElementPropertySetProperty(e,t,s,o,r,a).definition;return l.id===n?l:void 0},getElementPropertySetPropertyDefinitionUnits(e,t,n,o,r,s,a){return[this.getElementPropertySetPropertyDefinition(e,t,s,n,o,r,a).unit]},getElementPropertySetPropertyDefinitionUnit(e,t,n,o,r,s,a,l){const c=this.getElementPropertySetPropertyDefinition(e,t,a,o,r,s,l).unit;return c.id===n?c:void 0},getElement(e,t,n,o){return i[t].formattedRawElements.elements[o]},getSimpleElement(e,t,n,o){return this.getSimpleElements(e,t,n)[o]},getLayers(e,t,n){return Object.values(i[t].formattedRawElements.layers)},getLayer(e,t,n,o){return this.getLayers(e,n,o).find(r=>r.id===t)},getModelMaterials(e,t,n){return Object.values(i[t].formattedRawElements.materials.materials_data)},getModelMaterial(e,t,n,o){return this.getModelMaterials(e,n,o).find(r=>r.id===t)},getProcessorHandlers(e,t,n){return console.warn("[BIMData Viewer] Offline Warning: `getProcessorHandlers` is not available in offline mode."),[]},getProcessorHandler(e,t,n,o){console.warn("[BIMData Viewer] Offline Warning: `getProcessorHandler` is not available in offline mode.")},getModelProperties(e,t,n){return i[t].properties},getModelProperty(e,t,n,o){return i[n].properties.find(r=>r.id===t)},getModelPropertyDefinitions(e,t,n){return Object.values(i[t].formattedRawElements.definitions)},getModelPropertyDefinition(e,t,n,o){return this.getModelPropertyDefinitions(e,n,o).find(r=>r.id===t)},getPropertySets(e,t,n){return Object.values(i[t].formattedRawElements.property_sets)},getPropertySet(e,t,n,o){return this.getPropertySets(e,n,o).find(r=>r.id===t)},getSpaces(e,t,n){return i[t].spaces},getSpace(e,t,n,o){return i[n].spaces.find(r=>r.id===t)},getStoreys(e,t,n){return i[t].storeys},getStoreyPlanPositioning(e,t,n,o,r){const s=this.getStorey(e,n,o,r).plans.find(a=>a.plan.id===t);return{translation_x:s.translation_x,translation_y:s.translation_y,rotate_z:s.rotate_z,scale:s.scale,opacity:s.opacity}},getStorey(e,t,n,o){return i[t].storeys.find(r=>r.uuid===o)},getSystems(e,t,n){return Object.values(i[t].formattedRawElements.systems)},getSystem(e,t,n,o){return this.getSystems(e,t,n).find(r=>r.uuid===o)},getModelUnits(e,t,n){return Object.values(i[t].formattedRawElements.units)},getModelUnit(e,t,n,o){return this.getModelUnits(e,n,o).find(r=>r.id===t)},getZones(e,t,n,o){return i[t].zones.filter(r=>o?r.color===o:!0)},getZone(e,t,n,o){return i[n].zones.find(r=>r.id===t)},getZoneSpaces(e,t,n,o){return this.getZone(e,o,t,n).spaces},getZoneSpace(e,t,n,o,r){return this.getZoneSpaces(e,n,o,r).find(s=>s.id===t)}}}async function RVt(i){const e=i.find(n=>n.filename==="data.json"),t=await(e==null?void 0:e.getData(new eVt));return t?JSON.parse(t):null}async function g5(i,e,t){const n=i.find(r=>r.filename===`${e.id}/${t}`),o=await(n==null?void 0:n.getData(new Bpe));return o?URL.createObjectURL(o):null}async function DVt(i,e){await Promise.all([g5(i,e,"document_file").then(t=>e.document&&(e.document.file=t)),g5(i,e,"structure_file").then(t=>e.structure_file=t),g5(i,e,"map_file").then(t=>e.map_file=t),g5(i,e,"binary_2d_file").then(t=>e.binary_2d_file=t),...e.xkt_files.map((t,n)=>g5(i,e,`xkt_file_v${t.version}`).then(o=>e.xkt_files[n]={version:t.version,file:o}))])}async function _Vt(i){const t=await new vVt(new Epe(i)).getEntries(),n=await RVt(t);return await Promise.all(Object.values(n).flatMap(({model:o,buildings:r,storeys:s})=>[o].concat(o.children).concat(r.flatMap(a=>a.plans).map(a=>a.plan)).concat(s.flatMap(a=>a.plans).map(a=>a.plan))).map(o=>DVt(t,o))),n}function vL(i,e,t){return new Proxy(i[t],{get:function(n,o){if(e[o])return e[o];throw new Error(`[BIMData Viewer] Offline Error: method \`${t}.${o}\` is not mocked.`)}})}async function LVt(i,e,t){var l,c,u;typeof i=="string"&&(i=await fetch(i).then(d=>d.blob()));const n=await _Vt(i),o=SVt(),r=IVt(),s=kVt(n);return Object.assign(o,(l=t.methods)==null?void 0:l.bcfApi),Object.assign(r,(c=t.methods)==null?void 0:c.collaborationApi),Object.assign(s,(u=t.methods)==null?void 0:u.modelApi),Object.assign({},e,{bcfApi:vL(e,o,"bcfApi"),collaborationApi:vL(e,r,"collaborationApi"),modelApi:vL(e,s,"modelApi")})}class FVt{constructor(e={}){const{apiUrl:t,archiveUrl:n,pdfBackendUrl:o,cloudId:r,projectId:s,accessToken:a,offline:l}=e;this.apiUrl=t,this.archiveUrl=n,this.pdfBackendUrl=o,this.cloudId=r,this.projectId=s,this._accessToken=a,this.offline=l??{enabled:!1};const c=UT.makeBIMDataApiClient({apiUrl:t,accessToken:a});this.apiClient=c,this.ready=Promise.resolve(),this.getModelsPromise=null,Object.assign(c,{BcfApi:function(){return console.warn("[BIMData Viewer] DEPRECATED - API - please use `apiClient.bcfApi` instead of `new apiClient.BcfApi()`."),c.bcfApi},CollaborationApi:function(){return console.warn("[BIMData Viewer] DEPRECATED - API - please use `apiClient.collaborationApi` instead of `new apiClient.CollaborationApi()`."),c.collaborationApi},ModelApi:function(){return console.warn("[BIMData Viewer] DEPRECATED - API - please use `apiClient.modelApi` instead of `new apiClient.ModelApi()`."),c.modelApi},IfcApi:function(){return console.warn("[BIMData Viewer] DEPRECATED - API - please use `apiClient.modelApi` instead of `new apiClient.IfcApi()`."),new Proxy(c.modelApi,{get:function(d,h,f){const A=h.replace("Deprecated","").replace("Ifc","Model");return Reflect.get(d,A,f)}})}})}get accessToken(){return this._accessToken}set accessToken(e){this._accessToken=e,this.apiClient.accessToken=e}async getAvailableModels(e=null,t=!1){return t&&(this.getModelsPromise=null),this.getModelsPromise||(this.getModelsPromise=this.apiClient.modelApi.getModels(this.cloudId,this.projectId)),(await this.getModelsPromise).filter(n=>(e==null?void 0:e.includes(n.type))??!0)}getModel(e){const{cloudId:t,projectId:n,apiClient:o}=this;return o.modelApi.getModel(t,e,n)}getIfc(e){return console.warn("[BIMData Viewer] DEPRECATED - API - please use the `getModel` method instead of `getIfc`."),this.getModel(e)}async getModelStructure(e){const o=(await(await fetch(e.structure_file)).json())[0];return xu(o),o}getIfcStructure(e){return console.warn("[BIMData Viewer] DEPRECATED - API - please use the getModelStructure method instead of getIfcStructure."),this.getModelStructure(e)}async getRawElements(e){const{cloudId:t,projectId:n,apiClient:o}=this,r=await o.modelApi.getRawElements(t,e,n);r.units.forEach(a=>{a.conversion_baseunit=r.units[a.conversion_baseunit_index],delete a.conversion_baseunit_index}),r.definitions.forEach(a=>{a.unit=r.units[a.unit_id],delete a.unit_id}),r.property_sets.forEach(a=>{a.properties.forEach(l=>{l.definition=r.definitions[l.def_id],delete l.def_id})});const s={};return r.elements.forEach(a=>{a.attributes=r.property_sets[a.attributes],a.property_sets=a.psets.map(l=>r.property_sets[l]),Object.assign(a,{get propertySets(){return console.warn("propertySets is deprecated, please use property_sets instead."),a.property_sets}}),delete a.psets,a.classifications=a.classifications.map(l=>r.classifications[l]),a.systems=a.systems.map(l=>r.systems[l]),a.layers=a.layers.map(l=>r.layers[l]),s[a.uuid]=a}),s}getStoreys(e){const{cloudId:t,projectId:n,apiClient:o}=this;return o.modelApi.getStoreys(t,e,n)}createModel(e){const{cloudId:t,projectId:n,apiClient:o}=this;return o.modelApi.createModel(t,n,{document_id:e})}async waitForModelProcess(e){const t=["C","E","X"];return t.includes(e.status)?e:new Promise((n,o)=>{const r=setInterval(async()=>{try{let s=await this.getModel(e.id);t.includes(s.status)&&(clearInterval(r),n(s))}catch(s){clearInterval(r),o(s)}},1e3)})}async createStoreyPlan(e,t,n){const{cloudId:o,projectId:r,apiClient:s}=this,a=await this.createModel(n);return await s.modelApi.createStoreyPlan(o,e,r,t,{id:a.id}),a}deleteStoreyPlan(e,t,n){const{cloudId:o,projectId:r,apiClient:s}=this;return s.modelApi.deleteStoreyPlan(o,n,e,r,t)}updatePlanPositioning(e,t,n,o){const{cloudId:r,projectId:s,apiClient:a}=this;return a.modelApi.updateStoreyPlanPositioning(r,n,e,s,t,o)}async enableOfflineMode(e,t={}){let n;this.ready=new Promise(o=>n=o),this.apiClient=await LVt(e,this.apiClient,t),this.offline.enabled=!0,n()}disableOfflineMode(){this.offline.enabled&&(this.apiClient=UT.makeBIMDataApiClient({apiUrl:this.apiUrl,accessToken:this.accessToken}),this.offline.enabled=!1)}}function OVt(i){const e=[{methodName:"selectObjects",property:"selected",value:!0,eventName:"objects-selected",exlusiveIndex:1},{methodName:"deselectObjects",property:"selected",value:!1,eventName:"objects-deselected"},{methodName:"highlightObjects",property:"highlighted",value:!0,eventName:"objects-highlighted"},{methodName:"unhighlightObjects",property:"highlighted",value:!1,eventName:"objects-unhighlighted"},{methodName:"showObjects",property:"visible",value:!0,eventName:"objects-shown"},{methodName:"hideObjects",property:"visible",value:!1,eventName:"objects-hidden"},{methodName:"xrayObjects",property:"xrayed",value:!0,eventName:"objects-xrayed"},{methodName:"unxrayObjects",property:"xrayed",value:!1,eventName:"objects-unxrayed"},{methodName:"setObjectsPickable",property:"pickable",value:!0,eventName:"objects-pickable"},{methodName:"setObjectsUnpickable",property:"pickable",value:!1,eventName:"objects-unpickable"}],t=e.reduce((o,r)=>(o[r.methodName]=function(s,a){n(this,r,a);const{property:l,value:c}=r,u=[];for(const d of s){const h=i.get(d);try{h[l]=c,u.push(h)}catch{console.warn(`object with id ${d} does not exist`)}}this.hub.emit(r.eventName,{objects:u,options:{...a}})},o[`${r.methodName}ByUuids`]=function(s,a){n(this,r,a);const{property:l,value:c}=r,u=s.map(d=>this.uuidsMap.get(d)).filter(d=>(d==null?void 0:d.length)>0).flatMap(d=>d.map(h=>(h[l]=c,h)));this.hub.emit(r.eventName,{objects:u,options:{...a}})},o),{}),n=(o,r,s)=>{if(r.exlusiveIndex!==void 0&&(s!=null&&s.exclusive)){const a=e[r.exlusiveIndex],{property:l,value:c}=r;o[a.methodName](o.objects.filter(u=>u[l]===c).map(u=>u.id),{options:{...s}})}};return{...t,colorizeObjects(o,r,s){const a=[];for(const l of o)try{const c=i.get(l);c.color=r,a.push(c)}catch{console.warn(`object with id ${l} does not exist`)}this.hub.emit("objects-colorized",{objects:a,color:r,options:{...s}})},colorizeObjectsByUuids(o,r,s){const a=o.flatMap(l=>this.uuidsMap.get(l));this.colorizeObjects(a.map(l=>l.id),r,s)},get objects(){return Array.from(i.values())},get objectsIds(){return this.objects.map(o=>o.id)},get objectsUuids(){return Array.from(new Set(this.objects.map(o=>o.uuid)))},get objectsMap(){return i}}}const UVt=Object.freeze({EXA:10**18,PETA:10**15,TERA:10**12,GIGA:10**9,MEGA:10**6,KILO:10**3,HECTO:10**2,DECA:10,DECI:10**-1,CENTI:10**-2,MILLI:10**-3,MICRO:10**-6,NANO:10**-9,PICO:10**-12,FEMTO:10**-15,ATTO:10**-18});async function NVt(i,e,t){async function n(u,d){try{const f=(await i.apiClient.modelApi.getElement(i.cloudId,t,i.projectId,u)).attributes.properties.find(A=>A.definition.name===d);if(f){const A=f.definition.unit;if(A){const{name:p,prefix:m}=A;p!=="METRE"&&console.warn(`[Viewer] Elevation unit other that "METRE" are not supported. Unit "${p}" fallback to "METRE".`);const g=UVt[m];return g===void 0&&console.warn(`[Viewer] Elevation unit prefix "${m}" is unknown and will be ignored.`),(f.value??0)*(g??1)}else return f.value??0}}catch(h){console.warn(`[Models] Cannot get elevation of object with uuid ${u}: ${h}`)}return 0}const o=new Map,r=new Map,s=new Map;function a(){const u=new Set(e.map(d=>{var h,f;return(f=(h=d.object)==null?void 0:h.site)==null?void 0:f.uuid}).filter(Boolean));return v8(u,10,(d,h)=>{n(d,"RefElevation").then(f=>{o.set(d,f),h()},h)})}function l(){const u=new Set(e.map(d=>{var h,f;return(f=(h=d.object)==null?void 0:h.building)==null?void 0:f.uuid}).filter(Boolean));return v8(u,10,(d,h)=>{n(d,"ElevationOfRefHeight").then(f=>{r.set(d,f),h()},h)})}function c(){return v8(e,10,(u,d)=>{n(u.uuid,"Elevation").then(h=>{s.set(u.uuid,h),d()},d)})}await Promise.all([a(),l(),c()]),e.forEach((u,d)=>{var A,p,m,g;const h=s.get(u.uuid)??d;u.elevation=h;const f=r.get((p=(A=u.object)==null?void 0:A.building)==null?void 0:p.uuid);if(f==null){const w=o.get((g=(m=u.object)==null?void 0:m.site)==null?void 0:g.uuid)??0;u.absoluteElevation=h+w}else u.absoluteElevation=h+f}),e.forEach((u,d)=>{var h,f;u.topElevation=((h=e[d+1])==null?void 0:h.elevation)??1/0,u.absoluteTopElevation=((f=e[d+1])==null?void 0:f.absoluteElevation)??1/0})}async function VVt(i,e,t){e.every(n=>n.bimdata_elevation!==null&&n.bimdata_elevation!==void 0)?(e.forEach(n=>{n.elevation=n.bimdata_elevation,n.absoluteElevation=n.bimdata_elevation}),e.forEach((n,o)=>{var r,s;n.topElevation=((r=e[o+1])==null?void 0:r.elevation)??1/0,n.absoluteTopElevation=((s=e[o+1])==null?void 0:s.absoluteElevation)??1/0})):await NVt(i,e,t)}class yL{constructor(e){const{archived:t,binary_2d_file:n,children:o,created_at:r,creator:s,document:a,document_id:l,errors:c,gltf_file:u,id:d,layout_name:h,map_file:f,name:A,north_vector:p,page_number:m,parent_id:g,preview_file:w,project_id:y,recommanded_2d_angle:v,size_ratio:x,source:M,status:E,structure_file:S,systems_file:T,type:P,updated_at:I,version:R,viewer_360_file:L,warnings:U,world_position:H,xkt_file:N,xkt_files:Q}=e;this.id=d,this.name=A,this.type=P,this.archived=t,this.binary_2d_file=n,this.children=(o==null?void 0:o.map(J=>new yL(J)))??[],this.created_at=r,this.creator=s,this.document=a,this.document_id=l,this.errors=c,this.gltf_file=u,this.map_file=f,this.north_vector=p,this.page_number=m,this.parent_id=g,this.preview_file=w,this.project_id=y,this.recommanded_2d_angle=v,this.size_ratio=x,this.source=M,this.status=E,this.structure_file=S,this.systems_file=T,this.updated_at=I,this.version=R,this.viewer_360_file=L,this.warnings=U,this.world_position=H,this.xkt_file=N,this.xkt_files=Q,this.layout_name=h}}class Kpe{constructor(e,t,n,o){this.model=t,this.storey=n,this.index=o,this.key=`${n.key}-${e.plan.id}-${o}`,this.translation_x=e.translation_x??0,this.translation_y=e.translation_y??0,this.rotate_z=e.rotate_z??0,this.scale=e.scale??1,this.opacity=e.opacity??1,this.plan=e.plan}}class HVt{constructor(e,t){this.model=t;const{name:n,uuid:o,plans:r,plans_unreachable_count:s,bimdata_elevation:a}=e;this.name=n,this.uuid=o,this.bimdata_elevation=a,this.key=`${t.id}-${this.uuid}`,this.plans_unreachable_count=s,this.plans=r.map((l,c)=>new Kpe(l,t,this,c)),this.object=t.uuids.get(this.uuid),this.objects=null,this.elevation=null,this.absoluteElevation=null,this.topElevation=null,this.absoluteTopElevation=null}get uuids(){return new Map([...this.objects.values()].map(e=>[e.uuid,e]))}}class wL extends GE{constructor(e,t){super(e,t,"zone");const{id:n,uuid:o,name:r,created_at:s,updated_at:a,parent_id:l,order:c,zones:u=[],spaces:d=[],color:h,storey_uuid:f}=e;this.id=n,this.uuid=o,this.name=r,this.created_at=s,this.updated_at=a,this.parent_id=l,this.order=c,this.zones=u.map(A=>new wL(A,t)),this.spaces=d,this.color=h,this.storey_uuid=f}getContainedSpaces(){const e=Array.from(this.spaces);for(const t of this.zones)e.push(...t.getContainedSpaces());return e}get area(){return this.getContainedSpaces().filter(t=>t.geometry).reduce((t,n)=>t+zVt(n.geometry),0)}get perimeter(){return this.getContainedSpaces().filter(t=>t.geometry).reduce((t,n)=>t+jVt(n.geometry),0)}}function zVt(i){let e=0;const t=i.length;for(let n=0;n<t;n++){const o=(n+1)%t;e+=i[n].x*i[o].y,e-=i[o].x*i[n].y}return Math.abs(e)/2}function jVt(i){let e=0;const t=i.length;for(let n=0;n<t;n++){const o=(n+1)%t;e+=Math.sqrt(Math.pow(i[o].x-i[n].x,2)+Math.pow(i[o].y-i[n].y,2))}return e}class GVt extends yL{constructor(e,t,{structure:n,zones:o,systems:r,storeys:s}={}){var c,u;if(super(t),this._stateObjectMap=e,this.uuids=new Map,n){const d=Rq(n,this,e),h=p$e(d);this.structure=d,this.objects=h,h.forEach(f=>{f.uuid&&this.uuids.set(f.uuid,f)})}else this.structure=null,this.objects=[];this.zones=[],this.setZones(o??[]),r==null||r.forEach(d=>{const h=new GE(d,this,"system");this.uuids.set(h.uuid,h),e.set(h.id,h),this.objects.unshift(h)}),this.storeys=(s==null?void 0:s.map(d=>new HVt(d,this)).sort(Cu("order",!1)))??[];const a=new Map(this.storeys.map(d=>[d.uuid,new Set])),l=this.type==="DWG"?"layout":"storey";for(const d of this.objects)d.type!==l&&a.has((c=d[l])==null?void 0:c.uuid)&&a.get((u=d[l])==null?void 0:u.uuid).add(d);for(const d of this.storeys){const h=a.get(d.uuid);d.objects=h?[...h.values()]:[]}this.objects.forEach(d=>{var h,f;d.parent=this.uuids.get((h=d.parent)==null?void 0:h.uuid),d.children=(f=d.children)==null?void 0:f.map(A=>this.uuids.get(A.uuid)).filter(Boolean)})}setZones(e=[]){this.zones.forEach(t=>{this._stateObjectMap.delete(t.id),this.uuids.delete(t.uuid),this.objects.splice(this.objects.indexOf(t),1)}),this.zones=e.map(t=>{const n=new wL(t,this);return this._stateObjectMap.set(n.id,n),this.uuids.set(n.uuid,n),this.objects.unshift(n),n})}}const qVt=(i,e,t)=>{const{api:n}=t;async function o(r){if(typeof r=="string"&&(console.warn(`[State] 'loadModel' called with id ${r} as string and parsed as integer.`),r=parseInt(r)),i.get(r))return console.warn(`[State] 'loadModel' called with id ${r}}, model already loaded.`),i.get(r);const s=[n.apiClient.modelApi.getZones(n.cloudId,r,n.projectId),n.apiClient.modelApi.getSystems(n.cloudId,r,n.projectId),n.getStoreys(r)],a=await n.getModel(r);a.parent_id&&!i.get(a.parent_id)&&await o(a.parent_id),a.structure_file&&s.push(n.getModelStructure(a));const[l,c,u,d]=await Promise.all(s),h=new GVt(e,a,{structure:d,zones:l,systems:c,storeys:u});return await VVt(n,h.storeys,h.id),i.set(r,h),h}return{get models(){return Array.from(i.values())},get ifcs(){return console.warn("[BIMData Viewer] DEPRECATED - State model - please use the models instead of ifcs."),Array.from(i.values()).filter(r=>!r.type||r.type==="IFC")},get modelsMap(){return i},get ifcsMap(){return console.warn("[BIMData Viewer] DEPRECATED - State model - please use the modelsMap instead of ifcsMap."),new Map([...i].filter(([,r])=>!r.type||r.type==="IFC"))},async loadModels(r){const s=await Promise.allSettled(r.map(o));s.filter(l=>l.status==="rejected").forEach(l=>console.error(l.reason));const a=s.filter(l=>l.status==="fulfilled").map(l=>l.value);if(a.length>0){const l=a.filter(c=>!c.type||c.type==="IFC");l.length&&this.hub.emit("ifcs-loaded",{ifcs:l}),this.hub.emit("models-loaded",{models:a}),t.globalContext.hub.emit("models-loaded",{models:a}),this.hub.emit("objects-added",{objects:a.flatMap(c=>c.objects)})}return a},loadIfcs(r){return console.warn("[BIMData Viewer] DEPRECATED - State model - please use the loadModels method instead of loadIfcs."),this.loadModels(r)},unloadModels(r){const s=[],a=[];if(r.forEach(l=>{const c=i.get(l);c?(i.delete(l),c.objects.map(d=>(a.push(d),d.id)).forEach(d=>e.delete(d)),s.push(c)):console.warn(`[State] Cannot unload model with id ${l} because it is not loaded.`)}),a.length>0&&this.hub.emit("objects-removed",{objects:a}),s.length>0){const l=s.filter(c=>!c.type||c.type==="IFC");l.length&&this.hub.emit("ifcs-unloaded",{ifcs:l}),this.hub.emit("models-unloaded",{models:s})}return s},unloadIfcs(r){return console.warn("[BIMData Viewer] DEPRECATED - State model - please use the unloadModels method instead of unloadIfcs."),this.unloadModels(r)},getStoreyFromAbsoluteElevation(r,s){var a;if(!r.storeys)return null;for(let l=0;l<r.storeys.length;l++)if(s>=r.storeys[l].absoluteElevation&&s<(((a=r.storeys[l+1])==null?void 0:a.absoluteElevation)??1/0))return r.storeys[l];return r.storeys[0]}}};function QVt(i){return{async createPlan(e,t,n,o){const r=await i.api.createStoreyPlan(e.id,t.uuid,n.id);await i.api.updatePlanPositioning(e.id,t.uuid,r.id,o);const s=new Kpe({...o,plan:r},e,t,e.storeys.length);return t.plans.push(s),this.hub.emit("plan-created",{plan:s}),s},async updatePlan(e){const t=await i.api.updatePlanPositioning(e.model.id,e.storey.uuid,e.plan.id,e);return Object.assign(e,t),this.hub.emit("plan-updated",{plan:e}),e},async deletePlan(e){await i.api.deleteStoreyPlan(e.model.id,e.storey.uuid,e.plan.id),e.storey.plans=e.storey.plans.filter(t=>t.key!==e.key),this.hub.emit("plan-deleted",{plan:e})}}}const KVt=(i,e)=>{const t={getObjectsByUuids(n){return n.flatMap(o=>this.uuidsMap.get(o))},getObject(n){return console.warn("[BIMData Viewer] DEPRECATED - State - `getObject` is deprecated, use `objectsMap.get` instead."),e.get(n)},getIfc(n){return console.warn("[BIMData Viewer] DEPRECATED - State - `getIfc` is deprecated, use `modelsMap.get` instead."),i.get(n)},get colorizedObjects(){return Array.from(e.values()).filter(n=>!!n.color)},get colorizedObjectsIds(){return this.colorizedObjects.map(n=>n.id)},get colorizedObjectsUuids(){return Array.from(new Set(this.colorizedObjects.map(n=>n.uuid)))},getObjectsOfType(n){return Array.from(e.values()).filter(o=>o.type===n)},getTypesOf(n){typeof n.map>"u"&&(n=[...n]);const o=new Set;return n.forEach(r=>{const s=e.get(r);s&&s.type&&o.add(s.type)}),Array.from(o).sort()},getObjectsWithTheSameTypeAs(n){const o=this.getTypesOf(n);return[...e.values()].filter(r=>o.includes(r.type))}};return JVt.forEach(n=>{Object.defineProperty(t,n.name,{get(){return Array.from(e.values()).filter(o=>o[n.property]===n.value).map(o=>Object.freeze(Object.defineProperties({},Object.getOwnPropertyDescriptors(o))))}}),Object.defineProperty(t,`${n.name}Ids`,{get(){return this[n.name].map(ZVt)}}),Object.defineProperty(t,`${n.name}Uuids`,{get(){return Array.from(new Set(this[n.name].map(WVt)))}})}),t},JVt=[{name:"selectedObjects",property:"selected",value:!0},{name:"deselectedObjects",property:"selected",value:!1},{name:"highlightedObjects",property:"highlighted",value:!0},{name:"unhighlightedObjects",property:"highlighted",value:!1},{name:"visibleObjects",property:"visible",value:!0},{name:"unvisibleObjects",property:"visible",value:!1},{name:"xrayedObjects",property:"xrayed",value:!0},{name:"unxrayedObjects",property:"xrayed",value:!1},{name:"pickableObjects",property:"pickable",value:!0},{name:"unpickableObjects",property:"pickable",value:!1}];function ZVt(i){return i.id}function WVt(i){return i.uuid}function CL(i,e,t){var n;return(n=i.mixins)!=null&&n.some(o=>o[t])||(i.mixins?i.mixins[i.mixins.length]=e:i.mixins=[e]),i}const Jpe=Symbol("annotation-mixin-id");function XVt(){let i=0;const e=new Map;return{get annotations(){return Array.from(e.values())},addAnnotation({x:t=0,y:n=0,z:o=0,draggable:r=!0,grabberSelector:s,component:a={render(){}},props:l={}}={},c){const u=this,d=i++,h={get id(){return d},get x(){return t},set x(f){t=f,u.hub.emit("annotation-updated",{annotation:h})},get y(){return n},set y(f){n=f,u.hub.emit("annotation-updated",{annotation:h})},get z(){return o},set z(f){o=f,u.hub.emit("annotation-updated",{annotation:h})},draggable:r,grabberSelector:s,component:a,props:l};return CL(h.component,{[Jpe]:!0,inject:["$viewer"]},Jpe),e.set(d,h),this.hub.emit("annotation-added",{annotation:h,options:c}),h},removeAnnotation(t,n){return e.has(t.id)?(e.delete(t.id),this.hub.emit("annotation-removed",{annotation:t,options:n}),!0):!1},clearAnnotations(){e.forEach(t=>this.removeAnnotation(t))}}}function YVt(i){const e=new Map,t=new Map,n={uuidsMap:{get(o){const r=[];return e.forEach(s=>{const a=s.uuids.get(o);a&&r.push(a)}),r}},hub:new uu};return[qVt(e,t,i),OVt(t),QVt(i),XVt(),KVt(e,t)].forEach(o=>Object.defineProperties(n,Object.getOwnPropertyDescriptors(o))),n}function $Vt(i){if((i==null?void 0:i.type)==="container")nHt(i);else if((i==null?void 0:i.type)==="zone")iHt(i);else throw new TypeError("AREAS CORE - Layout first child must be a zone or a container.");return eHt(i),i}function eHt(i){const e=new Set,t=new Set;for(let n of i)if(n.id!=null)if(n.type==="zone"){if(e.has(n.id))throw new Error("AREAS CORE - Cannot add the same zone id twice.");e.add(n.id)}else{if(t.has(n.id))throw new Error("AREAS CORE - Cannot add the same container id twice.");t.add(n.id)}}function tHt(i){Zpe(i.layout,"zone",i.zoneIdManager),Zpe(i.layout,"container",i.containerIdManager)}function Zpe(i,e,t){const n=[...i].filter(r=>r.type===e);n.map(r=>r.id).filter(r=>r!=null).forEach(r=>t.add(r)),n.filter(r=>r.id===void 0||r.id===null).forEach(r=>{r.id=t.nextId()})}function iHt(i){if(typeof i!="object")throw new TypeError("AREAS CORE - Invalid zone. Zone must be an object.");if((i==null?void 0:i.type)!=="zone")throw new TypeError('AREAS CORE - Invalid zone. A zone must be of type "zone".');return i}function nHt(i){var e,t;if(typeof i!="object")throw new TypeError("AREAS CORE - Invalid container. A container must be an object.");if((i==null?void 0:i.type)!=="container")throw new TypeError('AREAS CORE - Invalid container. Container must be of type "container".');if(i!=null&&i.direction&&!["row","column"].includes(i.direction))throw new TypeError('AREAS CORE - Invalid container. Container direction must be of type "row" or "column".');if(((e=i==null?void 0:i.children)==null?void 0:e.length)<2)throw new TypeError("AREAS CORE - Invalid container. Container children must have at least 2 children.");if(((t=i==null?void 0:i.children)==null?void 0:t.reduce((n,o)=>n+(o==null?void 0:o.ratio),0))!==100)throw new TypeError("AREAS CORE - Invalid container. The sum of container children ratios must be equal to 100.");return i}function Wpe(i){var e;return(e=i.children)!=null&&e.length&&i.children.forEach(t=>{Object.defineProperty(t,Symbol.iterator,{value:Wpe(t),configurable:!0})}),function*(){var t;if(yield i,(t=i.children)!=null&&t.length)for(let n of i.children)yield*n}}function xm(i){return Object.defineProperty(i,Symbol.iterator,{value:Wpe(i),configurable:!0}),i}function Xpe(){let i=1;const e=new Set;return{nextId(){for(;!this.isIdAvailable(i);)i++;return e.add(i),i},isIdAvailable(n){return!e.has(n)},add(n){return this.isIdAvailable(n)?(e.add(n),n):!1}}}function Ype(i){var t;if(!i)return;const e=Object.assign({},i);return((t=i.children)==null?void 0:t.length)>0&&(e.children=i.children.map(Ype)),e}function oHt(i){return e=>{const t=i.getZone(e);if(!t)return!1;const n=i.getParent(t);if(!n)throw new Error("AREAS CORE - Cannot delete root Zone");const o=n.children.indexOf(t);if(n.children.length>2){const r=n.children[o-1],s=n.children[o+1];o===0?s.ratio+=t.ratio:o===n.children.length-1?r.ratio+=t.ratio:(r.ratio+=Math.floor(t.ratio/2),s.ratio+=Math.ceil(t.ratio/2)),n.children=n.children.filter(a=>a.type!=="zone"||a.id!==e)}else{const r=n.children[o===1?0:1];r.ratio=n.ratio;const s=i.getParent(n);if(s){const a=s.children.indexOf(n);s.children.splice(a,1,r)}else i.layout=r}return!0}}var sHt=oHt;function rHt(i){return()=>$pe(i.layout,[i.layout])}function $pe(i,e=[]){var t;return(t=i.children)==null||t.forEach(n=>{e.push(n),n.type==="container"&&$pe(n,e)}),e}var aHt=rHt;function lHt(i){return e=>{if(!e)throw new TypeError("AREAS CORE - fail to get parent: container child is null or undefined");return i.layout.type==="zone"?null:efe(i.layout,e)}}function efe(i,e){for(let t of i.children){if(t===e)return i;if(t.type==="container"){const n=efe(t,e);if(n)return n}}return null}var cHt=lHt;function uHt(i){return e=>i.layout.type==="zone"?i.layout.id===e?i.layout:null:tfe(i.layout,e)}function tfe(i,e){for(let t of i.children)if(t.type==="zone"){if(t.id===e)return t}else{const n=tfe(t,e);if(n)return n}return null}var dHt=uHt;function hHt(i){return(t,n)=>{if(typeof n!="number")throw new TypeError("AREAS CORE - resize value must be a number.");const o=i.getParent(t),r=o.children.findIndex(a=>a===t);if(r===-1)return!1;const s=o.children[r+1];if(s){const a=t.ratio+s.ratio;let l=t.ratio+n;return l=l<0?0:l,l=l>a?a:l,t.ratio=l,s.ratio=a-l,!0}else return!1}}var pHt=hHt;function fHt(i){return(e,t=50,n="row",o=!0,r=null)=>{const s=i.getZone(e);if(!s)throw new Error(`AREAS CORE - fail to split zone ${e}: zone does not exist.`);if(typeof t!="number"||t<0||t>100)throw new TypeError(`AREAS CORE - fail to split zone: invalid ratio ${t}, ratio should be a number between 0 and 100.`);if(n!=="row"&&n!=="column")throw new TypeError(`AREAS CORE - fail to split zone: invalid direction ${n}, direction should be 'row' or 'column'.`);const a=i.getParent(s),l=xm({id:i.zoneIdManager.nextId(),type:"zone",...r});if(a){const c=a.children.findIndex(u=>u===s);if(a.direction===n)o?(l.ratio=Math.floor(s.ratio*(100-t)/100),s.ratio=Math.ceil(s.ratio*t/100),a.children.splice(c,1,s,l)):(l.ratio=Math.floor(s.ratio*t/100),s.ratio=Math.ceil(s.ratio*(100-t)/100),a.children.splice(c,1,l,s));else{const u=xm({id:i.containerIdManager.nextId(),type:"container",direction:n,ratio:s.ratio});o?(l.ratio=Math.floor(100-t),s.ratio=Math.ceil(t),u.children=[s,l]):(l.ratio=Math.floor(t),s.ratio=Math.ceil(100-t),u.children=[l,s]),a.children.splice(c,1,u)}}else{const c=xm({id:i.containerIdManager.nextId(),type:"container",direction:n});o?(l.ratio=Math.floor(100-t),s.ratio=Math.ceil(t),c.children=[s,l]):(l.ratio=Math.floor(t),s.ratio=Math.ceil(100-t),c.children=[l,s]),i._layout=c}return l}}var AHt=fHt;function mHt(i){return(e=50,t="row",n=!0,o=null)=>{const r=i.layout;if(typeof e!="number"||e<0||e>100)throw new TypeError(`AREAS CORE - fail to split layout: invalid ratio ${e}, ratio should be a number between 0 and 100.`);if(t!=="row"&&t!=="column")throw new TypeError(`AREAS CORE - fail to split layout: invalid direction ${t}, direction should be 'row' or 'column'.`);const s=xm({id:i.zoneIdManager.nextId(),type:"zone",...o}),a=xm({id:i.containerIdManager.nextId(),type:"container",direction:t});return n?(s.ratio=Math.floor(100-e),r.ratio=Math.ceil(e),a.children=[r,s]):(s.ratio=Math.floor(e),r.ratio=Math.ceil(100-e),a.children=[s,r]),i._layout=a,s}}var gHt=mHt;function vHt(i){return(e,t)=>{const n=i.getZone(e),o=i.getZone(t);if(!n)throw new Error(`AREAS CORE - fail to swap zone ${e}: zone does not exist.`);if(!o)throw new Error(`AREAS CORE - fail to swap to zone ${t}: zone does not exist.`);const r=i.getParent(n),s=i.getParent(o),a=r.children.indexOf(n),l=s.children.indexOf(o),c=n.ratio,u=o.ratio;n.ratio=u,o.ratio=c,r.children[a]=o,s.children[l]=n}}var yHt=vHt;function wHt(i){const e={_layout:null,get layout(){return this._layout},set layout(t){t||(t={type:"zone"}),xm(t),$Vt(t),this._layout=t,tHt(e)},zoneIdManager:Xpe(),containerIdManager:Xpe()};return e.layout=i,e.deleteZone=sHt(e),e.getNodes=aHt(e),e.getParent=cHt(e),e.getZone=dHt(e),e.resize=pHt(e),e.splitZone=AHt(e),e.splitLayout=gHt(e),e.swapZones=yHt(e),e}var CHt=wHt;function ife(i=1,e=0,t=100){return Math.min(Math.max(e,i),t)}function nfe(i,e){const t=i.getParent(e);if(t){const{width:n,height:o}=nfe(i,t),r=t.children.length-1;return t.direction==="column"?{width:n,height:Math.max(0,(o-r*i.separatorSize)*(e.ratio/100))}:{width:Math.max(0,(n-r*i.separatorSize)*(e.ratio/100)),height:o}}else return{width:i.width,height:i.height}}function ofe(i,e,t){const{width:n,height:o}=nfe(i,e),r=e.children.length-1;if(e.direction==="column"){const s=1-r*i.separatorSize/o;return{height:`${ife(t.ratio*s,0,100)}%`,width:"100%"}}else{const s=1-r*i.separatorSize/n;return{height:"100%",width:`${ife(t.ratio*s,0,100)}%`}}}function bHt(i,e){const t={ref:i.contentManager.getRef(e.id),id:`zone-${e.id}`,class:"areas-zone",style:{flexGrow:0,overflow:"hidden"},key:e.id},n=i.getParent(e);if(n){const{width:o,height:r}=ofe(i,n,e);t.style={width:o,height:r}}else t.style={height:"100%"};return i.vue.h("div",t)}var bL=bHt;function xHt(i,e,t){const{separatorSize:n,separatorDetectionMargin:o,separatorDetectionZIndex:r}=i,s=e.direction==="column",a={ref:`separator-${e.id}-${t+1}`,class:"areas-separator",style:{[s?"height":"width"]:`${n}px`,backgroundColor:"var(--areas-separator-color, black)",flexShrink:0,position:"relative"}},l=s?"ns-resize":"ew-resize",c=i.vue.h("div",{style:{position:"absolute",[s?"height":"width"]:`${o*2}px`,[s?"width":"height"]:"100%",[s?"top":"left"]:`${-o+n/2}px`,zIndex:r,cursor:l},onMousedown:u=>MHt(i,e,t,u,l)});return i.vue.h("div",a,i.resizable?[c]:null)}function MHt(i,e,t,n,o){n.preventDefault(),n.stopPropagation(),document.body.style.cursor=o;const r=a=>EHt(i,e,t,a),s=()=>BHt(r,s);document.addEventListener("mousemove",r),document.addEventListener("mouseup",s)}function EHt(i,e,t,n){const o=e.children[t],r=e.direction==="column"?"height":"width",a=i.root.$refs[`separator-${e.id}-${t+1}`].getBoundingClientRect(),{separatorSize:l}=i,c=(e.direction==="column"?n.clientY-a.y:n.clientX-a.x)-l/2,u=i.root.$refs[`container-${e.id}`].getBoundingClientRect()[r],d=c/u*100;i.resize(o,d)}function BHt(i,e){document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",e),document.body.style.cursor=""}var SHt=xHt;function xL(i,e){const t={ref:`container-${e.id}`,id:`container-${e.id}`,class:"areas-container",style:{height:"100%",display:"flex",flexDirection:e.direction}},n=i.getParent(e);if(n){const{width:s,height:a}=ofe(i,n,e);t.style.width=s,t.style.height=a}const o=e.children.length-1,r=e.children.map((s,a)=>a<=o-1?[s.type==="zone"?bL(i,s):xL(i,s),SHt(i,e,a)]:s.type==="zone"?bL(i,s):xL(i,s));return i.vue.h("div",t,[r])}var IHt=xL;function PHt(i){const e=new Map,t=new Map,n=new Map;e.set("default",{component:{render(){return i.vue.h("div","Default component")}}});function o(s){return s&&!e.has(s)&&(console.warn(`[AREAS] Content with name ${s} is not registered, fallback to 'default'.`),s="default"),e.get(s)}return{registerContent(s,a){e.set(s,{name:s,component:a})},renderContent(s){return[...s].filter(a=>a.type==="zone").forEach(a=>{t.set(a.id,Object.assign({},o(a.content??"default"),{ref:i.vue.ref(null),options:{zoneId:a.id,...a.options,key:a.id},name:a.content??"default"}))}),i.vue.h("div",{style:{display:"none"}},[...t.values()].map(a=>i.vue.h(a.component,{...a.options,ref:a.ref})))},link(){[...n.entries()].forEach(([s,a])=>{const l=t.get(s);if(!l)return;const c=l.ref.value.$el,u=a.value;for(;u.lastChild;)u.removeChild(u.lastChild);u.appendChild(c)})},getElementZoneId(s){var a;for(const[l,c]of[...n.entries()])if((a=c.value)!=null&&a.contains(s))return l;return null},getRef(s){let a=n.get(s);return a||(a=i.vue.ref(null),n.set(s,a)),a},deleteZoneContent(s){t.delete(s),n.delete(s)},clean(){t.clear(),n.clear()}}}var THt=PHt;function kHt(i,e,t){const n=e.ref(0),o=e.ref(0),{separatorSize:r=2,separatorDetectionMargin:s=10,separatorDetectionZIndex:a=2,resizable:l=!0}=t??{},c=e.ref(!!l),u={vue:e,core:i,zones:e.ref([]),get resizable(){return c.value},set resizable(h){c.value=h},get width(){return n.value},get height(){return o.value},get separatorSize(){return r},get separatorDetectionMargin(){return s},get separatorDetectionZIndex(){return a},getParent(h){return this.core.getParent(h)},async coreLayoutSync(h=!1){this.layout&&(h?this.layout.value=this.core.layout:e.triggerRef(this.layout),await e.nextTick(),this.contentManager.link())},resize(h,f){this.core.resize(h,f),e.triggerRef(this.layout)},async split(h,f,A,p,m){const g=this.core.splitZone(h,f,A,p,m);return await this.coreLayoutSync(this.zones.value.length===1),g},async splitLayout(h,f,A,p){const m=this.core.splitLayout(h,f,A,p);return await this.coreLayoutSync(!0),m},async delete(h){let f=!1;const A=this.core.getZone(h);if(A){const m=this.core.getParent(A);f=(m==null?void 0:m.children.length)===2&&this.core.getParent(m)===null}this.contentManager.deleteZoneContent(h);const p=this.core.deleteZone(h);return await this.coreLayoutSync(f),p},async swap(h,f){const A=this.core.swapZones(h,f);return await this.coreLayoutSync(),A},destroy(){var h;(h=this.resizeObserver)==null||h.disconnect()},root:null,get component(){return this.layout=e.shallowRef(i.layout),e.watch(this.layout,h=>{this.zones.value=[...h].filter(f=>f.type==="zone")},{immediate:!0}),{created(){u.root=this},mounted(){const{width:h,height:f}=this.$el.getBoundingClientRect();n.value=h,o.value=f,u.resizeObserver=new ResizeObserver(A=>A.forEach(p=>{const{width:m,height:g}=p.target.getBoundingClientRect();n.value=m,o.value=g})),u.resizeObserver.observe(this.$el),u.contentManager.link()},render(){return e.h("div",{class:"areas-root"},[u.contentManager.renderContent(u.layout.value),d(u.layout.value)])}}}};u.contentManager=THt(u);function d(h){return h.type==="zone"?bL(u,h):IHt(u,h)}return u}var RHt=kHt;function DHt(i,e=null,t=null){const n=CHt(e),o=RHt(n,i,t);return Object.freeze({core:n,renderer:o,destroy(){o.destroy()},swap(s,a){return this.renderer.swap(s,a)},split(s,a,l,c,u){return this.renderer.split(s,a,l,c,u)},splitLayout(s,a,l,c){return this.renderer.splitLayout(s,a,l,c)},delete(s){return this.renderer.delete(s)},registerContent(s,a){this.renderer.contentManager.registerContent(s,a)},getElementZoneId(s){return this.renderer.contentManager.getElementZoneId(s)},get layout(){return Ype(this.core.layout)},set layout(s){this.core.layout=s,this.renderer.contentManager.clean(),this.renderer.coreLayoutSync(!0)},get component(){return this.renderer.component},get resizable(){return this.renderer.resizable},set resizable(s){this.renderer.resizable=s}})}var _Ht=DHt;function LHt(i){return Array.isArray(i==null?void 0:i.children)?rfe(i):sfe(i)}function sfe(i,e=100){return{type:"zone",ratio:e,options:typeof i=="string"?{windowName:i}:i}}function rfe(i,e=100){return{type:"container",ratio:e,direction:i.direction,children:i.children.map((t,n)=>Array.isArray(t==null?void 0:t.children)?rfe(t,i.ratios[n]):sfe(t,i.ratios[n]))}}function FHt(i,e,t=!0){return i.type==="zone"?afe(i,e,t):lfe(i,e,t)}function afe(i,e,t=!0){var r,s;const n=e.get(i.id);if(!n)throw new Error(`[Layout parser] Local context with id ${i.id} not found`);return{windowName:((r=n.window)==null?void 0:r.name)??null,windowState:{modelIds:n.loadedModelIds,viewpoint:(t||void 0)&&n.viewer&&n.getViewpoint(),storey:(s=n.selectedStorey)==null?void 0:s.key}}}function lfe(i,e,t=!0){return{direction:i.direction,ratios:i.children.map(n=>n.ratio),children:i.children.map(n=>n.type==="zone"?afe(n,e,t):lfe(n,e,t))}}const OHt={props:{text:{type:String,default:""}},emits:["close"]},UHt={class:"success-modal"},NHt={class:"success-modal__close"},VHt={class:"success-modal__title"},HHt={class:"success-modal__title--icon"},zHt={class:"success-modal__text"},jHt={class:"success-modal__button"};function GHt(i,e,t,n,o,r){const s=k("BIMDataIconClose"),a=k("BIMDataPieSpinner"),l=k("BIMDataIconSuccess"),c=k("BIMDataButton");return B(),O("div",UHt,[b("div",NHt,[D(a,{delay:5,onStop:e[1]||(e[1]=u=>i.$emit("close"))},{default:V(()=>[D(s,{class:"icon-close",size:"xxxs",onClick:e[0]||(e[0]=u=>i.$emit("close"))})]),_:1})]),b("div",VHt,[b("h2",null,K(i.$t("modal.success")),1),b("span",HHt,[D(l,{class:"fill-primary"})])]),b("div",zHt,K(t.text||i.$t("modal.success")),1),b("div",jHt,[D(c,{class:"bimdata-btn__fill bimdata-btn__fill--primary bimdata-btn__radius",onClick:e[2]||(e[2]=u=>i.$emit("close"))},{default:V(()=>[it(K(i.$t("modal.button")),1)]),_:1})])])}const qHt=z(OHt,[["render",GHt],["__scopeId","data-v-79d3a107"]]),cfe=Symbol("modal-mixin-id"),QHt={inject:["$viewer"],data(){return{modals:[]}},computed:{notBlocking(){var i;return((i=this.modal)==null?void 0:i.blocking)===!1},modal(){return this.modals.length?this.modals[0]:null},positionning(){var e;if(!((e=this.modal)!=null&&e.positions))return;const i=this.modal.positions;return{top:i.top?`${i.top}`:"0",right:i.right?`${i.right}`:"0",bottom:i.bottom?`${i.bottom} `:"0",left:i.left?`${i.left}`:"0"}}},created(){document.addEventListener("keydown",e=>{this.notBlocking&&e.key==="Escape"&&this.clearModal()});const i=this;this.mixin={[cfe]:!0,beforeCreate(){!this._.setupState.$viewer&&(this.$plugin=i.$plugin,this.$viewer=i.$viewer)}}},methods:{pushModal(i,e={},{display:t="full",positions:n,blocking:o=!0,exclusive:r=!1}={}){r&&(this.modals=[]),this.inject$viewerRecursively(i),this.modals.push({component:ra(i),props:e,display:t,positions:n,blocking:o})},clearModal(){this.modals.shift()},clearModals(){this.modals=[]},inject$viewerRecursively(i){CL(i,this.mixin,cfe),i.components&&Object.values(i.components).forEach(e=>this.inject$viewerRecursively(e))},getModal(i){const e={success:qHt};if(Object.keys(e).includes(i))return e[i];console.warn(`Modal name unknown : ${i}`)}}},KHt={class:"bimdata-modal-manager__content"};function JHt(i,e,t,n,o,r){const s=pi("click-away");return r.modal?(B(),O("div",{key:0,class:ue(["bimdata-modal-manager",{full:r.modal.display==="full",banner:r.modal.display==="banner"}]),style:ce(r.positionning),onClick:e[0]||(e[0]=pt(a=>r.notBlocking?r.clearModal():null,["self"]))},[ft((B(),O("div",KHt,[(B(),W(vn(r.modal.component),ds(r.modal.props,{onClose:r.clearModal}),null,16,["onClose"]))])),[[s,()=>r.notBlocking?r.clearModal():null,"mousedown"]])],6)):ne("",!0)}const ufe=z(QHt,[["render",JHt]]),ZHt={props:{plugin:{type:Object,required:!0}},setup(i){const e=mt("$viewer"),{plugin:t}=i;cn("$plugin",t),dfe(t.component,e.localContext,t)}},ML=Symbol("plugin-mixin-id");function dfe(i,e,t,n=!0){var s;if(!!((s=i.mixins)!=null&&s.some(a=>a[ML])))return;const r={[ML]:!0,beforeCreate(){!this._.setupState.$viewer&&(this.$plugin=t,this.$viewer=e.$viewer),Object.defineProperties(this,{$isOpen:{get(){return t.isOpen}},$loading:{get(){return t.loading}},$shown:{get(){return t.shown}}}),n&&(t.componentInstance=this,t.isViewer&&(e.viewer=this))},methods:{$open(...a){t.open(...a)},$close(...a){t.close(...a)},$show(){t.show()},$hide(){t.hide()}}};n&&(r.props={plugin:{type:Object,required:!0}},r.provide={pluginInstance:t},r.created=function(){e.hub.emit("plugin-created",{name:t.name,plugin:this}),e.$viewer.globalContext.hub.emit("plugin-created",{name:t.name,plugin:this})},r.unmounted=function(){e.hub.emit("plugin-destroyed",{name:t.name,plugin:this}),e.$viewer.globalContext.hub.emit("plugin-destroyed",{name:t.name,plugin:this})}),CL(i,r,ML),i.components&&Object.values(i.components).forEach(a=>dfe(a,e,t,!1))}function WHt(i,e,t,n,o,r){return ft((B(),W(vn(t.plugin.component),{class:"plugin-component-instance-container",plugin:t.plugin},null,8,["plugin"])),[[qt,t.plugin.shown]])}const v5=z(ZHt,[["render",WHt]]),XHt={components:{PluginComponentInstanceContainer:v5},props:{plugin:{type:Object,required:!0,validator(i){return i.sidePanel.width?typeof i.sidePanel.width=="number":i.sidePanel}}}};function YHt(i,e,t,n,o,r){const s=k("PluginComponentInstanceContainer");return ft((B(),O("div",{class:"side-panel",style:ce(`
5502
5502
  --side-panel-width: ${t.plugin.sidePanelWidth}px;
5503
5503
  ${t.plugin.sidePanel.position==="left"?"border-right":"border-left"}: 1px solid var(--color-silver);
5504
5504
  `)},[D(s,{plugin:t.plugin,style:{height:"100%"}},null,8,["plugin"])],4)),[[qt,t.plugin.shown]])}const $Ht=z(XHt,[["render",YHt],["__scopeId","data-v-ced3f116"]]),ezt={props:{name:{type:String,default:"box"},content:{type:String,default:""},width:{type:[Number,String],default:20},height:{type:[Number,String],default:20},color:{type:String,default:"currentColor"},x:{type:[Number,String],default:20},y:{type:[Number,String],default:20}},computed:{viewBox(){return`0 0 ${this.x} ${this.y}`}}},tzt=["width","height","viewBox","aria-labelledby","fill"],izt=["innerHTML"];function nzt(i,e,t,n,o,r){return B(),O("svg",{xmlns:"http://www.w3.org/2000/svg",width:t.width,height:t.height,viewBox:r.viewBox,"aria-labelledby":t.name,fill:t.color,role:"presentation"},[b("g",{innerHTML:t.content},null,8,izt)],8,tzt)}const ozt=z(ezt,[["render",nzt]]),szt=["src"],rzt={__name:"PluginIcon",props:{plugin:{type:Object,required:!0},isOpen:{type:Boolean,required:!0}},setup(i){const e=i,t=pn(null);return ja(()=>{e.isOpen&&e.plugin.button.iconOpen?t.value=e.plugin.button.iconOpen:e.plugin.button.icon?t.value=e.plugin.button.icon:t.value={component:"BIMDataIcon",options:{name:"default",size:"m"}}}),(n,o)=>t.value.imgUri?(B(),O("img",{key:0,src:t.value.imgUri,style:{"max-width":"40px","max-height":"40px"}},null,8,szt)):t.value.svgPath?(B(),W(ozt,ds({key:1},t.value.options,{content:t.value.svgPath}),null,16,["content"])):t.value.component?(B(),W(vn(t.value.component),kr(ds({key:2},t.value.options)),null,16)):ne("",!0)}},azt={key:0,class:"tools-menu__info"},lzt={class:"window"},czt={class:"plugins-as-button__content"},uzt={class:"plugins-as-button__panel__header"},dzt={class:"panel__content"},hzt={__name:"PluginAsButton",props:{plugin:{type:Object,required:!0},active:{type:Boolean,required:!0},position:{type:String,required:!0,validator(i){return["right","left"].includes(i)}}},emits:["focus"],setup(i,{emit:e}){const t=e;mt("$viewer");const n=i,{active:o}=Y5(n),r=n.plugin,s=$e(()=>r.isOpen),a=$e(()=>r.buttonText),l=$e(()=>n.active?2:1);function c(){s.value&&t("focus")}function u(){s.value?r.close():r.open()}function d(){En(()=>{s.value&&!r.button.keepOpen&&!r.loading&&r.close()})}return(h,f)=>{const A=k("BIMDataSpinner"),p=k("BIMDataButton"),m=k("BIMDataTooltip"),g=pi("click-away");return ft((B(),O("div",{class:"plugins-as-button",style:ce({zIndex:l.value,position:yt(r).button.content==="simple"?"relative":null})},[b("div",{class:"tools-menu m-b-12",onMouseenter:c},[D(m,{ref:"tooltip",class:ue({open:s.value}),text:yt(r).button.tooltip?h.$t(yt(r).button.tooltip):yt(r).name,position:i.position==="left"?"right":"left",disabled:s.value},{default:V(()=>[D(p,{width:"45px",height:"45px",fill:"",icon:"",color:"default",class:ue({focus:yt(o)}),"data-test":`plugin-${yt(r).name}`,onClick:f[0]||(f[0]=w=>u())},{default:V(()=>[a.value?(B(),O("span",azt,K(yt(JZe)(a.value,yt(r).button.truncateSize||4)),1)):ne("",!0),yt(r).loading?(B(),W(A,{key:1})):(B(),W(rzt,{key:2,plugin:yt(r),"is-open":s.value},null,8,["plugin","is-open"]))]),_:1},8,["class","data-test"])]),_:1},8,["class","text","position","disabled"])],32),b("div",lzt,[D(gi,{name:`slide-fade-${i.position}`},{default:V(()=>[ft(b("span",czt,[yt(r).button.content==="panel"?(B(),O("div",{key:0,class:ue(["plugins-as-button__submenu",`plugins-as-button__submenu--${i.position==="right"?"left":"right"}__panel`])},[b("div",uzt,K(yt(r).button.tooltip?h.$t(yt(r).button.tooltip):yt(r).name),1),b("div",dzt,[D(v5,{plugin:yt(r)},null,8,["plugin"])])],2)):(B(),W(v5,{key:1,class:ue(["plugins-as-button__submenu",`plugins-as-button__submenu--${i.position==="right"?"left":"right"}__${yt(r).button.content||"free"}`]),plugin:yt(r)},null,8,["class","plugin"]))],512),[[qt,s.value]])]),_:1},8,["name"])])],4)),[[g,d]])}}},pzt=z({__name:"SideColumn",props:{plugins:{type:Array,default:()=>[]},position:{type:String,required:!0,validator(i){return["right","left"].includes(i)}}},setup(i){const e=i,t=pn(null);return(n,o)=>(B(),O("div",{class:ue(["side-column",`side-column--${e.position}`])},[(B(!0),O(ct,null,St(e.plugins,r=>(B(),O(ct,{key:r.name},[r.button.content==="none"?(B(),W(v5,{key:0,plugin:r,onMouseenter:s=>t.value=r},null,8,["plugin","onMouseenter"])):ft((B(),W(hzt,{key:1,plugin:r,position:e.position,active:t.value===r,onFocus:s=>t.value=r},null,8,["plugin","position","active","onFocus"])),[[qt,r.shown]])],64))),128))],2))}},[["__scopeId","data-v-f11ec0c8"]]),fzt={},Azt={width:"23",height:"22",viewBox:"0 0 23 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function mzt(i,e){return B(),O("svg",Azt,e[0]||(e[0]=[b("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M-1.39472e-07 10.1037L3.19075 13.2944L6.3815 10.1037L4.25434 10.1037L4.25434 5.31755C4.25434 5.17754 4.30509 4.94384 4.42614 4.77572C4.47895 4.70237 4.54133 4.64599 4.62063 4.60508C4.69908 4.56461 4.83161 4.51987 5.05202 4.51987L11.1676 4.51987L11.1676 2.3927L5.05202 2.3927C3.96087 2.3927 3.17625 2.87117 2.69987 3.5328C2.26254 4.14021 2.12717 4.83714 2.12717 5.31755L2.12717 10.1037L-1.39472e-07 10.1037Z",fill:"currentColor"},null,-1),b("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M23 11.9657L19.8092 8.7749L16.6185 11.9657L18.7457 11.9657L18.7457 16.7518C18.7457 16.8918 18.6949 17.1255 18.5739 17.2936C18.521 17.367 18.4587 17.4233 18.3794 17.4643C18.3009 17.5047 18.1684 17.5495 17.948 17.5495L11.8324 17.5495L11.8324 19.6766L17.948 19.6766C19.0391 19.6766 19.8238 19.1982 20.3001 18.5365C20.7375 17.9291 20.8728 17.2322 20.8728 16.7518L20.8728 11.9657L23 11.9657Z",fill:"currentColor"},null,-1),b("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0 15.6879C0 14.9536 0.595228 14.3584 1.32948 14.3584H8.24277C8.97703 14.3584 9.57225 14.9536 9.57225 15.6879V19.9422C9.57225 20.6765 8.97703 21.2717 8.24277 21.2717H1.32948C0.595228 21.2717 0 20.6765 0 19.9422V15.6879ZM1.59538 15.9538V19.6763H7.97688V15.9538H1.59538Z",fill:"currentColor"},null,-1),b("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.2948 1.32948C13.2948 0.595229 13.89 0 14.6243 0H21.5376C22.2718 0 22.8671 0.595228 22.8671 1.32948V5.58382C22.8671 6.31807 22.2718 6.91329 21.5376 6.91329H14.6243C13.89 6.91329 13.2948 6.31807 13.2948 5.58382V1.32948ZM14.8902 1.59538V5.31792H21.2717V1.59538H14.8902Z",fill:"currentColor"},null,-1)]))}const gzt=z(fzt,[["render",mzt]]),vzt={props:{color:{type:String,default:"currentColor"},size:{type:Number,default:1}}},yzt=["width","height"],wzt=["fill"];function Czt(i,e,t,n,o,r){return B(),O("svg",{width:23*t.size,height:28*t.size,viewBox:"0 0 23 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[b("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.81498 1.39408C7.83109 1.39042 7.84845 1.38833 7.86714 1.38833H8.34975C8.73313 1.38833 9.04391 1.07754 9.04391 0.694167C9.04391 0.310789 8.73313 0 8.34975 0H7.86714C7.74418 0 7.62361 0.0138267 7.5072 0.0402917C7.18421 0.113723 6.96548 0.401367 6.96677 0.719361C6.64878 0.718068 6.36114 0.936792 6.28771 1.25978C6.26124 1.37619 6.24741 1.49677 6.24741 1.61972V2.10233C6.24741 2.48571 6.5582 2.7965 6.94158 2.7965C7.32496 2.7965 7.63575 2.48571 7.63575 2.10233V1.61972C7.63575 1.60103 7.63783 1.58368 7.64149 1.56756C7.65339 1.51525 7.65903 1.46297 7.65892 1.4115C7.71038 1.41162 7.76266 1.40597 7.81498 1.39408ZM10.7628 0C10.3794 0 10.0686 0.310789 10.0686 0.694167C10.0686 1.07754 10.3794 1.38833 10.7628 1.38833H11.728C12.1114 1.38833 12.4222 1.07754 12.4222 0.694167C12.4222 0.310789 12.1114 0 11.728 0H10.7628ZM14.1411 0C13.7577 0 13.4469 0.310789 13.4469 0.694167C13.4469 1.07754 13.7577 1.38833 14.1411 1.38833H15.1063C15.4897 1.38833 15.8005 1.07754 15.8005 0.694167C15.8005 0.310789 15.4897 0 15.1063 0H14.1411ZM17.5194 0C17.136 0 16.8252 0.310789 16.8252 0.694167C16.8252 1.07754 17.136 1.38833 17.5194 1.38833H18.4846C18.868 1.38833 19.1788 1.07754 19.1788 0.694167C19.1788 0.310789 18.868 0 18.4846 0H17.5194ZM20.8976 0C20.5143 0 20.2035 0.310789 20.2035 0.694167C20.2035 1.07754 20.5143 1.38833 20.8976 1.38833H21.3803C21.3989 1.38833 21.4163 1.39042 21.4324 1.39408C21.4847 1.40597 21.537 1.41162 21.5885 1.4115C21.5884 1.46297 21.594 1.51525 21.6059 1.56756C21.6096 1.58368 21.6116 1.60103 21.6116 1.61972V2.10233C21.6116 2.48571 21.9224 2.7965 22.3058 2.7965C22.6892 2.7965 23 2.48571 23 2.10233V1.61972C23 1.49677 22.9861 1.37619 22.9597 1.25978C22.8863 0.936791 22.5986 0.718068 22.2806 0.719361C22.2819 0.401367 22.0632 0.113723 21.7402 0.0402916C21.6238 0.0138267 21.5032 0 21.3803 0H20.8976ZM23 4.51539C23 4.13201 22.6892 3.82122 22.3058 3.82122C21.9224 3.82122 21.6116 4.13201 21.6116 4.51539V5.48061C21.6116 5.86399 21.9224 6.17478 22.3058 6.17478C22.6892 6.17478 23 5.86399 23 5.48061V4.51539ZM23 7.89367C23 7.51029 22.6892 7.1995 22.3058 7.1995C21.9224 7.1995 21.6116 7.51029 21.6116 7.89367V8.85889C21.6116 9.24227 21.9224 9.55306 22.3058 9.55306C22.6892 9.55306 23 9.24227 23 8.85889V7.89367ZM23 11.2719C23 10.8886 22.6892 10.5778 22.3058 10.5778C21.9224 10.5778 21.6116 10.8886 21.6116 11.2719V12.2372C21.6116 12.6205 21.9224 12.9313 22.3058 12.9313C22.6892 12.9313 23 12.6205 23 12.2372V11.2719ZM23 14.6502C23 14.2669 22.6892 13.9561 22.3058 13.9561C21.9224 13.9561 21.6116 14.2669 21.6116 14.6502V15.1328C21.6116 15.1515 21.6096 15.1689 21.6059 15.185C21.594 15.2373 21.5884 15.2896 21.5885 15.3411C21.537 15.3409 21.4847 15.3466 21.4324 15.3585C21.4163 15.3621 21.3989 15.3642 21.3803 15.3642H20.8976C20.5143 15.3642 20.2035 15.675 20.2035 16.0584C20.2035 16.4418 20.5143 16.7526 20.8976 16.7526H21.3803C21.5032 16.7526 21.6238 16.7387 21.7402 16.7123C22.0632 16.6388 22.2819 16.3512 22.2806 16.0332C22.5986 16.0345 22.8863 15.8158 22.9597 15.4928C22.9861 15.3764 23 15.2558 23 15.1328V14.6502ZM14.6474 13.9116C14.2294 13.4884 13.7764 13.3132 13.2767 13.5451C13.1394 13.6088 13.0164 13.7642 12.965 13.9976C12.9404 14.1092 12.9387 14.2154 12.952 14.2991C12.9615 14.3593 12.9761 14.3926 12.9832 14.4062L13.3718 14.7996C13.6232 15.0542 13.6207 15.4644 13.3661 15.7158C13.1116 15.9673 12.7014 15.9648 12.4499 15.7102L11.1619 14.4063C11.0696 14.3373 10.7782 14.256 10.4038 14.5402C10.265 14.6456 10.1892 14.8021 10.164 15.0159C10.146 15.1695 10.1586 15.3254 10.1806 15.4503L11.5483 16.8349C11.7998 17.0894 11.7973 17.4997 11.5427 17.7511C11.2881 18.0026 10.8779 18.0001 10.6265 17.7455L8.84977 15.9469C8.73834 15.8341 8.59086 15.7372 8.44955 15.7103C8.34989 15.6913 8.17941 15.6888 7.92486 15.922C7.40908 16.3944 7.60249 16.7531 7.61982 16.7853C7.62079 16.7871 7.62121 16.7879 7.62092 16.7876L8.36876 17.5446L8.36898 17.5449L9.63136 18.8228C9.88282 19.0774 9.8803 19.4876 9.62574 19.7391C9.37117 19.9905 8.96096 19.988 8.7095 19.7335L7.50459 18.5137C7.39104 18.4504 7.3071 18.431 7.25026 18.426C7.18448 18.4203 7.12354 18.4313 7.05978 18.4573C6.91636 18.5159 6.79333 18.6313 6.65652 18.7691C6.4611 19.004 6.42638 19.1929 6.43343 19.3189C6.44127 19.4591 6.50463 19.5852 6.59048 19.673L9.52673 22.586C9.77984 22.8371 9.78249 23.2456 9.53265 23.4999C9.2828 23.7543 8.87438 23.759 8.61876 23.5104L8.22865 23.1311V23.623C8.24763 24.1981 8.60657 24.7179 9.15357 25.1243C9.71443 25.541 10.3301 25.7301 10.6198 25.7301H14.6969C15.587 25.6238 16.1129 25.3237 16.2057 25.252C17.6012 24.1569 18.629 22.8236 18.9789 22.282C19.965 20.0757 18.9393 18.2565 18.341 17.6508L14.6474 13.9116ZM6.93288 21.8379V23.6327L6.93312 23.6505C6.96401 24.7762 7.65626 25.6261 8.38077 26.1644C9.09398 26.6943 9.97451 27.0259 10.6198 27.0259H14.7343C14.7585 27.0259 14.7826 27.0245 14.8067 27.0218C15.9128 26.8974 16.6893 26.5178 17.0025 26.2739L17.0044 26.2724C18.5682 25.0455 19.7067 23.557 20.0979 22.9372C20.1134 22.9127 20.1272 22.8871 20.1393 22.8607C21.4417 20.0111 20.126 17.614 19.2629 16.7402L17.6781 15.1359V6.01643C17.6781 4.8663 16.7457 3.93393 15.5956 3.93393H2.0825C0.932367 3.93393 0 4.8663 0 6.01643V19.5295C0 20.6797 0.932368 21.612 2.0825 21.612H6.70519L6.93288 21.8379ZM5.13682 19.2982H2.31389V6.24782H15.3642V12.8096C14.7425 12.2755 13.8096 11.8694 12.7314 12.3697C12.2925 12.5733 12.0053 12.926 11.8384 13.2984C11.1789 12.8743 10.2855 13.0031 9.62023 13.5082C9.24833 13.7906 9.04821 14.1549 8.94823 14.5061C8.86696 14.4778 8.7815 14.4544 8.69206 14.4374C8.15818 14.3357 7.58059 14.4801 7.04965 14.9664C6.21364 15.7322 6.13093 16.6828 6.43561 17.319C6.09639 17.4901 5.85345 17.7375 5.73648 17.8566L5.71719 17.8762C5.70638 17.8871 5.69596 17.8985 5.68595 17.9101C5.31058 18.3486 5.1343 18.8291 5.13682 19.2982Z",fill:t.color},null,8,wzt)],8,yzt)}const hfe=z(vzt,[["render",Czt]]),bzt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAYAAAA4qEECAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAkhSURBVHgB7Z3NbhvXFcfPvRTkWg5QdqW2aRAaTbMokHKUOpLQTahNYdMGTD2BqSewuuvO1BNYWnZl+QmkAIWoeqPRpoioGBrKbRAgATQGkiDJJgyQSIli3pNz5oMcUqT4oRnxXkk/QCA5M6Q4/7nzn3vOuXcIYBjW9N8LYCASDAPF2CMrl0uDYRgltPW3vMUP6vDGfTAMo4RWdfGAH4VQRTAMo4QWgL4/o7BMsw9jhA5sI+O9EJA2zT6METq0jRDT7MMYoRu2EWKYfRghdItthBhmH0YI3W4bISbZhxFCn7CNEIPsQ3uhO9pGiEH2ob3Q3WwjxBT7SFRoPq2t2UIGzkBX2wgxxD4SE9qaubuIhzcOEI8PsjP5g2GybidtA22lMAcIq41FhthHIkJbs/kiAj4GgWFLy1DWbc26dTs3wMc0bQOhhlBfrO6U517slrerlY0FpdQCrXB5tQn2kYjQiNCxhamUGKjl+baBtpBqan/nPyvRdS92N1eFwDmvdRtgH2OgKdbs7YzC+nK7wFGcDzddelh4573b2/j9r9hmbNAUAQlAO16UUj5pX/4KX1n/rzyrwiUkBQnwzZefOZNv/JGOosh5C9hjRf2f/6s8+wAuKUO36KPn7xYlitq1W8/Xu23DvvnT8cSvr40ffufYdg0uMUMJ/dPzv65B0L+lC5I9/u7eHCSM9V5QxhLwZrhMAlbpQug6uxsOaM7AQh/tWRmp5EF02c91NfXatBP7zlqz93J0QbwvUBYjXcVOuGRP3DtZCi6Q2jGw0LhnpY99oRs7Pi7Vb8SUE5s1eF21o4kSAjyEAREIS05lowSaMZx1fGSRbYhHHJUJxNL4LecpxAR36xDlFpxIJKFNwjugqPUyEjL05clOggtu67YOWdq8Tq07ke7dsHgiq9Rewya8iFAty4kfV7pdTL3+NsADgaJIu5OJrHIpYpzTRWxthD7ZkikiFLjQr1DB+9fAa+Uh6FDYPgUakEg/ehgmf/825UYg571AtVqtbM5/9flnffs+b/v1F5/+a/L1t24KIQKxxW8nX/8T0PJtGDGJZu+y03e/tabzpZ7bUhKKRC76r9AlkRdgSOTEtUVgLw+gU3aRWzuMmMSEpuzdQ/ZaFPCo57YoGr0LL1F0Bhx7vSYUNA8Up1Ejnz8qkhR6hVsnpzdP287POaMVvGk1jouXF8BEctZ8oRx1di+x7N3+TnmZHpZ7bafq8n1BfTbvOeIqxAQFL0+RAx3vBfX5R5zdG3nNkETOeU+oK8dJfYgJOjNsCs8bF1PKhWdhhGhQnBX+KS0w/nyFCIIb7+OFBSNEA6ExA8mhTcbQuBH/pqJtKYvxUqMo0/Da947p+WwtWzQHGNmZ/B5K2MOU2sKjib1OwxV4zIh1614ODEBLoRFTXG+0EFUJFS56vXIYexL2hf0DcXeLx4zwgRh23Mh5MrR1eDv9w0QBpaDM2c8rTuXZOsSAlSuk8eg4R2qv71c2l7xl0/deolBrwUAZ6h+n1vwgB7kL53L4HhwIO06LYeui/XssBAc/9e2zBFMDCR0VFw8pSyYpnUlBRlwityCahQWQiv4P55pe1TiSxDqJTAeiWinP8+q/zOZdymmU1NF1HnCzAjHBESZ9tu1HmRLoLLKHFb2n0B3F5b32EqzoColLECOcq8jO3LE5oZ+dzj9BgTVUlGsWyk2NiSoojiLZ8ZrBiAS5jRxdoog9zN7/cGOJrIltic+gHCJnGAcXvaPQp4vbBKm6Ut2JP7HOeWhKNHHatCj4n5LIQol5Z7fs8nrKCtYoAilaM3eoOAsuefnj4PvYkACcpOILc+vSwURvCN2vuM3/A6vkobGVsKIEX3b+z37lGz7eLbdEjVQ+m0MQW5QZfBx+P75wvtjdTCTvHFhIieqRpc5b9BZ9zJq+U0AhH/YlbuNzocYVZ0iYj7sMI+Adp57HlKqL+9T809ySkxI5JLCQInQbFN+gTXTqKMDEsT3mVMrr78zk6cyAAglYaLkIdYO3UYpbmwsjImgtsV34euGXynqJHEANkXM3dJatChKZe0KedbzY2eChWvy3QKLflyw4nC56Et0pnQnqmadsEIqLq1RM/qBdlxMXw75Fp9d4eJ0Di3m44FCprdSxNfcQN8qp3bueogtR4IgskX60JgSW0SzHDSBulL4Dlm6iX3QL8SxjSHGjDBWCt4sOh+M5en7hWjW15pxSqjSsuFHOnCYNRL+QeOWwmNA6Hx3CmTrun/JznpUVZ23xvLiqsJwTV0KfE1dCnxNXQp8TRlwMOxFcIDP8XKYgt/ffjZfR+qHz0b9t0AjthPb7rvJ9fi6l2u7exfJEzkTeRxGcCvMRLv3dBI3QTmgWmfK5peA5P9rR9ZTBLViz9wQVbdM8YcUUjPNoIcWi13JPn6WlHTqMvfNDW544Tx4rWqZGXBxGbh1UfF0nB7C8tGtKbfXxDhd8D86Ek4PwWN2EcVmDOmjLyFs0l4ggMhWiJyhsvm8HQmq5sSgln+Ar0cdBGh1aeHR1Z2PKu9GJd++N/rKA8vrY0/DGKMCtW3PP1mqeYQhPMgqEc0l4h75lY7gXAi7u75S9WqE/L1E+ak40amzExWM6ePJB2IPhg8h3roERoWXAghKXg9I+tdSWeyq5UmAjLRveGIX/eLgEHl1f82bSst+jPBCRZoSgbBgh2swzjPL1559uT/7h7TTpNNtciv4gmkr5k07v+cp1f/zdG2+9JKGLJ9eiu3+GKXVxoKV1hLA11FFmQWHf81v8cSqCa3yWV4Kiyo+YOPzHZb9fyBVXXBIGnYCpwzTk09A415EGnl7RS8Bw9H+9Lt4EjdFWaB4nTb2FGnfTuk3c927Lyff3AJXRvWCrdfZOKeENC+aJ+948laB1N+awhLflpLAcNEdroVM3xtcj04z5xicH2en8mt+K/eEHTJxzyJNC6340k525s9X5vkkh6FKSSatqSif0v1F3YB9dMcA2GO2FbrOPE5hgG4z2Qnu9D6G65KvRNWV4mBk/D9LNPgyxDcYIobvZhym2wRghdGf7MMc2GHN+lKzdPgyyDcYYodvtwyTbYIwRutU+zLINxqyfQg3twzDbYIwSOrQP02zDSPjWEmAg5g1ypEIrGMgvJG+j0Idlmd0AAAAASUVORK5CYII=",EL=document.createElement("img");EL.src=bzt,EL.style.cursor="grabbing";function xzt({dataTransferType:i="areas_zone-id",getData:e=()=>null,onDropCB:t=()=>{}}={}){const n=we(!1),o=we(!1);function r(d){d.dataTransfer.types.includes(i)&&(d.preventDefault(),d.dataTransfer.dropEffect="move")}function s(){o.value=!1}function a(d){n.value=!0,d.dataTransfer.setData(i,e()),d.dataTransfer.effectAllowed="move",d.dataTransfer.setDragImage(EL,45,45)}function l(){n.value=!1}function c(d){o.value=!1;const h=parseInt(d.dataTransfer.getData(i),10);t==null||t(h)}function u(d){d.dataTransfer.types.includes(i)&&(o.value=!0)}return{dragging:n,dragover:o,onDragOver:r,onDragLeave:s,onDragStart:a,onDragEnd:l,onDrop:c,onDragEnter:u}}const Mzt=["draggable"],Ezt={class:"layout-settings__header"},Bzt={key:0,class:"layout-settings__swap"},Szt={key:1,class:"layout-settings__split"},Izt={class:"layout-settings__split__text"},Pzt={class:"layout-settings__split__text"},Tzt={key:2,class:"layout-settings__buttons"},kzt={__name:"LayoutSettings",setup(i){const e=mt("$viewer"),{localContext:t}=e,n=$e(()=>t.window),o=$e(()=>e.globalContext.localContexts.length>1),r=$e(()=>e.layout.settings.swap),s=$e(()=>e.layout.settings.full);function a(){e.layout.settings.swap=!e.layout.settings.swap}function l(){t.loadWindow(null),e.layout.settings.edit=!1}function c(){t.close()}function u(M="row"){e.globalContext.open({localContextId:t.id,ratio:50,direction:M})}function d(){u(),e.layout.settings.edit=!1}function h(){u("column"),e.layout.settings.edit=!1}wt(()=>e.globalContext.localContexts.length,M=>{var E;M===1&&e.layout.settings.edit&&((E=e.globalContext.localContexts[0].window)==null?void 0:E.header)===!1&&(e.layout.settings.edit=!1)});const{dragging:f,dragover:A,onDragOver:p,onDragLeave:m,onDragStart:g,onDragEnd:w,onDrop:y,onDragEnter:v}=xzt({getData:()=>String(t.id),onDropCB:M=>{Number.isNaN(M)||e.globalContext.swap(M,t.id)}}),x=$e(()=>e.layout.settings.swap);return(M,E)=>{const S=k("BIMDataIconWindowRight"),T=k("BIMDataButton"),P=k("BIMDataIconWindowBottom"),I=k("BIMDataIconDelete"),R=k("BIMDataTooltip");return B(),O("div",{class:ue(["layout-settings",{"layout-settings--swap":r.value,"layout-settings--dragging":yt(f),"layout-settings--dragover":yt(A)}]),draggable:x.value,onDragover:E[0]||(E[0]=(...L)=>yt(p)&&yt(p)(...L)),onDragleave:E[1]||(E[1]=(...L)=>yt(m)&&yt(m)(...L)),onDragenter:E[2]||(E[2]=(...L)=>yt(v)&&yt(v)(...L)),onDragstart:E[3]||(E[3]=pt((...L)=>yt(g)&&yt(g)(...L),["self"])),onDrop:E[4]||(E[4]=(...L)=>yt(y)&&yt(y)(...L)),onDragend:E[5]||(E[5]=(...L)=>yt(w)&&yt(w)(...L))},[b("div",Ezt,K(M.$t(r.value?"window-manager.swap":"window-manager.description"))+". ",1),r.value?(B(),O("div",Bzt,[D(hfe,{color:"#ffffff",size:2})])):(B(),O("div",Szt,[D(T,{color:"default",fill:"",square:"",icon:"",height:"50px",style:{padding:"var(--spacing-unit)"},onClick:d},{default:V(()=>[D(S),b("span",Izt,K(M.$t("window-manager.vertical")),1)]),_:1}),D(T,{color:"default",fill:"",square:"",icon:"",height:"50px",style:{padding:"var(--spacing-unit)"},onClick:h},{default:V(()=>[D(P),b("span",Pzt,K(M.$t("window-manager.horizontal")),1)]),_:1})])),s.value?(B(),O("div",Tzt,[o.value?(B(),W(R,{key:0,text:M.$t("window-manager.delete"),position:"left"},{default:V(()=>[D(T,{disabled:r.value,fill:"",square:"",icon:"",color:"default",width:"50px",height:"50px",onClick:c},{default:V(()=>[D(I,{fill:"",color:"high"})]),_:1},8,["disabled"])]),_:1},8,["text"])):ne("",!0),o.value?(B(),W(R,{key:1,text:M.$t("window-manager.swap_tooltip"),position:"left"},{default:V(()=>[D(T,{fill:"",square:"",icon:"",color:r.value?"secondary":"default",width:"50px",height:"50px",onClick:a},{default:V(()=>[D(hfe)]),_:1},8,["color"])]),_:1},8,["text"])):ne("",!0),n.value?(B(),W(R,{key:2,text:M.$t("window-manager.change"),position:"left"},{default:V(()=>[D(T,{disabled:r.value,fill:"",square:"",icon:"",color:"default",width:"50px",height:"50px",onClick:l},{default:V(()=>[D(gzt)]),_:1},8,["disabled"])]),_:1},8,["text"])):ne("",!0)])):ne("",!0)],42,Mzt)}}};function Rzt(i,e=()=>{}){const t=we(0),n=we(0),o=we(0),r=we(0),s=l=>{l.forEach(c=>{const{width:u,height:d,x:h,y:f}=c.target.getBoundingClientRect();t.value=u,n.value=d,o.value=h,r.value=f,e==null||e({width:t.value,height:n.value,x:o.value,y:r.value})})},a=new ResizeObserver(s);return Ti(()=>{a.observe(i.value)}),ln(()=>a.disconnect()),{width:t,height:n,x:o,y:r}}class Dzt extends tH{constructor(e){super(e);const{width:t,height:n,x:o,y:r}=Rzt(this.templateRef,s=>this.hub.emit("context-resize",s));this._resolution=we(1),this._width=t,this._height=n,this._x=o,this._y=r}get width(){return this._width.value}get height(){return this._height.value}get x(){return this._x.value}get y(){return this._y.value}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}}class _zt extends Dzt{constructor(e){super(e),this.viewer=null,this._annotationMode=we(!1)}get annotationMode(){return this._annotationMode.value}async getSnapshot(){if(!this.viewer)throw new Error("[localContext.getSnapshot] Error: no viewer registered in this localContext.");await this.hideUI();const e=await this.viewer.getSnapshot();return await this.showUI(),e}getViewpoint(e){if(!this.viewer)throw new Error("[localContext.getViewpoint] Error: no viewer registered in this localContext.");return this.viewer.getViewpoint(e)}setViewpoint(e,t){if(!this.viewer)throw new Error("[localContext.setViewpoint] Error: no viewer registered in this localContext.");this.viewer.setViewpoint(e,t)}startAnnotationMode(e){if(!this.viewer)throw new Error("[localContext.startAnnotationMode] Error: no viewer registered in this localContext.");if(!this.annotationMode)return this._annotationMode.value=!0,this.viewer.startAnnotationMode(e)}stopAnnotationMode(){if(!this.viewer)throw new Error("[localContext.stopAnnotationMode] Error: no viewer registered in this localContext.");this._annotationMode.value=!1,this.viewer.stopAnnotationMode()}fitView(e){if(!this.viewer)throw new Error("[localContext.fitView] Error: no viewer registered in this localContext.");this.viewer.fitView(e)}async showUI(){if(!this.viewer)throw new Error("[localContext.showUI] Error: no viewer registered in this localContext.");this.pluginComponentInstances.forEach(e=>e.$show()),this.viewer.showUI(),await En()}async hideUI({exceptions:e=[]}={}){if(!this.viewer)throw new Error("[localContext.hideUI] Error: no viewer registered in this localContext.");e.push(this.viewer.$plugin.name),[...this.pluginComponentInstances.entries()].filter(([t])=>!e.includes(t)).forEach(([,t])=>t.$hide()),this.viewer.hideUI(),await En()}}class Lzt extends _zt{constructor(e){super(e),this.modelTypes=null,this.multiModel=!0,this._loadedModels=pn([]),this._loadingModelIds=we([]),this._selectedStorey=pn(null),this._shownPlans=pn([]),this._loadedModelIds=$e(()=>this._loadedModels.value.map(t=>t.id)),this._automaticFirstModelsLoading=!1,this._globalContextSubscription=null,ln(()=>{e.globalContext.hub.off(this._globalContextSubscription)})}get loadedModels(){return this._loadedModels.value}get loadingModelIds(){return this._loadingModelIds.value}get loadedModelIds(){return this._loadedModelIds.value}get selectedStorey(){return this._selectedStorey.value}async loadModels(e,t={}){var a;const n=this._$viewer;if(!Array.isArray(e))throw new Error("[BIMDataViewer - Local State] loadModels requires an array of model ids.");this.multiModel||(e.length>1&&(e=[e[0]]),this.loadedModels.length>0&&this.unloadModels(this.loadedModelIds)),this.loadingModelIds.push(...e),this.hub.emit("models-loading",{ids:e});const o=[],r=[];for(const l of e)this.loadedModelIds.includes(l)||(n.state.modelsMap.has(l)?o.push(n.state.modelsMap.get(l)):r.push(l));o.push(...await n.state.loadModels(r)),this._loadingModelIds.value=this.loadingModelIds.filter(l=>!e.includes(l));const s=o.filter(l=>{var c;return((c=this.modelTypes)==null?void 0:c.includes(l.type))??!0});if(s.forEach(l=>{l.status!=="C"&&console.warn(`[BIMDataViewer - Local State] Model with id ${l.id} has an uncompleted status, loading may fail`)}),s.length!==0&&(this._loadedModels.value=[...this.loadedModels,...s],await((a=this.viewer)==null?void 0:a.loadModels(s)),this.hub.emit("models-loaded",{models:s}),n.globalContext.hub.emit("models-loaded",{models:s,emitter:this})),t!=null&&t.viewpoint&&this.viewer&&this.setViewpoint(t.viewpoint),t!=null&&t.storey){const l=s.flatMap(c=>c.storeys).find(c=>c.key===t.storey);l&&this.selectStorey(l)}return s}unloadModels(e){var r;const{loadedModels:t,$viewer:n}=this;if(!Array.isArray(e))throw new Error("[BIMDataViewer - Local State] unloadModels requires an array of ids.");const o=e.map(s=>n.state.modelsMap.get(s)).filter(Boolean);return o.length===0?!1:(this._loadedModels.value=t.filter(s=>!o.includes(s)),(r=this.viewer)==null||r.unloadModels(o),this.selectedStorey&&o.some(s=>s.storeys.some(a=>a.key===this.selectedStorey.key))&&this.selectStorey(null),this.hub.emit("models-unloaded",{models:o}),n.globalContext.hub.emit("models-unloaded",{models:o,emitter:this}),o)}get automaticFirstModelsLoading(){return this._automaticFirstModelsLoading}set automaticFirstModelsLoading(e){this._automaticFirstModelsLoading=e,e?this._onAutomaticFirstModelsLoading():this._$viewer.globalContext.hub.off(this._globalContextSubscription)}async _onAutomaticFirstModelsLoading(){const{_loadedModels:e,_loadingModelIds:t,$viewer:n}=this,o=n.globalContext.loadedModels.filter(a=>{var l;return((l=this.modelTypes)==null?void 0:l.includes(a.type))??!0});o.length>0&&this.loadModels(o.map(a=>a.id)),n.globalContext.hub.off(this._globalContextSubscription);const r=a=>{a=a.filter(l=>{var c;return((c=this.modelTypes)==null?void 0:c.includes(l.type))??!0}),a.length>0&&e.value.length===0&&t.value.length===0&&this.loadModels(a.map(l=>l.id))};await En();let s=!0;this._globalContextSubscription=n.globalContext.hub.on("models-loaded",({models:a,emitter:l})=>{!s&&l===this||r(a)},{getLastEvent:!0}),s=!1}selectStorey(e,t=!0){this._selectedStorey.value=e,this.shownPlans.length>0&&this.shownPlans.forEach(n=>this.hidePlan(n)),t&&(e==null?void 0:e.plans.length)>0&&e.plans.forEach(n=>this.showPlan(n)),this.hub.emit("storey-selected",{storey:e})}get shownPlans(){return this._shownPlans.value}showPlan(e){return this._shownPlans.value.some(t=>t.key===e.key)?!1:(this._shownPlans.value=[...this._shownPlans.value,e],this.hub.emit("plan-shown",{plan:e}),!0)}hidePlan(e){return this._shownPlans.value.some(t=>t.key===e.key)?(this._shownPlans.value=this._shownPlans.value.filter(t=>t.key!==e.key),this.hub.emit("plan-hidden",{plan:e}),!0):!1}}class Fzt extends Lzt{constructor(e,t){super(e),this.id=t,this._window=pn(null),this.pluginInstances=new Map,ln(()=>{this.unloadWindow()})}get $viewer(){const e=this;return new Proxy(this._$viewer,{get(t,n,o){return n==="localContext"?e:Reflect.get(t,n,o)}})}get pluginComponentInstances(){return new Map([...this.pluginInstances.values()].filter(e=>e.componentInstance).map(e=>[e.name,e.componentInstance]))}get plugins(){return this.pluginComponentInstances}get window(){return this._window.value}unloadWindow(){if(!this.window)return!1;const e=this.window,t=this.window.name;return this.pluginInstances.clear(),this._window.value=null,this.loadedModelIds.length>0&&this.unloadModels(this.loadedModelIds),this.automaticFirstModelsLoading=!1,this._$viewer.globalContext.hub.emit("window-close",{window:e,name:t,localContext:this}),!0}async loadWindow(e=null,t=null){const n=!!this.window;if(this.unloadWindow(),e===null)return null;if(n&&await En(),!this.$viewer.windowManager.registeredWindows.has(e)){const l=`Cannot load window with name "${e}" because it is not registered.`;return console.warn(l),null}this._window.value=this.$viewer.windowManager.registeredWindows.get(e);const o=Array.from(this.window.plugins??[]);this.pluginInstances.clear(),o.map(l=>this.$viewer.pluginManager.getPluginInstance(l,this)).filter(Boolean).sort(({button:{stance:l=0}={}},{button:{stance:c=0}={}})=>l-c).forEach(l=>this.pluginInstances.set(l.name,l)),this.modelTypes=Array.isArray(this.window.modelTypes)?this.window.modelTypes:null,this.multiModel=this.window.multiModel??!0,this._loadedModels.value=[],this._loadingModelIds.value=[];const{modelIds:r,viewpoint:s,storey:a}=t??{};return this.window.noModel!==!0&&((r==null?void 0:r.length)>0?(this.automaticFirstModelsLoading=!1,this.loadModels(r,{viewpoint:s,storey:a})):this.automaticFirstModelsLoading=!0),this._$viewer.globalContext.hub.emit("window-open",{window:this.window,name:this.window.name,localContext:this}),this.window}close(){return this._$viewer.globalContext.close(this.id)}getPlugin(e){return console.warn("[BIMData Viewer] DEPRECATED - Ambigous name. Do not use localContext.getPlugin(name), use the localContext.pluginComponentInstances Map instead."),this.pluginComponentInstances.get(e)}}const Ozt={name:"WindowContainer",components:{PluginComponentInstanceContainer:v5,LayoutSettings:kzt,SidePanel:$Ht,SideColumn:pzt,ModalManager:ufe},inject:["$viewer"],props:{windowName:{type:String,default:null},windowState:{type:Object,default:null},zoneId:{type:Number,required:!0}},setup(i){const e=mt("$viewer"),{globalContext:t}=e,n=new Fzt(e,i.zoneId);cn("$viewer",n.$viewer);const{templateRef:o}=n,r=()=>{o.value&&(o.value.scrollTop=0,o.value.scrollLeft=0)};Ti(()=>{o.value.addEventListener("scroll",r,{passive:!0})});const s=()=>{t.activeLocalContext=n},a=()=>{t.activeLocalContext===n&&(t.activeLocalContext=null)},l=$e(()=>{var m;const u=[];let d=null,h=null;const f=[],A=[],p=[];return n.window?p.push(...n.pluginInstances.values()):((m=e.windowManager.defaultWindow)==null?void 0:m.plugins.length)>0&&p.push(...e.windowManager.defaultWindow.plugins.map(g=>e.pluginManager.getPluginInstance(g,this)).filter(Boolean).sort(({button:{stance:g=0}={}},{button:{stance:w=0}={}})=>g-w)),p.forEach(g=>{!g.button&&!g.sidePanel?g.isViewer?u.unshift(g):u.push(g):g.sidePanel?g.sidePanel.position==="left"?(d&&console.warn(`[BIMDataViewer - WindowContainer] Window ${n.window.name}, Multiple left side panels are not supported. Only the last one will be displayed.`),d=g):g.sidePanel.position==="right"&&(h&&console.warn(`[BIMDataViewer - WindowContainer] Window ${n.window.name}, Multiple right side panels are not supported. Only the last one will be displayed.`),h=g):g.button.position==="left"?f.push(g):g.button.position==="right"&&A.push(g)}),u.reverse(),{free:u,leftSidePanel:d,rightSidePanel:h,leftButtonColumn:f,rightButtonColumn:A}});n.loadWindow(i.windowName,i.windowState);const c=$e(()=>{const u=l.value.leftSidePanel,d=u!=null&&u.shown?u.sidePanel.width:0,h=l.value.rightSidePanel,f=h!=null&&h.shown?h.sidePanel.width:0;return n.width-d-f});return{onMouseEnter:s,onMouseLeave:a,templateRef:o,modalManagerTemplateRef:n.modalManagerTemplateRef,windowPlugins:l,layoutSettingsDisplayed:$e(()=>e.layout.settings.edit),spinner:$e(()=>n.spinner),loading:$e(()=>n.loading),width:$e(()=>n.width),height:$e(()=>n.height),resolution:$e(()=>n.resolution),localContext:n,centerWidth:c}},created(){this.$viewer.windowManager.windowContainers.push(this)},unmounted(){const i=this.$viewer.windowManager.windowContainers.indexOf(this);i!==-1&&this.$viewer.windowManager.windowContainers.splice(i,1)}},Uzt={class:"window-container__content"},Nzt={class:"window-container__content__center"},Vzt={key:0,class:"global-spinner",style:{"z-index":"2"}},Hzt={key:1,class:"window-container__layout-settings",style:{"z-index":"5"}};function zzt(i,e,t,n,o,r){const s=k("ModalManager"),a=k("SidePanel"),l=k("PluginComponentInstanceContainer"),c=k("SideColumn"),u=k("BIMDataSpinner"),d=k("LayoutSettings");return B(),O("div",{ref:"templateRef",class:"window-container",style:ce(`
@@ -5506,5 +5506,5 @@ void main() {
5506
5506
  --bimdata-local-context-width: ${n.width}px;
5507
5507
  --bimdata-local-context-center-width: ${n.centerWidth}px;
5508
5508
  --bimdata-local-context-resolution: ${n.resolution};
5509
- `),onMouseenter:e[0]||(e[0]=(...h)=>n.onMouseEnter&&n.onMouseEnter(...h)),onMouseleave:e[1]||(e[1]=(...h)=>n.onMouseLeave&&n.onMouseLeave(...h))},[D(s,{ref:"modalManagerTemplateRef"},null,512),b("div",Uzt,[n.windowPlugins.leftSidePanel?(B(),W(a,{key:0,plugin:n.windowPlugins.leftSidePanel},null,8,["plugin"])):ne("",!0),b("div",Nzt,[(B(!0),O(ct,null,St(n.windowPlugins.free,h=>(B(),W(l,{key:h.name,class:ue({"window-container__content__center__viewer":h.isViewer}),plugin:h},null,8,["class","plugin"]))),128)),D(c,{position:"left",plugins:n.windowPlugins.leftButtonColumn},null,8,["plugins"]),D(c,{position:"right",plugins:n.windowPlugins.rightButtonColumn},null,8,["plugins"])]),n.windowPlugins.rightSidePanel?(B(),W(a,{key:1,plugin:n.windowPlugins.rightSidePanel},null,8,["plugin"])):ne("",!0)]),n.loading?(B(),O("div",Vzt,[n.spinner&&n.spinner.component?(B(),W(vn(n.spinner.component),kr(ds({key:0},n.spinner.props)),null,16)):(B(),W(u,{key:1,size:"20px",border:"3px"}))])):ne("",!0),n.layoutSettingsDisplayed?(B(),O("div",Hzt,[D(d)])):ne("",!0)],36)}const jzt=z(Ozt,[["render",zzt]]);class Gzt{constructor(e=!0){const t=_Ht(FV,null,{resizable:e});t.registerContent("default",jzt),this.settings=Ls({edit:!1,swap:!1,full:!1}),this.areas=t}get resizable(){return this.areas.resizable}set resizable(e){this.areas.resizable=e}apply(e=null){this.areas.layout=e?LHt(e):null}copy(e,t=!0){return FHt(this.areas.layout,e,t)}open({ratio:e,direction:t,insertAfter:n,windowName:o=null,windowState:r=null,localContextId:s=null}={}){const a=o?{options:{windowName:o,windowState:r}}:null;return s===null?this.areas.splitLayout(e,t,n,a):this.areas.split(s,e,t,n,a)}swap(e,t){return this.areas.swap(e,t)}close(e){return this.areas.delete(e)}compare(e,t){var n,o;if(!e&&!t)return!0;if(!e||!t)return!1;if(typeof e=="string"&&typeof t=="string")return e===t;if(typeof e=="string"||typeof t=="string")return!1;if(e.windowName&&t.windowName){if(e.windowName!==t.windowName)return!1;const r=new Set((n=e.windowState)==null?void 0:n.modelIds),s=new Set((o=t.windowState)==null?void 0:o.modelIds);return r.size===s.size&&[...r].every(l=>s.has(l))}return e.windowName||t.windowName||e.direction!==t.direction||e.children.length!==t.children.length?!1:e.children.every((r,s)=>this.compare(r,t.children[s]))}}const qzt={name:"@bimdata/viewer",type:"module",version:"2.7.0-beta.5",description:"A customizable BIM viewer.",keywords:["bim","viewer","bimdata","ifc","bcf"],types:"./index.d.ts",author:"BIMData.io",homepage:"https://developers.bimdata.io/viewer/index.html",bugs:{email:"support@bimdata.io"},browserslist:["last 2 chrome version","last 2 firefox version"],main:"dist/bimdata-viewer.esm.min.js",module:"dist/bimdata-viewer.esm.min.js",scripts:{dev:"vite -c build/vite.config.dev.js",build:"node scripts/build.mjs","build:prod":"vite build -c build/vite.config.prod.js && esbuild dist/bimdata-viewer.esm.min.js --minify --outfile=dist/bimdata-viewer.esm.min.js --allow-overwrite","build:offline":"vite build -c build/vite.config.offline.js && esbuild dist/bimdata-viewer.offline.esm.min.js --minify --outfile=dist/bimdata-viewer.offline.esm.min.js --allow-overwrite","build:runtime":"vite build -c build/vite.config.runtime.js && esbuild dist/bimdata-viewer.runtime.esm.min.js --minify --outfile=dist/bimdata-viewer.runtime.esm.min.js --allow-overwrite","build:split":"vite build -c build/vite.config.split.js && esbuild dist/bimdata-viewer.split.esm.min.js --minify --outfile=dist/bimdata-viewer.split.esm.min.js --allow-overwrite","build:umd":"vite build -c build/vite.config.umd.js && esbuild dist/bimdata-viewer.umd.cjs --minify --outfile=dist/bimdata-viewer.umd.min.cjs","cy:run":"cypress run","cy:open":"cypress open",prebuild:"rm -rf dist",prepublishOnly:"npm run build","semantic-release":"semantic-release",serve:"http-server -c-1 --silent",test:"npm run test:unit & npm run build & npm run test:e2e","test:unit":"jest","test:e2e":"start-server-and-test 'npm run serve -- -p 8080' http://localhost:8080 cy:run","test:e2e-dev":"start-server-and-test 'npm run serve -- -p 8080' http://localhost:8080 cy:open",version:"echo $npm_package_version",ts:"tsc"},files:["dist/*","types/*","CHANGELOG.md","README.md","package.json","package-lock.json","index.d.ts"],devDependencies:{"@babel/preset-env":"^7.26.0","@bimdata/2d-engine":"2.6.1","@bimdata/areas-next":"0.1.15","@bimdata/bcf-components":"6.4.4","@bimdata/components":"1.7.2","@bimdata/design-system":"2.2.1-beta.7","@bimdata/typescript-fetch-api-client":"10.17.2","@eslint/eslintrc":"^3.2.0","@eslint/js":"^9.15.0","@photo-sphere-viewer/core":"^5.11.1","@rollup/plugin-alias":"5.1.1","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-commonjs":"^28.0.1","@rollup/plugin-image":"^3.0.3","@rollup/plugin-replace":"^6.0.1","@semantic-release/changelog":"^6.0.3","@semantic-release/commit-analyzer":"^13.0.0","@semantic-release/git":"^10.0.1","@semantic-release/github":"^11.0.1","@semantic-release/npm":"^12.0.1","@semantic-release/release-notes-generator":"^14.0.1","@vitejs/plugin-vue":"5.2.1","@vue/vue3-jest":"^29.2.6","@xeokit/xeokit-sdk":"git+https://git@github.com/Amoki/xeokit-sdk.git#f81ebaeda39e03d96f75785b257378e420416e0d","@zip.js/zip.js":"^2.7.53",async:"^3.2.6",autoprefixer:"^10.4.20","babel-core":"^7.0.0-bridge.0","babel-jest":"^29.7.0","conventional-changelog-eslint":"^6.0.0",cypress:"^13.16.0",esbuild:"^0.24.0",eslint:"9.15.0","eslint-config-prettier":"9.1.0","eslint-plugin-cypress":"4.1.0","eslint-plugin-jest":"28.9.0","eslint-plugin-prettier":"5.2.1","eslint-plugin-vue":"9.31.0","form-data":"^4.0.1",globals:"^15.12.0","html-to-image":"^1.11.11",html2canvas:"1.4.1","http-server":"^14.1.1",jest:"^29.7.0","jest-environment-jsdom":"^29.7.0","jest-extended":"^4.0.2",jspdf:"^2.5.2",lodash:"^4.17.21","node-fetch":"^3.3.2","pdfjs-dist":"^4.8.69",postcss:"^8.4.49",prettier:"^3.4.1",querystring:"^0.2.1","sass-embedded":"^1.81.0","semantic-release":"^24.2.0",sinon:"^19.0.2","start-server-and-test":"^2.0.8",vite:"6.0.11","vite-plugin-css-injected-by-js":"^3.5.2",vue:"3.5.13","vue-eslint-parser":"^9.4.3","vue-i18n":"^10.0.4"}};class Qzt{constructor({plugins:e,api:t,ui:n,locale:o="fr"}){this.pluginManager=new nUt(e),this.windowManager=new sUt,this.windowManager.registerAndAddPluginsToWindows([...this.pluginManager.registeredPlugins.values()]),this.api=new FVt(t),this.globalContext=new X3e(this),this.state=YVt(this),this.shortcutManager=I1e(this.state),this.uiSettings=n||{},this.i18n=new Z3e(o),this._contextMenu=null,this.layout=new Gzt(this.uiSettings.resizable!==!1),this.localContext=null,window.$viewer=this}get version(){return qzt.version}get locale(){return this.i18n.locale}get contextMenu(){return this._contextMenu||B1e}set contextMenu(e){this._contextMenu=e}get registeredWindows(){return[...this.windowManager.registeredWindows.keys()]}get registeredPlugins(){return[...this.pluginManager.registeredPlugins.keys()]}get pluginsCfg(){return this.pluginManager.cfg}registerPlugin(e){this.pluginManager.registerPlugin(e),this.windowManager.registerAndAddPluginsToWindows([e])}}function Kzt(i,e={}){e.backgroundColor&&(i.style.setProperty("--bimdata-viewer-background-color",e.backgroundColor),e.backgroundColor==="transparent"&&i.style.setProperty("--areas-separator-color","transparent")),e.colorPrimary&&i.style.setProperty("--color-primary",e.colorPrimary),e.colorPrimaryLighter&&i.style.setProperty("--color-primary-lighter",e.colorPrimaryLighter),e.colorPrimaryLight&&i.style.setProperty("--color-primary-light",e.colorPrimaryLight),e.colorPrimaryDark&&i.style.setProperty("--color-primary-dark",e.colorPrimaryDark),e.colorSecondary&&i.style.setProperty("--color-secondary",e.colorSecondary),e.colorSecondaryLighter&&i.style.setProperty("--color-secondary-lighter",e.colorSecondaryLighter),e.colorSecondaryLight&&i.style.setProperty("--color-secondary-light",e.colorSecondaryLight),e.colorSecondaryDark&&i.style.setProperty("--color-secondary-dark",e.colorSecondaryDark),e.colorSilverLight&&i.style.setProperty("--color-silver-light",e.colorSilverLight),e.colorSilver&&i.style.setProperty("--color-silver",e.colorSilver),e.colorSilverDark&&i.style.setProperty("--color-silver-dark",e.colorSilverDark),e.colorGraniteLight&&i.style.setProperty("--color-granite-light",e.colorGraniteLight),e.colorGranite&&i.style.setProperty("--color-granite",e.colorGranite),e.colorSuccess&&i.style.setProperty("--color-success",e.colorSuccess),e.colorSuccessLighter&&i.style.setProperty("--color-success-Lighter",e.colorSuccessLighter),e.colorSuccessLight&&i.style.setProperty("--color-success-Light",e.colorSuccessLight),e.colorSuccessDark&&i.style.setProperty("--color-success-Dark",e.colorSuccessDark),e.colorWarning&&i.style.setProperty("--color-warning",e.colorWarning),e.colorWarningLighter&&i.style.setProperty("--color-warning-Lighter",e.colorWarningLighter),e.colorWarningLight&&i.style.setProperty("--color-warning-Light",e.colorWarningLight),e.colorWarningDark&&i.style.setProperty("--color-warning-Dark",e.colorWarningDark),e.colorHigh&&i.style.setProperty("--color-high",e.colorHigh),e.colorHighLighter&&i.style.setProperty("--color-high-lighter",e.colorHighLighter),e.colorHighLight&&i.style.setProperty("--color-high-light",e.colorHighLight),e.colorHighDark&&i.style.setProperty("--color-high-dark",e.colorHighDark),e.colorText&&i.style.setProperty("--color-text",e.colorText),(!e.backgroundColor||e.backgroundColor!=="transparent")&&i.style.setProperty("--areas-separator-color","rgba(216, 216, 216, 1)"),e.headerHeight!=null&&i.style.setProperty("--bimdata-viewer-header-height",e.headerHeight),i.style.setProperty("--areas-background-color","transparent")}const Jzt=Object.freeze({25:"GUEST",50:"USER",100:"ADMIN"}),Mm=Object.freeze({READ:"read",WRITE:"write"});function pfe(i){const e={};return i.forEach(t=>{const[n,o]=t.split(":");e[n]?e[n].push(o):e[n]=[o]}),e}const Zzt={token_scopes:[],usable_scopes:[],user_role:25};function ffe(i=Zzt){var n,o,r,s,a,l;const e=pfe(i.token_scopes),t=pfe(i.usable_scopes);return{...Mq(i),tokenScopes:e,usableScopes:t,userRole:Jzt[i.user_role],user:i.user?Mq(i.user):null,hasBcfReadPermission:((n=t.bcf)==null?void 0:n.includes(Mm.READ))??!1,hasBcfWritePermission:((o=t.bcf)==null?void 0:o.includes(Mm.WRITE))??!1,hasModelReadPermission:((r=t.model)==null?void 0:r.includes(Mm.READ))??!1,hasModelWritePermission:((s=t.model)==null?void 0:s.includes(Mm.WRITE))??!1,hasDocReadPermission:((a=t.document)==null?void 0:a.includes(Mm.READ))??!1,hasDocWritePermission:((l=t.document)==null?void 0:l.includes(Mm.WRITE))??!1}}const Wzt={de:{BcfComponents:{BcfFilters:{filtersButton:"Filter",filtersTitle:"Filter",priorityLabel:"Priorität",statusLabel:"Status",assignedToLabel:"Zugewiesen an",creatorsLabel:"Erstellt von",tagsLabel:"Tags",resetButton:"Zurücksetzen",searchButton:"Suchen",undefined:"Nicht definiert",datePlaceholder:"Erstellungsdatum"},BcfSettings:{goBackButton:"Zurück",title:"BCF-Parameter",text:"Erstellen, füllen und listen Sie die BCF-Einstellungen auf, die Sie für dieses Projekt haben möchten.",validateButton:"Die BCF-Parameter anerkennen"},BcfStatistics:{emptyText:"Fügen Sie Fragen hinzu, um zugehörige Statistiken hier anzuzeigen.",issues:"Probleme",extension:{Priority:"Priorität",PriorityNotDefined:"Keine Priorität",PriorityTitle:"Prioritäten",Status:"Status",StatusNotDefined:"Kein Status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priorität:",noPriority:"Keine",assignedTo:"Zugewiesen an :",elements:"Elemente",notSpecified:"Nicht definiert",see:"Anzeigen"},BcfTopicCreationCard:{text:"Ein neues BCF-Thema erstellen",createBcfSideTitle:"Ein Problem melden"},BcfTopicForm:{dragDropImageText:"Bitte wählen Sie eine Datei aus.",addObjectButton:"Objekt",addAnnotationButton:"Annotation",annotationButtonTooltip:"Zu diesem Thema gibt es derzeit keine Ansichten.",addPictureButton:"Fügen Sie ein Bild hinzu.",titlePlaceholder:"Titel *",titleErrorMessage:"Titel fehlt",typeLabel:"Typ",priorityLabel:"Priorität",statusLabel:"Status",stageLabel:"Phase",assignedToLabel:"Zugewiesen an",dueDateLabel:"Fälligkeitsdatum (TT.MM.JJJJ)",descriptionLabel:"Beschreibung",labelsLabel:"Tags",createButton:"Bestätigen",updateButton:"Änderungen übernehmen",modalText:"Sie sind dabei, die Bearbeitung der Ausgabe {Name} zu beenden, aber es gibt noch ungespeicherte Änderungen.",cancelButton:"Änderungen verwerfen",continueButton:"Änderungen fortsetzen",createTitle:"Ein Problem melden",dragDropImageTextTablet:"Foto machen",takeSnapshot:"Mach einen Schnappschuss",importFile:"Eine Datei importieren",searchPlaceholder:"Suchen",emptySearch:"kein Ergebnis"},BcfTopicOverview:{openViewer:"Im Viewer öffnen",openViewerNoModels:"Es sind keine Vorlagen zur Ansicht bereit",elements:"{count} Elemente",noElements:"kein Element",type:"Typ",noTypeSpecified:"Kein Typ angegeben",description:"Beschreibung",noDescriptionProvided:"Keine Beschreibung angegeben",assignedTo:"Zugeteilt an",notAssigned:"Nicht zugewiesen",dueDate:"Fälligkeitsdatum",noDueDate:"Kein Fälligkeitsdatum",informations:"Informationen",status:"Status",noStatusSpecified:"Kein Status angegeben",stage:"Phase",noStageProvided:"Keine Phase angegeben",priority:"Priorität",priorityNotDefined:"Nicht definiert",tags:"Tags",noTags:"Keine Tags",commentButton:"Ein Kommentar veröffentlichen",deleteText:"Sie löschen jetzt {Name}",deleteBcfButton:"Dieses BCF löschen",keepBcfButton:"Dieses BCF beibehalten",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Priorität",status:"Status",title:"Titel",creator:"Autor",date:"Datum"}},BcfTopicActionsCell:{seeButton:"Anzeigen"},BcfTopicComments:{commentButton:"Ein Kommentar verfassen",commentLabel:"Ein Kommentar verfassen",commentText:"Kommentar",cancelButton:"Abbrechen",publishButton:"Veröffentlichen",commentsText:"Kommentare",deleteCommentText:"Diesen Kommentar löschen?",deleteButton:"Löschen",takeSnapshot:"Mach einen Schnappschuss"},BcfTopicPriorityCell:{noPriority:"Keine"},SettingCard:{addButton:"ein Element hinzufügen",cancelButton:"Abbrechen",validateButton:"Bestätigen",deleteExtensionText:"Diesen Parameter löschen",deleteButton:"Löschen",title:{Priority:"Prioritäten",Label:"Tags",Status:"Status",Type:"Typen",Stage:"Phasen"},input:{Priority:"Eine neue Priorität hinzufügen",Label:"Ein neues Etikett hinzufügen",Status:"Einen neuen Status hinzufügen",Type:"Einen neuen Typ hinzufügen",Stage:"Eine neue Phase hinzufügen"},text:{Priority:"Liste der Prioritäten",Label:"Liste von Tags",Status:"Liste der Status",Type:"Liste der Typen",Stage:"Liste der Phasen"}}}},en:{BcfComponents:{BcfFilters:{filtersButton:"Filters",filtersTitle:"Filters",priorityLabel:"Priority",statusLabel:"Status",assignedToLabel:"Assigned to",creatorsLabel:"Created by",tagsLabel:"Tags",resetButton:"Reset",searchButton:"Search",undefined:"Not defined",datePlaceholder:"Creation date"},BcfSettings:{goBackButton:"Back",title:"BCF Settings",text:"Create, enter in, and list the BCF settings you would like to have for this project",validateButton:"Validate BCF settings"},BcfStatistics:{emptyText:"Add BCF Topics to start to have some stats here.",issues:"issues",extension:{Priority:"Priority",PriorityNotDefined:"No priority",PriorityTitle:"Priorities",Status:"Status",StatusNotDefined:"No status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priority: ",noPriority:"None",assignedTo:"Assigned to: ",elements:"Elements",notSpecified:"Not specified",see:"See"},BcfTopicCreationCard:{text:"Create a new BCF topic",createBcfSideTitle:"Report a problem"},BcfTopicForm:{dragDropImageText:"Please select a file",addObjectButton:"Object",addAnnotationButton:"Annotation",annotationButtonTooltip:"This topic has no viewpoint",addPictureButton:"Add a picture",titlePlaceholder:"Title *",titleErrorMessage:"Missing title",typeLabel:"Type",priorityLabel:"Priority",statusLabel:"Status",stageLabel:"Stage",assignedToLabel:"Assigned to",dueDateLabel:"Due date",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Validate",updateButton:"Modify this BCF",modalText:"You are about to quit editing issue {name} but there are unsaved changes.",cancelButton:"Discard changes",continueButton:"Continue editing",createTitle:"Report a problem",dragDropImageTextTablet:"Take a picture",takeSnapshot:"Take a snapshot",importFile:"Import a file",searchPlaceholder:"Search",emptySearch:"No result"},BcfTopicOverview:{openViewer:"Open in viewer",openViewerNoModels:"No model to open",elements:"{count} Elements",noElements:"No element",type:"Type",noTypeSpecified:"No type specified",description:"Description",noDescriptionProvided:"No description provided",assignedTo:"Assigned to",notAssigned:"Not assigned",dueDate:"Due date",noDueDate:"No due date",informations:"Informations",status:"Status",noStatusSpecified:"No status specified",stage:"Stage",noStageProvided:"No stage provided",priority:"Priority",priorityNotDefined:"Not defined",tags:"Tags",noTags:"No tags",commentButton:"Post a comment",deleteText:"You are about to delete {name}",deleteBcfButton:"Delete this BCF",keepBcfButton:"Keep this BCF",author:"Author"},BcfTopicsTable:{headers:{index:"#",priority:"Priority",status:"Status",title:"Title",creator:"Author",date:"Date"}},BcfTopicActionsCell:{seeButton:"See"},BcfTopicComments:{commentButton:"Post a comment",commentLabel:"Post a comment",commentText:"Comment",cancelButton:"Cancel",publishButton:"Publish",commentsText:"Comments",deleteCommentText:"Delete this comment ?",deleteButton:"Delete",takeSnapshot:"Take a snapshot"},BcfTopicPriorityCell:{noPriority:"None"},SettingCard:{addButton:"add an element",cancelButton:"Cancel",validateButton:"Validate",deleteExtensionText:"Remove this setting",deleteButton:"Delete",title:{Priority:"Priorities",Label:"Labels",Status:"Status",Type:"Types",Stage:"Stages"},input:{Priority:"Add a new priority",Label:"Add a new label",Status:"Add new status",Type:"Add a new type",Stage:"Add a new stage"},text:{Priority:"Priority list",Label:"Labels list",Status:"Status list",Type:"Type list",Stage:"Stage list"}}}},es:{BcfComponents:{BcfFilters:{filtersButton:"Filtros",filtersTitle:"Filtros",priorityLabel:"Prioridad",statusLabel:"Estado",assignedToLabel:"Asignado a",creatorsLabel:"Creado por",tagsLabel:"Etiquetas:",resetButton:"Restablecer",searchButton:"Buscar en",undefined:"No definido",datePlaceholder:"Fecha de creación"},BcfSettings:{goBackButton:"Volver",title:"Parámetros del BCF",text:"Cree, rellene y enumere los parámetros del BCF que desea tener en este proyecto",validateButton:"Validar los parámetros del BCF"},BcfStatistics:{emptyText:"Añada preguntas para ver las estadísticas asociadas aquí.",issues:"problemas",extension:{Priority:"Prioridad",PriorityNotDefined:"Sin prioridad",PriorityTitle:"Prioridades",Status:"Estado",StatusNotDefined:"Sin estado",StatusTitle:"Estatutos"}},BcfTopicCard:{priority:"Prioridad :",noPriority:"Sin",assignedTo:"Asignado a :",elements:"Elementos",notSpecified:"No definido",see:"Ver"},BcfTopicCreationCard:{text:"Crear un nuevo tema BCF",createBcfSideTitle:"Informar de un problema"},BcfTopicForm:{dragDropImageText:"Seleccione un archivo",addObjectButton:"Objeto",addAnnotationButton:"Anotación",annotationButtonTooltip:"Actualmente este tema no posee ningún punto de vista",addPictureButton:"Añadir una imagen",titlePlaceholder:"Título *",titleErrorMessage:"Falta el título",typeLabel:"Tipo",priorityLabel:"Prioridad",statusLabel:"Estado",stageLabel:"Fase",assignedToLabel:"Asignado a",dueDateLabel:"Fecha de vencimiento (DD/MM/AAAA)",descriptionLabel:"Descripción",labelsLabel:"Etiquetas",createButton:"Validar",updateButton:"Modificar este BCF",modalText:"Está a punto de salir de la edición del problema de {name} pero hay cambios sin guardar.",cancelButton:"Cancelar los cambios",continueButton:"Continuar con los cambios",createTitle:"Informar de un problema",dragDropImageTextTablet:"Tomar una fotografía",takeSnapshot:"Tomar un snapshot",importFile:"Importar un archivo",searchPlaceholder:"Buscar",emptySearch:"No hay resultados"},BcfTopicOverview:{openViewer:"Abrir en el visor",openViewerNoModels:"No hay ningún modelo listo para la visualización",elements:"{count} Elementos",noElements:"Ningún elemento",type:"Tipo",noTypeSpecified:"No se especifica el tipo",description:"Descripción",noDescriptionProvided:"No hay descripción",assignedTo:"Asignado a",notAssigned:"No asignado",dueDate:"Plazo",noDueDate:"Sin fecha de vencimiento",informations:"Información",status:"Estado",noStatusSpecified:"No se especifica el estado",stage:"Fase",noStageProvided:"No se indica ninguna fase",priority:"Prioridad",priorityNotDefined:"No definido",tags:"Etiquetas",noTags:"Sin etiquetas",commentButton:"Publicar un comentario",deleteText:"Estás a punto de borrar {name}",deleteBcfButton:"Borrar este BCF",keepBcfButton:"Mantenga este BCF",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Prioridad",status:"Estado",title:"Título",creator:"Autor",date:"Fecha"}},BcfTopicActionsCell:{seeButton:"Ver"},BcfTopicComments:{commentButton:"Publicar un comentario",commentLabel:"Publicar un comentario",commentText:"Comentario",cancelButton:"Cancelar",publishButton:"Publicar",commentsText:"comentarios",deleteCommentText:"¿Borrar este comentario?",deleteButton:"Borrar",takeSnapshot:"Tomar un snapshot"},BcfTopicPriorityCell:{noPriority:"Sin"},SettingCard:{addButton:"añadir un elemento",cancelButton:"Cancelar",validateButton:"Validar",deleteExtensionText:"Borrar esta configuración",deleteButton:"Borrar",title:{Priority:"Prioridades",Label:"Etiquetas:",Status:"Estatutos",Type:"Tipos",Stage:"Fases"},input:{Priority:"Añadir una nueva prioridad",Label:"Añadir una nueva etiqueta",Status:"Añadir un nuevo estado",Type:"Añadir un nuevo tipo",Stage:"Añadir una nueva fase"},text:{Priority:"Lista de prioridades",Label:"Lista de etiquetas",Status:"Lista de estatutos",Type:"Lista de tipos",Stage:"Lista de fases"}}}},fr:{BcfComponents:{BcfFilters:{filtersButton:"Filtres",filtersTitle:"Filtres",priorityLabel:"Priorité",statusLabel:"Statut",assignedToLabel:"Assigné à",creatorsLabel:"Créé par",tagsLabel:"Tags",resetButton:"Réinitialiser",searchButton:"Rechercher",undefined:"Non défini",datePlaceholder:"Date de création"},BcfSettings:{goBackButton:"Retour",title:"Paramètres BCF",text:"Créez, renseignez et listez les paramètres BCF que vous souhaitez avoir sur ce projet",validateButton:"Valider les paramètres BCF"},BcfStatistics:{emptyText:"Ajoutez des questions pour voir les statistiques associées ici.",issues:"problèmes",extension:{Priority:"Priorité",PriorityNotDefined:"Aucune priorité",PriorityTitle:"Priorités",Status:"Statut",StatusNotDefined:"Aucun statut",StatusTitle:"Statuts"}},BcfTopicCard:{priority:"Priorité : ",noPriority:"Aucune",assignedTo:"Assigné à : ",elements:"{n} Élements",notSpecified:"Non défini",see:"Voir"},BcfTopicCreationCard:{text:"Créer un nouveau topic BCF",createBcfSideTitle:"Signaler un problème"},BcfTopicForm:{dragDropImageText:"Veuillez sélectionner un fichier",addObjectButton:"Objet",addAnnotationButton:"Annotation",annotationButtonTooltip:"Ce topic ne possède actuellement aucun point de vue",addPictureButton:"Ajouter une image",titlePlaceholder:"Titre *",titleErrorMessage:"Titre manquant",typeLabel:"Type",priorityLabel:"Priorité",statusLabel:"Statut",stageLabel:"Phase",assignedToLabel:"Assigné à",dueDateLabel:"Date d'échéance",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Valider",updateButton:"Modifier ce BCF",modalText:"Vous êtes sur le point de quitter l'édition de l'issue {name} mais il y'a des modifications non enregistrées.",cancelButton:"Annuler les modifications",continueButton:"Continuer les modifications",createTitle:"Signaler un problème",dragDropImageTextTablet:"Prendre une photo",takeSnapshot:"Prendre un snapshot",importFile:"Importer un fichier",searchPlaceholder:"Rechercher",emptySearch:"Pas de résultat"},BcfTopicOverview:{openViewer:"Ouvrir dans le viewer",openViewerNoModels:"Il n'y a aucun modèle prêt pour une visualisation",elements:"{count} Élements",noElements:"Aucun élément concerné",type:"Type",noTypeSpecified:"Pas de type spécifié",description:"Description",noDescriptionProvided:"Pas de description renseignée",assignedTo:"Assigné à",notAssigned:"Non assigné",dueDate:"Échéance",noDueDate:"Pas de date d'échéance",informations:"Informations",status:"Statut",noStatusSpecified:"Pas de statut spécifié",stage:"Phase",noStageProvided:"Pas de phase renseignée",priority:"Priorité",priorityNotDefined:"Non défini",tags:"Tags",noTags:"Pas de tags",commentButton:"Poster un commentaire",deleteText:"Vous êtes sur le point de supprimer {name}",deleteBcfButton:"Supprimer ce BCF",keepBcfButton:"Conserver ce BCF",author:"Auteur"},BcfTopicsTable:{headers:{index:"#",priority:"Priorité",status:"Statut",title:"Titre",creator:"Auteur",date:"Date"}},BcfTopicActionsCell:{seeButton:"Voir"},BcfTopicComments:{commentButton:"Poster un commentaire",commentLabel:"Poster un commentaire",commentText:"Commentaire",cancelButton:"Annuler",publishButton:"Publier",commentsText:"commentaires",deleteCommentText:"Supprimer ce commentaire ?",deleteButton:"Supprimer",takeSnapshot:"Prendre un snapshot"},BcfTopicPriorityCell:{noPriority:"Aucune"},SettingCard:{addButton:"ajouter un élément",cancelButton:"Annuler",validateButton:"Valider",deleteExtensionText:"Supprimmer ce paramètre",deleteButton:"Supprimer",title:{Priority:"Priorités",Label:"Tags",Status:"Statuts",Type:"Types",Stage:"Phases"},input:{Priority:"Ajouter une nouvelle priorité",Label:"Ajouter un nouveau label",Status:"Ajouter un nouveau statut",Type:"Ajouter un nouveau type",Stage:"Ajouter une nouvelle phase"},text:{Priority:"Liste des priorités",Label:"Liste des tags",Status:"Liste des statuts",Type:"Liste des types",Stage:"Liste des phases"}}}},it:{BcfComponents:{BcfFilters:{filtersButton:"Filtri",filtersTitle:"Filtri",priorityLabel:"Priorità",statusLabel:"Stato",datePlaceholder:"Data di creazione",assignedToLabel:"Assegnato a",creatorsLabel:"Creato da",tagsLabel:"Etichette",resetButton:"Ripristina",searchButton:"Cerca",undefined:"Non definito"},BcfSettings:{goBackButton:"Indietro",title:"Parametri BCF",text:"Creare, notificare e elencare i parametri BCF che si desidera avere su questo progetto",validateButton:"Conferma i parametri BCF"},BcfStatistics:{emptyText:"Aggiungi delle domande per vedere le statistiche associate qui.",issues:"problemi",extension:{Priority:"Priorità",PriorityNotDefined:"Nessuna priorità",PriorityTitle:"Priorità",Status:"Stato",StatusNotDefined:"Nessuno stato",StatusTitle:"Stati"}},BcfTopicCard:{priority:"Priorità:",noPriority:"Nessuno",assignedTo:"Assegnato a:",elements:"Elementi",noElements:"0 elementi",notSpecified:"Non definito",see:"Visualizza"},BcfTopicCreationCard:{text:"Crea un nuovo topic BCF",createBcfSideTitle:"Segnala un problema"},BcfTopicForm:{dragDropImageText:"Selezionare un file",addObjectButton:"Oggetto",addAnnotationButton:"Annotazione",annotationButtonTooltip:"Attualmente questo argomento non presenta alcun punto di vista",addPictureButton:"Aggiungere un'immagine",titlePlaceholder:"Titolo *",titleErrorMessage:"Titolo mancante",typeLabel:"Tipo",priorityLabel:"Priorità",statusLabel:"Stato",stageLabel:"Fase",assignedToLabel:"Assegnato a",dueDateLabel:"Data di scadenza",descriptionLabel:"Descrizione",labelsLabel:"Tag",createButton:"Conferma",updateButton:"Modificare questo BCF",modalText:"State per abbandonare la modifica di {name} ma ci sono modifiche non salvate.",cancelButton:"Annullare le modifiche",continueButton:"Continuare le modifiche",createTitle:"Segnala un problema"},BcfTopicOverview:{openViewer:"Apri nel visualizzatore",openViewerNoModels:"Non esistono modelli pronti per la visualizzazione",elements:"{count} Elementi",noElements:"Nessun elemento",type:"Tipo",noTypeSpecified:"Nessun tipo specificato",description:"Descrizione",noDescriptionProvided:"Nessuna descrizione inserita",assignedTo:"Assegnato a",notAssigned:"Non assegnato",dueDate:"Scadenza",noDueDate:"Nessuna data di scadenza",informations:"Informazioni",status:"Stato",noStatusSpecified:"Nessuno stato specificato",stage:"Fase",noStageProvided:"Nessuna fase inserita",priority:"Priorità",priorityNotDefined:"Non definita",tags:"Etichette",noTags:"Nessuna etichetta",commentButton:"Pubblica un commento",deleteText:"Stai per eliminare {name}",deleteBcfButton:"Elimina questo BCF",keepBcfButton:"Conserva questo BCF",author:"Autore"},BcfTopicsTable:{headers:{index:"#",priority:"Priorità",status:"Stato",title:"Titolo",creator:"Autore",date:"Data"}},BcfTopicActionsCell:{seeButton:"Visualizza"},BcfTopicComments:{commentButton:"Pubblica un commento",commentLabel:"Pubblica un commento",commentText:"Commento",cancelButton:"Annulla",publishButton:"Pubblica",commentsText:"commenti",deleteCommentText:"Eliminare questo commento?",deleteButton:"Elimina"},BcfTopicPriorityCell:{noPriority:"Nessuno"},SettingCard:{addButton:"aggiungi un elemento",cancelButton:"Annulla",validateButton:"Conferma",deleteExtensionText:"Elimina questo parametro",deleteButton:"Elimina",title:{Priority:"Priorità",Label:"Etichette",Status:"Stati",Type:"Tipi",Stage:"Fasi"},input:{Priority:"Aggiungi una nuova priorità",Label:"Aggiungi una nuova etichetta",Status:"Aggiungi un nuovo stato",Type:"Aggiungi un nuovo tipo",Stage:"Aggiungi una nuova fase"},text:{Priority:"Elenco delle priorità",Label:"Elenco delle etichette",Status:"Elenco degli stati",Type:"Elenco dei tipi",Stage:"Elenco delle fasi"}}}}},Xzt=({apiClient:i,fetchUsers:e,i18nPlugin:t}={})=>({install(n){i?fn.setup({apiClient:i,fetchUsers:e}):console.error("[BCF Components Plugin] No api client provided. You must provide an api client for the components to work properly."),t?Object.entries(Wzt).forEach(([o,r])=>{t.global.mergeLocaleMessage(o,r)}):console.warn("[BCF Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly."),Object.entries(Sye).forEach(([o,r])=>{n.component(o,r)})}}),Yzt={de:{BuildingMaker:{title:"Building Maker",back:"Zurück",list:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschließend Ihre PDFs herunter.",createButton:"Neues Projekt",updateButton:"Umbenennen",deleteButton:"Löschen"},form:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschließend Ihre PDFs herunter.",input:"Name des Gebäudes",error:"Ungültiger Name",createButton:"Erstellen",updateButton:"Bestätigen"},view:{addStoreyButton:"Etage",addPlanButton:"Grundriss",closeButton:"Fertigstellen",submitFilesButton:"Bestätigen"},storeyForm:{title:"Neue Etage",input:"Name",error:"Ungültiger Name",cancelButton:"Abbrechen",submitButton:"Bestätigen"}},FileManager:{creationFormTitle:"Ordner erstellen",renameFormPlaceholder:"Datei- / Ordnernam",nameInputPlaceholder:"Ordnername",emptyFolder:"Dieser Ordner ist leer",newFolderSuccess:"Neuer Ordner erstellt",renameFolderSuccess:"Umbenannter Ordner",deleteFolderSuccess:"Ordner gelöscht",newFileSuccess:"Datei hinzugefügt",renameFileSuccess:"Umbenannte Datei",deleteFileSuccess:"Datei gelöscht",nameInputErrorMessage:"Ungültiger name",cancel:"Abbrechen",submit:"Bestätigen",buttonText:"Neuer Ordner",addFileButtonText:"Datei laden",rename:"Umbenennen",view:"Sehen",download:"Herunterladen",delete:"Löschen",deleteTitle:"Dateien löschen",deleteDetail:"Sie sind im Begriff, die folgenden Dateien / Ordner endgültig zu löschen"}},en:{BIMDataComponents:{t:{back:"Back",cancel:"Cancel",create:"Create",delete:"Delete",download:"Download",finish:"Finish",rename:"Rename",search:"Search",see:"View",storey:"Storey",validate:"Validate"}},BuildingMaker:{title:"Building Maker",list:{text:"Create and edit storeys, then download your PDFs.",new:"New project"},form:{input:"Building name",error:"Invalid"},view:{addStorey:"Add Storey",addFile:"Add File",addPlan:"Add Plan"},storeyForm:{title:"New storey",input:"Name",error:"Invalid name"}},FileManager:{creationFormTitle:"Create folder",renameFormPlaceholder:"Folder/File name",nameInputPlaceholder:"Folder name",emptyFolder:"This folder is empty",newFolderSuccess:"New folder created",renameFolderSuccess:"Folder renamed",deleteFolderSuccess:"Folder deleted",newFileSuccess:"File added",renameFileSuccess:"File renamed",deleteFileSuccess:"File deleted",nameInputErrorMessage:"Invalid name",buttonText:"New folder",addFileButtonText:"Upload a file",deleteTitle:"Deleting Files",deleteDetail:"You are about to permanently delete the following files / folders",dmsRoot:"Root of the project's DMS",pdfPageSelectorTitle:"Select a page"},MetaBuildingStructure:{title:"Meta-Building Structure",tab:{structure:"Structure",zones:"Zones",equipments:"Equipments"},StoreySelector:{placeholder:"Select a storey"}},PhotosphereBuilding:{title:"Photosphere Building"}},es:{BuildingMaker:{title:"Building Maker",back:"Vuelta",list:{text:"Cree y edite los pisos después cargue los PDF.",createButton:"Nuevo proyecto",updateButton:"Renombrar",deleteButton:"Suprimir"},form:{text:"Cree y edite los pisos después cargue los PDF.",input:"Nombre del edificio",error:"Nombre no válido",createButton:"Crear",updateButton:"Validar"},view:{addStoreyButton:"Piso",addPlanButton:"Plano",closeButton:"Terminar",submitFilesButton:"Validar"},storeyForm:{title:"Nuevo piso",input:"Nombre",error:"Nombre no válido",cancelButton:"Anular",submitButton:"Validar"}},FileManager:{creationFormTitle:"Crear un archivo",renameFormPlaceholder:"Nombre de archivo / carpeta",nameInputPlaceholder:"Nombre de la carpeta",emptyFolder:"Esta carpeta está vacía",newFolderSuccess:"Nueva carpeta creada",renameFolderSuccess:"Carpeta renombrada",deleteFolderSuccess:"Carpeta eliminada",newFileSuccess:"Archivo agregado",renameFileSuccess:"Archivo renombrado",deleteFileSuccess:"Archivo eliminado",nameInputErrorMessage:"Nombre inválida",cancel:"Cancelar",submit:"Validar",buttonText:"Carpeta nueva",addFileButtonText:"Cargar un archivo",rename:"Renombrar",view:"Ver",download:"Descargar",delete:"Borrar",deleteTitle:"Eliminar archivos",deleteDetail:"Está a punto de eliminar permanentemente los siguientes archivos / carpetas"}},fr:{BIMDataComponents:{t:{back:"Retour",cancel:"Annuler",create:"Créer",delete:"Supprimer",download:"Télécharger",finish:"Terminer",rename:"Renommer",search:"Rechercher",see:"Voir",storey:"Étage",validate:"Valider"}},BuildingMaker:{title:"Building Maker",list:{text:"Créez et éditez les étages puis téléchagez vos PDF.",new:"Nouveau projet"},form:{input:"Nom du bâtiment",error:"Nom invalide"},view:{addStorey:"Ajouter un Étage",addFile:"Ajouter un fichier",addPlan:"Ajouter un plan"},storeyForm:{title:"Nouvel étage",input:"Nom",error:"Nom invalide"}},FileManager:{creationFormTitle:"Créer un dossier",renameFormPlaceholder:"Nom du fichier/dosier",nameInputPlaceholder:"Nom du dossier",emptyFolder:"Ce dossier est vide",newFolderSuccess:"Nouveau dossier créé",renameFolderSuccess:"Dossier renommé",deleteFolderSuccess:"Dossier supprimé",newFileSuccess:"Fichier ajouté",renameFileSuccess:"Fichier renommé",deleteFileSuccess:"Fichier supprimé",nameInputErrorMessage:"Nom invalide",buttonText:"Nouveau dossier",addFileButtonText:"Charger un fichier",deleteTitle:"Supression de fichiers",deleteDetail:"Vous êtes sur le point de supprimer définitivement les fichiers/dossiers suivants",dmsRoot:"Racine de la GED du projet",pdfPageSelectorTitle:"Sélectionner une page"},MetaBuildingStructure:{title:"Structure Méta-Building",tab:{structure:"Structure",zones:"Zones",equipments:"Équipements"},StoreySelector:{placeholder:"Sélectionner un étage"}},PhotosphereBuilding:{title:"Photosphère Building"}},it:{BuildingMaker:{title:"Building Maker",back:"Reso",list:{text:"Crea e modifica i piani e poi scarica i tuoi PDF.",createButton:"Nuovo progetto",updateButton:"Rinominare",deleteButton:"Eliminare"},form:{text:"Crea e modifica i piani e poi scarica i tuoi PDF.",input:"Nome della costruzione",error:"Nome non corretto",createButton:"Creare",updateButton:"Convalidare"},view:{addStoreyButton:"Piano",addPlanButton:"Mappa",closeButton:"Finire",submitFilesButton:"Convalidare"},storeyForm:{title:"Nuovo piano",input:"Nome",error:"Nome non corretto",cancelButton:"Annullare",submitButton:"Convalidare"}},FileManager:{creationFormTitle:"Crea una cartella",renameFormPlaceholder:"Nome file/cartella",nameInputPlaceholder:"Nome della cartella",emptyFolder:"Questa cartella è vuota",newFolderSuccess:"Nuova cartella creata",renameFolderSuccess:"Cartella rinominata",deleteFolderSuccess:"Cartella eliminata",newFileSuccess:"File aggiunto",renameFileSuccess:"File rinominato",deleteFileSuccess:"File cancellato",nameInputErrorMessage:"Nome non valido",cancel:"Annulla",submit:"Invia",buttonText:"Nuova cartella",addFileButtonText:"Carica un file",rename:"Rinominare",view:"Vedere",download:"Scaricare",delete:"Cancellare",deleteTitle:"Eliminazione di file",deleteDetail:"Stai per eliminare definitivamente i seguenti file/cartelle"}}},$zt=({i18nPlugin:i}={})=>({install(e){i?Object.entries(Yzt).forEach(([t,n])=>{i.global.mergeLocaleMessage(t,n)}):console.warn("[BIMData Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly."),Object.entries(IMt).forEach(([t,n])=>{e.component(t,n)})}}),ejt=Object.freeze(Object.defineProperty({__proto__:null,BIMDataClickAway:Za,BIMDataClickInputAway:{beforeMount(i,e){if(typeof e.value!="function")throw Error(`click away directive needs function, got ${typeof e.value}`);i.clickAwayHandler=t=>{(t.path||t.composedPath&&t.composedPath()).find(o=>o===i)||e.value()},window.addEventListener("mousedown",i.clickAwayHandler,!0)},unmounted(i){window.removeEventListener("mousedown",i.clickAwayHandler,!0),delete i.clickAwayHandler}}},Symbol.toStringTag,{value:"Module"})),tjt=i=>({install(e){Object.entries(Bje).forEach(([t,n])=>{e.component(t,n)}),Object.entries(ejt).forEach(([t,n])=>e.directive(t.split("BIMData")[1],n))}}),ijt={name:"LiWrapper",render(){return Jn("li",this.$slots.default())}};function njt(i,e){var t=new Set([]);return i.forEach(n=>{e.has(n)||t.add(n)}),t}const Il=zo("id"),ojt=({contextMenu:i,objects:e=[],state:t=i.$viewer.state,pictos:n})=>[{name:"selectAll",get group(){return i.groupPositions.select},position:1,get label(){return i.$t("context_menu.select_all")},get picto(){return n.get(this.name)},execute:()=>t.selectObjects(e.filter(Oa(Ei("visible"),yd("selected"))).map(Il)),predicate:()=>e.some(Oa(Ei("visible"),yd("selected")))},{name:"deselectAll",get group(){return i.groupPositions.select},position:2,get label(){return i.$t("context_menu.deselect_all")},get picto(){return n.get(this.name)},execute:()=>t.deselectObjects(e.filter(Ei("selected")).map(Il)),predicate:()=>e.some(Ei("selected"))},{name:"selectSimilar",get group(){return i.groupPositions.select},position:3,get label(){return i.$t("context_menu.select_similar")},get picto(){return n.get(this.name)},execute(){const o=e.filter(r=>r.visible&&r.type===this.selectedObject.type&&r.id!==this.selectedObject.id).map(Il);t.selectObjects(o)},selectedObject:null,predicate(){const o=e.filter(Oa(Ei("visible"),Ei("selected")));return o.length===1&&o[0].type!==void 0?(this.selectedObject=o[0],!0):(this.selectedObject=null,!1)}},{name:"reverseSelection",get label(){return i.$t("context_menu.reverse_selection")},get group(){return i.groupPositions.select},position:4,execute:()=>{const o=new Set(e.filter(Ei("selected")).map(Il)),r=new Set(e.filter(Ei("visible")).map(Il));t.selectObjects(Array.from(njt(r,o)),{exclusive:!0})},predicate:()=>e.some(Oa(yd("selected"),Ei("visible")))&&e.some(Oa(Ei("selected"),Ei("visible")))},{name:"showAll",get group(){return i.groupPositions.visibility},position:1,get label(){return i.$t("context_menu.show_all")},get picto(){return n.get(this.name)},execute:()=>t.showObjects(e.filter(yd("visible")).map(Il)),predicate:()=>e.some(yd("visible"))},{name:"hide",get group(){return i.groupPositions.visibility},position:2,get label(){return i.$t("context_menu.hide")},get picto(){return n.get(this.name)},objectsToHide:null,execute(){const o=this.objectsToHide.filter(Ei("selected"));o.length>0&&t.deselectObjects(o.map(Il)),t.hideObjects(this.objectsToHide.map(Il))},predicate(){return this.objectsToHide=e.filter(Oa(Ei("selected"),Ei("visible"))),this.objectsToHide.length>0}},{name:"hideAll",get group(){return i.groupPositions.visibility},position:3,get label(){return i.$t("context_menu.hide_all")},execute:()=>{const o=e.filter(Ei("visible"));o.some(Ei("selected"))&&t.deselectObjects(o.filter(Ei("selected")).map(Il)),t.hideObjects(o.map(Il))},predicate:()=>e.some(Ei("visible"))}].filter(o=>o.predicate()),sjt={components:{LiWrapper:ijt},inject:["$viewer"],data(){return{defaultPrevented:!1,displayed:!1,top:null,bottom:null,left:null,width:200,nextCommandId:1,currentCommands:[],contextCommands:[],registeredCommands:[],groupPositions:{select:10,visibility:20},asyncPredicateRunning:!1}},computed:{position(){return{top:this.top?this.top+"px":"unset",bottom:this.bottom?this.bottom+"px":"unset",left:this.left+"px",width:this.width+"px"}}},watch:{displayed(i){i?document.addEventListener("keydown",this.onKeyDown):document.removeEventListener("keydown",this.onKeyDown)}},created(){this.$viewer.contextMenu=this,this.asyncPredicates=new Set},methods:{onKeyDown(i){i.key==="Escape"&&this.away()},setPosition(i){const t=(document.fullscreenElement?document.fullscreenElement:this.$parent.$el).getBoundingClientRect();this.left=i.clientX-t.left,this.top=i.clientY-t.top,this.left+this.width>t.width&&(this.left=this.left-this.width),i.clientY>t.top+t.height/2?(this.bottom=t.height-this.top,this.top=null):this.bottom=null},typeCheckCommand(i={}){let e=null;if((!i.execute||typeof i.execute!="function")&!i.component&&(e="Cannot register context menu command. A command must have an execute function or a component property."),i.label||(e="Cannot register context menu command. A command must have a label."),e)throw console.error(e),new Error(e);return i.id=this.nextCommandId++,i},open(i){this.currentCommands=[],this.setPosition(i),this.originEvent=i,i.preventDefault(),this.setCurrentCommands(),this.groupCurrentCommands(),this.defaultPrevented=!1,this.displayed=!0,document.fullscreenElement?(this.$el.parentElement.removeChild(this.$el),this.adoptiveParent=document.fullscreenElement,this.adoptiveParent.appendChild(this.$el)):this.adoptiveParent&&this.adoptiveParent!==this.$viewer.globalContext.el&&(this.adoptiveParent.removeChild(this.$el),this.$viewer.globalContext.el.appendChild(this.$el),this.adoptiveParent=null)},setCurrentCommands(){this.asyncPredicates.clear(),this.asyncPredicateRunning=!1,this.defaultPrevented||this.registeredCommands.forEach(async i=>{if(typeof i.predicate=="function"){const e=i.predicate(this.$viewer.globalContext.activeLocalContext);if(e===!0)this.currentCommands.push(i);else if(typeof(e==null?void 0:e.then)=="function"){this.asyncPredicates.add(e),this.asyncPredicateRunning=!0;const t=await e;this.asyncPredicates.has(e)&&(this.asyncPredicates.delete(e),this.asyncPredicateRunning=this.asyncPredicates.size>0,t===!0&&this.currentCommands.push(i))}}else this.currentCommands.push(i)}),this.currentCommands.push(...this.contextCommands),this.contextCommands=[]},getDefaultCommands({objects:i=[],state:e=this.$viewer.state,context:t=null}){const n=new Map;return t&&this.$viewer.shortcutManager.getShortcuts(t).forEach(o=>n.set(o.name,o.key)),ojt({contextMenu:this,objects:i,state:e,pictos:n})},executeCommand(i){if(i.execute&&(i.execute(this.originEvent),this.displayed=!1),i.component&&!i.menu)throw new Error("Command with component property must have a `menu` property")},away(){this.displayed=!1},groupCurrentCommands(){const i=new Map;this.currentCommands.forEach(n=>{(n.group===null||n.group===void 0)&&(n.group=0),i.has(n.group)?i.get(n.group).push(n):i.set(n.group,[n])}),i.forEach(n=>n.sort((o,r)=>(o.position=o.position||0,r.position=r.position||0,o.position-r.position)));const t=[...i.keys()].sort((n,o)=>n-o).map(n=>i.get(n)).flat();this.currentCommands=t},isGroupIntersection(i){if(i===0)return!1;const e=this.currentCommands[i-1],t=this.currentCommands[i];return e.group<t.group},registerContextCommand(i){const e=this.typeCheckCommand(i);return this.contextCommands.push(e),i.id},registerCommand(i){const e=this.typeCheckCommand(i);return this.registeredCommands.push(e),i.id},unregisterCommand(i){return this.registeredCommands.find(e=>e.id===i)?(this.registeredCommands=this.registeredCommands.filter(e=>e.id!==i),!0):!1},preventDefault(){this.defaultPrevented=!0}}},rjt={key:0,class:"separator"},ajt={class:"menu-text"},ljt={key:1,class:"menu-picto"},cjt={key:0,class:"context-menu__spinner"};function ujt(i,e,t,n,o,r){const s=k("BIMDataIconChevron"),a=k("LiWrapper"),l=k("BIMDataSpinner"),c=pi("click-away");return o.displayed&&(o.currentCommands.length||o.asyncPredicateRunning)?ft((B(),O("ul",{key:0,class:"bimdata-list context-menu",style:ce(r.position)},[(B(!0),O(ct,null,St(o.currentCommands,(u,d)=>(B(),W(a,{key:u.label,class:"context-menu__element",onClick:h=>r.executeCommand(u)},{default:V(()=>[r.isGroupIntersection(d)?(B(),O("div",rjt)):ne("",!0),b("div",ajt,K(u.label),1),!u.component&&u.picto?(B(),O("span",ljt,K(u.picto),1)):u.component?(B(),W(s,{key:2,size:"xxs",class:"fill-primary"})):ne("",!0)]),_:2},1032,["onClick"]))),128)),o.asyncPredicateRunning?(B(),O("li",cjt,[D(l)])):ne("",!0)],4)),[[c,r.away]]):ne("",!0)}const djt=z(sjt,[["render",ujt],["__scopeId","data-v-5b87d4a3"]]),hjt={name:"ViewerHeader",inject:["$viewer"],props:{visible:{type:Boolean,default:!0}},setup(){const i=mt("$viewer"),e=Ls(new Map),t=o=>{if(!o.name)throw new TypeError("[Viewer Header] Content must have a name");if(e.has(o.name))throw new Error(`[Viewer Header] Content with name ${o.name} already exists`);e.set(o.name,o)},n=o=>e.has(o)?(e.delete(o),!0):!1;return{logo:i.uiSettings.bimdataLogo!==!1,version:i.uiSettings.version!==!1?i.version:null,headerContent:e,headerRightContentComponents:$e(()=>Array.from(e.values()).filter(o=>o.position==="right").sort((o,r)=>o.order-r.order).map(o=>o.component)),headerLeftContentComponents:$e(()=>Array.from(e.values()).filter(o=>o.position==="left").sort((o,r)=>o.order-r.order).map(o=>o.component)),addContent:t,removeContent:n}}},pjt={class:"viewer-header"},fjt={class:"viewer-header__content"},Ajt={class:"viewer-header__content__left"},mjt={class:"viewer-header__content__right"},gjt={key:0,class:"m-l-6 flex items-center"},vjt={key:1,class:"viewer-header__version"};function yjt(i,e,t,n,o,r){const s=k("BIMDataIllustration");return ft((B(),O("div",pjt,[b("div",fjt,[b("div",Ajt,[(B(!0),O(ct,null,St(n.headerLeftContentComponents,a=>(B(),W(vn(a),{key:a.name}))),128))]),b("div",mjt,[(B(!0),O(ct,null,St(n.headerRightContentComponents,a=>(B(),W(vn(a),{key:a.name}))),128))])]),n.logo||n.version?(B(),O("div",gjt,[n.logo?(B(),W(s,{key:0,name:"logo",width:"30px",height:"30px"})):ne("",!0),n.version?(B(),O("div",vjt,K(n.version),1)):ne("",!0)])):ne("",!0)],512)),[[qt,t.visible]])}const wjt=z(hjt,[["render",yjt],["__scopeId","data-v-5c9ea6b6"]]),Cjt={emits:["resize"],setup(i,{emit:e}){return{onResizerMousedown:n=>{n.preventDefault();let o=n.clientX;const r=a=>{a.preventDefault();const l=a.clientX-o;o=a.clientX,e("resize",l)},s=a=>{a.preventDefault(),window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",s)};window.addEventListener("mousemove",r),window.addEventListener("mouseup",s)}}}},bjt={class:"bimdata-separator"};function xjt(i,e,t,n,o,r){return B(),O("div",bjt,[e[1]||(e[1]=b("div",{class:"bimdata-separator__line"},null,-1)),b("div",{class:"bimdata-separator__resizer",onMousedown:e[0]||(e[0]=(...s)=>n.onResizerMousedown&&n.onResizerMousedown(...s))},null,32)])}const Mjt={components:{Separator:z(Cjt,[["render",xjt],["__scopeId","data-v-79a3b3af"]])},props:{position:{type:String,required:!0,validator(i){return["left","right"].includes(i)}},sidePanel:{type:Object,required:!0,validator(i){if(i.width&&(typeof i.width!="number"||i.width<0))return console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof i.width}`),!1;const e=typeof(i==null?void 0:i.component)=="object";return e||console.error("[GlobalSidePanel] sidePanel must have a component property"),e}}},setup(i){const e=we(null),t=we(i.sidePanel.width??400),n=(o,r=1)=>{const s=t.value+o*r;t.value=Math.max(0,s)};return wt(()=>i.sidePanel,()=>{Object.defineProperty(i.sidePanel,"width",{get(){return t.value},set(o){if(typeof o!="number"||o<=0){console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof o}`);return}t.value=o}}),Object.defineProperty(i.sidePanel,"componentInstance",{get(){return e.value},enumerable:!0})},{immediate:!0}),{componentInstance:e,width:t,onResize:n}}},Ejt={class:"bimdata-global-side-panel__component"};function Bjt(i,e,t,n,o,r){const s=k("Separator");return B(),O("div",{class:"bimdata-global-side-panel",style:ce(`width: ${n.width}px`)},[t.sidePanel.resizable&&t.position==="right"?(B(),W(s,{key:0,onResize:e[0]||(e[0]=a=>n.onResize(a,-1))})):ne("",!0),b("div",Ejt,[(B(),W(vn(t.sidePanel.component),{ref:"componentInstance"},null,512))]),t.sidePanel.resizable&&t.position==="left"?(B(),W(s,{key:1,onResize:e[1]||(e[1]=a=>n.onResize(a))})):ne("",!0)],4)}const Sjt={name:"BimdataViewer",components:{ContextMenu:djt,ViewerHeader:wjt,ModalManager:ufe,GlobalSidePanel:z(Mjt,[["render",Bjt],["__scopeId","data-v-82d0d4cb"]])},setup(){const i=mt("$viewer"),{globalContext:e,shortcutManager:t}=i;ln(()=>{t&&t.destroy(),e.hub.clear()}),Ti(()=>{i.pluginManager.runPluginsScripts(i)});const n=$e(()=>{var f;return i.uiSettings.bimdataLogo!==!1&&(e.localContexts.length!==1||((f=e.localContexts[0].window)==null?void 0:f.logoAndVersion))}),o=$e(()=>{var f;return i.uiSettings.version!==!1&&(e.localContexts.length!==1||(f=e.localContexts[0].window)!=null&&f.logoAndVersion)?i.version:null}),r=$e(()=>e.leftSidePanel),s=$e(()=>e.rightSidePanel),a=$e(()=>{var m;const f=i.uiSettings.header!==!1,A=e.localContexts.length===1&&((m=e.localContexts[0].window)==null?void 0:m.header)===!1,p=!!(r.value||s.value);return f&&(!A||p)}),l=i.uiSettings.contextMenu!==!1,c=we(null);function u(f){l&&c.value.open(f)}function d(){i.shortcutManager.active=!0}function h(){i.shortcutManager.active=!1}return{Layout:i.layout.areas.component,onContextMenu:u,onMouseenter:d,onMouseleave:h,isHeaderVisible:a,viewerTemplateRef:e.templateRef,modalManagerTemplateRef:e.modalManagerTemplateRef,headerTemplateRef:e.headerTemplateRef,contextMenuTemplateRef:c,contextMenuEnabled:l,bimdataLogoOnSingleWindow:n,viewerVersionOnSingleWindow:o,version:i.version,loading:$e(()=>e.loading),spinner:$e(()=>e.spinner),leftSidePanel:r,rightSidePanel:s}}},Ijt={key:1,class:"global-spinner",style:{"z-index":"3"}},Pjt={key:2,class:"viewer__logo"},Tjt={key:1,class:"version m-t-6"};function kjt(i,e,t,n,o,r){const s=k("ModalManager"),a=k("ContextMenu"),l=k("ViewerHeader"),c=k("GlobalSidePanel"),u=k("BIMDataSpinner"),d=k("BIMDataIllustration");return B(),O("div",{id:"bimdata-viewer",ref:"viewerTemplateRef",class:"bimdata-viewer bimdata-scrollbar",onContextmenu:e[0]||(e[0]=(...h)=>n.onContextMenu&&n.onContextMenu(...h)),onMouseenter:e[1]||(e[1]=(...h)=>n.onMouseenter&&n.onMouseenter(...h)),onMouseleave:e[2]||(e[2]=(...h)=>n.onMouseleave&&n.onMouseleave(...h))},[D(s,{ref:"modalManagerTemplateRef"},null,512),n.contextMenuEnabled?(B(),W(a,{key:0,ref:"contextMenuTemplateRef"},null,512)):ne("",!0),D(l,{ref:"headerTemplateRef",visible:n.isHeaderVisible},null,8,["visible"]),b("div",{class:"bimdata-viewer__content",style:ce(n.isHeaderVisible?"height: calc(100% - var(--bimdata-viewer-header-height, 40px))":"height: 100%")},[n.leftSidePanel?(B(),W(c,{key:0,"side-panel":n.leftSidePanel,position:"left"},null,8,["side-panel"])):ne("",!0),(B(),W(vn(n.Layout),{style:"height: 100%; flex-grow: 1;"})),n.rightSidePanel?(B(),W(c,{key:1,"side-panel":n.rightSidePanel,position:"right"},null,8,["side-panel"])):ne("",!0)],4),n.loading?(B(),O("div",Ijt,[n.spinner&&n.spinner.component?(B(),W(vn(n.spinner.component),kr(ds({key:0},n.spinner.props)),null,16)):(B(),W(u,{key:1,size:"40px",border:"5px"}))])):ne("",!0),!n.isHeaderVisible&&(n.bimdataLogoOnSingleWindow||n.viewerVersionOnSingleWindow)?(B(),O("div",Pjt,[n.bimdataLogoOnSingleWindow?(B(),W(d,{key:0,name:"logo"})):ne("",!0),n.viewerVersionOnSingleWindow?(B(),O("div",Tjt,K(n.version),1)):ne("",!0)])):ne("",!0)],544)}const Rjt=z(Sjt,[["render",kjt]]),Djt=["src"],_jt={class:"bimdata-models__header"},Ljt={key:0,class:"bimdata-models__header__loader"},Fjt={class:"bimdata-models__header__picto"},Ojt={class:"bimdata-models__header__name"},Ujt={key:0,class:"bimdata-models__header__name--empty"},Njt={key:1,class:"bimdata-models__header__name--empty"},Vjt={key:3},Hjt=["onMousemove","onClick"],Afe={__name:"Models",props:{preview:{type:Boolean,default:!1},windowPositioning:{type:Boolean,default:!0},customFilter:{type:Function,default:null},width:{type:String,default:"350px"}},setup(i){const e=i,t=mt("$viewer"),n=we(),o=we(0),r=we(0),s=we(),a=pn([]),l=we(!1),c=$e(()=>t.localContext.loadedModels),u=$e(()=>t.localContext.loadedModelIds),d=$e(()=>t.localContext.loadingModelIds),h=$e(()=>t.localContext.multiModel),f=$e(()=>(e.customFilter?a.value.filter(e.customFilter):a.value).map(E=>c.value.find(S=>{var T;return((T=S.document)==null?void 0:T.head_id)!=null&&S.document.head_id===E.document.id})??E)),A=M=>u.value.includes(M),p=M=>d.value.includes(M),m=$e(()=>{var S;const{x:M,y:E}=((S=s.value)==null?void 0:S.getBoundingClientRect())??{x:0,y:0};return`top:${r.value-E}px; left:${o.value-M}px;`}),g=M=>{!h.value&&A(M.id)||d.value.length>0||(t.localContext.loadedModelIds.includes(M.id)?t.localContext.unloadModels([M.id]):t.localContext.loadModels([M.id]))},w=M=>{switch(M){case"C":return"success";case"E":return"failed";case"P":case"I":return"sandglass"}},y=(M,E)=>{M!=null&&M.viewer_360_file&&(o.value=E.clientX,r.value=E.clientY),n.value=M==null?void 0:M.viewer_360_file},v=async M=>{l.value=!0;try{return(await t.api.apiClient.modelApi.getModels(t.api.cloudId,t.api.projectId,void 0,void 0,M)).filter(S=>t.state.models.some(T=>T.archived)||!S.archived).sort(Cu("updated_at",!1))}catch(E){console.error("[Models] Cannot get project models. Error: ",E)}finally{l.value=!1}return[]},x=M=>{var E;return((E=M.children)==null?void 0:E.some(S=>A(S.id)))??!1};return v(t.localContext.modelTypes).then(M=>{a.value=M}),(M,E)=>{const S=k("BIMDataSpinner"),T=k("BIMDataIconModel3D"),P=k("BIMDataTextbox"),I=k("BIMDataCheckbox"),R=k("BIMDataRadio"),L=k("BIMDataIcon"),U=k("BIMDataDropdownList");return B(),O("div",{ref_key:"templateRef",ref:s,class:ue(["bimdata-models",{"bimdata-models--window-positioning":i.windowPositioning}])},[n.value?(B(),O("div",{key:0,class:"bimdata-models__preview",style:ce(m.value)},[b("img",{src:n.value},null,8,Djt)],4)):ne("",!0),D(U,{style:ce(`--bimdata-models-width: ${i.width};`),width:i.width,list:f.value,"element-key":"id","per-page":40,loading:l.value,class:"bimdata-models__list",disabled:f.value.length===0,onElementClick:g},{header:V(({isOpen:H})=>[b("div",_jt,[l.value||d.value.length>0?(B(),O("div",Ljt,[D(S)])):(B(),O(ct,{key:1},[b("div",Fjt,[D(T)]),b("div",{class:ue(["bimdata-models__header__number bimdata-info-length",{"bimdata-models__header__number--empty":u.value.length===0}])},[b("span",null,K(u.value.length),1)],2),b("div",Ojt,[f.value.length===0?(B(),O("span",Ujt,K(M.$t("model.no_model")),1)):u.value.length===0?(B(),O("span",Njt,K(M.$t("model.no_loaded_model")),1)):u.value.length===1?(B(),W(P,{key:2,text:c.value[0].name,tooltip:!H},null,8,["text","tooltip"])):u.value.length>1?(B(),O("span",Vjt,K(M.$t("model.selected_models")),1)):ne("",!0)])],64))])]),element:V(({element:H,close:N})=>[b("div",{class:"bimdata-models__model",onMousemove:Q=>i.preview&&y(H,Q),onMouseout:E[0]||(E[0]=Q=>i.preview&&y()),onClick:()=>{!h.value&&!A(H.id)&&N()}},[h.value?(B(),W(I,{key:0,"model-value":A(H.id)||x(H),disabled:H.status!=="C"||d.value.length>0},null,8,["model-value","disabled"])):(B(),W(R,{key:1,"model-value":A(H.id)||x(H),disabled:H.status!=="C"||d.value.length>0},null,8,["model-value","disabled"])),D(L,{margin:"0 calc(var(--spacing-unit) / 2)",name:w(H.status),size:"xs",class:ue({"fill-success":H.status==="C","fill-high":H.status==="E"})},null,8,["name","class"]),D(P,{class:ue({"bimdata-models__model__name":!0,"bimdata-models__model__name--disabled":H.status!=="C"||d.value.length>0}),text:H.name,width:`calc(100% -
5509
+ `),onMouseenter:e[0]||(e[0]=(...h)=>n.onMouseEnter&&n.onMouseEnter(...h)),onMouseleave:e[1]||(e[1]=(...h)=>n.onMouseLeave&&n.onMouseLeave(...h))},[D(s,{ref:"modalManagerTemplateRef"},null,512),b("div",Uzt,[n.windowPlugins.leftSidePanel?(B(),W(a,{key:0,plugin:n.windowPlugins.leftSidePanel},null,8,["plugin"])):ne("",!0),b("div",Nzt,[(B(!0),O(ct,null,St(n.windowPlugins.free,h=>(B(),W(l,{key:h.name,class:ue({"window-container__content__center__viewer":h.isViewer}),plugin:h},null,8,["class","plugin"]))),128)),D(c,{position:"left",plugins:n.windowPlugins.leftButtonColumn},null,8,["plugins"]),D(c,{position:"right",plugins:n.windowPlugins.rightButtonColumn},null,8,["plugins"])]),n.windowPlugins.rightSidePanel?(B(),W(a,{key:1,plugin:n.windowPlugins.rightSidePanel},null,8,["plugin"])):ne("",!0)]),n.loading?(B(),O("div",Vzt,[n.spinner&&n.spinner.component?(B(),W(vn(n.spinner.component),kr(ds({key:0},n.spinner.props)),null,16)):(B(),W(u,{key:1,size:"20px",border:"3px"}))])):ne("",!0),n.layoutSettingsDisplayed?(B(),O("div",Hzt,[D(d)])):ne("",!0)],36)}const jzt=z(Ozt,[["render",zzt]]);class Gzt{constructor(e=!0){const t=_Ht(FV,null,{resizable:e});t.registerContent("default",jzt),this.settings=Ls({edit:!1,swap:!1,full:!1}),this.areas=t}get resizable(){return this.areas.resizable}set resizable(e){this.areas.resizable=e}apply(e=null){this.areas.layout=e?LHt(e):null}copy(e,t=!0){return FHt(this.areas.layout,e,t)}open({ratio:e,direction:t,insertAfter:n,windowName:o=null,windowState:r=null,localContextId:s=null}={}){const a=o?{options:{windowName:o,windowState:r}}:null;return s===null?this.areas.splitLayout(e,t,n,a):this.areas.split(s,e,t,n,a)}swap(e,t){return this.areas.swap(e,t)}close(e){return this.areas.delete(e)}compare(e,t){var n,o;if(!e&&!t)return!0;if(!e||!t)return!1;if(typeof e=="string"&&typeof t=="string")return e===t;if(typeof e=="string"||typeof t=="string")return!1;if(e.windowName&&t.windowName){if(e.windowName!==t.windowName)return!1;const r=new Set((n=e.windowState)==null?void 0:n.modelIds),s=new Set((o=t.windowState)==null?void 0:o.modelIds);return r.size===s.size&&[...r].every(l=>s.has(l))}return e.windowName||t.windowName||e.direction!==t.direction||e.children.length!==t.children.length?!1:e.children.every((r,s)=>this.compare(r,t.children[s]))}}const qzt={name:"@bimdata/viewer",type:"module",version:"2.7.0",description:"A customizable BIM viewer.",keywords:["bim","viewer","bimdata","ifc","bcf"],types:"./index.d.ts",author:"BIMData.io",homepage:"https://developers.bimdata.io/viewer/index.html",bugs:{email:"support@bimdata.io"},browserslist:["last 2 chrome version","last 2 firefox version"],main:"dist/bimdata-viewer.esm.min.js",module:"dist/bimdata-viewer.esm.min.js",scripts:{dev:"vite -c build/vite.config.dev.js",build:"node scripts/build.mjs","build:prod":"vite build -c build/vite.config.prod.js && esbuild dist/bimdata-viewer.esm.min.js --minify --outfile=dist/bimdata-viewer.esm.min.js --allow-overwrite","build:offline":"vite build -c build/vite.config.offline.js && esbuild dist/bimdata-viewer.offline.esm.min.js --minify --outfile=dist/bimdata-viewer.offline.esm.min.js --allow-overwrite","build:runtime":"vite build -c build/vite.config.runtime.js && esbuild dist/bimdata-viewer.runtime.esm.min.js --minify --outfile=dist/bimdata-viewer.runtime.esm.min.js --allow-overwrite","build:split":"vite build -c build/vite.config.split.js && esbuild dist/bimdata-viewer.split.esm.min.js --minify --outfile=dist/bimdata-viewer.split.esm.min.js --allow-overwrite","build:umd":"vite build -c build/vite.config.umd.js && esbuild dist/bimdata-viewer.umd.cjs --minify --outfile=dist/bimdata-viewer.umd.min.cjs","cy:run":"cypress run","cy:open":"cypress open",prebuild:"rm -rf dist",prepublishOnly:"npm run build","semantic-release":"semantic-release",serve:"http-server -c-1 --silent",test:"npm run test:unit & npm run build & npm run test:e2e","test:unit":"jest","test:e2e":"start-server-and-test 'npm run serve -- -p 8080' http://localhost:8080 cy:run","test:e2e-dev":"start-server-and-test 'npm run serve -- -p 8080' http://localhost:8080 cy:open",version:"echo $npm_package_version",ts:"tsc"},files:["dist/*","types/*","CHANGELOG.md","README.md","package.json","package-lock.json","index.d.ts"],devDependencies:{"@babel/preset-env":"^7.26.0","@bimdata/2d-engine":"2.6.1","@bimdata/areas-next":"0.1.15","@bimdata/bcf-components":"6.4.4","@bimdata/components":"1.7.2","@bimdata/design-system":"2.2.1-beta.7","@bimdata/typescript-fetch-api-client":"10.17.2","@eslint/eslintrc":"^3.2.0","@eslint/js":"^9.15.0","@photo-sphere-viewer/core":"^5.11.1","@rollup/plugin-alias":"5.1.1","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-commonjs":"^28.0.1","@rollup/plugin-image":"^3.0.3","@rollup/plugin-replace":"^6.0.1","@semantic-release/changelog":"^6.0.3","@semantic-release/commit-analyzer":"^13.0.0","@semantic-release/git":"^10.0.1","@semantic-release/github":"^11.0.1","@semantic-release/npm":"^12.0.1","@semantic-release/release-notes-generator":"^14.0.1","@vitejs/plugin-vue":"5.2.1","@vue/vue3-jest":"^29.2.6","@xeokit/xeokit-sdk":"git+https://git@github.com/Amoki/xeokit-sdk.git#f81ebaeda39e03d96f75785b257378e420416e0d","@zip.js/zip.js":"^2.7.53",async:"^3.2.6",autoprefixer:"^10.4.20","babel-core":"^7.0.0-bridge.0","babel-jest":"^29.7.0","conventional-changelog-eslint":"^6.0.0",cypress:"^13.16.0",esbuild:"^0.25.0",eslint:"9.15.0","eslint-config-prettier":"9.1.0","eslint-plugin-cypress":"4.1.0","eslint-plugin-jest":"28.9.0","eslint-plugin-prettier":"5.2.1","eslint-plugin-vue":"9.31.0","form-data":"^4.0.1",globals:"^15.12.0","html-to-image":"^1.11.11",html2canvas:"1.4.1","http-server":"^14.1.1",jest:"^29.7.0","jest-environment-jsdom":"^29.7.0","jest-extended":"^4.0.2",jspdf:"^2.5.2",lodash:"^4.17.21","node-fetch":"^3.3.2","pdfjs-dist":"^4.8.69",postcss:"^8.4.49",prettier:"^3.4.1",querystring:"^0.2.1","sass-embedded":"^1.81.0","semantic-release":"^24.2.0",sinon:"^19.0.2","start-server-and-test":"^2.0.8",vite:"6.0.11","vite-plugin-css-injected-by-js":"^3.5.2",vue:"3.5.13","vue-eslint-parser":"^9.4.3","vue-i18n":"^10.0.4"}};class Qzt{constructor({plugins:e,api:t,ui:n,locale:o="fr"}){this.pluginManager=new nUt(e),this.windowManager=new sUt,this.windowManager.registerAndAddPluginsToWindows([...this.pluginManager.registeredPlugins.values()]),this.api=new FVt(t),this.globalContext=new X3e(this),this.state=YVt(this),this.shortcutManager=I1e(this.state),this.uiSettings=n||{},this.i18n=new Z3e(o),this._contextMenu=null,this.layout=new Gzt(this.uiSettings.resizable!==!1),this.localContext=null,window.$viewer=this}get version(){return qzt.version}get locale(){return this.i18n.locale}get contextMenu(){return this._contextMenu||B1e}set contextMenu(e){this._contextMenu=e}get registeredWindows(){return[...this.windowManager.registeredWindows.keys()]}get registeredPlugins(){return[...this.pluginManager.registeredPlugins.keys()]}get pluginsCfg(){return this.pluginManager.cfg}registerPlugin(e){this.pluginManager.registerPlugin(e),this.windowManager.registerAndAddPluginsToWindows([e])}}function Kzt(i,e={}){e.backgroundColor&&(i.style.setProperty("--bimdata-viewer-background-color",e.backgroundColor),e.backgroundColor==="transparent"&&i.style.setProperty("--areas-separator-color","transparent")),e.colorPrimary&&i.style.setProperty("--color-primary",e.colorPrimary),e.colorPrimaryLighter&&i.style.setProperty("--color-primary-lighter",e.colorPrimaryLighter),e.colorPrimaryLight&&i.style.setProperty("--color-primary-light",e.colorPrimaryLight),e.colorPrimaryDark&&i.style.setProperty("--color-primary-dark",e.colorPrimaryDark),e.colorSecondary&&i.style.setProperty("--color-secondary",e.colorSecondary),e.colorSecondaryLighter&&i.style.setProperty("--color-secondary-lighter",e.colorSecondaryLighter),e.colorSecondaryLight&&i.style.setProperty("--color-secondary-light",e.colorSecondaryLight),e.colorSecondaryDark&&i.style.setProperty("--color-secondary-dark",e.colorSecondaryDark),e.colorSilverLight&&i.style.setProperty("--color-silver-light",e.colorSilverLight),e.colorSilver&&i.style.setProperty("--color-silver",e.colorSilver),e.colorSilverDark&&i.style.setProperty("--color-silver-dark",e.colorSilverDark),e.colorGraniteLight&&i.style.setProperty("--color-granite-light",e.colorGraniteLight),e.colorGranite&&i.style.setProperty("--color-granite",e.colorGranite),e.colorSuccess&&i.style.setProperty("--color-success",e.colorSuccess),e.colorSuccessLighter&&i.style.setProperty("--color-success-Lighter",e.colorSuccessLighter),e.colorSuccessLight&&i.style.setProperty("--color-success-Light",e.colorSuccessLight),e.colorSuccessDark&&i.style.setProperty("--color-success-Dark",e.colorSuccessDark),e.colorWarning&&i.style.setProperty("--color-warning",e.colorWarning),e.colorWarningLighter&&i.style.setProperty("--color-warning-Lighter",e.colorWarningLighter),e.colorWarningLight&&i.style.setProperty("--color-warning-Light",e.colorWarningLight),e.colorWarningDark&&i.style.setProperty("--color-warning-Dark",e.colorWarningDark),e.colorHigh&&i.style.setProperty("--color-high",e.colorHigh),e.colorHighLighter&&i.style.setProperty("--color-high-lighter",e.colorHighLighter),e.colorHighLight&&i.style.setProperty("--color-high-light",e.colorHighLight),e.colorHighDark&&i.style.setProperty("--color-high-dark",e.colorHighDark),e.colorText&&i.style.setProperty("--color-text",e.colorText),(!e.backgroundColor||e.backgroundColor!=="transparent")&&i.style.setProperty("--areas-separator-color","rgba(216, 216, 216, 1)"),e.headerHeight!=null&&i.style.setProperty("--bimdata-viewer-header-height",e.headerHeight),i.style.setProperty("--areas-background-color","transparent")}const Jzt=Object.freeze({25:"GUEST",50:"USER",100:"ADMIN"}),Mm=Object.freeze({READ:"read",WRITE:"write"});function pfe(i){const e={};return i.forEach(t=>{const[n,o]=t.split(":");e[n]?e[n].push(o):e[n]=[o]}),e}const Zzt={token_scopes:[],usable_scopes:[],user_role:25};function ffe(i=Zzt){var n,o,r,s,a,l;const e=pfe(i.token_scopes),t=pfe(i.usable_scopes);return{...Mq(i),tokenScopes:e,usableScopes:t,userRole:Jzt[i.user_role],user:i.user?Mq(i.user):null,hasBcfReadPermission:((n=t.bcf)==null?void 0:n.includes(Mm.READ))??!1,hasBcfWritePermission:((o=t.bcf)==null?void 0:o.includes(Mm.WRITE))??!1,hasModelReadPermission:((r=t.model)==null?void 0:r.includes(Mm.READ))??!1,hasModelWritePermission:((s=t.model)==null?void 0:s.includes(Mm.WRITE))??!1,hasDocReadPermission:((a=t.document)==null?void 0:a.includes(Mm.READ))??!1,hasDocWritePermission:((l=t.document)==null?void 0:l.includes(Mm.WRITE))??!1}}const Wzt={de:{BcfComponents:{BcfFilters:{filtersButton:"Filter",filtersTitle:"Filter",priorityLabel:"Priorität",statusLabel:"Status",assignedToLabel:"Zugewiesen an",creatorsLabel:"Erstellt von",tagsLabel:"Tags",resetButton:"Zurücksetzen",searchButton:"Suchen",undefined:"Nicht definiert",datePlaceholder:"Erstellungsdatum"},BcfSettings:{goBackButton:"Zurück",title:"BCF-Parameter",text:"Erstellen, füllen und listen Sie die BCF-Einstellungen auf, die Sie für dieses Projekt haben möchten.",validateButton:"Die BCF-Parameter anerkennen"},BcfStatistics:{emptyText:"Fügen Sie Fragen hinzu, um zugehörige Statistiken hier anzuzeigen.",issues:"Probleme",extension:{Priority:"Priorität",PriorityNotDefined:"Keine Priorität",PriorityTitle:"Prioritäten",Status:"Status",StatusNotDefined:"Kein Status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priorität:",noPriority:"Keine",assignedTo:"Zugewiesen an :",elements:"Elemente",notSpecified:"Nicht definiert",see:"Anzeigen"},BcfTopicCreationCard:{text:"Ein neues BCF-Thema erstellen",createBcfSideTitle:"Ein Problem melden"},BcfTopicForm:{dragDropImageText:"Bitte wählen Sie eine Datei aus.",addObjectButton:"Objekt",addAnnotationButton:"Annotation",annotationButtonTooltip:"Zu diesem Thema gibt es derzeit keine Ansichten.",addPictureButton:"Fügen Sie ein Bild hinzu.",titlePlaceholder:"Titel *",titleErrorMessage:"Titel fehlt",typeLabel:"Typ",priorityLabel:"Priorität",statusLabel:"Status",stageLabel:"Phase",assignedToLabel:"Zugewiesen an",dueDateLabel:"Fälligkeitsdatum (TT.MM.JJJJ)",descriptionLabel:"Beschreibung",labelsLabel:"Tags",createButton:"Bestätigen",updateButton:"Änderungen übernehmen",modalText:"Sie sind dabei, die Bearbeitung der Ausgabe {Name} zu beenden, aber es gibt noch ungespeicherte Änderungen.",cancelButton:"Änderungen verwerfen",continueButton:"Änderungen fortsetzen",createTitle:"Ein Problem melden",dragDropImageTextTablet:"Foto machen",takeSnapshot:"Mach einen Schnappschuss",importFile:"Eine Datei importieren",searchPlaceholder:"Suchen",emptySearch:"kein Ergebnis"},BcfTopicOverview:{openViewer:"Im Viewer öffnen",openViewerNoModels:"Es sind keine Vorlagen zur Ansicht bereit",elements:"{count} Elemente",noElements:"kein Element",type:"Typ",noTypeSpecified:"Kein Typ angegeben",description:"Beschreibung",noDescriptionProvided:"Keine Beschreibung angegeben",assignedTo:"Zugeteilt an",notAssigned:"Nicht zugewiesen",dueDate:"Fälligkeitsdatum",noDueDate:"Kein Fälligkeitsdatum",informations:"Informationen",status:"Status",noStatusSpecified:"Kein Status angegeben",stage:"Phase",noStageProvided:"Keine Phase angegeben",priority:"Priorität",priorityNotDefined:"Nicht definiert",tags:"Tags",noTags:"Keine Tags",commentButton:"Ein Kommentar veröffentlichen",deleteText:"Sie löschen jetzt {Name}",deleteBcfButton:"Dieses BCF löschen",keepBcfButton:"Dieses BCF beibehalten",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Priorität",status:"Status",title:"Titel",creator:"Autor",date:"Datum"}},BcfTopicActionsCell:{seeButton:"Anzeigen"},BcfTopicComments:{commentButton:"Ein Kommentar verfassen",commentLabel:"Ein Kommentar verfassen",commentText:"Kommentar",cancelButton:"Abbrechen",publishButton:"Veröffentlichen",commentsText:"Kommentare",deleteCommentText:"Diesen Kommentar löschen?",deleteButton:"Löschen",takeSnapshot:"Mach einen Schnappschuss"},BcfTopicPriorityCell:{noPriority:"Keine"},SettingCard:{addButton:"ein Element hinzufügen",cancelButton:"Abbrechen",validateButton:"Bestätigen",deleteExtensionText:"Diesen Parameter löschen",deleteButton:"Löschen",title:{Priority:"Prioritäten",Label:"Tags",Status:"Status",Type:"Typen",Stage:"Phasen"},input:{Priority:"Eine neue Priorität hinzufügen",Label:"Ein neues Etikett hinzufügen",Status:"Einen neuen Status hinzufügen",Type:"Einen neuen Typ hinzufügen",Stage:"Eine neue Phase hinzufügen"},text:{Priority:"Liste der Prioritäten",Label:"Liste von Tags",Status:"Liste der Status",Type:"Liste der Typen",Stage:"Liste der Phasen"}}}},en:{BcfComponents:{BcfFilters:{filtersButton:"Filters",filtersTitle:"Filters",priorityLabel:"Priority",statusLabel:"Status",assignedToLabel:"Assigned to",creatorsLabel:"Created by",tagsLabel:"Tags",resetButton:"Reset",searchButton:"Search",undefined:"Not defined",datePlaceholder:"Creation date"},BcfSettings:{goBackButton:"Back",title:"BCF Settings",text:"Create, enter in, and list the BCF settings you would like to have for this project",validateButton:"Validate BCF settings"},BcfStatistics:{emptyText:"Add BCF Topics to start to have some stats here.",issues:"issues",extension:{Priority:"Priority",PriorityNotDefined:"No priority",PriorityTitle:"Priorities",Status:"Status",StatusNotDefined:"No status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priority: ",noPriority:"None",assignedTo:"Assigned to: ",elements:"Elements",notSpecified:"Not specified",see:"See"},BcfTopicCreationCard:{text:"Create a new BCF topic",createBcfSideTitle:"Report a problem"},BcfTopicForm:{dragDropImageText:"Please select a file",addObjectButton:"Object",addAnnotationButton:"Annotation",annotationButtonTooltip:"This topic has no viewpoint",addPictureButton:"Add a picture",titlePlaceholder:"Title *",titleErrorMessage:"Missing title",typeLabel:"Type",priorityLabel:"Priority",statusLabel:"Status",stageLabel:"Stage",assignedToLabel:"Assigned to",dueDateLabel:"Due date",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Validate",updateButton:"Modify this BCF",modalText:"You are about to quit editing issue {name} but there are unsaved changes.",cancelButton:"Discard changes",continueButton:"Continue editing",createTitle:"Report a problem",dragDropImageTextTablet:"Take a picture",takeSnapshot:"Take a snapshot",importFile:"Import a file",searchPlaceholder:"Search",emptySearch:"No result"},BcfTopicOverview:{openViewer:"Open in viewer",openViewerNoModels:"No model to open",elements:"{count} Elements",noElements:"No element",type:"Type",noTypeSpecified:"No type specified",description:"Description",noDescriptionProvided:"No description provided",assignedTo:"Assigned to",notAssigned:"Not assigned",dueDate:"Due date",noDueDate:"No due date",informations:"Informations",status:"Status",noStatusSpecified:"No status specified",stage:"Stage",noStageProvided:"No stage provided",priority:"Priority",priorityNotDefined:"Not defined",tags:"Tags",noTags:"No tags",commentButton:"Post a comment",deleteText:"You are about to delete {name}",deleteBcfButton:"Delete this BCF",keepBcfButton:"Keep this BCF",author:"Author"},BcfTopicsTable:{headers:{index:"#",priority:"Priority",status:"Status",title:"Title",creator:"Author",date:"Date"}},BcfTopicActionsCell:{seeButton:"See"},BcfTopicComments:{commentButton:"Post a comment",commentLabel:"Post a comment",commentText:"Comment",cancelButton:"Cancel",publishButton:"Publish",commentsText:"Comments",deleteCommentText:"Delete this comment ?",deleteButton:"Delete",takeSnapshot:"Take a snapshot"},BcfTopicPriorityCell:{noPriority:"None"},SettingCard:{addButton:"add an element",cancelButton:"Cancel",validateButton:"Validate",deleteExtensionText:"Remove this setting",deleteButton:"Delete",title:{Priority:"Priorities",Label:"Labels",Status:"Status",Type:"Types",Stage:"Stages"},input:{Priority:"Add a new priority",Label:"Add a new label",Status:"Add new status",Type:"Add a new type",Stage:"Add a new stage"},text:{Priority:"Priority list",Label:"Labels list",Status:"Status list",Type:"Type list",Stage:"Stage list"}}}},es:{BcfComponents:{BcfFilters:{filtersButton:"Filtros",filtersTitle:"Filtros",priorityLabel:"Prioridad",statusLabel:"Estado",assignedToLabel:"Asignado a",creatorsLabel:"Creado por",tagsLabel:"Etiquetas:",resetButton:"Restablecer",searchButton:"Buscar en",undefined:"No definido",datePlaceholder:"Fecha de creación"},BcfSettings:{goBackButton:"Volver",title:"Parámetros del BCF",text:"Cree, rellene y enumere los parámetros del BCF que desea tener en este proyecto",validateButton:"Validar los parámetros del BCF"},BcfStatistics:{emptyText:"Añada preguntas para ver las estadísticas asociadas aquí.",issues:"problemas",extension:{Priority:"Prioridad",PriorityNotDefined:"Sin prioridad",PriorityTitle:"Prioridades",Status:"Estado",StatusNotDefined:"Sin estado",StatusTitle:"Estatutos"}},BcfTopicCard:{priority:"Prioridad :",noPriority:"Sin",assignedTo:"Asignado a :",elements:"Elementos",notSpecified:"No definido",see:"Ver"},BcfTopicCreationCard:{text:"Crear un nuevo tema BCF",createBcfSideTitle:"Informar de un problema"},BcfTopicForm:{dragDropImageText:"Seleccione un archivo",addObjectButton:"Objeto",addAnnotationButton:"Anotación",annotationButtonTooltip:"Actualmente este tema no posee ningún punto de vista",addPictureButton:"Añadir una imagen",titlePlaceholder:"Título *",titleErrorMessage:"Falta el título",typeLabel:"Tipo",priorityLabel:"Prioridad",statusLabel:"Estado",stageLabel:"Fase",assignedToLabel:"Asignado a",dueDateLabel:"Fecha de vencimiento (DD/MM/AAAA)",descriptionLabel:"Descripción",labelsLabel:"Etiquetas",createButton:"Validar",updateButton:"Modificar este BCF",modalText:"Está a punto de salir de la edición del problema de {name} pero hay cambios sin guardar.",cancelButton:"Cancelar los cambios",continueButton:"Continuar con los cambios",createTitle:"Informar de un problema",dragDropImageTextTablet:"Tomar una fotografía",takeSnapshot:"Tomar un snapshot",importFile:"Importar un archivo",searchPlaceholder:"Buscar",emptySearch:"No hay resultados"},BcfTopicOverview:{openViewer:"Abrir en el visor",openViewerNoModels:"No hay ningún modelo listo para la visualización",elements:"{count} Elementos",noElements:"Ningún elemento",type:"Tipo",noTypeSpecified:"No se especifica el tipo",description:"Descripción",noDescriptionProvided:"No hay descripción",assignedTo:"Asignado a",notAssigned:"No asignado",dueDate:"Plazo",noDueDate:"Sin fecha de vencimiento",informations:"Información",status:"Estado",noStatusSpecified:"No se especifica el estado",stage:"Fase",noStageProvided:"No se indica ninguna fase",priority:"Prioridad",priorityNotDefined:"No definido",tags:"Etiquetas",noTags:"Sin etiquetas",commentButton:"Publicar un comentario",deleteText:"Estás a punto de borrar {name}",deleteBcfButton:"Borrar este BCF",keepBcfButton:"Mantenga este BCF",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Prioridad",status:"Estado",title:"Título",creator:"Autor",date:"Fecha"}},BcfTopicActionsCell:{seeButton:"Ver"},BcfTopicComments:{commentButton:"Publicar un comentario",commentLabel:"Publicar un comentario",commentText:"Comentario",cancelButton:"Cancelar",publishButton:"Publicar",commentsText:"comentarios",deleteCommentText:"¿Borrar este comentario?",deleteButton:"Borrar",takeSnapshot:"Tomar un snapshot"},BcfTopicPriorityCell:{noPriority:"Sin"},SettingCard:{addButton:"añadir un elemento",cancelButton:"Cancelar",validateButton:"Validar",deleteExtensionText:"Borrar esta configuración",deleteButton:"Borrar",title:{Priority:"Prioridades",Label:"Etiquetas:",Status:"Estatutos",Type:"Tipos",Stage:"Fases"},input:{Priority:"Añadir una nueva prioridad",Label:"Añadir una nueva etiqueta",Status:"Añadir un nuevo estado",Type:"Añadir un nuevo tipo",Stage:"Añadir una nueva fase"},text:{Priority:"Lista de prioridades",Label:"Lista de etiquetas",Status:"Lista de estatutos",Type:"Lista de tipos",Stage:"Lista de fases"}}}},fr:{BcfComponents:{BcfFilters:{filtersButton:"Filtres",filtersTitle:"Filtres",priorityLabel:"Priorité",statusLabel:"Statut",assignedToLabel:"Assigné à",creatorsLabel:"Créé par",tagsLabel:"Tags",resetButton:"Réinitialiser",searchButton:"Rechercher",undefined:"Non défini",datePlaceholder:"Date de création"},BcfSettings:{goBackButton:"Retour",title:"Paramètres BCF",text:"Créez, renseignez et listez les paramètres BCF que vous souhaitez avoir sur ce projet",validateButton:"Valider les paramètres BCF"},BcfStatistics:{emptyText:"Ajoutez des questions pour voir les statistiques associées ici.",issues:"problèmes",extension:{Priority:"Priorité",PriorityNotDefined:"Aucune priorité",PriorityTitle:"Priorités",Status:"Statut",StatusNotDefined:"Aucun statut",StatusTitle:"Statuts"}},BcfTopicCard:{priority:"Priorité : ",noPriority:"Aucune",assignedTo:"Assigné à : ",elements:"{n} Élements",notSpecified:"Non défini",see:"Voir"},BcfTopicCreationCard:{text:"Créer un nouveau topic BCF",createBcfSideTitle:"Signaler un problème"},BcfTopicForm:{dragDropImageText:"Veuillez sélectionner un fichier",addObjectButton:"Objet",addAnnotationButton:"Annotation",annotationButtonTooltip:"Ce topic ne possède actuellement aucun point de vue",addPictureButton:"Ajouter une image",titlePlaceholder:"Titre *",titleErrorMessage:"Titre manquant",typeLabel:"Type",priorityLabel:"Priorité",statusLabel:"Statut",stageLabel:"Phase",assignedToLabel:"Assigné à",dueDateLabel:"Date d'échéance",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Valider",updateButton:"Modifier ce BCF",modalText:"Vous êtes sur le point de quitter l'édition de l'issue {name} mais il y'a des modifications non enregistrées.",cancelButton:"Annuler les modifications",continueButton:"Continuer les modifications",createTitle:"Signaler un problème",dragDropImageTextTablet:"Prendre une photo",takeSnapshot:"Prendre un snapshot",importFile:"Importer un fichier",searchPlaceholder:"Rechercher",emptySearch:"Pas de résultat"},BcfTopicOverview:{openViewer:"Ouvrir dans le viewer",openViewerNoModels:"Il n'y a aucun modèle prêt pour une visualisation",elements:"{count} Élements",noElements:"Aucun élément concerné",type:"Type",noTypeSpecified:"Pas de type spécifié",description:"Description",noDescriptionProvided:"Pas de description renseignée",assignedTo:"Assigné à",notAssigned:"Non assigné",dueDate:"Échéance",noDueDate:"Pas de date d'échéance",informations:"Informations",status:"Statut",noStatusSpecified:"Pas de statut spécifié",stage:"Phase",noStageProvided:"Pas de phase renseignée",priority:"Priorité",priorityNotDefined:"Non défini",tags:"Tags",noTags:"Pas de tags",commentButton:"Poster un commentaire",deleteText:"Vous êtes sur le point de supprimer {name}",deleteBcfButton:"Supprimer ce BCF",keepBcfButton:"Conserver ce BCF",author:"Auteur"},BcfTopicsTable:{headers:{index:"#",priority:"Priorité",status:"Statut",title:"Titre",creator:"Auteur",date:"Date"}},BcfTopicActionsCell:{seeButton:"Voir"},BcfTopicComments:{commentButton:"Poster un commentaire",commentLabel:"Poster un commentaire",commentText:"Commentaire",cancelButton:"Annuler",publishButton:"Publier",commentsText:"commentaires",deleteCommentText:"Supprimer ce commentaire ?",deleteButton:"Supprimer",takeSnapshot:"Prendre un snapshot"},BcfTopicPriorityCell:{noPriority:"Aucune"},SettingCard:{addButton:"ajouter un élément",cancelButton:"Annuler",validateButton:"Valider",deleteExtensionText:"Supprimmer ce paramètre",deleteButton:"Supprimer",title:{Priority:"Priorités",Label:"Tags",Status:"Statuts",Type:"Types",Stage:"Phases"},input:{Priority:"Ajouter une nouvelle priorité",Label:"Ajouter un nouveau label",Status:"Ajouter un nouveau statut",Type:"Ajouter un nouveau type",Stage:"Ajouter une nouvelle phase"},text:{Priority:"Liste des priorités",Label:"Liste des tags",Status:"Liste des statuts",Type:"Liste des types",Stage:"Liste des phases"}}}},it:{BcfComponents:{BcfFilters:{filtersButton:"Filtri",filtersTitle:"Filtri",priorityLabel:"Priorità",statusLabel:"Stato",datePlaceholder:"Data di creazione",assignedToLabel:"Assegnato a",creatorsLabel:"Creato da",tagsLabel:"Etichette",resetButton:"Ripristina",searchButton:"Cerca",undefined:"Non definito"},BcfSettings:{goBackButton:"Indietro",title:"Parametri BCF",text:"Creare, notificare e elencare i parametri BCF che si desidera avere su questo progetto",validateButton:"Conferma i parametri BCF"},BcfStatistics:{emptyText:"Aggiungi delle domande per vedere le statistiche associate qui.",issues:"problemi",extension:{Priority:"Priorità",PriorityNotDefined:"Nessuna priorità",PriorityTitle:"Priorità",Status:"Stato",StatusNotDefined:"Nessuno stato",StatusTitle:"Stati"}},BcfTopicCard:{priority:"Priorità:",noPriority:"Nessuno",assignedTo:"Assegnato a:",elements:"Elementi",noElements:"0 elementi",notSpecified:"Non definito",see:"Visualizza"},BcfTopicCreationCard:{text:"Crea un nuovo topic BCF",createBcfSideTitle:"Segnala un problema"},BcfTopicForm:{dragDropImageText:"Selezionare un file",addObjectButton:"Oggetto",addAnnotationButton:"Annotazione",annotationButtonTooltip:"Attualmente questo argomento non presenta alcun punto di vista",addPictureButton:"Aggiungere un'immagine",titlePlaceholder:"Titolo *",titleErrorMessage:"Titolo mancante",typeLabel:"Tipo",priorityLabel:"Priorità",statusLabel:"Stato",stageLabel:"Fase",assignedToLabel:"Assegnato a",dueDateLabel:"Data di scadenza",descriptionLabel:"Descrizione",labelsLabel:"Tag",createButton:"Conferma",updateButton:"Modificare questo BCF",modalText:"State per abbandonare la modifica di {name} ma ci sono modifiche non salvate.",cancelButton:"Annullare le modifiche",continueButton:"Continuare le modifiche",createTitle:"Segnala un problema"},BcfTopicOverview:{openViewer:"Apri nel visualizzatore",openViewerNoModels:"Non esistono modelli pronti per la visualizzazione",elements:"{count} Elementi",noElements:"Nessun elemento",type:"Tipo",noTypeSpecified:"Nessun tipo specificato",description:"Descrizione",noDescriptionProvided:"Nessuna descrizione inserita",assignedTo:"Assegnato a",notAssigned:"Non assegnato",dueDate:"Scadenza",noDueDate:"Nessuna data di scadenza",informations:"Informazioni",status:"Stato",noStatusSpecified:"Nessuno stato specificato",stage:"Fase",noStageProvided:"Nessuna fase inserita",priority:"Priorità",priorityNotDefined:"Non definita",tags:"Etichette",noTags:"Nessuna etichetta",commentButton:"Pubblica un commento",deleteText:"Stai per eliminare {name}",deleteBcfButton:"Elimina questo BCF",keepBcfButton:"Conserva questo BCF",author:"Autore"},BcfTopicsTable:{headers:{index:"#",priority:"Priorità",status:"Stato",title:"Titolo",creator:"Autore",date:"Data"}},BcfTopicActionsCell:{seeButton:"Visualizza"},BcfTopicComments:{commentButton:"Pubblica un commento",commentLabel:"Pubblica un commento",commentText:"Commento",cancelButton:"Annulla",publishButton:"Pubblica",commentsText:"commenti",deleteCommentText:"Eliminare questo commento?",deleteButton:"Elimina"},BcfTopicPriorityCell:{noPriority:"Nessuno"},SettingCard:{addButton:"aggiungi un elemento",cancelButton:"Annulla",validateButton:"Conferma",deleteExtensionText:"Elimina questo parametro",deleteButton:"Elimina",title:{Priority:"Priorità",Label:"Etichette",Status:"Stati",Type:"Tipi",Stage:"Fasi"},input:{Priority:"Aggiungi una nuova priorità",Label:"Aggiungi una nuova etichetta",Status:"Aggiungi un nuovo stato",Type:"Aggiungi un nuovo tipo",Stage:"Aggiungi una nuova fase"},text:{Priority:"Elenco delle priorità",Label:"Elenco delle etichette",Status:"Elenco degli stati",Type:"Elenco dei tipi",Stage:"Elenco delle fasi"}}}}},Xzt=({apiClient:i,fetchUsers:e,i18nPlugin:t}={})=>({install(n){i?fn.setup({apiClient:i,fetchUsers:e}):console.error("[BCF Components Plugin] No api client provided. You must provide an api client for the components to work properly."),t?Object.entries(Wzt).forEach(([o,r])=>{t.global.mergeLocaleMessage(o,r)}):console.warn("[BCF Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly."),Object.entries(Sye).forEach(([o,r])=>{n.component(o,r)})}}),Yzt={de:{BuildingMaker:{title:"Building Maker",back:"Zurück",list:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschließend Ihre PDFs herunter.",createButton:"Neues Projekt",updateButton:"Umbenennen",deleteButton:"Löschen"},form:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschließend Ihre PDFs herunter.",input:"Name des Gebäudes",error:"Ungültiger Name",createButton:"Erstellen",updateButton:"Bestätigen"},view:{addStoreyButton:"Etage",addPlanButton:"Grundriss",closeButton:"Fertigstellen",submitFilesButton:"Bestätigen"},storeyForm:{title:"Neue Etage",input:"Name",error:"Ungültiger Name",cancelButton:"Abbrechen",submitButton:"Bestätigen"}},FileManager:{creationFormTitle:"Ordner erstellen",renameFormPlaceholder:"Datei- / Ordnernam",nameInputPlaceholder:"Ordnername",emptyFolder:"Dieser Ordner ist leer",newFolderSuccess:"Neuer Ordner erstellt",renameFolderSuccess:"Umbenannter Ordner",deleteFolderSuccess:"Ordner gelöscht",newFileSuccess:"Datei hinzugefügt",renameFileSuccess:"Umbenannte Datei",deleteFileSuccess:"Datei gelöscht",nameInputErrorMessage:"Ungültiger name",cancel:"Abbrechen",submit:"Bestätigen",buttonText:"Neuer Ordner",addFileButtonText:"Datei laden",rename:"Umbenennen",view:"Sehen",download:"Herunterladen",delete:"Löschen",deleteTitle:"Dateien löschen",deleteDetail:"Sie sind im Begriff, die folgenden Dateien / Ordner endgültig zu löschen"}},en:{BIMDataComponents:{t:{back:"Back",cancel:"Cancel",create:"Create",delete:"Delete",download:"Download",finish:"Finish",rename:"Rename",search:"Search",see:"View",storey:"Storey",validate:"Validate"}},BuildingMaker:{title:"Building Maker",list:{text:"Create and edit storeys, then download your PDFs.",new:"New project"},form:{input:"Building name",error:"Invalid"},view:{addStorey:"Add Storey",addFile:"Add File",addPlan:"Add Plan"},storeyForm:{title:"New storey",input:"Name",error:"Invalid name"}},FileManager:{creationFormTitle:"Create folder",renameFormPlaceholder:"Folder/File name",nameInputPlaceholder:"Folder name",emptyFolder:"This folder is empty",newFolderSuccess:"New folder created",renameFolderSuccess:"Folder renamed",deleteFolderSuccess:"Folder deleted",newFileSuccess:"File added",renameFileSuccess:"File renamed",deleteFileSuccess:"File deleted",nameInputErrorMessage:"Invalid name",buttonText:"New folder",addFileButtonText:"Upload a file",deleteTitle:"Deleting Files",deleteDetail:"You are about to permanently delete the following files / folders",dmsRoot:"Root of the project's DMS",pdfPageSelectorTitle:"Select a page"},MetaBuildingStructure:{title:"Meta-Building Structure",tab:{structure:"Structure",zones:"Zones",equipments:"Equipments"},StoreySelector:{placeholder:"Select a storey"}},PhotosphereBuilding:{title:"Photosphere Building"}},es:{BuildingMaker:{title:"Building Maker",back:"Vuelta",list:{text:"Cree y edite los pisos después cargue los PDF.",createButton:"Nuevo proyecto",updateButton:"Renombrar",deleteButton:"Suprimir"},form:{text:"Cree y edite los pisos después cargue los PDF.",input:"Nombre del edificio",error:"Nombre no válido",createButton:"Crear",updateButton:"Validar"},view:{addStoreyButton:"Piso",addPlanButton:"Plano",closeButton:"Terminar",submitFilesButton:"Validar"},storeyForm:{title:"Nuevo piso",input:"Nombre",error:"Nombre no válido",cancelButton:"Anular",submitButton:"Validar"}},FileManager:{creationFormTitle:"Crear un archivo",renameFormPlaceholder:"Nombre de archivo / carpeta",nameInputPlaceholder:"Nombre de la carpeta",emptyFolder:"Esta carpeta está vacía",newFolderSuccess:"Nueva carpeta creada",renameFolderSuccess:"Carpeta renombrada",deleteFolderSuccess:"Carpeta eliminada",newFileSuccess:"Archivo agregado",renameFileSuccess:"Archivo renombrado",deleteFileSuccess:"Archivo eliminado",nameInputErrorMessage:"Nombre inválida",cancel:"Cancelar",submit:"Validar",buttonText:"Carpeta nueva",addFileButtonText:"Cargar un archivo",rename:"Renombrar",view:"Ver",download:"Descargar",delete:"Borrar",deleteTitle:"Eliminar archivos",deleteDetail:"Está a punto de eliminar permanentemente los siguientes archivos / carpetas"}},fr:{BIMDataComponents:{t:{back:"Retour",cancel:"Annuler",create:"Créer",delete:"Supprimer",download:"Télécharger",finish:"Terminer",rename:"Renommer",search:"Rechercher",see:"Voir",storey:"Étage",validate:"Valider"}},BuildingMaker:{title:"Building Maker",list:{text:"Créez et éditez les étages puis téléchagez vos PDF.",new:"Nouveau projet"},form:{input:"Nom du bâtiment",error:"Nom invalide"},view:{addStorey:"Ajouter un Étage",addFile:"Ajouter un fichier",addPlan:"Ajouter un plan"},storeyForm:{title:"Nouvel étage",input:"Nom",error:"Nom invalide"}},FileManager:{creationFormTitle:"Créer un dossier",renameFormPlaceholder:"Nom du fichier/dosier",nameInputPlaceholder:"Nom du dossier",emptyFolder:"Ce dossier est vide",newFolderSuccess:"Nouveau dossier créé",renameFolderSuccess:"Dossier renommé",deleteFolderSuccess:"Dossier supprimé",newFileSuccess:"Fichier ajouté",renameFileSuccess:"Fichier renommé",deleteFileSuccess:"Fichier supprimé",nameInputErrorMessage:"Nom invalide",buttonText:"Nouveau dossier",addFileButtonText:"Charger un fichier",deleteTitle:"Supression de fichiers",deleteDetail:"Vous êtes sur le point de supprimer définitivement les fichiers/dossiers suivants",dmsRoot:"Racine de la GED du projet",pdfPageSelectorTitle:"Sélectionner une page"},MetaBuildingStructure:{title:"Structure Méta-Building",tab:{structure:"Structure",zones:"Zones",equipments:"Équipements"},StoreySelector:{placeholder:"Sélectionner un étage"}},PhotosphereBuilding:{title:"Photosphère Building"}},it:{BuildingMaker:{title:"Building Maker",back:"Reso",list:{text:"Crea e modifica i piani e poi scarica i tuoi PDF.",createButton:"Nuovo progetto",updateButton:"Rinominare",deleteButton:"Eliminare"},form:{text:"Crea e modifica i piani e poi scarica i tuoi PDF.",input:"Nome della costruzione",error:"Nome non corretto",createButton:"Creare",updateButton:"Convalidare"},view:{addStoreyButton:"Piano",addPlanButton:"Mappa",closeButton:"Finire",submitFilesButton:"Convalidare"},storeyForm:{title:"Nuovo piano",input:"Nome",error:"Nome non corretto",cancelButton:"Annullare",submitButton:"Convalidare"}},FileManager:{creationFormTitle:"Crea una cartella",renameFormPlaceholder:"Nome file/cartella",nameInputPlaceholder:"Nome della cartella",emptyFolder:"Questa cartella è vuota",newFolderSuccess:"Nuova cartella creata",renameFolderSuccess:"Cartella rinominata",deleteFolderSuccess:"Cartella eliminata",newFileSuccess:"File aggiunto",renameFileSuccess:"File rinominato",deleteFileSuccess:"File cancellato",nameInputErrorMessage:"Nome non valido",cancel:"Annulla",submit:"Invia",buttonText:"Nuova cartella",addFileButtonText:"Carica un file",rename:"Rinominare",view:"Vedere",download:"Scaricare",delete:"Cancellare",deleteTitle:"Eliminazione di file",deleteDetail:"Stai per eliminare definitivamente i seguenti file/cartelle"}}},$zt=({i18nPlugin:i}={})=>({install(e){i?Object.entries(Yzt).forEach(([t,n])=>{i.global.mergeLocaleMessage(t,n)}):console.warn("[BIMData Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly."),Object.entries(IMt).forEach(([t,n])=>{e.component(t,n)})}}),ejt=Object.freeze(Object.defineProperty({__proto__:null,BIMDataClickAway:Za,BIMDataClickInputAway:{beforeMount(i,e){if(typeof e.value!="function")throw Error(`click away directive needs function, got ${typeof e.value}`);i.clickAwayHandler=t=>{(t.path||t.composedPath&&t.composedPath()).find(o=>o===i)||e.value()},window.addEventListener("mousedown",i.clickAwayHandler,!0)},unmounted(i){window.removeEventListener("mousedown",i.clickAwayHandler,!0),delete i.clickAwayHandler}}},Symbol.toStringTag,{value:"Module"})),tjt=i=>({install(e){Object.entries(Bje).forEach(([t,n])=>{e.component(t,n)}),Object.entries(ejt).forEach(([t,n])=>e.directive(t.split("BIMData")[1],n))}}),ijt={name:"LiWrapper",render(){return Jn("li",this.$slots.default())}};function njt(i,e){var t=new Set([]);return i.forEach(n=>{e.has(n)||t.add(n)}),t}const Il=zo("id"),ojt=({contextMenu:i,objects:e=[],state:t=i.$viewer.state,pictos:n})=>[{name:"selectAll",get group(){return i.groupPositions.select},position:1,get label(){return i.$t("context_menu.select_all")},get picto(){return n.get(this.name)},execute:()=>t.selectObjects(e.filter(Oa(Ei("visible"),yd("selected"))).map(Il)),predicate:()=>e.some(Oa(Ei("visible"),yd("selected")))},{name:"deselectAll",get group(){return i.groupPositions.select},position:2,get label(){return i.$t("context_menu.deselect_all")},get picto(){return n.get(this.name)},execute:()=>t.deselectObjects(e.filter(Ei("selected")).map(Il)),predicate:()=>e.some(Ei("selected"))},{name:"selectSimilar",get group(){return i.groupPositions.select},position:3,get label(){return i.$t("context_menu.select_similar")},get picto(){return n.get(this.name)},execute(){const o=e.filter(r=>r.visible&&r.type===this.selectedObject.type&&r.id!==this.selectedObject.id).map(Il);t.selectObjects(o)},selectedObject:null,predicate(){const o=e.filter(Oa(Ei("visible"),Ei("selected")));return o.length===1&&o[0].type!==void 0?(this.selectedObject=o[0],!0):(this.selectedObject=null,!1)}},{name:"reverseSelection",get label(){return i.$t("context_menu.reverse_selection")},get group(){return i.groupPositions.select},position:4,execute:()=>{const o=new Set(e.filter(Ei("selected")).map(Il)),r=new Set(e.filter(Ei("visible")).map(Il));t.selectObjects(Array.from(njt(r,o)),{exclusive:!0})},predicate:()=>e.some(Oa(yd("selected"),Ei("visible")))&&e.some(Oa(Ei("selected"),Ei("visible")))},{name:"showAll",get group(){return i.groupPositions.visibility},position:1,get label(){return i.$t("context_menu.show_all")},get picto(){return n.get(this.name)},execute:()=>t.showObjects(e.filter(yd("visible")).map(Il)),predicate:()=>e.some(yd("visible"))},{name:"hide",get group(){return i.groupPositions.visibility},position:2,get label(){return i.$t("context_menu.hide")},get picto(){return n.get(this.name)},objectsToHide:null,execute(){const o=this.objectsToHide.filter(Ei("selected"));o.length>0&&t.deselectObjects(o.map(Il)),t.hideObjects(this.objectsToHide.map(Il))},predicate(){return this.objectsToHide=e.filter(Oa(Ei("selected"),Ei("visible"))),this.objectsToHide.length>0}},{name:"hideAll",get group(){return i.groupPositions.visibility},position:3,get label(){return i.$t("context_menu.hide_all")},execute:()=>{const o=e.filter(Ei("visible"));o.some(Ei("selected"))&&t.deselectObjects(o.filter(Ei("selected")).map(Il)),t.hideObjects(o.map(Il))},predicate:()=>e.some(Ei("visible"))}].filter(o=>o.predicate()),sjt={components:{LiWrapper:ijt},inject:["$viewer"],data(){return{defaultPrevented:!1,displayed:!1,top:null,bottom:null,left:null,width:200,nextCommandId:1,currentCommands:[],contextCommands:[],registeredCommands:[],groupPositions:{select:10,visibility:20},asyncPredicateRunning:!1}},computed:{position(){return{top:this.top?this.top+"px":"unset",bottom:this.bottom?this.bottom+"px":"unset",left:this.left+"px",width:this.width+"px"}}},watch:{displayed(i){i?document.addEventListener("keydown",this.onKeyDown):document.removeEventListener("keydown",this.onKeyDown)}},created(){this.$viewer.contextMenu=this,this.asyncPredicates=new Set},methods:{onKeyDown(i){i.key==="Escape"&&this.away()},setPosition(i){const t=(document.fullscreenElement?document.fullscreenElement:this.$parent.$el).getBoundingClientRect();this.left=i.clientX-t.left,this.top=i.clientY-t.top,this.left+this.width>t.width&&(this.left=this.left-this.width),i.clientY>t.top+t.height/2?(this.bottom=t.height-this.top,this.top=null):this.bottom=null},typeCheckCommand(i={}){let e=null;if((!i.execute||typeof i.execute!="function")&!i.component&&(e="Cannot register context menu command. A command must have an execute function or a component property."),i.label||(e="Cannot register context menu command. A command must have a label."),e)throw console.error(e),new Error(e);return i.id=this.nextCommandId++,i},open(i){this.currentCommands=[],this.setPosition(i),this.originEvent=i,i.preventDefault(),this.setCurrentCommands(),this.groupCurrentCommands(),this.defaultPrevented=!1,this.displayed=!0,document.fullscreenElement?(this.$el.parentElement.removeChild(this.$el),this.adoptiveParent=document.fullscreenElement,this.adoptiveParent.appendChild(this.$el)):this.adoptiveParent&&this.adoptiveParent!==this.$viewer.globalContext.el&&(this.adoptiveParent.removeChild(this.$el),this.$viewer.globalContext.el.appendChild(this.$el),this.adoptiveParent=null)},setCurrentCommands(){this.asyncPredicates.clear(),this.asyncPredicateRunning=!1,this.defaultPrevented||this.registeredCommands.forEach(async i=>{if(typeof i.predicate=="function"){const e=i.predicate(this.$viewer.globalContext.activeLocalContext);if(e===!0)this.currentCommands.push(i);else if(typeof(e==null?void 0:e.then)=="function"){this.asyncPredicates.add(e),this.asyncPredicateRunning=!0;const t=await e;this.asyncPredicates.has(e)&&(this.asyncPredicates.delete(e),this.asyncPredicateRunning=this.asyncPredicates.size>0,t===!0&&this.currentCommands.push(i))}}else this.currentCommands.push(i)}),this.currentCommands.push(...this.contextCommands),this.contextCommands=[]},getDefaultCommands({objects:i=[],state:e=this.$viewer.state,context:t=null}){const n=new Map;return t&&this.$viewer.shortcutManager.getShortcuts(t).forEach(o=>n.set(o.name,o.key)),ojt({contextMenu:this,objects:i,state:e,pictos:n})},executeCommand(i){if(i.execute&&(i.execute(this.originEvent),this.displayed=!1),i.component&&!i.menu)throw new Error("Command with component property must have a `menu` property")},away(){this.displayed=!1},groupCurrentCommands(){const i=new Map;this.currentCommands.forEach(n=>{(n.group===null||n.group===void 0)&&(n.group=0),i.has(n.group)?i.get(n.group).push(n):i.set(n.group,[n])}),i.forEach(n=>n.sort((o,r)=>(o.position=o.position||0,r.position=r.position||0,o.position-r.position)));const t=[...i.keys()].sort((n,o)=>n-o).map(n=>i.get(n)).flat();this.currentCommands=t},isGroupIntersection(i){if(i===0)return!1;const e=this.currentCommands[i-1],t=this.currentCommands[i];return e.group<t.group},registerContextCommand(i){const e=this.typeCheckCommand(i);return this.contextCommands.push(e),i.id},registerCommand(i){const e=this.typeCheckCommand(i);return this.registeredCommands.push(e),i.id},unregisterCommand(i){return this.registeredCommands.find(e=>e.id===i)?(this.registeredCommands=this.registeredCommands.filter(e=>e.id!==i),!0):!1},preventDefault(){this.defaultPrevented=!0}}},rjt={key:0,class:"separator"},ajt={class:"menu-text"},ljt={key:1,class:"menu-picto"},cjt={key:0,class:"context-menu__spinner"};function ujt(i,e,t,n,o,r){const s=k("BIMDataIconChevron"),a=k("LiWrapper"),l=k("BIMDataSpinner"),c=pi("click-away");return o.displayed&&(o.currentCommands.length||o.asyncPredicateRunning)?ft((B(),O("ul",{key:0,class:"bimdata-list context-menu",style:ce(r.position)},[(B(!0),O(ct,null,St(o.currentCommands,(u,d)=>(B(),W(a,{key:u.label,class:"context-menu__element",onClick:h=>r.executeCommand(u)},{default:V(()=>[r.isGroupIntersection(d)?(B(),O("div",rjt)):ne("",!0),b("div",ajt,K(u.label),1),!u.component&&u.picto?(B(),O("span",ljt,K(u.picto),1)):u.component?(B(),W(s,{key:2,size:"xxs",class:"fill-primary"})):ne("",!0)]),_:2},1032,["onClick"]))),128)),o.asyncPredicateRunning?(B(),O("li",cjt,[D(l)])):ne("",!0)],4)),[[c,r.away]]):ne("",!0)}const djt=z(sjt,[["render",ujt],["__scopeId","data-v-5b87d4a3"]]),hjt={name:"ViewerHeader",inject:["$viewer"],props:{visible:{type:Boolean,default:!0}},setup(){const i=mt("$viewer"),e=Ls(new Map),t=o=>{if(!o.name)throw new TypeError("[Viewer Header] Content must have a name");if(e.has(o.name))throw new Error(`[Viewer Header] Content with name ${o.name} already exists`);e.set(o.name,o)},n=o=>e.has(o)?(e.delete(o),!0):!1;return{logo:i.uiSettings.bimdataLogo!==!1,version:i.uiSettings.version!==!1?i.version:null,headerContent:e,headerRightContentComponents:$e(()=>Array.from(e.values()).filter(o=>o.position==="right").sort((o,r)=>o.order-r.order).map(o=>o.component)),headerLeftContentComponents:$e(()=>Array.from(e.values()).filter(o=>o.position==="left").sort((o,r)=>o.order-r.order).map(o=>o.component)),addContent:t,removeContent:n}}},pjt={class:"viewer-header"},fjt={class:"viewer-header__content"},Ajt={class:"viewer-header__content__left"},mjt={class:"viewer-header__content__right"},gjt={key:0,class:"m-l-6 flex items-center"},vjt={key:1,class:"viewer-header__version"};function yjt(i,e,t,n,o,r){const s=k("BIMDataIllustration");return ft((B(),O("div",pjt,[b("div",fjt,[b("div",Ajt,[(B(!0),O(ct,null,St(n.headerLeftContentComponents,a=>(B(),W(vn(a),{key:a.name}))),128))]),b("div",mjt,[(B(!0),O(ct,null,St(n.headerRightContentComponents,a=>(B(),W(vn(a),{key:a.name}))),128))])]),n.logo||n.version?(B(),O("div",gjt,[n.logo?(B(),W(s,{key:0,name:"logo",width:"30px",height:"30px"})):ne("",!0),n.version?(B(),O("div",vjt,K(n.version),1)):ne("",!0)])):ne("",!0)],512)),[[qt,t.visible]])}const wjt=z(hjt,[["render",yjt],["__scopeId","data-v-5c9ea6b6"]]),Cjt={emits:["resize"],setup(i,{emit:e}){return{onResizerMousedown:n=>{n.preventDefault();let o=n.clientX;const r=a=>{a.preventDefault();const l=a.clientX-o;o=a.clientX,e("resize",l)},s=a=>{a.preventDefault(),window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",s)};window.addEventListener("mousemove",r),window.addEventListener("mouseup",s)}}}},bjt={class:"bimdata-separator"};function xjt(i,e,t,n,o,r){return B(),O("div",bjt,[e[1]||(e[1]=b("div",{class:"bimdata-separator__line"},null,-1)),b("div",{class:"bimdata-separator__resizer",onMousedown:e[0]||(e[0]=(...s)=>n.onResizerMousedown&&n.onResizerMousedown(...s))},null,32)])}const Mjt={components:{Separator:z(Cjt,[["render",xjt],["__scopeId","data-v-79a3b3af"]])},props:{position:{type:String,required:!0,validator(i){return["left","right"].includes(i)}},sidePanel:{type:Object,required:!0,validator(i){if(i.width&&(typeof i.width!="number"||i.width<0))return console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof i.width}`),!1;const e=typeof(i==null?void 0:i.component)=="object";return e||console.error("[GlobalSidePanel] sidePanel must have a component property"),e}}},setup(i){const e=we(null),t=we(i.sidePanel.width??400),n=(o,r=1)=>{const s=t.value+o*r;t.value=Math.max(0,s)};return wt(()=>i.sidePanel,()=>{Object.defineProperty(i.sidePanel,"width",{get(){return t.value},set(o){if(typeof o!="number"||o<=0){console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof o}`);return}t.value=o}}),Object.defineProperty(i.sidePanel,"componentInstance",{get(){return e.value},enumerable:!0})},{immediate:!0}),{componentInstance:e,width:t,onResize:n}}},Ejt={class:"bimdata-global-side-panel__component"};function Bjt(i,e,t,n,o,r){const s=k("Separator");return B(),O("div",{class:"bimdata-global-side-panel",style:ce(`width: ${n.width}px`)},[t.sidePanel.resizable&&t.position==="right"?(B(),W(s,{key:0,onResize:e[0]||(e[0]=a=>n.onResize(a,-1))})):ne("",!0),b("div",Ejt,[(B(),W(vn(t.sidePanel.component),{ref:"componentInstance"},null,512))]),t.sidePanel.resizable&&t.position==="left"?(B(),W(s,{key:1,onResize:e[1]||(e[1]=a=>n.onResize(a))})):ne("",!0)],4)}const Sjt={name:"BimdataViewer",components:{ContextMenu:djt,ViewerHeader:wjt,ModalManager:ufe,GlobalSidePanel:z(Mjt,[["render",Bjt],["__scopeId","data-v-82d0d4cb"]])},setup(){const i=mt("$viewer"),{globalContext:e,shortcutManager:t}=i;ln(()=>{t&&t.destroy(),e.hub.clear()}),Ti(()=>{i.pluginManager.runPluginsScripts(i)});const n=$e(()=>{var f;return i.uiSettings.bimdataLogo!==!1&&(e.localContexts.length!==1||((f=e.localContexts[0].window)==null?void 0:f.logoAndVersion))}),o=$e(()=>{var f;return i.uiSettings.version!==!1&&(e.localContexts.length!==1||(f=e.localContexts[0].window)!=null&&f.logoAndVersion)?i.version:null}),r=$e(()=>e.leftSidePanel),s=$e(()=>e.rightSidePanel),a=$e(()=>{var m;const f=i.uiSettings.header!==!1,A=e.localContexts.length===1&&((m=e.localContexts[0].window)==null?void 0:m.header)===!1,p=!!(r.value||s.value);return f&&(!A||p)}),l=i.uiSettings.contextMenu!==!1,c=we(null);function u(f){l&&c.value.open(f)}function d(){i.shortcutManager.active=!0}function h(){i.shortcutManager.active=!1}return{Layout:i.layout.areas.component,onContextMenu:u,onMouseenter:d,onMouseleave:h,isHeaderVisible:a,viewerTemplateRef:e.templateRef,modalManagerTemplateRef:e.modalManagerTemplateRef,headerTemplateRef:e.headerTemplateRef,contextMenuTemplateRef:c,contextMenuEnabled:l,bimdataLogoOnSingleWindow:n,viewerVersionOnSingleWindow:o,version:i.version,loading:$e(()=>e.loading),spinner:$e(()=>e.spinner),leftSidePanel:r,rightSidePanel:s}}},Ijt={key:1,class:"global-spinner",style:{"z-index":"3"}},Pjt={key:2,class:"viewer__logo"},Tjt={key:1,class:"version m-t-6"};function kjt(i,e,t,n,o,r){const s=k("ModalManager"),a=k("ContextMenu"),l=k("ViewerHeader"),c=k("GlobalSidePanel"),u=k("BIMDataSpinner"),d=k("BIMDataIllustration");return B(),O("div",{id:"bimdata-viewer",ref:"viewerTemplateRef",class:"bimdata-viewer bimdata-scrollbar",onContextmenu:e[0]||(e[0]=(...h)=>n.onContextMenu&&n.onContextMenu(...h)),onMouseenter:e[1]||(e[1]=(...h)=>n.onMouseenter&&n.onMouseenter(...h)),onMouseleave:e[2]||(e[2]=(...h)=>n.onMouseleave&&n.onMouseleave(...h))},[D(s,{ref:"modalManagerTemplateRef"},null,512),n.contextMenuEnabled?(B(),W(a,{key:0,ref:"contextMenuTemplateRef"},null,512)):ne("",!0),D(l,{ref:"headerTemplateRef",visible:n.isHeaderVisible},null,8,["visible"]),b("div",{class:"bimdata-viewer__content",style:ce(n.isHeaderVisible?"height: calc(100% - var(--bimdata-viewer-header-height, 40px))":"height: 100%")},[n.leftSidePanel?(B(),W(c,{key:0,"side-panel":n.leftSidePanel,position:"left"},null,8,["side-panel"])):ne("",!0),(B(),W(vn(n.Layout),{style:"height: 100%; flex-grow: 1;"})),n.rightSidePanel?(B(),W(c,{key:1,"side-panel":n.rightSidePanel,position:"right"},null,8,["side-panel"])):ne("",!0)],4),n.loading?(B(),O("div",Ijt,[n.spinner&&n.spinner.component?(B(),W(vn(n.spinner.component),kr(ds({key:0},n.spinner.props)),null,16)):(B(),W(u,{key:1,size:"40px",border:"5px"}))])):ne("",!0),!n.isHeaderVisible&&(n.bimdataLogoOnSingleWindow||n.viewerVersionOnSingleWindow)?(B(),O("div",Pjt,[n.bimdataLogoOnSingleWindow?(B(),W(d,{key:0,name:"logo"})):ne("",!0),n.viewerVersionOnSingleWindow?(B(),O("div",Tjt,K(n.version),1)):ne("",!0)])):ne("",!0)],544)}const Rjt=z(Sjt,[["render",kjt]]),Djt=["src"],_jt={class:"bimdata-models__header"},Ljt={key:0,class:"bimdata-models__header__loader"},Fjt={class:"bimdata-models__header__picto"},Ojt={class:"bimdata-models__header__name"},Ujt={key:0,class:"bimdata-models__header__name--empty"},Njt={key:1,class:"bimdata-models__header__name--empty"},Vjt={key:3},Hjt=["onMousemove","onClick"],Afe={__name:"Models",props:{preview:{type:Boolean,default:!1},windowPositioning:{type:Boolean,default:!0},customFilter:{type:Function,default:null},width:{type:String,default:"350px"}},setup(i){const e=i,t=mt("$viewer"),n=we(),o=we(0),r=we(0),s=we(),a=pn([]),l=we(!1),c=$e(()=>t.localContext.loadedModels),u=$e(()=>t.localContext.loadedModelIds),d=$e(()=>t.localContext.loadingModelIds),h=$e(()=>t.localContext.multiModel),f=$e(()=>(e.customFilter?a.value.filter(e.customFilter):a.value).map(E=>c.value.find(S=>{var T;return((T=S.document)==null?void 0:T.head_id)!=null&&S.document.head_id===E.document.id})??E)),A=M=>u.value.includes(M),p=M=>d.value.includes(M),m=$e(()=>{var S;const{x:M,y:E}=((S=s.value)==null?void 0:S.getBoundingClientRect())??{x:0,y:0};return`top:${r.value-E}px; left:${o.value-M}px;`}),g=M=>{!h.value&&A(M.id)||d.value.length>0||(t.localContext.loadedModelIds.includes(M.id)?t.localContext.unloadModels([M.id]):t.localContext.loadModels([M.id]))},w=M=>{switch(M){case"C":return"success";case"E":return"failed";case"P":case"I":return"sandglass"}},y=(M,E)=>{M!=null&&M.viewer_360_file&&(o.value=E.clientX,r.value=E.clientY),n.value=M==null?void 0:M.viewer_360_file},v=async M=>{l.value=!0;try{return(await t.api.apiClient.modelApi.getModels(t.api.cloudId,t.api.projectId,void 0,void 0,M)).filter(S=>t.state.models.some(T=>T.archived)||!S.archived).sort(Cu("updated_at",!1))}catch(E){console.error("[Models] Cannot get project models. Error: ",E)}finally{l.value=!1}return[]},x=M=>{var E;return((E=M.children)==null?void 0:E.some(S=>A(S.id)))??!1};return v(t.localContext.modelTypes).then(M=>{a.value=M}),(M,E)=>{const S=k("BIMDataSpinner"),T=k("BIMDataIconModel3D"),P=k("BIMDataTextbox"),I=k("BIMDataCheckbox"),R=k("BIMDataRadio"),L=k("BIMDataIcon"),U=k("BIMDataDropdownList");return B(),O("div",{ref_key:"templateRef",ref:s,class:ue(["bimdata-models",{"bimdata-models--window-positioning":i.windowPositioning}])},[n.value?(B(),O("div",{key:0,class:"bimdata-models__preview",style:ce(m.value)},[b("img",{src:n.value},null,8,Djt)],4)):ne("",!0),D(U,{style:ce(`--bimdata-models-width: ${i.width};`),width:i.width,list:f.value,"element-key":"id","per-page":40,loading:l.value,class:"bimdata-models__list",disabled:f.value.length===0,onElementClick:g},{header:V(({isOpen:H})=>[b("div",_jt,[l.value||d.value.length>0?(B(),O("div",Ljt,[D(S)])):(B(),O(ct,{key:1},[b("div",Fjt,[D(T)]),b("div",{class:ue(["bimdata-models__header__number bimdata-info-length",{"bimdata-models__header__number--empty":u.value.length===0}])},[b("span",null,K(u.value.length),1)],2),b("div",Ojt,[f.value.length===0?(B(),O("span",Ujt,K(M.$t("model.no_model")),1)):u.value.length===0?(B(),O("span",Njt,K(M.$t("model.no_loaded_model")),1)):u.value.length===1?(B(),W(P,{key:2,text:c.value[0].name,tooltip:!H},null,8,["text","tooltip"])):u.value.length>1?(B(),O("span",Vjt,K(M.$t("model.selected_models")),1)):ne("",!0)])],64))])]),element:V(({element:H,close:N})=>[b("div",{class:"bimdata-models__model",onMousemove:Q=>i.preview&&y(H,Q),onMouseout:E[0]||(E[0]=Q=>i.preview&&y()),onClick:()=>{!h.value&&!A(H.id)&&N()}},[h.value?(B(),W(I,{key:0,"model-value":A(H.id)||x(H),disabled:H.status!=="C"||d.value.length>0},null,8,["model-value","disabled"])):(B(),W(R,{key:1,"model-value":A(H.id)||x(H),disabled:H.status!=="C"||d.value.length>0},null,8,["model-value","disabled"])),D(L,{margin:"0 calc(var(--spacing-unit) / 2)",name:w(H.status),size:"xs",class:ue({"fill-success":H.status==="C","fill-high":H.status==="E"})},null,8,["name","class"]),D(P,{class:ue({"bimdata-models__model__name":!0,"bimdata-models__model__name--disabled":H.status!=="C"||d.value.length>0}),text:H.name,width:`calc(100% -
5510
5510
  ${h.value?13:23}px - 2 * 6px - 16px)`},null,8,["class","text","width"]),H.document&&!H.document.is_head_version?(B(),W(L,{key:2,name:"versioning",fill:"",color:"default",size:"xs",margin:"0 0 0 6px"})):ne("",!0)],40,Hjt),p(H.id)?(B(),W(S,{key:0,class:"bimdata-models__model__spinner"})):ne("",!0)]),_:1},8,["style","width","list","loading","disabled"])],2)}}},zjt={data(){return{shown:!1}},mounted(){setTimeout(()=>{this.shown=!0},500)}};function jjt(i,e,t,n,o,r){const s=k("BIMDataIllustration");return B(),O("div",{class:"bimdata__no-model",style:ce({"--no-model--opacity":o.shown?1:0})},[D(s,{name:"emptyViewer",x:"90",y:"90"}),b("span",null,K(i.$t("model.select_model")),1)],4)}const mfe=z(zjt,[["render",jjt],["__scopeId","data-v-5ffd9bc0"]]);window.BIMDataViewerVue=FV;class Gjt{constructor(e={}){var o,r;const{api:t={},ui:n}=e;this.uiCfg=n,t.apiUrl||(console.info("[BIMData Viewer] INFO - Viewer config - `apiUrl` not set, use 'https://api.bimdata.io' by default."),t.apiUrl="https://api.bimdata.io"),t.archiveUrl||(console.info("[BIMData Viewer] INFO - Viewer config - `archiveUrl` not set, use 'https://archive.bimdata.io' by default."),t.archiveUrl="https://archive.bimdata.io"),t.pdfBackendUrl||(console.info("[BIMData Viewer] INFO - Viewer config - `pdfBackendUrl` not set, use 'https://pdf-backend.bimdata.io' by default."),t.pdfBackendUrl="https://pdf-backend.bimdata.io"),t.ifcIds&&(console.warn("[BIMData Viewer] DEPRECATED - Viewer config - please use the `modelIds` property instead of `ifcIds`."),t.modelIds===void 0&&(t.modelIds=t.ifcIds)),t.modelIds||(t.modelIds=[]),(o=t.offline)!=null&&o.dataFile&&(t.offline.data=t.offline.dataFile),this.$viewer=new Qzt(e),(r=t.offline)!=null&&r.enabled?this.$viewer.api.enableOfflineMode(t.offline.data,t.offline.options).then(()=>this.state.loadModels(t.modelIds)):(this.$viewer.globalContext.loadingProcessStart(),this.state.loadModels(t.modelIds).finally(()=>this.$viewer.globalContext.loadingProcessEnd())),this.vueApp=null}get state(){return this.$viewer.state}get api(){return this.$viewer.api}async mount(e,t="3d"){var u;const{$viewer:n}=this;await n.api.ready;try{const d=await n.api.apiClient.collaborationApi.checkProjectAccess(n.api.cloudId,n.api.projectId);n.api.permissions=ffe(d)}catch{n.api.permissions=ffe()}const o=this.api.accessToken,{i18n:r}=n;r.registerTranslations(n.pluginManager.pluginTranslations),n.layout.apply(t);const s={i18n:r.i18nVuePlugin,data(){return{accessToken:o}},render(){return Jn(Rjt,{style:"height: 100%"})}},a=ig(s).use(r.i18nVuePlugin).use(tjt()).use($zt({i18nPlugin:r.i18nVuePlugin})).use(Xzt({apiClient:n.api.apiClient,i18nPlugin:r.i18nVuePlugin}));a.provide("$viewer",n),a.component("BIMDataModelLoader",Afe),a.component("BIMDataNoModelWindowPlaceHolder",mfe),a.component("BIMDataStoreySelector",ZB),a.component("ModelsLoader",Afe),a.component("NoModelWindowPlaceHolder",mfe);const l=e instanceof HTMLElement?e:document.querySelector(e);l&&(l.style.height="100%");const c=a.mount(e);return c.$viewer=n,Kzt(c.$el,(u=this.uiCfg)==null?void 0:u.style),typeof window<"u"&&(window.bimdataViewer=c),this.vueApp=a,c}destroy(){var e;(e=this.vueApp)==null||e.unmount()}setLocale(e){if(!eH.includes(e))throw new Error(`Viewer available locales are ${eH.join(", ")}.`);this.$viewer.i18n.locale=e}registerPlugin(e){this.$viewer.registerPlugin(e)}registerWindow(e){return this.$viewer.windowManager.registerWindow(e)}unregisterWindow(e){return this.$viewer.windowManager.unregisterWindow(e)}setAccessToken(e){this.api.accessToken=e}async loadModels(e){this.$viewer.globalContext.loadingProcessStart();const t=await this.state.loadModels(e);return this.$viewer.globalContext.loadingProcessEnd(),t}loadIfcs(e){return console.warn("[BIMData Viewer] DEPRECATED - Viewer - please use the loadModels method instead of loadIfcs."),this.loadModels(e)}}const gfe=(i={})=>new Gjt(i);return window.makeBIMDataViewer=gfe,gfe});