@aibee/crc-bmap 0.9.5 → 0.9.6

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.
@@ -8111,7 +8111,7 @@ void main() {
8111
8111
  top: 0;
8112
8112
  left: 0;
8113
8113
  z-index: 9999;
8114
- `,document.body.appendChild(r.canvas)}setAngle(t){if(console.log("angle",t),r.textureMap.has(t))this._initIcon(r.textureMap.get(t));else{this.draw(t);let e=this.getTexture(this.getImageData());r.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 Fh(new Sc({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}=r,{config:{size:n}}=this,i=n[0]/2,o=n[1]/2,u=4,l=1,c=u+l;if(e.clearRect(0,0,n[0],n[1]),e.setLineDash([10,10]),e.strokeStyle="#fff",e.lineWidth=2,e.beginPath(),e.arc(i,o,o-c,-Math.PI/2,Math.PI*2-Math.PI/2,t<Math.PI),e.stroke(),e.strokeStyle="#0A7AFF",t<Math.PI){let p=-Math.PI/2,m=p-t;e.beginPath(),e.arc(i,o,o-c,p,m,!0)}else{let p=-Math.PI/2,m=p+Math.PI*2-t;e.beginPath(),e.arc(i,o,o-c,p,m,!1)}e.stroke(),e.clearRect(i-c*2,0,c*4,c*4),e.beginPath(),e.arc(i,c,u,0,Math.PI*2),e.fillStyle="#0A7AFF",e.fill(),e.setLineDash([10,0]),e.strokeStyle="#fff",e.lineWidth=l,e.stroke(),e.clearRect(0,o-5,10,10),e.clearRect(i-5,n[1]-10,10,10),e.clearRect(n[0]-10,o-5,10,10),t>Math.PI/2&&t<Math.PI?e.fillStyle="#0A7AFF":e.fillStyle="#fff",e.fillRect(0,o-1,10,2),e.fillStyle="#fff",e.fillRect(i-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,o-1,10,2)}getImageData(){let{ctx:t}=r,{config:{size:e}}=this;return t.getImageData(0,0,e[0],e[1])}getTexture(t){let{config:{size:e}}=this,n=new Da(Uint8Array.from(t.data),e[0],e[1],si);return n.format=si,n.magFilter=sn,n.minFilter=sn,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,r.canvas.width=e.size[0],r.canvas.height=e.size[1]}};z0.canvas=document.createElement("canvas");z0.ctx=z0.canvas.getContext("2d",{willReadFrequently:!0});z0.textureMap=new Map;var JTt={path:{},cheapMaximumDistance:20,needStartPoi:!1,startPoi:{},positionNavigation:{},offsetY:150,directionEmitThreshold:5,disablePathAnimation:!1,disablePathRotate:!1,disablePathShorten:!1,speed:1,roadData:[],runAnimationMaxTime:1,navigationCameraBasic:45},AI=class extends pa{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(Ho.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 z0(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))}toPositionByTask(t){var e;let i=(e=this.taskQueue.getTasks().find(u=>u.meta.type==="toPosition"))==null?void 0:e.tid,o={run:()=>this.toPositionBySpeed(t,this.options.speed),meta:{type:"toPosition"}};i?this.taskQueue.replace(i,o):this.taskQueue.add(o)}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(Ho.SWITCH_FLOOR_GROUND,this.onSwitchFloor),this.positionNavigation.removeEventListener("navigation-info",this.onNavigationInfo),this.bmap.context.removeEventListener("control-change",this.onControlChangeForStartPoi)}clearPath(){if(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}}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();let i=(n=this.bmap.context.currentFloor)==null?void 0:n.name,o=t[e];if(i&&(o==null?void 0:o.floor)===i)if(this.setCurFloorPath(o),this.bmap.currentBuildGround)this.renderPath(this.translatePoints(o.points));else{let u=()=>{this.bmap.removeEventListener("center-change",u),this.renderPath(this.translatePoints(o.points))};this.bmap.addEventListener("center-change",u)}else this.clearPath();this.dispatchEvent({type:"add-path",paths:t})}translatePoints(t){let[e,n]=this.bmap.buildingCenter;return t.map(i=>[i[0]-e,i[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 Q1(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 i;(i=this.bmap.context.currentFloor)==null||i.poiLayer2.removePoi(this.startRotateHelperPoi),this.startRotateHelperPoi=null}}if(this.removeDetachStart(),this.showDetachStartState&&this.options.detachStartPoi){var o;this.detachStartPoi=new ji(this.bmap.context,ae({},this.options.detachStartPoi,{id:"navigation_detach_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.detachStartPoi),this.detachLine=new Wd(this.bmap.context,new K(e[0][0],e[0][1],.51),new K(e[0][0],e[0][1],.51)),this.bmap.context.scene.add(this.detachLine)}if(this.options.needStartPoi){var u;this.startPoi=new ji(this.bmap.context,ae({},this.options.startPoi,{id:"navigation_start_poi",position:{x:e[0][0],y:e[0][1],z:.51},collision_enable:!1}))||null,(u=this.bmap.context.currentFloor)==null||u.poiLayer2.pushPoi(this.startPoi),this.needStartRotateHelperPoi&&this.showStartRotateHelperPoi(),console.log(this.startRotateHelperPoi)}this.dispatchEvent({type:"render-path",path:this.path})}catmullRomCurve3(t){return xg(t,!1,!0,.1,170,2.5)}getPathDirection(){if(!this.curFloorPath||!this.currentPathPosition||this.curFloorPathPoints.length<2)return null;let t=Xl(this.curFloorPathPoints,this.currentPathPosition),e=this.curFloorPathPoints[t],n=this.curFloorPathPoints[t+1],i=new K(n[0]-e[0],n[1]-e[1],0).normalize(),o=new K(0,1,0).normalize(),u=i.angleTo(o),l=new K().crossVectors(o,i);return(Object.is(l.y,0)?-1:1)*u}getPathDirection2(){if(!this.curFloorPath||!this.toPointPosition||this.curFloorPathPoints.length<2)return null;let t=Xl(this.curFloorPathPoints,this.toPointPosition),e=this.curFloorPathPoints[t],n=this.curFloorPathPoints[t+1];return(new At(n[0]-e[0],n[1]-e[1]).normalize().angle()*180/Math.PI-90+360)%360}changeCameraToPathUp(t){return kt(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 i=Math.abs(e-this.bmap.context.control.getAzimuthalAngle());if(i<.01)return;let{control:o}=this.bmap.context,u=t/Math.PI*6*i;return Ya(new Promise(l=>{let c={azimuthal:o.getAzimuthalAngle()},p={azimuthal:e},m=o.getPolarAngle(),{maxPolarAngle:g,minPolarAngle:P}=o;o.maxPolarAngle=m,o.minPolarAngle=m;let v=new Ra(c,this.tweenUtil.group).to(p,u).easing(pp.Quadratic.InOut).onUpdate(()=>kt(this,null,function*(){this.startPoi&&o.target.copy(this.startPoi.position),o.setAzimuthalAngle(c.azimuthal,!0),o.setTargetByOffset(this.options.offsetY)})).onComplete(()=>{o.enabled=!0,this.tweenUtil.remove(v),o.maxPolarAngle=g,o.minPolarAngle=P,l(!0)}).onStart(()=>{o.enabled=!1}).start()}),u+500).finally(()=>{this.bmap.context.control.enabled=!0})})}initNavigationCamera(t){return kt(this,null,function*(){t===void 0&&(t=1e3);var e;let i=(e=this.taskQueue.getTasks().find(u=>u.meta.type==="initNavigationCamera"))==null?void 0:e.tid,o={run:()=>Ya(kt(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"}};i?this.taskQueue.replace(i,o):this.taskQueue.add(o)})}translateCameraToStartPoi(t){return kt(this,null,function*(){if(t===void 0&&(t=100),!this.startPoi)return;let{clientSize:{width:e,height:n},camera:i,control:o}=this.bmap.context,u=Math.round(e/2),l=Math.round(n/2),c=o.target.clone(),p=tn(this.startPoi.position,i,e,n),m=p.x-u,g=l-p.y+this.options.offsetY;if(!(Math.abs(m)<=1&&Math.abs(g)<=1)){if(Math.abs(m)>=1){let P=new K;P.setFromMatrixColumn(i.matrix,0),P.normalize(),P.multiplyScalar(m/i.zoom),c.add(new K(P.x,P.y,0))}if(Math.abs(g)>=1){let P=new K;P.setFromMatrixColumn(i.matrix,1),P.normalize(),P.multiplyScalar(g/i.zoom),c.add(new K(P.x,P.y,0))}return Ya(new Promise(P=>{let v=o.target.clone();console.log(v,c,t);let S=new Ra(v,this.tweenUtil.group).to(c,t).onUpdate(()=>{this.bmap.context.control.setCameraPositionByTarget(v,0)}).onComplete(()=>{this.bmap.context.control.setCameraPositionByTarget(c,0),this.tweenUtil.remove(S),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 kt(this,null,function*(){if(t===void 0&&(t=100),!this.startPoi)return;let{clientSize:{width:e,height:n},currentFloor:i}=this.bmap.context,{max:o,min:u}=i.box,c=Math.min(e/(o.x-u.x),n/(o.y-u.y))*(o.x-u.x)/this.options.navigationCameraBasic;return this.bmap.context.setZoom(c,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 kt(this,null,function*(){let{currentPathPosition:n,curFloorPath:i,curFloorPathPoints:o}=this;if(!i||!n)return null;let u=this.movedDistance,l=Ax(o,t);if(u===-1||l===-1||l<=u)return null;let c=l-u;if(!c)return;let p=Math.min(c/e,this.options.runAnimationMaxTime);return this.pathTween&&this.clearTween(),Ya(new Promise(m=>{let g=this.pathTween=new Ra({distance:0},this.tweenUtil.group).to({distance:c},p*1e3).onUpdate(P=>kt(this,null,function*(){this.moveDistance(P.distance+u,g)})).onComplete(()=>{this.tweenUtil.remove(g),m(!0)}).start()}),p*1e3+500).finally(()=>{this.bmap.context.control.enabled=!0})})}moveDistance(t,e){return kt(this,null,function*(){if(this.movedDistance=t,!this.options.disablePathShorten){var n;(n=this.path)==null||n.movePath(this.movedDistance/this.curFloorPathLength)}let i=lp(this.curFloorPathPoints,this.movedDistance);if(i===null)return;this.currentPathPosition=i;let o=this.translatePoints([i])[0];this.startPoi&&(this.setStartPoiPosition(o[0],o[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 ji(this.bmap.context,ae({},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 Wd(this.bmap.context,new K(e.x,e.y,.51),new K(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,i=(360-t-n)%360;this.detachStartPoi&&(this.detachStartPoi.options.icon_rotate=i),this.startPoi&&(this.startPoi.options.icon_rotate=i,this.startRotateHelperPoi&&this.startRotateHelperPoi.setAngle(i))}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(),z0.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 R0,this.taskQueue=new fp,this.animationPathOptions={cPathIndex:0},this.cPath=[],this.onNavigationInfo=i=>{let{info:o}=i;if(this.dispatchEvent({type:"navigation-info",info:o}),!o.offset){if(o.routeIndex!==this.curPathIndex)return;this.toPointPosition=o.pos,this.toPositionByTask(o.pos)}},this.onUpdate=()=>{this.tweenUtil.update()},this.onSwitchFloor=i=>{let{data:{curFloor:o}}=i;if(this.clearTween(),this.paths[this.curPathIndex]){let u=this.paths[this.curPathIndex];this.setCurFloorPath(u!=null?u:null),u?this.renderPath(this.translatePoints(u.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({},JTt,n),this.positionNavigation=new q1(this,ae({simulationSpeed:this.options.speed},this.options.positionNavigation),this.options.roadData),this.registryEvent()}};var Gre=et(Ke(),1);var SI=class extends pa{show(t,e){let n=0;t.forEach(u=>{u.poiLayer2.pois.forEach(l=>{l.position.setZ(l.position.z+n+u.groundMaxHeight),l.options.depth_test=!0,this.poiLayer.pushPoi(l)}),u.poiLayer2.pois.length=0,u.poiLayer2.dispose(),u.position.z=n,n+=u.userData.height});let{scene:i,currentFloor:o}=this.bmap.context;i.background=new Se((e==null?void 0:e.backgroundColor)||"#f1f7f6"),o&&(i.remove(o),o.dispose()),this.group.add(this.poiLayer,...t),i.add(this.group),this.floors=t,this.fitCamera(),this.bmap.context.cameraBound.updateBox(),this.showStatus=!0}hide(){let{scene:t}=this.bmap.context;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);let i=t.camera.zoom;t.control.minZoom=i,t.control.maxZoom=i*25,n==="3d"&&t.fitCameraToObject(this.group,e.defaultPadding,0,!1),this.bmap.basicZoom=t.camera.zoom,t.control.addEventListener("change",this.bmap.onControlChange.bind(this.bmap)),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 us,this.showStatus=!1,this.group.name="mul-floor-group",this.poiLayer=new _p(t.context),this.poiLayer.changeParkingSpaceVisibleByZoom=()=>{let e=new $e().setFromObject(this.group),{clientSize:{width:n,height:i}}=this.bmap.context,{max:o,min:u}=e,c=Math.min(n/(o.x-u.x),i/(o.y-u.y))*(o.x-u.x)/45;this.poiLayer.pois.filter(p=>p.userData.type==="parkingSpace").map(p=>{let m=this.bmap.context.camera.zoom>=c;p.visible=m,m||p.parentSetVisible(m)})}}};function TI(){let r=new Blob([`var fU=Object.create;var rE=Object.defineProperty;var hU=Object.getOwnPropertyDescriptor;var pU=Object.getOwnPropertyNames;var dU=Object.getPrototypeOf,gU=Object.prototype.hasOwnProperty;var ot=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var mU=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of pU(t))!gU.call(n,s)&&s!==e&&rE(n,s,{get:()=>t[s],enumerable:!(o=hU(t,s))||o.enumerable});return n};var Ze=(n,t,e)=>(e=n!=null?fU(dU(n)):{},mU(t||!n||!n.__esModule?rE(e,"default",{value:n,enumerable:!0}):e,n));var op=(n,t,e)=>new Promise((o,s)=>{var c=g=>{try{h(e.next(g))}catch(m){s(m)}},d=g=>{try{h(e.throw(g))}catch(m){s(m)}},h=g=>g.done?o(g.value):Promise.resolve(g.value).then(c,d);h((e=e.apply(n,t)).next())});var oo=ot((Nm,iE)=>{"use strict";var If=function(n){return n&&n.Math===Math&&n};iE.exports=If(typeof globalThis=="object"&&globalThis)||If(typeof window=="object"&&window)||If(typeof self=="object"&&self)||If(typeof global=="object"&&global)||If(typeof Nm=="object"&&Nm)||function(){return this}()||Function("return this")()});var sE=ot((GK,oE)=>{"use strict";oE.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 Di=ot((kK,aE)=>{"use strict";var Om=typeof document=="object"&&document.all;aE.exports=typeof Om=="undefined"&&Om!==void 0?function(n){return typeof n=="function"||n===Om}:function(n){return typeof n=="function"}});var Ea=ot((qK,uE)=>{"use strict";var yU=Di();uE.exports=function(n){return typeof n=="object"?n!==null:yU(n)}});var sp=ot((HK,cE)=>{"use strict";var vU=oo(),lE=Ea(),Dm=vU.document,_U=lE(Dm)&&lE(Dm.createElement);cE.exports=function(n){return _U?Dm.createElement(n):{}}});var pE=ot((VK,hE)=>{"use strict";var xU=sp(),Fm=xU("span").classList,fE=Fm&&Fm.constructor&&Fm.constructor.prototype;hE.exports=fE===Object.prototype?void 0:fE});var gi=ot((WK,dE)=>{"use strict";dE.exports=function(n){try{return!!n()}catch(t){return!0}}});var Rf=ot((XK,gE)=>{"use strict";var EU=gi();gE.exports=!EU(function(){var n=function(){}.bind();return typeof n!="function"||n.hasOwnProperty("prototype")})});var mi=ot((YK,vE)=>{"use strict";var mE=Rf(),yE=Function.prototype,Um=yE.call,wU=mE&&yE.bind.bind(Um,Um);vE.exports=mE?wU:function(n){return function(){return Um.apply(n,arguments)}}});var ec=ot(($K,xE)=>{"use strict";var _E=mi(),SU=_E({}.toString),MU=_E("".slice);xE.exports=function(n){return MU(SU(n),8,-1)}});var wE=ot((ZK,EE)=>{"use strict";var bU=mi(),AU=gi(),TU=ec(),Bm=Object,CU=bU("".split);EE.exports=AU(function(){return!Bm("z").propertyIsEnumerable(0)})?function(n){return TU(n)==="String"?CU(n,""):Bm(n)}:Bm});var ap=ot((JK,SE)=>{"use strict";SE.exports=function(n){return n==null}});var nc=ot((KK,ME)=>{"use strict";var PU=ap(),IU=TypeError;ME.exports=function(n){if(PU(n))throw new IU("Can't call method on "+n);return n}});var rc=ot((jK,bE)=>{"use strict";var RU=wE(),LU=nc();bE.exports=function(n){return RU(LU(n))}});var Lf=ot((QK,AE)=>{"use strict";AE.exports=!1});var up=ot((tj,CE)=>{"use strict";var TE=oo(),NU=Object.defineProperty;CE.exports=function(n,t){try{NU(TE,n,{value:t,configurable:!0,writable:!0})}catch(e){TE[n]=t}return t}});var lp=ot((ej,RE)=>{"use strict";var OU=Lf(),DU=oo(),FU=up(),PE="__core-js_shared__",IE=RE.exports=DU[PE]||FU(PE,{});(IE.versions||(IE.versions=[])).push({version:"3.41.0",mode:OU?"pure":"global",copyright:"\\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.41.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var cp=ot((nj,NE)=>{"use strict";var LE=lp();NE.exports=function(n,t){return LE[n]||(LE[n]=t||{})}});var ic=ot((rj,OE)=>{"use strict";var UU=nc(),BU=Object;OE.exports=function(n){return BU(UU(n))}});var wa=ot((ij,DE)=>{"use strict";var zU=mi(),GU=ic(),kU=zU({}.hasOwnProperty);DE.exports=Object.hasOwn||function(t,e){return kU(GU(t),e)}});var zm=ot((oj,FE)=>{"use strict";var qU=mi(),HU=0,VU=Math.random(),WU=qU(1 .toString);FE.exports=function(n){return"Symbol("+(n===void 0?"":n)+")_"+WU(++HU+VU,36)}});var GE=ot((sj,zE)=>{"use strict";var XU=oo(),UE=XU.navigator,BE=UE&&UE.userAgent;zE.exports=BE?String(BE):""});var YE=ot((aj,XE)=>{"use strict";var WE=oo(),Gm=GE(),kE=WE.process,qE=WE.Deno,HE=kE&&kE.versions||qE&&qE.version,VE=HE&&HE.v8,Xs,fp;VE&&(Xs=VE.split("."),fp=Xs[0]>0&&Xs[0]<4?1:+(Xs[0]+Xs[1]));!fp&&Gm&&(Xs=Gm.match(/Edge\\/(\\d+)/),(!Xs||Xs[1]>=74)&&(Xs=Gm.match(/Chrome\\/(\\d+)/),Xs&&(fp=+Xs[1])));XE.exports=fp});var km=ot((uj,ZE)=>{"use strict";var $E=YE(),YU=gi(),$U=oo(),ZU=$U.String;ZE.exports=!!Object.getOwnPropertySymbols&&!YU(function(){var n=Symbol("symbol detection");return!ZU(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&$E&&$E<41})});var qm=ot((lj,JE)=>{"use strict";var JU=km();JE.exports=JU&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Rs=ot((cj,jE)=>{"use strict";var KU=oo(),jU=cp(),KE=wa(),QU=zm(),tB=km(),eB=qm(),oc=KU.Symbol,Hm=jU("wks"),nB=eB?oc.for||oc:oc&&oc.withoutSetter||QU;jE.exports=function(n){return KE(Hm,n)||(Hm[n]=tB&&KE(oc,n)?oc[n]:nB("Symbol."+n)),Hm[n]}});var Sa=ot((fj,QE)=>{"use strict";var rB=Ea(),iB=String,oB=TypeError;QE.exports=function(n){if(rB(n))return n;throw new oB(iB(n)+" is not an object")}});var Ys=ot((hj,tw)=>{"use strict";var sB=gi();tw.exports=!sB(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var Vm=ot((pj,ew)=>{"use strict";var aB=Ys(),uB=gi();ew.exports=aB&&uB(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var Wm=ot((dj,nw)=>{"use strict";var lB=Ys(),cB=gi(),fB=sp();nw.exports=!lB&&!cB(function(){return Object.defineProperty(fB("div"),"a",{get:function(){return 7}}).a!==7})});var Ls=ot((gj,rw)=>{"use strict";var hB=Rf(),hp=Function.prototype.call;rw.exports=hB?hp.bind(hp):function(){return hp.apply(hp,arguments)}});var sc=ot((mj,iw)=>{"use strict";var Xm=oo(),pB=Di(),dB=function(n){return pB(n)?n:void 0};iw.exports=function(n,t){return arguments.length<2?dB(Xm[n]):Xm[n]&&Xm[n][t]}});var sw=ot((yj,ow)=>{"use strict";var gB=mi();ow.exports=gB({}.isPrototypeOf)});var Ym=ot((vj,aw)=>{"use strict";var mB=sc(),yB=Di(),vB=sw(),_B=qm(),xB=Object;aw.exports=_B?function(n){return typeof n=="symbol"}:function(n){var t=mB("Symbol");return yB(t)&&vB(t.prototype,xB(n))}});var lw=ot((_j,uw)=>{"use strict";var EB=String;uw.exports=function(n){try{return EB(n)}catch(t){return"Object"}}});var Nf=ot((xj,cw)=>{"use strict";var wB=Di(),SB=lw(),MB=TypeError;cw.exports=function(n){if(wB(n))return n;throw new MB(SB(n)+" is not a function")}});var pp=ot((Ej,fw)=>{"use strict";var bB=Nf(),AB=ap();fw.exports=function(n,t){var e=n[t];return AB(e)?void 0:bB(e)}});var pw=ot((wj,hw)=>{"use strict";var $m=Ls(),Zm=Di(),Jm=Ea(),TB=TypeError;hw.exports=function(n,t){var e,o;if(t==="string"&&Zm(e=n.toString)&&!Jm(o=$m(e,n))||Zm(e=n.valueOf)&&!Jm(o=$m(e,n))||t!=="string"&&Zm(e=n.toString)&&!Jm(o=$m(e,n)))return o;throw new TB("Can't convert object to primitive value")}});var yw=ot((Sj,mw)=>{"use strict";var CB=Ls(),dw=Ea(),gw=Ym(),PB=pp(),IB=pw(),RB=Rs(),LB=TypeError,NB=RB("toPrimitive");mw.exports=function(n,t){if(!dw(n)||gw(n))return n;var e=PB(n,NB),o;if(e){if(t===void 0&&(t="default"),o=CB(e,n,t),!dw(o)||gw(o))return o;throw new LB("Can't convert object to primitive value")}return t===void 0&&(t="number"),IB(n,t)}});var Km=ot((Mj,vw)=>{"use strict";var OB=yw(),DB=Ym();vw.exports=function(n){var t=OB(n,"string");return DB(t)?t:t+""}});var Iu=ot(xw=>{"use strict";var FB=Ys(),UB=Wm(),BB=Vm(),dp=Sa(),_w=Km(),zB=TypeError,jm=Object.defineProperty,GB=Object.getOwnPropertyDescriptor,Qm="enumerable",t0="configurable",e0="writable";xw.f=FB?BB?function(t,e,o){if(dp(t),e=_w(e),dp(o),typeof t=="function"&&e==="prototype"&&"value"in o&&e0 in o&&!o[e0]){var s=GB(t,e);s&&s[e0]&&(t[e]=o.value,o={configurable:t0 in o?o[t0]:s[t0],enumerable:Qm in o?o[Qm]:s[Qm],writable:!1})}return jm(t,e,o)}:jm:function(t,e,o){if(dp(t),e=_w(e),dp(o),UB)try{return jm(t,e,o)}catch(s){}if("get"in o||"set"in o)throw new zB("Accessors not supported");return"value"in o&&(t[e]=o.value),t}});var ww=ot((Aj,Ew)=>{"use strict";var kB=Math.ceil,qB=Math.floor;Ew.exports=Math.trunc||function(t){var e=+t;return(e>0?qB:kB)(e)}});var ml=ot((Tj,Sw)=>{"use strict";var HB=ww();Sw.exports=function(n){var t=+n;return t!==t||t===0?0:HB(t)}});var bw=ot((Cj,Mw)=>{"use strict";var VB=ml(),WB=Math.max,XB=Math.min;Mw.exports=function(n,t){var e=VB(n);return e<0?WB(e+t,0):XB(e,t)}});var n0=ot((Pj,Aw)=>{"use strict";var YB=ml(),$B=Math.min;Aw.exports=function(n){var t=YB(n);return t>0?$B(t,9007199254740991):0}});var Of=ot((Ij,Tw)=>{"use strict";var ZB=n0();Tw.exports=function(n){return ZB(n.length)}});var Iw=ot((Rj,Pw)=>{"use strict";var JB=rc(),KB=bw(),jB=Of(),Cw=function(n){return function(t,e,o){var s=JB(t),c=jB(s);if(c===0)return!n&&-1;var d=KB(o,c),h;if(n&&e!==e){for(;c>d;)if(h=s[d++],h!==h)return!0}else for(;c>d;d++)if((n||d in s)&&s[d]===e)return n||d||0;return!n&&-1}};Pw.exports={includes:Cw(!0),indexOf:Cw(!1)}});var gp=ot((Lj,Rw)=>{"use strict";Rw.exports={}});var i0=ot((Nj,Nw)=>{"use strict";var QB=mi(),r0=wa(),tz=rc(),ez=Iw().indexOf,nz=gp(),Lw=QB([].push);Nw.exports=function(n,t){var e=tz(n),o=0,s=[],c;for(c in e)!r0(nz,c)&&r0(e,c)&&Lw(s,c);for(;t.length>o;)r0(e,c=t[o++])&&(~ez(s,c)||Lw(s,c));return s}});var mp=ot((Oj,Ow)=>{"use strict";Ow.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Fw=ot((Dj,Dw)=>{"use strict";var rz=i0(),iz=mp();Dw.exports=Object.keys||function(t){return rz(t,iz)}});var Bw=ot(Uw=>{"use strict";var oz=Ys(),sz=Vm(),az=Iu(),uz=Sa(),lz=rc(),cz=Fw();Uw.f=oz&&!sz?Object.defineProperties:function(t,e){uz(t);for(var o=lz(e),s=cz(e),c=s.length,d=0,h;c>d;)az.f(t,h=s[d++],o[h]);return t}});var Gw=ot((Uj,zw)=>{"use strict";var fz=sc();zw.exports=fz("document","documentElement")});var yp=ot((Bj,qw)=>{"use strict";var hz=cp(),pz=zm(),kw=hz("keys");qw.exports=function(n){return kw[n]||(kw[n]=pz(n))}});var Df=ot((zj,Zw)=>{"use strict";var dz=Sa(),gz=Bw(),Hw=mp(),mz=gp(),yz=Gw(),vz=sp(),_z=yp(),Vw=">",Ww="<",s0="prototype",a0="script",Yw=_z("IE_PROTO"),o0=function(){},$w=function(n){return Ww+a0+Vw+n+Ww+"/"+a0+Vw},Xw=function(n){n.write($w("")),n.close();var t=n.parentWindow.Object;return n=null,t},xz=function(){var n=vz("iframe"),t="java"+a0+":",e;return n.style.display="none",yz.appendChild(n),n.src=String(t),e=n.contentWindow.document,e.open(),e.write($w("document.F=Object")),e.close(),e.F},vp,_p=function(){try{vp=new ActiveXObject("htmlfile")}catch(t){}_p=typeof document!="undefined"?document.domain&&vp?Xw(vp):xz():Xw(vp);for(var n=Hw.length;n--;)delete _p[s0][Hw[n]];return _p()};mz[Yw]=!0;Zw.exports=Object.create||function(t,e){var o;return t!==null?(o0[s0]=dz(t),o=new o0,o0[s0]=null,o[Yw]=t):o=_p(),e===void 0?o:gz.f(o,e)}});var c0=ot((Gj,Jw)=>{"use strict";var Ez=Rs(),wz=Df(),Sz=Iu().f,u0=Ez("unscopables"),l0=Array.prototype;l0[u0]===void 0&&Sz(l0,u0,{configurable:!0,value:wz(null)});Jw.exports=function(n){l0[u0][n]=!0}});var xp=ot((kj,Kw)=>{"use strict";Kw.exports={}});var tS=ot((qj,Qw)=>{"use strict";var Mz=oo(),bz=Di(),jw=Mz.WeakMap;Qw.exports=bz(jw)&&/native code/.test(String(jw))});var Ep=ot((Hj,eS)=>{"use strict";eS.exports=function(n,t){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:t}}});var ac=ot((Vj,nS)=>{"use strict";var Az=Ys(),Tz=Iu(),Cz=Ep();nS.exports=Az?function(n,t,e){return Tz.f(n,t,Cz(1,e))}:function(n,t,e){return n[t]=e,n}});var Mp=ot((Wj,oS)=>{"use strict";var Pz=tS(),iS=oo(),Iz=Ea(),Rz=ac(),f0=wa(),h0=lp(),Lz=yp(),Nz=gp(),rS="Object already initialized",p0=iS.TypeError,Oz=iS.WeakMap,wp,Ff,Sp,Dz=function(n){return Sp(n)?Ff(n):wp(n,{})},Fz=function(n){return function(t){var e;if(!Iz(t)||(e=Ff(t)).type!==n)throw new p0("Incompatible receiver, "+n+" required");return e}};Pz||h0.state?($s=h0.state||(h0.state=new Oz),$s.get=$s.get,$s.has=$s.has,$s.set=$s.set,wp=function(n,t){if($s.has(n))throw new p0(rS);return t.facade=n,$s.set(n,t),t},Ff=function(n){return $s.get(n)||{}},Sp=function(n){return $s.has(n)}):(yl=Lz("state"),Nz[yl]=!0,wp=function(n,t){if(f0(n,yl))throw new p0(rS);return t.facade=n,Rz(n,yl,t),t},Ff=function(n){return f0(n,yl)?n[yl]:{}},Sp=function(n){return f0(n,yl)});var $s,yl;oS.exports={set:wp,get:Ff,has:Sp,enforce:Dz,getterFor:Fz}});var lS=ot(uS=>{"use strict";var sS={}.propertyIsEnumerable,aS=Object.getOwnPropertyDescriptor,Uz=aS&&!sS.call({1:2},1);uS.f=Uz?function(t){var e=aS(this,t);return!!e&&e.enumerable}:sS});var d0=ot(fS=>{"use strict";var Bz=Ys(),zz=Ls(),Gz=lS(),kz=Ep(),qz=rc(),Hz=Km(),Vz=wa(),Wz=Wm(),cS=Object.getOwnPropertyDescriptor;fS.f=Bz?cS:function(t,e){if(t=qz(t),e=Hz(e),Wz)try{return cS(t,e)}catch(o){}if(Vz(t,e))return kz(!zz(Gz.f,t,e),t[e])}});var y0=ot(($j,pS)=>{"use strict";var g0=Ys(),Xz=wa(),hS=Function.prototype,Yz=g0&&Object.getOwnPropertyDescriptor,m0=Xz(hS,"name"),$z=m0&&function(){}.name==="something",Zz=m0&&(!g0||g0&&Yz(hS,"name").configurable);pS.exports={EXISTS:m0,PROPER:$z,CONFIGURABLE:Zz}});var _0=ot((Zj,dS)=>{"use strict";var Jz=mi(),Kz=Di(),v0=lp(),jz=Jz(Function.toString);Kz(v0.inspectSource)||(v0.inspectSource=function(n){return jz(n)});dS.exports=v0.inspectSource});var vS=ot((Jj,yS)=>{"use strict";var E0=mi(),Qz=gi(),tG=Di(),bp=wa(),x0=Ys(),eG=y0().CONFIGURABLE,nG=_0(),mS=Mp(),rG=mS.enforce,iG=mS.get,gS=String,Ap=Object.defineProperty,oG=E0("".slice),sG=E0("".replace),aG=E0([].join),uG=x0&&!Qz(function(){return Ap(function(){},"length",{value:8}).length!==8}),lG=String(String).split("String"),cG=yS.exports=function(n,t,e){oG(gS(t),0,7)==="Symbol("&&(t="["+sG(gS(t),/^Symbol\\(([^)]*)\\).*$/,"$1")+"]"),e&&e.getter&&(t="get "+t),e&&e.setter&&(t="set "+t),(!bp(n,"name")||eG&&n.name!==t)&&(x0?Ap(n,"name",{value:t,configurable:!0}):n.name=t),uG&&e&&bp(e,"arity")&&n.length!==e.arity&&Ap(n,"length",{value:e.arity});try{e&&bp(e,"constructor")&&e.constructor?x0&&Ap(n,"prototype",{writable:!1}):n.prototype&&(n.prototype=void 0)}catch(s){}var o=rG(n);return bp(o,"source")||(o.source=aG(lG,typeof t=="string"?t:"")),n};Function.prototype.toString=cG(function(){return tG(this)&&iG(this).source||nG(this)},"toString")});var Uf=ot((Kj,_S)=>{"use strict";var fG=Di(),hG=Iu(),pG=vS(),dG=up();_S.exports=function(n,t,e,o){o||(o={});var s=o.enumerable,c=o.name!==void 0?o.name:t;if(fG(e)&&pG(e,c,o),o.global)s?n[t]=e:dG(t,e);else{try{o.unsafe?n[t]&&(s=!0):delete n[t]}catch(d){}s?n[t]=e:hG.f(n,t,{value:e,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return n}});var ES=ot(xS=>{"use strict";var gG=i0(),mG=mp(),yG=mG.concat("length","prototype");xS.f=Object.getOwnPropertyNames||function(t){return gG(t,yG)}});var SS=ot(wS=>{"use strict";wS.f=Object.getOwnPropertySymbols});var bS=ot((tQ,MS)=>{"use strict";var vG=sc(),_G=mi(),xG=ES(),EG=SS(),wG=Sa(),SG=_G([].concat);MS.exports=vG("Reflect","ownKeys")||function(t){var e=xG.f(wG(t)),o=EG.f;return o?SG(e,o(t)):e}});var CS=ot((eQ,TS)=>{"use strict";var AS=wa(),MG=bS(),bG=d0(),AG=Iu();TS.exports=function(n,t,e){for(var o=MG(t),s=AG.f,c=bG.f,d=0;d<o.length;d++){var h=o[d];!AS(n,h)&&!(e&&AS(e,h))&&s(n,h,c(t,h))}}});var IS=ot((nQ,PS)=>{"use strict";var TG=gi(),CG=Di(),PG=/#|\\.prototype\\./,Bf=function(n,t){var e=RG[IG(n)];return e===NG?!0:e===LG?!1:CG(t)?TG(t):!!t},IG=Bf.normalize=function(n){return String(n).replace(PG,".").toLowerCase()},RG=Bf.data={},LG=Bf.NATIVE="N",NG=Bf.POLYFILL="P";PS.exports=Bf});var Ns=ot((rQ,RS)=>{"use strict";var Tp=oo(),OG=d0().f,DG=ac(),FG=Uf(),UG=up(),BG=CS(),zG=IS();RS.exports=function(n,t){var e=n.target,o=n.global,s=n.stat,c,d,h,g,m,_;if(o?d=Tp:s?d=Tp[e]||UG(e,{}):d=Tp[e]&&Tp[e].prototype,d)for(h in t){if(m=t[h],n.dontCallGetSet?(_=OG(d,h),g=_&&_.value):g=d[h],c=zG(o?h:e+(s?".":"#")+h,n.forced),!c&&g!==void 0){if(typeof m==typeof g)continue;BG(m,g)}(n.sham||g&&g.sham)&&DG(m,"sham",!0),FG(d,h,m,n)}}});var NS=ot((iQ,LS)=>{"use strict";var GG=gi();LS.exports=!GG(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype})});var S0=ot((oQ,DS)=>{"use strict";var kG=wa(),qG=Di(),HG=ic(),VG=yp(),WG=NS(),OS=VG("IE_PROTO"),w0=Object,XG=w0.prototype;DS.exports=WG?w0.getPrototypeOf:function(n){var t=HG(n);if(kG(t,OS))return t[OS];var e=t.constructor;return qG(e)&&t instanceof e?e.prototype:t instanceof w0?XG:null}});var T0=ot((sQ,BS)=>{"use strict";var YG=gi(),$G=Di(),ZG=Ea(),JG=Df(),FS=S0(),KG=Uf(),jG=Rs(),QG=Lf(),A0=jG("iterator"),US=!1,tu,M0,b0;[].keys&&(b0=[].keys(),"next"in b0?(M0=FS(FS(b0)),M0!==Object.prototype&&(tu=M0)):US=!0);var t4=!ZG(tu)||YG(function(){var n={};return tu[A0].call(n)!==n});t4?tu={}:QG&&(tu=JG(tu));$G(tu[A0])||KG(tu,A0,function(){return this});BS.exports={IteratorPrototype:tu,BUGGY_SAFARI_ITERATORS:US}});var Cp=ot((aQ,GS)=>{"use strict";var e4=Iu().f,n4=wa(),r4=Rs(),zS=r4("toStringTag");GS.exports=function(n,t,e){n&&!e&&(n=n.prototype),n&&!n4(n,zS)&&e4(n,zS,{configurable:!0,value:t})}});var qS=ot((uQ,kS)=>{"use strict";var i4=T0().IteratorPrototype,o4=Df(),s4=Ep(),a4=Cp(),u4=xp(),l4=function(){return this};kS.exports=function(n,t,e,o){var s=t+" Iterator";return n.prototype=o4(i4,{next:s4(+!o,e)}),a4(n,s,!1,!0),u4[s]=l4,n}});var C0=ot((lQ,HS)=>{"use strict";var c4=mi(),f4=Nf();HS.exports=function(n,t,e){try{return c4(f4(Object.getOwnPropertyDescriptor(n,t)[e]))}catch(o){}}});var WS=ot((cQ,VS)=>{"use strict";var h4=Ea();VS.exports=function(n){return h4(n)||n===null}});var YS=ot((fQ,XS)=>{"use strict";var p4=WS(),d4=String,g4=TypeError;XS.exports=function(n){if(p4(n))return n;throw new g4("Can't set "+d4(n)+" as a prototype")}});var ZS=ot((hQ,$S)=>{"use strict";var m4=C0(),y4=Ea(),v4=nc(),_4=YS();$S.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var n=!1,t={},e;try{e=m4(Object.prototype,"__proto__","set"),e(t,[]),n=t instanceof Array}catch(o){}return function(s,c){return v4(s),_4(c),y4(s)&&(n?e(s,c):s.__proto__=c),s}}():void 0)});var sM=ot((pQ,oM)=>{"use strict";var x4=Ns(),E4=Ls(),Pp=Lf(),rM=y0(),w4=Di(),S4=qS(),JS=S0(),KS=ZS(),M4=Cp(),b4=ac(),P0=Uf(),A4=Rs(),jS=xp(),iM=T0(),T4=rM.PROPER,C4=rM.CONFIGURABLE,QS=iM.IteratorPrototype,Ip=iM.BUGGY_SAFARI_ITERATORS,zf=A4("iterator"),tM="keys",Gf="values",eM="entries",nM=function(){return this};oM.exports=function(n,t,e,o,s,c,d){S4(e,t,o);var h=function(E){if(E===s&&x)return x;if(!Ip&&E&&E in _)return _[E];switch(E){case tM:return function(){return new e(this,E)};case Gf:return function(){return new e(this,E)};case eM:return function(){return new e(this,E)}}return function(){return new e(this)}},g=t+" Iterator",m=!1,_=n.prototype,w=_[zf]||_["@@iterator"]||s&&_[s],x=!Ip&&w||h(s),b=t==="Array"&&_.entries||w,T,I,S;if(b&&(T=JS(b.call(new n)),T!==Object.prototype&&T.next&&(!Pp&&JS(T)!==QS&&(KS?KS(T,QS):w4(T[zf])||P0(T,zf,nM)),M4(T,g,!0,!0),Pp&&(jS[g]=nM))),T4&&s===Gf&&w&&w.name!==Gf&&(!Pp&&C4?b4(_,"name",Gf):(m=!0,x=function(){return E4(w,this)})),s)if(I={values:h(Gf),keys:c?x:h(tM),entries:h(eM)},d)for(S in I)(Ip||m||!(S in _))&&P0(_,S,I[S]);else x4({target:t,proto:!0,forced:Ip||m},I);return(!Pp||d)&&_[zf]!==x&&P0(_,zf,x,{name:s}),jS[t]=x,I}});var uM=ot((dQ,aM)=>{"use strict";aM.exports=function(n,t){return{value:n,done:t}}});var dM=ot((gQ,pM)=>{"use strict";var P4=rc(),I0=c0(),lM=xp(),fM=Mp(),I4=Iu().f,R4=sM(),Rp=uM(),L4=Lf(),N4=Ys(),hM="Array Iterator",O4=fM.set,D4=fM.getterFor(hM);pM.exports=R4(Array,"Array",function(n,t){O4(this,{type:hM,target:P4(n),index:0,kind:t})},function(){var n=D4(this),t=n.target,e=n.index++;if(!t||e>=t.length)return n.target=null,Rp(void 0,!0);switch(n.kind){case"keys":return Rp(e,!1);case"values":return Rp(t[e],!1)}return Rp([e,t[e]],!1)},"values");var cM=lM.Arguments=lM.Array;I0("keys");I0("values");I0("entries");if(!L4&&N4&&cM.name!=="values")try{I4(cM,"name",{value:"values"})}catch(n){}});var Np=ot(()=>{"use strict";var gM=oo(),yM=sE(),F4=pE(),kf=dM(),mM=ac(),U4=Cp(),B4=Rs(),R0=B4("iterator"),L0=kf.values,vM=function(n,t){if(n){if(n[R0]!==L0)try{mM(n,R0,L0)}catch(o){n[R0]=L0}if(U4(n,t,!0),yM[t]){for(var e in kf)if(n[e]!==kf[e])try{mM(n,e,kf[e])}catch(o){n[e]=kf[e]}}}};for(Lp in yM)vM(gM[Lp]&&gM[Lp].prototype,Lp);var Lp;vM(F4,"DOMTokenList")});var EM=ot((vQ,xM)=>{"use strict";var z4=Rs(),G4=z4("toStringTag"),_M={};_M[G4]="z";xM.exports=String(_M)==="[object z]"});var N0=ot((_Q,wM)=>{"use strict";var k4=EM(),q4=Di(),Op=ec(),H4=Rs(),V4=H4("toStringTag"),W4=Object,X4=Op(function(){return arguments}())==="Arguments",Y4=function(n,t){try{return n[t]}catch(e){}};wM.exports=k4?Op:function(n){var t,e,o;return n===void 0?"Undefined":n===null?"Null":typeof(e=Y4(t=W4(n),V4))=="string"?e:X4?Op(t):(o=Op(t))==="Object"&&q4(t.callee)?"Arguments":o}});var Dp=ot((xQ,SM)=>{"use strict";var $4=N0(),Z4=String;SM.exports=function(n){if($4(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Z4(n)}});var bM=ot((EQ,MM)=>{"use strict";var J4=Sa();MM.exports=function(){var n=J4(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 TM=ot((wQ,AM)=>{"use strict";var O0=gi(),K4=oo(),D0=K4.RegExp,F0=O0(function(){var n=D0("a","y");return n.lastIndex=2,n.exec("abcd")!==null}),j4=F0||O0(function(){return!D0("a","y").sticky}),Q4=F0||O0(function(){var n=D0("^r","gy");return n.lastIndex=2,n.exec("str")!==null});AM.exports={BROKEN_CARET:Q4,MISSED_STICKY:j4,UNSUPPORTED_Y:F0}});var PM=ot((SQ,CM)=>{"use strict";var tk=gi(),ek=oo(),nk=ek.RegExp;CM.exports=tk(function(){var n=nk(".","s");return!(n.dotAll&&n.test(\`
8114
+ `,document.body.appendChild(r.canvas)}setAngle(t){if(console.log("angle",t),r.textureMap.has(t))this._initIcon(r.textureMap.get(t));else{this.draw(t);let e=this.getTexture(this.getImageData());r.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 Fh(new Sc({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}=r,{config:{size:n}}=this,i=n[0]/2,o=n[1]/2,u=4,l=1,c=u+l;if(e.clearRect(0,0,n[0],n[1]),e.setLineDash([10,10]),e.strokeStyle="#fff",e.lineWidth=2,e.beginPath(),e.arc(i,o,o-c,-Math.PI/2,Math.PI*2-Math.PI/2,t<Math.PI),e.stroke(),e.strokeStyle="#0A7AFF",t<Math.PI){let p=-Math.PI/2,m=p-t;e.beginPath(),e.arc(i,o,o-c,p,m,!0)}else{let p=-Math.PI/2,m=p+Math.PI*2-t;e.beginPath(),e.arc(i,o,o-c,p,m,!1)}e.stroke(),e.clearRect(i-c*2,0,c*4,c*4),e.beginPath(),e.arc(i,c,u,0,Math.PI*2),e.fillStyle="#0A7AFF",e.fill(),e.setLineDash([10,0]),e.strokeStyle="#fff",e.lineWidth=l,e.stroke(),e.clearRect(0,o-5,10,10),e.clearRect(i-5,n[1]-10,10,10),e.clearRect(n[0]-10,o-5,10,10),t>Math.PI/2&&t<Math.PI?e.fillStyle="#0A7AFF":e.fillStyle="#fff",e.fillRect(0,o-1,10,2),e.fillStyle="#fff",e.fillRect(i-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,o-1,10,2)}getImageData(){let{ctx:t}=r,{config:{size:e}}=this;return t.getImageData(0,0,e[0],e[1])}getTexture(t){let{config:{size:e}}=this,n=new Da(Uint8Array.from(t.data),e[0],e[1],si);return n.format=si,n.magFilter=sn,n.minFilter=sn,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,r.canvas.width=e.size[0],r.canvas.height=e.size[1]}};z0.canvas=document.createElement("canvas");z0.ctx=z0.canvas.getContext("2d",{willReadFrequently:!0});z0.textureMap=new Map;var JTt={path:{},cheapMaximumDistance:20,needStartPoi:!1,startPoi:{},positionNavigation:{},offsetY:150,directionEmitThreshold:5,disablePathAnimation:!1,disablePathRotate:!1,disablePathShorten:!1,speed:1,roadData:[],runAnimationMaxTime:1,navigationCameraBasic:45},AI=class extends pa{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(Ho.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 z0(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 i=(e=this.taskQueue.getTasks().find(u=>u.meta.type==="toPosition"))==null?void 0:e.tid,o={run:()=>this.toPositionBySpeed(t,this.options.speed),meta:{type:"toPosition"}};i?this.taskQueue.replace(i,o):this.taskQueue.add(o)}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(Ho.SWITCH_FLOOR_GROUND,this.onSwitchFloor),this.positionNavigation.removeEventListener("navigation-info",this.onNavigationInfo),this.bmap.context.removeEventListener("control-change",this.onControlChangeForStartPoi)}clearPath(){if(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}}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();let i=(n=this.bmap.context.currentFloor)==null?void 0:n.name,o=t[e];if(i&&(o==null?void 0:o.floor)===i)if(this.setCurFloorPath(o),this.bmap.currentBuildGround)this.renderPath(this.translatePoints(o.points));else{let u=()=>{this.bmap.removeEventListener("center-change",u),this.renderPath(this.translatePoints(o.points))};this.bmap.addEventListener("center-change",u)}else this.clearPath();this.dispatchEvent({type:"add-path",paths:t})}translatePoints(t){let[e,n]=this.bmap.buildingCenter;return t.map(i=>[i[0]-e,i[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 Q1(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 i;(i=this.bmap.context.currentFloor)==null||i.poiLayer2.removePoi(this.startRotateHelperPoi),this.startRotateHelperPoi=null}}if(this.removeDetachStart(),this.showDetachStartState&&this.options.detachStartPoi){var o;this.detachStartPoi=new ji(this.bmap.context,ae({},this.options.detachStartPoi,{id:"navigation_detach_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.detachStartPoi),this.detachLine=new Wd(this.bmap.context,new K(e[0][0],e[0][1],.51),new K(e[0][0],e[0][1],.51)),this.bmap.context.scene.add(this.detachLine)}if(this.options.needStartPoi){var u;this.startPoi=new ji(this.bmap.context,ae({},this.options.startPoi,{id:"navigation_start_poi",position:{x:e[0][0],y:e[0][1],z:.51},collision_enable:!1}))||null,(u=this.bmap.context.currentFloor)==null||u.poiLayer2.pushPoi(this.startPoi),this.needStartRotateHelperPoi&&this.showStartRotateHelperPoi(),console.log(this.startRotateHelperPoi)}this.dispatchEvent({type:"render-path",path:this.path})}catmullRomCurve3(t){return xg(t,!1,!0,.1,170,2.5)}getPathDirection(){if(!this.curFloorPath||!this.currentPathPosition||this.curFloorPathPoints.length<2)return null;let t=Xl(this.curFloorPathPoints,this.currentPathPosition),e=this.curFloorPathPoints[t],n=this.curFloorPathPoints[t+1],i=new K(n[0]-e[0],n[1]-e[1],0).normalize(),o=new K(0,1,0).normalize(),u=i.angleTo(o),l=new K().crossVectors(o,i);return(Object.is(l.y,0)?-1:1)*u}getPathDirection2(){if(!this.curFloorPath||!this.toPointPosition||this.curFloorPathPoints.length<2)return null;let t=Xl(this.curFloorPathPoints,this.toPointPosition),e=this.curFloorPathPoints[t],n=this.curFloorPathPoints[t+1];return(new At(n[0]-e[0],n[1]-e[1]).normalize().angle()*180/Math.PI-90+360)%360}changeCameraToPathUp(t){return kt(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 i=Math.abs(e-this.bmap.context.control.getAzimuthalAngle());if(i<.01)return;let{control:o}=this.bmap.context,u=t/Math.PI*6*i;return Ya(new Promise(l=>{let c={azimuthal:o.getAzimuthalAngle()},p={azimuthal:e},m=o.getPolarAngle(),{maxPolarAngle:g,minPolarAngle:P}=o;o.maxPolarAngle=m,o.minPolarAngle=m;let v=new Ra(c,this.tweenUtil.group).to(p,u).easing(pp.Quadratic.InOut).onUpdate(()=>kt(this,null,function*(){this.startPoi&&o.target.copy(this.startPoi.position),o.setAzimuthalAngle(c.azimuthal,!0),o.setTargetByOffset(this.options.offsetY)})).onComplete(()=>{o.enabled=!0,this.tweenUtil.remove(v),o.maxPolarAngle=g,o.minPolarAngle=P,l(!0)}).onStart(()=>{o.enabled=!1}).start()}),u+500).finally(()=>{this.bmap.context.control.enabled=!0})})}initNavigationCamera(t){return kt(this,null,function*(){t===void 0&&(t=1e3);var e;let i=(e=this.taskQueue.getTasks().find(u=>u.meta.type==="initNavigationCamera"))==null?void 0:e.tid,o={run:()=>Ya(kt(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"}};i?this.taskQueue.replace(i,o):this.taskQueue.add(o)})}translateCameraToStartPoi(t){return kt(this,null,function*(){if(t===void 0&&(t=100),!this.startPoi)return;let{clientSize:{width:e,height:n},camera:i,control:o}=this.bmap.context,u=Math.round(e/2),l=Math.round(n/2),c=o.target.clone(),p=tn(this.startPoi.position,i,e,n),m=p.x-u,g=l-p.y+this.options.offsetY;if(!(Math.abs(m)<=1&&Math.abs(g)<=1)){if(Math.abs(m)>=1){let P=new K;P.setFromMatrixColumn(i.matrix,0),P.normalize(),P.multiplyScalar(m/i.zoom),c.add(new K(P.x,P.y,0))}if(Math.abs(g)>=1){let P=new K;P.setFromMatrixColumn(i.matrix,1),P.normalize(),P.multiplyScalar(g/i.zoom),c.add(new K(P.x,P.y,0))}return Ya(new Promise(P=>{let v=o.target.clone();console.log(v,c,t);let S=new Ra(v,this.tweenUtil.group).to(c,t).onUpdate(()=>{this.bmap.context.control.setCameraPositionByTarget(v,0)}).onComplete(()=>{this.bmap.context.control.setCameraPositionByTarget(c,0),this.tweenUtil.remove(S),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 kt(this,null,function*(){if(t===void 0&&(t=100),!this.startPoi)return;let{clientSize:{width:e,height:n},currentFloor:i}=this.bmap.context,{max:o,min:u}=i.box,c=Math.min(e/(o.x-u.x),n/(o.y-u.y))*(o.x-u.x)/this.options.navigationCameraBasic;return this.bmap.context.setZoom(c,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 kt(this,null,function*(){let{currentPathPosition:n,curFloorPath:i,curFloorPathPoints:o}=this;if(!i||!n)return null;let u=this.movedDistance,l=Ax(o,t);if(u===-1||l===-1||l<=u)return null;let c=l-u;if(!c)return;let p=Math.min(c/e,this.options.runAnimationMaxTime);return this.pathTween&&this.clearTween(),Ya(new Promise(m=>{let g=this.pathTween=new Ra({distance:0},this.tweenUtil.group).to({distance:c},p*1e3).onUpdate(P=>kt(this,null,function*(){this.moveDistance(P.distance+u,g)})).onComplete(()=>{this.tweenUtil.remove(g),m(!0)}).start()}),p*1e3+500).finally(()=>{this.bmap.context.control.enabled=!0})})}moveDistance(t,e){return kt(this,null,function*(){if(this.movedDistance=t,!this.options.disablePathShorten){var n;(n=this.path)==null||n.movePath(this.movedDistance/this.curFloorPathLength)}let i=lp(this.curFloorPathPoints,this.movedDistance);if(i===null)return;this.currentPathPosition=i;let o=this.translatePoints([i])[0];this.startPoi&&(this.setStartPoiPosition(o[0],o[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 ji(this.bmap.context,ae({},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 Wd(this.bmap.context,new K(e.x,e.y,.51),new K(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,i=(360-t-n)%360;this.detachStartPoi&&(this.detachStartPoi.options.icon_rotate=i),this.startPoi&&(this.startPoi.options.icon_rotate=i,this.startRotateHelperPoi&&this.startRotateHelperPoi.setAngle(i))}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(),z0.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 R0,this.taskQueue=new fp,this.animationPathOptions={cPathIndex:0},this.cPath=[],this.onNavigationInfo=i=>{let{info:o}=i;if(this.dispatchEvent({type:"navigation-info",info:o}),!o.offset){if(o.routeIndex!==this.curPathIndex)return;this.toPointPosition=o.pos,this.toPositionByTask(o.pos)}},this.onUpdate=()=>{this.tweenUtil.update()},this.onSwitchFloor=i=>{let{data:{curFloor:o}}=i;if(this.clearTween(),this.paths[this.curPathIndex]){let u=this.paths[this.curPathIndex];this.setCurFloorPath(u!=null?u:null),u?this.renderPath(this.translatePoints(u.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({},JTt,n),this.positionNavigation=new q1(this,ae({simulationSpeed:this.options.speed},this.options.positionNavigation),this.options.roadData),this.registryEvent()}};var Gre=et(Ke(),1);var SI=class extends pa{show(t,e){let n=0;t.forEach(u=>{u.poiLayer2.pois.forEach(l=>{l.position.setZ(l.position.z+n+u.groundMaxHeight),l.options.depth_test=!0,this.poiLayer.pushPoi(l)}),u.poiLayer2.pois.length=0,u.poiLayer2.dispose(),u.position.z=n,n+=u.userData.height});let{scene:i,currentFloor:o}=this.bmap.context;i.background=new Se((e==null?void 0:e.backgroundColor)||"#f1f7f6"),o&&(i.remove(o),o.dispose()),this.group.add(this.poiLayer,...t),i.add(this.group),this.floors=t,this.fitCamera(),this.bmap.context.cameraBound.updateBox(),this.showStatus=!0}hide(){let{scene:t}=this.bmap.context;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);let i=t.camera.zoom;t.control.minZoom=i,t.control.maxZoom=i*25,n==="3d"&&t.fitCameraToObject(this.group,e.defaultPadding,0,!1),this.bmap.basicZoom=t.camera.zoom,t.control.addEventListener("change",this.bmap.onControlChange.bind(this.bmap)),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 us,this.showStatus=!1,this.group.name="mul-floor-group",this.poiLayer=new _p(t.context),this.poiLayer.changeParkingSpaceVisibleByZoom=()=>{let e=new $e().setFromObject(this.group),{clientSize:{width:n,height:i}}=this.bmap.context,{max:o,min:u}=e,c=Math.min(n/(o.x-u.x),i/(o.y-u.y))*(o.x-u.x)/45;this.poiLayer.pois.filter(p=>p.userData.type==="parkingSpace").map(p=>{let m=this.bmap.context.camera.zoom>=c;p.visible=m,m||p.parentSetVisible(m)})}}};function TI(){let r=new Blob([`var fU=Object.create;var rE=Object.defineProperty;var hU=Object.getOwnPropertyDescriptor;var pU=Object.getOwnPropertyNames;var dU=Object.getPrototypeOf,gU=Object.prototype.hasOwnProperty;var ot=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var mU=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of pU(t))!gU.call(n,s)&&s!==e&&rE(n,s,{get:()=>t[s],enumerable:!(o=hU(t,s))||o.enumerable});return n};var Ze=(n,t,e)=>(e=n!=null?fU(dU(n)):{},mU(t||!n||!n.__esModule?rE(e,"default",{value:n,enumerable:!0}):e,n));var op=(n,t,e)=>new Promise((o,s)=>{var c=g=>{try{h(e.next(g))}catch(m){s(m)}},d=g=>{try{h(e.throw(g))}catch(m){s(m)}},h=g=>g.done?o(g.value):Promise.resolve(g.value).then(c,d);h((e=e.apply(n,t)).next())});var oo=ot((Nm,iE)=>{"use strict";var If=function(n){return n&&n.Math===Math&&n};iE.exports=If(typeof globalThis=="object"&&globalThis)||If(typeof window=="object"&&window)||If(typeof self=="object"&&self)||If(typeof global=="object"&&global)||If(typeof Nm=="object"&&Nm)||function(){return this}()||Function("return this")()});var sE=ot((GK,oE)=>{"use strict";oE.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 Di=ot((kK,aE)=>{"use strict";var Om=typeof document=="object"&&document.all;aE.exports=typeof Om=="undefined"&&Om!==void 0?function(n){return typeof n=="function"||n===Om}:function(n){return typeof n=="function"}});var Ea=ot((qK,uE)=>{"use strict";var yU=Di();uE.exports=function(n){return typeof n=="object"?n!==null:yU(n)}});var sp=ot((HK,cE)=>{"use strict";var vU=oo(),lE=Ea(),Dm=vU.document,_U=lE(Dm)&&lE(Dm.createElement);cE.exports=function(n){return _U?Dm.createElement(n):{}}});var pE=ot((VK,hE)=>{"use strict";var xU=sp(),Fm=xU("span").classList,fE=Fm&&Fm.constructor&&Fm.constructor.prototype;hE.exports=fE===Object.prototype?void 0:fE});var gi=ot((WK,dE)=>{"use strict";dE.exports=function(n){try{return!!n()}catch(t){return!0}}});var Rf=ot((XK,gE)=>{"use strict";var EU=gi();gE.exports=!EU(function(){var n=function(){}.bind();return typeof n!="function"||n.hasOwnProperty("prototype")})});var mi=ot((YK,vE)=>{"use strict";var mE=Rf(),yE=Function.prototype,Um=yE.call,wU=mE&&yE.bind.bind(Um,Um);vE.exports=mE?wU:function(n){return function(){return Um.apply(n,arguments)}}});var ec=ot(($K,xE)=>{"use strict";var _E=mi(),SU=_E({}.toString),MU=_E("".slice);xE.exports=function(n){return MU(SU(n),8,-1)}});var wE=ot((ZK,EE)=>{"use strict";var bU=mi(),AU=gi(),TU=ec(),Bm=Object,CU=bU("".split);EE.exports=AU(function(){return!Bm("z").propertyIsEnumerable(0)})?function(n){return TU(n)==="String"?CU(n,""):Bm(n)}:Bm});var ap=ot((JK,SE)=>{"use strict";SE.exports=function(n){return n==null}});var nc=ot((KK,ME)=>{"use strict";var PU=ap(),IU=TypeError;ME.exports=function(n){if(PU(n))throw new IU("Can't call method on "+n);return n}});var rc=ot((jK,bE)=>{"use strict";var RU=wE(),LU=nc();bE.exports=function(n){return RU(LU(n))}});var Lf=ot((QK,AE)=>{"use strict";AE.exports=!1});var up=ot((tj,CE)=>{"use strict";var TE=oo(),NU=Object.defineProperty;CE.exports=function(n,t){try{NU(TE,n,{value:t,configurable:!0,writable:!0})}catch(e){TE[n]=t}return t}});var lp=ot((ej,RE)=>{"use strict";var OU=Lf(),DU=oo(),FU=up(),PE="__core-js_shared__",IE=RE.exports=DU[PE]||FU(PE,{});(IE.versions||(IE.versions=[])).push({version:"3.41.0",mode:OU?"pure":"global",copyright:"\\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.41.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var cp=ot((nj,NE)=>{"use strict";var LE=lp();NE.exports=function(n,t){return LE[n]||(LE[n]=t||{})}});var ic=ot((rj,OE)=>{"use strict";var UU=nc(),BU=Object;OE.exports=function(n){return BU(UU(n))}});var wa=ot((ij,DE)=>{"use strict";var zU=mi(),GU=ic(),kU=zU({}.hasOwnProperty);DE.exports=Object.hasOwn||function(t,e){return kU(GU(t),e)}});var zm=ot((oj,FE)=>{"use strict";var qU=mi(),HU=0,VU=Math.random(),WU=qU(1 .toString);FE.exports=function(n){return"Symbol("+(n===void 0?"":n)+")_"+WU(++HU+VU,36)}});var GE=ot((sj,zE)=>{"use strict";var XU=oo(),UE=XU.navigator,BE=UE&&UE.userAgent;zE.exports=BE?String(BE):""});var YE=ot((aj,XE)=>{"use strict";var WE=oo(),Gm=GE(),kE=WE.process,qE=WE.Deno,HE=kE&&kE.versions||qE&&qE.version,VE=HE&&HE.v8,Xs,fp;VE&&(Xs=VE.split("."),fp=Xs[0]>0&&Xs[0]<4?1:+(Xs[0]+Xs[1]));!fp&&Gm&&(Xs=Gm.match(/Edge\\/(\\d+)/),(!Xs||Xs[1]>=74)&&(Xs=Gm.match(/Chrome\\/(\\d+)/),Xs&&(fp=+Xs[1])));XE.exports=fp});var km=ot((uj,ZE)=>{"use strict";var $E=YE(),YU=gi(),$U=oo(),ZU=$U.String;ZE.exports=!!Object.getOwnPropertySymbols&&!YU(function(){var n=Symbol("symbol detection");return!ZU(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&$E&&$E<41})});var qm=ot((lj,JE)=>{"use strict";var JU=km();JE.exports=JU&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Rs=ot((cj,jE)=>{"use strict";var KU=oo(),jU=cp(),KE=wa(),QU=zm(),tB=km(),eB=qm(),oc=KU.Symbol,Hm=jU("wks"),nB=eB?oc.for||oc:oc&&oc.withoutSetter||QU;jE.exports=function(n){return KE(Hm,n)||(Hm[n]=tB&&KE(oc,n)?oc[n]:nB("Symbol."+n)),Hm[n]}});var Sa=ot((fj,QE)=>{"use strict";var rB=Ea(),iB=String,oB=TypeError;QE.exports=function(n){if(rB(n))return n;throw new oB(iB(n)+" is not an object")}});var Ys=ot((hj,tw)=>{"use strict";var sB=gi();tw.exports=!sB(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var Vm=ot((pj,ew)=>{"use strict";var aB=Ys(),uB=gi();ew.exports=aB&&uB(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var Wm=ot((dj,nw)=>{"use strict";var lB=Ys(),cB=gi(),fB=sp();nw.exports=!lB&&!cB(function(){return Object.defineProperty(fB("div"),"a",{get:function(){return 7}}).a!==7})});var Ls=ot((gj,rw)=>{"use strict";var hB=Rf(),hp=Function.prototype.call;rw.exports=hB?hp.bind(hp):function(){return hp.apply(hp,arguments)}});var sc=ot((mj,iw)=>{"use strict";var Xm=oo(),pB=Di(),dB=function(n){return pB(n)?n:void 0};iw.exports=function(n,t){return arguments.length<2?dB(Xm[n]):Xm[n]&&Xm[n][t]}});var sw=ot((yj,ow)=>{"use strict";var gB=mi();ow.exports=gB({}.isPrototypeOf)});var Ym=ot((vj,aw)=>{"use strict";var mB=sc(),yB=Di(),vB=sw(),_B=qm(),xB=Object;aw.exports=_B?function(n){return typeof n=="symbol"}:function(n){var t=mB("Symbol");return yB(t)&&vB(t.prototype,xB(n))}});var lw=ot((_j,uw)=>{"use strict";var EB=String;uw.exports=function(n){try{return EB(n)}catch(t){return"Object"}}});var Nf=ot((xj,cw)=>{"use strict";var wB=Di(),SB=lw(),MB=TypeError;cw.exports=function(n){if(wB(n))return n;throw new MB(SB(n)+" is not a function")}});var pp=ot((Ej,fw)=>{"use strict";var bB=Nf(),AB=ap();fw.exports=function(n,t){var e=n[t];return AB(e)?void 0:bB(e)}});var pw=ot((wj,hw)=>{"use strict";var $m=Ls(),Zm=Di(),Jm=Ea(),TB=TypeError;hw.exports=function(n,t){var e,o;if(t==="string"&&Zm(e=n.toString)&&!Jm(o=$m(e,n))||Zm(e=n.valueOf)&&!Jm(o=$m(e,n))||t!=="string"&&Zm(e=n.toString)&&!Jm(o=$m(e,n)))return o;throw new TB("Can't convert object to primitive value")}});var yw=ot((Sj,mw)=>{"use strict";var CB=Ls(),dw=Ea(),gw=Ym(),PB=pp(),IB=pw(),RB=Rs(),LB=TypeError,NB=RB("toPrimitive");mw.exports=function(n,t){if(!dw(n)||gw(n))return n;var e=PB(n,NB),o;if(e){if(t===void 0&&(t="default"),o=CB(e,n,t),!dw(o)||gw(o))return o;throw new LB("Can't convert object to primitive value")}return t===void 0&&(t="number"),IB(n,t)}});var Km=ot((Mj,vw)=>{"use strict";var OB=yw(),DB=Ym();vw.exports=function(n){var t=OB(n,"string");return DB(t)?t:t+""}});var Iu=ot(xw=>{"use strict";var FB=Ys(),UB=Wm(),BB=Vm(),dp=Sa(),_w=Km(),zB=TypeError,jm=Object.defineProperty,GB=Object.getOwnPropertyDescriptor,Qm="enumerable",t0="configurable",e0="writable";xw.f=FB?BB?function(t,e,o){if(dp(t),e=_w(e),dp(o),typeof t=="function"&&e==="prototype"&&"value"in o&&e0 in o&&!o[e0]){var s=GB(t,e);s&&s[e0]&&(t[e]=o.value,o={configurable:t0 in o?o[t0]:s[t0],enumerable:Qm in o?o[Qm]:s[Qm],writable:!1})}return jm(t,e,o)}:jm:function(t,e,o){if(dp(t),e=_w(e),dp(o),UB)try{return jm(t,e,o)}catch(s){}if("get"in o||"set"in o)throw new zB("Accessors not supported");return"value"in o&&(t[e]=o.value),t}});var ww=ot((Aj,Ew)=>{"use strict";var kB=Math.ceil,qB=Math.floor;Ew.exports=Math.trunc||function(t){var e=+t;return(e>0?qB:kB)(e)}});var ml=ot((Tj,Sw)=>{"use strict";var HB=ww();Sw.exports=function(n){var t=+n;return t!==t||t===0?0:HB(t)}});var bw=ot((Cj,Mw)=>{"use strict";var VB=ml(),WB=Math.max,XB=Math.min;Mw.exports=function(n,t){var e=VB(n);return e<0?WB(e+t,0):XB(e,t)}});var n0=ot((Pj,Aw)=>{"use strict";var YB=ml(),$B=Math.min;Aw.exports=function(n){var t=YB(n);return t>0?$B(t,9007199254740991):0}});var Of=ot((Ij,Tw)=>{"use strict";var ZB=n0();Tw.exports=function(n){return ZB(n.length)}});var Iw=ot((Rj,Pw)=>{"use strict";var JB=rc(),KB=bw(),jB=Of(),Cw=function(n){return function(t,e,o){var s=JB(t),c=jB(s);if(c===0)return!n&&-1;var d=KB(o,c),h;if(n&&e!==e){for(;c>d;)if(h=s[d++],h!==h)return!0}else for(;c>d;d++)if((n||d in s)&&s[d]===e)return n||d||0;return!n&&-1}};Pw.exports={includes:Cw(!0),indexOf:Cw(!1)}});var gp=ot((Lj,Rw)=>{"use strict";Rw.exports={}});var i0=ot((Nj,Nw)=>{"use strict";var QB=mi(),r0=wa(),tz=rc(),ez=Iw().indexOf,nz=gp(),Lw=QB([].push);Nw.exports=function(n,t){var e=tz(n),o=0,s=[],c;for(c in e)!r0(nz,c)&&r0(e,c)&&Lw(s,c);for(;t.length>o;)r0(e,c=t[o++])&&(~ez(s,c)||Lw(s,c));return s}});var mp=ot((Oj,Ow)=>{"use strict";Ow.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Fw=ot((Dj,Dw)=>{"use strict";var rz=i0(),iz=mp();Dw.exports=Object.keys||function(t){return rz(t,iz)}});var Bw=ot(Uw=>{"use strict";var oz=Ys(),sz=Vm(),az=Iu(),uz=Sa(),lz=rc(),cz=Fw();Uw.f=oz&&!sz?Object.defineProperties:function(t,e){uz(t);for(var o=lz(e),s=cz(e),c=s.length,d=0,h;c>d;)az.f(t,h=s[d++],o[h]);return t}});var Gw=ot((Uj,zw)=>{"use strict";var fz=sc();zw.exports=fz("document","documentElement")});var yp=ot((Bj,qw)=>{"use strict";var hz=cp(),pz=zm(),kw=hz("keys");qw.exports=function(n){return kw[n]||(kw[n]=pz(n))}});var Df=ot((zj,Zw)=>{"use strict";var dz=Sa(),gz=Bw(),Hw=mp(),mz=gp(),yz=Gw(),vz=sp(),_z=yp(),Vw=">",Ww="<",s0="prototype",a0="script",Yw=_z("IE_PROTO"),o0=function(){},$w=function(n){return Ww+a0+Vw+n+Ww+"/"+a0+Vw},Xw=function(n){n.write($w("")),n.close();var t=n.parentWindow.Object;return n=null,t},xz=function(){var n=vz("iframe"),t="java"+a0+":",e;return n.style.display="none",yz.appendChild(n),n.src=String(t),e=n.contentWindow.document,e.open(),e.write($w("document.F=Object")),e.close(),e.F},vp,_p=function(){try{vp=new ActiveXObject("htmlfile")}catch(t){}_p=typeof document!="undefined"?document.domain&&vp?Xw(vp):xz():Xw(vp);for(var n=Hw.length;n--;)delete _p[s0][Hw[n]];return _p()};mz[Yw]=!0;Zw.exports=Object.create||function(t,e){var o;return t!==null?(o0[s0]=dz(t),o=new o0,o0[s0]=null,o[Yw]=t):o=_p(),e===void 0?o:gz.f(o,e)}});var c0=ot((Gj,Jw)=>{"use strict";var Ez=Rs(),wz=Df(),Sz=Iu().f,u0=Ez("unscopables"),l0=Array.prototype;l0[u0]===void 0&&Sz(l0,u0,{configurable:!0,value:wz(null)});Jw.exports=function(n){l0[u0][n]=!0}});var xp=ot((kj,Kw)=>{"use strict";Kw.exports={}});var tS=ot((qj,Qw)=>{"use strict";var Mz=oo(),bz=Di(),jw=Mz.WeakMap;Qw.exports=bz(jw)&&/native code/.test(String(jw))});var Ep=ot((Hj,eS)=>{"use strict";eS.exports=function(n,t){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:t}}});var ac=ot((Vj,nS)=>{"use strict";var Az=Ys(),Tz=Iu(),Cz=Ep();nS.exports=Az?function(n,t,e){return Tz.f(n,t,Cz(1,e))}:function(n,t,e){return n[t]=e,n}});var Mp=ot((Wj,oS)=>{"use strict";var Pz=tS(),iS=oo(),Iz=Ea(),Rz=ac(),f0=wa(),h0=lp(),Lz=yp(),Nz=gp(),rS="Object already initialized",p0=iS.TypeError,Oz=iS.WeakMap,wp,Ff,Sp,Dz=function(n){return Sp(n)?Ff(n):wp(n,{})},Fz=function(n){return function(t){var e;if(!Iz(t)||(e=Ff(t)).type!==n)throw new p0("Incompatible receiver, "+n+" required");return e}};Pz||h0.state?($s=h0.state||(h0.state=new Oz),$s.get=$s.get,$s.has=$s.has,$s.set=$s.set,wp=function(n,t){if($s.has(n))throw new p0(rS);return t.facade=n,$s.set(n,t),t},Ff=function(n){return $s.get(n)||{}},Sp=function(n){return $s.has(n)}):(yl=Lz("state"),Nz[yl]=!0,wp=function(n,t){if(f0(n,yl))throw new p0(rS);return t.facade=n,Rz(n,yl,t),t},Ff=function(n){return f0(n,yl)?n[yl]:{}},Sp=function(n){return f0(n,yl)});var $s,yl;oS.exports={set:wp,get:Ff,has:Sp,enforce:Dz,getterFor:Fz}});var lS=ot(uS=>{"use strict";var sS={}.propertyIsEnumerable,aS=Object.getOwnPropertyDescriptor,Uz=aS&&!sS.call({1:2},1);uS.f=Uz?function(t){var e=aS(this,t);return!!e&&e.enumerable}:sS});var d0=ot(fS=>{"use strict";var Bz=Ys(),zz=Ls(),Gz=lS(),kz=Ep(),qz=rc(),Hz=Km(),Vz=wa(),Wz=Wm(),cS=Object.getOwnPropertyDescriptor;fS.f=Bz?cS:function(t,e){if(t=qz(t),e=Hz(e),Wz)try{return cS(t,e)}catch(o){}if(Vz(t,e))return kz(!zz(Gz.f,t,e),t[e])}});var y0=ot(($j,pS)=>{"use strict";var g0=Ys(),Xz=wa(),hS=Function.prototype,Yz=g0&&Object.getOwnPropertyDescriptor,m0=Xz(hS,"name"),$z=m0&&function(){}.name==="something",Zz=m0&&(!g0||g0&&Yz(hS,"name").configurable);pS.exports={EXISTS:m0,PROPER:$z,CONFIGURABLE:Zz}});var _0=ot((Zj,dS)=>{"use strict";var Jz=mi(),Kz=Di(),v0=lp(),jz=Jz(Function.toString);Kz(v0.inspectSource)||(v0.inspectSource=function(n){return jz(n)});dS.exports=v0.inspectSource});var vS=ot((Jj,yS)=>{"use strict";var E0=mi(),Qz=gi(),tG=Di(),bp=wa(),x0=Ys(),eG=y0().CONFIGURABLE,nG=_0(),mS=Mp(),rG=mS.enforce,iG=mS.get,gS=String,Ap=Object.defineProperty,oG=E0("".slice),sG=E0("".replace),aG=E0([].join),uG=x0&&!Qz(function(){return Ap(function(){},"length",{value:8}).length!==8}),lG=String(String).split("String"),cG=yS.exports=function(n,t,e){oG(gS(t),0,7)==="Symbol("&&(t="["+sG(gS(t),/^Symbol\\(([^)]*)\\).*$/,"$1")+"]"),e&&e.getter&&(t="get "+t),e&&e.setter&&(t="set "+t),(!bp(n,"name")||eG&&n.name!==t)&&(x0?Ap(n,"name",{value:t,configurable:!0}):n.name=t),uG&&e&&bp(e,"arity")&&n.length!==e.arity&&Ap(n,"length",{value:e.arity});try{e&&bp(e,"constructor")&&e.constructor?x0&&Ap(n,"prototype",{writable:!1}):n.prototype&&(n.prototype=void 0)}catch(s){}var o=rG(n);return bp(o,"source")||(o.source=aG(lG,typeof t=="string"?t:"")),n};Function.prototype.toString=cG(function(){return tG(this)&&iG(this).source||nG(this)},"toString")});var Uf=ot((Kj,_S)=>{"use strict";var fG=Di(),hG=Iu(),pG=vS(),dG=up();_S.exports=function(n,t,e,o){o||(o={});var s=o.enumerable,c=o.name!==void 0?o.name:t;if(fG(e)&&pG(e,c,o),o.global)s?n[t]=e:dG(t,e);else{try{o.unsafe?n[t]&&(s=!0):delete n[t]}catch(d){}s?n[t]=e:hG.f(n,t,{value:e,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return n}});var ES=ot(xS=>{"use strict";var gG=i0(),mG=mp(),yG=mG.concat("length","prototype");xS.f=Object.getOwnPropertyNames||function(t){return gG(t,yG)}});var SS=ot(wS=>{"use strict";wS.f=Object.getOwnPropertySymbols});var bS=ot((tQ,MS)=>{"use strict";var vG=sc(),_G=mi(),xG=ES(),EG=SS(),wG=Sa(),SG=_G([].concat);MS.exports=vG("Reflect","ownKeys")||function(t){var e=xG.f(wG(t)),o=EG.f;return o?SG(e,o(t)):e}});var CS=ot((eQ,TS)=>{"use strict";var AS=wa(),MG=bS(),bG=d0(),AG=Iu();TS.exports=function(n,t,e){for(var o=MG(t),s=AG.f,c=bG.f,d=0;d<o.length;d++){var h=o[d];!AS(n,h)&&!(e&&AS(e,h))&&s(n,h,c(t,h))}}});var IS=ot((nQ,PS)=>{"use strict";var TG=gi(),CG=Di(),PG=/#|\\.prototype\\./,Bf=function(n,t){var e=RG[IG(n)];return e===NG?!0:e===LG?!1:CG(t)?TG(t):!!t},IG=Bf.normalize=function(n){return String(n).replace(PG,".").toLowerCase()},RG=Bf.data={},LG=Bf.NATIVE="N",NG=Bf.POLYFILL="P";PS.exports=Bf});var Ns=ot((rQ,RS)=>{"use strict";var Tp=oo(),OG=d0().f,DG=ac(),FG=Uf(),UG=up(),BG=CS(),zG=IS();RS.exports=function(n,t){var e=n.target,o=n.global,s=n.stat,c,d,h,g,m,_;if(o?d=Tp:s?d=Tp[e]||UG(e,{}):d=Tp[e]&&Tp[e].prototype,d)for(h in t){if(m=t[h],n.dontCallGetSet?(_=OG(d,h),g=_&&_.value):g=d[h],c=zG(o?h:e+(s?".":"#")+h,n.forced),!c&&g!==void 0){if(typeof m==typeof g)continue;BG(m,g)}(n.sham||g&&g.sham)&&DG(m,"sham",!0),FG(d,h,m,n)}}});var NS=ot((iQ,LS)=>{"use strict";var GG=gi();LS.exports=!GG(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype})});var S0=ot((oQ,DS)=>{"use strict";var kG=wa(),qG=Di(),HG=ic(),VG=yp(),WG=NS(),OS=VG("IE_PROTO"),w0=Object,XG=w0.prototype;DS.exports=WG?w0.getPrototypeOf:function(n){var t=HG(n);if(kG(t,OS))return t[OS];var e=t.constructor;return qG(e)&&t instanceof e?e.prototype:t instanceof w0?XG:null}});var T0=ot((sQ,BS)=>{"use strict";var YG=gi(),$G=Di(),ZG=Ea(),JG=Df(),FS=S0(),KG=Uf(),jG=Rs(),QG=Lf(),A0=jG("iterator"),US=!1,tu,M0,b0;[].keys&&(b0=[].keys(),"next"in b0?(M0=FS(FS(b0)),M0!==Object.prototype&&(tu=M0)):US=!0);var t4=!ZG(tu)||YG(function(){var n={};return tu[A0].call(n)!==n});t4?tu={}:QG&&(tu=JG(tu));$G(tu[A0])||KG(tu,A0,function(){return this});BS.exports={IteratorPrototype:tu,BUGGY_SAFARI_ITERATORS:US}});var Cp=ot((aQ,GS)=>{"use strict";var e4=Iu().f,n4=wa(),r4=Rs(),zS=r4("toStringTag");GS.exports=function(n,t,e){n&&!e&&(n=n.prototype),n&&!n4(n,zS)&&e4(n,zS,{configurable:!0,value:t})}});var qS=ot((uQ,kS)=>{"use strict";var i4=T0().IteratorPrototype,o4=Df(),s4=Ep(),a4=Cp(),u4=xp(),l4=function(){return this};kS.exports=function(n,t,e,o){var s=t+" Iterator";return n.prototype=o4(i4,{next:s4(+!o,e)}),a4(n,s,!1,!0),u4[s]=l4,n}});var C0=ot((lQ,HS)=>{"use strict";var c4=mi(),f4=Nf();HS.exports=function(n,t,e){try{return c4(f4(Object.getOwnPropertyDescriptor(n,t)[e]))}catch(o){}}});var WS=ot((cQ,VS)=>{"use strict";var h4=Ea();VS.exports=function(n){return h4(n)||n===null}});var YS=ot((fQ,XS)=>{"use strict";var p4=WS(),d4=String,g4=TypeError;XS.exports=function(n){if(p4(n))return n;throw new g4("Can't set "+d4(n)+" as a prototype")}});var ZS=ot((hQ,$S)=>{"use strict";var m4=C0(),y4=Ea(),v4=nc(),_4=YS();$S.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var n=!1,t={},e;try{e=m4(Object.prototype,"__proto__","set"),e(t,[]),n=t instanceof Array}catch(o){}return function(s,c){return v4(s),_4(c),y4(s)&&(n?e(s,c):s.__proto__=c),s}}():void 0)});var sM=ot((pQ,oM)=>{"use strict";var x4=Ns(),E4=Ls(),Pp=Lf(),rM=y0(),w4=Di(),S4=qS(),JS=S0(),KS=ZS(),M4=Cp(),b4=ac(),P0=Uf(),A4=Rs(),jS=xp(),iM=T0(),T4=rM.PROPER,C4=rM.CONFIGURABLE,QS=iM.IteratorPrototype,Ip=iM.BUGGY_SAFARI_ITERATORS,zf=A4("iterator"),tM="keys",Gf="values",eM="entries",nM=function(){return this};oM.exports=function(n,t,e,o,s,c,d){S4(e,t,o);var h=function(E){if(E===s&&x)return x;if(!Ip&&E&&E in _)return _[E];switch(E){case tM:return function(){return new e(this,E)};case Gf:return function(){return new e(this,E)};case eM:return function(){return new e(this,E)}}return function(){return new e(this)}},g=t+" Iterator",m=!1,_=n.prototype,w=_[zf]||_["@@iterator"]||s&&_[s],x=!Ip&&w||h(s),b=t==="Array"&&_.entries||w,T,I,S;if(b&&(T=JS(b.call(new n)),T!==Object.prototype&&T.next&&(!Pp&&JS(T)!==QS&&(KS?KS(T,QS):w4(T[zf])||P0(T,zf,nM)),M4(T,g,!0,!0),Pp&&(jS[g]=nM))),T4&&s===Gf&&w&&w.name!==Gf&&(!Pp&&C4?b4(_,"name",Gf):(m=!0,x=function(){return E4(w,this)})),s)if(I={values:h(Gf),keys:c?x:h(tM),entries:h(eM)},d)for(S in I)(Ip||m||!(S in _))&&P0(_,S,I[S]);else x4({target:t,proto:!0,forced:Ip||m},I);return(!Pp||d)&&_[zf]!==x&&P0(_,zf,x,{name:s}),jS[t]=x,I}});var uM=ot((dQ,aM)=>{"use strict";aM.exports=function(n,t){return{value:n,done:t}}});var dM=ot((gQ,pM)=>{"use strict";var P4=rc(),I0=c0(),lM=xp(),fM=Mp(),I4=Iu().f,R4=sM(),Rp=uM(),L4=Lf(),N4=Ys(),hM="Array Iterator",O4=fM.set,D4=fM.getterFor(hM);pM.exports=R4(Array,"Array",function(n,t){O4(this,{type:hM,target:P4(n),index:0,kind:t})},function(){var n=D4(this),t=n.target,e=n.index++;if(!t||e>=t.length)return n.target=null,Rp(void 0,!0);switch(n.kind){case"keys":return Rp(e,!1);case"values":return Rp(t[e],!1)}return Rp([e,t[e]],!1)},"values");var cM=lM.Arguments=lM.Array;I0("keys");I0("values");I0("entries");if(!L4&&N4&&cM.name!=="values")try{I4(cM,"name",{value:"values"})}catch(n){}});var Np=ot(()=>{"use strict";var gM=oo(),yM=sE(),F4=pE(),kf=dM(),mM=ac(),U4=Cp(),B4=Rs(),R0=B4("iterator"),L0=kf.values,vM=function(n,t){if(n){if(n[R0]!==L0)try{mM(n,R0,L0)}catch(o){n[R0]=L0}if(U4(n,t,!0),yM[t]){for(var e in kf)if(n[e]!==kf[e])try{mM(n,e,kf[e])}catch(o){n[e]=kf[e]}}}};for(Lp in yM)vM(gM[Lp]&&gM[Lp].prototype,Lp);var Lp;vM(F4,"DOMTokenList")});var EM=ot((vQ,xM)=>{"use strict";var z4=Rs(),G4=z4("toStringTag"),_M={};_M[G4]="z";xM.exports=String(_M)==="[object z]"});var N0=ot((_Q,wM)=>{"use strict";var k4=EM(),q4=Di(),Op=ec(),H4=Rs(),V4=H4("toStringTag"),W4=Object,X4=Op(function(){return arguments}())==="Arguments",Y4=function(n,t){try{return n[t]}catch(e){}};wM.exports=k4?Op:function(n){var t,e,o;return n===void 0?"Undefined":n===null?"Null":typeof(e=Y4(t=W4(n),V4))=="string"?e:X4?Op(t):(o=Op(t))==="Object"&&q4(t.callee)?"Arguments":o}});var Dp=ot((xQ,SM)=>{"use strict";var $4=N0(),Z4=String;SM.exports=function(n){if($4(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Z4(n)}});var bM=ot((EQ,MM)=>{"use strict";var J4=Sa();MM.exports=function(){var n=J4(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 TM=ot((wQ,AM)=>{"use strict";var O0=gi(),K4=oo(),D0=K4.RegExp,F0=O0(function(){var n=D0("a","y");return n.lastIndex=2,n.exec("abcd")!==null}),j4=F0||O0(function(){return!D0("a","y").sticky}),Q4=F0||O0(function(){var n=D0("^r","gy");return n.lastIndex=2,n.exec("str")!==null});AM.exports={BROKEN_CARET:Q4,MISSED_STICKY:j4,UNSUPPORTED_Y:F0}});var PM=ot((SQ,CM)=>{"use strict";var tk=gi(),ek=oo(),nk=ek.RegExp;CM.exports=tk(function(){var n=nk(".","s");return!(n.dotAll&&n.test(\`
8115
8115
  \`)&&n.flags==="s")})});var RM=ot((MQ,IM)=>{"use strict";var rk=gi(),ik=oo(),ok=ik.RegExp;IM.exports=rk(function(){var n=ok("(?<a>b)","g");return n.exec("b").groups.a!=="b"||"b".replace(n,"$<a>c")!=="bc"})});var Bp=ot((bQ,NM)=>{"use strict";var uc=Ls(),Up=mi(),sk=Dp(),ak=bM(),uk=TM(),lk=cp(),ck=Df(),fk=Mp().get,hk=PM(),pk=RM(),dk=lk("native-string-replace",String.prototype.replace),Fp=RegExp.prototype.exec,B0=Fp,gk=Up("".charAt),mk=Up("".indexOf),yk=Up("".replace),U0=Up("".slice),z0=function(){var n=/a/,t=/b*/g;return uc(Fp,n,"a"),uc(Fp,t,"a"),n.lastIndex!==0||t.lastIndex!==0}(),LM=uk.BROKEN_CARET,G0=/()??/.exec("")[1]!==void 0,vk=z0||G0||LM||hk||pk;vk&&(B0=function(t){var e=this,o=fk(e),s=sk(t),c=o.raw,d,h,g,m,_,w,x;if(c)return c.lastIndex=e.lastIndex,d=uc(B0,c,s),e.lastIndex=c.lastIndex,d;var b=o.groups,T=LM&&e.sticky,I=uc(ak,e),S=e.source,E=0,R=s;if(T&&(I=yk(I,"y",""),mk(I,"g")===-1&&(I+="g"),R=U0(s,e.lastIndex),e.lastIndex>0&&(!e.multiline||e.multiline&&gk(s,e.lastIndex-1)!==\`
8116
8116
  \`)&&(S="(?: "+S+")",R=" "+R,E++),h=new RegExp("^(?:"+S+")",I)),G0&&(h=new RegExp("^"+S+"$(?!\\\\s)",I)),z0&&(g=e.lastIndex),m=uc(Fp,T?h:e,R),T?m?(m.input=U0(m.input,E),m[0]=U0(m[0],E),m.index=e.lastIndex,e.lastIndex+=m[0].length):e.lastIndex=0:z0&&m&&(e.lastIndex=e.global?m.index+m[0].length:g),G0&&m&&m.length>1&&uc(dk,m[0],h,function(){for(_=1;_<arguments.length-2;_++)arguments[_]===void 0&&(m[_]=void 0)}),m&&b)for(m.groups=w=ck(null),_=0;_<b.length;_++)x=b[_],w[x[0]]=m[x[1]];return m});NM.exports=B0});var zp=ot(()=>{"use strict";var _k=Ns(),OM=Bp();_k({target:"RegExp",proto:!0,forced:/./.exec!==OM},{exec:OM})});var Gp=ot((CQ,DM)=>{"use strict";var xk=ec();DM.exports=Array.isArray||function(t){return xk(t)==="Array"}});var UM=ot((PQ,FM)=>{"use strict";var Ek=Ys(),wk=Gp(),Sk=TypeError,Mk=Object.getOwnPropertyDescriptor,bk=Ek&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(n){return n instanceof TypeError}}();FM.exports=bk?function(n,t){if(wk(n)&&!Mk(n,"length").writable)throw new Sk("Cannot set read only .length");return n.length=t}:function(n,t){return n.length=t}});var k0=ot((IQ,BM)=>{"use strict";var Ak=TypeError,Tk=9007199254740991;BM.exports=function(n){if(n>Tk)throw Ak("Maximum allowed index exceeded");return n}});var q0=ot(()=>{"use strict";var Ck=Ns(),Pk=ic(),Ik=Of(),Rk=UM(),Lk=k0(),Nk=gi(),Ok=Nk(function(){return[].push.call({length:4294967296},1)!==4294967297}),Dk=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(n){return n instanceof TypeError}},Fk=Ok||!Dk();Ck({target:"Array",proto:!0,arity:1,forced:Fk},{push:function(t){var e=Pk(this),o=Ik(e),s=arguments.length;Lk(o+s);for(var c=0;c<s;c++)e[o]=arguments[c],o++;return Rk(e,o),o}})});var Zs=ot((NQ,zM)=>{"use strict";var H0=mi(),kp=Set.prototype;zM.exports={Set,add:H0(kp.add),has:H0(kp.has),remove:H0(kp.delete),proto:kp}});var Ru=ot((OQ,GM)=>{"use strict";var Uk=Zs().has;GM.exports=function(n){return Uk(n),n}});var Lu=ot((DQ,kM)=>{"use strict";var Bk=Ls();kM.exports=function(n,t,e){for(var o=e?n:n.iterator,s=n.next,c,d;!(c=Bk(s,o)).done;)if(d=t(c.value),d!==void 0)return d}});var lc=ot((FQ,XM)=>{"use strict";var qM=mi(),zk=Lu(),HM=Zs(),Gk=HM.Set,VM=HM.proto,kk=qM(VM.forEach),WM=qM(VM.keys),qk=WM(new Gk).next;XM.exports=function(n,t,e){return e?zk({iterator:WM(n),next:qk},t):kk(n,t)}});var qp=ot((UQ,$M)=>{"use strict";var YM=Zs(),Hk=lc(),Vk=YM.Set,Wk=YM.add;$M.exports=function(n){var t=new Vk;return Hk(n,function(e){Wk(t,e)}),t}});var cc=ot((BQ,ZM)=>{"use strict";var Xk=C0(),Yk=Zs();ZM.exports=Xk(Yk.proto,"size","get")||function(n){return n.size}});var KM=ot((zQ,JM)=>{"use strict";JM.exports=function(n){return{iterator:n,next:n.next,done:!1}}});var Nu=ot((GQ,rb)=>{"use strict";var jM=Nf(),eb=Sa(),QM=Ls(),$k=ml(),Zk=KM(),tb="Invalid size",Jk=RangeError,Kk=TypeError,jk=Math.max,nb=function(n,t){this.set=n,this.size=jk(t,0),this.has=jM(n.has),this.keys=jM(n.keys)};nb.prototype={getIterator:function(){return Zk(eb(QM(this.keys,this.set)))},includes:function(n){return QM(this.has,this.set,n)}};rb.exports=function(n){eb(n);var t=+n.size;if(t!==t)throw new Kk(tb);var e=$k(t);if(e<0)throw new Jk(tb);return new nb(n,e)}});var ab=ot((kQ,sb)=>{"use strict";var Qk=Ru(),ob=Zs(),tq=qp(),eq=cc(),nq=Nu(),rq=lc(),iq=Lu(),oq=ob.has,ib=ob.remove;sb.exports=function(t){var e=Qk(this),o=nq(t),s=tq(e);return eq(e)<=o.size?rq(e,function(c){o.includes(c)&&ib(s,c)}):iq(o.getIterator(),function(c){oq(e,c)&&ib(s,c)}),s}});var Ou=ot((qQ,cb)=>{"use strict";var sq=sc(),ub=function(n){return{size:n,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},lb=function(n){return{size:n,has:function(){return!0},keys:function(){throw new Error("e")}}};cb.exports=function(n,t){var e=sq("Set");try{new e()[n](ub(0));try{return new e()[n](ub(-1)),!1}catch(s){if(!t)return!0;try{return new e()[n](lb(-1/0)),!1}catch(c){var o=new e;return o.add(1),o.add(2),t(o[n](lb(1/0)))}}}catch(s){return!1}}});var fb=ot(()=>{"use strict";var aq=Ns(),uq=ab(),lq=Ou(),cq=!lq("difference",function(n){return n.size===0});aq({target:"Set",proto:!0,real:!0,forced:cq},{difference:uq})});var db=ot((WQ,pb)=>{"use strict";var fq=Ru(),V0=Zs(),hq=cc(),pq=Nu(),dq=lc(),gq=Lu(),mq=V0.Set,hb=V0.add,yq=V0.has;pb.exports=function(t){var e=fq(this),o=pq(t),s=new mq;return hq(e)>o.size?gq(o.getIterator(),function(c){yq(e,c)&&hb(s,c)}):dq(e,function(c){o.includes(c)&&hb(s,c)}),s}});var gb=ot(()=>{"use strict";var vq=Ns(),_q=gi(),xq=db(),Eq=Ou(),wq=!Eq("intersection",function(n){return n.size===2&&n.has(1)&&n.has(2)})||_q(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});vq({target:"Set",proto:!0,real:!0,forced:wq},{intersection:xq})});var W0=ot(($Q,yb)=>{"use strict";var Sq=Ls(),mb=Sa(),Mq=pp();yb.exports=function(n,t,e){var o,s;mb(n);try{if(o=Mq(n,"return"),!o){if(t==="throw")throw e;return e}o=Sq(o,n)}catch(c){s=!0,o=c}if(t==="throw")throw e;if(s)throw o;return mb(o),e}});var _b=ot((ZQ,vb)=>{"use strict";var bq=Ru(),Aq=Zs().has,Tq=cc(),Cq=Nu(),Pq=lc(),Iq=Lu(),Rq=W0();vb.exports=function(t){var e=bq(this),o=Cq(t);if(Tq(e)<=o.size)return Pq(e,function(c){if(o.includes(c))return!1},!0)!==!1;var s=o.getIterator();return Iq(s,function(c){if(Aq(e,c))return Rq(s,"normal",!1)})!==!1}});var xb=ot(()=>{"use strict";var Lq=Ns(),Nq=_b(),Oq=Ou(),Dq=!Oq("isDisjointFrom",function(n){return!n});Lq({target:"Set",proto:!0,real:!0,forced:Dq},{isDisjointFrom:Nq})});var wb=ot((jQ,Eb)=>{"use strict";var Fq=Ru(),Uq=cc(),Bq=lc(),zq=Nu();Eb.exports=function(t){var e=Fq(this),o=zq(t);return Uq(e)>o.size?!1:Bq(e,function(s){if(!o.includes(s))return!1},!0)!==!1}});var Sb=ot(()=>{"use strict";var Gq=Ns(),kq=wb(),qq=Ou(),Hq=!qq("isSubsetOf",function(n){return n});Gq({target:"Set",proto:!0,real:!0,forced:Hq},{isSubsetOf:kq})});var bb=ot((ett,Mb)=>{"use strict";var Vq=Ru(),Wq=Zs().has,Xq=cc(),Yq=Nu(),$q=Lu(),Zq=W0();Mb.exports=function(t){var e=Vq(this),o=Yq(t);if(Xq(e)<o.size)return!1;var s=o.getIterator();return $q(s,function(c){if(!Wq(e,c))return Zq(s,"normal",!1)})!==!1}});var Ab=ot(()=>{"use strict";var Jq=Ns(),Kq=bb(),jq=Ou(),Qq=!jq("isSupersetOf",function(n){return!n});Jq({target:"Set",proto:!0,real:!0,forced:Qq},{isSupersetOf:Kq})});var Cb=ot((itt,Tb)=>{"use strict";var t5=Ru(),X0=Zs(),e5=qp(),n5=Nu(),r5=Lu(),i5=X0.add,o5=X0.has,s5=X0.remove;Tb.exports=function(t){var e=t5(this),o=n5(t).getIterator(),s=e5(e);return r5(o,function(c){o5(e,c)?s5(s,c):i5(s,c)}),s}});var Pb=ot(()=>{"use strict";var a5=Ns(),u5=Cb(),l5=Ou();a5({target:"Set",proto:!0,real:!0,forced:!l5("symmetricDifference")},{symmetricDifference:u5})});var Rb=ot((att,Ib)=>{"use strict";var c5=Ru(),f5=Zs().add,h5=qp(),p5=Nu(),d5=Lu();Ib.exports=function(t){var e=c5(this),o=p5(t).getIterator(),s=h5(e);return d5(o,function(c){f5(s,c)}),s}});var Lb=ot(()=>{"use strict";var g5=Ns(),m5=Rb(),y5=Ou();g5({target:"Set",proto:!0,real:!0,forced:!y5("union")},{union:m5})});var Ob=ot((ctt,Nb)=>{"use strict";var v5=ec(),_5=mi();Nb.exports=function(n){if(v5(n)==="Function")return _5(n)}});var Ub=ot((ftt,Fb)=>{"use strict";var Db=Ob(),x5=Nf(),E5=Rf(),w5=Db(Db.bind);Fb.exports=function(n,t){return x5(n),t===void 0?n:E5?w5(n,t):function(){return n.apply(t,arguments)}}});var Gb=ot((htt,zb)=>{"use strict";var S5=Gp(),M5=Of(),b5=k0(),A5=Ub(),Bb=function(n,t,e,o,s,c,d,h){for(var g=s,m=0,_=d?A5(d,h):!1,w,x;m<o;)m in e&&(w=_?_(e[m],m,t):e[m],c>0&&S5(w)?(x=M5(w),g=Bb(n,t,w,x,g,c-1)-1):(b5(g+1),n[g]=w),g++),m++;return g};zb.exports=Bb});var Xb=ot((ptt,Wb)=>{"use strict";var T5=mi(),C5=gi(),kb=Di(),P5=N0(),I5=sc(),R5=_0(),qb=function(){},Hb=I5("Reflect","construct"),Y0=/^\\s*(?:class|function)\\b/,L5=T5(Y0.exec),N5=!Y0.test(qb),qf=function(t){if(!kb(t))return!1;try{return Hb(qb,[],t),!0}catch(e){return!1}},Vb=function(t){if(!kb(t))return!1;switch(P5(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return N5||!!L5(Y0,R5(t))}catch(e){return!0}};Vb.sham=!0;Wb.exports=!Hb||C5(function(){var n;return qf(qf.call)||!qf(Object)||!qf(function(){n=!0})||n})?Vb:qf});var Jb=ot((dtt,Zb)=>{"use strict";var Yb=Gp(),O5=Xb(),D5=Ea(),F5=Rs(),U5=F5("species"),$b=Array;Zb.exports=function(n){var t;return Yb(n)&&(t=n.constructor,O5(t)&&(t===$b||Yb(t.prototype))?t=void 0:D5(t)&&(t=t[U5],t===null&&(t=void 0))),t===void 0?$b:t}});var jb=ot((gtt,Kb)=>{"use strict";var B5=Jb();Kb.exports=function(n,t){return new(B5(n))(t===0?0:t)}});var Qb=ot(()=>{"use strict";var z5=Ns(),G5=Gb(),k5=ic(),q5=Of(),H5=ml(),V5=jb();z5({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=k5(this),o=q5(e),s=V5(e,0);return s.length=G5(s,e,e,o,0,t===void 0?1:H5(t)),s}})});var tA=ot(()=>{"use strict";var W5=c0();W5("flat")});var nA=ot((xtt,eA)=>{var $0=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)}};eA.exports=$0});var oA=ot((Ett,iA)=>{function rA(n,t){let e=new Map;for(let[o,s]of n)o!==t&&s instanceof Map?e.set(o,rA(s,t)):o!==t&&e.set(o,s);return e}iA.exports=rA});var uA=ot((wtt,aA)=>{function X5(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(!X5(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}aA.exports=sA});var fA=ot((Stt,cA)=>{function lA(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){lA(t);return}if(typeof t!="number"||t<=0)throw new Error(\`Values must be numbers greater than 0. Found value \${t} at \${e}\`)})}cA.exports=lA});var gA=ot((Mtt,dA)=>{var Y5=nA(),$5=oA(),hA=uA(),pA=fA(),Z0=class{constructor(t){t instanceof Map?(pA(t),this.graph=t):t?this.graph=hA(t):this.graph=new Map}addNode(t,e){let o;return e instanceof Map?(pA(e),o=e):o=hA(e),this.graph.set(t,o),this}addVertex(t,e){return this.addNode(t,e)}removeNode(t){return this.graph=$5(this.graph,t),this}path(t,e,o={}){if(!this.graph.size)return o.cost?{path:null,cost:0}:null;let s=new Set,c=new Y5,d=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(c.set(t,0);!c.isEmpty();){let _=c.next();if(_.key===e){g=_.priority;let x=_.key;for(;d.has(x);)h.push(x),x=d.get(x);break}s.add(_.key),(this.graph.get(_.key)||new Map).forEach((x,b)=>{if(s.has(b)||m.includes(b))return null;if(!c.has(b))return d.set(b,_.key),c.set(b,_.priority+x);let T=c.get(b).priority,I=_.priority+x;return I<T?(d.set(b,_.key),c.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)}};dA.exports=Z0});var Dd=ot((Ftt,uC)=>{"use strict";var aC=Object.getOwnPropertySymbols,aX=Object.prototype.hasOwnProperty,uX=Object.prototype.propertyIsEnumerable;function lX(n){if(n==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function cX(){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(c){return t[c]});if(o.join("")!=="0123456789")return!1;var s={};return"abcdefghijklmnopqrst".split("").forEach(function(c){s[c]=c}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch(c){return!1}}uC.exports=cX()?Object.assign:function(n,t){for(var e,o=lX(n),s,c=1;c<arguments.length;c++){e=Object(arguments[c]);for(var d in e)aX.call(e,d)&&(o[d]=e[d]);if(aC){s=aC(e);for(var h=0;h<s.length;h++)uX.call(e,s[h])&&(o[s[h]]=e[s[h]])}}return o}});var Mv=ot((wv,Sv)=>{(function(n,t){typeof wv=="object"&&typeof Sv!="undefined"?Sv.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self).RBush=t()})(wv,function(){"use strict";function n(S,E,R,C,F){(function W(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)),Rt=Math.min(xt,Math.floor(q+(j-J)*Q/j+At));W(X,q,Mt,Rt,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)}})(S,E,R||0,C||S.length-1,F||e)}function t(S,E,R){var C=S[E];S[E]=S[R],S[R]=C}function e(S,E){return S<E?-1:S>E?1:0}var o=function(S){S===void 0&&(S=9),this._maxEntries=Math.max(4,S),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function s(S,E,R){if(!R)return E.indexOf(S);for(var C=0;C<E.length;C++)if(R(S,E[C]))return C;return-1}function c(S,E){d(S,0,S.children.length,E,S)}function d(S,E,R,C,F){F||(F=T(null)),F.minX=1/0,F.minY=1/0,F.maxX=-1/0,F.maxY=-1/0;for(var W=E;W<R;W++){var X=S.children[W];h(F,S.leaf?C(X):X)}return F}function h(S,E){return S.minX=Math.min(S.minX,E.minX),S.minY=Math.min(S.minY,E.minY),S.maxX=Math.max(S.maxX,E.maxX),S.maxY=Math.max(S.maxY,E.maxY),S}function g(S,E){return S.minX-E.minX}function m(S,E){return S.minY-E.minY}function _(S){return(S.maxX-S.minX)*(S.maxY-S.minY)}function w(S){return S.maxX-S.minX+(S.maxY-S.minY)}function x(S,E){return S.minX<=E.minX&&S.minY<=E.minY&&E.maxX<=S.maxX&&E.maxY<=S.maxY}function b(S,E){return E.minX<=S.maxX&&E.minY<=S.maxY&&E.maxX>=S.minX&&E.maxY>=S.minY}function T(S){return{children:S,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function I(S,E,R,C,F){for(var W=[E,R];W.length;)if(!((R=W.pop())-(E=W.pop())<=C)){var X=E+Math.ceil((R-E)/C/2)*C;n(S,X,E,R,F),W.push(E,X,X,R)}}return o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(S){var E=this.data,R=[];if(!b(S,E))return R;for(var C=this.toBBox,F=[];E;){for(var W=0;W<E.children.length;W++){var X=E.children[W],q=E.leaf?C(X):X;b(S,q)&&(E.leaf?R.push(X):x(S,q)?this._all(X,R):F.push(X))}E=F.pop()}return R},o.prototype.collides=function(S){var E=this.data;if(!b(S,E))return!1;for(var R=[];E;){for(var C=0;C<E.children.length;C++){var F=E.children[C],W=E.leaf?this.toBBox(F):F;if(b(S,W)){if(E.leaf||x(S,W))return!0;R.push(F)}}E=R.pop()}return!1},o.prototype.load=function(S){if(!S||!S.length)return this;if(S.length<this._minEntries){for(var E=0;E<S.length;E++)this.insert(S[E]);return this}var R=this._build(S.slice(),0,S.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(S){return S&&this._insert(S,this.data.height-1),this},o.prototype.clear=function(){return this.data=T([]),this},o.prototype.remove=function(S,E){if(!S)return this;for(var R,C,F,W=this.data,X=this.toBBox(S),q=[],D=[];W||q.length;){if(W||(W=q.pop(),C=q[q.length-1],R=D.pop(),F=!0),W.leaf){var xt=s(S,W.children,E);if(xt!==-1)return W.children.splice(xt,1),q.push(W),this._condense(q),this}F||W.leaf||!x(W,X)?C?(R++,W=C.children[R],F=!1):W=null:(q.push(W),D.push(R),R=0,C=W,W=W.children[0])}return this},o.prototype.toBBox=function(S){return S},o.prototype.compareMinX=function(S,E){return S.minX-E.minX},o.prototype.compareMinY=function(S,E){return S.minY-E.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(S){return this.data=S,this},o.prototype._all=function(S,E){for(var R=[];S;)S.leaf?E.push.apply(E,S.children):R.push.apply(R,S.children),S=R.pop();return E},o.prototype._build=function(S,E,R,C){var F,W=R-E+1,X=this._maxEntries;if(W<=X)return c(F=T(S.slice(E,R+1)),this.toBBox),F;C||(C=Math.ceil(Math.log(W)/Math.log(X)),X=Math.ceil(W/Math.pow(X,C-1))),(F=T([])).leaf=!1,F.height=C;var q=Math.ceil(W/X),D=q*Math.ceil(Math.sqrt(X));I(S,E,R,D,this.compareMinX);for(var xt=E;xt<=R;xt+=D){var B=Math.min(xt+D-1,R);I(S,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(S,j,J,C-1))}}return c(F,this.toBBox),F},o.prototype._chooseSubtree=function(S,E,R,C){for(;C.push(E),!E.leaf&&C.length-1!==R;){for(var F=1/0,W=1/0,X=void 0,q=0;q<E.children.length;q++){var D=E.children[q],xt=_(D),B=(j=S,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<W?(W=B,F=xt<F?xt:F,X=D):B===W&&xt<F&&(F=xt,X=D)}E=X||E.children[0]}var j,J;return E},o.prototype._insert=function(S,E,R){var C=R?S:this.toBBox(S),F=[],W=this._chooseSubtree(C,this.data,E,F);for(W.children.push(S),h(W,C);E>=0&&F[E].children.length>this._maxEntries;)this._split(F,E),E--;this._adjustParentBBoxes(C,F,E)},o.prototype._split=function(S,E){var R=S[E],C=R.children.length,F=this._minEntries;this._chooseSplitAxis(R,F,C);var W=this._chooseSplitIndex(R,F,C),X=T(R.children.splice(W,R.children.length-W));X.height=R.height,X.leaf=R.leaf,c(R,this.toBBox),c(X,this.toBBox),E?S[E-1].children.push(X):this._splitRoot(R,X)},o.prototype._splitRoot=function(S,E){this.data=T([S,E]),this.data.height=S.height+1,this.data.leaf=!1,c(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(S,E,R){for(var C,F,W,X,q,D,xt,B=1/0,j=1/0,J=E;J<=R-E;J++){var Dt=d(S,0,J,this.toBBox),Q=d(S,J,R,this.toBBox),At=(F=Dt,W=Q,X=void 0,q=void 0,D=void 0,xt=void 0,X=Math.max(F.minX,W.minX),q=Math.max(F.minY,W.minY),D=Math.min(F.maxX,W.maxX),xt=Math.min(F.maxY,W.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-E},o.prototype._chooseSplitAxis=function(S,E,R){var C=S.leaf?this.compareMinX:g,F=S.leaf?this.compareMinY:m;this._allDistMargin(S,E,R,C)<this._allDistMargin(S,E,R,F)&&S.children.sort(C)},o.prototype._allDistMargin=function(S,E,R,C){S.children.sort(C);for(var F=this.toBBox,W=d(S,0,E,F),X=d(S,R-E,R,F),q=w(W)+w(X),D=E;D<R-E;D++){var xt=S.children[D];h(W,S.leaf?F(xt):xt),q+=w(W)}for(var B=R-E-1;B>=E;B--){var j=S.children[B];h(X,S.leaf?F(j):j),q+=w(X)}return q},o.prototype._adjustParentBBoxes=function(S,E,R){for(var C=R;C>=0;C--)h(E[C],S)},o.prototype._condense=function(S){for(var E=S.length-1,R=void 0;E>=0;E--)S[E].children.length===0?E>0?(R=S[E-1].children).splice(R.indexOf(S[E]),1):this.clear():c(S[E],this.toBBox)},o})});var lC=ot((bv,Av)=>{(function(n,t){typeof bv=="object"&&typeof Av!="undefined"?Av.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self,n.TinyQueue=t())})(bv,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 c=(this.length>>1)-1;c>=0;c--)this._down(c)};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,c=s.data,d=s.compare,h=c[o];o>0;){var g=o-1>>1,m=c[g];if(d(h,m)>=0)break;c[o]=m,o=g}c[o]=h},n.prototype._down=function(o){for(var s=this,c=s.data,d=s.compare,h=this.length>>1,g=c[o];o<h;){var m=(o<<1)+1,_=c[m],w=m+1;if(w<this.length&&d(c[w],_)<0&&(m=w,_=c[w]),d(_,g)>=0)break;c[o]=_,o=m}c[o]=g};function t(e,o){return e<o?-1:e>o?1:0}return n})});var fC=ot((qtt,cC)=>{cC.exports=function(t,e,o,s){var c=t[0],d=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 w=e[o+m*2+0],x=e[o+m*2+1],b=e[o+_*2+0],T=e[o+_*2+1],I=x>d!=T>d&&c<(b-w)*(d-x)/(T-x)+w;I&&(h=!h)}return h}});var pC=ot((Htt,hC)=>{hC.exports=function(t,e,o,s){var c=t[0],d=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 w=e[m+o][0],x=e[m+o][1],b=e[_+o][0],T=e[_+o][1],I=x>d!=T>d&&c<(b-w)*(d-x)/(T-x)+w;I&&(h=!h)}return h}});var mC=ot((Vtt,Bd)=>{var dC=fC(),gC=pC();Bd.exports=function(t,e,o,s){return e.length>0&&Array.isArray(e[0])?gC(t,e,o,s):dC(t,e,o,s)};Bd.exports.nested=gC;Bd.exports.flat=dC});var vC=ot((zd,yC)=>{(function(n,t){typeof zd=="object"&&typeof yC!="undefined"?t(zd):typeof define=="function"&&define.amd?define(["exports"],t):t((n=n||self).predicates={})})(zd,function(n){"use strict";let e=33306690738754706e-32;function o(b,T,I,S,E){let R,C,F,W,X=T[0],q=S[0],D=0,xt=0;q>X==q>-X?(R=X,X=T[++D]):(R=q,q=S[++xt]);let B=0;if(D<b&&xt<I)for(q>X==q>-X?(F=R-((C=X+R)-X),X=T[++D]):(F=R-((C=q+R)-q),q=S[++xt]),R=C,F!==0&&(E[B++]=F);D<b&&xt<I;)q>X==q>-X?(F=R-((C=R+X)-(W=C-R))+(X-W),X=T[++D]):(F=R-((C=R+q)-(W=C-R))+(q-W),q=S[++xt]),R=C,F!==0&&(E[B++]=F);for(;D<b;)F=R-((C=R+X)-(W=C-R))+(X-W),X=T[++D],R=C,F!==0&&(E[B++]=F);for(;xt<I;)F=R-((C=R+q)-(W=C-R))+(q-W),q=S[++xt],R=C,F!==0&&(E[B++]=F);return R===0&&B!==0||(E[B++]=R),B}function s(b){return new Float64Array(b)}let c=33306690738754716e-32,d=22204460492503146e-32,h=11093356479670487e-47,g=s(4),m=s(8),_=s(12),w=s(16),x=s(4);n.orient2d=function(b,T,I,S,E,R){let C=(T-R)*(I-E),F=(b-E)*(S-R),W=C-F;if(C===0||F===0||C>0!=F>0)return W;let X=Math.abs(C+F);return Math.abs(W)>=c*X?W:-function(q,D,xt,B,j,J,Dt){let Q,At,Mt,Rt,pt,yt,K,Bt,Gt,ae,ut,Ut,jt,ce,te,$t,qt,xe,ft=q-j,We=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=We-(Gt=(yt=134217729*We)-(yt-We)))-(($t=ee*We)-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 Pt=z[0];for(let Ot=1;Ot<tt;Ot++)Pt+=z[Ot];return Pt}(4,g),Te=d*Dt;if(fe>=Te||-fe>=Te||(Q=q-(ft+(pt=q-ft))+(pt-j),Mt=xt-(We+(pt=xt-We))+(pt-j),At=D-(ee+(pt=D-ee))+(pt-J),Rt=B-(ge+(pt=B-ge))+(pt-J),Q===0&&At===0&&Mt===0&&Rt===0)||(Te=h*Dt+e*Math.abs(fe),(fe+=ft*Rt+ge*Q-(ee*Mt+We*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=We-(Gt=(yt=134217729*We)-(yt-We)))-(($t=At*We)-K*Gt-Bt*Gt-K*ae))),x[0]=te-(ut+pt)+(pt-qt),pt=(jt=ce-((Ut=ce+ut)-(pt=Ut-ce))+(ut-pt))-(ut=jt-$t),x[1]=jt-(ut+pt)+(pt-$t),pt=(xe=Ut+ut)-Ut,x[2]=Ut-(xe-pt)+(ut-pt),x[3]=xe;let be=o(4,g,4,x,m);pt=(te=(Bt=ft-(K=(yt=134217729*ft)-(yt-ft)))*(ae=Rt-(Gt=(yt=134217729*Rt)-(yt-Rt)))-((ce=ft*Rt)-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))),x[0]=te-(ut+pt)+(pt-qt),pt=(jt=ce-((Ut=ce+ut)-(pt=Ut-ce))+(ut-pt))-(ut=jt-$t),x[1]=jt-(ut+pt)+(pt-$t),pt=(xe=Ut+ut)-Ut,x[2]=Ut-(xe-pt)+(ut-pt),x[3]=xe;let Wt=o(be,m,4,x,_);pt=(te=(Bt=Q-(K=(yt=134217729*Q)-(yt-Q)))*(ae=Rt-(Gt=(yt=134217729*Rt)-(yt-Rt)))-((ce=Q*Rt)-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))),x[0]=te-(ut+pt)+(pt-qt),pt=(jt=ce-((Ut=ce+ut)-(pt=Ut-ce))+(ut-pt))-(ut=jt-$t),x[1]=jt-(ut+pt)+(pt-$t),pt=(xe=Ut+ut)-Ut,x[2]=Ut-(xe-pt)+(ut-pt),x[3]=xe;let Me=o(Wt,_,4,x,w);return w[Me-1]}(b,T,I,S,E,R,X)},n.orient2dfast=function(b,T,I,S,E,R){return(T-R)*(I-E)-(b-E)*(S-R)},Object.defineProperty(n,"__esModule",{value:!0})})});var MC=ot((Wtt,Iv)=>{"use strict";var _C=Mv(),kd=lC(),hX=mC(),pX=vC().orient2d;kd.default&&(kd=kd.default);Iv.exports=SC;Iv.exports.default=SC;function SC(n,t,e){t=Math.max(0,t===void 0?2:t),e=e||0;var o=vX(n),s=new _C(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 c=[],d=0,h;d<o.length;d++){var g=o[d];s.remove(g),h=wC(g,h),c.push(h)}var m=new _C(16);for(d=0;d<c.length;d++)m.insert(Tv(c[d]));for(var _=t*t,w=e*e;c.length;){var x=c.shift(),b=x.p,T=x.next.p,I=Cv(b,T);if(!(I<w)){var S=I/_;g=dX(s,x.prev.p,b,T,x.next.next.p,S,m),g&&Math.min(Cv(g,b),Cv(g,T))<=S&&(c.push(x),c.push(wC(g,x)),s.remove(g),m.remove(x),m.insert(Tv(x)),m.insert(Tv(x.next)))}}x=h;var E=[];do E.push(x.p),x=x.next;while(x!==h);return E.push(x.p),E}function dX(n,t,e,o,s,c,d){for(var h=new kd([],gX),g=n.data;g;){for(var m=0;m<g.children.length;m++){var _=g.children[m],w=g.leaf?Pv(_,e,o):mX(e,o,_);w>c||h.push({node:_,dist:w})}for(;h.length&&!h.peek().node.children;){var x=h.pop(),b=x.node,T=Pv(b,t,e),I=Pv(b,o,s);if(x.dist<T&&x.dist<I&&EC(e,b,d)&&EC(o,b,d))return b}g=h.pop(),g&&(g=g.node)}return null}function gX(n,t){return n.dist-t.dist}function mX(n,t,e){if(xC(n,e)||xC(t,e))return 0;var o=Gd(n[0],n[1],t[0],t[1],e.minX,e.minY,e.maxX,e.minY);if(o===0)return 0;var s=Gd(n[0],n[1],t[0],t[1],e.minX,e.minY,e.minX,e.maxY);if(s===0)return 0;var c=Gd(n[0],n[1],t[0],t[1],e.maxX,e.minY,e.maxX,e.maxY);if(c===0)return 0;var d=Gd(n[0],n[1],t[0],t[1],e.minX,e.maxY,e.maxX,e.maxY);return d===0?0:Math.min(o,s,c,d)}function xC(n,t){return n[0]>=t.minX&&n[0]<=t.maxX&&n[1]>=t.minY&&n[1]<=t.maxY}function EC(n,t,e){for(var o=Math.min(n[0],t[0]),s=Math.min(n[1],t[1]),c=Math.max(n[0],t[0]),d=Math.max(n[1],t[1]),h=e.search({minX:o,minY:s,maxX:c,maxY:d}),g=0;g<h.length;g++)if(yX(h[g].p,h[g].next.p,n,t))return!1;return!0}function kc(n,t,e){return pX(n[0],n[1],t[0],t[1],e[0],e[1])}function yX(n,t,e,o){return n!==o&&t!==e&&kc(n,t,e)>0!=kc(n,t,o)>0&&kc(e,o,n)>0!=kc(e,o,t)>0}function Tv(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 vX(n){for(var t=n[0],e=n[0],o=n[0],s=n[0],c=0;c<n.length;c++){var d=n[c];d[0]<t[0]&&(t=d),d[0]>o[0]&&(o=d),d[1]<e[1]&&(e=d),d[1]>s[1]&&(s=d)}var h=[t,e,o,s],g=h.slice();for(c=0;c<n.length;c++)hX(n[c],h)||g.push(n[c]);return xX(g)}function wC(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 Cv(n,t){var e=n[0]-t[0],o=n[1]-t[1];return e*e+o*o}function Pv(n,t,e){var o=t[0],s=t[1],c=e[0]-o,d=e[1]-s;if(c!==0||d!==0){var h=((n[0]-o)*c+(n[1]-s)*d)/(c*c+d*d);h>1?(o=e[0],s=e[1]):h>0&&(o+=c*h,s+=d*h)}return c=n[0]-o,d=n[1]-s,c*c+d*d}function Gd(n,t,e,o,s,c,d,h){var g=e-n,m=o-t,_=d-s,w=h-c,x=n-s,b=t-c,T=g*g+m*m,I=g*_+m*w,S=_*_+w*w,E=g*x+m*b,R=_*x+w*b,C=T*S-I*I,F,W,X,q,D=C,xt=C;C===0?(W=0,D=1,q=R,xt=S):(W=I*R-S*E,q=T*R-I*E,W<0?(W=0,q=R,xt=S):W>D&&(W=D,q=R+I,xt=S)),q<0?(q=0,-E<0?W=0:-E>T?W=D:(W=-E,D=T)):q>xt&&(q=xt,-E+I<0?W=0:-E+I>T?W=D:(W=-E+I,D=T)),F=W===0?0:W/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*d,Dt=(1-X)*c+X*h,Q=J-B,At=Dt-j;return Q*Q+At*At}function _X(n,t){return n[0]===t[0]?n[1]-t[1]:n[0]-t[0]}function xX(n){n.sort(_X);for(var t=[],e=0;e<n.length;e++){for(;t.length>=2&&kc(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&&kc(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 IC=ot((Lv,Nv)=>{(function(n,t){typeof Lv=="object"&&typeof Nv!="undefined"?Nv.exports=t():typeof define=="function"&&define.amd?define(t):n.quickselect=t()})(Lv,function(){"use strict";function n(s,c,d,h,g){t(s,c,d||0,h||s.length-1,g||o)}function t(s,c,d,h,g){for(;h>d;){if(h-d>600){var m=h-d+1,_=c-d+1,w=Math.log(m),x=.5*Math.exp(2*w/3),b=.5*Math.sqrt(w*x*(m-x)/m)*(_-m/2<0?-1:1),T=Math.max(d,Math.floor(c-_*x/m+b)),I=Math.min(h,Math.floor(c+(m-_)*x/m+b));t(s,c,T,I,g)}var S=s[c],E=d,R=h;for(e(s,d,c),g(s[h],S)>0&&e(s,d,h);E<R;){for(e(s,E,R),E++,R--;g(s[E],S)<0;)E++;for(;g(s[R],S)>0;)R--}g(s[d],S)===0?e(s,d,R):(R++,e(s,R,h)),R<=c&&(d=R+1),c<=R&&(h=R-1)}}function e(s,c,d){var h=s[c];s[c]=s[d],s[d]=h}function o(s,c){return s<c?-1:s>c?1:0}return n})});var Uv=ot((_rt,Fv)=>{"use strict";Fv.exports=rh;Fv.exports.default=rh;var NX=IC();function rh(n,t){if(!(this instanceof rh))return new rh(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()}rh.prototype={all:function(){return this._all(this.data,[])},search:function(n){var t=this.data,e=[],o=this.toBBox;if(!Hd(n,t))return e;for(var s=[],c,d,h,g;t;){for(c=0,d=t.children.length;c<d;c++)h=t.children[c],g=t.leaf?o(h):h,Hd(n,g)&&(t.leaf?e.push(h):Dv(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(!Hd(n,t))return!1;for(var o=[],s,c,d,h;t;){for(s=0,c=t.children.length;s<c;s++)if(d=t.children[s],h=t.leaf?e(d):d,Hd(n,h)){if(t.leaf||Dv(n,h))return!0;o.push(d)}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=Vc([]),this},remove:function(n,t){if(!n)return this;for(var e=this.data,o=this.toBBox(n),s=[],c=[],d,h,g,m;e||s.length;){if(e||(e=s.pop(),h=s[s.length-1],d=c.pop(),m=!0),e.leaf&&(g=OX(n,e.children,t),g!==-1))return e.children.splice(g,1),s.push(e),this._condense(s),this;!m&&!e.leaf&&Dv(e,o)?(s.push(e),c.push(d),d=0,h=e,e=e.children[0]):h?(d++,e=h.children[d],m=!1):e=null}return this},toBBox:function(n){return n},compareMinX:RC,compareMinY:LC,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,c=this._maxEntries,d;if(s<=c)return d=Vc(n.slice(t,e+1)),Hc(d,this.toBBox),d;o||(o=Math.ceil(Math.log(s)/Math.log(c)),c=Math.ceil(s/Math.pow(c,o-1))),d=Vc([]),d.leaf=!1,d.height=o;var h=Math.ceil(s/c),g=h*Math.ceil(Math.sqrt(c)),m,_,w,x;for(NC(n,t,e,g,this.compareMinX),m=t;m<=e;m+=g)for(w=Math.min(m+g-1,e),NC(n,m,w,h,this.compareMinY),_=m;_<=w;_+=h)x=Math.min(_+h-1,w),d.children.push(this._build(n,_,x,o-1));return Hc(d,this.toBBox),d},_chooseSubtree:function(n,t,e,o){for(var s,c,d,h,g,m,_,w;o.push(t),!(t.leaf||o.length-1===e);){for(_=w=1/0,s=0,c=t.children.length;s<c;s++)d=t.children[s],g=Ov(d),m=DX(n,d)-g,m<w?(w=m,_=g<_?g:_,h=d):m===w&&g<_&&(_=g,h=d);t=h||t.children[0]}return t},_insert:function(n,t,e){var o=this.toBBox,s=e?n:o(n),c=[],d=this._chooseSubtree(s,this.data,t,c);for(d.children.push(n),nh(d,s);t>=0&&c[t].children.length>this._maxEntries;)this._split(c,t),t--;this._adjustParentBBoxes(s,c,t)},_split:function(n,t){var e=n[t],o=e.children.length,s=this._minEntries;this._chooseSplitAxis(e,s,o);var c=this._chooseSplitIndex(e,s,o),d=Vc(e.children.splice(c,e.children.length-c));d.height=e.height,d.leaf=e.leaf,Hc(e,this.toBBox),Hc(d,this.toBBox),t?n[t-1].children.push(d):this._splitRoot(e,d)},_splitRoot:function(n,t){this.data=Vc([n,t]),this.data.height=n.height+1,this.data.leaf=!1,Hc(this.data,this.toBBox)},_chooseSplitIndex:function(n,t,e){var o,s,c,d,h,g,m,_;for(g=m=1/0,o=t;o<=e-t;o++)s=eh(n,0,o,this.toBBox),c=eh(n,o,e,this.toBBox),d=FX(s,c),h=Ov(s)+Ov(c),d<g?(g=d,_=o,m=h<m?h:m):d===g&&h<m&&(m=h,_=o);return _},_chooseSplitAxis:function(n,t,e){var o=n.leaf?this.compareMinX:RC,s=n.leaf?this.compareMinY:LC,c=this._allDistMargin(n,t,e,o),d=this._allDistMargin(n,t,e,s);c<d&&n.children.sort(o)},_allDistMargin:function(n,t,e,o){n.children.sort(o);var s=this.toBBox,c=eh(n,0,t,s),d=eh(n,e-t,e,s),h=qd(c)+qd(d),g,m;for(g=t;g<e-t;g++)m=n.children[g],nh(c,n.leaf?s(m):m),h+=qd(c);for(g=e-t-1;g>=t;g--)m=n.children[g],nh(d,n.leaf?s(m):m),h+=qd(d);return h},_adjustParentBBoxes:function(n,t,e){for(var o=e;o>=0;o--)nh(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():Hc(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 OX(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 Hc(n,t){eh(n,0,n.children.length,t,n)}function eh(n,t,e,o,s){s||(s=Vc(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(var c=t,d;c<e;c++)d=n.children[c],nh(s,n.leaf?o(d):d);return s}function nh(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 RC(n,t){return n.minX-t.minX}function LC(n,t){return n.minY-t.minY}function Ov(n){return(n.maxX-n.minX)*(n.maxY-n.minY)}function qd(n){return n.maxX-n.minX+(n.maxY-n.minY)}function DX(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 FX(n,t){var e=Math.max(n.minX,t.minX),o=Math.max(n.minY,t.minY),s=Math.min(n.maxX,t.maxX),c=Math.min(n.maxY,t.maxY);return Math.max(0,s-e)*Math.max(0,c-o)}function Dv(n,t){return n.minX<=t.minX&&n.minY<=t.minY&&t.maxX<=n.maxX&&t.maxY<=n.maxY}function Hd(n,t){return t.minX<=n.maxX&&t.minY<=n.maxY&&t.maxX>=n.minX&&t.maxY>=n.minY}function Vc(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function NC(n,t,e,o,s){for(var c=[t,e],d;c.length;)e=c.pop(),t=c.pop(),!(e-t<=o)&&(d=t+Math.ceil((e-t)/o/2)*o,NX(n,d,t,e,s),c.push(t,d,d,e))}});var zC=ot((Lit,Hv)=>{"use strict";Hv.exports=Yd;Hv.exports.default=Yd;function Yd(n,t,e){e=e||2;var o=t&&t.length,s=o?t[0]*e:n.length,c=FC(n,0,s,e,!0),d=[];if(!c||c.next===c.prev)return d;var h,g,m,_,w,x,b;if(o&&(c=XX(n,t,c,e)),n.length>80*e){h=m=n[0],g=_=n[1];for(var T=e;T<s;T+=e)w=n[T],x=n[T+1],w<h&&(h=w),x<g&&(g=x),w>m&&(m=w),x>_&&(_=x);b=Math.max(m-h,_-g),b=b!==0?32767/b:0}return sh(c,d,e,h,g,b,0),d}function FC(n,t,e,o,s){var c,d;if(s===qv(n,t,e,o)>0)for(c=t;c<e;c+=o)d=DC(c,n[c],n[c+1],d);else for(c=e-o;c>=t;c-=o)d=DC(c,n[c],n[c+1],d);return d&&$d(d,d.next)&&(uh(d),d=d.next),d}function Dl(n,t){if(!n)return n;t||(t=n);var e=n,o;do if(o=!1,!e.steiner&&($d(e,e.next)||qr(e.prev,e,e.next)===0)){if(uh(e),e=t=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==t);return t}function sh(n,t,e,o,s,c,d){if(n){!d&&c&&KX(n,o,s,c);for(var h=n,g,m;n.prev!==n.next;){if(g=n.prev,m=n.next,c?HX(n,o,s,c):qX(n)){t.push(g.i/e|0),t.push(n.i/e|0),t.push(m.i/e|0),uh(n),n=m.next,h=m.next;continue}if(n=m,n===h){d?d===1?(n=VX(Dl(n),t,e),sh(n,t,e,o,s,c,2)):d===2&&WX(n,t,e,o,s,c):sh(Dl(n),t,e,o,s,c,1);break}}}}function qX(n){var t=n.prev,e=n,o=n.next;if(qr(t,e,o)>=0)return!1;for(var s=t.x,c=e.x,d=o.x,h=t.y,g=e.y,m=o.y,_=s<c?s<d?s:d:c<d?c:d,w=h<g?h<m?h:m:g<m?g:m,x=s>c?s>d?s:d:c>d?c:d,b=h>g?h>m?h:m:g>m?g:m,T=o.next;T!==t;){if(T.x>=_&&T.x<=x&&T.y>=w&&T.y<=b&&Yc(s,h,c,g,d,m,T.x,T.y)&&qr(T.prev,T,T.next)>=0)return!1;T=T.next}return!0}function HX(n,t,e,o){var s=n.prev,c=n,d=n.next;if(qr(s,c,d)>=0)return!1;for(var h=s.x,g=c.x,m=d.x,_=s.y,w=c.y,x=d.y,b=h<g?h<m?h:m:g<m?g:m,T=_<w?_<x?_:x:w<x?w:x,I=h>g?h>m?h:m:g>m?g:m,S=_>w?_>x?_:x:w>x?w:x,E=Gv(b,T,t,e,o),R=Gv(I,S,t,e,o),C=n.prevZ,F=n.nextZ;C&&C.z>=E&&F&&F.z<=R;){if(C.x>=b&&C.x<=I&&C.y>=T&&C.y<=S&&C!==s&&C!==d&&Yc(h,_,g,w,m,x,C.x,C.y)&&qr(C.prev,C,C.next)>=0||(C=C.prevZ,F.x>=b&&F.x<=I&&F.y>=T&&F.y<=S&&F!==s&&F!==d&&Yc(h,_,g,w,m,x,F.x,F.y)&&qr(F.prev,F,F.next)>=0))return!1;F=F.nextZ}for(;C&&C.z>=E;){if(C.x>=b&&C.x<=I&&C.y>=T&&C.y<=S&&C!==s&&C!==d&&Yc(h,_,g,w,m,x,C.x,C.y)&&qr(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>=T&&F.y<=S&&F!==s&&F!==d&&Yc(h,_,g,w,m,x,F.x,F.y)&&qr(F.prev,F,F.next)>=0)return!1;F=F.nextZ}return!0}function VX(n,t,e){var o=n;do{var s=o.prev,c=o.next.next;!$d(s,c)&&UC(s,o,o.next,c)&&ah(s,c)&&ah(c,s)&&(t.push(s.i/e|0),t.push(o.i/e|0),t.push(c.i/e|0),uh(o),uh(o.next),o=n=c),o=o.next}while(o!==n);return Dl(o)}function WX(n,t,e,o,s,c){var d=n;do{for(var h=d.next.next;h!==d.prev;){if(d.i!==h.i&&t7(d,h)){var g=BC(d,h);d=Dl(d,d.next),g=Dl(g,g.next),sh(d,t,e,o,s,c,0),sh(g,t,e,o,s,c,0);return}h=h.next}d=d.next}while(d!==n)}function XX(n,t,e,o){var s=[],c,d,h,g,m;for(c=0,d=t.length;c<d;c++)h=t[c]*o,g=c<d-1?t[c+1]*o:n.length,m=FC(n,h,g,o,!1),m===m.next&&(m.steiner=!0),s.push(QX(m));for(s.sort(YX),c=0;c<s.length;c++)e=$X(s[c],e);return e}function YX(n,t){return n.x-t.x}function $X(n,t){var e=ZX(n,t);if(!e)return t;var o=BC(e,n);return Dl(o,o.next),Dl(e,e.next)}function ZX(n,t){var e=t,o=n.x,s=n.y,c=-1/0,d;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>c&&(c=h,d=e.x<e.next.x?e:e.next,h===o))return d}e=e.next}while(e!==t);if(!d)return null;var g=d,m=d.x,_=d.y,w=1/0,x;e=d;do o>=e.x&&e.x>=m&&o!==e.x&&Yc(s<_?o:c,s,m,_,s<_?c:o,s,e.x,e.y)&&(x=Math.abs(s-e.y)/(o-e.x),ah(e,n)&&(x<w||x===w&&(e.x>d.x||e.x===d.x&&JX(d,e)))&&(d=e,w=x)),e=e.next;while(e!==g);return d}function JX(n,t){return qr(n.prev,n,t.prev)<0&&qr(t.next,n,n.next)<0}function KX(n,t,e,o){var s=n;do s.z===0&&(s.z=Gv(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,jX(s)}function jX(n){var t,e,o,s,c,d,h,g,m=1;do{for(e=n,n=null,c=null,d=0;e;){for(d++,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--),c?c.nextZ=s:n=s,s.prevZ=c,c=s;e=o}c.nextZ=null,m*=2}while(d>1);return n}function Gv(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 QX(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 Yc(n,t,e,o,s,c,d,h){return(s-d)*(t-h)>=(n-d)*(c-h)&&(n-d)*(o-h)>=(e-d)*(t-h)&&(e-d)*(c-h)>=(s-d)*(o-h)}function t7(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!e7(n,t)&&(ah(n,t)&&ah(t,n)&&n7(n,t)&&(qr(n.prev,n,t.prev)||qr(n,t.prev,t))||$d(n,t)&&qr(n.prev,n,n.next)>0&&qr(t.prev,t,t.next)>0)}function qr(n,t,e){return(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y)}function $d(n,t){return n.x===t.x&&n.y===t.y}function UC(n,t,e,o){var s=Xd(qr(n,t,e)),c=Xd(qr(n,t,o)),d=Xd(qr(e,o,n)),h=Xd(qr(e,o,t));return!!(s!==c&&d!==h||s===0&&Wd(n,e,t)||c===0&&Wd(n,o,t)||d===0&&Wd(e,n,o)||h===0&&Wd(e,t,o))}function Wd(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 Xd(n){return n>0?1:n<0?-1:0}function e7(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&&UC(e,e.next,n,t))return!0;e=e.next}while(e!==n);return!1}function ah(n,t){return qr(n.prev,n,n.next)<0?qr(n,t,n.next)>=0&&qr(n,n.prev,t)>=0:qr(n,t,n.prev)<0||qr(n,n.next,t)<0}function n7(n,t){var e=n,o=!1,s=(n.x+t.x)/2,c=(n.y+t.y)/2;do e.y>c!=e.next.y>c&&e.next.y!==e.y&&s<(e.next.x-e.x)*(c-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==n);return o}function BC(n,t){var e=new kv(n.i,n.x,n.y),o=new kv(t.i,t.x,t.y),s=n.next,c=t.prev;return n.next=t,t.prev=n,e.next=s,s.prev=e,o.next=e,e.prev=o,c.next=o,o.prev=c,o}function DC(n,t,e,o){var s=new kv(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 uh(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 kv(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}Yd.deviation=function(n,t,e,o){var s=t&&t.length,c=s?t[0]*e:n.length,d=Math.abs(qv(n,0,c,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;d-=Math.abs(qv(n,m,_,e))}var w=0;for(h=0;h<o.length;h+=3){var x=o[h]*e,b=o[h+1]*e,T=o[h+2]*e;w+=Math.abs((n[x]-n[T])*(n[b+1]-n[x+1])-(n[x]-n[b])*(n[T+1]-n[x+1]))}return d===0&&w===0?0:Math.abs((w-d)/d)};function qv(n,t,e,o){for(var s=0,c=t,d=e-o;c<e;c+=o)s+=(n[d]-n[c])*(n[c+1]+n[d+1]),d=c;return s}Yd.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 c=0;c<n[s].length;c++)for(var d=0;d<t;d++)e.vertices.push(n[s][c][d]);s>0&&(o+=n[s-1].length,e.holes.push(o))}return e}});var $v=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 Ku(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=Ku;function i7(n,t,e){switch(e===void 0&&(e={}),n){case"Point":return Vv(t).geometry;case"LineString":return Xv(t).geometry;case"Polygon":return Wv(t).geometry;case"MultiPoint":return kC(t).geometry;case"MultiLineString":return GC(t).geometry;case"MultiPolygon":return qC(t).geometry;default:throw new Error(n+" is invalid")}}Oe.geometry=i7;function Vv(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(!Zd(n[0])||!Zd(n[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:n};return Ku(o,t,e)}Oe.point=Vv;function o7(n,t,e){return e===void 0&&(e={}),Jd(n.map(function(o){return Vv(o,t)}),e)}Oe.points=o7;function Wv(n,t,e){e===void 0&&(e={});for(var o=0,s=n;o<s.length;o++){var c=s[o];if(c.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var d=0;d<c[c.length-1].length;d++)if(c[c.length-1][d]!==c[0][d])throw new Error("First and last Position are not equivalent.")}var h={type:"Polygon",coordinates:n};return Ku(h,t,e)}Oe.polygon=Wv;function s7(n,t,e){return e===void 0&&(e={}),Jd(n.map(function(o){return Wv(o,t)}),e)}Oe.polygons=s7;function Xv(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 Ku(o,t,e)}Oe.lineString=Xv;function a7(n,t,e){return e===void 0&&(e={}),Jd(n.map(function(o){return Xv(o,t)}),e)}Oe.lineStrings=a7;function Jd(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=Jd;function GC(n,t,e){e===void 0&&(e={});var o={type:"MultiLineString",coordinates:n};return Ku(o,t,e)}Oe.multiLineString=GC;function kC(n,t,e){e===void 0&&(e={});var o={type:"MultiPoint",coordinates:n};return Ku(o,t,e)}Oe.multiPoint=kC;function qC(n,t,e){e===void 0&&(e={});var o={type:"MultiPolygon",coordinates:n};return Ku(o,t,e)}Oe.multiPolygon=qC;function u7(n,t,e){e===void 0&&(e={});var o={type:"GeometryCollection",geometries:n};return Ku(o,t,e)}Oe.geometryCollection=u7;function l7(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=l7;function HC(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=HC;function Yv(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=Yv;function c7(n,t){return VC(Yv(n,t))}Oe.lengthToDegrees=c7;function f7(n){var t=n%360;return t<0&&(t+=360),t}Oe.bearingToAzimuth=f7;function VC(n){var t=n%(2*Math.PI);return t*180/Math.PI}Oe.radiansToDegrees=VC;function h7(n){var t=n%360;return t*Math.PI/180}Oe.degreesToRadians=h7;function p7(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 HC(Yv(n,t),e)}Oe.convertLength=p7;function d7(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=d7;function Zd(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}Oe.isNumber=Zd;function g7(n){return!!n&&n.constructor===Object}Oe.isObject=g7;function m7(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(!Zd(t))throw new Error("bbox must only contain numbers")})}Oe.validateBBox=m7;function y7(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=y7});var Jv=ot(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});var lo=$v();function lh(n,t,e){if(n!==null)for(var o,s,c,d,h,g,m,_=0,w=0,x,b=n.type,T=b==="FeatureCollection",I=b==="Feature",S=T?n.features.length:1,E=0;E<S;E++){m=T?n.features[E].geometry:I?n.geometry:n,x=m?m.type==="GeometryCollection":!1,h=x?m.geometries.length:1;for(var R=0;R<h;R++){var C=0,F=0;if(d=x?m.geometries[R]:m,d!==null){g=d.coordinates;var W=d.type;switch(_=e&&(W==="Polygon"||W==="MultiPolygon")?1:0,W){case null:break;case"Point":if(t(g,w,E,C,F)===!1)return!1;w++,C++;break;case"LineString":case"MultiPoint":for(o=0;o<g.length;o++){if(t(g[o],w,E,C,F)===!1)return!1;w++,W==="MultiPoint"&&C++}W==="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],w,E,C,F)===!1)return!1;w++}W==="MultiLineString"&&C++,W==="Polygon"&&F++}W==="Polygon"&&C++;break;case"MultiPolygon":for(o=0;o<g.length;o++){for(F=0,s=0;s<g[o].length;s++){for(c=0;c<g[o][s].length-_;c++){if(t(g[o][s][c],w,E,C,F)===!1)return!1;w++}F++}C++}break;case"GeometryCollection":for(o=0;o<d.geometries.length;o++)if(lh(d.geometries[o],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function v7(n,t,e,o){var s=e;return lh(n,function(c,d,h,g,m){d===0&&e===void 0?s=c:s=t(s,c,d,h,g,m)},o),s}function WC(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 _7(n,t,e){var o=e;return WC(n,function(s,c){c===0&&e===void 0?o=s:o=t(o,s,c)}),o}function XC(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 x7(n,t,e){var o=e;return XC(n,function(s,c){c===0&&e===void 0?o=s:o=t(o,s,c)}),o}function E7(n){var t=[];return lh(n,function(e){t.push(e)}),t}function Zv(n,t){var e,o,s,c,d,h,g,m,_,w,x=0,b=n.type==="FeatureCollection",T=n.type==="Feature",I=b?n.features.length:1;for(e=0;e<I;e++){for(h=b?n.features[e].geometry:T?n.geometry:n,m=b?n.features[e].properties:T?n.properties:{},_=b?n.features[e].bbox:T?n.bbox:void 0,w=b?n.features[e].id:T?n.id:void 0,g=h?h.type==="GeometryCollection":!1,d=g?h.geometries.length:1,s=0;s<d;s++){if(c=g?h.geometries[s]:h,c===null){if(t(null,x,m,_,w)===!1)return!1;continue}switch(c.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(c,x,m,_,w)===!1)return!1;break}case"GeometryCollection":{for(o=0;o<c.geometries.length;o++)if(t(c.geometries[o],x,m,_,w)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}x++}}function w7(n,t,e){var o=e;return Zv(n,function(s,c,d,h,g){c===0&&e===void 0?o=s:o=t(o,s,c,d,h,g)}),o}function Kd(n,t){Zv(n,function(e,o,s,c,d){var h=e===null?null:e.type;switch(h){case null:case"Point":case"LineString":case"Polygon":return t(lo.feature(e,s,{bbox:c,id:d}),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],w={type:g,coordinates:_};if(t(lo.feature(w,s),o,m)===!1)return!1}})}function S7(n,t,e){var o=e;return Kd(n,function(s,c,d){c===0&&d===0&&e===void 0?o=s:o=t(o,s,c,d)}),o}function YC(n,t){Kd(n,function(e,o,s){var c=0;if(e.geometry){var d=e.geometry.type;if(!(d==="Point"||d==="MultiPoint")){var h,g=0,m=0,_=0;if(lh(e,function(w,x,b,T,I){if(h===void 0||o>g||T>m||I>_){h=w,g=o,m=T,_=I,c=0;return}var S=lo.lineString([h,w],e.properties);if(t(S,o,s,I,c)===!1)return!1;c++,h=w})===!1)return!1}}})}function M7(n,t,e){var o=e,s=!1;return YC(n,function(c,d,h,g,m){s===!1&&e===void 0?o=c:o=t(o,c,d,h,g,m),s=!0}),o}function $C(n,t){if(!n)throw new Error("geojson is required");Kd(n,function(e,o,s){if(e.geometry!==null){var c=e.geometry.type,d=e.geometry.coordinates;switch(c){case"LineString":if(t(e,o,s,0,0)===!1)return!1;break;case"Polygon":for(var h=0;h<d.length;h++)if(t(lo.lineString(d[h],e.properties),o,s,h)===!1)return!1;break}}})}function b7(n,t,e){var o=e;return $C(n,function(s,c,d,h){c===0&&e===void 0?o=s:o=t(o,s,c,d,h)}),o}function A7(n,t){if(t=t||{},!lo.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,s=t.geometryIndex||0,c=t.segmentIndex||0,d=t.properties,h;switch(n.type){case"FeatureCollection":e<0&&(e=n.features.length+e),d=d||n.features[e].properties,h=n.features[e].geometry;break;case"Feature":d=d||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 c<0&&(c=g.length+c-1),lo.lineString([g[c],g[c+1]],d,t);case"Polygon":return s<0&&(s=g.length+s),c<0&&(c=g[s].length+c-1),lo.lineString([g[s][c],g[s][c+1]],d,t);case"MultiLineString":return o<0&&(o=g.length+o),c<0&&(c=g[o].length+c-1),lo.lineString([g[o][c],g[o][c+1]],d,t);case"MultiPolygon":return o<0&&(o=g.length+o),s<0&&(s=g[o].length+s),c<0&&(c=g[o][s].length-c-1),lo.lineString([g[o][s][c],g[o][s][c+1]],d,t)}throw new Error("geojson is invalid")}function T7(n,t){if(t=t||{},!lo.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,s=t.geometryIndex||0,c=t.coordIndex||0,d=t.properties,h;switch(n.type){case"FeatureCollection":e<0&&(e=n.features.length+e),d=d||n.features[e].properties,h=n.features[e].geometry;break;case"Feature":d=d||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 lo.point(g,d,t);case"MultiPoint":return o<0&&(o=g.length+o),lo.point(g[o],d,t);case"LineString":return c<0&&(c=g.length+c),lo.point(g[c],d,t);case"Polygon":return s<0&&(s=g.length+s),c<0&&(c=g[s].length+c),lo.point(g[s][c],d,t);case"MultiLineString":return o<0&&(o=g.length+o),c<0&&(c=g[o].length+c),lo.point(g[o][c],d,t);case"MultiPolygon":return o<0&&(o=g.length+o),s<0&&(s=g[o].length+s),c<0&&(c=g[o][s].length-c),lo.point(g[o][s][c],d,t)}throw new Error("geojson is invalid")}Ei.coordAll=E7;Ei.coordEach=lh;Ei.coordReduce=v7;Ei.featureEach=XC;Ei.featureReduce=x7;Ei.findPoint=T7;Ei.findSegment=A7;Ei.flattenEach=Kd;Ei.flattenReduce=S7;Ei.geomEach=Zv;Ei.geomReduce=w7;Ei.lineEach=$C;Ei.lineReduce=b7;Ei.propEach=WC;Ei.propReduce=_7;Ei.segmentEach=YC;Ei.segmentReduce=M7});var ZC=ot(jv=>{"use strict";Object.defineProperty(jv,"__esModule",{value:!0});var C7=Jv();function Kv(n){var t=[1/0,1/0,-1/0,-1/0];return C7.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}Kv.default=Kv;jv.default=Kv});var jd=ot(($it,Qv)=>{var Pa=Mv(),KC=$v(),jC=Jv(),$c=ZC().default,P7=jC.featureEach,Xit=jC.coordEach,Yit=KC.polygon,JC=KC.featureCollection;function QC(n){var t=new Pa(n);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:$c(e),Pa.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:$c(s),o.push(s)}):P7(e,function(s){if(s.type!=="Feature")throw new Error("invalid features");s.bbox=s.bbox?s.bbox:$c(s),o.push(s)}),Pa.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:$c(e),Pa.prototype.remove.call(this,e,o)},t.clear=function(){return Pa.prototype.clear.call(this)},t.search=function(e){var o=Pa.prototype.search.call(this,this.toBBox(e));return JC(o)},t.collides=function(e){return Pa.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=Pa.prototype.all.call(this);return JC(e)},t.toJSON=function(){return Pa.prototype.toJSON.call(this)},t.fromJSON=function(e){return Pa.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=$c(e);else if(e.type==="FeatureCollection")o=$c(e);else throw new Error("invalid geojson");return{minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]}},t}Qv.exports=QC;Qv.exports.default=QC});var o_=ot((rat,lP)=>{"use strict";var uP=Object.prototype.toString;lP.exports=function(t){var e=uP.call(t),o=e==="[object Arguments]";return o||(o=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&uP.call(t.callee)==="[object Function]"),o}});var vP=ot((iat,yP)=>{"use strict";var mP;Object.keys||(hh=Object.prototype.hasOwnProperty,s_=Object.prototype.toString,cP=o_(),a_=Object.prototype.propertyIsEnumerable,fP=!a_.call({toString:null},"toString"),hP=a_.call(function(){},"prototype"),ph=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],rg=function(n){var t=n.constructor;return t&&t.prototype===n},pP={$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},dP=function(){if(typeof window=="undefined")return!1;for(var n in window)try{if(!pP["$"+n]&&hh.call(window,n)&&window[n]!==null&&typeof window[n]=="object")try{rg(window[n])}catch(t){return!0}}catch(t){return!0}return!1}(),gP=function(n){if(typeof window=="undefined"||!dP)return rg(n);try{return rg(n)}catch(t){return!1}},mP=function(t){var e=t!==null&&typeof t=="object",o=s_.call(t)==="[object Function]",s=cP(t),c=e&&s_.call(t)==="[object String]",d=[];if(!e&&!o&&!s)throw new TypeError("Object.keys called on a non-object");var h=hP&&o;if(c&&t.length>0&&!hh.call(t,0))for(var g=0;g<t.length;++g)d.push(String(g));if(s&&t.length>0)for(var m=0;m<t.length;++m)d.push(String(m));else for(var _ in t)!(h&&_==="prototype")&&hh.call(t,_)&&d.push(String(_));if(fP)for(var w=gP(t),x=0;x<ph.length;++x)!(w&&ph[x]==="constructor")&&hh.call(t,ph[x])&&d.push(ph[x]);return d});var hh,s_,cP,a_,fP,hP,ph,rg,pP,dP,gP;yP.exports=mP});var u_=ot((oat,EP)=>{"use strict";var z7=Array.prototype.slice,G7=o_(),_P=Object.keys,ig=_P?function(t){return _P(t)}:vP(),xP=Object.keys;ig.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 G7(o)?xP(z7.call(o)):xP(o)})}else Object.keys=ig;return Object.keys||ig};EP.exports=ig});var l_=ot((sat,wP)=>{"use strict";wP.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 c 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 d=Object.getOwnPropertySymbols(t);if(d.length!==1||d[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 og=ot((aat,SP)=>{"use strict";var k7=l_();SP.exports=function(){return k7()&&!!Symbol.toStringTag}});var c_=ot((uat,MP)=>{"use strict";MP.exports=Object});var f_=ot((lat,bP)=>{"use strict";bP.exports=Error});var TP=ot((cat,AP)=>{"use strict";AP.exports=EvalError});var PP=ot((fat,CP)=>{"use strict";CP.exports=RangeError});var RP=ot((hat,IP)=>{"use strict";IP.exports=ReferenceError});var h_=ot((pat,LP)=>{"use strict";LP.exports=SyntaxError});var Fl=ot((dat,NP)=>{"use strict";NP.exports=TypeError});var DP=ot((gat,OP)=>{"use strict";OP.exports=URIError});var UP=ot((mat,FP)=>{"use strict";FP.exports=Math.abs});var zP=ot((yat,BP)=>{"use strict";BP.exports=Math.floor});var kP=ot((vat,GP)=>{"use strict";GP.exports=Math.max});var HP=ot((_at,qP)=>{"use strict";qP.exports=Math.min});var WP=ot((xat,VP)=>{"use strict";VP.exports=Math.pow});var YP=ot((Eat,XP)=>{"use strict";XP.exports=Math.round});var ZP=ot((wat,$P)=>{"use strict";$P.exports=Number.isNaN||function(t){return t!==t}});var KP=ot((Sat,JP)=>{"use strict";var q7=ZP();JP.exports=function(t){return q7(t)||t===0?t:t<0?-1:1}});var QP=ot((Mat,jP)=>{"use strict";jP.exports=Object.getOwnPropertyDescriptor});var Ul=ot((bat,tI)=>{"use strict";var sg=QP();if(sg)try{sg([],"length")}catch(n){sg=null}tI.exports=sg});var dh=ot((Aat,eI)=>{"use strict";var ag=Object.defineProperty||!1;if(ag)try{ag({},"a",{value:1})}catch(n){ag=!1}eI.exports=ag});var iI=ot((Tat,rI)=>{"use strict";var nI=typeof Symbol!="undefined"&&Symbol,H7=l_();rI.exports=function(){return typeof nI!="function"||typeof Symbol!="function"||typeof nI("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:H7()}});var p_=ot((Cat,oI)=>{"use strict";oI.exports=typeof Reflect!="undefined"&&Reflect.getPrototypeOf||null});var d_=ot((Pat,sI)=>{"use strict";var V7=c_();sI.exports=V7.getPrototypeOf||null});var lI=ot((Iat,uI)=>{"use strict";var W7="Function.prototype.bind called on incompatible ",X7=Object.prototype.toString,Y7=Math.max,$7="[object Function]",aI=function(t,e){for(var o=[],s=0;s<t.length;s+=1)o[s]=t[s];for(var c=0;c<e.length;c+=1)o[c+t.length]=e[c];return o},Z7=function(t,e){for(var o=[],s=e||0,c=0;s<t.length;s+=1,c+=1)o[c]=t[s];return o},J7=function(n,t){for(var e="",o=0;o<n.length;o+=1)e+=n[o],o+1<n.length&&(e+=t);return e};uI.exports=function(t){var e=this;if(typeof e!="function"||X7.apply(e)!==$7)throw new TypeError(W7+e);for(var o=Z7(arguments,1),s,c=function(){if(this instanceof s){var _=e.apply(this,aI(o,arguments));return Object(_)===_?_:this}return e.apply(t,aI(o,arguments))},d=Y7(0,e.length-o.length),h=[],g=0;g<d;g++)h[g]="$"+g;if(s=Function("binder","return function ("+J7(h,",")+"){ return binder.apply(this,arguments); }")(c),e.prototype){var m=function(){};m.prototype=e.prototype,s.prototype=new m,m.prototype=null}return s}});var Zc=ot((Rat,cI)=>{"use strict";var K7=lI();cI.exports=Function.prototype.bind||K7});var ug=ot((Lat,fI)=>{"use strict";fI.exports=Function.prototype.call});var lg=ot((Nat,hI)=>{"use strict";hI.exports=Function.prototype.apply});var dI=ot((Oat,pI)=>{"use strict";pI.exports=typeof Reflect!="undefined"&&Reflect&&Reflect.apply});var g_=ot((Dat,gI)=>{"use strict";var j7=Zc(),Q7=lg(),tY=ug(),eY=dI();gI.exports=eY||j7.call(tY,Q7)});var cg=ot((Fat,mI)=>{"use strict";var nY=Zc(),rY=Fl(),iY=ug(),oY=g_();mI.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new rY("a function is required");return oY(nY,iY,t)}});var wI=ot((Uat,EI)=>{"use strict";var sY=cg(),yI=Ul(),_I;try{_I=[].__proto__===Array.prototype}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var m_=!!_I&&yI&&yI(Object.prototype,"__proto__"),xI=Object,vI=xI.getPrototypeOf;EI.exports=m_&&typeof m_.get=="function"?sY([m_.get]):typeof vI=="function"?function(t){return vI(t==null?t:xI(t))}:!1});var y_=ot((Bat,AI)=>{"use strict";var SI=p_(),MI=d_(),bI=wI();AI.exports=SI?function(t){return SI(t)}:MI?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return MI(t)}:bI?function(t){return bI(t)}:null});var v_=ot((zat,TI)=>{"use strict";var aY=Function.prototype.call,uY=Object.prototype.hasOwnProperty,lY=Zc();TI.exports=lY.call(aY,uY)});var E_=ot((Gat,NI)=>{"use strict";var Fn,cY=c_(),fY=f_(),hY=TP(),pY=PP(),dY=RP(),Qc=h_(),jc=Fl(),gY=DP(),mY=UP(),yY=zP(),vY=kP(),_Y=HP(),xY=WP(),EY=YP(),wY=KP(),RI=Function,__=function(n){try{return RI('"use strict"; return ('+n+").constructor;")()}catch(t){}},gh=Ul(),SY=dh(),x_=function(){throw new jc},MY=gh?function(){try{return arguments.callee,x_}catch(n){try{return gh(arguments,"callee").get}catch(t){return x_}}}():x_,Jc=iI()(),ki=y_(),bY=d_(),AY=p_(),LI=lg(),mh=ug(),Kc={},TY=typeof Uint8Array=="undefined"||!ki?Fn:ki(Uint8Array),Bl={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?Fn:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?Fn:ArrayBuffer,"%ArrayIteratorPrototype%":Jc&&ki?ki([][Symbol.iterator]()):Fn,"%AsyncFromSyncIteratorPrototype%":Fn,"%AsyncFunction%":Kc,"%AsyncGenerator%":Kc,"%AsyncGeneratorFunction%":Kc,"%AsyncIteratorPrototype%":Kc,"%Atomics%":typeof Atomics=="undefined"?Fn:Atomics,"%BigInt%":typeof BigInt=="undefined"?Fn:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?Fn:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?Fn:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?Fn:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":fY,"%eval%":eval,"%EvalError%":hY,"%Float16Array%":typeof Float16Array=="undefined"?Fn:Float16Array,"%Float32Array%":typeof Float32Array=="undefined"?Fn:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?Fn:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?Fn:FinalizationRegistry,"%Function%":RI,"%GeneratorFunction%":Kc,"%Int8Array%":typeof Int8Array=="undefined"?Fn:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?Fn:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?Fn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Jc&&ki?ki(ki([][Symbol.iterator]())):Fn,"%JSON%":typeof JSON=="object"?JSON:Fn,"%Map%":typeof Map=="undefined"?Fn:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!Jc||!ki?Fn:ki(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":cY,"%Object.getOwnPropertyDescriptor%":gh,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?Fn:Promise,"%Proxy%":typeof Proxy=="undefined"?Fn:Proxy,"%RangeError%":pY,"%ReferenceError%":dY,"%Reflect%":typeof Reflect=="undefined"?Fn:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?Fn:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!Jc||!ki?Fn:ki(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?Fn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Jc&&ki?ki(""[Symbol.iterator]()):Fn,"%Symbol%":Jc?Symbol:Fn,"%SyntaxError%":Qc,"%ThrowTypeError%":MY,"%TypedArray%":TY,"%TypeError%":jc,"%Uint8Array%":typeof Uint8Array=="undefined"?Fn:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?Fn:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?Fn:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?Fn:Uint32Array,"%URIError%":gY,"%WeakMap%":typeof WeakMap=="undefined"?Fn:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?Fn:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?Fn:WeakSet,"%Function.prototype.call%":mh,"%Function.prototype.apply%":LI,"%Object.defineProperty%":SY,"%Object.getPrototypeOf%":bY,"%Math.abs%":mY,"%Math.floor%":yY,"%Math.max%":vY,"%Math.min%":_Y,"%Math.pow%":xY,"%Math.round%":EY,"%Math.sign%":wY,"%Reflect.getPrototypeOf%":AY};if(ki)try{null.error}catch(n){CI=ki(ki(n)),Bl["%Error.prototype%"]=CI}var CI,CY=function n(t){var e;if(t==="%AsyncFunction%")e=__("async function () {}");else if(t==="%GeneratorFunction%")e=__("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=__("async function* () {}");else if(t==="%AsyncGenerator%"){var o=n("%AsyncGeneratorFunction%");o&&(e=o.prototype)}else if(t==="%AsyncIteratorPrototype%"){var s=n("%AsyncGenerator%");s&&ki&&(e=ki(s.prototype))}return Bl[t]=e,e},PI={__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"]},yh=Zc(),fg=v_(),PY=yh.call(mh,Array.prototype.concat),IY=yh.call(LI,Array.prototype.splice),II=yh.call(mh,String.prototype.replace),hg=yh.call(mh,String.prototype.slice),RY=yh.call(mh,RegExp.prototype.exec),LY=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,NY=/\\\\(\\\\)?/g,OY=function(t){var e=hg(t,0,1),o=hg(t,-1);if(e==="%"&&o!=="%")throw new Qc("invalid intrinsic syntax, expected closing \`%\`");if(o==="%"&&e!=="%")throw new Qc("invalid intrinsic syntax, expected opening \`%\`");var s=[];return II(t,LY,function(c,d,h,g){s[s.length]=h?II(g,NY,"$1"):d||c}),s},DY=function(t,e){var o=t,s;if(fg(PI,o)&&(s=PI[o],o="%"+s[0]+"%"),fg(Bl,o)){var c=Bl[o];if(c===Kc&&(c=CY(o)),typeof c=="undefined"&&!e)throw new jc("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:s,name:o,value:c}}throw new Qc("intrinsic "+t+" does not exist!")};NI.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new jc("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new jc('"allowMissing" argument must be a boolean');if(RY(/^%?[^%]*%?$/,t)===null)throw new Qc("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var o=OY(t),s=o.length>0?o[0]:"",c=DY("%"+s+"%",e),d=c.name,h=c.value,g=!1,m=c.alias;m&&(s=m[0],IY(o,PY([0,1],m)));for(var _=1,w=!0;_<o.length;_+=1){var x=o[_],b=hg(x,0,1),T=hg(x,-1);if((b==='"'||b==="'"||b==="\`"||T==='"'||T==="'"||T==="\`")&&b!==T)throw new Qc("property names with quotes must have matching quotes");if((x==="constructor"||!w)&&(g=!0),s+="."+x,d="%"+s+"%",fg(Bl,d))h=Bl[d];else if(h!=null){if(!(x in h)){if(!e)throw new jc("base intrinsic for "+t+" exists, but the property is not available.");return}if(gh&&_+1>=o.length){var I=gh(h,x);w=!!I,w&&"get"in I&&!("originalValue"in I.get)?h=I.get:h=h[x]}else w=fg(h,x),h=h[x];w&&!g&&(Bl[d]=h)}}return h}});var pg=ot((kat,FI)=>{"use strict";var OI=E_(),DI=cg(),FY=DI([OI("%String.prototype.indexOf%")]);FI.exports=function(t,e){var o=OI(t,!!e);return typeof o=="function"&&FY(t,".prototype.")>-1?DI([o]):o}});var zI=ot((qat,BI)=>{"use strict";var UY=og()(),BY=pg(),w_=BY("Object.prototype.toString"),dg=function(t){return UY&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:w_(t)==="[object Arguments]"},UI=function(t){return dg(t)?!0:t!==null&&typeof t=="object"&&"length"in t&&typeof t.length=="number"&&t.length>=0&&w_(t)!=="[object Array]"&&"callee"in t&&w_(t.callee)==="[object Function]"},zY=function(){return dg(arguments)}();dg.isLegacyArguments=UI;BI.exports=zY?dg:UI});var gg=ot((Hat,qI)=>{"use strict";var GI=dh(),GY=h_(),tf=Fl(),kI=Ul();qI.exports=function(t,e,o){if(!t||typeof t!="object"&&typeof t!="function")throw new tf("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new tf("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new tf("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new tf("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new tf("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new tf("\`loose\`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,d=arguments.length>5?arguments[5]:null,h=arguments.length>6?arguments[6]:!1,g=!!kI&&kI(t,e);if(GI)GI(t,e,{configurable:d===null&&g?g.configurable:!d,enumerable:s===null&&g?g.enumerable:!s,value:o,writable:c===null&&g?g.writable:!c});else if(h||!s&&!c&&!d)t[e]=o;else throw new GY("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var mg=ot((Vat,VI)=>{"use strict";var S_=dh(),HI=function(){return!!S_};HI.hasArrayLengthDefineBug=function(){if(!S_)return null;try{return S_([],"length",{value:1}).length!==1}catch(t){return!0}};VI.exports=HI});var ef=ot((Wat,$I)=>{"use strict";var kY=u_(),qY=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",HY=Object.prototype.toString,VY=Array.prototype.concat,WI=gg(),WY=function(n){return typeof n=="function"&&HY.call(n)==="[object Function]"},XI=mg()(),XY=function(n,t,e,o){if(t in n){if(o===!0){if(n[t]===e)return}else if(!WY(o)||!o())return}XI?WI(n,t,e,!0):WI(n,t,e)},YI=function(n,t){var e=arguments.length>2?arguments[2]:{},o=kY(t);qY&&(o=VY.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s<o.length;s+=1)XY(n,o[s],t[o[s]],e[o[s]])};YI.supportsDescriptors=!!XI;$I.exports=YI});var QI=ot((Xat,jI)=>{"use strict";var YY=E_(),ZI=gg(),$Y=mg()(),JI=Ul(),KI=Fl(),ZY=YY("%Math.floor%");jI.exports=function(t,e){if(typeof t!="function")throw new KI("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||ZY(e)!==e)throw new KI("\`length\` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],s=!0,c=!0;if("length"in t&&JI){var d=JI(t,"length");d&&!d.configurable&&(s=!1),d&&!d.writable&&(c=!1)}return(s||c||!o)&&($Y?ZI(t,"length",e,!0,!0):ZI(t,"length",e)),t}});var eR=ot((Yat,tR)=>{"use strict";var JY=Zc(),KY=lg(),jY=g_();tR.exports=function(){return jY(JY,KY,arguments)}});var M_=ot(($at,yg)=>{"use strict";var QY=QI(),nR=dh(),t$=cg(),rR=eR();yg.exports=function(t){var e=t$(arguments),o=t.length-(arguments.length-1);return QY(e,1+(o>0?o:0),!0)};nR?nR(yg.exports,"apply",{value:rR}):yg.exports.apply=rR});var b_=ot((Zat,oR)=>{"use strict";var iR=function(n){return n!==n};oR.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||iR(t)&&iR(e))}});var A_=ot((Jat,sR)=>{"use strict";var e$=b_();sR.exports=function(){return typeof Object.is=="function"?Object.is:e$}});var uR=ot((Kat,aR)=>{"use strict";var n$=A_(),r$=ef();aR.exports=function(){var t=n$();return r$(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var hR=ot((jat,fR)=>{"use strict";var i$=ef(),o$=M_(),s$=b_(),lR=A_(),a$=uR(),cR=o$(lR(),Object);i$(cR,{getPolyfill:lR,implementation:s$,shim:a$});fR.exports=cR});var vR=ot((Qat,yR)=>{"use strict";var pR=pg(),u$=og()(),l$=v_(),c$=Ul(),P_;u$?(dR=pR("RegExp.prototype.exec"),T_={},vg=function(){throw T_},C_={toString:vg,valueOf:vg},typeof Symbol.toPrimitive=="symbol"&&(C_[Symbol.toPrimitive]=vg),P_=function(t){if(!t||typeof t!="object")return!1;var e=c$(t,"lastIndex"),o=e&&l$(e,"value");if(!o)return!1;try{dR(t,C_)}catch(s){return s===T_}}):(gR=pR("Object.prototype.toString"),mR="[object RegExp]",P_=function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:gR(t)===mR});var dR,T_,vg,C_,gR,mR;yR.exports=P_});var xR=ot((tut,_R)=>{"use strict";var _h=function(){return typeof function(){}.name=="string"},vh=Object.getOwnPropertyDescriptor;if(vh)try{vh([],"length")}catch(n){vh=null}_h.functionsHaveConfigurableNames=function(){if(!_h()||!vh)return!1;var t=vh(function(){},"name");return!!t&&!!t.configurable};var f$=Function.prototype.bind;_h.boundFunctionsHaveNames=function(){return _h()&&typeof f$=="function"&&function(){}.bind().name!==""};_R.exports=_h});var SR=ot((eut,wR)=>{"use strict";var ER=gg(),h$=mg()(),p$=xR().functionsHaveConfigurableNames(),d$=Fl();wR.exports=function(t,e){if(typeof t!="function")throw new d$("\`fn\` is not a function");var o=arguments.length>2&&!!arguments[2];return(!o||p$)&&(h$?ER(t,"name",e,!0,!0):ER(t,"name",e)),t}});var I_=ot((nut,MR)=>{"use strict";var g$=SR(),m$=Fl(),y$=Object;MR.exports=g$(function(){if(this==null||this!==y$(this))throw new m$("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 R_=ot((rut,bR)=>{"use strict";var v$=I_(),_$=ef().supportsDescriptors,x$=Object.getOwnPropertyDescriptor;bR.exports=function(){if(_$&&/a/mig.flags==="gim"){var t=x$(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 v$}});var CR=ot((iut,TR)=>{"use strict";var E$=ef().supportsDescriptors,w$=R_(),S$=Ul(),M$=Object.defineProperty,b$=f_(),AR=y_(),A$=/a/;TR.exports=function(){if(!E$||!AR)throw new b$("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=w$(),e=AR(A$),o=S$(e,"flags");return(!o||o.get!==t)&&M$(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var LR=ot((out,RR)=>{"use strict";var T$=ef(),C$=M_(),P$=I_(),PR=R_(),I$=CR(),IR=C$(PR());T$(IR,{getPolyfill:PR,implementation:P$,shim:I$});RR.exports=IR});var DR=ot((sut,OR)=>{"use strict";var NR=pg(),R$=NR("Date.prototype.getDay"),L$=function(t){try{return R$(t),!0}catch(e){return!1}},N$=NR("Object.prototype.toString"),O$="[object Date]",D$=og()();OR.exports=function(t){return typeof t!="object"||t===null?!1:D$?L$(t):N$(t)===O$}});var L_=ot((aut,XR)=>{var FR=u_(),UR=zI(),BR=hR(),zR=vR(),GR=LR(),kR=DR(),qR=Date.prototype.getTime;function WR(n,t,e){var o=e||{};return(o.strict?BR(n,t):n===t)?!0:!n||!t||typeof n!="object"&&typeof t!="object"?o.strict?BR(n,t):n==t:F$(n,t,o)}function HR(n){return n==null}function VR(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 F$(n,t,e){var o,s;if(typeof n!=typeof t||HR(n)||HR(t)||n.prototype!==t.prototype||UR(n)!==UR(t))return!1;var c=zR(n),d=zR(t);if(c!==d)return!1;if(c||d)return n.source===t.source&&GR(n)===GR(t);if(kR(n)&&kR(t))return qR.call(n)===qR.call(t);var h=VR(n),g=VR(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=FR(n),_=FR(t)}catch(w){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],!WR(n[s],t[s],e))return!1;return!0}XR.exports=WR});var V_=ot((pct,QR)=>{var AZ=L_(),Ia=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:TZ};Ia.prototype.compare=function(n,t){if(n.type!==t.type||!jR(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=KR(n),s=KR(t);return o.every(function(c){return this.some(function(d){return e.compare(c,d)})},s)}}return!1};function KR(n){return n.coordinates.map(function(t){return{type:n.type.replace("Multi",""),coordinates:t}})}function jR(n,t){return n.hasOwnProperty("coordinates")?n.coordinates.length===t.coordinates.length:n.length===t.length}Ia.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};Ia.prototype.compareLine=function(n,t,e,o){if(!jR(n,t))return!1;var s=this.pseudoNode?n:this.removePseudo(n),c=this.pseudoNode?t:this.removePseudo(t);if(!(o&&!this.compareCoord(s[0],c[0])&&(c=this.fixStartIndex(c,s),!c))){var d=this.compareCoord(s[e],c[e]);return this.direction||d?this.comparePath(s,c):this.compareCoord(s[e],c[c.length-(1+e)])?this.comparePath(s.slice().reverse(),c):!1}};Ia.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};Ia.prototype.comparePath=function(n,t){var e=this;return n.every(function(o,s){return e.compareCoord(o,this[s])},t)};Ia.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(c){return this.some(function(d){return s.compareLine(c,d,1,!0)})},o)}else return!1};Ia.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)};Ia.prototype.compareBBox=function(n,t){return!!(!n.bbox&&!t.bbox||n.bbox&&t.bbox&&this.compareCoord(n.bbox,t.bbox))};Ia.prototype.removePseudo=function(n){return n};function TZ(n,t){return AZ(n,t,{strict:!0})}QR.exports=Ia});var tL=ot((bct,Eg)=>{function Qu(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)}Qu.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 c=this._regionQuery(s);if(c.length<this.minPts)this.noise.push(s);else{var d=this.clusters.length;this.clusters.push([]),this._addToCluster(s,d),this._expandCluster(d,c)}}return this.clusters};Qu.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)};Qu.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)}};Qu.prototype._addToCluster=function(n,t){this.clusters[t].push(n),this._assigned[n]=1};Qu.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};Qu.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};Qu.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 Eg!="undefined"&&Eg.exports&&(Eg.exports=Qu)});var eL=ot((Act,wg)=>{function tl(n,t,e){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(n,t,e)}tl.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)};tl.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 c=0;c<this.k;c++){for(var d=new Array(_),h=0,g=0;g<_;g++)d[g]=0;for(var m=0;m<e;m++){var _=this.dataset[m].length;if(c===this.assignments[m]){for(var g=0;g<_;g++)d[g]+=this.dataset[m][g];h++}}if(h>0){for(var g=0;g<_;g++)d[g]/=h;this.centroids[c]=d}else this.centroids[c]=this.randomCentroid(),s=!0}}return this.getClusters()};tl.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};tl.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};tl.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};tl.prototype.argmin=function(n,t,e){for(var o=Number.MAX_VALUE,s=0,c=t.length,d,h=0;h<c;h++)d=e(n,t[h]),d<o&&(o=d,s=h);return s};tl.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 wg!="undefined"&&wg.exports&&(wg.exports=tl)});var W_=ot((Tct,Sg)=>{function Ra(n,t,e){this._queue=[],this._priorities=[],this._sorting="desc",this._init(n,t,e)}Ra.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)};Ra.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}}};Ra.prototype.forEach=function(n){this._queue.forEach(n)};Ra.prototype.getElements=function(){return this._queue};Ra.prototype.getElementPriority=function(n){return this._priorities[n]};Ra.prototype.getPriorities=function(){return this._priorities};Ra.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};Ra.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)};Ra.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 Sg!="undefined"&&Sg.exports&&(Sg.exports=Ra)});var rL=ot((Cct,rf)=>{typeof rf!="undefined"&&rf.exports&&(nL=W_());var nL;function pu(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)}pu.prototype.run=function(n,t,e,o){this._init(n,t,e,o);for(var s=0,c=this.dataset.length;s<c;s++)if(this._processed[s]!==1){this._processed[s]=1,this.clusters.push([s]);var d=this.clusters.length-1;this._orderedList.push(s);var h=new nL(null,null,"asc"),g=this._regionQuery(s);this._distanceToCore(s)!==void 0&&(this._updateQueue(s,g,h),this._expandCluster(d,h))}return this.clusters};pu.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};pu.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)};pu.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 c=o.distance(o.dataset[n],o.dataset[s]),d=Math.max(o._coreDistance,c);o._reachability[s]===void 0?(o._reachability[s]=d,e.insert(s,d)):d<o._reachability[s]&&(o._reachability[s]=d,e.remove(s),e.insert(s,d))}})};pu.prototype._expandCluster=function(n,t){for(var e=t.getElements(),o=0,s=e.length;o<s;o++){var c=e[o];if(this._processed[c]===void 0){var d=this._regionQuery(c);this._processed[c]=1,this.clusters[n].push(c),this._orderedList.push(c),this._distanceToCore(c)!==void 0&&(this._updateQueue(c,d,t),this._expandCluster(n,t))}}};pu.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}};pu.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};pu.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 rf!="undefined"&&rf.exports&&(rf.exports=pu)});var iL=ot((Pct,Mg)=>{typeof Mg!="undefined"&&Mg.exports&&(Mg.exports={DBSCAN:tL(),KMEANS:eL(),OPTICS:rL(),PriorityQueue:W_()})});var X_=ot((Dct,sL)=>{"use strict";sL.exports={eudist:function(t,e,o){for(var s=t.length,c=0,d=0;d<s;d++){var h=(t[d]||0)-(e[d]||0);c+=h*h}return o?Math.sqrt(c):c},mandist:function(t,e,o){for(var s=t.length,c=0,d=0;d<s;d++)c+=Math.abs((t[d]||0)-(e[d]||0));return o?Math.sqrt(c):c},dist:function(t,e,o){var s=Math.abs(t-e);return o?s:s*s}}});var lL=ot((Fct,uL)=>{"use strict";var aL=X_(),NZ=aL.eudist,OZ=aL.dist;uL.exports={kmrand:function(t,e){for(var o={},s=[],c=e<<2,d=t.length,h=t[0].length>0;s.length<e&&c-- >0;){var g=t[Math.floor(Math.random()*d)],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?NZ:OZ,s=[],c=t.length,d=t[0].length>0,h={},g=t[Math.floor(Math.random()*c)],m=d?g.join("_"):""+g;for(s.push(g),h[m]=!0;s.length<e;){for(var _=[],w=s.length,x=0,b=[],T=0;T<c;T++){for(var I=1/0,S=0;S<w;S++){var E=o(t[T],s[S]);E<=I&&(I=E)}_[T]=I}for(var R=0;R<c;R++)x+=_[R];for(var C=0;C<c;C++)b[C]={i:C,v:t[C],pr:_[C]/x,cs:0};b.sort(function(q,D){return q.pr-D.pr}),b[0].cs=b[0].pr;for(var F=1;F<c;F++)b[F].cs=b[F-1].cs+b[F].pr;for(var W=Math.random(),X=0;X<c-1&&b[X++].cs<W;);s.push(b[X-1].v)}return s}}});var dL=ot((zct,pL)=>{"use strict";var Y_=X_(),hL=lL(),DZ=Y_.eudist,Uct=Y_.mandist,Bct=Y_.dist,FZ=hL.kmrand,UZ=hL.kmpp,cL=1e4;function fL(n,t,e){e=e||[];for(var o=0;o<n;o++)e[o]=t;return e}function BZ(n,t,e,o){var s=[],c=[],d=[],h=[],g=!1,m=o||cL,_=n.length,w=n[0].length,x=w>0,b=[];if(e)e=="kmrand"?s=FZ(n,t):e=="kmpp"?s=UZ(n,t):s=e;else for(var T={};s.length<t;){var I=Math.floor(Math.random()*_);T[I]||(T[I]=!0,s.push(n[I]))}do{fL(t,0,b);for(var S=0;S<_;S++){for(var E=1/0,R=0,C=0;C<t;C++){var h=x?DZ(n[S],s[C]):Math.abs(n[S]-s[C]);h<=E&&(E=h,R=C)}d[S]=R,b[R]++}for(var F=[],c=[],W=0,X=0;X<t;X++)F[X]=x?fL(w,0,F[X]):0,c[X]=s[X];if(x){for(var q=0;q<t;q++)s[q]=[];for(var D=0;D<_;D++)for(var xt=d[D],B=F[xt],j=n[D],J=0;J<w;J++)B[J]+=j[J];g=!0;for(var Dt=0;Dt<t;Dt++){for(var Q=s[Dt],At=F[Dt],Mt=c[Dt],Rt=b[Dt],pt=0;pt<w;pt++)Q[pt]=At[pt]/Rt||0;if(g){for(var yt=0;yt<w;yt++)if(Mt[yt]!=Q[yt]){g=!1;break}}}}else{for(var K=0;K<_;K++){var Bt=d[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(c[ae]!=s[ae]){g=!1;break}}g=g||--m<=0}while(!g);return{it:cL-m,k:t,idxs:d,centroids:s}}pL.exports=BZ});var lf=ot((Q_,t1)=>{(function(n,t){typeof Q_=="object"&&typeof t1!="undefined"?t1.exports=t():typeof define=="function"&&define.amd?define(t):(n=typeof globalThis!="undefined"?globalThis:n||self,n.polygonClipping=t())})(Q_,function(){"use strict";function n(rt,P){var N={label:0,sent:function(){if(V[0]&1)throw V[1];return V[1]},trys:[],ops:[]},k,$,V,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,$&&(V=Et[0]&2?$.return:Et[0]?$.throw||((V=$.return)&&V.call($),0):$.next)&&!(V=V.call($,Et[1])).done)return V;switch($=0,V&&(Et=[Et[0]&2,V.value]),Et[0]){case 0:case 1:V=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(V=N.trys,!(V=V.length>0&&V[V.length-1])&&(Et[0]===6||Et[0]===2)){N=0;continue}if(Et[0]===3&&(!V||Et[1]>V[0]&&Et[1]<V[3])){N.label=Et[1];break}if(Et[0]===6&&N.label<V[1]){N.label=V[1],V=Et;break}if(V&&N.label<V[2]){N.label=V[2],N.ops.push(Et);break}V[2]&&N.ops.pop(),N.trys.pop();continue}Et=P.call(rt,N)}catch(G){Et=[6,G],$=0}finally{k=V=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,V=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}V.left=P,V=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,V.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 V=k(rt,N.key);return V<0?($.left=N.left,$.right=N,N.left=null):V>=0&&($.right=N.right,$.left=N,N.right=null),$}function c(rt,P,N){var k=null,$=null;if(P){P=o(rt,P,N);var V=N(P.key,rt);V===0?(k=P.left,$=P.right):V<0?($=P.right,P.right=null,k=P):(k=P.left,P.left=null,$=P)}return{left:k,right:$}}function d(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)+\`
8117
8117
  \`);var V=P+(N?" ":"\\u2502 ");rt.left&&h(rt.left,V,!1,k,$),rt.right&&h(rt.right,V,!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,V=o(P,this._root,$),ht=$(P,V.key);return ht===0?this._root=V:(ht<0?(k.left=V.left,k.right=V,V.left=null):ht>0&&(k.right=V.right,k.left=V,V.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 V=k(P,N.key);return V===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,$=[],V=!1;!V;)k!==null?($.push(k),k=k.left):$.length!==0?(k=$.pop(),P.call(N,k),k=k.right):V=!0;return this},rt.prototype.range=function(P,N,k,$){for(var V=[],ht=this._comparator,at=this._root,wt;V.length!==0||at;)if(at)V.push(at),at=at.left;else{if(at=V.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,V=[];!k;)if(N)V.push(N),N=N.left;else if(V.length>0){if(N=V.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 V=$(P.key,N.key);if(V===0)break;V<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 V=$(P.key,N.key);if(V===0)break;V<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 w(this._root)},rt.prototype.load=function(P,N,k){N===void 0&&(N=[]),k===void 0&&(k=!1);var $=P.length,V=this._comparator;if(k&&T(P,N,0,$-1,V),this._root===null)this._root=m(P,N,0,$),this._size=$;else{var ht=b(this.toList(),_(P,N),V);$=this._size+$,this._root=x({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,V=c(P,this._root,$),ht=V.left,at=V.right;$(P,N)<0?at=s(N,k,at,$):ht=s(N,k,ht,$),this._root=d(ht,at,$)},rt.prototype.split=function(P){return c(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 V=N+Math.floor($/2),ht=rt[V],at=P[V],wt=new t(ht,at);return wt.left=m(rt,P,N,V),wt.right=m(rt,P,V+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 w(rt){for(var P=rt,N=[],k=!1,$=new t(null,null),V=$;!k;)P?(N.push(P),P=P.left):N.length>0?(P=V=V.next=N.pop(),P=P.right):k=!0;return V.next=null,$.next}function x(rt,P,N){var k=N-P;if(k>0){var $=P+Math.floor(k/2),V=x(rt,P,$),ht=rt.head;return ht.left=V,rt.head=rt.head.next,ht.right=x(rt,$+1,N),ht}return null}function b(rt,P,N){for(var k=new t(null,null),$=k,V=rt,ht=P;V!==null&&ht!==null;)N(V.key,ht.key)<0?($.next=V,V=V.next):($.next=ht,ht=ht.next),$=$.next;return V!==null?$.next=V:ht!==null&&($.next=ht),k.next}function T(rt,P,N,k,$){if(!(N>=k)){for(var V=rt[N+k>>1],ht=N-1,at=k+1;;){do ht++;while($(rt[ht],V)<0);do at--;while($(rt[at],V)>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}T(rt,P,N,at,$),T(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,S=(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,V=rt.ur.y<P.ur.y?rt.ur.y:P.ur.y;return{ll:{x:N,y:$},ur:{x:k,y:V}}},E=Number.EPSILON;E===void 0&&(E=Math.pow(2,-52));let R=E*E,C=(rt,P)=>{if(-E<rt&&rt<E&&-E<P&&P<E)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 W,this.yRounder=new W}round(P,N){return{x:this.xRounder.round(P),y:this.yRounder.round(N)}}}class W{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 V,ht,at,wt,Et=P[0],G=k[0],st=0,et=0;G>Et==G>-Et?(V=Et,Et=P[++st]):(V=G,G=k[++et]);let lt=0;if(st<rt&&et<N)for(G>Et==G>-Et?(ht=Et+V,at=V-(ht-Et),Et=P[++st]):(ht=G+V,at=V-(ht-G),G=k[++et]),V=ht,at!==0&&($[lt++]=at);st<rt&&et<N;)G>Et==G>-Et?(ht=V+Et,wt=ht-V,at=V-(ht-wt)+(Et-wt),Et=P[++st]):(ht=V+G,wt=ht-V,at=V-(ht-wt)+(G-wt),G=k[++et]),V=ht,at!==0&&($[lt++]=at);for(;st<rt;)ht=V+Et,wt=ht-V,at=V-(ht-wt)+(Et-wt),Et=P[++st],V=ht,at!==0&&($[lt++]=at);for(;et<N;)ht=V+G,wt=ht-V,at=V-(ht-wt)+(G-wt),G=k[++et],V=ht,at!==0&&($[lt++]=at);return(V!==0||lt===0)&&($[lt++]=V),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),Rt=J(8),pt=J(12),yt=J(16),K=J(4);function Bt(rt,P,N,k,$,V,ht){let at,wt,Et,G,st,et,lt,Ft,Kt,me,ve,qe,Ue,Xe,Ke,Er,Zr,nr,Ie=rt-$,rr=N-$,pr=P-V,ar=k-V;Xe=Ie*ar,et=D*Ie,lt=et-(et-Ie),Ft=Ie-lt,et=D*ar,Kt=et-(et-ar),me=ar-Kt,Ke=Ft*me-(Xe-lt*Kt-Ft*Kt-lt*me),Er=pr*rr,et=D*pr,lt=et-(et-pr),Ft=pr-lt,et=D*rr,Kt=et-(et-rr),me=rr-Kt,Zr=Ft*me-(Er-lt*Kt-Ft*Kt-lt*me),ve=Ke-Zr,st=Ke-ve,Mt[0]=Ke-(ve+st)+(st-Zr),qe=Xe+ve,st=qe-Xe,Ue=Xe-(qe-st)+(ve-st),ve=Ue-Er,st=Ue-ve,Mt[1]=Ue-(ve+st)+(st-Er),nr=qe+ve,st=nr-qe,Mt[2]=qe-(nr-st)+(ve-st),Mt[3]=nr;let Qn=j(4,Mt),Si=Q*ht;if(Qn>=Si||-Qn>=Si||(st=rt-Ie,at=rt-(Ie+st)+(st-$),st=N-rr,Et=N-(rr+st)+(st-$),st=P-pr,wt=P-(pr+st)+(st-V),st=k-ar,G=k-(ar+st)+(st-V),at===0&&wt===0&&Et===0&&G===0)||(Si=At*ht+xt*Math.abs(Qn),Qn+=Ie*G+ar*at-(pr*Et+rr*wt),Qn>=Si||-Qn>=Si))return Qn;Xe=at*ar,et=D*at,lt=et-(et-at),Ft=at-lt,et=D*ar,Kt=et-(et-ar),me=ar-Kt,Ke=Ft*me-(Xe-lt*Kt-Ft*Kt-lt*me),Er=wt*rr,et=D*wt,lt=et-(et-wt),Ft=wt-lt,et=D*rr,Kt=et-(et-rr),me=rr-Kt,Zr=Ft*me-(Er-lt*Kt-Ft*Kt-lt*me),ve=Ke-Zr,st=Ke-ve,K[0]=Ke-(ve+st)+(st-Zr),qe=Xe+ve,st=qe-Xe,Ue=Xe-(qe-st)+(ve-st),ve=Ue-Er,st=Ue-ve,K[1]=Ue-(ve+st)+(st-Er),nr=qe+ve,st=nr-qe,K[2]=qe-(nr-st)+(ve-st),K[3]=nr;let ii=B(4,Mt,4,K,Rt);Xe=Ie*G,et=D*Ie,lt=et-(et-Ie),Ft=Ie-lt,et=D*G,Kt=et-(et-G),me=G-Kt,Ke=Ft*me-(Xe-lt*Kt-Ft*Kt-lt*me),Er=pr*Et,et=D*pr,lt=et-(et-pr),Ft=pr-lt,et=D*Et,Kt=et-(et-Et),me=Et-Kt,Zr=Ft*me-(Er-lt*Kt-Ft*Kt-lt*me),ve=Ke-Zr,st=Ke-ve,K[0]=Ke-(ve+st)+(st-Zr),qe=Xe+ve,st=qe-Xe,Ue=Xe-(qe-st)+(ve-st),ve=Ue-Er,st=Ue-ve,K[1]=Ue-(ve+st)+(st-Er),nr=qe+ve,st=nr-qe,K[2]=qe-(nr-st)+(ve-st),K[3]=nr;let Z=B(ii,Rt,4,K,pt);Xe=at*G,et=D*at,lt=et-(et-at),Ft=at-lt,et=D*G,Kt=et-(et-G),me=G-Kt,Ke=Ft*me-(Xe-lt*Kt-Ft*Kt-lt*me),Er=wt*Et,et=D*wt,lt=et-(et-wt),Ft=wt-lt,et=D*Et,Kt=et-(et-Et),me=Et-Kt,Zr=Ft*me-(Er-lt*Kt-Ft*Kt-lt*me),ve=Ke-Zr,st=Ke-ve,K[0]=Ke-(ve+st)+(st-Zr),qe=Xe+ve,st=qe-Xe,Ue=Xe-(qe-st)+(ve-st),ve=Ue-Er,st=Ue-ve,K[1]=Ue-(ve+st)+(st-Er),nr=qe+ve,st=nr-qe,K[2]=qe-(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,$,V){let ht=(P-V)*(N-$),at=(rt-$)*(k-V),wt=ht-at,Et=Math.abs(ht+at);return Math.abs(wt)>=Dt*Et?wt:-Bt(rt,P,N,k,$,V,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 V={x:N.x-rt.x,y:N.y-rt.y},ht=ae(V,P)/$,at=ae(V,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 V=N[k];this.point.events.push(V),V.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 V=this.point.events[$];V.consumedBy===void 0&&k.otherSE.point.events===V.otherSE.point.events&&k.segment.consume(V.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 V=$.otherSE;N.set($,{sine:ce(this.point,P.point,V.point),cosine:te(this.point,P.point,V.point)})};return($,V)=>{N.has($)||k($),N.has(V)||k(V);let{sine:ht,cosine:at}=N.get($),{sine:wt,cosine:Et}=N.get(V);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 We=0;class ee{static compare(P,N){let k=P.leftSE.point.x,$=N.leftSE.point.x,V=P.rightSE.point.x,ht=N.rightSE.point.x;if(ht<k)return 1;if(V<$)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(V<ht){let st=N.comparePoint(P.rightSE.point);if(st!==0)return st}if(V>ht){let st=P.comparePoint(N.rightSE.point);if(st<0)return 1;if(st>0)return-1}if(V!==ht){let st=Et-at,et=V-k,lt=G-wt,Ft=ht-$;if(st>et&&lt<Ft)return 1;if(st<et&&lt>Ft)return-1}return V>ht?1:V<ht||Et<G?-1:Et>G?1:P.id<N.id?-1:P.id>N.id?1:0}constructor(P,N,k,$){this.id=++We,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 $,V,ht,at=ft.comparePoints(P,N);if(at<0)$=P,V=N,ht=1;else if(at>0)$=N,V=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(V,!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 V=(P.y-N.y)/$.y,ht=N.x+V*$.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(),$=S(N,k);if($===null)return null;let V=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,V)&&P.comparePoint(V)===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&&V.x===wt.x&&V.y===wt.y?null:V;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(V,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),V=new ft(P,!1),ht=this.rightSE;this.replaceRightSE(V),N.push(V),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(),V.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 V=N;N=k,k=V}if(N.prev===k){let V=N;N=k,k=V}for(let V=0,ht=k.rings.length;V<ht;V++){let at=k.rings[V],wt=k.windings[V],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 V=[],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)V.push(G);else{ht.indexOf(G)===-1&&ht.push(G);let st=V.indexOf(Et.poly);st!==-1&&V.splice(st,1)}}for(let at=0,wt=V.length;at<wt;at++){let Et=V[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 V=$;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===V.x&&wt.y===V.y||(this.segments.push(ee.fromRing(V,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),V=wt)}($.x!==V.x||$.y!==V.y)&&this.segments.push(ee.fromRing(V,$,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 V=new ge(P[k],this,!1);V.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=V.bbox.ll.x),V.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=V.bbox.ll.y),V.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=V.bbox.ur.x),V.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=V.bbox.ur.y),this.interiorRings.push(V)}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 V=0,ht=$.length;V<ht;V++)P.push($[V])}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 V=new fe(P[k],this);V.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=V.bbox.ll.x),V.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=V.bbox.ll.y),V.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=V.bbox.ur.x),V.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=V.bbox.ur.y),this.polys.push(V)}this.isSubject=N}getSweepEvents(){let P=[];for(let N=0,k=this.polys.length;N<k;N++){let $=this.polys[N].getSweepEvents();for(let V=0,ht=$.length;V<ht;V++)P.push($[V])}return P}}class be{static factory(P){let N=[];for(let k=0,$=P.length;k<$;k++){let V=P[k];if(!V.isInResult()||V.ringOut)continue;let ht=null,at=V.leftSE,wt=V.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 V=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+=V)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,V=this.events.length;$<V;$++){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 V=P[k];if(!V.poly)if(V.isExteriorRing())N.push(new Wt(V));else{let ht=V.enclosingRing();ht.poly||N.push(new Wt(ht)),ht.poly.addInterior(V)}}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 V=$,ht=$,at,wt;for(;at===void 0;)V=this.tree.prev(V),V===null?at=null:V.key.consumedBy===void 0&&(at=V.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,Pt=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;)S($[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(S(lt.bbox,$[Ft].bbox)===null)return[]}let V=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(V.insert(lt[Ft]),V.size>z)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let ht=new tt(V),at=V.size,wt=V.pop();for(;wt;){let st=wt.key;if(V.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(V.size>z)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(ht.segments.length>Pt)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&&V.insert(Kt)}at=V.size,wt=V.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 NL=ot((Cg,LL)=>{(function(n,t){typeof Cg=="object"&&typeof LL!="undefined"?t(Cg):typeof define=="function"&&define.amd?define(["exports"],t):t(n.jsts={})})(Cg,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 c(){}function d(r){return r===null?Ke: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 w(){this.root_=null,this.size_=0}function x(){}function b(){this.array_=[],arguments[0]instanceof at&&this.addAll(arguments[0])}function T(){}function I(r){this.message=r||""}function S(){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,l=1 in arguments&&parseInt(Number(arguments[1]),10)||0;l=l<0?Math.max(a+l,0):Math.min(l,a);var p=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:a;for(p=p<0?Math.max(a+arguments[2],0):Math.min(p,a);l<p;)i[l]=r,++l;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 E=function(){};E.prototype.interfaces_=function(){return[]},E.prototype.getClass=function(){return E},E.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 W=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!!E.equalsWithTolerance(this.x,i.x,a)&&!!E.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 E.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,l=this.z-r.z;return Math.sqrt(i*i+a*a+l*l)},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[W,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,l=i,p=B.compare(a.x,l.x);if(p!==0)return p;var v=B.compare(a.y,l.y);return v!==0?v:this._dimensionsToTest<=2?0:B.compare(a.z,l.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,l){var p=r;return i<p&&(p=i),a<p&&(p=a),l<p&&(p=l),p},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 l=arguments[0],p=arguments[1],v=arguments[2];return l<p?p:l>v?v:l}},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],l=r;return i>l&&(l=i),a>l&&(l=a),l}if(arguments.length===4){var p=arguments[0],v=arguments[1],M=arguments[2],L=arguments[3],H=p;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 Rt=function(r){this.str=r};Rt.prototype.append=function(r){this.str+=r},Rt.prototype.setCharAt=function(r,i){this.str=this.str.substr(0,r)+i+this.str.substr(r+1)},Rt.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 l=arguments[0];r.call(this,r.parse(l))}}else if(arguments.length===2){var p=arguments[0],v=arguments[1];this.init(p,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(),l=K.magnitude(a._hi),p=K.TEN.pow(l);(a=a.divide(p)).gt(K.TEN)?(a=a.divide(K.TEN),l+=1):a.lt(K.ONE)&&(a=a.multiply(K.TEN),l-=1);for(var v=l+1,M=new Rt,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]=l,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],l=arguments[1],p=null,v=null,M=null,L=null,H=null,it=null,bt=null,Tt=null;return H=this._hi/a,it=K.SPLIT*H,p=it-H,Tt=K.SPLIT*a,p=it-p,v=H-p,M=Tt-a,bt=H*a,M=Tt-M,L=a-M,Tt=p*M-bt+p*L+v*M+v*L,it=(this._hi-bt-Tt+this._lo-H*l)/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,l=null,p=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*(l=(H=K.SPLIT*r._hi)-(l=H-r._hi))-(L=v*r._hi)+i*(p=r._hi-l)+a*l+a*p,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),l=Math.abs(r);if(l>1)for(;l>0;)l%2==1&&a.selfMultiply(i),(l/=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),l=this.subtract(a.sqr())._hi*(.5*r);return a.add(l)},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,l=null,p=null,v=null,M=null,L=null;return p=this._hi+i,M=p-this._hi,v=p-M,v=i-M+(this._hi-v),L=v+this._lo,a=p+L,l=L+(p-a),this._hi=a+l,this._lo=l+(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,On=null;Qt=this._hi+H,Tt=this._lo+it,le=Qt-(Ee=Qt-this._hi),Jt=Tt-(On=Tt-this._lo);var Kn=(bt=Qt+(Ee=(le=H-Ee+(this._hi-le))+Tt))+(Ee=(Jt=it-On+(this._lo-Jt))+(Ee+(Qt-bt))),ci=Ee+(bt-Kn);return this._hi=Kn,this._lo=ci,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],l=arguments[1],p=null,v=null,M=null,L=null,H=null,it=null;p=(H=K.SPLIT*this._hi)-this._hi,it=K.SPLIT*a,p=H-p,v=this._hi-p,M=it-a;var bt=(H=this._hi*a)+(it=p*(M=it-M)-H+p*(L=a-M)+v*M+v*L+(this._hi*l+this._lo*a)),Tt=it+(p=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),l=i[0]+1,p=a;if(a.charAt(0)===".")p="0"+a;else if(l<0)p="0."+K.stringOfChar("0",-l)+a;else if(a.indexOf(".")===-1){var v=l-a.length;p=a+K.stringOfChar("0",v)+".0"}return this.isNegative()?"-"+p:p},K.prototype.reciprocal=function(){var r=null,i=null,a=null,l=null,p=null,v=null,M=null,L=null;i=(p=1/this._hi)-(r=(v=K.SPLIT*p)-(r=v-p)),a=(L=K.SPLIT*this._hi)-this._hi;var H=p+(v=(1-(M=p*this._hi)-(L=r*(a=L-a)-M+r*(l=this._hi-a)+i*a+i*l)-p*this._lo)/this._hi);return new K(H,p-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),l=K.SCI_NOT_EXPONENT_CHAR+i[0];if(a.charAt(0)==="0")throw new Error("Found leading zero: "+a);var p="";a.length>1&&(p=a.substring(1));var v=a.charAt(0)+"."+p;return this.isNegative()?"-"+v+l:v+l},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],l=arguments[1];this._hi=a,this._lo=l}},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,W,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 l=!1;if(i<a){var p=r.charAt(i);p!=="-"&&p!=="+"||(i++,p==="-"&&(l=!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(On){throw On instanceof Error?new Error("Invalid exponent "+Tt+" in string "+r):On}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 l?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),l=Math.trunc(Math.floor(a));return 10*Math.pow(10,l)<=i&&(l+=1),l},K.stringOfChar=function(r,i){for(var a=new Rt,l=0;l<i;l++)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 l=Gt.orientationIndexFilter(r,i,a);if(l<=1)return l;var p=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 p.selfMultiply(L).selfSubtract(v.selfMultiply(M)).signum()},Gt.signOfDet2x2=function(r,i,a,l){return r.multiply(l).selfSubtract(i.multiply(a)).signum()},Gt.intersection=function(r,i,a,l){var p=K.valueOf(l.y).selfSubtract(a.y).selfMultiply(K.valueOf(i.x).selfSubtract(r.x)),v=K.valueOf(l.x).selfSubtract(a.x).selfMultiply(K.valueOf(i.y).selfSubtract(r.y)),M=p.subtract(v),L=K.valueOf(l.x).selfSubtract(a.x).selfMultiply(K.valueOf(r.y).selfSubtract(a.y)),H=K.valueOf(l.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(l.y).selfSubtract(a.y).selfMultiply(Qt)).doubleValue();return new D(bt,le)},Gt.orientationIndexFilter=function(r,i,a){var l=null,p=(r.x-a.x)*(i.y-a.y),v=(r.y-a.y)*(i.x-a.x),M=p-v;if(p>0){if(v<=0)return Gt.signum(M);l=p+v}else{if(!(p<0)||v>=0)return Gt.signum(M);l=-p-v}var L=Gt.DP_SAFE_EPSILON*l;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,l,p){for(var v=0,M=i;M<i+p;M++)a[l+v]=r[M],v++},te.getProperty=function(r){return{"line.separator":\`