@aibee/crc-bmap 0.12.39 → 0.12.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.cjs
CHANGED
|
@@ -11815,7 +11815,7 @@ void main() {
|
|
|
11815
11815
|
top: 0;
|
|
11816
11816
|
left: 0;
|
|
11817
11817
|
z-index: 9999;
|
|
11818
|
-
`,document.body.appendChild(a.canvas)}setAngle(t){if(console.log("angle",t),a.textureMap.has(t))this._initIcon(a.textureMap.get(t));else{this.draw(t);let e=this.getTexture(this.getImageData());a.textureMap.set(t,e),this._initIcon(e),this._initScale({zoom:this.bmap.context.camera.zoom})}}_initIcon(t){if(this.spriteIcon)this.spriteIcon.material.map=t,t.needsUpdate=!0;else{let e=new Yt.Sprite(new Yt.SpriteMaterial({map:t,transparent:!0,alphaTest:.2,depthTest:this.options.depth_test,rotation:this.options.icon_rotate/180*Math.PI}));e.renderOrder=1e5+this.options.level,t.needsUpdate=!0,this.add(e),e.center.set(.5,.5),this.spriteIcon=e}}initSize(){this.spriteIcon&&this.spriteIcon.center.set(.5,.5)}draw(t){let{ctx:e}=a,{config:{size:n}}=this,r=n[0]/2,i=n[1]/2,o=4,s=1,u=o+s;if(e.clearRect(0,0,n[0],n[1]),e.setLineDash([10,10]),e.strokeStyle="#fff",e.lineWidth=2,e.beginPath(),e.arc(r,i,i-u,-Math.PI/2,Math.PI*2-Math.PI/2,t<Math.PI),e.stroke(),e.strokeStyle="#0A7AFF",t<Math.PI){let l=-Math.PI/2,c=l-t;e.beginPath(),e.arc(r,i,i-u,l,c,!0)}else{let l=-Math.PI/2,c=l+Math.PI*2-t;e.beginPath(),e.arc(r,i,i-u,l,c,!1)}e.stroke(),e.clearRect(r-u*2,0,u*4,u*4),e.beginPath(),e.arc(r,u,o,0,Math.PI*2),e.fillStyle="#0A7AFF",e.fill(),e.setLineDash([10,0]),e.strokeStyle="#fff",e.lineWidth=s,e.stroke(),e.clearRect(0,i-5,10,10),e.clearRect(r-5,n[1]-10,10,10),e.clearRect(n[0]-10,i-5,10,10),t>Math.PI/2&&t<Math.PI?e.fillStyle="#0A7AFF":e.fillStyle="#fff",e.fillRect(0,i-1,10,2),e.fillStyle="#fff",e.fillRect(r-1,n[1]-10,2,10),t>Math.PI&&t<Math.PI/2*3?e.fillStyle="#0A7AFF":e.fillStyle="#fff",e.fillRect(n[0]-10,i-1,10,2)}getImageData(){let{ctx:t}=a,{config:{size:e}}=this;return t.getImageData(0,0,e[0],e[1])}getTexture(t){let{config:{size:e}}=this,n=new Yt.DataTexture(Uint8Array.from(t.data),e[0],e[1],Yt.RGBAFormat);return n.format=Yt.RGBAFormat,n.magFilter=Yt.LinearFilter,n.minFilter=Yt.LinearFilter,n.colorSpace="srgb",n.flipY=!0,n}dispose(){var t;super.dispose(),(t=this.spriteIcon)==null||t.material.dispose()}static dispose(){this.textureMap.forEach(t=>{t.dispose()}),this.textureMap.clear(),this.ctx=null,this.canvas=null}constructor(t,e){super(t.context,{icon_size:e.size,collision_enable:!1,level:2}),this.bmap=t,this.config=e,a.canvas.width=e.size[0],a.canvas.height=e.size[1]}};pe.canvas=document.createElement("canvas");pe.ctx=pe.canvas.getContext("2d",{willReadFrequently:!0});pe.textureMap=new Map;var Nu={path:{},cheapMaximumDistance:20,needStartPoi:!1,startPoi:{},positionNavigation:{},offsetY:150,directionEmitThreshold:5,disablePathAnimation:!1,disablePathRotate:!1,disablePathShorten:!1,speed:1,roadData:[],runAnimationMaxTime:1,navigationCameraBasic:45},Wi=class extends ut{get curFloorPathLength(){var t,e;return(e=(t=this.curFloorPath)==null?void 0:t.distance)!=null?e:0}get curFloorPathPoints(){var t,e;return(e=(t=this.curFloorPath)==null?void 0:t.points)!=null?e:[]}registryEvent(){this.bmap.context.addEventListener("update",this.onUpdate),this.bmap.addEventListener(_t.SWITCH_FLOOR_GROUND,this.onSwitchFloor),this.positionNavigation.addEventListener("navigation-info",this.onNavigationInfo),this.bmap.context.addEventListener("control-change",this.onControlChangeForStartPoi)}setRoadData(t){this.options.roadData=t,this.positionNavigation.setRoadData(t)}showStartRotateHelperPoi(){var t;if(this.needStartRotateHelperPoi=!0,!this.startPoi||this.startRotateHelperPoi)return;let e=this.startPoi.options.icon_size;this.startRotateHelperPoi=new pe(this.bmap,{size:[e[0]+20,e[1]+20]}),this.startRotateHelperPoi.setAngle(0),this.startRotateHelperPoi.position.setZ(.51),(t=this.bmap.context.currentFloor)==null||t.poiLayer2.pushPoi(this.startRotateHelperPoi)}hideStartRotateHelperPoi(){if(this.needStartRotateHelperPoi=!1,this.startRotateHelperPoi){var t;(t=this.bmap.context.currentFloor)==null||t.poiLayer2.removePoi(this.startRotateHelperPoi),this.startRotateHelperPoi=null}}setStartPoiPosition(t,e){this.startPoi&&(this.startPoi.position.setX(t).setY(e),this.startRotateHelperPoi&&this.startRotateHelperPoi.position.setX(t).setY(e),this.detachLine&&this.detachLine.setPosition(this.startPoi.position,this.detachStartPoi.position))}resetStatus(){this.pauseAnimation(),this.positionNavigation.resetStatus(this.paths),this.movedDistance=0,this.startPoi&&this.translatePath&&this.setStartPoiPosition(this.translatePath[0][0],this.translatePath[0][1])}toPositionByTask(t){var e;let r=(e=this.taskQueue.getTasks().find(o=>o.meta.type==="toPosition"))==null?void 0:e.tid,i={run:()=>this.toPositionBySpeed(t,this.options.speed),meta:{type:"toPosition"}};r?this.taskQueue.replace(r,i):this.taskQueue.add(i)}pauseAnimation(){this.taskQueue.clear(),this.positionNavigation.pause(),this.tweenUtil.pause()}continueAnimation(){this.tweenUtil.continue(),this.positionNavigation.continue()}clearTween(){this.tweenUtil.clear(),this.taskQueue.clear(),this.bmap.context.control.enabled=!0}unRegistryEvent(){this.bmap.context.removeEventListener("update",this.onUpdate),this.bmap.removeEventListener(_t.SWITCH_FLOOR_GROUND,this.onSwitchFloor),this.positionNavigation.removeEventListener("navigation-info",this.onNavigationInfo),this.bmap.context.removeEventListener("control-change",this.onControlChangeForStartPoi)}clearPath(){if(this.resetStatus(),this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose(),this.path=null,this.clearTween()),this.startPoi){var t;if((t=this.bmap.context.currentFloor)==null||t.poiLayer2.removePoi(this.startPoi),this.startPoi=null,this.startRotateHelperPoi){var e;(e=this.bmap.context.currentFloor)==null||e.poiLayer2.removePoi(this.startRotateHelperPoi),this.startRotateHelperPoi=null}}if(this.detachStartPoi){var n;(n=this.bmap.context.currentFloor)==null||n.removePoi2(this.detachStartPoi),this.detachStartPoi=null}this.detachLine&&(this.bmap.context.scene.remove(this.detachLine),this.detachLine.dispose(),this.detachLine=null),this.translatePath=null}setCurFloorPath(t){t===null?(this.curFloorPath=null,this.currentPathPosition=null,this.toPointPosition=null):(this.curFloorPath=t,this.currentPathPosition=t.points[0],this.toPointPosition=t.points[0]),this.movedDistance=0,this.clearTween()}setCurPathIndex(t){var e,n;this.curPathIndex=t,((e=this.paths[t])==null?void 0:e.floor)===((n=this.bmap.context.currentFloor)==null?void 0:n.name)?(this.setCurFloorPath(this.paths[t]),this.renderPath(this.translatePoints(this.curFloorPathPoints))):this.clearPath()}addPath(t,e){e===void 0&&(e=0);var n;this.paths=t,this.curPathIndex=e,this.clearTween(),this.clearPath();let r=(n=this.bmap.context.currentFloor)==null?void 0:n.name,i=t[e];if(r&&(i==null?void 0:i.floor)===r)if(this.setCurFloorPath(i),this.bmap.currentBuildGround)this.renderPath(this.translatePoints(i.points));else{let o=()=>{this.bmap.removeEventListener("center-change",o),this.renderPath(this.translatePoints(i.points))};this.bmap.addEventListener("center-change",o)}this.dispatchEvent({type:"add-path",paths:t})}translatePoints(t){let[e,n]=this.bmap.buildingCenter;return t.map(r=>[r[0]-e,r[1]-n])}renderPath(t){this.translatePath=t;let e=this.catmullRomCurve3(t);if(this.cPath=e,this.animationPathOptions={cPathIndex:0},this.pathStart=e[0],this.path?this.path.updatePoints(e):(this.path=new Ur(this,this.options.path),this.path.create(e),this.path.position.z=this.bmap.context.currentFloor.groundMaxHeight+.5,this.bmap.context.scene.add(this.path)),this.path.movePath(0),this.startPoi){var n;if((n=this.bmap.context.currentFloor)==null||n.poiLayer2.removePoi(this.startPoi),this.startPoi=null,this.startRotateHelperPoi){var r;(r=this.bmap.context.currentFloor)==null||r.poiLayer2.removePoi(this.startRotateHelperPoi),this.startRotateHelperPoi=null}}if(this.removeDetachStart(),this.showDetachStartState&&this.options.detachStartPoi){var i;this.detachStartPoi=new et(this.bmap.context,x({},this.options.detachStartPoi,{id:"navigation_detach_start_poi",position:{x:e[0][0],y:e[0][1],z:.51},collision_enable:!1}))||null,(i=this.bmap.context.currentFloor)==null||i.poiLayer2.pushPoi(this.detachStartPoi),this.detachLine=new qe(this.bmap.context,new Nt.Vector3(e[0][0],e[0][1],.51),new Nt.Vector3(e[0][0],e[0][1],.51)),this.bmap.context.scene.add(this.detachLine)}if(this.options.needStartPoi){var o;this.startPoi=new et(this.bmap.context,x({},this.options.startPoi,{id:"navigation_start_poi",position:{x:e[0][0],y:e[0][1],z:.51},collision_enable:!1}))||null,(o=this.bmap.context.currentFloor)==null||o.poiLayer2.pushPoi(this.startPoi),this.needStartRotateHelperPoi&&this.showStartRotateHelperPoi(),console.log(this.startRotateHelperPoi)}this.dispatchEvent({type:"render-path",path:this.path})}catmullRomCurve3(t){return gn(t,!1,!0,.1,170,2.5)}getPathDirection(){if(!this.curFloorPath||!this.currentPathPosition||this.curFloorPathPoints.length<2)return null;let t=Qt(this.curFloorPathPoints,this.currentPathPosition),e=this.curFloorPathPoints[t],n=this.curFloorPathPoints[t+1],r=new Nt.Vector3(n[0]-e[0],n[1]-e[1],0).normalize(),i=new Nt.Vector3(0,1,0).normalize(),o=r.angleTo(i),s=new Nt.Vector3().crossVectors(i,r);return(Object.is(s.y,0)?-1:1)*o}getPathDirection2(){if(!this.curFloorPath||!this.toPointPosition||this.curFloorPathPoints.length<2)return null;let t=Qt(this.curFloorPathPoints,this.toPointPosition),e=this.curFloorPathPoints[t],n=this.curFloorPathPoints[t+1];return(new Nt.Vector2(n[0]-e[0],n[1]-e[1]).normalize().angle()*180/Math.PI-90+360)%360}changeCameraToPathUp(t){return g(this,null,function*(){t===void 0&&(t=100);let e=this.getPathDirection();if(e===null)return;let n=this.bmap.context.control.getAzimuthalAngle();Math.abs(n-e)>Math.PI&&(n>0?e=Math.PI*2+e:e=e-Math.PI*2);let r=Math.abs(e-this.bmap.context.control.getAzimuthalAngle());if(r<.01)return;let{control:i}=this.bmap.context,o=t/Math.PI*6*r;return Ft(new Promise(s=>{let u={azimuthal:i.getAzimuthalAngle()},l={azimuthal:e},c=i.getPolarAngle(),{maxPolarAngle:h,minPolarAngle:p}=i;i.maxPolarAngle=c,i.minPolarAngle=c;let f=new Qe.Tween(u,this.tweenUtil.group).to(l,o).easing(Qe.Easing.Quadratic.InOut).onUpdate(()=>g(this,null,function*(){this.startPoi&&i.target.copy(this.startPoi.position),i.setAzimuthalAngle(u.azimuthal,!0),i.setTargetByOffset(this.options.offsetY)})).onComplete(()=>{i.enabled=!0,this.tweenUtil.remove(f),i.maxPolarAngle=h,i.minPolarAngle=p,s(!0)}).onStart(()=>{i.enabled=!1}).start()}),o+500).finally(()=>{this.bmap.context.control.enabled=!0})})}initNavigationCamera(t){return g(this,null,function*(){t===void 0&&(t=1e3);var e;let r=(e=this.taskQueue.getTasks().find(o=>o.meta.type==="initNavigationCamera"))==null?void 0:e.tid,i={run:()=>Ft(g(this,null,function*(){yield this.initCameraZoom(t/2),this.options.disablePathRotate||(yield this.changeCameraToPathUp(t/4)),yield this.translateCameraToStartPoi(t/(this.options.disablePathRotate?2:4))}),t+500).finally(()=>{this.bmap.context.control.enabled=!0}),meta:{type:"initNavigationCamera"}};r?this.taskQueue.replace(r,i):this.taskQueue.add(i)})}translateCameraToStartPoi(t){return g(this,null,function*(){if(t===void 0&&(t=100),!this.startPoi)return;let{clientSize:{width:e,height:n},camera:r,control:i}=this.bmap.context,o=Math.round(e/2),s=Math.round(n/2),u=i.target.clone(),l=I(this.startPoi.position,r,e,n),c=l.x-o,h=s-l.y+this.options.offsetY;if(!(Math.abs(c)<=1&&Math.abs(h)<=1)){if(Math.abs(c)>=1){let p=new Nt.Vector3;p.setFromMatrixColumn(r.matrix,0),p.normalize(),p.multiplyScalar(c/r.zoom),u.add(new Nt.Vector3(p.x,p.y,0))}if(Math.abs(h)>=1){let p=new Nt.Vector3;p.setFromMatrixColumn(r.matrix,1),p.normalize(),p.multiplyScalar(h/r.zoom),u.add(new Nt.Vector3(p.x,p.y,0))}return Ft(new Promise(p=>{let f=i.target.clone();console.log(f,u,t);let d=new Qe.Tween(f,this.tweenUtil.group).to(u,t).onUpdate(()=>{this.bmap.context.control.setCameraPositionByTarget(f,0)}).onComplete(()=>{this.bmap.context.control.setCameraPositionByTarget(u,0),this.tweenUtil.remove(d),this.bmap.context.control.enabled=!0,p(!0)}).onStart(()=>{this.bmap.context.control.enabled=!1}).start()}),t+500).then(()=>{this.bmap.context.control.enabled=!0})}})}initCameraZoom(t){return g(this,null,function*(){if(t===void 0&&(t=100),!this.startPoi)return;let{clientSize:{width:e,height:n},currentFloor:r}=this.bmap.context,{max:i,min:o}=r.box,u=Math.min(e/(i.x-o.x),n/(i.y-o.y))*(i.x-o.x)/this.options.navigationCameraBasic;return this.bmap.context.setZoom(u,this.startPoi.position,t).finally(()=>{this.bmap.context.control.enabled=!0})})}toPosition(t,e){if(this.paths[this.curPathIndex]&&this.paths[this.curPathIndex].floor===t&&this.detachStartPoi){let n=this.translatePoints([e]);this.detachStartPoi.position.setX(n[0][0]),this.detachStartPoi.position.setY(n[0][1]),this.detachLine&&this.startPoi&&this.detachLine.setPosition(this.startPoi.position,this.detachStartPoi.position)}this.positionNavigation.toPosition(t,e)}startSimulation(){this.positionNavigation.startSimulation()}setSimulationSpeed(t){this.positionNavigation.changeSimulationSpeed(t)}toPositionBySpeed(t,e){return g(this,null,function*(){let{currentPathPosition:n,curFloorPath:r,curFloorPathPoints:i}=this;if(!r||!n)return null;let o=this.movedDistance,s=di(i,t);if(o===-1||s===-1||s<=o)return null;let u=s-o;if(!u)return;let l=Math.min(u/e,this.options.runAnimationMaxTime);return this.pathTween&&this.clearTween(),Ft(new Promise(c=>{let h=this.pathTween=new Qe.Tween({distance:0},this.tweenUtil.group).to({distance:u},l*1e3).onUpdate(p=>g(this,null,function*(){this.moveDistance(p.distance+o,h)})).onComplete(()=>{this.tweenUtil.remove(h),c(!0)}).start()}),l*1e3+500).finally(()=>{this.bmap.context.control.enabled=!0})})}moveDistance(t,e){return g(this,null,function*(){if(this.movedDistance=t,!this.options.disablePathShorten){var n;(n=this.path)==null||n.movePath(this.movedDistance/this.curFloorPathLength)}let r=Ie(this.curFloorPathPoints,this.movedDistance);if(r===null)return;this.currentPathPosition=r;let i=this.translatePoints([r])[0];this.startPoi&&(this.setStartPoiPosition(i[0],i[1]),this.options.disablePathAnimation||this.bmap.context.control.setTargetByOffset(this.options.offsetY,this.startPoi.position.clone())),!this.options.disablePathAnimation&&!this.options.disablePathRotate&&(e==null||e.pause(),yield this.changeCameraToPathUp(500/this.options.speed),e==null||e.resume())})}removeDetachStart(){if(this.detachLine&&(this.bmap.context.scene.remove(this.detachLine),this.detachLine.dispose(),this.detachLine=null),this.detachStartPoi){var t;(t=this.bmap.context.currentFloor)==null||t.poiLayer2.removePoi(this.detachStartPoi),this.detachStartPoi=null}}hideDetachStart(){this.showDetachStartState=!1,this.removeDetachStart()}showDetachStart(){if(this.showDetachStartState=!0,this.path&&this.startPoi&&this.options.detachStartPoi){var t;let e=this.startPoi.position;this.detachStartPoi=new et(this.bmap.context,x({},this.options.detachStartPoi,{id:"navigation_detach_start_poi",position:e,collision_enable:!1}))||null,(t=this.bmap.context.currentFloor)==null||t.poiLayer2.pushPoi(this.detachStartPoi),this.detachLine=new qe(this.bmap.context,new Nt.Vector3(e.x,e.y,.51),new Nt.Vector3(e.x,e.y,.51)),this.bmap.context.scene.add(this.detachLine)}}setStartPoiRotate(t){this.startPoiRotate=t;let n=(this.bmap.context.control.getAzimuthalAngle()*180/Math.PI+360)%360,r=(360-t-n)%360;this.detachStartPoi&&(this.detachStartPoi.options.icon_rotate=r),this.startPoi&&(this.startPoi.options.icon_rotate=r,this.startRotateHelperPoi&&this.startRotateHelperPoi.setAngle(r))}dispose(){var t;if(this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose()),this.hideDetachStart(),this.startPoi){var e;(e=this.bmap.context.currentFloor)==null||e.poiLayer2.removePoi(this.startPoi),this.startPoi=null}this.tweenUtil.dispose(),this.unRegistryEvent(),(t=this.startRotateHelperPoi)==null||t.dispose(),pe.dispose(),this.positionNavigation.dispose(),this.startRotateHelperPoi=null,super.dispose()}constructor(t,e={},n){super(t),this.path=null,this.fetchRoadStatus=!1,this.paths=[],this.curPathIndex=0,this.curFloorPath=null,this.translatePath=null,this.currentPathPosition=null,this.toPointPosition=null,this.pathTween=null,this.startPoi=null,this.detachStartPoi=null,this.detachLine=null,this.startPoiRotate=null,this.startRotateHelperPoi=null,this.needStartRotateHelperPoi=!1,this.showDetachStartState=!0,this.movedDistance=0,this.pathStart=[0,0],this.tweenUtil=new le,this.taskQueue=new Ne,this.animationPathOptions={cPathIndex:0},this.cPath=[],this.onNavigationInfo=r=>{let{info:i}=r;if(this.dispatchEvent({type:"navigation-info",info:i}),!i.offset){if(i.routeIndex!==this.curPathIndex)return;this.toPointPosition=i.pos,this.toPositionByTask(i.pos)}},this.onUpdate=()=>{this.tweenUtil.update()},this.onSwitchFloor=r=>{let{data:{curFloor:i}}=r;if(this.clearTween(),this.paths[this.curPathIndex]){let o=this.paths[this.curPathIndex];this.setCurFloorPath(o!=null?o:null),o?this.renderPath(this.translatePoints(o.points)):this.clearPath()}else this.clearPath()},this.onControlChangeForStartPoi=()=>{this.startPoi&&this.startPoiRotate!==null&&this.setStartPoiRotate(this.startPoiRotate)},!n&&typeof e=="object"&&(n=e),this.options=Object.assign({},Nu,n),this.positionNavigation=new Fr(this,x({simulationSpeed:this.options.speed},this.options.positionNavigation),this.options.roadData),this.registryEvent()}};var Qy=require("core-js/modules/web.dom-collections.iterator.js");var Be=require("three"),Xi=class extends ut{show(t,e){let n=0;t.forEach(o=>{o.poiLayer2.pois.forEach(s=>{s.position.setZ(s.position.z+n+o.groundMaxHeight),s.options.depth_test=!0,this.poiLayer.pushPoi(s)}),o.poiLayer2.pois.length=0,o.poiLayer2.dispose(),o.position.z=n,n+=o.userData.height});let{scene:r,currentFloor:i}=this.bmap.context;r.background=new Be.Color((e==null?void 0:e.backgroundColor)||"#f1f7f6"),i&&(r.remove(i),i.dispose()),this.group.add(this.poiLayer,...t),this.poiLayer.onAddToScene(),r.add(this.group),this.floors=t,this.fitCamera(),this.bmap.context.cameraBound.updateBox(),this.showStatus=!0}showStep(t,e){let n=0;t.forEach(l=>{l.position.z=n,n+=l.userData.height});let{scene:r,currentFloor:i}=this.bmap.context;r.background=new Be.Color((e==null?void 0:e.backgroundColor)||"#f1f7f6"),i&&(r.remove(i),i.dispose()),this.group.add(this.poiLayer,...t),this.poiLayer.onAddToScene(),r.add(this.group),this.floors=t,this.fitCamera(),this.bmap.context.cameraBound.updateBox(),this.showStatus=!0;let o=()=>{t.some(l=>l.poiLayer2.pois.length>0)?u():requestAnimationFrame(o)},s=null,u=()=>{let l=!1;n=0,t.forEach(c=>{let h=c.poiLayer2.pois.splice(0,c.poiLayer2.pois.length);h.length>0&&(l=!0,h.forEach(p=>{p.position.setZ(p.position.z+n+c.groundMaxHeight),p.options.depth_test=!0,p.visible=!0,p.spriteIcon&&(p.spriteIcon.visible=!0),p.spriteText&&(p.spriteText.visible=!0),this.poiLayer.pushPoi(p)})),c.position.z=n,n+=c.userData.height}),l&&(this.poiLayer.onAddToScene(),this.bmap.context.cameraBound.updateBox(),this.fitCamera()),t.some(c=>c.poiLayer2.pois.length>0)?s=setTimeout(u,1e3):s&&clearTimeout(s)};o()}hide(){let{scene:t}=this.bmap.context;this.poiLayer.onRemoveFromScene(),t.remove(this.group),this.poiLayer.clear(),this.floors.forEach(e=>{e.dispose()}),this.floors=[],this.group.clear(),this.showStatus=!1}fitCamera(){let{context:t,config:e,type:n}=this.bmap;t.cameraBound.setEnable(!1),t.control.minZoom=0,t.control.maxZoom=1/0,t.camera.zoom=1,t.setAzimuthalAngle(e.control.defaultAzimuthal,0),t.setPolarAngle(e.control.defaultPolar,0),t.fitCameraToObject(this.group,e.defaultPadding,0,!1);let r=t.camera.zoom;t.control.minZoom=r,t.control.maxZoom=r*e.control.maxZoomScale,this.bmap.basicZoom=t.camera.zoom,t.control.addEventListener("change",this.bmap.onControlChange),this.bmap.onControlChange(),t.cameraBound.setEnable(!0)}dispose(){this.poiLayer.dispose(),this.floors.forEach(t=>t.dispose()),this.floors=[],super.dispose()}constructor(t){super(t),this.floors=[],this.group=new Be.Group,this.showStatus=!1,this.group.name="mul-floor-group",this.poiLayer=new De(t.context),this.poiLayer.changeParkingSpaceVisibleByZoom=()=>{let e=new Be.Box3().setFromObject(this.group),{clientSize:{width:n,height:r}}=this.bmap.context,{max:i,min:o}=e,u=Math.min(n/(i.x-o.x),r/(i.y-o.y))*(i.x-o.x)/45;this.poiLayer.pois.filter(l=>l.userData.type==="parkingSpace").map(l=>{let c=this.bmap.context.camera.zoom>=u;l.visible=c,c||l.parentSetVisible(c)})}}};var Ks=require("three");function qi(){let a=new Blob([`var RU=Object.create;var xE=Object.defineProperty;var LU=Object.getOwnPropertyDescriptor;var NU=Object.getOwnPropertyNames;var OU=Object.getPrototypeOf,DU=Object.prototype.hasOwnProperty;var ot=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var FU=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of NU(t))!DU.call(n,s)&&s!==e&&xE(n,s,{get:()=>t[s],enumerable:!(o=LU(t,s))||o.enumerable});return n};var Je=(n,t,e)=>(e=n!=null?RU(OU(n)):{},FU(t||!n||!n.__esModule?xE(e,"default",{value:n,enumerable:!0}):e,n));var pp=(n,t,e)=>new Promise((o,s)=>{var l=g=>{try{h(e.next(g))}catch(m){s(m)}},p=g=>{try{h(e.throw(g))}catch(m){s(m)}},h=g=>g.done?o(g.value):Promise.resolve(g.value).then(l,p);h((e=e.apply(n,t)).next())});var so=ot((Vm,EE)=>{"use strict";var Uf=function(n){return n&&n.Math===Math&&n};EE.exports=Uf(typeof globalThis=="object"&&globalThis)||Uf(typeof window=="object"&&window)||Uf(typeof self=="object"&&self)||Uf(typeof global=="object"&&global)||Uf(typeof Vm=="object"&&Vm)||function(){return this}()||Function("return this")()});var SE=ot((sj,wE)=>{"use strict";wE.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 Ui=ot((aj,ME)=>{"use strict";var Wm=typeof document=="object"&&document.all;ME.exports=typeof Wm=="undefined"&&Wm!==void 0?function(n){return typeof n=="function"||n===Wm}:function(n){return typeof n=="function"}});var Ys=ot((uj,bE)=>{"use strict";var UU=Ui();bE.exports=function(n){return typeof n=="object"?n!==null:UU(n)}});var dp=ot((lj,TE)=>{"use strict";var BU=so(),AE=Ys(),Xm=BU.document,zU=AE(Xm)&&AE(Xm.createElement);TE.exports=function(n){return zU?Xm.createElement(n):{}}});var IE=ot((cj,PE)=>{"use strict";var GU=dp(),Ym=GU("span").classList,CE=Ym&&Ym.constructor&&Ym.constructor.prototype;PE.exports=CE===Object.prototype?void 0:CE});var mi=ot((fj,RE)=>{"use strict";RE.exports=function(n){try{return!!n()}catch(t){return!0}}});var Bf=ot((hj,LE)=>{"use strict";var kU=mi();LE.exports=!kU(function(){var n=function(){}.bind();return typeof n!="function"||n.hasOwnProperty("prototype")})});var yi=ot((pj,DE)=>{"use strict";var NE=Bf(),OE=Function.prototype,$m=OE.call,qU=NE&&OE.bind.bind($m,$m);DE.exports=NE?qU:function(n){return function(){return $m.apply(n,arguments)}}});var ac=ot((dj,UE)=>{"use strict";var FE=yi(),HU=FE({}.toString),VU=FE("".slice);UE.exports=function(n){return VU(HU(n),8,-1)}});var zE=ot((gj,BE)=>{"use strict";var WU=yi(),XU=mi(),YU=ac(),Zm=Object,$U=WU("".split);BE.exports=XU(function(){return!Zm("z").propertyIsEnumerable(0)})?function(n){return YU(n)==="String"?$U(n,""):Zm(n)}:Zm});var Jm=ot((mj,GE)=>{"use strict";GE.exports=function(n){return n==null}});var uc=ot((yj,kE)=>{"use strict";var ZU=Jm(),JU=TypeError;kE.exports=function(n){if(ZU(n))throw new JU("Can't call method on "+n);return n}});var lc=ot((vj,qE)=>{"use strict";var KU=zE(),jU=uc();qE.exports=function(n){return KU(jU(n))}});var zf=ot((_j,HE)=>{"use strict";HE.exports=!1});var gp=ot((xj,WE)=>{"use strict";var VE=so(),QU=Object.defineProperty;WE.exports=function(n,t){try{QU(VE,n,{value:t,configurable:!0,writable:!0})}catch(e){VE[n]=t}return t}});var mp=ot((Ej,$E)=>{"use strict";var tB=zf(),eB=so(),nB=gp(),XE="__core-js_shared__",YE=$E.exports=eB[XE]||nB(XE,{});(YE.versions||(YE.versions=[])).push({version:"3.42.0",mode:tB?"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 yp=ot((wj,JE)=>{"use strict";var ZE=mp();JE.exports=function(n,t){return ZE[n]||(ZE[n]=t||{})}});var cc=ot((Sj,KE)=>{"use strict";var rB=uc(),iB=Object;KE.exports=function(n){return iB(rB(n))}});var Ma=ot((Mj,jE)=>{"use strict";var oB=yi(),sB=cc(),aB=oB({}.hasOwnProperty);jE.exports=Object.hasOwn||function(t,e){return aB(sB(t),e)}});var Km=ot((bj,QE)=>{"use strict";var uB=yi(),lB=0,cB=Math.random(),fB=uB(1 .toString);QE.exports=function(n){return"Symbol("+(n===void 0?"":n)+")_"+fB(++lB+cB,36)}});var rw=ot((Aj,nw)=>{"use strict";var hB=so(),tw=hB.navigator,ew=tw&&tw.userAgent;nw.exports=ew?String(ew):""});var cw=ot((Tj,lw)=>{"use strict";var uw=so(),jm=rw(),iw=uw.process,ow=uw.Deno,sw=iw&&iw.versions||ow&&ow.version,aw=sw&&sw.v8,$s,vp;aw&&($s=aw.split("."),vp=$s[0]>0&&$s[0]<4?1:+($s[0]+$s[1]));!vp&&jm&&($s=jm.match(/Edge\\/(\\d+)/),(!$s||$s[1]>=74)&&($s=jm.match(/Chrome\\/(\\d+)/),$s&&(vp=+$s[1])));lw.exports=vp});var Qm=ot((Cj,hw)=>{"use strict";var fw=cw(),pB=mi(),dB=so(),gB=dB.String;hw.exports=!!Object.getOwnPropertySymbols&&!pB(function(){var n=Symbol("symbol detection");return!gB(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&fw&&fw<41})});var t0=ot((Pj,pw)=>{"use strict";var mB=Qm();pw.exports=mB&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Ns=ot((Ij,gw)=>{"use strict";var yB=so(),vB=yp(),dw=Ma(),_B=Km(),xB=Qm(),EB=t0(),fc=yB.Symbol,e0=vB("wks"),wB=EB?fc.for||fc:fc&&fc.withoutSetter||_B;gw.exports=function(n){return dw(e0,n)||(e0[n]=xB&&dw(fc,n)?fc[n]:wB("Symbol."+n)),e0[n]}});var ba=ot((Rj,mw)=>{"use strict";var SB=Ys(),MB=String,bB=TypeError;mw.exports=function(n){if(SB(n))return n;throw new bB(MB(n)+" is not an object")}});var Zs=ot((Lj,yw)=>{"use strict";var AB=mi();yw.exports=!AB(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var n0=ot((Nj,vw)=>{"use strict";var TB=Zs(),CB=mi();vw.exports=TB&&CB(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var r0=ot((Oj,_w)=>{"use strict";var PB=Zs(),IB=mi(),RB=dp();_w.exports=!PB&&!IB(function(){return Object.defineProperty(RB("div"),"a",{get:function(){return 7}}).a!==7})});var Os=ot((Dj,xw)=>{"use strict";var LB=Bf(),_p=Function.prototype.call;xw.exports=LB?_p.bind(_p):function(){return _p.apply(_p,arguments)}});var hc=ot((Fj,Ew)=>{"use strict";var i0=so(),NB=Ui(),OB=function(n){return NB(n)?n:void 0};Ew.exports=function(n,t){return arguments.length<2?OB(i0[n]):i0[n]&&i0[n][t]}});var Sw=ot((Uj,ww)=>{"use strict";var DB=yi();ww.exports=DB({}.isPrototypeOf)});var o0=ot((Bj,Mw)=>{"use strict";var FB=hc(),UB=Ui(),BB=Sw(),zB=t0(),GB=Object;Mw.exports=zB?function(n){return typeof n=="symbol"}:function(n){var t=FB("Symbol");return UB(t)&&BB(t.prototype,GB(n))}});var Aw=ot((zj,bw)=>{"use strict";var kB=String;bw.exports=function(n){try{return kB(n)}catch(t){return"Object"}}});var Gf=ot((Gj,Tw)=>{"use strict";var qB=Ui(),HB=Aw(),VB=TypeError;Tw.exports=function(n){if(qB(n))return n;throw new VB(HB(n)+" is not a function")}});var xp=ot((kj,Cw)=>{"use strict";var WB=Gf(),XB=Jm();Cw.exports=function(n,t){var e=n[t];return XB(e)?void 0:WB(e)}});var Iw=ot((qj,Pw)=>{"use strict";var s0=Os(),a0=Ui(),u0=Ys(),YB=TypeError;Pw.exports=function(n,t){var e,o;if(t==="string"&&a0(e=n.toString)&&!u0(o=s0(e,n))||a0(e=n.valueOf)&&!u0(o=s0(e,n))||t!=="string"&&a0(e=n.toString)&&!u0(o=s0(e,n)))return o;throw new YB("Can't convert object to primitive value")}});var Ow=ot((Hj,Nw)=>{"use strict";var $B=Os(),Rw=Ys(),Lw=o0(),ZB=xp(),JB=Iw(),KB=Ns(),jB=TypeError,QB=KB("toPrimitive");Nw.exports=function(n,t){if(!Rw(n)||Lw(n))return n;var e=ZB(n,QB),o;if(e){if(t===void 0&&(t="default"),o=$B(e,n,t),!Rw(o)||Lw(o))return o;throw new jB("Can't convert object to primitive value")}return t===void 0&&(t="number"),JB(n,t)}});var l0=ot((Vj,Dw)=>{"use strict";var tz=Ow(),ez=o0();Dw.exports=function(n){var t=tz(n,"string");return ez(t)?t:t+""}});var Lu=ot(Uw=>{"use strict";var nz=Zs(),rz=r0(),iz=n0(),Ep=ba(),Fw=l0(),oz=TypeError,c0=Object.defineProperty,sz=Object.getOwnPropertyDescriptor,f0="enumerable",h0="configurable",p0="writable";Uw.f=nz?iz?function(t,e,o){if(Ep(t),e=Fw(e),Ep(o),typeof t=="function"&&e==="prototype"&&"value"in o&&p0 in o&&!o[p0]){var s=sz(t,e);s&&s[p0]&&(t[e]=o.value,o={configurable:h0 in o?o[h0]:s[h0],enumerable:f0 in o?o[f0]:s[f0],writable:!1})}return c0(t,e,o)}:c0:function(t,e,o){if(Ep(t),e=Fw(e),Ep(o),rz)try{return c0(t,e,o)}catch(s){}if("get"in o||"set"in o)throw new oz("Accessors not supported");return"value"in o&&(t[e]=o.value),t}});var zw=ot((Xj,Bw)=>{"use strict";var az=Math.ceil,uz=Math.floor;Bw.exports=Math.trunc||function(t){var e=+t;return(e>0?uz:az)(e)}});var El=ot((Yj,Gw)=>{"use strict";var lz=zw();Gw.exports=function(n){var t=+n;return t!==t||t===0?0:lz(t)}});var qw=ot(($j,kw)=>{"use strict";var cz=El(),fz=Math.max,hz=Math.min;kw.exports=function(n,t){var e=cz(n);return e<0?fz(e+t,0):hz(e,t)}});var d0=ot((Zj,Hw)=>{"use strict";var pz=El(),dz=Math.min;Hw.exports=function(n){var t=pz(n);return t>0?dz(t,9007199254740991):0}});var kf=ot((Jj,Vw)=>{"use strict";var gz=d0();Vw.exports=function(n){return gz(n.length)}});var Yw=ot((Kj,Xw)=>{"use strict";var mz=lc(),yz=qw(),vz=kf(),Ww=function(n){return function(t,e,o){var s=mz(t),l=vz(s);if(l===0)return!n&&-1;var p=yz(o,l),h;if(n&&e!==e){for(;l>p;)if(h=s[p++],h!==h)return!0}else for(;l>p;p++)if((n||p in s)&&s[p]===e)return n||p||0;return!n&&-1}};Xw.exports={includes:Ww(!0),indexOf:Ww(!1)}});var wp=ot((jj,$w)=>{"use strict";$w.exports={}});var m0=ot((Qj,Jw)=>{"use strict";var _z=yi(),g0=Ma(),xz=lc(),Ez=Yw().indexOf,wz=wp(),Zw=_z([].push);Jw.exports=function(n,t){var e=xz(n),o=0,s=[],l;for(l in e)!g0(wz,l)&&g0(e,l)&&Zw(s,l);for(;t.length>o;)g0(e,l=t[o++])&&(~Ez(s,l)||Zw(s,l));return s}});var Sp=ot((tQ,Kw)=>{"use strict";Kw.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Qw=ot((eQ,jw)=>{"use strict";var Sz=m0(),Mz=Sp();jw.exports=Object.keys||function(t){return Sz(t,Mz)}});var eS=ot(tS=>{"use strict";var bz=Zs(),Az=n0(),Tz=Lu(),Cz=ba(),Pz=lc(),Iz=Qw();tS.f=bz&&!Az?Object.defineProperties:function(t,e){Cz(t);for(var o=Pz(e),s=Iz(e),l=s.length,p=0,h;l>p;)Tz.f(t,h=s[p++],o[h]);return t}});var rS=ot((rQ,nS)=>{"use strict";var Rz=hc();nS.exports=Rz("document","documentElement")});var Mp=ot((iQ,oS)=>{"use strict";var Lz=yp(),Nz=Km(),iS=Lz("keys");oS.exports=function(n){return iS[n]||(iS[n]=Nz(n))}});var qf=ot((oQ,hS)=>{"use strict";var Oz=ba(),Dz=eS(),sS=Sp(),Fz=wp(),Uz=rS(),Bz=dp(),zz=Mp(),aS=">",uS="<",v0="prototype",_0="script",cS=zz("IE_PROTO"),y0=function(){},fS=function(n){return uS+_0+aS+n+uS+"/"+_0+aS},lS=function(n){n.write(fS("")),n.close();var t=n.parentWindow.Object;return n=null,t},Gz=function(){var n=Bz("iframe"),t="java"+_0+":",e;return n.style.display="none",Uz.appendChild(n),n.src=String(t),e=n.contentWindow.document,e.open(),e.write(fS("document.F=Object")),e.close(),e.F},bp,Ap=function(){try{bp=new ActiveXObject("htmlfile")}catch(t){}Ap=typeof document!="undefined"?document.domain&&bp?lS(bp):Gz():lS(bp);for(var n=sS.length;n--;)delete Ap[v0][sS[n]];return Ap()};Fz[cS]=!0;hS.exports=Object.create||function(t,e){var o;return t!==null?(y0[v0]=Oz(t),o=new y0,y0[v0]=null,o[cS]=t):o=Ap(),e===void 0?o:Dz.f(o,e)}});var w0=ot((sQ,pS)=>{"use strict";var kz=Ns(),qz=qf(),Hz=Lu().f,x0=kz("unscopables"),E0=Array.prototype;E0[x0]===void 0&&Hz(E0,x0,{configurable:!0,value:qz(null)});pS.exports=function(n){E0[x0][n]=!0}});var Tp=ot((aQ,dS)=>{"use strict";dS.exports={}});var yS=ot((uQ,mS)=>{"use strict";var Vz=so(),Wz=Ui(),gS=Vz.WeakMap;mS.exports=Wz(gS)&&/native code/.test(String(gS))});var Cp=ot((lQ,vS)=>{"use strict";vS.exports=function(n,t){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:t}}});var pc=ot((cQ,_S)=>{"use strict";var Xz=Zs(),Yz=Lu(),$z=Cp();_S.exports=Xz?function(n,t,e){return Yz.f(n,t,$z(1,e))}:function(n,t,e){return n[t]=e,n}});var Rp=ot((fQ,wS)=>{"use strict";var Zz=yS(),ES=so(),Jz=Ys(),Kz=pc(),S0=Ma(),M0=mp(),jz=Mp(),Qz=wp(),xS="Object already initialized",b0=ES.TypeError,tG=ES.WeakMap,Pp,Hf,Ip,eG=function(n){return Ip(n)?Hf(n):Pp(n,{})},nG=function(n){return function(t){var e;if(!Jz(t)||(e=Hf(t)).type!==n)throw new b0("Incompatible receiver, "+n+" required");return e}};Zz||M0.state?(Js=M0.state||(M0.state=new tG),Js.get=Js.get,Js.has=Js.has,Js.set=Js.set,Pp=function(n,t){if(Js.has(n))throw new b0(xS);return t.facade=n,Js.set(n,t),t},Hf=function(n){return Js.get(n)||{}},Ip=function(n){return Js.has(n)}):(wl=jz("state"),Qz[wl]=!0,Pp=function(n,t){if(S0(n,wl))throw new b0(xS);return t.facade=n,Kz(n,wl,t),t},Hf=function(n){return S0(n,wl)?n[wl]:{}},Ip=function(n){return S0(n,wl)});var Js,wl;wS.exports={set:Pp,get:Hf,has:Ip,enforce:eG,getterFor:nG}});var AS=ot(bS=>{"use strict";var SS={}.propertyIsEnumerable,MS=Object.getOwnPropertyDescriptor,rG=MS&&!SS.call({1:2},1);bS.f=rG?function(t){var e=MS(this,t);return!!e&&e.enumerable}:SS});var A0=ot(CS=>{"use strict";var iG=Zs(),oG=Os(),sG=AS(),aG=Cp(),uG=lc(),lG=l0(),cG=Ma(),fG=r0(),TS=Object.getOwnPropertyDescriptor;CS.f=iG?TS:function(t,e){if(t=uG(t),e=lG(e),fG)try{return TS(t,e)}catch(o){}if(cG(t,e))return aG(!oG(sG.f,t,e),t[e])}});var P0=ot((dQ,IS)=>{"use strict";var T0=Zs(),hG=Ma(),PS=Function.prototype,pG=T0&&Object.getOwnPropertyDescriptor,C0=hG(PS,"name"),dG=C0&&function(){}.name==="something",gG=C0&&(!T0||T0&&pG(PS,"name").configurable);IS.exports={EXISTS:C0,PROPER:dG,CONFIGURABLE:gG}});var R0=ot((gQ,RS)=>{"use strict";var mG=yi(),yG=Ui(),I0=mp(),vG=mG(Function.toString);yG(I0.inspectSource)||(I0.inspectSource=function(n){return vG(n)});RS.exports=I0.inspectSource});var DS=ot((mQ,OS)=>{"use strict";var N0=yi(),_G=mi(),xG=Ui(),Lp=Ma(),L0=Zs(),EG=P0().CONFIGURABLE,wG=R0(),NS=Rp(),SG=NS.enforce,MG=NS.get,LS=String,Np=Object.defineProperty,bG=N0("".slice),AG=N0("".replace),TG=N0([].join),CG=L0&&!_G(function(){return Np(function(){},"length",{value:8}).length!==8}),PG=String(String).split("String"),IG=OS.exports=function(n,t,e){bG(LS(t),0,7)==="Symbol("&&(t="["+AG(LS(t),/^Symbol\\(([^)]*)\\).*$/,"$1")+"]"),e&&e.getter&&(t="get "+t),e&&e.setter&&(t="set "+t),(!Lp(n,"name")||EG&&n.name!==t)&&(L0?Np(n,"name",{value:t,configurable:!0}):n.name=t),CG&&e&&Lp(e,"arity")&&n.length!==e.arity&&Np(n,"length",{value:e.arity});try{e&&Lp(e,"constructor")&&e.constructor?L0&&Np(n,"prototype",{writable:!1}):n.prototype&&(n.prototype=void 0)}catch(s){}var o=SG(n);return Lp(o,"source")||(o.source=TG(PG,typeof t=="string"?t:"")),n};Function.prototype.toString=IG(function(){return xG(this)&&MG(this).source||wG(this)},"toString")});var Vf=ot((yQ,FS)=>{"use strict";var RG=Ui(),LG=Lu(),NG=DS(),OG=gp();FS.exports=function(n,t,e,o){o||(o={});var s=o.enumerable,l=o.name!==void 0?o.name:t;if(RG(e)&&NG(e,l,o),o.global)s?n[t]=e:OG(t,e);else{try{o.unsafe?n[t]&&(s=!0):delete n[t]}catch(p){}s?n[t]=e:LG.f(n,t,{value:e,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return n}});var BS=ot(US=>{"use strict";var DG=m0(),FG=Sp(),UG=FG.concat("length","prototype");US.f=Object.getOwnPropertyNames||function(t){return DG(t,UG)}});var GS=ot(zS=>{"use strict";zS.f=Object.getOwnPropertySymbols});var qS=ot((xQ,kS)=>{"use strict";var BG=hc(),zG=yi(),GG=BS(),kG=GS(),qG=ba(),HG=zG([].concat);kS.exports=BG("Reflect","ownKeys")||function(t){var e=GG.f(qG(t)),o=kG.f;return o?HG(e,o(t)):e}});var WS=ot((EQ,VS)=>{"use strict";var HS=Ma(),VG=qS(),WG=A0(),XG=Lu();VS.exports=function(n,t,e){for(var o=VG(t),s=XG.f,l=WG.f,p=0;p<o.length;p++){var h=o[p];!HS(n,h)&&!(e&&HS(e,h))&&s(n,h,l(t,h))}}});var YS=ot((wQ,XS)=>{"use strict";var YG=mi(),$G=Ui(),ZG=/#|\\.prototype\\./,Wf=function(n,t){var e=KG[JG(n)];return e===QG?!0:e===jG?!1:$G(t)?YG(t):!!t},JG=Wf.normalize=function(n){return String(n).replace(ZG,".").toLowerCase()},KG=Wf.data={},jG=Wf.NATIVE="N",QG=Wf.POLYFILL="P";XS.exports=Wf});var Ds=ot((SQ,$S)=>{"use strict";var Op=so(),t4=A0().f,e4=pc(),n4=Vf(),r4=gp(),i4=WS(),o4=YS();$S.exports=function(n,t){var e=n.target,o=n.global,s=n.stat,l,p,h,g,m,_;if(o?p=Op:s?p=Op[e]||r4(e,{}):p=Op[e]&&Op[e].prototype,p)for(h in t){if(m=t[h],n.dontCallGetSet?(_=t4(p,h),g=_&&_.value):g=p[h],l=o4(o?h:e+(s?".":"#")+h,n.forced),!l&&g!==void 0){if(typeof m==typeof g)continue;i4(m,g)}(n.sham||g&&g.sham)&&e4(m,"sham",!0),n4(p,h,m,n)}}});var JS=ot((MQ,ZS)=>{"use strict";var s4=mi();ZS.exports=!s4(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype})});var D0=ot((bQ,jS)=>{"use strict";var a4=Ma(),u4=Ui(),l4=cc(),c4=Mp(),f4=JS(),KS=c4("IE_PROTO"),O0=Object,h4=O0.prototype;jS.exports=f4?O0.getPrototypeOf:function(n){var t=l4(n);if(a4(t,KS))return t[KS];var e=t.constructor;return u4(e)&&t instanceof e?e.prototype:t instanceof O0?h4:null}});var z0=ot((AQ,eM)=>{"use strict";var p4=mi(),d4=Ui(),g4=Ys(),m4=qf(),QS=D0(),y4=Vf(),v4=Ns(),_4=zf(),B0=v4("iterator"),tM=!1,nu,F0,U0;[].keys&&(U0=[].keys(),"next"in U0?(F0=QS(QS(U0)),F0!==Object.prototype&&(nu=F0)):tM=!0);var x4=!g4(nu)||p4(function(){var n={};return nu[B0].call(n)!==n});x4?nu={}:_4&&(nu=m4(nu));d4(nu[B0])||y4(nu,B0,function(){return this});eM.exports={IteratorPrototype:nu,BUGGY_SAFARI_ITERATORS:tM}});var Dp=ot((TQ,rM)=>{"use strict";var E4=Lu().f,w4=Ma(),S4=Ns(),nM=S4("toStringTag");rM.exports=function(n,t,e){n&&!e&&(n=n.prototype),n&&!w4(n,nM)&&E4(n,nM,{configurable:!0,value:t})}});var oM=ot((CQ,iM)=>{"use strict";var M4=z0().IteratorPrototype,b4=qf(),A4=Cp(),T4=Dp(),C4=Tp(),P4=function(){return this};iM.exports=function(n,t,e,o){var s=t+" Iterator";return n.prototype=b4(M4,{next:A4(+!o,e)}),T4(n,s,!1,!0),C4[s]=P4,n}});var G0=ot((PQ,sM)=>{"use strict";var I4=yi(),R4=Gf();sM.exports=function(n,t,e){try{return I4(R4(Object.getOwnPropertyDescriptor(n,t)[e]))}catch(o){}}});var uM=ot((IQ,aM)=>{"use strict";var L4=Ys();aM.exports=function(n){return L4(n)||n===null}});var cM=ot((RQ,lM)=>{"use strict";var N4=uM(),O4=String,D4=TypeError;lM.exports=function(n){if(N4(n))return n;throw new D4("Can't set "+O4(n)+" as a prototype")}});var hM=ot((LQ,fM)=>{"use strict";var F4=G0(),U4=Ys(),B4=uc(),z4=cM();fM.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var n=!1,t={},e;try{e=F4(Object.prototype,"__proto__","set"),e(t,[]),n=t instanceof Array}catch(o){}return function(s,l){return B4(s),z4(l),U4(s)&&(n?e(s,l):s.__proto__=l),s}}():void 0)});var SM=ot((NQ,wM)=>{"use strict";var G4=Ds(),k4=Os(),Fp=zf(),xM=P0(),q4=Ui(),H4=oM(),pM=D0(),dM=hM(),V4=Dp(),W4=pc(),k0=Vf(),X4=Ns(),gM=Tp(),EM=z0(),Y4=xM.PROPER,$4=xM.CONFIGURABLE,mM=EM.IteratorPrototype,Up=EM.BUGGY_SAFARI_ITERATORS,Xf=X4("iterator"),yM="keys",Yf="values",vM="entries",_M=function(){return this};wM.exports=function(n,t,e,o,s,l,p){H4(e,t,o);var h=function(x){if(x===s&&S)return S;if(!Up&&x&&x in _)return _[x];switch(x){case yM:return function(){return new e(this,x)};case Yf:return function(){return new e(this,x)};case vM:return function(){return new e(this,x)}}return function(){return new e(this)}},g=t+" Iterator",m=!1,_=n.prototype,E=_[Xf]||_["@@iterator"]||s&&_[s],S=!Up&&E||h(s),b=t==="Array"&&_.entries||E,A,I,w;if(b&&(A=pM(b.call(new n)),A!==Object.prototype&&A.next&&(!Fp&&pM(A)!==mM&&(dM?dM(A,mM):q4(A[Xf])||k0(A,Xf,_M)),V4(A,g,!0,!0),Fp&&(gM[g]=_M))),Y4&&s===Yf&&E&&E.name!==Yf&&(!Fp&&$4?W4(_,"name",Yf):(m=!0,S=function(){return k4(E,this)})),s)if(I={values:h(Yf),keys:l?S:h(yM),entries:h(vM)},p)for(w in I)(Up||m||!(w in _))&&k0(_,w,I[w]);else G4({target:t,proto:!0,forced:Up||m},I);return(!Fp||p)&&_[Xf]!==S&&k0(_,Xf,S,{name:s}),gM[t]=S,I}});var bM=ot((OQ,MM)=>{"use strict";MM.exports=function(n,t){return{value:n,done:t}}});var RM=ot((DQ,IM)=>{"use strict";var Z4=lc(),q0=w0(),AM=Tp(),CM=Rp(),J4=Lu().f,K4=SM(),Bp=bM(),j4=zf(),Q4=Zs(),PM="Array Iterator",tk=CM.set,ek=CM.getterFor(PM);IM.exports=K4(Array,"Array",function(n,t){tk(this,{type:PM,target:Z4(n),index:0,kind:t})},function(){var n=ek(this),t=n.target,e=n.index++;if(!t||e>=t.length)return n.target=null,Bp(void 0,!0);switch(n.kind){case"keys":return Bp(e,!1);case"values":return Bp(t[e],!1)}return Bp([e,t[e]],!1)},"values");var TM=AM.Arguments=AM.Array;q0("keys");q0("values");q0("entries");if(!j4&&Q4&&TM.name!=="values")try{J4(TM,"name",{value:"values"})}catch(n){}});var Gp=ot(()=>{"use strict";var LM=so(),OM=SE(),nk=IE(),$f=RM(),NM=pc(),rk=Dp(),ik=Ns(),H0=ik("iterator"),V0=$f.values,DM=function(n,t){if(n){if(n[H0]!==V0)try{NM(n,H0,V0)}catch(o){n[H0]=V0}if(rk(n,t,!0),OM[t]){for(var e in $f)if(n[e]!==$f[e])try{NM(n,e,$f[e])}catch(o){n[e]=$f[e]}}}};for(zp in OM)DM(LM[zp]&&LM[zp].prototype,zp);var zp;DM(nk,"DOMTokenList")});var BM=ot((BQ,UM)=>{"use strict";var ok=Ns(),sk=ok("toStringTag"),FM={};FM[sk]="z";UM.exports=String(FM)==="[object z]"});var W0=ot((zQ,zM)=>{"use strict";var ak=BM(),uk=Ui(),kp=ac(),lk=Ns(),ck=lk("toStringTag"),fk=Object,hk=kp(function(){return arguments}())==="Arguments",pk=function(n,t){try{return n[t]}catch(e){}};zM.exports=ak?kp:function(n){var t,e,o;return n===void 0?"Undefined":n===null?"Null":typeof(e=pk(t=fk(n),ck))=="string"?e:hk?kp(t):(o=kp(t))==="Object"&&uk(t.callee)?"Arguments":o}});var qp=ot((GQ,GM)=>{"use strict";var dk=W0(),gk=String;GM.exports=function(n){if(dk(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return gk(n)}});var qM=ot((kQ,kM)=>{"use strict";var mk=ba();kM.exports=function(){var n=mk(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 VM=ot((qQ,HM)=>{"use strict";var X0=mi(),yk=so(),Y0=yk.RegExp,$0=X0(function(){var n=Y0("a","y");return n.lastIndex=2,n.exec("abcd")!==null}),vk=$0||X0(function(){return!Y0("a","y").sticky}),_k=$0||X0(function(){var n=Y0("^r","gy");return n.lastIndex=2,n.exec("str")!==null});HM.exports={BROKEN_CARET:_k,MISSED_STICKY:vk,UNSUPPORTED_Y:$0}});var XM=ot((HQ,WM)=>{"use strict";var xk=mi(),Ek=so(),wk=Ek.RegExp;WM.exports=xk(function(){var n=wk(".","s");return!(n.dotAll&&n.test(\`
|
|
11818
|
+
`,document.body.appendChild(a.canvas)}setAngle(t){if(console.log("angle",t),a.textureMap.has(t))this._initIcon(a.textureMap.get(t));else{this.draw(t);let e=this.getTexture(this.getImageData());a.textureMap.set(t,e),this._initIcon(e),this._initScale({zoom:this.bmap.context.camera.zoom})}}_initIcon(t){if(this.spriteIcon)this.spriteIcon.material.map=t,t.needsUpdate=!0;else{let e=new Yt.Sprite(new Yt.SpriteMaterial({map:t,transparent:!0,alphaTest:.2,depthTest:this.options.depth_test,rotation:this.options.icon_rotate/180*Math.PI}));e.renderOrder=1e5+this.options.level,t.needsUpdate=!0,this.add(e),e.center.set(.5,.5),this.spriteIcon=e}}initSize(){this.spriteIcon&&this.spriteIcon.center.set(.5,.5)}draw(t){let{ctx:e}=a,{config:{size:n}}=this,r=n[0]/2,i=n[1]/2,o=4,s=1,u=o+s;if(e.clearRect(0,0,n[0],n[1]),e.setLineDash([10,10]),e.strokeStyle="#fff",e.lineWidth=2,e.beginPath(),e.arc(r,i,i-u,-Math.PI/2,Math.PI*2-Math.PI/2,t<Math.PI),e.stroke(),e.strokeStyle="#0A7AFF",t<Math.PI){let l=-Math.PI/2,c=l-t;e.beginPath(),e.arc(r,i,i-u,l,c,!0)}else{let l=-Math.PI/2,c=l+Math.PI*2-t;e.beginPath(),e.arc(r,i,i-u,l,c,!1)}e.stroke(),e.clearRect(r-u*2,0,u*4,u*4),e.beginPath(),e.arc(r,u,o,0,Math.PI*2),e.fillStyle="#0A7AFF",e.fill(),e.setLineDash([10,0]),e.strokeStyle="#fff",e.lineWidth=s,e.stroke(),e.clearRect(0,i-5,10,10),e.clearRect(r-5,n[1]-10,10,10),e.clearRect(n[0]-10,i-5,10,10),t>Math.PI/2&&t<Math.PI?e.fillStyle="#0A7AFF":e.fillStyle="#fff",e.fillRect(0,i-1,10,2),e.fillStyle="#fff",e.fillRect(r-1,n[1]-10,2,10),t>Math.PI&&t<Math.PI/2*3?e.fillStyle="#0A7AFF":e.fillStyle="#fff",e.fillRect(n[0]-10,i-1,10,2)}getImageData(){let{ctx:t}=a,{config:{size:e}}=this;return t.getImageData(0,0,e[0],e[1])}getTexture(t){let{config:{size:e}}=this,n=new Yt.DataTexture(Uint8Array.from(t.data),e[0],e[1],Yt.RGBAFormat);return n.format=Yt.RGBAFormat,n.magFilter=Yt.LinearFilter,n.minFilter=Yt.LinearFilter,n.colorSpace="srgb",n.flipY=!0,n}dispose(){var t;super.dispose(),(t=this.spriteIcon)==null||t.material.dispose()}static dispose(){this.textureMap.forEach(t=>{t.dispose()}),this.textureMap.clear(),this.ctx=null,this.canvas=null}constructor(t,e){super(t.context,{icon_size:e.size,collision_enable:!1,level:2}),this.bmap=t,this.config=e,a.canvas.width=e.size[0],a.canvas.height=e.size[1]}};pe.canvas=document.createElement("canvas");pe.ctx=pe.canvas.getContext("2d",{willReadFrequently:!0});pe.textureMap=new Map;var Nu={path:{},cheapMaximumDistance:20,needStartPoi:!1,startPoi:{},positionNavigation:{},offsetY:150,directionEmitThreshold:5,disablePathAnimation:!1,disablePathRotate:!1,disablePathShorten:!1,speed:1,roadData:[],runAnimationMaxTime:1,navigationCameraBasic:45,canBack:!1},Wi=class extends ut{get curFloorPathLength(){var t,e;return(e=(t=this.curFloorPath)==null?void 0:t.distance)!=null?e:0}get curFloorPathPoints(){var t,e;return(e=(t=this.curFloorPath)==null?void 0:t.points)!=null?e:[]}registryEvent(){this.bmap.context.addEventListener("update",this.onUpdate),this.bmap.addEventListener(_t.SWITCH_FLOOR_GROUND,this.onSwitchFloor),this.positionNavigation.addEventListener("navigation-info",this.onNavigationInfo),this.bmap.context.addEventListener("control-change",this.onControlChangeForStartPoi)}setRoadData(t){this.options.roadData=t,this.positionNavigation.setRoadData(t)}showStartRotateHelperPoi(){var t;if(this.needStartRotateHelperPoi=!0,!this.startPoi||this.startRotateHelperPoi)return;let e=this.startPoi.options.icon_size;this.startRotateHelperPoi=new pe(this.bmap,{size:[e[0]+20,e[1]+20]}),this.startRotateHelperPoi.setAngle(0),this.startRotateHelperPoi.position.setZ(.51),(t=this.bmap.context.currentFloor)==null||t.poiLayer2.pushPoi(this.startRotateHelperPoi)}hideStartRotateHelperPoi(){if(this.needStartRotateHelperPoi=!1,this.startRotateHelperPoi){var t;(t=this.bmap.context.currentFloor)==null||t.poiLayer2.removePoi(this.startRotateHelperPoi),this.startRotateHelperPoi=null}}setStartPoiPosition(t,e){this.startPoi&&(this.startPoi.position.setX(t).setY(e),this.startRotateHelperPoi&&this.startRotateHelperPoi.position.setX(t).setY(e),this.detachLine&&this.detachLine.setPosition(this.startPoi.position,this.detachStartPoi.position))}resetStatus(){this.pauseAnimation(),this.positionNavigation.resetStatus(this.paths),this.movedDistance=0,this.startPoi&&this.translatePath&&this.setStartPoiPosition(this.translatePath[0][0],this.translatePath[0][1])}toPositionByTask(t){var e;let r=(e=this.taskQueue.getTasks().find(o=>o.meta.type==="toPosition"))==null?void 0:e.tid,i={run:()=>this.toPositionBySpeed(t,this.options.speed),meta:{type:"toPosition"}};r?this.taskQueue.replace(r,i):this.taskQueue.add(i)}pauseAnimation(){this.taskQueue.clear(),this.positionNavigation.pause(),this.tweenUtil.pause()}continueAnimation(){this.tweenUtil.continue(),this.positionNavigation.continue()}clearTween(){this.tweenUtil.clear(),this.taskQueue.clear(),this.bmap.context.control.enabled=!0}unRegistryEvent(){this.bmap.context.removeEventListener("update",this.onUpdate),this.bmap.removeEventListener(_t.SWITCH_FLOOR_GROUND,this.onSwitchFloor),this.positionNavigation.removeEventListener("navigation-info",this.onNavigationInfo),this.bmap.context.removeEventListener("control-change",this.onControlChangeForStartPoi)}clearPath(){if(this.resetStatus(),this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose(),this.path=null,this.clearTween()),this.startPoi){var t;if((t=this.bmap.context.currentFloor)==null||t.poiLayer2.removePoi(this.startPoi),this.startPoi=null,this.startRotateHelperPoi){var e;(e=this.bmap.context.currentFloor)==null||e.poiLayer2.removePoi(this.startRotateHelperPoi),this.startRotateHelperPoi=null}}if(this.detachStartPoi){var n;(n=this.bmap.context.currentFloor)==null||n.removePoi2(this.detachStartPoi),this.detachStartPoi=null}this.detachLine&&(this.bmap.context.scene.remove(this.detachLine),this.detachLine.dispose(),this.detachLine=null),this.translatePath=null}setCurFloorPath(t){t===null?(this.curFloorPath=null,this.currentPathPosition=null,this.toPointPosition=null):(this.curFloorPath=t,this.currentPathPosition=t.points[0],this.toPointPosition=t.points[0]),this.movedDistance=0,this.clearTween()}setCurPathIndex(t){var e,n;this.curPathIndex=t,((e=this.paths[t])==null?void 0:e.floor)===((n=this.bmap.context.currentFloor)==null?void 0:n.name)?(this.setCurFloorPath(this.paths[t]),this.renderPath(this.translatePoints(this.curFloorPathPoints))):this.clearPath()}addPath(t,e){e===void 0&&(e=0);var n;this.paths=t,this.curPathIndex=e,this.clearTween(),this.clearPath();let r=(n=this.bmap.context.currentFloor)==null?void 0:n.name,i=t[e];if(r&&(i==null?void 0:i.floor)===r)if(this.setCurFloorPath(i),this.bmap.currentBuildGround)this.renderPath(this.translatePoints(i.points));else{let o=()=>{this.bmap.removeEventListener("center-change",o),this.renderPath(this.translatePoints(i.points))};this.bmap.addEventListener("center-change",o)}this.dispatchEvent({type:"add-path",paths:t})}translatePoints(t){let[e,n]=this.bmap.buildingCenter;return t.map(r=>[r[0]-e,r[1]-n])}renderPath(t){this.translatePath=t;let e=this.catmullRomCurve3(t);if(this.cPath=e,this.animationPathOptions={cPathIndex:0},this.pathStart=e[0],this.path?this.path.updatePoints(e):(this.path=new Ur(this,this.options.path),this.path.create(e),this.path.position.z=this.bmap.context.currentFloor.groundMaxHeight+.5,this.bmap.context.scene.add(this.path)),this.path.movePath(0),this.startPoi){var n;if((n=this.bmap.context.currentFloor)==null||n.poiLayer2.removePoi(this.startPoi),this.startPoi=null,this.startRotateHelperPoi){var r;(r=this.bmap.context.currentFloor)==null||r.poiLayer2.removePoi(this.startRotateHelperPoi),this.startRotateHelperPoi=null}}if(this.removeDetachStart(),this.showDetachStartState&&this.options.detachStartPoi){var i;this.detachStartPoi=new et(this.bmap.context,x({},this.options.detachStartPoi,{id:"navigation_detach_start_poi",position:{x:e[0][0],y:e[0][1],z:.51},collision_enable:!1}))||null,(i=this.bmap.context.currentFloor)==null||i.poiLayer2.pushPoi(this.detachStartPoi),this.detachLine=new qe(this.bmap.context,new Nt.Vector3(e[0][0],e[0][1],.51),new Nt.Vector3(e[0][0],e[0][1],.51)),this.bmap.context.scene.add(this.detachLine)}if(this.options.needStartPoi){var o;this.startPoi=new et(this.bmap.context,x({},this.options.startPoi,{id:"navigation_start_poi",position:{x:e[0][0],y:e[0][1],z:.51},collision_enable:!1}))||null,(o=this.bmap.context.currentFloor)==null||o.poiLayer2.pushPoi(this.startPoi),this.needStartRotateHelperPoi&&this.showStartRotateHelperPoi(),console.log(this.startRotateHelperPoi)}this.dispatchEvent({type:"render-path",path:this.path})}catmullRomCurve3(t){return gn(t,!1,!0,.1,170,2.5)}getPathDirection(){if(!this.curFloorPath||!this.currentPathPosition||this.curFloorPathPoints.length<2)return null;let t=Qt(this.curFloorPathPoints,this.currentPathPosition),e=this.curFloorPathPoints[t],n=this.curFloorPathPoints[t+1],r=new Nt.Vector3(n[0]-e[0],n[1]-e[1],0).normalize(),i=new Nt.Vector3(0,1,0).normalize(),o=r.angleTo(i),s=new Nt.Vector3().crossVectors(i,r);return(Object.is(s.y,0)?-1:1)*o}getPathDirection2(){if(!this.curFloorPath||!this.toPointPosition||this.curFloorPathPoints.length<2)return null;let t=Qt(this.curFloorPathPoints,this.toPointPosition),e=this.curFloorPathPoints[t],n=this.curFloorPathPoints[t+1];return(new Nt.Vector2(n[0]-e[0],n[1]-e[1]).normalize().angle()*180/Math.PI-90+360)%360}changeCameraToPathUp(t){return g(this,null,function*(){t===void 0&&(t=100);let e=this.getPathDirection();if(e===null)return;let n=this.bmap.context.control.getAzimuthalAngle();Math.abs(n-e)>Math.PI&&(n>0?e=Math.PI*2+e:e=e-Math.PI*2);let r=Math.abs(e-this.bmap.context.control.getAzimuthalAngle());if(r<.01)return;let{control:i}=this.bmap.context,o=t/Math.PI*6*r;return Ft(new Promise(s=>{let u={azimuthal:i.getAzimuthalAngle()},l={azimuthal:e},c=i.getPolarAngle(),{maxPolarAngle:h,minPolarAngle:p}=i;i.maxPolarAngle=c,i.minPolarAngle=c;let f=new Qe.Tween(u,this.tweenUtil.group).to(l,o).easing(Qe.Easing.Quadratic.InOut).onUpdate(()=>g(this,null,function*(){this.startPoi&&i.target.copy(this.startPoi.position),i.setAzimuthalAngle(u.azimuthal,!0),i.setTargetByOffset(this.options.offsetY)})).onComplete(()=>{i.enabled=!0,this.tweenUtil.remove(f),i.maxPolarAngle=h,i.minPolarAngle=p,s(!0)}).onStart(()=>{i.enabled=!1}).start()}),o+500).finally(()=>{this.bmap.context.control.enabled=!0})})}initNavigationCamera(t){return g(this,null,function*(){t===void 0&&(t=1e3);var e;let r=(e=this.taskQueue.getTasks().find(o=>o.meta.type==="initNavigationCamera"))==null?void 0:e.tid,i={run:()=>Ft(g(this,null,function*(){yield this.initCameraZoom(t/2),this.options.disablePathRotate||(yield this.changeCameraToPathUp(t/4)),yield this.translateCameraToStartPoi(t/(this.options.disablePathRotate?2:4))}),t+500).finally(()=>{this.bmap.context.control.enabled=!0}),meta:{type:"initNavigationCamera"}};r?this.taskQueue.replace(r,i):this.taskQueue.add(i)})}translateCameraToStartPoi(t){return g(this,null,function*(){if(t===void 0&&(t=100),!this.startPoi)return;let{clientSize:{width:e,height:n},camera:r,control:i}=this.bmap.context,o=Math.round(e/2),s=Math.round(n/2),u=i.target.clone(),l=I(this.startPoi.position,r,e,n),c=l.x-o,h=s-l.y+this.options.offsetY;if(!(Math.abs(c)<=1&&Math.abs(h)<=1)){if(Math.abs(c)>=1){let p=new Nt.Vector3;p.setFromMatrixColumn(r.matrix,0),p.normalize(),p.multiplyScalar(c/r.zoom),u.add(new Nt.Vector3(p.x,p.y,0))}if(Math.abs(h)>=1){let p=new Nt.Vector3;p.setFromMatrixColumn(r.matrix,1),p.normalize(),p.multiplyScalar(h/r.zoom),u.add(new Nt.Vector3(p.x,p.y,0))}return Ft(new Promise(p=>{let f=i.target.clone();console.log(f,u,t);let d=new Qe.Tween(f,this.tweenUtil.group).to(u,t).onUpdate(()=>{this.bmap.context.control.setCameraPositionByTarget(f,0)}).onComplete(()=>{this.bmap.context.control.setCameraPositionByTarget(u,0),this.tweenUtil.remove(d),this.bmap.context.control.enabled=!0,p(!0)}).onStart(()=>{this.bmap.context.control.enabled=!1}).start()}),t+500).then(()=>{this.bmap.context.control.enabled=!0})}})}initCameraZoom(t){return g(this,null,function*(){if(t===void 0&&(t=100),!this.startPoi)return;let{clientSize:{width:e,height:n},currentFloor:r}=this.bmap.context,{max:i,min:o}=r.box,u=Math.min(e/(i.x-o.x),n/(i.y-o.y))*(i.x-o.x)/this.options.navigationCameraBasic;return this.bmap.context.setZoom(u,this.startPoi.position,t).finally(()=>{this.bmap.context.control.enabled=!0})})}toPosition(t,e){if(this.paths[this.curPathIndex]&&this.paths[this.curPathIndex].floor===t&&this.detachStartPoi){let n=this.translatePoints([e]);this.detachStartPoi.position.setX(n[0][0]),this.detachStartPoi.position.setY(n[0][1]),this.detachLine&&this.startPoi&&this.detachLine.setPosition(this.startPoi.position,this.detachStartPoi.position)}this.options.canBack&&(this.positionNavigation.pointIndex=0,this.positionNavigation.position=this.paths[this.curPathIndex].points[0]),this.positionNavigation.toPosition(t,e)}startSimulation(){this.positionNavigation.startSimulation()}setSimulationSpeed(t){this.positionNavigation.changeSimulationSpeed(t)}toPositionBySpeed(t,e){return g(this,null,function*(){let{currentPathPosition:n,curFloorPath:r,curFloorPathPoints:i}=this;if(!r||!n)return null;let o=this.movedDistance,s=di(i,t);if(o===-1||s===-1||!this.options.canBack&&s<=o)return null;let u=s-o;if(!u)return;let l=Math.min(Math.abs(u)/e,this.options.runAnimationMaxTime);return this.pathTween&&this.clearTween(),Ft(new Promise(c=>{let h=this.pathTween=new Qe.Tween({distance:0},this.tweenUtil.group).to({distance:u},l*1e3).onUpdate(p=>g(this,null,function*(){this.moveDistance(p.distance+o,h)})).onComplete(()=>{this.tweenUtil.remove(h),c(!0)}).start()}),l*1e3+500).finally(()=>{this.bmap.context.control.enabled=!0})})}moveDistance(t,e){return g(this,null,function*(){if(this.movedDistance=t,!this.options.disablePathShorten){var n;(n=this.path)==null||n.movePath(this.movedDistance/this.curFloorPathLength)}let r=Ie(this.curFloorPathPoints,this.movedDistance);if(r===null)return;this.currentPathPosition=r;let i=this.translatePoints([r])[0];this.startPoi&&(this.setStartPoiPosition(i[0],i[1]),this.options.disablePathAnimation||this.bmap.context.control.setTargetByOffset(this.options.offsetY,this.startPoi.position.clone())),!this.options.disablePathAnimation&&!this.options.disablePathRotate&&(e==null||e.pause(),yield this.changeCameraToPathUp(500/this.options.speed),e==null||e.resume())})}removeDetachStart(){if(this.detachLine&&(this.bmap.context.scene.remove(this.detachLine),this.detachLine.dispose(),this.detachLine=null),this.detachStartPoi){var t;(t=this.bmap.context.currentFloor)==null||t.poiLayer2.removePoi(this.detachStartPoi),this.detachStartPoi=null}}hideDetachStart(){this.showDetachStartState=!1,this.removeDetachStart()}showDetachStart(){if(this.showDetachStartState=!0,this.path&&this.startPoi&&this.options.detachStartPoi){var t;let e=this.startPoi.position;this.detachStartPoi=new et(this.bmap.context,x({},this.options.detachStartPoi,{id:"navigation_detach_start_poi",position:e,collision_enable:!1}))||null,(t=this.bmap.context.currentFloor)==null||t.poiLayer2.pushPoi(this.detachStartPoi),this.detachLine=new qe(this.bmap.context,new Nt.Vector3(e.x,e.y,.51),new Nt.Vector3(e.x,e.y,.51)),this.bmap.context.scene.add(this.detachLine)}}setStartPoiRotate(t){this.startPoiRotate=t;let n=(this.bmap.context.control.getAzimuthalAngle()*180/Math.PI+360)%360,r=(360-t-n)%360;this.detachStartPoi&&(this.detachStartPoi.options.icon_rotate=r),this.startPoi&&(this.startPoi.options.icon_rotate=r,this.startRotateHelperPoi&&this.startRotateHelperPoi.setAngle(r))}dispose(){var t;if(this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose()),this.hideDetachStart(),this.startPoi){var e;(e=this.bmap.context.currentFloor)==null||e.poiLayer2.removePoi(this.startPoi),this.startPoi=null}this.tweenUtil.dispose(),this.unRegistryEvent(),(t=this.startRotateHelperPoi)==null||t.dispose(),pe.dispose(),this.positionNavigation.dispose(),this.startRotateHelperPoi=null,super.dispose()}constructor(t,e={},n){super(t),this.path=null,this.fetchRoadStatus=!1,this.paths=[],this.curPathIndex=0,this.curFloorPath=null,this.translatePath=null,this.currentPathPosition=null,this.toPointPosition=null,this.pathTween=null,this.startPoi=null,this.detachStartPoi=null,this.detachLine=null,this.startPoiRotate=null,this.startRotateHelperPoi=null,this.needStartRotateHelperPoi=!1,this.showDetachStartState=!0,this.movedDistance=0,this.pathStart=[0,0],this.tweenUtil=new le,this.taskQueue=new Ne,this.animationPathOptions={cPathIndex:0},this.cPath=[],this.onNavigationInfo=r=>{let{info:i}=r;if(this.dispatchEvent({type:"navigation-info",info:i}),!i.offset){if(i.routeIndex!==this.curPathIndex)return;this.toPointPosition=i.pos,this.toPositionByTask(i.pos)}},this.onUpdate=()=>{this.tweenUtil.update()},this.onSwitchFloor=r=>{let{data:{curFloor:i}}=r;if(this.clearTween(),this.paths[this.curPathIndex]){let o=this.paths[this.curPathIndex];this.setCurFloorPath(o!=null?o:null),o?this.renderPath(this.translatePoints(o.points)):this.clearPath()}else this.clearPath()},this.onControlChangeForStartPoi=()=>{this.startPoi&&this.startPoiRotate!==null&&this.setStartPoiRotate(this.startPoiRotate)},!n&&typeof e=="object"&&(n=e),this.options=Object.assign({},Nu,n),this.positionNavigation=new Fr(this,x({simulationSpeed:this.options.speed},this.options.positionNavigation),this.options.roadData),this.registryEvent()}};var Qy=require("core-js/modules/web.dom-collections.iterator.js");var Be=require("three"),Xi=class extends ut{show(t,e){let n=0;t.forEach(o=>{o.poiLayer2.pois.forEach(s=>{s.position.setZ(s.position.z+n+o.groundMaxHeight),s.options.depth_test=!0,this.poiLayer.pushPoi(s)}),o.poiLayer2.pois.length=0,o.poiLayer2.dispose(),o.position.z=n,n+=o.userData.height});let{scene:r,currentFloor:i}=this.bmap.context;r.background=new Be.Color((e==null?void 0:e.backgroundColor)||"#f1f7f6"),i&&(r.remove(i),i.dispose()),this.group.add(this.poiLayer,...t),this.poiLayer.onAddToScene(),r.add(this.group),this.floors=t,this.fitCamera(),this.bmap.context.cameraBound.updateBox(),this.showStatus=!0}showStep(t,e){let n=0;t.forEach(l=>{l.position.z=n,n+=l.userData.height});let{scene:r,currentFloor:i}=this.bmap.context;r.background=new Be.Color((e==null?void 0:e.backgroundColor)||"#f1f7f6"),i&&(r.remove(i),i.dispose()),this.group.add(this.poiLayer,...t),this.poiLayer.onAddToScene(),r.add(this.group),this.floors=t,this.fitCamera(),this.bmap.context.cameraBound.updateBox(),this.showStatus=!0;let o=()=>{t.some(l=>l.poiLayer2.pois.length>0)?u():requestAnimationFrame(o)},s=null,u=()=>{let l=!1;n=0,t.forEach(c=>{let h=c.poiLayer2.pois.splice(0,c.poiLayer2.pois.length);h.length>0&&(l=!0,h.forEach(p=>{p.position.setZ(p.position.z+n+c.groundMaxHeight),p.options.depth_test=!0,p.visible=!0,p.spriteIcon&&(p.spriteIcon.visible=!0),p.spriteText&&(p.spriteText.visible=!0),this.poiLayer.pushPoi(p)})),c.position.z=n,n+=c.userData.height}),l&&(this.poiLayer.onAddToScene(),this.bmap.context.cameraBound.updateBox(),this.fitCamera()),t.some(c=>c.poiLayer2.pois.length>0)?s=setTimeout(u,1e3):s&&clearTimeout(s)};o()}hide(){let{scene:t}=this.bmap.context;this.poiLayer.onRemoveFromScene(),t.remove(this.group),this.poiLayer.clear(),this.floors.forEach(e=>{e.dispose()}),this.floors=[],this.group.clear(),this.showStatus=!1}fitCamera(){let{context:t,config:e,type:n}=this.bmap;t.cameraBound.setEnable(!1),t.control.minZoom=0,t.control.maxZoom=1/0,t.camera.zoom=1,t.setAzimuthalAngle(e.control.defaultAzimuthal,0),t.setPolarAngle(e.control.defaultPolar,0),t.fitCameraToObject(this.group,e.defaultPadding,0,!1);let r=t.camera.zoom;t.control.minZoom=r,t.control.maxZoom=r*e.control.maxZoomScale,this.bmap.basicZoom=t.camera.zoom,t.control.addEventListener("change",this.bmap.onControlChange),this.bmap.onControlChange(),t.cameraBound.setEnable(!0)}dispose(){this.poiLayer.dispose(),this.floors.forEach(t=>t.dispose()),this.floors=[],super.dispose()}constructor(t){super(t),this.floors=[],this.group=new Be.Group,this.showStatus=!1,this.group.name="mul-floor-group",this.poiLayer=new De(t.context),this.poiLayer.changeParkingSpaceVisibleByZoom=()=>{let e=new Be.Box3().setFromObject(this.group),{clientSize:{width:n,height:r}}=this.bmap.context,{max:i,min:o}=e,u=Math.min(n/(i.x-o.x),r/(i.y-o.y))*(i.x-o.x)/45;this.poiLayer.pois.filter(l=>l.userData.type==="parkingSpace").map(l=>{let c=this.bmap.context.camera.zoom>=u;l.visible=c,c||l.parentSetVisible(c)})}}};var Ks=require("three");function qi(){let a=new Blob([`var RU=Object.create;var xE=Object.defineProperty;var LU=Object.getOwnPropertyDescriptor;var NU=Object.getOwnPropertyNames;var OU=Object.getPrototypeOf,DU=Object.prototype.hasOwnProperty;var ot=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var FU=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of NU(t))!DU.call(n,s)&&s!==e&&xE(n,s,{get:()=>t[s],enumerable:!(o=LU(t,s))||o.enumerable});return n};var Je=(n,t,e)=>(e=n!=null?RU(OU(n)):{},FU(t||!n||!n.__esModule?xE(e,"default",{value:n,enumerable:!0}):e,n));var pp=(n,t,e)=>new Promise((o,s)=>{var l=g=>{try{h(e.next(g))}catch(m){s(m)}},p=g=>{try{h(e.throw(g))}catch(m){s(m)}},h=g=>g.done?o(g.value):Promise.resolve(g.value).then(l,p);h((e=e.apply(n,t)).next())});var so=ot((Vm,EE)=>{"use strict";var Uf=function(n){return n&&n.Math===Math&&n};EE.exports=Uf(typeof globalThis=="object"&&globalThis)||Uf(typeof window=="object"&&window)||Uf(typeof self=="object"&&self)||Uf(typeof global=="object"&&global)||Uf(typeof Vm=="object"&&Vm)||function(){return this}()||Function("return this")()});var SE=ot((sj,wE)=>{"use strict";wE.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 Ui=ot((aj,ME)=>{"use strict";var Wm=typeof document=="object"&&document.all;ME.exports=typeof Wm=="undefined"&&Wm!==void 0?function(n){return typeof n=="function"||n===Wm}:function(n){return typeof n=="function"}});var Ys=ot((uj,bE)=>{"use strict";var UU=Ui();bE.exports=function(n){return typeof n=="object"?n!==null:UU(n)}});var dp=ot((lj,TE)=>{"use strict";var BU=so(),AE=Ys(),Xm=BU.document,zU=AE(Xm)&&AE(Xm.createElement);TE.exports=function(n){return zU?Xm.createElement(n):{}}});var IE=ot((cj,PE)=>{"use strict";var GU=dp(),Ym=GU("span").classList,CE=Ym&&Ym.constructor&&Ym.constructor.prototype;PE.exports=CE===Object.prototype?void 0:CE});var mi=ot((fj,RE)=>{"use strict";RE.exports=function(n){try{return!!n()}catch(t){return!0}}});var Bf=ot((hj,LE)=>{"use strict";var kU=mi();LE.exports=!kU(function(){var n=function(){}.bind();return typeof n!="function"||n.hasOwnProperty("prototype")})});var yi=ot((pj,DE)=>{"use strict";var NE=Bf(),OE=Function.prototype,$m=OE.call,qU=NE&&OE.bind.bind($m,$m);DE.exports=NE?qU:function(n){return function(){return $m.apply(n,arguments)}}});var ac=ot((dj,UE)=>{"use strict";var FE=yi(),HU=FE({}.toString),VU=FE("".slice);UE.exports=function(n){return VU(HU(n),8,-1)}});var zE=ot((gj,BE)=>{"use strict";var WU=yi(),XU=mi(),YU=ac(),Zm=Object,$U=WU("".split);BE.exports=XU(function(){return!Zm("z").propertyIsEnumerable(0)})?function(n){return YU(n)==="String"?$U(n,""):Zm(n)}:Zm});var Jm=ot((mj,GE)=>{"use strict";GE.exports=function(n){return n==null}});var uc=ot((yj,kE)=>{"use strict";var ZU=Jm(),JU=TypeError;kE.exports=function(n){if(ZU(n))throw new JU("Can't call method on "+n);return n}});var lc=ot((vj,qE)=>{"use strict";var KU=zE(),jU=uc();qE.exports=function(n){return KU(jU(n))}});var zf=ot((_j,HE)=>{"use strict";HE.exports=!1});var gp=ot((xj,WE)=>{"use strict";var VE=so(),QU=Object.defineProperty;WE.exports=function(n,t){try{QU(VE,n,{value:t,configurable:!0,writable:!0})}catch(e){VE[n]=t}return t}});var mp=ot((Ej,$E)=>{"use strict";var tB=zf(),eB=so(),nB=gp(),XE="__core-js_shared__",YE=$E.exports=eB[XE]||nB(XE,{});(YE.versions||(YE.versions=[])).push({version:"3.42.0",mode:tB?"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 yp=ot((wj,JE)=>{"use strict";var ZE=mp();JE.exports=function(n,t){return ZE[n]||(ZE[n]=t||{})}});var cc=ot((Sj,KE)=>{"use strict";var rB=uc(),iB=Object;KE.exports=function(n){return iB(rB(n))}});var Ma=ot((Mj,jE)=>{"use strict";var oB=yi(),sB=cc(),aB=oB({}.hasOwnProperty);jE.exports=Object.hasOwn||function(t,e){return aB(sB(t),e)}});var Km=ot((bj,QE)=>{"use strict";var uB=yi(),lB=0,cB=Math.random(),fB=uB(1 .toString);QE.exports=function(n){return"Symbol("+(n===void 0?"":n)+")_"+fB(++lB+cB,36)}});var rw=ot((Aj,nw)=>{"use strict";var hB=so(),tw=hB.navigator,ew=tw&&tw.userAgent;nw.exports=ew?String(ew):""});var cw=ot((Tj,lw)=>{"use strict";var uw=so(),jm=rw(),iw=uw.process,ow=uw.Deno,sw=iw&&iw.versions||ow&&ow.version,aw=sw&&sw.v8,$s,vp;aw&&($s=aw.split("."),vp=$s[0]>0&&$s[0]<4?1:+($s[0]+$s[1]));!vp&&jm&&($s=jm.match(/Edge\\/(\\d+)/),(!$s||$s[1]>=74)&&($s=jm.match(/Chrome\\/(\\d+)/),$s&&(vp=+$s[1])));lw.exports=vp});var Qm=ot((Cj,hw)=>{"use strict";var fw=cw(),pB=mi(),dB=so(),gB=dB.String;hw.exports=!!Object.getOwnPropertySymbols&&!pB(function(){var n=Symbol("symbol detection");return!gB(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&fw&&fw<41})});var t0=ot((Pj,pw)=>{"use strict";var mB=Qm();pw.exports=mB&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Ns=ot((Ij,gw)=>{"use strict";var yB=so(),vB=yp(),dw=Ma(),_B=Km(),xB=Qm(),EB=t0(),fc=yB.Symbol,e0=vB("wks"),wB=EB?fc.for||fc:fc&&fc.withoutSetter||_B;gw.exports=function(n){return dw(e0,n)||(e0[n]=xB&&dw(fc,n)?fc[n]:wB("Symbol."+n)),e0[n]}});var ba=ot((Rj,mw)=>{"use strict";var SB=Ys(),MB=String,bB=TypeError;mw.exports=function(n){if(SB(n))return n;throw new bB(MB(n)+" is not an object")}});var Zs=ot((Lj,yw)=>{"use strict";var AB=mi();yw.exports=!AB(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var n0=ot((Nj,vw)=>{"use strict";var TB=Zs(),CB=mi();vw.exports=TB&&CB(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var r0=ot((Oj,_w)=>{"use strict";var PB=Zs(),IB=mi(),RB=dp();_w.exports=!PB&&!IB(function(){return Object.defineProperty(RB("div"),"a",{get:function(){return 7}}).a!==7})});var Os=ot((Dj,xw)=>{"use strict";var LB=Bf(),_p=Function.prototype.call;xw.exports=LB?_p.bind(_p):function(){return _p.apply(_p,arguments)}});var hc=ot((Fj,Ew)=>{"use strict";var i0=so(),NB=Ui(),OB=function(n){return NB(n)?n:void 0};Ew.exports=function(n,t){return arguments.length<2?OB(i0[n]):i0[n]&&i0[n][t]}});var Sw=ot((Uj,ww)=>{"use strict";var DB=yi();ww.exports=DB({}.isPrototypeOf)});var o0=ot((Bj,Mw)=>{"use strict";var FB=hc(),UB=Ui(),BB=Sw(),zB=t0(),GB=Object;Mw.exports=zB?function(n){return typeof n=="symbol"}:function(n){var t=FB("Symbol");return UB(t)&&BB(t.prototype,GB(n))}});var Aw=ot((zj,bw)=>{"use strict";var kB=String;bw.exports=function(n){try{return kB(n)}catch(t){return"Object"}}});var Gf=ot((Gj,Tw)=>{"use strict";var qB=Ui(),HB=Aw(),VB=TypeError;Tw.exports=function(n){if(qB(n))return n;throw new VB(HB(n)+" is not a function")}});var xp=ot((kj,Cw)=>{"use strict";var WB=Gf(),XB=Jm();Cw.exports=function(n,t){var e=n[t];return XB(e)?void 0:WB(e)}});var Iw=ot((qj,Pw)=>{"use strict";var s0=Os(),a0=Ui(),u0=Ys(),YB=TypeError;Pw.exports=function(n,t){var e,o;if(t==="string"&&a0(e=n.toString)&&!u0(o=s0(e,n))||a0(e=n.valueOf)&&!u0(o=s0(e,n))||t!=="string"&&a0(e=n.toString)&&!u0(o=s0(e,n)))return o;throw new YB("Can't convert object to primitive value")}});var Ow=ot((Hj,Nw)=>{"use strict";var $B=Os(),Rw=Ys(),Lw=o0(),ZB=xp(),JB=Iw(),KB=Ns(),jB=TypeError,QB=KB("toPrimitive");Nw.exports=function(n,t){if(!Rw(n)||Lw(n))return n;var e=ZB(n,QB),o;if(e){if(t===void 0&&(t="default"),o=$B(e,n,t),!Rw(o)||Lw(o))return o;throw new jB("Can't convert object to primitive value")}return t===void 0&&(t="number"),JB(n,t)}});var l0=ot((Vj,Dw)=>{"use strict";var tz=Ow(),ez=o0();Dw.exports=function(n){var t=tz(n,"string");return ez(t)?t:t+""}});var Lu=ot(Uw=>{"use strict";var nz=Zs(),rz=r0(),iz=n0(),Ep=ba(),Fw=l0(),oz=TypeError,c0=Object.defineProperty,sz=Object.getOwnPropertyDescriptor,f0="enumerable",h0="configurable",p0="writable";Uw.f=nz?iz?function(t,e,o){if(Ep(t),e=Fw(e),Ep(o),typeof t=="function"&&e==="prototype"&&"value"in o&&p0 in o&&!o[p0]){var s=sz(t,e);s&&s[p0]&&(t[e]=o.value,o={configurable:h0 in o?o[h0]:s[h0],enumerable:f0 in o?o[f0]:s[f0],writable:!1})}return c0(t,e,o)}:c0:function(t,e,o){if(Ep(t),e=Fw(e),Ep(o),rz)try{return c0(t,e,o)}catch(s){}if("get"in o||"set"in o)throw new oz("Accessors not supported");return"value"in o&&(t[e]=o.value),t}});var zw=ot((Xj,Bw)=>{"use strict";var az=Math.ceil,uz=Math.floor;Bw.exports=Math.trunc||function(t){var e=+t;return(e>0?uz:az)(e)}});var El=ot((Yj,Gw)=>{"use strict";var lz=zw();Gw.exports=function(n){var t=+n;return t!==t||t===0?0:lz(t)}});var qw=ot(($j,kw)=>{"use strict";var cz=El(),fz=Math.max,hz=Math.min;kw.exports=function(n,t){var e=cz(n);return e<0?fz(e+t,0):hz(e,t)}});var d0=ot((Zj,Hw)=>{"use strict";var pz=El(),dz=Math.min;Hw.exports=function(n){var t=pz(n);return t>0?dz(t,9007199254740991):0}});var kf=ot((Jj,Vw)=>{"use strict";var gz=d0();Vw.exports=function(n){return gz(n.length)}});var Yw=ot((Kj,Xw)=>{"use strict";var mz=lc(),yz=qw(),vz=kf(),Ww=function(n){return function(t,e,o){var s=mz(t),l=vz(s);if(l===0)return!n&&-1;var p=yz(o,l),h;if(n&&e!==e){for(;l>p;)if(h=s[p++],h!==h)return!0}else for(;l>p;p++)if((n||p in s)&&s[p]===e)return n||p||0;return!n&&-1}};Xw.exports={includes:Ww(!0),indexOf:Ww(!1)}});var wp=ot((jj,$w)=>{"use strict";$w.exports={}});var m0=ot((Qj,Jw)=>{"use strict";var _z=yi(),g0=Ma(),xz=lc(),Ez=Yw().indexOf,wz=wp(),Zw=_z([].push);Jw.exports=function(n,t){var e=xz(n),o=0,s=[],l;for(l in e)!g0(wz,l)&&g0(e,l)&&Zw(s,l);for(;t.length>o;)g0(e,l=t[o++])&&(~Ez(s,l)||Zw(s,l));return s}});var Sp=ot((tQ,Kw)=>{"use strict";Kw.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Qw=ot((eQ,jw)=>{"use strict";var Sz=m0(),Mz=Sp();jw.exports=Object.keys||function(t){return Sz(t,Mz)}});var eS=ot(tS=>{"use strict";var bz=Zs(),Az=n0(),Tz=Lu(),Cz=ba(),Pz=lc(),Iz=Qw();tS.f=bz&&!Az?Object.defineProperties:function(t,e){Cz(t);for(var o=Pz(e),s=Iz(e),l=s.length,p=0,h;l>p;)Tz.f(t,h=s[p++],o[h]);return t}});var rS=ot((rQ,nS)=>{"use strict";var Rz=hc();nS.exports=Rz("document","documentElement")});var Mp=ot((iQ,oS)=>{"use strict";var Lz=yp(),Nz=Km(),iS=Lz("keys");oS.exports=function(n){return iS[n]||(iS[n]=Nz(n))}});var qf=ot((oQ,hS)=>{"use strict";var Oz=ba(),Dz=eS(),sS=Sp(),Fz=wp(),Uz=rS(),Bz=dp(),zz=Mp(),aS=">",uS="<",v0="prototype",_0="script",cS=zz("IE_PROTO"),y0=function(){},fS=function(n){return uS+_0+aS+n+uS+"/"+_0+aS},lS=function(n){n.write(fS("")),n.close();var t=n.parentWindow.Object;return n=null,t},Gz=function(){var n=Bz("iframe"),t="java"+_0+":",e;return n.style.display="none",Uz.appendChild(n),n.src=String(t),e=n.contentWindow.document,e.open(),e.write(fS("document.F=Object")),e.close(),e.F},bp,Ap=function(){try{bp=new ActiveXObject("htmlfile")}catch(t){}Ap=typeof document!="undefined"?document.domain&&bp?lS(bp):Gz():lS(bp);for(var n=sS.length;n--;)delete Ap[v0][sS[n]];return Ap()};Fz[cS]=!0;hS.exports=Object.create||function(t,e){var o;return t!==null?(y0[v0]=Oz(t),o=new y0,y0[v0]=null,o[cS]=t):o=Ap(),e===void 0?o:Dz.f(o,e)}});var w0=ot((sQ,pS)=>{"use strict";var kz=Ns(),qz=qf(),Hz=Lu().f,x0=kz("unscopables"),E0=Array.prototype;E0[x0]===void 0&&Hz(E0,x0,{configurable:!0,value:qz(null)});pS.exports=function(n){E0[x0][n]=!0}});var Tp=ot((aQ,dS)=>{"use strict";dS.exports={}});var yS=ot((uQ,mS)=>{"use strict";var Vz=so(),Wz=Ui(),gS=Vz.WeakMap;mS.exports=Wz(gS)&&/native code/.test(String(gS))});var Cp=ot((lQ,vS)=>{"use strict";vS.exports=function(n,t){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:t}}});var pc=ot((cQ,_S)=>{"use strict";var Xz=Zs(),Yz=Lu(),$z=Cp();_S.exports=Xz?function(n,t,e){return Yz.f(n,t,$z(1,e))}:function(n,t,e){return n[t]=e,n}});var Rp=ot((fQ,wS)=>{"use strict";var Zz=yS(),ES=so(),Jz=Ys(),Kz=pc(),S0=Ma(),M0=mp(),jz=Mp(),Qz=wp(),xS="Object already initialized",b0=ES.TypeError,tG=ES.WeakMap,Pp,Hf,Ip,eG=function(n){return Ip(n)?Hf(n):Pp(n,{})},nG=function(n){return function(t){var e;if(!Jz(t)||(e=Hf(t)).type!==n)throw new b0("Incompatible receiver, "+n+" required");return e}};Zz||M0.state?(Js=M0.state||(M0.state=new tG),Js.get=Js.get,Js.has=Js.has,Js.set=Js.set,Pp=function(n,t){if(Js.has(n))throw new b0(xS);return t.facade=n,Js.set(n,t),t},Hf=function(n){return Js.get(n)||{}},Ip=function(n){return Js.has(n)}):(wl=jz("state"),Qz[wl]=!0,Pp=function(n,t){if(S0(n,wl))throw new b0(xS);return t.facade=n,Kz(n,wl,t),t},Hf=function(n){return S0(n,wl)?n[wl]:{}},Ip=function(n){return S0(n,wl)});var Js,wl;wS.exports={set:Pp,get:Hf,has:Ip,enforce:eG,getterFor:nG}});var AS=ot(bS=>{"use strict";var SS={}.propertyIsEnumerable,MS=Object.getOwnPropertyDescriptor,rG=MS&&!SS.call({1:2},1);bS.f=rG?function(t){var e=MS(this,t);return!!e&&e.enumerable}:SS});var A0=ot(CS=>{"use strict";var iG=Zs(),oG=Os(),sG=AS(),aG=Cp(),uG=lc(),lG=l0(),cG=Ma(),fG=r0(),TS=Object.getOwnPropertyDescriptor;CS.f=iG?TS:function(t,e){if(t=uG(t),e=lG(e),fG)try{return TS(t,e)}catch(o){}if(cG(t,e))return aG(!oG(sG.f,t,e),t[e])}});var P0=ot((dQ,IS)=>{"use strict";var T0=Zs(),hG=Ma(),PS=Function.prototype,pG=T0&&Object.getOwnPropertyDescriptor,C0=hG(PS,"name"),dG=C0&&function(){}.name==="something",gG=C0&&(!T0||T0&&pG(PS,"name").configurable);IS.exports={EXISTS:C0,PROPER:dG,CONFIGURABLE:gG}});var R0=ot((gQ,RS)=>{"use strict";var mG=yi(),yG=Ui(),I0=mp(),vG=mG(Function.toString);yG(I0.inspectSource)||(I0.inspectSource=function(n){return vG(n)});RS.exports=I0.inspectSource});var DS=ot((mQ,OS)=>{"use strict";var N0=yi(),_G=mi(),xG=Ui(),Lp=Ma(),L0=Zs(),EG=P0().CONFIGURABLE,wG=R0(),NS=Rp(),SG=NS.enforce,MG=NS.get,LS=String,Np=Object.defineProperty,bG=N0("".slice),AG=N0("".replace),TG=N0([].join),CG=L0&&!_G(function(){return Np(function(){},"length",{value:8}).length!==8}),PG=String(String).split("String"),IG=OS.exports=function(n,t,e){bG(LS(t),0,7)==="Symbol("&&(t="["+AG(LS(t),/^Symbol\\(([^)]*)\\).*$/,"$1")+"]"),e&&e.getter&&(t="get "+t),e&&e.setter&&(t="set "+t),(!Lp(n,"name")||EG&&n.name!==t)&&(L0?Np(n,"name",{value:t,configurable:!0}):n.name=t),CG&&e&&Lp(e,"arity")&&n.length!==e.arity&&Np(n,"length",{value:e.arity});try{e&&Lp(e,"constructor")&&e.constructor?L0&&Np(n,"prototype",{writable:!1}):n.prototype&&(n.prototype=void 0)}catch(s){}var o=SG(n);return Lp(o,"source")||(o.source=TG(PG,typeof t=="string"?t:"")),n};Function.prototype.toString=IG(function(){return xG(this)&&MG(this).source||wG(this)},"toString")});var Vf=ot((yQ,FS)=>{"use strict";var RG=Ui(),LG=Lu(),NG=DS(),OG=gp();FS.exports=function(n,t,e,o){o||(o={});var s=o.enumerable,l=o.name!==void 0?o.name:t;if(RG(e)&&NG(e,l,o),o.global)s?n[t]=e:OG(t,e);else{try{o.unsafe?n[t]&&(s=!0):delete n[t]}catch(p){}s?n[t]=e:LG.f(n,t,{value:e,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return n}});var BS=ot(US=>{"use strict";var DG=m0(),FG=Sp(),UG=FG.concat("length","prototype");US.f=Object.getOwnPropertyNames||function(t){return DG(t,UG)}});var GS=ot(zS=>{"use strict";zS.f=Object.getOwnPropertySymbols});var qS=ot((xQ,kS)=>{"use strict";var BG=hc(),zG=yi(),GG=BS(),kG=GS(),qG=ba(),HG=zG([].concat);kS.exports=BG("Reflect","ownKeys")||function(t){var e=GG.f(qG(t)),o=kG.f;return o?HG(e,o(t)):e}});var WS=ot((EQ,VS)=>{"use strict";var HS=Ma(),VG=qS(),WG=A0(),XG=Lu();VS.exports=function(n,t,e){for(var o=VG(t),s=XG.f,l=WG.f,p=0;p<o.length;p++){var h=o[p];!HS(n,h)&&!(e&&HS(e,h))&&s(n,h,l(t,h))}}});var YS=ot((wQ,XS)=>{"use strict";var YG=mi(),$G=Ui(),ZG=/#|\\.prototype\\./,Wf=function(n,t){var e=KG[JG(n)];return e===QG?!0:e===jG?!1:$G(t)?YG(t):!!t},JG=Wf.normalize=function(n){return String(n).replace(ZG,".").toLowerCase()},KG=Wf.data={},jG=Wf.NATIVE="N",QG=Wf.POLYFILL="P";XS.exports=Wf});var Ds=ot((SQ,$S)=>{"use strict";var Op=so(),t4=A0().f,e4=pc(),n4=Vf(),r4=gp(),i4=WS(),o4=YS();$S.exports=function(n,t){var e=n.target,o=n.global,s=n.stat,l,p,h,g,m,_;if(o?p=Op:s?p=Op[e]||r4(e,{}):p=Op[e]&&Op[e].prototype,p)for(h in t){if(m=t[h],n.dontCallGetSet?(_=t4(p,h),g=_&&_.value):g=p[h],l=o4(o?h:e+(s?".":"#")+h,n.forced),!l&&g!==void 0){if(typeof m==typeof g)continue;i4(m,g)}(n.sham||g&&g.sham)&&e4(m,"sham",!0),n4(p,h,m,n)}}});var JS=ot((MQ,ZS)=>{"use strict";var s4=mi();ZS.exports=!s4(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype})});var D0=ot((bQ,jS)=>{"use strict";var a4=Ma(),u4=Ui(),l4=cc(),c4=Mp(),f4=JS(),KS=c4("IE_PROTO"),O0=Object,h4=O0.prototype;jS.exports=f4?O0.getPrototypeOf:function(n){var t=l4(n);if(a4(t,KS))return t[KS];var e=t.constructor;return u4(e)&&t instanceof e?e.prototype:t instanceof O0?h4:null}});var z0=ot((AQ,eM)=>{"use strict";var p4=mi(),d4=Ui(),g4=Ys(),m4=qf(),QS=D0(),y4=Vf(),v4=Ns(),_4=zf(),B0=v4("iterator"),tM=!1,nu,F0,U0;[].keys&&(U0=[].keys(),"next"in U0?(F0=QS(QS(U0)),F0!==Object.prototype&&(nu=F0)):tM=!0);var x4=!g4(nu)||p4(function(){var n={};return nu[B0].call(n)!==n});x4?nu={}:_4&&(nu=m4(nu));d4(nu[B0])||y4(nu,B0,function(){return this});eM.exports={IteratorPrototype:nu,BUGGY_SAFARI_ITERATORS:tM}});var Dp=ot((TQ,rM)=>{"use strict";var E4=Lu().f,w4=Ma(),S4=Ns(),nM=S4("toStringTag");rM.exports=function(n,t,e){n&&!e&&(n=n.prototype),n&&!w4(n,nM)&&E4(n,nM,{configurable:!0,value:t})}});var oM=ot((CQ,iM)=>{"use strict";var M4=z0().IteratorPrototype,b4=qf(),A4=Cp(),T4=Dp(),C4=Tp(),P4=function(){return this};iM.exports=function(n,t,e,o){var s=t+" Iterator";return n.prototype=b4(M4,{next:A4(+!o,e)}),T4(n,s,!1,!0),C4[s]=P4,n}});var G0=ot((PQ,sM)=>{"use strict";var I4=yi(),R4=Gf();sM.exports=function(n,t,e){try{return I4(R4(Object.getOwnPropertyDescriptor(n,t)[e]))}catch(o){}}});var uM=ot((IQ,aM)=>{"use strict";var L4=Ys();aM.exports=function(n){return L4(n)||n===null}});var cM=ot((RQ,lM)=>{"use strict";var N4=uM(),O4=String,D4=TypeError;lM.exports=function(n){if(N4(n))return n;throw new D4("Can't set "+O4(n)+" as a prototype")}});var hM=ot((LQ,fM)=>{"use strict";var F4=G0(),U4=Ys(),B4=uc(),z4=cM();fM.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var n=!1,t={},e;try{e=F4(Object.prototype,"__proto__","set"),e(t,[]),n=t instanceof Array}catch(o){}return function(s,l){return B4(s),z4(l),U4(s)&&(n?e(s,l):s.__proto__=l),s}}():void 0)});var SM=ot((NQ,wM)=>{"use strict";var G4=Ds(),k4=Os(),Fp=zf(),xM=P0(),q4=Ui(),H4=oM(),pM=D0(),dM=hM(),V4=Dp(),W4=pc(),k0=Vf(),X4=Ns(),gM=Tp(),EM=z0(),Y4=xM.PROPER,$4=xM.CONFIGURABLE,mM=EM.IteratorPrototype,Up=EM.BUGGY_SAFARI_ITERATORS,Xf=X4("iterator"),yM="keys",Yf="values",vM="entries",_M=function(){return this};wM.exports=function(n,t,e,o,s,l,p){H4(e,t,o);var h=function(x){if(x===s&&S)return S;if(!Up&&x&&x in _)return _[x];switch(x){case yM:return function(){return new e(this,x)};case Yf:return function(){return new e(this,x)};case vM:return function(){return new e(this,x)}}return function(){return new e(this)}},g=t+" Iterator",m=!1,_=n.prototype,E=_[Xf]||_["@@iterator"]||s&&_[s],S=!Up&&E||h(s),b=t==="Array"&&_.entries||E,A,I,w;if(b&&(A=pM(b.call(new n)),A!==Object.prototype&&A.next&&(!Fp&&pM(A)!==mM&&(dM?dM(A,mM):q4(A[Xf])||k0(A,Xf,_M)),V4(A,g,!0,!0),Fp&&(gM[g]=_M))),Y4&&s===Yf&&E&&E.name!==Yf&&(!Fp&&$4?W4(_,"name",Yf):(m=!0,S=function(){return k4(E,this)})),s)if(I={values:h(Yf),keys:l?S:h(yM),entries:h(vM)},p)for(w in I)(Up||m||!(w in _))&&k0(_,w,I[w]);else G4({target:t,proto:!0,forced:Up||m},I);return(!Fp||p)&&_[Xf]!==S&&k0(_,Xf,S,{name:s}),gM[t]=S,I}});var bM=ot((OQ,MM)=>{"use strict";MM.exports=function(n,t){return{value:n,done:t}}});var RM=ot((DQ,IM)=>{"use strict";var Z4=lc(),q0=w0(),AM=Tp(),CM=Rp(),J4=Lu().f,K4=SM(),Bp=bM(),j4=zf(),Q4=Zs(),PM="Array Iterator",tk=CM.set,ek=CM.getterFor(PM);IM.exports=K4(Array,"Array",function(n,t){tk(this,{type:PM,target:Z4(n),index:0,kind:t})},function(){var n=ek(this),t=n.target,e=n.index++;if(!t||e>=t.length)return n.target=null,Bp(void 0,!0);switch(n.kind){case"keys":return Bp(e,!1);case"values":return Bp(t[e],!1)}return Bp([e,t[e]],!1)},"values");var TM=AM.Arguments=AM.Array;q0("keys");q0("values");q0("entries");if(!j4&&Q4&&TM.name!=="values")try{J4(TM,"name",{value:"values"})}catch(n){}});var Gp=ot(()=>{"use strict";var LM=so(),OM=SE(),nk=IE(),$f=RM(),NM=pc(),rk=Dp(),ik=Ns(),H0=ik("iterator"),V0=$f.values,DM=function(n,t){if(n){if(n[H0]!==V0)try{NM(n,H0,V0)}catch(o){n[H0]=V0}if(rk(n,t,!0),OM[t]){for(var e in $f)if(n[e]!==$f[e])try{NM(n,e,$f[e])}catch(o){n[e]=$f[e]}}}};for(zp in OM)DM(LM[zp]&&LM[zp].prototype,zp);var zp;DM(nk,"DOMTokenList")});var BM=ot((BQ,UM)=>{"use strict";var ok=Ns(),sk=ok("toStringTag"),FM={};FM[sk]="z";UM.exports=String(FM)==="[object z]"});var W0=ot((zQ,zM)=>{"use strict";var ak=BM(),uk=Ui(),kp=ac(),lk=Ns(),ck=lk("toStringTag"),fk=Object,hk=kp(function(){return arguments}())==="Arguments",pk=function(n,t){try{return n[t]}catch(e){}};zM.exports=ak?kp:function(n){var t,e,o;return n===void 0?"Undefined":n===null?"Null":typeof(e=pk(t=fk(n),ck))=="string"?e:hk?kp(t):(o=kp(t))==="Object"&&uk(t.callee)?"Arguments":o}});var qp=ot((GQ,GM)=>{"use strict";var dk=W0(),gk=String;GM.exports=function(n){if(dk(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return gk(n)}});var qM=ot((kQ,kM)=>{"use strict";var mk=ba();kM.exports=function(){var n=mk(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 VM=ot((qQ,HM)=>{"use strict";var X0=mi(),yk=so(),Y0=yk.RegExp,$0=X0(function(){var n=Y0("a","y");return n.lastIndex=2,n.exec("abcd")!==null}),vk=$0||X0(function(){return!Y0("a","y").sticky}),_k=$0||X0(function(){var n=Y0("^r","gy");return n.lastIndex=2,n.exec("str")!==null});HM.exports={BROKEN_CARET:_k,MISSED_STICKY:vk,UNSUPPORTED_Y:$0}});var XM=ot((HQ,WM)=>{"use strict";var xk=mi(),Ek=so(),wk=Ek.RegExp;WM.exports=xk(function(){var n=wk(".","s");return!(n.dotAll&&n.test(\`
|
|
11819
11819
|
\`)&&n.flags==="s")})});var $M=ot((VQ,YM)=>{"use strict";var Sk=mi(),Mk=so(),bk=Mk.RegExp;YM.exports=Sk(function(){var n=bk("(?<a>b)","g");return n.exec("b").groups.a!=="b"||"b".replace(n,"$<a>c")!=="bc"})});var Wp=ot((WQ,JM)=>{"use strict";var dc=Os(),Vp=yi(),Ak=qp(),Tk=qM(),Ck=VM(),Pk=yp(),Ik=qf(),Rk=Rp().get,Lk=XM(),Nk=$M(),Ok=Pk("native-string-replace",String.prototype.replace),Hp=RegExp.prototype.exec,J0=Hp,Dk=Vp("".charAt),Fk=Vp("".indexOf),Uk=Vp("".replace),Z0=Vp("".slice),K0=function(){var n=/a/,t=/b*/g;return dc(Hp,n,"a"),dc(Hp,t,"a"),n.lastIndex!==0||t.lastIndex!==0}(),ZM=Ck.BROKEN_CARET,j0=/()??/.exec("")[1]!==void 0,Bk=K0||j0||ZM||Lk||Nk;Bk&&(J0=function(t){var e=this,o=Rk(e),s=Ak(t),l=o.raw,p,h,g,m,_,E,S;if(l)return l.lastIndex=e.lastIndex,p=dc(J0,l,s),e.lastIndex=l.lastIndex,p;var b=o.groups,A=ZM&&e.sticky,I=dc(Tk,e),w=e.source,x=0,R=s;if(A&&(I=Uk(I,"y",""),Fk(I,"g")===-1&&(I+="g"),R=Z0(s,e.lastIndex),e.lastIndex>0&&(!e.multiline||e.multiline&&Dk(s,e.lastIndex-1)!==\`
|
|
11820
11820
|
\`)&&(w="(?: "+w+")",R=" "+R,x++),h=new RegExp("^(?:"+w+")",I)),j0&&(h=new RegExp("^"+w+"$(?!\\\\s)",I)),K0&&(g=e.lastIndex),m=dc(Hp,A?h:e,R),A?m?(m.input=Z0(m.input,x),m[0]=Z0(m[0],x),m.index=e.lastIndex,e.lastIndex+=m[0].length):e.lastIndex=0:K0&&m&&(e.lastIndex=e.global?m.index+m[0].length:g),j0&&m&&m.length>1&&dc(Ok,m[0],h,function(){for(_=1;_<arguments.length-2;_++)arguments[_]===void 0&&(m[_]=void 0)}),m&&b)for(m.groups=E=Ik(null),_=0;_<b.length;_++)S=b[_],E[S[0]]=m[S[1]];return m});JM.exports=J0});var Xp=ot(()=>{"use strict";var zk=Ds(),KM=Wp();zk({target:"RegExp",proto:!0,forced:/./.exec!==KM},{exec:KM})});var Yp=ot(($Q,jM)=>{"use strict";var Gk=ac();jM.exports=Array.isArray||function(t){return Gk(t)==="Array"}});var tb=ot((ZQ,QM)=>{"use strict";var kk=Zs(),qk=Yp(),Hk=TypeError,Vk=Object.getOwnPropertyDescriptor,Wk=kk&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(n){return n instanceof TypeError}}();QM.exports=Wk?function(n,t){if(qk(n)&&!Vk(n,"length").writable)throw new Hk("Cannot set read only .length");return n.length=t}:function(n,t){return n.length=t}});var Q0=ot((JQ,eb)=>{"use strict";var Xk=TypeError,Yk=9007199254740991;eb.exports=function(n){if(n>Yk)throw Xk("Maximum allowed index exceeded");return n}});var ty=ot(()=>{"use strict";var $k=Ds(),Zk=cc(),Jk=kf(),Kk=tb(),jk=Q0(),Qk=mi(),tq=Qk(function(){return[].push.call({length:4294967296},1)!==4294967297}),eq=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(n){return n instanceof TypeError}},nq=tq||!eq();$k({target:"Array",proto:!0,arity:1,forced:nq},{push:function(t){var e=Zk(this),o=Jk(e),s=arguments.length;jk(o+s);for(var l=0;l<s;l++)e[o]=arguments[l],o++;return Kk(e,o),o}})});var Ks=ot((QQ,nb)=>{"use strict";var ey=yi(),$p=Set.prototype;nb.exports={Set,add:ey($p.add),has:ey($p.has),remove:ey($p.delete),proto:$p}});var Nu=ot((ttt,rb)=>{"use strict";var rq=Ks().has;rb.exports=function(n){return rq(n),n}});var Ou=ot((ett,ib)=>{"use strict";var iq=Os();ib.exports=function(n,t,e){for(var o=e?n:n.iterator,s=n.next,l,p;!(l=iq(s,o)).done;)if(p=t(l.value),p!==void 0)return p}});var gc=ot((ntt,lb)=>{"use strict";var ob=yi(),oq=Ou(),sb=Ks(),sq=sb.Set,ab=sb.proto,aq=ob(ab.forEach),ub=ob(ab.keys),uq=ub(new sq).next;lb.exports=function(n,t,e){return e?oq({iterator:ub(n),next:uq},t):aq(n,t)}});var Zp=ot((rtt,fb)=>{"use strict";var cb=Ks(),lq=gc(),cq=cb.Set,fq=cb.add;fb.exports=function(n){var t=new cq;return lq(n,function(e){fq(t,e)}),t}});var mc=ot((itt,hb)=>{"use strict";var hq=G0(),pq=Ks();hb.exports=hq(pq.proto,"size","get")||function(n){return n.size}});var db=ot((ott,pb)=>{"use strict";pb.exports=function(n){return{iterator:n,next:n.next,done:!1}}});var Du=ot((stt,xb)=>{"use strict";var gb=Gf(),vb=ba(),mb=Os(),dq=El(),gq=db(),yb="Invalid size",mq=RangeError,yq=TypeError,vq=Math.max,_b=function(n,t){this.set=n,this.size=vq(t,0),this.has=gb(n.has),this.keys=gb(n.keys)};_b.prototype={getIterator:function(){return gq(vb(mb(this.keys,this.set)))},includes:function(n){return mb(this.has,this.set,n)}};xb.exports=function(n){vb(n);var t=+n.size;if(t!==t)throw new yq(yb);var e=dq(t);if(e<0)throw new mq(yb);return new _b(n,e)}});var Mb=ot((att,Sb)=>{"use strict";var _q=Nu(),wb=Ks(),xq=Zp(),Eq=mc(),wq=Du(),Sq=gc(),Mq=Ou(),bq=wb.has,Eb=wb.remove;Sb.exports=function(t){var e=_q(this),o=wq(t),s=xq(e);return Eq(e)<=o.size?Sq(e,function(l){o.includes(l)&&Eb(s,l)}):Mq(o.getIterator(),function(l){bq(e,l)&&Eb(s,l)}),s}});var Fu=ot((utt,Tb)=>{"use strict";var Aq=hc(),bb=function(n){return{size:n,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},Ab=function(n){return{size:n,has:function(){return!0},keys:function(){throw new Error("e")}}};Tb.exports=function(n,t){var e=Aq("Set");try{new e()[n](bb(0));try{return new e()[n](bb(-1)),!1}catch(s){if(!t)return!0;try{return new e()[n](Ab(-1/0)),!1}catch(l){var o=new e;return o.add(1),o.add(2),t(o[n](Ab(1/0)))}}}catch(s){return!1}}});var Cb=ot(()=>{"use strict";var Tq=Ds(),Cq=Mb(),Pq=Fu(),Iq=!Pq("difference",function(n){return n.size===0});Tq({target:"Set",proto:!0,real:!0,forced:Iq},{difference:Cq})});var Rb=ot((ftt,Ib)=>{"use strict";var Rq=Nu(),ny=Ks(),Lq=mc(),Nq=Du(),Oq=gc(),Dq=Ou(),Fq=ny.Set,Pb=ny.add,Uq=ny.has;Ib.exports=function(t){var e=Rq(this),o=Nq(t),s=new Fq;return Lq(e)>o.size?Dq(o.getIterator(),function(l){Uq(e,l)&&Pb(s,l)}):Oq(e,function(l){o.includes(l)&&Pb(s,l)}),s}});var Lb=ot(()=>{"use strict";var Bq=Ds(),zq=mi(),Gq=Rb(),kq=Fu(),qq=!kq("intersection",function(n){return n.size===2&&n.has(1)&&n.has(2)})||zq(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});Bq({target:"Set",proto:!0,real:!0,forced:qq},{intersection:Gq})});var ry=ot((dtt,Ob)=>{"use strict";var Hq=Os(),Nb=ba(),Vq=xp();Ob.exports=function(n,t,e){var o,s;Nb(n);try{if(o=Vq(n,"return"),!o){if(t==="throw")throw e;return e}o=Hq(o,n)}catch(l){s=!0,o=l}if(t==="throw")throw e;if(s)throw o;return Nb(o),e}});var Fb=ot((gtt,Db)=>{"use strict";var Wq=Nu(),Xq=Ks().has,Yq=mc(),$q=Du(),Zq=gc(),Jq=Ou(),Kq=ry();Db.exports=function(t){var e=Wq(this),o=$q(t);if(Yq(e)<=o.size)return Zq(e,function(l){if(o.includes(l))return!1},!0)!==!1;var s=o.getIterator();return Jq(s,function(l){if(Xq(e,l))return Kq(s,"normal",!1)})!==!1}});var Ub=ot(()=>{"use strict";var jq=Ds(),Qq=Fb(),t5=Fu(),e5=!t5("isDisjointFrom",function(n){return!n});jq({target:"Set",proto:!0,real:!0,forced:e5},{isDisjointFrom:Qq})});var zb=ot((vtt,Bb)=>{"use strict";var n5=Nu(),r5=mc(),i5=gc(),o5=Du();Bb.exports=function(t){var e=n5(this),o=o5(t);return r5(e)>o.size?!1:i5(e,function(s){if(!o.includes(s))return!1},!0)!==!1}});var Gb=ot(()=>{"use strict";var s5=Ds(),a5=zb(),u5=Fu(),l5=!u5("isSubsetOf",function(n){return n});s5({target:"Set",proto:!0,real:!0,forced:l5},{isSubsetOf:a5})});var qb=ot((Ett,kb)=>{"use strict";var c5=Nu(),f5=Ks().has,h5=mc(),p5=Du(),d5=Ou(),g5=ry();kb.exports=function(t){var e=c5(this),o=p5(t);if(h5(e)<o.size)return!1;var s=o.getIterator();return d5(s,function(l){if(!f5(e,l))return g5(s,"normal",!1)})!==!1}});var Hb=ot(()=>{"use strict";var m5=Ds(),y5=qb(),v5=Fu(),_5=!v5("isSupersetOf",function(n){return!n});m5({target:"Set",proto:!0,real:!0,forced:_5},{isSupersetOf:y5})});var Wb=ot((Mtt,Vb)=>{"use strict";var x5=Nu(),iy=Ks(),E5=Zp(),w5=Du(),S5=Ou(),M5=iy.add,b5=iy.has,A5=iy.remove;Vb.exports=function(t){var e=x5(this),o=w5(t).getIterator(),s=E5(e);return S5(o,function(l){b5(e,l)?A5(s,l):M5(s,l)}),s}});var Xb=ot(()=>{"use strict";var T5=Ds(),C5=Wb(),P5=Fu();T5({target:"Set",proto:!0,real:!0,forced:!P5("symmetricDifference")},{symmetricDifference:C5})});var $b=ot((Ttt,Yb)=>{"use strict";var I5=Nu(),R5=Ks().add,L5=Zp(),N5=Du(),O5=Ou();Yb.exports=function(t){var e=I5(this),o=N5(t).getIterator(),s=L5(e);return O5(o,function(l){R5(s,l)}),s}});var Zb=ot(()=>{"use strict";var D5=Ds(),F5=$b(),U5=Fu();D5({target:"Set",proto:!0,real:!0,forced:!U5("union")},{union:F5})});var Kb=ot((Itt,Jb)=>{"use strict";var B5=ac(),z5=yi();Jb.exports=function(n){if(B5(n)==="Function")return z5(n)}});var tA=ot((Rtt,Qb)=>{"use strict";var jb=Kb(),G5=Gf(),k5=Bf(),q5=jb(jb.bind);Qb.exports=function(n,t){return G5(n),t===void 0?n:k5?q5(n,t):function(){return n.apply(t,arguments)}}});var rA=ot((Ltt,nA)=>{"use strict";var H5=Yp(),V5=kf(),W5=Q0(),X5=tA(),eA=function(n,t,e,o,s,l,p,h){for(var g=s,m=0,_=p?X5(p,h):!1,E,S;m<o;)m in e&&(E=_?_(e[m],m,t):e[m],l>0&&H5(E)?(S=V5(E),g=eA(n,t,E,S,g,l-1)-1):(W5(g+1),n[g]=E),g++),m++;return g};nA.exports=eA});var lA=ot((Ntt,uA)=>{"use strict";var Y5=yi(),$5=mi(),iA=Ui(),Z5=W0(),J5=hc(),K5=R0(),oA=function(){},sA=J5("Reflect","construct"),oy=/^\\s*(?:class|function)\\b/,j5=Y5(oy.exec),Q5=!oy.test(oA),Zf=function(t){if(!iA(t))return!1;try{return sA(oA,[],t),!0}catch(e){return!1}},aA=function(t){if(!iA(t))return!1;switch(Z5(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Q5||!!j5(oy,K5(t))}catch(e){return!0}};aA.sham=!0;uA.exports=!sA||$5(function(){var n;return Zf(Zf.call)||!Zf(Object)||!Zf(function(){n=!0})||n})?aA:Zf});var pA=ot((Ott,hA)=>{"use strict";var cA=Yp(),tH=lA(),eH=Ys(),nH=Ns(),rH=nH("species"),fA=Array;hA.exports=function(n){var t;return cA(n)&&(t=n.constructor,tH(t)&&(t===fA||cA(t.prototype))?t=void 0:eH(t)&&(t=t[rH],t===null&&(t=void 0))),t===void 0?fA:t}});var gA=ot((Dtt,dA)=>{"use strict";var iH=pA();dA.exports=function(n,t){return new(iH(n))(t===0?0:t)}});var mA=ot(()=>{"use strict";var oH=Ds(),sH=rA(),aH=cc(),uH=kf(),lH=El(),cH=gA();oH({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=aH(this),o=uH(e),s=cH(e,0);return s.length=sH(s,e,e,o,0,t===void 0?1:lH(t)),s}})});var yA=ot(()=>{"use strict";var fH=w0();fH("flat")});var _A=ot((Gtt,vA)=>{var sy=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((t,e)=>t.priority-e.priority)}set(t,e){let o=Number(e);if(isNaN(o))throw new TypeError('"priority" must be a number');return this.keys.has(t)?this.queue.map(s=>(s.key===t&&Object.assign(s,{priority:o}),s)):(this.keys.add(t),this.queue.push({key:t,priority:o})),this.sort(),this.queue.length}next(){let t=this.queue.shift();return this.keys.delete(t.key),t}isEmpty(){return this.queue.length===0}has(t){return this.keys.has(t)}get(t){return this.queue.find(e=>e.key===t)}};vA.exports=sy});var wA=ot((ktt,EA)=>{function xA(n,t){let e=new Map;for(let[o,s]of n)o!==t&&s instanceof Map?e.set(o,xA(s,t)):o!==t&&e.set(o,s);return e}EA.exports=xA});var bA=ot((qtt,MA)=>{function hH(n){let t=Number(n);return!(isNaN(t)||t<=0)}function SA(n){let t=new Map;return Object.keys(n).forEach(o=>{let s=n[o];if(s!==null&&typeof s=="object"&&!Array.isArray(s))return t.set(o,SA(s));if(!hH(s))throw new Error(\`Could not add node at key "\${o}", make sure it's a valid node\`,s);return t.set(o,Number(s))}),t}MA.exports=SA});var CA=ot((Htt,TA)=>{function AA(n){if(!(n instanceof Map))throw new Error(\`Invalid graph: Expected Map instead found \${typeof n}\`);n.forEach((t,e)=>{if(typeof t=="object"&&t instanceof Map){AA(t);return}if(typeof t!="number"||t<=0)throw new Error(\`Values must be numbers greater than 0. Found value \${t} at \${e}\`)})}TA.exports=AA});var LA=ot((Vtt,RA)=>{var pH=_A(),dH=wA(),PA=bA(),IA=CA(),ay=class{constructor(t){t instanceof Map?(IA(t),this.graph=t):t?this.graph=PA(t):this.graph=new Map}addNode(t,e){let o;return e instanceof Map?(IA(e),o=e):o=PA(e),this.graph.set(t,o),this}addVertex(t,e){return this.addNode(t,e)}removeNode(t){return this.graph=dH(this.graph,t),this}path(t,e,o={}){if(!this.graph.size)return o.cost?{path:null,cost:0}:null;let s=new Set,l=new pH,p=new Map,h=[],g=0,m=[];if(o.avoid&&(m=[].concat(o.avoid)),m.includes(t))throw new Error(\`Starting node (\${t}) cannot be avoided\`);if(m.includes(e))throw new Error(\`Ending node (\${e}) cannot be avoided\`);for(l.set(t,0);!l.isEmpty();){let _=l.next();if(_.key===e){g=_.priority;let S=_.key;for(;p.has(S);)h.push(S),S=p.get(S);break}s.add(_.key),(this.graph.get(_.key)||new Map).forEach((S,b)=>{if(s.has(b)||m.includes(b))return null;if(!l.has(b))return p.set(b,_.key),l.set(b,_.priority+S);let A=l.get(b).priority,I=_.priority+S;return I<A?(p.set(b,_.key),l.set(b,I)):null})}return h.length?(o.trim?h.shift():h=h.concat([t]),o.reverse||(h=h.reverse()),o.cost?{path:h,cost:g}:h):o.cost?{path:null,cost:0}:null}shortestPath(...t){return this.path(...t)}};RA.exports=ay});var Xd=ot((net,CC)=>{"use strict";var TC=Object.getOwnPropertySymbols,AX=Object.prototype.hasOwnProperty,TX=Object.prototype.propertyIsEnumerable;function CX(n){if(n==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function PX(){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 o=Object.getOwnPropertyNames(t).map(function(l){return t[l]});if(o.join("")!=="0123456789")return!1;var s={};return"abcdefghijklmnopqrst".split("").forEach(function(l){s[l]=l}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch(l){return!1}}CC.exports=PX()?Object.assign:function(n,t){for(var e,o=CX(n),s,l=1;l<arguments.length;l++){e=Object(arguments[l]);for(var p in e)AX.call(e,p)&&(o[p]=e[p]);if(TC){s=TC(e);for(var h=0;h<s.length;h++)TX.call(e,s[h])&&(o[s[h]]=e[s[h]])}}return o}});var kv=ot((zv,Gv)=>{(function(n,t){typeof zv=="object"&&typeof Gv!="undefined"?Gv.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self).RBush=t()})(zv,function(){"use strict";function n(w,x,R,C,F){(function V(X,q,D,xt,B){for(;xt>D;){if(xt-D>600){var j=xt-D+1,J=q-D+1,Dt=Math.log(j),Q=.5*Math.exp(2*Dt/3),At=.5*Math.sqrt(Dt*Q*(j-Q)/j)*(J-j/2<0?-1:1),Mt=Math.max(D,Math.floor(q-J*Q/j+At)),Lt=Math.min(xt,Math.floor(q+(j-J)*Q/j+At));V(X,q,Mt,Lt,B)}var pt=X[q],yt=D,K=xt;for(t(X,D,q),B(X[xt],pt)>0&&t(X,D,xt);yt<K;){for(t(X,yt,K),yt++,K--;B(X[yt],pt)<0;)yt++;for(;B(X[K],pt)>0;)K--}B(X[D],pt)===0?t(X,D,K):t(X,++K,xt),K<=q&&(D=K+1),q<=K&&(xt=K-1)}})(w,x,R||0,C||w.length-1,F||e)}function t(w,x,R){var C=w[x];w[x]=w[R],w[R]=C}function e(w,x){return w<x?-1:w>x?1:0}var o=function(w){w===void 0&&(w=9),this._maxEntries=Math.max(4,w),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function s(w,x,R){if(!R)return x.indexOf(w);for(var C=0;C<x.length;C++)if(R(w,x[C]))return C;return-1}function l(w,x){p(w,0,w.children.length,x,w)}function p(w,x,R,C,F){F||(F=A(null)),F.minX=1/0,F.minY=1/0,F.maxX=-1/0,F.maxY=-1/0;for(var V=x;V<R;V++){var X=w.children[V];h(F,w.leaf?C(X):X)}return F}function h(w,x){return w.minX=Math.min(w.minX,x.minX),w.minY=Math.min(w.minY,x.minY),w.maxX=Math.max(w.maxX,x.maxX),w.maxY=Math.max(w.maxY,x.maxY),w}function g(w,x){return w.minX-x.minX}function m(w,x){return w.minY-x.minY}function _(w){return(w.maxX-w.minX)*(w.maxY-w.minY)}function E(w){return w.maxX-w.minX+(w.maxY-w.minY)}function S(w,x){return w.minX<=x.minX&&w.minY<=x.minY&&x.maxX<=w.maxX&&x.maxY<=w.maxY}function b(w,x){return x.minX<=w.maxX&&x.minY<=w.maxY&&x.maxX>=w.minX&&x.maxY>=w.minY}function A(w){return{children:w,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function I(w,x,R,C,F){for(var V=[x,R];V.length;)if(!((R=V.pop())-(x=V.pop())<=C)){var X=x+Math.ceil((R-x)/C/2)*C;n(w,X,x,R,F),V.push(x,X,X,R)}}return o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(w){var x=this.data,R=[];if(!b(w,x))return R;for(var C=this.toBBox,F=[];x;){for(var V=0;V<x.children.length;V++){var X=x.children[V],q=x.leaf?C(X):X;b(w,q)&&(x.leaf?R.push(X):S(w,q)?this._all(X,R):F.push(X))}x=F.pop()}return R},o.prototype.collides=function(w){var x=this.data;if(!b(w,x))return!1;for(var R=[];x;){for(var C=0;C<x.children.length;C++){var F=x.children[C],V=x.leaf?this.toBBox(F):F;if(b(w,V)){if(x.leaf||S(w,V))return!0;R.push(F)}}x=R.pop()}return!1},o.prototype.load=function(w){if(!w||!w.length)return this;if(w.length<this._minEntries){for(var x=0;x<w.length;x++)this.insert(w[x]);return this}var R=this._build(w.slice(),0,w.length-1,0);if(this.data.children.length)if(this.data.height===R.height)this._splitRoot(this.data,R);else{if(this.data.height<R.height){var C=this.data;this.data=R,R=C}this._insert(R,this.data.height-R.height-1,!0)}else this.data=R;return this},o.prototype.insert=function(w){return w&&this._insert(w,this.data.height-1),this},o.prototype.clear=function(){return this.data=A([]),this},o.prototype.remove=function(w,x){if(!w)return this;for(var R,C,F,V=this.data,X=this.toBBox(w),q=[],D=[];V||q.length;){if(V||(V=q.pop(),C=q[q.length-1],R=D.pop(),F=!0),V.leaf){var xt=s(w,V.children,x);if(xt!==-1)return V.children.splice(xt,1),q.push(V),this._condense(q),this}F||V.leaf||!S(V,X)?C?(R++,V=C.children[R],F=!1):V=null:(q.push(V),D.push(R),R=0,C=V,V=V.children[0])}return this},o.prototype.toBBox=function(w){return w},o.prototype.compareMinX=function(w,x){return w.minX-x.minX},o.prototype.compareMinY=function(w,x){return w.minY-x.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(w){return this.data=w,this},o.prototype._all=function(w,x){for(var R=[];w;)w.leaf?x.push.apply(x,w.children):R.push.apply(R,w.children),w=R.pop();return x},o.prototype._build=function(w,x,R,C){var F,V=R-x+1,X=this._maxEntries;if(V<=X)return l(F=A(w.slice(x,R+1)),this.toBBox),F;C||(C=Math.ceil(Math.log(V)/Math.log(X)),X=Math.ceil(V/Math.pow(X,C-1))),(F=A([])).leaf=!1,F.height=C;var q=Math.ceil(V/X),D=q*Math.ceil(Math.sqrt(X));I(w,x,R,D,this.compareMinX);for(var xt=x;xt<=R;xt+=D){var B=Math.min(xt+D-1,R);I(w,xt,B,q,this.compareMinY);for(var j=xt;j<=B;j+=q){var J=Math.min(j+q-1,B);F.children.push(this._build(w,j,J,C-1))}}return l(F,this.toBBox),F},o.prototype._chooseSubtree=function(w,x,R,C){for(;C.push(x),!x.leaf&&C.length-1!==R;){for(var F=1/0,V=1/0,X=void 0,q=0;q<x.children.length;q++){var D=x.children[q],xt=_(D),B=(j=w,J=D,(Math.max(J.maxX,j.maxX)-Math.min(J.minX,j.minX))*(Math.max(J.maxY,j.maxY)-Math.min(J.minY,j.minY))-xt);B<V?(V=B,F=xt<F?xt:F,X=D):B===V&&xt<F&&(F=xt,X=D)}x=X||x.children[0]}var j,J;return x},o.prototype._insert=function(w,x,R){var C=R?w:this.toBBox(w),F=[],V=this._chooseSubtree(C,this.data,x,F);for(V.children.push(w),h(V,C);x>=0&&F[x].children.length>this._maxEntries;)this._split(F,x),x--;this._adjustParentBBoxes(C,F,x)},o.prototype._split=function(w,x){var R=w[x],C=R.children.length,F=this._minEntries;this._chooseSplitAxis(R,F,C);var V=this._chooseSplitIndex(R,F,C),X=A(R.children.splice(V,R.children.length-V));X.height=R.height,X.leaf=R.leaf,l(R,this.toBBox),l(X,this.toBBox),x?w[x-1].children.push(X):this._splitRoot(R,X)},o.prototype._splitRoot=function(w,x){this.data=A([w,x]),this.data.height=w.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(w,x,R){for(var C,F,V,X,q,D,xt,B=1/0,j=1/0,J=x;J<=R-x;J++){var Dt=p(w,0,J,this.toBBox),Q=p(w,J,R,this.toBBox),At=(F=Dt,V=Q,X=void 0,q=void 0,D=void 0,xt=void 0,X=Math.max(F.minX,V.minX),q=Math.max(F.minY,V.minY),D=Math.min(F.maxX,V.maxX),xt=Math.min(F.maxY,V.maxY),Math.max(0,D-X)*Math.max(0,xt-q)),Mt=_(Dt)+_(Q);At<B?(B=At,C=J,j=Mt<j?Mt:j):At===B&&Mt<j&&(j=Mt,C=J)}return C||R-x},o.prototype._chooseSplitAxis=function(w,x,R){var C=w.leaf?this.compareMinX:g,F=w.leaf?this.compareMinY:m;this._allDistMargin(w,x,R,C)<this._allDistMargin(w,x,R,F)&&w.children.sort(C)},o.prototype._allDistMargin=function(w,x,R,C){w.children.sort(C);for(var F=this.toBBox,V=p(w,0,x,F),X=p(w,R-x,R,F),q=E(V)+E(X),D=x;D<R-x;D++){var xt=w.children[D];h(V,w.leaf?F(xt):xt),q+=E(V)}for(var B=R-x-1;B>=x;B--){var j=w.children[B];h(X,w.leaf?F(j):j),q+=E(X)}return q},o.prototype._adjustParentBBoxes=function(w,x,R){for(var C=R;C>=0;C--)h(x[C],w)},o.prototype._condense=function(w){for(var x=w.length-1,R=void 0;x>=0;x--)w[x].children.length===0?x>0?(R=w[x-1].children).splice(R.indexOf(w[x]),1):this.clear():l(w[x],this.toBBox)},o})});var PC=ot((qv,Hv)=>{(function(n,t){typeof qv=="object"&&typeof Hv!="undefined"?Hv.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self,n.TinyQueue=t())})(qv,function(){"use strict";var n=function(o,s){if(o===void 0&&(o=[]),s===void 0&&(s=t),this.data=o,this.length=this.data.length,this.compare=s,this.length>0)for(var l=(this.length>>1)-1;l>=0;l--)this._down(l)};n.prototype.push=function(o){this.data.push(o),this.length++,this._up(this.length-1)},n.prototype.pop=function(){if(this.length!==0){var o=this.data[0],s=this.data.pop();return this.length--,this.length>0&&(this.data[0]=s,this._down(0)),o}},n.prototype.peek=function(){return this.data[0]},n.prototype._up=function(o){for(var s=this,l=s.data,p=s.compare,h=l[o];o>0;){var g=o-1>>1,m=l[g];if(p(h,m)>=0)break;l[o]=m,o=g}l[o]=h},n.prototype._down=function(o){for(var s=this,l=s.data,p=s.compare,h=this.length>>1,g=l[o];o<h;){var m=(o<<1)+1,_=l[m],E=m+1;if(E<this.length&&p(l[E],_)<0&&(m=E,_=l[E]),p(_,g)>=0)break;l[o]=_,o=m}l[o]=g};function t(e,o){return e<o?-1:e>o?1:0}return n})});var RC=ot((uet,IC)=>{IC.exports=function(t,e,o,s){var l=t[0],p=t[1],h=!1;o===void 0&&(o=0),s===void 0&&(s=e.length);for(var g=(s-o)/2,m=0,_=g-1;m<g;_=m++){var E=e[o+m*2+0],S=e[o+m*2+1],b=e[o+_*2+0],A=e[o+_*2+1],I=S>p!=A>p&&l<(b-E)*(p-S)/(A-S)+E;I&&(h=!h)}return h}});var NC=ot((cet,LC)=>{LC.exports=function(t,e,o,s){var l=t[0],p=t[1],h=!1;o===void 0&&(o=0),s===void 0&&(s=e.length);for(var g=s-o,m=0,_=g-1;m<g;_=m++){var E=e[m+o][0],S=e[m+o][1],b=e[_+o][0],A=e[_+o][1],I=S>p!=A>p&&l<(b-E)*(p-S)/(A-S)+E;I&&(h=!h)}return h}});var FC=ot((fet,Zd)=>{var OC=RC(),DC=NC();Zd.exports=function(t,e,o,s){return e.length>0&&Array.isArray(e[0])?DC(t,e,o,s):OC(t,e,o,s)};Zd.exports.nested=DC;Zd.exports.flat=OC});var BC=ot((Jd,UC)=>{(function(n,t){typeof Jd=="object"&&typeof UC!="undefined"?t(Jd):typeof define=="function"&&define.amd?define(["exports"],t):t((n=n||self).predicates={})})(Jd,function(n){"use strict";let e=33306690738754706e-32;function o(b,A,I,w,x){let R,C,F,V,X=A[0],q=w[0],D=0,xt=0;q>X==q>-X?(R=X,X=A[++D]):(R=q,q=w[++xt]);let B=0;if(D<b&&xt<I)for(q>X==q>-X?(F=R-((C=X+R)-X),X=A[++D]):(F=R-((C=q+R)-q),q=w[++xt]),R=C,F!==0&&(x[B++]=F);D<b&&xt<I;)q>X==q>-X?(F=R-((C=R+X)-(V=C-R))+(X-V),X=A[++D]):(F=R-((C=R+q)-(V=C-R))+(q-V),q=w[++xt]),R=C,F!==0&&(x[B++]=F);for(;D<b;)F=R-((C=R+X)-(V=C-R))+(X-V),X=A[++D],R=C,F!==0&&(x[B++]=F);for(;xt<I;)F=R-((C=R+q)-(V=C-R))+(q-V),q=w[++xt],R=C,F!==0&&(x[B++]=F);return R===0&&B!==0||(x[B++]=R),B}function s(b){return new Float64Array(b)}let l=33306690738754716e-32,p=22204460492503146e-32,h=11093356479670487e-47,g=s(4),m=s(8),_=s(12),E=s(16),S=s(4);n.orient2d=function(b,A,I,w,x,R){let C=(A-R)*(I-x),F=(b-x)*(w-R),V=C-F;if(C===0||F===0||C>0!=F>0)return V;let X=Math.abs(C+F);return Math.abs(V)>=l*X?V:-function(q,D,xt,B,j,J,Dt){let Q,At,Mt,Lt,pt,yt,K,Bt,Gt,ae,ut,Ut,jt,ce,te,$t,qt,xe,ft=q-j,Xe=xt-j,ee=D-J,ge=B-J;pt=(te=(Bt=ft-(K=(yt=134217729*ft)-(yt-ft)))*(ae=ge-(Gt=(yt=134217729*ge)-(yt-ge)))-((ce=ft*ge)-K*Gt-Bt*Gt-K*ae))-(ut=te-(qt=(Bt=ee-(K=(yt=134217729*ee)-(yt-ee)))*(ae=Xe-(Gt=(yt=134217729*Xe)-(yt-Xe)))-(($t=ee*Xe)-K*Gt-Bt*Gt-K*ae))),g[0]=te-(ut+pt)+(pt-qt),pt=(jt=ce-((Ut=ce+ut)-(pt=Ut-ce))+(ut-pt))-(ut=jt-$t),g[1]=jt-(ut+pt)+(pt-$t),pt=(xe=Ut+ut)-Ut,g[2]=Ut-(xe-pt)+(ut-pt),g[3]=xe;let fe=function(tt,z){let It=z[0];for(let Ot=1;Ot<tt;Ot++)It+=z[Ot];return It}(4,g),Te=p*Dt;if(fe>=Te||-fe>=Te||(Q=q-(ft+(pt=q-ft))+(pt-j),Mt=xt-(Xe+(pt=xt-Xe))+(pt-j),At=D-(ee+(pt=D-ee))+(pt-J),Lt=B-(ge+(pt=B-ge))+(pt-J),Q===0&&At===0&&Mt===0&&Lt===0)||(Te=h*Dt+e*Math.abs(fe),(fe+=ft*Lt+ge*Q-(ee*Mt+Xe*At))>=Te||-fe>=Te))return fe;pt=(te=(Bt=Q-(K=(yt=134217729*Q)-(yt-Q)))*(ae=ge-(Gt=(yt=134217729*ge)-(yt-ge)))-((ce=Q*ge)-K*Gt-Bt*Gt-K*ae))-(ut=te-(qt=(Bt=At-(K=(yt=134217729*At)-(yt-At)))*(ae=Xe-(Gt=(yt=134217729*Xe)-(yt-Xe)))-(($t=At*Xe)-K*Gt-Bt*Gt-K*ae))),S[0]=te-(ut+pt)+(pt-qt),pt=(jt=ce-((Ut=ce+ut)-(pt=Ut-ce))+(ut-pt))-(ut=jt-$t),S[1]=jt-(ut+pt)+(pt-$t),pt=(xe=Ut+ut)-Ut,S[2]=Ut-(xe-pt)+(ut-pt),S[3]=xe;let be=o(4,g,4,S,m);pt=(te=(Bt=ft-(K=(yt=134217729*ft)-(yt-ft)))*(ae=Lt-(Gt=(yt=134217729*Lt)-(yt-Lt)))-((ce=ft*Lt)-K*Gt-Bt*Gt-K*ae))-(ut=te-(qt=(Bt=ee-(K=(yt=134217729*ee)-(yt-ee)))*(ae=Mt-(Gt=(yt=134217729*Mt)-(yt-Mt)))-(($t=ee*Mt)-K*Gt-Bt*Gt-K*ae))),S[0]=te-(ut+pt)+(pt-qt),pt=(jt=ce-((Ut=ce+ut)-(pt=Ut-ce))+(ut-pt))-(ut=jt-$t),S[1]=jt-(ut+pt)+(pt-$t),pt=(xe=Ut+ut)-Ut,S[2]=Ut-(xe-pt)+(ut-pt),S[3]=xe;let Wt=o(be,m,4,S,_);pt=(te=(Bt=Q-(K=(yt=134217729*Q)-(yt-Q)))*(ae=Lt-(Gt=(yt=134217729*Lt)-(yt-Lt)))-((ce=Q*Lt)-K*Gt-Bt*Gt-K*ae))-(ut=te-(qt=(Bt=At-(K=(yt=134217729*At)-(yt-At)))*(ae=Mt-(Gt=(yt=134217729*Mt)-(yt-Mt)))-(($t=At*Mt)-K*Gt-Bt*Gt-K*ae))),S[0]=te-(ut+pt)+(pt-qt),pt=(jt=ce-((Ut=ce+ut)-(pt=Ut-ce))+(ut-pt))-(ut=jt-$t),S[1]=jt-(ut+pt)+(pt-$t),pt=(xe=Ut+ut)-Ut,S[2]=Ut-(xe-pt)+(ut-pt),S[3]=xe;let Me=o(Wt,_,4,S,E);return E[Me-1]}(b,A,I,w,x,R,X)},n.orient2dfast=function(b,A,I,w,x,R){return(A-R)*(I-x)-(b-x)*(w-R)},Object.defineProperty(n,"__esModule",{value:!0})})});var VC=ot((het,Yv)=>{"use strict";var zC=kv(),jd=PC(),RX=FC(),LX=BC().orient2d;jd.default&&(jd=jd.default);Yv.exports=HC;Yv.exports.default=HC;function HC(n,t,e){t=Math.max(0,t===void 0?2:t),e=e||0;var o=UX(n),s=new zC(16);s.toBBox=function(R){return{minX:R[0],minY:R[1],maxX:R[0],maxY:R[1]}},s.compareMinX=function(R,C){return R[0]-C[0]},s.compareMinY=function(R,C){return R[1]-C[1]},s.load(n);for(var l=[],p=0,h;p<o.length;p++){var g=o[p];s.remove(g),h=qC(g,h),l.push(h)}var m=new zC(16);for(p=0;p<l.length;p++)m.insert(Vv(l[p]));for(var _=t*t,E=e*e;l.length;){var S=l.shift(),b=S.p,A=S.next.p,I=Wv(b,A);if(!(I<E)){var w=I/_;g=NX(s,S.prev.p,b,A,S.next.next.p,w,m),g&&Math.min(Wv(g,b),Wv(g,A))<=w&&(l.push(S),l.push(qC(g,S)),s.remove(g),m.remove(S),m.insert(Vv(S)),m.insert(Vv(S.next)))}}S=h;var x=[];do x.push(S.p),S=S.next;while(S!==h);return x.push(S.p),x}function NX(n,t,e,o,s,l,p){for(var h=new jd([],OX),g=n.data;g;){for(var m=0;m<g.children.length;m++){var _=g.children[m],E=g.leaf?Xv(_,e,o):DX(e,o,_);E>l||h.push({node:_,dist:E})}for(;h.length&&!h.peek().node.children;){var S=h.pop(),b=S.node,A=Xv(b,t,e),I=Xv(b,o,s);if(S.dist<A&&S.dist<I&&kC(e,b,p)&&kC(o,b,p))return b}g=h.pop(),g&&(g=g.node)}return null}function OX(n,t){return n.dist-t.dist}function DX(n,t,e){if(GC(n,e)||GC(t,e))return 0;var o=Kd(n[0],n[1],t[0],t[1],e.minX,e.minY,e.maxX,e.minY);if(o===0)return 0;var s=Kd(n[0],n[1],t[0],t[1],e.minX,e.minY,e.minX,e.maxY);if(s===0)return 0;var l=Kd(n[0],n[1],t[0],t[1],e.maxX,e.minY,e.maxX,e.maxY);if(l===0)return 0;var p=Kd(n[0],n[1],t[0],t[1],e.minX,e.maxY,e.maxX,e.maxY);return p===0?0:Math.min(o,s,l,p)}function GC(n,t){return n[0]>=t.minX&&n[0]<=t.maxX&&n[1]>=t.minY&&n[1]<=t.maxY}function kC(n,t,e){for(var o=Math.min(n[0],t[0]),s=Math.min(n[1],t[1]),l=Math.max(n[0],t[0]),p=Math.max(n[1],t[1]),h=e.search({minX:o,minY:s,maxX:l,maxY:p}),g=0;g<h.length;g++)if(FX(h[g].p,h[g].next.p,n,t))return!1;return!0}function $c(n,t,e){return LX(n[0],n[1],t[0],t[1],e[0],e[1])}function FX(n,t,e,o){return n!==o&&t!==e&&$c(n,t,e)>0!=$c(n,t,o)>0&&$c(e,o,n)>0!=$c(e,o,t)>0}function Vv(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 UX(n){for(var t=n[0],e=n[0],o=n[0],s=n[0],l=0;l<n.length;l++){var p=n[l];p[0]<t[0]&&(t=p),p[0]>o[0]&&(o=p),p[1]<e[1]&&(e=p),p[1]>s[1]&&(s=p)}var h=[t,e,o,s],g=h.slice();for(l=0;l<n.length;l++)RX(n[l],h)||g.push(n[l]);return zX(g)}function qC(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 Wv(n,t){var e=n[0]-t[0],o=n[1]-t[1];return e*e+o*o}function Xv(n,t,e){var o=t[0],s=t[1],l=e[0]-o,p=e[1]-s;if(l!==0||p!==0){var h=((n[0]-o)*l+(n[1]-s)*p)/(l*l+p*p);h>1?(o=e[0],s=e[1]):h>0&&(o+=l*h,s+=p*h)}return l=n[0]-o,p=n[1]-s,l*l+p*p}function Kd(n,t,e,o,s,l,p,h){var g=e-n,m=o-t,_=p-s,E=h-l,S=n-s,b=t-l,A=g*g+m*m,I=g*_+m*E,w=_*_+E*E,x=g*S+m*b,R=_*S+E*b,C=A*w-I*I,F,V,X,q,D=C,xt=C;C===0?(V=0,D=1,q=R,xt=w):(V=I*R-w*x,q=A*R-I*x,V<0?(V=0,q=R,xt=w):V>D&&(V=D,q=R+I,xt=w)),q<0?(q=0,-x<0?V=0:-x>A?V=D:(V=-x,D=A)):q>xt&&(q=xt,-x+I<0?V=0:-x+I>A?V=D:(V=-x+I,D=A)),F=V===0?0:V/D,X=q===0?0:q/xt;var B=(1-F)*n+F*e,j=(1-F)*t+F*o,J=(1-X)*s+X*p,Dt=(1-X)*l+X*h,Q=J-B,At=Dt-j;return Q*Q+At*At}function BX(n,t){return n[0]===t[0]?n[1]-t[1]:n[0]-t[0]}function zX(n){n.sort(BX);for(var t=[],e=0;e<n.length;e++){for(;t.length>=2&&$c(t[t.length-2],t[t.length-1],n[e])<=0;)t.pop();t.push(n[e])}for(var o=[],s=n.length-1;s>=0;s--){for(;o.length>=2&&$c(o[o.length-2],o[o.length-1],n[s])<=0;)o.pop();o.push(n[s])}return o.pop(),t.pop(),t.concat(o)}});var JC=ot((Zv,Jv)=>{(function(n,t){typeof Zv=="object"&&typeof Jv!="undefined"?Jv.exports=t():typeof define=="function"&&define.amd?define(t):n.quickselect=t()})(Zv,function(){"use strict";function n(s,l,p,h,g){t(s,l,p||0,h||s.length-1,g||o)}function t(s,l,p,h,g){for(;h>p;){if(h-p>600){var m=h-p+1,_=l-p+1,E=Math.log(m),S=.5*Math.exp(2*E/3),b=.5*Math.sqrt(E*S*(m-S)/m)*(_-m/2<0?-1:1),A=Math.max(p,Math.floor(l-_*S/m+b)),I=Math.min(h,Math.floor(l+(m-_)*S/m+b));t(s,l,A,I,g)}var w=s[l],x=p,R=h;for(e(s,p,l),g(s[h],w)>0&&e(s,p,h);x<R;){for(e(s,x,R),x++,R--;g(s[x],w)<0;)x++;for(;g(s[R],w)>0;)R--}g(s[p],w)===0?e(s,p,R):(R++,e(s,R,h)),R<=l&&(p=R+1),l<=R&&(h=R-1)}}function e(s,l,p){var h=s[l];s[l]=s[p],s[p]=h}function o(s,l){return s<l?-1:s>l?1:0}return n})});var t_=ot((zrt,Qv)=>{"use strict";Qv.exports=fh;Qv.exports.default=fh;var jX=JC();function fh(n,t){if(!(this instanceof fh))return new fh(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()}fh.prototype={all:function(){return this._all(this.data,[])},search:function(n){var t=this.data,e=[],o=this.toBBox;if(!tg(n,t))return e;for(var s=[],l,p,h,g;t;){for(l=0,p=t.children.length;l<p;l++)h=t.children[l],g=t.leaf?o(h):h,tg(n,g)&&(t.leaf?e.push(h):jv(n,g)?this._all(h,e):s.push(h));t=s.pop()}return e},collides:function(n){var t=this.data,e=this.toBBox;if(!tg(n,t))return!1;for(var o=[],s,l,p,h;t;){for(s=0,l=t.children.length;s<l;s++)if(p=t.children[s],h=t.leaf?e(p):p,tg(n,h)){if(t.leaf||jv(n,h))return!0;o.push(p)}t=o.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 o=this._build(n.slice(),0,n.length-1,0);if(!this.data.children.length)this.data=o;else if(this.data.height===o.height)this._splitRoot(this.data,o);else{if(this.data.height<o.height){var s=this.data;this.data=o,o=s}this._insert(o,this.data.height-o.height-1,!0)}return this},insert:function(n){return n&&this._insert(n,this.data.height-1),this},clear:function(){return this.data=Kc([]),this},remove:function(n,t){if(!n)return this;for(var e=this.data,o=this.toBBox(n),s=[],l=[],p,h,g,m;e||s.length;){if(e||(e=s.pop(),h=s[s.length-1],p=l.pop(),m=!0),e.leaf&&(g=QX(n,e.children,t),g!==-1))return e.children.splice(g,1),s.push(e),this._condense(s),this;!m&&!e.leaf&&jv(e,o)?(s.push(e),l.push(p),p=0,h=e,e=e.children[0]):h?(p++,e=h.children[p],m=!1):e=null}return this},toBBox:function(n){return n},compareMinX:KC,compareMinY:jC,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,o){var s=e-t+1,l=this._maxEntries,p;if(s<=l)return p=Kc(n.slice(t,e+1)),Jc(p,this.toBBox),p;o||(o=Math.ceil(Math.log(s)/Math.log(l)),l=Math.ceil(s/Math.pow(l,o-1))),p=Kc([]),p.leaf=!1,p.height=o;var h=Math.ceil(s/l),g=h*Math.ceil(Math.sqrt(l)),m,_,E,S;for(QC(n,t,e,g,this.compareMinX),m=t;m<=e;m+=g)for(E=Math.min(m+g-1,e),QC(n,m,E,h,this.compareMinY),_=m;_<=E;_+=h)S=Math.min(_+h-1,E),p.children.push(this._build(n,_,S,o-1));return Jc(p,this.toBBox),p},_chooseSubtree:function(n,t,e,o){for(var s,l,p,h,g,m,_,E;o.push(t),!(t.leaf||o.length-1===e);){for(_=E=1/0,s=0,l=t.children.length;s<l;s++)p=t.children[s],g=Kv(p),m=t7(n,p)-g,m<E?(E=m,_=g<_?g:_,h=p):m===E&&g<_&&(_=g,h=p);t=h||t.children[0]}return t},_insert:function(n,t,e){var o=this.toBBox,s=e?n:o(n),l=[],p=this._chooseSubtree(s,this.data,t,l);for(p.children.push(n),ch(p,s);t>=0&&l[t].children.length>this._maxEntries;)this._split(l,t),t--;this._adjustParentBBoxes(s,l,t)},_split:function(n,t){var e=n[t],o=e.children.length,s=this._minEntries;this._chooseSplitAxis(e,s,o);var l=this._chooseSplitIndex(e,s,o),p=Kc(e.children.splice(l,e.children.length-l));p.height=e.height,p.leaf=e.leaf,Jc(e,this.toBBox),Jc(p,this.toBBox),t?n[t-1].children.push(p):this._splitRoot(e,p)},_splitRoot:function(n,t){this.data=Kc([n,t]),this.data.height=n.height+1,this.data.leaf=!1,Jc(this.data,this.toBBox)},_chooseSplitIndex:function(n,t,e){var o,s,l,p,h,g,m,_;for(g=m=1/0,o=t;o<=e-t;o++)s=lh(n,0,o,this.toBBox),l=lh(n,o,e,this.toBBox),p=e7(s,l),h=Kv(s)+Kv(l),p<g?(g=p,_=o,m=h<m?h:m):p===g&&h<m&&(m=h,_=o);return _},_chooseSplitAxis:function(n,t,e){var o=n.leaf?this.compareMinX:KC,s=n.leaf?this.compareMinY:jC,l=this._allDistMargin(n,t,e,o),p=this._allDistMargin(n,t,e,s);l<p&&n.children.sort(o)},_allDistMargin:function(n,t,e,o){n.children.sort(o);var s=this.toBBox,l=lh(n,0,t,s),p=lh(n,e-t,e,s),h=Qd(l)+Qd(p),g,m;for(g=t;g<e-t;g++)m=n.children[g],ch(l,n.leaf?s(m):m),h+=Qd(l);for(g=e-t-1;g>=t;g--)m=n.children[g],ch(p,n.leaf?s(m):m),h+=Qd(p);return h},_adjustParentBBoxes:function(n,t,e){for(var o=e;o>=0;o--)ch(t[o],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():Jc(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 QX(n,t,e){if(!e)return t.indexOf(n);for(var o=0;o<t.length;o++)if(e(n,t[o]))return o;return-1}function Jc(n,t){lh(n,0,n.children.length,t,n)}function lh(n,t,e,o,s){s||(s=Kc(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(var l=t,p;l<e;l++)p=n.children[l],ch(s,n.leaf?o(p):p);return s}function ch(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 KC(n,t){return n.minX-t.minX}function jC(n,t){return n.minY-t.minY}function Kv(n){return(n.maxX-n.minX)*(n.maxY-n.minY)}function Qd(n){return n.maxX-n.minX+(n.maxY-n.minY)}function t7(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 e7(n,t){var e=Math.max(n.minX,t.minX),o=Math.max(n.minY,t.minY),s=Math.min(n.maxX,t.maxX),l=Math.min(n.maxY,t.maxY);return Math.max(0,s-e)*Math.max(0,l-o)}function jv(n,t){return n.minX<=t.minX&&n.minY<=t.minY&&t.maxX<=n.maxX&&t.maxY<=n.maxY}function tg(n,t){return t.minX<=n.maxX&&t.minY<=n.maxY&&t.maxX>=n.minX&&t.maxY>=n.minY}function Kc(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function QC(n,t,e,o,s){for(var l=[t,e],p;l.length;)e=l.pop(),t=l.pop(),!(e-t<=o)&&(p=t+Math.ceil((e-t)/o/2)*o,jX(n,p,t,e,s),l.push(t,p,p,e))}});var oP=ot((jit,s_)=>{"use strict";s_.exports=ig;s_.exports.default=ig;function ig(n,t,e){e=e||2;var o=t&&t.length,s=o?t[0]*e:n.length,l=nP(n,0,s,e,!0),p=[];if(!l||l.next===l.prev)return p;var h,g,m,_,E,S,b;if(o&&(l=f7(n,t,l,e)),n.length>80*e){h=m=n[0],g=_=n[1];for(var A=e;A<s;A+=e)E=n[A],S=n[A+1],E<h&&(h=E),S<g&&(g=S),E>m&&(m=E),S>_&&(_=S);b=Math.max(m-h,_-g),b=b!==0?32767/b:0}return dh(l,p,e,h,g,b,0),p}function nP(n,t,e,o,s){var l,p;if(s===o_(n,t,e,o)>0)for(l=t;l<e;l+=o)p=eP(l,n[l],n[l+1],p);else for(l=e-o;l>=t;l-=o)p=eP(l,n[l],n[l+1],p);return p&&og(p,p.next)&&(mh(p),p=p.next),p}function kl(n,t){if(!n)return n;t||(t=n);var e=n,o;do if(o=!1,!e.steiner&&(og(e,e.next)||Hr(e.prev,e,e.next)===0)){if(mh(e),e=t=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==t);return t}function dh(n,t,e,o,s,l,p){if(n){!p&&l&&m7(n,o,s,l);for(var h=n,g,m;n.prev!==n.next;){if(g=n.prev,m=n.next,l?u7(n,o,s,l):a7(n)){t.push(g.i/e|0),t.push(n.i/e|0),t.push(m.i/e|0),mh(n),n=m.next,h=m.next;continue}if(n=m,n===h){p?p===1?(n=l7(kl(n),t,e),dh(n,t,e,o,s,l,2)):p===2&&c7(n,t,e,o,s,l):dh(kl(n),t,e,o,s,l,1);break}}}}function a7(n){var t=n.prev,e=n,o=n.next;if(Hr(t,e,o)>=0)return!1;for(var s=t.x,l=e.x,p=o.x,h=t.y,g=e.y,m=o.y,_=s<l?s<p?s:p:l<p?l:p,E=h<g?h<m?h:m:g<m?g:m,S=s>l?s>p?s:p:l>p?l:p,b=h>g?h>m?h:m:g>m?g:m,A=o.next;A!==t;){if(A.x>=_&&A.x<=S&&A.y>=E&&A.y<=b&&tf(s,h,l,g,p,m,A.x,A.y)&&Hr(A.prev,A,A.next)>=0)return!1;A=A.next}return!0}function u7(n,t,e,o){var s=n.prev,l=n,p=n.next;if(Hr(s,l,p)>=0)return!1;for(var h=s.x,g=l.x,m=p.x,_=s.y,E=l.y,S=p.y,b=h<g?h<m?h:m:g<m?g:m,A=_<E?_<S?_:S:E<S?E:S,I=h>g?h>m?h:m:g>m?g:m,w=_>E?_>S?_:S:E>S?E:S,x=r_(b,A,t,e,o),R=r_(I,w,t,e,o),C=n.prevZ,F=n.nextZ;C&&C.z>=x&&F&&F.z<=R;){if(C.x>=b&&C.x<=I&&C.y>=A&&C.y<=w&&C!==s&&C!==p&&tf(h,_,g,E,m,S,C.x,C.y)&&Hr(C.prev,C,C.next)>=0||(C=C.prevZ,F.x>=b&&F.x<=I&&F.y>=A&&F.y<=w&&F!==s&&F!==p&&tf(h,_,g,E,m,S,F.x,F.y)&&Hr(F.prev,F,F.next)>=0))return!1;F=F.nextZ}for(;C&&C.z>=x;){if(C.x>=b&&C.x<=I&&C.y>=A&&C.y<=w&&C!==s&&C!==p&&tf(h,_,g,E,m,S,C.x,C.y)&&Hr(C.prev,C,C.next)>=0)return!1;C=C.prevZ}for(;F&&F.z<=R;){if(F.x>=b&&F.x<=I&&F.y>=A&&F.y<=w&&F!==s&&F!==p&&tf(h,_,g,E,m,S,F.x,F.y)&&Hr(F.prev,F,F.next)>=0)return!1;F=F.nextZ}return!0}function l7(n,t,e){var o=n;do{var s=o.prev,l=o.next.next;!og(s,l)&&rP(s,o,o.next,l)&&gh(s,l)&&gh(l,s)&&(t.push(s.i/e|0),t.push(o.i/e|0),t.push(l.i/e|0),mh(o),mh(o.next),o=n=l),o=o.next}while(o!==n);return kl(o)}function c7(n,t,e,o,s,l){var p=n;do{for(var h=p.next.next;h!==p.prev;){if(p.i!==h.i&&_7(p,h)){var g=iP(p,h);p=kl(p,p.next),g=kl(g,g.next),dh(p,t,e,o,s,l,0),dh(g,t,e,o,s,l,0);return}h=h.next}p=p.next}while(p!==n)}function f7(n,t,e,o){var s=[],l,p,h,g,m;for(l=0,p=t.length;l<p;l++)h=t[l]*o,g=l<p-1?t[l+1]*o:n.length,m=nP(n,h,g,o,!1),m===m.next&&(m.steiner=!0),s.push(v7(m));for(s.sort(h7),l=0;l<s.length;l++)e=p7(s[l],e);return e}function h7(n,t){return n.x-t.x}function p7(n,t){var e=d7(n,t);if(!e)return t;var o=iP(e,n);return kl(o,o.next),kl(e,e.next)}function d7(n,t){var e=t,o=n.x,s=n.y,l=-1/0,p;do{if(s<=e.y&&s>=e.next.y&&e.next.y!==e.y){var h=e.x+(s-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(h<=o&&h>l&&(l=h,p=e.x<e.next.x?e:e.next,h===o))return p}e=e.next}while(e!==t);if(!p)return null;var g=p,m=p.x,_=p.y,E=1/0,S;e=p;do o>=e.x&&e.x>=m&&o!==e.x&&tf(s<_?o:l,s,m,_,s<_?l:o,s,e.x,e.y)&&(S=Math.abs(s-e.y)/(o-e.x),gh(e,n)&&(S<E||S===E&&(e.x>p.x||e.x===p.x&&g7(p,e)))&&(p=e,E=S)),e=e.next;while(e!==g);return p}function g7(n,t){return Hr(n.prev,n,t.prev)<0&&Hr(t.next,n,n.next)<0}function m7(n,t,e,o){var s=n;do s.z===0&&(s.z=r_(s.x,s.y,t,e,o)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==n);s.prevZ.nextZ=null,s.prevZ=null,y7(s)}function y7(n){var t,e,o,s,l,p,h,g,m=1;do{for(e=n,n=null,l=null,p=0;e;){for(p++,o=e,h=0,t=0;t<m&&(h++,o=o.nextZ,!!o);t++);for(g=m;h>0||g>0&&o;)h!==0&&(g===0||!o||e.z<=o.z)?(s=e,e=e.nextZ,h--):(s=o,o=o.nextZ,g--),l?l.nextZ=s:n=s,s.prevZ=l,l=s;e=o}l.nextZ=null,m*=2}while(p>1);return n}function r_(n,t,e,o,s){return n=(n-e)*s|0,t=(t-o)*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 v7(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 tf(n,t,e,o,s,l,p,h){return(s-p)*(t-h)>=(n-p)*(l-h)&&(n-p)*(o-h)>=(e-p)*(t-h)&&(e-p)*(l-h)>=(s-p)*(o-h)}function _7(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!x7(n,t)&&(gh(n,t)&&gh(t,n)&&E7(n,t)&&(Hr(n.prev,n,t.prev)||Hr(n,t.prev,t))||og(n,t)&&Hr(n.prev,n,n.next)>0&&Hr(t.prev,t,t.next)>0)}function Hr(n,t,e){return(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y)}function og(n,t){return n.x===t.x&&n.y===t.y}function rP(n,t,e,o){var s=rg(Hr(n,t,e)),l=rg(Hr(n,t,o)),p=rg(Hr(e,o,n)),h=rg(Hr(e,o,t));return!!(s!==l&&p!==h||s===0&&ng(n,e,t)||l===0&&ng(n,o,t)||p===0&&ng(e,n,o)||h===0&&ng(e,t,o))}function ng(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 rg(n){return n>0?1:n<0?-1:0}function x7(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&&rP(e,e.next,n,t))return!0;e=e.next}while(e!==n);return!1}function gh(n,t){return Hr(n.prev,n,n.next)<0?Hr(n,t,n.next)>=0&&Hr(n,n.prev,t)>=0:Hr(n,t,n.prev)<0||Hr(n,n.next,t)<0}function E7(n,t){var e=n,o=!1,s=(n.x+t.x)/2,l=(n.y+t.y)/2;do e.y>l!=e.next.y>l&&e.next.y!==e.y&&s<(e.next.x-e.x)*(l-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==n);return o}function iP(n,t){var e=new i_(n.i,n.x,n.y),o=new i_(t.i,t.x,t.y),s=n.next,l=t.prev;return n.next=t,t.prev=n,e.next=s,s.prev=e,o.next=e,e.prev=o,l.next=o,o.prev=l,o}function eP(n,t,e,o){var s=new i_(n,t,e);return o?(s.next=o.next,s.prev=o,o.next.prev=s,o.next=s):(s.prev=s,s.next=s),s}function mh(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 i_(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}ig.deviation=function(n,t,e,o){var s=t&&t.length,l=s?t[0]*e:n.length,p=Math.abs(o_(n,0,l,e));if(s)for(var h=0,g=t.length;h<g;h++){var m=t[h]*e,_=h<g-1?t[h+1]*e:n.length;p-=Math.abs(o_(n,m,_,e))}var E=0;for(h=0;h<o.length;h+=3){var S=o[h]*e,b=o[h+1]*e,A=o[h+2]*e;E+=Math.abs((n[S]-n[A])*(n[b+1]-n[S+1])-(n[S]-n[b])*(n[A+1]-n[S+1]))}return p===0&&E===0?0:Math.abs((E-p)/p)};function o_(n,t,e,o){for(var s=0,l=t,p=e-o;l<e;l+=o)s+=(n[p]-n[l])*(n[l+1]+n[p+1]),p=l;return s}ig.flatten=function(n){for(var t=n[0][0].length,e={vertices:[],holes:[],dimensions:t},o=0,s=0;s<n.length;s++){for(var l=0;l<n[s].length;l++)for(var p=0;p<t;p++)e.vertices.push(n[s][l][p]);s>0&&(o+=n[s-1].length,e.holes.push(o))}return e}});var f_=ot(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.earthRadius=63710088e-1;Oe.factors={centimeters:Oe.earthRadius*100,centimetres:Oe.earthRadius*100,degrees:Oe.earthRadius/111325,feet:Oe.earthRadius*3.28084,inches:Oe.earthRadius*39.37,kilometers:Oe.earthRadius/1e3,kilometres:Oe.earthRadius/1e3,meters:Oe.earthRadius,metres:Oe.earthRadius,miles:Oe.earthRadius/1609.344,millimeters:Oe.earthRadius*1e3,millimetres:Oe.earthRadius*1e3,nauticalmiles:Oe.earthRadius/1852,radians:1,yards:Oe.earthRadius*1.0936};Oe.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/Oe.earthRadius,yards:1.0936133};Oe.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 nl(n,t,e){e===void 0&&(e={});var o={type:"Feature"};return(e.id===0||e.id)&&(o.id=e.id),e.bbox&&(o.bbox=e.bbox),o.properties=t||{},o.geometry=n,o}Oe.feature=nl;function S7(n,t,e){switch(e===void 0&&(e={}),n){case"Point":return a_(t).geometry;case"LineString":return l_(t).geometry;case"Polygon":return u_(t).geometry;case"MultiPoint":return aP(t).geometry;case"MultiLineString":return sP(t).geometry;case"MultiPolygon":return uP(t).geometry;default:throw new Error(n+" is invalid")}}Oe.geometry=S7;function a_(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(!sg(n[0])||!sg(n[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:n};return nl(o,t,e)}Oe.point=a_;function M7(n,t,e){return e===void 0&&(e={}),ag(n.map(function(o){return a_(o,t)}),e)}Oe.points=M7;function u_(n,t,e){e===void 0&&(e={});for(var o=0,s=n;o<s.length;o++){var l=s[o];if(l.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var p=0;p<l[l.length-1].length;p++)if(l[l.length-1][p]!==l[0][p])throw new Error("First and last Position are not equivalent.")}var h={type:"Polygon",coordinates:n};return nl(h,t,e)}Oe.polygon=u_;function b7(n,t,e){return e===void 0&&(e={}),ag(n.map(function(o){return u_(o,t)}),e)}Oe.polygons=b7;function l_(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 o={type:"LineString",coordinates:n};return nl(o,t,e)}Oe.lineString=l_;function A7(n,t,e){return e===void 0&&(e={}),ag(n.map(function(o){return l_(o,t)}),e)}Oe.lineStrings=A7;function ag(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}Oe.featureCollection=ag;function sP(n,t,e){e===void 0&&(e={});var o={type:"MultiLineString",coordinates:n};return nl(o,t,e)}Oe.multiLineString=sP;function aP(n,t,e){e===void 0&&(e={});var o={type:"MultiPoint",coordinates:n};return nl(o,t,e)}Oe.multiPoint=aP;function uP(n,t,e){e===void 0&&(e={});var o={type:"MultiPolygon",coordinates:n};return nl(o,t,e)}Oe.multiPolygon=uP;function T7(n,t,e){e===void 0&&(e={});var o={type:"GeometryCollection",geometries:n};return nl(o,t,e)}Oe.geometryCollection=T7;function C7(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}Oe.round=C7;function lP(n,t){t===void 0&&(t="kilometers");var e=Oe.factors[t];if(!e)throw new Error(t+" units is invalid");return n*e}Oe.radiansToLength=lP;function c_(n,t){t===void 0&&(t="kilometers");var e=Oe.factors[t];if(!e)throw new Error(t+" units is invalid");return n/e}Oe.lengthToRadians=c_;function P7(n,t){return cP(c_(n,t))}Oe.lengthToDegrees=P7;function I7(n){var t=n%360;return t<0&&(t+=360),t}Oe.bearingToAzimuth=I7;function cP(n){var t=n%(2*Math.PI);return t*180/Math.PI}Oe.radiansToDegrees=cP;function R7(n){var t=n%360;return t*Math.PI/180}Oe.degreesToRadians=R7;function L7(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 lP(c_(n,t),e)}Oe.convertLength=L7;function N7(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 o=Oe.areaFactors[t];if(!o)throw new Error("invalid original units");var s=Oe.areaFactors[e];if(!s)throw new Error("invalid final units");return n/o*s}Oe.convertArea=N7;function sg(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}Oe.isNumber=sg;function O7(n){return!!n&&n.constructor===Object}Oe.isObject=O7;function D7(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(!sg(t))throw new Error("bbox must only contain numbers")})}Oe.validateBBox=D7;function F7(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")}Oe.validateId=F7});var p_=ot(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});var co=f_();function yh(n,t,e){if(n!==null)for(var o,s,l,p,h,g,m,_=0,E=0,S,b=n.type,A=b==="FeatureCollection",I=b==="Feature",w=A?n.features.length:1,x=0;x<w;x++){m=A?n.features[x].geometry:I?n.geometry:n,S=m?m.type==="GeometryCollection":!1,h=S?m.geometries.length:1;for(var R=0;R<h;R++){var C=0,F=0;if(p=S?m.geometries[R]:m,p!==null){g=p.coordinates;var V=p.type;switch(_=e&&(V==="Polygon"||V==="MultiPolygon")?1:0,V){case null:break;case"Point":if(t(g,E,x,C,F)===!1)return!1;E++,C++;break;case"LineString":case"MultiPoint":for(o=0;o<g.length;o++){if(t(g[o],E,x,C,F)===!1)return!1;E++,V==="MultiPoint"&&C++}V==="LineString"&&C++;break;case"Polygon":case"MultiLineString":for(o=0;o<g.length;o++){for(s=0;s<g[o].length-_;s++){if(t(g[o][s],E,x,C,F)===!1)return!1;E++}V==="MultiLineString"&&C++,V==="Polygon"&&F++}V==="Polygon"&&C++;break;case"MultiPolygon":for(o=0;o<g.length;o++){for(F=0,s=0;s<g[o].length;s++){for(l=0;l<g[o][s].length-_;l++){if(t(g[o][s][l],E,x,C,F)===!1)return!1;E++}F++}C++}break;case"GeometryCollection":for(o=0;o<p.geometries.length;o++)if(yh(p.geometries[o],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function U7(n,t,e,o){var s=e;return yh(n,function(l,p,h,g,m){p===0&&e===void 0?s=l:s=t(s,l,p,h,g,m)},o),s}function fP(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 B7(n,t,e){var o=e;return fP(n,function(s,l){l===0&&e===void 0?o=s:o=t(o,s,l)}),o}function hP(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 z7(n,t,e){var o=e;return hP(n,function(s,l){l===0&&e===void 0?o=s:o=t(o,s,l)}),o}function G7(n){var t=[];return yh(n,function(e){t.push(e)}),t}function h_(n,t){var e,o,s,l,p,h,g,m,_,E,S=0,b=n.type==="FeatureCollection",A=n.type==="Feature",I=b?n.features.length:1;for(e=0;e<I;e++){for(h=b?n.features[e].geometry:A?n.geometry:n,m=b?n.features[e].properties:A?n.properties:{},_=b?n.features[e].bbox:A?n.bbox:void 0,E=b?n.features[e].id:A?n.id:void 0,g=h?h.type==="GeometryCollection":!1,p=g?h.geometries.length:1,s=0;s<p;s++){if(l=g?h.geometries[s]:h,l===null){if(t(null,S,m,_,E)===!1)return!1;continue}switch(l.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(l,S,m,_,E)===!1)return!1;break}case"GeometryCollection":{for(o=0;o<l.geometries.length;o++)if(t(l.geometries[o],S,m,_,E)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}S++}}function k7(n,t,e){var o=e;return h_(n,function(s,l,p,h,g){l===0&&e===void 0?o=s:o=t(o,s,l,p,h,g)}),o}function ug(n,t){h_(n,function(e,o,s,l,p){var h=e===null?null:e.type;switch(h){case null:case"Point":case"LineString":case"Polygon":return t(co.feature(e,s,{bbox:l,id:p}),o,0)===!1?!1:void 0}var g;switch(h){case"MultiPoint":g="Point";break;case"MultiLineString":g="LineString";break;case"MultiPolygon":g="Polygon";break}for(var m=0;m<e.coordinates.length;m++){var _=e.coordinates[m],E={type:g,coordinates:_};if(t(co.feature(E,s),o,m)===!1)return!1}})}function q7(n,t,e){var o=e;return ug(n,function(s,l,p){l===0&&p===0&&e===void 0?o=s:o=t(o,s,l,p)}),o}function pP(n,t){ug(n,function(e,o,s){var l=0;if(e.geometry){var p=e.geometry.type;if(!(p==="Point"||p==="MultiPoint")){var h,g=0,m=0,_=0;if(yh(e,function(E,S,b,A,I){if(h===void 0||o>g||A>m||I>_){h=E,g=o,m=A,_=I,l=0;return}var w=co.lineString([h,E],e.properties);if(t(w,o,s,I,l)===!1)return!1;l++,h=E})===!1)return!1}}})}function H7(n,t,e){var o=e,s=!1;return pP(n,function(l,p,h,g,m){s===!1&&e===void 0?o=l:o=t(o,l,p,h,g,m),s=!0}),o}function dP(n,t){if(!n)throw new Error("geojson is required");ug(n,function(e,o,s){if(e.geometry!==null){var l=e.geometry.type,p=e.geometry.coordinates;switch(l){case"LineString":if(t(e,o,s,0,0)===!1)return!1;break;case"Polygon":for(var h=0;h<p.length;h++)if(t(co.lineString(p[h],e.properties),o,s,h)===!1)return!1;break}}})}function V7(n,t,e){var o=e;return dP(n,function(s,l,p,h){l===0&&e===void 0?o=s:o=t(o,s,l,p,h)}),o}function W7(n,t){if(t=t||{},!co.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,s=t.geometryIndex||0,l=t.segmentIndex||0,p=t.properties,h;switch(n.type){case"FeatureCollection":e<0&&(e=n.features.length+e),p=p||n.features[e].properties,h=n.features[e].geometry;break;case"Feature":p=p||n.properties,h=n.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":h=n;break;default:throw new Error("geojson is invalid")}if(h===null)return null;var g=h.coordinates;switch(h.type){case"Point":case"MultiPoint":return null;case"LineString":return l<0&&(l=g.length+l-1),co.lineString([g[l],g[l+1]],p,t);case"Polygon":return s<0&&(s=g.length+s),l<0&&(l=g[s].length+l-1),co.lineString([g[s][l],g[s][l+1]],p,t);case"MultiLineString":return o<0&&(o=g.length+o),l<0&&(l=g[o].length+l-1),co.lineString([g[o][l],g[o][l+1]],p,t);case"MultiPolygon":return o<0&&(o=g.length+o),s<0&&(s=g[o].length+s),l<0&&(l=g[o][s].length-l-1),co.lineString([g[o][s][l],g[o][s][l+1]],p,t)}throw new Error("geojson is invalid")}function X7(n,t){if(t=t||{},!co.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,s=t.geometryIndex||0,l=t.coordIndex||0,p=t.properties,h;switch(n.type){case"FeatureCollection":e<0&&(e=n.features.length+e),p=p||n.features[e].properties,h=n.features[e].geometry;break;case"Feature":p=p||n.properties,h=n.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":h=n;break;default:throw new Error("geojson is invalid")}if(h===null)return null;var g=h.coordinates;switch(h.type){case"Point":return co.point(g,p,t);case"MultiPoint":return o<0&&(o=g.length+o),co.point(g[o],p,t);case"LineString":return l<0&&(l=g.length+l),co.point(g[l],p,t);case"Polygon":return s<0&&(s=g.length+s),l<0&&(l=g[s].length+l),co.point(g[s][l],p,t);case"MultiLineString":return o<0&&(o=g.length+o),l<0&&(l=g[o].length+l),co.point(g[o][l],p,t);case"MultiPolygon":return o<0&&(o=g.length+o),s<0&&(s=g[o].length+s),l<0&&(l=g[o][s].length-l),co.point(g[o][s][l],p,t)}throw new Error("geojson is invalid")}Si.coordAll=G7;Si.coordEach=yh;Si.coordReduce=U7;Si.featureEach=hP;Si.featureReduce=z7;Si.findPoint=X7;Si.findSegment=W7;Si.flattenEach=ug;Si.flattenReduce=q7;Si.geomEach=h_;Si.geomReduce=k7;Si.lineEach=dP;Si.lineReduce=V7;Si.propEach=fP;Si.propReduce=B7;Si.segmentEach=pP;Si.segmentReduce=H7});var gP=ot(g_=>{"use strict";Object.defineProperty(g_,"__esModule",{value:!0});var Y7=p_();function d_(n){var t=[1/0,1/0,-1/0,-1/0];return Y7.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}d_.default=d_;g_.default=d_});var lg=ot((dot,m_)=>{var Ra=kv(),yP=f_(),vP=p_(),ef=gP().default,$7=vP.featureEach,hot=vP.coordEach,pot=yP.polygon,mP=yP.featureCollection;function _P(n){var t=new Ra(n);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:ef(e),Ra.prototype.insert.call(this,e)},t.load=function(e){var o=[];return Array.isArray(e)?e.forEach(function(s){if(s.type!=="Feature")throw new Error("invalid features");s.bbox=s.bbox?s.bbox:ef(s),o.push(s)}):$7(e,function(s){if(s.type!=="Feature")throw new Error("invalid features");s.bbox=s.bbox?s.bbox:ef(s),o.push(s)}),Ra.prototype.load.call(this,o)},t.remove=function(e,o){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:ef(e),Ra.prototype.remove.call(this,e,o)},t.clear=function(){return Ra.prototype.clear.call(this)},t.search=function(e){var o=Ra.prototype.search.call(this,this.toBBox(e));return mP(o)},t.collides=function(e){return Ra.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=Ra.prototype.all.call(this);return mP(e)},t.toJSON=function(){return Ra.prototype.toJSON.call(this)},t.fromJSON=function(e){return Ra.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var o;if(e.bbox)o=e.bbox;else if(Array.isArray(e)&&e.length===4)o=e;else if(Array.isArray(e)&&e.length===6)o=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")o=ef(e);else if(e.type==="FeatureCollection")o=ef(e);else throw new Error("invalid geojson");return{minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]}},t}m_.exports=_P;m_.exports.default=_P});var w_=ot((Sat,PP)=>{"use strict";var CP=Object.prototype.toString;PP.exports=function(t){var e=CP.call(t),o=e==="[object Arguments]";return o||(o=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&CP.call(t.callee)==="[object Function]"),o}});var BP=ot((Mat,UP)=>{"use strict";var FP;Object.keys||(xh=Object.prototype.hasOwnProperty,S_=Object.prototype.toString,IP=w_(),M_=Object.prototype.propertyIsEnumerable,RP=!M_.call({toString:null},"toString"),LP=M_.call(function(){},"prototype"),Eh=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],dg=function(n){var t=n.constructor;return t&&t.prototype===n},NP={$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},OP=function(){if(typeof window=="undefined")return!1;for(var n in window)try{if(!NP["$"+n]&&xh.call(window,n)&&window[n]!==null&&typeof window[n]=="object")try{dg(window[n])}catch(t){return!0}}catch(t){return!0}return!1}(),DP=function(n){if(typeof window=="undefined"||!OP)return dg(n);try{return dg(n)}catch(t){return!1}},FP=function(t){var e=t!==null&&typeof t=="object",o=S_.call(t)==="[object Function]",s=IP(t),l=e&&S_.call(t)==="[object String]",p=[];if(!e&&!o&&!s)throw new TypeError("Object.keys called on a non-object");var h=LP&&o;if(l&&t.length>0&&!xh.call(t,0))for(var g=0;g<t.length;++g)p.push(String(g));if(s&&t.length>0)for(var m=0;m<t.length;++m)p.push(String(m));else for(var _ in t)!(h&&_==="prototype")&&xh.call(t,_)&&p.push(String(_));if(RP)for(var E=DP(t),S=0;S<Eh.length;++S)!(E&&Eh[S]==="constructor")&&xh.call(t,Eh[S])&&p.push(Eh[S]);return p});var xh,S_,IP,M_,RP,LP,Eh,dg,NP,OP,DP;UP.exports=FP});var b_=ot((bat,kP)=>{"use strict";var iY=Array.prototype.slice,oY=w_(),zP=Object.keys,gg=zP?function(t){return zP(t)}:BP(),GP=Object.keys;gg.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(o){return oY(o)?GP(iY.call(o)):GP(o)})}else Object.keys=gg;return Object.keys||gg};kP.exports=gg});var A_=ot((Aat,qP)=>{"use strict";qP.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),o=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var s=42;t[e]=s;for(var l 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 p=Object.getOwnPropertySymbols(t);if(p.length!==1||p[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var h=Object.getOwnPropertyDescriptor(t,e);if(h.value!==s||h.enumerable!==!0)return!1}return!0}});var mg=ot((Tat,HP)=>{"use strict";var sY=A_();HP.exports=function(){return sY()&&!!Symbol.toStringTag}});var T_=ot((Cat,VP)=>{"use strict";VP.exports=Object});var C_=ot((Pat,WP)=>{"use strict";WP.exports=Error});var YP=ot((Iat,XP)=>{"use strict";XP.exports=EvalError});var ZP=ot((Rat,$P)=>{"use strict";$P.exports=RangeError});var KP=ot((Lat,JP)=>{"use strict";JP.exports=ReferenceError});var P_=ot((Nat,jP)=>{"use strict";jP.exports=SyntaxError});var ql=ot((Oat,QP)=>{"use strict";QP.exports=TypeError});var eI=ot((Dat,tI)=>{"use strict";tI.exports=URIError});var rI=ot((Fat,nI)=>{"use strict";nI.exports=Math.abs});var oI=ot((Uat,iI)=>{"use strict";iI.exports=Math.floor});var aI=ot((Bat,sI)=>{"use strict";sI.exports=Math.max});var lI=ot((zat,uI)=>{"use strict";uI.exports=Math.min});var fI=ot((Gat,cI)=>{"use strict";cI.exports=Math.pow});var pI=ot((kat,hI)=>{"use strict";hI.exports=Math.round});var gI=ot((qat,dI)=>{"use strict";dI.exports=Number.isNaN||function(t){return t!==t}});var yI=ot((Hat,mI)=>{"use strict";var aY=gI();mI.exports=function(t){return aY(t)||t===0?t:t<0?-1:1}});var _I=ot((Vat,vI)=>{"use strict";vI.exports=Object.getOwnPropertyDescriptor});var Hl=ot((Wat,xI)=>{"use strict";var yg=_I();if(yg)try{yg([],"length")}catch(n){yg=null}xI.exports=yg});var wh=ot((Xat,EI)=>{"use strict";var vg=Object.defineProperty||!1;if(vg)try{vg({},"a",{value:1})}catch(n){vg=!1}EI.exports=vg});var MI=ot((Yat,SI)=>{"use strict";var wI=typeof Symbol!="undefined"&&Symbol,uY=A_();SI.exports=function(){return typeof wI!="function"||typeof Symbol!="function"||typeof wI("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:uY()}});var I_=ot(($at,bI)=>{"use strict";bI.exports=typeof Reflect!="undefined"&&Reflect.getPrototypeOf||null});var R_=ot((Zat,AI)=>{"use strict";var lY=T_();AI.exports=lY.getPrototypeOf||null});var PI=ot((Jat,CI)=>{"use strict";var cY="Function.prototype.bind called on incompatible ",fY=Object.prototype.toString,hY=Math.max,pY="[object Function]",TI=function(t,e){for(var o=[],s=0;s<t.length;s+=1)o[s]=t[s];for(var l=0;l<e.length;l+=1)o[l+t.length]=e[l];return o},dY=function(t,e){for(var o=[],s=e||0,l=0;s<t.length;s+=1,l+=1)o[l]=t[s];return o},gY=function(n,t){for(var e="",o=0;o<n.length;o+=1)e+=n[o],o+1<n.length&&(e+=t);return e};CI.exports=function(t){var e=this;if(typeof e!="function"||fY.apply(e)!==pY)throw new TypeError(cY+e);for(var o=dY(arguments,1),s,l=function(){if(this instanceof s){var _=e.apply(this,TI(o,arguments));return Object(_)===_?_:this}return e.apply(t,TI(o,arguments))},p=hY(0,e.length-o.length),h=[],g=0;g<p;g++)h[g]="$"+g;if(s=Function("binder","return function ("+gY(h,",")+"){ return binder.apply(this,arguments); }")(l),e.prototype){var m=function(){};m.prototype=e.prototype,s.prototype=new m,m.prototype=null}return s}});var nf=ot((Kat,II)=>{"use strict";var mY=PI();II.exports=Function.prototype.bind||mY});var _g=ot((jat,RI)=>{"use strict";RI.exports=Function.prototype.call});var xg=ot((Qat,LI)=>{"use strict";LI.exports=Function.prototype.apply});var OI=ot((tut,NI)=>{"use strict";NI.exports=typeof Reflect!="undefined"&&Reflect&&Reflect.apply});var L_=ot((eut,DI)=>{"use strict";var yY=nf(),vY=xg(),_Y=_g(),xY=OI();DI.exports=xY||yY.call(_Y,vY)});var Eg=ot((nut,FI)=>{"use strict";var EY=nf(),wY=ql(),SY=_g(),MY=L_();FI.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new wY("a function is required");return MY(EY,SY,t)}});var qI=ot((rut,kI)=>{"use strict";var bY=Eg(),UI=Hl(),zI;try{zI=[].__proto__===Array.prototype}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var N_=!!zI&&UI&&UI(Object.prototype,"__proto__"),GI=Object,BI=GI.getPrototypeOf;kI.exports=N_&&typeof N_.get=="function"?bY([N_.get]):typeof BI=="function"?function(t){return BI(t==null?t:GI(t))}:!1});var O_=ot((iut,XI)=>{"use strict";var HI=I_(),VI=R_(),WI=qI();XI.exports=HI?function(t){return HI(t)}:VI?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return VI(t)}:WI?function(t){return WI(t)}:null});var D_=ot((out,YI)=>{"use strict";var AY=Function.prototype.call,TY=Object.prototype.hasOwnProperty,CY=nf();YI.exports=CY.call(AY,TY)});var B_=ot((sut,QI)=>{"use strict";var Un,PY=T_(),IY=C_(),RY=YP(),LY=ZP(),NY=KP(),af=P_(),sf=ql(),OY=eI(),DY=rI(),FY=oI(),UY=aI(),BY=lI(),zY=fI(),GY=pI(),kY=yI(),KI=Function,F_=function(n){try{return KI('"use strict"; return ('+n+").constructor;")()}catch(t){}},Sh=Hl(),qY=wh(),U_=function(){throw new sf},HY=Sh?function(){try{return arguments.callee,U_}catch(n){try{return Sh(arguments,"callee").get}catch(t){return U_}}}():U_,rf=MI()(),qi=O_(),VY=R_(),WY=I_(),jI=xg(),Mh=_g(),of={},XY=typeof Uint8Array=="undefined"||!qi?Un:qi(Uint8Array),Vl={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?Un:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?Un:ArrayBuffer,"%ArrayIteratorPrototype%":rf&&qi?qi([][Symbol.iterator]()):Un,"%AsyncFromSyncIteratorPrototype%":Un,"%AsyncFunction%":of,"%AsyncGenerator%":of,"%AsyncGeneratorFunction%":of,"%AsyncIteratorPrototype%":of,"%Atomics%":typeof Atomics=="undefined"?Un:Atomics,"%BigInt%":typeof BigInt=="undefined"?Un:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?Un:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?Un:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?Un:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":IY,"%eval%":eval,"%EvalError%":RY,"%Float16Array%":typeof Float16Array=="undefined"?Un:Float16Array,"%Float32Array%":typeof Float32Array=="undefined"?Un:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?Un:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?Un:FinalizationRegistry,"%Function%":KI,"%GeneratorFunction%":of,"%Int8Array%":typeof Int8Array=="undefined"?Un:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?Un:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?Un:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":rf&&qi?qi(qi([][Symbol.iterator]())):Un,"%JSON%":typeof JSON=="object"?JSON:Un,"%Map%":typeof Map=="undefined"?Un:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!rf||!qi?Un:qi(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":PY,"%Object.getOwnPropertyDescriptor%":Sh,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?Un:Promise,"%Proxy%":typeof Proxy=="undefined"?Un:Proxy,"%RangeError%":LY,"%ReferenceError%":NY,"%Reflect%":typeof Reflect=="undefined"?Un:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?Un:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!rf||!qi?Un:qi(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?Un:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":rf&&qi?qi(""[Symbol.iterator]()):Un,"%Symbol%":rf?Symbol:Un,"%SyntaxError%":af,"%ThrowTypeError%":HY,"%TypedArray%":XY,"%TypeError%":sf,"%Uint8Array%":typeof Uint8Array=="undefined"?Un:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?Un:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?Un:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?Un:Uint32Array,"%URIError%":OY,"%WeakMap%":typeof WeakMap=="undefined"?Un:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?Un:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?Un:WeakSet,"%Function.prototype.call%":Mh,"%Function.prototype.apply%":jI,"%Object.defineProperty%":qY,"%Object.getPrototypeOf%":VY,"%Math.abs%":DY,"%Math.floor%":FY,"%Math.max%":UY,"%Math.min%":BY,"%Math.pow%":zY,"%Math.round%":GY,"%Math.sign%":kY,"%Reflect.getPrototypeOf%":WY};if(qi)try{null.error}catch(n){$I=qi(qi(n)),Vl["%Error.prototype%"]=$I}var $I,YY=function n(t){var e;if(t==="%AsyncFunction%")e=F_("async function () {}");else if(t==="%GeneratorFunction%")e=F_("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=F_("async function* () {}");else if(t==="%AsyncGenerator%"){var o=n("%AsyncGeneratorFunction%");o&&(e=o.prototype)}else if(t==="%AsyncIteratorPrototype%"){var s=n("%AsyncGenerator%");s&&qi&&(e=qi(s.prototype))}return Vl[t]=e,e},ZI={__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"]},bh=nf(),wg=D_(),$Y=bh.call(Mh,Array.prototype.concat),ZY=bh.call(jI,Array.prototype.splice),JI=bh.call(Mh,String.prototype.replace),Sg=bh.call(Mh,String.prototype.slice),JY=bh.call(Mh,RegExp.prototype.exec),KY=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,jY=/\\\\(\\\\)?/g,QY=function(t){var e=Sg(t,0,1),o=Sg(t,-1);if(e==="%"&&o!=="%")throw new af("invalid intrinsic syntax, expected closing \`%\`");if(o==="%"&&e!=="%")throw new af("invalid intrinsic syntax, expected opening \`%\`");var s=[];return JI(t,KY,function(l,p,h,g){s[s.length]=h?JI(g,jY,"$1"):p||l}),s},t$=function(t,e){var o=t,s;if(wg(ZI,o)&&(s=ZI[o],o="%"+s[0]+"%"),wg(Vl,o)){var l=Vl[o];if(l===of&&(l=YY(o)),typeof l=="undefined"&&!e)throw new sf("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:s,name:o,value:l}}throw new af("intrinsic "+t+" does not exist!")};QI.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new sf("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new sf('"allowMissing" argument must be a boolean');if(JY(/^%?[^%]*%?$/,t)===null)throw new af("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var o=QY(t),s=o.length>0?o[0]:"",l=t$("%"+s+"%",e),p=l.name,h=l.value,g=!1,m=l.alias;m&&(s=m[0],ZY(o,$Y([0,1],m)));for(var _=1,E=!0;_<o.length;_+=1){var S=o[_],b=Sg(S,0,1),A=Sg(S,-1);if((b==='"'||b==="'"||b==="\`"||A==='"'||A==="'"||A==="\`")&&b!==A)throw new af("property names with quotes must have matching quotes");if((S==="constructor"||!E)&&(g=!0),s+="."+S,p="%"+s+"%",wg(Vl,p))h=Vl[p];else if(h!=null){if(!(S in h)){if(!e)throw new sf("base intrinsic for "+t+" exists, but the property is not available.");return}if(Sh&&_+1>=o.length){var I=Sh(h,S);E=!!I,E&&"get"in I&&!("originalValue"in I.get)?h=I.get:h=h[S]}else E=wg(h,S),h=h[S];E&&!g&&(Vl[p]=h)}}return h}});var Mg=ot((aut,nR)=>{"use strict";var tR=B_(),eR=Eg(),e$=eR([tR("%String.prototype.indexOf%")]);nR.exports=function(t,e){var o=tR(t,!!e);return typeof o=="function"&&e$(t,".prototype.")>-1?eR([o]):o}});var oR=ot((uut,iR)=>{"use strict";var n$=mg()(),r$=Mg(),z_=r$("Object.prototype.toString"),bg=function(t){return n$&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:z_(t)==="[object Arguments]"},rR=function(t){return bg(t)?!0:t!==null&&typeof t=="object"&&"length"in t&&typeof t.length=="number"&&t.length>=0&&z_(t)!=="[object Array]"&&"callee"in t&&z_(t.callee)==="[object Function]"},i$=function(){return bg(arguments)}();bg.isLegacyArguments=rR;iR.exports=i$?bg:rR});var Ag=ot((lut,uR)=>{"use strict";var sR=wh(),o$=P_(),uf=ql(),aR=Hl();uR.exports=function(t,e,o){if(!t||typeof t!="object"&&typeof t!="function")throw new uf("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new uf("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new uf("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new uf("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new uf("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new uf("\`loose\`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,p=arguments.length>5?arguments[5]:null,h=arguments.length>6?arguments[6]:!1,g=!!aR&&aR(t,e);if(sR)sR(t,e,{configurable:p===null&&g?g.configurable:!p,enumerable:s===null&&g?g.enumerable:!s,value:o,writable:l===null&&g?g.writable:!l});else if(h||!s&&!l&&!p)t[e]=o;else throw new o$("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Tg=ot((cut,cR)=>{"use strict";var G_=wh(),lR=function(){return!!G_};lR.hasArrayLengthDefineBug=function(){if(!G_)return null;try{return G_([],"length",{value:1}).length!==1}catch(t){return!0}};cR.exports=lR});var lf=ot((fut,dR)=>{"use strict";var s$=b_(),a$=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",u$=Object.prototype.toString,l$=Array.prototype.concat,fR=Ag(),c$=function(n){return typeof n=="function"&&u$.call(n)==="[object Function]"},hR=Tg()(),f$=function(n,t,e,o){if(t in n){if(o===!0){if(n[t]===e)return}else if(!c$(o)||!o())return}hR?fR(n,t,e,!0):fR(n,t,e)},pR=function(n,t){var e=arguments.length>2?arguments[2]:{},o=s$(t);a$&&(o=l$.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s<o.length;s+=1)f$(n,o[s],t[o[s]],e[o[s]])};pR.supportsDescriptors=!!hR;dR.exports=pR});var _R=ot((hut,vR)=>{"use strict";var h$=B_(),gR=Ag(),p$=Tg()(),mR=Hl(),yR=ql(),d$=h$("%Math.floor%");vR.exports=function(t,e){if(typeof t!="function")throw new yR("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||d$(e)!==e)throw new yR("\`length\` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],s=!0,l=!0;if("length"in t&&mR){var p=mR(t,"length");p&&!p.configurable&&(s=!1),p&&!p.writable&&(l=!1)}return(s||l||!o)&&(p$?gR(t,"length",e,!0,!0):gR(t,"length",e)),t}});var ER=ot((put,xR)=>{"use strict";var g$=nf(),m$=xg(),y$=L_();xR.exports=function(){return y$(g$,m$,arguments)}});var k_=ot((dut,Cg)=>{"use strict";var v$=_R(),wR=wh(),_$=Eg(),SR=ER();Cg.exports=function(t){var e=_$(arguments),o=t.length-(arguments.length-1);return v$(e,1+(o>0?o:0),!0)};wR?wR(Cg.exports,"apply",{value:SR}):Cg.exports.apply=SR});var q_=ot((gut,bR)=>{"use strict";var MR=function(n){return n!==n};bR.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||MR(t)&&MR(e))}});var H_=ot((mut,AR)=>{"use strict";var x$=q_();AR.exports=function(){return typeof Object.is=="function"?Object.is:x$}});var CR=ot((yut,TR)=>{"use strict";var E$=H_(),w$=lf();TR.exports=function(){var t=E$();return w$(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var LR=ot((vut,RR)=>{"use strict";var S$=lf(),M$=k_(),b$=q_(),PR=H_(),A$=CR(),IR=M$(PR(),Object);S$(IR,{getPolyfill:PR,implementation:b$,shim:A$});RR.exports=IR});var BR=ot((_ut,UR)=>{"use strict";var NR=Mg(),T$=mg()(),C$=D_(),P$=Hl(),X_;T$?(OR=NR("RegExp.prototype.exec"),V_={},Pg=function(){throw V_},W_={toString:Pg,valueOf:Pg},typeof Symbol.toPrimitive=="symbol"&&(W_[Symbol.toPrimitive]=Pg),X_=function(t){if(!t||typeof t!="object")return!1;var e=P$(t,"lastIndex"),o=e&&C$(e,"value");if(!o)return!1;try{OR(t,W_)}catch(s){return s===V_}}):(DR=NR("Object.prototype.toString"),FR="[object RegExp]",X_=function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:DR(t)===FR});var OR,V_,Pg,W_,DR,FR;UR.exports=X_});var GR=ot((xut,zR)=>{"use strict";var Th=function(){return typeof function(){}.name=="string"},Ah=Object.getOwnPropertyDescriptor;if(Ah)try{Ah([],"length")}catch(n){Ah=null}Th.functionsHaveConfigurableNames=function(){if(!Th()||!Ah)return!1;var t=Ah(function(){},"name");return!!t&&!!t.configurable};var I$=Function.prototype.bind;Th.boundFunctionsHaveNames=function(){return Th()&&typeof I$=="function"&&function(){}.bind().name!==""};zR.exports=Th});var HR=ot((Eut,qR)=>{"use strict";var kR=Ag(),R$=Tg()(),L$=GR().functionsHaveConfigurableNames(),N$=ql();qR.exports=function(t,e){if(typeof t!="function")throw new N$("\`fn\` is not a function");var o=arguments.length>2&&!!arguments[2];return(!o||L$)&&(R$?kR(t,"name",e,!0,!0):kR(t,"name",e)),t}});var Y_=ot((wut,VR)=>{"use strict";var O$=HR(),D$=ql(),F$=Object;VR.exports=O$(function(){if(this==null||this!==F$(this))throw new D$("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 $_=ot((Sut,WR)=>{"use strict";var U$=Y_(),B$=lf().supportsDescriptors,z$=Object.getOwnPropertyDescriptor;WR.exports=function(){if(B$&&/a/mig.flags==="gim"){var t=z$(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",o={};if(Object.defineProperty(o,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(o,"sticky",{get:function(){e+="y"}}),t.get.call(o),e==="dy")return t.get}}return U$}});var $R=ot((Mut,YR)=>{"use strict";var G$=lf().supportsDescriptors,k$=$_(),q$=Hl(),H$=Object.defineProperty,V$=C_(),XR=O_(),W$=/a/;YR.exports=function(){if(!G$||!XR)throw new V$("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=k$(),e=XR(W$),o=q$(e,"flags");return(!o||o.get!==t)&&H$(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var jR=ot((but,KR)=>{"use strict";var X$=lf(),Y$=k_(),$$=Y_(),ZR=$_(),Z$=$R(),JR=Y$(ZR());X$(JR,{getPolyfill:ZR,implementation:$$,shim:Z$});KR.exports=JR});var eL=ot((Aut,tL)=>{"use strict";var QR=Mg(),J$=QR("Date.prototype.getDay"),K$=function(t){try{return J$(t),!0}catch(e){return!1}},j$=QR("Object.prototype.toString"),Q$="[object Date]",tZ=mg()();tL.exports=function(t){return typeof t!="object"||t===null?!1:tZ?K$(t):j$(t)===Q$}});var Z_=ot((Tut,hL)=>{var nL=b_(),rL=oR(),iL=LR(),oL=BR(),sL=jR(),aL=eL(),uL=Date.prototype.getTime;function fL(n,t,e){var o=e||{};return(o.strict?iL(n,t):n===t)?!0:!n||!t||typeof n!="object"&&typeof t!="object"?o.strict?iL(n,t):n==t:eZ(n,t,o)}function lL(n){return n==null}function cL(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 eZ(n,t,e){var o,s;if(typeof n!=typeof t||lL(n)||lL(t)||n.prototype!==t.prototype||rL(n)!==rL(t))return!1;var l=oL(n),p=oL(t);if(l!==p)return!1;if(l||p)return n.source===t.source&&sL(n)===sL(t);if(aL(n)&&aL(t))return uL.call(n)===uL.call(t);var h=cL(n),g=cL(t);if(h!==g)return!1;if(h||g){if(n.length!==t.length)return!1;for(o=0;o<n.length;o++)if(n[o]!==t[o])return!1;return!0}if(typeof n!=typeof t)return!1;try{var m=nL(n),_=nL(t)}catch(E){return!1}if(m.length!==_.length)return!1;for(m.sort(),_.sort(),o=m.length-1;o>=0;o--)if(m[o]!=_[o])return!1;for(o=m.length-1;o>=0;o--)if(s=m[o],!fL(n[s],t[s],e))return!1;return!0}hL.exports=fL});var a1=ot((Nct,_L)=>{var WZ=Z_(),La=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:XZ};La.prototype.compare=function(n,t){if(n.type!==t.type||!vL(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,o=yL(n),s=yL(t);return o.every(function(l){return this.some(function(p){return e.compare(l,p)})},s)}}return!1};function yL(n){return n.coordinates.map(function(t){return{type:n.type.replace("Multi",""),coordinates:t}})}function vL(n,t){return n.hasOwnProperty("coordinates")?n.coordinates.length===t.coordinates.length:n.length===t.length}La.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};La.prototype.compareLine=function(n,t,e,o){if(!vL(n,t))return!1;var s=this.pseudoNode?n:this.removePseudo(n),l=this.pseudoNode?t:this.removePseudo(t);if(!(o&&!this.compareCoord(s[0],l[0])&&(l=this.fixStartIndex(l,s),!l))){var p=this.compareCoord(s[e],l[e]);return this.direction||p?this.comparePath(s,l):this.compareCoord(s[e],l[l.length-(1+e)])?this.comparePath(s.slice().reverse(),l):!1}};La.prototype.fixStartIndex=function(n,t){for(var e,o=-1,s=0;s<n.length;s++)if(this.compareCoord(n[s],t[0])){o=s;break}return o>=0&&(e=[].concat(n.slice(o,n.length),n.slice(1,o+1))),e};La.prototype.comparePath=function(n,t){var e=this;return n.every(function(o,s){return e.compareCoord(o,this[s])},t)};La.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),o=t.coordinates.slice(1,t.coordinates.length),s=this;return e.every(function(l){return this.some(function(p){return s.compareLine(l,p,1,!0)})},o)}else return!1};La.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)};La.prototype.compareBBox=function(n,t){return!!(!n.bbox&&!t.bbox||n.bbox&&t.bbox&&this.compareCoord(n.bbox,t.bbox))};La.prototype.removePseudo=function(n){return n};function XZ(n,t){return WZ(n,t,{strict:!0})}_L.exports=La});var xL=ot((Wct,Lg)=>{function il(n,t,e,o){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,o)}il.prototype.run=function(n,t,e,o){this._init(n,t,e,o);for(var s=0;s<this._datasetLength;s++)if(this._visited[s]!==1){this._visited[s]=1;var l=this._regionQuery(s);if(l.length<this.minPts)this.noise.push(s);else{var p=this.clusters.length;this.clusters.push([]),this._addToCluster(s,p),this._expandCluster(p,l)}}return this.clusters};il.prototype._init=function(n,t,e,o){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),o&&(this.distance=o)};il.prototype._expandCluster=function(n,t){for(var e=0;e<t.length;e++){var o=t[e];if(this._visited[o]!==1){this._visited[o]=1;var s=this._regionQuery(o);s.length>=this.minPts&&(t=this._mergeArrays(t,s))}this._assigned[o]!==1&&this._addToCluster(o,n)}};il.prototype._addToCluster=function(n,t){this.clusters[t].push(n),this._assigned[n]=1};il.prototype._regionQuery=function(n){for(var t=[],e=0;e<this._datasetLength;e++){var o=this.distance(this.dataset[n],this.dataset[e]);o<this.epsilon&&t.push(e)}return t};il.prototype._mergeArrays=function(n,t){for(var e=t.length,o=0;o<e;o++){var s=t[o];n.indexOf(s)<0&&n.push(s)}return n};il.prototype._euclideanDistance=function(n,t){for(var e=0,o=Math.min(n.length,t.length);o--;)e+=(n[o]-t[o])*(n[o]-t[o]);return Math.sqrt(e)};typeof Lg!="undefined"&&Lg.exports&&(Lg.exports=il)});var EL=ot((Xct,Ng)=>{function ol(n,t,e){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(n,t,e)}ol.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)};ol.prototype.run=function(n,t){this.init(n,t);for(var e=this.dataset.length,o=0;o<this.k;o++)this.centroids[o]=this.randomCentroid();for(var s=!0;s;){s=this.assign();for(var l=0;l<this.k;l++){for(var p=new Array(_),h=0,g=0;g<_;g++)p[g]=0;for(var m=0;m<e;m++){var _=this.dataset[m].length;if(l===this.assignments[m]){for(var g=0;g<_;g++)p[g]+=this.dataset[m][g];h++}}if(h>0){for(var g=0;g<_;g++)p[g]/=h;this.centroids[l]=p}else this.centroids[l]=this.randomCentroid(),s=!0}}return this.getClusters()};ol.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};ol.prototype.assign=function(){for(var n=!1,t=this.dataset.length,e,o=0;o<t;o++)e=this.argmin(this.dataset[o],this.centroids,this.distance),e!=this.assignments[o]&&(this.assignments[o]=e,n=!0);return n};ol.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};ol.prototype.argmin=function(n,t,e){for(var o=Number.MAX_VALUE,s=0,l=t.length,p,h=0;h<l;h++)p=e(n,t[h]),p<o&&(o=p,s=h);return s};ol.prototype.distance=function(n,t){for(var e=0,o=Math.min(n.length,t.length);o--;){var s=n[o]-t[o];e+=s*s}return Math.sqrt(e)};typeof Ng!="undefined"&&Ng.exports&&(Ng.exports=ol)});var u1=ot((Yct,Og)=>{function Na(n,t,e){this._queue=[],this._priorities=[],this._sorting="desc",this._init(n,t,e)}Na.prototype.insert=function(n,t){for(var e=this._queue.length,o=e;o--;){var s=this._priorities[o];this._sorting==="desc"?t>s&&(e=o):t<s&&(e=o)}this._insertAt(n,t,e)};Na.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}}};Na.prototype.forEach=function(n){this._queue.forEach(n)};Na.prototype.getElements=function(){return this._queue};Na.prototype.getElementPriority=function(n){return this._priorities[n]};Na.prototype.getPriorities=function(){return this._priorities};Na.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};Na.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 o=0;o<n.length;o++)this.insert(n[o],t[o])}e&&(this._sorting=e)};Na.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 Og!="undefined"&&Og.exports&&(Og.exports=Na)});var SL=ot(($ct,ff)=>{typeof ff!="undefined"&&ff.exports&&(wL=u1());var wL;function gu(n,t,e,o){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(n,t,e,o)}gu.prototype.run=function(n,t,e,o){this._init(n,t,e,o);for(var s=0,l=this.dataset.length;s<l;s++)if(this._processed[s]!==1){this._processed[s]=1,this.clusters.push([s]);var p=this.clusters.length-1;this._orderedList.push(s);var h=new wL(null,null,"asc"),g=this._regionQuery(s);this._distanceToCore(s)!==void 0&&(this._updateQueue(s,g,h),this._expandCluster(p,h))}return this.clusters};gu.prototype.getReachabilityPlot=function(){for(var n=[],t=0,e=this._orderedList.length;t<e;t++){var o=this._orderedList[t],s=this._reachability[o];n.push([o,s])}return n};gu.prototype._init=function(n,t,e,o){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),o&&(this.distance=o)};gu.prototype._updateQueue=function(n,t,e){var o=this;this._coreDistance=this._distanceToCore(n),t.forEach(function(s){if(o._processed[s]===void 0){var l=o.distance(o.dataset[n],o.dataset[s]),p=Math.max(o._coreDistance,l);o._reachability[s]===void 0?(o._reachability[s]=p,e.insert(s,p)):p<o._reachability[s]&&(o._reachability[s]=p,e.remove(s),e.insert(s,p))}})};gu.prototype._expandCluster=function(n,t){for(var e=t.getElements(),o=0,s=e.length;o<s;o++){var l=e[o];if(this._processed[l]===void 0){var p=this._regionQuery(l);this._processed[l]=1,this.clusters[n].push(l),this._orderedList.push(l),this._distanceToCore(l)!==void 0&&(this._updateQueue(l,p,t),this._expandCluster(n,t))}}};gu.prototype._distanceToCore=function(n){for(var t=this.epsilon,e=0;e<t;e++){var o=this._regionQuery(n,e);if(o.length>=this.minPts)return e}};gu.prototype._regionQuery=function(n,t){t=t||this.epsilon;for(var e=[],o=0,s=this.dataset.length;o<s;o++)this.distance(this.dataset[n],this.dataset[o])<t&&e.push(o);return e};gu.prototype._euclideanDistance=function(n,t){for(var e=0,o=Math.min(n.length,t.length);o--;)e+=(n[o]-t[o])*(n[o]-t[o]);return Math.sqrt(e)};typeof ff!="undefined"&&ff.exports&&(ff.exports=gu)});var ML=ot((Zct,Dg)=>{typeof Dg!="undefined"&&Dg.exports&&(Dg.exports={DBSCAN:xL(),KMEANS:EL(),OPTICS:SL(),PriorityQueue:u1()})});var l1=ot((eft,AL)=>{"use strict";AL.exports={eudist:function(t,e,o){for(var s=t.length,l=0,p=0;p<s;p++){var h=(t[p]||0)-(e[p]||0);l+=h*h}return o?Math.sqrt(l):l},mandist:function(t,e,o){for(var s=t.length,l=0,p=0;p<s;p++)l+=Math.abs((t[p]||0)-(e[p]||0));return o?Math.sqrt(l):l},dist:function(t,e,o){var s=Math.abs(t-e);return o?s:s*s}}});var PL=ot((nft,CL)=>{"use strict";var TL=l1(),jZ=TL.eudist,QZ=TL.dist;CL.exports={kmrand:function(t,e){for(var o={},s=[],l=e<<2,p=t.length,h=t[0].length>0;s.length<e&&l-- >0;){var g=t[Math.floor(Math.random()*p)],m=h?g.join("_"):""+g;o[m]||(o[m]=!0,s.push(g))}if(s.length<e)throw new Error("Error initializating clusters");return s},kmpp:function(t,e){var o=t[0].length?jZ:QZ,s=[],l=t.length,p=t[0].length>0,h={},g=t[Math.floor(Math.random()*l)],m=p?g.join("_"):""+g;for(s.push(g),h[m]=!0;s.length<e;){for(var _=[],E=s.length,S=0,b=[],A=0;A<l;A++){for(var I=1/0,w=0;w<E;w++){var x=o(t[A],s[w]);x<=I&&(I=x)}_[A]=I}for(var R=0;R<l;R++)S+=_[R];for(var C=0;C<l;C++)b[C]={i:C,v:t[C],pr:_[C]/S,cs:0};b.sort(function(q,D){return q.pr-D.pr}),b[0].cs=b[0].pr;for(var F=1;F<l;F++)b[F].cs=b[F-1].cs+b[F].pr;for(var V=Math.random(),X=0;X<l-1&&b[X++].cs<V;);s.push(b[X-1].v)}return s}}});var OL=ot((oft,NL)=>{"use strict";var c1=l1(),LL=PL(),tJ=c1.eudist,rft=c1.mandist,ift=c1.dist,eJ=LL.kmrand,nJ=LL.kmpp,IL=1e4;function RL(n,t,e){e=e||[];for(var o=0;o<n;o++)e[o]=t;return e}function rJ(n,t,e,o){var s=[],l=[],p=[],h=[],g=!1,m=o||IL,_=n.length,E=n[0].length,S=E>0,b=[];if(e)e=="kmrand"?s=eJ(n,t):e=="kmpp"?s=nJ(n,t):s=e;else for(var A={};s.length<t;){var I=Math.floor(Math.random()*_);A[I]||(A[I]=!0,s.push(n[I]))}do{RL(t,0,b);for(var w=0;w<_;w++){for(var x=1/0,R=0,C=0;C<t;C++){var h=S?tJ(n[w],s[C]):Math.abs(n[w]-s[C]);h<=x&&(x=h,R=C)}p[w]=R,b[R]++}for(var F=[],l=[],V=0,X=0;X<t;X++)F[X]=S?RL(E,0,F[X]):0,l[X]=s[X];if(S){for(var q=0;q<t;q++)s[q]=[];for(var D=0;D<_;D++)for(var xt=p[D],B=F[xt],j=n[D],J=0;J<E;J++)B[J]+=j[J];g=!0;for(var Dt=0;Dt<t;Dt++){for(var Q=s[Dt],At=F[Dt],Mt=l[Dt],Lt=b[Dt],pt=0;pt<E;pt++)Q[pt]=At[pt]/Lt||0;if(g){for(var yt=0;yt<E;yt++)if(Mt[yt]!=Q[yt]){g=!1;break}}}}else{for(var K=0;K<_;K++){var Bt=p[K];F[Bt]+=n[K]}for(var Gt=0;Gt<t;Gt++)s[Gt]=F[Gt]/b[Gt]||0;g=!0;for(var ae=0;ae<t;ae++)if(l[ae]!=s[ae]){g=!1;break}}g=g||--m<=0}while(!g);return{it:IL-m,k:t,idxs:p,centroids:s}}NL.exports=rJ});var mf=ot((m1,y1)=>{(function(n,t){typeof m1=="object"&&typeof y1!="undefined"?y1.exports=t():typeof define=="function"&&define.amd?define(t):(n=typeof globalThis!="undefined"?globalThis:n||self,n.polygonClipping=t())})(m1,function(){"use strict";function n(rt,P){var N={label:0,sent:function(){if(W[0]&1)throw W[1];return W[1]},trys:[],ops:[]},k,$,W,ht;return ht={next:at(0),throw:at(1),return:at(2)},typeof Symbol=="function"&&(ht[Symbol.iterator]=function(){return this}),ht;function at(Et){return function(G){return wt([Et,G])}}function wt(Et){if(k)throw new TypeError("Generator is already executing.");for(;N;)try{if(k=1,$&&(W=Et[0]&2?$.return:Et[0]?$.throw||((W=$.return)&&W.call($),0):$.next)&&!(W=W.call($,Et[1])).done)return W;switch($=0,W&&(Et=[Et[0]&2,W.value]),Et[0]){case 0:case 1:W=Et;break;case 4:return N.label++,{value:Et[1],done:!1};case 5:N.label++,$=Et[1],Et=[0];continue;case 7:Et=N.ops.pop(),N.trys.pop();continue;default:if(W=N.trys,!(W=W.length>0&&W[W.length-1])&&(Et[0]===6||Et[0]===2)){N=0;continue}if(Et[0]===3&&(!W||Et[1]>W[0]&&Et[1]<W[3])){N.label=Et[1];break}if(Et[0]===6&&N.label<W[1]){N.label=W[1],W=Et;break}if(W&&N.label<W[2]){N.label=W[2],N.ops.push(Et);break}W[2]&&N.ops.pop(),N.trys.pop();continue}Et=P.call(rt,N)}catch(G){Et=[6,G],$=0}finally{k=W=0}if(Et[0]&5)throw Et[1];return{value:Et[0]?Et[1]:void 0,done:!0}}}var t=function(){function rt(P,N){this.next=null,this.key=P,this.data=N,this.left=null,this.right=null}return rt}();function e(rt,P){return rt>P?1:rt<P?-1:0}function o(rt,P,N){for(var k=new t(null,null),$=k,W=k;;){var ht=N(rt,P.key);if(ht<0){if(P.left===null)break;if(N(rt,P.left.key)<0){var at=P.left;if(P.left=at.right,at.right=P,P=at,P.left===null)break}W.left=P,W=P,P=P.left}else if(ht>0){if(P.right===null)break;if(N(rt,P.right.key)>0){var at=P.right;if(P.right=at.left,at.left=P,P=at,P.right===null)break}$.right=P,$=P,P=P.right}else break}return $.right=P.left,W.left=P.right,P.left=k.right,P.right=k.left,P}function s(rt,P,N,k){var $=new t(rt,P);if(N===null)return $.left=$.right=null,$;N=o(rt,N,k);var W=k(rt,N.key);return W<0?($.left=N.left,$.right=N,N.left=null):W>=0&&($.right=N.right,$.left=N,N.right=null),$}function l(rt,P,N){var k=null,$=null;if(P){P=o(rt,P,N);var W=N(P.key,rt);W===0?(k=P.left,$=P.right):W<0?($=P.right,P.right=null,k=P):(k=P.left,P.left=null,$=P)}return{left:k,right:$}}function p(rt,P,N){return P===null?rt:(rt===null||(P=o(rt.key,P,N),P.left=rt),P)}function h(rt,P,N,k,$){if(rt){k(""+P+(N?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+$(rt)+\`
|
|
11821
11821
|
\`);var W=P+(N?" ":"\\u2502 ");rt.left&&h(rt.left,W,!1,k,$),rt.right&&h(rt.right,W,!0,k,$)}}var g=function(){function rt(P){P===void 0&&(P=e),this._root=null,this._size=0,this._comparator=P}return rt.prototype.insert=function(P,N){return this._size++,this._root=s(P,N,this._root,this._comparator)},rt.prototype.add=function(P,N){var k=new t(P,N);this._root===null&&(k.left=k.right=null,this._size++,this._root=k);var $=this._comparator,W=o(P,this._root,$),ht=$(P,W.key);return ht===0?this._root=W:(ht<0?(k.left=W.left,k.right=W,W.left=null):ht>0&&(k.right=W.right,k.left=W,W.right=null),this._size++,this._root=k),this._root},rt.prototype.remove=function(P){this._root=this._remove(P,this._root,this._comparator)},rt.prototype._remove=function(P,N,k){var $;if(N===null)return null;N=o(P,N,k);var W=k(P,N.key);return W===0?(N.left===null?$=N.right:($=o(P,N.left,k),$.right=N.right),this._size--,$):N},rt.prototype.pop=function(){var P=this._root;if(P){for(;P.left;)P=P.left;return this._root=o(P.key,this._root,this._comparator),this._root=this._remove(P.key,this._root,this._comparator),{key:P.key,data:P.data}}return null},rt.prototype.findStatic=function(P){for(var N=this._root,k=this._comparator;N;){var $=k(P,N.key);if($===0)return N;$<0?N=N.left:N=N.right}return null},rt.prototype.find=function(P){return this._root&&(this._root=o(P,this._root,this._comparator),this._comparator(P,this._root.key)!==0)?null:this._root},rt.prototype.contains=function(P){for(var N=this._root,k=this._comparator;N;){var $=k(P,N.key);if($===0)return!0;$<0?N=N.left:N=N.right}return!1},rt.prototype.forEach=function(P,N){for(var k=this._root,$=[],W=!1;!W;)k!==null?($.push(k),k=k.left):$.length!==0?(k=$.pop(),P.call(N,k),k=k.right):W=!0;return this},rt.prototype.range=function(P,N,k,$){for(var W=[],ht=this._comparator,at=this._root,wt;W.length!==0||at;)if(at)W.push(at),at=at.left;else{if(at=W.pop(),wt=ht(at.key,N),wt>0)break;if(ht(at.key,P)>=0&&k.call($,at))return this;at=at.right}return this},rt.prototype.keys=function(){var P=[];return this.forEach(function(N){var k=N.key;return P.push(k)}),P},rt.prototype.values=function(){var P=[];return this.forEach(function(N){var k=N.data;return P.push(k)}),P},rt.prototype.min=function(){return this._root?this.minNode(this._root).key:null},rt.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},rt.prototype.minNode=function(P){if(P===void 0&&(P=this._root),P)for(;P.left;)P=P.left;return P},rt.prototype.maxNode=function(P){if(P===void 0&&(P=this._root),P)for(;P.right;)P=P.right;return P},rt.prototype.at=function(P){for(var N=this._root,k=!1,$=0,W=[];!k;)if(N)W.push(N),N=N.left;else if(W.length>0){if(N=W.pop(),$===P)return N;$++,N=N.right}else k=!0;return null},rt.prototype.next=function(P){var N=this._root,k=null;if(P.right){for(k=P.right;k.left;)k=k.left;return k}for(var $=this._comparator;N;){var W=$(P.key,N.key);if(W===0)break;W<0?(k=N,N=N.left):N=N.right}return k},rt.prototype.prev=function(P){var N=this._root,k=null;if(P.left!==null){for(k=P.left;k.right;)k=k.right;return k}for(var $=this._comparator;N;){var W=$(P.key,N.key);if(W===0)break;W<0?N=N.left:(k=N,N=N.right)}return k},rt.prototype.clear=function(){return this._root=null,this._size=0,this},rt.prototype.toList=function(){return E(this._root)},rt.prototype.load=function(P,N,k){N===void 0&&(N=[]),k===void 0&&(k=!1);var $=P.length,W=this._comparator;if(k&&A(P,N,0,$-1,W),this._root===null)this._root=m(P,N,0,$),this._size=$;else{var ht=b(this.toList(),_(P,N),W);$=this._size+$,this._root=S({head:ht},0,$)}return this},rt.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(rt.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),rt.prototype.toString=function(P){P===void 0&&(P=function(k){return String(k.key)});var N=[];return h(this._root,"",!0,function(k){return N.push(k)},P),N.join("")},rt.prototype.update=function(P,N,k){var $=this._comparator,W=l(P,this._root,$),ht=W.left,at=W.right;$(P,N)<0?at=s(N,k,at,$):ht=s(N,k,ht,$),this._root=p(ht,at,$)},rt.prototype.split=function(P){return l(P,this._root,this._comparator)},rt.prototype[Symbol.iterator]=function(){var P,N,k;return n(this,function($){switch($.label){case 0:P=this._root,N=[],k=!1,$.label=1;case 1:return k?[3,6]:P===null?[3,2]:(N.push(P),P=P.left,[3,5]);case 2:return N.length===0?[3,4]:(P=N.pop(),[4,P]);case 3:return $.sent(),P=P.right,[3,5];case 4:k=!0,$.label=5;case 5:return[3,1];case 6:return[2]}})},rt}();function m(rt,P,N,k){var $=k-N;if($>0){var W=N+Math.floor($/2),ht=rt[W],at=P[W],wt=new t(ht,at);return wt.left=m(rt,P,N,W),wt.right=m(rt,P,W+1,k),wt}return null}function _(rt,P){for(var N=new t(null,null),k=N,$=0;$<rt.length;$++)k=k.next=new t(rt[$],P[$]);return k.next=null,N.next}function E(rt){for(var P=rt,N=[],k=!1,$=new t(null,null),W=$;!k;)P?(N.push(P),P=P.left):N.length>0?(P=W=W.next=N.pop(),P=P.right):k=!0;return W.next=null,$.next}function S(rt,P,N){var k=N-P;if(k>0){var $=P+Math.floor(k/2),W=S(rt,P,$),ht=rt.head;return ht.left=W,rt.head=rt.head.next,ht.right=S(rt,$+1,N),ht}return null}function b(rt,P,N){for(var k=new t(null,null),$=k,W=rt,ht=P;W!==null&&ht!==null;)N(W.key,ht.key)<0?($.next=W,W=W.next):($.next=ht,ht=ht.next),$=$.next;return W!==null?$.next=W:ht!==null&&($.next=ht),k.next}function A(rt,P,N,k,$){if(!(N>=k)){for(var W=rt[N+k>>1],ht=N-1,at=k+1;;){do ht++;while($(rt[ht],W)<0);do at--;while($(rt[at],W)>0);if(ht>=at)break;var wt=rt[ht];rt[ht]=rt[at],rt[at]=wt,wt=P[ht],P[ht]=P[at],P[at]=wt}A(rt,P,N,at,$),A(rt,P,at+1,k,$)}}let I=(rt,P)=>rt.ll.x<=P.x&&P.x<=rt.ur.x&&rt.ll.y<=P.y&&P.y<=rt.ur.y,w=(rt,P)=>{if(P.ur.x<rt.ll.x||rt.ur.x<P.ll.x||P.ur.y<rt.ll.y||rt.ur.y<P.ll.y)return null;let N=rt.ll.x<P.ll.x?P.ll.x:rt.ll.x,k=rt.ur.x<P.ur.x?rt.ur.x:P.ur.x,$=rt.ll.y<P.ll.y?P.ll.y:rt.ll.y,W=rt.ur.y<P.ur.y?rt.ur.y:P.ur.y;return{ll:{x:N,y:$},ur:{x:k,y:W}}},x=Number.EPSILON;x===void 0&&(x=Math.pow(2,-52));let R=x*x,C=(rt,P)=>{if(-x<rt&&rt<x&&-x<P&&P<x)return 0;let N=rt-P;return N*N<R*rt*P?0:rt<P?-1:1};class F{constructor(){this.reset()}reset(){this.xRounder=new V,this.yRounder=new V}round(P,N){return{x:this.xRounder.round(P),y:this.yRounder.round(N)}}}class V{constructor(){this.tree=new g,this.round(0)}round(P){let N=this.tree.add(P),k=this.tree.prev(N);if(k!==null&&C(N.key,k.key)===0)return this.tree.remove(P),k.key;let $=this.tree.next(N);return $!==null&&C(N.key,$.key)===0?(this.tree.remove(P),$.key):P}}let X=new F,q=11102230246251565e-32,D=134217729,xt=(3+8*q)*q;function B(rt,P,N,k,$){let W,ht,at,wt,Et=P[0],G=k[0],st=0,et=0;G>Et==G>-Et?(W=Et,Et=P[++st]):(W=G,G=k[++et]);let lt=0;if(st<rt&&et<N)for(G>Et==G>-Et?(ht=Et+W,at=W-(ht-Et),Et=P[++st]):(ht=G+W,at=W-(ht-G),G=k[++et]),W=ht,at!==0&&($[lt++]=at);st<rt&&et<N;)G>Et==G>-Et?(ht=W+Et,wt=ht-W,at=W-(ht-wt)+(Et-wt),Et=P[++st]):(ht=W+G,wt=ht-W,at=W-(ht-wt)+(G-wt),G=k[++et]),W=ht,at!==0&&($[lt++]=at);for(;st<rt;)ht=W+Et,wt=ht-W,at=W-(ht-wt)+(Et-wt),Et=P[++st],W=ht,at!==0&&($[lt++]=at);for(;et<N;)ht=W+G,wt=ht-W,at=W-(ht-wt)+(G-wt),G=k[++et],W=ht,at!==0&&($[lt++]=at);return(W!==0||lt===0)&&($[lt++]=W),lt}function j(rt,P){let N=P[0];for(let k=1;k<rt;k++)N+=P[k];return N}function J(rt){return new Float64Array(rt)}let Dt=(3+16*q)*q,Q=(2+12*q)*q,At=(9+64*q)*q*q,Mt=J(4),Lt=J(8),pt=J(12),yt=J(16),K=J(4);function Bt(rt,P,N,k,$,W,ht){let at,wt,Et,G,st,et,lt,Ft,Kt,me,ve,He,Ue,Ye,je,wr,Jr,nr,Ie=rt-$,rr=N-$,pr=P-W,ur=k-W;Ye=Ie*ur,et=D*Ie,lt=et-(et-Ie),Ft=Ie-lt,et=D*ur,Kt=et-(et-ur),me=ur-Kt,je=Ft*me-(Ye-lt*Kt-Ft*Kt-lt*me),wr=pr*rr,et=D*pr,lt=et-(et-pr),Ft=pr-lt,et=D*rr,Kt=et-(et-rr),me=rr-Kt,Jr=Ft*me-(wr-lt*Kt-Ft*Kt-lt*me),ve=je-Jr,st=je-ve,Mt[0]=je-(ve+st)+(st-Jr),He=Ye+ve,st=He-Ye,Ue=Ye-(He-st)+(ve-st),ve=Ue-wr,st=Ue-ve,Mt[1]=Ue-(ve+st)+(st-wr),nr=He+ve,st=nr-He,Mt[2]=He-(nr-st)+(ve-st),Mt[3]=nr;let Qn=j(4,Mt),bi=Q*ht;if(Qn>=bi||-Qn>=bi||(st=rt-Ie,at=rt-(Ie+st)+(st-$),st=N-rr,Et=N-(rr+st)+(st-$),st=P-pr,wt=P-(pr+st)+(st-W),st=k-ur,G=k-(ur+st)+(st-W),at===0&&wt===0&&Et===0&&G===0)||(bi=At*ht+xt*Math.abs(Qn),Qn+=Ie*G+ur*at-(pr*Et+rr*wt),Qn>=bi||-Qn>=bi))return Qn;Ye=at*ur,et=D*at,lt=et-(et-at),Ft=at-lt,et=D*ur,Kt=et-(et-ur),me=ur-Kt,je=Ft*me-(Ye-lt*Kt-Ft*Kt-lt*me),wr=wt*rr,et=D*wt,lt=et-(et-wt),Ft=wt-lt,et=D*rr,Kt=et-(et-rr),me=rr-Kt,Jr=Ft*me-(wr-lt*Kt-Ft*Kt-lt*me),ve=je-Jr,st=je-ve,K[0]=je-(ve+st)+(st-Jr),He=Ye+ve,st=He-Ye,Ue=Ye-(He-st)+(ve-st),ve=Ue-wr,st=Ue-ve,K[1]=Ue-(ve+st)+(st-wr),nr=He+ve,st=nr-He,K[2]=He-(nr-st)+(ve-st),K[3]=nr;let oi=B(4,Mt,4,K,Lt);Ye=Ie*G,et=D*Ie,lt=et-(et-Ie),Ft=Ie-lt,et=D*G,Kt=et-(et-G),me=G-Kt,je=Ft*me-(Ye-lt*Kt-Ft*Kt-lt*me),wr=pr*Et,et=D*pr,lt=et-(et-pr),Ft=pr-lt,et=D*Et,Kt=et-(et-Et),me=Et-Kt,Jr=Ft*me-(wr-lt*Kt-Ft*Kt-lt*me),ve=je-Jr,st=je-ve,K[0]=je-(ve+st)+(st-Jr),He=Ye+ve,st=He-Ye,Ue=Ye-(He-st)+(ve-st),ve=Ue-wr,st=Ue-ve,K[1]=Ue-(ve+st)+(st-wr),nr=He+ve,st=nr-He,K[2]=He-(nr-st)+(ve-st),K[3]=nr;let Z=B(oi,Lt,4,K,pt);Ye=at*G,et=D*at,lt=et-(et-at),Ft=at-lt,et=D*G,Kt=et-(et-G),me=G-Kt,je=Ft*me-(Ye-lt*Kt-Ft*Kt-lt*me),wr=wt*Et,et=D*wt,lt=et-(et-wt),Ft=wt-lt,et=D*Et,Kt=et-(et-Et),me=Et-Kt,Jr=Ft*me-(wr-lt*Kt-Ft*Kt-lt*me),ve=je-Jr,st=je-ve,K[0]=je-(ve+st)+(st-Jr),He=Ye+ve,st=He-Ye,Ue=Ye-(He-st)+(ve-st),ve=Ue-wr,st=Ue-ve,K[1]=Ue-(ve+st)+(st-wr),nr=He+ve,st=nr-He,K[2]=He-(nr-st)+(ve-st),K[3]=nr;let mt=B(Z,pt,4,K,yt);return yt[mt-1]}function Gt(rt,P,N,k,$,W){let ht=(P-W)*(N-$),at=(rt-$)*(k-W),wt=ht-at,Et=Math.abs(ht+at);return Math.abs(wt)>=Dt*Et?wt:-Bt(rt,P,N,k,$,W,Et)}let ae=(rt,P)=>rt.x*P.y-rt.y*P.x,ut=(rt,P)=>rt.x*P.x+rt.y*P.y,Ut=(rt,P,N)=>{let k=Gt(rt.x,rt.y,P.x,P.y,N.x,N.y);return k>0?-1:k<0?1:0},jt=rt=>Math.sqrt(ut(rt,rt)),ce=(rt,P,N)=>{let k={x:P.x-rt.x,y:P.y-rt.y},$={x:N.x-rt.x,y:N.y-rt.y};return ae($,k)/jt($)/jt(k)},te=(rt,P,N)=>{let k={x:P.x-rt.x,y:P.y-rt.y},$={x:N.x-rt.x,y:N.y-rt.y};return ut($,k)/jt($)/jt(k)},$t=(rt,P,N)=>P.y===0?null:{x:rt.x+P.x/P.y*(N-rt.y),y:N},qt=(rt,P,N)=>P.x===0?null:{x:N,y:rt.y+P.y/P.x*(N-rt.x)},xe=(rt,P,N,k)=>{if(P.x===0)return qt(N,k,rt.x);if(k.x===0)return qt(rt,P,N.x);if(P.y===0)return $t(N,k,rt.y);if(k.y===0)return $t(rt,P,N.y);let $=ae(P,k);if($==0)return null;let W={x:N.x-rt.x,y:N.y-rt.y},ht=ae(W,P)/$,at=ae(W,k)/$,wt=rt.x+at*P.x,Et=N.x+ht*k.x,G=rt.y+at*P.y,st=N.y+ht*k.y,et=(wt+Et)/2,lt=(G+st)/2;return{x:et,y:lt}};class ft{static compare(P,N){let k=ft.comparePoints(P.point,N.point);return k!==0?k:(P.point!==N.point&&P.link(N),P.isLeft!==N.isLeft?P.isLeft?1:-1:ee.compare(P.segment,N.segment))}static comparePoints(P,N){return P.x<N.x?-1:P.x>N.x?1:P.y<N.y?-1:P.y>N.y?1:0}constructor(P,N){P.events===void 0?P.events=[this]:P.events.push(this),this.point=P,this.isLeft=N}link(P){if(P.point===this.point)throw new Error("Tried to link already linked events");let N=P.point.events;for(let k=0,$=N.length;k<$;k++){let W=N[k];this.point.events.push(W),W.point=this.point}this.checkForConsuming()}checkForConsuming(){let P=this.point.events.length;for(let N=0;N<P;N++){let k=this.point.events[N];if(k.segment.consumedBy===void 0)for(let $=N+1;$<P;$++){let W=this.point.events[$];W.consumedBy===void 0&&k.otherSE.point.events===W.otherSE.point.events&&k.segment.consume(W.segment)}}}getAvailableLinkedEvents(){let P=[];for(let N=0,k=this.point.events.length;N<k;N++){let $=this.point.events[N];$!==this&&!$.segment.ringOut&&$.segment.isInResult()&&P.push($)}return P}getLeftmostComparator(P){let N=new Map,k=$=>{let W=$.otherSE;N.set($,{sine:ce(this.point,P.point,W.point),cosine:te(this.point,P.point,W.point)})};return($,W)=>{N.has($)||k($),N.has(W)||k(W);let{sine:ht,cosine:at}=N.get($),{sine:wt,cosine:Et}=N.get(W);return ht>=0&&wt>=0?at<Et?1:at>Et?-1:0:ht<0&&wt<0?at<Et?-1:at>Et?1:0:wt<ht?-1:wt>ht?1:0}}}let Xe=0;class ee{static compare(P,N){let k=P.leftSE.point.x,$=N.leftSE.point.x,W=P.rightSE.point.x,ht=N.rightSE.point.x;if(ht<k)return 1;if(W<$)return-1;let at=P.leftSE.point.y,wt=N.leftSE.point.y,Et=P.rightSE.point.y,G=N.rightSE.point.y;if(k<$){if(wt<at&&wt<Et)return 1;if(wt>at&&wt>Et)return-1;let st=P.comparePoint(N.leftSE.point);if(st<0)return 1;if(st>0)return-1;let et=N.comparePoint(P.rightSE.point);return et!==0?et:-1}if(k>$){if(at<wt&&at<G)return-1;if(at>wt&&at>G)return 1;let st=N.comparePoint(P.leftSE.point);if(st!==0)return st;let et=P.comparePoint(N.rightSE.point);return et<0?1:et>0?-1:1}if(at<wt)return-1;if(at>wt)return 1;if(W<ht){let st=N.comparePoint(P.rightSE.point);if(st!==0)return st}if(W>ht){let st=P.comparePoint(N.rightSE.point);if(st<0)return 1;if(st>0)return-1}if(W!==ht){let st=Et-at,et=W-k,lt=G-wt,Ft=ht-$;if(st>et&<<Ft)return 1;if(st<et&<>Ft)return-1}return W>ht?1:W<ht||Et<G?-1:Et>G?1:P.id<N.id?-1:P.id>N.id?1:0}constructor(P,N,k,$){this.id=++Xe,this.leftSE=P,P.segment=this,P.otherSE=N,this.rightSE=N,N.segment=this,N.otherSE=P,this.rings=k,this.windings=$}static fromRing(P,N,k){let $,W,ht,at=ft.comparePoints(P,N);if(at<0)$=P,W=N,ht=1;else if(at>0)$=N,W=P,ht=-1;else throw new Error(\`Tried to create degenerate segment at [\${P.x}, \${P.y}]\`);let wt=new ft($,!0),Et=new ft(W,!1);return new ee(wt,Et,[k],[ht])}replaceRightSE(P){this.rightSE=P,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let P=this.leftSE.point.y,N=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:P<N?P:N},ur:{x:this.rightSE.point.x,y:P>N?P:N}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(P){return P.x===this.leftSE.point.x&&P.y===this.leftSE.point.y||P.x===this.rightSE.point.x&&P.y===this.rightSE.point.y}comparePoint(P){if(this.isAnEndpoint(P))return 0;let N=this.leftSE.point,k=this.rightSE.point,$=this.vector();if(N.x===k.x)return P.x===N.x?0:P.x<N.x?1:-1;let W=(P.y-N.y)/$.y,ht=N.x+W*$.x;if(P.x===ht)return 0;let at=(P.x-N.x)/$.x,wt=N.y+at*$.y;return P.y===wt?0:P.y<wt?-1:1}getIntersection(P){let N=this.bbox(),k=P.bbox(),$=w(N,k);if($===null)return null;let W=this.leftSE.point,ht=this.rightSE.point,at=P.leftSE.point,wt=P.rightSE.point,Et=I(N,at)&&this.comparePoint(at)===0,G=I(k,W)&&P.comparePoint(W)===0,st=I(N,wt)&&this.comparePoint(wt)===0,et=I(k,ht)&&P.comparePoint(ht)===0;if(G&&Et)return et&&!st?ht:!et&&st?wt:null;if(G)return st&&W.x===wt.x&&W.y===wt.y?null:W;if(Et)return et&&ht.x===at.x&&ht.y===at.y?null:at;if(et&&st)return null;if(et)return ht;if(st)return wt;let lt=xe(W,this.vector(),at,P.vector());return lt===null||!I($,lt)?null:X.round(lt.x,lt.y)}split(P){let N=[],k=P.events!==void 0,$=new ft(P,!0),W=new ft(P,!1),ht=this.rightSE;this.replaceRightSE(W),N.push(W),N.push($);let at=new ee($,ht,this.rings.slice(),this.windings.slice());return ft.comparePoints(at.leftSE.point,at.rightSE.point)>0&&at.swapEvents(),ft.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),k&&($.checkForConsuming(),W.checkForConsuming()),N}swapEvents(){let P=this.rightSE;this.rightSE=this.leftSE,this.leftSE=P,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let N=0,k=this.windings.length;N<k;N++)this.windings[N]*=-1}consume(P){let N=this,k=P;for(;N.consumedBy;)N=N.consumedBy;for(;k.consumedBy;)k=k.consumedBy;let $=ee.compare(N,k);if($!==0){if($>0){let W=N;N=k,k=W}if(N.prev===k){let W=N;N=k,k=W}for(let W=0,ht=k.rings.length;W<ht;W++){let at=k.rings[W],wt=k.windings[W],Et=N.rings.indexOf(at);Et===-1?(N.rings.push(at),N.windings.push(wt)):N.windings[Et]+=wt}k.rings=null,k.windings=null,k.consumedBy=N,k.leftSE.consumedBy=N.leftSE,k.rightSE.consumedBy=N.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 P=this.prev.consumedBy||this.prev;this._beforeState=P.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let P=this.beforeState();this._afterState={rings:P.rings.slice(0),windings:P.windings.slice(0),multiPolys:[]};let N=this._afterState.rings,k=this._afterState.windings,$=this._afterState.multiPolys;for(let at=0,wt=this.rings.length;at<wt;at++){let Et=this.rings[at],G=this.windings[at],st=N.indexOf(Et);st===-1?(N.push(Et),k.push(G)):k[st]+=G}let W=[],ht=[];for(let at=0,wt=N.length;at<wt;at++){if(k[at]===0)continue;let Et=N[at],G=Et.poly;if(ht.indexOf(G)===-1)if(Et.isExterior)W.push(G);else{ht.indexOf(G)===-1&&ht.push(G);let st=W.indexOf(Et.poly);st!==-1&&W.splice(st,1)}}for(let at=0,wt=W.length;at<wt;at++){let Et=W[at].multiPoly;$.indexOf(Et)===-1&&$.push(Et)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let P=this.beforeState().multiPolys,N=this.afterState().multiPolys;switch(dt.type){case"union":{let k=P.length===0,$=N.length===0;this._isInResult=k!==$;break}case"intersection":{let k,$;P.length<N.length?(k=P.length,$=N.length):(k=N.length,$=P.length),this._isInResult=$===dt.numMultiPolys&&k<$;break}case"xor":{let k=Math.abs(P.length-N.length);this._isInResult=k%2===1;break}case"difference":{let k=$=>$.length===1&&$[0].isSubject;this._isInResult=k(P)!==k(N);break}default:throw new Error(\`Unrecognized operation type found \${dt.type}\`)}return this._isInResult}}class ge{constructor(P,N,k){if(!Array.isArray(P)||P.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=N,this.isExterior=k,this.segments=[],typeof P[0][0]!="number"||typeof P[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let $=X.round(P[0][0],P[0][1]);this.bbox={ll:{x:$.x,y:$.y},ur:{x:$.x,y:$.y}};let W=$;for(let ht=1,at=P.length;ht<at;ht++){if(typeof P[ht][0]!="number"||typeof P[ht][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let wt=X.round(P[ht][0],P[ht][1]);wt.x===W.x&&wt.y===W.y||(this.segments.push(ee.fromRing(W,wt,this)),wt.x<this.bbox.ll.x&&(this.bbox.ll.x=wt.x),wt.y<this.bbox.ll.y&&(this.bbox.ll.y=wt.y),wt.x>this.bbox.ur.x&&(this.bbox.ur.x=wt.x),wt.y>this.bbox.ur.y&&(this.bbox.ur.y=wt.y),W=wt)}($.x!==W.x||$.y!==W.y)&&this.segments.push(ee.fromRing(W,$,this))}getSweepEvents(){let P=[];for(let N=0,k=this.segments.length;N<k;N++){let $=this.segments[N];P.push($.leftSE),P.push($.rightSE)}return P}}class fe{constructor(P,N){if(!Array.isArray(P))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new ge(P[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 k=1,$=P.length;k<$;k++){let W=new ge(P[k],this,!1);W.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=W.bbox.ll.x),W.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=W.bbox.ll.y),W.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=W.bbox.ur.x),W.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=W.bbox.ur.y),this.interiorRings.push(W)}this.multiPoly=N}getSweepEvents(){let P=this.exteriorRing.getSweepEvents();for(let N=0,k=this.interiorRings.length;N<k;N++){let $=this.interiorRings[N].getSweepEvents();for(let W=0,ht=$.length;W<ht;W++)P.push($[W])}return P}}class Te{constructor(P,N){if(!Array.isArray(P))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof P[0][0][0]=="number"&&(P=[P])}catch(k){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let k=0,$=P.length;k<$;k++){let W=new fe(P[k],this);W.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=W.bbox.ll.x),W.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=W.bbox.ll.y),W.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=W.bbox.ur.x),W.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=W.bbox.ur.y),this.polys.push(W)}this.isSubject=N}getSweepEvents(){let P=[];for(let N=0,k=this.polys.length;N<k;N++){let $=this.polys[N].getSweepEvents();for(let W=0,ht=$.length;W<ht;W++)P.push($[W])}return P}}class be{static factory(P){let N=[];for(let k=0,$=P.length;k<$;k++){let W=P[k];if(!W.isInResult()||W.ringOut)continue;let ht=null,at=W.leftSE,wt=W.rightSE,Et=[at],G=at.point,st=[];for(;ht=at,at=wt,Et.push(at),at.point!==G;)for(;;){let et=at.getAvailableLinkedEvents();if(et.length===0){let Kt=Et[0].point,me=Et[Et.length-1].point;throw new Error(\`Unable to complete output ring starting at [\${Kt.x}, \${Kt.y}]. Last matching segment found ends at [\${me.x}, \${me.y}].\`)}if(et.length===1){wt=et[0].otherSE;break}let lt=null;for(let Kt=0,me=st.length;Kt<me;Kt++)if(st[Kt].point===at.point){lt=Kt;break}if(lt!==null){let Kt=st.splice(lt)[0],me=Et.splice(Kt.index);me.unshift(me[0].otherSE),N.push(new be(me.reverse()));continue}st.push({index:Et.length,point:at.point});let Ft=at.getLeftmostComparator(ht);wt=et.sort(Ft)[0].otherSE;break}N.push(new be(Et))}return N}constructor(P){this.events=P;for(let N=0,k=P.length;N<k;N++)P[N].segment.ringOut=this;this.poly=null}getGeom(){let P=this.events[0].point,N=[P];for(let Et=1,G=this.events.length-1;Et<G;Et++){let st=this.events[Et].point,et=this.events[Et+1].point;Ut(st,P,et)!==0&&(N.push(st),P=st)}if(N.length===1)return null;let k=N[0],$=N[1];Ut(k,P,$)===0&&N.shift(),N.push(N[0]);let W=this.isExteriorRing()?1:-1,ht=this.isExteriorRing()?0:N.length-1,at=this.isExteriorRing()?N.length:-1,wt=[];for(let Et=ht;Et!=at;Et+=W)wt.push([N[Et].x,N[Et].y]);return wt}isExteriorRing(){if(this._isExteriorRing===void 0){let P=this.enclosingRing();this._isExteriorRing=P?!P.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let P=this.events[0];for(let $=1,W=this.events.length;$<W;$++){let ht=this.events[$];ft.compare(P,ht)>0&&(P=ht)}let N=P.segment.prevInResult(),k=N?N.prevInResult():null;for(;;){if(!N)return null;if(!k)return N.ringOut;if(k.ringOut!==N.ringOut)return k.ringOut.enclosingRing()!==N.ringOut?N.ringOut:N.ringOut.enclosingRing();N=k.prevInResult(),k=N?N.prevInResult():null}}}class Wt{constructor(P){this.exteriorRing=P,P.poly=this,this.interiorRings=[]}addInterior(P){this.interiorRings.push(P),P.poly=this}getGeom(){let P=[this.exteriorRing.getGeom()];if(P[0]===null)return null;for(let N=0,k=this.interiorRings.length;N<k;N++){let $=this.interiorRings[N].getGeom();$!==null&&P.push($)}return P}}class Me{constructor(P){this.rings=P,this.polys=this._composePolys(P)}getGeom(){let P=[];for(let N=0,k=this.polys.length;N<k;N++){let $=this.polys[N].getGeom();$!==null&&P.push($)}return P}_composePolys(P){let N=[];for(let k=0,$=P.length;k<$;k++){let W=P[k];if(!W.poly)if(W.isExteriorRing())N.push(new Wt(W));else{let ht=W.enclosingRing();ht.poly||N.push(new Wt(ht)),ht.poly.addInterior(W)}}return N}}class tt{constructor(P){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ee.compare;this.queue=P,this.tree=new g(N),this.segments=[]}process(P){let N=P.segment,k=[];if(P.consumedBy)return P.isLeft?this.queue.remove(P.otherSE):this.tree.remove(N),k;let $=P.isLeft?this.tree.add(N):this.tree.find(N);if(!$)throw new Error(\`Unable to find segment #\${N.id} [\${N.leftSE.point.x}, \${N.leftSE.point.y}] -> [\${N.rightSE.point.x}, \${N.rightSE.point.y}] in SweepLine tree.\`);let W=$,ht=$,at,wt;for(;at===void 0;)W=this.tree.prev(W),W===null?at=null:W.key.consumedBy===void 0&&(at=W.key);for(;wt===void 0;)ht=this.tree.next(ht),ht===null?wt=null:ht.key.consumedBy===void 0&&(wt=ht.key);if(P.isLeft){let Et=null;if(at){let st=at.getIntersection(N);if(st!==null&&(N.isAnEndpoint(st)||(Et=st),!at.isAnEndpoint(st))){let et=this._splitSafely(at,st);for(let lt=0,Ft=et.length;lt<Ft;lt++)k.push(et[lt])}}let G=null;if(wt){let st=wt.getIntersection(N);if(st!==null&&(N.isAnEndpoint(st)||(G=st),!wt.isAnEndpoint(st))){let et=this._splitSafely(wt,st);for(let lt=0,Ft=et.length;lt<Ft;lt++)k.push(et[lt])}}if(Et!==null||G!==null){let st=null;Et===null?st=G:G===null?st=Et:st=ft.comparePoints(Et,G)<=0?Et:G,this.queue.remove(N.rightSE),k.push(N.rightSE);let et=N.split(st);for(let lt=0,Ft=et.length;lt<Ft;lt++)k.push(et[lt])}k.length>0?(this.tree.remove(N),k.push(P)):(this.segments.push(N),N.prev=at)}else{if(at&&wt){let Et=at.getIntersection(wt);if(Et!==null){if(!at.isAnEndpoint(Et)){let G=this._splitSafely(at,Et);for(let st=0,et=G.length;st<et;st++)k.push(G[st])}if(!wt.isAnEndpoint(Et)){let G=this._splitSafely(wt,Et);for(let st=0,et=G.length;st<et;st++)k.push(G[st])}}}this.tree.remove(N)}return k}_splitSafely(P,N){this.tree.remove(P);let k=P.rightSE;this.queue.remove(k);let $=P.split(N);return $.push(k),P.consumedBy===void 0&&this.tree.add(P),$}}let z=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,It=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Ot{run(P,N,k){dt.type=P,X.reset();let $=[new Te(N,!0)];for(let st=0,et=k.length;st<et;st++)$.push(new Te(k[st],!1));if(dt.numMultiPolys=$.length,dt.type==="difference"){let st=$[0],et=1;for(;et<$.length;)w($[et].bbox,st.bbox)!==null?et++:$.splice(et,1)}if(dt.type==="intersection")for(let st=0,et=$.length;st<et;st++){let lt=$[st];for(let Ft=st+1,Kt=$.length;Ft<Kt;Ft++)if(w(lt.bbox,$[Ft].bbox)===null)return[]}let W=new g(ft.compare);for(let st=0,et=$.length;st<et;st++){let lt=$[st].getSweepEvents();for(let Ft=0,Kt=lt.length;Ft<Kt;Ft++)if(W.insert(lt[Ft]),W.size>z)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let ht=new tt(W),at=W.size,wt=W.pop();for(;wt;){let st=wt.key;if(W.size===at){let lt=st.segment;throw new Error(\`Unable to pop() \${st.isLeft?"left":"right"} SweepEvent [\${st.point.x}, \${st.point.y}] from segment #\${lt.id} [\${lt.leftSE.point.x}, \${lt.leftSE.point.y}] -> [\${lt.rightSE.point.x}, \${lt.rightSE.point.y}] from queue.\`)}if(W.size>z)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(ht.segments.length>It)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let et=ht.process(st);for(let lt=0,Ft=et.length;lt<Ft;lt++){let Kt=et[lt];Kt.consumedBy===void 0&&W.insert(Kt)}at=W.size,wt=W.pop()}X.reset();let Et=be.factory(ht.segments);return new Me(Et).getGeom()}}let dt=new Ot;var ne={union:function(rt){for(var P=arguments.length,N=new Array(P>1?P-1:0),k=1;k<P;k++)N[k-1]=arguments[k];return dt.run("union",rt,N)},intersection:function(rt){for(var P=arguments.length,N=new Array(P>1?P-1:0),k=1;k<P;k++)N[k-1]=arguments[k];return dt.run("intersection",rt,N)},xor:function(rt){for(var P=arguments.length,N=new Array(P>1?P-1:0),k=1;k<P;k++)N[k-1]=arguments[k];return dt.run("xor",rt,N)},difference:function(rt){for(var P=arguments.length,N=new Array(P>1?P-1:0),k=1;k<P;k++)N[k-1]=arguments[k];return dt.run("difference",rt,N)}};return ne})});var QL=ot((zg,jL)=>{(function(n,t){typeof zg=="object"&&typeof jL!="undefined"?t(zg):typeof define=="function"&&define.amd?define(["exports"],t):t(n.jsts={})})(zg,function(n){"use strict";function t(){}function e(r){this.message=r||""}function o(r){this.message=r||""}function s(r){this.message=r||""}function l(){}function p(r){return r===null?je:r.color}function h(r){return r===null?null:r.parent}function g(r,i){r!==null&&(r.color=i)}function m(r){return r===null?null:r.left}function _(r){return r===null?null:r.right}function E(){this.root_=null,this.size_=0}function S(){}function b(){this.array_=[],arguments[0]instanceof at&&this.addAll(arguments[0])}function A(){}function I(r){this.message=r||""}function w(){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 i=Object(this),a=Math.max(Math.min(i.length,9007199254740991),0)||0,c=1 in arguments&&parseInt(Number(arguments[1]),10)||0;c=c<0?Math.max(a+c,0):Math.min(c,a);var d=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:a;for(d=d<0?Math.max(a+arguments[2],0):Math.min(d,a);c<d;)i[c]=r,++c;return i},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,i,a){return Math.abs(r-i)<=a};var R=function(r){function i(a){r.call(this,a),this.name="IllegalArgumentException",this.message=a,this.stack=new r().stack}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i}(Error),C=function(){},F={MAX_VALUE:{configurable:!0}};C.isNaN=function(r){return Number.isNaN(r)},C.doubleToLongBits=function(r){return r},C.longBitsToDouble=function(r){return r},C.isInfinite=function(r){return!Number.isFinite(r)},F.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(C,F);var V=function(){},X=function(){},q=function(){},D=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 i=arguments[0];this.x=i.x,this.y=i.y,this.z=i.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])},xt={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};D.prototype.setOrdinate=function(r,i){switch(r){case D.X:this.x=i;break;case D.Y:this.y=i;break;case D.Z:this.z=i;break;default:throw new R("Invalid ordinate index: "+r)}},D.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 i=arguments[0],a=arguments[1];return!!x.equalsWithTolerance(this.x,i.x,a)&&!!x.equalsWithTolerance(this.y,i.y,a)}},D.prototype.getOrdinate=function(r){switch(r){case D.X:return this.x;case D.Y:return this.y;case D.Z:return this.z}throw new R("Invalid ordinate index: "+r)},D.prototype.equals3D=function(r){return this.x===r.x&&this.y===r.y&&(this.z===r.z||C.isNaN(this.z))&&C.isNaN(r.z)},D.prototype.equals=function(r){return r instanceof D&&this.equals2D(r)},D.prototype.equalInZ=function(r,i){return x.equalsWithTolerance(this.z,r.z,i)},D.prototype.compareTo=function(r){var i=r;return this.x<i.x?-1:this.x>i.x?1:this.y<i.y?-1:this.y>i.y?1:0},D.prototype.clone=function(){},D.prototype.copy=function(){return new D(this)},D.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},D.prototype.distance3D=function(r){var i=this.x-r.x,a=this.y-r.y,c=this.z-r.z;return Math.sqrt(i*i+a*a+c*c)},D.prototype.distance=function(r){var i=this.x-r.x,a=this.y-r.y;return Math.sqrt(i*i+a*a)},D.prototype.hashCode=function(){var r=17;return r=37*r+D.hashCode(this.x),r=37*r+D.hashCode(this.y)},D.prototype.setCoordinate=function(r){this.x=r.x,this.y=r.y,this.z=r.z},D.prototype.interfaces_=function(){return[V,X,t]},D.prototype.getClass=function(){return D},D.hashCode=function(){if(arguments.length===1){var r=arguments[0],i=C.doubleToLongBits(r);return Math.trunc((i^i)>>>32)}},xt.DimensionalComparator.get=function(){return B},xt.serialVersionUID.get=function(){return 6683108902428367e3},xt.NULL_ORDINATE.get=function(){return C.NaN},xt.X.get=function(){return 0},xt.Y.get=function(){return 1},xt.Z.get=function(){return 2},Object.defineProperties(D,xt);var B=function(r){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var i=arguments[0];if(i!==2&&i!==3)throw new R("only 2 or 3 dimensions may be specified");this._dimensionsToTest=i}}};B.prototype.compare=function(r,i){var a=r,c=i,d=B.compare(a.x,c.x);if(d!==0)return d;var v=B.compare(a.y,c.y);return v!==0?v:this._dimensionsToTest<=2?0:B.compare(a.z,c.z)},B.prototype.interfaces_=function(){return[q]},B.prototype.getClass=function(){return B},B.compare=function(r,i){return r<i?-1:r>i?1:C.isNaN(r)?C.isNaN(i)?0:-1:C.isNaN(i)?1:0};var j=function(){};j.prototype.create=function(){},j.prototype.interfaces_=function(){return[]},j.prototype.getClass=function(){return j};var J=function(){},Dt={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};J.prototype.interfaces_=function(){return[]},J.prototype.getClass=function(){return J},J.toLocationSymbol=function(r){switch(r){case J.EXTERIOR:return"e";case J.BOUNDARY:return"b";case J.INTERIOR:return"i";case J.NONE:return"-"}throw new R("Unknown location value: "+r)},Dt.INTERIOR.get=function(){return 0},Dt.BOUNDARY.get=function(){return 1},Dt.EXTERIOR.get=function(){return 2},Dt.NONE.get=function(){return-1},Object.defineProperties(J,Dt);var Q=function(r,i){return r.interfaces_&&r.interfaces_().indexOf(i)>-1},At=function(){},Mt={LOG_10:{configurable:!0}};At.prototype.interfaces_=function(){return[]},At.prototype.getClass=function(){return At},At.log10=function(r){var i=Math.log(r);return C.isInfinite(i)||C.isNaN(i)?i:i/At.LOG_10},At.min=function(r,i,a,c){var d=r;return i<d&&(d=i),a<d&&(d=a),c<d&&(d=c),d},At.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var r=arguments[0],i=arguments[1],a=arguments[2];return r<i?i:r>a?a:r}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var c=arguments[0],d=arguments[1],v=arguments[2];return c<d?d:c>v?v:c}},At.wrap=function(r,i){return r<0?i- -r%i:r%i},At.max=function(){if(arguments.length===3){var r=arguments[0],i=arguments[1],a=arguments[2],c=r;return i>c&&(c=i),a>c&&(c=a),c}if(arguments.length===4){var d=arguments[0],v=arguments[1],M=arguments[2],L=arguments[3],H=d;return v>H&&(H=v),M>H&&(H=M),L>H&&(H=L),H}},At.average=function(r,i){return(r+i)/2},Mt.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(At,Mt);var Lt=function(r){this.str=r};Lt.prototype.append=function(r){this.str+=r},Lt.prototype.setCharAt=function(r,i){this.str=this.str.substr(0,r)+i+this.str.substr(r+1)},Lt.prototype.toString=function(r){return this.str};var pt=function(r){this.value=r};pt.prototype.intValue=function(){return this.value},pt.prototype.compareTo=function(r){return this.value<r?-1:this.value>r?1:0},pt.isNaN=function(r){return Number.isNaN(r)};var yt=function(){};yt.isWhitespace=function(r){return r<=32&&r>=0||r===127},yt.toUpperCase=function(r){return r.toUpperCase()};var K=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 i=arguments[0];this.init(i)}else if(arguments[0]instanceof r){var a=arguments[0];this.init(a)}else if(typeof arguments[0]=="string"){var c=arguments[0];r.call(this,r.parse(c))}}else if(arguments.length===2){var d=arguments[0],v=arguments[1];this.init(d,v)}},Bt={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}};K.prototype.le=function(r){return(this._hi<r._hi||this._hi===r._hi)&&this._lo<=r._lo},K.prototype.extractSignificantDigits=function(r,i){var a=this.abs(),c=K.magnitude(a._hi),d=K.TEN.pow(c);(a=a.divide(d)).gt(K.TEN)?(a=a.divide(K.TEN),c+=1):a.lt(K.ONE)&&(a=a.multiply(K.TEN),c-=1);for(var v=c+1,M=new Lt,L=K.MAX_PRINT_DIGITS-1,H=0;H<=L;H++){r&&H===v&&M.append(".");var it=Math.trunc(a._hi);if(it<0)break;var bt=!1,Tt=0;it>9?(bt=!0,Tt="9"):Tt="0"+it,M.append(Tt),a=a.subtract(K.valueOf(it)).multiply(K.TEN),bt&&a.selfAdd(K.TEN);var Jt=!0,Qt=K.magnitude(a._hi);if(Qt<0&&Math.abs(Qt)>=L-H&&(Jt=!1),!Jt)break}return i[0]=c,M.toString()},K.prototype.sqr=function(){return this.multiply(this)},K.prototype.doubleValue=function(){return this._hi+this._lo},K.prototype.subtract=function(){if(arguments[0]instanceof K){var r=arguments[0];return this.add(r.negate())}if(typeof arguments[0]=="number"){var i=arguments[0];return this.add(-i)}},K.prototype.equals=function(){if(arguments.length===1){var r=arguments[0];return this._hi===r._hi&&this._lo===r._lo}},K.prototype.isZero=function(){return this._hi===0&&this._lo===0},K.prototype.selfSubtract=function(){if(arguments[0]instanceof K){var r=arguments[0];return this.isNaN()?this:this.selfAdd(-r._hi,-r._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.isNaN()?this:this.selfAdd(-i,0)}},K.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},K.prototype.min=function(r){return this.le(r)?this:r},K.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof K){var r=arguments[0];return this.selfDivide(r._hi,r._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.selfDivide(i,0)}}else if(arguments.length===2){var a=arguments[0],c=arguments[1],d=null,v=null,M=null,L=null,H=null,it=null,bt=null,Tt=null;return H=this._hi/a,it=K.SPLIT*H,d=it-H,Tt=K.SPLIT*a,d=it-d,v=H-d,M=Tt-a,bt=H*a,M=Tt-M,L=a-M,Tt=d*M-bt+d*L+v*M+v*L,it=(this._hi-bt-Tt+this._lo-H*c)/a,Tt=H+it,this._hi=Tt,this._lo=H-Tt+it,this}},K.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},K.prototype.divide=function(){if(arguments[0]instanceof K){var r=arguments[0],i=null,a=null,c=null,d=null,v=null,M=null,L=null,H=null;return a=(v=this._hi/r._hi)-(i=(M=K.SPLIT*v)-(i=M-v)),H=i*(c=(H=K.SPLIT*r._hi)-(c=H-r._hi))-(L=v*r._hi)+i*(d=r._hi-c)+a*c+a*d,M=(this._hi-L-H+this._lo-v*r._lo)/r._hi,new K(H=v+M,v-H+M)}if(typeof arguments[0]=="number"){var it=arguments[0];return C.isNaN(it)?K.createNaN():K.copy(this).selfDivide(it,0)}},K.prototype.ge=function(r){return(this._hi>r._hi||this._hi===r._hi)&&this._lo>=r._lo},K.prototype.pow=function(r){if(r===0)return K.valueOf(1);var i=new K(this),a=K.valueOf(1),c=Math.abs(r);if(c>1)for(;c>0;)c%2==1&&a.selfMultiply(i),(c/=2)>0&&(i=i.sqr());else a=i;return r<0?a.reciprocal():a},K.prototype.ceil=function(){if(this.isNaN())return K.NaN;var r=Math.ceil(this._hi),i=0;return r===this._hi&&(i=Math.ceil(this._lo)),new K(r,i)},K.prototype.compareTo=function(r){var i=r;return this._hi<i._hi?-1:this._hi>i._hi?1:this._lo<i._lo?-1:this._lo>i._lo?1:0},K.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},K.prototype.setValue=function(){if(arguments[0]instanceof K){var r=arguments[0];return this.init(r),this}if(typeof arguments[0]=="number"){var i=arguments[0];return this.init(i),this}},K.prototype.max=function(r){return this.ge(r)?this:r},K.prototype.sqrt=function(){if(this.isZero())return K.valueOf(0);if(this.isNegative())return K.NaN;var r=1/Math.sqrt(this._hi),i=this._hi*r,a=K.valueOf(i),c=this.subtract(a.sqr())._hi*(.5*r);return a.add(c)},K.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof K){var r=arguments[0];return this.selfAdd(r._hi,r._lo)}if(typeof arguments[0]=="number"){var i=arguments[0],a=null,c=null,d=null,v=null,M=null,L=null;return d=this._hi+i,M=d-this._hi,v=d-M,v=i-M+(this._hi-v),L=v+this._lo,a=d+L,c=L+(d-a),this._hi=a+c,this._lo=c+(a-this._hi),this}}else if(arguments.length===2){var H=arguments[0],it=arguments[1],bt=null,Tt=null,Jt=null,Qt=null,le=null,Ee=null,Dn=null;Qt=this._hi+H,Tt=this._lo+it,le=Qt-(Ee=Qt-this._hi),Jt=Tt-(Dn=Tt-this._lo);var Kn=(bt=Qt+(Ee=(le=H-Ee+(this._hi-le))+Tt))+(Ee=(Jt=it-Dn+(this._lo-Jt))+(Ee+(Qt-bt))),fi=Ee+(bt-Kn);return this._hi=Kn,this._lo=fi,this}},K.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof K){var r=arguments[0];return this.selfMultiply(r._hi,r._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.selfMultiply(i,0)}}else if(arguments.length===2){var a=arguments[0],c=arguments[1],d=null,v=null,M=null,L=null,H=null,it=null;d=(H=K.SPLIT*this._hi)-this._hi,it=K.SPLIT*a,d=H-d,v=this._hi-d,M=it-a;var bt=(H=this._hi*a)+(it=d*(M=it-M)-H+d*(L=a-M)+v*M+v*L+(this._hi*c+this._lo*a)),Tt=it+(d=H-bt);return this._hi=bt,this._lo=Tt,this}},K.prototype.selfSqr=function(){return this.selfMultiply(this)},K.prototype.floor=function(){if(this.isNaN())return K.NaN;var r=Math.floor(this._hi),i=0;return r===this._hi&&(i=Math.floor(this._lo)),new K(r,i)},K.prototype.negate=function(){return this.isNaN()?this:new K(-this._hi,-this._lo)},K.prototype.clone=function(){},K.prototype.multiply=function(){if(arguments[0]instanceof K){var r=arguments[0];return r.isNaN()?K.createNaN():K.copy(this).selfMultiply(r)}if(typeof arguments[0]=="number"){var i=arguments[0];return C.isNaN(i)?K.createNaN():K.copy(this).selfMultiply(i,0)}},K.prototype.isNaN=function(){return C.isNaN(this._hi)},K.prototype.intValue=function(){return Math.trunc(this._hi)},K.prototype.toString=function(){var r=K.magnitude(this._hi);return r>=-3&&r<=20?this.toStandardNotation():this.toSciNotation()},K.prototype.toStandardNotation=function(){var r=this.getSpecialNumberString();if(r!==null)return r;var i=new Array(1).fill(null),a=this.extractSignificantDigits(!0,i),c=i[0]+1,d=a;if(a.charAt(0)===".")d="0"+a;else if(c<0)d="0."+K.stringOfChar("0",-c)+a;else if(a.indexOf(".")===-1){var v=c-a.length;d=a+K.stringOfChar("0",v)+".0"}return this.isNegative()?"-"+d:d},K.prototype.reciprocal=function(){var r=null,i=null,a=null,c=null,d=null,v=null,M=null,L=null;i=(d=1/this._hi)-(r=(v=K.SPLIT*d)-(r=v-d)),a=(L=K.SPLIT*this._hi)-this._hi;var H=d+(v=(1-(M=d*this._hi)-(L=r*(a=L-a)-M+r*(c=this._hi-a)+i*a+i*c)-d*this._lo)/this._hi);return new K(H,d-H+v)},K.prototype.toSciNotation=function(){if(this.isZero())return K.SCI_NOT_ZERO;var r=this.getSpecialNumberString();if(r!==null)return r;var i=new Array(1).fill(null),a=this.extractSignificantDigits(!1,i),c=K.SCI_NOT_EXPONENT_CHAR+i[0];if(a.charAt(0)==="0")throw new Error("Found leading zero: "+a);var d="";a.length>1&&(d=a.substring(1));var v=a.charAt(0)+"."+d;return this.isNegative()?"-"+v+c:v+c},K.prototype.abs=function(){return this.isNaN()?K.NaN:this.isNegative()?this.negate():new K(this)},K.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},K.prototype.lt=function(r){return(this._hi<r._hi||this._hi===r._hi)&&this._lo<r._lo},K.prototype.add=function(){if(arguments[0]instanceof K){var r=arguments[0];return K.copy(this).selfAdd(r)}if(typeof arguments[0]=="number"){var i=arguments[0];return K.copy(this).selfAdd(i)}},K.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 K){var i=arguments[0];this._hi=i._hi,this._lo=i._lo}}else if(arguments.length===2){var a=arguments[0],c=arguments[1];this._hi=a,this._lo=c}},K.prototype.gt=function(r){return(this._hi>r._hi||this._hi===r._hi)&&this._lo>r._lo},K.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},K.prototype.trunc=function(){return this.isNaN()?K.NaN:this.isPositive()?this.floor():this.ceil()},K.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},K.prototype.interfaces_=function(){return[t,V,X]},K.prototype.getClass=function(){return K},K.sqr=function(r){return K.valueOf(r).selfMultiply(r)},K.valueOf=function(){if(typeof arguments[0]=="string"){var r=arguments[0];return K.parse(r)}if(typeof arguments[0]=="number"){var i=arguments[0];return new K(i)}},K.sqrt=function(r){return K.valueOf(r).sqrt()},K.parse=function(r){for(var i=0,a=r.length;yt.isWhitespace(r.charAt(i));)i++;var c=!1;if(i<a){var d=r.charAt(i);d!=="-"&&d!=="+"||(i++,d==="-"&&(c=!0))}for(var v=new K,M=0,L=0,H=0;!(i>=a);){var it=r.charAt(i);if(i++,yt.isDigit(it)){var bt=it-"0";v.selfMultiply(K.TEN),v.selfAdd(bt),M++}else{if(it!=="."){if(it==="e"||it==="E"){var Tt=r.substring(i);try{H=pt.parseInt(Tt)}catch(Dn){throw Dn instanceof Error?new Error("Invalid exponent "+Tt+" in string "+r):Dn}break}throw new Error("Unexpected character '"+it+"' at position "+i+" in string "+r)}L=M}}var Jt=v,Qt=M-L-H;if(Qt===0)Jt=v;else if(Qt>0){var le=K.TEN.pow(Qt);Jt=v.divide(le)}else if(Qt<0){var Ee=K.TEN.pow(-Qt);Jt=v.multiply(Ee)}return c?Jt.negate():Jt},K.createNaN=function(){return new K(C.NaN,C.NaN)},K.copy=function(r){return new K(r)},K.magnitude=function(r){var i=Math.abs(r),a=Math.log(i)/Math.log(10),c=Math.trunc(Math.floor(a));return 10*Math.pow(10,c)<=i&&(c+=1),c},K.stringOfChar=function(r,i){for(var a=new Lt,c=0;c<i;c++)a.append(r);return a.toString()},Bt.PI.get=function(){return new K(3.141592653589793,12246467991473532e-32)},Bt.TWO_PI.get=function(){return new K(6.283185307179586,24492935982947064e-32)},Bt.PI_2.get=function(){return new K(1.5707963267948966,6123233995736766e-32)},Bt.E.get=function(){return new K(2.718281828459045,14456468917292502e-32)},Bt.NaN.get=function(){return new K(C.NaN,C.NaN)},Bt.EPS.get=function(){return 123259516440783e-46},Bt.SPLIT.get=function(){return 134217729},Bt.MAX_PRINT_DIGITS.get=function(){return 32},Bt.TEN.get=function(){return K.valueOf(10)},Bt.ONE.get=function(){return K.valueOf(1)},Bt.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},Bt.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(K,Bt);var Gt=function(){},ae={DP_SAFE_EPSILON:{configurable:!0}};Gt.prototype.interfaces_=function(){return[]},Gt.prototype.getClass=function(){return Gt},Gt.orientationIndex=function(r,i,a){var c=Gt.orientationIndexFilter(r,i,a);if(c<=1)return c;var d=K.valueOf(i.x).selfAdd(-r.x),v=K.valueOf(i.y).selfAdd(-r.y),M=K.valueOf(a.x).selfAdd(-i.x),L=K.valueOf(a.y).selfAdd(-i.y);return d.selfMultiply(L).selfSubtract(v.selfMultiply(M)).signum()},Gt.signOfDet2x2=function(r,i,a,c){return r.multiply(c).selfSubtract(i.multiply(a)).signum()},Gt.intersection=function(r,i,a,c){var d=K.valueOf(c.y).selfSubtract(a.y).selfMultiply(K.valueOf(i.x).selfSubtract(r.x)),v=K.valueOf(c.x).selfSubtract(a.x).selfMultiply(K.valueOf(i.y).selfSubtract(r.y)),M=d.subtract(v),L=K.valueOf(c.x).selfSubtract(a.x).selfMultiply(K.valueOf(r.y).selfSubtract(a.y)),H=K.valueOf(c.y).selfSubtract(a.y).selfMultiply(K.valueOf(r.x).selfSubtract(a.x)),it=L.subtract(H).selfDivide(M).doubleValue(),bt=K.valueOf(r.x).selfAdd(K.valueOf(i.x).selfSubtract(r.x).selfMultiply(it)).doubleValue(),Tt=K.valueOf(i.x).selfSubtract(r.x).selfMultiply(K.valueOf(r.y).selfSubtract(a.y)),Jt=K.valueOf(i.y).selfSubtract(r.y).selfMultiply(K.valueOf(r.x).selfSubtract(a.x)),Qt=Tt.subtract(Jt).selfDivide(M).doubleValue(),le=K.valueOf(a.y).selfAdd(K.valueOf(c.y).selfSubtract(a.y).selfMultiply(Qt)).doubleValue();return new D(bt,le)},Gt.orientationIndexFilter=function(r,i,a){var c=null,d=(r.x-a.x)*(i.y-a.y),v=(r.y-a.y)*(i.x-a.x),M=d-v;if(d>0){if(v<=0)return Gt.signum(M);c=d+v}else{if(!(d<0)||v>=0)return Gt.signum(M);c=-d-v}var L=Gt.DP_SAFE_EPSILON*c;return M>=L||-M>=L?Gt.signum(M):2},Gt.signum=function(r){return r>0?1:r<0?-1:0},ae.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(Gt,ae);var ut=function(){},Ut={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Ut.X.get=function(){return 0},Ut.Y.get=function(){return 1},Ut.Z.get=function(){return 2},Ut.M.get=function(){return 3},ut.prototype.setOrdinate=function(r,i,a){},ut.prototype.size=function(){},ut.prototype.getOrdinate=function(r,i){},ut.prototype.getCoordinate=function(){},ut.prototype.getCoordinateCopy=function(r){},ut.prototype.getDimension=function(){},ut.prototype.getX=function(r){},ut.prototype.clone=function(){},ut.prototype.expandEnvelope=function(r){},ut.prototype.copy=function(){},ut.prototype.getY=function(r){},ut.prototype.toCoordinateArray=function(){},ut.prototype.interfaces_=function(){return[X]},ut.prototype.getClass=function(){return ut},Object.defineProperties(ut,Ut);var jt=function(){},ce=function(r){function i(){r.call(this,"Projective point not representable on the Cartesian plane.")}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(jt),te=function(){};te.arraycopy=function(r,i,a,c,d){for(var v=0,M=i;M<i+d;M++)a[c+v]=r[M],v++},te.getProperty=function(r){return{"line.separator":\`
|
|
@@ -23464,4 +23464,4 @@ void main() {
|
|
|
23464
23464
|
|
|
23465
23465
|
}\`,dv=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,o){if(this.texture===null){let s=new Us,l=t.properties.get(s);l.__webglTexture=e.texture,(e.depthNear!=o.depthNear||e.depthFar!=o.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=s}}render(t,e){if(this.texture!==null){if(this.mesh===null){let o=e.cameras[0].viewport,s=new Ia({extensions:{fragDepth:!0},vertexShader:sX,fragmentShader:aX,uniforms:{depthColor:{value:this.texture},depthWidth:{value:o.z},depthHeight:{value:o.w}}});this.mesh=new ra(new zd(20,20),s)}t.render(this.mesh,e)}}reset(){this.texture=null,this.mesh=null}},gv=class extends Ku{constructor(t,e){super();let o=this,s=null,l=1,p=null,h="local-floor",g=1,m=null,v=null,x=null,E=null,M=null,A=null,I=new dv,S=e.getContextAttributes(),w=null,R=null,C=[],F=[],V=new Ye,X=null,q=new gs;q.layers.enable(1),q.viewport=new ji;let D=new gs;D.layers.enable(2),D.viewport=new ji;let xt=[q,D],B=new pv;B.layers.enable(1),B.layers.enable(2);let j=null,J=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ut){let Ut=C[ut];return Ut===void 0&&(Ut=new sh,C[ut]=Ut),Ut.getTargetRaySpace()},this.getControllerGrip=function(ut){let Ut=C[ut];return Ut===void 0&&(Ut=new sh,C[ut]=Ut),Ut.getGripSpace()},this.getHand=function(ut){let Ut=C[ut];return Ut===void 0&&(Ut=new sh,C[ut]=Ut),Ut.getHandSpace()};function Dt(ut){let Ut=F.indexOf(ut.inputSource);if(Ut===-1)return;let jt=C[Ut];jt!==void 0&&(jt.update(ut.inputSource,ut.frame,m||p),jt.dispatchEvent({type:ut.type,data:ut.inputSource}))}function Q(){s.removeEventListener("select",Dt),s.removeEventListener("selectstart",Dt),s.removeEventListener("selectend",Dt),s.removeEventListener("squeeze",Dt),s.removeEventListener("squeezestart",Dt),s.removeEventListener("squeezeend",Dt),s.removeEventListener("end",Q),s.removeEventListener("inputsourceschange",At);for(let ut=0;ut<C.length;ut++){let Ut=F[ut];Ut!==null&&(F[ut]=null,C[ut].disconnect(Ut))}j=null,J=null,I.reset(),t.setRenderTarget(w),M=null,E=null,x=null,s=null,R=null,ae.stop(),o.isPresenting=!1,t.setPixelRatio(X),t.setSize(V.width,V.height,!1),o.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(ut){l=ut,o.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(ut){h=ut,o.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return m||p},this.setReferenceSpace=function(ut){m=ut},this.getBaseLayer=function(){return E!==null?E:M},this.getBinding=function(){return x},this.getFrame=function(){return A},this.getSession=function(){return s},this.setSession=function(ut){return ac(this,null,function*(){if(s=ut,s!==null){if(w=t.getRenderTarget(),s.addEventListener("select",Dt),s.addEventListener("selectstart",Dt),s.addEventListener("selectend",Dt),s.addEventListener("squeeze",Dt),s.addEventListener("squeezestart",Dt),s.addEventListener("squeezeend",Dt),s.addEventListener("end",Q),s.addEventListener("inputsourceschange",At),S.xrCompatible!==!0&&(yield e.makeXRCompatible()),X=t.getPixelRatio(),t.getSize(V),s.renderState.layers===void 0||t.capabilities.isWebGL2===!1){let Ut={antialias:s.renderState.layers===void 0?S.antialias:!0,alpha:!0,depth:S.depth,stencil:S.stencil,framebufferScaleFactor:l};M=new XRWebGLLayer(s,e,Ut),s.updateRenderState({baseLayer:M}),t.setPixelRatio(1),t.setSize(M.framebufferWidth,M.framebufferHeight,!1),R=new du(M.framebufferWidth,M.framebufferHeight,{format:na,type:$u,colorSpace:t.outputColorSpace,stencilBuffer:S.stencil})}else{let Ut=null,jt=null,ce=null;S.depth&&(ce=S.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,Ut=S.stencil?Wc:Dl,jt=S.stencil?Ol:Wu);let te={colorFormat:e.RGBA8,depthFormat:ce,scaleFactor:l};x=new XRWebGLBinding(s,e),E=x.createProjectionLayer(te),s.updateRenderState({layers:[E]}),t.setPixelRatio(1),t.setSize(E.textureWidth,E.textureHeight,!1),R=new du(E.textureWidth,E.textureHeight,{format:na,type:$u,depthTexture:new kd(E.textureWidth,E.textureHeight,jt,void 0,void 0,void 0,void 0,void 0,void 0,Ut),stencilBuffer:S.stencil,colorSpace:t.outputColorSpace,samples:S.antialias?4:0});let $t=t.properties.get(R);$t.__ignoreDepthValues=E.ignoreDepthValues}R.isXRRenderTarget=!0,this.setFoveation(g),m=null,p=yield s.requestReferenceSpace(h),ae.setContext(s),ae.start(),o.isPresenting=!0,o.dispatchEvent({type:"sessionstart"})}})},this.getEnvironmentBlendMode=function(){if(s!==null)return s.environmentBlendMode};function At(ut){for(let Ut=0;Ut<ut.removed.length;Ut++){let jt=ut.removed[Ut],ce=F.indexOf(jt);ce>=0&&(F[ce]=null,C[ce].disconnect(jt))}for(let Ut=0;Ut<ut.added.length;Ut++){let jt=ut.added[Ut],ce=F.indexOf(jt);if(ce===-1){for(let $t=0;$t<C.length;$t++)if($t>=F.length){F.push(jt),ce=$t;break}else if(F[$t]===null){F[$t]=jt,ce=$t;break}if(ce===-1)break}let te=C[ce];te&&te.connect(jt)}}let Mt=new Rt,Lt=new Rt;function pt(ut,Ut,jt){Mt.setFromMatrixPosition(Ut.matrixWorld),Lt.setFromMatrixPosition(jt.matrixWorld);let ce=Mt.distanceTo(Lt),te=Ut.projectionMatrix.elements,$t=jt.projectionMatrix.elements,qt=te[14]/(te[10]-1),xe=te[14]/(te[10]+1),ft=(te[9]+1)/te[5],We=(te[9]-1)/te[5],ee=(te[8]-1)/te[0],ge=($t[8]+1)/$t[0],fe=qt*ee,Te=qt*ge,be=ce/(-ee+ge),Wt=be*-ee;Ut.matrixWorld.decompose(ut.position,ut.quaternion,ut.scale),ut.translateX(Wt),ut.translateZ(be),ut.matrixWorld.compose(ut.position,ut.quaternion,ut.scale),ut.matrixWorldInverse.copy(ut.matrixWorld).invert();let Me=qt+be,tt=xe+be,z=fe-Wt,Pt=Te+(ce-Wt),Ot=ft*xe/tt*Me,dt=We*xe/tt*Me;ut.projectionMatrix.makePerspective(z,Pt,Ot,dt,Me,tt),ut.projectionMatrixInverse.copy(ut.projectionMatrix).invert()}function yt(ut,Ut){Ut===null?ut.matrixWorld.copy(ut.matrix):ut.matrixWorld.multiplyMatrices(Ut.matrixWorld,ut.matrix),ut.matrixWorldInverse.copy(ut.matrixWorld).invert()}this.updateCamera=function(ut){if(s===null)return;I.texture!==null&&(ut.near=I.depthNear,ut.far=I.depthFar),B.near=D.near=q.near=ut.near,B.far=D.far=q.far=ut.far,(j!==B.near||J!==B.far)&&(s.updateRenderState({depthNear:B.near,depthFar:B.far}),j=B.near,J=B.far,q.near=j,q.far=J,D.near=j,D.far=J,q.updateProjectionMatrix(),D.updateProjectionMatrix(),ut.updateProjectionMatrix());let Ut=ut.parent,jt=B.cameras;yt(B,Ut);for(let ce=0;ce<jt.length;ce++)yt(jt[ce],Ut);jt.length===2?pt(B,q,D):B.projectionMatrix.copy(q.projectionMatrix),K(ut,B,Ut)};function K(ut,Ut,jt){jt===null?ut.matrix.copy(Ut.matrixWorld):(ut.matrix.copy(jt.matrixWorld),ut.matrix.invert(),ut.matrix.multiply(Ut.matrixWorld)),ut.matrix.decompose(ut.position,ut.quaternion,ut.scale),ut.updateMatrixWorld(!0),ut.projectionMatrix.copy(Ut.projectionMatrix),ut.projectionMatrixInverse.copy(Ut.projectionMatrixInverse),ut.isPerspectiveCamera&&(ut.fov=Ky*2*Math.atan(1/ut.projectionMatrix.elements[5]),ut.zoom=1)}this.getCamera=function(){return B},this.getFoveation=function(){if(!(E===null&&M===null))return g},this.setFoveation=function(ut){g=ut,E!==null&&(E.fixedFoveation=ut),M!==null&&M.fixedFoveation!==void 0&&(M.fixedFoveation=ut)},this.hasDepthSensing=function(){return I.texture!==null};let Bt=null;function Gt(ut,Ut){if(v=Ut.getViewerPose(m||p),A=Ut,v!==null){let jt=v.views;M!==null&&(t.setRenderTargetFramebuffer(R,M.framebuffer),t.setRenderTarget(R));let ce=!1;jt.length!==B.cameras.length&&(B.cameras.length=0,ce=!0);for(let $t=0;$t<jt.length;$t++){let qt=jt[$t],xe=null;if(M!==null)xe=M.getViewport(qt);else{let We=x.getViewSubImage(E,qt);xe=We.viewport,$t===0&&(t.setRenderTargetTextures(R,We.colorTexture,E.ignoreDepthValues?void 0:We.depthStencilTexture),t.setRenderTarget(R))}let ft=xt[$t];ft===void 0&&(ft=new gs,ft.layers.enable($t),ft.viewport=new ji,xt[$t]=ft),ft.matrix.fromArray(qt.transform.matrix),ft.matrix.decompose(ft.position,ft.quaternion,ft.scale),ft.projectionMatrix.fromArray(qt.projectionMatrix),ft.projectionMatrixInverse.copy(ft.projectionMatrix).invert(),ft.viewport.set(xe.x,xe.y,xe.width,xe.height),$t===0&&(B.matrix.copy(ft.matrix),B.matrix.decompose(B.position,B.quaternion,B.scale)),ce===!0&&B.cameras.push(ft)}let te=s.enabledFeatures;if(te&&te.includes("depth-sensing")){let $t=x.getDepthInformation(jt[0]);$t&&$t.isValid&&$t.texture&&I.init(t,$t,s.renderState)}}for(let jt=0;jt<C.length;jt++){let ce=F[jt],te=C[jt];ce!==null&&te!==void 0&&te.update(ce,Ut,m||p)}I.render(t,B),Bt&&Bt(ut,Ut),Ut.detectedPlanes&&o.dispatchEvent({type:"planesdetected",data:Ut}),A=null}let ae=new xC;ae.setAnimationLoop(Gt),this.setAnimationLoop=function(ut){Bt=ut},this.dispose=function(){}}},Cl=new Ul,uX=new vi;function lX(n,t){function e(S,w){S.matrixAutoUpdate===!0&&S.updateMatrix(),w.value.copy(S.matrix)}function o(S,w){w.color.getRGB(S.fogColor.value,_C(n)),w.isFog?(S.fogNear.value=w.near,S.fogFar.value=w.far):w.isFogExp2&&(S.fogDensity.value=w.density)}function s(S,w,R,C,F){w.isMeshBasicMaterial||w.isMeshLambertMaterial?l(S,w):w.isMeshToonMaterial?(l(S,w),x(S,w)):w.isMeshPhongMaterial?(l(S,w),v(S,w)):w.isMeshStandardMaterial?(l(S,w),E(S,w),w.isMeshPhysicalMaterial&&M(S,w,F)):w.isMeshMatcapMaterial?(l(S,w),A(S,w)):w.isMeshDepthMaterial?l(S,w):w.isMeshDistanceMaterial?(l(S,w),I(S,w)):w.isMeshNormalMaterial?l(S,w):w.isLineBasicMaterial?(p(S,w),w.isLineDashedMaterial&&h(S,w)):w.isPointsMaterial?g(S,w,R,C):w.isSpriteMaterial?m(S,w):w.isShadowMaterial?(S.color.value.copy(w.color),S.opacity.value=w.opacity):w.isShaderMaterial&&(w.uniformsNeedUpdate=!1)}function l(S,w){S.opacity.value=w.opacity,w.color&&S.diffuse.value.copy(w.color),w.emissive&&S.emissive.value.copy(w.emissive).multiplyScalar(w.emissiveIntensity),w.map&&(S.map.value=w.map,e(w.map,S.mapTransform)),w.alphaMap&&(S.alphaMap.value=w.alphaMap,e(w.alphaMap,S.alphaMapTransform)),w.bumpMap&&(S.bumpMap.value=w.bumpMap,e(w.bumpMap,S.bumpMapTransform),S.bumpScale.value=w.bumpScale,w.side===$o&&(S.bumpScale.value*=-1)),w.normalMap&&(S.normalMap.value=w.normalMap,e(w.normalMap,S.normalMapTransform),S.normalScale.value.copy(w.normalScale),w.side===$o&&S.normalScale.value.negate()),w.displacementMap&&(S.displacementMap.value=w.displacementMap,e(w.displacementMap,S.displacementMapTransform),S.displacementScale.value=w.displacementScale,S.displacementBias.value=w.displacementBias),w.emissiveMap&&(S.emissiveMap.value=w.emissiveMap,e(w.emissiveMap,S.emissiveMapTransform)),w.specularMap&&(S.specularMap.value=w.specularMap,e(w.specularMap,S.specularMapTransform)),w.alphaTest>0&&(S.alphaTest.value=w.alphaTest);let R=t.get(w),C=R.envMap,F=R.envMapRotation;if(C&&(S.envMap.value=C,Cl.copy(F),Cl.x*=-1,Cl.y*=-1,Cl.z*=-1,C.isCubeTexture&&C.isRenderTargetTexture===!1&&(Cl.y*=-1,Cl.z*=-1),S.envMapRotation.value.setFromMatrix4(uX.makeRotationFromEuler(Cl)),S.flipEnvMap.value=C.isCubeTexture&&C.isRenderTargetTexture===!1?-1:1,S.reflectivity.value=w.reflectivity,S.ior.value=w.ior,S.refractionRatio.value=w.refractionRatio),w.lightMap){S.lightMap.value=w.lightMap;let V=n._useLegacyLights===!0?Math.PI:1;S.lightMapIntensity.value=w.lightMapIntensity*V,e(w.lightMap,S.lightMapTransform)}w.aoMap&&(S.aoMap.value=w.aoMap,S.aoMapIntensity.value=w.aoMapIntensity,e(w.aoMap,S.aoMapTransform))}function p(S,w){S.diffuse.value.copy(w.color),S.opacity.value=w.opacity,w.map&&(S.map.value=w.map,e(w.map,S.mapTransform))}function h(S,w){S.dashSize.value=w.dashSize,S.totalSize.value=w.dashSize+w.gapSize,S.scale.value=w.scale}function g(S,w,R,C){S.diffuse.value.copy(w.color),S.opacity.value=w.opacity,S.size.value=w.size*R,S.scale.value=C*.5,w.map&&(S.map.value=w.map,e(w.map,S.uvTransform)),w.alphaMap&&(S.alphaMap.value=w.alphaMap,e(w.alphaMap,S.alphaMapTransform)),w.alphaTest>0&&(S.alphaTest.value=w.alphaTest)}function m(S,w){S.diffuse.value.copy(w.color),S.opacity.value=w.opacity,S.rotation.value=w.rotation,w.map&&(S.map.value=w.map,e(w.map,S.mapTransform)),w.alphaMap&&(S.alphaMap.value=w.alphaMap,e(w.alphaMap,S.alphaMapTransform)),w.alphaTest>0&&(S.alphaTest.value=w.alphaTest)}function v(S,w){S.specular.value.copy(w.specular),S.shininess.value=Math.max(w.shininess,1e-4)}function x(S,w){w.gradientMap&&(S.gradientMap.value=w.gradientMap)}function E(S,w){S.metalness.value=w.metalness,w.metalnessMap&&(S.metalnessMap.value=w.metalnessMap,e(w.metalnessMap,S.metalnessMapTransform)),S.roughness.value=w.roughness,w.roughnessMap&&(S.roughnessMap.value=w.roughnessMap,e(w.roughnessMap,S.roughnessMapTransform)),t.get(w).envMap&&(S.envMapIntensity.value=w.envMapIntensity)}function M(S,w,R){S.ior.value=w.ior,w.sheen>0&&(S.sheenColor.value.copy(w.sheenColor).multiplyScalar(w.sheen),S.sheenRoughness.value=w.sheenRoughness,w.sheenColorMap&&(S.sheenColorMap.value=w.sheenColorMap,e(w.sheenColorMap,S.sheenColorMapTransform)),w.sheenRoughnessMap&&(S.sheenRoughnessMap.value=w.sheenRoughnessMap,e(w.sheenRoughnessMap,S.sheenRoughnessMapTransform))),w.clearcoat>0&&(S.clearcoat.value=w.clearcoat,S.clearcoatRoughness.value=w.clearcoatRoughness,w.clearcoatMap&&(S.clearcoatMap.value=w.clearcoatMap,e(w.clearcoatMap,S.clearcoatMapTransform)),w.clearcoatRoughnessMap&&(S.clearcoatRoughnessMap.value=w.clearcoatRoughnessMap,e(w.clearcoatRoughnessMap,S.clearcoatRoughnessMapTransform)),w.clearcoatNormalMap&&(S.clearcoatNormalMap.value=w.clearcoatNormalMap,e(w.clearcoatNormalMap,S.clearcoatNormalMapTransform),S.clearcoatNormalScale.value.copy(w.clearcoatNormalScale),w.side===$o&&S.clearcoatNormalScale.value.negate())),w.iridescence>0&&(S.iridescence.value=w.iridescence,S.iridescenceIOR.value=w.iridescenceIOR,S.iridescenceThicknessMinimum.value=w.iridescenceThicknessRange[0],S.iridescenceThicknessMaximum.value=w.iridescenceThicknessRange[1],w.iridescenceMap&&(S.iridescenceMap.value=w.iridescenceMap,e(w.iridescenceMap,S.iridescenceMapTransform)),w.iridescenceThicknessMap&&(S.iridescenceThicknessMap.value=w.iridescenceThicknessMap,e(w.iridescenceThicknessMap,S.iridescenceThicknessMapTransform))),w.transmission>0&&(S.transmission.value=w.transmission,S.transmissionSamplerMap.value=R.texture,S.transmissionSamplerSize.value.set(R.width,R.height),w.transmissionMap&&(S.transmissionMap.value=w.transmissionMap,e(w.transmissionMap,S.transmissionMapTransform)),S.thickness.value=w.thickness,w.thicknessMap&&(S.thicknessMap.value=w.thicknessMap,e(w.thicknessMap,S.thicknessMapTransform)),S.attenuationDistance.value=w.attenuationDistance,S.attenuationColor.value.copy(w.attenuationColor)),w.anisotropy>0&&(S.anisotropyVector.value.set(w.anisotropy*Math.cos(w.anisotropyRotation),w.anisotropy*Math.sin(w.anisotropyRotation)),w.anisotropyMap&&(S.anisotropyMap.value=w.anisotropyMap,e(w.anisotropyMap,S.anisotropyMapTransform))),S.specularIntensity.value=w.specularIntensity,S.specularColor.value.copy(w.specularColor),w.specularColorMap&&(S.specularColorMap.value=w.specularColorMap,e(w.specularColorMap,S.specularColorMapTransform)),w.specularIntensityMap&&(S.specularIntensityMap.value=w.specularIntensityMap,e(w.specularIntensityMap,S.specularIntensityMapTransform))}function A(S,w){w.matcap&&(S.matcap.value=w.matcap)}function I(S,w){let R=t.get(w).light;S.referencePosition.value.setFromMatrixPosition(R.matrixWorld),S.nearDistance.value=R.shadow.camera.near,S.farDistance.value=R.shadow.camera.far}return{refreshFogUniforms:o,refreshMaterialUniforms:s}}function cX(n,t,e,o){let s={},l={},p=[],h=e.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function g(R,C){let F=C.program;o.uniformBlockBinding(R,F)}function m(R,C){let F=s[R.id];F===void 0&&(A(R),F=v(R),s[R.id]=F,R.addEventListener("dispose",S));let V=C.program;o.updateUBOMapping(R,V);let X=t.render.frame;l[R.id]!==X&&(E(R),l[R.id]=X)}function v(R){let C=x();R.__bindingPointIndex=C;let F=n.createBuffer(),V=R.__size,X=R.usage;return n.bindBuffer(n.UNIFORM_BUFFER,F),n.bufferData(n.UNIFORM_BUFFER,V,X),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,C,F),F}function x(){for(let R=0;R<h;R++)if(p.indexOf(R)===-1)return p.push(R),R;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function E(R){let C=s[R.id],F=R.uniforms,V=R.__cache;n.bindBuffer(n.UNIFORM_BUFFER,C);for(let X=0,q=F.length;X<q;X++){let D=Array.isArray(F[X])?F[X]:[F[X]];for(let xt=0,B=D.length;xt<B;xt++){let j=D[xt];if(M(j,X,xt,V)===!0){let J=j.__offset,Dt=Array.isArray(j.value)?j.value:[j.value],Q=0;for(let At=0;At<Dt.length;At++){let Mt=Dt[At],Lt=I(Mt);typeof Mt=="number"||typeof Mt=="boolean"?(j.__data[0]=Mt,n.bufferSubData(n.UNIFORM_BUFFER,J+Q,j.__data)):Mt.isMatrix3?(j.__data[0]=Mt.elements[0],j.__data[1]=Mt.elements[1],j.__data[2]=Mt.elements[2],j.__data[3]=0,j.__data[4]=Mt.elements[3],j.__data[5]=Mt.elements[4],j.__data[6]=Mt.elements[5],j.__data[7]=0,j.__data[8]=Mt.elements[6],j.__data[9]=Mt.elements[7],j.__data[10]=Mt.elements[8],j.__data[11]=0):(Mt.toArray(j.__data,Q),Q+=Lt.storage/Float32Array.BYTES_PER_ELEMENT)}n.bufferSubData(n.UNIFORM_BUFFER,J,j.__data)}}}n.bindBuffer(n.UNIFORM_BUFFER,null)}function M(R,C,F,V){let X=R.value,q=C+"_"+F;if(V[q]===void 0)return typeof X=="number"||typeof X=="boolean"?V[q]=X:V[q]=X.clone(),!0;{let D=V[q];if(typeof X=="number"||typeof X=="boolean"){if(D!==X)return V[q]=X,!0}else if(D.equals(X)===!1)return D.copy(X),!0}return!1}function A(R){let C=R.uniforms,F=0,V=16;for(let q=0,D=C.length;q<D;q++){let xt=Array.isArray(C[q])?C[q]:[C[q]];for(let B=0,j=xt.length;B<j;B++){let J=xt[B],Dt=Array.isArray(J.value)?J.value:[J.value];for(let Q=0,At=Dt.length;Q<At;Q++){let Mt=Dt[Q],Lt=I(Mt),pt=F%V;pt!==0&&V-pt<Lt.boundary&&(F+=V-pt),J.__data=new Float32Array(Lt.storage/Float32Array.BYTES_PER_ELEMENT),J.__offset=F,F+=Lt.storage}}}let X=F%V;return X>0&&(F+=V-X),R.__size=F,R.__cache={},this}function I(R){let C={boundary:0,storage:0};return typeof R=="number"||typeof R=="boolean"?(C.boundary=4,C.storage=4):R.isVector2?(C.boundary=8,C.storage=8):R.isVector3||R.isColor?(C.boundary=16,C.storage=12):R.isVector4?(C.boundary=16,C.storage=16):R.isMatrix3?(C.boundary=48,C.storage=48):R.isMatrix4?(C.boundary=64,C.storage=64):R.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",R),C}function S(R){let C=R.target;C.removeEventListener("dispose",S);let F=p.indexOf(C.__bindingPointIndex);p.splice(F,1),n.deleteBuffer(s[C.id]),delete s[C.id],delete l[C.id]}function w(){for(let R in s)n.deleteBuffer(s[R]);p=[],s={},l={}}return{bind:g,update:m,dispose:w}}var mv=class{constructor(t={}){let{canvas:e=d6(),context:o=null,depth:s=!0,stencil:l=!0,alpha:p=!1,antialias:h=!1,premultipliedAlpha:g=!0,preserveDrawingBuffer:m=!1,powerPreference:v="default",failIfMajorPerformanceCaveat:x=!1}=t;this.isWebGLRenderer=!0;let E;o!==null?E=o.getContextAttributes().alpha:E=p;let M=new Uint32Array(4),A=new Int32Array(4),I=null,S=null,w=[],R=[];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=Ta,this._useLegacyLights=!1,this.toneMapping=Yu,this.toneMappingExposure=1;let C=this,F=!1,V=0,X=0,q=null,D=-1,xt=null,B=new ji,j=new ji,J=null,Dt=new ar(0),Q=0,At=e.width,Mt=e.height,Lt=1,pt=null,yt=null,K=new ji(0,0,At,Mt),Bt=new ji(0,0,At,Mt),Gt=!1,ae=new Bd,ut=!1,Ut=!1,jt=null,ce=new vi,te=new Ye,$t=new Rt,qt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function xe(){return q===null?Lt:1}let ft=o;function We(Z,mt){for(let It=0;It<Z.length;It++){let St=Z[It],vt=e.getContext(St,mt);if(vt!==null)return vt}return null}try{let Z={alpha:!0,depth:s,stencil:l,antialias:h,premultipliedAlpha:g,preserveDrawingBuffer:m,powerPreference:v,failIfMajorPerformanceCaveat:x};if("setAttribute"in e&&e.setAttribute("data-engine",\`three.js r\${Rv}\`),e.addEventListener("webglcontextlost",Et,!1),e.addEventListener("webglcontextrestored",G,!1),e.addEventListener("webglcontextcreationerror",ot,!1),ft===null){let mt=["webgl2","webgl","experimental-webgl"];if(C.isWebGL1Renderer===!0&&mt.shift(),ft=We(mt,Z),ft===null)throw We(mt)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}typeof WebGLRenderingContext!="undefined"&&ft instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),ft.getShaderPrecisionFormat===void 0&&(ft.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(Z){throw console.error("THREE.WebGLRenderer: "+Z.message),Z}let ee,ge,fe,Te,be,Wt,Me,tt,z,Pt,Ot,dt,Ht,Ce,Vt,Zt,ne,rt,P,N,k,$,W,ht;function at(){ee=new AW(ft),ge=new xW(ft,ee,t),ee.init(ge),$=new iX(ft,ee,ge),fe=new nX(ft,ee,ge),Te=new PW(ft),be=new V9,Wt=new rX(ft,ee,fe,be,ge,$,Te),Me=new wW(C),tt=new bW(C),z=new D6(ft,ge),W=new vW(ft,ee,z,ge),Pt=new TW(ft,z,Te,W),Ot=new NW(ft,Pt,z,Te),P=new LW(ft,ge,Wt),Zt=new EW(be),dt=new H9(C,Me,tt,ee,ge,W,Zt),Ht=new lX(C,be),Ce=new X9,Vt=new j9(ee,ge),rt=new yW(C,Me,tt,fe,Ot,E,g),ne=new eX(C,Ot,ge),ht=new cX(ft,Te,ge,fe),N=new _W(ft,ee,Te,ge),k=new CW(ft,ee,Te,ge),Te.programs=dt.programs,C.capabilities=ge,C.extensions=ee,C.properties=be,C.renderLists=Ce,C.shadowMap=ne,C.state=fe,C.info=Te}at();let wt=new gv(C,ft);this.xr=wt,this.getContext=function(){return ft},this.getContextAttributes=function(){return ft.getContextAttributes()},this.forceContextLoss=function(){let Z=ee.get("WEBGL_lose_context");Z&&Z.loseContext()},this.forceContextRestore=function(){let Z=ee.get("WEBGL_lose_context");Z&&Z.restoreContext()},this.getPixelRatio=function(){return Lt},this.setPixelRatio=function(Z){Z!==void 0&&(Lt=Z,this.setSize(At,Mt,!1))},this.getSize=function(Z){return Z.set(At,Mt)},this.setSize=function(Z,mt,It=!0){if(wt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}At=Z,Mt=mt,e.width=Math.floor(Z*Lt),e.height=Math.floor(mt*Lt),It===!0&&(e.style.width=Z+"px",e.style.height=mt+"px"),this.setViewport(0,0,Z,mt)},this.getDrawingBufferSize=function(Z){return Z.set(At*Lt,Mt*Lt).floor()},this.setDrawingBufferSize=function(Z,mt,It){At=Z,Mt=mt,Lt=It,e.width=Math.floor(Z*It),e.height=Math.floor(mt*It),this.setViewport(0,0,Z,mt)},this.getCurrentViewport=function(Z){return Z.copy(B)},this.getViewport=function(Z){return Z.copy(K)},this.setViewport=function(Z,mt,It,St){Z.isVector4?K.set(Z.x,Z.y,Z.z,Z.w):K.set(Z,mt,It,St),fe.viewport(B.copy(K).multiplyScalar(Lt).round())},this.getScissor=function(Z){return Z.copy(Bt)},this.setScissor=function(Z,mt,It,St){Z.isVector4?Bt.set(Z.x,Z.y,Z.z,Z.w):Bt.set(Z,mt,It,St),fe.scissor(j.copy(Bt).multiplyScalar(Lt).round())},this.getScissorTest=function(){return Gt},this.setScissorTest=function(Z){fe.setScissorTest(Gt=Z)},this.setOpaqueSort=function(Z){pt=Z},this.setTransparentSort=function(Z){yt=Z},this.getClearColor=function(Z){return Z.copy(rt.getClearColor())},this.setClearColor=function(){rt.setClearColor.apply(rt,arguments)},this.getClearAlpha=function(){return rt.getClearAlpha()},this.setClearAlpha=function(){rt.setClearAlpha.apply(rt,arguments)},this.clear=function(Z=!0,mt=!0,It=!0){let St=0;if(Z){let vt=!1;if(q!==null){let he=q.texture.format;vt=he===pC||he===hC||he===fC}if(vt){let he=q.texture.type,ue=he===$u||he===Wu||he===Lv||he===Ol||he===lC||he===cC,we=rt.getClearColor(),de=rt.getClearAlpha(),Be=we.r,Ae=we.g,Pe=we.b;ue?(M[0]=Be,M[1]=Ae,M[2]=Pe,M[3]=de,ft.clearBufferuiv(ft.COLOR,0,M)):(A[0]=Be,A[1]=Ae,A[2]=Pe,A[3]=de,ft.clearBufferiv(ft.COLOR,0,A))}else St|=ft.COLOR_BUFFER_BIT}mt&&(St|=ft.DEPTH_BUFFER_BIT),It&&(St|=ft.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),ft.clear(St)},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",Et,!1),e.removeEventListener("webglcontextrestored",G,!1),e.removeEventListener("webglcontextcreationerror",ot,!1),Ce.dispose(),Vt.dispose(),be.dispose(),Me.dispose(),tt.dispose(),Ot.dispose(),W.dispose(),ht.dispose(),dt.dispose(),ne.dispose(),wt.dispose(),wt.removeEventListener("sessionstart",qe),wt.removeEventListener("sessionend",Ue),jt&&(jt.dispose(),jt=null),Xe.stop()};function Et(Z){Z.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),F=!0}function G(){console.log("THREE.WebGLRenderer: Context Restored."),F=!1;let Z=Te.autoReset,mt=ne.enabled,It=ne.autoUpdate,St=ne.needsUpdate,vt=ne.type;at(),Te.autoReset=Z,ne.enabled=mt,ne.autoUpdate=It,ne.needsUpdate=St,ne.type=vt}function ot(Z){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",Z.statusMessage)}function et(Z){let mt=Z.target;mt.removeEventListener("dispose",et),lt(mt)}function lt(Z){Ft(Z),be.remove(Z)}function Ft(Z){let mt=be.get(Z).programs;mt!==void 0&&(mt.forEach(function(It){dt.releaseProgram(It)}),Z.isShaderMaterial&&dt.releaseShaderCache(Z))}this.renderBufferDirect=function(Z,mt,It,St,vt,he){mt===null&&(mt=qt);let ue=vt.isMesh&&vt.matrixWorld.determinant()<0,we=Qn(Z,mt,It,St,vt);fe.setMaterial(St,ue);let de=It.index,Be=1;if(St.wireframe===!0){if(de=Pt.getWireframeAttribute(It),de===void 0)return;Be=2}let Ae=It.drawRange,Pe=It.attributes.position,en=Ae.start*Be,si=(Ae.start+Ae.count)*Be;he!==null&&(en=Math.max(en,he.start*Be),si=Math.min(si,(he.start+he.count)*Be)),de!==null?(en=Math.max(en,0),si=Math.min(si,de.count)):Pe!=null&&(en=Math.max(en,0),si=Math.min(si,Pe.count));let br=si-en;if(br<0||br===1/0)return;W.setup(vt,St,we,It,de);let Vi,sr=N;if(de!==null&&(Vi=z.get(de),sr=k,sr.setIndex(Vi)),vt.isMesh)St.wireframe===!0?(fe.setLineWidth(St.wireframeLinewidth*xe()),sr.setMode(ft.LINES)):sr.setMode(ft.TRIANGLES);else if(vt.isLine){let ye=St.linewidth;ye===void 0&&(ye=1),fe.setLineWidth(ye*xe()),vt.isLineSegments?sr.setMode(ft.LINES):vt.isLineLoop?sr.setMode(ft.LINE_LOOP):sr.setMode(ft.LINE_STRIP)}else vt.isPoints?sr.setMode(ft.POINTS):vt.isSprite&&sr.setMode(ft.TRIANGLES);if(vt.isBatchedMesh)sr.renderMultiDraw(vt._multiDrawStarts,vt._multiDrawCounts,vt._multiDrawCount);else if(vt.isInstancedMesh)sr.renderInstances(en,br,vt.count);else if(It.isInstancedBufferGeometry){let ye=It._maxInstanceCount!==void 0?It._maxInstanceCount:1/0,Ua=Math.min(It.instanceCount,ye);sr.renderInstances(en,br,Ua)}else sr.render(en,br)};function Kt(Z,mt,It){Z.transparent===!0&&Z.side===cu&&Z.forceSinglePass===!1?(Z.side=$o,Z.needsUpdate=!0,rr(Z,mt,It),Z.side=Ju,Z.needsUpdate=!0,rr(Z,mt,It),Z.side=cu):rr(Z,mt,It)}this.compile=function(Z,mt,It=null){It===null&&(It=Z),S=Vt.get(It),S.init(),R.push(S),It.traverseVisible(function(vt){vt.isLight&&vt.layers.test(mt.layers)&&(S.pushLight(vt),vt.castShadow&&S.pushShadow(vt))}),Z!==It&&Z.traverseVisible(function(vt){vt.isLight&&vt.layers.test(mt.layers)&&(S.pushLight(vt),vt.castShadow&&S.pushShadow(vt))}),S.setupLights(C._useLegacyLights);let St=new Set;return Z.traverse(function(vt){let he=vt.material;if(he)if(Array.isArray(he))for(let ue=0;ue<he.length;ue++){let we=he[ue];Kt(we,It,vt),St.add(we)}else Kt(he,It,vt),St.add(he)}),R.pop(),S=null,St},this.compileAsync=function(Z,mt,It=null){let St=this.compile(Z,mt,It);return new Promise(vt=>{function he(){if(St.forEach(function(ue){be.get(ue).currentProgram.isReady()&&St.delete(ue)}),St.size===0){vt(Z);return}setTimeout(he,10)}ee.get("KHR_parallel_shader_compile")!==null?he():setTimeout(he,10)})};let me=null;function ve(Z){me&&me(Z)}function qe(){Xe.stop()}function Ue(){Xe.start()}let Xe=new xC;Xe.setAnimationLoop(ve),typeof self!="undefined"&&Xe.setContext(self),this.setAnimationLoop=function(Z){me=Z,wt.setAnimationLoop(Z),Z===null?Xe.stop():Xe.start()},wt.addEventListener("sessionstart",qe),wt.addEventListener("sessionend",Ue),this.render=function(Z,mt){if(mt!==void 0&&mt.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(F===!0)return;Z.matrixWorldAutoUpdate===!0&&Z.updateMatrixWorld(),mt.parent===null&&mt.matrixWorldAutoUpdate===!0&&mt.updateMatrixWorld(),wt.enabled===!0&&wt.isPresenting===!0&&(wt.cameraAutoUpdate===!0&&wt.updateCamera(mt),mt=wt.getCamera()),Z.isScene===!0&&Z.onBeforeRender(C,Z,mt,q),S=Vt.get(Z,R.length),S.init(),R.push(S),ce.multiplyMatrices(mt.projectionMatrix,mt.matrixWorldInverse),ae.setFromProjectionMatrix(ce),Ut=this.localClippingEnabled,ut=Zt.init(this.clippingPlanes,Ut),I=Ce.get(Z,w.length),I.init(),w.push(I),Je(Z,mt,0,C.sortObjects),I.finish(),C.sortObjects===!0&&I.sort(pt,yt),this.info.render.frame++,ut===!0&&Zt.beginShadows();let It=S.state.shadowsArray;if(ne.render(It,Z,mt),ut===!0&&Zt.endShadows(),this.info.autoReset===!0&&this.info.reset(),(wt.enabled===!1||wt.isPresenting===!1||wt.hasDepthSensing()===!1)&&rt.render(I,Z),S.setupLights(C._useLegacyLights),mt.isArrayCamera){let St=mt.cameras;for(let vt=0,he=St.length;vt<he;vt++){let ue=St[vt];wr(I,Z,ue,ue.viewport)}}else wr(I,Z,mt);q!==null&&(Wt.updateMultisampleRenderTarget(q),Wt.updateRenderTargetMipmap(q)),Z.isScene===!0&&Z.onAfterRender(C,Z,mt),W.resetDefaultState(),D=-1,xt=null,R.pop(),R.length>0?S=R[R.length-1]:S=null,w.pop(),w.length>0?I=w[w.length-1]:I=null};function Je(Z,mt,It,St){if(Z.visible===!1)return;if(Z.layers.test(mt.layers)){if(Z.isGroup)It=Z.renderOrder;else if(Z.isLOD)Z.autoUpdate===!0&&Z.update(mt);else if(Z.isLight)S.pushLight(Z),Z.castShadow&&S.pushShadow(Z);else if(Z.isSprite){if(!Z.frustumCulled||ae.intersectsSprite(Z)){St&&$t.setFromMatrixPosition(Z.matrixWorld).applyMatrix4(ce);let ue=Ot.update(Z),we=Z.material;we.visible&&I.push(Z,ue,we,It,$t.z,null)}}else if((Z.isMesh||Z.isLine||Z.isPoints)&&(!Z.frustumCulled||ae.intersectsObject(Z))){let ue=Ot.update(Z),we=Z.material;if(St&&(Z.boundingSphere!==void 0?(Z.boundingSphere===null&&Z.computeBoundingSphere(),$t.copy(Z.boundingSphere.center)):(ue.boundingSphere===null&&ue.computeBoundingSphere(),$t.copy(ue.boundingSphere.center)),$t.applyMatrix4(Z.matrixWorld).applyMatrix4(ce)),Array.isArray(we)){let de=ue.groups;for(let Be=0,Ae=de.length;Be<Ae;Be++){let Pe=de[Be],en=we[Pe.materialIndex];en&&en.visible&&I.push(Z,ue,en,It,$t.z,Pe)}}else we.visible&&I.push(Z,ue,we,It,$t.z,null)}}let he=Z.children;for(let ue=0,we=he.length;ue<we;ue++)Je(he[ue],mt,It,St)}function wr(Z,mt,It,St){let vt=Z.opaque,he=Z.transmissive,ue=Z.transparent;S.setupLightsView(It),ut===!0&&Zt.setGlobalState(C.clippingPlanes,It),he.length>0&&Jr(vt,he,mt,It),St&&fe.viewport(B.copy(St)),vt.length>0&&nr(vt,mt,It),he.length>0&&nr(he,mt,It),ue.length>0&&nr(ue,mt,It),fe.buffers.depth.setTest(!0),fe.buffers.depth.setMask(!0),fe.buffers.color.setMask(!0),fe.setPolygonOffset(!1)}function Jr(Z,mt,It,St){if((It.isScene===!0?It.overrideMaterial:null)!==null)return;let he=ge.isWebGL2;jt===null&&(jt=new du(1,1,{generateMipmaps:!0,type:ee.has("EXT_color_buffer_half_float")?ah:$u,minFilter:Ll,samples:he?4:0})),C.getDrawingBufferSize(te),he?jt.setSize(te.x,te.y):jt.setSize(jy(te.x),jy(te.y));let ue=C.getRenderTarget();C.setRenderTarget(jt),C.getClearColor(Dt),Q=C.getClearAlpha(),Q<1&&C.setClearColor(16777215,.5),C.clear();let we=C.toneMapping;C.toneMapping=Yu,nr(Z,It,St),Wt.updateMultisampleRenderTarget(jt),Wt.updateRenderTargetMipmap(jt);let de=!1;for(let Be=0,Ae=mt.length;Be<Ae;Be++){let Pe=mt[Be],en=Pe.object,si=Pe.geometry,br=Pe.material,Vi=Pe.group;if(br.side===cu&&en.layers.test(St.layers)){let sr=br.side;br.side=$o,br.needsUpdate=!0,Ie(en,It,St,si,br,Vi),br.side=sr,br.needsUpdate=!0,de=!0}}de===!0&&(Wt.updateMultisampleRenderTarget(jt),Wt.updateRenderTargetMipmap(jt)),C.setRenderTarget(ue),C.setClearColor(Dt,Q),C.toneMapping=we}function nr(Z,mt,It){let St=mt.isScene===!0?mt.overrideMaterial:null;for(let vt=0,he=Z.length;vt<he;vt++){let ue=Z[vt],we=ue.object,de=ue.geometry,Be=St===null?ue.material:St,Ae=ue.group;we.layers.test(It.layers)&&Ie(we,mt,It,de,Be,Ae)}}function Ie(Z,mt,It,St,vt,he){Z.onBeforeRender(C,mt,It,St,vt,he),Z.modelViewMatrix.multiplyMatrices(It.matrixWorldInverse,Z.matrixWorld),Z.normalMatrix.getNormalMatrix(Z.modelViewMatrix),vt.onBeforeRender(C,mt,It,St,Z,he),vt.transparent===!0&&vt.side===cu&&vt.forceSinglePass===!1?(vt.side=$o,vt.needsUpdate=!0,C.renderBufferDirect(It,mt,St,vt,Z,he),vt.side=Ju,vt.needsUpdate=!0,C.renderBufferDirect(It,mt,St,vt,Z,he),vt.side=cu):C.renderBufferDirect(It,mt,St,vt,Z,he),Z.onAfterRender(C,mt,It,St,vt,he)}function rr(Z,mt,It){mt.isScene!==!0&&(mt=qt);let St=be.get(Z),vt=S.state.lights,he=S.state.shadowsArray,ue=vt.state.version,we=dt.getParameters(Z,vt.state,he,mt,It),de=dt.getProgramCacheKey(we),Be=St.programs;St.environment=Z.isMeshStandardMaterial?mt.environment:null,St.fog=mt.fog,St.envMap=(Z.isMeshStandardMaterial?tt:Me).get(Z.envMap||St.environment),St.envMapRotation=St.environment!==null&&Z.envMap===null?mt.environmentRotation:Z.envMapRotation,Be===void 0&&(Z.addEventListener("dispose",et),Be=new Map,St.programs=Be);let Ae=Be.get(de);if(Ae!==void 0){if(St.currentProgram===Ae&&St.lightsStateVersion===ue)return ur(Z,we),Ae}else we.uniforms=dt.getUniforms(Z),Z.onBuild(It,we,C),Z.onBeforeCompile(we,C),Ae=dt.acquireProgram(we,de),Be.set(de,Ae),St.uniforms=we.uniforms;let Pe=St.uniforms;return(!Z.isShaderMaterial&&!Z.isRawShaderMaterial||Z.clipping===!0)&&(Pe.clippingPlanes=Zt.uniform),ur(Z,we),St.needsLights=oi(Z),St.lightsStateVersion=ue,St.needsLights&&(Pe.ambientLightColor.value=vt.state.ambient,Pe.lightProbe.value=vt.state.probe,Pe.directionalLights.value=vt.state.directional,Pe.directionalLightShadows.value=vt.state.directionalShadow,Pe.spotLights.value=vt.state.spot,Pe.spotLightShadows.value=vt.state.spotShadow,Pe.rectAreaLights.value=vt.state.rectArea,Pe.ltc_1.value=vt.state.rectAreaLTC1,Pe.ltc_2.value=vt.state.rectAreaLTC2,Pe.pointLights.value=vt.state.point,Pe.pointLightShadows.value=vt.state.pointShadow,Pe.hemisphereLights.value=vt.state.hemi,Pe.directionalShadowMap.value=vt.state.directionalShadowMap,Pe.directionalShadowMatrix.value=vt.state.directionalShadowMatrix,Pe.spotShadowMap.value=vt.state.spotShadowMap,Pe.spotLightMatrix.value=vt.state.spotLightMatrix,Pe.spotLightMap.value=vt.state.spotLightMap,Pe.pointShadowMap.value=vt.state.pointShadowMap,Pe.pointShadowMatrix.value=vt.state.pointShadowMatrix),St.currentProgram=Ae,St.uniformsList=null,Ae}function pr(Z){if(Z.uniformsList===null){let mt=Z.currentProgram.getUniforms();Z.uniformsList=qc.seqWithValue(mt.seq,Z.uniforms)}return Z.uniformsList}function ur(Z,mt){let It=be.get(Z);It.outputColorSpace=mt.outputColorSpace,It.batching=mt.batching,It.instancing=mt.instancing,It.instancingColor=mt.instancingColor,It.instancingMorph=mt.instancingMorph,It.skinning=mt.skinning,It.morphTargets=mt.morphTargets,It.morphNormals=mt.morphNormals,It.morphColors=mt.morphColors,It.morphTargetsCount=mt.morphTargetsCount,It.numClippingPlanes=mt.numClippingPlanes,It.numIntersection=mt.numClipIntersection,It.vertexAlphas=mt.vertexAlphas,It.vertexTangents=mt.vertexTangents,It.toneMapping=mt.toneMapping}function Qn(Z,mt,It,St,vt){mt.isScene!==!0&&(mt=qt),Wt.resetTextureUnits();let he=mt.fog,ue=St.isMeshStandardMaterial?mt.environment:null,we=q===null?C.outputColorSpace:q.isXRRenderTarget===!0?q.texture.colorSpace:tl,de=(St.isMeshStandardMaterial?tt:Me).get(St.envMap||ue),Be=St.vertexColors===!0&&!!It.attributes.color&&It.attributes.color.itemSize===4,Ae=!!It.attributes.tangent&&(!!St.normalMap||St.anisotropy>0),Pe=!!It.morphAttributes.position,en=!!It.morphAttributes.normal,si=!!It.morphAttributes.color,br=Yu;St.toneMapped&&(q===null||q.isXRRenderTarget===!0)&&(br=C.toneMapping);let Vi=It.morphAttributes.position||It.morphAttributes.normal||It.morphAttributes.color,sr=Vi!==void 0?Vi.length:0,ye=be.get(St),Ua=S.state.lights;if(ut===!0&&(Ut===!0||Z!==xt)){let Ai=Z===xt&&St.id===D;Zt.setState(St,Z,Ai)}let nn=!1;St.version===ye.__version?(ye.needsLights&&ye.lightsStateVersion!==Ua.state.version||ye.outputColorSpace!==we||vt.isBatchedMesh&&ye.batching===!1||!vt.isBatchedMesh&&ye.batching===!0||vt.isInstancedMesh&&ye.instancing===!1||!vt.isInstancedMesh&&ye.instancing===!0||vt.isSkinnedMesh&&ye.skinning===!1||!vt.isSkinnedMesh&&ye.skinning===!0||vt.isInstancedMesh&&ye.instancingColor===!0&&vt.instanceColor===null||vt.isInstancedMesh&&ye.instancingColor===!1&&vt.instanceColor!==null||vt.isInstancedMesh&&ye.instancingMorph===!0&&vt.morphTexture===null||vt.isInstancedMesh&&ye.instancingMorph===!1&&vt.morphTexture!==null||ye.envMap!==de||St.fog===!0&&ye.fog!==he||ye.numClippingPlanes!==void 0&&(ye.numClippingPlanes!==Zt.numPlanes||ye.numIntersection!==Zt.numIntersection)||ye.vertexAlphas!==Be||ye.vertexTangents!==Ae||ye.morphTargets!==Pe||ye.morphNormals!==en||ye.morphColors!==si||ye.toneMapping!==br||ge.isWebGL2===!0&&ye.morphTargetsCount!==sr)&&(nn=!0):(nn=!0,ye.__version=St.version);let fo=ye.currentProgram;nn===!0&&(fo=rr(St,mt,vt));let ul=!1,ze=!1,vs=!1,ir=fo.getUniforms(),Qo=ye.uniforms;if(fe.useProgram(fo.program)&&(ul=!0,ze=!0,vs=!0),St.id!==D&&(D=St.id,ze=!0),ul||xt!==Z){ir.setValue(ft,"projectionMatrix",Z.projectionMatrix),ir.setValue(ft,"viewMatrix",Z.matrixWorldInverse);let Ai=ir.map.cameraPosition;Ai!==void 0&&Ai.setValue(ft,$t.setFromMatrixPosition(Z.matrixWorld)),ge.logarithmicDepthBuffer&&ir.setValue(ft,"logDepthBufFC",2/(Math.log(Z.far+1)/Math.LN2)),(St.isMeshPhongMaterial||St.isMeshToonMaterial||St.isMeshLambertMaterial||St.isMeshBasicMaterial||St.isMeshStandardMaterial||St.isShaderMaterial)&&ir.setValue(ft,"isOrthographic",Z.isOrthographicCamera===!0),xt!==Z&&(xt=Z,ze=!0,vs=!0)}if(vt.isSkinnedMesh){ir.setOptional(ft,vt,"bindMatrix"),ir.setOptional(ft,vt,"bindMatrixInverse");let Ai=vt.skeleton;Ai&&(ge.floatVertexTextures?(Ai.boneTexture===null&&Ai.computeBoneTexture(),ir.setValue(ft,"boneTexture",Ai.boneTexture,Wt)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}vt.isBatchedMesh&&(ir.setOptional(ft,vt,"batchingTexture"),ir.setValue(ft,"batchingTexture",vt._matricesTexture,Wt));let Le=It.morphAttributes;if((Le.position!==void 0||Le.normal!==void 0||Le.color!==void 0&&ge.isWebGL2===!0)&&P.update(vt,It,fo),(ze||ye.receiveShadow!==vt.receiveShadow)&&(ye.receiveShadow=vt.receiveShadow,ir.setValue(ft,"receiveShadow",vt.receiveShadow)),St.isMeshGouraudMaterial&&St.envMap!==null&&(Qo.envMap.value=de,Qo.flipEnvMap.value=de.isCubeTexture&&de.isRenderTargetTexture===!1?-1:1),ze&&(ir.setValue(ft,"toneMappingExposure",C.toneMappingExposure),ye.needsLights&&bi(Qo,vs),he&&St.fog===!0&&Ht.refreshFogUniforms(Qo,he),Ht.refreshMaterialUniforms(Qo,St,Lt,Mt,jt),qc.upload(ft,pr(ye),Qo,Wt)),St.isShaderMaterial&&St.uniformsNeedUpdate===!0&&(qc.upload(ft,pr(ye),Qo,Wt),St.uniformsNeedUpdate=!1),St.isSpriteMaterial&&ir.setValue(ft,"center",vt.center),ir.setValue(ft,"modelViewMatrix",vt.modelViewMatrix),ir.setValue(ft,"normalMatrix",vt.normalMatrix),ir.setValue(ft,"modelMatrix",vt.matrixWorld),St.isShaderMaterial||St.isRawShaderMaterial){let Ai=St.uniformsGroups;for(let Ba=0,mu=Ai.length;Ba<mu;Ba++)if(ge.isWebGL2){let Ti=Ai[Ba];ht.update(Ti,fo),ht.bind(Ti,fo)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return fo}function bi(Z,mt){Z.ambientLightColor.needsUpdate=mt,Z.lightProbe.needsUpdate=mt,Z.directionalLights.needsUpdate=mt,Z.directionalLightShadows.needsUpdate=mt,Z.pointLights.needsUpdate=mt,Z.pointLightShadows.needsUpdate=mt,Z.spotLights.needsUpdate=mt,Z.spotLightShadows.needsUpdate=mt,Z.rectAreaLights.needsUpdate=mt,Z.hemisphereLights.needsUpdate=mt}function oi(Z){return Z.isMeshLambertMaterial||Z.isMeshToonMaterial||Z.isMeshPhongMaterial||Z.isMeshStandardMaterial||Z.isShadowMaterial||Z.isShaderMaterial&&Z.lights===!0}this.getActiveCubeFace=function(){return V},this.getActiveMipmapLevel=function(){return X},this.getRenderTarget=function(){return q},this.setRenderTargetTextures=function(Z,mt,It){be.get(Z.texture).__webglTexture=mt,be.get(Z.depthTexture).__webglTexture=It;let St=be.get(Z);St.__hasExternalTextures=!0,St.__autoAllocateDepthBuffer=It===void 0,St.__autoAllocateDepthBuffer||ee.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),St.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(Z,mt){let It=be.get(Z);It.__webglFramebuffer=mt,It.__useDefaultFramebuffer=mt===void 0},this.setRenderTarget=function(Z,mt=0,It=0){q=Z,V=mt,X=It;let St=!0,vt=null,he=!1,ue=!1;if(Z){let de=be.get(Z);de.__useDefaultFramebuffer!==void 0?(fe.bindFramebuffer(ft.FRAMEBUFFER,null),St=!1):de.__webglFramebuffer===void 0?Wt.setupRenderTarget(Z):de.__hasExternalTextures&&Wt.rebindTextures(Z,be.get(Z.texture).__webglTexture,be.get(Z.depthTexture).__webglTexture);let Be=Z.texture;(Be.isData3DTexture||Be.isDataArrayTexture||Be.isCompressedArrayTexture)&&(ue=!0);let Ae=be.get(Z).__webglFramebuffer;Z.isWebGLCubeRenderTarget?(Array.isArray(Ae[mt])?vt=Ae[mt][It]:vt=Ae[mt],he=!0):ge.isWebGL2&&Z.samples>0&&Wt.useMultisampledRTT(Z)===!1?vt=be.get(Z).__webglMultisampledFramebuffer:Array.isArray(Ae)?vt=Ae[It]:vt=Ae,B.copy(Z.viewport),j.copy(Z.scissor),J=Z.scissorTest}else B.copy(K).multiplyScalar(Lt).floor(),j.copy(Bt).multiplyScalar(Lt).floor(),J=Gt;if(fe.bindFramebuffer(ft.FRAMEBUFFER,vt)&&ge.drawBuffers&&St&&fe.drawBuffers(Z,vt),fe.viewport(B),fe.scissor(j),fe.setScissorTest(J),he){let de=be.get(Z.texture);ft.framebufferTexture2D(ft.FRAMEBUFFER,ft.COLOR_ATTACHMENT0,ft.TEXTURE_CUBE_MAP_POSITIVE_X+mt,de.__webglTexture,It)}else if(ue){let de=be.get(Z.texture),Be=mt||0;ft.framebufferTextureLayer(ft.FRAMEBUFFER,ft.COLOR_ATTACHMENT0,de.__webglTexture,It||0,Be)}D=-1},this.readRenderTargetPixels=function(Z,mt,It,St,vt,he,ue){if(!(Z&&Z.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let we=be.get(Z).__webglFramebuffer;if(Z.isWebGLCubeRenderTarget&&ue!==void 0&&(we=we[ue]),we){fe.bindFramebuffer(ft.FRAMEBUFFER,we);try{let de=Z.texture,Be=de.format,Ae=de.type;if(Be!==na&&$.convert(Be)!==ft.getParameter(ft.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}let Pe=Ae===ah&&(ee.has("EXT_color_buffer_half_float")||ge.isWebGL2&&ee.has("EXT_color_buffer_float"));if(Ae!==$u&&$.convert(Ae)!==ft.getParameter(ft.IMPLEMENTATION_COLOR_READ_TYPE)&&!(Ae===fu&&(ge.isWebGL2||ee.has("OES_texture_float")||ee.has("WEBGL_color_buffer_float")))&&!Pe){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}mt>=0&&mt<=Z.width-St&&It>=0&&It<=Z.height-vt&&ft.readPixels(mt,It,St,vt,$.convert(Be),$.convert(Ae),he)}finally{let de=q!==null?be.get(q).__webglFramebuffer:null;fe.bindFramebuffer(ft.FRAMEBUFFER,de)}}},this.copyFramebufferToTexture=function(Z,mt,It=0){let St=Math.pow(2,-It),vt=Math.floor(mt.image.width*St),he=Math.floor(mt.image.height*St);Wt.setTexture2D(mt,0),ft.copyTexSubImage2D(ft.TEXTURE_2D,It,0,0,Z.x,Z.y,vt,he),fe.unbindTexture()},this.copyTextureToTexture=function(Z,mt,It,St=0){let vt=mt.image.width,he=mt.image.height,ue=$.convert(It.format),we=$.convert(It.type);Wt.setTexture2D(It,0),ft.pixelStorei(ft.UNPACK_FLIP_Y_WEBGL,It.flipY),ft.pixelStorei(ft.UNPACK_PREMULTIPLY_ALPHA_WEBGL,It.premultiplyAlpha),ft.pixelStorei(ft.UNPACK_ALIGNMENT,It.unpackAlignment),mt.isDataTexture?ft.texSubImage2D(ft.TEXTURE_2D,St,Z.x,Z.y,vt,he,ue,we,mt.image.data):mt.isCompressedTexture?ft.compressedTexSubImage2D(ft.TEXTURE_2D,St,Z.x,Z.y,mt.mipmaps[0].width,mt.mipmaps[0].height,ue,mt.mipmaps[0].data):ft.texSubImage2D(ft.TEXTURE_2D,St,Z.x,Z.y,ue,we,mt.image),St===0&&It.generateMipmaps&&ft.generateMipmap(ft.TEXTURE_2D),fe.unbindTexture()},this.copyTextureToTexture3D=function(Z,mt,It,St,vt=0){if(C.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let he=Math.round(Z.max.x-Z.min.x),ue=Math.round(Z.max.y-Z.min.y),we=Z.max.z-Z.min.z+1,de=$.convert(St.format),Be=$.convert(St.type),Ae;if(St.isData3DTexture)Wt.setTexture3D(St,0),Ae=ft.TEXTURE_3D;else if(St.isDataArrayTexture||St.isCompressedArrayTexture)Wt.setTexture2DArray(St,0),Ae=ft.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}ft.pixelStorei(ft.UNPACK_FLIP_Y_WEBGL,St.flipY),ft.pixelStorei(ft.UNPACK_PREMULTIPLY_ALPHA_WEBGL,St.premultiplyAlpha),ft.pixelStorei(ft.UNPACK_ALIGNMENT,St.unpackAlignment);let Pe=ft.getParameter(ft.UNPACK_ROW_LENGTH),en=ft.getParameter(ft.UNPACK_IMAGE_HEIGHT),si=ft.getParameter(ft.UNPACK_SKIP_PIXELS),br=ft.getParameter(ft.UNPACK_SKIP_ROWS),Vi=ft.getParameter(ft.UNPACK_SKIP_IMAGES),sr=It.isCompressedTexture?It.mipmaps[vt]:It.image;ft.pixelStorei(ft.UNPACK_ROW_LENGTH,sr.width),ft.pixelStorei(ft.UNPACK_IMAGE_HEIGHT,sr.height),ft.pixelStorei(ft.UNPACK_SKIP_PIXELS,Z.min.x),ft.pixelStorei(ft.UNPACK_SKIP_ROWS,Z.min.y),ft.pixelStorei(ft.UNPACK_SKIP_IMAGES,Z.min.z),It.isDataTexture||It.isData3DTexture?ft.texSubImage3D(Ae,vt,mt.x,mt.y,mt.z,he,ue,we,de,Be,sr.data):St.isCompressedArrayTexture?ft.compressedTexSubImage3D(Ae,vt,mt.x,mt.y,mt.z,he,ue,we,de,sr.data):ft.texSubImage3D(Ae,vt,mt.x,mt.y,mt.z,he,ue,we,de,Be,sr),ft.pixelStorei(ft.UNPACK_ROW_LENGTH,Pe),ft.pixelStorei(ft.UNPACK_IMAGE_HEIGHT,en),ft.pixelStorei(ft.UNPACK_SKIP_PIXELS,si),ft.pixelStorei(ft.UNPACK_SKIP_ROWS,br),ft.pixelStorei(ft.UNPACK_SKIP_IMAGES,Vi),vt===0&&St.generateMipmaps&&ft.generateMipmap(Ae),fe.unbindTexture()},this.initTexture=function(Z){Z.isCubeTexture?Wt.setTextureCube(Z,0):Z.isData3DTexture?Wt.setTexture3D(Z,0):Z.isDataArrayTexture||Z.isCompressedArrayTexture?Wt.setTexture2DArray(Z,0):Wt.setTexture2D(Z,0),fe.unbindTexture()},this.resetState=function(){V=0,X=0,q=null,fe.reset(),W.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return hu}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;let e=this.getContext();e.drawingBufferColorSpace=t===Nv?"display-p3":"srgb",e.unpackColorSpace=xr.workingColorSpace===Vd?"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}},yv=class extends mv{};yv.prototype.isWebGL1Renderer=!0;var vv=class{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=Zy,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Zu()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return yC("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,o){t*=this.stride,o*=e.stride;for(let s=0,l=this.stride;s<l;s++)this.array[t+s]=e.array[o+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=Zu()),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]),o=new this.constructor(e,this.stride);return o.setUsage(this.usage),o}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=Zu()),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}}},wo=new Rt,qd=class n{constructor(t,e,o,s=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=o,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,o=this.data.count;e<o;e++)wo.fromBufferAttribute(this,e),wo.applyMatrix4(t),this.setXYZ(e,wo.x,wo.y,wo.z);return this}applyNormalMatrix(t){for(let e=0,o=this.count;e<o;e++)wo.fromBufferAttribute(this,e),wo.applyNormalMatrix(t),this.setXYZ(e,wo.x,wo.y,wo.z);return this}transformDirection(t){for(let e=0,o=this.count;e<o;e++)wo.fromBufferAttribute(this,e),wo.transformDirection(t),this.setXYZ(e,wo.x,wo.y,wo.z);return this}getComponent(t,e){let o=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(o=Pa(o,this.array)),o}setComponent(t,e,o){return this.normalized&&(o=_r(o,this.array)),this.data.array[t*this.data.stride+this.offset+e]=o,this}setX(t,e){return this.normalized&&(e=_r(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=_r(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=_r(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=_r(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=Pa(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=Pa(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=Pa(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=Pa(e,this.array)),e}setXY(t,e,o){return t=t*this.data.stride+this.offset,this.normalized&&(e=_r(e,this.array),o=_r(o,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=o,this}setXYZ(t,e,o,s){return t=t*this.data.stride+this.offset,this.normalized&&(e=_r(e,this.array),o=_r(o,this.array),s=_r(s,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=o,this.data.array[t+2]=s,this}setXYZW(t,e,o,s,l){return t=t*this.data.stride+this.offset,this.normalized&&(e=_r(e,this.array),o=_r(o,this.array),s=_r(s,this.array),l=_r(l,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=o,this.data.array[t+2]=s,this.data.array[t+3]=l,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 o=0;o<this.count;o++){let s=o*this.data.stride+this.offset;for(let l=0;l<this.itemSize;l++)e.push(this.data.array[s+l])}return new ms(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 o=0;o<this.count;o++){let s=o*this.data.stride+this.offset;for(let l=0;l<this.itemSize;l++)e.push(this.data.array[s+l])}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}}},_v=class extends Bl{constructor(t){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new ar(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}},Hu,rh=new Rt,Oc=new Rt,Dc=new Rt,Fc=new Ye,ih=new Ye,AC=new vi,yd=new Rt,oh=new Rt,vd=new Rt,rC=new Ye,qy=new Ye,iC=new Ye,xv=class extends ia{constructor(t=new _v){if(super(),this.isSprite=!0,this.type="Sprite",Hu===void 0){Hu=new Qu;let e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),o=new vv(e,5);Hu.setIndex([0,1,2,0,2,3]),Hu.setAttribute("position",new qd(o,3,0,!1)),Hu.setAttribute("uv",new qd(o,2,3,!1))}this.geometry=Hu,this.material=t,this.center=new Ye(.5,.5)}raycast(t,e){t.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Oc.setFromMatrixScale(this.matrixWorld),AC.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),Dc.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Oc.multiplyScalar(-Dc.z);let o=this.material.rotation,s,l;o!==0&&(l=Math.cos(o),s=Math.sin(o));let p=this.center;_d(yd.set(-.5,-.5,0),Dc,p,Oc,s,l),_d(oh.set(.5,-.5,0),Dc,p,Oc,s,l),_d(vd.set(.5,.5,0),Dc,p,Oc,s,l),rC.set(0,0),qy.set(1,0),iC.set(1,1);let h=t.ray.intersectTriangle(yd,oh,vd,!1,rh);if(h===null&&(_d(oh.set(-.5,.5,0),Dc,p,Oc,s,l),qy.set(0,1),h=t.ray.intersectTriangle(yd,vd,oh,!1,rh),h===null))return;let g=t.ray.origin.distanceTo(rh);g<t.near||g>t.far||e.push({distance:g,point:rh.clone(),uv:Nl.getInterpolation(rh,yd,oh,vd,rC,qy,iC,new Ye),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}};xv.Dispose=function(){Hu.dispose(),Hu=void 0};function _d(n,t,e,o,s,l){Fc.subVectors(n,e).addScalar(.5).multiply(o),s!==void 0?(ih.x=l*Fc.x-s*Fc.y,ih.y=s*Fc.x+l*Fc.y):ih.copy(Fc),n.copy(t),n.x+=ih.x,n.y+=ih.y,n.applyMatrix4(AC)}function xd(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 fX(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}var Yc=class{constructor(t,e,o,s){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=s!==void 0?s:new e.constructor(o),this.sampleValues=e,this.valueSize=o,this.settings=null,this.DefaultSettings_={}}evaluate(t){let e=this.parameterPositions,o=this._cachedIndex,s=e[o],l=e[o-1];t:{e:{let p;n:{r:if(!(t<s)){for(let h=o+2;;){if(s===void 0){if(t<l)break r;return o=e.length,this._cachedIndex=o,this.copySampleValue_(o-1)}if(o===h)break;if(l=s,s=e[++o],t<s)break e}p=e.length;break n}if(!(t>=l)){let h=e[1];t<h&&(o=2,l=h);for(let g=o-2;;){if(l===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(o===g)break;if(s=l,l=e[--o-1],t>=l)break e}p=o,o=0;break n}break t}for(;o<p;){let h=o+p>>>1;t<e[h]?p=h:o=h+1}if(s=e[o],l=e[o-1],l===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(s===void 0)return o=e.length,this._cachedIndex=o,this.copySampleValue_(o-1)}this._cachedIndex=o,this.intervalChanged_(o,l,s)}return this.interpolate_(o,l,t,s)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,o=this.sampleValues,s=this.valueSize,l=t*s;for(let p=0;p!==s;++p)e[p]=o[l+p];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},Ev=class extends Yc{constructor(t,e,o,s){super(t,e,o,s),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:hT,endingEnd:hT}}intervalChanged_(t,e,o){let s=this.parameterPositions,l=t-2,p=t+1,h=s[l],g=s[p];if(h===void 0)switch(this.getSettings_().endingStart){case pT:l=t,h=2*e-o;break;case dT:l=s.length-2,h=e+s[l]-s[l+1];break;default:l=t,h=o}if(g===void 0)switch(this.getSettings_().endingEnd){case pT:p=t,g=2*o-e;break;case dT:p=1,g=o+s[1]-s[0];break;default:p=t-1,g=e}let m=(o-e)*.5,v=this.valueSize;this._weightPrev=m/(e-h),this._weightNext=m/(g-o),this._offsetPrev=l*v,this._offsetNext=p*v}interpolate_(t,e,o,s){let l=this.resultBuffer,p=this.sampleValues,h=this.valueSize,g=t*h,m=g-h,v=this._offsetPrev,x=this._offsetNext,E=this._weightPrev,M=this._weightNext,A=(o-e)/(s-e),I=A*A,S=I*A,w=-E*S+2*E*I-E*A,R=(1+E)*S+(-1.5-2*E)*I+(-.5+E)*A+1,C=(-1-M)*S+(1.5+M)*I+.5*A,F=M*S-M*I;for(let V=0;V!==h;++V)l[V]=w*p[v+V]+R*p[m+V]+C*p[g+V]+F*p[x+V];return l}},wv=class extends Yc{constructor(t,e,o,s){super(t,e,o,s)}interpolate_(t,e,o,s){let l=this.resultBuffer,p=this.sampleValues,h=this.valueSize,g=t*h,m=g-h,v=(o-e)/(s-e),x=1-v;for(let E=0;E!==h;++E)l[E]=p[m+E]*x+p[g+E]*v;return l}},Sv=class extends Yc{constructor(t,e,o,s){super(t,e,o,s)}interpolate_(t){return this.copySampleValue_(t-1)}},oa=class{constructor(t,e,o,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=xd(e,this.TimeBufferType),this.values=xd(o,this.ValueBufferType),this.setInterpolation(s||this.DefaultInterpolation)}static toJSON(t){let e=t.constructor,o;if(e.toJSON!==this.toJSON)o=e.toJSON(t);else{o={name:t.name,times:xd(t.times,Array),values:xd(t.values,Array)};let s=t.getInterpolation();s!==t.DefaultInterpolation&&(o.interpolation=s)}return o.type=t.ValueTypeName,o}InterpolantFactoryMethodDiscrete(t){return new Sv(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new wv(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new Ev(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case wd:e=this.InterpolantFactoryMethodDiscrete;break;case Sd:e=this.InterpolantFactoryMethodLinear;break;case gy:e=this.InterpolantFactoryMethodSmooth;break}if(e===void 0){let o="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(o);return console.warn("THREE.KeyframeTrack:",o),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return wd;case this.InterpolantFactoryMethodLinear:return Sd;case this.InterpolantFactoryMethodSmooth:return gy}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){let e=this.times;for(let o=0,s=e.length;o!==s;++o)e[o]+=t}return this}scale(t){if(t!==1){let e=this.times;for(let o=0,s=e.length;o!==s;++o)e[o]*=t}return this}trim(t,e){let o=this.times,s=o.length,l=0,p=s-1;for(;l!==s&&o[l]<t;)++l;for(;p!==-1&&o[p]>e;)--p;if(++p,l!==0||p!==s){l>=p&&(p=Math.max(p,1),l=p-1);let h=this.getValueSize();this.times=o.slice(l,p),this.values=this.values.slice(l*h,p*h)}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 o=this.times,s=this.values,l=o.length;l===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let p=null;for(let h=0;h!==l;h++){let g=o[h];if(typeof g=="number"&&isNaN(g)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,h,g),t=!1;break}if(p!==null&&p>g){console.error("THREE.KeyframeTrack: Out of order keys.",this,h,g,p),t=!1;break}p=g}if(s!==void 0&&fX(s))for(let h=0,g=s.length;h!==g;++h){let m=s[h];if(isNaN(m)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,h,m),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),o=this.getValueSize(),s=this.getInterpolation()===gy,l=t.length-1,p=1;for(let h=1;h<l;++h){let g=!1,m=t[h],v=t[h+1];if(m!==v&&(h!==1||m!==t[0]))if(s)g=!0;else{let x=h*o,E=x-o,M=x+o;for(let A=0;A!==o;++A){let I=e[x+A];if(I!==e[E+A]||I!==e[M+A]){g=!0;break}}}if(g){if(h!==p){t[p]=t[h];let x=h*o,E=p*o;for(let M=0;M!==o;++M)e[E+M]=e[x+M]}++p}}if(l>0){t[p]=t[l];for(let h=l*o,g=p*o,m=0;m!==o;++m)e[g+m]=e[h+m];++p}return p!==t.length?(this.times=t.slice(0,p),this.values=e.slice(0,p*o)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),o=this.constructor,s=new o(this.name,t,e);return s.createInterpolant=this.createInterpolant,s}};oa.prototype.TimeBufferType=Float32Array;oa.prototype.ValueBufferType=Float32Array;oa.prototype.DefaultInterpolation=Sd;var zl=class extends oa{};zl.prototype.ValueTypeName="bool";zl.prototype.ValueBufferType=Array;zl.prototype.DefaultInterpolation=wd;zl.prototype.InterpolantFactoryMethodLinear=void 0;zl.prototype.InterpolantFactoryMethodSmooth=void 0;var Mv=class extends oa{};Mv.prototype.ValueTypeName="color";var bv=class extends oa{};bv.prototype.ValueTypeName="number";var Av=class extends Yc{constructor(t,e,o,s){super(t,e,o,s)}interpolate_(t,e,o,s){let l=this.resultBuffer,p=this.sampleValues,h=this.valueSize,g=(o-e)/(s-e),m=t*h;for(let v=m+h;m!==v;m+=4)ju.slerpFlat(l,0,p,m-h,p,m,g);return l}},ch=class extends oa{InterpolantFactoryMethodLinear(t){return new Av(this.times,this.values,this.getValueSize(),t)}};ch.prototype.ValueTypeName="quaternion";ch.prototype.DefaultInterpolation=Sd;ch.prototype.InterpolantFactoryMethodSmooth=void 0;var Gl=class extends oa{};Gl.prototype.ValueTypeName="string";Gl.prototype.ValueBufferType=Array;Gl.prototype.DefaultInterpolation=wd;Gl.prototype.InterpolantFactoryMethodLinear=void 0;Gl.prototype.InterpolantFactoryMethodSmooth=void 0;var Tv=class extends oa{};Tv.prototype.ValueTypeName="vector";var Cv=class{constructor(t,e,o){let s=this,l=!1,p=0,h=0,g,m=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=o,this.itemStart=function(v){h++,l===!1&&s.onStart!==void 0&&s.onStart(v,p,h),l=!0},this.itemEnd=function(v){p++,s.onProgress!==void 0&&s.onProgress(v,p,h),p===h&&(l=!1,s.onLoad!==void 0&&s.onLoad())},this.itemError=function(v){s.onError!==void 0&&s.onError(v)},this.resolveURL=function(v){return g?g(v):v},this.setURLModifier=function(v){return g=v,this},this.addHandler=function(v,x){return m.push(v,x),this},this.removeHandler=function(v){let x=m.indexOf(v);return x!==-1&&m.splice(x,2),this},this.getHandler=function(v){for(let x=0,E=m.length;x<E;x+=2){let M=m[x],A=m[x+1];if(M.global&&(M.lastIndex=0),M.test(v))return A}return null}}},hX=new Cv,Pv=class{constructor(t){this.manager=t!==void 0?t:hX,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){let o=this;return new Promise(function(s,l){o.load(t,s,e,l)})}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}};Pv.DEFAULT_MATERIAL_NAME="__DEFAULT";var Dv="\\\\[\\\\]\\\\.:\\\\/",pX=new RegExp("["+Dv+"]","g"),Fv="[^"+Dv+"]",dX="[^"+Dv.replace("\\\\.","")+"]",gX=/((?:WC+[\\/:])*)/.source.replace("WC",Fv),mX=/(WCOD+)?/.source.replace("WCOD",dX),yX=/(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace("WC",Fv),vX=/\\.(WC+)(?:\\[(.+)\\])?/.source.replace("WC",Fv),_X=new RegExp("^"+gX+mX+yX+vX+"$"),xX=["material","materials","bones","map"],Iv=class{constructor(t,e,o){let s=o||Or.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,s)}getValue(t,e){this.bind();let o=this._targetGroup.nCachedObjects_,s=this._bindings[o];s!==void 0&&s.getValue(t,e)}setValue(t,e){let o=this._bindings;for(let s=this._targetGroup.nCachedObjects_,l=o.length;s!==l;++s)o[s].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,o=t.length;e!==o;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,o=t.length;e!==o;++e)t[e].unbind()}},Or=class n{constructor(t,e,o){this.path=e,this.parsedPath=o||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,o){return t&&t.isAnimationObjectGroup?new n.Composite(t,e,o):new n(t,e,o)}static sanitizeNodeName(t){return t.replace(/\\s/g,"_").replace(pX,"")}static parseTrackName(t){let e=_X.exec(t);if(e===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);let o={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},s=o.nodeName&&o.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){let l=o.nodeName.substring(s+1);xX.indexOf(l)!==-1&&(o.nodeName=o.nodeName.substring(0,s),o.objectName=l)}if(o.propertyName===null||o.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return o}static findNode(t,e){if(e===void 0||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){let o=t.skeleton.getBoneByName(e);if(o!==void 0)return o}if(t.children){let o=function(l){for(let p=0;p<l.length;p++){let h=l[p];if(h.name===e||h.uuid===e)return h;let g=o(h.children);if(g)return g}return null},s=o(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 o=this.resolvedProperty;for(let s=0,l=o.length;s!==l;++s)t[e++]=o[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 o=this.resolvedProperty;for(let s=0,l=o.length;s!==l;++s)o[s]=t[e++]}_setValue_array_setNeedsUpdate(t,e){let o=this.resolvedProperty;for(let s=0,l=o.length;s!==l;++s)o[s]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){let o=this.resolvedProperty;for(let s=0,l=o.length;s!==l;++s)o[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,o=e.objectName,s=e.propertyName,l=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(o){let m=e.objectIndex;switch(o){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 v=0;v<t.length;v++)if(t[v].name===m){m=v;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[o]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}t=t[o]}if(m!==void 0){if(t[m]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);return}t=t[m]}}let p=t[s];if(p===void 0){let m=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+m+"."+s+" but it wasn't found.",t);return}let h=this.Versioning.None;this.targetObject=t,t.needsUpdate!==void 0?h=this.Versioning.NeedsUpdate:t.matrixWorldNeedsUpdate!==void 0&&(h=this.Versioning.MatrixWorldNeedsUpdate);let g=this.BindingType.Direct;if(l!==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[l]!==void 0&&(l=t.morphTargetDictionary[l])}g=this.BindingType.ArrayElement,this.resolvedProperty=p,this.propertyIndex=l}else p.fromArray!==void 0&&p.toArray!==void 0?(g=this.BindingType.HasFromToArray,this.resolvedProperty=p):Array.isArray(p)?(g=this.BindingType.EntireArray,this.resolvedProperty=p):this.propertyName=s;this.getValue=this.GetterByBindingType[g],this.setValue=this.SetterByBindingTypeAndVersioning[g][h]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};Or.Composite=Iv;Or.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Or.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Or.prototype.GetterByBindingType=[Or.prototype._getValue_direct,Or.prototype._getValue_array,Or.prototype._getValue_arrayElement,Or.prototype._getValue_toArray];Or.prototype.SetterByBindingTypeAndVersioning=[[Or.prototype._setValue_direct,Or.prototype._setValue_direct_setNeedsUpdate,Or.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Or.prototype._setValue_array,Or.prototype._setValue_array_setNeedsUpdate,Or.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Or.prototype._setValue_arrayElement,Or.prototype._setValue_arrayElement_setNeedsUpdate,Or.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Or.prototype._setValue_fromArray,Or.prototype._setValue_fromArray_setNeedsUpdate,Or.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var Ytt=new Float32Array(1);typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Rv}}));typeof window!="undefined"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Rv);var zi=63710088e-1,Jtt={centimeters:zi*100,centimetres:zi*100,degrees:zi/111325,feet:zi*3.28084,inches:zi*39.37,kilometers:zi/1e3,kilometres:zi/1e3,meters:zi,metres:zi,miles:zi/1609.344,millimeters:zi*1e3,millimetres:zi*1e3,nauticalmiles:zi/1852,radians:1,yards:zi*1.0936},Ktt={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/zi,yards:1.0936133};function bo(n,t,e){e===void 0&&(e={});var o={type:"Feature"};return(e.id===0||e.id)&&(o.id=e.id),e.bbox&&(o.bbox=e.bbox),o.properties=t||{},o.geometry=n,o}function Pr(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(!Ra(n[0])||!Ra(n[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:n};return bo(o,t,e)}function Dr(n,t,e){e===void 0&&(e={});for(var o=0,s=n;o<s.length;o++){var l=s[o];if(l.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var p=0;p<l[l.length-1].length;p++)if(l[l.length-1][p]!==l[0][p])throw new Error("First and last Position are not equivalent.")}var h={type:"Polygon",coordinates:n};return bo(h,t,e)}function Gi(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 o={type:"LineString",coordinates:n};return bo(o,t,e)}function Uv(n,t,e){e===void 0&&(e={});var o={type:"MultiPoint",coordinates:n};return bo(o,t,e)}function Ra(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}function Ei(n,t,e){if(n!==null)for(var o,s,l,p,h,g,m,v=0,x=0,E,M=n.type,A=M==="FeatureCollection",I=M==="Feature",S=A?n.features.length:1,w=0;w<S;w++){m=A?n.features[w].geometry:I?n.geometry:n,E=m?m.type==="GeometryCollection":!1,h=E?m.geometries.length:1;for(var R=0;R<h;R++){var C=0,F=0;if(p=E?m.geometries[R]:m,p!==null){g=p.coordinates;var V=p.type;switch(v=e&&(V==="Polygon"||V==="MultiPolygon")?1:0,V){case null:break;case"Point":if(t(g,x,w,C,F)===!1)return!1;x++,C++;break;case"LineString":case"MultiPoint":for(o=0;o<g.length;o++){if(t(g[o],x,w,C,F)===!1)return!1;x++,V==="MultiPoint"&&C++}V==="LineString"&&C++;break;case"Polygon":case"MultiLineString":for(o=0;o<g.length;o++){for(s=0;s<g[o].length-v;s++){if(t(g[o][s],x,w,C,F)===!1)return!1;x++}V==="MultiLineString"&&C++,V==="Polygon"&&F++}V==="Polygon"&&C++;break;case"MultiPolygon":for(o=0;o<g.length;o++){for(F=0,s=0;s<g[o].length;s++){for(l=0;l<g[o][s].length-v;l++){if(t(g[o][s][l],x,w,C,F)===!1)return!1;x++}F++}C++}break;case"GeometryCollection":for(o=0;o<p.geometries.length;o++)if(Ei(p.geometries[o],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function TC(n,t,e,o){var s=e;return Ei(n,function(l,p,h,g,m){p===0&&e===void 0?s=l:s=t(s,l,p,h,g,m)},o),s}function el(n,t){var e,o,s,l,p,h,g,m,v,x,E=0,M=n.type==="FeatureCollection",A=n.type==="Feature",I=M?n.features.length:1;for(e=0;e<I;e++){for(h=M?n.features[e].geometry:A?n.geometry:n,m=M?n.features[e].properties:A?n.properties:{},v=M?n.features[e].bbox:A?n.bbox:void 0,x=M?n.features[e].id:A?n.id:void 0,g=h?h.type==="GeometryCollection":!1,p=g?h.geometries.length:1,s=0;s<p;s++){if(l=g?h.geometries[s]:h,l===null){if(t(null,E,m,v,x)===!1)return!1;continue}switch(l.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(l,E,m,v,x)===!1)return!1;break}case"GeometryCollection":{for(o=0;o<l.geometries.length;o++)if(t(l.geometries[o],E,m,v,x)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}E++}}function ys(n,t){el(n,function(e,o,s,l,p){var h=e===null?null:e.type;switch(h){case null:case"Point":case"LineString":case"Polygon":return t(bo(e,s,{bbox:l,id:p}),o,0)===!1?!1:void 0}var g;switch(h){case"MultiPoint":g="Point";break;case"MultiLineString":g="LineString";break;case"MultiPolygon":g="Polygon";break}for(var m=0;m<e.coordinates.length;m++){var v=e.coordinates[m],x={type:g,coordinates:v};if(t(bo(x,s),o,m)===!1)return!1}})}function Bv(n){var t=[1/0,1/0,-1/0,-1/0];return Ei(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}Bv.default=Bv;var Ao=Bv;function Qi(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 zv(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 to(n){return n.type==="Feature"?n.geometry:n}var CX=sn(Xd(),1);var BX=sn(WC(),1);function ki(n,t,e){if(e===void 0&&(e={}),!n)throw new Error("point is required");if(!t)throw new Error("polygon is required");var o=Qi(n),s=to(t),l=s.type,p=t.bbox,h=s.coordinates;if(p&&zX(o,p)===!1)return!1;l==="Polygon"&&(h=[h]);for(var g=!1,m=0;m<h.length&&!g;m++)if(XC(o,h[m][0],e.ignoreBoundary)){for(var v=!1,x=1;x<h[m].length&&!v;)XC(o,h[m][x],!e.ignoreBoundary)&&(v=!0),x++;v||(g=!0)}return g}function XC(n,t,e){var o=!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,l=t.length-1;s<t.length;l=s++){var p=t[s][0],h=t[s][1],g=t[l][0],m=t[l][1],v=n[1]*(p-g)+h*(g-n[0])+m*(n[0]-p)===0&&(p-n[0])*(g-n[0])<=0&&(h-n[1])*(m-n[1])<=0;if(v)return!e;var x=h>n[1]!=m>n[1]&&n[0]<(g-p)*(n[1]-h)/(m-h)+p;x&&(o=!o)}return o}function zX(n,t){return t[0]<=n[0]&&t[1]<=n[1]&&t[2]>=n[0]&&t[3]>=n[1]}var ZC=new ArrayBuffer(16),Cnt=new Float64Array(ZC),Pnt=new Uint32Array(ZC);var t7=sn(e_(),1);var eit=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 o=this.points[e],s=this.points[e+1];this.centers.push({x:(o.x+s.x)/2,y:(o.y+s.y)/2,z:(o.z+s.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var e=0;e<this.centers.length-1;e++){var l=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,p=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,h=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+l),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+p),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+h)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+l),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+p),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+h)}])}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=[],o=this.pos(0);e.push(0);for(var s=0;s<this.duration;s+=10){var l=this.pos(s),p=Math.sqrt((l.x-o.x)*(l.x-o.x)+(l.y-o.y)*(l.y-o.y)+(l.z-o.z)*(l.z-o.z));p>t&&(e.push(s),o=l)}return e},n.prototype.vector=function(t){var e=this.pos(t+10),o=this.pos(t-10);return{angle:180*Math.atan2(e.y-o.y,e.x-o.x)/3.14,speed:Math.sqrt((o.x-e.x)*(o.x-e.x)+(o.y-e.y)*(o.y-e.y)+(o.z-e.z)*(o.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 o=e/this.duration;if(o>=1)return this.points[this.length-1];var s=Math.floor((this.points.length-1)*o),l=(this.length-1)*o-s;return e7(l,this.points[s],this.controls[s][1],this.controls[s+1][0],this.points[s+1])},n}();function e7(n,t,e,o,s){var l=n7(n),p={x:s.x*l[0]+o.x*l[1]+e.x*l[2]+t.x*l[3],y:s.y*l[0]+o.y*l[1]+e.y*l[2]+t.y*l[3],z:s.z*l[0]+o.z*l[1]+e.z*l[2]+t.z*l[3]};return p}function n7(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 dh(n,t){t===void 0&&(t={});var e=Number(n[0]),o=Number(n[1]),s=Number(n[2]),l=Number(n[3]);if(n.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var p=[e,o],h=[e,l],g=[s,l],m=[s,o];return Dr([[p,m,g,h,p]],t.properties,{bbox:n,id:t.id})}function r7(n){return dh(Ao(n))}var n_=r7;var x7=sn(sP(),1);var Y7=sn(lg(),1);var Z7=sn(Xd(),1);var j7=sn(e_(),1);var MP=Math.PI/180,bP=180/Math.PI,Eh=function(n,t){this.lon=n,this.lat=t,this.x=MP*n,this.y=MP*t};Eh.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)};Eh.prototype.antipode=function(){var n=-1*this.lat,t=this.lon<0?180+this.lon:(180-this.lon)*-1;return new Eh(t,n)};var AP=function(){this.coords=[],this.length=0};AP.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(l){t+=l[0]+" "+l[1]+","},o=0;o<this.geometries.length;o++){if(this.geometries[o].coords.length===0)return"LINESTRING(empty)";var s=this.geometries[o].coords;s.forEach(e),n+=t.substring(0,t.length-1)+")"}return n};var TP=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 Eh(n.x,n.y),this.end=new Eh(t.x,t.y),this.properties=e||{};var o=this.start.x-this.end.x,s=this.start.y-this.end.y,l=Math.pow(Math.sin(s/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(o/2),2);if(this.g=2*Math.asin(Math.sqrt(l)),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)};TP.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),o=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),l=t*Math.sin(this.start.y)+e*Math.sin(this.end.y),p=bP*Math.atan2(l,Math.sqrt(Math.pow(o,2)+Math.pow(s,2))),h=bP*Math.atan2(s,o);return[h,p]};TP.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 o=1/(n-1),s=0;s<n;++s){var l=o*s,p=this.interpolate(l);e.push(p)}for(var h=!1,g=0,m=t&&t.offset?t.offset:10,v=180-m,x=-180+m,E=360-m,M=1;M<e.length;++M){var A=e[M-1][0],I=e[M][0],S=Math.abs(I-A);S>E&&(I>v&&A<x||A>v&&I<x)?h=!0:S>g&&(g=S)}var w=[];if(h&&g<m){var R=[];w.push(R);for(var C=0;C<e.length;++C){var F=parseFloat(e[C][0]);if(C>0&&Math.abs(F-e[C-1][0])>E){var V=parseFloat(e[C-1][0]),X=parseFloat(e[C-1][1]),q=parseFloat(e[C][0]),D=parseFloat(e[C][1]);if(V>-180&&V<x&&q===180&&C+1<e.length&&e[C-1][0]>-180&&e[C-1][0]<x){R.push([-180,e[C][1]]),C++,R.push([e[C][0],e[C][1]]);continue}else if(V>v&&V<180&&q===-180&&C+1<e.length&&e[C-1][0]>v&&e[C-1][0]<180){R.push([180,e[C][1]]),C++,R.push([e[C][0],e[C][1]]);continue}if(V<x&&q>v){var xt=V;V=q,q=xt;var B=X;X=D,D=B}if(V>v&&q<x&&(q+=360),V<=180&&q>=180&&V<q){var j=(180-V)/(q-V),J=j*D+(1-j)*X;R.push([e[C-1][0]>v?180:-180,J]),R=[],R.push([e[C-1][0]>v?-180:180,J]),w.push(R)}else R=[],w.push(R);R.push([F,e[C][1]])}else R.push([e[C][0],e[C][1]])}}else{var Dt=[];w.push(Dt);for(var Q=0;Q<e.length;++Q)Dt.push([e[Q][0],e[Q][1]])}for(var At=new w_(this.properties),Mt=0;Mt<w.length;++Mt){var Lt=new AP;At.geometries.push(Lt);for(var pt=w[Mt],yt=0;yt<pt.length;++yt)Lt.move_to(pt[yt])}return At};var eY=sn(lg(),1);var tZ=sn(lg(),1);var eZ=sn(J_(),1);var iZ=sn(Xd(),1);var ln=[],cn=[],fn=[],hn=[],pn=[],dn=[],gn=[],mn=[],yn=[],vn=[],_n=[],xn=[],En=[],wn=[],Sn=[],Mn=[],bn=[],An=[],Tn=[],Cn=[],Pn=[],In=[],Rn=[],Ln=[];gn[85]=vn[85]=-1;mn[85]=_n[85]=0;yn[85]=xn[85]=1;Tn[85]=In[85]=1;Cn[85]=Rn[85]=0;Pn[85]=Ln[85]=1;ln[85]=hn[85]=0;cn[85]=pn[85]=-1;fn[85]=Sn[85]=0;Mn[85]=En[85]=0;bn[85]=wn[85]=1;dn[85]=An[85]=1;In[1]=In[169]=0;Rn[1]=Rn[169]=-1;Ln[1]=Ln[169]=0;En[1]=En[169]=-1;wn[1]=wn[169]=0;Sn[1]=Sn[169]=0;vn[4]=vn[166]=0;_n[4]=_n[166]=-1;xn[4]=xn[166]=1;Mn[4]=Mn[166]=1;bn[4]=bn[166]=0;An[4]=An[166]=0;gn[16]=gn[154]=0;mn[16]=mn[154]=1;yn[16]=yn[154]=1;hn[16]=hn[154]=1;pn[16]=pn[154]=0;dn[16]=dn[154]=1;Tn[64]=Tn[106]=0;Cn[64]=Cn[106]=1;Pn[64]=Pn[106]=0;ln[64]=ln[106]=-1;cn[64]=cn[106]=0;fn[64]=fn[106]=1;Tn[2]=Tn[168]=0;Cn[2]=Cn[168]=-1;Pn[2]=Pn[168]=1;In[2]=In[168]=0;Rn[2]=Rn[168]=-1;Ln[2]=Ln[168]=0;En[2]=En[168]=-1;wn[2]=wn[168]=0;Sn[2]=Sn[168]=0;Mn[2]=Mn[168]=-1;bn[2]=bn[168]=0;An[2]=An[168]=1;gn[8]=gn[162]=0;mn[8]=mn[162]=-1;yn[8]=yn[162]=0;vn[8]=vn[162]=0;_n[8]=_n[162]=-1;xn[8]=xn[162]=1;En[8]=En[162]=1;wn[8]=wn[162]=0;Sn[8]=Sn[162]=1;Mn[8]=Mn[162]=1;bn[8]=bn[162]=0;An[8]=An[162]=0;gn[32]=gn[138]=0;mn[32]=mn[138]=1;yn[32]=yn[138]=1;vn[32]=vn[138]=0;_n[32]=_n[138]=1;xn[32]=xn[138]=0;ln[32]=ln[138]=1;cn[32]=cn[138]=0;fn[32]=fn[138]=0;hn[32]=hn[138]=1;pn[32]=pn[138]=0;dn[32]=dn[138]=1;In[128]=In[42]=0;Rn[128]=Rn[42]=1;Ln[128]=Ln[42]=1;Tn[128]=Tn[42]=0;Cn[128]=Cn[42]=1;Pn[128]=Pn[42]=0;ln[128]=ln[42]=-1;cn[128]=cn[42]=0;fn[128]=fn[42]=1;hn[128]=hn[42]=-1;pn[128]=pn[42]=0;dn[128]=dn[42]=0;vn[5]=vn[165]=-1;_n[5]=_n[165]=0;xn[5]=xn[165]=0;In[5]=In[165]=1;Rn[5]=Rn[165]=0;Ln[5]=Ln[165]=0;Mn[20]=Mn[150]=0;bn[20]=bn[150]=1;An[20]=An[150]=1;hn[20]=hn[150]=0;pn[20]=pn[150]=-1;dn[20]=dn[150]=1;gn[80]=gn[90]=-1;mn[80]=mn[90]=0;yn[80]=yn[90]=1;Tn[80]=Tn[90]=1;Cn[80]=Cn[90]=0;Pn[80]=Pn[90]=1;En[65]=En[105]=0;wn[65]=wn[105]=1;Sn[65]=Sn[105]=0;ln[65]=ln[105]=0;cn[65]=cn[105]=-1;fn[65]=fn[105]=0;gn[160]=gn[10]=-1;mn[160]=mn[10]=0;yn[160]=yn[10]=1;vn[160]=vn[10]=-1;_n[160]=_n[10]=0;xn[160]=xn[10]=0;In[160]=In[10]=1;Rn[160]=Rn[10]=0;Ln[160]=Ln[10]=0;Tn[160]=Tn[10]=1;Cn[160]=Cn[10]=0;Pn[160]=Pn[10]=1;Mn[130]=Mn[40]=0;bn[130]=bn[40]=1;An[130]=An[40]=1;En[130]=En[40]=0;wn[130]=wn[40]=1;Sn[130]=Sn[40]=0;ln[130]=ln[40]=0;cn[130]=cn[40]=-1;fn[130]=fn[40]=0;hn[130]=hn[40]=0;pn[130]=pn[40]=-1;dn[130]=dn[40]=1;vn[37]=vn[133]=0;_n[37]=_n[133]=1;xn[37]=xn[133]=1;In[37]=In[133]=0;Rn[37]=Rn[133]=1;Ln[37]=Ln[133]=0;ln[37]=ln[133]=-1;cn[37]=cn[133]=0;fn[37]=fn[133]=0;hn[37]=hn[133]=1;pn[37]=pn[133]=0;dn[37]=dn[133]=0;Mn[148]=Mn[22]=-1;bn[148]=bn[22]=0;An[148]=An[22]=0;In[148]=In[22]=0;Rn[148]=Rn[22]=-1;Ln[148]=Ln[22]=1;Tn[148]=Tn[22]=0;Cn[148]=Cn[22]=1;Pn[148]=Pn[22]=1;hn[148]=hn[22]=-1;pn[148]=pn[22]=0;dn[148]=dn[22]=1;gn[82]=gn[88]=0;mn[82]=mn[88]=-1;yn[82]=yn[88]=1;Mn[82]=Mn[88]=1;bn[82]=bn[88]=0;An[82]=An[88]=1;En[82]=En[88]=-1;wn[82]=wn[88]=0;Sn[82]=Sn[88]=1;Tn[82]=Tn[88]=0;Cn[82]=Cn[88]=-1;Pn[82]=Pn[88]=0;gn[73]=gn[97]=0;mn[73]=mn[97]=1;yn[73]=yn[97]=0;vn[73]=vn[97]=0;_n[73]=_n[97]=-1;xn[73]=xn[97]=0;En[73]=En[97]=1;wn[73]=wn[97]=0;Sn[73]=Sn[97]=0;ln[73]=ln[97]=1;cn[73]=cn[97]=0;fn[73]=fn[97]=1;gn[145]=gn[25]=0;mn[145]=mn[25]=-1;yn[145]=yn[25]=0;En[145]=En[25]=1;wn[145]=wn[25]=0;Sn[145]=Sn[25]=1;In[145]=In[25]=0;Rn[145]=Rn[25]=1;Ln[145]=Ln[25]=1;hn[145]=hn[25]=-1;pn[145]=pn[25]=0;dn[145]=dn[25]=0;vn[70]=vn[100]=0;_n[70]=_n[100]=1;xn[70]=xn[100]=0;Mn[70]=Mn[100]=-1;bn[70]=bn[100]=0;An[70]=An[100]=1;Tn[70]=Tn[100]=0;Cn[70]=Cn[100]=-1;Pn[70]=Pn[100]=1;ln[70]=ln[100]=1;cn[70]=cn[100]=0;fn[70]=fn[100]=0;vn[101]=vn[69]=0;_n[101]=_n[69]=1;xn[101]=xn[69]=0;ln[101]=ln[69]=1;cn[101]=cn[69]=0;fn[101]=fn[69]=0;In[149]=In[21]=0;Rn[149]=Rn[21]=1;Ln[149]=Ln[21]=1;hn[149]=hn[21]=-1;pn[149]=pn[21]=0;dn[149]=dn[21]=0;Mn[86]=Mn[84]=-1;bn[86]=bn[84]=0;An[86]=An[84]=1;Tn[86]=Tn[84]=0;Cn[86]=Cn[84]=-1;Pn[86]=Pn[84]=1;gn[89]=gn[81]=0;mn[89]=mn[81]=-1;yn[89]=yn[81]=0;En[89]=En[81]=1;wn[89]=wn[81]=0;Sn[89]=Sn[81]=1;gn[96]=gn[74]=0;mn[96]=mn[74]=1;yn[96]=yn[74]=0;vn[96]=vn[74]=-1;_n[96]=_n[74]=0;xn[96]=xn[74]=1;Tn[96]=Tn[74]=1;Cn[96]=Cn[74]=0;Pn[96]=Pn[74]=0;ln[96]=ln[74]=1;cn[96]=cn[74]=0;fn[96]=fn[74]=1;gn[24]=gn[146]=0;mn[24]=mn[146]=-1;yn[24]=yn[146]=1;Mn[24]=Mn[146]=1;bn[24]=bn[146]=0;An[24]=An[146]=1;En[24]=En[146]=0;wn[24]=wn[146]=1;Sn[24]=Sn[146]=1;hn[24]=hn[146]=0;pn[24]=pn[146]=-1;dn[24]=dn[146]=0;vn[6]=vn[164]=-1;_n[6]=_n[164]=0;xn[6]=xn[164]=1;Mn[6]=Mn[164]=-1;bn[6]=bn[164]=0;An[6]=An[164]=0;In[6]=In[164]=0;Rn[6]=Rn[164]=-1;Ln[6]=Ln[164]=1;Tn[6]=Tn[164]=1;Cn[6]=Cn[164]=0;Pn[6]=Pn[164]=0;En[129]=En[41]=0;wn[129]=wn[41]=1;Sn[129]=Sn[41]=1;In[129]=In[41]=0;Rn[129]=Rn[41]=1;Ln[129]=Ln[41]=0;ln[129]=ln[41]=-1;cn[129]=cn[41]=0;fn[129]=fn[41]=0;hn[129]=hn[41]=0;pn[129]=pn[41]=-1;dn[129]=dn[41]=0;Mn[66]=Mn[104]=0;bn[66]=bn[104]=1;An[66]=An[104]=0;En[66]=En[104]=-1;wn[66]=wn[104]=0;Sn[66]=Sn[104]=1;Tn[66]=Tn[104]=0;Cn[66]=Cn[104]=-1;Pn[66]=Pn[104]=0;ln[66]=ln[104]=0;cn[66]=cn[104]=-1;fn[66]=fn[104]=1;gn[144]=gn[26]=-1;mn[144]=mn[26]=0;yn[144]=yn[26]=0;In[144]=In[26]=1;Rn[144]=Rn[26]=0;Ln[144]=Ln[26]=1;Tn[144]=Tn[26]=0;Cn[144]=Cn[26]=1;Pn[144]=Pn[26]=1;hn[144]=hn[26]=-1;pn[144]=pn[26]=0;dn[144]=dn[26]=1;vn[36]=vn[134]=0;_n[36]=_n[134]=1;xn[36]=xn[134]=1;Mn[36]=Mn[134]=0;bn[36]=bn[134]=1;An[36]=An[134]=0;ln[36]=ln[134]=0;cn[36]=cn[134]=-1;fn[36]=fn[134]=1;hn[36]=hn[134]=1;pn[36]=pn[134]=0;dn[36]=dn[134]=0;gn[9]=gn[161]=-1;mn[9]=mn[161]=0;yn[9]=yn[161]=0;vn[9]=vn[161]=0;_n[9]=_n[161]=-1;xn[9]=xn[161]=0;En[9]=En[161]=1;wn[9]=wn[161]=0;Sn[9]=Sn[161]=0;In[9]=In[161]=1;Rn[9]=Rn[161]=0;Ln[9]=Ln[161]=1;gn[136]=0;mn[136]=1;yn[136]=1;vn[136]=0;_n[136]=1;xn[136]=0;Mn[136]=-1;bn[136]=0;An[136]=1;En[136]=-1;wn[136]=0;Sn[136]=0;In[136]=0;Rn[136]=-1;Ln[136]=0;Tn[136]=0;Cn[136]=-1;Pn[136]=1;ln[136]=1;cn[136]=0;fn[136]=0;hn[136]=1;pn[136]=0;dn[136]=1;gn[34]=0;mn[34]=-1;yn[34]=0;vn[34]=0;_n[34]=-1;xn[34]=1;Mn[34]=1;bn[34]=0;An[34]=0;En[34]=1;wn[34]=0;Sn[34]=1;In[34]=0;Rn[34]=1;Ln[34]=1;Tn[34]=0;Cn[34]=1;Pn[34]=0;ln[34]=-1;cn[34]=0;fn[34]=1;hn[34]=-1;pn[34]=0;dn[34]=0;gn[35]=0;mn[35]=1;yn[35]=1;vn[35]=0;_n[35]=-1;xn[35]=1;Mn[35]=1;bn[35]=0;An[35]=0;En[35]=-1;wn[35]=0;Sn[35]=0;In[35]=0;Rn[35]=-1;Ln[35]=0;Tn[35]=0;Cn[35]=1;Pn[35]=0;ln[35]=-1;cn[35]=0;fn[35]=1;hn[35]=1;pn[35]=0;dn[35]=1;gn[153]=0;mn[153]=1;yn[153]=1;En[153]=-1;wn[153]=0;Sn[153]=0;In[153]=0;Rn[153]=-1;Ln[153]=0;hn[153]=1;pn[153]=0;dn[153]=1;vn[102]=0;_n[102]=-1;xn[102]=1;Mn[102]=1;bn[102]=0;An[102]=0;Tn[102]=0;Cn[102]=1;Pn[102]=0;ln[102]=-1;cn[102]=0;fn[102]=1;gn[155]=0;mn[155]=-1;yn[155]=0;En[155]=1;wn[155]=0;Sn[155]=1;In[155]=0;Rn[155]=1;Ln[155]=1;hn[155]=-1;pn[155]=0;dn[155]=0;vn[103]=0;_n[103]=1;xn[103]=0;Mn[103]=-1;bn[103]=0;An[103]=1;Tn[103]=0;Cn[103]=-1;Pn[103]=1;ln[103]=1;cn[103]=0;fn[103]=0;gn[152]=0;mn[152]=1;yn[152]=1;Mn[152]=-1;bn[152]=0;An[152]=1;En[152]=-1;wn[152]=0;Sn[152]=0;In[152]=0;Rn[152]=-1;Ln[152]=0;Tn[152]=0;Cn[152]=-1;Pn[152]=1;hn[152]=1;pn[152]=0;dn[152]=1;gn[156]=0;mn[156]=-1;yn[156]=1;Mn[156]=1;bn[156]=0;An[156]=1;En[156]=-1;wn[156]=0;Sn[156]=0;In[156]=0;Rn[156]=-1;Ln[156]=0;Tn[156]=0;Cn[156]=1;Pn[156]=1;hn[156]=-1;pn[156]=0;dn[156]=1;gn[137]=0;mn[137]=1;yn[137]=1;vn[137]=0;_n[137]=1;xn[137]=0;En[137]=-1;wn[137]=0;Sn[137]=0;In[137]=0;Rn[137]=-1;Ln[137]=0;ln[137]=1;cn[137]=0;fn[137]=0;hn[137]=1;pn[137]=0;dn[137]=1;gn[139]=0;mn[139]=1;yn[139]=1;vn[139]=0;_n[139]=-1;xn[139]=0;En[139]=1;wn[139]=0;Sn[139]=0;In[139]=0;Rn[139]=1;Ln[139]=0;ln[139]=-1;cn[139]=0;fn[139]=0;hn[139]=1;pn[139]=0;dn[139]=1;gn[98]=0;mn[98]=-1;yn[98]=0;vn[98]=0;_n[98]=-1;xn[98]=1;Mn[98]=1;bn[98]=0;An[98]=0;En[98]=1;wn[98]=0;Sn[98]=1;Tn[98]=0;Cn[98]=1;Pn[98]=0;ln[98]=-1;cn[98]=0;fn[98]=1;gn[99]=0;mn[99]=1;yn[99]=0;vn[99]=0;_n[99]=-1;xn[99]=1;Mn[99]=1;bn[99]=0;An[99]=0;En[99]=-1;wn[99]=0;Sn[99]=1;Tn[99]=0;Cn[99]=-1;Pn[99]=0;ln[99]=1;cn[99]=0;fn[99]=1;vn[38]=0;_n[38]=-1;xn[38]=1;Mn[38]=1;bn[38]=0;An[38]=0;In[38]=0;Rn[38]=1;Ln[38]=1;Tn[38]=0;Cn[38]=1;Pn[38]=0;ln[38]=-1;cn[38]=0;fn[38]=1;hn[38]=-1;pn[38]=0;dn[38]=0;vn[39]=0;_n[39]=1;xn[39]=1;Mn[39]=-1;bn[39]=0;An[39]=0;In[39]=0;Rn[39]=-1;Ln[39]=1;Tn[39]=0;Cn[39]=1;Pn[39]=0;ln[39]=-1;cn[39]=0;fn[39]=1;hn[39]=1;pn[39]=0;dn[39]=0;var K_=function(n){return[[n.bottomleft,0],[0,0],[0,n.leftbottom]]},j_=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0]]},Q_=function(n){return[[n.topright,1],[1,1],[1,n.righttop]]},t1=function(n){return[[0,n.lefttop],[0,1],[n.topleft,1]]},e1=function(n){return[[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop]]},n1=function(n){return[[n.bottomright,0],[n.bottomleft,0],[1,n.righttop],[1,n.rightbottom]]},r1=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.topleft,1],[n.topright,1]]},i1=function(n){return[[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},oZ=function(n){return[[0,0],[0,n.leftbottom],[1,n.rightbottom],[1,0]]},sZ=function(n){return[[1,0],[n.bottomright,0],[n.topright,1],[1,1]]},aZ=function(n){return[[1,1],[1,n.righttop],[0,n.lefttop],[0,1]]},uZ=function(n){return[[n.bottomleft,0],[0,0],[0,1],[n.topleft,1]]},lZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[0,n.leftbottom],[0,n.lefttop]]},cZ=function(n){return[[n.topleft,1],[n.topright,1],[n.bottomright,0],[n.bottomleft,0]]},fZ=function(){return[[0,0],[0,1],[1,1],[1,0]]},hZ=function(n){return[[1,n.rightbottom],[1,0],[0,0],[0,1],[n.topleft,1]]},pZ=function(n){return[[n.topright,1],[1,1],[1,0],[0,0],[0,n.leftbottom]]},dZ=function(n){return[[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[1,1]]},gZ=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,1]]},mZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[0,n.lefttop],[0,1],[n.topleft,1]]},yZ=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[n.topright,1]]},vZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop]]},_Z=function(n){return[[n.topright,1],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topleft,1]]},xZ=function(n){return[[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1],[n.topleft,1]]},EZ=function(n){return[[1,1],[1,n.righttop],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},wZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[n.topleft,1],[n.topright,1]]},SZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,n.leftbottom]]},MZ=function(n){return[[1,n.rightbottom],[1,0],[0,0],[0,n.leftbottom],[n.topleft,1],[n.topright,1]]},bZ=function(n){return[[1,1],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},AZ=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1]]},TZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,1],[n.topleft,1]]},CZ=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topright,1]]},PZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[n.topleft,1]]},IZ=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]]},RZ=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topright,1]]},LZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[n.topleft,1]]},NZ=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},OZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topleft,1],[n.topright,1]]},DZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1],[n.topleft,1]]},FZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},Bn=[],zn=[],Gn=[],kn=[],qn=[],Hn=[],Vn=[],Wn=[];kn[1]=qn[1]=18;kn[169]=qn[169]=18;Gn[4]=zn[4]=12;Gn[166]=zn[166]=12;Bn[16]=Wn[16]=4;Bn[154]=Wn[154]=4;Hn[64]=Vn[64]=22;Hn[106]=Vn[106]=22;Gn[2]=Hn[2]=17;kn[2]=qn[2]=18;Gn[168]=Hn[168]=17;kn[168]=qn[168]=18;Bn[8]=kn[8]=9;zn[8]=Gn[8]=12;Bn[162]=kn[162]=9;zn[162]=Gn[162]=12;Bn[32]=Wn[32]=4;zn[32]=Vn[32]=1;Bn[138]=Wn[138]=4;zn[138]=Vn[138]=1;qn[128]=Wn[128]=21;Hn[128]=Vn[128]=22;qn[42]=Wn[42]=21;Hn[42]=Vn[42]=22;zn[5]=qn[5]=14;zn[165]=qn[165]=14;Gn[20]=Wn[20]=6;Gn[150]=Wn[150]=6;Bn[80]=Hn[80]=11;Bn[90]=Hn[90]=11;kn[65]=Vn[65]=3;kn[105]=Vn[105]=3;Bn[160]=Hn[160]=11;zn[160]=qn[160]=14;Bn[10]=Hn[10]=11;zn[10]=qn[10]=14;Gn[130]=Wn[130]=6;kn[130]=Vn[130]=3;Gn[40]=Wn[40]=6;kn[40]=Vn[40]=3;zn[101]=Vn[101]=1;zn[69]=Vn[69]=1;qn[149]=Wn[149]=21;qn[21]=Wn[21]=21;Gn[86]=Hn[86]=17;Gn[84]=Hn[84]=17;Bn[89]=kn[89]=9;Bn[81]=kn[81]=9;Bn[96]=Vn[96]=0;zn[96]=Hn[96]=15;Bn[74]=Vn[74]=0;zn[74]=Hn[74]=15;Bn[24]=Gn[24]=8;kn[24]=Wn[24]=7;Bn[146]=Gn[146]=8;kn[146]=Wn[146]=7;zn[6]=Hn[6]=15;Gn[6]=qn[6]=16;zn[164]=Hn[164]=15;Gn[164]=qn[164]=16;kn[129]=Wn[129]=7;qn[129]=Vn[129]=20;kn[41]=Wn[41]=7;qn[41]=Vn[41]=20;Gn[66]=Vn[66]=2;kn[66]=Hn[66]=19;Gn[104]=Vn[104]=2;kn[104]=Hn[104]=19;Bn[144]=qn[144]=10;Hn[144]=Wn[144]=23;Bn[26]=qn[26]=10;Hn[26]=Wn[26]=23;zn[36]=Wn[36]=5;Gn[36]=Vn[36]=2;zn[134]=Wn[134]=5;Gn[134]=Vn[134]=2;Bn[9]=qn[9]=10;zn[9]=kn[9]=13;Bn[161]=qn[161]=10;zn[161]=kn[161]=13;zn[37]=Wn[37]=5;qn[37]=Vn[37]=20;zn[133]=Wn[133]=5;qn[133]=Vn[133]=20;Gn[148]=qn[148]=16;Hn[148]=Wn[148]=23;Gn[22]=qn[22]=16;Hn[22]=Wn[22]=23;Bn[82]=Gn[82]=8;kn[82]=Hn[82]=19;Bn[88]=Gn[88]=8;kn[88]=Hn[88]=19;Bn[73]=Vn[73]=0;zn[73]=kn[73]=13;Bn[97]=Vn[97]=0;zn[97]=kn[97]=13;Bn[145]=kn[145]=9;qn[145]=Wn[145]=21;Bn[25]=kn[25]=9;qn[25]=Wn[25]=21;zn[70]=Vn[70]=1;Gn[70]=Hn[70]=17;zn[100]=Vn[100]=1;Gn[100]=Hn[100]=17;Bn[34]=kn[34]=9;zn[34]=Gn[34]=12;qn[34]=Wn[34]=21;Hn[34]=Vn[34]=22;Bn[136]=Wn[136]=4;zn[136]=Vn[136]=1;Gn[136]=Hn[136]=17;kn[136]=qn[136]=18;Bn[35]=Wn[35]=4;zn[35]=Gn[35]=12;kn[35]=qn[35]=18;Hn[35]=Vn[35]=22;Bn[153]=Wn[153]=4;kn[153]=qn[153]=18;zn[102]=Gn[102]=12;Hn[102]=Vn[102]=22;Bn[155]=kn[155]=9;qn[155]=Wn[155]=23;zn[103]=Vn[103]=1;Gn[103]=Hn[103]=17;Bn[152]=Wn[152]=4;Gn[152]=Hn[152]=17;kn[152]=qn[152]=18;Bn[156]=Gn[156]=8;kn[156]=qn[156]=18;Hn[156]=Wn[156]=23;Bn[137]=Wn[137]=4;zn[137]=Vn[137]=1;kn[137]=qn[137]=18;Bn[139]=Wn[139]=4;zn[139]=kn[139]=13;qn[139]=Vn[139]=20;Bn[98]=kn[98]=9;zn[98]=Gn[98]=12;Hn[98]=Vn[98]=22;Bn[99]=Vn[99]=0;zn[99]=Gn[99]=12;kn[99]=Hn[99]=19;zn[38]=Gn[38]=12;qn[38]=Wn[38]=21;Hn[38]=Vn[38]=22;zn[39]=Wn[39]=5;Gn[39]=qn[39]=16;Hn[39]=Vn[39]=22;var re=[];re[1]=re[169]=K_;re[4]=re[166]=j_;re[16]=re[154]=Q_;re[64]=re[106]=t1;re[168]=re[2]=e1;re[162]=re[8]=n1;re[138]=re[32]=r1;re[42]=re[128]=i1;re[5]=re[165]=oZ;re[20]=re[150]=sZ;re[80]=re[90]=aZ;re[65]=re[105]=uZ;re[160]=re[10]=lZ;re[130]=re[40]=cZ;re[85]=fZ;re[101]=re[69]=hZ;re[149]=re[21]=pZ;re[86]=re[84]=dZ;re[89]=re[81]=gZ;re[96]=re[74]=mZ;re[24]=re[146]=yZ;re[6]=re[164]=vZ;re[129]=re[41]=_Z;re[66]=re[104]=xZ;re[144]=re[26]=EZ;re[36]=re[134]=wZ;re[9]=re[161]=SZ;re[37]=re[133]=MZ;re[148]=re[22]=bZ;re[82]=re[88]=AZ;re[73]=re[97]=TZ;re[145]=re[25]=CZ;re[70]=re[100]=PZ;re[34]=function(n){return[i1(n),n1(n)]};re[35]=IZ;re[136]=function(n){return[r1(n),e1(n)]};re[153]=function(n){return[Q_(n),K_(n)]};re[102]=function(n){return[j_(n),t1(n)]};re[155]=RZ;re[103]=LZ;re[152]=function(n){return[Q_(n),e1(n)]};re[156]=NZ;re[137]=function(n){return[r1(n),K_(n)]};re[139]=OZ;re[98]=function(n){return[n1(n),t1(n)]};re[99]=DZ;re[38]=function(n){return[j_(n),i1(n)]};re[39]=FZ;function BZ(n){return(n>0)-(n<0)||+n}function ff(n,t,e){var o=t[0]-n[0],s=t[1]-n[1],l=e[0]-t[0],p=e[1]-t[1];return BZ(o*p-l*s)}function dL(n,t){var e=n.geometry.coordinates[0].map(function(p){return p[0]}),o=n.geometry.coordinates[0].map(function(p){return p[1]}),s=t.geometry.coordinates[0].map(function(p){return p[0]}),l=t.geometry.coordinates[0].map(function(p){return p[1]});return Math.max.apply(null,e)===Math.max.apply(null,s)&&Math.max.apply(null,o)===Math.max.apply(null,l)&&Math.min.apply(null,e)===Math.min.apply(null,s)&&Math.min.apply(null,o)===Math.min.apply(null,l)}function o1(n,t){return t.geometry.coordinates[0].every(function(e){return ki(Pr(e),n)})}function gL(n,t){return n[0]===t[0]&&n[1]===t[1]}var zZ=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,o){var s=e.to,l=o.to;if(s.coordinates[0]-t.coordinates[0]>=0&&l.coordinates[0]-t.coordinates[0]<0)return 1;if(s.coordinates[0]-t.coordinates[0]<0&&l.coordinates[0]-t.coordinates[0]>=0)return-1;if(s.coordinates[0]-t.coordinates[0]===0&&l.coordinates[0]-t.coordinates[0]===0)return s.coordinates[1]-t.coordinates[1]>=0||l.coordinates[1]-t.coordinates[1]>=0?s.coordinates[1]-l.coordinates[1]:l.coordinates[1]-s.coordinates[1];var p=ff(t.coordinates,s.coordinates,l.coordinates);if(p<0)return 1;if(p>0)return-1;var h=Math.pow(s.coordinates[0]-t.coordinates[0],2)+Math.pow(s.coordinates[1]-t.coordinates[1],2),g=Math.pow(l.coordinates[0]-t.coordinates[0],2)+Math.pow(l.coordinates[1]-t.coordinates[1],2);return h-g}),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}(),s1=zZ;var GZ=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 Gi([this.from.coordinates,this.to.coordinates])},n.prototype.compareTo=function(t){return ff(t.from.coordinates,t.to.coordinates,this.to.coordinates)},n}(),mL=GZ;var kZ=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(p,h,g){return h.from.coordinates[1]>t.edges[p].from.coordinates[1]&&(p=g),p},0),o=(e===0?this.length:e)-1,s=(e+1)%this.length,l=ff(this.edges[o].from.coordinates,this.edges[e].from.coordinates,this.edges[s].from.coordinates);return l===0?this.edges[o].from.coordinates[0]>this.edges[s].from.coordinates[0]:l>0},n.prototype.toMultiPoint=function(){return Uv(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=Dr([t])},n.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=n_(this.toPolygon())},n.findEdgeRingContaining=function(t,e){var o=t.getEnvelope(),s,l;return e.forEach(function(p){var h=p.getEnvelope();if(l&&(s=l.getEnvelope()),!dL(h,o)&&o1(h,o)){for(var g=t.map(function(A){return A.from.coordinates}),m=void 0,v=function(A){p.some(function(I){return gL(A,I.from.coordinates)})||(m=A)},x=0,E=g;x<E.length;x++){var M=E[x];v(M)}m&&p.inside(Pr(m))&&(!l||o1(s,h))&&(l=p)}}),l},n.prototype.inside=function(t){return ki(t,this.toPolygon())},n}(),a1=kZ;function qZ(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 lct=function(){function n(){this.edges=[],this.nodes={}}return n.fromGeoJson=function(t){qZ(t);var e=new n;return ys(t,function(o){zv(o,"LineString","Graph::fromGeoJson"),TC(o,function(s,l){if(s){var p=e.getNode(s),h=e.getNode(l);e.addEdge(p,h)}return l})}),e},n.prototype.getNode=function(t){var e=s1.buildId(t),o=this.nodes[e];return o||(o=this.nodes[e]=new s1(t)),o},n.prototype.addEdge=function(t,e){var o=new mL(t,e),s=o.getSymetric();this.edges.push(o),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 o=t.getOuterEdges().map(function(s){return s.to});this.removeNode(t),o.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(o){return e._computeNextCWEdges(e.nodes[o])}):t.getOuterEdges().forEach(function(o,s){t.getOuterEdge((s===0?t.getOuterEdges().length:s)-1).symetric.next=o})},n.prototype._computeNextCCWEdges=function(t,e){for(var o=t.getOuterEdges(),s,l,p=o.length-1;p>=0;--p){var h=o[p],g=h.symetric,m=void 0,v=void 0;h.label===e&&(m=h),g.label===e&&(v=g),!(!m||!v)&&(v&&(l=v),m&&(l&&(l.next=m,l=void 0),s||(s=m)))}l&&(l.next=s)},n.prototype._findLabeledEdgeRings=function(){var t=[],e=0;return this.edges.forEach(function(o){if(!(o.label>=0)){t.push(o);var s=o;do s.label=e,s=s.next;while(!o.isEqual(s));e++}}),t},n.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach(function(o){o.label=void 0}),this._findLabeledEdgeRings().forEach(function(o){t._findIntersectionNodes(o).forEach(function(s){t._computeNextCCWEdges(s,o.label)})});var e=[];return this.edges.forEach(function(o){o.ring||e.push(t._findEdgeRing(o))}),e},n.prototype._findIntersectionNodes=function(t){var e=[],o=t,s=function(){var l=0;o.from.getOuterEdges().forEach(function(p){p.label===t.label&&++l}),l>1&&e.push(o.from),o=o.next};do s();while(!t.isEqual(o));return e},n.prototype._findEdgeRing=function(t){var e=t,o=new a1;do o.push(e),e.ring=o,e=e.next;while(!t.isEqual(e));return o},n.prototype.removeNode=function(t){var e=this;t.getOuterEdges().forEach(function(o){return e.removeEdge(o)}),t.innerEdges.forEach(function(o){return e.removeEdge(o)}),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 XZ=sn(u1(),1);var YZ=sn(u1(),1);var ZZ=sn(bL(),1);var nJ=sn(DL(),1);function UL(n){for(var t=n,e=[];t.parent;)e.unshift(t),t=t.parent;return e}function iJ(){return new BL(function(n){return n.f})}var h1={search:function(n,t,e,o){n.cleanDirty(),o=o||{};var s=o.heuristic||h1.heuristics.manhattan,l=o.closest||!1,p=iJ(),h=t;for(t.h=s(t,e),p.push(t);p.size()>0;){var g=p.pop();if(g===e)return UL(g);g.closed=!0;for(var m=n.neighbors(g),v=0,x=m.length;v<x;++v){var E=m[v];if(!(E.closed||E.isWall())){var M=g.g+E.getCost(g),A=E.visited;(!A||M<E.g)&&(E.visited=!0,E.parent=g,E.h=E.h||s(E,e),E.g=M,E.f=E.g+E.h,n.markDirty(E),l&&(E.h<h.h||E.h===h.h&&E.g<h.g)&&(h=E),A?p.rescoreElement(E):p.push(E))}}}return l?UL(h):[]},heuristics:{manhattan:function(n,t){var e=Math.abs(t.x-n.x),o=Math.abs(t.y-n.y);return e+o},diagonal:function(n,t){var e=1,o=Math.sqrt(2),s=Math.abs(t.x-n.x),l=Math.abs(t.y-n.y);return e*(s+l)+(o-2*e)*Math.min(s,l)}},cleanNode:function(n){n.f=0,n.g=0,n.h=0,n.visited=!1,n.closed=!1,n.parent=null}};function Ih(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 o=0,s=n[e];o<s.length;o++){var l=new Fg(e,o,s[o]);this.grid[e][o]=l,this.nodes.push(l)}}this.init()}Ih.prototype.init=function(){this.dirtyNodes=[];for(var n=0;n<this.nodes.length;n++)h1.cleanNode(this.nodes[n])};Ih.prototype.cleanDirty=function(){for(var n=0;n<this.dirtyNodes.length;n++)h1.cleanNode(this.dirtyNodes[n]);this.dirtyNodes=[]};Ih.prototype.markDirty=function(n){this.dirtyNodes.push(n)};Ih.prototype.neighbors=function(n){var t=[],e=n.x,o=n.y,s=this.grid;return s[e-1]&&s[e-1][o]&&t.push(s[e-1][o]),s[e+1]&&s[e+1][o]&&t.push(s[e+1][o]),s[e]&&s[e][o-1]&&t.push(s[e][o-1]),s[e]&&s[e][o+1]&&t.push(s[e][o+1]),this.diagonal&&(s[e-1]&&s[e-1][o-1]&&t.push(s[e-1][o-1]),s[e+1]&&s[e+1][o-1]&&t.push(s[e+1][o-1]),s[e-1]&&s[e-1][o+1]&&t.push(s[e-1][o+1]),s[e+1]&&s[e+1][o+1]&&t.push(s[e+1][o+1])),t};Ih.prototype.toString=function(){for(var n=[],t=this.grid,e,o,s,l,p=0,h=t.length;p<h;p++){for(e=[],o=t[p],s=0,l=o.length;s<l;s++)e.push(o[s].weight);n.push(e.join(" "))}return n.join(\`
|
|
23466
23466
|
\`)};function Fg(n,t,e){this.x=n,this.y=t,this.weight=e}Fg.prototype.toString=function(){return"["+this.x+" "+this.y+"]"};Fg.prototype.getCost=function(n){return n&&n.x!==this.x&&n.y!==this.y?this.weight*1.41421:this.weight};Fg.prototype.isWall=function(){return this.weight===0};function BL(n){this.content=[],this.scoreFunction=n}BL.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,o=this.content[e];if(this.scoreFunction(t)<this.scoreFunction(o))this.content[e]=t,this.content[n]=o,n=e;else break}},bubbleUp:function(n){for(var t=this.content.length,e=this.content[n],o=this.scoreFunction(e);;){var s=n+1<<1,l=s-1,p=null,h;if(l<t){var g=this.content[l];h=this.scoreFunction(g),h<o&&(p=l)}if(s<t){var m=this.content[s],v=this.scoreFunction(m);v<(p===null?o:h)&&(p=s)}if(p!==null)this.content[n]=this.content[p],this.content[p]=e,n=p;else break}}};function p1(){this._=null}function pf(n){n.U=n.C=n.L=n.R=n.P=n.N=null}p1.prototype={constructor:p1,insert:function(n,t){var e,o,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=zL(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;)o=e.U,e===o.L?(s=o.R,s&&s.C?(e.C=s.C=!1,o.C=!0,n=o):(n===e.R&&(Rh(this,e),n=e,e=n.U),e.C=!1,o.C=!0,Lh(this,o))):(s=o.L,s&&s.C?(e.C=s.C=!1,o.C=!0,n=o):(n===e.L&&(Lh(this,e),n=e,e=n.U),e.C=!1,o.C=!0,Rh(this,o))),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,o=n.L,s=n.R,l,p;if(o?s?l=zL(s):l=o:l=s,t?t.L===n?t.L=l:t.R=l:this._=l,o&&s?(p=l.C,l.C=n.C,l.L=o,o.U=l,l!==s?(t=l.U,l.U=n.U,n=l.R,t.L=n,l.R=s,s.U=l):(l.U=t,t=l,n=l.R)):(p=n.C,n=l),n&&(n.U=t),!p){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,Rh(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,Lh(this,e),e=t.R),e.C=t.C,t.C=e.R.C=!1,Rh(this,t),n=this._;break}}else if(e=t.L,e.C&&(e.C=!1,t.C=!0,Lh(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,Rh(this,e),e=t.L),e.C=t.C,t.C=e.L.C=!1,Lh(this,t),n=this._;break}e.C=!0,n=t,t=t.U}while(!n.C);n&&(n.C=!1)}}};function Rh(n,t){var e=t,o=t.R,s=e.U;s?s.L===e?s.L=o:s.R=o:n._=o,o.U=s,e.U=o,e.R=o.L,e.R&&(e.R.U=e),o.L=e}function Lh(n,t){var e=t,o=t.L,s=e.U;s?s.L===e?s.L=o:s.R=o:n._=o,o.U=s,e.U=o,e.L=o.R,e.L&&(e.L.U=e),o.R=e}function zL(n){for(;n.L;)n=n.L;return n}var d1=p1;function df(n,t,e,o){var s=[null,null],l=Hi.push(s)-1;return s.left=n,s.right=t,e&&Nh(s,n,t,e),o&&Nh(s,t,n,o),To[n.index].halfedges.push(l),To[t.index].halfedges.push(l),s}function gf(n,t,e){var o=[t,e];return o.left=n,o}function Nh(n,t,e,o){!n[0]&&!n[1]?(n[0]=o,n.left=t,n.right=e):n.left===e?n[1]=o:n[0]=o}function oJ(n,t,e,o,s){var l=n[0],p=n[1],h=l[0],g=l[1],m=p[0],v=p[1],x=0,E=1,M=m-h,A=v-g,I;if(I=t-h,!(!M&&I>0)){if(I/=M,M<0){if(I<x)return;I<E&&(E=I)}else if(M>0){if(I>E)return;I>x&&(x=I)}if(I=o-h,!(!M&&I<0)){if(I/=M,M<0){if(I>E)return;I>x&&(x=I)}else if(M>0){if(I<x)return;I<E&&(E=I)}if(I=e-g,!(!A&&I>0)){if(I/=A,A<0){if(I<x)return;I<E&&(E=I)}else if(A>0){if(I>E)return;I>x&&(x=I)}if(I=s-g,!(!A&&I<0)){if(I/=A,A<0){if(I>E)return;I>x&&(x=I)}else if(A>0){if(I<x)return;I<E&&(E=I)}return!(x>0)&&!(E<1)||(x>0&&(n[0]=[h+x*M,g+x*A]),E<1&&(n[1]=[h+E*M,g+E*A])),!0}}}}}function sJ(n,t,e,o,s){var l=n[1];if(l)return!0;var p=n[0],h=n.left,g=n.right,m=h[0],v=h[1],x=g[0],E=g[1],M=(m+x)/2,A=(v+E)/2,I,S;if(E===v){if(M<t||M>=o)return;if(m>x){if(!p)p=[M,e];else if(p[1]>=s)return;l=[M,s]}else{if(!p)p=[M,s];else if(p[1]<e)return;l=[M,e]}}else if(I=(m-x)/(E-v),S=A-I*M,I<-1||I>1)if(m>x){if(!p)p=[(e-S)/I,e];else if(p[1]>=s)return;l=[(s-S)/I,s]}else{if(!p)p=[(s-S)/I,s];else if(p[1]<e)return;l=[(e-S)/I,e]}else if(v<E){if(!p)p=[t,I*t+S];else if(p[0]>=o)return;l=[o,I*o+S]}else{if(!p)p=[o,I*o+S];else if(p[0]<t)return;l=[t,I*t+S]}return n[0]=p,n[1]=l,!0}function GL(n,t,e,o){for(var s=Hi.length,l;s--;)(!sJ(l=Hi[s],n,t,e,o)||!oJ(l,n,t,e,o)||!(Math.abs(l[0][0]-l[1][0])>Er||Math.abs(l[0][1]-l[1][1])>Er))&&delete Hi[s]}function kL(n){return To[n.index]={site:n,halfedges:[]}}function aJ(n,t){var e=n.site,o=t.left,s=t.right;return e===s&&(s=o,o=e),s?Math.atan2(s[1]-o[1],s[0]-o[0]):(e===o?(o=t[1],s=t[0]):(o=t[0],s=t[1]),Math.atan2(o[0]-s[0],s[1]-o[1]))}function g1(n,t){return t[+(t.left!==n.site)]}function uJ(n,t){return t[+(t.left===n.site)]}function qL(){for(var n=0,t=To.length,e,o,s,l;n<t;++n)if((e=To[n])&&(l=(o=e.halfedges).length)){var p=new Array(l),h=new Array(l);for(s=0;s<l;++s)p[s]=s,h[s]=aJ(e,Hi[o[s]]);for(p.sort(function(g,m){return h[m]-h[g]}),s=0;s<l;++s)h[s]=o[p[s]];for(s=0;s<l;++s)o[s]=h[s]}}function HL(n,t,e,o){var s=To.length,l,p,h,g,m,v,x,E,M,A,I,S,w=!0;for(l=0;l<s;++l)if(p=To[l]){for(h=p.site,m=p.halfedges,g=m.length;g--;)Hi[m[g]]||m.splice(g,1);for(g=0,v=m.length;g<v;)A=uJ(p,Hi[m[g]]),I=A[0],S=A[1],x=g1(p,Hi[m[++g%v]]),E=x[0],M=x[1],(Math.abs(I-E)>Er||Math.abs(S-M)>Er)&&(m.splice(g,0,Hi.push(gf(h,A,Math.abs(I-n)<Er&&o-S>Er?[n,Math.abs(E-n)<Er?M:o]:Math.abs(S-o)<Er&&e-I>Er?[Math.abs(M-o)<Er?E:e,o]:Math.abs(I-e)<Er&&S-t>Er?[e,Math.abs(E-e)<Er?M:t]:Math.abs(S-t)<Er&&I-n>Er?[Math.abs(M-t)<Er?E:n,t]:null))-1),++v);v&&(w=!1)}if(w){var R,C,F,V=1/0;for(l=0,w=null;l<s;++l)(p=To[l])&&(h=p.site,R=h[0]-n,C=h[1]-t,F=R*R+C*C,F<V&&(V=F,w=p));if(w){var X=[n,t],q=[n,o],D=[e,o],xt=[e,t];w.halfedges.push(Hi.push(gf(h=w.site,X,q))-1,Hi.push(gf(h,q,D))-1,Hi.push(gf(h,D,xt))-1,Hi.push(gf(h,xt,X))-1)}}for(l=0;l<s;++l)(p=To[l])&&(p.halfedges.length||delete To[l])}var VL=[],Ug;function lJ(){pf(this),this.x=this.y=this.arc=this.site=this.cy=null}function Wl(n){var t=n.P,e=n.N;if(!(!t||!e)){var o=t.site,s=n.site,l=e.site;if(o!==l){var p=s[0],h=s[1],g=o[0]-p,m=o[1]-h,v=l[0]-p,x=l[1]-h,E=2*(g*x-m*v);if(!(E>=-WL)){var M=g*g+m*m,A=v*v+x*x,I=(x*M-m*A)/E,S=(g*A-v*M)/E,w=VL.pop()||new lJ;w.arc=n,w.site=s,w.x=I+p,w.y=(w.cy=S+h)+Math.sqrt(I*I+S*S),n.circle=w;for(var R=null,C=mf._;C;)if(w.y<C.y||w.y===C.y&&w.x<=C.x)if(C.L)C=C.L;else{R=C.P;break}else if(C.R)C=C.R;else{R=C;break}mf.insert(R,w),R||(Ug=w)}}}}function Xl(n){var t=n.circle;t&&(t.P||(Ug=t.N),mf.remove(t),VL.push(t),pf(t),n.circle=null)}var YL=[];function cJ(){pf(this),this.edge=this.site=this.circle=null}function XL(n){var t=YL.pop()||new cJ;return t.site=n,t}function m1(n){Xl(n),Yl.remove(n),YL.push(n),pf(n)}function $L(n){var t=n.circle,e=t.x,o=t.cy,s=[e,o],l=n.P,p=n.N,h=[n];m1(n);for(var g=l;g.circle&&Math.abs(e-g.circle.x)<Er&&Math.abs(o-g.circle.cy)<Er;)l=g.P,h.unshift(g),m1(g),g=l;h.unshift(g),Xl(g);for(var m=p;m.circle&&Math.abs(e-m.circle.x)<Er&&Math.abs(o-m.circle.cy)<Er;)p=m.N,h.push(m),m1(m),m=p;h.push(m),Xl(m);var v=h.length,x;for(x=1;x<v;++x)m=h[x],g=h[x-1],Nh(m.edge,g.site,m.site,s);g=h[0],m=h[v-1],m.edge=df(g.site,m.site,null,s),Wl(g),Wl(m)}function ZL(n){for(var t=n[0],e=n[1],o,s,l,p,h=Yl._;h;)if(l=JL(h,e)-t,l>Er)h=h.L;else if(p=t-fJ(h,e),p>Er){if(!h.R){o=h;break}h=h.R}else{l>-Er?(o=h.P,s=h):p>-Er?(o=h,s=h.N):o=s=h;break}kL(n);var g=XL(n);if(Yl.insert(o,g),!(!o&&!s)){if(o===s){Xl(o),s=XL(o.site),Yl.insert(g,s),g.edge=s.edge=df(o.site,g.site),Wl(o),Wl(s);return}if(!s){g.edge=df(o.site,g.site);return}Xl(o),Xl(s);var m=o.site,v=m[0],x=m[1],E=n[0]-v,M=n[1]-x,A=s.site,I=A[0]-v,S=A[1]-x,w=2*(E*S-M*I),R=E*E+M*M,C=I*I+S*S,F=[(S*R-M*C)/w+v,(E*C-I*R)/w+x];Nh(s.edge,m,A,F),g.edge=df(m,n,null,F),s.edge=df(n,A,null,F),Wl(o),Wl(s)}}function JL(n,t){var e=n.site,o=e[0],s=e[1],l=s-t;if(!l)return o;var p=n.P;if(!p)return-1/0;e=p.site;var h=e[0],g=e[1],m=g-t;if(!m)return h;var v=h-o,x=1/l-1/m,E=v/m;return x?(-E+Math.sqrt(E*E-2*x*(v*v/(-2*m)-g+m/2+s-l/2)))/x+o:(o+h)/2}function fJ(n,t){var e=n.N;if(e)return JL(e,t);var o=n.site;return o[1]===t?o[0]:1/0}var Er=1e-6,WL=1e-12,Yl,To,mf,Hi;function hJ(n,t,e){return(n[0]-e[0])*(t[1]-n[1])-(n[0]-t[0])*(e[1]-n[1])}function pJ(n,t){return t[1]-n[1]||t[0]-n[0]}function Bg(n,t){var e=n.sort(pJ).pop(),o,s,l;for(Hi=[],To=new Array(n.length),Yl=new d1,mf=new d1;;)if(l=Ug,e&&(!l||e[1]<l.y||e[1]===l.y&&e[0]<l.x))(e[0]!==o||e[1]!==s)&&(ZL(e),o=e[0],s=e[1]),e=n.pop();else if(l)$L(l.arc);else break;if(qL(),t){var p=+t[0][0],h=+t[0][1],g=+t[1][0],m=+t[1][1];GL(p,h,g,m),HL(p,h,g,m)}this.edges=Hi,this.cells=To,Yl=mf=Hi=To=null}Bg.prototype={constructor:Bg,polygons:function(){var n=this.edges;return this.cells.map(function(t){var e=t.halfedges.map(function(o){return g1(t,n[o])});return e.data=t.site.data,e})},triangles:function(){var n=[],t=this.edges;return this.cells.forEach(function(e,o){if(h=(l=e.halfedges).length)for(var s=e.site,l,p=-1,h,g,m=t[l[h-1]],v=m.left===s?m.right:m.left;++p<h;)g=v,m=t[l[p]],v=m.left===s?m.right:m.left,g&&v&&o<g.index&&o<v.index&&hJ(s,g,v)<0&&n.push([s.data,g.data,v.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 o=this,s,l=o._found||0,p=o.cells.length,h;!(h=o.cells[l]);)if(++l>=p)return null;var g=n-h.site[0],m=t-h.site[1],v=g*g+m*m;do h=o.cells[s=l],l=null,h.halfedges.forEach(function(x){var E=o.edges[x],M=E.left;if(!((M===h.site||!M)&&!(M=E.right))){var A=n-M[0],I=t-M[1],S=A*A+I*I;S<v&&(v=S,l=M.index)}});while(l!==null);return o._found=s,e==null||v<=e*e?h.site:null}};var EJ=sn(yf(),1);var R1=sn(tN(),1);function Zo(){return new kg}function kg(){this.reset()}kg.prototype={constructor:kg,reset:function(){this.s=this.t=0},add:function(n){eN(Gg,n,this.t),eN(this,Gg.s,this.s),this.s?this.t+=Gg.t:this.s=Gg.t},valueOf:function(){return this.s}};var Gg=new kg;function eN(n,t,e){var o=n.s=t+e,s=o-t,l=o-s;n.t=t-l+(e-s)}var er=1e-6;var gr=Math.PI,Mi=gr/2,qg=gr/4,Da=gr*2,$l=180/gr,Jo=gr/180,Zr=Math.abs,aa=Math.atan,Ko=Math.atan2,Xn=Math.cos;var Hg=Math.exp;var Oh=Math.log;var an=Math.sin;var no=Math.sqrt,Dh=Math.tan;function _1(n){return n>1?0:n<-1?gr:Math.acos(n)}function Co(n){return n>1?Mi:n<-1?-Mi:Math.asin(n)}function ua(){}var wJ=Zo(),rpt=Zo();function Zl(n){var t=n[0],e=n[1],o=Xn(e);return[o*Xn(t),o*an(t),an(e)]}function Fh(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 Uh(n){var t=no(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}var ppt=Zo();function rN(n,t){return[n>gr?n-Da:n<-gr?n+Da:n,t]}rN.invert=rN;function x1(){var n=[],t;return{point:function(e,o){t.push([e,o])},lineStart:function(){n.push(t=[])},lineEnd:ua,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function E1(n,t){return Zr(n[0]-t[0])<er&&Zr(n[1]-t[1])<er}function Vg(n,t,e,o){this.x=n,this.z=t,this.o=e,this.e=o,this.v=!1,this.n=this.p=null}function w1(n,t,e,o,s){var l=[],p=[],h,g;if(n.forEach(function(A){if(!((I=A.length-1)<=0)){var I,S=A[0],w=A[I],R;if(E1(S,w)){for(s.lineStart(),h=0;h<I;++h)s.point((S=A[h])[0],S[1]);s.lineEnd();return}l.push(R=new Vg(S,A,null,!0)),p.push(R.o=new Vg(S,null,R,!1)),l.push(R=new Vg(w,A,null,!1)),p.push(R.o=new Vg(w,null,R,!0))}}),!!l.length){for(p.sort(t),iN(l),iN(p),h=0,g=p.length;h<g;++h)p[h].e=e=!e;for(var m=l[0],v,x;;){for(var E=m,M=!0;E.v;)if((E=E.n)===m)return;v=E.z,s.lineStart();do{if(E.v=E.o.v=!0,E.e){if(M)for(h=0,g=v.length;h<g;++h)s.point((x=v[h])[0],x[1]);else o(E.x,E.n.x,1,s);E=E.n}else{if(M)for(v=E.p.z,h=v.length-1;h>=0;--h)s.point((x=v[h])[0],x[1]);else o(E.x,E.p.x,-1,s);E=E.p}E=E.o,v=E.z,M=!M}while(!E.v);s.lineEnd()}}}function iN(n){if(t=n.length){for(var t,e=0,o=n[0],s;++e<t;)o.n=s=n[e],s.p=o,o=s;o.n=s=n[0],s.p=o}}function sl(n,t){return n<t?-1:n>t?1:n>=t?0:NaN}function S1(n){return n.length===1&&(n=bJ(n)),{left:function(t,e,o,s){for(o==null&&(o=0),s==null&&(s=t.length);o<s;){var l=o+s>>>1;n(t[l],e)<0?o=l+1:s=l}return o},right:function(t,e,o,s){for(o==null&&(o=0),s==null&&(s=t.length);o<s;){var l=o+s>>>1;n(t[l],e)>0?s=l:o=l+1}return o}}}function bJ(n){return function(t,e){return sl(n(t),e)}}var oN=S1(sl),AJ=oN.right,TJ=oN.left;var sN=Array.prototype,PJ=sN.slice,IJ=sN.map;var odt=Math.sqrt(50),sdt=Math.sqrt(10),adt=Math.sqrt(2);function Xg(n){for(var t=n.length,e,o=-1,s=0,l,p;++o<t;)s+=n[o].length;for(l=new Array(s);--t>=0;)for(p=n[t],e=p.length;--e>=0;)l[--s]=p[e];return l}var BJ=1e9,Vgt=-BJ;var M1=Zo();function b1(n,t){var e=t[0],o=t[1],s=[an(e),-Xn(e),0],l=0,p=0;M1.reset();for(var h=0,g=n.length;h<g;++h)if(v=(m=n[h]).length)for(var m,v,x=m[v-1],E=x[0],M=x[1]/2+qg,A=an(M),I=Xn(M),S=0;S<v;++S,E=R,A=F,I=V,x=w){var w=m[S],R=w[0],C=w[1]/2+qg,F=an(C),V=Xn(C),X=R-E,q=X>=0?1:-1,D=q*X,xt=D>gr,B=A*F;if(M1.add(Ko(B*q*an(D),I*V+B*Xn(D))),l+=xt?X+q*Da:X,xt^E>=e^R>=e){var j=Fh(Zl(x),Zl(w));Uh(j);var J=Fh(s,j);Uh(J);var Dt=(xt^X>=0?-1:1)*Co(J[2]);(o>Dt||o===Dt&&(j[0]||j[1]))&&(p+=xt^X>=0?1:-1)}}return(l<-er||l<er&&M1<-er)^p&1}var tmt=Zo();var _mt=Zo(),xmt=Zo();var kJ=1/0;var Smt=-kJ;function A1(n){this._context=n}A1.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,Da);break}}},result:ua};var Nmt=Zo();function T1(){this._string=[]}T1.prototype={_radius:4.5,_circle:lN(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=lN(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 lN(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function C1(n,t,e,o){return function(s,l){var p=t(l),h=s.invert(o[0],o[1]),g=x1(),m=t(g),v=!1,x,E,M,A={point:I,lineStart:w,lineEnd:R,polygonStart:function(){A.point=C,A.lineStart=F,A.lineEnd=V,E=[],x=[]},polygonEnd:function(){A.point=I,A.lineStart=w,A.lineEnd=R,E=Xg(E);var X=b1(x,h);E.length?(v||(l.polygonStart(),v=!0),w1(E,VJ,X,e,l)):X&&(v||(l.polygonStart(),v=!0),l.lineStart(),e(null,null,1,l),l.lineEnd()),v&&(l.polygonEnd(),v=!1),E=x=null},sphere:function(){l.polygonStart(),l.lineStart(),e(null,null,1,l),l.lineEnd(),l.polygonEnd()}};function I(X,q){var D=s(X,q);n(X=D[0],q=D[1])&&l.point(X,q)}function S(X,q){var D=s(X,q);p.point(D[0],D[1])}function w(){A.point=S,p.lineStart()}function R(){A.point=I,p.lineEnd()}function C(X,q){M.push([X,q]);var D=s(X,q);m.point(D[0],D[1])}function F(){m.lineStart(),M=[]}function V(){C(M[0][0],M[0][1]),m.lineEnd();var X=m.clean(),q=g.result(),D,xt=q.length,B,j,J;if(M.pop(),x.push(M),M=null,!!xt){if(X&1){if(j=q[0],(B=j.length-1)>0){for(v||(l.polygonStart(),v=!0),l.lineStart(),D=0;D<B;++D)l.point((J=j[D])[0],J[1]);l.lineEnd()}return}xt>1&&X&2&&q.push(q.pop().concat(q.shift())),E.push(q.filter(HJ))}}return A}}function HJ(n){return n.length>1}function VJ(n,t){return((n=n.x)[0]<0?n[1]-Mi-er:Mi-n[1])-((t=t.x)[0]<0?t[1]-Mi-er:Mi-t[1])}var WJ=C1(function(){return!0},XJ,$J,[-gr,-Mi]);function XJ(n){var t=NaN,e=NaN,o=NaN,s;return{lineStart:function(){n.lineStart(),s=1},point:function(l,p){var h=l>0?gr:-gr,g=Zr(l-t);Zr(g-gr)<er?(n.point(t,e=(e+p)/2>0?Mi:-Mi),n.point(o,e),n.lineEnd(),n.lineStart(),n.point(h,e),n.point(l,e),s=0):o!==h&&g>=gr&&(Zr(t-o)<er&&(t-=o*er),Zr(l-h)<er&&(l-=h*er),e=YJ(t,e,l,p),n.point(o,e),n.lineEnd(),n.lineStart(),n.point(h,e),s=0),n.point(t=l,e=p),o=h},lineEnd:function(){n.lineEnd(),t=e=NaN},clean:function(){return 2-s}}}function YJ(n,t,e,o){var s,l,p=an(n-e);return Zr(p)>er?aa((an(t)*(l=Xn(o))*an(e)-an(o)*(s=Xn(t))*an(n))/(s*l*p)):(t+o)/2}function $J(n,t,e,o){var s;if(n==null)s=e*Mi,o.point(-gr,s),o.point(0,s),o.point(gr,s),o.point(gr,0),o.point(gr,-s),o.point(0,-s),o.point(-gr,-s),o.point(-gr,0),o.point(-gr,s);else if(Zr(n[0]-t[0])>er){var l=n[0]<t[0]?gr:-gr;s=e*l/2,o.point(-l,s),o.point(0,s),o.point(l,s)}else o.point(t[0],t[1])}function Yg(n){return function(t){var e=new P1;for(var o in n)e[o]=n[o];return e.stream=t,e}}function P1(){}P1.prototype={constructor:P1,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 x0t=Xn(30*Jo);var O0t=Yg({point:function(n,t){this.stream.point(n*Jo,t*Jo)}});function $g(n){return function(t,e){var o=Xn(t),s=Xn(e),l=n(o*s);return[l*s*an(t),l*an(e)]}}function Fa(n){return function(t,e){var o=no(t*t+e*e),s=n(o),l=an(s),p=Xn(s);return[Ko(t*l,o*p),Co(o&&e*l/o)]}}var mN=$g(function(n){return no(2/(1+n))});mN.invert=Fa(function(n){return 2*Co(n/2)});var yN=$g(function(n){return(n=_1(n))&&n/an(n)});yN.invert=Fa(function(n){return n});function I1(n,t){return[n,Oh(Dh((Mi+t)/2))]}I1.invert=function(n,t){return[n,2*aa(Hg(t))-Mi]};function Zg(n,t){return[n,t]}Zg.invert=Zg;function vN(n,t){var e=Xn(t),o=Xn(n)*e;return[e*an(n)/o,an(t)/o]}vN.invert=Fa(aa);function _N(n,t){var e=t*t,o=e*e;return[n*(.8707-.131979*e+o*(-.013791+o*(.003971*e-.001529*o))),t*(1.007226+e*(.015085+o*(-.044475+.028874*e-.005916*o)))]}_N.invert=function(n,t){var e=t,o=25,s;do{var l=e*e,p=l*l;e-=s=(e*(1.007226+l*(.015085+p*(-.044475+.028874*l-.005916*p)))-t)/(1.007226+l*(.015085*3+p*(-.044475*7+.028874*9*l-.005916*11*p)))}while(Zr(s)>er&&--o>0);return[n/(.8707+(l=e*e)*(-.131979+l*(-.013791+l*l*l*(.003971-.001529*l)))),e]};function xN(n,t){return[Xn(t)*an(n),an(t)]}xN.invert=Fa(Co);function EN(n,t){var e=Xn(t),o=1+Xn(n)*e;return[e*an(n)/o,an(t)/o]}EN.invert=Fa(function(n){return 2*aa(n)});function wN(n,t){return[Oh(Dh((Mi+t)/2)),-n]}wN.invert=function(n,t){return[-t,2*aa(Hg(n))-Mi]};var tK=sn(yf(),1);var eK=sn(yf(),1);var rK=sn(yf(),1);var iK=sn(yf(),1);function _f(n,t){return Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2)}function MN(n){let t=0;for(let e=0;e<n.length-1;e++)t+=_f(n[e],n[e+1]);return t}var jo=sn(bN(),1);var Nn="___",Jg=class{isFacilityByType(t){return["facility","escalator","straightLadder","staircase","ramp","connectionPoint"].includes(t)}initFacilities(t){this.facilities=t.map(e=>{let o=[];try{o=JSON.parse(e.entry_end_floor)}catch(l){o=[]}let s=[];try{s=JSON.parse(e.entry_start_floor)}catch(l){s=[]}return Lu({},e,{entry_start_floor:s,entry_end_floor:o})})}getParkingSpaceInfo(t,e){let o=""+t+Nn+e;var s;return(s=this.parkingMap.get(o))!=null?s:null}getNodeInfo(t,e){let o=""+t+Nn+e,s=this.nodeMap.get(o);if(!(s!=null&&s.length))return null;let l=this.pointMap.get(s[0]);return l!=null?l:null}initRoute(t,e){this.clear(),this.roadInfo=t,this.initFacilities(e);let o=new Date,s=o.getHours()*60+o.getMinutes();t.length&&(t.forEach(l=>{let p=(l.points||[]).filter(h=>!(0,jo.isNil)(h.passWeight)&&h.passWeight!==1&&!(0,jo.isNil)(h.coverageArea)&&h.coverageArea!==0);(l.points||[]).filter(h=>h.openStatus!==!1).filter(h=>{if(!h.startTime||!h.endTime)return!0;let[g,m]=h.startTime.split(":").map(A=>+A),[v,x]=h.endTime.split(":").map(A=>+A),E=g*60+m,M=v*60+x;return s>=E&&s<=M}).forEach(h=>{h.floor=l.floor;let g=""+l.floor+Nn+h.id,m=""+l.floor+Nn+h.nodeId,v=this.nodeMap.get(m)||[];if(v.push(""+l.floor+Nn+(h.relatedId||h.id)),this.nodeMap.set(""+l.floor+Nn+h.nodeId,v),this.pointMap.set(g,h),this.isFacilityByType(h.type)){let x=this.facilities.find(E=>E.id===+h.targetId);if(x){switch(x.entry_infra_type){case"straightLadder":if(x.entry_end_floor.find(I=>I.floor===l.floor)&&x.entry_start_floor.find(I=>I.floor===l.floor)){let I=this.straightLadderMap.get(h.targetId)||[];I.push(Lu({},h)),this.straightLadderMap.set(h.targetId,I)}break;case"staircase":if(x.entry_end_floor.find(I=>I.floor===l.floor)&&x.entry_start_floor.find(I=>I.floor===l.floor)){let I=this.staircaseMap.get(h.targetId)||[];I.push(Lu({},h)),this.staircaseMap.set(h.targetId,I)}break;case"escalator":let M=this.escalatorMap.get(h.targetId)||[];if(x.entry_start_floor.find(I=>I.floor===l.floor)){let I=M.find(S=>{var w;return((w=S.end)==null?void 0:w.floor)!==l.floor&&!S.start});I?I.start=h:M.push({start:h})}if(x.entry_end_floor.find(I=>I.floor===l.floor)){let I=M.find(S=>{var w;return((w=S.start)==null?void 0:w.floor)!==l.floor&&!S.end});I?I.end=h:M.push({end:h})}this.escalatorMap.set(h.targetId,M);break;case"ramp":let A=this.rampMap.get(h.targetId)||[];if(x.entry_start_floor.find(I=>I.floor===l.floor)){let I=A.find(S=>{var w;return((w=S.end)==null?void 0:w.floor)!==l.floor&&!S.start});I?I.start=h:A.push({start:h})}if(x.entry_end_floor.find(I=>I.floor===l.floor)){let I=A.find(S=>{var w;return((w=S.start)==null?void 0:w.floor)!==l.floor&&!S.end});I?I.end=h:A.push({end:h})}this.rampMap.set(h.targetId,A);break;case"connectionPoint":if(x.entry_end_floor.find(I=>I.floor===l.floor)&&x.entry_start_floor.find(I=>I.floor===l.floor)){let I=this.connectionPointMap.get(h.targetId)||[];I.push(Lu({},h)),this.connectionPointMap.set(h.targetId,I)}break}let E=this.facilityMap.get(h.targetId)||[];E.push(Lu({},h)),this.facilityMap.set(h.targetId,E)}}h.type==="parkingSpace"&&h.name.split(/[,\uFF0C]/).forEach(E=>{this.parkingMap.set(""+l.floor+Nn+E,h)})}),(l.lines||[]).filter(h=>h.to!==h.from).forEach(h=>{let g=""+l.floor+Nn+h.from,m=""+l.floor+Nn+h.to,v=this.pointMap.get(g),x=this.pointMap.get(m);if(!v||!x)return;let E=v.cds,M=x.cds,A=_f(E,M);if(p.forEach(I=>{(I.id===h.from||I.id===h.to)&&(A=A/I.passWeight);let S=_f(E,I.cds)<=I.coverageArea,w=_f(M,I.cds)<=I.coverageArea;(S||w)&&(A=A/I.passWeight)}),!v.permission&&!x.permission){switch(this.addLineItem(g,m,A),this.addLineItem(m,g,A),h.direction){case"double":this.addLineItem(g,m,A,this.forwardLineMap),this.addLineItem(m,g,A,this.forwardLineMap);break;case"single":this.addLineItem(g,m,A,this.forwardLineMap);break;case"back":this.addLineItem(m,g,A,this.forwardLineMap);break}(v.type==="parkingSpace"||x.type==="parkingSpace")&&h.direction==="noDir"&&(this.addLineItem(g,m,A,this.forwardLineMap),this.addLineItem(m,g,A,this.forwardLineMap))}else v.permission&&(this.setPermissionLine(g,m,v.permission,A,""),this.setPermissionLine(m,g,v.permission,A,"")),x.permission&&x.permission!==v.permission&&(this.setPermissionLine(g,m,x.permission,A,""),this.setPermissionLine(m,g,x.permission,A,""))})}),this.addPermissionFacility(),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute(),this.initForwardRoute())}getPermissionMap(t){return this["permission_"+t]||(this["permission_"+t]=new Set),this["permission_"+t]}setPermissionLine(t,e,o,s,l){this.getPermissionMap(o).add({fromKey:t,toKey:e,distance:s,type:l})}addPermissionFacility(){this.straightLadderMap.forEach((t,e)=>{if(t.length<2){this.straightLadderMap.delete(e);return}for(let o=0;o<t.length;o++){let s=""+t[o].floor+Nn+t[o].id,l=this.pointMap.get(s);if(l){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Nn+t[p].id,g=this.pointMap.get(h);if(!g)continue;l.permission&&this.setPermissionLine(s,h,l.permission,1,"straightLadder"),g.permission&&g.permission!==l.permission&&this.setPermissionLine(s,h,g.permission,1,"straightLadder")}}}}),this.staircaseMap.forEach((t,e)=>{if(t.length<2){this.staircaseMap.delete(e);return}for(let o=0;o<t.length;o++){let s=""+t[o].floor+Nn+t[o].id,l=this.pointMap.get(s);if(l){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Nn+t[p].id,g=this.pointMap.get(h);if(!g)continue;l.permission&&this.setPermissionLine(s,h,l.permission,1,"staircase"),g.permission&&g.permission!==l.permission&&this.setPermissionLine(s,h,g.permission,1,"staircase")}}}}),this.escalatorMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Nn+o.start.id,l=""+o.end.floor+Nn+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(l);p&&h&&(p.permission&&this.setPermissionLine(s,l,p.permission,1,"escalator"),h.permission&&h.permission!==p.permission&&this.setPermissionLine(s,l,h.permission,1,"escalator"))}})}),this.rampMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Nn+o.start.id,l=""+o.end.floor+Nn+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(l);p&&h&&(p.permission&&this.setPermissionLine(s,l,p.permission,10,"ramp"),h.permission&&h.permission!==p.permission&&this.setPermissionLine(s,l,h.permission,10,"ramp"))}})}),this.connectionPointMap.forEach((t,e)=>{if(t.length<2){this.connectionPointMap.delete(e);return}for(let o=0;o<t.length;o++){let s=""+t[o].floor+Nn+t[o].id,l=this.pointMap.get(s);if(l){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Nn+t[p].id,g=this.pointMap.get(h);if(!g)continue;l.permission&&this.setPermissionLine(s,h,l.permission,1,"connectionPoint"),g.permission&&g.permission!==l.permission&&this.setPermissionLine(s,h,g.permission,1,"connectionPoint")}}}})}addPermissionLineToMap(t,e,o,s){this.getPermissionMap(t).forEach(p=>{e.includes(p.type)&&(p.type===""?this.addLineItem(p.fromKey,p.toKey,p.distance,o):this.addLineItem(p.fromKey,p.toKey,s.get(p.type),o))})}addLineItem(t,e,o,s){s===void 0&&(s=this.lineMap);let l=s.get(t)||new Map;l.set(e,o),s.set(t,l)}addFacilityToLineMap(t,e,o,s){[...this.straightLadderMap,...this.staircaseMap].forEach(l=>{let[p,h]=l;if(!(h.length<2))for(let g=0;g<h.length;g++){let m=""+h[g].floor+Nn+h[g].id,v=this.pointMap.get(m);if(!(!v||v.permission)){for(let x=0;x<h.length;x++)if(g!==x){let E=""+h[x].floor+Nn+h[x].id,M=this.pointMap.get(E);if(!M||M.permission)continue;if(h[g].type==="straightLadder"){let A=e;this.addLineItem(m,E,A,s)}else{let A=o;this.addLineItem(m,E,A,s)}}}}}),this.escalatorMap.forEach((l,p)=>{l.forEach(h=>{if(h.start&&h.end){let g=""+h.start.floor+Nn+h.start.id,m=""+h.end.floor+Nn+h.end.id,v=this.pointMap.get(g),x=this.pointMap.get(m);if(v&&x&&!v.permission&&!x.permission){let E=t;this.addLineItem(g,m,E,s)}}})}),this.connectionPointMap.forEach((l,p)=>{if(!(l.length<2))for(let h=0;h<l.length;h++){let g=""+l[h].floor+Nn+l[h].id,m=this.pointMap.get(g);if(!(!m||m.permission)){for(let v=0;v<l.length;v++)if(h!==v){let x=""+l[v].floor+Nn+l[v].id,E=this.pointMap.get(x);if(!E||E.permission)continue;this.addLineItem(g,x,100,s)}}}})}initBaseRoute(){let t=new Map((0,jo.cloneDeep)([...this.lineMap]));this.addFacilityToLineMap(100,100*this.lift_priority,3e4,t),this.baseRoute=new ro.default(t)}initEscalatorRoute(){let t=new Map((0,jo.cloneDeep)([...this.lineMap])),e=1e4;this.addFacilityToLineMap(100,this.lift_priority*e,3e4*e,t),this.escalatorRoute=new ro.default(t)}initStraightLadderRoute(){let t=new Map((0,jo.cloneDeep)([...this.lineMap])),e=1e4;this.addFacilityToLineMap(3*e,300,3e4*e,t),this.straightLadderRoute=new ro.default(t)}initForwardRoute(){this.rampMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Nn+o.start.id,l=""+o.end.floor+Nn+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(l);p&&h&&!p.permission&&!h.permission&&this.addLineItem(s,l,10,this.forwardLineMap)}})}),this.connectionPointMap.forEach((t,e)=>{if(!(t.length<2))for(let o=0;o<t.length;o++){let s=""+t[o].floor+Nn+t[o].id,l=this.pointMap.get(s);if(!(!l||l.permission)){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Nn+t[p].id,g=this.pointMap.get(h);if(!g||g.permission)continue;this.addLineItem(s,h,100,this.forwardLineMap)}}}}),this.forwardRoute=new ro.default(this.forwardLineMap)}checkStart(t){return!(!t.floor||!t.nodeId&&(!t.coord||t.coord.length<2))}checkEnd(t){return t.facility||t.parkingSpace&&t.floor?!0:this.checkStart(t)}transformStart(t,e,o){o===void 0&&(o={});var s;if(t.nodeId){let l=this.nodeMap.get(""+t.floor+Nn+t.nodeId);if(l!=null&&l.length)return l.map(p=>{let[h,g]=p.split(Nn);return{floor:h,id:g}})}if((s=t.coord)!=null&&s.length){let l=this.roadInfo.find(m=>m.floor===t.floor);if(!l)return null;let p=l.points.filter(m=>m.isStarted),h=l.points.filter(m=>{let v=""+m.floor+Nn+m.id;if(e==="forward"){if(!this.forwardLineMap.has(v)||o.adsorptionIntersection&&p.length&&!m.isStarted)return!1}else if(!this.lineMap.has(v))return!1;return!0});if(!h.length)return null;let g=h.reduce((m,v)=>{if(v.relatedId)return m;let x=_f(t.coord,v.cds);return x<m.min&&(m.min=x,m.point=v),m},{min:1/0,point:h[0]});return[{floor:l.floor,id:g.point.id}]}return null}transformEnd(t,e){if(t.floor){if(t.parkingSpace){let s=this.parkingMap.get(""+t.floor+Nn+t.parkingSpace);if(s)return[{floor:t.floor,id:s.id}]}let o=this.transformStart(t,e);if(o)return o}if(t.facility){let s=this.facilities.filter(l=>+l.type_id==+t.facility).map(l=>l.id).map(l=>this.facilityMap.get(""+l)).flat(2);if(s!=null&&s.length)return{floor:t.floor,facility:t.facility}}return null}getPath(t,e,o,s,l,p){if(o===void 0&&(o=""),p===void 0&&(p={}),!this.checkStart(t))return"start-error";if(!this.checkEnd(e))return"end-error";let h=this.transformStart(t,o,p);if(!h)return"no-start";let g=this.transformEnd(e,o);if(!g)return"no-end";let m=[];if(Array.isArray(g))for(let E=0;E<h.length;E++){let M=h[E];for(let A=0;A<g.length;A++){let I=g[A];if(M.floor===I.floor&&M.id===I.id)return"near"}}else{m=this.facilities.filter(M=>+M.type_id==+e.facility).map(M=>M.id).map(M=>this.facilityMap.get(""+M)).flat(2).filter(M=>M).filter(M=>g.floor?M.floor===g.floor:!0);for(let M=0;M<h.length;M++){let A=h[M];for(let I=0;I<m.length;I++){let S=m[I];if(A.floor===S.floor&&A.id===S.id)return"near"}}}let v;switch(o){case"escalator":v=this.getEscalatorPath.bind(this);break;case"straightLadder":v=this.getStraightLadderPath.bind(this);break;case"forward":v=this.getForwardPath.bind(this);break;default:v=this.getBasePath.bind(this);break}let x=null;return h.forEach(E=>{if(Array.isArray(g))g.forEach(M=>{let A=v(E,M,s,l);A&&A&&(!x||A[0].consume<x[0].consume)&&(x=A)});else{if(!m.length)return null;let M=m.map(A=>v(E,{floor:A.floor,id:A.id},s,l)).filter(A=>!!A);x=M.reduce((A,I)=>{let S=I[0].consume;return S<A.distance&&(A.distance=S,A.path=I),A},{distance:1/0,path:M[0]}).path}}),x}getRoutePath(t,e,o){let s=""+t.floor+Nn+t.id,l=this.pointMap.get(s),p=""+e.floor+Nn+e.id,h=this.pointMap.get(p);if(!l||!h)return null;let g=""+l.floor+Nn+(l.relatedId||l.id),m=""+h.floor+Nn+(h.relatedId||h.id),v=o.path(g,m);if(!v)return null;let x=[],E=v.reduce((M,A,I,S)=>{if(I===0)return 0;let w=S[I-1],R=o.graph.get(w).get(A);return M+R},0);return v.map(M=>{let A=this.pointMap.get(M);if(A){var I;let{floor:S}=A,w=A.type;if(this.isFacilityByType(A.type)){let R=this.facilities.find(C=>C.id===+A.targetId);R&&(w=R.entry_infra_type)}if(((I=x[x.length-1])==null?void 0:I.floor)===S){let R=x[x.length-1];R.points.push(A.cds),R.pointInfos.push(A),R.endType=w,R.destId=A.nodeId,R.distance=MN(R.points)}else x.push({floor:S,points:[A.cds],pointInfos:[A],endType:w,destId:A.nodeId,distance:0,consume:E})}}),x}getBasePath(t,e,o){if(!o)return this.getRoutePath(t,e,this.baseRoute);let s=(0,jo.cloneDeep)(this.baseRoute.graph),l=h=>{this.addPermissionLineToMap(h,["","escalator","staircase","straightLadder","connectionPoint"],s,new Map([["escalator",100],["connectionPoint",100],["straightLadder",100*this.lift_priority],["staircase",3e4]]))};Array.isArray(o)?o.forEach(h=>{l(h)}):l(o);let p=new ro.default(s);return this.getRoutePath(t,e,p)}getEscalatorPath(t,e,o){if(!o)return this.getRoutePath(t,e,this.escalatorRoute);let s=(0,jo.cloneDeep)(this.escalatorRoute.graph),l=1e4,p=g=>{this.addPermissionLineToMap(g,["","escalator","staircase","straightLadder","connectionPoint"],s,new Map([["escalator",100],["connectionPoint",100],["straightLadder",this.lift_priority*l],["staircase",3e4*l]]))};Array.isArray(o)?o.forEach(g=>{p(g)}):p(o);let h=new ro.default(s);return this.getRoutePath(t,e,h)}getStraightLadderPath(t,e,o){if(!o)return this.getRoutePath(t,e,this.straightLadderRoute);let s=(0,jo.cloneDeep)(this.straightLadderRoute.graph),l=1e4,p=g=>{this.addPermissionLineToMap(g,["","escalator","staircase","straightLadder","connectionPoint"],s,new Map([["escalator",3*l],["connectionPoint",100],["straightLadder",300],["staircase",3e4*l]]))};Array.isArray(o)?o.forEach(g=>{p(g)}):p(o);let h=new ro.default(s);return this.getRoutePath(t,e,h)}getForwardPath(t,e,o,s){let l=new Map,p=M=>{let A=this.forwardRoute.graph.get(g);M.forEach(I=>{let S=A.get(I);(0,jo.isNil)(S)||(l.set(I,S),A.delete(I))})},h=()=>{let M=this.forwardRoute.graph.get(g);l.forEach((A,I)=>{M.set(I,A)})},g=""+t.floor+Nn+t.id;if(!(0,jo.isNil)(s)){let M=this.forwardLineMap.get(g),A=this.pointMap.get(g);if(A&&(M!=null&&M.size)&&M.size>1){let I=new Ye(A.cds[0],A.cds[1]),S=new Map;M.forEach((R,C)=>{let F=this.pointMap.get(C);if(F){let V=new Ye(F.cds[0],F.cds[1]),q=360-(new Ye().subVectors(V,I).angle()/Math.PI*180-90+360)%360;S.set(C,q)}});let w=Array.from(S).filter(R=>{let[C,F]=R;return Math.abs(F-s)<=60}).map(R=>{let[C]=R;return C});if(w.length)w.forEach(R=>S.delete(R)),p([...S.keys()]);else{let R=Array.from(S).reduce((C,F)=>{let V=Math.abs(F[1]-s);return V<C.diff?{diff:V,key:F[0]}:C},{diff:1/0,key:""});S.delete(R.key),p([...S.keys()])}}}if(!o){let M=this.getRoutePath(t,e,this.forwardRoute);return h(),M||this.getRoutePath(t,e,this.forwardRoute)}let m=(0,jo.cloneDeep)(this.forwardRoute.graph),v=M=>{this.addPermissionLineToMap(M,["","ramp"],m,new Map([["ramp",10]]))};Array.isArray(o)?o.forEach(M=>{v(M)}):v(o);let x=new ro.default(m),E=this.getRoutePath(t,e,x);if(h(),E)return E;{let M=(0,jo.cloneDeep)(this.forwardRoute.graph);Array.isArray(o)?o.forEach(S=>{v(S)}):v(o);let A=new ro.default(M);return this.getRoutePath(t,e,A)}}clear(){this.roadInfo=[],this.pointMap.clear(),this.nodeMap.clear(),this.facilityMap.clear(),this.straightLadderMap.clear(),this.escalatorMap.clear(),this.staircaseMap.clear(),this.lineMap.clear(),this.baseRoute=new ro.default,this.escalatorRoute=new ro.default,this.straightLadderRoute=new ro.default}constructor(t=3){this.lift_priority=t,this.roadInfo=[],this.facilities=[],this.pointMap=new Map,this.nodeMap=new Map,this.facilityMap=new Map,this.straightLadderMap=new Map,this.escalatorMap=new Map,this.rampMap=new Map,this.staircaseMap=new Map,this.connectionPointMap=new Map,this.parkingMap=new Map,this.lineMap=new Map,this.baseRoute=new ro.default,this.escalatorRoute=new ro.default,this.straightLadderRoute=new ro.default,this.forwardLineMap=new Map,this.forwardRoute=new ro.default}};var uwt=sn(jN(),1),lwt=sn(Yp(),1);function QN(n){return n.replace(/[A-Z]/g,t=>"_"+t.toLowerCase()).replace(/^_/,"")}function t2(n){let t={};for(let o in n)o.startsWith("on")&&(t[QN(o.slice(2))]=n[o]);let e=o=>ac(this,null,function*(){let{data:s}=o;if(t[s.type])try{let l=yield t[s.type](s.data);if(l!=null&&l.$transfer&&Array.isArray(l.$transfer)){let p=l.$transfer;delete l.$transfer,self.postMessage({type:""+s.type+"_result",key:s.key,data:l},p)}else self.postMessage({type:""+s.type+"_result",key:s.key,data:l})}catch(l){self.postMessage({type:""+s.type+"_result",key:s.key,error:l})}else self.postMessage({type:""+s.type+"_result",key:s.key,error:"no_event"})});return self.addEventListener("message",e),()=>{self.removeEventListener("message",e)}}var la=new Jg,r2,QK=new Promise(n=>{r2=n});function i2(n,t,e){let{floor:o,coord:s}=n,l=null;return(t||[]).forEach(p=>{let h=la.getPath({floor:o,coord:s},{floor:p.floor,parkingSpace:p.lot_id},"forward",0,e);if(h==="near"){l={floor:p.floor,spaceNo:p.lot_id,distance:0};return}if(!h||typeof h=="string")return;let g={floor:p.floor,spaceNo:p.lot_id,distance:h[0].consume};l||(l=g),l.distance>g.distance&&(l=g)}),l}function e2(n,t,e,o,s){let l=i2({floor:n,coord:t},e[n],s);return l||tj(n,t,e,o,s)}function tj(n,t,e,o,s){let l=o.indexOf(n);l===-1&&(l=o.length);let p=1,h=null;for(;p<=o.length;){if(o.filter((m,v)=>v===l-1||v===l+1).forEach(m=>{let v=i2({floor:n,coord:t},e[m],s);h?v&&h.distance>v.distance&&(h=v):h=v}),h)return h;p++}return h}function n2(n,t,e,o,s){let l=z1(n,t,t.floor,e,s);if(l)return l;let p=z1(n,t,n.floor,e,s);return p||ej(n,t,n.floor,e,o,s)}function z1(n,t,e,o,s){let l=o[e]||[];if(!l.length)return null;let p=null;return l.forEach(h=>{let g={floor:h.floor,parkingSpace:h.lot_id},m=la.getPath(n,g,"forward",0,s);if(!m||typeof m=="string"&&m!=="near")return;let v=la.getParkingSpaceInfo(h.floor,h.lot_id);if(!v)return;let x=la.getPath({floor:h.floor,coord:v.cds},t,"",0);if(x==="near"){p={floor:h.floor,spaceNo:h.lot_id,distance:0};return}if(!x||typeof x=="string")return;let E={floor:h.floor,spaceNo:h.lot_id,distance:x[0].consume};p?p.distance>E.distance&&(p=E):p=E}),p}function ej(n,t,e,o,s,l){let p=s.indexOf(e);p===-1&&(p=s.length);let h=1,g=null;for(;h<=s.length;){if(s.filter((v,x)=>x===p-1||x===p+1).forEach(v=>{let x=z1(n,t,v,o,l);g?x&&g.distance>x.distance&&(g=x):g=x}),g)return g;h++}return g}function nj(n){if(n.coord)return{floor:n.floor,coord:n.coord};if(n.nodeId){let t=la.getNodeInfo(n.floor,n.nodeId);if(t)return{floor:t.floor,coord:t.cds}}return null}function rj(n){if(n.coord)return{floor:n.floor,coord:n.coord};if(n.nodeId){let t=la.getNodeInfo(n.floor,n.nodeId);if(t)return{floor:t.floor,coord:t.cds}}if(n.parkingSpace){let t=la.getParkingSpaceInfo(n.floor,n.parkingSpace);if(t)return{floor:t.floor,coord:t.cds}}return null}t2({onSetRoadInfo(n){let{roadData:t,facilities:e}=n;la.initRoute(t,e),r2(!0)},onRecommend(n){return ac(this,null,function*(){let{start:t,end:e,travelDirection:o,carLotStatus:s,parkingType:l}=n;yield QK;let p=s.reduce((v,x)=>(v[x.floor]?v[x.floor].push(x):v[x.floor]=[x],v),{}),h=la.roadInfo.map(v=>v.floor),g=nj(t);if(!g)return null;let m=e?rj(e):null;if(l){let v=s.filter(x=>{let E=la.getParkingSpaceInfo(x.floor,x.lot_id);return E?E.parkingType===l:!1});if(v){let x=v.reduce((E,M)=>(E[M.floor]?E[M.floor].push(M):E[M.floor]=[M],E),{});if(m){let E=n2(g,m,x,h,o);if(E)return E}else{let E=e2(g.floor,g.coord,x,h,o);if(E)return E}}}return m?n2(g,m,p,h,o):e2(g.floor,g.coord,p,h,o)})},onClear(){la.clear()}});
|
|
23467
|
-
`],{type:"text/javascript"}),t=URL.createObjectURL(a),e=new Worker(t);return URL.revokeObjectURL(t),e}var Vu={placeId:0,catLotStatusApi:"https://vrapi.aibee.cn/parking/cat-lot-status"},Qi=class{setRoadData(t,e){return $(this.worker,"set_road_info",{roadData:t,facilities:e})}recommend(t){return g(this,null,function*(){let e=yield fetch(this.options.catLotStatusApi,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({place_id:+this.options.placeId})}).then(n=>n.json()).then(n=>n.data.filter(r=>r.status===0));return $(this.worker,"recommend",x({},t,{carLotStatus:e}))})}dispose(){this.worker.terminate()}constructor(t={}){this.worker=Ji(),this.options=x({},Vu,t)}};var a6=require("core-js/modules/es.json.stringify.js"),u6=require("core-js/modules/web.dom-collections.iterator.js"),l6=require("core-js/modules/es.array.sort.js"),c6=require("core-js/modules/es.array.push.js"),h6=require("core-js/modules/web.url-search-params.js"),p6=require("core-js/modules/web.url-search-params.delete.js"),f6=require("core-js/modules/web.url-search-params.has.js"),d6=require("core-js/modules/web.url-search-params.size.js"),g6=require("core-js/modules/es.regexp.exec.js");var n6=require("core-js/modules/es.json.stringify.js");var Hu={url:"",reconnect:!0,heartBeat:2e3,heartMsg:"PING",reconnectTime:3e3,reconnectMaxCount:1e6,noMessageTime:6e3},rn=class extends it{initWebsocket(){this.ws=new WebSocket(this.options.url),this.ws.onopen=()=>{this.alive=!0,this.startHeart(),this.startOnMessageTimer(),this.stopReconnect(),this.dispatchEvent({type:"open"})},this.ws.onerror=()=>{this.alive=!1,this.ws=null,this.stopHeart(),this.stopOnMessageTimer(),this.startReconnect(),this.registryEvent()},this.ws.onclose=()=>{this.alive=!1,this.ws=null,this.stopHeart(),this.stopOnMessageTimer(),this.startReconnect()},this.ws.onmessage=t=>{this.startOnMessageTimer(),this.dispatchEvent({type:"message",message:t})}}startHeart(){this.stopHeart(),this.heartTimer=this.timer.setInterval(()=>{this.send(this.options.heartMsg)&&this.dispatchEvent({type:"send-heart"})},this.options.heartBeat)}stopHeart(){this.heartTimer&&(this.timer.clearInterval(this.heartTimer),this.heartTimer=null)}startReconnect(t){t===void 0&&(t=this.options.reconnectTime),this.stopReconnect(),this.options.reconnect&&(this.options.reconnectMaxCount--,this.options.reconnectMaxCount>=0&&(this.reconnectTimer=this.timer.setTimeout(()=>{this.initWebsocket()},t)))}stopReconnect(){this.reconnectTimer&&(this.timer.clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}startOnMessageTimer(){this.stopOnMessageTimer(),this.noMessageTimer=this.timer.setTimeout(()=>{var t;(t=this.ws)==null||t.close(),this.dispatchEvent({type:"no-message-timeout"})},this.options.noMessageTime)}stopOnMessageTimer(){this.noMessageTimer&&(this.timer.clearTimeout(this.noMessageTimer),this.noMessageTimer=null)}send(t){var e;let n=typeof t=="string"?t:JSON.stringify(t);return this.alive&&((e=this.ws)==null?void 0:e.readyState)===1?(this.ws.send(n),this.dispatchEvent({type:"send-success",msg:n}),!0):(this.dispatchEvent({type:"send-fail",msg:n}),!1)}registryEvent(){window.addEventListener("online",this.onOnline)}unRegistryEvent(){window.removeEventListener("online",this.onOnline)}close(){var t;this.unRegistryEvent(),this.options.reconnect=!1,this.alive=!1,this.stopHeart(),this.stopReconnect(),this.stopOnMessageTimer(),(t=this.ws)==null||t.close(),this.ws=null,this.dispatchEvent({type:"close"})}dispose(){this.close(),this.timer.dispose(),super.dispose()}constructor(t){super(),this.ws=null,this.alive=!1,this.timer=new K,this.heartTimer=null,this.reconnectTimer=null,this.noMessageTimer=null,this.onOnline=()=>{this.startReconnect()},this.options=x({},Hu,t||{}),this.options.url&&this.initWebsocket()}};var eo=require("lodash");var to=a=>{let t=a.toString(2),e=""+Array(16-t.length+1).join("0")+t,n=parseInt(e.slice(0,4),2)*10,r=parseInt(e.slice(4,16),2);return[n,r]};var no=class extends it{initPositionWebSocket(){let t=x({},this.options.ext_position_params,{place_id:this.options.place_id,token:this.options.access_token}),e=Object.keys(t).filter(n=>!(0,eo.isNil)(t[n])).map(n=>n+"="+t[n]).join("&");this.positionWebSocket=new rn({url:this.options.wss_position_url+"?"+e}),this.positionWebSocket.addEventListener("message",n=>{let{message:r}=n,i=(()=>{try{return JSON.parse(r.data)}catch(U){return r.data}})();if(i.command==="POSITION_RESULT"&&i.data.success)if(["POSITION","FLOOR","PARK_POSITION"].includes(i.data.success_type)&&this.useGpsFloorTimer&&(this.positionFloor=i.data.floor,this.timer.clearTimeout(this.useGpsFloorTimer),this.useGpsFloorTimer=null),i.data.success_type==="POSITION"){let{x:U,y:T,time:R,floor:M,ts:V}=i.data,Z=this.positionFloor!==M;if(this.positionFloor=M,this.dispatchEvent({type:"ws-position",floor:M,x:U,y:T,time:R}),console.log("positionFloor",M,Z),this.options.upload_position){var o;(o=this.positionWebSocket)==null||o.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:U,y:T,floor:M,type:"originBeacon"}),serverData:JSON.stringify(i)})}if(!this.options.use_pdr){this.dispatchEvent({type:"position",floor:M,x:U,y:T,time:new Date(V).getTime()-i.lag-i.duration});return}if(this.options.type!==1){var s;if(Z){var u,l,c;(c=this.pdrPosition)==null||(l=c.pdr)==null||(u=l.particleFilter)==null||u.setPosInitFlag(!1)}(s=this.pdrPosition)==null||s.setBeaconPosition({x:U,y:T},new Date(V).getTime()-i.lag-i.duration)}else if(Z){var h;if(this.resetPdr(),(h=this.carInertialPosition)==null||h.stopPositionTimer(),this.path){let W=this.path.findIndex(fe=>fe.floor===M),F=this.path[W];if(F){var p;this.resetPdr(),(p=this.carInertialPosition)==null||p.setBeaconPosition(F.points[0],new Date(R).getTime()-i.lag-i.duration,i.lag+i.duration)}else{var f;(f=this.carInertialPosition)==null||f.setBeaconPosition([U,T],new Date(R).getTime()-i.lag-i.duration,i.lag+i.duration)}}else{var d;(d=this.carInertialPosition)==null||d.setBeaconPosition([U,T],new Date(R).getTime()-i.lag-i.duration,i.lag+i.duration)}}else{var m;(m=this.carInertialPosition)==null||m.setBeaconPosition([U,T],new Date(R).getTime()-i.lag-i.duration,i.lag+i.duration)}}else if(i.data.success_type==="PARK_POSITION"&&i.data.success){if(this.options.type===1){let{x:U,y:T,time:R,floor:M}=i.data,V=this.positionFloor!==M;if(this.positionFloor=i.data.floor,this.dispatchEvent({type:"ws-position",floor:M,x:U,y:T,time:R}),!this.options.use_pdr){this.dispatchEvent({type:"position",floor:M,x:U,y:T,time:new Date(R).getTime()});return}if(V){var v;if(this.resetPdr(),(v=this.carInertialPosition)==null||v.stopPositionTimer(),this.path){let Z=this.path.findIndex(F=>F.floor===M),W=this.path[Z];if(W){var y;this.resetPdr(),(y=this.carInertialPosition)==null||y.setPosition(W.points[0],new Date(R).getTime(),i.duration)}else{var S;(S=this.carInertialPosition)==null||S.setPosition([U,T],new Date(R).getTime(),i.duration)}}else{var w;(w=this.carInertialPosition)==null||w.setPosition([U,T],new Date(R).getTime(),i.duration)}}else{var O,N;if((O=this.carInertialPosition)==null||O.setPosition([U,T],new Date(R).getTime(),i.duration),!((N=this.carInertialPosition)!=null&&N.positionTimer)){var Y;(Y=this.carInertialPosition)==null||Y.startPositionTimer()}}if(this.options.upload_position){var C;(C=this.positionWebSocket)==null||C.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:U,y:T,floor:M,type:"vision"}),serverData:JSON.stringify(i)})}}}else this.dispatchEvent({type:"floor",floor:i.data.floor,time:i.data.time})})}initSensorWebSocket(){let t=x({},this.options.ext_sensor_params,{token:this.options.access_token,place_id:this.options.place_id,record_sensor:1}),e=Object.keys(t).filter(n=>!(0,eo.isNil)(t[n])).map(n=>n+"="+t[n]).join("&");this.sensorWebSocket=new rn({url:this.options.wss_sensor_url+"?"+e})}initPdr(){this.options.type===1?(this.carInertialPosition=new er,this.carInertialPosition.addEventListener("change-pos",t=>{let{value:e}=t,{pos:n,success:r,speed:i}=e;if(r&&(this.dispatchEvent({type:"position",floor:this.positionFloor,x:n[0],y:n[1],time:Date.now(),speed:i}),this.options.upload_position)){var o;(o=this.positionWebSocket)==null||o.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:n[0],y:n[1],floor:this.positionFloor,type:"vision_pdr"})})}}),this.carInertialPosition.addEventListener("change-compass",t=>{let{value:e}=t;this.dispatchEvent({type:"compass",value:e})})):(this.pdrPosition=new $n(this.bmap,{pdr:{using_gps:this.options.use_gps},sensor:{elements:[k.COMPASS,k.ACCELERATION,k.DEVICE_MOTION].concat(this.options.use_gps?[k.GPS]:[])}}),this.requestDeviceOrientationPermission(),this.options.upload_position&&this.pdrPosition.sensor.addEventListener("sensor-data",t=>{let{data:e}=t;var n;(n=this.positionWebSocket)==null||n.send({command:"UPLOAD_SENSOR",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify(e)})}),this.pdrPosition.sensor.addEventListener("add-data-item",t=>{t.item.type==="compass"&&this.dispatchEvent({type:"compass",value:t.item.res})}),this.pdrPosition.addEventListener("position",t=>{let{x:e,y:n,_type:r}=t;if(console.log("_type",r,e,n,this.positionFloor,this.gpsFloor),r==="gps"&&!this.useGpsFloorTimer){let o=()=>{this.useGpsFloorTimer=this.timer.setTimeout(()=>{this.gpsFloor?this.positionFloor=this.gpsFloor:o()},5e3)};o()}if(this.positionFloor&&(this.dispatchEvent({type:"position",floor:this.positionFloor,x:e,y:n,time:Date.now()}),this.options.upload_position)){var i;(i=this.positionWebSocket)==null||i.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:e,y:n,floor:this.positionFloor,type:r})})}}))}setSensor(t){this.pdrPosition&&this.pdrPosition.setSensor(t)}requestDeviceOrientationPermission(){return g(this,null,function*(){if(this.pdrPosition){let t=yield this.pdrPosition.checkSensor();return t.deviceOrientation?this.pdrPosition.start():(this.dispatchEvent(x({type:"check-sensor"},t)),!t.deviceOrientation&&this.options.use_default_permission),t}else return null})}getGpsFloor(){return g(this,null,function*(){if(this.options.use_gps&&this.options.get_gps_floor_url){let t=yield fetch(this.options.get_gps_floor_url+"/"+this.options.place_id).then(e=>e.json());t.code===200&&(this.gpsFloor=t.data.gps_floor)}})}pausePdr(){if(this.options.type===1){var t;(t=this.carInertialPosition)==null||t.stopPositionTimer()}else{var e;(e=this.pdrPosition)==null||e.pause()}}continuePdr(){if(this.options.type===1)this.carInertialPosition&&(this.carInertialPosition.positionTimer||this.carInertialPosition.startPositionTimer());else{var t;(t=this.pdrPosition)==null||t.continue()}}setPathAngle(t){if(this.options.type===1){var e;(e=this.carInertialPosition)==null||e.setPathAngle(t)}}getForwardAngle(){if(this.options.type===1){var t,e;return(e=(t=this.carInertialPosition)==null?void 0:t.angle)!=null?e:null}else return null}resetPdr(){this.carInertialPosition&&(this.carInertialPosition.history=[],this.carInertialPosition.setPathAngle(0),this.carInertialPosition.speed=0),this.pdrPosition&&this.pdrPosition.pdr.particleFilter.setPosInitFlag(!1)}setPath(t){this.path=t}sendBeacon(t){var e;let n=[];if(ge)n=t.map(i=>{let[o,s]=to(i.major);return[i.uuid,s,i.minor,i.rssi,i.accuracy,o]}).filter(i=>i[3]!==0).sort((i,o)=>o[3]-i[3]);else{let i=t.reduce((o,s)=>{var u,l;let[c,h]=to(s.major),p=""+h+s.minor;return(u=o)[l=p]||(u[l]=[]),o[p].push(x({},s,{battery:c})),o},{});Object.entries(i).forEach(o=>{let[s,u]=o,{uuid:l,major:c,minor:h,accuracy:p,battery:f}=u[0];if(u.length>1){let d=u.filter(v=>v.rssi<0),m=d.reduce((v,y)=>v+y.rssi,0);n.push([l,c,h,m/d.length,p,f])}else n.push([l,c,h,u[0].rssi,p,f])})}let r={command:"POSITION",index:this.uploadIndex++,ts:Date.now(),beacons:JSON.stringify(n),ext_sensors:JSON.stringify({})};(e=this.sensorWebSocket)==null||e.send(r)}dispose(){var t,e,n,r;this.timer.dispose(),(t=this.positionWebSocket)==null||t.dispose(),this.positionWebSocket=null,(e=this.sensorWebSocket)==null||e.dispose(),this.sensorWebSocket=null,(n=this.pdrPosition)==null||n.dispose(),this.pdrPosition=null,(r=this.carInertialPosition)==null||r.dispose(),this.carInertialPosition=null,super.dispose()}constructor(t,e){super(),this.bmap=t,this.positionWebSocket=null,this.sensorWebSocket=null,this.pdrPosition=null,this.carInertialPosition=null,this.gpsFloor="",this.positionFloor="",this.useGpsFloorTimer=null,this.uploadIndex=0,this.path=null,this.timer=new K;let n=new URLSearchParams(location.search),r=n.get("server_env")||"prod",i={test:"nav-test.aibee.cn",prod:"nav.aibee.cn"},o="wss://"+i[r]+"/aether-walker/indoor/position",s="wss://"+i[r]+"/aether-walker/indoor/sensor";this.options=x({place_id:n.get("place_id"),access_token:n.get("access_token"),env:r,wss_position_url:o,wss_sensor_url:s,get_gps_floor_url:"https://"+i[r]+"/aether-walker/indoor/conf",use_sensor:!1,type:-1,use_gps:!0,use_pdr:!0,upload_position:!0,use_default_permission:!0,ext_position_params:{},ext_sensor_params:{}},e),this.initPositionWebSocket(),this.options.use_sensor&&this.initSensorWebSocket(),this.options.use_pdr&&this.initPdr(),this.options.use_gps&&this.getGpsFloor()}};var M6=require("core-js/modules/web.dom-collections.iterator.js");var ro=class extends ut{showMyPosition(t,e){var n;let r=(n=this.bmap.context.currentFloor)==null?void 0:n.getGraphicPosition(t);if(r){let i=new Oe(this.bmap.context,{autoUpdate:!0,appendToBody:!1});i.div.appendChild(e),i.position.copy(this.bmap.mercatorToWorld(r)),this.myPositionOverlay=i,console.log("graphicPos",r,this)}else console.warn("[showMyPosition] \u6CA1\u6709\u627E\u5230\u56FE\u5143\u6240\u5728\u7684\u4F4D\u7F6E")}hideMyPosition(){this.myPositionOverlay&&(this.myPositionOverlay.dispose(),this.myPositionOverlay=null)}dispose(){this.hideMyPosition()}constructor(...t){super(...t),this.myPositionOverlay=null}};var io=class extends ut{highlightPoi(t,e){e===void 0&&(e={icon_size:[40,40],collision_enable:!1}),t.map(r=>this.bmap.getPoiById(r)).filter(r=>!!r).forEach(r=>{var i;(i=r.userData).restore||(i.restore={});for(let u in e)if(u in r.options){var o,s;(o=r.userData.restore)[s=u]||(o[s]=r.options[u]),r.options[u]=e[u]}})}restorePoi(t){t.map(n=>this.bmap.getPoiById(n)).filter(n=>!!n).forEach(n=>{console.log("poi.userData.restore",n.userData.restore);for(let r in n.userData.restore)r in n.options&&(n.options[r]=n.userData.restore[r]);n.userData.restore={}})}};var P6=require("core-js/modules/web.dom-collections.iterator.js"),I6=require("core-js/modules/es.array.sort.js");var oo=class extends ut{sortByDistance(t,e,n){return g(this,null,function*(){n===void 0&&(n=!1);let r=[...e];if(n||e.length<20)return yield Promise.all(r.map(i=>g(this,null,function*(){i.distance=yield this._getDistance(t,{floor:i.floor,x:i.center_x,y:i.center_y})}))),r.sort((i,o)=>i.distance-o.distance);{let i=r.sort((s,u)=>{let l=Math.sqrt((s.center_x-t.x)**2+(s.center_y-t.y)**2)+(t.floor===s.floor?0:100),c=Math.sqrt((u.center_x-t.x)**2+(u.center_y-t.y)**2)+(t.floor===u.floor?0:100);return l-c});return[...(yield Promise.all(i.slice(0,20).map(s=>g(this,null,function*(){return s.distance=yield this._getDistance(t,{floor:s.floor,x:s.center_x,y:s.center_y}),s})))).sort((s,u)=>s.distance-u.distance),...i.slice(20)]}})}_getDistance(t,e){return g(this,null,function*(){return this.navPath.getPath({floor:t.floor,coord:[t.x,t.y]},{floor:e.floor,coord:[e.x,e.y]},"",0).then(n=>n.reduce((r,i,o)=>{if(r+=i.distance,o!==n.length-1)switch(i.endType){case"escalator":case"straightLadder":case"staircase":case"ramp":r+=100;break}return r},0)).catch(n=>n==="near"?0:1/0)})}dispose(){super.dispose(),this.needDisposeNavPath&&this.navPath.dispose()}constructor(t,e){if(super(t),this.needDisposeNavPath=!1,e)this.navPath=e;else{this.navPath=new Yn;let n=new Fe(t);this.needDisposeNavPath=!0,n.load(t.config.apiPath.loadPlaceInfo+"?place_id="+t.config.placeId+"&env=prod").then(r=>g(this,null,function*(){let[i,o]=yield Promise.all([n.getRoadNetworkData(),n.getFacilitiesData()]);this.navPath.setRoadData(i,o.infrastructures)}))}}};
|
|
23467
|
+
`],{type:"text/javascript"}),t=URL.createObjectURL(a),e=new Worker(t);return URL.revokeObjectURL(t),e}var Vu={placeId:0,catLotStatusApi:"https://vrapi.aibee.cn/parking/cat-lot-status"},Qi=class{setRoadData(t,e){return $(this.worker,"set_road_info",{roadData:t,facilities:e})}recommend(t){return g(this,null,function*(){let e=yield fetch(this.options.catLotStatusApi,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({place_id:+this.options.placeId})}).then(n=>n.json()).then(n=>n.data.filter(r=>r.status===0));return $(this.worker,"recommend",x({},t,{carLotStatus:e}))})}dispose(){this.worker.terminate()}constructor(t={}){this.worker=Ji(),this.options=x({},Vu,t)}};var a6=require("core-js/modules/es.json.stringify.js"),u6=require("core-js/modules/web.dom-collections.iterator.js"),l6=require("core-js/modules/es.array.sort.js"),c6=require("core-js/modules/es.array.push.js"),h6=require("core-js/modules/web.url-search-params.js"),p6=require("core-js/modules/web.url-search-params.delete.js"),f6=require("core-js/modules/web.url-search-params.has.js"),d6=require("core-js/modules/web.url-search-params.size.js"),g6=require("core-js/modules/es.regexp.exec.js");var n6=require("core-js/modules/es.json.stringify.js");var Hu={url:"",reconnect:!0,heartBeat:2e3,heartMsg:"PING",reconnectTime:3e3,reconnectMaxCount:1e6,noMessageTime:6e3},rn=class extends it{initWebsocket(){this.ws=new WebSocket(this.options.url),this.ws.onopen=()=>{this.alive=!0,this.startHeart(),this.startOnMessageTimer(),this.stopReconnect(),this.dispatchEvent({type:"open"})},this.ws.onerror=()=>{this.alive=!1,this.ws=null,this.stopHeart(),this.stopOnMessageTimer(),this.startReconnect(),this.registryEvent()},this.ws.onclose=()=>{this.alive=!1,this.ws=null,this.stopHeart(),this.stopOnMessageTimer(),this.startReconnect()},this.ws.onmessage=t=>{this.startOnMessageTimer(),this.dispatchEvent({type:"message",message:t})}}startHeart(){this.stopHeart(),this.heartTimer=this.timer.setInterval(()=>{this.send(this.options.heartMsg)&&this.dispatchEvent({type:"send-heart"})},this.options.heartBeat)}stopHeart(){this.heartTimer&&(this.timer.clearInterval(this.heartTimer),this.heartTimer=null)}startReconnect(t){t===void 0&&(t=this.options.reconnectTime),this.stopReconnect(),this.options.reconnect&&(this.options.reconnectMaxCount--,this.options.reconnectMaxCount>=0&&(this.reconnectTimer=this.timer.setTimeout(()=>{this.initWebsocket()},t)))}stopReconnect(){this.reconnectTimer&&(this.timer.clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}startOnMessageTimer(){this.stopOnMessageTimer(),this.noMessageTimer=this.timer.setTimeout(()=>{var t;(t=this.ws)==null||t.close(),this.dispatchEvent({type:"no-message-timeout"})},this.options.noMessageTime)}stopOnMessageTimer(){this.noMessageTimer&&(this.timer.clearTimeout(this.noMessageTimer),this.noMessageTimer=null)}send(t){var e;let n=typeof t=="string"?t:JSON.stringify(t);return this.alive&&((e=this.ws)==null?void 0:e.readyState)===1?(this.ws.send(n),this.dispatchEvent({type:"send-success",msg:n}),!0):(this.dispatchEvent({type:"send-fail",msg:n}),!1)}registryEvent(){window.addEventListener("online",this.onOnline)}unRegistryEvent(){window.removeEventListener("online",this.onOnline)}close(){var t;this.unRegistryEvent(),this.options.reconnect=!1,this.alive=!1,this.stopHeart(),this.stopReconnect(),this.stopOnMessageTimer(),(t=this.ws)==null||t.close(),this.ws=null,this.dispatchEvent({type:"close"})}dispose(){this.close(),this.timer.dispose(),super.dispose()}constructor(t){super(),this.ws=null,this.alive=!1,this.timer=new K,this.heartTimer=null,this.reconnectTimer=null,this.noMessageTimer=null,this.onOnline=()=>{this.startReconnect()},this.options=x({},Hu,t||{}),this.options.url&&this.initWebsocket()}};var eo=require("lodash");var to=a=>{let t=a.toString(2),e=""+Array(16-t.length+1).join("0")+t,n=parseInt(e.slice(0,4),2)*10,r=parseInt(e.slice(4,16),2);return[n,r]};var no=class extends it{initPositionWebSocket(){let t=x({},this.options.ext_position_params,{place_id:this.options.place_id,token:this.options.access_token}),e=Object.keys(t).filter(n=>!(0,eo.isNil)(t[n])).map(n=>n+"="+t[n]).join("&");this.positionWebSocket=new rn({url:this.options.wss_position_url+"?"+e}),this.positionWebSocket.addEventListener("message",n=>{let{message:r}=n,i=(()=>{try{return JSON.parse(r.data)}catch(U){return r.data}})();if(i.command==="POSITION_RESULT"&&i.data.success)if(["POSITION","FLOOR","PARK_POSITION"].includes(i.data.success_type)&&this.useGpsFloorTimer&&(this.positionFloor=i.data.floor,this.timer.clearTimeout(this.useGpsFloorTimer),this.useGpsFloorTimer=null),i.data.success_type==="POSITION"){let{x:U,y:T,time:R,floor:M,ts:V}=i.data,Z=this.positionFloor!==M;if(this.positionFloor=M,this.dispatchEvent({type:"ws-position",floor:M,x:U,y:T,time:R}),console.log("positionFloor",M,Z),this.options.upload_position){var o;(o=this.positionWebSocket)==null||o.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:U,y:T,floor:M,type:"originBeacon"}),serverData:JSON.stringify(i)})}if(!this.options.use_pdr){this.dispatchEvent({type:"position",floor:M,x:U,y:T,time:new Date(V).getTime()-i.lag-i.duration});return}if(this.options.type!==1){var s;if(Z){var u,l,c;(c=this.pdrPosition)==null||(l=c.pdr)==null||(u=l.particleFilter)==null||u.setPosInitFlag(!1)}(s=this.pdrPosition)==null||s.setBeaconPosition({x:U,y:T},new Date(V).getTime()-i.lag-i.duration)}else if(Z){var h;if(this.resetPdr(),(h=this.carInertialPosition)==null||h.stopPositionTimer(),this.path){let W=this.path.findIndex(fe=>fe.floor===M),F=this.path[W];if(F){var p;this.resetPdr(),(p=this.carInertialPosition)==null||p.setBeaconPosition(F.points[0],new Date(R).getTime()-i.lag-i.duration,i.lag+i.duration)}else{var f;(f=this.carInertialPosition)==null||f.setBeaconPosition([U,T],new Date(R).getTime()-i.lag-i.duration,i.lag+i.duration)}}else{var d;(d=this.carInertialPosition)==null||d.setBeaconPosition([U,T],new Date(R).getTime()-i.lag-i.duration,i.lag+i.duration)}}else{var m;(m=this.carInertialPosition)==null||m.setBeaconPosition([U,T],new Date(R).getTime()-i.lag-i.duration,i.lag+i.duration)}}else if(i.data.success_type==="PARK_POSITION"&&i.data.success){if(this.options.type===1){let{x:U,y:T,time:R,floor:M}=i.data,V=this.positionFloor!==M;if(this.positionFloor=i.data.floor,this.dispatchEvent({type:"ws-position",floor:M,x:U,y:T,time:R}),!this.options.use_pdr){this.dispatchEvent({type:"position",floor:M,x:U,y:T,time:new Date(R).getTime()});return}if(V){var v;if(this.resetPdr(),(v=this.carInertialPosition)==null||v.stopPositionTimer(),this.path){let Z=this.path.findIndex(F=>F.floor===M),W=this.path[Z];if(W){var y;this.resetPdr(),(y=this.carInertialPosition)==null||y.setPosition(W.points[0],new Date(R).getTime(),i.duration)}else{var S;(S=this.carInertialPosition)==null||S.setPosition([U,T],new Date(R).getTime(),i.duration)}}else{var w;(w=this.carInertialPosition)==null||w.setPosition([U,T],new Date(R).getTime(),i.duration)}}else{var O,N;if((O=this.carInertialPosition)==null||O.setPosition([U,T],new Date(R).getTime(),i.duration),!((N=this.carInertialPosition)!=null&&N.positionTimer)){var Y;(Y=this.carInertialPosition)==null||Y.startPositionTimer()}}if(this.options.upload_position){var C;(C=this.positionWebSocket)==null||C.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:U,y:T,floor:M,type:"vision"}),serverData:JSON.stringify(i)})}}}else this.dispatchEvent({type:"floor",floor:i.data.floor,time:i.data.time})})}initSensorWebSocket(){let t=x({},this.options.ext_sensor_params,{token:this.options.access_token,place_id:this.options.place_id,record_sensor:1}),e=Object.keys(t).filter(n=>!(0,eo.isNil)(t[n])).map(n=>n+"="+t[n]).join("&");this.sensorWebSocket=new rn({url:this.options.wss_sensor_url+"?"+e})}initPdr(){this.options.type===1?(this.carInertialPosition=new er,this.carInertialPosition.addEventListener("change-pos",t=>{let{value:e}=t,{pos:n,success:r,speed:i}=e;if(r&&(this.dispatchEvent({type:"position",floor:this.positionFloor,x:n[0],y:n[1],time:Date.now(),speed:i}),this.options.upload_position)){var o;(o=this.positionWebSocket)==null||o.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:n[0],y:n[1],floor:this.positionFloor,type:"vision_pdr"})})}}),this.carInertialPosition.addEventListener("change-compass",t=>{let{value:e}=t;this.dispatchEvent({type:"compass",value:e})})):(this.pdrPosition=new $n(this.bmap,{pdr:{using_gps:this.options.use_gps},sensor:{elements:[k.COMPASS,k.ACCELERATION,k.DEVICE_MOTION].concat(this.options.use_gps?[k.GPS]:[])}}),this.requestDeviceOrientationPermission(),this.options.upload_position&&this.pdrPosition.sensor.addEventListener("sensor-data",t=>{let{data:e}=t;var n;(n=this.positionWebSocket)==null||n.send({command:"UPLOAD_SENSOR",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify(e)})}),this.pdrPosition.sensor.addEventListener("add-data-item",t=>{t.item.type==="compass"&&this.dispatchEvent({type:"compass",value:t.item.res})}),this.pdrPosition.addEventListener("position",t=>{let{x:e,y:n,_type:r}=t;if(console.log("_type",r,e,n,this.positionFloor,this.gpsFloor),r==="gps"&&!this.useGpsFloorTimer){let o=()=>{this.useGpsFloorTimer=this.timer.setTimeout(()=>{this.gpsFloor?this.positionFloor=this.gpsFloor:o()},5e3)};o()}if(this.positionFloor&&(this.dispatchEvent({type:"position",floor:this.positionFloor,x:e,y:n,time:Date.now()}),this.options.upload_position)){var i;(i=this.positionWebSocket)==null||i.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:e,y:n,floor:this.positionFloor,type:r})})}}))}setSensor(t){this.pdrPosition&&this.pdrPosition.setSensor(t)}requestDeviceOrientationPermission(){return g(this,null,function*(){if(this.pdrPosition){let t=yield this.pdrPosition.checkSensor();return t.deviceOrientation?this.pdrPosition.start():(this.dispatchEvent(x({type:"check-sensor"},t)),!t.deviceOrientation&&this.options.use_default_permission),t}else return null})}getGpsFloor(){return g(this,null,function*(){if(this.options.use_gps&&this.options.get_gps_floor_url){let t=yield fetch(this.options.get_gps_floor_url+"/"+this.options.place_id).then(e=>e.json());t.code===200&&(this.gpsFloor=t.data.gps_floor)}})}pausePdr(){if(this.options.type===1){var t;(t=this.carInertialPosition)==null||t.stopPositionTimer()}else{var e;(e=this.pdrPosition)==null||e.pause()}}continuePdr(){if(this.options.type===1)this.carInertialPosition&&(this.carInertialPosition.positionTimer||this.carInertialPosition.startPositionTimer());else{var t;(t=this.pdrPosition)==null||t.continue()}}setPathAngle(t){if(this.options.type===1){var e;(e=this.carInertialPosition)==null||e.setPathAngle(t)}}getForwardAngle(){if(this.options.type===1){var t,e;return(e=(t=this.carInertialPosition)==null?void 0:t.angle)!=null?e:null}else return null}resetPdr(){this.carInertialPosition&&(this.carInertialPosition.history=[],this.carInertialPosition.setPathAngle(0),this.carInertialPosition.speed=0),this.pdrPosition&&this.pdrPosition.pdr.particleFilter.setPosInitFlag(!1)}setPath(t){this.path=t}sendBeacon(t){var e;let n=[];if(ge)n=t.map(i=>{let[o,s]=to(i.major);return[i.uuid,s,i.minor,i.rssi,i.accuracy,o]}).filter(i=>i[3]!==0).sort((i,o)=>o[3]-i[3]);else{let i=t.reduce((o,s)=>{var u,l;let[c,h]=to(s.major),p=""+h+s.minor;return(u=o)[l=p]||(u[l]=[]),o[p].push(x({},s,{battery:c,major:h})),o},{});Object.entries(i).forEach(o=>{let[s,u]=o,{uuid:l,major:c,minor:h,accuracy:p,battery:f}=u[0];if(u.length>1){let d=u.filter(v=>v.rssi<0),m=d.reduce((v,y)=>v+y.rssi,0);n.push([l,c,h,m/d.length,p,f])}else n.push([l,c,h,u[0].rssi,p,f])})}let r={command:"POSITION",index:this.uploadIndex++,ts:Date.now(),beacons:JSON.stringify([{type:"ibeacon",timestamp:Date.now()/1e3,res:n}]),ext_sensors:JSON.stringify({})};(e=this.sensorWebSocket)==null||e.send(r)}dispose(){var t,e,n,r;this.timer.dispose(),(t=this.positionWebSocket)==null||t.dispose(),this.positionWebSocket=null,(e=this.sensorWebSocket)==null||e.dispose(),this.sensorWebSocket=null,(n=this.pdrPosition)==null||n.dispose(),this.pdrPosition=null,(r=this.carInertialPosition)==null||r.dispose(),this.carInertialPosition=null,super.dispose()}constructor(t,e){super(),this.bmap=t,this.positionWebSocket=null,this.sensorWebSocket=null,this.pdrPosition=null,this.carInertialPosition=null,this.gpsFloor="",this.positionFloor="",this.useGpsFloorTimer=null,this.uploadIndex=0,this.path=null,this.timer=new K;let n=new URLSearchParams(location.search),r=n.get("server_env")||"prod",i={test:"nav-test.aibee.cn",prod:"nav.aibee.cn"},o="wss://"+i[r]+"/aether-walker/indoor/position",s="wss://"+i[r]+"/aether-walker/indoor/sensor";this.options=x({place_id:n.get("place_id"),access_token:n.get("access_token"),env:r,wss_position_url:o,wss_sensor_url:s,get_gps_floor_url:"https://"+i[r]+"/aether-walker/indoor/conf",use_sensor:!1,type:-1,use_gps:!0,use_pdr:!0,upload_position:!0,use_default_permission:!0,ext_position_params:{},ext_sensor_params:{}},e),this.initPositionWebSocket(),this.options.use_sensor&&this.initSensorWebSocket(),this.options.use_pdr&&this.initPdr(),this.options.use_gps&&this.getGpsFloor()}};var M6=require("core-js/modules/web.dom-collections.iterator.js");var ro=class extends ut{showMyPosition(t,e){var n;let r=(n=this.bmap.context.currentFloor)==null?void 0:n.getGraphicPosition(t);if(r){let i=new Oe(this.bmap.context,{autoUpdate:!0,appendToBody:!1});i.div.appendChild(e),i.position.copy(this.bmap.mercatorToWorld(r)),this.myPositionOverlay=i,console.log("graphicPos",r,this)}else console.warn("[showMyPosition] \u6CA1\u6709\u627E\u5230\u56FE\u5143\u6240\u5728\u7684\u4F4D\u7F6E")}hideMyPosition(){this.myPositionOverlay&&(this.myPositionOverlay.dispose(),this.myPositionOverlay=null)}dispose(){this.hideMyPosition()}constructor(...t){super(...t),this.myPositionOverlay=null}};var io=class extends ut{highlightPoi(t,e){e===void 0&&(e={icon_size:[40,40],collision_enable:!1}),t.map(r=>this.bmap.getPoiById(r)).filter(r=>!!r).forEach(r=>{var i;(i=r.userData).restore||(i.restore={});for(let u in e)if(u in r.options){var o,s;(o=r.userData.restore)[s=u]||(o[s]=r.options[u]),r.options[u]=e[u]}})}restorePoi(t){t.map(n=>this.bmap.getPoiById(n)).filter(n=>!!n).forEach(n=>{console.log("poi.userData.restore",n.userData.restore);for(let r in n.userData.restore)r in n.options&&(n.options[r]=n.userData.restore[r]);n.userData.restore={}})}};var P6=require("core-js/modules/web.dom-collections.iterator.js"),I6=require("core-js/modules/es.array.sort.js");var oo=class extends ut{sortByDistance(t,e,n){return g(this,null,function*(){n===void 0&&(n=!1);let r=[...e];if(n||e.length<20)return yield Promise.all(r.map(i=>g(this,null,function*(){i.distance=yield this._getDistance(t,{floor:i.floor,x:i.center_x,y:i.center_y})}))),r.sort((i,o)=>i.distance-o.distance);{let i=r.sort((s,u)=>{let l=Math.sqrt((s.center_x-t.x)**2+(s.center_y-t.y)**2)+(t.floor===s.floor?0:100),c=Math.sqrt((u.center_x-t.x)**2+(u.center_y-t.y)**2)+(t.floor===u.floor?0:100);return l-c});return[...(yield Promise.all(i.slice(0,20).map(s=>g(this,null,function*(){return s.distance=yield this._getDistance(t,{floor:s.floor,x:s.center_x,y:s.center_y}),s})))).sort((s,u)=>s.distance-u.distance),...i.slice(20)]}})}_getDistance(t,e){return g(this,null,function*(){return this.navPath.getPath({floor:t.floor,coord:[t.x,t.y]},{floor:e.floor,coord:[e.x,e.y]},"",0).then(n=>n.reduce((r,i,o)=>{if(r+=i.distance,o!==n.length-1)switch(i.endType){case"escalator":case"straightLadder":case"staircase":case"ramp":r+=100;break}return r},0)).catch(n=>n==="near"?0:1/0)})}dispose(){super.dispose(),this.needDisposeNavPath&&this.navPath.dispose()}constructor(t,e){if(super(t),this.needDisposeNavPath=!1,e)this.navPath=e;else{this.navPath=new Yn;let n=new Fe(t);this.needDisposeNavPath=!0,n.load(t.config.apiPath.loadPlaceInfo+"?place_id="+t.config.placeId+"&env=prod").then(r=>g(this,null,function*(){let[i,o]=yield Promise.all([n.getRoadNetworkData(),n.getFacilitiesData()]);this.navPath.setRoadData(i,o.infrastructures)}))}}};
|