@aibee/crc-bmap 0.12.36 → 0.12.37

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.
@@ -12201,7 +12201,7 @@ void main() {
12201
12201
  `,m=function(L,tt,O){tt=tt||1024;let W=L.pos,St=-1,j=0,pt="",mt=String.fromCharCode.apply(null,new Uint16Array(L.subarray(W,W+128)));for(;0>(St=mt.indexOf(g))&&j<tt&&W<L.byteLength;)pt+=mt,j+=mt.length,W+=128,mt+=String.fromCharCode.apply(null,new Uint16Array(L.subarray(W,W+128)));return-1<St?(O!==!1&&(L.pos+=j+St+1),pt+mt.slice(0,St)):!1},v=function(L){let tt=/^#\?(\S+)/,O=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,V=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,W=/^\s*FORMAT=(\S+)\s*$/,St=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,j={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0},pt,mt;for((L.pos>=L.byteLength||!(pt=m(L)))&&a(1,"no header found"),(mt=pt.match(tt))||a(3,"bad initial token"),j.valid|=1,j.programtype=mt[1],j.string+=pt+`
12202
12202
  `;pt=m(L),pt!==!1;){if(j.string+=pt+`
12203
12203
  `,pt.charAt(0)==="#"){j.comments+=pt+`
12204
- `;continue}if((mt=pt.match(O))&&(j.gamma=parseFloat(mt[1])),(mt=pt.match(V))&&(j.exposure=parseFloat(mt[1])),(mt=pt.match(W))&&(j.valid|=2,j.format=mt[1]),(mt=pt.match(St))&&(j.valid|=4,j.height=parseInt(mt[1],10),j.width=parseInt(mt[2],10)),j.valid&2&&j.valid&4)break}return j.valid&2||a(3,"missing format specifier"),j.valid&4||a(3,"missing image size specifier"),j},x=function(L,tt,O){let V=tt;if(V<8||V>32767||L[0]!==2||L[1]!==2||L[2]&128)return new Uint8Array(L);V!==(L[2]<<8|L[3])&&a(3,"wrong scanline width");let W=new Uint8Array(4*tt*O);W.length||a(4,"unable to allocate buffer space");let St=0,j=0,pt=4*V,mt=new Uint8Array(4),Lt=new Uint8Array(pt),yt=O;for(;yt>0&&j<L.byteLength;){j+4>L.byteLength&&a(1),mt[0]=L[j++],mt[1]=L[j++],mt[2]=L[j++],mt[3]=L[j++],(mt[0]!=2||mt[1]!=2||(mt[2]<<8|mt[3])!=V)&&a(3,"bad rgbe scanline format");let bt=0,nt;for(;bt<pt&&j<L.byteLength;){nt=L[j++];let Vt=nt>128;if(Vt&&(nt-=128),(nt===0||bt+nt>pt)&&a(3,"bad scanline data"),Vt){let he=L[j++];for(let dt=0;dt<nt;dt++)Lt[bt++]=he}else Lt.set(L.subarray(j,j+nt),bt),bt+=nt,j+=nt}let Xt=V;for(let Vt=0;Vt<Xt;Vt++){let he=0;W[St]=Lt[Vt+he],he+=V,W[St+1]=Lt[Vt+he],he+=V,W[St+2]=Lt[Vt+he],he+=V,W[St+3]=Lt[Vt+he],St+=4}yt--}return W},S=function(L,tt,O,V){let W=L[tt+3],St=Math.pow(2,W-128)/255;O[V+0]=L[tt+0]*St,O[V+1]=L[tt+1]*St,O[V+2]=L[tt+2]*St,O[V+3]=1},w=function(L,tt,O,V){let W=L[tt+3],St=Math.pow(2,W-128)/255;O[V+0]=Wm.toHalfFloat(Math.min(L[tt+0]*St,65504)),O[V+1]=Wm.toHalfFloat(Math.min(L[tt+1]*St,65504)),O[V+2]=Wm.toHalfFloat(Math.min(L[tt+2]*St,65504)),O[V+3]=Wm.toHalfFloat(1)},E=new Uint8Array(t);E.pos=0;let b=v(E),C=b.width,A=b.height,P=x(E.subarray(E.pos),C,A),U,F,D;switch(this.type){case _s:D=P.length/4;let L=new Float32Array(D*4);for(let O=0;O<D;O++)S(P,O*4,L,O*4);U=L,F=_s;break;case F0:D=P.length/4;let tt=new Uint16Array(D*4);for(let O=0;O<D;O++)w(P,O*4,tt,O*4);U=tt,F=F0;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:C,height:A,data:U,header:b.string,gamma:b.gamma,exposure:b.exposure,type:F}}setDataType(t){return this.type=t,this}load(t,e,n,i){function o(a,l){switch(a.type){case _s:case F0:a.colorSpace=Ii,a.minFilter=tn,a.magFilter=tn,a.generateMipmaps=!1,a.flipY=!0;break}e&&e(a,l)}return super.load(t,o,n,i)}};var G6=class extends Tm{dispose(){var t;(t=this.environment)==null||t.dispose(),this.environment=null,Lr(this),this.clear()}constructor(){super(),new z6().load(AY,t=>{t.mapping=ud,this.environment=t;let e=new Ie;e.makeRotationX(Math.PI/2),this.environmentRotation=new ga().setFromRotationMatrix(e)})}};var k6=class extends kl{constructor(t,e){super(-t/2,t/2,e/2,-e/2,-1e4,5e4),this.up.set(0,0,1),this.position.set(0,0,100),this.lookAt(0,0,0)}};var S_=class extends Sn{get config(){return this.bmap.config}get center(){return this.bmap.buildingCenter}setRange(t){this.range=br([t])}resizeClientSize(){let{x:t,y:e,width:n,height:i}=this.container.getBoundingClientRect();this.clientSize={width:n||this.container.clientWidth,height:i||this.container.clientHeight,x:t,y:e}}init(){let{clientWidth:t,clientHeight:e}=this.container;this.camera=new k6(t,e),this.renderer.setSize(t,e),this.renderer.setCameraAndScene(this.scene,this.camera),this.renderer.autoRender(),this.control=new F6(this,this.camera,this.renderer.domElement),this.control.maxPolarAngle=this.config.control.maxPolar,this.container.appendChild(this.renderer.domElement),this.scene.add(this.lights),this.basicRatio=this.getRatio(),this.control.addEventListener("change",this.onControlChange),this.control.addEventListener("change-zoom",this.onControlChangeZoom),this.renderer.addEventListener("update",this.onRendererUpdate),this.cameraBound=new N6(this)}getRatio(t,e){t===void 0&&(t=new G(0,0,0)),e===void 0&&(e=new G(100,0,0));let{clientWidth:n,clientHeight:i}=this.container,o=sn(t,this.camera,n,i),a=sn(e,this.camera,n,i);return Math.ceil(Math.sqrt((a.x-o.x)**2+(a.y-o.y)**2))}changeAmbientLightColor(t){this.lights.children.forEach(e=>{e instanceof Pf&&(e.color=new ne(t))})}switchFloor(t,e){e===void 0&&(e=!0),console.log("switchFloor",e),this.currentFloor&&(this.currentFloor.onRemoveFromScene(),this.scene.remove(this.currentFloor),e&&this.currentFloor.dispose()),this.currentFloor=t,this.setRange(t.userData.range||[]),this.scene.add(t),t.onAddToScene();let n=t.getCenter();n&&(this.lights.position.x=n.x,this.lights.position.y=n.y),this.cameraBound.updateBox()}getGraphicsByDeviceXy(t,e){var n;let i=new ft;i.x=t/this.clientSize.width*2-1,i.y=e/this.clientSize.height*-2+1;let o=new md;return o.setFromCamera(i,this.camera),o.ray.origin.sub(o.ray.direction.clone().multiplyScalar(100)),((n=this.currentFloor)==null?void 0:n.graphicLayer.getGraphicByRaycaster(o))||{graphics:[],position:null}}getPoisByDeviceXy(t,e){var n,i;let o=(n=this.currentFloor)==null?void 0:n.poiLayer.getPoiByDeviceXy(t,e),a=(i=this.currentFloor)==null?void 0:i.poiLayer2.getPoiByDeviceXy(t,e);return(o||[]).concat(a||[])}registryEvent(){window.addEventListener("resize",this.onWindowResize),this.container.addEventListener("click",this.onClick),this.container.addEventListener("pointerover",this.onPointerover),this.container.addEventListener("pointermove",this.onPointermove),this.container.addEventListener("pointerleave",this.onPointerleave),this.container.addEventListener("pointercancel",this.onPointerleave),this.container.addEventListener("pointerout",this.onPointerleave),this.selection.addEventListener("select",this.onSelectionSelect),this.hoverHelper.addEventListener("hover-change",this.onHoverChange)}unRegistryEvent(){window.removeEventListener("resize",this.onWindowResize),this.container.removeEventListener("click",this.onClick),this.container.removeEventListener("pointerover",this.onPointerover),this.container.removeEventListener("pointermove",this.onPointermove),this.container.removeEventListener("pointerleave",this.onPointerleave),this.container.removeEventListener("pointercancel",this.onPointerleave),this.container.removeEventListener("pointerout",this.onPointerleave),this.selection.removeEventListener("select",this.onSelectionSelect),this.hoverHelper.removeEventListener("hover-change",this.onHoverChange),this.control.removeEventListener("change",this.onControlChange),this.control.removeEventListener("change-zoom",this.onControlChangeZoom),this.renderer.removeEventListener("update",this.onRendererUpdate)}setPolarAngle(t,e){return e===void 0&&(e=500),this.control.setPolarAngleByDuration(t,!0,e)}setAzimuthalAngle(t,e){return e===void 0&&(e=500),this.control.setAzimuthalAngleDuration(t,!0,e)}getCameraLookAt(){return this.control.getCameraLookAt()}setZoom(t,e,n){return n===void 0&&(n=500),this.control.setZoomByDuration(t,e,!0,n)}getFitCameraToObjectZoom(t,e,n){return e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=!0),this.getFitCameraToBoxZoom(new Fe().setFromObject(t),e,n)}getFitCameraToBoxZoom(t,e,n){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=!0);let[i,o,a,l]=e,{clientSize:{width:c,height:f}}=this,g=this.control.getPolarAngle();n&&this.setPolarAngle(0,0),this.setPolarAngle(g,0);let{max:m,min:v}=t,x=new G(v.x,m.y,m.z),S=new G(m.x,m.y,m.z),w=new G(m.x,v.y,v.z),E=new G(v.x,v.y,v.z),b=sn(x,this.camera,c,f),C=sn(S,this.camera,c,f),A=sn(E,this.camera,c,f),P=sn(w,this.camera,c,f),F=new V0().setFromPoints([new ft(b.x,b.y),new ft(C.x,C.y),new ft(A.x,A.y),new ft(P.x,P.y)]).getSize(new ft),D=(c-o-l)/F.x,L=(f-i-a)/F.y,tt=Math.min(D,L),O=new G((m.x+v.x)/2,(m.y+v.y)/2,(m.z+v.z)/2),V=tt*this.camera.zoom,W=this.camera.clone();W.zoom=V,W.updateMatrix();let St=(o-l)/2,j=(i-a)/2;if(St){let pt=new G;pt.setFromMatrixColumn(W.matrix,0),pt.normalize(),pt.multiplyScalar(St/V),O.add(pt)}if(j){let pt=new G;pt.setFromMatrixColumn(W.matrix,1),pt.normalize(),pt.multiplyScalar(j/V),O.add(pt)}return{zoom:tt*this.camera.zoom,center:O}}fitCameraToObject(t,e,n,i){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=500),i===void 0&&(i=!0);let{zoom:o,center:a}=this.getFitCameraToObjectZoom(t,e,i);return this.setZoom(o,a,n)}fitCameraToBox(t,e,n,i){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=500),i===void 0&&(i=!0);let{zoom:o,center:a}=this.getFitCameraToBoxZoom(t,e,i);return this.setZoom(o,a,n)}getFitCameraToGroundZoom(t,e,n){if(t===void 0&&(t=[20,20,20,20]),e===void 0&&(e=500),n===void 0&&(n=!0),this.currentFloor&&this.currentFloor.hasElement)return this.getFitCameraToObjectZoom(this.currentFloor.groundUpper,t,n).zoom}fitCameraToGround(t,e,n){return t===void 0&&(t=[20,20,20,20]),e===void 0&&(e=500),n===void 0&&(n=!0),this.currentFloor&&this.currentFloor.hasElement?this.fitCameraToObject(this.currentFloor.groundLayer,t,e,n):Promise.resolve(!1)}setCameraPosition(t,e){return Tt(this,null,function*(){return this.control.setCameraPositionByTarget(t,e)})}pauseRender(){this.renderer.pauseRender()}continueRender(){this.renderer.continueRender()}dispose(){var t;(t=this.currentFloor)==null||t.dispose(),this.control.dispose(),this.cameraBound.dispose(),this.selection.dispose(),this.hoverHelper.dispose(),this.unRegistryEvent(),this.renderer.dispose(),this.lights.children.forEach(e=>e.dispose()),this.scene.dispose(),this.container=null,this.renderer=null}constructor(t,e){super(),this.container=t,this.scene=new G6,this.renderer=new B6,this.lights=cM(),this.range=br([]),this.clientSize={width:0,height:0,x:0,y:0},this.renderRf=0,this.basicZoom=1,this.onControlChange=()=>{this.dispatchEvent({type:"change-ratio",px:(this.basicRatio||0)*this.camera.zoom}),this.dispatchEvent({type:"control-change"})},this.onControlChangeZoom=n=>{let{zoom:i}=n;this.dispatchEvent({type:"control-zoom-change",zoom:i})},this.onRendererUpdate=()=>{this.dispatchEvent({type:"update"})},this.onWindowResize=()=>{let{container:n,camera:i,renderer:o}=this,{clientWidth:a,clientHeight:l}=n;a=Math.max(1,a),l=Math.max(1,l),i.left=-a/2,i.right=a/2,i.top=l/2,i.bottom=-l/2,i.updateProjectionMatrix(),o.setSize(a,l),this.resizeClientSize(),this.dispatchEvent({type:"resize",width:a,height:l})},this.onClick=n=>{let{graphics:i,position:o}=this.getGraphicsByDeviceXy(n.offsetX,n.offsetY);i.length&&this.dispatchEvent({type:"graphic-click",graphics:i,position:o});let a=this.getPoisByDeviceXy(n.offsetX,n.offsetY);a.length&&this.dispatchEvent({type:"poi-click",pois:a})},this.onPointerover=n=>{let{graphics:i,position:o}=this.getGraphicsByDeviceXy(n.offsetX,n.offsetY),a=this.getPoisByDeviceXy(n.offsetX,n.offsetY);this.dispatchEvent({type:"pointer-over",e:n,graphics:i,pois:a,position:o})},this.onPointermove=n=>{let{graphics:i,position:o}=this.getGraphicsByDeviceXy(n.offsetX,n.offsetY),a=this.getPoisByDeviceXy(n.offsetX,n.offsetY);this.dispatchEvent({type:"pointer-move",e:n,graphics:i,pois:a,position:o})},this.onPointerleave=n=>{this.dispatchEvent({type:"pointer-level"})},this.onSelectionSelect=n=>{let{graphics:i,isMultipleSelect:o}=n;this.dispatchEvent({type:"select-graphic",graphics:i,isMultipleSelect:o})},this.onHoverChange=n=>{let{graphics:i}=n;this.dispatchEvent({type:"hover",graphics:i})},this.bmap=e,this.container.style.position="relative",this.container.style.overflow="hidden",this.init(),this.selection=new x_(this),this.hoverHelper=new E_(this),this.resizeClientSize(),this.registryEvent()}};var n8=H(qs(),1),r8={placeId:0,apiDomain:"",apiInfo:{},apiPath:{floorGraphic:"/api/inception-map/floor/get",floorRange:"/api/inception-map/range/get",equipmentList:"/api/inception-map/equipment/get",roadNetwork:"/api/inception-map/road_network/get",loadPlaceInfo:"https://screen.aibee.cn/ai-map/map/get-floor-map"},enableBoxSelect:!0,resizeObserver:!1,initTransToMark:!1,heatMap:{radius:50,minOpacity:.1,gradient:{0:"#8F9FCD",.5:"#6284FF",1:"#F95D5D"}},useFloorCache:!0,control:{maxPolar:1.2,defaultPolar:1.1,defaultAzimuthal:0,maxZoomScale:30},defaultPadding:[20,20,20,20],svg:{circle:{radius:"2",fill:"#1CADFF"},line:{stroke:"#1CADFF"}},selectBox:{stroke:"#1CADFF",fill:"rgba(28, 173, 255, 0.3)"},hover:{time:100},ground:{color:"#F6F6F6",opacity:1,height:.001,stroke:!1,strokeColor:"#E6E6E6",strokeOpacity:1},markGraphic:{color:"#EEF0F3",opacity:1,height:.001,stroke:!1,strokeColor:"#000",strokeOpacity:1},graphic:{fillOpacity:1},cameraBound:{padding:[150,150,150,150]},poi:{boxScale:1},loaderPlaceConfig:{textFontSize:14}};function FR(r){return(0,n8.merge)({},r8,r)}var a8=H(qs(),1);var Roe=H(ze(),1);var xoe=H(En(),1),Eoe=H(ze(),1);var moe=H(Kf(),1);var vg=function(r){return r.LAYERED_RENDER_VERSION="layeredRender",r.MERGED_RENDER_VERSION="mergedRender",r}({});function V6(r,t){let e=r.poi_info.showName||r.store_name||r.poi_info.text;switch(t){case"zh-cn":return e;case"en":var n;return((n=r.store_info_ext)==null?void 0:n.poi_name)||e;case"zh-hk":var i;return((i=r.store_info_ext)==null?void 0:i.traditional_name)||e}}function H6(r,t){let e=r.poi_info.showName||r.store_name||r.poi_info.text;switch(t){case"zh-cn":return e;case"en":var n;return((n=r.infra_info_ext)==null?void 0:n.poi_name)||e;case"zh-hk":var i;return((i=r.infra_info_ext)==null?void 0:i.traditional_name)||e}}var BR=["range","ground","store","facility","parkingSpace"];function i8(r){return BR.indexOf(r.l_type)===-1?BR.length:BR.indexOf(r.l_type)}function Gbt(r){r.layers.sort((t,e)=>i8(t)-i8(e))}function kbt(r){let t=r.layers.find(n=>n.l_type==="range"),e=[t.elements[0].center_x,t.elements[0].center_y];r.layers.map(n=>{if(n.l_type!=="range")return Av(n.elements,e)})}function b_(r){Gbt(r),kbt(r)}function _g(r,t){return t===void 0&&(t=4),r.floor_id+"_"+r.version_id+(t?"_"+t:"")}function o8(r,t,e){switch(r.l_type){case"ground":return zR(r,t);case"graph":return Vbt(r,t);case"wall":return Hbt(r,t);case"lane":return Wbt(r,t);case"texture2d":case"texture3d":return qbt(r,t);case"glb":return Xbt(r,t);case"store":return jbt(r,t,e);case"facility":return Zbt(r,t,e);case"parkingSpace":return $bt(r,t,e);case"text":return Qbt(r,t)}}function s8(r,t,e,n){switch(r.l_type){case"store":return Ybt(r,t,e,n);case"facility":return Kbt(r,t,e,n);case"parkingSpace":return Jbt(r,t,n)}}function Vbt(r,t){t.mergeGraphicLayer.addGraphics(r.elements,r.mergedElements)}function zR(r,t){if(r.mergedElements){let e=r.mergedElements.map(n=>new zh(t.context,te({},n,{dashed:!1})));t.addGrounds(e)}else{let e=r.elements.map(n=>new wo(t.context,te({},n,{dashed:!1})));t.addGrounds(e)}}function Hbt(r,t){if(r.mergedElements)r.mergedElements.map(e=>{let n=new __(t.context,e);t.wallLayer.add(n)});else{let e=r.elements.reduce((n,i)=>{let{fillColor:o,fillOpacity:a,strokeColor:l,strokeOpacity:c,height:f}=i,g=o.toLowerCase()+"-"+a+"-"+l.toLowerCase()+"-"+c+"-"+f;return c===0&&(g=o.toLowerCase()+"-"+a+"-"+f),n[g]?n[g].push(i):n[g]=[i],n},{});Object.values(e).forEach(n=>{let i=new g_(t.context,n);t.wallLayer.add(i)})}}function Wbt(r,t){if(r.mergedElements){let e=new y_(t.context,r.mergedElements);t.laneLayer.add(e)}else{let e=new m_(t.context,r.elements);t.laneLayer.add(e)}}function qbt(r,t){if(r.mergedMatrixes)r.mergedMatrixes.map(e=>{let n=new Bh(t.context,e);t.textureLayer.add(n)});else if(r.elements.length){let e=new Fh(t.context,r.elements);t.textureLayer.add(e)}}function Xbt(r,t){t.glbModelLayer.addModels(r.elements.map(e=>te({},e,{url:e.secondUrl,rotate:e.secondRotate,width:e.secondWidth,center_x:e.center_coord_x,center_y:e.center_coord_y,deltaHeight:0})))}function jbt(r,t,e){e.mergeGraphic?t.mergeGraphicLayer.addGraphics(r.elements,r.mergedElements):r.elements.map(n=>{let i=t.addGraphic(te({},n,{dashed:!1}));t.userData.graphics.push(i),t.userData.graphicMap.set(n.id,i)})}function Ybt(r,t,e,n){r.elements.map(i=>{try{let o=V6(i,e),a=new Di(t.context,{id:i.id,icon:i.poi_info.showImageUrl||i.poi_info.icon,text:o,position:{x:i.center_coord_x,y:i.center_coord_y,z:i.airHeight+i.height},icon_size:[24,24],level:i.poi_info.level||0,hide_text:!n.showStoreName,maxWeight:i.poi_info.maxWeight||25,minWeight:i.poi_info.minWeight||1,text_font_size:n.textFontSize});t.poiLayer2.pushPoi(a),a&&(a.userData.type="store",a.userData.data=i,a.userData.floor=t.name)}catch(o){console.log("\u521B\u5EFA\u5E97\u94FApoi\u5931\u8D25",o,i)}})}function Zbt(r,t,e){e.mergeGraphic?t.mergeGraphicLayer.addGraphics(r.elements,r.mergedElements):r.elements.map(n=>{let i=t.addGraphic(te({},n,{dashed:!1}));t.userData.graphics.push(i),t.userData.graphicMap.set(n.id,i)})}function Kbt(r,t,e,n){r.elements.filter(o=>o.poi_info).map(o=>{try{let a=H6(o,e),l=new Di(t.context,{id:o.id,icon:o.poi_info.showImageUrl||o.poi_info.icon,text:a,position:{x:o.center_coord_x,y:o.center_coord_y,z:o.airHeight+o.height},icon_size:[24,24],level:o.poi_info.level||0,hide_text:!n.showFacilityName,maxWeight:o.poi_info.maxWeight||25,minWeight:o.poi_info.minWeight||1,text_font_size:n.textFontSize});t.poiLayer2.pushPoi(l),l.userData.type="facility",l.userData.data=o,l.userData.floor=t.name}catch(a){console.log("\u6DFB\u52A0facility\u5931\u8D25",a,o)}})}function $bt(r,t,e){t.parkingSpaceLayer.load(r,e.mergeParkingSpace),t.userData.parkingSpaces=t.parkingSpaceLayer.graphicMap.values(),t.userData.parkingSpacesGraphicMap=t.parkingSpaceLayer.graphicMap}function Jbt(r,t,e){return Tt(this,null,function*(){let n=r.elements.filter(a=>a.texts[0]),i=n.map(a=>a.displayName||a.texts[0]),o=yield Oi.lazyGetTextureByTexts(i,{height:64});n.forEach(a=>{try{let l=a.displayName||a.texts[0],c=new Di(t.context,{id:a.id,text:l,position:{x:a.center_coord_x,y:a.center_coord_y,z:a.airHeight+a.height},text_texture:o[l].texture,text_texture_width:o[l].width,text_texture_height:o[l].height,text_texture_offset_x:o[l].x,text_texture_offset_y:o[l].y,text_font_size:e.textFontSize});c&&(c.userData.type="parkingSpace",c.userData.data=a,c.userData.floor=t.name),t.poiLayer2.pushPoi(c)}catch(l){console.log("\u6DFB\u52A0\u8F66\u4F4Dpoi\u5931\u8D25",l,a)}}),Object.values(o).forEach(a=>{a.texture.dispose()})})}function Qbt(r,t){let e=new v_(t.context,r.elements.map(n=>te({},n,{center_x:n.center_coord_x,center_y:n.center_coord_y})));t.textTextureLayer.add(e)}function GR(){let r=new Blob([`var VD=Object.create;var D1=Object.defineProperty;var HD=Object.getOwnPropertyDescriptor;var WD=Object.getOwnPropertyNames;var XD=Object.getPrototypeOf,YD=Object.prototype.hasOwnProperty;var X=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var $D=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of WD(t))!YD.call(n,s)&&s!==e&&D1(n,s,{get:()=>t[s],enumerable:!(i=HD(t,s))||i.enumerable});return n};var Qt=(n,t,e)=>(e=n!=null?VD(XD(n)):{},$D(t||!n||!n.__esModule?D1(e,"default",{value:n,enumerable:!0}):e,n));var Ri=(n,t,e)=>new Promise((i,s)=>{var u=p=>{try{f(e.next(p))}catch(d){s(d)}},c=p=>{try{f(e.throw(p))}catch(d){s(d)}},f=p=>p.done?i(p.value):Promise.resolve(p.value).then(u,c);f((e=e.apply(n,t)).next())});var Sn=X((Ug,F1)=>{"use strict";var Ec=function(n){return n&&n.Math===Math&&n};F1.exports=Ec(typeof globalThis=="object"&&globalThis)||Ec(typeof window=="object"&&window)||Ec(typeof self=="object"&&self)||Ec(typeof global=="object"&&global)||Ec(typeof Ug=="object"&&Ug)||function(){return this}()||Function("return this")()});var An=X((pet,U1)=>{"use strict";U1.exports=function(n){try{return!!n()}catch(t){return!0}}});var ri=X((det,B1)=>{"use strict";var ZD=An();B1.exports=!ZD(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var Sc=X((get,z1)=>{"use strict";var JD=An();z1.exports=!JD(function(){var n=function(){}.bind();return typeof n!="function"||n.hasOwnProperty("prototype")})});var vr=X((met,G1)=>{"use strict";var jD=Sc(),Kf=Function.prototype.call;G1.exports=jD?Kf.bind(Kf):function(){return Kf.apply(Kf,arguments)}});var H1=X(V1=>{"use strict";var k1={}.propertyIsEnumerable,q1=Object.getOwnPropertyDescriptor,KD=q1&&!k1.call({1:2},1);V1.f=KD?function(t){var e=q1(this,t);return!!e&&e.enumerable}:k1});var wc=X((vet,W1)=>{"use strict";W1.exports=function(n,t){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:t}}});var In=X((_et,$1)=>{"use strict";var X1=Sc(),Y1=Function.prototype,Bg=Y1.call,QD=X1&&Y1.bind.bind(Bg,Bg);$1.exports=X1?QD:function(n){return function(){return Bg.apply(n,arguments)}}});var vs=X((xet,J1)=>{"use strict";var Z1=In(),t3=Z1({}.toString),e3=Z1("".slice);J1.exports=function(n){return e3(t3(n),8,-1)}});var Qf=X((Eet,j1)=>{"use strict";var n3=In(),r3=An(),i3=vs(),zg=Object,o3=n3("".split);j1.exports=r3(function(){return!zg("z").propertyIsEnumerable(0)})?function(n){return i3(n)==="String"?o3(n,""):zg(n)}:zg});var th=X((wet,K1)=>{"use strict";K1.exports=function(n){return n==null}});var Fu=X((Met,Q1)=>{"use strict";var s3=th(),a3=TypeError;Q1.exports=function(n){if(s3(n))throw new a3("Can't call method on "+n);return n}});var Uu=X((bet,tE)=>{"use strict";var u3=Qf(),l3=Fu();tE.exports=function(n){return u3(l3(n))}});var er=X((Aet,eE)=>{"use strict";var Gg=typeof document=="object"&&document.all;eE.exports=typeof Gg=="undefined"&&Gg!==void 0?function(n){return typeof n=="function"||n===Gg}:function(n){return typeof n=="function"}});var xi=X((Tet,nE)=>{"use strict";var c3=er();nE.exports=function(n){return typeof n=="object"?n!==null:c3(n)}});var $s=X((Cet,rE)=>{"use strict";var kg=Sn(),f3=er(),h3=function(n){return f3(n)?n:void 0};rE.exports=function(n,t){return arguments.length<2?h3(kg[n]):kg[n]&&kg[n][t]}});var Mc=X((Iet,iE)=>{"use strict";var p3=In();iE.exports=p3({}.isPrototypeOf)});var Bu=X((Pet,aE)=>{"use strict";var d3=Sn(),oE=d3.navigator,sE=oE&&oE.userAgent;aE.exports=sE?String(sE):""});var bc=X((Ret,pE)=>{"use strict";var hE=Sn(),qg=Bu(),uE=hE.process,lE=hE.Deno,cE=uE&&uE.versions||lE&&lE.version,fE=cE&&cE.v8,So,eh;fE&&(So=fE.split("."),eh=So[0]>0&&So[0]<4?1:+(So[0]+So[1]));!eh&&qg&&(So=qg.match(/Edge\\/(\\d+)/),(!So||So[1]>=74)&&(So=qg.match(/Chrome\\/(\\d+)/),So&&(eh=+So[1])));pE.exports=eh});var nh=X((Let,gE)=>{"use strict";var dE=bc(),g3=An(),m3=Sn(),y3=m3.String;gE.exports=!!Object.getOwnPropertySymbols&&!g3(function(){var n=Symbol("symbol detection");return!y3(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&dE&&dE<41})});var Vg=X((Net,mE)=>{"use strict";var v3=nh();mE.exports=v3&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Ac=X((Oet,yE)=>{"use strict";var _3=$s(),x3=er(),E3=Mc(),S3=Vg(),w3=Object;yE.exports=S3?function(n){return typeof n=="symbol"}:function(n){var t=_3("Symbol");return x3(t)&&E3(t.prototype,w3(n))}});var zu=X((Det,vE)=>{"use strict";var M3=String;vE.exports=function(n){try{return M3(n)}catch(t){return"Object"}}});var _s=X((Fet,_E)=>{"use strict";var b3=er(),A3=zu(),T3=TypeError;_E.exports=function(n){if(b3(n))return n;throw new T3(A3(n)+" is not a function")}});var Tc=X((Uet,xE)=>{"use strict";var C3=_s(),I3=th();xE.exports=function(n,t){var e=n[t];return I3(e)?void 0:C3(e)}});var SE=X((Bet,EE)=>{"use strict";var Hg=vr(),Wg=er(),Xg=xi(),P3=TypeError;EE.exports=function(n,t){var e,i;if(t==="string"&&Wg(e=n.toString)&&!Xg(i=Hg(e,n))||Wg(e=n.valueOf)&&!Xg(i=Hg(e,n))||t!=="string"&&Wg(e=n.toString)&&!Xg(i=Hg(e,n)))return i;throw new P3("Can't convert object to primitive value")}});var Cc=X((zet,wE)=>{"use strict";wE.exports=!1});var rh=X((Get,bE)=>{"use strict";var ME=Sn(),R3=Object.defineProperty;bE.exports=function(n,t){try{R3(ME,n,{value:t,configurable:!0,writable:!0})}catch(e){ME[n]=t}return t}});var ih=X((ket,CE)=>{"use strict";var L3=Cc(),N3=Sn(),O3=rh(),AE="__core-js_shared__",TE=CE.exports=N3[AE]||O3(AE,{});(TE.versions||(TE.versions=[])).push({version:"3.42.0",mode:L3?"pure":"global",copyright:"\\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var oh=X((qet,PE)=>{"use strict";var IE=ih();PE.exports=function(n,t){return IE[n]||(IE[n]=t||{})}});var Vi=X((Vet,RE)=>{"use strict";var D3=Fu(),F3=Object;RE.exports=function(n){return F3(D3(n))}});var oo=X((Het,LE)=>{"use strict";var U3=In(),B3=Vi(),z3=U3({}.hasOwnProperty);LE.exports=Object.hasOwn||function(t,e){return z3(B3(t),e)}});var sh=X((Wet,NE)=>{"use strict";var G3=In(),k3=0,q3=Math.random(),V3=G3(1 .toString);NE.exports=function(n){return"Symbol("+(n===void 0?"":n)+")_"+V3(++k3+q3,36)}});var Xr=X((Xet,DE)=>{"use strict";var H3=Sn(),W3=oh(),OE=oo(),X3=sh(),Y3=nh(),$3=Vg(),Gu=H3.Symbol,Yg=W3("wks"),Z3=$3?Gu.for||Gu:Gu&&Gu.withoutSetter||X3;DE.exports=function(n){return OE(Yg,n)||(Yg[n]=Y3&&OE(Gu,n)?Gu[n]:Z3("Symbol."+n)),Yg[n]}});var $g=X((Yet,BE)=>{"use strict";var J3=vr(),FE=xi(),UE=Ac(),j3=Tc(),K3=SE(),Q3=Xr(),tF=TypeError,eF=Q3("toPrimitive");BE.exports=function(n,t){if(!FE(n)||UE(n))return n;var e=j3(n,eF),i;if(e){if(t===void 0&&(t="default"),i=J3(e,n,t),!FE(i)||UE(i))return i;throw new tF("Can't convert object to primitive value")}return t===void 0&&(t="number"),K3(n,t)}});var ah=X(($et,zE)=>{"use strict";var nF=$g(),rF=Ac();zE.exports=function(n){var t=nF(n,"string");return rF(t)?t:t+""}});var uh=X((Zet,kE)=>{"use strict";var iF=Sn(),GE=xi(),Zg=iF.document,oF=GE(Zg)&&GE(Zg.createElement);kE.exports=function(n){return oF?Zg.createElement(n):{}}});var Jg=X((Jet,qE)=>{"use strict";var sF=ri(),aF=An(),uF=uh();qE.exports=!sF&&!aF(function(){return Object.defineProperty(uF("div"),"a",{get:function(){return 7}}).a!==7})});var lh=X(HE=>{"use strict";var lF=ri(),cF=vr(),fF=H1(),hF=wc(),pF=Uu(),dF=ah(),gF=oo(),mF=Jg(),VE=Object.getOwnPropertyDescriptor;HE.f=lF?VE:function(t,e){if(t=pF(t),e=dF(e),mF)try{return VE(t,e)}catch(i){}if(gF(t,e))return hF(!cF(fF.f,t,e),t[e])}});var jg=X((Ket,WE)=>{"use strict";var yF=ri(),vF=An();WE.exports=yF&&vF(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var so=X((Qet,XE)=>{"use strict";var _F=xi(),xF=String,EF=TypeError;XE.exports=function(n){if(_F(n))return n;throw new EF(xF(n)+" is not an object")}});var Wo=X($E=>{"use strict";var SF=ri(),wF=Jg(),MF=jg(),ch=so(),YE=ah(),bF=TypeError,Kg=Object.defineProperty,AF=Object.getOwnPropertyDescriptor,Qg="enumerable",tm="configurable",em="writable";$E.f=SF?MF?function(t,e,i){if(ch(t),e=YE(e),ch(i),typeof t=="function"&&e==="prototype"&&"value"in i&&em in i&&!i[em]){var s=AF(t,e);s&&s[em]&&(t[e]=i.value,i={configurable:tm in i?i[tm]:s[tm],enumerable:Qg in i?i[Qg]:s[Qg],writable:!1})}return Kg(t,e,i)}:Kg:function(t,e,i){if(ch(t),e=YE(e),ch(i),wF)try{return Kg(t,e,i)}catch(s){}if("get"in i||"set"in i)throw new bF("Accessors not supported");return"value"in i&&(t[e]=i.value),t}});var xs=X((ent,ZE)=>{"use strict";var TF=ri(),CF=Wo(),IF=wc();ZE.exports=TF?function(n,t,e){return CF.f(n,t,IF(1,e))}:function(n,t,e){return n[t]=e,n}});var fh=X((nnt,jE)=>{"use strict";var nm=ri(),PF=oo(),JE=Function.prototype,RF=nm&&Object.getOwnPropertyDescriptor,rm=PF(JE,"name"),LF=rm&&function(){}.name==="something",NF=rm&&(!nm||nm&&RF(JE,"name").configurable);jE.exports={EXISTS:rm,PROPER:LF,CONFIGURABLE:NF}});var om=X((rnt,KE)=>{"use strict";var OF=In(),DF=er(),im=ih(),FF=OF(Function.toString);DF(im.inspectSource)||(im.inspectSource=function(n){return FF(n)});KE.exports=im.inspectSource});var eS=X((int,tS)=>{"use strict";var UF=Sn(),BF=er(),QE=UF.WeakMap;tS.exports=BF(QE)&&/native code/.test(String(QE))});var hh=X((ont,rS)=>{"use strict";var zF=oh(),GF=sh(),nS=zF("keys");rS.exports=function(n){return nS[n]||(nS[n]=GF(n))}});var ph=X((snt,iS)=>{"use strict";iS.exports={}});var Va=X((ant,aS)=>{"use strict";var kF=eS(),sS=Sn(),qF=xi(),VF=xs(),sm=oo(),am=ih(),HF=hh(),WF=ph(),oS="Object already initialized",um=sS.TypeError,XF=sS.WeakMap,dh,Ic,gh,YF=function(n){return gh(n)?Ic(n):dh(n,{})},$F=function(n){return function(t){var e;if(!qF(t)||(e=Ic(t)).type!==n)throw new um("Incompatible receiver, "+n+" required");return e}};kF||am.state?(wo=am.state||(am.state=new XF),wo.get=wo.get,wo.has=wo.has,wo.set=wo.set,dh=function(n,t){if(wo.has(n))throw new um(oS);return t.facade=n,wo.set(n,t),t},Ic=function(n){return wo.get(n)||{}},gh=function(n){return wo.has(n)}):(qa=HF("state"),WF[qa]=!0,dh=function(n,t){if(sm(n,qa))throw new um(oS);return t.facade=n,VF(n,qa,t),t},Ic=function(n){return sm(n,qa)?n[qa]:{}},gh=function(n){return sm(n,qa)});var wo,qa;aS.exports={set:dh,get:Ic,has:gh,enforce:YF,getterFor:$F}});var fm=X((unt,cS)=>{"use strict";var cm=In(),ZF=An(),JF=er(),mh=oo(),lm=ri(),jF=fh().CONFIGURABLE,KF=om(),lS=Va(),QF=lS.enforce,tU=lS.get,uS=String,yh=Object.defineProperty,eU=cm("".slice),nU=cm("".replace),rU=cm([].join),iU=lm&&!ZF(function(){return yh(function(){},"length",{value:8}).length!==8}),oU=String(String).split("String"),sU=cS.exports=function(n,t,e){eU(uS(t),0,7)==="Symbol("&&(t="["+nU(uS(t),/^Symbol\\(([^)]*)\\).*$/,"$1")+"]"),e&&e.getter&&(t="get "+t),e&&e.setter&&(t="set "+t),(!mh(n,"name")||jF&&n.name!==t)&&(lm?yh(n,"name",{value:t,configurable:!0}):n.name=t),iU&&e&&mh(e,"arity")&&n.length!==e.arity&&yh(n,"length",{value:e.arity});try{e&&mh(e,"constructor")&&e.constructor?lm&&yh(n,"prototype",{writable:!1}):n.prototype&&(n.prototype=void 0)}catch(s){}var i=QF(n);return mh(i,"source")||(i.source=rU(oU,typeof t=="string"?t:"")),n};Function.prototype.toString=sU(function(){return JF(this)&&tU(this).source||KF(this)},"toString")});var Ha=X((lnt,fS)=>{"use strict";var aU=er(),uU=Wo(),lU=fm(),cU=rh();fS.exports=function(n,t,e,i){i||(i={});var s=i.enumerable,u=i.name!==void 0?i.name:t;if(aU(e)&&lU(e,u,i),i.global)s?n[t]=e:cU(t,e);else{try{i.unsafe?n[t]&&(s=!0):delete n[t]}catch(c){}s?n[t]=e:uU.f(n,t,{value:e,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return n}});var pS=X((cnt,hS)=>{"use strict";var fU=Math.ceil,hU=Math.floor;hS.exports=Math.trunc||function(t){var e=+t;return(e>0?hU:fU)(e)}});var Hi=X((fnt,dS)=>{"use strict";var pU=pS();dS.exports=function(n){var t=+n;return t!==t||t===0?0:pU(t)}});var vh=X((hnt,gS)=>{"use strict";var dU=Hi(),gU=Math.max,mU=Math.min;gS.exports=function(n,t){var e=dU(n);return e<0?gU(e+t,0):mU(e,t)}});var Wa=X((pnt,mS)=>{"use strict";var yU=Hi(),vU=Math.min;mS.exports=function(n){var t=yU(n);return t>0?vU(t,9007199254740991):0}});var ii=X((dnt,yS)=>{"use strict";var _U=Wa();yS.exports=function(n){return _U(n.length)}});var xS=X((gnt,_S)=>{"use strict";var xU=Uu(),EU=vh(),SU=ii(),vS=function(n){return function(t,e,i){var s=xU(t),u=SU(s);if(u===0)return!n&&-1;var c=EU(i,u),f;if(n&&e!==e){for(;u>c;)if(f=s[c++],f!==f)return!0}else for(;u>c;c++)if((n||c in s)&&s[c]===e)return n||c||0;return!n&&-1}};_S.exports={includes:vS(!0),indexOf:vS(!1)}});var pm=X((mnt,SS)=>{"use strict";var wU=In(),hm=oo(),MU=Uu(),bU=xS().indexOf,AU=ph(),ES=wU([].push);SS.exports=function(n,t){var e=MU(n),i=0,s=[],u;for(u in e)!hm(AU,u)&&hm(e,u)&&ES(s,u);for(;t.length>i;)hm(e,u=t[i++])&&(~bU(s,u)||ES(s,u));return s}});var _h=X((ynt,wS)=>{"use strict";wS.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var dm=X(MS=>{"use strict";var TU=pm(),CU=_h(),IU=CU.concat("length","prototype");MS.f=Object.getOwnPropertyNames||function(t){return TU(t,IU)}});var AS=X(bS=>{"use strict";bS.f=Object.getOwnPropertySymbols});var CS=X((xnt,TS)=>{"use strict";var PU=$s(),RU=In(),LU=dm(),NU=AS(),OU=so(),DU=RU([].concat);TS.exports=PU("Reflect","ownKeys")||function(t){var e=LU.f(OU(t)),i=NU.f;return i?DU(e,i(t)):e}});var gm=X((Ent,PS)=>{"use strict";var IS=oo(),FU=CS(),UU=lh(),BU=Wo();PS.exports=function(n,t,e){for(var i=FU(t),s=BU.f,u=UU.f,c=0;c<i.length;c++){var f=i[c];!IS(n,f)&&!(e&&IS(e,f))&&s(n,f,u(t,f))}}});var LS=X((Snt,RS)=>{"use strict";var zU=An(),GU=er(),kU=/#|\\.prototype\\./,Pc=function(n,t){var e=VU[qU(n)];return e===WU?!0:e===HU?!1:GU(t)?zU(t):!!t},qU=Pc.normalize=function(n){return String(n).replace(kU,".").toLowerCase()},VU=Pc.data={},HU=Pc.NATIVE="N",WU=Pc.POLYFILL="P";RS.exports=Pc});var sr=X((wnt,NS)=>{"use strict";var xh=Sn(),XU=lh().f,YU=xs(),$U=Ha(),ZU=rh(),JU=gm(),jU=LS();NS.exports=function(n,t){var e=n.target,i=n.global,s=n.stat,u,c,f,p,d,g;if(i?c=xh:s?c=xh[e]||ZU(e,{}):c=xh[e]&&xh[e].prototype,c)for(f in t){if(d=t[f],n.dontCallGetSet?(g=XU(c,f),p=g&&g.value):p=c[f],u=jU(i?f:e+(s?".":"#")+f,n.forced),!u&&p!==void 0){if(typeof d==typeof p)continue;JU(d,p)}(n.sham||p&&p.sham)&&YU(d,"sham",!0),$U(c,f,d,n)}}});var Rc=X((Mnt,OS)=>{"use strict";var KU=vs();OS.exports=Array.isArray||function(t){return KU(t)==="Array"}});var mm=X((bnt,DS)=>{"use strict";var QU=ri(),tB=Rc(),eB=TypeError,nB=Object.getOwnPropertyDescriptor,rB=QU&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(n){return n instanceof TypeError}}();DS.exports=rB?function(n,t){if(tB(n)&&!nB(n,"length").writable)throw new eB("Cannot set read only .length");return n.length=t}:function(n,t){return n.length=t}});var Eh=X((Ant,FS)=>{"use strict";var iB=TypeError,oB=9007199254740991;FS.exports=function(n){if(n>oB)throw iB("Maximum allowed index exceeded");return n}});var Sh=X(()=>{"use strict";var sB=sr(),aB=Vi(),uB=ii(),lB=mm(),cB=Eh(),fB=An(),hB=fB(function(){return[].push.call({length:4294967296},1)!==4294967297}),pB=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(n){return n instanceof TypeError}},dB=hB||!pB();sB({target:"Array",proto:!0,arity:1,forced:dB},{push:function(t){var e=aB(this),i=uB(e),s=arguments.length;cB(i+s);for(var u=0;u<s;u++)e[i]=arguments[u],i++;return lB(e,i),i}})});var US=X(()=>{"use strict";var gB=sr(),mB=vr();gB({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return mB(URL.prototype.toString,this)}})});var zS=X((Rnt,BS)=>{"use strict";BS.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}});var qS=X((Lnt,kS)=>{"use strict";var yB=uh(),ym=yB("span").classList,GS=ym&&ym.constructor&&ym.constructor.prototype;kS.exports=GS===Object.prototype?void 0:GS});var HS=X((Nnt,VS)=>{"use strict";var vB=pm(),_B=_h();VS.exports=Object.keys||function(t){return vB(t,_B)}});var XS=X(WS=>{"use strict";var xB=ri(),EB=jg(),SB=Wo(),wB=so(),MB=Uu(),bB=HS();WS.f=xB&&!EB?Object.defineProperties:function(t,e){wB(t);for(var i=MB(e),s=bB(e),u=s.length,c=0,f;u>c;)SB.f(t,f=s[c++],i[f]);return t}});var $S=X((Dnt,YS)=>{"use strict";var AB=$s();YS.exports=AB("document","documentElement")});var ku=X((Fnt,ew)=>{"use strict";var TB=so(),CB=XS(),ZS=_h(),IB=ph(),PB=$S(),RB=uh(),LB=hh(),JS=">",jS="<",_m="prototype",xm="script",QS=LB("IE_PROTO"),vm=function(){},tw=function(n){return jS+xm+JS+n+jS+"/"+xm+JS},KS=function(n){n.write(tw("")),n.close();var t=n.parentWindow.Object;return n=null,t},NB=function(){var n=RB("iframe"),t="java"+xm+":",e;return n.style.display="none",PB.appendChild(n),n.src=String(t),e=n.contentWindow.document,e.open(),e.write(tw("document.F=Object")),e.close(),e.F},wh,Mh=function(){try{wh=new ActiveXObject("htmlfile")}catch(t){}Mh=typeof document!="undefined"?document.domain&&wh?KS(wh):NB():KS(wh);for(var n=ZS.length;n--;)delete Mh[_m][ZS[n]];return Mh()};IB[QS]=!0;ew.exports=Object.create||function(t,e){var i;return t!==null?(vm[_m]=TB(t),i=new vm,vm[_m]=null,i[QS]=t):i=Mh(),e===void 0?i:CB.f(i,e)}});var wm=X((Unt,nw)=>{"use strict";var OB=Xr(),DB=ku(),FB=Wo().f,Em=OB("unscopables"),Sm=Array.prototype;Sm[Em]===void 0&&FB(Sm,Em,{configurable:!0,value:DB(null)});nw.exports=function(n){Sm[Em][n]=!0}});var qu=X((Bnt,rw)=>{"use strict";rw.exports={}});var ow=X((znt,iw)=>{"use strict";var UB=An();iw.exports=!UB(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype})});var Lc=X((Gnt,aw)=>{"use strict";var BB=oo(),zB=er(),GB=Vi(),kB=hh(),qB=ow(),sw=kB("IE_PROTO"),Mm=Object,VB=Mm.prototype;aw.exports=qB?Mm.getPrototypeOf:function(n){var t=GB(n);if(BB(t,sw))return t[sw];var e=t.constructor;return zB(e)&&t instanceof e?e.prototype:t instanceof Mm?VB:null}});var Cm=X((knt,cw)=>{"use strict";var HB=An(),WB=er(),XB=xi(),YB=ku(),uw=Lc(),$B=Ha(),ZB=Xr(),JB=Cc(),Tm=ZB("iterator"),lw=!1,Es,bm,Am;[].keys&&(Am=[].keys(),"next"in Am?(bm=uw(uw(Am)),bm!==Object.prototype&&(Es=bm)):lw=!0);var jB=!XB(Es)||HB(function(){var n={};return Es[Tm].call(n)!==n});jB?Es={}:JB&&(Es=YB(Es));WB(Es[Tm])||$B(Es,Tm,function(){return this});cw.exports={IteratorPrototype:Es,BUGGY_SAFARI_ITERATORS:lw}});var Nc=X((qnt,hw)=>{"use strict";var KB=Wo().f,QB=oo(),tz=Xr(),fw=tz("toStringTag");hw.exports=function(n,t,e){n&&!e&&(n=n.prototype),n&&!QB(n,fw)&&KB(n,fw,{configurable:!0,value:t})}});var dw=X((Vnt,pw)=>{"use strict";var ez=Cm().IteratorPrototype,nz=ku(),rz=wc(),iz=Nc(),oz=qu(),sz=function(){return this};pw.exports=function(n,t,e,i){var s=t+" Iterator";return n.prototype=nz(ez,{next:rz(+!i,e)}),iz(n,s,!1,!0),oz[s]=sz,n}});var Oc=X((Hnt,gw)=>{"use strict";var az=In(),uz=_s();gw.exports=function(n,t,e){try{return az(uz(Object.getOwnPropertyDescriptor(n,t)[e]))}catch(i){}}});var yw=X((Wnt,mw)=>{"use strict";var lz=xi();mw.exports=function(n){return lz(n)||n===null}});var _w=X((Xnt,vw)=>{"use strict";var cz=yw(),fz=String,hz=TypeError;vw.exports=function(n){if(cz(n))return n;throw new hz("Can't set "+fz(n)+" as a prototype")}});var Vu=X((Ynt,xw)=>{"use strict";var pz=Oc(),dz=xi(),gz=Fu(),mz=_w();xw.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var n=!1,t={},e;try{e=pz(Object.prototype,"__proto__","set"),e(t,[]),n=t instanceof Array}catch(i){}return function(s,u){return gz(s),mz(u),dz(s)&&(n?e(s,u):s.__proto__=u),s}}():void 0)});var Rw=X(($nt,Pw)=>{"use strict";var yz=sr(),vz=vr(),bh=Cc(),Cw=fh(),_z=er(),xz=dw(),Ew=Lc(),Sw=Vu(),Ez=Nc(),Sz=xs(),Im=Ha(),wz=Xr(),ww=qu(),Iw=Cm(),Mz=Cw.PROPER,bz=Cw.CONFIGURABLE,Mw=Iw.IteratorPrototype,Ah=Iw.BUGGY_SAFARI_ITERATORS,Dc=wz("iterator"),bw="keys",Fc="values",Aw="entries",Tw=function(){return this};Pw.exports=function(n,t,e,i,s,u,c){xz(e,t,i);var f=function(x){if(x===s&&v)return v;if(!Ah&&x&&x in g)return g[x];switch(x){case bw:return function(){return new e(this,x)};case Fc:return function(){return new e(this,x)};case Aw:return function(){return new e(this,x)}}return function(){return new e(this)}},p=t+" Iterator",d=!1,g=n.prototype,y=g[Dc]||g["@@iterator"]||s&&g[s],v=!Ah&&y||f(s),E=t==="Array"&&g.entries||y,M,A,_;if(E&&(M=Ew(E.call(new n)),M!==Object.prototype&&M.next&&(!bh&&Ew(M)!==Mw&&(Sw?Sw(M,Mw):_z(M[Dc])||Im(M,Dc,Tw)),Ez(M,p,!0,!0),bh&&(ww[p]=Tw))),Mz&&s===Fc&&y&&y.name!==Fc&&(!bh&&bz?Sz(g,"name",Fc):(d=!0,v=function(){return vz(y,this)})),s)if(A={values:f(Fc),keys:u?v:f(bw),entries:f(Aw)},c)for(_ in A)(Ah||d||!(_ in g))&&Im(g,_,A[_]);else yz({target:t,proto:!0,forced:Ah||d},A);return(!bh||c)&&g[Dc]!==v&&Im(g,Dc,v,{name:s}),ww[t]=v,A}});var Nw=X((Znt,Lw)=>{"use strict";Lw.exports=function(n,t){return{value:n,done:t}}});var zw=X((Jnt,Bw)=>{"use strict";var Az=Uu(),Pm=wm(),Ow=qu(),Fw=Va(),Tz=Wo().f,Cz=Rw(),Th=Nw(),Iz=Cc(),Pz=ri(),Uw="Array Iterator",Rz=Fw.set,Lz=Fw.getterFor(Uw);Bw.exports=Cz(Array,"Array",function(n,t){Rz(this,{type:Uw,target:Az(n),index:0,kind:t})},function(){var n=Lz(this),t=n.target,e=n.index++;if(!t||e>=t.length)return n.target=null,Th(void 0,!0);switch(n.kind){case"keys":return Th(e,!1);case"values":return Th(t[e],!1)}return Th([e,t[e]],!1)},"values");var Dw=Ow.Arguments=Ow.Array;Pm("keys");Pm("values");Pm("entries");if(!Iz&&Pz&&Dw.name!=="values")try{Tz(Dw,"name",{value:"values"})}catch(n){}});var Bc=X(()=>{"use strict";var Gw=Sn(),qw=zS(),Nz=qS(),Uc=zw(),kw=xs(),Oz=Nc(),Dz=Xr(),Rm=Dz("iterator"),Lm=Uc.values,Vw=function(n,t){if(n){if(n[Rm]!==Lm)try{kw(n,Rm,Lm)}catch(i){n[Rm]=Lm}if(Oz(n,t,!0),qw[t]){for(var e in Uc)if(n[e]!==Uc[e])try{kw(n,e,Uc[e])}catch(i){n[e]=Uc[e]}}}};for(Ch in qw)Vw(Gw[Ch]&&Gw[Ch].prototype,Ch);var Ch;Vw(Nz,"DOMTokenList")});var Ih=X((Qnt,Hw)=>{"use strict";var Fz=vs(),Uz=In();Hw.exports=function(n){if(Fz(n)==="Function")return Uz(n)}});var zc=X((trt,Xw)=>{"use strict";var Ww=Ih(),Bz=_s(),zz=Sc(),Gz=Ww(Ww.bind);Xw.exports=function(n,t){return Bz(n),t===void 0?n:zz?Gz(n,t):function(){return n.apply(t,arguments)}}});var Zw=X((ert,$w)=>{"use strict";var kz=Rc(),qz=ii(),Vz=Eh(),Hz=zc(),Yw=function(n,t,e,i,s,u,c,f){for(var p=s,d=0,g=c?Hz(c,f):!1,y,v;d<i;)d in e&&(y=g?g(e[d],d,t):e[d],u>0&&kz(y)?(v=qz(y),p=Yw(n,t,y,v,p,u-1)-1):(Vz(p+1),n[p]=y),p++),d++;return p};$w.exports=Yw});var Kw=X((nrt,jw)=>{"use strict";var Wz=Xr(),Xz=Wz("toStringTag"),Jw={};Jw[Xz]="z";jw.exports=String(Jw)==="[object z]"});var Zs=X((rrt,Qw)=>{"use strict";var Yz=Kw(),$z=er(),Ph=vs(),Zz=Xr(),Jz=Zz("toStringTag"),jz=Object,Kz=Ph(function(){return arguments}())==="Arguments",Qz=function(n,t){try{return n[t]}catch(e){}};Qw.exports=Yz?Ph:function(n){var t,e,i;return n===void 0?"Undefined":n===null?"Null":typeof(e=Qz(t=jz(n),Jz))=="string"?e:Kz?Ph(t):(i=Ph(t))==="Object"&&$z(t.callee)?"Arguments":i}});var Om=X((irt,iM)=>{"use strict";var tG=In(),eG=An(),tM=er(),nG=Zs(),rG=$s(),iG=om(),eM=function(){},nM=rG("Reflect","construct"),Nm=/^\\s*(?:class|function)\\b/,oG=tG(Nm.exec),sG=!Nm.test(eM),Gc=function(t){if(!tM(t))return!1;try{return nM(eM,[],t),!0}catch(e){return!1}},rM=function(t){if(!tM(t))return!1;switch(nG(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return sG||!!oG(Nm,iG(t))}catch(e){return!0}};rM.sham=!0;iM.exports=!nM||eG(function(){var n;return Gc(Gc.call)||!Gc(Object)||!Gc(function(){n=!0})||n})?rM:Gc});var uM=X((ort,aM)=>{"use strict";var oM=Rc(),aG=Om(),uG=xi(),lG=Xr(),cG=lG("species"),sM=Array;aM.exports=function(n){var t;return oM(n)&&(t=n.constructor,aG(t)&&(t===sM||oM(t.prototype))?t=void 0:uG(t)&&(t=t[cG],t===null&&(t=void 0))),t===void 0?sM:t}});var Dm=X((srt,lM)=>{"use strict";var fG=uM();lM.exports=function(n,t){return new(fG(n))(t===0?0:t)}});var cM=X(()=>{"use strict";var hG=sr(),pG=Zw(),dG=Vi(),gG=ii(),mG=Hi(),yG=Dm();hG({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=dG(this),i=gG(e),s=yG(e,0);return s.length=pG(s,e,e,i,0,t===void 0?1:mG(t)),s}})});var fM=X(()=>{"use strict";var vG=wm();vG("flat")});var mM=X((frt,gM)=>{"use strict";var _G=Xr(),pM=_G("iterator"),dM=!1;try{hM=0,Fm={next:function(){return{done:!!hM++}},return:function(){dM=!0}},Fm[pM]=function(){return this},Array.from(Fm,function(){throw 2})}catch(n){}var hM,Fm;gM.exports=function(n,t){try{if(!t&&!dM)return!1}catch(s){return!1}var e=!1;try{var i={};i[pM]=function(){return{next:function(){return{done:e=!0}}}},n(i)}catch(s){}return e}});var Rh=X((hrt,yM)=>{"use strict";yM.exports=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"});var Hu=X((prt,_M)=>{"use strict";var vM=fm(),xG=Wo();_M.exports=function(n,t,e){return e.get&&vM(e.get,t,{getter:!0}),e.set&&vM(e.set,t,{setter:!0}),xG.f(n,t,e)}});var Wi=X((drt,IM)=>{"use strict";var EG=Rh(),Gm=ri(),Ei=Sn(),wM=er(),Oh=xi(),js=oo(),km=Zs(),SG=zu(),wG=xs(),Um=Ha(),MG=Hu(),bG=Mc(),Dh=Lc(),Xu=Vu(),AG=Xr(),TG=sh(),MM=Va(),bM=MM.enforce,CG=MM.get,Lh=Ei.Int8Array,Bm=Lh&&Lh.prototype,xM=Ei.Uint8ClampedArray,EM=xM&&xM.prototype,Xo=Lh&&Dh(Lh),Mo=Bm&&Dh(Bm),IG=Object.prototype,qm=Ei.TypeError,SM=AG("toStringTag"),zm=TG("TYPED_ARRAY_TAG"),Nh="TypedArrayConstructor",Ss=EG&&!!Xu&&km(Ei.opera)!=="Opera",AM=!1,Li,Js,Wu,ws={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Vm={BigInt64Array:8,BigUint64Array:8},PG=function(t){if(!Oh(t))return!1;var e=km(t);return e==="DataView"||js(ws,e)||js(Vm,e)},TM=function(n){var t=Dh(n);if(Oh(t)){var e=CG(t);return e&&js(e,Nh)?e[Nh]:TM(t)}},CM=function(n){if(!Oh(n))return!1;var t=km(n);return js(ws,t)||js(Vm,t)},RG=function(n){if(CM(n))return n;throw new qm("Target is not a typed array")},LG=function(n){if(wM(n)&&(!Xu||bG(Xo,n)))return n;throw new qm(SG(n)+" is not a typed array constructor")},NG=function(n,t,e,i){if(Gm){if(e)for(var s in ws){var u=Ei[s];if(u&&js(u.prototype,n))try{delete u.prototype[n]}catch(c){try{u.prototype[n]=t}catch(f){}}}(!Mo[n]||e)&&Um(Mo,n,e?t:Ss&&Bm[n]||t,i)}},OG=function(n,t,e){var i,s;if(Gm){if(Xu){if(e){for(i in ws)if(s=Ei[i],s&&js(s,n))try{delete s[n]}catch(u){}}if(!Xo[n]||e)try{return Um(Xo,n,e?t:Ss&&Xo[n]||t)}catch(u){}else return}for(i in ws)s=Ei[i],s&&(!s[n]||e)&&Um(s,n,t)}};for(Li in ws)Js=Ei[Li],Wu=Js&&Js.prototype,Wu?bM(Wu)[Nh]=Js:Ss=!1;for(Li in Vm)Js=Ei[Li],Wu=Js&&Js.prototype,Wu&&(bM(Wu)[Nh]=Js);if((!Ss||!wM(Xo)||Xo===Function.prototype)&&(Xo=function(){throw new qm("Incorrect invocation")},Ss))for(Li in ws)Ei[Li]&&Xu(Ei[Li],Xo);if((!Ss||!Mo||Mo===IG)&&(Mo=Xo.prototype,Ss))for(Li in ws)Ei[Li]&&Xu(Ei[Li].prototype,Mo);Ss&&Dh(EM)!==Mo&&Xu(EM,Mo);if(Gm&&!js(Mo,SM)){AM=!0,MG(Mo,SM,{configurable:!0,get:function(){return Oh(this)?this[zm]:void 0}});for(Li in ws)Ei[Li]&&wG(Ei[Li],zm,Li)}IM.exports={NATIVE_ARRAY_BUFFER_VIEWS:Ss,TYPED_ARRAY_TAG:AM&&zm,aTypedArray:RG,aTypedArrayConstructor:LG,exportTypedArrayMethod:NG,exportTypedArrayStaticMethod:OG,getTypedArrayConstructor:TM,isView:PG,isTypedArray:CM,TypedArray:Xo,TypedArrayPrototype:Mo}});var LM=X((grt,RM)=>{"use strict";var PM=Sn(),Hm=An(),DG=mM(),FG=Wi().NATIVE_ARRAY_BUFFER_VIEWS,UG=PM.ArrayBuffer,Xa=PM.Int8Array;RM.exports=!FG||!Hm(function(){Xa(1)})||!Hm(function(){new Xa(-1)})||!DG(function(n){new Xa,new Xa(null),new Xa(1.5),new Xa(n)},!0)||Hm(function(){return new Xa(new UG(2),1,void 0).length!==1})});var OM=X((mrt,NM)=>{"use strict";var BG=Ha();NM.exports=function(n,t,e){for(var i in t)BG(n,i,t[i],e);return n}});var Wm=X((yrt,DM)=>{"use strict";var zG=Mc(),GG=TypeError;DM.exports=function(n,t){if(zG(t,n))return n;throw new GG("Incorrect invocation")}});var Fh=X((vrt,FM)=>{"use strict";var kG=Hi(),qG=Wa(),VG=RangeError;FM.exports=function(n){if(n===void 0)return 0;var t=kG(n),e=qG(t);if(t!==e)throw new VG("Wrong length or index");return e}});var BM=X((_rt,UM)=>{"use strict";UM.exports=Math.sign||function(t){var e=+t;return e===0||e!==e?e:e<0?-1:1}});var kM=X((xrt,GM)=>{"use strict";var HG=2220446049250313e-31,zM=1/HG;GM.exports=function(n){return n+zM-zM}});var VM=X((Ert,qM)=>{"use strict";var WG=BM(),XG=kM(),YG=Math.abs,$G=2220446049250313e-31;qM.exports=function(n,t,e,i){var s=+n,u=YG(s),c=WG(s);if(u<i)return c*XG(u/i/t)*i*t;var f=(1+t/$G)*u,p=f-(f-u);return p>e||p!==p?c*(1/0):c*p}});var WM=X((Srt,HM)=>{"use strict";var ZG=VM(),JG=11920928955078125e-23,jG=34028234663852886e22,KG=11754943508222875e-54;HM.exports=Math.fround||function(t){return ZG(t,JG,jG,KG)}});var YM=X((wrt,XM)=>{"use strict";var QG=Array,t4=Math.abs,Ms=Math.pow,e4=Math.floor,n4=Math.log,r4=Math.LN2,i4=function(n,t,e){var i=QG(e),s=e*8-t-1,u=(1<<s)-1,c=u>>1,f=t===23?Ms(2,-24)-Ms(2,-77):0,p=n<0||n===0&&1/n<0?1:0,d=0,g,y,v;for(n=t4(n),n!==n||n===1/0?(y=n!==n?1:0,g=u):(g=e4(n4(n)/r4),v=Ms(2,-g),n*v<1&&(g--,v*=2),g+c>=1?n+=f/v:n+=f*Ms(2,1-c),n*v>=2&&(g++,v/=2),g+c>=u?(y=0,g=u):g+c>=1?(y=(n*v-1)*Ms(2,t),g+=c):(y=n*Ms(2,c-1)*Ms(2,t),g=0));t>=8;)i[d++]=y&255,y/=256,t-=8;for(g=g<<t|y,s+=t;s>0;)i[d++]=g&255,g/=256,s-=8;return i[d-1]|=p*128,i},o4=function(n,t){var e=n.length,i=e*8-t-1,s=(1<<i)-1,u=s>>1,c=i-7,f=e-1,p=n[f--],d=p&127,g;for(p>>=7;c>0;)d=d*256+n[f--],c-=8;for(g=d&(1<<-c)-1,d>>=-c,c+=t;c>0;)g=g*256+n[f--],c-=8;if(d===0)d=1-u;else{if(d===s)return g?NaN:p?-1/0:1/0;g+=Ms(2,t),d-=u}return(p?-1:1)*g*Ms(2,d-t)};XM.exports={pack:i4,unpack:o4}});var Xm=X((Mrt,ZM)=>{"use strict";var s4=Vi(),$M=vh(),a4=ii();ZM.exports=function(t){for(var e=s4(this),i=a4(e),s=arguments.length,u=$M(s>1?arguments[1]:void 0,i),c=s>2?arguments[2]:void 0,f=c===void 0?i:$M(c,i);f>u;)e[u++]=t;return e}});var Uh=X((brt,JM)=>{"use strict";var u4=In();JM.exports=u4([].slice)});var Ym=X((Art,KM)=>{"use strict";var l4=er(),c4=xi(),jM=Vu();KM.exports=function(n,t,e){var i,s;return jM&&l4(i=t.constructor)&&i!==e&&c4(s=i.prototype)&&s!==e.prototype&&jM(n,s),n}});var Hh=X((Trt,gb)=>{"use strict";var qh=Sn(),Km=In(),$m=ri(),f4=Rh(),cb=fh(),h4=xs(),p4=Hu(),QM=OM(),Zm=An(),Bh=Wm(),d4=Hi(),g4=Wa(),Gh=Fh(),m4=WM(),fb=YM(),y4=Lc(),tb=Vu(),v4=Xm(),_4=Uh(),x4=Ym(),E4=gm(),hb=Nc(),Qm=Va(),S4=cb.PROPER,eb=cb.CONFIGURABLE,$u="ArrayBuffer",Vh="DataView",Zu="prototype",w4="Wrong length",pb="Wrong index",nb=Qm.getterFor($u),qc=Qm.getterFor(Vh),rb=Qm.set,bo=qh[$u],Xi=bo,Yu=Xi&&Xi[Zu],Yo=qh[Vh],Ya=Yo&&Yo[Zu],ib=Object.prototype,M4=qh.Array,kh=qh.RangeError,b4=Km(v4),A4=Km([].reverse),db=fb.pack,ob=fb.unpack,sb=function(n){return[n&255]},ab=function(n){return[n&255,n>>8&255]},ub=function(n){return[n&255,n>>8&255,n>>16&255,n>>24&255]},lb=function(n){return n[3]<<24|n[2]<<16|n[1]<<8|n[0]},T4=function(n){return db(m4(n),23,4)},C4=function(n){return db(n,52,8)},zh=function(n,t,e){p4(n[Zu],t,{configurable:!0,get:function(){return e(this)[t]}})},Ks=function(n,t,e,i){var s=qc(n),u=Gh(e),c=!!i;if(u+t>s.byteLength)throw new kh(pb);var f=s.bytes,p=u+s.byteOffset,d=_4(f,p,p+t);return c?d:A4(d)},Qs=function(n,t,e,i,s,u){var c=qc(n),f=Gh(e),p=i(+s),d=!!u;if(f+t>c.byteLength)throw new kh(pb);for(var g=c.bytes,y=f+c.byteOffset,v=0;v<t;v++)g[y+v]=p[d?v:t-v-1]};f4?(Jm=S4&&bo.name!==$u,!Zm(function(){bo(1)})||!Zm(function(){new bo(-1)})||Zm(function(){return new bo,new bo(1.5),new bo(NaN),bo.length!==1||Jm&&!eb})?(Xi=function(t){return Bh(this,Yu),x4(new bo(Gh(t)),this,Xi)},Xi[Zu]=Yu,Yu.constructor=Xi,E4(Xi,bo)):Jm&&eb&&h4(bo,"name",$u),tb&&y4(Ya)!==ib&&tb(Ya,ib),kc=new Yo(new Xi(2)),jm=Km(Ya.setInt8),kc.setInt8(0,2147483648),kc.setInt8(1,2147483649),(kc.getInt8(0)||!kc.getInt8(1))&&QM(Ya,{setInt8:function(t,e){jm(this,t,e<<24>>24)},setUint8:function(t,e){jm(this,t,e<<24>>24)}},{unsafe:!0})):(Xi=function(t){Bh(this,Yu);var e=Gh(t);rb(this,{type:$u,bytes:b4(M4(e),0),byteLength:e}),$m||(this.byteLength=e,this.detached=!1)},Yu=Xi[Zu],Yo=function(t,e,i){Bh(this,Ya),Bh(t,Yu);var s=nb(t),u=s.byteLength,c=d4(e);if(c<0||c>u)throw new kh("Wrong offset");if(i=i===void 0?u-c:g4(i),c+i>u)throw new kh(w4);rb(this,{type:Vh,buffer:t,byteLength:i,byteOffset:c,bytes:s.bytes}),$m||(this.buffer=t,this.byteLength=i,this.byteOffset=c)},Ya=Yo[Zu],$m&&(zh(Xi,"byteLength",nb),zh(Yo,"buffer",qc),zh(Yo,"byteLength",qc),zh(Yo,"byteOffset",qc)),QM(Ya,{getInt8:function(t){return Ks(this,1,t)[0]<<24>>24},getUint8:function(t){return Ks(this,1,t)[0]},getInt16:function(t){var e=Ks(this,2,t,arguments.length>1?arguments[1]:!1);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=Ks(this,2,t,arguments.length>1?arguments[1]:!1);return e[1]<<8|e[0]},getInt32:function(t){return lb(Ks(this,4,t,arguments.length>1?arguments[1]:!1))},getUint32:function(t){return lb(Ks(this,4,t,arguments.length>1?arguments[1]:!1))>>>0},getFloat32:function(t){return ob(Ks(this,4,t,arguments.length>1?arguments[1]:!1),23)},getFloat64:function(t){return ob(Ks(this,8,t,arguments.length>1?arguments[1]:!1),52)},setInt8:function(t,e){Qs(this,1,t,sb,e)},setUint8:function(t,e){Qs(this,1,t,sb,e)},setInt16:function(t,e){Qs(this,2,t,ab,e,arguments.length>2?arguments[2]:!1)},setUint16:function(t,e){Qs(this,2,t,ab,e,arguments.length>2?arguments[2]:!1)},setInt32:function(t,e){Qs(this,4,t,ub,e,arguments.length>2?arguments[2]:!1)},setUint32:function(t,e){Qs(this,4,t,ub,e,arguments.length>2?arguments[2]:!1)},setFloat32:function(t,e){Qs(this,4,t,T4,e,arguments.length>2?arguments[2]:!1)},setFloat64:function(t,e){Qs(this,8,t,C4,e,arguments.length>2?arguments[2]:!1)}}));var Jm,kc,jm;hb(Xi,$u);hb(Yo,Vh);gb.exports={ArrayBuffer:Xi,DataView:Yo}});var yb=X((Crt,mb)=>{"use strict";var I4=xi(),P4=Math.floor;mb.exports=Number.isInteger||function(t){return!I4(t)&&isFinite(t)&&P4(t)===t}});var _b=X((Irt,vb)=>{"use strict";var R4=Hi(),L4=RangeError;vb.exports=function(n){var t=R4(n);if(t<0)throw new L4("The argument can't be less than 0");return t}});var t0=X((Prt,xb)=>{"use strict";var N4=_b(),O4=RangeError;xb.exports=function(n,t){var e=N4(n);if(e%t)throw new O4("Wrong offset");return e}});var Sb=X((Rrt,Eb)=>{"use strict";var D4=Math.round;Eb.exports=function(n){var t=D4(n);return t<0?0:t>255?255:t&255}});var Mb=X((Lrt,wb)=>{"use strict";var F4=Om(),U4=zu(),B4=TypeError;wb.exports=function(n){if(F4(n))return n;throw new B4(U4(n)+" is not a constructor")}});var e0=X((Nrt,Ab)=>{"use strict";var z4=Zs(),bb=Tc(),G4=th(),k4=qu(),q4=Xr(),V4=q4("iterator");Ab.exports=function(n){if(!G4(n))return bb(n,V4)||bb(n,"@@iterator")||k4[z4(n)]}});var Cb=X((Ort,Tb)=>{"use strict";var H4=vr(),W4=_s(),X4=so(),Y4=zu(),$4=e0(),Z4=TypeError;Tb.exports=function(n,t){var e=arguments.length<2?$4(n):t;if(W4(e))return X4(H4(e,n));throw new Z4(Y4(n)+" is not iterable")}});var Pb=X((Drt,Ib)=>{"use strict";var J4=Xr(),j4=qu(),K4=J4("iterator"),Q4=Array.prototype;Ib.exports=function(n){return n!==void 0&&(j4.Array===n||Q4[K4]===n)}});var n0=X((Frt,Rb)=>{"use strict";var tk=Zs();Rb.exports=function(n){var t=tk(n);return t==="BigInt64Array"||t==="BigUint64Array"}});var Wh=X((Urt,Lb)=>{"use strict";var ek=$g(),nk=TypeError;Lb.exports=function(n){var t=ek(n,"number");if(typeof t=="number")throw new nk("Can't convert number to bigint");return BigInt(t)}});var Ob=X((Brt,Nb)=>{"use strict";var rk=zc(),ik=vr(),ok=Mb(),sk=Vi(),ak=ii(),uk=Cb(),lk=e0(),ck=Pb(),fk=n0(),hk=Wi().aTypedArrayConstructor,pk=Wh();Nb.exports=function(t){var e=ok(this),i=sk(t),s=arguments.length,u=s>1?arguments[1]:void 0,c=u!==void 0,f=lk(i),p,d,g,y,v,E,M,A;if(f&&!ck(f))for(M=uk(i,f),A=M.next,i=[];!(E=ik(A,M)).done;)i.push(E.value);for(c&&s>2&&(u=rk(u,arguments[2])),d=ak(i),g=new(hk(e))(d),y=fk(g),p=0;d>p;p++)v=c?u(i[p],p):i[p],g[p]=y?pk(v):+v;return g}});var Ub=X((zrt,Fb)=>{"use strict";var dk=zc(),gk=In(),mk=Qf(),yk=Vi(),vk=ii(),_k=Dm(),Db=gk([].push),ta=function(n){var t=n===1,e=n===2,i=n===3,s=n===4,u=n===6,c=n===7,f=n===5||u;return function(p,d,g,y){for(var v=yk(p),E=mk(v),M=vk(E),A=dk(d,g),_=0,x=y||_k,T=t?x(p,M):e||c?x(p,0):void 0,w,R;M>_;_++)if((f||_ in E)&&(w=E[_],R=A(w,_,v),n))if(t)T[_]=R;else if(R)switch(n){case 3:return!0;case 5:return w;case 6:return _;case 2:Db(T,w)}else switch(n){case 4:return!1;case 7:Db(T,w)}return u?-1:i||s?s:T}};Fb.exports={forEach:ta(0),map:ta(1),filter:ta(2),some:ta(3),every:ta(4),find:ta(5),findIndex:ta(6),filterReject:ta(7)}});var r0=X((Grt,zb)=>{"use strict";var xk=$s(),Ek=Hu(),Sk=Xr(),wk=ri(),Bb=Sk("species");zb.exports=function(n){var t=xk(n);wk&&t&&!t[Bb]&&Ek(t,Bb,{configurable:!0,get:function(){return this}})}});var i0=X((krt,Gb)=>{"use strict";var Mk=ii();Gb.exports=function(n,t,e){for(var i=0,s=arguments.length>2?e:Mk(t),u=new n(s);s>i;)u[i]=t[i++];return u}});var sA=X((qrt,f0)=>{"use strict";var kb=sr(),Kb=Sn(),qb=vr(),bk=ri(),Ak=LM(),Xc=Wi(),Qb=Hh(),Vb=Wm(),Tk=wc(),Vc=xs(),Ck=yb(),Ik=Wa(),Hb=Fh(),o0=t0(),Pk=Sb(),tA=ah(),Hc=oo(),Rk=Zs(),u0=xi(),Lk=Ac(),Nk=ku(),Ok=Mc(),Xh=Vu(),Dk=dm().f,Wb=Ob(),Fk=Ub().forEach,Uk=r0(),Bk=Hu(),eA=Wo(),nA=lh(),Xb=i0(),h0=Va(),zk=Ym(),l0=h0.get,Gk=h0.set,kk=h0.enforce,rA=eA.f,qk=nA.f,s0=Kb.RangeError,iA=Qb.ArrayBuffer,Vk=iA.prototype,Hk=Qb.DataView,Yh=Xc.NATIVE_ARRAY_BUFFER_VIEWS,Yb=Xc.TYPED_ARRAY_TAG,$b=Xc.TypedArray,Wc=Xc.TypedArrayPrototype,c0=Xc.isTypedArray,$h="BYTES_PER_ELEMENT",a0="Wrong length",Zh=function(n,t){Bk(n,t,{configurable:!0,get:function(){return l0(this)[t]}})},Zb=function(n){var t;return Ok(Vk,n)||(t=Rk(n))==="ArrayBuffer"||t==="SharedArrayBuffer"},oA=function(n,t){return c0(n)&&!Lk(t)&&t in n&&Ck(+t)&&t>=0},Jb=function(t,e){return e=tA(e),oA(t,e)?Tk(2,t[e]):qk(t,e)},jb=function(t,e,i){return e=tA(e),oA(t,e)&&u0(i)&&Hc(i,"value")&&!Hc(i,"get")&&!Hc(i,"set")&&!i.configurable&&(!Hc(i,"writable")||i.writable)&&(!Hc(i,"enumerable")||i.enumerable)?(t[e]=i.value,t):rA(t,e,i)};bk?(Yh||(nA.f=Jb,eA.f=jb,Zh(Wc,"buffer"),Zh(Wc,"byteOffset"),Zh(Wc,"byteLength"),Zh(Wc,"length")),kb({target:"Object",stat:!0,forced:!Yh},{getOwnPropertyDescriptor:Jb,defineProperty:jb}),f0.exports=function(n,t,e){var i=n.match(/\\d+/)[0]/8,s=n+(e?"Clamped":"")+"Array",u="get"+n,c="set"+n,f=Kb[s],p=f,d=p&&p.prototype,g={},y=function(A,_){var x=l0(A);return x.view[u](_*i+x.byteOffset,!0)},v=function(A,_,x){var T=l0(A);T.view[c](_*i+T.byteOffset,e?Pk(x):x,!0)},E=function(A,_){rA(A,_,{get:function(){return y(this,_)},set:function(x){return v(this,_,x)},enumerable:!0})};Yh?Ak&&(p=t(function(A,_,x,T){return Vb(A,d),zk(function(){return u0(_)?Zb(_)?T!==void 0?new f(_,o0(x,i),T):x!==void 0?new f(_,o0(x,i)):new f(_):c0(_)?Xb(p,_):qb(Wb,p,_):new f(Hb(_))}(),A,p)}),Xh&&Xh(p,$b),Fk(Dk(f),function(A){A in p||Vc(p,A,f[A])}),p.prototype=d):(p=t(function(A,_,x,T){Vb(A,d);var w=0,R=0,B,U,D;if(!u0(_))D=Hb(_),U=D*i,B=new iA(U);else if(Zb(_)){B=_,R=o0(x,i);var P=_.byteLength;if(T===void 0){if(P%i)throw new s0(a0);if(U=P-R,U<0)throw new s0(a0)}else if(U=Ik(T)*i,U+R>P)throw new s0(a0);D=U/i}else return c0(_)?Xb(p,_):qb(Wb,p,_);for(Gk(A,{buffer:B,byteOffset:R,byteLength:U,length:D,view:new Hk(B)});w<D;)E(A,w++)}),Xh&&Xh(p,$b),d=p.prototype=Nk(Wc)),d.constructor!==p&&Vc(d,"constructor",p),kk(d).TypedArrayConstructor=p,Yb&&Vc(d,Yb,s);var M=p!==f;g[s]=p,kb({global:!0,constructor:!0,forced:M,sham:!Yh},g),$h in p||Vc(p,$h,i),$h in d||Vc(d,$h,i),Uk(s)}):f0.exports=function(){}});var p0=X(()=>{"use strict";var Wk=sA();Wk("Float32",function(n){return function(e,i,s){return n(this,e,i,s)}})});var d0=X(()=>{"use strict";var aA=Wi(),Xk=ii(),Yk=Hi(),$k=aA.aTypedArray,Zk=aA.exportTypedArrayMethod;Zk("at",function(t){var e=$k(this),i=Xk(e),s=Yk(t),u=s>=0?s:i+s;return u<0||u>=i?void 0:e[u]})});var g0=X(()=>{"use strict";var uA=Wi(),Jk=Xm(),jk=Wh(),Kk=Zs(),Qk=vr(),tq=In(),eq=An(),nq=uA.aTypedArray,rq=uA.exportTypedArrayMethod,iq=tq("".slice),oq=eq(function(){var n=0;return new Int8Array(2).fill({valueOf:function(){return n++}}),n!==1});rq("fill",function(t){var e=arguments.length;nq(this);var i=iq(Kk(this),0,3)==="Big"?jk(t):+t;return Qk(Jk,this,i,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)},oq)});var m0=X((Zrt,cA)=>{"use strict";var sq=zc(),aq=Qf(),uq=Vi(),lq=ii(),lA=function(n){var t=n===1;return function(e,i,s){for(var u=uq(e),c=aq(u),f=lq(c),p=sq(i,s),d,g;f-- >0;)if(d=c[f],g=p(d,f,u),g)switch(n){case 0:return d;case 1:return f}return t?-1:void 0}};cA.exports={findLast:lA(0),findLastIndex:lA(1)}});var y0=X(()=>{"use strict";var fA=Wi(),cq=m0().findLast,fq=fA.aTypedArray,hq=fA.exportTypedArrayMethod;hq("findLast",function(t){return cq(fq(this),t,arguments.length>1?arguments[1]:void 0)})});var v0=X(()=>{"use strict";var hA=Wi(),pq=m0().findLastIndex,dq=hA.aTypedArray,gq=hA.exportTypedArrayMethod;gq("findLastIndex",function(t){return pq(dq(this),t,arguments.length>1?arguments[1]:void 0)})});var S0=X(()=>{"use strict";var dA=Sn(),gA=vr(),E0=Wi(),mq=ii(),yq=t0(),vq=Vi(),mA=An(),_q=dA.RangeError,_0=dA.Int8Array,pA=_0&&_0.prototype,yA=pA&&pA.set,xq=E0.aTypedArray,Eq=E0.exportTypedArrayMethod,x0=!mA(function(){var n=new Uint8ClampedArray(2);return gA(yA,n,{length:1,0:3},1),n[1]!==3}),Sq=x0&&E0.NATIVE_ARRAY_BUFFER_VIEWS&&mA(function(){var n=new _0(2);return n.set(1),n.set("2",1),n[0]!==0||n[1]!==2});Eq("set",function(t){xq(this);var e=yq(arguments.length>1?arguments[1]:void 0,1),i=vq(t);if(x0)return gA(yA,this,i,e);var s=this.length,u=mq(i),c=0;if(u+e>s)throw new _q("Wrong length");for(;c<u;)this[e+c]=i[c++]},!x0||Sq)});var M0=X((nit,_A)=>{"use strict";var vA=Uh(),wq=Math.floor,w0=function(n,t){var e=n.length;if(e<8)for(var i=1,s,u;i<e;){for(u=i,s=n[i];u&&t(n[u-1],s)>0;)n[u]=n[--u];u!==i++&&(n[u]=s)}else for(var c=wq(e/2),f=w0(vA(n,0,c),t),p=w0(vA(n,c),t),d=f.length,g=p.length,y=0,v=0;y<d||v<g;)n[y+v]=y<d&&v<g?t(f[y],p[v])<=0?f[y++]:p[v++]:y<d?f[y++]:p[v++];return n};_A.exports=w0});var b0=X((rit,EA)=>{"use strict";var Mq=Bu(),xA=Mq.match(/firefox\\/(\\d+)/i);EA.exports=!!xA&&+xA[1]});var A0=X((iit,SA)=>{"use strict";var bq=Bu();SA.exports=/MSIE|Trident/.test(bq)});var T0=X((oit,MA)=>{"use strict";var Aq=Bu(),wA=Aq.match(/AppleWebKit\\/(\\d+)\\./);MA.exports=!!wA&&+wA[1]});var I0=X(()=>{"use strict";var Tq=Sn(),Cq=Ih(),C0=An(),Iq=_s(),Pq=M0(),IA=Wi(),bA=b0(),Rq=A0(),AA=bc(),TA=T0(),Lq=IA.aTypedArray,Nq=IA.exportTypedArrayMethod,Yc=Tq.Uint16Array,Ju=Yc&&Cq(Yc.prototype.sort),Oq=!!Ju&&!(C0(function(){Ju(new Yc(2),null)})&&C0(function(){Ju(new Yc(2),{})})),CA=!!Ju&&!C0(function(){if(AA)return AA<74;if(bA)return bA<67;if(Rq)return!0;if(TA)return TA<602;var n=new Yc(516),t=Array(516),e,i;for(e=0;e<516;e++)i=e%4,n[e]=515-e,t[e]=e-2*i+3;for(Ju(n,function(s,u){return(s/4|0)-(u/4|0)}),e=0;e<516;e++)if(n[e]!==t[e])return!0}),Dq=function(n){return function(t,e){return n!==void 0?+n(t,e)||0:e!==e?-1:t!==t?1:t===0&&e===0?1/t>0&&1/e<0?1:-1:t>e}};Nq("sort",function(t){return t!==void 0&&Iq(t),CA?Ju(this,t):Pq(Lq(this),Dq(t))},!CA||Oq)});var RA=X((uit,PA)=>{"use strict";var Fq=ii();PA.exports=function(n,t){for(var e=Fq(n),i=new t(e),s=0;s<e;s++)i[s]=n[e-s-1];return i}});var R0=X(()=>{"use strict";var Uq=RA(),P0=Wi(),Bq=P0.aTypedArray,zq=P0.exportTypedArrayMethod,Gq=P0.getTypedArrayConstructor;zq("toReversed",function(){return Uq(Bq(this),Gq(this))})});var L0=X(()=>{"use strict";var Jh=Wi(),kq=In(),qq=_s(),Vq=i0(),Hq=Jh.aTypedArray,Wq=Jh.getTypedArrayConstructor,Xq=Jh.exportTypedArrayMethod,Yq=kq(Jh.TypedArrayPrototype.sort);Xq("toSorted",function(t){t!==void 0&&qq(t);var e=Hq(this),i=Vq(Wq(e),e);return Yq(i,t)})});var NA=X((pit,LA)=>{"use strict";var $q=ii(),Zq=Hi(),Jq=RangeError;LA.exports=function(n,t,e,i){var s=$q(n),u=Zq(e),c=u<0?s+u:u;if(c>=s||c<0)throw new Jq("Incorrect index");for(var f=new t(s),p=0;p<s;p++)f[p]=p===c?i:n[p];return f}});var O0=X(()=>{"use strict";var jq=NA(),N0=Wi(),Kq=n0(),Qq=Hi(),t5=Wh(),e5=N0.aTypedArray,n5=N0.getTypedArrayConstructor,r5=N0.exportTypedArrayMethod,i5=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(n){return n===8}}();r5("with",function(n,t){var e=e5(this),i=Qq(n),s=Kq(e)?t5(t):+t;return jq(e,n5(e),i,s)},!i5)});var F0=X(()=>{"use strict";var o5=sr(),s5=Sn(),a5=Hh(),u5=r0(),D0="ArrayBuffer",OA=a5[D0],l5=s5[D0];o5({global:!0,constructor:!0,forced:l5!==OA},{ArrayBuffer:OA});u5(D0)});var G0=X(()=>{"use strict";var c5=sr(),B0=Ih(),f5=An(),BA=Hh(),DA=so(),FA=vh(),h5=Wa(),z0=BA.ArrayBuffer,U0=BA.DataView,zA=U0.prototype,UA=B0(z0.prototype.slice),p5=B0(zA.getUint8),d5=B0(zA.setUint8),g5=f5(function(){return!new z0(2).slice(1,void 0).byteLength});c5({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:g5},{slice:function(t,e){if(UA&&e===void 0)return UA(DA(this),t);for(var i=DA(this).byteLength,s=FA(t,i),u=FA(e===void 0?i:e,i),c=new z0(h5(u-s)),f=new U0(this),p=new U0(c),d=0;s<u;)d5(p,d++,p5(f,s++));return c}})});var k0=X((xit,qA)=>{"use strict";var kA=Sn(),m5=Oc(),y5=vs(),GA=kA.ArrayBuffer,v5=kA.TypeError;qA.exports=GA&&m5(GA.prototype,"byteLength","get")||function(n){if(y5(n)!=="ArrayBuffer")throw new v5("ArrayBuffer expected");return n.byteLength}});var q0=X((Eit,VA)=>{"use strict";var _5=Sn(),x5=Rh(),E5=k0(),S5=_5.DataView;VA.exports=function(n){if(!x5||E5(n)!==0)return!1;try{return new S5(n),!1}catch(t){return!0}}});var V0=X(()=>{"use strict";var w5=ri(),M5=Hu(),b5=q0(),HA=ArrayBuffer.prototype;w5&&!("detached"in HA)&&M5(HA,"detached",{configurable:!0,get:function(){return b5(this)}})});var XA=X((Mit,WA)=>{"use strict";var A5=q0(),T5=TypeError;WA.exports=function(n){if(A5(n))throw new T5("ArrayBuffer is detached");return n}});var H0=X((bit,YA)=>{"use strict";var $c=Sn(),C5=Bu(),I5=vs(),jh=function(n){return C5.slice(0,n.length)===n};YA.exports=function(){return jh("Bun/")?"BUN":jh("Cloudflare-Workers")?"CLOUDFLARE":jh("Deno/")?"DENO":jh("Node.js/")?"NODE":$c.Bun&&typeof Bun.version=="string"?"BUN":$c.Deno&&typeof Deno.version=="object"?"DENO":I5($c.process)==="process"?"NODE":$c.window&&$c.document?"BROWSER":"REST"}()});var ZA=X((Ait,$A)=>{"use strict";var P5=H0();$A.exports=P5==="NODE"});var jA=X((Tit,JA)=>{"use strict";var R5=Sn(),L5=ZA();JA.exports=function(n){if(L5){try{return R5.process.getBuiltinModule(n)}catch(t){}try{return Function('return require("'+n+'")')()}catch(t){}}}});var Y0=X((Cit,QA)=>{"use strict";var N5=Sn(),O5=An(),W0=bc(),X0=H0(),KA=N5.structuredClone;QA.exports=!!KA&&!O5(function(){if(X0==="DENO"&&W0>92||X0==="NODE"&&W0>94||X0==="BROWSER"&&W0>97)return!1;var n=new ArrayBuffer(8),t=KA(n,{transfer:[n]});return n.byteLength!==0||t.byteLength!==8})});var rT=X((Iit,nT)=>{"use strict";var j0=Sn(),D5=jA(),F5=Y0(),U5=j0.structuredClone,tT=j0.ArrayBuffer,Kh=j0.MessageChannel,J0=!1,$0,eT,Qh,Z0;if(F5)J0=function(n){U5(n,{transfer:[n]})};else if(tT)try{Kh||($0=D5("worker_threads"),$0&&(Kh=$0.MessageChannel)),Kh&&(eT=new Kh,Qh=new tT(2),Z0=function(n){eT.port1.postMessage(null,[n])},Qh.byteLength===2&&(Z0(Qh),Qh.byteLength===0&&(J0=Z0)))}catch(n){}nT.exports=J0});var ry=X((Pit,cT)=>{"use strict";var ty=Sn(),ey=In(),aT=Oc(),B5=Fh(),z5=XA(),G5=k0(),iT=rT(),K0=Y0(),k5=ty.structuredClone,uT=ty.ArrayBuffer,Q0=ty.DataView,q5=Math.min,ny=uT.prototype,lT=Q0.prototype,V5=ey(ny.slice),oT=aT(ny,"resizable","get"),sT=aT(ny,"maxByteLength","get"),H5=ey(lT.getInt8),W5=ey(lT.setInt8);cT.exports=(K0||iT)&&function(n,t,e){var i=G5(n),s=t===void 0?i:B5(t),u=!oT||!oT(n),c;if(z5(n),K0&&(n=k5(n,{transfer:[n]}),i===s&&(e||u)))return n;if(i>=s&&(!e||u))c=V5(n,0,s);else{var f=e&&!u&&sT?{maxByteLength:sT(n)}:void 0;c=new uT(s,f);for(var p=new Q0(n),d=new Q0(c),g=q5(s,i),y=0;y<g;y++)W5(d,y,H5(p,y))}return K0||iT(n),c}});var iy=X(()=>{"use strict";var X5=sr(),fT=ry();fT&&X5({target:"ArrayBuffer",proto:!0},{transfer:function(){return fT(this,arguments.length?arguments[0]:void 0,!0)}})});var oy=X(()=>{"use strict";var Y5=sr(),hT=ry();hT&&Y5({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return hT(this,arguments.length?arguments[0]:void 0,!1)}})});var Ao=X((Dit,pT)=>{"use strict";var sy=In(),tp=Set.prototype;pT.exports={Set,add:sy(tp.add),has:sy(tp.has),remove:sy(tp.delete),proto:tp}});var ea=X((Fit,dT)=>{"use strict";var $5=Ao().has;dT.exports=function(n){return $5(n),n}});var na=X((Uit,gT)=>{"use strict";var Z5=vr();gT.exports=function(n,t,e){for(var i=e?n:n.iterator,s=n.next,u,c;!(u=Z5(s,i)).done;)if(c=t(u.value),c!==void 0)return c}});var ju=X((Bit,xT)=>{"use strict";var mT=In(),J5=na(),yT=Ao(),j5=yT.Set,vT=yT.proto,K5=mT(vT.forEach),_T=mT(vT.keys),Q5=_T(new j5).next;xT.exports=function(n,t,e){return e?J5({iterator:_T(n),next:Q5},t):K5(n,t)}});var ep=X((zit,ST)=>{"use strict";var ET=Ao(),tV=ju(),eV=ET.Set,nV=ET.add;ST.exports=function(n){var t=new eV;return tV(n,function(e){nV(t,e)}),t}});var Ku=X((Git,wT)=>{"use strict";var rV=Oc(),iV=Ao();wT.exports=rV(iV.proto,"size","get")||function(n){return n.size}});var bT=X((kit,MT)=>{"use strict";MT.exports=function(n){return{iterator:n,next:n.next,done:!1}}});var ra=X((qit,RT)=>{"use strict";var AT=_s(),IT=so(),TT=vr(),oV=Hi(),sV=bT(),CT="Invalid size",aV=RangeError,uV=TypeError,lV=Math.max,PT=function(n,t){this.set=n,this.size=lV(t,0),this.has=AT(n.has),this.keys=AT(n.keys)};PT.prototype={getIterator:function(){return sV(IT(TT(this.keys,this.set)))},includes:function(n){return TT(this.has,this.set,n)}};RT.exports=function(n){IT(n);var t=+n.size;if(t!==t)throw new uV(CT);var e=oV(t);if(e<0)throw new aV(CT);return new PT(n,e)}});var DT=X((Vit,OT)=>{"use strict";var cV=ea(),NT=Ao(),fV=ep(),hV=Ku(),pV=ra(),dV=ju(),gV=na(),mV=NT.has,LT=NT.remove;OT.exports=function(t){var e=cV(this),i=pV(t),s=fV(e);return hV(e)<=i.size?dV(e,function(u){i.includes(u)&&LT(s,u)}):gV(i.getIterator(),function(u){mV(e,u)&&LT(s,u)}),s}});var ia=X((Hit,BT)=>{"use strict";var yV=$s(),FT=function(n){return{size:n,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},UT=function(n){return{size:n,has:function(){return!0},keys:function(){throw new Error("e")}}};BT.exports=function(n,t){var e=yV("Set");try{new e()[n](FT(0));try{return new e()[n](FT(-1)),!1}catch(s){if(!t)return!0;try{return new e()[n](UT(-1/0)),!1}catch(u){var i=new e;return i.add(1),i.add(2),t(i[n](UT(1/0)))}}}catch(s){return!1}}});var zT=X(()=>{"use strict";var vV=sr(),_V=DT(),xV=ia(),EV=!xV("difference",function(n){return n.size===0});vV({target:"Set",proto:!0,real:!0,forced:EV},{difference:_V})});var qT=X((Yit,kT)=>{"use strict";var SV=ea(),ay=Ao(),wV=Ku(),MV=ra(),bV=ju(),AV=na(),TV=ay.Set,GT=ay.add,CV=ay.has;kT.exports=function(t){var e=SV(this),i=MV(t),s=new TV;return wV(e)>i.size?AV(i.getIterator(),function(u){CV(e,u)&&GT(s,u)}):bV(e,function(u){i.includes(u)&&GT(s,u)}),s}});var VT=X(()=>{"use strict";var IV=sr(),PV=An(),RV=qT(),LV=ia(),NV=!LV("intersection",function(n){return n.size===2&&n.has(1)&&n.has(2)})||PV(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});IV({target:"Set",proto:!0,real:!0,forced:NV},{intersection:RV})});var uy=X((Jit,WT)=>{"use strict";var OV=vr(),HT=so(),DV=Tc();WT.exports=function(n,t,e){var i,s;HT(n);try{if(i=DV(n,"return"),!i){if(t==="throw")throw e;return e}i=OV(i,n)}catch(u){s=!0,i=u}if(t==="throw")throw e;if(s)throw i;return HT(i),e}});var YT=X((jit,XT)=>{"use strict";var FV=ea(),UV=Ao().has,BV=Ku(),zV=ra(),GV=ju(),kV=na(),qV=uy();XT.exports=function(t){var e=FV(this),i=zV(t);if(BV(e)<=i.size)return GV(e,function(u){if(i.includes(u))return!1},!0)!==!1;var s=i.getIterator();return kV(s,function(u){if(UV(e,u))return qV(s,"normal",!1)})!==!1}});var $T=X(()=>{"use strict";var VV=sr(),HV=YT(),WV=ia(),XV=!WV("isDisjointFrom",function(n){return!n});VV({target:"Set",proto:!0,real:!0,forced:XV},{isDisjointFrom:HV})});var JT=X((tot,ZT)=>{"use strict";var YV=ea(),$V=Ku(),ZV=ju(),JV=ra();ZT.exports=function(t){var e=YV(this),i=JV(t);return $V(e)>i.size?!1:ZV(e,function(s){if(!i.includes(s))return!1},!0)!==!1}});var jT=X(()=>{"use strict";var jV=sr(),KV=JT(),QV=ia(),tH=!QV("isSubsetOf",function(n){return n});jV({target:"Set",proto:!0,real:!0,forced:tH},{isSubsetOf:KV})});var QT=X((rot,KT)=>{"use strict";var eH=ea(),nH=Ao().has,rH=Ku(),iH=ra(),oH=na(),sH=uy();KT.exports=function(t){var e=eH(this),i=iH(t);if(rH(e)<i.size)return!1;var s=i.getIterator();return oH(s,function(u){if(!nH(e,u))return sH(s,"normal",!1)})!==!1}});var tC=X(()=>{"use strict";var aH=sr(),uH=QT(),lH=ia(),cH=!lH("isSupersetOf",function(n){return!n});aH({target:"Set",proto:!0,real:!0,forced:cH},{isSupersetOf:uH})});var nC=X((sot,eC)=>{"use strict";var fH=ea(),ly=Ao(),hH=ep(),pH=ra(),dH=na(),gH=ly.add,mH=ly.has,yH=ly.remove;eC.exports=function(t){var e=fH(this),i=pH(t).getIterator(),s=hH(e);return dH(i,function(u){mH(e,u)?yH(s,u):gH(s,u)}),s}});var rC=X(()=>{"use strict";var vH=sr(),_H=nC(),xH=ia();vH({target:"Set",proto:!0,real:!0,forced:!xH("symmetricDifference")},{symmetricDifference:_H})});var oC=X((lot,iC)=>{"use strict";var EH=ea(),SH=Ao().add,wH=ep(),MH=ra(),bH=na();iC.exports=function(t){var e=EH(this),i=MH(t).getIterator(),s=wH(e);return bH(i,function(u){SH(s,u)}),s}});var sC=X(()=>{"use strict";var AH=sr(),TH=oC(),CH=ia();AH({target:"Set",proto:!0,real:!0,forced:!CH("union")},{union:TH})});var cy=X((hot,uC)=>{"use strict";var aC=zu(),IH=TypeError;uC.exports=function(n,t){if(!delete n[t])throw new IH("Cannot delete property "+aC(t)+" of "+aC(n))}});var lC=X(()=>{"use strict";var PH=sr(),RH=Vi(),LH=ii(),NH=mm(),OH=cy(),DH=Eh(),FH=[].unshift(0)!==1,UH=function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(n){return n instanceof TypeError}},BH=FH||!UH();PH({target:"Array",proto:!0,arity:1,forced:BH},{unshift:function(t){var e=RH(this),i=LH(e),s=arguments.length;if(s){DH(i+s);for(var u=i;u--;){var c=u+s;u in e?e[c]=e[u]:OH(e,c)}for(var f=0;f<s;f++)e[f]=arguments[f]}return NH(e,i+s)}})});var Ll=X((Cot,pP)=>{"use strict";var xY=Zs(),EY=String;pP.exports=function(n){if(xY(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return EY(n)}});var gP=X((Iot,dP)=>{"use strict";var SY=so();dP.exports=function(){var n=SY(this),t="";return n.hasIndices&&(t+="d"),n.global&&(t+="g"),n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.dotAll&&(t+="s"),n.unicode&&(t+="u"),n.unicodeSets&&(t+="v"),n.sticky&&(t+="y"),t}});var yP=X((Pot,mP)=>{"use strict";var Kv=An(),wY=Sn(),Qv=wY.RegExp,t_=Kv(function(){var n=Qv("a","y");return n.lastIndex=2,n.exec("abcd")!==null}),MY=t_||Kv(function(){return!Qv("a","y").sticky}),bY=t_||Kv(function(){var n=Qv("^r","gy");return n.lastIndex=2,n.exec("str")!==null});mP.exports={BROKEN_CARET:bY,MISSED_STICKY:MY,UNSUPPORTED_Y:t_}});var _P=X((Rot,vP)=>{"use strict";var AY=An(),TY=Sn(),CY=TY.RegExp;vP.exports=AY(function(){var n=CY(".","s");return!(n.dotAll&&n.test(\`
12204
+ `;continue}if((mt=pt.match(O))&&(j.gamma=parseFloat(mt[1])),(mt=pt.match(V))&&(j.exposure=parseFloat(mt[1])),(mt=pt.match(W))&&(j.valid|=2,j.format=mt[1]),(mt=pt.match(St))&&(j.valid|=4,j.height=parseInt(mt[1],10),j.width=parseInt(mt[2],10)),j.valid&2&&j.valid&4)break}return j.valid&2||a(3,"missing format specifier"),j.valid&4||a(3,"missing image size specifier"),j},x=function(L,tt,O){let V=tt;if(V<8||V>32767||L[0]!==2||L[1]!==2||L[2]&128)return new Uint8Array(L);V!==(L[2]<<8|L[3])&&a(3,"wrong scanline width");let W=new Uint8Array(4*tt*O);W.length||a(4,"unable to allocate buffer space");let St=0,j=0,pt=4*V,mt=new Uint8Array(4),Lt=new Uint8Array(pt),yt=O;for(;yt>0&&j<L.byteLength;){j+4>L.byteLength&&a(1),mt[0]=L[j++],mt[1]=L[j++],mt[2]=L[j++],mt[3]=L[j++],(mt[0]!=2||mt[1]!=2||(mt[2]<<8|mt[3])!=V)&&a(3,"bad rgbe scanline format");let bt=0,nt;for(;bt<pt&&j<L.byteLength;){nt=L[j++];let Vt=nt>128;if(Vt&&(nt-=128),(nt===0||bt+nt>pt)&&a(3,"bad scanline data"),Vt){let he=L[j++];for(let dt=0;dt<nt;dt++)Lt[bt++]=he}else Lt.set(L.subarray(j,j+nt),bt),bt+=nt,j+=nt}let Xt=V;for(let Vt=0;Vt<Xt;Vt++){let he=0;W[St]=Lt[Vt+he],he+=V,W[St+1]=Lt[Vt+he],he+=V,W[St+2]=Lt[Vt+he],he+=V,W[St+3]=Lt[Vt+he],St+=4}yt--}return W},S=function(L,tt,O,V){let W=L[tt+3],St=Math.pow(2,W-128)/255;O[V+0]=L[tt+0]*St,O[V+1]=L[tt+1]*St,O[V+2]=L[tt+2]*St,O[V+3]=1},w=function(L,tt,O,V){let W=L[tt+3],St=Math.pow(2,W-128)/255;O[V+0]=Wm.toHalfFloat(Math.min(L[tt+0]*St,65504)),O[V+1]=Wm.toHalfFloat(Math.min(L[tt+1]*St,65504)),O[V+2]=Wm.toHalfFloat(Math.min(L[tt+2]*St,65504)),O[V+3]=Wm.toHalfFloat(1)},E=new Uint8Array(t);E.pos=0;let b=v(E),C=b.width,A=b.height,P=x(E.subarray(E.pos),C,A),U,F,D;switch(this.type){case _s:D=P.length/4;let L=new Float32Array(D*4);for(let O=0;O<D;O++)S(P,O*4,L,O*4);U=L,F=_s;break;case F0:D=P.length/4;let tt=new Uint16Array(D*4);for(let O=0;O<D;O++)w(P,O*4,tt,O*4);U=tt,F=F0;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:C,height:A,data:U,header:b.string,gamma:b.gamma,exposure:b.exposure,type:F}}setDataType(t){return this.type=t,this}load(t,e,n,i){function o(a,l){switch(a.type){case _s:case F0:a.colorSpace=Ii,a.minFilter=tn,a.magFilter=tn,a.generateMipmaps=!1,a.flipY=!0;break}e&&e(a,l)}return super.load(t,o,n,i)}};var G6=class extends Tm{dispose(){var t;(t=this.environment)==null||t.dispose(),this.environment=null,Lr(this),this.clear()}constructor(){super(),new z6().load(AY,t=>{t.mapping=ud,this.environment=t;let e=new Ie;e.makeRotationX(Math.PI/2),this.environmentRotation=new ga().setFromRotationMatrix(e)})}};var k6=class extends kl{constructor(t,e){super(-t/2,t/2,e/2,-e/2,-1e4,5e4),this.up.set(0,0,1),this.position.set(0,0,100),this.lookAt(0,0,0)}};var S_=class extends Sn{get config(){return this.bmap.config}get center(){return this.bmap.buildingCenter}setRange(t){this.range=br([t])}resizeClientSize(){let{x:t,y:e,width:n,height:i}=this.container.getBoundingClientRect();this.clientSize={width:n||this.container.clientWidth,height:i||this.container.clientHeight,x:t,y:e}}init(){let{clientWidth:t,clientHeight:e}=this.container;this.camera=new k6(t,e),this.renderer.setSize(t,e),this.renderer.setCameraAndScene(this.scene,this.camera),this.renderer.autoRender(),this.control=new F6(this,this.camera,this.renderer.domElement),this.control.maxPolarAngle=this.config.control.maxPolar,this.container.appendChild(this.renderer.domElement),this.scene.add(this.lights),this.basicRatio=this.getRatio(),this.control.addEventListener("change",this.onControlChange),this.control.addEventListener("change-zoom",this.onControlChangeZoom),this.renderer.addEventListener("update",this.onRendererUpdate),this.cameraBound=new N6(this)}getRatio(t,e){t===void 0&&(t=new G(0,0,0)),e===void 0&&(e=new G(100,0,0));let{clientWidth:n,clientHeight:i}=this.container,o=sn(t,this.camera,n,i),a=sn(e,this.camera,n,i);return Math.ceil(Math.sqrt((a.x-o.x)**2+(a.y-o.y)**2))}changeAmbientLightColor(t){this.lights.children.forEach(e=>{e instanceof Pf&&(e.color=new ne(t))})}switchFloor(t,e){e===void 0&&(e=!0),console.log("switchFloor",e),this.currentFloor&&(this.currentFloor.onRemoveFromScene(),this.scene.remove(this.currentFloor),e&&this.currentFloor.dispose()),this.currentFloor=t,this.setRange(t.userData.range||[]),this.scene.add(t),t.onAddToScene();let n=t.getCenter();n&&(this.lights.position.x=n.x,this.lights.position.y=n.y),this.cameraBound.updateBox()}getGraphicsByDeviceXy(t,e){var n;let i=new ft;i.x=t/this.clientSize.width*2-1,i.y=e/this.clientSize.height*-2+1;let o=new md;return o.setFromCamera(i,this.camera),o.ray.origin.sub(o.ray.direction.clone().multiplyScalar(100)),((n=this.currentFloor)==null?void 0:n.graphicLayer.getGraphicByRaycaster(o))||{graphics:[],position:null}}getPoisByDeviceXy(t,e){var n,i;let o=(n=this.currentFloor)==null?void 0:n.poiLayer.getPoiByDeviceXy(t,e),a=(i=this.currentFloor)==null?void 0:i.poiLayer2.getPoiByDeviceXy(t,e);return(o||[]).concat(a||[])}registryEvent(){window.addEventListener("resize",this.onWindowResize),this.container.addEventListener("click",this.onClick),this.container.addEventListener("pointerover",this.onPointerover),this.container.addEventListener("pointermove",this.onPointermove),this.container.addEventListener("pointerleave",this.onPointerleave),this.container.addEventListener("pointercancel",this.onPointerleave),this.container.addEventListener("pointerout",this.onPointerleave),this.selection.addEventListener("select",this.onSelectionSelect),this.hoverHelper.addEventListener("hover-change",this.onHoverChange)}unRegistryEvent(){window.removeEventListener("resize",this.onWindowResize),this.container.removeEventListener("click",this.onClick),this.container.removeEventListener("pointerover",this.onPointerover),this.container.removeEventListener("pointermove",this.onPointermove),this.container.removeEventListener("pointerleave",this.onPointerleave),this.container.removeEventListener("pointercancel",this.onPointerleave),this.container.removeEventListener("pointerout",this.onPointerleave),this.selection.removeEventListener("select",this.onSelectionSelect),this.hoverHelper.removeEventListener("hover-change",this.onHoverChange),this.control.removeEventListener("change",this.onControlChange),this.control.removeEventListener("change-zoom",this.onControlChangeZoom),this.renderer.removeEventListener("update",this.onRendererUpdate)}setPolarAngle(t,e){return e===void 0&&(e=500),this.control.setPolarAngleByDuration(t,!0,e)}setAzimuthalAngle(t,e){return e===void 0&&(e=500),this.control.setAzimuthalAngleDuration(t,!0,e)}getCameraLookAt(){return this.control.getCameraLookAt()}setZoom(t,e,n){return n===void 0&&(n=500),this.control.setZoomByDuration(t,e,!0,n)}getFitCameraToObjectZoom(t,e,n){return e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=!0),this.getFitCameraToBoxZoom(new Fe().setFromObject(t),e,n)}getFitCameraToBoxZoom(t,e,n){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=!0);let[i,o,a,l]=e,{clientSize:{width:c,height:f}}=this,g=this.control.getPolarAngle();n&&this.setPolarAngle(0,0),this.setPolarAngle(g,0);let{max:m,min:v}=t,x=new G(v.x,m.y,m.z),S=new G(m.x,m.y,m.z),w=new G(m.x,v.y,v.z),E=new G(v.x,v.y,v.z),b=sn(x,this.camera,c,f),C=sn(S,this.camera,c,f),A=sn(E,this.camera,c,f),P=sn(w,this.camera,c,f),F=new V0().setFromPoints([new ft(b.x,b.y),new ft(C.x,C.y),new ft(A.x,A.y),new ft(P.x,P.y)]).getSize(new ft),D=(c-o-l)/F.x,L=(f-i-a)/F.y,tt=Math.min(D,L),O=new G((m.x+v.x)/2,(m.y+v.y)/2,(m.z+v.z)/2),V=tt*this.camera.zoom,W=this.camera.clone();W.zoom=V,W.updateMatrix();let St=(o-l)/2,j=(i-a)/2;if(St){let pt=new G;pt.setFromMatrixColumn(W.matrix,0),pt.normalize(),pt.multiplyScalar(St/V),O.add(pt)}if(j){let pt=new G;pt.setFromMatrixColumn(W.matrix,1),pt.normalize(),pt.multiplyScalar(j/V),O.add(pt)}return{zoom:tt*this.camera.zoom,center:O}}fitCameraToObject(t,e,n,i){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=500),i===void 0&&(i=!0);let{zoom:o,center:a}=this.getFitCameraToObjectZoom(t,e,i);return this.setZoom(o,a,n)}fitCameraToBox(t,e,n,i){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=500),i===void 0&&(i=!0);let{zoom:o,center:a}=this.getFitCameraToBoxZoom(t,e,i);return this.setZoom(o,a,n)}getFitCameraToGroundZoom(t,e,n){if(t===void 0&&(t=[20,20,20,20]),e===void 0&&(e=500),n===void 0&&(n=!0),this.currentFloor&&this.currentFloor.hasElement)return this.getFitCameraToObjectZoom(this.currentFloor.groundUpper,t,n).zoom}fitCameraToGround(t,e,n){return t===void 0&&(t=[20,20,20,20]),e===void 0&&(e=500),n===void 0&&(n=!0),this.currentFloor&&this.currentFloor.hasElement?this.fitCameraToObject(this.currentFloor.groundLayer,t,e,n):Promise.resolve(!1)}setCameraPosition(t,e){return Tt(this,null,function*(){return this.control.setCameraPositionByTarget(t,e)})}pauseRender(){this.renderer.pauseRender()}continueRender(){this.renderer.continueRender()}dispose(){var t;(t=this.currentFloor)==null||t.dispose(),this.control.dispose(),this.cameraBound.dispose(),this.selection.dispose(),this.hoverHelper.dispose(),this.unRegistryEvent(),this.renderer.dispose(),this.lights.children.forEach(e=>e.dispose()),this.scene.dispose(),this.container=null,this.renderer=null}constructor(t,e){super(),this.container=t,this.scene=new G6,this.renderer=new B6,this.lights=cM(),this.range=br([]),this.clientSize={width:0,height:0,x:0,y:0},this.renderRf=0,this.basicZoom=1,this.onControlChange=()=>{this.dispatchEvent({type:"change-ratio",px:(this.basicRatio||0)*this.camera.zoom}),this.dispatchEvent({type:"control-change"})},this.onControlChangeZoom=n=>{let{zoom:i}=n;this.dispatchEvent({type:"control-zoom-change",zoom:i})},this.onRendererUpdate=()=>{this.dispatchEvent({type:"update"})},this.onWindowResize=()=>{let{container:n,camera:i,renderer:o}=this,{clientWidth:a,clientHeight:l}=n;a=Math.max(1,a),l=Math.max(1,l),i.left=-a/2,i.right=a/2,i.top=l/2,i.bottom=-l/2,i.updateProjectionMatrix(),o.setSize(a,l),this.resizeClientSize(),this.dispatchEvent({type:"resize",width:a,height:l})},this.onClick=n=>{let{graphics:i,position:o}=this.getGraphicsByDeviceXy(n.offsetX,n.offsetY);i.length&&this.dispatchEvent({type:"graphic-click",graphics:i,position:o});let a=this.getPoisByDeviceXy(n.offsetX,n.offsetY);a.length&&this.dispatchEvent({type:"poi-click",pois:a})},this.onPointerover=n=>{let{graphics:i,position:o}=this.getGraphicsByDeviceXy(n.offsetX,n.offsetY),a=this.getPoisByDeviceXy(n.offsetX,n.offsetY);this.dispatchEvent({type:"pointer-over",e:n,graphics:i,pois:a,position:o})},this.onPointermove=n=>{let{graphics:i,position:o}=this.getGraphicsByDeviceXy(n.offsetX,n.offsetY),a=this.getPoisByDeviceXy(n.offsetX,n.offsetY);this.dispatchEvent({type:"pointer-move",e:n,graphics:i,pois:a,position:o})},this.onPointerleave=n=>{this.dispatchEvent({type:"pointer-level"})},this.onSelectionSelect=n=>{let{graphics:i,isMultipleSelect:o}=n;this.dispatchEvent({type:"select-graphic",graphics:i,isMultipleSelect:o})},this.onHoverChange=n=>{let{graphics:i}=n;this.dispatchEvent({type:"hover",graphics:i})},this.bmap=e,this.container.style.position="relative",this.container.style.overflow="hidden",this.init(),this.selection=new x_(this),this.hoverHelper=new E_(this),this.resizeClientSize(),this.registryEvent()}};var n8=H(qs(),1),r8={placeId:0,apiDomain:"",apiInfo:{},apiPath:{floorGraphic:"/api/inception-map/floor/get",floorRange:"/api/inception-map/range/get",equipmentList:"/api/inception-map/equipment/get",roadNetwork:"/api/inception-map/road_network/get",loadPlaceInfo:"https://screen.aibee.cn/ai-map/map/get-floor-map"},enableBoxSelect:!0,resizeObserver:!1,initTransToMark:!1,heatMap:{radius:50,minOpacity:.1,gradient:{0:"#8F9FCD",.5:"#6284FF",1:"#F95D5D"}},useFloorCache:!0,control:{maxPolar:1.2,defaultPolar:1.1,defaultAzimuthal:0,maxZoomScale:30},defaultPadding:[20,20,20,20],svg:{circle:{radius:"2",fill:"#1CADFF"},line:{stroke:"#1CADFF"}},selectBox:{stroke:"#1CADFF",fill:"rgba(28, 173, 255, 0.3)"},hover:{time:100},ground:{color:"#F6F6F6",opacity:1,height:.001,stroke:!1,strokeColor:"#E6E6E6",strokeOpacity:1},markGraphic:{color:"#EEF0F3",opacity:1,height:.001,stroke:!1,strokeColor:"#000",strokeOpacity:1},graphic:{fillOpacity:1},cameraBound:{padding:[150,150,150,150]},poi:{boxScale:1},loaderPlaceConfig:{textFontSize:14}};function FR(r){return(0,n8.merge)({},r8,r)}var a8=H(qs(),1);var Roe=H(ze(),1);var xoe=H(En(),1),Eoe=H(ze(),1);var moe=H(Kf(),1);var vg=function(r){return r.LAYERED_RENDER_VERSION="layeredRender",r.MERGED_RENDER_VERSION="mergedRender",r}({});function V6(r,t){let e=r.poi_info.showName||r.store_name||r.poi_info.text;switch(t){case"zh-cn":return e;case"en":var n;return((n=r.store_info_ext)==null?void 0:n.poi_name)||e;case"zh-hk":var i;return((i=r.store_info_ext)==null?void 0:i.traditional_name)||e}}function H6(r,t){let e=r.poi_info.showName||r.store_name||r.poi_info.text;switch(t){case"zh-cn":return e;case"en":var n;return((n=r.infra_info_ext)==null?void 0:n.poi_name)||e;case"zh-hk":var i;return((i=r.infra_info_ext)==null?void 0:i.traditional_name)||e}}var BR=["range","ground","store","facility","parkingSpace"];function i8(r){return BR.indexOf(r.l_type)===-1?BR.length:BR.indexOf(r.l_type)}function Gbt(r){r.layers.sort((t,e)=>i8(t)-i8(e))}function kbt(r){let t=r.layers.find(n=>n.l_type==="range"),e=[t.elements[0].center_x,t.elements[0].center_y];r.layers.map(n=>{if(n.l_type!=="range")return Av(n.elements,e)})}function b_(r){Gbt(r),kbt(r)}function _g(r,t){return t===void 0&&(t=4),r.floor_id+"_"+r.version_id+(t?"_"+t:"")}function o8(r,t,e){switch(r.l_type){case"ground":return zR(r,t);case"graph":return Vbt(r,t);case"wall":return Hbt(r,t);case"lane":return Wbt(r,t);case"texture2d":case"texture3d":return qbt(r,t);case"glb":return Xbt(r,t);case"store":return jbt(r,t,e);case"facility":return Zbt(r,t,e);case"parkingSpace":return $bt(r,t,e);case"text":return Qbt(r,t)}}function s8(r,t,e,n,i){switch(r.l_type){case"store":return Ybt(r,t,e,n,i);case"facility":return Kbt(r,t,e,n,i);case"parkingSpace":return Jbt(r,t,n,i)}}function Vbt(r,t){t.mergeGraphicLayer.addGraphics(r.elements,r.mergedElements)}function zR(r,t){if(r.mergedElements){let e=r.mergedElements.map(n=>new zh(t.context,te({},n,{dashed:!1})));t.addGrounds(e)}else{let e=r.elements.map(n=>new wo(t.context,te({},n,{dashed:!1})));t.addGrounds(e)}}function Hbt(r,t){if(r.mergedElements)r.mergedElements.map(e=>{let n=new __(t.context,e);t.wallLayer.add(n)});else{let e=r.elements.reduce((n,i)=>{let{fillColor:o,fillOpacity:a,strokeColor:l,strokeOpacity:c,height:f}=i,g=o.toLowerCase()+"-"+a+"-"+l.toLowerCase()+"-"+c+"-"+f;return c===0&&(g=o.toLowerCase()+"-"+a+"-"+f),n[g]?n[g].push(i):n[g]=[i],n},{});Object.values(e).forEach(n=>{let i=new g_(t.context,n);t.wallLayer.add(i)})}}function Wbt(r,t){if(r.mergedElements){let e=new y_(t.context,r.mergedElements);t.laneLayer.add(e)}else{let e=new m_(t.context,r.elements);t.laneLayer.add(e)}}function qbt(r,t){if(r.mergedMatrixes)r.mergedMatrixes.map(e=>{let n=new Bh(t.context,e);t.textureLayer.add(n)});else if(r.elements.length){let e=new Fh(t.context,r.elements);t.textureLayer.add(e)}}function Xbt(r,t){t.glbModelLayer.addModels(r.elements.map(e=>te({},e,{url:e.secondUrl,rotate:e.secondRotate,width:e.secondWidth,center_x:e.center_coord_x,center_y:e.center_coord_y,deltaHeight:0})))}function jbt(r,t,e){e.mergeGraphic?t.mergeGraphicLayer.addGraphics(r.elements,r.mergedElements):r.elements.map(n=>{let i=t.addGraphic(te({},n,{dashed:!1}));t.userData.graphics.push(i),t.userData.graphicMap.set(n.id,i)})}function Ybt(r,t,e,n,i){r.elements.filter(o=>i.filterPoi(o)).map(o=>{try{let a=V6(o,e),l=new Di(t.context,{id:o.id,icon:o.poi_info.showImageUrl||o.poi_info.icon,text:a,position:{x:o.center_coord_x,y:o.center_coord_y,z:o.airHeight+o.height},icon_size:[24,24],level:o.poi_info.level||0,hide_text:!n.showStoreName,maxWeight:o.poi_info.maxWeight||25,minWeight:o.poi_info.minWeight||1,text_font_size:n.textFontSize});t.poiLayer2.pushPoi(l),l&&(l.userData.type="store",l.userData.data=o,l.userData.floor=t.name)}catch(a){console.log("\u521B\u5EFA\u5E97\u94FApoi\u5931\u8D25",a,o)}})}function Zbt(r,t,e){e.mergeGraphic?t.mergeGraphicLayer.addGraphics(r.elements,r.mergedElements):r.elements.map(n=>{let i=t.addGraphic(te({},n,{dashed:!1}));t.userData.graphics.push(i),t.userData.graphicMap.set(n.id,i)})}function Kbt(r,t,e,n,i){r.elements.filter(o=>o.poi_info).filter(o=>i.filterPoi(o)).map(o=>{try{let a=H6(o,e),l=new Di(t.context,{id:o.id,icon:o.poi_info.showImageUrl||o.poi_info.icon,text:a,position:{x:o.center_coord_x,y:o.center_coord_y,z:o.airHeight+o.height},icon_size:[24,24],level:o.poi_info.level||0,hide_text:!n.showFacilityName,maxWeight:o.poi_info.maxWeight||25,minWeight:o.poi_info.minWeight||1,text_font_size:n.textFontSize});t.poiLayer2.pushPoi(l),l.userData.type="facility",l.userData.data=o,l.userData.floor=t.name}catch(a){console.log("\u6DFB\u52A0facility\u5931\u8D25",a,o)}})}function $bt(r,t,e){t.parkingSpaceLayer.load(r,e.mergeParkingSpace),t.userData.parkingSpaces=t.parkingSpaceLayer.graphicMap.values(),t.userData.parkingSpacesGraphicMap=t.parkingSpaceLayer.graphicMap}function Jbt(r,t,e,n){return Tt(this,null,function*(){let i=r.elements.filter(l=>l.texts[0]).filter(l=>n.filterPoi(l)),o=i.map(l=>l.displayName||l.texts[0]),a=yield Oi.lazyGetTextureByTexts(o,{height:64});i.forEach(l=>{try{let c=l.displayName||l.texts[0],f=new Di(t.context,{id:l.id,text:c,position:{x:l.center_coord_x,y:l.center_coord_y,z:l.airHeight+l.height},text_texture:a[c].texture,text_texture_width:a[c].width,text_texture_height:a[c].height,text_texture_offset_x:a[c].x,text_texture_offset_y:a[c].y,text_font_size:e.textFontSize});f&&(f.userData.type="parkingSpace",f.userData.data=l,f.userData.floor=t.name),t.poiLayer2.pushPoi(f)}catch(c){console.log("\u6DFB\u52A0\u8F66\u4F4Dpoi\u5931\u8D25",c,l)}}),Object.values(a).forEach(l=>{l.texture.dispose()})})}function Qbt(r,t){let e=new v_(t.context,r.elements.map(n=>te({},n,{center_x:n.center_coord_x,center_y:n.center_coord_y})));t.textTextureLayer.add(e)}function GR(){let r=new Blob([`var VD=Object.create;var D1=Object.defineProperty;var HD=Object.getOwnPropertyDescriptor;var WD=Object.getOwnPropertyNames;var XD=Object.getPrototypeOf,YD=Object.prototype.hasOwnProperty;var X=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var $D=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of WD(t))!YD.call(n,s)&&s!==e&&D1(n,s,{get:()=>t[s],enumerable:!(i=HD(t,s))||i.enumerable});return n};var Qt=(n,t,e)=>(e=n!=null?VD(XD(n)):{},$D(t||!n||!n.__esModule?D1(e,"default",{value:n,enumerable:!0}):e,n));var Ri=(n,t,e)=>new Promise((i,s)=>{var u=p=>{try{f(e.next(p))}catch(d){s(d)}},c=p=>{try{f(e.throw(p))}catch(d){s(d)}},f=p=>p.done?i(p.value):Promise.resolve(p.value).then(u,c);f((e=e.apply(n,t)).next())});var Sn=X((Ug,F1)=>{"use strict";var Ec=function(n){return n&&n.Math===Math&&n};F1.exports=Ec(typeof globalThis=="object"&&globalThis)||Ec(typeof window=="object"&&window)||Ec(typeof self=="object"&&self)||Ec(typeof global=="object"&&global)||Ec(typeof Ug=="object"&&Ug)||function(){return this}()||Function("return this")()});var An=X((pet,U1)=>{"use strict";U1.exports=function(n){try{return!!n()}catch(t){return!0}}});var ri=X((det,B1)=>{"use strict";var ZD=An();B1.exports=!ZD(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var Sc=X((get,z1)=>{"use strict";var JD=An();z1.exports=!JD(function(){var n=function(){}.bind();return typeof n!="function"||n.hasOwnProperty("prototype")})});var vr=X((met,G1)=>{"use strict";var jD=Sc(),Kf=Function.prototype.call;G1.exports=jD?Kf.bind(Kf):function(){return Kf.apply(Kf,arguments)}});var H1=X(V1=>{"use strict";var k1={}.propertyIsEnumerable,q1=Object.getOwnPropertyDescriptor,KD=q1&&!k1.call({1:2},1);V1.f=KD?function(t){var e=q1(this,t);return!!e&&e.enumerable}:k1});var wc=X((vet,W1)=>{"use strict";W1.exports=function(n,t){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:t}}});var In=X((_et,$1)=>{"use strict";var X1=Sc(),Y1=Function.prototype,Bg=Y1.call,QD=X1&&Y1.bind.bind(Bg,Bg);$1.exports=X1?QD:function(n){return function(){return Bg.apply(n,arguments)}}});var vs=X((xet,J1)=>{"use strict";var Z1=In(),t3=Z1({}.toString),e3=Z1("".slice);J1.exports=function(n){return e3(t3(n),8,-1)}});var Qf=X((Eet,j1)=>{"use strict";var n3=In(),r3=An(),i3=vs(),zg=Object,o3=n3("".split);j1.exports=r3(function(){return!zg("z").propertyIsEnumerable(0)})?function(n){return i3(n)==="String"?o3(n,""):zg(n)}:zg});var th=X((wet,K1)=>{"use strict";K1.exports=function(n){return n==null}});var Fu=X((Met,Q1)=>{"use strict";var s3=th(),a3=TypeError;Q1.exports=function(n){if(s3(n))throw new a3("Can't call method on "+n);return n}});var Uu=X((bet,tE)=>{"use strict";var u3=Qf(),l3=Fu();tE.exports=function(n){return u3(l3(n))}});var er=X((Aet,eE)=>{"use strict";var Gg=typeof document=="object"&&document.all;eE.exports=typeof Gg=="undefined"&&Gg!==void 0?function(n){return typeof n=="function"||n===Gg}:function(n){return typeof n=="function"}});var xi=X((Tet,nE)=>{"use strict";var c3=er();nE.exports=function(n){return typeof n=="object"?n!==null:c3(n)}});var $s=X((Cet,rE)=>{"use strict";var kg=Sn(),f3=er(),h3=function(n){return f3(n)?n:void 0};rE.exports=function(n,t){return arguments.length<2?h3(kg[n]):kg[n]&&kg[n][t]}});var Mc=X((Iet,iE)=>{"use strict";var p3=In();iE.exports=p3({}.isPrototypeOf)});var Bu=X((Pet,aE)=>{"use strict";var d3=Sn(),oE=d3.navigator,sE=oE&&oE.userAgent;aE.exports=sE?String(sE):""});var bc=X((Ret,pE)=>{"use strict";var hE=Sn(),qg=Bu(),uE=hE.process,lE=hE.Deno,cE=uE&&uE.versions||lE&&lE.version,fE=cE&&cE.v8,So,eh;fE&&(So=fE.split("."),eh=So[0]>0&&So[0]<4?1:+(So[0]+So[1]));!eh&&qg&&(So=qg.match(/Edge\\/(\\d+)/),(!So||So[1]>=74)&&(So=qg.match(/Chrome\\/(\\d+)/),So&&(eh=+So[1])));pE.exports=eh});var nh=X((Let,gE)=>{"use strict";var dE=bc(),g3=An(),m3=Sn(),y3=m3.String;gE.exports=!!Object.getOwnPropertySymbols&&!g3(function(){var n=Symbol("symbol detection");return!y3(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&dE&&dE<41})});var Vg=X((Net,mE)=>{"use strict";var v3=nh();mE.exports=v3&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Ac=X((Oet,yE)=>{"use strict";var _3=$s(),x3=er(),E3=Mc(),S3=Vg(),w3=Object;yE.exports=S3?function(n){return typeof n=="symbol"}:function(n){var t=_3("Symbol");return x3(t)&&E3(t.prototype,w3(n))}});var zu=X((Det,vE)=>{"use strict";var M3=String;vE.exports=function(n){try{return M3(n)}catch(t){return"Object"}}});var _s=X((Fet,_E)=>{"use strict";var b3=er(),A3=zu(),T3=TypeError;_E.exports=function(n){if(b3(n))return n;throw new T3(A3(n)+" is not a function")}});var Tc=X((Uet,xE)=>{"use strict";var C3=_s(),I3=th();xE.exports=function(n,t){var e=n[t];return I3(e)?void 0:C3(e)}});var SE=X((Bet,EE)=>{"use strict";var Hg=vr(),Wg=er(),Xg=xi(),P3=TypeError;EE.exports=function(n,t){var e,i;if(t==="string"&&Wg(e=n.toString)&&!Xg(i=Hg(e,n))||Wg(e=n.valueOf)&&!Xg(i=Hg(e,n))||t!=="string"&&Wg(e=n.toString)&&!Xg(i=Hg(e,n)))return i;throw new P3("Can't convert object to primitive value")}});var Cc=X((zet,wE)=>{"use strict";wE.exports=!1});var rh=X((Get,bE)=>{"use strict";var ME=Sn(),R3=Object.defineProperty;bE.exports=function(n,t){try{R3(ME,n,{value:t,configurable:!0,writable:!0})}catch(e){ME[n]=t}return t}});var ih=X((ket,CE)=>{"use strict";var L3=Cc(),N3=Sn(),O3=rh(),AE="__core-js_shared__",TE=CE.exports=N3[AE]||O3(AE,{});(TE.versions||(TE.versions=[])).push({version:"3.42.0",mode:L3?"pure":"global",copyright:"\\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var oh=X((qet,PE)=>{"use strict";var IE=ih();PE.exports=function(n,t){return IE[n]||(IE[n]=t||{})}});var Vi=X((Vet,RE)=>{"use strict";var D3=Fu(),F3=Object;RE.exports=function(n){return F3(D3(n))}});var oo=X((Het,LE)=>{"use strict";var U3=In(),B3=Vi(),z3=U3({}.hasOwnProperty);LE.exports=Object.hasOwn||function(t,e){return z3(B3(t),e)}});var sh=X((Wet,NE)=>{"use strict";var G3=In(),k3=0,q3=Math.random(),V3=G3(1 .toString);NE.exports=function(n){return"Symbol("+(n===void 0?"":n)+")_"+V3(++k3+q3,36)}});var Xr=X((Xet,DE)=>{"use strict";var H3=Sn(),W3=oh(),OE=oo(),X3=sh(),Y3=nh(),$3=Vg(),Gu=H3.Symbol,Yg=W3("wks"),Z3=$3?Gu.for||Gu:Gu&&Gu.withoutSetter||X3;DE.exports=function(n){return OE(Yg,n)||(Yg[n]=Y3&&OE(Gu,n)?Gu[n]:Z3("Symbol."+n)),Yg[n]}});var $g=X((Yet,BE)=>{"use strict";var J3=vr(),FE=xi(),UE=Ac(),j3=Tc(),K3=SE(),Q3=Xr(),tF=TypeError,eF=Q3("toPrimitive");BE.exports=function(n,t){if(!FE(n)||UE(n))return n;var e=j3(n,eF),i;if(e){if(t===void 0&&(t="default"),i=J3(e,n,t),!FE(i)||UE(i))return i;throw new tF("Can't convert object to primitive value")}return t===void 0&&(t="number"),K3(n,t)}});var ah=X(($et,zE)=>{"use strict";var nF=$g(),rF=Ac();zE.exports=function(n){var t=nF(n,"string");return rF(t)?t:t+""}});var uh=X((Zet,kE)=>{"use strict";var iF=Sn(),GE=xi(),Zg=iF.document,oF=GE(Zg)&&GE(Zg.createElement);kE.exports=function(n){return oF?Zg.createElement(n):{}}});var Jg=X((Jet,qE)=>{"use strict";var sF=ri(),aF=An(),uF=uh();qE.exports=!sF&&!aF(function(){return Object.defineProperty(uF("div"),"a",{get:function(){return 7}}).a!==7})});var lh=X(HE=>{"use strict";var lF=ri(),cF=vr(),fF=H1(),hF=wc(),pF=Uu(),dF=ah(),gF=oo(),mF=Jg(),VE=Object.getOwnPropertyDescriptor;HE.f=lF?VE:function(t,e){if(t=pF(t),e=dF(e),mF)try{return VE(t,e)}catch(i){}if(gF(t,e))return hF(!cF(fF.f,t,e),t[e])}});var jg=X((Ket,WE)=>{"use strict";var yF=ri(),vF=An();WE.exports=yF&&vF(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var so=X((Qet,XE)=>{"use strict";var _F=xi(),xF=String,EF=TypeError;XE.exports=function(n){if(_F(n))return n;throw new EF(xF(n)+" is not an object")}});var Wo=X($E=>{"use strict";var SF=ri(),wF=Jg(),MF=jg(),ch=so(),YE=ah(),bF=TypeError,Kg=Object.defineProperty,AF=Object.getOwnPropertyDescriptor,Qg="enumerable",tm="configurable",em="writable";$E.f=SF?MF?function(t,e,i){if(ch(t),e=YE(e),ch(i),typeof t=="function"&&e==="prototype"&&"value"in i&&em in i&&!i[em]){var s=AF(t,e);s&&s[em]&&(t[e]=i.value,i={configurable:tm in i?i[tm]:s[tm],enumerable:Qg in i?i[Qg]:s[Qg],writable:!1})}return Kg(t,e,i)}:Kg:function(t,e,i){if(ch(t),e=YE(e),ch(i),wF)try{return Kg(t,e,i)}catch(s){}if("get"in i||"set"in i)throw new bF("Accessors not supported");return"value"in i&&(t[e]=i.value),t}});var xs=X((ent,ZE)=>{"use strict";var TF=ri(),CF=Wo(),IF=wc();ZE.exports=TF?function(n,t,e){return CF.f(n,t,IF(1,e))}:function(n,t,e){return n[t]=e,n}});var fh=X((nnt,jE)=>{"use strict";var nm=ri(),PF=oo(),JE=Function.prototype,RF=nm&&Object.getOwnPropertyDescriptor,rm=PF(JE,"name"),LF=rm&&function(){}.name==="something",NF=rm&&(!nm||nm&&RF(JE,"name").configurable);jE.exports={EXISTS:rm,PROPER:LF,CONFIGURABLE:NF}});var om=X((rnt,KE)=>{"use strict";var OF=In(),DF=er(),im=ih(),FF=OF(Function.toString);DF(im.inspectSource)||(im.inspectSource=function(n){return FF(n)});KE.exports=im.inspectSource});var eS=X((int,tS)=>{"use strict";var UF=Sn(),BF=er(),QE=UF.WeakMap;tS.exports=BF(QE)&&/native code/.test(String(QE))});var hh=X((ont,rS)=>{"use strict";var zF=oh(),GF=sh(),nS=zF("keys");rS.exports=function(n){return nS[n]||(nS[n]=GF(n))}});var ph=X((snt,iS)=>{"use strict";iS.exports={}});var Va=X((ant,aS)=>{"use strict";var kF=eS(),sS=Sn(),qF=xi(),VF=xs(),sm=oo(),am=ih(),HF=hh(),WF=ph(),oS="Object already initialized",um=sS.TypeError,XF=sS.WeakMap,dh,Ic,gh,YF=function(n){return gh(n)?Ic(n):dh(n,{})},$F=function(n){return function(t){var e;if(!qF(t)||(e=Ic(t)).type!==n)throw new um("Incompatible receiver, "+n+" required");return e}};kF||am.state?(wo=am.state||(am.state=new XF),wo.get=wo.get,wo.has=wo.has,wo.set=wo.set,dh=function(n,t){if(wo.has(n))throw new um(oS);return t.facade=n,wo.set(n,t),t},Ic=function(n){return wo.get(n)||{}},gh=function(n){return wo.has(n)}):(qa=HF("state"),WF[qa]=!0,dh=function(n,t){if(sm(n,qa))throw new um(oS);return t.facade=n,VF(n,qa,t),t},Ic=function(n){return sm(n,qa)?n[qa]:{}},gh=function(n){return sm(n,qa)});var wo,qa;aS.exports={set:dh,get:Ic,has:gh,enforce:YF,getterFor:$F}});var fm=X((unt,cS)=>{"use strict";var cm=In(),ZF=An(),JF=er(),mh=oo(),lm=ri(),jF=fh().CONFIGURABLE,KF=om(),lS=Va(),QF=lS.enforce,tU=lS.get,uS=String,yh=Object.defineProperty,eU=cm("".slice),nU=cm("".replace),rU=cm([].join),iU=lm&&!ZF(function(){return yh(function(){},"length",{value:8}).length!==8}),oU=String(String).split("String"),sU=cS.exports=function(n,t,e){eU(uS(t),0,7)==="Symbol("&&(t="["+nU(uS(t),/^Symbol\\(([^)]*)\\).*$/,"$1")+"]"),e&&e.getter&&(t="get "+t),e&&e.setter&&(t="set "+t),(!mh(n,"name")||jF&&n.name!==t)&&(lm?yh(n,"name",{value:t,configurable:!0}):n.name=t),iU&&e&&mh(e,"arity")&&n.length!==e.arity&&yh(n,"length",{value:e.arity});try{e&&mh(e,"constructor")&&e.constructor?lm&&yh(n,"prototype",{writable:!1}):n.prototype&&(n.prototype=void 0)}catch(s){}var i=QF(n);return mh(i,"source")||(i.source=rU(oU,typeof t=="string"?t:"")),n};Function.prototype.toString=sU(function(){return JF(this)&&tU(this).source||KF(this)},"toString")});var Ha=X((lnt,fS)=>{"use strict";var aU=er(),uU=Wo(),lU=fm(),cU=rh();fS.exports=function(n,t,e,i){i||(i={});var s=i.enumerable,u=i.name!==void 0?i.name:t;if(aU(e)&&lU(e,u,i),i.global)s?n[t]=e:cU(t,e);else{try{i.unsafe?n[t]&&(s=!0):delete n[t]}catch(c){}s?n[t]=e:uU.f(n,t,{value:e,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return n}});var pS=X((cnt,hS)=>{"use strict";var fU=Math.ceil,hU=Math.floor;hS.exports=Math.trunc||function(t){var e=+t;return(e>0?hU:fU)(e)}});var Hi=X((fnt,dS)=>{"use strict";var pU=pS();dS.exports=function(n){var t=+n;return t!==t||t===0?0:pU(t)}});var vh=X((hnt,gS)=>{"use strict";var dU=Hi(),gU=Math.max,mU=Math.min;gS.exports=function(n,t){var e=dU(n);return e<0?gU(e+t,0):mU(e,t)}});var Wa=X((pnt,mS)=>{"use strict";var yU=Hi(),vU=Math.min;mS.exports=function(n){var t=yU(n);return t>0?vU(t,9007199254740991):0}});var ii=X((dnt,yS)=>{"use strict";var _U=Wa();yS.exports=function(n){return _U(n.length)}});var xS=X((gnt,_S)=>{"use strict";var xU=Uu(),EU=vh(),SU=ii(),vS=function(n){return function(t,e,i){var s=xU(t),u=SU(s);if(u===0)return!n&&-1;var c=EU(i,u),f;if(n&&e!==e){for(;u>c;)if(f=s[c++],f!==f)return!0}else for(;u>c;c++)if((n||c in s)&&s[c]===e)return n||c||0;return!n&&-1}};_S.exports={includes:vS(!0),indexOf:vS(!1)}});var pm=X((mnt,SS)=>{"use strict";var wU=In(),hm=oo(),MU=Uu(),bU=xS().indexOf,AU=ph(),ES=wU([].push);SS.exports=function(n,t){var e=MU(n),i=0,s=[],u;for(u in e)!hm(AU,u)&&hm(e,u)&&ES(s,u);for(;t.length>i;)hm(e,u=t[i++])&&(~bU(s,u)||ES(s,u));return s}});var _h=X((ynt,wS)=>{"use strict";wS.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var dm=X(MS=>{"use strict";var TU=pm(),CU=_h(),IU=CU.concat("length","prototype");MS.f=Object.getOwnPropertyNames||function(t){return TU(t,IU)}});var AS=X(bS=>{"use strict";bS.f=Object.getOwnPropertySymbols});var CS=X((xnt,TS)=>{"use strict";var PU=$s(),RU=In(),LU=dm(),NU=AS(),OU=so(),DU=RU([].concat);TS.exports=PU("Reflect","ownKeys")||function(t){var e=LU.f(OU(t)),i=NU.f;return i?DU(e,i(t)):e}});var gm=X((Ent,PS)=>{"use strict";var IS=oo(),FU=CS(),UU=lh(),BU=Wo();PS.exports=function(n,t,e){for(var i=FU(t),s=BU.f,u=UU.f,c=0;c<i.length;c++){var f=i[c];!IS(n,f)&&!(e&&IS(e,f))&&s(n,f,u(t,f))}}});var LS=X((Snt,RS)=>{"use strict";var zU=An(),GU=er(),kU=/#|\\.prototype\\./,Pc=function(n,t){var e=VU[qU(n)];return e===WU?!0:e===HU?!1:GU(t)?zU(t):!!t},qU=Pc.normalize=function(n){return String(n).replace(kU,".").toLowerCase()},VU=Pc.data={},HU=Pc.NATIVE="N",WU=Pc.POLYFILL="P";RS.exports=Pc});var sr=X((wnt,NS)=>{"use strict";var xh=Sn(),XU=lh().f,YU=xs(),$U=Ha(),ZU=rh(),JU=gm(),jU=LS();NS.exports=function(n,t){var e=n.target,i=n.global,s=n.stat,u,c,f,p,d,g;if(i?c=xh:s?c=xh[e]||ZU(e,{}):c=xh[e]&&xh[e].prototype,c)for(f in t){if(d=t[f],n.dontCallGetSet?(g=XU(c,f),p=g&&g.value):p=c[f],u=jU(i?f:e+(s?".":"#")+f,n.forced),!u&&p!==void 0){if(typeof d==typeof p)continue;JU(d,p)}(n.sham||p&&p.sham)&&YU(d,"sham",!0),$U(c,f,d,n)}}});var Rc=X((Mnt,OS)=>{"use strict";var KU=vs();OS.exports=Array.isArray||function(t){return KU(t)==="Array"}});var mm=X((bnt,DS)=>{"use strict";var QU=ri(),tB=Rc(),eB=TypeError,nB=Object.getOwnPropertyDescriptor,rB=QU&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(n){return n instanceof TypeError}}();DS.exports=rB?function(n,t){if(tB(n)&&!nB(n,"length").writable)throw new eB("Cannot set read only .length");return n.length=t}:function(n,t){return n.length=t}});var Eh=X((Ant,FS)=>{"use strict";var iB=TypeError,oB=9007199254740991;FS.exports=function(n){if(n>oB)throw iB("Maximum allowed index exceeded");return n}});var Sh=X(()=>{"use strict";var sB=sr(),aB=Vi(),uB=ii(),lB=mm(),cB=Eh(),fB=An(),hB=fB(function(){return[].push.call({length:4294967296},1)!==4294967297}),pB=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(n){return n instanceof TypeError}},dB=hB||!pB();sB({target:"Array",proto:!0,arity:1,forced:dB},{push:function(t){var e=aB(this),i=uB(e),s=arguments.length;cB(i+s);for(var u=0;u<s;u++)e[i]=arguments[u],i++;return lB(e,i),i}})});var US=X(()=>{"use strict";var gB=sr(),mB=vr();gB({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return mB(URL.prototype.toString,this)}})});var zS=X((Rnt,BS)=>{"use strict";BS.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}});var qS=X((Lnt,kS)=>{"use strict";var yB=uh(),ym=yB("span").classList,GS=ym&&ym.constructor&&ym.constructor.prototype;kS.exports=GS===Object.prototype?void 0:GS});var HS=X((Nnt,VS)=>{"use strict";var vB=pm(),_B=_h();VS.exports=Object.keys||function(t){return vB(t,_B)}});var XS=X(WS=>{"use strict";var xB=ri(),EB=jg(),SB=Wo(),wB=so(),MB=Uu(),bB=HS();WS.f=xB&&!EB?Object.defineProperties:function(t,e){wB(t);for(var i=MB(e),s=bB(e),u=s.length,c=0,f;u>c;)SB.f(t,f=s[c++],i[f]);return t}});var $S=X((Dnt,YS)=>{"use strict";var AB=$s();YS.exports=AB("document","documentElement")});var ku=X((Fnt,ew)=>{"use strict";var TB=so(),CB=XS(),ZS=_h(),IB=ph(),PB=$S(),RB=uh(),LB=hh(),JS=">",jS="<",_m="prototype",xm="script",QS=LB("IE_PROTO"),vm=function(){},tw=function(n){return jS+xm+JS+n+jS+"/"+xm+JS},KS=function(n){n.write(tw("")),n.close();var t=n.parentWindow.Object;return n=null,t},NB=function(){var n=RB("iframe"),t="java"+xm+":",e;return n.style.display="none",PB.appendChild(n),n.src=String(t),e=n.contentWindow.document,e.open(),e.write(tw("document.F=Object")),e.close(),e.F},wh,Mh=function(){try{wh=new ActiveXObject("htmlfile")}catch(t){}Mh=typeof document!="undefined"?document.domain&&wh?KS(wh):NB():KS(wh);for(var n=ZS.length;n--;)delete Mh[_m][ZS[n]];return Mh()};IB[QS]=!0;ew.exports=Object.create||function(t,e){var i;return t!==null?(vm[_m]=TB(t),i=new vm,vm[_m]=null,i[QS]=t):i=Mh(),e===void 0?i:CB.f(i,e)}});var wm=X((Unt,nw)=>{"use strict";var OB=Xr(),DB=ku(),FB=Wo().f,Em=OB("unscopables"),Sm=Array.prototype;Sm[Em]===void 0&&FB(Sm,Em,{configurable:!0,value:DB(null)});nw.exports=function(n){Sm[Em][n]=!0}});var qu=X((Bnt,rw)=>{"use strict";rw.exports={}});var ow=X((znt,iw)=>{"use strict";var UB=An();iw.exports=!UB(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype})});var Lc=X((Gnt,aw)=>{"use strict";var BB=oo(),zB=er(),GB=Vi(),kB=hh(),qB=ow(),sw=kB("IE_PROTO"),Mm=Object,VB=Mm.prototype;aw.exports=qB?Mm.getPrototypeOf:function(n){var t=GB(n);if(BB(t,sw))return t[sw];var e=t.constructor;return zB(e)&&t instanceof e?e.prototype:t instanceof Mm?VB:null}});var Cm=X((knt,cw)=>{"use strict";var HB=An(),WB=er(),XB=xi(),YB=ku(),uw=Lc(),$B=Ha(),ZB=Xr(),JB=Cc(),Tm=ZB("iterator"),lw=!1,Es,bm,Am;[].keys&&(Am=[].keys(),"next"in Am?(bm=uw(uw(Am)),bm!==Object.prototype&&(Es=bm)):lw=!0);var jB=!XB(Es)||HB(function(){var n={};return Es[Tm].call(n)!==n});jB?Es={}:JB&&(Es=YB(Es));WB(Es[Tm])||$B(Es,Tm,function(){return this});cw.exports={IteratorPrototype:Es,BUGGY_SAFARI_ITERATORS:lw}});var Nc=X((qnt,hw)=>{"use strict";var KB=Wo().f,QB=oo(),tz=Xr(),fw=tz("toStringTag");hw.exports=function(n,t,e){n&&!e&&(n=n.prototype),n&&!QB(n,fw)&&KB(n,fw,{configurable:!0,value:t})}});var dw=X((Vnt,pw)=>{"use strict";var ez=Cm().IteratorPrototype,nz=ku(),rz=wc(),iz=Nc(),oz=qu(),sz=function(){return this};pw.exports=function(n,t,e,i){var s=t+" Iterator";return n.prototype=nz(ez,{next:rz(+!i,e)}),iz(n,s,!1,!0),oz[s]=sz,n}});var Oc=X((Hnt,gw)=>{"use strict";var az=In(),uz=_s();gw.exports=function(n,t,e){try{return az(uz(Object.getOwnPropertyDescriptor(n,t)[e]))}catch(i){}}});var yw=X((Wnt,mw)=>{"use strict";var lz=xi();mw.exports=function(n){return lz(n)||n===null}});var _w=X((Xnt,vw)=>{"use strict";var cz=yw(),fz=String,hz=TypeError;vw.exports=function(n){if(cz(n))return n;throw new hz("Can't set "+fz(n)+" as a prototype")}});var Vu=X((Ynt,xw)=>{"use strict";var pz=Oc(),dz=xi(),gz=Fu(),mz=_w();xw.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var n=!1,t={},e;try{e=pz(Object.prototype,"__proto__","set"),e(t,[]),n=t instanceof Array}catch(i){}return function(s,u){return gz(s),mz(u),dz(s)&&(n?e(s,u):s.__proto__=u),s}}():void 0)});var Rw=X(($nt,Pw)=>{"use strict";var yz=sr(),vz=vr(),bh=Cc(),Cw=fh(),_z=er(),xz=dw(),Ew=Lc(),Sw=Vu(),Ez=Nc(),Sz=xs(),Im=Ha(),wz=Xr(),ww=qu(),Iw=Cm(),Mz=Cw.PROPER,bz=Cw.CONFIGURABLE,Mw=Iw.IteratorPrototype,Ah=Iw.BUGGY_SAFARI_ITERATORS,Dc=wz("iterator"),bw="keys",Fc="values",Aw="entries",Tw=function(){return this};Pw.exports=function(n,t,e,i,s,u,c){xz(e,t,i);var f=function(x){if(x===s&&v)return v;if(!Ah&&x&&x in g)return g[x];switch(x){case bw:return function(){return new e(this,x)};case Fc:return function(){return new e(this,x)};case Aw:return function(){return new e(this,x)}}return function(){return new e(this)}},p=t+" Iterator",d=!1,g=n.prototype,y=g[Dc]||g["@@iterator"]||s&&g[s],v=!Ah&&y||f(s),E=t==="Array"&&g.entries||y,M,A,_;if(E&&(M=Ew(E.call(new n)),M!==Object.prototype&&M.next&&(!bh&&Ew(M)!==Mw&&(Sw?Sw(M,Mw):_z(M[Dc])||Im(M,Dc,Tw)),Ez(M,p,!0,!0),bh&&(ww[p]=Tw))),Mz&&s===Fc&&y&&y.name!==Fc&&(!bh&&bz?Sz(g,"name",Fc):(d=!0,v=function(){return vz(y,this)})),s)if(A={values:f(Fc),keys:u?v:f(bw),entries:f(Aw)},c)for(_ in A)(Ah||d||!(_ in g))&&Im(g,_,A[_]);else yz({target:t,proto:!0,forced:Ah||d},A);return(!bh||c)&&g[Dc]!==v&&Im(g,Dc,v,{name:s}),ww[t]=v,A}});var Nw=X((Znt,Lw)=>{"use strict";Lw.exports=function(n,t){return{value:n,done:t}}});var zw=X((Jnt,Bw)=>{"use strict";var Az=Uu(),Pm=wm(),Ow=qu(),Fw=Va(),Tz=Wo().f,Cz=Rw(),Th=Nw(),Iz=Cc(),Pz=ri(),Uw="Array Iterator",Rz=Fw.set,Lz=Fw.getterFor(Uw);Bw.exports=Cz(Array,"Array",function(n,t){Rz(this,{type:Uw,target:Az(n),index:0,kind:t})},function(){var n=Lz(this),t=n.target,e=n.index++;if(!t||e>=t.length)return n.target=null,Th(void 0,!0);switch(n.kind){case"keys":return Th(e,!1);case"values":return Th(t[e],!1)}return Th([e,t[e]],!1)},"values");var Dw=Ow.Arguments=Ow.Array;Pm("keys");Pm("values");Pm("entries");if(!Iz&&Pz&&Dw.name!=="values")try{Tz(Dw,"name",{value:"values"})}catch(n){}});var Bc=X(()=>{"use strict";var Gw=Sn(),qw=zS(),Nz=qS(),Uc=zw(),kw=xs(),Oz=Nc(),Dz=Xr(),Rm=Dz("iterator"),Lm=Uc.values,Vw=function(n,t){if(n){if(n[Rm]!==Lm)try{kw(n,Rm,Lm)}catch(i){n[Rm]=Lm}if(Oz(n,t,!0),qw[t]){for(var e in Uc)if(n[e]!==Uc[e])try{kw(n,e,Uc[e])}catch(i){n[e]=Uc[e]}}}};for(Ch in qw)Vw(Gw[Ch]&&Gw[Ch].prototype,Ch);var Ch;Vw(Nz,"DOMTokenList")});var Ih=X((Qnt,Hw)=>{"use strict";var Fz=vs(),Uz=In();Hw.exports=function(n){if(Fz(n)==="Function")return Uz(n)}});var zc=X((trt,Xw)=>{"use strict";var Ww=Ih(),Bz=_s(),zz=Sc(),Gz=Ww(Ww.bind);Xw.exports=function(n,t){return Bz(n),t===void 0?n:zz?Gz(n,t):function(){return n.apply(t,arguments)}}});var Zw=X((ert,$w)=>{"use strict";var kz=Rc(),qz=ii(),Vz=Eh(),Hz=zc(),Yw=function(n,t,e,i,s,u,c,f){for(var p=s,d=0,g=c?Hz(c,f):!1,y,v;d<i;)d in e&&(y=g?g(e[d],d,t):e[d],u>0&&kz(y)?(v=qz(y),p=Yw(n,t,y,v,p,u-1)-1):(Vz(p+1),n[p]=y),p++),d++;return p};$w.exports=Yw});var Kw=X((nrt,jw)=>{"use strict";var Wz=Xr(),Xz=Wz("toStringTag"),Jw={};Jw[Xz]="z";jw.exports=String(Jw)==="[object z]"});var Zs=X((rrt,Qw)=>{"use strict";var Yz=Kw(),$z=er(),Ph=vs(),Zz=Xr(),Jz=Zz("toStringTag"),jz=Object,Kz=Ph(function(){return arguments}())==="Arguments",Qz=function(n,t){try{return n[t]}catch(e){}};Qw.exports=Yz?Ph:function(n){var t,e,i;return n===void 0?"Undefined":n===null?"Null":typeof(e=Qz(t=jz(n),Jz))=="string"?e:Kz?Ph(t):(i=Ph(t))==="Object"&&$z(t.callee)?"Arguments":i}});var Om=X((irt,iM)=>{"use strict";var tG=In(),eG=An(),tM=er(),nG=Zs(),rG=$s(),iG=om(),eM=function(){},nM=rG("Reflect","construct"),Nm=/^\\s*(?:class|function)\\b/,oG=tG(Nm.exec),sG=!Nm.test(eM),Gc=function(t){if(!tM(t))return!1;try{return nM(eM,[],t),!0}catch(e){return!1}},rM=function(t){if(!tM(t))return!1;switch(nG(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return sG||!!oG(Nm,iG(t))}catch(e){return!0}};rM.sham=!0;iM.exports=!nM||eG(function(){var n;return Gc(Gc.call)||!Gc(Object)||!Gc(function(){n=!0})||n})?rM:Gc});var uM=X((ort,aM)=>{"use strict";var oM=Rc(),aG=Om(),uG=xi(),lG=Xr(),cG=lG("species"),sM=Array;aM.exports=function(n){var t;return oM(n)&&(t=n.constructor,aG(t)&&(t===sM||oM(t.prototype))?t=void 0:uG(t)&&(t=t[cG],t===null&&(t=void 0))),t===void 0?sM:t}});var Dm=X((srt,lM)=>{"use strict";var fG=uM();lM.exports=function(n,t){return new(fG(n))(t===0?0:t)}});var cM=X(()=>{"use strict";var hG=sr(),pG=Zw(),dG=Vi(),gG=ii(),mG=Hi(),yG=Dm();hG({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=dG(this),i=gG(e),s=yG(e,0);return s.length=pG(s,e,e,i,0,t===void 0?1:mG(t)),s}})});var fM=X(()=>{"use strict";var vG=wm();vG("flat")});var mM=X((frt,gM)=>{"use strict";var _G=Xr(),pM=_G("iterator"),dM=!1;try{hM=0,Fm={next:function(){return{done:!!hM++}},return:function(){dM=!0}},Fm[pM]=function(){return this},Array.from(Fm,function(){throw 2})}catch(n){}var hM,Fm;gM.exports=function(n,t){try{if(!t&&!dM)return!1}catch(s){return!1}var e=!1;try{var i={};i[pM]=function(){return{next:function(){return{done:e=!0}}}},n(i)}catch(s){}return e}});var Rh=X((hrt,yM)=>{"use strict";yM.exports=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"});var Hu=X((prt,_M)=>{"use strict";var vM=fm(),xG=Wo();_M.exports=function(n,t,e){return e.get&&vM(e.get,t,{getter:!0}),e.set&&vM(e.set,t,{setter:!0}),xG.f(n,t,e)}});var Wi=X((drt,IM)=>{"use strict";var EG=Rh(),Gm=ri(),Ei=Sn(),wM=er(),Oh=xi(),js=oo(),km=Zs(),SG=zu(),wG=xs(),Um=Ha(),MG=Hu(),bG=Mc(),Dh=Lc(),Xu=Vu(),AG=Xr(),TG=sh(),MM=Va(),bM=MM.enforce,CG=MM.get,Lh=Ei.Int8Array,Bm=Lh&&Lh.prototype,xM=Ei.Uint8ClampedArray,EM=xM&&xM.prototype,Xo=Lh&&Dh(Lh),Mo=Bm&&Dh(Bm),IG=Object.prototype,qm=Ei.TypeError,SM=AG("toStringTag"),zm=TG("TYPED_ARRAY_TAG"),Nh="TypedArrayConstructor",Ss=EG&&!!Xu&&km(Ei.opera)!=="Opera",AM=!1,Li,Js,Wu,ws={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Vm={BigInt64Array:8,BigUint64Array:8},PG=function(t){if(!Oh(t))return!1;var e=km(t);return e==="DataView"||js(ws,e)||js(Vm,e)},TM=function(n){var t=Dh(n);if(Oh(t)){var e=CG(t);return e&&js(e,Nh)?e[Nh]:TM(t)}},CM=function(n){if(!Oh(n))return!1;var t=km(n);return js(ws,t)||js(Vm,t)},RG=function(n){if(CM(n))return n;throw new qm("Target is not a typed array")},LG=function(n){if(wM(n)&&(!Xu||bG(Xo,n)))return n;throw new qm(SG(n)+" is not a typed array constructor")},NG=function(n,t,e,i){if(Gm){if(e)for(var s in ws){var u=Ei[s];if(u&&js(u.prototype,n))try{delete u.prototype[n]}catch(c){try{u.prototype[n]=t}catch(f){}}}(!Mo[n]||e)&&Um(Mo,n,e?t:Ss&&Bm[n]||t,i)}},OG=function(n,t,e){var i,s;if(Gm){if(Xu){if(e){for(i in ws)if(s=Ei[i],s&&js(s,n))try{delete s[n]}catch(u){}}if(!Xo[n]||e)try{return Um(Xo,n,e?t:Ss&&Xo[n]||t)}catch(u){}else return}for(i in ws)s=Ei[i],s&&(!s[n]||e)&&Um(s,n,t)}};for(Li in ws)Js=Ei[Li],Wu=Js&&Js.prototype,Wu?bM(Wu)[Nh]=Js:Ss=!1;for(Li in Vm)Js=Ei[Li],Wu=Js&&Js.prototype,Wu&&(bM(Wu)[Nh]=Js);if((!Ss||!wM(Xo)||Xo===Function.prototype)&&(Xo=function(){throw new qm("Incorrect invocation")},Ss))for(Li in ws)Ei[Li]&&Xu(Ei[Li],Xo);if((!Ss||!Mo||Mo===IG)&&(Mo=Xo.prototype,Ss))for(Li in ws)Ei[Li]&&Xu(Ei[Li].prototype,Mo);Ss&&Dh(EM)!==Mo&&Xu(EM,Mo);if(Gm&&!js(Mo,SM)){AM=!0,MG(Mo,SM,{configurable:!0,get:function(){return Oh(this)?this[zm]:void 0}});for(Li in ws)Ei[Li]&&wG(Ei[Li],zm,Li)}IM.exports={NATIVE_ARRAY_BUFFER_VIEWS:Ss,TYPED_ARRAY_TAG:AM&&zm,aTypedArray:RG,aTypedArrayConstructor:LG,exportTypedArrayMethod:NG,exportTypedArrayStaticMethod:OG,getTypedArrayConstructor:TM,isView:PG,isTypedArray:CM,TypedArray:Xo,TypedArrayPrototype:Mo}});var LM=X((grt,RM)=>{"use strict";var PM=Sn(),Hm=An(),DG=mM(),FG=Wi().NATIVE_ARRAY_BUFFER_VIEWS,UG=PM.ArrayBuffer,Xa=PM.Int8Array;RM.exports=!FG||!Hm(function(){Xa(1)})||!Hm(function(){new Xa(-1)})||!DG(function(n){new Xa,new Xa(null),new Xa(1.5),new Xa(n)},!0)||Hm(function(){return new Xa(new UG(2),1,void 0).length!==1})});var OM=X((mrt,NM)=>{"use strict";var BG=Ha();NM.exports=function(n,t,e){for(var i in t)BG(n,i,t[i],e);return n}});var Wm=X((yrt,DM)=>{"use strict";var zG=Mc(),GG=TypeError;DM.exports=function(n,t){if(zG(t,n))return n;throw new GG("Incorrect invocation")}});var Fh=X((vrt,FM)=>{"use strict";var kG=Hi(),qG=Wa(),VG=RangeError;FM.exports=function(n){if(n===void 0)return 0;var t=kG(n),e=qG(t);if(t!==e)throw new VG("Wrong length or index");return e}});var BM=X((_rt,UM)=>{"use strict";UM.exports=Math.sign||function(t){var e=+t;return e===0||e!==e?e:e<0?-1:1}});var kM=X((xrt,GM)=>{"use strict";var HG=2220446049250313e-31,zM=1/HG;GM.exports=function(n){return n+zM-zM}});var VM=X((Ert,qM)=>{"use strict";var WG=BM(),XG=kM(),YG=Math.abs,$G=2220446049250313e-31;qM.exports=function(n,t,e,i){var s=+n,u=YG(s),c=WG(s);if(u<i)return c*XG(u/i/t)*i*t;var f=(1+t/$G)*u,p=f-(f-u);return p>e||p!==p?c*(1/0):c*p}});var WM=X((Srt,HM)=>{"use strict";var ZG=VM(),JG=11920928955078125e-23,jG=34028234663852886e22,KG=11754943508222875e-54;HM.exports=Math.fround||function(t){return ZG(t,JG,jG,KG)}});var YM=X((wrt,XM)=>{"use strict";var QG=Array,t4=Math.abs,Ms=Math.pow,e4=Math.floor,n4=Math.log,r4=Math.LN2,i4=function(n,t,e){var i=QG(e),s=e*8-t-1,u=(1<<s)-1,c=u>>1,f=t===23?Ms(2,-24)-Ms(2,-77):0,p=n<0||n===0&&1/n<0?1:0,d=0,g,y,v;for(n=t4(n),n!==n||n===1/0?(y=n!==n?1:0,g=u):(g=e4(n4(n)/r4),v=Ms(2,-g),n*v<1&&(g--,v*=2),g+c>=1?n+=f/v:n+=f*Ms(2,1-c),n*v>=2&&(g++,v/=2),g+c>=u?(y=0,g=u):g+c>=1?(y=(n*v-1)*Ms(2,t),g+=c):(y=n*Ms(2,c-1)*Ms(2,t),g=0));t>=8;)i[d++]=y&255,y/=256,t-=8;for(g=g<<t|y,s+=t;s>0;)i[d++]=g&255,g/=256,s-=8;return i[d-1]|=p*128,i},o4=function(n,t){var e=n.length,i=e*8-t-1,s=(1<<i)-1,u=s>>1,c=i-7,f=e-1,p=n[f--],d=p&127,g;for(p>>=7;c>0;)d=d*256+n[f--],c-=8;for(g=d&(1<<-c)-1,d>>=-c,c+=t;c>0;)g=g*256+n[f--],c-=8;if(d===0)d=1-u;else{if(d===s)return g?NaN:p?-1/0:1/0;g+=Ms(2,t),d-=u}return(p?-1:1)*g*Ms(2,d-t)};XM.exports={pack:i4,unpack:o4}});var Xm=X((Mrt,ZM)=>{"use strict";var s4=Vi(),$M=vh(),a4=ii();ZM.exports=function(t){for(var e=s4(this),i=a4(e),s=arguments.length,u=$M(s>1?arguments[1]:void 0,i),c=s>2?arguments[2]:void 0,f=c===void 0?i:$M(c,i);f>u;)e[u++]=t;return e}});var Uh=X((brt,JM)=>{"use strict";var u4=In();JM.exports=u4([].slice)});var Ym=X((Art,KM)=>{"use strict";var l4=er(),c4=xi(),jM=Vu();KM.exports=function(n,t,e){var i,s;return jM&&l4(i=t.constructor)&&i!==e&&c4(s=i.prototype)&&s!==e.prototype&&jM(n,s),n}});var Hh=X((Trt,gb)=>{"use strict";var qh=Sn(),Km=In(),$m=ri(),f4=Rh(),cb=fh(),h4=xs(),p4=Hu(),QM=OM(),Zm=An(),Bh=Wm(),d4=Hi(),g4=Wa(),Gh=Fh(),m4=WM(),fb=YM(),y4=Lc(),tb=Vu(),v4=Xm(),_4=Uh(),x4=Ym(),E4=gm(),hb=Nc(),Qm=Va(),S4=cb.PROPER,eb=cb.CONFIGURABLE,$u="ArrayBuffer",Vh="DataView",Zu="prototype",w4="Wrong length",pb="Wrong index",nb=Qm.getterFor($u),qc=Qm.getterFor(Vh),rb=Qm.set,bo=qh[$u],Xi=bo,Yu=Xi&&Xi[Zu],Yo=qh[Vh],Ya=Yo&&Yo[Zu],ib=Object.prototype,M4=qh.Array,kh=qh.RangeError,b4=Km(v4),A4=Km([].reverse),db=fb.pack,ob=fb.unpack,sb=function(n){return[n&255]},ab=function(n){return[n&255,n>>8&255]},ub=function(n){return[n&255,n>>8&255,n>>16&255,n>>24&255]},lb=function(n){return n[3]<<24|n[2]<<16|n[1]<<8|n[0]},T4=function(n){return db(m4(n),23,4)},C4=function(n){return db(n,52,8)},zh=function(n,t,e){p4(n[Zu],t,{configurable:!0,get:function(){return e(this)[t]}})},Ks=function(n,t,e,i){var s=qc(n),u=Gh(e),c=!!i;if(u+t>s.byteLength)throw new kh(pb);var f=s.bytes,p=u+s.byteOffset,d=_4(f,p,p+t);return c?d:A4(d)},Qs=function(n,t,e,i,s,u){var c=qc(n),f=Gh(e),p=i(+s),d=!!u;if(f+t>c.byteLength)throw new kh(pb);for(var g=c.bytes,y=f+c.byteOffset,v=0;v<t;v++)g[y+v]=p[d?v:t-v-1]};f4?(Jm=S4&&bo.name!==$u,!Zm(function(){bo(1)})||!Zm(function(){new bo(-1)})||Zm(function(){return new bo,new bo(1.5),new bo(NaN),bo.length!==1||Jm&&!eb})?(Xi=function(t){return Bh(this,Yu),x4(new bo(Gh(t)),this,Xi)},Xi[Zu]=Yu,Yu.constructor=Xi,E4(Xi,bo)):Jm&&eb&&h4(bo,"name",$u),tb&&y4(Ya)!==ib&&tb(Ya,ib),kc=new Yo(new Xi(2)),jm=Km(Ya.setInt8),kc.setInt8(0,2147483648),kc.setInt8(1,2147483649),(kc.getInt8(0)||!kc.getInt8(1))&&QM(Ya,{setInt8:function(t,e){jm(this,t,e<<24>>24)},setUint8:function(t,e){jm(this,t,e<<24>>24)}},{unsafe:!0})):(Xi=function(t){Bh(this,Yu);var e=Gh(t);rb(this,{type:$u,bytes:b4(M4(e),0),byteLength:e}),$m||(this.byteLength=e,this.detached=!1)},Yu=Xi[Zu],Yo=function(t,e,i){Bh(this,Ya),Bh(t,Yu);var s=nb(t),u=s.byteLength,c=d4(e);if(c<0||c>u)throw new kh("Wrong offset");if(i=i===void 0?u-c:g4(i),c+i>u)throw new kh(w4);rb(this,{type:Vh,buffer:t,byteLength:i,byteOffset:c,bytes:s.bytes}),$m||(this.buffer=t,this.byteLength=i,this.byteOffset=c)},Ya=Yo[Zu],$m&&(zh(Xi,"byteLength",nb),zh(Yo,"buffer",qc),zh(Yo,"byteLength",qc),zh(Yo,"byteOffset",qc)),QM(Ya,{getInt8:function(t){return Ks(this,1,t)[0]<<24>>24},getUint8:function(t){return Ks(this,1,t)[0]},getInt16:function(t){var e=Ks(this,2,t,arguments.length>1?arguments[1]:!1);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=Ks(this,2,t,arguments.length>1?arguments[1]:!1);return e[1]<<8|e[0]},getInt32:function(t){return lb(Ks(this,4,t,arguments.length>1?arguments[1]:!1))},getUint32:function(t){return lb(Ks(this,4,t,arguments.length>1?arguments[1]:!1))>>>0},getFloat32:function(t){return ob(Ks(this,4,t,arguments.length>1?arguments[1]:!1),23)},getFloat64:function(t){return ob(Ks(this,8,t,arguments.length>1?arguments[1]:!1),52)},setInt8:function(t,e){Qs(this,1,t,sb,e)},setUint8:function(t,e){Qs(this,1,t,sb,e)},setInt16:function(t,e){Qs(this,2,t,ab,e,arguments.length>2?arguments[2]:!1)},setUint16:function(t,e){Qs(this,2,t,ab,e,arguments.length>2?arguments[2]:!1)},setInt32:function(t,e){Qs(this,4,t,ub,e,arguments.length>2?arguments[2]:!1)},setUint32:function(t,e){Qs(this,4,t,ub,e,arguments.length>2?arguments[2]:!1)},setFloat32:function(t,e){Qs(this,4,t,T4,e,arguments.length>2?arguments[2]:!1)},setFloat64:function(t,e){Qs(this,8,t,C4,e,arguments.length>2?arguments[2]:!1)}}));var Jm,kc,jm;hb(Xi,$u);hb(Yo,Vh);gb.exports={ArrayBuffer:Xi,DataView:Yo}});var yb=X((Crt,mb)=>{"use strict";var I4=xi(),P4=Math.floor;mb.exports=Number.isInteger||function(t){return!I4(t)&&isFinite(t)&&P4(t)===t}});var _b=X((Irt,vb)=>{"use strict";var R4=Hi(),L4=RangeError;vb.exports=function(n){var t=R4(n);if(t<0)throw new L4("The argument can't be less than 0");return t}});var t0=X((Prt,xb)=>{"use strict";var N4=_b(),O4=RangeError;xb.exports=function(n,t){var e=N4(n);if(e%t)throw new O4("Wrong offset");return e}});var Sb=X((Rrt,Eb)=>{"use strict";var D4=Math.round;Eb.exports=function(n){var t=D4(n);return t<0?0:t>255?255:t&255}});var Mb=X((Lrt,wb)=>{"use strict";var F4=Om(),U4=zu(),B4=TypeError;wb.exports=function(n){if(F4(n))return n;throw new B4(U4(n)+" is not a constructor")}});var e0=X((Nrt,Ab)=>{"use strict";var z4=Zs(),bb=Tc(),G4=th(),k4=qu(),q4=Xr(),V4=q4("iterator");Ab.exports=function(n){if(!G4(n))return bb(n,V4)||bb(n,"@@iterator")||k4[z4(n)]}});var Cb=X((Ort,Tb)=>{"use strict";var H4=vr(),W4=_s(),X4=so(),Y4=zu(),$4=e0(),Z4=TypeError;Tb.exports=function(n,t){var e=arguments.length<2?$4(n):t;if(W4(e))return X4(H4(e,n));throw new Z4(Y4(n)+" is not iterable")}});var Pb=X((Drt,Ib)=>{"use strict";var J4=Xr(),j4=qu(),K4=J4("iterator"),Q4=Array.prototype;Ib.exports=function(n){return n!==void 0&&(j4.Array===n||Q4[K4]===n)}});var n0=X((Frt,Rb)=>{"use strict";var tk=Zs();Rb.exports=function(n){var t=tk(n);return t==="BigInt64Array"||t==="BigUint64Array"}});var Wh=X((Urt,Lb)=>{"use strict";var ek=$g(),nk=TypeError;Lb.exports=function(n){var t=ek(n,"number");if(typeof t=="number")throw new nk("Can't convert number to bigint");return BigInt(t)}});var Ob=X((Brt,Nb)=>{"use strict";var rk=zc(),ik=vr(),ok=Mb(),sk=Vi(),ak=ii(),uk=Cb(),lk=e0(),ck=Pb(),fk=n0(),hk=Wi().aTypedArrayConstructor,pk=Wh();Nb.exports=function(t){var e=ok(this),i=sk(t),s=arguments.length,u=s>1?arguments[1]:void 0,c=u!==void 0,f=lk(i),p,d,g,y,v,E,M,A;if(f&&!ck(f))for(M=uk(i,f),A=M.next,i=[];!(E=ik(A,M)).done;)i.push(E.value);for(c&&s>2&&(u=rk(u,arguments[2])),d=ak(i),g=new(hk(e))(d),y=fk(g),p=0;d>p;p++)v=c?u(i[p],p):i[p],g[p]=y?pk(v):+v;return g}});var Ub=X((zrt,Fb)=>{"use strict";var dk=zc(),gk=In(),mk=Qf(),yk=Vi(),vk=ii(),_k=Dm(),Db=gk([].push),ta=function(n){var t=n===1,e=n===2,i=n===3,s=n===4,u=n===6,c=n===7,f=n===5||u;return function(p,d,g,y){for(var v=yk(p),E=mk(v),M=vk(E),A=dk(d,g),_=0,x=y||_k,T=t?x(p,M):e||c?x(p,0):void 0,w,R;M>_;_++)if((f||_ in E)&&(w=E[_],R=A(w,_,v),n))if(t)T[_]=R;else if(R)switch(n){case 3:return!0;case 5:return w;case 6:return _;case 2:Db(T,w)}else switch(n){case 4:return!1;case 7:Db(T,w)}return u?-1:i||s?s:T}};Fb.exports={forEach:ta(0),map:ta(1),filter:ta(2),some:ta(3),every:ta(4),find:ta(5),findIndex:ta(6),filterReject:ta(7)}});var r0=X((Grt,zb)=>{"use strict";var xk=$s(),Ek=Hu(),Sk=Xr(),wk=ri(),Bb=Sk("species");zb.exports=function(n){var t=xk(n);wk&&t&&!t[Bb]&&Ek(t,Bb,{configurable:!0,get:function(){return this}})}});var i0=X((krt,Gb)=>{"use strict";var Mk=ii();Gb.exports=function(n,t,e){for(var i=0,s=arguments.length>2?e:Mk(t),u=new n(s);s>i;)u[i]=t[i++];return u}});var sA=X((qrt,f0)=>{"use strict";var kb=sr(),Kb=Sn(),qb=vr(),bk=ri(),Ak=LM(),Xc=Wi(),Qb=Hh(),Vb=Wm(),Tk=wc(),Vc=xs(),Ck=yb(),Ik=Wa(),Hb=Fh(),o0=t0(),Pk=Sb(),tA=ah(),Hc=oo(),Rk=Zs(),u0=xi(),Lk=Ac(),Nk=ku(),Ok=Mc(),Xh=Vu(),Dk=dm().f,Wb=Ob(),Fk=Ub().forEach,Uk=r0(),Bk=Hu(),eA=Wo(),nA=lh(),Xb=i0(),h0=Va(),zk=Ym(),l0=h0.get,Gk=h0.set,kk=h0.enforce,rA=eA.f,qk=nA.f,s0=Kb.RangeError,iA=Qb.ArrayBuffer,Vk=iA.prototype,Hk=Qb.DataView,Yh=Xc.NATIVE_ARRAY_BUFFER_VIEWS,Yb=Xc.TYPED_ARRAY_TAG,$b=Xc.TypedArray,Wc=Xc.TypedArrayPrototype,c0=Xc.isTypedArray,$h="BYTES_PER_ELEMENT",a0="Wrong length",Zh=function(n,t){Bk(n,t,{configurable:!0,get:function(){return l0(this)[t]}})},Zb=function(n){var t;return Ok(Vk,n)||(t=Rk(n))==="ArrayBuffer"||t==="SharedArrayBuffer"},oA=function(n,t){return c0(n)&&!Lk(t)&&t in n&&Ck(+t)&&t>=0},Jb=function(t,e){return e=tA(e),oA(t,e)?Tk(2,t[e]):qk(t,e)},jb=function(t,e,i){return e=tA(e),oA(t,e)&&u0(i)&&Hc(i,"value")&&!Hc(i,"get")&&!Hc(i,"set")&&!i.configurable&&(!Hc(i,"writable")||i.writable)&&(!Hc(i,"enumerable")||i.enumerable)?(t[e]=i.value,t):rA(t,e,i)};bk?(Yh||(nA.f=Jb,eA.f=jb,Zh(Wc,"buffer"),Zh(Wc,"byteOffset"),Zh(Wc,"byteLength"),Zh(Wc,"length")),kb({target:"Object",stat:!0,forced:!Yh},{getOwnPropertyDescriptor:Jb,defineProperty:jb}),f0.exports=function(n,t,e){var i=n.match(/\\d+/)[0]/8,s=n+(e?"Clamped":"")+"Array",u="get"+n,c="set"+n,f=Kb[s],p=f,d=p&&p.prototype,g={},y=function(A,_){var x=l0(A);return x.view[u](_*i+x.byteOffset,!0)},v=function(A,_,x){var T=l0(A);T.view[c](_*i+T.byteOffset,e?Pk(x):x,!0)},E=function(A,_){rA(A,_,{get:function(){return y(this,_)},set:function(x){return v(this,_,x)},enumerable:!0})};Yh?Ak&&(p=t(function(A,_,x,T){return Vb(A,d),zk(function(){return u0(_)?Zb(_)?T!==void 0?new f(_,o0(x,i),T):x!==void 0?new f(_,o0(x,i)):new f(_):c0(_)?Xb(p,_):qb(Wb,p,_):new f(Hb(_))}(),A,p)}),Xh&&Xh(p,$b),Fk(Dk(f),function(A){A in p||Vc(p,A,f[A])}),p.prototype=d):(p=t(function(A,_,x,T){Vb(A,d);var w=0,R=0,B,U,D;if(!u0(_))D=Hb(_),U=D*i,B=new iA(U);else if(Zb(_)){B=_,R=o0(x,i);var P=_.byteLength;if(T===void 0){if(P%i)throw new s0(a0);if(U=P-R,U<0)throw new s0(a0)}else if(U=Ik(T)*i,U+R>P)throw new s0(a0);D=U/i}else return c0(_)?Xb(p,_):qb(Wb,p,_);for(Gk(A,{buffer:B,byteOffset:R,byteLength:U,length:D,view:new Hk(B)});w<D;)E(A,w++)}),Xh&&Xh(p,$b),d=p.prototype=Nk(Wc)),d.constructor!==p&&Vc(d,"constructor",p),kk(d).TypedArrayConstructor=p,Yb&&Vc(d,Yb,s);var M=p!==f;g[s]=p,kb({global:!0,constructor:!0,forced:M,sham:!Yh},g),$h in p||Vc(p,$h,i),$h in d||Vc(d,$h,i),Uk(s)}):f0.exports=function(){}});var p0=X(()=>{"use strict";var Wk=sA();Wk("Float32",function(n){return function(e,i,s){return n(this,e,i,s)}})});var d0=X(()=>{"use strict";var aA=Wi(),Xk=ii(),Yk=Hi(),$k=aA.aTypedArray,Zk=aA.exportTypedArrayMethod;Zk("at",function(t){var e=$k(this),i=Xk(e),s=Yk(t),u=s>=0?s:i+s;return u<0||u>=i?void 0:e[u]})});var g0=X(()=>{"use strict";var uA=Wi(),Jk=Xm(),jk=Wh(),Kk=Zs(),Qk=vr(),tq=In(),eq=An(),nq=uA.aTypedArray,rq=uA.exportTypedArrayMethod,iq=tq("".slice),oq=eq(function(){var n=0;return new Int8Array(2).fill({valueOf:function(){return n++}}),n!==1});rq("fill",function(t){var e=arguments.length;nq(this);var i=iq(Kk(this),0,3)==="Big"?jk(t):+t;return Qk(Jk,this,i,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)},oq)});var m0=X((Zrt,cA)=>{"use strict";var sq=zc(),aq=Qf(),uq=Vi(),lq=ii(),lA=function(n){var t=n===1;return function(e,i,s){for(var u=uq(e),c=aq(u),f=lq(c),p=sq(i,s),d,g;f-- >0;)if(d=c[f],g=p(d,f,u),g)switch(n){case 0:return d;case 1:return f}return t?-1:void 0}};cA.exports={findLast:lA(0),findLastIndex:lA(1)}});var y0=X(()=>{"use strict";var fA=Wi(),cq=m0().findLast,fq=fA.aTypedArray,hq=fA.exportTypedArrayMethod;hq("findLast",function(t){return cq(fq(this),t,arguments.length>1?arguments[1]:void 0)})});var v0=X(()=>{"use strict";var hA=Wi(),pq=m0().findLastIndex,dq=hA.aTypedArray,gq=hA.exportTypedArrayMethod;gq("findLastIndex",function(t){return pq(dq(this),t,arguments.length>1?arguments[1]:void 0)})});var S0=X(()=>{"use strict";var dA=Sn(),gA=vr(),E0=Wi(),mq=ii(),yq=t0(),vq=Vi(),mA=An(),_q=dA.RangeError,_0=dA.Int8Array,pA=_0&&_0.prototype,yA=pA&&pA.set,xq=E0.aTypedArray,Eq=E0.exportTypedArrayMethod,x0=!mA(function(){var n=new Uint8ClampedArray(2);return gA(yA,n,{length:1,0:3},1),n[1]!==3}),Sq=x0&&E0.NATIVE_ARRAY_BUFFER_VIEWS&&mA(function(){var n=new _0(2);return n.set(1),n.set("2",1),n[0]!==0||n[1]!==2});Eq("set",function(t){xq(this);var e=yq(arguments.length>1?arguments[1]:void 0,1),i=vq(t);if(x0)return gA(yA,this,i,e);var s=this.length,u=mq(i),c=0;if(u+e>s)throw new _q("Wrong length");for(;c<u;)this[e+c]=i[c++]},!x0||Sq)});var M0=X((nit,_A)=>{"use strict";var vA=Uh(),wq=Math.floor,w0=function(n,t){var e=n.length;if(e<8)for(var i=1,s,u;i<e;){for(u=i,s=n[i];u&&t(n[u-1],s)>0;)n[u]=n[--u];u!==i++&&(n[u]=s)}else for(var c=wq(e/2),f=w0(vA(n,0,c),t),p=w0(vA(n,c),t),d=f.length,g=p.length,y=0,v=0;y<d||v<g;)n[y+v]=y<d&&v<g?t(f[y],p[v])<=0?f[y++]:p[v++]:y<d?f[y++]:p[v++];return n};_A.exports=w0});var b0=X((rit,EA)=>{"use strict";var Mq=Bu(),xA=Mq.match(/firefox\\/(\\d+)/i);EA.exports=!!xA&&+xA[1]});var A0=X((iit,SA)=>{"use strict";var bq=Bu();SA.exports=/MSIE|Trident/.test(bq)});var T0=X((oit,MA)=>{"use strict";var Aq=Bu(),wA=Aq.match(/AppleWebKit\\/(\\d+)\\./);MA.exports=!!wA&&+wA[1]});var I0=X(()=>{"use strict";var Tq=Sn(),Cq=Ih(),C0=An(),Iq=_s(),Pq=M0(),IA=Wi(),bA=b0(),Rq=A0(),AA=bc(),TA=T0(),Lq=IA.aTypedArray,Nq=IA.exportTypedArrayMethod,Yc=Tq.Uint16Array,Ju=Yc&&Cq(Yc.prototype.sort),Oq=!!Ju&&!(C0(function(){Ju(new Yc(2),null)})&&C0(function(){Ju(new Yc(2),{})})),CA=!!Ju&&!C0(function(){if(AA)return AA<74;if(bA)return bA<67;if(Rq)return!0;if(TA)return TA<602;var n=new Yc(516),t=Array(516),e,i;for(e=0;e<516;e++)i=e%4,n[e]=515-e,t[e]=e-2*i+3;for(Ju(n,function(s,u){return(s/4|0)-(u/4|0)}),e=0;e<516;e++)if(n[e]!==t[e])return!0}),Dq=function(n){return function(t,e){return n!==void 0?+n(t,e)||0:e!==e?-1:t!==t?1:t===0&&e===0?1/t>0&&1/e<0?1:-1:t>e}};Nq("sort",function(t){return t!==void 0&&Iq(t),CA?Ju(this,t):Pq(Lq(this),Dq(t))},!CA||Oq)});var RA=X((uit,PA)=>{"use strict";var Fq=ii();PA.exports=function(n,t){for(var e=Fq(n),i=new t(e),s=0;s<e;s++)i[s]=n[e-s-1];return i}});var R0=X(()=>{"use strict";var Uq=RA(),P0=Wi(),Bq=P0.aTypedArray,zq=P0.exportTypedArrayMethod,Gq=P0.getTypedArrayConstructor;zq("toReversed",function(){return Uq(Bq(this),Gq(this))})});var L0=X(()=>{"use strict";var Jh=Wi(),kq=In(),qq=_s(),Vq=i0(),Hq=Jh.aTypedArray,Wq=Jh.getTypedArrayConstructor,Xq=Jh.exportTypedArrayMethod,Yq=kq(Jh.TypedArrayPrototype.sort);Xq("toSorted",function(t){t!==void 0&&qq(t);var e=Hq(this),i=Vq(Wq(e),e);return Yq(i,t)})});var NA=X((pit,LA)=>{"use strict";var $q=ii(),Zq=Hi(),Jq=RangeError;LA.exports=function(n,t,e,i){var s=$q(n),u=Zq(e),c=u<0?s+u:u;if(c>=s||c<0)throw new Jq("Incorrect index");for(var f=new t(s),p=0;p<s;p++)f[p]=p===c?i:n[p];return f}});var O0=X(()=>{"use strict";var jq=NA(),N0=Wi(),Kq=n0(),Qq=Hi(),t5=Wh(),e5=N0.aTypedArray,n5=N0.getTypedArrayConstructor,r5=N0.exportTypedArrayMethod,i5=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(n){return n===8}}();r5("with",function(n,t){var e=e5(this),i=Qq(n),s=Kq(e)?t5(t):+t;return jq(e,n5(e),i,s)},!i5)});var F0=X(()=>{"use strict";var o5=sr(),s5=Sn(),a5=Hh(),u5=r0(),D0="ArrayBuffer",OA=a5[D0],l5=s5[D0];o5({global:!0,constructor:!0,forced:l5!==OA},{ArrayBuffer:OA});u5(D0)});var G0=X(()=>{"use strict";var c5=sr(),B0=Ih(),f5=An(),BA=Hh(),DA=so(),FA=vh(),h5=Wa(),z0=BA.ArrayBuffer,U0=BA.DataView,zA=U0.prototype,UA=B0(z0.prototype.slice),p5=B0(zA.getUint8),d5=B0(zA.setUint8),g5=f5(function(){return!new z0(2).slice(1,void 0).byteLength});c5({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:g5},{slice:function(t,e){if(UA&&e===void 0)return UA(DA(this),t);for(var i=DA(this).byteLength,s=FA(t,i),u=FA(e===void 0?i:e,i),c=new z0(h5(u-s)),f=new U0(this),p=new U0(c),d=0;s<u;)d5(p,d++,p5(f,s++));return c}})});var k0=X((xit,qA)=>{"use strict";var kA=Sn(),m5=Oc(),y5=vs(),GA=kA.ArrayBuffer,v5=kA.TypeError;qA.exports=GA&&m5(GA.prototype,"byteLength","get")||function(n){if(y5(n)!=="ArrayBuffer")throw new v5("ArrayBuffer expected");return n.byteLength}});var q0=X((Eit,VA)=>{"use strict";var _5=Sn(),x5=Rh(),E5=k0(),S5=_5.DataView;VA.exports=function(n){if(!x5||E5(n)!==0)return!1;try{return new S5(n),!1}catch(t){return!0}}});var V0=X(()=>{"use strict";var w5=ri(),M5=Hu(),b5=q0(),HA=ArrayBuffer.prototype;w5&&!("detached"in HA)&&M5(HA,"detached",{configurable:!0,get:function(){return b5(this)}})});var XA=X((Mit,WA)=>{"use strict";var A5=q0(),T5=TypeError;WA.exports=function(n){if(A5(n))throw new T5("ArrayBuffer is detached");return n}});var H0=X((bit,YA)=>{"use strict";var $c=Sn(),C5=Bu(),I5=vs(),jh=function(n){return C5.slice(0,n.length)===n};YA.exports=function(){return jh("Bun/")?"BUN":jh("Cloudflare-Workers")?"CLOUDFLARE":jh("Deno/")?"DENO":jh("Node.js/")?"NODE":$c.Bun&&typeof Bun.version=="string"?"BUN":$c.Deno&&typeof Deno.version=="object"?"DENO":I5($c.process)==="process"?"NODE":$c.window&&$c.document?"BROWSER":"REST"}()});var ZA=X((Ait,$A)=>{"use strict";var P5=H0();$A.exports=P5==="NODE"});var jA=X((Tit,JA)=>{"use strict";var R5=Sn(),L5=ZA();JA.exports=function(n){if(L5){try{return R5.process.getBuiltinModule(n)}catch(t){}try{return Function('return require("'+n+'")')()}catch(t){}}}});var Y0=X((Cit,QA)=>{"use strict";var N5=Sn(),O5=An(),W0=bc(),X0=H0(),KA=N5.structuredClone;QA.exports=!!KA&&!O5(function(){if(X0==="DENO"&&W0>92||X0==="NODE"&&W0>94||X0==="BROWSER"&&W0>97)return!1;var n=new ArrayBuffer(8),t=KA(n,{transfer:[n]});return n.byteLength!==0||t.byteLength!==8})});var rT=X((Iit,nT)=>{"use strict";var j0=Sn(),D5=jA(),F5=Y0(),U5=j0.structuredClone,tT=j0.ArrayBuffer,Kh=j0.MessageChannel,J0=!1,$0,eT,Qh,Z0;if(F5)J0=function(n){U5(n,{transfer:[n]})};else if(tT)try{Kh||($0=D5("worker_threads"),$0&&(Kh=$0.MessageChannel)),Kh&&(eT=new Kh,Qh=new tT(2),Z0=function(n){eT.port1.postMessage(null,[n])},Qh.byteLength===2&&(Z0(Qh),Qh.byteLength===0&&(J0=Z0)))}catch(n){}nT.exports=J0});var ry=X((Pit,cT)=>{"use strict";var ty=Sn(),ey=In(),aT=Oc(),B5=Fh(),z5=XA(),G5=k0(),iT=rT(),K0=Y0(),k5=ty.structuredClone,uT=ty.ArrayBuffer,Q0=ty.DataView,q5=Math.min,ny=uT.prototype,lT=Q0.prototype,V5=ey(ny.slice),oT=aT(ny,"resizable","get"),sT=aT(ny,"maxByteLength","get"),H5=ey(lT.getInt8),W5=ey(lT.setInt8);cT.exports=(K0||iT)&&function(n,t,e){var i=G5(n),s=t===void 0?i:B5(t),u=!oT||!oT(n),c;if(z5(n),K0&&(n=k5(n,{transfer:[n]}),i===s&&(e||u)))return n;if(i>=s&&(!e||u))c=V5(n,0,s);else{var f=e&&!u&&sT?{maxByteLength:sT(n)}:void 0;c=new uT(s,f);for(var p=new Q0(n),d=new Q0(c),g=q5(s,i),y=0;y<g;y++)W5(d,y,H5(p,y))}return K0||iT(n),c}});var iy=X(()=>{"use strict";var X5=sr(),fT=ry();fT&&X5({target:"ArrayBuffer",proto:!0},{transfer:function(){return fT(this,arguments.length?arguments[0]:void 0,!0)}})});var oy=X(()=>{"use strict";var Y5=sr(),hT=ry();hT&&Y5({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return hT(this,arguments.length?arguments[0]:void 0,!1)}})});var Ao=X((Dit,pT)=>{"use strict";var sy=In(),tp=Set.prototype;pT.exports={Set,add:sy(tp.add),has:sy(tp.has),remove:sy(tp.delete),proto:tp}});var ea=X((Fit,dT)=>{"use strict";var $5=Ao().has;dT.exports=function(n){return $5(n),n}});var na=X((Uit,gT)=>{"use strict";var Z5=vr();gT.exports=function(n,t,e){for(var i=e?n:n.iterator,s=n.next,u,c;!(u=Z5(s,i)).done;)if(c=t(u.value),c!==void 0)return c}});var ju=X((Bit,xT)=>{"use strict";var mT=In(),J5=na(),yT=Ao(),j5=yT.Set,vT=yT.proto,K5=mT(vT.forEach),_T=mT(vT.keys),Q5=_T(new j5).next;xT.exports=function(n,t,e){return e?J5({iterator:_T(n),next:Q5},t):K5(n,t)}});var ep=X((zit,ST)=>{"use strict";var ET=Ao(),tV=ju(),eV=ET.Set,nV=ET.add;ST.exports=function(n){var t=new eV;return tV(n,function(e){nV(t,e)}),t}});var Ku=X((Git,wT)=>{"use strict";var rV=Oc(),iV=Ao();wT.exports=rV(iV.proto,"size","get")||function(n){return n.size}});var bT=X((kit,MT)=>{"use strict";MT.exports=function(n){return{iterator:n,next:n.next,done:!1}}});var ra=X((qit,RT)=>{"use strict";var AT=_s(),IT=so(),TT=vr(),oV=Hi(),sV=bT(),CT="Invalid size",aV=RangeError,uV=TypeError,lV=Math.max,PT=function(n,t){this.set=n,this.size=lV(t,0),this.has=AT(n.has),this.keys=AT(n.keys)};PT.prototype={getIterator:function(){return sV(IT(TT(this.keys,this.set)))},includes:function(n){return TT(this.has,this.set,n)}};RT.exports=function(n){IT(n);var t=+n.size;if(t!==t)throw new uV(CT);var e=oV(t);if(e<0)throw new aV(CT);return new PT(n,e)}});var DT=X((Vit,OT)=>{"use strict";var cV=ea(),NT=Ao(),fV=ep(),hV=Ku(),pV=ra(),dV=ju(),gV=na(),mV=NT.has,LT=NT.remove;OT.exports=function(t){var e=cV(this),i=pV(t),s=fV(e);return hV(e)<=i.size?dV(e,function(u){i.includes(u)&&LT(s,u)}):gV(i.getIterator(),function(u){mV(e,u)&&LT(s,u)}),s}});var ia=X((Hit,BT)=>{"use strict";var yV=$s(),FT=function(n){return{size:n,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},UT=function(n){return{size:n,has:function(){return!0},keys:function(){throw new Error("e")}}};BT.exports=function(n,t){var e=yV("Set");try{new e()[n](FT(0));try{return new e()[n](FT(-1)),!1}catch(s){if(!t)return!0;try{return new e()[n](UT(-1/0)),!1}catch(u){var i=new e;return i.add(1),i.add(2),t(i[n](UT(1/0)))}}}catch(s){return!1}}});var zT=X(()=>{"use strict";var vV=sr(),_V=DT(),xV=ia(),EV=!xV("difference",function(n){return n.size===0});vV({target:"Set",proto:!0,real:!0,forced:EV},{difference:_V})});var qT=X((Yit,kT)=>{"use strict";var SV=ea(),ay=Ao(),wV=Ku(),MV=ra(),bV=ju(),AV=na(),TV=ay.Set,GT=ay.add,CV=ay.has;kT.exports=function(t){var e=SV(this),i=MV(t),s=new TV;return wV(e)>i.size?AV(i.getIterator(),function(u){CV(e,u)&&GT(s,u)}):bV(e,function(u){i.includes(u)&&GT(s,u)}),s}});var VT=X(()=>{"use strict";var IV=sr(),PV=An(),RV=qT(),LV=ia(),NV=!LV("intersection",function(n){return n.size===2&&n.has(1)&&n.has(2)})||PV(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});IV({target:"Set",proto:!0,real:!0,forced:NV},{intersection:RV})});var uy=X((Jit,WT)=>{"use strict";var OV=vr(),HT=so(),DV=Tc();WT.exports=function(n,t,e){var i,s;HT(n);try{if(i=DV(n,"return"),!i){if(t==="throw")throw e;return e}i=OV(i,n)}catch(u){s=!0,i=u}if(t==="throw")throw e;if(s)throw i;return HT(i),e}});var YT=X((jit,XT)=>{"use strict";var FV=ea(),UV=Ao().has,BV=Ku(),zV=ra(),GV=ju(),kV=na(),qV=uy();XT.exports=function(t){var e=FV(this),i=zV(t);if(BV(e)<=i.size)return GV(e,function(u){if(i.includes(u))return!1},!0)!==!1;var s=i.getIterator();return kV(s,function(u){if(UV(e,u))return qV(s,"normal",!1)})!==!1}});var $T=X(()=>{"use strict";var VV=sr(),HV=YT(),WV=ia(),XV=!WV("isDisjointFrom",function(n){return!n});VV({target:"Set",proto:!0,real:!0,forced:XV},{isDisjointFrom:HV})});var JT=X((tot,ZT)=>{"use strict";var YV=ea(),$V=Ku(),ZV=ju(),JV=ra();ZT.exports=function(t){var e=YV(this),i=JV(t);return $V(e)>i.size?!1:ZV(e,function(s){if(!i.includes(s))return!1},!0)!==!1}});var jT=X(()=>{"use strict";var jV=sr(),KV=JT(),QV=ia(),tH=!QV("isSubsetOf",function(n){return n});jV({target:"Set",proto:!0,real:!0,forced:tH},{isSubsetOf:KV})});var QT=X((rot,KT)=>{"use strict";var eH=ea(),nH=Ao().has,rH=Ku(),iH=ra(),oH=na(),sH=uy();KT.exports=function(t){var e=eH(this),i=iH(t);if(rH(e)<i.size)return!1;var s=i.getIterator();return oH(s,function(u){if(!nH(e,u))return sH(s,"normal",!1)})!==!1}});var tC=X(()=>{"use strict";var aH=sr(),uH=QT(),lH=ia(),cH=!lH("isSupersetOf",function(n){return!n});aH({target:"Set",proto:!0,real:!0,forced:cH},{isSupersetOf:uH})});var nC=X((sot,eC)=>{"use strict";var fH=ea(),ly=Ao(),hH=ep(),pH=ra(),dH=na(),gH=ly.add,mH=ly.has,yH=ly.remove;eC.exports=function(t){var e=fH(this),i=pH(t).getIterator(),s=hH(e);return dH(i,function(u){mH(e,u)?yH(s,u):gH(s,u)}),s}});var rC=X(()=>{"use strict";var vH=sr(),_H=nC(),xH=ia();vH({target:"Set",proto:!0,real:!0,forced:!xH("symmetricDifference")},{symmetricDifference:_H})});var oC=X((lot,iC)=>{"use strict";var EH=ea(),SH=Ao().add,wH=ep(),MH=ra(),bH=na();iC.exports=function(t){var e=EH(this),i=MH(t).getIterator(),s=wH(e);return bH(i,function(u){SH(s,u)}),s}});var sC=X(()=>{"use strict";var AH=sr(),TH=oC(),CH=ia();AH({target:"Set",proto:!0,real:!0,forced:!CH("union")},{union:TH})});var cy=X((hot,uC)=>{"use strict";var aC=zu(),IH=TypeError;uC.exports=function(n,t){if(!delete n[t])throw new IH("Cannot delete property "+aC(t)+" of "+aC(n))}});var lC=X(()=>{"use strict";var PH=sr(),RH=Vi(),LH=ii(),NH=mm(),OH=cy(),DH=Eh(),FH=[].unshift(0)!==1,UH=function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(n){return n instanceof TypeError}},BH=FH||!UH();PH({target:"Array",proto:!0,arity:1,forced:BH},{unshift:function(t){var e=RH(this),i=LH(e),s=arguments.length;if(s){DH(i+s);for(var u=i;u--;){var c=u+s;u in e?e[c]=e[u]:OH(e,c)}for(var f=0;f<s;f++)e[f]=arguments[f]}return NH(e,i+s)}})});var Ll=X((Cot,pP)=>{"use strict";var xY=Zs(),EY=String;pP.exports=function(n){if(xY(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return EY(n)}});var gP=X((Iot,dP)=>{"use strict";var SY=so();dP.exports=function(){var n=SY(this),t="";return n.hasIndices&&(t+="d"),n.global&&(t+="g"),n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.dotAll&&(t+="s"),n.unicode&&(t+="u"),n.unicodeSets&&(t+="v"),n.sticky&&(t+="y"),t}});var yP=X((Pot,mP)=>{"use strict";var Kv=An(),wY=Sn(),Qv=wY.RegExp,t_=Kv(function(){var n=Qv("a","y");return n.lastIndex=2,n.exec("abcd")!==null}),MY=t_||Kv(function(){return!Qv("a","y").sticky}),bY=t_||Kv(function(){var n=Qv("^r","gy");return n.lastIndex=2,n.exec("str")!==null});mP.exports={BROKEN_CARET:bY,MISSED_STICKY:MY,UNSUPPORTED_Y:t_}});var _P=X((Rot,vP)=>{"use strict";var AY=An(),TY=Sn(),CY=TY.RegExp;vP.exports=AY(function(){var n=CY(".","s");return!(n.dotAll&&n.test(\`
12205
12205
  \`)&&n.flags==="s")})});var EP=X((Lot,xP)=>{"use strict";var IY=An(),PY=Sn(),RY=PY.RegExp;xP.exports=IY(function(){var n=RY("(?<a>b)","g");return n.exec("b").groups.a!=="b"||"b".replace(n,"$<a>c")!=="bc"})});var dd=X((Not,wP)=>{"use strict";var Nl=vr(),pd=In(),LY=Ll(),NY=gP(),OY=yP(),DY=oh(),FY=ku(),UY=Va().get,BY=_P(),zY=EP(),GY=DY("native-string-replace",String.prototype.replace),hd=RegExp.prototype.exec,n_=hd,kY=pd("".charAt),qY=pd("".indexOf),VY=pd("".replace),e_=pd("".slice),r_=function(){var n=/a/,t=/b*/g;return Nl(hd,n,"a"),Nl(hd,t,"a"),n.lastIndex!==0||t.lastIndex!==0}(),SP=OY.BROKEN_CARET,i_=/()??/.exec("")[1]!==void 0,HY=r_||i_||SP||BY||zY;HY&&(n_=function(t){var e=this,i=UY(e),s=LY(t),u=i.raw,c,f,p,d,g,y,v;if(u)return u.lastIndex=e.lastIndex,c=Nl(n_,u,s),e.lastIndex=u.lastIndex,c;var E=i.groups,M=SP&&e.sticky,A=Nl(NY,e),_=e.source,x=0,T=s;if(M&&(A=VY(A,"y",""),qY(A,"g")===-1&&(A+="g"),T=e_(s,e.lastIndex),e.lastIndex>0&&(!e.multiline||e.multiline&&kY(s,e.lastIndex-1)!==\`
12206
12206
  \`)&&(_="(?: "+_+")",T=" "+T,x++),f=new RegExp("^(?:"+_+")",A)),i_&&(f=new RegExp("^"+_+"$(?!\\\\s)",A)),r_&&(p=e.lastIndex),d=Nl(hd,M?f:e,T),M?d?(d.input=e_(d.input,x),d[0]=e_(d[0],x),d.index=e.lastIndex,e.lastIndex+=d[0].length):e.lastIndex=0:r_&&d&&(e.lastIndex=e.global?d.index+d[0].length:p),i_&&d&&d.length>1&&Nl(GY,d[0],f,function(){for(g=1;g<arguments.length-2;g++)arguments[g]===void 0&&(d[g]=void 0)}),d&&E)for(d.groups=y=FY(null),g=0;g<E.length;g++)v=E[g],y[v[0]]=d[v[1]];return d});wP.exports=n_});var o_=X(()=>{"use strict";var WY=sr(),MP=dd();WY({target:"RegExp",proto:!0,forced:/./.exec!==MP},{exec:MP})});var gd=X((qot,TP)=>{"use strict";var AP=Object.getOwnPropertySymbols,ZY=Object.prototype.hasOwnProperty,JY=Object.prototype.propertyIsEnumerable;function jY(n){if(n==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function KY(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[0]==="5")return!1;for(var t={},e=0;e<10;e++)t["_"+String.fromCharCode(e)]=e;var i=Object.getOwnPropertyNames(t).map(function(u){return t[u]});if(i.join("")!=="0123456789")return!1;var s={};return"abcdefghijklmnopqrst".split("").forEach(function(u){s[u]=u}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch(u){return!1}}TP.exports=KY()?Object.assign:function(n,t){for(var e,i=jY(n),s,u=1;u<arguments.length;u++){e=Object(arguments[u]);for(var c in e)ZY.call(e,c)&&(i[c]=e[c]);if(AP){s=AP(e);for(var f=0;f<s.length;f++)JY.call(e,s[f])&&(i[s[f]]=e[s[f]])}}return i}});var f_=X((l_,c_)=>{(function(n,t){typeof l_=="object"&&typeof c_!="undefined"?c_.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self).RBush=t()})(l_,function(){"use strict";function n(_,x,T,w,R){(function B(U,D,P,ct,L){for(;ct>P;){if(ct-P>600){var W=ct-P+1,V=D-P+1,Mt=Math.log(W),$=.5*Math.exp(2*Mt/3),gt=.5*Math.sqrt(Mt*$*(W-$)/W)*(V-W/2<0?-1:1),ft=Math.max(P,Math.floor(D-V*$/W+gt)),vt=Math.min(ct,Math.floor(D+(W-V)*$/W+gt));B(U,D,ft,vt,L)}var it=U[D],lt=P,H=ct;for(t(U,P,D),L(U[ct],it)>0&&t(U,P,ct);lt<H;){for(t(U,lt,H),lt++,H--;L(U[lt],it)<0;)lt++;for(;L(U[H],it)>0;)H--}L(U[P],it)===0?t(U,P,H):t(U,++H,ct),H<=D&&(P=H+1),D<=H&&(ct=H-1)}})(_,x,T||0,w||_.length-1,R||e)}function t(_,x,T){var w=_[x];_[x]=_[T],_[T]=w}function e(_,x){return _<x?-1:_>x?1:0}var i=function(_){_===void 0&&(_=9),this._maxEntries=Math.max(4,_),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function s(_,x,T){if(!T)return x.indexOf(_);for(var w=0;w<x.length;w++)if(T(_,x[w]))return w;return-1}function u(_,x){c(_,0,_.children.length,x,_)}function c(_,x,T,w,R){R||(R=M(null)),R.minX=1/0,R.minY=1/0,R.maxX=-1/0,R.maxY=-1/0;for(var B=x;B<T;B++){var U=_.children[B];f(R,_.leaf?w(U):U)}return R}function f(_,x){return _.minX=Math.min(_.minX,x.minX),_.minY=Math.min(_.minY,x.minY),_.maxX=Math.max(_.maxX,x.maxX),_.maxY=Math.max(_.maxY,x.maxY),_}function p(_,x){return _.minX-x.minX}function d(_,x){return _.minY-x.minY}function g(_){return(_.maxX-_.minX)*(_.maxY-_.minY)}function y(_){return _.maxX-_.minX+(_.maxY-_.minY)}function v(_,x){return _.minX<=x.minX&&_.minY<=x.minY&&x.maxX<=_.maxX&&x.maxY<=_.maxY}function E(_,x){return x.minX<=_.maxX&&x.minY<=_.maxY&&x.maxX>=_.minX&&x.maxY>=_.minY}function M(_){return{children:_,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function A(_,x,T,w,R){for(var B=[x,T];B.length;)if(!((T=B.pop())-(x=B.pop())<=w)){var U=x+Math.ceil((T-x)/w/2)*w;n(_,U,x,T,R),B.push(x,U,U,T)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(_){var x=this.data,T=[];if(!E(_,x))return T;for(var w=this.toBBox,R=[];x;){for(var B=0;B<x.children.length;B++){var U=x.children[B],D=x.leaf?w(U):U;E(_,D)&&(x.leaf?T.push(U):v(_,D)?this._all(U,T):R.push(U))}x=R.pop()}return T},i.prototype.collides=function(_){var x=this.data;if(!E(_,x))return!1;for(var T=[];x;){for(var w=0;w<x.children.length;w++){var R=x.children[w],B=x.leaf?this.toBBox(R):R;if(E(_,B)){if(x.leaf||v(_,B))return!0;T.push(R)}}x=T.pop()}return!1},i.prototype.load=function(_){if(!_||!_.length)return this;if(_.length<this._minEntries){for(var x=0;x<_.length;x++)this.insert(_[x]);return this}var T=this._build(_.slice(),0,_.length-1,0);if(this.data.children.length)if(this.data.height===T.height)this._splitRoot(this.data,T);else{if(this.data.height<T.height){var w=this.data;this.data=T,T=w}this._insert(T,this.data.height-T.height-1,!0)}else this.data=T;return this},i.prototype.insert=function(_){return _&&this._insert(_,this.data.height-1),this},i.prototype.clear=function(){return this.data=M([]),this},i.prototype.remove=function(_,x){if(!_)return this;for(var T,w,R,B=this.data,U=this.toBBox(_),D=[],P=[];B||D.length;){if(B||(B=D.pop(),w=D[D.length-1],T=P.pop(),R=!0),B.leaf){var ct=s(_,B.children,x);if(ct!==-1)return B.children.splice(ct,1),D.push(B),this._condense(D),this}R||B.leaf||!v(B,U)?w?(T++,B=w.children[T],R=!1):B=null:(D.push(B),P.push(T),T=0,w=B,B=B.children[0])}return this},i.prototype.toBBox=function(_){return _},i.prototype.compareMinX=function(_,x){return _.minX-x.minX},i.prototype.compareMinY=function(_,x){return _.minY-x.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(_){return this.data=_,this},i.prototype._all=function(_,x){for(var T=[];_;)_.leaf?x.push.apply(x,_.children):T.push.apply(T,_.children),_=T.pop();return x},i.prototype._build=function(_,x,T,w){var R,B=T-x+1,U=this._maxEntries;if(B<=U)return u(R=M(_.slice(x,T+1)),this.toBBox),R;w||(w=Math.ceil(Math.log(B)/Math.log(U)),U=Math.ceil(B/Math.pow(U,w-1))),(R=M([])).leaf=!1,R.height=w;var D=Math.ceil(B/U),P=D*Math.ceil(Math.sqrt(U));A(_,x,T,P,this.compareMinX);for(var ct=x;ct<=T;ct+=P){var L=Math.min(ct+P-1,T);A(_,ct,L,D,this.compareMinY);for(var W=ct;W<=L;W+=D){var V=Math.min(W+D-1,L);R.children.push(this._build(_,W,V,w-1))}}return u(R,this.toBBox),R},i.prototype._chooseSubtree=function(_,x,T,w){for(;w.push(x),!x.leaf&&w.length-1!==T;){for(var R=1/0,B=1/0,U=void 0,D=0;D<x.children.length;D++){var P=x.children[D],ct=g(P),L=(W=_,V=P,(Math.max(V.maxX,W.maxX)-Math.min(V.minX,W.minX))*(Math.max(V.maxY,W.maxY)-Math.min(V.minY,W.minY))-ct);L<B?(B=L,R=ct<R?ct:R,U=P):L===B&&ct<R&&(R=ct,U=P)}x=U||x.children[0]}var W,V;return x},i.prototype._insert=function(_,x,T){var w=T?_:this.toBBox(_),R=[],B=this._chooseSubtree(w,this.data,x,R);for(B.children.push(_),f(B,w);x>=0&&R[x].children.length>this._maxEntries;)this._split(R,x),x--;this._adjustParentBBoxes(w,R,x)},i.prototype._split=function(_,x){var T=_[x],w=T.children.length,R=this._minEntries;this._chooseSplitAxis(T,R,w);var B=this._chooseSplitIndex(T,R,w),U=M(T.children.splice(B,T.children.length-B));U.height=T.height,U.leaf=T.leaf,u(T,this.toBBox),u(U,this.toBBox),x?_[x-1].children.push(U):this._splitRoot(T,U)},i.prototype._splitRoot=function(_,x){this.data=M([_,x]),this.data.height=_.height+1,this.data.leaf=!1,u(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(_,x,T){for(var w,R,B,U,D,P,ct,L=1/0,W=1/0,V=x;V<=T-x;V++){var Mt=c(_,0,V,this.toBBox),$=c(_,V,T,this.toBBox),gt=(R=Mt,B=$,U=void 0,D=void 0,P=void 0,ct=void 0,U=Math.max(R.minX,B.minX),D=Math.max(R.minY,B.minY),P=Math.min(R.maxX,B.maxX),ct=Math.min(R.maxY,B.maxY),Math.max(0,P-U)*Math.max(0,ct-D)),ft=g(Mt)+g($);gt<L?(L=gt,w=V,W=ft<W?ft:W):gt===L&&ft<W&&(W=ft,w=V)}return w||T-x},i.prototype._chooseSplitAxis=function(_,x,T){var w=_.leaf?this.compareMinX:p,R=_.leaf?this.compareMinY:d;this._allDistMargin(_,x,T,w)<this._allDistMargin(_,x,T,R)&&_.children.sort(w)},i.prototype._allDistMargin=function(_,x,T,w){_.children.sort(w);for(var R=this.toBBox,B=c(_,0,x,R),U=c(_,T-x,T,R),D=y(B)+y(U),P=x;P<T-x;P++){var ct=_.children[P];f(B,_.leaf?R(ct):ct),D+=y(B)}for(var L=T-x-1;L>=x;L--){var W=_.children[L];f(U,_.leaf?R(W):W),D+=y(U)}return D},i.prototype._adjustParentBBoxes=function(_,x,T){for(var w=T;w>=0;w--)f(x[w],_)},i.prototype._condense=function(_){for(var x=_.length-1,T=void 0;x>=0;x--)_[x].children.length===0?x>0?(T=_[x-1].children).splice(T.indexOf(_[x]),1):this.clear():u(_[x],this.toBBox)},i})});var CP=X((h_,p_)=>{(function(n,t){typeof h_=="object"&&typeof p_!="undefined"?p_.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self,n.TinyQueue=t())})(h_,function(){"use strict";var n=function(i,s){if(i===void 0&&(i=[]),s===void 0&&(s=t),this.data=i,this.length=this.data.length,this.compare=s,this.length>0)for(var u=(this.length>>1)-1;u>=0;u--)this._down(u)};n.prototype.push=function(i){this.data.push(i),this.length++,this._up(this.length-1)},n.prototype.pop=function(){if(this.length!==0){var i=this.data[0],s=this.data.pop();return this.length--,this.length>0&&(this.data[0]=s,this._down(0)),i}},n.prototype.peek=function(){return this.data[0]},n.prototype._up=function(i){for(var s=this,u=s.data,c=s.compare,f=u[i];i>0;){var p=i-1>>1,d=u[p];if(c(f,d)>=0)break;u[i]=d,i=p}u[i]=f},n.prototype._down=function(i){for(var s=this,u=s.data,c=s.compare,f=this.length>>1,p=u[i];i<f;){var d=(i<<1)+1,g=u[d],y=d+1;if(y<this.length&&c(u[y],g)<0&&(d=y,g=u[y]),c(g,p)>=0)break;u[i]=g,i=d}u[i]=p};function t(e,i){return e<i?-1:e>i?1:0}return n})});var PP=X(($ot,IP)=>{IP.exports=function(t,e,i,s){var u=t[0],c=t[1],f=!1;i===void 0&&(i=0),s===void 0&&(s=e.length);for(var p=(s-i)/2,d=0,g=p-1;d<p;g=d++){var y=e[i+d*2+0],v=e[i+d*2+1],E=e[i+g*2+0],M=e[i+g*2+1],A=v>c!=M>c&&u<(E-y)*(c-v)/(M-v)+y;A&&(f=!f)}return f}});var LP=X((Zot,RP)=>{RP.exports=function(t,e,i,s){var u=t[0],c=t[1],f=!1;i===void 0&&(i=0),s===void 0&&(s=e.length);for(var p=s-i,d=0,g=p-1;d<p;g=d++){var y=e[d+i][0],v=e[d+i][1],E=e[g+i][0],M=e[g+i][1],A=v>c!=M>c&&u<(E-y)*(c-v)/(M-v)+y;A&&(f=!f)}return f}});var DP=X((Jot,vd)=>{var NP=PP(),OP=LP();vd.exports=function(t,e,i,s){return e.length>0&&Array.isArray(e[0])?OP(t,e,i,s):NP(t,e,i,s)};vd.exports.nested=OP;vd.exports.flat=NP});var UP=X((_d,FP)=>{(function(n,t){typeof _d=="object"&&typeof FP!="undefined"?t(_d):typeof define=="function"&&define.amd?define(["exports"],t):t((n=n||self).predicates={})})(_d,function(n){"use strict";let e=33306690738754706e-32;function i(E,M,A,_,x){let T,w,R,B,U=M[0],D=_[0],P=0,ct=0;D>U==D>-U?(T=U,U=M[++P]):(T=D,D=_[++ct]);let L=0;if(P<E&&ct<A)for(D>U==D>-U?(R=T-((w=U+T)-U),U=M[++P]):(R=T-((w=D+T)-D),D=_[++ct]),T=w,R!==0&&(x[L++]=R);P<E&&ct<A;)D>U==D>-U?(R=T-((w=T+U)-(B=w-T))+(U-B),U=M[++P]):(R=T-((w=T+D)-(B=w-T))+(D-B),D=_[++ct]),T=w,R!==0&&(x[L++]=R);for(;P<E;)R=T-((w=T+U)-(B=w-T))+(U-B),U=M[++P],T=w,R!==0&&(x[L++]=R);for(;ct<A;)R=T-((w=T+D)-(B=w-T))+(D-B),D=_[++ct],T=w,R!==0&&(x[L++]=R);return T===0&&L!==0||(x[L++]=T),L}function s(E){return new Float64Array(E)}let u=33306690738754716e-32,c=22204460492503146e-32,f=11093356479670487e-47,p=s(4),d=s(8),g=s(12),y=s(16),v=s(4);n.orient2d=function(E,M,A,_,x,T){let w=(M-T)*(A-x),R=(E-x)*(_-T),B=w-R;if(w===0||R===0||w>0!=R>0)return B;let U=Math.abs(w+R);return Math.abs(B)>=u*U?B:-function(D,P,ct,L,W,V,Mt){let $,gt,ft,vt,it,lt,H,At,It,jt,nt,bt,Vt,$t,Ut,Gt,Ct,ee,Z=D-W,Ot=ct-W,_t=P-V,Nt=L-V;it=(Ut=(At=Z-(H=(lt=134217729*Z)-(lt-Z)))*(jt=Nt-(It=(lt=134217729*Nt)-(lt-Nt)))-(($t=Z*Nt)-H*It-At*It-H*jt))-(nt=Ut-(Ct=(At=_t-(H=(lt=134217729*_t)-(lt-_t)))*(jt=Ot-(It=(lt=134217729*Ot)-(lt-Ot)))-((Gt=_t*Ot)-H*It-At*It-H*jt))),p[0]=Ut-(nt+it)+(it-Ct),it=(Vt=$t-((bt=$t+nt)-(it=bt-$t))+(nt-it))-(nt=Vt-Gt),p[1]=Vt-(nt+it)+(it-Gt),it=(ee=bt+nt)-bt,p[2]=bt-(ee-it)+(nt-it),p[3]=ee;let wt=function(Y,N){let xt=N[0];for(let St=1;St<Y;St++)xt+=N[St];return xt}(4,p),Ht=c*Mt;if(wt>=Ht||-wt>=Ht||($=D-(Z+(it=D-Z))+(it-W),ft=ct-(Ot+(it=ct-Ot))+(it-W),gt=P-(_t+(it=P-_t))+(it-V),vt=L-(Nt+(it=L-Nt))+(it-V),$===0&&gt===0&&ft===0&&vt===0)||(Ht=f*Mt+e*Math.abs(wt),(wt+=Z*vt+Nt*$-(_t*ft+Ot*gt))>=Ht||-wt>=Ht))return wt;it=(Ut=(At=$-(H=(lt=134217729*$)-(lt-$)))*(jt=Nt-(It=(lt=134217729*Nt)-(lt-Nt)))-(($t=$*Nt)-H*It-At*It-H*jt))-(nt=Ut-(Ct=(At=gt-(H=(lt=134217729*gt)-(lt-gt)))*(jt=Ot-(It=(lt=134217729*Ot)-(lt-Ot)))-((Gt=gt*Ot)-H*It-At*It-H*jt))),v[0]=Ut-(nt+it)+(it-Ct),it=(Vt=$t-((bt=$t+nt)-(it=bt-$t))+(nt-it))-(nt=Vt-Gt),v[1]=Vt-(nt+it)+(it-Gt),it=(ee=bt+nt)-bt,v[2]=bt-(ee-it)+(nt-it),v[3]=ee;let Xt=i(4,p,4,v,d);it=(Ut=(At=Z-(H=(lt=134217729*Z)-(lt-Z)))*(jt=vt-(It=(lt=134217729*vt)-(lt-vt)))-(($t=Z*vt)-H*It-At*It-H*jt))-(nt=Ut-(Ct=(At=_t-(H=(lt=134217729*_t)-(lt-_t)))*(jt=ft-(It=(lt=134217729*ft)-(lt-ft)))-((Gt=_t*ft)-H*It-At*It-H*jt))),v[0]=Ut-(nt+it)+(it-Ct),it=(Vt=$t-((bt=$t+nt)-(it=bt-$t))+(nt-it))-(nt=Vt-Gt),v[1]=Vt-(nt+it)+(it-Gt),it=(ee=bt+nt)-bt,v[2]=bt-(ee-it)+(nt-it),v[3]=ee;let Pt=i(Xt,d,4,v,g);it=(Ut=(At=$-(H=(lt=134217729*$)-(lt-$)))*(jt=vt-(It=(lt=134217729*vt)-(lt-vt)))-(($t=$*vt)-H*It-At*It-H*jt))-(nt=Ut-(Ct=(At=gt-(H=(lt=134217729*gt)-(lt-gt)))*(jt=ft-(It=(lt=134217729*ft)-(lt-ft)))-((Gt=gt*ft)-H*It-At*It-H*jt))),v[0]=Ut-(nt+it)+(it-Ct),it=(Vt=$t-((bt=$t+nt)-(it=bt-$t))+(nt-it))-(nt=Vt-Gt),v[1]=Vt-(nt+it)+(it-Gt),it=(ee=bt+nt)-bt,v[2]=bt-(ee-it)+(nt-it),v[3]=ee;let ne=i(Pt,g,4,v,y);return y[ne-1]}(E,M,A,_,x,T,U)},n.orient2dfast=function(E,M,A,_,x,T){return(M-T)*(A-x)-(E-x)*(_-T)},Object.defineProperty(n,"__esModule",{value:!0})})});var VP=X((jot,y_)=>{"use strict";var BP=f_(),Ed=CP(),t$=DP(),e$=UP().orient2d;Ed.default&&(Ed=Ed.default);y_.exports=qP;y_.exports.default=qP;function qP(n,t,e){t=Math.max(0,t===void 0?2:t),e=e||0;var i=s$(n),s=new BP(16);s.toBBox=function(T){return{minX:T[0],minY:T[1],maxX:T[0],maxY:T[1]}},s.compareMinX=function(T,w){return T[0]-w[0]},s.compareMinY=function(T,w){return T[1]-w[1]},s.load(n);for(var u=[],c=0,f;c<i.length;c++){var p=i[c];s.remove(p),f=kP(p,f),u.push(f)}var d=new BP(16);for(c=0;c<u.length;c++)d.insert(d_(u[c]));for(var g=t*t,y=e*e;u.length;){var v=u.shift(),E=v.p,M=v.next.p,A=g_(E,M);if(!(A<y)){var _=A/g;p=n$(s,v.prev.p,E,M,v.next.next.p,_,d),p&&Math.min(g_(p,E),g_(p,M))<=_&&(u.push(v),u.push(kP(p,v)),s.remove(p),d.remove(v),d.insert(d_(v)),d.insert(d_(v.next)))}}v=f;var x=[];do x.push(v.p),v=v.next;while(v!==f);return x.push(v.p),x}function n$(n,t,e,i,s,u,c){for(var f=new Ed([],r$),p=n.data;p;){for(var d=0;d<p.children.length;d++){var g=p.children[d],y=p.leaf?m_(g,e,i):i$(e,i,g);y>u||f.push({node:g,dist:y})}for(;f.length&&!f.peek().node.children;){var v=f.pop(),E=v.node,M=m_(E,t,e),A=m_(E,i,s);if(v.dist<M&&v.dist<A&&GP(e,E,c)&&GP(i,E,c))return E}p=f.pop(),p&&(p=p.node)}return null}function r$(n,t){return n.dist-t.dist}function i$(n,t,e){if(zP(n,e)||zP(t,e))return 0;var i=xd(n[0],n[1],t[0],t[1],e.minX,e.minY,e.maxX,e.minY);if(i===0)return 0;var s=xd(n[0],n[1],t[0],t[1],e.minX,e.minY,e.minX,e.maxY);if(s===0)return 0;var u=xd(n[0],n[1],t[0],t[1],e.maxX,e.minY,e.maxX,e.maxY);if(u===0)return 0;var c=xd(n[0],n[1],t[0],t[1],e.minX,e.maxY,e.maxX,e.maxY);return c===0?0:Math.min(i,s,u,c)}function zP(n,t){return n[0]>=t.minX&&n[0]<=t.maxX&&n[1]>=t.minY&&n[1]<=t.maxY}function GP(n,t,e){for(var i=Math.min(n[0],t[0]),s=Math.min(n[1],t[1]),u=Math.max(n[0],t[0]),c=Math.max(n[1],t[1]),f=e.search({minX:i,minY:s,maxX:u,maxY:c}),p=0;p<f.length;p++)if(o$(f[p].p,f[p].next.p,n,t))return!1;return!0}function Ol(n,t,e){return e$(n[0],n[1],t[0],t[1],e[0],e[1])}function o$(n,t,e,i){return n!==i&&t!==e&&Ol(n,t,e)>0!=Ol(n,t,i)>0&&Ol(e,i,n)>0!=Ol(e,i,t)>0}function d_(n){var t=n.p,e=n.next.p;return n.minX=Math.min(t[0],e[0]),n.minY=Math.min(t[1],e[1]),n.maxX=Math.max(t[0],e[0]),n.maxY=Math.max(t[1],e[1]),n}function s$(n){for(var t=n[0],e=n[0],i=n[0],s=n[0],u=0;u<n.length;u++){var c=n[u];c[0]<t[0]&&(t=c),c[0]>i[0]&&(i=c),c[1]<e[1]&&(e=c),c[1]>s[1]&&(s=c)}var f=[t,e,i,s],p=f.slice();for(u=0;u<n.length;u++)t$(n[u],f)||p.push(n[u]);return u$(p)}function kP(n,t){var e={p:n,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return t?(e.next=t.next,e.prev=t,t.next.prev=e,t.next=e):(e.prev=e,e.next=e),e}function g_(n,t){var e=n[0]-t[0],i=n[1]-t[1];return e*e+i*i}function m_(n,t,e){var i=t[0],s=t[1],u=e[0]-i,c=e[1]-s;if(u!==0||c!==0){var f=((n[0]-i)*u+(n[1]-s)*c)/(u*u+c*c);f>1?(i=e[0],s=e[1]):f>0&&(i+=u*f,s+=c*f)}return u=n[0]-i,c=n[1]-s,u*u+c*c}function xd(n,t,e,i,s,u,c,f){var p=e-n,d=i-t,g=c-s,y=f-u,v=n-s,E=t-u,M=p*p+d*d,A=p*g+d*y,_=g*g+y*y,x=p*v+d*E,T=g*v+y*E,w=M*_-A*A,R,B,U,D,P=w,ct=w;w===0?(B=0,P=1,D=T,ct=_):(B=A*T-_*x,D=M*T-A*x,B<0?(B=0,D=T,ct=_):B>P&&(B=P,D=T+A,ct=_)),D<0?(D=0,-x<0?B=0:-x>M?B=P:(B=-x,P=M)):D>ct&&(D=ct,-x+A<0?B=0:-x+A>M?B=P:(B=-x+A,P=M)),R=B===0?0:B/P,U=D===0?0:D/ct;var L=(1-R)*n+R*e,W=(1-R)*t+R*i,V=(1-U)*s+U*c,Mt=(1-U)*u+U*f,$=V-L,gt=Mt-W;return $*$+gt*gt}function a$(n,t){return n[0]===t[0]?n[1]-t[1]:n[0]-t[0]}function u$(n){n.sort(a$);for(var t=[],e=0;e<n.length;e++){for(;t.length>=2&&Ol(t[t.length-2],t[t.length-1],n[e])<=0;)t.pop();t.push(n[e])}for(var i=[],s=n.length-1;s>=0;s--){for(;i.length>=2&&Ol(i[i.length-2],i[i.length-1],n[s])<=0;)i.pop();i.push(n[s])}return i.pop(),t.pop(),t.concat(i)}});var ZP=X((__,x_)=>{(function(n,t){typeof __=="object"&&typeof x_!="undefined"?x_.exports=t():typeof define=="function"&&define.amd?define(t):n.quickselect=t()})(__,function(){"use strict";function n(s,u,c,f,p){t(s,u,c||0,f||s.length-1,p||i)}function t(s,u,c,f,p){for(;f>c;){if(f-c>600){var d=f-c+1,g=u-c+1,y=Math.log(d),v=.5*Math.exp(2*y/3),E=.5*Math.sqrt(y*v*(d-v)/d)*(g-d/2<0?-1:1),M=Math.max(c,Math.floor(u-g*v/d+E)),A=Math.min(f,Math.floor(u+(d-g)*v/d+E));t(s,u,M,A,p)}var _=s[u],x=c,T=f;for(e(s,c,u),p(s[f],_)>0&&e(s,c,f);x<T;){for(e(s,x,T),x++,T--;p(s[x],_)<0;)x++;for(;p(s[T],_)>0;)T--}p(s[c],_)===0?e(s,c,T):(T++,e(s,T,f)),T<=u&&(c=T+1),u<=T&&(f=T-1)}}function e(s,u,c){var f=s[u];s[u]=s[c],s[c]=f}function i(s,u){return s<u?-1:s>u?1:0}return n})});var M_=X((wut,w_)=>{"use strict";w_.exports=vf;w_.exports.default=vf;var E$=ZP();function vf(n,t){if(!(this instanceof vf))return new vf(n,t);this._maxEntries=Math.max(4,n||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),t&&this._initFormat(t),this.clear()}vf.prototype={all:function(){return this._all(this.data,[])},search:function(n){var t=this.data,e=[],i=this.toBBox;if(!wd(n,t))return e;for(var s=[],u,c,f,p;t;){for(u=0,c=t.children.length;u<c;u++)f=t.children[u],p=t.leaf?i(f):f,wd(n,p)&&(t.leaf?e.push(f):S_(n,p)?this._all(f,e):s.push(f));t=s.pop()}return e},collides:function(n){var t=this.data,e=this.toBBox;if(!wd(n,t))return!1;for(var i=[],s,u,c,f;t;){for(s=0,u=t.children.length;s<u;s++)if(c=t.children[s],f=t.leaf?e(c):c,wd(n,f)){if(t.leaf||S_(n,f))return!0;i.push(c)}t=i.pop()}return!1},load:function(n){if(!(n&&n.length))return this;if(n.length<this._minEntries){for(var t=0,e=n.length;t<e;t++)this.insert(n[t]);return this}var i=this._build(n.slice(),0,n.length-1,0);if(!this.data.children.length)this.data=i;else if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var s=this.data;this.data=i,i=s}this._insert(i,this.data.height-i.height-1,!0)}return this},insert:function(n){return n&&this._insert(n,this.data.height-1),this},clear:function(){return this.data=Ul([]),this},remove:function(n,t){if(!n)return this;for(var e=this.data,i=this.toBBox(n),s=[],u=[],c,f,p,d;e||s.length;){if(e||(e=s.pop(),f=s[s.length-1],c=u.pop(),d=!0),e.leaf&&(p=S$(n,e.children,t),p!==-1))return e.children.splice(p,1),s.push(e),this._condense(s),this;!d&&!e.leaf&&S_(e,i)?(s.push(e),u.push(c),c=0,f=e,e=e.children[0]):f?(c++,e=f.children[c],d=!1):e=null}return this},toBBox:function(n){return n},compareMinX:JP,compareMinY:jP,toJSON:function(){return this.data},fromJSON:function(n){return this.data=n,this},_all:function(n,t){for(var e=[];n;)n.leaf?t.push.apply(t,n.children):e.push.apply(e,n.children),n=e.pop();return t},_build:function(n,t,e,i){var s=e-t+1,u=this._maxEntries,c;if(s<=u)return c=Ul(n.slice(t,e+1)),Fl(c,this.toBBox),c;i||(i=Math.ceil(Math.log(s)/Math.log(u)),u=Math.ceil(s/Math.pow(u,i-1))),c=Ul([]),c.leaf=!1,c.height=i;var f=Math.ceil(s/u),p=f*Math.ceil(Math.sqrt(u)),d,g,y,v;for(KP(n,t,e,p,this.compareMinX),d=t;d<=e;d+=p)for(y=Math.min(d+p-1,e),KP(n,d,y,f,this.compareMinY),g=d;g<=y;g+=f)v=Math.min(g+f-1,y),c.children.push(this._build(n,g,v,i-1));return Fl(c,this.toBBox),c},_chooseSubtree:function(n,t,e,i){for(var s,u,c,f,p,d,g,y;i.push(t),!(t.leaf||i.length-1===e);){for(g=y=1/0,s=0,u=t.children.length;s<u;s++)c=t.children[s],p=E_(c),d=w$(n,c)-p,d<y?(y=d,g=p<g?p:g,f=c):d===y&&p<g&&(g=p,f=c);t=f||t.children[0]}return t},_insert:function(n,t,e){var i=this.toBBox,s=e?n:i(n),u=[],c=this._chooseSubtree(s,this.data,t,u);for(c.children.push(n),yf(c,s);t>=0&&u[t].children.length>this._maxEntries;)this._split(u,t),t--;this._adjustParentBBoxes(s,u,t)},_split:function(n,t){var e=n[t],i=e.children.length,s=this._minEntries;this._chooseSplitAxis(e,s,i);var u=this._chooseSplitIndex(e,s,i),c=Ul(e.children.splice(u,e.children.length-u));c.height=e.height,c.leaf=e.leaf,Fl(e,this.toBBox),Fl(c,this.toBBox),t?n[t-1].children.push(c):this._splitRoot(e,c)},_splitRoot:function(n,t){this.data=Ul([n,t]),this.data.height=n.height+1,this.data.leaf=!1,Fl(this.data,this.toBBox)},_chooseSplitIndex:function(n,t,e){var i,s,u,c,f,p,d,g;for(p=d=1/0,i=t;i<=e-t;i++)s=mf(n,0,i,this.toBBox),u=mf(n,i,e,this.toBBox),c=M$(s,u),f=E_(s)+E_(u),c<p?(p=c,g=i,d=f<d?f:d):c===p&&f<d&&(d=f,g=i);return g},_chooseSplitAxis:function(n,t,e){var i=n.leaf?this.compareMinX:JP,s=n.leaf?this.compareMinY:jP,u=this._allDistMargin(n,t,e,i),c=this._allDistMargin(n,t,e,s);u<c&&n.children.sort(i)},_allDistMargin:function(n,t,e,i){n.children.sort(i);var s=this.toBBox,u=mf(n,0,t,s),c=mf(n,e-t,e,s),f=Sd(u)+Sd(c),p,d;for(p=t;p<e-t;p++)d=n.children[p],yf(u,n.leaf?s(d):d),f+=Sd(u);for(p=e-t-1;p>=t;p--)d=n.children[p],yf(c,n.leaf?s(d):d),f+=Sd(c);return f},_adjustParentBBoxes:function(n,t,e){for(var i=e;i>=0;i--)yf(t[i],n)},_condense:function(n){for(var t=n.length-1,e;t>=0;t--)n[t].children.length===0?t>0?(e=n[t-1].children,e.splice(e.indexOf(n[t]),1)):this.clear():Fl(n[t],this.toBBox)},_initFormat:function(n){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(n[0])),this.compareMinY=new Function("a","b",t.join(n[1])),this.toBBox=new Function("a","return {minX: a"+n[0]+", minY: a"+n[1]+", maxX: a"+n[2]+", maxY: a"+n[3]+"};")}};function S$(n,t,e){if(!e)return t.indexOf(n);for(var i=0;i<t.length;i++)if(e(n,t[i]))return i;return-1}function Fl(n,t){mf(n,0,n.children.length,t,n)}function mf(n,t,e,i,s){s||(s=Ul(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(var u=t,c;u<e;u++)c=n.children[u],yf(s,n.leaf?i(c):c);return s}function yf(n,t){return n.minX=Math.min(n.minX,t.minX),n.minY=Math.min(n.minY,t.minY),n.maxX=Math.max(n.maxX,t.maxX),n.maxY=Math.max(n.maxY,t.maxY),n}function JP(n,t){return n.minX-t.minX}function jP(n,t){return n.minY-t.minY}function E_(n){return(n.maxX-n.minX)*(n.maxY-n.minY)}function Sd(n){return n.maxX-n.minX+(n.maxY-n.minY)}function w$(n,t){return(Math.max(t.maxX,n.maxX)-Math.min(t.minX,n.minX))*(Math.max(t.maxY,n.maxY)-Math.min(t.minY,n.minY))}function M$(n,t){var e=Math.max(n.minX,t.minX),i=Math.max(n.minY,t.minY),s=Math.min(n.maxX,t.maxX),u=Math.min(n.maxY,t.maxY);return Math.max(0,s-e)*Math.max(0,u-i)}function S_(n,t){return n.minX<=t.minX&&n.minY<=t.minY&&t.maxX<=n.maxX&&t.maxY<=n.maxY}function wd(n,t){return t.minX<=n.maxX&&t.minY<=n.maxY&&t.maxX>=n.minX&&t.maxY>=n.minY}function Ul(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function KP(n,t,e,i,s){for(var u=[t,e],c;u.length;)e=u.pop(),t=u.pop(),!(e-t<=i)&&(c=t+Math.ceil((e-t)/i/2)*i,E$(n,c,t,e,s),u.push(t,c,c,e))}});var iR=X((Flt,P_)=>{"use strict";P_.exports=Td;P_.exports.default=Td;function Td(n,t,e){e=e||2;var i=t&&t.length,s=i?t[0]*e:n.length,u=eR(n,0,s,e,!0),c=[];if(!u||u.next===u.prev)return c;var f,p,d,g,y,v,E;if(i&&(u=O$(n,t,u,e)),n.length>80*e){f=d=n[0],p=g=n[1];for(var M=e;M<s;M+=e)y=n[M],v=n[M+1],y<f&&(f=y),v<p&&(p=v),y>d&&(d=y),v>g&&(g=v);E=Math.max(d-f,g-p),E=E!==0?32767/E:0}return Ef(u,c,e,f,p,E,0),c}function eR(n,t,e,i,s){var u,c;if(s===I_(n,t,e,i)>0)for(u=t;u<e;u+=i)c=tR(u,n[u],n[u+1],c);else for(u=e-i;u>=t;u-=i)c=tR(u,n[u],n[u+1],c);return c&&Cd(c,c.next)&&(wf(c),c=c.next),c}function du(n,t){if(!n)return n;t||(t=n);var e=n,i;do if(i=!1,!e.steiner&&(Cd(e,e.next)||tr(e.prev,e,e.next)===0)){if(wf(e),e=t=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==t);return t}function Ef(n,t,e,i,s,u,c){if(n){!c&&u&&z$(n,i,s,u);for(var f=n,p,d;n.prev!==n.next;){if(p=n.prev,d=n.next,u?R$(n,i,s,u):P$(n)){t.push(p.i/e|0),t.push(n.i/e|0),t.push(d.i/e|0),wf(n),n=d.next,f=d.next;continue}if(n=d,n===f){c?c===1?(n=L$(du(n),t,e),Ef(n,t,e,i,s,u,2)):c===2&&N$(n,t,e,i,s,u):Ef(du(n),t,e,i,s,u,1);break}}}}function P$(n){var t=n.prev,e=n,i=n.next;if(tr(t,e,i)>=0)return!1;for(var s=t.x,u=e.x,c=i.x,f=t.y,p=e.y,d=i.y,g=s<u?s<c?s:c:u<c?u:c,y=f<p?f<d?f:d:p<d?p:d,v=s>u?s>c?s:c:u>c?u:c,E=f>p?f>d?f:d:p>d?p:d,M=i.next;M!==t;){if(M.x>=g&&M.x<=v&&M.y>=y&&M.y<=E&&Gl(s,f,u,p,c,d,M.x,M.y)&&tr(M.prev,M,M.next)>=0)return!1;M=M.next}return!0}function R$(n,t,e,i){var s=n.prev,u=n,c=n.next;if(tr(s,u,c)>=0)return!1;for(var f=s.x,p=u.x,d=c.x,g=s.y,y=u.y,v=c.y,E=f<p?f<d?f:d:p<d?p:d,M=g<y?g<v?g:v:y<v?y:v,A=f>p?f>d?f:d:p>d?p:d,_=g>y?g>v?g:v:y>v?y:v,x=T_(E,M,t,e,i),T=T_(A,_,t,e,i),w=n.prevZ,R=n.nextZ;w&&w.z>=x&&R&&R.z<=T;){if(w.x>=E&&w.x<=A&&w.y>=M&&w.y<=_&&w!==s&&w!==c&&Gl(f,g,p,y,d,v,w.x,w.y)&&tr(w.prev,w,w.next)>=0||(w=w.prevZ,R.x>=E&&R.x<=A&&R.y>=M&&R.y<=_&&R!==s&&R!==c&&Gl(f,g,p,y,d,v,R.x,R.y)&&tr(R.prev,R,R.next)>=0))return!1;R=R.nextZ}for(;w&&w.z>=x;){if(w.x>=E&&w.x<=A&&w.y>=M&&w.y<=_&&w!==s&&w!==c&&Gl(f,g,p,y,d,v,w.x,w.y)&&tr(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;R&&R.z<=T;){if(R.x>=E&&R.x<=A&&R.y>=M&&R.y<=_&&R!==s&&R!==c&&Gl(f,g,p,y,d,v,R.x,R.y)&&tr(R.prev,R,R.next)>=0)return!1;R=R.nextZ}return!0}function L$(n,t,e){var i=n;do{var s=i.prev,u=i.next.next;!Cd(s,u)&&nR(s,i,i.next,u)&&Sf(s,u)&&Sf(u,s)&&(t.push(s.i/e|0),t.push(i.i/e|0),t.push(u.i/e|0),wf(i),wf(i.next),i=n=u),i=i.next}while(i!==n);return du(i)}function N$(n,t,e,i,s,u){var c=n;do{for(var f=c.next.next;f!==c.prev;){if(c.i!==f.i&&q$(c,f)){var p=rR(c,f);c=du(c,c.next),p=du(p,p.next),Ef(c,t,e,i,s,u,0),Ef(p,t,e,i,s,u,0);return}f=f.next}c=c.next}while(c!==n)}function O$(n,t,e,i){var s=[],u,c,f,p,d;for(u=0,c=t.length;u<c;u++)f=t[u]*i,p=u<c-1?t[u+1]*i:n.length,d=eR(n,f,p,i,!1),d===d.next&&(d.steiner=!0),s.push(k$(d));for(s.sort(D$),u=0;u<s.length;u++)e=F$(s[u],e);return e}function D$(n,t){return n.x-t.x}function F$(n,t){var e=U$(n,t);if(!e)return t;var i=rR(e,n);return du(i,i.next),du(e,e.next)}function U$(n,t){var e=t,i=n.x,s=n.y,u=-1/0,c;do{if(s<=e.y&&s>=e.next.y&&e.next.y!==e.y){var f=e.x+(s-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(f<=i&&f>u&&(u=f,c=e.x<e.next.x?e:e.next,f===i))return c}e=e.next}while(e!==t);if(!c)return null;var p=c,d=c.x,g=c.y,y=1/0,v;e=c;do i>=e.x&&e.x>=d&&i!==e.x&&Gl(s<g?i:u,s,d,g,s<g?u:i,s,e.x,e.y)&&(v=Math.abs(s-e.y)/(i-e.x),Sf(e,n)&&(v<y||v===y&&(e.x>c.x||e.x===c.x&&B$(c,e)))&&(c=e,y=v)),e=e.next;while(e!==p);return c}function B$(n,t){return tr(n.prev,n,t.prev)<0&&tr(t.next,n,n.next)<0}function z$(n,t,e,i){var s=n;do s.z===0&&(s.z=T_(s.x,s.y,t,e,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==n);s.prevZ.nextZ=null,s.prevZ=null,G$(s)}function G$(n){var t,e,i,s,u,c,f,p,d=1;do{for(e=n,n=null,u=null,c=0;e;){for(c++,i=e,f=0,t=0;t<d&&(f++,i=i.nextZ,!!i);t++);for(p=d;f>0||p>0&&i;)f!==0&&(p===0||!i||e.z<=i.z)?(s=e,e=e.nextZ,f--):(s=i,i=i.nextZ,p--),u?u.nextZ=s:n=s,s.prevZ=u,u=s;e=i}u.nextZ=null,d*=2}while(c>1);return n}function T_(n,t,e,i,s){return n=(n-e)*s|0,t=(t-i)*s|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n|t<<1}function k$(n){var t=n,e=n;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==n);return e}function Gl(n,t,e,i,s,u,c,f){return(s-c)*(t-f)>=(n-c)*(u-f)&&(n-c)*(i-f)>=(e-c)*(t-f)&&(e-c)*(u-f)>=(s-c)*(i-f)}function q$(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!V$(n,t)&&(Sf(n,t)&&Sf(t,n)&&H$(n,t)&&(tr(n.prev,n,t.prev)||tr(n,t.prev,t))||Cd(n,t)&&tr(n.prev,n,n.next)>0&&tr(t.prev,t,t.next)>0)}function tr(n,t,e){return(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y)}function Cd(n,t){return n.x===t.x&&n.y===t.y}function nR(n,t,e,i){var s=Ad(tr(n,t,e)),u=Ad(tr(n,t,i)),c=Ad(tr(e,i,n)),f=Ad(tr(e,i,t));return!!(s!==u&&c!==f||s===0&&bd(n,e,t)||u===0&&bd(n,i,t)||c===0&&bd(e,n,i)||f===0&&bd(e,t,i))}function bd(n,t,e){return t.x<=Math.max(n.x,e.x)&&t.x>=Math.min(n.x,e.x)&&t.y<=Math.max(n.y,e.y)&&t.y>=Math.min(n.y,e.y)}function Ad(n){return n>0?1:n<0?-1:0}function V$(n,t){var e=n;do{if(e.i!==n.i&&e.next.i!==n.i&&e.i!==t.i&&e.next.i!==t.i&&nR(e,e.next,n,t))return!0;e=e.next}while(e!==n);return!1}function Sf(n,t){return tr(n.prev,n,n.next)<0?tr(n,t,n.next)>=0&&tr(n,n.prev,t)>=0:tr(n,t,n.prev)<0||tr(n,n.next,t)<0}function H$(n,t){var e=n,i=!1,s=(n.x+t.x)/2,u=(n.y+t.y)/2;do e.y>u!=e.next.y>u&&e.next.y!==e.y&&s<(e.next.x-e.x)*(u-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==n);return i}function rR(n,t){var e=new C_(n.i,n.x,n.y),i=new C_(t.i,t.x,t.y),s=n.next,u=t.prev;return n.next=t,t.prev=n,e.next=s,s.prev=e,i.next=e,e.prev=i,u.next=i,i.prev=u,i}function tR(n,t,e,i){var s=new C_(n,t,e);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function wf(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function C_(n,t,e){this.i=n,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Td.deviation=function(n,t,e,i){var s=t&&t.length,u=s?t[0]*e:n.length,c=Math.abs(I_(n,0,u,e));if(s)for(var f=0,p=t.length;f<p;f++){var d=t[f]*e,g=f<p-1?t[f+1]*e:n.length;c-=Math.abs(I_(n,d,g,e))}var y=0;for(f=0;f<i.length;f+=3){var v=i[f]*e,E=i[f+1]*e,M=i[f+2]*e;y+=Math.abs((n[v]-n[M])*(n[E+1]-n[v+1])-(n[v]-n[E])*(n[M+1]-n[v+1]))}return c===0&&y===0?0:Math.abs((y-c)/c)};function I_(n,t,e,i){for(var s=0,u=t,c=e-i;u<e;u+=i)s+=(n[c]-n[u])*(n[u+1]+n[c+1]),c=u;return s}Td.flatten=function(n){for(var t=n[0][0].length,e={vertices:[],holes:[],dimensions:t},i=0,s=0;s<n.length;s++){for(var u=0;u<n[s].length;u++)for(var c=0;c<t;c++)e.vertices.push(n[s][u][c]);s>0&&(i+=n[s-1].length,e.holes.push(i))}return e}});var D_=X(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.earthRadius=63710088e-1;ge.factors={centimeters:ge.earthRadius*100,centimetres:ge.earthRadius*100,degrees:ge.earthRadius/111325,feet:ge.earthRadius*3.28084,inches:ge.earthRadius*39.37,kilometers:ge.earthRadius/1e3,kilometres:ge.earthRadius/1e3,meters:ge.earthRadius,metres:ge.earthRadius,miles:ge.earthRadius/1609.344,millimeters:ge.earthRadius*1e3,millimetres:ge.earthRadius*1e3,nauticalmiles:ge.earthRadius/1852,radians:1,yards:ge.earthRadius*1.0936};ge.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/ge.earthRadius,yards:1.0936133};ge.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Sa(n,t,e){e===void 0&&(e={});var i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=t||{},i.geometry=n,i}ge.feature=Sa;function X$(n,t,e){switch(e===void 0&&(e={}),n){case"Point":return R_(t).geometry;case"LineString":return N_(t).geometry;case"Polygon":return L_(t).geometry;case"MultiPoint":return sR(t).geometry;case"MultiLineString":return oR(t).geometry;case"MultiPolygon":return aR(t).geometry;default:throw new Error(n+" is invalid")}}ge.geometry=X$;function R_(n,t,e){if(e===void 0&&(e={}),!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Id(n[0])||!Id(n[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:n};return Sa(i,t,e)}ge.point=R_;function Y$(n,t,e){return e===void 0&&(e={}),Pd(n.map(function(i){return R_(i,t)}),e)}ge.points=Y$;function L_(n,t,e){e===void 0&&(e={});for(var i=0,s=n;i<s.length;i++){var u=s[i];if(u.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var c=0;c<u[u.length-1].length;c++)if(u[u.length-1][c]!==u[0][c])throw new Error("First and last Position are not equivalent.")}var f={type:"Polygon",coordinates:n};return Sa(f,t,e)}ge.polygon=L_;function $$(n,t,e){return e===void 0&&(e={}),Pd(n.map(function(i){return L_(i,t)}),e)}ge.polygons=$$;function N_(n,t,e){if(e===void 0&&(e={}),n.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:n};return Sa(i,t,e)}ge.lineString=N_;function Z$(n,t,e){return e===void 0&&(e={}),Pd(n.map(function(i){return N_(i,t)}),e)}ge.lineStrings=Z$;function Pd(n,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=n,e}ge.featureCollection=Pd;function oR(n,t,e){e===void 0&&(e={});var i={type:"MultiLineString",coordinates:n};return Sa(i,t,e)}ge.multiLineString=oR;function sR(n,t,e){e===void 0&&(e={});var i={type:"MultiPoint",coordinates:n};return Sa(i,t,e)}ge.multiPoint=sR;function aR(n,t,e){e===void 0&&(e={});var i={type:"MultiPolygon",coordinates:n};return Sa(i,t,e)}ge.multiPolygon=aR;function J$(n,t,e){e===void 0&&(e={});var i={type:"GeometryCollection",geometries:n};return Sa(i,t,e)}ge.geometryCollection=J$;function j$(n,t){if(t===void 0&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,t||0);return Math.round(n*e)/e}ge.round=j$;function uR(n,t){t===void 0&&(t="kilometers");var e=ge.factors[t];if(!e)throw new Error(t+" units is invalid");return n*e}ge.radiansToLength=uR;function O_(n,t){t===void 0&&(t="kilometers");var e=ge.factors[t];if(!e)throw new Error(t+" units is invalid");return n/e}ge.lengthToRadians=O_;function K$(n,t){return lR(O_(n,t))}ge.lengthToDegrees=K$;function Q$(n){var t=n%360;return t<0&&(t+=360),t}ge.bearingToAzimuth=Q$;function lR(n){var t=n%(2*Math.PI);return t*180/Math.PI}ge.radiansToDegrees=lR;function tZ(n){var t=n%360;return t*Math.PI/180}ge.degreesToRadians=tZ;function eZ(n,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(n>=0))throw new Error("length must be a positive number");return uR(O_(n,t),e)}ge.convertLength=eZ;function nZ(n,t,e){if(t===void 0&&(t="meters"),e===void 0&&(e="kilometers"),!(n>=0))throw new Error("area must be a positive number");var i=ge.areaFactors[t];if(!i)throw new Error("invalid original units");var s=ge.areaFactors[e];if(!s)throw new Error("invalid final units");return n/i*s}ge.convertArea=nZ;function Id(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}ge.isNumber=Id;function rZ(n){return!!n&&n.constructor===Object}ge.isObject=rZ;function iZ(n){if(!n)throw new Error("bbox is required");if(!Array.isArray(n))throw new Error("bbox must be an Array");if(n.length!==4&&n.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");n.forEach(function(t){if(!Id(t))throw new Error("bbox must only contain numbers")})}ge.validateBBox=iZ;function oZ(n){if(!n)throw new Error("id is required");if(["string","number"].indexOf(typeof n)===-1)throw new Error("id must be a number or a string")}ge.validateId=oZ});var U_=X(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});var ci=D_();function Mf(n,t,e){if(n!==null)for(var i,s,u,c,f,p,d,g=0,y=0,v,E=n.type,M=E==="FeatureCollection",A=E==="Feature",_=M?n.features.length:1,x=0;x<_;x++){d=M?n.features[x].geometry:A?n.geometry:n,v=d?d.type==="GeometryCollection":!1,f=v?d.geometries.length:1;for(var T=0;T<f;T++){var w=0,R=0;if(c=v?d.geometries[T]:d,c!==null){p=c.coordinates;var B=c.type;switch(g=e&&(B==="Polygon"||B==="MultiPolygon")?1:0,B){case null:break;case"Point":if(t(p,y,x,w,R)===!1)return!1;y++,w++;break;case"LineString":case"MultiPoint":for(i=0;i<p.length;i++){if(t(p[i],y,x,w,R)===!1)return!1;y++,B==="MultiPoint"&&w++}B==="LineString"&&w++;break;case"Polygon":case"MultiLineString":for(i=0;i<p.length;i++){for(s=0;s<p[i].length-g;s++){if(t(p[i][s],y,x,w,R)===!1)return!1;y++}B==="MultiLineString"&&w++,B==="Polygon"&&R++}B==="Polygon"&&w++;break;case"MultiPolygon":for(i=0;i<p.length;i++){for(R=0,s=0;s<p[i].length;s++){for(u=0;u<p[i][s].length-g;u++){if(t(p[i][s][u],y,x,w,R)===!1)return!1;y++}R++}w++}break;case"GeometryCollection":for(i=0;i<c.geometries.length;i++)if(Mf(c.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function sZ(n,t,e,i){var s=e;return Mf(n,function(u,c,f,p,d){c===0&&e===void 0?s=u:s=t(s,u,c,f,p,d)},i),s}function cR(n,t){var e;switch(n.type){case"FeatureCollection":for(e=0;e<n.features.length&&t(n.features[e].properties,e)!==!1;e++);break;case"Feature":t(n.properties,0);break}}function aZ(n,t,e){var i=e;return cR(n,function(s,u){u===0&&e===void 0?i=s:i=t(i,s,u)}),i}function fR(n,t){if(n.type==="Feature")t(n,0);else if(n.type==="FeatureCollection")for(var e=0;e<n.features.length&&t(n.features[e],e)!==!1;e++);}function uZ(n,t,e){var i=e;return fR(n,function(s,u){u===0&&e===void 0?i=s:i=t(i,s,u)}),i}function lZ(n){var t=[];return Mf(n,function(e){t.push(e)}),t}function F_(n,t){var e,i,s,u,c,f,p,d,g,y,v=0,E=n.type==="FeatureCollection",M=n.type==="Feature",A=E?n.features.length:1;for(e=0;e<A;e++){for(f=E?n.features[e].geometry:M?n.geometry:n,d=E?n.features[e].properties:M?n.properties:{},g=E?n.features[e].bbox:M?n.bbox:void 0,y=E?n.features[e].id:M?n.id:void 0,p=f?f.type==="GeometryCollection":!1,c=p?f.geometries.length:1,s=0;s<c;s++){if(u=p?f.geometries[s]:f,u===null){if(t(null,v,d,g,y)===!1)return!1;continue}switch(u.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(u,v,d,g,y)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<u.geometries.length;i++)if(t(u.geometries[i],v,d,g,y)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}v++}}function cZ(n,t,e){var i=e;return F_(n,function(s,u,c,f,p){u===0&&e===void 0?i=s:i=t(i,s,u,c,f,p)}),i}function Rd(n,t){F_(n,function(e,i,s,u,c){var f=e===null?null:e.type;switch(f){case null:case"Point":case"LineString":case"Polygon":return t(ci.feature(e,s,{bbox:u,id:c}),i,0)===!1?!1:void 0}var p;switch(f){case"MultiPoint":p="Point";break;case"MultiLineString":p="LineString";break;case"MultiPolygon":p="Polygon";break}for(var d=0;d<e.coordinates.length;d++){var g=e.coordinates[d],y={type:p,coordinates:g};if(t(ci.feature(y,s),i,d)===!1)return!1}})}function fZ(n,t,e){var i=e;return Rd(n,function(s,u,c){u===0&&c===0&&e===void 0?i=s:i=t(i,s,u,c)}),i}function hR(n,t){Rd(n,function(e,i,s){var u=0;if(e.geometry){var c=e.geometry.type;if(!(c==="Point"||c==="MultiPoint")){var f,p=0,d=0,g=0;if(Mf(e,function(y,v,E,M,A){if(f===void 0||i>p||M>d||A>g){f=y,p=i,d=M,g=A,u=0;return}var _=ci.lineString([f,y],e.properties);if(t(_,i,s,A,u)===!1)return!1;u++,f=y})===!1)return!1}}})}function hZ(n,t,e){var i=e,s=!1;return hR(n,function(u,c,f,p,d){s===!1&&e===void 0?i=u:i=t(i,u,c,f,p,d),s=!0}),i}function pR(n,t){if(!n)throw new Error("geojson is required");Rd(n,function(e,i,s){if(e.geometry!==null){var u=e.geometry.type,c=e.geometry.coordinates;switch(u){case"LineString":if(t(e,i,s,0,0)===!1)return!1;break;case"Polygon":for(var f=0;f<c.length;f++)if(t(ci.lineString(c[f],e.properties),i,s,f)===!1)return!1;break}}})}function pZ(n,t,e){var i=e;return pR(n,function(s,u,c,f){u===0&&e===void 0?i=s:i=t(i,s,u,c,f)}),i}function dZ(n,t){if(t=t||{},!ci.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,s=t.geometryIndex||0,u=t.segmentIndex||0,c=t.properties,f;switch(n.type){case"FeatureCollection":e<0&&(e=n.features.length+e),c=c||n.features[e].properties,f=n.features[e].geometry;break;case"Feature":c=c||n.properties,f=n.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":f=n;break;default:throw new Error("geojson is invalid")}if(f===null)return null;var p=f.coordinates;switch(f.type){case"Point":case"MultiPoint":return null;case"LineString":return u<0&&(u=p.length+u-1),ci.lineString([p[u],p[u+1]],c,t);case"Polygon":return s<0&&(s=p.length+s),u<0&&(u=p[s].length+u-1),ci.lineString([p[s][u],p[s][u+1]],c,t);case"MultiLineString":return i<0&&(i=p.length+i),u<0&&(u=p[i].length+u-1),ci.lineString([p[i][u],p[i][u+1]],c,t);case"MultiPolygon":return i<0&&(i=p.length+i),s<0&&(s=p[i].length+s),u<0&&(u=p[i][s].length-u-1),ci.lineString([p[i][s][u],p[i][s][u+1]],c,t)}throw new Error("geojson is invalid")}function gZ(n,t){if(t=t||{},!ci.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,s=t.geometryIndex||0,u=t.coordIndex||0,c=t.properties,f;switch(n.type){case"FeatureCollection":e<0&&(e=n.features.length+e),c=c||n.features[e].properties,f=n.features[e].geometry;break;case"Feature":c=c||n.properties,f=n.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":f=n;break;default:throw new Error("geojson is invalid")}if(f===null)return null;var p=f.coordinates;switch(f.type){case"Point":return ci.point(p,c,t);case"MultiPoint":return i<0&&(i=p.length+i),ci.point(p[i],c,t);case"LineString":return u<0&&(u=p.length+u),ci.point(p[u],c,t);case"Polygon":return s<0&&(s=p.length+s),u<0&&(u=p[s].length+u),ci.point(p[s][u],c,t);case"MultiLineString":return i<0&&(i=p.length+i),u<0&&(u=p[i].length+u),ci.point(p[i][u],c,t);case"MultiPolygon":return i<0&&(i=p.length+i),s<0&&(s=p[i].length+s),u<0&&(u=p[i][s].length-u),ci.point(p[i][s][u],c,t)}throw new Error("geojson is invalid")}Mr.coordAll=lZ;Mr.coordEach=Mf;Mr.coordReduce=sZ;Mr.featureEach=fR;Mr.featureReduce=uZ;Mr.findPoint=gZ;Mr.findSegment=dZ;Mr.flattenEach=Rd;Mr.flattenReduce=fZ;Mr.geomEach=F_;Mr.geomReduce=cZ;Mr.lineEach=pR;Mr.lineReduce=pZ;Mr.propEach=cR;Mr.propReduce=aZ;Mr.segmentEach=hR;Mr.segmentReduce=hZ});var dR=X(z_=>{"use strict";Object.defineProperty(z_,"__esModule",{value:!0});var mZ=U_();function B_(n){var t=[1/0,1/0,-1/0,-1/0];return mZ.coordEach(n,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}B_.default=B_;z_.default=B_});var Ld=X((Klt,G_)=>{var ns=f_(),mR=D_(),yR=U_(),kl=dR().default,yZ=yR.featureEach,Jlt=yR.coordEach,jlt=mR.polygon,gR=mR.featureCollection;function vR(n){var t=new ns(n);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:kl(e),ns.prototype.insert.call(this,e)},t.load=function(e){var i=[];return Array.isArray(e)?e.forEach(function(s){if(s.type!=="Feature")throw new Error("invalid features");s.bbox=s.bbox?s.bbox:kl(s),i.push(s)}):yZ(e,function(s){if(s.type!=="Feature")throw new Error("invalid features");s.bbox=s.bbox?s.bbox:kl(s),i.push(s)}),ns.prototype.load.call(this,i)},t.remove=function(e,i){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:kl(e),ns.prototype.remove.call(this,e,i)},t.clear=function(){return ns.prototype.clear.call(this)},t.search=function(e){var i=ns.prototype.search.call(this,this.toBBox(e));return gR(i)},t.collides=function(e){return ns.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=ns.prototype.all.call(this);return gR(e)},t.toJSON=function(){return ns.prototype.toJSON.call(this)},t.fromJSON=function(e){return ns.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var i;if(e.bbox)i=e.bbox;else if(Array.isArray(e)&&e.length===4)i=e;else if(Array.isArray(e)&&e.length===6)i=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")i=kl(e);else if(e.type==="FeatureCollection")i=kl(e);else throw new Error("invalid geojson");return{minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}},t}G_.exports=vR;G_.exports.default=vR});var X_=X((aht,CR)=>{"use strict";var TR=Object.prototype.toString;CR.exports=function(t){var e=TR.call(t),i=e==="[object Arguments]";return i||(i=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&TR.call(t.callee)==="[object Function]"),i}});var UR=X((uht,FR)=>{"use strict";var DR;Object.keys||(Tf=Object.prototype.hasOwnProperty,Y_=Object.prototype.toString,IR=X_(),$_=Object.prototype.propertyIsEnumerable,PR=!$_.call({toString:null},"toString"),RR=$_.call(function(){},"prototype"),Cf=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Ud=function(n){var t=n.constructor;return t&&t.prototype===n},LR={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},NR=function(){if(typeof window=="undefined")return!1;for(var n in window)try{if(!LR["$"+n]&&Tf.call(window,n)&&window[n]!==null&&typeof window[n]=="object")try{Ud(window[n])}catch(t){return!0}}catch(t){return!0}return!1}(),OR=function(n){if(typeof window=="undefined"||!NR)return Ud(n);try{return Ud(n)}catch(t){return!1}},DR=function(t){var e=t!==null&&typeof t=="object",i=Y_.call(t)==="[object Function]",s=IR(t),u=e&&Y_.call(t)==="[object String]",c=[];if(!e&&!i&&!s)throw new TypeError("Object.keys called on a non-object");var f=RR&&i;if(u&&t.length>0&&!Tf.call(t,0))for(var p=0;p<t.length;++p)c.push(String(p));if(s&&t.length>0)for(var d=0;d<t.length;++d)c.push(String(d));else for(var g in t)!(f&&g==="prototype")&&Tf.call(t,g)&&c.push(String(g));if(PR)for(var y=OR(t),v=0;v<Cf.length;++v)!(y&&Cf[v]==="constructor")&&Tf.call(t,Cf[v])&&c.push(Cf[v]);return c});var Tf,Y_,IR,$_,PR,RR,Cf,Ud,LR,NR,OR;FR.exports=DR});var Z_=X((lht,GR)=>{"use strict";var TZ=Array.prototype.slice,CZ=X_(),BR=Object.keys,Bd=BR?function(t){return BR(t)}:UR(),zR=Object.keys;Bd.shim=function(){if(Object.keys){var t=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);t||(Object.keys=function(i){return CZ(i)?zR(TZ.call(i)):zR(i)})}else Object.keys=Bd;return Object.keys||Bd};GR.exports=Bd});var J_=X((cht,kR)=>{"use strict";kR.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),i=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var s=42;t[e]=s;for(var u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var f=Object.getOwnPropertyDescriptor(t,e);if(f.value!==s||f.enumerable!==!0)return!1}return!0}});var zd=X((fht,qR)=>{"use strict";var IZ=J_();qR.exports=function(){return IZ()&&!!Symbol.toStringTag}});var j_=X((hht,VR)=>{"use strict";VR.exports=Object});var K_=X((pht,HR)=>{"use strict";HR.exports=Error});var XR=X((dht,WR)=>{"use strict";WR.exports=EvalError});var $R=X((ght,YR)=>{"use strict";YR.exports=RangeError});var JR=X((mht,ZR)=>{"use strict";ZR.exports=ReferenceError});var Q_=X((yht,jR)=>{"use strict";jR.exports=SyntaxError});var gu=X((vht,KR)=>{"use strict";KR.exports=TypeError});var tL=X((_ht,QR)=>{"use strict";QR.exports=URIError});var nL=X((xht,eL)=>{"use strict";eL.exports=Math.abs});var iL=X((Eht,rL)=>{"use strict";rL.exports=Math.floor});var sL=X((Sht,oL)=>{"use strict";oL.exports=Math.max});var uL=X((wht,aL)=>{"use strict";aL.exports=Math.min});var cL=X((Mht,lL)=>{"use strict";lL.exports=Math.pow});var hL=X((bht,fL)=>{"use strict";fL.exports=Math.round});var dL=X((Aht,pL)=>{"use strict";pL.exports=Number.isNaN||function(t){return t!==t}});var mL=X((Tht,gL)=>{"use strict";var PZ=dL();gL.exports=function(t){return PZ(t)||t===0?t:t<0?-1:1}});var vL=X((Cht,yL)=>{"use strict";yL.exports=Object.getOwnPropertyDescriptor});var mu=X((Iht,_L)=>{"use strict";var Gd=vL();if(Gd)try{Gd([],"length")}catch(n){Gd=null}_L.exports=Gd});var If=X((Pht,xL)=>{"use strict";var kd=Object.defineProperty||!1;if(kd)try{kd({},"a",{value:1})}catch(n){kd=!1}xL.exports=kd});var wL=X((Rht,SL)=>{"use strict";var EL=typeof Symbol!="undefined"&&Symbol,RZ=J_();SL.exports=function(){return typeof EL!="function"||typeof Symbol!="function"||typeof EL("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:RZ()}});var tx=X((Lht,ML)=>{"use strict";ML.exports=typeof Reflect!="undefined"&&Reflect.getPrototypeOf||null});var ex=X((Nht,bL)=>{"use strict";var LZ=j_();bL.exports=LZ.getPrototypeOf||null});var CL=X((Oht,TL)=>{"use strict";var NZ="Function.prototype.bind called on incompatible ",OZ=Object.prototype.toString,DZ=Math.max,FZ="[object Function]",AL=function(t,e){for(var i=[],s=0;s<t.length;s+=1)i[s]=t[s];for(var u=0;u<e.length;u+=1)i[u+t.length]=e[u];return i},UZ=function(t,e){for(var i=[],s=e||0,u=0;s<t.length;s+=1,u+=1)i[u]=t[s];return i},BZ=function(n,t){for(var e="",i=0;i<n.length;i+=1)e+=n[i],i+1<n.length&&(e+=t);return e};TL.exports=function(t){var e=this;if(typeof e!="function"||OZ.apply(e)!==FZ)throw new TypeError(NZ+e);for(var i=UZ(arguments,1),s,u=function(){if(this instanceof s){var g=e.apply(this,AL(i,arguments));return Object(g)===g?g:this}return e.apply(t,AL(i,arguments))},c=DZ(0,e.length-i.length),f=[],p=0;p<c;p++)f[p]="$"+p;if(s=Function("binder","return function ("+BZ(f,",")+"){ return binder.apply(this,arguments); }")(u),e.prototype){var d=function(){};d.prototype=e.prototype,s.prototype=new d,d.prototype=null}return s}});var ql=X((Dht,IL)=>{"use strict";var zZ=CL();IL.exports=Function.prototype.bind||zZ});var qd=X((Fht,PL)=>{"use strict";PL.exports=Function.prototype.call});var Vd=X((Uht,RL)=>{"use strict";RL.exports=Function.prototype.apply});var NL=X((Bht,LL)=>{"use strict";LL.exports=typeof Reflect!="undefined"&&Reflect&&Reflect.apply});var nx=X((zht,OL)=>{"use strict";var GZ=ql(),kZ=Vd(),qZ=qd(),VZ=NL();OL.exports=VZ||GZ.call(qZ,kZ)});var Hd=X((Ght,DL)=>{"use strict";var HZ=ql(),WZ=gu(),XZ=qd(),YZ=nx();DL.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new WZ("a function is required");return YZ(HZ,XZ,t)}});var kL=X((kht,GL)=>{"use strict";var $Z=Hd(),FL=mu(),BL;try{BL=[].__proto__===Array.prototype}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var rx=!!BL&&FL&&FL(Object.prototype,"__proto__"),zL=Object,UL=zL.getPrototypeOf;GL.exports=rx&&typeof rx.get=="function"?$Z([rx.get]):typeof UL=="function"?function(t){return UL(t==null?t:zL(t))}:!1});var ix=X((qht,WL)=>{"use strict";var qL=tx(),VL=ex(),HL=kL();WL.exports=qL?function(t){return qL(t)}:VL?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return VL(t)}:HL?function(t){return HL(t)}:null});var ox=X((Vht,XL)=>{"use strict";var ZZ=Function.prototype.call,JZ=Object.prototype.hasOwnProperty,jZ=ql();XL.exports=jZ.call(ZZ,JZ)});var ux=X((Hht,KL)=>{"use strict";var tn,KZ=j_(),QZ=K_(),tJ=XR(),eJ=$R(),nJ=JR(),Xl=Q_(),Wl=gu(),rJ=tL(),iJ=nL(),oJ=iL(),sJ=sL(),aJ=uL(),uJ=cL(),lJ=hL(),cJ=mL(),JL=Function,sx=function(n){try{return JL('"use strict"; return ('+n+").constructor;")()}catch(t){}},Pf=mu(),fJ=If(),ax=function(){throw new Wl},hJ=Pf?function(){try{return arguments.callee,ax}catch(n){try{return Pf(arguments,"callee").get}catch(t){return ax}}}():ax,Vl=wL()(),Gr=ix(),pJ=ex(),dJ=tx(),jL=Vd(),Rf=qd(),Hl={},gJ=typeof Uint8Array=="undefined"||!Gr?tn:Gr(Uint8Array),yu={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?tn:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?tn:ArrayBuffer,"%ArrayIteratorPrototype%":Vl&&Gr?Gr([][Symbol.iterator]()):tn,"%AsyncFromSyncIteratorPrototype%":tn,"%AsyncFunction%":Hl,"%AsyncGenerator%":Hl,"%AsyncGeneratorFunction%":Hl,"%AsyncIteratorPrototype%":Hl,"%Atomics%":typeof Atomics=="undefined"?tn:Atomics,"%BigInt%":typeof BigInt=="undefined"?tn:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?tn:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?tn:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?tn:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":QZ,"%eval%":eval,"%EvalError%":tJ,"%Float16Array%":typeof Float16Array=="undefined"?tn:Float16Array,"%Float32Array%":typeof Float32Array=="undefined"?tn:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?tn:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?tn:FinalizationRegistry,"%Function%":JL,"%GeneratorFunction%":Hl,"%Int8Array%":typeof Int8Array=="undefined"?tn:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?tn:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?tn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Vl&&Gr?Gr(Gr([][Symbol.iterator]())):tn,"%JSON%":typeof JSON=="object"?JSON:tn,"%Map%":typeof Map=="undefined"?tn:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!Vl||!Gr?tn:Gr(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":KZ,"%Object.getOwnPropertyDescriptor%":Pf,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?tn:Promise,"%Proxy%":typeof Proxy=="undefined"?tn:Proxy,"%RangeError%":eJ,"%ReferenceError%":nJ,"%Reflect%":typeof Reflect=="undefined"?tn:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?tn:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!Vl||!Gr?tn:Gr(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?tn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Vl&&Gr?Gr(""[Symbol.iterator]()):tn,"%Symbol%":Vl?Symbol:tn,"%SyntaxError%":Xl,"%ThrowTypeError%":hJ,"%TypedArray%":gJ,"%TypeError%":Wl,"%Uint8Array%":typeof Uint8Array=="undefined"?tn:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?tn:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?tn:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?tn:Uint32Array,"%URIError%":rJ,"%WeakMap%":typeof WeakMap=="undefined"?tn:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?tn:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?tn:WeakSet,"%Function.prototype.call%":Rf,"%Function.prototype.apply%":jL,"%Object.defineProperty%":fJ,"%Object.getPrototypeOf%":pJ,"%Math.abs%":iJ,"%Math.floor%":oJ,"%Math.max%":sJ,"%Math.min%":aJ,"%Math.pow%":uJ,"%Math.round%":lJ,"%Math.sign%":cJ,"%Reflect.getPrototypeOf%":dJ};if(Gr)try{null.error}catch(n){YL=Gr(Gr(n)),yu["%Error.prototype%"]=YL}var YL,mJ=function n(t){var e;if(t==="%AsyncFunction%")e=sx("async function () {}");else if(t==="%GeneratorFunction%")e=sx("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=sx("async function* () {}");else if(t==="%AsyncGenerator%"){var i=n("%AsyncGeneratorFunction%");i&&(e=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var s=n("%AsyncGenerator%");s&&Gr&&(e=Gr(s.prototype))}return yu[t]=e,e},$L={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Lf=ql(),Wd=ox(),yJ=Lf.call(Rf,Array.prototype.concat),vJ=Lf.call(jL,Array.prototype.splice),ZL=Lf.call(Rf,String.prototype.replace),Xd=Lf.call(Rf,String.prototype.slice),_J=Lf.call(Rf,RegExp.prototype.exec),xJ=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,EJ=/\\\\(\\\\)?/g,SJ=function(t){var e=Xd(t,0,1),i=Xd(t,-1);if(e==="%"&&i!=="%")throw new Xl("invalid intrinsic syntax, expected closing \`%\`");if(i==="%"&&e!=="%")throw new Xl("invalid intrinsic syntax, expected opening \`%\`");var s=[];return ZL(t,xJ,function(u,c,f,p){s[s.length]=f?ZL(p,EJ,"$1"):c||u}),s},wJ=function(t,e){var i=t,s;if(Wd($L,i)&&(s=$L[i],i="%"+s[0]+"%"),Wd(yu,i)){var u=yu[i];if(u===Hl&&(u=mJ(i)),typeof u=="undefined"&&!e)throw new Wl("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:s,name:i,value:u}}throw new Xl("intrinsic "+t+" does not exist!")};KL.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new Wl("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Wl('"allowMissing" argument must be a boolean');if(_J(/^%?[^%]*%?$/,t)===null)throw new Xl("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var i=SJ(t),s=i.length>0?i[0]:"",u=wJ("%"+s+"%",e),c=u.name,f=u.value,p=!1,d=u.alias;d&&(s=d[0],vJ(i,yJ([0,1],d)));for(var g=1,y=!0;g<i.length;g+=1){var v=i[g],E=Xd(v,0,1),M=Xd(v,-1);if((E==='"'||E==="'"||E==="\`"||M==='"'||M==="'"||M==="\`")&&E!==M)throw new Xl("property names with quotes must have matching quotes");if((v==="constructor"||!y)&&(p=!0),s+="."+v,c="%"+s+"%",Wd(yu,c))f=yu[c];else if(f!=null){if(!(v in f)){if(!e)throw new Wl("base intrinsic for "+t+" exists, but the property is not available.");return}if(Pf&&g+1>=i.length){var A=Pf(f,v);y=!!A,y&&"get"in A&&!("originalValue"in A.get)?f=A.get:f=f[v]}else y=Wd(f,v),f=f[v];y&&!p&&(yu[c]=f)}}return f}});var Yd=X((Wht,eN)=>{"use strict";var QL=ux(),tN=Hd(),MJ=tN([QL("%String.prototype.indexOf%")]);eN.exports=function(t,e){var i=QL(t,!!e);return typeof i=="function"&&MJ(t,".prototype.")>-1?tN([i]):i}});var iN=X((Xht,rN)=>{"use strict";var bJ=zd()(),AJ=Yd(),lx=AJ("Object.prototype.toString"),$d=function(t){return bJ&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:lx(t)==="[object Arguments]"},nN=function(t){return $d(t)?!0:t!==null&&typeof t=="object"&&"length"in t&&typeof t.length=="number"&&t.length>=0&&lx(t)!=="[object Array]"&&"callee"in t&&lx(t.callee)==="[object Function]"},TJ=function(){return $d(arguments)}();$d.isLegacyArguments=nN;rN.exports=TJ?$d:nN});var Zd=X((Yht,aN)=>{"use strict";var oN=If(),CJ=Q_(),Yl=gu(),sN=mu();aN.exports=function(t,e,i){if(!t||typeof t!="object"&&typeof t!="function")throw new Yl("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new Yl("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Yl("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Yl("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Yl("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Yl("\`loose\`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,f=arguments.length>6?arguments[6]:!1,p=!!sN&&sN(t,e);if(oN)oN(t,e,{configurable:c===null&&p?p.configurable:!c,enumerable:s===null&&p?p.enumerable:!s,value:i,writable:u===null&&p?p.writable:!u});else if(f||!s&&!u&&!c)t[e]=i;else throw new CJ("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Jd=X(($ht,lN)=>{"use strict";var cx=If(),uN=function(){return!!cx};uN.hasArrayLengthDefineBug=function(){if(!cx)return null;try{return cx([],"length",{value:1}).length!==1}catch(t){return!0}};lN.exports=uN});var $l=X((Zht,pN)=>{"use strict";var IJ=Z_(),PJ=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",RJ=Object.prototype.toString,LJ=Array.prototype.concat,cN=Zd(),NJ=function(n){return typeof n=="function"&&RJ.call(n)==="[object Function]"},fN=Jd()(),OJ=function(n,t,e,i){if(t in n){if(i===!0){if(n[t]===e)return}else if(!NJ(i)||!i())return}fN?cN(n,t,e,!0):cN(n,t,e)},hN=function(n,t){var e=arguments.length>2?arguments[2]:{},i=IJ(t);PJ&&(i=LJ.call(i,Object.getOwnPropertySymbols(t)));for(var s=0;s<i.length;s+=1)OJ(n,i[s],t[i[s]],e[i[s]])};hN.supportsDescriptors=!!fN;pN.exports=hN});var vN=X((Jht,yN)=>{"use strict";var DJ=ux(),dN=Zd(),FJ=Jd()(),gN=mu(),mN=gu(),UJ=DJ("%Math.floor%");yN.exports=function(t,e){if(typeof t!="function")throw new mN("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||UJ(e)!==e)throw new mN("\`length\` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],s=!0,u=!0;if("length"in t&&gN){var c=gN(t,"length");c&&!c.configurable&&(s=!1),c&&!c.writable&&(u=!1)}return(s||u||!i)&&(FJ?dN(t,"length",e,!0,!0):dN(t,"length",e)),t}});var xN=X((jht,_N)=>{"use strict";var BJ=ql(),zJ=Vd(),GJ=nx();_N.exports=function(){return GJ(BJ,zJ,arguments)}});var fx=X((Kht,jd)=>{"use strict";var kJ=vN(),EN=If(),qJ=Hd(),SN=xN();jd.exports=function(t){var e=qJ(arguments),i=t.length-(arguments.length-1);return kJ(e,1+(i>0?i:0),!0)};EN?EN(jd.exports,"apply",{value:SN}):jd.exports.apply=SN});var hx=X((Qht,MN)=>{"use strict";var wN=function(n){return n!==n};MN.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||wN(t)&&wN(e))}});var px=X((tpt,bN)=>{"use strict";var VJ=hx();bN.exports=function(){return typeof Object.is=="function"?Object.is:VJ}});var TN=X((ept,AN)=>{"use strict";var HJ=px(),WJ=$l();AN.exports=function(){var t=HJ();return WJ(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var RN=X((npt,PN)=>{"use strict";var XJ=$l(),YJ=fx(),$J=hx(),CN=px(),ZJ=TN(),IN=YJ(CN(),Object);XJ(IN,{getPolyfill:CN,implementation:$J,shim:ZJ});PN.exports=IN});var UN=X((rpt,FN)=>{"use strict";var LN=Yd(),JJ=zd()(),jJ=ox(),KJ=mu(),mx;JJ?(NN=LN("RegExp.prototype.exec"),dx={},Kd=function(){throw dx},gx={toString:Kd,valueOf:Kd},typeof Symbol.toPrimitive=="symbol"&&(gx[Symbol.toPrimitive]=Kd),mx=function(t){if(!t||typeof t!="object")return!1;var e=KJ(t,"lastIndex"),i=e&&jJ(e,"value");if(!i)return!1;try{NN(t,gx)}catch(s){return s===dx}}):(ON=LN("Object.prototype.toString"),DN="[object RegExp]",mx=function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:ON(t)===DN});var NN,dx,Kd,gx,ON,DN;FN.exports=mx});var zN=X((ipt,BN)=>{"use strict";var Of=function(){return typeof function(){}.name=="string"},Nf=Object.getOwnPropertyDescriptor;if(Nf)try{Nf([],"length")}catch(n){Nf=null}Of.functionsHaveConfigurableNames=function(){if(!Of()||!Nf)return!1;var t=Nf(function(){},"name");return!!t&&!!t.configurable};var QJ=Function.prototype.bind;Of.boundFunctionsHaveNames=function(){return Of()&&typeof QJ=="function"&&function(){}.bind().name!==""};BN.exports=Of});var qN=X((opt,kN)=>{"use strict";var GN=Zd(),tj=Jd()(),ej=zN().functionsHaveConfigurableNames(),nj=gu();kN.exports=function(t,e){if(typeof t!="function")throw new nj("\`fn\` is not a function");var i=arguments.length>2&&!!arguments[2];return(!i||ej)&&(tj?GN(t,"name",e,!0,!0):GN(t,"name",e)),t}});var yx=X((spt,VN)=>{"use strict";var rj=qN(),ij=gu(),oj=Object;VN.exports=rj(function(){if(this==null||this!==oj(this))throw new ij("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0)});var vx=X((apt,HN)=>{"use strict";var sj=yx(),aj=$l().supportsDescriptors,uj=Object.getOwnPropertyDescriptor;HN.exports=function(){if(aj&&/a/mig.flags==="gim"){var t=uj(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",i={};if(Object.defineProperty(i,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(i,"sticky",{get:function(){e+="y"}}),t.get.call(i),e==="dy")return t.get}}return sj}});var YN=X((upt,XN)=>{"use strict";var lj=$l().supportsDescriptors,cj=vx(),fj=mu(),hj=Object.defineProperty,pj=K_(),WN=ix(),dj=/a/;XN.exports=function(){if(!lj||!WN)throw new pj("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=cj(),e=WN(dj),i=fj(e,"flags");return(!i||i.get!==t)&&hj(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var jN=X((lpt,JN)=>{"use strict";var gj=$l(),mj=fx(),yj=yx(),$N=vx(),vj=YN(),ZN=mj($N());gj(ZN,{getPolyfill:$N,implementation:yj,shim:vj});JN.exports=ZN});var t2=X((cpt,QN)=>{"use strict";var KN=Yd(),_j=KN("Date.prototype.getDay"),xj=function(t){try{return _j(t),!0}catch(e){return!1}},Ej=KN("Object.prototype.toString"),Sj="[object Date]",wj=zd()();QN.exports=function(t){return typeof t!="object"||t===null?!1:wj?xj(t):Ej(t)===Sj}});var _x=X((fpt,f2)=>{var e2=Z_(),n2=iN(),r2=RN(),i2=UN(),o2=jN(),s2=t2(),a2=Date.prototype.getTime;function c2(n,t,e){var i=e||{};return(i.strict?r2(n,t):n===t)?!0:!n||!t||typeof n!="object"&&typeof t!="object"?i.strict?r2(n,t):n==t:Mj(n,t,i)}function u2(n){return n==null}function l2(n){return!(!n||typeof n!="object"||typeof n.length!="number"||typeof n.copy!="function"||typeof n.slice!="function"||n.length>0&&typeof n[0]!="number")}function Mj(n,t,e){var i,s;if(typeof n!=typeof t||u2(n)||u2(t)||n.prototype!==t.prototype||n2(n)!==n2(t))return!1;var u=i2(n),c=i2(t);if(u!==c)return!1;if(u||c)return n.source===t.source&&o2(n)===o2(t);if(s2(n)&&s2(t))return a2.call(n)===a2.call(t);var f=l2(n),p=l2(t);if(f!==p)return!1;if(f||p){if(n.length!==t.length)return!1;for(i=0;i<n.length;i++)if(n[i]!==t[i])return!1;return!0}if(typeof n!=typeof t)return!1;try{var d=e2(n),g=e2(t)}catch(y){return!1}if(d.length!==g.length)return!1;for(d.sort(),g.sort(),i=d.length-1;i>=0;i--)if(d[i]!=g[i])return!1;for(i=d.length-1;i>=0;i--)if(s=d[i],!c2(n[s],t[s],e))return!1;return!0}f2.exports=c2});var Rx=X((ygt,v2)=>{var dK=_x(),rs=function(n){this.precision=n&&n.precision?n.precision:17,this.direction=n&&n.direction?n.direction:!1,this.pseudoNode=n&&n.pseudoNode?n.pseudoNode:!1,this.objectComparator=n&&n.objectComparator?n.objectComparator:gK};rs.prototype.compare=function(n,t){if(n.type!==t.type||!y2(n,t))return!1;switch(n.type){case"Point":return this.compareCoord(n.coordinates,t.coordinates);case"LineString":return this.compareLine(n.coordinates,t.coordinates,0,!1);case"Polygon":return this.comparePolygon(n,t);case"Feature":return this.compareFeature(n,t);default:if(n.type.indexOf("Multi")===0){var e=this,i=m2(n),s=m2(t);return i.every(function(u){return this.some(function(c){return e.compare(u,c)})},s)}}return!1};function m2(n){return n.coordinates.map(function(t){return{type:n.type.replace("Multi",""),coordinates:t}})}function y2(n,t){return n.hasOwnProperty("coordinates")?n.coordinates.length===t.coordinates.length:n.length===t.length}rs.prototype.compareCoord=function(n,t){if(n.length!==t.length)return!1;for(var e=0;e<n.length;e++)if(n[e].toFixed(this.precision)!==t[e].toFixed(this.precision))return!1;return!0};rs.prototype.compareLine=function(n,t,e,i){if(!y2(n,t))return!1;var s=this.pseudoNode?n:this.removePseudo(n),u=this.pseudoNode?t:this.removePseudo(t);if(!(i&&!this.compareCoord(s[0],u[0])&&(u=this.fixStartIndex(u,s),!u))){var c=this.compareCoord(s[e],u[e]);return this.direction||c?this.comparePath(s,u):this.compareCoord(s[e],u[u.length-(1+e)])?this.comparePath(s.slice().reverse(),u):!1}};rs.prototype.fixStartIndex=function(n,t){for(var e,i=-1,s=0;s<n.length;s++)if(this.compareCoord(n[s],t[0])){i=s;break}return i>=0&&(e=[].concat(n.slice(i,n.length),n.slice(1,i+1))),e};rs.prototype.comparePath=function(n,t){var e=this;return n.every(function(i,s){return e.compareCoord(i,this[s])},t)};rs.prototype.comparePolygon=function(n,t){if(this.compareLine(n.coordinates[0],t.coordinates[0],1,!0)){var e=n.coordinates.slice(1,n.coordinates.length),i=t.coordinates.slice(1,t.coordinates.length),s=this;return e.every(function(u){return this.some(function(c){return s.compareLine(u,c,1,!0)})},i)}else return!1};rs.prototype.compareFeature=function(n,t){return n.id!==t.id||!this.objectComparator(n.properties,t.properties)||!this.compareBBox(n,t)?!1:this.compare(n.geometry,t.geometry)};rs.prototype.compareBBox=function(n,t){return!!(!n.bbox&&!t.bbox||n.bbox&&t.bbox&&this.compareCoord(n.bbox,t.bbox))};rs.prototype.removePseudo=function(n){return n};function gK(n,t){return dK(n,t,{strict:!0})}v2.exports=rs});var _2=X((Igt,eg)=>{function Ma(n,t,e,i){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(n,t,e,i)}Ma.prototype.run=function(n,t,e,i){this._init(n,t,e,i);for(var s=0;s<this._datasetLength;s++)if(this._visited[s]!==1){this._visited[s]=1;var u=this._regionQuery(s);if(u.length<this.minPts)this.noise.push(s);else{var c=this.clusters.length;this.clusters.push([]),this._addToCluster(s,c),this._expandCluster(c,u)}}return this.clusters};Ma.prototype._init=function(n,t,e,i){if(n){if(!(n instanceof Array))throw Error("Dataset must be of type array, "+typeof n+" given");this.dataset=n,this.clusters=[],this.noise=[],this._datasetLength=n.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}t&&(this.epsilon=t),e&&(this.minPts=e),i&&(this.distance=i)};Ma.prototype._expandCluster=function(n,t){for(var e=0;e<t.length;e++){var i=t[e];if(this._visited[i]!==1){this._visited[i]=1;var s=this._regionQuery(i);s.length>=this.minPts&&(t=this._mergeArrays(t,s))}this._assigned[i]!==1&&this._addToCluster(i,n)}};Ma.prototype._addToCluster=function(n,t){this.clusters[t].push(n),this._assigned[n]=1};Ma.prototype._regionQuery=function(n){for(var t=[],e=0;e<this._datasetLength;e++){var i=this.distance(this.dataset[n],this.dataset[e]);i<this.epsilon&&t.push(e)}return t};Ma.prototype._mergeArrays=function(n,t){for(var e=t.length,i=0;i<e;i++){var s=t[i];n.indexOf(s)<0&&n.push(s)}return n};Ma.prototype._euclideanDistance=function(n,t){for(var e=0,i=Math.min(n.length,t.length);i--;)e+=(n[i]-t[i])*(n[i]-t[i]);return Math.sqrt(e)};typeof eg!="undefined"&&eg.exports&&(eg.exports=Ma)});var x2=X((Pgt,ng)=>{function ba(n,t,e){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(n,t,e)}ba.prototype.init=function(n,t,e){this.assignments=[],this.centroids=[],typeof n!="undefined"&&(this.dataset=n),typeof t!="undefined"&&(this.k=t),typeof e!="undefined"&&(this.distance=e)};ba.prototype.run=function(n,t){this.init(n,t);for(var e=this.dataset.length,i=0;i<this.k;i++)this.centroids[i]=this.randomCentroid();for(var s=!0;s;){s=this.assign();for(var u=0;u<this.k;u++){for(var c=new Array(g),f=0,p=0;p<g;p++)c[p]=0;for(var d=0;d<e;d++){var g=this.dataset[d].length;if(u===this.assignments[d]){for(var p=0;p<g;p++)c[p]+=this.dataset[d][p];f++}}if(f>0){for(var p=0;p<g;p++)c[p]/=f;this.centroids[u]=c}else this.centroids[u]=this.randomCentroid(),s=!0}}return this.getClusters()};ba.prototype.randomCentroid=function(){var n=this.dataset.length-1,t,e;do e=Math.round(Math.random()*n),t=this.dataset[e];while(this.centroids.indexOf(t)>=0);return t};ba.prototype.assign=function(){for(var n=!1,t=this.dataset.length,e,i=0;i<t;i++)e=this.argmin(this.dataset[i],this.centroids,this.distance),e!=this.assignments[i]&&(this.assignments[i]=e,n=!0);return n};ba.prototype.getClusters=function(){for(var n=new Array(this.k),t,e=0;e<this.assignments.length;e++)t=this.assignments[e],typeof n[t]=="undefined"&&(n[t]=[]),n[t].push(e);return n};ba.prototype.argmin=function(n,t,e){for(var i=Number.MAX_VALUE,s=0,u=t.length,c,f=0;f<u;f++)c=e(n,t[f]),c<i&&(i=c,s=f);return s};ba.prototype.distance=function(n,t){for(var e=0,i=Math.min(n.length,t.length);i--;){var s=n[i]-t[i];e+=s*s}return Math.sqrt(e)};typeof ng!="undefined"&&ng.exports&&(ng.exports=ba)});var Lx=X((Rgt,rg)=>{function is(n,t,e){this._queue=[],this._priorities=[],this._sorting="desc",this._init(n,t,e)}is.prototype.insert=function(n,t){for(var e=this._queue.length,i=e;i--;){var s=this._priorities[i];this._sorting==="desc"?t>s&&(e=i):t<s&&(e=i)}this._insertAt(n,t,e)};is.prototype.remove=function(n){for(var t=this._queue.length;t--;){var e=this._queue[t];if(n===e){this._queue.splice(t,1),this._priorities.splice(t,1);break}}};is.prototype.forEach=function(n){this._queue.forEach(n)};is.prototype.getElements=function(){return this._queue};is.prototype.getElementPriority=function(n){return this._priorities[n]};is.prototype.getPriorities=function(){return this._priorities};is.prototype.getElementsWithPriorities=function(){for(var n=[],t=0,e=this._queue.length;t<e;t++)n.push([this._queue[t],this._priorities[t]]);return n};is.prototype._init=function(n,t,e){if(n&&t){if(this._queue=[],this._priorities=[],n.length!==t.length)throw new Error("Arrays must have the same length");for(var i=0;i<n.length;i++)this.insert(n[i],t[i])}e&&(this._sorting=e)};is.prototype._insertAt=function(n,t,e){this._queue.length===e?(this._queue.push(n),this._priorities.push(t)):(this._queue.splice(e,0,n),this._priorities.splice(e,0,t))};typeof rg!="undefined"&&rg.exports&&(rg.exports=is)});var S2=X((Lgt,Jl)=>{typeof Jl!="undefined"&&Jl.exports&&(E2=Lx());var E2;function Bs(n,t,e,i){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(n,t,e,i)}Bs.prototype.run=function(n,t,e,i){this._init(n,t,e,i);for(var s=0,u=this.dataset.length;s<u;s++)if(this._processed[s]!==1){this._processed[s]=1,this.clusters.push([s]);var c=this.clusters.length-1;this._orderedList.push(s);var f=new E2(null,null,"asc"),p=this._regionQuery(s);this._distanceToCore(s)!==void 0&&(this._updateQueue(s,p,f),this._expandCluster(c,f))}return this.clusters};Bs.prototype.getReachabilityPlot=function(){for(var n=[],t=0,e=this._orderedList.length;t<e;t++){var i=this._orderedList[t],s=this._reachability[i];n.push([i,s])}return n};Bs.prototype._init=function(n,t,e,i){if(n){if(!(n instanceof Array))throw Error("Dataset must be of type array, "+typeof n+" given");this.dataset=n,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}t&&(this.epsilon=t),e&&(this.minPts=e),i&&(this.distance=i)};Bs.prototype._updateQueue=function(n,t,e){var i=this;this._coreDistance=this._distanceToCore(n),t.forEach(function(s){if(i._processed[s]===void 0){var u=i.distance(i.dataset[n],i.dataset[s]),c=Math.max(i._coreDistance,u);i._reachability[s]===void 0?(i._reachability[s]=c,e.insert(s,c)):c<i._reachability[s]&&(i._reachability[s]=c,e.remove(s),e.insert(s,c))}})};Bs.prototype._expandCluster=function(n,t){for(var e=t.getElements(),i=0,s=e.length;i<s;i++){var u=e[i];if(this._processed[u]===void 0){var c=this._regionQuery(u);this._processed[u]=1,this.clusters[n].push(u),this._orderedList.push(u),this._distanceToCore(u)!==void 0&&(this._updateQueue(u,c,t),this._expandCluster(n,t))}}};Bs.prototype._distanceToCore=function(n){for(var t=this.epsilon,e=0;e<t;e++){var i=this._regionQuery(n,e);if(i.length>=this.minPts)return e}};Bs.prototype._regionQuery=function(n,t){t=t||this.epsilon;for(var e=[],i=0,s=this.dataset.length;i<s;i++)this.distance(this.dataset[n],this.dataset[i])<t&&e.push(i);return e};Bs.prototype._euclideanDistance=function(n,t){for(var e=0,i=Math.min(n.length,t.length);i--;)e+=(n[i]-t[i])*(n[i]-t[i]);return Math.sqrt(e)};typeof Jl!="undefined"&&Jl.exports&&(Jl.exports=Bs)});var w2=X((Ngt,ig)=>{typeof ig!="undefined"&&ig.exports&&(ig.exports={DBSCAN:_2(),KMEANS:x2(),OPTICS:S2(),PriorityQueue:Lx()})});var Nx=X((zgt,b2)=>{"use strict";b2.exports={eudist:function(t,e,i){for(var s=t.length,u=0,c=0;c<s;c++){var f=(t[c]||0)-(e[c]||0);u+=f*f}return i?Math.sqrt(u):u},mandist:function(t,e,i){for(var s=t.length,u=0,c=0;c<s;c++)u+=Math.abs((t[c]||0)-(e[c]||0));return i?Math.sqrt(u):u},dist:function(t,e,i){var s=Math.abs(t-e);return i?s:s*s}}});var C2=X((Ggt,T2)=>{"use strict";var A2=Nx(),EK=A2.eudist,SK=A2.dist;T2.exports={kmrand:function(t,e){for(var i={},s=[],u=e<<2,c=t.length,f=t[0].length>0;s.length<e&&u-- >0;){var p=t[Math.floor(Math.random()*c)],d=f?p.join("_"):""+p;i[d]||(i[d]=!0,s.push(p))}if(s.length<e)throw new Error("Error initializating clusters");return s},kmpp:function(t,e){var i=t[0].length?EK:SK,s=[],u=t.length,c=t[0].length>0,f={},p=t[Math.floor(Math.random()*u)],d=c?p.join("_"):""+p;for(s.push(p),f[d]=!0;s.length<e;){for(var g=[],y=s.length,v=0,E=[],M=0;M<u;M++){for(var A=1/0,_=0;_<y;_++){var x=i(t[M],s[_]);x<=A&&(A=x)}g[M]=A}for(var T=0;T<u;T++)v+=g[T];for(var w=0;w<u;w++)E[w]={i:w,v:t[w],pr:g[w]/v,cs:0};E.sort(function(D,P){return D.pr-P.pr}),E[0].cs=E[0].pr;for(var R=1;R<u;R++)E[R].cs=E[R-1].cs+E[R].pr;for(var B=Math.random(),U=0;U<u-1&&E[U++].cs<B;);s.push(E[U-1].v)}return s}}});var N2=X((Vgt,L2)=>{"use strict";var Ox=Nx(),R2=C2(),wK=Ox.eudist,kgt=Ox.mandist,qgt=Ox.dist,MK=R2.kmrand,bK=R2.kmpp,I2=1e4;function P2(n,t,e){e=e||[];for(var i=0;i<n;i++)e[i]=t;return e}function AK(n,t,e,i){var s=[],u=[],c=[],f=[],p=!1,d=i||I2,g=n.length,y=n[0].length,v=y>0,E=[];if(e)e=="kmrand"?s=MK(n,t):e=="kmpp"?s=bK(n,t):s=e;else for(var M={};s.length<t;){var A=Math.floor(Math.random()*g);M[A]||(M[A]=!0,s.push(n[A]))}do{P2(t,0,E);for(var _=0;_<g;_++){for(var x=1/0,T=0,w=0;w<t;w++){var f=v?wK(n[_],s[w]):Math.abs(n[_]-s[w]);f<=x&&(x=f,T=w)}c[_]=T,E[T]++}for(var R=[],u=[],B=0,U=0;U<t;U++)R[U]=v?P2(y,0,R[U]):0,u[U]=s[U];if(v){for(var D=0;D<t;D++)s[D]=[];for(var P=0;P<g;P++)for(var ct=c[P],L=R[ct],W=n[P],V=0;V<y;V++)L[V]+=W[V];p=!0;for(var Mt=0;Mt<t;Mt++){for(var $=s[Mt],gt=R[Mt],ft=u[Mt],vt=E[Mt],it=0;it<y;it++)$[it]=gt[it]/vt||0;if(p){for(var lt=0;lt<y;lt++)if(ft[lt]!=$[lt]){p=!1;break}}}}else{for(var H=0;H<g;H++){var At=c[H];R[At]+=n[H]}for(var It=0;It<t;It++)s[It]=R[It]/E[It]||0;p=!0;for(var jt=0;jt<t;jt++)if(u[jt]!=s[jt]){p=!1;break}}p=p||--d<=0}while(!p);return{it:I2-d,k:t,idxs:c,centroids:s}}L2.exports=AK});var ec=X((Gx,kx)=>{(function(n,t){typeof Gx=="object"&&typeof kx!="undefined"?kx.exports=t():typeof define=="function"&&define.amd?define(t):(n=typeof globalThis!="undefined"?globalThis:n||self,n.polygonClipping=t())})(Gx,function(){"use strict";function n(j,b){var I={label:0,sent:function(){if(G[0]&1)throw G[1];return G[1]},trys:[],ops:[]},F,k,G,rt;return rt={next:tt(0),throw:tt(1),return:tt(2)},typeof Symbol=="function"&&(rt[Symbol.iterator]=function(){return this}),rt;function tt(ht){return function(O){return pt([ht,O])}}function pt(ht){if(F)throw new TypeError("Generator is already executing.");for(;I;)try{if(F=1,k&&(G=ht[0]&2?k.return:ht[0]?k.throw||((G=k.return)&&G.call(k),0):k.next)&&!(G=G.call(k,ht[1])).done)return G;switch(k=0,G&&(ht=[ht[0]&2,G.value]),ht[0]){case 0:case 1:G=ht;break;case 4:return I.label++,{value:ht[1],done:!1};case 5:I.label++,k=ht[1],ht=[0];continue;case 7:ht=I.ops.pop(),I.trys.pop();continue;default:if(G=I.trys,!(G=G.length>0&&G[G.length-1])&&(ht[0]===6||ht[0]===2)){I=0;continue}if(ht[0]===3&&(!G||ht[1]>G[0]&&ht[1]<G[3])){I.label=ht[1];break}if(ht[0]===6&&I.label<G[1]){I.label=G[1],G=ht;break}if(G&&I.label<G[2]){I.label=G[2],I.ops.push(ht);break}G[2]&&I.ops.pop(),I.trys.pop();continue}ht=b.call(j,I)}catch(O){ht=[6,O],k=0}finally{F=G=0}if(ht[0]&5)throw ht[1];return{value:ht[0]?ht[1]:void 0,done:!0}}}var t=function(){function j(b,I){this.next=null,this.key=b,this.data=I,this.left=null,this.right=null}return j}();function e(j,b){return j>b?1:j<b?-1:0}function i(j,b,I){for(var F=new t(null,null),k=F,G=F;;){var rt=I(j,b.key);if(rt<0){if(b.left===null)break;if(I(j,b.left.key)<0){var tt=b.left;if(b.left=tt.right,tt.right=b,b=tt,b.left===null)break}G.left=b,G=b,b=b.left}else if(rt>0){if(b.right===null)break;if(I(j,b.right.key)>0){var tt=b.right;if(b.right=tt.left,tt.left=b,b=tt,b.right===null)break}k.right=b,k=b,b=b.right}else break}return k.right=b.left,G.left=b.right,b.left=F.right,b.right=F.left,b}function s(j,b,I,F){var k=new t(j,b);if(I===null)return k.left=k.right=null,k;I=i(j,I,F);var G=F(j,I.key);return G<0?(k.left=I.left,k.right=I,I.left=null):G>=0&&(k.right=I.right,k.left=I,I.right=null),k}function u(j,b,I){var F=null,k=null;if(b){b=i(j,b,I);var G=I(b.key,j);G===0?(F=b.left,k=b.right):G<0?(k=b.right,b.right=null,F=b):(F=b.left,b.left=null,k=b)}return{left:F,right:k}}function c(j,b,I){return b===null?j:(j===null||(b=i(j.key,b,I),b.left=j),b)}function f(j,b,I,F,k){if(j){F(""+b+(I?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+k(j)+\`
12207
12207
  \`);var G=b+(I?" ":"\\u2502 ");j.left&&f(j.left,G,!1,F,k),j.right&&f(j.right,G,!0,F,k)}}var p=function(){function j(b){b===void 0&&(b=e),this._root=null,this._size=0,this._comparator=b}return j.prototype.insert=function(b,I){return this._size++,this._root=s(b,I,this._root,this._comparator)},j.prototype.add=function(b,I){var F=new t(b,I);this._root===null&&(F.left=F.right=null,this._size++,this._root=F);var k=this._comparator,G=i(b,this._root,k),rt=k(b,G.key);return rt===0?this._root=G:(rt<0?(F.left=G.left,F.right=G,G.left=null):rt>0&&(F.right=G.right,F.left=G,G.right=null),this._size++,this._root=F),this._root},j.prototype.remove=function(b){this._root=this._remove(b,this._root,this._comparator)},j.prototype._remove=function(b,I,F){var k;if(I===null)return null;I=i(b,I,F);var G=F(b,I.key);return G===0?(I.left===null?k=I.right:(k=i(b,I.left,F),k.right=I.right),this._size--,k):I},j.prototype.pop=function(){var b=this._root;if(b){for(;b.left;)b=b.left;return this._root=i(b.key,this._root,this._comparator),this._root=this._remove(b.key,this._root,this._comparator),{key:b.key,data:b.data}}return null},j.prototype.findStatic=function(b){for(var I=this._root,F=this._comparator;I;){var k=F(b,I.key);if(k===0)return I;k<0?I=I.left:I=I.right}return null},j.prototype.find=function(b){return this._root&&(this._root=i(b,this._root,this._comparator),this._comparator(b,this._root.key)!==0)?null:this._root},j.prototype.contains=function(b){for(var I=this._root,F=this._comparator;I;){var k=F(b,I.key);if(k===0)return!0;k<0?I=I.left:I=I.right}return!1},j.prototype.forEach=function(b,I){for(var F=this._root,k=[],G=!1;!G;)F!==null?(k.push(F),F=F.left):k.length!==0?(F=k.pop(),b.call(I,F),F=F.right):G=!0;return this},j.prototype.range=function(b,I,F,k){for(var G=[],rt=this._comparator,tt=this._root,pt;G.length!==0||tt;)if(tt)G.push(tt),tt=tt.left;else{if(tt=G.pop(),pt=rt(tt.key,I),pt>0)break;if(rt(tt.key,b)>=0&&F.call(k,tt))return this;tt=tt.right}return this},j.prototype.keys=function(){var b=[];return this.forEach(function(I){var F=I.key;return b.push(F)}),b},j.prototype.values=function(){var b=[];return this.forEach(function(I){var F=I.data;return b.push(F)}),b},j.prototype.min=function(){return this._root?this.minNode(this._root).key:null},j.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},j.prototype.minNode=function(b){if(b===void 0&&(b=this._root),b)for(;b.left;)b=b.left;return b},j.prototype.maxNode=function(b){if(b===void 0&&(b=this._root),b)for(;b.right;)b=b.right;return b},j.prototype.at=function(b){for(var I=this._root,F=!1,k=0,G=[];!F;)if(I)G.push(I),I=I.left;else if(G.length>0){if(I=G.pop(),k===b)return I;k++,I=I.right}else F=!0;return null},j.prototype.next=function(b){var I=this._root,F=null;if(b.right){for(F=b.right;F.left;)F=F.left;return F}for(var k=this._comparator;I;){var G=k(b.key,I.key);if(G===0)break;G<0?(F=I,I=I.left):I=I.right}return F},j.prototype.prev=function(b){var I=this._root,F=null;if(b.left!==null){for(F=b.left;F.right;)F=F.right;return F}for(var k=this._comparator;I;){var G=k(b.key,I.key);if(G===0)break;G<0?I=I.left:(F=I,I=I.right)}return F},j.prototype.clear=function(){return this._root=null,this._size=0,this},j.prototype.toList=function(){return y(this._root)},j.prototype.load=function(b,I,F){I===void 0&&(I=[]),F===void 0&&(F=!1);var k=b.length,G=this._comparator;if(F&&M(b,I,0,k-1,G),this._root===null)this._root=d(b,I,0,k),this._size=k;else{var rt=E(this.toList(),g(b,I),G);k=this._size+k,this._root=v({head:rt},0,k)}return this},j.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(j.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),j.prototype.toString=function(b){b===void 0&&(b=function(F){return String(F.key)});var I=[];return f(this._root,"",!0,function(F){return I.push(F)},b),I.join("")},j.prototype.update=function(b,I,F){var k=this._comparator,G=u(b,this._root,k),rt=G.left,tt=G.right;k(b,I)<0?tt=s(I,F,tt,k):rt=s(I,F,rt,k),this._root=c(rt,tt,k)},j.prototype.split=function(b){return u(b,this._root,this._comparator)},j.prototype[Symbol.iterator]=function(){var b,I,F;return n(this,function(k){switch(k.label){case 0:b=this._root,I=[],F=!1,k.label=1;case 1:return F?[3,6]:b===null?[3,2]:(I.push(b),b=b.left,[3,5]);case 2:return I.length===0?[3,4]:(b=I.pop(),[4,b]);case 3:return k.sent(),b=b.right,[3,5];case 4:F=!0,k.label=5;case 5:return[3,1];case 6:return[2]}})},j}();function d(j,b,I,F){var k=F-I;if(k>0){var G=I+Math.floor(k/2),rt=j[G],tt=b[G],pt=new t(rt,tt);return pt.left=d(j,b,I,G),pt.right=d(j,b,G+1,F),pt}return null}function g(j,b){for(var I=new t(null,null),F=I,k=0;k<j.length;k++)F=F.next=new t(j[k],b[k]);return F.next=null,I.next}function y(j){for(var b=j,I=[],F=!1,k=new t(null,null),G=k;!F;)b?(I.push(b),b=b.left):I.length>0?(b=G=G.next=I.pop(),b=b.right):F=!0;return G.next=null,k.next}function v(j,b,I){var F=I-b;if(F>0){var k=b+Math.floor(F/2),G=v(j,b,k),rt=j.head;return rt.left=G,j.head=j.head.next,rt.right=v(j,k+1,I),rt}return null}function E(j,b,I){for(var F=new t(null,null),k=F,G=j,rt=b;G!==null&&rt!==null;)I(G.key,rt.key)<0?(k.next=G,G=G.next):(k.next=rt,rt=rt.next),k=k.next;return G!==null?k.next=G:rt!==null&&(k.next=rt),F.next}function M(j,b,I,F,k){if(!(I>=F)){for(var G=j[I+F>>1],rt=I-1,tt=F+1;;){do rt++;while(k(j[rt],G)<0);do tt--;while(k(j[tt],G)>0);if(rt>=tt)break;var pt=j[rt];j[rt]=j[tt],j[tt]=pt,pt=b[rt],b[rt]=b[tt],b[tt]=pt}M(j,b,I,tt,k),M(j,b,tt+1,F,k)}}let A=(j,b)=>j.ll.x<=b.x&&b.x<=j.ur.x&&j.ll.y<=b.y&&b.y<=j.ur.y,_=(j,b)=>{if(b.ur.x<j.ll.x||j.ur.x<b.ll.x||b.ur.y<j.ll.y||j.ur.y<b.ll.y)return null;let I=j.ll.x<b.ll.x?b.ll.x:j.ll.x,F=j.ur.x<b.ur.x?j.ur.x:b.ur.x,k=j.ll.y<b.ll.y?b.ll.y:j.ll.y,G=j.ur.y<b.ur.y?j.ur.y:b.ur.y;return{ll:{x:I,y:k},ur:{x:F,y:G}}},x=Number.EPSILON;x===void 0&&(x=Math.pow(2,-52));let T=x*x,w=(j,b)=>{if(-x<j&&j<x&&-x<b&&b<x)return 0;let I=j-b;return I*I<T*j*b?0:j<b?-1:1};class R{constructor(){this.reset()}reset(){this.xRounder=new B,this.yRounder=new B}round(b,I){return{x:this.xRounder.round(b),y:this.yRounder.round(I)}}}class B{constructor(){this.tree=new p,this.round(0)}round(b){let I=this.tree.add(b),F=this.tree.prev(I);if(F!==null&&w(I.key,F.key)===0)return this.tree.remove(b),F.key;let k=this.tree.next(I);return k!==null&&w(I.key,k.key)===0?(this.tree.remove(b),k.key):b}}let U=new R,D=11102230246251565e-32,P=134217729,ct=(3+8*D)*D;function L(j,b,I,F,k){let G,rt,tt,pt,ht=b[0],O=F[0],Q=0,J=0;O>ht==O>-ht?(G=ht,ht=b[++Q]):(G=O,O=F[++J]);let et=0;if(Q<j&&J<I)for(O>ht==O>-ht?(rt=ht+G,tt=G-(rt-ht),ht=b[++Q]):(rt=O+G,tt=G-(rt-O),O=F[++J]),G=rt,tt!==0&&(k[et++]=tt);Q<j&&J<I;)O>ht==O>-ht?(rt=G+ht,pt=rt-G,tt=G-(rt-pt)+(ht-pt),ht=b[++Q]):(rt=G+O,pt=rt-G,tt=G-(rt-pt)+(O-pt),O=F[++J]),G=rt,tt!==0&&(k[et++]=tt);for(;Q<j;)rt=G+ht,pt=rt-G,tt=G-(rt-pt)+(ht-pt),ht=b[++Q],G=rt,tt!==0&&(k[et++]=tt);for(;J<I;)rt=G+O,pt=rt-G,tt=G-(rt-pt)+(O-pt),O=F[++J],G=rt,tt!==0&&(k[et++]=tt);return(G!==0||et===0)&&(k[et++]=G),et}function W(j,b){let I=b[0];for(let F=1;F<j;F++)I+=b[F];return I}function V(j){return new Float64Array(j)}let Mt=(3+16*D)*D,$=(2+12*D)*D,gt=(9+64*D)*D*D,ft=V(4),vt=V(8),it=V(12),lt=V(16),H=V(4);function At(j,b,I,F,k,G,rt){let tt,pt,ht,O,Q,J,et,Tt,kt,ie,oe,we,ye,be,Ae,Un,dr,_n,pe=j-k,xn=I-k,Nn=b-G,Cn=F-G;be=pe*Cn,J=P*pe,et=J-(J-pe),Tt=pe-et,J=P*Cn,kt=J-(J-Cn),ie=Cn-kt,Ae=Tt*ie-(be-et*kt-Tt*kt-et*ie),Un=Nn*xn,J=P*Nn,et=J-(J-Nn),Tt=Nn-et,J=P*xn,kt=J-(J-xn),ie=xn-kt,dr=Tt*ie-(Un-et*kt-Tt*kt-et*ie),oe=Ae-dr,Q=Ae-oe,ft[0]=Ae-(oe+Q)+(Q-dr),we=be+oe,Q=we-be,ye=be-(we-Q)+(oe-Q),oe=ye-Un,Q=ye-oe,ft[1]=ye-(oe+Q)+(Q-Un),_n=we+oe,Q=_n-we,ft[2]=we-(_n-Q)+(oe-Q),ft[3]=_n;let En=W(4,ft),Kr=$*rt;if(En>=Kr||-En>=Kr||(Q=j-pe,tt=j-(pe+Q)+(Q-k),Q=I-xn,ht=I-(xn+Q)+(Q-k),Q=b-Nn,pt=b-(Nn+Q)+(Q-G),Q=F-Cn,O=F-(Cn+Q)+(Q-G),tt===0&&pt===0&&ht===0&&O===0)||(Kr=gt*rt+ct*Math.abs(En),En+=pe*O+Cn*tt-(Nn*ht+xn*pt),En>=Kr||-En>=Kr))return En;be=tt*Cn,J=P*tt,et=J-(J-tt),Tt=tt-et,J=P*Cn,kt=J-(J-Cn),ie=Cn-kt,Ae=Tt*ie-(be-et*kt-Tt*kt-et*ie),Un=pt*xn,J=P*pt,et=J-(J-pt),Tt=pt-et,J=P*xn,kt=J-(J-xn),ie=xn-kt,dr=Tt*ie-(Un-et*kt-Tt*kt-et*ie),oe=Ae-dr,Q=Ae-oe,H[0]=Ae-(oe+Q)+(Q-dr),we=be+oe,Q=we-be,ye=be-(we-Q)+(oe-Q),oe=ye-Un,Q=ye-oe,H[1]=ye-(oe+Q)+(Q-Un),_n=we+oe,Q=_n-we,H[2]=we-(_n-Q)+(oe-Q),H[3]=_n;let Ar=L(4,ft,4,H,vt);be=pe*O,J=P*pe,et=J-(J-pe),Tt=pe-et,J=P*O,kt=J-(J-O),ie=O-kt,Ae=Tt*ie-(be-et*kt-Tt*kt-et*ie),Un=Nn*ht,J=P*Nn,et=J-(J-Nn),Tt=Nn-et,J=P*ht,kt=J-(J-ht),ie=ht-kt,dr=Tt*ie-(Un-et*kt-Tt*kt-et*ie),oe=Ae-dr,Q=Ae-oe,H[0]=Ae-(oe+Q)+(Q-dr),we=be+oe,Q=we-be,ye=be-(we-Q)+(oe-Q),oe=ye-Un,Q=ye-oe,H[1]=ye-(oe+Q)+(Q-Un),_n=we+oe,Q=_n-we,H[2]=we-(_n-Q)+(oe-Q),H[3]=_n;let q=L(Ar,vt,4,H,it);be=tt*O,J=P*tt,et=J-(J-tt),Tt=tt-et,J=P*O,kt=J-(J-O),ie=O-kt,Ae=Tt*ie-(be-et*kt-Tt*kt-et*ie),Un=pt*ht,J=P*pt,et=J-(J-pt),Tt=pt-et,J=P*ht,kt=J-(J-ht),ie=ht-kt,dr=Tt*ie-(Un-et*kt-Tt*kt-et*ie),oe=Ae-dr,Q=Ae-oe,H[0]=Ae-(oe+Q)+(Q-dr),we=be+oe,Q=we-be,ye=be-(we-Q)+(oe-Q),oe=ye-Un,Q=ye-oe,H[1]=ye-(oe+Q)+(Q-Un),_n=we+oe,Q=_n-we,H[2]=we-(_n-Q)+(oe-Q),H[3]=_n;let at=L(q,it,4,H,lt);return lt[at-1]}function It(j,b,I,F,k,G){let rt=(b-G)*(I-k),tt=(j-k)*(F-G),pt=rt-tt,ht=Math.abs(rt+tt);return Math.abs(pt)>=Mt*ht?pt:-At(j,b,I,F,k,G,ht)}let jt=(j,b)=>j.x*b.y-j.y*b.x,nt=(j,b)=>j.x*b.x+j.y*b.y,bt=(j,b,I)=>{let F=It(j.x,j.y,b.x,b.y,I.x,I.y);return F>0?-1:F<0?1:0},Vt=j=>Math.sqrt(nt(j,j)),$t=(j,b,I)=>{let F={x:b.x-j.x,y:b.y-j.y},k={x:I.x-j.x,y:I.y-j.y};return jt(k,F)/Vt(k)/Vt(F)},Ut=(j,b,I)=>{let F={x:b.x-j.x,y:b.y-j.y},k={x:I.x-j.x,y:I.y-j.y};return nt(k,F)/Vt(k)/Vt(F)},Gt=(j,b,I)=>b.y===0?null:{x:j.x+b.x/b.y*(I-j.y),y:I},Ct=(j,b,I)=>b.x===0?null:{x:I,y:j.y+b.y/b.x*(I-j.x)},ee=(j,b,I,F)=>{if(b.x===0)return Ct(I,F,j.x);if(F.x===0)return Ct(j,b,I.x);if(b.y===0)return Gt(I,F,j.y);if(F.y===0)return Gt(j,b,I.y);let k=jt(b,F);if(k==0)return null;let G={x:I.x-j.x,y:I.y-j.y},rt=jt(G,b)/k,tt=jt(G,F)/k,pt=j.x+tt*b.x,ht=I.x+rt*F.x,O=j.y+tt*b.y,Q=I.y+rt*F.y,J=(pt+ht)/2,et=(O+Q)/2;return{x:J,y:et}};class Z{static compare(b,I){let F=Z.comparePoints(b.point,I.point);return F!==0?F:(b.point!==I.point&&b.link(I),b.isLeft!==I.isLeft?b.isLeft?1:-1:_t.compare(b.segment,I.segment))}static comparePoints(b,I){return b.x<I.x?-1:b.x>I.x?1:b.y<I.y?-1:b.y>I.y?1:0}constructor(b,I){b.events===void 0?b.events=[this]:b.events.push(this),this.point=b,this.isLeft=I}link(b){if(b.point===this.point)throw new Error("Tried to link already linked events");let I=b.point.events;for(let F=0,k=I.length;F<k;F++){let G=I[F];this.point.events.push(G),G.point=this.point}this.checkForConsuming()}checkForConsuming(){let b=this.point.events.length;for(let I=0;I<b;I++){let F=this.point.events[I];if(F.segment.consumedBy===void 0)for(let k=I+1;k<b;k++){let G=this.point.events[k];G.consumedBy===void 0&&F.otherSE.point.events===G.otherSE.point.events&&F.segment.consume(G.segment)}}}getAvailableLinkedEvents(){let b=[];for(let I=0,F=this.point.events.length;I<F;I++){let k=this.point.events[I];k!==this&&!k.segment.ringOut&&k.segment.isInResult()&&b.push(k)}return b}getLeftmostComparator(b){let I=new Map,F=k=>{let G=k.otherSE;I.set(k,{sine:$t(this.point,b.point,G.point),cosine:Ut(this.point,b.point,G.point)})};return(k,G)=>{I.has(k)||F(k),I.has(G)||F(G);let{sine:rt,cosine:tt}=I.get(k),{sine:pt,cosine:ht}=I.get(G);return rt>=0&&pt>=0?tt<ht?1:tt>ht?-1:0:rt<0&&pt<0?tt<ht?-1:tt>ht?1:0:pt<rt?-1:pt>rt?1:0}}}let Ot=0;class _t{static compare(b,I){let F=b.leftSE.point.x,k=I.leftSE.point.x,G=b.rightSE.point.x,rt=I.rightSE.point.x;if(rt<F)return 1;if(G<k)return-1;let tt=b.leftSE.point.y,pt=I.leftSE.point.y,ht=b.rightSE.point.y,O=I.rightSE.point.y;if(F<k){if(pt<tt&&pt<ht)return 1;if(pt>tt&&pt>ht)return-1;let Q=b.comparePoint(I.leftSE.point);if(Q<0)return 1;if(Q>0)return-1;let J=I.comparePoint(b.rightSE.point);return J!==0?J:-1}if(F>k){if(tt<pt&&tt<O)return-1;if(tt>pt&&tt>O)return 1;let Q=I.comparePoint(b.leftSE.point);if(Q!==0)return Q;let J=b.comparePoint(I.rightSE.point);return J<0?1:J>0?-1:1}if(tt<pt)return-1;if(tt>pt)return 1;if(G<rt){let Q=I.comparePoint(b.rightSE.point);if(Q!==0)return Q}if(G>rt){let Q=b.comparePoint(I.rightSE.point);if(Q<0)return 1;if(Q>0)return-1}if(G!==rt){let Q=ht-tt,J=G-F,et=O-pt,Tt=rt-k;if(Q>J&&et<Tt)return 1;if(Q<J&&et>Tt)return-1}return G>rt?1:G<rt||ht<O?-1:ht>O?1:b.id<I.id?-1:b.id>I.id?1:0}constructor(b,I,F,k){this.id=++Ot,this.leftSE=b,b.segment=this,b.otherSE=I,this.rightSE=I,I.segment=this,I.otherSE=b,this.rings=F,this.windings=k}static fromRing(b,I,F){let k,G,rt,tt=Z.comparePoints(b,I);if(tt<0)k=b,G=I,rt=1;else if(tt>0)k=I,G=b,rt=-1;else throw new Error(\`Tried to create degenerate segment at [\${b.x}, \${b.y}]\`);let pt=new Z(k,!0),ht=new Z(G,!1);return new _t(pt,ht,[F],[rt])}replaceRightSE(b){this.rightSE=b,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let b=this.leftSE.point.y,I=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:b<I?b:I},ur:{x:this.rightSE.point.x,y:b>I?b:I}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(b){return b.x===this.leftSE.point.x&&b.y===this.leftSE.point.y||b.x===this.rightSE.point.x&&b.y===this.rightSE.point.y}comparePoint(b){if(this.isAnEndpoint(b))return 0;let I=this.leftSE.point,F=this.rightSE.point,k=this.vector();if(I.x===F.x)return b.x===I.x?0:b.x<I.x?1:-1;let G=(b.y-I.y)/k.y,rt=I.x+G*k.x;if(b.x===rt)return 0;let tt=(b.x-I.x)/k.x,pt=I.y+tt*k.y;return b.y===pt?0:b.y<pt?-1:1}getIntersection(b){let I=this.bbox(),F=b.bbox(),k=_(I,F);if(k===null)return null;let G=this.leftSE.point,rt=this.rightSE.point,tt=b.leftSE.point,pt=b.rightSE.point,ht=A(I,tt)&&this.comparePoint(tt)===0,O=A(F,G)&&b.comparePoint(G)===0,Q=A(I,pt)&&this.comparePoint(pt)===0,J=A(F,rt)&&b.comparePoint(rt)===0;if(O&&ht)return J&&!Q?rt:!J&&Q?pt:null;if(O)return Q&&G.x===pt.x&&G.y===pt.y?null:G;if(ht)return J&&rt.x===tt.x&&rt.y===tt.y?null:tt;if(J&&Q)return null;if(J)return rt;if(Q)return pt;let et=ee(G,this.vector(),tt,b.vector());return et===null||!A(k,et)?null:U.round(et.x,et.y)}split(b){let I=[],F=b.events!==void 0,k=new Z(b,!0),G=new Z(b,!1),rt=this.rightSE;this.replaceRightSE(G),I.push(G),I.push(k);let tt=new _t(k,rt,this.rings.slice(),this.windings.slice());return Z.comparePoints(tt.leftSE.point,tt.rightSE.point)>0&&tt.swapEvents(),Z.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),F&&(k.checkForConsuming(),G.checkForConsuming()),I}swapEvents(){let b=this.rightSE;this.rightSE=this.leftSE,this.leftSE=b,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let I=0,F=this.windings.length;I<F;I++)this.windings[I]*=-1}consume(b){let I=this,F=b;for(;I.consumedBy;)I=I.consumedBy;for(;F.consumedBy;)F=F.consumedBy;let k=_t.compare(I,F);if(k!==0){if(k>0){let G=I;I=F,F=G}if(I.prev===F){let G=I;I=F,F=G}for(let G=0,rt=F.rings.length;G<rt;G++){let tt=F.rings[G],pt=F.windings[G],ht=I.rings.indexOf(tt);ht===-1?(I.rings.push(tt),I.windings.push(pt)):I.windings[ht]+=pt}F.rings=null,F.windings=null,F.consumedBy=I,F.leftSE.consumedBy=I.leftSE,F.rightSE.consumedBy=I.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let b=this.prev.consumedBy||this.prev;this._beforeState=b.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let b=this.beforeState();this._afterState={rings:b.rings.slice(0),windings:b.windings.slice(0),multiPolys:[]};let I=this._afterState.rings,F=this._afterState.windings,k=this._afterState.multiPolys;for(let tt=0,pt=this.rings.length;tt<pt;tt++){let ht=this.rings[tt],O=this.windings[tt],Q=I.indexOf(ht);Q===-1?(I.push(ht),F.push(O)):F[Q]+=O}let G=[],rt=[];for(let tt=0,pt=I.length;tt<pt;tt++){if(F[tt]===0)continue;let ht=I[tt],O=ht.poly;if(rt.indexOf(O)===-1)if(ht.isExterior)G.push(O);else{rt.indexOf(O)===-1&&rt.push(O);let Q=G.indexOf(ht.poly);Q!==-1&&G.splice(Q,1)}}for(let tt=0,pt=G.length;tt<pt;tt++){let ht=G[tt].multiPoly;k.indexOf(ht)===-1&&k.push(ht)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let b=this.beforeState().multiPolys,I=this.afterState().multiPolys;switch(ot.type){case"union":{let F=b.length===0,k=I.length===0;this._isInResult=F!==k;break}case"intersection":{let F,k;b.length<I.length?(F=b.length,k=I.length):(F=I.length,k=b.length),this._isInResult=k===ot.numMultiPolys&&F<k;break}case"xor":{let F=Math.abs(b.length-I.length);this._isInResult=F%2===1;break}case"difference":{let F=k=>k.length===1&&k[0].isSubject;this._isInResult=F(b)!==F(I);break}default:throw new Error(\`Unrecognized operation type found \${ot.type}\`)}return this._isInResult}}class Nt{constructor(b,I,F){if(!Array.isArray(b)||b.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=I,this.isExterior=F,this.segments=[],typeof b[0][0]!="number"||typeof b[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let k=U.round(b[0][0],b[0][1]);this.bbox={ll:{x:k.x,y:k.y},ur:{x:k.x,y:k.y}};let G=k;for(let rt=1,tt=b.length;rt<tt;rt++){if(typeof b[rt][0]!="number"||typeof b[rt][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let pt=U.round(b[rt][0],b[rt][1]);pt.x===G.x&&pt.y===G.y||(this.segments.push(_t.fromRing(G,pt,this)),pt.x<this.bbox.ll.x&&(this.bbox.ll.x=pt.x),pt.y<this.bbox.ll.y&&(this.bbox.ll.y=pt.y),pt.x>this.bbox.ur.x&&(this.bbox.ur.x=pt.x),pt.y>this.bbox.ur.y&&(this.bbox.ur.y=pt.y),G=pt)}(k.x!==G.x||k.y!==G.y)&&this.segments.push(_t.fromRing(G,k,this))}getSweepEvents(){let b=[];for(let I=0,F=this.segments.length;I<F;I++){let k=this.segments[I];b.push(k.leftSE),b.push(k.rightSE)}return b}}class wt{constructor(b,I){if(!Array.isArray(b))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Nt(b[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let F=1,k=b.length;F<k;F++){let G=new Nt(b[F],this,!1);G.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=G.bbox.ll.x),G.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=G.bbox.ll.y),G.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=G.bbox.ur.x),G.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=G.bbox.ur.y),this.interiorRings.push(G)}this.multiPoly=I}getSweepEvents(){let b=this.exteriorRing.getSweepEvents();for(let I=0,F=this.interiorRings.length;I<F;I++){let k=this.interiorRings[I].getSweepEvents();for(let G=0,rt=k.length;G<rt;G++)b.push(k[G])}return b}}class Ht{constructor(b,I){if(!Array.isArray(b))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof b[0][0][0]=="number"&&(b=[b])}catch(F){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let F=0,k=b.length;F<k;F++){let G=new wt(b[F],this);G.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=G.bbox.ll.x),G.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=G.bbox.ll.y),G.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=G.bbox.ur.x),G.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=G.bbox.ur.y),this.polys.push(G)}this.isSubject=I}getSweepEvents(){let b=[];for(let I=0,F=this.polys.length;I<F;I++){let k=this.polys[I].getSweepEvents();for(let G=0,rt=k.length;G<rt;G++)b.push(k[G])}return b}}class Xt{static factory(b){let I=[];for(let F=0,k=b.length;F<k;F++){let G=b[F];if(!G.isInResult()||G.ringOut)continue;let rt=null,tt=G.leftSE,pt=G.rightSE,ht=[tt],O=tt.point,Q=[];for(;rt=tt,tt=pt,ht.push(tt),tt.point!==O;)for(;;){let J=tt.getAvailableLinkedEvents();if(J.length===0){let kt=ht[0].point,ie=ht[ht.length-1].point;throw new Error(\`Unable to complete output ring starting at [\${kt.x}, \${kt.y}]. Last matching segment found ends at [\${ie.x}, \${ie.y}].\`)}if(J.length===1){pt=J[0].otherSE;break}let et=null;for(let kt=0,ie=Q.length;kt<ie;kt++)if(Q[kt].point===tt.point){et=kt;break}if(et!==null){let kt=Q.splice(et)[0],ie=ht.splice(kt.index);ie.unshift(ie[0].otherSE),I.push(new Xt(ie.reverse()));continue}Q.push({index:ht.length,point:tt.point});let Tt=tt.getLeftmostComparator(rt);pt=J.sort(Tt)[0].otherSE;break}I.push(new Xt(ht))}return I}constructor(b){this.events=b;for(let I=0,F=b.length;I<F;I++)b[I].segment.ringOut=this;this.poly=null}getGeom(){let b=this.events[0].point,I=[b];for(let ht=1,O=this.events.length-1;ht<O;ht++){let Q=this.events[ht].point,J=this.events[ht+1].point;bt(Q,b,J)!==0&&(I.push(Q),b=Q)}if(I.length===1)return null;let F=I[0],k=I[1];bt(F,b,k)===0&&I.shift(),I.push(I[0]);let G=this.isExteriorRing()?1:-1,rt=this.isExteriorRing()?0:I.length-1,tt=this.isExteriorRing()?I.length:-1,pt=[];for(let ht=rt;ht!=tt;ht+=G)pt.push([I[ht].x,I[ht].y]);return pt}isExteriorRing(){if(this._isExteriorRing===void 0){let b=this.enclosingRing();this._isExteriorRing=b?!b.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let b=this.events[0];for(let k=1,G=this.events.length;k<G;k++){let rt=this.events[k];Z.compare(b,rt)>0&&(b=rt)}let I=b.segment.prevInResult(),F=I?I.prevInResult():null;for(;;){if(!I)return null;if(!F)return I.ringOut;if(F.ringOut!==I.ringOut)return F.ringOut.enclosingRing()!==I.ringOut?I.ringOut:I.ringOut.enclosingRing();I=F.prevInResult(),F=I?I.prevInResult():null}}}class Pt{constructor(b){this.exteriorRing=b,b.poly=this,this.interiorRings=[]}addInterior(b){this.interiorRings.push(b),b.poly=this}getGeom(){let b=[this.exteriorRing.getGeom()];if(b[0]===null)return null;for(let I=0,F=this.interiorRings.length;I<F;I++){let k=this.interiorRings[I].getGeom();k!==null&&b.push(k)}return b}}class ne{constructor(b){this.rings=b,this.polys=this._composePolys(b)}getGeom(){let b=[];for(let I=0,F=this.polys.length;I<F;I++){let k=this.polys[I].getGeom();k!==null&&b.push(k)}return b}_composePolys(b){let I=[];for(let F=0,k=b.length;F<k;F++){let G=b[F];if(!G.poly)if(G.isExteriorRing())I.push(new Pt(G));else{let rt=G.enclosingRing();rt.poly||I.push(new Pt(rt)),rt.poly.addInterior(G)}}return I}}class Y{constructor(b){let I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_t.compare;this.queue=b,this.tree=new p(I),this.segments=[]}process(b){let I=b.segment,F=[];if(b.consumedBy)return b.isLeft?this.queue.remove(b.otherSE):this.tree.remove(I),F;let k=b.isLeft?this.tree.add(I):this.tree.find(I);if(!k)throw new Error(\`Unable to find segment #\${I.id} [\${I.leftSE.point.x}, \${I.leftSE.point.y}] -> [\${I.rightSE.point.x}, \${I.rightSE.point.y}] in SweepLine tree.\`);let G=k,rt=k,tt,pt;for(;tt===void 0;)G=this.tree.prev(G),G===null?tt=null:G.key.consumedBy===void 0&&(tt=G.key);for(;pt===void 0;)rt=this.tree.next(rt),rt===null?pt=null:rt.key.consumedBy===void 0&&(pt=rt.key);if(b.isLeft){let ht=null;if(tt){let Q=tt.getIntersection(I);if(Q!==null&&(I.isAnEndpoint(Q)||(ht=Q),!tt.isAnEndpoint(Q))){let J=this._splitSafely(tt,Q);for(let et=0,Tt=J.length;et<Tt;et++)F.push(J[et])}}let O=null;if(pt){let Q=pt.getIntersection(I);if(Q!==null&&(I.isAnEndpoint(Q)||(O=Q),!pt.isAnEndpoint(Q))){let J=this._splitSafely(pt,Q);for(let et=0,Tt=J.length;et<Tt;et++)F.push(J[et])}}if(ht!==null||O!==null){let Q=null;ht===null?Q=O:O===null?Q=ht:Q=Z.comparePoints(ht,O)<=0?ht:O,this.queue.remove(I.rightSE),F.push(I.rightSE);let J=I.split(Q);for(let et=0,Tt=J.length;et<Tt;et++)F.push(J[et])}F.length>0?(this.tree.remove(I),F.push(b)):(this.segments.push(I),I.prev=tt)}else{if(tt&&pt){let ht=tt.getIntersection(pt);if(ht!==null){if(!tt.isAnEndpoint(ht)){let O=this._splitSafely(tt,ht);for(let Q=0,J=O.length;Q<J;Q++)F.push(O[Q])}if(!pt.isAnEndpoint(ht)){let O=this._splitSafely(pt,ht);for(let Q=0,J=O.length;Q<J;Q++)F.push(O[Q])}}}this.tree.remove(I)}return F}_splitSafely(b,I){this.tree.remove(b);let F=b.rightSE;this.queue.remove(F);let k=b.split(I);return k.push(F),b.consumedBy===void 0&&this.tree.add(b),k}}let N=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,xt=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class St{run(b,I,F){ot.type=b,U.reset();let k=[new Ht(I,!0)];for(let Q=0,J=F.length;Q<J;Q++)k.push(new Ht(F[Q],!1));if(ot.numMultiPolys=k.length,ot.type==="difference"){let Q=k[0],J=1;for(;J<k.length;)_(k[J].bbox,Q.bbox)!==null?J++:k.splice(J,1)}if(ot.type==="intersection")for(let Q=0,J=k.length;Q<J;Q++){let et=k[Q];for(let Tt=Q+1,kt=k.length;Tt<kt;Tt++)if(_(et.bbox,k[Tt].bbox)===null)return[]}let G=new p(Z.compare);for(let Q=0,J=k.length;Q<J;Q++){let et=k[Q].getSweepEvents();for(let Tt=0,kt=et.length;Tt<kt;Tt++)if(G.insert(et[Tt]),G.size>N)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let rt=new Y(G),tt=G.size,pt=G.pop();for(;pt;){let Q=pt.key;if(G.size===tt){let et=Q.segment;throw new Error(\`Unable to pop() \${Q.isLeft?"left":"right"} SweepEvent [\${Q.point.x}, \${Q.point.y}] from segment #\${et.id} [\${et.leftSE.point.x}, \${et.leftSE.point.y}] -> [\${et.rightSE.point.x}, \${et.rightSE.point.y}] from queue.\`)}if(G.size>N)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(rt.segments.length>xt)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let J=rt.process(Q);for(let et=0,Tt=J.length;et<Tt;et++){let kt=J[et];kt.consumedBy===void 0&&G.insert(kt)}tt=G.size,pt=G.pop()}U.reset();let ht=Xt.factory(rt.segments);return new ne(ht).getGeom()}}let ot=new St;var Wt={union:function(j){for(var b=arguments.length,I=new Array(b>1?b-1:0),F=1;F<b;F++)I[F-1]=arguments[F];return ot.run("union",j,I)},intersection:function(j){for(var b=arguments.length,I=new Array(b>1?b-1:0),F=1;F<b;F++)I[F-1]=arguments[F];return ot.run("intersection",j,I)},xor:function(j){for(var b=arguments.length,I=new Array(b>1?b-1:0),F=1;F<b;F++)I[F-1]=arguments[F];return ot.run("xor",j,I)},difference:function(j){for(var b=arguments.length,I=new Array(b>1?b-1:0),F=1;F<b;F++)I[F-1]=arguments[F];return ot.run("difference",j,I)}};return Wt})});var K2=X((ug,j2)=>{(function(n,t){typeof ug=="object"&&typeof j2!="undefined"?t(ug):typeof define=="function"&&define.amd?define(["exports"],t):t(n.jsts={})})(ug,function(n){"use strict";function t(){}function e(r){this.message=r||""}function i(r){this.message=r||""}function s(r){this.message=r||""}function u(){}function c(r){return r===null?Ae:r.color}function f(r){return r===null?null:r.parent}function p(r,o){r!==null&&(r.color=o)}function d(r){return r===null?null:r.left}function g(r){return r===null?null:r.right}function y(){this.root_=null,this.size_=0}function v(){}function E(){this.array_=[],arguments[0]instanceof tt&&this.addAll(arguments[0])}function M(){}function A(r){this.message=r||""}function _(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(r){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var o=Object(this),a=Math.max(Math.min(o.length,9007199254740991),0)||0,l=1 in arguments&&parseInt(Number(arguments[1]),10)||0;l=l<0?Math.max(a+l,0):Math.min(l,a);var h=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:a;for(h=h<0?Math.max(a+arguments[2],0):Math.min(h,a);l<h;)o[l]=r,++l;return o},writable:!0}),Number.isFinite=Number.isFinite||function(r){return typeof r=="number"&&isFinite(r)},Number.isInteger=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(r){return r!=r},Math.trunc=Math.trunc||function(r){return r<0?Math.ceil(r):Math.floor(r)};var x=function(){};x.prototype.interfaces_=function(){return[]},x.prototype.getClass=function(){return x},x.prototype.equalsWithTolerance=function(r,o,a){return Math.abs(r-o)<=a};var T=function(r){function o(a){r.call(this,a),this.name="IllegalArgumentException",this.message=a,this.stack=new r().stack}return r&&(o.__proto__=r),o.prototype=Object.create(r&&r.prototype),o.prototype.constructor=o,o}(Error),w=function(){},R={MAX_VALUE:{configurable:!0}};w.isNaN=function(r){return Number.isNaN(r)},w.doubleToLongBits=function(r){return r},w.longBitsToDouble=function(r){return r},w.isInfinite=function(r){return!Number.isFinite(r)},R.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(w,R);var B=function(){},U=function(){},D=function(){},P=function r(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=r.NULL_ORDINATE;else if(arguments.length===1){var o=arguments[0];this.x=o.x,this.y=o.y,this.z=o.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=r.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},ct={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};P.prototype.setOrdinate=function(r,o){switch(r){case P.X:this.x=o;break;case P.Y:this.y=o;break;case P.Z:this.z=o;break;default:throw new T("Invalid ordinate index: "+r)}},P.prototype.equals2D=function(){if(arguments.length===1){var r=arguments[0];return this.x===r.x&&this.y===r.y}if(arguments.length===2){var o=arguments[0],a=arguments[1];return!!x.equalsWithTolerance(this.x,o.x,a)&&!!x.equalsWithTolerance(this.y,o.y,a)}},P.prototype.getOrdinate=function(r){switch(r){case P.X:return this.x;case P.Y:return this.y;case P.Z:return this.z}throw new T("Invalid ordinate index: "+r)},P.prototype.equals3D=function(r){return this.x===r.x&&this.y===r.y&&(this.z===r.z||w.isNaN(this.z))&&w.isNaN(r.z)},P.prototype.equals=function(r){return r instanceof P&&this.equals2D(r)},P.prototype.equalInZ=function(r,o){return x.equalsWithTolerance(this.z,r.z,o)},P.prototype.compareTo=function(r){var o=r;return this.x<o.x?-1:this.x>o.x?1:this.y<o.y?-1:this.y>o.y?1:0},P.prototype.clone=function(){},P.prototype.copy=function(){return new P(this)},P.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},P.prototype.distance3D=function(r){var o=this.x-r.x,a=this.y-r.y,l=this.z-r.z;return Math.sqrt(o*o+a*a+l*l)},P.prototype.distance=function(r){var o=this.x-r.x,a=this.y-r.y;return Math.sqrt(o*o+a*a)},P.prototype.hashCode=function(){var r=17;return r=37*r+P.hashCode(this.x),r=37*r+P.hashCode(this.y)},P.prototype.setCoordinate=function(r){this.x=r.x,this.y=r.y,this.z=r.z},P.prototype.interfaces_=function(){return[B,U,t]},P.prototype.getClass=function(){return P},P.hashCode=function(){if(arguments.length===1){var r=arguments[0],o=w.doubleToLongBits(r);return Math.trunc((o^o)>>>32)}},ct.DimensionalComparator.get=function(){return L},ct.serialVersionUID.get=function(){return 6683108902428367e3},ct.NULL_ORDINATE.get=function(){return w.NaN},ct.X.get=function(){return 0},ct.Y.get=function(){return 1},ct.Z.get=function(){return 2},Object.defineProperties(P,ct);var L=function(r){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var o=arguments[0];if(o!==2&&o!==3)throw new T("only 2 or 3 dimensions may be specified");this._dimensionsToTest=o}}};L.prototype.compare=function(r,o){var a=r,l=o,h=L.compare(a.x,l.x);if(h!==0)return h;var m=L.compare(a.y,l.y);return m!==0?m:this._dimensionsToTest<=2?0:L.compare(a.z,l.z)},L.prototype.interfaces_=function(){return[D]},L.prototype.getClass=function(){return L},L.compare=function(r,o){return r<o?-1:r>o?1:w.isNaN(r)?w.isNaN(o)?0:-1:w.isNaN(o)?1:0};var W=function(){};W.prototype.create=function(){},W.prototype.interfaces_=function(){return[]},W.prototype.getClass=function(){return W};var V=function(){},Mt={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};V.prototype.interfaces_=function(){return[]},V.prototype.getClass=function(){return V},V.toLocationSymbol=function(r){switch(r){case V.EXTERIOR:return"e";case V.BOUNDARY:return"b";case V.INTERIOR:return"i";case V.NONE:return"-"}throw new T("Unknown location value: "+r)},Mt.INTERIOR.get=function(){return 0},Mt.BOUNDARY.get=function(){return 1},Mt.EXTERIOR.get=function(){return 2},Mt.NONE.get=function(){return-1},Object.defineProperties(V,Mt);var $=function(r,o){return r.interfaces_&&r.interfaces_().indexOf(o)>-1},gt=function(){},ft={LOG_10:{configurable:!0}};gt.prototype.interfaces_=function(){return[]},gt.prototype.getClass=function(){return gt},gt.log10=function(r){var o=Math.log(r);return w.isInfinite(o)||w.isNaN(o)?o:o/gt.LOG_10},gt.min=function(r,o,a,l){var h=r;return o<h&&(h=o),a<h&&(h=a),l<h&&(h=l),h},gt.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var r=arguments[0],o=arguments[1],a=arguments[2];return r<o?o:r>a?a:r}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var l=arguments[0],h=arguments[1],m=arguments[2];return l<h?h:l>m?m:l}},gt.wrap=function(r,o){return r<0?o- -r%o:r%o},gt.max=function(){if(arguments.length===3){var r=arguments[0],o=arguments[1],a=arguments[2],l=r;return o>l&&(l=o),a>l&&(l=a),l}if(arguments.length===4){var h=arguments[0],m=arguments[1],S=arguments[2],C=arguments[3],z=h;return m>z&&(z=m),S>z&&(z=S),C>z&&(z=C),z}},gt.average=function(r,o){return(r+o)/2},ft.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(gt,ft);var vt=function(r){this.str=r};vt.prototype.append=function(r){this.str+=r},vt.prototype.setCharAt=function(r,o){this.str=this.str.substr(0,r)+o+this.str.substr(r+1)},vt.prototype.toString=function(r){return this.str};var it=function(r){this.value=r};it.prototype.intValue=function(){return this.value},it.prototype.compareTo=function(r){return this.value<r?-1:this.value>r?1:0},it.isNaN=function(r){return Number.isNaN(r)};var lt=function(){};lt.isWhitespace=function(r){return r<=32&&r>=0||r===127},lt.toUpperCase=function(r){return r.toUpperCase()};var H=function r(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var o=arguments[0];this.init(o)}else if(arguments[0]instanceof r){var a=arguments[0];this.init(a)}else if(typeof arguments[0]=="string"){var l=arguments[0];r.call(this,r.parse(l))}}else if(arguments.length===2){var h=arguments[0],m=arguments[1];this.init(h,m)}},At={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};H.prototype.le=function(r){return(this._hi<r._hi||this._hi===r._hi)&&this._lo<=r._lo},H.prototype.extractSignificantDigits=function(r,o){var a=this.abs(),l=H.magnitude(a._hi),h=H.TEN.pow(l);(a=a.divide(h)).gt(H.TEN)?(a=a.divide(H.TEN),l+=1):a.lt(H.ONE)&&(a=a.multiply(H.TEN),l-=1);for(var m=l+1,S=new vt,C=H.MAX_PRINT_DIGITS-1,z=0;z<=C;z++){r&&z===m&&S.append(".");var K=Math.trunc(a._hi);if(K<0)break;var mt=!1,yt=0;K>9?(mt=!0,yt="9"):yt="0"+K,S.append(yt),a=a.subtract(H.valueOf(K)).multiply(H.TEN),mt&&a.selfAdd(H.TEN);var zt=!0,qt=H.magnitude(a._hi);if(qt<0&&Math.abs(qt)>=C-z&&(zt=!1),!zt)break}return o[0]=l,S.toString()},H.prototype.sqr=function(){return this.multiply(this)},H.prototype.doubleValue=function(){return this._hi+this._lo},H.prototype.subtract=function(){if(arguments[0]instanceof H){var r=arguments[0];return this.add(r.negate())}if(typeof arguments[0]=="number"){var o=arguments[0];return this.add(-o)}},H.prototype.equals=function(){if(arguments.length===1){var r=arguments[0];return this._hi===r._hi&&this._lo===r._lo}},H.prototype.isZero=function(){return this._hi===0&&this._lo===0},H.prototype.selfSubtract=function(){if(arguments[0]instanceof H){var r=arguments[0];return this.isNaN()?this:this.selfAdd(-r._hi,-r._lo)}if(typeof arguments[0]=="number"){var o=arguments[0];return this.isNaN()?this:this.selfAdd(-o,0)}},H.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},H.prototype.min=function(r){return this.le(r)?this:r},H.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof H){var r=arguments[0];return this.selfDivide(r._hi,r._lo)}if(typeof arguments[0]=="number"){var o=arguments[0];return this.selfDivide(o,0)}}else if(arguments.length===2){var a=arguments[0],l=arguments[1],h=null,m=null,S=null,C=null,z=null,K=null,mt=null,yt=null;return z=this._hi/a,K=H.SPLIT*z,h=K-z,yt=H.SPLIT*a,h=K-h,m=z-h,S=yt-a,mt=z*a,S=yt-S,C=a-S,yt=h*S-mt+h*C+m*S+m*C,K=(this._hi-mt-yt+this._lo-z*l)/a,yt=z+K,this._hi=yt,this._lo=z-yt+K,this}},H.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},H.prototype.divide=function(){if(arguments[0]instanceof H){var r=arguments[0],o=null,a=null,l=null,h=null,m=null,S=null,C=null,z=null;return a=(m=this._hi/r._hi)-(o=(S=H.SPLIT*m)-(o=S-m)),z=o*(l=(z=H.SPLIT*r._hi)-(l=z-r._hi))-(C=m*r._hi)+o*(h=r._hi-l)+a*l+a*h,S=(this._hi-C-z+this._lo-m*r._lo)/r._hi,new H(z=m+S,m-z+S)}if(typeof arguments[0]=="number"){var K=arguments[0];return w.isNaN(K)?H.createNaN():H.copy(this).selfDivide(K,0)}},H.prototype.ge=function(r){return(this._hi>r._hi||this._hi===r._hi)&&this._lo>=r._lo},H.prototype.pow=function(r){if(r===0)return H.valueOf(1);var o=new H(this),a=H.valueOf(1),l=Math.abs(r);if(l>1)for(;l>0;)l%2==1&&a.selfMultiply(o),(l/=2)>0&&(o=o.sqr());else a=o;return r<0?a.reciprocal():a},H.prototype.ceil=function(){if(this.isNaN())return H.NaN;var r=Math.ceil(this._hi),o=0;return r===this._hi&&(o=Math.ceil(this._lo)),new H(r,o)},H.prototype.compareTo=function(r){var o=r;return this._hi<o._hi?-1:this._hi>o._hi?1:this._lo<o._lo?-1:this._lo>o._lo?1:0},H.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},H.prototype.setValue=function(){if(arguments[0]instanceof H){var r=arguments[0];return this.init(r),this}if(typeof arguments[0]=="number"){var o=arguments[0];return this.init(o),this}},H.prototype.max=function(r){return this.ge(r)?this:r},H.prototype.sqrt=function(){if(this.isZero())return H.valueOf(0);if(this.isNegative())return H.NaN;var r=1/Math.sqrt(this._hi),o=this._hi*r,a=H.valueOf(o),l=this.subtract(a.sqr())._hi*(.5*r);return a.add(l)},H.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof H){var r=arguments[0];return this.selfAdd(r._hi,r._lo)}if(typeof arguments[0]=="number"){var o=arguments[0],a=null,l=null,h=null,m=null,S=null,C=null;return h=this._hi+o,S=h-this._hi,m=h-S,m=o-S+(this._hi-m),C=m+this._lo,a=h+C,l=C+(h-a),this._hi=a+l,this._lo=l+(a-this._hi),this}}else if(arguments.length===2){var z=arguments[0],K=arguments[1],mt=null,yt=null,zt=null,qt=null,Jt=null,ue=null,dn=null;qt=this._hi+z,yt=this._lo+K,Jt=qt-(ue=qt-this._hi),zt=yt-(dn=yt-this._lo);var Wn=(mt=qt+(ue=(Jt=z-ue+(this._hi-Jt))+yt))+(ue=(zt=K-dn+(this._lo-zt))+(ue+(qt-mt))),Dr=ue+(mt-Wn);return this._hi=Wn,this._lo=Dr,this}},H.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof H){var r=arguments[0];return this.selfMultiply(r._hi,r._lo)}if(typeof arguments[0]=="number"){var o=arguments[0];return this.selfMultiply(o,0)}}else if(arguments.length===2){var a=arguments[0],l=arguments[1],h=null,m=null,S=null,C=null,z=null,K=null;h=(z=H.SPLIT*this._hi)-this._hi,K=H.SPLIT*a,h=z-h,m=this._hi-h,S=K-a;var mt=(z=this._hi*a)+(K=h*(S=K-S)-z+h*(C=a-S)+m*S+m*C+(this._hi*l+this._lo*a)),yt=K+(h=z-mt);return this._hi=mt,this._lo=yt,this}},H.prototype.selfSqr=function(){return this.selfMultiply(this)},H.prototype.floor=function(){if(this.isNaN())return H.NaN;var r=Math.floor(this._hi),o=0;return r===this._hi&&(o=Math.floor(this._lo)),new H(r,o)},H.prototype.negate=function(){return this.isNaN()?this:new H(-this._hi,-this._lo)},H.prototype.clone=function(){},H.prototype.multiply=function(){if(arguments[0]instanceof H){var r=arguments[0];return r.isNaN()?H.createNaN():H.copy(this).selfMultiply(r)}if(typeof arguments[0]=="number"){var o=arguments[0];return w.isNaN(o)?H.createNaN():H.copy(this).selfMultiply(o,0)}},H.prototype.isNaN=function(){return w.isNaN(this._hi)},H.prototype.intValue=function(){return Math.trunc(this._hi)},H.prototype.toString=function(){var r=H.magnitude(this._hi);return r>=-3&&r<=20?this.toStandardNotation():this.toSciNotation()},H.prototype.toStandardNotation=function(){var r=this.getSpecialNumberString();if(r!==null)return r;var o=new Array(1).fill(null),a=this.extractSignificantDigits(!0,o),l=o[0]+1,h=a;if(a.charAt(0)===".")h="0"+a;else if(l<0)h="0."+H.stringOfChar("0",-l)+a;else if(a.indexOf(".")===-1){var m=l-a.length;h=a+H.stringOfChar("0",m)+".0"}return this.isNegative()?"-"+h:h},H.prototype.reciprocal=function(){var r=null,o=null,a=null,l=null,h=null,m=null,S=null,C=null;o=(h=1/this._hi)-(r=(m=H.SPLIT*h)-(r=m-h)),a=(C=H.SPLIT*this._hi)-this._hi;var z=h+(m=(1-(S=h*this._hi)-(C=r*(a=C-a)-S+r*(l=this._hi-a)+o*a+o*l)-h*this._lo)/this._hi);return new H(z,h-z+m)},H.prototype.toSciNotation=function(){if(this.isZero())return H.SCI_NOT_ZERO;var r=this.getSpecialNumberString();if(r!==null)return r;var o=new Array(1).fill(null),a=this.extractSignificantDigits(!1,o),l=H.SCI_NOT_EXPONENT_CHAR+o[0];if(a.charAt(0)==="0")throw new Error("Found leading zero: "+a);var h="";a.length>1&&(h=a.substring(1));var m=a.charAt(0)+"."+h;return this.isNegative()?"-"+m+l:m+l},H.prototype.abs=function(){return this.isNaN()?H.NaN:this.isNegative()?this.negate():new H(this)},H.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},H.prototype.lt=function(r){return(this._hi<r._hi||this._hi===r._hi)&&this._lo<r._lo},H.prototype.add=function(){if(arguments[0]instanceof H){var r=arguments[0];return H.copy(this).selfAdd(r)}if(typeof arguments[0]=="number"){var o=arguments[0];return H.copy(this).selfAdd(o)}},H.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var r=arguments[0];this._hi=r,this._lo=0}else if(arguments[0]instanceof H){var o=arguments[0];this._hi=o._hi,this._lo=o._lo}}else if(arguments.length===2){var a=arguments[0],l=arguments[1];this._hi=a,this._lo=l}},H.prototype.gt=function(r){return(this._hi>r._hi||this._hi===r._hi)&&this._lo>r._lo},H.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},H.prototype.trunc=function(){return this.isNaN()?H.NaN:this.isPositive()?this.floor():this.ceil()},H.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},H.prototype.interfaces_=function(){return[t,B,U]},H.prototype.getClass=function(){return H},H.sqr=function(r){return H.valueOf(r).selfMultiply(r)},H.valueOf=function(){if(typeof arguments[0]=="string"){var r=arguments[0];return H.parse(r)}if(typeof arguments[0]=="number"){var o=arguments[0];return new H(o)}},H.sqrt=function(r){return H.valueOf(r).sqrt()},H.parse=function(r){for(var o=0,a=r.length;lt.isWhitespace(r.charAt(o));)o++;var l=!1;if(o<a){var h=r.charAt(o);h!=="-"&&h!=="+"||(o++,h==="-"&&(l=!0))}for(var m=new H,S=0,C=0,z=0;!(o>=a);){var K=r.charAt(o);if(o++,lt.isDigit(K)){var mt=K-"0";m.selfMultiply(H.TEN),m.selfAdd(mt),S++}else{if(K!=="."){if(K==="e"||K==="E"){var yt=r.substring(o);try{z=it.parseInt(yt)}catch(dn){throw dn instanceof Error?new Error("Invalid exponent "+yt+" in string "+r):dn}break}throw new Error("Unexpected character '"+K+"' at position "+o+" in string "+r)}C=S}}var zt=m,qt=S-C-z;if(qt===0)zt=m;else if(qt>0){var Jt=H.TEN.pow(qt);zt=m.divide(Jt)}else if(qt<0){var ue=H.TEN.pow(-qt);zt=m.multiply(ue)}return l?zt.negate():zt},H.createNaN=function(){return new H(w.NaN,w.NaN)},H.copy=function(r){return new H(r)},H.magnitude=function(r){var o=Math.abs(r),a=Math.log(o)/Math.log(10),l=Math.trunc(Math.floor(a));return 10*Math.pow(10,l)<=o&&(l+=1),l},H.stringOfChar=function(r,o){for(var a=new vt,l=0;l<o;l++)a.append(r);return a.toString()},At.PI.get=function(){return new H(3.141592653589793,12246467991473532e-32)},At.TWO_PI.get=function(){return new H(6.283185307179586,24492935982947064e-32)},At.PI_2.get=function(){return new H(1.5707963267948966,6123233995736766e-32)},At.E.get=function(){return new H(2.718281828459045,14456468917292502e-32)},At.NaN.get=function(){return new H(w.NaN,w.NaN)},At.EPS.get=function(){return 123259516440783e-46},At.SPLIT.get=function(){return 134217729},At.MAX_PRINT_DIGITS.get=function(){return 32},At.TEN.get=function(){return H.valueOf(10)},At.ONE.get=function(){return H.valueOf(1)},At.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},At.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(H,At);var It=function(){},jt={DP_SAFE_EPSILON:{configurable:!0}};It.prototype.interfaces_=function(){return[]},It.prototype.getClass=function(){return It},It.orientationIndex=function(r,o,a){var l=It.orientationIndexFilter(r,o,a);if(l<=1)return l;var h=H.valueOf(o.x).selfAdd(-r.x),m=H.valueOf(o.y).selfAdd(-r.y),S=H.valueOf(a.x).selfAdd(-o.x),C=H.valueOf(a.y).selfAdd(-o.y);return h.selfMultiply(C).selfSubtract(m.selfMultiply(S)).signum()},It.signOfDet2x2=function(r,o,a,l){return r.multiply(l).selfSubtract(o.multiply(a)).signum()},It.intersection=function(r,o,a,l){var h=H.valueOf(l.y).selfSubtract(a.y).selfMultiply(H.valueOf(o.x).selfSubtract(r.x)),m=H.valueOf(l.x).selfSubtract(a.x).selfMultiply(H.valueOf(o.y).selfSubtract(r.y)),S=h.subtract(m),C=H.valueOf(l.x).selfSubtract(a.x).selfMultiply(H.valueOf(r.y).selfSubtract(a.y)),z=H.valueOf(l.y).selfSubtract(a.y).selfMultiply(H.valueOf(r.x).selfSubtract(a.x)),K=C.subtract(z).selfDivide(S).doubleValue(),mt=H.valueOf(r.x).selfAdd(H.valueOf(o.x).selfSubtract(r.x).selfMultiply(K)).doubleValue(),yt=H.valueOf(o.x).selfSubtract(r.x).selfMultiply(H.valueOf(r.y).selfSubtract(a.y)),zt=H.valueOf(o.y).selfSubtract(r.y).selfMultiply(H.valueOf(r.x).selfSubtract(a.x)),qt=yt.subtract(zt).selfDivide(S).doubleValue(),Jt=H.valueOf(a.y).selfAdd(H.valueOf(l.y).selfSubtract(a.y).selfMultiply(qt)).doubleValue();return new P(mt,Jt)},It.orientationIndexFilter=function(r,o,a){var l=null,h=(r.x-a.x)*(o.y-a.y),m=(r.y-a.y)*(o.x-a.x),S=h-m;if(h>0){if(m<=0)return It.signum(S);l=h+m}else{if(!(h<0)||m>=0)return It.signum(S);l=-h-m}var C=It.DP_SAFE_EPSILON*l;return S>=C||-S>=C?It.signum(S):2},It.signum=function(r){return r>0?1:r<0?-1:0},jt.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(It,jt);var nt=function(){},bt={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};bt.X.get=function(){return 0},bt.Y.get=function(){return 1},bt.Z.get=function(){return 2},bt.M.get=function(){return 3},nt.prototype.setOrdinate=function(r,o,a){},nt.prototype.size=function(){},nt.prototype.getOrdinate=function(r,o){},nt.prototype.getCoordinate=function(){},nt.prototype.getCoordinateCopy=function(r){},nt.prototype.getDimension=function(){},nt.prototype.getX=function(r){},nt.prototype.clone=function(){},nt.prototype.expandEnvelope=function(r){},nt.prototype.copy=function(){},nt.prototype.getY=function(r){},nt.prototype.toCoordinateArray=function(){},nt.prototype.interfaces_=function(){return[U]},nt.prototype.getClass=function(){return nt},Object.defineProperties(nt,bt);var Vt=function(){},$t=function(r){function o(){r.call(this,"Projective point not representable on the Cartesian plane.")}return r&&(o.__proto__=r),o.prototype=Object.create(r&&r.prototype),o.prototype.constructor=o,o.prototype.interfaces_=function(){return[]},o.prototype.getClass=function(){return o},o}(Vt),Ut=function(){};Ut.arraycopy=function(r,o,a,l,h){for(var m=0,S=o;S<o+h;S++)a[l+m]=r[S],m++},Ut.getProperty=function(r){return{"line.separator":\`
@@ -16007,7 +16007,7 @@ void main() {
16007
16007
 
16008
16008
  }\`,xv=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,i){if(this.texture===null){let s=new uo,u=t.properties.get(s);u.__webglTexture=e.texture,(e.depthNear!=i.depthNear||e.depthFar!=i.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=s}}render(t,e){if(this.texture!==null){if(this.mesh===null){let i=e.cameras[0].viewport,s=new Qo({extensions:{fragDepth:!0},vertexShader:L7,fragmentShader:N7,uniforms:{depthColor:{value:this.texture},depthWidth:{value:i.z},depthHeight:{value:i.w}}});this.mesh=new Lo(new Jp(20,20),s)}t.render(this.mesh,e)}}reset(){this.texture=null,this.mesh=null}},Ev=class extends _a{constructor(t,e){super();let i=this,s=null,u=1,c=null,f="local-floor",p=1,d=null,g=null,y=null,v=null,E=null,M=null,A=new xv,_=e.getContextAttributes(),x=null,T=null,w=[],R=[],B=new Ft,U=null,D=new Zi;D.layers.enable(1),D.viewport=new Yr;let P=new Zi;P.layers.enable(2),P.viewport=new Yr;let ct=[D,P],L=new _v;L.layers.enable(1),L.layers.enable(2);let W=null,V=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(nt){let bt=w[nt];return bt===void 0&&(bt=new rf,w[nt]=bt),bt.getTargetRaySpace()},this.getControllerGrip=function(nt){let bt=w[nt];return bt===void 0&&(bt=new rf,w[nt]=bt),bt.getGripSpace()},this.getHand=function(nt){let bt=w[nt];return bt===void 0&&(bt=new rf,w[nt]=bt),bt.getHandSpace()};function Mt(nt){let bt=R.indexOf(nt.inputSource);if(bt===-1)return;let Vt=w[bt];Vt!==void 0&&(Vt.update(nt.inputSource,nt.frame,d||c),Vt.dispatchEvent({type:nt.type,data:nt.inputSource}))}function $(){s.removeEventListener("select",Mt),s.removeEventListener("selectstart",Mt),s.removeEventListener("selectend",Mt),s.removeEventListener("squeeze",Mt),s.removeEventListener("squeezestart",Mt),s.removeEventListener("squeezeend",Mt),s.removeEventListener("end",$),s.removeEventListener("inputsourceschange",gt);for(let nt=0;nt<w.length;nt++){let bt=R[nt];bt!==null&&(R[nt]=null,w[nt].disconnect(bt))}W=null,V=null,A.reset(),t.setRenderTarget(x),E=null,v=null,y=null,s=null,T=null,jt.stop(),i.isPresenting=!1,t.setPixelRatio(U),t.setSize(B.width,B.height,!1),i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(nt){u=nt,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(nt){f=nt,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return d||c},this.setReferenceSpace=function(nt){d=nt},this.getBaseLayer=function(){return v!==null?v:E},this.getBinding=function(){return y},this.getFrame=function(){return M},this.getSession=function(){return s},this.setSession=function(nt){return Ri(this,null,function*(){if(s=nt,s!==null){if(x=t.getRenderTarget(),s.addEventListener("select",Mt),s.addEventListener("selectstart",Mt),s.addEventListener("selectend",Mt),s.addEventListener("squeeze",Mt),s.addEventListener("squeezestart",Mt),s.addEventListener("squeezeend",Mt),s.addEventListener("end",$),s.addEventListener("inputsourceschange",gt),_.xrCompatible!==!0&&(yield e.makeXRCompatible()),U=t.getPixelRatio(),t.getSize(B),s.renderState.layers===void 0||t.capabilities.isWebGL2===!1){let bt={antialias:s.renderState.layers===void 0?_.antialias:!0,alpha:!0,depth:_.depth,stencil:_.stencil,framebufferScaleFactor:u};E=new XRWebGLLayer(s,e,bt),s.updateRenderState({baseLayer:E}),t.setPixelRatio(1),t.setSize(E.framebufferWidth,E.framebufferHeight,!1),T=new Us(E.framebufferWidth,E.framebufferHeight,{format:Ro,type:ma,colorSpace:t.outputColorSpace,stencilBuffer:_.stencil})}else{let bt=null,Vt=null,$t=null;_.depth&&($t=_.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,bt=_.stencil?Al:au,Vt=_.stencil?su:pa);let Ut={colorFormat:e.RGBA8,depthFormat:$t,scaleFactor:u};y=new XRWebGLBinding(s,e),v=y.createProjectionLayer(Ut),s.updateRenderState({layers:[v]}),t.setPixelRatio(1),t.setSize(v.textureWidth,v.textureHeight,!1),T=new Us(v.textureWidth,v.textureHeight,{format:Ro,type:ma,depthTexture:new Kp(v.textureWidth,v.textureHeight,Vt,void 0,void 0,void 0,void 0,void 0,void 0,bt),stencilBuffer:_.stencil,colorSpace:t.outputColorSpace,samples:_.antialias?4:0});let Gt=t.properties.get(T);Gt.__ignoreDepthValues=v.ignoreDepthValues}T.isXRRenderTarget=!0,this.setFoveation(p),d=null,c=yield s.requestReferenceSpace(f),jt.setContext(s),jt.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}})},this.getEnvironmentBlendMode=function(){if(s!==null)return s.environmentBlendMode};function gt(nt){for(let bt=0;bt<nt.removed.length;bt++){let Vt=nt.removed[bt],$t=R.indexOf(Vt);$t>=0&&(R[$t]=null,w[$t].disconnect(Vt))}for(let bt=0;bt<nt.added.length;bt++){let Vt=nt.added[bt],$t=R.indexOf(Vt);if($t===-1){for(let Gt=0;Gt<w.length;Gt++)if(Gt>=R.length){R.push(Vt),$t=Gt;break}else if(R[Gt]===null){R[Gt]=Vt,$t=Gt;break}if($t===-1)break}let Ut=w[$t];Ut&&Ut.connect(Vt)}}let ft=new st,vt=new st;function it(nt,bt,Vt){ft.setFromMatrixPosition(bt.matrixWorld),vt.setFromMatrixPosition(Vt.matrixWorld);let $t=ft.distanceTo(vt),Ut=bt.projectionMatrix.elements,Gt=Vt.projectionMatrix.elements,Ct=Ut[14]/(Ut[10]-1),ee=Ut[14]/(Ut[10]+1),Z=(Ut[9]+1)/Ut[5],Ot=(Ut[9]-1)/Ut[5],_t=(Ut[8]-1)/Ut[0],Nt=(Gt[8]+1)/Gt[0],wt=Ct*_t,Ht=Ct*Nt,Xt=$t/(-_t+Nt),Pt=Xt*-_t;bt.matrixWorld.decompose(nt.position,nt.quaternion,nt.scale),nt.translateX(Pt),nt.translateZ(Xt),nt.matrixWorld.compose(nt.position,nt.quaternion,nt.scale),nt.matrixWorldInverse.copy(nt.matrixWorld).invert();let ne=Ct+Xt,Y=ee+Xt,N=wt-Pt,xt=Ht+($t-Pt),St=Z*ee/Y*ne,ot=Ot*ee/Y*ne;nt.projectionMatrix.makePerspective(N,xt,St,ot,ne,Y),nt.projectionMatrixInverse.copy(nt.projectionMatrix).invert()}function lt(nt,bt){bt===null?nt.matrixWorld.copy(nt.matrix):nt.matrixWorld.multiplyMatrices(bt.matrixWorld,nt.matrix),nt.matrixWorldInverse.copy(nt.matrixWorld).invert()}this.updateCamera=function(nt){if(s===null)return;A.texture!==null&&(nt.near=A.depthNear,nt.far=A.depthFar),L.near=P.near=D.near=nt.near,L.far=P.far=D.far=nt.far,(W!==L.near||V!==L.far)&&(s.updateRenderState({depthNear:L.near,depthFar:L.far}),W=L.near,V=L.far,D.near=W,D.far=V,P.near=W,P.far=V,D.updateProjectionMatrix(),P.updateProjectionMatrix(),nt.updateProjectionMatrix());let bt=nt.parent,Vt=L.cameras;lt(L,bt);for(let $t=0;$t<Vt.length;$t++)lt(Vt[$t],bt);Vt.length===2?it(L,D,P):L.projectionMatrix.copy(D.projectionMatrix),H(nt,L,bt)};function H(nt,bt,Vt){Vt===null?nt.matrix.copy(bt.matrixWorld):(nt.matrix.copy(Vt.matrixWorld),nt.matrix.invert(),nt.matrix.multiply(bt.matrixWorld)),nt.matrix.decompose(nt.position,nt.quaternion,nt.scale),nt.updateMatrixWorld(!0),nt.projectionMatrix.copy(bt.projectionMatrix),nt.projectionMatrixInverse.copy(bt.projectionMatrixInverse),nt.isPerspectiveCamera&&(nt.fov=rv*2*Math.atan(1/nt.projectionMatrix.elements[5]),nt.zoom=1)}this.getCamera=function(){return L},this.getFoveation=function(){if(!(v===null&&E===null))return p},this.setFoveation=function(nt){p=nt,v!==null&&(v.fixedFoveation=nt),E!==null&&E.fixedFoveation!==void 0&&(E.fixedFoveation=nt)},this.hasDepthSensing=function(){return A.texture!==null};let At=null;function It(nt,bt){if(g=bt.getViewerPose(d||c),M=bt,g!==null){let Vt=g.views;E!==null&&(t.setRenderTargetFramebuffer(T,E.framebuffer),t.setRenderTarget(T));let $t=!1;Vt.length!==L.cameras.length&&(L.cameras.length=0,$t=!0);for(let Gt=0;Gt<Vt.length;Gt++){let Ct=Vt[Gt],ee=null;if(E!==null)ee=E.getViewport(Ct);else{let Ot=y.getViewSubImage(v,Ct);ee=Ot.viewport,Gt===0&&(t.setRenderTargetTextures(T,Ot.colorTexture,v.ignoreDepthValues?void 0:Ot.depthStencilTexture),t.setRenderTarget(T))}let Z=ct[Gt];Z===void 0&&(Z=new Zi,Z.layers.enable(Gt),Z.viewport=new Yr,ct[Gt]=Z),Z.matrix.fromArray(Ct.transform.matrix),Z.matrix.decompose(Z.position,Z.quaternion,Z.scale),Z.projectionMatrix.fromArray(Ct.projectionMatrix),Z.projectionMatrixInverse.copy(Z.projectionMatrix).invert(),Z.viewport.set(ee.x,ee.y,ee.width,ee.height),Gt===0&&(L.matrix.copy(Z.matrix),L.matrix.decompose(L.position,L.quaternion,L.scale)),$t===!0&&L.cameras.push(Z)}let Ut=s.enabledFeatures;if(Ut&&Ut.includes("depth-sensing")){let Gt=y.getDepthInformation(Vt[0]);Gt&&Gt.isValid&&Gt.texture&&A.init(t,Gt,s.renderState)}}for(let Vt=0;Vt<w.length;Vt++){let $t=R[Vt],Ut=w[Vt];$t!==null&&Ut!==void 0&&Ut.update($t,bt,d||c)}A.render(t,L),At&&At(nt,bt),bt.detectedPlanes&&i.dispatchEvent({type:"planesdetected",data:bt}),M=null}let jt=new rP;jt.setAnimationLoop(It),this.setAnimationLoop=function(nt){At=nt},this.dispose=function(){}}},Qa=new lu,O7=new jn;function D7(n,t){function e(_,x){_.matrixAutoUpdate===!0&&_.updateMatrix(),x.value.copy(_.matrix)}function i(_,x){x.color.getRGB(_.fogColor.value,nP(n)),x.isFog?(_.fogNear.value=x.near,_.fogFar.value=x.far):x.isFogExp2&&(_.fogDensity.value=x.density)}function s(_,x,T,w,R){x.isMeshBasicMaterial||x.isMeshLambertMaterial?u(_,x):x.isMeshToonMaterial?(u(_,x),y(_,x)):x.isMeshPhongMaterial?(u(_,x),g(_,x)):x.isMeshStandardMaterial?(u(_,x),v(_,x),x.isMeshPhysicalMaterial&&E(_,x,R)):x.isMeshMatcapMaterial?(u(_,x),M(_,x)):x.isMeshDepthMaterial?u(_,x):x.isMeshDistanceMaterial?(u(_,x),A(_,x)):x.isMeshNormalMaterial?u(_,x):x.isLineBasicMaterial?(c(_,x),x.isLineDashedMaterial&&f(_,x)):x.isPointsMaterial?p(_,x,T,w):x.isSpriteMaterial?d(_,x):x.isShadowMaterial?(_.color.value.copy(x.color),_.opacity.value=x.opacity):x.isShaderMaterial&&(x.uniformsNeedUpdate=!1)}function u(_,x){_.opacity.value=x.opacity,x.color&&_.diffuse.value.copy(x.color),x.emissive&&_.emissive.value.copy(x.emissive).multiplyScalar(x.emissiveIntensity),x.map&&(_.map.value=x.map,e(x.map,_.mapTransform)),x.alphaMap&&(_.alphaMap.value=x.alphaMap,e(x.alphaMap,_.alphaMapTransform)),x.bumpMap&&(_.bumpMap.value=x.bumpMap,e(x.bumpMap,_.bumpMapTransform),_.bumpScale.value=x.bumpScale,x.side===Oi&&(_.bumpScale.value*=-1)),x.normalMap&&(_.normalMap.value=x.normalMap,e(x.normalMap,_.normalMapTransform),_.normalScale.value.copy(x.normalScale),x.side===Oi&&_.normalScale.value.negate()),x.displacementMap&&(_.displacementMap.value=x.displacementMap,e(x.displacementMap,_.displacementMapTransform),_.displacementScale.value=x.displacementScale,_.displacementBias.value=x.displacementBias),x.emissiveMap&&(_.emissiveMap.value=x.emissiveMap,e(x.emissiveMap,_.emissiveMapTransform)),x.specularMap&&(_.specularMap.value=x.specularMap,e(x.specularMap,_.specularMapTransform)),x.alphaTest>0&&(_.alphaTest.value=x.alphaTest);let T=t.get(x),w=T.envMap,R=T.envMapRotation;if(w&&(_.envMap.value=w,Qa.copy(R),Qa.x*=-1,Qa.y*=-1,Qa.z*=-1,w.isCubeTexture&&w.isRenderTargetTexture===!1&&(Qa.y*=-1,Qa.z*=-1),_.envMapRotation.value.setFromMatrix4(O7.makeRotationFromEuler(Qa)),_.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,_.reflectivity.value=x.reflectivity,_.ior.value=x.ior,_.refractionRatio.value=x.refractionRatio),x.lightMap){_.lightMap.value=x.lightMap;let B=n._useLegacyLights===!0?Math.PI:1;_.lightMapIntensity.value=x.lightMapIntensity*B,e(x.lightMap,_.lightMapTransform)}x.aoMap&&(_.aoMap.value=x.aoMap,_.aoMapIntensity.value=x.aoMapIntensity,e(x.aoMap,_.aoMapTransform))}function c(_,x){_.diffuse.value.copy(x.color),_.opacity.value=x.opacity,x.map&&(_.map.value=x.map,e(x.map,_.mapTransform))}function f(_,x){_.dashSize.value=x.dashSize,_.totalSize.value=x.dashSize+x.gapSize,_.scale.value=x.scale}function p(_,x,T,w){_.diffuse.value.copy(x.color),_.opacity.value=x.opacity,_.size.value=x.size*T,_.scale.value=w*.5,x.map&&(_.map.value=x.map,e(x.map,_.uvTransform)),x.alphaMap&&(_.alphaMap.value=x.alphaMap,e(x.alphaMap,_.alphaMapTransform)),x.alphaTest>0&&(_.alphaTest.value=x.alphaTest)}function d(_,x){_.diffuse.value.copy(x.color),_.opacity.value=x.opacity,_.rotation.value=x.rotation,x.map&&(_.map.value=x.map,e(x.map,_.mapTransform)),x.alphaMap&&(_.alphaMap.value=x.alphaMap,e(x.alphaMap,_.alphaMapTransform)),x.alphaTest>0&&(_.alphaTest.value=x.alphaTest)}function g(_,x){_.specular.value.copy(x.specular),_.shininess.value=Math.max(x.shininess,1e-4)}function y(_,x){x.gradientMap&&(_.gradientMap.value=x.gradientMap)}function v(_,x){_.metalness.value=x.metalness,x.metalnessMap&&(_.metalnessMap.value=x.metalnessMap,e(x.metalnessMap,_.metalnessMapTransform)),_.roughness.value=x.roughness,x.roughnessMap&&(_.roughnessMap.value=x.roughnessMap,e(x.roughnessMap,_.roughnessMapTransform)),t.get(x).envMap&&(_.envMapIntensity.value=x.envMapIntensity)}function E(_,x,T){_.ior.value=x.ior,x.sheen>0&&(_.sheenColor.value.copy(x.sheenColor).multiplyScalar(x.sheen),_.sheenRoughness.value=x.sheenRoughness,x.sheenColorMap&&(_.sheenColorMap.value=x.sheenColorMap,e(x.sheenColorMap,_.sheenColorMapTransform)),x.sheenRoughnessMap&&(_.sheenRoughnessMap.value=x.sheenRoughnessMap,e(x.sheenRoughnessMap,_.sheenRoughnessMapTransform))),x.clearcoat>0&&(_.clearcoat.value=x.clearcoat,_.clearcoatRoughness.value=x.clearcoatRoughness,x.clearcoatMap&&(_.clearcoatMap.value=x.clearcoatMap,e(x.clearcoatMap,_.clearcoatMapTransform)),x.clearcoatRoughnessMap&&(_.clearcoatRoughnessMap.value=x.clearcoatRoughnessMap,e(x.clearcoatRoughnessMap,_.clearcoatRoughnessMapTransform)),x.clearcoatNormalMap&&(_.clearcoatNormalMap.value=x.clearcoatNormalMap,e(x.clearcoatNormalMap,_.clearcoatNormalMapTransform),_.clearcoatNormalScale.value.copy(x.clearcoatNormalScale),x.side===Oi&&_.clearcoatNormalScale.value.negate())),x.iridescence>0&&(_.iridescence.value=x.iridescence,_.iridescenceIOR.value=x.iridescenceIOR,_.iridescenceThicknessMinimum.value=x.iridescenceThicknessRange[0],_.iridescenceThicknessMaximum.value=x.iridescenceThicknessRange[1],x.iridescenceMap&&(_.iridescenceMap.value=x.iridescenceMap,e(x.iridescenceMap,_.iridescenceMapTransform)),x.iridescenceThicknessMap&&(_.iridescenceThicknessMap.value=x.iridescenceThicknessMap,e(x.iridescenceThicknessMap,_.iridescenceThicknessMapTransform))),x.transmission>0&&(_.transmission.value=x.transmission,_.transmissionSamplerMap.value=T.texture,_.transmissionSamplerSize.value.set(T.width,T.height),x.transmissionMap&&(_.transmissionMap.value=x.transmissionMap,e(x.transmissionMap,_.transmissionMapTransform)),_.thickness.value=x.thickness,x.thicknessMap&&(_.thicknessMap.value=x.thicknessMap,e(x.thicknessMap,_.thicknessMapTransform)),_.attenuationDistance.value=x.attenuationDistance,_.attenuationColor.value.copy(x.attenuationColor)),x.anisotropy>0&&(_.anisotropyVector.value.set(x.anisotropy*Math.cos(x.anisotropyRotation),x.anisotropy*Math.sin(x.anisotropyRotation)),x.anisotropyMap&&(_.anisotropyMap.value=x.anisotropyMap,e(x.anisotropyMap,_.anisotropyMapTransform))),_.specularIntensity.value=x.specularIntensity,_.specularColor.value.copy(x.specularColor),x.specularColorMap&&(_.specularColorMap.value=x.specularColorMap,e(x.specularColorMap,_.specularColorMapTransform)),x.specularIntensityMap&&(_.specularIntensityMap.value=x.specularIntensityMap,e(x.specularIntensityMap,_.specularIntensityMapTransform))}function M(_,x){x.matcap&&(_.matcap.value=x.matcap)}function A(_,x){let T=t.get(x).light;_.referencePosition.value.setFromMatrixPosition(T.matrixWorld),_.nearDistance.value=T.shadow.camera.near,_.farDistance.value=T.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:s}}function F7(n,t,e,i){let s={},u={},c=[],f=e.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function p(T,w){let R=w.program;i.uniformBlockBinding(T,R)}function d(T,w){let R=s[T.id];R===void 0&&(M(T),R=g(T),s[T.id]=R,T.addEventListener("dispose",_));let B=w.program;i.updateUBOMapping(T,B);let U=t.render.frame;u[T.id]!==U&&(v(T),u[T.id]=U)}function g(T){let w=y();T.__bindingPointIndex=w;let R=n.createBuffer(),B=T.__size,U=T.usage;return n.bindBuffer(n.UNIFORM_BUFFER,R),n.bufferData(n.UNIFORM_BUFFER,B,U),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,w,R),R}function y(){for(let T=0;T<f;T++)if(c.indexOf(T)===-1)return c.push(T),T;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function v(T){let w=s[T.id],R=T.uniforms,B=T.__cache;n.bindBuffer(n.UNIFORM_BUFFER,w);for(let U=0,D=R.length;U<D;U++){let P=Array.isArray(R[U])?R[U]:[R[U]];for(let ct=0,L=P.length;ct<L;ct++){let W=P[ct];if(E(W,U,ct,B)===!0){let V=W.__offset,Mt=Array.isArray(W.value)?W.value:[W.value],$=0;for(let gt=0;gt<Mt.length;gt++){let ft=Mt[gt],vt=A(ft);typeof ft=="number"||typeof ft=="boolean"?(W.__data[0]=ft,n.bufferSubData(n.UNIFORM_BUFFER,V+$,W.__data)):ft.isMatrix3?(W.__data[0]=ft.elements[0],W.__data[1]=ft.elements[1],W.__data[2]=ft.elements[2],W.__data[3]=0,W.__data[4]=ft.elements[3],W.__data[5]=ft.elements[4],W.__data[6]=ft.elements[5],W.__data[7]=0,W.__data[8]=ft.elements[6],W.__data[9]=ft.elements[7],W.__data[10]=ft.elements[8],W.__data[11]=0):(ft.toArray(W.__data,$),$+=vt.storage/Float32Array.BYTES_PER_ELEMENT)}n.bufferSubData(n.UNIFORM_BUFFER,V,W.__data)}}}n.bindBuffer(n.UNIFORM_BUFFER,null)}function E(T,w,R,B){let U=T.value,D=w+"_"+R;if(B[D]===void 0)return typeof U=="number"||typeof U=="boolean"?B[D]=U:B[D]=U.clone(),!0;{let P=B[D];if(typeof U=="number"||typeof U=="boolean"){if(P!==U)return B[D]=U,!0}else if(P.equals(U)===!1)return P.copy(U),!0}return!1}function M(T){let w=T.uniforms,R=0,B=16;for(let D=0,P=w.length;D<P;D++){let ct=Array.isArray(w[D])?w[D]:[w[D]];for(let L=0,W=ct.length;L<W;L++){let V=ct[L],Mt=Array.isArray(V.value)?V.value:[V.value];for(let $=0,gt=Mt.length;$<gt;$++){let ft=Mt[$],vt=A(ft),it=R%B;it!==0&&B-it<vt.boundary&&(R+=B-it),V.__data=new Float32Array(vt.storage/Float32Array.BYTES_PER_ELEMENT),V.__offset=R,R+=vt.storage}}}let U=R%B;return U>0&&(R+=B-U),T.__size=R,T.__cache={},this}function A(T){let w={boundary:0,storage:0};return typeof T=="number"||typeof T=="boolean"?(w.boundary=4,w.storage=4):T.isVector2?(w.boundary=8,w.storage=8):T.isVector3||T.isColor?(w.boundary=16,w.storage=12):T.isVector4?(w.boundary=16,w.storage=16):T.isMatrix3?(w.boundary=48,w.storage=48):T.isMatrix4?(w.boundary=64,w.storage=64):T.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",T),w}function _(T){let w=T.target;w.removeEventListener("dispose",_);let R=c.indexOf(w.__bindingPointIndex);c.splice(R,1),n.deleteBuffer(s[w.id]),delete s[w.id],delete u[w.id]}function x(){for(let T in s)n.deleteBuffer(s[T]);c=[],s={},u={}}return{bind:p,update:d,dispose:x}}var Sv=class{constructor(t={}){let{canvas:e=G6(),context:i=null,depth:s=!0,stencil:u=!0,alpha:c=!1,antialias:f=!1,premultipliedAlpha:p=!0,preserveDrawingBuffer:d=!1,powerPreference:g="default",failIfMajorPerformanceCaveat:y=!1}=t;this.isWebGLRenderer=!0;let v;i!==null?v=i.getContextAttributes().alpha:v=c;let E=new Uint32Array(4),M=new Int32Array(4),A=null,_=null,x=[],T=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Zo,this._useLegacyLights=!1,this.toneMapping=ga,this.toneMappingExposure=1;let w=this,R=!1,B=0,U=0,D=null,P=-1,ct=null,L=new Yr,W=new Yr,V=null,Mt=new Te(0),$=0,gt=e.width,ft=e.height,vt=1,it=null,lt=null,H=new Yr(0,0,gt,ft),At=new Yr(0,0,gt,ft),It=!1,jt=new Zp,nt=!1,bt=!1,Vt=null,$t=new jn,Ut=new Ft,Gt=new st,Ct={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ee(){return D===null?vt:1}let Z=i;function Ot(q,at){for(let Et=0;Et<q.length;Et++){let dt=q[Et],ut=e.getContext(dt,at);if(ut!==null)return ut}return null}try{let q={alpha:!0,depth:s,stencil:u,antialias:f,premultipliedAlpha:p,preserveDrawingBuffer:d,powerPreference:g,failIfMajorPerformanceCaveat:y};if("setAttribute"in e&&e.setAttribute("data-engine",\`three.js r\${Wv}\`),e.addEventListener("webglcontextlost",ht,!1),e.addEventListener("webglcontextrestored",O,!1),e.addEventListener("webglcontextcreationerror",Q,!1),Z===null){let at=["webgl2","webgl","experimental-webgl"];if(w.isWebGL1Renderer===!0&&at.shift(),Z=Ot(at,q),Z===null)throw Ot(at)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}typeof WebGLRenderingContext!="undefined"&&Z instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),Z.getShaderPrecisionFormat===void 0&&(Z.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(q){throw console.error("THREE.WebGLRenderer: "+q.message),q}let _t,Nt,wt,Ht,Xt,Pt,ne,Y,N,xt,St,ot,Lt,ce,Rt,Bt,Wt,j,b,I,F,k,G,rt;function tt(){_t=new KX(Z),Nt=new XX(Z,_t,t),_t.init(Nt),k=new P7(Z,_t,Nt),wt=new C7(Z,_t,Nt),Ht=new e9(Z),Xt=new m7,Pt=new I7(Z,_t,wt,Xt,Nt,k,Ht),ne=new $X(w),Y=new jX(w),N=new a8(Z,Nt),G=new HX(Z,_t,N,Nt),xt=new QX(Z,N,Ht,G),St=new o9(Z,xt,N,Ht),b=new i9(Z,Nt,Pt),Bt=new YX(Xt),ot=new g7(w,ne,Y,_t,Nt,G,Bt),Lt=new D7(w,Xt),ce=new v7,Rt=new M7(_t,Nt),j=new VX(w,ne,Y,wt,St,v,p),Wt=new T7(w,St,Nt),rt=new F7(Z,Ht,Nt,wt),I=new WX(Z,_t,Ht,Nt),F=new t9(Z,_t,Ht,Nt),Ht.programs=ot.programs,w.capabilities=Nt,w.extensions=_t,w.properties=Xt,w.renderLists=ce,w.shadowMap=Wt,w.state=wt,w.info=Ht}tt();let pt=new Ev(w,Z);this.xr=pt,this.getContext=function(){return Z},this.getContextAttributes=function(){return Z.getContextAttributes()},this.forceContextLoss=function(){let q=_t.get("WEBGL_lose_context");q&&q.loseContext()},this.forceContextRestore=function(){let q=_t.get("WEBGL_lose_context");q&&q.restoreContext()},this.getPixelRatio=function(){return vt},this.setPixelRatio=function(q){q!==void 0&&(vt=q,this.setSize(gt,ft,!1))},this.getSize=function(q){return q.set(gt,ft)},this.setSize=function(q,at,Et=!0){if(pt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}gt=q,ft=at,e.width=Math.floor(q*vt),e.height=Math.floor(at*vt),Et===!0&&(e.style.width=q+"px",e.style.height=at+"px"),this.setViewport(0,0,q,at)},this.getDrawingBufferSize=function(q){return q.set(gt*vt,ft*vt).floor()},this.setDrawingBufferSize=function(q,at,Et){gt=q,ft=at,vt=Et,e.width=Math.floor(q*Et),e.height=Math.floor(at*Et),this.setViewport(0,0,q,at)},this.getCurrentViewport=function(q){return q.copy(L)},this.getViewport=function(q){return q.copy(H)},this.setViewport=function(q,at,Et,dt){q.isVector4?H.set(q.x,q.y,q.z,q.w):H.set(q,at,Et,dt),wt.viewport(L.copy(H).multiplyScalar(vt).round())},this.getScissor=function(q){return q.copy(At)},this.setScissor=function(q,at,Et,dt){q.isVector4?At.set(q.x,q.y,q.z,q.w):At.set(q,at,Et,dt),wt.scissor(W.copy(At).multiplyScalar(vt).round())},this.getScissorTest=function(){return It},this.setScissorTest=function(q){wt.setScissorTest(It=q)},this.setOpaqueSort=function(q){it=q},this.setTransparentSort=function(q){lt=q},this.getClearColor=function(q){return q.copy(j.getClearColor())},this.setClearColor=function(){j.setClearColor.apply(j,arguments)},this.getClearAlpha=function(){return j.getClearAlpha()},this.setClearAlpha=function(){j.setClearAlpha.apply(j,arguments)},this.clear=function(q=!0,at=!0,Et=!0){let dt=0;if(q){let ut=!1;if(D!==null){let Kt=D.texture.format;ut=Kt===JI||Kt===ZI||Kt===$I}if(ut){let Kt=D.texture.type,te=Kt===ma||Kt===pa||Kt===Xv||Kt===su||Kt===XI||Kt===YI,le=j.getClearColor(),re=j.getClearAlpha(),ve=le.r,fe=le.g,he=le.b;te?(E[0]=ve,E[1]=fe,E[2]=he,E[3]=re,Z.clearBufferuiv(Z.COLOR,0,E)):(M[0]=ve,M[1]=fe,M[2]=he,M[3]=re,Z.clearBufferiv(Z.COLOR,0,M))}else dt|=Z.COLOR_BUFFER_BIT}at&&(dt|=Z.DEPTH_BUFFER_BIT),Et&&(dt|=Z.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),Z.clear(dt)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",ht,!1),e.removeEventListener("webglcontextrestored",O,!1),e.removeEventListener("webglcontextcreationerror",Q,!1),ce.dispose(),Rt.dispose(),Xt.dispose(),ne.dispose(),Y.dispose(),St.dispose(),G.dispose(),rt.dispose(),ot.dispose(),Wt.dispose(),pt.dispose(),pt.removeEventListener("sessionstart",we),pt.removeEventListener("sessionend",ye),Vt&&(Vt.dispose(),Vt=null),be.stop()};function ht(q){q.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),R=!0}function O(){console.log("THREE.WebGLRenderer: Context Restored."),R=!1;let q=Ht.autoReset,at=Wt.enabled,Et=Wt.autoUpdate,dt=Wt.needsUpdate,ut=Wt.type;tt(),Ht.autoReset=q,Wt.enabled=at,Wt.autoUpdate=Et,Wt.needsUpdate=dt,Wt.type=ut}function Q(q){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",q.statusMessage)}function J(q){let at=q.target;at.removeEventListener("dispose",J),et(at)}function et(q){Tt(q),Xt.remove(q)}function Tt(q){let at=Xt.get(q).programs;at!==void 0&&(at.forEach(function(Et){ot.releaseProgram(Et)}),q.isShaderMaterial&&ot.releaseShaderCache(q))}this.renderBufferDirect=function(q,at,Et,dt,ut,Kt){at===null&&(at=Ct);let te=ut.isMesh&&ut.matrixWorld.determinant()<0,le=En(q,at,Et,dt,ut);wt.setMaterial(dt,te);let re=Et.index,ve=1;if(dt.wireframe===!0){if(re=xt.getWireframeAttribute(Et),re===void 0)return;ve=2}let fe=Et.drawRange,he=Et.attributes.position,cn=fe.start*ve,Tr=(fe.start+fe.count)*ve;Kt!==null&&(cn=Math.max(cn,Kt.start*ve),Tr=Math.min(Tr,(Kt.start+Kt.count)*ve)),re!==null?(cn=Math.max(cn,0),Tr=Math.min(Tr,re.count)):he!=null&&(cn=Math.max(cn,0),Tr=Math.min(Tr,he.count));let kn=Tr-cn;if(kn<0||kn===1/0)return;G.setup(ut,dt,le,Et,re);let fi,wn=I;if(re!==null&&(fi=N.get(re),wn=F,wn.setIndex(fi)),ut.isMesh)dt.wireframe===!0?(wt.setLineWidth(dt.wireframeLinewidth*ee()),wn.setMode(Z.LINES)):wn.setMode(Z.TRIANGLES);else if(ut.isLine){let se=dt.linewidth;se===void 0&&(se=1),wt.setLineWidth(se*ee()),ut.isLineSegments?wn.setMode(Z.LINES):ut.isLineLoop?wn.setMode(Z.LINE_LOOP):wn.setMode(Z.LINE_STRIP)}else ut.isPoints?wn.setMode(Z.POINTS):ut.isSprite&&wn.setMode(Z.TRIANGLES);if(ut.isBatchedMesh)wn.renderMultiDraw(ut._multiDrawStarts,ut._multiDrawCounts,ut._multiDrawCount);else if(ut.isInstancedMesh)wn.renderInstances(cn,kn,ut.count);else if(Et.isInstancedBufferGeometry){let se=Et._maxInstanceCount!==void 0?Et._maxInstanceCount:1/0,wu=Math.min(Et.instanceCount,se);wn.renderInstances(cn,kn,wu)}else wn.render(cn,kn)};function kt(q,at,Et){q.transparent===!0&&q.side===Ns&&q.forceSinglePass===!1?(q.side=Oi,q.needsUpdate=!0,xn(q,at,Et),q.side=va,q.needsUpdate=!0,xn(q,at,Et),q.side=Ns):xn(q,at,Et)}this.compile=function(q,at,Et=null){Et===null&&(Et=q),_=Rt.get(Et),_.init(),T.push(_),Et.traverseVisible(function(ut){ut.isLight&&ut.layers.test(at.layers)&&(_.pushLight(ut),ut.castShadow&&_.pushShadow(ut))}),q!==Et&&q.traverseVisible(function(ut){ut.isLight&&ut.layers.test(at.layers)&&(_.pushLight(ut),ut.castShadow&&_.pushShadow(ut))}),_.setupLights(w._useLegacyLights);let dt=new Set;return q.traverse(function(ut){let Kt=ut.material;if(Kt)if(Array.isArray(Kt))for(let te=0;te<Kt.length;te++){let le=Kt[te];kt(le,Et,ut),dt.add(le)}else kt(Kt,Et,ut),dt.add(Kt)}),T.pop(),_=null,dt},this.compileAsync=function(q,at,Et=null){let dt=this.compile(q,at,Et);return new Promise(ut=>{function Kt(){if(dt.forEach(function(te){Xt.get(te).currentProgram.isReady()&&dt.delete(te)}),dt.size===0){ut(q);return}setTimeout(Kt,10)}_t.get("KHR_parallel_shader_compile")!==null?Kt():setTimeout(Kt,10)})};let ie=null;function oe(q){ie&&ie(q)}function we(){be.stop()}function ye(){be.start()}let be=new rP;be.setAnimationLoop(oe),typeof self!="undefined"&&be.setContext(self),this.setAnimationLoop=function(q){ie=q,pt.setAnimationLoop(q),q===null?be.stop():be.start()},pt.addEventListener("sessionstart",we),pt.addEventListener("sessionend",ye),this.render=function(q,at){if(at!==void 0&&at.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(R===!0)return;q.matrixWorldAutoUpdate===!0&&q.updateMatrixWorld(),at.parent===null&&at.matrixWorldAutoUpdate===!0&&at.updateMatrixWorld(),pt.enabled===!0&&pt.isPresenting===!0&&(pt.cameraAutoUpdate===!0&&pt.updateCamera(at),at=pt.getCamera()),q.isScene===!0&&q.onBeforeRender(w,q,at,D),_=Rt.get(q,T.length),_.init(),T.push(_),$t.multiplyMatrices(at.projectionMatrix,at.matrixWorldInverse),jt.setFromProjectionMatrix($t),bt=this.localClippingEnabled,nt=Bt.init(this.clippingPlanes,bt),A=ce.get(q,x.length),A.init(),x.push(A),Ae(q,at,0,w.sortObjects),A.finish(),w.sortObjects===!0&&A.sort(it,lt),this.info.render.frame++,nt===!0&&Bt.beginShadows();let Et=_.state.shadowsArray;if(Wt.render(Et,q,at),nt===!0&&Bt.endShadows(),this.info.autoReset===!0&&this.info.reset(),(pt.enabled===!1||pt.isPresenting===!1||pt.hasDepthSensing()===!1)&&j.render(A,q),_.setupLights(w._useLegacyLights),at.isArrayCamera){let dt=at.cameras;for(let ut=0,Kt=dt.length;ut<Kt;ut++){let te=dt[ut];Un(A,q,te,te.viewport)}}else Un(A,q,at);D!==null&&(Pt.updateMultisampleRenderTarget(D),Pt.updateRenderTargetMipmap(D)),q.isScene===!0&&q.onAfterRender(w,q,at),G.resetDefaultState(),P=-1,ct=null,T.pop(),T.length>0?_=T[T.length-1]:_=null,x.pop(),x.length>0?A=x[x.length-1]:A=null};function Ae(q,at,Et,dt){if(q.visible===!1)return;if(q.layers.test(at.layers)){if(q.isGroup)Et=q.renderOrder;else if(q.isLOD)q.autoUpdate===!0&&q.update(at);else if(q.isLight)_.pushLight(q),q.castShadow&&_.pushShadow(q);else if(q.isSprite){if(!q.frustumCulled||jt.intersectsSprite(q)){dt&&Gt.setFromMatrixPosition(q.matrixWorld).applyMatrix4($t);let te=St.update(q),le=q.material;le.visible&&A.push(q,te,le,Et,Gt.z,null)}}else if((q.isMesh||q.isLine||q.isPoints)&&(!q.frustumCulled||jt.intersectsObject(q))){let te=St.update(q),le=q.material;if(dt&&(q.boundingSphere!==void 0?(q.boundingSphere===null&&q.computeBoundingSphere(),Gt.copy(q.boundingSphere.center)):(te.boundingSphere===null&&te.computeBoundingSphere(),Gt.copy(te.boundingSphere.center)),Gt.applyMatrix4(q.matrixWorld).applyMatrix4($t)),Array.isArray(le)){let re=te.groups;for(let ve=0,fe=re.length;ve<fe;ve++){let he=re[ve],cn=le[he.materialIndex];cn&&cn.visible&&A.push(q,te,cn,Et,Gt.z,he)}}else le.visible&&A.push(q,te,le,Et,Gt.z,null)}}let Kt=q.children;for(let te=0,le=Kt.length;te<le;te++)Ae(Kt[te],at,Et,dt)}function Un(q,at,Et,dt){let ut=q.opaque,Kt=q.transmissive,te=q.transparent;_.setupLightsView(Et),nt===!0&&Bt.setGlobalState(w.clippingPlanes,Et),Kt.length>0&&dr(ut,Kt,at,Et),dt&&wt.viewport(L.copy(dt)),ut.length>0&&_n(ut,at,Et),Kt.length>0&&_n(Kt,at,Et),te.length>0&&_n(te,at,Et),wt.buffers.depth.setTest(!0),wt.buffers.depth.setMask(!0),wt.buffers.color.setMask(!0),wt.setPolygonOffset(!1)}function dr(q,at,Et,dt){if((Et.isScene===!0?Et.overrideMaterial:null)!==null)return;let Kt=Nt.isWebGL2;Vt===null&&(Vt=new Us(1,1,{generateMipmaps:!0,type:_t.has("EXT_color_buffer_half_float")?af:ma,minFilter:ru,samples:Kt?4:0})),w.getDrawingBufferSize(Ut),Kt?Vt.setSize(Ut.x,Ut.y):Vt.setSize(iv(Ut.x),iv(Ut.y));let te=w.getRenderTarget();w.setRenderTarget(Vt),w.getClearColor(Mt),$=w.getClearAlpha(),$<1&&w.setClearColor(16777215,.5),w.clear();let le=w.toneMapping;w.toneMapping=ga,_n(q,Et,dt),Pt.updateMultisampleRenderTarget(Vt),Pt.updateRenderTargetMipmap(Vt);let re=!1;for(let ve=0,fe=at.length;ve<fe;ve++){let he=at[ve],cn=he.object,Tr=he.geometry,kn=he.material,fi=he.group;if(kn.side===Ns&&cn.layers.test(dt.layers)){let wn=kn.side;kn.side=Oi,kn.needsUpdate=!0,pe(cn,Et,dt,Tr,kn,fi),kn.side=wn,kn.needsUpdate=!0,re=!0}}re===!0&&(Pt.updateMultisampleRenderTarget(Vt),Pt.updateRenderTargetMipmap(Vt)),w.setRenderTarget(te),w.setClearColor(Mt,$),w.toneMapping=le}function _n(q,at,Et){let dt=at.isScene===!0?at.overrideMaterial:null;for(let ut=0,Kt=q.length;ut<Kt;ut++){let te=q[ut],le=te.object,re=te.geometry,ve=dt===null?te.material:dt,fe=te.group;le.layers.test(Et.layers)&&pe(le,at,Et,re,ve,fe)}}function pe(q,at,Et,dt,ut,Kt){q.onBeforeRender(w,at,Et,dt,ut,Kt),q.modelViewMatrix.multiplyMatrices(Et.matrixWorldInverse,q.matrixWorld),q.normalMatrix.getNormalMatrix(q.modelViewMatrix),ut.onBeforeRender(w,at,Et,dt,q,Kt),ut.transparent===!0&&ut.side===Ns&&ut.forceSinglePass===!1?(ut.side=Oi,ut.needsUpdate=!0,w.renderBufferDirect(Et,at,dt,ut,q,Kt),ut.side=va,ut.needsUpdate=!0,w.renderBufferDirect(Et,at,dt,ut,q,Kt),ut.side=Ns):w.renderBufferDirect(Et,at,dt,ut,q,Kt),q.onAfterRender(w,at,Et,dt,ut,Kt)}function xn(q,at,Et){at.isScene!==!0&&(at=Ct);let dt=Xt.get(q),ut=_.state.lights,Kt=_.state.shadowsArray,te=ut.state.version,le=ot.getParameters(q,ut.state,Kt,at,Et),re=ot.getProgramCacheKey(le),ve=dt.programs;dt.environment=q.isMeshStandardMaterial?at.environment:null,dt.fog=at.fog,dt.envMap=(q.isMeshStandardMaterial?Y:ne).get(q.envMap||dt.environment),dt.envMapRotation=dt.environment!==null&&q.envMap===null?at.environmentRotation:q.envMapRotation,ve===void 0&&(q.addEventListener("dispose",J),ve=new Map,dt.programs=ve);let fe=ve.get(re);if(fe!==void 0){if(dt.currentProgram===fe&&dt.lightsStateVersion===te)return Cn(q,le),fe}else le.uniforms=ot.getUniforms(q),q.onBuild(Et,le,w),q.onBeforeCompile(le,w),fe=ot.acquireProgram(le,re),ve.set(re,fe),dt.uniforms=le.uniforms;let he=dt.uniforms;return(!q.isShaderMaterial&&!q.isRawShaderMaterial||q.clipping===!0)&&(he.clippingPlanes=Bt.uniform),Cn(q,le),dt.needsLights=Ar(q),dt.lightsStateVersion=te,dt.needsLights&&(he.ambientLightColor.value=ut.state.ambient,he.lightProbe.value=ut.state.probe,he.directionalLights.value=ut.state.directional,he.directionalLightShadows.value=ut.state.directionalShadow,he.spotLights.value=ut.state.spot,he.spotLightShadows.value=ut.state.spotShadow,he.rectAreaLights.value=ut.state.rectArea,he.ltc_1.value=ut.state.rectAreaLTC1,he.ltc_2.value=ut.state.rectAreaLTC2,he.pointLights.value=ut.state.point,he.pointLightShadows.value=ut.state.pointShadow,he.hemisphereLights.value=ut.state.hemi,he.directionalShadowMap.value=ut.state.directionalShadowMap,he.directionalShadowMatrix.value=ut.state.directionalShadowMatrix,he.spotShadowMap.value=ut.state.spotShadowMap,he.spotLightMatrix.value=ut.state.spotLightMatrix,he.spotLightMap.value=ut.state.spotLightMap,he.pointShadowMap.value=ut.state.pointShadowMap,he.pointShadowMatrix.value=ut.state.pointShadowMatrix),dt.currentProgram=fe,dt.uniformsList=null,fe}function Nn(q){if(q.uniformsList===null){let at=q.currentProgram.getUniforms();q.uniformsList=wl.seqWithValue(at.seq,q.uniforms)}return q.uniformsList}function Cn(q,at){let Et=Xt.get(q);Et.outputColorSpace=at.outputColorSpace,Et.batching=at.batching,Et.instancing=at.instancing,Et.instancingColor=at.instancingColor,Et.instancingMorph=at.instancingMorph,Et.skinning=at.skinning,Et.morphTargets=at.morphTargets,Et.morphNormals=at.morphNormals,Et.morphColors=at.morphColors,Et.morphTargetsCount=at.morphTargetsCount,Et.numClippingPlanes=at.numClippingPlanes,Et.numIntersection=at.numClipIntersection,Et.vertexAlphas=at.vertexAlphas,Et.vertexTangents=at.vertexTangents,Et.toneMapping=at.toneMapping}function En(q,at,Et,dt,ut){at.isScene!==!0&&(at=Ct),Pt.resetTextureUnits();let Kt=at.fog,te=dt.isMeshStandardMaterial?at.environment:null,le=D===null?w.outputColorSpace:D.isXRRenderTarget===!0?D.texture.colorSpace:xa,re=(dt.isMeshStandardMaterial?Y:ne).get(dt.envMap||te),ve=dt.vertexColors===!0&&!!Et.attributes.color&&Et.attributes.color.itemSize===4,fe=!!Et.attributes.tangent&&(!!dt.normalMap||dt.anisotropy>0),he=!!Et.morphAttributes.position,cn=!!Et.morphAttributes.normal,Tr=!!Et.morphAttributes.color,kn=ga;dt.toneMapped&&(D===null||D.isXRRenderTarget===!0)&&(kn=w.toneMapping);let fi=Et.morphAttributes.position||Et.morphAttributes.normal||Et.morphAttributes.color,wn=fi!==void 0?fi.length:0,se=Xt.get(dt),wu=_.state.lights;if(nt===!0&&(bt===!0||q!==ct)){let hi=q===ct&&dt.id===P;Bt.setState(dt,q,hi)}let fn=!1;dt.version===se.__version?(se.needsLights&&se.lightsStateVersion!==wu.state.version||se.outputColorSpace!==le||ut.isBatchedMesh&&se.batching===!1||!ut.isBatchedMesh&&se.batching===!0||ut.isInstancedMesh&&se.instancing===!1||!ut.isInstancedMesh&&se.instancing===!0||ut.isSkinnedMesh&&se.skinning===!1||!ut.isSkinnedMesh&&se.skinning===!0||ut.isInstancedMesh&&se.instancingColor===!0&&ut.instanceColor===null||ut.isInstancedMesh&&se.instancingColor===!1&&ut.instanceColor!==null||ut.isInstancedMesh&&se.instancingMorph===!0&&ut.morphTexture===null||ut.isInstancedMesh&&se.instancingMorph===!1&&ut.morphTexture!==null||se.envMap!==re||dt.fog===!0&&se.fog!==Kt||se.numClippingPlanes!==void 0&&(se.numClippingPlanes!==Bt.numPlanes||se.numIntersection!==Bt.numIntersection)||se.vertexAlphas!==ve||se.vertexTangents!==fe||se.morphTargets!==he||se.morphNormals!==cn||se.morphColors!==Tr||se.toneMapping!==kn||Nt.isWebGL2===!0&&se.morphTargetsCount!==wn)&&(fn=!0):(fn=!0,se.__version=dt.version);let co=se.currentProgram;fn===!0&&(co=xn(dt,at,ut));let ac=!1,_e=!1,Pa=!1,Mn=co.getUniforms(),fo=se.uniforms;if(wt.useProgram(co.program)&&(ac=!0,_e=!0,Pa=!0),dt.id!==P&&(P=dt.id,_e=!0),ac||ct!==q){Mn.setValue(Z,"projectionMatrix",q.projectionMatrix),Mn.setValue(Z,"viewMatrix",q.matrixWorldInverse);let hi=Mn.map.cameraPosition;hi!==void 0&&hi.setValue(Z,Gt.setFromMatrixPosition(q.matrixWorld)),Nt.logarithmicDepthBuffer&&Mn.setValue(Z,"logDepthBufFC",2/(Math.log(q.far+1)/Math.LN2)),(dt.isMeshPhongMaterial||dt.isMeshToonMaterial||dt.isMeshLambertMaterial||dt.isMeshBasicMaterial||dt.isMeshStandardMaterial||dt.isShaderMaterial)&&Mn.setValue(Z,"isOrthographic",q.isOrthographicCamera===!0),ct!==q&&(ct=q,_e=!0,Pa=!0)}if(ut.isSkinnedMesh){Mn.setOptional(Z,ut,"bindMatrix"),Mn.setOptional(Z,ut,"bindMatrixInverse");let hi=ut.skeleton;hi&&(Nt.floatVertexTextures?(hi.boneTexture===null&&hi.computeBoneTexture(),Mn.setValue(Z,"boneTexture",hi.boneTexture,Pt)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}ut.isBatchedMesh&&(Mn.setOptional(Z,ut,"batchingTexture"),Mn.setValue(Z,"batchingTexture",ut._matricesTexture,Pt));let me=Et.morphAttributes;if((me.position!==void 0||me.normal!==void 0||me.color!==void 0&&Nt.isWebGL2===!0)&&b.update(ut,Et,co),(_e||se.receiveShadow!==ut.receiveShadow)&&(se.receiveShadow=ut.receiveShadow,Mn.setValue(Z,"receiveShadow",ut.receiveShadow)),dt.isMeshGouraudMaterial&&dt.envMap!==null&&(fo.envMap.value=re,fo.flipEnvMap.value=re.isCubeTexture&&re.isRenderTargetTexture===!1?-1:1),_e&&(Mn.setValue(Z,"toneMappingExposure",w.toneMappingExposure),se.needsLights&&Kr(fo,Pa),Kt&&dt.fog===!0&&Lt.refreshFogUniforms(fo,Kt),Lt.refreshMaterialUniforms(fo,dt,vt,ft,Vt),wl.upload(Z,Nn(se),fo,Pt)),dt.isShaderMaterial&&dt.uniformsNeedUpdate===!0&&(wl.upload(Z,Nn(se),fo,Pt),dt.uniformsNeedUpdate=!1),dt.isSpriteMaterial&&Mn.setValue(Z,"center",ut.center),Mn.setValue(Z,"modelViewMatrix",ut.modelViewMatrix),Mn.setValue(Z,"normalMatrix",ut.normalMatrix),Mn.setValue(Z,"modelMatrix",ut.matrixWorld),dt.isShaderMaterial||dt.isRawShaderMaterial){let hi=dt.uniformsGroups;for(let uc=0,Mu=hi.length;uc<Mu;uc++)if(Nt.isWebGL2){let pi=hi[uc];rt.update(pi,co),rt.bind(pi,co)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return co}function Kr(q,at){q.ambientLightColor.needsUpdate=at,q.lightProbe.needsUpdate=at,q.directionalLights.needsUpdate=at,q.directionalLightShadows.needsUpdate=at,q.pointLights.needsUpdate=at,q.pointLightShadows.needsUpdate=at,q.spotLights.needsUpdate=at,q.spotLightShadows.needsUpdate=at,q.rectAreaLights.needsUpdate=at,q.hemisphereLights.needsUpdate=at}function Ar(q){return q.isMeshLambertMaterial||q.isMeshToonMaterial||q.isMeshPhongMaterial||q.isMeshStandardMaterial||q.isShadowMaterial||q.isShaderMaterial&&q.lights===!0}this.getActiveCubeFace=function(){return B},this.getActiveMipmapLevel=function(){return U},this.getRenderTarget=function(){return D},this.setRenderTargetTextures=function(q,at,Et){Xt.get(q.texture).__webglTexture=at,Xt.get(q.depthTexture).__webglTexture=Et;let dt=Xt.get(q);dt.__hasExternalTextures=!0,dt.__autoAllocateDepthBuffer=Et===void 0,dt.__autoAllocateDepthBuffer||_t.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),dt.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(q,at){let Et=Xt.get(q);Et.__webglFramebuffer=at,Et.__useDefaultFramebuffer=at===void 0},this.setRenderTarget=function(q,at=0,Et=0){D=q,B=at,U=Et;let dt=!0,ut=null,Kt=!1,te=!1;if(q){let re=Xt.get(q);re.__useDefaultFramebuffer!==void 0?(wt.bindFramebuffer(Z.FRAMEBUFFER,null),dt=!1):re.__webglFramebuffer===void 0?Pt.setupRenderTarget(q):re.__hasExternalTextures&&Pt.rebindTextures(q,Xt.get(q.texture).__webglTexture,Xt.get(q.depthTexture).__webglTexture);let ve=q.texture;(ve.isData3DTexture||ve.isDataArrayTexture||ve.isCompressedArrayTexture)&&(te=!0);let fe=Xt.get(q).__webglFramebuffer;q.isWebGLCubeRenderTarget?(Array.isArray(fe[at])?ut=fe[at][Et]:ut=fe[at],Kt=!0):Nt.isWebGL2&&q.samples>0&&Pt.useMultisampledRTT(q)===!1?ut=Xt.get(q).__webglMultisampledFramebuffer:Array.isArray(fe)?ut=fe[Et]:ut=fe,L.copy(q.viewport),W.copy(q.scissor),V=q.scissorTest}else L.copy(H).multiplyScalar(vt).floor(),W.copy(At).multiplyScalar(vt).floor(),V=It;if(wt.bindFramebuffer(Z.FRAMEBUFFER,ut)&&Nt.drawBuffers&&dt&&wt.drawBuffers(q,ut),wt.viewport(L),wt.scissor(W),wt.setScissorTest(V),Kt){let re=Xt.get(q.texture);Z.framebufferTexture2D(Z.FRAMEBUFFER,Z.COLOR_ATTACHMENT0,Z.TEXTURE_CUBE_MAP_POSITIVE_X+at,re.__webglTexture,Et)}else if(te){let re=Xt.get(q.texture),ve=at||0;Z.framebufferTextureLayer(Z.FRAMEBUFFER,Z.COLOR_ATTACHMENT0,re.__webglTexture,Et||0,ve)}P=-1},this.readRenderTargetPixels=function(q,at,Et,dt,ut,Kt,te){if(!(q&&q.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let le=Xt.get(q).__webglFramebuffer;if(q.isWebGLCubeRenderTarget&&te!==void 0&&(le=le[te]),le){wt.bindFramebuffer(Z.FRAMEBUFFER,le);try{let re=q.texture,ve=re.format,fe=re.type;if(ve!==Ro&&k.convert(ve)!==Z.getParameter(Z.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}let he=fe===af&&(_t.has("EXT_color_buffer_half_float")||Nt.isWebGL2&&_t.has("EXT_color_buffer_float"));if(fe!==ma&&k.convert(fe)!==Z.getParameter(Z.IMPLEMENTATION_COLOR_READ_TYPE)&&!(fe===Os&&(Nt.isWebGL2||_t.has("OES_texture_float")||_t.has("WEBGL_color_buffer_float")))&&!he){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}at>=0&&at<=q.width-dt&&Et>=0&&Et<=q.height-ut&&Z.readPixels(at,Et,dt,ut,k.convert(ve),k.convert(fe),Kt)}finally{let re=D!==null?Xt.get(D).__webglFramebuffer:null;wt.bindFramebuffer(Z.FRAMEBUFFER,re)}}},this.copyFramebufferToTexture=function(q,at,Et=0){let dt=Math.pow(2,-Et),ut=Math.floor(at.image.width*dt),Kt=Math.floor(at.image.height*dt);Pt.setTexture2D(at,0),Z.copyTexSubImage2D(Z.TEXTURE_2D,Et,0,0,q.x,q.y,ut,Kt),wt.unbindTexture()},this.copyTextureToTexture=function(q,at,Et,dt=0){let ut=at.image.width,Kt=at.image.height,te=k.convert(Et.format),le=k.convert(Et.type);Pt.setTexture2D(Et,0),Z.pixelStorei(Z.UNPACK_FLIP_Y_WEBGL,Et.flipY),Z.pixelStorei(Z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Et.premultiplyAlpha),Z.pixelStorei(Z.UNPACK_ALIGNMENT,Et.unpackAlignment),at.isDataTexture?Z.texSubImage2D(Z.TEXTURE_2D,dt,q.x,q.y,ut,Kt,te,le,at.image.data):at.isCompressedTexture?Z.compressedTexSubImage2D(Z.TEXTURE_2D,dt,q.x,q.y,at.mipmaps[0].width,at.mipmaps[0].height,te,at.mipmaps[0].data):Z.texSubImage2D(Z.TEXTURE_2D,dt,q.x,q.y,te,le,at.image),dt===0&&Et.generateMipmaps&&Z.generateMipmap(Z.TEXTURE_2D),wt.unbindTexture()},this.copyTextureToTexture3D=function(q,at,Et,dt,ut=0){if(w.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let Kt=Math.round(q.max.x-q.min.x),te=Math.round(q.max.y-q.min.y),le=q.max.z-q.min.z+1,re=k.convert(dt.format),ve=k.convert(dt.type),fe;if(dt.isData3DTexture)Pt.setTexture3D(dt,0),fe=Z.TEXTURE_3D;else if(dt.isDataArrayTexture||dt.isCompressedArrayTexture)Pt.setTexture2DArray(dt,0),fe=Z.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}Z.pixelStorei(Z.UNPACK_FLIP_Y_WEBGL,dt.flipY),Z.pixelStorei(Z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,dt.premultiplyAlpha),Z.pixelStorei(Z.UNPACK_ALIGNMENT,dt.unpackAlignment);let he=Z.getParameter(Z.UNPACK_ROW_LENGTH),cn=Z.getParameter(Z.UNPACK_IMAGE_HEIGHT),Tr=Z.getParameter(Z.UNPACK_SKIP_PIXELS),kn=Z.getParameter(Z.UNPACK_SKIP_ROWS),fi=Z.getParameter(Z.UNPACK_SKIP_IMAGES),wn=Et.isCompressedTexture?Et.mipmaps[ut]:Et.image;Z.pixelStorei(Z.UNPACK_ROW_LENGTH,wn.width),Z.pixelStorei(Z.UNPACK_IMAGE_HEIGHT,wn.height),Z.pixelStorei(Z.UNPACK_SKIP_PIXELS,q.min.x),Z.pixelStorei(Z.UNPACK_SKIP_ROWS,q.min.y),Z.pixelStorei(Z.UNPACK_SKIP_IMAGES,q.min.z),Et.isDataTexture||Et.isData3DTexture?Z.texSubImage3D(fe,ut,at.x,at.y,at.z,Kt,te,le,re,ve,wn.data):dt.isCompressedArrayTexture?Z.compressedTexSubImage3D(fe,ut,at.x,at.y,at.z,Kt,te,le,re,wn.data):Z.texSubImage3D(fe,ut,at.x,at.y,at.z,Kt,te,le,re,ve,wn),Z.pixelStorei(Z.UNPACK_ROW_LENGTH,he),Z.pixelStorei(Z.UNPACK_IMAGE_HEIGHT,cn),Z.pixelStorei(Z.UNPACK_SKIP_PIXELS,Tr),Z.pixelStorei(Z.UNPACK_SKIP_ROWS,kn),Z.pixelStorei(Z.UNPACK_SKIP_IMAGES,fi),ut===0&&dt.generateMipmaps&&Z.generateMipmap(fe),wt.unbindTexture()},this.initTexture=function(q){q.isCubeTexture?Pt.setTextureCube(q,0):q.isData3DTexture?Pt.setTexture3D(q,0):q.isDataArrayTexture||q.isCompressedArrayTexture?Pt.setTexture2DArray(q,0):Pt.setTexture2D(q,0),wt.unbindTexture()},this.resetState=function(){B=0,U=0,D=null,wt.reset(),G.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Ds}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;let e=this.getContext();e.drawingBufferColorSpace=t===Yv?"display-p3":"srgb",e.unpackColorSpace=Rn.workingColorSpace===ud?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t}},wv=class extends Sv{};wv.prototype.isWebGL1Renderer=!0;var lf=class{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=ev,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Fs()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return tP("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,i){t*=this.stride,i*=e.stride;for(let s=0,u=this.stride;s<u;s++)this.array[t+s]=e.array[i+s];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Fs()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(e,this.stride);return i.setUsage(this.usage),i}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Fs()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}},Si=new st,ts=class n{constructor(t,e,i,s=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=i,this.normalized=s}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,i=this.data.count;e<i;e++)Si.fromBufferAttribute(this,e),Si.applyMatrix4(t),this.setXYZ(e,Si.x,Si.y,Si.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)Si.fromBufferAttribute(this,e),Si.applyNormalMatrix(t),this.setXYZ(e,Si.x,Si.y,Si.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)Si.fromBufferAttribute(this,e),Si.transformDirection(t),this.setXYZ(e,Si.x,Si.y,Si.z);return this}getComponent(t,e){let i=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(i=jo(i,this.array)),i}setComponent(t,e,i){return this.normalized&&(i=Pn(i,this.array)),this.data.array[t*this.data.stride+this.offset+e]=i,this}setX(t,e){return this.normalized&&(e=Pn(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=Pn(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=Pn(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=Pn(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=jo(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=jo(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=jo(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=jo(e,this.array)),e}setXY(t,e,i){return t=t*this.data.stride+this.offset,this.normalized&&(e=Pn(e,this.array),i=Pn(i,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this}setXYZ(t,e,i,s){return t=t*this.data.stride+this.offset,this.normalized&&(e=Pn(e,this.array),i=Pn(i,this.array),s=Pn(s,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=s,this}setXYZW(t,e,i,s,u){return t=t*this.data.stride+this.offset,this.normalized&&(e=Pn(e,this.array),i=Pn(i,this.array),s=Pn(s,this.array),u=Pn(u,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=s,this.data.array[t+3]=u,this}clone(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let e=[];for(let i=0;i<this.count;i++){let s=i*this.data.stride+this.offset;for(let u=0;u<this.itemSize;u++)e.push(this.data.array[s+u])}return new Yn(new this.array.constructor(e),this.itemSize,this.normalized)}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new n(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");let e=[];for(let i=0;i<this.count;i++){let s=i*this.data.stride+this.offset;for(let u=0;u<this.itemSize;u++)e.push(this.data.array[s+u])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}},Mv=class extends cu{constructor(t){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Te(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}},fa,tf=new st,gl=new st,ml=new st,yl=new Ft,ef=new Ft,lP=new jn,bp=new st,nf=new st,Ap=new st,DI=new Ft,Wy=new Ft,FI=new Ft,bv=class extends Oo{constructor(t=new Mv){if(super(),this.isSprite=!0,this.type="Sprite",fa===void 0){fa=new ui;let e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new lf(e,5);fa.setIndex([0,1,2,0,2,3]),fa.setAttribute("position",new ts(i,3,0,!1)),fa.setAttribute("uv",new ts(i,2,3,!1))}this.geometry=fa,this.material=t,this.center=new Ft(.5,.5)}raycast(t,e){t.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),gl.setFromMatrixScale(this.matrixWorld),lP.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),ml.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&gl.multiplyScalar(-ml.z);let i=this.material.rotation,s,u;i!==0&&(u=Math.cos(i),s=Math.sin(i));let c=this.center;Tp(bp.set(-.5,-.5,0),ml,c,gl,s,u),Tp(nf.set(.5,-.5,0),ml,c,gl,s,u),Tp(Ap.set(.5,.5,0),ml,c,gl,s,u),DI.set(0,0),Wy.set(1,0),FI.set(1,1);let f=t.ray.intersectTriangle(bp,nf,Ap,!1,tf);if(f===null&&(Tp(nf.set(-.5,.5,0),ml,c,gl,s,u),Wy.set(0,1),f=t.ray.intersectTriangle(bp,Ap,nf,!1,tf),f===null))return;let p=t.ray.origin.distanceTo(tf);p<t.near||p>t.far||e.push({distance:p,point:tf.clone(),uv:iu.getInterpolation(tf,bp,nf,Ap,DI,Wy,FI,new Ft),face:null,object:this})}copy(t,e){return super.copy(t,e),t.center!==void 0&&this.center.copy(t.center),this.material=t.material,this}};bv.Dispose=function(){fa.dispose(),fa=void 0};function Tp(n,t,e,i,s,u){yl.subVectors(n,e).addScalar(.5).multiply(i),s!==void 0?(ef.x=u*yl.x-s*yl.y,ef.y=s*yl.x+u*yl.y):ef.copy(yl),n.copy(t),n.x+=ef.x,n.y+=ef.y,n.applyMatrix4(lP)}var lo=class{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){let i=this.getUtoTmapping(t);return this.getPoint(i,e)}getPoints(t=5){let e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return e}getSpacedPoints(t=5){let e=[];for(let i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e}getLength(){let t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let e=[],i,s=this.getPoint(0),u=0;e.push(0);for(let c=1;c<=t;c++)i=this.getPoint(c/t),u+=i.distanceTo(s),e.push(u),s=i;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){let i=this.getLengths(),s=0,u=i.length,c;e?c=e:c=t*i[u-1];let f=0,p=u-1,d;for(;f<=p;)if(s=Math.floor(f+(p-f)/2),d=i[s]-c,d<0)f=s+1;else if(d>0)p=s-1;else{p=s;break}if(s=p,i[s]===c)return s/(u-1);let g=i[s],v=i[s+1]-g,E=(c-g)/v;return(s+E)/(u-1)}getTangent(t,e){let s=t-1e-4,u=t+1e-4;s<0&&(s=0),u>1&&(u=1);let c=this.getPoint(s),f=this.getPoint(u),p=e||(c.isVector2?new Ft:new st);return p.copy(f).sub(c).normalize(),p}getTangentAt(t,e){let i=this.getUtoTmapping(t);return this.getTangent(i,e)}computeFrenetFrames(t,e){let i=new st,s=[],u=[],c=[],f=new st,p=new jn;for(let E=0;E<=t;E++){let M=E/t;s[E]=this.getTangentAt(M,new st)}u[0]=new st,c[0]=new st;let d=Number.MAX_VALUE,g=Math.abs(s[0].x),y=Math.abs(s[0].y),v=Math.abs(s[0].z);g<=d&&(d=g,i.set(1,0,0)),y<=d&&(d=y,i.set(0,1,0)),v<=d&&i.set(0,0,1),f.crossVectors(s[0],i).normalize(),u[0].crossVectors(s[0],f),c[0].crossVectors(s[0],u[0]);for(let E=1;E<=t;E++){if(u[E]=u[E-1].clone(),c[E]=c[E-1].clone(),f.crossVectors(s[E-1],s[E]),f.length()>Number.EPSILON){f.normalize();let M=Math.acos(ai(s[E-1].dot(s[E]),-1,1));u[E].applyMatrix4(p.makeRotationAxis(f,M))}c[E].crossVectors(s[E],u[E])}if(e===!0){let E=Math.acos(ai(u[0].dot(u[t]),-1,1));E/=t,s[0].dot(f.crossVectors(u[0],u[t]))>0&&(E=-E);for(let M=1;M<=t;M++)u[M].applyMatrix4(p.makeRotationAxis(s[M],E*M)),c[M].crossVectors(s[M],u[M])}return{tangents:s,normals:u,binormals:c}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){let t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}},cf=class extends lo{constructor(t=0,e=0,i=1,s=1,u=0,c=Math.PI*2,f=!1,p=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=s,this.aStartAngle=u,this.aEndAngle=c,this.aClockwise=f,this.aRotation=p}getPoint(t,e=new Ft){let i=e,s=Math.PI*2,u=this.aEndAngle-this.aStartAngle,c=Math.abs(u)<Number.EPSILON;for(;u<0;)u+=s;for(;u>s;)u-=s;u<Number.EPSILON&&(c?u=0:u=s),this.aClockwise===!0&&!c&&(u===s?u=-s:u=u-s);let f=this.aStartAngle+t*u,p=this.aX+this.xRadius*Math.cos(f),d=this.aY+this.yRadius*Math.sin(f);if(this.aRotation!==0){let g=Math.cos(this.aRotation),y=Math.sin(this.aRotation),v=p-this.aX,E=d-this.aY;p=v*g-E*y+this.aX,d=v*y+E*g+this.aY}return i.set(p,d)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){let t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}},Av=class extends cf{constructor(t,e,i,s,u,c){super(t,e,i,i,s,u,c),this.isArcCurve=!0,this.type="ArcCurve"}};function Zv(){let n=0,t=0,e=0,i=0;function s(u,c,f,p){n=u,t=f,e=-3*u+3*c-2*f-p,i=2*u-2*c+f+p}return{initCatmullRom:function(u,c,f,p,d){s(c,f,d*(f-u),d*(p-c))},initNonuniformCatmullRom:function(u,c,f,p,d,g,y){let v=(c-u)/d-(f-u)/(d+g)+(f-c)/g,E=(f-c)/g-(p-c)/(g+y)+(p-f)/y;v*=g,E*=g,s(c,f,v,E)},calc:function(u){let c=u*u,f=c*u;return n+t*u+e*c+i*f}}}var Cp=new st,Xy=new Zv,Yy=new Zv,$y=new Zv,Tv=class extends lo{constructor(t=[],e=!1,i="centripetal",s=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=i,this.tension=s}getPoint(t,e=new st){let i=e,s=this.points,u=s.length,c=(u-(this.closed?0:1))*t,f=Math.floor(c),p=c-f;this.closed?f+=f>0?0:(Math.floor(Math.abs(f)/u)+1)*u:p===0&&f===u-1&&(f=u-2,p=1);let d,g;this.closed||f>0?d=s[(f-1)%u]:(Cp.subVectors(s[0],s[1]).add(s[0]),d=Cp);let y=s[f%u],v=s[(f+1)%u];if(this.closed||f+2<u?g=s[(f+2)%u]:(Cp.subVectors(s[u-1],s[u-2]).add(s[u-1]),g=Cp),this.curveType==="centripetal"||this.curveType==="chordal"){let E=this.curveType==="chordal"?.5:.25,M=Math.pow(d.distanceToSquared(y),E),A=Math.pow(y.distanceToSquared(v),E),_=Math.pow(v.distanceToSquared(g),E);A<1e-4&&(A=1),M<1e-4&&(M=A),_<1e-4&&(_=A),Xy.initNonuniformCatmullRom(d.x,y.x,v.x,g.x,M,A,_),Yy.initNonuniformCatmullRom(d.y,y.y,v.y,g.y,M,A,_),$y.initNonuniformCatmullRom(d.z,y.z,v.z,g.z,M,A,_)}else this.curveType==="catmullrom"&&(Xy.initCatmullRom(d.x,y.x,v.x,g.x,this.tension),Yy.initCatmullRom(d.y,y.y,v.y,g.y,this.tension),$y.initCatmullRom(d.z,y.z,v.z,g.z,this.tension));return i.set(Xy.calc(p),Yy.calc(p),$y.calc(p)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let s=t.points[e];this.points.push(s.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){let t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){let s=this.points[e];t.points.push(s.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let s=t.points[e];this.points.push(new st().fromArray(s))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}};function UI(n,t,e,i,s){let u=(i-t)*.5,c=(s-e)*.5,f=n*n,p=n*f;return(2*e-2*i+u+c)*p+(-3*e+3*i-2*u-c)*f+u*n+e}function U7(n,t){let e=1-n;return e*e*t}function B7(n,t){return 2*(1-n)*n*t}function z7(n,t){return n*n*t}function of(n,t,e,i){return U7(n,t)+B7(n,e)+z7(n,i)}function G7(n,t){let e=1-n;return e*e*e*t}function k7(n,t){let e=1-n;return 3*e*e*n*t}function q7(n,t){return 3*(1-n)*n*n*t}function V7(n,t){return n*n*n*t}function sf(n,t,e,i,s){return G7(n,t)+k7(n,e)+q7(n,i)+V7(n,s)}var Qp=class extends lo{constructor(t=new Ft,e=new Ft,i=new Ft,s=new Ft){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=i,this.v3=s}getPoint(t,e=new Ft){let i=e,s=this.v0,u=this.v1,c=this.v2,f=this.v3;return i.set(sf(t,s.x,u.x,c.x,f.x),sf(t,s.y,u.y,c.y,f.y)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}},Cv=class extends lo{constructor(t=new st,e=new st,i=new st,s=new st){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=i,this.v3=s}getPoint(t,e=new st){let i=e,s=this.v0,u=this.v1,c=this.v2,f=this.v3;return i.set(sf(t,s.x,u.x,c.x,f.x),sf(t,s.y,u.y,c.y,f.y),sf(t,s.z,u.z,c.z,f.z)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}},td=class extends lo{constructor(t=new Ft,e=new Ft){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new Ft){let i=e;return t===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new Ft){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},Iv=class extends lo{constructor(t=new st,e=new st){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=t,this.v2=e}getPoint(t,e=new st){let i=e;return t===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new st){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},ed=class extends lo{constructor(t=new Ft,e=new Ft,i=new Ft){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new Ft){let i=e,s=this.v0,u=this.v1,c=this.v2;return i.set(of(t,s.x,u.x,c.x),of(t,s.y,u.y,c.y)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},Pv=class extends lo{constructor(t=new st,e=new st,i=new st){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new st){let i=e,s=this.v0,u=this.v1,c=this.v2;return i.set(of(t,s.x,u.x,c.x),of(t,s.y,u.y,c.y),of(t,s.z,u.z,c.z)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},nd=class extends lo{constructor(t=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=t}getPoint(t,e=new Ft){let i=e,s=this.points,u=(s.length-1)*t,c=Math.floor(u),f=u-c,p=s[c===0?c:c-1],d=s[c],g=s[c>s.length-2?s.length-1:c+1],y=s[c>s.length-3?s.length-1:c+2];return i.set(UI(f,p.x,d.x,g.x,y.x),UI(f,p.y,d.y,g.y,y.y)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let s=t.points[e];this.points.push(s.clone())}return this}toJSON(){let t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){let s=this.points[e];t.points.push(s.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let s=t.points[e];this.points.push(new Ft().fromArray(s))}return this}},Rv=Object.freeze({__proto__:null,ArcCurve:Av,CatmullRomCurve3:Tv,CubicBezierCurve:Qp,CubicBezierCurve3:Cv,EllipseCurve:cf,LineCurve:td,LineCurve3:Iv,QuadraticBezierCurve:ed,QuadraticBezierCurve3:Pv,SplineCurve:nd}),Lv=class extends lo{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){let t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);if(!t.equals(e)){let i=t.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new Rv[i](e,t))}return this}getPoint(t,e){let i=t*this.getLength(),s=this.getCurveLengths(),u=0;for(;u<s.length;){if(s[u]>=i){let c=s[u]-i,f=this.curves[u],p=f.getLength(),d=p===0?0:1-c/p;return f.getPointAt(d,e)}u++}return null}getLength(){let t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let t=[],e=0;for(let i=0,s=this.curves.length;i<s;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t,t}getSpacedPoints(t=40){let e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){let e=[],i;for(let s=0,u=this.curves;s<u.length;s++){let c=u[s],f=c.isEllipseCurve?t*2:c.isLineCurve||c.isLineCurve3?1:c.isSplineCurve?t*c.points.length:t,p=c.getPoints(f);for(let d=0;d<p.length;d++){let g=p[d];i&&i.equals(g)||(e.push(g),i=g)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){let s=t.curves[e];this.curves.push(s.clone())}return this.autoClose=t.autoClose,this}toJSON(){let t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,i=this.curves.length;e<i;e++){let s=this.curves[e];t.curves.push(s.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){let s=t.curves[e];this.curves.push(new Rv[s.type]().fromJSON(s))}return this}},Cl=class extends Lv{constructor(t){super(),this.type="Path",this.currentPoint=new Ft,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,i=t.length;e<i;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){let i=new td(this.currentPoint.clone(),new Ft(t,e));return this.curves.push(i),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,i,s){let u=new ed(this.currentPoint.clone(),new Ft(t,e),new Ft(i,s));return this.curves.push(u),this.currentPoint.set(i,s),this}bezierCurveTo(t,e,i,s,u,c){let f=new Qp(this.currentPoint.clone(),new Ft(t,e),new Ft(i,s),new Ft(u,c));return this.curves.push(f),this.currentPoint.set(u,c),this}splineThru(t){let e=[this.currentPoint.clone()].concat(t),i=new nd(e);return this.curves.push(i),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,i,s,u,c){let f=this.currentPoint.x,p=this.currentPoint.y;return this.absarc(t+f,e+p,i,s,u,c),this}absarc(t,e,i,s,u,c){return this.absellipse(t,e,i,i,s,u,c),this}ellipse(t,e,i,s,u,c,f,p){let d=this.currentPoint.x,g=this.currentPoint.y;return this.absellipse(t+d,e+g,i,s,u,c,f,p),this}absellipse(t,e,i,s,u,c,f,p){let d=new cf(t,e,i,s,u,c,f,p);if(this.curves.length>0){let y=d.getPoint(0);y.equals(this.currentPoint)||this.lineTo(y.x,y.y)}this.curves.push(d);let g=d.getPoint(1);return this.currentPoint.copy(g),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){let t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}};var Il=class extends Cl{constructor(t){super(t),this.uuid=Fs(),this.type="Shape",this.holes=[]}getPointsHoles(t){let e=[];for(let i=0,s=this.holes.length;i<s;i++)e[i]=this.holes[i].getPoints(t);return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let e=0,i=t.holes.length;e<i;e++){let s=t.holes[e];this.holes.push(s.clone())}return this}toJSON(){let t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,i=this.holes.length;e<i;e++){let s=this.holes[e];t.holes.push(s.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,i=t.holes.length;e<i;e++){let s=t.holes[e];this.holes.push(new Cl().fromJSON(s))}return this}},H7={triangulate:function(n,t,e=2){let i=t&&t.length,s=i?t[0]*e:n.length,u=cP(n,0,s,e,!0),c=[];if(!u||u.next===u.prev)return c;let f,p,d,g,y,v,E;if(i&&(u=Z7(n,t,u,e)),n.length>80*e){f=d=n[0],p=g=n[1];for(let M=e;M<s;M+=e)y=n[M],v=n[M+1],y<f&&(f=y),v<p&&(p=v),y>d&&(d=y),v>g&&(g=v);E=Math.max(d-f,g-p),E=E!==0?32767/E:0}return ff(u,c,e,f,p,E,0),c}};function cP(n,t,e,i,s){let u,c;if(s===sY(n,t,e,i)>0)for(u=t;u<e;u+=i)c=BI(u,n[u],n[u+1],c);else for(u=e-i;u>=t;u-=i)c=BI(u,n[u],n[u+1],c);return c&&cd(c,c.next)&&(pf(c),c=c.next),c}function fu(n,t){if(!n)return n;t||(t=n);let e=n,i;do if(i=!1,!e.steiner&&(cd(e,e.next)||Jn(e.prev,e,e.next)===0)){if(pf(e),e=t=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==t);return t}function ff(n,t,e,i,s,u,c){if(!n)return;!c&&u&&tY(n,i,s,u);let f=n,p,d;for(;n.prev!==n.next;){if(p=n.prev,d=n.next,u?X7(n,i,s,u):W7(n)){t.push(p.i/e|0),t.push(n.i/e|0),t.push(d.i/e|0),pf(n),n=d.next,f=d.next;continue}if(n=d,n===f){c?c===1?(n=Y7(fu(n),t,e),ff(n,t,e,i,s,u,2)):c===2&&$7(n,t,e,i,s,u):ff(fu(n),t,e,i,s,u,1);break}}}function W7(n){let t=n.prev,e=n,i=n.next;if(Jn(t,e,i)>=0)return!1;let s=t.x,u=e.x,c=i.x,f=t.y,p=e.y,d=i.y,g=s<u?s<c?s:c:u<c?u:c,y=f<p?f<d?f:d:p<d?p:d,v=s>u?s>c?s:c:u>c?u:c,E=f>p?f>d?f:d:p>d?p:d,M=i.next;for(;M!==t;){if(M.x>=g&&M.x<=v&&M.y>=y&&M.y<=E&&xl(s,f,u,p,c,d,M.x,M.y)&&Jn(M.prev,M,M.next)>=0)return!1;M=M.next}return!0}function X7(n,t,e,i){let s=n.prev,u=n,c=n.next;if(Jn(s,u,c)>=0)return!1;let f=s.x,p=u.x,d=c.x,g=s.y,y=u.y,v=c.y,E=f<p?f<d?f:d:p<d?p:d,M=g<y?g<v?g:v:y<v?y:v,A=f>p?f>d?f:d:p>d?p:d,_=g>y?g>v?g:v:y>v?y:v,x=Nv(E,M,t,e,i),T=Nv(A,_,t,e,i),w=n.prevZ,R=n.nextZ;for(;w&&w.z>=x&&R&&R.z<=T;){if(w.x>=E&&w.x<=A&&w.y>=M&&w.y<=_&&w!==s&&w!==c&&xl(f,g,p,y,d,v,w.x,w.y)&&Jn(w.prev,w,w.next)>=0||(w=w.prevZ,R.x>=E&&R.x<=A&&R.y>=M&&R.y<=_&&R!==s&&R!==c&&xl(f,g,p,y,d,v,R.x,R.y)&&Jn(R.prev,R,R.next)>=0))return!1;R=R.nextZ}for(;w&&w.z>=x;){if(w.x>=E&&w.x<=A&&w.y>=M&&w.y<=_&&w!==s&&w!==c&&xl(f,g,p,y,d,v,w.x,w.y)&&Jn(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;R&&R.z<=T;){if(R.x>=E&&R.x<=A&&R.y>=M&&R.y<=_&&R!==s&&R!==c&&xl(f,g,p,y,d,v,R.x,R.y)&&Jn(R.prev,R,R.next)>=0)return!1;R=R.nextZ}return!0}function Y7(n,t,e){let i=n;do{let s=i.prev,u=i.next.next;!cd(s,u)&&fP(s,i,i.next,u)&&hf(s,u)&&hf(u,s)&&(t.push(s.i/e|0),t.push(i.i/e|0),t.push(u.i/e|0),pf(i),pf(i.next),i=n=u),i=i.next}while(i!==n);return fu(i)}function $7(n,t,e,i,s,u){let c=n;do{let f=c.next.next;for(;f!==c.prev;){if(c.i!==f.i&&rY(c,f)){let p=hP(c,f);c=fu(c,c.next),p=fu(p,p.next),ff(c,t,e,i,s,u,0),ff(p,t,e,i,s,u,0);return}f=f.next}c=c.next}while(c!==n)}function Z7(n,t,e,i){let s=[],u,c,f,p,d;for(u=0,c=t.length;u<c;u++)f=t[u]*i,p=u<c-1?t[u+1]*i:n.length,d=cP(n,f,p,i,!1),d===d.next&&(d.steiner=!0),s.push(nY(d));for(s.sort(J7),u=0;u<s.length;u++)e=j7(s[u],e);return e}function J7(n,t){return n.x-t.x}function j7(n,t){let e=K7(n,t);if(!e)return t;let i=hP(e,n);return fu(i,i.next),fu(e,e.next)}function K7(n,t){let e=t,i=-1/0,s,u=n.x,c=n.y;do{if(c<=e.y&&c>=e.next.y&&e.next.y!==e.y){let v=e.x+(c-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(v<=u&&v>i&&(i=v,s=e.x<e.next.x?e:e.next,v===u))return s}e=e.next}while(e!==t);if(!s)return null;let f=s,p=s.x,d=s.y,g=1/0,y;e=s;do u>=e.x&&e.x>=p&&u!==e.x&&xl(c<d?u:i,c,p,d,c<d?i:u,c,e.x,e.y)&&(y=Math.abs(c-e.y)/(u-e.x),hf(e,n)&&(y<g||y===g&&(e.x>s.x||e.x===s.x&&Q7(s,e)))&&(s=e,g=y)),e=e.next;while(e!==f);return s}function Q7(n,t){return Jn(n.prev,n,t.prev)<0&&Jn(t.next,n,n.next)<0}function tY(n,t,e,i){let s=n;do s.z===0&&(s.z=Nv(s.x,s.y,t,e,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==n);s.prevZ.nextZ=null,s.prevZ=null,eY(s)}function eY(n){let t,e,i,s,u,c,f,p,d=1;do{for(e=n,n=null,u=null,c=0;e;){for(c++,i=e,f=0,t=0;t<d&&(f++,i=i.nextZ,!!i);t++);for(p=d;f>0||p>0&&i;)f!==0&&(p===0||!i||e.z<=i.z)?(s=e,e=e.nextZ,f--):(s=i,i=i.nextZ,p--),u?u.nextZ=s:n=s,s.prevZ=u,u=s;e=i}u.nextZ=null,d*=2}while(c>1);return n}function Nv(n,t,e,i,s){return n=(n-e)*s|0,t=(t-i)*s|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n|t<<1}function nY(n){let t=n,e=n;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==n);return e}function xl(n,t,e,i,s,u,c,f){return(s-c)*(t-f)>=(n-c)*(u-f)&&(n-c)*(i-f)>=(e-c)*(t-f)&&(e-c)*(u-f)>=(s-c)*(i-f)}function rY(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!iY(n,t)&&(hf(n,t)&&hf(t,n)&&oY(n,t)&&(Jn(n.prev,n,t.prev)||Jn(n,t.prev,t))||cd(n,t)&&Jn(n.prev,n,n.next)>0&&Jn(t.prev,t,t.next)>0)}function Jn(n,t,e){return(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y)}function cd(n,t){return n.x===t.x&&n.y===t.y}function fP(n,t,e,i){let s=Pp(Jn(n,t,e)),u=Pp(Jn(n,t,i)),c=Pp(Jn(e,i,n)),f=Pp(Jn(e,i,t));return!!(s!==u&&c!==f||s===0&&Ip(n,e,t)||u===0&&Ip(n,i,t)||c===0&&Ip(e,n,i)||f===0&&Ip(e,t,i))}function Ip(n,t,e){return t.x<=Math.max(n.x,e.x)&&t.x>=Math.min(n.x,e.x)&&t.y<=Math.max(n.y,e.y)&&t.y>=Math.min(n.y,e.y)}function Pp(n){return n>0?1:n<0?-1:0}function iY(n,t){let e=n;do{if(e.i!==n.i&&e.next.i!==n.i&&e.i!==t.i&&e.next.i!==t.i&&fP(e,e.next,n,t))return!0;e=e.next}while(e!==n);return!1}function hf(n,t){return Jn(n.prev,n,n.next)<0?Jn(n,t,n.next)>=0&&Jn(n,n.prev,t)>=0:Jn(n,t,n.prev)<0||Jn(n,n.next,t)<0}function oY(n,t){let e=n,i=!1,s=(n.x+t.x)/2,u=(n.y+t.y)/2;do e.y>u!=e.next.y>u&&e.next.y!==e.y&&s<(e.next.x-e.x)*(u-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==n);return i}function hP(n,t){let e=new Ov(n.i,n.x,n.y),i=new Ov(t.i,t.x,t.y),s=n.next,u=t.prev;return n.next=t,t.prev=n,e.next=s,s.prev=e,i.next=e,e.prev=i,u.next=i,i.prev=u,i}function BI(n,t,e,i){let s=new Ov(n,t,e);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function pf(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function Ov(n,t,e){this.i=n,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function sY(n,t,e,i){let s=0;for(let u=t,c=e-i;u<e;u+=i)s+=(n[c]-n[u])*(n[u+1]+n[c+1]),c=u;return s}var ya=class n{static area(t){let e=t.length,i=0;for(let s=e-1,u=0;u<e;s=u++)i+=t[s].x*t[u].y-t[u].x*t[s].y;return i*.5}static isClockWise(t){return n.area(t)<0}static triangulateShape(t,e){let i=[],s=[],u=[];zI(t),GI(i,t);let c=t.length;e.forEach(zI);for(let p=0;p<e.length;p++)s.push(c),c+=e[p].length,GI(i,e[p]);let f=H7.triangulate(i,s);for(let p=0;p<f.length;p+=3)u.push(f.slice(p,p+3));return u}};function zI(n){let t=n.length;t>2&&n[t-1].equals(n[0])&&n.pop()}function GI(n,t){for(let e=0;e<t.length;e++)n.push(t[e].x),n.push(t[e].y)}var rd=class n extends ui{constructor(t=new Il([new Ft(.5,.5),new Ft(-.5,.5),new Ft(-.5,-.5),new Ft(.5,-.5)]),e={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];let i=this,s=[],u=[];for(let f=0,p=t.length;f<p;f++){let d=t[f];c(d)}this.setAttribute("position",new _r(s,3)),this.setAttribute("uv",new _r(u,2)),this.computeVertexNormals();function c(f){let p=[],d=e.curveSegments!==void 0?e.curveSegments:12,g=e.steps!==void 0?e.steps:1,y=e.depth!==void 0?e.depth:1,v=e.bevelEnabled!==void 0?e.bevelEnabled:!0,E=e.bevelThickness!==void 0?e.bevelThickness:.2,M=e.bevelSize!==void 0?e.bevelSize:E-.1,A=e.bevelOffset!==void 0?e.bevelOffset:0,_=e.bevelSegments!==void 0?e.bevelSegments:3,x=e.extrudePath,T=e.UVGenerator!==void 0?e.UVGenerator:aY,w,R=!1,B,U,D,P;x&&(w=x.getSpacedPoints(g),R=!0,v=!1,B=x.computeFrenetFrames(g,!1),U=new st,D=new st,P=new st),v||(_=0,E=0,M=0,A=0);let ct=f.extractPoints(d),L=ct.shape,W=ct.holes;if(!ya.isClockWise(L)){L=L.reverse();for(let Z=0,Ot=W.length;Z<Ot;Z++){let _t=W[Z];ya.isClockWise(_t)&&(W[Z]=_t.reverse())}}let Mt=ya.triangulateShape(L,W),$=L;for(let Z=0,Ot=W.length;Z<Ot;Z++){let _t=W[Z];L=L.concat(_t)}function gt(Z,Ot,_t){return Ot||console.error("THREE.ExtrudeGeometry: vec does not exist"),Z.clone().addScaledVector(Ot,_t)}let ft=L.length,vt=Mt.length;function it(Z,Ot,_t){let Nt,wt,Ht,Xt=Z.x-Ot.x,Pt=Z.y-Ot.y,ne=_t.x-Z.x,Y=_t.y-Z.y,N=Xt*Xt+Pt*Pt,xt=Xt*Y-Pt*ne;if(Math.abs(xt)>Number.EPSILON){let St=Math.sqrt(N),ot=Math.sqrt(ne*ne+Y*Y),Lt=Ot.x-Pt/St,ce=Ot.y+Xt/St,Rt=_t.x-Y/ot,Bt=_t.y+ne/ot,Wt=((Rt-Lt)*Y-(Bt-ce)*ne)/(Xt*Y-Pt*ne);Nt=Lt+Xt*Wt-Z.x,wt=ce+Pt*Wt-Z.y;let j=Nt*Nt+wt*wt;if(j<=2)return new Ft(Nt,wt);Ht=Math.sqrt(j/2)}else{let St=!1;Xt>Number.EPSILON?ne>Number.EPSILON&&(St=!0):Xt<-Number.EPSILON?ne<-Number.EPSILON&&(St=!0):Math.sign(Pt)===Math.sign(Y)&&(St=!0),St?(Nt=-Pt,wt=Xt,Ht=Math.sqrt(N)):(Nt=Xt,wt=Pt,Ht=Math.sqrt(N/2))}return new Ft(Nt/Ht,wt/Ht)}let lt=[];for(let Z=0,Ot=$.length,_t=Ot-1,Nt=Z+1;Z<Ot;Z++,_t++,Nt++)_t===Ot&&(_t=0),Nt===Ot&&(Nt=0),lt[Z]=it($[Z],$[_t],$[Nt]);let H=[],At,It=lt.concat();for(let Z=0,Ot=W.length;Z<Ot;Z++){let _t=W[Z];At=[];for(let Nt=0,wt=_t.length,Ht=wt-1,Xt=Nt+1;Nt<wt;Nt++,Ht++,Xt++)Ht===wt&&(Ht=0),Xt===wt&&(Xt=0),At[Nt]=it(_t[Nt],_t[Ht],_t[Xt]);H.push(At),It=It.concat(At)}for(let Z=0;Z<_;Z++){let Ot=Z/_,_t=E*Math.cos(Ot*Math.PI/2),Nt=M*Math.sin(Ot*Math.PI/2)+A;for(let wt=0,Ht=$.length;wt<Ht;wt++){let Xt=gt($[wt],lt[wt],Nt);$t(Xt.x,Xt.y,-_t)}for(let wt=0,Ht=W.length;wt<Ht;wt++){let Xt=W[wt];At=H[wt];for(let Pt=0,ne=Xt.length;Pt<ne;Pt++){let Y=gt(Xt[Pt],At[Pt],Nt);$t(Y.x,Y.y,-_t)}}}let jt=M+A;for(let Z=0;Z<ft;Z++){let Ot=v?gt(L[Z],It[Z],jt):L[Z];R?(D.copy(B.normals[0]).multiplyScalar(Ot.x),U.copy(B.binormals[0]).multiplyScalar(Ot.y),P.copy(w[0]).add(D).add(U),$t(P.x,P.y,P.z)):$t(Ot.x,Ot.y,0)}for(let Z=1;Z<=g;Z++)for(let Ot=0;Ot<ft;Ot++){let _t=v?gt(L[Ot],It[Ot],jt):L[Ot];R?(D.copy(B.normals[Z]).multiplyScalar(_t.x),U.copy(B.binormals[Z]).multiplyScalar(_t.y),P.copy(w[Z]).add(D).add(U),$t(P.x,P.y,P.z)):$t(_t.x,_t.y,y/g*Z)}for(let Z=_-1;Z>=0;Z--){let Ot=Z/_,_t=E*Math.cos(Ot*Math.PI/2),Nt=M*Math.sin(Ot*Math.PI/2)+A;for(let wt=0,Ht=$.length;wt<Ht;wt++){let Xt=gt($[wt],lt[wt],Nt);$t(Xt.x,Xt.y,y+_t)}for(let wt=0,Ht=W.length;wt<Ht;wt++){let Xt=W[wt];At=H[wt];for(let Pt=0,ne=Xt.length;Pt<ne;Pt++){let Y=gt(Xt[Pt],At[Pt],Nt);R?$t(Y.x,Y.y+w[g-1].y,w[g-1].x+_t):$t(Y.x,Y.y,y+_t)}}}nt(),bt();function nt(){let Z=s.length/3;if(v){let Ot=0,_t=ft*Ot;for(let Nt=0;Nt<vt;Nt++){let wt=Mt[Nt];Ut(wt[2]+_t,wt[1]+_t,wt[0]+_t)}Ot=g+_*2,_t=ft*Ot;for(let Nt=0;Nt<vt;Nt++){let wt=Mt[Nt];Ut(wt[0]+_t,wt[1]+_t,wt[2]+_t)}}else{for(let Ot=0;Ot<vt;Ot++){let _t=Mt[Ot];Ut(_t[2],_t[1],_t[0])}for(let Ot=0;Ot<vt;Ot++){let _t=Mt[Ot];Ut(_t[0]+ft*g,_t[1]+ft*g,_t[2]+ft*g)}}i.addGroup(Z,s.length/3-Z,0)}function bt(){let Z=s.length/3,Ot=0;Vt($,Ot),Ot+=$.length;for(let _t=0,Nt=W.length;_t<Nt;_t++){let wt=W[_t];Vt(wt,Ot),Ot+=wt.length}i.addGroup(Z,s.length/3-Z,1)}function Vt(Z,Ot){let _t=Z.length;for(;--_t>=0;){let Nt=_t,wt=_t-1;wt<0&&(wt=Z.length-1);for(let Ht=0,Xt=g+_*2;Ht<Xt;Ht++){let Pt=ft*Ht,ne=ft*(Ht+1),Y=Ot+Nt+Pt,N=Ot+wt+Pt,xt=Ot+wt+ne,St=Ot+Nt+ne;Gt(Y,N,xt,St)}}}function $t(Z,Ot,_t){p.push(Z),p.push(Ot),p.push(_t)}function Ut(Z,Ot,_t){Ct(Z),Ct(Ot),Ct(_t);let Nt=s.length/3,wt=T.generateTopUV(i,s,Nt-3,Nt-2,Nt-1);ee(wt[0]),ee(wt[1]),ee(wt[2])}function Gt(Z,Ot,_t,Nt){Ct(Z),Ct(Ot),Ct(Nt),Ct(Ot),Ct(_t),Ct(Nt);let wt=s.length/3,Ht=T.generateSideWallUV(i,s,wt-6,wt-3,wt-2,wt-1);ee(Ht[0]),ee(Ht[1]),ee(Ht[3]),ee(Ht[1]),ee(Ht[2]),ee(Ht[3])}function Ct(Z){s.push(p[Z*3+0]),s.push(p[Z*3+1]),s.push(p[Z*3+2])}function ee(Z){u.push(Z.x),u.push(Z.y)}}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){let t=super.toJSON(),e=this.parameters.shapes,i=this.parameters.options;return uY(e,i,t)}static fromJSON(t,e){let i=[];for(let u=0,c=t.shapes.length;u<c;u++){let f=e[t.shapes[u]];i.push(f)}let s=t.options.extrudePath;return s!==void 0&&(t.options.extrudePath=new Rv[s.type]().fromJSON(s)),new n(i,t.options)}},aY={generateTopUV:function(n,t,e,i,s){let u=t[e*3],c=t[e*3+1],f=t[i*3],p=t[i*3+1],d=t[s*3],g=t[s*3+1];return[new Ft(u,c),new Ft(f,p),new Ft(d,g)]},generateSideWallUV:function(n,t,e,i,s,u){let c=t[e*3],f=t[e*3+1],p=t[e*3+2],d=t[i*3],g=t[i*3+1],y=t[i*3+2],v=t[s*3],E=t[s*3+1],M=t[s*3+2],A=t[u*3],_=t[u*3+1],x=t[u*3+2];return Math.abs(f-g)<Math.abs(c-d)?[new Ft(c,1-p),new Ft(d,1-y),new Ft(v,1-M),new Ft(A,1-x)]:[new Ft(f,1-p),new Ft(g,1-y),new Ft(E,1-M),new Ft(_,1-x)]}};function uY(n,t,e){if(e.shapes=[],Array.isArray(n))for(let i=0,s=n.length;i<s;i++){let u=n[i];e.shapes.push(u.uuid)}else e.shapes.push(n.uuid);return e.options=Object.assign({},t),t.extrudePath!==void 0&&(e.options.extrudePath=t.extrudePath.toJSON()),e}var id=class n extends ui{constructor(t=new Il([new Ft(0,.5),new Ft(-.5,-.5),new Ft(.5,-.5)]),e=12){super(),this.type="ShapeGeometry",this.parameters={shapes:t,curveSegments:e};let i=[],s=[],u=[],c=[],f=0,p=0;if(Array.isArray(t)===!1)d(t);else for(let g=0;g<t.length;g++)d(t[g]),this.addGroup(f,p,g),f+=p,p=0;this.setIndex(i),this.setAttribute("position",new _r(s,3)),this.setAttribute("normal",new _r(u,3)),this.setAttribute("uv",new _r(c,2));function d(g){let y=s.length/3,v=g.extractPoints(e),E=v.shape,M=v.holes;ya.isClockWise(E)===!1&&(E=E.reverse());for(let _=0,x=M.length;_<x;_++){let T=M[_];ya.isClockWise(T)===!0&&(M[_]=T.reverse())}let A=ya.triangulateShape(E,M);for(let _=0,x=M.length;_<x;_++){let T=M[_];E=E.concat(T)}for(let _=0,x=E.length;_<x;_++){let T=E[_];s.push(T.x,T.y,0),u.push(0,0,1),c.push(T.x,T.y)}for(let _=0,x=A.length;_<x;_++){let T=A[_],w=T[0]+y,R=T[1]+y,B=T[2]+y;i.push(w,R,B),p+=3}}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){let t=super.toJSON(),e=this.parameters.shapes;return lY(e,t)}static fromJSON(t,e){let i=[];for(let s=0,u=t.shapes.length;s<u;s++){let c=e[t.shapes[s]];i.push(c)}return new n(i,t.curveSegments)}};function lY(n,t){if(t.shapes=[],Array.isArray(n))for(let e=0,i=n.length;e<i;e++){let s=n[e];t.shapes.push(s.uuid)}else t.shapes.push(n.uuid);return t}var od=class extends ui{constructor(t=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:t},t!==null){let e=[],i=new Set,s=new st,u=new st;if(t.index!==null){let c=t.attributes.position,f=t.index,p=t.groups;p.length===0&&(p=[{start:0,count:f.count,materialIndex:0}]);for(let d=0,g=p.length;d<g;++d){let y=p[d],v=y.start,E=y.count;for(let M=v,A=v+E;M<A;M+=3)for(let _=0;_<3;_++){let x=f.getX(M+_),T=f.getX(M+(_+1)%3);s.fromBufferAttribute(c,x),u.fromBufferAttribute(c,T),kI(s,u,i)===!0&&(e.push(s.x,s.y,s.z),e.push(u.x,u.y,u.z))}}}else{let c=t.attributes.position;for(let f=0,p=c.count/3;f<p;f++)for(let d=0;d<3;d++){let g=3*f+d,y=3*f+(d+1)%3;s.fromBufferAttribute(c,g),u.fromBufferAttribute(c,y),kI(s,u,i)===!0&&(e.push(s.x,s.y,s.z),e.push(u.x,u.y,u.z))}}this.setAttribute("position",new _r(e,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}};function kI(n,t,e){let i=\`\${n.x},\${n.y},\${n.z}-\${t.x},\${t.y},\${t.z}\`,s=\`\${t.x},\${t.y},\${t.z}-\${n.x},\${n.y},\${n.z}\`;return e.has(i)===!0||e.has(s)===!0?!1:(e.add(i),e.add(s),!0)}function Rp(n,t,e){return!n||!e&&n.constructor===t?n:typeof t.BYTES_PER_ELEMENT=="number"?new t(n):Array.prototype.slice.call(n)}function cY(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}var Pl=class{constructor(t,e,i,s){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=s!==void 0?s:new e.constructor(i),this.sampleValues=e,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(t){let e=this.parameterPositions,i=this._cachedIndex,s=e[i],u=e[i-1];n:{t:{let c;e:{r:if(!(t<s)){for(let f=i+2;;){if(s===void 0){if(t<u)break r;return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===f)break;if(u=s,s=e[++i],t<s)break t}c=e.length;break e}if(!(t>=u)){let f=e[1];t<f&&(i=2,u=f);for(let p=i-2;;){if(u===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===p)break;if(s=u,u=e[--i-1],t>=u)break t}c=i,i=0;break e}break n}for(;i<c;){let f=i+c>>>1;t<e[f]?c=f:i=f+1}if(s=e[i],u=e[i-1],u===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(s===void 0)return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,u,s)}return this.interpolate_(i,u,t,s)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,i=this.sampleValues,s=this.valueSize,u=t*s;for(let c=0;c!==s;++c)e[c]=i[u+c];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},Dv=class extends Pl{constructor(t,e,i,s){super(t,e,i,s),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:HC,endingEnd:HC}}intervalChanged_(t,e,i){let s=this.parameterPositions,u=t-2,c=t+1,f=s[u],p=s[c];if(f===void 0)switch(this.getSettings_().endingStart){case WC:u=t,f=2*e-i;break;case XC:u=s.length-2,f=e+s[u]-s[u+1];break;default:u=t,f=i}if(p===void 0)switch(this.getSettings_().endingEnd){case WC:c=t,p=2*i-e;break;case XC:c=1,p=i+s[1]-s[0];break;default:c=t-1,p=e}let d=(i-e)*.5,g=this.valueSize;this._weightPrev=d/(e-f),this._weightNext=d/(p-i),this._offsetPrev=u*g,this._offsetNext=c*g}interpolate_(t,e,i,s){let u=this.resultBuffer,c=this.sampleValues,f=this.valueSize,p=t*f,d=p-f,g=this._offsetPrev,y=this._offsetNext,v=this._weightPrev,E=this._weightNext,M=(i-e)/(s-e),A=M*M,_=A*M,x=-v*_+2*v*A-v*M,T=(1+v)*_+(-1.5-2*v)*A+(-.5+v)*M+1,w=(-1-E)*_+(1.5+E)*A+.5*M,R=E*_-E*A;for(let B=0;B!==f;++B)u[B]=x*c[g+B]+T*c[d+B]+w*c[p+B]+R*c[y+B];return u}},Fv=class extends Pl{constructor(t,e,i,s){super(t,e,i,s)}interpolate_(t,e,i,s){let u=this.resultBuffer,c=this.sampleValues,f=this.valueSize,p=t*f,d=p-f,g=(i-e)/(s-e),y=1-g;for(let v=0;v!==f;++v)u[v]=c[d+v]*y+c[p+v]*g;return u}},Uv=class extends Pl{constructor(t,e,i,s){super(t,e,i,s)}interpolate_(t){return this.copySampleValue_(t-1)}},Do=class{constructor(t,e,i,s){if(t===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(e===void 0||e.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Rp(e,this.TimeBufferType),this.values=Rp(i,this.ValueBufferType),this.setInterpolation(s||this.DefaultInterpolation)}static toJSON(t){let e=t.constructor,i;if(e.toJSON!==this.toJSON)i=e.toJSON(t);else{i={name:t.name,times:Rp(t.times,Array),values:Rp(t.values,Array)};let s=t.getInterpolation();s!==t.DefaultInterpolation&&(i.interpolation=s)}return i.type=t.ValueTypeName,i}InterpolantFactoryMethodDiscrete(t){return new Uv(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new Fv(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new Dv(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case Np:e=this.InterpolantFactoryMethodDiscrete;break;case Op:e=this.InterpolantFactoryMethodLinear;break;case vy:e=this.InterpolantFactoryMethodSmooth;break}if(e===void 0){let i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(i);return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Np;case this.InterpolantFactoryMethodLinear:return Op;case this.InterpolantFactoryMethodSmooth:return vy}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){let e=this.times;for(let i=0,s=e.length;i!==s;++i)e[i]+=t}return this}scale(t){if(t!==1){let e=this.times;for(let i=0,s=e.length;i!==s;++i)e[i]*=t}return this}trim(t,e){let i=this.times,s=i.length,u=0,c=s-1;for(;u!==s&&i[u]<t;)++u;for(;c!==-1&&i[c]>e;)--c;if(++c,u!==0||c!==s){u>=c&&(c=Math.max(c,1),u=c-1);let f=this.getValueSize();this.times=i.slice(u,c),this.values=this.values.slice(u*f,c*f)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);let i=this.times,s=this.values,u=i.length;u===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let c=null;for(let f=0;f!==u;f++){let p=i[f];if(typeof p=="number"&&isNaN(p)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,f,p),t=!1;break}if(c!==null&&c>p){console.error("THREE.KeyframeTrack: Out of order keys.",this,f,p,c),t=!1;break}c=p}if(s!==void 0&&cY(s))for(let f=0,p=s.length;f!==p;++f){let d=s[f];if(isNaN(d)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,f,d),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),i=this.getValueSize(),s=this.getInterpolation()===vy,u=t.length-1,c=1;for(let f=1;f<u;++f){let p=!1,d=t[f],g=t[f+1];if(d!==g&&(f!==1||d!==t[0]))if(s)p=!0;else{let y=f*i,v=y-i,E=y+i;for(let M=0;M!==i;++M){let A=e[y+M];if(A!==e[v+M]||A!==e[E+M]){p=!0;break}}}if(p){if(f!==c){t[c]=t[f];let y=f*i,v=c*i;for(let E=0;E!==i;++E)e[v+E]=e[y+E]}++c}}if(u>0){t[c]=t[u];for(let f=u*i,p=c*i,d=0;d!==i;++d)e[p+d]=e[f+d];++c}return c!==t.length?(this.times=t.slice(0,c),this.values=e.slice(0,c*i)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),i=this.constructor,s=new i(this.name,t,e);return s.createInterpolant=this.createInterpolant,s}};Do.prototype.TimeBufferType=Float32Array;Do.prototype.ValueBufferType=Float32Array;Do.prototype.DefaultInterpolation=Op;var hu=class extends Do{};hu.prototype.ValueTypeName="bool";hu.prototype.ValueBufferType=Array;hu.prototype.DefaultInterpolation=Np;hu.prototype.InterpolantFactoryMethodLinear=void 0;hu.prototype.InterpolantFactoryMethodSmooth=void 0;var Bv=class extends Do{};Bv.prototype.ValueTypeName="color";var zv=class extends Do{};zv.prototype.ValueTypeName="number";var Gv=class extends Pl{constructor(t,e,i,s){super(t,e,i,s)}interpolate_(t,e,i,s){let u=this.resultBuffer,c=this.sampleValues,f=this.valueSize,p=(i-e)/(s-e),d=t*f;for(let g=d+f;d!==g;d+=4)No.slerpFlat(u,0,c,d-f,c,d,p);return u}},df=class extends Do{InterpolantFactoryMethodLinear(t){return new Gv(this.times,this.values,this.getValueSize(),t)}};df.prototype.ValueTypeName="quaternion";df.prototype.DefaultInterpolation=Op;df.prototype.InterpolantFactoryMethodSmooth=void 0;var pu=class extends Do{};pu.prototype.ValueTypeName="string";pu.prototype.ValueBufferType=Array;pu.prototype.DefaultInterpolation=Np;pu.prototype.InterpolantFactoryMethodLinear=void 0;pu.prototype.InterpolantFactoryMethodSmooth=void 0;var kv=class extends Do{};kv.prototype.ValueTypeName="vector";var qv=class{constructor(t,e,i){let s=this,u=!1,c=0,f=0,p,d=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this.itemStart=function(g){f++,u===!1&&s.onStart!==void 0&&s.onStart(g,c,f),u=!0},this.itemEnd=function(g){c++,s.onProgress!==void 0&&s.onProgress(g,c,f),c===f&&(u=!1,s.onLoad!==void 0&&s.onLoad())},this.itemError=function(g){s.onError!==void 0&&s.onError(g)},this.resolveURL=function(g){return p?p(g):g},this.setURLModifier=function(g){return p=g,this},this.addHandler=function(g,y){return d.push(g,y),this},this.removeHandler=function(g){let y=d.indexOf(g);return y!==-1&&d.splice(y,2),this},this.getHandler=function(g){for(let y=0,v=d.length;y<v;y+=2){let E=d[y],M=d[y+1];if(E.global&&(E.lastIndex=0),E.test(g))return M}return null}}},fY=new qv,Vv=class{constructor(t){this.manager=t!==void 0?t:fY,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){let i=this;return new Promise(function(s,u){i.load(t,s,e,u)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}};Vv.DEFAULT_MATERIAL_NAME="__DEFAULT";var sd=class extends ui{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}toJSON(){let t=super.toJSON();return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}};var Jv="\\\\[\\\\]\\\\.:\\\\/",hY=new RegExp("["+Jv+"]","g"),jv="[^"+Jv+"]",pY="[^"+Jv.replace("\\\\.","")+"]",dY=/((?:WC+[\\/:])*)/.source.replace("WC",jv),gY=/(WCOD+)?/.source.replace("WCOD",pY),mY=/(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace("WC",jv),yY=/\\.(WC+)(?:\\[(.+)\\])?/.source.replace("WC",jv),vY=new RegExp("^"+dY+gY+mY+yY+"$"),_Y=["material","materials","bones","map"],Hv=class{constructor(t,e,i){let s=i||Xn.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,s)}getValue(t,e){this.bind();let i=this._targetGroup.nCachedObjects_,s=this._bindings[i];s!==void 0&&s.getValue(t,e)}setValue(t,e){let i=this._bindings;for(let s=this._targetGroup.nCachedObjects_,u=i.length;s!==u;++s)i[s].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}},Xn=class n{constructor(t,e,i){this.path=e,this.parsedPath=i||n.parseTrackName(e),this.node=n.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,i){return t&&t.isAnimationObjectGroup?new n.Composite(t,e,i):new n(t,e,i)}static sanitizeNodeName(t){return t.replace(/\\s/g,"_").replace(hY,"")}static parseTrackName(t){let e=vY.exec(t);if(e===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);let i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},s=i.nodeName&&i.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){let u=i.nodeName.substring(s+1);_Y.indexOf(u)!==-1&&(i.nodeName=i.nodeName.substring(0,s),i.objectName=u)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}static findNode(t,e){if(e===void 0||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){let i=t.skeleton.getBoneByName(e);if(i!==void 0)return i}if(t.children){let i=function(u){for(let c=0;c<u.length;c++){let f=u[c];if(f.name===e||f.uuid===e)return f;let p=i(f.children);if(p)return p}return null},s=i(t.children);if(s)return s}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){let i=this.resolvedProperty;for(let s=0,u=i.length;s!==u;++s)t[e++]=i[s]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){let i=this.resolvedProperty;for(let s=0,u=i.length;s!==u;++s)i[s]=t[e++]}_setValue_array_setNeedsUpdate(t,e){let i=this.resolvedProperty;for(let s=0,u=i.length;s!==u;++s)i[s]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){let i=this.resolvedProperty;for(let s=0,u=i.length;s!==u;++s)i[s]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node,e=this.parsedPath,i=e.objectName,s=e.propertyName,u=e.propertyIndex;if(t||(t=n.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(i){let d=e.objectIndex;switch(i){case"materials":if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}t=t.material.materials;break;case"bones":if(!t.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}t=t.skeleton.bones;for(let g=0;g<t.length;g++)if(t[g].name===d){d=g;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}t=t.material.map;break;default:if(t[i]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}t=t[i]}if(d!==void 0){if(t[d]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);return}t=t[d]}}let c=t[s];if(c===void 0){let d=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+d+"."+s+" but it wasn't found.",t);return}let f=this.Versioning.None;this.targetObject=t,t.needsUpdate!==void 0?f=this.Versioning.NeedsUpdate:t.matrixWorldNeedsUpdate!==void 0&&(f=this.Versioning.MatrixWorldNeedsUpdate);let p=this.BindingType.Direct;if(u!==void 0){if(s==="morphTargetInfluences"){if(!t.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!t.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}t.morphTargetDictionary[u]!==void 0&&(u=t.morphTargetDictionary[u])}p=this.BindingType.ArrayElement,this.resolvedProperty=c,this.propertyIndex=u}else c.fromArray!==void 0&&c.toArray!==void 0?(p=this.BindingType.HasFromToArray,this.resolvedProperty=c):Array.isArray(c)?(p=this.BindingType.EntireArray,this.resolvedProperty=c):this.propertyName=s;this.getValue=this.GetterByBindingType[p],this.setValue=this.SetterByBindingTypeAndVersioning[p][f]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};Xn.Composite=Hv;Xn.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Xn.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Xn.prototype.GetterByBindingType=[Xn.prototype._getValue_direct,Xn.prototype._getValue_array,Xn.prototype._getValue_arrayElement,Xn.prototype._getValue_toArray];Xn.prototype.SetterByBindingTypeAndVersioning=[[Xn.prototype._setValue_direct,Xn.prototype._setValue_direct_setNeedsUpdate,Xn.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Xn.prototype._setValue_array,Xn.prototype._setValue_array_setNeedsUpdate,Xn.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Xn.prototype._setValue_arrayElement,Xn.prototype._setValue_arrayElement_setNeedsUpdate,Xn.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Xn.prototype._setValue_fromArray,Xn.prototype._setValue_fromArray_setNeedsUpdate,Xn.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var _ot=new Float32Array(1);var gf=class extends lf{constructor(t,e,i=1){super(t,e),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=i}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){let e=super.clone(t);return e.meshPerAttribute=this.meshPerAttribute,e}toJSON(t){let e=super.toJSON(t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}};typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Wv}}));typeof window!="undefined"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Wv);function fd(n,t){t===void 0&&(t=[]);let e=new Il(n.map(i=>new Ft(...i)));return t.length&&t.forEach(i=>{var s=new Cl(i.map(u=>new Ft(...u)));e.holes.push(s)}),e}var _At=Qt(Bc(),1);var Ur=63710088e-1,Fot={centimeters:Ur*100,centimetres:Ur*100,degrees:Ur/111325,feet:Ur*3.28084,inches:Ur*39.37,kilometers:Ur/1e3,kilometres:Ur/1e3,meters:Ur,metres:Ur,miles:Ur/1609.344,millimeters:Ur*1e3,millimetres:Ur*1e3,nauticalmiles:Ur/1852,radians:1,yards:Ur*1.0936},Uot={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/Ur,yards:1.0936133};function bi(n,t,e){e===void 0&&(e={});var i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=t||{},i.geometry=n,i}function Fn(n,t,e){if(e===void 0&&(e={}),!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!es(n[0])||!es(n[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:n};return bi(i,t,e)}function $n(n,t,e){e===void 0&&(e={});for(var i=0,s=n;i<s.length;i++){var u=s[i];if(u.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var c=0;c<u[u.length-1].length;c++)if(u[u.length-1][c]!==u[0][c])throw new Error("First and last Position are not equivalent.")}var f={type:"Polygon",coordinates:n};return bi(f,t,e)}function Br(n,t,e){if(e===void 0&&(e={}),n.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:n};return bi(i,t,e)}function s_(n,t,e){e===void 0&&(e={});var i={type:"MultiPoint",coordinates:n};return bi(i,t,e)}function es(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}function Sr(n,t,e){if(n!==null)for(var i,s,u,c,f,p,d,g=0,y=0,v,E=n.type,M=E==="FeatureCollection",A=E==="Feature",_=M?n.features.length:1,x=0;x<_;x++){d=M?n.features[x].geometry:A?n.geometry:n,v=d?d.type==="GeometryCollection":!1,f=v?d.geometries.length:1;for(var T=0;T<f;T++){var w=0,R=0;if(c=v?d.geometries[T]:d,c!==null){p=c.coordinates;var B=c.type;switch(g=e&&(B==="Polygon"||B==="MultiPolygon")?1:0,B){case null:break;case"Point":if(t(p,y,x,w,R)===!1)return!1;y++,w++;break;case"LineString":case"MultiPoint":for(i=0;i<p.length;i++){if(t(p[i],y,x,w,R)===!1)return!1;y++,B==="MultiPoint"&&w++}B==="LineString"&&w++;break;case"Polygon":case"MultiLineString":for(i=0;i<p.length;i++){for(s=0;s<p[i].length-g;s++){if(t(p[i][s],y,x,w,R)===!1)return!1;y++}B==="MultiLineString"&&w++,B==="Polygon"&&R++}B==="Polygon"&&w++;break;case"MultiPolygon":for(i=0;i<p.length;i++){for(R=0,s=0;s<p[i].length;s++){for(u=0;u<p[i][s].length-g;u++){if(t(p[i][s][u],y,x,w,R)===!1)return!1;y++}R++}w++}break;case"GeometryCollection":for(i=0;i<c.geometries.length;i++)if(Sr(c.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function bP(n,t,e,i){var s=e;return Sr(n,function(u,c,f,p,d){c===0&&e===void 0?s=u:s=t(s,u,c,f,p,d)},i),s}function Ea(n,t){var e,i,s,u,c,f,p,d,g,y,v=0,E=n.type==="FeatureCollection",M=n.type==="Feature",A=E?n.features.length:1;for(e=0;e<A;e++){for(f=E?n.features[e].geometry:M?n.geometry:n,d=E?n.features[e].properties:M?n.properties:{},g=E?n.features[e].bbox:M?n.bbox:void 0,y=E?n.features[e].id:M?n.id:void 0,p=f?f.type==="GeometryCollection":!1,c=p?f.geometries.length:1,s=0;s<c;s++){if(u=p?f.geometries[s]:f,u===null){if(t(null,v,d,g,y)===!1)return!1;continue}switch(u.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(u,v,d,g,y)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<u.geometries.length;i++)if(t(u.geometries[i],v,d,g,y)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}v++}}function Ji(n,t){Ea(n,function(e,i,s,u,c){var f=e===null?null:e.type;switch(f){case null:case"Point":case"LineString":case"Polygon":return t(bi(e,s,{bbox:u,id:c}),i,0)===!1?!1:void 0}var p;switch(f){case"MultiPoint":p="Point";break;case"MultiLineString":p="LineString";break;case"MultiPolygon":p="Polygon";break}for(var d=0;d<e.coordinates.length;d++){var g=e.coordinates[d],y={type:p,coordinates:g};if(t(bi(y,s),i,d)===!1)return!1}})}function a_(n){var t=[1/0,1/0,-1/0,-1/0];return Sr(n,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}a_.default=a_;var Ai=a_;function $r(n){if(!n)throw new Error("coord is required");if(!Array.isArray(n)){if(n.type==="Feature"&&n.geometry!==null&&n.geometry.type==="Point")return n.geometry.coordinates;if(n.type==="Point")return n.coordinates}if(Array.isArray(n)&&n.length>=2&&!Array.isArray(n[0])&&!Array.isArray(n[1]))return n;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function u_(n,t,e){if(!n)throw new Error("No feature passed");if(!e)throw new Error(".featureOf() requires a name");if(!n||n.type!=="Feature"||!n.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!n.geometry||n.geometry.type!==t)throw new Error("Invalid input to "+e+": must be a "+t+", given "+n.geometry.type)}function Zr(n){return n.type==="Feature"?n.geometry:n}var QY=Qt(gd(),1);var l$=Qt(VP(),1);function zr(n,t,e){if(e===void 0&&(e={}),!n)throw new Error("point is required");if(!t)throw new Error("polygon is required");var i=$r(n),s=Zr(t),u=s.type,c=t.bbox,f=s.coordinates;if(c&&c$(i,c)===!1)return!1;u==="Polygon"&&(f=[f]);for(var p=!1,d=0;d<f.length&&!p;d++)if(HP(i,f[d][0],e.ignoreBoundary)){for(var g=!1,y=1;y<f[d].length&&!g;)HP(i,f[d][y],!e.ignoreBoundary)&&(g=!0),y++;g||(p=!0)}return p}function HP(n,t,e){var i=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var s=0,u=t.length-1;s<t.length;u=s++){var c=t[s][0],f=t[s][1],p=t[u][0],d=t[u][1],g=n[1]*(c-p)+f*(p-n[0])+d*(n[0]-c)===0&&(c-n[0])*(p-n[0])<=0&&(f-n[1])*(d-n[1])<=0;if(g)return!e;var y=f>n[1]!=d>n[1]&&n[0]<(p-c)*(n[1]-f)/(d-f)+c;y&&(i=!i)}return i}function c$(n,t){return t[0]<=n[0]&&t[1]<=n[1]&&t[2]>=n[0]&&t[3]>=n[1]}var YP=new ArrayBuffer(16),hat=new Float64Array(YP),pat=new Uint32Array(YP);var b$=Qt(M_(),1);var zut=function(){function n(t){this.points=t.points||[],this.duration=t.duration||1e4,this.sharpness=t.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=t.stepLength||60,this.length=this.points.length,this.delay=0;for(var e=0;e<this.length;e++)this.points[e].z=this.points[e].z||0;for(var e=0;e<this.length-1;e++){var i=this.points[e],s=this.points[e+1];this.centers.push({x:(i.x+s.x)/2,y:(i.y+s.y)/2,z:(i.z+s.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var e=0;e<this.centers.length-1;e++){var u=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,c=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,f=this.points[e+1].z-(this.centers[e].y+this.centers[e+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e].x+u),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+c),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+f)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+u),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+c),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+f)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}return n.prototype.cacheSteps=function(t){var e=[],i=this.pos(0);e.push(0);for(var s=0;s<this.duration;s+=10){var u=this.pos(s),c=Math.sqrt((u.x-i.x)*(u.x-i.x)+(u.y-i.y)*(u.y-i.y)+(u.z-i.z)*(u.z-i.z));c>t&&(e.push(s),i=u)}return e},n.prototype.vector=function(t){var e=this.pos(t+10),i=this.pos(t-10);return{angle:180*Math.atan2(e.y-i.y,e.x-i.x)/3.14,speed:Math.sqrt((i.x-e.x)*(i.x-e.x)+(i.y-e.y)*(i.y-e.y)+(i.z-e.z)*(i.z-e.z))}},n.prototype.pos=function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var i=e/this.duration;if(i>=1)return this.points[this.length-1];var s=Math.floor((this.points.length-1)*i),u=(this.length-1)*i-s;return A$(u,this.points[s],this.controls[s][1],this.controls[s+1][0],this.points[s+1])},n}();function A$(n,t,e,i,s){var u=T$(n),c={x:s.x*u[0]+i.x*u[1]+e.x*u[2]+t.x*u[3],y:s.y*u[0]+i.y*u[1]+e.y*u[2]+t.y*u[3],z:s.z*u[0]+i.z*u[1]+e.z*u[2]+t.z*u[3]};return c}function T$(n){var t=n*n,e=t*n;return[e,3*t*(1-n),3*n*(1-n)*(1-n),(1-n)*(1-n)*(1-n)]}function _f(n,t){t===void 0&&(t={});var e=Number(n[0]),i=Number(n[1]),s=Number(n[2]),u=Number(n[3]);if(n.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var c=[e,i],f=[e,u],p=[s,u],d=[s,i];return $n([[c,d,p,f,c]],t.properties,{bbox:n,id:t.id})}function C$(n){return _f(Ai(n))}var b_=C$;var W$=Qt(iR(),1);var vZ=Qt(Ld(),1);var xZ=Qt(gd(),1);var wZ=Qt(M_(),1);var SR=Math.PI/180,wR=180/Math.PI,Af=function(n,t){this.lon=n,this.lat=t,this.x=SR*n,this.y=SR*t};Af.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)};Af.prototype.antipode=function(){var n=-1*this.lat,t=this.lon<0?180+this.lon:(180-this.lon)*-1;return new Af(t,n)};var MR=function(){this.coords=[],this.length=0};MR.prototype.move_to=function(n){this.length++,this.coords.push(n)};var W_=function(n){this.properties=n||{},this.geometries=[]};W_.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(this.geometries.length===1)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var n=[],t=0;t<this.geometries.length;t++)n.push(this.geometries[t].coords);return{geometry:{type:"MultiLineString",coordinates:n},type:"Feature",properties:this.properties}};W_.prototype.wkt=function(){for(var n="",t="LINESTRING(",e=function(u){t+=u[0]+" "+u[1]+","},i=0;i<this.geometries.length;i++){if(this.geometries[i].coords.length===0)return"LINESTRING(empty)";var s=this.geometries[i].coords;s.forEach(e),n+=t.substring(0,t.length-1)+")"}return n};var bR=function(n,t,e){if(!n||n.x===void 0||n.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!t||t.x===void 0||t.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new Af(n.x,n.y),this.end=new Af(t.x,t.y),this.properties=e||{};var i=this.start.x-this.end.x,s=this.start.y-this.end.y,u=Math.pow(Math.sin(s/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(i/2),2);if(this.g=2*Math.asin(Math.sqrt(u)),this.g===Math.PI)throw new Error("it appears "+n.view()+" and "+t.view()+" are 'antipodal', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw new Error("could not calculate great circle between "+n+" and "+t)};bR.prototype.interpolate=function(n){var t=Math.sin((1-n)*this.g)/Math.sin(this.g),e=Math.sin(n*this.g)/Math.sin(this.g),i=t*Math.cos(this.start.y)*Math.cos(this.start.x)+e*Math.cos(this.end.y)*Math.cos(this.end.x),s=t*Math.cos(this.start.y)*Math.sin(this.start.x)+e*Math.cos(this.end.y)*Math.sin(this.end.x),u=t*Math.sin(this.start.y)+e*Math.sin(this.end.y),c=wR*Math.atan2(u,Math.sqrt(Math.pow(i,2)+Math.pow(s,2))),f=wR*Math.atan2(s,i);return[f,c]};bR.prototype.Arc=function(n,t){var e=[];if(!n||n<=2)e.push([this.start.lon,this.start.lat]),e.push([this.end.lon,this.end.lat]);else for(var i=1/(n-1),s=0;s<n;++s){var u=i*s,c=this.interpolate(u);e.push(c)}for(var f=!1,p=0,d=t&&t.offset?t.offset:10,g=180-d,y=-180+d,v=360-d,E=1;E<e.length;++E){var M=e[E-1][0],A=e[E][0],_=Math.abs(A-M);_>v&&(A>g&&M<y||M>g&&A<y)?f=!0:_>p&&(p=_)}var x=[];if(f&&p<d){var T=[];x.push(T);for(var w=0;w<e.length;++w){var R=parseFloat(e[w][0]);if(w>0&&Math.abs(R-e[w-1][0])>v){var B=parseFloat(e[w-1][0]),U=parseFloat(e[w-1][1]),D=parseFloat(e[w][0]),P=parseFloat(e[w][1]);if(B>-180&&B<y&&D===180&&w+1<e.length&&e[w-1][0]>-180&&e[w-1][0]<y){T.push([-180,e[w][1]]),w++,T.push([e[w][0],e[w][1]]);continue}else if(B>g&&B<180&&D===-180&&w+1<e.length&&e[w-1][0]>g&&e[w-1][0]<180){T.push([180,e[w][1]]),w++,T.push([e[w][0],e[w][1]]);continue}if(B<y&&D>g){var ct=B;B=D,D=ct;var L=U;U=P,P=L}if(B>g&&D<y&&(D+=360),B<=180&&D>=180&&B<D){var W=(180-B)/(D-B),V=W*P+(1-W)*U;T.push([e[w-1][0]>g?180:-180,V]),T=[],T.push([e[w-1][0]>g?-180:180,V]),x.push(T)}else T=[],x.push(T);T.push([R,e[w][1]])}else T.push([e[w][0],e[w][1]])}}else{var Mt=[];x.push(Mt);for(var $=0;$<e.length;++$)Mt.push([e[$][0],e[$][1]])}for(var gt=new W_(this.properties),ft=0;ft<x.length;++ft){var vt=new MR;gt.geometries.push(vt);for(var it=x[ft],lt=0;lt<it.length;++lt)vt.move_to(it[lt])}return gt};var AZ=Qt(Ld(),1);var bj=Qt(Ld(),1);var Aj=Qt(_x(),1);var Ij=Qt(gd(),1);var Ce=[],Ie=[],Pe=[],Re=[],Le=[],Ne=[],Oe=[],De=[],Fe=[],Ue=[],Be=[],ze=[],Ge=[],ke=[],qe=[],Ve=[],He=[],We=[],Xe=[],Ye=[],$e=[],Ze=[],Je=[],je=[];Oe[85]=Ue[85]=-1;De[85]=Be[85]=0;Fe[85]=ze[85]=1;Xe[85]=Ze[85]=1;Ye[85]=Je[85]=0;$e[85]=je[85]=1;Ce[85]=Re[85]=0;Ie[85]=Le[85]=-1;Pe[85]=qe[85]=0;Ve[85]=Ge[85]=0;He[85]=ke[85]=1;Ne[85]=We[85]=1;Ze[1]=Ze[169]=0;Je[1]=Je[169]=-1;je[1]=je[169]=0;Ge[1]=Ge[169]=-1;ke[1]=ke[169]=0;qe[1]=qe[169]=0;Ue[4]=Ue[166]=0;Be[4]=Be[166]=-1;ze[4]=ze[166]=1;Ve[4]=Ve[166]=1;He[4]=He[166]=0;We[4]=We[166]=0;Oe[16]=Oe[154]=0;De[16]=De[154]=1;Fe[16]=Fe[154]=1;Re[16]=Re[154]=1;Le[16]=Le[154]=0;Ne[16]=Ne[154]=1;Xe[64]=Xe[106]=0;Ye[64]=Ye[106]=1;$e[64]=$e[106]=0;Ce[64]=Ce[106]=-1;Ie[64]=Ie[106]=0;Pe[64]=Pe[106]=1;Xe[2]=Xe[168]=0;Ye[2]=Ye[168]=-1;$e[2]=$e[168]=1;Ze[2]=Ze[168]=0;Je[2]=Je[168]=-1;je[2]=je[168]=0;Ge[2]=Ge[168]=-1;ke[2]=ke[168]=0;qe[2]=qe[168]=0;Ve[2]=Ve[168]=-1;He[2]=He[168]=0;We[2]=We[168]=1;Oe[8]=Oe[162]=0;De[8]=De[162]=-1;Fe[8]=Fe[162]=0;Ue[8]=Ue[162]=0;Be[8]=Be[162]=-1;ze[8]=ze[162]=1;Ge[8]=Ge[162]=1;ke[8]=ke[162]=0;qe[8]=qe[162]=1;Ve[8]=Ve[162]=1;He[8]=He[162]=0;We[8]=We[162]=0;Oe[32]=Oe[138]=0;De[32]=De[138]=1;Fe[32]=Fe[138]=1;Ue[32]=Ue[138]=0;Be[32]=Be[138]=1;ze[32]=ze[138]=0;Ce[32]=Ce[138]=1;Ie[32]=Ie[138]=0;Pe[32]=Pe[138]=0;Re[32]=Re[138]=1;Le[32]=Le[138]=0;Ne[32]=Ne[138]=1;Ze[128]=Ze[42]=0;Je[128]=Je[42]=1;je[128]=je[42]=1;Xe[128]=Xe[42]=0;Ye[128]=Ye[42]=1;$e[128]=$e[42]=0;Ce[128]=Ce[42]=-1;Ie[128]=Ie[42]=0;Pe[128]=Pe[42]=1;Re[128]=Re[42]=-1;Le[128]=Le[42]=0;Ne[128]=Ne[42]=0;Ue[5]=Ue[165]=-1;Be[5]=Be[165]=0;ze[5]=ze[165]=0;Ze[5]=Ze[165]=1;Je[5]=Je[165]=0;je[5]=je[165]=0;Ve[20]=Ve[150]=0;He[20]=He[150]=1;We[20]=We[150]=1;Re[20]=Re[150]=0;Le[20]=Le[150]=-1;Ne[20]=Ne[150]=1;Oe[80]=Oe[90]=-1;De[80]=De[90]=0;Fe[80]=Fe[90]=1;Xe[80]=Xe[90]=1;Ye[80]=Ye[90]=0;$e[80]=$e[90]=1;Ge[65]=Ge[105]=0;ke[65]=ke[105]=1;qe[65]=qe[105]=0;Ce[65]=Ce[105]=0;Ie[65]=Ie[105]=-1;Pe[65]=Pe[105]=0;Oe[160]=Oe[10]=-1;De[160]=De[10]=0;Fe[160]=Fe[10]=1;Ue[160]=Ue[10]=-1;Be[160]=Be[10]=0;ze[160]=ze[10]=0;Ze[160]=Ze[10]=1;Je[160]=Je[10]=0;je[160]=je[10]=0;Xe[160]=Xe[10]=1;Ye[160]=Ye[10]=0;$e[160]=$e[10]=1;Ve[130]=Ve[40]=0;He[130]=He[40]=1;We[130]=We[40]=1;Ge[130]=Ge[40]=0;ke[130]=ke[40]=1;qe[130]=qe[40]=0;Ce[130]=Ce[40]=0;Ie[130]=Ie[40]=-1;Pe[130]=Pe[40]=0;Re[130]=Re[40]=0;Le[130]=Le[40]=-1;Ne[130]=Ne[40]=1;Ue[37]=Ue[133]=0;Be[37]=Be[133]=1;ze[37]=ze[133]=1;Ze[37]=Ze[133]=0;Je[37]=Je[133]=1;je[37]=je[133]=0;Ce[37]=Ce[133]=-1;Ie[37]=Ie[133]=0;Pe[37]=Pe[133]=0;Re[37]=Re[133]=1;Le[37]=Le[133]=0;Ne[37]=Ne[133]=0;Ve[148]=Ve[22]=-1;He[148]=He[22]=0;We[148]=We[22]=0;Ze[148]=Ze[22]=0;Je[148]=Je[22]=-1;je[148]=je[22]=1;Xe[148]=Xe[22]=0;Ye[148]=Ye[22]=1;$e[148]=$e[22]=1;Re[148]=Re[22]=-1;Le[148]=Le[22]=0;Ne[148]=Ne[22]=1;Oe[82]=Oe[88]=0;De[82]=De[88]=-1;Fe[82]=Fe[88]=1;Ve[82]=Ve[88]=1;He[82]=He[88]=0;We[82]=We[88]=1;Ge[82]=Ge[88]=-1;ke[82]=ke[88]=0;qe[82]=qe[88]=1;Xe[82]=Xe[88]=0;Ye[82]=Ye[88]=-1;$e[82]=$e[88]=0;Oe[73]=Oe[97]=0;De[73]=De[97]=1;Fe[73]=Fe[97]=0;Ue[73]=Ue[97]=0;Be[73]=Be[97]=-1;ze[73]=ze[97]=0;Ge[73]=Ge[97]=1;ke[73]=ke[97]=0;qe[73]=qe[97]=0;Ce[73]=Ce[97]=1;Ie[73]=Ie[97]=0;Pe[73]=Pe[97]=1;Oe[145]=Oe[25]=0;De[145]=De[25]=-1;Fe[145]=Fe[25]=0;Ge[145]=Ge[25]=1;ke[145]=ke[25]=0;qe[145]=qe[25]=1;Ze[145]=Ze[25]=0;Je[145]=Je[25]=1;je[145]=je[25]=1;Re[145]=Re[25]=-1;Le[145]=Le[25]=0;Ne[145]=Ne[25]=0;Ue[70]=Ue[100]=0;Be[70]=Be[100]=1;ze[70]=ze[100]=0;Ve[70]=Ve[100]=-1;He[70]=He[100]=0;We[70]=We[100]=1;Xe[70]=Xe[100]=0;Ye[70]=Ye[100]=-1;$e[70]=$e[100]=1;Ce[70]=Ce[100]=1;Ie[70]=Ie[100]=0;Pe[70]=Pe[100]=0;Ue[101]=Ue[69]=0;Be[101]=Be[69]=1;ze[101]=ze[69]=0;Ce[101]=Ce[69]=1;Ie[101]=Ie[69]=0;Pe[101]=Pe[69]=0;Ze[149]=Ze[21]=0;Je[149]=Je[21]=1;je[149]=je[21]=1;Re[149]=Re[21]=-1;Le[149]=Le[21]=0;Ne[149]=Ne[21]=0;Ve[86]=Ve[84]=-1;He[86]=He[84]=0;We[86]=We[84]=1;Xe[86]=Xe[84]=0;Ye[86]=Ye[84]=-1;$e[86]=$e[84]=1;Oe[89]=Oe[81]=0;De[89]=De[81]=-1;Fe[89]=Fe[81]=0;Ge[89]=Ge[81]=1;ke[89]=ke[81]=0;qe[89]=qe[81]=1;Oe[96]=Oe[74]=0;De[96]=De[74]=1;Fe[96]=Fe[74]=0;Ue[96]=Ue[74]=-1;Be[96]=Be[74]=0;ze[96]=ze[74]=1;Xe[96]=Xe[74]=1;Ye[96]=Ye[74]=0;$e[96]=$e[74]=0;Ce[96]=Ce[74]=1;Ie[96]=Ie[74]=0;Pe[96]=Pe[74]=1;Oe[24]=Oe[146]=0;De[24]=De[146]=-1;Fe[24]=Fe[146]=1;Ve[24]=Ve[146]=1;He[24]=He[146]=0;We[24]=We[146]=1;Ge[24]=Ge[146]=0;ke[24]=ke[146]=1;qe[24]=qe[146]=1;Re[24]=Re[146]=0;Le[24]=Le[146]=-1;Ne[24]=Ne[146]=0;Ue[6]=Ue[164]=-1;Be[6]=Be[164]=0;ze[6]=ze[164]=1;Ve[6]=Ve[164]=-1;He[6]=He[164]=0;We[6]=We[164]=0;Ze[6]=Ze[164]=0;Je[6]=Je[164]=-1;je[6]=je[164]=1;Xe[6]=Xe[164]=1;Ye[6]=Ye[164]=0;$e[6]=$e[164]=0;Ge[129]=Ge[41]=0;ke[129]=ke[41]=1;qe[129]=qe[41]=1;Ze[129]=Ze[41]=0;Je[129]=Je[41]=1;je[129]=je[41]=0;Ce[129]=Ce[41]=-1;Ie[129]=Ie[41]=0;Pe[129]=Pe[41]=0;Re[129]=Re[41]=0;Le[129]=Le[41]=-1;Ne[129]=Ne[41]=0;Ve[66]=Ve[104]=0;He[66]=He[104]=1;We[66]=We[104]=0;Ge[66]=Ge[104]=-1;ke[66]=ke[104]=0;qe[66]=qe[104]=1;Xe[66]=Xe[104]=0;Ye[66]=Ye[104]=-1;$e[66]=$e[104]=0;Ce[66]=Ce[104]=0;Ie[66]=Ie[104]=-1;Pe[66]=Pe[104]=1;Oe[144]=Oe[26]=-1;De[144]=De[26]=0;Fe[144]=Fe[26]=0;Ze[144]=Ze[26]=1;Je[144]=Je[26]=0;je[144]=je[26]=1;Xe[144]=Xe[26]=0;Ye[144]=Ye[26]=1;$e[144]=$e[26]=1;Re[144]=Re[26]=-1;Le[144]=Le[26]=0;Ne[144]=Ne[26]=1;Ue[36]=Ue[134]=0;Be[36]=Be[134]=1;ze[36]=ze[134]=1;Ve[36]=Ve[134]=0;He[36]=He[134]=1;We[36]=We[134]=0;Ce[36]=Ce[134]=0;Ie[36]=Ie[134]=-1;Pe[36]=Pe[134]=1;Re[36]=Re[134]=1;Le[36]=Le[134]=0;Ne[36]=Ne[134]=0;Oe[9]=Oe[161]=-1;De[9]=De[161]=0;Fe[9]=Fe[161]=0;Ue[9]=Ue[161]=0;Be[9]=Be[161]=-1;ze[9]=ze[161]=0;Ge[9]=Ge[161]=1;ke[9]=ke[161]=0;qe[9]=qe[161]=0;Ze[9]=Ze[161]=1;Je[9]=Je[161]=0;je[9]=je[161]=1;Oe[136]=0;De[136]=1;Fe[136]=1;Ue[136]=0;Be[136]=1;ze[136]=0;Ve[136]=-1;He[136]=0;We[136]=1;Ge[136]=-1;ke[136]=0;qe[136]=0;Ze[136]=0;Je[136]=-1;je[136]=0;Xe[136]=0;Ye[136]=-1;$e[136]=1;Ce[136]=1;Ie[136]=0;Pe[136]=0;Re[136]=1;Le[136]=0;Ne[136]=1;Oe[34]=0;De[34]=-1;Fe[34]=0;Ue[34]=0;Be[34]=-1;ze[34]=1;Ve[34]=1;He[34]=0;We[34]=0;Ge[34]=1;ke[34]=0;qe[34]=1;Ze[34]=0;Je[34]=1;je[34]=1;Xe[34]=0;Ye[34]=1;$e[34]=0;Ce[34]=-1;Ie[34]=0;Pe[34]=1;Re[34]=-1;Le[34]=0;Ne[34]=0;Oe[35]=0;De[35]=1;Fe[35]=1;Ue[35]=0;Be[35]=-1;ze[35]=1;Ve[35]=1;He[35]=0;We[35]=0;Ge[35]=-1;ke[35]=0;qe[35]=0;Ze[35]=0;Je[35]=-1;je[35]=0;Xe[35]=0;Ye[35]=1;$e[35]=0;Ce[35]=-1;Ie[35]=0;Pe[35]=1;Re[35]=1;Le[35]=0;Ne[35]=1;Oe[153]=0;De[153]=1;Fe[153]=1;Ge[153]=-1;ke[153]=0;qe[153]=0;Ze[153]=0;Je[153]=-1;je[153]=0;Re[153]=1;Le[153]=0;Ne[153]=1;Ue[102]=0;Be[102]=-1;ze[102]=1;Ve[102]=1;He[102]=0;We[102]=0;Xe[102]=0;Ye[102]=1;$e[102]=0;Ce[102]=-1;Ie[102]=0;Pe[102]=1;Oe[155]=0;De[155]=-1;Fe[155]=0;Ge[155]=1;ke[155]=0;qe[155]=1;Ze[155]=0;Je[155]=1;je[155]=1;Re[155]=-1;Le[155]=0;Ne[155]=0;Ue[103]=0;Be[103]=1;ze[103]=0;Ve[103]=-1;He[103]=0;We[103]=1;Xe[103]=0;Ye[103]=-1;$e[103]=1;Ce[103]=1;Ie[103]=0;Pe[103]=0;Oe[152]=0;De[152]=1;Fe[152]=1;Ve[152]=-1;He[152]=0;We[152]=1;Ge[152]=-1;ke[152]=0;qe[152]=0;Ze[152]=0;Je[152]=-1;je[152]=0;Xe[152]=0;Ye[152]=-1;$e[152]=1;Re[152]=1;Le[152]=0;Ne[152]=1;Oe[156]=0;De[156]=-1;Fe[156]=1;Ve[156]=1;He[156]=0;We[156]=1;Ge[156]=-1;ke[156]=0;qe[156]=0;Ze[156]=0;Je[156]=-1;je[156]=0;Xe[156]=0;Ye[156]=1;$e[156]=1;Re[156]=-1;Le[156]=0;Ne[156]=1;Oe[137]=0;De[137]=1;Fe[137]=1;Ue[137]=0;Be[137]=1;ze[137]=0;Ge[137]=-1;ke[137]=0;qe[137]=0;Ze[137]=0;Je[137]=-1;je[137]=0;Ce[137]=1;Ie[137]=0;Pe[137]=0;Re[137]=1;Le[137]=0;Ne[137]=1;Oe[139]=0;De[139]=1;Fe[139]=1;Ue[139]=0;Be[139]=-1;ze[139]=0;Ge[139]=1;ke[139]=0;qe[139]=0;Ze[139]=0;Je[139]=1;je[139]=0;Ce[139]=-1;Ie[139]=0;Pe[139]=0;Re[139]=1;Le[139]=0;Ne[139]=1;Oe[98]=0;De[98]=-1;Fe[98]=0;Ue[98]=0;Be[98]=-1;ze[98]=1;Ve[98]=1;He[98]=0;We[98]=0;Ge[98]=1;ke[98]=0;qe[98]=1;Xe[98]=0;Ye[98]=1;$e[98]=0;Ce[98]=-1;Ie[98]=0;Pe[98]=1;Oe[99]=0;De[99]=1;Fe[99]=0;Ue[99]=0;Be[99]=-1;ze[99]=1;Ve[99]=1;He[99]=0;We[99]=0;Ge[99]=-1;ke[99]=0;qe[99]=1;Xe[99]=0;Ye[99]=-1;$e[99]=0;Ce[99]=1;Ie[99]=0;Pe[99]=1;Ue[38]=0;Be[38]=-1;ze[38]=1;Ve[38]=1;He[38]=0;We[38]=0;Ze[38]=0;Je[38]=1;je[38]=1;Xe[38]=0;Ye[38]=1;$e[38]=0;Ce[38]=-1;Ie[38]=0;Pe[38]=1;Re[38]=-1;Le[38]=0;Ne[38]=0;Ue[39]=0;Be[39]=1;ze[39]=1;Ve[39]=-1;He[39]=0;We[39]=0;Ze[39]=0;Je[39]=-1;je[39]=1;Xe[39]=0;Ye[39]=1;$e[39]=0;Ce[39]=-1;Ie[39]=0;Pe[39]=1;Re[39]=1;Le[39]=0;Ne[39]=0;var xx=function(n){return[[n.bottomleft,0],[0,0],[0,n.leftbottom]]},Ex=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0]]},Sx=function(n){return[[n.topright,1],[1,1],[1,n.righttop]]},wx=function(n){return[[0,n.lefttop],[0,1],[n.topleft,1]]},Mx=function(n){return[[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop]]},bx=function(n){return[[n.bottomright,0],[n.bottomleft,0],[1,n.righttop],[1,n.rightbottom]]},Ax=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.topleft,1],[n.topright,1]]},Tx=function(n){return[[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},Pj=function(n){return[[0,0],[0,n.leftbottom],[1,n.rightbottom],[1,0]]},Rj=function(n){return[[1,0],[n.bottomright,0],[n.topright,1],[1,1]]},Lj=function(n){return[[1,1],[1,n.righttop],[0,n.lefttop],[0,1]]},Nj=function(n){return[[n.bottomleft,0],[0,0],[0,1],[n.topleft,1]]},Oj=function(n){return[[1,n.righttop],[1,n.rightbottom],[0,n.leftbottom],[0,n.lefttop]]},Dj=function(n){return[[n.topleft,1],[n.topright,1],[n.bottomright,0],[n.bottomleft,0]]},Fj=function(){return[[0,0],[0,1],[1,1],[1,0]]},Uj=function(n){return[[1,n.rightbottom],[1,0],[0,0],[0,1],[n.topleft,1]]},Bj=function(n){return[[n.topright,1],[1,1],[1,0],[0,0],[0,n.leftbottom]]},zj=function(n){return[[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[1,1]]},Gj=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,1]]},kj=function(n){return[[1,n.righttop],[1,n.rightbottom],[0,n.lefttop],[0,1],[n.topleft,1]]},qj=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[n.topright,1]]},Vj=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop]]},Hj=function(n){return[[n.topright,1],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topleft,1]]},Wj=function(n){return[[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1],[n.topleft,1]]},Xj=function(n){return[[1,1],[1,n.righttop],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},Yj=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[n.topleft,1],[n.topright,1]]},$j=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,n.leftbottom]]},Zj=function(n){return[[1,n.rightbottom],[1,0],[0,0],[0,n.leftbottom],[n.topleft,1],[n.topright,1]]},Jj=function(n){return[[1,1],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},jj=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1]]},Kj=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,1],[n.topleft,1]]},Qj=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topright,1]]},tK=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[n.topleft,1]]},eK=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},nK=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topright,1]]},rK=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[n.topleft,1]]},iK=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},oK=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topleft,1],[n.topright,1]]},sK=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1],[n.topleft,1]]},aK=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},en=[],nn=[],rn=[],on=[],sn=[],an=[],un=[],ln=[];on[1]=sn[1]=18;on[169]=sn[169]=18;rn[4]=nn[4]=12;rn[166]=nn[166]=12;en[16]=ln[16]=4;en[154]=ln[154]=4;an[64]=un[64]=22;an[106]=un[106]=22;rn[2]=an[2]=17;on[2]=sn[2]=18;rn[168]=an[168]=17;on[168]=sn[168]=18;en[8]=on[8]=9;nn[8]=rn[8]=12;en[162]=on[162]=9;nn[162]=rn[162]=12;en[32]=ln[32]=4;nn[32]=un[32]=1;en[138]=ln[138]=4;nn[138]=un[138]=1;sn[128]=ln[128]=21;an[128]=un[128]=22;sn[42]=ln[42]=21;an[42]=un[42]=22;nn[5]=sn[5]=14;nn[165]=sn[165]=14;rn[20]=ln[20]=6;rn[150]=ln[150]=6;en[80]=an[80]=11;en[90]=an[90]=11;on[65]=un[65]=3;on[105]=un[105]=3;en[160]=an[160]=11;nn[160]=sn[160]=14;en[10]=an[10]=11;nn[10]=sn[10]=14;rn[130]=ln[130]=6;on[130]=un[130]=3;rn[40]=ln[40]=6;on[40]=un[40]=3;nn[101]=un[101]=1;nn[69]=un[69]=1;sn[149]=ln[149]=21;sn[21]=ln[21]=21;rn[86]=an[86]=17;rn[84]=an[84]=17;en[89]=on[89]=9;en[81]=on[81]=9;en[96]=un[96]=0;nn[96]=an[96]=15;en[74]=un[74]=0;nn[74]=an[74]=15;en[24]=rn[24]=8;on[24]=ln[24]=7;en[146]=rn[146]=8;on[146]=ln[146]=7;nn[6]=an[6]=15;rn[6]=sn[6]=16;nn[164]=an[164]=15;rn[164]=sn[164]=16;on[129]=ln[129]=7;sn[129]=un[129]=20;on[41]=ln[41]=7;sn[41]=un[41]=20;rn[66]=un[66]=2;on[66]=an[66]=19;rn[104]=un[104]=2;on[104]=an[104]=19;en[144]=sn[144]=10;an[144]=ln[144]=23;en[26]=sn[26]=10;an[26]=ln[26]=23;nn[36]=ln[36]=5;rn[36]=un[36]=2;nn[134]=ln[134]=5;rn[134]=un[134]=2;en[9]=sn[9]=10;nn[9]=on[9]=13;en[161]=sn[161]=10;nn[161]=on[161]=13;nn[37]=ln[37]=5;sn[37]=un[37]=20;nn[133]=ln[133]=5;sn[133]=un[133]=20;rn[148]=sn[148]=16;an[148]=ln[148]=23;rn[22]=sn[22]=16;an[22]=ln[22]=23;en[82]=rn[82]=8;on[82]=an[82]=19;en[88]=rn[88]=8;on[88]=an[88]=19;en[73]=un[73]=0;nn[73]=on[73]=13;en[97]=un[97]=0;nn[97]=on[97]=13;en[145]=on[145]=9;sn[145]=ln[145]=21;en[25]=on[25]=9;sn[25]=ln[25]=21;nn[70]=un[70]=1;rn[70]=an[70]=17;nn[100]=un[100]=1;rn[100]=an[100]=17;en[34]=on[34]=9;nn[34]=rn[34]=12;sn[34]=ln[34]=21;an[34]=un[34]=22;en[136]=ln[136]=4;nn[136]=un[136]=1;rn[136]=an[136]=17;on[136]=sn[136]=18;en[35]=ln[35]=4;nn[35]=rn[35]=12;on[35]=sn[35]=18;an[35]=un[35]=22;en[153]=ln[153]=4;on[153]=sn[153]=18;nn[102]=rn[102]=12;an[102]=un[102]=22;en[155]=on[155]=9;sn[155]=ln[155]=23;nn[103]=un[103]=1;rn[103]=an[103]=17;en[152]=ln[152]=4;rn[152]=an[152]=17;on[152]=sn[152]=18;en[156]=rn[156]=8;on[156]=sn[156]=18;an[156]=ln[156]=23;en[137]=ln[137]=4;nn[137]=un[137]=1;on[137]=sn[137]=18;en[139]=ln[139]=4;nn[139]=on[139]=13;sn[139]=un[139]=20;en[98]=on[98]=9;nn[98]=rn[98]=12;an[98]=un[98]=22;en[99]=un[99]=0;nn[99]=rn[99]=12;on[99]=an[99]=19;nn[38]=rn[38]=12;sn[38]=ln[38]=21;an[38]=un[38]=22;nn[39]=ln[39]=5;rn[39]=sn[39]=16;an[39]=un[39]=22;var Yt=[];Yt[1]=Yt[169]=xx;Yt[4]=Yt[166]=Ex;Yt[16]=Yt[154]=Sx;Yt[64]=Yt[106]=wx;Yt[168]=Yt[2]=Mx;Yt[162]=Yt[8]=bx;Yt[138]=Yt[32]=Ax;Yt[42]=Yt[128]=Tx;Yt[5]=Yt[165]=Pj;Yt[20]=Yt[150]=Rj;Yt[80]=Yt[90]=Lj;Yt[65]=Yt[105]=Nj;Yt[160]=Yt[10]=Oj;Yt[130]=Yt[40]=Dj;Yt[85]=Fj;Yt[101]=Yt[69]=Uj;Yt[149]=Yt[21]=Bj;Yt[86]=Yt[84]=zj;Yt[89]=Yt[81]=Gj;Yt[96]=Yt[74]=kj;Yt[24]=Yt[146]=qj;Yt[6]=Yt[164]=Vj;Yt[129]=Yt[41]=Hj;Yt[66]=Yt[104]=Wj;Yt[144]=Yt[26]=Xj;Yt[36]=Yt[134]=Yj;Yt[9]=Yt[161]=$j;Yt[37]=Yt[133]=Zj;Yt[148]=Yt[22]=Jj;Yt[82]=Yt[88]=jj;Yt[73]=Yt[97]=Kj;Yt[145]=Yt[25]=Qj;Yt[70]=Yt[100]=tK;Yt[34]=function(n){return[Tx(n),bx(n)]};Yt[35]=eK;Yt[136]=function(n){return[Ax(n),Mx(n)]};Yt[153]=function(n){return[Sx(n),xx(n)]};Yt[102]=function(n){return[Ex(n),wx(n)]};Yt[155]=nK;Yt[103]=rK;Yt[152]=function(n){return[Sx(n),Mx(n)]};Yt[156]=iK;Yt[137]=function(n){return[Ax(n),xx(n)]};Yt[139]=oK;Yt[98]=function(n){return[bx(n),wx(n)]};Yt[99]=sK;Yt[38]=function(n){return[Ex(n),Tx(n)]};Yt[39]=aK;function lK(n){return(n>0)-(n<0)||+n}function Zl(n,t,e){var i=t[0]-n[0],s=t[1]-n[1],u=e[0]-t[0],c=e[1]-t[1];return lK(i*c-u*s)}function h2(n,t){var e=n.geometry.coordinates[0].map(function(c){return c[0]}),i=n.geometry.coordinates[0].map(function(c){return c[1]}),s=t.geometry.coordinates[0].map(function(c){return c[0]}),u=t.geometry.coordinates[0].map(function(c){return c[1]});return Math.max.apply(null,e)===Math.max.apply(null,s)&&Math.max.apply(null,i)===Math.max.apply(null,u)&&Math.min.apply(null,e)===Math.min.apply(null,s)&&Math.min.apply(null,i)===Math.min.apply(null,u)}function Cx(n,t){return t.geometry.coordinates[0].every(function(e){return zr(Fn(e),n)})}function p2(n,t){return n[0]===t[0]&&n[1]===t[1]}var cK=function(){function n(t){this.id=n.buildId(t),this.coordinates=t,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return n.buildId=function(t){return t.join(",")},n.prototype.removeInnerEdge=function(t){this.innerEdges=this.innerEdges.filter(function(e){return e.from.id!==t.from.id})},n.prototype.removeOuterEdge=function(t){this.outerEdges=this.outerEdges.filter(function(e){return e.to.id!==t.to.id})},n.prototype.addOuterEdge=function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1},n.prototype.sortOuterEdges=function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort(function(e,i){var s=e.to,u=i.to;if(s.coordinates[0]-t.coordinates[0]>=0&&u.coordinates[0]-t.coordinates[0]<0)return 1;if(s.coordinates[0]-t.coordinates[0]<0&&u.coordinates[0]-t.coordinates[0]>=0)return-1;if(s.coordinates[0]-t.coordinates[0]===0&&u.coordinates[0]-t.coordinates[0]===0)return s.coordinates[1]-t.coordinates[1]>=0||u.coordinates[1]-t.coordinates[1]>=0?s.coordinates[1]-u.coordinates[1]:u.coordinates[1]-s.coordinates[1];var c=Zl(t.coordinates,s.coordinates,u.coordinates);if(c<0)return 1;if(c>0)return-1;var f=Math.pow(s.coordinates[0]-t.coordinates[0],2)+Math.pow(s.coordinates[1]-t.coordinates[1],2),p=Math.pow(u.coordinates[0]-t.coordinates[0],2)+Math.pow(u.coordinates[1]-t.coordinates[1],2);return f-p}),this.outerEdgesSorted=!0)},n.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},n.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},n.prototype.addInnerEdge=function(t){this.innerEdges.push(t)},n}(),Ix=cK;var fK=function(){function n(t,e){this.from=t,this.to=e,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return n.prototype.getSymetric=function(){return this.symetric||(this.symetric=new n(this.to,this.from),this.symetric.symetric=this),this.symetric},n.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},n.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},n.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},n.prototype.toLineString=function(){return Br([this.from.coordinates,this.to.coordinates])},n.prototype.compareTo=function(t){return Zl(t.from.coordinates,t.to.coordinates,this.to.coordinates)},n}(),d2=fK;var hK=function(){function n(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return n.prototype.push=function(t){this.edges.push(t),this.polygon=this.envelope=void 0},n.prototype.get=function(t){return this.edges[t]},Object.defineProperty(n.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}),n.prototype.forEach=function(t){this.edges.forEach(t)},n.prototype.map=function(t){return this.edges.map(t)},n.prototype.some=function(t){return this.edges.some(t)},n.prototype.isValid=function(){return!0},n.prototype.isHole=function(){var t=this,e=this.edges.reduce(function(c,f,p){return f.from.coordinates[1]>t.edges[c].from.coordinates[1]&&(c=p),c},0),i=(e===0?this.length:e)-1,s=(e+1)%this.length,u=Zl(this.edges[i].from.coordinates,this.edges[e].from.coordinates,this.edges[s].from.coordinates);return u===0?this.edges[i].from.coordinates[0]>this.edges[s].from.coordinates[0]:u>0},n.prototype.toMultiPoint=function(){return s_(this.edges.map(function(t){return t.from.coordinates}))},n.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map(function(e){return e.from.coordinates});return t.push(this.edges[0].from.coordinates),this.polygon=$n([t])},n.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=b_(this.toPolygon())},n.findEdgeRingContaining=function(t,e){var i=t.getEnvelope(),s,u;return e.forEach(function(c){var f=c.getEnvelope();if(u&&(s=u.getEnvelope()),!h2(f,i)&&Cx(f,i)){for(var p=t.map(function(M){return M.from.coordinates}),d=void 0,g=function(M){c.some(function(A){return p2(M,A.from.coordinates)})||(d=M)},y=0,v=p;y<v.length;y++){var E=v[y];g(E)}d&&c.inside(Fn(d))&&(!u||Cx(s,f))&&(u=c)}}),u},n.prototype.inside=function(t){return zr(t,this.toPolygon())},n}(),Px=hK;function pK(n){if(!n)throw new Error("No geojson passed");if(n.type!=="FeatureCollection"&&n.type!=="GeometryCollection"&&n.type!=="MultiLineString"&&n.type!=="LineString"&&n.type!=="Feature")throw new Error("Invalid input type '"+n.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}var Ydt=function(){function n(){this.edges=[],this.nodes={}}return n.fromGeoJson=function(t){pK(t);var e=new n;return Ji(t,function(i){u_(i,"LineString","Graph::fromGeoJson"),bP(i,function(s,u){if(s){var c=e.getNode(s),f=e.getNode(u);e.addEdge(c,f)}return u})}),e},n.prototype.getNode=function(t){var e=Ix.buildId(t),i=this.nodes[e];return i||(i=this.nodes[e]=new Ix(t)),i},n.prototype.addEdge=function(t,e){var i=new d2(t,e),s=i.getSymetric();this.edges.push(i),this.edges.push(s)},n.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map(function(e){return t.nodes[e]}).forEach(function(e){return t._removeIfDangle(e)})},n.prototype._removeIfDangle=function(t){var e=this;if(t.innerEdges.length<=1){var i=t.getOuterEdges().map(function(s){return s.to});this.removeNode(t),i.forEach(function(s){return e._removeIfDangle(s)})}},n.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))})},n.prototype._computeNextCWEdges=function(t){var e=this;typeof t=="undefined"?Object.keys(this.nodes).forEach(function(i){return e._computeNextCWEdges(e.nodes[i])}):t.getOuterEdges().forEach(function(i,s){t.getOuterEdge((s===0?t.getOuterEdges().length:s)-1).symetric.next=i})},n.prototype._computeNextCCWEdges=function(t,e){for(var i=t.getOuterEdges(),s,u,c=i.length-1;c>=0;--c){var f=i[c],p=f.symetric,d=void 0,g=void 0;f.label===e&&(d=f),p.label===e&&(g=p),!(!d||!g)&&(g&&(u=g),d&&(u&&(u.next=d,u=void 0),s||(s=d)))}u&&(u.next=s)},n.prototype._findLabeledEdgeRings=function(){var t=[],e=0;return this.edges.forEach(function(i){if(!(i.label>=0)){t.push(i);var s=i;do s.label=e,s=s.next;while(!i.isEqual(s));e++}}),t},n.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach(function(i){i.label=void 0}),this._findLabeledEdgeRings().forEach(function(i){t._findIntersectionNodes(i).forEach(function(s){t._computeNextCCWEdges(s,i.label)})});var e=[];return this.edges.forEach(function(i){i.ring||e.push(t._findEdgeRing(i))}),e},n.prototype._findIntersectionNodes=function(t){var e=[],i=t,s=function(){var u=0;i.from.getOuterEdges().forEach(function(c){c.label===t.label&&++u}),u>1&&e.push(i.from),i=i.next};do s();while(!t.isEqual(i));return e},n.prototype._findEdgeRing=function(t){var e=t,i=new Px;do i.push(e),e.ring=i,e=e.next;while(!t.isEqual(e));return i},n.prototype.removeNode=function(t){var e=this;t.getOuterEdges().forEach(function(i){return e.removeEdge(i)}),t.innerEdges.forEach(function(i){return e.removeEdge(i)}),delete this.nodes[t.id]},n.prototype.removeEdge=function(t){this.edges=this.edges.filter(function(e){return!e.isEqual(t)}),t.deleteEdge()},n}();var yK=Qt(Rx(),1);var vK=Qt(Rx(),1);var xK=Qt(w2(),1);var TK=Qt(N2(),1);function D2(n){for(var t=n,e=[];t.parent;)e.unshift(t),t=t.parent;return e}function IK(){return new F2(function(n){return n.f})}var Dx={search:function(n,t,e,i){n.cleanDirty(),i=i||{};var s=i.heuristic||Dx.heuristics.manhattan,u=i.closest||!1,c=IK(),f=t;for(t.h=s(t,e),c.push(t);c.size()>0;){var p=c.pop();if(p===e)return D2(p);p.closed=!0;for(var d=n.neighbors(p),g=0,y=d.length;g<y;++g){var v=d[g];if(!(v.closed||v.isWall())){var E=p.g+v.getCost(p),M=v.visited;(!M||E<v.g)&&(v.visited=!0,v.parent=p,v.h=v.h||s(v,e),v.g=E,v.f=v.g+v.h,n.markDirty(v),u&&(v.h<f.h||v.h===f.h&&v.g<f.g)&&(f=v),M?c.rescoreElement(v):c.push(v))}}}return u?D2(f):[]},heuristics:{manhattan:function(n,t){var e=Math.abs(t.x-n.x),i=Math.abs(t.y-n.y);return e+i},diagonal:function(n,t){var e=1,i=Math.sqrt(2),s=Math.abs(t.x-n.x),u=Math.abs(t.y-n.y);return e*(s+u)+(i-2*e)*Math.min(s,u)}},cleanNode:function(n){n.f=0,n.g=0,n.h=0,n.visited=!1,n.closed=!1,n.parent=null}};function Df(n,t){t=t||{},this.nodes=[],this.diagonal=!!t.diagonal,this.grid=[];for(var e=0;e<n.length;e++){this.grid[e]=[];for(var i=0,s=n[e];i<s.length;i++){var u=new og(e,i,s[i]);this.grid[e][i]=u,this.nodes.push(u)}}this.init()}Df.prototype.init=function(){this.dirtyNodes=[];for(var n=0;n<this.nodes.length;n++)Dx.cleanNode(this.nodes[n])};Df.prototype.cleanDirty=function(){for(var n=0;n<this.dirtyNodes.length;n++)Dx.cleanNode(this.dirtyNodes[n]);this.dirtyNodes=[]};Df.prototype.markDirty=function(n){this.dirtyNodes.push(n)};Df.prototype.neighbors=function(n){var t=[],e=n.x,i=n.y,s=this.grid;return s[e-1]&&s[e-1][i]&&t.push(s[e-1][i]),s[e+1]&&s[e+1][i]&&t.push(s[e+1][i]),s[e]&&s[e][i-1]&&t.push(s[e][i-1]),s[e]&&s[e][i+1]&&t.push(s[e][i+1]),this.diagonal&&(s[e-1]&&s[e-1][i-1]&&t.push(s[e-1][i-1]),s[e+1]&&s[e+1][i-1]&&t.push(s[e+1][i-1]),s[e-1]&&s[e-1][i+1]&&t.push(s[e-1][i+1]),s[e+1]&&s[e+1][i+1]&&t.push(s[e+1][i+1])),t};Df.prototype.toString=function(){for(var n=[],t=this.grid,e,i,s,u,c=0,f=t.length;c<f;c++){for(e=[],i=t[c],s=0,u=i.length;s<u;s++)e.push(i[s].weight);n.push(e.join(" "))}return n.join(\`
16009
16009
  \`)};function og(n,t,e){this.x=n,this.y=t,this.weight=e}og.prototype.toString=function(){return"["+this.x+" "+this.y+"]"};og.prototype.getCost=function(n){return n&&n.x!==this.x&&n.y!==this.y?this.weight*1.41421:this.weight};og.prototype.isWall=function(){return this.weight===0};function F2(n){this.content=[],this.scoreFunction=n}F2.prototype={push:function(n){this.content.push(n),this.sinkDown(this.content.length-1)},pop:function(){var n=this.content[0],t=this.content.pop();return this.content.length>0&&(this.content[0]=t,this.bubbleUp(0)),n},remove:function(n){var t=this.content.indexOf(n),e=this.content.pop();t!==this.content.length-1&&(this.content[t]=e,this.scoreFunction(e)<this.scoreFunction(n)?this.sinkDown(t):this.bubbleUp(t))},size:function(){return this.content.length},rescoreElement:function(n){this.sinkDown(this.content.indexOf(n))},sinkDown:function(n){for(var t=this.content[n];n>0;){var e=(n+1>>1)-1,i=this.content[e];if(this.scoreFunction(t)<this.scoreFunction(i))this.content[e]=t,this.content[n]=i,n=e;else break}},bubbleUp:function(n){for(var t=this.content.length,e=this.content[n],i=this.scoreFunction(e);;){var s=n+1<<1,u=s-1,c=null,f;if(u<t){var p=this.content[u];f=this.scoreFunction(p),f<i&&(c=u)}if(s<t){var d=this.content[s],g=this.scoreFunction(d);g<(c===null?i:f)&&(c=s)}if(c!==null)this.content[n]=this.content[c],this.content[c]=e,n=c;else break}}};function Fx(){this._=null}function jl(n){n.U=n.C=n.L=n.R=n.P=n.N=null}Fx.prototype={constructor:Fx,insert:function(n,t){var e,i,s;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=U2(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)i=e.U,e===i.L?(s=i.R,s&&s.C?(e.C=s.C=!1,i.C=!0,n=i):(n===e.R&&(Ff(this,e),n=e,e=n.U),e.C=!1,i.C=!0,Uf(this,i))):(s=i.L,s&&s.C?(e.C=s.C=!1,i.C=!0,n=i):(n===e.L&&(Uf(this,e),n=e,e=n.U),e.C=!1,i.C=!0,Ff(this,i))),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t=n.U,e,i=n.L,s=n.R,u,c;if(i?s?u=U2(s):u=i:u=s,t?t.L===n?t.L=u:t.R=u:this._=u,i&&s?(c=u.C,u.C=n.C,u.L=i,i.U=u,u!==s?(t=u.U,u.U=n.U,n=u.R,t.L=n,u.R=s,s.U=u):(u.U=t,t=u,n=u.R)):(c=n.C,n=u),n&&(n.U=t),!c){if(n&&n.C){n.C=!1;return}do{if(n===this._)break;if(n===t.L){if(e=t.R,e.C&&(e.C=!1,t.C=!0,Ff(this,t),e=t.R),e.L&&e.L.C||e.R&&e.R.C){(!e.R||!e.R.C)&&(e.L.C=!1,e.C=!0,Uf(this,e),e=t.R),e.C=t.C,t.C=e.R.C=!1,Ff(this,t),n=this._;break}}else if(e=t.L,e.C&&(e.C=!1,t.C=!0,Uf(this,t),e=t.L),e.L&&e.L.C||e.R&&e.R.C){(!e.L||!e.L.C)&&(e.R.C=!1,e.C=!0,Ff(this,e),e=t.L),e.C=t.C,t.C=e.L.C=!1,Uf(this,t),n=this._;break}e.C=!0,n=t,t=t.U}while(!n.C);n&&(n.C=!1)}}};function Ff(n,t){var e=t,i=t.R,s=e.U;s?s.L===e?s.L=i:s.R=i:n._=i,i.U=s,e.U=i,e.R=i.L,e.R&&(e.R.U=e),i.L=e}function Uf(n,t){var e=t,i=t.L,s=e.U;s?s.L===e?s.L=i:s.R=i:n._=i,i.U=s,e.U=i,e.L=i.R,e.L&&(e.L.U=e),i.R=e}function U2(n){for(;n.L;)n=n.L;return n}var Ux=Fx;function Kl(n,t,e,i){var s=[null,null],u=kr.push(s)-1;return s.left=n,s.right=t,e&&Bf(s,n,t,e),i&&Bf(s,t,n,i),Ti[n.index].halfedges.push(u),Ti[t.index].halfedges.push(u),s}function Ql(n,t,e){var i=[t,e];return i.left=n,i}function Bf(n,t,e,i){!n[0]&&!n[1]?(n[0]=i,n.left=t,n.right=e):n.left===e?n[1]=i:n[0]=i}function PK(n,t,e,i,s){var u=n[0],c=n[1],f=u[0],p=u[1],d=c[0],g=c[1],y=0,v=1,E=d-f,M=g-p,A;if(A=t-f,!(!E&&A>0)){if(A/=E,E<0){if(A<y)return;A<v&&(v=A)}else if(E>0){if(A>v)return;A>y&&(y=A)}if(A=i-f,!(!E&&A<0)){if(A/=E,E<0){if(A>v)return;A>y&&(y=A)}else if(E>0){if(A<y)return;A<v&&(v=A)}if(A=e-p,!(!M&&A>0)){if(A/=M,M<0){if(A<y)return;A<v&&(v=A)}else if(M>0){if(A>v)return;A>y&&(y=A)}if(A=s-p,!(!M&&A<0)){if(A/=M,M<0){if(A>v)return;A>y&&(y=A)}else if(M>0){if(A<y)return;A<v&&(v=A)}return!(y>0)&&!(v<1)||(y>0&&(n[0]=[f+y*E,p+y*M]),v<1&&(n[1]=[f+v*E,p+v*M])),!0}}}}}function RK(n,t,e,i,s){var u=n[1];if(u)return!0;var c=n[0],f=n.left,p=n.right,d=f[0],g=f[1],y=p[0],v=p[1],E=(d+y)/2,M=(g+v)/2,A,_;if(v===g){if(E<t||E>=i)return;if(d>y){if(!c)c=[E,e];else if(c[1]>=s)return;u=[E,s]}else{if(!c)c=[E,s];else if(c[1]<e)return;u=[E,e]}}else if(A=(d-y)/(v-g),_=M-A*E,A<-1||A>1)if(d>y){if(!c)c=[(e-_)/A,e];else if(c[1]>=s)return;u=[(s-_)/A,s]}else{if(!c)c=[(s-_)/A,s];else if(c[1]<e)return;u=[(e-_)/A,e]}else if(g<v){if(!c)c=[t,A*t+_];else if(c[0]>=i)return;u=[i,A*i+_]}else{if(!c)c=[i,A*i+_];else if(c[0]<t)return;u=[t,A*t+_]}return n[0]=c,n[1]=u,!0}function B2(n,t,e,i){for(var s=kr.length,u;s--;)(!RK(u=kr[s],n,t,e,i)||!PK(u,n,t,e,i)||!(Math.abs(u[0][0]-u[1][0])>Ln||Math.abs(u[0][1]-u[1][1])>Ln))&&delete kr[s]}function z2(n){return Ti[n.index]={site:n,halfedges:[]}}function LK(n,t){var e=n.site,i=t.left,s=t.right;return e===s&&(s=i,i=e),s?Math.atan2(s[1]-i[1],s[0]-i[0]):(e===i?(i=t[1],s=t[0]):(i=t[0],s=t[1]),Math.atan2(i[0]-s[0],s[1]-i[1]))}function Bx(n,t){return t[+(t.left!==n.site)]}function NK(n,t){return t[+(t.left===n.site)]}function G2(){for(var n=0,t=Ti.length,e,i,s,u;n<t;++n)if((e=Ti[n])&&(u=(i=e.halfedges).length)){var c=new Array(u),f=new Array(u);for(s=0;s<u;++s)c[s]=s,f[s]=LK(e,kr[i[s]]);for(c.sort(function(p,d){return f[d]-f[p]}),s=0;s<u;++s)f[s]=i[c[s]];for(s=0;s<u;++s)i[s]=f[s]}}function k2(n,t,e,i){var s=Ti.length,u,c,f,p,d,g,y,v,E,M,A,_,x=!0;for(u=0;u<s;++u)if(c=Ti[u]){for(f=c.site,d=c.halfedges,p=d.length;p--;)kr[d[p]]||d.splice(p,1);for(p=0,g=d.length;p<g;)M=NK(c,kr[d[p]]),A=M[0],_=M[1],y=Bx(c,kr[d[++p%g]]),v=y[0],E=y[1],(Math.abs(A-v)>Ln||Math.abs(_-E)>Ln)&&(d.splice(p,0,kr.push(Ql(f,M,Math.abs(A-n)<Ln&&i-_>Ln?[n,Math.abs(v-n)<Ln?E:i]:Math.abs(_-i)<Ln&&e-A>Ln?[Math.abs(E-i)<Ln?v:e,i]:Math.abs(A-e)<Ln&&_-t>Ln?[e,Math.abs(v-e)<Ln?E:t]:Math.abs(_-t)<Ln&&A-n>Ln?[Math.abs(E-t)<Ln?v:n,t]:null))-1),++g);g&&(x=!1)}if(x){var T,w,R,B=1/0;for(u=0,x=null;u<s;++u)(c=Ti[u])&&(f=c.site,T=f[0]-n,w=f[1]-t,R=T*T+w*w,R<B&&(B=R,x=c));if(x){var U=[n,t],D=[n,i],P=[e,i],ct=[e,t];x.halfedges.push(kr.push(Ql(f=x.site,U,D))-1,kr.push(Ql(f,D,P))-1,kr.push(Ql(f,P,ct))-1,kr.push(Ql(f,ct,U))-1)}}for(u=0;u<s;++u)(c=Ti[u])&&(c.halfedges.length||delete Ti[u])}var q2=[],sg;function OK(){jl(this),this.x=this.y=this.arc=this.site=this.cy=null}function vu(n){var t=n.P,e=n.N;if(!(!t||!e)){var i=t.site,s=n.site,u=e.site;if(i!==u){var c=s[0],f=s[1],p=i[0]-c,d=i[1]-f,g=u[0]-c,y=u[1]-f,v=2*(p*y-d*g);if(!(v>=-V2)){var E=p*p+d*d,M=g*g+y*y,A=(y*E-d*M)/v,_=(p*M-g*E)/v,x=q2.pop()||new OK;x.arc=n,x.site=s,x.x=A+c,x.y=(x.cy=_+f)+Math.sqrt(A*A+_*_),n.circle=x;for(var T=null,w=tc._;w;)if(x.y<w.y||x.y===w.y&&x.x<=w.x)if(w.L)w=w.L;else{T=w.P;break}else if(w.R)w=w.R;else{T=w;break}tc.insert(T,x),T||(sg=x)}}}}function _u(n){var t=n.circle;t&&(t.P||(sg=t.N),tc.remove(t),q2.push(t),jl(t),n.circle=null)}var W2=[];function DK(){jl(this),this.edge=this.site=this.circle=null}function H2(n){var t=W2.pop()||new DK;return t.site=n,t}function zx(n){_u(n),xu.remove(n),W2.push(n),jl(n)}function X2(n){var t=n.circle,e=t.x,i=t.cy,s=[e,i],u=n.P,c=n.N,f=[n];zx(n);for(var p=u;p.circle&&Math.abs(e-p.circle.x)<Ln&&Math.abs(i-p.circle.cy)<Ln;)u=p.P,f.unshift(p),zx(p),p=u;f.unshift(p),_u(p);for(var d=c;d.circle&&Math.abs(e-d.circle.x)<Ln&&Math.abs(i-d.circle.cy)<Ln;)c=d.N,f.push(d),zx(d),d=c;f.push(d),_u(d);var g=f.length,y;for(y=1;y<g;++y)d=f[y],p=f[y-1],Bf(d.edge,p.site,d.site,s);p=f[0],d=f[g-1],d.edge=Kl(p.site,d.site,null,s),vu(p),vu(d)}function Y2(n){for(var t=n[0],e=n[1],i,s,u,c,f=xu._;f;)if(u=$2(f,e)-t,u>Ln)f=f.L;else if(c=t-FK(f,e),c>Ln){if(!f.R){i=f;break}f=f.R}else{u>-Ln?(i=f.P,s=f):c>-Ln?(i=f,s=f.N):i=s=f;break}z2(n);var p=H2(n);if(xu.insert(i,p),!(!i&&!s)){if(i===s){_u(i),s=H2(i.site),xu.insert(p,s),p.edge=s.edge=Kl(i.site,p.site),vu(i),vu(s);return}if(!s){p.edge=Kl(i.site,p.site);return}_u(i),_u(s);var d=i.site,g=d[0],y=d[1],v=n[0]-g,E=n[1]-y,M=s.site,A=M[0]-g,_=M[1]-y,x=2*(v*_-E*A),T=v*v+E*E,w=A*A+_*_,R=[(_*T-E*w)/x+g,(v*w-A*T)/x+y];Bf(s.edge,d,M,R),p.edge=Kl(d,n,null,R),s.edge=Kl(n,M,null,R),vu(i),vu(s)}}function $2(n,t){var e=n.site,i=e[0],s=e[1],u=s-t;if(!u)return i;var c=n.P;if(!c)return-1/0;e=c.site;var f=e[0],p=e[1],d=p-t;if(!d)return f;var g=f-i,y=1/u-1/d,v=g/d;return y?(-v+Math.sqrt(v*v-2*y*(g*g/(-2*d)-p+d/2+s-u/2)))/y+i:(i+f)/2}function FK(n,t){var e=n.N;if(e)return $2(e,t);var i=n.site;return i[1]===t?i[0]:1/0}var Ln=1e-6,V2=1e-12,xu,Ti,tc,kr;function UK(n,t,e){return(n[0]-e[0])*(t[1]-n[1])-(n[0]-t[0])*(e[1]-n[1])}function BK(n,t){return t[1]-n[1]||t[0]-n[0]}function ag(n,t){var e=n.sort(BK).pop(),i,s,u;for(kr=[],Ti=new Array(n.length),xu=new Ux,tc=new Ux;;)if(u=sg,e&&(!u||e[1]<u.y||e[1]===u.y&&e[0]<u.x))(e[0]!==i||e[1]!==s)&&(Y2(e),i=e[0],s=e[1]),e=n.pop();else if(u)X2(u.arc);else break;if(G2(),t){var c=+t[0][0],f=+t[0][1],p=+t[1][0],d=+t[1][1];B2(c,f,p,d),k2(c,f,p,d)}this.edges=kr,this.cells=Ti,xu=tc=kr=Ti=null}ag.prototype={constructor:ag,polygons:function(){var n=this.edges;return this.cells.map(function(t){var e=t.halfedges.map(function(i){return Bx(t,n[i])});return e.data=t.site.data,e})},triangles:function(){var n=[],t=this.edges;return this.cells.forEach(function(e,i){if(f=(u=e.halfedges).length)for(var s=e.site,u,c=-1,f,p,d=t[u[f-1]],g=d.left===s?d.right:d.left;++c<f;)p=g,d=t[u[c]],g=d.left===s?d.right:d.left,p&&g&&i<p.index&&i<g.index&&UK(s,p,g)<0&&n.push([s.data,p.data,g.data])}),n},links:function(){return this.edges.filter(function(n){return n.right}).map(function(n){return{source:n.left.data,target:n.right.data}})},find:function(n,t,e){for(var i=this,s,u=i._found||0,c=i.cells.length,f;!(f=i.cells[u]);)if(++u>=c)return null;var p=n-f.site[0],d=t-f.site[1],g=p*p+d*d;do f=i.cells[s=u],u=null,f.halfedges.forEach(function(y){var v=i.edges[y],E=v.left;if(!((E===f.site||!E)&&!(E=v.right))){var M=n-E[0],A=t-E[1],_=M*M+A*A;_<g&&(g=_,u=E.index)}});while(u!==null);return i._found=s,e==null||g<=e*e?f.site:null}};var XK=Qt(ec(),1);var t1=Qt(K2(),1);function Di(){return new cg}function cg(){this.reset()}cg.prototype={constructor:cg,reset:function(){this.s=this.t=0},add:function(n){Q2(lg,n,this.t),Q2(this,lg.s,this.s),this.s?this.t+=lg.t:this.s=lg.t},valueOf:function(){return this.s}};var lg=new cg;function Q2(n,t,e){var i=n.s=t+e,s=i-t,u=i-s;n.t=t-u+(e-s)}var yn=1e-6;var Tn=Math.PI,br=Tn/2,fg=Tn/4,os=Tn*2,Eu=180/Tn,Fi=Tn/180,nr=Math.abs,Uo=Math.atan,Ui=Math.atan2,hn=Math.cos;var hg=Math.exp;var zf=Math.log;var Me=Math.sin;var jr=Math.sqrt,Gf=Math.tan;function qx(n){return n>1?0:n<-1?Tn:Math.acos(n)}function Ci(n){return n>1?br:n<-1?-br:Math.asin(n)}function Bo(){}var YK=Di(),k0t=Di();function Su(n){var t=n[0],e=n[1],i=hn(e);return[i*hn(t),i*Me(t),Me(e)]}function kf(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function qf(n){var t=jr(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}var j0t=Di();function eO(n,t){return[n>Tn?n-os:n<-Tn?n+os:n,t]}eO.invert=eO;function Vx(){var n=[],t;return{point:function(e,i){t.push([e,i])},lineStart:function(){n.push(t=[])},lineEnd:Bo,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function Hx(n,t){return nr(n[0]-t[0])<yn&&nr(n[1]-t[1])<yn}function pg(n,t,e,i){this.x=n,this.z=t,this.o=e,this.e=i,this.v=!1,this.n=this.p=null}function Wx(n,t,e,i,s){var u=[],c=[],f,p;if(n.forEach(function(M){if(!((A=M.length-1)<=0)){var A,_=M[0],x=M[A],T;if(Hx(_,x)){for(s.lineStart(),f=0;f<A;++f)s.point((_=M[f])[0],_[1]);s.lineEnd();return}u.push(T=new pg(_,M,null,!0)),c.push(T.o=new pg(_,null,T,!1)),u.push(T=new pg(x,M,null,!1)),c.push(T.o=new pg(x,null,T,!0))}}),!!u.length){for(c.sort(t),nO(u),nO(c),f=0,p=c.length;f<p;++f)c[f].e=e=!e;for(var d=u[0],g,y;;){for(var v=d,E=!0;v.v;)if((v=v.n)===d)return;g=v.z,s.lineStart();do{if(v.v=v.o.v=!0,v.e){if(E)for(f=0,p=g.length;f<p;++f)s.point((y=g[f])[0],y[1]);else i(v.x,v.n.x,1,s);v=v.n}else{if(E)for(g=v.p.z,f=g.length-1;f>=0;--f)s.point((y=g[f])[0],y[1]);else i(v.x,v.p.x,-1,s);v=v.p}v=v.o,g=v.z,E=!E}while(!v.v);s.lineEnd()}}}function nO(n){if(t=n.length){for(var t,e=0,i=n[0],s;++e<t;)i.n=s=n[e],s.p=i,i=s;i.n=s=n[0],s.p=i}}function Aa(n,t){return n<t?-1:n>t?1:n>=t?0:NaN}function Xx(n){return n.length===1&&(n=JK(n)),{left:function(t,e,i,s){for(i==null&&(i=0),s==null&&(s=t.length);i<s;){var u=i+s>>>1;n(t[u],e)<0?i=u+1:s=u}return i},right:function(t,e,i,s){for(i==null&&(i=0),s==null&&(s=t.length);i<s;){var u=i+s>>>1;n(t[u],e)>0?s=u:i=u+1}return i}}}function JK(n){return function(t,e){return Aa(n(t),e)}}var rO=Xx(Aa),jK=rO.right,KK=rO.left;var iO=Array.prototype,tQ=iO.slice,eQ=iO.map;var Vyt=Math.sqrt(50),Hyt=Math.sqrt(10),Wyt=Math.sqrt(2);function gg(n){for(var t=n.length,e,i=-1,s=0,u,c;++i<t;)s+=n[i].length;for(u=new Array(s);--t>=0;)for(c=n[t],e=c.length;--e>=0;)u[--s]=c[e];return u}var lQ=1e9,C_t=-lQ;var Yx=Di();function $x(n,t){var e=t[0],i=t[1],s=[Me(e),-hn(e),0],u=0,c=0;Yx.reset();for(var f=0,p=n.length;f<p;++f)if(g=(d=n[f]).length)for(var d,g,y=d[g-1],v=y[0],E=y[1]/2+fg,M=Me(E),A=hn(E),_=0;_<g;++_,v=T,M=R,A=B,y=x){var x=d[_],T=x[0],w=x[1]/2+fg,R=Me(w),B=hn(w),U=T-v,D=U>=0?1:-1,P=D*U,ct=P>Tn,L=M*R;if(Yx.add(Ui(L*D*Me(P),A*B+L*hn(P))),u+=ct?U+D*os:U,ct^v>=e^T>=e){var W=kf(Su(y),Su(x));qf(W);var V=kf(s,W);qf(V);var Mt=(ct^U>=0?-1:1)*Ci(V[2]);(i>Mt||i===Mt&&(W[0]||W[1]))&&(c+=ct^U>=0?1:-1)}}return(u<-yn||u<yn&&Yx<-yn)^c&1}var B_t=Di();var rxt=Di(),ixt=Di();var hQ=1/0;var axt=-hQ;function Zx(n){this._context=n}Zx.prototype={_radius:4.5,pointRadius:function(n){return this._radius=n,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(n,t){switch(this._point){case 0:{this._context.moveTo(n,t),this._point=1;break}case 1:{this._context.lineTo(n,t);break}default:{this._context.moveTo(n+this._radius,t),this._context.arc(n,t,this._radius,0,os);break}}},result:Bo};var yxt=Di();function Jx(){this._string=[]}Jx.prototype={_radius:4.5,_circle:aO(4.5),pointRadius:function(n){return(n=+n)!==this._radius&&(this._radius=n,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(n,t){switch(this._point){case 0:{this._string.push("M",n,",",t),this._point=1;break}case 1:{this._string.push("L",n,",",t);break}default:{this._circle==null&&(this._circle=aO(this._radius)),this._string.push("M",n,",",t,this._circle);break}}},result:function(){if(this._string.length){var n=this._string.join("");return this._string=[],n}else return null}};function aO(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function jx(n,t,e,i){return function(s,u){var c=t(u),f=s.invert(i[0],i[1]),p=Vx(),d=t(p),g=!1,y,v,E,M={point:A,lineStart:x,lineEnd:T,polygonStart:function(){M.point=w,M.lineStart=R,M.lineEnd=B,v=[],y=[]},polygonEnd:function(){M.point=A,M.lineStart=x,M.lineEnd=T,v=gg(v);var U=$x(y,f);v.length?(g||(u.polygonStart(),g=!0),Wx(v,gQ,U,e,u)):U&&(g||(u.polygonStart(),g=!0),u.lineStart(),e(null,null,1,u),u.lineEnd()),g&&(u.polygonEnd(),g=!1),v=y=null},sphere:function(){u.polygonStart(),u.lineStart(),e(null,null,1,u),u.lineEnd(),u.polygonEnd()}};function A(U,D){var P=s(U,D);n(U=P[0],D=P[1])&&u.point(U,D)}function _(U,D){var P=s(U,D);c.point(P[0],P[1])}function x(){M.point=_,c.lineStart()}function T(){M.point=A,c.lineEnd()}function w(U,D){E.push([U,D]);var P=s(U,D);d.point(P[0],P[1])}function R(){d.lineStart(),E=[]}function B(){w(E[0][0],E[0][1]),d.lineEnd();var U=d.clean(),D=p.result(),P,ct=D.length,L,W,V;if(E.pop(),y.push(E),E=null,!!ct){if(U&1){if(W=D[0],(L=W.length-1)>0){for(g||(u.polygonStart(),g=!0),u.lineStart(),P=0;P<L;++P)u.point((V=W[P])[0],V[1]);u.lineEnd()}return}ct>1&&U&2&&D.push(D.pop().concat(D.shift())),v.push(D.filter(dQ))}}return M}}function dQ(n){return n.length>1}function gQ(n,t){return((n=n.x)[0]<0?n[1]-br-yn:br-n[1])-((t=t.x)[0]<0?t[1]-br-yn:br-t[1])}var mQ=jx(function(){return!0},yQ,_Q,[-Tn,-br]);function yQ(n){var t=NaN,e=NaN,i=NaN,s;return{lineStart:function(){n.lineStart(),s=1},point:function(u,c){var f=u>0?Tn:-Tn,p=nr(u-t);nr(p-Tn)<yn?(n.point(t,e=(e+c)/2>0?br:-br),n.point(i,e),n.lineEnd(),n.lineStart(),n.point(f,e),n.point(u,e),s=0):i!==f&&p>=Tn&&(nr(t-i)<yn&&(t-=i*yn),nr(u-f)<yn&&(u-=f*yn),e=vQ(t,e,u,c),n.point(i,e),n.lineEnd(),n.lineStart(),n.point(f,e),s=0),n.point(t=u,e=c),i=f},lineEnd:function(){n.lineEnd(),t=e=NaN},clean:function(){return 2-s}}}function vQ(n,t,e,i){var s,u,c=Me(n-e);return nr(c)>yn?Uo((Me(t)*(u=hn(i))*Me(e)-Me(i)*(s=hn(t))*Me(n))/(s*u*c)):(t+i)/2}function _Q(n,t,e,i){var s;if(n==null)s=e*br,i.point(-Tn,s),i.point(0,s),i.point(Tn,s),i.point(Tn,0),i.point(Tn,-s),i.point(0,-s),i.point(-Tn,-s),i.point(-Tn,0),i.point(-Tn,s);else if(nr(n[0]-t[0])>yn){var u=n[0]<t[0]?Tn:-Tn;s=e*u/2,i.point(-u,s),i.point(0,s),i.point(u,s)}else i.point(t[0],t[1])}function mg(n){return function(t){var e=new Kx;for(var i in n)e[i]=n[i];return e.stream=t,e}}function Kx(){}Kx.prototype={constructor:Kx,point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var i1t=hn(30*Fi);var v1t=mg({point:function(n,t){this.stream.point(n*Fi,t*Fi)}});function yg(n){return function(t,e){var i=hn(t),s=hn(e),u=n(i*s);return[u*s*Me(t),u*Me(e)]}}function ss(n){return function(t,e){var i=jr(t*t+e*e),s=n(i),u=Me(s),c=hn(s);return[Ui(t*u,i*c),Ci(i&&e*u/i)]}}var dO=yg(function(n){return jr(2/(1+n))});dO.invert=ss(function(n){return 2*Ci(n/2)});var gO=yg(function(n){return(n=qx(n))&&n/Me(n)});gO.invert=ss(function(n){return n});function Qx(n,t){return[n,zf(Gf((br+t)/2))]}Qx.invert=function(n,t){return[n,2*Uo(hg(t))-br]};function vg(n,t){return[n,t]}vg.invert=vg;function mO(n,t){var e=hn(t),i=hn(n)*e;return[e*Me(n)/i,Me(t)/i]}mO.invert=ss(Uo);function yO(n,t){var e=t*t,i=e*e;return[n*(.8707-.131979*e+i*(-.013791+i*(.003971*e-.001529*i))),t*(1.007226+e*(.015085+i*(-.044475+.028874*e-.005916*i)))]}yO.invert=function(n,t){var e=t,i=25,s;do{var u=e*e,c=u*u;e-=s=(e*(1.007226+u*(.015085+c*(-.044475+.028874*u-.005916*c)))-t)/(1.007226+u*(.015085*3+c*(-.044475*7+.028874*9*u-.005916*11*c)))}while(nr(s)>yn&&--i>0);return[n/(.8707+(u=e*e)*(-.131979+u*(-.013791+u*u*u*(.003971-.001529*u)))),e]};function vO(n,t){return[hn(t)*Me(n),Me(t)]}vO.invert=ss(Ci);function _O(n,t){var e=hn(t),i=1+hn(n)*e;return[e*Me(n)/i,Me(t)/i]}_O.invert=ss(function(n){return 2*Uo(n)});function xO(n,t){return[zf(Gf((br+t)/2)),-n]}xO.invert=function(n,t){return[-t,2*Uo(hg(n))-br]};var bQ=Qt(ec(),1);var AQ=Qt(ec(),1);var CQ=Qt(ec(),1);var IQ=Qt(ec(),1);function SO(n,t){let e=0,i=1/0,[s,u]=t;for(let c=0;c<n.length-1;c++){let[f,p]=n[c],[d,g]=n[c+1],y=Math.min(f,d)<=s&&s<=Math.max(f,d),v=Math.min(p,g)<=u&&u<=Math.max(p,g);if(y&&v){let E=Math.abs((d-f)*(u-p)-(g-p)*(s-f));E<i&&(i=E,e=c)}}return e}function wO(n,t){let e=n[0],i=n[1],s=!1;for(let u=0,c=t.length-1;u<t.length;c=u++){let f=t[u][0],p=t[u][1],d=t[c][0],g=t[c][1];p>i!=g>i&&e<(d-f)*(i-p)/(g-p)+f&&(s=!s)}return s}var NAt=Qt(ZO(),1),OAt=Qt(o_(),1);function aD(n){return n.replace(/[A-Z]/g,t=>"_"+t.toLowerCase()).replace(/^_/,"")}function uD(n){let t={};for(let i in n)i.startsWith("on")&&(t[aD(i.slice(2))]=n[i]);let e=i=>Ri(this,null,function*(){let{data:s}=i;if(t[s.type])try{let u=yield t[s.type](s.data);if(u!=null&&u.$transfer&&Array.isArray(u.$transfer)){let c=u.$transfer;delete u.$transfer,self.postMessage({type:""+s.type+"_result",key:s.key,data:u},c)}else self.postMessage({type:""+s.type+"_result",key:s.key,data:u})}catch(u){self.postMessage({type:""+s.type+"_result",key:s.key,error:u})}else self.postMessage({type:""+s.type+"_result",key:s.key,error:"no_event"})});return self.addEventListener("message",e),()=>{self.removeEventListener("message",e)}}var qAt=Qt(bD(),1),VAt=Qt(Bc(),1);function AD(n,t,e){e===void 0&&(e=0),n.forEach(i=>{if(i.geometry.coords=JSON.parse(JSON.stringify(i.geometry.cds)),i.geometry.type==="polygon"){var s;i.geometry.coords.map(u=>{Array.isArray(u)&&u.forEach(c=>{c[0]-=t[0],c[1]-=t[1]})}),i.geometry.otherCds&&(i.geometry.otherCoords=i.geometry.otherCds.map(u=>u.map(c=>ic(c,t)))),(s=i.doors)!=null&&s.length&&i.doors.map(u=>{u.coord=ic(u.coordinate,t)}),i.center&&(i.centerCoords=ic(i.center,t))}else i.geometry.coords=ic(i.geometry.cds,t),i.center&&(i.centerCoords=ic(i.center,t));if(i.center_x&&i.center_y){let[u,c]=ic([i.center_x,i.center_y],t);i.center_coord_x=u,i.center_coord_y=c}});for(let i=0;i<n.length;i++){let s=n[i];s.deltaHeight=1e-5*(e+i+1)}}function ic(n,t){return[n[0]-t[0],n[1]-t[1]]}var jAt=Qt(p0(),1),KAt=Qt(d0(),1),QAt=Qt(g0(),1),tTt=Qt(y0(),1),eTt=Qt(v0(),1),nTt=Qt(S0(),1),rTt=Qt(I0(),1),iTt=Qt(R0(),1),oTt=Qt(L0(),1),sTt=Qt(O0(),1),aTt=Qt(F0(),1),uTt=Qt(G0(),1),lTt=Qt(V0(),1),cTt=Qt(iy(),1),fTt=Qt(oy(),1),hTt=Qt(Sh(),1);function Eg(n,t=!1){let e=n[0].index!==null,i=new Set(Object.keys(n[0].attributes)),s=new Set(Object.keys(n[0].morphAttributes)),u={},c={},f=n[0].morphTargetsRelative,p=new ui,d=0;for(let g=0;g<n.length;++g){let y=n[g],v=0;if(e!==(y.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+g+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let E in y.attributes){if(!i.has(E))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+g+'. All geometries must have compatible attributes; make sure "'+E+'" attribute exists among all geometries, or in none of them.'),null;u[E]===void 0&&(u[E]=[]),u[E].push(y.attributes[E]),v++}if(v!==i.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+g+". Make sure all geometries have the same number of attributes."),null;if(f!==y.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+g+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let E in y.morphAttributes){if(!s.has(E))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+g+". .morphAttributes must be consistent throughout all geometries."),null;c[E]===void 0&&(c[E]=[]),c[E].push(y.morphAttributes[E])}if(t){let E;if(e)E=y.index.count;else if(y.attributes.position!==void 0)E=y.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+g+". The geometry must have either an index or a position attribute"),null;p.addGroup(d,E,g),d+=E}}if(e){let g=0,y=[];for(let v=0;v<n.length;++v){let E=n[v].index;for(let M=0;M<E.count;++M)y.push(E.getX(M)+g);g+=n[v].attributes.position.count}p.setIndex(y)}for(let g in u){let y=TD(u[g]);if(!y)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+g+" attribute."),null;p.setAttribute(g,y)}for(let g in c){let y=c[g][0].length;if(y===0)break;p.morphAttributes=p.morphAttributes||{},p.morphAttributes[g]=[];for(let v=0;v<y;++v){let E=[];for(let A=0;A<c[g].length;++A)E.push(c[g][A][v]);let M=TD(E);if(!M)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+g+" morphAttribute."),null;p.morphAttributes[g].push(M)}}return p}function TD(n){let t,e,i,s=-1,u=0;for(let d=0;d<n.length;++d){let g=n[d];if(t===void 0&&(t=g.array.constructor),t!==g.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(e===void 0&&(e=g.itemSize),e!==g.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(i===void 0&&(i=g.normalized),i!==g.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(s===-1&&(s=g.gpuType),s!==g.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;u+=g.count*e}let c=new t(u),f=new Yn(c,e,i),p=0;for(let d=0;d<n.length;++d){let g=n[d];if(g.isInterleavedBufferAttribute){let y=p/e;for(let v=0,E=g.count;v<E;v++)for(let M=0;M<e;M++){let A=g.getComponent(v,M);f.setComponent(v+y,M,A)}}else c.set(g.array,p);p+=g.count*e}return s!==void 0&&(f.gpuType=s),f}function CD(n,t,e){t===void 0&&(t=!0),e===void 0&&(e=!1);let i=n.filter(f=>f.geometry.type==="polygon");if(!i.length)return null;let s=i.map(f=>{var p;let d=f.geometry.coords,g=fd(d[0],d.slice(1)),y=new rd(g,{steps:1,bevelEnabled:!1,depth:f.height,curveSegments:4});(p=f).deltaHeight||(p.deltaHeight=0),y.translate(0,0,f.airHeight+f.deltaHeight);let v=y.attributes.position.count,E=new Float32Array(v).fill(f.height+f.airHeight+f.deltaHeight);if(y.setAttribute("maxZ",new Yn(E,1)),y.setAttribute("opacity",new Yn(new Float32Array(v).fill(f.fillOpacity),1)),e){let _=new Float32Array(v).fill(f.airHeight+f.deltaHeight);y.setAttribute("minZ",new Yn(_,1))}let M=new Te(f.fillColor).convertLinearToSRGB(),A=new Float32Array(v*3);for(let _=0;_<v;_++)A[_*3]=M.r,A[_*3+1]=M.g,A[_*3+2]=M.b;return y.setAttribute("color",new Yn(A,3)),y}),u=Eg(s);s.forEach(f=>f.dispose());let c={geometry:u};return u.dispose(),t&&(c.lineGeometry=c1(i)||void 0),c}function c1(n){let{points:t,colors:e,opacities:i}=Ktt(n);if(!t.length)return null;let s=new ui().setFromPoints(t);return s.setAttribute("color",new Yn(new Float32Array(e),3)),s.setAttribute("opacity",new Yn(new Float32Array(i),1)),s}function Ktt(n){let t=[],e=[],i=[];return n.filter(s=>s.strokeOpacity>0).map(s=>{let u=s.height+(s.deltaHeight||0)+s.airHeight,{coords:c}=s.geometry,{strokeColor:f,strokeOpacity:p}=s,d=new Te(f).convertLinearToSRGB();for(let g=0;g<c.length;g++){let y=c[g];for(let v=0;v<y.length;v++){let E=y[v],M=v+1===y.length?y[0]:y[v+1];t.push(new st(E[0],E[1],u)),t.push(new st(M[0],M[1],u)),e.push(d.r,d.g,d.b),e.push(d.r,d.g,d.b),i.push(p),i.push(p)}}}),{points:t,colors:e,opacities:i}}var Hf=function(n){return n.HALF="half",n.POWER="power",n.MECHANICAL="mechanical",n.NORMAL="normal",n.VIP="vip",n}({});var ID=new Ko,Sg=new st,wg=class extends sd{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";let t=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],e=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],i=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(i),this.setAttribute("position",new _r(t,3)),this.setAttribute("uv",new _r(e,2))}applyMatrix4(t){let e=this.attributes.instanceStart,i=this.attributes.instanceEnd;return e!==void 0&&(e.applyMatrix4(t),i.applyMatrix4(t),e.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));let i=new gf(e,6,1);return this.setAttribute("instanceStart",new ts(i,3,0)),this.setAttribute("instanceEnd",new ts(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));let i=new gf(e,6,1);return this.setAttribute("instanceColorStart",new ts(i,3,0)),this.setAttribute("instanceColorEnd",new ts(i,3,3)),this}fromWireframeGeometry(t){return this.setPositions(t.attributes.position.array),this}fromEdgesGeometry(t){return this.setPositions(t.attributes.position.array),this}fromMesh(t){return this.fromWireframeGeometry(new od(t.geometry)),this}fromLineSegments(t){let e=t.geometry;return this.setPositions(e.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Ko);let t=this.attributes.instanceStart,e=this.attributes.instanceEnd;t!==void 0&&e!==void 0&&(this.boundingBox.setFromBufferAttribute(t),ID.setFromBufferAttribute(e),this.boundingBox.union(ID))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new uu),this.boundingBox===null&&this.computeBoundingBox();let t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(t!==void 0&&e!==void 0){let i=this.boundingSphere.center;this.boundingBox.getCenter(i);let s=0;for(let u=0,c=t.count;u<c;u++)Sg.fromBufferAttribute(t,u),s=Math.max(s,i.distanceToSquared(Sg)),Sg.fromBufferAttribute(e,u),s=Math.max(s,i.distanceToSquared(Sg));this.boundingSphere.radius=Math.sqrt(s),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(t){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(t)}};var xTt=Qt(sD(),1);var Mg=function(n){return n.LAYERED_RENDER_VERSION="layeredRender",n.MERGED_RENDER_VERSION="mergedRender",n}({});var f1=["range","ground","store","facility","parkingSpace"];function PD(n){return f1.indexOf(n.l_type)===-1?f1.length:f1.indexOf(n.l_type)}function Qtt(n){n.layers.sort((t,e)=>PD(t)-PD(e))}function tet(n){let t=n.layers.find(i=>i.l_type==="range"),e=[t.elements[0].center_x,t.elements[0].center_y];n.layers.map(i=>{if(i.l_type!=="range")return AD(i.elements,e)})}function RD(n){Qtt(n),tet(n)}function bg(n,t){return t===void 0&&(t=4),n.floor_id+"_"+n.version_id+(t?"_"+t:"")}var oc=[],sc=[];function eet(n,t){return Ri(this,null,function*(){return yield rp(),fy(n,""+t)})}function LD(n,t,e){return Ri(this,null,function*(){let{db:i}=yield rp();return cC(n,""+t,e,i)})}function net(n){return Ri(this,null,function*(){let t=yield fetch(n.map_url).then(e=>e.json());return t.floor=n.floor,RD(t),oc.push(t),t})}function ret(n,t){return Ri(this,null,function*(){let e=bg(n,t===Mg.LAYERED_RENDER_VERSION?1:void 0);try{let i=yield eet(np.MAP_DATA,e);return i&&(t===Mg.LAYERED_RENDER_VERSION||i.transformed)?(console.log("\\u4ECE\\u7F13\\u5B58\\u4E2D\\u53D6\\u5230\\u4E86\\u6570\\u636E"),i):(console.log("\\u7F13\\u5B58\\u4E2D\\u6CA1\\u6709\\u6570\\u636E",e,i),sc.push(n),null)}catch(i){return console.log("[get floor data error]",i),sc.push(n),null}})}function iet(n,t){return t===void 0&&(t=!0),t&&(n.layers.forEach(e=>{switch(e.l_type){case"ground":if(e.elements.length<2)break;e.mergedElements=Wf(e.elements);break;case"store":h1(e.elements),e.mergedElements=Wf(e.elements);break;case"facility":h1(e.elements),e.mergedElements=Wf(e.elements);break;case"parkingSpace":console.time("parkingSpace merge"),e.mergedElements=oet(e.elements),console.timeEnd("parkingSpace merge"),e.mergedParkingTexture=uet(e.elements);break;case"graph":h1(e.elements),e.mergedElements=Wf(e.elements);break;case"wall":e.mergedElements=Wf(e.elements,!1,!0);break;case"lane":e.mergedElements=set(e.elements);break;case"texture2d":case"texture3d":e.mergedMatrixes=ND(e.elements);break;case"glb":case"text":}}),n.transformed=!0),n}function Wf(n,t,e){t===void 0&&(t=!0),e===void 0&&(e=!1);let i=CD(n,t,e);if(i){var s;return[xc({},n[0],{mergedGeometry:i.geometry.toJSON(),lineGeometry:((s=i.lineGeometry)==null?void 0:s.toJSON())||null})]}else return[]}function oet(n){let t=[],e=[],i=[],s=[];n.forEach((c,f)=>{let p=c.geometry.coords[0],[d,g,y]=p.slice(0,3),v=Math.sqrt((g[0]-d[0])**2+(g[1]-d[1])**2),E=Math.sqrt((y[0]-g[0])**2+(y[1]-g[1])**2),M=[v,E],A=Math.max(...M),_=Math.min(...M),x;A===v?x=[g[0]-d[0],g[1]-d[1]]:x=[y[0]-g[0],y[1]-g[1]];let[T,w]=x,R=Math.atan2(w,T)-Math.PI/2,B=new jn().compose(new st(c.center_coord_x,c.center_coord_y,(c.deltaHeight||0)+c.airHeight+c.height/2),new No().setFromAxisAngle(new st(0,0,1),R),new st(_,A,c.height));i.push(...B.toArray()),s.push(...new Te(c.fillColor).convertLinearToSRGB().toArray()),t[f]=c.fillOpacity||1,e[f]=(c.deltaHeight||0)+c.airHeight+c.height});let u=c1(n);return{size:n.length,opacities:t,maxZ:e,matrixes:i,colors:s,lineGeometry:(u==null?void 0:u.toJSON())||null}}function ND(n){let t=n.reduce((i,s)=>{let{iconUrl:u}=s;return i.has(u)||i.set(u,[]),i.get(u).push(s),i},new Map);return Array.from(t.values()).map(i=>{let s=i.map(c=>new jn().compose(new st(c.centerCoords[0],c.centerCoords[1],c.deltaHeight+c.airHeight+c.height),new No().setFromAxisAngle(new st(0,0,1),c.secondRotate),new st(c.secondWidth,c.secondHeight,1)).toArray());return xc({},i[0],{mergedMatrixes:{size:s.length,array:s.flat()}})})}function set(n){let t=n.map(u=>{let c=fd(u.geometry.coords[0].slice(0,-1),u.geometry.coords.slice(1)),f=new id(c,4),p=f.getAttribute("position"),d=[],g=new Te(u.fillColor);for(let v=0;v<p.count;v++){p.setZ(v,u.airHeight+(u.deltaHeight||0));var y;d.push(g.r,g.g,g.b,(y=u.fillOpacity)!=null?y:1)}return f.setAttribute("color",new Yn(new Float32Array(d),4)),f}),e=Eg(t);t.forEach(u=>u.dispose());let i={mergedGeometry:e.toJSON()};e.dispose();let s=n.filter(u=>{var c,f;return u.double&&((f=u.geometry.otherCoords)==null||(c=f[1])==null?void 0:c.length)});return s.length&&[!0,!1].forEach(u=>{let c=s.filter(g=>g.double===!0&&g.dashed===u);if(!c.length)return;let f=[],p=[];c.forEach(g=>{let y=g.geometry.otherCoords[1],v=g.airHeight+(g.deltaHeight||0)+.01,E=new Te(g.secondColor);for(let M=0;M<y.length-1;M++){let A=y[M],_=y[M+1];f.push(A[0],A[1],v,_[0],_[1],v),p.push(E.r,E.g,E.b,E.r,E.g,E.b)}});let d=new wg;d.setPositions(f),d.setColors(p),i[u?"dashedLineGeometry":"lineGeometry"]={positions:f,colors:p},d.dispose()}),i}var aet=new Set([Hf.HALF,Hf.MECHANICAL,Hf.POWER,Hf.VIP]);function uet(n){let t=n.filter(e=>aet.has(e.parkingType)).map(e=>{let i=new Ft(...e.geometry.coords[0][0]),s=new Ft(...e.geometry.coords[0][1]),u=new Ft(...e.geometry.coords[0][2]),c=Math.min(i.distanceTo(s),s.distanceTo(u)),f=0;return c===i.distanceTo(s)?f=s.sub(i).angle()-Math.PI/2:f=u.sub(s).angle()-Math.PI/2,{uuid:e.id,iconUrl:e.parkingType,name:e.texts[0],deltaHeight:(e.deltaHeight||0)+.001,airHeight:e.airHeight,height:e.height,geometry:e.geometry,opacity:e.fillOpacity,visible:!0,secondWidth:c-1,secondHeight:c-1,secondRotate:f,centerCoords:[e.center_coord_x,e.center_coord_y]}});return ND(t)}function h1(n){n.map(t=>{var e;if((e=t.doors)!=null&&e.length&&t.geometry.type==="polygon"){let i=t.geometry.coords[0];t.doors.forEach(s=>{let u=s.type==="single"?.5:1,c=.5,f=SO(i,s.coord),p=new Ft(...s.coord),d=new Ft(...i[f]).sub(new Ft(...s.coord)).normalize(),g=new Ft().addVectors(p,d.clone().multiplyScalar(u)),y=new Ft().addVectors(p,d.clone().multiplyScalar(-u)),v=new Ft(-d.y,d.x),E=new Ft().addVectors(g,v.clone().multiplyScalar(c));wO([E.x,E.y],i)||(v.multiplyScalar(-1),E=new Ft().addVectors(g,v.clone().multiplyScalar(c)));let M=new Ft().addVectors(y,v.clone().multiplyScalar(c)),A=[[g.x,g.y],[E.x,E.y],[M.x,M.y],[y.x,y.y]];i=[...i.slice(0,f+1),...A,...i.slice(f+1)]}),t.geometry.coords[0]=i}})}var p1="";function OD(n){let t=sc.findIndex(e=>e.floor===n);if(t!==-1){console.log("\\u8C03\\u6574\\u697C\\u5C42\\u8BF7\\u6C42\\u7684\\u4F18\\u5148\\u7EA7",n,t);let e=sc.splice(t,1)[0];sc.unshift(e)}else p1=n}var d1="";function DD(n){let t=oc.findIndex(e=>e.floor===n);if(t!==-1){console.log("\\u8C03\\u6574\\u697C\\u5C42merge\\u4F18\\u5148\\u7EA7",n,t);let e=oc.splice(t,1)[0];oc.unshift(e)}else d1=n}function cet(n){OD(n),DD(n)}uD({onLoad(n){return Ri(this,null,function*(){let{floors:t,version:e}=n;for(yield rp(),yield Promise.all(t.map(i=>Ri(this,null,function*(){return ret(i,e)}))),p1&&OD(p1),yield Promise.all(sc.map(i=>Ri(this,null,function*(){let s=yield net(i);if(s&&e===Mg.LAYERED_RENDER_VERSION){let u=bg(t.find(c=>c.floor===s.floor),1);yield LD(np.MAP_DATA,u,s),console.log(s.floor+" \\u5199\\u5165\\u7F13\\u5B58\\u6210\\u529F\\uFF0Ckey="+u),self.postMessage({type:"floor_success",data:{floor:s.floor}})}}))),d1&&DD(d1);oc.length>0;){let i=oc.shift(),s=iet(i),u=bg(t.find(c=>c.floor===i.floor));yield LD(np.MAP_DATA,u,s),console.log(i.floor+" \\u5199\\u5165\\u7F13\\u5B58\\u6210\\u529F\\uFF0Ckey="+u),self.postMessage({type:"floor_success",data:{floor:i.floor}})}fC(),console.log("\\u6240\\u6709\\u6570\\u636E\\u5904\\u7406\\u5B8C\\u6210")})},onAdjustFloorPriority(n){let{floor:t}=n;cet(t)}});
16010
- `],{type:"text/javascript"}),t=URL.createObjectURL(r),e=new Worker(t);return URL.revokeObjectURL(t),e}var tMt={mergeParkingSpace:!0,mergeGraphic:!0,renderVersion:vg.MERGED_RENDER_VERSION},fp=class extends Zi{initDb(){return Tt(this,null,function*(){try{let{db:t}=yield n6();this.db=t}catch(t){console.log("[\u6253\u5F00indexDb\u9519\u8BEF]",t)}})}load(t,e){return Tt(this,null,function*(){if(Array.isArray(t))this.floors=t,e&&(this.placeConfig=te({},this.placeConfig,e));else if(typeof t=="string"){let n=yield fetch(t).then(i=>i.json());n.code===200&&(this.floors=n.data.list,this.placeConfig=te({},this.placeConfig,JSON.parse(n.data.config||"{}")))}else return this.load("https://screen.aibee.cn/ai-map/map/get-floor-map?place_id="+t);this.getOtherDataByFreeTime()})}setCacheData(t,e,n){return Tt(this,null,function*(){return this.initDbPromise.then(()=>r6(t,""+e,n))})}getCacheData(t,e){return Tt(this,null,function*(){return this.initDbPromise.then(()=>Wv(t,""+e))})}getFloorData(t){return Tt(this,null,function*(){let e=yield this.getFloorJsonData(t);return e?this.getDataByJson(e):null})}getFloorDataByFloorInfo(t){return Tt(this,null,function*(){let e=yield this.getFloorJsonDataByFloorInfo(t);return this.getDataByJson(e)})}setLocale(t){this.locale=t,this.bmap.context.currentFloor&&this.bmap.context.currentFloor.poiLayer2.pois.forEach(e=>{e.userData.type==="store"&&(e.options.text=V6(e.userData.data,t)),e.userData.type==="facility"&&(e.options.text=H6(e.userData.data,t))})}getFloorJsonDataByFloorInfo(t){return Tt(this,null,function*(){if(this.getFloorDataPromise.has(t.floor))return this.getFloorDataPromise.get(t.floor);let e=new Promise(n=>Tt(this,null,function*(){let i=_g(t),o=yield fetch(t.map_url).then(a=>a.json());o.floor=t.floor,b_(o),this.setCacheData(js.MAP_DATA,i,o),this.setCacheData(js.MAP_VERSION,i,t.version_id),n(o)}));return this.getFloorDataPromise.set(t.floor,e),e})}getFloorJsonData(t){return Tt(this,null,function*(){let e=this.floors.find(n=>n.floor===t);return e?new Promise(n=>Tt(this,null,function*(){let i=_g(e,this.options.renderVersion===vg.LAYERED_RENDER_VERSION?1:void 0);try{let o=_g(e),a=yield this.getCacheData(js.MAP_DATA,o);if(a&&a.transformed){console.log("\u4ECE\u7F13\u5B58\u4E2D\u53D6\u5230\u4E86\u5408\u5E76\u540E\u7684\u6570\u636E"),n(a);return}if(this.options.renderVersion===vg.LAYERED_RENDER_VERSION){let l=yield this.getCacheData(js.MAP_DATA,i);if(l){console.log("\u4ECE\u7F13\u5B58\u4E2D\u53D6\u5230\u4E86\u6570\u636E"),n(l);return}}if(console.log("\u7F13\u5B58\u4E2D\u6CA1\u6709\u6570\u636E"),this.loadWorker){fi(this.loadWorker,"adjust_floor_priority",{floor:t});let l=c=>{if(c.data.type==="floor_success"&&c.data.data.floor===t){var f;(f=this.loadWorker)==null||f.removeEventListener("message",l),n(this.getFloorJsonData(t))}};this.loadWorker.addEventListener("message",l)}else n(this.getFloorJsonDataByFloorInfo(e))}catch(o){console.log("[get floor data error]",o),n(this.getFloorJsonDataByFloorInfo(e))}})):null})}getRoadNetworkData(){return Tt(this,null,function*(){return(yield Promise.all(this.floors.map(e=>Tt(this,null,function*(){let n=_g(e,0);try{let i=yield this.getCacheData(js.ROAD_NETWORK_DATA,n);if(i)return i;let o=yield fetch(e.route_url).then(a=>a.json());return this.setCacheData(js.ROAD_NETWORK_DATA,n,o),this.setCacheData(js.ROUTE_VERSION,n,e.version_id),o}catch(i){let o=yield fetch(e.route_url).then(a=>a.json());return this.setCacheData(js.ROAD_NETWORK_DATA,n,o),o}})))).filter(e=>e.points)})}getFacilitiesData(){return Tt(this,null,function*(){let t=this.floors.reduce((i,o)=>i.updated_at>o.updated_at?i:o,this.floors[0]);if(!t)return null;let e=_g(t,0),n=()=>Tt(this,null,function*(){let i=yield fetch(t.entry_infra_url).then(o=>o.json());return i&&(this.setCacheData(js.FACILITY_DATA,e,i),this.setCacheData(js.FACILITY_VERSION,e,t.version_id)),i});try{let i=yield this.getCacheData(js.FACILITY_DATA,e);return i||n()}catch(i){return console.log("[get facility error]",i),n()}})}getOtherDataByFreeTime(){return Tt(this,null,function*(){yield this.initDbPromise,yield fi(this.loadWorker,"load",{floors:this.floors,version:this.options.renderVersion}),this.closeWorker()})}getMulFloorsData(t){return Tt(this,null,function*(){return Promise.all(t.map(e=>this.getFloorData(e))).then(e=>e.filter(n=>n))})}getDataByUrl(t){return Tt(this,null,function*(){let e=yield fetch(t).then(n=>n.json());return this.getDataByJson(e)})}getDataByJson(t,e,n){return Tt(this,null,function*(){b_(t),e=this.getFloorBaseLayer(t,e);let i=te({},this.placeConfig,n);return yield this.getFloorContentLayer(t,e),yield this.getFloorPoi(t,e,i),this.changeFloorBox(t,e),e})}getDataByJsonStep(t,e,n){return Tt(this,null,function*(){b_(t),e=this.getFloorBaseLayer(t,e);let i=te({},this.placeConfig,n);return this.changeFloorBox(t,e),requestAnimationFrame(()=>Tt(this,null,function*(){yield this.getFloorContentLayer(t,e),this.changeFloorBox(t,e),requestAnimationFrame(()=>Tt(this,null,function*(){yield this.getFloorPoi(t,e,i),this.changeFloorBox(t,e)}))})),e})}changeFloorBox(t,e){e.updateBox();let n=e.box.getSize(new G),i=Math.max(n.x,n.y,n.z);e.userData.height=i/4+t.floorHeight}switchFloor(t,e){return Tt(this,null,function*(){return new Promise(n=>{let i={run:()=>this._switchFloor(t,e),meta:{type:"switchFloor"}},o=this.taskQueue.replaceByMetaType(i),a=l=>{let{task:c,res:f}=l;c.tid===o&&(this.taskQueue.removeEventListener("active-task-end",a),n(f))};this.taskQueue.addEventListener("active-task-end",a)})})}_switchFloor(t,e){return Tt(this,null,function*(){var n;let i=t;if(typeof t=="string"){let g=yield this.getFloorJsonData(t);if(g)i=g;else return null}else b_(t);let o=te({},this.placeConfig,e),a=new $a(this.bmap.context);a.userData.data=t;let l=this.floors.find(g=>g.floor===i.floor);var c;let f=(c=l==null?void 0:l.map_angle)!=null?c:0;return this.bmap.dispatchEvent({type:ss.SWITCH_FLOOR_BEFORE,data:{curFloor:a,graphics:[]}}),this.dispatchEvent({type:"switch-floor-before",data:{curFloor:a,graphics:[],floorData:i}}),this.bmap.context.scene.background=new ne(o.backgroundColor),this.getFloorBaseLayer(i,a),this.changeFloorBox(i,a),this.bmap.buildingCenter=a.userData.center,this.bmap.currentBuildGround=(n=a.userData.data.layers.find(g=>g.l_type==="range"))==null?void 0:n.elements[0],this.bmap.context.switchFloor(a),this.bmap.initialFloorCamera(),this.bmap.context.control.setAzimuthalAngle(f/180*Math.PI,!0),this.bmap.context.cameraBound.updateBox(),this.dispatchEvent({type:"switch-floor-ground",data:{curFloor:a,graphics:[]}}),this.bmap.dispatchEvent({type:ss.SWITCH_FLOOR_GROUND,data:{curFloor:a}}),yield y1(),yield this.getFloorContentLayer(i,a),this.changeFloorBox(i,a),this.bmap.context.cameraBound.updateBox(),this.dispatchEvent({type:"switch-floor-content",data:{curFloor:a,graphics:[]}}),yield ET(2),yield this.getFloorPoi(i,a,o),this.dispatchEvent({type:"switch-floor-after",data:{curFloor:a,graphics:a.graphicLayer.children}}),this.bmap.dispatchEvent({type:ss.SWITCH_FLOOR_AFTER,data:{curFloor:a,graphics:a.graphicLayer.children}}),a})}getFloorBaseLayer(t,e){e||(e=new $a(this.bmap.context));let n=[0,0];return t.layers.forEach(i=>{switch(i.l_type){case"range":let o=i.elements[0];n=[o.center_x,o.center_y],e.userData.range=o.geometry.cds[0],e.userData.rangeGraphic=o;break;case"ground":zR(i,e);break;default:break}}),e.userData.center=n,e.name=t.floor,e.userData.data=t,e}getFloorContentLayer(t,e){return Tt(this,null,function*(){e||(e=new $a(this.bmap.context)),e.userData.graphics=[],e.userData.graphicMap=new Map;let n=Date.now();for(let i=0;i<t.layers.length;i++){let o=t.layers[i];["range","ground"].includes(o.l_type)||(o8(o,e,this.options),console.log("time",Date.now()-n,o.l_type),n=Date.now())}return e})}getFloorPoi(t,e,n){return Tt(this,null,function*(){n===void 0&&(n=this.placeConfig);let i=Date.now();yield Promise.all(t.layers.map(a=>s8(a,e,this.locale,n))),console.log("poi time",Date.now()-i);let o=Date.now();y1().then(()=>{console.log("poi render time",Date.now()-o)})})}clear(){return Tt(this,null,function*(){BX(),this.db=null})}closeWorker(){this.loadWorker&&(this.loadWorker.terminate(),this.loadWorker=null)}dispose(){super.dispose(),this.clear(),this.closeWorker(),this.getFloorDataPromise.clear()}constructor(t,e={}){super(),this.bmap=t,this.floors=[],this.initDbPromise=Promise.resolve(),this.db=null,this.taskQueue=new ep,this.loadWorker=GR(),this.locale="zh-cn",this.placeConfig={backgroundColor:"#f1f7f6",showFacilityName:!0,showStoreName:!0,textFontSize:14},this.getFloorDataPromise=new Map,this.options=te({},tMt,e),this.placeConfig=te({},this.placeConfig,t.config.loaderPlaceConfig),this.initDbPromise=this.initDb()}};var Hoe=H(ze(),1);function kR(r,t){return Tt(this,null,function*(){let{brand:e,project:n}=r,{apiDomain:i,apiPath:{floorRange:o},apiInfo:a}=t,l=""+i+o+"?brand="+e+"&project="+n+"&phase="+n+"&building="+n;return yield fetch(l,a).then(f=>f.json()).then(f=>f.data).then(f=>{let g=(f||[])[0];return g&&(g.info=JSON.parse(g.info)),g})})}function VR(r,t){return Tt(this,null,function*(){let{brand:e,project:n,floor:i,ts:o,resource_type_list:a}=r,{apiDomain:l,apiPath:{floorGraphic:c},apiInfo:f}=t,g=""+l+c+"?brand="+e+"&project="+n+"&phase="+n+"&building="+n+"&floor="+i+"&ts="+o+"&resource_type_list="+a;return yield fetch(g,f).then(v=>v.json()).then(v=>v.data).then(v=>((v||[]).map(x=>x.info=JSON.parse(x.info)),v||[]))})}function eMt(r,t){return Tt(this,null,function*(){let{project:e,floor:n}=r,{apiDomain:i,apiInfo:o}=t,a=i+"/api/inception-map/external_street/get?projectCode="+e+"&floorCode="+n;return yield fetch(a,o).then(c=>c.json()).then(c=>c.data).then(c=>JSON.parse(c[0].streetInfo||"{}")).then(c=>c.fileId?nMt(c.fileId,t):null)})}function nMt(r,t){return Tt(this,null,function*(){let{apiDomain:e,apiInfo:n}=t;return fetch(e+"/api/inception-map/file/getFileStream?fileId="+r,n).then(i=>i.arrayBuffer()).then(i=>{let a=new TextDecoder("utf-8").decode(i);return a?JSON.parse(a):null})})}var HR=class{load(t){return Tt(this,null,function*(){let e=$f(t);if(this.cacheData.has(e))return this.cacheData.get(e);let[,n]=yield Promise.all([this.loadBuildGround(t),VR(t,this.bmap.config)]),i=$f({floor:t.floor,ts:t.ts});Av(n.map(a=>a.info),this.bmap.buildingCenter,this.floorDataLengthMap.get(i)||0),n.forEach(a=>a.info.transformToBuildingGround=!1),this.cacheData.set(e,n);let o=this.floorDataLengthMap.get(i)||0;return this.floorDataLengthMap.set(i,o+n.length),this.loadExternalStreet(t),n})}loadExternalStreet(t){return Tt(this,null,function*(){})}switchFloorByData(t,e){if(!t.length)return;let n=e.userData.legacyToGraphicMap||new Map,i=e.userData.graphicMap||new Map,{ground:o,markGraphic:a,graphic:l}=this.bmap.config;for(let c=0;c<t.length;c++){let f=t[c];f.info.group==="ground"?(f.info.fillColor=o.color,f.info.fillOpacity=o.opacity,f.info.height=o.height,f.info.stroke=o.stroke,f.info.strokeColor=o.strokeColor,f.info.strokeOpacity=o.strokeOpacity):f.info.userData.mark?(f.info.height=a.height,f.info.fillColor=a.color,f.info.fillOpacity=a.opacity,f.info.stroke=a.stroke,f.info.strokeColor=a.strokeColor,f.info.strokeOpacity=a.strokeOpacity):(f.info.fillOpacity=l.fillOpacity,this.bmap.config.initTransToMark&&(f.info.height=a.height,f.info.fillColor=a.color,f.info.stroke=a.stroke,f.info.strokeColor=a.strokeColor,f.info.strokeOpacity=a.strokeOpacity))}for(let c of t){if(c.info.group==="ground")e.createGround(c.info);else{let f=e.addGraphic(c.info);f.userData.data=c,n.set(c.legacy_id,f)}i.set(c.element_uuid,c)}e.userData.legacyToGraphicMap=n,e.userData.graphicMap=i,e.userData.rangeGraphic=this.bmap.currentBuildGround,e.userData.range=this.bmap.currentBuildGround.geometry.cds[0],e.userData.center=this.bmap.buildingCenter,e.updateBox(),e===this.bmap.context.currentFloor?(this.bmap.triggerHooks(ss.SWITCH_FLOOR_BEFORE,{curFloor:e,graphics:e.graphicLayer.children}),this.bmap.initialFloorCamera(),this.bmap.triggerHooks(ss.SWITCH_FLOOR_AFTER,{curFloor:e,graphics:e.graphicLayer.children})):this.bmap.switchFloorByFloor(e)}filterData(t,e){let n=e.userData.graphicMap||new Map;return t.filter(i=>!n.has(i.element_uuid))}switchFloorByStoreData(t,e){return Tt(this,null,function*(){let n=yield this.load(te({},t,{resource_type_list:"6"})),i=this.filterData(n,e);this.switchFloorByData(i,e)})}switchFloorByOtherData(t,e){return Tt(this,null,function*(){let n=yield this.load(te({},t,{resource_type_list:"1,2,3,4"})),i=this.filterData(n,e);this.switchFloorByData(i,e)})}loadBuildGround(t){return Tt(this,null,function*(){let{brand:e,project:n}=t,i=yield this.loadBuildingGround({brand:e,project:n});var o;return this.bmap.currentBuildGround=(o=i==null?void 0:i.info)!=null?o:null,this.bmap.changeBuildingCenter(i,{brand:e,project:n}),this.bmap.currentBuildGround})}loadBuildingGround(t){return Tt(this,null,function*(){let{brand:e,project:n}=t,i=$f({brand:e,project:n});if(this.buildingGroundMap.has(i))return this.buildingGroundMap.get(i);let o=kR({brand:e,project:n},this.bmap.config).then(a=>(this.buildingGroundMap.set(i,a),a));return this.buildingGroundMap.set(i,o),o})}switchFloor(t){return Tt(this,null,function*(){let e=new $a(this.bmap.context);e.userData.graphicMap=new Map,e.name=t.floor;try{yield Promise.all([this.switchFloorByStoreData(t,e),this.switchFloorByOtherData(t,e)])}catch(n){console.log(n)}return e})}dispose(){this.cacheData.clear(),this.floorDataLengthMap.clear(),this.buildingGroundMap.clear()}constructor(t){this.bmap=t,this.cacheData=new Map,this.floorDataLengthMap=new Map,this.buildingGroundMap=new Map,this.externalStreetMap=new Map}};var rMt=function(r){return r[r.D2=0]="D2",r[r.D3=1.1]="D3",r}({}),WR=class extends Sn{get basicZoom(){return this.context.basicZoom}set basicZoom(t){this.context.basicZoom=t}changeBuildingCenter(t,e){let{brand:n,project:i}=e,o=t?yv(t.info.geometry.cds[0]):[0,0];this.buildingCenter=o,this.dispatchEvent({type:"center-change",center:o,project:i,brand:n})}use(t){t.bmap=this,this.plugins.push(t)}unUse(t){this.plugins=this.plugins.filter(e=>e!==t)}triggerHooks(t,e){this.dispatchEvent({type:t,data:e})}switchFloor(t){return Tt(this,null,function*(){return this.loader||(this.loader=new fp(this),this.loader.placeConfig=te({},this.loader.placeConfig,this.config.loaderPlaceConfig),yield this.loader.load(this.config.apiPath.loadPlaceInfo+"?place_id="+this.config.placeId+"&env=prod")),this.loader.switchFloor(t)})}switchFloorByFloor(t,e,n){e===void 0&&(e=!0),n===void 0&&(n=t.graphicLayer.children),this.triggerHooks(ss.SWITCH_FLOOR_BEFORE,{curFloor:t,graphics:n}),this.buildingCenter=t.userData.center,this.currentBuildGround=t.userData.rangeGraphic,this.context.switchFloor(t,e),this.initialFloorCamera(),this.triggerHooks(ss.SWITCH_FLOOR_AFTER,{curFloor:t,graphics:n})}initialFloorCamera(){this.context.cameraBound.setEnable(!1),this.context.control.minZoom=0,this.context.control.maxZoom=1/0,this.context.camera.zoom=1,this.context.setAzimuthalAngle(this.config.control.defaultAzimuthal,0),this.context.setPolarAngle(this.config.control.defaultPolar,0),this.context.fitCameraToGround(this.config.defaultPadding,0);let t=this.context.camera.zoom;this.context.control.minZoom=t,this.context.control.maxZoom=t*this.config.control.maxZoomScale,this.type==="3d"&&this.context.fitCameraToGround(this.config.defaultPadding,0,!1),this.basicZoom=this.context.camera.zoom,this.context.control.addEventListener("change",this.onControlChange),this.onControlChange(),this.context.cameraBound.setEnable(!0),this.context.cameraBound.changePrevCamera()}addModel(t,e){if(t.options.geometry.type==="polygon"){var n;let i=(n=this.context.currentFloor)==null?void 0:n.addModel(te({},e,{position:t.getPosition().setZ(.1),id:t.options.id}));if(i){let{facilityAngle:o=0,facilityXScale:a=1,facilityYScale:l=1}=t.options.userData;i.rotateZ((180-o)/180*Math.PI),i.scale.set(a,l,1)}}}addHeatmap(t){var e;return(e=this.context.currentFloor)==null?void 0:e.addHeatmap(t)}getLegacyToGraphicMap(){var t;return((t=this.context.currentFloor)==null?void 0:t.userData.legacyToGraphicMap)||new Map}getFloorAllGraphics(){var t;return((t=this.context.currentFloor)==null?void 0:t.getGraphics())||[]}createGraphicPoi(t,e){if(this.context.currentFloor){e.id===void 0&&(e.id=t.options.id);let n=t.options.center,i=t.getCenter(),o=(n==null?void 0:n[0])||i.x,a=(n==null?void 0:n[1])||i.y;return console.log(o,a,n,i),this.context.currentFloor.addPoi(te({},e,{position:{x:o,y:a,z:i.z+t.options.height/2}}))}return null}createPoi2ByPosition(t,e){if(this.context.currentFloor){let n=this.mercatorToWorld([t.x,t.y]),i=new Di(this.context,te({},e,{position:{x:n.x,y:n.y,z:t.z}}));return this.context.currentFloor.poiLayer2.pushPoi(i),i}return null}removeHeatMap(){var t;(t=this.context.currentFloor)==null||t.removeHeatMap()}translateElementToCenter(t,e,n,i){e===void 0&&(e=500),n===void 0&&(n=0),i===void 0&&(i=0);let o=t.getPosition().clone(),{context:{camera:a}}=this;if(a.updateMatrix(),i){let l=new G;l.setFromMatrixColumn(a.matrix,1),l.normalize(),l.multiplyScalar(i/a.zoom),o.add(l)}if(n){let l=new G;l.setFromMatrixColumn(a.matrix,0),l.normalize(),l.multiplyScalar(n/a.zoom),o.add(l)}return this.context.setCameraPosition(o,e)}translateElementToCenterX(t,e){return Tt(this,null,function*(){return e===void 0&&(e=500),Ya(new Promise(n=>{let i=this.context.control.target.clone(),o=t.getPosition();this.timer.requestAnimationFrame(()=>{let{clientSize:{width:a,height:l},camera:c}=this.context,g=sn(o,c,a,l).x-a/2,m=new G;m.setFromMatrixColumn(this.context.camera.matrix,0),m.normalize(),m.multiplyScalar(g/this.context.camera.zoom),i.add(m),this.context.setCameraPosition(i,e).then(n)})}),e+500)})}getElementDeviceCoordinate(t){let e=t.position.clone(),{clientWidth:n,clientHeight:i}=this.container;return sn(e,this.context.camera,n,i)}changeMapType(t,e){return e===void 0&&(e=500),this.type=t,t==="2d"?this.context.setPolarAngle(0,e):this.context.setPolarAngle(1.1,e)}resetView(t){return Tt(this,null,function*(){t===void 0&&(t=300);let e=t/3;yield this.context.setAzimuthalAngle(this.config.control.defaultAzimuthal,e),yield this.context.setPolarAngle(this.config.control.defaultPolar,e),yield this.context.fitCameraToGround(this.config.defaultPadding,e,!1)})}reduceMap(t,e){t===void 0&&(t=.5),e===void 0&&(e=500);let n=this.context.camera.zoom;return this.context.setZoom(n-t,this.context.control.target,e)}enlargeMap(t,e){t===void 0&&(t=.5),e===void 0&&(e=500);let n=this.context.camera.zoom;return this.context.setZoom(n+t,this.context.control.target,e)}registryEvent(){if(window.addEventListener("keydown",this.onKeydown),window.addEventListener("keyup",this.onKeyUp),this.config.resizeObserver){let t=new ResizeObserver(this.debounceResize);t.observe(this.container),this.observe=t}}unRegistryEvent(){var t;this.context.control.removeEventListener("change",this.onControlChange),window.removeEventListener("keydown",this.onKeydown),window.removeEventListener("keyup",this.onKeyUp),(t=this.observe)==null||t.disconnect(),this.observe=null}configurePolarShortcutKeys(t){this.polarKeys=t}configureAzimuthalShortcutKeys(t){this.azimuthalKeys=t}rotateMap(t,e){t===void 0&&(t=.1),e===void 0&&(e=500);let n=this.context.control.getAzimuthalAngle();return this.context.setAzimuthalAngle(n+t,e)}measureDistance(){return Tt(this,null,function*(){return this.cancelDistance(),new Promise((t,e)=>{this.changeMapType("2d",0),this.context.control.enableRotate=!1,this.svgLine=new p_(this.context);let n=this.svgLine.dispose.bind(this.svgLine);this.svgLine.dispose=function(){n(),e("cancel")},this.svgLine.addEventListener("distance",i=>{let{distance:o}=i;t(o)})})})}cancelDistance(){this.svgLine&&(this.svgLine.dispose(),this.svgLine=void 0,this.context.control.enableRotate=!0)}measureArea(){return this.cancelArea(),new Promise((t,e)=>{this.changeMapType("2d",0),this.context.control.enableRotate=!1,this.svgPolygon=new d_(this.context);let n=this.svgPolygon.dispose.bind(this.svgPolygon);this.svgPolygon.dispose=function(){n(),e("cancel")},this.svgPolygon.addEventListener("area",i=>{let{area:o}=i;t(o)})})}cancelArea(){this.svgPolygon&&(this.svgPolygon.dispose(),this.svgPolygon=void 0,this.context.control.enableRotate=!0)}fitCameraByPois(t,e,n){return Tt(this,null,function*(){if(e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=500),!t.length)return;let i=new Fe;return t.forEach(o=>{let{position:a}=o;i.expandByPoint(a)}),this.context.fitCameraToBox(i,e,n,!1)})}fitCameraByPoiNodeIds(t,e,n){return Tt(this,null,function*(){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=500);let i=t.map(o=>this.getPoiById(o)).filter(o=>!!o);if(i.length)return this.fitCameraByPois(i,e,n)})}getGraphicByNodeId(t){var e,n;return((e=this.context.currentFloor)==null?void 0:e.graphicLayer.getGraphicByNodeId(t))||((n=this.context.currentFloor)==null?void 0:n.parkingSpaceLayer.graphicMap.get(t))||null}deleteGraphic(t){var e;(e=this.context.currentFloor)==null||e.graphicLayer.removeGraphic(t)}createGraphicByOptions(t){var e;if(!t.transformToBuildingGround&&this.currentBuildGround){let n=yv(this.currentBuildGround.geometry.cds[0]);if(t.geometry.type==="polygon")t.geometry.coords=JSON.parse(JSON.stringify(t.geometry.cds)),t.geometry.coords.map(i=>{Array.isArray(i)&&i.forEach(o=>{o[0]-=n[0],o[1]-=n[1]})});else{let[i,o]=t.geometry.cds;t.geometry.coords=[i-n[0],o-n[1]]}}return(e=this.context.currentFloor)==null?void 0:e.graphicLayer.createGraphic(t)}mercatorToWorld(t){let e=this.buildingCenter;return new G(t[0]-e[0],t[1]-e[1],0)}removePoiById(t){var e,n;(e=this.context.currentFloor)==null||e.poiLayer.removePoiById(t),(n=this.context.currentFloor)==null||n.poiLayer2.removePoiById(t)}getPoiById(t){var e,n;return((e=this.context.currentFloor)==null?void 0:e.poiLayer.getPoiById(t))||((n=this.context.currentFloor)==null?void 0:n.poiLayer2.getPoiById(t))}getPois(){var t,e;return[...(((t=this.context.currentFloor)==null?void 0:t.poiLayer.pois)||[]).filter(n=>!n.options.built_in),...((e=this.context.currentFloor)==null?void 0:e.poiLayer2.pois)||[]]}clearPoi(){this.context.currentFloor&&this.context.currentFloor.poiLayer.clear()}removeSelectGraphic(t){this.context.selection.remove(t)}dispose(){this.loader&&(this.loader.dispose(),this.loader=null),this.unRegistryEvent(),this.timer.dispose(),this.plugins.forEach(t=>t.dispose()),this.plugins=[],this.context.dispose(),this.context=null,this.container=null,Oi.dispose(),Mo.dispose(),Sh.dispose(),Ms.dispose(),hn.dispose(),v0.dispose(),this.debounceResize=null,Ha.Dispose==null||Ha.Dispose.call(Ha)}constructor(t,e={}){super(),this.container=t,this.polarKeys=[],this.azimuthalKeys=[],this.prevCameraZoom=1,this.type="2d",this.currentBuildGround=null,this.observe=null,this.buildingCenter=[0,0],this.timer=new ui,this.plugins=[],this.loader=null,this.onControlChange=()=>{let{camera:{zoom:n}}=this.context;n!==this.prevCameraZoom&&(this.dispatchEvent({type:"zoom-change",basicZoom:this.basicZoom,cameraZoom:this.context.camera.zoom}),this.prevCameraZoom=n)},this.onKeydown=n=>{this.polarKeys.includes(n.code)&&(this.context.control.maxPolarAngle=this.config.control.maxPolar,this.context.control.minPolarAngle=0),this.azimuthalKeys.includes(n.code)&&(this.context.control.maxAzimuthAngle=1/0,this.context.control.minAzimuthAngle=1/0)},this.onKeyUp=n=>{if(this.polarKeys.includes(n.code)){let i=this.context.control.getPolarAngle();this.context.control.maxPolarAngle=i,this.context.control.minPolarAngle=i}if(this.azimuthalKeys.includes(n.code)){let i=this.context.control.getAzimuthalAngle();this.context.control.maxAzimuthAngle=i,this.context.control.minAzimuthAngle=i}},this.resize=()=>{this.context.cameraBound.setEnable(!1),this.context.onWindowResize();let n=this.context.control.getAzimuthalAngle(),i=this.context.camera.zoom;this.context.control.minZoom=0,this.context.control.maxZoom=1/0,this.context.camera.zoom=1,this.context.setAzimuthalAngle(0,0);let o=this.context.getFitCameraToGroundZoom(this.config.defaultPadding,0)||1;this.context.camera.zoom=i,this.context.control.minZoom=o,this.context.control.maxZoom=o*this.config.control.maxZoomScale,this.basicZoom=i,this.context.control.addEventListener("change",this.onControlChange),this.context.setAzimuthalAngle(n,0),this.context.cameraBound.setEnable(!0)},this.config=FR(e),this.context=new S_(t,this),this.debounceResize=(0,a8.debounce)(this.resize,5),this.registryEvent()}};var iMt=function(r){return r.HALF="half",r.POWER="power",r.MECHANICAL="mechanical",r.NORMAL="normal",r.VIP="vip",r}({});var fse=H(ze(),1);var lo=class extends Zi{dispose(){let t=this.bmap.plugins.findIndex(e=>e===this);t!==-1&&this.bmap.plugins.splice(t,1),this.bmap=null,super.dispose()}constructor(t){super(),this.bmap=t,this.bmap.use(this)}};var qR=class extends lo{fetchEquipment(){return Tt(this,null,function*(){let{apiDomain:t,apiPath:{equipmentList:e},apiInfo:n}=this.bmap.config,i=""+t+e;yield fetch(i,n).then(o=>o.json()).then(o=>o.data).then(o=>{this.equipmentList=o,this.equipmentMap=new Map(o.map(a=>[a.equipment_id,a]))}),this.dispatchEvent({type:"change-equipment-list",data:this.equipmentList}),this.bmap.context.currentFloor&&this.changeGraphicToEquipment(this.bmap.context.currentFloor.graphicLayer.children)})}getGraphicEquipment(t){return t.userData.data.info.userData.equipment}changeGraphicToEquipment(t){t.filter(e=>{let n=this.getGraphicEquipment(e);return n&&this.equipmentMap.has(n)}).forEach(e=>{let n=this.equipmentMap.get(this.getGraphicEquipment(e)),i=this.bmap.createGraphicPoi(e,{icon:n==null?void 0:n.equipment_icon,built_in:!0,icon_size:[14,14]});i&&(i.userData.data=n,i.userData.type="equipment")})}dispose(){var t;this.bmap.removeEventListener(ss.SWITCH_FLOOR_AFTER,this.onSwitchFloor),Array.from(((t=this.bmap.context.currentFloor)==null?void 0:t.poiLayer.pois)||[]).forEach(e=>{if(e.userData.type==="equipment"){var n;(n=this.bmap.context.currentFloor)==null||n.poiLayer.removePoi(e)}}),super.dispose()}constructor(t){super(t),this.equipmentList=[],this.equipmentMap=new Map,this.onSwitchFloor=e=>{let{data:{graphics:n}}=e;this.equipmentList.length&&this.changeGraphicToEquipment(n)},this.fetchEquipment(),this.bmap.addEventListener(ss.SWITCH_FLOOR_AFTER,this.onSwitchFloor)}};var Eae=H(bv(),1),Sae=H(Xa(),1),bae=H(ze(),1),Mae=H(UR(),1);var Use=H(ze(),1),Fse=H(En(),1);var vse=H(ip(),1),_se=H(ec(),1),yse=H(nc(),1),xse=H(rc(),1),Ese=H(ic(),1),Sse=H(oc(),1),bse=H(sc(),1),Mse=H(ac(),1),wse=H(uc(),1),Tse=H(lc(),1),Ase=H(cc(),1),Cse=H(hc(),1),Rse=H(fc(),1),Pse=H(pc(),1),Ise=H(dc(),1),Lse=H(En(),1),Nse=H(MR(),1);var Qa=class extends qe{constructor(){super(),this.isMeshLine=!0,this.type="MeshLine",this.positions=[],this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[],this.counters=[],this._points=[],this._geom=null,this.widthCallback=null,this.matrixWorld=new Ie,Object.defineProperties(this,{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(t){this.setPoints(t,this.widthCallback)}}})}};Qa.prototype.setMatrixWorld=function(r){this.matrixWorld=r};Qa.prototype.setGeometry=function(r,t){this._geometry=r,this.setPoints(r.getAttribute("position").array,t)};Qa.prototype.setPoints=function(r,t){if(!(r instanceof Float32Array)&&!(r instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=r,this.widthCallback=t,this.positions=[],this.counters=[],r.length&&r[0]instanceof G)for(var e=0;e<r.length;e++){var n=r[e],i=e/r.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(i),this.counters.push(i)}else for(var e=0;e<r.length;e+=3){var i=e/r.length;this.positions.push(r[e],r[e+1],r[e+2]),this.positions.push(r[e],r[e+1],r[e+2]),this.counters.push(i),this.counters.push(i)}this.process()};function oMt(r,t){var e=new Ie,n=new da,i=new ai,o=new G,a=this.geometry;if(a.boundingSphere||a.computeBoundingSphere(),i.copy(a.boundingSphere),i.applyMatrix4(this.matrixWorld),r.ray.intersectSphere(i,o)!==!1){e.copy(this.matrixWorld).invert(),n.copy(r.ray).applyMatrix4(e);var l=new G,c=new G,f=new G,g=this instanceof Yi?2:1,m=a.index,v=a.attributes;if(m!==null)for(var x=m.array,S=v.position.array,w=v.width.array,E=0,b=x.length-1;E<b;E+=g){var C=x[E],A=x[E+1];l.fromArray(S,C*3),c.fromArray(S,A*3);var P=w[Math.floor(E/3)]!==void 0?w[Math.floor(E/3)]:1,U=r.params.Line.threshold+this.material.lineWidth*P/2,F=U*U,D=n.distanceSqToSegment(l,c,o,f);if(!(D>F)){o.applyMatrix4(this.matrixWorld);var L=r.ray.origin.distanceTo(o);L<r.near||L>r.far||(t.push({distance:L,point:f.clone().applyMatrix4(this.matrixWorld),index:E,face:null,faceIndex:null,object:this}),E=b)}}}}Qa.prototype.raycast=oMt;Qa.prototype.compareV3=function(r,t){var e=r*6,n=t*6;return this.positions[e]===this.positions[n]&&this.positions[e+1]===this.positions[n+1]&&this.positions[e+2]===this.positions[n+2]};Qa.prototype.copyV3=function(r){var t=r*6;return[this.positions[t],this.positions[t+1],this.positions[t+2]]};Qa.prototype.getDistance=function(r){let t=0;for(let e=0;e<r;e++){let n=6*e,i=new G(this.positions[n],this.positions[n+1],this.positions[n+2]),o=new G(this.positions[n+6],this.positions[n+7],this.positions[n+8]),a=i.distanceTo(o);t+=a}return t};Qa.prototype.process=function(){var r=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var t;let e=this.getDistance(r-1);var n;this.compareV3(0,r-1)?n=this.copyV3(r-2):n=this.copyV3(0),this.previous.push(n[0],n[1],n[2]),this.previous.push(n[0],n[1],n[2]);for(var i=0;i<r;i++){if(this.side.push(1),this.side.push(-1),this.widthCallback?t=this.widthCallback(i/(r-1)):t=1,this.width.push(t),this.width.push(t),i===0)this.uvs.push(0,0),this.uvs.push(0,1);else if(i===r-1)this.uvs.push(1,0),this.uvs.push(1,1);else{let a=this.getDistance(i)/e;this.uvs.push(a,0),this.uvs.push(a,1)}if(i<r-1){n=this.copyV3(i),this.previous.push(n[0],n[1],n[2]),this.previous.push(n[0],n[1],n[2]);var o=i*2;this.indices_array.push(o,o+1,o+2),this.indices_array.push(o+2,o+1,o+3)}i>0&&(n=this.copyV3(i),this.next.push(n[0],n[1],n[2]),this.next.push(n[0],n[1],n[2]))}this.compareV3(r-1,0)?n=this.copyV3(1):n=this.copyV3(r-1),this.next.push(n[0],n[1],n[2]),this.next.push(n[0],n[1],n[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new He(new Float32Array(this.positions),3),previous:new He(new Float32Array(this.previous),3),next:new He(new Float32Array(this.next),3),side:new He(new Float32Array(this.side),1),width:new He(new Float32Array(this.width),1),uv:new He(new Float32Array(this.uvs),2),index:new He(new Uint16Array(this.indices_array),1),counters:new He(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function XR(r,t,e,n,i){var o;if(r=r.subarray||r.slice?r:r.buffer,e=e.subarray||e.slice?e:e.buffer,r=t?r.subarray?r.subarray(t,i&&t+i):r.slice(t,i&&t+i):r,e.set)e.set(r,n);else for(o=0;o<r.length;o++)e[o+n]=r[o];return e}Qa.prototype.advance=function(r){var t=this._attributes.position.array,e=this._attributes.previous.array,n=this._attributes.next.array,i=t.length;XR(t,0,e,0,i),XR(t,6,t,0,i-6),t[i-6]=r.x,t[i-5]=r.y,t[i-4]=r.z,t[i-3]=r.x,t[i-2]=r.y,t[i-1]=r.z,XR(t,6,n,0,i-6),n[i-6]=r.x,n[i-5]=r.y,n[i-4]=r.z,n[i-3]=r.x,n[i-2]=r.y,n[i-1]=r.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0};ke.meshline_vert=["",ke.logdepthbuf_pars_vertex,ke.fog_pars_vertex,"","attribute vec3 previous;","attribute vec3 next;","attribute float side;","attribute float width;","attribute float counters;","","uniform vec2 resolution;","uniform float lineWidth;","uniform vec3 color;","uniform float opacity;","uniform float sizeAttenuation;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","vec2 fix( vec4 i, float aspect ) {",""," vec2 res = i.xy / i.w;"," res.x *= aspect;"," vCounters = counters;"," return res;","","}","","void main() {",""," float aspect = resolution.x / resolution.y;",""," vColor = vec4( color, opacity );"," vUV = uv;",""," mat4 m = projectionMatrix * modelViewMatrix;"," vec4 finalPosition = m * vec4( position, 1.0 );"," vec4 prevPos = m * vec4( previous, 1.0 );"," vec4 nextPos = m * vec4( next, 1.0 );",""," vec2 currentP = fix( finalPosition, aspect );"," vec2 prevP = fix( prevPos, aspect );"," vec2 nextP = fix( nextPos, aspect );",""," float w = lineWidth * width;",""," vec2 dir;"," if( nextP == currentP ) dir = normalize( currentP - prevP );"," else if( prevP == currentP ) dir = normalize( nextP - currentP );"," else {"," vec2 dir1 = normalize( currentP - prevP );"," vec2 dir2 = normalize( nextP - currentP );"," dir = normalize( dir1 + dir2 );",""," vec2 perp = vec2( -dir1.y, dir1.x );"," vec2 miter = vec2( -dir.y, dir.x );"," //w = clamp( w / dot( miter, perp ), 0., 4. * lineWidth * width );",""," }",""," //vec2 normal = ( cross( vec3( dir, 0. ), vec3( 0., 0., 1. ) ) ).xy;"," vec4 normal = vec4( -dir.y, dir.x, 0., 1. );"," normal.xy *= .5 * w;"," normal *= projectionMatrix;"," if( sizeAttenuation == 0. ) {"," normal.xy *= finalPosition.w;"," normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;"," }",""," finalPosition.xy += normal.xy * side;",""," gl_Position = finalPosition;","",ke.logdepthbuf_vertex,ke.fog_vertex&&" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",ke.fog_vertex,"}"].join(`
16010
+ `],{type:"text/javascript"}),t=URL.createObjectURL(r),e=new Worker(t);return URL.revokeObjectURL(t),e}var tMt={mergeParkingSpace:!0,mergeGraphic:!0,renderVersion:vg.MERGED_RENDER_VERSION,layers:["graph","wall","lane","texture2d","texture3d","glb","store","facility","parkingSpace","text"],filterPoi:()=>!0},fp=class extends Zi{initDb(){return Tt(this,null,function*(){try{let{db:t}=yield n6();this.db=t}catch(t){console.log("[\u6253\u5F00indexDb\u9519\u8BEF]",t)}})}load(t,e){return Tt(this,null,function*(){if(Array.isArray(t))this.floors=t,e&&(this.placeConfig=te({},this.placeConfig,e));else if(typeof t=="string"){let n=yield fetch(t).then(i=>i.json());n.code===200&&(this.floors=n.data.list,this.placeConfig=te({},this.placeConfig,JSON.parse(n.data.config||"{}")))}else return this.load("https://screen.aibee.cn/ai-map/map/get-floor-map?place_id="+t);this.getOtherDataByFreeTime()})}setCacheData(t,e,n){return Tt(this,null,function*(){return this.initDbPromise.then(()=>r6(t,""+e,n))})}getCacheData(t,e){return Tt(this,null,function*(){return this.initDbPromise.then(()=>Wv(t,""+e))})}getFloorData(t){return Tt(this,null,function*(){let e=yield this.getFloorJsonData(t);return e?this.getDataByJson(e):null})}getFloorDataByFloorInfo(t){return Tt(this,null,function*(){let e=yield this.getFloorJsonDataByFloorInfo(t);return this.getDataByJson(e)})}setLocale(t){this.locale=t,this.bmap.context.currentFloor&&this.bmap.context.currentFloor.poiLayer2.pois.forEach(e=>{e.userData.type==="store"&&(e.options.text=V6(e.userData.data,t)),e.userData.type==="facility"&&(e.options.text=H6(e.userData.data,t))})}getFloorJsonDataByFloorInfo(t){return Tt(this,null,function*(){if(this.getFloorDataPromise.has(t.floor))return this.getFloorDataPromise.get(t.floor);let e=new Promise(n=>Tt(this,null,function*(){let i=_g(t),o=yield fetch(t.map_url).then(a=>a.json());o.floor=t.floor,b_(o),this.setCacheData(js.MAP_DATA,i,o),this.setCacheData(js.MAP_VERSION,i,t.version_id),n(o)}));return this.getFloorDataPromise.set(t.floor,e),e})}getFloorJsonData(t){return Tt(this,null,function*(){let e=this.floors.find(n=>n.floor===t);return e?new Promise(n=>Tt(this,null,function*(){let i=_g(e,this.options.renderVersion===vg.LAYERED_RENDER_VERSION?1:void 0);try{let o=_g(e),a=yield this.getCacheData(js.MAP_DATA,o);if(a&&a.transformed){console.log("\u4ECE\u7F13\u5B58\u4E2D\u53D6\u5230\u4E86\u5408\u5E76\u540E\u7684\u6570\u636E"),n(a);return}if(this.options.renderVersion===vg.LAYERED_RENDER_VERSION){let l=yield this.getCacheData(js.MAP_DATA,i);if(l){console.log("\u4ECE\u7F13\u5B58\u4E2D\u53D6\u5230\u4E86\u6570\u636E"),n(l);return}}if(console.log("\u7F13\u5B58\u4E2D\u6CA1\u6709\u6570\u636E"),this.loadWorker){fi(this.loadWorker,"adjust_floor_priority",{floor:t});let l=c=>{if(c.data.type==="floor_success"&&c.data.data.floor===t){var f;(f=this.loadWorker)==null||f.removeEventListener("message",l),n(this.getFloorJsonData(t))}};this.loadWorker.addEventListener("message",l)}else n(this.getFloorJsonDataByFloorInfo(e))}catch(o){console.log("[get floor data error]",o),n(this.getFloorJsonDataByFloorInfo(e))}})):null})}getRoadNetworkData(){return Tt(this,null,function*(){return(yield Promise.all(this.floors.map(e=>Tt(this,null,function*(){let n=_g(e,0);try{let i=yield this.getCacheData(js.ROAD_NETWORK_DATA,n);if(i)return i;let o=yield fetch(e.route_url).then(a=>a.json());return this.setCacheData(js.ROAD_NETWORK_DATA,n,o),this.setCacheData(js.ROUTE_VERSION,n,e.version_id),o}catch(i){let o=yield fetch(e.route_url).then(a=>a.json());return this.setCacheData(js.ROAD_NETWORK_DATA,n,o),o}})))).filter(e=>e.points)})}getFacilitiesData(){return Tt(this,null,function*(){let t=this.floors.reduce((i,o)=>i.updated_at>o.updated_at?i:o,this.floors[0]);if(!t)return null;let e=_g(t,0),n=()=>Tt(this,null,function*(){let i=yield fetch(t.entry_infra_url).then(o=>o.json());return i&&(this.setCacheData(js.FACILITY_DATA,e,i),this.setCacheData(js.FACILITY_VERSION,e,t.version_id)),i});try{let i=yield this.getCacheData(js.FACILITY_DATA,e);return i||n()}catch(i){return console.log("[get facility error]",i),n()}})}getOtherDataByFreeTime(){return Tt(this,null,function*(){yield this.initDbPromise,yield fi(this.loadWorker,"load",{floors:this.floors,version:this.options.renderVersion}),this.closeWorker()})}getMulFloorsData(t){return Tt(this,null,function*(){return Promise.all(t.map(e=>this.getFloorData(e))).then(e=>e.filter(n=>n))})}getDataByUrl(t){return Tt(this,null,function*(){let e=yield fetch(t).then(n=>n.json());return this.getDataByJson(e)})}getDataByJson(t,e,n){return Tt(this,null,function*(){b_(t),e=this.getFloorBaseLayer(t,e);let i=te({},this.placeConfig,n);return yield this.getFloorContentLayer(t,e),yield this.getFloorPoi(t,e,i),this.changeFloorBox(t,e),e})}getDataByJsonStep(t,e,n){return Tt(this,null,function*(){b_(t),e=this.getFloorBaseLayer(t,e);let i=te({},this.placeConfig,n);return this.changeFloorBox(t,e),requestAnimationFrame(()=>Tt(this,null,function*(){yield this.getFloorContentLayer(t,e),this.changeFloorBox(t,e),requestAnimationFrame(()=>Tt(this,null,function*(){yield this.getFloorPoi(t,e,i),this.changeFloorBox(t,e)}))})),e})}changeFloorBox(t,e){e.updateBox();let n=e.box.getSize(new G),i=Math.max(n.x,n.y,n.z);e.userData.height=i/4+t.floorHeight}switchFloor(t,e){return Tt(this,null,function*(){return new Promise(n=>{let i={run:()=>this._switchFloor(t,e),meta:{type:"switchFloor"}},o=this.taskQueue.replaceByMetaType(i),a=l=>{let{task:c,res:f}=l;c.tid===o&&(this.taskQueue.removeEventListener("active-task-end",a),n(f))};this.taskQueue.addEventListener("active-task-end",a)})})}_switchFloor(t,e){return Tt(this,null,function*(){var n;let i=t;if(typeof t=="string"){let g=yield this.getFloorJsonData(t);if(g)i=g;else return null}else b_(t);let o=te({},this.placeConfig,e),a=new $a(this.bmap.context);a.userData.data=t;let l=this.floors.find(g=>g.floor===i.floor);var c;let f=(c=l==null?void 0:l.map_angle)!=null?c:0;return this.bmap.dispatchEvent({type:ss.SWITCH_FLOOR_BEFORE,data:{curFloor:a,graphics:[]}}),this.dispatchEvent({type:"switch-floor-before",data:{curFloor:a,graphics:[],floorData:i}}),this.bmap.context.scene.background=new ne(o.backgroundColor),this.getFloorBaseLayer(i,a),this.changeFloorBox(i,a),this.bmap.buildingCenter=a.userData.center,this.bmap.currentBuildGround=(n=a.userData.data.layers.find(g=>g.l_type==="range"))==null?void 0:n.elements[0],this.bmap.context.switchFloor(a),this.bmap.initialFloorCamera(),this.bmap.context.control.setAzimuthalAngle(f/180*Math.PI,!0),this.bmap.context.cameraBound.updateBox(),this.dispatchEvent({type:"switch-floor-ground",data:{curFloor:a,graphics:[]}}),this.bmap.dispatchEvent({type:ss.SWITCH_FLOOR_GROUND,data:{curFloor:a}}),yield y1(),yield this.getFloorContentLayer(i,a),this.changeFloorBox(i,a),this.bmap.context.cameraBound.updateBox(),this.dispatchEvent({type:"switch-floor-content",data:{curFloor:a,graphics:[]}}),yield ET(2),yield this.getFloorPoi(i,a,o),this.dispatchEvent({type:"switch-floor-after",data:{curFloor:a,graphics:a.graphicLayer.children}}),this.bmap.dispatchEvent({type:ss.SWITCH_FLOOR_AFTER,data:{curFloor:a,graphics:a.graphicLayer.children}}),a})}getFloorBaseLayer(t,e){e||(e=new $a(this.bmap.context));let n=[0,0];return t.layers.forEach(i=>{switch(i.l_type){case"range":let o=i.elements[0];n=[o.center_x,o.center_y],e.userData.range=o.geometry.cds[0],e.userData.rangeGraphic=o;break;case"ground":zR(i,e);break;default:break}}),e.userData.center=n,e.name=t.floor,e.userData.data=t,e}getFloorContentLayer(t,e){return Tt(this,null,function*(){e||(e=new $a(this.bmap.context)),e.userData.graphics=[],e.userData.graphicMap=new Map;let n=Date.now();for(let i=0;i<t.layers.length;i++){let o=t.layers[i];["range","ground"].includes(o.l_type)||this.options.layers.includes(o.l_type)&&(o8(o,e,this.options),console.log("time",Date.now()-n,o.l_type),n=Date.now())}return e})}getFloorPoi(t,e,n){return Tt(this,null,function*(){n===void 0&&(n=this.placeConfig);let i=Date.now();yield Promise.all(t.layers.map(a=>{if(this.options.layers.includes(a.l_type))return s8(a,e,this.locale,n,this.options)})),console.log("poi time",Date.now()-i);let o=Date.now();y1().then(()=>{console.log("poi render time",Date.now()-o)})})}clear(){return Tt(this,null,function*(){BX(),this.db=null})}closeWorker(){this.loadWorker&&(this.loadWorker.terminate(),this.loadWorker=null)}dispose(){super.dispose(),this.clear(),this.closeWorker(),this.getFloorDataPromise.clear()}constructor(t,e={}){super(),this.bmap=t,this.floors=[],this.initDbPromise=Promise.resolve(),this.db=null,this.taskQueue=new ep,this.loadWorker=GR(),this.locale="zh-cn",this.placeConfig={backgroundColor:"#f1f7f6",showFacilityName:!0,showStoreName:!0,textFontSize:14},this.getFloorDataPromise=new Map,this.options=te({},tMt,e),this.placeConfig=te({},this.placeConfig,t.config.loaderPlaceConfig),this.initDbPromise=this.initDb()}};var Hoe=H(ze(),1);function kR(r,t){return Tt(this,null,function*(){let{brand:e,project:n}=r,{apiDomain:i,apiPath:{floorRange:o},apiInfo:a}=t,l=""+i+o+"?brand="+e+"&project="+n+"&phase="+n+"&building="+n;return yield fetch(l,a).then(f=>f.json()).then(f=>f.data).then(f=>{let g=(f||[])[0];return g&&(g.info=JSON.parse(g.info)),g})})}function VR(r,t){return Tt(this,null,function*(){let{brand:e,project:n,floor:i,ts:o,resource_type_list:a}=r,{apiDomain:l,apiPath:{floorGraphic:c},apiInfo:f}=t,g=""+l+c+"?brand="+e+"&project="+n+"&phase="+n+"&building="+n+"&floor="+i+"&ts="+o+"&resource_type_list="+a;return yield fetch(g,f).then(v=>v.json()).then(v=>v.data).then(v=>((v||[]).map(x=>x.info=JSON.parse(x.info)),v||[]))})}function eMt(r,t){return Tt(this,null,function*(){let{project:e,floor:n}=r,{apiDomain:i,apiInfo:o}=t,a=i+"/api/inception-map/external_street/get?projectCode="+e+"&floorCode="+n;return yield fetch(a,o).then(c=>c.json()).then(c=>c.data).then(c=>JSON.parse(c[0].streetInfo||"{}")).then(c=>c.fileId?nMt(c.fileId,t):null)})}function nMt(r,t){return Tt(this,null,function*(){let{apiDomain:e,apiInfo:n}=t;return fetch(e+"/api/inception-map/file/getFileStream?fileId="+r,n).then(i=>i.arrayBuffer()).then(i=>{let a=new TextDecoder("utf-8").decode(i);return a?JSON.parse(a):null})})}var HR=class{load(t){return Tt(this,null,function*(){let e=$f(t);if(this.cacheData.has(e))return this.cacheData.get(e);let[,n]=yield Promise.all([this.loadBuildGround(t),VR(t,this.bmap.config)]),i=$f({floor:t.floor,ts:t.ts});Av(n.map(a=>a.info),this.bmap.buildingCenter,this.floorDataLengthMap.get(i)||0),n.forEach(a=>a.info.transformToBuildingGround=!1),this.cacheData.set(e,n);let o=this.floorDataLengthMap.get(i)||0;return this.floorDataLengthMap.set(i,o+n.length),this.loadExternalStreet(t),n})}loadExternalStreet(t){return Tt(this,null,function*(){})}switchFloorByData(t,e){if(!t.length)return;let n=e.userData.legacyToGraphicMap||new Map,i=e.userData.graphicMap||new Map,{ground:o,markGraphic:a,graphic:l}=this.bmap.config;for(let c=0;c<t.length;c++){let f=t[c];f.info.group==="ground"?(f.info.fillColor=o.color,f.info.fillOpacity=o.opacity,f.info.height=o.height,f.info.stroke=o.stroke,f.info.strokeColor=o.strokeColor,f.info.strokeOpacity=o.strokeOpacity):f.info.userData.mark?(f.info.height=a.height,f.info.fillColor=a.color,f.info.fillOpacity=a.opacity,f.info.stroke=a.stroke,f.info.strokeColor=a.strokeColor,f.info.strokeOpacity=a.strokeOpacity):(f.info.fillOpacity=l.fillOpacity,this.bmap.config.initTransToMark&&(f.info.height=a.height,f.info.fillColor=a.color,f.info.stroke=a.stroke,f.info.strokeColor=a.strokeColor,f.info.strokeOpacity=a.strokeOpacity))}for(let c of t){if(c.info.group==="ground")e.createGround(c.info);else{let f=e.addGraphic(c.info);f.userData.data=c,n.set(c.legacy_id,f)}i.set(c.element_uuid,c)}e.userData.legacyToGraphicMap=n,e.userData.graphicMap=i,e.userData.rangeGraphic=this.bmap.currentBuildGround,e.userData.range=this.bmap.currentBuildGround.geometry.cds[0],e.userData.center=this.bmap.buildingCenter,e.updateBox(),e===this.bmap.context.currentFloor?(this.bmap.triggerHooks(ss.SWITCH_FLOOR_BEFORE,{curFloor:e,graphics:e.graphicLayer.children}),this.bmap.initialFloorCamera(),this.bmap.triggerHooks(ss.SWITCH_FLOOR_AFTER,{curFloor:e,graphics:e.graphicLayer.children})):this.bmap.switchFloorByFloor(e)}filterData(t,e){let n=e.userData.graphicMap||new Map;return t.filter(i=>!n.has(i.element_uuid))}switchFloorByStoreData(t,e){return Tt(this,null,function*(){let n=yield this.load(te({},t,{resource_type_list:"6"})),i=this.filterData(n,e);this.switchFloorByData(i,e)})}switchFloorByOtherData(t,e){return Tt(this,null,function*(){let n=yield this.load(te({},t,{resource_type_list:"1,2,3,4"})),i=this.filterData(n,e);this.switchFloorByData(i,e)})}loadBuildGround(t){return Tt(this,null,function*(){let{brand:e,project:n}=t,i=yield this.loadBuildingGround({brand:e,project:n});var o;return this.bmap.currentBuildGround=(o=i==null?void 0:i.info)!=null?o:null,this.bmap.changeBuildingCenter(i,{brand:e,project:n}),this.bmap.currentBuildGround})}loadBuildingGround(t){return Tt(this,null,function*(){let{brand:e,project:n}=t,i=$f({brand:e,project:n});if(this.buildingGroundMap.has(i))return this.buildingGroundMap.get(i);let o=kR({brand:e,project:n},this.bmap.config).then(a=>(this.buildingGroundMap.set(i,a),a));return this.buildingGroundMap.set(i,o),o})}switchFloor(t){return Tt(this,null,function*(){let e=new $a(this.bmap.context);e.userData.graphicMap=new Map,e.name=t.floor;try{yield Promise.all([this.switchFloorByStoreData(t,e),this.switchFloorByOtherData(t,e)])}catch(n){console.log(n)}return e})}dispose(){this.cacheData.clear(),this.floorDataLengthMap.clear(),this.buildingGroundMap.clear()}constructor(t){this.bmap=t,this.cacheData=new Map,this.floorDataLengthMap=new Map,this.buildingGroundMap=new Map,this.externalStreetMap=new Map}};var rMt=function(r){return r[r.D2=0]="D2",r[r.D3=1.1]="D3",r}({}),WR=class extends Sn{get basicZoom(){return this.context.basicZoom}set basicZoom(t){this.context.basicZoom=t}changeBuildingCenter(t,e){let{brand:n,project:i}=e,o=t?yv(t.info.geometry.cds[0]):[0,0];this.buildingCenter=o,this.dispatchEvent({type:"center-change",center:o,project:i,brand:n})}use(t){t.bmap=this,this.plugins.push(t)}unUse(t){this.plugins=this.plugins.filter(e=>e!==t)}triggerHooks(t,e){this.dispatchEvent({type:t,data:e})}switchFloor(t){return Tt(this,null,function*(){return this.loader||(this.loader=new fp(this),this.loader.placeConfig=te({},this.loader.placeConfig,this.config.loaderPlaceConfig),yield this.loader.load(this.config.apiPath.loadPlaceInfo+"?place_id="+this.config.placeId+"&env=prod")),this.loader.switchFloor(t)})}switchFloorByFloor(t,e,n){e===void 0&&(e=!0),n===void 0&&(n=t.graphicLayer.children),this.triggerHooks(ss.SWITCH_FLOOR_BEFORE,{curFloor:t,graphics:n}),this.buildingCenter=t.userData.center,this.currentBuildGround=t.userData.rangeGraphic,this.context.switchFloor(t,e),this.initialFloorCamera(),this.triggerHooks(ss.SWITCH_FLOOR_AFTER,{curFloor:t,graphics:n})}initialFloorCamera(){this.context.cameraBound.setEnable(!1),this.context.control.minZoom=0,this.context.control.maxZoom=1/0,this.context.camera.zoom=1,this.context.setAzimuthalAngle(this.config.control.defaultAzimuthal,0),this.context.setPolarAngle(this.config.control.defaultPolar,0),this.context.fitCameraToGround(this.config.defaultPadding,0);let t=this.context.camera.zoom;this.context.control.minZoom=t,this.context.control.maxZoom=t*this.config.control.maxZoomScale,this.type==="3d"&&this.context.fitCameraToGround(this.config.defaultPadding,0,!1),this.basicZoom=this.context.camera.zoom,this.context.control.addEventListener("change",this.onControlChange),this.onControlChange(),this.context.cameraBound.setEnable(!0),this.context.cameraBound.changePrevCamera()}addModel(t,e){if(t.options.geometry.type==="polygon"){var n;let i=(n=this.context.currentFloor)==null?void 0:n.addModel(te({},e,{position:t.getPosition().setZ(.1),id:t.options.id}));if(i){let{facilityAngle:o=0,facilityXScale:a=1,facilityYScale:l=1}=t.options.userData;i.rotateZ((180-o)/180*Math.PI),i.scale.set(a,l,1)}}}addHeatmap(t){var e;return(e=this.context.currentFloor)==null?void 0:e.addHeatmap(t)}getLegacyToGraphicMap(){var t;return((t=this.context.currentFloor)==null?void 0:t.userData.legacyToGraphicMap)||new Map}getFloorAllGraphics(){var t;return((t=this.context.currentFloor)==null?void 0:t.getGraphics())||[]}createGraphicPoi(t,e){if(this.context.currentFloor){e.id===void 0&&(e.id=t.options.id);let n=t.options.center,i=t.getCenter(),o=(n==null?void 0:n[0])||i.x,a=(n==null?void 0:n[1])||i.y;return console.log(o,a,n,i),this.context.currentFloor.addPoi(te({},e,{position:{x:o,y:a,z:i.z+t.options.height/2}}))}return null}createPoi2ByPosition(t,e){if(this.context.currentFloor){let n=this.mercatorToWorld([t.x,t.y]),i=new Di(this.context,te({},e,{position:{x:n.x,y:n.y,z:t.z}}));return this.context.currentFloor.poiLayer2.pushPoi(i),i}return null}removeHeatMap(){var t;(t=this.context.currentFloor)==null||t.removeHeatMap()}translateElementToCenter(t,e,n,i){e===void 0&&(e=500),n===void 0&&(n=0),i===void 0&&(i=0);let o=t.getPosition().clone(),{context:{camera:a}}=this;if(a.updateMatrix(),i){let l=new G;l.setFromMatrixColumn(a.matrix,1),l.normalize(),l.multiplyScalar(i/a.zoom),o.add(l)}if(n){let l=new G;l.setFromMatrixColumn(a.matrix,0),l.normalize(),l.multiplyScalar(n/a.zoom),o.add(l)}return this.context.setCameraPosition(o,e)}translateElementToCenterX(t,e){return Tt(this,null,function*(){return e===void 0&&(e=500),Ya(new Promise(n=>{let i=this.context.control.target.clone(),o=t.getPosition();this.timer.requestAnimationFrame(()=>{let{clientSize:{width:a,height:l},camera:c}=this.context,g=sn(o,c,a,l).x-a/2,m=new G;m.setFromMatrixColumn(this.context.camera.matrix,0),m.normalize(),m.multiplyScalar(g/this.context.camera.zoom),i.add(m),this.context.setCameraPosition(i,e).then(n)})}),e+500)})}getElementDeviceCoordinate(t){let e=t.position.clone(),{clientWidth:n,clientHeight:i}=this.container;return sn(e,this.context.camera,n,i)}changeMapType(t,e){return e===void 0&&(e=500),this.type=t,t==="2d"?this.context.setPolarAngle(0,e):this.context.setPolarAngle(1.1,e)}resetView(t){return Tt(this,null,function*(){t===void 0&&(t=300);let e=t/3;yield this.context.setAzimuthalAngle(this.config.control.defaultAzimuthal,e),yield this.context.setPolarAngle(this.config.control.defaultPolar,e),yield this.context.fitCameraToGround(this.config.defaultPadding,e,!1)})}reduceMap(t,e){t===void 0&&(t=.5),e===void 0&&(e=500);let n=this.context.camera.zoom;return this.context.setZoom(n-t,this.context.control.target,e)}enlargeMap(t,e){t===void 0&&(t=.5),e===void 0&&(e=500);let n=this.context.camera.zoom;return this.context.setZoom(n+t,this.context.control.target,e)}registryEvent(){if(window.addEventListener("keydown",this.onKeydown),window.addEventListener("keyup",this.onKeyUp),this.config.resizeObserver){let t=new ResizeObserver(this.debounceResize);t.observe(this.container),this.observe=t}}unRegistryEvent(){var t;this.context.control.removeEventListener("change",this.onControlChange),window.removeEventListener("keydown",this.onKeydown),window.removeEventListener("keyup",this.onKeyUp),(t=this.observe)==null||t.disconnect(),this.observe=null}configurePolarShortcutKeys(t){this.polarKeys=t}configureAzimuthalShortcutKeys(t){this.azimuthalKeys=t}rotateMap(t,e){t===void 0&&(t=.1),e===void 0&&(e=500);let n=this.context.control.getAzimuthalAngle();return this.context.setAzimuthalAngle(n+t,e)}measureDistance(){return Tt(this,null,function*(){return this.cancelDistance(),new Promise((t,e)=>{this.changeMapType("2d",0),this.context.control.enableRotate=!1,this.svgLine=new p_(this.context);let n=this.svgLine.dispose.bind(this.svgLine);this.svgLine.dispose=function(){n(),e("cancel")},this.svgLine.addEventListener("distance",i=>{let{distance:o}=i;t(o)})})})}cancelDistance(){this.svgLine&&(this.svgLine.dispose(),this.svgLine=void 0,this.context.control.enableRotate=!0)}measureArea(){return this.cancelArea(),new Promise((t,e)=>{this.changeMapType("2d",0),this.context.control.enableRotate=!1,this.svgPolygon=new d_(this.context);let n=this.svgPolygon.dispose.bind(this.svgPolygon);this.svgPolygon.dispose=function(){n(),e("cancel")},this.svgPolygon.addEventListener("area",i=>{let{area:o}=i;t(o)})})}cancelArea(){this.svgPolygon&&(this.svgPolygon.dispose(),this.svgPolygon=void 0,this.context.control.enableRotate=!0)}fitCameraByPois(t,e,n){return Tt(this,null,function*(){if(e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=500),!t.length)return;let i=new Fe;return t.forEach(o=>{let{position:a}=o;i.expandByPoint(a)}),this.context.fitCameraToBox(i,e,n,!1)})}fitCameraByPoiNodeIds(t,e,n){return Tt(this,null,function*(){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=500);let i=t.map(o=>this.getPoiById(o)).filter(o=>!!o);if(i.length)return this.fitCameraByPois(i,e,n)})}getGraphicByNodeId(t){var e,n;return((e=this.context.currentFloor)==null?void 0:e.graphicLayer.getGraphicByNodeId(t))||((n=this.context.currentFloor)==null?void 0:n.parkingSpaceLayer.graphicMap.get(t))||null}deleteGraphic(t){var e;(e=this.context.currentFloor)==null||e.graphicLayer.removeGraphic(t)}createGraphicByOptions(t){var e;if(!t.transformToBuildingGround&&this.currentBuildGround){let n=yv(this.currentBuildGround.geometry.cds[0]);if(t.geometry.type==="polygon")t.geometry.coords=JSON.parse(JSON.stringify(t.geometry.cds)),t.geometry.coords.map(i=>{Array.isArray(i)&&i.forEach(o=>{o[0]-=n[0],o[1]-=n[1]})});else{let[i,o]=t.geometry.cds;t.geometry.coords=[i-n[0],o-n[1]]}}return(e=this.context.currentFloor)==null?void 0:e.graphicLayer.createGraphic(t)}mercatorToWorld(t){let e=this.buildingCenter;return new G(t[0]-e[0],t[1]-e[1],0)}removePoiById(t){var e,n;(e=this.context.currentFloor)==null||e.poiLayer.removePoiById(t),(n=this.context.currentFloor)==null||n.poiLayer2.removePoiById(t)}getPoiById(t){var e,n;return((e=this.context.currentFloor)==null?void 0:e.poiLayer.getPoiById(t))||((n=this.context.currentFloor)==null?void 0:n.poiLayer2.getPoiById(t))}getPois(){var t,e;return[...(((t=this.context.currentFloor)==null?void 0:t.poiLayer.pois)||[]).filter(n=>!n.options.built_in),...((e=this.context.currentFloor)==null?void 0:e.poiLayer2.pois)||[]]}clearPoi(){this.context.currentFloor&&this.context.currentFloor.poiLayer.clear()}removeSelectGraphic(t){this.context.selection.remove(t)}dispose(){this.loader&&(this.loader.dispose(),this.loader=null),this.unRegistryEvent(),this.timer.dispose(),this.plugins.forEach(t=>t.dispose()),this.plugins=[],this.context.dispose(),this.context=null,this.container=null,Oi.dispose(),Mo.dispose(),Sh.dispose(),Ms.dispose(),hn.dispose(),v0.dispose(),this.debounceResize=null,Ha.Dispose==null||Ha.Dispose.call(Ha)}constructor(t,e={}){super(),this.container=t,this.polarKeys=[],this.azimuthalKeys=[],this.prevCameraZoom=1,this.type="2d",this.currentBuildGround=null,this.observe=null,this.buildingCenter=[0,0],this.timer=new ui,this.plugins=[],this.loader=null,this.onControlChange=()=>{let{camera:{zoom:n}}=this.context;n!==this.prevCameraZoom&&(this.dispatchEvent({type:"zoom-change",basicZoom:this.basicZoom,cameraZoom:this.context.camera.zoom}),this.prevCameraZoom=n)},this.onKeydown=n=>{this.polarKeys.includes(n.code)&&(this.context.control.maxPolarAngle=this.config.control.maxPolar,this.context.control.minPolarAngle=0),this.azimuthalKeys.includes(n.code)&&(this.context.control.maxAzimuthAngle=1/0,this.context.control.minAzimuthAngle=1/0)},this.onKeyUp=n=>{if(this.polarKeys.includes(n.code)){let i=this.context.control.getPolarAngle();this.context.control.maxPolarAngle=i,this.context.control.minPolarAngle=i}if(this.azimuthalKeys.includes(n.code)){let i=this.context.control.getAzimuthalAngle();this.context.control.maxAzimuthAngle=i,this.context.control.minAzimuthAngle=i}},this.resize=()=>{this.context.cameraBound.setEnable(!1),this.context.onWindowResize();let n=this.context.control.getAzimuthalAngle(),i=this.context.camera.zoom;this.context.control.minZoom=0,this.context.control.maxZoom=1/0,this.context.camera.zoom=1,this.context.setAzimuthalAngle(0,0);let o=this.context.getFitCameraToGroundZoom(this.config.defaultPadding,0)||1;this.context.camera.zoom=i,this.context.control.minZoom=o,this.context.control.maxZoom=o*this.config.control.maxZoomScale,this.basicZoom=i,this.context.control.addEventListener("change",this.onControlChange),this.context.setAzimuthalAngle(n,0),this.context.cameraBound.setEnable(!0)},this.config=FR(e),this.context=new S_(t,this),this.debounceResize=(0,a8.debounce)(this.resize,5),this.registryEvent()}};var iMt=function(r){return r.HALF="half",r.POWER="power",r.MECHANICAL="mechanical",r.NORMAL="normal",r.VIP="vip",r}({});var fse=H(ze(),1);var lo=class extends Zi{dispose(){let t=this.bmap.plugins.findIndex(e=>e===this);t!==-1&&this.bmap.plugins.splice(t,1),this.bmap=null,super.dispose()}constructor(t){super(),this.bmap=t,this.bmap.use(this)}};var qR=class extends lo{fetchEquipment(){return Tt(this,null,function*(){let{apiDomain:t,apiPath:{equipmentList:e},apiInfo:n}=this.bmap.config,i=""+t+e;yield fetch(i,n).then(o=>o.json()).then(o=>o.data).then(o=>{this.equipmentList=o,this.equipmentMap=new Map(o.map(a=>[a.equipment_id,a]))}),this.dispatchEvent({type:"change-equipment-list",data:this.equipmentList}),this.bmap.context.currentFloor&&this.changeGraphicToEquipment(this.bmap.context.currentFloor.graphicLayer.children)})}getGraphicEquipment(t){return t.userData.data.info.userData.equipment}changeGraphicToEquipment(t){t.filter(e=>{let n=this.getGraphicEquipment(e);return n&&this.equipmentMap.has(n)}).forEach(e=>{let n=this.equipmentMap.get(this.getGraphicEquipment(e)),i=this.bmap.createGraphicPoi(e,{icon:n==null?void 0:n.equipment_icon,built_in:!0,icon_size:[14,14]});i&&(i.userData.data=n,i.userData.type="equipment")})}dispose(){var t;this.bmap.removeEventListener(ss.SWITCH_FLOOR_AFTER,this.onSwitchFloor),Array.from(((t=this.bmap.context.currentFloor)==null?void 0:t.poiLayer.pois)||[]).forEach(e=>{if(e.userData.type==="equipment"){var n;(n=this.bmap.context.currentFloor)==null||n.poiLayer.removePoi(e)}}),super.dispose()}constructor(t){super(t),this.equipmentList=[],this.equipmentMap=new Map,this.onSwitchFloor=e=>{let{data:{graphics:n}}=e;this.equipmentList.length&&this.changeGraphicToEquipment(n)},this.fetchEquipment(),this.bmap.addEventListener(ss.SWITCH_FLOOR_AFTER,this.onSwitchFloor)}};var Eae=H(bv(),1),Sae=H(Xa(),1),bae=H(ze(),1),Mae=H(UR(),1);var Use=H(ze(),1),Fse=H(En(),1);var vse=H(ip(),1),_se=H(ec(),1),yse=H(nc(),1),xse=H(rc(),1),Ese=H(ic(),1),Sse=H(oc(),1),bse=H(sc(),1),Mse=H(ac(),1),wse=H(uc(),1),Tse=H(lc(),1),Ase=H(cc(),1),Cse=H(hc(),1),Rse=H(fc(),1),Pse=H(pc(),1),Ise=H(dc(),1),Lse=H(En(),1),Nse=H(MR(),1);var Qa=class extends qe{constructor(){super(),this.isMeshLine=!0,this.type="MeshLine",this.positions=[],this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[],this.counters=[],this._points=[],this._geom=null,this.widthCallback=null,this.matrixWorld=new Ie,Object.defineProperties(this,{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(t){this.setPoints(t,this.widthCallback)}}})}};Qa.prototype.setMatrixWorld=function(r){this.matrixWorld=r};Qa.prototype.setGeometry=function(r,t){this._geometry=r,this.setPoints(r.getAttribute("position").array,t)};Qa.prototype.setPoints=function(r,t){if(!(r instanceof Float32Array)&&!(r instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=r,this.widthCallback=t,this.positions=[],this.counters=[],r.length&&r[0]instanceof G)for(var e=0;e<r.length;e++){var n=r[e],i=e/r.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(i),this.counters.push(i)}else for(var e=0;e<r.length;e+=3){var i=e/r.length;this.positions.push(r[e],r[e+1],r[e+2]),this.positions.push(r[e],r[e+1],r[e+2]),this.counters.push(i),this.counters.push(i)}this.process()};function oMt(r,t){var e=new Ie,n=new da,i=new ai,o=new G,a=this.geometry;if(a.boundingSphere||a.computeBoundingSphere(),i.copy(a.boundingSphere),i.applyMatrix4(this.matrixWorld),r.ray.intersectSphere(i,o)!==!1){e.copy(this.matrixWorld).invert(),n.copy(r.ray).applyMatrix4(e);var l=new G,c=new G,f=new G,g=this instanceof Yi?2:1,m=a.index,v=a.attributes;if(m!==null)for(var x=m.array,S=v.position.array,w=v.width.array,E=0,b=x.length-1;E<b;E+=g){var C=x[E],A=x[E+1];l.fromArray(S,C*3),c.fromArray(S,A*3);var P=w[Math.floor(E/3)]!==void 0?w[Math.floor(E/3)]:1,U=r.params.Line.threshold+this.material.lineWidth*P/2,F=U*U,D=n.distanceSqToSegment(l,c,o,f);if(!(D>F)){o.applyMatrix4(this.matrixWorld);var L=r.ray.origin.distanceTo(o);L<r.near||L>r.far||(t.push({distance:L,point:f.clone().applyMatrix4(this.matrixWorld),index:E,face:null,faceIndex:null,object:this}),E=b)}}}}Qa.prototype.raycast=oMt;Qa.prototype.compareV3=function(r,t){var e=r*6,n=t*6;return this.positions[e]===this.positions[n]&&this.positions[e+1]===this.positions[n+1]&&this.positions[e+2]===this.positions[n+2]};Qa.prototype.copyV3=function(r){var t=r*6;return[this.positions[t],this.positions[t+1],this.positions[t+2]]};Qa.prototype.getDistance=function(r){let t=0;for(let e=0;e<r;e++){let n=6*e,i=new G(this.positions[n],this.positions[n+1],this.positions[n+2]),o=new G(this.positions[n+6],this.positions[n+7],this.positions[n+8]),a=i.distanceTo(o);t+=a}return t};Qa.prototype.process=function(){var r=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var t;let e=this.getDistance(r-1);var n;this.compareV3(0,r-1)?n=this.copyV3(r-2):n=this.copyV3(0),this.previous.push(n[0],n[1],n[2]),this.previous.push(n[0],n[1],n[2]);for(var i=0;i<r;i++){if(this.side.push(1),this.side.push(-1),this.widthCallback?t=this.widthCallback(i/(r-1)):t=1,this.width.push(t),this.width.push(t),i===0)this.uvs.push(0,0),this.uvs.push(0,1);else if(i===r-1)this.uvs.push(1,0),this.uvs.push(1,1);else{let a=this.getDistance(i)/e;this.uvs.push(a,0),this.uvs.push(a,1)}if(i<r-1){n=this.copyV3(i),this.previous.push(n[0],n[1],n[2]),this.previous.push(n[0],n[1],n[2]);var o=i*2;this.indices_array.push(o,o+1,o+2),this.indices_array.push(o+2,o+1,o+3)}i>0&&(n=this.copyV3(i),this.next.push(n[0],n[1],n[2]),this.next.push(n[0],n[1],n[2]))}this.compareV3(r-1,0)?n=this.copyV3(1):n=this.copyV3(r-1),this.next.push(n[0],n[1],n[2]),this.next.push(n[0],n[1],n[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new He(new Float32Array(this.positions),3),previous:new He(new Float32Array(this.previous),3),next:new He(new Float32Array(this.next),3),side:new He(new Float32Array(this.side),1),width:new He(new Float32Array(this.width),1),uv:new He(new Float32Array(this.uvs),2),index:new He(new Uint16Array(this.indices_array),1),counters:new He(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function XR(r,t,e,n,i){var o;if(r=r.subarray||r.slice?r:r.buffer,e=e.subarray||e.slice?e:e.buffer,r=t?r.subarray?r.subarray(t,i&&t+i):r.slice(t,i&&t+i):r,e.set)e.set(r,n);else for(o=0;o<r.length;o++)e[o+n]=r[o];return e}Qa.prototype.advance=function(r){var t=this._attributes.position.array,e=this._attributes.previous.array,n=this._attributes.next.array,i=t.length;XR(t,0,e,0,i),XR(t,6,t,0,i-6),t[i-6]=r.x,t[i-5]=r.y,t[i-4]=r.z,t[i-3]=r.x,t[i-2]=r.y,t[i-1]=r.z,XR(t,6,n,0,i-6),n[i-6]=r.x,n[i-5]=r.y,n[i-4]=r.z,n[i-3]=r.x,n[i-2]=r.y,n[i-1]=r.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0};ke.meshline_vert=["",ke.logdepthbuf_pars_vertex,ke.fog_pars_vertex,"","attribute vec3 previous;","attribute vec3 next;","attribute float side;","attribute float width;","attribute float counters;","","uniform vec2 resolution;","uniform float lineWidth;","uniform vec3 color;","uniform float opacity;","uniform float sizeAttenuation;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","vec2 fix( vec4 i, float aspect ) {",""," vec2 res = i.xy / i.w;"," res.x *= aspect;"," vCounters = counters;"," return res;","","}","","void main() {",""," float aspect = resolution.x / resolution.y;",""," vColor = vec4( color, opacity );"," vUV = uv;",""," mat4 m = projectionMatrix * modelViewMatrix;"," vec4 finalPosition = m * vec4( position, 1.0 );"," vec4 prevPos = m * vec4( previous, 1.0 );"," vec4 nextPos = m * vec4( next, 1.0 );",""," vec2 currentP = fix( finalPosition, aspect );"," vec2 prevP = fix( prevPos, aspect );"," vec2 nextP = fix( nextPos, aspect );",""," float w = lineWidth * width;",""," vec2 dir;"," if( nextP == currentP ) dir = normalize( currentP - prevP );"," else if( prevP == currentP ) dir = normalize( nextP - currentP );"," else {"," vec2 dir1 = normalize( currentP - prevP );"," vec2 dir2 = normalize( nextP - currentP );"," dir = normalize( dir1 + dir2 );",""," vec2 perp = vec2( -dir1.y, dir1.x );"," vec2 miter = vec2( -dir.y, dir.x );"," //w = clamp( w / dot( miter, perp ), 0., 4. * lineWidth * width );",""," }",""," //vec2 normal = ( cross( vec3( dir, 0. ), vec3( 0., 0., 1. ) ) ).xy;"," vec4 normal = vec4( -dir.y, dir.x, 0., 1. );"," normal.xy *= .5 * w;"," normal *= projectionMatrix;"," if( sizeAttenuation == 0. ) {"," normal.xy *= finalPosition.w;"," normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;"," }",""," finalPosition.xy += normal.xy * side;",""," gl_Position = finalPosition;","",ke.logdepthbuf_vertex,ke.fog_vertex&&" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",ke.fog_vertex,"}"].join(`
16011
16011
  `);ke.meshline_frag=["",ke.fog_pars_fragment,ke.logdepthbuf_pars_fragment,"","uniform sampler2D map;","uniform sampler2D alphaMap;","uniform float useMap;","uniform float useAlphaMap;","uniform float useDash;","uniform float dashArray;","uniform float dashOffset;","uniform float dashRatio;","uniform float visibility;","uniform float alphaTest;","uniform vec2 repeat;","uniform float thresholdRatio;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","void main() {",""," if (vUV.x <= thresholdRatio) {"," discard;"," }",ke.logdepthbuf_fragment,""," vec4 c = vColor;"," if( useMap == 1. ) c *= texture2D( map, vUV * repeat );"," if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;"," if( c.a < alphaTest ) discard;"," if( useDash == 1. ){"," c.a *= ceil(mod(vCounters + dashOffset, dashArray) - (dashArray * dashRatio));"," }"," gl_FragColor = c;"," gl_FragColor.a *= step(vCounters, visibility);","",ke.fog_fragment,"}"].join(`
16012
16012
  `);var M_=class extends gr{constructor(t){super({uniforms:Object.assign({},pe.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new ne(16777215)},opacity:{value:1},resolution:{value:new ft(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new ft(1,1)},thresholdRatio:{value:0},transparent:{value:!0},depthTest:{vale:!1},depthWrite:{value:!1}}),vertexShader:ke.meshline_vert,fragmentShader:ke.meshline_frag}),this.isMeshLineMaterial=!0,this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(e){this.uniforms.lineWidth.value=e}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(e){this.uniforms.map.value=e}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(e){this.uniforms.useMap.value=e}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(e){this.uniforms.alphaMap.value=e}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(e){this.uniforms.useAlphaMap.value=e}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(e){this.uniforms.color.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(e){this.uniforms.sizeAttenuation.value=e}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(e){this.uniforms.dashArray.value=e,this.useDash=e!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(e){this.uniforms.dashOffset.value=e}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(e){this.uniforms.dashRatio.value=e}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(e){this.uniforms.useDash.value=e}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(e){this.uniforms.visibility.value=e}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(e){this.uniforms.alphaTest.value=e}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(e){this.uniforms.repeat.value.copy(e)}},thresholdRatio:{enumerable:!0,get:function(){return this.uniforms.thresholdRatio.value},set:function(e){this.uniforms.thresholdRatio.value=e}}}),this.setValues(t)}};M_.prototype.copy=function(r){return gr.prototype.copy.call(this,r),this.lineWidth=r.lineWidth,this.map=r.map,this.useMap=r.useMap,this.alphaMap=r.alphaMap,this.useAlphaMap=r.useAlphaMap,this.color.copy(r.color),this.opacity=r.opacity,this.resolution.copy(r.resolution),this.sizeAttenuation=r.sizeAttenuation,this.dashArray.copy(r.dashArray),this.dashOffset.copy(r.dashOffset),this.dashRatio.copy(r.dashRatio),this.useDash=r.useDash,this.visibility=r.visibility,this.alphaTest=r.alphaTest,this.repeat.copy(r.repeat),this};var u8={texture_url:b6,lineWidth:10,color:16777215},W6=class extends Se{registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.bmap.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.bmap.context.removeEventListener("resize",this.onResize)}getRepeat(){let{points:t,navigation:{bmap:{context:{camera:e,clientSize:{width:n,height:i}}}}}=this,o=t.map(l=>{let[c,f]=l;return sn(new G(c,f,0),e,n,i)}).map(l=>{let{x:c,y:f}=l;return[c,f]});return Ws(o)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new ft(t,1)}loadTexture(t){return new Promise((e,n)=>{new G0().load(t,e,void 0,n)})}transformPoints(t){let e=[];for(let n=0;n<t.length;n++)e.push(...t[n],0);return e}updatePoints(t){this.points=t,this.changeRepeat();let e=this.transformPoints(t);this.geometry&&this.geometry.setPoints(e)}movePath(t){this.material&&(this.material.thresholdRatio=t)}create(t){return Tt(this,null,function*(){let e=this.geometry=new Qa;if(this.updatePoints(t),!this.texture){let o=this.texture=yield this.loadTexture(this.config.texture_url);o.wrapS=o.wrapT=zs}let n=this.material=new M_({useMap:!0,color:new ne(this.config.color),transparent:!0,resolution:new ft(this.navigation.bmap.context.clientSize.width,this.navigation.bmap.context.clientSize.height),depthTest:!1,sizeAttenuation:!1,lineWidth:this.config.lineWidth*2,map:this.texture,blending:U0,repeat:new ft(this.getRepeat(),1)}),i=this.mesh=new en(e,n);return i.renderOrder=99999,this.add(i),i})}dispose(){var t,e,n;this.unRegistryEvent(),this.clear(),(t=this.geometry)==null||t.dispose(),(e=this.material)==null||e.dispose(),(n=this.texture)==null||n.dispose(),this.navigation=null}constructor(t,e){super(),this.navigation=t,this.mesh=null,this.geometry=null,this.material=null,this.texture=null,this.config=u8,this.points=[],this.basicRepeat=1,this.prevCameraZoom=0,this.onControlChange=()=>{let n=this.navigation.bmap.context.camera.zoom;n!==this.prevCameraZoom&&(this.prevCameraZoom=n,this.changeRepeat())},this.onUpdate=()=>{this.texture},this.onResize=()=>{if(this.material){let{width:n,height:i}=this.navigation.bmap.context.clientSize;this.material.resolution.set(n,i)}},this.config=Object.assign({},u8,e),this.registryEvent(),this.prevCameraZoom=this.navigation.bmap.context.camera.zoom}};var qse=H(T6(),1),Xse=H(ze(),1),jse=H(En(),1);var l8=H(qs(),1);var sMt={offsetDistance:15,offsetToResetTime:3e3,directionEmitThreshold:5,simulationSpeed:1,destinationDistanceThreshold:10},q6=class extends Zi{get curRoutePath(){return this.paths[this.routeIndex]||null}get curRoutePathPoints(){var t;return((t=this.curRoutePath)==null?void 0:t.points)||[]}registryEvent(){this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.addEventListener("add-path",this.onAddPaths)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.removeEventListener("add-path",this.onAddPaths)}setRoadData(t){this.roadData=t}resetStatus(t){this.offset=!1,this.reset=!1,this.routeIndex=0,this.pointIndex=0,this.resetTimer&&(this.timer.clearTimeout(this.resetTimer),this.resetTimer=null),t.length&&(this.position=t[0].points[0])}emitNavigationStatus(){let t=this.getNavigationInfo();t&&this.dispatchEvent({type:"navigation-info",info:t})}adsorb(t,e){let{curRoutePathPoints:n,position:i,curRoutePath:o,paths:a,routeIndex:l}=this;if(!n.length)return null;let c=n,f=this.paths[this.routeIndex].floor,g=this.getCurRouteRemainDistance();if(i){let E=K0(n,i);c=c.slice(E+1),c.unshift(i)}let m=[{floor:o==null?void 0:o.floor,points:c},...a.slice(l+1)],{distance:v,closestPoint:x,index:S,i:w}=m.reduce((E,b,C)=>{if(b.floor!==t)return E;let{distance:A,closestPoint:P,index:U}=b.points.reduce((F,D,L,tt)=>{if(!tt[L+1])return te({},F,{distance:F.distance===1/0?zr(D,e):F.distance});let{distance:O,closestPoint:V}=VT(e,D,tt[L+1]);if(f===t){let W=[e,...tt.slice(L+1)],St=Ws(W);if(g-St>10)return F}return O<F.distance?{distance:O,closestPoint:V,index:L}:F},{distance:1/0,closestPoint:b.points[0],index:0});return A<E.distance?{distance:A,closestPoint:P,index:C,i:U}:E},{distance:1/0,closestPoint:c[0],index:0,i:0});return{distance:v,closestPoint:x,routeIndex:S+l,pointIndex:S===0?w+this.pointIndex:w}}toPosition(t,e){let n=this.adsorb(t,e);if(!n)return;let{distance:i,closestPoint:o,routeIndex:a,pointIndex:l}=n;i>this.options.offsetDistance?(this.offset=!0,this.resetTimer||(this.resetTimer=this.timer.setTimeout(()=>{this.reset=!0,this.resetTimer=null},this.options.offsetToResetTime))):(this.offset=!1,this.reset=!1,this.resetTimer&&(this.timer.clearTimeout(this.resetTimer),this.resetTimer=null)),this.routeIndex=a,this.pointIndex=l,this.position=o,this.emitNavigationStatus()}startSimulation(){this.resetStatus(this.paths),this.emitNavigationStatus(),this.startCurRouteSimulation()}pause(){var t;this.tweenUtil.clear(),(t=this.throttleUpdatePosition)==null||t.cancel(),this.paused=!0}continue(){this.paused=!1,this.startCurRouteSimulation()}startCurRouteSimulation(){return Tt(this,null,function*(){let{curRoutePath:t}=this;if(!t)return;this.simulationTween&&this.tweenUtil.remove(this.simulationTween);let e=[];return new Promise(n=>{let i=[this.position,...this.curRoutePathPoints.slice(this.pointIndex+1)],o=this.getCurRouteRemainDistance(),a=o/this.options.simulationSpeed,l=this.throttleUpdatePosition=(0,l8.throttle)(f=>{let g=Jf(i,f.distance);g&&(e.push({floor:t.floor,pos:g}),this.toPosition(t.floor,g))},100),c=this.simulationTween=new Za({distance:0},this.tweenUtil.group).to({distance:o},a*1e3).onUpdate(l).onComplete(()=>{this.tweenUtil.remove(c),l.flush(),l.cancel(),this.routeIndex+1<this.paths.length?(this.routeIndex++,this.position=this.paths[this.routeIndex].points[0],this.pointIndex=0,setTimeout(()=>{n(this.startCurRouteSimulation())},3e3)):(n(!0),console.log(e,this.routeIndex,this.paths))}).start()})})}changeSimulationSpeed(t){this.options.simulationSpeed=t,this.paused||this.startCurRouteSimulation()}getCurRouteRemainDistance(){let{curRoutePathPoints:t,pointIndex:e,position:n}=this;if(!t.length)return 0;let i=[n,...t.slice(e+1)];return Ws(i)}getCurRouteToStartDistance(){let{curRoutePathPoints:t,pointIndex:e,position:n}=this;if(!t.length)return 0;let i=[...t.slice(0,e+1),n];return Ws(i)}getRemainDistance(){let t=this.getCurRouteRemainDistance();return{total:this.paths.slice(this.routeIndex+1).reduce((i,o)=>i+o.distance,0)+t,curRoute:t}}getNextDirDistance(){var t;if(!this.position)return null;let{pointIndex:e,curRoutePathPoints:n,position:i,curRoutePath:o}=this,a=e,l=Q0.FRONT,c=(o==null||(t=o.pointInfos[a])==null?void 0:t.crossName)||"",f=0,g=0,m=0;for(;l===Q0.FRONT&&a<=n.length;){let w=n[a],E=n[a+1],b=n[a+2];if(!w||!E)l=Q0.END;else if(f+=zr(w,E),!b)l=Q0.END;else{l=w1(w,E,b),g=xv(w,E,b),m=(new ft(b[0]-E[0],b[1]-E[1]).angle()*180/Math.PI-90+360)%360;var v;c=(v=o==null?void 0:o.pointInfos[a+1].crossName)!=null?v:"",a+=1}}n[a]&&(f=zr(i,n[a]));let x=T1(g);if(l===Q0.END&&f<=this.options.directionEmitThreshold)return{dir:l,distance:f,crossName:c,angle:g,nextAngle:m,nextDir:x};let S=this.getCurRouteToStartDistance();return e===0&&S<=5?{dir:Q0.START,distance:f,crossName:c,angle:g,nextAngle:m,nextDir:x}:(f>=this.options.directionEmitThreshold&&(l=Q0.FRONT),{dir:l,distance:f,crossName:c,angle:g,nextAngle:m,nextDir:x})}getCurPointAreaInfo(){let t=this.roadData.find(e=>e.floor===this.paths[this.routeIndex].floor);if(t){let e=(t.areas||[]).find(n=>{let i=br(n.cds),o=Rr(this.position);return Li(o,i)});if(e)return e}return{imageUrl:null}}getNavigationInfo(){let{total:t,curRoute:e}=this.getRemainDistance(),n=this.getNextDirDistance();if(!n)return null;let{dir:i,distance:o,crossName:a,angle:l,nextAngle:c,nextDir:f}=n;e<=this.options.destinationDistanceThreshold&&(i=Q0.END);let{imageUrl:g}=this.getCurPointAreaInfo();return{distance:t,curRouteDistance:e,nextDirDistance:o,dir:i,angle:l,nextAngle:c,pos:this.position,routeIndex:this.routeIndex,crossName:a,offset:this.offset,reset:this.reset,imageUrl:g,nextDir:f}}dispose(){this.timer.dispose(),this.unRegistryEvent(),this.tweenUtil.clear(),this.navigation=null}constructor(t,e,n){super(),this.navigation=t,this.offset=!1,this.reset=!1,this.position=[0,0],this.routeIndex=0,this.pointIndex=0,this.paths=[],this.timer=new ui,this.resetTimer=null,this.tweenUtil=new Kl,this.paused=!1,this.onAddPaths=i=>{let{paths:o}=i;this.paths=o,this.resetStatus(o),this.simulationTween&&!this.paused&&this.startSimulation()},this.onUpdate=()=>{this.tweenUtil.update()},this.options=Object.assign({},sMt,e),this.roadData=n,this.registryEvent()}};var tae=H(e6(),1),eae=H(ec(),1),nae=H(nc(),1),rae=H(rc(),1),iae=H(ic(),1),oae=H(oc(),1),sae=H(sc(),1),aae=H(ac(),1),uae=H(uc(),1),lae=H(lc(),1),cae=H(cc(),1),hae=H(hc(),1),fae=H(fc(),1),pae=H(pc(),1),dae=H(dc(),1),gae=H(oC(),1),mae=H(ze(),1);var yc=class r extends Di{addDebug(){r.canvas.style.cssText=`
16013
16013
  position: fixed;