@aibee/crc-bmap 0.8.63 → 0.8.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/bmap.cjs.min.js +2 -2
- package/lib/bmap.esm.js +4 -3
- package/lib/bmap.esm.min.js +2 -2
- package/lib/bmap.min.js +2 -2
- package/lib/src/plugins/navigation/navigation.d.ts +1 -0
- package/lib/src/plugins/navigation/navigation.js +3 -2
- package/lib/src/plugins/navigation/path.js +1 -1
- package/package.json +1 -1
package/lib/bmap.cjs.min.js
CHANGED
|
@@ -106,12 +106,12 @@
|
|
|
106
106
|
}
|
|
107
107
|
`,n=-1/0,i=this.geometry.getAttribute("position");if(i)for(let s=0;s<i.count;s++){let a=i.getZ(s);a>n&&(n=a)}let o=new at.ShaderMaterial({uniforms:{maxZ:{value:n},uColor:{value:new at.Color(this.options[0].fillColor).convertLinearToSRGB()},uColor2:{value:new at.Color(Oe(this.options[0].fillColor)).convertLinearToSRGB()},uOpacity:{value:this.options[0].fillOpacity}},vertexShader:t,fragmentShader:e,transparent:!0});this.material=o}initLineMaterial(){let t=B.createLineMaterial({color:this.options[0].strokeColor,opacity:this.options[0].strokeOpacity});return this.lineMaterial=t,t}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new at.Mesh(this.geometry,this.material),this.add(this.mesh)}getBorderPoints(){let t=[],e=this.options[0].height+this.options[0].deltaHeight;return this.options.map(n=>{let{coords:i}=n.geometry;for(let o=0;o<i.length;o++){let s=i[o];for(let a=0;a<s.length;a++){let u=s[a],l=a+1===s.length?s[0]:s[a+1];t.push(new at.Vector3(u[0],u[1],e)),t.push(new at.Vector3(l[0],l[1],e))}}}),t}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.getBorderPoints(),e=new at.BufferGeometry().setFromPoints(t);this.lineGeometry=e}createBorder(){this.line&&this.remove(this.line);let t=new at.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}dispose(){var t;this.geometry.dispose(),this.material.dispose(),(t=this.line)==null||t.geometry.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.options=e.map(n=>T({},Pa,n)),this.init()}};var oL=d(W(),1);var mt=require("three");var Nr=require("lodash");var Q4={text:"",icon:"",icon_size:[22,22],level:1,collision_enable:!0,opacity:1,id:"",position:{x:0,y:0,z:0},text_font_size:14,icon_rotate:0,depth_test:!1},ot=class extends mt.Object3D{get durIconAndText(){return this.options.icon&&this.options.text?2:0}get offset(){return this.options.icon&&this.options.text?0:.5}get iconWidth(){return this.options.icon?this.options.icon_size[0]:0}get iconHeight(){return this.options.icon?this.options.icon_size[1]:0}get textWidth(){return this.options.text?this.options.text_font_size*this.textAspect:0}get textHeight(){return this.options.text?this.options.text_font_size:0}get hasOriginTexture(){let{text_texture:t,text_texture_width:e,text_texture_height:n,text_texture_offset_x:i,text_texture_offset_y:o}=this.options;return!(0,Nr.isNil)(t)&&!(0,Nr.isNil)(e)&&!(0,Nr.isNil)(n)&&!(0,Nr.isNil)(i)&&!(0,Nr.isNil)(o)}get deltaZ(){return!this.options.icon&&this.options.text?.1+this.offset*(this.iconHeight+this.durIconAndText+this.textHeight)/this.context.camera.zoom:.1}get canSelect(){return this.visible&&(this.spriteIcon?this.spriteIcon.visible:!0)&&(this.spriteText?this.spriteText.visible:!0)}registryEvent(){this.context.addEventListener("control-zoom-change",this._initScale),this.addEventListener("change-icon",t=>j(this,null,function*(){let{value:e}=t;this._initIconPromise&&(yield this._initIconPromise),this.spriteIcon&&(this.remove(this.spriteIcon),this.spriteIcon=void 0),yield this.initIcon(),this.initSize(),this._initScale({zoom:this.context.camera.zoom})})),this.addEventListener("change-text",t=>{let{value:e}=t;this.spriteText&&(this.remove(this.spriteText),this.spriteText=void 0),this.initText(),this.initSize(),this._initScale({zoom:this.context.camera.zoom})}),this.addEventListener("change-text_font_size",t=>{let{value:e}=t;this.spriteText&&(this.remove(this.spriteText),this.spriteText=void 0),this.initText(),this.initSize(),this._initScale({zoom:this.context.camera.zoom})}),this.addEventListener("change-icon_rotate",t=>{let{value:e}=t;this.spriteIcon&&(this.spriteIcon.material.rotation=e/180*Math.PI)}),this.addEventListener("change-icon_size",t=>{let{value:e}=t;this.spriteIcon&&this._initScale({zoom:this.context.camera.zoom})}),this.addEventListener("change-depth_test",t=>{let{value:e}=t;this.spriteIcon&&(this.spriteIcon.material.depthTest=e),this.spriteText&&(this.spriteText.material.depthTest=e)})}unRegistryEvent(){this.context.removeEventListener("control-zoom-change",this._initScale)}getPosition(){return this.position}initIcon(){return j(this,null,function*(){if(this.options.icon)return this._initIconPromise=new Promise(t=>j(this,null,function*(){let e=yield $t.getTextureByUrl(this.options.icon),n=new mt.Sprite(new mt.SpriteMaterial({map:e,transparent:!0,alphaTest:.2,depthTest:this.options.depth_test,rotation:this.options.icon_rotate/180*Math.PI}));n.visible=!1,n.renderOrder=1e5+this.options.level,e.needsUpdate=!0,this.add(n),this.spriteIcon=n,t(n)})).then(()=>{this._initIconPromise=null})})}initText(){if(this.options.text){let t;if(this.hasOriginTexture){let{text_texture:n,text_texture_width:i,text_texture_height:o,text_texture_offset_x:s,text_texture_offset_y:a}=this.options;t=this.options.text_texture.clone(),t.uuid=n.uuid,t.offset.set(s/t.image.width,1-(o+a)/t.image.height),t.repeat.set(i/t.image.width,o/t.image.height),this.textAspect=i/o}else t=Ut.getTextureByText(this.options.text),this.textAspect=t.image.width/t.image.height;let e=new mt.Sprite(new mt.SpriteMaterial({map:t,transparent:!0,alphaTest:.2,depthTest:this.options.depth_test}));e.visible=!1,e.renderOrder=100001+this.options.level,t.needsUpdate=!0,this.spriteText=e,this.add(e)}}initSize(){var t,e;let n=0,i=0,{icon:o,text:s}=this.options;o?s?(n=0,i=n*(this.iconHeight/this.textHeight)-this.iconHeight/this.textHeight-this.durIconAndText/this.textHeight):(n=.5,i=0):s?(i=.5,n=0):(n=0,i=0),(t=this.spriteIcon)==null||t.center.set(.5,n),(e=this.spriteText)==null||e.center.set(.5,i)}init(){return j(this,null,function*(){yield Promise.all([this.initIcon(),new Promise(t=>{this.initText(),t(!0)})]),this.initSize(),this._initScale({zoom:this.context.camera.zoom})})}resetZ(){let t=this.deltaZ;this.spriteIcon&&(this.spriteIcon.position.z=t),this.spriteText&&(this.spriteText.position.z=t)}getBox(t){let{clientSize:{width:e,height:n}}=this.context,i=e*(t.x+1)/2,o=n*(-t.y+1)/2;o+=this.offset*(this.iconHeight+this.durIconAndText+this.textHeight);let s=this.iconWidth/2,a=new mt.Box2(new mt.Vector2(i-s,o-this.iconHeight),new mt.Vector2(i+s,o)),u=this.textWidth/2,l=new mt.Box2(new mt.Vector2(i-u,o-this.textHeight-this.durIconAndText-this.iconHeight),new mt.Vector2(i+u,o-this.iconHeight-this.durIconAndText));return this.box=l.union(a),this.box}renderBoxHelper(t,e){if(!this.boxHelper){let n=document.createElement("div");n.style.position="absolute",n.style.zIndex="999",n.style.border="1px solid red",n.style.pointerEvents="none",this.boxHelper=n,this.context.container.appendChild(n)}t&&e?(this.boxHelper.style.left=t+"px",this.boxHelper.style.top=e+"px",this.boxHelper.style.width="2px",this.boxHelper.style.height="2px"):(this.boxHelper.style.left=this.box.min.x+"px",this.boxHelper.style.top=this.box.min.y+"px",this.boxHelper.style.width=this.box.max.x-this.box.min.x+"px",this.boxHelper.style.height=this.box.max.y-this.box.min.y+"px")}parentSetVisible(t){this.spriteText&&(this.spriteText.visible=t),this.spriteIcon&&(this.spriteIcon.visible=t),this.boxHelper&&(this.boxHelper.style.display=t?"block":"none")}dispose(){this.clear(),this.unRegistryEvent(),this.spriteText=void 0,this.spriteIcon=void 0}constructor(t,e){super(),this.context=t,this.textAspect=1,this.box=new mt.Box2,this._initIconPromise=null,this._initScale=n=>{let{zoom:i}=n;if(this.spriteText){let s=this.textHeight/i;this.spriteText.scale.set(this.textAspect*s,s,.1)}if(this.spriteIcon){var o;(o=this.spriteIcon)==null||o.scale.set(this.options.icon_size[0]/i,this.options.icon_size[1]/i,.1)}this.resetZ()},this.options=zn(T({},Q4,e),this),this.position.set(this.options.position.x,this.options.position.y,this.options.position.z),this.registryEvent(),this.init()}};var Vt=require("three"),Y1=require("three/examples/jsm/utils/BufferGeometryUtils");var E1={airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},texts:[],fillColor:"#ffffff",fillOpacity:0,strokeColor:"#ffffff",strokeOpacity:0,secondHeight:0,secondRotate:0,center_x:0,center_y:0},So=class extends Vt.Object3D{init(){return j(this,null,function*(){let t=this.options.map(s=>Ut.getTextureByText(s.texts[0],{fillStyle:vs(s.fillColor,s.fillOpacity),strokeStyle:vs(s.strokeColor,s.strokeOpacity),lineWidth:6,font:"54px sans-serif"})),e=t.map((s,a)=>{let u=this.options[a],{width:l,height:c}=s.image,h=l/c,p=u.secondHeight*h,m=new Vt.PlaneGeometry(p,u.secondHeight),g=new Vt.Matrix4().makeTranslation(u.center_x,u.center_y,u.airHeight+u.deltaHeight+u.height).multiply(new Vt.Matrix4().makeRotationZ(u.secondRotate));return m.applyMatrix4(g),m}),n=(0,Y1.mergeGeometries)(e,!0);e.forEach(s=>s.dispose());let i=t.map(s=>{let a=new Vt.MeshBasicMaterial({map:s,alphaTest:1,side:Vt.DoubleSide});return s.needsUpdate=!0,a}),o=new Vt.Mesh(n,i);this.mesh=o,this.position.z+=.04,this.add(o)})}dispose(){var t,e;(t=this.mesh)==null||t.geometry.dispose(),((e=this.mesh)==null?void 0:e.material).forEach(n=>n.dispose()),this.clear()}constructor(t,e){super(),this.context=t,this.options=e.map(n=>T({},E1,n)),this.init()}};var Dn=require("three"),bo=class extends Dn.Object3D{setPosition(t,e){this.geometry.setFromPoints([t,e]),this.line||this.createLine()}createLine(){this.line=new Dn.Line(this.geometry,this.material),this.add(this.line)}dispose(){this.line&&q(this.line),this.geometry=null,this.material=null}constructor(t,e,n){super(),this.context=t,this.geometry=new Dn.BufferGeometry,this.material=new Dn.LineBasicMaterial({color:0}),e&&n&&this.setPosition(e,n)}};var D1=require("three"),va=class extends kt{setEnable(t){super.setEnable(t),yt(this.rect,0,0,0,0),t?this.registryEvent():(this.startPoint=void 0,this.unRegistryEvent())}registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointermove",this.onPointerMove),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointermove",this.onPointerMove),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.removeEventListener("update",this.onUpdate)}doSelect(){if(this.startPoint&&this.endPoint){if(this.startPoint.distanceTo(this.endPoint)<.1)return;let{context:{camera:e,container:{clientWidth:n,clientHeight:i}}}=this,o=I(this.startPoint,e,n,i),s=I(this.endPoint,e,n,i),a={x:Math.min(o.x,s.x),y:Math.min(o.y,s.y)},u={x:Math.max(o.x,s.x),y:Math.max(o.y,s.y)},l=this.searchMapInFrustum(a,u);this.dispatchEvent({type:"selected",list:l})}}searchMapInFrustum(t,e){var n;let{context:i}=this;return((n=i.currentFloor)==null?void 0:n.graphicLayer.children.filter(o=>o instanceof et&&this.searchChildInFrustum(o,t,e)))||[]}searchChildInFrustum(t,e,n){let{context:{camera:i,container:{clientWidth:o,clientHeight:s}}}=this;if(!t)return!1;if(!t.mesh){let p=t.getPosition();if(p){let m=I(p,i,o,s);return He(m,e,n)}return!1}t.mesh.geometry.boundingBox||t.mesh.geometry.computeBoundingBox();let a=t.mesh.geometry.boundingBox;if(!a)return!1;let{min:u,max:l}=a,c=I(u,i,o,s),h=I(l,i,o,s);return!(!He(c,e,n)||!He(h,e,n))}dispose(){super.dispose(),this.rect=null,this.unRegistryEvent()}constructor(t){super(t),this.frustum=new D1.Frustum,this.onPointerDown=i=>{if(!this.enable)return;let o=this.getIntersectByPointerEvent(i);o&&(this.startPoint=o),this.endPoint=void 0},this.onPointerMove=i=>{if(!this.enable||!this.startPoint)return;let o=this.getIntersectByPointerEvent(i);o&&(this.endPoint=o)},this.onPointerUp=i=>{if(!this.enable)return;let o=this.getIntersectByPointerEvent(i);o&&(this.endPoint=o),this.doSelect(),this.startPoint=void 0},this.onUpdate=()=>{if(this.startPoint){let i=this.getSvgCoordinate(this.startPoint),o=T({},i);this.endPoint&&(o=this.getSvgCoordinate(this.endPoint));let s={x:Math.min(i.x,o.x),y:Math.min(i.y,o.y)},a=Math.abs(o.x-i.x),u=Math.abs(o.y-i.y);yt(this.rect,s.x,s.y,a,u)}else yt(this.rect,0,0,0,0)};let{config:{selectBox:{fill:e,stroke:n}}}=t;this.rect=qe(n,e),this.svg.appendChild(this.rect),this.registryEvent()}};var vo=class extends X1.EventDispatcher{get list(){return this._list}enableBoxSelection(){this.isMultipleSelect||!this.context.config.enableBoxSelect||(this.isMultipleSelect=!0,this.boxSelection.setEnable(!0),this.prevPanStatus=this.context.control.enablePan,this.prevRotateStatus=this.context.control.enableRotate,this.context.control.enablePan=!1,this.context.control.enableRotate=!1)}disableBoxSelection(){this.isMultipleSelect&&(this.isMultipleSelect=!1,this.boxSelection.setEnable(!1),this.context.control.enablePan=!!this.prevPanStatus,this.context.control.enableRotate=!!this.prevRotateStatus)}selectEnd(){this.dispatchEvent({type:"select",graphics:[...this._list],isMultipleSelect:this.isMultipleSelect})}registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.container.addEventListener("pointerout",this.onPointerOut),this.context.container.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.boxSelection.addEventListener("selected",this.onBoxSelected)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.container.removeEventListener("pointerout",this.onPointerOut),this.context.container.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp),this.boxSelection.removeEventListener("selected",this.onBoxSelected)}clear(){this._list.clear()}remove(t){this._list.delete(t)}dispose(){this.unRegistryEvent()}constructor(t){super(),this.context=t,this._list=new Set,this.downPoint=null,this.downTime=0,this.isMultipleSelect=!1,this.onPointerDown=e=>{Date.now()-this.downTime<200||(this.downPoint={x:e.offsetX,y:e.offsetY},this.downTime=Date.now())},this.onPointerUp=e=>{if(!this.downPoint)return;let{offsetX:n,offsetY:i}=e,{x:o,y:s}=this.downPoint;if(Math.sqrt((o-n)**2+(s-i)**2)>3)return;let{graphics:a}=this.context.getGraphicsByDeviceXy(n,i),u=new Set(a.map(c=>c.options.id));this.context.getPoisByDeviceXy(n,i).forEach(c=>{if(!u.has(c.options.id)){var h;let p=((h=this.context.currentFloor)==null?void 0:h.graphicLayer.graphicMap.get(c.options.id))||null;p&&p.options.geometry.type==="point"&&(a.push(p),u.add(c.options.id))}}),(Un?e.metaKey:e.ctrlKey)||this._list.clear(),a.forEach(c=>this._list.add(c)),this.selectEnd(),this.downPoint=null},this.onPointerOut=e=>{this.disableBoxSelection()},this.onKeyDown=e=>{Gn(e.key)&&this.enableBoxSelection()},this.onKeyUp=e=>{Gn(e.key)&&this.disableBoxSelection()},this.onBoxSelected=e=>{let{list:n}=e;this._list.clear(),n.forEach(i=>{this._list.add(i)}),this.selectEnd()},this.boxSelection=new va(t),this.boxSelection.setEnable(!1),this.registryEvent()}};var DL=d(_e(),1),XL=d(We(),1),ZL=d(xe(),1),CL=d(Ie(),1),OL=d(Ye(),1),KL=d(Ee(),1),RL=d(De(),1),FL=d(W(),1);var _a=require("three");var _o=class extends _a.EventDispatcher{handleHoverGraphicsChange(t){t===void 0&&(t=this.curGraphics),this.dispatchEvent({type:"hover-change",graphics:Array.from(t)})}registryEvent(){this.context.addEventListener("pointer-over",this.onPointerMove),this.context.addEventListener("pointer-move",this.onPointerMove),this.context.addEventListener("pointer-level",this.onPointerLevel),document.body.addEventListener("pointermove",this.onBodyPointerMove)}unRegistryEvent(){this.context.removeEventListener("pointer-over",this.onPointerMove),this.context.removeEventListener("pointer-move",this.onPointerMove),this.context.removeEventListener("pointer-level",this.onPointerLevel),document.body.removeEventListener("pointermove",this.onBodyPointerMove)}dispose(){this.unRegistryEvent(),this.timer.dispose()}constructor(t){super(),this.context=t,this.curGraphics=new Set,this.timer=new rt,this.graphicTimerMap=new Map,this.onPointerMove=e=>{let{graphics:n,pois:i,e:o}=e,s=i.map(c=>{var h;return(h=this.context.currentFloor)==null?void 0:h.graphicLayer.graphicMap.get(c.options.id)}).filter(c=>c&&c.options.geometry.type==="point");if(!n.length&&!s.length&&this.curGraphics.size){this.curGraphics.clear(),this.handleHoverGraphicsChange();return}let{time:a}=this.context.config.hover,u=new Set;if(s.length){let c,h=1e4;s.forEach(p=>{let m=i.find(g=>g.options.id===p.options.id);if(m instanceof In){let{x:g,y:M}=m.clientPos,P=Math.sqrt((g-o.offsetX)**2+(M-o.offsetY)**2);P<h&&(h=P,c=p)}else if(m instanceof ot){let{x:g,y:M}=m.box.getCenter(new _a.Vector2),P=Math.sqrt((g-o.offsetX)**2+(M-o.offsetY)**2);P<h&&(h=P,c=p)}}),u.add(c)}u.size||n.forEach(c=>u.add(c)),u.forEach(c=>{if(this.graphicTimerMap.get(c)||this.curGraphics.has(c))return;let h=this.timer.setTimeout(()=>{this.curGraphics.add(c),this.graphicTimerMap.delete(c),this.timer.clearTimeout(h),this.handleHoverGraphicsChange()},a);this.graphicTimerMap.set(c,h)}),this.graphicTimerMap.forEach((c,h)=>{u.has(h)||(this.timer.clearTimeout(c),this.graphicTimerMap.delete(h))});let l=this.curGraphics.size;this.curGraphics.forEach(c=>{u.has(c)||this.curGraphics.delete(c)}),l!==this.curGraphics.size&&this.handleHoverGraphicsChange()},this.onPointerLevel=()=>{this.curGraphics.clear(),this.handleHoverGraphicsChange()},this.onBodyPointerMove=e=>{if(this.curGraphics.size){let n=this.context.container.getBoundingClientRect();(e.clientX<n.left||e.clientX>n.right||e.clientY<n.top||e.clientY>n.bottom)&&this.onPointerLevel()}},this.registryEvent()}};var GL=d(W(),1),or=require("three");var Wa=class{updateBox(){this.box.setFromObject(this.context.scene)}setEnable(t){this.enable=t,t?this.registryEvent():this.unRegistryEvent()}changePrevCamera(){this.prevCamera={position:this.context.camera.position.clone(),zoom:this.context.camera.zoom,target:this.context.control.target.clone()}}backToPrevCamera(){this.setEnable(!1),this.context.camera.position.copy(this.prevCamera.position),this.context.camera.zoom=this.prevCamera.zoom,this.context.control.target.copy(this.prevCamera.target),this.context.control.update(),this.setEnable(!0)}registryEvent(){this.context.addEventListener("control-change",this.onCameraChange)}unRegistryEvent(){this.context.removeEventListener("control-change",this.onCameraChange)}getCurFloorScreenPosition(){if(!this.context.scene.children.filter(P=>P instanceof Gt).length)return null;let e=this.box,{camera:n,clientSize:{width:i,height:o}}=this.context,{min:s,max:a}=e,u=I(s,n,i,o),l=I(a,n,i,o),c=I(new or.Vector3(s.x,a.y,a.z),n,i,o),h=I(new or.Vector3(a.x,s.y,s.z),n,i,o),p=Math.min(u.x,l.x,c.x,h.x),m=Math.max(u.x,l.x,c.x,h.x),g=Math.min(u.y,l.y,c.y,h.y),M=Math.max(u.y,l.y,c.y,h.y);return{left:p,right:m,top:g,bottom:M}}checkDistanceToScreenEdge(t){let{left:e,right:n,top:i,bottom:o}=t,{width:s,height:a}=this.context.clientSize,[u,l,c,h]=this.context.config.cameraBound.padding,p=n>=h,m=s-e>=l,g=a-i>=c,M=o>=u;return p&&m&&g&&M}dispose(){this.unRegistryEvent()}constructor(t){this.context=t,this.prevCamera={position:new or.Vector3,zoom:1,target:new or.Vector3},this.enable=!0,this.box=new or.Box3,this.onCameraChange=()=>{let e=this.getCurFloorScreenPosition();if(e){let{left:n,right:i,top:o,bottom:s}=e;this.checkDistanceToScreenEdge({left:n,right:i,top:o,bottom:s})?this.changePrevCamera():this.backToPrevCamera()}},this.registryEvent(),this.changePrevCamera()}};var r7=d(oh(),1),sh=require("three"),sr=require("@tweenjs/tween.js");var t7=d(W(),1),e7=d(K(),1),b=require("three"),Ia=new b.Ray,L1=new b.Plane,f9=Math.cos(70*b.MathUtils.DEG2RAD),Ya=class extends b.EventDispatcher{dispose(){this.domElement.removeEventListener("contextmenu",this.onContextMenu),this.domElement.removeEventListener("pointerdown",this.onPointerDown),this.domElement.removeEventListener("pointercancel",this.onPointerUp),this.domElement.removeEventListener("wheel",this.onMouseWheel),this.domElement.removeEventListener("pointermove",this.onPointerMove),this.domElement.removeEventListener("pointerup",this.onPointerUp),this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this.onKeyDown),this._domElementKeyEvents=null)}constructor(t,e){super(),this.rotateLineStart=new b.Vector2,this.rotateLineEnd=new b.Vector2,this.spherical=new b.Spherical,this.sphericalDelta=new b.Spherical,this.object=t,this.domElement=e,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new b.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.screenSpacePanning=!1,this.mouseButtons={LEFT:b.MOUSE.PAN,MIDDLE:b.MOUSE.DOLLY,RIGHT:b.MOUSE.ROTATE},this.touches={ONE:b.TOUCH.PAN,TWO:b.TOUCH.DOLLY_ROTATE},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return a.phi},this.getAzimuthalAngle=function(){return a.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(y){y.addEventListener("keydown",this.onKeyDown),this._domElementKeyEvents=y},this.stopListenToKeyEvents=function(){var y;(y=this._domElementKeyEvents)==null||y.removeEventListener("keydown",this.onKeyDown),this._domElementKeyEvents=null},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent({type:"change"}),n.update(),o=i.NONE},this.update=function(){let y=new b.Vector3,w=new b.Quaternion().setFromUnitVectors(t.up,new b.Vector3(0,1,0)),U=w.clone().invert(),H=new b.Vector3,Ct=new b.Quaternion,Se=new b.Vector3,ce=2*Math.PI;return function(qr){qr===void 0&&(qr=null);let ke=n.object.position;y.copy(ke).sub(n.target),y.applyQuaternion(w),a.setFromVector3(y),n.autoRotate&&o===i.NONE&&Ue(Br(qr)),n.enableDamping?(a.theta+=u.theta*n.dampingFactor,a.phi+=u.phi*n.dampingFactor):(a.theta+=u.theta,a.phi+=u.phi);let Ve=n.minAzimuthAngle,Je=n.maxAzimuthAngle;isFinite(Ve)&&isFinite(Je)&&(Ve<-Math.PI?Ve+=ce:Ve>Math.PI&&(Ve-=ce),Je<-Math.PI?Je+=ce:Je>Math.PI&&(Je-=ce),Ve<=Je?a.theta=Math.max(Ve,Math.min(Je,a.theta)):a.theta=a.theta>(Ve+Je)/2?Math.max(Ve,a.theta):Math.min(Je,a.theta)),a.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,a.phi)),a.makeSafe(),n.enableDamping===!0?n.target.addScaledVector(c,n.dampingFactor):n.target.add(c),n.zoomToCursor&&z||n.object.isOrthographicCamera?a.radius=Zt(a.radius):a.radius=Zt(a.radius*l),y.setFromSpherical(a),y.applyQuaternion(U),ke.copy(n.target).add(y),n.object.lookAt(n.target),n.enableDamping===!0?(u.theta*=1-n.dampingFactor,u.phi*=1-n.dampingFactor,c.multiplyScalar(1-n.dampingFactor)):(u.set(0,0,0),c.set(0,0,0));let Zo=!1;if(n.zoomToCursor&&z){let $r=null;if(n.object.isPerspectiveCamera){let ti=y.length();$r=Zt(ti*l);let Co=ti-$r;n.object.position.addScaledVector(D,Co),n.object.updateMatrixWorld()}else if(n.object.isOrthographicCamera){let ti=new b.Vector3(E.x,E.y,0);ti.unproject(n.object),n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/l)),n.object.updateProjectionMatrix(),Zo=!0;let Co=new b.Vector3(E.x,E.y,0);Co.unproject(n.object),n.object.position.sub(Co).add(ti),n.object.updateMatrixWorld(),$r=y.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;$r!==null&&(n.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar($r).add(n.object.position):(Ia.origin.copy(n.object.position),Ia.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(Ia.direction))<f9?t.lookAt(n.target):(L1.setFromNormalAndCoplanarPoint(n.object.up,n.target),Ia.intersectPlane(L1,n.target))))}else n.object.isOrthographicCamera&&(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/l)),n.object.updateProjectionMatrix(),Zo=!0);return l=1,z=!1,Zo||H.distanceToSquared(n.object.position)>s||8*(1-Ct.dot(n.object.quaternion))>s||Se.distanceToSquared(n.target)>0?(n.dispatchEvent({type:"change"}),H.copy(n.object.position),Ct.copy(n.object.quaternion),Se.copy(n.target),Zo=!1,!0):!1}}();let n=this,i={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},o=i.NONE,s=1e-6,a=new b.Spherical,u=new b.Spherical,l=1,c=new b.Vector3,h=new b.Vector2,p=new b.Vector2,m=new b.Vector2,g=new b.Vector2,M=new b.Vector2,P=new b.Vector2,A=new b.Vector2,S=new b.Vector2,x=new b.Vector2,D=new b.Vector3,E=new b.Vector2,z=!1,v=[],L={};function Br(y){return y!==null?2*Math.PI/60*n.autoRotateSpeed*y:2*Math.PI/60/60*n.autoRotateSpeed}function lr(){return Math.pow(.95,n.zoomSpeed)}function Ue(y){u.theta-=y}function un(y){u.phi-=y}let cr=function(){let y=new b.Vector3;return function(U,H){y.setFromMatrixColumn(H,0),y.multiplyScalar(-U),c.add(y)}}(),Zn=function(){let y=new b.Vector3;return function(U,H){n.screenSpacePanning===!0?y.setFromMatrixColumn(H,1):(y.setFromMatrixColumn(H,0),y.crossVectors(n.object.up,y)),y.multiplyScalar(U),c.add(y)}}(),Ge=function(){let y=new b.Vector3;return function(U,H){let Ct=n.domElement;if(n.object.isPerspectiveCamera){let Se=n.object.position;y.copy(Se).sub(n.target);let ce=y.length();ce*=Math.tan(n.object.fov/2*Math.PI/180),cr(2*U*ce/Ct.clientHeight,n.object.matrix),Zn(2*H*ce/Ct.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(cr(U*(n.object.right-n.object.left)/n.object.zoom/Ct.clientWidth,n.object.matrix),Zn(H*(n.object.top-n.object.bottom)/n.object.zoom/Ct.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function hr(y){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?l/=y:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function Qr(y){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?l*=y:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function Hr(y){if(!n.zoomToCursor)return;z=!0;let w=n.domElement.getBoundingClientRect(),U=y.clientX-w.left,H=y.clientY-w.top,Ct=w.width,Se=w.height;E.x=U/Ct*2-1,E.y=-(H/Se)*2+1,D.set(E.x,E.y,1).unproject(n.object).sub(n.object.position).normalize()}function Zt(y){return Math.max(n.minDistance,Math.min(n.maxDistance,y))}function Dh(y){h.set(y.clientX,y.clientY)}function TT(y){Hr(y),A.set(y.clientX,y.clientY)}function Xh(y){g.set(y.clientX,y.clientY)}function wT(y){p.set(y.clientX,y.clientY),m.subVectors(p,h).multiplyScalar(n.rotateSpeed);let w=n.domElement;Ue(2*Math.PI*m.x/w.clientHeight),un(2*Math.PI*m.y/w.clientHeight),h.copy(p),n.update()}function ST(y){S.set(y.clientX,y.clientY),x.subVectors(S,A),x.y>0?hr(lr()):x.y<0&&Qr(lr()),A.copy(S),n.update()}function bT(y){M.set(y.clientX,y.clientY),P.subVectors(M,g).multiplyScalar(n.panSpeed),Ge(P.x,P.y),g.copy(M),n.update()}function vT(y){Hr(y),y.deltaY<0?Qr(lr()):y.deltaY>0&&hr(lr()),n.update()}function _T(y){let w=!1;switch(y.code){case n.keys.UP:y.ctrlKey||y.metaKey||y.shiftKey?un(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):Ge(0,n.keyPanSpeed),w=!0;break;case n.keys.BOTTOM:y.ctrlKey||y.metaKey||y.shiftKey?un(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):Ge(0,-n.keyPanSpeed),w=!0;break;case n.keys.LEFT:y.ctrlKey||y.metaKey||y.shiftKey?Ue(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):Ge(n.keyPanSpeed,0),w=!0;break;case n.keys.RIGHT:y.ctrlKey||y.metaKey||y.shiftKey?Ue(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):Ge(-n.keyPanSpeed,0),w=!0;break}w&&(y.preventDefault(),n.update())}function Zh(){if(v.length===1)h.set(v[0].pageX,v[0].pageY);else{let y=(v[0].pageX-v[0].pageY)/(v[1].pageX-v[1].pageY),w=v[0].pageY-y*v[0].pageX;n.rotateLineStart.set(y,w);let U=.5*(v[0].pageX+v[1].pageX),H=.5*(v[0].pageY+v[1].pageY);h.set(U,H)}}function Ch(){if(v.length===1)g.set(v[0].pageX,v[0].pageY);else{let y=.5*(v[0].pageX+v[1].pageX),w=.5*(v[0].pageY+v[1].pageY);g.set(y,w)}}function Oh(){let y=v[0].pageX-v[1].pageX,w=v[0].pageY-v[1].pageY,U=Math.sqrt(y*y+w*w);A.set(0,U)}function WT(){n.enableZoom&&Oh(),n.enablePan&&Ch()}function xT(){n.enableZoom&&Oh(),n.enableRotate&&Zh()}function Kh(y){if(v.length==1)p.set(y.pageX,y.pageY);else{let U=eu(y),H=.5*(y.pageX+U.x),Ct=.5*(y.pageY+U.y);p.set(H,Ct);let Se=(y.pageY-U.y)/(y.pageX-U.x),ce=U.y-Se*U.x;if(n.rotateLineEnd.set(Se,ce),Number.isFinite(n.rotateLineEnd.x)&&Number.isFinite(n.rotateLineStart.x)){let nu=(n.rotateLineStart.y-n.rotateLineEnd.y)/(n.rotateLineEnd.x-n.rotateLineStart.x),qr=Se*nu+ce;if(Number.isFinite(nu)&&Number.isFinite(qr)){let ke=Math.atan(n.rotateLineEnd.x)-Math.atan(n.rotateLineStart.x);Math.PI-Math.abs(ke)<.5&&(ke=-Math.sign(ke)*(Math.PI-Math.abs(ke))),Math.abs(ke)<.1&&(u.theta+=ke)}}n.rotateLineStart.copy(n.rotateLineEnd)}m.subVectors(p,h).multiplyScalar(n.rotateSpeed);let w=n.domElement;un(2*Math.PI*m.y/w.clientHeight),h.copy(p)}function Rh(y){if(v.length===1)M.set(y.pageX,y.pageY);else{let w=eu(y),U=.5*(y.pageX+w.x),H=.5*(y.pageY+w.y);M.set(U,H)}P.subVectors(M,g).multiplyScalar(n.panSpeed),Ge(P.x,P.y),g.copy(M)}function Fh(y){let w=eu(y),U=y.pageX-w.x,H=y.pageY-w.y,Ct=Math.sqrt(U*U+H*H);S.set(0,Ct),x.set(0,Math.pow(S.y/A.y,n.zoomSpeed)),hr(x.y),A.copy(S)}function IT(y){n.enableZoom&&Fh(y),n.enablePan&&Rh(y)}function YT(y){n.enableZoom&&Fh(y),n.enableRotate&&Kh(y)}this.onPointerDown=function(w){n.enabled!==!1&&(v.length===0&&(n.domElement.setPointerCapture(w.pointerId),n.domElement.addEventListener("pointermove",n.onPointerMove),n.domElement.addEventListener("pointerup",n.onPointerUp)),CT(w),w.pointerType==="touch"?XT(w):ET(w))},this.onPointerMove=function(w){n.enabled!==!1&&(w.pointerType==="touch"?ZT(w):DT(w))},this.onPointerUp=function(w){OT(w),v.length===0&&(n.domElement.releasePointerCapture(w.pointerId),n.domElement.removeEventListener("pointermove",n.onPointerMove),n.domElement.removeEventListener("pointerup",n.onPointerUp)),n.dispatchEvent({type:"end"}),o=i.NONE};function ET(y){let w;switch(y.button){case 0:w=n.mouseButtons.LEFT;break;case 1:w=n.mouseButtons.MIDDLE;break;case 2:w=n.mouseButtons.RIGHT;break;default:w=-1}switch(w){case b.MOUSE.DOLLY:if(n.enableZoom===!1)return;TT(y),o=i.DOLLY;break;case b.MOUSE.ROTATE:if(y.ctrlKey||y.metaKey||y.shiftKey){if(n.enablePan===!1)return;Xh(y),o=i.PAN}else{if(n.enableRotate===!1)return;Dh(y),o=i.ROTATE}break;case b.MOUSE.PAN:if(y.ctrlKey||y.metaKey||y.shiftKey){if(n.enableRotate===!1)return;Dh(y),o=i.ROTATE}else{if(n.enablePan===!1)return;Xh(y),o=i.PAN}break;default:o=i.NONE}o!==i.NONE&&n.dispatchEvent({type:"start"})}function DT(y){switch(o){case i.ROTATE:if(n.enableRotate===!1)return;wT(y);break;case i.DOLLY:if(n.enableZoom===!1)return;ST(y);break;case i.PAN:if(n.enablePan===!1)return;bT(y);break}}this.onMouseWheel=function(w){n.enabled===!1||n.enableZoom===!1||o!==i.NONE||(w.preventDefault(),n.dispatchEvent({type:"start"}),vT(w),n.dispatchEvent({type:"end"}))},this.onKeyDown=function(w){n.enabled===!1||n.enablePan===!1||_T(w)};function XT(y){switch(zh(y),v.length){case 1:switch(n.touches.ONE){case b.TOUCH.ROTATE:if(n.enableRotate===!1)return;Zh(),o=i.TOUCH_ROTATE;break;case b.TOUCH.PAN:if(n.enablePan===!1)return;Ch(),o=i.TOUCH_PAN;break;default:o=i.NONE}break;case 2:switch(n.touches.TWO){case b.TOUCH.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;WT(),o=i.TOUCH_DOLLY_PAN;break;case b.TOUCH.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;xT(),o=i.TOUCH_DOLLY_ROTATE;break;default:o=i.NONE}break;default:o=i.NONE}o!==i.NONE&&n.dispatchEvent({type:"start"})}function ZT(y){switch(zh(y),o){case i.TOUCH_ROTATE:if(n.enableRotate===!1)return;Kh(y),n.update();break;case i.TOUCH_PAN:if(n.enablePan===!1)return;Rh(y),n.update();break;case i.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;IT(y),n.update();break;case i.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;YT(y),n.update();break;default:o=i.NONE}}this.onContextMenu=function(w){n.enabled!==!1&&w.preventDefault()};function CT(y){v.push(y)}function OT(y){delete L[y.pointerId];for(let w=0;w<v.length;w++)if(v[w].pointerId==y.pointerId){v.splice(w,1);return}}function zh(y){let w=L[y.pointerId];w===void 0&&(w=new b.Vector2,L[y.pointerId]=w),w.set(y.pageX,y.pageY)}function eu(y){let w=y.pointerId===v[0].pointerId?v[1]:v[0];return L[w.pointerId]}n.domElement.addEventListener("contextmenu",this.onContextMenu),n.domElement.addEventListener("pointerdown",this.onPointerDown),n.domElement.addEventListener("pointercancel",this.onPointerUp),n.domElement.addEventListener("wheel",this.onMouseWheel,{passive:!1}),this.update()}};var Ea=class extends Ya{registryEvent(){this.addEventListener("change",this.onChange),this.context.addEventListener("update",this.tweenUpdate)}unRegistryEvent(){this.removeEventListener("change",this.onChange),this.context.removeEventListener("update",this.tweenUpdate)}setPolarAngle(t,e){e===void 0&&(e=!1);let{maxPolarAngle:n,minPolarAngle:i}=this,o=n===i;(e||t<=n&&t>=i)&&(this.maxPolarAngle=t,this.minPolarAngle=t,this.update()),o||(this.maxPolarAngle=n,this.minPolarAngle=i)}setPolarAngleByDuration(t,e,n){return j(this,null,function*(){return e===void 0&&(e=!1),n===void 0&&(n=500),n<=0?this.setPolarAngle(t,e):zt(new Promise(i=>{let o={polar:this.getPolarAngle()},s={polar:t},a=new sr.Tween(o,this.tweenGroup).to(s,n).onUpdate(()=>{this.setPolarAngle(o.polar,e)}).onComplete(()=>{this.enabled=!0,this.tweenGroup.remove(a),i(!0)}).onStart(()=>{this.enabled=!1}).start()}),n+500)})}setAzimuthalAngle(t,e){let{maxAzimuthAngle:n,minAzimuthAngle:i}=this,o=n===i;(e||t<=n&&t>=i)&&(this.maxAzimuthAngle=t,this.minAzimuthAngle=t,this.update()),o||(this.maxAzimuthAngle=n,this.minAzimuthAngle=i)}setAzimuthalAngleDuration(t,e,n){return e===void 0&&(e=!1),n===void 0&&(n=500),n<=0?this.setAzimuthalAngle(t,e):zt(new Promise(i=>{let o={azimuthal:this.getAzimuthalAngle()},s={azimuthal:t},a=new sr.Tween(o,this.tweenGroup).to(s,n).onUpdate(()=>{this.setAzimuthalAngle(o.azimuthal,e)}).onComplete(()=>{this.enabled=!0,this.tweenGroup.remove(a),i(!0)}).onStart(()=>{this.enabled=!1}).start()}),n+500)}getCameraLookAt(){return new sh.Vector3().subVectors(this.target,this.camera.position)}setCameraPositionByTarget(t,e){return j(this,null,function*(){let n=this.target.clone(),i=this.getCameraLookAt();if(!e){this.camera.position.copy(t.clone().sub(i)),this.target.copy(t.clone()),this.update();return}return zt(new Promise(o=>{let s=new sr.Tween(n,this.tweenGroup).to(t,e).onUpdate(()=>{this.camera.position.copy(n.clone().sub(i)),this.target.copy(n.clone()),this.update()}).onComplete(()=>{this.tweenGroup.remove(s),this.enabled=!0,o(!0)}).onStart(()=>{this.enabled=!1}).start()}),e+500)})}setZoom(t,e,n){n===void 0&&(n=!1);let{minZoom:i,maxZoom:o}=this;(n||t>=i&&t<=o)&&(this.camera.position.copy(e.clone().sub(this.getCameraLookAt())),this.target.copy(e),this.camera.zoom=t,this.update())}setZoomByDuration(t,e,n,i){return j(this,null,function*(){n===void 0&&(n=!1),i===void 0&&(i=500);let o={zoom:this.camera.zoom,target:this.target.clone()};if(t!==this.camera.zoom)return i?zt(new Promise(s=>{let a=new sr.Tween(o,this.tweenGroup).to({zoom:t,target:e},i).onUpdate(()=>{this.setZoom(o.zoom,o.target,n)}).onComplete(()=>{this.tweenGroup.remove(a),this.enabled=!0,s(!0)}).onStart(()=>{this.enabled=!1}).start()}),i+500).finally(()=>{this.enabled=!0}):this.setZoom(t,e,n)})}setTargetByOffset(t,e){if(e===void 0&&(e=this.target.clone()),!t)return;this.camera.updateMatrix();let n=new sh.Vector3;n.setFromMatrixColumn(this.camera.matrix,1),n.normalize(),n.multiplyScalar(t/this.camera.zoom),e.add(n),this.setCameraPositionByTarget(e,0)}clearTween(){this.tweenGroup.getAll().forEach(t=>t.stop()),this.tweenGroup.removeAll()}dispose(){super.dispose(),this.unRegistryEvent(),this.clearTween()}constructor(t,e,n){super(e,n),this.context=t,this.camera=e,this.domElement=n,this.prevCameraZoom=1,this.tweenGroup=new sr.Group,this.offsetY=0,this.onChange=()=>{let i=this.camera.zoom;i!==this.prevCameraZoom&&(this.prevCameraZoom=i,this.dispatchEvent({type:"change-zoom",zoom:i}))},this.tweenUpdate=()=>{this.tweenGroup.update()},this.enableDamping=!1,this.zoomSpeed=.5,this.prevCameraZoom=e.zoom,this.registryEvent()}};var Ur=require("three");var Da=class extends Ur.WebGLRenderer{setCameraAndScene(t,e){this.scene=t,this.camera=e}autoRender(){this.scene&&this.camera&&this.enable&&(this.event.dispatchEvent({type:"update"}),this.render(this.scene,this.camera)),this.timer.requestAnimationFrame(()=>{this.autoRender()})}pauseRender(){this.enable=!1}continueRender(){this.enable=!0}addEventListener(t,e){this.event.addEventListener(t,e)}removeEventListener(t,e){this.event.removeEventListener(t,e)}dispose(){this.timer.dispose(),this.enable=!1,super.dispose()}constructor(t){super(T({antialias:!0,alpha:!0},t)),this.event=new Ur.EventDispatcher,this.enable=!0,this.timer=new rt,this.autoClear=!0,this.setPixelRatio(window.devicePixelRatio),this.shadowMap.enabled=!0,this.shadowMap.autoUpdate=!0,this.shadowMap.type=Ur.PCFSoftShadowMap}};var Xn=require("three"),B1=require("three/examples/jsm/loaders/RGBELoader.js");var Xa=class extends Xn.Scene{constructor(){super(),new B1.RGBELoader().load(y1,t=>{t.mapping=Xn.EquirectangularReflectionMapping,this.environment=t;let e=new Xn.Matrix4;e.makeRotationX(Math.PI/2),this.environmentRotation=new Xn.Euler().setFromRotationMatrix(e)})}};var Q1=require("three"),Za=class extends Q1.OrthographicCamera{constructor(t,e){super(-t/2,t/2,e/2,-e/2,-1e4,5e4),this.up.set(0,0,1),this.position.set(0,0,100),this.lookAt(0,0,0)}};var Wo=class extends F.EventDispatcher{resizeClientSize(){let{x:t,y:e,width:n,height:i}=this.container.getBoundingClientRect();this.clientSize={width:n||this.container.clientWidth,height:i||this.container.clientHeight,x:t,y:e}}init(){let{clientWidth:t,clientHeight:e}=this.container;this.camera=new Za(t,e),this.renderer.setSize(t,e),this.renderer.setCameraAndScene(this.scene,this.camera),this.renderer.autoRender(),this.control=new Ea(this,this.camera,this.renderer.domElement),this.control.maxPolarAngle=this.config.control.maxPolar,this.container.appendChild(this.renderer.domElement),this.scene.add(this.lights),this.basicRatio=this.getRatio(),this.control.addEventListener("change",this.onControlChange),this.control.addEventListener("change-zoom",this.onControlChangeZoom),this.renderer.addEventListener("update",this.onRendererUpdate),this.cameraBound=new Wa(this)}getRatio(t,e){t===void 0&&(t=new F.Vector3(0,0,0)),e===void 0&&(e=new F.Vector3(100,0,0));let{clientWidth:n,clientHeight:i}=this.container,o=I(t,this.camera,n,i),s=I(e,this.camera,n,i);return Math.ceil(Math.sqrt((s.x-o.x)**2+(s.y-o.y)**2))}changeAmbientLightColor(t){this.lights.children.forEach(e=>{e instanceof F.AmbientLight&&(e.color=new F.Color(t))})}switchFloor(t){this.currentFloor&&(this.scene.remove(this.currentFloor),this.currentFloor.dispose()),this.currentFloor=t,this.scene.add(t);let e=t.getCenter();e&&(this.lights.position.x=e.x,this.lights.position.y=e.y),this.cameraBound.updateBox()}getGraphicsByDeviceXy(t,e){var n;let i=new F.Vector2;i.x=t/this.clientSize.width*2-1,i.y=e/this.clientSize.height*-2+1;let o=new F.Raycaster;return o.setFromCamera(i,this.camera),o.ray.origin.sub(o.ray.direction.clone().multiplyScalar(100)),((n=this.currentFloor)==null?void 0:n.graphicLayer.getGraphicByRaycaster(o))||{graphics:[],position:null}}getPoisByDeviceXy(t,e){var n,i;let o=(n=this.currentFloor)==null?void 0:n.poiLayer.getPoiByDeviceXy(t,e),s=(i=this.currentFloor)==null?void 0:i.poiLayer2.getPoiByDeviceXy(t,e);return(o||[]).concat(s||[])}registryEvent(){window.addEventListener("resize",this.onWindowResize),this.container.addEventListener("click",this.onClick),this.container.addEventListener("pointerover",this.onPointerover),this.container.addEventListener("pointermove",this.onPointermove),this.container.addEventListener("pointerleave",this.onPointerleave),this.container.addEventListener("pointercancel",this.onPointerleave),this.container.addEventListener("pointerout",this.onPointerleave),this.selection.addEventListener("select",this.onSelectionSelect),this.hoverHelper.addEventListener("hover-change",this.onHoverChange)}unRegistryEvent(){window.removeEventListener("resize",this.onWindowResize),this.container.removeEventListener("click",this.onClick),this.container.removeEventListener("pointerover",this.onPointerover),this.container.removeEventListener("pointermove",this.onPointermove),this.container.removeEventListener("pointerleave",this.onPointerleave),this.container.removeEventListener("pointercancel",this.onPointerleave),this.container.removeEventListener("pointerout",this.onPointerleave),this.selection.removeEventListener("select",this.onSelectionSelect),this.hoverHelper.removeEventListener("hover-change",this.onHoverChange),this.control.removeEventListener("change",this.onControlChange),this.control.removeEventListener("change-zoom",this.onControlChangeZoom),this.renderer.removeEventListener("update",this.onRendererUpdate)}setPolarAngle(t,e){return e===void 0&&(e=500),this.control.setPolarAngleByDuration(t,!0,e)}setAzimuthalAngle(t,e){return e===void 0&&(e=500),this.control.setAzimuthalAngleDuration(t,!0,e)}getCameraLookAt(){return this.control.getCameraLookAt()}setZoom(t,e,n){return n===void 0&&(n=500),this.control.setZoomByDuration(t,e,!0,n)}getFitCameraToObjectZoom(t,e,n,i){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=500),i===void 0&&(i=!0);let[o,s,a,u]=e,{clientSize:{width:l,height:c}}=this,h=this.control.getPolarAngle();i&&this.setPolarAngle(0,0);let p=new F.Box3().setFromObject(t);this.setPolarAngle(h,0);let{max:m,min:g}=p,M=new F.Vector3(g.x,m.y,m.z),P=new F.Vector3(m.x,m.y,m.z),A=new F.Vector3(m.x,g.y,g.z),S=new F.Vector3(g.x,g.y,g.z),x=I(M,this.camera,l,c),D=I(P,this.camera,l,c),E=I(S,this.camera,l,c),z=I(A,this.camera,l,c),L=new F.Box2().setFromPoints([new F.Vector2(x.x,x.y),new F.Vector2(D.x,D.y),new F.Vector2(E.x,E.y),new F.Vector2(z.x,z.y)]).getSize(new F.Vector2),Br=(l-s-u)/L.x,lr=(c-o-a)/L.y,Ue=Math.min(Br,lr),un=new F.Vector3((m.x+g.x)/2,(m.y+g.y)/2,(m.z+g.z)/2),cr=Ue*this.camera.zoom,Zn=this.camera.clone();Zn.zoom=cr,Zn.updateMatrix();let Ge=(l-L.x*Ue)/2,hr=(c-L.y*Ue)/2,Qr=Ge<s||Ge<u?(s-u)/2:0,Hr=hr<o||hr<a?(o-a)/2:0;if(Qr){let Zt=new F.Vector3;Zt.setFromMatrixColumn(Zn.matrix,0),Zt.normalize(),Zt.multiplyScalar(Qr/cr),un.add(Zt)}if(Hr){let Zt=new F.Vector3;Zt.setFromMatrixColumn(Zn.matrix,1),Zt.normalize(),Zt.multiplyScalar(Hr/cr),un.add(Zt)}return{zoom:Ue*this.camera.zoom,center:un}}fitCameraToObject(t,e,n,i){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=500),i===void 0&&(i=!0);let{zoom:o,center:s}=this.getFitCameraToObjectZoom(t,e,n,i);return this.setZoom(o,s,n)}getFitCameraToGroundZoom(t,e,n){if(t===void 0&&(t=[20,20,20,20]),e===void 0&&(e=500),n===void 0&&(n=!0),this.currentFloor&&this.currentFloor.hasElement)return this.getFitCameraToObjectZoom(this.currentFloor.groundUpper,t,e,n).zoom}fitCameraToGround(t,e,n){return t===void 0&&(t=[20,20,20,20]),e===void 0&&(e=500),n===void 0&&(n=!0),this.currentFloor&&this.currentFloor.hasElement?this.fitCameraToObject(this.currentFloor.groundLayer,t,e,n):Promise.resolve(!1)}setCameraPosition(t,e){return j(this,null,function*(){return this.control.setCameraPositionByTarget(t,e)})}pauseRender(){this.renderer.pauseRender()}continueRender(){this.renderer.continueRender()}dispose(){var t;(t=this.currentFloor)==null||t.dispose(),this.control.dispose(),this.cameraBound.dispose(),this.selection.dispose(),this.hoverHelper.dispose(),this.unRegistryEvent(),this.renderer.domElement.remove(),this.renderer.dispose(),this.lights.children.forEach(e=>e.dispose()),q(this.scene),this.scene.clear(),this.container=null}constructor(t,e){super(),this.container=t,this.config=e,this.scene=new Xa,this.renderer=new Da,this.lights=s0(),this.clientSize={width:0,height:0,x:0,y:0},this.renderRf=0,this.onControlChange=()=>{this.dispatchEvent({type:"change-ratio",px:(this.basicRatio||0)*this.camera.zoom}),this.dispatchEvent({type:"control-change"})},this.onControlChangeZoom=n=>{let{zoom:i}=n;this.dispatchEvent({type:"control-zoom-change",zoom:i})},this.onRendererUpdate=()=>{this.dispatchEvent({type:"update"})},this.onWindowResize=()=>{let{container:n,camera:i,renderer:o}=this,{clientWidth:s,clientHeight:a}=n;s=Math.max(1,s),a=Math.max(1,a),i.left=-s/2,i.right=s/2,i.top=a/2,i.bottom=-a/2,i.updateProjectionMatrix(),o.setSize(s,a),this.resizeClientSize(),this.dispatchEvent({type:"resize",width:s,height:a})},this.onClick=n=>{let{graphics:i,position:o}=this.getGraphicsByDeviceXy(n.offsetX,n.offsetY);i.length&&this.dispatchEvent({type:"graphic-click",graphics:i,position:o});let s=this.getPoisByDeviceXy(n.offsetX,n.offsetY);s.length&&this.dispatchEvent({type:"poi-click",pois:s})},this.onPointerover=n=>{let{graphics:i,position:o}=this.getGraphicsByDeviceXy(n.offsetX,n.offsetY),s=this.getPoisByDeviceXy(n.offsetX,n.offsetY);this.dispatchEvent({type:"pointer-over",e:n,graphics:i,pois:s,position:o})},this.onPointermove=n=>{let{graphics:i,position:o}=this.getGraphicsByDeviceXy(n.offsetX,n.offsetY),s=this.getPoisByDeviceXy(n.offsetX,n.offsetY);this.dispatchEvent({type:"pointer-move",e:n,graphics:i,pois:s,position:o})},this.onPointerleave=n=>{this.dispatchEvent({type:"pointer-level"})},this.onSelectionSelect=n=>{let{graphics:i,isMultipleSelect:o}=n;this.dispatchEvent({type:"select-graphic",graphics:i,isMultipleSelect:o})},this.onHoverChange=n=>{let{graphics:i}=n;this.dispatchEvent({type:"hover",graphics:i})},this.container.style.position="relative",this.container.style.overflow="hidden",this.init(),this.selection=new vo(this),this.hoverHelper=new _o(this),this.resizeClientSize(),this.registryEvent()}};var H1=require("lodash"),q1={placeId:0,apiDomain:"",apiInfo:{},apiPath:{floorGraphic:"/api/inception-map/floor/get",floorRange:"/api/inception-map/range/get",equipmentList:"/api/inception-map/equipment/get",roadNetwork:"/api/inception-map/road_network/get",loadPlaceInfo:"https://screen.aibee.cn/ai-map/map/get-floor-map"},enableBoxSelect:!0,resizeObserver:!1,initTransToMark:!1,heatMap:{radius:50,gradient:{0:"#8F9FCD",.5:"#6284FF",1:"#F95D5D"}},useFloorCache:!0,control:{maxPolar:1.2,defaultPolar:1.1,defaultAzimuthal:0},defaultPadding:[20,20,20,20],svg:{circle:{radius:"2",fill:"#1CADFF"},line:{stroke:"#1CADFF"}},selectBox:{stroke:"#1CADFF",fill:"rgba(28, 173, 255, 0.3)"},hover:{time:100},ground:{color:"#F6F6F6",opacity:1,height:.001,stroke:!1,strokeColor:"#E6E6E6",strokeOpacity:1},markGraphic:{color:"#EEF0F3",opacity:1,height:.001,stroke:!1,strokeColor:"#000",strokeOpacity:1},graphic:{fillOpacity:1},cameraBound:{padding:[150,150,150,150]},poi:{boxScale:1}};function ah(r){return(0,H1.merge)({},q1,r)}var iT=require("lodash");var O7=d(W(),1);var we;function $1(r,t){return r===void 0&&(r="aibee_map"),t===void 0&&(t=1),new Promise((e,n)=>{if(we)return e({db:we,type:"success"});let i=indexedDB.open(r,t);i.onupgradeneeded=function(o){we=o.target.result,console.log("onupgradeneeded"),e({db:we,type:"onupgradeneeded"})},i.onsuccess=o=>{we=o.target.result,e({db:we,type:"success"})},i.onerror=o=>{n(o)}})}function uh(r,t,e){return e===void 0&&(e=we),new Promise((n,i)=>{e||i("\u6CA1\u6709db");let s=e.transaction([r],"readonly").objectStore(r).get(t);s.onsuccess=()=>{s.result?n(s.result.value):n(null)},s.onerror=a=>{console.log("[getVersionByKey]",a),n(null)}})}function tT(r,t,e,n){return n===void 0&&(n=we),new Promise((i,o)=>(n||o("\u6CA1\u6709db"),new Promise((s,a)=>j(this,null,function*(){let u=yield uh(r,t),l=n.transaction([r],"readwrite").objectStore(r),c=u!==null?l.put({key:t,value:e}):l.add({key:t,value:e});c.onsuccess=function(h){s(h)},c.onerror=function(h){a(h)}}))))}function ar(r,t){t===void 0&&(t=we),t&&(t.objectStoreNames.contains(r)||t.createObjectStore(r,{keyPath:"key"}))}function eT(r){r===void 0&&(r=we),r==null||r.close(),we=null}var Ra=require("three");var I7=d(K(),1),Y7=d(W(),1);function Ca(r,t){let e=r.poi_info.showName||r.store_name||r.poi_info.text;switch(t){case"zh-cn":return e;case"en":var n;return((n=r.store_info_ext)==null?void 0:n.poi_name)||e;case"zh-hk":var i;return((i=r.store_info_ext)==null?void 0:i.traditional_name)||e}}function Oa(r,t){let e=r.poi_info.showName||r.store_name||r.poi_info.text;switch(t){case"zh-cn":return e;case"en":var n;return((n=r.infra_info_ext)==null?void 0:n.poi_name)||e;case"zh-hk":var i;return((i=r.infra_info_ext)==null?void 0:i.traditional_name)||e}}function nT(r,t,e){switch(r.l_type){case"graph":return d9(r,t);case"wall":return m9(r,t);case"lane":return g9(r,t);case"texture2d":case"texture3d":return y9(r,t);case"glb":return M9(r,t);case"store":return P9(r,t);case"facility":return A9(r,t);case"parkingSpace":return w9(r,t,e);case"text":return b9(r,t)}}function rT(r,t,e){switch(r.l_type){case"store":return j9(r,t,e);case"facility":return T9(r,t,e);case"parkingSpace":return S9(r,t)}}function d9(r,t){let e=t.userData.center;At(r.elements,e);let n=[];r.elements.forEach(o=>{o.group==="ground"?t.createGround(o):n.push(o)});let i=n.reduce((o,s)=>{let{fillColor:a,fillOpacity:u,strokeColor:l,strokeOpacity:c,height:h,airHeight:p}=s,m=a.toLowerCase()+"-"+u+"-"+l.toLowerCase()+"-"+c+"-"+h+"-"+p;return c===0&&(m=a.toLowerCase()+"-"+u+"-"+h+"-"+p),o[m]?o[m].push(s):o[m]=[s],o},{});Object.values(i).forEach(o=>{let s=new ir(t.context,o);t.mergeGraphicLayer.add(s)})}function m9(r,t){let e=t.userData.center;At(r.elements,e);let n=r.elements.reduce((i,o)=>{let{fillColor:s,fillOpacity:a,strokeColor:u,strokeOpacity:l,height:c}=o,h=s.toLowerCase()+"-"+a+"-"+u.toLowerCase()+"-"+l+"-"+c;return l===0&&(h=s.toLowerCase()+"-"+a+"-"+c),i[h]?i[h].push(o):i[h]=[o],i},{});Object.values(n).forEach(i=>{let o=new Ao(t.context,i);t.wallLayer.add(o)})}function g9(r,t){let e=t.userData.center;At(r.elements,e);let n=r.elements.reduce((i,o)=>{let{fillColor:s,fillOpacity:a,strokeColor:u,strokeOpacity:l}=o,c=s.toLowerCase()+"-"+a+"-"+u.toLowerCase()+"-"+l;return l===0&&(c=s.toLowerCase()+"-"+a),i[c]?i[c].push(o):i[c]=[o],i},{});Object.values(n).forEach(i=>{let o=new wo(t.context,i);t.laneLayer.add(o)})}function y9(r,t){let e=t.userData.center;if(At(r.elements,e),r.elements.length){let n=new rr(t.context,r.elements);t.textureLayer.add(n)}}function M9(r,t){let e=t.userData.center;At(r.elements,e),r.elements.forEach(n=>{let i=new To(t.context,T({},n,{url:n.secondUrl,rotate:n.secondRotate,width:n.secondWidth,center_x:n.center_coord_x,center_y:n.center_coord_y}));t.glbModelLayer.add(i)})}function P9(r,t){let e=t.userData.center;At(r.elements,e),r.elements.map(n=>{let i=t.addGraphic(n);t.userData.graphics.push(i),t.userData.graphicMap.set(n.id,i)})}function j9(r,t,e){r.elements.map(n=>{try{let i=Ca(n,e),o=new ot(t.context,{id:n.id,icon:n.poi_info.icon,text:i,position:{x:n.center_coord_x,y:n.center_coord_y,z:n.airHeight+n.height},icon_size:[24,24],level:n.poi_info.level||0});t.poiLayer2.pushPoi(o),o&&(o.userData.type="store",o.userData.data=n,o.userData.floor=t.name)}catch(i){console.log("\u521B\u5EFA\u5E97\u94FApoi\u5931\u8D25",i,n)}})}function A9(r,t){let e=t.userData.center;At(r.elements,e),r.elements.map(n=>{let i=t.addGraphic(n);t.userData.graphics.push(i),t.userData.graphicMap.set(n.id,i)})}function T9(r,t,e){r.elements.filter(i=>i.poi_info).map(i=>{try{let o=Oa(i,e),s=new ot(t.context,{id:i.id,icon:i.poi_info.icon,text:o,position:{x:i.center_coord_x,y:i.center_coord_y,z:i.airHeight+i.height},icon_size:[24,24],level:i.poi_info.level||0});t.poiLayer2.pushPoi(s),s.userData.type="facility",s.userData.data=i,s.userData.floor=t.name}catch(o){console.log("\u6DFB\u52A0facility\u5931\u8D25",o,i)}})}function w9(r,t,e){let n=t.userData.center;At(r.elements,n),t.parkingSpaceLayer.createParkings(r.elements,e.mergeParkingSpace),t.userData.parkingSpaces=t.parkingSpaceLayer.graphicMap.values(),t.userData.parkingSpacesGraphicMap=t.parkingSpaceLayer.graphicMap}function S9(r,t){r.elements.filter(n=>n.texts[0]).forEach(n=>{try{let i=new ot(t.context,{id:n.id,text:n.texts[0],position:{x:n.center_coord_x,y:n.center_coord_y,z:n.airHeight+n.height}});i&&(i.userData.type="parkingSpace",i.userData.data=n,i.userData.floor=t.name),t.poiLayer2.pushPoi(i)}catch(i){console.log("\u6DFB\u52A0\u8F66\u4F4Dpoi\u5931\u8D25",i,n)}})}function b9(r,t){let e=t.userData.center;At(r.elements,e);let n=new So(t.context,r.elements.map(i=>T({},i,{center_x:i.center_coord_x,center_y:i.center_coord_y})));t.textTextureLayer.add(n)}var lh="map_version",ch="route_version",hh="facility_version",ph="map_data",Ka="road_network_data",fh="facility_data",v9={mergeParkingSpace:!0},xo=class extends Ra.EventDispatcher{initDb(){return j(this,null,function*(){try{let{db:t,type:e}=yield $1("aibee_map",2);e==="onupgradeneeded"&&(ar(lh),ar(ch),ar(hh),ar(ph),ar(Ka),ar(fh)),this.db=t}catch(t){console.log("[\u6253\u5F00indexDb\u9519\u8BEF]",t)}})}load(t){return j(this,null,function*(){if(Array.isArray(t))this.floors=t;else{let e=yield fetch(t).then(n=>n.json());e.code===200&&(this.floors=e.data.list)}})}setCacheData(t,e,n){return this.initDbPromise.then(()=>tT(t,""+e,n,this.db))}getCacheData(t,e){return this.initDbPromise.then(()=>uh(t,""+e,this.db))}getFloorCacheKey(t){return""+t.floor_id}getFloorData(t){return j(this,null,function*(){let e=yield this.getFloorJsonData(t);return e?this.getDataByJson(e):null})}getFloorDataByFloorInfo(t){return j(this,null,function*(){let e=yield this.getFloorJsonDataByFloorInfo(t);return this.getDataByJson(e)})}setLocale(t){this.locale=t,this.bmap.context.currentFloor&&this.bmap.context.currentFloor.poiLayer2.pois.forEach(e=>{e.userData.type==="store"&&(e.options.text=Ca(e.userData.data,t)),e.userData.type==="facility"&&(e.options.text=Oa(e.userData.data,t))})}getFloorJsonDataByFloorInfo(t){return j(this,null,function*(){let e=this.getFloorCacheKey(t);console.time("zstd_json");let n=yield fetch(t.map_url).then(i=>i.json());return n.floor=t.floor,console.timeEnd("zstd_json"),this.setCacheData(ph,e,n),this.setCacheData(lh,e,t.version_id),n})}getFloorJsonData(t){return j(this,null,function*(){let e=this.floors.find(i=>i.floor===t);if(!e)return null;let n=this.getFloorCacheKey(e);try{if((yield this.getCacheData(lh,n))===e.version_id){let o=yield this.getCacheData(ph,n);if(o)return o}return this.getFloorJsonDataByFloorInfo(e)}catch(i){return console.log("[get floor data error]",i),this.getFloorJsonDataByFloorInfo(e)}})}getRoadNetworkData(){return j(this,null,function*(){return(yield Promise.all(this.floors.map(e=>j(this,null,function*(){let n=this.getFloorCacheKey(e);try{if((yield this.getCacheData(ch,n))===e.version_id){let s=yield this.getCacheData(Ka,n);if(s)return s}let o=yield fetch(e.route_url).then(s=>s.json());return this.setCacheData(Ka,n,o),this.setCacheData(ch,n,e.version_id),o}catch(i){let o=yield fetch(e.route_url).then(s=>s.json());return this.setCacheData(Ka,n,o),o}})))).filter(e=>e.points)})}getFacilitiesData(){return j(this,null,function*(){let t=this.floors.reduce((i,o)=>i.updated_at>o.updated_at?i:o,this.floors[0]);if(!t)return null;let e=this.getFloorCacheKey(t),n=()=>j(this,null,function*(){let i=yield fetch(t.entry_infra_url).then(o=>o.json());return i&&(this.setCacheData(fh,e,i),this.setCacheData(hh,e,t.version_id)),i});try{if((yield this.getCacheData(hh,e))===t.version_id){let o=yield this.getCacheData(fh,e);if(o)return o}return n()}catch(i){return console.log("[get facility error]",i),n()}})}getOtherDataByFreeTime(){return j(this,null,function*(){})}getMulFloorsData(t){return j(this,null,function*(){return Promise.all(t.map(e=>this.getFloorData(e))).then(e=>e.filter(n=>n))})}getDataByUrl(t){return j(this,null,function*(){let e=yield fetch(t).then(n=>n.json());return this.getDataByJson(e)})}getDataByJson(t,e){return j(this,null,function*(){return e=this.getFloorBaseLayer(t,e),yield this.getFloorContentLayer(t,e),this.getFloorPoi(t,e),this.changeFloorBox(t,e),e})}changeFloorBox(t,e){e.updateBox();let n=e.box.getSize(new Ra.Vector3),i=Math.max(n.x,n.y,n.z);e.userData.height=i/4+t.floorHeight}switchFloor(t){return j(this,null,function*(){return new Promise(e=>{let n={run:()=>this._switchFloor(t),meta:{type:"switchFloor"}},i=this.taskQueue.replaceByMetaType(n),o=s=>{let{task:a,res:u}=s;a.tid===i&&(this.taskQueue.removeEventListener("active-task-end",o),e(u))};this.taskQueue.addEventListener("active-task-end",o)})})}_switchFloor(t){return j(this,null,function*(){var e;let n=t;if(typeof t=="string"){let u=yield this.getFloorJsonData(t);if(u)n=u;else return null}let i=new Gt(this.bmap.context),o=this.floors.find(u=>u.floor===n.floor);var s;let a=(s=o==null?void 0:o.map_angle)!=null?s:0;return this.bmap.dispatchEvent({type:Mt.SWITCH_FLOOR_BEFORE,data:{curFloor:i,graphics:[]}}),this.dispatchEvent({type:"switch-floor-before",data:{curFloor:i,graphics:[]}}),this.bmap.context.control.setAzimuthalAngle(a/180*Math.PI,!0),this.getFloorBaseLayer(n,i),this.changeFloorBox(n,i),this.bmap.buildingCenter=i.userData.center,this.bmap.currentBuildGround=(e=i.userData.data.layers.find(u=>u.l_type==="range"))==null?void 0:e.elements[0],this.bmap.context.switchFloor(i),this.bmap.initialFloorCamera(),this.bmap.context.cameraBound.updateBox(),this.dispatchEvent({type:"switch-floor-ground",data:{curFloor:i,graphics:[]}}),yield bi(),yield this.getFloorContentLayer(n,i),this.changeFloorBox(n,i),this.dispatchEvent({type:"switch-floor-content",data:{curFloor:i,graphics:[]}}),yield T0(2),this.getFloorPoi(n,i),this.dispatchEvent({type:"switch-floor-after",data:{curFloor:i,graphics:i.graphicLayer.children}}),this.bmap.dispatchEvent({type:Mt.SWITCH_FLOOR_AFTER,data:{curFloor:i,graphics:i.graphicLayer.children}}),i})}getFloorBaseLayer(t,e){e||(e=new Gt(this.bmap.context));let n=[0,0];return t.layers.forEach(i=>{switch(i.l_type){case"range":let o=i.elements[0];n=[o.center_x,o.center_y];break;case"ground":At(i.elements,n);let s=i.elements.map(a=>new et(this.bmap.context,a));e.addGrounds(s);break;default:break}}),e.userData.center=n,e.name=t.floor,e.userData.data=t,e}getFloorContentLayer(t,e){return j(this,null,function*(){e||(e=new Gt(this.bmap.context)),e.userData.graphics=[],e.userData.graphicMap=new Map;let n=Date.now();for(let i=0;i<t.layers.length;i++){let o=t.layers[i];["range","ground"].includes(o.l_type)||(nT(o,e,this.options),console.log("time",Date.now()-n,o.l_type),Date.now()-n>50&&(yield bi(),n=Date.now()))}return e})}getFloorPoi(t,e){let n=Date.now();t.layers.map(o=>{rT(o,e,this.locale)}),console.log("poi time",Date.now()-n);let i=Date.now();bi().then(()=>{console.log("poi render time",Date.now()-i)})}clear(){return j(this,null,function*(){var t;eT((t=this.db)!=null?t:void 0)})}dispose(){this.clear()}constructor(t,e={}){super(),this.bmap=t,this.floors=[],this.initDbPromise=Promise.resolve(),this.db=null,this.taskQueue=new Ln,this.locale="zh-cn",this.options=T({},v9,e),this.initDbPromise=this.initDb()}};var L7=d(W(),1);function dh(r,t){return j(this,null,function*(){let{brand:e,project:n}=r,{apiDomain:i,apiPath:{floorRange:o},apiInfo:s}=t,a=""+i+o+"?brand="+e+"&project="+n+"&phase="+n+"&building="+n;return yield fetch(a,s).then(l=>l.json()).then(l=>l.data).then(l=>{let c=(l||[])[0];return c&&(c.info=JSON.parse(c.info)),c})})}function mh(r,t){return j(this,null,function*(){let{brand:e,project:n,floor:i,ts:o,resource_type_list:s}=r,{apiDomain:a,apiPath:{floorGraphic:u},apiInfo:l}=t,c=""+a+u+"?brand="+e+"&project="+n+"&phase="+n+"&building="+n+"&floor="+i+"&ts="+o+"&resource_type_list="+s;return yield fetch(c,l).then(p=>p.json()).then(p=>p.data).then(p=>((p||[]).map(m=>m.info=JSON.parse(m.info)),p||[]))})}function _9(r,t){return j(this,null,function*(){let{project:e,floor:n}=r,{apiDomain:i,apiInfo:o}=t,s=i+"/api/inception-map/external_street/get?projectCode="+e+"&floorCode="+n;return yield fetch(s,o).then(u=>u.json()).then(u=>u.data).then(u=>JSON.parse(u[0].streetInfo||"{}")).then(u=>u.fileId?W9(u.fileId,t):null)})}function W9(r,t){return j(this,null,function*(){let{apiDomain:e,apiInfo:n}=t;return fetch(e+"/api/inception-map/file/getFileStream?fileId="+r,n).then(i=>i.arrayBuffer()).then(i=>{let s=new TextDecoder("utf-8").decode(i);return s?JSON.parse(s):null})})}var gh=class{load(t){return j(this,null,function*(){let e=kn(t);if(this.cacheData.has(e))return this.cacheData.get(e);let[,n]=yield Promise.all([this.loadBuildGround(t),mh(t,this.bmap.config)]),i=kn({floor:t.floor,ts:t.ts});At(n.map(s=>s.info),this.bmap.buildingCenter,this.floorDataLengthMap.get(i)||0),n.forEach(s=>s.info.transformToBuildingGround=!1),this.cacheData.set(e,n);let o=this.floorDataLengthMap.get(i)||0;return this.floorDataLengthMap.set(i,o+n.length),this.loadExternalStreet(t),n})}loadExternalStreet(t){return j(this,null,function*(){})}switchFloorByData(t,e){if(!t.length)return;let n=e.userData.legacyToGraphicMap||new Map,i=e.userData.graphicMap||new Map,{ground:o,markGraphic:s,graphic:a}=this.bmap.config;for(let u=0;u<t.length;u++){let l=t[u];l.info.group==="ground"?(l.info.fillColor=o.color,l.info.fillOpacity=o.opacity,l.info.height=o.height,l.info.stroke=o.stroke,l.info.strokeColor=o.strokeColor,l.info.strokeOpacity=o.strokeOpacity):l.info.userData.mark?(l.info.height=s.height,l.info.fillColor=s.color,l.info.fillOpacity=s.opacity,l.info.stroke=s.stroke,l.info.strokeColor=s.strokeColor,l.info.strokeOpacity=s.strokeOpacity):(l.info.fillOpacity=a.fillOpacity,this.bmap.config.initTransToMark&&(l.info.height=s.height,l.info.fillColor=s.color,l.info.stroke=s.stroke,l.info.strokeColor=s.strokeColor,l.info.strokeOpacity=s.strokeOpacity))}for(let u of t){if(u.info.group==="ground")e.createGround(u.info);else{let l=e.addGraphic(u.info);l.userData.data=u,n.set(u.legacy_id,l)}i.set(u.element_uuid,u)}e.userData.legacyToGraphicMap=n,e.userData.graphicMap=i,e.updateBox(),e===this.bmap.context.currentFloor?(this.bmap.triggerHooks(Mt.SWITCH_FLOOR_BEFORE,{curFloor:e,graphics:e.graphicLayer.children}),this.bmap.initialFloorCamera(),this.bmap.triggerHooks(Mt.SWITCH_FLOOR_AFTER,{curFloor:e,graphics:e.graphicLayer.children})):this.bmap.switchFloorByFloor(e)}filterData(t,e){let n=e.userData.graphicMap||new Map;return t.filter(i=>!n.has(i.element_uuid))}switchFloorByStoreData(t,e){return j(this,null,function*(){let n=yield this.load(T({},t,{resource_type_list:"6"})),i=this.filterData(n,e);this.switchFloorByData(i,e)})}switchFloorByOtherData(t,e){return j(this,null,function*(){let n=yield this.load(T({},t,{resource_type_list:"1,2,3,4"})),i=this.filterData(n,e);this.switchFloorByData(i,e)})}loadBuildGround(t){return j(this,null,function*(){let{brand:e,project:n}=t,i=yield this.loadBuildingGround({brand:e,project:n});return this.bmap.currentBuildGround=i,this.bmap.changeBuildingCenter(i,{brand:e,project:n}),this.bmap.currentBuildGround})}loadBuildingGround(t){return j(this,null,function*(){let{brand:e,project:n}=t,i=kn({brand:e,project:n});if(this.buildingGroundMap.has(i))return this.buildingGroundMap.get(i);let o=dh({brand:e,project:n},this.bmap.config).then(s=>(this.buildingGroundMap.set(i,s),s));return this.buildingGroundMap.set(i,o),o})}switchFloor(t){return j(this,null,function*(){let e=new Gt(this.bmap.context);e.userData.graphicMap=new Map,e.name=t.floor;try{yield Promise.all([this.switchFloorByStoreData(t,e),this.switchFloorByOtherData(t,e)])}catch(n){console.log(n)}return e})}dispose(){this.cacheData.clear(),this.floorDataLengthMap.clear(),this.buildingGroundMap.clear()}constructor(t){this.bmap=t,this.cacheData=new Map,this.floorDataLengthMap=new Map,this.buildingGroundMap=new Map,this.externalStreetMap=new Map}};var x9=function(r){return r[r.D2=0]="D2",r[r.D3=1.1]="D3",r}({}),yh=class extends Fa.EventDispatcher{changeBuildingCenter(t,e){let{brand:n,project:i}=e,o=t?Ai(t.info.geometry.cds[0]):[0,0];this.buildingCenter=o,this.dispatchEvent({type:"center-change",center:o,project:i,brand:n})}use(t){t.bmap=this,this.plugins.push(t)}unUse(t){this.plugins=this.plugins.filter(e=>e!==t)}triggerHooks(t,e){this.dispatchEvent({type:t,data:e})}switchFloor(t){return j(this,null,function*(){return this.loader||(this.loader=new xo(this),yield this.loader.load(this.config.apiPath.loadPlaceInfo+"?place_id="+this.config.placeId+"&env=prod")),this.loader.switchFloor(t)})}switchFloorByFloor(t,e){e===void 0&&(e=t.graphicLayer.children),this.triggerHooks(Mt.SWITCH_FLOOR_BEFORE,{curFloor:t,graphics:e}),this.context.switchFloor(t),this.initialFloorCamera(),this.triggerHooks(Mt.SWITCH_FLOOR_AFTER,{curFloor:t,graphics:e})}initialFloorCamera(){this.context.cameraBound.setEnable(!1),this.context.control.minZoom=0,this.context.control.maxZoom=1/0,this.context.camera.zoom=1,this.context.setAzimuthalAngle(this.config.control.defaultAzimuthal,0),this.context.setPolarAngle(this.config.control.defaultPolar,0),this.context.fitCameraToGround(this.config.defaultPadding,0);let t=this.context.camera.zoom;this.context.control.minZoom=t,this.context.control.maxZoom=t*30,this.type==="3d"&&this.context.fitCameraToGround(this.config.defaultPadding,0,!1),this.basicZoom=this.context.camera.zoom,this.context.control.addEventListener("change",this.onControlChange),this.onControlChange(),this.context.cameraBound.setEnable(!0),this.context.cameraBound.changePrevCamera()}addModel(t,e){if(t.options.geometry.type==="polygon"){var n;let i=(n=this.context.currentFloor)==null?void 0:n.addModel(T({},e,{position:t.getPosition().setZ(.1),id:t.options.id}));if(i){let{facilityAngle:o=0,facilityXScale:s=1,facilityYScale:a=1}=t.options.userData;i.rotateZ((180-o)/180*Math.PI),i.scale.set(s,a,1)}}}addHeatmap(t){var e;return(e=this.context.currentFloor)==null?void 0:e.addHeatmap(t)}getLegacyToGraphicMap(){var t;return((t=this.context.currentFloor)==null?void 0:t.userData.legacyToGraphicMap)||new Map}getFloorAllGraphics(){var t;return((t=this.context.currentFloor)==null?void 0:t.graphicLayer.children.filter(e=>e instanceof et))||[]}createGraphicPoi(t,e){if(this.context.currentFloor){e.id===void 0&&(e.id=t.options.id);let n=t.options.center,i=t.getCenter(),o=(n==null?void 0:n[0])||i.x,s=(n==null?void 0:n[1])||i.y;return console.log(o,s,n,i),this.context.currentFloor.addPoi(T({},e,{position:{x:o,y:s,z:i.z+t.options.height/2}}))}return null}removeHeatMap(){var t;(t=this.context.currentFloor)==null||t.removeHeatMap()}translateElementToCenter(t,e){e===void 0&&(e=500);let n=t.getPosition();return this.context.setCameraPosition(n,e)}translateElementToCenterX(t,e){return j(this,null,function*(){return e===void 0&&(e=500),zt(new Promise(n=>{let i=this.context.control.target.clone(),o=t.getPosition();this.timer.requestAnimationFrame(()=>{let{clientSize:{width:s,height:a},camera:u}=this.context,c=I(o,u,s,a).x-s/2,h=new Fa.Vector3;h.setFromMatrixColumn(this.context.camera.matrix,0),h.normalize(),h.multiplyScalar(c/this.context.camera.zoom),i.add(h),this.context.setCameraPosition(i,e).then(n)})}),e+500)})}getElementDeviceCoordinate(t){let e=t.position.clone(),{clientWidth:n,clientHeight:i}=this.container;return I(e,this.context.camera,n,i)}changeMapType(t,e){return e===void 0&&(e=500),this.type=t,t==="2d"?this.context.setPolarAngle(0,e):this.context.setPolarAngle(1.1,e)}resetView(t){return j(this,null,function*(){t===void 0&&(t=300);let e=t/3;yield this.context.setAzimuthalAngle(this.config.control.defaultAzimuthal,e),yield this.context.setPolarAngle(this.config.control.defaultPolar,e),yield this.context.fitCameraToGround(this.config.defaultPadding,e,!1)})}reduceMap(t,e){t===void 0&&(t=.5),e===void 0&&(e=500);let n=this.context.camera.zoom;return this.context.setZoom(n-t,this.context.control.target,e)}enlargeMap(t,e){t===void 0&&(t=.5),e===void 0&&(e=500);let n=this.context.camera.zoom;return this.context.setZoom(n+t,this.context.control.target,e)}registryEvent(){if(window.addEventListener("keydown",this.onKeydown),window.addEventListener("keyup",this.onKeyUp),this.config.resizeObserver){let t=new ResizeObserver(this.debounceResize);t.observe(this.container),this.observe=t}}unRegistryEvent(){var t;this.context.control.removeEventListener("change",this.onControlChange),window.removeEventListener("keydown",this.onKeydown),window.removeEventListener("keyup",this.onKeyUp),(t=this.observe)==null||t.disconnect(),this.observe=null}configurePolarShortcutKeys(t){this.polarKeys=t}configureAzimuthalShortcutKeys(t){this.azimuthalKeys=t}rotateMap(t){t===void 0&&(t=.1);let e=this.context.control.getAzimuthalAngle();this.context.setAzimuthalAngle(e+t,500)}measureDistance(){return j(this,null,function*(){return this.cancelDistance(),new Promise((t,e)=>{this.changeMapType("2d",0),this.context.control.enableRotate=!1,this.svgLine=new Po(this.context);let n=this.svgLine.dispose.bind(this.svgLine);this.svgLine.dispose=function(){n(),e("cancel")},this.svgLine.addEventListener("distance",i=>{let{distance:o}=i;t(o)})})})}cancelDistance(){this.svgLine&&(this.svgLine.dispose(),this.svgLine=void 0,this.context.control.enableRotate=!0)}measureArea(){return this.cancelArea(),new Promise((t,e)=>{this.changeMapType("2d",0),this.context.control.enableRotate=!1,this.svgPolygon=new jo(this.context);let n=this.svgPolygon.dispose.bind(this.svgPolygon);this.svgPolygon.dispose=function(){n(),e("cancel")},this.svgPolygon.addEventListener("area",i=>{let{area:o}=i;t(o)})})}cancelArea(){this.svgPolygon&&(this.svgPolygon.dispose(),this.svgPolygon=void 0,this.context.control.enableRotate=!0)}getGraphicByNodeId(t){var e,n;return((e=this.context.currentFloor)==null?void 0:e.graphicLayer.getGraphicByNodeId(t))||((n=this.context.currentFloor)==null?void 0:n.parkingSpaceLayer.graphicMap.get(t))||null}deleteGraphic(t){var e;(e=this.context.currentFloor)==null||e.graphicLayer.removeGraphic(t)}createGraphicByOptions(t){var e;if(!t.transformToBuildingGround&&this.currentBuildGround){let n=Ai(this.currentBuildGround.info.geometry.cds[0]);if(t.geometry.type==="polygon")t.geometry.coords=JSON.parse(JSON.stringify(t.geometry.cds)),t.geometry.coords.map(i=>{Array.isArray(i)&&i.forEach(o=>{o[0]-=n[0],o[1]-=n[1]})});else{let[i,o]=t.geometry.cds;t.geometry.coords=[i-n[0],o-n[1]]}}return(e=this.context.currentFloor)==null?void 0:e.graphicLayer.createGraphic(t)}removePoiById(t){var e,n;(e=this.context.currentFloor)==null||e.poiLayer.removePoiById(t),(n=this.context.currentFloor)==null||n.poiLayer2.removePoiById(t)}getPoiById(t){var e,n;return((e=this.context.currentFloor)==null?void 0:e.poiLayer.getPoiById(t))||((n=this.context.currentFloor)==null?void 0:n.poiLayer2.getPoiById(t))}getPois(){var t,e;return[...(((t=this.context.currentFloor)==null?void 0:t.poiLayer.pois)||[]).filter(n=>!n.options.built_in),...((e=this.context.currentFloor)==null?void 0:e.poiLayer2.pois)||[]]}clearPoi(){this.context.currentFloor&&this.context.currentFloor.poiLayer.clear()}removeSelectGraphic(t){this.context.selection.remove(t)}dispose(){this.loader&&(this.loader.dispose(),this.loader=null),this.unRegistryEvent(),this.timer.dispose(),this.plugins.forEach(t=>t.dispose()),this.plugins=[],this.context.dispose(),this.context=null,this.container=null,Ut.dispose(),$t.dispose(),jn.dispose(),Yt.dispose(),B.dispose(),this.debounceResize=null}constructor(t,e={}){super(),this.container=t,this.polarKeys=[],this.azimuthalKeys=[],this.basicZoom=1,this.prevCameraZoom=1,this.type="2d",this.currentBuildGround=null,this.observe=null,this.buildingCenter=[0,0],this.timer=new rt,this.plugins=[],this.loader=null,this.onControlChange=()=>{let{camera:{zoom:n}}=this.context;n!==this.prevCameraZoom&&(this.dispatchEvent({type:"zoom-change",basicZoom:this.basicZoom,cameraZoom:this.context.camera.zoom}),this.prevCameraZoom=n)},this.onKeydown=n=>{this.polarKeys.includes(n.code)&&(this.context.control.maxPolarAngle=this.config.control.maxPolar,this.context.control.minPolarAngle=0),this.azimuthalKeys.includes(n.code)&&(this.context.control.maxAzimuthAngle=1/0,this.context.control.minAzimuthAngle=1/0)},this.onKeyUp=n=>{if(this.polarKeys.includes(n.code)){let i=this.context.control.getPolarAngle();this.context.control.maxPolarAngle=i,this.context.control.minPolarAngle=i}if(this.azimuthalKeys.includes(n.code)){let i=this.context.control.getAzimuthalAngle();this.context.control.maxAzimuthAngle=i,this.context.control.minAzimuthAngle=i}},this.resize=()=>{this.context.cameraBound.setEnable(!1),this.context.onWindowResize();let n=this.context.control.getAzimuthalAngle(),i=this.context.camera.zoom;this.context.control.minZoom=0,this.context.control.maxZoom=1/0,this.context.camera.zoom=1,this.context.setAzimuthalAngle(0,0);let o=this.context.getFitCameraToGroundZoom(this.config.defaultPadding,0)||1;this.context.camera.zoom=i,this.context.control.minZoom=o,this.context.control.maxZoom=o*25,this.basicZoom=i,this.context.control.addEventListener("change",this.onControlChange),this.context.setAzimuthalAngle(n,0),this.context.cameraBound.setEnable(!0)},this.config=ah(e),this.context=new Wo(t,this.config),this.debounceResize=(0,iT.debounce)(this.resize,5),this.registryEvent()}};var dB=d(W(),1);var oT=require("three"),Dt=class extends oT.EventDispatcher{dispose(){let t=this.bmap.plugins.findIndex(e=>e===this);t!==-1&&this.bmap.plugins.splice(t,1),this.bmap=null}constructor(t){super(),this.bmap=t,this.bmap.use(this)}};var Mh=class extends Dt{fetchEquipment(){return j(this,null,function*(){let{apiDomain:t,apiPath:{equipmentList:e},apiInfo:n}=this.bmap.config,i=""+t+e;yield fetch(i,n).then(o=>o.json()).then(o=>o.data).then(o=>{this.equipmentList=o,this.equipmentMap=new Map(o.map(s=>[s.equipment_id,s]))}),this.dispatchEvent({type:"change-equipment-list",data:this.equipmentList}),this.bmap.context.currentFloor&&this.changeGraphicToEquipment(this.bmap.context.currentFloor.graphicLayer.children)})}getGraphicEquipment(t){return t.userData.data.info.userData.equipment}changeGraphicToEquipment(t){t.filter(e=>{let n=this.getGraphicEquipment(e);return n&&this.equipmentMap.has(n)}).forEach(e=>{let n=this.equipmentMap.get(this.getGraphicEquipment(e)),i=this.bmap.createGraphicPoi(e,{icon:n==null?void 0:n.equipment_icon,built_in:!0,icon_size:[14,14]});i&&(i.userData.data=n,i.userData.type="equipment")})}dispose(){var t;this.bmap.removeEventListener(Mt.SWITCH_FLOOR_AFTER,this.onSwitchFloor),Array.from(((t=this.bmap.context.currentFloor)==null?void 0:t.poiLayer.pois)||[]).forEach(e=>{if(e.userData.type==="equipment"){var n;(n=this.bmap.context.currentFloor)==null||n.poiLayer.removePoi(e)}}),super.dispose()}constructor(t){super(t),this.equipmentList=[],this.equipmentMap=new Map,this.onSwitchFloor=e=>{let{data:{graphics:n}}=e;this.equipmentList.length&&this.changeGraphicToEquipment(n)},this.fetchEquipment(),this.bmap.addEventListener(Mt.SWITCH_FLOOR_AFTER,this.onSwitchFloor)}};var y8=d(vi(),1),M8=d(Xe(),1),P8=d(W(),1),j8=d(oh(),1);var OB=d(W(),1),KB=d(K(),1),ut=require("three");var PB=d(uc(),1),jB=d(Ri(),1),AB=d(Fi(),1),TB=d(Ni(),1),wB=d(Ui(),1),SB=d(Gi(),1),bB=d(Vi(),1),vB=d(Ji(),1),_B=d(Li(),1),WB=d(Bi(),1),xB=d(Qi(),1),IB=d(Hi(),1),YB=d(qi(),1),EB=d(to(),1),DB=d(eo(),1),XB=d(K(),1),ZB=d(Jc(),1),_=require("three"),_t=class extends _.BufferGeometry{constructor(){super(),this.isMeshLine=!0,this.type="MeshLine",this.positions=[],this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[],this.counters=[],this._points=[],this._geom=null,this.widthCallback=null,this.matrixWorld=new _.Matrix4,Object.defineProperties(this,{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(t){this.setPoints(t,this.widthCallback)}}})}};_t.prototype.setMatrixWorld=function(r){this.matrixWorld=r};_t.prototype.setGeometry=function(r,t){this._geometry=r,this.setPoints(r.getAttribute("position").array,t)};_t.prototype.setPoints=function(r,t){if(!(r instanceof Float32Array)&&!(r instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=r,this.widthCallback=t,this.positions=[],this.counters=[],r.length&&r[0]instanceof _.Vector3)for(var e=0;e<r.length;e++){var n=r[e],i=e/r.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(i),this.counters.push(i)}else for(var e=0;e<r.length;e+=3){var i=e/r.length;this.positions.push(r[e],r[e+1],r[e+2]),this.positions.push(r[e],r[e+1],r[e+2]),this.counters.push(i),this.counters.push(i)}this.process()};function I9(r,t){var e=new _.Matrix4,n=new _.Ray,i=new _.Sphere,o=new _.Vector3,s=this.geometry;if(s.boundingSphere||s.computeBoundingSphere(),i.copy(s.boundingSphere),i.applyMatrix4(this.matrixWorld),r.ray.intersectSphere(i,o)!==!1){e.copy(this.matrixWorld).invert(),n.copy(r.ray).applyMatrix4(e);var a=new _.Vector3,u=new _.Vector3,l=new _.Vector3,c=this instanceof _.LineSegments?2:1,h=s.index,p=s.attributes;if(h!==null)for(var m=h.array,g=p.position.array,M=p.width.array,P=0,A=m.length-1;P<A;P+=c){var S=m[P],x=m[P+1];a.fromArray(g,S*3),u.fromArray(g,x*3);var D=M[Math.floor(P/3)]!==void 0?M[Math.floor(P/3)]:1,E=r.params.Line.threshold+this.material.lineWidth*D/2,z=E*E,v=n.distanceSqToSegment(a,u,o,l);if(!(v>z)){o.applyMatrix4(this.matrixWorld);var L=r.ray.origin.distanceTo(o);L<r.near||L>r.far||(t.push({distance:L,point:l.clone().applyMatrix4(this.matrixWorld),index:P,face:null,faceIndex:null,object:this}),P=A)}}}}_t.prototype.raycast=I9;_t.prototype.compareV3=function(r,t){var e=r*6,n=t*6;return this.positions[e]===this.positions[n]&&this.positions[e+1]===this.positions[n+1]&&this.positions[e+2]===this.positions[n+2]};_t.prototype.copyV3=function(r){var t=r*6;return[this.positions[t],this.positions[t+1],this.positions[t+2]]};_t.prototype.getDistance=function(r){let t=0;for(let e=0;e<r;e++){let n=6*e,i=new _.Vector3(this.positions[n],this.positions[n+1],this.positions[n+2]),o=new _.Vector3(this.positions[n+6],this.positions[n+7],this.positions[n+8]),s=i.distanceTo(o);t+=s}return t};_t.prototype.process=function(){var r=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var t;let e=this.getDistance(r-1);var n;this.compareV3(0,r-1)?n=this.copyV3(r-2):n=this.copyV3(0),this.previous.push(n[0],n[1],n[2]),this.previous.push(n[0],n[1],n[2]);for(var i=0;i<r;i++){if(this.side.push(1),this.side.push(-1),this.widthCallback?t=this.widthCallback(i/(r-1)):t=1,this.width.push(t),this.width.push(t),i===0)this.uvs.push(0,0),this.uvs.push(0,1);else if(i===r-1)this.uvs.push(1,0),this.uvs.push(1,1);else{let s=this.getDistance(i)/e;this.uvs.push(s,0),this.uvs.push(s,1)}if(i<r-1){n=this.copyV3(i),this.previous.push(n[0],n[1],n[2]),this.previous.push(n[0],n[1],n[2]);var o=i*2;this.indices_array.push(o,o+1,o+2),this.indices_array.push(o+2,o+1,o+3)}i>0&&(n=this.copyV3(i),this.next.push(n[0],n[1],n[2]),this.next.push(n[0],n[1],n[2]))}this.compareV3(r-1,0)?n=this.copyV3(1):n=this.copyV3(r-1),this.next.push(n[0],n[1],n[2]),this.next.push(n[0],n[1],n[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new _.BufferAttribute(new Float32Array(this.positions),3),previous:new _.BufferAttribute(new Float32Array(this.previous),3),next:new _.BufferAttribute(new Float32Array(this.next),3),side:new _.BufferAttribute(new Float32Array(this.side),1),width:new _.BufferAttribute(new Float32Array(this.width),1),uv:new _.BufferAttribute(new Float32Array(this.uvs),2),index:new _.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new _.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function Ph(r,t,e,n,i){var o;if(r=r.subarray||r.slice?r:r.buffer,e=e.subarray||e.slice?e:e.buffer,r=t?r.subarray?r.subarray(t,i&&t+i):r.slice(t,i&&t+i):r,e.set)e.set(r,n);else for(o=0;o<r.length;o++)e[o+n]=r[o];return e}_t.prototype.advance=function(r){var t=this._attributes.position.array,e=this._attributes.previous.array,n=this._attributes.next.array,i=t.length;Ph(t,0,e,0,i),Ph(t,6,t,0,i-6),t[i-6]=r.x,t[i-5]=r.y,t[i-4]=r.z,t[i-3]=r.x,t[i-2]=r.y,t[i-1]=r.z,Ph(t,6,n,0,i-6),n[i-6]=r.x,n[i-5]=r.y,n[i-4]=r.z,n[i-3]=r.x,n[i-2]=r.y,n[i-1]=r.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0};_.ShaderChunk.meshline_vert=["",_.ShaderChunk.logdepthbuf_pars_vertex,_.ShaderChunk.fog_pars_vertex,"","attribute vec3 previous;","attribute vec3 next;","attribute float side;","attribute float width;","attribute float counters;","","uniform vec2 resolution;","uniform float lineWidth;","uniform vec3 color;","uniform float opacity;","uniform float sizeAttenuation;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","vec2 fix( vec4 i, float aspect ) {",""," vec2 res = i.xy / i.w;"," res.x *= aspect;"," vCounters = counters;"," return res;","","}","","void main() {",""," float aspect = resolution.x / resolution.y;",""," vColor = vec4( color, opacity );"," vUV = uv;",""," mat4 m = projectionMatrix * modelViewMatrix;"," vec4 finalPosition = m * vec4( position, 1.0 );"," vec4 prevPos = m * vec4( previous, 1.0 );"," vec4 nextPos = m * vec4( next, 1.0 );",""," vec2 currentP = fix( finalPosition, aspect );"," vec2 prevP = fix( prevPos, aspect );"," vec2 nextP = fix( nextPos, aspect );",""," float w = lineWidth * width;",""," vec2 dir;"," if( nextP == currentP ) dir = normalize( currentP - prevP );"," else if( prevP == currentP ) dir = normalize( nextP - currentP );"," else {"," vec2 dir1 = normalize( currentP - prevP );"," vec2 dir2 = normalize( nextP - currentP );"," dir = normalize( dir1 + dir2 );",""," vec2 perp = vec2( -dir1.y, dir1.x );"," vec2 miter = vec2( -dir.y, dir.x );"," //w = clamp( w / dot( miter, perp ), 0., 4. * lineWidth * width );",""," }",""," //vec2 normal = ( cross( vec3( dir, 0. ), vec3( 0., 0., 1. ) ) ).xy;"," vec4 normal = vec4( -dir.y, dir.x, 0., 1. );"," normal.xy *= .5 * w;"," normal *= projectionMatrix;"," if( sizeAttenuation == 0. ) {"," normal.xy *= finalPosition.w;"," normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;"," }",""," finalPosition.xy += normal.xy * side;",""," gl_Position = finalPosition;","",_.ShaderChunk.logdepthbuf_vertex,_.ShaderChunk.fog_vertex&&" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",_.ShaderChunk.fog_vertex,"}"].join(`
|
|
108
108
|
`);_.ShaderChunk.meshline_frag=["",_.ShaderChunk.fog_pars_fragment,_.ShaderChunk.logdepthbuf_pars_fragment,"","uniform sampler2D map;","uniform sampler2D alphaMap;","uniform float useMap;","uniform float useAlphaMap;","uniform float useDash;","uniform float dashArray;","uniform float dashOffset;","uniform float dashRatio;","uniform float visibility;","uniform float alphaTest;","uniform vec2 repeat;","uniform float thresholdRatio;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","void main() {","",_.ShaderChunk.logdepthbuf_fragment,""," vec4 c = vColor;"," if( useMap == 1. ) c *= texture2D( map, vUV * repeat );"," if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;"," if( c.a < alphaTest ) discard;"," if( useDash == 1. ){"," c.a *= ceil(mod(vCounters + dashOffset, dashArray) - (dashArray * dashRatio));"," }"," gl_FragColor = c;"," gl_FragColor.a *= step(vCounters, visibility);","",_.ShaderChunk.fog_fragment,"if (vUV.x <= thresholdRatio) {","gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);","}","}"].join(`
|
|
109
|
-
`);var ur=class extends _.ShaderMaterial{constructor(t){super({uniforms:Object.assign({},_.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new _.Color(16777215)},opacity:{value:1},resolution:{value:new _.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new _.Vector2(1,1)},thresholdRatio:{value:0},transparent:{value:!0},depthTest:{vale:!1},depthWrite:{value:!1}}),vertexShader:_.ShaderChunk.meshline_vert,fragmentShader:_.ShaderChunk.meshline_frag}),this.isMeshLineMaterial=!0,this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(e){this.uniforms.lineWidth.value=e}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(e){this.uniforms.map.value=e}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(e){this.uniforms.useMap.value=e}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(e){this.uniforms.alphaMap.value=e}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(e){this.uniforms.useAlphaMap.value=e}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(e){this.uniforms.color.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(e){this.uniforms.sizeAttenuation.value=e}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(e){this.uniforms.dashArray.value=e,this.useDash=e!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(e){this.uniforms.dashOffset.value=e}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(e){this.uniforms.dashRatio.value=e}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(e){this.uniforms.useDash.value=e}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(e){this.uniforms.visibility.value=e}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(e){this.uniforms.alphaTest.value=e}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(e){this.uniforms.repeat.value.copy(e)}},thresholdRatio:{enumerable:!0,get:function(){return this.uniforms.thresholdRatio.value},set:function(e){this.uniforms.thresholdRatio.value=e}}}),this.setValues(t)}};ur.prototype.copy=function(r){return _.ShaderMaterial.prototype.copy.call(this,r),this.lineWidth=r.lineWidth,this.map=r.map,this.useMap=r.useMap,this.alphaMap=r.alphaMap,this.useAlphaMap=r.useAlphaMap,this.color.copy(r.color),this.opacity=r.opacity,this.resolution.copy(r.resolution),this.sizeAttenuation=r.sizeAttenuation,this.dashArray.copy(r.dashArray),this.dashOffset.copy(r.dashOffset),this.dashRatio.copy(r.dashRatio),this.useDash=r.useDash,this.visibility=r.visibility,this.alphaTest=r.alphaTest,this.repeat.copy(r.repeat),this};var sT={texture_url:ya,lineWidth:10,color:16777215},za=class extends ut.Object3D{registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.bmap.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.bmap.context.removeEventListener("resize",this.onResize)}getRepeat(){let{points:t,navigation:{bmap:{context:{camera:e,clientSize:{width:n,height:i}}}}}=this,o=t.map(a=>{let[u,l]=a;return I(new ut.Vector3(u,l,0),e,n,i)}).map(a=>{let{x:u,y:l}=a;return[u,l]});return Ft(o)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new ut.Vector2(t,1)}loadTexture(t){return new Promise((e,n)=>{new ut.TextureLoader().load(t,e,void 0,n)})}transformPoints(t){let e=[];for(let n=0;n<t.length;n++)e.push(...t[n],0);return e}updatePoints(t){this.points=t,this.changeRepeat();let e=this.transformPoints(t);this.geometry&&this.geometry.setPoints(e)}movePath(t){this.material&&(this.material.thresholdRatio=t)}create(t){return j(this,null,function*(){let e=this.geometry=new _t;if(this.updatePoints(t),!this.texture){let o=this.texture=yield this.loadTexture(this.config.texture_url);o.wrapS=o.wrapT=ut.RepeatWrapping}let n=this.material=new ur({useMap:!0,color:new ut.Color(this.config.color),transparent:!0,resolution:new ut.Vector2(this.navigation.bmap.context.clientSize.width,this.navigation.bmap.context.clientSize.height),depthTest:!1,sizeAttenuation:!1,lineWidth:this.config.lineWidth*2,map:this.texture,blending:ut.NormalBlending,repeat:new ut.Vector2(this.getRepeat(),1)}),i=this.mesh=new ut.Mesh(e,n);return i.renderOrder=9,this.add(i),i})}dispose(){var t,e,n;this.unRegistryEvent(),this.clear(),(t=this.geometry)==null||t.dispose(),(e=this.material)==null||e.dispose(),(n=this.texture)==null||n.dispose(),this.navigation=null}constructor(t,e){super(),this.navigation=t,this.mesh=null,this.geometry=null,this.material=null,this.texture=null,this.config=sT,this.points=[],this.basicRepeat=1,this.prevCameraZoom=0,this.onControlChange=()=>{let n=this.navigation.bmap.context.camera.zoom;n!==this.prevCameraZoom&&(this.prevCameraZoom=n,this.changeRepeat())},this.onUpdate=()=>{this.texture},this.onResize=()=>{if(this.material){let{width:n,height:i}=this.navigation.bmap.context.clientSize;this.material.resolution.set(n,i)}},this.config=Object.assign({},sT,e),this.registryEvent(),this.prevCameraZoom=this.navigation.bmap.context.camera.zoom}};var Gr=require("@tweenjs/tween.js"),le=require("three");var kB=d(wa(),1),VB=d(W(),1),JB=d(K(),1),Ua=require("three");var aT=require("@tweenjs/tween.js"),uT=require("lodash");var Y9={offsetDistance:15,offsetToResetTime:3e3,directionEmitThreshold:5,simulationSpeed:1},Na=class extends Ua.EventDispatcher{get curRoutePath(){return this.paths[this.routeIndex]||null}get curRoutePathPoints(){var t;return((t=this.curRoutePath)==null?void 0:t.points)||[]}registryEvent(){this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.addEventListener("add-path",this.onAddPaths)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.removeEventListener("add-path",this.onAddPaths)}resetStatus(t){this.offset=!1,this.reset=!1,this.routeIndex=0,this.pointIndex=0,t.length&&(this.position=t[0].points[0])}emitNavigationStatus(){let t=this.getNavigationInfo();t&&this.dispatchEvent({type:"navigation-info",info:t})}adsorb(t,e){let{curRoutePathPoints:n,position:i,curRoutePath:o,paths:s,routeIndex:a}=this;if(!n.length)return null;let u=n;if(i){let g=Ze(n,i);u=u.slice(g+1),u.unshift(i)}let l=[{floor:o==null?void 0:o.floor,points:u},...s.slice(a+1)],{distance:c,closestPoint:h,index:p,i:m}=l.reduce((g,M,P)=>{if(M.floor!==t)return g;let{distance:A,closestPoint:S,index:x}=M.points.reduce((D,E,z,v)=>{if(!v[z+1])return T({},D,{distance:D.distance===1/0?N(E,e):D.distance});let{distance:L,closestPoint:Br}=U0(e,E,v[z+1]);return L<D.distance?{distance:L,closestPoint:Br,index:z}:D},{distance:1/0,closestPoint:M.points[0],index:0});return A<g.distance?{distance:A,closestPoint:S,index:P,i:x}:g},{distance:1/0,closestPoint:u[0],index:0,i:0});return{distance:c,closestPoint:h,routeIndex:p+a,pointIndex:p===0?m+this.pointIndex:m}}toPosition(t,e){let n=this.adsorb(t,e);if(!n)return;let{distance:i,closestPoint:o,routeIndex:s,pointIndex:a}=n;i>this.options.offsetDistance?(this.offset=!0,this.resetTimer||(this.resetTimer=this.timer.setTimeout(()=>{this.reset=!0,this.resetTimer=null},this.options.offsetToResetTime))):(this.offset=!1,this.reset=!1,this.resetTimer&&(this.timer.clearTimeout(this.resetTimer),this.resetTimer=null)),this.routeIndex=s,this.pointIndex=a,this.position=o,this.emitNavigationStatus()}startSimulation(){this.resetStatus(this.paths),this.emitNavigationStatus(),this.startCurRouteSimulation()}pause(){var t;this.tweenUtil.clear(),(t=this.throttleUpdatePosition)==null||t.cancel(),this.paused=!0}continue(){this.paused=!1,this.startCurRouteSimulation()}startCurRouteSimulation(){return j(this,null,function*(){let{curRoutePath:t}=this;if(!t)return;this.simulationTween&&this.tweenUtil.remove(this.simulationTween);let e=[];return new Promise(n=>{let i=[this.position,...this.curRoutePathPoints.slice(this.pointIndex+1)],o=this.getCurRouteRemainDistance(),s=o/this.options.simulationSpeed,a=this.throttleUpdatePosition=(0,uT.throttle)(l=>{let c=Vn(i,l.distance);c&&(e.push({floor:t.floor,pos:c}),this.toPosition(t.floor,c))},100),u=this.simulationTween=new aT.Tween({distance:0},this.tweenUtil.group).to({distance:o},s*1e3).onUpdate(a).onComplete(()=>{this.tweenUtil.remove(u),a.flush(),a.cancel(),this.routeIndex+1<this.paths.length?(this.routeIndex++,this.position=this.paths[this.routeIndex].points[0],this.pointIndex=0,setTimeout(()=>{n(this.startCurRouteSimulation())},3e3)):(n(!0),console.log(e,this.routeIndex,this.paths))}).start()})})}changeSimulationSpeed(t){this.options.simulationSpeed=t,this.paused||this.startCurRouteSimulation()}getCurRouteRemainDistance(){let{curRoutePathPoints:t,pointIndex:e,position:n}=this;if(!t.length)return 0;let i=[n,...t.slice(e+1)];return Ft(i)}getCurRouteToStartDistance(){let{curRoutePathPoints:t,pointIndex:e,position:n}=this;if(!t.length)return 0;let i=[...t.slice(0,e+1),n];return Ft(i)}getRemainDistance(){let t=this.getCurRouteRemainDistance();return{total:this.paths.slice(this.routeIndex+1).reduce((i,o)=>i+o.distance,0)+t,curRoute:t}}getNextDirDistance(){var t;if(!this.position)return null;let{pointIndex:e,curRoutePathPoints:n,position:i,curRoutePath:o}=this,s=e,a=Ke.FRONT,u=(o==null||(t=o.pointInfos[s])==null?void 0:t.crossName)||"",l=0,c=0,h=0;for(;a===Ke.FRONT&&s<=n.length;){let g=n[s],M=n[s+1],P=n[s+2];if(!g||!M)a=Ke.END;else if(l+=N(g,M),!P)a=Ke.END;else{a=xs(g,M,P),c=Ti(g,M,P),h=(new Ua.Vector2(P[0]-M[0],P[1]-M[1]).angle()*180/Math.PI-90+360)%360;var p;u=(p=o==null?void 0:o.pointInfos[s+1].crossName)!=null?p:"",s+=1}}if(n[s]&&(l=N(i,n[s])),a===Ke.END&&l<=this.options.directionEmitThreshold)return{dir:a,distance:l,crossName:u,angle:c,nextAngle:h};let m=this.getCurRouteToStartDistance();return e===0&&m<=5?{dir:Ke.START,distance:l,crossName:u,angle:c,nextAngle:h}:(l>=this.options.directionEmitThreshold&&(a=Ke.FRONT),{dir:a,distance:l,crossName:u,angle:c,nextAngle:h})}getNavigationInfo(){let{total:t,curRoute:e}=this.getRemainDistance(),n=this.getNextDirDistance();if(!n)return null;let{dir:i,distance:o,crossName:s,angle:a,nextAngle:u}=n;return e<=10&&(i=Ke.END),{distance:t,curRouteDistance:e,nextDirDistance:o,dir:i,angle:a,nextAngle:u,pos:this.position,routeIndex:this.routeIndex,crossName:s,offset:this.offset,reset:this.reset}}dispose(){this.timer.dispose(),this.unRegistryEvent(),this.tweenUtil.clear(),this.navigation=null}constructor(t,e,n){super(),this.navigation=t,this.offset=!1,this.reset=!1,this.position=[0,0],this.routeIndex=0,this.pointIndex=0,this.paths=[],this.timer=new rt,this.resetTimer=null,this.tweenUtil=new $e,this.paused=!1,this.onAddPaths=i=>{let{paths:o}=i;this.paths=o,this.resetStatus(o)},this.onUpdate=()=>{this.tweenUtil.update()},this.options=Object.assign({},Y9,e),this.roadData=n,this.registryEvent()}};var HB=d(Qs(),1),qB=d(Ri(),1),$B=d(Fi(),1),t8=d(Ni(),1),e8=d(Ui(),1),n8=d(Gi(),1),r8=d(Vi(),1),i8=d(Ji(),1),o8=d(Li(),1),s8=d(Bi(),1),a8=d(Qi(),1),u8=d(Hi(),1),l8=d(qi(),1),c8=d(to(),1),h8=d(eo(),1),p8=d(ac(),1),f8=d(W(),1),ue=require("three");var an=class r extends ot{addDebug(){r.canvas.style.cssText=`
|
|
109
|
+
`);var ur=class extends _.ShaderMaterial{constructor(t){super({uniforms:Object.assign({},_.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new _.Color(16777215)},opacity:{value:1},resolution:{value:new _.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new _.Vector2(1,1)},thresholdRatio:{value:0},transparent:{value:!0},depthTest:{vale:!1},depthWrite:{value:!1}}),vertexShader:_.ShaderChunk.meshline_vert,fragmentShader:_.ShaderChunk.meshline_frag}),this.isMeshLineMaterial=!0,this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(e){this.uniforms.lineWidth.value=e}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(e){this.uniforms.map.value=e}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(e){this.uniforms.useMap.value=e}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(e){this.uniforms.alphaMap.value=e}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(e){this.uniforms.useAlphaMap.value=e}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(e){this.uniforms.color.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(e){this.uniforms.sizeAttenuation.value=e}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(e){this.uniforms.dashArray.value=e,this.useDash=e!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(e){this.uniforms.dashOffset.value=e}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(e){this.uniforms.dashRatio.value=e}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(e){this.uniforms.useDash.value=e}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(e){this.uniforms.visibility.value=e}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(e){this.uniforms.alphaTest.value=e}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(e){this.uniforms.repeat.value.copy(e)}},thresholdRatio:{enumerable:!0,get:function(){return this.uniforms.thresholdRatio.value},set:function(e){this.uniforms.thresholdRatio.value=e}}}),this.setValues(t)}};ur.prototype.copy=function(r){return _.ShaderMaterial.prototype.copy.call(this,r),this.lineWidth=r.lineWidth,this.map=r.map,this.useMap=r.useMap,this.alphaMap=r.alphaMap,this.useAlphaMap=r.useAlphaMap,this.color.copy(r.color),this.opacity=r.opacity,this.resolution.copy(r.resolution),this.sizeAttenuation=r.sizeAttenuation,this.dashArray.copy(r.dashArray),this.dashOffset.copy(r.dashOffset),this.dashRatio.copy(r.dashRatio),this.useDash=r.useDash,this.visibility=r.visibility,this.alphaTest=r.alphaTest,this.repeat.copy(r.repeat),this};var sT={texture_url:ya,lineWidth:10,color:16777215},za=class extends ut.Object3D{registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.bmap.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.bmap.context.removeEventListener("resize",this.onResize)}getRepeat(){let{points:t,navigation:{bmap:{context:{camera:e,clientSize:{width:n,height:i}}}}}=this,o=t.map(a=>{let[u,l]=a;return I(new ut.Vector3(u,l,0),e,n,i)}).map(a=>{let{x:u,y:l}=a;return[u,l]});return Ft(o)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new ut.Vector2(t,1)}loadTexture(t){return new Promise((e,n)=>{new ut.TextureLoader().load(t,e,void 0,n)})}transformPoints(t){let e=[];for(let n=0;n<t.length;n++)e.push(...t[n],0);return e}updatePoints(t){this.points=t,this.changeRepeat();let e=this.transformPoints(t);this.geometry&&this.geometry.setPoints(e)}movePath(t){this.material&&(this.material.thresholdRatio=t)}create(t){return j(this,null,function*(){let e=this.geometry=new _t;if(this.updatePoints(t),!this.texture){let o=this.texture=yield this.loadTexture(this.config.texture_url);o.wrapS=o.wrapT=ut.RepeatWrapping}let n=this.material=new ur({useMap:!0,color:new ut.Color(this.config.color),transparent:!0,resolution:new ut.Vector2(this.navigation.bmap.context.clientSize.width,this.navigation.bmap.context.clientSize.height),depthTest:!1,sizeAttenuation:!1,lineWidth:this.config.lineWidth*2,map:this.texture,blending:ut.NormalBlending,repeat:new ut.Vector2(this.getRepeat(),1)}),i=this.mesh=new ut.Mesh(e,n);return i.renderOrder=100009,this.add(i),i})}dispose(){var t,e,n;this.unRegistryEvent(),this.clear(),(t=this.geometry)==null||t.dispose(),(e=this.material)==null||e.dispose(),(n=this.texture)==null||n.dispose(),this.navigation=null}constructor(t,e){super(),this.navigation=t,this.mesh=null,this.geometry=null,this.material=null,this.texture=null,this.config=sT,this.points=[],this.basicRepeat=1,this.prevCameraZoom=0,this.onControlChange=()=>{let n=this.navigation.bmap.context.camera.zoom;n!==this.prevCameraZoom&&(this.prevCameraZoom=n,this.changeRepeat())},this.onUpdate=()=>{this.texture},this.onResize=()=>{if(this.material){let{width:n,height:i}=this.navigation.bmap.context.clientSize;this.material.resolution.set(n,i)}},this.config=Object.assign({},sT,e),this.registryEvent(),this.prevCameraZoom=this.navigation.bmap.context.camera.zoom}};var Gr=require("@tweenjs/tween.js"),le=require("three");var kB=d(wa(),1),VB=d(W(),1),JB=d(K(),1),Ua=require("three");var aT=require("@tweenjs/tween.js"),uT=require("lodash");var Y9={offsetDistance:15,offsetToResetTime:3e3,directionEmitThreshold:5,simulationSpeed:1},Na=class extends Ua.EventDispatcher{get curRoutePath(){return this.paths[this.routeIndex]||null}get curRoutePathPoints(){var t;return((t=this.curRoutePath)==null?void 0:t.points)||[]}registryEvent(){this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.addEventListener("add-path",this.onAddPaths)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.removeEventListener("add-path",this.onAddPaths)}resetStatus(t){this.offset=!1,this.reset=!1,this.routeIndex=0,this.pointIndex=0,t.length&&(this.position=t[0].points[0])}emitNavigationStatus(){let t=this.getNavigationInfo();t&&this.dispatchEvent({type:"navigation-info",info:t})}adsorb(t,e){let{curRoutePathPoints:n,position:i,curRoutePath:o,paths:s,routeIndex:a}=this;if(!n.length)return null;let u=n;if(i){let g=Ze(n,i);u=u.slice(g+1),u.unshift(i)}let l=[{floor:o==null?void 0:o.floor,points:u},...s.slice(a+1)],{distance:c,closestPoint:h,index:p,i:m}=l.reduce((g,M,P)=>{if(M.floor!==t)return g;let{distance:A,closestPoint:S,index:x}=M.points.reduce((D,E,z,v)=>{if(!v[z+1])return T({},D,{distance:D.distance===1/0?N(E,e):D.distance});let{distance:L,closestPoint:Br}=U0(e,E,v[z+1]);return L<D.distance?{distance:L,closestPoint:Br,index:z}:D},{distance:1/0,closestPoint:M.points[0],index:0});return A<g.distance?{distance:A,closestPoint:S,index:P,i:x}:g},{distance:1/0,closestPoint:u[0],index:0,i:0});return{distance:c,closestPoint:h,routeIndex:p+a,pointIndex:p===0?m+this.pointIndex:m}}toPosition(t,e){let n=this.adsorb(t,e);if(!n)return;let{distance:i,closestPoint:o,routeIndex:s,pointIndex:a}=n;i>this.options.offsetDistance?(this.offset=!0,this.resetTimer||(this.resetTimer=this.timer.setTimeout(()=>{this.reset=!0,this.resetTimer=null},this.options.offsetToResetTime))):(this.offset=!1,this.reset=!1,this.resetTimer&&(this.timer.clearTimeout(this.resetTimer),this.resetTimer=null)),this.routeIndex=s,this.pointIndex=a,this.position=o,this.emitNavigationStatus()}startSimulation(){this.resetStatus(this.paths),this.emitNavigationStatus(),this.startCurRouteSimulation()}pause(){var t;this.tweenUtil.clear(),(t=this.throttleUpdatePosition)==null||t.cancel(),this.paused=!0}continue(){this.paused=!1,this.startCurRouteSimulation()}startCurRouteSimulation(){return j(this,null,function*(){let{curRoutePath:t}=this;if(!t)return;this.simulationTween&&this.tweenUtil.remove(this.simulationTween);let e=[];return new Promise(n=>{let i=[this.position,...this.curRoutePathPoints.slice(this.pointIndex+1)],o=this.getCurRouteRemainDistance(),s=o/this.options.simulationSpeed,a=this.throttleUpdatePosition=(0,uT.throttle)(l=>{let c=Vn(i,l.distance);c&&(e.push({floor:t.floor,pos:c}),this.toPosition(t.floor,c))},100),u=this.simulationTween=new aT.Tween({distance:0},this.tweenUtil.group).to({distance:o},s*1e3).onUpdate(a).onComplete(()=>{this.tweenUtil.remove(u),a.flush(),a.cancel(),this.routeIndex+1<this.paths.length?(this.routeIndex++,this.position=this.paths[this.routeIndex].points[0],this.pointIndex=0,setTimeout(()=>{n(this.startCurRouteSimulation())},3e3)):(n(!0),console.log(e,this.routeIndex,this.paths))}).start()})})}changeSimulationSpeed(t){this.options.simulationSpeed=t,this.paused||this.startCurRouteSimulation()}getCurRouteRemainDistance(){let{curRoutePathPoints:t,pointIndex:e,position:n}=this;if(!t.length)return 0;let i=[n,...t.slice(e+1)];return Ft(i)}getCurRouteToStartDistance(){let{curRoutePathPoints:t,pointIndex:e,position:n}=this;if(!t.length)return 0;let i=[...t.slice(0,e+1),n];return Ft(i)}getRemainDistance(){let t=this.getCurRouteRemainDistance();return{total:this.paths.slice(this.routeIndex+1).reduce((i,o)=>i+o.distance,0)+t,curRoute:t}}getNextDirDistance(){var t;if(!this.position)return null;let{pointIndex:e,curRoutePathPoints:n,position:i,curRoutePath:o}=this,s=e,a=Ke.FRONT,u=(o==null||(t=o.pointInfos[s])==null?void 0:t.crossName)||"",l=0,c=0,h=0;for(;a===Ke.FRONT&&s<=n.length;){let g=n[s],M=n[s+1],P=n[s+2];if(!g||!M)a=Ke.END;else if(l+=N(g,M),!P)a=Ke.END;else{a=xs(g,M,P),c=Ti(g,M,P),h=(new Ua.Vector2(P[0]-M[0],P[1]-M[1]).angle()*180/Math.PI-90+360)%360;var p;u=(p=o==null?void 0:o.pointInfos[s+1].crossName)!=null?p:"",s+=1}}if(n[s]&&(l=N(i,n[s])),a===Ke.END&&l<=this.options.directionEmitThreshold)return{dir:a,distance:l,crossName:u,angle:c,nextAngle:h};let m=this.getCurRouteToStartDistance();return e===0&&m<=5?{dir:Ke.START,distance:l,crossName:u,angle:c,nextAngle:h}:(l>=this.options.directionEmitThreshold&&(a=Ke.FRONT),{dir:a,distance:l,crossName:u,angle:c,nextAngle:h})}getNavigationInfo(){let{total:t,curRoute:e}=this.getRemainDistance(),n=this.getNextDirDistance();if(!n)return null;let{dir:i,distance:o,crossName:s,angle:a,nextAngle:u}=n;return e<=10&&(i=Ke.END),{distance:t,curRouteDistance:e,nextDirDistance:o,dir:i,angle:a,nextAngle:u,pos:this.position,routeIndex:this.routeIndex,crossName:s,offset:this.offset,reset:this.reset}}dispose(){this.timer.dispose(),this.unRegistryEvent(),this.tweenUtil.clear(),this.navigation=null}constructor(t,e,n){super(),this.navigation=t,this.offset=!1,this.reset=!1,this.position=[0,0],this.routeIndex=0,this.pointIndex=0,this.paths=[],this.timer=new rt,this.resetTimer=null,this.tweenUtil=new $e,this.paused=!1,this.onAddPaths=i=>{let{paths:o}=i;this.paths=o,this.resetStatus(o)},this.onUpdate=()=>{this.tweenUtil.update()},this.options=Object.assign({},Y9,e),this.roadData=n,this.registryEvent()}};var HB=d(Qs(),1),qB=d(Ri(),1),$B=d(Fi(),1),t8=d(Ni(),1),e8=d(Ui(),1),n8=d(Gi(),1),r8=d(Vi(),1),i8=d(Ji(),1),o8=d(Li(),1),s8=d(Bi(),1),a8=d(Qi(),1),u8=d(Hi(),1),l8=d(qi(),1),c8=d(to(),1),h8=d(eo(),1),p8=d(ac(),1),f8=d(W(),1),ue=require("three");var an=class r extends ot{addDebug(){r.canvas.style.cssText=`
|
|
110
110
|
position: fixed;
|
|
111
111
|
top: 0;
|
|
112
112
|
left: 0;
|
|
113
113
|
z-index: 9999;
|
|
114
|
-
`,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 ue.Sprite(new ue.SpriteMaterial({map:t,transparent:!0,alphaTest:.2,depthTest:this.options.depth_test,rotation:this.options.icon_rotate/180*Math.PI}));e.renderOrder=1e5+this.options.level,t.needsUpdate=!0,this.add(e),e.center.set(.5,.5),this.spriteIcon=e}}initSize(){this.spriteIcon&&this.spriteIcon.center.set(.5,.5)}draw(t){let{ctx:e}=r,{config:{size:n}}=this,i=n[0]/2,o=n[1]/2,s=4,a=1,u=s+a;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-u,-Math.PI/2,Math.PI*2-Math.PI/2,t<Math.PI),e.stroke(),e.strokeStyle="#0A7AFF",t<Math.PI){let l=-Math.PI/2,c=l-t;e.beginPath(),e.arc(i,o,o-u,l,c,!0)}else{let l=-Math.PI/2,c=l+Math.PI*2-t;e.beginPath(),e.arc(i,o,o-u,l,c,!1)}e.stroke(),e.clearRect(i-u*2,0,u*4,u*4),e.beginPath(),e.arc(i,u,s,0,Math.PI*2),e.fillStyle="#0A7AFF",e.fill(),e.setLineDash([10,0]),e.strokeStyle="#fff",e.lineWidth=a,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 ue.DataTexture(Uint8Array.from(t.data),e[0],e[1],ue.RGBAFormat);return n.format=ue.RGBAFormat,n.magFilter=ue.LinearFilter,n.minFilter=ue.LinearFilter,n.colorSpace="srgb",n.flipY=!0,n}dispose(){var t;super.dispose(),(t=this.spriteIcon)==null||t.material.dispose()}static dispose(){this.textureMap.forEach(t=>{t.dispose()}),this.textureMap.clear(),this.ctx=null,this.canvas=null}constructor(t,e){super(t.context,{icon_size:e.size,collision_enable:!1,level:2}),this.bmap=t,this.config=e,r.canvas.width=e.size[0],r.canvas.height=e.size[1]}};an.canvas=document.createElement("canvas");an.ctx=an.canvas.getContext("2d",{willReadFrequently:!0});an.textureMap=new Map;var E9={path:{},cheapMaximumDistance:20,needStartPoi:!1,startPoi:{},positionNavigation:{},offsetY:150,directionEmitThreshold:5,disablePathAnimation:!1,speed:1,roadData:[],runAnimationMaxTime:1},jh=class extends Dt{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(Mt.SWITCH_FLOOR_AFTER,this.onSwitchFloor),this.positionNavigation.addEventListener("navigation-info",this.onNavigationInfo),this.bmap.context.addEventListener("control-change",this.onControlChangeForStartPoi)}showStartRotateHelperPoi(){var t;if(this.needStartRotateHelperPoi=!0,!this.startPoi||this.startRotateHelperPoi)return;let e=this.startPoi.options.icon_size;this.startRotateHelperPoi=new an(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(s=>s.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(Mt.SWITCH_FLOOR_AFTER,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 s=()=>{this.bmap.removeEventListener("center-change",s),this.renderPath(this.translatePoints(o.points))};this.bmap.addEventListener("center-change",s)}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 za(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.detachStartPoi){var o;(o=this.bmap.context.currentFloor)==null||o.poiLayer2.removePoi(this.detachStartPoi),this.detachStartPoi=null}if(this.detachLine&&(this.bmap.context.scene.remove(this.detachLine),this.detachLine=null),this.options.detachStartPoi){var s;this.detachStartPoi=new ot(this.bmap.context,T({},this.options.detachStartPoi,{id:"navigation_detach_start_poi",position:{x:e[0][0],y:e[0][1],z:.51},collision_enable:!1}))||null,(s=this.bmap.context.currentFloor)==null||s.poiLayer2.pushPoi(this.detachStartPoi),this.detachLine=new bo(this.bmap.context,new le.Vector3(e[0][0],e[0][1],.51),new le.Vector3(e[0][0],e[0][1],.51)),this.bmap.context.scene.add(this.detachLine)}if(this.options.needStartPoi){var a;this.startPoi=new ot(this.bmap.context,T({},this.options.startPoi,{id:"navigation_start_poi",position:{x:e[0][0],y:e[0][1],z:.51},collision_enable:!1}))||null,(a=this.bmap.context.currentFloor)==null||a.poiLayer2.pushPoi(this.startPoi),this.needStartRotateHelperPoi&&this.showStartRotateHelperPoi(),console.log(this.startRotateHelperPoi)}this.dispatchEvent({type:"render-path",path:this.path})}catmullRomCurve3(t){return _i(t,!1,!0,.1,170,2.5)}getPathDirection(){if(!this.curFloorPath||!this.currentPathPosition||this.curFloorPathPoints.length<2)return null;let t=Ze(this.curFloorPathPoints,this.currentPathPosition),e=this.curFloorPathPoints[t],n=this.curFloorPathPoints[t+1],i=new le.Vector3(n[0]-e[0],n[1]-e[1],0).normalize(),o=new le.Vector3(0,1,0).normalize(),s=i.angleTo(o),a=new le.Vector3().crossVectors(o,i);return(Object.is(a.y,0)?-1:1)*s}getPathDirection2(){if(!this.curFloorPath||!this.toPointPosition||this.curFloorPathPoints.length<2)return null;let t=Ze(this.curFloorPathPoints,this.toPointPosition),e=this.curFloorPathPoints[t],n=this.curFloorPathPoints[t+1];return(new le.Vector2(n[0]-e[0],n[1]-e[1]).normalize().angle()*180/Math.PI-90+360)%360}changeCameraToPathUp(t){return j(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,s=t/Math.PI*6*i;return zt(new Promise(a=>{let u={azimuthal:o.getAzimuthalAngle()},l={azimuthal:e},c=o.getPolarAngle(),{maxPolarAngle:h,minPolarAngle:p}=o;o.maxPolarAngle=c,o.minPolarAngle=c;let m=new Gr.Tween(u,this.tweenUtil.group).to(l,s).easing(Gr.Easing.Quadratic.InOut).onUpdate(()=>j(this,null,function*(){this.startPoi&&o.target.copy(this.startPoi.position),o.setAzimuthalAngle(u.azimuthal,!0),o.setTargetByOffset(this.options.offsetY)})).onComplete(()=>{o.enabled=!0,this.tweenUtil.remove(m),o.maxPolarAngle=h,o.minPolarAngle=p,a(!0)}).onStart(()=>{o.enabled=!1}).start()}),s+500).finally(()=>{this.bmap.context.control.enabled=!0})})}initNavigationCamera(t){return j(this,null,function*(){t===void 0&&(t=1e3);var e;let i=(e=this.taskQueue.getTasks().find(s=>s.meta.type==="initNavigationCamera"))==null?void 0:e.tid,o={run:()=>zt(j(this,null,function*(){yield this.initCameraZoom(t/2),yield this.changeCameraToPathUp(t/4),yield this.translateCameraToStartPoi(t/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 j(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,s=Math.round(e/2),a=Math.round(n/2),u=o.target.clone(),l=I(this.startPoi.position,i,e,n),c=l.x-s,h=a-l.y+this.options.offsetY;if(!(Math.abs(c)<=1&&Math.abs(h)<=1)){if(Math.abs(c)>=1){let p=new le.Vector3;p.setFromMatrixColumn(i.matrix,0),p.normalize(),p.multiplyScalar(c/i.zoom),u.add(new le.Vector3(p.x,p.y,0))}if(Math.abs(h)>=1){let p=new le.Vector3;p.setFromMatrixColumn(i.matrix,1),p.normalize(),p.multiplyScalar(h/i.zoom),u.add(new le.Vector3(p.x,p.y,0))}return zt(new Promise(p=>{let m=o.target.clone();console.log(m,u,t);let g=new Gr.Tween(m,this.tweenUtil.group).to(u,t).onUpdate(()=>{this.bmap.context.control.setCameraPositionByTarget(m,0)}).onComplete(()=>{this.bmap.context.control.setCameraPositionByTarget(u,0),this.tweenUtil.remove(g),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 j(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:s}=i.box,u=Math.min(e/(o.x-s.x),n/(o.y-s.y))*(o.x-s.x)/45;return this.bmap.context.setZoom(u,this.startPoi.position,t).finally(()=>{this.bmap.context.control.enabled=!0})})}toPosition(t,e){if(this.paths[this.curPathIndex].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 j(this,null,function*(){let{currentPathPosition:n,curFloorPath:i,curFloorPathPoints:o}=this;if(!i||!n)return null;let s=this.movedDistance,a=G0(o,t);if(s===-1||a===-1||a<=s)return null;let u=a-s;if(!u)return;let l=Math.min(u/e,this.options.runAnimationMaxTime);return this.pathTween&&this.clearTween(),zt(new Promise(c=>{let h=this.pathTween=new Gr.Tween({distance:0},this.tweenUtil.group).to({distance:u},l*1e3).onUpdate(p=>j(this,null,function*(){this.moveDistance(p.distance+s,h)})).onComplete(()=>{this.tweenUtil.remove(h),c(!0)}).start()}),l*1e3+500).finally(()=>{this.bmap.context.control.enabled=!0})})}moveDistance(t,e){return j(this,null,function*(){var n;this.movedDistance=t,(n=this.path)==null||n.movePath(this.movedDistance/this.curFloorPathLength);let i=Vn(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||(e==null||e.pause(),yield this.changeCameraToPathUp(500/this.options.speed),e==null||e.resume())})}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.startRotateHelperPoi&&this.startRotateHelperPoi.setAngle(i)}dispose(){var t,e,n,i;this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose()),this.tweenUtil.dispose(),this.unRegistryEvent(),(t=this.startPoi)==null||t.dispose(),(e=this.detachStartPoi)==null||e.dispose(),(n=this.detachLine)==null||n.dispose(),(i=this.startRotateHelperPoi)==null||i.dispose(),an.dispose(),this.positionNavigation.dispose(),this.startRotateHelperPoi=null,this.detachStartPoi=null,this.detachLine=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=0,this.startRotateHelperPoi=null,this.needStartRotateHelperPoi=!1,this.movedDistance=0,this.pathStart=[0,0],this.tweenUtil=new $e,this.taskQueue=new Ln,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 s=this.paths[this.curPathIndex];this.setCurFloorPath(s!=null?s:null),s?this.renderPath(this.translatePoints(s.points)):this.clearPath()}else this.clearPath()},this.onControlChangeForStartPoi=()=>{this.startPoi&&this.setStartPoiRotate(this.startPoiRotate)},!n&&typeof e=="object"&&(n=e),this.options=Object.assign({},E9,n),this.positionNavigation=new Na(this,T({simulationSpeed:this.options.speed},this.options.positionNavigation),this.options.roadData),this.registryEvent()}};var Y8=d(W(),1);var kr=require("three"),Ah=class extends Dt{show(t){let e=0;t.forEach(o=>{o.poiLayer2.pois.forEach(s=>{let a=new kr.Vector3().setFromMatrixPosition(s.matrixWorld).z;s.position.setZ(a+e),s.options.depth_test=!0,this.poiLayer.pushPoi(s)}),o.poiLayer2.pois.length=0,o.poiLayer2.dispose(),o.position.z=e,e+=o.userData.height});let{scene:n,currentFloor:i}=this.bmap.context;i&&(n.remove(i),i.dispose()),this.group.add(this.poiLayer,...t),n.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 kr.Group,this.showStatus=!1,this.group.name="mul-floor-group",this.poiLayer=new nr(t.context),this.poiLayer.changeParkingSpaceVisibleByZoom=()=>{let e=new kr.Box3().setFromObject(this.group),{clientSize:{width:n,height:i}}=this.bmap.context,{max:o,min:s}=e,u=Math.min(n/(o.x-s.x),i/(o.y-s.y))*(o.x-s.x)/45;this.poiLayer.pois.filter(l=>l.userData.type==="parkingSpace").map(l=>{let c=this.bmap.context.camera.zoom>=u;l.visible=c,c||l.parentSetVisible(c)})}}};var lT=require("three");function Th(){let r=new Blob([`var xF=Object.create;var $x=Object.defineProperty;var EF=Object.getOwnPropertyDescriptor;var wF=Object.getOwnPropertyNames;var SF=Object.getPrototypeOf,MF=Object.prototype.hasOwnProperty;var at=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var bF=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of wF(t))!MF.call(n,s)&&s!==e&&$x(n,s,{get:()=>t[s],enumerable:!(o=EF(t,s))||o.enumerable});return n};var Ze=(n,t,e)=>(e=n!=null?xF(SF(n)):{},bF(t||!n||!n.__esModule?$x(e,"default",{value:n,enumerable:!0}):e,n));var np=(n,t,e)=>new Promise((o,s)=>{var c=g=>{try{p(e.next(g))}catch(m){s(m)}},h=g=>{try{p(e.throw(g))}catch(m){s(m)}},p=g=>g.done?o(g.value):Promise.resolve(g.value).then(c,h);p((e=e.apply(n,t)).next())});var oo=at((Im,Zx)=>{"use strict";var If=function(n){return n&&n.Math===Math&&n};Zx.exports=If(typeof globalThis=="object"&&globalThis)||If(typeof window=="object"&&window)||If(typeof self=="object"&&self)||If(typeof global=="object"&&global)||If(typeof Im=="object"&&Im)||function(){return this}()||Function("return this")()});var Kx=at((bJ,Jx)=>{"use strict";Jx.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=at((AJ,jx)=>{"use strict";var Rm=typeof document=="object"&&document.all;jx.exports=typeof Rm=="undefined"&&Rm!==void 0?function(n){return typeof n=="function"||n===Rm}:function(n){return typeof n=="function"}});var Ea=at((TJ,Qx)=>{"use strict";var AF=Di();Qx.exports=function(n){return typeof n=="object"?n!==null:AF(n)}});var rp=at((CJ,eE)=>{"use strict";var TF=oo(),tE=Ea(),Lm=TF.document,CF=tE(Lm)&&tE(Lm.createElement);eE.exports=function(n){return CF?Lm.createElement(n):{}}});var iE=at((PJ,rE)=>{"use strict";var PF=rp(),Nm=PF("span").classList,nE=Nm&&Nm.constructor&&Nm.constructor.prototype;rE.exports=nE===Object.prototype?void 0:nE});var gi=at((IJ,oE)=>{"use strict";oE.exports=function(n){try{return!!n()}catch(t){return!0}}});var Rf=at((RJ,sE)=>{"use strict";var IF=gi();sE.exports=!IF(function(){var n=function(){}.bind();return typeof n!="function"||n.hasOwnProperty("prototype")})});var mi=at((LJ,lE)=>{"use strict";var aE=Rf(),uE=Function.prototype,Om=uE.call,RF=aE&&uE.bind.bind(Om,Om);lE.exports=aE?RF:function(n){return function(){return Om.apply(n,arguments)}}});var ec=at((NJ,fE)=>{"use strict";var cE=mi(),LF=cE({}.toString),NF=cE("".slice);fE.exports=function(n){return NF(LF(n),8,-1)}});var pE=at((OJ,hE)=>{"use strict";var OF=mi(),DF=gi(),FF=ec(),Dm=Object,UF=OF("".split);hE.exports=DF(function(){return!Dm("z").propertyIsEnumerable(0)})?function(n){return FF(n)==="String"?UF(n,""):Dm(n)}:Dm});var ip=at((DJ,dE)=>{"use strict";dE.exports=function(n){return n==null}});var nc=at((FJ,gE)=>{"use strict";var BF=ip(),zF=TypeError;gE.exports=function(n){if(BF(n))throw new zF("Can't call method on "+n);return n}});var rc=at((UJ,mE)=>{"use strict";var GF=pE(),kF=nc();mE.exports=function(n){return GF(kF(n))}});var Lf=at((BJ,yE)=>{"use strict";yE.exports=!1});var op=at((zJ,_E)=>{"use strict";var vE=oo(),qF=Object.defineProperty;_E.exports=function(n,t){try{qF(vE,n,{value:t,configurable:!0,writable:!0})}catch(e){vE[n]=t}return t}});var sp=at((GJ,wE)=>{"use strict";var HF=Lf(),VF=oo(),WF=op(),xE="__core-js_shared__",EE=wE.exports=VF[xE]||WF(xE,{});(EE.versions||(EE.versions=[])).push({version:"3.39.0",mode:HF?"pure":"global",copyright:"\\xA9 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var ap=at((kJ,ME)=>{"use strict";var SE=sp();ME.exports=function(n,t){return SE[n]||(SE[n]=t||{})}});var ic=at((qJ,bE)=>{"use strict";var XF=nc(),YF=Object;bE.exports=function(n){return YF(XF(n))}});var wa=at((HJ,AE)=>{"use strict";var $F=mi(),ZF=ic(),JF=$F({}.hasOwnProperty);AE.exports=Object.hasOwn||function(t,e){return JF(ZF(t),e)}});var Fm=at((VJ,TE)=>{"use strict";var KF=mi(),jF=0,QF=Math.random(),tU=KF(1 .toString);TE.exports=function(n){return"Symbol("+(n===void 0?"":n)+")_"+tU(++jF+QF,36)}});var RE=at((WJ,IE)=>{"use strict";var eU=oo(),CE=eU.navigator,PE=CE&&CE.userAgent;IE.exports=PE?String(PE):""});var BE=at((XJ,UE)=>{"use strict";var FE=oo(),Um=RE(),LE=FE.process,NE=FE.Deno,OE=LE&&LE.versions||NE&&NE.version,DE=OE&&OE.v8,Xs,up;DE&&(Xs=DE.split("."),up=Xs[0]>0&&Xs[0]<4?1:+(Xs[0]+Xs[1]));!up&&Um&&(Xs=Um.match(/Edge\\/(\\d+)/),(!Xs||Xs[1]>=74)&&(Xs=Um.match(/Chrome\\/(\\d+)/),Xs&&(up=+Xs[1])));UE.exports=up});var Bm=at((YJ,GE)=>{"use strict";var zE=BE(),nU=gi(),rU=oo(),iU=rU.String;GE.exports=!!Object.getOwnPropertySymbols&&!nU(function(){var n=Symbol("symbol detection");return!iU(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&zE&&zE<41})});var zm=at(($J,kE)=>{"use strict";var oU=Bm();kE.exports=oU&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Is=at((ZJ,HE)=>{"use strict";var sU=oo(),aU=ap(),qE=wa(),uU=Fm(),lU=Bm(),cU=zm(),oc=sU.Symbol,Gm=aU("wks"),fU=cU?oc.for||oc:oc&&oc.withoutSetter||uU;HE.exports=function(n){return qE(Gm,n)||(Gm[n]=lU&&qE(oc,n)?oc[n]:fU("Symbol."+n)),Gm[n]}});var Sa=at((JJ,VE)=>{"use strict";var hU=Ea(),pU=String,dU=TypeError;VE.exports=function(n){if(hU(n))return n;throw new dU(pU(n)+" is not an object")}});var Ys=at((KJ,WE)=>{"use strict";var gU=gi();WE.exports=!gU(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var km=at((jJ,XE)=>{"use strict";var mU=Ys(),yU=gi();XE.exports=mU&&yU(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var qm=at((QJ,YE)=>{"use strict";var vU=Ys(),_U=gi(),xU=rp();YE.exports=!vU&&!_U(function(){return Object.defineProperty(xU("div"),"a",{get:function(){return 7}}).a!==7})});var Rs=at((tK,$E)=>{"use strict";var EU=Rf(),lp=Function.prototype.call;$E.exports=EU?lp.bind(lp):function(){return lp.apply(lp,arguments)}});var sc=at((eK,ZE)=>{"use strict";var Hm=oo(),wU=Di(),SU=function(n){return wU(n)?n:void 0};ZE.exports=function(n,t){return arguments.length<2?SU(Hm[n]):Hm[n]&&Hm[n][t]}});var KE=at((nK,JE)=>{"use strict";var MU=mi();JE.exports=MU({}.isPrototypeOf)});var Vm=at((rK,jE)=>{"use strict";var bU=sc(),AU=Di(),TU=KE(),CU=zm(),PU=Object;jE.exports=CU?function(n){return typeof n=="symbol"}:function(n){var t=bU("Symbol");return AU(t)&&TU(t.prototype,PU(n))}});var tw=at((iK,QE)=>{"use strict";var IU=String;QE.exports=function(n){try{return IU(n)}catch(t){return"Object"}}});var Nf=at((oK,ew)=>{"use strict";var RU=Di(),LU=tw(),NU=TypeError;ew.exports=function(n){if(RU(n))return n;throw new NU(LU(n)+" is not a function")}});var cp=at((sK,nw)=>{"use strict";var OU=Nf(),DU=ip();nw.exports=function(n,t){var e=n[t];return DU(e)?void 0:OU(e)}});var iw=at((aK,rw)=>{"use strict";var Wm=Rs(),Xm=Di(),Ym=Ea(),FU=TypeError;rw.exports=function(n,t){var e,o;if(t==="string"&&Xm(e=n.toString)&&!Ym(o=Wm(e,n))||Xm(e=n.valueOf)&&!Ym(o=Wm(e,n))||t!=="string"&&Xm(e=n.toString)&&!Ym(o=Wm(e,n)))return o;throw new FU("Can't convert object to primitive value")}});var uw=at((uK,aw)=>{"use strict";var UU=Rs(),ow=Ea(),sw=Vm(),BU=cp(),zU=iw(),GU=Is(),kU=TypeError,qU=GU("toPrimitive");aw.exports=function(n,t){if(!ow(n)||sw(n))return n;var e=BU(n,qU),o;if(e){if(t===void 0&&(t="default"),o=UU(e,n,t),!ow(o)||sw(o))return o;throw new kU("Can't convert object to primitive value")}return t===void 0&&(t="number"),zU(n,t)}});var $m=at((lK,lw)=>{"use strict";var HU=uw(),VU=Vm();lw.exports=function(n){var t=HU(n,"string");return VU(t)?t:t+""}});var Pu=at(fw=>{"use strict";var WU=Ys(),XU=qm(),YU=km(),fp=Sa(),cw=$m(),$U=TypeError,Zm=Object.defineProperty,ZU=Object.getOwnPropertyDescriptor,Jm="enumerable",Km="configurable",jm="writable";fw.f=WU?YU?function(t,e,o){if(fp(t),e=cw(e),fp(o),typeof t=="function"&&e==="prototype"&&"value"in o&&jm in o&&!o[jm]){var s=ZU(t,e);s&&s[jm]&&(t[e]=o.value,o={configurable:Km in o?o[Km]:s[Km],enumerable:Jm in o?o[Jm]:s[Jm],writable:!1})}return Zm(t,e,o)}:Zm:function(t,e,o){if(fp(t),e=cw(e),fp(o),XU)try{return Zm(t,e,o)}catch(s){}if("get"in o||"set"in o)throw new $U("Accessors not supported");return"value"in o&&(t[e]=o.value),t}});var pw=at((fK,hw)=>{"use strict";var JU=Math.ceil,KU=Math.floor;hw.exports=Math.trunc||function(t){var e=+t;return(e>0?KU:JU)(e)}});var ml=at((hK,dw)=>{"use strict";var jU=pw();dw.exports=function(n){var t=+n;return t!==t||t===0?0:jU(t)}});var mw=at((pK,gw)=>{"use strict";var QU=ml(),tB=Math.max,eB=Math.min;gw.exports=function(n,t){var e=QU(n);return e<0?tB(e+t,0):eB(e,t)}});var Qm=at((dK,yw)=>{"use strict";var nB=ml(),rB=Math.min;yw.exports=function(n){var t=nB(n);return t>0?rB(t,9007199254740991):0}});var Of=at((gK,vw)=>{"use strict";var iB=Qm();vw.exports=function(n){return iB(n.length)}});var Ew=at((mK,xw)=>{"use strict";var oB=rc(),sB=mw(),aB=Of(),_w=function(n){return function(t,e,o){var s=oB(t),c=aB(s);if(c===0)return!n&&-1;var h=sB(o,c),p;if(n&&e!==e){for(;c>h;)if(p=s[h++],p!==p)return!0}else for(;c>h;h++)if((n||h in s)&&s[h]===e)return n||h||0;return!n&&-1}};xw.exports={includes:_w(!0),indexOf:_w(!1)}});var hp=at((yK,ww)=>{"use strict";ww.exports={}});var e0=at((vK,Mw)=>{"use strict";var uB=mi(),t0=wa(),lB=rc(),cB=Ew().indexOf,fB=hp(),Sw=uB([].push);Mw.exports=function(n,t){var e=lB(n),o=0,s=[],c;for(c in e)!t0(fB,c)&&t0(e,c)&&Sw(s,c);for(;t.length>o;)t0(e,c=t[o++])&&(~cB(s,c)||Sw(s,c));return s}});var pp=at((_K,bw)=>{"use strict";bw.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Tw=at((xK,Aw)=>{"use strict";var hB=e0(),pB=pp();Aw.exports=Object.keys||function(t){return hB(t,pB)}});var Pw=at(Cw=>{"use strict";var dB=Ys(),gB=km(),mB=Pu(),yB=Sa(),vB=rc(),_B=Tw();Cw.f=dB&&!gB?Object.defineProperties:function(t,e){yB(t);for(var o=vB(e),s=_B(e),c=s.length,h=0,p;c>h;)mB.f(t,p=s[h++],o[p]);return t}});var Rw=at((wK,Iw)=>{"use strict";var xB=sc();Iw.exports=xB("document","documentElement")});var dp=at((SK,Nw)=>{"use strict";var EB=ap(),wB=Fm(),Lw=EB("keys");Nw.exports=function(n){return Lw[n]||(Lw[n]=wB(n))}});var Df=at((MK,Gw)=>{"use strict";var SB=Sa(),MB=Pw(),Ow=pp(),bB=hp(),AB=Rw(),TB=rp(),CB=dp(),Dw=">",Fw="<",r0="prototype",i0="script",Bw=CB("IE_PROTO"),n0=function(){},zw=function(n){return Fw+i0+Dw+n+Fw+"/"+i0+Dw},Uw=function(n){n.write(zw("")),n.close();var t=n.parentWindow.Object;return n=null,t},PB=function(){var n=TB("iframe"),t="java"+i0+":",e;return n.style.display="none",AB.appendChild(n),n.src=String(t),e=n.contentWindow.document,e.open(),e.write(zw("document.F=Object")),e.close(),e.F},gp,mp=function(){try{gp=new ActiveXObject("htmlfile")}catch(t){}mp=typeof document!="undefined"?document.domain&&gp?Uw(gp):PB():Uw(gp);for(var n=Ow.length;n--;)delete mp[r0][Ow[n]];return mp()};bB[Bw]=!0;Gw.exports=Object.create||function(t,e){var o;return t!==null?(n0[r0]=SB(t),o=new n0,n0[r0]=null,o[Bw]=t):o=mp(),e===void 0?o:MB.f(o,e)}});var a0=at((bK,kw)=>{"use strict";var IB=Is(),RB=Df(),LB=Pu().f,o0=IB("unscopables"),s0=Array.prototype;s0[o0]===void 0&&LB(s0,o0,{configurable:!0,value:RB(null)});kw.exports=function(n){s0[o0][n]=!0}});var yp=at((AK,qw)=>{"use strict";qw.exports={}});var Ww=at((TK,Vw)=>{"use strict";var NB=oo(),OB=Di(),Hw=NB.WeakMap;Vw.exports=OB(Hw)&&/native code/.test(String(Hw))});var vp=at((CK,Xw)=>{"use strict";Xw.exports=function(n,t){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:t}}});var ac=at((PK,Yw)=>{"use strict";var DB=Ys(),FB=Pu(),UB=vp();Yw.exports=DB?function(n,t,e){return FB.f(n,t,UB(1,e))}:function(n,t,e){return n[t]=e,n}});var Ep=at((IK,Jw)=>{"use strict";var BB=Ww(),Zw=oo(),zB=Ea(),GB=ac(),u0=wa(),l0=sp(),kB=dp(),qB=hp(),$w="Object already initialized",c0=Zw.TypeError,HB=Zw.WeakMap,_p,Ff,xp,VB=function(n){return xp(n)?Ff(n):_p(n,{})},WB=function(n){return function(t){var e;if(!zB(t)||(e=Ff(t)).type!==n)throw new c0("Incompatible receiver, "+n+" required");return e}};BB||l0.state?($s=l0.state||(l0.state=new HB),$s.get=$s.get,$s.has=$s.has,$s.set=$s.set,_p=function(n,t){if($s.has(n))throw new c0($w);return t.facade=n,$s.set(n,t),t},Ff=function(n){return $s.get(n)||{}},xp=function(n){return $s.has(n)}):(yl=kB("state"),qB[yl]=!0,_p=function(n,t){if(u0(n,yl))throw new c0($w);return t.facade=n,GB(n,yl,t),t},Ff=function(n){return u0(n,yl)?n[yl]:{}},xp=function(n){return u0(n,yl)});var $s,yl;Jw.exports={set:_p,get:Ff,has:xp,enforce:VB,getterFor:WB}});var tS=at(Qw=>{"use strict";var Kw={}.propertyIsEnumerable,jw=Object.getOwnPropertyDescriptor,XB=jw&&!Kw.call({1:2},1);Qw.f=XB?function(t){var e=jw(this,t);return!!e&&e.enumerable}:Kw});var f0=at(nS=>{"use strict";var YB=Ys(),$B=Rs(),ZB=tS(),JB=vp(),KB=rc(),jB=$m(),QB=wa(),tz=qm(),eS=Object.getOwnPropertyDescriptor;nS.f=YB?eS:function(t,e){if(t=KB(t),e=jB(e),tz)try{return eS(t,e)}catch(o){}if(QB(t,e))return JB(!$B(ZB.f,t,e),t[e])}});var d0=at((NK,iS)=>{"use strict";var h0=Ys(),ez=wa(),rS=Function.prototype,nz=h0&&Object.getOwnPropertyDescriptor,p0=ez(rS,"name"),rz=p0&&function(){}.name==="something",iz=p0&&(!h0||h0&&nz(rS,"name").configurable);iS.exports={EXISTS:p0,PROPER:rz,CONFIGURABLE:iz}});var m0=at((OK,oS)=>{"use strict";var oz=mi(),sz=Di(),g0=sp(),az=oz(Function.toString);sz(g0.inspectSource)||(g0.inspectSource=function(n){return az(n)});oS.exports=g0.inspectSource});var lS=at((DK,uS)=>{"use strict";var v0=mi(),uz=gi(),lz=Di(),wp=wa(),y0=Ys(),cz=d0().CONFIGURABLE,fz=m0(),aS=Ep(),hz=aS.enforce,pz=aS.get,sS=String,Sp=Object.defineProperty,dz=v0("".slice),gz=v0("".replace),mz=v0([].join),yz=y0&&!uz(function(){return Sp(function(){},"length",{value:8}).length!==8}),vz=String(String).split("String"),_z=uS.exports=function(n,t,e){dz(sS(t),0,7)==="Symbol("&&(t="["+gz(sS(t),/^Symbol\\(([^)]*)\\).*$/,"$1")+"]"),e&&e.getter&&(t="get "+t),e&&e.setter&&(t="set "+t),(!wp(n,"name")||cz&&n.name!==t)&&(y0?Sp(n,"name",{value:t,configurable:!0}):n.name=t),yz&&e&&wp(e,"arity")&&n.length!==e.arity&&Sp(n,"length",{value:e.arity});try{e&&wp(e,"constructor")&&e.constructor?y0&&Sp(n,"prototype",{writable:!1}):n.prototype&&(n.prototype=void 0)}catch(s){}var o=hz(n);return wp(o,"source")||(o.source=mz(vz,typeof t=="string"?t:"")),n};Function.prototype.toString=_z(function(){return lz(this)&&pz(this).source||fz(this)},"toString")});var Uf=at((FK,cS)=>{"use strict";var xz=Di(),Ez=Pu(),wz=lS(),Sz=op();cS.exports=function(n,t,e,o){o||(o={});var s=o.enumerable,c=o.name!==void 0?o.name:t;if(xz(e)&&wz(e,c,o),o.global)s?n[t]=e:Sz(t,e);else{try{o.unsafe?n[t]&&(s=!0):delete n[t]}catch(h){}s?n[t]=e:Ez.f(n,t,{value:e,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return n}});var hS=at(fS=>{"use strict";var Mz=e0(),bz=pp(),Az=bz.concat("length","prototype");fS.f=Object.getOwnPropertyNames||function(t){return Mz(t,Az)}});var dS=at(pS=>{"use strict";pS.f=Object.getOwnPropertySymbols});var mS=at((zK,gS)=>{"use strict";var Tz=sc(),Cz=mi(),Pz=hS(),Iz=dS(),Rz=Sa(),Lz=Cz([].concat);gS.exports=Tz("Reflect","ownKeys")||function(t){var e=Pz.f(Rz(t)),o=Iz.f;return o?Lz(e,o(t)):e}});var _S=at((GK,vS)=>{"use strict";var yS=wa(),Nz=mS(),Oz=f0(),Dz=Pu();vS.exports=function(n,t,e){for(var o=Nz(t),s=Dz.f,c=Oz.f,h=0;h<o.length;h++){var p=o[h];!yS(n,p)&&!(e&&yS(e,p))&&s(n,p,c(t,p))}}});var ES=at((kK,xS)=>{"use strict";var Fz=gi(),Uz=Di(),Bz=/#|\\.prototype\\./,Bf=function(n,t){var e=Gz[zz(n)];return e===qz?!0:e===kz?!1:Uz(t)?Fz(t):!!t},zz=Bf.normalize=function(n){return String(n).replace(Bz,".").toLowerCase()},Gz=Bf.data={},kz=Bf.NATIVE="N",qz=Bf.POLYFILL="P";xS.exports=Bf});var Ls=at((qK,wS)=>{"use strict";var Mp=oo(),Hz=f0().f,Vz=ac(),Wz=Uf(),Xz=op(),Yz=_S(),$z=ES();wS.exports=function(n,t){var e=n.target,o=n.global,s=n.stat,c,h,p,g,m,_;if(o?h=Mp:s?h=Mp[e]||Xz(e,{}):h=Mp[e]&&Mp[e].prototype,h)for(p in t){if(m=t[p],n.dontCallGetSet?(_=Hz(h,p),g=_&&_.value):g=h[p],c=$z(o?p:e+(s?".":"#")+p,n.forced),!c&&g!==void 0){if(typeof m==typeof g)continue;Yz(m,g)}(n.sham||g&&g.sham)&&Vz(m,"sham",!0),Wz(h,p,m,n)}}});var MS=at((HK,SS)=>{"use strict";var Zz=gi();SS.exports=!Zz(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype})});var x0=at((VK,AS)=>{"use strict";var Jz=wa(),Kz=Di(),jz=ic(),Qz=dp(),tG=MS(),bS=Qz("IE_PROTO"),_0=Object,eG=_0.prototype;AS.exports=tG?_0.getPrototypeOf:function(n){var t=jz(n);if(Jz(t,bS))return t[bS];var e=t.constructor;return Kz(e)&&t instanceof e?e.prototype:t instanceof _0?eG:null}});var M0=at((WK,PS)=>{"use strict";var nG=gi(),rG=Di(),iG=Ea(),oG=Df(),TS=x0(),sG=Uf(),aG=Is(),uG=Lf(),S0=aG("iterator"),CS=!1,Qa,E0,w0;[].keys&&(w0=[].keys(),"next"in w0?(E0=TS(TS(w0)),E0!==Object.prototype&&(Qa=E0)):CS=!0);var lG=!iG(Qa)||nG(function(){var n={};return Qa[S0].call(n)!==n});lG?Qa={}:uG&&(Qa=oG(Qa));rG(Qa[S0])||sG(Qa,S0,function(){return this});PS.exports={IteratorPrototype:Qa,BUGGY_SAFARI_ITERATORS:CS}});var bp=at((XK,RS)=>{"use strict";var cG=Pu().f,fG=wa(),hG=Is(),IS=hG("toStringTag");RS.exports=function(n,t,e){n&&!e&&(n=n.prototype),n&&!fG(n,IS)&&cG(n,IS,{configurable:!0,value:t})}});var NS=at((YK,LS)=>{"use strict";var pG=M0().IteratorPrototype,dG=Df(),gG=vp(),mG=bp(),yG=yp(),vG=function(){return this};LS.exports=function(n,t,e,o){var s=t+" Iterator";return n.prototype=dG(pG,{next:gG(+!o,e)}),mG(n,s,!1,!0),yG[s]=vG,n}});var b0=at(($K,OS)=>{"use strict";var _G=mi(),xG=Nf();OS.exports=function(n,t,e){try{return _G(xG(Object.getOwnPropertyDescriptor(n,t)[e]))}catch(o){}}});var FS=at((ZK,DS)=>{"use strict";var EG=Ea();DS.exports=function(n){return EG(n)||n===null}});var BS=at((JK,US)=>{"use strict";var wG=FS(),SG=String,MG=TypeError;US.exports=function(n){if(wG(n))return n;throw new MG("Can't set "+SG(n)+" as a prototype")}});var GS=at((KK,zS)=>{"use strict";var bG=b0(),AG=Ea(),TG=nc(),CG=BS();zS.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var n=!1,t={},e;try{e=bG(Object.prototype,"__proto__","set"),e(t,[]),n=t instanceof Array}catch(o){}return function(s,c){return TG(s),CG(c),AG(s)&&(n?e(s,c):s.__proto__=c),s}}():void 0)});var KS=at((jK,JS)=>{"use strict";var PG=Ls(),IG=Rs(),Ap=Lf(),$S=d0(),RG=Di(),LG=NS(),kS=x0(),qS=GS(),NG=bp(),OG=ac(),A0=Uf(),DG=Is(),HS=yp(),ZS=M0(),FG=$S.PROPER,UG=$S.CONFIGURABLE,VS=ZS.IteratorPrototype,Tp=ZS.BUGGY_SAFARI_ITERATORS,zf=DG("iterator"),WS="keys",Gf="values",XS="entries",YS=function(){return this};JS.exports=function(n,t,e,o,s,c,h){LG(e,t,o);var p=function(E){if(E===s&&x)return x;if(!Tp&&E&&E in _)return _[E];switch(E){case WS:return function(){return new e(this,E)};case Gf:return function(){return new e(this,E)};case XS: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=!Tp&&w||p(s),b=t==="Array"&&_.entries||w,P,I,S;if(b&&(P=kS(b.call(new n)),P!==Object.prototype&&P.next&&(!Ap&&kS(P)!==VS&&(qS?qS(P,VS):RG(P[zf])||A0(P,zf,YS)),NG(P,g,!0,!0),Ap&&(HS[g]=YS))),FG&&s===Gf&&w&&w.name!==Gf&&(!Ap&&UG?OG(_,"name",Gf):(m=!0,x=function(){return IG(w,this)})),s)if(I={values:p(Gf),keys:c?x:p(WS),entries:p(XS)},h)for(S in I)(Tp||m||!(S in _))&&A0(_,S,I[S]);else PG({target:t,proto:!0,forced:Tp||m},I);return(!Ap||h)&&_[zf]!==x&&A0(_,zf,x,{name:s}),HS[t]=x,I}});var QS=at((QK,jS)=>{"use strict";jS.exports=function(n,t){return{value:n,done:t}}});var oM=at((tj,iM)=>{"use strict";var BG=rc(),T0=a0(),tM=yp(),nM=Ep(),zG=Pu().f,GG=KS(),Cp=QS(),kG=Lf(),qG=Ys(),rM="Array Iterator",HG=nM.set,VG=nM.getterFor(rM);iM.exports=GG(Array,"Array",function(n,t){HG(this,{type:rM,target:BG(n),index:0,kind:t})},function(){var n=VG(this),t=n.target,e=n.index++;if(!t||e>=t.length)return n.target=null,Cp(void 0,!0);switch(n.kind){case"keys":return Cp(e,!1);case"values":return Cp(t[e],!1)}return Cp([e,t[e]],!1)},"values");var eM=tM.Arguments=tM.Array;T0("keys");T0("values");T0("entries");if(!kG&&qG&&eM.name!=="values")try{zG(eM,"name",{value:"values"})}catch(n){}});var Ip=at(()=>{"use strict";var sM=oo(),uM=Kx(),WG=iE(),kf=oM(),aM=ac(),XG=bp(),YG=Is(),C0=YG("iterator"),P0=kf.values,lM=function(n,t){if(n){if(n[C0]!==P0)try{aM(n,C0,P0)}catch(o){n[C0]=P0}if(XG(n,t,!0),uM[t]){for(var e in kf)if(n[e]!==kf[e])try{aM(n,e,kf[e])}catch(o){n[e]=kf[e]}}}};for(Pp in uM)lM(sM[Pp]&&sM[Pp].prototype,Pp);var Pp;lM(WG,"DOMTokenList")});var hM=at((rj,fM)=>{"use strict";var $G=Is(),ZG=$G("toStringTag"),cM={};cM[ZG]="z";fM.exports=String(cM)==="[object z]"});var I0=at((ij,pM)=>{"use strict";var JG=hM(),KG=Di(),Rp=ec(),jG=Is(),QG=jG("toStringTag"),t4=Object,e4=Rp(function(){return arguments}())==="Arguments",n4=function(n,t){try{return n[t]}catch(e){}};pM.exports=JG?Rp:function(n){var t,e,o;return n===void 0?"Undefined":n===null?"Null":typeof(e=n4(t=t4(n),QG))=="string"?e:e4?Rp(t):(o=Rp(t))==="Object"&&KG(t.callee)?"Arguments":o}});var Lp=at((oj,dM)=>{"use strict";var r4=I0(),i4=String;dM.exports=function(n){if(r4(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return i4(n)}});var mM=at((sj,gM)=>{"use strict";var o4=Sa();gM.exports=function(){var n=o4(this),t="";return n.hasIndices&&(t+="d"),n.global&&(t+="g"),n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.dotAll&&(t+="s"),n.unicode&&(t+="u"),n.unicodeSets&&(t+="v"),n.sticky&&(t+="y"),t}});var vM=at((aj,yM)=>{"use strict";var R0=gi(),s4=oo(),L0=s4.RegExp,N0=R0(function(){var n=L0("a","y");return n.lastIndex=2,n.exec("abcd")!==null}),a4=N0||R0(function(){return!L0("a","y").sticky}),u4=N0||R0(function(){var n=L0("^r","gy");return n.lastIndex=2,n.exec("str")!==null});yM.exports={BROKEN_CARET:u4,MISSED_STICKY:a4,UNSUPPORTED_Y:N0}});var xM=at((uj,_M)=>{"use strict";var l4=gi(),c4=oo(),f4=c4.RegExp;_M.exports=l4(function(){var n=f4(".","s");return!(n.dotAll&&n.test(\`
|
|
114
|
+
`,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 ue.Sprite(new ue.SpriteMaterial({map:t,transparent:!0,alphaTest:.2,depthTest:this.options.depth_test,rotation:this.options.icon_rotate/180*Math.PI}));e.renderOrder=1e5+this.options.level,t.needsUpdate=!0,this.add(e),e.center.set(.5,.5),this.spriteIcon=e}}initSize(){this.spriteIcon&&this.spriteIcon.center.set(.5,.5)}draw(t){let{ctx:e}=r,{config:{size:n}}=this,i=n[0]/2,o=n[1]/2,s=4,a=1,u=s+a;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-u,-Math.PI/2,Math.PI*2-Math.PI/2,t<Math.PI),e.stroke(),e.strokeStyle="#0A7AFF",t<Math.PI){let l=-Math.PI/2,c=l-t;e.beginPath(),e.arc(i,o,o-u,l,c,!0)}else{let l=-Math.PI/2,c=l+Math.PI*2-t;e.beginPath(),e.arc(i,o,o-u,l,c,!1)}e.stroke(),e.clearRect(i-u*2,0,u*4,u*4),e.beginPath(),e.arc(i,u,s,0,Math.PI*2),e.fillStyle="#0A7AFF",e.fill(),e.setLineDash([10,0]),e.strokeStyle="#fff",e.lineWidth=a,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 ue.DataTexture(Uint8Array.from(t.data),e[0],e[1],ue.RGBAFormat);return n.format=ue.RGBAFormat,n.magFilter=ue.LinearFilter,n.minFilter=ue.LinearFilter,n.colorSpace="srgb",n.flipY=!0,n}dispose(){var t;super.dispose(),(t=this.spriteIcon)==null||t.material.dispose()}static dispose(){this.textureMap.forEach(t=>{t.dispose()}),this.textureMap.clear(),this.ctx=null,this.canvas=null}constructor(t,e){super(t.context,{icon_size:e.size,collision_enable:!1,level:2}),this.bmap=t,this.config=e,r.canvas.width=e.size[0],r.canvas.height=e.size[1]}};an.canvas=document.createElement("canvas");an.ctx=an.canvas.getContext("2d",{willReadFrequently:!0});an.textureMap=new Map;var E9={path:{},cheapMaximumDistance:20,needStartPoi:!1,startPoi:{},positionNavigation:{},offsetY:150,directionEmitThreshold:5,disablePathAnimation:!1,speed:1,roadData:[],runAnimationMaxTime:1,navigationCameraBasic:45},jh=class extends Dt{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(Mt.SWITCH_FLOOR_AFTER,this.onSwitchFloor),this.positionNavigation.addEventListener("navigation-info",this.onNavigationInfo),this.bmap.context.addEventListener("control-change",this.onControlChangeForStartPoi)}showStartRotateHelperPoi(){var t;if(this.needStartRotateHelperPoi=!0,!this.startPoi||this.startRotateHelperPoi)return;let e=this.startPoi.options.icon_size;this.startRotateHelperPoi=new an(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(s=>s.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(Mt.SWITCH_FLOOR_AFTER,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 s=()=>{this.bmap.removeEventListener("center-change",s),this.renderPath(this.translatePoints(o.points))};this.bmap.addEventListener("center-change",s)}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 za(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.detachStartPoi){var o;(o=this.bmap.context.currentFloor)==null||o.poiLayer2.removePoi(this.detachStartPoi),this.detachStartPoi=null}if(this.detachLine&&(this.bmap.context.scene.remove(this.detachLine),this.detachLine=null),this.options.detachStartPoi){var s;this.detachStartPoi=new ot(this.bmap.context,T({},this.options.detachStartPoi,{id:"navigation_detach_start_poi",position:{x:e[0][0],y:e[0][1],z:.51},collision_enable:!1}))||null,(s=this.bmap.context.currentFloor)==null||s.poiLayer2.pushPoi(this.detachStartPoi),this.detachLine=new bo(this.bmap.context,new le.Vector3(e[0][0],e[0][1],.51),new le.Vector3(e[0][0],e[0][1],.51)),this.bmap.context.scene.add(this.detachLine)}if(this.options.needStartPoi){var a;this.startPoi=new ot(this.bmap.context,T({},this.options.startPoi,{id:"navigation_start_poi",position:{x:e[0][0],y:e[0][1],z:.51},collision_enable:!1}))||null,(a=this.bmap.context.currentFloor)==null||a.poiLayer2.pushPoi(this.startPoi),this.needStartRotateHelperPoi&&this.showStartRotateHelperPoi(),console.log(this.startRotateHelperPoi)}this.dispatchEvent({type:"render-path",path:this.path})}catmullRomCurve3(t){return _i(t,!1,!0,.1,170,2.5)}getPathDirection(){if(!this.curFloorPath||!this.currentPathPosition||this.curFloorPathPoints.length<2)return null;let t=Ze(this.curFloorPathPoints,this.currentPathPosition),e=this.curFloorPathPoints[t],n=this.curFloorPathPoints[t+1],i=new le.Vector3(n[0]-e[0],n[1]-e[1],0).normalize(),o=new le.Vector3(0,1,0).normalize(),s=i.angleTo(o),a=new le.Vector3().crossVectors(o,i);return(Object.is(a.y,0)?-1:1)*s}getPathDirection2(){if(!this.curFloorPath||!this.toPointPosition||this.curFloorPathPoints.length<2)return null;let t=Ze(this.curFloorPathPoints,this.toPointPosition),e=this.curFloorPathPoints[t],n=this.curFloorPathPoints[t+1];return(new le.Vector2(n[0]-e[0],n[1]-e[1]).normalize().angle()*180/Math.PI-90+360)%360}changeCameraToPathUp(t){return j(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,s=t/Math.PI*6*i;return zt(new Promise(a=>{let u={azimuthal:o.getAzimuthalAngle()},l={azimuthal:e},c=o.getPolarAngle(),{maxPolarAngle:h,minPolarAngle:p}=o;o.maxPolarAngle=c,o.minPolarAngle=c;let m=new Gr.Tween(u,this.tweenUtil.group).to(l,s).easing(Gr.Easing.Quadratic.InOut).onUpdate(()=>j(this,null,function*(){this.startPoi&&o.target.copy(this.startPoi.position),o.setAzimuthalAngle(u.azimuthal,!0),o.setTargetByOffset(this.options.offsetY)})).onComplete(()=>{o.enabled=!0,this.tweenUtil.remove(m),o.maxPolarAngle=h,o.minPolarAngle=p,a(!0)}).onStart(()=>{o.enabled=!1}).start()}),s+500).finally(()=>{this.bmap.context.control.enabled=!0})})}initNavigationCamera(t){return j(this,null,function*(){t===void 0&&(t=1e3);var e;let i=(e=this.taskQueue.getTasks().find(s=>s.meta.type==="initNavigationCamera"))==null?void 0:e.tid,o={run:()=>zt(j(this,null,function*(){yield this.initCameraZoom(t/2),yield this.changeCameraToPathUp(t/4),yield this.translateCameraToStartPoi(t/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 j(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,s=Math.round(e/2),a=Math.round(n/2),u=o.target.clone(),l=I(this.startPoi.position,i,e,n),c=l.x-s,h=a-l.y+this.options.offsetY;if(!(Math.abs(c)<=1&&Math.abs(h)<=1)){if(Math.abs(c)>=1){let p=new le.Vector3;p.setFromMatrixColumn(i.matrix,0),p.normalize(),p.multiplyScalar(c/i.zoom),u.add(new le.Vector3(p.x,p.y,0))}if(Math.abs(h)>=1){let p=new le.Vector3;p.setFromMatrixColumn(i.matrix,1),p.normalize(),p.multiplyScalar(h/i.zoom),u.add(new le.Vector3(p.x,p.y,0))}return zt(new Promise(p=>{let m=o.target.clone();console.log(m,u,t);let g=new Gr.Tween(m,this.tweenUtil.group).to(u,t).onUpdate(()=>{this.bmap.context.control.setCameraPositionByTarget(m,0)}).onComplete(()=>{this.bmap.context.control.setCameraPositionByTarget(u,0),this.tweenUtil.remove(g),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 j(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:s}=i.box,u=Math.min(e/(o.x-s.x),n/(o.y-s.y))*(o.x-s.x)/this.options.navigationCameraBasic;return this.bmap.context.setZoom(u,this.startPoi.position,t).finally(()=>{this.bmap.context.control.enabled=!0})})}toPosition(t,e){if(this.paths[this.curPathIndex].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 j(this,null,function*(){let{currentPathPosition:n,curFloorPath:i,curFloorPathPoints:o}=this;if(!i||!n)return null;let s=this.movedDistance,a=G0(o,t);if(s===-1||a===-1||a<=s)return null;let u=a-s;if(!u)return;let l=Math.min(u/e,this.options.runAnimationMaxTime);return this.pathTween&&this.clearTween(),zt(new Promise(c=>{let h=this.pathTween=new Gr.Tween({distance:0},this.tweenUtil.group).to({distance:u},l*1e3).onUpdate(p=>j(this,null,function*(){this.moveDistance(p.distance+s,h)})).onComplete(()=>{this.tweenUtil.remove(h),c(!0)}).start()}),l*1e3+500).finally(()=>{this.bmap.context.control.enabled=!0})})}moveDistance(t,e){return j(this,null,function*(){var n;this.movedDistance=t,(n=this.path)==null||n.movePath(this.movedDistance/this.curFloorPathLength);let i=Vn(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||(e==null||e.pause(),yield this.changeCameraToPathUp(500/this.options.speed),e==null||e.resume())})}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.startRotateHelperPoi&&this.startRotateHelperPoi.setAngle(i)}dispose(){var t,e,n,i;this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose()),this.tweenUtil.dispose(),this.unRegistryEvent(),(t=this.startPoi)==null||t.dispose(),(e=this.detachStartPoi)==null||e.dispose(),(n=this.detachLine)==null||n.dispose(),(i=this.startRotateHelperPoi)==null||i.dispose(),an.dispose(),this.positionNavigation.dispose(),this.startRotateHelperPoi=null,this.detachStartPoi=null,this.detachLine=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=0,this.startRotateHelperPoi=null,this.needStartRotateHelperPoi=!1,this.movedDistance=0,this.pathStart=[0,0],this.tweenUtil=new $e,this.taskQueue=new Ln,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 s=this.paths[this.curPathIndex];this.setCurFloorPath(s!=null?s:null),s?this.renderPath(this.translatePoints(s.points)):this.clearPath()}else this.clearPath()},this.onControlChangeForStartPoi=()=>{this.startPoi&&this.setStartPoiRotate(this.startPoiRotate)},!n&&typeof e=="object"&&(n=e),this.options=Object.assign({},E9,n),this.positionNavigation=new Na(this,T({simulationSpeed:this.options.speed},this.options.positionNavigation),this.options.roadData),this.registryEvent()}};var Y8=d(W(),1);var kr=require("three"),Ah=class extends Dt{show(t){let e=0;t.forEach(o=>{o.poiLayer2.pois.forEach(s=>{let a=new kr.Vector3().setFromMatrixPosition(s.matrixWorld).z;s.position.setZ(a+e),s.options.depth_test=!0,this.poiLayer.pushPoi(s)}),o.poiLayer2.pois.length=0,o.poiLayer2.dispose(),o.position.z=e,e+=o.userData.height});let{scene:n,currentFloor:i}=this.bmap.context;i&&(n.remove(i),i.dispose()),this.group.add(this.poiLayer,...t),n.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 kr.Group,this.showStatus=!1,this.group.name="mul-floor-group",this.poiLayer=new nr(t.context),this.poiLayer.changeParkingSpaceVisibleByZoom=()=>{let e=new kr.Box3().setFromObject(this.group),{clientSize:{width:n,height:i}}=this.bmap.context,{max:o,min:s}=e,u=Math.min(n/(o.x-s.x),i/(o.y-s.y))*(o.x-s.x)/45;this.poiLayer.pois.filter(l=>l.userData.type==="parkingSpace").map(l=>{let c=this.bmap.context.camera.zoom>=u;l.visible=c,c||l.parentSetVisible(c)})}}};var lT=require("three");function Th(){let r=new Blob([`var xF=Object.create;var $x=Object.defineProperty;var EF=Object.getOwnPropertyDescriptor;var wF=Object.getOwnPropertyNames;var SF=Object.getPrototypeOf,MF=Object.prototype.hasOwnProperty;var at=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var bF=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of wF(t))!MF.call(n,s)&&s!==e&&$x(n,s,{get:()=>t[s],enumerable:!(o=EF(t,s))||o.enumerable});return n};var Ze=(n,t,e)=>(e=n!=null?xF(SF(n)):{},bF(t||!n||!n.__esModule?$x(e,"default",{value:n,enumerable:!0}):e,n));var np=(n,t,e)=>new Promise((o,s)=>{var c=g=>{try{p(e.next(g))}catch(m){s(m)}},h=g=>{try{p(e.throw(g))}catch(m){s(m)}},p=g=>g.done?o(g.value):Promise.resolve(g.value).then(c,h);p((e=e.apply(n,t)).next())});var oo=at((Im,Zx)=>{"use strict";var If=function(n){return n&&n.Math===Math&&n};Zx.exports=If(typeof globalThis=="object"&&globalThis)||If(typeof window=="object"&&window)||If(typeof self=="object"&&self)||If(typeof global=="object"&&global)||If(typeof Im=="object"&&Im)||function(){return this}()||Function("return this")()});var Kx=at((bJ,Jx)=>{"use strict";Jx.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=at((AJ,jx)=>{"use strict";var Rm=typeof document=="object"&&document.all;jx.exports=typeof Rm=="undefined"&&Rm!==void 0?function(n){return typeof n=="function"||n===Rm}:function(n){return typeof n=="function"}});var Ea=at((TJ,Qx)=>{"use strict";var AF=Di();Qx.exports=function(n){return typeof n=="object"?n!==null:AF(n)}});var rp=at((CJ,eE)=>{"use strict";var TF=oo(),tE=Ea(),Lm=TF.document,CF=tE(Lm)&&tE(Lm.createElement);eE.exports=function(n){return CF?Lm.createElement(n):{}}});var iE=at((PJ,rE)=>{"use strict";var PF=rp(),Nm=PF("span").classList,nE=Nm&&Nm.constructor&&Nm.constructor.prototype;rE.exports=nE===Object.prototype?void 0:nE});var gi=at((IJ,oE)=>{"use strict";oE.exports=function(n){try{return!!n()}catch(t){return!0}}});var Rf=at((RJ,sE)=>{"use strict";var IF=gi();sE.exports=!IF(function(){var n=function(){}.bind();return typeof n!="function"||n.hasOwnProperty("prototype")})});var mi=at((LJ,lE)=>{"use strict";var aE=Rf(),uE=Function.prototype,Om=uE.call,RF=aE&&uE.bind.bind(Om,Om);lE.exports=aE?RF:function(n){return function(){return Om.apply(n,arguments)}}});var ec=at((NJ,fE)=>{"use strict";var cE=mi(),LF=cE({}.toString),NF=cE("".slice);fE.exports=function(n){return NF(LF(n),8,-1)}});var pE=at((OJ,hE)=>{"use strict";var OF=mi(),DF=gi(),FF=ec(),Dm=Object,UF=OF("".split);hE.exports=DF(function(){return!Dm("z").propertyIsEnumerable(0)})?function(n){return FF(n)==="String"?UF(n,""):Dm(n)}:Dm});var ip=at((DJ,dE)=>{"use strict";dE.exports=function(n){return n==null}});var nc=at((FJ,gE)=>{"use strict";var BF=ip(),zF=TypeError;gE.exports=function(n){if(BF(n))throw new zF("Can't call method on "+n);return n}});var rc=at((UJ,mE)=>{"use strict";var GF=pE(),kF=nc();mE.exports=function(n){return GF(kF(n))}});var Lf=at((BJ,yE)=>{"use strict";yE.exports=!1});var op=at((zJ,_E)=>{"use strict";var vE=oo(),qF=Object.defineProperty;_E.exports=function(n,t){try{qF(vE,n,{value:t,configurable:!0,writable:!0})}catch(e){vE[n]=t}return t}});var sp=at((GJ,wE)=>{"use strict";var HF=Lf(),VF=oo(),WF=op(),xE="__core-js_shared__",EE=wE.exports=VF[xE]||WF(xE,{});(EE.versions||(EE.versions=[])).push({version:"3.39.0",mode:HF?"pure":"global",copyright:"\\xA9 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var ap=at((kJ,ME)=>{"use strict";var SE=sp();ME.exports=function(n,t){return SE[n]||(SE[n]=t||{})}});var ic=at((qJ,bE)=>{"use strict";var XF=nc(),YF=Object;bE.exports=function(n){return YF(XF(n))}});var wa=at((HJ,AE)=>{"use strict";var $F=mi(),ZF=ic(),JF=$F({}.hasOwnProperty);AE.exports=Object.hasOwn||function(t,e){return JF(ZF(t),e)}});var Fm=at((VJ,TE)=>{"use strict";var KF=mi(),jF=0,QF=Math.random(),tU=KF(1 .toString);TE.exports=function(n){return"Symbol("+(n===void 0?"":n)+")_"+tU(++jF+QF,36)}});var RE=at((WJ,IE)=>{"use strict";var eU=oo(),CE=eU.navigator,PE=CE&&CE.userAgent;IE.exports=PE?String(PE):""});var BE=at((XJ,UE)=>{"use strict";var FE=oo(),Um=RE(),LE=FE.process,NE=FE.Deno,OE=LE&&LE.versions||NE&&NE.version,DE=OE&&OE.v8,Xs,up;DE&&(Xs=DE.split("."),up=Xs[0]>0&&Xs[0]<4?1:+(Xs[0]+Xs[1]));!up&&Um&&(Xs=Um.match(/Edge\\/(\\d+)/),(!Xs||Xs[1]>=74)&&(Xs=Um.match(/Chrome\\/(\\d+)/),Xs&&(up=+Xs[1])));UE.exports=up});var Bm=at((YJ,GE)=>{"use strict";var zE=BE(),nU=gi(),rU=oo(),iU=rU.String;GE.exports=!!Object.getOwnPropertySymbols&&!nU(function(){var n=Symbol("symbol detection");return!iU(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&zE&&zE<41})});var zm=at(($J,kE)=>{"use strict";var oU=Bm();kE.exports=oU&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Is=at((ZJ,HE)=>{"use strict";var sU=oo(),aU=ap(),qE=wa(),uU=Fm(),lU=Bm(),cU=zm(),oc=sU.Symbol,Gm=aU("wks"),fU=cU?oc.for||oc:oc&&oc.withoutSetter||uU;HE.exports=function(n){return qE(Gm,n)||(Gm[n]=lU&&qE(oc,n)?oc[n]:fU("Symbol."+n)),Gm[n]}});var Sa=at((JJ,VE)=>{"use strict";var hU=Ea(),pU=String,dU=TypeError;VE.exports=function(n){if(hU(n))return n;throw new dU(pU(n)+" is not an object")}});var Ys=at((KJ,WE)=>{"use strict";var gU=gi();WE.exports=!gU(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var km=at((jJ,XE)=>{"use strict";var mU=Ys(),yU=gi();XE.exports=mU&&yU(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var qm=at((QJ,YE)=>{"use strict";var vU=Ys(),_U=gi(),xU=rp();YE.exports=!vU&&!_U(function(){return Object.defineProperty(xU("div"),"a",{get:function(){return 7}}).a!==7})});var Rs=at((tK,$E)=>{"use strict";var EU=Rf(),lp=Function.prototype.call;$E.exports=EU?lp.bind(lp):function(){return lp.apply(lp,arguments)}});var sc=at((eK,ZE)=>{"use strict";var Hm=oo(),wU=Di(),SU=function(n){return wU(n)?n:void 0};ZE.exports=function(n,t){return arguments.length<2?SU(Hm[n]):Hm[n]&&Hm[n][t]}});var KE=at((nK,JE)=>{"use strict";var MU=mi();JE.exports=MU({}.isPrototypeOf)});var Vm=at((rK,jE)=>{"use strict";var bU=sc(),AU=Di(),TU=KE(),CU=zm(),PU=Object;jE.exports=CU?function(n){return typeof n=="symbol"}:function(n){var t=bU("Symbol");return AU(t)&&TU(t.prototype,PU(n))}});var tw=at((iK,QE)=>{"use strict";var IU=String;QE.exports=function(n){try{return IU(n)}catch(t){return"Object"}}});var Nf=at((oK,ew)=>{"use strict";var RU=Di(),LU=tw(),NU=TypeError;ew.exports=function(n){if(RU(n))return n;throw new NU(LU(n)+" is not a function")}});var cp=at((sK,nw)=>{"use strict";var OU=Nf(),DU=ip();nw.exports=function(n,t){var e=n[t];return DU(e)?void 0:OU(e)}});var iw=at((aK,rw)=>{"use strict";var Wm=Rs(),Xm=Di(),Ym=Ea(),FU=TypeError;rw.exports=function(n,t){var e,o;if(t==="string"&&Xm(e=n.toString)&&!Ym(o=Wm(e,n))||Xm(e=n.valueOf)&&!Ym(o=Wm(e,n))||t!=="string"&&Xm(e=n.toString)&&!Ym(o=Wm(e,n)))return o;throw new FU("Can't convert object to primitive value")}});var uw=at((uK,aw)=>{"use strict";var UU=Rs(),ow=Ea(),sw=Vm(),BU=cp(),zU=iw(),GU=Is(),kU=TypeError,qU=GU("toPrimitive");aw.exports=function(n,t){if(!ow(n)||sw(n))return n;var e=BU(n,qU),o;if(e){if(t===void 0&&(t="default"),o=UU(e,n,t),!ow(o)||sw(o))return o;throw new kU("Can't convert object to primitive value")}return t===void 0&&(t="number"),zU(n,t)}});var $m=at((lK,lw)=>{"use strict";var HU=uw(),VU=Vm();lw.exports=function(n){var t=HU(n,"string");return VU(t)?t:t+""}});var Pu=at(fw=>{"use strict";var WU=Ys(),XU=qm(),YU=km(),fp=Sa(),cw=$m(),$U=TypeError,Zm=Object.defineProperty,ZU=Object.getOwnPropertyDescriptor,Jm="enumerable",Km="configurable",jm="writable";fw.f=WU?YU?function(t,e,o){if(fp(t),e=cw(e),fp(o),typeof t=="function"&&e==="prototype"&&"value"in o&&jm in o&&!o[jm]){var s=ZU(t,e);s&&s[jm]&&(t[e]=o.value,o={configurable:Km in o?o[Km]:s[Km],enumerable:Jm in o?o[Jm]:s[Jm],writable:!1})}return Zm(t,e,o)}:Zm:function(t,e,o){if(fp(t),e=cw(e),fp(o),XU)try{return Zm(t,e,o)}catch(s){}if("get"in o||"set"in o)throw new $U("Accessors not supported");return"value"in o&&(t[e]=o.value),t}});var pw=at((fK,hw)=>{"use strict";var JU=Math.ceil,KU=Math.floor;hw.exports=Math.trunc||function(t){var e=+t;return(e>0?KU:JU)(e)}});var ml=at((hK,dw)=>{"use strict";var jU=pw();dw.exports=function(n){var t=+n;return t!==t||t===0?0:jU(t)}});var mw=at((pK,gw)=>{"use strict";var QU=ml(),tB=Math.max,eB=Math.min;gw.exports=function(n,t){var e=QU(n);return e<0?tB(e+t,0):eB(e,t)}});var Qm=at((dK,yw)=>{"use strict";var nB=ml(),rB=Math.min;yw.exports=function(n){var t=nB(n);return t>0?rB(t,9007199254740991):0}});var Of=at((gK,vw)=>{"use strict";var iB=Qm();vw.exports=function(n){return iB(n.length)}});var Ew=at((mK,xw)=>{"use strict";var oB=rc(),sB=mw(),aB=Of(),_w=function(n){return function(t,e,o){var s=oB(t),c=aB(s);if(c===0)return!n&&-1;var h=sB(o,c),p;if(n&&e!==e){for(;c>h;)if(p=s[h++],p!==p)return!0}else for(;c>h;h++)if((n||h in s)&&s[h]===e)return n||h||0;return!n&&-1}};xw.exports={includes:_w(!0),indexOf:_w(!1)}});var hp=at((yK,ww)=>{"use strict";ww.exports={}});var e0=at((vK,Mw)=>{"use strict";var uB=mi(),t0=wa(),lB=rc(),cB=Ew().indexOf,fB=hp(),Sw=uB([].push);Mw.exports=function(n,t){var e=lB(n),o=0,s=[],c;for(c in e)!t0(fB,c)&&t0(e,c)&&Sw(s,c);for(;t.length>o;)t0(e,c=t[o++])&&(~cB(s,c)||Sw(s,c));return s}});var pp=at((_K,bw)=>{"use strict";bw.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Tw=at((xK,Aw)=>{"use strict";var hB=e0(),pB=pp();Aw.exports=Object.keys||function(t){return hB(t,pB)}});var Pw=at(Cw=>{"use strict";var dB=Ys(),gB=km(),mB=Pu(),yB=Sa(),vB=rc(),_B=Tw();Cw.f=dB&&!gB?Object.defineProperties:function(t,e){yB(t);for(var o=vB(e),s=_B(e),c=s.length,h=0,p;c>h;)mB.f(t,p=s[h++],o[p]);return t}});var Rw=at((wK,Iw)=>{"use strict";var xB=sc();Iw.exports=xB("document","documentElement")});var dp=at((SK,Nw)=>{"use strict";var EB=ap(),wB=Fm(),Lw=EB("keys");Nw.exports=function(n){return Lw[n]||(Lw[n]=wB(n))}});var Df=at((MK,Gw)=>{"use strict";var SB=Sa(),MB=Pw(),Ow=pp(),bB=hp(),AB=Rw(),TB=rp(),CB=dp(),Dw=">",Fw="<",r0="prototype",i0="script",Bw=CB("IE_PROTO"),n0=function(){},zw=function(n){return Fw+i0+Dw+n+Fw+"/"+i0+Dw},Uw=function(n){n.write(zw("")),n.close();var t=n.parentWindow.Object;return n=null,t},PB=function(){var n=TB("iframe"),t="java"+i0+":",e;return n.style.display="none",AB.appendChild(n),n.src=String(t),e=n.contentWindow.document,e.open(),e.write(zw("document.F=Object")),e.close(),e.F},gp,mp=function(){try{gp=new ActiveXObject("htmlfile")}catch(t){}mp=typeof document!="undefined"?document.domain&&gp?Uw(gp):PB():Uw(gp);for(var n=Ow.length;n--;)delete mp[r0][Ow[n]];return mp()};bB[Bw]=!0;Gw.exports=Object.create||function(t,e){var o;return t!==null?(n0[r0]=SB(t),o=new n0,n0[r0]=null,o[Bw]=t):o=mp(),e===void 0?o:MB.f(o,e)}});var a0=at((bK,kw)=>{"use strict";var IB=Is(),RB=Df(),LB=Pu().f,o0=IB("unscopables"),s0=Array.prototype;s0[o0]===void 0&&LB(s0,o0,{configurable:!0,value:RB(null)});kw.exports=function(n){s0[o0][n]=!0}});var yp=at((AK,qw)=>{"use strict";qw.exports={}});var Ww=at((TK,Vw)=>{"use strict";var NB=oo(),OB=Di(),Hw=NB.WeakMap;Vw.exports=OB(Hw)&&/native code/.test(String(Hw))});var vp=at((CK,Xw)=>{"use strict";Xw.exports=function(n,t){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:t}}});var ac=at((PK,Yw)=>{"use strict";var DB=Ys(),FB=Pu(),UB=vp();Yw.exports=DB?function(n,t,e){return FB.f(n,t,UB(1,e))}:function(n,t,e){return n[t]=e,n}});var Ep=at((IK,Jw)=>{"use strict";var BB=Ww(),Zw=oo(),zB=Ea(),GB=ac(),u0=wa(),l0=sp(),kB=dp(),qB=hp(),$w="Object already initialized",c0=Zw.TypeError,HB=Zw.WeakMap,_p,Ff,xp,VB=function(n){return xp(n)?Ff(n):_p(n,{})},WB=function(n){return function(t){var e;if(!zB(t)||(e=Ff(t)).type!==n)throw new c0("Incompatible receiver, "+n+" required");return e}};BB||l0.state?($s=l0.state||(l0.state=new HB),$s.get=$s.get,$s.has=$s.has,$s.set=$s.set,_p=function(n,t){if($s.has(n))throw new c0($w);return t.facade=n,$s.set(n,t),t},Ff=function(n){return $s.get(n)||{}},xp=function(n){return $s.has(n)}):(yl=kB("state"),qB[yl]=!0,_p=function(n,t){if(u0(n,yl))throw new c0($w);return t.facade=n,GB(n,yl,t),t},Ff=function(n){return u0(n,yl)?n[yl]:{}},xp=function(n){return u0(n,yl)});var $s,yl;Jw.exports={set:_p,get:Ff,has:xp,enforce:VB,getterFor:WB}});var tS=at(Qw=>{"use strict";var Kw={}.propertyIsEnumerable,jw=Object.getOwnPropertyDescriptor,XB=jw&&!Kw.call({1:2},1);Qw.f=XB?function(t){var e=jw(this,t);return!!e&&e.enumerable}:Kw});var f0=at(nS=>{"use strict";var YB=Ys(),$B=Rs(),ZB=tS(),JB=vp(),KB=rc(),jB=$m(),QB=wa(),tz=qm(),eS=Object.getOwnPropertyDescriptor;nS.f=YB?eS:function(t,e){if(t=KB(t),e=jB(e),tz)try{return eS(t,e)}catch(o){}if(QB(t,e))return JB(!$B(ZB.f,t,e),t[e])}});var d0=at((NK,iS)=>{"use strict";var h0=Ys(),ez=wa(),rS=Function.prototype,nz=h0&&Object.getOwnPropertyDescriptor,p0=ez(rS,"name"),rz=p0&&function(){}.name==="something",iz=p0&&(!h0||h0&&nz(rS,"name").configurable);iS.exports={EXISTS:p0,PROPER:rz,CONFIGURABLE:iz}});var m0=at((OK,oS)=>{"use strict";var oz=mi(),sz=Di(),g0=sp(),az=oz(Function.toString);sz(g0.inspectSource)||(g0.inspectSource=function(n){return az(n)});oS.exports=g0.inspectSource});var lS=at((DK,uS)=>{"use strict";var v0=mi(),uz=gi(),lz=Di(),wp=wa(),y0=Ys(),cz=d0().CONFIGURABLE,fz=m0(),aS=Ep(),hz=aS.enforce,pz=aS.get,sS=String,Sp=Object.defineProperty,dz=v0("".slice),gz=v0("".replace),mz=v0([].join),yz=y0&&!uz(function(){return Sp(function(){},"length",{value:8}).length!==8}),vz=String(String).split("String"),_z=uS.exports=function(n,t,e){dz(sS(t),0,7)==="Symbol("&&(t="["+gz(sS(t),/^Symbol\\(([^)]*)\\).*$/,"$1")+"]"),e&&e.getter&&(t="get "+t),e&&e.setter&&(t="set "+t),(!wp(n,"name")||cz&&n.name!==t)&&(y0?Sp(n,"name",{value:t,configurable:!0}):n.name=t),yz&&e&&wp(e,"arity")&&n.length!==e.arity&&Sp(n,"length",{value:e.arity});try{e&&wp(e,"constructor")&&e.constructor?y0&&Sp(n,"prototype",{writable:!1}):n.prototype&&(n.prototype=void 0)}catch(s){}var o=hz(n);return wp(o,"source")||(o.source=mz(vz,typeof t=="string"?t:"")),n};Function.prototype.toString=_z(function(){return lz(this)&&pz(this).source||fz(this)},"toString")});var Uf=at((FK,cS)=>{"use strict";var xz=Di(),Ez=Pu(),wz=lS(),Sz=op();cS.exports=function(n,t,e,o){o||(o={});var s=o.enumerable,c=o.name!==void 0?o.name:t;if(xz(e)&&wz(e,c,o),o.global)s?n[t]=e:Sz(t,e);else{try{o.unsafe?n[t]&&(s=!0):delete n[t]}catch(h){}s?n[t]=e:Ez.f(n,t,{value:e,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return n}});var hS=at(fS=>{"use strict";var Mz=e0(),bz=pp(),Az=bz.concat("length","prototype");fS.f=Object.getOwnPropertyNames||function(t){return Mz(t,Az)}});var dS=at(pS=>{"use strict";pS.f=Object.getOwnPropertySymbols});var mS=at((zK,gS)=>{"use strict";var Tz=sc(),Cz=mi(),Pz=hS(),Iz=dS(),Rz=Sa(),Lz=Cz([].concat);gS.exports=Tz("Reflect","ownKeys")||function(t){var e=Pz.f(Rz(t)),o=Iz.f;return o?Lz(e,o(t)):e}});var _S=at((GK,vS)=>{"use strict";var yS=wa(),Nz=mS(),Oz=f0(),Dz=Pu();vS.exports=function(n,t,e){for(var o=Nz(t),s=Dz.f,c=Oz.f,h=0;h<o.length;h++){var p=o[h];!yS(n,p)&&!(e&&yS(e,p))&&s(n,p,c(t,p))}}});var ES=at((kK,xS)=>{"use strict";var Fz=gi(),Uz=Di(),Bz=/#|\\.prototype\\./,Bf=function(n,t){var e=Gz[zz(n)];return e===qz?!0:e===kz?!1:Uz(t)?Fz(t):!!t},zz=Bf.normalize=function(n){return String(n).replace(Bz,".").toLowerCase()},Gz=Bf.data={},kz=Bf.NATIVE="N",qz=Bf.POLYFILL="P";xS.exports=Bf});var Ls=at((qK,wS)=>{"use strict";var Mp=oo(),Hz=f0().f,Vz=ac(),Wz=Uf(),Xz=op(),Yz=_S(),$z=ES();wS.exports=function(n,t){var e=n.target,o=n.global,s=n.stat,c,h,p,g,m,_;if(o?h=Mp:s?h=Mp[e]||Xz(e,{}):h=Mp[e]&&Mp[e].prototype,h)for(p in t){if(m=t[p],n.dontCallGetSet?(_=Hz(h,p),g=_&&_.value):g=h[p],c=$z(o?p:e+(s?".":"#")+p,n.forced),!c&&g!==void 0){if(typeof m==typeof g)continue;Yz(m,g)}(n.sham||g&&g.sham)&&Vz(m,"sham",!0),Wz(h,p,m,n)}}});var MS=at((HK,SS)=>{"use strict";var Zz=gi();SS.exports=!Zz(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype})});var x0=at((VK,AS)=>{"use strict";var Jz=wa(),Kz=Di(),jz=ic(),Qz=dp(),tG=MS(),bS=Qz("IE_PROTO"),_0=Object,eG=_0.prototype;AS.exports=tG?_0.getPrototypeOf:function(n){var t=jz(n);if(Jz(t,bS))return t[bS];var e=t.constructor;return Kz(e)&&t instanceof e?e.prototype:t instanceof _0?eG:null}});var M0=at((WK,PS)=>{"use strict";var nG=gi(),rG=Di(),iG=Ea(),oG=Df(),TS=x0(),sG=Uf(),aG=Is(),uG=Lf(),S0=aG("iterator"),CS=!1,Qa,E0,w0;[].keys&&(w0=[].keys(),"next"in w0?(E0=TS(TS(w0)),E0!==Object.prototype&&(Qa=E0)):CS=!0);var lG=!iG(Qa)||nG(function(){var n={};return Qa[S0].call(n)!==n});lG?Qa={}:uG&&(Qa=oG(Qa));rG(Qa[S0])||sG(Qa,S0,function(){return this});PS.exports={IteratorPrototype:Qa,BUGGY_SAFARI_ITERATORS:CS}});var bp=at((XK,RS)=>{"use strict";var cG=Pu().f,fG=wa(),hG=Is(),IS=hG("toStringTag");RS.exports=function(n,t,e){n&&!e&&(n=n.prototype),n&&!fG(n,IS)&&cG(n,IS,{configurable:!0,value:t})}});var NS=at((YK,LS)=>{"use strict";var pG=M0().IteratorPrototype,dG=Df(),gG=vp(),mG=bp(),yG=yp(),vG=function(){return this};LS.exports=function(n,t,e,o){var s=t+" Iterator";return n.prototype=dG(pG,{next:gG(+!o,e)}),mG(n,s,!1,!0),yG[s]=vG,n}});var b0=at(($K,OS)=>{"use strict";var _G=mi(),xG=Nf();OS.exports=function(n,t,e){try{return _G(xG(Object.getOwnPropertyDescriptor(n,t)[e]))}catch(o){}}});var FS=at((ZK,DS)=>{"use strict";var EG=Ea();DS.exports=function(n){return EG(n)||n===null}});var BS=at((JK,US)=>{"use strict";var wG=FS(),SG=String,MG=TypeError;US.exports=function(n){if(wG(n))return n;throw new MG("Can't set "+SG(n)+" as a prototype")}});var GS=at((KK,zS)=>{"use strict";var bG=b0(),AG=Ea(),TG=nc(),CG=BS();zS.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var n=!1,t={},e;try{e=bG(Object.prototype,"__proto__","set"),e(t,[]),n=t instanceof Array}catch(o){}return function(s,c){return TG(s),CG(c),AG(s)&&(n?e(s,c):s.__proto__=c),s}}():void 0)});var KS=at((jK,JS)=>{"use strict";var PG=Ls(),IG=Rs(),Ap=Lf(),$S=d0(),RG=Di(),LG=NS(),kS=x0(),qS=GS(),NG=bp(),OG=ac(),A0=Uf(),DG=Is(),HS=yp(),ZS=M0(),FG=$S.PROPER,UG=$S.CONFIGURABLE,VS=ZS.IteratorPrototype,Tp=ZS.BUGGY_SAFARI_ITERATORS,zf=DG("iterator"),WS="keys",Gf="values",XS="entries",YS=function(){return this};JS.exports=function(n,t,e,o,s,c,h){LG(e,t,o);var p=function(E){if(E===s&&x)return x;if(!Tp&&E&&E in _)return _[E];switch(E){case WS:return function(){return new e(this,E)};case Gf:return function(){return new e(this,E)};case XS: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=!Tp&&w||p(s),b=t==="Array"&&_.entries||w,P,I,S;if(b&&(P=kS(b.call(new n)),P!==Object.prototype&&P.next&&(!Ap&&kS(P)!==VS&&(qS?qS(P,VS):RG(P[zf])||A0(P,zf,YS)),NG(P,g,!0,!0),Ap&&(HS[g]=YS))),FG&&s===Gf&&w&&w.name!==Gf&&(!Ap&&UG?OG(_,"name",Gf):(m=!0,x=function(){return IG(w,this)})),s)if(I={values:p(Gf),keys:c?x:p(WS),entries:p(XS)},h)for(S in I)(Tp||m||!(S in _))&&A0(_,S,I[S]);else PG({target:t,proto:!0,forced:Tp||m},I);return(!Ap||h)&&_[zf]!==x&&A0(_,zf,x,{name:s}),HS[t]=x,I}});var QS=at((QK,jS)=>{"use strict";jS.exports=function(n,t){return{value:n,done:t}}});var oM=at((tj,iM)=>{"use strict";var BG=rc(),T0=a0(),tM=yp(),nM=Ep(),zG=Pu().f,GG=KS(),Cp=QS(),kG=Lf(),qG=Ys(),rM="Array Iterator",HG=nM.set,VG=nM.getterFor(rM);iM.exports=GG(Array,"Array",function(n,t){HG(this,{type:rM,target:BG(n),index:0,kind:t})},function(){var n=VG(this),t=n.target,e=n.index++;if(!t||e>=t.length)return n.target=null,Cp(void 0,!0);switch(n.kind){case"keys":return Cp(e,!1);case"values":return Cp(t[e],!1)}return Cp([e,t[e]],!1)},"values");var eM=tM.Arguments=tM.Array;T0("keys");T0("values");T0("entries");if(!kG&&qG&&eM.name!=="values")try{zG(eM,"name",{value:"values"})}catch(n){}});var Ip=at(()=>{"use strict";var sM=oo(),uM=Kx(),WG=iE(),kf=oM(),aM=ac(),XG=bp(),YG=Is(),C0=YG("iterator"),P0=kf.values,lM=function(n,t){if(n){if(n[C0]!==P0)try{aM(n,C0,P0)}catch(o){n[C0]=P0}if(XG(n,t,!0),uM[t]){for(var e in kf)if(n[e]!==kf[e])try{aM(n,e,kf[e])}catch(o){n[e]=kf[e]}}}};for(Pp in uM)lM(sM[Pp]&&sM[Pp].prototype,Pp);var Pp;lM(WG,"DOMTokenList")});var hM=at((rj,fM)=>{"use strict";var $G=Is(),ZG=$G("toStringTag"),cM={};cM[ZG]="z";fM.exports=String(cM)==="[object z]"});var I0=at((ij,pM)=>{"use strict";var JG=hM(),KG=Di(),Rp=ec(),jG=Is(),QG=jG("toStringTag"),t4=Object,e4=Rp(function(){return arguments}())==="Arguments",n4=function(n,t){try{return n[t]}catch(e){}};pM.exports=JG?Rp:function(n){var t,e,o;return n===void 0?"Undefined":n===null?"Null":typeof(e=n4(t=t4(n),QG))=="string"?e:e4?Rp(t):(o=Rp(t))==="Object"&&KG(t.callee)?"Arguments":o}});var Lp=at((oj,dM)=>{"use strict";var r4=I0(),i4=String;dM.exports=function(n){if(r4(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return i4(n)}});var mM=at((sj,gM)=>{"use strict";var o4=Sa();gM.exports=function(){var n=o4(this),t="";return n.hasIndices&&(t+="d"),n.global&&(t+="g"),n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.dotAll&&(t+="s"),n.unicode&&(t+="u"),n.unicodeSets&&(t+="v"),n.sticky&&(t+="y"),t}});var vM=at((aj,yM)=>{"use strict";var R0=gi(),s4=oo(),L0=s4.RegExp,N0=R0(function(){var n=L0("a","y");return n.lastIndex=2,n.exec("abcd")!==null}),a4=N0||R0(function(){return!L0("a","y").sticky}),u4=N0||R0(function(){var n=L0("^r","gy");return n.lastIndex=2,n.exec("str")!==null});yM.exports={BROKEN_CARET:u4,MISSED_STICKY:a4,UNSUPPORTED_Y:N0}});var xM=at((uj,_M)=>{"use strict";var l4=gi(),c4=oo(),f4=c4.RegExp;_M.exports=l4(function(){var n=f4(".","s");return!(n.dotAll&&n.test(\`
|
|
115
115
|
\`)&&n.flags==="s")})});var wM=at((lj,EM)=>{"use strict";var h4=gi(),p4=oo(),d4=p4.RegExp;EM.exports=h4(function(){var n=d4("(?<a>b)","g");return n.exec("b").groups.a!=="b"||"b".replace(n,"$<a>c")!=="bc"})});var Dp=at((cj,MM)=>{"use strict";var uc=Rs(),Op=mi(),g4=Lp(),m4=mM(),y4=vM(),v4=ap(),_4=Df(),x4=Ep().get,E4=xM(),w4=wM(),S4=v4("native-string-replace",String.prototype.replace),Np=RegExp.prototype.exec,D0=Np,M4=Op("".charAt),b4=Op("".indexOf),A4=Op("".replace),O0=Op("".slice),F0=function(){var n=/a/,t=/b*/g;return uc(Np,n,"a"),uc(Np,t,"a"),n.lastIndex!==0||t.lastIndex!==0}(),SM=y4.BROKEN_CARET,U0=/()??/.exec("")[1]!==void 0,T4=F0||U0||SM||E4||w4;T4&&(D0=function(t){var e=this,o=x4(e),s=g4(t),c=o.raw,h,p,g,m,_,w,x;if(c)return c.lastIndex=e.lastIndex,h=uc(D0,c,s),e.lastIndex=c.lastIndex,h;var b=o.groups,P=SM&&e.sticky,I=uc(m4,e),S=e.source,E=0,R=s;if(P&&(I=A4(I,"y",""),b4(I,"g")===-1&&(I+="g"),R=O0(s,e.lastIndex),e.lastIndex>0&&(!e.multiline||e.multiline&&M4(s,e.lastIndex-1)!==\`
|
|
116
116
|
\`)&&(S="(?: "+S+")",R=" "+R,E++),p=new RegExp("^(?:"+S+")",I)),U0&&(p=new RegExp("^"+S+"$(?!\\\\s)",I)),F0&&(g=e.lastIndex),m=uc(Np,P?p:e,R),P?m?(m.input=O0(m.input,E),m[0]=O0(m[0],E),m.index=e.lastIndex,e.lastIndex+=m[0].length):e.lastIndex=0:F0&&m&&(e.lastIndex=e.global?m.index+m[0].length:g),U0&&m&&m.length>1&&uc(S4,m[0],p,function(){for(_=1;_<arguments.length-2;_++)arguments[_]===void 0&&(m[_]=void 0)}),m&&b)for(m.groups=w=_4(null),_=0;_<b.length;_++)x=b[_],w[x[0]]=m[x[1]];return m});MM.exports=D0});var Fp=at(()=>{"use strict";var C4=Ls(),bM=Dp();C4({target:"RegExp",proto:!0,forced:/./.exec!==bM},{exec:bM})});var Up=at((pj,AM)=>{"use strict";var P4=ec();AM.exports=Array.isArray||function(t){return P4(t)==="Array"}});var CM=at((dj,TM)=>{"use strict";var I4=Ys(),R4=Up(),L4=TypeError,N4=Object.getOwnPropertyDescriptor,O4=I4&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(n){return n instanceof TypeError}}();TM.exports=O4?function(n,t){if(R4(n)&&!N4(n,"length").writable)throw new L4("Cannot set read only .length");return n.length=t}:function(n,t){return n.length=t}});var B0=at((gj,PM)=>{"use strict";var D4=TypeError,F4=9007199254740991;PM.exports=function(n){if(n>F4)throw D4("Maximum allowed index exceeded");return n}});var z0=at(()=>{"use strict";var U4=Ls(),B4=ic(),z4=Of(),G4=CM(),k4=B0(),q4=gi(),H4=q4(function(){return[].push.call({length:4294967296},1)!==4294967297}),V4=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(n){return n instanceof TypeError}},W4=H4||!V4();U4({target:"Array",proto:!0,arity:1,forced:W4},{push:function(t){var e=B4(this),o=z4(e),s=arguments.length;k4(o+s);for(var c=0;c<s;c++)e[o]=arguments[c],o++;return G4(e,o),o}})});var Zs=at((vj,IM)=>{"use strict";var G0=mi(),Bp=Set.prototype;IM.exports={Set,add:G0(Bp.add),has:G0(Bp.has),remove:G0(Bp.delete),proto:Bp}});var Iu=at((_j,RM)=>{"use strict";var X4=Zs().has;RM.exports=function(n){return X4(n),n}});var Ru=at((xj,LM)=>{"use strict";var Y4=Rs();LM.exports=function(n,t,e){for(var o=e?n:n.iterator,s=n.next,c,h;!(c=Y4(s,o)).done;)if(h=t(c.value),h!==void 0)return h}});var lc=at((Ej,UM)=>{"use strict";var NM=mi(),$4=Ru(),OM=Zs(),Z4=OM.Set,DM=OM.proto,J4=NM(DM.forEach),FM=NM(DM.keys),K4=FM(new Z4).next;UM.exports=function(n,t,e){return e?$4({iterator:FM(n),next:K4},t):J4(n,t)}});var zp=at((wj,zM)=>{"use strict";var BM=Zs(),j4=lc(),Q4=BM.Set,tk=BM.add;zM.exports=function(n){var t=new Q4;return j4(n,function(e){tk(t,e)}),t}});var cc=at((Sj,GM)=>{"use strict";var ek=b0(),nk=Zs();GM.exports=ek(nk.proto,"size","get")||function(n){return n.size}});var qM=at((Mj,kM)=>{"use strict";kM.exports=function(n){return{iterator:n,next:n.next,done:!1}}});var Lu=at((bj,$M)=>{"use strict";var HM=Nf(),XM=Sa(),VM=Rs(),rk=ml(),ik=qM(),WM="Invalid size",ok=RangeError,sk=TypeError,ak=Math.max,YM=function(n,t){this.set=n,this.size=ak(t,0),this.has=HM(n.has),this.keys=HM(n.keys)};YM.prototype={getIterator:function(){return ik(XM(VM(this.keys,this.set)))},includes:function(n){return VM(this.has,this.set,n)}};$M.exports=function(n){XM(n);var t=+n.size;if(t!==t)throw new sk(WM);var e=rk(t);if(e<0)throw new ok(WM);return new YM(n,e)}});var jM=at((Aj,KM)=>{"use strict";var uk=Iu(),JM=Zs(),lk=zp(),ck=cc(),fk=Lu(),hk=lc(),pk=Ru(),dk=JM.has,ZM=JM.remove;KM.exports=function(t){var e=uk(this),o=fk(t),s=lk(e);return ck(e)<=o.size?hk(e,function(c){o.includes(c)&&ZM(s,c)}):pk(o.getIterator(),function(c){dk(e,c)&&ZM(s,c)}),s}});var Nu=at((Tj,tb)=>{"use strict";var gk=sc(),QM=function(n){return{size:n,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};tb.exports=function(n){var t=gk("Set");try{new t()[n](QM(0));try{return new t()[n](QM(-1)),!1}catch(e){return!0}}catch(e){return!1}}});var eb=at(()=>{"use strict";var mk=Ls(),yk=jM(),vk=Nu();mk({target:"Set",proto:!0,real:!0,forced:!vk("difference")},{difference:yk})});var ib=at((Ij,rb)=>{"use strict";var _k=Iu(),k0=Zs(),xk=cc(),Ek=Lu(),wk=lc(),Sk=Ru(),Mk=k0.Set,nb=k0.add,bk=k0.has;rb.exports=function(t){var e=_k(this),o=Ek(t),s=new Mk;return xk(e)>o.size?Sk(o.getIterator(),function(c){bk(e,c)&&nb(s,c)}):wk(e,function(c){o.includes(c)&&nb(s,c)}),s}});var ob=at(()=>{"use strict";var Ak=Ls(),Tk=gi(),Ck=ib(),Pk=Nu(),Ik=!Pk("intersection")||Tk(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});Ak({target:"Set",proto:!0,real:!0,forced:Ik},{intersection:Ck})});var q0=at((Nj,ab)=>{"use strict";var Rk=Rs(),sb=Sa(),Lk=cp();ab.exports=function(n,t,e){var o,s;sb(n);try{if(o=Lk(n,"return"),!o){if(t==="throw")throw e;return e}o=Rk(o,n)}catch(c){s=!0,o=c}if(t==="throw")throw e;if(s)throw o;return sb(o),e}});var lb=at((Oj,ub)=>{"use strict";var Nk=Iu(),Ok=Zs().has,Dk=cc(),Fk=Lu(),Uk=lc(),Bk=Ru(),zk=q0();ub.exports=function(t){var e=Nk(this),o=Fk(t);if(Dk(e)<=o.size)return Uk(e,function(c){if(o.includes(c))return!1},!0)!==!1;var s=o.getIterator();return Bk(s,function(c){if(Ok(e,c))return zk(s,"normal",!1)})!==!1}});var cb=at(()=>{"use strict";var Gk=Ls(),kk=lb(),qk=Nu();Gk({target:"Set",proto:!0,real:!0,forced:!qk("isDisjointFrom")},{isDisjointFrom:kk})});var hb=at((Uj,fb)=>{"use strict";var Hk=Iu(),Vk=cc(),Wk=lc(),Xk=Lu();fb.exports=function(t){var e=Hk(this),o=Xk(t);return Vk(e)>o.size?!1:Wk(e,function(s){if(!o.includes(s))return!1},!0)!==!1}});var pb=at(()=>{"use strict";var Yk=Ls(),$k=hb(),Zk=Nu();Yk({target:"Set",proto:!0,real:!0,forced:!Zk("isSubsetOf")},{isSubsetOf:$k})});var gb=at((Gj,db)=>{"use strict";var Jk=Iu(),Kk=Zs().has,jk=cc(),Qk=Lu(),tq=Ru(),eq=q0();db.exports=function(t){var e=Jk(this),o=Qk(t);if(jk(e)<o.size)return!1;var s=o.getIterator();return tq(s,function(c){if(!Kk(e,c))return eq(s,"normal",!1)})!==!1}});var mb=at(()=>{"use strict";var nq=Ls(),rq=gb(),iq=Nu();nq({target:"Set",proto:!0,real:!0,forced:!iq("isSupersetOf")},{isSupersetOf:rq})});var vb=at((Hj,yb)=>{"use strict";var oq=Iu(),H0=Zs(),sq=zp(),aq=Lu(),uq=Ru(),lq=H0.add,cq=H0.has,fq=H0.remove;yb.exports=function(t){var e=oq(this),o=aq(t).getIterator(),s=sq(e);return uq(o,function(c){cq(e,c)?fq(s,c):lq(s,c)}),s}});var _b=at(()=>{"use strict";var hq=Ls(),pq=vb(),dq=Nu();hq({target:"Set",proto:!0,real:!0,forced:!dq("symmetricDifference")},{symmetricDifference:pq})});var Eb=at((Xj,xb)=>{"use strict";var gq=Iu(),mq=Zs().add,yq=zp(),vq=Lu(),_q=Ru();xb.exports=function(t){var e=gq(this),o=vq(t).getIterator(),s=yq(e);return _q(o,function(c){mq(s,c)}),s}});var wb=at(()=>{"use strict";var xq=Ls(),Eq=Eb(),wq=Nu();xq({target:"Set",proto:!0,real:!0,forced:!wq("union")},{union:Eq})});var Mb=at((Zj,Sb)=>{"use strict";var Sq=ec(),Mq=mi();Sb.exports=function(n){if(Sq(n)==="Function")return Mq(n)}});var Tb=at((Jj,Ab)=>{"use strict";var bb=Mb(),bq=Nf(),Aq=Rf(),Tq=bb(bb.bind);Ab.exports=function(n,t){return bq(n),t===void 0?n:Aq?Tq(n,t):function(){return n.apply(t,arguments)}}});var Ib=at((Kj,Pb)=>{"use strict";var Cq=Up(),Pq=Of(),Iq=B0(),Rq=Tb(),Cb=function(n,t,e,o,s,c,h,p){for(var g=s,m=0,_=h?Rq(h,p):!1,w,x;m<o;)m in e&&(w=_?_(e[m],m,t):e[m],c>0&&Cq(w)?(x=Pq(w),g=Cb(n,t,w,x,g,c-1)-1):(Iq(g+1),n[g]=w),g++),m++;return g};Pb.exports=Cb});var Fb=at((jj,Db)=>{"use strict";var Lq=mi(),Nq=gi(),Rb=Di(),Oq=I0(),Dq=sc(),Fq=m0(),Lb=function(){},Nb=Dq("Reflect","construct"),V0=/^\\s*(?:class|function)\\b/,Uq=Lq(V0.exec),Bq=!V0.test(Lb),qf=function(t){if(!Rb(t))return!1;try{return Nb(Lb,[],t),!0}catch(e){return!1}},Ob=function(t){if(!Rb(t))return!1;switch(Oq(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Bq||!!Uq(V0,Fq(t))}catch(e){return!0}};Ob.sham=!0;Db.exports=!Nb||Nq(function(){var n;return qf(qf.call)||!qf(Object)||!qf(function(){n=!0})||n})?Ob:qf});var Gb=at((Qj,zb)=>{"use strict";var Ub=Up(),zq=Fb(),Gq=Ea(),kq=Is(),qq=kq("species"),Bb=Array;zb.exports=function(n){var t;return Ub(n)&&(t=n.constructor,zq(t)&&(t===Bb||Ub(t.prototype))?t=void 0:Gq(t)&&(t=t[qq],t===null&&(t=void 0))),t===void 0?Bb:t}});var qb=at((tQ,kb)=>{"use strict";var Hq=Gb();kb.exports=function(n,t){return new(Hq(n))(t===0?0:t)}});var Hb=at(()=>{"use strict";var Vq=Ls(),Wq=Ib(),Xq=ic(),Yq=Of(),$q=ml(),Zq=qb();Vq({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=Xq(this),o=Yq(e),s=Zq(e,0);return s.length=Wq(s,e,e,o,0,t===void 0?1:$q(t)),s}})});var Vb=at(()=>{"use strict";var Jq=a0();Jq("flat")});var Xb=at((oQ,Wb)=>{var W0=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)}};Wb.exports=W0});var Zb=at((sQ,$b)=>{function Yb(n,t){let e=new Map;for(let[o,s]of n)o!==t&&s instanceof Map?e.set(o,Yb(s,t)):o!==t&&e.set(o,s);return e}$b.exports=Yb});var jb=at((aQ,Kb)=>{function Kq(n){let t=Number(n);return!(isNaN(t)||t<=0)}function Jb(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,Jb(s));if(!Kq(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}Kb.exports=Jb});var eA=at((uQ,tA)=>{function Qb(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){Qb(t);return}if(typeof t!="number"||t<=0)throw new Error(\`Values must be numbers greater than 0. Found value \${t} at \${e}\`)})}tA.exports=Qb});var oA=at((lQ,iA)=>{var jq=Xb(),Qq=Zb(),nA=jb(),rA=eA(),X0=class{constructor(t){t instanceof Map?(rA(t),this.graph=t):t?this.graph=nA(t):this.graph=new Map}addNode(t,e){let o;return e instanceof Map?(rA(e),o=e):o=nA(e),this.graph.set(t,o),this}addVertex(t,e){return this.addNode(t,e)}removeNode(t){return this.graph=Qq(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 jq,h=new Map,p=[],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(;h.has(x);)p.push(x),x=h.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 h.set(b,_.key),c.set(b,_.priority+x);let P=c.get(b).priority,I=_.priority+x;return I<P?(h.set(b,_.key),c.set(b,I)):null})}return p.length?(o.trim?p.shift():p=p.concat([t]),o.reverse||(p=p.reverse()),o.cost?{path:p,cost:g}:p):o.cost?{path:null,cost:0}:null}shortestPath(...t){return this.path(...t)}};iA.exports=X0});var Ld=at((EQ,jT)=>{"use strict";var KT=Object.getOwnPropertySymbols,h9=Object.prototype.hasOwnProperty,p9=Object.prototype.propertyIsEnumerable;function d9(n){if(n==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function g9(){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}}jT.exports=g9()?Object.assign:function(n,t){for(var e,o=d9(n),s,c=1;c<arguments.length;c++){e=Object(arguments[c]);for(var h in e)h9.call(e,h)&&(o[h]=e[h]);if(KT){s=KT(e);for(var p=0;p<s.length;p++)p9.call(e,s[p])&&(o[s[p]]=e[s[p]])}}return o}});var Ev=at((_v,xv)=>{(function(n,t){typeof _v=="object"&&typeof xv!="undefined"?xv.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self).RBush=t()})(_v,function(){"use strict";function n(S,E,R,T,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,T||S.length-1,F||e)}function t(S,E,R){var T=S[E];S[E]=S[R],S[R]=T}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 T=0;T<E.length;T++)if(R(S,E[T]))return T;return-1}function c(S,E){h(S,0,S.children.length,E,S)}function h(S,E,R,T,F){F||(F=P(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];p(F,S.leaf?T(X):X)}return F}function p(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 P(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,T,F){for(var W=[E,R];W.length;)if(!((R=W.pop())-(E=W.pop())<=T)){var X=E+Math.ceil((R-E)/T/2)*T;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 T=this.toBBox,F=[];E;){for(var W=0;W<E.children.length;W++){var X=E.children[W],q=E.leaf?T(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 T=0;T<E.children.length;T++){var F=E.children[T],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 T=this.data;this.data=R,R=T}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=P([]),this},o.prototype.remove=function(S,E){if(!S)return this;for(var R,T,F,W=this.data,X=this.toBBox(S),q=[],D=[];W||q.length;){if(W||(W=q.pop(),T=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)?T?(R++,W=T.children[R],F=!1):W=null:(q.push(W),D.push(R),R=0,T=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,T){var F,W=R-E+1,X=this._maxEntries;if(W<=X)return c(F=P(S.slice(E,R+1)),this.toBBox),F;T||(T=Math.ceil(Math.log(W)/Math.log(X)),X=Math.ceil(W/Math.pow(X,T-1))),(F=P([])).leaf=!1,F.height=T;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,T-1))}}return c(F,this.toBBox),F},o.prototype._chooseSubtree=function(S,E,R,T){for(;T.push(E),!E.leaf&&T.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 T=R?S:this.toBBox(S),F=[],W=this._chooseSubtree(T,this.data,E,F);for(W.children.push(S),p(W,T);E>=0&&F[E].children.length>this._maxEntries;)this._split(F,E),E--;this._adjustParentBBoxes(T,F,E)},o.prototype._split=function(S,E){var R=S[E],T=R.children.length,F=this._minEntries;this._chooseSplitAxis(R,F,T);var W=this._chooseSplitIndex(R,F,T),X=P(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=P([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 T,F,W,X,q,D,xt,B=1/0,j=1/0,J=E;J<=R-E;J++){var Dt=h(S,0,J,this.toBBox),Q=h(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,T=J,j=Mt<j?Mt:j):At===B&&Mt<j&&(j=Mt,T=J)}return T||R-E},o.prototype._chooseSplitAxis=function(S,E,R){var T=S.leaf?this.compareMinX:g,F=S.leaf?this.compareMinY:m;this._allDistMargin(S,E,R,T)<this._allDistMargin(S,E,R,F)&&S.children.sort(T)},o.prototype._allDistMargin=function(S,E,R,T){S.children.sort(T);for(var F=this.toBBox,W=h(S,0,E,F),X=h(S,R-E,R,F),q=w(W)+w(X),D=E;D<R-E;D++){var xt=S.children[D];p(W,S.leaf?F(xt):xt),q+=w(W)}for(var B=R-E-1;B>=E;B--){var j=S.children[B];p(X,S.leaf?F(j):j),q+=w(X)}return q},o.prototype._adjustParentBBoxes=function(S,E,R){for(var T=R;T>=0;T--)p(E[T],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 QT=at((wv,Sv)=>{(function(n,t){typeof wv=="object"&&typeof Sv!="undefined"?Sv.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self,n.TinyQueue=t())})(wv,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,h=s.compare,p=c[o];o>0;){var g=o-1>>1,m=c[g];if(h(p,m)>=0)break;c[o]=m,o=g}c[o]=p},n.prototype._down=function(o){for(var s=this,c=s.data,h=s.compare,p=this.length>>1,g=c[o];o<p;){var m=(o<<1)+1,_=c[m],w=m+1;if(w<this.length&&h(c[w],_)<0&&(m=w,_=c[w]),h(_,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 eC=at((TQ,tC)=>{tC.exports=function(t,e,o,s){var c=t[0],h=t[1],p=!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],P=e[o+_*2+1],I=x>h!=P>h&&c<(b-w)*(h-x)/(P-x)+w;I&&(p=!p)}return p}});var rC=at((CQ,nC)=>{nC.exports=function(t,e,o,s){var c=t[0],h=t[1],p=!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],P=e[_+o][1],I=x>h!=P>h&&c<(b-w)*(h-x)/(P-x)+w;I&&(p=!p)}return p}});var sC=at((PQ,Dd)=>{var iC=eC(),oC=rC();Dd.exports=function(t,e,o,s){return e.length>0&&Array.isArray(e[0])?oC(t,e,o,s):iC(t,e,o,s)};Dd.exports.nested=oC;Dd.exports.flat=iC});var uC=at((Fd,aC)=>{(function(n,t){typeof Fd=="object"&&typeof aC!="undefined"?t(Fd):typeof define=="function"&&define.amd?define(["exports"],t):t((n=n||self).predicates={})})(Fd,function(n){"use strict";let e=33306690738754706e-32;function o(b,P,I,S,E){let R,T,F,W,X=P[0],q=S[0],D=0,xt=0;q>X==q>-X?(R=X,X=P[++D]):(R=q,q=S[++xt]);let B=0;if(D<b&&xt<I)for(q>X==q>-X?(F=R-((T=X+R)-X),X=P[++D]):(F=R-((T=q+R)-q),q=S[++xt]),R=T,F!==0&&(E[B++]=F);D<b&&xt<I;)q>X==q>-X?(F=R-((T=R+X)-(W=T-R))+(X-W),X=P[++D]):(F=R-((T=R+q)-(W=T-R))+(q-W),q=S[++xt]),R=T,F!==0&&(E[B++]=F);for(;D<b;)F=R-((T=R+X)-(W=T-R))+(X-W),X=P[++D],R=T,F!==0&&(E[B++]=F);for(;xt<I;)F=R-((T=R+q)-(W=T-R))+(q-W),q=S[++xt],R=T,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,h=22204460492503146e-32,p=11093356479670487e-47,g=s(4),m=s(8),_=s(12),w=s(16),x=s(4);n.orient2d=function(b,P,I,S,E,R){let T=(P-R)*(I-E),F=(b-E)*(S-R),W=T-F;if(T===0||F===0||T>0!=F>0)return W;let X=Math.abs(T+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=h*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=p*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,P,I,S,E,R,X)},n.orient2dfast=function(b,P,I,S,E,R){return(P-R)*(I-E)-(b-E)*(S-R)},Object.defineProperty(n,"__esModule",{value:!0})})});var dC=at((IQ,Tv)=>{"use strict";var lC=Ev(),Bd=QT(),y9=sC(),v9=uC().orient2d;Bd.default&&(Bd=Bd.default);Tv.exports=pC;Tv.exports.default=pC;function pC(n,t,e){t=Math.max(0,t===void 0?2:t),e=e||0;var o=S9(n),s=new lC(16);s.toBBox=function(R){return{minX:R[0],minY:R[1],maxX:R[0],maxY:R[1]}},s.compareMinX=function(R,T){return R[0]-T[0]},s.compareMinY=function(R,T){return R[1]-T[1]},s.load(n);for(var c=[],h=0,p;h<o.length;h++){var g=o[h];s.remove(g),p=hC(g,p),c.push(p)}var m=new lC(16);for(h=0;h<c.length;h++)m.insert(Mv(c[h]));for(var _=t*t,w=e*e;c.length;){var x=c.shift(),b=x.p,P=x.next.p,I=bv(b,P);if(!(I<w)){var S=I/_;g=_9(s,x.prev.p,b,P,x.next.next.p,S,m),g&&Math.min(bv(g,b),bv(g,P))<=S&&(c.push(x),c.push(hC(g,x)),s.remove(g),m.remove(x),m.insert(Mv(x)),m.insert(Mv(x.next)))}}x=p;var E=[];do E.push(x.p),x=x.next;while(x!==p);return E.push(x.p),E}function _9(n,t,e,o,s,c,h){for(var p=new Bd([],x9),g=n.data;g;){for(var m=0;m<g.children.length;m++){var _=g.children[m],w=g.leaf?Av(_,e,o):E9(e,o,_);w>c||p.push({node:_,dist:w})}for(;p.length&&!p.peek().node.children;){var x=p.pop(),b=x.node,P=Av(b,t,e),I=Av(b,o,s);if(x.dist<P&&x.dist<I&&fC(e,b,h)&&fC(o,b,h))return b}g=p.pop(),g&&(g=g.node)}return null}function x9(n,t){return n.dist-t.dist}function E9(n,t,e){if(cC(n,e)||cC(t,e))return 0;var o=Ud(n[0],n[1],t[0],t[1],e.minX,e.minY,e.maxX,e.minY);if(o===0)return 0;var s=Ud(n[0],n[1],t[0],t[1],e.minX,e.minY,e.minX,e.maxY);if(s===0)return 0;var c=Ud(n[0],n[1],t[0],t[1],e.maxX,e.minY,e.maxX,e.maxY);if(c===0)return 0;var h=Ud(n[0],n[1],t[0],t[1],e.minX,e.maxY,e.maxX,e.maxY);return h===0?0:Math.min(o,s,c,h)}function cC(n,t){return n[0]>=t.minX&&n[0]<=t.maxX&&n[1]>=t.minY&&n[1]<=t.maxY}function fC(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]),h=Math.max(n[1],t[1]),p=e.search({minX:o,minY:s,maxX:c,maxY:h}),g=0;g<p.length;g++)if(w9(p[g].p,p[g].next.p,n,t))return!1;return!0}function kc(n,t,e){return v9(n[0],n[1],t[0],t[1],e[0],e[1])}function w9(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 Mv(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 S9(n){for(var t=n[0],e=n[0],o=n[0],s=n[0],c=0;c<n.length;c++){var h=n[c];h[0]<t[0]&&(t=h),h[0]>o[0]&&(o=h),h[1]<e[1]&&(e=h),h[1]>s[1]&&(s=h)}var p=[t,e,o,s],g=p.slice();for(c=0;c<n.length;c++)y9(n[c],p)||g.push(n[c]);return b9(g)}function hC(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 bv(n,t){var e=n[0]-t[0],o=n[1]-t[1];return e*e+o*o}function Av(n,t,e){var o=t[0],s=t[1],c=e[0]-o,h=e[1]-s;if(c!==0||h!==0){var p=((n[0]-o)*c+(n[1]-s)*h)/(c*c+h*h);p>1?(o=e[0],s=e[1]):p>0&&(o+=c*p,s+=h*p)}return c=n[0]-o,h=n[1]-s,c*c+h*h}function Ud(n,t,e,o,s,c,h,p){var g=e-n,m=o-t,_=h-s,w=p-c,x=n-s,b=t-c,P=g*g+m*m,I=g*_+m*w,S=_*_+w*w,E=g*x+m*b,R=_*x+w*b,T=P*S-I*I,F,W,X,q,D=T,xt=T;T===0?(W=0,D=1,q=R,xt=S):(W=I*R-S*E,q=P*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>P?W=D:(W=-E,D=P)):q>xt&&(q=xt,-E+I<0?W=0:-E+I>P?W=D:(W=-E+I,D=P)),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*h,Dt=(1-X)*c+X*p,Q=J-B,At=Dt-j;return Q*Q+At*At}function M9(n,t){return n[0]===t[0]?n[1]-t[1]:n[0]-t[0]}function b9(n){n.sort(M9);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 xC=at((Pv,Iv)=>{(function(n,t){typeof Pv=="object"&&typeof Iv!="undefined"?Iv.exports=t():typeof define=="function"&&define.amd?define(t):n.quickselect=t()})(Pv,function(){"use strict";function n(s,c,h,p,g){t(s,c,h||0,p||s.length-1,g||o)}function t(s,c,h,p,g){for(;p>h;){if(p-h>600){var m=p-h+1,_=c-h+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),P=Math.max(h,Math.floor(c-_*x/m+b)),I=Math.min(p,Math.floor(c+(m-_)*x/m+b));t(s,c,P,I,g)}var S=s[c],E=h,R=p;for(e(s,h,c),g(s[p],S)>0&&e(s,h,p);E<R;){for(e(s,E,R),E++,R--;g(s[E],S)<0;)E++;for(;g(s[R],S)>0;)R--}g(s[h],S)===0?e(s,h,R):(R++,e(s,R,p)),R<=c&&(h=R+1),c<=R&&(p=R-1)}}function e(s,c,h){var p=s[c];s[c]=s[h],s[h]=p}function o(s,c){return s<c?-1:s>c?1:0}return n})});var Ov=at((int,Nv)=>{"use strict";Nv.exports=rh;Nv.exports.default=rh;var B9=xC();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(!Gd(n,t))return e;for(var s=[],c,h,p,g;t;){for(c=0,h=t.children.length;c<h;c++)p=t.children[c],g=t.leaf?o(p):p,Gd(n,g)&&(t.leaf?e.push(p):Lv(n,g)?this._all(p,e):s.push(p));t=s.pop()}return e},collides:function(n){var t=this.data,e=this.toBBox;if(!Gd(n,t))return!1;for(var o=[],s,c,h,p;t;){for(s=0,c=t.children.length;s<c;s++)if(h=t.children[s],p=t.leaf?e(h):h,Gd(n,p)){if(t.leaf||Lv(n,p))return!0;o.push(h)}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=[],h,p,g,m;e||s.length;){if(e||(e=s.pop(),p=s[s.length-1],h=c.pop(),m=!0),e.leaf&&(g=z9(n,e.children,t),g!==-1))return e.children.splice(g,1),s.push(e),this._condense(s),this;!m&&!e.leaf&&Lv(e,o)?(s.push(e),c.push(h),h=0,p=e,e=e.children[0]):p?(h++,e=p.children[h],m=!1):e=null}return this},toBBox:function(n){return n},compareMinX:EC,compareMinY:wC,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,h;if(s<=c)return h=Vc(n.slice(t,e+1)),Hc(h,this.toBBox),h;o||(o=Math.ceil(Math.log(s)/Math.log(c)),c=Math.ceil(s/Math.pow(c,o-1))),h=Vc([]),h.leaf=!1,h.height=o;var p=Math.ceil(s/c),g=p*Math.ceil(Math.sqrt(c)),m,_,w,x;for(SC(n,t,e,g,this.compareMinX),m=t;m<=e;m+=g)for(w=Math.min(m+g-1,e),SC(n,m,w,p,this.compareMinY),_=m;_<=w;_+=p)x=Math.min(_+p-1,w),h.children.push(this._build(n,_,x,o-1));return Hc(h,this.toBBox),h},_chooseSubtree:function(n,t,e,o){for(var s,c,h,p,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++)h=t.children[s],g=Rv(h),m=G9(n,h)-g,m<w?(w=m,_=g<_?g:_,p=h):m===w&&g<_&&(_=g,p=h);t=p||t.children[0]}return t},_insert:function(n,t,e){var o=this.toBBox,s=e?n:o(n),c=[],h=this._chooseSubtree(s,this.data,t,c);for(h.children.push(n),nh(h,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),h=Vc(e.children.splice(c,e.children.length-c));h.height=e.height,h.leaf=e.leaf,Hc(e,this.toBBox),Hc(h,this.toBBox),t?n[t-1].children.push(h):this._splitRoot(e,h)},_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,h,p,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),h=k9(s,c),p=Rv(s)+Rv(c),h<g?(g=h,_=o,m=p<m?p:m):h===g&&p<m&&(m=p,_=o);return _},_chooseSplitAxis:function(n,t,e){var o=n.leaf?this.compareMinX:EC,s=n.leaf?this.compareMinY:wC,c=this._allDistMargin(n,t,e,o),h=this._allDistMargin(n,t,e,s);c<h&&n.children.sort(o)},_allDistMargin:function(n,t,e,o){n.children.sort(o);var s=this.toBBox,c=eh(n,0,t,s),h=eh(n,e-t,e,s),p=zd(c)+zd(h),g,m;for(g=t;g<e-t;g++)m=n.children[g],nh(c,n.leaf?s(m):m),p+=zd(c);for(g=e-t-1;g>=t;g--)m=n.children[g],nh(h,n.leaf?s(m):m),p+=zd(h);return p},_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 z9(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,h;c<e;c++)h=n.children[c],nh(s,n.leaf?o(h):h);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 EC(n,t){return n.minX-t.minX}function wC(n,t){return n.minY-t.minY}function Rv(n){return(n.maxX-n.minX)*(n.maxY-n.minY)}function zd(n){return n.maxX-n.minX+(n.maxY-n.minY)}function G9(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 k9(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 Lv(n,t){return n.minX<=t.minX&&n.minY<=t.minY&&t.maxX<=n.maxX&&t.maxY<=n.maxY}function Gd(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 SC(n,t,e,o,s){for(var c=[t,e],h;c.length;)e=c.pop(),t=c.pop(),!(e-t<=o)&&(h=t+Math.ceil((e-t)/o/2)*o,B9(n,h,t,e,s),c.push(t,h,h,e))}});var PC=at((yrt,Gv)=>{"use strict";Gv.exports=Vd;Gv.exports.default=Vd;function Vd(n,t,e){e=e||2;var o=t&&t.length,s=o?t[0]*e:n.length,c=AC(n,0,s,e,!0),h=[];if(!c||c.next===c.prev)return h;var p,g,m,_,w,x,b;if(o&&(c=K9(n,t,c,e)),n.length>80*e){p=m=n[0],g=_=n[1];for(var P=e;P<s;P+=e)w=n[P],x=n[P+1],w<p&&(p=w),x<g&&(g=x),w>m&&(m=w),x>_&&(_=x);b=Math.max(m-p,_-g),b=b!==0?32767/b:0}return sh(c,h,e,p,g,b,0),h}function AC(n,t,e,o,s){var c,h;if(s===zv(n,t,e,o)>0)for(c=t;c<e;c+=o)h=bC(c,n[c],n[c+1],h);else for(c=e-o;c>=t;c-=o)h=bC(c,n[c],n[c+1],h);return h&&Wd(h,h.next)&&(uh(h),h=h.next),h}function Dl(n,t){if(!n)return n;t||(t=n);var e=n,o;do if(o=!1,!e.steiner&&(Wd(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,h){if(n){!h&&c&&nX(n,o,s,c);for(var p=n,g,m;n.prev!==n.next;){if(g=n.prev,m=n.next,c?$9(n,o,s,c):Y9(n)){t.push(g.i/e|0),t.push(n.i/e|0),t.push(m.i/e|0),uh(n),n=m.next,p=m.next;continue}if(n=m,n===p){h?h===1?(n=Z9(Dl(n),t,e),sh(n,t,e,o,s,c,2)):h===2&&J9(n,t,e,o,s,c):sh(Dl(n),t,e,o,s,c,1);break}}}}function Y9(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,h=o.x,p=t.y,g=e.y,m=o.y,_=s<c?s<h?s:h:c<h?c:h,w=p<g?p<m?p:m:g<m?g:m,x=s>c?s>h?s:h:c>h?c:h,b=p>g?p>m?p:m:g>m?g:m,P=o.next;P!==t;){if(P.x>=_&&P.x<=x&&P.y>=w&&P.y<=b&&Yc(s,p,c,g,h,m,P.x,P.y)&&qr(P.prev,P,P.next)>=0)return!1;P=P.next}return!0}function $9(n,t,e,o){var s=n.prev,c=n,h=n.next;if(qr(s,c,h)>=0)return!1;for(var p=s.x,g=c.x,m=h.x,_=s.y,w=c.y,x=h.y,b=p<g?p<m?p:m:g<m?g:m,P=_<w?_<x?_:x:w<x?w:x,I=p>g?p>m?p:m:g>m?g:m,S=_>w?_>x?_:x:w>x?w:x,E=Uv(b,P,t,e,o),R=Uv(I,S,t,e,o),T=n.prevZ,F=n.nextZ;T&&T.z>=E&&F&&F.z<=R;){if(T.x>=b&&T.x<=I&&T.y>=P&&T.y<=S&&T!==s&&T!==h&&Yc(p,_,g,w,m,x,T.x,T.y)&&qr(T.prev,T,T.next)>=0||(T=T.prevZ,F.x>=b&&F.x<=I&&F.y>=P&&F.y<=S&&F!==s&&F!==h&&Yc(p,_,g,w,m,x,F.x,F.y)&&qr(F.prev,F,F.next)>=0))return!1;F=F.nextZ}for(;T&&T.z>=E;){if(T.x>=b&&T.x<=I&&T.y>=P&&T.y<=S&&T!==s&&T!==h&&Yc(p,_,g,w,m,x,T.x,T.y)&&qr(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;F&&F.z<=R;){if(F.x>=b&&F.x<=I&&F.y>=P&&F.y<=S&&F!==s&&F!==h&&Yc(p,_,g,w,m,x,F.x,F.y)&&qr(F.prev,F,F.next)>=0)return!1;F=F.nextZ}return!0}function Z9(n,t,e){var o=n;do{var s=o.prev,c=o.next.next;!Wd(s,c)&&TC(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 J9(n,t,e,o,s,c){var h=n;do{for(var p=h.next.next;p!==h.prev;){if(h.i!==p.i&&oX(h,p)){var g=CC(h,p);h=Dl(h,h.next),g=Dl(g,g.next),sh(h,t,e,o,s,c,0),sh(g,t,e,o,s,c,0);return}p=p.next}h=h.next}while(h!==n)}function K9(n,t,e,o){var s=[],c,h,p,g,m;for(c=0,h=t.length;c<h;c++)p=t[c]*o,g=c<h-1?t[c+1]*o:n.length,m=AC(n,p,g,o,!1),m===m.next&&(m.steiner=!0),s.push(iX(m));for(s.sort(j9),c=0;c<s.length;c++)e=Q9(s[c],e);return e}function j9(n,t){return n.x-t.x}function Q9(n,t){var e=tX(n,t);if(!e)return t;var o=CC(e,n);return Dl(o,o.next),Dl(e,e.next)}function tX(n,t){var e=t,o=n.x,s=n.y,c=-1/0,h;do{if(s<=e.y&&s>=e.next.y&&e.next.y!==e.y){var p=e.x+(s-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(p<=o&&p>c&&(c=p,h=e.x<e.next.x?e:e.next,p===o))return h}e=e.next}while(e!==t);if(!h)return null;var g=h,m=h.x,_=h.y,w=1/0,x;e=h;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>h.x||e.x===h.x&&eX(h,e)))&&(h=e,w=x)),e=e.next;while(e!==g);return h}function eX(n,t){return qr(n.prev,n,t.prev)<0&&qr(t.next,n,n.next)<0}function nX(n,t,e,o){var s=n;do s.z===0&&(s.z=Uv(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,rX(s)}function rX(n){var t,e,o,s,c,h,p,g,m=1;do{for(e=n,n=null,c=null,h=0;e;){for(h++,o=e,p=0,t=0;t<m&&(p++,o=o.nextZ,!!o);t++);for(g=m;p>0||g>0&&o;)p!==0&&(g===0||!o||e.z<=o.z)?(s=e,e=e.nextZ,p--):(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(h>1);return n}function Uv(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 iX(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,h,p){return(s-h)*(t-p)>=(n-h)*(c-p)&&(n-h)*(o-p)>=(e-h)*(t-p)&&(e-h)*(c-p)>=(s-h)*(o-p)}function oX(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!sX(n,t)&&(ah(n,t)&&ah(t,n)&&aX(n,t)&&(qr(n.prev,n,t.prev)||qr(n,t.prev,t))||Wd(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 Wd(n,t){return n.x===t.x&&n.y===t.y}function TC(n,t,e,o){var s=Hd(qr(n,t,e)),c=Hd(qr(n,t,o)),h=Hd(qr(e,o,n)),p=Hd(qr(e,o,t));return!!(s!==c&&h!==p||s===0&&qd(n,e,t)||c===0&&qd(n,o,t)||h===0&&qd(e,n,o)||p===0&&qd(e,t,o))}function qd(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 Hd(n){return n>0?1:n<0?-1:0}function sX(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&&TC(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 aX(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 CC(n,t){var e=new Bv(n.i,n.x,n.y),o=new Bv(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 bC(n,t,e,o){var s=new Bv(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 Bv(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}Vd.deviation=function(n,t,e,o){var s=t&&t.length,c=s?t[0]*e:n.length,h=Math.abs(zv(n,0,c,e));if(s)for(var p=0,g=t.length;p<g;p++){var m=t[p]*e,_=p<g-1?t[p+1]*e:n.length;h-=Math.abs(zv(n,m,_,e))}var w=0;for(p=0;p<o.length;p+=3){var x=o[p]*e,b=o[p+1]*e,P=o[p+2]*e;w+=Math.abs((n[x]-n[P])*(n[b+1]-n[x+1])-(n[x]-n[b])*(n[P+1]-n[x+1]))}return h===0&&w===0?0:Math.abs((w-h)/h)};function zv(n,t,e,o){for(var s=0,c=t,h=e-o;c<e;c+=o)s+=(n[h]-n[c])*(n[c+1]+n[h+1]),h=c;return s}Vd.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 h=0;h<t;h++)e.vertices.push(n[s][c][h]);s>0&&(o+=n[s-1].length,e.holes.push(o))}return e}});var Wv=at(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 Ju(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=Ju;function lX(n,t,e){switch(e===void 0&&(e={}),n){case"Point":return kv(t).geometry;case"LineString":return Hv(t).geometry;case"Polygon":return qv(t).geometry;case"MultiPoint":return RC(t).geometry;case"MultiLineString":return IC(t).geometry;case"MultiPolygon":return LC(t).geometry;default:throw new Error(n+" is invalid")}}Oe.geometry=lX;function kv(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(!Xd(n[0])||!Xd(n[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:n};return Ju(o,t,e)}Oe.point=kv;function cX(n,t,e){return e===void 0&&(e={}),Yd(n.map(function(o){return kv(o,t)}),e)}Oe.points=cX;function qv(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 h=0;h<c[c.length-1].length;h++)if(c[c.length-1][h]!==c[0][h])throw new Error("First and last Position are not equivalent.")}var p={type:"Polygon",coordinates:n};return Ju(p,t,e)}Oe.polygon=qv;function fX(n,t,e){return e===void 0&&(e={}),Yd(n.map(function(o){return qv(o,t)}),e)}Oe.polygons=fX;function Hv(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 Ju(o,t,e)}Oe.lineString=Hv;function hX(n,t,e){return e===void 0&&(e={}),Yd(n.map(function(o){return Hv(o,t)}),e)}Oe.lineStrings=hX;function Yd(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=Yd;function IC(n,t,e){e===void 0&&(e={});var o={type:"MultiLineString",coordinates:n};return Ju(o,t,e)}Oe.multiLineString=IC;function RC(n,t,e){e===void 0&&(e={});var o={type:"MultiPoint",coordinates:n};return Ju(o,t,e)}Oe.multiPoint=RC;function LC(n,t,e){e===void 0&&(e={});var o={type:"MultiPolygon",coordinates:n};return Ju(o,t,e)}Oe.multiPolygon=LC;function pX(n,t,e){e===void 0&&(e={});var o={type:"GeometryCollection",geometries:n};return Ju(o,t,e)}Oe.geometryCollection=pX;function dX(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=dX;function NC(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=NC;function Vv(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=Vv;function gX(n,t){return OC(Vv(n,t))}Oe.lengthToDegrees=gX;function mX(n){var t=n%360;return t<0&&(t+=360),t}Oe.bearingToAzimuth=mX;function OC(n){var t=n%(2*Math.PI);return t*180/Math.PI}Oe.radiansToDegrees=OC;function yX(n){var t=n%360;return t*Math.PI/180}Oe.degreesToRadians=yX;function vX(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 NC(Vv(n,t),e)}Oe.convertLength=vX;function _X(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=_X;function Xd(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}Oe.isNumber=Xd;function xX(n){return!!n&&n.constructor===Object}Oe.isObject=xX;function EX(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(!Xd(t))throw new Error("bbox must only contain numbers")})}Oe.validateBBox=EX;function wX(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=wX});var Yv=at(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});var lo=Wv();function lh(n,t,e){if(n!==null)for(var o,s,c,h,p,g,m,_=0,w=0,x,b=n.type,P=b==="FeatureCollection",I=b==="Feature",S=P?n.features.length:1,E=0;E<S;E++){m=P?n.features[E].geometry:I?n.geometry:n,x=m?m.type==="GeometryCollection":!1,p=x?m.geometries.length:1;for(var R=0;R<p;R++){var T=0,F=0;if(h=x?m.geometries[R]:m,h!==null){g=h.coordinates;var W=h.type;switch(_=e&&(W==="Polygon"||W==="MultiPolygon")?1:0,W){case null:break;case"Point":if(t(g,w,E,T,F)===!1)return!1;w++,T++;break;case"LineString":case"MultiPoint":for(o=0;o<g.length;o++){if(t(g[o],w,E,T,F)===!1)return!1;w++,W==="MultiPoint"&&T++}W==="LineString"&&T++;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,T,F)===!1)return!1;w++}W==="MultiLineString"&&T++,W==="Polygon"&&F++}W==="Polygon"&&T++;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,T,F)===!1)return!1;w++}F++}T++}break;case"GeometryCollection":for(o=0;o<h.geometries.length;o++)if(lh(h.geometries[o],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function SX(n,t,e,o){var s=e;return lh(n,function(c,h,p,g,m){h===0&&e===void 0?s=c:s=t(s,c,h,p,g,m)},o),s}function DC(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 MX(n,t,e){var o=e;return DC(n,function(s,c){c===0&&e===void 0?o=s:o=t(o,s,c)}),o}function FC(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 bX(n,t,e){var o=e;return FC(n,function(s,c){c===0&&e===void 0?o=s:o=t(o,s,c)}),o}function AX(n){var t=[];return lh(n,function(e){t.push(e)}),t}function Xv(n,t){var e,o,s,c,h,p,g,m,_,w,x=0,b=n.type==="FeatureCollection",P=n.type==="Feature",I=b?n.features.length:1;for(e=0;e<I;e++){for(p=b?n.features[e].geometry:P?n.geometry:n,m=b?n.features[e].properties:P?n.properties:{},_=b?n.features[e].bbox:P?n.bbox:void 0,w=b?n.features[e].id:P?n.id:void 0,g=p?p.type==="GeometryCollection":!1,h=g?p.geometries.length:1,s=0;s<h;s++){if(c=g?p.geometries[s]:p,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 TX(n,t,e){var o=e;return Xv(n,function(s,c,h,p,g){c===0&&e===void 0?o=s:o=t(o,s,c,h,p,g)}),o}function $d(n,t){Xv(n,function(e,o,s,c,h){var p=e===null?null:e.type;switch(p){case null:case"Point":case"LineString":case"Polygon":return t(lo.feature(e,s,{bbox:c,id:h}),o,0)===!1?!1:void 0}var g;switch(p){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 CX(n,t,e){var o=e;return $d(n,function(s,c,h){c===0&&h===0&&e===void 0?o=s:o=t(o,s,c,h)}),o}function UC(n,t){$d(n,function(e,o,s){var c=0;if(e.geometry){var h=e.geometry.type;if(!(h==="Point"||h==="MultiPoint")){var p,g=0,m=0,_=0;if(lh(e,function(w,x,b,P,I){if(p===void 0||o>g||P>m||I>_){p=w,g=o,m=P,_=I,c=0;return}var S=lo.lineString([p,w],e.properties);if(t(S,o,s,I,c)===!1)return!1;c++,p=w})===!1)return!1}}})}function PX(n,t,e){var o=e,s=!1;return UC(n,function(c,h,p,g,m){s===!1&&e===void 0?o=c:o=t(o,c,h,p,g,m),s=!0}),o}function BC(n,t){if(!n)throw new Error("geojson is required");$d(n,function(e,o,s){if(e.geometry!==null){var c=e.geometry.type,h=e.geometry.coordinates;switch(c){case"LineString":if(t(e,o,s,0,0)===!1)return!1;break;case"Polygon":for(var p=0;p<h.length;p++)if(t(lo.lineString(h[p],e.properties),o,s,p)===!1)return!1;break}}})}function IX(n,t,e){var o=e;return BC(n,function(s,c,h,p){c===0&&e===void 0?o=s:o=t(o,s,c,h,p)}),o}function RX(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,h=t.properties,p;switch(n.type){case"FeatureCollection":e<0&&(e=n.features.length+e),h=h||n.features[e].properties,p=n.features[e].geometry;break;case"Feature":h=h||n.properties,p=n.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":p=n;break;default:throw new Error("geojson is invalid")}if(p===null)return null;var g=p.coordinates;switch(p.type){case"Point":case"MultiPoint":return null;case"LineString":return c<0&&(c=g.length+c-1),lo.lineString([g[c],g[c+1]],h,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]],h,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]],h,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]],h,t)}throw new Error("geojson is invalid")}function LX(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,h=t.properties,p;switch(n.type){case"FeatureCollection":e<0&&(e=n.features.length+e),h=h||n.features[e].properties,p=n.features[e].geometry;break;case"Feature":h=h||n.properties,p=n.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":p=n;break;default:throw new Error("geojson is invalid")}if(p===null)return null;var g=p.coordinates;switch(p.type){case"Point":return lo.point(g,h,t);case"MultiPoint":return o<0&&(o=g.length+o),lo.point(g[o],h,t);case"LineString":return c<0&&(c=g.length+c),lo.point(g[c],h,t);case"Polygon":return s<0&&(s=g.length+s),c<0&&(c=g[s].length+c),lo.point(g[s][c],h,t);case"MultiLineString":return o<0&&(o=g.length+o),c<0&&(c=g[o].length+c),lo.point(g[o][c],h,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],h,t)}throw new Error("geojson is invalid")}Ei.coordAll=AX;Ei.coordEach=lh;Ei.coordReduce=SX;Ei.featureEach=FC;Ei.featureReduce=bX;Ei.findPoint=LX;Ei.findSegment=RX;Ei.flattenEach=$d;Ei.flattenReduce=CX;Ei.geomEach=Xv;Ei.geomReduce=TX;Ei.lineEach=BC;Ei.lineReduce=IX;Ei.propEach=DC;Ei.propReduce=MX;Ei.segmentEach=UC;Ei.segmentReduce=PX});var zC=at(Zv=>{"use strict";Object.defineProperty(Zv,"__esModule",{value:!0});var NX=Yv();function $v(n){var t=[1/0,1/0,-1/0,-1/0];return NX.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}$v.default=$v;Zv.default=$v});var Zd=at((Nrt,Jv)=>{var Pa=Ev(),kC=Wv(),qC=Yv(),$c=zC().default,OX=qC.featureEach,Rrt=qC.coordEach,Lrt=kC.polygon,GC=kC.featureCollection;function HC(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)}):OX(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 GC(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 GC(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}Jv.exports=HC;Jv.exports.default=HC});var n_=at((qot,QC)=>{"use strict";var jC=Object.prototype.toString;QC.exports=function(t){var e=jC.call(t),o=e==="[object Arguments]";return o||(o=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&jC.call(t.callee)==="[object Function]"),o}});var uP=at((Hot,aP)=>{"use strict";var sP;Object.keys||(hh=Object.prototype.hasOwnProperty,r_=Object.prototype.toString,tP=n_(),i_=Object.prototype.propertyIsEnumerable,eP=!i_.call({toString:null},"toString"),nP=i_.call(function(){},"prototype"),ph=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],tg=function(n){var t=n.constructor;return t&&t.prototype===n},rP={$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},iP=function(){if(typeof window=="undefined")return!1;for(var n in window)try{if(!rP["$"+n]&&hh.call(window,n)&&window[n]!==null&&typeof window[n]=="object")try{tg(window[n])}catch(t){return!0}}catch(t){return!0}return!1}(),oP=function(n){if(typeof window=="undefined"||!iP)return tg(n);try{return tg(n)}catch(t){return!1}},sP=function(t){var e=t!==null&&typeof t=="object",o=r_.call(t)==="[object Function]",s=tP(t),c=e&&r_.call(t)==="[object String]",h=[];if(!e&&!o&&!s)throw new TypeError("Object.keys called on a non-object");var p=nP&&o;if(c&&t.length>0&&!hh.call(t,0))for(var g=0;g<t.length;++g)h.push(String(g));if(s&&t.length>0)for(var m=0;m<t.length;++m)h.push(String(m));else for(var _ in t)!(p&&_==="prototype")&&hh.call(t,_)&&h.push(String(_));if(eP)for(var w=oP(t),x=0;x<ph.length;++x)!(w&&ph[x]==="constructor")&&hh.call(t,ph[x])&&h.push(ph[x]);return h});var hh,r_,tP,i_,eP,nP,ph,tg,rP,iP,oP;aP.exports=sP});var o_=at((Vot,fP)=>{"use strict";var VX=Array.prototype.slice,WX=n_(),lP=Object.keys,eg=lP?function(t){return lP(t)}:uP(),cP=Object.keys;eg.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 WX(o)?cP(VX.call(o)):cP(o)})}else Object.keys=eg;return Object.keys||eg};fP.exports=eg});var s_=at((Wot,hP)=>{"use strict";hP.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(e in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var h=Object.getOwnPropertyDescriptor(t,e);if(h.value!==s||h.enumerable!==!0)return!1}return!0}});var ng=at((Xot,pP)=>{"use strict";var XX=s_();pP.exports=function(){return XX()&&!!Symbol.toStringTag}});var gP=at((Yot,dP)=>{"use strict";dP.exports=Error});var yP=at(($ot,mP)=>{"use strict";mP.exports=EvalError});var _P=at((Zot,vP)=>{"use strict";vP.exports=RangeError});var EP=at((Jot,xP)=>{"use strict";xP.exports=ReferenceError});var a_=at((Kot,wP)=>{"use strict";wP.exports=SyntaxError});var Fl=at((jot,SP)=>{"use strict";SP.exports=TypeError});var bP=at((Qot,MP)=>{"use strict";MP.exports=URIError});var CP=at((tst,TP)=>{"use strict";var AP=typeof Symbol!="undefined"&&Symbol,YX=s_();TP.exports=function(){return typeof AP!="function"||typeof Symbol!="function"||typeof AP("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:YX()}});var IP=at((est,PP)=>{"use strict";var u_={__proto__:null,foo:{}},$X=Object;PP.exports=function(){return{__proto__:u_}.foo===u_.foo&&!(u_ instanceof $X)}});var NP=at((nst,LP)=>{"use strict";var ZX="Function.prototype.bind called on incompatible ",JX=Object.prototype.toString,KX=Math.max,jX="[object Function]",RP=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},QX=function(t,e){for(var o=[],s=e||0,c=0;s<t.length;s+=1,c+=1)o[c]=t[s];return o},t7=function(n,t){for(var e="",o=0;o<n.length;o+=1)e+=n[o],o+1<n.length&&(e+=t);return e};LP.exports=function(t){var e=this;if(typeof e!="function"||JX.apply(e)!==jX)throw new TypeError(ZX+e);for(var o=QX(arguments,1),s,c=function(){if(this instanceof s){var _=e.apply(this,RP(o,arguments));return Object(_)===_?_:this}return e.apply(t,RP(o,arguments))},h=KX(0,e.length-o.length),p=[],g=0;g<h;g++)p[g]="$"+g;if(s=Function("binder","return function ("+t7(p,",")+"){ 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 rg=at((rst,OP)=>{"use strict";var e7=NP();OP.exports=Function.prototype.bind||e7});var FP=at((ist,DP)=>{"use strict";var n7=Function.prototype.call,r7=Object.prototype.hasOwnProperty,i7=rg();DP.exports=i7.call(n7,r7)});var Qc=at((ost,kP)=>{"use strict";var Vn,o7=gP(),s7=yP(),a7=_P(),u7=EP(),jc=a_(),Kc=Fl(),l7=bP(),GP=Function,l_=function(n){try{return GP('"use strict"; return ('+n+").constructor;")()}catch(t){}},Ul=Object.getOwnPropertyDescriptor;if(Ul)try{Ul({},"")}catch(n){Ul=null}var c_=function(){throw new Kc},c7=Ul?function(){try{return arguments.callee,c_}catch(n){try{return Ul(arguments,"callee").get}catch(t){return c_}}}():c_,Zc=CP()(),f7=IP()(),ki=Object.getPrototypeOf||(f7?function(n){return n.__proto__}:null),Jc={},h7=typeof Uint8Array=="undefined"||!ki?Vn:ki(Uint8Array),Bl={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?Vn:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?Vn:ArrayBuffer,"%ArrayIteratorPrototype%":Zc&&ki?ki([][Symbol.iterator]()):Vn,"%AsyncFromSyncIteratorPrototype%":Vn,"%AsyncFunction%":Jc,"%AsyncGenerator%":Jc,"%AsyncGeneratorFunction%":Jc,"%AsyncIteratorPrototype%":Jc,"%Atomics%":typeof Atomics=="undefined"?Vn:Atomics,"%BigInt%":typeof BigInt=="undefined"?Vn:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?Vn:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?Vn:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?Vn:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o7,"%eval%":eval,"%EvalError%":s7,"%Float32Array%":typeof Float32Array=="undefined"?Vn:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?Vn:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?Vn:FinalizationRegistry,"%Function%":GP,"%GeneratorFunction%":Jc,"%Int8Array%":typeof Int8Array=="undefined"?Vn:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?Vn:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?Vn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Zc&&ki?ki(ki([][Symbol.iterator]())):Vn,"%JSON%":typeof JSON=="object"?JSON:Vn,"%Map%":typeof Map=="undefined"?Vn:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!Zc||!ki?Vn:ki(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?Vn:Promise,"%Proxy%":typeof Proxy=="undefined"?Vn:Proxy,"%RangeError%":a7,"%ReferenceError%":u7,"%Reflect%":typeof Reflect=="undefined"?Vn:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?Vn:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!Zc||!ki?Vn:ki(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?Vn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Zc&&ki?ki(""[Symbol.iterator]()):Vn,"%Symbol%":Zc?Symbol:Vn,"%SyntaxError%":jc,"%ThrowTypeError%":c7,"%TypedArray%":h7,"%TypeError%":Kc,"%Uint8Array%":typeof Uint8Array=="undefined"?Vn:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?Vn:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?Vn:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?Vn:Uint32Array,"%URIError%":l7,"%WeakMap%":typeof WeakMap=="undefined"?Vn:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?Vn:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?Vn:WeakSet};if(ki)try{null.error}catch(n){UP=ki(ki(n)),Bl["%Error.prototype%"]=UP}var UP,p7=function n(t){var e;if(t==="%AsyncFunction%")e=l_("async function () {}");else if(t==="%GeneratorFunction%")e=l_("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=l_("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},BP={__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"]},dh=rg(),ig=FP(),d7=dh.call(Function.call,Array.prototype.concat),g7=dh.call(Function.apply,Array.prototype.splice),zP=dh.call(Function.call,String.prototype.replace),og=dh.call(Function.call,String.prototype.slice),m7=dh.call(Function.call,RegExp.prototype.exec),y7=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,v7=/\\\\(\\\\)?/g,_7=function(t){var e=og(t,0,1),o=og(t,-1);if(e==="%"&&o!=="%")throw new jc("invalid intrinsic syntax, expected closing \`%\`");if(o==="%"&&e!=="%")throw new jc("invalid intrinsic syntax, expected opening \`%\`");var s=[];return zP(t,y7,function(c,h,p,g){s[s.length]=p?zP(g,v7,"$1"):h||c}),s},x7=function(t,e){var o=t,s;if(ig(BP,o)&&(s=BP[o],o="%"+s[0]+"%"),ig(Bl,o)){var c=Bl[o];if(c===Jc&&(c=p7(o)),typeof c=="undefined"&&!e)throw new Kc("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:s,name:o,value:c}}throw new jc("intrinsic "+t+" does not exist!")};kP.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new Kc("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Kc('"allowMissing" argument must be a boolean');if(m7(/^%?[^%]*%?$/,t)===null)throw new jc("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var o=_7(t),s=o.length>0?o[0]:"",c=x7("%"+s+"%",e),h=c.name,p=c.value,g=!1,m=c.alias;m&&(s=m[0],g7(o,d7([0,1],m)));for(var _=1,w=!0;_<o.length;_+=1){var x=o[_],b=og(x,0,1),P=og(x,-1);if((b==='"'||b==="'"||b==="\`"||P==='"'||P==="'"||P==="\`")&&b!==P)throw new jc("property names with quotes must have matching quotes");if((x==="constructor"||!w)&&(g=!0),s+="."+x,h="%"+s+"%",ig(Bl,h))p=Bl[h];else if(p!=null){if(!(x in p)){if(!e)throw new Kc("base intrinsic for "+t+" exists, but the property is not available.");return}if(Ul&&_+1>=o.length){var I=Ul(p,x);w=!!I,w&&"get"in I&&!("originalValue"in I.get)?p=I.get:p=p[x]}else w=ig(p,x),p=p[x];w&&!g&&(Bl[h]=p)}}return p}});var ag=at((sst,qP)=>{"use strict";var E7=Qc(),sg=E7("%Object.defineProperty%",!0)||!1;if(sg)try{sg({},"a",{value:1})}catch(n){sg=!1}qP.exports=sg});var f_=at((ast,HP)=>{"use strict";var w7=Qc(),ug=w7("%Object.getOwnPropertyDescriptor%",!0);if(ug)try{ug([],"length")}catch(n){ug=null}HP.exports=ug});var lg=at((ust,XP)=>{"use strict";var VP=ag(),S7=a_(),tf=Fl(),WP=f_();XP.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,h=arguments.length>5?arguments[5]:null,p=arguments.length>6?arguments[6]:!1,g=!!WP&&WP(t,e);if(VP)VP(t,e,{configurable:h===null&&g?g.configurable:!h,enumerable:s===null&&g?g.enumerable:!s,value:o,writable:c===null&&g?g.writable:!c});else if(p||!s&&!c&&!h)t[e]=o;else throw new S7("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var cg=at((lst,$P)=>{"use strict";var h_=ag(),YP=function(){return!!h_};YP.hasArrayLengthDefineBug=function(){if(!h_)return null;try{return h_([],"length",{value:1}).length!==1}catch(t){return!0}};$P.exports=YP});var QP=at((cst,jP)=>{"use strict";var M7=Qc(),ZP=lg(),b7=cg()(),JP=f_(),KP=Fl(),A7=M7("%Math.floor%");jP.exports=function(t,e){if(typeof t!="function")throw new KP("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||A7(e)!==e)throw new KP("\`length\` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],s=!0,c=!0;if("length"in t&&JP){var h=JP(t,"length");h&&!h.configurable&&(s=!1),h&&!h.writable&&(c=!1)}return(s||c||!o)&&(b7?ZP(t,"length",e,!0,!0):ZP(t,"length",e)),t}});var pg=at((fst,fg)=>{"use strict";var p_=rg(),hg=Qc(),T7=QP(),C7=Fl(),nI=hg("%Function.prototype.apply%"),rI=hg("%Function.prototype.call%"),iI=hg("%Reflect.apply%",!0)||p_.call(rI,nI),tI=ag(),P7=hg("%Math.max%");fg.exports=function(t){if(typeof t!="function")throw new C7("a function is required");var e=iI(p_,rI,arguments);return T7(e,1+P7(0,t.length-(arguments.length-1)),!0)};var eI=function(){return iI(p_,nI,arguments)};tI?tI(fg.exports,"apply",{value:eI}):fg.exports.apply=eI});var d_=at((hst,aI)=>{"use strict";var oI=Qc(),sI=pg(),I7=sI(oI("String.prototype.indexOf"));aI.exports=function(t,e){var o=oI(t,!!e);return typeof o=="function"&&I7(t,".prototype.")>-1?sI(o):o}});var cI=at((pst,lI)=>{"use strict";var R7=ng()(),L7=d_(),g_=L7("Object.prototype.toString"),dg=function(t){return R7&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:g_(t)==="[object Arguments]"},uI=function(t){return dg(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&g_(t)!=="[object Array]"&&g_(t.callee)==="[object Function]"},N7=function(){return dg(arguments)}();dg.isLegacyArguments=uI;lI.exports=N7?dg:uI});var ef=at((dst,dI)=>{"use strict";var O7=o_(),D7=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",F7=Object.prototype.toString,U7=Array.prototype.concat,fI=lg(),B7=function(n){return typeof n=="function"&&F7.call(n)==="[object Function]"},hI=cg()(),z7=function(n,t,e,o){if(t in n){if(o===!0){if(n[t]===e)return}else if(!B7(o)||!o())return}hI?fI(n,t,e,!0):fI(n,t,e)},pI=function(n,t){var e=arguments.length>2?arguments[2]:{},o=O7(t);D7&&(o=U7.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s<o.length;s+=1)z7(n,o[s],t[o[s]],e[o[s]])};pI.supportsDescriptors=!!hI;dI.exports=pI});var m_=at((gst,mI)=>{"use strict";var gI=function(n){return n!==n};mI.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||gI(t)&&gI(e))}});var y_=at((mst,yI)=>{"use strict";var G7=m_();yI.exports=function(){return typeof Object.is=="function"?Object.is:G7}});var _I=at((yst,vI)=>{"use strict";var k7=y_(),q7=ef();vI.exports=function(){var t=k7();return q7(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var SI=at((vst,wI)=>{"use strict";var H7=ef(),V7=pg(),W7=m_(),xI=y_(),X7=_I(),EI=V7(xI(),Object);H7(EI,{getPolyfill:xI,implementation:W7,shim:X7});wI.exports=EI});var CI=at((_st,TI)=>{"use strict";var v_=d_(),MI=ng()(),bI,AI,__,x_;MI&&(bI=v_("Object.prototype.hasOwnProperty"),AI=v_("RegExp.prototype.exec"),__={},gg=function(){throw __},x_={toString:gg,valueOf:gg},typeof Symbol.toPrimitive=="symbol"&&(x_[Symbol.toPrimitive]=gg));var gg,Y7=v_("Object.prototype.toString"),$7=Object.getOwnPropertyDescriptor,Z7="[object RegExp]";TI.exports=MI?function(t){if(!t||typeof t!="object")return!1;var e=$7(t,"lastIndex"),o=e&&bI(e,"value");if(!o)return!1;try{AI(t,x_)}catch(s){return s===__}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:Y7(t)===Z7}});var II=at((xst,PI)=>{"use strict";var mh=function(){return typeof function(){}.name=="string"},gh=Object.getOwnPropertyDescriptor;if(gh)try{gh([],"length")}catch(n){gh=null}mh.functionsHaveConfigurableNames=function(){if(!mh()||!gh)return!1;var t=gh(function(){},"name");return!!t&&!!t.configurable};var J7=Function.prototype.bind;mh.boundFunctionsHaveNames=function(){return mh()&&typeof J7=="function"&&function(){}.bind().name!==""};PI.exports=mh});var NI=at((Est,LI)=>{"use strict";var RI=lg(),K7=cg()(),j7=II().functionsHaveConfigurableNames(),Q7=Fl();LI.exports=function(t,e){if(typeof t!="function")throw new Q7("\`fn\` is not a function");var o=arguments.length>2&&!!arguments[2];return(!o||j7)&&(K7?RI(t,"name",e,!0,!0):RI(t,"name",e)),t}});var E_=at((wst,OI)=>{"use strict";var tY=NI(),eY=Fl(),nY=Object;OI.exports=tY(function(){if(this==null||this!==nY(this))throw new eY("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 w_=at((Sst,DI)=>{"use strict";var rY=E_(),iY=ef().supportsDescriptors,oY=Object.getOwnPropertyDescriptor;DI.exports=function(){if(iY&&/a/mig.flags==="gim"){var t=oY(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 rY}});var BI=at((Mst,UI)=>{"use strict";var sY=ef().supportsDescriptors,aY=w_(),uY=Object.getOwnPropertyDescriptor,lY=Object.defineProperty,cY=TypeError,FI=Object.getPrototypeOf,fY=/a/;UI.exports=function(){if(!sY||!FI)throw new cY("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=aY(),e=FI(fY),o=uY(e,"flags");return(!o||o.get!==t)&&lY(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var qI=at((bst,kI)=>{"use strict";var hY=ef(),pY=pg(),dY=E_(),zI=w_(),gY=BI(),GI=pY(zI());hY(GI,{getPolyfill:zI,implementation:dY,shim:gY});kI.exports=GI});var VI=at((Ast,HI)=>{"use strict";var mY=Date.prototype.getDay,yY=function(t){try{return mY.call(t),!0}catch(e){return!1}},vY=Object.prototype.toString,_Y="[object Date]",xY=ng()();HI.exports=function(t){return typeof t!="object"||t===null?!1:xY?yY(t):vY.call(t)===_Y}});var S_=at((Tst,eR)=>{var WI=o_(),XI=cI(),YI=SI(),$I=CI(),ZI=qI(),JI=VI(),KI=Date.prototype.getTime;function tR(n,t,e){var o=e||{};return(o.strict?YI(n,t):n===t)?!0:!n||!t||typeof n!="object"&&typeof t!="object"?o.strict?YI(n,t):n==t:EY(n,t,o)}function jI(n){return n==null}function QI(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 EY(n,t,e){var o,s;if(typeof n!=typeof t||jI(n)||jI(t)||n.prototype!==t.prototype||XI(n)!==XI(t))return!1;var c=$I(n),h=$I(t);if(c!==h)return!1;if(c||h)return n.source===t.source&&ZI(n)===ZI(t);if(JI(n)&&JI(t))return KI.call(n)===KI.call(t);var p=QI(n),g=QI(t);if(p!==g)return!1;if(p||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=WI(n),_=WI(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],!tR(n[s],t[s],e))return!1;return!0}eR.exports=tR});var D_=at((Nut,uR)=>{var f$=S_(),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:h$};Ia.prototype.compare=function(n,t){if(n.type!==t.type||!aR(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=sR(n),s=sR(t);return o.every(function(c){return this.some(function(h){return e.compare(c,h)})},s)}}return!1};function sR(n){return n.coordinates.map(function(t){return{type:n.type.replace("Multi",""),coordinates:t}})}function aR(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(!aR(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 h=this.compareCoord(s[e],c[e]);return this.direction||h?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(h){return s.compareLine(c,h,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 h$(n,t){return f$(n,t,{strict:!0})}uR.exports=Ia});var lR=at((Wut,vg)=>{function ju(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)}ju.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 h=this.clusters.length;this.clusters.push([]),this._addToCluster(s,h),this._expandCluster(h,c)}}return this.clusters};ju.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)};ju.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)}};ju.prototype._addToCluster=function(n,t){this.clusters[t].push(n),this._assigned[n]=1};ju.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};ju.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};ju.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 vg!="undefined"&&vg.exports&&(vg.exports=ju)});var cR=at((Xut,_g)=>{function Qu(n,t,e){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(n,t,e)}Qu.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)};Qu.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 h=new Array(_),p=0,g=0;g<_;g++)h[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++)h[g]+=this.dataset[m][g];p++}}if(p>0){for(var g=0;g<_;g++)h[g]/=p;this.centroids[c]=h}else this.centroids[c]=this.randomCentroid(),s=!0}}return this.getClusters()};Qu.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};Qu.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};Qu.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};Qu.prototype.argmin=function(n,t,e){for(var o=Number.MAX_VALUE,s=0,c=t.length,h,p=0;p<c;p++)h=e(n,t[p]),h<o&&(o=h,s=p);return s};Qu.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 _g!="undefined"&&_g.exports&&(_g.exports=Qu)});var F_=at((Yut,xg)=>{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 xg!="undefined"&&xg.exports&&(xg.exports=Ra)});var hR=at(($ut,rf)=>{typeof rf!="undefined"&&rf.exports&&(fR=F_());var fR;function hu(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)}hu.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 h=this.clusters.length-1;this._orderedList.push(s);var p=new fR(null,null,"asc"),g=this._regionQuery(s);this._distanceToCore(s)!==void 0&&(this._updateQueue(s,g,p),this._expandCluster(h,p))}return this.clusters};hu.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};hu.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)};hu.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]),h=Math.max(o._coreDistance,c);o._reachability[s]===void 0?(o._reachability[s]=h,e.insert(s,h)):h<o._reachability[s]&&(o._reachability[s]=h,e.remove(s),e.insert(s,h))}})};hu.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 h=this._regionQuery(c);this._processed[c]=1,this.clusters[n].push(c),this._orderedList.push(c),this._distanceToCore(c)!==void 0&&(this._updateQueue(c,h,t),this._expandCluster(n,t))}}};hu.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}};hu.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};hu.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=hu)});var pR=at((Zut,Eg)=>{typeof Eg!="undefined"&&Eg.exports&&(Eg.exports={DBSCAN:lR(),KMEANS:cR(),OPTICS:hR(),PriorityQueue:F_()})});var U_=at((elt,gR)=>{"use strict";gR.exports={eudist:function(t,e,o){for(var s=t.length,c=0,h=0;h<s;h++){var p=(t[h]||0)-(e[h]||0);c+=p*p}return o?Math.sqrt(c):c},mandist:function(t,e,o){for(var s=t.length,c=0,h=0;h<s;h++)c+=Math.abs((t[h]||0)-(e[h]||0));return o?Math.sqrt(c):c},dist:function(t,e,o){var s=Math.abs(t-e);return o?s:s*s}}});var vR=at((nlt,yR)=>{"use strict";var mR=U_(),v$=mR.eudist,_$=mR.dist;yR.exports={kmrand:function(t,e){for(var o={},s=[],c=e<<2,h=t.length,p=t[0].length>0;s.length<e&&c-- >0;){var g=t[Math.floor(Math.random()*h)],m=p?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?v$:_$,s=[],c=t.length,h=t[0].length>0,p={},g=t[Math.floor(Math.random()*c)],m=h?g.join("_"):""+g;for(s.push(g),p[m]=!0;s.length<e;){for(var _=[],w=s.length,x=0,b=[],P=0;P<c;P++){for(var I=1/0,S=0;S<w;S++){var E=o(t[P],s[S]);E<=I&&(I=E)}_[P]=I}for(var R=0;R<c;R++)x+=_[R];for(var T=0;T<c;T++)b[T]={i:T,v:t[T],pr:_[T]/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 SR=at((olt,wR)=>{"use strict";var B_=U_(),ER=vR(),x$=B_.eudist,rlt=B_.mandist,ilt=B_.dist,E$=ER.kmrand,w$=ER.kmpp,_R=1e4;function xR(n,t,e){e=e||[];for(var o=0;o<n;o++)e[o]=t;return e}function S$(n,t,e,o){var s=[],c=[],h=[],p=[],g=!1,m=o||_R,_=n.length,w=n[0].length,x=w>0,b=[];if(e)e=="kmrand"?s=E$(n,t):e=="kmpp"?s=w$(n,t):s=e;else for(var P={};s.length<t;){var I=Math.floor(Math.random()*_);P[I]||(P[I]=!0,s.push(n[I]))}do{xR(t,0,b);for(var S=0;S<_;S++){for(var E=1/0,R=0,T=0;T<t;T++){var p=x?x$(n[S],s[T]):Math.abs(n[S]-s[T]);p<=E&&(E=p,R=T)}h[S]=R,b[R]++}for(var F=[],c=[],W=0,X=0;X<t;X++)F[X]=x?xR(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=h[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=h[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:_R-m,k:t,idxs:h,centroids:s}}wR.exports=S$});var lf=at((V_,W_)=>{(function(n,t){typeof V_=="object"&&typeof W_!="undefined"?W_.exports=t():typeof define=="function"&&define.amd?define(t):(n=typeof globalThis!="undefined"?globalThis:n||self,n.polygonClipping=t())})(V_,function(){"use strict";function n(rt,C){var N={label:0,sent:function(){if(V[0]&1)throw V[1];return V[1]},trys:[],ops:[]},k,$,V,ht;return ht={next:st(0),throw:st(1),return:st(2)},typeof Symbol=="function"&&(ht[Symbol.iterator]=function(){return this}),ht;function st(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=C.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(C,N){this.next=null,this.key=C,this.data=N,this.left=null,this.right=null}return rt}();function e(rt,C){return rt>C?1:rt<C?-1:0}function o(rt,C,N){for(var k=new t(null,null),$=k,V=k;;){var ht=N(rt,C.key);if(ht<0){if(C.left===null)break;if(N(rt,C.left.key)<0){var st=C.left;if(C.left=st.right,st.right=C,C=st,C.left===null)break}V.left=C,V=C,C=C.left}else if(ht>0){if(C.right===null)break;if(N(rt,C.right.key)>0){var st=C.right;if(C.right=st.left,st.left=C,C=st,C.right===null)break}$.right=C,$=C,C=C.right}else break}return $.right=C.left,V.left=C.right,C.left=k.right,C.right=k.left,C}function s(rt,C,N,k){var $=new t(rt,C);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,C,N){var k=null,$=null;if(C){C=o(rt,C,N);var V=N(C.key,rt);V===0?(k=C.left,$=C.right):V<0?($=C.right,C.right=null,k=C):(k=C.left,C.left=null,$=C)}return{left:k,right:$}}function h(rt,C,N){return C===null?rt:(rt===null||(C=o(rt.key,C,N),C.left=rt),C)}function p(rt,C,N,k,$){if(rt){k(""+C+(N?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+$(rt)+\`
|
|
117
117
|
\`);var V=C+(N?" ":"\\u2502 ");rt.left&&p(rt.left,V,!1,k,$),rt.right&&p(rt.right,V,!0,k,$)}}var g=function(){function rt(C){C===void 0&&(C=e),this._root=null,this._size=0,this._comparator=C}return rt.prototype.insert=function(C,N){return this._size++,this._root=s(C,N,this._root,this._comparator)},rt.prototype.add=function(C,N){var k=new t(C,N);this._root===null&&(k.left=k.right=null,this._size++,this._root=k);var $=this._comparator,V=o(C,this._root,$),ht=$(C,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(C){this._root=this._remove(C,this._root,this._comparator)},rt.prototype._remove=function(C,N,k){var $;if(N===null)return null;N=o(C,N,k);var V=k(C,N.key);return V===0?(N.left===null?$=N.right:($=o(C,N.left,k),$.right=N.right),this._size--,$):N},rt.prototype.pop=function(){var C=this._root;if(C){for(;C.left;)C=C.left;return this._root=o(C.key,this._root,this._comparator),this._root=this._remove(C.key,this._root,this._comparator),{key:C.key,data:C.data}}return null},rt.prototype.findStatic=function(C){for(var N=this._root,k=this._comparator;N;){var $=k(C,N.key);if($===0)return N;$<0?N=N.left:N=N.right}return null},rt.prototype.find=function(C){return this._root&&(this._root=o(C,this._root,this._comparator),this._comparator(C,this._root.key)!==0)?null:this._root},rt.prototype.contains=function(C){for(var N=this._root,k=this._comparator;N;){var $=k(C,N.key);if($===0)return!0;$<0?N=N.left:N=N.right}return!1},rt.prototype.forEach=function(C,N){for(var k=this._root,$=[],V=!1;!V;)k!==null?($.push(k),k=k.left):$.length!==0?(k=$.pop(),C.call(N,k),k=k.right):V=!0;return this},rt.prototype.range=function(C,N,k,$){for(var V=[],ht=this._comparator,st=this._root,wt;V.length!==0||st;)if(st)V.push(st),st=st.left;else{if(st=V.pop(),wt=ht(st.key,N),wt>0)break;if(ht(st.key,C)>=0&&k.call($,st))return this;st=st.right}return this},rt.prototype.keys=function(){var C=[];return this.forEach(function(N){var k=N.key;return C.push(k)}),C},rt.prototype.values=function(){var C=[];return this.forEach(function(N){var k=N.data;return C.push(k)}),C},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(C){if(C===void 0&&(C=this._root),C)for(;C.left;)C=C.left;return C},rt.prototype.maxNode=function(C){if(C===void 0&&(C=this._root),C)for(;C.right;)C=C.right;return C},rt.prototype.at=function(C){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(),$===C)return N;$++,N=N.right}else k=!0;return null},rt.prototype.next=function(C){var N=this._root,k=null;if(C.right){for(k=C.right;k.left;)k=k.left;return k}for(var $=this._comparator;N;){var V=$(C.key,N.key);if(V===0)break;V<0?(k=N,N=N.left):N=N.right}return k},rt.prototype.prev=function(C){var N=this._root,k=null;if(C.left!==null){for(k=C.left;k.right;)k=k.right;return k}for(var $=this._comparator;N;){var V=$(C.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(C,N,k){N===void 0&&(N=[]),k===void 0&&(k=!1);var $=C.length,V=this._comparator;if(k&&P(C,N,0,$-1,V),this._root===null)this._root=m(C,N,0,$),this._size=$;else{var ht=b(this.toList(),_(C,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(C){C===void 0&&(C=function(k){return String(k.key)});var N=[];return p(this._root,"",!0,function(k){return N.push(k)},C),N.join("")},rt.prototype.update=function(C,N,k){var $=this._comparator,V=c(C,this._root,$),ht=V.left,st=V.right;$(C,N)<0?st=s(N,k,st,$):ht=s(N,k,ht,$),this._root=h(ht,st,$)},rt.prototype.split=function(C){return c(C,this._root,this._comparator)},rt.prototype[Symbol.iterator]=function(){var C,N,k;return n(this,function($){switch($.label){case 0:C=this._root,N=[],k=!1,$.label=1;case 1:return k?[3,6]:C===null?[3,2]:(N.push(C),C=C.left,[3,5]);case 2:return N.length===0?[3,4]:(C=N.pop(),[4,C]);case 3:return $.sent(),C=C.right,[3,5];case 4:k=!0,$.label=5;case 5:return[3,1];case 6:return[2]}})},rt}();function m(rt,C,N,k){var $=k-N;if($>0){var V=N+Math.floor($/2),ht=rt[V],st=C[V],wt=new t(ht,st);return wt.left=m(rt,C,N,V),wt.right=m(rt,C,V+1,k),wt}return null}function _(rt,C){for(var N=new t(null,null),k=N,$=0;$<rt.length;$++)k=k.next=new t(rt[$],C[$]);return k.next=null,N.next}function w(rt){for(var C=rt,N=[],k=!1,$=new t(null,null),V=$;!k;)C?(N.push(C),C=C.left):N.length>0?(C=V=V.next=N.pop(),C=C.right):k=!0;return V.next=null,$.next}function x(rt,C,N){var k=N-C;if(k>0){var $=C+Math.floor(k/2),V=x(rt,C,$),ht=rt.head;return ht.left=V,rt.head=rt.head.next,ht.right=x(rt,$+1,N),ht}return null}function b(rt,C,N){for(var k=new t(null,null),$=k,V=rt,ht=C;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 P(rt,C,N,k,$){if(!(N>=k)){for(var V=rt[N+k>>1],ht=N-1,st=k+1;;){do ht++;while($(rt[ht],V)<0);do st--;while($(rt[st],V)>0);if(ht>=st)break;var wt=rt[ht];rt[ht]=rt[st],rt[st]=wt,wt=C[ht],C[ht]=C[st],C[st]=wt}P(rt,C,N,st,$),P(rt,C,st+1,k,$)}}let I=(rt,C)=>rt.ll.x<=C.x&&C.x<=rt.ur.x&&rt.ll.y<=C.y&&C.y<=rt.ur.y,S=(rt,C)=>{if(C.ur.x<rt.ll.x||rt.ur.x<C.ll.x||C.ur.y<rt.ll.y||rt.ur.y<C.ll.y)return null;let N=rt.ll.x<C.ll.x?C.ll.x:rt.ll.x,k=rt.ur.x<C.ur.x?rt.ur.x:C.ur.x,$=rt.ll.y<C.ll.y?C.ll.y:rt.ll.y,V=rt.ur.y<C.ur.y?rt.ur.y:C.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,T=(rt,C)=>{if(-E<rt&&rt<E&&-E<C&&C<E)return 0;let N=rt-C;return N*N<R*rt*C?0:rt<C?-1:1};class F{constructor(){this.reset()}reset(){this.xRounder=new W,this.yRounder=new W}round(C,N){return{x:this.xRounder.round(C),y:this.yRounder.round(N)}}}class W{constructor(){this.tree=new g,this.round(0)}round(C){let N=this.tree.add(C),k=this.tree.prev(N);if(k!==null&&T(N.key,k.key)===0)return this.tree.remove(C),k.key;let $=this.tree.next(N);return $!==null&&T(N.key,$.key)===0?(this.tree.remove(C),$.key):C}}let X=new F,q=11102230246251565e-32,D=134217729,xt=(3+8*q)*q;function B(rt,C,N,k,$){let V,ht,st,wt,Et=C[0],G=k[0],ot=0,et=0;G>Et==G>-Et?(V=Et,Et=C[++ot]):(V=G,G=k[++et]);let lt=0;if(ot<rt&&et<N)for(G>Et==G>-Et?(ht=Et+V,st=V-(ht-Et),Et=C[++ot]):(ht=G+V,st=V-(ht-G),G=k[++et]),V=ht,st!==0&&($[lt++]=st);ot<rt&&et<N;)G>Et==G>-Et?(ht=V+Et,wt=ht-V,st=V-(ht-wt)+(Et-wt),Et=C[++ot]):(ht=V+G,wt=ht-V,st=V-(ht-wt)+(G-wt),G=k[++et]),V=ht,st!==0&&($[lt++]=st);for(;ot<rt;)ht=V+Et,wt=ht-V,st=V-(ht-wt)+(Et-wt),Et=C[++ot],V=ht,st!==0&&($[lt++]=st);for(;et<N;)ht=V+G,wt=ht-V,st=V-(ht-wt)+(G-wt),G=k[++et],V=ht,st!==0&&($[lt++]=st);return(V!==0||lt===0)&&($[lt++]=V),lt}function j(rt,C){let N=C[0];for(let k=1;k<rt;k++)N+=C[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,C,N,k,$,V,ht){let st,wt,Et,G,ot,et,lt,Ft,Kt,me,ve,qe,Ue,Xe,Ke,Er,Zr,nr,Ie=rt-$,rr=N-$,pr=C-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,ot=Ke-ve,Mt[0]=Ke-(ve+ot)+(ot-Zr),qe=Xe+ve,ot=qe-Xe,Ue=Xe-(qe-ot)+(ve-ot),ve=Ue-Er,ot=Ue-ve,Mt[1]=Ue-(ve+ot)+(ot-Er),nr=qe+ve,ot=nr-qe,Mt[2]=qe-(nr-ot)+(ve-ot),Mt[3]=nr;let Qn=j(4,Mt),Si=Q*ht;if(Qn>=Si||-Qn>=Si||(ot=rt-Ie,st=rt-(Ie+ot)+(ot-$),ot=N-rr,Et=N-(rr+ot)+(ot-$),ot=C-pr,wt=C-(pr+ot)+(ot-V),ot=k-ar,G=k-(ar+ot)+(ot-V),st===0&&wt===0&&Et===0&&G===0)||(Si=At*ht+xt*Math.abs(Qn),Qn+=Ie*G+ar*st-(pr*Et+rr*wt),Qn>=Si||-Qn>=Si))return Qn;Xe=st*ar,et=D*st,lt=et-(et-st),Ft=st-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,ot=Ke-ve,K[0]=Ke-(ve+ot)+(ot-Zr),qe=Xe+ve,ot=qe-Xe,Ue=Xe-(qe-ot)+(ve-ot),ve=Ue-Er,ot=Ue-ve,K[1]=Ue-(ve+ot)+(ot-Er),nr=qe+ve,ot=nr-qe,K[2]=qe-(nr-ot)+(ve-ot),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,ot=Ke-ve,K[0]=Ke-(ve+ot)+(ot-Zr),qe=Xe+ve,ot=qe-Xe,Ue=Xe-(qe-ot)+(ve-ot),ve=Ue-Er,ot=Ue-ve,K[1]=Ue-(ve+ot)+(ot-Er),nr=qe+ve,ot=nr-qe,K[2]=qe-(nr-ot)+(ve-ot),K[3]=nr;let Z=B(ii,Rt,4,K,pt);Xe=st*G,et=D*st,lt=et-(et-st),Ft=st-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,ot=Ke-ve,K[0]=Ke-(ve+ot)+(ot-Zr),qe=Xe+ve,ot=qe-Xe,Ue=Xe-(qe-ot)+(ve-ot),ve=Ue-Er,ot=Ue-ve,K[1]=Ue-(ve+ot)+(ot-Er),nr=qe+ve,ot=nr-qe,K[2]=qe-(nr-ot)+(ve-ot),K[3]=nr;let mt=B(Z,pt,4,K,yt);return yt[mt-1]}function Gt(rt,C,N,k,$,V){let ht=(C-V)*(N-$),st=(rt-$)*(k-V),wt=ht-st,Et=Math.abs(ht+st);return Math.abs(wt)>=Dt*Et?wt:-Bt(rt,C,N,k,$,V,Et)}let ae=(rt,C)=>rt.x*C.y-rt.y*C.x,ut=(rt,C)=>rt.x*C.x+rt.y*C.y,Ut=(rt,C,N)=>{let k=Gt(rt.x,rt.y,C.x,C.y,N.x,N.y);return k>0?-1:k<0?1:0},jt=rt=>Math.sqrt(ut(rt,rt)),ce=(rt,C,N)=>{let k={x:C.x-rt.x,y:C.y-rt.y},$={x:N.x-rt.x,y:N.y-rt.y};return ae($,k)/jt($)/jt(k)},te=(rt,C,N)=>{let k={x:C.x-rt.x,y:C.y-rt.y},$={x:N.x-rt.x,y:N.y-rt.y};return ut($,k)/jt($)/jt(k)},$t=(rt,C,N)=>C.y===0?null:{x:rt.x+C.x/C.y*(N-rt.y),y:N},qt=(rt,C,N)=>C.x===0?null:{x:N,y:rt.y+C.y/C.x*(N-rt.x)},xe=(rt,C,N,k)=>{if(C.x===0)return qt(N,k,rt.x);if(k.x===0)return qt(rt,C,N.x);if(C.y===0)return $t(N,k,rt.y);if(k.y===0)return $t(rt,C,N.y);let $=ae(C,k);if($==0)return null;let V={x:N.x-rt.x,y:N.y-rt.y},ht=ae(V,C)/$,st=ae(V,k)/$,wt=rt.x+st*C.x,Et=N.x+ht*k.x,G=rt.y+st*C.y,ot=N.y+ht*k.y,et=(wt+Et)/2,lt=(G+ot)/2;return{x:et,y:lt}};class ft{static compare(C,N){let k=ft.comparePoints(C.point,N.point);return k!==0?k:(C.point!==N.point&&C.link(N),C.isLeft!==N.isLeft?C.isLeft?1:-1:ee.compare(C.segment,N.segment))}static comparePoints(C,N){return C.x<N.x?-1:C.x>N.x?1:C.y<N.y?-1:C.y>N.y?1:0}constructor(C,N){C.events===void 0?C.events=[this]:C.events.push(this),this.point=C,this.isLeft=N}link(C){if(C.point===this.point)throw new Error("Tried to link already linked events");let N=C.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 C=this.point.events.length;for(let N=0;N<C;N++){let k=this.point.events[N];if(k.segment.consumedBy===void 0)for(let $=N+1;$<C;$++){let V=this.point.events[$];V.consumedBy===void 0&&k.otherSE.point.events===V.otherSE.point.events&&k.segment.consume(V.segment)}}}getAvailableLinkedEvents(){let C=[];for(let N=0,k=this.point.events.length;N<k;N++){let $=this.point.events[N];$!==this&&!$.segment.ringOut&&$.segment.isInResult()&&C.push($)}return C}getLeftmostComparator(C){let N=new Map,k=$=>{let V=$.otherSE;N.set($,{sine:ce(this.point,C.point,V.point),cosine:te(this.point,C.point,V.point)})};return($,V)=>{N.has($)||k($),N.has(V)||k(V);let{sine:ht,cosine:st}=N.get($),{sine:wt,cosine:Et}=N.get(V);return ht>=0&&wt>=0?st<Et?1:st>Et?-1:0:ht<0&&wt<0?st<Et?-1:st>Et?1:0:wt<ht?-1:wt>ht?1:0}}}let We=0;class ee{static compare(C,N){let k=C.leftSE.point.x,$=N.leftSE.point.x,V=C.rightSE.point.x,ht=N.rightSE.point.x;if(ht<k)return 1;if(V<$)return-1;let st=C.leftSE.point.y,wt=N.leftSE.point.y,Et=C.rightSE.point.y,G=N.rightSE.point.y;if(k<$){if(wt<st&&wt<Et)return 1;if(wt>st&&wt>Et)return-1;let ot=C.comparePoint(N.leftSE.point);if(ot<0)return 1;if(ot>0)return-1;let et=N.comparePoint(C.rightSE.point);return et!==0?et:-1}if(k>$){if(st<wt&&st<G)return-1;if(st>wt&&st>G)return 1;let ot=N.comparePoint(C.leftSE.point);if(ot!==0)return ot;let et=C.comparePoint(N.rightSE.point);return et<0?1:et>0?-1:1}if(st<wt)return-1;if(st>wt)return 1;if(V<ht){let ot=N.comparePoint(C.rightSE.point);if(ot!==0)return ot}if(V>ht){let ot=C.comparePoint(N.rightSE.point);if(ot<0)return 1;if(ot>0)return-1}if(V!==ht){let ot=Et-st,et=V-k,lt=G-wt,Ft=ht-$;if(ot>et&<<Ft)return 1;if(ot<et&<>Ft)return-1}return V>ht?1:V<ht||Et<G?-1:Et>G?1:C.id<N.id?-1:C.id>N.id?1:0}constructor(C,N,k,$){this.id=++We,this.leftSE=C,C.segment=this,C.otherSE=N,this.rightSE=N,N.segment=this,N.otherSE=C,this.rings=k,this.windings=$}static fromRing(C,N,k){let $,V,ht,st=ft.comparePoints(C,N);if(st<0)$=C,V=N,ht=1;else if(st>0)$=N,V=C,ht=-1;else throw new Error(\`Tried to create degenerate segment at [\${C.x}, \${C.y}]\`);let wt=new ft($,!0),Et=new ft(V,!1);return new ee(wt,Et,[k],[ht])}replaceRightSE(C){this.rightSE=C,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let C=this.leftSE.point.y,N=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:C<N?C:N},ur:{x:this.rightSE.point.x,y:C>N?C:N}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(C){return C.x===this.leftSE.point.x&&C.y===this.leftSE.point.y||C.x===this.rightSE.point.x&&C.y===this.rightSE.point.y}comparePoint(C){if(this.isAnEndpoint(C))return 0;let N=this.leftSE.point,k=this.rightSE.point,$=this.vector();if(N.x===k.x)return C.x===N.x?0:C.x<N.x?1:-1;let V=(C.y-N.y)/$.y,ht=N.x+V*$.x;if(C.x===ht)return 0;let st=(C.x-N.x)/$.x,wt=N.y+st*$.y;return C.y===wt?0:C.y<wt?-1:1}getIntersection(C){let N=this.bbox(),k=C.bbox(),$=S(N,k);if($===null)return null;let V=this.leftSE.point,ht=this.rightSE.point,st=C.leftSE.point,wt=C.rightSE.point,Et=I(N,st)&&this.comparePoint(st)===0,G=I(k,V)&&C.comparePoint(V)===0,ot=I(N,wt)&&this.comparePoint(wt)===0,et=I(k,ht)&&C.comparePoint(ht)===0;if(G&&Et)return et&&!ot?ht:!et&&ot?wt:null;if(G)return ot&&V.x===wt.x&&V.y===wt.y?null:V;if(Et)return et&&ht.x===st.x&&ht.y===st.y?null:st;if(et&&ot)return null;if(et)return ht;if(ot)return wt;let lt=xe(V,this.vector(),st,C.vector());return lt===null||!I($,lt)?null:X.round(lt.x,lt.y)}split(C){let N=[],k=C.events!==void 0,$=new ft(C,!0),V=new ft(C,!1),ht=this.rightSE;this.replaceRightSE(V),N.push(V),N.push($);let st=new ee($,ht,this.rings.slice(),this.windings.slice());return ft.comparePoints(st.leftSE.point,st.rightSE.point)>0&&st.swapEvents(),ft.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),k&&($.checkForConsuming(),V.checkForConsuming()),N}swapEvents(){let C=this.rightSE;this.rightSE=this.leftSE,this.leftSE=C,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let N=0,k=this.windings.length;N<k;N++)this.windings[N]*=-1}consume(C){let N=this,k=C;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 st=k.rings[V],wt=k.windings[V],Et=N.rings.indexOf(st);Et===-1?(N.rings.push(st),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 C=this.prev.consumedBy||this.prev;this._beforeState=C.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let C=this.beforeState();this._afterState={rings:C.rings.slice(0),windings:C.windings.slice(0),multiPolys:[]};let N=this._afterState.rings,k=this._afterState.windings,$=this._afterState.multiPolys;for(let st=0,wt=this.rings.length;st<wt;st++){let Et=this.rings[st],G=this.windings[st],ot=N.indexOf(Et);ot===-1?(N.push(Et),k.push(G)):k[ot]+=G}let V=[],ht=[];for(let st=0,wt=N.length;st<wt;st++){if(k[st]===0)continue;let Et=N[st],G=Et.poly;if(ht.indexOf(G)===-1)if(Et.isExterior)V.push(G);else{ht.indexOf(G)===-1&&ht.push(G);let ot=V.indexOf(Et.poly);ot!==-1&&V.splice(ot,1)}}for(let st=0,wt=V.length;st<wt;st++){let Et=V[st].multiPoly;$.indexOf(Et)===-1&&$.push(Et)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let C=this.beforeState().multiPolys,N=this.afterState().multiPolys;switch(dt.type){case"union":{let k=C.length===0,$=N.length===0;this._isInResult=k!==$;break}case"intersection":{let k,$;C.length<N.length?(k=C.length,$=N.length):(k=N.length,$=C.length),this._isInResult=$===dt.numMultiPolys&&k<$;break}case"xor":{let k=Math.abs(C.length-N.length);this._isInResult=k%2===1;break}case"difference":{let k=$=>$.length===1&&$[0].isSubject;this._isInResult=k(C)!==k(N);break}default:throw new Error(\`Unrecognized operation type found \${dt.type}\`)}return this._isInResult}}class ge{constructor(C,N,k){if(!Array.isArray(C)||C.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=N,this.isExterior=k,this.segments=[],typeof C[0][0]!="number"||typeof C[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let $=X.round(C[0][0],C[0][1]);this.bbox={ll:{x:$.x,y:$.y},ur:{x:$.x,y:$.y}};let V=$;for(let ht=1,st=C.length;ht<st;ht++){if(typeof C[ht][0]!="number"||typeof C[ht][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let wt=X.round(C[ht][0],C[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 C=[];for(let N=0,k=this.segments.length;N<k;N++){let $=this.segments[N];C.push($.leftSE),C.push($.rightSE)}return C}}class fe{constructor(C,N){if(!Array.isArray(C))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new ge(C[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,$=C.length;k<$;k++){let V=new ge(C[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 C=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++)C.push($[V])}return C}}class Te{constructor(C,N){if(!Array.isArray(C))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof C[0][0][0]=="number"&&(C=[C])}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,$=C.length;k<$;k++){let V=new fe(C[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 C=[];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++)C.push($[V])}return C}}class be{static factory(C){let N=[];for(let k=0,$=C.length;k<$;k++){let V=C[k];if(!V.isInResult()||V.ringOut)continue;let ht=null,st=V.leftSE,wt=V.rightSE,Et=[st],G=st.point,ot=[];for(;ht=st,st=wt,Et.push(st),st.point!==G;)for(;;){let et=st.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=ot.length;Kt<me;Kt++)if(ot[Kt].point===st.point){lt=Kt;break}if(lt!==null){let Kt=ot.splice(lt)[0],me=Et.splice(Kt.index);me.unshift(me[0].otherSE),N.push(new be(me.reverse()));continue}ot.push({index:Et.length,point:st.point});let Ft=st.getLeftmostComparator(ht);wt=et.sort(Ft)[0].otherSE;break}N.push(new be(Et))}return N}constructor(C){this.events=C;for(let N=0,k=C.length;N<k;N++)C[N].segment.ringOut=this;this.poly=null}getGeom(){let C=this.events[0].point,N=[C];for(let Et=1,G=this.events.length-1;Et<G;Et++){let ot=this.events[Et].point,et=this.events[Et+1].point;Ut(ot,C,et)!==0&&(N.push(ot),C=ot)}if(N.length===1)return null;let k=N[0],$=N[1];Ut(k,C,$)===0&&N.shift(),N.push(N[0]);let V=this.isExteriorRing()?1:-1,ht=this.isExteriorRing()?0:N.length-1,st=this.isExteriorRing()?N.length:-1,wt=[];for(let Et=ht;Et!=st;Et+=V)wt.push([N[Et].x,N[Et].y]);return wt}isExteriorRing(){if(this._isExteriorRing===void 0){let C=this.enclosingRing();this._isExteriorRing=C?!C.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let C=this.events[0];for(let $=1,V=this.events.length;$<V;$++){let ht=this.events[$];ft.compare(C,ht)>0&&(C=ht)}let N=C.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(C){this.exteriorRing=C,C.poly=this,this.interiorRings=[]}addInterior(C){this.interiorRings.push(C),C.poly=this}getGeom(){let C=[this.exteriorRing.getGeom()];if(C[0]===null)return null;for(let N=0,k=this.interiorRings.length;N<k;N++){let $=this.interiorRings[N].getGeom();$!==null&&C.push($)}return C}}class Me{constructor(C){this.rings=C,this.polys=this._composePolys(C)}getGeom(){let C=[];for(let N=0,k=this.polys.length;N<k;N++){let $=this.polys[N].getGeom();$!==null&&C.push($)}return C}_composePolys(C){let N=[];for(let k=0,$=C.length;k<$;k++){let V=C[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(C){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ee.compare;this.queue=C,this.tree=new g(N),this.segments=[]}process(C){let N=C.segment,k=[];if(C.consumedBy)return C.isLeft?this.queue.remove(C.otherSE):this.tree.remove(N),k;let $=C.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=$,st,wt;for(;st===void 0;)V=this.tree.prev(V),V===null?st=null:V.key.consumedBy===void 0&&(st=V.key);for(;wt===void 0;)ht=this.tree.next(ht),ht===null?wt=null:ht.key.consumedBy===void 0&&(wt=ht.key);if(C.isLeft){let Et=null;if(st){let ot=st.getIntersection(N);if(ot!==null&&(N.isAnEndpoint(ot)||(Et=ot),!st.isAnEndpoint(ot))){let et=this._splitSafely(st,ot);for(let lt=0,Ft=et.length;lt<Ft;lt++)k.push(et[lt])}}let G=null;if(wt){let ot=wt.getIntersection(N);if(ot!==null&&(N.isAnEndpoint(ot)||(G=ot),!wt.isAnEndpoint(ot))){let et=this._splitSafely(wt,ot);for(let lt=0,Ft=et.length;lt<Ft;lt++)k.push(et[lt])}}if(Et!==null||G!==null){let ot=null;Et===null?ot=G:G===null?ot=Et:ot=ft.comparePoints(Et,G)<=0?Et:G,this.queue.remove(N.rightSE),k.push(N.rightSE);let et=N.split(ot);for(let lt=0,Ft=et.length;lt<Ft;lt++)k.push(et[lt])}k.length>0?(this.tree.remove(N),k.push(C)):(this.segments.push(N),N.prev=st)}else{if(st&&wt){let Et=st.getIntersection(wt);if(Et!==null){if(!st.isAnEndpoint(Et)){let G=this._splitSafely(st,Et);for(let ot=0,et=G.length;ot<et;ot++)k.push(G[ot])}if(!wt.isAnEndpoint(Et)){let G=this._splitSafely(wt,Et);for(let ot=0,et=G.length;ot<et;ot++)k.push(G[ot])}}}this.tree.remove(N)}return k}_splitSafely(C,N){this.tree.remove(C);let k=C.rightSE;this.queue.remove(k);let $=C.split(N);return $.push(k),C.consumedBy===void 0&&this.tree.add(C),$}}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(C,N,k){dt.type=C,X.reset();let $=[new Te(N,!0)];for(let ot=0,et=k.length;ot<et;ot++)$.push(new Te(k[ot],!1));if(dt.numMultiPolys=$.length,dt.type==="difference"){let ot=$[0],et=1;for(;et<$.length;)S($[et].bbox,ot.bbox)!==null?et++:$.splice(et,1)}if(dt.type==="intersection")for(let ot=0,et=$.length;ot<et;ot++){let lt=$[ot];for(let Ft=ot+1,Kt=$.length;Ft<Kt;Ft++)if(S(lt.bbox,$[Ft].bbox)===null)return[]}let V=new g(ft.compare);for(let ot=0,et=$.length;ot<et;ot++){let lt=$[ot].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),st=V.size,wt=V.pop();for(;wt;){let ot=wt.key;if(V.size===st){let lt=ot.segment;throw new Error(\`Unable to pop() \${ot.isLeft?"left":"right"} SweepEvent [\${ot.point.x}, \${ot.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(ot);for(let lt=0,Ft=et.length;lt<Ft;lt++){let Kt=et[lt];Kt.consumedBy===void 0&&V.insert(Kt)}st=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 C=arguments.length,N=new Array(C>1?C-1:0),k=1;k<C;k++)N[k-1]=arguments[k];return dt.run("union",rt,N)},intersection:function(rt){for(var C=arguments.length,N=new Array(C>1?C-1:0),k=1;k<C;k++)N[k-1]=arguments[k];return dt.run("intersection",rt,N)},xor:function(rt){for(var C=arguments.length,N=new Array(C>1?C-1:0),k=1;k<C;k++)N[k-1]=arguments[k];return dt.run("xor",rt,N)},difference:function(rt){for(var C=arguments.length,N=new Array(C>1?C-1:0),k=1;k<C;k++)N[k-1]=arguments[k];return dt.run("difference",rt,N)}};return ne})});var qR=at((bg,kR)=>{(function(n,t){typeof bg=="object"&&typeof kR!="undefined"?t(bg):typeof define=="function"&&define.amd?define(["exports"],t):t(n.jsts={})})(bg,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 h(r){return r===null?Ke:r.color}function p(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 st&&this.addAll(arguments[0])}function P(){}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 d=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:a;for(d=d<0?Math.max(a+arguments[2],0):Math.min(d,a);l<d;)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),T=function(){},F={MAX_VALUE:{configurable:!0}};T.isNaN=function(r){return Number.isNaN(r)},T.doubleToLongBits=function(r){return r},T.longBitsToDouble=function(r){return r},T.isInfinite=function(r){return!Number.isFinite(r)},F.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(T,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||T.isNaN(this.z))&&T.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=T.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 T.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,d=B.compare(a.x,l.x);if(d!==0)return d;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:T.isNaN(r)?T.isNaN(i)?0:-1:T.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 T.isInfinite(i)||T.isNaN(i)?i:i/At.LOG_10},At.min=function(r,i,a,l){var d=r;return i<d&&(d=i),a<d&&(d=a),l<d&&(d=l),d},At.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var r=arguments[0],i=arguments[1],a=arguments[2];return r<i?i:r>a?a:r}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var l=arguments[0],d=arguments[1],v=arguments[2];return l<d?d: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 d=arguments[0],v=arguments[1],M=arguments[2],L=arguments[3],H=d;return v>H&&(H=v),M>H&&(H=M),L>H&&(H=L),H}},At.average=function(r,i){return(r+i)/2},Mt.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(At,Mt);var 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 d=arguments[0],v=arguments[1];this.init(d,v)}},Bt={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};K.prototype.le=function(r){return(this._hi<r._hi||this._hi===r._hi)&&this._lo<=r._lo},K.prototype.extractSignificantDigits=function(r,i){var a=this.abs(),l=K.magnitude(a._hi),d=K.TEN.pow(l);(a=a.divide(d)).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],d=null,v=null,M=null,L=null,H=null,it=null,bt=null,Tt=null;return H=this._hi/a,it=K.SPLIT*H,d=it-H,Tt=K.SPLIT*a,d=it-d,v=H-d,M=Tt-a,bt=H*a,M=Tt-M,L=a-M,Tt=d*M-bt+d*L+v*M+v*L,it=(this._hi-bt-Tt+this._lo-H*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,d=null,v=null,M=null,L=null,H=null;return a=(v=this._hi/r._hi)-(i=(M=K.SPLIT*v)-(i=M-v)),H=i*(l=(H=K.SPLIT*r._hi)-(l=H-r._hi))-(L=v*r._hi)+i*(d=r._hi-l)+a*l+a*d,M=(this._hi-L-H+this._lo-v*r._lo)/r._hi,new K(H=v+M,v-H+M)}if(typeof arguments[0]=="number"){var it=arguments[0];return T.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,d=null,v=null,M=null,L=null;return d=this._hi+i,M=d-this._hi,v=d-M,v=i-M+(this._hi-v),L=v+this._lo,a=d+L,l=L+(d-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],d=null,v=null,M=null,L=null,H=null,it=null;d=(H=K.SPLIT*this._hi)-this._hi,it=K.SPLIT*a,d=H-d,v=this._hi-d,M=it-a;var bt=(H=this._hi*a)+(it=d*(M=it-M)-H+d*(L=a-M)+v*M+v*L+(this._hi*l+this._lo*a)),Tt=it+(d=H-bt);return this._hi=bt,this._lo=Tt,this}},K.prototype.selfSqr=function(){return this.selfMultiply(this)},K.prototype.floor=function(){if(this.isNaN())return K.NaN;var r=Math.floor(this._hi),i=0;return r===this._hi&&(i=Math.floor(this._lo)),new K(r,i)},K.prototype.negate=function(){return this.isNaN()?this:new K(-this._hi,-this._lo)},K.prototype.clone=function(){},K.prototype.multiply=function(){if(arguments[0]instanceof K){var r=arguments[0];return r.isNaN()?K.createNaN():K.copy(this).selfMultiply(r)}if(typeof arguments[0]=="number"){var i=arguments[0];return T.isNaN(i)?K.createNaN():K.copy(this).selfMultiply(i,0)}},K.prototype.isNaN=function(){return T.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,d=a;if(a.charAt(0)===".")d="0"+a;else if(l<0)d="0."+K.stringOfChar("0",-l)+a;else if(a.indexOf(".")===-1){var v=l-a.length;d=a+K.stringOfChar("0",v)+".0"}return this.isNegative()?"-"+d:d},K.prototype.reciprocal=function(){var r=null,i=null,a=null,l=null,d=null,v=null,M=null,L=null;i=(d=1/this._hi)-(r=(v=K.SPLIT*d)-(r=v-d)),a=(L=K.SPLIT*this._hi)-this._hi;var H=d+(v=(1-(M=d*this._hi)-(L=r*(a=L-a)-M+r*(l=this._hi-a)+i*a+i*l)-d*this._lo)/this._hi);return new K(H,d-H+v)},K.prototype.toSciNotation=function(){if(this.isZero())return K.SCI_NOT_ZERO;var r=this.getSpecialNumberString();if(r!==null)return r;var i=new Array(1).fill(null),a=this.extractSignificantDigits(!1,i),l=K.SCI_NOT_EXPONENT_CHAR+i[0];if(a.charAt(0)==="0")throw new Error("Found leading zero: "+a);var d="";a.length>1&&(d=a.substring(1));var v=a.charAt(0)+"."+d;return this.isNegative()?"-"+v+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 d=r.charAt(i);d!=="-"&&d!=="+"||(i++,d==="-"&&(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(T.NaN,T.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(T.NaN,T.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 d=K.valueOf(i.x).selfAdd(-r.x),v=K.valueOf(i.y).selfAdd(-r.y),M=K.valueOf(a.x).selfAdd(-i.x),L=K.valueOf(a.y).selfAdd(-i.y);return d.selfMultiply(L).selfSubtract(v.selfMultiply(M)).signum()},Gt.signOfDet2x2=function(r,i,a,l){return r.multiply(l).selfSubtract(i.multiply(a)).signum()},Gt.intersection=function(r,i,a,l){var d=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=d.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,d=(r.x-a.x)*(i.y-a.y),v=(r.y-a.y)*(i.x-a.x),M=d-v;if(d>0){if(v<=0)return Gt.signum(M);l=d+v}else{if(!(d<0)||v>=0)return Gt.signum(M);l=-d-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,d){for(var v=0,M=i;M<i+d;M++)a[l+v]=r[M],v++},te.getProperty=function(r){return{"line.separator":\`
|