@aibee/crc-bmap 0.13.0 → 0.13.1

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.
@@ -8223,7 +8223,7 @@ void main() {
8223
8223
 
8224
8224
  }\`,vy=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,i){if(this.texture===null){let s=new ro,u=t.properties.get(s);u.__webglTexture=e.texture,(e.depthNear!=i.depthNear||e.depthFar!=i.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=s}}render(t,e){if(this.texture!==null){if(this.mesh===null){let i=e.cameras[0].viewport,s=new $o({extensions:{fragDepth:!0},vertexShader:y6,fragmentShader:v6,uniforms:{depthColor:{value:this.texture},depthWidth:{value:i.z},depthHeight:{value:i.w}}});this.mesh=new To(new xp(20,20),s)}t.render(this.mesh,e)}}reset(){this.texture=null,this.mesh=null}},_y=class extends aa{constructor(t,e){super();let i=this,s=null,u=1,c=null,f="local-floor",p=1,d=null,m=null,y=null,v=null,E=null,M=null,A=new vy,_=e.getContextAttributes(),x=null,T=null,S=[],R=[],z=new Ht,U=null,D=new Hi;D.layers.enable(1),D.viewport=new Hr;let P=new Hi;P.layers.enable(2),P.viewport=new Hr;let ct=[D,P],L=new yy;L.layers.enable(1),L.layers.enable(2);let W=null,V=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(nt){let bt=S[nt];return bt===void 0&&(bt=new Rc,S[nt]=bt),bt.getTargetRaySpace()},this.getControllerGrip=function(nt){let bt=S[nt];return bt===void 0&&(bt=new Rc,S[nt]=bt),bt.getGripSpace()},this.getHand=function(nt){let bt=S[nt];return bt===void 0&&(bt=new Rc,S[nt]=bt),bt.getHandSpace()};function Mt(nt){let bt=R.indexOf(nt.inputSource);if(bt===-1)return;let qt=S[bt];qt!==void 0&&(qt.update(nt.inputSource,nt.frame,d||c),qt.dispatchEvent({type:nt.type,data:nt.inputSource}))}function Y(){s.removeEventListener("select",Mt),s.removeEventListener("selectstart",Mt),s.removeEventListener("selectend",Mt),s.removeEventListener("squeeze",Mt),s.removeEventListener("squeezestart",Mt),s.removeEventListener("squeezeend",Mt),s.removeEventListener("end",Y),s.removeEventListener("inputsourceschange",mt);for(let nt=0;nt<S.length;nt++){let bt=R[nt];bt!==null&&(R[nt]=null,S[nt].disconnect(bt))}W=null,V=null,A.reset(),t.setRenderTarget(x),E=null,v=null,y=null,s=null,T=null,jt.stop(),i.isPresenting=!1,t.setPixelRatio(U),t.setSize(z.width,z.height,!1),i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(nt){u=nt,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(nt){f=nt,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return d||c},this.setReferenceSpace=function(nt){d=nt},this.getBaseLayer=function(){return v!==null?v:E},this.getBinding=function(){return y},this.getFrame=function(){return M},this.getSession=function(){return s},this.setSession=function(nt){return Tf(this,null,function*(){if(s=nt,s!==null){if(x=t.getRenderTarget(),s.addEventListener("select",Mt),s.addEventListener("selectstart",Mt),s.addEventListener("selectend",Mt),s.addEventListener("squeeze",Mt),s.addEventListener("squeezestart",Mt),s.addEventListener("squeezeend",Mt),s.addEventListener("end",Y),s.addEventListener("inputsourceschange",mt),_.xrCompatible!==!0&&(yield e.makeXRCompatible()),U=t.getPixelRatio(),t.getSize(z),s.renderState.layers===void 0||t.capabilities.isWebGL2===!1){let bt={antialias:s.renderState.layers===void 0?_.antialias:!0,alpha:!0,depth:_.depth,stencil:_.stencil,framebufferScaleFactor:u};E=new XRWebGLLayer(s,e,bt),s.updateRenderState({baseLayer:E}),t.setPixelRatio(1),t.setSize(E.framebufferWidth,E.framebufferHeight,!1),T=new Ts(E.framebufferWidth,E.framebufferHeight,{format:Ao,type:ia,colorSpace:t.outputColorSpace,stencilBuffer:_.stencil})}else{let bt=null,qt=null,$t=null;_.depth&&($t=_.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,bt=_.stencil?fl:$a,qt=_.stencil?Ya:ea);let Ft={colorFormat:e.RGBA8,depthFormat:$t,scaleFactor:u};y=new XRWebGLBinding(s,e),v=y.createProjectionLayer(Ft),s.updateRenderState({layers:[v]}),t.setPixelRatio(1),t.setSize(v.textureWidth,v.textureHeight,!1),T=new Ts(v.textureWidth,v.textureHeight,{format:Ao,type:ia,depthTexture:new wp(v.textureWidth,v.textureHeight,qt,void 0,void 0,void 0,void 0,void 0,void 0,bt),stencilBuffer:_.stencil,colorSpace:t.outputColorSpace,samples:_.antialias?4:0});let zt=t.properties.get(T);zt.__ignoreDepthValues=v.ignoreDepthValues}T.isXRRenderTarget=!0,this.setFoveation(p),d=null,c=yield s.requestReferenceSpace(f),jt.setContext(s),jt.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}})},this.getEnvironmentBlendMode=function(){if(s!==null)return s.environmentBlendMode};function mt(nt){for(let bt=0;bt<nt.removed.length;bt++){let qt=nt.removed[bt],$t=R.indexOf(qt);$t>=0&&(R[$t]=null,S[$t].disconnect(qt))}for(let bt=0;bt<nt.added.length;bt++){let qt=nt.added[bt],$t=R.indexOf(qt);if($t===-1){for(let zt=0;zt<S.length;zt++)if(zt>=R.length){R.push(qt),$t=zt;break}else if(R[zt]===null){R[zt]=qt,$t=zt;break}if($t===-1)break}let Ft=S[$t];Ft&&Ft.connect(qt)}}let ft=new at,vt=new at;function it(nt,bt,qt){ft.setFromMatrixPosition(bt.matrixWorld),vt.setFromMatrixPosition(qt.matrixWorld);let $t=ft.distanceTo(vt),Ft=bt.projectionMatrix.elements,zt=qt.projectionMatrix.elements,Ct=Ft[14]/(Ft[10]-1),te=Ft[14]/(Ft[10]+1),$=(Ft[9]+1)/Ft[5],Ot=(Ft[9]-1)/Ft[5],_t=(Ft[8]-1)/Ft[0],Nt=(zt[8]+1)/zt[0],St=Ct*_t,Vt=Ct*Nt,Xt=$t/(-_t+Nt),Pt=Xt*-_t;bt.matrixWorld.decompose(nt.position,nt.quaternion,nt.scale),nt.translateX(Pt),nt.translateZ(Xt),nt.matrixWorld.compose(nt.position,nt.quaternion,nt.scale),nt.matrixWorldInverse.copy(nt.matrixWorld).invert();let ee=Ct+Xt,X=te+Xt,N=St-Pt,xt=Vt+($t-Pt),wt=$*te/X*ee,ot=Ot*te/X*ee;nt.projectionMatrix.makePerspective(N,xt,wt,ot,ee,X),nt.projectionMatrixInverse.copy(nt.projectionMatrix).invert()}function lt(nt,bt){bt===null?nt.matrixWorld.copy(nt.matrix):nt.matrixWorld.multiplyMatrices(bt.matrixWorld,nt.matrix),nt.matrixWorldInverse.copy(nt.matrixWorld).invert()}this.updateCamera=function(nt){if(s===null)return;A.texture!==null&&(nt.near=A.depthNear,nt.far=A.depthFar),L.near=P.near=D.near=nt.near,L.far=P.far=D.far=nt.far,(W!==L.near||V!==L.far)&&(s.updateRenderState({depthNear:L.near,depthFar:L.far}),W=L.near,V=L.far,D.near=W,D.far=V,P.near=W,P.far=V,D.updateProjectionMatrix(),P.updateProjectionMatrix(),nt.updateProjectionMatrix());let bt=nt.parent,qt=L.cameras;lt(L,bt);for(let $t=0;$t<qt.length;$t++)lt(qt[$t],bt);qt.length===2?it(L,D,P):L.projectionMatrix.copy(D.projectionMatrix),H(nt,L,bt)};function H(nt,bt,qt){qt===null?nt.matrix.copy(bt.matrixWorld):(nt.matrix.copy(qt.matrixWorld),nt.matrix.invert(),nt.matrix.multiply(bt.matrixWorld)),nt.matrix.decompose(nt.position,nt.quaternion,nt.scale),nt.updateMatrixWorld(!0),nt.projectionMatrix.copy(bt.projectionMatrix),nt.projectionMatrixInverse.copy(bt.projectionMatrixInverse),nt.isPerspectiveCamera&&(nt.fov=ey*2*Math.atan(1/nt.projectionMatrix.elements[5]),nt.zoom=1)}this.getCamera=function(){return L},this.getFoveation=function(){if(!(v===null&&E===null))return p},this.setFoveation=function(nt){p=nt,v!==null&&(v.fixedFoveation=nt),E!==null&&E.fixedFoveation!==void 0&&(E.fixedFoveation=nt)},this.hasDepthSensing=function(){return A.texture!==null};let At=null;function It(nt,bt){if(m=bt.getViewerPose(d||c),M=bt,m!==null){let qt=m.views;E!==null&&(t.setRenderTargetFramebuffer(T,E.framebuffer),t.setRenderTarget(T));let $t=!1;qt.length!==L.cameras.length&&(L.cameras.length=0,$t=!0);for(let zt=0;zt<qt.length;zt++){let Ct=qt[zt],te=null;if(E!==null)te=E.getViewport(Ct);else{let Ot=y.getViewSubImage(v,Ct);te=Ot.viewport,zt===0&&(t.setRenderTargetTextures(T,Ot.colorTexture,v.ignoreDepthValues?void 0:Ot.depthStencilTexture),t.setRenderTarget(T))}let $=ct[zt];$===void 0&&($=new Hi,$.layers.enable(zt),$.viewport=new Hr,ct[zt]=$),$.matrix.fromArray(Ct.transform.matrix),$.matrix.decompose($.position,$.quaternion,$.scale),$.projectionMatrix.fromArray(Ct.projectionMatrix),$.projectionMatrixInverse.copy($.projectionMatrix).invert(),$.viewport.set(te.x,te.y,te.width,te.height),zt===0&&(L.matrix.copy($.matrix),L.matrix.decompose(L.position,L.quaternion,L.scale)),$t===!0&&L.cameras.push($)}let Ft=s.enabledFeatures;if(Ft&&Ft.includes("depth-sensing")){let zt=y.getDepthInformation(qt[0]);zt&&zt.isValid&&zt.texture&&A.init(t,zt,s.renderState)}}for(let qt=0;qt<S.length;qt++){let $t=R[qt],Ft=S[qt];$t!==null&&Ft!==void 0&&Ft.update($t,bt,d||c)}A.render(t,L),At&&At(nt,bt),bt.detectedPlanes&&i.dispatchEvent({type:"planesdetected",data:bt}),M=null}let jt=new IT;jt.setAnimationLoop(It),this.setAnimationLoop=function(nt){At=nt},this.dispose=function(){}}},Ga=new Ja,_6=new ir;function x6(n,t){function e(_,x){_.matrixAutoUpdate===!0&&_.updateMatrix(),x.value.copy(_.matrix)}function i(_,x){x.color.getRGB(_.fogColor.value,CT(n)),x.isFog?(_.fogNear.value=x.near,_.fogFar.value=x.far):x.isFogExp2&&(_.fogDensity.value=x.density)}function s(_,x,T,S,R){x.isMeshBasicMaterial||x.isMeshLambertMaterial?u(_,x):x.isMeshToonMaterial?(u(_,x),y(_,x)):x.isMeshPhongMaterial?(u(_,x),m(_,x)):x.isMeshStandardMaterial?(u(_,x),v(_,x),x.isMeshPhysicalMaterial&&E(_,x,R)):x.isMeshMatcapMaterial?(u(_,x),M(_,x)):x.isMeshDepthMaterial?u(_,x):x.isMeshDistanceMaterial?(u(_,x),A(_,x)):x.isMeshNormalMaterial?u(_,x):x.isLineBasicMaterial?(c(_,x),x.isLineDashedMaterial&&f(_,x)):x.isPointsMaterial?p(_,x,T,S):x.isSpriteMaterial?d(_,x):x.isShadowMaterial?(_.color.value.copy(x.color),_.opacity.value=x.opacity):x.isShaderMaterial&&(x.uniformsNeedUpdate=!1)}function u(_,x){_.opacity.value=x.opacity,x.color&&_.diffuse.value.copy(x.color),x.emissive&&_.emissive.value.copy(x.emissive).multiplyScalar(x.emissiveIntensity),x.map&&(_.map.value=x.map,e(x.map,_.mapTransform)),x.alphaMap&&(_.alphaMap.value=x.alphaMap,e(x.alphaMap,_.alphaMapTransform)),x.bumpMap&&(_.bumpMap.value=x.bumpMap,e(x.bumpMap,_.bumpMapTransform),_.bumpScale.value=x.bumpScale,x.side===Pi&&(_.bumpScale.value*=-1)),x.normalMap&&(_.normalMap.value=x.normalMap,e(x.normalMap,_.normalMapTransform),_.normalScale.value.copy(x.normalScale),x.side===Pi&&_.normalScale.value.negate()),x.displacementMap&&(_.displacementMap.value=x.displacementMap,e(x.displacementMap,_.displacementMapTransform),_.displacementScale.value=x.displacementScale,_.displacementBias.value=x.displacementBias),x.emissiveMap&&(_.emissiveMap.value=x.emissiveMap,e(x.emissiveMap,_.emissiveMapTransform)),x.specularMap&&(_.specularMap.value=x.specularMap,e(x.specularMap,_.specularMapTransform)),x.alphaTest>0&&(_.alphaTest.value=x.alphaTest);let T=t.get(x),S=T.envMap,R=T.envMapRotation;if(S&&(_.envMap.value=S,Ga.copy(R),Ga.x*=-1,Ga.y*=-1,Ga.z*=-1,S.isCubeTexture&&S.isRenderTargetTexture===!1&&(Ga.y*=-1,Ga.z*=-1),_.envMapRotation.value.setFromMatrix4(_6.makeRotationFromEuler(Ga)),_.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,_.reflectivity.value=x.reflectivity,_.ior.value=x.ior,_.refractionRatio.value=x.refractionRatio),x.lightMap){_.lightMap.value=x.lightMap;let z=n._useLegacyLights===!0?Math.PI:1;_.lightMapIntensity.value=x.lightMapIntensity*z,e(x.lightMap,_.lightMapTransform)}x.aoMap&&(_.aoMap.value=x.aoMap,_.aoMapIntensity.value=x.aoMapIntensity,e(x.aoMap,_.aoMapTransform))}function c(_,x){_.diffuse.value.copy(x.color),_.opacity.value=x.opacity,x.map&&(_.map.value=x.map,e(x.map,_.mapTransform))}function f(_,x){_.dashSize.value=x.dashSize,_.totalSize.value=x.dashSize+x.gapSize,_.scale.value=x.scale}function p(_,x,T,S){_.diffuse.value.copy(x.color),_.opacity.value=x.opacity,_.size.value=x.size*T,_.scale.value=S*.5,x.map&&(_.map.value=x.map,e(x.map,_.uvTransform)),x.alphaMap&&(_.alphaMap.value=x.alphaMap,e(x.alphaMap,_.alphaMapTransform)),x.alphaTest>0&&(_.alphaTest.value=x.alphaTest)}function d(_,x){_.diffuse.value.copy(x.color),_.opacity.value=x.opacity,_.rotation.value=x.rotation,x.map&&(_.map.value=x.map,e(x.map,_.mapTransform)),x.alphaMap&&(_.alphaMap.value=x.alphaMap,e(x.alphaMap,_.alphaMapTransform)),x.alphaTest>0&&(_.alphaTest.value=x.alphaTest)}function m(_,x){_.specular.value.copy(x.specular),_.shininess.value=Math.max(x.shininess,1e-4)}function y(_,x){x.gradientMap&&(_.gradientMap.value=x.gradientMap)}function v(_,x){_.metalness.value=x.metalness,x.metalnessMap&&(_.metalnessMap.value=x.metalnessMap,e(x.metalnessMap,_.metalnessMapTransform)),_.roughness.value=x.roughness,x.roughnessMap&&(_.roughnessMap.value=x.roughnessMap,e(x.roughnessMap,_.roughnessMapTransform)),t.get(x).envMap&&(_.envMapIntensity.value=x.envMapIntensity)}function E(_,x,T){_.ior.value=x.ior,x.sheen>0&&(_.sheenColor.value.copy(x.sheenColor).multiplyScalar(x.sheen),_.sheenRoughness.value=x.sheenRoughness,x.sheenColorMap&&(_.sheenColorMap.value=x.sheenColorMap,e(x.sheenColorMap,_.sheenColorMapTransform)),x.sheenRoughnessMap&&(_.sheenRoughnessMap.value=x.sheenRoughnessMap,e(x.sheenRoughnessMap,_.sheenRoughnessMapTransform))),x.clearcoat>0&&(_.clearcoat.value=x.clearcoat,_.clearcoatRoughness.value=x.clearcoatRoughness,x.clearcoatMap&&(_.clearcoatMap.value=x.clearcoatMap,e(x.clearcoatMap,_.clearcoatMapTransform)),x.clearcoatRoughnessMap&&(_.clearcoatRoughnessMap.value=x.clearcoatRoughnessMap,e(x.clearcoatRoughnessMap,_.clearcoatRoughnessMapTransform)),x.clearcoatNormalMap&&(_.clearcoatNormalMap.value=x.clearcoatNormalMap,e(x.clearcoatNormalMap,_.clearcoatNormalMapTransform),_.clearcoatNormalScale.value.copy(x.clearcoatNormalScale),x.side===Pi&&_.clearcoatNormalScale.value.negate())),x.iridescence>0&&(_.iridescence.value=x.iridescence,_.iridescenceIOR.value=x.iridescenceIOR,_.iridescenceThicknessMinimum.value=x.iridescenceThicknessRange[0],_.iridescenceThicknessMaximum.value=x.iridescenceThicknessRange[1],x.iridescenceMap&&(_.iridescenceMap.value=x.iridescenceMap,e(x.iridescenceMap,_.iridescenceMapTransform)),x.iridescenceThicknessMap&&(_.iridescenceThicknessMap.value=x.iridescenceThicknessMap,e(x.iridescenceThicknessMap,_.iridescenceThicknessMapTransform))),x.transmission>0&&(_.transmission.value=x.transmission,_.transmissionSamplerMap.value=T.texture,_.transmissionSamplerSize.value.set(T.width,T.height),x.transmissionMap&&(_.transmissionMap.value=x.transmissionMap,e(x.transmissionMap,_.transmissionMapTransform)),_.thickness.value=x.thickness,x.thicknessMap&&(_.thicknessMap.value=x.thicknessMap,e(x.thicknessMap,_.thicknessMapTransform)),_.attenuationDistance.value=x.attenuationDistance,_.attenuationColor.value.copy(x.attenuationColor)),x.anisotropy>0&&(_.anisotropyVector.value.set(x.anisotropy*Math.cos(x.anisotropyRotation),x.anisotropy*Math.sin(x.anisotropyRotation)),x.anisotropyMap&&(_.anisotropyMap.value=x.anisotropyMap,e(x.anisotropyMap,_.anisotropyMapTransform))),_.specularIntensity.value=x.specularIntensity,_.specularColor.value.copy(x.specularColor),x.specularColorMap&&(_.specularColorMap.value=x.specularColorMap,e(x.specularColorMap,_.specularColorMapTransform)),x.specularIntensityMap&&(_.specularIntensityMap.value=x.specularIntensityMap,e(x.specularIntensityMap,_.specularIntensityMapTransform))}function M(_,x){x.matcap&&(_.matcap.value=x.matcap)}function A(_,x){let T=t.get(x).light;_.referencePosition.value.setFromMatrixPosition(T.matrixWorld),_.nearDistance.value=T.shadow.camera.near,_.farDistance.value=T.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:s}}function E6(n,t,e,i){let s={},u={},c=[],f=e.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function p(T,S){let R=S.program;i.uniformBlockBinding(T,R)}function d(T,S){let R=s[T.id];R===void 0&&(M(T),R=m(T),s[T.id]=R,T.addEventListener("dispose",_));let z=S.program;i.updateUBOMapping(T,z);let U=t.render.frame;u[T.id]!==U&&(v(T),u[T.id]=U)}function m(T){let S=y();T.__bindingPointIndex=S;let R=n.createBuffer(),z=T.__size,U=T.usage;return n.bindBuffer(n.UNIFORM_BUFFER,R),n.bufferData(n.UNIFORM_BUFFER,z,U),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,S,R),R}function y(){for(let T=0;T<f;T++)if(c.indexOf(T)===-1)return c.push(T),T;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function v(T){let S=s[T.id],R=T.uniforms,z=T.__cache;n.bindBuffer(n.UNIFORM_BUFFER,S);for(let U=0,D=R.length;U<D;U++){let P=Array.isArray(R[U])?R[U]:[R[U]];for(let ct=0,L=P.length;ct<L;ct++){let W=P[ct];if(E(W,U,ct,z)===!0){let V=W.__offset,Mt=Array.isArray(W.value)?W.value:[W.value],Y=0;for(let mt=0;mt<Mt.length;mt++){let ft=Mt[mt],vt=A(ft);typeof ft=="number"||typeof ft=="boolean"?(W.__data[0]=ft,n.bufferSubData(n.UNIFORM_BUFFER,V+Y,W.__data)):ft.isMatrix3?(W.__data[0]=ft.elements[0],W.__data[1]=ft.elements[1],W.__data[2]=ft.elements[2],W.__data[3]=0,W.__data[4]=ft.elements[3],W.__data[5]=ft.elements[4],W.__data[6]=ft.elements[5],W.__data[7]=0,W.__data[8]=ft.elements[6],W.__data[9]=ft.elements[7],W.__data[10]=ft.elements[8],W.__data[11]=0):(ft.toArray(W.__data,Y),Y+=vt.storage/Float32Array.BYTES_PER_ELEMENT)}n.bufferSubData(n.UNIFORM_BUFFER,V,W.__data)}}}n.bindBuffer(n.UNIFORM_BUFFER,null)}function E(T,S,R,z){let U=T.value,D=S+"_"+R;if(z[D]===void 0)return typeof U=="number"||typeof U=="boolean"?z[D]=U:z[D]=U.clone(),!0;{let P=z[D];if(typeof U=="number"||typeof U=="boolean"){if(P!==U)return z[D]=U,!0}else if(P.equals(U)===!1)return P.copy(U),!0}return!1}function M(T){let S=T.uniforms,R=0,z=16;for(let D=0,P=S.length;D<P;D++){let ct=Array.isArray(S[D])?S[D]:[S[D]];for(let L=0,W=ct.length;L<W;L++){let V=ct[L],Mt=Array.isArray(V.value)?V.value:[V.value];for(let Y=0,mt=Mt.length;Y<mt;Y++){let ft=Mt[Y],vt=A(ft),it=R%z;it!==0&&z-it<vt.boundary&&(R+=z-it),V.__data=new Float32Array(vt.storage/Float32Array.BYTES_PER_ELEMENT),V.__offset=R,R+=vt.storage}}}let U=R%z;return U>0&&(R+=z-U),T.__size=R,T.__cache={},this}function A(T){let S={boundary:0,storage:0};return typeof T=="number"||typeof T=="boolean"?(S.boundary=4,S.storage=4):T.isVector2?(S.boundary=8,S.storage=8):T.isVector3||T.isColor?(S.boundary=16,S.storage=12):T.isVector4?(S.boundary=16,S.storage=16):T.isMatrix3?(S.boundary=48,S.storage=48):T.isMatrix4?(S.boundary=64,S.storage=64):T.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",T),S}function _(T){let S=T.target;S.removeEventListener("dispose",_);let R=c.indexOf(S.__bindingPointIndex);c.splice(R,1),n.deleteBuffer(s[S.id]),delete s[S.id],delete u[S.id]}function x(){for(let T in s)n.deleteBuffer(s[T]);c=[],s={},u={}}return{bind:p,update:d,dispose:x}}var xy=class{constructor(t={}){let{canvas:e=bk(),context:i=null,depth:s=!0,stencil:u=!0,alpha:c=!1,antialias:f=!1,premultipliedAlpha:p=!0,preserveDrawingBuffer:d=!1,powerPreference:m="default",failIfMajorPerformanceCaveat:y=!1}=t;this.isWebGLRenderer=!0;let v;i!==null?v=i.getContextAttributes().alpha:v=c;let E=new Uint32Array(4),M=new Int32Array(4),A=null,_=null,x=[],T=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Wo,this._useLegacyLights=!1,this.toneMapping=ra,this.toneMappingExposure=1;let S=this,R=!1,z=0,U=0,D=null,P=-1,ct=null,L=new Hr,W=new Hr,V=null,Mt=new fn(0),Y=0,mt=e.width,ft=e.height,vt=1,it=null,lt=null,H=new Hr(0,0,mt,ft),At=new Hr(0,0,mt,ft),It=!1,jt=new _p,nt=!1,bt=!1,qt=null,$t=new ir,Ft=new Ht,zt=new at,Ct={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function te(){return D===null?vt:1}let $=i;function Ot(q,st){for(let Et=0;Et<q.length;Et++){let dt=q[Et],ut=e.getContext(dt,st);if(ut!==null)return ut}return null}try{let q={alpha:!0,depth:s,stencil:u,antialias:f,premultipliedAlpha:p,preserveDrawingBuffer:d,powerPreference:m,failIfMajorPerformanceCaveat:y};if("setAttribute"in e&&e.setAttribute("data-engine",\`three.js r\${Vy}\`),e.addEventListener("webglcontextlost",ht,!1),e.addEventListener("webglcontextrestored",O,!1),e.addEventListener("webglcontextcreationerror",Q,!1),$===null){let st=["webgl2","webgl","experimental-webgl"];if(S.isWebGL1Renderer===!0&&st.shift(),$=Ot(st,q),$===null)throw Ot(st)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}typeof WebGLRenderingContext!="undefined"&&$ instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),$.getShaderPrecisionFormat===void 0&&($.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(q){throw console.error("THREE.WebGLRenderer: "+q.message),q}let _t,Nt,St,Vt,Xt,Pt,ee,X,N,xt,wt,ot,Lt,ce,Rt,Ut,Wt,j,b,I,F,k,G,rt;function tt(){_t=new UV($),Nt=new RV($,_t,t),_t.init(Nt),k=new m6($,_t,Nt),St=new p6($,_t,Nt),Vt=new GV($),Xt=new e6,Pt=new d6($,_t,St,Xt,Nt,k,Vt),ee=new NV(S),X=new FV(S),N=new Xk($,Nt),G=new IV($,_t,N,Nt),xt=new BV($,N,Vt,G),wt=new HV($,xt,N,Vt),b=new VV($,Nt,Pt),Ut=new LV(Xt),ot=new t6(S,ee,X,_t,Nt,G,Ut),Lt=new x6(S,Xt),ce=new r6,Rt=new l6(_t,Nt),j=new CV(S,ee,X,St,wt,v,p),Wt=new h6(S,wt,Nt),rt=new E6($,Vt,Nt,St),I=new PV($,_t,Vt,Nt),F=new zV($,_t,Vt,Nt),Vt.programs=ot.programs,S.capabilities=Nt,S.extensions=_t,S.properties=Xt,S.renderLists=ce,S.shadowMap=Wt,S.state=St,S.info=Vt}tt();let pt=new _y(S,$);this.xr=pt,this.getContext=function(){return $},this.getContextAttributes=function(){return $.getContextAttributes()},this.forceContextLoss=function(){let q=_t.get("WEBGL_lose_context");q&&q.loseContext()},this.forceContextRestore=function(){let q=_t.get("WEBGL_lose_context");q&&q.restoreContext()},this.getPixelRatio=function(){return vt},this.setPixelRatio=function(q){q!==void 0&&(vt=q,this.setSize(mt,ft,!1))},this.getSize=function(q){return q.set(mt,ft)},this.setSize=function(q,st,Et=!0){if(pt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}mt=q,ft=st,e.width=Math.floor(q*vt),e.height=Math.floor(st*vt),Et===!0&&(e.style.width=q+"px",e.style.height=st+"px"),this.setViewport(0,0,q,st)},this.getDrawingBufferSize=function(q){return q.set(mt*vt,ft*vt).floor()},this.setDrawingBufferSize=function(q,st,Et){mt=q,ft=st,vt=Et,e.width=Math.floor(q*Et),e.height=Math.floor(st*Et),this.setViewport(0,0,q,st)},this.getCurrentViewport=function(q){return q.copy(L)},this.getViewport=function(q){return q.copy(H)},this.setViewport=function(q,st,Et,dt){q.isVector4?H.set(q.x,q.y,q.z,q.w):H.set(q,st,Et,dt),St.viewport(L.copy(H).multiplyScalar(vt).round())},this.getScissor=function(q){return q.copy(At)},this.setScissor=function(q,st,Et,dt){q.isVector4?At.set(q.x,q.y,q.z,q.w):At.set(q,st,Et,dt),St.scissor(W.copy(At).multiplyScalar(vt).round())},this.getScissorTest=function(){return It},this.setScissorTest=function(q){St.setScissorTest(It=q)},this.setOpaqueSort=function(q){it=q},this.setTransparentSort=function(q){lt=q},this.getClearColor=function(q){return q.copy(j.getClearColor())},this.setClearColor=function(){j.setClearColor.apply(j,arguments)},this.getClearAlpha=function(){return j.getClearAlpha()},this.setClearAlpha=function(){j.setClearAlpha.apply(j,arguments)},this.clear=function(q=!0,st=!0,Et=!0){let dt=0;if(q){let ut=!1;if(D!==null){let Kt=D.texture.format;ut=Kt===wT||Kt===ET||Kt===xT}if(ut){let Kt=D.texture.type,Qt=Kt===ia||Kt===ea||Kt===Hy||Kt===Ya||Kt===vT||Kt===_T,le=j.getClearColor(),ne=j.getClearAlpha(),ve=le.r,fe=le.g,he=le.b;Qt?(E[0]=ve,E[1]=fe,E[2]=he,E[3]=ne,$.clearBufferuiv($.COLOR,0,E)):(M[0]=ve,M[1]=fe,M[2]=he,M[3]=ne,$.clearBufferiv($.COLOR,0,M))}else dt|=$.COLOR_BUFFER_BIT}st&&(dt|=$.DEPTH_BUFFER_BIT),Et&&(dt|=$.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),$.clear(dt)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",ht,!1),e.removeEventListener("webglcontextrestored",O,!1),e.removeEventListener("webglcontextcreationerror",Q,!1),ce.dispose(),Rt.dispose(),Xt.dispose(),ee.dispose(),X.dispose(),wt.dispose(),G.dispose(),rt.dispose(),ot.dispose(),Wt.dispose(),pt.dispose(),pt.removeEventListener("sessionstart",Se),pt.removeEventListener("sessionend",ye),qt&&(qt.dispose(),qt=null),be.stop()};function ht(q){q.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),R=!0}function O(){console.log("THREE.WebGLRenderer: Context Restored."),R=!1;let q=Vt.autoReset,st=Wt.enabled,Et=Wt.autoUpdate,dt=Wt.needsUpdate,ut=Wt.type;tt(),Vt.autoReset=q,Wt.enabled=st,Wt.autoUpdate=Et,Wt.needsUpdate=dt,Wt.type=ut}function Q(q){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",q.statusMessage)}function J(q){let st=q.target;st.removeEventListener("dispose",J),et(st)}function et(q){Tt(q),Xt.remove(q)}function Tt(q){let st=Xt.get(q).programs;st!==void 0&&(st.forEach(function(Et){ot.releaseProgram(Et)}),q.isShaderMaterial&&ot.releaseShaderCache(q))}this.renderBufferDirect=function(q,st,Et,dt,ut,Kt){st===null&&(st=Ct);let Qt=ut.isMesh&&ut.matrixWorld.determinant()<0,le=En(q,st,Et,dt,ut);St.setMaterial(dt,Qt);let ne=Et.index,ve=1;if(dt.wireframe===!0){if(ne=xt.getWireframeAttribute(Et),ne===void 0)return;ve=2}let fe=Et.drawRange,he=Et.attributes.position,ln=fe.start*ve,Mr=(fe.start+fe.count)*ve;Kt!==null&&(ln=Math.max(ln,Kt.start*ve),Mr=Math.min(Mr,(Kt.start+Kt.count)*ve)),ne!==null?(ln=Math.max(ln,0),Mr=Math.min(Mr,ne.count)):he!=null&&(ln=Math.max(ln,0),Mr=Math.min(Mr,he.count));let kn=Mr-ln;if(kn<0||kn===1/0)return;G.setup(ut,dt,le,Et,ne);let ai,Sn=I;if(ne!==null&&(ai=N.get(ne),Sn=F,Sn.setIndex(ai)),ut.isMesh)dt.wireframe===!0?(St.setLineWidth(dt.wireframeLinewidth*te()),Sn.setMode($.LINES)):Sn.setMode($.TRIANGLES);else if(ut.isLine){let oe=dt.linewidth;oe===void 0&&(oe=1),St.setLineWidth(oe*te()),ut.isLineSegments?Sn.setMode($.LINES):ut.isLineLoop?Sn.setMode($.LINE_LOOP):Sn.setMode($.LINE_STRIP)}else ut.isPoints?Sn.setMode($.POINTS):ut.isSprite&&Sn.setMode($.TRIANGLES);if(ut.isBatchedMesh)Sn.renderMultiDraw(ut._multiDrawStarts,ut._multiDrawCounts,ut._multiDrawCount);else if(ut.isInstancedMesh)Sn.renderInstances(ln,kn,ut.count);else if(Et.isInstancedBufferGeometry){let oe=Et._maxInstanceCount!==void 0?Et._maxInstanceCount:1/0,cu=Math.min(Et.instanceCount,oe);Sn.renderInstances(ln,kn,cu)}else Sn.render(ln,kn)};function Gt(q,st,Et){q.transparent===!0&&q.side===Ss&&q.forceSinglePass===!1?(q.side=Pi,q.needsUpdate=!0,xn(q,st,Et),q.side=sa,q.needsUpdate=!0,xn(q,st,Et),q.side=Ss):xn(q,st,Et)}this.compile=function(q,st,Et=null){Et===null&&(Et=q),_=Rt.get(Et),_.init(),T.push(_),Et.traverseVisible(function(ut){ut.isLight&&ut.layers.test(st.layers)&&(_.pushLight(ut),ut.castShadow&&_.pushShadow(ut))}),q!==Et&&q.traverseVisible(function(ut){ut.isLight&&ut.layers.test(st.layers)&&(_.pushLight(ut),ut.castShadow&&_.pushShadow(ut))}),_.setupLights(S._useLegacyLights);let dt=new Set;return q.traverse(function(ut){let Kt=ut.material;if(Kt)if(Array.isArray(Kt))for(let Qt=0;Qt<Kt.length;Qt++){let le=Kt[Qt];Gt(le,Et,ut),dt.add(le)}else Gt(Kt,Et,ut),dt.add(Kt)}),T.pop(),_=null,dt},this.compileAsync=function(q,st,Et=null){let dt=this.compile(q,st,Et);return new Promise(ut=>{function Kt(){if(dt.forEach(function(Qt){Xt.get(Qt).currentProgram.isReady()&&dt.delete(Qt)}),dt.size===0){ut(q);return}setTimeout(Kt,10)}_t.get("KHR_parallel_shader_compile")!==null?Kt():setTimeout(Kt,10)})};let re=null;function ie(q){re&&re(q)}function Se(){be.stop()}function ye(){be.start()}let be=new IT;be.setAnimationLoop(ie),typeof self!="undefined"&&be.setContext(self),this.setAnimationLoop=function(q){re=q,pt.setAnimationLoop(q),q===null?be.stop():be.start()},pt.addEventListener("sessionstart",Se),pt.addEventListener("sessionend",ye),this.render=function(q,st){if(st!==void 0&&st.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(R===!0)return;q.matrixWorldAutoUpdate===!0&&q.updateMatrixWorld(),st.parent===null&&st.matrixWorldAutoUpdate===!0&&st.updateMatrixWorld(),pt.enabled===!0&&pt.isPresenting===!0&&(pt.cameraAutoUpdate===!0&&pt.updateCamera(st),st=pt.getCamera()),q.isScene===!0&&q.onBeforeRender(S,q,st,D),_=Rt.get(q,T.length),_.init(),T.push(_),$t.multiplyMatrices(st.projectionMatrix,st.matrixWorldInverse),jt.setFromProjectionMatrix($t),bt=this.localClippingEnabled,nt=Ut.init(this.clippingPlanes,bt),A=ce.get(q,x.length),A.init(),x.push(A),Ae(q,st,0,S.sortObjects),A.finish(),S.sortObjects===!0&&A.sort(it,lt),this.info.render.frame++,nt===!0&&Ut.beginShadows();let Et=_.state.shadowsArray;if(Wt.render(Et,q,st),nt===!0&&Ut.endShadows(),this.info.autoReset===!0&&this.info.reset(),(pt.enabled===!1||pt.isPresenting===!1||pt.hasDepthSensing()===!1)&&j.render(A,q),_.setupLights(S._useLegacyLights),st.isArrayCamera){let dt=st.cameras;for(let ut=0,Kt=dt.length;ut<Kt;ut++){let Qt=dt[ut];On(A,q,Qt,Qt.viewport)}}else On(A,q,st);D!==null&&(Pt.updateMultisampleRenderTarget(D),Pt.updateRenderTargetMipmap(D)),q.isScene===!0&&q.onAfterRender(S,q,st),G.resetDefaultState(),P=-1,ct=null,T.pop(),T.length>0?_=T[T.length-1]:_=null,x.pop(),x.length>0?A=x[x.length-1]:A=null};function Ae(q,st,Et,dt){if(q.visible===!1)return;if(q.layers.test(st.layers)){if(q.isGroup)Et=q.renderOrder;else if(q.isLOD)q.autoUpdate===!0&&q.update(st);else if(q.isLight)_.pushLight(q),q.castShadow&&_.pushShadow(q);else if(q.isSprite){if(!q.frustumCulled||jt.intersectsSprite(q)){dt&&zt.setFromMatrixPosition(q.matrixWorld).applyMatrix4($t);let Qt=wt.update(q),le=q.material;le.visible&&A.push(q,Qt,le,Et,zt.z,null)}}else if((q.isMesh||q.isLine||q.isPoints)&&(!q.frustumCulled||jt.intersectsObject(q))){let Qt=wt.update(q),le=q.material;if(dt&&(q.boundingSphere!==void 0?(q.boundingSphere===null&&q.computeBoundingSphere(),zt.copy(q.boundingSphere.center)):(Qt.boundingSphere===null&&Qt.computeBoundingSphere(),zt.copy(Qt.boundingSphere.center)),zt.applyMatrix4(q.matrixWorld).applyMatrix4($t)),Array.isArray(le)){let ne=Qt.groups;for(let ve=0,fe=ne.length;ve<fe;ve++){let he=ne[ve],ln=le[he.materialIndex];ln&&ln.visible&&A.push(q,Qt,ln,Et,zt.z,he)}}else le.visible&&A.push(q,Qt,le,Et,zt.z,null)}}let Kt=q.children;for(let Qt=0,le=Kt.length;Qt<le;Qt++)Ae(Kt[Qt],st,Et,dt)}function On(q,st,Et,dt){let ut=q.opaque,Kt=q.transmissive,Qt=q.transparent;_.setupLightsView(Et),nt===!0&&Ut.setGlobalState(S.clippingPlanes,Et),Kt.length>0&&pr(ut,Kt,st,Et),dt&&St.viewport(L.copy(dt)),ut.length>0&&_n(ut,st,Et),Kt.length>0&&_n(Kt,st,Et),Qt.length>0&&_n(Qt,st,Et),St.buffers.depth.setTest(!0),St.buffers.depth.setMask(!0),St.buffers.color.setMask(!0),St.setPolygonOffset(!1)}function pr(q,st,Et,dt){if((Et.isScene===!0?Et.overrideMaterial:null)!==null)return;let Kt=Nt.isWebGL2;qt===null&&(qt=new Ts(1,1,{generateMipmaps:!0,type:_t.has("EXT_color_buffer_half_float")?Oc:ia,minFilter:Ha,samples:Kt?4:0})),S.getDrawingBufferSize(Ft),Kt?qt.setSize(Ft.x,Ft.y):qt.setSize(ny(Ft.x),ny(Ft.y));let Qt=S.getRenderTarget();S.setRenderTarget(qt),S.getClearColor(Mt),Y=S.getClearAlpha(),Y<1&&S.setClearColor(16777215,.5),S.clear();let le=S.toneMapping;S.toneMapping=ra,_n(q,Et,dt),Pt.updateMultisampleRenderTarget(qt),Pt.updateRenderTargetMipmap(qt);let ne=!1;for(let ve=0,fe=st.length;ve<fe;ve++){let he=st[ve],ln=he.object,Mr=he.geometry,kn=he.material,ai=he.group;if(kn.side===Ss&&ln.layers.test(dt.layers)){let Sn=kn.side;kn.side=Pi,kn.needsUpdate=!0,pe(ln,Et,dt,Mr,kn,ai),kn.side=Sn,kn.needsUpdate=!0,ne=!0}}ne===!0&&(Pt.updateMultisampleRenderTarget(qt),Pt.updateRenderTargetMipmap(qt)),S.setRenderTarget(Qt),S.setClearColor(Mt,Y),S.toneMapping=le}function _n(q,st,Et){let dt=st.isScene===!0?st.overrideMaterial:null;for(let ut=0,Kt=q.length;ut<Kt;ut++){let Qt=q[ut],le=Qt.object,ne=Qt.geometry,ve=dt===null?Qt.material:dt,fe=Qt.group;le.layers.test(Et.layers)&&pe(le,st,Et,ne,ve,fe)}}function pe(q,st,Et,dt,ut,Kt){q.onBeforeRender(S,st,Et,dt,ut,Kt),q.modelViewMatrix.multiplyMatrices(Et.matrixWorldInverse,q.matrixWorld),q.normalMatrix.getNormalMatrix(q.modelViewMatrix),ut.onBeforeRender(S,st,Et,dt,q,Kt),ut.transparent===!0&&ut.side===Ss&&ut.forceSinglePass===!1?(ut.side=Pi,ut.needsUpdate=!0,S.renderBufferDirect(Et,st,dt,ut,q,Kt),ut.side=sa,ut.needsUpdate=!0,S.renderBufferDirect(Et,st,dt,ut,q,Kt),ut.side=Ss):S.renderBufferDirect(Et,st,dt,ut,q,Kt),q.onAfterRender(S,st,Et,dt,ut,Kt)}function xn(q,st,Et){st.isScene!==!0&&(st=Ct);let dt=Xt.get(q),ut=_.state.lights,Kt=_.state.shadowsArray,Qt=ut.state.version,le=ot.getParameters(q,ut.state,Kt,st,Et),ne=ot.getProgramCacheKey(le),ve=dt.programs;dt.environment=q.isMeshStandardMaterial?st.environment:null,dt.fog=st.fog,dt.envMap=(q.isMeshStandardMaterial?X:ee).get(q.envMap||dt.environment),dt.envMapRotation=dt.environment!==null&&q.envMap===null?st.environmentRotation:q.envMapRotation,ve===void 0&&(q.addEventListener("dispose",J),ve=new Map,dt.programs=ve);let fe=ve.get(ne);if(fe!==void 0){if(dt.currentProgram===fe&&dt.lightsStateVersion===Qt)return Tn(q,le),fe}else le.uniforms=ot.getUniforms(q),q.onBuild(Et,le,S),q.onBeforeCompile(le,S),fe=ot.acquireProgram(le,ne),ve.set(ne,fe),dt.uniforms=le.uniforms;let he=dt.uniforms;return(!q.isShaderMaterial&&!q.isRawShaderMaterial||q.clipping===!0)&&(he.clippingPlanes=Ut.uniform),Tn(q,le),dt.needsLights=Sr(q),dt.lightsStateVersion=Qt,dt.needsLights&&(he.ambientLightColor.value=ut.state.ambient,he.lightProbe.value=ut.state.probe,he.directionalLights.value=ut.state.directional,he.directionalLightShadows.value=ut.state.directionalShadow,he.spotLights.value=ut.state.spot,he.spotLightShadows.value=ut.state.spotShadow,he.rectAreaLights.value=ut.state.rectArea,he.ltc_1.value=ut.state.rectAreaLTC1,he.ltc_2.value=ut.state.rectAreaLTC2,he.pointLights.value=ut.state.point,he.pointLightShadows.value=ut.state.pointShadow,he.hemisphereLights.value=ut.state.hemi,he.directionalShadowMap.value=ut.state.directionalShadowMap,he.directionalShadowMatrix.value=ut.state.directionalShadowMatrix,he.spotShadowMap.value=ut.state.spotShadowMap,he.spotLightMatrix.value=ut.state.spotLightMatrix,he.spotLightMap.value=ut.state.spotLightMap,he.pointShadowMap.value=ut.state.pointShadowMap,he.pointShadowMatrix.value=ut.state.pointShadowMatrix),dt.currentProgram=fe,dt.uniformsList=null,fe}function Rn(q){if(q.uniformsList===null){let st=q.currentProgram.getUniforms();q.uniformsList=ul.seqWithValue(st.seq,q.uniforms)}return q.uniformsList}function Tn(q,st){let Et=Xt.get(q);Et.outputColorSpace=st.outputColorSpace,Et.batching=st.batching,Et.instancing=st.instancing,Et.instancingColor=st.instancingColor,Et.instancingMorph=st.instancingMorph,Et.skinning=st.skinning,Et.morphTargets=st.morphTargets,Et.morphNormals=st.morphNormals,Et.morphColors=st.morphColors,Et.morphTargetsCount=st.morphTargetsCount,Et.numClippingPlanes=st.numClippingPlanes,Et.numIntersection=st.numClipIntersection,Et.vertexAlphas=st.vertexAlphas,Et.vertexTangents=st.vertexTangents,Et.toneMapping=st.toneMapping}function En(q,st,Et,dt,ut){st.isScene!==!0&&(st=Ct),Pt.resetTextureUnits();let Kt=st.fog,Qt=dt.isMeshStandardMaterial?st.environment:null,le=D===null?S.outputColorSpace:D.isXRRenderTarget===!0?D.texture.colorSpace:ua,ne=(dt.isMeshStandardMaterial?X:ee).get(dt.envMap||Qt),ve=dt.vertexColors===!0&&!!Et.attributes.color&&Et.attributes.color.itemSize===4,fe=!!Et.attributes.tangent&&(!!dt.normalMap||dt.anisotropy>0),he=!!Et.morphAttributes.position,ln=!!Et.morphAttributes.normal,Mr=!!Et.morphAttributes.color,kn=ra;dt.toneMapped&&(D===null||D.isXRRenderTarget===!0)&&(kn=S.toneMapping);let ai=Et.morphAttributes.position||Et.morphAttributes.normal||Et.morphAttributes.color,Sn=ai!==void 0?ai.length:0,oe=Xt.get(dt),cu=_.state.lights;if(nt===!0&&(bt===!0||q!==ct)){let ui=q===ct&&dt.id===P;Ut.setState(dt,q,ui)}let cn=!1;dt.version===oe.__version?(oe.needsLights&&oe.lightsStateVersion!==cu.state.version||oe.outputColorSpace!==le||ut.isBatchedMesh&&oe.batching===!1||!ut.isBatchedMesh&&oe.batching===!0||ut.isInstancedMesh&&oe.instancing===!1||!ut.isInstancedMesh&&oe.instancing===!0||ut.isSkinnedMesh&&oe.skinning===!1||!ut.isSkinnedMesh&&oe.skinning===!0||ut.isInstancedMesh&&oe.instancingColor===!0&&ut.instanceColor===null||ut.isInstancedMesh&&oe.instancingColor===!1&&ut.instanceColor!==null||ut.isInstancedMesh&&oe.instancingMorph===!0&&ut.morphTexture===null||ut.isInstancedMesh&&oe.instancingMorph===!1&&ut.morphTexture!==null||oe.envMap!==ne||dt.fog===!0&&oe.fog!==Kt||oe.numClippingPlanes!==void 0&&(oe.numClippingPlanes!==Ut.numPlanes||oe.numIntersection!==Ut.numIntersection)||oe.vertexAlphas!==ve||oe.vertexTangents!==fe||oe.morphTargets!==he||oe.morphNormals!==ln||oe.morphColors!==Mr||oe.toneMapping!==kn||Nt.isWebGL2===!0&&oe.morphTargetsCount!==Sn)&&(cn=!0):(cn=!0,oe.__version=dt.version);let oo=oe.currentProgram;cn===!0&&(oo=xn(dt,st,ut));let Wl=!1,_e=!1,ga=!1,Mn=oo.getUniforms(),so=oe.uniforms;if(St.useProgram(oo.program)&&(Wl=!0,_e=!0,ga=!0),dt.id!==P&&(P=dt.id,_e=!0),Wl||ct!==q){Mn.setValue($,"projectionMatrix",q.projectionMatrix),Mn.setValue($,"viewMatrix",q.matrixWorldInverse);let ui=Mn.map.cameraPosition;ui!==void 0&&ui.setValue($,zt.setFromMatrixPosition(q.matrixWorld)),Nt.logarithmicDepthBuffer&&Mn.setValue($,"logDepthBufFC",2/(Math.log(q.far+1)/Math.LN2)),(dt.isMeshPhongMaterial||dt.isMeshToonMaterial||dt.isMeshLambertMaterial||dt.isMeshBasicMaterial||dt.isMeshStandardMaterial||dt.isShaderMaterial)&&Mn.setValue($,"isOrthographic",q.isOrthographicCamera===!0),ct!==q&&(ct=q,_e=!0,ga=!0)}if(ut.isSkinnedMesh){Mn.setOptional($,ut,"bindMatrix"),Mn.setOptional($,ut,"bindMatrixInverse");let ui=ut.skeleton;ui&&(Nt.floatVertexTextures?(ui.boneTexture===null&&ui.computeBoneTexture(),Mn.setValue($,"boneTexture",ui.boneTexture,Pt)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}ut.isBatchedMesh&&(Mn.setOptional($,ut,"batchingTexture"),Mn.setValue($,"batchingTexture",ut._matricesTexture,Pt));let ge=Et.morphAttributes;if((ge.position!==void 0||ge.normal!==void 0||ge.color!==void 0&&Nt.isWebGL2===!0)&&b.update(ut,Et,oo),(_e||oe.receiveShadow!==ut.receiveShadow)&&(oe.receiveShadow=ut.receiveShadow,Mn.setValue($,"receiveShadow",ut.receiveShadow)),dt.isMeshGouraudMaterial&&dt.envMap!==null&&(so.envMap.value=ne,so.flipEnvMap.value=ne.isCubeTexture&&ne.isRenderTargetTexture===!1?-1:1),_e&&(Mn.setValue($,"toneMappingExposure",S.toneMappingExposure),oe.needsLights&&Jr(so,ga),Kt&&dt.fog===!0&&Lt.refreshFogUniforms(so,Kt),Lt.refreshMaterialUniforms(so,dt,vt,ft,qt),ul.upload($,Rn(oe),so,Pt)),dt.isShaderMaterial&&dt.uniformsNeedUpdate===!0&&(ul.upload($,Rn(oe),so,Pt),dt.uniformsNeedUpdate=!1),dt.isSpriteMaterial&&Mn.setValue($,"center",ut.center),Mn.setValue($,"modelViewMatrix",ut.modelViewMatrix),Mn.setValue($,"normalMatrix",ut.normalMatrix),Mn.setValue($,"modelMatrix",ut.matrixWorld),dt.isShaderMaterial||dt.isRawShaderMaterial){let ui=dt.uniformsGroups;for(let Xl=0,fu=ui.length;Xl<fu;Xl++)if(Nt.isWebGL2){let li=ui[Xl];rt.update(li,oo),rt.bind(li,oo)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return oo}function Jr(q,st){q.ambientLightColor.needsUpdate=st,q.lightProbe.needsUpdate=st,q.directionalLights.needsUpdate=st,q.directionalLightShadows.needsUpdate=st,q.pointLights.needsUpdate=st,q.pointLightShadows.needsUpdate=st,q.spotLights.needsUpdate=st,q.spotLightShadows.needsUpdate=st,q.rectAreaLights.needsUpdate=st,q.hemisphereLights.needsUpdate=st}function Sr(q){return q.isMeshLambertMaterial||q.isMeshToonMaterial||q.isMeshPhongMaterial||q.isMeshStandardMaterial||q.isShadowMaterial||q.isShaderMaterial&&q.lights===!0}this.getActiveCubeFace=function(){return z},this.getActiveMipmapLevel=function(){return U},this.getRenderTarget=function(){return D},this.setRenderTargetTextures=function(q,st,Et){Xt.get(q.texture).__webglTexture=st,Xt.get(q.depthTexture).__webglTexture=Et;let dt=Xt.get(q);dt.__hasExternalTextures=!0,dt.__autoAllocateDepthBuffer=Et===void 0,dt.__autoAllocateDepthBuffer||_t.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),dt.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(q,st){let Et=Xt.get(q);Et.__webglFramebuffer=st,Et.__useDefaultFramebuffer=st===void 0},this.setRenderTarget=function(q,st=0,Et=0){D=q,z=st,U=Et;let dt=!0,ut=null,Kt=!1,Qt=!1;if(q){let ne=Xt.get(q);ne.__useDefaultFramebuffer!==void 0?(St.bindFramebuffer($.FRAMEBUFFER,null),dt=!1):ne.__webglFramebuffer===void 0?Pt.setupRenderTarget(q):ne.__hasExternalTextures&&Pt.rebindTextures(q,Xt.get(q.texture).__webglTexture,Xt.get(q.depthTexture).__webglTexture);let ve=q.texture;(ve.isData3DTexture||ve.isDataArrayTexture||ve.isCompressedArrayTexture)&&(Qt=!0);let fe=Xt.get(q).__webglFramebuffer;q.isWebGLCubeRenderTarget?(Array.isArray(fe[st])?ut=fe[st][Et]:ut=fe[st],Kt=!0):Nt.isWebGL2&&q.samples>0&&Pt.useMultisampledRTT(q)===!1?ut=Xt.get(q).__webglMultisampledFramebuffer:Array.isArray(fe)?ut=fe[Et]:ut=fe,L.copy(q.viewport),W.copy(q.scissor),V=q.scissorTest}else L.copy(H).multiplyScalar(vt).floor(),W.copy(At).multiplyScalar(vt).floor(),V=It;if(St.bindFramebuffer($.FRAMEBUFFER,ut)&&Nt.drawBuffers&&dt&&St.drawBuffers(q,ut),St.viewport(L),St.scissor(W),St.setScissorTest(V),Kt){let ne=Xt.get(q.texture);$.framebufferTexture2D($.FRAMEBUFFER,$.COLOR_ATTACHMENT0,$.TEXTURE_CUBE_MAP_POSITIVE_X+st,ne.__webglTexture,Et)}else if(Qt){let ne=Xt.get(q.texture),ve=st||0;$.framebufferTextureLayer($.FRAMEBUFFER,$.COLOR_ATTACHMENT0,ne.__webglTexture,Et||0,ve)}P=-1},this.readRenderTargetPixels=function(q,st,Et,dt,ut,Kt,Qt){if(!(q&&q.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let le=Xt.get(q).__webglFramebuffer;if(q.isWebGLCubeRenderTarget&&Qt!==void 0&&(le=le[Qt]),le){St.bindFramebuffer($.FRAMEBUFFER,le);try{let ne=q.texture,ve=ne.format,fe=ne.type;if(ve!==Ao&&k.convert(ve)!==$.getParameter($.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}let he=fe===Oc&&(_t.has("EXT_color_buffer_half_float")||Nt.isWebGL2&&_t.has("EXT_color_buffer_float"));if(fe!==ia&&k.convert(fe)!==$.getParameter($.IMPLEMENTATION_COLOR_READ_TYPE)&&!(fe===Ms&&(Nt.isWebGL2||_t.has("OES_texture_float")||_t.has("WEBGL_color_buffer_float")))&&!he){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}st>=0&&st<=q.width-dt&&Et>=0&&Et<=q.height-ut&&$.readPixels(st,Et,dt,ut,k.convert(ve),k.convert(fe),Kt)}finally{let ne=D!==null?Xt.get(D).__webglFramebuffer:null;St.bindFramebuffer($.FRAMEBUFFER,ne)}}},this.copyFramebufferToTexture=function(q,st,Et=0){let dt=Math.pow(2,-Et),ut=Math.floor(st.image.width*dt),Kt=Math.floor(st.image.height*dt);Pt.setTexture2D(st,0),$.copyTexSubImage2D($.TEXTURE_2D,Et,0,0,q.x,q.y,ut,Kt),St.unbindTexture()},this.copyTextureToTexture=function(q,st,Et,dt=0){let ut=st.image.width,Kt=st.image.height,Qt=k.convert(Et.format),le=k.convert(Et.type);Pt.setTexture2D(Et,0),$.pixelStorei($.UNPACK_FLIP_Y_WEBGL,Et.flipY),$.pixelStorei($.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Et.premultiplyAlpha),$.pixelStorei($.UNPACK_ALIGNMENT,Et.unpackAlignment),st.isDataTexture?$.texSubImage2D($.TEXTURE_2D,dt,q.x,q.y,ut,Kt,Qt,le,st.image.data):st.isCompressedTexture?$.compressedTexSubImage2D($.TEXTURE_2D,dt,q.x,q.y,st.mipmaps[0].width,st.mipmaps[0].height,Qt,st.mipmaps[0].data):$.texSubImage2D($.TEXTURE_2D,dt,q.x,q.y,Qt,le,st.image),dt===0&&Et.generateMipmaps&&$.generateMipmap($.TEXTURE_2D),St.unbindTexture()},this.copyTextureToTexture3D=function(q,st,Et,dt,ut=0){if(S.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let Kt=Math.round(q.max.x-q.min.x),Qt=Math.round(q.max.y-q.min.y),le=q.max.z-q.min.z+1,ne=k.convert(dt.format),ve=k.convert(dt.type),fe;if(dt.isData3DTexture)Pt.setTexture3D(dt,0),fe=$.TEXTURE_3D;else if(dt.isDataArrayTexture||dt.isCompressedArrayTexture)Pt.setTexture2DArray(dt,0),fe=$.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}$.pixelStorei($.UNPACK_FLIP_Y_WEBGL,dt.flipY),$.pixelStorei($.UNPACK_PREMULTIPLY_ALPHA_WEBGL,dt.premultiplyAlpha),$.pixelStorei($.UNPACK_ALIGNMENT,dt.unpackAlignment);let he=$.getParameter($.UNPACK_ROW_LENGTH),ln=$.getParameter($.UNPACK_IMAGE_HEIGHT),Mr=$.getParameter($.UNPACK_SKIP_PIXELS),kn=$.getParameter($.UNPACK_SKIP_ROWS),ai=$.getParameter($.UNPACK_SKIP_IMAGES),Sn=Et.isCompressedTexture?Et.mipmaps[ut]:Et.image;$.pixelStorei($.UNPACK_ROW_LENGTH,Sn.width),$.pixelStorei($.UNPACK_IMAGE_HEIGHT,Sn.height),$.pixelStorei($.UNPACK_SKIP_PIXELS,q.min.x),$.pixelStorei($.UNPACK_SKIP_ROWS,q.min.y),$.pixelStorei($.UNPACK_SKIP_IMAGES,q.min.z),Et.isDataTexture||Et.isData3DTexture?$.texSubImage3D(fe,ut,st.x,st.y,st.z,Kt,Qt,le,ne,ve,Sn.data):dt.isCompressedArrayTexture?$.compressedTexSubImage3D(fe,ut,st.x,st.y,st.z,Kt,Qt,le,ne,Sn.data):$.texSubImage3D(fe,ut,st.x,st.y,st.z,Kt,Qt,le,ne,ve,Sn),$.pixelStorei($.UNPACK_ROW_LENGTH,he),$.pixelStorei($.UNPACK_IMAGE_HEIGHT,ln),$.pixelStorei($.UNPACK_SKIP_PIXELS,Mr),$.pixelStorei($.UNPACK_SKIP_ROWS,kn),$.pixelStorei($.UNPACK_SKIP_IMAGES,ai),ut===0&&dt.generateMipmaps&&$.generateMipmap(fe),St.unbindTexture()},this.initTexture=function(q){q.isCubeTexture?Pt.setTextureCube(q,0):q.isData3DTexture?Pt.setTexture3D(q,0):q.isDataArrayTexture||q.isCompressedArrayTexture?Pt.setTexture2DArray(q,0):Pt.setTexture2D(q,0),St.unbindTexture()},this.resetState=function(){z=0,U=0,D=null,St.reset(),G.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return bs}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;let e=this.getContext();e.drawingBufferColorSpace=t===Wy?"display-p3":"srgb",e.unpackColorSpace=In.workingColorSpace===Ip?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t}},Ey=class extends xy{};Ey.prototype.isWebGL1Renderer=!0;var Sp=class{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=Q0,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=As()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return AT("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,i){t*=this.stride,i*=e.stride;for(let s=0,u=this.stride;s<u;s++)this.array[t+s]=e.array[i+s];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=As()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(e,this.stride);return i.setUsage(this.usage),i}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=As()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}},_i=new at,Uc=class n{constructor(t,e,i,s=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=i,this.normalized=s}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,i=this.data.count;e<i;e++)_i.fromBufferAttribute(this,e),_i.applyMatrix4(t),this.setXYZ(e,_i.x,_i.y,_i.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)_i.fromBufferAttribute(this,e),_i.applyNormalMatrix(t),this.setXYZ(e,_i.x,_i.y,_i.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)_i.fromBufferAttribute(this,e),_i.transformDirection(t),this.setXYZ(e,_i.x,_i.y,_i.z);return this}getComponent(t,e){let i=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(i=Yo(i,this.array)),i}setComponent(t,e,i){return this.normalized&&(i=Cn(i,this.array)),this.data.array[t*this.data.stride+this.offset+e]=i,this}setX(t,e){return this.normalized&&(e=Cn(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=Cn(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=Cn(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=Cn(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=Yo(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=Yo(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=Yo(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=Yo(e,this.array)),e}setXY(t,e,i){return t=t*this.data.stride+this.offset,this.normalized&&(e=Cn(e,this.array),i=Cn(i,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this}setXYZ(t,e,i,s){return t=t*this.data.stride+this.offset,this.normalized&&(e=Cn(e,this.array),i=Cn(i,this.array),s=Cn(s,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=s,this}setXYZW(t,e,i,s,u){return t=t*this.data.stride+this.offset,this.normalized&&(e=Cn(e,this.array),i=Cn(i,this.array),s=Cn(s,this.array),u=Cn(u,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=s,this.data.array[t+3]=u,this}clone(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let e=[];for(let i=0;i<this.count;i++){let s=i*this.data.stride+this.offset;for(let u=0;u<this.itemSize;u++)e.push(this.data.array[s+u])}return new Yn(new this.array.constructor(e),this.itemSize,this.normalized)}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new n(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");let e=[];for(let i=0;i<this.count;i++){let s=i*this.data.stride+this.offset;for(let u=0;u<this.itemSize;u++)e.push(this.data.array[s+u])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}},wy=class extends ja{constructor(t){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new fn(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}},Qs,Cc=new at,tl=new at,el=new at,nl=new Ht,Ic=new Ht,DT=new ir,Zh=new at,Pc=new at,Jh=new at,uT=new Ht,V0=new Ht,lT=new Ht,Sy=class extends Co{constructor(t=new wy){if(super(),this.isSprite=!0,this.type="Sprite",Qs===void 0){Qs=new Ri;let e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new Sp(e,5);Qs.setIndex([0,1,2,0,2,3]),Qs.setAttribute("position",new Uc(i,3,0,!1)),Qs.setAttribute("uv",new Uc(i,2,3,!1))}this.geometry=Qs,this.material=t,this.center=new Ht(.5,.5)}raycast(t,e){t.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),tl.setFromMatrixScale(this.matrixWorld),DT.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),el.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&tl.multiplyScalar(-el.z);let i=this.material.rotation,s,u;i!==0&&(u=Math.cos(i),s=Math.sin(i));let c=this.center;jh(Zh.set(-.5,-.5,0),el,c,tl,s,u),jh(Pc.set(.5,-.5,0),el,c,tl,s,u),jh(Jh.set(.5,.5,0),el,c,tl,s,u),uT.set(0,0),V0.set(1,0),lT.set(1,1);let f=t.ray.intersectTriangle(Zh,Pc,Jh,!1,Cc);if(f===null&&(jh(Pc.set(-.5,.5,0),el,c,tl,s,u),V0.set(0,1),f=t.ray.intersectTriangle(Zh,Jh,Pc,!1,Cc),f===null))return;let p=t.ray.origin.distanceTo(Cc);p<t.near||p>t.far||e.push({distance:p,point:Cc.clone(),uv:Wa.getInterpolation(Cc,Zh,Pc,Jh,uT,V0,lT,new Ht),face:null,object:this})}copy(t,e){return super.copy(t,e),t.center!==void 0&&this.center.copy(t.center),this.material=t.material,this}};Sy.Dispose=function(){Qs.dispose(),Qs=void 0};function jh(n,t,e,i,s,u){nl.subVectors(n,e).addScalar(.5).multiply(i),s!==void 0?(Ic.x=u*nl.x-s*nl.y,Ic.y=s*nl.x+u*nl.y):Ic.copy(nl),n.copy(t),n.x+=Ic.x,n.y+=Ic.y,n.applyMatrix4(DT)}var io=class{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){let i=this.getUtoTmapping(t);return this.getPoint(i,e)}getPoints(t=5){let e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return e}getSpacedPoints(t=5){let e=[];for(let i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e}getLength(){let t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let e=[],i,s=this.getPoint(0),u=0;e.push(0);for(let c=1;c<=t;c++)i=this.getPoint(c/t),u+=i.distanceTo(s),e.push(u),s=i;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){let i=this.getLengths(),s=0,u=i.length,c;e?c=e:c=t*i[u-1];let f=0,p=u-1,d;for(;f<=p;)if(s=Math.floor(f+(p-f)/2),d=i[s]-c,d<0)f=s+1;else if(d>0)p=s-1;else{p=s;break}if(s=p,i[s]===c)return s/(u-1);let m=i[s],v=i[s+1]-m,E=(c-m)/v;return(s+E)/(u-1)}getTangent(t,e){let s=t-1e-4,u=t+1e-4;s<0&&(s=0),u>1&&(u=1);let c=this.getPoint(s),f=this.getPoint(u),p=e||(c.isVector2?new Ht:new at);return p.copy(f).sub(c).normalize(),p}getTangentAt(t,e){let i=this.getUtoTmapping(t);return this.getTangent(i,e)}computeFrenetFrames(t,e){let i=new at,s=[],u=[],c=[],f=new at,p=new ir;for(let E=0;E<=t;E++){let M=E/t;s[E]=this.getTangentAt(M,new at)}u[0]=new at,c[0]=new at;let d=Number.MAX_VALUE,m=Math.abs(s[0].x),y=Math.abs(s[0].y),v=Math.abs(s[0].z);m<=d&&(d=m,i.set(1,0,0)),y<=d&&(d=y,i.set(0,1,0)),v<=d&&i.set(0,0,1),f.crossVectors(s[0],i).normalize(),u[0].crossVectors(s[0],f),c[0].crossVectors(s[0],u[0]);for(let E=1;E<=t;E++){if(u[E]=u[E-1].clone(),c[E]=c[E-1].clone(),f.crossVectors(s[E-1],s[E]),f.length()>Number.EPSILON){f.normalize();let M=Math.acos(ii(s[E-1].dot(s[E]),-1,1));u[E].applyMatrix4(p.makeRotationAxis(f,M))}c[E].crossVectors(s[E],u[E])}if(e===!0){let E=Math.acos(ii(u[0].dot(u[t]),-1,1));E/=t,s[0].dot(f.crossVectors(u[0],u[t]))>0&&(E=-E);for(let M=1;M<=t;M++)u[M].applyMatrix4(p.makeRotationAxis(s[M],E*M)),c[M].crossVectors(s[M],u[M])}return{tangents:s,normals:u,binormals:c}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){let t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}},Bc=class extends io{constructor(t=0,e=0,i=1,s=1,u=0,c=Math.PI*2,f=!1,p=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=s,this.aStartAngle=u,this.aEndAngle=c,this.aClockwise=f,this.aRotation=p}getPoint(t,e=new Ht){let i=e,s=Math.PI*2,u=this.aEndAngle-this.aStartAngle,c=Math.abs(u)<Number.EPSILON;for(;u<0;)u+=s;for(;u>s;)u-=s;u<Number.EPSILON&&(c?u=0:u=s),this.aClockwise===!0&&!c&&(u===s?u=-s:u=u-s);let f=this.aStartAngle+t*u,p=this.aX+this.xRadius*Math.cos(f),d=this.aY+this.yRadius*Math.sin(f);if(this.aRotation!==0){let m=Math.cos(this.aRotation),y=Math.sin(this.aRotation),v=p-this.aX,E=d-this.aY;p=v*m-E*y+this.aX,d=v*y+E*m+this.aY}return i.set(p,d)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){let t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}},My=class extends Bc{constructor(t,e,i,s,u,c){super(t,e,i,i,s,u,c),this.isArcCurve=!0,this.type="ArcCurve"}};function Yy(){let n=0,t=0,e=0,i=0;function s(u,c,f,p){n=u,t=f,e=-3*u+3*c-2*f-p,i=2*u-2*c+f+p}return{initCatmullRom:function(u,c,f,p,d){s(c,f,d*(f-u),d*(p-c))},initNonuniformCatmullRom:function(u,c,f,p,d,m,y){let v=(c-u)/d-(f-u)/(d+m)+(f-c)/m,E=(f-c)/m-(p-c)/(m+y)+(p-f)/y;v*=m,E*=m,s(c,f,v,E)},calc:function(u){let c=u*u,f=c*u;return n+t*u+e*c+i*f}}}var Kh=new at,H0=new Yy,W0=new Yy,X0=new Yy,by=class extends io{constructor(t=[],e=!1,i="centripetal",s=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=i,this.tension=s}getPoint(t,e=new at){let i=e,s=this.points,u=s.length,c=(u-(this.closed?0:1))*t,f=Math.floor(c),p=c-f;this.closed?f+=f>0?0:(Math.floor(Math.abs(f)/u)+1)*u:p===0&&f===u-1&&(f=u-2,p=1);let d,m;this.closed||f>0?d=s[(f-1)%u]:(Kh.subVectors(s[0],s[1]).add(s[0]),d=Kh);let y=s[f%u],v=s[(f+1)%u];if(this.closed||f+2<u?m=s[(f+2)%u]:(Kh.subVectors(s[u-1],s[u-2]).add(s[u-1]),m=Kh),this.curveType==="centripetal"||this.curveType==="chordal"){let E=this.curveType==="chordal"?.5:.25,M=Math.pow(d.distanceToSquared(y),E),A=Math.pow(y.distanceToSquared(v),E),_=Math.pow(v.distanceToSquared(m),E);A<1e-4&&(A=1),M<1e-4&&(M=A),_<1e-4&&(_=A),H0.initNonuniformCatmullRom(d.x,y.x,v.x,m.x,M,A,_),W0.initNonuniformCatmullRom(d.y,y.y,v.y,m.y,M,A,_),X0.initNonuniformCatmullRom(d.z,y.z,v.z,m.z,M,A,_)}else this.curveType==="catmullrom"&&(H0.initCatmullRom(d.x,y.x,v.x,m.x,this.tension),W0.initCatmullRom(d.y,y.y,v.y,m.y,this.tension),X0.initCatmullRom(d.z,y.z,v.z,m.z,this.tension));return i.set(H0.calc(p),W0.calc(p),X0.calc(p)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let s=t.points[e];this.points.push(s.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){let t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){let s=this.points[e];t.points.push(s.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let s=t.points[e];this.points.push(new at().fromArray(s))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}};function cT(n,t,e,i,s){let u=(i-t)*.5,c=(s-e)*.5,f=n*n,p=n*f;return(2*e-2*i+u+c)*p+(-3*e+3*i-2*u-c)*f+u*n+e}function w6(n,t){let e=1-n;return e*e*t}function S6(n,t){return 2*(1-n)*n*t}function M6(n,t){return n*n*t}function Lc(n,t,e,i){return w6(n,t)+S6(n,e)+M6(n,i)}function b6(n,t){let e=1-n;return e*e*e*t}function A6(n,t){let e=1-n;return 3*e*e*n*t}function T6(n,t){return 3*(1-n)*n*n*t}function C6(n,t){return n*n*n*t}function Nc(n,t,e,i,s){return b6(n,t)+A6(n,e)+T6(n,i)+C6(n,s)}var Mp=class extends io{constructor(t=new Ht,e=new Ht,i=new Ht,s=new Ht){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=i,this.v3=s}getPoint(t,e=new Ht){let i=e,s=this.v0,u=this.v1,c=this.v2,f=this.v3;return i.set(Nc(t,s.x,u.x,c.x,f.x),Nc(t,s.y,u.y,c.y,f.y)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}},Ay=class extends io{constructor(t=new at,e=new at,i=new at,s=new at){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=i,this.v3=s}getPoint(t,e=new at){let i=e,s=this.v0,u=this.v1,c=this.v2,f=this.v3;return i.set(Nc(t,s.x,u.x,c.x,f.x),Nc(t,s.y,u.y,c.y,f.y),Nc(t,s.z,u.z,c.z,f.z)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}},bp=class extends io{constructor(t=new Ht,e=new Ht){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new Ht){let i=e;return t===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new Ht){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},Ty=class extends io{constructor(t=new at,e=new at){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=t,this.v2=e}getPoint(t,e=new at){let i=e;return t===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new at){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},Ap=class extends io{constructor(t=new Ht,e=new Ht,i=new Ht){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new Ht){let i=e,s=this.v0,u=this.v1,c=this.v2;return i.set(Lc(t,s.x,u.x,c.x),Lc(t,s.y,u.y,c.y)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},Cy=class extends io{constructor(t=new at,e=new at,i=new at){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new at){let i=e,s=this.v0,u=this.v1,c=this.v2;return i.set(Lc(t,s.x,u.x,c.x),Lc(t,s.y,u.y,c.y),Lc(t,s.z,u.z,c.z)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},Tp=class extends io{constructor(t=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=t}getPoint(t,e=new Ht){let i=e,s=this.points,u=(s.length-1)*t,c=Math.floor(u),f=u-c,p=s[c===0?c:c-1],d=s[c],m=s[c>s.length-2?s.length-1:c+1],y=s[c>s.length-3?s.length-1:c+2];return i.set(cT(f,p.x,d.x,m.x,y.x),cT(f,p.y,d.y,m.y,y.y)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let s=t.points[e];this.points.push(s.clone())}return this}toJSON(){let t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){let s=this.points[e];t.points.push(s.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let s=t.points[e];this.points.push(new Ht().fromArray(s))}return this}},Iy=Object.freeze({__proto__:null,ArcCurve:My,CatmullRomCurve3:by,CubicBezierCurve:Mp,CubicBezierCurve3:Ay,EllipseCurve:Bc,LineCurve:bp,LineCurve3:Ty,QuadraticBezierCurve:Ap,QuadraticBezierCurve3:Cy,SplineCurve:Tp}),Py=class extends io{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){let t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);if(!t.equals(e)){let i=t.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new Iy[i](e,t))}return this}getPoint(t,e){let i=t*this.getLength(),s=this.getCurveLengths(),u=0;for(;u<s.length;){if(s[u]>=i){let c=s[u]-i,f=this.curves[u],p=f.getLength(),d=p===0?0:1-c/p;return f.getPointAt(d,e)}u++}return null}getLength(){let t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let t=[],e=0;for(let i=0,s=this.curves.length;i<s;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t,t}getSpacedPoints(t=40){let e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){let e=[],i;for(let s=0,u=this.curves;s<u.length;s++){let c=u[s],f=c.isEllipseCurve?t*2:c.isLineCurve||c.isLineCurve3?1:c.isSplineCurve?t*c.points.length:t,p=c.getPoints(f);for(let d=0;d<p.length;d++){let m=p[d];i&&i.equals(m)||(e.push(m),i=m)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){let s=t.curves[e];this.curves.push(s.clone())}return this.autoClose=t.autoClose,this}toJSON(){let t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,i=this.curves.length;e<i;e++){let s=this.curves[e];t.curves.push(s.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){let s=t.curves[e];this.curves.push(new Iy[s.type]().fromJSON(s))}return this}},pl=class extends Py{constructor(t){super(),this.type="Path",this.currentPoint=new Ht,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,i=t.length;e<i;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){let i=new bp(this.currentPoint.clone(),new Ht(t,e));return this.curves.push(i),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,i,s){let u=new Ap(this.currentPoint.clone(),new Ht(t,e),new Ht(i,s));return this.curves.push(u),this.currentPoint.set(i,s),this}bezierCurveTo(t,e,i,s,u,c){let f=new Mp(this.currentPoint.clone(),new Ht(t,e),new Ht(i,s),new Ht(u,c));return this.curves.push(f),this.currentPoint.set(u,c),this}splineThru(t){let e=[this.currentPoint.clone()].concat(t),i=new Tp(e);return this.curves.push(i),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,i,s,u,c){let f=this.currentPoint.x,p=this.currentPoint.y;return this.absarc(t+f,e+p,i,s,u,c),this}absarc(t,e,i,s,u,c){return this.absellipse(t,e,i,i,s,u,c),this}ellipse(t,e,i,s,u,c,f,p){let d=this.currentPoint.x,m=this.currentPoint.y;return this.absellipse(t+d,e+m,i,s,u,c,f,p),this}absellipse(t,e,i,s,u,c,f,p){let d=new Bc(t,e,i,s,u,c,f,p);if(this.curves.length>0){let y=d.getPoint(0);y.equals(this.currentPoint)||this.lineTo(y.x,y.y)}this.curves.push(d);let m=d.getPoint(1);return this.currentPoint.copy(m),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){let t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}};var dl=class extends pl{constructor(t){super(t),this.uuid=As(),this.type="Shape",this.holes=[]}getPointsHoles(t){let e=[];for(let i=0,s=this.holes.length;i<s;i++)e[i]=this.holes[i].getPoints(t);return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let e=0,i=t.holes.length;e<i;e++){let s=t.holes[e];this.holes.push(s.clone())}return this}toJSON(){let t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,i=this.holes.length;e<i;e++){let s=this.holes[e];t.holes.push(s.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,i=t.holes.length;e<i;e++){let s=t.holes[e];this.holes.push(new pl().fromJSON(s))}return this}},I6={triangulate:function(n,t,e=2){let i=t&&t.length,s=i?t[0]*e:n.length,u=FT(n,0,s,e,!0),c=[];if(!u||u.next===u.prev)return c;let f,p,d,m,y,v,E;if(i&&(u=O6(n,t,u,e)),n.length>80*e){f=d=n[0],p=m=n[1];for(let M=e;M<s;M+=e)y=n[M],v=n[M+1],y<f&&(f=y),v<p&&(p=v),y>d&&(d=y),v>m&&(m=v);E=Math.max(d-f,m-p),E=E!==0?32767/E:0}return zc(u,c,e,f,p,E,0),c}};function FT(n,t,e,i,s){let u,c;if(s===W6(n,t,e,i)>0)for(u=t;u<e;u+=i)c=fT(u,n[u],n[u+1],c);else for(u=e-i;u>=t;u-=i)c=fT(u,n[u],n[u+1],c);return c&&Rp(c,c.next)&&(kc(c),c=c.next),c}function Ka(n,t){if(!n)return n;t||(t=n);let e=n,i;do if(i=!1,!e.steiner&&(Rp(e,e.next)||Jn(e.prev,e,e.next)===0)){if(kc(e),e=t=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==t);return t}function zc(n,t,e,i,s,u,c){if(!n)return;!c&&u&&z6(n,i,s,u);let f=n,p,d;for(;n.prev!==n.next;){if(p=n.prev,d=n.next,u?R6(n,i,s,u):P6(n)){t.push(p.i/e|0),t.push(n.i/e|0),t.push(d.i/e|0),kc(n),n=d.next,f=d.next;continue}if(n=d,n===f){c?c===1?(n=L6(Ka(n),t,e),zc(n,t,e,i,s,u,2)):c===2&&N6(n,t,e,i,s,u):zc(Ka(n),t,e,i,s,u,1);break}}}function P6(n){let t=n.prev,e=n,i=n.next;if(Jn(t,e,i)>=0)return!1;let s=t.x,u=e.x,c=i.x,f=t.y,p=e.y,d=i.y,m=s<u?s<c?s:c:u<c?u:c,y=f<p?f<d?f:d:p<d?p:d,v=s>u?s>c?s:c:u>c?u:c,E=f>p?f>d?f:d:p>d?p:d,M=i.next;for(;M!==t;){if(M.x>=m&&M.x<=v&&M.y>=y&&M.y<=E&&ol(s,f,u,p,c,d,M.x,M.y)&&Jn(M.prev,M,M.next)>=0)return!1;M=M.next}return!0}function R6(n,t,e,i){let s=n.prev,u=n,c=n.next;if(Jn(s,u,c)>=0)return!1;let f=s.x,p=u.x,d=c.x,m=s.y,y=u.y,v=c.y,E=f<p?f<d?f:d:p<d?p:d,M=m<y?m<v?m:v:y<v?y:v,A=f>p?f>d?f:d:p>d?p:d,_=m>y?m>v?m:v:y>v?y:v,x=Ry(E,M,t,e,i),T=Ry(A,_,t,e,i),S=n.prevZ,R=n.nextZ;for(;S&&S.z>=x&&R&&R.z<=T;){if(S.x>=E&&S.x<=A&&S.y>=M&&S.y<=_&&S!==s&&S!==c&&ol(f,m,p,y,d,v,S.x,S.y)&&Jn(S.prev,S,S.next)>=0||(S=S.prevZ,R.x>=E&&R.x<=A&&R.y>=M&&R.y<=_&&R!==s&&R!==c&&ol(f,m,p,y,d,v,R.x,R.y)&&Jn(R.prev,R,R.next)>=0))return!1;R=R.nextZ}for(;S&&S.z>=x;){if(S.x>=E&&S.x<=A&&S.y>=M&&S.y<=_&&S!==s&&S!==c&&ol(f,m,p,y,d,v,S.x,S.y)&&Jn(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;R&&R.z<=T;){if(R.x>=E&&R.x<=A&&R.y>=M&&R.y<=_&&R!==s&&R!==c&&ol(f,m,p,y,d,v,R.x,R.y)&&Jn(R.prev,R,R.next)>=0)return!1;R=R.nextZ}return!0}function L6(n,t,e){let i=n;do{let s=i.prev,u=i.next.next;!Rp(s,u)&&UT(s,i,i.next,u)&&Gc(s,u)&&Gc(u,s)&&(t.push(s.i/e|0),t.push(i.i/e|0),t.push(u.i/e|0),kc(i),kc(i.next),i=n=u),i=i.next}while(i!==n);return Ka(i)}function N6(n,t,e,i,s,u){let c=n;do{let f=c.next.next;for(;f!==c.prev;){if(c.i!==f.i&&q6(c,f)){let p=BT(c,f);c=Ka(c,c.next),p=Ka(p,p.next),zc(c,t,e,i,s,u,0),zc(p,t,e,i,s,u,0);return}f=f.next}c=c.next}while(c!==n)}function O6(n,t,e,i){let s=[],u,c,f,p,d;for(u=0,c=t.length;u<c;u++)f=t[u]*i,p=u<c-1?t[u+1]*i:n.length,d=FT(n,f,p,i,!1),d===d.next&&(d.steiner=!0),s.push(k6(d));for(s.sort(D6),u=0;u<s.length;u++)e=F6(s[u],e);return e}function D6(n,t){return n.x-t.x}function F6(n,t){let e=U6(n,t);if(!e)return t;let i=BT(e,n);return Ka(i,i.next),Ka(e,e.next)}function U6(n,t){let e=t,i=-1/0,s,u=n.x,c=n.y;do{if(c<=e.y&&c>=e.next.y&&e.next.y!==e.y){let v=e.x+(c-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(v<=u&&v>i&&(i=v,s=e.x<e.next.x?e:e.next,v===u))return s}e=e.next}while(e!==t);if(!s)return null;let f=s,p=s.x,d=s.y,m=1/0,y;e=s;do u>=e.x&&e.x>=p&&u!==e.x&&ol(c<d?u:i,c,p,d,c<d?i:u,c,e.x,e.y)&&(y=Math.abs(c-e.y)/(u-e.x),Gc(e,n)&&(y<m||y===m&&(e.x>s.x||e.x===s.x&&B6(s,e)))&&(s=e,m=y)),e=e.next;while(e!==f);return s}function B6(n,t){return Jn(n.prev,n,t.prev)<0&&Jn(t.next,n,n.next)<0}function z6(n,t,e,i){let s=n;do s.z===0&&(s.z=Ry(s.x,s.y,t,e,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==n);s.prevZ.nextZ=null,s.prevZ=null,G6(s)}function G6(n){let t,e,i,s,u,c,f,p,d=1;do{for(e=n,n=null,u=null,c=0;e;){for(c++,i=e,f=0,t=0;t<d&&(f++,i=i.nextZ,!!i);t++);for(p=d;f>0||p>0&&i;)f!==0&&(p===0||!i||e.z<=i.z)?(s=e,e=e.nextZ,f--):(s=i,i=i.nextZ,p--),u?u.nextZ=s:n=s,s.prevZ=u,u=s;e=i}u.nextZ=null,d*=2}while(c>1);return n}function Ry(n,t,e,i,s){return n=(n-e)*s|0,t=(t-i)*s|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n|t<<1}function k6(n){let t=n,e=n;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==n);return e}function ol(n,t,e,i,s,u,c,f){return(s-c)*(t-f)>=(n-c)*(u-f)&&(n-c)*(i-f)>=(e-c)*(t-f)&&(e-c)*(u-f)>=(s-c)*(i-f)}function q6(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!V6(n,t)&&(Gc(n,t)&&Gc(t,n)&&H6(n,t)&&(Jn(n.prev,n,t.prev)||Jn(n,t.prev,t))||Rp(n,t)&&Jn(n.prev,n,n.next)>0&&Jn(t.prev,t,t.next)>0)}function Jn(n,t,e){return(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y)}function Rp(n,t){return n.x===t.x&&n.y===t.y}function UT(n,t,e,i){let s=tp(Jn(n,t,e)),u=tp(Jn(n,t,i)),c=tp(Jn(e,i,n)),f=tp(Jn(e,i,t));return!!(s!==u&&c!==f||s===0&&Qh(n,e,t)||u===0&&Qh(n,i,t)||c===0&&Qh(e,n,i)||f===0&&Qh(e,t,i))}function Qh(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 tp(n){return n>0?1:n<0?-1:0}function V6(n,t){let e=n;do{if(e.i!==n.i&&e.next.i!==n.i&&e.i!==t.i&&e.next.i!==t.i&&UT(e,e.next,n,t))return!0;e=e.next}while(e!==n);return!1}function Gc(n,t){return Jn(n.prev,n,n.next)<0?Jn(n,t,n.next)>=0&&Jn(n,n.prev,t)>=0:Jn(n,t,n.prev)<0||Jn(n,n.next,t)<0}function H6(n,t){let e=n,i=!1,s=(n.x+t.x)/2,u=(n.y+t.y)/2;do e.y>u!=e.next.y>u&&e.next.y!==e.y&&s<(e.next.x-e.x)*(u-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==n);return i}function BT(n,t){let e=new Ly(n.i,n.x,n.y),i=new Ly(t.i,t.x,t.y),s=n.next,u=t.prev;return n.next=t,t.prev=n,e.next=s,s.prev=e,i.next=e,e.prev=i,u.next=i,i.prev=u,i}function fT(n,t,e,i){let s=new Ly(n,t,e);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function kc(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 Ly(n,t,e){this.i=n,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function W6(n,t,e,i){let s=0;for(let u=t,c=e-i;u<e;u+=i)s+=(n[c]-n[u])*(n[u+1]+n[c+1]),c=u;return s}var oa=class n{static area(t){let e=t.length,i=0;for(let s=e-1,u=0;u<e;s=u++)i+=t[s].x*t[u].y-t[u].x*t[s].y;return i*.5}static isClockWise(t){return n.area(t)<0}static triangulateShape(t,e){let i=[],s=[],u=[];hT(t),pT(i,t);let c=t.length;e.forEach(hT);for(let p=0;p<e.length;p++)s.push(c),c+=e[p].length,pT(i,e[p]);let f=I6.triangulate(i,s);for(let p=0;p<f.length;p+=3)u.push(f.slice(p,p+3));return u}};function hT(n){let t=n.length;t>2&&n[t-1].equals(n[0])&&n.pop()}function pT(n,t){for(let e=0;e<t.length;e++)n.push(t[e].x),n.push(t[e].y)}var ml=class n extends Ri{constructor(t=new dl([new Ht(.5,.5),new Ht(-.5,.5),new Ht(-.5,-.5),new Ht(.5,-.5)]),e={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];let i=this,s=[],u=[];for(let f=0,p=t.length;f<p;f++){let d=t[f];c(d)}this.setAttribute("position",new Wr(s,3)),this.setAttribute("uv",new Wr(u,2)),this.computeVertexNormals();function c(f){let p=[],d=e.curveSegments!==void 0?e.curveSegments:12,m=e.steps!==void 0?e.steps:1,y=e.depth!==void 0?e.depth:1,v=e.bevelEnabled!==void 0?e.bevelEnabled:!0,E=e.bevelThickness!==void 0?e.bevelThickness:.2,M=e.bevelSize!==void 0?e.bevelSize:E-.1,A=e.bevelOffset!==void 0?e.bevelOffset:0,_=e.bevelSegments!==void 0?e.bevelSegments:3,x=e.extrudePath,T=e.UVGenerator!==void 0?e.UVGenerator:X6,S,R=!1,z,U,D,P;x&&(S=x.getSpacedPoints(m),R=!0,v=!1,z=x.computeFrenetFrames(m,!1),U=new at,D=new at,P=new at),v||(_=0,E=0,M=0,A=0);let ct=f.extractPoints(d),L=ct.shape,W=ct.holes;if(!oa.isClockWise(L)){L=L.reverse();for(let $=0,Ot=W.length;$<Ot;$++){let _t=W[$];oa.isClockWise(_t)&&(W[$]=_t.reverse())}}let Mt=oa.triangulateShape(L,W),Y=L;for(let $=0,Ot=W.length;$<Ot;$++){let _t=W[$];L=L.concat(_t)}function mt($,Ot,_t){return Ot||console.error("THREE.ExtrudeGeometry: vec does not exist"),$.clone().addScaledVector(Ot,_t)}let ft=L.length,vt=Mt.length;function it($,Ot,_t){let Nt,St,Vt,Xt=$.x-Ot.x,Pt=$.y-Ot.y,ee=_t.x-$.x,X=_t.y-$.y,N=Xt*Xt+Pt*Pt,xt=Xt*X-Pt*ee;if(Math.abs(xt)>Number.EPSILON){let wt=Math.sqrt(N),ot=Math.sqrt(ee*ee+X*X),Lt=Ot.x-Pt/wt,ce=Ot.y+Xt/wt,Rt=_t.x-X/ot,Ut=_t.y+ee/ot,Wt=((Rt-Lt)*X-(Ut-ce)*ee)/(Xt*X-Pt*ee);Nt=Lt+Xt*Wt-$.x,St=ce+Pt*Wt-$.y;let j=Nt*Nt+St*St;if(j<=2)return new Ht(Nt,St);Vt=Math.sqrt(j/2)}else{let wt=!1;Xt>Number.EPSILON?ee>Number.EPSILON&&(wt=!0):Xt<-Number.EPSILON?ee<-Number.EPSILON&&(wt=!0):Math.sign(Pt)===Math.sign(X)&&(wt=!0),wt?(Nt=-Pt,St=Xt,Vt=Math.sqrt(N)):(Nt=Xt,St=Pt,Vt=Math.sqrt(N/2))}return new Ht(Nt/Vt,St/Vt)}let lt=[];for(let $=0,Ot=Y.length,_t=Ot-1,Nt=$+1;$<Ot;$++,_t++,Nt++)_t===Ot&&(_t=0),Nt===Ot&&(Nt=0),lt[$]=it(Y[$],Y[_t],Y[Nt]);let H=[],At,It=lt.concat();for(let $=0,Ot=W.length;$<Ot;$++){let _t=W[$];At=[];for(let Nt=0,St=_t.length,Vt=St-1,Xt=Nt+1;Nt<St;Nt++,Vt++,Xt++)Vt===St&&(Vt=0),Xt===St&&(Xt=0),At[Nt]=it(_t[Nt],_t[Vt],_t[Xt]);H.push(At),It=It.concat(At)}for(let $=0;$<_;$++){let Ot=$/_,_t=E*Math.cos(Ot*Math.PI/2),Nt=M*Math.sin(Ot*Math.PI/2)+A;for(let St=0,Vt=Y.length;St<Vt;St++){let Xt=mt(Y[St],lt[St],Nt);$t(Xt.x,Xt.y,-_t)}for(let St=0,Vt=W.length;St<Vt;St++){let Xt=W[St];At=H[St];for(let Pt=0,ee=Xt.length;Pt<ee;Pt++){let X=mt(Xt[Pt],At[Pt],Nt);$t(X.x,X.y,-_t)}}}let jt=M+A;for(let $=0;$<ft;$++){let Ot=v?mt(L[$],It[$],jt):L[$];R?(D.copy(z.normals[0]).multiplyScalar(Ot.x),U.copy(z.binormals[0]).multiplyScalar(Ot.y),P.copy(S[0]).add(D).add(U),$t(P.x,P.y,P.z)):$t(Ot.x,Ot.y,0)}for(let $=1;$<=m;$++)for(let Ot=0;Ot<ft;Ot++){let _t=v?mt(L[Ot],It[Ot],jt):L[Ot];R?(D.copy(z.normals[$]).multiplyScalar(_t.x),U.copy(z.binormals[$]).multiplyScalar(_t.y),P.copy(S[$]).add(D).add(U),$t(P.x,P.y,P.z)):$t(_t.x,_t.y,y/m*$)}for(let $=_-1;$>=0;$--){let Ot=$/_,_t=E*Math.cos(Ot*Math.PI/2),Nt=M*Math.sin(Ot*Math.PI/2)+A;for(let St=0,Vt=Y.length;St<Vt;St++){let Xt=mt(Y[St],lt[St],Nt);$t(Xt.x,Xt.y,y+_t)}for(let St=0,Vt=W.length;St<Vt;St++){let Xt=W[St];At=H[St];for(let Pt=0,ee=Xt.length;Pt<ee;Pt++){let X=mt(Xt[Pt],At[Pt],Nt);R?$t(X.x,X.y+S[m-1].y,S[m-1].x+_t):$t(X.x,X.y,y+_t)}}}nt(),bt();function nt(){let $=s.length/3;if(v){let Ot=0,_t=ft*Ot;for(let Nt=0;Nt<vt;Nt++){let St=Mt[Nt];Ft(St[2]+_t,St[1]+_t,St[0]+_t)}Ot=m+_*2,_t=ft*Ot;for(let Nt=0;Nt<vt;Nt++){let St=Mt[Nt];Ft(St[0]+_t,St[1]+_t,St[2]+_t)}}else{for(let Ot=0;Ot<vt;Ot++){let _t=Mt[Ot];Ft(_t[2],_t[1],_t[0])}for(let Ot=0;Ot<vt;Ot++){let _t=Mt[Ot];Ft(_t[0]+ft*m,_t[1]+ft*m,_t[2]+ft*m)}}i.addGroup($,s.length/3-$,0)}function bt(){let $=s.length/3,Ot=0;qt(Y,Ot),Ot+=Y.length;for(let _t=0,Nt=W.length;_t<Nt;_t++){let St=W[_t];qt(St,Ot),Ot+=St.length}i.addGroup($,s.length/3-$,1)}function qt($,Ot){let _t=$.length;for(;--_t>=0;){let Nt=_t,St=_t-1;St<0&&(St=$.length-1);for(let Vt=0,Xt=m+_*2;Vt<Xt;Vt++){let Pt=ft*Vt,ee=ft*(Vt+1),X=Ot+Nt+Pt,N=Ot+St+Pt,xt=Ot+St+ee,wt=Ot+Nt+ee;zt(X,N,xt,wt)}}}function $t($,Ot,_t){p.push($),p.push(Ot),p.push(_t)}function Ft($,Ot,_t){Ct($),Ct(Ot),Ct(_t);let Nt=s.length/3,St=T.generateTopUV(i,s,Nt-3,Nt-2,Nt-1);te(St[0]),te(St[1]),te(St[2])}function zt($,Ot,_t,Nt){Ct($),Ct(Ot),Ct(Nt),Ct(Ot),Ct(_t),Ct(Nt);let St=s.length/3,Vt=T.generateSideWallUV(i,s,St-6,St-3,St-2,St-1);te(Vt[0]),te(Vt[1]),te(Vt[3]),te(Vt[1]),te(Vt[2]),te(Vt[3])}function Ct($){s.push(p[$*3+0]),s.push(p[$*3+1]),s.push(p[$*3+2])}function te($){u.push($.x),u.push($.y)}}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){let t=super.toJSON(),e=this.parameters.shapes,i=this.parameters.options;return Y6(e,i,t)}static fromJSON(t,e){let i=[];for(let u=0,c=t.shapes.length;u<c;u++){let f=e[t.shapes[u]];i.push(f)}let s=t.options.extrudePath;return s!==void 0&&(t.options.extrudePath=new Iy[s.type]().fromJSON(s)),new n(i,t.options)}},X6={generateTopUV:function(n,t,e,i,s){let u=t[e*3],c=t[e*3+1],f=t[i*3],p=t[i*3+1],d=t[s*3],m=t[s*3+1];return[new Ht(u,c),new Ht(f,p),new Ht(d,m)]},generateSideWallUV:function(n,t,e,i,s,u){let c=t[e*3],f=t[e*3+1],p=t[e*3+2],d=t[i*3],m=t[i*3+1],y=t[i*3+2],v=t[s*3],E=t[s*3+1],M=t[s*3+2],A=t[u*3],_=t[u*3+1],x=t[u*3+2];return Math.abs(f-m)<Math.abs(c-d)?[new Ht(c,1-p),new Ht(d,1-y),new Ht(v,1-M),new Ht(A,1-x)]:[new Ht(f,1-p),new Ht(m,1-y),new Ht(E,1-M),new Ht(_,1-x)]}};function Y6(n,t,e){if(e.shapes=[],Array.isArray(n))for(let i=0,s=n.length;i<s;i++){let u=n[i];e.shapes.push(u.uuid)}else e.shapes.push(n.uuid);return e.options=Object.assign({},t),t.extrudePath!==void 0&&(e.options.extrudePath=t.extrudePath.toJSON()),e}var qc=class n extends Ri{constructor(t=new dl([new Ht(0,.5),new Ht(-.5,-.5),new Ht(.5,-.5)]),e=12){super(),this.type="ShapeGeometry",this.parameters={shapes:t,curveSegments:e};let i=[],s=[],u=[],c=[],f=0,p=0;if(Array.isArray(t)===!1)d(t);else for(let m=0;m<t.length;m++)d(t[m]),this.addGroup(f,p,m),f+=p,p=0;this.setIndex(i),this.setAttribute("position",new Wr(s,3)),this.setAttribute("normal",new Wr(u,3)),this.setAttribute("uv",new Wr(c,2));function d(m){let y=s.length/3,v=m.extractPoints(e),E=v.shape,M=v.holes;oa.isClockWise(E)===!1&&(E=E.reverse());for(let _=0,x=M.length;_<x;_++){let T=M[_];oa.isClockWise(T)===!0&&(M[_]=T.reverse())}let A=oa.triangulateShape(E,M);for(let _=0,x=M.length;_<x;_++){let T=M[_];E=E.concat(T)}for(let _=0,x=E.length;_<x;_++){let T=E[_];s.push(T.x,T.y,0),u.push(0,0,1),c.push(T.x,T.y)}for(let _=0,x=A.length;_<x;_++){let T=A[_],S=T[0]+y,R=T[1]+y,z=T[2]+y;i.push(S,R,z),p+=3}}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){let t=super.toJSON(),e=this.parameters.shapes;return $6(e,t)}static fromJSON(t,e){let i=[];for(let s=0,u=t.shapes.length;s<u;s++){let c=e[t.shapes[s]];i.push(c)}return new n(i,t.curveSegments)}};function $6(n,t){if(t.shapes=[],Array.isArray(n))for(let e=0,i=n.length;e<i;e++){let s=n[e];t.shapes.push(s.uuid)}else t.shapes.push(n.uuid);return t}function ep(n,t,e){return!n||!e&&n.constructor===t?n:typeof t.BYTES_PER_ELEMENT=="number"?new t(n):Array.prototype.slice.call(n)}function Z6(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}var gl=class{constructor(t,e,i,s){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=s!==void 0?s:new e.constructor(i),this.sampleValues=e,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(t){let e=this.parameterPositions,i=this._cachedIndex,s=e[i],u=e[i-1];n:{t:{let c;e:{r:if(!(t<s)){for(let f=i+2;;){if(s===void 0){if(t<u)break r;return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===f)break;if(u=s,s=e[++i],t<s)break t}c=e.length;break e}if(!(t>=u)){let f=e[1];t<f&&(i=2,u=f);for(let p=i-2;;){if(u===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===p)break;if(s=u,u=e[--i-1],t>=u)break t}c=i,i=0;break e}break n}for(;i<c;){let f=i+c>>>1;t<e[f]?c=f:i=f+1}if(s=e[i],u=e[i-1],u===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(s===void 0)return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,u,s)}return this.interpolate_(i,u,t,s)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,i=this.sampleValues,s=this.valueSize,u=t*s;for(let c=0;c!==s;++c)e[c]=i[u+c];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},Ny=class extends gl{constructor(t,e,i,s){super(t,e,i,s),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:yA,endingEnd:yA}}intervalChanged_(t,e,i){let s=this.parameterPositions,u=t-2,c=t+1,f=s[u],p=s[c];if(f===void 0)switch(this.getSettings_().endingStart){case vA:u=t,f=2*e-i;break;case _A:u=s.length-2,f=e+s[u]-s[u+1];break;default:u=t,f=i}if(p===void 0)switch(this.getSettings_().endingEnd){case vA:c=t,p=2*i-e;break;case _A:c=1,p=i+s[1]-s[0];break;default:c=t-1,p=e}let d=(i-e)*.5,m=this.valueSize;this._weightPrev=d/(e-f),this._weightNext=d/(p-i),this._offsetPrev=u*m,this._offsetNext=c*m}interpolate_(t,e,i,s){let u=this.resultBuffer,c=this.sampleValues,f=this.valueSize,p=t*f,d=p-f,m=this._offsetPrev,y=this._offsetNext,v=this._weightPrev,E=this._weightNext,M=(i-e)/(s-e),A=M*M,_=A*M,x=-v*_+2*v*A-v*M,T=(1+v)*_+(-1.5-2*v)*A+(-.5+v)*M+1,S=(-1-E)*_+(1.5+E)*A+.5*M,R=E*_-E*A;for(let z=0;z!==f;++z)u[z]=x*c[m+z]+T*c[d+z]+S*c[p+z]+R*c[y+z];return u}},Oy=class extends gl{constructor(t,e,i,s){super(t,e,i,s)}interpolate_(t,e,i,s){let u=this.resultBuffer,c=this.sampleValues,f=this.valueSize,p=t*f,d=p-f,m=(i-e)/(s-e),y=1-m;for(let v=0;v!==f;++v)u[v]=c[d+v]*y+c[p+v]*m;return u}},Dy=class extends gl{constructor(t,e,i,s){super(t,e,i,s)}interpolate_(t){return this.copySampleValue_(t-1)}},Io=class{constructor(t,e,i,s){if(t===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(e===void 0||e.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=ep(e,this.TimeBufferType),this.values=ep(i,this.ValueBufferType),this.setInterpolation(s||this.DefaultInterpolation)}static toJSON(t){let e=t.constructor,i;if(e.toJSON!==this.toJSON)i=e.toJSON(t);else{i={name:t.name,times:ep(t.times,Array),values:ep(t.values,Array)};let s=t.getInterpolation();s!==t.DefaultInterpolation&&(i.interpolation=s)}return i.type=t.ValueTypeName,i}InterpolantFactoryMethodDiscrete(t){return new Dy(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new Oy(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new Ny(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case rp:e=this.InterpolantFactoryMethodDiscrete;break;case ip:e=this.InterpolantFactoryMethodLinear;break;case g0:e=this.InterpolantFactoryMethodSmooth;break}if(e===void 0){let i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(i);return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return rp;case this.InterpolantFactoryMethodLinear:return ip;case this.InterpolantFactoryMethodSmooth:return g0}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){let e=this.times;for(let i=0,s=e.length;i!==s;++i)e[i]+=t}return this}scale(t){if(t!==1){let e=this.times;for(let i=0,s=e.length;i!==s;++i)e[i]*=t}return this}trim(t,e){let i=this.times,s=i.length,u=0,c=s-1;for(;u!==s&&i[u]<t;)++u;for(;c!==-1&&i[c]>e;)--c;if(++c,u!==0||c!==s){u>=c&&(c=Math.max(c,1),u=c-1);let f=this.getValueSize();this.times=i.slice(u,c),this.values=this.values.slice(u*f,c*f)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);let i=this.times,s=this.values,u=i.length;u===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let c=null;for(let f=0;f!==u;f++){let p=i[f];if(typeof p=="number"&&isNaN(p)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,f,p),t=!1;break}if(c!==null&&c>p){console.error("THREE.KeyframeTrack: Out of order keys.",this,f,p,c),t=!1;break}c=p}if(s!==void 0&&Z6(s))for(let f=0,p=s.length;f!==p;++f){let d=s[f];if(isNaN(d)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,f,d),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),i=this.getValueSize(),s=this.getInterpolation()===g0,u=t.length-1,c=1;for(let f=1;f<u;++f){let p=!1,d=t[f],m=t[f+1];if(d!==m&&(f!==1||d!==t[0]))if(s)p=!0;else{let y=f*i,v=y-i,E=y+i;for(let M=0;M!==i;++M){let A=e[y+M];if(A!==e[v+M]||A!==e[E+M]){p=!0;break}}}if(p){if(f!==c){t[c]=t[f];let y=f*i,v=c*i;for(let E=0;E!==i;++E)e[v+E]=e[y+E]}++c}}if(u>0){t[c]=t[u];for(let f=u*i,p=c*i,d=0;d!==i;++d)e[p+d]=e[f+d];++c}return c!==t.length?(this.times=t.slice(0,c),this.values=e.slice(0,c*i)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),i=this.constructor,s=new i(this.name,t,e);return s.createInterpolant=this.createInterpolant,s}};Io.prototype.TimeBufferType=Float32Array;Io.prototype.ValueBufferType=Float32Array;Io.prototype.DefaultInterpolation=ip;var Qa=class extends Io{};Qa.prototype.ValueTypeName="bool";Qa.prototype.ValueBufferType=Array;Qa.prototype.DefaultInterpolation=rp;Qa.prototype.InterpolantFactoryMethodLinear=void 0;Qa.prototype.InterpolantFactoryMethodSmooth=void 0;var Fy=class extends Io{};Fy.prototype.ValueTypeName="color";var Uy=class extends Io{};Uy.prototype.ValueTypeName="number";var By=class extends gl{constructor(t,e,i,s){super(t,e,i,s)}interpolate_(t,e,i,s){let u=this.resultBuffer,c=this.sampleValues,f=this.valueSize,p=(i-e)/(s-e),d=t*f;for(let m=d+f;d!==m;d+=4)Cs.slerpFlat(u,0,c,d-f,c,d,p);return u}},Vc=class extends Io{InterpolantFactoryMethodLinear(t){return new By(this.times,this.values,this.getValueSize(),t)}};Vc.prototype.ValueTypeName="quaternion";Vc.prototype.DefaultInterpolation=ip;Vc.prototype.InterpolantFactoryMethodSmooth=void 0;var tu=class extends Io{};tu.prototype.ValueTypeName="string";tu.prototype.ValueBufferType=Array;tu.prototype.DefaultInterpolation=rp;tu.prototype.InterpolantFactoryMethodLinear=void 0;tu.prototype.InterpolantFactoryMethodSmooth=void 0;var zy=class extends Io{};zy.prototype.ValueTypeName="vector";var Gy=class{constructor(t,e,i){let s=this,u=!1,c=0,f=0,p,d=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this.itemStart=function(m){f++,u===!1&&s.onStart!==void 0&&s.onStart(m,c,f),u=!0},this.itemEnd=function(m){c++,s.onProgress!==void 0&&s.onProgress(m,c,f),c===f&&(u=!1,s.onLoad!==void 0&&s.onLoad())},this.itemError=function(m){s.onError!==void 0&&s.onError(m)},this.resolveURL=function(m){return p?p(m):m},this.setURLModifier=function(m){return p=m,this},this.addHandler=function(m,y){return d.push(m,y),this},this.removeHandler=function(m){let y=d.indexOf(m);return y!==-1&&d.splice(y,2),this},this.getHandler=function(m){for(let y=0,v=d.length;y<v;y+=2){let E=d[y],M=d[y+1];if(E.global&&(E.lastIndex=0),E.test(m))return M}return null}}},J6=new Gy,ky=class{constructor(t){this.manager=t!==void 0?t:J6,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){let i=this;return new Promise(function(s,u){i.load(t,s,e,u)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}};ky.DEFAULT_MATERIAL_NAME="__DEFAULT";var $y="\\\\[\\\\]\\\\.:\\\\/",j6=new RegExp("["+$y+"]","g"),Zy="[^"+$y+"]",K6="[^"+$y.replace("\\\\.","")+"]",Q6=/((?:WC+[\\/:])*)/.source.replace("WC",Zy),t8=/(WCOD+)?/.source.replace("WCOD",K6),e8=/(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace("WC",Zy),n8=/\\.(WC+)(?:\\[(.+)\\])?/.source.replace("WC",Zy),r8=new RegExp("^"+Q6+t8+e8+n8+"$"),i8=["material","materials","bones","map"],qy=class{constructor(t,e,i){let s=i||Xn.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,s)}getValue(t,e){this.bind();let i=this._targetGroup.nCachedObjects_,s=this._bindings[i];s!==void 0&&s.getValue(t,e)}setValue(t,e){let i=this._bindings;for(let s=this._targetGroup.nCachedObjects_,u=i.length;s!==u;++s)i[s].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}},Xn=class n{constructor(t,e,i){this.path=e,this.parsedPath=i||n.parseTrackName(e),this.node=n.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,i){return t&&t.isAnimationObjectGroup?new n.Composite(t,e,i):new n(t,e,i)}static sanitizeNodeName(t){return t.replace(/\\s/g,"_").replace(j6,"")}static parseTrackName(t){let e=r8.exec(t);if(e===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);let i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},s=i.nodeName&&i.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){let u=i.nodeName.substring(s+1);i8.indexOf(u)!==-1&&(i.nodeName=i.nodeName.substring(0,s),i.objectName=u)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}static findNode(t,e){if(e===void 0||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){let i=t.skeleton.getBoneByName(e);if(i!==void 0)return i}if(t.children){let i=function(u){for(let c=0;c<u.length;c++){let f=u[c];if(f.name===e||f.uuid===e)return f;let p=i(f.children);if(p)return p}return null},s=i(t.children);if(s)return s}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){let i=this.resolvedProperty;for(let s=0,u=i.length;s!==u;++s)t[e++]=i[s]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){let i=this.resolvedProperty;for(let s=0,u=i.length;s!==u;++s)i[s]=t[e++]}_setValue_array_setNeedsUpdate(t,e){let i=this.resolvedProperty;for(let s=0,u=i.length;s!==u;++s)i[s]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){let i=this.resolvedProperty;for(let s=0,u=i.length;s!==u;++s)i[s]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node,e=this.parsedPath,i=e.objectName,s=e.propertyName,u=e.propertyIndex;if(t||(t=n.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(i){let d=e.objectIndex;switch(i){case"materials":if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}t=t.material.materials;break;case"bones":if(!t.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}t=t.skeleton.bones;for(let m=0;m<t.length;m++)if(t[m].name===d){d=m;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}t=t.material.map;break;default:if(t[i]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}t=t[i]}if(d!==void 0){if(t[d]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);return}t=t[d]}}let c=t[s];if(c===void 0){let d=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+d+"."+s+" but it wasn't found.",t);return}let f=this.Versioning.None;this.targetObject=t,t.needsUpdate!==void 0?f=this.Versioning.NeedsUpdate:t.matrixWorldNeedsUpdate!==void 0&&(f=this.Versioning.MatrixWorldNeedsUpdate);let p=this.BindingType.Direct;if(u!==void 0){if(s==="morphTargetInfluences"){if(!t.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!t.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}t.morphTargetDictionary[u]!==void 0&&(u=t.morphTargetDictionary[u])}p=this.BindingType.ArrayElement,this.resolvedProperty=c,this.propertyIndex=u}else c.fromArray!==void 0&&c.toArray!==void 0?(p=this.BindingType.HasFromToArray,this.resolvedProperty=c):Array.isArray(c)?(p=this.BindingType.EntireArray,this.resolvedProperty=c):this.propertyName=s;this.getValue=this.GetterByBindingType[p],this.setValue=this.SetterByBindingTypeAndVersioning[p][f]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};Xn.Composite=qy;Xn.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Xn.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Xn.prototype.GetterByBindingType=[Xn.prototype._getValue_direct,Xn.prototype._getValue_array,Xn.prototype._getValue_arrayElement,Xn.prototype._getValue_toArray];Xn.prototype.SetterByBindingTypeAndVersioning=[[Xn.prototype._setValue_direct,Xn.prototype._setValue_direct_setNeedsUpdate,Xn.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Xn.prototype._setValue_array,Xn.prototype._setValue_array_setNeedsUpdate,Xn.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Xn.prototype._setValue_arrayElement,Xn.prototype._setValue_arrayElement_setNeedsUpdate,Xn.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Xn.prototype._setValue_fromArray,Xn.prototype._setValue_fromArray_setNeedsUpdate,Xn.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var nQ=new Float32Array(1);typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Vy}}));typeof window!="undefined"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Vy);var yQ=ue(av(),1),vQ=ue(Qf(),1);function vl(n,t){t===void 0&&(t=[]);let e=new dl(n.map(i=>new Ht(...i)));return t.length&&t.forEach(i=>{var s=new pl(i.map(u=>new Ht(...u)));e.holes.push(s)}),e}var Or=63710088e-1,IQ={centimeters:Or*100,centimetres:Or*100,degrees:Or/111325,feet:Or*3.28084,inches:Or*39.37,kilometers:Or/1e3,kilometres:Or/1e3,meters:Or,metres:Or,miles:Or/1609.344,millimeters:Or*1e3,millimetres:Or*1e3,nauticalmiles:Or/1852,radians:1,yards:Or*1.0936},PQ={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/Or,yards:1.0936133};function wi(n,t,e){e===void 0&&(e={});var i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=t||{},i.geometry=n,i}function zn(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(!Zo(n[0])||!Zo(n[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:n};return wi(i,t,e)}function Gn(n,t,e){e===void 0&&(e={});for(var i=0,s=n;i<s.length;i++){var u=s[i];if(u.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var c=0;c<u[u.length-1].length;c++)if(u[u.length-1][c]!==u[0][c])throw new Error("First and last Position are not equivalent.")}var f={type:"Polygon",coordinates:n};return wi(f,t,e)}function Dr(n,t,e){if(e===void 0&&(e={}),n.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:n};return wi(i,t,e)}function gv(n,t,e){e===void 0&&(e={});var i={type:"MultiPoint",coordinates:n};return wi(i,t,e)}function Zo(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}function _r(n,t,e){if(n!==null)for(var i,s,u,c,f,p,d,m=0,y=0,v,E=n.type,M=E==="FeatureCollection",A=E==="Feature",_=M?n.features.length:1,x=0;x<_;x++){d=M?n.features[x].geometry:A?n.geometry:n,v=d?d.type==="GeometryCollection":!1,f=v?d.geometries.length:1;for(var T=0;T<f;T++){var S=0,R=0;if(c=v?d.geometries[T]:d,c!==null){p=c.coordinates;var z=c.type;switch(m=e&&(z==="Polygon"||z==="MultiPolygon")?1:0,z){case null:break;case"Point":if(t(p,y,x,S,R)===!1)return!1;y++,S++;break;case"LineString":case"MultiPoint":for(i=0;i<p.length;i++){if(t(p[i],y,x,S,R)===!1)return!1;y++,z==="MultiPoint"&&S++}z==="LineString"&&S++;break;case"Polygon":case"MultiLineString":for(i=0;i<p.length;i++){for(s=0;s<p[i].length-m;s++){if(t(p[i][s],y,x,S,R)===!1)return!1;y++}z==="MultiLineString"&&S++,z==="Polygon"&&R++}z==="Polygon"&&S++;break;case"MultiPolygon":for(i=0;i<p.length;i++){for(R=0,s=0;s<p[i].length;s++){for(u=0;u<p[i][s].length-m;u++){if(t(p[i][s][u],y,x,S,R)===!1)return!1;y++}R++}S++}break;case"GeometryCollection":for(i=0;i<c.geometries.length;i++)if(_r(c.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function LC(n,t,e,i){var s=e;return _r(n,function(u,c,f,p,d){c===0&&e===void 0?s=u:s=t(s,u,c,f,p,d)},i),s}function la(n,t){var e,i,s,u,c,f,p,d,m,y,v=0,E=n.type==="FeatureCollection",M=n.type==="Feature",A=E?n.features.length:1;for(e=0;e<A;e++){for(f=E?n.features[e].geometry:M?n.geometry:n,d=E?n.features[e].properties:M?n.properties:{},m=E?n.features[e].bbox:M?n.bbox:void 0,y=E?n.features[e].id:M?n.id:void 0,p=f?f.type==="GeometryCollection":!1,c=p?f.geometries.length:1,s=0;s<c;s++){if(u=p?f.geometries[s]:f,u===null){if(t(null,v,d,m,y)===!1)return!1;continue}switch(u.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(u,v,d,m,y)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<u.geometries.length;i++)if(t(u.geometries[i],v,d,m,y)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}v++}}function Wi(n,t){la(n,function(e,i,s,u,c){var f=e===null?null:e.type;switch(f){case null:case"Point":case"LineString":case"Polygon":return t(wi(e,s,{bbox:u,id:c}),i,0)===!1?!1:void 0}var p;switch(f){case"MultiPoint":p="Point";break;case"MultiLineString":p="LineString";break;case"MultiPolygon":p="Polygon";break}for(var d=0;d<e.coordinates.length;d++){var m=e.coordinates[d],y={type:p,coordinates:m};if(t(wi(y,s),i,d)===!1)return!1}})}function yv(n){var t=[1/0,1/0,-1/0,-1/0];return _r(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}yv.default=yv;var Si=yv;function Xr(n){if(!n)throw new Error("coord is required");if(!Array.isArray(n)){if(n.type==="Feature"&&n.geometry!==null&&n.geometry.type==="Point")return n.geometry.coordinates;if(n.type==="Point")return n.coordinates}if(Array.isArray(n)&&n.length>=2&&!Array.isArray(n[0])&&!Array.isArray(n[1]))return n;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function vv(n,t,e){if(!n)throw new Error("No feature passed");if(!e)throw new Error(".featureOf() requires a name");if(!n||n.type!=="Feature"||!n.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!n.geometry||n.geometry.type!==t)throw new Error("Invalid input to "+e+": must be a "+t+", given "+n.geometry.type)}function Yr(n){return n.type==="Feature"?n.geometry:n}var EW=ue(Gp(),1);var RW=ue(JC(),1);function Fr(n,t,e){if(e===void 0&&(e={}),!n)throw new Error("point is required");if(!t)throw new Error("polygon is required");var i=Xr(n),s=Yr(t),u=s.type,c=t.bbox,f=s.coordinates;if(c&&LW(i,c)===!1)return!1;u==="Polygon"&&(f=[f]);for(var p=!1,d=0;d<f.length&&!p;d++)if(jC(i,f[d][0],e.ignoreBoundary)){for(var m=!1,y=1;y<f[d].length&&!m;)jC(i,f[d][y],!e.ignoreBoundary)&&(m=!0),y++;m||(p=!0)}return p}function jC(n,t,e){var i=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var s=0,u=t.length-1;s<t.length;u=s++){var c=t[s][0],f=t[s][1],p=t[u][0],d=t[u][1],m=n[1]*(c-p)+f*(p-n[0])+d*(n[0]-c)===0&&(c-n[0])*(p-n[0])<=0&&(f-n[1])*(d-n[1])<=0;if(m)return!e;var y=f>n[1]!=d>n[1]&&n[0]<(p-c)*(n[1]-f)/(d-f)+c;y&&(i=!i)}return i}function LW(n,t){return t[0]<=n[0]&&t[1]<=n[1]&&t[2]>=n[0]&&t[3]>=n[1]}var tI=new ArrayBuffer(16),oet=new Float64Array(tI),set=new Uint32Array(tI);var YW=ue(Ov(),1);var Ont=function(){function n(t){this.points=t.points||[],this.duration=t.duration||1e4,this.sharpness=t.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=t.stepLength||60,this.length=this.points.length,this.delay=0;for(var e=0;e<this.length;e++)this.points[e].z=this.points[e].z||0;for(var e=0;e<this.length-1;e++){var i=this.points[e],s=this.points[e+1];this.centers.push({x:(i.x+s.x)/2,y:(i.y+s.y)/2,z:(i.z+s.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var e=0;e<this.centers.length-1;e++){var u=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,c=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,f=this.points[e+1].z-(this.centers[e].y+this.centers[e+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e].x+u),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+c),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+f)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+u),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+c),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+f)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}return n.prototype.cacheSteps=function(t){var e=[],i=this.pos(0);e.push(0);for(var s=0;s<this.duration;s+=10){var u=this.pos(s),c=Math.sqrt((u.x-i.x)*(u.x-i.x)+(u.y-i.y)*(u.y-i.y)+(u.z-i.z)*(u.z-i.z));c>t&&(e.push(s),i=u)}return e},n.prototype.vector=function(t){var e=this.pos(t+10),i=this.pos(t-10);return{angle:180*Math.atan2(e.y-i.y,e.x-i.x)/3.14,speed:Math.sqrt((i.x-e.x)*(i.x-e.x)+(i.y-e.y)*(i.y-e.y)+(i.z-e.z)*(i.z-e.z))}},n.prototype.pos=function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var i=e/this.duration;if(i>=1)return this.points[this.length-1];var s=Math.floor((this.points.length-1)*i),u=(this.length-1)*i-s;return $W(u,this.points[s],this.controls[s][1],this.controls[s+1][0],this.points[s+1])},n}();function $W(n,t,e,i,s){var u=ZW(n),c={x:s.x*u[0]+i.x*u[1]+e.x*u[2]+t.x*u[3],y:s.y*u[0]+i.y*u[1]+e.y*u[2]+t.y*u[3],z:s.z*u[0]+i.z*u[1]+e.z*u[2]+t.z*u[3]};return c}function ZW(n){var t=n*n,e=t*n;return[e,3*t*(1-n),3*n*(1-n)*(1-n),(1-n)*(1-n)*(1-n)]}function Jc(n,t){t===void 0&&(t={});var e=Number(n[0]),i=Number(n[1]),s=Number(n[2]),u=Number(n[3]);if(n.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var c=[e,i],f=[e,u],p=[s,u],d=[s,i];return Gn([[c,d,p,f,c]],t.properties,{bbox:n,id:t.id})}function JW(n){return Jc(Si(n))}var Dv=JW;var pX=ue(fI(),1);var GX=ue(rd(),1);var qX=ue(Gp(),1);var WX=ue(Ov(),1);var II=Math.PI/180,PI=180/Math.PI,rf=function(n,t){this.lon=n,this.lat=t,this.x=II*n,this.y=II*t};rf.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)};rf.prototype.antipode=function(){var n=-1*this.lat,t=this.lon<0?180+this.lon:(180-this.lon)*-1;return new rf(t,n)};var RI=function(){this.coords=[],this.length=0};RI.prototype.move_to=function(n){this.length++,this.coords.push(n)};var e_=function(n){this.properties=n||{},this.geometries=[]};e_.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(this.geometries.length===1)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var n=[],t=0;t<this.geometries.length;t++)n.push(this.geometries[t].coords);return{geometry:{type:"MultiLineString",coordinates:n},type:"Feature",properties:this.properties}};e_.prototype.wkt=function(){for(var n="",t="LINESTRING(",e=function(u){t+=u[0]+" "+u[1]+","},i=0;i<this.geometries.length;i++){if(this.geometries[i].coords.length===0)return"LINESTRING(empty)";var s=this.geometries[i].coords;s.forEach(e),n+=t.substring(0,t.length-1)+")"}return n};var LI=function(n,t,e){if(!n||n.x===void 0||n.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!t||t.x===void 0||t.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new rf(n.x,n.y),this.end=new rf(t.x,t.y),this.properties=e||{};var i=this.start.x-this.end.x,s=this.start.y-this.end.y,u=Math.pow(Math.sin(s/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(i/2),2);if(this.g=2*Math.asin(Math.sqrt(u)),this.g===Math.PI)throw new Error("it appears "+n.view()+" and "+t.view()+" are 'antipodal', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw new Error("could not calculate great circle between "+n+" and "+t)};LI.prototype.interpolate=function(n){var t=Math.sin((1-n)*this.g)/Math.sin(this.g),e=Math.sin(n*this.g)/Math.sin(this.g),i=t*Math.cos(this.start.y)*Math.cos(this.start.x)+e*Math.cos(this.end.y)*Math.cos(this.end.x),s=t*Math.cos(this.start.y)*Math.sin(this.start.x)+e*Math.cos(this.end.y)*Math.sin(this.end.x),u=t*Math.sin(this.start.y)+e*Math.sin(this.end.y),c=PI*Math.atan2(u,Math.sqrt(Math.pow(i,2)+Math.pow(s,2))),f=PI*Math.atan2(s,i);return[f,c]};LI.prototype.Arc=function(n,t){var e=[];if(!n||n<=2)e.push([this.start.lon,this.start.lat]),e.push([this.end.lon,this.end.lat]);else for(var i=1/(n-1),s=0;s<n;++s){var u=i*s,c=this.interpolate(u);e.push(c)}for(var f=!1,p=0,d=t&&t.offset?t.offset:10,m=180-d,y=-180+d,v=360-d,E=1;E<e.length;++E){var M=e[E-1][0],A=e[E][0],_=Math.abs(A-M);_>v&&(A>m&&M<y||M>m&&A<y)?f=!0:_>p&&(p=_)}var x=[];if(f&&p<d){var T=[];x.push(T);for(var S=0;S<e.length;++S){var R=parseFloat(e[S][0]);if(S>0&&Math.abs(R-e[S-1][0])>v){var z=parseFloat(e[S-1][0]),U=parseFloat(e[S-1][1]),D=parseFloat(e[S][0]),P=parseFloat(e[S][1]);if(z>-180&&z<y&&D===180&&S+1<e.length&&e[S-1][0]>-180&&e[S-1][0]<y){T.push([-180,e[S][1]]),S++,T.push([e[S][0],e[S][1]]);continue}else if(z>m&&z<180&&D===-180&&S+1<e.length&&e[S-1][0]>m&&e[S-1][0]<180){T.push([180,e[S][1]]),S++,T.push([e[S][0],e[S][1]]);continue}if(z<y&&D>m){var ct=z;z=D,D=ct;var L=U;U=P,P=L}if(z>m&&D<y&&(D+=360),z<=180&&D>=180&&z<D){var W=(180-z)/(D-z),V=W*P+(1-W)*U;T.push([e[S-1][0]>m?180:-180,V]),T=[],T.push([e[S-1][0]>m?-180:180,V]),x.push(T)}else T=[],x.push(T);T.push([R,e[S][1]])}else T.push([e[S][0],e[S][1]])}}else{var Mt=[];x.push(Mt);for(var Y=0;Y<e.length;++Y)Mt.push([e[Y][0],e[Y][1]])}for(var mt=new e_(this.properties),ft=0;ft<x.length;++ft){var vt=new RI;mt.geometries.push(vt);for(var it=x[ft],lt=0;lt<it.length;++lt)vt.move_to(it[lt])}return mt};var $X=ue(rd(),1);var Y7=ue(rd(),1);var $7=ue(I_(),1);var j7=ue(Gp(),1);var Te=[],Ce=[],Ie=[],Pe=[],Re=[],Le=[],Ne=[],Oe=[],De=[],Fe=[],Ue=[],Be=[],ze=[],Ge=[],ke=[],qe=[],Ve=[],He=[],We=[],Xe=[],Ye=[],$e=[],Ze=[],Je=[];Ne[85]=Fe[85]=-1;Oe[85]=Ue[85]=0;De[85]=Be[85]=1;We[85]=$e[85]=1;Xe[85]=Ze[85]=0;Ye[85]=Je[85]=1;Te[85]=Pe[85]=0;Ce[85]=Re[85]=-1;Ie[85]=ke[85]=0;qe[85]=ze[85]=0;Ve[85]=Ge[85]=1;Le[85]=He[85]=1;$e[1]=$e[169]=0;Ze[1]=Ze[169]=-1;Je[1]=Je[169]=0;ze[1]=ze[169]=-1;Ge[1]=Ge[169]=0;ke[1]=ke[169]=0;Fe[4]=Fe[166]=0;Ue[4]=Ue[166]=-1;Be[4]=Be[166]=1;qe[4]=qe[166]=1;Ve[4]=Ve[166]=0;He[4]=He[166]=0;Ne[16]=Ne[154]=0;Oe[16]=Oe[154]=1;De[16]=De[154]=1;Pe[16]=Pe[154]=1;Re[16]=Re[154]=0;Le[16]=Le[154]=1;We[64]=We[106]=0;Xe[64]=Xe[106]=1;Ye[64]=Ye[106]=0;Te[64]=Te[106]=-1;Ce[64]=Ce[106]=0;Ie[64]=Ie[106]=1;We[2]=We[168]=0;Xe[2]=Xe[168]=-1;Ye[2]=Ye[168]=1;$e[2]=$e[168]=0;Ze[2]=Ze[168]=-1;Je[2]=Je[168]=0;ze[2]=ze[168]=-1;Ge[2]=Ge[168]=0;ke[2]=ke[168]=0;qe[2]=qe[168]=-1;Ve[2]=Ve[168]=0;He[2]=He[168]=1;Ne[8]=Ne[162]=0;Oe[8]=Oe[162]=-1;De[8]=De[162]=0;Fe[8]=Fe[162]=0;Ue[8]=Ue[162]=-1;Be[8]=Be[162]=1;ze[8]=ze[162]=1;Ge[8]=Ge[162]=0;ke[8]=ke[162]=1;qe[8]=qe[162]=1;Ve[8]=Ve[162]=0;He[8]=He[162]=0;Ne[32]=Ne[138]=0;Oe[32]=Oe[138]=1;De[32]=De[138]=1;Fe[32]=Fe[138]=0;Ue[32]=Ue[138]=1;Be[32]=Be[138]=0;Te[32]=Te[138]=1;Ce[32]=Ce[138]=0;Ie[32]=Ie[138]=0;Pe[32]=Pe[138]=1;Re[32]=Re[138]=0;Le[32]=Le[138]=1;$e[128]=$e[42]=0;Ze[128]=Ze[42]=1;Je[128]=Je[42]=1;We[128]=We[42]=0;Xe[128]=Xe[42]=1;Ye[128]=Ye[42]=0;Te[128]=Te[42]=-1;Ce[128]=Ce[42]=0;Ie[128]=Ie[42]=1;Pe[128]=Pe[42]=-1;Re[128]=Re[42]=0;Le[128]=Le[42]=0;Fe[5]=Fe[165]=-1;Ue[5]=Ue[165]=0;Be[5]=Be[165]=0;$e[5]=$e[165]=1;Ze[5]=Ze[165]=0;Je[5]=Je[165]=0;qe[20]=qe[150]=0;Ve[20]=Ve[150]=1;He[20]=He[150]=1;Pe[20]=Pe[150]=0;Re[20]=Re[150]=-1;Le[20]=Le[150]=1;Ne[80]=Ne[90]=-1;Oe[80]=Oe[90]=0;De[80]=De[90]=1;We[80]=We[90]=1;Xe[80]=Xe[90]=0;Ye[80]=Ye[90]=1;ze[65]=ze[105]=0;Ge[65]=Ge[105]=1;ke[65]=ke[105]=0;Te[65]=Te[105]=0;Ce[65]=Ce[105]=-1;Ie[65]=Ie[105]=0;Ne[160]=Ne[10]=-1;Oe[160]=Oe[10]=0;De[160]=De[10]=1;Fe[160]=Fe[10]=-1;Ue[160]=Ue[10]=0;Be[160]=Be[10]=0;$e[160]=$e[10]=1;Ze[160]=Ze[10]=0;Je[160]=Je[10]=0;We[160]=We[10]=1;Xe[160]=Xe[10]=0;Ye[160]=Ye[10]=1;qe[130]=qe[40]=0;Ve[130]=Ve[40]=1;He[130]=He[40]=1;ze[130]=ze[40]=0;Ge[130]=Ge[40]=1;ke[130]=ke[40]=0;Te[130]=Te[40]=0;Ce[130]=Ce[40]=-1;Ie[130]=Ie[40]=0;Pe[130]=Pe[40]=0;Re[130]=Re[40]=-1;Le[130]=Le[40]=1;Fe[37]=Fe[133]=0;Ue[37]=Ue[133]=1;Be[37]=Be[133]=1;$e[37]=$e[133]=0;Ze[37]=Ze[133]=1;Je[37]=Je[133]=0;Te[37]=Te[133]=-1;Ce[37]=Ce[133]=0;Ie[37]=Ie[133]=0;Pe[37]=Pe[133]=1;Re[37]=Re[133]=0;Le[37]=Le[133]=0;qe[148]=qe[22]=-1;Ve[148]=Ve[22]=0;He[148]=He[22]=0;$e[148]=$e[22]=0;Ze[148]=Ze[22]=-1;Je[148]=Je[22]=1;We[148]=We[22]=0;Xe[148]=Xe[22]=1;Ye[148]=Ye[22]=1;Pe[148]=Pe[22]=-1;Re[148]=Re[22]=0;Le[148]=Le[22]=1;Ne[82]=Ne[88]=0;Oe[82]=Oe[88]=-1;De[82]=De[88]=1;qe[82]=qe[88]=1;Ve[82]=Ve[88]=0;He[82]=He[88]=1;ze[82]=ze[88]=-1;Ge[82]=Ge[88]=0;ke[82]=ke[88]=1;We[82]=We[88]=0;Xe[82]=Xe[88]=-1;Ye[82]=Ye[88]=0;Ne[73]=Ne[97]=0;Oe[73]=Oe[97]=1;De[73]=De[97]=0;Fe[73]=Fe[97]=0;Ue[73]=Ue[97]=-1;Be[73]=Be[97]=0;ze[73]=ze[97]=1;Ge[73]=Ge[97]=0;ke[73]=ke[97]=0;Te[73]=Te[97]=1;Ce[73]=Ce[97]=0;Ie[73]=Ie[97]=1;Ne[145]=Ne[25]=0;Oe[145]=Oe[25]=-1;De[145]=De[25]=0;ze[145]=ze[25]=1;Ge[145]=Ge[25]=0;ke[145]=ke[25]=1;$e[145]=$e[25]=0;Ze[145]=Ze[25]=1;Je[145]=Je[25]=1;Pe[145]=Pe[25]=-1;Re[145]=Re[25]=0;Le[145]=Le[25]=0;Fe[70]=Fe[100]=0;Ue[70]=Ue[100]=1;Be[70]=Be[100]=0;qe[70]=qe[100]=-1;Ve[70]=Ve[100]=0;He[70]=He[100]=1;We[70]=We[100]=0;Xe[70]=Xe[100]=-1;Ye[70]=Ye[100]=1;Te[70]=Te[100]=1;Ce[70]=Ce[100]=0;Ie[70]=Ie[100]=0;Fe[101]=Fe[69]=0;Ue[101]=Ue[69]=1;Be[101]=Be[69]=0;Te[101]=Te[69]=1;Ce[101]=Ce[69]=0;Ie[101]=Ie[69]=0;$e[149]=$e[21]=0;Ze[149]=Ze[21]=1;Je[149]=Je[21]=1;Pe[149]=Pe[21]=-1;Re[149]=Re[21]=0;Le[149]=Le[21]=0;qe[86]=qe[84]=-1;Ve[86]=Ve[84]=0;He[86]=He[84]=1;We[86]=We[84]=0;Xe[86]=Xe[84]=-1;Ye[86]=Ye[84]=1;Ne[89]=Ne[81]=0;Oe[89]=Oe[81]=-1;De[89]=De[81]=0;ze[89]=ze[81]=1;Ge[89]=Ge[81]=0;ke[89]=ke[81]=1;Ne[96]=Ne[74]=0;Oe[96]=Oe[74]=1;De[96]=De[74]=0;Fe[96]=Fe[74]=-1;Ue[96]=Ue[74]=0;Be[96]=Be[74]=1;We[96]=We[74]=1;Xe[96]=Xe[74]=0;Ye[96]=Ye[74]=0;Te[96]=Te[74]=1;Ce[96]=Ce[74]=0;Ie[96]=Ie[74]=1;Ne[24]=Ne[146]=0;Oe[24]=Oe[146]=-1;De[24]=De[146]=1;qe[24]=qe[146]=1;Ve[24]=Ve[146]=0;He[24]=He[146]=1;ze[24]=ze[146]=0;Ge[24]=Ge[146]=1;ke[24]=ke[146]=1;Pe[24]=Pe[146]=0;Re[24]=Re[146]=-1;Le[24]=Le[146]=0;Fe[6]=Fe[164]=-1;Ue[6]=Ue[164]=0;Be[6]=Be[164]=1;qe[6]=qe[164]=-1;Ve[6]=Ve[164]=0;He[6]=He[164]=0;$e[6]=$e[164]=0;Ze[6]=Ze[164]=-1;Je[6]=Je[164]=1;We[6]=We[164]=1;Xe[6]=Xe[164]=0;Ye[6]=Ye[164]=0;ze[129]=ze[41]=0;Ge[129]=Ge[41]=1;ke[129]=ke[41]=1;$e[129]=$e[41]=0;Ze[129]=Ze[41]=1;Je[129]=Je[41]=0;Te[129]=Te[41]=-1;Ce[129]=Ce[41]=0;Ie[129]=Ie[41]=0;Pe[129]=Pe[41]=0;Re[129]=Re[41]=-1;Le[129]=Le[41]=0;qe[66]=qe[104]=0;Ve[66]=Ve[104]=1;He[66]=He[104]=0;ze[66]=ze[104]=-1;Ge[66]=Ge[104]=0;ke[66]=ke[104]=1;We[66]=We[104]=0;Xe[66]=Xe[104]=-1;Ye[66]=Ye[104]=0;Te[66]=Te[104]=0;Ce[66]=Ce[104]=-1;Ie[66]=Ie[104]=1;Ne[144]=Ne[26]=-1;Oe[144]=Oe[26]=0;De[144]=De[26]=0;$e[144]=$e[26]=1;Ze[144]=Ze[26]=0;Je[144]=Je[26]=1;We[144]=We[26]=0;Xe[144]=Xe[26]=1;Ye[144]=Ye[26]=1;Pe[144]=Pe[26]=-1;Re[144]=Re[26]=0;Le[144]=Le[26]=1;Fe[36]=Fe[134]=0;Ue[36]=Ue[134]=1;Be[36]=Be[134]=1;qe[36]=qe[134]=0;Ve[36]=Ve[134]=1;He[36]=He[134]=0;Te[36]=Te[134]=0;Ce[36]=Ce[134]=-1;Ie[36]=Ie[134]=1;Pe[36]=Pe[134]=1;Re[36]=Re[134]=0;Le[36]=Le[134]=0;Ne[9]=Ne[161]=-1;Oe[9]=Oe[161]=0;De[9]=De[161]=0;Fe[9]=Fe[161]=0;Ue[9]=Ue[161]=-1;Be[9]=Be[161]=0;ze[9]=ze[161]=1;Ge[9]=Ge[161]=0;ke[9]=ke[161]=0;$e[9]=$e[161]=1;Ze[9]=Ze[161]=0;Je[9]=Je[161]=1;Ne[136]=0;Oe[136]=1;De[136]=1;Fe[136]=0;Ue[136]=1;Be[136]=0;qe[136]=-1;Ve[136]=0;He[136]=1;ze[136]=-1;Ge[136]=0;ke[136]=0;$e[136]=0;Ze[136]=-1;Je[136]=0;We[136]=0;Xe[136]=-1;Ye[136]=1;Te[136]=1;Ce[136]=0;Ie[136]=0;Pe[136]=1;Re[136]=0;Le[136]=1;Ne[34]=0;Oe[34]=-1;De[34]=0;Fe[34]=0;Ue[34]=-1;Be[34]=1;qe[34]=1;Ve[34]=0;He[34]=0;ze[34]=1;Ge[34]=0;ke[34]=1;$e[34]=0;Ze[34]=1;Je[34]=1;We[34]=0;Xe[34]=1;Ye[34]=0;Te[34]=-1;Ce[34]=0;Ie[34]=1;Pe[34]=-1;Re[34]=0;Le[34]=0;Ne[35]=0;Oe[35]=1;De[35]=1;Fe[35]=0;Ue[35]=-1;Be[35]=1;qe[35]=1;Ve[35]=0;He[35]=0;ze[35]=-1;Ge[35]=0;ke[35]=0;$e[35]=0;Ze[35]=-1;Je[35]=0;We[35]=0;Xe[35]=1;Ye[35]=0;Te[35]=-1;Ce[35]=0;Ie[35]=1;Pe[35]=1;Re[35]=0;Le[35]=1;Ne[153]=0;Oe[153]=1;De[153]=1;ze[153]=-1;Ge[153]=0;ke[153]=0;$e[153]=0;Ze[153]=-1;Je[153]=0;Pe[153]=1;Re[153]=0;Le[153]=1;Fe[102]=0;Ue[102]=-1;Be[102]=1;qe[102]=1;Ve[102]=0;He[102]=0;We[102]=0;Xe[102]=1;Ye[102]=0;Te[102]=-1;Ce[102]=0;Ie[102]=1;Ne[155]=0;Oe[155]=-1;De[155]=0;ze[155]=1;Ge[155]=0;ke[155]=1;$e[155]=0;Ze[155]=1;Je[155]=1;Pe[155]=-1;Re[155]=0;Le[155]=0;Fe[103]=0;Ue[103]=1;Be[103]=0;qe[103]=-1;Ve[103]=0;He[103]=1;We[103]=0;Xe[103]=-1;Ye[103]=1;Te[103]=1;Ce[103]=0;Ie[103]=0;Ne[152]=0;Oe[152]=1;De[152]=1;qe[152]=-1;Ve[152]=0;He[152]=1;ze[152]=-1;Ge[152]=0;ke[152]=0;$e[152]=0;Ze[152]=-1;Je[152]=0;We[152]=0;Xe[152]=-1;Ye[152]=1;Pe[152]=1;Re[152]=0;Le[152]=1;Ne[156]=0;Oe[156]=-1;De[156]=1;qe[156]=1;Ve[156]=0;He[156]=1;ze[156]=-1;Ge[156]=0;ke[156]=0;$e[156]=0;Ze[156]=-1;Je[156]=0;We[156]=0;Xe[156]=1;Ye[156]=1;Pe[156]=-1;Re[156]=0;Le[156]=1;Ne[137]=0;Oe[137]=1;De[137]=1;Fe[137]=0;Ue[137]=1;Be[137]=0;ze[137]=-1;Ge[137]=0;ke[137]=0;$e[137]=0;Ze[137]=-1;Je[137]=0;Te[137]=1;Ce[137]=0;Ie[137]=0;Pe[137]=1;Re[137]=0;Le[137]=1;Ne[139]=0;Oe[139]=1;De[139]=1;Fe[139]=0;Ue[139]=-1;Be[139]=0;ze[139]=1;Ge[139]=0;ke[139]=0;$e[139]=0;Ze[139]=1;Je[139]=0;Te[139]=-1;Ce[139]=0;Ie[139]=0;Pe[139]=1;Re[139]=0;Le[139]=1;Ne[98]=0;Oe[98]=-1;De[98]=0;Fe[98]=0;Ue[98]=-1;Be[98]=1;qe[98]=1;Ve[98]=0;He[98]=0;ze[98]=1;Ge[98]=0;ke[98]=1;We[98]=0;Xe[98]=1;Ye[98]=0;Te[98]=-1;Ce[98]=0;Ie[98]=1;Ne[99]=0;Oe[99]=1;De[99]=0;Fe[99]=0;Ue[99]=-1;Be[99]=1;qe[99]=1;Ve[99]=0;He[99]=0;ze[99]=-1;Ge[99]=0;ke[99]=1;We[99]=0;Xe[99]=-1;Ye[99]=0;Te[99]=1;Ce[99]=0;Ie[99]=1;Fe[38]=0;Ue[38]=-1;Be[38]=1;qe[38]=1;Ve[38]=0;He[38]=0;$e[38]=0;Ze[38]=1;Je[38]=1;We[38]=0;Xe[38]=1;Ye[38]=0;Te[38]=-1;Ce[38]=0;Ie[38]=1;Pe[38]=-1;Re[38]=0;Le[38]=0;Fe[39]=0;Ue[39]=1;Be[39]=1;qe[39]=-1;Ve[39]=0;He[39]=0;$e[39]=0;Ze[39]=-1;Je[39]=1;We[39]=0;Xe[39]=1;Ye[39]=0;Te[39]=-1;Ce[39]=0;Ie[39]=1;Pe[39]=1;Re[39]=0;Le[39]=0;var P_=function(n){return[[n.bottomleft,0],[0,0],[0,n.leftbottom]]},R_=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0]]},L_=function(n){return[[n.topright,1],[1,1],[1,n.righttop]]},N_=function(n){return[[0,n.lefttop],[0,1],[n.topleft,1]]},O_=function(n){return[[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop]]},D_=function(n){return[[n.bottomright,0],[n.bottomleft,0],[1,n.righttop],[1,n.rightbottom]]},F_=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.topleft,1],[n.topright,1]]},U_=function(n){return[[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},K7=function(n){return[[0,0],[0,n.leftbottom],[1,n.rightbottom],[1,0]]},Q7=function(n){return[[1,0],[n.bottomright,0],[n.topright,1],[1,1]]},tY=function(n){return[[1,1],[1,n.righttop],[0,n.lefttop],[0,1]]},eY=function(n){return[[n.bottomleft,0],[0,0],[0,1],[n.topleft,1]]},nY=function(n){return[[1,n.righttop],[1,n.rightbottom],[0,n.leftbottom],[0,n.lefttop]]},rY=function(n){return[[n.topleft,1],[n.topright,1],[n.bottomright,0],[n.bottomleft,0]]},iY=function(){return[[0,0],[0,1],[1,1],[1,0]]},oY=function(n){return[[1,n.rightbottom],[1,0],[0,0],[0,1],[n.topleft,1]]},sY=function(n){return[[n.topright,1],[1,1],[1,0],[0,0],[0,n.leftbottom]]},aY=function(n){return[[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[1,1]]},uY=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,1]]},lY=function(n){return[[1,n.righttop],[1,n.rightbottom],[0,n.lefttop],[0,1],[n.topleft,1]]},cY=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[n.topright,1]]},fY=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop]]},hY=function(n){return[[n.topright,1],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topleft,1]]},pY=function(n){return[[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1],[n.topleft,1]]},dY=function(n){return[[1,1],[1,n.righttop],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},mY=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[n.topleft,1],[n.topright,1]]},gY=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,n.leftbottom]]},yY=function(n){return[[1,n.rightbottom],[1,0],[0,0],[0,n.leftbottom],[n.topleft,1],[n.topright,1]]},vY=function(n){return[[1,1],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},_Y=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1]]},xY=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,1],[n.topleft,1]]},EY=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topright,1]]},wY=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[n.topleft,1]]},SY=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},MY=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topright,1]]},bY=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[n.topleft,1]]},AY=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},TY=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topleft,1],[n.topright,1]]},CY=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1],[n.topleft,1]]},IY=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},tn=[],en=[],nn=[],rn=[],on=[],sn=[],an=[],un=[];rn[1]=on[1]=18;rn[169]=on[169]=18;nn[4]=en[4]=12;nn[166]=en[166]=12;tn[16]=un[16]=4;tn[154]=un[154]=4;sn[64]=an[64]=22;sn[106]=an[106]=22;nn[2]=sn[2]=17;rn[2]=on[2]=18;nn[168]=sn[168]=17;rn[168]=on[168]=18;tn[8]=rn[8]=9;en[8]=nn[8]=12;tn[162]=rn[162]=9;en[162]=nn[162]=12;tn[32]=un[32]=4;en[32]=an[32]=1;tn[138]=un[138]=4;en[138]=an[138]=1;on[128]=un[128]=21;sn[128]=an[128]=22;on[42]=un[42]=21;sn[42]=an[42]=22;en[5]=on[5]=14;en[165]=on[165]=14;nn[20]=un[20]=6;nn[150]=un[150]=6;tn[80]=sn[80]=11;tn[90]=sn[90]=11;rn[65]=an[65]=3;rn[105]=an[105]=3;tn[160]=sn[160]=11;en[160]=on[160]=14;tn[10]=sn[10]=11;en[10]=on[10]=14;nn[130]=un[130]=6;rn[130]=an[130]=3;nn[40]=un[40]=6;rn[40]=an[40]=3;en[101]=an[101]=1;en[69]=an[69]=1;on[149]=un[149]=21;on[21]=un[21]=21;nn[86]=sn[86]=17;nn[84]=sn[84]=17;tn[89]=rn[89]=9;tn[81]=rn[81]=9;tn[96]=an[96]=0;en[96]=sn[96]=15;tn[74]=an[74]=0;en[74]=sn[74]=15;tn[24]=nn[24]=8;rn[24]=un[24]=7;tn[146]=nn[146]=8;rn[146]=un[146]=7;en[6]=sn[6]=15;nn[6]=on[6]=16;en[164]=sn[164]=15;nn[164]=on[164]=16;rn[129]=un[129]=7;on[129]=an[129]=20;rn[41]=un[41]=7;on[41]=an[41]=20;nn[66]=an[66]=2;rn[66]=sn[66]=19;nn[104]=an[104]=2;rn[104]=sn[104]=19;tn[144]=on[144]=10;sn[144]=un[144]=23;tn[26]=on[26]=10;sn[26]=un[26]=23;en[36]=un[36]=5;nn[36]=an[36]=2;en[134]=un[134]=5;nn[134]=an[134]=2;tn[9]=on[9]=10;en[9]=rn[9]=13;tn[161]=on[161]=10;en[161]=rn[161]=13;en[37]=un[37]=5;on[37]=an[37]=20;en[133]=un[133]=5;on[133]=an[133]=20;nn[148]=on[148]=16;sn[148]=un[148]=23;nn[22]=on[22]=16;sn[22]=un[22]=23;tn[82]=nn[82]=8;rn[82]=sn[82]=19;tn[88]=nn[88]=8;rn[88]=sn[88]=19;tn[73]=an[73]=0;en[73]=rn[73]=13;tn[97]=an[97]=0;en[97]=rn[97]=13;tn[145]=rn[145]=9;on[145]=un[145]=21;tn[25]=rn[25]=9;on[25]=un[25]=21;en[70]=an[70]=1;nn[70]=sn[70]=17;en[100]=an[100]=1;nn[100]=sn[100]=17;tn[34]=rn[34]=9;en[34]=nn[34]=12;on[34]=un[34]=21;sn[34]=an[34]=22;tn[136]=un[136]=4;en[136]=an[136]=1;nn[136]=sn[136]=17;rn[136]=on[136]=18;tn[35]=un[35]=4;en[35]=nn[35]=12;rn[35]=on[35]=18;sn[35]=an[35]=22;tn[153]=un[153]=4;rn[153]=on[153]=18;en[102]=nn[102]=12;sn[102]=an[102]=22;tn[155]=rn[155]=9;on[155]=un[155]=23;en[103]=an[103]=1;nn[103]=sn[103]=17;tn[152]=un[152]=4;nn[152]=sn[152]=17;rn[152]=on[152]=18;tn[156]=nn[156]=8;rn[156]=on[156]=18;sn[156]=un[156]=23;tn[137]=un[137]=4;en[137]=an[137]=1;rn[137]=on[137]=18;tn[139]=un[139]=4;en[139]=rn[139]=13;on[139]=an[139]=20;tn[98]=rn[98]=9;en[98]=nn[98]=12;sn[98]=an[98]=22;tn[99]=an[99]=0;en[99]=nn[99]=12;rn[99]=sn[99]=19;en[38]=nn[38]=12;on[38]=un[38]=21;sn[38]=an[38]=22;en[39]=un[39]=5;nn[39]=on[39]=16;sn[39]=an[39]=22;var Yt=[];Yt[1]=Yt[169]=P_;Yt[4]=Yt[166]=R_;Yt[16]=Yt[154]=L_;Yt[64]=Yt[106]=N_;Yt[168]=Yt[2]=O_;Yt[162]=Yt[8]=D_;Yt[138]=Yt[32]=F_;Yt[42]=Yt[128]=U_;Yt[5]=Yt[165]=K7;Yt[20]=Yt[150]=Q7;Yt[80]=Yt[90]=tY;Yt[65]=Yt[105]=eY;Yt[160]=Yt[10]=nY;Yt[130]=Yt[40]=rY;Yt[85]=iY;Yt[101]=Yt[69]=oY;Yt[149]=Yt[21]=sY;Yt[86]=Yt[84]=aY;Yt[89]=Yt[81]=uY;Yt[96]=Yt[74]=lY;Yt[24]=Yt[146]=cY;Yt[6]=Yt[164]=fY;Yt[129]=Yt[41]=hY;Yt[66]=Yt[104]=pY;Yt[144]=Yt[26]=dY;Yt[36]=Yt[134]=mY;Yt[9]=Yt[161]=gY;Yt[37]=Yt[133]=yY;Yt[148]=Yt[22]=vY;Yt[82]=Yt[88]=_Y;Yt[73]=Yt[97]=xY;Yt[145]=Yt[25]=EY;Yt[70]=Yt[100]=wY;Yt[34]=function(n){return[U_(n),D_(n)]};Yt[35]=SY;Yt[136]=function(n){return[F_(n),O_(n)]};Yt[153]=function(n){return[L_(n),P_(n)]};Yt[102]=function(n){return[R_(n),N_(n)]};Yt[155]=MY;Yt[103]=bY;Yt[152]=function(n){return[L_(n),O_(n)]};Yt[156]=AY;Yt[137]=function(n){return[F_(n),P_(n)]};Yt[139]=TY;Yt[98]=function(n){return[D_(n),N_(n)]};Yt[99]=CY;Yt[38]=function(n){return[R_(n),U_(n)]};Yt[39]=IY;function RY(n){return(n>0)-(n<0)||+n}function Dl(n,t,e){var i=t[0]-n[0],s=t[1]-n[1],u=e[0]-t[0],c=e[1]-t[1];return RY(i*c-u*s)}function _L(n,t){var e=n.geometry.coordinates[0].map(function(c){return c[0]}),i=n.geometry.coordinates[0].map(function(c){return c[1]}),s=t.geometry.coordinates[0].map(function(c){return c[0]}),u=t.geometry.coordinates[0].map(function(c){return c[1]});return Math.max.apply(null,e)===Math.max.apply(null,s)&&Math.max.apply(null,i)===Math.max.apply(null,u)&&Math.min.apply(null,e)===Math.min.apply(null,s)&&Math.min.apply(null,i)===Math.min.apply(null,u)}function B_(n,t){return t.geometry.coordinates[0].every(function(e){return Fr(zn(e),n)})}function xL(n,t){return n[0]===t[0]&&n[1]===t[1]}var LY=function(){function n(t){this.id=n.buildId(t),this.coordinates=t,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return n.buildId=function(t){return t.join(",")},n.prototype.removeInnerEdge=function(t){this.innerEdges=this.innerEdges.filter(function(e){return e.from.id!==t.from.id})},n.prototype.removeOuterEdge=function(t){this.outerEdges=this.outerEdges.filter(function(e){return e.to.id!==t.to.id})},n.prototype.addOuterEdge=function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1},n.prototype.sortOuterEdges=function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort(function(e,i){var s=e.to,u=i.to;if(s.coordinates[0]-t.coordinates[0]>=0&&u.coordinates[0]-t.coordinates[0]<0)return 1;if(s.coordinates[0]-t.coordinates[0]<0&&u.coordinates[0]-t.coordinates[0]>=0)return-1;if(s.coordinates[0]-t.coordinates[0]===0&&u.coordinates[0]-t.coordinates[0]===0)return s.coordinates[1]-t.coordinates[1]>=0||u.coordinates[1]-t.coordinates[1]>=0?s.coordinates[1]-u.coordinates[1]:u.coordinates[1]-s.coordinates[1];var c=Dl(t.coordinates,s.coordinates,u.coordinates);if(c<0)return 1;if(c>0)return-1;var f=Math.pow(s.coordinates[0]-t.coordinates[0],2)+Math.pow(s.coordinates[1]-t.coordinates[1],2),p=Math.pow(u.coordinates[0]-t.coordinates[0],2)+Math.pow(u.coordinates[1]-t.coordinates[1],2);return f-p}),this.outerEdgesSorted=!0)},n.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},n.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},n.prototype.addInnerEdge=function(t){this.innerEdges.push(t)},n}(),z_=LY;var NY=function(){function n(t,e){this.from=t,this.to=e,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return n.prototype.getSymetric=function(){return this.symetric||(this.symetric=new n(this.to,this.from),this.symetric.symetric=this),this.symetric},n.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},n.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},n.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},n.prototype.toLineString=function(){return Dr([this.from.coordinates,this.to.coordinates])},n.prototype.compareTo=function(t){return Dl(t.from.coordinates,t.to.coordinates,this.to.coordinates)},n}(),EL=NY;var OY=function(){function n(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return n.prototype.push=function(t){this.edges.push(t),this.polygon=this.envelope=void 0},n.prototype.get=function(t){return this.edges[t]},Object.defineProperty(n.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}),n.prototype.forEach=function(t){this.edges.forEach(t)},n.prototype.map=function(t){return this.edges.map(t)},n.prototype.some=function(t){return this.edges.some(t)},n.prototype.isValid=function(){return!0},n.prototype.isHole=function(){var t=this,e=this.edges.reduce(function(c,f,p){return f.from.coordinates[1]>t.edges[c].from.coordinates[1]&&(c=p),c},0),i=(e===0?this.length:e)-1,s=(e+1)%this.length,u=Dl(this.edges[i].from.coordinates,this.edges[e].from.coordinates,this.edges[s].from.coordinates);return u===0?this.edges[i].from.coordinates[0]>this.edges[s].from.coordinates[0]:u>0},n.prototype.toMultiPoint=function(){return gv(this.edges.map(function(t){return t.from.coordinates}))},n.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map(function(e){return e.from.coordinates});return t.push(this.edges[0].from.coordinates),this.polygon=Gn([t])},n.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=Dv(this.toPolygon())},n.findEdgeRingContaining=function(t,e){var i=t.getEnvelope(),s,u;return e.forEach(function(c){var f=c.getEnvelope();if(u&&(s=u.getEnvelope()),!_L(f,i)&&B_(f,i)){for(var p=t.map(function(M){return M.from.coordinates}),d=void 0,m=function(M){c.some(function(A){return xL(M,A.from.coordinates)})||(d=M)},y=0,v=p;y<v.length;y++){var E=v[y];m(E)}d&&c.inside(zn(d))&&(!u||B_(s,f))&&(u=c)}}),u},n.prototype.inside=function(t){return Fr(t,this.toPolygon())},n}(),G_=OY;function DY(n){if(!n)throw new Error("No geojson passed");if(n.type!=="FeatureCollection"&&n.type!=="GeometryCollection"&&n.type!=="MultiLineString"&&n.type!=="LineString"&&n.type!=="Feature")throw new Error("Invalid input type '"+n.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}var qut=function(){function n(){this.edges=[],this.nodes={}}return n.fromGeoJson=function(t){DY(t);var e=new n;return Wi(t,function(i){vv(i,"LineString","Graph::fromGeoJson"),LC(i,function(s,u){if(s){var c=e.getNode(s),f=e.getNode(u);e.addEdge(c,f)}return u})}),e},n.prototype.getNode=function(t){var e=z_.buildId(t),i=this.nodes[e];return i||(i=this.nodes[e]=new z_(t)),i},n.prototype.addEdge=function(t,e){var i=new EL(t,e),s=i.getSymetric();this.edges.push(i),this.edges.push(s)},n.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map(function(e){return t.nodes[e]}).forEach(function(e){return t._removeIfDangle(e)})},n.prototype._removeIfDangle=function(t){var e=this;if(t.innerEdges.length<=1){var i=t.getOuterEdges().map(function(s){return s.to});this.removeNode(t),i.forEach(function(s){return e._removeIfDangle(s)})}},n.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))})},n.prototype._computeNextCWEdges=function(t){var e=this;typeof t=="undefined"?Object.keys(this.nodes).forEach(function(i){return e._computeNextCWEdges(e.nodes[i])}):t.getOuterEdges().forEach(function(i,s){t.getOuterEdge((s===0?t.getOuterEdges().length:s)-1).symetric.next=i})},n.prototype._computeNextCCWEdges=function(t,e){for(var i=t.getOuterEdges(),s,u,c=i.length-1;c>=0;--c){var f=i[c],p=f.symetric,d=void 0,m=void 0;f.label===e&&(d=f),p.label===e&&(m=p),!(!d||!m)&&(m&&(u=m),d&&(u&&(u.next=d,u=void 0),s||(s=d)))}u&&(u.next=s)},n.prototype._findLabeledEdgeRings=function(){var t=[],e=0;return this.edges.forEach(function(i){if(!(i.label>=0)){t.push(i);var s=i;do s.label=e,s=s.next;while(!i.isEqual(s));e++}}),t},n.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach(function(i){i.label=void 0}),this._findLabeledEdgeRings().forEach(function(i){t._findIntersectionNodes(i).forEach(function(s){t._computeNextCCWEdges(s,i.label)})});var e=[];return this.edges.forEach(function(i){i.ring||e.push(t._findEdgeRing(i))}),e},n.prototype._findIntersectionNodes=function(t){var e=[],i=t,s=function(){var u=0;i.from.getOuterEdges().forEach(function(c){c.label===t.label&&++u}),u>1&&e.push(i.from),i=i.next};do s();while(!t.isEqual(i));return e},n.prototype._findEdgeRing=function(t){var e=t,i=new G_;do i.push(e),e.ring=i,e=e.next;while(!t.isEqual(e));return i},n.prototype.removeNode=function(t){var e=this;t.getOuterEdges().forEach(function(i){return e.removeEdge(i)}),t.innerEdges.forEach(function(i){return e.removeEdge(i)}),delete this.nodes[t.id]},n.prototype.removeEdge=function(t){this.edges=this.edges.filter(function(e){return!e.isEqual(t)}),t.deleteEdge()},n}();var zY=ue(k_(),1);var GY=ue(k_(),1);var qY=ue(PL(),1);var ZY=ue(GL(),1);function qL(n){for(var t=n,e=[];t.parent;)e.unshift(t),t=t.parent;return e}function jY(){return new VL(function(n){return n.f})}var W_={search:function(n,t,e,i){n.cleanDirty(),i=i||{};var s=i.heuristic||W_.heuristics.manhattan,u=i.closest||!1,c=jY(),f=t;for(t.h=s(t,e),c.push(t);c.size()>0;){var p=c.pop();if(p===e)return qL(p);p.closed=!0;for(var d=n.neighbors(p),m=0,y=d.length;m<y;++m){var v=d[m];if(!(v.closed||v.isWall())){var E=p.g+v.getCost(p),M=v.visited;(!M||E<v.g)&&(v.visited=!0,v.parent=p,v.h=v.h||s(v,e),v.g=E,v.f=v.g+v.h,n.markDirty(v),u&&(v.h<f.h||v.h===f.h&&v.g<f.g)&&(f=v),M?c.rescoreElement(v):c.push(v))}}}return u?qL(f):[]},heuristics:{manhattan:function(n,t){var e=Math.abs(t.x-n.x),i=Math.abs(t.y-n.y);return e+i},diagonal:function(n,t){var e=1,i=Math.sqrt(2),s=Math.abs(t.x-n.x),u=Math.abs(t.y-n.y);return e*(s+u)+(i-2*e)*Math.min(s,u)}},cleanNode:function(n){n.f=0,n.g=0,n.h=0,n.visited=!1,n.closed=!1,n.parent=null}};function pf(n,t){t=t||{},this.nodes=[],this.diagonal=!!t.diagonal,this.grid=[];for(var e=0;e<n.length;e++){this.grid[e]=[];for(var i=0,s=n[e];i<s.length;i++){var u=new Pd(e,i,s[i]);this.grid[e][i]=u,this.nodes.push(u)}}this.init()}pf.prototype.init=function(){this.dirtyNodes=[];for(var n=0;n<this.nodes.length;n++)W_.cleanNode(this.nodes[n])};pf.prototype.cleanDirty=function(){for(var n=0;n<this.dirtyNodes.length;n++)W_.cleanNode(this.dirtyNodes[n]);this.dirtyNodes=[]};pf.prototype.markDirty=function(n){this.dirtyNodes.push(n)};pf.prototype.neighbors=function(n){var t=[],e=n.x,i=n.y,s=this.grid;return s[e-1]&&s[e-1][i]&&t.push(s[e-1][i]),s[e+1]&&s[e+1][i]&&t.push(s[e+1][i]),s[e]&&s[e][i-1]&&t.push(s[e][i-1]),s[e]&&s[e][i+1]&&t.push(s[e][i+1]),this.diagonal&&(s[e-1]&&s[e-1][i-1]&&t.push(s[e-1][i-1]),s[e+1]&&s[e+1][i-1]&&t.push(s[e+1][i-1]),s[e-1]&&s[e-1][i+1]&&t.push(s[e-1][i+1]),s[e+1]&&s[e+1][i+1]&&t.push(s[e+1][i+1])),t};pf.prototype.toString=function(){for(var n=[],t=this.grid,e,i,s,u,c=0,f=t.length;c<f;c++){for(e=[],i=t[c],s=0,u=i.length;s<u;s++)e.push(i[s].weight);n.push(e.join(" "))}return n.join(\`
8225
8225
  \`)};function Pd(n,t,e){this.x=n,this.y=t,this.weight=e}Pd.prototype.toString=function(){return"["+this.x+" "+this.y+"]"};Pd.prototype.getCost=function(n){return n&&n.x!==this.x&&n.y!==this.y?this.weight*1.41421:this.weight};Pd.prototype.isWall=function(){return this.weight===0};function VL(n){this.content=[],this.scoreFunction=n}VL.prototype={push:function(n){this.content.push(n),this.sinkDown(this.content.length-1)},pop:function(){var n=this.content[0],t=this.content.pop();return this.content.length>0&&(this.content[0]=t,this.bubbleUp(0)),n},remove:function(n){var t=this.content.indexOf(n),e=this.content.pop();t!==this.content.length-1&&(this.content[t]=e,this.scoreFunction(e)<this.scoreFunction(n)?this.sinkDown(t):this.bubbleUp(t))},size:function(){return this.content.length},rescoreElement:function(n){this.sinkDown(this.content.indexOf(n))},sinkDown:function(n){for(var t=this.content[n];n>0;){var e=(n+1>>1)-1,i=this.content[e];if(this.scoreFunction(t)<this.scoreFunction(i))this.content[e]=t,this.content[n]=i,n=e;else break}},bubbleUp:function(n){for(var t=this.content.length,e=this.content[n],i=this.scoreFunction(e);;){var s=n+1<<1,u=s-1,c=null,f;if(u<t){var p=this.content[u];f=this.scoreFunction(p),f<i&&(c=u)}if(s<t){var d=this.content[s],m=this.scoreFunction(d);m<(c===null?i:f)&&(c=s)}if(c!==null)this.content[n]=this.content[c],this.content[c]=e,n=c;else break}}};function X_(){this._=null}function Ul(n){n.U=n.C=n.L=n.R=n.P=n.N=null}X_.prototype={constructor:X_,insert:function(n,t){var e,i,s;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=HL(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)i=e.U,e===i.L?(s=i.R,s&&s.C?(e.C=s.C=!1,i.C=!0,n=i):(n===e.R&&(df(this,e),n=e,e=n.U),e.C=!1,i.C=!0,mf(this,i))):(s=i.L,s&&s.C?(e.C=s.C=!1,i.C=!0,n=i):(n===e.L&&(mf(this,e),n=e,e=n.U),e.C=!1,i.C=!0,df(this,i))),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t=n.U,e,i=n.L,s=n.R,u,c;if(i?s?u=HL(s):u=i:u=s,t?t.L===n?t.L=u:t.R=u:this._=u,i&&s?(c=u.C,u.C=n.C,u.L=i,i.U=u,u!==s?(t=u.U,u.U=n.U,n=u.R,t.L=n,u.R=s,s.U=u):(u.U=t,t=u,n=u.R)):(c=n.C,n=u),n&&(n.U=t),!c){if(n&&n.C){n.C=!1;return}do{if(n===this._)break;if(n===t.L){if(e=t.R,e.C&&(e.C=!1,t.C=!0,df(this,t),e=t.R),e.L&&e.L.C||e.R&&e.R.C){(!e.R||!e.R.C)&&(e.L.C=!1,e.C=!0,mf(this,e),e=t.R),e.C=t.C,t.C=e.R.C=!1,df(this,t),n=this._;break}}else if(e=t.L,e.C&&(e.C=!1,t.C=!0,mf(this,t),e=t.L),e.L&&e.L.C||e.R&&e.R.C){(!e.L||!e.L.C)&&(e.R.C=!1,e.C=!0,df(this,e),e=t.L),e.C=t.C,t.C=e.L.C=!1,mf(this,t),n=this._;break}e.C=!0,n=t,t=t.U}while(!n.C);n&&(n.C=!1)}}};function df(n,t){var e=t,i=t.R,s=e.U;s?s.L===e?s.L=i:s.R=i:n._=i,i.U=s,e.U=i,e.R=i.L,e.R&&(e.R.U=e),i.L=e}function mf(n,t){var e=t,i=t.L,s=e.U;s?s.L===e?s.L=i:s.R=i:n._=i,i.U=s,e.U=i,e.L=i.R,e.L&&(e.L.U=e),i.R=e}function HL(n){for(;n.L;)n=n.L;return n}var Y_=X_;function Bl(n,t,e,i){var s=[null,null],u=Br.push(s)-1;return s.left=n,s.right=t,e&&gf(s,n,t,e),i&&gf(s,t,n,i),Mi[n.index].halfedges.push(u),Mi[t.index].halfedges.push(u),s}function zl(n,t,e){var i=[t,e];return i.left=n,i}function gf(n,t,e,i){!n[0]&&!n[1]?(n[0]=i,n.left=t,n.right=e):n.left===e?n[1]=i:n[0]=i}function KY(n,t,e,i,s){var u=n[0],c=n[1],f=u[0],p=u[1],d=c[0],m=c[1],y=0,v=1,E=d-f,M=m-p,A;if(A=t-f,!(!E&&A>0)){if(A/=E,E<0){if(A<y)return;A<v&&(v=A)}else if(E>0){if(A>v)return;A>y&&(y=A)}if(A=i-f,!(!E&&A<0)){if(A/=E,E<0){if(A>v)return;A>y&&(y=A)}else if(E>0){if(A<y)return;A<v&&(v=A)}if(A=e-p,!(!M&&A>0)){if(A/=M,M<0){if(A<y)return;A<v&&(v=A)}else if(M>0){if(A>v)return;A>y&&(y=A)}if(A=s-p,!(!M&&A<0)){if(A/=M,M<0){if(A>v)return;A>y&&(y=A)}else if(M>0){if(A<y)return;A<v&&(v=A)}return!(y>0)&&!(v<1)||(y>0&&(n[0]=[f+y*E,p+y*M]),v<1&&(n[1]=[f+v*E,p+v*M])),!0}}}}}function QY(n,t,e,i,s){var u=n[1];if(u)return!0;var c=n[0],f=n.left,p=n.right,d=f[0],m=f[1],y=p[0],v=p[1],E=(d+y)/2,M=(m+v)/2,A,_;if(v===m){if(E<t||E>=i)return;if(d>y){if(!c)c=[E,e];else if(c[1]>=s)return;u=[E,s]}else{if(!c)c=[E,s];else if(c[1]<e)return;u=[E,e]}}else if(A=(d-y)/(v-m),_=M-A*E,A<-1||A>1)if(d>y){if(!c)c=[(e-_)/A,e];else if(c[1]>=s)return;u=[(s-_)/A,s]}else{if(!c)c=[(s-_)/A,s];else if(c[1]<e)return;u=[(e-_)/A,e]}else if(m<v){if(!c)c=[t,A*t+_];else if(c[0]>=i)return;u=[i,A*i+_]}else{if(!c)c=[i,A*i+_];else if(c[0]<t)return;u=[t,A*t+_]}return n[0]=c,n[1]=u,!0}function WL(n,t,e,i){for(var s=Br.length,u;s--;)(!QY(u=Br[s],n,t,e,i)||!KY(u,n,t,e,i)||!(Math.abs(u[0][0]-u[1][0])>Pn||Math.abs(u[0][1]-u[1][1])>Pn))&&delete Br[s]}function XL(n){return Mi[n.index]={site:n,halfedges:[]}}function t$(n,t){var e=n.site,i=t.left,s=t.right;return e===s&&(s=i,i=e),s?Math.atan2(s[1]-i[1],s[0]-i[0]):(e===i?(i=t[1],s=t[0]):(i=t[0],s=t[1]),Math.atan2(i[0]-s[0],s[1]-i[1]))}function $_(n,t){return t[+(t.left!==n.site)]}function e$(n,t){return t[+(t.left===n.site)]}function YL(){for(var n=0,t=Mi.length,e,i,s,u;n<t;++n)if((e=Mi[n])&&(u=(i=e.halfedges).length)){var c=new Array(u),f=new Array(u);for(s=0;s<u;++s)c[s]=s,f[s]=t$(e,Br[i[s]]);for(c.sort(function(p,d){return f[d]-f[p]}),s=0;s<u;++s)f[s]=i[c[s]];for(s=0;s<u;++s)i[s]=f[s]}}function $L(n,t,e,i){var s=Mi.length,u,c,f,p,d,m,y,v,E,M,A,_,x=!0;for(u=0;u<s;++u)if(c=Mi[u]){for(f=c.site,d=c.halfedges,p=d.length;p--;)Br[d[p]]||d.splice(p,1);for(p=0,m=d.length;p<m;)M=e$(c,Br[d[p]]),A=M[0],_=M[1],y=$_(c,Br[d[++p%m]]),v=y[0],E=y[1],(Math.abs(A-v)>Pn||Math.abs(_-E)>Pn)&&(d.splice(p,0,Br.push(zl(f,M,Math.abs(A-n)<Pn&&i-_>Pn?[n,Math.abs(v-n)<Pn?E:i]:Math.abs(_-i)<Pn&&e-A>Pn?[Math.abs(E-i)<Pn?v:e,i]:Math.abs(A-e)<Pn&&_-t>Pn?[e,Math.abs(v-e)<Pn?E:t]:Math.abs(_-t)<Pn&&A-n>Pn?[Math.abs(E-t)<Pn?v:n,t]:null))-1),++m);m&&(x=!1)}if(x){var T,S,R,z=1/0;for(u=0,x=null;u<s;++u)(c=Mi[u])&&(f=c.site,T=f[0]-n,S=f[1]-t,R=T*T+S*S,R<z&&(z=R,x=c));if(x){var U=[n,t],D=[n,i],P=[e,i],ct=[e,t];x.halfedges.push(Br.push(zl(f=x.site,U,D))-1,Br.push(zl(f,D,P))-1,Br.push(zl(f,P,ct))-1,Br.push(zl(f,ct,U))-1)}}for(u=0;u<s;++u)(c=Mi[u])&&(c.halfedges.length||delete Mi[u])}var ZL=[],Rd;function n$(){Ul(this),this.x=this.y=this.arc=this.site=this.cy=null}function ou(n){var t=n.P,e=n.N;if(!(!t||!e)){var i=t.site,s=n.site,u=e.site;if(i!==u){var c=s[0],f=s[1],p=i[0]-c,d=i[1]-f,m=u[0]-c,y=u[1]-f,v=2*(p*y-d*m);if(!(v>=-JL)){var E=p*p+d*d,M=m*m+y*y,A=(y*E-d*M)/v,_=(p*M-m*E)/v,x=ZL.pop()||new n$;x.arc=n,x.site=s,x.x=A+c,x.y=(x.cy=_+f)+Math.sqrt(A*A+_*_),n.circle=x;for(var T=null,S=Gl._;S;)if(x.y<S.y||x.y===S.y&&x.x<=S.x)if(S.L)S=S.L;else{T=S.P;break}else if(S.R)S=S.R;else{T=S;break}Gl.insert(T,x),T||(Rd=x)}}}}function su(n){var t=n.circle;t&&(t.P||(Rd=t.N),Gl.remove(t),ZL.push(t),Ul(t),n.circle=null)}var KL=[];function r$(){Ul(this),this.edge=this.site=this.circle=null}function jL(n){var t=KL.pop()||new r$;return t.site=n,t}function Z_(n){su(n),au.remove(n),KL.push(n),Ul(n)}function QL(n){var t=n.circle,e=t.x,i=t.cy,s=[e,i],u=n.P,c=n.N,f=[n];Z_(n);for(var p=u;p.circle&&Math.abs(e-p.circle.x)<Pn&&Math.abs(i-p.circle.cy)<Pn;)u=p.P,f.unshift(p),Z_(p),p=u;f.unshift(p),su(p);for(var d=c;d.circle&&Math.abs(e-d.circle.x)<Pn&&Math.abs(i-d.circle.cy)<Pn;)c=d.N,f.push(d),Z_(d),d=c;f.push(d),su(d);var m=f.length,y;for(y=1;y<m;++y)d=f[y],p=f[y-1],gf(d.edge,p.site,d.site,s);p=f[0],d=f[m-1],d.edge=Bl(p.site,d.site,null,s),ou(p),ou(d)}function tN(n){for(var t=n[0],e=n[1],i,s,u,c,f=au._;f;)if(u=eN(f,e)-t,u>Pn)f=f.L;else if(c=t-i$(f,e),c>Pn){if(!f.R){i=f;break}f=f.R}else{u>-Pn?(i=f.P,s=f):c>-Pn?(i=f,s=f.N):i=s=f;break}XL(n);var p=jL(n);if(au.insert(i,p),!(!i&&!s)){if(i===s){su(i),s=jL(i.site),au.insert(p,s),p.edge=s.edge=Bl(i.site,p.site),ou(i),ou(s);return}if(!s){p.edge=Bl(i.site,p.site);return}su(i),su(s);var d=i.site,m=d[0],y=d[1],v=n[0]-m,E=n[1]-y,M=s.site,A=M[0]-m,_=M[1]-y,x=2*(v*_-E*A),T=v*v+E*E,S=A*A+_*_,R=[(_*T-E*S)/x+m,(v*S-A*T)/x+y];gf(s.edge,d,M,R),p.edge=Bl(d,n,null,R),s.edge=Bl(n,M,null,R),ou(i),ou(s)}}function eN(n,t){var e=n.site,i=e[0],s=e[1],u=s-t;if(!u)return i;var c=n.P;if(!c)return-1/0;e=c.site;var f=e[0],p=e[1],d=p-t;if(!d)return f;var m=f-i,y=1/u-1/d,v=m/d;return y?(-v+Math.sqrt(v*v-2*y*(m*m/(-2*d)-p+d/2+s-u/2)))/y+i:(i+f)/2}function i$(n,t){var e=n.N;if(e)return eN(e,t);var i=n.site;return i[1]===t?i[0]:1/0}var Pn=1e-6,JL=1e-12,au,Mi,Gl,Br;function o$(n,t,e){return(n[0]-e[0])*(t[1]-n[1])-(n[0]-t[0])*(e[1]-n[1])}function s$(n,t){return t[1]-n[1]||t[0]-n[0]}function Ld(n,t){var e=n.sort(s$).pop(),i,s,u;for(Br=[],Mi=new Array(n.length),au=new Y_,Gl=new Y_;;)if(u=Rd,e&&(!u||e[1]<u.y||e[1]===u.y&&e[0]<u.x))(e[0]!==i||e[1]!==s)&&(tN(e),i=e[0],s=e[1]),e=n.pop();else if(u)QL(u.arc);else break;if(YL(),t){var c=+t[0][0],f=+t[0][1],p=+t[1][0],d=+t[1][1];WL(c,f,p,d),$L(c,f,p,d)}this.edges=Br,this.cells=Mi,au=Gl=Br=Mi=null}Ld.prototype={constructor:Ld,polygons:function(){var n=this.edges;return this.cells.map(function(t){var e=t.halfedges.map(function(i){return $_(t,n[i])});return e.data=t.site.data,e})},triangles:function(){var n=[],t=this.edges;return this.cells.forEach(function(e,i){if(f=(u=e.halfedges).length)for(var s=e.site,u,c=-1,f,p,d=t[u[f-1]],m=d.left===s?d.right:d.left;++c<f;)p=m,d=t[u[c]],m=d.left===s?d.right:d.left,p&&m&&i<p.index&&i<m.index&&o$(s,p,m)<0&&n.push([s.data,p.data,m.data])}),n},links:function(){return this.edges.filter(function(n){return n.right}).map(function(n){return{source:n.left.data,target:n.right.data}})},find:function(n,t,e){for(var i=this,s,u=i._found||0,c=i.cells.length,f;!(f=i.cells[u]);)if(++u>=c)return null;var p=n-f.site[0],d=t-f.site[1],m=p*p+d*d;do f=i.cells[s=u],u=null,f.halfedges.forEach(function(y){var v=i.edges[y],E=v.left;if(!((E===f.site||!E)&&!(E=v.right))){var M=n-E[0],A=t-E[1],_=M*M+A*A;_<m&&(m=_,u=E.index)}});while(u!==null);return i._found=s,e==null||m<=e*e?f.site:null}};var d$=ue(kl(),1);var cx=ue(oN(),1);function Li(){return new Dd}function Dd(){this.reset()}Dd.prototype={constructor:Dd,reset:function(){this.s=this.t=0},add:function(n){sN(Od,n,this.t),sN(this,Od.s,this.s),this.s?this.t+=Od.t:this.s=Od.t},valueOf:function(){return this.s}};var Od=new Dd;function sN(n,t,e){var i=n.s=t+e,s=i-t,u=i-s;n.t=t-u+(e-s)}var yn=1e-6;var An=Math.PI,wr=An/2,Fd=An/4,Qo=An*2,uu=180/An,Ni=An/180,tr=Math.abs,Ro=Math.atan,Oi=Math.atan2,hn=Math.cos;var Ud=Math.exp;var yf=Math.log;var Me=Math.sin;var Zr=Math.sqrt,vf=Math.tan;function K_(n){return n>1?0:n<-1?An:Math.acos(n)}function bi(n){return n>1?wr:n<-1?-wr:Math.asin(n)}function Lo(){}var m$=Li(),Fft=Li();function lu(n){var t=n[0],e=n[1],i=hn(e);return[i*hn(t),i*Me(t),Me(e)]}function _f(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function xf(n){var t=Zr(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}var Xft=Li();function uN(n,t){return[n>An?n-Qo:n<-An?n+Qo:n,t]}uN.invert=uN;function Q_(){var n=[],t;return{point:function(e,i){t.push([e,i])},lineStart:function(){n.push(t=[])},lineEnd:Lo,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function tx(n,t){return tr(n[0]-t[0])<yn&&tr(n[1]-t[1])<yn}function Bd(n,t,e,i){this.x=n,this.z=t,this.o=e,this.e=i,this.v=!1,this.n=this.p=null}function ex(n,t,e,i,s){var u=[],c=[],f,p;if(n.forEach(function(M){if(!((A=M.length-1)<=0)){var A,_=M[0],x=M[A],T;if(tx(_,x)){for(s.lineStart(),f=0;f<A;++f)s.point((_=M[f])[0],_[1]);s.lineEnd();return}u.push(T=new Bd(_,M,null,!0)),c.push(T.o=new Bd(_,null,T,!1)),u.push(T=new Bd(x,M,null,!1)),c.push(T.o=new Bd(x,null,T,!0))}}),!!u.length){for(c.sort(t),lN(u),lN(c),f=0,p=c.length;f<p;++f)c[f].e=e=!e;for(var d=u[0],m,y;;){for(var v=d,E=!0;v.v;)if((v=v.n)===d)return;m=v.z,s.lineStart();do{if(v.v=v.o.v=!0,v.e){if(E)for(f=0,p=m.length;f<p;++f)s.point((y=m[f])[0],y[1]);else i(v.x,v.n.x,1,s);v=v.n}else{if(E)for(m=v.p.z,f=m.length-1;f>=0;--f)s.point((y=m[f])[0],y[1]);else i(v.x,v.p.x,-1,s);v=v.p}v=v.o,m=v.z,E=!E}while(!v.v);s.lineEnd()}}}function lN(n){if(t=n.length){for(var t,e=0,i=n[0],s;++e<t;)i.n=s=n[e],s.p=i,i=s;i.n=s=n[0],s.p=i}}function da(n,t){return n<t?-1:n>t?1:n>=t?0:NaN}function nx(n){return n.length===1&&(n=v$(n)),{left:function(t,e,i,s){for(i==null&&(i=0),s==null&&(s=t.length);i<s;){var u=i+s>>>1;n(t[u],e)<0?i=u+1:s=u}return i},right:function(t,e,i,s){for(i==null&&(i=0),s==null&&(s=t.length);i<s;){var u=i+s>>>1;n(t[u],e)>0?s=u:i=u+1}return i}}}function v$(n){return function(t,e){return da(n(t),e)}}var cN=nx(da),_$=cN.right,x$=cN.left;var fN=Array.prototype,w$=fN.slice,S$=fN.map;var Bht=Math.sqrt(50),zht=Math.sqrt(10),Ght=Math.sqrt(2);function Gd(n){for(var t=n.length,e,i=-1,s=0,u,c;++i<t;)s+=n[i].length;for(u=new Array(s);--t>=0;)for(c=n[t],e=c.length;--e>=0;)u[--s]=c[e];return u}var R$=1e9,Sdt=-R$;var rx=Li();function ix(n,t){var e=t[0],i=t[1],s=[Me(e),-hn(e),0],u=0,c=0;rx.reset();for(var f=0,p=n.length;f<p;++f)if(m=(d=n[f]).length)for(var d,m,y=d[m-1],v=y[0],E=y[1]/2+Fd,M=Me(E),A=hn(E),_=0;_<m;++_,v=T,M=R,A=z,y=x){var x=d[_],T=x[0],S=x[1]/2+Fd,R=Me(S),z=hn(S),U=T-v,D=U>=0?1:-1,P=D*U,ct=P>An,L=M*R;if(rx.add(Oi(L*D*Me(P),A*z+L*hn(P))),u+=ct?U+D*Qo:U,ct^v>=e^T>=e){var W=_f(lu(y),lu(x));xf(W);var V=_f(s,W);xf(V);var Mt=(ct^U>=0?-1:1)*bi(V[2]);(i>Mt||i===Mt&&(W[0]||W[1]))&&(c+=ct^U>=0?1:-1)}}return(u<-yn||u<yn&&rx<-yn)^c&1}var Ndt=Li();var Kdt=Li(),Qdt=Li();var O$=1/0;var nmt=-O$;function ox(n){this._context=n}ox.prototype={_radius:4.5,pointRadius:function(n){return this._radius=n,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(n,t){switch(this._point){case 0:{this._context.moveTo(n,t),this._point=1;break}case 1:{this._context.lineTo(n,t);break}default:{this._context.moveTo(n+this._radius,t),this._context.arc(n,t,this._radius,0,Qo);break}}},result:Lo};var hmt=Li();function sx(){this._string=[]}sx.prototype={_radius:4.5,_circle:dN(4.5),pointRadius:function(n){return(n=+n)!==this._radius&&(this._radius=n,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(n,t){switch(this._point){case 0:{this._string.push("M",n,",",t),this._point=1;break}case 1:{this._string.push("L",n,",",t);break}default:{this._circle==null&&(this._circle=dN(this._radius)),this._string.push("M",n,",",t,this._circle);break}}},result:function(){if(this._string.length){var n=this._string.join("");return this._string=[],n}else return null}};function dN(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function ax(n,t,e,i){return function(s,u){var c=t(u),f=s.invert(i[0],i[1]),p=Q_(),d=t(p),m=!1,y,v,E,M={point:A,lineStart:x,lineEnd:T,polygonStart:function(){M.point=S,M.lineStart=R,M.lineEnd=z,v=[],y=[]},polygonEnd:function(){M.point=A,M.lineStart=x,M.lineEnd=T,v=Gd(v);var U=ix(y,f);v.length?(m||(u.polygonStart(),m=!0),ex(v,U$,U,e,u)):U&&(m||(u.polygonStart(),m=!0),u.lineStart(),e(null,null,1,u),u.lineEnd()),m&&(u.polygonEnd(),m=!1),v=y=null},sphere:function(){u.polygonStart(),u.lineStart(),e(null,null,1,u),u.lineEnd(),u.polygonEnd()}};function A(U,D){var P=s(U,D);n(U=P[0],D=P[1])&&u.point(U,D)}function _(U,D){var P=s(U,D);c.point(P[0],P[1])}function x(){M.point=_,c.lineStart()}function T(){M.point=A,c.lineEnd()}function S(U,D){E.push([U,D]);var P=s(U,D);d.point(P[0],P[1])}function R(){d.lineStart(),E=[]}function z(){S(E[0][0],E[0][1]),d.lineEnd();var U=d.clean(),D=p.result(),P,ct=D.length,L,W,V;if(E.pop(),y.push(E),E=null,!!ct){if(U&1){if(W=D[0],(L=W.length-1)>0){for(m||(u.polygonStart(),m=!0),u.lineStart(),P=0;P<L;++P)u.point((V=W[P])[0],V[1]);u.lineEnd()}return}ct>1&&U&2&&D.push(D.pop().concat(D.shift())),v.push(D.filter(F$))}}return M}}function F$(n){return n.length>1}function U$(n,t){return((n=n.x)[0]<0?n[1]-wr-yn:wr-n[1])-((t=t.x)[0]<0?t[1]-wr-yn:wr-t[1])}var B$=ax(function(){return!0},z$,k$,[-An,-wr]);function z$(n){var t=NaN,e=NaN,i=NaN,s;return{lineStart:function(){n.lineStart(),s=1},point:function(u,c){var f=u>0?An:-An,p=tr(u-t);tr(p-An)<yn?(n.point(t,e=(e+c)/2>0?wr:-wr),n.point(i,e),n.lineEnd(),n.lineStart(),n.point(f,e),n.point(u,e),s=0):i!==f&&p>=An&&(tr(t-i)<yn&&(t-=i*yn),tr(u-f)<yn&&(u-=f*yn),e=G$(t,e,u,c),n.point(i,e),n.lineEnd(),n.lineStart(),n.point(f,e),s=0),n.point(t=u,e=c),i=f},lineEnd:function(){n.lineEnd(),t=e=NaN},clean:function(){return 2-s}}}function G$(n,t,e,i){var s,u,c=Me(n-e);return tr(c)>yn?Ro((Me(t)*(u=hn(i))*Me(e)-Me(i)*(s=hn(t))*Me(n))/(s*u*c)):(t+i)/2}function k$(n,t,e,i){var s;if(n==null)s=e*wr,i.point(-An,s),i.point(0,s),i.point(An,s),i.point(An,0),i.point(An,-s),i.point(0,-s),i.point(-An,-s),i.point(-An,0),i.point(-An,s);else if(tr(n[0]-t[0])>yn){var u=n[0]<t[0]?An:-An;s=e*u/2,i.point(-u,s),i.point(0,s),i.point(u,s)}else i.point(t[0],t[1])}function kd(n){return function(t){var e=new ux;for(var i in n)e[i]=n[i];return e.stream=t,e}}function ux(){}ux.prototype={constructor:ux,point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Qmt=hn(30*Ni);var pgt=kd({point:function(n,t){this.stream.point(n*Ni,t*Ni)}});function qd(n){return function(t,e){var i=hn(t),s=hn(e),u=n(i*s);return[u*s*Me(t),u*Me(e)]}}function ts(n){return function(t,e){var i=Zr(t*t+e*e),s=n(i),u=Me(s),c=hn(s);return[Oi(t*u,i*c),bi(i&&e*u/i)]}}var EN=qd(function(n){return Zr(2/(1+n))});EN.invert=ts(function(n){return 2*bi(n/2)});var wN=qd(function(n){return(n=K_(n))&&n/Me(n)});wN.invert=ts(function(n){return n});function lx(n,t){return[n,yf(vf((wr+t)/2))]}lx.invert=function(n,t){return[n,2*Ro(Ud(t))-wr]};function Vd(n,t){return[n,t]}Vd.invert=Vd;function SN(n,t){var e=hn(t),i=hn(n)*e;return[e*Me(n)/i,Me(t)/i]}SN.invert=ts(Ro);function MN(n,t){var e=t*t,i=e*e;return[n*(.8707-.131979*e+i*(-.013791+i*(.003971*e-.001529*i))),t*(1.007226+e*(.015085+i*(-.044475+.028874*e-.005916*i)))]}MN.invert=function(n,t){var e=t,i=25,s;do{var u=e*e,c=u*u;e-=s=(e*(1.007226+u*(.015085+c*(-.044475+.028874*u-.005916*c)))-t)/(1.007226+u*(.015085*3+c*(-.044475*7+.028874*9*u-.005916*11*c)))}while(tr(s)>yn&&--i>0);return[n/(.8707+(u=e*e)*(-.131979+u*(-.013791+u*u*u*(.003971-.001529*u)))),e]};function bN(n,t){return[hn(t)*Me(n),Me(t)]}bN.invert=ts(bi);function AN(n,t){var e=hn(t),i=1+hn(n)*e;return[e*Me(n)/i,Me(t)/i]}AN.invert=ts(function(n){return 2*Ro(n)});function TN(n,t){return[yf(vf((wr+t)/2)),-n]}TN.invert=function(n,t){return[-t,2*Ro(Ud(n))-wr]};var Y$=ue(kl(),1);var $$=ue(kl(),1);var J$=ue(kl(),1);var j$=ue(kl(),1);var w1t=ue(e2(),1),S1t=ue(mv(),1);function n2(n){return n.replace(/[A-Z]/g,t=>"_"+t.toLowerCase()).replace(/^_/,"")}function r2(n){let t={};for(let i in n)i.startsWith("on")&&(t[n2(i.slice(2))]=n[i],t[i]=n[i]);let e=i=>Tf(this,null,function*(){let{data:s}=i;if(t[s.type])try{let u=yield t[s.type](s.data);if(u!=null&&u.$transfer&&Array.isArray(u.$transfer)){let c=u.$transfer;delete u.$transfer,self.postMessage({type:""+s.type+"_result",key:s.key,data:u},c)}else self.postMessage({type:""+s.type+"_result",key:s.key,data:u})}catch(u){self.postMessage({type:""+s.type+"_result",key:s.key,error:u})}else self.postMessage({type:""+s.type+"_result",key:s.key,error:"no_event"})});return self.addEventListener("message",e),()=>{self.removeEventListener("message",e)}}var O1t=ue(Eg(),1),D1t=ue(wg(),1),F1t=ue(Sg(),1),U1t=ue(bg(),1),B1t=ue(Ag(),1),z1t=ue(Pg(),1),G1t=ue(Ng(),1),k1t=ue(Dg(),1),q1t=ue(Fg(),1),V1t=ue(Bg(),1),H1t=ue(Gg(),1),W1t=ue(Hg(),1),X1t=ue(Yg(),1),Y1t=ue(u0(),1),$1t=ue(l0(),1),Z1t=ue(Qf(),1),J1t=ue(av(),1);function Hl(n,t=!1){let e=n[0].index!==null,i=new Set(Object.keys(n[0].attributes)),s=new Set(Object.keys(n[0].morphAttributes)),u={},c={},f=n[0].morphTargetsRelative,p=new Ri,d=0;for(let m=0;m<n.length;++m){let y=n[m],v=0;if(e!==(y.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+m+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let E in y.attributes){if(!i.has(E))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+m+'. All geometries must have compatible attributes; make sure "'+E+'" attribute exists among all geometries, or in none of them.'),null;u[E]===void 0&&(u[E]=[]),u[E].push(y.attributes[E]),v++}if(v!==i.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+m+". Make sure all geometries have the same number of attributes."),null;if(f!==y.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+m+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let E in y.morphAttributes){if(!s.has(E))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+m+". .morphAttributes must be consistent throughout all geometries."),null;c[E]===void 0&&(c[E]=[]),c[E].push(y.morphAttributes[E])}if(t){let E;if(e)E=y.index.count;else if(y.attributes.position!==void 0)E=y.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+m+". The geometry must have either an index or a position attribute"),null;p.addGroup(d,E,m),d+=E}}if(e){let m=0,y=[];for(let v=0;v<n.length;++v){let E=n[v].index;for(let M=0;M<E.count;++M)y.push(E.getX(M)+m);m+=n[v].attributes.position.count}p.setIndex(y)}for(let m in u){let y=i2(u[m]);if(!y)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+m+" attribute."),null;p.setAttribute(m,y)}for(let m in c){let y=c[m][0].length;if(y===0)break;p.morphAttributes=p.morphAttributes||{},p.morphAttributes[m]=[];for(let v=0;v<y;++v){let E=[];for(let A=0;A<c[m].length;++A)E.push(c[m][A][v]);let M=i2(E);if(!M)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+m+" morphAttribute."),null;p.morphAttributes[m].push(M)}}return p}function i2(n){let t,e,i,s=-1,u=0;for(let d=0;d<n.length;++d){let m=n[d];if(t===void 0&&(t=m.array.constructor),t!==m.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(e===void 0&&(e=m.itemSize),e!==m.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(i===void 0&&(i=m.normalized),i!==m.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(s===-1&&(s=m.gpuType),s!==m.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;u+=m.count*e}let c=new t(u),f=new Yn(c,e,i),p=0;for(let d=0;d<n.length;++d){let m=n[d];if(m.isInterleavedBufferAttribute){let y=p/e;for(let v=0,E=m.count;v<E;v++)for(let M=0;M<e;M++){let A=m.getComponent(v,M);f.setComponent(v+y,M,A)}}else c.set(m.array,p);p+=m.count*e}return s!==void 0&&(f.gpuType=s),f}function o2(n,t,e){t===void 0&&(t=!0),e===void 0&&(e=!1);let i=n.filter(f=>f.geometry.type==="polygon");if(!i.length)return null;let s=i.map(f=>{var p;let d=f.geometry.coords,m=vl(d[0],d.slice(1)),y=new ml(m,{steps:1,bevelEnabled:!1,depth:f.height,curveSegments:4});(p=f).deltaHeight||(p.deltaHeight=0),y.translate(0,0,f.airHeight+f.deltaHeight);let v=y.attributes.position.count,E=new Float32Array(v).fill(f.height+f.airHeight+f.deltaHeight);if(y.setAttribute("maxZ",new Yn(E,1)),y.setAttribute("opacity",new Yn(new Float32Array(v).fill(f.fillOpacity),1)),e){let _=new Float32Array(v).fill(f.airHeight+f.deltaHeight);y.setAttribute("minZ",new Yn(_,1))}let M=new fn(f.fillColor).convertLinearToSRGB(),A=new Float32Array(v*3);for(let _=0;_<v;_++)A[_*3]=M.r,A[_*3+1]=M.g,A[_*3+2]=M.b;return y.setAttribute("color",new Yn(A,3)),y}),u=Hl(s);s.forEach(f=>f.dispose());let c={geometry:u};return u.dispose(),t&&(c.lineGeometry=vx(i)||void 0),c}function vx(n){let{points:t,colors:e,opacities:i}=XZ(n);if(!t.length)return null;let s=new Ri().setFromPoints(t);return s.setAttribute("color",new Yn(new Float32Array(e),3)),s.setAttribute("opacity",new Yn(new Float32Array(i),1)),s}function XZ(n){let t=[],e=[],i=[];return n.filter(s=>s.strokeOpacity>0).map(s=>{let u=s.height+(s.deltaHeight||0)+s.airHeight,{coords:c}=s.geometry,{strokeColor:f,strokeOpacity:p}=s,d=new fn(f).convertLinearToSRGB();for(let m=0;m<c.length;m++){let y=c[m];for(let v=0;v<y.length;v++){let E=y[v],M=v+1===y.length?y[0]:y[v+1];t.push(new at(E[0],E[1],u)),t.push(new at(M[0],M[1],u)),e.push(d.r,d.g,d.b),e.push(d.r,d.g,d.b),i.push(p),i.push(p)}}}),{points:t,colors:e,opacities:i}}r2({onGetMergedGeometryAttributes(n){let{data:t}=n,e=t.map(u=>{let c=u.geometry.coords,f=vl(c[0],c.slice(1));return new ml(f,{steps:1,bevelEnabled:!1,depth:u.height,curveSegments:4})}),i=Hl(e);e.forEach(u=>u.dispose());let s={attributes:i.attributes,index:i.index,morphAttributes:i.morphAttributes,morphTargetsRelative:i.morphTargetsRelative,groups:i.groups,boundingSphere:i.boundingSphere};return i.dispose(),s},onGetMergedShapeGeometryAttributes(n){let{data:t}=n,e=t.map(u=>{let c=vl(u.geometry.coords[0].slice(0,-1),u.geometry.coords.slice(1)),f=new qc(c,4),p=f.getAttribute("position"),d=[],m=new fn(u.fillColor);for(let v=0;v<p.count;v++){p.setZ(v,u.airHeight+(u.deltaHeight||0));var y;d.push(m.r,m.g,m.b,(y=u.fillOpacity)!=null?y:1)}return f.setAttribute("color",new Yn(new Float32Array(d),4)),f}),i=Hl(e);e.forEach(u=>u.dispose());let s={attributes:i.attributes,index:i.index,morphAttributes:i.morphAttributes,morphTargetsRelative:i.morphTargetsRelative,groups:i.groups,boundingSphere:i.boundingSphere};return i.dispose(),s},onGetMergedTexture2dShapeGeometryAttributes(n){let{data:t}=n,e=t.map(u=>{let c=vl(u.geometry.coords[0].slice(0,-1),u.geometry.coords.slice(1)),f=new qc(c,4),p=f.getAttribute("position"),d=[1,1,1,0,0,0,0,1];f.setAttribute("uv",new Wr(d,2));let m=u.height+(u.deltaHeight||0)+u.airHeight;for(let y=0;y<p.count;y++)p.setZ(y,m);return f}),i=Hl(e);e.forEach(u=>u.dispose());let s={attributes:i.attributes,index:i.index,morphAttributes:i.morphAttributes,morphTargetsRelative:i.morphTargetsRelative,groups:i.groups,boundingSphere:i.boundingSphere};return i.dispose(),s},onGetMergedGeometriesJson(n){let{data:t}=n,e=o2(t,!1);return e?{mergedGeometry:e.geometry.toJSON()}:null},onGetMergedGeometriesLineJson(n){let{data:t}=n,e=vx(t);return e?{lineGeometry:e.toJSON()}:null}});
8226
- `],{type:"text/javascript"}),t=URL.createObjectURL(r),e=new Worker(t);return URL.revokeObjectURL(t),e}var y0=class{static GetMergeGeometry(t){return St(this,null,function*(){let e=yield this.WorkerPool.getWorker(),n=yield oi(e,"get_merged_geometry_attributes",{data:t}),i=this.GetBufferGeometryByData(n);return this.WorkerPool.releaseWorker(e),i})}static GetMergedShapeGeometry(t){return St(this,null,function*(){let e=yield this.WorkerPool.getWorker(),n=yield oi(e,"get_merged_shape_geometry_attributes",{data:t}),i=this.GetBufferGeometryByData(n);return this.WorkerPool.releaseWorker(e),i})}static GetMergedTexture2dGeometry(t){return St(this,null,function*(){let e=yield this.WorkerPool.getWorker(),n=yield oi(e,"get_merged_texture2d_shape_geometry_attributes",{data:t}),i=this.GetBufferGeometryByData(n);return this.WorkerPool.releaseWorker(e),i})}static GetBufferGeometryByData(t){let e=new Xe;return Object.keys(t.attributes).forEach(n=>{e.setAttribute(n,new We(t.attributes[n].array,t.attributes[n].itemSize))}),t.index&&e.setIndex(new We(t.index.array,t.index.itemSize)),e.morphAttributes=t.morphAttributes,e.morphTargetsRelative=t.morphTargetsRelative,e.groups=t.groups,e.boundingSphere=t.boundingSphere,e}static GetMergedGeometry(t){return St(this,null,function*(){let e=yield this.WorkerPool.getWorker(),n=yield oi(e,"get_merged_geometries_json",{data:t});return this.WorkerPool.releaseWorker(e),n?Jt({},t[0],n):null})}static GetMergedGeometryLine(t){return St(this,null,function*(){let e=yield this.WorkerPool.getWorker(),n=yield oi(e,"get_merged_geometries_line_json",{data:t});return this.WorkerPool.releaseWorker(e),n?Jt({},t[0],n):null})}static dispose(){this.WorkerPool.dispose()}};y0.WorkerPool=new Oy(10,RI);var RY=V(Ws(),1),vl={id:"",height:.1,airHeight:0,area:0,group:"",fillColor:"#EFF4FB",strokeColor:"#ffffff",fillOpacity:1,strokeOpacity:1,strokeWidth:1,doors:[],visible:!0,geometry:{type:"polygon",cds:[],coords:[],curveCpt:[],curveIndex:[]},layerType:"",zIndex:0,stroke:!0,deltaHeight:0,userData:{},gradualColor:[],renderType:"single",colorFactor:.9,center_x:0,center_y:0,center_coord_x:0,center_coord_y:0,dashed:!1},wo=class extends ye{getCenter(){if(this.options.geometry.type==="point")return this.position.clone();let t=new G,e=new Ge;return e.setFromObject(this),e.getCenter(t),t}getSize(){if(this.options.geometry.type==="point")return new G(0,0,0);let t=new Ge,e=new G;return t.setFromObject(this),t.getSize(e),e}getPosition(){let{center_coord_x:t,center_coord_y:e}=this.options,n=this.getCenter();return n.setZ(n.z+this.options.height/2),new G(t,e,n.z+this.options.height/2)}init(){this.geometry=this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options.airHeight+this.options.deltaHeight,this.options.stroke&&this.options.strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())}initDoor(){var t;if((t=this.options.doors)!=null&&t.length&&this.options.geometry.type==="polygon"){let e=this.options.geometry.coords[0];this.options.doors.forEach(n=>{let i=n.type==="single"?.5:1,o=.5,a=Z0(e,n.coord),l=new ft(...n.coord),c=new ft(...e[a]).sub(new ft(...n.coord)).normalize(),p=new ft().addVectors(l,c.clone().multiplyScalar(i)),g=new ft().addVectors(l,c.clone().multiplyScalar(-i)),m=new ft(-c.y,c.x),y=new ft().addVectors(p,m.clone().multiplyScalar(o));vT([y.x,y.y],e)||(m.multiplyScalar(-1),y=new ft().addVectors(p,m.clone().multiplyScalar(o)));let x=new ft().addVectors(g,m.clone().multiplyScalar(o)),S=[[p.x,p.y],[y.x,y.y],[x.x,x.y],[g.x,g.y]];e=this.options.geometry.coords[0]=[...e.slice(0,a+1),...S,...e.slice(a+1)]})}}initGeometry(){let t=$m(this.options.geometry.coords[0],this.options.geometry.coords.slice(1));return new Ap(t,{steps:1,bevelEnabled:!1,depth:this.options.height,curveSegments:4})}initSingleMaterial(){let t=rn.createMeshBasicMaterial({color:this.options.fillColor,opacity:this.options.fillOpacity});if(this.options.secondUrl&&Mo.getTextureByUrl(this.options.secondUrl).then(n=>{n.wrapS=Gs,n.wrapT=Gs,n.needsUpdate=!0,t.map=n,t.side=Xi}),this.options.height<=.1)return this.material=t,t;let e=rn.createMeshBasicMaterial({color:K0(this.options.fillColor),opacity:this.options.fillOpacity});return this.material=[t,e],[t,e]}getMaxAndMin(t,e){let n=new Ge().setFromObject(this),i=t.clone().add(e.clone().multiplyScalar(1e3)),o=new da(i,e.clone().multiplyScalar(-1)),a=new G;o.intersectBox(n,a);let l=t.clone().add(e.clone().multiplyScalar(-1e3)),c=new da(l,e.clone()),p=new G;return c.intersectBox(n,p),{max:p,min:a}}initGradualMaterial(){let{max:t,min:e}=new Ge().setFromObject(this),n=t.clone().sub(e),i=Math.max(n.x,n.y,n.z)/2,o=this.getPosition(),a=new G(-1,.2,0).normalize(),{max:l,min:c}=this.getMaxAndMin(o,a),p=rn.createShaderMaterial({gradualColor:this.options.gradualColor,center:this.getPosition(),maxValue:i,opacity:this.options.fillOpacity,direction:new G(-1,.2,0),max:l,min:c});if(this.options.height<=.1)return this.material=p,p;let g=this.getCenter(),m=new G(-1,.2,1).normalize(),{max:y,min:x}=this.getMaxAndMin(g,m),S=rn.createShaderMaterial({gradualColor:[K0(this.options.gradualColor[0],this.options.colorFactor),K0(this.options.gradualColor[1],this.options.colorFactor)],center:this.getCenter(),maxValue:i,opacity:this.options.fillOpacity,direction:new G(-1,.2,1),max:y,min:x});return this.material=[p,S],[p,S]}initMaterial(){return this.options.renderType==="gradual"?this.initGradualMaterial():this.initSingleMaterial()}initLineMaterial(){if(this.options.dashed){let t=rn.createLineDashedMaterial({color:this.options.strokeColor,opacity:this.options.strokeOpacity});return this.lineMaterial=t,t}else{let t=rn.createLineMaterial({color:this.options.strokeColor,opacity:this.options.strokeOpacity});return this.lineMaterial=t,t}}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new Ne(this.geometry,this.material),this.add(this.mesh)}getBorderPoints(){let t=[],e=this.options.height+this.options.deltaHeight,{coords:n}=this.options.geometry;for(let i=0;i<n.length;i++){let o=n[i];for(let a=0;a<o.length;a++){let l=o[a],c=a+1===o.length?o[0]:o[a+1];t.push(new G(l[0],l[1],e)),t.push(new G(c[0],c[1],e))}}return t}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.getBorderPoints(),e=new Xe().setFromPoints(t);this.lineGeometry=e}createBorder(){this.line&&this.remove(this.line);let t=new Yi(this.lineGeometry,this.lineMaterial);return t.position.z=this.options.airHeight+.01,this.options.dashed&&t.computeLineDistances(),this.line=t,this.add(t),t}setOpacity(t,e){if(e===void 0&&(e=!1),e)this.options.fillOpacity=t,this.options.strokeOpacity=t;else{let{fillOpacity:n,strokeOpacity:i}=this.originOptions;this.options.fillOpacity=Math.min(n,t),this.options.strokeOpacity=Math.min(i,t)}}raycast(t){if(!this.visible||this.options.geometry.type==="point")return!1;this.mesh.updateMatrixWorld(!0);let e=t.intersectObject(this.mesh);if(e[0]){let{point:n,distance:i}=e[0];return{position:n,distance:i}}return!1}dispose(){var t,e;(t=this.geometry)==null||t.dispose(),(e=this.line)==null||e.geometry.dispose(),this.clear()}constructor(t,e){if(super(),this.context=t,this.line=null,this.options=$p((0,RY.cloneDeep)(Jt({},vl,e)),this),this.originOptions={fillOpacity:this.options.fillOpacity,strokeOpacity:this.options.strokeOpacity},this.options.geometry.type==="point"){let[n,i]=this.options.geometry.coords;return this.position.set(n,i,this.options.height+this.options.airHeight),this}this.initDoor(),this.init(),this.visible=this.options.visible,this.addEventListener("change-fillColor",n=>{let{value:i}=n;this.initMaterial(),this.initMesh()}),this.addEventListener("change-fillOpacity",n=>{let{value:i}=n;this.initMaterial(),this.initMesh()}),this.addEventListener("change-height",n=>{let{value:i}=n;this.dispose(),this.init()}),this.addEventListener("change-strokeColor",n=>{let{value:i}=n;!this.options.stroke||!this.options.strokeOpacity||(this.initLineMaterial(),this.createBorder())}),this.addEventListener("change-strokeOpacity",n=>{let{value:i}=n;if(this.options.stroke)if(i)this.lineGeometry||this.initLineGeometry(),this.initLineMaterial(),this.createBorder();else{var o;this.line&&(this.remove(this.line),this.line=null),(o=this.lineGeometry)==null||o.dispose(),this.lineGeometry=void 0}}),this.addEventListener("change-airHeight",n=>{let{value:i}=n;this.position.z=i}),this.addEventListener("change-visible",n=>{let{value:i}=n;this.visible=i}),this.addEventListener("change-stroke",n=>{let{value:i}=n;if(i){if(this.line)return;this.initLineGeometry(),this.initLineMaterial(),this.createBorder()}else if(this.line){var o;this.remove(this.line),(o=this.lineGeometry)==null||o.dispose()}}),this.addEventListener("change-dashed",()=>{!this.options.stroke||!this.options.strokeOpacity||(this.lineGeometry||this.initLineGeometry(),this.initLineMaterial(),this.createBorder())}),this.addEventListener("change-renderType",()=>{this.initMaterial(),this.initMesh()}),this.addEventListener("change-gradualColor",()=>{this.initMaterial(),this.initMesh()})}};var i_=class extends ye{initLight(){let t=gM(16777215,.5);return t.position.set(0,0,100),this.add(t),t}changeLightCamera(t){let e=t.x,n=t.y;this.directionalLight.shadow.camera.left=-e,this.directionalLight.shadow.camera.right=e,this.directionalLight.shadow.camera.top=n,this.directionalLight.shadow.camera.bottom=-n,this.directionalLight.shadow.camera.near=.5,this.directionalLight.shadow.camera.far=Math.max(e,n)}changeLightColor(t){this.directionalLight.color=new ne(t)}setPosition(t){this.position.copy(t),this.directionalLight.position.set(-t.x/2,-t.y/2,100)}initPlane(t,e){t===void 0&&(t=1e3),e===void 0&&(e=1e3);let n=new qa(t,e),i=new Hm({transparent:!0,opacity:0,side:Xi}),o=new Ne(n,i);return o.receiveShadow=!0,o.position.z=-10,this.add(o),this.plane=o,o}setTarget(t){this.directionalLight.target=t}transformOpacity(t){return t*this.basicOpacity}setOpacity(t){this.plane.material.opacity=this.transformOpacity(t)}dispose(){wr(this,!0)}constructor(){super(),this.basicOpacity=.07,this.directionalLight=this.initLight(),this.initPlane()}};var WJt=V(De(),1);var PY=V(Ws(),1);var cbt={autoUpdate:!0,appendToBody:!1,autoChangePlacement:!1},ff=class extends Zi{initObserver(){let t=new MutationObserver((0,PY.debounce)(()=>{this.div&&this.usePlacement()},100));t.observe(this.div,{childList:!0,subtree:!0,attributes:!0}),this.observer=t}getPlacementPosition(){var t,e;if(this.element instanceof wo&&this.element.options.geometry.type==="polygon"){let{max:a,min:l}=new Ge().setFromObject(this.element),c=(a.x+l.x)/2,p=(a.y+l.y)/2;return{left:new G(l.x,p,a.z),leftTop:new G(l.x,a.y,a.z),top:new G(c,a.y,a.z),rightTop:new G(a.x,a.y,a.z),right:new G(a.x,p,a.z),rightBottom:new G(a.x,l.y,a.z),bottom:new G(c,l.y,a.z),leftBottom:new G(l.x,l.y,a.z),center:new G(c,p,a.z)}}let{x:n,y:i,z:o}=((e=this.element)==null||(t=e.getPosition)==null?void 0:t.call(e))||this.position;return{left:new G(n,i,o),leftTop:new G(n,i,o),top:new G(n,i,o),rightTop:new G(n,i,o),right:new G(n,i,o),rightBottom:new G(n,i,o),bottom:new G(n,i,o),leftBottom:new G(n,i,o),center:new G(n,i,o)}}getPlacementScreenPosition(){let{width:t,height:e}=this.context.clientSize,n=this.getPlacementPosition();return Object.keys(n).reduce((i,o)=>{let{x:a,y:l}=bn(n[o],this.context.camera,t,e);return i[o]={x:a,y:l},i},{})}checkOverflow(t,e){let{width:n,height:i}=this.context.clientSize;return e.x>0&&t.x<n&&e.y<i&&t.y>0}getPlacement(){let{clientWidth:t,clientHeight:e}=this.div,n=this.getPlacementScreenPosition(),i=t/2,o=e/2,a=[{type:"center",getBox(l,c){return{max:{x:i+l,y:c-e},min:{x:l-i,y:c}}}},{type:"left",getBox(l,c){return{max:{x:l,y:c-o},min:{x:l-t,y:c+o}}}},{type:"leftTop",getBox(l,c){return{max:{x:l,y:c-e},min:{x:l-t,y:c}}}},{type:"top",getBox(l,c){return{max:{x:l+i,y:c-e},min:{x:l-i,y:c}}}},{type:"rightTop",getBox(l,c){return{max:{x:l+t,y:c-e},min:{x:l,y:c}}}},{type:"right",getBox(l,c){return{max:{x:l+t,y:c-o},min:{x:l,y:c+o}}}},{type:"rightBottom",getBox(l,c){return{max:{x:l+t,y:c},min:{x:l,y:c+e}}}},{type:"bottom",getBox(l,c){return{max:{x:l+i,y:c},min:{x:l-i,y:c+e}}}},{type:"leftBottom",getBox(l,c){return{max:{x:l,y:c},min:{x:l-t,y:c+o}}}}];for(let l=0;l<a.length;l++){let c=a[l],p=n[c.type],{max:g,min:m}=c.getBox(p.x,p.y);if(this.checkOverflow(g,m))return{type:c.type,position:p}}return{type:"center",position:n.center}}initDiv(){let t=document.createElement("div");return t.style.position="absolute",t}usePlacement(){let t=this.getPlacement();this.div.className="overlay_"+t.type,this._updatePosition(t.position.x,t.position.y)}bindElement(t){this.element=t,this.options.autoChangePlacement&&this.initObserver(),this.onUpdate()}unBindElement(){this.element=void 0}setVisible(t,e){e===void 0&&(e="block"),t!==this.visible&&(this.div.style.display=t?e:"none",this.visible=t)}setOpacity(t){this.div.style.opacity=""+t}getPosition(){return this.element?typeof this.element.getPosition=="function"?this.element.getPosition():new Ge().setFromObject(this.element).getCenter(new G):this.position}get withinDisplayRange(){let{x:t,y:e}=this.clientPos,{width:n,height:i}=this.context.clientSize;return t>=0&&t<=n&&e>=0&&e<=i}_updatePosition(t,e){this.clientPos={x:t,y:e};let{width:n,height:i,x:o,y:a}=this.context.clientSize;if(this.div){if(this.options.appendToBody){this.div.style.left=""+o+"px",this.div.style.top=""+(a+i)+"px";return}this.options.autoUpdate?(this.div.style.left=""+t+"px",this.div.style.bottom=""+(i-e)+"px"):this.dispatchEvent({type:"update-position",x:t,y:e,width:n,height:i})}}updatePosition(t){t===void 0&&(t=!1);let e=this.getPosition(),{width:n,height:i}=this.context.clientSize,{x:o,y:a}=bn(e,this.context.camera,n,i);this.clientPos.x===o&&this.clientPos.y===a&&!t||this._updatePosition(o,a)}registryEvent(){this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate)}dispose(){var t,e;super.dispose(),this.unRegistryEvent(),this.unBindElement(),(t=this.observer)==null||t.disconnect(),(e=this.div)==null||e.remove(),this.div=null}constructor(t,e={}){super(),this.context=t,this.position=new G,this.clientPos={x:0,y:0},this.visible=!0,this.placement="top",this.observer=null,this.onUpdate=()=>{this.options.autoChangePlacement?this.usePlacement():this.updatePosition()},this.options=Jt({},cbt,e),this.registryEvent(),this.div=this.initDiv(),this.options.appendToBody?document.body.appendChild(this.div):this.context.container.appendChild(this.div)}};var hbt={texts:[{text:""}],level:1,icon_position:"bottom",collision_enable:!0,opacity:1,id:"",position:{x:0,y:0,z:0},icon_opacity:1,icon_border:{color:"#586EE0",width:0},background:"",collision_hide_icon:!0,built_in:!1,box_only_icon:!1},Fh=class extends En{get withinDisplayRange(){return this.overlay.withinDisplayRange}resetSize(){return St(this,null,function*(){if(yield bT(),!this.disposed)if(this.options.box_only_icon){if(!this.img)return;let{width:t,height:e}=this.img.getBoundingClientRect();this.size={width:t+2,height:e+2}}else{let{width:t,height:e}=this.div.getBoundingClientRect();this.size={width:t+2,height:e+2}}})}renderHelperBox(){}get clientPos(){return this.overlay.clientPos}initDiv(){let t=document.createElement("div");return this.div=t,this.addText(),this.options.icon&&this.addIcon(),t.style.fontSize="12px",t.style.textShadow="#fff 1px 0 0, #fff 0 1px 0, #fff -1px 0 0, #fff 0 -1px 0",t.style.display="flex",t.style.flexDirection="column",t.style.justifyContent="center",t.style.alignItems="center",t.style.padding="4px",this.overlay.setOpacity(this.options.opacity),this.overlay.div.style.pointerEvents="none",this.overlay.div.style.userSelect="none",this.overlay.div.appendChild(t),this.resetSize(),t}addIcon(){if(!this.img){let t=this.initIcon();this.options.icon_position==="top"?this.div.firstChild?this.div.insertBefore(t,this.div.firstChild):this.div.appendChild(t):this.div.appendChild(t)}}addText(){let t=this.initText();this.options.icon_position==="top"?this.div.appendChild(t):this.div.firstChild?this.div.insertBefore(t,this.div.firstChild):this.div.appendChild(t)}getPosition(){return this.position}initText(){let t=document.createElement("div");return t.appendChild(this.createTextFragment()),t.style.textAlign="center",this.textDiv=t,t}createTextFragment(){let t=document.createDocumentFragment();return this.options.texts.forEach(e=>{let n=document.createElement("div");if(n.style.whiteSpace="nowrap",e.styles)for(let[i,o]of Object.entries(e.styles))n.style[i]=o;n.textContent=e.text,t.appendChild(n)}),t}initIcon(){var t,e;let n=document.createElement("img");return n.setAttribute("src",this.options.icon),n.style.width=""+(((t=this.options.icon_size)==null?void 0:t[0])||32)+"px",n.style.height=""+(((e=this.options.icon_size)==null?void 0:e[1])||32)+"px",n.style.opacity=""+this.options.icon_opacity+"px",n.style.borderRadius="50%",this.options.icon_border.width&&(n.style.border=this.options.icon_border.width+"px solid "+this.options.icon_border.color),n.onload=()=>{this.resetSize()},this.img=n,n}registryEvent(){}unRegistryEvent(){}setVisible(t){t!==this.visible&&(this.visible=t,this.changeOverlayVisible(t))}changeOverlayVisible(t){if(!(t===this.overlay.visible&&this.options.collision_hide_icon))if(this.options.collision_hide_icon)this.overlay.visible=t,this.overlay.div.style.visibility=t?"visible":"hidden";else{if(this.showTextStatus===t)return;this.textDiv.style.visibility=t?"visible":"hidden",this.showTextStatus=t}}parentSetVisible(t){this.visible&&this.changeOverlayVisible(t)}getBox(t){t===void 0&&(t=this.context.config.poi.boxScale);let{width:e,height:n}=this.size,i=e*t,o=n*t,{x:a,y:l}=this.overlay.clientPos;return{left:a-i/2,right:a+i/2,top:this.options.icon?l-o:l-o/2,bottom:this.options.icon?l:l+o/2}}getOriginBox(){return this.getBox(1)}isContain(t,e){if(!this.overlay.visible||!this.visible)return!1;let n=this.getOriginBox();return t>=n.left&&t<=n.right&&e>=n.top&&e<=n.bottom}dispose(){this.unRegistryEvent(),this.div=null,this.textDiv=null,this.img=void 0,this.overlay.dispose(),this.disposed=!0}constructor(t,e){var n,i,o;super(),this.context=t,this.visible=!0,this.size={width:0,height:0},this.position=new G,this.userData={},this.showTextStatus=!0,this.disposed=!1,this._changePosition=()=>{this.overlay.updatePosition(!0)},this.options=$p(Jt({},hbt,e),this),this.position.set(((n=e.position)==null?void 0:n.x)||0,((i=e.position)==null?void 0:i.y)||0,((o=e.position)==null?void 0:o.z)||0),this.overlay=new ff(this.context,{autoUpdate:!1}),this.overlay.addEventListener("update-position",a=>{let{x:l,y:c,height:p}=a;this.overlay.div.style.transform="translate3d(calc("+l+"px - 50%), calc("+(-p+c)+"px - "+(this.options.icon&&this.options.icon_position!=="center"?"100%":"50%")+"), 0)"}),this.overlay.bindElement(this),this.registryEvent(),this.initDiv(),this.addEventListener("change-icon",a=>{let{value:l}=a;l?this.img?this.img.setAttribute("src",l):(this.addIcon(),this._changePosition()):(this.img&&this.div.removeChild(this.img),this.img=void 0,this._changePosition(),this.resetSize())}),this.addEventListener("change-texts",a=>{let{value:l}=a,c=this.textDiv;if(c){let p=this.initText();this.div.replaceChild(p,c)}else this.addText();this.resetSize()}),this.addEventListener("change-opacity",a=>{let{value:l}=a;this.overlay.setOpacity(l)}),this.addEventListener("change-icon_size",a=>{let{value:l}=a;this.img&&(this.img.style.width=""+((l==null?void 0:l[0])||32)+"px",this.img.style.height=""+((l==null?void 0:l[1])||32)+"px",this.resetSize())}),this.addEventListener("change-icon_opacity",a=>{let{value:l}=a;this.img&&(this.img.style.opacity=""+l)}),this.addEventListener("change-icon_border",a=>{let{value:l}=a;this.img&&(this.img.style.border=l.width+"px solid "+l.color)}),this.addEventListener("change-background",a=>{let{value:l}=a;this.div.style.background=l})}};var kte=V(De(),1),Vte=V(n0(),1),Hte=V(r0(),1),Wte=V(i0(),1),qte=V(o0(),1),Xte=V(s0(),1),jte=V(a0(),1),Yte=V(u0(),1);var OY=V(NY(),1);var o_=class extends ye{clearHeatmap(){this.div.firstChild&&this.div.removeChild(this.div.firstChild),this.heatmap=void 0}loadData(t){var e;this.clearHeatmap();let{width:n,height:i,leftTop:o,center:a,scale:l}=this.box,c=((e=this.context.config.heatMap)==null?void 0:e.radius)||1,p=Jt({width:n,height:i,container:this.div},this.context.config.heatMap,{radius:c});this.heatmap=(0,OY.create)(p);let g=this.transformData(t,o,l);t.maxValue!==void 0&&(g.max=t.maxValue),t.minValue!==void 0&&(g.min=t.minValue),this.heatmap.setData(g),this.initPlane(n/l,i/l);let m=this.context.center;this.position.set(a[0]-m[0],a[1]-m[1],this.position.z)}initPlane(t,e){this.plane&&this.remove(this.plane);let n=new qa(t,e),i=new Li(this.div.firstChild);i.needsUpdate=!0;let o=new Wr({transparent:!0,side:vs,map:i});o.needsUpdate=!0,this.plane=new Ne(n,o),this.plane.renderOrder=1e5,this.add(this.plane)}getTransMatrix(t){let{x:e,y:n}=t;return new Qe().makeScale(this.box.scale,-this.box.scale).multiply(new Qe().makeTranslation(-e,-n))}transformData(t,e,n){var i,o;let a=this.getTransMatrix(e);var l;let c=(l=(i=t.data[0])==null?void 0:i.value)!=null?l:0;var p;let g=(p=(o=t.data[0])==null?void 0:o.value)!=null?p:0;return{data:t.data.map(y=>{let x=new ft(y.x,y.y).applyMatrix3(a);return y.value>c&&(c=y.value),y.value<g&&(g=y.value),{x:Math.ceil(x.x),y:Math.ceil(x.y),value:y.value}}),max:c,min:g}}getBox(){let t=this.context.range,e=Wo(t),n=Math.ceil(e[2]-e[0]),i=Math.ceil(e[3]-e[1]),o=4e3,a=4e3,l=o/n,c=a/i,p=Math.min(l,c);this.scaleRatio=p;let g=n*p,m=i*p,y={x:Math.ceil(e[0]),y:Math.ceil(e[3])},x=H0(t).geometry.coordinates;return{width:g,height:m,leftTop:y,center:x,scale:p}}dispose(){this.clearHeatmap(),this.div.remove(),this.div=null,this.plane&&(this.remove(this.plane),wr(this.plane))}constructor(t){super(),this.context=t,this.scaleRatio=1,this.div=document.createElement("div"),this.box=this.getBox()}};var s_=class extends ye{loadModel(){return St(this,null,function*(){let t=yield ws.loadModel(this.options.modelUrl);t.scene.rotation.set(Math.PI/2,Math.PI/2,0),this.add(t.scene),this.model=t})}dispose(){wr(this),this.model=null}constructor(t,e){super(),this.context=t,this.options=e,this.model=null,this.position.copy(e.position||new G(0,0,0)),this.loadModel()}};var cQt=V(De(),1);var wi=class extends ye{setOpacity(t,e){e===void 0&&(e=!1),this.children.forEach(n=>{n.setOpacity==null||n.setOpacity.call(n,t,e)})}dispose(){wr(this),this.children.forEach(t=>t.dispose==null?void 0:t.dispose.call(t)),this.clear()}constructor(t){super(),this.context=t}};var a_=class extends wi{getCenter(){return new Ge().setFromObject(this).getCenter(new G)}createGraphic(t){let e=new wo(this.context,t);return e.userData.data=t,this.add(e),this.graphicMap.set(t.id,e),e}removeGraphic(t){this.remove(t),this.graphicMap.delete(t.options.id),t.dispose()}removeGraphicById(t){this.graphicMap.has(t)&&this.removeGraphic(this.graphicMap.get(t))}getGraphicByNodeId(t){return this.graphicMap.get(t)||null}getGraphicByRaycaster(t){let e={distance:1e4,graphic:null,position:null},n=this.children.reduce((i,o)=>{if(o instanceof wo){let a=o.raycast(t);if(a){let{distance:l}=a;if(l<i.distance)return{distance:a.distance,position:a.position,graphic:o}}return i}else return i},e);return n===e?{graphics:[],position:null}:{graphics:[n.graphic],position:n.position}}setGraphicOptions(t,e){let n,i=this.graphicMap.get(t);i&&(typeof e=="function"?n=e(i.options):n=Jt({},i.options,e),Object.keys(n).forEach(o=>{i.options[o]=n[o]}))}getGraphicPosition(t){let e=this.graphicMap.get(t);return e?[e.options.center_x,e.options.center_y]:null}setOpacity(t,e){e===void 0&&(e=!1),this.graphicMap.forEach(n=>{n.setOpacity(t,e)})}constructor(t){super(t),this.graphicMap=new Map}};var yQt=V(N6(),1),_Qt=V(cn(),1);var DY=V(Ws(),1);var u_=class extends wi{clear(t){return t===void 0&&(t=!1),this.pois.forEach(e=>{e.options.built_in&&!t||e.dispose()}),this.pois=t?[]:this.pois.filter(e=>e.options.built_in),this}createPoi(t){let e=new Fh(this.context,t);return this.pushPoi(e),e.addEventListener("change-level",()=>this.changePoiLevelOrCollisionEnable(e)),e.addEventListener("change-collision_enable",()=>this.changePoiLevelOrCollisionEnable(e)),Promise.resolve().then(()=>{this.debounceCollisionDetection()}),e}changePoiLevelOrCollisionEnable(t){let e=this.pois.findIndex(n=>n===t);e!==-1&&(this.pois.splice(e,1),this.pushPoi(t))}removePoi(t){let e=this.pois.findIndex(n=>n===t);e!==-1&&(this.pois.splice(e,1),t.dispose())}removePoiById(t){let e=this.pois.find(n=>n.options.id===t);e&&this.removePoi(e)}getPoiById(t){return this.pois.find(n=>n.options.id===t)||null}pushPoi(t){if(!t.options.collision_enable){this.pois.unshift(t);return}if(t.options.level===0){this.pois.push(t);return}for(let e=0;e<this.pois.length;e++){let n=this.pois[e];if(n.options.collision_enable&&n.options.level<=t.options.level){this.pois.splice(e,0,t);return}}this.pois.push(t)}getPoiByDeviceXy(t,e){return this.pois.filter(i=>i instanceof Fh&&i.isContain(t,e))}collisionDetection(){let t=[];this.pois.filter(n=>n.visible&&n.withinDisplayRange).forEach((n,i)=>{let{left:o,right:a,top:l,bottom:c}=n.getBox();if(i===0||!n.options.collision_enable){t.push({left:o,right:a,top:l,bottom:c}),n.parentSetVisible(!0);return}let p=t.some(g=>g.left<a&&g.right>o&&g.top<c&&g.bottom>l);n.parentSetVisible(!p),p||t.push({left:o,right:a,top:l,bottom:c})})}registryEvent(){this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate)}dispose(){this.timer.dispose(),this.pois.forEach(t=>t.dispose()),this.pois.length=0,this.debounceCollisionDetection=()=>{},super.dispose(),this.unRegistryEvent()}constructor(t){super(t),this.pois=[],this.timer=new hi,this.onUpdate=()=>{this.timer.requestAnimationFrame(()=>{this.collisionDetection()})},this.registryEvent(),this.debounceCollisionDetection=(0,DY.debounce)(this.collisionDetection,10)}};var bQt=V(cn(),1);var l_=class extends wi{clear(){return this.context.collisionSystem.removeObjects(this.pois),this.pois.forEach(t=>{t.dispose()}),this.pois=[],this}createPoi(t){let e=new Di(this.context,t);return this.pushPoi(e),e}removePoi(t){let e=this.pois.findIndex(n=>n===t);e!==-1&&(this.remove(t),this.pois.splice(e,1),this.context.collisionSystem.removeObject(t),t.dispose())}removePoiById(t){let e=this.pois.find(n=>n.options.id===t);e&&this.removePoi(e)}getPoiById(t){return this.pois.find(n=>n.options.id===t)||null}pushPoi(t){t.parentSetVisible(!1),this.add(t),this.pois.push(t),this.sceneType==="mulFloors"&&(t.options.depth_test=!0),this.active&&this.context.collisionSystem.addObject(t)}getPoiByDeviceXy(t,e){let n=new ft(t,e);return this.pois.filter(o=>o instanceof Di&&o.canSelect&&o.box.containsPoint(n))}setOpacity(t){this.pois.forEach(e=>{e.options.icon_opacity=t,e.options.text_opacity=t})}onAddToScene(t){this.active=!0,this.sceneType=t;let e=t==="mulFloors";this.pois.forEach(n=>{n.options.depth_test=e,this.context.collisionSystem.addObject(n)})}onRemoveFromScene(){this.active=!1,this.context.collisionSystem.removeObjects(this.pois)}dispose(){this.timer.dispose(),this.clear(),super.dispose()}constructor(t){super(t),this.pois=[],this.timer=new hi,this.active=!1,this.sceneType="scene"}};var IQt=V(_a(),1),RQt=V(De(),1);var UY=V(Ws(),1);var c_=class extends wi{createParkings(t,e,n){e===void 0&&(e=!0),this.parkingOptions=t,this.merged=e,e?(n?this.createMergedParkingByMergedElements(n):this.createMergedParking(t),t.map((i,o)=>{var a;(a=i.texts[0])==null||a.split(/[,,]/).map(l=>{this.parkingNoIndexMap.set(l,o)}),this.nodeIdIndexMap.set(i.id,o)})):this.createIndependentParking(t)}load(t,e){e===void 0&&(e=!0);var n;this.createParkings(t.elements,e,t.mergedElements),(n=t.mergedParkingTexture)!=null&&n.length?this.createMergedParkingTexture(t.mergedParkingTexture):this.createParkingTexture(t.elements)}createMergedParking(t){return St(this,null,function*(){let e=new gg(this.context,t);this.mergedParkingSpace=e,this.add(e)})}createMergedParkingByMergedElements(t){let e=new df(this.context,t);if(this.mergedParkingSpace=e,t.lineGeometry){let n=new Gh(this.context,t.lineGeometry);this.add(n)}this.add(e)}createIndependentParking(t){t.forEach(e=>{var n;let i=new wo(this.context,e);this.add(i),(n=e.texts[0])==null||n.split(/[,,]/).map(o=>{this.parkingNoGraphicMap.set(o,i)}),this.graphicMap.set(i.options.id,i)})}createParkingTexture(t){let e=t.filter(n=>I6[n.parkingType]).map(n=>{let i=new ft(...n.geometry.coords[0][0]),o=new ft(...n.geometry.coords[0][1]),a=new ft(...n.geometry.coords[0][2]),l=Math.min(i.distanceTo(o),o.distanceTo(a)),c=0;return l===i.distanceTo(o)?c=o.sub(i).angle()-Math.PI/2:c=a.sub(o).angle()-Math.PI/2,{uuid:n.id,iconUrl:I6[n.parkingType],name:n.texts[0],deltaHeight:(n.deltaHeight||0)+.001,airHeight:n.airHeight,height:n.height,geometry:n.geometry,opacity:n.fillOpacity,visible:!0,secondWidth:l-1,secondHeight:l-1,secondRotate:c,centerCoords:[n.center_coord_x,n.center_coord_y]}});if(e.length){let n=new Bh(this.context,e);this.add(n)}}createMergedParkingTexture(t){t.map(e=>{e.iconUrl=I6[e.iconUrl];let n=new zh(this.context,e);this.add(n)})}changeParkingColor(t){this.merged?Object.keys(t).map(e=>{let n=this.parkingNoIndexMap.get(e);if(!(0,UY.isNil)(n)){var i;(i=this.mergedParkingSpace)==null||i.setColorByIndex(n,t[e])}}):Object.keys(t).map(e=>{let n=this.parkingNoGraphicMap.get(e);n&&(n.options.fillColor=t[e])})}setOpacity(t,e){if(e===void 0&&(e=!1),this.parkingOptions.forEach(i=>{if(e)i.fillOpacity=t,i.strokeOpacity=t;else{let l=this.parkingOriginOptions.get(i.id);var o;i.fillOpacity=Math.min(t,(o=l==null?void 0:l.fillOpacity)!=null?o:1);var a;i.strokeOpacity=Math.min(t,(a=l==null?void 0:l.strokeOpacity)!=null?a:1)}}),this.merged)if(this.mergedParkingSpace instanceof gg)this.mergedParkingSpace.setOpacity(t,e);else{var n;(n=this.mergedParkingSpace)==null||n.setOpacity(t,e)}else this.graphicMap.forEach(i=>{i.setOpacity(t,e)});this.children.filter(i=>i instanceof Bh||i instanceof zh).map(i=>i.setOpacity(t))}getParkingOptionsByParkingNo(t){return this.parkingOptions.find(n=>n.texts[0]===t)||null}getGraphicPosition(t){if(this.merged){let e=this.parkingOptions.find(n=>n.id===t);return e?[e.center_x,e.center_y]:null}}dispose(){var t;(t=this.mergedParkingSpace)==null||t.dispose(),this.mergedParkingSpace=null,wr(this),this.graphicMap.clear(),this.parkingNoGraphicMap.clear(),this.parkingNoIndexMap.clear(),this.nodeIdIndexMap.clear(),this.parkingOptions=[],super.dispose()}constructor(t){super(t),this.graphicMap=new Map,this.parkingNoGraphicMap=new Map,this.parkingOriginOptions=new Map,this.parkingOptions=[],this.merged=!1,this.parkingNoIndexMap=new Map,this.nodeIdIndexMap=new Map,this.mergedParkingSpace=null}};var BQt=V(cn(),1);var h_=class extends wi{addModels(t){let e=t.reduce((n,i)=>{let{url:o}=i;return n[o]?n[o].push(i):n[o]=[i],n},{});Object.values(e).forEach(n=>{let i=new p_(this.context,n);this.add(i)})}constructor(t){super(t)}};var lte=V(De(),1);function FY(r){return`${r.x}-${r.y}-${r.z}`}var Zs=class{static generateLineMaterialKey({color:t,opacity:e}){return`${t}-${e}`}static createLineMaterial({color:t,opacity:e,vertexColors:n}){let i=this.generateLineMaterialKey({color:t,opacity:e,vertexColors:n});if(this.lineMaterialMap.has(i))return this.lineMaterialMap.get(i);let o=new ja({color:new ne(t).convertLinearToSRGB(),transparent:!0,opacity:e,vertexColors:n!=null?n:!1});return this.lineMaterialMap.set(i,o),o}static createMeshStandardMaterial({color:t,opacity:e}){let n=`${t}-${e}`;if(this.meshStandardMaterialMap.has(n))return this.meshStandardMaterialMap.get(n);let i=new ma({color:new ne(t).convertLinearToSRGB(),roughness:1,transparent:!0,opacity:e,depthWrite:!0});return this.meshStandardMaterialMap.set(n,i),i}static createMeshBasicMaterial({color:t,opacity:e,vertexColors:n}){let i=`${t}-${e}-${n}`;if(this.meshBasicMaterialMap.has(i))return this.meshBasicMaterialMap.get(i);let o=new Wr({color:t,transparent:!0,opacity:e,depthWrite:!0,vertexColors:n!=null?n:!1});return this.meshBasicMaterialMap.set(i,o),o}static createShaderMaterial({gradualColor:t,center:e,maxValue:n,opacity:i,direction:o,max:a,min:l}){let c=`${t.toString()}-${FY(e)}-${n}-${i}-${FY(o)}`;if(this.shaderMaterialMap.has(c))return this.shaderMaterialMap.get(c);let p=`
8226
+ `],{type:"text/javascript"}),t=URL.createObjectURL(r),e=new Worker(t);return URL.revokeObjectURL(t),e}var y0=class{static GetMergeGeometry(t){return St(this,null,function*(){let e=yield this.WorkerPool.getWorker(),n=yield oi(e,"get_merged_geometry_attributes",{data:t}),i=this.GetBufferGeometryByData(n);return this.WorkerPool.releaseWorker(e),i})}static GetMergedShapeGeometry(t){return St(this,null,function*(){let e=yield this.WorkerPool.getWorker(),n=yield oi(e,"get_merged_shape_geometry_attributes",{data:t}),i=this.GetBufferGeometryByData(n);return this.WorkerPool.releaseWorker(e),i})}static GetMergedTexture2dGeometry(t){return St(this,null,function*(){let e=yield this.WorkerPool.getWorker(),n=yield oi(e,"get_merged_texture2d_shape_geometry_attributes",{data:t}),i=this.GetBufferGeometryByData(n);return this.WorkerPool.releaseWorker(e),i})}static GetBufferGeometryByData(t){let e=new Xe;return Object.keys(t.attributes).forEach(n=>{e.setAttribute(n,new We(t.attributes[n].array,t.attributes[n].itemSize))}),t.index&&e.setIndex(new We(t.index.array,t.index.itemSize)),e.morphAttributes=t.morphAttributes,e.morphTargetsRelative=t.morphTargetsRelative,e.groups=t.groups,e.boundingSphere=t.boundingSphere,e}static GetMergedGeometry(t){return St(this,null,function*(){let e=yield this.WorkerPool.getWorker(),n=yield oi(e,"get_merged_geometries_json",{data:t});return this.WorkerPool.releaseWorker(e),n?Jt({},t[0],n):null})}static GetMergedGeometryLine(t){return St(this,null,function*(){let e=yield this.WorkerPool.getWorker(),n=yield oi(e,"get_merged_geometries_line_json",{data:t});return this.WorkerPool.releaseWorker(e),n?Jt({},t[0],n):null})}static dispose(){this.WorkerPool.dispose()}};y0.WorkerPool=new Oy(10,RI);var RY=V(Ws(),1),vl={id:"",height:.1,airHeight:0,area:0,group:"",fillColor:"#EFF4FB",strokeColor:"#ffffff",fillOpacity:1,strokeOpacity:1,strokeWidth:1,doors:[],visible:!0,geometry:{type:"polygon",cds:[],coords:[],curveCpt:[],curveIndex:[]},layerType:"",zIndex:0,stroke:!0,deltaHeight:0,userData:{},gradualColor:[],renderType:"single",colorFactor:.9,center_x:0,center_y:0,center_coord_x:0,center_coord_y:0,dashed:!1},wo=class extends ye{getCenter(){if(this.options.geometry.type==="point")return this.position.clone();let t=new G,e=new Ge;return e.setFromObject(this),e.getCenter(t),t}getSize(){if(this.options.geometry.type==="point")return new G(0,0,0);let t=new Ge,e=new G;return t.setFromObject(this),t.getSize(e),e}getPosition(){let{center_coord_x:t,center_coord_y:e}=this.options,n=this.getCenter();return n.setZ(n.z+this.options.height/2),new G(t,e,n.z+this.options.height/2)}init(){this.geometry=this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options.airHeight+this.options.deltaHeight,this.options.stroke&&this.options.strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())}initDoor(){var t;if((t=this.options.doors)!=null&&t.length&&this.options.geometry.type==="polygon"){let e=this.options.geometry.coords[0];this.options.doors.forEach(n=>{let i=n.type==="single"?.5:1,o=.5,a=Z0(e,n.coord),l=new ft(...n.coord),c=new ft(...e[a]).sub(new ft(...n.coord)).normalize(),p=new ft().addVectors(l,c.clone().multiplyScalar(i)),g=new ft().addVectors(l,c.clone().multiplyScalar(-i)),m=new ft(-c.y,c.x),y=new ft().addVectors(p,m.clone().multiplyScalar(o));vT([y.x,y.y],e)||(m.multiplyScalar(-1),y=new ft().addVectors(p,m.clone().multiplyScalar(o)));let x=new ft().addVectors(g,m.clone().multiplyScalar(o)),S=[[p.x,p.y],[y.x,y.y],[x.x,x.y],[g.x,g.y]];e=this.options.geometry.coords[0]=[...e.slice(0,a+1),...S,...e.slice(a+1)]})}}initGeometry(){let t=$m(this.options.geometry.coords[0],this.options.geometry.coords.slice(1));return new Ap(t,{steps:1,bevelEnabled:!1,depth:this.options.height,curveSegments:4})}initSingleMaterial(){let t=rn.createMeshBasicMaterial({color:this.options.fillColor,opacity:this.options.fillOpacity});if(this.options.secondUrl&&Mo.getTextureByUrl(this.options.secondUrl).then(n=>{n.wrapS=Gs,n.wrapT=Gs,n.needsUpdate=!0,t.map=n,t.side=Xi}),this.options.height<=.1)return this.material=t,t;let e=rn.createMeshBasicMaterial({color:K0(this.options.fillColor),opacity:this.options.fillOpacity});return this.material=[t,e],[t,e]}getMaxAndMin(t,e){let n=new Ge().setFromObject(this),i=t.clone().add(e.clone().multiplyScalar(1e3)),o=new da(i,e.clone().multiplyScalar(-1)),a=new G;o.intersectBox(n,a);let l=t.clone().add(e.clone().multiplyScalar(-1e3)),c=new da(l,e.clone()),p=new G;return c.intersectBox(n,p),{max:p,min:a}}initGradualMaterial(){let{max:t,min:e}=new Ge().setFromObject(this),n=t.clone().sub(e),i=Math.max(n.x,n.y,n.z)/2,o=this.getPosition(),a=new G(-1,.2,0).normalize(),{max:l,min:c}=this.getMaxAndMin(o,a),p=rn.createShaderMaterial({gradualColor:this.options.gradualColor,center:this.getPosition(),maxValue:i,opacity:this.options.fillOpacity,direction:new G(-1,.2,0),max:l,min:c});if(this.options.height<=.1)return this.material=p,p;let g=this.getCenter(),m=new G(-1,.2,1).normalize(),{max:y,min:x}=this.getMaxAndMin(g,m),S=rn.createShaderMaterial({gradualColor:[K0(this.options.gradualColor[0],this.options.colorFactor),K0(this.options.gradualColor[1],this.options.colorFactor)],center:this.getCenter(),maxValue:i,opacity:this.options.fillOpacity,direction:new G(-1,.2,1),max:y,min:x});return this.material=[p,S],[p,S]}initMaterial(){return this.options.renderType==="gradual"?this.initGradualMaterial():this.initSingleMaterial()}initLineMaterial(){if(this.options.dashed){let t=rn.createLineDashedMaterial({color:this.options.strokeColor,opacity:this.options.strokeOpacity});return this.lineMaterial=t,t}else{let t=rn.createLineMaterial({color:this.options.strokeColor,opacity:this.options.strokeOpacity});return this.lineMaterial=t,t}}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new Ne(this.geometry,this.material),this.add(this.mesh)}getBorderPoints(){let t=[],e=this.options.height+this.options.deltaHeight,{coords:n}=this.options.geometry;for(let i=0;i<n.length;i++){let o=n[i];for(let a=0;a<o.length;a++){let l=o[a],c=a+1===o.length?o[0]:o[a+1];t.push(new G(l[0],l[1],e)),t.push(new G(c[0],c[1],e))}}return t}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.getBorderPoints(),e=new Xe().setFromPoints(t);this.lineGeometry=e}createBorder(){this.line&&this.remove(this.line);let t=new Yi(this.lineGeometry,this.lineMaterial);return t.position.z=this.options.airHeight+.01,this.options.dashed&&t.computeLineDistances(),this.line=t,this.add(t),t}setOpacity(t,e){if(e===void 0&&(e=!1),e)this.options.fillOpacity=t,this.options.strokeOpacity=t;else{let{fillOpacity:n,strokeOpacity:i}=this.originOptions;this.options.fillOpacity=Math.min(n,t),this.options.strokeOpacity=Math.min(i,t)}}raycast(t){if(!this.visible||this.options.geometry.type==="point")return!1;this.mesh.updateMatrixWorld(!0);let e=t.intersectObject(this.mesh);if(e[0]){let{point:n,distance:i}=e[0];return{position:n,distance:i}}return!1}dispose(){var t,e;(t=this.geometry)==null||t.dispose(),(e=this.line)==null||e.geometry.dispose(),this.clear()}constructor(t,e){if(super(),this.context=t,this.line=null,this.options=$p((0,RY.cloneDeep)(Jt({},vl,e)),this),this.originOptions={fillOpacity:this.options.fillOpacity,strokeOpacity:this.options.strokeOpacity},this.options.geometry.type==="point"){let[n,i]=this.options.geometry.coords;return this.position.set(n,i,this.options.height+this.options.airHeight),this}this.initDoor(),this.init(),this.visible=this.options.visible,this.addEventListener("change-fillColor",n=>{let{value:i}=n;this.initMaterial(),this.initMesh()}),this.addEventListener("change-fillOpacity",n=>{let{value:i}=n;this.initMaterial(),this.initMesh()}),this.addEventListener("change-height",n=>{let{value:i}=n;this.dispose(),this.init()}),this.addEventListener("change-strokeColor",n=>{let{value:i}=n;!this.options.stroke||!this.options.strokeOpacity||(this.initLineMaterial(),this.createBorder())}),this.addEventListener("change-strokeOpacity",n=>{let{value:i}=n;if(this.options.stroke)if(i)this.lineGeometry||this.initLineGeometry(),this.initLineMaterial(),this.createBorder();else{var o;this.line&&(this.remove(this.line),this.line=null),(o=this.lineGeometry)==null||o.dispose(),this.lineGeometry=void 0}}),this.addEventListener("change-airHeight",n=>{let{value:i}=n;this.position.z=i}),this.addEventListener("change-visible",n=>{let{value:i}=n;this.visible=i}),this.addEventListener("change-stroke",n=>{let{value:i}=n;if(i){if(this.line)return;this.initLineGeometry(),this.initLineMaterial(),this.createBorder()}else if(this.line){var o;this.remove(this.line),(o=this.lineGeometry)==null||o.dispose()}}),this.addEventListener("change-dashed",()=>{!this.options.stroke||!this.options.strokeOpacity||(this.lineGeometry||this.initLineGeometry(),this.initLineMaterial(),this.createBorder())}),this.addEventListener("change-renderType",()=>{this.initMaterial(),this.initMesh()}),this.addEventListener("change-gradualColor",()=>{this.initMaterial(),this.initMesh()})}};var i_=class extends ye{initLight(){let t=gM(16777215,.5);return t.position.set(0,0,100),this.add(t),t}changeLightCamera(t){let e=t.x,n=t.y;this.directionalLight.shadow.camera.left=-e,this.directionalLight.shadow.camera.right=e,this.directionalLight.shadow.camera.top=n,this.directionalLight.shadow.camera.bottom=-n,this.directionalLight.shadow.camera.near=.5,this.directionalLight.shadow.camera.far=Math.max(e,n)}changeLightColor(t){this.directionalLight.color=new ne(t)}setPosition(t){this.position.copy(t),this.directionalLight.position.set(-t.x/2,-t.y/2,100)}initPlane(t,e){t===void 0&&(t=1e3),e===void 0&&(e=1e3);let n=new qa(t,e),i=new Hm({transparent:!0,opacity:0,side:Xi}),o=new Ne(n,i);return o.receiveShadow=!0,o.position.z=-10,this.add(o),this.plane=o,o}setTarget(t){this.directionalLight.target=t}transformOpacity(t){return t*this.basicOpacity}setOpacity(t){this.plane.material.opacity=this.transformOpacity(t)}dispose(){wr(this,!0)}constructor(){super(),this.basicOpacity=.07,this.directionalLight=this.initLight(),this.initPlane()}};var WJt=V(De(),1);var PY=V(Ws(),1);var cbt={autoUpdate:!0,appendToBody:!1,autoChangePlacement:!1},ff=class extends Zi{initObserver(){let t=new MutationObserver((0,PY.debounce)(()=>{this.div&&this.usePlacement()},100));t.observe(this.div,{childList:!0,subtree:!0,attributes:!0}),this.observer=t}getPlacementPosition(){var t,e;if(this.element instanceof wo&&this.element.options.geometry.type==="polygon"){let{max:a,min:l}=new Ge().setFromObject(this.element),c=(a.x+l.x)/2,p=(a.y+l.y)/2;return{left:new G(l.x,p,a.z),leftTop:new G(l.x,a.y,a.z),top:new G(c,a.y,a.z),rightTop:new G(a.x,a.y,a.z),right:new G(a.x,p,a.z),rightBottom:new G(a.x,l.y,a.z),bottom:new G(c,l.y,a.z),leftBottom:new G(l.x,l.y,a.z),center:new G(c,p,a.z)}}let{x:n,y:i,z:o}=((e=this.element)==null||(t=e.getPosition)==null?void 0:t.call(e))||this.position;return{left:new G(n,i,o),leftTop:new G(n,i,o),top:new G(n,i,o),rightTop:new G(n,i,o),right:new G(n,i,o),rightBottom:new G(n,i,o),bottom:new G(n,i,o),leftBottom:new G(n,i,o),center:new G(n,i,o)}}getPlacementScreenPosition(){let{width:t,height:e}=this.context.clientSize,n=this.getPlacementPosition();return Object.keys(n).reduce((i,o)=>{let{x:a,y:l}=bn(n[o],this.context.camera,t,e);return i[o]={x:a,y:l},i},{})}checkOverflow(t,e){let{width:n,height:i}=this.context.clientSize;return e.x>0&&t.x<n&&e.y<i&&t.y>0}getPlacement(){let{clientWidth:t,clientHeight:e}=this.div,n=this.getPlacementScreenPosition(),i=t/2,o=e/2,a=[{type:"center",getBox(l,c){return{max:{x:i+l,y:c-e},min:{x:l-i,y:c}}}},{type:"left",getBox(l,c){return{max:{x:l,y:c-o},min:{x:l-t,y:c+o}}}},{type:"leftTop",getBox(l,c){return{max:{x:l,y:c-e},min:{x:l-t,y:c}}}},{type:"top",getBox(l,c){return{max:{x:l+i,y:c-e},min:{x:l-i,y:c}}}},{type:"rightTop",getBox(l,c){return{max:{x:l+t,y:c-e},min:{x:l,y:c}}}},{type:"right",getBox(l,c){return{max:{x:l+t,y:c-o},min:{x:l,y:c+o}}}},{type:"rightBottom",getBox(l,c){return{max:{x:l+t,y:c},min:{x:l,y:c+e}}}},{type:"bottom",getBox(l,c){return{max:{x:l+i,y:c},min:{x:l-i,y:c+e}}}},{type:"leftBottom",getBox(l,c){return{max:{x:l,y:c},min:{x:l-t,y:c+o}}}}];for(let l=0;l<a.length;l++){let c=a[l],p=n[c.type],{max:g,min:m}=c.getBox(p.x,p.y);if(this.checkOverflow(g,m))return{type:c.type,position:p}}return{type:"center",position:n.center}}initDiv(){let t=document.createElement("div");return t.style.position="absolute",t}usePlacement(){let t=this.getPlacement();this.div.className="overlay_"+t.type,this._updatePosition(t.position.x,t.position.y)}bindElement(t){this.element=t,this.options.autoChangePlacement&&this.initObserver(),this.onUpdate()}unBindElement(){this.element=void 0}setVisible(t,e){e===void 0&&(e="block"),t!==this.visible&&(this.div.style.display=t?e:"none",this.visible=t)}setOpacity(t){this.div.style.opacity=""+t}getPosition(){return this.element?typeof this.element.getPosition=="function"?this.element.getPosition():new Ge().setFromObject(this.element).getCenter(new G):this.position}get withinDisplayRange(){let{x:t,y:e}=this.clientPos,{width:n,height:i}=this.context.clientSize;return t>=0&&t<=n&&e>=0&&e<=i}_updatePosition(t,e){this.clientPos={x:t,y:e};let{width:n,height:i,x:o,y:a}=this.context.clientSize;if(this.div){if(this.options.appendToBody){this.div.style.left=""+o+"px",this.div.style.top=""+(a+i)+"px";return}this.options.autoUpdate?(this.div.style.left=""+t+"px",this.div.style.bottom=""+(i-e)+"px"):this.dispatchEvent({type:"update-position",x:t,y:e,width:n,height:i})}}updatePosition(t){t===void 0&&(t=!1);let e=this.getPosition(),{width:n,height:i}=this.context.clientSize,{x:o,y:a}=bn(e,this.context.camera,n,i);this.clientPos.x===o&&this.clientPos.y===a&&!t||this._updatePosition(o,a)}registryEvent(){this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate)}dispose(){var t,e;super.dispose(),this.unRegistryEvent(),this.unBindElement(),(t=this.observer)==null||t.disconnect(),(e=this.div)==null||e.remove(),this.div=null}constructor(t,e={}){super(),this.context=t,this.position=new G,this.clientPos={x:0,y:0},this.visible=!0,this.placement="top",this.observer=null,this.onUpdate=()=>{this.options.autoChangePlacement?this.usePlacement():this.updatePosition()},this.options=Jt({},cbt,e),this.registryEvent(),this.div=this.initDiv(),this.options.appendToBody?document.body.appendChild(this.div):this.context.container.appendChild(this.div)}};var hbt={texts:[{text:""}],level:1,icon_position:"bottom",collision_enable:!0,opacity:1,id:"",position:{x:0,y:0,z:0},icon_opacity:1,icon_border:{color:"#586EE0",width:0},background:"",collision_hide_icon:!0,built_in:!1,box_only_icon:!1},Fh=class extends En{get withinDisplayRange(){return this.overlay.withinDisplayRange}resetSize(){return St(this,null,function*(){if(yield bT(),!this.disposed)if(this.options.box_only_icon){if(!this.img)return;let{width:t,height:e}=this.img.getBoundingClientRect();this.size={width:t+2,height:e+2}}else{let{width:t,height:e}=this.div.getBoundingClientRect();this.size={width:t+2,height:e+2}}})}renderHelperBox(){}get clientPos(){return this.overlay.clientPos}initDiv(){let t=document.createElement("div");return this.div=t,this.addText(),this.options.icon&&this.addIcon(),t.style.fontSize="12px",t.style.textShadow="#fff 1px 0 0, #fff 0 1px 0, #fff -1px 0 0, #fff 0 -1px 0",t.style.display="flex",t.style.flexDirection="column",t.style.justifyContent="center",t.style.alignItems="center",t.style.padding="4px",this.overlay.setOpacity(this.options.opacity),this.overlay.div.style.pointerEvents="none",this.overlay.div.style.userSelect="none",this.overlay.div.appendChild(t),this.resetSize(),t}addIcon(){if(!this.img){let t=this.initIcon();this.options.icon_position==="top"?this.div.firstChild?this.div.insertBefore(t,this.div.firstChild):this.div.appendChild(t):this.div.appendChild(t)}}addText(){let t=this.initText();this.options.icon_position==="top"?this.div.appendChild(t):this.div.firstChild?this.div.insertBefore(t,this.div.firstChild):this.div.appendChild(t)}getPosition(){return this.position}initText(){let t=document.createElement("div");return t.appendChild(this.createTextFragment()),t.style.textAlign="center",this.textDiv=t,t}createTextFragment(){let t=document.createDocumentFragment();return this.options.texts.forEach(e=>{let n=document.createElement("div");if(n.style.whiteSpace="nowrap",e.styles)for(let[i,o]of Object.entries(e.styles))n.style[i]=o;n.textContent=e.text,t.appendChild(n)}),t}initIcon(){var t,e;let n=document.createElement("img");return n.setAttribute("src",this.options.icon),n.style.width=""+(((t=this.options.icon_size)==null?void 0:t[0])||32)+"px",n.style.height=""+(((e=this.options.icon_size)==null?void 0:e[1])||32)+"px",n.style.opacity=""+this.options.icon_opacity+"px",n.style.borderRadius="50%",this.options.icon_border.width&&(n.style.border=this.options.icon_border.width+"px solid "+this.options.icon_border.color),n.onload=()=>{this.resetSize()},this.img=n,n}registryEvent(){}unRegistryEvent(){}setVisible(t){t!==this.visible&&(this.visible=t,this.changeOverlayVisible(t))}changeOverlayVisible(t){if(!(t===this.overlay.visible&&this.options.collision_hide_icon))if(this.options.collision_hide_icon)this.overlay.visible=t,this.overlay.div.style.visibility=t?"visible":"hidden";else{if(this.showTextStatus===t)return;this.textDiv.style.visibility=t?"visible":"hidden",this.showTextStatus=t}}parentSetVisible(t){this.visible&&this.changeOverlayVisible(t)}getBox(t){t===void 0&&(t=this.context.config.poi.boxScale);let{width:e,height:n}=this.size,i=e*t,o=n*t,{x:a,y:l}=this.overlay.clientPos;return{left:a-i/2,right:a+i/2,top:this.options.icon?l-o:l-o/2,bottom:this.options.icon?l:l+o/2}}getOriginBox(){return this.getBox(1)}isContain(t,e){if(!this.overlay.visible||!this.visible)return!1;let n=this.getOriginBox();return t>=n.left&&t<=n.right&&e>=n.top&&e<=n.bottom}dispose(){this.unRegistryEvent(),this.div=null,this.textDiv=null,this.img=void 0,this.overlay.dispose(),this.disposed=!0}constructor(t,e){var n,i,o;super(),this.context=t,this.visible=!0,this.size={width:0,height:0},this.position=new G,this.userData={},this.showTextStatus=!0,this.disposed=!1,this._changePosition=()=>{this.overlay.updatePosition(!0)},this.options=$p(Jt({},hbt,e),this),this.position.set(((n=e.position)==null?void 0:n.x)||0,((i=e.position)==null?void 0:i.y)||0,((o=e.position)==null?void 0:o.z)||0),this.overlay=new ff(this.context,{autoUpdate:!1}),this.overlay.addEventListener("update-position",a=>{let{x:l,y:c,height:p}=a;this.overlay.div.style.transform="translate3d(calc("+l+"px - 50%), calc("+(-p+c)+"px - "+(this.options.icon&&this.options.icon_position!=="center"?"100%":"50%")+"), 0)"}),this.overlay.bindElement(this),this.registryEvent(),this.initDiv(),this.addEventListener("change-icon",a=>{let{value:l}=a;l?this.img?this.img.setAttribute("src",l):(this.addIcon(),this._changePosition()):(this.img&&this.div.removeChild(this.img),this.img=void 0,this._changePosition(),this.resetSize())}),this.addEventListener("change-texts",a=>{let{value:l}=a,c=this.textDiv;if(c){let p=this.initText();this.div.replaceChild(p,c)}else this.addText();this.resetSize()}),this.addEventListener("change-opacity",a=>{let{value:l}=a;this.overlay.setOpacity(l)}),this.addEventListener("change-icon_size",a=>{let{value:l}=a;this.img&&(this.img.style.width=""+((l==null?void 0:l[0])||32)+"px",this.img.style.height=""+((l==null?void 0:l[1])||32)+"px",this.resetSize())}),this.addEventListener("change-icon_opacity",a=>{let{value:l}=a;this.img&&(this.img.style.opacity=""+l)}),this.addEventListener("change-icon_border",a=>{let{value:l}=a;this.img&&(this.img.style.border=l.width+"px solid "+l.color)}),this.addEventListener("change-background",a=>{let{value:l}=a;this.div.style.background=l})}};var kte=V(De(),1),Vte=V(n0(),1),Hte=V(r0(),1),Wte=V(i0(),1),qte=V(o0(),1),Xte=V(s0(),1),jte=V(a0(),1),Yte=V(u0(),1);var OY=V(NY(),1);var o_=class extends ye{clearHeatmap(){this.div.firstChild&&this.div.removeChild(this.div.firstChild),this.heatmap=void 0}loadData(t){var e;this.clearHeatmap();let{width:n,height:i,leftTop:o,center:a,scale:l}=this.box,c=((e=this.context.config.heatMap)==null?void 0:e.radius)||1,p=Jt({width:n,height:i,container:this.div},this.context.config.heatMap,{radius:c});this.heatmap=(0,OY.create)(p);let g=this.transformData(t,o,l);t.maxValue!==void 0&&(g.max=t.maxValue),t.minValue!==void 0&&(g.min=t.minValue),this.heatmap.setData(g),this.initPlane(n/l,i/l);let m=this.context.center;this.position.set(a[0]-m[0],a[1]-m[1],this.position.z)}initPlane(t,e){this.plane&&this.remove(this.plane);let n=new qa(t,e),i=new Li(this.div.firstChild);i.needsUpdate=!0;let o=new Wr({transparent:!0,side:vs,map:i});o.needsUpdate=!0,this.plane=new Ne(n,o),this.plane.renderOrder=1e5,this.add(this.plane)}getTransMatrix(t){let{x:e,y:n}=t;return new Qe().makeScale(this.box.scale,-this.box.scale).multiply(new Qe().makeTranslation(-e,-n))}transformData(t,e,n){var i,o;let a=this.getTransMatrix(e);var l;let c=(l=(i=t.data[0])==null?void 0:i.value)!=null?l:0;var p;let g=(p=(o=t.data[0])==null?void 0:o.value)!=null?p:0;return{data:t.data.map(y=>{let x=new ft(y.x,y.y).applyMatrix3(a);return y.value>c&&(c=y.value),y.value<g&&(g=y.value),{x:Math.ceil(x.x),y:Math.ceil(x.y),value:y.value}}),max:c,min:g}}getBox(){let t=this.context.range,e=Wo(t),n=Math.ceil(e[2]-e[0]),i=Math.ceil(e[3]-e[1]),o=4e3,a=4e3,l=o/n,c=a/i,p=Math.min(l,c);this.scaleRatio=p;let g=n*p,m=i*p,y={x:Math.ceil(e[0]),y:Math.ceil(e[3])},x=H0(t).geometry.coordinates;return{width:g,height:m,leftTop:y,center:x,scale:p}}dispose(){this.clearHeatmap(),this.div.remove(),this.div=null,this.plane&&(this.remove(this.plane),wr(this.plane))}constructor(t){super(),this.context=t,this.scaleRatio=1,this.div=document.createElement("div"),this.box=this.getBox()}};var s_=class extends ye{loadModel(){return St(this,null,function*(){let t=yield ws.loadModel(this.options.modelUrl);t.scene.rotation.set(Math.PI/2,Math.PI/2,0),this.add(t.scene),this.model=t})}dispose(){wr(this),this.model=null}constructor(t,e){super(),this.context=t,this.options=e,this.model=null,this.position.copy(e.position||new G(0,0,0)),this.loadModel()}};var cQt=V(De(),1);var wi=class extends ye{setOpacity(t,e){e===void 0&&(e=!1),this.children.forEach(n=>{n.setOpacity==null||n.setOpacity.call(n,t,e)})}dispose(){wr(this),this.children.forEach(t=>t.dispose==null?void 0:t.dispose.call(t)),this.clear()}constructor(t){super(),this.context=t}};var a_=class extends wi{getCenter(){return new Ge().setFromObject(this).getCenter(new G)}createGraphic(t){let e=new wo(this.context,t);return e.userData.data=t,this.add(e),this.graphicMap.set(t.id,e),e}removeGraphic(t){this.remove(t),this.graphicMap.delete(t.options.id),t.dispose()}removeGraphicById(t){this.graphicMap.has(t)&&this.removeGraphic(this.graphicMap.get(t))}getGraphicByNodeId(t){return this.graphicMap.get(t)||null}getGraphicByRaycaster(t){let e={distance:1e4,graphic:null,position:null},n=this.children.reduce((i,o)=>{if(o instanceof wo){let a=o.raycast(t);if(a){let{distance:l}=a;if(l<i.distance)return{distance:a.distance,position:a.position,graphic:o}}return i}else return i},e);return n===e?{graphics:[],position:null}:{graphics:[n.graphic],position:n.position}}setGraphicOptions(t,e){let n,i=this.graphicMap.get(t);i&&(typeof e=="function"?n=e(i.options):n=Jt({},i.options,e),Object.keys(n).forEach(o=>{i.options[o]=n[o]}))}getGraphicPosition(t){let e=this.graphicMap.get(t);return e?[e.options.center_x,e.options.center_y]:null}setOpacity(t,e){e===void 0&&(e=!1),this.graphicMap.forEach(n=>{n.setOpacity(t,e)})}constructor(t){super(t),this.graphicMap=new Map}};var yQt=V(N6(),1),_Qt=V(cn(),1);var DY=V(Ws(),1);var u_=class extends wi{clear(t){return t===void 0&&(t=!1),this.pois.forEach(e=>{e.options.built_in&&!t||e.dispose()}),this.pois=t?[]:this.pois.filter(e=>e.options.built_in),this}createPoi(t){let e=new Fh(this.context,t);return this.pushPoi(e),e.addEventListener("change-level",()=>this.changePoiLevelOrCollisionEnable(e)),e.addEventListener("change-collision_enable",()=>this.changePoiLevelOrCollisionEnable(e)),Promise.resolve().then(()=>{this.debounceCollisionDetection()}),e}changePoiLevelOrCollisionEnable(t){let e=this.pois.findIndex(n=>n===t);e!==-1&&(this.pois.splice(e,1),this.pushPoi(t))}removePoi(t){let e=this.pois.findIndex(n=>n===t);e!==-1&&(this.pois.splice(e,1),t.dispose())}removePoiById(t){let e=this.pois.find(n=>n.options.id===t);e&&this.removePoi(e)}getPoiById(t){return this.pois.find(n=>n.options.id===t)||null}pushPoi(t){if(!t.options.collision_enable){this.pois.unshift(t);return}if(t.options.level===0){this.pois.push(t);return}for(let e=0;e<this.pois.length;e++){let n=this.pois[e];if(n.options.collision_enable&&n.options.level<=t.options.level){this.pois.splice(e,0,t);return}}this.pois.push(t)}getPoiByDeviceXy(t,e){return this.pois.filter(i=>i instanceof Fh&&i.isContain(t,e))}collisionDetection(){let t=[];this.pois.filter(n=>n.visible&&n.withinDisplayRange).forEach((n,i)=>{let{left:o,right:a,top:l,bottom:c}=n.getBox();if(i===0||!n.options.collision_enable){t.push({left:o,right:a,top:l,bottom:c}),n.parentSetVisible(!0);return}let p=t.some(g=>g.left<a&&g.right>o&&g.top<c&&g.bottom>l);n.parentSetVisible(!p),p||t.push({left:o,right:a,top:l,bottom:c})})}registryEvent(){this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate)}dispose(){this.timer.dispose(),this.pois.forEach(t=>t.dispose()),this.pois.length=0,this.debounceCollisionDetection=()=>{},super.dispose(),this.unRegistryEvent()}constructor(t){super(t),this.pois=[],this.timer=new hi,this.onUpdate=()=>{this.timer.requestAnimationFrame(()=>{this.collisionDetection()})},this.registryEvent(),this.debounceCollisionDetection=(0,DY.debounce)(this.collisionDetection,10)}};var bQt=V(cn(),1);var l_=class extends wi{clear(t){return t===void 0&&(t=!1),this.context.collisionSystem.removeObjects(this.pois,t),this.pois.forEach(e=>{e.dispose()}),this.pois=[],this}createPoi(t){let e=new Di(this.context,t);return this.pushPoi(e),e}removePoi(t){let e=this.pois.findIndex(n=>n===t);e!==-1&&(this.remove(t),this.pois.splice(e,1),this.context.collisionSystem.removeObject(t),t.dispose())}removePoiById(t){let e=this.pois.find(n=>n.options.id===t);e&&this.removePoi(e)}getPoiById(t){return this.pois.find(n=>n.options.id===t)||null}pushPoi(t){t.parentSetVisible(!1),this.add(t),this.pois.push(t),this.sceneType==="mulFloors"&&(t.options.depth_test=!0),this.active&&this.context.collisionSystem.addObject(t)}getPoiByDeviceXy(t,e){let n=new ft(t,e);return this.pois.filter(o=>o instanceof Di&&o.canSelect&&o.box.containsPoint(n))}setOpacity(t){this.pois.forEach(e=>{e.options.icon_opacity=t,e.options.text_opacity=t})}onAddToScene(t){this.active=!0,this.sceneType=t;let e=t==="mulFloors";this.pois.forEach(n=>{n.options.depth_test=e,this.context.collisionSystem.addObject(n)})}onRemoveFromScene(){this.active=!1,this.context.collisionSystem.removeObjects(this.pois)}dispose(){this.timer.dispose(),this.clear(!0),super.dispose()}constructor(t){super(t),this.pois=[],this.timer=new hi,this.active=!1,this.sceneType="scene"}};var IQt=V(_a(),1),RQt=V(De(),1);var UY=V(Ws(),1);var c_=class extends wi{createParkings(t,e,n){e===void 0&&(e=!0),this.parkingOptions=t,this.merged=e,e?(n?this.createMergedParkingByMergedElements(n):this.createMergedParking(t),t.map((i,o)=>{var a;(a=i.texts[0])==null||a.split(/[,,]/).map(l=>{this.parkingNoIndexMap.set(l,o)}),this.nodeIdIndexMap.set(i.id,o)})):this.createIndependentParking(t)}load(t,e){e===void 0&&(e=!0);var n;this.createParkings(t.elements,e,t.mergedElements),(n=t.mergedParkingTexture)!=null&&n.length?this.createMergedParkingTexture(t.mergedParkingTexture):this.createParkingTexture(t.elements)}createMergedParking(t){return St(this,null,function*(){let e=new gg(this.context,t);this.mergedParkingSpace=e,this.add(e)})}createMergedParkingByMergedElements(t){let e=new df(this.context,t);if(this.mergedParkingSpace=e,t.lineGeometry){let n=new Gh(this.context,t.lineGeometry);this.add(n)}this.add(e)}createIndependentParking(t){t.forEach(e=>{var n;let i=new wo(this.context,e);this.add(i),(n=e.texts[0])==null||n.split(/[,,]/).map(o=>{this.parkingNoGraphicMap.set(o,i)}),this.graphicMap.set(i.options.id,i)})}createParkingTexture(t){let e=t.filter(n=>I6[n.parkingType]).map(n=>{let i=new ft(...n.geometry.coords[0][0]),o=new ft(...n.geometry.coords[0][1]),a=new ft(...n.geometry.coords[0][2]),l=Math.min(i.distanceTo(o),o.distanceTo(a)),c=0;return l===i.distanceTo(o)?c=o.sub(i).angle()-Math.PI/2:c=a.sub(o).angle()-Math.PI/2,{uuid:n.id,iconUrl:I6[n.parkingType],name:n.texts[0],deltaHeight:(n.deltaHeight||0)+.001,airHeight:n.airHeight,height:n.height,geometry:n.geometry,opacity:n.fillOpacity,visible:!0,secondWidth:l-1,secondHeight:l-1,secondRotate:c,centerCoords:[n.center_coord_x,n.center_coord_y]}});if(e.length){let n=new Bh(this.context,e);this.add(n)}}createMergedParkingTexture(t){t.map(e=>{e.iconUrl=I6[e.iconUrl];let n=new zh(this.context,e);this.add(n)})}changeParkingColor(t){this.merged?Object.keys(t).map(e=>{let n=this.parkingNoIndexMap.get(e);if(!(0,UY.isNil)(n)){var i;(i=this.mergedParkingSpace)==null||i.setColorByIndex(n,t[e])}}):Object.keys(t).map(e=>{let n=this.parkingNoGraphicMap.get(e);n&&(n.options.fillColor=t[e])})}setOpacity(t,e){if(e===void 0&&(e=!1),this.parkingOptions.forEach(i=>{if(e)i.fillOpacity=t,i.strokeOpacity=t;else{let l=this.parkingOriginOptions.get(i.id);var o;i.fillOpacity=Math.min(t,(o=l==null?void 0:l.fillOpacity)!=null?o:1);var a;i.strokeOpacity=Math.min(t,(a=l==null?void 0:l.strokeOpacity)!=null?a:1)}}),this.merged)if(this.mergedParkingSpace instanceof gg)this.mergedParkingSpace.setOpacity(t,e);else{var n;(n=this.mergedParkingSpace)==null||n.setOpacity(t,e)}else this.graphicMap.forEach(i=>{i.setOpacity(t,e)});this.children.filter(i=>i instanceof Bh||i instanceof zh).map(i=>i.setOpacity(t))}getParkingOptionsByParkingNo(t){return this.parkingOptions.find(n=>n.texts[0]===t)||null}getGraphicPosition(t){if(this.merged){let e=this.parkingOptions.find(n=>n.id===t);return e?[e.center_x,e.center_y]:null}}dispose(){var t;(t=this.mergedParkingSpace)==null||t.dispose(),this.mergedParkingSpace=null,wr(this),this.graphicMap.clear(),this.parkingNoGraphicMap.clear(),this.parkingNoIndexMap.clear(),this.nodeIdIndexMap.clear(),this.parkingOptions=[],super.dispose()}constructor(t){super(t),this.graphicMap=new Map,this.parkingNoGraphicMap=new Map,this.parkingOriginOptions=new Map,this.parkingOptions=[],this.merged=!1,this.parkingNoIndexMap=new Map,this.nodeIdIndexMap=new Map,this.mergedParkingSpace=null}};var BQt=V(cn(),1);var h_=class extends wi{addModels(t){let e=t.reduce((n,i)=>{let{url:o}=i;return n[o]?n[o].push(i):n[o]=[i],n},{});Object.values(e).forEach(n=>{let i=new p_(this.context,n);this.add(i)})}constructor(t){super(t)}};var lte=V(De(),1);function FY(r){return`${r.x}-${r.y}-${r.z}`}var Zs=class{static generateLineMaterialKey({color:t,opacity:e}){return`${t}-${e}`}static createLineMaterial({color:t,opacity:e,vertexColors:n}){let i=this.generateLineMaterialKey({color:t,opacity:e,vertexColors:n});if(this.lineMaterialMap.has(i))return this.lineMaterialMap.get(i);let o=new ja({color:new ne(t).convertLinearToSRGB(),transparent:!0,opacity:e,vertexColors:n!=null?n:!1});return this.lineMaterialMap.set(i,o),o}static createMeshStandardMaterial({color:t,opacity:e}){let n=`${t}-${e}`;if(this.meshStandardMaterialMap.has(n))return this.meshStandardMaterialMap.get(n);let i=new ma({color:new ne(t).convertLinearToSRGB(),roughness:1,transparent:!0,opacity:e,depthWrite:!0});return this.meshStandardMaterialMap.set(n,i),i}static createMeshBasicMaterial({color:t,opacity:e,vertexColors:n}){let i=`${t}-${e}-${n}`;if(this.meshBasicMaterialMap.has(i))return this.meshBasicMaterialMap.get(i);let o=new Wr({color:t,transparent:!0,opacity:e,depthWrite:!0,vertexColors:n!=null?n:!1});return this.meshBasicMaterialMap.set(i,o),o}static createShaderMaterial({gradualColor:t,center:e,maxValue:n,opacity:i,direction:o,max:a,min:l}){let c=`${t.toString()}-${FY(e)}-${n}-${i}-${FY(o)}`;if(this.shaderMaterialMap.has(c))return this.shaderMaterialMap.get(c);let p=`
8227
8227
  uniform vec3 uColor;
8228
8228
  uniform vec3 uGradualColor;
8229
8229
  uniform vec3 center;
@@ -12309,7 +12309,7 @@ void main() {
12309
12309
  gl_FragColor = vec4(uColor2, uOpacity); // \u5176\u4ED6\u9762\u989C\u8272\uFF09
12310
12310
  }
12311
12311
  }
12312
- `,n=-1/0,i=this.geometry.getAttribute("position");if(i)for(let a=0;a<i.count;a++){let l=i.getZ(a);l>n&&(n=l)}let o=new tr({uniforms:{maxZ:{value:n},uColor:{value:new ne(this.options[0].fillColor).convertLinearToSRGB()},uColor2:{value:new ne(K0(this.options[0].fillColor)).convertLinearToSRGB()},uOpacity:{value:this.options[0].fillOpacity}},vertexShader:t,fragmentShader:e,transparent:!0});this.material=o}initLineMaterial(){let t=rn.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 Ne(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 a=i[o];for(let l=0;l<a.length;l++){let c=a[l],p=l+1===a.length?a[0]:a[l+1];t.push(new G(c[0],c[1],e)),t.push(new G(p[0],p[1],e))}}}),t}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.getBorderPoints(),e=new Xe().setFromPoints(t);this.lineGeometry=e}createBorder(){this.line&&this.remove(this.line);let t=new Yi(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}dispose(){var t,e;this.geometry?(this.geometry.dispose(),this._listeners={}):this.addEventListener("init-geometry",()=>{var n;(n=this.geometry)==null||n.dispose(),this._listeners={}}),(t=this.material)==null||t.dispose(),(e=this.line)==null||e.geometry.dispose(),this.clear()}constructor(t,e,n){super(),this.context=t,this.mergedElement=n,this.options=[],n?(this.options=[n],this.initMergedElement()):(this.options=e.map(i=>Jt({},vl,i)),this.init())}};var une=V(De(),1),lne=V(I1(),1);var qY={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},v_=class extends ye{init(){return St(this,null,function*(){let t=yield Promise.all(this.options.map(a=>co.getTextureByText(a.texts[0],{fillStyle:R1(a.fillColor,a.fillOpacity),strokeStyle:R1(a.strokeColor,a.strokeOpacity),lineWidth:6,font:"bold 54px sans-serif",maxWidth:2048}))),e=t.map((a,l)=>{let c=this.options[l],{width:p,height:g}=a.texture.image,m=p/g,y=c.secondHeight*m,x=new qa(y,c.secondHeight),S=new Ce().makeTranslation(c.center_x,c.center_y,c.airHeight+c.deltaHeight+c.height).multiply(new Ce().makeRotationZ(c.secondRotate));return x.applyMatrix4(S),x}),n=Ph(e,!0);e.forEach(a=>a.dispose());let i=t.map(a=>{let{texture:l}=a,c=new Wr({map:l,alphaTest:1,side:Xi});return l.needsUpdate=!0,c}),o=new Ne(n,i);this.mesh=o,this.position.z+=.04,this.add(o)})}setOpacity(t){var e,n;(n=this.mesh)==null||(e=n.material)==null||e.forEach(i=>{i.opacity=t,i.needsUpdate=!0})}dispose(){var t,e,n;(t=this.mesh)==null||t.geometry.dispose(),(n=this.mesh)==null||(e=n.material)==null||e.forEach(i=>i.dispose()),this.clear()}constructor(t,e){super(),this.context=t,this.options=e.map(n=>Jt({},qY,n)).filter(n=>n.texts[0].trim()),this.options.length&&this.init()}};var Vh=class extends v0{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(t){let e=t.length-3,n=new Float32Array(2*e);for(let i=0;i<e;i+=3)n[2*i]=t[i],n[2*i+1]=t[i+1],n[2*i+2]=t[i+2],n[2*i+3]=t[i+3],n[2*i+4]=t[i+4],n[2*i+5]=t[i+5];return super.setPositions(n),this}setColors(t){let e=t.length-3,n=new Float32Array(2*e);for(let i=0;i<e;i+=3)n[2*i]=t[i],n[2*i+1]=t[i+1],n[2*i+2]=t[i+2],n[2*i+3]=t[i+3],n[2*i+4]=t[i+4],n[2*i+5]=t[i+5];return super.setColors(n),this}fromLine(t){let e=t.geometry;return this.setPositions(e.attributes.position.array),this}};var Eg=class extends yc{constructor(t=new Vh,e=new Iu({color:Math.random()*16777215})){super(t,e),this.isLine2=!0,this.type="Line2"}};var Sg=class extends ye{registryEvent(){this.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.context.removeEventListener("resize",this.onResize)}setPosition(t,e){this.lineGeometry.setPositions([t.x,t.y,t.z,e.x,e.y,e.z]),this.line||this.createLine()}createLine(){this.line=new Eg(this.lineGeometry,this.lineMaterial),this.line.renderOrder=100003,this.add(this.line)}dispose(){var t;this.unRegistryEvent(),this.line&&wr(this.line),this.lineGeometry=null,this.lineMaterial=null,this.clear(),(t=this.line)==null||t.clear(),this.line=null}constructor(t,e,n){super(),this.context=t,this.lineGeometry=new Vh,this.lineMaterial=new Iu({color:0,transparent:!0,depthTest:!1,linewidth:2}),this.line=null,this.onResize=()=>{let{width:i,height:o}=this.context.clientSize;this.lineMaterial.resolution.set(i,o)},this.onResize(),this.registryEvent(),e&&n&&this.setPosition(e,n)}};var Cne=V(cn(),1),Ine=V(De(),1);var p_=class extends ye{loadModel(){return St(this,null,function*(){let t=yield ws.loadModel(this.options[0].url);t.scene.updateMatrixWorld(!0);let e=t.scene.matrixWorld.clone().invert();t.scene.traverse(c=>{if(c.isMesh){let p=e.clone().multiply(c.matrixWorld),g=c.material;this.subMeshes.push({geometry:c.geometry,material:c.material,initialMatrix:p}),Array.isArray(g)?g.forEach(m=>{m.transparent=!0,this.materialOriginParams.set(m,{opacity:m.opacity})}):(g.transparent=!0,this.materialOriginParams.set(g,{opacity:g.opacity}))}});let n=this.subMeshes.map(c=>{let{geometry:p,material:g}=c;return new rs(p,g,this.options.length)});t.scene.rotation.set(Math.PI/2,0,0);let o=new Ge().setFromObject(t.scene).getSize(new G),a=Math.max(o.x,o.y);this.options.map(c=>{let p=new Ce,g=c.width/a;return p.multiply(new Ce().makeTranslation(c.center_x,c.center_y,c.airHeight+c.deltaHeight)).multiply(new Ce().makeScale(g,g,g)).multiply(new Ce().makeRotationZ(c.rotate)).multiply(new Ce().makeRotationX(Math.PI/2)),c.url==="https://robot-vr-public.cdn.bcebos.com/ai-map-resource/757/1865371442288267264/smzsdrc.glb"&&console.log(c,p),p}).forEach((c,p)=>{n.forEach((g,m)=>{let y=c.clone().multiply(this.subMeshes[m].initialMatrix);g.setMatrixAt(p,y)})}),n.forEach(c=>{c.instanceMatrix.needsUpdate=!0,this.meshSetMaterial(c),this.add(c)})})}meshSetMaterial(t){t.isMesh&&(t.frustumCulled=!1,t.castShadow=!0,Array.isArray(t.material)?t.material.map(e=>{e.emissiveIntensity*=.95}):(t.material.emissiveIntensity*=.95,t.material.emissive=t.material.color,t.material.emissiveMap=t.material.map))}setOpacity(t,e){e===void 0&&(e=!1),this.subMeshes.forEach(n=>{let{material:i}=n;if(Array.isArray(i))i.forEach(o=>{if(e)o.opacity=t;else{let a=this.materialOriginParams.get(o)||{opacity:1};t>a.opacity?o.opacity=a.opacity:o.opacity=t}o.needsUpdate=!0});else{let o=this.materialOriginParams.get(i)||{opacity:1};t>o.opacity?i.opacity=o.opacity:i.opacity=t,i.needsUpdate=!0}}),this.children.forEach(n=>{n.instanceMatrix.needsUpdate=!0})}dispose(){this.children.forEach(t=>t.dispose()),wr(this),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.subMeshes=[],this.materialOriginParams=new Map,this.loadModel()}};var vg=class extends ye{init(){return St(this,null,function*(){this.geometry=this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options.deltaHeight+this.options.airHeight,this.options.lineGeometry&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())})}initGeometry(){return this.loader.parseGeometries([this.options.mergedGeometry])[this.options.mergedGeometry.uuid]}initMaterial(){this.material=rn.GetMergeAttributeGraphicMaterial()}initLineMaterial(){return this.lineMaterial=rn.GetMergeAttributeGraphicLineMaterial()}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new Ne(this.geometry,this.material),this.add(this.mesh)}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.loader.parseGeometries([this.options.lineGeometry]);this.lineGeometry=t[this.options.lineGeometry.uuid]}createBorder(){this.line&&this.remove(this.line);let t=new Yi(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}dispose(){var t;this.geometry&&this.geometry.dispose(),(t=this.line)==null||t.geometry.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.loader=new Tu,this.options=Jt({},vl,e),this.init()}};var x_=class extends ye{initGeometry(){return St(this,null,function*(){let t=new Tu().parseGeometries([this.options.mergedGeometry]);this.geometry=t[this.options.mergedGeometry.uuid]})}init(){return St(this,null,function*(){var t;yield this.initGeometry();let e=new Ne(this.geometry,Zs.GetMergeAttributeWallMaterial());this.add(e);let n=(t=this.geometry)==null?void 0:t.getAttribute("opacity");n&&(this.originOpacities=Array.from(n.array))})}setOpacity(t,e){e===void 0&&(e=!1);var n;let i=(n=this.geometry)==null?void 0:n.getAttribute("opacity");if(i){for(let a=0;a<i.count;a++)if(e)i.setX(a,t);else{var o;i.setX(a,Math.min(t,(o=this.originOpacities[a])!=null?o:1))}i.needsUpdate=!0}}dispose(){var t;(t=this.geometry)==null||t.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.originOpacities=[],this.init()}};var jne=V(Rh(),1),Yne=V(rl(),1),Zne=V(il(),1),$ne=V(ol(),1),Kne=V(sl(),1),Jne=V(al(),1),Qne=V(ul(),1),tre=V(ll(),1),ere=V(cl(),1),nre=V(hl(),1),rre=V(pl(),1),ire=V(fl(),1),ore=V(dl(),1),sre=V(gl(),1),are=V(ml(),1);var zh=class extends ye{init(){return St(this,null,function*(){let t=this.options.iconUrl,e=yield Mo.getTextureByUrl(t),n=new Wr({map:e,transparent:!0,alphaTest:.2,side:vs}),i=new rs(this.geometry,n,this.options.mergedMatrixes.size);i.instanceMatrix=new gi(new Float32Array(this.options.mergedMatrixes.array),16),this.add(i),this.mesh=i,this.position.z+=.004})}setOpacity(t){this.mesh&&(this.mesh.material.opacity=t,this.mesh.material.needsUpdate=!0,this.mesh.instanceMatrix.needsUpdate=!0)}dispose(){var t;this.mesh&&wr(this.mesh),(t=this.mesh)==null||t.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.geometry=new Cp(new t0([new ft(-.5,-.5),new ft(-.5,.5),new ft(.5,.5),new ft(.5,-.5)])),this.options=Jt({},D6,e);let n=new qe([0,0,0,1,1,1,1,0],2);this.geometry.setAttribute("uv",n),this.init()}};var dre=V(cn(),1);var E_=class extends ye{initGeometry(){return St(this,null,function*(){let t=this.loader.parseGeometries([this.options.mergedGeometry]);this.geometry=t[this.options.mergedGeometry.uuid]})}initMaterial(){let t=rn.createMeshBasicMaterial({color:"#ffffff",opacity:1,vertexColors:!0});return this.material=t,t}initDoubleLine(){if(this.options.dashedLineGeometry){let t=rn.createLine2MaterialMap({color:"#ffffff",width:.2,dashed:!0,resolution:new ft(this.context.clientSize.width,this.context.clientSize.height),vertexColors:!0});t.transparent=!0,t.needsUpdate=!0;let e=new v0;e.setPositions(this.options.dashedLineGeometry.positions),e.setColors(this.options.dashedLineGeometry.colors);let n=new yc(e,t);n.computeLineDistances(),n.position.z+=.01,this.add(n),this.doubleLines.push(n)}if(this.options.lineGeometry){let t=rn.createLine2MaterialMap({color:"#ffffff",width:.2,dashed:!1,resolution:new ft(this.context.clientSize.width,this.context.clientSize.height),vertexColors:!0}),e=new v0;e.setPositions(this.options.lineGeometry.positions),e.setColors(this.options.lineGeometry.colors);let n=new yc(e,t);n.position.z+=.01,this.add(n),this.doubleLines.push(n)}}init(){return St(this,null,function*(){yield this.initGeometry(),this.initMaterial();let t=new Ne(this.geometry,this.material);this.add(t),this.initDoubleLine(),this.position.z+=.02})}setOpacity(t){this.material.opacity=t,this.material.needsUpdate=!0,this.doubleLines.forEach(e=>{e.material.opacity=t,e.material.needsUpdate=!0})}dispose(){var t,e;(t=this.geometry)==null||t.dispose(),(e=this.lineGeometry)==null||e.dispose(),this.doubleLines.map(n=>n.geometry.dispose()),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.doubleLines=[],this.loader=new Tu,this.init()}};var Sre=V(Rh(),1),bre=V(rl(),1),Mre=V(il(),1),wre=V(ol(),1),Tre=V(sl(),1),Are=V(al(),1),Cre=V(ul(),1),Ire=V(ll(),1),Rre=V(cl(),1),Pre=V(hl(),1),Lre=V(pl(),1),Nre=V(fl(),1),Ore=V(dl(),1),Dre=V(gl(),1),Ure=V(ml(),1),Fre=V(De(),1);var gg=class extends ye{setColorByIndex(t,e){this.mesh&&(this.mesh.setColorAt(t,new ne(e).convertLinearToSRGB()),this.mesh.instanceColor.needsUpdate=!0)}init(){return St(this,null,function*(){this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options[0].deltaHeight+this.options[0].airHeight,this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())})}initMaterial(){this.material=rn.GetInstancedGraphicMaterial()}initLineMaterial(){let t=rn.GetMergeAttributeGraphicLineMaterial();this.lineMaterial=t}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new rs(this.geometry,this.material,this.options.length);let t=new gi(new Float32Array(this.options.length),1),e=new gi(new Float32Array(this.options.length),1);this.options.forEach((n,i)=>{let o=n.geometry.coords[0],[a,l,c]=o.slice(0,3),p=Math.sqrt((l[0]-a[0])**2+(l[1]-a[1])**2),g=Math.sqrt((c[0]-l[0])**2+(c[1]-l[1])**2),m=[p,g],y=Math.max(...m),x=Math.min(...m),S;y===p?S=[l[0]-a[0],l[1]-a[1]]:S=[c[0]-l[0],c[1]-l[1]];let[w,E]=S,b=Math.atan2(E,w)-Math.PI/2,C=new Ce().compose(new G(n.center_coord_x,n.center_coord_y,(n.deltaHeight||0)+n.airHeight+n.height/2),new li().setFromAxisAngle(new G(0,0,1),b),new G(x,y,n.height));this.mesh.setMatrixAt(i,C),this.mesh.setColorAt(i,new ne(n.fillColor).convertLinearToSRGB()),t.array[i]=n.fillOpacity||1,e.array[i]=(n.deltaHeight||0)+n.airHeight+n.height}),this.originOpacity=[...t.array],this.geometry.setAttribute("opacity",t),this.geometry.setAttribute("maxZ",e),this.add(this.mesh),this.mesh.instanceMatrix.needsUpdate=!0}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let{points:t,colors:e,opacities:n}=a6(this.options),i=new Xe().setFromPoints(t);i.setAttribute("color",new We(new Float32Array(e),3)),i.setAttribute("opacity",new We(new Float32Array(n),1)),this.lineOriginOpacity=[...n],this.lineGeometry=i}createBorder(){this.line&&this.remove(this.line);let t=new Yi(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}setOpacity(t,e){e===void 0&&(e=!1);let n=this.geometry.getAttribute("opacity");for(let a=0;a<n.count;a++)if(e)n.array[a]=t;else{var i;n.array[a]=Math.min(t,(i=this.originOpacity[a])!=null?i:1)}if(n.needsUpdate=!0,this.lineGeometry){let a=this.lineGeometry.getAttribute("opacity");for(let l=0;l<a.count;l++)if(e)a.array[l]=t;else{var o;a.array[l]=Math.min(t,(o=this.lineOriginOpacity[l])!=null?o:1)}a.needsUpdate=!0}}dispose(){var t,e;this.geometry.dispose(),(t=this.mesh)==null||t.dispose(),(e=this.line)==null||e.geometry.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.geometry=new xs(1,1,1),this.options=[],this.originOpacity=[],this.lineOriginOpacity=[],this.options=e.map(n=>Jt({},vl,n)),this.init()}};var Wre=V(Rh(),1),qre=V(rl(),1),Xre=V(il(),1),jre=V(ol(),1),Yre=V(sl(),1),Zre=V(al(),1),$re=V(ul(),1),Kre=V(ll(),1),Jre=V(cl(),1),Qre=V(hl(),1),tie=V(pl(),1),eie=V(fl(),1),nie=V(dl(),1),rie=V(gl(),1),iie=V(ml(),1),oie=V(De(),1);var df=class extends ye{init(){return St(this,null,function*(){this.initMaterial(),this.initMesh()})}initMaterial(){this.material=rn.GetInstancedGraphicMaterial()}initMesh(){if(this.mesh&&this.remove(this.mesh),!this.elements)return;this.mesh=new rs(this.geometry,this.material,this.elements.size);let t=new gi(new Float32Array(this.elements.opacities),1),e=new gi(new Float32Array(this.elements.maxZs),1);this.originOpacities=[...t.array],this.geometry.setAttribute("opacity",t),this.geometry.setAttribute("maxZ",e),this.mesh.instanceMatrix.set(this.elements.matrixes),this.mesh.instanceColor=new gi(new Float32Array(this.elements.colors),3),this.add(this.mesh),this.mesh.instanceMatrix.needsUpdate=!0}setColorByIndex(t,e){this.mesh&&(this.mesh.setColorAt(t,new ne(e).convertLinearToSRGB()),this.mesh.instanceColor.needsUpdate=!0)}setOpacityByIndex(t,e){if(this.mesh){let n=this.geometry.getAttribute("opacity");n.setX(t,e),n.needsUpdate=!0}}setMatrixByIndex(t,e){this.mesh&&(this.mesh.setMatrixAt(t,e),this.mesh.instanceMatrix.needsUpdate=!0)}setMaxZByIndex(t,e){if(this.mesh){let n=this.geometry.getAttribute("maxZ");n.setX(t,e),n.needsUpdate=!0}}setColorById(t,e){if(!this.elements)return;let n=this.elements.ids.findIndex(i=>i===t);n!==-1&&this.setColorByIndex(n,e)}setOpacityById(t,e){if(!this.elements)return;let n=this.elements.ids.findIndex(i=>i===t);n!==-1&&this.setOpacityByIndex(n,e)}setMatrixById(t,e){if(!this.elements)return;let n=this.elements.ids.findIndex(i=>i===t);n!==-1&&this.setMatrixByIndex(n,e)}setMaxZById(t,e){if(!this.elements)return;let n=this.elements.ids.findIndex(i=>i===t);n!==-1&&this.setMaxZByIndex(n,e)}setOpacity(t,e){if(e===void 0&&(e=!1),!this.geometry)return;let n=this.geometry.getAttribute("opacity");for(let o=0;o<n.count;o++)if(e)n.array[o]=t;else{var i;n.array[o]=Math.min(t,(i=this.originOpacities[o])!=null?i:1)}n.needsUpdate=!0}pushElements(t){this.elements?(this.elements.size+=t.size,this.elements.colors=[...this.elements.colors,...t.colors],this.elements.matrixes=[...this.elements.matrixes,...t.matrixes],this.elements.opacities=[...this.elements.opacities,...t.opacities],this.elements.maxZs=[...this.elements.maxZs,...t.maxZs],this.elements.ids=[...this.elements.ids,...t.ids],this.originOpacities=[...this.originOpacities,...t.opacities]):this.elements=t,this.refesh()}removeInstanceById(t){if(this.elements){if(this.mesh){let e=this.elements.ids.indexOf(t);e!==-1&&(this.elements.size--,this.elements.colors.splice(e*3,3),this.elements.matrixes.splice(e*16,16),this.elements.opacities.splice(e,1),this.elements.maxZs.splice(e,1),this.elements.ids.splice(e,1),this.originOpacities.splice(e,1))}this.refesh()}}refesh(){this.mesh&&(this.mesh.dispose(),this.remove(this.mesh)),this.init()}dispose(){var t;this.material=null,this.originOpacities.length=0,this.geometry.dispose(),(t=this.mesh)==null||t.dispose(),this.clear()}constructor(t,e){super(),this.geometry=new xs(1,1,1),this.material=null,this.elements=null,this.originOpacities=[],this.elements=e,this.init()}};var cie=V(Rh(),1),hie=V(rl(),1),pie=V(il(),1),fie=V(ol(),1),die=V(sl(),1),gie=V(al(),1),mie=V(ul(),1),yie=V(ll(),1),_ie=V(cl(),1),vie=V(hl(),1),xie=V(pl(),1),Eie=V(fl(),1),Sie=V(dl(),1),bie=V(gl(),1),Mie=V(ml(),1),wie=V(De(),1);var S_=class extends ye{init(){return St(this,null,function*(){this.initMaterial(),this.initMesh()})}initMaterial(){this.material=rn.GetInstancedWallMaterial()}initMesh(){if(this.mesh&&this.remove(this.mesh),!this.elements)return;this.mesh=new rs(this.geometry,this.material,this.elements.size);let t=new gi(new Float32Array(this.elements.opacities),1),e=new gi(new Float32Array(this.elements.maxZs),1),n=new gi(new Float32Array(this.elements.minZs),1);this.originOpacities=[...t.array],this.geometry.setAttribute("opacity",t),this.geometry.setAttribute("maxZ",e),this.geometry.setAttribute("minZ",n),this.mesh.instanceMatrix.set(this.elements.matrixes),this.mesh.instanceColor=new gi(new Float32Array(this.elements.colors),3),this.add(this.mesh),this.mesh.instanceMatrix.needsUpdate=!0}setOpacityByIndex(t,e){if(this.mesh){let n=this.geometry.getAttribute("opacity");n.setX(t,e),n.needsUpdate=!0}}setOpacity(t,e){e===void 0&&(e=!1),this.elements&&this.elements.opacities.forEach((n,i)=>{let o=e?t:Math.min(t,this.originOpacities[i]);this.setOpacityByIndex(i,o)})}dispose(){this.mesh&&(this.mesh.dispose(),this.remove(this.mesh)),this.material=null,this.geometry&&this.geometry.dispose(),this.elements=null}constructor(t,e){super(),this.geometry=new xs(1,1,1),this.material=null,this.elements=null,this.originOpacities=[],this.elements=e,this.init()}};var Gh=class extends ye{init(){return St(this,null,function*(){this.initLineGeometry(),this.initLineMaterial(),this.createBorder()})}initLineMaterial(){return this.lineMaterial=rn.GetMergeAttributeGraphicLineMaterial()}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.loader.parseGeometries([this.options]);this.lineGeometry=t[this.options.uuid]}createBorder(){this.line&&this.remove(this.line);let t=new Yi(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}dispose(){var t;(t=this.lineGeometry)==null||t.dispose(),this.lineMaterial=null,this.clear()}constructor(t,e){super(),this.context=t,this.lineMaterial=null,this.loader=new Tu,this.options=Jt({},vl,e),this.init()}};var z6=class extends Qa{setEnable(t){super.setEnable(t),Ms(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=bn(this.startPoint,e,n,i),a=bn(this.endPoint,e,n,i),l={x:Math.min(o.x,a.x),y:Math.min(o.y,a.y)},c={x:Math.max(o.x,a.x),y:Math.max(o.y,a.y)},p=this.searchMapInFrustum(l,c);this.dispatchEvent({type:"selected",list:p})}}searchMapInFrustum(t,e){var n;let{context:i}=this;return((n=i.currentFloor)==null?void 0:n.graphicLayer.children.filter(o=>o instanceof wo&&this.searchChildInFrustum(o,t,e)))||[]}searchChildInFrustum(t,e,n){let{context:{camera:i,container:{clientWidth:o,clientHeight:a}}}=this;if(!t)return!1;if(!t.mesh){let y=t.getPosition();if(y){let x=bn(y,i,o,a);return ac(x,e,n)}return!1}t.mesh.geometry.boundingBox||t.mesh.geometry.computeBoundingBox();let l=t.mesh.geometry.boundingBox;if(!l)return!1;let{min:c,max:p}=l,g=bn(c,i,o,a),m=bn(p,i,o,a);return!(!ac(g,e,n)||!ac(m,e,n))}dispose(){super.dispose(),this.rect=null,this.unRegistryEvent()}constructor(t){super(t),this.frustum=new B0,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=Jt({},i);this.endPoint&&(o=this.getSvgCoordinate(this.endPoint));let a={x:Math.min(i.x,o.x),y:Math.min(i.y,o.y)},l=Math.abs(o.x-i.x),c=Math.abs(o.y-i.y);Ms(this.rect,a.x,a.y,l,c)}else Ms(this.rect,0,0,0,0)};let{config:{selectBox:{fill:e,stroke:n}}}=t;this.rect=uc(n,e),this.svg.appendChild(this.rect),this.registryEvent()}};var b_=class extends En{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:a}=this.downPoint;if(Math.sqrt((o-n)**2+(a-i)**2)>3)return;let{graphics:l}=this.context.getGraphicsByDeviceXy(n,i),c=new Set(l.map(g=>g.options.id));this.context.getPoisByDeviceXy(n,i).forEach(g=>{if(!c.has(g.options.id)){var m;let y=((m=this.context.currentFloor)==null?void 0:m.graphicLayer.graphicMap.get(g.options.id))||null;y&&y.options.geometry.type==="point"&&(l.push(y),c.add(g.options.id))}}),(Jp?e.metaKey:e.ctrlKey)||this._list.clear(),l.forEach(g=>this._list.add(g)),this.selectEnd(),this.downPoint=null},this.onPointerOut=e=>{this.disableBoxSelection()},this.onKeyDown=e=>{Qp(e.key)&&this.enableBoxSelection()},this.onKeyUp=e=>{Qp(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 z6(t),this.boxSelection.setEnable(!1),this.registryEvent()}};var toe=V(n0(),1),eoe=V(r0(),1),noe=V(i0(),1),roe=V(o0(),1),ioe=V(s0(),1),ooe=V(a0(),1),soe=V(u0(),1),aoe=V(De(),1);var M_=class extends En{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 hi,this.graphicTimerMap=new Map,this.onPointerMove=e=>{let{graphics:n,pois:i,e:o}=e,a=i.map(g=>{var m;return(m=this.context.currentFloor)==null?void 0:m.graphicLayer.graphicMap.get(g.options.id)}).filter(g=>g&&g.options.geometry.type==="point");if(!n.length&&!a.length&&this.curGraphics.size){this.curGraphics.clear(),this.handleHoverGraphicsChange();return}let{time:l}=this.context.config.hover,c=new Set;if(a.length){let g,m=1e4;a.forEach(y=>{let x=i.find(S=>S.options.id===y.options.id);if(x instanceof Fh){let{x:S,y:w}=x.clientPos,E=Math.sqrt((S-o.offsetX)**2+(w-o.offsetY)**2);E<m&&(m=E,g=y)}else if(x instanceof Di){let{x:S,y:w}=x.box.getCenter(new ft),E=Math.sqrt((S-o.offsetX)**2+(w-o.offsetY)**2);E<m&&(m=E,g=y)}}),c.add(g)}c.size||n.forEach(g=>c.add(g)),c.forEach(g=>{if(this.graphicTimerMap.get(g)||this.curGraphics.has(g))return;let m=this.timer.setTimeout(()=>{this.curGraphics.add(g),this.graphicTimerMap.delete(g),this.timer.clearTimeout(m),this.handleHoverGraphicsChange()},l);this.graphicTimerMap.set(g,m)}),this.graphicTimerMap.forEach((g,m)=>{c.has(m)||(this.timer.clearTimeout(g),this.graphicTimerMap.delete(m))});let p=this.curGraphics.size;this.curGraphics.forEach(g=>{c.has(g)||this.curGraphics.delete(g)}),p!==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 poe=V(De(),1);var G6=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(S=>S instanceof _0).length)return null;let e=this.box,{camera:n,clientSize:{width:i,height:o}}=this.context,{min:a,max:l}=e,p=[new G(a.x,a.y,a.z),new G(l.x,a.y,a.z),new G(a.x,l.y,a.z),new G(l.x,l.y,a.z),new G(a.x,a.y,l.z),new G(l.x,a.y,l.z),new G(a.x,l.y,l.z),new G(l.x,l.y,l.z)].map(S=>bn(S,n,i,o)),g=Math.min(...p.map(S=>S.x)),m=Math.max(...p.map(S=>S.x)),y=Math.min(...p.map(S=>S.y)),x=Math.max(...p.map(S=>S.y));return{left:g,right:m,top:y,bottom:x}}checkDistanceToScreenEdge(t){let{left:e,right:n,top:i,bottom:o}=t,{width:a,height:l}=this.context.clientSize,[c,p,g,m]=this.context.config.cameraBound.padding,y=yr([[[e,i],[n,i],[n,o],[e,o],[e,i]]]),x=yr([[[m,c],[a-p,c],[a-p,l-g],[m,l-g],[m,c]]]);try{return jd(y,x)!==null}catch(S){return console.warn("\u8BA1\u7B97\u4EA4\u96C6\u51FA\u9519:",S),!1}}dispose(){this.unRegistryEvent()}constructor(t){this.context=t,this.prevCamera={position:new G,zoom:1,target:new G},this.enable=!0,this.box=new Ge,this.onCameraChange=()=>{let e=this.getCurFloorScreenPosition();if(e){let{left:n,right:i,top:o,bottom:a}=e;this.checkDistanceToScreenEdge({left:n,right:i,top:o,bottom:a})?this.changePrevCamera():this.backToPrevCamera()}},this.registryEvent(),this.changePrevCamera()}};var Coe=V(zI(),1);var Moe=V(De(),1),woe=V(cn(),1);var V6=new da,o8=new Wa,kbt=Math.cos(70*vd.DEG2RAD),H6=class extends En{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 ft,this.rotateLineEnd=new ft,this.spherical=new Dp,this.sphericalDelta=new Dp,this.object=t,this.domElement=e,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new G,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:Up.PAN,MIDDLE:Up.DOLLY,RIGHT:Up.ROTATE},this.touches={ONE:Fp.PAN,TWO:Fp.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 l.phi},this.getAzimuthalAngle=function(){return l.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(st){st.addEventListener("keydown",this.onKeyDown),this._domElementKeyEvents=st},this.stopListenToKeyEvents=function(){var st;(st=this._domElementKeyEvents)==null||st.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 st=new G,Wt=new li().setFromUnitVectors(t.up,new G(0,1,0)),kt=Wt.clone().invert(),$t=new G,ae=new li,ut=new G,L=2*Math.PI;return function(Y){Y===void 0&&(Y=null);let J=n.object.position;st.copy(J).sub(n.target),st.applyQuaternion(Wt),l.setFromVector3(st),n.autoRotate&&o===i.NONE&&W(ot(Y)),n.enableDamping?(l.theta+=c.theta*n.dampingFactor,l.phi+=c.phi*n.dampingFactor):(l.theta+=c.theta,l.phi+=c.phi);let $=n.minAzimuthAngle,mt=n.maxAzimuthAngle;isFinite($)&&isFinite(mt)&&($<-Math.PI?$+=L:$>Math.PI&&($-=L),mt<-Math.PI?mt+=L:mt>Math.PI&&(mt-=L),$<=mt?l.theta=Math.max($,Math.min(mt,l.theta)):l.theta=l.theta>($+mt)/2?Math.max($,l.theta):Math.min(mt,l.theta)),l.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,l.phi)),l.makeSafe(),n.enableDamping===!0?n.target.addScaledVector(g,n.dampingFactor):n.target.add(g),n.zoomToCursor&&F||n.object.isOrthographicCamera?l.radius=_t(l.radius):l.radius=_t(l.radius*p),st.setFromSpherical(l),st.applyQuaternion(kt),J.copy(n.target).add(st),n.object.lookAt(n.target),n.enableDamping===!0?(c.theta*=1-n.dampingFactor,c.phi*=1-n.dampingFactor,g.multiplyScalar(1-n.dampingFactor)):(c.set(0,0,0),g.set(0,0,0));let gt=!1;if(n.zoomToCursor&&F){let It=null;if(n.object.isPerspectiveCamera){let Ct=st.length();It=_t(Ct*p);let j=Ct-It;n.object.position.addScaledVector(R,j),n.object.updateMatrixWorld()}else if(n.object.isOrthographicCamera){let Ct=new G(U.x,U.y,0);Ct.unproject(n.object),n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/p)),n.object.updateProjectionMatrix(),gt=!0;let j=new G(U.x,U.y,0);j.unproject(n.object),n.object.position.sub(j).add(Ct),n.object.updateMatrixWorld(),It=st.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;It!==null&&(n.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(It).add(n.object.position):(V6.origin.copy(n.object.position),V6.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(V6.direction))<kbt?t.lookAt(n.target):(o8.setFromNormalAndCoplanarPoint(n.object.up,n.target),V6.intersectPlane(o8,n.target))))}else n.object.isOrthographicCamera&&(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/p)),n.object.updateProjectionMatrix(),gt=!0);return p=1,F=!1,gt||$t.distanceToSquared(n.object.position)>a||8*(1-ae.dot(n.object.quaternion))>a||ut.distanceToSquared(n.target)>0?(n.dispatchEvent({type:"change"}),$t.copy(n.object.position),ae.copy(n.object.quaternion),ut.copy(n.target),gt=!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,a=1e-6,l=new Dp,c=new Dp,p=1,g=new G,m=new ft,y=new ft,x=new ft,S=new ft,w=new ft,E=new ft,b=new ft,C=new ft,A=new ft,R=new G,U=new ft,F=!1,O=[],N={};function ot(st){return st!==null?2*Math.PI/60*n.autoRotateSpeed*st:2*Math.PI/60/60*n.autoRotateSpeed}function D(){return Math.pow(.95,n.zoomSpeed)}function W(st){c.theta-=st}function X(st){c.phi-=st}let Rt=function(){let st=new G;return function(kt,$t){st.setFromMatrixColumn($t,0),st.multiplyScalar(-kt),g.add(st)}}(),et=function(){let st=new G;return function(kt,$t){n.screenSpacePanning===!0?st.setFromMatrixColumn($t,1):(st.setFromMatrixColumn($t,0),st.crossVectors(n.object.up,st)),st.multiplyScalar(kt),g.add(st)}}(),xt=function(){let st=new G;return function(kt,$t){let ae=n.domElement;if(n.object.isPerspectiveCamera){let ut=n.object.position;st.copy(ut).sub(n.target);let L=st.length();L*=Math.tan(n.object.fov/2*Math.PI/180),Rt(2*kt*L/ae.clientHeight,n.object.matrix),et(2*$t*L/ae.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(Rt(kt*(n.object.right-n.object.left)/n.object.zoom/ae.clientWidth,n.object.matrix),et($t*(n.object.top-n.object.bottom)/n.object.zoom/ae.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function bt(st){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?p/=st:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function Ot(st){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?p*=st:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function ht(st){if(!n.zoomToCursor)return;F=!0;let Wt=n.domElement.getBoundingClientRect(),kt=st.clientX-Wt.left,$t=st.clientY-Wt.top,ae=Wt.width,ut=Wt.height;U.x=kt/ae*2-1,U.y=-($t/ut)*2+1,R.set(U.x,U.y,1).unproject(n.object).sub(n.object.position).normalize()}function _t(st){return Math.max(n.minDistance,Math.min(n.maxDistance,st))}function Q(st){m.set(st.clientX,st.clientY)}function Bt(st){ht(st),b.set(st.clientX,st.clientY)}function Xt(st){S.set(st.clientX,st.clientY)}function he(st){y.set(st.clientX,st.clientY),x.subVectors(y,m).multiplyScalar(n.rotateSpeed);let Wt=n.domElement;W(2*Math.PI*x.x/Wt.clientHeight),X(2*Math.PI*x.y/Wt.clientHeight),m.copy(y),n.update()}function dt(st){C.set(st.clientX,st.clientY),A.subVectors(C,b),A.y>0?bt(D()):A.y<0&&Ot(D()),b.copy(C),n.update()}function Vt(st){w.set(st.clientX,st.clientY),E.subVectors(w,S).multiplyScalar(n.panSpeed),xt(E.x,E.y),S.copy(w),n.update()}function oe(st){ht(st),st.deltaY<0?Ot(D()):st.deltaY>0&&bt(D()),n.update()}function me(st){let Wt=!1;switch(st.code){case n.keys.UP:st.ctrlKey||st.metaKey||st.shiftKey?X(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):xt(0,n.keyPanSpeed),Wt=!0;break;case n.keys.BOTTOM:st.ctrlKey||st.metaKey||st.shiftKey?X(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):xt(0,-n.keyPanSpeed),Wt=!0;break;case n.keys.LEFT:st.ctrlKey||st.metaKey||st.shiftKey?W(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):xt(n.keyPanSpeed,0),Wt=!0;break;case n.keys.RIGHT:st.ctrlKey||st.metaKey||st.shiftKey?W(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):xt(-n.keyPanSpeed,0),Wt=!0;break}Wt&&(st.preventDefault(),n.update())}function ue(){if(O.length===1)m.set(O[0].pageX,O[0].pageY);else{let st=(O[0].pageX-O[0].pageY)/(O[1].pageX-O[1].pageY),Wt=O[0].pageY-st*O[0].pageX;n.rotateLineStart.set(st,Wt);let kt=.5*(O[0].pageX+O[1].pageX),$t=.5*(O[0].pageY+O[1].pageY);m.set(kt,$t)}}function se(){if(O.length===1)S.set(O[0].pageX,O[0].pageY);else{let st=.5*(O[0].pageX+O[1].pageX),Wt=.5*(O[0].pageY+O[1].pageY);S.set(st,Wt)}}function Yt(){let st=O[0].pageX-O[1].pageX,Wt=O[0].pageY-O[1].pageY,kt=Math.sqrt(st*st+Wt*Wt);b.set(0,kt)}function be(){n.enableZoom&&Yt(),n.enablePan&&se()}function it(){n.enableZoom&&Yt(),n.enableRotate&&ue()}function ee(st){if(O.length==1)y.set(st.pageX,st.pageY);else{let kt=Et(st),$t=.5*(st.pageX+kt.x),ae=.5*(st.pageY+kt.y);y.set($t,ae);let ut=(st.pageY-kt.y)/(st.pageX-kt.x),L=kt.y-ut*kt.x;if(n.rotateLineEnd.set(ut,L),Number.isFinite(n.rotateLineEnd.x)&&Number.isFinite(n.rotateLineStart.x)){let z=(n.rotateLineStart.y-n.rotateLineEnd.y)/(n.rotateLineEnd.x-n.rotateLineStart.x),Y=ut*z+L;if(Number.isFinite(z)&&Number.isFinite(Y)){let J=Math.atan(n.rotateLineEnd.x)-Math.atan(n.rotateLineStart.x);Math.PI-Math.abs(J)<.5&&(J=-Math.sign(J)*(Math.PI-Math.abs(J))),Math.abs(J)<.1&&(c.theta+=J)}}n.rotateLineStart.copy(n.rotateLineEnd)}x.subVectors(y,m).multiplyScalar(n.rotateSpeed);let Wt=n.domElement;X(2*Math.PI*x.y/Wt.clientHeight),m.copy(y)}function Dt(st){if(O.length===1)w.set(st.pageX,st.pageY);else{let Wt=Et(st),kt=.5*(st.pageX+Wt.x),$t=.5*(st.pageY+Wt.y);w.set(kt,$t)}E.subVectors(w,S).multiplyScalar(n.panSpeed),xt(E.x,E.y),S.copy(w)}function Kt(st){let Wt=Et(st),kt=st.pageX-Wt.x,$t=st.pageY-Wt.y,ae=Math.sqrt(kt*kt+$t*$t);C.set(0,ae),A.set(0,Math.pow(C.y/b.y,n.zoomSpeed)),bt(A.y),b.copy(C)}function Ht(st){n.enableZoom&&Kt(st),n.enablePan&&Dt(st)}function de(st){n.enableZoom&&Kt(st),n.enableRotate&&ee(st)}this.onPointerDown=function(Wt){n.enabled!==!1&&(O.length===0&&(n.domElement.setPointerCapture(Wt.pointerId),n.domElement.addEventListener("pointermove",n.onPointerMove),n.domElement.addEventListener("pointerup",n.onPointerUp)),q(Wt),Wt.pointerType==="touch"?Ee(Wt):ge(Wt))},this.onPointerMove=function(Wt){n.enabled!==!1&&(Wt.pointerType==="touch"?rt(Wt):jt(Wt))},this.onPointerUp=function(Wt){Ut(Wt),O.length===0&&(n.domElement.releasePointerCapture(Wt.pointerId),n.domElement.removeEventListener("pointermove",n.onPointerMove),n.domElement.removeEventListener("pointerup",n.onPointerUp)),n.dispatchEvent({type:"end"}),o=i.NONE};function ge(st){let Wt;switch(st.button){case 0:Wt=n.mouseButtons.LEFT;break;case 1:Wt=n.mouseButtons.MIDDLE;break;case 2:Wt=n.mouseButtons.RIGHT;break;default:Wt=-1}switch(Wt){case Up.DOLLY:if(n.enableZoom===!1)return;Bt(st),o=i.DOLLY;break;case Up.ROTATE:if(st.ctrlKey||st.metaKey||st.shiftKey){if(n.enablePan===!1)return;Xt(st),o=i.PAN}else{if(n.enableRotate===!1)return;Q(st),o=i.ROTATE}break;case Up.PAN:if(st.ctrlKey||st.metaKey||st.shiftKey){if(n.enableRotate===!1)return;Q(st),o=i.ROTATE}else{if(n.enablePan===!1)return;Xt(st),o=i.PAN}break;default:o=i.NONE}o!==i.NONE&&n.dispatchEvent({type:"start"})}function jt(st){switch(o){case i.ROTATE:if(n.enableRotate===!1)return;he(st);break;case i.DOLLY:if(n.enableZoom===!1)return;dt(st);break;case i.PAN:if(n.enablePan===!1)return;Vt(st);break}}this.onMouseWheel=function(Wt){n.enabled===!1||n.enableZoom===!1||o!==i.NONE||(Wt.preventDefault(),n.dispatchEvent({type:"start"}),oe(Wt),n.dispatchEvent({type:"end"}))},this.onKeyDown=function(Wt){n.enabled===!1||n.enablePan===!1||me(Wt)};function Ee(st){switch(Gt(st),O.length){case 1:switch(n.touches.ONE){case Fp.ROTATE:if(n.enableRotate===!1)return;ue(),o=i.TOUCH_ROTATE;break;case Fp.PAN:if(n.enablePan===!1)return;se(),o=i.TOUCH_PAN;break;default:o=i.NONE}break;case 2:switch(n.touches.TWO){case Fp.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;be(),o=i.TOUCH_DOLLY_PAN;break;case Fp.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;it(),o=i.TOUCH_DOLLY_ROTATE;break;default:o=i.NONE}break;default:o=i.NONE}o!==i.NONE&&n.dispatchEvent({type:"start"})}function rt(st){switch(Gt(st),o){case i.TOUCH_ROTATE:if(n.enableRotate===!1)return;ee(st),n.update();break;case i.TOUCH_PAN:if(n.enablePan===!1)return;Dt(st),n.update();break;case i.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;Ht(st),n.update();break;case i.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;de(st),n.update();break;default:o=i.NONE}}this.onContextMenu=function(Wt){n.enabled!==!1&&Wt.preventDefault()};function q(st){O.push(st)}function Ut(st){delete N[st.pointerId];for(let Wt=0;Wt<O.length;Wt++)if(O[Wt].pointerId==st.pointerId){O.splice(Wt,1);return}}function Gt(st){let Wt=N[st.pointerId];Wt===void 0&&(Wt=new ft,N[st.pointerId]=Wt),Wt.set(st.pageX,st.pageY)}function Et(st){let Wt=st.pointerId===O[0].pointerId?O[1]:O[0];return N[Wt.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 w_=class extends H6{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 St(this,null,function*(){return e===void 0&&(e=!1),n===void 0&&(n=500),n<=0?this.setPolarAngle(t,e):$a(new Promise(i=>{let o={polar:this.getPolarAngle()},a={polar:t},l=new Ka(o,this.tweenGroup).to(a,n).onUpdate(()=>{this.setPolarAngle(o.polar,e)}).onComplete(()=>{this.enabled=!0,this.tweenGroup.remove(l),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):$a(new Promise(i=>{let o={azimuthal:this.getAzimuthalAngle()},a={azimuthal:t},l=new Ka(o,this.tweenGroup).to(a,n).onUpdate(()=>{this.setAzimuthalAngle(o.azimuthal,e)}).onComplete(()=>{this.enabled=!0,this.tweenGroup.remove(l),i(!0)}).onStart(()=>{this.enabled=!1}).start()}),n+500)}getCameraLookAt(){return new G().subVectors(this.target,this.camera.position)}setCameraPositionByTarget(t,e){return St(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 $a(new Promise(o=>{let a=new Ka(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(a),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 St(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?$a(new Promise(a=>{let l=new Ka(o,this.tweenGroup).to({zoom:t,target:e},i).onUpdate(()=>{this.setZoom(o.zoom,o.target,n)}).onComplete(()=>{this.tweenGroup.remove(l),this.enabled=!0,a(!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()),this.camera.updateMatrix(),t){let n=new G;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 Ly,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 T_=class extends Nm{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)}constructor(t){super(Jt({antialias:!0,alpha:!0},t)),this.event=new En,this.enable=!0,this.timer=new hi,this.autoClear=!0,this.setPixelRatio(window.devicePixelRatio),this.toneMapping=eM,this.toneMappingExposure=1;let e=this.dispose;this.dispose=()=>{this.timer.dispose(),this.enable=!1,e.call(this),this.domElement.remove(),this.domElement=null,this.shadowMap=null,this.info.programs&&(this.info.programs.length=0),this.info=null}}};var W6=class extends bp{constructor(t=null){super();let e=new xs;e.deleteAttribute("uv");let n=new ma({side:_s}),i=new ma,o=5;t!==null&&t._useLegacyLights===!1&&(o=900);let a=new Pp(16777215,o,28,2);a.position.set(.418,16.199,.3),this.add(a);let l=new Ne(e,n);l.position.set(-.757,13.219,.717),l.scale.set(31.713,28.305,28.591),this.add(l);let c=new Ne(e,i);c.position.set(-10.906,2.009,1.846),c.rotation.set(0,-.195,0),c.scale.set(2.328,7.905,4.651),this.add(c);let p=new Ne(e,i);p.position.set(-5.607,-.754,-.758),p.rotation.set(0,.994,0),p.scale.set(1.97,1.534,3.955),this.add(p);let g=new Ne(e,i);g.position.set(6.167,.857,7.803),g.rotation.set(0,.561,0),g.scale.set(3.927,6.285,3.687),this.add(g);let m=new Ne(e,i);m.position.set(-2.017,.018,6.124),m.rotation.set(0,.333,0),m.scale.set(2.002,4.566,2.064),this.add(m);let y=new Ne(e,i);y.position.set(2.291,-.756,-2.621),y.rotation.set(0,-.286,0),y.scale.set(1.546,1.552,1.496),this.add(y);let x=new Ne(e,i);x.position.set(-2.193,-.369,-5.547),x.rotation.set(0,.516,0),x.scale.set(3.875,3.487,2.986),this.add(x);let S=new Ne(e,bg(50));S.position.set(-16.116,14.37,8.208),S.scale.set(.1,2.428,2.739),this.add(S);let w=new Ne(e,bg(50));w.position.set(-16.109,18.021,-8.207),w.scale.set(.1,2.425,2.751),this.add(w);let E=new Ne(e,bg(17));E.position.set(14.904,12.198,-1.832),E.scale.set(.15,4.265,6.331),this.add(E);let b=new Ne(e,bg(43));b.position.set(-.462,8.89,14.52),b.scale.set(4.38,5.441,.088),this.add(b);let C=new Ne(e,bg(20));C.position.set(3.235,11.486,-12.541),C.scale.set(2.5,2,.1),this.add(C);let A=new Ne(e,bg(100));A.position.set(0,20,0),A.scale.set(1,.1,1),this.add(A)}dispose(){let t=new Set;this.traverse(e=>{e.isMesh&&(t.add(e.geometry),t.add(e.material))});for(let e of t)e.dispose()}};function bg(r){let t=new Wr;return t.color.setScalar(r),t}function s8(r,t){t===void 0&&(t=.85);let e=new md(r);return e.compileEquirectangularShader(),e.fromScene(new W6).texture}var A_=class extends bp{dispose(){var t;(t=this.environment)==null||t.dispose(),this.environment=null,wr(this),this.clear()}constructor(t){super(),this.environment=s8(t)}};var C_=class extends tc{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 $oe=V(N6(),1),Koe=V(cn(),1),Joe=V(De(),1);var q6=class{registryEvent(){this.context.addEventListener("update",this.onUpdate),this.context.addEventListener("control-change",this.onControlChange),this.context.addEventListener("resize",this.onControlChange)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate),this.context.removeEventListener("control-change",this.onControlChange),this.context.removeEventListener("resize",this.onControlChange)}changePoiLevelOrCollisionEnable(t){let e=this.objects.findIndex(n=>n===t);e!==-1&&(this.objects.splice(e,1),this.addObject(t))}addObjectEvent(t){let e=()=>this.changePoiLevelOrCollisionEnable(t);this.poiEvents.set(t,e),t.addEventListener("change-level",e),t.addEventListener("change-collision_enable",e),t.addEventListener("text-texture-inited",this.onControlChange)}removeObjectEvent(t){let e=this.poiEvents.get(t);e&&(t.removeEventListener("change-level",e),t.removeEventListener("change-collision_enable",e),t.removeEventListener("text-texture-inited",this.onControlChange))}addObject(t){if(!this.objects.includes(t)){if(this.needsUpdate=!0,this.addObjectEvent(t),!t.options.collision_enable){this.objects.unshift(t);return}if(t.options.level===0){this.objects.push(t);return}for(let e=0;e<this.objects.length;e++){let n=this.objects[e];if(n.options.collision_enable&&n.options.level<=t.options.level){this.objects.splice(e,0,t);return}}this.objects.push(t)}}removeObject(t){let e=this.objects.indexOf(t);e!==-1&&(this.objects.splice(e,1),this.removeObjectEvent(t),this.poiEvents.set(t,null),this.needsUpdate=!0)}removeObjects(t){this.objects=this.objects.filter(e=>t.includes(e)?(this.removeObjectEvent(e),this.poiEvents.set(e,null),!1):!0),this.needsUpdate=!0}getObjectById(t){return this.objects.find(e=>e.options.id===t)||null}validShowParkingSpace(t){t===void 0&&(t=60);let{clientSize:{width:e,height:n},control:i,camera:o}=this.context,a=Math.min(e/t,n/t,i.maxZoom-1);return o.zoom>=a}detectCollisions(){if(!this.needsUpdate)return;let t=[],{camera:e}=this.context;e.updateMatrixWorld();let n=g=>g<=1&&g>=-1,i=e.projectionMatrix.clone();i.multiply(e.matrixWorldInverse);let o=e.zoom/this.context.basicZoom,a=25/30,l=Math.min(25,Math.max(1,o*a)),c=this.validShowParkingSpace();this.objects.filter(g=>{if(g.visible){if(!(l<=g.options.maxWeight&&l>=g.options.minWeight)||!c&&g.userData.type==="parkingSpace")return g.parentSetVisible(!1),!1;let m=g.getWorldPosition(new G);return m.applyMatrix4(i),g.screenPosition=m,n(m.x)&&n(m.y)&&n(m.z)?!0:(g.parentSetVisible(!1),!1)}return!1}).forEach((g,m)=>{let y=g.getBox(g.screenPosition);if(y===null){g.parentSetVisible(!1);return}if(m===0||!g.options.collision_enable){t.push(y),g.parentSetVisible(!0);return}let x=t.some(S=>S.intersectsBox(y));g.parentSetVisible(!x),x||t.push(y)}),this.needsUpdate=!1}markForUpdate(){this.needsUpdate=!0}clear(){this.objects=[],this.needsUpdate=!0}dispose(){this.objects.forEach(t=>{this.poiEvents.set(t,null)}),this.objects=[],this.unRegistryEvent()}constructor(t){this.context=t,this.objects=[],this.needsUpdate=!0,this.poiEvents=new WeakMap,this.onUpdate=()=>{this.detectCollisions()},this.onControlChange=()=>{this.needsUpdate=!0},this.registryEvent()}};var I_=class extends En{get config(){return this.bmap.config}get center(){return this.bmap.buildingCenter}setRange(t){this.range=yr([t])}resizeClientSize(){let{x:t,y:e,width:n,height:i}=this.container.getBoundingClientRect();this.clientSize={width:n||this.container.clientWidth,height:i||this.container.clientHeight,x:t,y:e}}init(){let{clientWidth:t,clientHeight:e}=this.container;this.camera=new C_(t,e),this.renderer.setSize(t,e),this.renderer.setCameraAndScene(this.scene,this.camera),this.renderer.autoRender(),this.control=new w_(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 G6(this)}getRatio(t,e){t===void 0&&(t=new G(0,0,0)),e===void 0&&(e=new G(100,0,0));let{clientWidth:n,clientHeight:i}=this.container,o=bn(t,this.camera,n,i),a=bn(e,this.camera,n,i);return Math.ceil(Math.sqrt((a.x-o.x)**2+(a.y-o.y)**2))}changeAmbientLightColor(t){this.lights.children.forEach(e=>{e instanceof Np&&(e.color=new ne(t))})}switchFloor(t,e){e===void 0&&(e=!0),console.log("switchFloor",e),this.currentFloor&&(this.currentFloor.onRemoveFromScene(),this.scene.remove(this.currentFloor),e&&this.currentFloor.dispose()),this.currentFloor=t,this.setRange(t.userData.range||[]),this.scene.add(t),t.onAddToScene("scene"),this.cameraBound.updateBox()}getGraphicsByDeviceXy(t,e){var n;let i=new ft;i.x=t/this.clientSize.width*2-1,i.y=e/this.clientSize.height*-2+1;let o=new ah;return o.setFromCamera(i,this.camera),o.ray.origin.sub(o.ray.direction.clone().multiplyScalar(100)),((n=this.currentFloor)==null?void 0:n.graphicLayer.getGraphicByRaycaster(o))||{graphics:[],position:null}}getPoisByDeviceXy(t,e){var n,i;let o=(n=this.currentFloor)==null?void 0:n.poiLayer.getPoiByDeviceXy(t,e),a=(i=this.currentFloor)==null?void 0:i.poiLayer2.getPoiByDeviceXy(t,e);return(o||[]).concat(a||[])}registryEvent(){window.addEventListener("resize",this.onWindowResize),this.container.addEventListener("click",this.onClick),this.container.addEventListener("pointerover",this.onPointerover),this.container.addEventListener("pointermove",this.onPointermove),this.container.addEventListener("pointerleave",this.onPointerleave),this.container.addEventListener("pointercancel",this.onPointerleave),this.container.addEventListener("pointerout",this.onPointerleave),this.selection.addEventListener("select",this.onSelectionSelect),this.hoverHelper.addEventListener("hover-change",this.onHoverChange)}unRegistryEvent(){window.removeEventListener("resize",this.onWindowResize),this.container.removeEventListener("click",this.onClick),this.container.removeEventListener("pointerover",this.onPointerover),this.container.removeEventListener("pointermove",this.onPointermove),this.container.removeEventListener("pointerleave",this.onPointerleave),this.container.removeEventListener("pointercancel",this.onPointerleave),this.container.removeEventListener("pointerout",this.onPointerleave),this.selection.removeEventListener("select",this.onSelectionSelect),this.hoverHelper.removeEventListener("hover-change",this.onHoverChange),this.control.removeEventListener("change",this.onControlChange),this.control.removeEventListener("change-zoom",this.onControlChangeZoom),this.renderer.removeEventListener("update",this.onRendererUpdate)}setPolarAngle(t,e){return e===void 0&&(e=500),this.control.setPolarAngleByDuration(t,!0,e)}setAzimuthalAngle(t,e){return e===void 0&&(e=500),this.control.setAzimuthalAngleDuration(t,!0,e)}getCameraLookAt(){return this.control.getCameraLookAt()}setZoom(t,e,n){return n===void 0&&(n=500),this.control.setZoomByDuration(t,e,!0,n)}getFitCameraToObjectZoom(t,e,n){return e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=!0),this.getFitCameraToBoxZoom(new Ge().setFromObject(t),e,n)}getFitCameraToBoxZoom(t,e,n){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=!0);let[i,o,a,l]=e,{clientSize:{width:c,height:p}}=this,g=this.control.getPolarAngle();n&&this.setPolarAngle(0,0),this.setPolarAngle(g,0);let{max:m,min:y}=t,x=new G(y.x,m.y,m.z),S=new G(m.x,m.y,m.z),w=new G(m.x,y.y,y.z),E=new G(y.x,y.y,y.z),b=bn(x,this.camera,c,p),C=bn(S,this.camera,c,p),A=bn(E,this.camera,c,p),R=bn(w,this.camera,c,p),F=new uh().setFromPoints([new ft(b.x,b.y),new ft(C.x,C.y),new ft(A.x,A.y),new ft(R.x,R.y)]).getSize(new ft),O=(c-o-l)/F.x,N=(p-i-a)/F.y,ot=Math.min(O,N),D=new G((m.x+y.x)/2,(m.y+y.y)/2,(m.z+y.z)/2),W=ot*this.camera.zoom,X=this.camera.clone();X.zoom=W,X.updateMatrix();let Rt=(o-l)/2,et=(i-a)/2;if(Rt){let xt=new G;xt.setFromMatrixColumn(X.matrix,0),xt.normalize(),xt.multiplyScalar(Rt/W),D.add(xt)}if(et){let xt=new G;xt.setFromMatrixColumn(X.matrix,1),xt.normalize(),xt.multiplyScalar(et/W),D.add(xt)}return{zoom:ot*this.camera.zoom,center:D}}fitCameraToObject(t,e,n,i){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=500),i===void 0&&(i=!0);let{zoom:o,center:a}=this.getFitCameraToObjectZoom(t,e,i);return this.setZoom(o,a,n)}fitCameraToBox(t,e,n,i){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=500),i===void 0&&(i=!0);let{zoom:o,center:a}=this.getFitCameraToBoxZoom(t,e,i);return this.setZoom(o,a,n)}getFitCameraToGroundZoom(t,e,n){if(t===void 0&&(t=[20,20,20,20]),e===void 0&&(e=500),n===void 0&&(n=!0),this.currentFloor&&this.currentFloor.hasElement)return this.getFitCameraToObjectZoom(this.currentFloor.groundUpper,t,n).zoom}fitCameraToGround(t,e,n){return t===void 0&&(t=[20,20,20,20]),e===void 0&&(e=500),n===void 0&&(n=!0),this.currentFloor&&this.currentFloor.hasElement?this.fitCameraToObject(this.currentFloor.groundLayer,t,e,n):Promise.resolve(!1)}setCameraPosition(t,e){return St(this,null,function*(){return this.control.setCameraPositionByTarget(t,e)})}pauseRender(){this.renderer.pauseRender()}continueRender(){this.renderer.continueRender()}forceUpdate(){this.collisionSystem.needsUpdate=!0}dispose(){var t;this.collisionSystem.dispose(),(t=this.currentFloor)==null||t.dispose(),this.control.dispose(),this.cameraBound.dispose(),this.selection.dispose(),this.hoverHelper.dispose(),this.unRegistryEvent(),this.renderer.dispose(),this.lights.children.forEach(e=>e.dispose()),this.scene.dispose(),this.container=null,this.renderer=null}constructor(t,e){super(),this.container=t,this.renderer=new T_,this.lights=dM(),this.range=yr([]),this.clientSize={width:0,height:0,x:0,y:0},this.renderRf=0,this.basicZoom=1,this.onControlChange=()=>{this.dispatchEvent({type:"change-ratio",px:(this.basicRatio||0)*this.camera.zoom}),this.dispatchEvent({type:"control-change"})},this.onControlChangeZoom=n=>{let{zoom:i}=n;this.dispatchEvent({type:"control-zoom-change",zoom:i})},this.onRendererUpdate=()=>{this.dispatchEvent({type:"update"})},this.onWindowResize=()=>{let{container:n,camera:i,renderer:o}=this,{clientWidth:a,clientHeight:l}=n;a=Math.max(1,a),l=Math.max(1,l),i.left=-a/2,i.right=a/2,i.top=l/2,i.bottom=-l/2,i.updateProjectionMatrix(),o.setSize(a,l),this.resizeClientSize(),this.dispatchEvent({type:"resize",width:a,height:l})},this.onClick=n=>{let{graphics:i,position:o}=this.getGraphicsByDeviceXy(n.offsetX,n.offsetY);i.length&&this.dispatchEvent({type:"graphic-click",graphics:i,position:o});let a=this.getPoisByDeviceXy(n.offsetX,n.offsetY);a.length&&this.dispatchEvent({type:"poi-click",pois:a})},this.onPointerover=n=>{let{graphics:i,position:o}=this.getGraphicsByDeviceXy(n.offsetX,n.offsetY),a=this.getPoisByDeviceXy(n.offsetX,n.offsetY);this.dispatchEvent({type:"pointer-over",e:n,graphics:i,pois:a,position:o})},this.onPointermove=n=>{let{graphics:i,position:o}=this.getGraphicsByDeviceXy(n.offsetX,n.offsetY),a=this.getPoisByDeviceXy(n.offsetX,n.offsetY);this.dispatchEvent({type:"pointer-move",e:n,graphics:i,pois:a,position:o})},this.onPointerleave=n=>{this.dispatchEvent({type:"pointer-level"})},this.onSelectionSelect=n=>{let{graphics:i,isMultipleSelect:o}=n;this.dispatchEvent({type:"select-graphic",graphics:i,isMultipleSelect:o})},this.onHoverChange=n=>{let{graphics:i}=n;this.dispatchEvent({type:"hover",graphics:i})},this.bmap=e,this.container.style.position="relative",this.container.style.overflow="hidden",this.scene=new A_(this.renderer),this.collisionSystem=new q6(this),this.init(),this.selection=new b_(this),this.hoverHelper=new M_(this),this.resizeClientSize(),this.registryEvent()}};var a8=V(Ws(),1),u8={placeId:0,apiDomain:"",apiInfo:{},apiPath:{floorGraphic:"/api/inception-map/floor/get",floorRange:"/api/inception-map/range/get",equipmentList:"/api/inception-map/equipment/get",roadNetwork:"/api/inception-map/road_network/get",loadPlaceInfo:"https://screen.aibee.cn/ai-map/map/get-floor-map"},enableBoxSelect:!0,resizeObserver:!1,initTransToMark:!1,heatMap:{radius:50,minOpacity:.1,gradient:{0:"#8F9FCD",.5:"#6284FF",1:"#F95D5D"}},useFloorCache:!0,control:{maxPolar:1.2,defaultPolar:1.1,defaultAzimuthal:0,maxZoomScale:30},defaultPadding:[20,20,20,20],svg:{circle:{radius:"2",fill:"#1CADFF"},line:{stroke:"#1CADFF"}},selectBox:{stroke:"#1CADFF",fill:"rgba(28, 173, 255, 0.3)"},hover:{time:100},ground:{color:"#F6F6F6",opacity:1,height:.001,stroke:!1,strokeColor:"#E6E6E6",strokeOpacity:1},markGraphic:{color:"#EEF0F3",opacity:1,height:.001,stroke:!1,strokeColor:"#000",strokeOpacity:1},graphic:{fillOpacity:1},cameraBound:{padding:[150,150,150,150]},poi:{boxScale:1},loaderPlaceConfig:{textFontSize:14}};function GI(r){return(0,a8.merge)({},u8,r)}var p8=V(Ws(),1);var Cse=V(De(),1);var xse=V(cn(),1),Ese=V(De(),1);var mse=V(tf(),1);var Mg=function(r){return r.LAYERED_RENDER_VERSION="layeredRender",r.MERGED_RENDER_VERSION="mergedRender",r}({});function X6(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 j6(r,t){let e=r.poi_info.showName||r.store_name||r.poi_info.text;switch(t){case"zh-cn":return e;case"en":var n;return((n=r.infra_info_ext)==null?void 0:n.poi_name)||e;case"zh-hk":var i;return((i=r.infra_info_ext)==null?void 0:i.traditional_name)||e}}var kI=["range","ground","store","facility","parkingSpace"];function l8(r){return kI.indexOf(r.l_type)===-1?kI.length:kI.indexOf(r.l_type)}function Vbt(r){r.layers.sort((t,e)=>l8(t)-l8(e))}function Hbt(r){let t=r.layers.find(n=>n.l_type==="range"),e=[t.elements[0].center_x,t.elements[0].center_y];r.layers.map(n=>{if(n.l_type!=="range")return Ry(n.elements,e)})}function R_(r){Vbt(r),Hbt(r)}function wg(r,t){return t===void 0&&(t=5),r.floor_id+"_"+r.version_id+(t?"_"+t:"")}function c8(r,t,e){switch(r.l_type){case"ground":return VI(r,t);case"graph":return Wbt(r,t);case"wall":return qbt(r,t);case"lane":return Xbt(r,t);case"texture2d":case"texture3d":return jbt(r,t);case"glb":return Ybt(r,t);case"store":return Zbt(r,t,e);case"facility":return Kbt(r,t,e);case"parkingSpace":return Qbt(r,t,e);case"text":return eMt(r,t)}}function h8(r,t,e,n,i){switch(r.l_type){case"store":return $bt(r,t,e,n,i);case"facility":return Jbt(r,t,e,n,i);case"parkingSpace":return tMt(r,t,n,i)}}function Wbt(r,t){t.mergeGraphicLayer.addGraphics(r.elements,r.mergedElements)}function VI(r,t){let e=r.elements.map(n=>new wo(t.context,Jt({},n,{dashed:!1})));t.addGrounds(e)}function qbt(r,t){if(r.mergedElements)r.mergedElements.map(e=>{if(e.instancedGeometry){let n=new S_(t.context,e.instancedGeometry);t.wallLayer.add(n)}if(e.mergedGeometry){let n=new x_(t.context,e);t.wallLayer.add(n)}});else{let e=r.elements.reduce((n,i)=>{let{fillColor:o,fillOpacity:a,strokeColor:l,strokeOpacity:c,height:p}=i,g=o.toLowerCase()+"-"+a+"-"+l.toLowerCase()+"-"+c+"-"+p;return c===0&&(g=o.toLowerCase()+"-"+a+"-"+p),n[g]?n[g].push(i):n[g]=[i],n},{});Object.values(e).forEach(n=>{let i=new y_(t.context,n);t.wallLayer.add(i)})}}function Xbt(r,t){if(r.mergedElements){let e=new E_(t.context,r.mergedElements);t.laneLayer.add(e)}else{let e=new __(t.context,r.elements);t.laneLayer.add(e)}}function jbt(r,t){if(r.mergedMatrixes)r.mergedMatrixes.map(e=>{let n=new zh(t.context,e);t.textureLayer.add(n)});else if(r.elements.length){let e=new Bh(t.context,r.elements);t.textureLayer.add(e)}}function Ybt(r,t){t.glbModelLayer.addModels(r.elements.map(e=>Jt({},e,{url:e.secondUrl,rotate:e.secondRotate,width:e.secondWidth,center_x:e.center_coord_x,center_y:e.center_coord_y,deltaHeight:0})))}function Zbt(r,t,e){e.mergeGraphic?t.mergeGraphicLayer.addGraphics(r.elements,r.mergedElements):r.elements.map(n=>{let i=t.addGraphic(Jt({},n,{dashed:!1}));t.userData.graphics.push(i),t.userData.graphicMap.set(n.id,i)})}function $bt(r,t,e,n,i){r.elements.filter(o=>i.filterPoi(o)).map(o=>{try{let a=X6(o,e),l=new Di(t.context,{id:o.id,icon:o.poi_info.showImageUrl||o.poi_info.icon,text:a,position:{x:o.center_coord_x,y:o.center_coord_y,z:o.airHeight+o.height},icon_size:[24,24],level:o.poi_info.level||0,hide_text:!n.showStoreName,maxWeight:o.poi_info.maxWeight||25,minWeight:o.poi_info.minWeight||1,text_font_size:n.textFontSize});t.poiLayer2.pushPoi(l),l&&(l.userData.type="store",l.userData.data=o,l.userData.floor=t.name)}catch(a){console.log("\u521B\u5EFA\u5E97\u94FApoi\u5931\u8D25",a,o)}})}function Kbt(r,t,e){e.mergeGraphic?t.mergeGraphicLayer.addGraphics(r.elements,r.mergedElements):r.elements.map(n=>{let i=t.addGraphic(Jt({},n,{dashed:!1}));t.userData.graphics.push(i),t.userData.graphicMap.set(n.id,i)})}function Jbt(r,t,e,n,i){r.elements.filter(o=>o.poi_info).filter(o=>i.filterPoi(o)).map(o=>{try{let a=j6(o,e),l=new Di(t.context,{id:o.id,icon:o.poi_info.showImageUrl||o.poi_info.icon,text:a,position:{x:o.center_coord_x,y:o.center_coord_y,z:o.airHeight+o.height},icon_size:[24,24],level:o.poi_info.level||0,hide_text:!n.showFacilityName,maxWeight:o.poi_info.maxWeight||25,minWeight:o.poi_info.minWeight||1,text_font_size:n.textFontSize});t.poiLayer2.pushPoi(l),l.userData.type="facility",l.userData.data=o,l.userData.floor=t.name}catch(a){console.log("\u6DFB\u52A0facility\u5931\u8D25",a,o)}})}function Qbt(r,t,e){t.parkingSpaceLayer.load(r,e.mergeParkingSpace),t.userData.parkingSpaces=t.parkingSpaceLayer.graphicMap.values(),t.userData.parkingSpacesGraphicMap=t.parkingSpaceLayer.graphicMap}function tMt(r,t,e,n){return St(this,null,function*(){r.elements.filter(o=>o.texts[0]).filter(o=>n.filterPoi(o)).forEach(o=>{try{let a=o.displayName||o.texts[0],l=new Di(t.context,{id:o.id,text:a,position:{x:o.center_coord_x,y:o.center_coord_y,z:o.airHeight+o.height},text_font_size:e.textFontSize});l&&(l.userData.type="parkingSpace",l.userData.data=o,l.userData.floor=t.name),t.poiLayer2.pushPoi(l)}catch(a){console.log("\u6DFB\u52A0\u8F66\u4F4Dpoi\u5931\u8D25",a,o)}})})}function eMt(r,t){let e=new v_(t.context,r.elements.map(n=>Jt({},n,{center_x:n.center_coord_x,center_y:n.center_coord_y})));t.textTextureLayer.add(e)}function HI(){let r=new Blob([`var $D=Object.create;var U1=Object.defineProperty;var ZD=Object.getOwnPropertyDescriptor;var JD=Object.getOwnPropertyNames;var jD=Object.getPrototypeOf,KD=Object.prototype.hasOwnProperty;var X=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var QD=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of JD(t))!KD.call(n,s)&&s!==e&&U1(n,s,{get:()=>t[s],enumerable:!(i=ZD(t,s))||i.enumerable});return n};var jt=(n,t,e)=>(e=n!=null?$D(jD(n)):{},QD(t||!n||!n.__esModule?U1(e,"default",{value:n,enumerable:!0}):e,n));var Ri=(n,t,e)=>new Promise((i,s)=>{var u=p=>{try{f(e.next(p))}catch(d){s(d)}},c=p=>{try{f(e.throw(p))}catch(d){s(d)}},f=p=>p.done?i(p.value):Promise.resolve(p.value).then(u,c);f((e=e.apply(n,t)).next())});var Sn=X((zg,B1)=>{"use strict";var Mc=function(n){return n&&n.Math===Math&&n};B1.exports=Mc(typeof globalThis=="object"&&globalThis)||Mc(typeof window=="object"&&window)||Mc(typeof self=="object"&&self)||Mc(typeof global=="object"&&global)||Mc(typeof zg=="object"&&zg)||function(){return this}()||Function("return this")()});var An=X((vet,z1)=>{"use strict";z1.exports=function(n){try{return!!n()}catch(t){return!0}}});var ri=X((_et,G1)=>{"use strict";var t3=An();G1.exports=!t3(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var bc=X((xet,k1)=>{"use strict";var e3=An();k1.exports=!e3(function(){var n=function(){}.bind();return typeof n!="function"||n.hasOwnProperty("prototype")})});var vr=X((Eet,q1)=>{"use strict";var n3=bc(),th=Function.prototype.call;q1.exports=n3?th.bind(th):function(){return th.apply(th,arguments)}});var X1=X(W1=>{"use strict";var V1={}.propertyIsEnumerable,H1=Object.getOwnPropertyDescriptor,r3=H1&&!V1.call({1:2},1);W1.f=r3?function(t){var e=H1(this,t);return!!e&&e.enumerable}:V1});var Ac=X((Met,Y1)=>{"use strict";Y1.exports=function(n,t){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:t}}});var In=X((bet,J1)=>{"use strict";var $1=bc(),Z1=Function.prototype,Gg=Z1.call,i3=$1&&Z1.bind.bind(Gg,Gg);J1.exports=$1?i3:function(n){return function(){return Gg.apply(n,arguments)}}});var vs=X((Aet,K1)=>{"use strict";var j1=In(),o3=j1({}.toString),s3=j1("".slice);K1.exports=function(n){return s3(o3(n),8,-1)}});var eh=X((Tet,Q1)=>{"use strict";var a3=In(),u3=An(),l3=vs(),kg=Object,c3=a3("".split);Q1.exports=u3(function(){return!kg("z").propertyIsEnumerable(0)})?function(n){return l3(n)==="String"?c3(n,""):kg(n)}:kg});var nh=X((Cet,tE)=>{"use strict";tE.exports=function(n){return n==null}});var zu=X((Iet,eE)=>{"use strict";var f3=nh(),h3=TypeError;eE.exports=function(n){if(f3(n))throw new h3("Can't call method on "+n);return n}});var Gu=X((Pet,nE)=>{"use strict";var p3=eh(),d3=zu();nE.exports=function(n){return p3(d3(n))}});var er=X((Ret,rE)=>{"use strict";var qg=typeof document=="object"&&document.all;rE.exports=typeof qg=="undefined"&&qg!==void 0?function(n){return typeof n=="function"||n===qg}:function(n){return typeof n=="function"}});var Ei=X((Let,iE)=>{"use strict";var g3=er();iE.exports=function(n){return typeof n=="object"?n!==null:g3(n)}});var $s=X((Net,oE)=>{"use strict";var Vg=Sn(),m3=er(),y3=function(n){return m3(n)?n:void 0};oE.exports=function(n,t){return arguments.length<2?y3(Vg[n]):Vg[n]&&Vg[n][t]}});var Tc=X((Oet,sE)=>{"use strict";var v3=In();sE.exports=v3({}.isPrototypeOf)});var ku=X((Det,lE)=>{"use strict";var _3=Sn(),aE=_3.navigator,uE=aE&&aE.userAgent;lE.exports=uE?String(uE):""});var Cc=X((Fet,gE)=>{"use strict";var dE=Sn(),Hg=ku(),cE=dE.process,fE=dE.Deno,hE=cE&&cE.versions||fE&&fE.version,pE=hE&&hE.v8,wo,rh;pE&&(wo=pE.split("."),rh=wo[0]>0&&wo[0]<4?1:+(wo[0]+wo[1]));!rh&&Hg&&(wo=Hg.match(/Edge\\/(\\d+)/),(!wo||wo[1]>=74)&&(wo=Hg.match(/Chrome\\/(\\d+)/),wo&&(rh=+wo[1])));gE.exports=rh});var ih=X((Uet,yE)=>{"use strict";var mE=Cc(),x3=An(),E3=Sn(),S3=E3.String;yE.exports=!!Object.getOwnPropertySymbols&&!x3(function(){var n=Symbol("symbol detection");return!S3(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&mE&&mE<41})});var Wg=X((Bet,vE)=>{"use strict";var w3=ih();vE.exports=w3&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Ic=X((zet,_E)=>{"use strict";var M3=$s(),b3=er(),A3=Tc(),T3=Wg(),C3=Object;_E.exports=T3?function(n){return typeof n=="symbol"}:function(n){var t=M3("Symbol");return b3(t)&&A3(t.prototype,C3(n))}});var qu=X((Get,xE)=>{"use strict";var I3=String;xE.exports=function(n){try{return I3(n)}catch(t){return"Object"}}});var _s=X((ket,EE)=>{"use strict";var P3=er(),R3=qu(),L3=TypeError;EE.exports=function(n){if(P3(n))return n;throw new L3(R3(n)+" is not a function")}});var Pc=X((qet,SE)=>{"use strict";var N3=_s(),O3=nh();SE.exports=function(n,t){var e=n[t];return O3(e)?void 0:N3(e)}});var ME=X((Vet,wE)=>{"use strict";var Xg=vr(),Yg=er(),$g=Ei(),D3=TypeError;wE.exports=function(n,t){var e,i;if(t==="string"&&Yg(e=n.toString)&&!$g(i=Xg(e,n))||Yg(e=n.valueOf)&&!$g(i=Xg(e,n))||t!=="string"&&Yg(e=n.toString)&&!$g(i=Xg(e,n)))return i;throw new D3("Can't convert object to primitive value")}});var Rc=X((Het,bE)=>{"use strict";bE.exports=!1});var oh=X((Wet,TE)=>{"use strict";var AE=Sn(),F3=Object.defineProperty;TE.exports=function(n,t){try{F3(AE,n,{value:t,configurable:!0,writable:!0})}catch(e){AE[n]=t}return t}});var sh=X((Xet,PE)=>{"use strict";var U3=Rc(),B3=Sn(),z3=oh(),CE="__core-js_shared__",IE=PE.exports=B3[CE]||z3(CE,{});(IE.versions||(IE.versions=[])).push({version:"3.42.0",mode:U3?"pure":"global",copyright:"\\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var ah=X((Yet,LE)=>{"use strict";var RE=sh();LE.exports=function(n,t){return RE[n]||(RE[n]=t||{})}});var Vi=X(($et,NE)=>{"use strict";var G3=zu(),k3=Object;NE.exports=function(n){return k3(G3(n))}});var oo=X((Zet,OE)=>{"use strict";var q3=In(),V3=Vi(),H3=q3({}.hasOwnProperty);OE.exports=Object.hasOwn||function(t,e){return H3(V3(t),e)}});var uh=X((Jet,DE)=>{"use strict";var W3=In(),X3=0,Y3=Math.random(),$3=W3(1 .toString);DE.exports=function(n){return"Symbol("+(n===void 0?"":n)+")_"+$3(++X3+Y3,36)}});var Xr=X((jet,UE)=>{"use strict";var Z3=Sn(),J3=ah(),FE=oo(),j3=uh(),K3=ih(),Q3=Wg(),Vu=Z3.Symbol,Zg=J3("wks"),tF=Q3?Vu.for||Vu:Vu&&Vu.withoutSetter||j3;UE.exports=function(n){return FE(Zg,n)||(Zg[n]=K3&&FE(Vu,n)?Vu[n]:tF("Symbol."+n)),Zg[n]}});var Jg=X((Ket,GE)=>{"use strict";var eF=vr(),BE=Ei(),zE=Ic(),nF=Pc(),rF=ME(),iF=Xr(),oF=TypeError,sF=iF("toPrimitive");GE.exports=function(n,t){if(!BE(n)||zE(n))return n;var e=nF(n,sF),i;if(e){if(t===void 0&&(t="default"),i=eF(e,n,t),!BE(i)||zE(i))return i;throw new oF("Can't convert object to primitive value")}return t===void 0&&(t="number"),rF(n,t)}});var lh=X((Qet,kE)=>{"use strict";var aF=Jg(),uF=Ic();kE.exports=function(n){var t=aF(n,"string");return uF(t)?t:t+""}});var ch=X((tnt,VE)=>{"use strict";var lF=Sn(),qE=Ei(),jg=lF.document,cF=qE(jg)&&qE(jg.createElement);VE.exports=function(n){return cF?jg.createElement(n):{}}});var Kg=X((ent,HE)=>{"use strict";var fF=ri(),hF=An(),pF=ch();HE.exports=!fF&&!hF(function(){return Object.defineProperty(pF("div"),"a",{get:function(){return 7}}).a!==7})});var fh=X(XE=>{"use strict";var dF=ri(),gF=vr(),mF=X1(),yF=Ac(),vF=Gu(),_F=lh(),xF=oo(),EF=Kg(),WE=Object.getOwnPropertyDescriptor;XE.f=dF?WE:function(t,e){if(t=vF(t),e=_F(e),EF)try{return WE(t,e)}catch(i){}if(xF(t,e))return yF(!gF(mF.f,t,e),t[e])}});var Qg=X((rnt,YE)=>{"use strict";var SF=ri(),wF=An();YE.exports=SF&&wF(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var so=X((int,$E)=>{"use strict";var MF=Ei(),bF=String,AF=TypeError;$E.exports=function(n){if(MF(n))return n;throw new AF(bF(n)+" is not an object")}});var Wo=X(JE=>{"use strict";var TF=ri(),CF=Kg(),IF=Qg(),hh=so(),ZE=lh(),PF=TypeError,tm=Object.defineProperty,RF=Object.getOwnPropertyDescriptor,em="enumerable",nm="configurable",rm="writable";JE.f=TF?IF?function(t,e,i){if(hh(t),e=ZE(e),hh(i),typeof t=="function"&&e==="prototype"&&"value"in i&&rm in i&&!i[rm]){var s=RF(t,e);s&&s[rm]&&(t[e]=i.value,i={configurable:nm in i?i[nm]:s[nm],enumerable:em in i?i[em]:s[em],writable:!1})}return tm(t,e,i)}:tm:function(t,e,i){if(hh(t),e=ZE(e),hh(i),CF)try{return tm(t,e,i)}catch(s){}if("get"in i||"set"in i)throw new PF("Accessors not supported");return"value"in i&&(t[e]=i.value),t}});var xs=X((snt,jE)=>{"use strict";var LF=ri(),NF=Wo(),OF=Ac();jE.exports=LF?function(n,t,e){return NF.f(n,t,OF(1,e))}:function(n,t,e){return n[t]=e,n}});var ph=X((ant,QE)=>{"use strict";var im=ri(),DF=oo(),KE=Function.prototype,FF=im&&Object.getOwnPropertyDescriptor,om=DF(KE,"name"),UF=om&&function(){}.name==="something",BF=om&&(!im||im&&FF(KE,"name").configurable);QE.exports={EXISTS:om,PROPER:UF,CONFIGURABLE:BF}});var am=X((unt,tS)=>{"use strict";var zF=In(),GF=er(),sm=sh(),kF=zF(Function.toString);GF(sm.inspectSource)||(sm.inspectSource=function(n){return kF(n)});tS.exports=sm.inspectSource});var rS=X((lnt,nS)=>{"use strict";var qF=Sn(),VF=er(),eS=qF.WeakMap;nS.exports=VF(eS)&&/native code/.test(String(eS))});var dh=X((cnt,oS)=>{"use strict";var HF=ah(),WF=uh(),iS=HF("keys");oS.exports=function(n){return iS[n]||(iS[n]=WF(n))}});var gh=X((fnt,sS)=>{"use strict";sS.exports={}});var Va=X((hnt,lS)=>{"use strict";var XF=rS(),uS=Sn(),YF=Ei(),$F=xs(),um=oo(),lm=sh(),ZF=dh(),JF=gh(),aS="Object already initialized",cm=uS.TypeError,jF=uS.WeakMap,mh,Lc,yh,KF=function(n){return yh(n)?Lc(n):mh(n,{})},QF=function(n){return function(t){var e;if(!YF(t)||(e=Lc(t)).type!==n)throw new cm("Incompatible receiver, "+n+" required");return e}};XF||lm.state?(Mo=lm.state||(lm.state=new jF),Mo.get=Mo.get,Mo.has=Mo.has,Mo.set=Mo.set,mh=function(n,t){if(Mo.has(n))throw new cm(aS);return t.facade=n,Mo.set(n,t),t},Lc=function(n){return Mo.get(n)||{}},yh=function(n){return Mo.has(n)}):(qa=ZF("state"),JF[qa]=!0,mh=function(n,t){if(um(n,qa))throw new cm(aS);return t.facade=n,$F(n,qa,t),t},Lc=function(n){return um(n,qa)?n[qa]:{}},yh=function(n){return um(n,qa)});var Mo,qa;lS.exports={set:mh,get:Lc,has:yh,enforce:KF,getterFor:QF}});var pm=X((pnt,hS)=>{"use strict";var hm=In(),tU=An(),eU=er(),vh=oo(),fm=ri(),nU=ph().CONFIGURABLE,rU=am(),fS=Va(),iU=fS.enforce,oU=fS.get,cS=String,_h=Object.defineProperty,sU=hm("".slice),aU=hm("".replace),uU=hm([].join),lU=fm&&!tU(function(){return _h(function(){},"length",{value:8}).length!==8}),cU=String(String).split("String"),fU=hS.exports=function(n,t,e){sU(cS(t),0,7)==="Symbol("&&(t="["+aU(cS(t),/^Symbol\\(([^)]*)\\).*$/,"$1")+"]"),e&&e.getter&&(t="get "+t),e&&e.setter&&(t="set "+t),(!vh(n,"name")||nU&&n.name!==t)&&(fm?_h(n,"name",{value:t,configurable:!0}):n.name=t),lU&&e&&vh(e,"arity")&&n.length!==e.arity&&_h(n,"length",{value:e.arity});try{e&&vh(e,"constructor")&&e.constructor?fm&&_h(n,"prototype",{writable:!1}):n.prototype&&(n.prototype=void 0)}catch(s){}var i=iU(n);return vh(i,"source")||(i.source=uU(cU,typeof t=="string"?t:"")),n};Function.prototype.toString=fU(function(){return eU(this)&&oU(this).source||rU(this)},"toString")});var Ha=X((dnt,pS)=>{"use strict";var hU=er(),pU=Wo(),dU=pm(),gU=oh();pS.exports=function(n,t,e,i){i||(i={});var s=i.enumerable,u=i.name!==void 0?i.name:t;if(hU(e)&&dU(e,u,i),i.global)s?n[t]=e:gU(t,e);else{try{i.unsafe?n[t]&&(s=!0):delete n[t]}catch(c){}s?n[t]=e:pU.f(n,t,{value:e,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return n}});var gS=X((gnt,dS)=>{"use strict";var mU=Math.ceil,yU=Math.floor;dS.exports=Math.trunc||function(t){var e=+t;return(e>0?yU:mU)(e)}});var Hi=X((mnt,mS)=>{"use strict";var vU=gS();mS.exports=function(n){var t=+n;return t!==t||t===0?0:vU(t)}});var xh=X((ynt,yS)=>{"use strict";var _U=Hi(),xU=Math.max,EU=Math.min;yS.exports=function(n,t){var e=_U(n);return e<0?xU(e+t,0):EU(e,t)}});var Wa=X((vnt,vS)=>{"use strict";var SU=Hi(),wU=Math.min;vS.exports=function(n){var t=SU(n);return t>0?wU(t,9007199254740991):0}});var ii=X((_nt,_S)=>{"use strict";var MU=Wa();_S.exports=function(n){return MU(n.length)}});var SS=X((xnt,ES)=>{"use strict";var bU=Gu(),AU=xh(),TU=ii(),xS=function(n){return function(t,e,i){var s=bU(t),u=TU(s);if(u===0)return!n&&-1;var c=AU(i,u),f;if(n&&e!==e){for(;u>c;)if(f=s[c++],f!==f)return!0}else for(;u>c;c++)if((n||c in s)&&s[c]===e)return n||c||0;return!n&&-1}};ES.exports={includes:xS(!0),indexOf:xS(!1)}});var gm=X((Ent,MS)=>{"use strict";var CU=In(),dm=oo(),IU=Gu(),PU=SS().indexOf,RU=gh(),wS=CU([].push);MS.exports=function(n,t){var e=IU(n),i=0,s=[],u;for(u in e)!dm(RU,u)&&dm(e,u)&&wS(s,u);for(;t.length>i;)dm(e,u=t[i++])&&(~PU(s,u)||wS(s,u));return s}});var Eh=X((Snt,bS)=>{"use strict";bS.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var mm=X(AS=>{"use strict";var LU=gm(),NU=Eh(),OU=NU.concat("length","prototype");AS.f=Object.getOwnPropertyNames||function(t){return LU(t,OU)}});var CS=X(TS=>{"use strict";TS.f=Object.getOwnPropertySymbols});var PS=X((bnt,IS)=>{"use strict";var DU=$s(),FU=In(),UU=mm(),BU=CS(),zU=so(),GU=FU([].concat);IS.exports=DU("Reflect","ownKeys")||function(t){var e=UU.f(zU(t)),i=BU.f;return i?GU(e,i(t)):e}});var ym=X((Ant,LS)=>{"use strict";var RS=oo(),kU=PS(),qU=fh(),VU=Wo();LS.exports=function(n,t,e){for(var i=kU(t),s=VU.f,u=qU.f,c=0;c<i.length;c++){var f=i[c];!RS(n,f)&&!(e&&RS(e,f))&&s(n,f,u(t,f))}}});var OS=X((Tnt,NS)=>{"use strict";var HU=An(),WU=er(),XU=/#|\\.prototype\\./,Nc=function(n,t){var e=$U[YU(n)];return e===JU?!0:e===ZU?!1:WU(t)?HU(t):!!t},YU=Nc.normalize=function(n){return String(n).replace(XU,".").toLowerCase()},$U=Nc.data={},ZU=Nc.NATIVE="N",JU=Nc.POLYFILL="P";NS.exports=Nc});var sr=X((Cnt,DS)=>{"use strict";var Sh=Sn(),jU=fh().f,KU=xs(),QU=Ha(),tB=oh(),eB=ym(),nB=OS();DS.exports=function(n,t){var e=n.target,i=n.global,s=n.stat,u,c,f,p,d,g;if(i?c=Sh:s?c=Sh[e]||tB(e,{}):c=Sh[e]&&Sh[e].prototype,c)for(f in t){if(d=t[f],n.dontCallGetSet?(g=jU(c,f),p=g&&g.value):p=c[f],u=nB(i?f:e+(s?".":"#")+f,n.forced),!u&&p!==void 0){if(typeof d==typeof p)continue;eB(d,p)}(n.sham||p&&p.sham)&&KU(d,"sham",!0),QU(c,f,d,n)}}});var Oc=X((Int,FS)=>{"use strict";var rB=vs();FS.exports=Array.isArray||function(t){return rB(t)==="Array"}});var vm=X((Pnt,US)=>{"use strict";var iB=ri(),oB=Oc(),sB=TypeError,aB=Object.getOwnPropertyDescriptor,uB=iB&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(n){return n instanceof TypeError}}();US.exports=uB?function(n,t){if(oB(n)&&!aB(n,"length").writable)throw new sB("Cannot set read only .length");return n.length=t}:function(n,t){return n.length=t}});var wh=X((Rnt,BS)=>{"use strict";var lB=TypeError,cB=9007199254740991;BS.exports=function(n){if(n>cB)throw lB("Maximum allowed index exceeded");return n}});var Mh=X(()=>{"use strict";var fB=sr(),hB=Vi(),pB=ii(),dB=vm(),gB=wh(),mB=An(),yB=mB(function(){return[].push.call({length:4294967296},1)!==4294967297}),vB=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(n){return n instanceof TypeError}},_B=yB||!vB();fB({target:"Array",proto:!0,arity:1,forced:_B},{push:function(t){var e=hB(this),i=pB(e),s=arguments.length;gB(i+s);for(var u=0;u<s;u++)e[i]=arguments[u],i++;return dB(e,i),i}})});var zS=X(()=>{"use strict";var xB=sr(),EB=vr();xB({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return EB(URL.prototype.toString,this)}})});var kS=X((Fnt,GS)=>{"use strict";GS.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 HS=X((Unt,VS)=>{"use strict";var SB=ch(),_m=SB("span").classList,qS=_m&&_m.constructor&&_m.constructor.prototype;VS.exports=qS===Object.prototype?void 0:qS});var XS=X((Bnt,WS)=>{"use strict";var wB=gm(),MB=Eh();WS.exports=Object.keys||function(t){return wB(t,MB)}});var $S=X(YS=>{"use strict";var bB=ri(),AB=Qg(),TB=Wo(),CB=so(),IB=Gu(),PB=XS();YS.f=bB&&!AB?Object.defineProperties:function(t,e){CB(t);for(var i=IB(e),s=PB(e),u=s.length,c=0,f;u>c;)TB.f(t,f=s[c++],i[f]);return t}});var JS=X((Gnt,ZS)=>{"use strict";var RB=$s();ZS.exports=RB("document","documentElement")});var Hu=X((knt,rw)=>{"use strict";var LB=so(),NB=$S(),jS=Eh(),OB=gh(),DB=JS(),FB=ch(),UB=dh(),KS=">",QS="<",Em="prototype",Sm="script",ew=UB("IE_PROTO"),xm=function(){},nw=function(n){return QS+Sm+KS+n+QS+"/"+Sm+KS},tw=function(n){n.write(nw("")),n.close();var t=n.parentWindow.Object;return n=null,t},BB=function(){var n=FB("iframe"),t="java"+Sm+":",e;return n.style.display="none",DB.appendChild(n),n.src=String(t),e=n.contentWindow.document,e.open(),e.write(nw("document.F=Object")),e.close(),e.F},bh,Ah=function(){try{bh=new ActiveXObject("htmlfile")}catch(t){}Ah=typeof document!="undefined"?document.domain&&bh?tw(bh):BB():tw(bh);for(var n=jS.length;n--;)delete Ah[Em][jS[n]];return Ah()};OB[ew]=!0;rw.exports=Object.create||function(t,e){var i;return t!==null?(xm[Em]=LB(t),i=new xm,xm[Em]=null,i[ew]=t):i=Ah(),e===void 0?i:NB.f(i,e)}});var bm=X((qnt,iw)=>{"use strict";var zB=Xr(),GB=Hu(),kB=Wo().f,wm=zB("unscopables"),Mm=Array.prototype;Mm[wm]===void 0&&kB(Mm,wm,{configurable:!0,value:GB(null)});iw.exports=function(n){Mm[wm][n]=!0}});var Wu=X((Vnt,ow)=>{"use strict";ow.exports={}});var aw=X((Hnt,sw)=>{"use strict";var qB=An();sw.exports=!qB(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype})});var Dc=X((Wnt,lw)=>{"use strict";var VB=oo(),HB=er(),WB=Vi(),XB=dh(),YB=aw(),uw=XB("IE_PROTO"),Am=Object,$B=Am.prototype;lw.exports=YB?Am.getPrototypeOf:function(n){var t=WB(n);if(VB(t,uw))return t[uw];var e=t.constructor;return HB(e)&&t instanceof e?e.prototype:t instanceof Am?$B:null}});var Pm=X((Xnt,hw)=>{"use strict";var ZB=An(),JB=er(),jB=Ei(),KB=Hu(),cw=Dc(),QB=Ha(),tz=Xr(),ez=Rc(),Im=tz("iterator"),fw=!1,Es,Tm,Cm;[].keys&&(Cm=[].keys(),"next"in Cm?(Tm=cw(cw(Cm)),Tm!==Object.prototype&&(Es=Tm)):fw=!0);var nz=!jB(Es)||ZB(function(){var n={};return Es[Im].call(n)!==n});nz?Es={}:ez&&(Es=KB(Es));JB(Es[Im])||QB(Es,Im,function(){return this});hw.exports={IteratorPrototype:Es,BUGGY_SAFARI_ITERATORS:fw}});var Fc=X((Ynt,dw)=>{"use strict";var rz=Wo().f,iz=oo(),oz=Xr(),pw=oz("toStringTag");dw.exports=function(n,t,e){n&&!e&&(n=n.prototype),n&&!iz(n,pw)&&rz(n,pw,{configurable:!0,value:t})}});var mw=X(($nt,gw)=>{"use strict";var sz=Pm().IteratorPrototype,az=Hu(),uz=Ac(),lz=Fc(),cz=Wu(),fz=function(){return this};gw.exports=function(n,t,e,i){var s=t+" Iterator";return n.prototype=az(sz,{next:uz(+!i,e)}),lz(n,s,!1,!0),cz[s]=fz,n}});var Uc=X((Znt,yw)=>{"use strict";var hz=In(),pz=_s();yw.exports=function(n,t,e){try{return hz(pz(Object.getOwnPropertyDescriptor(n,t)[e]))}catch(i){}}});var _w=X((Jnt,vw)=>{"use strict";var dz=Ei();vw.exports=function(n){return dz(n)||n===null}});var Ew=X((jnt,xw)=>{"use strict";var gz=_w(),mz=String,yz=TypeError;xw.exports=function(n){if(gz(n))return n;throw new yz("Can't set "+mz(n)+" as a prototype")}});var Xu=X((Knt,Sw)=>{"use strict";var vz=Uc(),_z=Ei(),xz=zu(),Ez=Ew();Sw.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var n=!1,t={},e;try{e=vz(Object.prototype,"__proto__","set"),e(t,[]),n=t instanceof Array}catch(i){}return function(s,u){return xz(s),Ez(u),_z(s)&&(n?e(s,u):s.__proto__=u),s}}():void 0)});var Nw=X((Qnt,Lw)=>{"use strict";var Sz=sr(),wz=vr(),Th=Rc(),Pw=ph(),Mz=er(),bz=mw(),ww=Dc(),Mw=Xu(),Az=Fc(),Tz=xs(),Rm=Ha(),Cz=Xr(),bw=Wu(),Rw=Pm(),Iz=Pw.PROPER,Pz=Pw.CONFIGURABLE,Aw=Rw.IteratorPrototype,Ch=Rw.BUGGY_SAFARI_ITERATORS,Bc=Cz("iterator"),Tw="keys",zc="values",Cw="entries",Iw=function(){return this};Lw.exports=function(n,t,e,i,s,u,c){bz(e,t,i);var f=function(x){if(x===s&&v)return v;if(!Ch&&x&&x in g)return g[x];switch(x){case Tw:return function(){return new e(this,x)};case zc:return function(){return new e(this,x)};case Cw:return function(){return new e(this,x)}}return function(){return new e(this)}},p=t+" Iterator",d=!1,g=n.prototype,y=g[Bc]||g["@@iterator"]||s&&g[s],v=!Ch&&y||f(s),E=t==="Array"&&g.entries||y,M,A,_;if(E&&(M=ww(E.call(new n)),M!==Object.prototype&&M.next&&(!Th&&ww(M)!==Aw&&(Mw?Mw(M,Aw):Mz(M[Bc])||Rm(M,Bc,Iw)),Az(M,p,!0,!0),Th&&(bw[p]=Iw))),Iz&&s===zc&&y&&y.name!==zc&&(!Th&&Pz?Tz(g,"name",zc):(d=!0,v=function(){return wz(y,this)})),s)if(A={values:f(zc),keys:u?v:f(Tw),entries:f(Cw)},c)for(_ in A)(Ch||d||!(_ in g))&&Rm(g,_,A[_]);else Sz({target:t,proto:!0,forced:Ch||d},A);return(!Th||c)&&g[Bc]!==v&&Rm(g,Bc,v,{name:s}),bw[t]=v,A}});var Dw=X((trt,Ow)=>{"use strict";Ow.exports=function(n,t){return{value:n,done:t}}});var kw=X((ert,Gw)=>{"use strict";var Rz=Gu(),Lm=bm(),Fw=Wu(),Bw=Va(),Lz=Wo().f,Nz=Nw(),Ih=Dw(),Oz=Rc(),Dz=ri(),zw="Array Iterator",Fz=Bw.set,Uz=Bw.getterFor(zw);Gw.exports=Nz(Array,"Array",function(n,t){Fz(this,{type:zw,target:Rz(n),index:0,kind:t})},function(){var n=Uz(this),t=n.target,e=n.index++;if(!t||e>=t.length)return n.target=null,Ih(void 0,!0);switch(n.kind){case"keys":return Ih(e,!1);case"values":return Ih(t[e],!1)}return Ih([e,t[e]],!1)},"values");var Uw=Fw.Arguments=Fw.Array;Lm("keys");Lm("values");Lm("entries");if(!Oz&&Dz&&Uw.name!=="values")try{Lz(Uw,"name",{value:"values"})}catch(n){}});var Yu=X(()=>{"use strict";var qw=Sn(),Hw=kS(),Bz=HS(),Gc=kw(),Vw=xs(),zz=Fc(),Gz=Xr(),Nm=Gz("iterator"),Om=Gc.values,Ww=function(n,t){if(n){if(n[Nm]!==Om)try{Vw(n,Nm,Om)}catch(i){n[Nm]=Om}if(zz(n,t,!0),Hw[t]){for(var e in Gc)if(n[e]!==Gc[e])try{Vw(n,e,Gc[e])}catch(i){n[e]=Gc[e]}}}};for(Ph in Hw)Ww(qw[Ph]&&qw[Ph].prototype,Ph);var Ph;Ww(Bz,"DOMTokenList")});var Rh=X((irt,Xw)=>{"use strict";var kz=vs(),qz=In();Xw.exports=function(n){if(kz(n)==="Function")return qz(n)}});var kc=X((ort,$w)=>{"use strict";var Yw=Rh(),Vz=_s(),Hz=bc(),Wz=Yw(Yw.bind);$w.exports=function(n,t){return Vz(n),t===void 0?n:Hz?Wz(n,t):function(){return n.apply(t,arguments)}}});var jw=X((srt,Jw)=>{"use strict";var Xz=Oc(),Yz=ii(),$z=wh(),Zz=kc(),Zw=function(n,t,e,i,s,u,c,f){for(var p=s,d=0,g=c?Zz(c,f):!1,y,v;d<i;)d in e&&(y=g?g(e[d],d,t):e[d],u>0&&Xz(y)?(v=Yz(y),p=Zw(n,t,y,v,p,u-1)-1):($z(p+1),n[p]=y),p++),d++;return p};Jw.exports=Zw});var tM=X((art,Qw)=>{"use strict";var Jz=Xr(),jz=Jz("toStringTag"),Kw={};Kw[jz]="z";Qw.exports=String(Kw)==="[object z]"});var Zs=X((urt,eM)=>{"use strict";var Kz=tM(),Qz=er(),Lh=vs(),tG=Xr(),eG=tG("toStringTag"),nG=Object,rG=Lh(function(){return arguments}())==="Arguments",iG=function(n,t){try{return n[t]}catch(e){}};eM.exports=Kz?Lh:function(n){var t,e,i;return n===void 0?"Undefined":n===null?"Null":typeof(e=iG(t=nG(n),eG))=="string"?e:rG?Lh(t):(i=Lh(t))==="Object"&&Qz(t.callee)?"Arguments":i}});var Fm=X((lrt,sM)=>{"use strict";var oG=In(),sG=An(),nM=er(),aG=Zs(),uG=$s(),lG=am(),rM=function(){},iM=uG("Reflect","construct"),Dm=/^\\s*(?:class|function)\\b/,cG=oG(Dm.exec),fG=!Dm.test(rM),qc=function(t){if(!nM(t))return!1;try{return iM(rM,[],t),!0}catch(e){return!1}},oM=function(t){if(!nM(t))return!1;switch(aG(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return fG||!!cG(Dm,lG(t))}catch(e){return!0}};oM.sham=!0;sM.exports=!iM||sG(function(){var n;return qc(qc.call)||!qc(Object)||!qc(function(){n=!0})||n})?oM:qc});var cM=X((crt,lM)=>{"use strict";var aM=Oc(),hG=Fm(),pG=Ei(),dG=Xr(),gG=dG("species"),uM=Array;lM.exports=function(n){var t;return aM(n)&&(t=n.constructor,hG(t)&&(t===uM||aM(t.prototype))?t=void 0:pG(t)&&(t=t[gG],t===null&&(t=void 0))),t===void 0?uM:t}});var Um=X((frt,fM)=>{"use strict";var mG=cM();fM.exports=function(n,t){return new(mG(n))(t===0?0:t)}});var hM=X(()=>{"use strict";var yG=sr(),vG=jw(),_G=Vi(),xG=ii(),EG=Hi(),SG=Um();yG({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=_G(this),i=xG(e),s=SG(e,0);return s.length=vG(s,e,e,i,0,t===void 0?1:EG(t)),s}})});var pM=X(()=>{"use strict";var wG=bm();wG("flat")});var vM=X((mrt,yM)=>{"use strict";var MG=Xr(),gM=MG("iterator"),mM=!1;try{dM=0,Bm={next:function(){return{done:!!dM++}},return:function(){mM=!0}},Bm[gM]=function(){return this},Array.from(Bm,function(){throw 2})}catch(n){}var dM,Bm;yM.exports=function(n,t){try{if(!t&&!mM)return!1}catch(s){return!1}var e=!1;try{var i={};i[gM]=function(){return{next:function(){return{done:e=!0}}}},n(i)}catch(s){}return e}});var Nh=X((yrt,_M)=>{"use strict";_M.exports=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"});var $u=X((vrt,EM)=>{"use strict";var xM=pm(),bG=Wo();EM.exports=function(n,t,e){return e.get&&xM(e.get,t,{getter:!0}),e.set&&xM(e.set,t,{setter:!0}),bG.f(n,t,e)}});var Wi=X((_rt,RM)=>{"use strict";var AG=Nh(),qm=ri(),Si=Sn(),bM=er(),Fh=Ei(),js=oo(),Vm=Zs(),TG=qu(),CG=xs(),zm=Ha(),IG=$u(),PG=Tc(),Uh=Dc(),Ju=Xu(),RG=Xr(),LG=uh(),AM=Va(),TM=AM.enforce,NG=AM.get,Oh=Si.Int8Array,Gm=Oh&&Oh.prototype,SM=Si.Uint8ClampedArray,wM=SM&&SM.prototype,Xo=Oh&&Uh(Oh),bo=Gm&&Uh(Gm),OG=Object.prototype,Hm=Si.TypeError,MM=RG("toStringTag"),km=LG("TYPED_ARRAY_TAG"),Dh="TypedArrayConstructor",Ss=AG&&!!Ju&&Vm(Si.opera)!=="Opera",CM=!1,Li,Js,Zu,ws={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Wm={BigInt64Array:8,BigUint64Array:8},DG=function(t){if(!Fh(t))return!1;var e=Vm(t);return e==="DataView"||js(ws,e)||js(Wm,e)},IM=function(n){var t=Uh(n);if(Fh(t)){var e=NG(t);return e&&js(e,Dh)?e[Dh]:IM(t)}},PM=function(n){if(!Fh(n))return!1;var t=Vm(n);return js(ws,t)||js(Wm,t)},FG=function(n){if(PM(n))return n;throw new Hm("Target is not a typed array")},UG=function(n){if(bM(n)&&(!Ju||PG(Xo,n)))return n;throw new Hm(TG(n)+" is not a typed array constructor")},BG=function(n,t,e,i){if(qm){if(e)for(var s in ws){var u=Si[s];if(u&&js(u.prototype,n))try{delete u.prototype[n]}catch(c){try{u.prototype[n]=t}catch(f){}}}(!bo[n]||e)&&zm(bo,n,e?t:Ss&&Gm[n]||t,i)}},zG=function(n,t,e){var i,s;if(qm){if(Ju){if(e){for(i in ws)if(s=Si[i],s&&js(s,n))try{delete s[n]}catch(u){}}if(!Xo[n]||e)try{return zm(Xo,n,e?t:Ss&&Xo[n]||t)}catch(u){}else return}for(i in ws)s=Si[i],s&&(!s[n]||e)&&zm(s,n,t)}};for(Li in ws)Js=Si[Li],Zu=Js&&Js.prototype,Zu?TM(Zu)[Dh]=Js:Ss=!1;for(Li in Wm)Js=Si[Li],Zu=Js&&Js.prototype,Zu&&(TM(Zu)[Dh]=Js);if((!Ss||!bM(Xo)||Xo===Function.prototype)&&(Xo=function(){throw new Hm("Incorrect invocation")},Ss))for(Li in ws)Si[Li]&&Ju(Si[Li],Xo);if((!Ss||!bo||bo===OG)&&(bo=Xo.prototype,Ss))for(Li in ws)Si[Li]&&Ju(Si[Li].prototype,bo);Ss&&Uh(wM)!==bo&&Ju(wM,bo);if(qm&&!js(bo,MM)){CM=!0,IG(bo,MM,{configurable:!0,get:function(){return Fh(this)?this[km]:void 0}});for(Li in ws)Si[Li]&&CG(Si[Li],km,Li)}RM.exports={NATIVE_ARRAY_BUFFER_VIEWS:Ss,TYPED_ARRAY_TAG:CM&&km,aTypedArray:FG,aTypedArrayConstructor:UG,exportTypedArrayMethod:BG,exportTypedArrayStaticMethod:zG,getTypedArrayConstructor:IM,isView:DG,isTypedArray:PM,TypedArray:Xo,TypedArrayPrototype:bo}});var OM=X((xrt,NM)=>{"use strict";var LM=Sn(),Xm=An(),GG=vM(),kG=Wi().NATIVE_ARRAY_BUFFER_VIEWS,qG=LM.ArrayBuffer,Xa=LM.Int8Array;NM.exports=!kG||!Xm(function(){Xa(1)})||!Xm(function(){new Xa(-1)})||!GG(function(n){new Xa,new Xa(null),new Xa(1.5),new Xa(n)},!0)||Xm(function(){return new Xa(new qG(2),1,void 0).length!==1})});var FM=X((Ert,DM)=>{"use strict";var VG=Ha();DM.exports=function(n,t,e){for(var i in t)VG(n,i,t[i],e);return n}});var Ym=X((Srt,UM)=>{"use strict";var HG=Tc(),WG=TypeError;UM.exports=function(n,t){if(HG(t,n))return n;throw new WG("Incorrect invocation")}});var Bh=X((wrt,BM)=>{"use strict";var XG=Hi(),YG=Wa(),$G=RangeError;BM.exports=function(n){if(n===void 0)return 0;var t=XG(n),e=YG(t);if(t!==e)throw new $G("Wrong length or index");return e}});var GM=X((Mrt,zM)=>{"use strict";zM.exports=Math.sign||function(t){var e=+t;return e===0||e!==e?e:e<0?-1:1}});var VM=X((brt,qM)=>{"use strict";var ZG=2220446049250313e-31,kM=1/ZG;qM.exports=function(n){return n+kM-kM}});var WM=X((Art,HM)=>{"use strict";var JG=GM(),jG=VM(),KG=Math.abs,QG=2220446049250313e-31;HM.exports=function(n,t,e,i){var s=+n,u=KG(s),c=JG(s);if(u<i)return c*jG(u/i/t)*i*t;var f=(1+t/QG)*u,p=f-(f-u);return p>e||p!==p?c*(1/0):c*p}});var YM=X((Trt,XM)=>{"use strict";var t4=WM(),e4=11920928955078125e-23,n4=34028234663852886e22,r4=11754943508222875e-54;XM.exports=Math.fround||function(t){return t4(t,e4,n4,r4)}});var ZM=X((Crt,$M)=>{"use strict";var i4=Array,o4=Math.abs,Ms=Math.pow,s4=Math.floor,a4=Math.log,u4=Math.LN2,l4=function(n,t,e){var i=i4(e),s=e*8-t-1,u=(1<<s)-1,c=u>>1,f=t===23?Ms(2,-24)-Ms(2,-77):0,p=n<0||n===0&&1/n<0?1:0,d=0,g,y,v;for(n=o4(n),n!==n||n===1/0?(y=n!==n?1:0,g=u):(g=s4(a4(n)/u4),v=Ms(2,-g),n*v<1&&(g--,v*=2),g+c>=1?n+=f/v:n+=f*Ms(2,1-c),n*v>=2&&(g++,v/=2),g+c>=u?(y=0,g=u):g+c>=1?(y=(n*v-1)*Ms(2,t),g+=c):(y=n*Ms(2,c-1)*Ms(2,t),g=0));t>=8;)i[d++]=y&255,y/=256,t-=8;for(g=g<<t|y,s+=t;s>0;)i[d++]=g&255,g/=256,s-=8;return i[d-1]|=p*128,i},c4=function(n,t){var e=n.length,i=e*8-t-1,s=(1<<i)-1,u=s>>1,c=i-7,f=e-1,p=n[f--],d=p&127,g;for(p>>=7;c>0;)d=d*256+n[f--],c-=8;for(g=d&(1<<-c)-1,d>>=-c,c+=t;c>0;)g=g*256+n[f--],c-=8;if(d===0)d=1-u;else{if(d===s)return g?NaN:p?-1/0:1/0;g+=Ms(2,t),d-=u}return(p?-1:1)*g*Ms(2,d-t)};$M.exports={pack:l4,unpack:c4}});var $m=X((Irt,jM)=>{"use strict";var f4=Vi(),JM=xh(),h4=ii();jM.exports=function(t){for(var e=f4(this),i=h4(e),s=arguments.length,u=JM(s>1?arguments[1]:void 0,i),c=s>2?arguments[2]:void 0,f=c===void 0?i:JM(c,i);f>u;)e[u++]=t;return e}});var zh=X((Prt,KM)=>{"use strict";var p4=In();KM.exports=p4([].slice)});var Zm=X((Rrt,tb)=>{"use strict";var d4=er(),g4=Ei(),QM=Xu();tb.exports=function(n,t,e){var i,s;return QM&&d4(i=t.constructor)&&i!==e&&g4(s=i.prototype)&&s!==e.prototype&&QM(n,s),n}});var Xh=X((Lrt,yb)=>{"use strict";var Hh=Sn(),t0=In(),Jm=ri(),m4=Nh(),hb=ph(),y4=xs(),v4=$u(),eb=FM(),jm=An(),Gh=Ym(),_4=Hi(),x4=Wa(),qh=Bh(),E4=YM(),pb=ZM(),S4=Dc(),nb=Xu(),w4=$m(),M4=zh(),b4=Zm(),A4=ym(),db=Fc(),e0=Va(),T4=hb.PROPER,rb=hb.CONFIGURABLE,Ku="ArrayBuffer",Wh="DataView",Qu="prototype",C4="Wrong length",gb="Wrong index",ib=e0.getterFor(Ku),Hc=e0.getterFor(Wh),ob=e0.set,Ao=Hh[Ku],Xi=Ao,ju=Xi&&Xi[Qu],Yo=Hh[Wh],Ya=Yo&&Yo[Qu],sb=Object.prototype,I4=Hh.Array,Vh=Hh.RangeError,P4=t0(w4),R4=t0([].reverse),mb=pb.pack,ab=pb.unpack,ub=function(n){return[n&255]},lb=function(n){return[n&255,n>>8&255]},cb=function(n){return[n&255,n>>8&255,n>>16&255,n>>24&255]},fb=function(n){return n[3]<<24|n[2]<<16|n[1]<<8|n[0]},L4=function(n){return mb(E4(n),23,4)},N4=function(n){return mb(n,52,8)},kh=function(n,t,e){v4(n[Qu],t,{configurable:!0,get:function(){return e(this)[t]}})},Ks=function(n,t,e,i){var s=Hc(n),u=qh(e),c=!!i;if(u+t>s.byteLength)throw new Vh(gb);var f=s.bytes,p=u+s.byteOffset,d=M4(f,p,p+t);return c?d:R4(d)},Qs=function(n,t,e,i,s,u){var c=Hc(n),f=qh(e),p=i(+s),d=!!u;if(f+t>c.byteLength)throw new Vh(gb);for(var g=c.bytes,y=f+c.byteOffset,v=0;v<t;v++)g[y+v]=p[d?v:t-v-1]};m4?(Km=T4&&Ao.name!==Ku,!jm(function(){Ao(1)})||!jm(function(){new Ao(-1)})||jm(function(){return new Ao,new Ao(1.5),new Ao(NaN),Ao.length!==1||Km&&!rb})?(Xi=function(t){return Gh(this,ju),b4(new Ao(qh(t)),this,Xi)},Xi[Qu]=ju,ju.constructor=Xi,A4(Xi,Ao)):Km&&rb&&y4(Ao,"name",Ku),nb&&S4(Ya)!==sb&&nb(Ya,sb),Vc=new Yo(new Xi(2)),Qm=t0(Ya.setInt8),Vc.setInt8(0,2147483648),Vc.setInt8(1,2147483649),(Vc.getInt8(0)||!Vc.getInt8(1))&&eb(Ya,{setInt8:function(t,e){Qm(this,t,e<<24>>24)},setUint8:function(t,e){Qm(this,t,e<<24>>24)}},{unsafe:!0})):(Xi=function(t){Gh(this,ju);var e=qh(t);ob(this,{type:Ku,bytes:P4(I4(e),0),byteLength:e}),Jm||(this.byteLength=e,this.detached=!1)},ju=Xi[Qu],Yo=function(t,e,i){Gh(this,Ya),Gh(t,ju);var s=ib(t),u=s.byteLength,c=_4(e);if(c<0||c>u)throw new Vh("Wrong offset");if(i=i===void 0?u-c:x4(i),c+i>u)throw new Vh(C4);ob(this,{type:Wh,buffer:t,byteLength:i,byteOffset:c,bytes:s.bytes}),Jm||(this.buffer=t,this.byteLength=i,this.byteOffset=c)},Ya=Yo[Qu],Jm&&(kh(Xi,"byteLength",ib),kh(Yo,"buffer",Hc),kh(Yo,"byteLength",Hc),kh(Yo,"byteOffset",Hc)),eb(Ya,{getInt8:function(t){return Ks(this,1,t)[0]<<24>>24},getUint8:function(t){return Ks(this,1,t)[0]},getInt16:function(t){var e=Ks(this,2,t,arguments.length>1?arguments[1]:!1);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=Ks(this,2,t,arguments.length>1?arguments[1]:!1);return e[1]<<8|e[0]},getInt32:function(t){return fb(Ks(this,4,t,arguments.length>1?arguments[1]:!1))},getUint32:function(t){return fb(Ks(this,4,t,arguments.length>1?arguments[1]:!1))>>>0},getFloat32:function(t){return ab(Ks(this,4,t,arguments.length>1?arguments[1]:!1),23)},getFloat64:function(t){return ab(Ks(this,8,t,arguments.length>1?arguments[1]:!1),52)},setInt8:function(t,e){Qs(this,1,t,ub,e)},setUint8:function(t,e){Qs(this,1,t,ub,e)},setInt16:function(t,e){Qs(this,2,t,lb,e,arguments.length>2?arguments[2]:!1)},setUint16:function(t,e){Qs(this,2,t,lb,e,arguments.length>2?arguments[2]:!1)},setInt32:function(t,e){Qs(this,4,t,cb,e,arguments.length>2?arguments[2]:!1)},setUint32:function(t,e){Qs(this,4,t,cb,e,arguments.length>2?arguments[2]:!1)},setFloat32:function(t,e){Qs(this,4,t,L4,e,arguments.length>2?arguments[2]:!1)},setFloat64:function(t,e){Qs(this,8,t,N4,e,arguments.length>2?arguments[2]:!1)}}));var Km,Vc,Qm;db(Xi,Ku);db(Yo,Wh);yb.exports={ArrayBuffer:Xi,DataView:Yo}});var _b=X((Nrt,vb)=>{"use strict";var O4=Ei(),D4=Math.floor;vb.exports=Number.isInteger||function(t){return!O4(t)&&isFinite(t)&&D4(t)===t}});var Eb=X((Ort,xb)=>{"use strict";var F4=Hi(),U4=RangeError;xb.exports=function(n){var t=F4(n);if(t<0)throw new U4("The argument can't be less than 0");return t}});var n0=X((Drt,Sb)=>{"use strict";var B4=Eb(),z4=RangeError;Sb.exports=function(n,t){var e=B4(n);if(e%t)throw new z4("Wrong offset");return e}});var Mb=X((Frt,wb)=>{"use strict";var G4=Math.round;wb.exports=function(n){var t=G4(n);return t<0?0:t>255?255:t&255}});var Ab=X((Urt,bb)=>{"use strict";var k4=Fm(),q4=qu(),V4=TypeError;bb.exports=function(n){if(k4(n))return n;throw new V4(q4(n)+" is not a constructor")}});var r0=X((Brt,Cb)=>{"use strict";var H4=Zs(),Tb=Pc(),W4=nh(),X4=Wu(),Y4=Xr(),$4=Y4("iterator");Cb.exports=function(n){if(!W4(n))return Tb(n,$4)||Tb(n,"@@iterator")||X4[H4(n)]}});var Pb=X((zrt,Ib)=>{"use strict";var Z4=vr(),J4=_s(),j4=so(),K4=qu(),Q4=r0(),tk=TypeError;Ib.exports=function(n,t){var e=arguments.length<2?Q4(n):t;if(J4(e))return j4(Z4(e,n));throw new tk(K4(n)+" is not iterable")}});var Lb=X((Grt,Rb)=>{"use strict";var ek=Xr(),nk=Wu(),rk=ek("iterator"),ik=Array.prototype;Rb.exports=function(n){return n!==void 0&&(nk.Array===n||ik[rk]===n)}});var i0=X((krt,Nb)=>{"use strict";var ok=Zs();Nb.exports=function(n){var t=ok(n);return t==="BigInt64Array"||t==="BigUint64Array"}});var Yh=X((qrt,Ob)=>{"use strict";var sk=Jg(),ak=TypeError;Ob.exports=function(n){var t=sk(n,"number");if(typeof t=="number")throw new ak("Can't convert number to bigint");return BigInt(t)}});var Fb=X((Vrt,Db)=>{"use strict";var uk=kc(),lk=vr(),ck=Ab(),fk=Vi(),hk=ii(),pk=Pb(),dk=r0(),gk=Lb(),mk=i0(),yk=Wi().aTypedArrayConstructor,vk=Yh();Db.exports=function(t){var e=ck(this),i=fk(t),s=arguments.length,u=s>1?arguments[1]:void 0,c=u!==void 0,f=dk(i),p,d,g,y,v,E,M,A;if(f&&!gk(f))for(M=pk(i,f),A=M.next,i=[];!(E=lk(A,M)).done;)i.push(E.value);for(c&&s>2&&(u=uk(u,arguments[2])),d=hk(i),g=new(yk(e))(d),y=mk(g),p=0;d>p;p++)v=c?u(i[p],p):i[p],g[p]=y?vk(v):+v;return g}});var zb=X((Hrt,Bb)=>{"use strict";var _k=kc(),xk=In(),Ek=eh(),Sk=Vi(),wk=ii(),Mk=Um(),Ub=xk([].push),ta=function(n){var t=n===1,e=n===2,i=n===3,s=n===4,u=n===6,c=n===7,f=n===5||u;return function(p,d,g,y){for(var v=Sk(p),E=Ek(v),M=wk(E),A=_k(d,g),_=0,x=y||Mk,T=t?x(p,M):e||c?x(p,0):void 0,w,R;M>_;_++)if((f||_ in E)&&(w=E[_],R=A(w,_,v),n))if(t)T[_]=R;else if(R)switch(n){case 3:return!0;case 5:return w;case 6:return _;case 2:Ub(T,w)}else switch(n){case 4:return!1;case 7:Ub(T,w)}return u?-1:i||s?s:T}};Bb.exports={forEach:ta(0),map:ta(1),filter:ta(2),some:ta(3),every:ta(4),find:ta(5),findIndex:ta(6),filterReject:ta(7)}});var o0=X((Wrt,kb)=>{"use strict";var bk=$s(),Ak=$u(),Tk=Xr(),Ck=ri(),Gb=Tk("species");kb.exports=function(n){var t=bk(n);Ck&&t&&!t[Gb]&&Ak(t,Gb,{configurable:!0,get:function(){return this}})}});var s0=X((Xrt,qb)=>{"use strict";var Ik=ii();qb.exports=function(n,t,e){for(var i=0,s=arguments.length>2?e:Ik(t),u=new n(s);s>i;)u[i]=t[i++];return u}});var uA=X((Yrt,p0)=>{"use strict";var Vb=sr(),tA=Sn(),Hb=vr(),Pk=ri(),Rk=OM(),$c=Wi(),eA=Xh(),Wb=Ym(),Lk=Ac(),Wc=xs(),Nk=_b(),Ok=Wa(),Xb=Bh(),a0=n0(),Dk=Mb(),nA=lh(),Xc=oo(),Fk=Zs(),c0=Ei(),Uk=Ic(),Bk=Hu(),zk=Tc(),$h=Xu(),Gk=mm().f,Yb=Fb(),kk=zb().forEach,qk=o0(),Vk=$u(),rA=Wo(),iA=fh(),$b=s0(),d0=Va(),Hk=Zm(),f0=d0.get,Wk=d0.set,Xk=d0.enforce,oA=rA.f,Yk=iA.f,u0=tA.RangeError,sA=eA.ArrayBuffer,$k=sA.prototype,Zk=eA.DataView,Zh=$c.NATIVE_ARRAY_BUFFER_VIEWS,Zb=$c.TYPED_ARRAY_TAG,Jb=$c.TypedArray,Yc=$c.TypedArrayPrototype,h0=$c.isTypedArray,Jh="BYTES_PER_ELEMENT",l0="Wrong length",jh=function(n,t){Vk(n,t,{configurable:!0,get:function(){return f0(this)[t]}})},jb=function(n){var t;return zk($k,n)||(t=Fk(n))==="ArrayBuffer"||t==="SharedArrayBuffer"},aA=function(n,t){return h0(n)&&!Uk(t)&&t in n&&Nk(+t)&&t>=0},Kb=function(t,e){return e=nA(e),aA(t,e)?Lk(2,t[e]):Yk(t,e)},Qb=function(t,e,i){return e=nA(e),aA(t,e)&&c0(i)&&Xc(i,"value")&&!Xc(i,"get")&&!Xc(i,"set")&&!i.configurable&&(!Xc(i,"writable")||i.writable)&&(!Xc(i,"enumerable")||i.enumerable)?(t[e]=i.value,t):oA(t,e,i)};Pk?(Zh||(iA.f=Kb,rA.f=Qb,jh(Yc,"buffer"),jh(Yc,"byteOffset"),jh(Yc,"byteLength"),jh(Yc,"length")),Vb({target:"Object",stat:!0,forced:!Zh},{getOwnPropertyDescriptor:Kb,defineProperty:Qb}),p0.exports=function(n,t,e){var i=n.match(/\\d+/)[0]/8,s=n+(e?"Clamped":"")+"Array",u="get"+n,c="set"+n,f=tA[s],p=f,d=p&&p.prototype,g={},y=function(A,_){var x=f0(A);return x.view[u](_*i+x.byteOffset,!0)},v=function(A,_,x){var T=f0(A);T.view[c](_*i+T.byteOffset,e?Dk(x):x,!0)},E=function(A,_){oA(A,_,{get:function(){return y(this,_)},set:function(x){return v(this,_,x)},enumerable:!0})};Zh?Rk&&(p=t(function(A,_,x,T){return Wb(A,d),Hk(function(){return c0(_)?jb(_)?T!==void 0?new f(_,a0(x,i),T):x!==void 0?new f(_,a0(x,i)):new f(_):h0(_)?$b(p,_):Hb(Yb,p,_):new f(Xb(_))}(),A,p)}),$h&&$h(p,Jb),kk(Gk(f),function(A){A in p||Wc(p,A,f[A])}),p.prototype=d):(p=t(function(A,_,x,T){Wb(A,d);var w=0,R=0,z,U,D;if(!c0(_))D=Xb(_),U=D*i,z=new sA(U);else if(jb(_)){z=_,R=a0(x,i);var P=_.byteLength;if(T===void 0){if(P%i)throw new u0(l0);if(U=P-R,U<0)throw new u0(l0)}else if(U=Ok(T)*i,U+R>P)throw new u0(l0);D=U/i}else return h0(_)?$b(p,_):Hb(Yb,p,_);for(Wk(A,{buffer:z,byteOffset:R,byteLength:U,length:D,view:new Zk(z)});w<D;)E(A,w++)}),$h&&$h(p,Jb),d=p.prototype=Bk(Yc)),d.constructor!==p&&Wc(d,"constructor",p),Xk(d).TypedArrayConstructor=p,Zb&&Wc(d,Zb,s);var M=p!==f;g[s]=p,Vb({global:!0,constructor:!0,forced:M,sham:!Zh},g),Jh in p||Wc(p,Jh,i),Jh in d||Wc(d,Jh,i),qk(s)}):p0.exports=function(){}});var g0=X(()=>{"use strict";var Jk=uA();Jk("Float32",function(n){return function(e,i,s){return n(this,e,i,s)}})});var m0=X(()=>{"use strict";var lA=Wi(),jk=ii(),Kk=Hi(),Qk=lA.aTypedArray,tq=lA.exportTypedArrayMethod;tq("at",function(t){var e=Qk(this),i=jk(e),s=Kk(t),u=s>=0?s:i+s;return u<0||u>=i?void 0:e[u]})});var y0=X(()=>{"use strict";var cA=Wi(),eq=$m(),nq=Yh(),rq=Zs(),iq=vr(),oq=In(),sq=An(),aq=cA.aTypedArray,uq=cA.exportTypedArrayMethod,lq=oq("".slice),cq=sq(function(){var n=0;return new Int8Array(2).fill({valueOf:function(){return n++}}),n!==1});uq("fill",function(t){var e=arguments.length;aq(this);var i=lq(rq(this),0,3)==="Big"?nq(t):+t;return iq(eq,this,i,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)},cq)});var v0=X((tit,hA)=>{"use strict";var fq=kc(),hq=eh(),pq=Vi(),dq=ii(),fA=function(n){var t=n===1;return function(e,i,s){for(var u=pq(e),c=hq(u),f=dq(c),p=fq(i,s),d,g;f-- >0;)if(d=c[f],g=p(d,f,u),g)switch(n){case 0:return d;case 1:return f}return t?-1:void 0}};hA.exports={findLast:fA(0),findLastIndex:fA(1)}});var _0=X(()=>{"use strict";var pA=Wi(),gq=v0().findLast,mq=pA.aTypedArray,yq=pA.exportTypedArrayMethod;yq("findLast",function(t){return gq(mq(this),t,arguments.length>1?arguments[1]:void 0)})});var x0=X(()=>{"use strict";var dA=Wi(),vq=v0().findLastIndex,_q=dA.aTypedArray,xq=dA.exportTypedArrayMethod;xq("findLastIndex",function(t){return vq(_q(this),t,arguments.length>1?arguments[1]:void 0)})});var M0=X(()=>{"use strict";var mA=Sn(),yA=vr(),w0=Wi(),Eq=ii(),Sq=n0(),wq=Vi(),vA=An(),Mq=mA.RangeError,E0=mA.Int8Array,gA=E0&&E0.prototype,_A=gA&&gA.set,bq=w0.aTypedArray,Aq=w0.exportTypedArrayMethod,S0=!vA(function(){var n=new Uint8ClampedArray(2);return yA(_A,n,{length:1,0:3},1),n[1]!==3}),Tq=S0&&w0.NATIVE_ARRAY_BUFFER_VIEWS&&vA(function(){var n=new E0(2);return n.set(1),n.set("2",1),n[0]!==0||n[1]!==2});Aq("set",function(t){bq(this);var e=Sq(arguments.length>1?arguments[1]:void 0,1),i=wq(t);if(S0)return yA(_A,this,i,e);var s=this.length,u=Eq(i),c=0;if(u+e>s)throw new Mq("Wrong length");for(;c<u;)this[e+c]=i[c++]},!S0||Tq)});var A0=X((ait,EA)=>{"use strict";var xA=zh(),Cq=Math.floor,b0=function(n,t){var e=n.length;if(e<8)for(var i=1,s,u;i<e;){for(u=i,s=n[i];u&&t(n[u-1],s)>0;)n[u]=n[--u];u!==i++&&(n[u]=s)}else for(var c=Cq(e/2),f=b0(xA(n,0,c),t),p=b0(xA(n,c),t),d=f.length,g=p.length,y=0,v=0;y<d||v<g;)n[y+v]=y<d&&v<g?t(f[y],p[v])<=0?f[y++]:p[v++]:y<d?f[y++]:p[v++];return n};EA.exports=b0});var T0=X((uit,wA)=>{"use strict";var Iq=ku(),SA=Iq.match(/firefox\\/(\\d+)/i);wA.exports=!!SA&&+SA[1]});var C0=X((lit,MA)=>{"use strict";var Pq=ku();MA.exports=/MSIE|Trident/.test(Pq)});var I0=X((cit,AA)=>{"use strict";var Rq=ku(),bA=Rq.match(/AppleWebKit\\/(\\d+)\\./);AA.exports=!!bA&&+bA[1]});var R0=X(()=>{"use strict";var Lq=Sn(),Nq=Rh(),P0=An(),Oq=_s(),Dq=A0(),RA=Wi(),TA=T0(),Fq=C0(),CA=Cc(),IA=I0(),Uq=RA.aTypedArray,Bq=RA.exportTypedArrayMethod,Zc=Lq.Uint16Array,tl=Zc&&Nq(Zc.prototype.sort),zq=!!tl&&!(P0(function(){tl(new Zc(2),null)})&&P0(function(){tl(new Zc(2),{})})),PA=!!tl&&!P0(function(){if(CA)return CA<74;if(TA)return TA<67;if(Fq)return!0;if(IA)return IA<602;var n=new Zc(516),t=Array(516),e,i;for(e=0;e<516;e++)i=e%4,n[e]=515-e,t[e]=e-2*i+3;for(tl(n,function(s,u){return(s/4|0)-(u/4|0)}),e=0;e<516;e++)if(n[e]!==t[e])return!0}),Gq=function(n){return function(t,e){return n!==void 0?+n(t,e)||0:e!==e?-1:t!==t?1:t===0&&e===0?1/t>0&&1/e<0?1:-1:t>e}};Bq("sort",function(t){return t!==void 0&&Oq(t),PA?tl(this,t):Dq(Uq(this),Gq(t))},!PA||zq)});var NA=X((pit,LA)=>{"use strict";var kq=ii();LA.exports=function(n,t){for(var e=kq(n),i=new t(e),s=0;s<e;s++)i[s]=n[e-s-1];return i}});var N0=X(()=>{"use strict";var qq=NA(),L0=Wi(),Vq=L0.aTypedArray,Hq=L0.exportTypedArrayMethod,Wq=L0.getTypedArrayConstructor;Hq("toReversed",function(){return qq(Vq(this),Wq(this))})});var O0=X(()=>{"use strict";var Kh=Wi(),Xq=In(),Yq=_s(),$q=s0(),Zq=Kh.aTypedArray,Jq=Kh.getTypedArrayConstructor,jq=Kh.exportTypedArrayMethod,Kq=Xq(Kh.TypedArrayPrototype.sort);jq("toSorted",function(t){t!==void 0&&Yq(t);var e=Zq(this),i=$q(Jq(e),e);return Kq(i,t)})});var DA=X((vit,OA)=>{"use strict";var Qq=ii(),t5=Hi(),e5=RangeError;OA.exports=function(n,t,e,i){var s=Qq(n),u=t5(e),c=u<0?s+u:u;if(c>=s||c<0)throw new e5("Incorrect index");for(var f=new t(s),p=0;p<s;p++)f[p]=p===c?i:n[p];return f}});var F0=X(()=>{"use strict";var n5=DA(),D0=Wi(),r5=i0(),i5=Hi(),o5=Yh(),s5=D0.aTypedArray,a5=D0.getTypedArrayConstructor,u5=D0.exportTypedArrayMethod,l5=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(n){return n===8}}();u5("with",function(n,t){var e=s5(this),i=i5(n),s=r5(e)?o5(t):+t;return n5(e,a5(e),i,s)},!l5)});var B0=X(()=>{"use strict";var c5=sr(),f5=Sn(),h5=Xh(),p5=o0(),U0="ArrayBuffer",FA=h5[U0],d5=f5[U0];c5({global:!0,constructor:!0,forced:d5!==FA},{ArrayBuffer:FA});p5(U0)});var q0=X(()=>{"use strict";var g5=sr(),G0=Rh(),m5=An(),GA=Xh(),UA=so(),BA=xh(),y5=Wa(),k0=GA.ArrayBuffer,z0=GA.DataView,kA=z0.prototype,zA=G0(k0.prototype.slice),v5=G0(kA.getUint8),_5=G0(kA.setUint8),x5=m5(function(){return!new k0(2).slice(1,void 0).byteLength});g5({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:x5},{slice:function(t,e){if(zA&&e===void 0)return zA(UA(this),t);for(var i=UA(this).byteLength,s=BA(t,i),u=BA(e===void 0?i:e,i),c=new k0(y5(u-s)),f=new z0(this),p=new z0(c),d=0;s<u;)_5(p,d++,v5(f,s++));return c}})});var V0=X((bit,HA)=>{"use strict";var VA=Sn(),E5=Uc(),S5=vs(),qA=VA.ArrayBuffer,w5=VA.TypeError;HA.exports=qA&&E5(qA.prototype,"byteLength","get")||function(n){if(S5(n)!=="ArrayBuffer")throw new w5("ArrayBuffer expected");return n.byteLength}});var H0=X((Ait,WA)=>{"use strict";var M5=Sn(),b5=Nh(),A5=V0(),T5=M5.DataView;WA.exports=function(n){if(!b5||A5(n)!==0)return!1;try{return new T5(n),!1}catch(t){return!0}}});var W0=X(()=>{"use strict";var C5=ri(),I5=$u(),P5=H0(),XA=ArrayBuffer.prototype;C5&&!("detached"in XA)&&I5(XA,"detached",{configurable:!0,get:function(){return P5(this)}})});var $A=X((Iit,YA)=>{"use strict";var R5=H0(),L5=TypeError;YA.exports=function(n){if(R5(n))throw new L5("ArrayBuffer is detached");return n}});var X0=X((Pit,ZA)=>{"use strict";var Jc=Sn(),N5=ku(),O5=vs(),Qh=function(n){return N5.slice(0,n.length)===n};ZA.exports=function(){return Qh("Bun/")?"BUN":Qh("Cloudflare-Workers")?"CLOUDFLARE":Qh("Deno/")?"DENO":Qh("Node.js/")?"NODE":Jc.Bun&&typeof Bun.version=="string"?"BUN":Jc.Deno&&typeof Deno.version=="object"?"DENO":O5(Jc.process)==="process"?"NODE":Jc.window&&Jc.document?"BROWSER":"REST"}()});var jA=X((Rit,JA)=>{"use strict";var D5=X0();JA.exports=D5==="NODE"});var QA=X((Lit,KA)=>{"use strict";var F5=Sn(),U5=jA();KA.exports=function(n){if(U5){try{return F5.process.getBuiltinModule(n)}catch(t){}try{return Function('return require("'+n+'")')()}catch(t){}}}});var Z0=X((Nit,eT)=>{"use strict";var B5=Sn(),z5=An(),Y0=Cc(),$0=X0(),tT=B5.structuredClone;eT.exports=!!tT&&!z5(function(){if($0==="DENO"&&Y0>92||$0==="NODE"&&Y0>94||$0==="BROWSER"&&Y0>97)return!1;var n=new ArrayBuffer(8),t=tT(n,{transfer:[n]});return n.byteLength!==0||t.byteLength!==8})});var oT=X((Oit,iT)=>{"use strict";var Q0=Sn(),G5=QA(),k5=Z0(),q5=Q0.structuredClone,nT=Q0.ArrayBuffer,tp=Q0.MessageChannel,K0=!1,J0,rT,ep,j0;if(k5)K0=function(n){q5(n,{transfer:[n]})};else if(nT)try{tp||(J0=G5("worker_threads"),J0&&(tp=J0.MessageChannel)),tp&&(rT=new tp,ep=new nT(2),j0=function(n){rT.port1.postMessage(null,[n])},ep.byteLength===2&&(j0(ep),ep.byteLength===0&&(K0=j0)))}catch(n){}iT.exports=K0});var oy=X((Dit,hT)=>{"use strict";var ny=Sn(),ry=In(),lT=Uc(),V5=Bh(),H5=$A(),W5=V0(),sT=oT(),ty=Z0(),X5=ny.structuredClone,cT=ny.ArrayBuffer,ey=ny.DataView,Y5=Math.min,iy=cT.prototype,fT=ey.prototype,$5=ry(iy.slice),aT=lT(iy,"resizable","get"),uT=lT(iy,"maxByteLength","get"),Z5=ry(fT.getInt8),J5=ry(fT.setInt8);hT.exports=(ty||sT)&&function(n,t,e){var i=W5(n),s=t===void 0?i:V5(t),u=!aT||!aT(n),c;if(H5(n),ty&&(n=X5(n,{transfer:[n]}),i===s&&(e||u)))return n;if(i>=s&&(!e||u))c=$5(n,0,s);else{var f=e&&!u&&uT?{maxByteLength:uT(n)}:void 0;c=new cT(s,f);for(var p=new ey(n),d=new ey(c),g=Y5(s,i),y=0;y<g;y++)J5(d,y,Z5(p,y))}return ty||sT(n),c}});var sy=X(()=>{"use strict";var j5=sr(),pT=oy();pT&&j5({target:"ArrayBuffer",proto:!0},{transfer:function(){return pT(this,arguments.length?arguments[0]:void 0,!0)}})});var ay=X(()=>{"use strict";var K5=sr(),dT=oy();dT&&K5({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return dT(this,arguments.length?arguments[0]:void 0,!1)}})});var To=X((Git,gT)=>{"use strict";var uy=In(),np=Set.prototype;gT.exports={Set,add:uy(np.add),has:uy(np.has),remove:uy(np.delete),proto:np}});var ea=X((kit,mT)=>{"use strict";var Q5=To().has;mT.exports=function(n){return Q5(n),n}});var na=X((qit,yT)=>{"use strict";var tV=vr();yT.exports=function(n,t,e){for(var i=e?n:n.iterator,s=n.next,u,c;!(u=tV(s,i)).done;)if(c=t(u.value),c!==void 0)return c}});var el=X((Vit,ST)=>{"use strict";var vT=In(),eV=na(),_T=To(),nV=_T.Set,xT=_T.proto,rV=vT(xT.forEach),ET=vT(xT.keys),iV=ET(new nV).next;ST.exports=function(n,t,e){return e?eV({iterator:ET(n),next:iV},t):rV(n,t)}});var rp=X((Hit,MT)=>{"use strict";var wT=To(),oV=el(),sV=wT.Set,aV=wT.add;MT.exports=function(n){var t=new sV;return oV(n,function(e){aV(t,e)}),t}});var nl=X((Wit,bT)=>{"use strict";var uV=Uc(),lV=To();bT.exports=uV(lV.proto,"size","get")||function(n){return n.size}});var TT=X((Xit,AT)=>{"use strict";AT.exports=function(n){return{iterator:n,next:n.next,done:!1}}});var ra=X((Yit,NT)=>{"use strict";var CT=_s(),RT=so(),IT=vr(),cV=Hi(),fV=TT(),PT="Invalid size",hV=RangeError,pV=TypeError,dV=Math.max,LT=function(n,t){this.set=n,this.size=dV(t,0),this.has=CT(n.has),this.keys=CT(n.keys)};LT.prototype={getIterator:function(){return fV(RT(IT(this.keys,this.set)))},includes:function(n){return IT(this.has,this.set,n)}};NT.exports=function(n){RT(n);var t=+n.size;if(t!==t)throw new pV(PT);var e=cV(t);if(e<0)throw new hV(PT);return new LT(n,e)}});var UT=X(($it,FT)=>{"use strict";var gV=ea(),DT=To(),mV=rp(),yV=nl(),vV=ra(),_V=el(),xV=na(),EV=DT.has,OT=DT.remove;FT.exports=function(t){var e=gV(this),i=vV(t),s=mV(e);return yV(e)<=i.size?_V(e,function(u){i.includes(u)&&OT(s,u)}):xV(i.getIterator(),function(u){EV(e,u)&&OT(s,u)}),s}});var ia=X((Zit,GT)=>{"use strict";var SV=$s(),BT=function(n){return{size:n,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},zT=function(n){return{size:n,has:function(){return!0},keys:function(){throw new Error("e")}}};GT.exports=function(n,t){var e=SV("Set");try{new e()[n](BT(0));try{return new e()[n](BT(-1)),!1}catch(s){if(!t)return!0;try{return new e()[n](zT(-1/0)),!1}catch(u){var i=new e;return i.add(1),i.add(2),t(i[n](zT(1/0)))}}}catch(s){return!1}}});var kT=X(()=>{"use strict";var wV=sr(),MV=UT(),bV=ia(),AV=!bV("difference",function(n){return n.size===0});wV({target:"Set",proto:!0,real:!0,forced:AV},{difference:MV})});var HT=X((Kit,VT)=>{"use strict";var TV=ea(),ly=To(),CV=nl(),IV=ra(),PV=el(),RV=na(),LV=ly.Set,qT=ly.add,NV=ly.has;VT.exports=function(t){var e=TV(this),i=IV(t),s=new LV;return CV(e)>i.size?RV(i.getIterator(),function(u){NV(e,u)&&qT(s,u)}):PV(e,function(u){i.includes(u)&&qT(s,u)}),s}});var WT=X(()=>{"use strict";var OV=sr(),DV=An(),FV=HT(),UV=ia(),BV=!UV("intersection",function(n){return n.size===2&&n.has(1)&&n.has(2)})||DV(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});OV({target:"Set",proto:!0,real:!0,forced:BV},{intersection:FV})});var cy=X((eot,YT)=>{"use strict";var zV=vr(),XT=so(),GV=Pc();YT.exports=function(n,t,e){var i,s;XT(n);try{if(i=GV(n,"return"),!i){if(t==="throw")throw e;return e}i=zV(i,n)}catch(u){s=!0,i=u}if(t==="throw")throw e;if(s)throw i;return XT(i),e}});var ZT=X((not,$T)=>{"use strict";var kV=ea(),qV=To().has,VV=nl(),HV=ra(),WV=el(),XV=na(),YV=cy();$T.exports=function(t){var e=kV(this),i=HV(t);if(VV(e)<=i.size)return WV(e,function(u){if(i.includes(u))return!1},!0)!==!1;var s=i.getIterator();return XV(s,function(u){if(qV(e,u))return YV(s,"normal",!1)})!==!1}});var JT=X(()=>{"use strict";var $V=sr(),ZV=ZT(),JV=ia(),jV=!JV("isDisjointFrom",function(n){return!n});$V({target:"Set",proto:!0,real:!0,forced:jV},{isDisjointFrom:ZV})});var KT=X((oot,jT)=>{"use strict";var KV=ea(),QV=nl(),tH=el(),eH=ra();jT.exports=function(t){var e=KV(this),i=eH(t);return QV(e)>i.size?!1:tH(e,function(s){if(!i.includes(s))return!1},!0)!==!1}});var QT=X(()=>{"use strict";var nH=sr(),rH=KT(),iH=ia(),oH=!iH("isSubsetOf",function(n){return n});nH({target:"Set",proto:!0,real:!0,forced:oH},{isSubsetOf:rH})});var eC=X((uot,tC)=>{"use strict";var sH=ea(),aH=To().has,uH=nl(),lH=ra(),cH=na(),fH=cy();tC.exports=function(t){var e=sH(this),i=lH(t);if(uH(e)<i.size)return!1;var s=i.getIterator();return cH(s,function(u){if(!aH(e,u))return fH(s,"normal",!1)})!==!1}});var nC=X(()=>{"use strict";var hH=sr(),pH=eC(),dH=ia(),gH=!dH("isSupersetOf",function(n){return!n});hH({target:"Set",proto:!0,real:!0,forced:gH},{isSupersetOf:pH})});var iC=X((fot,rC)=>{"use strict";var mH=ea(),fy=To(),yH=rp(),vH=ra(),_H=na(),xH=fy.add,EH=fy.has,SH=fy.remove;rC.exports=function(t){var e=mH(this),i=vH(t).getIterator(),s=yH(e);return _H(i,function(u){EH(e,u)?SH(s,u):xH(s,u)}),s}});var oC=X(()=>{"use strict";var wH=sr(),MH=iC(),bH=ia();wH({target:"Set",proto:!0,real:!0,forced:!bH("symmetricDifference")},{symmetricDifference:MH})});var aC=X((dot,sC)=>{"use strict";var AH=ea(),TH=To().add,CH=rp(),IH=ra(),PH=na();sC.exports=function(t){var e=AH(this),i=IH(t).getIterator(),s=CH(e);return PH(i,function(u){TH(s,u)}),s}});var uC=X(()=>{"use strict";var RH=sr(),LH=aC(),NH=ia();RH({target:"Set",proto:!0,real:!0,forced:!NH("union")},{union:LH})});var hy=X((yot,cC)=>{"use strict";var lC=qu(),OH=TypeError;cC.exports=function(n,t){if(!delete n[t])throw new OH("Cannot delete property "+lC(t)+" of "+lC(n))}});var fC=X(()=>{"use strict";var DH=sr(),FH=Vi(),UH=ii(),BH=vm(),zH=hy(),GH=wh(),kH=[].unshift(0)!==1,qH=function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(n){return n instanceof TypeError}},VH=kH||!qH();DH({target:"Array",proto:!0,arity:1,forced:VH},{unshift:function(t){var e=FH(this),i=UH(e),s=arguments.length;if(s){GH(i+s);for(var u=i;u--;){var c=u+s;u in e?e[c]=e[u]:zH(e,c)}for(var f=0;f<s;f++)e[f]=arguments[f]}return BH(e,i+s)}})});var Fl=X((Not,gP)=>{"use strict";var bY=Zs(),AY=String;gP.exports=function(n){if(bY(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return AY(n)}});var yP=X((Oot,mP)=>{"use strict";var TY=so();mP.exports=function(){var n=TY(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 _P=X((Dot,vP)=>{"use strict";var t_=An(),CY=Sn(),e_=CY.RegExp,n_=t_(function(){var n=e_("a","y");return n.lastIndex=2,n.exec("abcd")!==null}),IY=n_||t_(function(){return!e_("a","y").sticky}),PY=n_||t_(function(){var n=e_("^r","gy");return n.lastIndex=2,n.exec("str")!==null});vP.exports={BROKEN_CARET:PY,MISSED_STICKY:IY,UNSUPPORTED_Y:n_}});var EP=X((Fot,xP)=>{"use strict";var RY=An(),LY=Sn(),NY=LY.RegExp;xP.exports=RY(function(){var n=NY(".","s");return!(n.dotAll&&n.test(\`
12312
+ `,n=-1/0,i=this.geometry.getAttribute("position");if(i)for(let a=0;a<i.count;a++){let l=i.getZ(a);l>n&&(n=l)}let o=new tr({uniforms:{maxZ:{value:n},uColor:{value:new ne(this.options[0].fillColor).convertLinearToSRGB()},uColor2:{value:new ne(K0(this.options[0].fillColor)).convertLinearToSRGB()},uOpacity:{value:this.options[0].fillOpacity}},vertexShader:t,fragmentShader:e,transparent:!0});this.material=o}initLineMaterial(){let t=rn.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 Ne(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 a=i[o];for(let l=0;l<a.length;l++){let c=a[l],p=l+1===a.length?a[0]:a[l+1];t.push(new G(c[0],c[1],e)),t.push(new G(p[0],p[1],e))}}}),t}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.getBorderPoints(),e=new Xe().setFromPoints(t);this.lineGeometry=e}createBorder(){this.line&&this.remove(this.line);let t=new Yi(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}dispose(){var t,e;this.geometry?(this.geometry.dispose(),this._listeners={}):this.addEventListener("init-geometry",()=>{var n;(n=this.geometry)==null||n.dispose(),this._listeners={}}),(t=this.material)==null||t.dispose(),(e=this.line)==null||e.geometry.dispose(),this.clear()}constructor(t,e,n){super(),this.context=t,this.mergedElement=n,this.options=[],n?(this.options=[n],this.initMergedElement()):(this.options=e.map(i=>Jt({},vl,i)),this.init())}};var une=V(De(),1),lne=V(I1(),1);var qY={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},v_=class extends ye{init(){return St(this,null,function*(){let t=yield Promise.all(this.options.map(a=>co.getTextureByText(a.texts[0],{fillStyle:R1(a.fillColor,a.fillOpacity),strokeStyle:R1(a.strokeColor,a.strokeOpacity),lineWidth:6,font:"bold 54px sans-serif",maxWidth:2048}))),e=t.map((a,l)=>{let c=this.options[l],{width:p,height:g}=a.texture.image,m=p/g,y=c.secondHeight*m,x=new qa(y,c.secondHeight),S=new Ce().makeTranslation(c.center_x,c.center_y,c.airHeight+c.deltaHeight+c.height).multiply(new Ce().makeRotationZ(c.secondRotate));return x.applyMatrix4(S),x}),n=Ph(e,!0);e.forEach(a=>a.dispose());let i=t.map(a=>{let{texture:l}=a,c=new Wr({map:l,alphaTest:1,side:Xi});return l.needsUpdate=!0,c}),o=new Ne(n,i);this.mesh=o,this.position.z+=.04,this.add(o)})}setOpacity(t){var e,n;(n=this.mesh)==null||(e=n.material)==null||e.forEach(i=>{i.opacity=t,i.needsUpdate=!0})}dispose(){var t,e,n;(t=this.mesh)==null||t.geometry.dispose(),(n=this.mesh)==null||(e=n.material)==null||e.forEach(i=>i.dispose()),this.clear()}constructor(t,e){super(),this.context=t,this.options=e.map(n=>Jt({},qY,n)).filter(n=>n.texts[0].trim()),this.options.length&&this.init()}};var Vh=class extends v0{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(t){let e=t.length-3,n=new Float32Array(2*e);for(let i=0;i<e;i+=3)n[2*i]=t[i],n[2*i+1]=t[i+1],n[2*i+2]=t[i+2],n[2*i+3]=t[i+3],n[2*i+4]=t[i+4],n[2*i+5]=t[i+5];return super.setPositions(n),this}setColors(t){let e=t.length-3,n=new Float32Array(2*e);for(let i=0;i<e;i+=3)n[2*i]=t[i],n[2*i+1]=t[i+1],n[2*i+2]=t[i+2],n[2*i+3]=t[i+3],n[2*i+4]=t[i+4],n[2*i+5]=t[i+5];return super.setColors(n),this}fromLine(t){let e=t.geometry;return this.setPositions(e.attributes.position.array),this}};var Eg=class extends yc{constructor(t=new Vh,e=new Iu({color:Math.random()*16777215})){super(t,e),this.isLine2=!0,this.type="Line2"}};var Sg=class extends ye{registryEvent(){this.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.context.removeEventListener("resize",this.onResize)}setPosition(t,e){this.lineGeometry.setPositions([t.x,t.y,t.z,e.x,e.y,e.z]),this.line||this.createLine()}createLine(){this.line=new Eg(this.lineGeometry,this.lineMaterial),this.line.renderOrder=100003,this.add(this.line)}dispose(){var t;this.unRegistryEvent(),this.line&&wr(this.line),this.lineGeometry=null,this.lineMaterial=null,this.clear(),(t=this.line)==null||t.clear(),this.line=null}constructor(t,e,n){super(),this.context=t,this.lineGeometry=new Vh,this.lineMaterial=new Iu({color:0,transparent:!0,depthTest:!1,linewidth:2}),this.line=null,this.onResize=()=>{let{width:i,height:o}=this.context.clientSize;this.lineMaterial.resolution.set(i,o)},this.onResize(),this.registryEvent(),e&&n&&this.setPosition(e,n)}};var Cne=V(cn(),1),Ine=V(De(),1);var p_=class extends ye{loadModel(){return St(this,null,function*(){let t=yield ws.loadModel(this.options[0].url);t.scene.updateMatrixWorld(!0);let e=t.scene.matrixWorld.clone().invert();t.scene.traverse(c=>{if(c.isMesh){let p=e.clone().multiply(c.matrixWorld),g=c.material;this.subMeshes.push({geometry:c.geometry,material:c.material,initialMatrix:p}),Array.isArray(g)?g.forEach(m=>{m.transparent=!0,this.materialOriginParams.set(m,{opacity:m.opacity})}):(g.transparent=!0,this.materialOriginParams.set(g,{opacity:g.opacity}))}});let n=this.subMeshes.map(c=>{let{geometry:p,material:g}=c;return new rs(p,g,this.options.length)});t.scene.rotation.set(Math.PI/2,0,0);let o=new Ge().setFromObject(t.scene).getSize(new G),a=Math.max(o.x,o.y);this.options.map(c=>{let p=new Ce,g=c.width/a;return p.multiply(new Ce().makeTranslation(c.center_x,c.center_y,c.airHeight+c.deltaHeight)).multiply(new Ce().makeScale(g,g,g)).multiply(new Ce().makeRotationZ(c.rotate)).multiply(new Ce().makeRotationX(Math.PI/2)),c.url==="https://robot-vr-public.cdn.bcebos.com/ai-map-resource/757/1865371442288267264/smzsdrc.glb"&&console.log(c,p),p}).forEach((c,p)=>{n.forEach((g,m)=>{let y=c.clone().multiply(this.subMeshes[m].initialMatrix);g.setMatrixAt(p,y)})}),n.forEach(c=>{c.instanceMatrix.needsUpdate=!0,this.meshSetMaterial(c),this.add(c)})})}meshSetMaterial(t){t.isMesh&&(t.frustumCulled=!1,t.castShadow=!0,Array.isArray(t.material)?t.material.map(e=>{e.emissiveIntensity*=.95}):(t.material.emissiveIntensity*=.95,t.material.emissive=t.material.color,t.material.emissiveMap=t.material.map))}setOpacity(t,e){e===void 0&&(e=!1),this.subMeshes.forEach(n=>{let{material:i}=n;if(Array.isArray(i))i.forEach(o=>{if(e)o.opacity=t;else{let a=this.materialOriginParams.get(o)||{opacity:1};t>a.opacity?o.opacity=a.opacity:o.opacity=t}o.needsUpdate=!0});else{let o=this.materialOriginParams.get(i)||{opacity:1};t>o.opacity?i.opacity=o.opacity:i.opacity=t,i.needsUpdate=!0}}),this.children.forEach(n=>{n.instanceMatrix.needsUpdate=!0})}dispose(){this.children.forEach(t=>t.dispose()),wr(this),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.subMeshes=[],this.materialOriginParams=new Map,this.loadModel()}};var vg=class extends ye{init(){return St(this,null,function*(){this.geometry=this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options.deltaHeight+this.options.airHeight,this.options.lineGeometry&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())})}initGeometry(){return this.loader.parseGeometries([this.options.mergedGeometry])[this.options.mergedGeometry.uuid]}initMaterial(){this.material=rn.GetMergeAttributeGraphicMaterial()}initLineMaterial(){return this.lineMaterial=rn.GetMergeAttributeGraphicLineMaterial()}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new Ne(this.geometry,this.material),this.add(this.mesh)}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.loader.parseGeometries([this.options.lineGeometry]);this.lineGeometry=t[this.options.lineGeometry.uuid]}createBorder(){this.line&&this.remove(this.line);let t=new Yi(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}dispose(){var t;this.geometry&&this.geometry.dispose(),(t=this.line)==null||t.geometry.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.loader=new Tu,this.options=Jt({},vl,e),this.init()}};var x_=class extends ye{initGeometry(){return St(this,null,function*(){let t=new Tu().parseGeometries([this.options.mergedGeometry]);this.geometry=t[this.options.mergedGeometry.uuid]})}init(){return St(this,null,function*(){var t;yield this.initGeometry();let e=new Ne(this.geometry,Zs.GetMergeAttributeWallMaterial());this.add(e);let n=(t=this.geometry)==null?void 0:t.getAttribute("opacity");n&&(this.originOpacities=Array.from(n.array))})}setOpacity(t,e){e===void 0&&(e=!1);var n;let i=(n=this.geometry)==null?void 0:n.getAttribute("opacity");if(i){for(let a=0;a<i.count;a++)if(e)i.setX(a,t);else{var o;i.setX(a,Math.min(t,(o=this.originOpacities[a])!=null?o:1))}i.needsUpdate=!0}}dispose(){var t;(t=this.geometry)==null||t.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.originOpacities=[],this.init()}};var jne=V(Rh(),1),Yne=V(rl(),1),Zne=V(il(),1),$ne=V(ol(),1),Kne=V(sl(),1),Jne=V(al(),1),Qne=V(ul(),1),tre=V(ll(),1),ere=V(cl(),1),nre=V(hl(),1),rre=V(pl(),1),ire=V(fl(),1),ore=V(dl(),1),sre=V(gl(),1),are=V(ml(),1);var zh=class extends ye{init(){return St(this,null,function*(){let t=this.options.iconUrl,e=yield Mo.getTextureByUrl(t),n=new Wr({map:e,transparent:!0,alphaTest:.2,side:vs}),i=new rs(this.geometry,n,this.options.mergedMatrixes.size);i.instanceMatrix=new gi(new Float32Array(this.options.mergedMatrixes.array),16),this.add(i),this.mesh=i,this.position.z+=.004})}setOpacity(t){this.mesh&&(this.mesh.material.opacity=t,this.mesh.material.needsUpdate=!0,this.mesh.instanceMatrix.needsUpdate=!0)}dispose(){var t;this.mesh&&wr(this.mesh),(t=this.mesh)==null||t.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.geometry=new Cp(new t0([new ft(-.5,-.5),new ft(-.5,.5),new ft(.5,.5),new ft(.5,-.5)])),this.options=Jt({},D6,e);let n=new qe([0,0,0,1,1,1,1,0],2);this.geometry.setAttribute("uv",n),this.init()}};var dre=V(cn(),1);var E_=class extends ye{initGeometry(){return St(this,null,function*(){let t=this.loader.parseGeometries([this.options.mergedGeometry]);this.geometry=t[this.options.mergedGeometry.uuid]})}initMaterial(){let t=rn.createMeshBasicMaterial({color:"#ffffff",opacity:1,vertexColors:!0});return this.material=t,t}initDoubleLine(){if(this.options.dashedLineGeometry){let t=rn.createLine2MaterialMap({color:"#ffffff",width:.2,dashed:!0,resolution:new ft(this.context.clientSize.width,this.context.clientSize.height),vertexColors:!0});t.transparent=!0,t.needsUpdate=!0;let e=new v0;e.setPositions(this.options.dashedLineGeometry.positions),e.setColors(this.options.dashedLineGeometry.colors);let n=new yc(e,t);n.computeLineDistances(),n.position.z+=.01,this.add(n),this.doubleLines.push(n)}if(this.options.lineGeometry){let t=rn.createLine2MaterialMap({color:"#ffffff",width:.2,dashed:!1,resolution:new ft(this.context.clientSize.width,this.context.clientSize.height),vertexColors:!0}),e=new v0;e.setPositions(this.options.lineGeometry.positions),e.setColors(this.options.lineGeometry.colors);let n=new yc(e,t);n.position.z+=.01,this.add(n),this.doubleLines.push(n)}}init(){return St(this,null,function*(){yield this.initGeometry(),this.initMaterial();let t=new Ne(this.geometry,this.material);this.add(t),this.initDoubleLine(),this.position.z+=.02})}setOpacity(t){this.material.opacity=t,this.material.needsUpdate=!0,this.doubleLines.forEach(e=>{e.material.opacity=t,e.material.needsUpdate=!0})}dispose(){var t,e;(t=this.geometry)==null||t.dispose(),(e=this.lineGeometry)==null||e.dispose(),this.doubleLines.map(n=>n.geometry.dispose()),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.doubleLines=[],this.loader=new Tu,this.init()}};var Sre=V(Rh(),1),bre=V(rl(),1),Mre=V(il(),1),wre=V(ol(),1),Tre=V(sl(),1),Are=V(al(),1),Cre=V(ul(),1),Ire=V(ll(),1),Rre=V(cl(),1),Pre=V(hl(),1),Lre=V(pl(),1),Nre=V(fl(),1),Ore=V(dl(),1),Dre=V(gl(),1),Ure=V(ml(),1),Fre=V(De(),1);var gg=class extends ye{setColorByIndex(t,e){this.mesh&&(this.mesh.setColorAt(t,new ne(e).convertLinearToSRGB()),this.mesh.instanceColor.needsUpdate=!0)}init(){return St(this,null,function*(){this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options[0].deltaHeight+this.options[0].airHeight,this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())})}initMaterial(){this.material=rn.GetInstancedGraphicMaterial()}initLineMaterial(){let t=rn.GetMergeAttributeGraphicLineMaterial();this.lineMaterial=t}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new rs(this.geometry,this.material,this.options.length);let t=new gi(new Float32Array(this.options.length),1),e=new gi(new Float32Array(this.options.length),1);this.options.forEach((n,i)=>{let o=n.geometry.coords[0],[a,l,c]=o.slice(0,3),p=Math.sqrt((l[0]-a[0])**2+(l[1]-a[1])**2),g=Math.sqrt((c[0]-l[0])**2+(c[1]-l[1])**2),m=[p,g],y=Math.max(...m),x=Math.min(...m),S;y===p?S=[l[0]-a[0],l[1]-a[1]]:S=[c[0]-l[0],c[1]-l[1]];let[w,E]=S,b=Math.atan2(E,w)-Math.PI/2,C=new Ce().compose(new G(n.center_coord_x,n.center_coord_y,(n.deltaHeight||0)+n.airHeight+n.height/2),new li().setFromAxisAngle(new G(0,0,1),b),new G(x,y,n.height));this.mesh.setMatrixAt(i,C),this.mesh.setColorAt(i,new ne(n.fillColor).convertLinearToSRGB()),t.array[i]=n.fillOpacity||1,e.array[i]=(n.deltaHeight||0)+n.airHeight+n.height}),this.originOpacity=[...t.array],this.geometry.setAttribute("opacity",t),this.geometry.setAttribute("maxZ",e),this.add(this.mesh),this.mesh.instanceMatrix.needsUpdate=!0}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let{points:t,colors:e,opacities:n}=a6(this.options),i=new Xe().setFromPoints(t);i.setAttribute("color",new We(new Float32Array(e),3)),i.setAttribute("opacity",new We(new Float32Array(n),1)),this.lineOriginOpacity=[...n],this.lineGeometry=i}createBorder(){this.line&&this.remove(this.line);let t=new Yi(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}setOpacity(t,e){e===void 0&&(e=!1);let n=this.geometry.getAttribute("opacity");for(let a=0;a<n.count;a++)if(e)n.array[a]=t;else{var i;n.array[a]=Math.min(t,(i=this.originOpacity[a])!=null?i:1)}if(n.needsUpdate=!0,this.lineGeometry){let a=this.lineGeometry.getAttribute("opacity");for(let l=0;l<a.count;l++)if(e)a.array[l]=t;else{var o;a.array[l]=Math.min(t,(o=this.lineOriginOpacity[l])!=null?o:1)}a.needsUpdate=!0}}dispose(){var t,e;this.geometry.dispose(),(t=this.mesh)==null||t.dispose(),(e=this.line)==null||e.geometry.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.geometry=new xs(1,1,1),this.options=[],this.originOpacity=[],this.lineOriginOpacity=[],this.options=e.map(n=>Jt({},vl,n)),this.init()}};var Wre=V(Rh(),1),qre=V(rl(),1),Xre=V(il(),1),jre=V(ol(),1),Yre=V(sl(),1),Zre=V(al(),1),$re=V(ul(),1),Kre=V(ll(),1),Jre=V(cl(),1),Qre=V(hl(),1),tie=V(pl(),1),eie=V(fl(),1),nie=V(dl(),1),rie=V(gl(),1),iie=V(ml(),1),oie=V(De(),1);var df=class extends ye{init(){return St(this,null,function*(){this.initMaterial(),this.initMesh()})}initMaterial(){this.material=rn.GetInstancedGraphicMaterial()}initMesh(){if(this.mesh&&this.remove(this.mesh),!this.elements)return;this.mesh=new rs(this.geometry,this.material,this.elements.size);let t=new gi(new Float32Array(this.elements.opacities),1),e=new gi(new Float32Array(this.elements.maxZs),1);this.originOpacities=[...t.array],this.geometry.setAttribute("opacity",t),this.geometry.setAttribute("maxZ",e),this.mesh.instanceMatrix.set(this.elements.matrixes),this.mesh.instanceColor=new gi(new Float32Array(this.elements.colors),3),this.add(this.mesh),this.mesh.instanceMatrix.needsUpdate=!0}setColorByIndex(t,e){this.mesh&&(this.mesh.setColorAt(t,new ne(e).convertLinearToSRGB()),this.mesh.instanceColor.needsUpdate=!0)}setOpacityByIndex(t,e){if(this.mesh){let n=this.geometry.getAttribute("opacity");n.setX(t,e),n.needsUpdate=!0}}setMatrixByIndex(t,e){this.mesh&&(this.mesh.setMatrixAt(t,e),this.mesh.instanceMatrix.needsUpdate=!0)}setMaxZByIndex(t,e){if(this.mesh){let n=this.geometry.getAttribute("maxZ");n.setX(t,e),n.needsUpdate=!0}}setColorById(t,e){if(!this.elements)return;let n=this.elements.ids.findIndex(i=>i===t);n!==-1&&this.setColorByIndex(n,e)}setOpacityById(t,e){if(!this.elements)return;let n=this.elements.ids.findIndex(i=>i===t);n!==-1&&this.setOpacityByIndex(n,e)}setMatrixById(t,e){if(!this.elements)return;let n=this.elements.ids.findIndex(i=>i===t);n!==-1&&this.setMatrixByIndex(n,e)}setMaxZById(t,e){if(!this.elements)return;let n=this.elements.ids.findIndex(i=>i===t);n!==-1&&this.setMaxZByIndex(n,e)}setOpacity(t,e){if(e===void 0&&(e=!1),!this.geometry)return;let n=this.geometry.getAttribute("opacity");for(let o=0;o<n.count;o++)if(e)n.array[o]=t;else{var i;n.array[o]=Math.min(t,(i=this.originOpacities[o])!=null?i:1)}n.needsUpdate=!0}pushElements(t){this.elements?(this.elements.size+=t.size,this.elements.colors=[...this.elements.colors,...t.colors],this.elements.matrixes=[...this.elements.matrixes,...t.matrixes],this.elements.opacities=[...this.elements.opacities,...t.opacities],this.elements.maxZs=[...this.elements.maxZs,...t.maxZs],this.elements.ids=[...this.elements.ids,...t.ids],this.originOpacities=[...this.originOpacities,...t.opacities]):this.elements=t,this.refesh()}removeInstanceById(t){if(this.elements){if(this.mesh){let e=this.elements.ids.indexOf(t);e!==-1&&(this.elements.size--,this.elements.colors.splice(e*3,3),this.elements.matrixes.splice(e*16,16),this.elements.opacities.splice(e,1),this.elements.maxZs.splice(e,1),this.elements.ids.splice(e,1),this.originOpacities.splice(e,1))}this.refesh()}}refesh(){this.mesh&&(this.mesh.dispose(),this.remove(this.mesh)),this.init()}dispose(){var t;this.material=null,this.originOpacities.length=0,this.geometry.dispose(),(t=this.mesh)==null||t.dispose(),this.clear()}constructor(t,e){super(),this.geometry=new xs(1,1,1),this.material=null,this.elements=null,this.originOpacities=[],this.elements=e,this.init()}};var cie=V(Rh(),1),hie=V(rl(),1),pie=V(il(),1),fie=V(ol(),1),die=V(sl(),1),gie=V(al(),1),mie=V(ul(),1),yie=V(ll(),1),_ie=V(cl(),1),vie=V(hl(),1),xie=V(pl(),1),Eie=V(fl(),1),Sie=V(dl(),1),bie=V(gl(),1),Mie=V(ml(),1),wie=V(De(),1);var S_=class extends ye{init(){return St(this,null,function*(){this.initMaterial(),this.initMesh()})}initMaterial(){this.material=rn.GetInstancedWallMaterial()}initMesh(){if(this.mesh&&this.remove(this.mesh),!this.elements)return;this.mesh=new rs(this.geometry,this.material,this.elements.size);let t=new gi(new Float32Array(this.elements.opacities),1),e=new gi(new Float32Array(this.elements.maxZs),1),n=new gi(new Float32Array(this.elements.minZs),1);this.originOpacities=[...t.array],this.geometry.setAttribute("opacity",t),this.geometry.setAttribute("maxZ",e),this.geometry.setAttribute("minZ",n),this.mesh.instanceMatrix.set(this.elements.matrixes),this.mesh.instanceColor=new gi(new Float32Array(this.elements.colors),3),this.add(this.mesh),this.mesh.instanceMatrix.needsUpdate=!0}setOpacityByIndex(t,e){if(this.mesh){let n=this.geometry.getAttribute("opacity");n.setX(t,e),n.needsUpdate=!0}}setOpacity(t,e){e===void 0&&(e=!1),this.elements&&this.elements.opacities.forEach((n,i)=>{let o=e?t:Math.min(t,this.originOpacities[i]);this.setOpacityByIndex(i,o)})}dispose(){this.mesh&&(this.mesh.dispose(),this.remove(this.mesh)),this.material=null,this.geometry&&this.geometry.dispose(),this.elements=null}constructor(t,e){super(),this.geometry=new xs(1,1,1),this.material=null,this.elements=null,this.originOpacities=[],this.elements=e,this.init()}};var Gh=class extends ye{init(){return St(this,null,function*(){this.initLineGeometry(),this.initLineMaterial(),this.createBorder()})}initLineMaterial(){return this.lineMaterial=rn.GetMergeAttributeGraphicLineMaterial()}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.loader.parseGeometries([this.options]);this.lineGeometry=t[this.options.uuid]}createBorder(){this.line&&this.remove(this.line);let t=new Yi(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}dispose(){var t;(t=this.lineGeometry)==null||t.dispose(),this.lineMaterial=null,this.clear()}constructor(t,e){super(),this.context=t,this.lineMaterial=null,this.loader=new Tu,this.options=Jt({},vl,e),this.init()}};var z6=class extends Qa{setEnable(t){super.setEnable(t),Ms(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=bn(this.startPoint,e,n,i),a=bn(this.endPoint,e,n,i),l={x:Math.min(o.x,a.x),y:Math.min(o.y,a.y)},c={x:Math.max(o.x,a.x),y:Math.max(o.y,a.y)},p=this.searchMapInFrustum(l,c);this.dispatchEvent({type:"selected",list:p})}}searchMapInFrustum(t,e){var n;let{context:i}=this;return((n=i.currentFloor)==null?void 0:n.graphicLayer.children.filter(o=>o instanceof wo&&this.searchChildInFrustum(o,t,e)))||[]}searchChildInFrustum(t,e,n){let{context:{camera:i,container:{clientWidth:o,clientHeight:a}}}=this;if(!t)return!1;if(!t.mesh){let y=t.getPosition();if(y){let x=bn(y,i,o,a);return ac(x,e,n)}return!1}t.mesh.geometry.boundingBox||t.mesh.geometry.computeBoundingBox();let l=t.mesh.geometry.boundingBox;if(!l)return!1;let{min:c,max:p}=l,g=bn(c,i,o,a),m=bn(p,i,o,a);return!(!ac(g,e,n)||!ac(m,e,n))}dispose(){super.dispose(),this.rect=null,this.unRegistryEvent()}constructor(t){super(t),this.frustum=new B0,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=Jt({},i);this.endPoint&&(o=this.getSvgCoordinate(this.endPoint));let a={x:Math.min(i.x,o.x),y:Math.min(i.y,o.y)},l=Math.abs(o.x-i.x),c=Math.abs(o.y-i.y);Ms(this.rect,a.x,a.y,l,c)}else Ms(this.rect,0,0,0,0)};let{config:{selectBox:{fill:e,stroke:n}}}=t;this.rect=uc(n,e),this.svg.appendChild(this.rect),this.registryEvent()}};var b_=class extends En{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:a}=this.downPoint;if(Math.sqrt((o-n)**2+(a-i)**2)>3)return;let{graphics:l}=this.context.getGraphicsByDeviceXy(n,i),c=new Set(l.map(g=>g.options.id));this.context.getPoisByDeviceXy(n,i).forEach(g=>{if(!c.has(g.options.id)){var m;let y=((m=this.context.currentFloor)==null?void 0:m.graphicLayer.graphicMap.get(g.options.id))||null;y&&y.options.geometry.type==="point"&&(l.push(y),c.add(g.options.id))}}),(Jp?e.metaKey:e.ctrlKey)||this._list.clear(),l.forEach(g=>this._list.add(g)),this.selectEnd(),this.downPoint=null},this.onPointerOut=e=>{this.disableBoxSelection()},this.onKeyDown=e=>{Qp(e.key)&&this.enableBoxSelection()},this.onKeyUp=e=>{Qp(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 z6(t),this.boxSelection.setEnable(!1),this.registryEvent()}};var toe=V(n0(),1),eoe=V(r0(),1),noe=V(i0(),1),roe=V(o0(),1),ioe=V(s0(),1),ooe=V(a0(),1),soe=V(u0(),1),aoe=V(De(),1);var M_=class extends En{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 hi,this.graphicTimerMap=new Map,this.onPointerMove=e=>{let{graphics:n,pois:i,e:o}=e,a=i.map(g=>{var m;return(m=this.context.currentFloor)==null?void 0:m.graphicLayer.graphicMap.get(g.options.id)}).filter(g=>g&&g.options.geometry.type==="point");if(!n.length&&!a.length&&this.curGraphics.size){this.curGraphics.clear(),this.handleHoverGraphicsChange();return}let{time:l}=this.context.config.hover,c=new Set;if(a.length){let g,m=1e4;a.forEach(y=>{let x=i.find(S=>S.options.id===y.options.id);if(x instanceof Fh){let{x:S,y:w}=x.clientPos,E=Math.sqrt((S-o.offsetX)**2+(w-o.offsetY)**2);E<m&&(m=E,g=y)}else if(x instanceof Di){let{x:S,y:w}=x.box.getCenter(new ft),E=Math.sqrt((S-o.offsetX)**2+(w-o.offsetY)**2);E<m&&(m=E,g=y)}}),c.add(g)}c.size||n.forEach(g=>c.add(g)),c.forEach(g=>{if(this.graphicTimerMap.get(g)||this.curGraphics.has(g))return;let m=this.timer.setTimeout(()=>{this.curGraphics.add(g),this.graphicTimerMap.delete(g),this.timer.clearTimeout(m),this.handleHoverGraphicsChange()},l);this.graphicTimerMap.set(g,m)}),this.graphicTimerMap.forEach((g,m)=>{c.has(m)||(this.timer.clearTimeout(g),this.graphicTimerMap.delete(m))});let p=this.curGraphics.size;this.curGraphics.forEach(g=>{c.has(g)||this.curGraphics.delete(g)}),p!==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 poe=V(De(),1);var G6=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(S=>S instanceof _0).length)return null;let e=this.box,{camera:n,clientSize:{width:i,height:o}}=this.context,{min:a,max:l}=e,p=[new G(a.x,a.y,a.z),new G(l.x,a.y,a.z),new G(a.x,l.y,a.z),new G(l.x,l.y,a.z),new G(a.x,a.y,l.z),new G(l.x,a.y,l.z),new G(a.x,l.y,l.z),new G(l.x,l.y,l.z)].map(S=>bn(S,n,i,o)),g=Math.min(...p.map(S=>S.x)),m=Math.max(...p.map(S=>S.x)),y=Math.min(...p.map(S=>S.y)),x=Math.max(...p.map(S=>S.y));return{left:g,right:m,top:y,bottom:x}}checkDistanceToScreenEdge(t){let{left:e,right:n,top:i,bottom:o}=t,{width:a,height:l}=this.context.clientSize,[c,p,g,m]=this.context.config.cameraBound.padding,y=yr([[[e,i],[n,i],[n,o],[e,o],[e,i]]]),x=yr([[[m,c],[a-p,c],[a-p,l-g],[m,l-g],[m,c]]]);try{return jd(y,x)!==null}catch(S){return console.warn("\u8BA1\u7B97\u4EA4\u96C6\u51FA\u9519:",S),!1}}dispose(){this.unRegistryEvent()}constructor(t){this.context=t,this.prevCamera={position:new G,zoom:1,target:new G},this.enable=!0,this.box=new Ge,this.onCameraChange=()=>{let e=this.getCurFloorScreenPosition();if(e){let{left:n,right:i,top:o,bottom:a}=e;this.checkDistanceToScreenEdge({left:n,right:i,top:o,bottom:a})?this.changePrevCamera():this.backToPrevCamera()}},this.registryEvent(),this.changePrevCamera()}};var Coe=V(zI(),1);var Moe=V(De(),1),woe=V(cn(),1);var V6=new da,o8=new Wa,kbt=Math.cos(70*vd.DEG2RAD),H6=class extends En{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 ft,this.rotateLineEnd=new ft,this.spherical=new Dp,this.sphericalDelta=new Dp,this.object=t,this.domElement=e,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new G,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:Up.PAN,MIDDLE:Up.DOLLY,RIGHT:Up.ROTATE},this.touches={ONE:Fp.PAN,TWO:Fp.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 l.phi},this.getAzimuthalAngle=function(){return l.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(st){st.addEventListener("keydown",this.onKeyDown),this._domElementKeyEvents=st},this.stopListenToKeyEvents=function(){var st;(st=this._domElementKeyEvents)==null||st.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 st=new G,Wt=new li().setFromUnitVectors(t.up,new G(0,1,0)),kt=Wt.clone().invert(),$t=new G,ae=new li,ut=new G,L=2*Math.PI;return function(Y){Y===void 0&&(Y=null);let J=n.object.position;st.copy(J).sub(n.target),st.applyQuaternion(Wt),l.setFromVector3(st),n.autoRotate&&o===i.NONE&&W(ot(Y)),n.enableDamping?(l.theta+=c.theta*n.dampingFactor,l.phi+=c.phi*n.dampingFactor):(l.theta+=c.theta,l.phi+=c.phi);let $=n.minAzimuthAngle,mt=n.maxAzimuthAngle;isFinite($)&&isFinite(mt)&&($<-Math.PI?$+=L:$>Math.PI&&($-=L),mt<-Math.PI?mt+=L:mt>Math.PI&&(mt-=L),$<=mt?l.theta=Math.max($,Math.min(mt,l.theta)):l.theta=l.theta>($+mt)/2?Math.max($,l.theta):Math.min(mt,l.theta)),l.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,l.phi)),l.makeSafe(),n.enableDamping===!0?n.target.addScaledVector(g,n.dampingFactor):n.target.add(g),n.zoomToCursor&&F||n.object.isOrthographicCamera?l.radius=_t(l.radius):l.radius=_t(l.radius*p),st.setFromSpherical(l),st.applyQuaternion(kt),J.copy(n.target).add(st),n.object.lookAt(n.target),n.enableDamping===!0?(c.theta*=1-n.dampingFactor,c.phi*=1-n.dampingFactor,g.multiplyScalar(1-n.dampingFactor)):(c.set(0,0,0),g.set(0,0,0));let gt=!1;if(n.zoomToCursor&&F){let It=null;if(n.object.isPerspectiveCamera){let Ct=st.length();It=_t(Ct*p);let j=Ct-It;n.object.position.addScaledVector(R,j),n.object.updateMatrixWorld()}else if(n.object.isOrthographicCamera){let Ct=new G(U.x,U.y,0);Ct.unproject(n.object),n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/p)),n.object.updateProjectionMatrix(),gt=!0;let j=new G(U.x,U.y,0);j.unproject(n.object),n.object.position.sub(j).add(Ct),n.object.updateMatrixWorld(),It=st.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;It!==null&&(n.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(It).add(n.object.position):(V6.origin.copy(n.object.position),V6.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(V6.direction))<kbt?t.lookAt(n.target):(o8.setFromNormalAndCoplanarPoint(n.object.up,n.target),V6.intersectPlane(o8,n.target))))}else n.object.isOrthographicCamera&&(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/p)),n.object.updateProjectionMatrix(),gt=!0);return p=1,F=!1,gt||$t.distanceToSquared(n.object.position)>a||8*(1-ae.dot(n.object.quaternion))>a||ut.distanceToSquared(n.target)>0?(n.dispatchEvent({type:"change"}),$t.copy(n.object.position),ae.copy(n.object.quaternion),ut.copy(n.target),gt=!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,a=1e-6,l=new Dp,c=new Dp,p=1,g=new G,m=new ft,y=new ft,x=new ft,S=new ft,w=new ft,E=new ft,b=new ft,C=new ft,A=new ft,R=new G,U=new ft,F=!1,O=[],N={};function ot(st){return st!==null?2*Math.PI/60*n.autoRotateSpeed*st:2*Math.PI/60/60*n.autoRotateSpeed}function D(){return Math.pow(.95,n.zoomSpeed)}function W(st){c.theta-=st}function X(st){c.phi-=st}let Rt=function(){let st=new G;return function(kt,$t){st.setFromMatrixColumn($t,0),st.multiplyScalar(-kt),g.add(st)}}(),et=function(){let st=new G;return function(kt,$t){n.screenSpacePanning===!0?st.setFromMatrixColumn($t,1):(st.setFromMatrixColumn($t,0),st.crossVectors(n.object.up,st)),st.multiplyScalar(kt),g.add(st)}}(),xt=function(){let st=new G;return function(kt,$t){let ae=n.domElement;if(n.object.isPerspectiveCamera){let ut=n.object.position;st.copy(ut).sub(n.target);let L=st.length();L*=Math.tan(n.object.fov/2*Math.PI/180),Rt(2*kt*L/ae.clientHeight,n.object.matrix),et(2*$t*L/ae.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(Rt(kt*(n.object.right-n.object.left)/n.object.zoom/ae.clientWidth,n.object.matrix),et($t*(n.object.top-n.object.bottom)/n.object.zoom/ae.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function bt(st){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?p/=st:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function Ot(st){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?p*=st:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function ht(st){if(!n.zoomToCursor)return;F=!0;let Wt=n.domElement.getBoundingClientRect(),kt=st.clientX-Wt.left,$t=st.clientY-Wt.top,ae=Wt.width,ut=Wt.height;U.x=kt/ae*2-1,U.y=-($t/ut)*2+1,R.set(U.x,U.y,1).unproject(n.object).sub(n.object.position).normalize()}function _t(st){return Math.max(n.minDistance,Math.min(n.maxDistance,st))}function Q(st){m.set(st.clientX,st.clientY)}function Bt(st){ht(st),b.set(st.clientX,st.clientY)}function Xt(st){S.set(st.clientX,st.clientY)}function he(st){y.set(st.clientX,st.clientY),x.subVectors(y,m).multiplyScalar(n.rotateSpeed);let Wt=n.domElement;W(2*Math.PI*x.x/Wt.clientHeight),X(2*Math.PI*x.y/Wt.clientHeight),m.copy(y),n.update()}function dt(st){C.set(st.clientX,st.clientY),A.subVectors(C,b),A.y>0?bt(D()):A.y<0&&Ot(D()),b.copy(C),n.update()}function Vt(st){w.set(st.clientX,st.clientY),E.subVectors(w,S).multiplyScalar(n.panSpeed),xt(E.x,E.y),S.copy(w),n.update()}function oe(st){ht(st),st.deltaY<0?Ot(D()):st.deltaY>0&&bt(D()),n.update()}function me(st){let Wt=!1;switch(st.code){case n.keys.UP:st.ctrlKey||st.metaKey||st.shiftKey?X(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):xt(0,n.keyPanSpeed),Wt=!0;break;case n.keys.BOTTOM:st.ctrlKey||st.metaKey||st.shiftKey?X(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):xt(0,-n.keyPanSpeed),Wt=!0;break;case n.keys.LEFT:st.ctrlKey||st.metaKey||st.shiftKey?W(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):xt(n.keyPanSpeed,0),Wt=!0;break;case n.keys.RIGHT:st.ctrlKey||st.metaKey||st.shiftKey?W(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):xt(-n.keyPanSpeed,0),Wt=!0;break}Wt&&(st.preventDefault(),n.update())}function ue(){if(O.length===1)m.set(O[0].pageX,O[0].pageY);else{let st=(O[0].pageX-O[0].pageY)/(O[1].pageX-O[1].pageY),Wt=O[0].pageY-st*O[0].pageX;n.rotateLineStart.set(st,Wt);let kt=.5*(O[0].pageX+O[1].pageX),$t=.5*(O[0].pageY+O[1].pageY);m.set(kt,$t)}}function se(){if(O.length===1)S.set(O[0].pageX,O[0].pageY);else{let st=.5*(O[0].pageX+O[1].pageX),Wt=.5*(O[0].pageY+O[1].pageY);S.set(st,Wt)}}function Yt(){let st=O[0].pageX-O[1].pageX,Wt=O[0].pageY-O[1].pageY,kt=Math.sqrt(st*st+Wt*Wt);b.set(0,kt)}function be(){n.enableZoom&&Yt(),n.enablePan&&se()}function it(){n.enableZoom&&Yt(),n.enableRotate&&ue()}function ee(st){if(O.length==1)y.set(st.pageX,st.pageY);else{let kt=Et(st),$t=.5*(st.pageX+kt.x),ae=.5*(st.pageY+kt.y);y.set($t,ae);let ut=(st.pageY-kt.y)/(st.pageX-kt.x),L=kt.y-ut*kt.x;if(n.rotateLineEnd.set(ut,L),Number.isFinite(n.rotateLineEnd.x)&&Number.isFinite(n.rotateLineStart.x)){let z=(n.rotateLineStart.y-n.rotateLineEnd.y)/(n.rotateLineEnd.x-n.rotateLineStart.x),Y=ut*z+L;if(Number.isFinite(z)&&Number.isFinite(Y)){let J=Math.atan(n.rotateLineEnd.x)-Math.atan(n.rotateLineStart.x);Math.PI-Math.abs(J)<.5&&(J=-Math.sign(J)*(Math.PI-Math.abs(J))),Math.abs(J)<.1&&(c.theta+=J)}}n.rotateLineStart.copy(n.rotateLineEnd)}x.subVectors(y,m).multiplyScalar(n.rotateSpeed);let Wt=n.domElement;X(2*Math.PI*x.y/Wt.clientHeight),m.copy(y)}function Dt(st){if(O.length===1)w.set(st.pageX,st.pageY);else{let Wt=Et(st),kt=.5*(st.pageX+Wt.x),$t=.5*(st.pageY+Wt.y);w.set(kt,$t)}E.subVectors(w,S).multiplyScalar(n.panSpeed),xt(E.x,E.y),S.copy(w)}function Kt(st){let Wt=Et(st),kt=st.pageX-Wt.x,$t=st.pageY-Wt.y,ae=Math.sqrt(kt*kt+$t*$t);C.set(0,ae),A.set(0,Math.pow(C.y/b.y,n.zoomSpeed)),bt(A.y),b.copy(C)}function Ht(st){n.enableZoom&&Kt(st),n.enablePan&&Dt(st)}function de(st){n.enableZoom&&Kt(st),n.enableRotate&&ee(st)}this.onPointerDown=function(Wt){n.enabled!==!1&&(O.length===0&&(n.domElement.setPointerCapture(Wt.pointerId),n.domElement.addEventListener("pointermove",n.onPointerMove),n.domElement.addEventListener("pointerup",n.onPointerUp)),q(Wt),Wt.pointerType==="touch"?Ee(Wt):ge(Wt))},this.onPointerMove=function(Wt){n.enabled!==!1&&(Wt.pointerType==="touch"?rt(Wt):jt(Wt))},this.onPointerUp=function(Wt){Ut(Wt),O.length===0&&(n.domElement.releasePointerCapture(Wt.pointerId),n.domElement.removeEventListener("pointermove",n.onPointerMove),n.domElement.removeEventListener("pointerup",n.onPointerUp)),n.dispatchEvent({type:"end"}),o=i.NONE};function ge(st){let Wt;switch(st.button){case 0:Wt=n.mouseButtons.LEFT;break;case 1:Wt=n.mouseButtons.MIDDLE;break;case 2:Wt=n.mouseButtons.RIGHT;break;default:Wt=-1}switch(Wt){case Up.DOLLY:if(n.enableZoom===!1)return;Bt(st),o=i.DOLLY;break;case Up.ROTATE:if(st.ctrlKey||st.metaKey||st.shiftKey){if(n.enablePan===!1)return;Xt(st),o=i.PAN}else{if(n.enableRotate===!1)return;Q(st),o=i.ROTATE}break;case Up.PAN:if(st.ctrlKey||st.metaKey||st.shiftKey){if(n.enableRotate===!1)return;Q(st),o=i.ROTATE}else{if(n.enablePan===!1)return;Xt(st),o=i.PAN}break;default:o=i.NONE}o!==i.NONE&&n.dispatchEvent({type:"start"})}function jt(st){switch(o){case i.ROTATE:if(n.enableRotate===!1)return;he(st);break;case i.DOLLY:if(n.enableZoom===!1)return;dt(st);break;case i.PAN:if(n.enablePan===!1)return;Vt(st);break}}this.onMouseWheel=function(Wt){n.enabled===!1||n.enableZoom===!1||o!==i.NONE||(Wt.preventDefault(),n.dispatchEvent({type:"start"}),oe(Wt),n.dispatchEvent({type:"end"}))},this.onKeyDown=function(Wt){n.enabled===!1||n.enablePan===!1||me(Wt)};function Ee(st){switch(Gt(st),O.length){case 1:switch(n.touches.ONE){case Fp.ROTATE:if(n.enableRotate===!1)return;ue(),o=i.TOUCH_ROTATE;break;case Fp.PAN:if(n.enablePan===!1)return;se(),o=i.TOUCH_PAN;break;default:o=i.NONE}break;case 2:switch(n.touches.TWO){case Fp.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;be(),o=i.TOUCH_DOLLY_PAN;break;case Fp.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;it(),o=i.TOUCH_DOLLY_ROTATE;break;default:o=i.NONE}break;default:o=i.NONE}o!==i.NONE&&n.dispatchEvent({type:"start"})}function rt(st){switch(Gt(st),o){case i.TOUCH_ROTATE:if(n.enableRotate===!1)return;ee(st),n.update();break;case i.TOUCH_PAN:if(n.enablePan===!1)return;Dt(st),n.update();break;case i.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;Ht(st),n.update();break;case i.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;de(st),n.update();break;default:o=i.NONE}}this.onContextMenu=function(Wt){n.enabled!==!1&&Wt.preventDefault()};function q(st){O.push(st)}function Ut(st){delete N[st.pointerId];for(let Wt=0;Wt<O.length;Wt++)if(O[Wt].pointerId==st.pointerId){O.splice(Wt,1);return}}function Gt(st){let Wt=N[st.pointerId];Wt===void 0&&(Wt=new ft,N[st.pointerId]=Wt),Wt.set(st.pageX,st.pageY)}function Et(st){let Wt=st.pointerId===O[0].pointerId?O[1]:O[0];return N[Wt.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 w_=class extends H6{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 St(this,null,function*(){return e===void 0&&(e=!1),n===void 0&&(n=500),n<=0?this.setPolarAngle(t,e):$a(new Promise(i=>{let o={polar:this.getPolarAngle()},a={polar:t},l=new Ka(o,this.tweenGroup).to(a,n).onUpdate(()=>{this.setPolarAngle(o.polar,e)}).onComplete(()=>{this.enabled=!0,this.tweenGroup.remove(l),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):$a(new Promise(i=>{let o={azimuthal:this.getAzimuthalAngle()},a={azimuthal:t},l=new Ka(o,this.tweenGroup).to(a,n).onUpdate(()=>{this.setAzimuthalAngle(o.azimuthal,e)}).onComplete(()=>{this.enabled=!0,this.tweenGroup.remove(l),i(!0)}).onStart(()=>{this.enabled=!1}).start()}),n+500)}getCameraLookAt(){return new G().subVectors(this.target,this.camera.position)}setCameraPositionByTarget(t,e){return St(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 $a(new Promise(o=>{let a=new Ka(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(a),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 St(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?$a(new Promise(a=>{let l=new Ka(o,this.tweenGroup).to({zoom:t,target:e},i).onUpdate(()=>{this.setZoom(o.zoom,o.target,n)}).onComplete(()=>{this.tweenGroup.remove(l),this.enabled=!0,a(!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()),this.camera.updateMatrix(),t){let n=new G;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 Ly,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 T_=class extends Nm{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)}constructor(t){super(Jt({antialias:!0,alpha:!0},t)),this.event=new En,this.enable=!0,this.timer=new hi,this.autoClear=!0,this.setPixelRatio(window.devicePixelRatio),this.toneMapping=eM,this.toneMappingExposure=1;let e=this.dispose;this.dispose=()=>{this.timer.dispose(),this.enable=!1,e.call(this),this.domElement.remove(),this.domElement=null,this.shadowMap=null,this.info.programs&&(this.info.programs.length=0),this.info=null}}};var W6=class extends bp{constructor(t=null){super();let e=new xs;e.deleteAttribute("uv");let n=new ma({side:_s}),i=new ma,o=5;t!==null&&t._useLegacyLights===!1&&(o=900);let a=new Pp(16777215,o,28,2);a.position.set(.418,16.199,.3),this.add(a);let l=new Ne(e,n);l.position.set(-.757,13.219,.717),l.scale.set(31.713,28.305,28.591),this.add(l);let c=new Ne(e,i);c.position.set(-10.906,2.009,1.846),c.rotation.set(0,-.195,0),c.scale.set(2.328,7.905,4.651),this.add(c);let p=new Ne(e,i);p.position.set(-5.607,-.754,-.758),p.rotation.set(0,.994,0),p.scale.set(1.97,1.534,3.955),this.add(p);let g=new Ne(e,i);g.position.set(6.167,.857,7.803),g.rotation.set(0,.561,0),g.scale.set(3.927,6.285,3.687),this.add(g);let m=new Ne(e,i);m.position.set(-2.017,.018,6.124),m.rotation.set(0,.333,0),m.scale.set(2.002,4.566,2.064),this.add(m);let y=new Ne(e,i);y.position.set(2.291,-.756,-2.621),y.rotation.set(0,-.286,0),y.scale.set(1.546,1.552,1.496),this.add(y);let x=new Ne(e,i);x.position.set(-2.193,-.369,-5.547),x.rotation.set(0,.516,0),x.scale.set(3.875,3.487,2.986),this.add(x);let S=new Ne(e,bg(50));S.position.set(-16.116,14.37,8.208),S.scale.set(.1,2.428,2.739),this.add(S);let w=new Ne(e,bg(50));w.position.set(-16.109,18.021,-8.207),w.scale.set(.1,2.425,2.751),this.add(w);let E=new Ne(e,bg(17));E.position.set(14.904,12.198,-1.832),E.scale.set(.15,4.265,6.331),this.add(E);let b=new Ne(e,bg(43));b.position.set(-.462,8.89,14.52),b.scale.set(4.38,5.441,.088),this.add(b);let C=new Ne(e,bg(20));C.position.set(3.235,11.486,-12.541),C.scale.set(2.5,2,.1),this.add(C);let A=new Ne(e,bg(100));A.position.set(0,20,0),A.scale.set(1,.1,1),this.add(A)}dispose(){let t=new Set;this.traverse(e=>{e.isMesh&&(t.add(e.geometry),t.add(e.material))});for(let e of t)e.dispose()}};function bg(r){let t=new Wr;return t.color.setScalar(r),t}function s8(r,t){t===void 0&&(t=.85);let e=new md(r);return e.compileEquirectangularShader(),e.fromScene(new W6).texture}var A_=class extends bp{dispose(){var t;(t=this.environment)==null||t.dispose(),this.environment=null,wr(this),this.clear()}constructor(t){super(),this.environment=s8(t)}};var C_=class extends tc{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 $oe=V(N6(),1),Koe=V(cn(),1),Joe=V(De(),1);var q6=class{registryEvent(){this.context.addEventListener("update",this.onUpdate),this.context.addEventListener("control-change",this.onControlChange),this.context.addEventListener("resize",this.onControlChange)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate),this.context.removeEventListener("control-change",this.onControlChange),this.context.removeEventListener("resize",this.onControlChange)}changePoiLevelOrCollisionEnable(t){let e=this.objects.findIndex(n=>n===t);e!==-1&&(this.objects.splice(e,1),this.addObject(t))}addObjectEvent(t){let e=()=>this.changePoiLevelOrCollisionEnable(t);this.poiEvents.set(t,e),t.addEventListener("change-level",e),t.addEventListener("change-collision_enable",e),t.addEventListener("text-texture-inited",this.onControlChange)}removeObjectEvent(t){let e=this.poiEvents.get(t);e&&(t.removeEventListener("change-level",e),t.removeEventListener("change-collision_enable",e),t.removeEventListener("text-texture-inited",this.onControlChange))}addObject(t){if(!this.objects.includes(t)){if(this.needsUpdate=!0,this.addObjectEvent(t),!t.options.collision_enable){this.objects.unshift(t);return}if(t.options.level===0){this.objects.push(t);return}for(let e=0;e<this.objects.length;e++){let n=this.objects[e];if(n.options.collision_enable&&n.options.level<=t.options.level){this.objects.splice(e,0,t);return}}this.objects.push(t)}}removeObject(t){let e=this.objects.indexOf(t);e!==-1&&(this.objects.splice(e,1),this.removeObjectEvent(t),this.poiEvents.set(t,null),this.needsUpdate=!0)}removeObjects(t,e){e===void 0&&(e=!1),e?this.objects=this.objects.filter(n=>!t.includes(n)):this.objects=this.objects.filter(n=>t.includes(n)?(this.removeObjectEvent(n),this.poiEvents.set(n,null),!1):!0),this.needsUpdate=!0}getObjectById(t){return this.objects.find(e=>e.options.id===t)||null}validShowParkingSpace(t){t===void 0&&(t=60);let{clientSize:{width:e,height:n},control:i,camera:o}=this.context,a=Math.min(e/t,n/t,i.maxZoom-1);return o.zoom>=a}detectCollisions(){if(!this.needsUpdate)return;let t=[],{camera:e}=this.context;e.updateMatrixWorld();let n=g=>g<=1&&g>=-1,i=e.projectionMatrix.clone();i.multiply(e.matrixWorldInverse);let o=e.zoom/this.context.basicZoom,a=25/30,l=Math.min(25,Math.max(1,o*a)),c=this.validShowParkingSpace();this.objects.filter(g=>{if(g.visible){if(!(l<=g.options.maxWeight&&l>=g.options.minWeight)||!c&&g.userData.type==="parkingSpace")return g.parentSetVisible(!1),!1;let m=g.getWorldPosition(new G);return m.applyMatrix4(i),g.screenPosition=m,n(m.x)&&n(m.y)&&n(m.z)?!0:(g.parentSetVisible(!1),!1)}return!1}).forEach((g,m)=>{let y=g.getBox(g.screenPosition);if(y===null){g.parentSetVisible(!1);return}if(m===0||!g.options.collision_enable){t.push(y),g.parentSetVisible(!0);return}let x=t.some(S=>S.intersectsBox(y));g.parentSetVisible(!x),x||t.push(y)}),this.needsUpdate=!1}markForUpdate(){this.needsUpdate=!0}clear(){this.objects=[],this.needsUpdate=!0}dispose(){this.objects.forEach(t=>{this.poiEvents.set(t,null)}),this.objects=[],this.unRegistryEvent()}constructor(t){this.context=t,this.objects=[],this.needsUpdate=!0,this.poiEvents=new WeakMap,this.onUpdate=()=>{this.detectCollisions()},this.onControlChange=()=>{this.needsUpdate=!0},this.registryEvent()}};var I_=class extends En{get config(){return this.bmap.config}get center(){return this.bmap.buildingCenter}setRange(t){this.range=yr([t])}resizeClientSize(){let{x:t,y:e,width:n,height:i}=this.container.getBoundingClientRect();this.clientSize={width:n||this.container.clientWidth,height:i||this.container.clientHeight,x:t,y:e}}init(){let{clientWidth:t,clientHeight:e}=this.container;this.camera=new C_(t,e),this.renderer.setSize(t,e),this.renderer.setCameraAndScene(this.scene,this.camera),this.renderer.autoRender(),this.control=new w_(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 G6(this)}getRatio(t,e){t===void 0&&(t=new G(0,0,0)),e===void 0&&(e=new G(100,0,0));let{clientWidth:n,clientHeight:i}=this.container,o=bn(t,this.camera,n,i),a=bn(e,this.camera,n,i);return Math.ceil(Math.sqrt((a.x-o.x)**2+(a.y-o.y)**2))}changeAmbientLightColor(t){this.lights.children.forEach(e=>{e instanceof Np&&(e.color=new ne(t))})}switchFloor(t,e){e===void 0&&(e=!0),console.log("switchFloor",e),this.currentFloor&&(this.scene.remove(this.currentFloor),e?this.currentFloor.dispose():this.currentFloor.onRemoveFromScene()),this.currentFloor=t,this.setRange(t.userData.range||[]),this.scene.add(t),t.onAddToScene("scene"),this.cameraBound.updateBox()}getGraphicsByDeviceXy(t,e){var n;let i=new ft;i.x=t/this.clientSize.width*2-1,i.y=e/this.clientSize.height*-2+1;let o=new ah;return o.setFromCamera(i,this.camera),o.ray.origin.sub(o.ray.direction.clone().multiplyScalar(100)),((n=this.currentFloor)==null?void 0:n.graphicLayer.getGraphicByRaycaster(o))||{graphics:[],position:null}}getPoisByDeviceXy(t,e){var n,i;let o=(n=this.currentFloor)==null?void 0:n.poiLayer.getPoiByDeviceXy(t,e),a=(i=this.currentFloor)==null?void 0:i.poiLayer2.getPoiByDeviceXy(t,e);return(o||[]).concat(a||[])}registryEvent(){window.addEventListener("resize",this.onWindowResize),this.container.addEventListener("click",this.onClick),this.container.addEventListener("pointerover",this.onPointerover),this.container.addEventListener("pointermove",this.onPointermove),this.container.addEventListener("pointerleave",this.onPointerleave),this.container.addEventListener("pointercancel",this.onPointerleave),this.container.addEventListener("pointerout",this.onPointerleave),this.selection.addEventListener("select",this.onSelectionSelect),this.hoverHelper.addEventListener("hover-change",this.onHoverChange)}unRegistryEvent(){window.removeEventListener("resize",this.onWindowResize),this.container.removeEventListener("click",this.onClick),this.container.removeEventListener("pointerover",this.onPointerover),this.container.removeEventListener("pointermove",this.onPointermove),this.container.removeEventListener("pointerleave",this.onPointerleave),this.container.removeEventListener("pointercancel",this.onPointerleave),this.container.removeEventListener("pointerout",this.onPointerleave),this.selection.removeEventListener("select",this.onSelectionSelect),this.hoverHelper.removeEventListener("hover-change",this.onHoverChange),this.control.removeEventListener("change",this.onControlChange),this.control.removeEventListener("change-zoom",this.onControlChangeZoom),this.renderer.removeEventListener("update",this.onRendererUpdate)}setPolarAngle(t,e){return e===void 0&&(e=500),this.control.setPolarAngleByDuration(t,!0,e)}setAzimuthalAngle(t,e){return e===void 0&&(e=500),this.control.setAzimuthalAngleDuration(t,!0,e)}getCameraLookAt(){return this.control.getCameraLookAt()}setZoom(t,e,n){return n===void 0&&(n=500),this.control.setZoomByDuration(t,e,!0,n)}getFitCameraToObjectZoom(t,e,n){return e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=!0),this.getFitCameraToBoxZoom(new Ge().setFromObject(t),e,n)}getFitCameraToBoxZoom(t,e,n){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=!0);let[i,o,a,l]=e,{clientSize:{width:c,height:p}}=this,g=this.control.getPolarAngle();n&&this.setPolarAngle(0,0),this.setPolarAngle(g,0);let{max:m,min:y}=t,x=new G(y.x,m.y,m.z),S=new G(m.x,m.y,m.z),w=new G(m.x,y.y,y.z),E=new G(y.x,y.y,y.z),b=bn(x,this.camera,c,p),C=bn(S,this.camera,c,p),A=bn(E,this.camera,c,p),R=bn(w,this.camera,c,p),F=new uh().setFromPoints([new ft(b.x,b.y),new ft(C.x,C.y),new ft(A.x,A.y),new ft(R.x,R.y)]).getSize(new ft),O=(c-o-l)/F.x,N=(p-i-a)/F.y,ot=Math.min(O,N),D=new G((m.x+y.x)/2,(m.y+y.y)/2,(m.z+y.z)/2),W=ot*this.camera.zoom,X=this.camera.clone();X.zoom=W,X.updateMatrix();let Rt=(o-l)/2,et=(i-a)/2;if(Rt){let xt=new G;xt.setFromMatrixColumn(X.matrix,0),xt.normalize(),xt.multiplyScalar(Rt/W),D.add(xt)}if(et){let xt=new G;xt.setFromMatrixColumn(X.matrix,1),xt.normalize(),xt.multiplyScalar(et/W),D.add(xt)}return{zoom:ot*this.camera.zoom,center:D}}fitCameraToObject(t,e,n,i){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=500),i===void 0&&(i=!0);let{zoom:o,center:a}=this.getFitCameraToObjectZoom(t,e,i);return this.setZoom(o,a,n)}fitCameraToBox(t,e,n,i){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=500),i===void 0&&(i=!0);let{zoom:o,center:a}=this.getFitCameraToBoxZoom(t,e,i);return this.setZoom(o,a,n)}getFitCameraToGroundZoom(t,e,n){if(t===void 0&&(t=[20,20,20,20]),e===void 0&&(e=500),n===void 0&&(n=!0),this.currentFloor&&this.currentFloor.hasElement)return this.getFitCameraToObjectZoom(this.currentFloor.groundUpper,t,n).zoom}fitCameraToGround(t,e,n){return t===void 0&&(t=[20,20,20,20]),e===void 0&&(e=500),n===void 0&&(n=!0),this.currentFloor&&this.currentFloor.hasElement?this.fitCameraToObject(this.currentFloor.groundLayer,t,e,n):Promise.resolve(!1)}setCameraPosition(t,e){return St(this,null,function*(){return this.control.setCameraPositionByTarget(t,e)})}pauseRender(){this.renderer.pauseRender()}continueRender(){this.renderer.continueRender()}forceUpdate(){this.collisionSystem.needsUpdate=!0}dispose(){var t;this.collisionSystem.dispose(),(t=this.currentFloor)==null||t.dispose(),this.control.dispose(),this.cameraBound.dispose(),this.selection.dispose(),this.hoverHelper.dispose(),this.unRegistryEvent(),this.renderer.dispose(),this.lights.children.forEach(e=>e.dispose()),this.scene.dispose(),this.container=null,this.renderer=null}constructor(t,e){super(),this.container=t,this.renderer=new T_,this.lights=dM(),this.range=yr([]),this.clientSize={width:0,height:0,x:0,y:0},this.renderRf=0,this.basicZoom=1,this.onControlChange=()=>{this.dispatchEvent({type:"change-ratio",px:(this.basicRatio||0)*this.camera.zoom}),this.dispatchEvent({type:"control-change"})},this.onControlChangeZoom=n=>{let{zoom:i}=n;this.dispatchEvent({type:"control-zoom-change",zoom:i})},this.onRendererUpdate=()=>{this.dispatchEvent({type:"update"})},this.onWindowResize=()=>{let{container:n,camera:i,renderer:o}=this,{clientWidth:a,clientHeight:l}=n;a=Math.max(1,a),l=Math.max(1,l),i.left=-a/2,i.right=a/2,i.top=l/2,i.bottom=-l/2,i.updateProjectionMatrix(),o.setSize(a,l),this.resizeClientSize(),this.dispatchEvent({type:"resize",width:a,height:l})},this.onClick=n=>{let{graphics:i,position:o}=this.getGraphicsByDeviceXy(n.offsetX,n.offsetY);i.length&&this.dispatchEvent({type:"graphic-click",graphics:i,position:o});let a=this.getPoisByDeviceXy(n.offsetX,n.offsetY);a.length&&this.dispatchEvent({type:"poi-click",pois:a})},this.onPointerover=n=>{let{graphics:i,position:o}=this.getGraphicsByDeviceXy(n.offsetX,n.offsetY),a=this.getPoisByDeviceXy(n.offsetX,n.offsetY);this.dispatchEvent({type:"pointer-over",e:n,graphics:i,pois:a,position:o})},this.onPointermove=n=>{let{graphics:i,position:o}=this.getGraphicsByDeviceXy(n.offsetX,n.offsetY),a=this.getPoisByDeviceXy(n.offsetX,n.offsetY);this.dispatchEvent({type:"pointer-move",e:n,graphics:i,pois:a,position:o})},this.onPointerleave=n=>{this.dispatchEvent({type:"pointer-level"})},this.onSelectionSelect=n=>{let{graphics:i,isMultipleSelect:o}=n;this.dispatchEvent({type:"select-graphic",graphics:i,isMultipleSelect:o})},this.onHoverChange=n=>{let{graphics:i}=n;this.dispatchEvent({type:"hover",graphics:i})},this.bmap=e,this.container.style.position="relative",this.container.style.overflow="hidden",this.scene=new A_(this.renderer),this.collisionSystem=new q6(this),this.init(),this.selection=new b_(this),this.hoverHelper=new M_(this),this.resizeClientSize(),this.registryEvent()}};var a8=V(Ws(),1),u8={placeId:0,apiDomain:"",apiInfo:{},apiPath:{floorGraphic:"/api/inception-map/floor/get",floorRange:"/api/inception-map/range/get",equipmentList:"/api/inception-map/equipment/get",roadNetwork:"/api/inception-map/road_network/get",loadPlaceInfo:"https://screen.aibee.cn/ai-map/map/get-floor-map"},enableBoxSelect:!0,resizeObserver:!1,initTransToMark:!1,heatMap:{radius:50,minOpacity:.1,gradient:{0:"#8F9FCD",.5:"#6284FF",1:"#F95D5D"}},useFloorCache:!0,control:{maxPolar:1.2,defaultPolar:1.1,defaultAzimuthal:0,maxZoomScale:30},defaultPadding:[20,20,20,20],svg:{circle:{radius:"2",fill:"#1CADFF"},line:{stroke:"#1CADFF"}},selectBox:{stroke:"#1CADFF",fill:"rgba(28, 173, 255, 0.3)"},hover:{time:100},ground:{color:"#F6F6F6",opacity:1,height:.001,stroke:!1,strokeColor:"#E6E6E6",strokeOpacity:1},markGraphic:{color:"#EEF0F3",opacity:1,height:.001,stroke:!1,strokeColor:"#000",strokeOpacity:1},graphic:{fillOpacity:1},cameraBound:{padding:[150,150,150,150]},poi:{boxScale:1},loaderPlaceConfig:{textFontSize:14}};function GI(r){return(0,a8.merge)({},u8,r)}var p8=V(Ws(),1);var Cse=V(De(),1);var xse=V(cn(),1),Ese=V(De(),1);var mse=V(tf(),1);var Mg=function(r){return r.LAYERED_RENDER_VERSION="layeredRender",r.MERGED_RENDER_VERSION="mergedRender",r}({});function X6(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 j6(r,t){let e=r.poi_info.showName||r.store_name||r.poi_info.text;switch(t){case"zh-cn":return e;case"en":var n;return((n=r.infra_info_ext)==null?void 0:n.poi_name)||e;case"zh-hk":var i;return((i=r.infra_info_ext)==null?void 0:i.traditional_name)||e}}var kI=["range","ground","store","facility","parkingSpace"];function l8(r){return kI.indexOf(r.l_type)===-1?kI.length:kI.indexOf(r.l_type)}function Vbt(r){r.layers.sort((t,e)=>l8(t)-l8(e))}function Hbt(r){let t=r.layers.find(n=>n.l_type==="range"),e=[t.elements[0].center_x,t.elements[0].center_y];r.layers.map(n=>{if(n.l_type!=="range")return Ry(n.elements,e)})}function R_(r){Vbt(r),Hbt(r)}function wg(r,t){return t===void 0&&(t=5),r.floor_id+"_"+r.version_id+(t?"_"+t:"")}function c8(r,t,e){switch(r.l_type){case"ground":return VI(r,t);case"graph":return Wbt(r,t);case"wall":return qbt(r,t);case"lane":return Xbt(r,t);case"texture2d":case"texture3d":return jbt(r,t);case"glb":return Ybt(r,t);case"store":return Zbt(r,t,e);case"facility":return Kbt(r,t,e);case"parkingSpace":return Qbt(r,t,e);case"text":return eMt(r,t)}}function h8(r,t,e,n,i){switch(r.l_type){case"store":return $bt(r,t,e,n,i);case"facility":return Jbt(r,t,e,n,i);case"parkingSpace":return tMt(r,t,n,i)}}function Wbt(r,t){t.mergeGraphicLayer.addGraphics(r.elements,r.mergedElements)}function VI(r,t){let e=r.elements.map(n=>new wo(t.context,Jt({},n,{dashed:!1})));t.addGrounds(e)}function qbt(r,t){if(r.mergedElements)r.mergedElements.map(e=>{if(e.instancedGeometry){let n=new S_(t.context,e.instancedGeometry);t.wallLayer.add(n)}if(e.mergedGeometry){let n=new x_(t.context,e);t.wallLayer.add(n)}});else{let e=r.elements.reduce((n,i)=>{let{fillColor:o,fillOpacity:a,strokeColor:l,strokeOpacity:c,height:p}=i,g=o.toLowerCase()+"-"+a+"-"+l.toLowerCase()+"-"+c+"-"+p;return c===0&&(g=o.toLowerCase()+"-"+a+"-"+p),n[g]?n[g].push(i):n[g]=[i],n},{});Object.values(e).forEach(n=>{let i=new y_(t.context,n);t.wallLayer.add(i)})}}function Xbt(r,t){if(r.mergedElements){let e=new E_(t.context,r.mergedElements);t.laneLayer.add(e)}else{let e=new __(t.context,r.elements);t.laneLayer.add(e)}}function jbt(r,t){if(r.mergedMatrixes)r.mergedMatrixes.map(e=>{let n=new zh(t.context,e);t.textureLayer.add(n)});else if(r.elements.length){let e=new Bh(t.context,r.elements);t.textureLayer.add(e)}}function Ybt(r,t){t.glbModelLayer.addModels(r.elements.map(e=>Jt({},e,{url:e.secondUrl,rotate:e.secondRotate,width:e.secondWidth,center_x:e.center_coord_x,center_y:e.center_coord_y,deltaHeight:0})))}function Zbt(r,t,e){e.mergeGraphic?t.mergeGraphicLayer.addGraphics(r.elements,r.mergedElements):r.elements.map(n=>{let i=t.addGraphic(Jt({},n,{dashed:!1}));t.userData.graphics.push(i),t.userData.graphicMap.set(n.id,i)})}function $bt(r,t,e,n,i){r.elements.filter(o=>i.filterPoi(o)).map(o=>{try{let a=X6(o,e),l=new Di(t.context,{id:o.id,icon:o.poi_info.showImageUrl||o.poi_info.icon,text:a,position:{x:o.center_coord_x,y:o.center_coord_y,z:o.airHeight+o.height},icon_size:[24,24],level:o.poi_info.level||0,hide_text:!n.showStoreName,maxWeight:o.poi_info.maxWeight||25,minWeight:o.poi_info.minWeight||1,text_font_size:n.textFontSize});t.poiLayer2.pushPoi(l),l&&(l.userData.type="store",l.userData.data=o,l.userData.floor=t.name)}catch(a){console.log("\u521B\u5EFA\u5E97\u94FApoi\u5931\u8D25",a,o)}})}function Kbt(r,t,e){e.mergeGraphic?t.mergeGraphicLayer.addGraphics(r.elements,r.mergedElements):r.elements.map(n=>{let i=t.addGraphic(Jt({},n,{dashed:!1}));t.userData.graphics.push(i),t.userData.graphicMap.set(n.id,i)})}function Jbt(r,t,e,n,i){r.elements.filter(o=>o.poi_info).filter(o=>i.filterPoi(o)).map(o=>{try{let a=j6(o,e),l=new Di(t.context,{id:o.id,icon:o.poi_info.showImageUrl||o.poi_info.icon,text:a,position:{x:o.center_coord_x,y:o.center_coord_y,z:o.airHeight+o.height},icon_size:[24,24],level:o.poi_info.level||0,hide_text:!n.showFacilityName,maxWeight:o.poi_info.maxWeight||25,minWeight:o.poi_info.minWeight||1,text_font_size:n.textFontSize});t.poiLayer2.pushPoi(l),l.userData.type="facility",l.userData.data=o,l.userData.floor=t.name}catch(a){console.log("\u6DFB\u52A0facility\u5931\u8D25",a,o)}})}function Qbt(r,t,e){t.parkingSpaceLayer.load(r,e.mergeParkingSpace),t.userData.parkingSpaces=t.parkingSpaceLayer.graphicMap.values(),t.userData.parkingSpacesGraphicMap=t.parkingSpaceLayer.graphicMap}function tMt(r,t,e,n){return St(this,null,function*(){r.elements.filter(o=>o.texts[0]).filter(o=>n.filterPoi(o)).forEach(o=>{try{let a=o.displayName||o.texts[0],l=new Di(t.context,{id:o.id,text:a,position:{x:o.center_coord_x,y:o.center_coord_y,z:o.airHeight+o.height},text_font_size:e.textFontSize});l&&(l.userData.type="parkingSpace",l.userData.data=o,l.userData.floor=t.name),t.poiLayer2.pushPoi(l)}catch(a){console.log("\u6DFB\u52A0\u8F66\u4F4Dpoi\u5931\u8D25",a,o)}})})}function eMt(r,t){let e=new v_(t.context,r.elements.map(n=>Jt({},n,{center_x:n.center_coord_x,center_y:n.center_coord_y})));t.textTextureLayer.add(e)}function HI(){let r=new Blob([`var $D=Object.create;var U1=Object.defineProperty;var ZD=Object.getOwnPropertyDescriptor;var JD=Object.getOwnPropertyNames;var jD=Object.getPrototypeOf,KD=Object.prototype.hasOwnProperty;var X=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var QD=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of JD(t))!KD.call(n,s)&&s!==e&&U1(n,s,{get:()=>t[s],enumerable:!(i=ZD(t,s))||i.enumerable});return n};var jt=(n,t,e)=>(e=n!=null?$D(jD(n)):{},QD(t||!n||!n.__esModule?U1(e,"default",{value:n,enumerable:!0}):e,n));var Ri=(n,t,e)=>new Promise((i,s)=>{var u=p=>{try{f(e.next(p))}catch(d){s(d)}},c=p=>{try{f(e.throw(p))}catch(d){s(d)}},f=p=>p.done?i(p.value):Promise.resolve(p.value).then(u,c);f((e=e.apply(n,t)).next())});var Sn=X((zg,B1)=>{"use strict";var Mc=function(n){return n&&n.Math===Math&&n};B1.exports=Mc(typeof globalThis=="object"&&globalThis)||Mc(typeof window=="object"&&window)||Mc(typeof self=="object"&&self)||Mc(typeof global=="object"&&global)||Mc(typeof zg=="object"&&zg)||function(){return this}()||Function("return this")()});var An=X((vet,z1)=>{"use strict";z1.exports=function(n){try{return!!n()}catch(t){return!0}}});var ri=X((_et,G1)=>{"use strict";var t3=An();G1.exports=!t3(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var bc=X((xet,k1)=>{"use strict";var e3=An();k1.exports=!e3(function(){var n=function(){}.bind();return typeof n!="function"||n.hasOwnProperty("prototype")})});var vr=X((Eet,q1)=>{"use strict";var n3=bc(),th=Function.prototype.call;q1.exports=n3?th.bind(th):function(){return th.apply(th,arguments)}});var X1=X(W1=>{"use strict";var V1={}.propertyIsEnumerable,H1=Object.getOwnPropertyDescriptor,r3=H1&&!V1.call({1:2},1);W1.f=r3?function(t){var e=H1(this,t);return!!e&&e.enumerable}:V1});var Ac=X((Met,Y1)=>{"use strict";Y1.exports=function(n,t){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:t}}});var In=X((bet,J1)=>{"use strict";var $1=bc(),Z1=Function.prototype,Gg=Z1.call,i3=$1&&Z1.bind.bind(Gg,Gg);J1.exports=$1?i3:function(n){return function(){return Gg.apply(n,arguments)}}});var vs=X((Aet,K1)=>{"use strict";var j1=In(),o3=j1({}.toString),s3=j1("".slice);K1.exports=function(n){return s3(o3(n),8,-1)}});var eh=X((Tet,Q1)=>{"use strict";var a3=In(),u3=An(),l3=vs(),kg=Object,c3=a3("".split);Q1.exports=u3(function(){return!kg("z").propertyIsEnumerable(0)})?function(n){return l3(n)==="String"?c3(n,""):kg(n)}:kg});var nh=X((Cet,tE)=>{"use strict";tE.exports=function(n){return n==null}});var zu=X((Iet,eE)=>{"use strict";var f3=nh(),h3=TypeError;eE.exports=function(n){if(f3(n))throw new h3("Can't call method on "+n);return n}});var Gu=X((Pet,nE)=>{"use strict";var p3=eh(),d3=zu();nE.exports=function(n){return p3(d3(n))}});var er=X((Ret,rE)=>{"use strict";var qg=typeof document=="object"&&document.all;rE.exports=typeof qg=="undefined"&&qg!==void 0?function(n){return typeof n=="function"||n===qg}:function(n){return typeof n=="function"}});var Ei=X((Let,iE)=>{"use strict";var g3=er();iE.exports=function(n){return typeof n=="object"?n!==null:g3(n)}});var $s=X((Net,oE)=>{"use strict";var Vg=Sn(),m3=er(),y3=function(n){return m3(n)?n:void 0};oE.exports=function(n,t){return arguments.length<2?y3(Vg[n]):Vg[n]&&Vg[n][t]}});var Tc=X((Oet,sE)=>{"use strict";var v3=In();sE.exports=v3({}.isPrototypeOf)});var ku=X((Det,lE)=>{"use strict";var _3=Sn(),aE=_3.navigator,uE=aE&&aE.userAgent;lE.exports=uE?String(uE):""});var Cc=X((Fet,gE)=>{"use strict";var dE=Sn(),Hg=ku(),cE=dE.process,fE=dE.Deno,hE=cE&&cE.versions||fE&&fE.version,pE=hE&&hE.v8,wo,rh;pE&&(wo=pE.split("."),rh=wo[0]>0&&wo[0]<4?1:+(wo[0]+wo[1]));!rh&&Hg&&(wo=Hg.match(/Edge\\/(\\d+)/),(!wo||wo[1]>=74)&&(wo=Hg.match(/Chrome\\/(\\d+)/),wo&&(rh=+wo[1])));gE.exports=rh});var ih=X((Uet,yE)=>{"use strict";var mE=Cc(),x3=An(),E3=Sn(),S3=E3.String;yE.exports=!!Object.getOwnPropertySymbols&&!x3(function(){var n=Symbol("symbol detection");return!S3(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&mE&&mE<41})});var Wg=X((Bet,vE)=>{"use strict";var w3=ih();vE.exports=w3&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Ic=X((zet,_E)=>{"use strict";var M3=$s(),b3=er(),A3=Tc(),T3=Wg(),C3=Object;_E.exports=T3?function(n){return typeof n=="symbol"}:function(n){var t=M3("Symbol");return b3(t)&&A3(t.prototype,C3(n))}});var qu=X((Get,xE)=>{"use strict";var I3=String;xE.exports=function(n){try{return I3(n)}catch(t){return"Object"}}});var _s=X((ket,EE)=>{"use strict";var P3=er(),R3=qu(),L3=TypeError;EE.exports=function(n){if(P3(n))return n;throw new L3(R3(n)+" is not a function")}});var Pc=X((qet,SE)=>{"use strict";var N3=_s(),O3=nh();SE.exports=function(n,t){var e=n[t];return O3(e)?void 0:N3(e)}});var ME=X((Vet,wE)=>{"use strict";var Xg=vr(),Yg=er(),$g=Ei(),D3=TypeError;wE.exports=function(n,t){var e,i;if(t==="string"&&Yg(e=n.toString)&&!$g(i=Xg(e,n))||Yg(e=n.valueOf)&&!$g(i=Xg(e,n))||t!=="string"&&Yg(e=n.toString)&&!$g(i=Xg(e,n)))return i;throw new D3("Can't convert object to primitive value")}});var Rc=X((Het,bE)=>{"use strict";bE.exports=!1});var oh=X((Wet,TE)=>{"use strict";var AE=Sn(),F3=Object.defineProperty;TE.exports=function(n,t){try{F3(AE,n,{value:t,configurable:!0,writable:!0})}catch(e){AE[n]=t}return t}});var sh=X((Xet,PE)=>{"use strict";var U3=Rc(),B3=Sn(),z3=oh(),CE="__core-js_shared__",IE=PE.exports=B3[CE]||z3(CE,{});(IE.versions||(IE.versions=[])).push({version:"3.42.0",mode:U3?"pure":"global",copyright:"\\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var ah=X((Yet,LE)=>{"use strict";var RE=sh();LE.exports=function(n,t){return RE[n]||(RE[n]=t||{})}});var Vi=X(($et,NE)=>{"use strict";var G3=zu(),k3=Object;NE.exports=function(n){return k3(G3(n))}});var oo=X((Zet,OE)=>{"use strict";var q3=In(),V3=Vi(),H3=q3({}.hasOwnProperty);OE.exports=Object.hasOwn||function(t,e){return H3(V3(t),e)}});var uh=X((Jet,DE)=>{"use strict";var W3=In(),X3=0,Y3=Math.random(),$3=W3(1 .toString);DE.exports=function(n){return"Symbol("+(n===void 0?"":n)+")_"+$3(++X3+Y3,36)}});var Xr=X((jet,UE)=>{"use strict";var Z3=Sn(),J3=ah(),FE=oo(),j3=uh(),K3=ih(),Q3=Wg(),Vu=Z3.Symbol,Zg=J3("wks"),tF=Q3?Vu.for||Vu:Vu&&Vu.withoutSetter||j3;UE.exports=function(n){return FE(Zg,n)||(Zg[n]=K3&&FE(Vu,n)?Vu[n]:tF("Symbol."+n)),Zg[n]}});var Jg=X((Ket,GE)=>{"use strict";var eF=vr(),BE=Ei(),zE=Ic(),nF=Pc(),rF=ME(),iF=Xr(),oF=TypeError,sF=iF("toPrimitive");GE.exports=function(n,t){if(!BE(n)||zE(n))return n;var e=nF(n,sF),i;if(e){if(t===void 0&&(t="default"),i=eF(e,n,t),!BE(i)||zE(i))return i;throw new oF("Can't convert object to primitive value")}return t===void 0&&(t="number"),rF(n,t)}});var lh=X((Qet,kE)=>{"use strict";var aF=Jg(),uF=Ic();kE.exports=function(n){var t=aF(n,"string");return uF(t)?t:t+""}});var ch=X((tnt,VE)=>{"use strict";var lF=Sn(),qE=Ei(),jg=lF.document,cF=qE(jg)&&qE(jg.createElement);VE.exports=function(n){return cF?jg.createElement(n):{}}});var Kg=X((ent,HE)=>{"use strict";var fF=ri(),hF=An(),pF=ch();HE.exports=!fF&&!hF(function(){return Object.defineProperty(pF("div"),"a",{get:function(){return 7}}).a!==7})});var fh=X(XE=>{"use strict";var dF=ri(),gF=vr(),mF=X1(),yF=Ac(),vF=Gu(),_F=lh(),xF=oo(),EF=Kg(),WE=Object.getOwnPropertyDescriptor;XE.f=dF?WE:function(t,e){if(t=vF(t),e=_F(e),EF)try{return WE(t,e)}catch(i){}if(xF(t,e))return yF(!gF(mF.f,t,e),t[e])}});var Qg=X((rnt,YE)=>{"use strict";var SF=ri(),wF=An();YE.exports=SF&&wF(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var so=X((int,$E)=>{"use strict";var MF=Ei(),bF=String,AF=TypeError;$E.exports=function(n){if(MF(n))return n;throw new AF(bF(n)+" is not an object")}});var Wo=X(JE=>{"use strict";var TF=ri(),CF=Kg(),IF=Qg(),hh=so(),ZE=lh(),PF=TypeError,tm=Object.defineProperty,RF=Object.getOwnPropertyDescriptor,em="enumerable",nm="configurable",rm="writable";JE.f=TF?IF?function(t,e,i){if(hh(t),e=ZE(e),hh(i),typeof t=="function"&&e==="prototype"&&"value"in i&&rm in i&&!i[rm]){var s=RF(t,e);s&&s[rm]&&(t[e]=i.value,i={configurable:nm in i?i[nm]:s[nm],enumerable:em in i?i[em]:s[em],writable:!1})}return tm(t,e,i)}:tm:function(t,e,i){if(hh(t),e=ZE(e),hh(i),CF)try{return tm(t,e,i)}catch(s){}if("get"in i||"set"in i)throw new PF("Accessors not supported");return"value"in i&&(t[e]=i.value),t}});var xs=X((snt,jE)=>{"use strict";var LF=ri(),NF=Wo(),OF=Ac();jE.exports=LF?function(n,t,e){return NF.f(n,t,OF(1,e))}:function(n,t,e){return n[t]=e,n}});var ph=X((ant,QE)=>{"use strict";var im=ri(),DF=oo(),KE=Function.prototype,FF=im&&Object.getOwnPropertyDescriptor,om=DF(KE,"name"),UF=om&&function(){}.name==="something",BF=om&&(!im||im&&FF(KE,"name").configurable);QE.exports={EXISTS:om,PROPER:UF,CONFIGURABLE:BF}});var am=X((unt,tS)=>{"use strict";var zF=In(),GF=er(),sm=sh(),kF=zF(Function.toString);GF(sm.inspectSource)||(sm.inspectSource=function(n){return kF(n)});tS.exports=sm.inspectSource});var rS=X((lnt,nS)=>{"use strict";var qF=Sn(),VF=er(),eS=qF.WeakMap;nS.exports=VF(eS)&&/native code/.test(String(eS))});var dh=X((cnt,oS)=>{"use strict";var HF=ah(),WF=uh(),iS=HF("keys");oS.exports=function(n){return iS[n]||(iS[n]=WF(n))}});var gh=X((fnt,sS)=>{"use strict";sS.exports={}});var Va=X((hnt,lS)=>{"use strict";var XF=rS(),uS=Sn(),YF=Ei(),$F=xs(),um=oo(),lm=sh(),ZF=dh(),JF=gh(),aS="Object already initialized",cm=uS.TypeError,jF=uS.WeakMap,mh,Lc,yh,KF=function(n){return yh(n)?Lc(n):mh(n,{})},QF=function(n){return function(t){var e;if(!YF(t)||(e=Lc(t)).type!==n)throw new cm("Incompatible receiver, "+n+" required");return e}};XF||lm.state?(Mo=lm.state||(lm.state=new jF),Mo.get=Mo.get,Mo.has=Mo.has,Mo.set=Mo.set,mh=function(n,t){if(Mo.has(n))throw new cm(aS);return t.facade=n,Mo.set(n,t),t},Lc=function(n){return Mo.get(n)||{}},yh=function(n){return Mo.has(n)}):(qa=ZF("state"),JF[qa]=!0,mh=function(n,t){if(um(n,qa))throw new cm(aS);return t.facade=n,$F(n,qa,t),t},Lc=function(n){return um(n,qa)?n[qa]:{}},yh=function(n){return um(n,qa)});var Mo,qa;lS.exports={set:mh,get:Lc,has:yh,enforce:KF,getterFor:QF}});var pm=X((pnt,hS)=>{"use strict";var hm=In(),tU=An(),eU=er(),vh=oo(),fm=ri(),nU=ph().CONFIGURABLE,rU=am(),fS=Va(),iU=fS.enforce,oU=fS.get,cS=String,_h=Object.defineProperty,sU=hm("".slice),aU=hm("".replace),uU=hm([].join),lU=fm&&!tU(function(){return _h(function(){},"length",{value:8}).length!==8}),cU=String(String).split("String"),fU=hS.exports=function(n,t,e){sU(cS(t),0,7)==="Symbol("&&(t="["+aU(cS(t),/^Symbol\\(([^)]*)\\).*$/,"$1")+"]"),e&&e.getter&&(t="get "+t),e&&e.setter&&(t="set "+t),(!vh(n,"name")||nU&&n.name!==t)&&(fm?_h(n,"name",{value:t,configurable:!0}):n.name=t),lU&&e&&vh(e,"arity")&&n.length!==e.arity&&_h(n,"length",{value:e.arity});try{e&&vh(e,"constructor")&&e.constructor?fm&&_h(n,"prototype",{writable:!1}):n.prototype&&(n.prototype=void 0)}catch(s){}var i=iU(n);return vh(i,"source")||(i.source=uU(cU,typeof t=="string"?t:"")),n};Function.prototype.toString=fU(function(){return eU(this)&&oU(this).source||rU(this)},"toString")});var Ha=X((dnt,pS)=>{"use strict";var hU=er(),pU=Wo(),dU=pm(),gU=oh();pS.exports=function(n,t,e,i){i||(i={});var s=i.enumerable,u=i.name!==void 0?i.name:t;if(hU(e)&&dU(e,u,i),i.global)s?n[t]=e:gU(t,e);else{try{i.unsafe?n[t]&&(s=!0):delete n[t]}catch(c){}s?n[t]=e:pU.f(n,t,{value:e,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return n}});var gS=X((gnt,dS)=>{"use strict";var mU=Math.ceil,yU=Math.floor;dS.exports=Math.trunc||function(t){var e=+t;return(e>0?yU:mU)(e)}});var Hi=X((mnt,mS)=>{"use strict";var vU=gS();mS.exports=function(n){var t=+n;return t!==t||t===0?0:vU(t)}});var xh=X((ynt,yS)=>{"use strict";var _U=Hi(),xU=Math.max,EU=Math.min;yS.exports=function(n,t){var e=_U(n);return e<0?xU(e+t,0):EU(e,t)}});var Wa=X((vnt,vS)=>{"use strict";var SU=Hi(),wU=Math.min;vS.exports=function(n){var t=SU(n);return t>0?wU(t,9007199254740991):0}});var ii=X((_nt,_S)=>{"use strict";var MU=Wa();_S.exports=function(n){return MU(n.length)}});var SS=X((xnt,ES)=>{"use strict";var bU=Gu(),AU=xh(),TU=ii(),xS=function(n){return function(t,e,i){var s=bU(t),u=TU(s);if(u===0)return!n&&-1;var c=AU(i,u),f;if(n&&e!==e){for(;u>c;)if(f=s[c++],f!==f)return!0}else for(;u>c;c++)if((n||c in s)&&s[c]===e)return n||c||0;return!n&&-1}};ES.exports={includes:xS(!0),indexOf:xS(!1)}});var gm=X((Ent,MS)=>{"use strict";var CU=In(),dm=oo(),IU=Gu(),PU=SS().indexOf,RU=gh(),wS=CU([].push);MS.exports=function(n,t){var e=IU(n),i=0,s=[],u;for(u in e)!dm(RU,u)&&dm(e,u)&&wS(s,u);for(;t.length>i;)dm(e,u=t[i++])&&(~PU(s,u)||wS(s,u));return s}});var Eh=X((Snt,bS)=>{"use strict";bS.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var mm=X(AS=>{"use strict";var LU=gm(),NU=Eh(),OU=NU.concat("length","prototype");AS.f=Object.getOwnPropertyNames||function(t){return LU(t,OU)}});var CS=X(TS=>{"use strict";TS.f=Object.getOwnPropertySymbols});var PS=X((bnt,IS)=>{"use strict";var DU=$s(),FU=In(),UU=mm(),BU=CS(),zU=so(),GU=FU([].concat);IS.exports=DU("Reflect","ownKeys")||function(t){var e=UU.f(zU(t)),i=BU.f;return i?GU(e,i(t)):e}});var ym=X((Ant,LS)=>{"use strict";var RS=oo(),kU=PS(),qU=fh(),VU=Wo();LS.exports=function(n,t,e){for(var i=kU(t),s=VU.f,u=qU.f,c=0;c<i.length;c++){var f=i[c];!RS(n,f)&&!(e&&RS(e,f))&&s(n,f,u(t,f))}}});var OS=X((Tnt,NS)=>{"use strict";var HU=An(),WU=er(),XU=/#|\\.prototype\\./,Nc=function(n,t){var e=$U[YU(n)];return e===JU?!0:e===ZU?!1:WU(t)?HU(t):!!t},YU=Nc.normalize=function(n){return String(n).replace(XU,".").toLowerCase()},$U=Nc.data={},ZU=Nc.NATIVE="N",JU=Nc.POLYFILL="P";NS.exports=Nc});var sr=X((Cnt,DS)=>{"use strict";var Sh=Sn(),jU=fh().f,KU=xs(),QU=Ha(),tB=oh(),eB=ym(),nB=OS();DS.exports=function(n,t){var e=n.target,i=n.global,s=n.stat,u,c,f,p,d,g;if(i?c=Sh:s?c=Sh[e]||tB(e,{}):c=Sh[e]&&Sh[e].prototype,c)for(f in t){if(d=t[f],n.dontCallGetSet?(g=jU(c,f),p=g&&g.value):p=c[f],u=nB(i?f:e+(s?".":"#")+f,n.forced),!u&&p!==void 0){if(typeof d==typeof p)continue;eB(d,p)}(n.sham||p&&p.sham)&&KU(d,"sham",!0),QU(c,f,d,n)}}});var Oc=X((Int,FS)=>{"use strict";var rB=vs();FS.exports=Array.isArray||function(t){return rB(t)==="Array"}});var vm=X((Pnt,US)=>{"use strict";var iB=ri(),oB=Oc(),sB=TypeError,aB=Object.getOwnPropertyDescriptor,uB=iB&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(n){return n instanceof TypeError}}();US.exports=uB?function(n,t){if(oB(n)&&!aB(n,"length").writable)throw new sB("Cannot set read only .length");return n.length=t}:function(n,t){return n.length=t}});var wh=X((Rnt,BS)=>{"use strict";var lB=TypeError,cB=9007199254740991;BS.exports=function(n){if(n>cB)throw lB("Maximum allowed index exceeded");return n}});var Mh=X(()=>{"use strict";var fB=sr(),hB=Vi(),pB=ii(),dB=vm(),gB=wh(),mB=An(),yB=mB(function(){return[].push.call({length:4294967296},1)!==4294967297}),vB=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(n){return n instanceof TypeError}},_B=yB||!vB();fB({target:"Array",proto:!0,arity:1,forced:_B},{push:function(t){var e=hB(this),i=pB(e),s=arguments.length;gB(i+s);for(var u=0;u<s;u++)e[i]=arguments[u],i++;return dB(e,i),i}})});var zS=X(()=>{"use strict";var xB=sr(),EB=vr();xB({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return EB(URL.prototype.toString,this)}})});var kS=X((Fnt,GS)=>{"use strict";GS.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 HS=X((Unt,VS)=>{"use strict";var SB=ch(),_m=SB("span").classList,qS=_m&&_m.constructor&&_m.constructor.prototype;VS.exports=qS===Object.prototype?void 0:qS});var XS=X((Bnt,WS)=>{"use strict";var wB=gm(),MB=Eh();WS.exports=Object.keys||function(t){return wB(t,MB)}});var $S=X(YS=>{"use strict";var bB=ri(),AB=Qg(),TB=Wo(),CB=so(),IB=Gu(),PB=XS();YS.f=bB&&!AB?Object.defineProperties:function(t,e){CB(t);for(var i=IB(e),s=PB(e),u=s.length,c=0,f;u>c;)TB.f(t,f=s[c++],i[f]);return t}});var JS=X((Gnt,ZS)=>{"use strict";var RB=$s();ZS.exports=RB("document","documentElement")});var Hu=X((knt,rw)=>{"use strict";var LB=so(),NB=$S(),jS=Eh(),OB=gh(),DB=JS(),FB=ch(),UB=dh(),KS=">",QS="<",Em="prototype",Sm="script",ew=UB("IE_PROTO"),xm=function(){},nw=function(n){return QS+Sm+KS+n+QS+"/"+Sm+KS},tw=function(n){n.write(nw("")),n.close();var t=n.parentWindow.Object;return n=null,t},BB=function(){var n=FB("iframe"),t="java"+Sm+":",e;return n.style.display="none",DB.appendChild(n),n.src=String(t),e=n.contentWindow.document,e.open(),e.write(nw("document.F=Object")),e.close(),e.F},bh,Ah=function(){try{bh=new ActiveXObject("htmlfile")}catch(t){}Ah=typeof document!="undefined"?document.domain&&bh?tw(bh):BB():tw(bh);for(var n=jS.length;n--;)delete Ah[Em][jS[n]];return Ah()};OB[ew]=!0;rw.exports=Object.create||function(t,e){var i;return t!==null?(xm[Em]=LB(t),i=new xm,xm[Em]=null,i[ew]=t):i=Ah(),e===void 0?i:NB.f(i,e)}});var bm=X((qnt,iw)=>{"use strict";var zB=Xr(),GB=Hu(),kB=Wo().f,wm=zB("unscopables"),Mm=Array.prototype;Mm[wm]===void 0&&kB(Mm,wm,{configurable:!0,value:GB(null)});iw.exports=function(n){Mm[wm][n]=!0}});var Wu=X((Vnt,ow)=>{"use strict";ow.exports={}});var aw=X((Hnt,sw)=>{"use strict";var qB=An();sw.exports=!qB(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype})});var Dc=X((Wnt,lw)=>{"use strict";var VB=oo(),HB=er(),WB=Vi(),XB=dh(),YB=aw(),uw=XB("IE_PROTO"),Am=Object,$B=Am.prototype;lw.exports=YB?Am.getPrototypeOf:function(n){var t=WB(n);if(VB(t,uw))return t[uw];var e=t.constructor;return HB(e)&&t instanceof e?e.prototype:t instanceof Am?$B:null}});var Pm=X((Xnt,hw)=>{"use strict";var ZB=An(),JB=er(),jB=Ei(),KB=Hu(),cw=Dc(),QB=Ha(),tz=Xr(),ez=Rc(),Im=tz("iterator"),fw=!1,Es,Tm,Cm;[].keys&&(Cm=[].keys(),"next"in Cm?(Tm=cw(cw(Cm)),Tm!==Object.prototype&&(Es=Tm)):fw=!0);var nz=!jB(Es)||ZB(function(){var n={};return Es[Im].call(n)!==n});nz?Es={}:ez&&(Es=KB(Es));JB(Es[Im])||QB(Es,Im,function(){return this});hw.exports={IteratorPrototype:Es,BUGGY_SAFARI_ITERATORS:fw}});var Fc=X((Ynt,dw)=>{"use strict";var rz=Wo().f,iz=oo(),oz=Xr(),pw=oz("toStringTag");dw.exports=function(n,t,e){n&&!e&&(n=n.prototype),n&&!iz(n,pw)&&rz(n,pw,{configurable:!0,value:t})}});var mw=X(($nt,gw)=>{"use strict";var sz=Pm().IteratorPrototype,az=Hu(),uz=Ac(),lz=Fc(),cz=Wu(),fz=function(){return this};gw.exports=function(n,t,e,i){var s=t+" Iterator";return n.prototype=az(sz,{next:uz(+!i,e)}),lz(n,s,!1,!0),cz[s]=fz,n}});var Uc=X((Znt,yw)=>{"use strict";var hz=In(),pz=_s();yw.exports=function(n,t,e){try{return hz(pz(Object.getOwnPropertyDescriptor(n,t)[e]))}catch(i){}}});var _w=X((Jnt,vw)=>{"use strict";var dz=Ei();vw.exports=function(n){return dz(n)||n===null}});var Ew=X((jnt,xw)=>{"use strict";var gz=_w(),mz=String,yz=TypeError;xw.exports=function(n){if(gz(n))return n;throw new yz("Can't set "+mz(n)+" as a prototype")}});var Xu=X((Knt,Sw)=>{"use strict";var vz=Uc(),_z=Ei(),xz=zu(),Ez=Ew();Sw.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var n=!1,t={},e;try{e=vz(Object.prototype,"__proto__","set"),e(t,[]),n=t instanceof Array}catch(i){}return function(s,u){return xz(s),Ez(u),_z(s)&&(n?e(s,u):s.__proto__=u),s}}():void 0)});var Nw=X((Qnt,Lw)=>{"use strict";var Sz=sr(),wz=vr(),Th=Rc(),Pw=ph(),Mz=er(),bz=mw(),ww=Dc(),Mw=Xu(),Az=Fc(),Tz=xs(),Rm=Ha(),Cz=Xr(),bw=Wu(),Rw=Pm(),Iz=Pw.PROPER,Pz=Pw.CONFIGURABLE,Aw=Rw.IteratorPrototype,Ch=Rw.BUGGY_SAFARI_ITERATORS,Bc=Cz("iterator"),Tw="keys",zc="values",Cw="entries",Iw=function(){return this};Lw.exports=function(n,t,e,i,s,u,c){bz(e,t,i);var f=function(x){if(x===s&&v)return v;if(!Ch&&x&&x in g)return g[x];switch(x){case Tw:return function(){return new e(this,x)};case zc:return function(){return new e(this,x)};case Cw:return function(){return new e(this,x)}}return function(){return new e(this)}},p=t+" Iterator",d=!1,g=n.prototype,y=g[Bc]||g["@@iterator"]||s&&g[s],v=!Ch&&y||f(s),E=t==="Array"&&g.entries||y,M,A,_;if(E&&(M=ww(E.call(new n)),M!==Object.prototype&&M.next&&(!Th&&ww(M)!==Aw&&(Mw?Mw(M,Aw):Mz(M[Bc])||Rm(M,Bc,Iw)),Az(M,p,!0,!0),Th&&(bw[p]=Iw))),Iz&&s===zc&&y&&y.name!==zc&&(!Th&&Pz?Tz(g,"name",zc):(d=!0,v=function(){return wz(y,this)})),s)if(A={values:f(zc),keys:u?v:f(Tw),entries:f(Cw)},c)for(_ in A)(Ch||d||!(_ in g))&&Rm(g,_,A[_]);else Sz({target:t,proto:!0,forced:Ch||d},A);return(!Th||c)&&g[Bc]!==v&&Rm(g,Bc,v,{name:s}),bw[t]=v,A}});var Dw=X((trt,Ow)=>{"use strict";Ow.exports=function(n,t){return{value:n,done:t}}});var kw=X((ert,Gw)=>{"use strict";var Rz=Gu(),Lm=bm(),Fw=Wu(),Bw=Va(),Lz=Wo().f,Nz=Nw(),Ih=Dw(),Oz=Rc(),Dz=ri(),zw="Array Iterator",Fz=Bw.set,Uz=Bw.getterFor(zw);Gw.exports=Nz(Array,"Array",function(n,t){Fz(this,{type:zw,target:Rz(n),index:0,kind:t})},function(){var n=Uz(this),t=n.target,e=n.index++;if(!t||e>=t.length)return n.target=null,Ih(void 0,!0);switch(n.kind){case"keys":return Ih(e,!1);case"values":return Ih(t[e],!1)}return Ih([e,t[e]],!1)},"values");var Uw=Fw.Arguments=Fw.Array;Lm("keys");Lm("values");Lm("entries");if(!Oz&&Dz&&Uw.name!=="values")try{Lz(Uw,"name",{value:"values"})}catch(n){}});var Yu=X(()=>{"use strict";var qw=Sn(),Hw=kS(),Bz=HS(),Gc=kw(),Vw=xs(),zz=Fc(),Gz=Xr(),Nm=Gz("iterator"),Om=Gc.values,Ww=function(n,t){if(n){if(n[Nm]!==Om)try{Vw(n,Nm,Om)}catch(i){n[Nm]=Om}if(zz(n,t,!0),Hw[t]){for(var e in Gc)if(n[e]!==Gc[e])try{Vw(n,e,Gc[e])}catch(i){n[e]=Gc[e]}}}};for(Ph in Hw)Ww(qw[Ph]&&qw[Ph].prototype,Ph);var Ph;Ww(Bz,"DOMTokenList")});var Rh=X((irt,Xw)=>{"use strict";var kz=vs(),qz=In();Xw.exports=function(n){if(kz(n)==="Function")return qz(n)}});var kc=X((ort,$w)=>{"use strict";var Yw=Rh(),Vz=_s(),Hz=bc(),Wz=Yw(Yw.bind);$w.exports=function(n,t){return Vz(n),t===void 0?n:Hz?Wz(n,t):function(){return n.apply(t,arguments)}}});var jw=X((srt,Jw)=>{"use strict";var Xz=Oc(),Yz=ii(),$z=wh(),Zz=kc(),Zw=function(n,t,e,i,s,u,c,f){for(var p=s,d=0,g=c?Zz(c,f):!1,y,v;d<i;)d in e&&(y=g?g(e[d],d,t):e[d],u>0&&Xz(y)?(v=Yz(y),p=Zw(n,t,y,v,p,u-1)-1):($z(p+1),n[p]=y),p++),d++;return p};Jw.exports=Zw});var tM=X((art,Qw)=>{"use strict";var Jz=Xr(),jz=Jz("toStringTag"),Kw={};Kw[jz]="z";Qw.exports=String(Kw)==="[object z]"});var Zs=X((urt,eM)=>{"use strict";var Kz=tM(),Qz=er(),Lh=vs(),tG=Xr(),eG=tG("toStringTag"),nG=Object,rG=Lh(function(){return arguments}())==="Arguments",iG=function(n,t){try{return n[t]}catch(e){}};eM.exports=Kz?Lh:function(n){var t,e,i;return n===void 0?"Undefined":n===null?"Null":typeof(e=iG(t=nG(n),eG))=="string"?e:rG?Lh(t):(i=Lh(t))==="Object"&&Qz(t.callee)?"Arguments":i}});var Fm=X((lrt,sM)=>{"use strict";var oG=In(),sG=An(),nM=er(),aG=Zs(),uG=$s(),lG=am(),rM=function(){},iM=uG("Reflect","construct"),Dm=/^\\s*(?:class|function)\\b/,cG=oG(Dm.exec),fG=!Dm.test(rM),qc=function(t){if(!nM(t))return!1;try{return iM(rM,[],t),!0}catch(e){return!1}},oM=function(t){if(!nM(t))return!1;switch(aG(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return fG||!!cG(Dm,lG(t))}catch(e){return!0}};oM.sham=!0;sM.exports=!iM||sG(function(){var n;return qc(qc.call)||!qc(Object)||!qc(function(){n=!0})||n})?oM:qc});var cM=X((crt,lM)=>{"use strict";var aM=Oc(),hG=Fm(),pG=Ei(),dG=Xr(),gG=dG("species"),uM=Array;lM.exports=function(n){var t;return aM(n)&&(t=n.constructor,hG(t)&&(t===uM||aM(t.prototype))?t=void 0:pG(t)&&(t=t[gG],t===null&&(t=void 0))),t===void 0?uM:t}});var Um=X((frt,fM)=>{"use strict";var mG=cM();fM.exports=function(n,t){return new(mG(n))(t===0?0:t)}});var hM=X(()=>{"use strict";var yG=sr(),vG=jw(),_G=Vi(),xG=ii(),EG=Hi(),SG=Um();yG({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=_G(this),i=xG(e),s=SG(e,0);return s.length=vG(s,e,e,i,0,t===void 0?1:EG(t)),s}})});var pM=X(()=>{"use strict";var wG=bm();wG("flat")});var vM=X((mrt,yM)=>{"use strict";var MG=Xr(),gM=MG("iterator"),mM=!1;try{dM=0,Bm={next:function(){return{done:!!dM++}},return:function(){mM=!0}},Bm[gM]=function(){return this},Array.from(Bm,function(){throw 2})}catch(n){}var dM,Bm;yM.exports=function(n,t){try{if(!t&&!mM)return!1}catch(s){return!1}var e=!1;try{var i={};i[gM]=function(){return{next:function(){return{done:e=!0}}}},n(i)}catch(s){}return e}});var Nh=X((yrt,_M)=>{"use strict";_M.exports=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"});var $u=X((vrt,EM)=>{"use strict";var xM=pm(),bG=Wo();EM.exports=function(n,t,e){return e.get&&xM(e.get,t,{getter:!0}),e.set&&xM(e.set,t,{setter:!0}),bG.f(n,t,e)}});var Wi=X((_rt,RM)=>{"use strict";var AG=Nh(),qm=ri(),Si=Sn(),bM=er(),Fh=Ei(),js=oo(),Vm=Zs(),TG=qu(),CG=xs(),zm=Ha(),IG=$u(),PG=Tc(),Uh=Dc(),Ju=Xu(),RG=Xr(),LG=uh(),AM=Va(),TM=AM.enforce,NG=AM.get,Oh=Si.Int8Array,Gm=Oh&&Oh.prototype,SM=Si.Uint8ClampedArray,wM=SM&&SM.prototype,Xo=Oh&&Uh(Oh),bo=Gm&&Uh(Gm),OG=Object.prototype,Hm=Si.TypeError,MM=RG("toStringTag"),km=LG("TYPED_ARRAY_TAG"),Dh="TypedArrayConstructor",Ss=AG&&!!Ju&&Vm(Si.opera)!=="Opera",CM=!1,Li,Js,Zu,ws={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Wm={BigInt64Array:8,BigUint64Array:8},DG=function(t){if(!Fh(t))return!1;var e=Vm(t);return e==="DataView"||js(ws,e)||js(Wm,e)},IM=function(n){var t=Uh(n);if(Fh(t)){var e=NG(t);return e&&js(e,Dh)?e[Dh]:IM(t)}},PM=function(n){if(!Fh(n))return!1;var t=Vm(n);return js(ws,t)||js(Wm,t)},FG=function(n){if(PM(n))return n;throw new Hm("Target is not a typed array")},UG=function(n){if(bM(n)&&(!Ju||PG(Xo,n)))return n;throw new Hm(TG(n)+" is not a typed array constructor")},BG=function(n,t,e,i){if(qm){if(e)for(var s in ws){var u=Si[s];if(u&&js(u.prototype,n))try{delete u.prototype[n]}catch(c){try{u.prototype[n]=t}catch(f){}}}(!bo[n]||e)&&zm(bo,n,e?t:Ss&&Gm[n]||t,i)}},zG=function(n,t,e){var i,s;if(qm){if(Ju){if(e){for(i in ws)if(s=Si[i],s&&js(s,n))try{delete s[n]}catch(u){}}if(!Xo[n]||e)try{return zm(Xo,n,e?t:Ss&&Xo[n]||t)}catch(u){}else return}for(i in ws)s=Si[i],s&&(!s[n]||e)&&zm(s,n,t)}};for(Li in ws)Js=Si[Li],Zu=Js&&Js.prototype,Zu?TM(Zu)[Dh]=Js:Ss=!1;for(Li in Wm)Js=Si[Li],Zu=Js&&Js.prototype,Zu&&(TM(Zu)[Dh]=Js);if((!Ss||!bM(Xo)||Xo===Function.prototype)&&(Xo=function(){throw new Hm("Incorrect invocation")},Ss))for(Li in ws)Si[Li]&&Ju(Si[Li],Xo);if((!Ss||!bo||bo===OG)&&(bo=Xo.prototype,Ss))for(Li in ws)Si[Li]&&Ju(Si[Li].prototype,bo);Ss&&Uh(wM)!==bo&&Ju(wM,bo);if(qm&&!js(bo,MM)){CM=!0,IG(bo,MM,{configurable:!0,get:function(){return Fh(this)?this[km]:void 0}});for(Li in ws)Si[Li]&&CG(Si[Li],km,Li)}RM.exports={NATIVE_ARRAY_BUFFER_VIEWS:Ss,TYPED_ARRAY_TAG:CM&&km,aTypedArray:FG,aTypedArrayConstructor:UG,exportTypedArrayMethod:BG,exportTypedArrayStaticMethod:zG,getTypedArrayConstructor:IM,isView:DG,isTypedArray:PM,TypedArray:Xo,TypedArrayPrototype:bo}});var OM=X((xrt,NM)=>{"use strict";var LM=Sn(),Xm=An(),GG=vM(),kG=Wi().NATIVE_ARRAY_BUFFER_VIEWS,qG=LM.ArrayBuffer,Xa=LM.Int8Array;NM.exports=!kG||!Xm(function(){Xa(1)})||!Xm(function(){new Xa(-1)})||!GG(function(n){new Xa,new Xa(null),new Xa(1.5),new Xa(n)},!0)||Xm(function(){return new Xa(new qG(2),1,void 0).length!==1})});var FM=X((Ert,DM)=>{"use strict";var VG=Ha();DM.exports=function(n,t,e){for(var i in t)VG(n,i,t[i],e);return n}});var Ym=X((Srt,UM)=>{"use strict";var HG=Tc(),WG=TypeError;UM.exports=function(n,t){if(HG(t,n))return n;throw new WG("Incorrect invocation")}});var Bh=X((wrt,BM)=>{"use strict";var XG=Hi(),YG=Wa(),$G=RangeError;BM.exports=function(n){if(n===void 0)return 0;var t=XG(n),e=YG(t);if(t!==e)throw new $G("Wrong length or index");return e}});var GM=X((Mrt,zM)=>{"use strict";zM.exports=Math.sign||function(t){var e=+t;return e===0||e!==e?e:e<0?-1:1}});var VM=X((brt,qM)=>{"use strict";var ZG=2220446049250313e-31,kM=1/ZG;qM.exports=function(n){return n+kM-kM}});var WM=X((Art,HM)=>{"use strict";var JG=GM(),jG=VM(),KG=Math.abs,QG=2220446049250313e-31;HM.exports=function(n,t,e,i){var s=+n,u=KG(s),c=JG(s);if(u<i)return c*jG(u/i/t)*i*t;var f=(1+t/QG)*u,p=f-(f-u);return p>e||p!==p?c*(1/0):c*p}});var YM=X((Trt,XM)=>{"use strict";var t4=WM(),e4=11920928955078125e-23,n4=34028234663852886e22,r4=11754943508222875e-54;XM.exports=Math.fround||function(t){return t4(t,e4,n4,r4)}});var ZM=X((Crt,$M)=>{"use strict";var i4=Array,o4=Math.abs,Ms=Math.pow,s4=Math.floor,a4=Math.log,u4=Math.LN2,l4=function(n,t,e){var i=i4(e),s=e*8-t-1,u=(1<<s)-1,c=u>>1,f=t===23?Ms(2,-24)-Ms(2,-77):0,p=n<0||n===0&&1/n<0?1:0,d=0,g,y,v;for(n=o4(n),n!==n||n===1/0?(y=n!==n?1:0,g=u):(g=s4(a4(n)/u4),v=Ms(2,-g),n*v<1&&(g--,v*=2),g+c>=1?n+=f/v:n+=f*Ms(2,1-c),n*v>=2&&(g++,v/=2),g+c>=u?(y=0,g=u):g+c>=1?(y=(n*v-1)*Ms(2,t),g+=c):(y=n*Ms(2,c-1)*Ms(2,t),g=0));t>=8;)i[d++]=y&255,y/=256,t-=8;for(g=g<<t|y,s+=t;s>0;)i[d++]=g&255,g/=256,s-=8;return i[d-1]|=p*128,i},c4=function(n,t){var e=n.length,i=e*8-t-1,s=(1<<i)-1,u=s>>1,c=i-7,f=e-1,p=n[f--],d=p&127,g;for(p>>=7;c>0;)d=d*256+n[f--],c-=8;for(g=d&(1<<-c)-1,d>>=-c,c+=t;c>0;)g=g*256+n[f--],c-=8;if(d===0)d=1-u;else{if(d===s)return g?NaN:p?-1/0:1/0;g+=Ms(2,t),d-=u}return(p?-1:1)*g*Ms(2,d-t)};$M.exports={pack:l4,unpack:c4}});var $m=X((Irt,jM)=>{"use strict";var f4=Vi(),JM=xh(),h4=ii();jM.exports=function(t){for(var e=f4(this),i=h4(e),s=arguments.length,u=JM(s>1?arguments[1]:void 0,i),c=s>2?arguments[2]:void 0,f=c===void 0?i:JM(c,i);f>u;)e[u++]=t;return e}});var zh=X((Prt,KM)=>{"use strict";var p4=In();KM.exports=p4([].slice)});var Zm=X((Rrt,tb)=>{"use strict";var d4=er(),g4=Ei(),QM=Xu();tb.exports=function(n,t,e){var i,s;return QM&&d4(i=t.constructor)&&i!==e&&g4(s=i.prototype)&&s!==e.prototype&&QM(n,s),n}});var Xh=X((Lrt,yb)=>{"use strict";var Hh=Sn(),t0=In(),Jm=ri(),m4=Nh(),hb=ph(),y4=xs(),v4=$u(),eb=FM(),jm=An(),Gh=Ym(),_4=Hi(),x4=Wa(),qh=Bh(),E4=YM(),pb=ZM(),S4=Dc(),nb=Xu(),w4=$m(),M4=zh(),b4=Zm(),A4=ym(),db=Fc(),e0=Va(),T4=hb.PROPER,rb=hb.CONFIGURABLE,Ku="ArrayBuffer",Wh="DataView",Qu="prototype",C4="Wrong length",gb="Wrong index",ib=e0.getterFor(Ku),Hc=e0.getterFor(Wh),ob=e0.set,Ao=Hh[Ku],Xi=Ao,ju=Xi&&Xi[Qu],Yo=Hh[Wh],Ya=Yo&&Yo[Qu],sb=Object.prototype,I4=Hh.Array,Vh=Hh.RangeError,P4=t0(w4),R4=t0([].reverse),mb=pb.pack,ab=pb.unpack,ub=function(n){return[n&255]},lb=function(n){return[n&255,n>>8&255]},cb=function(n){return[n&255,n>>8&255,n>>16&255,n>>24&255]},fb=function(n){return n[3]<<24|n[2]<<16|n[1]<<8|n[0]},L4=function(n){return mb(E4(n),23,4)},N4=function(n){return mb(n,52,8)},kh=function(n,t,e){v4(n[Qu],t,{configurable:!0,get:function(){return e(this)[t]}})},Ks=function(n,t,e,i){var s=Hc(n),u=qh(e),c=!!i;if(u+t>s.byteLength)throw new Vh(gb);var f=s.bytes,p=u+s.byteOffset,d=M4(f,p,p+t);return c?d:R4(d)},Qs=function(n,t,e,i,s,u){var c=Hc(n),f=qh(e),p=i(+s),d=!!u;if(f+t>c.byteLength)throw new Vh(gb);for(var g=c.bytes,y=f+c.byteOffset,v=0;v<t;v++)g[y+v]=p[d?v:t-v-1]};m4?(Km=T4&&Ao.name!==Ku,!jm(function(){Ao(1)})||!jm(function(){new Ao(-1)})||jm(function(){return new Ao,new Ao(1.5),new Ao(NaN),Ao.length!==1||Km&&!rb})?(Xi=function(t){return Gh(this,ju),b4(new Ao(qh(t)),this,Xi)},Xi[Qu]=ju,ju.constructor=Xi,A4(Xi,Ao)):Km&&rb&&y4(Ao,"name",Ku),nb&&S4(Ya)!==sb&&nb(Ya,sb),Vc=new Yo(new Xi(2)),Qm=t0(Ya.setInt8),Vc.setInt8(0,2147483648),Vc.setInt8(1,2147483649),(Vc.getInt8(0)||!Vc.getInt8(1))&&eb(Ya,{setInt8:function(t,e){Qm(this,t,e<<24>>24)},setUint8:function(t,e){Qm(this,t,e<<24>>24)}},{unsafe:!0})):(Xi=function(t){Gh(this,ju);var e=qh(t);ob(this,{type:Ku,bytes:P4(I4(e),0),byteLength:e}),Jm||(this.byteLength=e,this.detached=!1)},ju=Xi[Qu],Yo=function(t,e,i){Gh(this,Ya),Gh(t,ju);var s=ib(t),u=s.byteLength,c=_4(e);if(c<0||c>u)throw new Vh("Wrong offset");if(i=i===void 0?u-c:x4(i),c+i>u)throw new Vh(C4);ob(this,{type:Wh,buffer:t,byteLength:i,byteOffset:c,bytes:s.bytes}),Jm||(this.buffer=t,this.byteLength=i,this.byteOffset=c)},Ya=Yo[Qu],Jm&&(kh(Xi,"byteLength",ib),kh(Yo,"buffer",Hc),kh(Yo,"byteLength",Hc),kh(Yo,"byteOffset",Hc)),eb(Ya,{getInt8:function(t){return Ks(this,1,t)[0]<<24>>24},getUint8:function(t){return Ks(this,1,t)[0]},getInt16:function(t){var e=Ks(this,2,t,arguments.length>1?arguments[1]:!1);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=Ks(this,2,t,arguments.length>1?arguments[1]:!1);return e[1]<<8|e[0]},getInt32:function(t){return fb(Ks(this,4,t,arguments.length>1?arguments[1]:!1))},getUint32:function(t){return fb(Ks(this,4,t,arguments.length>1?arguments[1]:!1))>>>0},getFloat32:function(t){return ab(Ks(this,4,t,arguments.length>1?arguments[1]:!1),23)},getFloat64:function(t){return ab(Ks(this,8,t,arguments.length>1?arguments[1]:!1),52)},setInt8:function(t,e){Qs(this,1,t,ub,e)},setUint8:function(t,e){Qs(this,1,t,ub,e)},setInt16:function(t,e){Qs(this,2,t,lb,e,arguments.length>2?arguments[2]:!1)},setUint16:function(t,e){Qs(this,2,t,lb,e,arguments.length>2?arguments[2]:!1)},setInt32:function(t,e){Qs(this,4,t,cb,e,arguments.length>2?arguments[2]:!1)},setUint32:function(t,e){Qs(this,4,t,cb,e,arguments.length>2?arguments[2]:!1)},setFloat32:function(t,e){Qs(this,4,t,L4,e,arguments.length>2?arguments[2]:!1)},setFloat64:function(t,e){Qs(this,8,t,N4,e,arguments.length>2?arguments[2]:!1)}}));var Km,Vc,Qm;db(Xi,Ku);db(Yo,Wh);yb.exports={ArrayBuffer:Xi,DataView:Yo}});var _b=X((Nrt,vb)=>{"use strict";var O4=Ei(),D4=Math.floor;vb.exports=Number.isInteger||function(t){return!O4(t)&&isFinite(t)&&D4(t)===t}});var Eb=X((Ort,xb)=>{"use strict";var F4=Hi(),U4=RangeError;xb.exports=function(n){var t=F4(n);if(t<0)throw new U4("The argument can't be less than 0");return t}});var n0=X((Drt,Sb)=>{"use strict";var B4=Eb(),z4=RangeError;Sb.exports=function(n,t){var e=B4(n);if(e%t)throw new z4("Wrong offset");return e}});var Mb=X((Frt,wb)=>{"use strict";var G4=Math.round;wb.exports=function(n){var t=G4(n);return t<0?0:t>255?255:t&255}});var Ab=X((Urt,bb)=>{"use strict";var k4=Fm(),q4=qu(),V4=TypeError;bb.exports=function(n){if(k4(n))return n;throw new V4(q4(n)+" is not a constructor")}});var r0=X((Brt,Cb)=>{"use strict";var H4=Zs(),Tb=Pc(),W4=nh(),X4=Wu(),Y4=Xr(),$4=Y4("iterator");Cb.exports=function(n){if(!W4(n))return Tb(n,$4)||Tb(n,"@@iterator")||X4[H4(n)]}});var Pb=X((zrt,Ib)=>{"use strict";var Z4=vr(),J4=_s(),j4=so(),K4=qu(),Q4=r0(),tk=TypeError;Ib.exports=function(n,t){var e=arguments.length<2?Q4(n):t;if(J4(e))return j4(Z4(e,n));throw new tk(K4(n)+" is not iterable")}});var Lb=X((Grt,Rb)=>{"use strict";var ek=Xr(),nk=Wu(),rk=ek("iterator"),ik=Array.prototype;Rb.exports=function(n){return n!==void 0&&(nk.Array===n||ik[rk]===n)}});var i0=X((krt,Nb)=>{"use strict";var ok=Zs();Nb.exports=function(n){var t=ok(n);return t==="BigInt64Array"||t==="BigUint64Array"}});var Yh=X((qrt,Ob)=>{"use strict";var sk=Jg(),ak=TypeError;Ob.exports=function(n){var t=sk(n,"number");if(typeof t=="number")throw new ak("Can't convert number to bigint");return BigInt(t)}});var Fb=X((Vrt,Db)=>{"use strict";var uk=kc(),lk=vr(),ck=Ab(),fk=Vi(),hk=ii(),pk=Pb(),dk=r0(),gk=Lb(),mk=i0(),yk=Wi().aTypedArrayConstructor,vk=Yh();Db.exports=function(t){var e=ck(this),i=fk(t),s=arguments.length,u=s>1?arguments[1]:void 0,c=u!==void 0,f=dk(i),p,d,g,y,v,E,M,A;if(f&&!gk(f))for(M=pk(i,f),A=M.next,i=[];!(E=lk(A,M)).done;)i.push(E.value);for(c&&s>2&&(u=uk(u,arguments[2])),d=hk(i),g=new(yk(e))(d),y=mk(g),p=0;d>p;p++)v=c?u(i[p],p):i[p],g[p]=y?vk(v):+v;return g}});var zb=X((Hrt,Bb)=>{"use strict";var _k=kc(),xk=In(),Ek=eh(),Sk=Vi(),wk=ii(),Mk=Um(),Ub=xk([].push),ta=function(n){var t=n===1,e=n===2,i=n===3,s=n===4,u=n===6,c=n===7,f=n===5||u;return function(p,d,g,y){for(var v=Sk(p),E=Ek(v),M=wk(E),A=_k(d,g),_=0,x=y||Mk,T=t?x(p,M):e||c?x(p,0):void 0,w,R;M>_;_++)if((f||_ in E)&&(w=E[_],R=A(w,_,v),n))if(t)T[_]=R;else if(R)switch(n){case 3:return!0;case 5:return w;case 6:return _;case 2:Ub(T,w)}else switch(n){case 4:return!1;case 7:Ub(T,w)}return u?-1:i||s?s:T}};Bb.exports={forEach:ta(0),map:ta(1),filter:ta(2),some:ta(3),every:ta(4),find:ta(5),findIndex:ta(6),filterReject:ta(7)}});var o0=X((Wrt,kb)=>{"use strict";var bk=$s(),Ak=$u(),Tk=Xr(),Ck=ri(),Gb=Tk("species");kb.exports=function(n){var t=bk(n);Ck&&t&&!t[Gb]&&Ak(t,Gb,{configurable:!0,get:function(){return this}})}});var s0=X((Xrt,qb)=>{"use strict";var Ik=ii();qb.exports=function(n,t,e){for(var i=0,s=arguments.length>2?e:Ik(t),u=new n(s);s>i;)u[i]=t[i++];return u}});var uA=X((Yrt,p0)=>{"use strict";var Vb=sr(),tA=Sn(),Hb=vr(),Pk=ri(),Rk=OM(),$c=Wi(),eA=Xh(),Wb=Ym(),Lk=Ac(),Wc=xs(),Nk=_b(),Ok=Wa(),Xb=Bh(),a0=n0(),Dk=Mb(),nA=lh(),Xc=oo(),Fk=Zs(),c0=Ei(),Uk=Ic(),Bk=Hu(),zk=Tc(),$h=Xu(),Gk=mm().f,Yb=Fb(),kk=zb().forEach,qk=o0(),Vk=$u(),rA=Wo(),iA=fh(),$b=s0(),d0=Va(),Hk=Zm(),f0=d0.get,Wk=d0.set,Xk=d0.enforce,oA=rA.f,Yk=iA.f,u0=tA.RangeError,sA=eA.ArrayBuffer,$k=sA.prototype,Zk=eA.DataView,Zh=$c.NATIVE_ARRAY_BUFFER_VIEWS,Zb=$c.TYPED_ARRAY_TAG,Jb=$c.TypedArray,Yc=$c.TypedArrayPrototype,h0=$c.isTypedArray,Jh="BYTES_PER_ELEMENT",l0="Wrong length",jh=function(n,t){Vk(n,t,{configurable:!0,get:function(){return f0(this)[t]}})},jb=function(n){var t;return zk($k,n)||(t=Fk(n))==="ArrayBuffer"||t==="SharedArrayBuffer"},aA=function(n,t){return h0(n)&&!Uk(t)&&t in n&&Nk(+t)&&t>=0},Kb=function(t,e){return e=nA(e),aA(t,e)?Lk(2,t[e]):Yk(t,e)},Qb=function(t,e,i){return e=nA(e),aA(t,e)&&c0(i)&&Xc(i,"value")&&!Xc(i,"get")&&!Xc(i,"set")&&!i.configurable&&(!Xc(i,"writable")||i.writable)&&(!Xc(i,"enumerable")||i.enumerable)?(t[e]=i.value,t):oA(t,e,i)};Pk?(Zh||(iA.f=Kb,rA.f=Qb,jh(Yc,"buffer"),jh(Yc,"byteOffset"),jh(Yc,"byteLength"),jh(Yc,"length")),Vb({target:"Object",stat:!0,forced:!Zh},{getOwnPropertyDescriptor:Kb,defineProperty:Qb}),p0.exports=function(n,t,e){var i=n.match(/\\d+/)[0]/8,s=n+(e?"Clamped":"")+"Array",u="get"+n,c="set"+n,f=tA[s],p=f,d=p&&p.prototype,g={},y=function(A,_){var x=f0(A);return x.view[u](_*i+x.byteOffset,!0)},v=function(A,_,x){var T=f0(A);T.view[c](_*i+T.byteOffset,e?Dk(x):x,!0)},E=function(A,_){oA(A,_,{get:function(){return y(this,_)},set:function(x){return v(this,_,x)},enumerable:!0})};Zh?Rk&&(p=t(function(A,_,x,T){return Wb(A,d),Hk(function(){return c0(_)?jb(_)?T!==void 0?new f(_,a0(x,i),T):x!==void 0?new f(_,a0(x,i)):new f(_):h0(_)?$b(p,_):Hb(Yb,p,_):new f(Xb(_))}(),A,p)}),$h&&$h(p,Jb),kk(Gk(f),function(A){A in p||Wc(p,A,f[A])}),p.prototype=d):(p=t(function(A,_,x,T){Wb(A,d);var w=0,R=0,z,U,D;if(!c0(_))D=Xb(_),U=D*i,z=new sA(U);else if(jb(_)){z=_,R=a0(x,i);var P=_.byteLength;if(T===void 0){if(P%i)throw new u0(l0);if(U=P-R,U<0)throw new u0(l0)}else if(U=Ok(T)*i,U+R>P)throw new u0(l0);D=U/i}else return h0(_)?$b(p,_):Hb(Yb,p,_);for(Wk(A,{buffer:z,byteOffset:R,byteLength:U,length:D,view:new Zk(z)});w<D;)E(A,w++)}),$h&&$h(p,Jb),d=p.prototype=Bk(Yc)),d.constructor!==p&&Wc(d,"constructor",p),Xk(d).TypedArrayConstructor=p,Zb&&Wc(d,Zb,s);var M=p!==f;g[s]=p,Vb({global:!0,constructor:!0,forced:M,sham:!Zh},g),Jh in p||Wc(p,Jh,i),Jh in d||Wc(d,Jh,i),qk(s)}):p0.exports=function(){}});var g0=X(()=>{"use strict";var Jk=uA();Jk("Float32",function(n){return function(e,i,s){return n(this,e,i,s)}})});var m0=X(()=>{"use strict";var lA=Wi(),jk=ii(),Kk=Hi(),Qk=lA.aTypedArray,tq=lA.exportTypedArrayMethod;tq("at",function(t){var e=Qk(this),i=jk(e),s=Kk(t),u=s>=0?s:i+s;return u<0||u>=i?void 0:e[u]})});var y0=X(()=>{"use strict";var cA=Wi(),eq=$m(),nq=Yh(),rq=Zs(),iq=vr(),oq=In(),sq=An(),aq=cA.aTypedArray,uq=cA.exportTypedArrayMethod,lq=oq("".slice),cq=sq(function(){var n=0;return new Int8Array(2).fill({valueOf:function(){return n++}}),n!==1});uq("fill",function(t){var e=arguments.length;aq(this);var i=lq(rq(this),0,3)==="Big"?nq(t):+t;return iq(eq,this,i,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)},cq)});var v0=X((tit,hA)=>{"use strict";var fq=kc(),hq=eh(),pq=Vi(),dq=ii(),fA=function(n){var t=n===1;return function(e,i,s){for(var u=pq(e),c=hq(u),f=dq(c),p=fq(i,s),d,g;f-- >0;)if(d=c[f],g=p(d,f,u),g)switch(n){case 0:return d;case 1:return f}return t?-1:void 0}};hA.exports={findLast:fA(0),findLastIndex:fA(1)}});var _0=X(()=>{"use strict";var pA=Wi(),gq=v0().findLast,mq=pA.aTypedArray,yq=pA.exportTypedArrayMethod;yq("findLast",function(t){return gq(mq(this),t,arguments.length>1?arguments[1]:void 0)})});var x0=X(()=>{"use strict";var dA=Wi(),vq=v0().findLastIndex,_q=dA.aTypedArray,xq=dA.exportTypedArrayMethod;xq("findLastIndex",function(t){return vq(_q(this),t,arguments.length>1?arguments[1]:void 0)})});var M0=X(()=>{"use strict";var mA=Sn(),yA=vr(),w0=Wi(),Eq=ii(),Sq=n0(),wq=Vi(),vA=An(),Mq=mA.RangeError,E0=mA.Int8Array,gA=E0&&E0.prototype,_A=gA&&gA.set,bq=w0.aTypedArray,Aq=w0.exportTypedArrayMethod,S0=!vA(function(){var n=new Uint8ClampedArray(2);return yA(_A,n,{length:1,0:3},1),n[1]!==3}),Tq=S0&&w0.NATIVE_ARRAY_BUFFER_VIEWS&&vA(function(){var n=new E0(2);return n.set(1),n.set("2",1),n[0]!==0||n[1]!==2});Aq("set",function(t){bq(this);var e=Sq(arguments.length>1?arguments[1]:void 0,1),i=wq(t);if(S0)return yA(_A,this,i,e);var s=this.length,u=Eq(i),c=0;if(u+e>s)throw new Mq("Wrong length");for(;c<u;)this[e+c]=i[c++]},!S0||Tq)});var A0=X((ait,EA)=>{"use strict";var xA=zh(),Cq=Math.floor,b0=function(n,t){var e=n.length;if(e<8)for(var i=1,s,u;i<e;){for(u=i,s=n[i];u&&t(n[u-1],s)>0;)n[u]=n[--u];u!==i++&&(n[u]=s)}else for(var c=Cq(e/2),f=b0(xA(n,0,c),t),p=b0(xA(n,c),t),d=f.length,g=p.length,y=0,v=0;y<d||v<g;)n[y+v]=y<d&&v<g?t(f[y],p[v])<=0?f[y++]:p[v++]:y<d?f[y++]:p[v++];return n};EA.exports=b0});var T0=X((uit,wA)=>{"use strict";var Iq=ku(),SA=Iq.match(/firefox\\/(\\d+)/i);wA.exports=!!SA&&+SA[1]});var C0=X((lit,MA)=>{"use strict";var Pq=ku();MA.exports=/MSIE|Trident/.test(Pq)});var I0=X((cit,AA)=>{"use strict";var Rq=ku(),bA=Rq.match(/AppleWebKit\\/(\\d+)\\./);AA.exports=!!bA&&+bA[1]});var R0=X(()=>{"use strict";var Lq=Sn(),Nq=Rh(),P0=An(),Oq=_s(),Dq=A0(),RA=Wi(),TA=T0(),Fq=C0(),CA=Cc(),IA=I0(),Uq=RA.aTypedArray,Bq=RA.exportTypedArrayMethod,Zc=Lq.Uint16Array,tl=Zc&&Nq(Zc.prototype.sort),zq=!!tl&&!(P0(function(){tl(new Zc(2),null)})&&P0(function(){tl(new Zc(2),{})})),PA=!!tl&&!P0(function(){if(CA)return CA<74;if(TA)return TA<67;if(Fq)return!0;if(IA)return IA<602;var n=new Zc(516),t=Array(516),e,i;for(e=0;e<516;e++)i=e%4,n[e]=515-e,t[e]=e-2*i+3;for(tl(n,function(s,u){return(s/4|0)-(u/4|0)}),e=0;e<516;e++)if(n[e]!==t[e])return!0}),Gq=function(n){return function(t,e){return n!==void 0?+n(t,e)||0:e!==e?-1:t!==t?1:t===0&&e===0?1/t>0&&1/e<0?1:-1:t>e}};Bq("sort",function(t){return t!==void 0&&Oq(t),PA?tl(this,t):Dq(Uq(this),Gq(t))},!PA||zq)});var NA=X((pit,LA)=>{"use strict";var kq=ii();LA.exports=function(n,t){for(var e=kq(n),i=new t(e),s=0;s<e;s++)i[s]=n[e-s-1];return i}});var N0=X(()=>{"use strict";var qq=NA(),L0=Wi(),Vq=L0.aTypedArray,Hq=L0.exportTypedArrayMethod,Wq=L0.getTypedArrayConstructor;Hq("toReversed",function(){return qq(Vq(this),Wq(this))})});var O0=X(()=>{"use strict";var Kh=Wi(),Xq=In(),Yq=_s(),$q=s0(),Zq=Kh.aTypedArray,Jq=Kh.getTypedArrayConstructor,jq=Kh.exportTypedArrayMethod,Kq=Xq(Kh.TypedArrayPrototype.sort);jq("toSorted",function(t){t!==void 0&&Yq(t);var e=Zq(this),i=$q(Jq(e),e);return Kq(i,t)})});var DA=X((vit,OA)=>{"use strict";var Qq=ii(),t5=Hi(),e5=RangeError;OA.exports=function(n,t,e,i){var s=Qq(n),u=t5(e),c=u<0?s+u:u;if(c>=s||c<0)throw new e5("Incorrect index");for(var f=new t(s),p=0;p<s;p++)f[p]=p===c?i:n[p];return f}});var F0=X(()=>{"use strict";var n5=DA(),D0=Wi(),r5=i0(),i5=Hi(),o5=Yh(),s5=D0.aTypedArray,a5=D0.getTypedArrayConstructor,u5=D0.exportTypedArrayMethod,l5=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(n){return n===8}}();u5("with",function(n,t){var e=s5(this),i=i5(n),s=r5(e)?o5(t):+t;return n5(e,a5(e),i,s)},!l5)});var B0=X(()=>{"use strict";var c5=sr(),f5=Sn(),h5=Xh(),p5=o0(),U0="ArrayBuffer",FA=h5[U0],d5=f5[U0];c5({global:!0,constructor:!0,forced:d5!==FA},{ArrayBuffer:FA});p5(U0)});var q0=X(()=>{"use strict";var g5=sr(),G0=Rh(),m5=An(),GA=Xh(),UA=so(),BA=xh(),y5=Wa(),k0=GA.ArrayBuffer,z0=GA.DataView,kA=z0.prototype,zA=G0(k0.prototype.slice),v5=G0(kA.getUint8),_5=G0(kA.setUint8),x5=m5(function(){return!new k0(2).slice(1,void 0).byteLength});g5({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:x5},{slice:function(t,e){if(zA&&e===void 0)return zA(UA(this),t);for(var i=UA(this).byteLength,s=BA(t,i),u=BA(e===void 0?i:e,i),c=new k0(y5(u-s)),f=new z0(this),p=new z0(c),d=0;s<u;)_5(p,d++,v5(f,s++));return c}})});var V0=X((bit,HA)=>{"use strict";var VA=Sn(),E5=Uc(),S5=vs(),qA=VA.ArrayBuffer,w5=VA.TypeError;HA.exports=qA&&E5(qA.prototype,"byteLength","get")||function(n){if(S5(n)!=="ArrayBuffer")throw new w5("ArrayBuffer expected");return n.byteLength}});var H0=X((Ait,WA)=>{"use strict";var M5=Sn(),b5=Nh(),A5=V0(),T5=M5.DataView;WA.exports=function(n){if(!b5||A5(n)!==0)return!1;try{return new T5(n),!1}catch(t){return!0}}});var W0=X(()=>{"use strict";var C5=ri(),I5=$u(),P5=H0(),XA=ArrayBuffer.prototype;C5&&!("detached"in XA)&&I5(XA,"detached",{configurable:!0,get:function(){return P5(this)}})});var $A=X((Iit,YA)=>{"use strict";var R5=H0(),L5=TypeError;YA.exports=function(n){if(R5(n))throw new L5("ArrayBuffer is detached");return n}});var X0=X((Pit,ZA)=>{"use strict";var Jc=Sn(),N5=ku(),O5=vs(),Qh=function(n){return N5.slice(0,n.length)===n};ZA.exports=function(){return Qh("Bun/")?"BUN":Qh("Cloudflare-Workers")?"CLOUDFLARE":Qh("Deno/")?"DENO":Qh("Node.js/")?"NODE":Jc.Bun&&typeof Bun.version=="string"?"BUN":Jc.Deno&&typeof Deno.version=="object"?"DENO":O5(Jc.process)==="process"?"NODE":Jc.window&&Jc.document?"BROWSER":"REST"}()});var jA=X((Rit,JA)=>{"use strict";var D5=X0();JA.exports=D5==="NODE"});var QA=X((Lit,KA)=>{"use strict";var F5=Sn(),U5=jA();KA.exports=function(n){if(U5){try{return F5.process.getBuiltinModule(n)}catch(t){}try{return Function('return require("'+n+'")')()}catch(t){}}}});var Z0=X((Nit,eT)=>{"use strict";var B5=Sn(),z5=An(),Y0=Cc(),$0=X0(),tT=B5.structuredClone;eT.exports=!!tT&&!z5(function(){if($0==="DENO"&&Y0>92||$0==="NODE"&&Y0>94||$0==="BROWSER"&&Y0>97)return!1;var n=new ArrayBuffer(8),t=tT(n,{transfer:[n]});return n.byteLength!==0||t.byteLength!==8})});var oT=X((Oit,iT)=>{"use strict";var Q0=Sn(),G5=QA(),k5=Z0(),q5=Q0.structuredClone,nT=Q0.ArrayBuffer,tp=Q0.MessageChannel,K0=!1,J0,rT,ep,j0;if(k5)K0=function(n){q5(n,{transfer:[n]})};else if(nT)try{tp||(J0=G5("worker_threads"),J0&&(tp=J0.MessageChannel)),tp&&(rT=new tp,ep=new nT(2),j0=function(n){rT.port1.postMessage(null,[n])},ep.byteLength===2&&(j0(ep),ep.byteLength===0&&(K0=j0)))}catch(n){}iT.exports=K0});var oy=X((Dit,hT)=>{"use strict";var ny=Sn(),ry=In(),lT=Uc(),V5=Bh(),H5=$A(),W5=V0(),sT=oT(),ty=Z0(),X5=ny.structuredClone,cT=ny.ArrayBuffer,ey=ny.DataView,Y5=Math.min,iy=cT.prototype,fT=ey.prototype,$5=ry(iy.slice),aT=lT(iy,"resizable","get"),uT=lT(iy,"maxByteLength","get"),Z5=ry(fT.getInt8),J5=ry(fT.setInt8);hT.exports=(ty||sT)&&function(n,t,e){var i=W5(n),s=t===void 0?i:V5(t),u=!aT||!aT(n),c;if(H5(n),ty&&(n=X5(n,{transfer:[n]}),i===s&&(e||u)))return n;if(i>=s&&(!e||u))c=$5(n,0,s);else{var f=e&&!u&&uT?{maxByteLength:uT(n)}:void 0;c=new cT(s,f);for(var p=new ey(n),d=new ey(c),g=Y5(s,i),y=0;y<g;y++)J5(d,y,Z5(p,y))}return ty||sT(n),c}});var sy=X(()=>{"use strict";var j5=sr(),pT=oy();pT&&j5({target:"ArrayBuffer",proto:!0},{transfer:function(){return pT(this,arguments.length?arguments[0]:void 0,!0)}})});var ay=X(()=>{"use strict";var K5=sr(),dT=oy();dT&&K5({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return dT(this,arguments.length?arguments[0]:void 0,!1)}})});var To=X((Git,gT)=>{"use strict";var uy=In(),np=Set.prototype;gT.exports={Set,add:uy(np.add),has:uy(np.has),remove:uy(np.delete),proto:np}});var ea=X((kit,mT)=>{"use strict";var Q5=To().has;mT.exports=function(n){return Q5(n),n}});var na=X((qit,yT)=>{"use strict";var tV=vr();yT.exports=function(n,t,e){for(var i=e?n:n.iterator,s=n.next,u,c;!(u=tV(s,i)).done;)if(c=t(u.value),c!==void 0)return c}});var el=X((Vit,ST)=>{"use strict";var vT=In(),eV=na(),_T=To(),nV=_T.Set,xT=_T.proto,rV=vT(xT.forEach),ET=vT(xT.keys),iV=ET(new nV).next;ST.exports=function(n,t,e){return e?eV({iterator:ET(n),next:iV},t):rV(n,t)}});var rp=X((Hit,MT)=>{"use strict";var wT=To(),oV=el(),sV=wT.Set,aV=wT.add;MT.exports=function(n){var t=new sV;return oV(n,function(e){aV(t,e)}),t}});var nl=X((Wit,bT)=>{"use strict";var uV=Uc(),lV=To();bT.exports=uV(lV.proto,"size","get")||function(n){return n.size}});var TT=X((Xit,AT)=>{"use strict";AT.exports=function(n){return{iterator:n,next:n.next,done:!1}}});var ra=X((Yit,NT)=>{"use strict";var CT=_s(),RT=so(),IT=vr(),cV=Hi(),fV=TT(),PT="Invalid size",hV=RangeError,pV=TypeError,dV=Math.max,LT=function(n,t){this.set=n,this.size=dV(t,0),this.has=CT(n.has),this.keys=CT(n.keys)};LT.prototype={getIterator:function(){return fV(RT(IT(this.keys,this.set)))},includes:function(n){return IT(this.has,this.set,n)}};NT.exports=function(n){RT(n);var t=+n.size;if(t!==t)throw new pV(PT);var e=cV(t);if(e<0)throw new hV(PT);return new LT(n,e)}});var UT=X(($it,FT)=>{"use strict";var gV=ea(),DT=To(),mV=rp(),yV=nl(),vV=ra(),_V=el(),xV=na(),EV=DT.has,OT=DT.remove;FT.exports=function(t){var e=gV(this),i=vV(t),s=mV(e);return yV(e)<=i.size?_V(e,function(u){i.includes(u)&&OT(s,u)}):xV(i.getIterator(),function(u){EV(e,u)&&OT(s,u)}),s}});var ia=X((Zit,GT)=>{"use strict";var SV=$s(),BT=function(n){return{size:n,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},zT=function(n){return{size:n,has:function(){return!0},keys:function(){throw new Error("e")}}};GT.exports=function(n,t){var e=SV("Set");try{new e()[n](BT(0));try{return new e()[n](BT(-1)),!1}catch(s){if(!t)return!0;try{return new e()[n](zT(-1/0)),!1}catch(u){var i=new e;return i.add(1),i.add(2),t(i[n](zT(1/0)))}}}catch(s){return!1}}});var kT=X(()=>{"use strict";var wV=sr(),MV=UT(),bV=ia(),AV=!bV("difference",function(n){return n.size===0});wV({target:"Set",proto:!0,real:!0,forced:AV},{difference:MV})});var HT=X((Kit,VT)=>{"use strict";var TV=ea(),ly=To(),CV=nl(),IV=ra(),PV=el(),RV=na(),LV=ly.Set,qT=ly.add,NV=ly.has;VT.exports=function(t){var e=TV(this),i=IV(t),s=new LV;return CV(e)>i.size?RV(i.getIterator(),function(u){NV(e,u)&&qT(s,u)}):PV(e,function(u){i.includes(u)&&qT(s,u)}),s}});var WT=X(()=>{"use strict";var OV=sr(),DV=An(),FV=HT(),UV=ia(),BV=!UV("intersection",function(n){return n.size===2&&n.has(1)&&n.has(2)})||DV(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});OV({target:"Set",proto:!0,real:!0,forced:BV},{intersection:FV})});var cy=X((eot,YT)=>{"use strict";var zV=vr(),XT=so(),GV=Pc();YT.exports=function(n,t,e){var i,s;XT(n);try{if(i=GV(n,"return"),!i){if(t==="throw")throw e;return e}i=zV(i,n)}catch(u){s=!0,i=u}if(t==="throw")throw e;if(s)throw i;return XT(i),e}});var ZT=X((not,$T)=>{"use strict";var kV=ea(),qV=To().has,VV=nl(),HV=ra(),WV=el(),XV=na(),YV=cy();$T.exports=function(t){var e=kV(this),i=HV(t);if(VV(e)<=i.size)return WV(e,function(u){if(i.includes(u))return!1},!0)!==!1;var s=i.getIterator();return XV(s,function(u){if(qV(e,u))return YV(s,"normal",!1)})!==!1}});var JT=X(()=>{"use strict";var $V=sr(),ZV=ZT(),JV=ia(),jV=!JV("isDisjointFrom",function(n){return!n});$V({target:"Set",proto:!0,real:!0,forced:jV},{isDisjointFrom:ZV})});var KT=X((oot,jT)=>{"use strict";var KV=ea(),QV=nl(),tH=el(),eH=ra();jT.exports=function(t){var e=KV(this),i=eH(t);return QV(e)>i.size?!1:tH(e,function(s){if(!i.includes(s))return!1},!0)!==!1}});var QT=X(()=>{"use strict";var nH=sr(),rH=KT(),iH=ia(),oH=!iH("isSubsetOf",function(n){return n});nH({target:"Set",proto:!0,real:!0,forced:oH},{isSubsetOf:rH})});var eC=X((uot,tC)=>{"use strict";var sH=ea(),aH=To().has,uH=nl(),lH=ra(),cH=na(),fH=cy();tC.exports=function(t){var e=sH(this),i=lH(t);if(uH(e)<i.size)return!1;var s=i.getIterator();return cH(s,function(u){if(!aH(e,u))return fH(s,"normal",!1)})!==!1}});var nC=X(()=>{"use strict";var hH=sr(),pH=eC(),dH=ia(),gH=!dH("isSupersetOf",function(n){return!n});hH({target:"Set",proto:!0,real:!0,forced:gH},{isSupersetOf:pH})});var iC=X((fot,rC)=>{"use strict";var mH=ea(),fy=To(),yH=rp(),vH=ra(),_H=na(),xH=fy.add,EH=fy.has,SH=fy.remove;rC.exports=function(t){var e=mH(this),i=vH(t).getIterator(),s=yH(e);return _H(i,function(u){EH(e,u)?SH(s,u):xH(s,u)}),s}});var oC=X(()=>{"use strict";var wH=sr(),MH=iC(),bH=ia();wH({target:"Set",proto:!0,real:!0,forced:!bH("symmetricDifference")},{symmetricDifference:MH})});var aC=X((dot,sC)=>{"use strict";var AH=ea(),TH=To().add,CH=rp(),IH=ra(),PH=na();sC.exports=function(t){var e=AH(this),i=IH(t).getIterator(),s=CH(e);return PH(i,function(u){TH(s,u)}),s}});var uC=X(()=>{"use strict";var RH=sr(),LH=aC(),NH=ia();RH({target:"Set",proto:!0,real:!0,forced:!NH("union")},{union:LH})});var hy=X((yot,cC)=>{"use strict";var lC=qu(),OH=TypeError;cC.exports=function(n,t){if(!delete n[t])throw new OH("Cannot delete property "+lC(t)+" of "+lC(n))}});var fC=X(()=>{"use strict";var DH=sr(),FH=Vi(),UH=ii(),BH=vm(),zH=hy(),GH=wh(),kH=[].unshift(0)!==1,qH=function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(n){return n instanceof TypeError}},VH=kH||!qH();DH({target:"Array",proto:!0,arity:1,forced:VH},{unshift:function(t){var e=FH(this),i=UH(e),s=arguments.length;if(s){GH(i+s);for(var u=i;u--;){var c=u+s;u in e?e[c]=e[u]:zH(e,c)}for(var f=0;f<s;f++)e[f]=arguments[f]}return BH(e,i+s)}})});var Fl=X((Not,gP)=>{"use strict";var bY=Zs(),AY=String;gP.exports=function(n){if(bY(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return AY(n)}});var yP=X((Oot,mP)=>{"use strict";var TY=so();mP.exports=function(){var n=TY(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 _P=X((Dot,vP)=>{"use strict";var t_=An(),CY=Sn(),e_=CY.RegExp,n_=t_(function(){var n=e_("a","y");return n.lastIndex=2,n.exec("abcd")!==null}),IY=n_||t_(function(){return!e_("a","y").sticky}),PY=n_||t_(function(){var n=e_("^r","gy");return n.lastIndex=2,n.exec("str")!==null});vP.exports={BROKEN_CARET:PY,MISSED_STICKY:IY,UNSUPPORTED_Y:n_}});var EP=X((Fot,xP)=>{"use strict";var RY=An(),LY=Sn(),NY=LY.RegExp;xP.exports=RY(function(){var n=NY(".","s");return!(n.dotAll&&n.test(\`
12313
12313
  \`)&&n.flags==="s")})});var wP=X((Uot,SP)=>{"use strict";var OY=An(),DY=Sn(),FY=DY.RegExp;SP.exports=OY(function(){var n=FY("(?<a>b)","g");return n.exec("b").groups.a!=="b"||"b".replace(n,"$<a>c")!=="bc"})});var gd=X((Bot,bP)=>{"use strict";var Ul=vr(),dd=In(),UY=Fl(),BY=yP(),zY=_P(),GY=ah(),kY=Hu(),qY=Va().get,VY=EP(),HY=wP(),WY=GY("native-string-replace",String.prototype.replace),pd=RegExp.prototype.exec,i_=pd,XY=dd("".charAt),YY=dd("".indexOf),$Y=dd("".replace),r_=dd("".slice),o_=function(){var n=/a/,t=/b*/g;return Ul(pd,n,"a"),Ul(pd,t,"a"),n.lastIndex!==0||t.lastIndex!==0}(),MP=zY.BROKEN_CARET,s_=/()??/.exec("")[1]!==void 0,ZY=o_||s_||MP||VY||HY;ZY&&(i_=function(t){var e=this,i=qY(e),s=UY(t),u=i.raw,c,f,p,d,g,y,v;if(u)return u.lastIndex=e.lastIndex,c=Ul(i_,u,s),e.lastIndex=u.lastIndex,c;var E=i.groups,M=MP&&e.sticky,A=Ul(BY,e),_=e.source,x=0,T=s;if(M&&(A=$Y(A,"y",""),YY(A,"g")===-1&&(A+="g"),T=r_(s,e.lastIndex),e.lastIndex>0&&(!e.multiline||e.multiline&&XY(s,e.lastIndex-1)!==\`
12314
12314
  \`)&&(_="(?: "+_+")",T=" "+T,x++),f=new RegExp("^(?:"+_+")",A)),s_&&(f=new RegExp("^"+_+"$(?!\\\\s)",A)),o_&&(p=e.lastIndex),d=Ul(pd,M?f:e,T),M?d?(d.input=r_(d.input,x),d[0]=r_(d[0],x),d.index=e.lastIndex,e.lastIndex+=d[0].length):e.lastIndex=0:o_&&d&&(e.lastIndex=e.global?d.index+d[0].length:p),s_&&d&&d.length>1&&Ul(WY,d[0],f,function(){for(g=1;g<arguments.length-2;g++)arguments[g]===void 0&&(d[g]=void 0)}),d&&E)for(d.groups=y=kY(null),g=0;g<E.length;g++)v=E[g],y[v[0]]=d[v[1]];return d});bP.exports=i_});var a_=X(()=>{"use strict";var JY=sr(),AP=gd();JY({target:"RegExp",proto:!0,forced:/./.exec!==AP},{exec:AP})});var md=X((Yot,IP)=>{"use strict";var CP=Object.getOwnPropertySymbols,t$=Object.prototype.hasOwnProperty,e$=Object.prototype.propertyIsEnumerable;function n$(n){if(n==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function r$(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[0]==="5")return!1;for(var t={},e=0;e<10;e++)t["_"+String.fromCharCode(e)]=e;var i=Object.getOwnPropertyNames(t).map(function(u){return t[u]});if(i.join("")!=="0123456789")return!1;var s={};return"abcdefghijklmnopqrst".split("").forEach(function(u){s[u]=u}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch(u){return!1}}IP.exports=r$()?Object.assign:function(n,t){for(var e,i=n$(n),s,u=1;u<arguments.length;u++){e=Object(arguments[u]);for(var c in e)t$.call(e,c)&&(i[c]=e[c]);if(CP){s=CP(e);for(var f=0;f<s.length;f++)e$.call(e,s[f])&&(i[s[f]]=e[s[f]])}}return i}});var p_=X((f_,h_)=>{(function(n,t){typeof f_=="object"&&typeof h_!="undefined"?h_.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self).RBush=t()})(f_,function(){"use strict";function n(_,x,T,w,R){(function z(U,D,P,ct,L){for(;ct>P;){if(ct-P>600){var W=ct-P+1,V=D-P+1,Mt=Math.log(W),$=.5*Math.exp(2*Mt/3),gt=.5*Math.sqrt(Mt*$*(W-$)/W)*(V-W/2<0?-1:1),ft=Math.max(P,Math.floor(D-V*$/W+gt)),vt=Math.min(ct,Math.floor(D+(W-V)*$/W+gt));z(U,D,ft,vt,L)}var it=U[D],lt=P,H=ct;for(t(U,P,D),L(U[ct],it)>0&&t(U,P,ct);lt<H;){for(t(U,lt,H),lt++,H--;L(U[lt],it)<0;)lt++;for(;L(U[H],it)>0;)H--}L(U[P],it)===0?t(U,P,H):t(U,++H,ct),H<=D&&(P=H+1),D<=H&&(ct=H-1)}})(_,x,T||0,w||_.length-1,R||e)}function t(_,x,T){var w=_[x];_[x]=_[T],_[T]=w}function e(_,x){return _<x?-1:_>x?1:0}var i=function(_){_===void 0&&(_=9),this._maxEntries=Math.max(4,_),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function s(_,x,T){if(!T)return x.indexOf(_);for(var w=0;w<x.length;w++)if(T(_,x[w]))return w;return-1}function u(_,x){c(_,0,_.children.length,x,_)}function c(_,x,T,w,R){R||(R=M(null)),R.minX=1/0,R.minY=1/0,R.maxX=-1/0,R.maxY=-1/0;for(var z=x;z<T;z++){var U=_.children[z];f(R,_.leaf?w(U):U)}return R}function f(_,x){return _.minX=Math.min(_.minX,x.minX),_.minY=Math.min(_.minY,x.minY),_.maxX=Math.max(_.maxX,x.maxX),_.maxY=Math.max(_.maxY,x.maxY),_}function p(_,x){return _.minX-x.minX}function d(_,x){return _.minY-x.minY}function g(_){return(_.maxX-_.minX)*(_.maxY-_.minY)}function y(_){return _.maxX-_.minX+(_.maxY-_.minY)}function v(_,x){return _.minX<=x.minX&&_.minY<=x.minY&&x.maxX<=_.maxX&&x.maxY<=_.maxY}function E(_,x){return x.minX<=_.maxX&&x.minY<=_.maxY&&x.maxX>=_.minX&&x.maxY>=_.minY}function M(_){return{children:_,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function A(_,x,T,w,R){for(var z=[x,T];z.length;)if(!((T=z.pop())-(x=z.pop())<=w)){var U=x+Math.ceil((T-x)/w/2)*w;n(_,U,x,T,R),z.push(x,U,U,T)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(_){var x=this.data,T=[];if(!E(_,x))return T;for(var w=this.toBBox,R=[];x;){for(var z=0;z<x.children.length;z++){var U=x.children[z],D=x.leaf?w(U):U;E(_,D)&&(x.leaf?T.push(U):v(_,D)?this._all(U,T):R.push(U))}x=R.pop()}return T},i.prototype.collides=function(_){var x=this.data;if(!E(_,x))return!1;for(var T=[];x;){for(var w=0;w<x.children.length;w++){var R=x.children[w],z=x.leaf?this.toBBox(R):R;if(E(_,z)){if(x.leaf||v(_,z))return!0;T.push(R)}}x=T.pop()}return!1},i.prototype.load=function(_){if(!_||!_.length)return this;if(_.length<this._minEntries){for(var x=0;x<_.length;x++)this.insert(_[x]);return this}var T=this._build(_.slice(),0,_.length-1,0);if(this.data.children.length)if(this.data.height===T.height)this._splitRoot(this.data,T);else{if(this.data.height<T.height){var w=this.data;this.data=T,T=w}this._insert(T,this.data.height-T.height-1,!0)}else this.data=T;return this},i.prototype.insert=function(_){return _&&this._insert(_,this.data.height-1),this},i.prototype.clear=function(){return this.data=M([]),this},i.prototype.remove=function(_,x){if(!_)return this;for(var T,w,R,z=this.data,U=this.toBBox(_),D=[],P=[];z||D.length;){if(z||(z=D.pop(),w=D[D.length-1],T=P.pop(),R=!0),z.leaf){var ct=s(_,z.children,x);if(ct!==-1)return z.children.splice(ct,1),D.push(z),this._condense(D),this}R||z.leaf||!v(z,U)?w?(T++,z=w.children[T],R=!1):z=null:(D.push(z),P.push(T),T=0,w=z,z=z.children[0])}return this},i.prototype.toBBox=function(_){return _},i.prototype.compareMinX=function(_,x){return _.minX-x.minX},i.prototype.compareMinY=function(_,x){return _.minY-x.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(_){return this.data=_,this},i.prototype._all=function(_,x){for(var T=[];_;)_.leaf?x.push.apply(x,_.children):T.push.apply(T,_.children),_=T.pop();return x},i.prototype._build=function(_,x,T,w){var R,z=T-x+1,U=this._maxEntries;if(z<=U)return u(R=M(_.slice(x,T+1)),this.toBBox),R;w||(w=Math.ceil(Math.log(z)/Math.log(U)),U=Math.ceil(z/Math.pow(U,w-1))),(R=M([])).leaf=!1,R.height=w;var D=Math.ceil(z/U),P=D*Math.ceil(Math.sqrt(U));A(_,x,T,P,this.compareMinX);for(var ct=x;ct<=T;ct+=P){var L=Math.min(ct+P-1,T);A(_,ct,L,D,this.compareMinY);for(var W=ct;W<=L;W+=D){var V=Math.min(W+D-1,L);R.children.push(this._build(_,W,V,w-1))}}return u(R,this.toBBox),R},i.prototype._chooseSubtree=function(_,x,T,w){for(;w.push(x),!x.leaf&&w.length-1!==T;){for(var R=1/0,z=1/0,U=void 0,D=0;D<x.children.length;D++){var P=x.children[D],ct=g(P),L=(W=_,V=P,(Math.max(V.maxX,W.maxX)-Math.min(V.minX,W.minX))*(Math.max(V.maxY,W.maxY)-Math.min(V.minY,W.minY))-ct);L<z?(z=L,R=ct<R?ct:R,U=P):L===z&&ct<R&&(R=ct,U=P)}x=U||x.children[0]}var W,V;return x},i.prototype._insert=function(_,x,T){var w=T?_:this.toBBox(_),R=[],z=this._chooseSubtree(w,this.data,x,R);for(z.children.push(_),f(z,w);x>=0&&R[x].children.length>this._maxEntries;)this._split(R,x),x--;this._adjustParentBBoxes(w,R,x)},i.prototype._split=function(_,x){var T=_[x],w=T.children.length,R=this._minEntries;this._chooseSplitAxis(T,R,w);var z=this._chooseSplitIndex(T,R,w),U=M(T.children.splice(z,T.children.length-z));U.height=T.height,U.leaf=T.leaf,u(T,this.toBBox),u(U,this.toBBox),x?_[x-1].children.push(U):this._splitRoot(T,U)},i.prototype._splitRoot=function(_,x){this.data=M([_,x]),this.data.height=_.height+1,this.data.leaf=!1,u(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(_,x,T){for(var w,R,z,U,D,P,ct,L=1/0,W=1/0,V=x;V<=T-x;V++){var Mt=c(_,0,V,this.toBBox),$=c(_,V,T,this.toBBox),gt=(R=Mt,z=$,U=void 0,D=void 0,P=void 0,ct=void 0,U=Math.max(R.minX,z.minX),D=Math.max(R.minY,z.minY),P=Math.min(R.maxX,z.maxX),ct=Math.min(R.maxY,z.maxY),Math.max(0,P-U)*Math.max(0,ct-D)),ft=g(Mt)+g($);gt<L?(L=gt,w=V,W=ft<W?ft:W):gt===L&&ft<W&&(W=ft,w=V)}return w||T-x},i.prototype._chooseSplitAxis=function(_,x,T){var w=_.leaf?this.compareMinX:p,R=_.leaf?this.compareMinY:d;this._allDistMargin(_,x,T,w)<this._allDistMargin(_,x,T,R)&&_.children.sort(w)},i.prototype._allDistMargin=function(_,x,T,w){_.children.sort(w);for(var R=this.toBBox,z=c(_,0,x,R),U=c(_,T-x,T,R),D=y(z)+y(U),P=x;P<T-x;P++){var ct=_.children[P];f(z,_.leaf?R(ct):ct),D+=y(z)}for(var L=T-x-1;L>=x;L--){var W=_.children[L];f(U,_.leaf?R(W):W),D+=y(U)}return D},i.prototype._adjustParentBBoxes=function(_,x,T){for(var w=T;w>=0;w--)f(x[w],_)},i.prototype._condense=function(_){for(var x=_.length-1,T=void 0;x>=0;x--)_[x].children.length===0?x>0?(T=_[x-1].children).splice(T.indexOf(_[x]),1):this.clear():u(_[x],this.toBBox)},i})});var PP=X((d_,g_)=>{(function(n,t){typeof d_=="object"&&typeof g_!="undefined"?g_.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self,n.TinyQueue=t())})(d_,function(){"use strict";var n=function(i,s){if(i===void 0&&(i=[]),s===void 0&&(s=t),this.data=i,this.length=this.data.length,this.compare=s,this.length>0)for(var u=(this.length>>1)-1;u>=0;u--)this._down(u)};n.prototype.push=function(i){this.data.push(i),this.length++,this._up(this.length-1)},n.prototype.pop=function(){if(this.length!==0){var i=this.data[0],s=this.data.pop();return this.length--,this.length>0&&(this.data[0]=s,this._down(0)),i}},n.prototype.peek=function(){return this.data[0]},n.prototype._up=function(i){for(var s=this,u=s.data,c=s.compare,f=u[i];i>0;){var p=i-1>>1,d=u[p];if(c(f,d)>=0)break;u[i]=d,i=p}u[i]=f},n.prototype._down=function(i){for(var s=this,u=s.data,c=s.compare,f=this.length>>1,p=u[i];i<f;){var d=(i<<1)+1,g=u[d],y=d+1;if(y<this.length&&c(u[y],g)<0&&(d=y,g=u[y]),c(g,p)>=0)break;u[i]=g,i=d}u[i]=p};function t(e,i){return e<i?-1:e>i?1:0}return n})});var LP=X((Qot,RP)=>{RP.exports=function(t,e,i,s){var u=t[0],c=t[1],f=!1;i===void 0&&(i=0),s===void 0&&(s=e.length);for(var p=(s-i)/2,d=0,g=p-1;d<p;g=d++){var y=e[i+d*2+0],v=e[i+d*2+1],E=e[i+g*2+0],M=e[i+g*2+1],A=v>c!=M>c&&u<(E-y)*(c-v)/(M-v)+y;A&&(f=!f)}return f}});var OP=X((tst,NP)=>{NP.exports=function(t,e,i,s){var u=t[0],c=t[1],f=!1;i===void 0&&(i=0),s===void 0&&(s=e.length);for(var p=s-i,d=0,g=p-1;d<p;g=d++){var y=e[d+i][0],v=e[d+i][1],E=e[g+i][0],M=e[g+i][1],A=v>c!=M>c&&u<(E-y)*(c-v)/(M-v)+y;A&&(f=!f)}return f}});var UP=X((est,_d)=>{var DP=LP(),FP=OP();_d.exports=function(t,e,i,s){return e.length>0&&Array.isArray(e[0])?FP(t,e,i,s):DP(t,e,i,s)};_d.exports.nested=FP;_d.exports.flat=DP});var zP=X((xd,BP)=>{(function(n,t){typeof xd=="object"&&typeof BP!="undefined"?t(xd):typeof define=="function"&&define.amd?define(["exports"],t):t((n=n||self).predicates={})})(xd,function(n){"use strict";let e=33306690738754706e-32;function i(E,M,A,_,x){let T,w,R,z,U=M[0],D=_[0],P=0,ct=0;D>U==D>-U?(T=U,U=M[++P]):(T=D,D=_[++ct]);let L=0;if(P<E&&ct<A)for(D>U==D>-U?(R=T-((w=U+T)-U),U=M[++P]):(R=T-((w=D+T)-D),D=_[++ct]),T=w,R!==0&&(x[L++]=R);P<E&&ct<A;)D>U==D>-U?(R=T-((w=T+U)-(z=w-T))+(U-z),U=M[++P]):(R=T-((w=T+D)-(z=w-T))+(D-z),D=_[++ct]),T=w,R!==0&&(x[L++]=R);for(;P<E;)R=T-((w=T+U)-(z=w-T))+(U-z),U=M[++P],T=w,R!==0&&(x[L++]=R);for(;ct<A;)R=T-((w=T+D)-(z=w-T))+(D-z),D=_[++ct],T=w,R!==0&&(x[L++]=R);return T===0&&L!==0||(x[L++]=T),L}function s(E){return new Float64Array(E)}let u=33306690738754716e-32,c=22204460492503146e-32,f=11093356479670487e-47,p=s(4),d=s(8),g=s(12),y=s(16),v=s(4);n.orient2d=function(E,M,A,_,x,T){let w=(M-T)*(A-x),R=(E-x)*(_-T),z=w-R;if(w===0||R===0||w>0!=R>0)return z;let U=Math.abs(w+R);return Math.abs(z)>=u*U?z:-function(D,P,ct,L,W,V,Mt){let $,gt,ft,vt,it,lt,H,At,It,Kt,nt,bt,Vt,$t,Ut,Gt,Ct,ee,Z=D-W,Dt=ct-W,_t=P-V,Nt=L-V;it=(Ut=(At=Z-(H=(lt=134217729*Z)-(lt-Z)))*(Kt=Nt-(It=(lt=134217729*Nt)-(lt-Nt)))-(($t=Z*Nt)-H*It-At*It-H*Kt))-(nt=Ut-(Ct=(At=_t-(H=(lt=134217729*_t)-(lt-_t)))*(Kt=Dt-(It=(lt=134217729*Dt)-(lt-Dt)))-((Gt=_t*Dt)-H*It-At*It-H*Kt))),p[0]=Ut-(nt+it)+(it-Ct),it=(Vt=$t-((bt=$t+nt)-(it=bt-$t))+(nt-it))-(nt=Vt-Gt),p[1]=Vt-(nt+it)+(it-Gt),it=(ee=bt+nt)-bt,p[2]=bt-(ee-it)+(nt-it),p[3]=ee;let wt=function(Y,N){let xt=N[0];for(let St=1;St<Y;St++)xt+=N[St];return xt}(4,p),Ht=c*Mt;if(wt>=Ht||-wt>=Ht||($=D-(Z+(it=D-Z))+(it-W),ft=ct-(Dt+(it=ct-Dt))+(it-W),gt=P-(_t+(it=P-_t))+(it-V),vt=L-(Nt+(it=L-Nt))+(it-V),$===0&&gt===0&&ft===0&&vt===0)||(Ht=f*Mt+e*Math.abs(wt),(wt+=Z*vt+Nt*$-(_t*ft+Dt*gt))>=Ht||-wt>=Ht))return wt;it=(Ut=(At=$-(H=(lt=134217729*$)-(lt-$)))*(Kt=Nt-(It=(lt=134217729*Nt)-(lt-Nt)))-(($t=$*Nt)-H*It-At*It-H*Kt))-(nt=Ut-(Ct=(At=gt-(H=(lt=134217729*gt)-(lt-gt)))*(Kt=Dt-(It=(lt=134217729*Dt)-(lt-Dt)))-((Gt=gt*Dt)-H*It-At*It-H*Kt))),v[0]=Ut-(nt+it)+(it-Ct),it=(Vt=$t-((bt=$t+nt)-(it=bt-$t))+(nt-it))-(nt=Vt-Gt),v[1]=Vt-(nt+it)+(it-Gt),it=(ee=bt+nt)-bt,v[2]=bt-(ee-it)+(nt-it),v[3]=ee;let Xt=i(4,p,4,v,d);it=(Ut=(At=Z-(H=(lt=134217729*Z)-(lt-Z)))*(Kt=vt-(It=(lt=134217729*vt)-(lt-vt)))-(($t=Z*vt)-H*It-At*It-H*Kt))-(nt=Ut-(Ct=(At=_t-(H=(lt=134217729*_t)-(lt-_t)))*(Kt=ft-(It=(lt=134217729*ft)-(lt-ft)))-((Gt=_t*ft)-H*It-At*It-H*Kt))),v[0]=Ut-(nt+it)+(it-Ct),it=(Vt=$t-((bt=$t+nt)-(it=bt-$t))+(nt-it))-(nt=Vt-Gt),v[1]=Vt-(nt+it)+(it-Gt),it=(ee=bt+nt)-bt,v[2]=bt-(ee-it)+(nt-it),v[3]=ee;let Pt=i(Xt,d,4,v,g);it=(Ut=(At=$-(H=(lt=134217729*$)-(lt-$)))*(Kt=vt-(It=(lt=134217729*vt)-(lt-vt)))-(($t=$*vt)-H*It-At*It-H*Kt))-(nt=Ut-(Ct=(At=gt-(H=(lt=134217729*gt)-(lt-gt)))*(Kt=ft-(It=(lt=134217729*ft)-(lt-ft)))-((Gt=gt*ft)-H*It-At*It-H*Kt))),v[0]=Ut-(nt+it)+(it-Ct),it=(Vt=$t-((bt=$t+nt)-(it=bt-$t))+(nt-it))-(nt=Vt-Gt),v[1]=Vt-(nt+it)+(it-Gt),it=(ee=bt+nt)-bt,v[2]=bt-(ee-it)+(nt-it),v[3]=ee;let ne=i(Pt,g,4,v,y);return y[ne-1]}(E,M,A,_,x,T,U)},n.orient2dfast=function(E,M,A,_,x,T){return(M-T)*(A-x)-(E-x)*(_-T)},Object.defineProperty(n,"__esModule",{value:!0})})});var WP=X((nst,__)=>{"use strict";var GP=p_(),Sd=PP(),o$=UP(),s$=zP().orient2d;Sd.default&&(Sd=Sd.default);__.exports=HP;__.exports.default=HP;function HP(n,t,e){t=Math.max(0,t===void 0?2:t),e=e||0;var i=f$(n),s=new GP(16);s.toBBox=function(T){return{minX:T[0],minY:T[1],maxX:T[0],maxY:T[1]}},s.compareMinX=function(T,w){return T[0]-w[0]},s.compareMinY=function(T,w){return T[1]-w[1]},s.load(n);for(var u=[],c=0,f;c<i.length;c++){var p=i[c];s.remove(p),f=VP(p,f),u.push(f)}var d=new GP(16);for(c=0;c<u.length;c++)d.insert(m_(u[c]));for(var g=t*t,y=e*e;u.length;){var v=u.shift(),E=v.p,M=v.next.p,A=y_(E,M);if(!(A<y)){var _=A/g;p=a$(s,v.prev.p,E,M,v.next.next.p,_,d),p&&Math.min(y_(p,E),y_(p,M))<=_&&(u.push(v),u.push(VP(p,v)),s.remove(p),d.remove(v),d.insert(m_(v)),d.insert(m_(v.next)))}}v=f;var x=[];do x.push(v.p),v=v.next;while(v!==f);return x.push(v.p),x}function a$(n,t,e,i,s,u,c){for(var f=new Sd([],u$),p=n.data;p;){for(var d=0;d<p.children.length;d++){var g=p.children[d],y=p.leaf?v_(g,e,i):l$(e,i,g);y>u||f.push({node:g,dist:y})}for(;f.length&&!f.peek().node.children;){var v=f.pop(),E=v.node,M=v_(E,t,e),A=v_(E,i,s);if(v.dist<M&&v.dist<A&&qP(e,E,c)&&qP(i,E,c))return E}p=f.pop(),p&&(p=p.node)}return null}function u$(n,t){return n.dist-t.dist}function l$(n,t,e){if(kP(n,e)||kP(t,e))return 0;var i=Ed(n[0],n[1],t[0],t[1],e.minX,e.minY,e.maxX,e.minY);if(i===0)return 0;var s=Ed(n[0],n[1],t[0],t[1],e.minX,e.minY,e.minX,e.maxY);if(s===0)return 0;var u=Ed(n[0],n[1],t[0],t[1],e.maxX,e.minY,e.maxX,e.maxY);if(u===0)return 0;var c=Ed(n[0],n[1],t[0],t[1],e.minX,e.maxY,e.maxX,e.maxY);return c===0?0:Math.min(i,s,u,c)}function kP(n,t){return n[0]>=t.minX&&n[0]<=t.maxX&&n[1]>=t.minY&&n[1]<=t.maxY}function qP(n,t,e){for(var i=Math.min(n[0],t[0]),s=Math.min(n[1],t[1]),u=Math.max(n[0],t[0]),c=Math.max(n[1],t[1]),f=e.search({minX:i,minY:s,maxX:u,maxY:c}),p=0;p<f.length;p++)if(c$(f[p].p,f[p].next.p,n,t))return!1;return!0}function Bl(n,t,e){return s$(n[0],n[1],t[0],t[1],e[0],e[1])}function c$(n,t,e,i){return n!==i&&t!==e&&Bl(n,t,e)>0!=Bl(n,t,i)>0&&Bl(e,i,n)>0!=Bl(e,i,t)>0}function m_(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 f$(n){for(var t=n[0],e=n[0],i=n[0],s=n[0],u=0;u<n.length;u++){var c=n[u];c[0]<t[0]&&(t=c),c[0]>i[0]&&(i=c),c[1]<e[1]&&(e=c),c[1]>s[1]&&(s=c)}var f=[t,e,i,s],p=f.slice();for(u=0;u<n.length;u++)o$(n[u],f)||p.push(n[u]);return p$(p)}function VP(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 y_(n,t){var e=n[0]-t[0],i=n[1]-t[1];return e*e+i*i}function v_(n,t,e){var i=t[0],s=t[1],u=e[0]-i,c=e[1]-s;if(u!==0||c!==0){var f=((n[0]-i)*u+(n[1]-s)*c)/(u*u+c*c);f>1?(i=e[0],s=e[1]):f>0&&(i+=u*f,s+=c*f)}return u=n[0]-i,c=n[1]-s,u*u+c*c}function Ed(n,t,e,i,s,u,c,f){var p=e-n,d=i-t,g=c-s,y=f-u,v=n-s,E=t-u,M=p*p+d*d,A=p*g+d*y,_=g*g+y*y,x=p*v+d*E,T=g*v+y*E,w=M*_-A*A,R,z,U,D,P=w,ct=w;w===0?(z=0,P=1,D=T,ct=_):(z=A*T-_*x,D=M*T-A*x,z<0?(z=0,D=T,ct=_):z>P&&(z=P,D=T+A,ct=_)),D<0?(D=0,-x<0?z=0:-x>M?z=P:(z=-x,P=M)):D>ct&&(D=ct,-x+A<0?z=0:-x+A>M?z=P:(z=-x+A,P=M)),R=z===0?0:z/P,U=D===0?0:D/ct;var L=(1-R)*n+R*e,W=(1-R)*t+R*i,V=(1-U)*s+U*c,Mt=(1-U)*u+U*f,$=V-L,gt=Mt-W;return $*$+gt*gt}function h$(n,t){return n[0]===t[0]?n[1]-t[1]:n[0]-t[0]}function p$(n){n.sort(h$);for(var t=[],e=0;e<n.length;e++){for(;t.length>=2&&Bl(t[t.length-2],t[t.length-1],n[e])<=0;)t.pop();t.push(n[e])}for(var i=[],s=n.length-1;s>=0;s--){for(;i.length>=2&&Bl(i[i.length-2],i[i.length-1],n[s])<=0;)i.pop();i.push(n[s])}return i.pop(),t.pop(),t.concat(i)}});var jP=X((E_,S_)=>{(function(n,t){typeof E_=="object"&&typeof S_!="undefined"?S_.exports=t():typeof define=="function"&&define.amd?define(t):n.quickselect=t()})(E_,function(){"use strict";function n(s,u,c,f,p){t(s,u,c||0,f||s.length-1,p||i)}function t(s,u,c,f,p){for(;f>c;){if(f-c>600){var d=f-c+1,g=u-c+1,y=Math.log(d),v=.5*Math.exp(2*y/3),E=.5*Math.sqrt(y*v*(d-v)/d)*(g-d/2<0?-1:1),M=Math.max(c,Math.floor(u-g*v/d+E)),A=Math.min(f,Math.floor(u+(d-g)*v/d+E));t(s,u,M,A,p)}var _=s[u],x=c,T=f;for(e(s,c,u),p(s[f],_)>0&&e(s,c,f);x<T;){for(e(s,x,T),x++,T--;p(s[x],_)<0;)x++;for(;p(s[T],_)>0;)T--}p(s[c],_)===0?e(s,c,T):(T++,e(s,T,f)),T<=u&&(c=T+1),u<=T&&(f=T-1)}}function e(s,u,c){var f=s[u];s[u]=s[c],s[c]=f}function i(s,u){return s<u?-1:s>u?1:0}return n})});var A_=X((Cut,b_)=>{"use strict";b_.exports=Ef;b_.exports.default=Ef;var A$=jP();function Ef(n,t){if(!(this instanceof Ef))return new Ef(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()}Ef.prototype={all:function(){return this._all(this.data,[])},search:function(n){var t=this.data,e=[],i=this.toBBox;if(!Md(n,t))return e;for(var s=[],u,c,f,p;t;){for(u=0,c=t.children.length;u<c;u++)f=t.children[u],p=t.leaf?i(f):f,Md(n,p)&&(t.leaf?e.push(f):M_(n,p)?this._all(f,e):s.push(f));t=s.pop()}return e},collides:function(n){var t=this.data,e=this.toBBox;if(!Md(n,t))return!1;for(var i=[],s,u,c,f;t;){for(s=0,u=t.children.length;s<u;s++)if(c=t.children[s],f=t.leaf?e(c):c,Md(n,f)){if(t.leaf||M_(n,f))return!0;i.push(c)}t=i.pop()}return!1},load:function(n){if(!(n&&n.length))return this;if(n.length<this._minEntries){for(var t=0,e=n.length;t<e;t++)this.insert(n[t]);return this}var i=this._build(n.slice(),0,n.length-1,0);if(!this.data.children.length)this.data=i;else if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var s=this.data;this.data=i,i=s}this._insert(i,this.data.height-i.height-1,!0)}return this},insert:function(n){return n&&this._insert(n,this.data.height-1),this},clear:function(){return this.data=kl([]),this},remove:function(n,t){if(!n)return this;for(var e=this.data,i=this.toBBox(n),s=[],u=[],c,f,p,d;e||s.length;){if(e||(e=s.pop(),f=s[s.length-1],c=u.pop(),d=!0),e.leaf&&(p=T$(n,e.children,t),p!==-1))return e.children.splice(p,1),s.push(e),this._condense(s),this;!d&&!e.leaf&&M_(e,i)?(s.push(e),u.push(c),c=0,f=e,e=e.children[0]):f?(c++,e=f.children[c],d=!1):e=null}return this},toBBox:function(n){return n},compareMinX:KP,compareMinY:QP,toJSON:function(){return this.data},fromJSON:function(n){return this.data=n,this},_all:function(n,t){for(var e=[];n;)n.leaf?t.push.apply(t,n.children):e.push.apply(e,n.children),n=e.pop();return t},_build:function(n,t,e,i){var s=e-t+1,u=this._maxEntries,c;if(s<=u)return c=kl(n.slice(t,e+1)),Gl(c,this.toBBox),c;i||(i=Math.ceil(Math.log(s)/Math.log(u)),u=Math.ceil(s/Math.pow(u,i-1))),c=kl([]),c.leaf=!1,c.height=i;var f=Math.ceil(s/u),p=f*Math.ceil(Math.sqrt(u)),d,g,y,v;for(tR(n,t,e,p,this.compareMinX),d=t;d<=e;d+=p)for(y=Math.min(d+p-1,e),tR(n,d,y,f,this.compareMinY),g=d;g<=y;g+=f)v=Math.min(g+f-1,y),c.children.push(this._build(n,g,v,i-1));return Gl(c,this.toBBox),c},_chooseSubtree:function(n,t,e,i){for(var s,u,c,f,p,d,g,y;i.push(t),!(t.leaf||i.length-1===e);){for(g=y=1/0,s=0,u=t.children.length;s<u;s++)c=t.children[s],p=w_(c),d=C$(n,c)-p,d<y?(y=d,g=p<g?p:g,f=c):d===y&&p<g&&(g=p,f=c);t=f||t.children[0]}return t},_insert:function(n,t,e){var i=this.toBBox,s=e?n:i(n),u=[],c=this._chooseSubtree(s,this.data,t,u);for(c.children.push(n),xf(c,s);t>=0&&u[t].children.length>this._maxEntries;)this._split(u,t),t--;this._adjustParentBBoxes(s,u,t)},_split:function(n,t){var e=n[t],i=e.children.length,s=this._minEntries;this._chooseSplitAxis(e,s,i);var u=this._chooseSplitIndex(e,s,i),c=kl(e.children.splice(u,e.children.length-u));c.height=e.height,c.leaf=e.leaf,Gl(e,this.toBBox),Gl(c,this.toBBox),t?n[t-1].children.push(c):this._splitRoot(e,c)},_splitRoot:function(n,t){this.data=kl([n,t]),this.data.height=n.height+1,this.data.leaf=!1,Gl(this.data,this.toBBox)},_chooseSplitIndex:function(n,t,e){var i,s,u,c,f,p,d,g;for(p=d=1/0,i=t;i<=e-t;i++)s=_f(n,0,i,this.toBBox),u=_f(n,i,e,this.toBBox),c=I$(s,u),f=w_(s)+w_(u),c<p?(p=c,g=i,d=f<d?f:d):c===p&&f<d&&(d=f,g=i);return g},_chooseSplitAxis:function(n,t,e){var i=n.leaf?this.compareMinX:KP,s=n.leaf?this.compareMinY:QP,u=this._allDistMargin(n,t,e,i),c=this._allDistMargin(n,t,e,s);u<c&&n.children.sort(i)},_allDistMargin:function(n,t,e,i){n.children.sort(i);var s=this.toBBox,u=_f(n,0,t,s),c=_f(n,e-t,e,s),f=wd(u)+wd(c),p,d;for(p=t;p<e-t;p++)d=n.children[p],xf(u,n.leaf?s(d):d),f+=wd(u);for(p=e-t-1;p>=t;p--)d=n.children[p],xf(c,n.leaf?s(d):d),f+=wd(c);return f},_adjustParentBBoxes:function(n,t,e){for(var i=e;i>=0;i--)xf(t[i],n)},_condense:function(n){for(var t=n.length-1,e;t>=0;t--)n[t].children.length===0?t>0?(e=n[t-1].children,e.splice(e.indexOf(n[t]),1)):this.clear():Gl(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 T$(n,t,e){if(!e)return t.indexOf(n);for(var i=0;i<t.length;i++)if(e(n,t[i]))return i;return-1}function Gl(n,t){_f(n,0,n.children.length,t,n)}function _f(n,t,e,i,s){s||(s=kl(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(var u=t,c;u<e;u++)c=n.children[u],xf(s,n.leaf?i(c):c);return s}function xf(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 KP(n,t){return n.minX-t.minX}function QP(n,t){return n.minY-t.minY}function w_(n){return(n.maxX-n.minX)*(n.maxY-n.minY)}function wd(n){return n.maxX-n.minX+(n.maxY-n.minY)}function C$(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 I$(n,t){var e=Math.max(n.minX,t.minX),i=Math.max(n.minY,t.minY),s=Math.min(n.maxX,t.maxX),u=Math.min(n.maxY,t.maxY);return Math.max(0,s-e)*Math.max(0,u-i)}function M_(n,t){return n.minX<=t.minX&&n.minY<=t.minY&&t.maxX<=n.maxX&&t.maxY<=n.maxY}function Md(n,t){return t.minX<=n.maxX&&t.minY<=n.maxY&&t.maxX>=n.minX&&t.maxY>=n.minY}function kl(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function tR(n,t,e,i,s){for(var u=[t,e],c;u.length;)e=u.pop(),t=u.pop(),!(e-t<=i)&&(c=t+Math.ceil((e-t)/i/2)*i,A$(n,c,t,e,s),u.push(t,c,c,e))}});var sR=X((klt,L_)=>{"use strict";L_.exports=Cd;L_.exports.default=Cd;function Cd(n,t,e){e=e||2;var i=t&&t.length,s=i?t[0]*e:n.length,u=rR(n,0,s,e,!0),c=[];if(!u||u.next===u.prev)return c;var f,p,d,g,y,v,E;if(i&&(u=G$(n,t,u,e)),n.length>80*e){f=d=n[0],p=g=n[1];for(var M=e;M<s;M+=e)y=n[M],v=n[M+1],y<f&&(f=y),v<p&&(p=v),y>d&&(d=y),v>g&&(g=v);E=Math.max(d-f,g-p),E=E!==0?32767/E:0}return Mf(u,c,e,f,p,E,0),c}function rR(n,t,e,i,s){var u,c;if(s===R_(n,t,e,i)>0)for(u=t;u<e;u+=i)c=nR(u,n[u],n[u+1],c);else for(u=e-i;u>=t;u-=i)c=nR(u,n[u],n[u+1],c);return c&&Id(c,c.next)&&(Af(c),c=c.next),c}function gu(n,t){if(!n)return n;t||(t=n);var e=n,i;do if(i=!1,!e.steiner&&(Id(e,e.next)||tr(e.prev,e,e.next)===0)){if(Af(e),e=t=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==t);return t}function Mf(n,t,e,i,s,u,c){if(n){!c&&u&&W$(n,i,s,u);for(var f=n,p,d;n.prev!==n.next;){if(p=n.prev,d=n.next,u?U$(n,i,s,u):F$(n)){t.push(p.i/e|0),t.push(n.i/e|0),t.push(d.i/e|0),Af(n),n=d.next,f=d.next;continue}if(n=d,n===f){c?c===1?(n=B$(gu(n),t,e),Mf(n,t,e,i,s,u,2)):c===2&&z$(n,t,e,i,s,u):Mf(gu(n),t,e,i,s,u,1);break}}}}function F$(n){var t=n.prev,e=n,i=n.next;if(tr(t,e,i)>=0)return!1;for(var s=t.x,u=e.x,c=i.x,f=t.y,p=e.y,d=i.y,g=s<u?s<c?s:c:u<c?u:c,y=f<p?f<d?f:d:p<d?p:d,v=s>u?s>c?s:c:u>c?u:c,E=f>p?f>d?f:d:p>d?p:d,M=i.next;M!==t;){if(M.x>=g&&M.x<=v&&M.y>=y&&M.y<=E&&Hl(s,f,u,p,c,d,M.x,M.y)&&tr(M.prev,M,M.next)>=0)return!1;M=M.next}return!0}function U$(n,t,e,i){var s=n.prev,u=n,c=n.next;if(tr(s,u,c)>=0)return!1;for(var f=s.x,p=u.x,d=c.x,g=s.y,y=u.y,v=c.y,E=f<p?f<d?f:d:p<d?p:d,M=g<y?g<v?g:v:y<v?y:v,A=f>p?f>d?f:d:p>d?p:d,_=g>y?g>v?g:v:y>v?y:v,x=I_(E,M,t,e,i),T=I_(A,_,t,e,i),w=n.prevZ,R=n.nextZ;w&&w.z>=x&&R&&R.z<=T;){if(w.x>=E&&w.x<=A&&w.y>=M&&w.y<=_&&w!==s&&w!==c&&Hl(f,g,p,y,d,v,w.x,w.y)&&tr(w.prev,w,w.next)>=0||(w=w.prevZ,R.x>=E&&R.x<=A&&R.y>=M&&R.y<=_&&R!==s&&R!==c&&Hl(f,g,p,y,d,v,R.x,R.y)&&tr(R.prev,R,R.next)>=0))return!1;R=R.nextZ}for(;w&&w.z>=x;){if(w.x>=E&&w.x<=A&&w.y>=M&&w.y<=_&&w!==s&&w!==c&&Hl(f,g,p,y,d,v,w.x,w.y)&&tr(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;R&&R.z<=T;){if(R.x>=E&&R.x<=A&&R.y>=M&&R.y<=_&&R!==s&&R!==c&&Hl(f,g,p,y,d,v,R.x,R.y)&&tr(R.prev,R,R.next)>=0)return!1;R=R.nextZ}return!0}function B$(n,t,e){var i=n;do{var s=i.prev,u=i.next.next;!Id(s,u)&&iR(s,i,i.next,u)&&bf(s,u)&&bf(u,s)&&(t.push(s.i/e|0),t.push(i.i/e|0),t.push(u.i/e|0),Af(i),Af(i.next),i=n=u),i=i.next}while(i!==n);return gu(i)}function z$(n,t,e,i,s,u){var c=n;do{for(var f=c.next.next;f!==c.prev;){if(c.i!==f.i&&$$(c,f)){var p=oR(c,f);c=gu(c,c.next),p=gu(p,p.next),Mf(c,t,e,i,s,u,0),Mf(p,t,e,i,s,u,0);return}f=f.next}c=c.next}while(c!==n)}function G$(n,t,e,i){var s=[],u,c,f,p,d;for(u=0,c=t.length;u<c;u++)f=t[u]*i,p=u<c-1?t[u+1]*i:n.length,d=rR(n,f,p,i,!1),d===d.next&&(d.steiner=!0),s.push(Y$(d));for(s.sort(k$),u=0;u<s.length;u++)e=q$(s[u],e);return e}function k$(n,t){return n.x-t.x}function q$(n,t){var e=V$(n,t);if(!e)return t;var i=oR(e,n);return gu(i,i.next),gu(e,e.next)}function V$(n,t){var e=t,i=n.x,s=n.y,u=-1/0,c;do{if(s<=e.y&&s>=e.next.y&&e.next.y!==e.y){var f=e.x+(s-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(f<=i&&f>u&&(u=f,c=e.x<e.next.x?e:e.next,f===i))return c}e=e.next}while(e!==t);if(!c)return null;var p=c,d=c.x,g=c.y,y=1/0,v;e=c;do i>=e.x&&e.x>=d&&i!==e.x&&Hl(s<g?i:u,s,d,g,s<g?u:i,s,e.x,e.y)&&(v=Math.abs(s-e.y)/(i-e.x),bf(e,n)&&(v<y||v===y&&(e.x>c.x||e.x===c.x&&H$(c,e)))&&(c=e,y=v)),e=e.next;while(e!==p);return c}function H$(n,t){return tr(n.prev,n,t.prev)<0&&tr(t.next,n,n.next)<0}function W$(n,t,e,i){var s=n;do s.z===0&&(s.z=I_(s.x,s.y,t,e,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==n);s.prevZ.nextZ=null,s.prevZ=null,X$(s)}function X$(n){var t,e,i,s,u,c,f,p,d=1;do{for(e=n,n=null,u=null,c=0;e;){for(c++,i=e,f=0,t=0;t<d&&(f++,i=i.nextZ,!!i);t++);for(p=d;f>0||p>0&&i;)f!==0&&(p===0||!i||e.z<=i.z)?(s=e,e=e.nextZ,f--):(s=i,i=i.nextZ,p--),u?u.nextZ=s:n=s,s.prevZ=u,u=s;e=i}u.nextZ=null,d*=2}while(c>1);return n}function I_(n,t,e,i,s){return n=(n-e)*s|0,t=(t-i)*s|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n|t<<1}function Y$(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 Hl(n,t,e,i,s,u,c,f){return(s-c)*(t-f)>=(n-c)*(u-f)&&(n-c)*(i-f)>=(e-c)*(t-f)&&(e-c)*(u-f)>=(s-c)*(i-f)}function $$(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!Z$(n,t)&&(bf(n,t)&&bf(t,n)&&J$(n,t)&&(tr(n.prev,n,t.prev)||tr(n,t.prev,t))||Id(n,t)&&tr(n.prev,n,n.next)>0&&tr(t.prev,t,t.next)>0)}function tr(n,t,e){return(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y)}function Id(n,t){return n.x===t.x&&n.y===t.y}function iR(n,t,e,i){var s=Td(tr(n,t,e)),u=Td(tr(n,t,i)),c=Td(tr(e,i,n)),f=Td(tr(e,i,t));return!!(s!==u&&c!==f||s===0&&Ad(n,e,t)||u===0&&Ad(n,i,t)||c===0&&Ad(e,n,i)||f===0&&Ad(e,t,i))}function Ad(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 Td(n){return n>0?1:n<0?-1:0}function Z$(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&&iR(e,e.next,n,t))return!0;e=e.next}while(e!==n);return!1}function bf(n,t){return tr(n.prev,n,n.next)<0?tr(n,t,n.next)>=0&&tr(n,n.prev,t)>=0:tr(n,t,n.prev)<0||tr(n,n.next,t)<0}function J$(n,t){var e=n,i=!1,s=(n.x+t.x)/2,u=(n.y+t.y)/2;do e.y>u!=e.next.y>u&&e.next.y!==e.y&&s<(e.next.x-e.x)*(u-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==n);return i}function oR(n,t){var e=new P_(n.i,n.x,n.y),i=new P_(t.i,t.x,t.y),s=n.next,u=t.prev;return n.next=t,t.prev=n,e.next=s,s.prev=e,i.next=e,e.prev=i,u.next=i,i.prev=u,i}function nR(n,t,e,i){var s=new P_(n,t,e);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function Af(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 P_(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}Cd.deviation=function(n,t,e,i){var s=t&&t.length,u=s?t[0]*e:n.length,c=Math.abs(R_(n,0,u,e));if(s)for(var f=0,p=t.length;f<p;f++){var d=t[f]*e,g=f<p-1?t[f+1]*e:n.length;c-=Math.abs(R_(n,d,g,e))}var y=0;for(f=0;f<i.length;f+=3){var v=i[f]*e,E=i[f+1]*e,M=i[f+2]*e;y+=Math.abs((n[v]-n[M])*(n[E+1]-n[v+1])-(n[v]-n[E])*(n[M+1]-n[v+1]))}return c===0&&y===0?0:Math.abs((y-c)/c)};function R_(n,t,e,i){for(var s=0,u=t,c=e-i;u<e;u+=i)s+=(n[c]-n[u])*(n[u+1]+n[c+1]),c=u;return s}Cd.flatten=function(n){for(var t=n[0][0].length,e={vertices:[],holes:[],dimensions:t},i=0,s=0;s<n.length;s++){for(var u=0;u<n[s].length;u++)for(var c=0;c<t;c++)e.vertices.push(n[s][u][c]);s>0&&(i+=n[s-1].length,e.holes.push(i))}return e}});var U_=X(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.earthRadius=63710088e-1;ge.factors={centimeters:ge.earthRadius*100,centimetres:ge.earthRadius*100,degrees:ge.earthRadius/111325,feet:ge.earthRadius*3.28084,inches:ge.earthRadius*39.37,kilometers:ge.earthRadius/1e3,kilometres:ge.earthRadius/1e3,meters:ge.earthRadius,metres:ge.earthRadius,miles:ge.earthRadius/1609.344,millimeters:ge.earthRadius*1e3,millimetres:ge.earthRadius*1e3,nauticalmiles:ge.earthRadius/1852,radians:1,yards:ge.earthRadius*1.0936};ge.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/ge.earthRadius,yards:1.0936133};ge.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Sa(n,t,e){e===void 0&&(e={});var i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=t||{},i.geometry=n,i}ge.feature=Sa;function K$(n,t,e){switch(e===void 0&&(e={}),n){case"Point":return N_(t).geometry;case"LineString":return D_(t).geometry;case"Polygon":return O_(t).geometry;case"MultiPoint":return uR(t).geometry;case"MultiLineString":return aR(t).geometry;case"MultiPolygon":return lR(t).geometry;default:throw new Error(n+" is invalid")}}ge.geometry=K$;function N_(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(!Pd(n[0])||!Pd(n[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:n};return Sa(i,t,e)}ge.point=N_;function Q$(n,t,e){return e===void 0&&(e={}),Rd(n.map(function(i){return N_(i,t)}),e)}ge.points=Q$;function O_(n,t,e){e===void 0&&(e={});for(var i=0,s=n;i<s.length;i++){var u=s[i];if(u.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var c=0;c<u[u.length-1].length;c++)if(u[u.length-1][c]!==u[0][c])throw new Error("First and last Position are not equivalent.")}var f={type:"Polygon",coordinates:n};return Sa(f,t,e)}ge.polygon=O_;function tZ(n,t,e){return e===void 0&&(e={}),Rd(n.map(function(i){return O_(i,t)}),e)}ge.polygons=tZ;function D_(n,t,e){if(e===void 0&&(e={}),n.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:n};return Sa(i,t,e)}ge.lineString=D_;function eZ(n,t,e){return e===void 0&&(e={}),Rd(n.map(function(i){return D_(i,t)}),e)}ge.lineStrings=eZ;function Rd(n,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=n,e}ge.featureCollection=Rd;function aR(n,t,e){e===void 0&&(e={});var i={type:"MultiLineString",coordinates:n};return Sa(i,t,e)}ge.multiLineString=aR;function uR(n,t,e){e===void 0&&(e={});var i={type:"MultiPoint",coordinates:n};return Sa(i,t,e)}ge.multiPoint=uR;function lR(n,t,e){e===void 0&&(e={});var i={type:"MultiPolygon",coordinates:n};return Sa(i,t,e)}ge.multiPolygon=lR;function nZ(n,t,e){e===void 0&&(e={});var i={type:"GeometryCollection",geometries:n};return Sa(i,t,e)}ge.geometryCollection=nZ;function rZ(n,t){if(t===void 0&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,t||0);return Math.round(n*e)/e}ge.round=rZ;function cR(n,t){t===void 0&&(t="kilometers");var e=ge.factors[t];if(!e)throw new Error(t+" units is invalid");return n*e}ge.radiansToLength=cR;function F_(n,t){t===void 0&&(t="kilometers");var e=ge.factors[t];if(!e)throw new Error(t+" units is invalid");return n/e}ge.lengthToRadians=F_;function iZ(n,t){return fR(F_(n,t))}ge.lengthToDegrees=iZ;function oZ(n){var t=n%360;return t<0&&(t+=360),t}ge.bearingToAzimuth=oZ;function fR(n){var t=n%(2*Math.PI);return t*180/Math.PI}ge.radiansToDegrees=fR;function sZ(n){var t=n%360;return t*Math.PI/180}ge.degreesToRadians=sZ;function aZ(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 cR(F_(n,t),e)}ge.convertLength=aZ;function uZ(n,t,e){if(t===void 0&&(t="meters"),e===void 0&&(e="kilometers"),!(n>=0))throw new Error("area must be a positive number");var i=ge.areaFactors[t];if(!i)throw new Error("invalid original units");var s=ge.areaFactors[e];if(!s)throw new Error("invalid final units");return n/i*s}ge.convertArea=uZ;function Pd(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}ge.isNumber=Pd;function lZ(n){return!!n&&n.constructor===Object}ge.isObject=lZ;function cZ(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(!Pd(t))throw new Error("bbox must only contain numbers")})}ge.validateBBox=cZ;function fZ(n){if(!n)throw new Error("id is required");if(["string","number"].indexOf(typeof n)===-1)throw new Error("id must be a number or a string")}ge.validateId=fZ});var z_=X(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});var fi=U_();function Tf(n,t,e){if(n!==null)for(var i,s,u,c,f,p,d,g=0,y=0,v,E=n.type,M=E==="FeatureCollection",A=E==="Feature",_=M?n.features.length:1,x=0;x<_;x++){d=M?n.features[x].geometry:A?n.geometry:n,v=d?d.type==="GeometryCollection":!1,f=v?d.geometries.length:1;for(var T=0;T<f;T++){var w=0,R=0;if(c=v?d.geometries[T]:d,c!==null){p=c.coordinates;var z=c.type;switch(g=e&&(z==="Polygon"||z==="MultiPolygon")?1:0,z){case null:break;case"Point":if(t(p,y,x,w,R)===!1)return!1;y++,w++;break;case"LineString":case"MultiPoint":for(i=0;i<p.length;i++){if(t(p[i],y,x,w,R)===!1)return!1;y++,z==="MultiPoint"&&w++}z==="LineString"&&w++;break;case"Polygon":case"MultiLineString":for(i=0;i<p.length;i++){for(s=0;s<p[i].length-g;s++){if(t(p[i][s],y,x,w,R)===!1)return!1;y++}z==="MultiLineString"&&w++,z==="Polygon"&&R++}z==="Polygon"&&w++;break;case"MultiPolygon":for(i=0;i<p.length;i++){for(R=0,s=0;s<p[i].length;s++){for(u=0;u<p[i][s].length-g;u++){if(t(p[i][s][u],y,x,w,R)===!1)return!1;y++}R++}w++}break;case"GeometryCollection":for(i=0;i<c.geometries.length;i++)if(Tf(c.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function hZ(n,t,e,i){var s=e;return Tf(n,function(u,c,f,p,d){c===0&&e===void 0?s=u:s=t(s,u,c,f,p,d)},i),s}function hR(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 pZ(n,t,e){var i=e;return hR(n,function(s,u){u===0&&e===void 0?i=s:i=t(i,s,u)}),i}function pR(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 dZ(n,t,e){var i=e;return pR(n,function(s,u){u===0&&e===void 0?i=s:i=t(i,s,u)}),i}function gZ(n){var t=[];return Tf(n,function(e){t.push(e)}),t}function B_(n,t){var e,i,s,u,c,f,p,d,g,y,v=0,E=n.type==="FeatureCollection",M=n.type==="Feature",A=E?n.features.length:1;for(e=0;e<A;e++){for(f=E?n.features[e].geometry:M?n.geometry:n,d=E?n.features[e].properties:M?n.properties:{},g=E?n.features[e].bbox:M?n.bbox:void 0,y=E?n.features[e].id:M?n.id:void 0,p=f?f.type==="GeometryCollection":!1,c=p?f.geometries.length:1,s=0;s<c;s++){if(u=p?f.geometries[s]:f,u===null){if(t(null,v,d,g,y)===!1)return!1;continue}switch(u.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(u,v,d,g,y)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<u.geometries.length;i++)if(t(u.geometries[i],v,d,g,y)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}v++}}function mZ(n,t,e){var i=e;return B_(n,function(s,u,c,f,p){u===0&&e===void 0?i=s:i=t(i,s,u,c,f,p)}),i}function Ld(n,t){B_(n,function(e,i,s,u,c){var f=e===null?null:e.type;switch(f){case null:case"Point":case"LineString":case"Polygon":return t(fi.feature(e,s,{bbox:u,id:c}),i,0)===!1?!1:void 0}var p;switch(f){case"MultiPoint":p="Point";break;case"MultiLineString":p="LineString";break;case"MultiPolygon":p="Polygon";break}for(var d=0;d<e.coordinates.length;d++){var g=e.coordinates[d],y={type:p,coordinates:g};if(t(fi.feature(y,s),i,d)===!1)return!1}})}function yZ(n,t,e){var i=e;return Ld(n,function(s,u,c){u===0&&c===0&&e===void 0?i=s:i=t(i,s,u,c)}),i}function dR(n,t){Ld(n,function(e,i,s){var u=0;if(e.geometry){var c=e.geometry.type;if(!(c==="Point"||c==="MultiPoint")){var f,p=0,d=0,g=0;if(Tf(e,function(y,v,E,M,A){if(f===void 0||i>p||M>d||A>g){f=y,p=i,d=M,g=A,u=0;return}var _=fi.lineString([f,y],e.properties);if(t(_,i,s,A,u)===!1)return!1;u++,f=y})===!1)return!1}}})}function vZ(n,t,e){var i=e,s=!1;return dR(n,function(u,c,f,p,d){s===!1&&e===void 0?i=u:i=t(i,u,c,f,p,d),s=!0}),i}function gR(n,t){if(!n)throw new Error("geojson is required");Ld(n,function(e,i,s){if(e.geometry!==null){var u=e.geometry.type,c=e.geometry.coordinates;switch(u){case"LineString":if(t(e,i,s,0,0)===!1)return!1;break;case"Polygon":for(var f=0;f<c.length;f++)if(t(fi.lineString(c[f],e.properties),i,s,f)===!1)return!1;break}}})}function _Z(n,t,e){var i=e;return gR(n,function(s,u,c,f){u===0&&e===void 0?i=s:i=t(i,s,u,c,f)}),i}function xZ(n,t){if(t=t||{},!fi.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,s=t.geometryIndex||0,u=t.segmentIndex||0,c=t.properties,f;switch(n.type){case"FeatureCollection":e<0&&(e=n.features.length+e),c=c||n.features[e].properties,f=n.features[e].geometry;break;case"Feature":c=c||n.properties,f=n.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":f=n;break;default:throw new Error("geojson is invalid")}if(f===null)return null;var p=f.coordinates;switch(f.type){case"Point":case"MultiPoint":return null;case"LineString":return u<0&&(u=p.length+u-1),fi.lineString([p[u],p[u+1]],c,t);case"Polygon":return s<0&&(s=p.length+s),u<0&&(u=p[s].length+u-1),fi.lineString([p[s][u],p[s][u+1]],c,t);case"MultiLineString":return i<0&&(i=p.length+i),u<0&&(u=p[i].length+u-1),fi.lineString([p[i][u],p[i][u+1]],c,t);case"MultiPolygon":return i<0&&(i=p.length+i),s<0&&(s=p[i].length+s),u<0&&(u=p[i][s].length-u-1),fi.lineString([p[i][s][u],p[i][s][u+1]],c,t)}throw new Error("geojson is invalid")}function EZ(n,t){if(t=t||{},!fi.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,s=t.geometryIndex||0,u=t.coordIndex||0,c=t.properties,f;switch(n.type){case"FeatureCollection":e<0&&(e=n.features.length+e),c=c||n.features[e].properties,f=n.features[e].geometry;break;case"Feature":c=c||n.properties,f=n.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":f=n;break;default:throw new Error("geojson is invalid")}if(f===null)return null;var p=f.coordinates;switch(f.type){case"Point":return fi.point(p,c,t);case"MultiPoint":return i<0&&(i=p.length+i),fi.point(p[i],c,t);case"LineString":return u<0&&(u=p.length+u),fi.point(p[u],c,t);case"Polygon":return s<0&&(s=p.length+s),u<0&&(u=p[s].length+u),fi.point(p[s][u],c,t);case"MultiLineString":return i<0&&(i=p.length+i),u<0&&(u=p[i].length+u),fi.point(p[i][u],c,t);case"MultiPolygon":return i<0&&(i=p.length+i),s<0&&(s=p[i].length+s),u<0&&(u=p[i][s].length-u),fi.point(p[i][s][u],c,t)}throw new Error("geojson is invalid")}Mr.coordAll=gZ;Mr.coordEach=Tf;Mr.coordReduce=hZ;Mr.featureEach=pR;Mr.featureReduce=dZ;Mr.findPoint=EZ;Mr.findSegment=xZ;Mr.flattenEach=Ld;Mr.flattenReduce=yZ;Mr.geomEach=B_;Mr.geomReduce=mZ;Mr.lineEach=gR;Mr.lineReduce=_Z;Mr.propEach=hR;Mr.propReduce=pZ;Mr.segmentEach=dR;Mr.segmentReduce=vZ});var mR=X(k_=>{"use strict";Object.defineProperty(k_,"__esModule",{value:!0});var SZ=z_();function G_(n){var t=[1/0,1/0,-1/0,-1/0];return SZ.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}G_.default=G_;k_.default=G_});var Nd=X((rct,q_)=>{var ns=p_(),vR=U_(),_R=z_(),Wl=mR().default,wZ=_R.featureEach,ect=_R.coordEach,nct=vR.polygon,yR=vR.featureCollection;function xR(n){var t=new ns(n);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Wl(e),ns.prototype.insert.call(this,e)},t.load=function(e){var i=[];return Array.isArray(e)?e.forEach(function(s){if(s.type!=="Feature")throw new Error("invalid features");s.bbox=s.bbox?s.bbox:Wl(s),i.push(s)}):wZ(e,function(s){if(s.type!=="Feature")throw new Error("invalid features");s.bbox=s.bbox?s.bbox:Wl(s),i.push(s)}),ns.prototype.load.call(this,i)},t.remove=function(e,i){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Wl(e),ns.prototype.remove.call(this,e,i)},t.clear=function(){return ns.prototype.clear.call(this)},t.search=function(e){var i=ns.prototype.search.call(this,this.toBBox(e));return yR(i)},t.collides=function(e){return ns.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=ns.prototype.all.call(this);return yR(e)},t.toJSON=function(){return ns.prototype.toJSON.call(this)},t.fromJSON=function(e){return ns.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var i;if(e.bbox)i=e.bbox;else if(Array.isArray(e)&&e.length===4)i=e;else if(Array.isArray(e)&&e.length===6)i=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")i=Wl(e);else if(e.type==="FeatureCollection")i=Wl(e);else throw new Error("invalid geojson");return{minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}},t}q_.exports=xR;q_.exports.default=xR});var $_=X((hht,PR)=>{"use strict";var IR=Object.prototype.toString;PR.exports=function(t){var e=IR.call(t),i=e==="[object Arguments]";return i||(i=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&IR.call(t.callee)==="[object Function]"),i}});var zR=X((pht,BR)=>{"use strict";var UR;Object.keys||(Pf=Object.prototype.hasOwnProperty,Z_=Object.prototype.toString,RR=$_(),J_=Object.prototype.propertyIsEnumerable,LR=!J_.call({toString:null},"toString"),NR=J_.call(function(){},"prototype"),Rf=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Ud=function(n){var t=n.constructor;return t&&t.prototype===n},OR={$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},DR=function(){if(typeof window=="undefined")return!1;for(var n in window)try{if(!OR["$"+n]&&Pf.call(window,n)&&window[n]!==null&&typeof window[n]=="object")try{Ud(window[n])}catch(t){return!0}}catch(t){return!0}return!1}(),FR=function(n){if(typeof window=="undefined"||!DR)return Ud(n);try{return Ud(n)}catch(t){return!1}},UR=function(t){var e=t!==null&&typeof t=="object",i=Z_.call(t)==="[object Function]",s=RR(t),u=e&&Z_.call(t)==="[object String]",c=[];if(!e&&!i&&!s)throw new TypeError("Object.keys called on a non-object");var f=NR&&i;if(u&&t.length>0&&!Pf.call(t,0))for(var p=0;p<t.length;++p)c.push(String(p));if(s&&t.length>0)for(var d=0;d<t.length;++d)c.push(String(d));else for(var g in t)!(f&&g==="prototype")&&Pf.call(t,g)&&c.push(String(g));if(LR)for(var y=FR(t),v=0;v<Rf.length;++v)!(y&&Rf[v]==="constructor")&&Pf.call(t,Rf[v])&&c.push(Rf[v]);return c});var Pf,Z_,RR,J_,LR,NR,Rf,Ud,OR,DR,FR;BR.exports=UR});var j_=X((dht,qR)=>{"use strict";var NZ=Array.prototype.slice,OZ=$_(),GR=Object.keys,Bd=GR?function(t){return GR(t)}:zR(),kR=Object.keys;Bd.shim=function(){if(Object.keys){var t=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);t||(Object.keys=function(i){return OZ(i)?kR(NZ.call(i)):kR(i)})}else Object.keys=Bd;return Object.keys||Bd};qR.exports=Bd});var K_=X((ght,VR)=>{"use strict";VR.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),i=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var s=42;t[e]=s;for(var u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var f=Object.getOwnPropertyDescriptor(t,e);if(f.value!==s||f.enumerable!==!0)return!1}return!0}});var zd=X((mht,HR)=>{"use strict";var DZ=K_();HR.exports=function(){return DZ()&&!!Symbol.toStringTag}});var Q_=X((yht,WR)=>{"use strict";WR.exports=Object});var tx=X((vht,XR)=>{"use strict";XR.exports=Error});var $R=X((_ht,YR)=>{"use strict";YR.exports=EvalError});var JR=X((xht,ZR)=>{"use strict";ZR.exports=RangeError});var KR=X((Eht,jR)=>{"use strict";jR.exports=ReferenceError});var ex=X((Sht,QR)=>{"use strict";QR.exports=SyntaxError});var mu=X((wht,tL)=>{"use strict";tL.exports=TypeError});var nL=X((Mht,eL)=>{"use strict";eL.exports=URIError});var iL=X((bht,rL)=>{"use strict";rL.exports=Math.abs});var sL=X((Aht,oL)=>{"use strict";oL.exports=Math.floor});var uL=X((Tht,aL)=>{"use strict";aL.exports=Math.max});var cL=X((Cht,lL)=>{"use strict";lL.exports=Math.min});var hL=X((Iht,fL)=>{"use strict";fL.exports=Math.pow});var dL=X((Pht,pL)=>{"use strict";pL.exports=Math.round});var mL=X((Rht,gL)=>{"use strict";gL.exports=Number.isNaN||function(t){return t!==t}});var vL=X((Lht,yL)=>{"use strict";var FZ=mL();yL.exports=function(t){return FZ(t)||t===0?t:t<0?-1:1}});var xL=X((Nht,_L)=>{"use strict";_L.exports=Object.getOwnPropertyDescriptor});var yu=X((Oht,EL)=>{"use strict";var Gd=xL();if(Gd)try{Gd([],"length")}catch(n){Gd=null}EL.exports=Gd});var Lf=X((Dht,SL)=>{"use strict";var kd=Object.defineProperty||!1;if(kd)try{kd({},"a",{value:1})}catch(n){kd=!1}SL.exports=kd});var bL=X((Fht,ML)=>{"use strict";var wL=typeof Symbol!="undefined"&&Symbol,UZ=K_();ML.exports=function(){return typeof wL!="function"||typeof Symbol!="function"||typeof wL("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:UZ()}});var nx=X((Uht,AL)=>{"use strict";AL.exports=typeof Reflect!="undefined"&&Reflect.getPrototypeOf||null});var rx=X((Bht,TL)=>{"use strict";var BZ=Q_();TL.exports=BZ.getPrototypeOf||null});var PL=X((zht,IL)=>{"use strict";var zZ="Function.prototype.bind called on incompatible ",GZ=Object.prototype.toString,kZ=Math.max,qZ="[object Function]",CL=function(t,e){for(var i=[],s=0;s<t.length;s+=1)i[s]=t[s];for(var u=0;u<e.length;u+=1)i[u+t.length]=e[u];return i},VZ=function(t,e){for(var i=[],s=e||0,u=0;s<t.length;s+=1,u+=1)i[u]=t[s];return i},HZ=function(n,t){for(var e="",i=0;i<n.length;i+=1)e+=n[i],i+1<n.length&&(e+=t);return e};IL.exports=function(t){var e=this;if(typeof e!="function"||GZ.apply(e)!==qZ)throw new TypeError(zZ+e);for(var i=VZ(arguments,1),s,u=function(){if(this instanceof s){var g=e.apply(this,CL(i,arguments));return Object(g)===g?g:this}return e.apply(t,CL(i,arguments))},c=kZ(0,e.length-i.length),f=[],p=0;p<c;p++)f[p]="$"+p;if(s=Function("binder","return function ("+HZ(f,",")+"){ return binder.apply(this,arguments); }")(u),e.prototype){var d=function(){};d.prototype=e.prototype,s.prototype=new d,d.prototype=null}return s}});var Xl=X((Ght,RL)=>{"use strict";var WZ=PL();RL.exports=Function.prototype.bind||WZ});var qd=X((kht,LL)=>{"use strict";LL.exports=Function.prototype.call});var Vd=X((qht,NL)=>{"use strict";NL.exports=Function.prototype.apply});var DL=X((Vht,OL)=>{"use strict";OL.exports=typeof Reflect!="undefined"&&Reflect&&Reflect.apply});var ix=X((Hht,FL)=>{"use strict";var XZ=Xl(),YZ=Vd(),$Z=qd(),ZZ=DL();FL.exports=ZZ||XZ.call($Z,YZ)});var Hd=X((Wht,UL)=>{"use strict";var JZ=Xl(),jZ=mu(),KZ=qd(),QZ=ix();UL.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new jZ("a function is required");return QZ(JZ,KZ,t)}});var VL=X((Xht,qL)=>{"use strict";var tJ=Hd(),BL=yu(),GL;try{GL=[].__proto__===Array.prototype}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var ox=!!GL&&BL&&BL(Object.prototype,"__proto__"),kL=Object,zL=kL.getPrototypeOf;qL.exports=ox&&typeof ox.get=="function"?tJ([ox.get]):typeof zL=="function"?function(t){return zL(t==null?t:kL(t))}:!1});var sx=X((Yht,YL)=>{"use strict";var HL=nx(),WL=rx(),XL=VL();YL.exports=HL?function(t){return HL(t)}:WL?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return WL(t)}:XL?function(t){return XL(t)}:null});var ax=X(($ht,$L)=>{"use strict";var eJ=Function.prototype.call,nJ=Object.prototype.hasOwnProperty,rJ=Xl();$L.exports=rJ.call(eJ,nJ)});var cx=X((Zht,tN)=>{"use strict";var tn,iJ=Q_(),oJ=tx(),sJ=$R(),aJ=JR(),uJ=KR(),Jl=ex(),Zl=mu(),lJ=nL(),cJ=iL(),fJ=sL(),hJ=uL(),pJ=cL(),dJ=hL(),gJ=dL(),mJ=vL(),KL=Function,ux=function(n){try{return KL('"use strict"; return ('+n+").constructor;")()}catch(t){}},Nf=yu(),yJ=Lf(),lx=function(){throw new Zl},vJ=Nf?function(){try{return arguments.callee,lx}catch(n){try{return Nf(arguments,"callee").get}catch(t){return lx}}}():lx,Yl=bL()(),Gr=sx(),_J=rx(),xJ=nx(),QL=Vd(),Of=qd(),$l={},EJ=typeof Uint8Array=="undefined"||!Gr?tn:Gr(Uint8Array),vu={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?tn:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?tn:ArrayBuffer,"%ArrayIteratorPrototype%":Yl&&Gr?Gr([][Symbol.iterator]()):tn,"%AsyncFromSyncIteratorPrototype%":tn,"%AsyncFunction%":$l,"%AsyncGenerator%":$l,"%AsyncGeneratorFunction%":$l,"%AsyncIteratorPrototype%":$l,"%Atomics%":typeof Atomics=="undefined"?tn:Atomics,"%BigInt%":typeof BigInt=="undefined"?tn:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?tn:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?tn:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?tn:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":oJ,"%eval%":eval,"%EvalError%":sJ,"%Float16Array%":typeof Float16Array=="undefined"?tn:Float16Array,"%Float32Array%":typeof Float32Array=="undefined"?tn:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?tn:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?tn:FinalizationRegistry,"%Function%":KL,"%GeneratorFunction%":$l,"%Int8Array%":typeof Int8Array=="undefined"?tn:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?tn:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?tn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Yl&&Gr?Gr(Gr([][Symbol.iterator]())):tn,"%JSON%":typeof JSON=="object"?JSON:tn,"%Map%":typeof Map=="undefined"?tn:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!Yl||!Gr?tn:Gr(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":iJ,"%Object.getOwnPropertyDescriptor%":Nf,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?tn:Promise,"%Proxy%":typeof Proxy=="undefined"?tn:Proxy,"%RangeError%":aJ,"%ReferenceError%":uJ,"%Reflect%":typeof Reflect=="undefined"?tn:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?tn:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!Yl||!Gr?tn:Gr(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?tn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Yl&&Gr?Gr(""[Symbol.iterator]()):tn,"%Symbol%":Yl?Symbol:tn,"%SyntaxError%":Jl,"%ThrowTypeError%":vJ,"%TypedArray%":EJ,"%TypeError%":Zl,"%Uint8Array%":typeof Uint8Array=="undefined"?tn:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?tn:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?tn:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?tn:Uint32Array,"%URIError%":lJ,"%WeakMap%":typeof WeakMap=="undefined"?tn:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?tn:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?tn:WeakSet,"%Function.prototype.call%":Of,"%Function.prototype.apply%":QL,"%Object.defineProperty%":yJ,"%Object.getPrototypeOf%":_J,"%Math.abs%":cJ,"%Math.floor%":fJ,"%Math.max%":hJ,"%Math.min%":pJ,"%Math.pow%":dJ,"%Math.round%":gJ,"%Math.sign%":mJ,"%Reflect.getPrototypeOf%":xJ};if(Gr)try{null.error}catch(n){ZL=Gr(Gr(n)),vu["%Error.prototype%"]=ZL}var ZL,SJ=function n(t){var e;if(t==="%AsyncFunction%")e=ux("async function () {}");else if(t==="%GeneratorFunction%")e=ux("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=ux("async function* () {}");else if(t==="%AsyncGenerator%"){var i=n("%AsyncGeneratorFunction%");i&&(e=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var s=n("%AsyncGenerator%");s&&Gr&&(e=Gr(s.prototype))}return vu[t]=e,e},JL={__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"]},Df=Xl(),Wd=ax(),wJ=Df.call(Of,Array.prototype.concat),MJ=Df.call(QL,Array.prototype.splice),jL=Df.call(Of,String.prototype.replace),Xd=Df.call(Of,String.prototype.slice),bJ=Df.call(Of,RegExp.prototype.exec),AJ=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,TJ=/\\\\(\\\\)?/g,CJ=function(t){var e=Xd(t,0,1),i=Xd(t,-1);if(e==="%"&&i!=="%")throw new Jl("invalid intrinsic syntax, expected closing \`%\`");if(i==="%"&&e!=="%")throw new Jl("invalid intrinsic syntax, expected opening \`%\`");var s=[];return jL(t,AJ,function(u,c,f,p){s[s.length]=f?jL(p,TJ,"$1"):c||u}),s},IJ=function(t,e){var i=t,s;if(Wd(JL,i)&&(s=JL[i],i="%"+s[0]+"%"),Wd(vu,i)){var u=vu[i];if(u===$l&&(u=SJ(i)),typeof u=="undefined"&&!e)throw new Zl("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:s,name:i,value:u}}throw new Jl("intrinsic "+t+" does not exist!")};tN.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new Zl("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Zl('"allowMissing" argument must be a boolean');if(bJ(/^%?[^%]*%?$/,t)===null)throw new Jl("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var i=CJ(t),s=i.length>0?i[0]:"",u=IJ("%"+s+"%",e),c=u.name,f=u.value,p=!1,d=u.alias;d&&(s=d[0],MJ(i,wJ([0,1],d)));for(var g=1,y=!0;g<i.length;g+=1){var v=i[g],E=Xd(v,0,1),M=Xd(v,-1);if((E==='"'||E==="'"||E==="\`"||M==='"'||M==="'"||M==="\`")&&E!==M)throw new Jl("property names with quotes must have matching quotes");if((v==="constructor"||!y)&&(p=!0),s+="."+v,c="%"+s+"%",Wd(vu,c))f=vu[c];else if(f!=null){if(!(v in f)){if(!e)throw new Zl("base intrinsic for "+t+" exists, but the property is not available.");return}if(Nf&&g+1>=i.length){var A=Nf(f,v);y=!!A,y&&"get"in A&&!("originalValue"in A.get)?f=A.get:f=f[v]}else y=Wd(f,v),f=f[v];y&&!p&&(vu[c]=f)}}return f}});var Yd=X((Jht,rN)=>{"use strict";var eN=cx(),nN=Hd(),PJ=nN([eN("%String.prototype.indexOf%")]);rN.exports=function(t,e){var i=eN(t,!!e);return typeof i=="function"&&PJ(t,".prototype.")>-1?nN([i]):i}});var sN=X((jht,oN)=>{"use strict";var RJ=zd()(),LJ=Yd(),fx=LJ("Object.prototype.toString"),$d=function(t){return RJ&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:fx(t)==="[object Arguments]"},iN=function(t){return $d(t)?!0:t!==null&&typeof t=="object"&&"length"in t&&typeof t.length=="number"&&t.length>=0&&fx(t)!=="[object Array]"&&"callee"in t&&fx(t.callee)==="[object Function]"},NJ=function(){return $d(arguments)}();$d.isLegacyArguments=iN;oN.exports=NJ?$d:iN});var Zd=X((Kht,lN)=>{"use strict";var aN=Lf(),OJ=ex(),jl=mu(),uN=yu();lN.exports=function(t,e,i){if(!t||typeof t!="object"&&typeof t!="function")throw new jl("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new jl("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new jl("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new jl("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new jl("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new jl("\`loose\`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,f=arguments.length>6?arguments[6]:!1,p=!!uN&&uN(t,e);if(aN)aN(t,e,{configurable:c===null&&p?p.configurable:!c,enumerable:s===null&&p?p.enumerable:!s,value:i,writable:u===null&&p?p.writable:!u});else if(f||!s&&!u&&!c)t[e]=i;else throw new OJ("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Jd=X((Qht,fN)=>{"use strict";var hx=Lf(),cN=function(){return!!hx};cN.hasArrayLengthDefineBug=function(){if(!hx)return null;try{return hx([],"length",{value:1}).length!==1}catch(t){return!0}};fN.exports=cN});var Kl=X((tpt,gN)=>{"use strict";var DJ=j_(),FJ=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",UJ=Object.prototype.toString,BJ=Array.prototype.concat,hN=Zd(),zJ=function(n){return typeof n=="function"&&UJ.call(n)==="[object Function]"},pN=Jd()(),GJ=function(n,t,e,i){if(t in n){if(i===!0){if(n[t]===e)return}else if(!zJ(i)||!i())return}pN?hN(n,t,e,!0):hN(n,t,e)},dN=function(n,t){var e=arguments.length>2?arguments[2]:{},i=DJ(t);FJ&&(i=BJ.call(i,Object.getOwnPropertySymbols(t)));for(var s=0;s<i.length;s+=1)GJ(n,i[s],t[i[s]],e[i[s]])};dN.supportsDescriptors=!!pN;gN.exports=dN});var xN=X((ept,_N)=>{"use strict";var kJ=cx(),mN=Zd(),qJ=Jd()(),yN=yu(),vN=mu(),VJ=kJ("%Math.floor%");_N.exports=function(t,e){if(typeof t!="function")throw new vN("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||VJ(e)!==e)throw new vN("\`length\` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],s=!0,u=!0;if("length"in t&&yN){var c=yN(t,"length");c&&!c.configurable&&(s=!1),c&&!c.writable&&(u=!1)}return(s||u||!i)&&(qJ?mN(t,"length",e,!0,!0):mN(t,"length",e)),t}});var SN=X((npt,EN)=>{"use strict";var HJ=Xl(),WJ=Vd(),XJ=ix();EN.exports=function(){return XJ(HJ,WJ,arguments)}});var px=X((rpt,jd)=>{"use strict";var YJ=xN(),wN=Lf(),$J=Hd(),MN=SN();jd.exports=function(t){var e=$J(arguments),i=t.length-(arguments.length-1);return YJ(e,1+(i>0?i:0),!0)};wN?wN(jd.exports,"apply",{value:MN}):jd.exports.apply=MN});var dx=X((ipt,AN)=>{"use strict";var bN=function(n){return n!==n};AN.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||bN(t)&&bN(e))}});var gx=X((opt,TN)=>{"use strict";var ZJ=dx();TN.exports=function(){return typeof Object.is=="function"?Object.is:ZJ}});var IN=X((spt,CN)=>{"use strict";var JJ=gx(),jJ=Kl();CN.exports=function(){var t=JJ();return jJ(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var NN=X((apt,LN)=>{"use strict";var KJ=Kl(),QJ=px(),tj=dx(),PN=gx(),ej=IN(),RN=QJ(PN(),Object);KJ(RN,{getPolyfill:PN,implementation:tj,shim:ej});LN.exports=RN});var zN=X((upt,BN)=>{"use strict";var ON=Yd(),nj=zd()(),rj=ax(),ij=yu(),vx;nj?(DN=ON("RegExp.prototype.exec"),mx={},Kd=function(){throw mx},yx={toString:Kd,valueOf:Kd},typeof Symbol.toPrimitive=="symbol"&&(yx[Symbol.toPrimitive]=Kd),vx=function(t){if(!t||typeof t!="object")return!1;var e=ij(t,"lastIndex"),i=e&&rj(e,"value");if(!i)return!1;try{DN(t,yx)}catch(s){return s===mx}}):(FN=ON("Object.prototype.toString"),UN="[object RegExp]",vx=function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:FN(t)===UN});var DN,mx,Kd,yx,FN,UN;BN.exports=vx});var kN=X((lpt,GN)=>{"use strict";var Uf=function(){return typeof function(){}.name=="string"},Ff=Object.getOwnPropertyDescriptor;if(Ff)try{Ff([],"length")}catch(n){Ff=null}Uf.functionsHaveConfigurableNames=function(){if(!Uf()||!Ff)return!1;var t=Ff(function(){},"name");return!!t&&!!t.configurable};var oj=Function.prototype.bind;Uf.boundFunctionsHaveNames=function(){return Uf()&&typeof oj=="function"&&function(){}.bind().name!==""};GN.exports=Uf});var HN=X((cpt,VN)=>{"use strict";var qN=Zd(),sj=Jd()(),aj=kN().functionsHaveConfigurableNames(),uj=mu();VN.exports=function(t,e){if(typeof t!="function")throw new uj("\`fn\` is not a function");var i=arguments.length>2&&!!arguments[2];return(!i||aj)&&(sj?qN(t,"name",e,!0,!0):qN(t,"name",e)),t}});var _x=X((fpt,WN)=>{"use strict";var lj=HN(),cj=mu(),fj=Object;WN.exports=lj(function(){if(this==null||this!==fj(this))throw new cj("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 xx=X((hpt,XN)=>{"use strict";var hj=_x(),pj=Kl().supportsDescriptors,dj=Object.getOwnPropertyDescriptor;XN.exports=function(){if(pj&&/a/mig.flags==="gim"){var t=dj(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",i={};if(Object.defineProperty(i,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(i,"sticky",{get:function(){e+="y"}}),t.get.call(i),e==="dy")return t.get}}return hj}});var ZN=X((ppt,$N)=>{"use strict";var gj=Kl().supportsDescriptors,mj=xx(),yj=yu(),vj=Object.defineProperty,_j=tx(),YN=sx(),xj=/a/;$N.exports=function(){if(!gj||!YN)throw new _j("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=mj(),e=YN(xj),i=yj(e,"flags");return(!i||i.get!==t)&&vj(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var QN=X((dpt,KN)=>{"use strict";var Ej=Kl(),Sj=px(),wj=_x(),JN=xx(),Mj=ZN(),jN=Sj(JN());Ej(jN,{getPolyfill:JN,implementation:wj,shim:Mj});KN.exports=jN});var n2=X((gpt,e2)=>{"use strict";var t2=Yd(),bj=t2("Date.prototype.getDay"),Aj=function(t){try{return bj(t),!0}catch(e){return!1}},Tj=t2("Object.prototype.toString"),Cj="[object Date]",Ij=zd()();e2.exports=function(t){return typeof t!="object"||t===null?!1:Ij?Aj(t):Tj(t)===Cj}});var Ex=X((mpt,p2)=>{var r2=j_(),i2=sN(),o2=NN(),s2=zN(),a2=QN(),u2=n2(),l2=Date.prototype.getTime;function h2(n,t,e){var i=e||{};return(i.strict?o2(n,t):n===t)?!0:!n||!t||typeof n!="object"&&typeof t!="object"?i.strict?o2(n,t):n==t:Pj(n,t,i)}function c2(n){return n==null}function f2(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 Pj(n,t,e){var i,s;if(typeof n!=typeof t||c2(n)||c2(t)||n.prototype!==t.prototype||i2(n)!==i2(t))return!1;var u=s2(n),c=s2(t);if(u!==c)return!1;if(u||c)return n.source===t.source&&a2(n)===a2(t);if(u2(n)&&u2(t))return l2.call(n)===l2.call(t);var f=f2(n),p=f2(t);if(f!==p)return!1;if(f||p){if(n.length!==t.length)return!1;for(i=0;i<n.length;i++)if(n[i]!==t[i])return!1;return!0}if(typeof n!=typeof t)return!1;try{var d=r2(n),g=r2(t)}catch(y){return!1}if(d.length!==g.length)return!1;for(d.sort(),g.sort(),i=d.length-1;i>=0;i--)if(d[i]!=g[i])return!1;for(i=d.length-1;i>=0;i--)if(s=d[i],!h2(n[s],t[s],e))return!1;return!0}p2.exports=h2});var Nx=X((Sgt,x2)=>{var xK=Ex(),rs=function(n){this.precision=n&&n.precision?n.precision:17,this.direction=n&&n.direction?n.direction:!1,this.pseudoNode=n&&n.pseudoNode?n.pseudoNode:!1,this.objectComparator=n&&n.objectComparator?n.objectComparator:EK};rs.prototype.compare=function(n,t){if(n.type!==t.type||!_2(n,t))return!1;switch(n.type){case"Point":return this.compareCoord(n.coordinates,t.coordinates);case"LineString":return this.compareLine(n.coordinates,t.coordinates,0,!1);case"Polygon":return this.comparePolygon(n,t);case"Feature":return this.compareFeature(n,t);default:if(n.type.indexOf("Multi")===0){var e=this,i=v2(n),s=v2(t);return i.every(function(u){return this.some(function(c){return e.compare(u,c)})},s)}}return!1};function v2(n){return n.coordinates.map(function(t){return{type:n.type.replace("Multi",""),coordinates:t}})}function _2(n,t){return n.hasOwnProperty("coordinates")?n.coordinates.length===t.coordinates.length:n.length===t.length}rs.prototype.compareCoord=function(n,t){if(n.length!==t.length)return!1;for(var e=0;e<n.length;e++)if(n[e].toFixed(this.precision)!==t[e].toFixed(this.precision))return!1;return!0};rs.prototype.compareLine=function(n,t,e,i){if(!_2(n,t))return!1;var s=this.pseudoNode?n:this.removePseudo(n),u=this.pseudoNode?t:this.removePseudo(t);if(!(i&&!this.compareCoord(s[0],u[0])&&(u=this.fixStartIndex(u,s),!u))){var c=this.compareCoord(s[e],u[e]);return this.direction||c?this.comparePath(s,u):this.compareCoord(s[e],u[u.length-(1+e)])?this.comparePath(s.slice().reverse(),u):!1}};rs.prototype.fixStartIndex=function(n,t){for(var e,i=-1,s=0;s<n.length;s++)if(this.compareCoord(n[s],t[0])){i=s;break}return i>=0&&(e=[].concat(n.slice(i,n.length),n.slice(1,i+1))),e};rs.prototype.comparePath=function(n,t){var e=this;return n.every(function(i,s){return e.compareCoord(i,this[s])},t)};rs.prototype.comparePolygon=function(n,t){if(this.compareLine(n.coordinates[0],t.coordinates[0],1,!0)){var e=n.coordinates.slice(1,n.coordinates.length),i=t.coordinates.slice(1,t.coordinates.length),s=this;return e.every(function(u){return this.some(function(c){return s.compareLine(u,c,1,!0)})},i)}else return!1};rs.prototype.compareFeature=function(n,t){return n.id!==t.id||!this.objectComparator(n.properties,t.properties)||!this.compareBBox(n,t)?!1:this.compare(n.geometry,t.geometry)};rs.prototype.compareBBox=function(n,t){return!!(!n.bbox&&!t.bbox||n.bbox&&t.bbox&&this.compareCoord(n.bbox,t.bbox))};rs.prototype.removePseudo=function(n){return n};function EK(n,t){return xK(n,t,{strict:!0})}x2.exports=rs});var E2=X((Ogt,eg)=>{function Ma(n,t,e,i){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(n,t,e,i)}Ma.prototype.run=function(n,t,e,i){this._init(n,t,e,i);for(var s=0;s<this._datasetLength;s++)if(this._visited[s]!==1){this._visited[s]=1;var u=this._regionQuery(s);if(u.length<this.minPts)this.noise.push(s);else{var c=this.clusters.length;this.clusters.push([]),this._addToCluster(s,c),this._expandCluster(c,u)}}return this.clusters};Ma.prototype._init=function(n,t,e,i){if(n){if(!(n instanceof Array))throw Error("Dataset must be of type array, "+typeof n+" given");this.dataset=n,this.clusters=[],this.noise=[],this._datasetLength=n.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}t&&(this.epsilon=t),e&&(this.minPts=e),i&&(this.distance=i)};Ma.prototype._expandCluster=function(n,t){for(var e=0;e<t.length;e++){var i=t[e];if(this._visited[i]!==1){this._visited[i]=1;var s=this._regionQuery(i);s.length>=this.minPts&&(t=this._mergeArrays(t,s))}this._assigned[i]!==1&&this._addToCluster(i,n)}};Ma.prototype._addToCluster=function(n,t){this.clusters[t].push(n),this._assigned[n]=1};Ma.prototype._regionQuery=function(n){for(var t=[],e=0;e<this._datasetLength;e++){var i=this.distance(this.dataset[n],this.dataset[e]);i<this.epsilon&&t.push(e)}return t};Ma.prototype._mergeArrays=function(n,t){for(var e=t.length,i=0;i<e;i++){var s=t[i];n.indexOf(s)<0&&n.push(s)}return n};Ma.prototype._euclideanDistance=function(n,t){for(var e=0,i=Math.min(n.length,t.length);i--;)e+=(n[i]-t[i])*(n[i]-t[i]);return Math.sqrt(e)};typeof eg!="undefined"&&eg.exports&&(eg.exports=Ma)});var S2=X((Dgt,ng)=>{function ba(n,t,e){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(n,t,e)}ba.prototype.init=function(n,t,e){this.assignments=[],this.centroids=[],typeof n!="undefined"&&(this.dataset=n),typeof t!="undefined"&&(this.k=t),typeof e!="undefined"&&(this.distance=e)};ba.prototype.run=function(n,t){this.init(n,t);for(var e=this.dataset.length,i=0;i<this.k;i++)this.centroids[i]=this.randomCentroid();for(var s=!0;s;){s=this.assign();for(var u=0;u<this.k;u++){for(var c=new Array(g),f=0,p=0;p<g;p++)c[p]=0;for(var d=0;d<e;d++){var g=this.dataset[d].length;if(u===this.assignments[d]){for(var p=0;p<g;p++)c[p]+=this.dataset[d][p];f++}}if(f>0){for(var p=0;p<g;p++)c[p]/=f;this.centroids[u]=c}else this.centroids[u]=this.randomCentroid(),s=!0}}return this.getClusters()};ba.prototype.randomCentroid=function(){var n=this.dataset.length-1,t,e;do e=Math.round(Math.random()*n),t=this.dataset[e];while(this.centroids.indexOf(t)>=0);return t};ba.prototype.assign=function(){for(var n=!1,t=this.dataset.length,e,i=0;i<t;i++)e=this.argmin(this.dataset[i],this.centroids,this.distance),e!=this.assignments[i]&&(this.assignments[i]=e,n=!0);return n};ba.prototype.getClusters=function(){for(var n=new Array(this.k),t,e=0;e<this.assignments.length;e++)t=this.assignments[e],typeof n[t]=="undefined"&&(n[t]=[]),n[t].push(e);return n};ba.prototype.argmin=function(n,t,e){for(var i=Number.MAX_VALUE,s=0,u=t.length,c,f=0;f<u;f++)c=e(n,t[f]),c<i&&(i=c,s=f);return s};ba.prototype.distance=function(n,t){for(var e=0,i=Math.min(n.length,t.length);i--;){var s=n[i]-t[i];e+=s*s}return Math.sqrt(e)};typeof ng!="undefined"&&ng.exports&&(ng.exports=ba)});var Ox=X((Fgt,rg)=>{function is(n,t,e){this._queue=[],this._priorities=[],this._sorting="desc",this._init(n,t,e)}is.prototype.insert=function(n,t){for(var e=this._queue.length,i=e;i--;){var s=this._priorities[i];this._sorting==="desc"?t>s&&(e=i):t<s&&(e=i)}this._insertAt(n,t,e)};is.prototype.remove=function(n){for(var t=this._queue.length;t--;){var e=this._queue[t];if(n===e){this._queue.splice(t,1),this._priorities.splice(t,1);break}}};is.prototype.forEach=function(n){this._queue.forEach(n)};is.prototype.getElements=function(){return this._queue};is.prototype.getElementPriority=function(n){return this._priorities[n]};is.prototype.getPriorities=function(){return this._priorities};is.prototype.getElementsWithPriorities=function(){for(var n=[],t=0,e=this._queue.length;t<e;t++)n.push([this._queue[t],this._priorities[t]]);return n};is.prototype._init=function(n,t,e){if(n&&t){if(this._queue=[],this._priorities=[],n.length!==t.length)throw new Error("Arrays must have the same length");for(var i=0;i<n.length;i++)this.insert(n[i],t[i])}e&&(this._sorting=e)};is.prototype._insertAt=function(n,t,e){this._queue.length===e?(this._queue.push(n),this._priorities.push(t)):(this._queue.splice(e,0,n),this._priorities.splice(e,0,t))};typeof rg!="undefined"&&rg.exports&&(rg.exports=is)});var M2=X((Ugt,tc)=>{typeof tc!="undefined"&&tc.exports&&(w2=Ox());var w2;function Bs(n,t,e,i){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(n,t,e,i)}Bs.prototype.run=function(n,t,e,i){this._init(n,t,e,i);for(var s=0,u=this.dataset.length;s<u;s++)if(this._processed[s]!==1){this._processed[s]=1,this.clusters.push([s]);var c=this.clusters.length-1;this._orderedList.push(s);var f=new w2(null,null,"asc"),p=this._regionQuery(s);this._distanceToCore(s)!==void 0&&(this._updateQueue(s,p,f),this._expandCluster(c,f))}return this.clusters};Bs.prototype.getReachabilityPlot=function(){for(var n=[],t=0,e=this._orderedList.length;t<e;t++){var i=this._orderedList[t],s=this._reachability[i];n.push([i,s])}return n};Bs.prototype._init=function(n,t,e,i){if(n){if(!(n instanceof Array))throw Error("Dataset must be of type array, "+typeof n+" given");this.dataset=n,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}t&&(this.epsilon=t),e&&(this.minPts=e),i&&(this.distance=i)};Bs.prototype._updateQueue=function(n,t,e){var i=this;this._coreDistance=this._distanceToCore(n),t.forEach(function(s){if(i._processed[s]===void 0){var u=i.distance(i.dataset[n],i.dataset[s]),c=Math.max(i._coreDistance,u);i._reachability[s]===void 0?(i._reachability[s]=c,e.insert(s,c)):c<i._reachability[s]&&(i._reachability[s]=c,e.remove(s),e.insert(s,c))}})};Bs.prototype._expandCluster=function(n,t){for(var e=t.getElements(),i=0,s=e.length;i<s;i++){var u=e[i];if(this._processed[u]===void 0){var c=this._regionQuery(u);this._processed[u]=1,this.clusters[n].push(u),this._orderedList.push(u),this._distanceToCore(u)!==void 0&&(this._updateQueue(u,c,t),this._expandCluster(n,t))}}};Bs.prototype._distanceToCore=function(n){for(var t=this.epsilon,e=0;e<t;e++){var i=this._regionQuery(n,e);if(i.length>=this.minPts)return e}};Bs.prototype._regionQuery=function(n,t){t=t||this.epsilon;for(var e=[],i=0,s=this.dataset.length;i<s;i++)this.distance(this.dataset[n],this.dataset[i])<t&&e.push(i);return e};Bs.prototype._euclideanDistance=function(n,t){for(var e=0,i=Math.min(n.length,t.length);i--;)e+=(n[i]-t[i])*(n[i]-t[i]);return Math.sqrt(e)};typeof tc!="undefined"&&tc.exports&&(tc.exports=Bs)});var b2=X((Bgt,ig)=>{typeof ig!="undefined"&&ig.exports&&(ig.exports={DBSCAN:E2(),KMEANS:S2(),OPTICS:M2(),PriorityQueue:Ox()})});var Dx=X((Hgt,T2)=>{"use strict";T2.exports={eudist:function(t,e,i){for(var s=t.length,u=0,c=0;c<s;c++){var f=(t[c]||0)-(e[c]||0);u+=f*f}return i?Math.sqrt(u):u},mandist:function(t,e,i){for(var s=t.length,u=0,c=0;c<s;c++)u+=Math.abs((t[c]||0)-(e[c]||0));return i?Math.sqrt(u):u},dist:function(t,e,i){var s=Math.abs(t-e);return i?s:s*s}}});var P2=X((Wgt,I2)=>{"use strict";var C2=Dx(),TK=C2.eudist,CK=C2.dist;I2.exports={kmrand:function(t,e){for(var i={},s=[],u=e<<2,c=t.length,f=t[0].length>0;s.length<e&&u-- >0;){var p=t[Math.floor(Math.random()*c)],d=f?p.join("_"):""+p;i[d]||(i[d]=!0,s.push(p))}if(s.length<e)throw new Error("Error initializating clusters");return s},kmpp:function(t,e){var i=t[0].length?TK:CK,s=[],u=t.length,c=t[0].length>0,f={},p=t[Math.floor(Math.random()*u)],d=c?p.join("_"):""+p;for(s.push(p),f[d]=!0;s.length<e;){for(var g=[],y=s.length,v=0,E=[],M=0;M<u;M++){for(var A=1/0,_=0;_<y;_++){var x=i(t[M],s[_]);x<=A&&(A=x)}g[M]=A}for(var T=0;T<u;T++)v+=g[T];for(var w=0;w<u;w++)E[w]={i:w,v:t[w],pr:g[w]/v,cs:0};E.sort(function(D,P){return D.pr-P.pr}),E[0].cs=E[0].pr;for(var R=1;R<u;R++)E[R].cs=E[R-1].cs+E[R].pr;for(var z=Math.random(),U=0;U<u-1&&E[U++].cs<z;);s.push(E[U-1].v)}return s}}});var D2=X(($gt,O2)=>{"use strict";var Fx=Dx(),N2=P2(),IK=Fx.eudist,Xgt=Fx.mandist,Ygt=Fx.dist,PK=N2.kmrand,RK=N2.kmpp,R2=1e4;function L2(n,t,e){e=e||[];for(var i=0;i<n;i++)e[i]=t;return e}function LK(n,t,e,i){var s=[],u=[],c=[],f=[],p=!1,d=i||R2,g=n.length,y=n[0].length,v=y>0,E=[];if(e)e=="kmrand"?s=PK(n,t):e=="kmpp"?s=RK(n,t):s=e;else for(var M={};s.length<t;){var A=Math.floor(Math.random()*g);M[A]||(M[A]=!0,s.push(n[A]))}do{L2(t,0,E);for(var _=0;_<g;_++){for(var x=1/0,T=0,w=0;w<t;w++){var f=v?IK(n[_],s[w]):Math.abs(n[_]-s[w]);f<=x&&(x=f,T=w)}c[_]=T,E[T]++}for(var R=[],u=[],z=0,U=0;U<t;U++)R[U]=v?L2(y,0,R[U]):0,u[U]=s[U];if(v){for(var D=0;D<t;D++)s[D]=[];for(var P=0;P<g;P++)for(var ct=c[P],L=R[ct],W=n[P],V=0;V<y;V++)L[V]+=W[V];p=!0;for(var Mt=0;Mt<t;Mt++){for(var $=s[Mt],gt=R[Mt],ft=u[Mt],vt=E[Mt],it=0;it<y;it++)$[it]=gt[it]/vt||0;if(p){for(var lt=0;lt<y;lt++)if(ft[lt]!=$[lt]){p=!1;break}}}}else{for(var H=0;H<g;H++){var At=c[H];R[At]+=n[H]}for(var It=0;It<t;It++)s[It]=R[It]/E[It]||0;p=!0;for(var Kt=0;Kt<t;Kt++)if(u[Kt]!=s[Kt]){p=!1;break}}p=p||--d<=0}while(!p);return{it:R2-d,k:t,idxs:c,centroids:s}}O2.exports=LK});var oc=X((qx,Vx)=>{(function(n,t){typeof qx=="object"&&typeof Vx!="undefined"?Vx.exports=t():typeof define=="function"&&define.amd?define(t):(n=typeof globalThis!="undefined"?globalThis:n||self,n.polygonClipping=t())})(qx,function(){"use strict";function n(j,b){var I={label:0,sent:function(){if(G[0]&1)throw G[1];return G[1]},trys:[],ops:[]},F,k,G,rt;return rt={next:tt(0),throw:tt(1),return:tt(2)},typeof Symbol=="function"&&(rt[Symbol.iterator]=function(){return this}),rt;function tt(ht){return function(O){return pt([ht,O])}}function pt(ht){if(F)throw new TypeError("Generator is already executing.");for(;I;)try{if(F=1,k&&(G=ht[0]&2?k.return:ht[0]?k.throw||((G=k.return)&&G.call(k),0):k.next)&&!(G=G.call(k,ht[1])).done)return G;switch(k=0,G&&(ht=[ht[0]&2,G.value]),ht[0]){case 0:case 1:G=ht;break;case 4:return I.label++,{value:ht[1],done:!1};case 5:I.label++,k=ht[1],ht=[0];continue;case 7:ht=I.ops.pop(),I.trys.pop();continue;default:if(G=I.trys,!(G=G.length>0&&G[G.length-1])&&(ht[0]===6||ht[0]===2)){I=0;continue}if(ht[0]===3&&(!G||ht[1]>G[0]&&ht[1]<G[3])){I.label=ht[1];break}if(ht[0]===6&&I.label<G[1]){I.label=G[1],G=ht;break}if(G&&I.label<G[2]){I.label=G[2],I.ops.push(ht);break}G[2]&&I.ops.pop(),I.trys.pop();continue}ht=b.call(j,I)}catch(O){ht=[6,O],k=0}finally{F=G=0}if(ht[0]&5)throw ht[1];return{value:ht[0]?ht[1]:void 0,done:!0}}}var t=function(){function j(b,I){this.next=null,this.key=b,this.data=I,this.left=null,this.right=null}return j}();function e(j,b){return j>b?1:j<b?-1:0}function i(j,b,I){for(var F=new t(null,null),k=F,G=F;;){var rt=I(j,b.key);if(rt<0){if(b.left===null)break;if(I(j,b.left.key)<0){var tt=b.left;if(b.left=tt.right,tt.right=b,b=tt,b.left===null)break}G.left=b,G=b,b=b.left}else if(rt>0){if(b.right===null)break;if(I(j,b.right.key)>0){var tt=b.right;if(b.right=tt.left,tt.left=b,b=tt,b.right===null)break}k.right=b,k=b,b=b.right}else break}return k.right=b.left,G.left=b.right,b.left=F.right,b.right=F.left,b}function s(j,b,I,F){var k=new t(j,b);if(I===null)return k.left=k.right=null,k;I=i(j,I,F);var G=F(j,I.key);return G<0?(k.left=I.left,k.right=I,I.left=null):G>=0&&(k.right=I.right,k.left=I,I.right=null),k}function u(j,b,I){var F=null,k=null;if(b){b=i(j,b,I);var G=I(b.key,j);G===0?(F=b.left,k=b.right):G<0?(k=b.right,b.right=null,F=b):(F=b.left,b.left=null,k=b)}return{left:F,right:k}}function c(j,b,I){return b===null?j:(j===null||(b=i(j.key,b,I),b.left=j),b)}function f(j,b,I,F,k){if(j){F(""+b+(I?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+k(j)+\`
12315
12315
  \`);var G=b+(I?" ":"\\u2502 ");j.left&&f(j.left,G,!1,F,k),j.right&&f(j.right,G,!0,F,k)}}var p=function(){function j(b){b===void 0&&(b=e),this._root=null,this._size=0,this._comparator=b}return j.prototype.insert=function(b,I){return this._size++,this._root=s(b,I,this._root,this._comparator)},j.prototype.add=function(b,I){var F=new t(b,I);this._root===null&&(F.left=F.right=null,this._size++,this._root=F);var k=this._comparator,G=i(b,this._root,k),rt=k(b,G.key);return rt===0?this._root=G:(rt<0?(F.left=G.left,F.right=G,G.left=null):rt>0&&(F.right=G.right,F.left=G,G.right=null),this._size++,this._root=F),this._root},j.prototype.remove=function(b){this._root=this._remove(b,this._root,this._comparator)},j.prototype._remove=function(b,I,F){var k;if(I===null)return null;I=i(b,I,F);var G=F(b,I.key);return G===0?(I.left===null?k=I.right:(k=i(b,I.left,F),k.right=I.right),this._size--,k):I},j.prototype.pop=function(){var b=this._root;if(b){for(;b.left;)b=b.left;return this._root=i(b.key,this._root,this._comparator),this._root=this._remove(b.key,this._root,this._comparator),{key:b.key,data:b.data}}return null},j.prototype.findStatic=function(b){for(var I=this._root,F=this._comparator;I;){var k=F(b,I.key);if(k===0)return I;k<0?I=I.left:I=I.right}return null},j.prototype.find=function(b){return this._root&&(this._root=i(b,this._root,this._comparator),this._comparator(b,this._root.key)!==0)?null:this._root},j.prototype.contains=function(b){for(var I=this._root,F=this._comparator;I;){var k=F(b,I.key);if(k===0)return!0;k<0?I=I.left:I=I.right}return!1},j.prototype.forEach=function(b,I){for(var F=this._root,k=[],G=!1;!G;)F!==null?(k.push(F),F=F.left):k.length!==0?(F=k.pop(),b.call(I,F),F=F.right):G=!0;return this},j.prototype.range=function(b,I,F,k){for(var G=[],rt=this._comparator,tt=this._root,pt;G.length!==0||tt;)if(tt)G.push(tt),tt=tt.left;else{if(tt=G.pop(),pt=rt(tt.key,I),pt>0)break;if(rt(tt.key,b)>=0&&F.call(k,tt))return this;tt=tt.right}return this},j.prototype.keys=function(){var b=[];return this.forEach(function(I){var F=I.key;return b.push(F)}),b},j.prototype.values=function(){var b=[];return this.forEach(function(I){var F=I.data;return b.push(F)}),b},j.prototype.min=function(){return this._root?this.minNode(this._root).key:null},j.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},j.prototype.minNode=function(b){if(b===void 0&&(b=this._root),b)for(;b.left;)b=b.left;return b},j.prototype.maxNode=function(b){if(b===void 0&&(b=this._root),b)for(;b.right;)b=b.right;return b},j.prototype.at=function(b){for(var I=this._root,F=!1,k=0,G=[];!F;)if(I)G.push(I),I=I.left;else if(G.length>0){if(I=G.pop(),k===b)return I;k++,I=I.right}else F=!0;return null},j.prototype.next=function(b){var I=this._root,F=null;if(b.right){for(F=b.right;F.left;)F=F.left;return F}for(var k=this._comparator;I;){var G=k(b.key,I.key);if(G===0)break;G<0?(F=I,I=I.left):I=I.right}return F},j.prototype.prev=function(b){var I=this._root,F=null;if(b.left!==null){for(F=b.left;F.right;)F=F.right;return F}for(var k=this._comparator;I;){var G=k(b.key,I.key);if(G===0)break;G<0?I=I.left:(F=I,I=I.right)}return F},j.prototype.clear=function(){return this._root=null,this._size=0,this},j.prototype.toList=function(){return y(this._root)},j.prototype.load=function(b,I,F){I===void 0&&(I=[]),F===void 0&&(F=!1);var k=b.length,G=this._comparator;if(F&&M(b,I,0,k-1,G),this._root===null)this._root=d(b,I,0,k),this._size=k;else{var rt=E(this.toList(),g(b,I),G);k=this._size+k,this._root=v({head:rt},0,k)}return this},j.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(j.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),j.prototype.toString=function(b){b===void 0&&(b=function(F){return String(F.key)});var I=[];return f(this._root,"",!0,function(F){return I.push(F)},b),I.join("")},j.prototype.update=function(b,I,F){var k=this._comparator,G=u(b,this._root,k),rt=G.left,tt=G.right;k(b,I)<0?tt=s(I,F,tt,k):rt=s(I,F,rt,k),this._root=c(rt,tt,k)},j.prototype.split=function(b){return u(b,this._root,this._comparator)},j.prototype[Symbol.iterator]=function(){var b,I,F;return n(this,function(k){switch(k.label){case 0:b=this._root,I=[],F=!1,k.label=1;case 1:return F?[3,6]:b===null?[3,2]:(I.push(b),b=b.left,[3,5]);case 2:return I.length===0?[3,4]:(b=I.pop(),[4,b]);case 3:return k.sent(),b=b.right,[3,5];case 4:F=!0,k.label=5;case 5:return[3,1];case 6:return[2]}})},j}();function d(j,b,I,F){var k=F-I;if(k>0){var G=I+Math.floor(k/2),rt=j[G],tt=b[G],pt=new t(rt,tt);return pt.left=d(j,b,I,G),pt.right=d(j,b,G+1,F),pt}return null}function g(j,b){for(var I=new t(null,null),F=I,k=0;k<j.length;k++)F=F.next=new t(j[k],b[k]);return F.next=null,I.next}function y(j){for(var b=j,I=[],F=!1,k=new t(null,null),G=k;!F;)b?(I.push(b),b=b.left):I.length>0?(b=G=G.next=I.pop(),b=b.right):F=!0;return G.next=null,k.next}function v(j,b,I){var F=I-b;if(F>0){var k=b+Math.floor(F/2),G=v(j,b,k),rt=j.head;return rt.left=G,j.head=j.head.next,rt.right=v(j,k+1,I),rt}return null}function E(j,b,I){for(var F=new t(null,null),k=F,G=j,rt=b;G!==null&&rt!==null;)I(G.key,rt.key)<0?(k.next=G,G=G.next):(k.next=rt,rt=rt.next),k=k.next;return G!==null?k.next=G:rt!==null&&(k.next=rt),F.next}function M(j,b,I,F,k){if(!(I>=F)){for(var G=j[I+F>>1],rt=I-1,tt=F+1;;){do rt++;while(k(j[rt],G)<0);do tt--;while(k(j[tt],G)>0);if(rt>=tt)break;var pt=j[rt];j[rt]=j[tt],j[tt]=pt,pt=b[rt],b[rt]=b[tt],b[tt]=pt}M(j,b,I,tt,k),M(j,b,tt+1,F,k)}}let A=(j,b)=>j.ll.x<=b.x&&b.x<=j.ur.x&&j.ll.y<=b.y&&b.y<=j.ur.y,_=(j,b)=>{if(b.ur.x<j.ll.x||j.ur.x<b.ll.x||b.ur.y<j.ll.y||j.ur.y<b.ll.y)return null;let I=j.ll.x<b.ll.x?b.ll.x:j.ll.x,F=j.ur.x<b.ur.x?j.ur.x:b.ur.x,k=j.ll.y<b.ll.y?b.ll.y:j.ll.y,G=j.ur.y<b.ur.y?j.ur.y:b.ur.y;return{ll:{x:I,y:k},ur:{x:F,y:G}}},x=Number.EPSILON;x===void 0&&(x=Math.pow(2,-52));let T=x*x,w=(j,b)=>{if(-x<j&&j<x&&-x<b&&b<x)return 0;let I=j-b;return I*I<T*j*b?0:j<b?-1:1};class R{constructor(){this.reset()}reset(){this.xRounder=new z,this.yRounder=new z}round(b,I){return{x:this.xRounder.round(b),y:this.yRounder.round(I)}}}class z{constructor(){this.tree=new p,this.round(0)}round(b){let I=this.tree.add(b),F=this.tree.prev(I);if(F!==null&&w(I.key,F.key)===0)return this.tree.remove(b),F.key;let k=this.tree.next(I);return k!==null&&w(I.key,k.key)===0?(this.tree.remove(b),k.key):b}}let U=new R,D=11102230246251565e-32,P=134217729,ct=(3+8*D)*D;function L(j,b,I,F,k){let G,rt,tt,pt,ht=b[0],O=F[0],Q=0,J=0;O>ht==O>-ht?(G=ht,ht=b[++Q]):(G=O,O=F[++J]);let et=0;if(Q<j&&J<I)for(O>ht==O>-ht?(rt=ht+G,tt=G-(rt-ht),ht=b[++Q]):(rt=O+G,tt=G-(rt-O),O=F[++J]),G=rt,tt!==0&&(k[et++]=tt);Q<j&&J<I;)O>ht==O>-ht?(rt=G+ht,pt=rt-G,tt=G-(rt-pt)+(ht-pt),ht=b[++Q]):(rt=G+O,pt=rt-G,tt=G-(rt-pt)+(O-pt),O=F[++J]),G=rt,tt!==0&&(k[et++]=tt);for(;Q<j;)rt=G+ht,pt=rt-G,tt=G-(rt-pt)+(ht-pt),ht=b[++Q],G=rt,tt!==0&&(k[et++]=tt);for(;J<I;)rt=G+O,pt=rt-G,tt=G-(rt-pt)+(O-pt),O=F[++J],G=rt,tt!==0&&(k[et++]=tt);return(G!==0||et===0)&&(k[et++]=G),et}function W(j,b){let I=b[0];for(let F=1;F<j;F++)I+=b[F];return I}function V(j){return new Float64Array(j)}let Mt=(3+16*D)*D,$=(2+12*D)*D,gt=(9+64*D)*D*D,ft=V(4),vt=V(8),it=V(12),lt=V(16),H=V(4);function At(j,b,I,F,k,G,rt){let tt,pt,ht,O,Q,J,et,Tt,kt,ie,oe,we,ye,be,Ae,Bn,dr,_n,pe=j-k,xn=I-k,Nn=b-G,Cn=F-G;be=pe*Cn,J=P*pe,et=J-(J-pe),Tt=pe-et,J=P*Cn,kt=J-(J-Cn),ie=Cn-kt,Ae=Tt*ie-(be-et*kt-Tt*kt-et*ie),Bn=Nn*xn,J=P*Nn,et=J-(J-Nn),Tt=Nn-et,J=P*xn,kt=J-(J-xn),ie=xn-kt,dr=Tt*ie-(Bn-et*kt-Tt*kt-et*ie),oe=Ae-dr,Q=Ae-oe,ft[0]=Ae-(oe+Q)+(Q-dr),we=be+oe,Q=we-be,ye=be-(we-Q)+(oe-Q),oe=ye-Bn,Q=ye-oe,ft[1]=ye-(oe+Q)+(Q-Bn),_n=we+oe,Q=_n-we,ft[2]=we-(_n-Q)+(oe-Q),ft[3]=_n;let En=W(4,ft),Kr=$*rt;if(En>=Kr||-En>=Kr||(Q=j-pe,tt=j-(pe+Q)+(Q-k),Q=I-xn,ht=I-(xn+Q)+(Q-k),Q=b-Nn,pt=b-(Nn+Q)+(Q-G),Q=F-Cn,O=F-(Cn+Q)+(Q-G),tt===0&&pt===0&&ht===0&&O===0)||(Kr=gt*rt+ct*Math.abs(En),En+=pe*O+Cn*tt-(Nn*ht+xn*pt),En>=Kr||-En>=Kr))return En;be=tt*Cn,J=P*tt,et=J-(J-tt),Tt=tt-et,J=P*Cn,kt=J-(J-Cn),ie=Cn-kt,Ae=Tt*ie-(be-et*kt-Tt*kt-et*ie),Bn=pt*xn,J=P*pt,et=J-(J-pt),Tt=pt-et,J=P*xn,kt=J-(J-xn),ie=xn-kt,dr=Tt*ie-(Bn-et*kt-Tt*kt-et*ie),oe=Ae-dr,Q=Ae-oe,H[0]=Ae-(oe+Q)+(Q-dr),we=be+oe,Q=we-be,ye=be-(we-Q)+(oe-Q),oe=ye-Bn,Q=ye-oe,H[1]=ye-(oe+Q)+(Q-Bn),_n=we+oe,Q=_n-we,H[2]=we-(_n-Q)+(oe-Q),H[3]=_n;let Ar=L(4,ft,4,H,vt);be=pe*O,J=P*pe,et=J-(J-pe),Tt=pe-et,J=P*O,kt=J-(J-O),ie=O-kt,Ae=Tt*ie-(be-et*kt-Tt*kt-et*ie),Bn=Nn*ht,J=P*Nn,et=J-(J-Nn),Tt=Nn-et,J=P*ht,kt=J-(J-ht),ie=ht-kt,dr=Tt*ie-(Bn-et*kt-Tt*kt-et*ie),oe=Ae-dr,Q=Ae-oe,H[0]=Ae-(oe+Q)+(Q-dr),we=be+oe,Q=we-be,ye=be-(we-Q)+(oe-Q),oe=ye-Bn,Q=ye-oe,H[1]=ye-(oe+Q)+(Q-Bn),_n=we+oe,Q=_n-we,H[2]=we-(_n-Q)+(oe-Q),H[3]=_n;let q=L(Ar,vt,4,H,it);be=tt*O,J=P*tt,et=J-(J-tt),Tt=tt-et,J=P*O,kt=J-(J-O),ie=O-kt,Ae=Tt*ie-(be-et*kt-Tt*kt-et*ie),Bn=pt*ht,J=P*pt,et=J-(J-pt),Tt=pt-et,J=P*ht,kt=J-(J-ht),ie=ht-kt,dr=Tt*ie-(Bn-et*kt-Tt*kt-et*ie),oe=Ae-dr,Q=Ae-oe,H[0]=Ae-(oe+Q)+(Q-dr),we=be+oe,Q=we-be,ye=be-(we-Q)+(oe-Q),oe=ye-Bn,Q=ye-oe,H[1]=ye-(oe+Q)+(Q-Bn),_n=we+oe,Q=_n-we,H[2]=we-(_n-Q)+(oe-Q),H[3]=_n;let at=L(q,it,4,H,lt);return lt[at-1]}function It(j,b,I,F,k,G){let rt=(b-G)*(I-k),tt=(j-k)*(F-G),pt=rt-tt,ht=Math.abs(rt+tt);return Math.abs(pt)>=Mt*ht?pt:-At(j,b,I,F,k,G,ht)}let Kt=(j,b)=>j.x*b.y-j.y*b.x,nt=(j,b)=>j.x*b.x+j.y*b.y,bt=(j,b,I)=>{let F=It(j.x,j.y,b.x,b.y,I.x,I.y);return F>0?-1:F<0?1:0},Vt=j=>Math.sqrt(nt(j,j)),$t=(j,b,I)=>{let F={x:b.x-j.x,y:b.y-j.y},k={x:I.x-j.x,y:I.y-j.y};return Kt(k,F)/Vt(k)/Vt(F)},Ut=(j,b,I)=>{let F={x:b.x-j.x,y:b.y-j.y},k={x:I.x-j.x,y:I.y-j.y};return nt(k,F)/Vt(k)/Vt(F)},Gt=(j,b,I)=>b.y===0?null:{x:j.x+b.x/b.y*(I-j.y),y:I},Ct=(j,b,I)=>b.x===0?null:{x:I,y:j.y+b.y/b.x*(I-j.x)},ee=(j,b,I,F)=>{if(b.x===0)return Ct(I,F,j.x);if(F.x===0)return Ct(j,b,I.x);if(b.y===0)return Gt(I,F,j.y);if(F.y===0)return Gt(j,b,I.y);let k=Kt(b,F);if(k==0)return null;let G={x:I.x-j.x,y:I.y-j.y},rt=Kt(G,b)/k,tt=Kt(G,F)/k,pt=j.x+tt*b.x,ht=I.x+rt*F.x,O=j.y+tt*b.y,Q=I.y+rt*F.y,J=(pt+ht)/2,et=(O+Q)/2;return{x:J,y:et}};class Z{static compare(b,I){let F=Z.comparePoints(b.point,I.point);return F!==0?F:(b.point!==I.point&&b.link(I),b.isLeft!==I.isLeft?b.isLeft?1:-1:_t.compare(b.segment,I.segment))}static comparePoints(b,I){return b.x<I.x?-1:b.x>I.x?1:b.y<I.y?-1:b.y>I.y?1:0}constructor(b,I){b.events===void 0?b.events=[this]:b.events.push(this),this.point=b,this.isLeft=I}link(b){if(b.point===this.point)throw new Error("Tried to link already linked events");let I=b.point.events;for(let F=0,k=I.length;F<k;F++){let G=I[F];this.point.events.push(G),G.point=this.point}this.checkForConsuming()}checkForConsuming(){let b=this.point.events.length;for(let I=0;I<b;I++){let F=this.point.events[I];if(F.segment.consumedBy===void 0)for(let k=I+1;k<b;k++){let G=this.point.events[k];G.consumedBy===void 0&&F.otherSE.point.events===G.otherSE.point.events&&F.segment.consume(G.segment)}}}getAvailableLinkedEvents(){let b=[];for(let I=0,F=this.point.events.length;I<F;I++){let k=this.point.events[I];k!==this&&!k.segment.ringOut&&k.segment.isInResult()&&b.push(k)}return b}getLeftmostComparator(b){let I=new Map,F=k=>{let G=k.otherSE;I.set(k,{sine:$t(this.point,b.point,G.point),cosine:Ut(this.point,b.point,G.point)})};return(k,G)=>{I.has(k)||F(k),I.has(G)||F(G);let{sine:rt,cosine:tt}=I.get(k),{sine:pt,cosine:ht}=I.get(G);return rt>=0&&pt>=0?tt<ht?1:tt>ht?-1:0:rt<0&&pt<0?tt<ht?-1:tt>ht?1:0:pt<rt?-1:pt>rt?1:0}}}let Dt=0;class _t{static compare(b,I){let F=b.leftSE.point.x,k=I.leftSE.point.x,G=b.rightSE.point.x,rt=I.rightSE.point.x;if(rt<F)return 1;if(G<k)return-1;let tt=b.leftSE.point.y,pt=I.leftSE.point.y,ht=b.rightSE.point.y,O=I.rightSE.point.y;if(F<k){if(pt<tt&&pt<ht)return 1;if(pt>tt&&pt>ht)return-1;let Q=b.comparePoint(I.leftSE.point);if(Q<0)return 1;if(Q>0)return-1;let J=I.comparePoint(b.rightSE.point);return J!==0?J:-1}if(F>k){if(tt<pt&&tt<O)return-1;if(tt>pt&&tt>O)return 1;let Q=I.comparePoint(b.leftSE.point);if(Q!==0)return Q;let J=b.comparePoint(I.rightSE.point);return J<0?1:J>0?-1:1}if(tt<pt)return-1;if(tt>pt)return 1;if(G<rt){let Q=I.comparePoint(b.rightSE.point);if(Q!==0)return Q}if(G>rt){let Q=b.comparePoint(I.rightSE.point);if(Q<0)return 1;if(Q>0)return-1}if(G!==rt){let Q=ht-tt,J=G-F,et=O-pt,Tt=rt-k;if(Q>J&&et<Tt)return 1;if(Q<J&&et>Tt)return-1}return G>rt?1:G<rt||ht<O?-1:ht>O?1:b.id<I.id?-1:b.id>I.id?1:0}constructor(b,I,F,k){this.id=++Dt,this.leftSE=b,b.segment=this,b.otherSE=I,this.rightSE=I,I.segment=this,I.otherSE=b,this.rings=F,this.windings=k}static fromRing(b,I,F){let k,G,rt,tt=Z.comparePoints(b,I);if(tt<0)k=b,G=I,rt=1;else if(tt>0)k=I,G=b,rt=-1;else throw new Error(\`Tried to create degenerate segment at [\${b.x}, \${b.y}]\`);let pt=new Z(k,!0),ht=new Z(G,!1);return new _t(pt,ht,[F],[rt])}replaceRightSE(b){this.rightSE=b,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let b=this.leftSE.point.y,I=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:b<I?b:I},ur:{x:this.rightSE.point.x,y:b>I?b:I}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(b){return b.x===this.leftSE.point.x&&b.y===this.leftSE.point.y||b.x===this.rightSE.point.x&&b.y===this.rightSE.point.y}comparePoint(b){if(this.isAnEndpoint(b))return 0;let I=this.leftSE.point,F=this.rightSE.point,k=this.vector();if(I.x===F.x)return b.x===I.x?0:b.x<I.x?1:-1;let G=(b.y-I.y)/k.y,rt=I.x+G*k.x;if(b.x===rt)return 0;let tt=(b.x-I.x)/k.x,pt=I.y+tt*k.y;return b.y===pt?0:b.y<pt?-1:1}getIntersection(b){let I=this.bbox(),F=b.bbox(),k=_(I,F);if(k===null)return null;let G=this.leftSE.point,rt=this.rightSE.point,tt=b.leftSE.point,pt=b.rightSE.point,ht=A(I,tt)&&this.comparePoint(tt)===0,O=A(F,G)&&b.comparePoint(G)===0,Q=A(I,pt)&&this.comparePoint(pt)===0,J=A(F,rt)&&b.comparePoint(rt)===0;if(O&&ht)return J&&!Q?rt:!J&&Q?pt:null;if(O)return Q&&G.x===pt.x&&G.y===pt.y?null:G;if(ht)return J&&rt.x===tt.x&&rt.y===tt.y?null:tt;if(J&&Q)return null;if(J)return rt;if(Q)return pt;let et=ee(G,this.vector(),tt,b.vector());return et===null||!A(k,et)?null:U.round(et.x,et.y)}split(b){let I=[],F=b.events!==void 0,k=new Z(b,!0),G=new Z(b,!1),rt=this.rightSE;this.replaceRightSE(G),I.push(G),I.push(k);let tt=new _t(k,rt,this.rings.slice(),this.windings.slice());return Z.comparePoints(tt.leftSE.point,tt.rightSE.point)>0&&tt.swapEvents(),Z.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),F&&(k.checkForConsuming(),G.checkForConsuming()),I}swapEvents(){let b=this.rightSE;this.rightSE=this.leftSE,this.leftSE=b,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let I=0,F=this.windings.length;I<F;I++)this.windings[I]*=-1}consume(b){let I=this,F=b;for(;I.consumedBy;)I=I.consumedBy;for(;F.consumedBy;)F=F.consumedBy;let k=_t.compare(I,F);if(k!==0){if(k>0){let G=I;I=F,F=G}if(I.prev===F){let G=I;I=F,F=G}for(let G=0,rt=F.rings.length;G<rt;G++){let tt=F.rings[G],pt=F.windings[G],ht=I.rings.indexOf(tt);ht===-1?(I.rings.push(tt),I.windings.push(pt)):I.windings[ht]+=pt}F.rings=null,F.windings=null,F.consumedBy=I,F.leftSE.consumedBy=I.leftSE,F.rightSE.consumedBy=I.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let b=this.prev.consumedBy||this.prev;this._beforeState=b.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let b=this.beforeState();this._afterState={rings:b.rings.slice(0),windings:b.windings.slice(0),multiPolys:[]};let I=this._afterState.rings,F=this._afterState.windings,k=this._afterState.multiPolys;for(let tt=0,pt=this.rings.length;tt<pt;tt++){let ht=this.rings[tt],O=this.windings[tt],Q=I.indexOf(ht);Q===-1?(I.push(ht),F.push(O)):F[Q]+=O}let G=[],rt=[];for(let tt=0,pt=I.length;tt<pt;tt++){if(F[tt]===0)continue;let ht=I[tt],O=ht.poly;if(rt.indexOf(O)===-1)if(ht.isExterior)G.push(O);else{rt.indexOf(O)===-1&&rt.push(O);let Q=G.indexOf(ht.poly);Q!==-1&&G.splice(Q,1)}}for(let tt=0,pt=G.length;tt<pt;tt++){let ht=G[tt].multiPoly;k.indexOf(ht)===-1&&k.push(ht)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let b=this.beforeState().multiPolys,I=this.afterState().multiPolys;switch(ot.type){case"union":{let F=b.length===0,k=I.length===0;this._isInResult=F!==k;break}case"intersection":{let F,k;b.length<I.length?(F=b.length,k=I.length):(F=I.length,k=b.length),this._isInResult=k===ot.numMultiPolys&&F<k;break}case"xor":{let F=Math.abs(b.length-I.length);this._isInResult=F%2===1;break}case"difference":{let F=k=>k.length===1&&k[0].isSubject;this._isInResult=F(b)!==F(I);break}default:throw new Error(\`Unrecognized operation type found \${ot.type}\`)}return this._isInResult}}class Nt{constructor(b,I,F){if(!Array.isArray(b)||b.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=I,this.isExterior=F,this.segments=[],typeof b[0][0]!="number"||typeof b[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let k=U.round(b[0][0],b[0][1]);this.bbox={ll:{x:k.x,y:k.y},ur:{x:k.x,y:k.y}};let G=k;for(let rt=1,tt=b.length;rt<tt;rt++){if(typeof b[rt][0]!="number"||typeof b[rt][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let pt=U.round(b[rt][0],b[rt][1]);pt.x===G.x&&pt.y===G.y||(this.segments.push(_t.fromRing(G,pt,this)),pt.x<this.bbox.ll.x&&(this.bbox.ll.x=pt.x),pt.y<this.bbox.ll.y&&(this.bbox.ll.y=pt.y),pt.x>this.bbox.ur.x&&(this.bbox.ur.x=pt.x),pt.y>this.bbox.ur.y&&(this.bbox.ur.y=pt.y),G=pt)}(k.x!==G.x||k.y!==G.y)&&this.segments.push(_t.fromRing(G,k,this))}getSweepEvents(){let b=[];for(let I=0,F=this.segments.length;I<F;I++){let k=this.segments[I];b.push(k.leftSE),b.push(k.rightSE)}return b}}class wt{constructor(b,I){if(!Array.isArray(b))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Nt(b[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let F=1,k=b.length;F<k;F++){let G=new Nt(b[F],this,!1);G.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=G.bbox.ll.x),G.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=G.bbox.ll.y),G.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=G.bbox.ur.x),G.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=G.bbox.ur.y),this.interiorRings.push(G)}this.multiPoly=I}getSweepEvents(){let b=this.exteriorRing.getSweepEvents();for(let I=0,F=this.interiorRings.length;I<F;I++){let k=this.interiorRings[I].getSweepEvents();for(let G=0,rt=k.length;G<rt;G++)b.push(k[G])}return b}}class Ht{constructor(b,I){if(!Array.isArray(b))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof b[0][0][0]=="number"&&(b=[b])}catch(F){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let F=0,k=b.length;F<k;F++){let G=new wt(b[F],this);G.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=G.bbox.ll.x),G.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=G.bbox.ll.y),G.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=G.bbox.ur.x),G.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=G.bbox.ur.y),this.polys.push(G)}this.isSubject=I}getSweepEvents(){let b=[];for(let I=0,F=this.polys.length;I<F;I++){let k=this.polys[I].getSweepEvents();for(let G=0,rt=k.length;G<rt;G++)b.push(k[G])}return b}}class Xt{static factory(b){let I=[];for(let F=0,k=b.length;F<k;F++){let G=b[F];if(!G.isInResult()||G.ringOut)continue;let rt=null,tt=G.leftSE,pt=G.rightSE,ht=[tt],O=tt.point,Q=[];for(;rt=tt,tt=pt,ht.push(tt),tt.point!==O;)for(;;){let J=tt.getAvailableLinkedEvents();if(J.length===0){let kt=ht[0].point,ie=ht[ht.length-1].point;throw new Error(\`Unable to complete output ring starting at [\${kt.x}, \${kt.y}]. Last matching segment found ends at [\${ie.x}, \${ie.y}].\`)}if(J.length===1){pt=J[0].otherSE;break}let et=null;for(let kt=0,ie=Q.length;kt<ie;kt++)if(Q[kt].point===tt.point){et=kt;break}if(et!==null){let kt=Q.splice(et)[0],ie=ht.splice(kt.index);ie.unshift(ie[0].otherSE),I.push(new Xt(ie.reverse()));continue}Q.push({index:ht.length,point:tt.point});let Tt=tt.getLeftmostComparator(rt);pt=J.sort(Tt)[0].otherSE;break}I.push(new Xt(ht))}return I}constructor(b){this.events=b;for(let I=0,F=b.length;I<F;I++)b[I].segment.ringOut=this;this.poly=null}getGeom(){let b=this.events[0].point,I=[b];for(let ht=1,O=this.events.length-1;ht<O;ht++){let Q=this.events[ht].point,J=this.events[ht+1].point;bt(Q,b,J)!==0&&(I.push(Q),b=Q)}if(I.length===1)return null;let F=I[0],k=I[1];bt(F,b,k)===0&&I.shift(),I.push(I[0]);let G=this.isExteriorRing()?1:-1,rt=this.isExteriorRing()?0:I.length-1,tt=this.isExteriorRing()?I.length:-1,pt=[];for(let ht=rt;ht!=tt;ht+=G)pt.push([I[ht].x,I[ht].y]);return pt}isExteriorRing(){if(this._isExteriorRing===void 0){let b=this.enclosingRing();this._isExteriorRing=b?!b.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let b=this.events[0];for(let k=1,G=this.events.length;k<G;k++){let rt=this.events[k];Z.compare(b,rt)>0&&(b=rt)}let I=b.segment.prevInResult(),F=I?I.prevInResult():null;for(;;){if(!I)return null;if(!F)return I.ringOut;if(F.ringOut!==I.ringOut)return F.ringOut.enclosingRing()!==I.ringOut?I.ringOut:I.ringOut.enclosingRing();I=F.prevInResult(),F=I?I.prevInResult():null}}}class Pt{constructor(b){this.exteriorRing=b,b.poly=this,this.interiorRings=[]}addInterior(b){this.interiorRings.push(b),b.poly=this}getGeom(){let b=[this.exteriorRing.getGeom()];if(b[0]===null)return null;for(let I=0,F=this.interiorRings.length;I<F;I++){let k=this.interiorRings[I].getGeom();k!==null&&b.push(k)}return b}}class ne{constructor(b){this.rings=b,this.polys=this._composePolys(b)}getGeom(){let b=[];for(let I=0,F=this.polys.length;I<F;I++){let k=this.polys[I].getGeom();k!==null&&b.push(k)}return b}_composePolys(b){let I=[];for(let F=0,k=b.length;F<k;F++){let G=b[F];if(!G.poly)if(G.isExteriorRing())I.push(new Pt(G));else{let rt=G.enclosingRing();rt.poly||I.push(new Pt(rt)),rt.poly.addInterior(G)}}return I}}class Y{constructor(b){let I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_t.compare;this.queue=b,this.tree=new p(I),this.segments=[]}process(b){let I=b.segment,F=[];if(b.consumedBy)return b.isLeft?this.queue.remove(b.otherSE):this.tree.remove(I),F;let k=b.isLeft?this.tree.add(I):this.tree.find(I);if(!k)throw new Error(\`Unable to find segment #\${I.id} [\${I.leftSE.point.x}, \${I.leftSE.point.y}] -> [\${I.rightSE.point.x}, \${I.rightSE.point.y}] in SweepLine tree.\`);let G=k,rt=k,tt,pt;for(;tt===void 0;)G=this.tree.prev(G),G===null?tt=null:G.key.consumedBy===void 0&&(tt=G.key);for(;pt===void 0;)rt=this.tree.next(rt),rt===null?pt=null:rt.key.consumedBy===void 0&&(pt=rt.key);if(b.isLeft){let ht=null;if(tt){let Q=tt.getIntersection(I);if(Q!==null&&(I.isAnEndpoint(Q)||(ht=Q),!tt.isAnEndpoint(Q))){let J=this._splitSafely(tt,Q);for(let et=0,Tt=J.length;et<Tt;et++)F.push(J[et])}}let O=null;if(pt){let Q=pt.getIntersection(I);if(Q!==null&&(I.isAnEndpoint(Q)||(O=Q),!pt.isAnEndpoint(Q))){let J=this._splitSafely(pt,Q);for(let et=0,Tt=J.length;et<Tt;et++)F.push(J[et])}}if(ht!==null||O!==null){let Q=null;ht===null?Q=O:O===null?Q=ht:Q=Z.comparePoints(ht,O)<=0?ht:O,this.queue.remove(I.rightSE),F.push(I.rightSE);let J=I.split(Q);for(let et=0,Tt=J.length;et<Tt;et++)F.push(J[et])}F.length>0?(this.tree.remove(I),F.push(b)):(this.segments.push(I),I.prev=tt)}else{if(tt&&pt){let ht=tt.getIntersection(pt);if(ht!==null){if(!tt.isAnEndpoint(ht)){let O=this._splitSafely(tt,ht);for(let Q=0,J=O.length;Q<J;Q++)F.push(O[Q])}if(!pt.isAnEndpoint(ht)){let O=this._splitSafely(pt,ht);for(let Q=0,J=O.length;Q<J;Q++)F.push(O[Q])}}}this.tree.remove(I)}return F}_splitSafely(b,I){this.tree.remove(b);let F=b.rightSE;this.queue.remove(F);let k=b.split(I);return k.push(F),b.consumedBy===void 0&&this.tree.add(b),k}}let N=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,xt=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class St{run(b,I,F){ot.type=b,U.reset();let k=[new Ht(I,!0)];for(let Q=0,J=F.length;Q<J;Q++)k.push(new Ht(F[Q],!1));if(ot.numMultiPolys=k.length,ot.type==="difference"){let Q=k[0],J=1;for(;J<k.length;)_(k[J].bbox,Q.bbox)!==null?J++:k.splice(J,1)}if(ot.type==="intersection")for(let Q=0,J=k.length;Q<J;Q++){let et=k[Q];for(let Tt=Q+1,kt=k.length;Tt<kt;Tt++)if(_(et.bbox,k[Tt].bbox)===null)return[]}let G=new p(Z.compare);for(let Q=0,J=k.length;Q<J;Q++){let et=k[Q].getSweepEvents();for(let Tt=0,kt=et.length;Tt<kt;Tt++)if(G.insert(et[Tt]),G.size>N)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let rt=new Y(G),tt=G.size,pt=G.pop();for(;pt;){let Q=pt.key;if(G.size===tt){let et=Q.segment;throw new Error(\`Unable to pop() \${Q.isLeft?"left":"right"} SweepEvent [\${Q.point.x}, \${Q.point.y}] from segment #\${et.id} [\${et.leftSE.point.x}, \${et.leftSE.point.y}] -> [\${et.rightSE.point.x}, \${et.rightSE.point.y}] from queue.\`)}if(G.size>N)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(rt.segments.length>xt)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let J=rt.process(Q);for(let et=0,Tt=J.length;et<Tt;et++){let kt=J[et];kt.consumedBy===void 0&&G.insert(kt)}tt=G.size,pt=G.pop()}U.reset();let ht=Xt.factory(rt.segments);return new ne(ht).getGeom()}}let ot=new St;var Wt={union:function(j){for(var b=arguments.length,I=new Array(b>1?b-1:0),F=1;F<b;F++)I[F-1]=arguments[F];return ot.run("union",j,I)},intersection:function(j){for(var b=arguments.length,I=new Array(b>1?b-1:0),F=1;F<b;F++)I[F-1]=arguments[F];return ot.run("intersection",j,I)},xor:function(j){for(var b=arguments.length,I=new Array(b>1?b-1:0),F=1;F<b;F++)I[F-1]=arguments[F];return ot.run("xor",j,I)},difference:function(j){for(var b=arguments.length,I=new Array(b>1?b-1:0),F=1;F<b;F++)I[F-1]=arguments[F];return ot.run("difference",j,I)}};return Wt})});var tO=X((ug,Q2)=>{(function(n,t){typeof ug=="object"&&typeof Q2!="undefined"?t(ug):typeof define=="function"&&define.amd?define(["exports"],t):t(n.jsts={})})(ug,function(n){"use strict";function t(){}function e(r){this.message=r||""}function i(r){this.message=r||""}function s(r){this.message=r||""}function u(){}function c(r){return r===null?Ae:r.color}function f(r){return r===null?null:r.parent}function p(r,o){r!==null&&(r.color=o)}function d(r){return r===null?null:r.left}function g(r){return r===null?null:r.right}function y(){this.root_=null,this.size_=0}function v(){}function E(){this.array_=[],arguments[0]instanceof tt&&this.addAll(arguments[0])}function M(){}function A(r){this.message=r||""}function _(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(r){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var o=Object(this),a=Math.max(Math.min(o.length,9007199254740991),0)||0,l=1 in arguments&&parseInt(Number(arguments[1]),10)||0;l=l<0?Math.max(a+l,0):Math.min(l,a);var h=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:a;for(h=h<0?Math.max(a+arguments[2],0):Math.min(h,a);l<h;)o[l]=r,++l;return o},writable:!0}),Number.isFinite=Number.isFinite||function(r){return typeof r=="number"&&isFinite(r)},Number.isInteger=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(r){return r!=r},Math.trunc=Math.trunc||function(r){return r<0?Math.ceil(r):Math.floor(r)};var x=function(){};x.prototype.interfaces_=function(){return[]},x.prototype.getClass=function(){return x},x.prototype.equalsWithTolerance=function(r,o,a){return Math.abs(r-o)<=a};var T=function(r){function o(a){r.call(this,a),this.name="IllegalArgumentException",this.message=a,this.stack=new r().stack}return r&&(o.__proto__=r),o.prototype=Object.create(r&&r.prototype),o.prototype.constructor=o,o}(Error),w=function(){},R={MAX_VALUE:{configurable:!0}};w.isNaN=function(r){return Number.isNaN(r)},w.doubleToLongBits=function(r){return r},w.longBitsToDouble=function(r){return r},w.isInfinite=function(r){return!Number.isFinite(r)},R.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(w,R);var z=function(){},U=function(){},D=function(){},P=function r(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=r.NULL_ORDINATE;else if(arguments.length===1){var o=arguments[0];this.x=o.x,this.y=o.y,this.z=o.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=r.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},ct={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};P.prototype.setOrdinate=function(r,o){switch(r){case P.X:this.x=o;break;case P.Y:this.y=o;break;case P.Z:this.z=o;break;default:throw new T("Invalid ordinate index: "+r)}},P.prototype.equals2D=function(){if(arguments.length===1){var r=arguments[0];return this.x===r.x&&this.y===r.y}if(arguments.length===2){var o=arguments[0],a=arguments[1];return!!x.equalsWithTolerance(this.x,o.x,a)&&!!x.equalsWithTolerance(this.y,o.y,a)}},P.prototype.getOrdinate=function(r){switch(r){case P.X:return this.x;case P.Y:return this.y;case P.Z:return this.z}throw new T("Invalid ordinate index: "+r)},P.prototype.equals3D=function(r){return this.x===r.x&&this.y===r.y&&(this.z===r.z||w.isNaN(this.z))&&w.isNaN(r.z)},P.prototype.equals=function(r){return r instanceof P&&this.equals2D(r)},P.prototype.equalInZ=function(r,o){return x.equalsWithTolerance(this.z,r.z,o)},P.prototype.compareTo=function(r){var o=r;return this.x<o.x?-1:this.x>o.x?1:this.y<o.y?-1:this.y>o.y?1:0},P.prototype.clone=function(){},P.prototype.copy=function(){return new P(this)},P.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},P.prototype.distance3D=function(r){var o=this.x-r.x,a=this.y-r.y,l=this.z-r.z;return Math.sqrt(o*o+a*a+l*l)},P.prototype.distance=function(r){var o=this.x-r.x,a=this.y-r.y;return Math.sqrt(o*o+a*a)},P.prototype.hashCode=function(){var r=17;return r=37*r+P.hashCode(this.x),r=37*r+P.hashCode(this.y)},P.prototype.setCoordinate=function(r){this.x=r.x,this.y=r.y,this.z=r.z},P.prototype.interfaces_=function(){return[z,U,t]},P.prototype.getClass=function(){return P},P.hashCode=function(){if(arguments.length===1){var r=arguments[0],o=w.doubleToLongBits(r);return Math.trunc((o^o)>>>32)}},ct.DimensionalComparator.get=function(){return L},ct.serialVersionUID.get=function(){return 6683108902428367e3},ct.NULL_ORDINATE.get=function(){return w.NaN},ct.X.get=function(){return 0},ct.Y.get=function(){return 1},ct.Z.get=function(){return 2},Object.defineProperties(P,ct);var L=function(r){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var o=arguments[0];if(o!==2&&o!==3)throw new T("only 2 or 3 dimensions may be specified");this._dimensionsToTest=o}}};L.prototype.compare=function(r,o){var a=r,l=o,h=L.compare(a.x,l.x);if(h!==0)return h;var m=L.compare(a.y,l.y);return m!==0?m:this._dimensionsToTest<=2?0:L.compare(a.z,l.z)},L.prototype.interfaces_=function(){return[D]},L.prototype.getClass=function(){return L},L.compare=function(r,o){return r<o?-1:r>o?1:w.isNaN(r)?w.isNaN(o)?0:-1:w.isNaN(o)?1:0};var W=function(){};W.prototype.create=function(){},W.prototype.interfaces_=function(){return[]},W.prototype.getClass=function(){return W};var V=function(){},Mt={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};V.prototype.interfaces_=function(){return[]},V.prototype.getClass=function(){return V},V.toLocationSymbol=function(r){switch(r){case V.EXTERIOR:return"e";case V.BOUNDARY:return"b";case V.INTERIOR:return"i";case V.NONE:return"-"}throw new T("Unknown location value: "+r)},Mt.INTERIOR.get=function(){return 0},Mt.BOUNDARY.get=function(){return 1},Mt.EXTERIOR.get=function(){return 2},Mt.NONE.get=function(){return-1},Object.defineProperties(V,Mt);var $=function(r,o){return r.interfaces_&&r.interfaces_().indexOf(o)>-1},gt=function(){},ft={LOG_10:{configurable:!0}};gt.prototype.interfaces_=function(){return[]},gt.prototype.getClass=function(){return gt},gt.log10=function(r){var o=Math.log(r);return w.isInfinite(o)||w.isNaN(o)?o:o/gt.LOG_10},gt.min=function(r,o,a,l){var h=r;return o<h&&(h=o),a<h&&(h=a),l<h&&(h=l),h},gt.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var r=arguments[0],o=arguments[1],a=arguments[2];return r<o?o:r>a?a:r}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var l=arguments[0],h=arguments[1],m=arguments[2];return l<h?h:l>m?m:l}},gt.wrap=function(r,o){return r<0?o- -r%o:r%o},gt.max=function(){if(arguments.length===3){var r=arguments[0],o=arguments[1],a=arguments[2],l=r;return o>l&&(l=o),a>l&&(l=a),l}if(arguments.length===4){var h=arguments[0],m=arguments[1],S=arguments[2],C=arguments[3],B=h;return m>B&&(B=m),S>B&&(B=S),C>B&&(B=C),B}},gt.average=function(r,o){return(r+o)/2},ft.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(gt,ft);var vt=function(r){this.str=r};vt.prototype.append=function(r){this.str+=r},vt.prototype.setCharAt=function(r,o){this.str=this.str.substr(0,r)+o+this.str.substr(r+1)},vt.prototype.toString=function(r){return this.str};var it=function(r){this.value=r};it.prototype.intValue=function(){return this.value},it.prototype.compareTo=function(r){return this.value<r?-1:this.value>r?1:0},it.isNaN=function(r){return Number.isNaN(r)};var lt=function(){};lt.isWhitespace=function(r){return r<=32&&r>=0||r===127},lt.toUpperCase=function(r){return r.toUpperCase()};var H=function r(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var o=arguments[0];this.init(o)}else if(arguments[0]instanceof r){var a=arguments[0];this.init(a)}else if(typeof arguments[0]=="string"){var l=arguments[0];r.call(this,r.parse(l))}}else if(arguments.length===2){var h=arguments[0],m=arguments[1];this.init(h,m)}},At={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};H.prototype.le=function(r){return(this._hi<r._hi||this._hi===r._hi)&&this._lo<=r._lo},H.prototype.extractSignificantDigits=function(r,o){var a=this.abs(),l=H.magnitude(a._hi),h=H.TEN.pow(l);(a=a.divide(h)).gt(H.TEN)?(a=a.divide(H.TEN),l+=1):a.lt(H.ONE)&&(a=a.multiply(H.TEN),l-=1);for(var m=l+1,S=new vt,C=H.MAX_PRINT_DIGITS-1,B=0;B<=C;B++){r&&B===m&&S.append(".");var K=Math.trunc(a._hi);if(K<0)break;var mt=!1,yt=0;K>9?(mt=!0,yt="9"):yt="0"+K,S.append(yt),a=a.subtract(H.valueOf(K)).multiply(H.TEN),mt&&a.selfAdd(H.TEN);var zt=!0,qt=H.magnitude(a._hi);if(qt<0&&Math.abs(qt)>=C-B&&(zt=!1),!zt)break}return o[0]=l,S.toString()},H.prototype.sqr=function(){return this.multiply(this)},H.prototype.doubleValue=function(){return this._hi+this._lo},H.prototype.subtract=function(){if(arguments[0]instanceof H){var r=arguments[0];return this.add(r.negate())}if(typeof arguments[0]=="number"){var o=arguments[0];return this.add(-o)}},H.prototype.equals=function(){if(arguments.length===1){var r=arguments[0];return this._hi===r._hi&&this._lo===r._lo}},H.prototype.isZero=function(){return this._hi===0&&this._lo===0},H.prototype.selfSubtract=function(){if(arguments[0]instanceof H){var r=arguments[0];return this.isNaN()?this:this.selfAdd(-r._hi,-r._lo)}if(typeof arguments[0]=="number"){var o=arguments[0];return this.isNaN()?this:this.selfAdd(-o,0)}},H.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},H.prototype.min=function(r){return this.le(r)?this:r},H.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof H){var r=arguments[0];return this.selfDivide(r._hi,r._lo)}if(typeof arguments[0]=="number"){var o=arguments[0];return this.selfDivide(o,0)}}else if(arguments.length===2){var a=arguments[0],l=arguments[1],h=null,m=null,S=null,C=null,B=null,K=null,mt=null,yt=null;return B=this._hi/a,K=H.SPLIT*B,h=K-B,yt=H.SPLIT*a,h=K-h,m=B-h,S=yt-a,mt=B*a,S=yt-S,C=a-S,yt=h*S-mt+h*C+m*S+m*C,K=(this._hi-mt-yt+this._lo-B*l)/a,yt=B+K,this._hi=yt,this._lo=B-yt+K,this}},H.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},H.prototype.divide=function(){if(arguments[0]instanceof H){var r=arguments[0],o=null,a=null,l=null,h=null,m=null,S=null,C=null,B=null;return a=(m=this._hi/r._hi)-(o=(S=H.SPLIT*m)-(o=S-m)),B=o*(l=(B=H.SPLIT*r._hi)-(l=B-r._hi))-(C=m*r._hi)+o*(h=r._hi-l)+a*l+a*h,S=(this._hi-C-B+this._lo-m*r._lo)/r._hi,new H(B=m+S,m-B+S)}if(typeof arguments[0]=="number"){var K=arguments[0];return w.isNaN(K)?H.createNaN():H.copy(this).selfDivide(K,0)}},H.prototype.ge=function(r){return(this._hi>r._hi||this._hi===r._hi)&&this._lo>=r._lo},H.prototype.pow=function(r){if(r===0)return H.valueOf(1);var o=new H(this),a=H.valueOf(1),l=Math.abs(r);if(l>1)for(;l>0;)l%2==1&&a.selfMultiply(o),(l/=2)>0&&(o=o.sqr());else a=o;return r<0?a.reciprocal():a},H.prototype.ceil=function(){if(this.isNaN())return H.NaN;var r=Math.ceil(this._hi),o=0;return r===this._hi&&(o=Math.ceil(this._lo)),new H(r,o)},H.prototype.compareTo=function(r){var o=r;return this._hi<o._hi?-1:this._hi>o._hi?1:this._lo<o._lo?-1:this._lo>o._lo?1:0},H.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},H.prototype.setValue=function(){if(arguments[0]instanceof H){var r=arguments[0];return this.init(r),this}if(typeof arguments[0]=="number"){var o=arguments[0];return this.init(o),this}},H.prototype.max=function(r){return this.ge(r)?this:r},H.prototype.sqrt=function(){if(this.isZero())return H.valueOf(0);if(this.isNegative())return H.NaN;var r=1/Math.sqrt(this._hi),o=this._hi*r,a=H.valueOf(o),l=this.subtract(a.sqr())._hi*(.5*r);return a.add(l)},H.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof H){var r=arguments[0];return this.selfAdd(r._hi,r._lo)}if(typeof arguments[0]=="number"){var o=arguments[0],a=null,l=null,h=null,m=null,S=null,C=null;return h=this._hi+o,S=h-this._hi,m=h-S,m=o-S+(this._hi-m),C=m+this._lo,a=h+C,l=C+(h-a),this._hi=a+l,this._lo=l+(a-this._hi),this}}else if(arguments.length===2){var B=arguments[0],K=arguments[1],mt=null,yt=null,zt=null,qt=null,Jt=null,ue=null,dn=null;qt=this._hi+B,yt=this._lo+K,Jt=qt-(ue=qt-this._hi),zt=yt-(dn=yt-this._lo);var Xn=(mt=qt+(ue=(Jt=B-ue+(this._hi-Jt))+yt))+(ue=(zt=K-dn+(this._lo-zt))+(ue+(qt-mt))),Dr=ue+(mt-Xn);return this._hi=Xn,this._lo=Dr,this}},H.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof H){var r=arguments[0];return this.selfMultiply(r._hi,r._lo)}if(typeof arguments[0]=="number"){var o=arguments[0];return this.selfMultiply(o,0)}}else if(arguments.length===2){var a=arguments[0],l=arguments[1],h=null,m=null,S=null,C=null,B=null,K=null;h=(B=H.SPLIT*this._hi)-this._hi,K=H.SPLIT*a,h=B-h,m=this._hi-h,S=K-a;var mt=(B=this._hi*a)+(K=h*(S=K-S)-B+h*(C=a-S)+m*S+m*C+(this._hi*l+this._lo*a)),yt=K+(h=B-mt);return this._hi=mt,this._lo=yt,this}},H.prototype.selfSqr=function(){return this.selfMultiply(this)},H.prototype.floor=function(){if(this.isNaN())return H.NaN;var r=Math.floor(this._hi),o=0;return r===this._hi&&(o=Math.floor(this._lo)),new H(r,o)},H.prototype.negate=function(){return this.isNaN()?this:new H(-this._hi,-this._lo)},H.prototype.clone=function(){},H.prototype.multiply=function(){if(arguments[0]instanceof H){var r=arguments[0];return r.isNaN()?H.createNaN():H.copy(this).selfMultiply(r)}if(typeof arguments[0]=="number"){var o=arguments[0];return w.isNaN(o)?H.createNaN():H.copy(this).selfMultiply(o,0)}},H.prototype.isNaN=function(){return w.isNaN(this._hi)},H.prototype.intValue=function(){return Math.trunc(this._hi)},H.prototype.toString=function(){var r=H.magnitude(this._hi);return r>=-3&&r<=20?this.toStandardNotation():this.toSciNotation()},H.prototype.toStandardNotation=function(){var r=this.getSpecialNumberString();if(r!==null)return r;var o=new Array(1).fill(null),a=this.extractSignificantDigits(!0,o),l=o[0]+1,h=a;if(a.charAt(0)===".")h="0"+a;else if(l<0)h="0."+H.stringOfChar("0",-l)+a;else if(a.indexOf(".")===-1){var m=l-a.length;h=a+H.stringOfChar("0",m)+".0"}return this.isNegative()?"-"+h:h},H.prototype.reciprocal=function(){var r=null,o=null,a=null,l=null,h=null,m=null,S=null,C=null;o=(h=1/this._hi)-(r=(m=H.SPLIT*h)-(r=m-h)),a=(C=H.SPLIT*this._hi)-this._hi;var B=h+(m=(1-(S=h*this._hi)-(C=r*(a=C-a)-S+r*(l=this._hi-a)+o*a+o*l)-h*this._lo)/this._hi);return new H(B,h-B+m)},H.prototype.toSciNotation=function(){if(this.isZero())return H.SCI_NOT_ZERO;var r=this.getSpecialNumberString();if(r!==null)return r;var o=new Array(1).fill(null),a=this.extractSignificantDigits(!1,o),l=H.SCI_NOT_EXPONENT_CHAR+o[0];if(a.charAt(0)==="0")throw new Error("Found leading zero: "+a);var h="";a.length>1&&(h=a.substring(1));var m=a.charAt(0)+"."+h;return this.isNegative()?"-"+m+l:m+l},H.prototype.abs=function(){return this.isNaN()?H.NaN:this.isNegative()?this.negate():new H(this)},H.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},H.prototype.lt=function(r){return(this._hi<r._hi||this._hi===r._hi)&&this._lo<r._lo},H.prototype.add=function(){if(arguments[0]instanceof H){var r=arguments[0];return H.copy(this).selfAdd(r)}if(typeof arguments[0]=="number"){var o=arguments[0];return H.copy(this).selfAdd(o)}},H.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var r=arguments[0];this._hi=r,this._lo=0}else if(arguments[0]instanceof H){var o=arguments[0];this._hi=o._hi,this._lo=o._lo}}else if(arguments.length===2){var a=arguments[0],l=arguments[1];this._hi=a,this._lo=l}},H.prototype.gt=function(r){return(this._hi>r._hi||this._hi===r._hi)&&this._lo>r._lo},H.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},H.prototype.trunc=function(){return this.isNaN()?H.NaN:this.isPositive()?this.floor():this.ceil()},H.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},H.prototype.interfaces_=function(){return[t,z,U]},H.prototype.getClass=function(){return H},H.sqr=function(r){return H.valueOf(r).selfMultiply(r)},H.valueOf=function(){if(typeof arguments[0]=="string"){var r=arguments[0];return H.parse(r)}if(typeof arguments[0]=="number"){var o=arguments[0];return new H(o)}},H.sqrt=function(r){return H.valueOf(r).sqrt()},H.parse=function(r){for(var o=0,a=r.length;lt.isWhitespace(r.charAt(o));)o++;var l=!1;if(o<a){var h=r.charAt(o);h!=="-"&&h!=="+"||(o++,h==="-"&&(l=!0))}for(var m=new H,S=0,C=0,B=0;!(o>=a);){var K=r.charAt(o);if(o++,lt.isDigit(K)){var mt=K-"0";m.selfMultiply(H.TEN),m.selfAdd(mt),S++}else{if(K!=="."){if(K==="e"||K==="E"){var yt=r.substring(o);try{B=it.parseInt(yt)}catch(dn){throw dn instanceof Error?new Error("Invalid exponent "+yt+" in string "+r):dn}break}throw new Error("Unexpected character '"+K+"' at position "+o+" in string "+r)}C=S}}var zt=m,qt=S-C-B;if(qt===0)zt=m;else if(qt>0){var Jt=H.TEN.pow(qt);zt=m.divide(Jt)}else if(qt<0){var ue=H.TEN.pow(-qt);zt=m.multiply(ue)}return l?zt.negate():zt},H.createNaN=function(){return new H(w.NaN,w.NaN)},H.copy=function(r){return new H(r)},H.magnitude=function(r){var o=Math.abs(r),a=Math.log(o)/Math.log(10),l=Math.trunc(Math.floor(a));return 10*Math.pow(10,l)<=o&&(l+=1),l},H.stringOfChar=function(r,o){for(var a=new vt,l=0;l<o;l++)a.append(r);return a.toString()},At.PI.get=function(){return new H(3.141592653589793,12246467991473532e-32)},At.TWO_PI.get=function(){return new H(6.283185307179586,24492935982947064e-32)},At.PI_2.get=function(){return new H(1.5707963267948966,6123233995736766e-32)},At.E.get=function(){return new H(2.718281828459045,14456468917292502e-32)},At.NaN.get=function(){return new H(w.NaN,w.NaN)},At.EPS.get=function(){return 123259516440783e-46},At.SPLIT.get=function(){return 134217729},At.MAX_PRINT_DIGITS.get=function(){return 32},At.TEN.get=function(){return H.valueOf(10)},At.ONE.get=function(){return H.valueOf(1)},At.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},At.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(H,At);var It=function(){},Kt={DP_SAFE_EPSILON:{configurable:!0}};It.prototype.interfaces_=function(){return[]},It.prototype.getClass=function(){return It},It.orientationIndex=function(r,o,a){var l=It.orientationIndexFilter(r,o,a);if(l<=1)return l;var h=H.valueOf(o.x).selfAdd(-r.x),m=H.valueOf(o.y).selfAdd(-r.y),S=H.valueOf(a.x).selfAdd(-o.x),C=H.valueOf(a.y).selfAdd(-o.y);return h.selfMultiply(C).selfSubtract(m.selfMultiply(S)).signum()},It.signOfDet2x2=function(r,o,a,l){return r.multiply(l).selfSubtract(o.multiply(a)).signum()},It.intersection=function(r,o,a,l){var h=H.valueOf(l.y).selfSubtract(a.y).selfMultiply(H.valueOf(o.x).selfSubtract(r.x)),m=H.valueOf(l.x).selfSubtract(a.x).selfMultiply(H.valueOf(o.y).selfSubtract(r.y)),S=h.subtract(m),C=H.valueOf(l.x).selfSubtract(a.x).selfMultiply(H.valueOf(r.y).selfSubtract(a.y)),B=H.valueOf(l.y).selfSubtract(a.y).selfMultiply(H.valueOf(r.x).selfSubtract(a.x)),K=C.subtract(B).selfDivide(S).doubleValue(),mt=H.valueOf(r.x).selfAdd(H.valueOf(o.x).selfSubtract(r.x).selfMultiply(K)).doubleValue(),yt=H.valueOf(o.x).selfSubtract(r.x).selfMultiply(H.valueOf(r.y).selfSubtract(a.y)),zt=H.valueOf(o.y).selfSubtract(r.y).selfMultiply(H.valueOf(r.x).selfSubtract(a.x)),qt=yt.subtract(zt).selfDivide(S).doubleValue(),Jt=H.valueOf(a.y).selfAdd(H.valueOf(l.y).selfSubtract(a.y).selfMultiply(qt)).doubleValue();return new P(mt,Jt)},It.orientationIndexFilter=function(r,o,a){var l=null,h=(r.x-a.x)*(o.y-a.y),m=(r.y-a.y)*(o.x-a.x),S=h-m;if(h>0){if(m<=0)return It.signum(S);l=h+m}else{if(!(h<0)||m>=0)return It.signum(S);l=-h-m}var C=It.DP_SAFE_EPSILON*l;return S>=C||-S>=C?It.signum(S):2},It.signum=function(r){return r>0?1:r<0?-1:0},Kt.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(It,Kt);var nt=function(){},bt={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};bt.X.get=function(){return 0},bt.Y.get=function(){return 1},bt.Z.get=function(){return 2},bt.M.get=function(){return 3},nt.prototype.setOrdinate=function(r,o,a){},nt.prototype.size=function(){},nt.prototype.getOrdinate=function(r,o){},nt.prototype.getCoordinate=function(){},nt.prototype.getCoordinateCopy=function(r){},nt.prototype.getDimension=function(){},nt.prototype.getX=function(r){},nt.prototype.clone=function(){},nt.prototype.expandEnvelope=function(r){},nt.prototype.copy=function(){},nt.prototype.getY=function(r){},nt.prototype.toCoordinateArray=function(){},nt.prototype.interfaces_=function(){return[U]},nt.prototype.getClass=function(){return nt},Object.defineProperties(nt,bt);var Vt=function(){},$t=function(r){function o(){r.call(this,"Projective point not representable on the Cartesian plane.")}return r&&(o.__proto__=r),o.prototype=Object.create(r&&r.prototype),o.prototype.constructor=o,o.prototype.interfaces_=function(){return[]},o.prototype.getClass=function(){return o},o}(Vt),Ut=function(){};Ut.arraycopy=function(r,o,a,l,h){for(var m=0,S=o;S<o+h;S++)a[l+m]=r[S],m++},Ut.getProperty=function(r){return{"line.separator":\`
@@ -16122,7 +16122,7 @@ void main() {
16122
16122
  top: 0;
16123
16123
  left: 0;
16124
16124
  z-index: 9999;
16125
- `,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 Xa(new ec({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,a=4,l=1,c=a+l;if(e.clearRect(0,0,n[0],n[1]),e.setLineDash([10,10]),e.strokeStyle="#fff",e.lineWidth=2,e.beginPath(),e.arc(i,o,o-c,-Math.PI/2,Math.PI*2-Math.PI/2,t<Math.PI),e.stroke(),e.strokeStyle="#0A7AFF",t<Math.PI){let p=-Math.PI/2,g=p-t;e.beginPath(),e.arc(i,o,o-c,p,g,!0)}else{let p=-Math.PI/2,g=p+Math.PI*2-t;e.beginPath(),e.arc(i,o,o-c,p,g,!1)}e.stroke(),e.clearRect(i-c*2,0,c*4,c*4),e.beginPath(),e.arc(i,c,a,0,Math.PI*2),e.fillStyle="#0A7AFF",e.fill(),e.setLineDash([10,0]),e.strokeStyle="#fff",e.lineWidth=l,e.stroke(),e.clearRect(0,o-5,10,10),e.clearRect(i-5,n[1]-10,10,10),e.clearRect(n[0]-10,o-5,10,10),t>Math.PI/2&&t<Math.PI?e.fillStyle="#0A7AFF":e.fillStyle="#fff",e.fillRect(0,o-1,10,2),e.fillStyle="#fff",e.fillRect(i-1,n[1]-10,2,10),t>Math.PI&&t<Math.PI/2*3?e.fillStyle="#0A7AFF":e.fillStyle="#fff",e.fillRect(n[0]-10,o-1,10,2)}getImageData(){let{ctx:t}=r,{config:{size:e}}=this;return t.getImageData(0,0,e[0],e[1])}getTexture(t){let{config:{size:e}}=this,n=new ko(Uint8Array.from(t.data),e[0],e[1],ti);return n.format=ti,n.magFilter=fn,n.minFilter=fn,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]}};_c.canvas=document.createElement("canvas");_c.ctx=_c.canvas.getContext("2d",{willReadFrequently:!0});_c.textureMap=new Map;var lMt={path:{},cheapMaximumDistance:20,needStartPoi:!1,startPoi:{},positionNavigation:{},offsetY:150,directionEmitThreshold:5,disablePathAnimation:!1,disablePathRotate:!1,disablePathShorten:!1,speed:1,roadData:[],runAnimationMaxTime:1,navigationCameraBasic:45,canBack:!1},$I=class extends ho{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(as.SWITCH_FLOOR_GROUND,this.onSwitchFloor),this.positionNavigation.addEventListener("navigation-info",this.onNavigationInfo),this.bmap.context.addEventListener("control-change",this.onControlChangeForStartPoi)}setRoadData(t){this.options.roadData=t,this.positionNavigation.setRoadData(t)}showStartRotateHelperPoi(){var t;if(this.needStartRotateHelperPoi=!0,!this.startPoi||this.startRotateHelperPoi)return;let e=this.startPoi.options.icon_size;this.startRotateHelperPoi=new _c(this.bmap,{size:[e[0]+20,e[1]+20]}),this.startRotateHelperPoi.setAngle(0),this.startRotateHelperPoi.position.setZ(.51),(t=this.bmap.context.currentFloor)==null||t.poiLayer2.pushPoi(this.startRotateHelperPoi)}hideStartRotateHelperPoi(){if(this.needStartRotateHelperPoi=!1,this.startRotateHelperPoi){var t;(t=this.bmap.context.currentFloor)==null||t.poiLayer2.removePoi(this.startRotateHelperPoi),this.startRotateHelperPoi=null}}setStartPoiPosition(t,e){this.startPoi&&(this.startPoi.position.setX(t).setY(e),this.startRotateHelperPoi&&this.startRotateHelperPoi.position.setX(t).setY(e),this.detachLine&&this.detachLine.setPosition(this.startPoi.position,this.detachStartPoi.position))}resetStatus(){this.pauseAnimation(),this.positionNavigation.resetStatus(this.paths),this.movedDistance=0,this.startPoi&&this.translatePath&&this.setStartPoiPosition(this.translatePath[0][0],this.translatePath[0][1])}toPositionByTask(t){var e;let i=(e=this.taskQueue.getTasks().find(a=>a.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(as.SWITCH_FLOOR_GROUND,this.onSwitchFloor),this.positionNavigation.removeEventListener("navigation-info",this.onNavigationInfo),this.bmap.context.removeEventListener("control-change",this.onControlChangeForStartPoi)}clearPath(){if(this.resetStatus(),this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose(),this.path=null,this.clearTween()),this.startPoi){var t;if((t=this.bmap.context.currentFloor)==null||t.poiLayer2.removePoi(this.startPoi),this.startPoi=null,this.startRotateHelperPoi){var e;(e=this.bmap.context.currentFloor)==null||e.poiLayer2.removePoi(this.startRotateHelperPoi),this.startRotateHelperPoi=null}}if(this.detachStartPoi){var n;(n=this.bmap.context.currentFloor)==null||n.removePoi2(this.detachStartPoi),this.detachStartPoi=null}this.detachLine&&(this.bmap.context.scene.remove(this.detachLine),this.detachLine.dispose(),this.detachLine=null),this.translatePath=null}setCurFloorPath(t){t===null?(this.curFloorPath=null,this.currentPathPosition=null,this.toPointPosition=null):(this.curFloorPath=t,this.currentPathPosition=t.points[0],this.toPointPosition=t.points[0]),this.movedDistance=0,this.clearTween()}setCurPathIndex(t){var e,n;this.curPathIndex=t,((e=this.paths[t])==null?void 0:e.floor)===((n=this.bmap.context.currentFloor)==null?void 0:n.name)?(this.setCurFloorPath(this.paths[t]),this.renderPath(this.translatePoints(this.curFloorPathPoints))):this.clearPath()}addPath(t,e){e===void 0&&(e=0);var n;this.paths=t,this.curPathIndex=e,this.clearTween(),this.clearPath();let 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 a=()=>{this.bmap.removeEventListener("center-change",a),this.renderPath(this.translatePoints(o.points))};this.bmap.addEventListener("center-change",a)}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 Y6(this,this.options.path),this.path.create(e),this.path.position.z=this.bmap.context.currentFloor.groundMaxHeight+.5,this.bmap.context.scene.add(this.path)),this.path.movePath(0),this.startPoi){var n;if((n=this.bmap.context.currentFloor)==null||n.poiLayer2.removePoi(this.startPoi),this.startPoi=null,this.startRotateHelperPoi){var i;(i=this.bmap.context.currentFloor)==null||i.poiLayer2.removePoi(this.startRotateHelperPoi),this.startRotateHelperPoi=null}}if(this.removeDetachStart(),this.showDetachStartState&&this.options.detachStartPoi){var o;this.detachStartPoi=new Di(this.bmap.context,Jt({},this.options.detachStartPoi,{id:"navigation_detach_start_poi",position:{x:e[0][0],y:e[0][1],z:.51},collision_enable:!1}))||null,(o=this.bmap.context.currentFloor)==null||o.poiLayer2.pushPoi(this.detachStartPoi),this.detachLine=new Sg(this.bmap.context,new G(e[0][0],e[0][1],.51),new G(e[0][0],e[0][1],.51)),this.bmap.context.scene.add(this.detachLine)}if(this.options.needStartPoi){var a;this.startPoi=new Di(this.bmap.context,Jt({},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 Ay(t,!1,!0,.1,170,2.5)}getPathDirection(){if(!this.curFloorPath||!this.currentPathPosition||this.curFloorPathPoints.length<2)return null;let t=Z0(this.curFloorPathPoints,this.currentPathPosition),e=this.curFloorPathPoints[t],n=this.curFloorPathPoints[t+1],i=new G(n[0]-e[0],n[1]-e[1],0).normalize(),o=new G(0,1,0).normalize(),a=i.angleTo(o),l=new G().crossVectors(o,i);return(Object.is(l.y,0)?-1:1)*a}getPathDirection2(){if(!this.curFloorPath||!this.toPointPosition||this.curFloorPathPoints.length<2)return null;let t=Z0(this.curFloorPathPoints,this.toPointPosition),e=this.curFloorPathPoints[t],n=this.curFloorPathPoints[t+1];return(new ft(n[0]-e[0],n[1]-e[1]).normalize().angle()*180/Math.PI-90+360)%360}changeCameraToPathUp(t){return St(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,a=t/Math.PI*6*i;return $a(new Promise(l=>{let c={azimuthal:o.getAzimuthalAngle()},p={azimuthal:e},g=o.getPolarAngle(),{maxPolarAngle:m,minPolarAngle:y}=o;o.maxPolarAngle=g,o.minPolarAngle=g;let x=new Ka(c,this.tweenUtil.group).to(p,a).easing(of.Quadratic.InOut).onUpdate(()=>St(this,null,function*(){this.startPoi&&o.target.copy(this.startPoi.position),o.setAzimuthalAngle(c.azimuthal,!0),o.setTargetByOffset(this.options.offsetY)})).onComplete(()=>{o.enabled=!0,this.tweenUtil.remove(x),o.maxPolarAngle=m,o.minPolarAngle=y,l(!0)}).onStart(()=>{o.enabled=!1}).start()}),a+500).finally(()=>{this.bmap.context.control.enabled=!0})})}initNavigationCamera(t){return St(this,null,function*(){t===void 0&&(t=1e3);var e;let i=(e=this.taskQueue.getTasks().find(a=>a.meta.type==="initNavigationCamera"))==null?void 0:e.tid,o={run:()=>$a(St(this,null,function*(){yield this.initCameraZoom(t/2),this.options.disablePathRotate||(yield this.changeCameraToPathUp(t/4)),yield this.translateCameraToStartPoi(t/(this.options.disablePathRotate?2:4))}),t+500).finally(()=>{this.bmap.context.control.enabled=!0}),meta:{type:"initNavigationCamera"}};i?this.taskQueue.replace(i,o):this.taskQueue.add(o)})}translateCameraToStartPoi(t){return St(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,a=Math.round(e/2),l=Math.round(n/2),c=o.target.clone(),p=bn(this.startPoi.position,i,e,n),g=p.x-a,m=l-p.y+this.options.offsetY;if(!(Math.abs(g)<=1&&Math.abs(m)<=1)){if(Math.abs(g)>=1){let y=new G;y.setFromMatrixColumn(i.matrix,0),y.normalize(),y.multiplyScalar(g/i.zoom),c.add(new G(y.x,y.y,0))}if(Math.abs(m)>=1){let y=new G;y.setFromMatrixColumn(i.matrix,1),y.normalize(),y.multiplyScalar(m/i.zoom),c.add(new G(y.x,y.y,0))}return $a(new Promise(y=>{let x=o.target.clone();console.log(x,c,t);let S=new Ka(x,this.tweenUtil.group).to(c,t).onUpdate(()=>{this.bmap.context.control.setCameraPositionByTarget(x,0)}).onComplete(()=>{this.bmap.context.control.setCameraPositionByTarget(c,0),this.tweenUtil.remove(S),this.bmap.context.control.enabled=!0,y(!0)}).onStart(()=>{this.bmap.context.control.enabled=!1}).start()}),t+500).then(()=>{this.bmap.context.control.enabled=!0})}})}initCameraZoom(t){return St(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:a}=i.box,c=Math.min(e/(o.x-a.x),n/(o.y-a.y))*(o.x-a.x)/this.options.navigationCameraBasic;return this.bmap.context.setZoom(c,this.startPoi.position,t).finally(()=>{this.bmap.context.control.enabled=!0})})}toPosition(t,e){if(this.paths[this.curPathIndex]&&this.paths[this.curPathIndex].floor===t&&this.detachStartPoi){let n=this.translatePoints([e]);this.detachStartPoi.position.setX(n[0][0]),this.detachStartPoi.position.setY(n[0][1]),this.detachLine&&this.startPoi&&this.detachLine.setPosition(this.startPoi.position,this.detachStartPoi.position)}this.options.canBack&&(this.positionNavigation.pointIndex=0,this.positionNavigation.position=this.paths[this.curPathIndex].points[0]),this.positionNavigation.toPosition(t,e)}startSimulation(){this.positionNavigation.startSimulation()}setSimulationSpeed(t){this.positionNavigation.changeSimulationSpeed(t)}toPositionBySpeed(t,e){return St(this,null,function*(){let{currentPathPosition:n,curFloorPath:i,curFloorPathPoints:o}=this;if(!i||!n)return null;let a=this.movedDistance,l=XT(o,t);if(a===-1||l===-1||!this.options.canBack&&l<=a)return null;let c=l-a;if(!c)return;let p=Math.min(Math.abs(c)/e,this.options.runAnimationMaxTime);return this.pathTween&&this.clearTween(),$a(new Promise(g=>{let m=this.pathTween=new Ka({distance:0},this.tweenUtil.group).to({distance:c},p*1e3).onUpdate(y=>St(this,null,function*(){this.moveDistance(y.distance+a,m)})).onComplete(()=>{this.tweenUtil.remove(m),g(!0)}).start()}),p*1e3+500).finally(()=>{this.bmap.context.control.enabled=!0})})}moveDistance(t,e){return St(this,null,function*(){if(this.movedDistance=t,!this.options.disablePathShorten){var n;(n=this.path)==null||n.movePath(this.movedDistance/this.curFloorPathLength)}let i=nf(this.curFloorPathPoints,this.movedDistance);if(i===null)return;this.currentPathPosition=i;let o=this.translatePoints([i])[0];this.startPoi&&(this.setStartPoiPosition(o[0],o[1]),this.options.disablePathAnimation||this.bmap.context.control.setTargetByOffset(this.options.offsetY,this.startPoi.position.clone())),!this.options.disablePathAnimation&&!this.options.disablePathRotate&&(e==null||e.pause(),yield this.changeCameraToPathUp(500/this.options.speed),e==null||e.resume())})}removeDetachStart(){if(this.detachLine&&(this.bmap.context.scene.remove(this.detachLine),this.detachLine.dispose(),this.detachLine=null),this.detachStartPoi){var t;(t=this.bmap.context.currentFloor)==null||t.poiLayer2.removePoi(this.detachStartPoi),this.detachStartPoi=null}}hideDetachStart(){this.showDetachStartState=!1,this.removeDetachStart()}showDetachStart(){if(!this.detachStartPoi&&(this.showDetachStartState=!0,this.path&&this.startPoi&&this.options.detachStartPoi)){var t;let e=this.startPoi.position;this.detachStartPoi=new Di(this.bmap.context,Jt({},this.options.detachStartPoi,{id:"navigation_detach_start_poi",position:e,collision_enable:!1}))||null,(t=this.bmap.context.currentFloor)==null||t.poiLayer2.pushPoi(this.detachStartPoi),this.detachLine=new Sg(this.bmap.context,new G(e.x,e.y,.51),new G(e.x,e.y,.51)),this.bmap.context.scene.add(this.detachLine)}}setStartPoiRotate(t){this.startPoiRotate=t;let n=(this.bmap.context.control.getAzimuthalAngle()*180/Math.PI+360)%360,i=(360-t-n)%360;this.detachStartPoi&&(this.detachStartPoi.options.icon_rotate=i),this.startPoi&&(this.startPoi.options.icon_rotate=i,this.startRotateHelperPoi&&this.startRotateHelperPoi.setAngle(i))}dispose(){var t;if(this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose()),this.hideDetachStart(),this.startPoi){var e;(e=this.bmap.context.currentFloor)==null||e.poiLayer2.removePoi(this.startPoi),this.startPoi=null}this.tweenUtil.dispose(),this.unRegistryEvent(),(t=this.startRotateHelperPoi)==null||t.dispose(),_c.dispose(),this.positionNavigation.dispose(),this.startRotateHelperPoi=null,super.dispose()}constructor(t,e={},n){super(t),this.path=null,this.fetchRoadStatus=!1,this.paths=[],this.curPathIndex=0,this.curFloorPath=null,this.translatePath=null,this.currentPathPosition=null,this.toPointPosition=null,this.pathTween=null,this.startPoi=null,this.detachStartPoi=null,this.detachLine=null,this.startPoiRotate=null,this.startRotateHelperPoi=null,this.needStartRotateHelperPoi=!1,this.showDetachStartState=!0,this.movedDistance=0,this.pathStart=[0,0],this.tweenUtil=new lc,this.taskQueue=new sf,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 a=this.paths[this.curPathIndex];this.setCurFloorPath(a!=null?a:null),a?this.renderPath(this.translatePoints(a.points)):this.clearPath()}else this.clearPath()},this.onControlChangeForStartPoi=()=>{this.startPoi&&this.startPoiRotate!==null&&this.setStartPoiRotate(this.startPoiRotate)},!n&&typeof e=="object"&&(n=e),this.options=Object.assign({},lMt,n),this.positionNavigation=new Z6(this,Jt({simulationSpeed:this.options.speed},this.options.positionNavigation),this.options.roadData),this.registryEvent()}};var Uue=V(De(),1);var KI=class extends ho{show(t,e){let n=0;t.forEach(a=>{a.onAddToScene("mulFloors"),a.position.z=n,n+=a.userData.height,a.poiLayer2.pois.forEach(l=>{l.options.depth_test=!0})});let{scene:i,currentFloor:o}=this.bmap.context;i.background=new ne((e==null?void 0:e.backgroundColor)||"#f1f7f6"),o&&(i.remove(o),o.dispose()),this.group.add(...t),i.add(this.group),this.floors=t,this.fitCamera(),this.bmap.context.cameraBound.updateBox(),this.showStatus=!0,this.bmap.context.forceUpdate()}showStep(t,e){return this.show(t,e)}hide(){let{scene:t}=this.bmap.context;t.remove(this.group),this.floors.forEach(e=>{e.onRemoveFromScene(),e.dispose()}),this.floors=[],this.group.clear(),this.showStatus=!1}showByNotDispose(t,e,n){n===void 0&&(n=()=>!0);let i=0;t.forEach(l=>{[...l.poiLayer2.pois].forEach(c=>{if(!n(c)){c.visible=!1;return}c.options.depth_test=!0}),l.position.z=i,i+=l.userData.height,l.onAddToScene("mulFloors")});let{scene:o,currentFloor:a}=this.bmap.context;o.background=new ne((e==null?void 0:e.backgroundColor)||"#f1f7f6"),a&&o.remove(a),this.group.add(...t),o.add(this.group),this.floors=t,this.fitCamera(),this.bmap.context.cameraBound.updateBox(),this.showStatus=!0,this.bmap.context.forceUpdate()}hideByNotDispose(){let{scene:t}=this.bmap.context;t.remove(this.group),this.floors.forEach(e=>{e.poiLayer2.pois.forEach(n=>{n.visible=!0,n.options.depth_test=!1})}),this.floors.forEach(e=>{e.position.z=0,e.onRemoveFromScene()}),this.group.clear(),this.showStatus=!1}fitCamera(){let{context:t,config:e}=this.bmap;t.cameraBound.setEnable(!1),t.control.minZoom=0,t.control.maxZoom=1/0,t.camera.zoom=1,t.setAzimuthalAngle(e.control.defaultAzimuthal,0),t.setPolarAngle(e.control.defaultPolar,0),t.fitCameraToObject(this.group,e.defaultPadding,0,!1);let n=t.camera.zoom;t.control.minZoom=n,t.control.maxZoom=n*e.control.maxZoomScale,this.bmap.basicZoom=t.camera.zoom,t.control.addEventListener("change",this.bmap.onControlChange),this.bmap.onControlChange(),t.cameraBound.setEnable(!0)}dispose(){this.floors.forEach(t=>t.dispose()),this.floors=[],super.dispose()}constructor(t){super(t),this.floors=[],this.group=new uo,this.showStatus=!1,this.group.name="mul-floor-group"}};function JI(){let r=new Blob([`var RU=Object.create;var xE=Object.defineProperty;var LU=Object.getOwnPropertyDescriptor;var NU=Object.getOwnPropertyNames;var OU=Object.getPrototypeOf,DU=Object.prototype.hasOwnProperty;var ot=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var FU=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of NU(t))!DU.call(n,s)&&s!==e&&xE(n,s,{get:()=>t[s],enumerable:!(o=LU(t,s))||o.enumerable});return n};var Je=(n,t,e)=>(e=n!=null?RU(OU(n)):{},FU(t||!n||!n.__esModule?xE(e,"default",{value:n,enumerable:!0}):e,n));var pp=(n,t,e)=>new Promise((o,s)=>{var l=g=>{try{h(e.next(g))}catch(m){s(m)}},p=g=>{try{h(e.throw(g))}catch(m){s(m)}},h=g=>g.done?o(g.value):Promise.resolve(g.value).then(l,p);h((e=e.apply(n,t)).next())});var so=ot((Wm,EE)=>{"use strict";var Uf=function(n){return n&&n.Math===Math&&n};EE.exports=Uf(typeof globalThis=="object"&&globalThis)||Uf(typeof window=="object"&&window)||Uf(typeof self=="object"&&self)||Uf(typeof global=="object"&&global)||Uf(typeof Wm=="object"&&Wm)||function(){return this}()||Function("return this")()});var SE=ot((sj,wE)=>{"use strict";wE.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}});var Ui=ot((aj,ME)=>{"use strict";var Xm=typeof document=="object"&&document.all;ME.exports=typeof Xm=="undefined"&&Xm!==void 0?function(n){return typeof n=="function"||n===Xm}:function(n){return typeof n=="function"}});var Ys=ot((uj,bE)=>{"use strict";var UU=Ui();bE.exports=function(n){return typeof n=="object"?n!==null:UU(n)}});var dp=ot((lj,TE)=>{"use strict";var BU=so(),AE=Ys(),Ym=BU.document,zU=AE(Ym)&&AE(Ym.createElement);TE.exports=function(n){return zU?Ym.createElement(n):{}}});var IE=ot((cj,PE)=>{"use strict";var GU=dp(),$m=GU("span").classList,CE=$m&&$m.constructor&&$m.constructor.prototype;PE.exports=CE===Object.prototype?void 0:CE});var mi=ot((fj,RE)=>{"use strict";RE.exports=function(n){try{return!!n()}catch(t){return!0}}});var Bf=ot((hj,LE)=>{"use strict";var kU=mi();LE.exports=!kU(function(){var n=function(){}.bind();return typeof n!="function"||n.hasOwnProperty("prototype")})});var yi=ot((pj,DE)=>{"use strict";var NE=Bf(),OE=Function.prototype,Zm=OE.call,qU=NE&&OE.bind.bind(Zm,Zm);DE.exports=NE?qU:function(n){return function(){return Zm.apply(n,arguments)}}});var ac=ot((dj,UE)=>{"use strict";var FE=yi(),HU=FE({}.toString),VU=FE("".slice);UE.exports=function(n){return VU(HU(n),8,-1)}});var zE=ot((gj,BE)=>{"use strict";var WU=yi(),XU=mi(),YU=ac(),Jm=Object,$U=WU("".split);BE.exports=XU(function(){return!Jm("z").propertyIsEnumerable(0)})?function(n){return YU(n)==="String"?$U(n,""):Jm(n)}:Jm});var Km=ot((mj,GE)=>{"use strict";GE.exports=function(n){return n==null}});var uc=ot((yj,kE)=>{"use strict";var ZU=Km(),JU=TypeError;kE.exports=function(n){if(ZU(n))throw new JU("Can't call method on "+n);return n}});var lc=ot((vj,qE)=>{"use strict";var KU=zE(),jU=uc();qE.exports=function(n){return KU(jU(n))}});var zf=ot((_j,HE)=>{"use strict";HE.exports=!1});var gp=ot((xj,WE)=>{"use strict";var VE=so(),QU=Object.defineProperty;WE.exports=function(n,t){try{QU(VE,n,{value:t,configurable:!0,writable:!0})}catch(e){VE[n]=t}return t}});var mp=ot((Ej,$E)=>{"use strict";var tB=zf(),eB=so(),nB=gp(),XE="__core-js_shared__",YE=$E.exports=eB[XE]||nB(XE,{});(YE.versions||(YE.versions=[])).push({version:"3.42.0",mode:tB?"pure":"global",copyright:"\\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var yp=ot((wj,JE)=>{"use strict";var ZE=mp();JE.exports=function(n,t){return ZE[n]||(ZE[n]=t||{})}});var cc=ot((Sj,KE)=>{"use strict";var rB=uc(),iB=Object;KE.exports=function(n){return iB(rB(n))}});var Ma=ot((Mj,jE)=>{"use strict";var oB=yi(),sB=cc(),aB=oB({}.hasOwnProperty);jE.exports=Object.hasOwn||function(t,e){return aB(sB(t),e)}});var jm=ot((bj,QE)=>{"use strict";var uB=yi(),lB=0,cB=Math.random(),fB=uB(1 .toString);QE.exports=function(n){return"Symbol("+(n===void 0?"":n)+")_"+fB(++lB+cB,36)}});var rw=ot((Aj,nw)=>{"use strict";var hB=so(),tw=hB.navigator,ew=tw&&tw.userAgent;nw.exports=ew?String(ew):""});var cw=ot((Tj,lw)=>{"use strict";var uw=so(),Qm=rw(),iw=uw.process,ow=uw.Deno,sw=iw&&iw.versions||ow&&ow.version,aw=sw&&sw.v8,$s,vp;aw&&($s=aw.split("."),vp=$s[0]>0&&$s[0]<4?1:+($s[0]+$s[1]));!vp&&Qm&&($s=Qm.match(/Edge\\/(\\d+)/),(!$s||$s[1]>=74)&&($s=Qm.match(/Chrome\\/(\\d+)/),$s&&(vp=+$s[1])));lw.exports=vp});var t0=ot((Cj,hw)=>{"use strict";var fw=cw(),pB=mi(),dB=so(),gB=dB.String;hw.exports=!!Object.getOwnPropertySymbols&&!pB(function(){var n=Symbol("symbol detection");return!gB(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&fw&&fw<41})});var e0=ot((Pj,pw)=>{"use strict";var mB=t0();pw.exports=mB&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Ns=ot((Ij,gw)=>{"use strict";var yB=so(),vB=yp(),dw=Ma(),_B=jm(),xB=t0(),EB=e0(),fc=yB.Symbol,n0=vB("wks"),wB=EB?fc.for||fc:fc&&fc.withoutSetter||_B;gw.exports=function(n){return dw(n0,n)||(n0[n]=xB&&dw(fc,n)?fc[n]:wB("Symbol."+n)),n0[n]}});var ba=ot((Rj,mw)=>{"use strict";var SB=Ys(),MB=String,bB=TypeError;mw.exports=function(n){if(SB(n))return n;throw new bB(MB(n)+" is not an object")}});var Zs=ot((Lj,yw)=>{"use strict";var AB=mi();yw.exports=!AB(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var r0=ot((Nj,vw)=>{"use strict";var TB=Zs(),CB=mi();vw.exports=TB&&CB(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var i0=ot((Oj,_w)=>{"use strict";var PB=Zs(),IB=mi(),RB=dp();_w.exports=!PB&&!IB(function(){return Object.defineProperty(RB("div"),"a",{get:function(){return 7}}).a!==7})});var Os=ot((Dj,xw)=>{"use strict";var LB=Bf(),_p=Function.prototype.call;xw.exports=LB?_p.bind(_p):function(){return _p.apply(_p,arguments)}});var hc=ot((Fj,Ew)=>{"use strict";var o0=so(),NB=Ui(),OB=function(n){return NB(n)?n:void 0};Ew.exports=function(n,t){return arguments.length<2?OB(o0[n]):o0[n]&&o0[n][t]}});var Sw=ot((Uj,ww)=>{"use strict";var DB=yi();ww.exports=DB({}.isPrototypeOf)});var s0=ot((Bj,Mw)=>{"use strict";var FB=hc(),UB=Ui(),BB=Sw(),zB=e0(),GB=Object;Mw.exports=zB?function(n){return typeof n=="symbol"}:function(n){var t=FB("Symbol");return UB(t)&&BB(t.prototype,GB(n))}});var Aw=ot((zj,bw)=>{"use strict";var kB=String;bw.exports=function(n){try{return kB(n)}catch(t){return"Object"}}});var Gf=ot((Gj,Tw)=>{"use strict";var qB=Ui(),HB=Aw(),VB=TypeError;Tw.exports=function(n){if(qB(n))return n;throw new VB(HB(n)+" is not a function")}});var xp=ot((kj,Cw)=>{"use strict";var WB=Gf(),XB=Km();Cw.exports=function(n,t){var e=n[t];return XB(e)?void 0:WB(e)}});var Iw=ot((qj,Pw)=>{"use strict";var a0=Os(),u0=Ui(),l0=Ys(),YB=TypeError;Pw.exports=function(n,t){var e,o;if(t==="string"&&u0(e=n.toString)&&!l0(o=a0(e,n))||u0(e=n.valueOf)&&!l0(o=a0(e,n))||t!=="string"&&u0(e=n.toString)&&!l0(o=a0(e,n)))return o;throw new YB("Can't convert object to primitive value")}});var Ow=ot((Hj,Nw)=>{"use strict";var $B=Os(),Rw=Ys(),Lw=s0(),ZB=xp(),JB=Iw(),KB=Ns(),jB=TypeError,QB=KB("toPrimitive");Nw.exports=function(n,t){if(!Rw(n)||Lw(n))return n;var e=ZB(n,QB),o;if(e){if(t===void 0&&(t="default"),o=$B(e,n,t),!Rw(o)||Lw(o))return o;throw new jB("Can't convert object to primitive value")}return t===void 0&&(t="number"),JB(n,t)}});var c0=ot((Vj,Dw)=>{"use strict";var tz=Ow(),ez=s0();Dw.exports=function(n){var t=tz(n,"string");return ez(t)?t:t+""}});var Lu=ot(Uw=>{"use strict";var nz=Zs(),rz=i0(),iz=r0(),Ep=ba(),Fw=c0(),oz=TypeError,f0=Object.defineProperty,sz=Object.getOwnPropertyDescriptor,h0="enumerable",p0="configurable",d0="writable";Uw.f=nz?iz?function(t,e,o){if(Ep(t),e=Fw(e),Ep(o),typeof t=="function"&&e==="prototype"&&"value"in o&&d0 in o&&!o[d0]){var s=sz(t,e);s&&s[d0]&&(t[e]=o.value,o={configurable:p0 in o?o[p0]:s[p0],enumerable:h0 in o?o[h0]:s[h0],writable:!1})}return f0(t,e,o)}:f0:function(t,e,o){if(Ep(t),e=Fw(e),Ep(o),rz)try{return f0(t,e,o)}catch(s){}if("get"in o||"set"in o)throw new oz("Accessors not supported");return"value"in o&&(t[e]=o.value),t}});var zw=ot((Xj,Bw)=>{"use strict";var az=Math.ceil,uz=Math.floor;Bw.exports=Math.trunc||function(t){var e=+t;return(e>0?uz:az)(e)}});var El=ot((Yj,Gw)=>{"use strict";var lz=zw();Gw.exports=function(n){var t=+n;return t!==t||t===0?0:lz(t)}});var qw=ot(($j,kw)=>{"use strict";var cz=El(),fz=Math.max,hz=Math.min;kw.exports=function(n,t){var e=cz(n);return e<0?fz(e+t,0):hz(e,t)}});var g0=ot((Zj,Hw)=>{"use strict";var pz=El(),dz=Math.min;Hw.exports=function(n){var t=pz(n);return t>0?dz(t,9007199254740991):0}});var kf=ot((Jj,Vw)=>{"use strict";var gz=g0();Vw.exports=function(n){return gz(n.length)}});var Yw=ot((Kj,Xw)=>{"use strict";var mz=lc(),yz=qw(),vz=kf(),Ww=function(n){return function(t,e,o){var s=mz(t),l=vz(s);if(l===0)return!n&&-1;var p=yz(o,l),h;if(n&&e!==e){for(;l>p;)if(h=s[p++],h!==h)return!0}else for(;l>p;p++)if((n||p in s)&&s[p]===e)return n||p||0;return!n&&-1}};Xw.exports={includes:Ww(!0),indexOf:Ww(!1)}});var wp=ot((jj,$w)=>{"use strict";$w.exports={}});var y0=ot((Qj,Jw)=>{"use strict";var _z=yi(),m0=Ma(),xz=lc(),Ez=Yw().indexOf,wz=wp(),Zw=_z([].push);Jw.exports=function(n,t){var e=xz(n),o=0,s=[],l;for(l in e)!m0(wz,l)&&m0(e,l)&&Zw(s,l);for(;t.length>o;)m0(e,l=t[o++])&&(~Ez(s,l)||Zw(s,l));return s}});var Sp=ot((tQ,Kw)=>{"use strict";Kw.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Qw=ot((eQ,jw)=>{"use strict";var Sz=y0(),Mz=Sp();jw.exports=Object.keys||function(t){return Sz(t,Mz)}});var eS=ot(tS=>{"use strict";var bz=Zs(),Az=r0(),Tz=Lu(),Cz=ba(),Pz=lc(),Iz=Qw();tS.f=bz&&!Az?Object.defineProperties:function(t,e){Cz(t);for(var o=Pz(e),s=Iz(e),l=s.length,p=0,h;l>p;)Tz.f(t,h=s[p++],o[h]);return t}});var rS=ot((rQ,nS)=>{"use strict";var Rz=hc();nS.exports=Rz("document","documentElement")});var Mp=ot((iQ,oS)=>{"use strict";var Lz=yp(),Nz=jm(),iS=Lz("keys");oS.exports=function(n){return iS[n]||(iS[n]=Nz(n))}});var qf=ot((oQ,hS)=>{"use strict";var Oz=ba(),Dz=eS(),sS=Sp(),Fz=wp(),Uz=rS(),Bz=dp(),zz=Mp(),aS=">",uS="<",_0="prototype",x0="script",cS=zz("IE_PROTO"),v0=function(){},fS=function(n){return uS+x0+aS+n+uS+"/"+x0+aS},lS=function(n){n.write(fS("")),n.close();var t=n.parentWindow.Object;return n=null,t},Gz=function(){var n=Bz("iframe"),t="java"+x0+":",e;return n.style.display="none",Uz.appendChild(n),n.src=String(t),e=n.contentWindow.document,e.open(),e.write(fS("document.F=Object")),e.close(),e.F},bp,Ap=function(){try{bp=new ActiveXObject("htmlfile")}catch(t){}Ap=typeof document!="undefined"?document.domain&&bp?lS(bp):Gz():lS(bp);for(var n=sS.length;n--;)delete Ap[_0][sS[n]];return Ap()};Fz[cS]=!0;hS.exports=Object.create||function(t,e){var o;return t!==null?(v0[_0]=Oz(t),o=new v0,v0[_0]=null,o[cS]=t):o=Ap(),e===void 0?o:Dz.f(o,e)}});var S0=ot((sQ,pS)=>{"use strict";var kz=Ns(),qz=qf(),Hz=Lu().f,E0=kz("unscopables"),w0=Array.prototype;w0[E0]===void 0&&Hz(w0,E0,{configurable:!0,value:qz(null)});pS.exports=function(n){w0[E0][n]=!0}});var Tp=ot((aQ,dS)=>{"use strict";dS.exports={}});var yS=ot((uQ,mS)=>{"use strict";var Vz=so(),Wz=Ui(),gS=Vz.WeakMap;mS.exports=Wz(gS)&&/native code/.test(String(gS))});var Cp=ot((lQ,vS)=>{"use strict";vS.exports=function(n,t){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:t}}});var pc=ot((cQ,_S)=>{"use strict";var Xz=Zs(),Yz=Lu(),$z=Cp();_S.exports=Xz?function(n,t,e){return Yz.f(n,t,$z(1,e))}:function(n,t,e){return n[t]=e,n}});var Rp=ot((fQ,wS)=>{"use strict";var Zz=yS(),ES=so(),Jz=Ys(),Kz=pc(),M0=Ma(),b0=mp(),jz=Mp(),Qz=wp(),xS="Object already initialized",A0=ES.TypeError,tG=ES.WeakMap,Pp,Hf,Ip,eG=function(n){return Ip(n)?Hf(n):Pp(n,{})},nG=function(n){return function(t){var e;if(!Jz(t)||(e=Hf(t)).type!==n)throw new A0("Incompatible receiver, "+n+" required");return e}};Zz||b0.state?(Js=b0.state||(b0.state=new tG),Js.get=Js.get,Js.has=Js.has,Js.set=Js.set,Pp=function(n,t){if(Js.has(n))throw new A0(xS);return t.facade=n,Js.set(n,t),t},Hf=function(n){return Js.get(n)||{}},Ip=function(n){return Js.has(n)}):(wl=jz("state"),Qz[wl]=!0,Pp=function(n,t){if(M0(n,wl))throw new A0(xS);return t.facade=n,Kz(n,wl,t),t},Hf=function(n){return M0(n,wl)?n[wl]:{}},Ip=function(n){return M0(n,wl)});var Js,wl;wS.exports={set:Pp,get:Hf,has:Ip,enforce:eG,getterFor:nG}});var AS=ot(bS=>{"use strict";var SS={}.propertyIsEnumerable,MS=Object.getOwnPropertyDescriptor,rG=MS&&!SS.call({1:2},1);bS.f=rG?function(t){var e=MS(this,t);return!!e&&e.enumerable}:SS});var T0=ot(CS=>{"use strict";var iG=Zs(),oG=Os(),sG=AS(),aG=Cp(),uG=lc(),lG=c0(),cG=Ma(),fG=i0(),TS=Object.getOwnPropertyDescriptor;CS.f=iG?TS:function(t,e){if(t=uG(t),e=lG(e),fG)try{return TS(t,e)}catch(o){}if(cG(t,e))return aG(!oG(sG.f,t,e),t[e])}});var I0=ot((dQ,IS)=>{"use strict";var C0=Zs(),hG=Ma(),PS=Function.prototype,pG=C0&&Object.getOwnPropertyDescriptor,P0=hG(PS,"name"),dG=P0&&function(){}.name==="something",gG=P0&&(!C0||C0&&pG(PS,"name").configurable);IS.exports={EXISTS:P0,PROPER:dG,CONFIGURABLE:gG}});var L0=ot((gQ,RS)=>{"use strict";var mG=yi(),yG=Ui(),R0=mp(),vG=mG(Function.toString);yG(R0.inspectSource)||(R0.inspectSource=function(n){return vG(n)});RS.exports=R0.inspectSource});var DS=ot((mQ,OS)=>{"use strict";var O0=yi(),_G=mi(),xG=Ui(),Lp=Ma(),N0=Zs(),EG=I0().CONFIGURABLE,wG=L0(),NS=Rp(),SG=NS.enforce,MG=NS.get,LS=String,Np=Object.defineProperty,bG=O0("".slice),AG=O0("".replace),TG=O0([].join),CG=N0&&!_G(function(){return Np(function(){},"length",{value:8}).length!==8}),PG=String(String).split("String"),IG=OS.exports=function(n,t,e){bG(LS(t),0,7)==="Symbol("&&(t="["+AG(LS(t),/^Symbol\\(([^)]*)\\).*$/,"$1")+"]"),e&&e.getter&&(t="get "+t),e&&e.setter&&(t="set "+t),(!Lp(n,"name")||EG&&n.name!==t)&&(N0?Np(n,"name",{value:t,configurable:!0}):n.name=t),CG&&e&&Lp(e,"arity")&&n.length!==e.arity&&Np(n,"length",{value:e.arity});try{e&&Lp(e,"constructor")&&e.constructor?N0&&Np(n,"prototype",{writable:!1}):n.prototype&&(n.prototype=void 0)}catch(s){}var o=SG(n);return Lp(o,"source")||(o.source=TG(PG,typeof t=="string"?t:"")),n};Function.prototype.toString=IG(function(){return xG(this)&&MG(this).source||wG(this)},"toString")});var Vf=ot((yQ,FS)=>{"use strict";var RG=Ui(),LG=Lu(),NG=DS(),OG=gp();FS.exports=function(n,t,e,o){o||(o={});var s=o.enumerable,l=o.name!==void 0?o.name:t;if(RG(e)&&NG(e,l,o),o.global)s?n[t]=e:OG(t,e);else{try{o.unsafe?n[t]&&(s=!0):delete n[t]}catch(p){}s?n[t]=e:LG.f(n,t,{value:e,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return n}});var BS=ot(US=>{"use strict";var DG=y0(),FG=Sp(),UG=FG.concat("length","prototype");US.f=Object.getOwnPropertyNames||function(t){return DG(t,UG)}});var GS=ot(zS=>{"use strict";zS.f=Object.getOwnPropertySymbols});var qS=ot((xQ,kS)=>{"use strict";var BG=hc(),zG=yi(),GG=BS(),kG=GS(),qG=ba(),HG=zG([].concat);kS.exports=BG("Reflect","ownKeys")||function(t){var e=GG.f(qG(t)),o=kG.f;return o?HG(e,o(t)):e}});var WS=ot((EQ,VS)=>{"use strict";var HS=Ma(),VG=qS(),WG=T0(),XG=Lu();VS.exports=function(n,t,e){for(var o=VG(t),s=XG.f,l=WG.f,p=0;p<o.length;p++){var h=o[p];!HS(n,h)&&!(e&&HS(e,h))&&s(n,h,l(t,h))}}});var YS=ot((wQ,XS)=>{"use strict";var YG=mi(),$G=Ui(),ZG=/#|\\.prototype\\./,Wf=function(n,t){var e=KG[JG(n)];return e===QG?!0:e===jG?!1:$G(t)?YG(t):!!t},JG=Wf.normalize=function(n){return String(n).replace(ZG,".").toLowerCase()},KG=Wf.data={},jG=Wf.NATIVE="N",QG=Wf.POLYFILL="P";XS.exports=Wf});var Ds=ot((SQ,$S)=>{"use strict";var Op=so(),t4=T0().f,e4=pc(),n4=Vf(),r4=gp(),i4=WS(),o4=YS();$S.exports=function(n,t){var e=n.target,o=n.global,s=n.stat,l,p,h,g,m,_;if(o?p=Op:s?p=Op[e]||r4(e,{}):p=Op[e]&&Op[e].prototype,p)for(h in t){if(m=t[h],n.dontCallGetSet?(_=t4(p,h),g=_&&_.value):g=p[h],l=o4(o?h:e+(s?".":"#")+h,n.forced),!l&&g!==void 0){if(typeof m==typeof g)continue;i4(m,g)}(n.sham||g&&g.sham)&&e4(m,"sham",!0),n4(p,h,m,n)}}});var JS=ot((MQ,ZS)=>{"use strict";var s4=mi();ZS.exports=!s4(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype})});var F0=ot((bQ,jS)=>{"use strict";var a4=Ma(),u4=Ui(),l4=cc(),c4=Mp(),f4=JS(),KS=c4("IE_PROTO"),D0=Object,h4=D0.prototype;jS.exports=f4?D0.getPrototypeOf:function(n){var t=l4(n);if(a4(t,KS))return t[KS];var e=t.constructor;return u4(e)&&t instanceof e?e.prototype:t instanceof D0?h4:null}});var G0=ot((AQ,eM)=>{"use strict";var p4=mi(),d4=Ui(),g4=Ys(),m4=qf(),QS=F0(),y4=Vf(),v4=Ns(),_4=zf(),z0=v4("iterator"),tM=!1,nu,U0,B0;[].keys&&(B0=[].keys(),"next"in B0?(U0=QS(QS(B0)),U0!==Object.prototype&&(nu=U0)):tM=!0);var x4=!g4(nu)||p4(function(){var n={};return nu[z0].call(n)!==n});x4?nu={}:_4&&(nu=m4(nu));d4(nu[z0])||y4(nu,z0,function(){return this});eM.exports={IteratorPrototype:nu,BUGGY_SAFARI_ITERATORS:tM}});var Dp=ot((TQ,rM)=>{"use strict";var E4=Lu().f,w4=Ma(),S4=Ns(),nM=S4("toStringTag");rM.exports=function(n,t,e){n&&!e&&(n=n.prototype),n&&!w4(n,nM)&&E4(n,nM,{configurable:!0,value:t})}});var oM=ot((CQ,iM)=>{"use strict";var M4=G0().IteratorPrototype,b4=qf(),A4=Cp(),T4=Dp(),C4=Tp(),P4=function(){return this};iM.exports=function(n,t,e,o){var s=t+" Iterator";return n.prototype=b4(M4,{next:A4(+!o,e)}),T4(n,s,!1,!0),C4[s]=P4,n}});var k0=ot((PQ,sM)=>{"use strict";var I4=yi(),R4=Gf();sM.exports=function(n,t,e){try{return I4(R4(Object.getOwnPropertyDescriptor(n,t)[e]))}catch(o){}}});var uM=ot((IQ,aM)=>{"use strict";var L4=Ys();aM.exports=function(n){return L4(n)||n===null}});var cM=ot((RQ,lM)=>{"use strict";var N4=uM(),O4=String,D4=TypeError;lM.exports=function(n){if(N4(n))return n;throw new D4("Can't set "+O4(n)+" as a prototype")}});var hM=ot((LQ,fM)=>{"use strict";var F4=k0(),U4=Ys(),B4=uc(),z4=cM();fM.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var n=!1,t={},e;try{e=F4(Object.prototype,"__proto__","set"),e(t,[]),n=t instanceof Array}catch(o){}return function(s,l){return B4(s),z4(l),U4(s)&&(n?e(s,l):s.__proto__=l),s}}():void 0)});var SM=ot((NQ,wM)=>{"use strict";var G4=Ds(),k4=Os(),Fp=zf(),xM=I0(),q4=Ui(),H4=oM(),pM=F0(),dM=hM(),V4=Dp(),W4=pc(),q0=Vf(),X4=Ns(),gM=Tp(),EM=G0(),Y4=xM.PROPER,$4=xM.CONFIGURABLE,mM=EM.IteratorPrototype,Up=EM.BUGGY_SAFARI_ITERATORS,Xf=X4("iterator"),yM="keys",Yf="values",vM="entries",_M=function(){return this};wM.exports=function(n,t,e,o,s,l,p){H4(e,t,o);var h=function(x){if(x===s&&S)return S;if(!Up&&x&&x in _)return _[x];switch(x){case yM:return function(){return new e(this,x)};case Yf:return function(){return new e(this,x)};case vM:return function(){return new e(this,x)}}return function(){return new e(this)}},g=t+" Iterator",m=!1,_=n.prototype,E=_[Xf]||_["@@iterator"]||s&&_[s],S=!Up&&E||h(s),b=t==="Array"&&_.entries||E,A,I,w;if(b&&(A=pM(b.call(new n)),A!==Object.prototype&&A.next&&(!Fp&&pM(A)!==mM&&(dM?dM(A,mM):q4(A[Xf])||q0(A,Xf,_M)),V4(A,g,!0,!0),Fp&&(gM[g]=_M))),Y4&&s===Yf&&E&&E.name!==Yf&&(!Fp&&$4?W4(_,"name",Yf):(m=!0,S=function(){return k4(E,this)})),s)if(I={values:h(Yf),keys:l?S:h(yM),entries:h(vM)},p)for(w in I)(Up||m||!(w in _))&&q0(_,w,I[w]);else G4({target:t,proto:!0,forced:Up||m},I);return(!Fp||p)&&_[Xf]!==S&&q0(_,Xf,S,{name:s}),gM[t]=S,I}});var bM=ot((OQ,MM)=>{"use strict";MM.exports=function(n,t){return{value:n,done:t}}});var RM=ot((DQ,IM)=>{"use strict";var Z4=lc(),H0=S0(),AM=Tp(),CM=Rp(),J4=Lu().f,K4=SM(),Bp=bM(),j4=zf(),Q4=Zs(),PM="Array Iterator",tk=CM.set,ek=CM.getterFor(PM);IM.exports=K4(Array,"Array",function(n,t){tk(this,{type:PM,target:Z4(n),index:0,kind:t})},function(){var n=ek(this),t=n.target,e=n.index++;if(!t||e>=t.length)return n.target=null,Bp(void 0,!0);switch(n.kind){case"keys":return Bp(e,!1);case"values":return Bp(t[e],!1)}return Bp([e,t[e]],!1)},"values");var TM=AM.Arguments=AM.Array;H0("keys");H0("values");H0("entries");if(!j4&&Q4&&TM.name!=="values")try{J4(TM,"name",{value:"values"})}catch(n){}});var Gp=ot(()=>{"use strict";var LM=so(),OM=SE(),nk=IE(),$f=RM(),NM=pc(),rk=Dp(),ik=Ns(),V0=ik("iterator"),W0=$f.values,DM=function(n,t){if(n){if(n[V0]!==W0)try{NM(n,V0,W0)}catch(o){n[V0]=W0}if(rk(n,t,!0),OM[t]){for(var e in $f)if(n[e]!==$f[e])try{NM(n,e,$f[e])}catch(o){n[e]=$f[e]}}}};for(zp in OM)DM(LM[zp]&&LM[zp].prototype,zp);var zp;DM(nk,"DOMTokenList")});var BM=ot((BQ,UM)=>{"use strict";var ok=Ns(),sk=ok("toStringTag"),FM={};FM[sk]="z";UM.exports=String(FM)==="[object z]"});var X0=ot((zQ,zM)=>{"use strict";var ak=BM(),uk=Ui(),kp=ac(),lk=Ns(),ck=lk("toStringTag"),fk=Object,hk=kp(function(){return arguments}())==="Arguments",pk=function(n,t){try{return n[t]}catch(e){}};zM.exports=ak?kp:function(n){var t,e,o;return n===void 0?"Undefined":n===null?"Null":typeof(e=pk(t=fk(n),ck))=="string"?e:hk?kp(t):(o=kp(t))==="Object"&&uk(t.callee)?"Arguments":o}});var qp=ot((GQ,GM)=>{"use strict";var dk=X0(),gk=String;GM.exports=function(n){if(dk(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return gk(n)}});var qM=ot((kQ,kM)=>{"use strict";var mk=ba();kM.exports=function(){var n=mk(this),t="";return n.hasIndices&&(t+="d"),n.global&&(t+="g"),n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.dotAll&&(t+="s"),n.unicode&&(t+="u"),n.unicodeSets&&(t+="v"),n.sticky&&(t+="y"),t}});var VM=ot((qQ,HM)=>{"use strict";var Y0=mi(),yk=so(),$0=yk.RegExp,Z0=Y0(function(){var n=$0("a","y");return n.lastIndex=2,n.exec("abcd")!==null}),vk=Z0||Y0(function(){return!$0("a","y").sticky}),_k=Z0||Y0(function(){var n=$0("^r","gy");return n.lastIndex=2,n.exec("str")!==null});HM.exports={BROKEN_CARET:_k,MISSED_STICKY:vk,UNSUPPORTED_Y:Z0}});var XM=ot((HQ,WM)=>{"use strict";var xk=mi(),Ek=so(),wk=Ek.RegExp;WM.exports=xk(function(){var n=wk(".","s");return!(n.dotAll&&n.test(\`
16125
+ `,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 Xa(new ec({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,a=4,l=1,c=a+l;if(e.clearRect(0,0,n[0],n[1]),e.setLineDash([10,10]),e.strokeStyle="#fff",e.lineWidth=2,e.beginPath(),e.arc(i,o,o-c,-Math.PI/2,Math.PI*2-Math.PI/2,t<Math.PI),e.stroke(),e.strokeStyle="#0A7AFF",t<Math.PI){let p=-Math.PI/2,g=p-t;e.beginPath(),e.arc(i,o,o-c,p,g,!0)}else{let p=-Math.PI/2,g=p+Math.PI*2-t;e.beginPath(),e.arc(i,o,o-c,p,g,!1)}e.stroke(),e.clearRect(i-c*2,0,c*4,c*4),e.beginPath(),e.arc(i,c,a,0,Math.PI*2),e.fillStyle="#0A7AFF",e.fill(),e.setLineDash([10,0]),e.strokeStyle="#fff",e.lineWidth=l,e.stroke(),e.clearRect(0,o-5,10,10),e.clearRect(i-5,n[1]-10,10,10),e.clearRect(n[0]-10,o-5,10,10),t>Math.PI/2&&t<Math.PI?e.fillStyle="#0A7AFF":e.fillStyle="#fff",e.fillRect(0,o-1,10,2),e.fillStyle="#fff",e.fillRect(i-1,n[1]-10,2,10),t>Math.PI&&t<Math.PI/2*3?e.fillStyle="#0A7AFF":e.fillStyle="#fff",e.fillRect(n[0]-10,o-1,10,2)}getImageData(){let{ctx:t}=r,{config:{size:e}}=this;return t.getImageData(0,0,e[0],e[1])}getTexture(t){let{config:{size:e}}=this,n=new ko(Uint8Array.from(t.data),e[0],e[1],ti);return n.format=ti,n.magFilter=fn,n.minFilter=fn,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]}};_c.canvas=document.createElement("canvas");_c.ctx=_c.canvas.getContext("2d",{willReadFrequently:!0});_c.textureMap=new Map;var lMt={path:{},cheapMaximumDistance:20,needStartPoi:!1,startPoi:{},positionNavigation:{},offsetY:150,directionEmitThreshold:5,disablePathAnimation:!1,disablePathRotate:!1,disablePathShorten:!1,speed:1,roadData:[],runAnimationMaxTime:1,navigationCameraBasic:45,canBack:!1},$I=class extends ho{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(as.SWITCH_FLOOR_GROUND,this.onSwitchFloor),this.positionNavigation.addEventListener("navigation-info",this.onNavigationInfo),this.bmap.context.addEventListener("control-change",this.onControlChangeForStartPoi)}setRoadData(t){this.options.roadData=t,this.positionNavigation.setRoadData(t)}showStartRotateHelperPoi(){var t;if(this.needStartRotateHelperPoi=!0,!this.startPoi||this.startRotateHelperPoi)return;let e=this.startPoi.options.icon_size;this.startRotateHelperPoi=new _c(this.bmap,{size:[e[0]+20,e[1]+20]}),this.startRotateHelperPoi.setAngle(0),this.startRotateHelperPoi.position.setZ(.51),(t=this.bmap.context.currentFloor)==null||t.poiLayer2.pushPoi(this.startRotateHelperPoi)}hideStartRotateHelperPoi(){if(this.needStartRotateHelperPoi=!1,this.startRotateHelperPoi){var t;(t=this.bmap.context.currentFloor)==null||t.poiLayer2.removePoi(this.startRotateHelperPoi),this.startRotateHelperPoi=null}}setStartPoiPosition(t,e){this.startPoi&&(this.startPoi.position.setX(t).setY(e),this.startRotateHelperPoi&&this.startRotateHelperPoi.position.setX(t).setY(e),this.detachLine&&this.detachLine.setPosition(this.startPoi.position,this.detachStartPoi.position))}resetStatus(){this.pauseAnimation(),this.positionNavigation.resetStatus(this.paths),this.movedDistance=0,this.startPoi&&this.translatePath&&this.setStartPoiPosition(this.translatePath[0][0],this.translatePath[0][1])}toPositionByTask(t){var e;let i=(e=this.taskQueue.getTasks().find(a=>a.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(as.SWITCH_FLOOR_GROUND,this.onSwitchFloor),this.positionNavigation.removeEventListener("navigation-info",this.onNavigationInfo),this.bmap.context.removeEventListener("control-change",this.onControlChangeForStartPoi)}clearPath(){if(this.resetStatus(),this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose(),this.path=null,this.clearTween()),this.startPoi){var t;if((t=this.bmap.context.currentFloor)==null||t.poiLayer2.removePoi(this.startPoi),this.startPoi=null,this.startRotateHelperPoi){var e;(e=this.bmap.context.currentFloor)==null||e.poiLayer2.removePoi(this.startRotateHelperPoi),this.startRotateHelperPoi=null}}if(this.detachStartPoi){var n;(n=this.bmap.context.currentFloor)==null||n.removePoi2(this.detachStartPoi),this.detachStartPoi=null}this.detachLine&&(this.bmap.context.scene.remove(this.detachLine),this.detachLine.dispose(),this.detachLine=null),this.translatePath=null}setCurFloorPath(t){t===null?(this.curFloorPath=null,this.currentPathPosition=null,this.toPointPosition=null):(this.curFloorPath=t,this.currentPathPosition=t.points[0],this.toPointPosition=t.points[0]),this.movedDistance=0,this.clearTween()}setCurPathIndex(t){var e,n;this.curPathIndex=t,((e=this.paths[t])==null?void 0:e.floor)===((n=this.bmap.context.currentFloor)==null?void 0:n.name)?(this.setCurFloorPath(this.paths[t]),this.renderPath(this.translatePoints(this.curFloorPathPoints))):this.clearPath()}addPath(t,e){e===void 0&&(e=0);var n;this.paths=t,this.curPathIndex=e,this.clearTween(),this.clearPath();let 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 a=()=>{this.bmap.removeEventListener("center-change",a),this.renderPath(this.translatePoints(o.points))};this.bmap.addEventListener("center-change",a)}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 Y6(this,this.options.path),this.path.create(e),this.path.position.z=this.bmap.context.currentFloor.groundMaxHeight+.5,this.bmap.context.scene.add(this.path)),this.path.movePath(0),this.startPoi){var n;if((n=this.bmap.context.currentFloor)==null||n.poiLayer2.removePoi(this.startPoi),this.startPoi=null,this.startRotateHelperPoi){var i;(i=this.bmap.context.currentFloor)==null||i.poiLayer2.removePoi(this.startRotateHelperPoi),this.startRotateHelperPoi=null}}if(this.removeDetachStart(),this.showDetachStartState&&this.options.detachStartPoi){var o;this.detachStartPoi=new Di(this.bmap.context,Jt({},this.options.detachStartPoi,{id:"navigation_detach_start_poi",position:{x:e[0][0],y:e[0][1],z:.51},collision_enable:!1}))||null,(o=this.bmap.context.currentFloor)==null||o.poiLayer2.pushPoi(this.detachStartPoi),this.detachLine=new Sg(this.bmap.context,new G(e[0][0],e[0][1],.51),new G(e[0][0],e[0][1],.51)),this.bmap.context.scene.add(this.detachLine)}if(this.options.needStartPoi){var a;this.startPoi=new Di(this.bmap.context,Jt({},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 Ay(t,!1,!0,.1,170,2.5)}getPathDirection(){if(!this.curFloorPath||!this.currentPathPosition||this.curFloorPathPoints.length<2)return null;let t=Z0(this.curFloorPathPoints,this.currentPathPosition),e=this.curFloorPathPoints[t],n=this.curFloorPathPoints[t+1],i=new G(n[0]-e[0],n[1]-e[1],0).normalize(),o=new G(0,1,0).normalize(),a=i.angleTo(o),l=new G().crossVectors(o,i);return(Object.is(l.y,0)?-1:1)*a}getPathDirection2(){if(!this.curFloorPath||!this.toPointPosition||this.curFloorPathPoints.length<2)return null;let t=Z0(this.curFloorPathPoints,this.toPointPosition),e=this.curFloorPathPoints[t],n=this.curFloorPathPoints[t+1];return(new ft(n[0]-e[0],n[1]-e[1]).normalize().angle()*180/Math.PI-90+360)%360}changeCameraToPathUp(t){return St(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,a=t/Math.PI*6*i;return $a(new Promise(l=>{let c={azimuthal:o.getAzimuthalAngle()},p={azimuthal:e},g=o.getPolarAngle(),{maxPolarAngle:m,minPolarAngle:y}=o;o.maxPolarAngle=g,o.minPolarAngle=g;let x=new Ka(c,this.tweenUtil.group).to(p,a).easing(of.Quadratic.InOut).onUpdate(()=>St(this,null,function*(){this.startPoi&&o.target.copy(this.startPoi.position),o.setAzimuthalAngle(c.azimuthal,!0),o.setTargetByOffset(this.options.offsetY)})).onComplete(()=>{o.enabled=!0,this.tweenUtil.remove(x),o.maxPolarAngle=m,o.minPolarAngle=y,l(!0)}).onStart(()=>{o.enabled=!1}).start()}),a+500).finally(()=>{this.bmap.context.control.enabled=!0})})}initNavigationCamera(t){return St(this,null,function*(){t===void 0&&(t=1e3);var e;let i=(e=this.taskQueue.getTasks().find(a=>a.meta.type==="initNavigationCamera"))==null?void 0:e.tid,o={run:()=>$a(St(this,null,function*(){yield this.initCameraZoom(t/2),this.options.disablePathRotate||(yield this.changeCameraToPathUp(t/4)),yield this.translateCameraToStartPoi(t/(this.options.disablePathRotate?2:4))}),t+500).finally(()=>{this.bmap.context.control.enabled=!0}),meta:{type:"initNavigationCamera"}};i?this.taskQueue.replace(i,o):this.taskQueue.add(o)})}translateCameraToStartPoi(t){return St(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,a=Math.round(e/2),l=Math.round(n/2),c=o.target.clone(),p=bn(this.startPoi.position,i,e,n),g=p.x-a,m=l-p.y+this.options.offsetY;if(!(Math.abs(g)<=1&&Math.abs(m)<=1)){if(Math.abs(g)>=1){let y=new G;y.setFromMatrixColumn(i.matrix,0),y.normalize(),y.multiplyScalar(g/i.zoom),c.add(new G(y.x,y.y,0))}if(Math.abs(m)>=1){let y=new G;y.setFromMatrixColumn(i.matrix,1),y.normalize(),y.multiplyScalar(m/i.zoom),c.add(new G(y.x,y.y,0))}return $a(new Promise(y=>{let x=o.target.clone();console.log(x,c,t);let S=new Ka(x,this.tweenUtil.group).to(c,t).onUpdate(()=>{this.bmap.context.control.setCameraPositionByTarget(x,0)}).onComplete(()=>{this.bmap.context.control.setCameraPositionByTarget(c,0),this.tweenUtil.remove(S),this.bmap.context.control.enabled=!0,y(!0)}).onStart(()=>{this.bmap.context.control.enabled=!1}).start()}),t+500).then(()=>{this.bmap.context.control.enabled=!0})}})}initCameraZoom(t){return St(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:a}=i.box,c=Math.min(e/(o.x-a.x),n/(o.y-a.y))*(o.x-a.x)/this.options.navigationCameraBasic;return this.bmap.context.setZoom(c,this.startPoi.position,t).finally(()=>{this.bmap.context.control.enabled=!0})})}toPosition(t,e){if(this.paths[this.curPathIndex]&&this.paths[this.curPathIndex].floor===t&&this.detachStartPoi){let n=this.translatePoints([e]);this.detachStartPoi.position.setX(n[0][0]),this.detachStartPoi.position.setY(n[0][1]),this.detachLine&&this.startPoi&&this.detachLine.setPosition(this.startPoi.position,this.detachStartPoi.position)}this.options.canBack&&(this.positionNavigation.pointIndex=0,this.positionNavigation.position=this.paths[this.curPathIndex].points[0]),this.positionNavigation.toPosition(t,e)}startSimulation(){this.positionNavigation.startSimulation()}setSimulationSpeed(t){this.positionNavigation.changeSimulationSpeed(t)}toPositionBySpeed(t,e){return St(this,null,function*(){let{currentPathPosition:n,curFloorPath:i,curFloorPathPoints:o}=this;if(!i||!n)return null;let a=this.movedDistance,l=XT(o,t);if(a===-1||l===-1||!this.options.canBack&&l<=a)return null;let c=l-a;if(!c)return;let p=Math.min(Math.abs(c)/e,this.options.runAnimationMaxTime);return this.pathTween&&this.clearTween(),$a(new Promise(g=>{let m=this.pathTween=new Ka({distance:0},this.tweenUtil.group).to({distance:c},p*1e3).onUpdate(y=>St(this,null,function*(){this.moveDistance(y.distance+a,m)})).onComplete(()=>{this.tweenUtil.remove(m),g(!0)}).start()}),p*1e3+500).finally(()=>{this.bmap.context.control.enabled=!0})})}moveDistance(t,e){return St(this,null,function*(){if(this.movedDistance=t,!this.options.disablePathShorten){var n;(n=this.path)==null||n.movePath(this.movedDistance/this.curFloorPathLength)}let i=nf(this.curFloorPathPoints,this.movedDistance);if(i===null)return;this.currentPathPosition=i;let o=this.translatePoints([i])[0];this.startPoi&&(this.setStartPoiPosition(o[0],o[1]),this.options.disablePathAnimation||this.bmap.context.control.setTargetByOffset(this.options.offsetY,this.startPoi.position.clone())),!this.options.disablePathAnimation&&!this.options.disablePathRotate&&(e==null||e.pause(),yield this.changeCameraToPathUp(500/this.options.speed),e==null||e.resume())})}removeDetachStart(){if(this.detachLine&&(this.bmap.context.scene.remove(this.detachLine),this.detachLine.dispose(),this.detachLine=null),this.detachStartPoi){var t;(t=this.bmap.context.currentFloor)==null||t.poiLayer2.removePoi(this.detachStartPoi),this.detachStartPoi=null}}hideDetachStart(){this.showDetachStartState=!1,this.removeDetachStart()}showDetachStart(){if(!this.detachStartPoi&&(this.showDetachStartState=!0,this.path&&this.startPoi&&this.options.detachStartPoi)){var t;let e=this.startPoi.position;this.detachStartPoi=new Di(this.bmap.context,Jt({},this.options.detachStartPoi,{id:"navigation_detach_start_poi",position:e,collision_enable:!1}))||null,(t=this.bmap.context.currentFloor)==null||t.poiLayer2.pushPoi(this.detachStartPoi),this.detachLine=new Sg(this.bmap.context,new G(e.x,e.y,.51),new G(e.x,e.y,.51)),this.bmap.context.scene.add(this.detachLine)}}setStartPoiRotate(t){this.startPoiRotate=t;let n=(this.bmap.context.control.getAzimuthalAngle()*180/Math.PI+360)%360,i=(360-t-n)%360;this.detachStartPoi&&(this.detachStartPoi.options.icon_rotate=i),this.startPoi&&(this.startPoi.options.icon_rotate=i,this.startRotateHelperPoi&&this.startRotateHelperPoi.setAngle(i))}dispose(){var t;if(this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose()),this.hideDetachStart(),this.startPoi){var e;(e=this.bmap.context.currentFloor)==null||e.poiLayer2.removePoi(this.startPoi),this.startPoi=null}this.tweenUtil.dispose(),this.unRegistryEvent(),(t=this.startRotateHelperPoi)==null||t.dispose(),_c.dispose(),this.positionNavigation.dispose(),this.startRotateHelperPoi=null,super.dispose()}constructor(t,e={},n){super(t),this.path=null,this.fetchRoadStatus=!1,this.paths=[],this.curPathIndex=0,this.curFloorPath=null,this.translatePath=null,this.currentPathPosition=null,this.toPointPosition=null,this.pathTween=null,this.startPoi=null,this.detachStartPoi=null,this.detachLine=null,this.startPoiRotate=null,this.startRotateHelperPoi=null,this.needStartRotateHelperPoi=!1,this.showDetachStartState=!0,this.movedDistance=0,this.pathStart=[0,0],this.tweenUtil=new lc,this.taskQueue=new sf,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 a=this.paths[this.curPathIndex];this.setCurFloorPath(a!=null?a:null),a?this.renderPath(this.translatePoints(a.points)):this.clearPath()}else this.clearPath()},this.onControlChangeForStartPoi=()=>{this.startPoi&&this.startPoiRotate!==null&&this.setStartPoiRotate(this.startPoiRotate)},!n&&typeof e=="object"&&(n=e),this.options=Object.assign({},lMt,n),this.positionNavigation=new Z6(this,Jt({simulationSpeed:this.options.speed},this.options.positionNavigation),this.options.roadData),this.registryEvent()}};var Uue=V(De(),1);var KI=class extends ho{show(t,e){let n=0;t.forEach(a=>{a.onAddToScene("mulFloors"),a.position.z=n,n+=a.userData.height,a.poiLayer2.pois.forEach(l=>{l.options.depth_test=!0})});let{scene:i,currentFloor:o}=this.bmap.context;i.background=new ne((e==null?void 0:e.backgroundColor)||"#f1f7f6"),o&&(i.remove(o),o.dispose()),this.group.add(...t),i.add(this.group),this.floors=t,this.fitCamera(),this.bmap.context.cameraBound.updateBox(),this.showStatus=!0,this.bmap.context.forceUpdate()}showStep(t,e){return this.show(t,e)}hide(){let{scene:t}=this.bmap.context;t.remove(this.group),this.floors.forEach(e=>{e.dispose()}),this.floors=[],this.group.clear(),this.showStatus=!1}showByNotDispose(t,e,n){n===void 0&&(n=()=>!0);let i=0;t.forEach(l=>{[...l.poiLayer2.pois].forEach(c=>{if(!n(c)){c.visible=!1;return}c.options.depth_test=!0}),l.position.z=i,i+=l.userData.height,l.onAddToScene("mulFloors")});let{scene:o,currentFloor:a}=this.bmap.context;o.background=new ne((e==null?void 0:e.backgroundColor)||"#f1f7f6"),a&&o.remove(a),this.group.add(...t),o.add(this.group),this.floors=t,this.fitCamera(),this.bmap.context.cameraBound.updateBox(),this.showStatus=!0,this.bmap.context.forceUpdate()}hideByNotDispose(){let{scene:t}=this.bmap.context;t.remove(this.group),this.floors.forEach(e=>{e.poiLayer2.pois.forEach(n=>{n.visible=!0,n.options.depth_test=!1})}),this.floors.forEach(e=>{e.position.z=0,e.onRemoveFromScene()}),this.group.clear(),this.showStatus=!1}fitCamera(){let{context:t,config:e}=this.bmap;t.cameraBound.setEnable(!1),t.control.minZoom=0,t.control.maxZoom=1/0,t.camera.zoom=1,t.setAzimuthalAngle(e.control.defaultAzimuthal,0),t.setPolarAngle(e.control.defaultPolar,0),t.fitCameraToObject(this.group,e.defaultPadding,0,!1);let n=t.camera.zoom;t.control.minZoom=n,t.control.maxZoom=n*e.control.maxZoomScale,this.bmap.basicZoom=t.camera.zoom,t.control.addEventListener("change",this.bmap.onControlChange),this.bmap.onControlChange(),t.cameraBound.setEnable(!0)}dispose(){this.floors.forEach(t=>t.dispose()),this.floors=[],super.dispose()}constructor(t){super(t),this.floors=[],this.group=new uo,this.showStatus=!1,this.group.name="mul-floor-group"}};function JI(){let r=new Blob([`var RU=Object.create;var xE=Object.defineProperty;var LU=Object.getOwnPropertyDescriptor;var NU=Object.getOwnPropertyNames;var OU=Object.getPrototypeOf,DU=Object.prototype.hasOwnProperty;var ot=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var FU=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of NU(t))!DU.call(n,s)&&s!==e&&xE(n,s,{get:()=>t[s],enumerable:!(o=LU(t,s))||o.enumerable});return n};var Je=(n,t,e)=>(e=n!=null?RU(OU(n)):{},FU(t||!n||!n.__esModule?xE(e,"default",{value:n,enumerable:!0}):e,n));var pp=(n,t,e)=>new Promise((o,s)=>{var l=g=>{try{h(e.next(g))}catch(m){s(m)}},p=g=>{try{h(e.throw(g))}catch(m){s(m)}},h=g=>g.done?o(g.value):Promise.resolve(g.value).then(l,p);h((e=e.apply(n,t)).next())});var so=ot((Wm,EE)=>{"use strict";var Uf=function(n){return n&&n.Math===Math&&n};EE.exports=Uf(typeof globalThis=="object"&&globalThis)||Uf(typeof window=="object"&&window)||Uf(typeof self=="object"&&self)||Uf(typeof global=="object"&&global)||Uf(typeof Wm=="object"&&Wm)||function(){return this}()||Function("return this")()});var SE=ot((sj,wE)=>{"use strict";wE.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}});var Ui=ot((aj,ME)=>{"use strict";var Xm=typeof document=="object"&&document.all;ME.exports=typeof Xm=="undefined"&&Xm!==void 0?function(n){return typeof n=="function"||n===Xm}:function(n){return typeof n=="function"}});var Ys=ot((uj,bE)=>{"use strict";var UU=Ui();bE.exports=function(n){return typeof n=="object"?n!==null:UU(n)}});var dp=ot((lj,TE)=>{"use strict";var BU=so(),AE=Ys(),Ym=BU.document,zU=AE(Ym)&&AE(Ym.createElement);TE.exports=function(n){return zU?Ym.createElement(n):{}}});var IE=ot((cj,PE)=>{"use strict";var GU=dp(),$m=GU("span").classList,CE=$m&&$m.constructor&&$m.constructor.prototype;PE.exports=CE===Object.prototype?void 0:CE});var mi=ot((fj,RE)=>{"use strict";RE.exports=function(n){try{return!!n()}catch(t){return!0}}});var Bf=ot((hj,LE)=>{"use strict";var kU=mi();LE.exports=!kU(function(){var n=function(){}.bind();return typeof n!="function"||n.hasOwnProperty("prototype")})});var yi=ot((pj,DE)=>{"use strict";var NE=Bf(),OE=Function.prototype,Zm=OE.call,qU=NE&&OE.bind.bind(Zm,Zm);DE.exports=NE?qU:function(n){return function(){return Zm.apply(n,arguments)}}});var ac=ot((dj,UE)=>{"use strict";var FE=yi(),HU=FE({}.toString),VU=FE("".slice);UE.exports=function(n){return VU(HU(n),8,-1)}});var zE=ot((gj,BE)=>{"use strict";var WU=yi(),XU=mi(),YU=ac(),Jm=Object,$U=WU("".split);BE.exports=XU(function(){return!Jm("z").propertyIsEnumerable(0)})?function(n){return YU(n)==="String"?$U(n,""):Jm(n)}:Jm});var Km=ot((mj,GE)=>{"use strict";GE.exports=function(n){return n==null}});var uc=ot((yj,kE)=>{"use strict";var ZU=Km(),JU=TypeError;kE.exports=function(n){if(ZU(n))throw new JU("Can't call method on "+n);return n}});var lc=ot((vj,qE)=>{"use strict";var KU=zE(),jU=uc();qE.exports=function(n){return KU(jU(n))}});var zf=ot((_j,HE)=>{"use strict";HE.exports=!1});var gp=ot((xj,WE)=>{"use strict";var VE=so(),QU=Object.defineProperty;WE.exports=function(n,t){try{QU(VE,n,{value:t,configurable:!0,writable:!0})}catch(e){VE[n]=t}return t}});var mp=ot((Ej,$E)=>{"use strict";var tB=zf(),eB=so(),nB=gp(),XE="__core-js_shared__",YE=$E.exports=eB[XE]||nB(XE,{});(YE.versions||(YE.versions=[])).push({version:"3.42.0",mode:tB?"pure":"global",copyright:"\\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var yp=ot((wj,JE)=>{"use strict";var ZE=mp();JE.exports=function(n,t){return ZE[n]||(ZE[n]=t||{})}});var cc=ot((Sj,KE)=>{"use strict";var rB=uc(),iB=Object;KE.exports=function(n){return iB(rB(n))}});var Ma=ot((Mj,jE)=>{"use strict";var oB=yi(),sB=cc(),aB=oB({}.hasOwnProperty);jE.exports=Object.hasOwn||function(t,e){return aB(sB(t),e)}});var jm=ot((bj,QE)=>{"use strict";var uB=yi(),lB=0,cB=Math.random(),fB=uB(1 .toString);QE.exports=function(n){return"Symbol("+(n===void 0?"":n)+")_"+fB(++lB+cB,36)}});var rw=ot((Aj,nw)=>{"use strict";var hB=so(),tw=hB.navigator,ew=tw&&tw.userAgent;nw.exports=ew?String(ew):""});var cw=ot((Tj,lw)=>{"use strict";var uw=so(),Qm=rw(),iw=uw.process,ow=uw.Deno,sw=iw&&iw.versions||ow&&ow.version,aw=sw&&sw.v8,$s,vp;aw&&($s=aw.split("."),vp=$s[0]>0&&$s[0]<4?1:+($s[0]+$s[1]));!vp&&Qm&&($s=Qm.match(/Edge\\/(\\d+)/),(!$s||$s[1]>=74)&&($s=Qm.match(/Chrome\\/(\\d+)/),$s&&(vp=+$s[1])));lw.exports=vp});var t0=ot((Cj,hw)=>{"use strict";var fw=cw(),pB=mi(),dB=so(),gB=dB.String;hw.exports=!!Object.getOwnPropertySymbols&&!pB(function(){var n=Symbol("symbol detection");return!gB(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&fw&&fw<41})});var e0=ot((Pj,pw)=>{"use strict";var mB=t0();pw.exports=mB&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Ns=ot((Ij,gw)=>{"use strict";var yB=so(),vB=yp(),dw=Ma(),_B=jm(),xB=t0(),EB=e0(),fc=yB.Symbol,n0=vB("wks"),wB=EB?fc.for||fc:fc&&fc.withoutSetter||_B;gw.exports=function(n){return dw(n0,n)||(n0[n]=xB&&dw(fc,n)?fc[n]:wB("Symbol."+n)),n0[n]}});var ba=ot((Rj,mw)=>{"use strict";var SB=Ys(),MB=String,bB=TypeError;mw.exports=function(n){if(SB(n))return n;throw new bB(MB(n)+" is not an object")}});var Zs=ot((Lj,yw)=>{"use strict";var AB=mi();yw.exports=!AB(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var r0=ot((Nj,vw)=>{"use strict";var TB=Zs(),CB=mi();vw.exports=TB&&CB(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var i0=ot((Oj,_w)=>{"use strict";var PB=Zs(),IB=mi(),RB=dp();_w.exports=!PB&&!IB(function(){return Object.defineProperty(RB("div"),"a",{get:function(){return 7}}).a!==7})});var Os=ot((Dj,xw)=>{"use strict";var LB=Bf(),_p=Function.prototype.call;xw.exports=LB?_p.bind(_p):function(){return _p.apply(_p,arguments)}});var hc=ot((Fj,Ew)=>{"use strict";var o0=so(),NB=Ui(),OB=function(n){return NB(n)?n:void 0};Ew.exports=function(n,t){return arguments.length<2?OB(o0[n]):o0[n]&&o0[n][t]}});var Sw=ot((Uj,ww)=>{"use strict";var DB=yi();ww.exports=DB({}.isPrototypeOf)});var s0=ot((Bj,Mw)=>{"use strict";var FB=hc(),UB=Ui(),BB=Sw(),zB=e0(),GB=Object;Mw.exports=zB?function(n){return typeof n=="symbol"}:function(n){var t=FB("Symbol");return UB(t)&&BB(t.prototype,GB(n))}});var Aw=ot((zj,bw)=>{"use strict";var kB=String;bw.exports=function(n){try{return kB(n)}catch(t){return"Object"}}});var Gf=ot((Gj,Tw)=>{"use strict";var qB=Ui(),HB=Aw(),VB=TypeError;Tw.exports=function(n){if(qB(n))return n;throw new VB(HB(n)+" is not a function")}});var xp=ot((kj,Cw)=>{"use strict";var WB=Gf(),XB=Km();Cw.exports=function(n,t){var e=n[t];return XB(e)?void 0:WB(e)}});var Iw=ot((qj,Pw)=>{"use strict";var a0=Os(),u0=Ui(),l0=Ys(),YB=TypeError;Pw.exports=function(n,t){var e,o;if(t==="string"&&u0(e=n.toString)&&!l0(o=a0(e,n))||u0(e=n.valueOf)&&!l0(o=a0(e,n))||t!=="string"&&u0(e=n.toString)&&!l0(o=a0(e,n)))return o;throw new YB("Can't convert object to primitive value")}});var Ow=ot((Hj,Nw)=>{"use strict";var $B=Os(),Rw=Ys(),Lw=s0(),ZB=xp(),JB=Iw(),KB=Ns(),jB=TypeError,QB=KB("toPrimitive");Nw.exports=function(n,t){if(!Rw(n)||Lw(n))return n;var e=ZB(n,QB),o;if(e){if(t===void 0&&(t="default"),o=$B(e,n,t),!Rw(o)||Lw(o))return o;throw new jB("Can't convert object to primitive value")}return t===void 0&&(t="number"),JB(n,t)}});var c0=ot((Vj,Dw)=>{"use strict";var tz=Ow(),ez=s0();Dw.exports=function(n){var t=tz(n,"string");return ez(t)?t:t+""}});var Lu=ot(Uw=>{"use strict";var nz=Zs(),rz=i0(),iz=r0(),Ep=ba(),Fw=c0(),oz=TypeError,f0=Object.defineProperty,sz=Object.getOwnPropertyDescriptor,h0="enumerable",p0="configurable",d0="writable";Uw.f=nz?iz?function(t,e,o){if(Ep(t),e=Fw(e),Ep(o),typeof t=="function"&&e==="prototype"&&"value"in o&&d0 in o&&!o[d0]){var s=sz(t,e);s&&s[d0]&&(t[e]=o.value,o={configurable:p0 in o?o[p0]:s[p0],enumerable:h0 in o?o[h0]:s[h0],writable:!1})}return f0(t,e,o)}:f0:function(t,e,o){if(Ep(t),e=Fw(e),Ep(o),rz)try{return f0(t,e,o)}catch(s){}if("get"in o||"set"in o)throw new oz("Accessors not supported");return"value"in o&&(t[e]=o.value),t}});var zw=ot((Xj,Bw)=>{"use strict";var az=Math.ceil,uz=Math.floor;Bw.exports=Math.trunc||function(t){var e=+t;return(e>0?uz:az)(e)}});var El=ot((Yj,Gw)=>{"use strict";var lz=zw();Gw.exports=function(n){var t=+n;return t!==t||t===0?0:lz(t)}});var qw=ot(($j,kw)=>{"use strict";var cz=El(),fz=Math.max,hz=Math.min;kw.exports=function(n,t){var e=cz(n);return e<0?fz(e+t,0):hz(e,t)}});var g0=ot((Zj,Hw)=>{"use strict";var pz=El(),dz=Math.min;Hw.exports=function(n){var t=pz(n);return t>0?dz(t,9007199254740991):0}});var kf=ot((Jj,Vw)=>{"use strict";var gz=g0();Vw.exports=function(n){return gz(n.length)}});var Yw=ot((Kj,Xw)=>{"use strict";var mz=lc(),yz=qw(),vz=kf(),Ww=function(n){return function(t,e,o){var s=mz(t),l=vz(s);if(l===0)return!n&&-1;var p=yz(o,l),h;if(n&&e!==e){for(;l>p;)if(h=s[p++],h!==h)return!0}else for(;l>p;p++)if((n||p in s)&&s[p]===e)return n||p||0;return!n&&-1}};Xw.exports={includes:Ww(!0),indexOf:Ww(!1)}});var wp=ot((jj,$w)=>{"use strict";$w.exports={}});var y0=ot((Qj,Jw)=>{"use strict";var _z=yi(),m0=Ma(),xz=lc(),Ez=Yw().indexOf,wz=wp(),Zw=_z([].push);Jw.exports=function(n,t){var e=xz(n),o=0,s=[],l;for(l in e)!m0(wz,l)&&m0(e,l)&&Zw(s,l);for(;t.length>o;)m0(e,l=t[o++])&&(~Ez(s,l)||Zw(s,l));return s}});var Sp=ot((tQ,Kw)=>{"use strict";Kw.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Qw=ot((eQ,jw)=>{"use strict";var Sz=y0(),Mz=Sp();jw.exports=Object.keys||function(t){return Sz(t,Mz)}});var eS=ot(tS=>{"use strict";var bz=Zs(),Az=r0(),Tz=Lu(),Cz=ba(),Pz=lc(),Iz=Qw();tS.f=bz&&!Az?Object.defineProperties:function(t,e){Cz(t);for(var o=Pz(e),s=Iz(e),l=s.length,p=0,h;l>p;)Tz.f(t,h=s[p++],o[h]);return t}});var rS=ot((rQ,nS)=>{"use strict";var Rz=hc();nS.exports=Rz("document","documentElement")});var Mp=ot((iQ,oS)=>{"use strict";var Lz=yp(),Nz=jm(),iS=Lz("keys");oS.exports=function(n){return iS[n]||(iS[n]=Nz(n))}});var qf=ot((oQ,hS)=>{"use strict";var Oz=ba(),Dz=eS(),sS=Sp(),Fz=wp(),Uz=rS(),Bz=dp(),zz=Mp(),aS=">",uS="<",_0="prototype",x0="script",cS=zz("IE_PROTO"),v0=function(){},fS=function(n){return uS+x0+aS+n+uS+"/"+x0+aS},lS=function(n){n.write(fS("")),n.close();var t=n.parentWindow.Object;return n=null,t},Gz=function(){var n=Bz("iframe"),t="java"+x0+":",e;return n.style.display="none",Uz.appendChild(n),n.src=String(t),e=n.contentWindow.document,e.open(),e.write(fS("document.F=Object")),e.close(),e.F},bp,Ap=function(){try{bp=new ActiveXObject("htmlfile")}catch(t){}Ap=typeof document!="undefined"?document.domain&&bp?lS(bp):Gz():lS(bp);for(var n=sS.length;n--;)delete Ap[_0][sS[n]];return Ap()};Fz[cS]=!0;hS.exports=Object.create||function(t,e){var o;return t!==null?(v0[_0]=Oz(t),o=new v0,v0[_0]=null,o[cS]=t):o=Ap(),e===void 0?o:Dz.f(o,e)}});var S0=ot((sQ,pS)=>{"use strict";var kz=Ns(),qz=qf(),Hz=Lu().f,E0=kz("unscopables"),w0=Array.prototype;w0[E0]===void 0&&Hz(w0,E0,{configurable:!0,value:qz(null)});pS.exports=function(n){w0[E0][n]=!0}});var Tp=ot((aQ,dS)=>{"use strict";dS.exports={}});var yS=ot((uQ,mS)=>{"use strict";var Vz=so(),Wz=Ui(),gS=Vz.WeakMap;mS.exports=Wz(gS)&&/native code/.test(String(gS))});var Cp=ot((lQ,vS)=>{"use strict";vS.exports=function(n,t){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:t}}});var pc=ot((cQ,_S)=>{"use strict";var Xz=Zs(),Yz=Lu(),$z=Cp();_S.exports=Xz?function(n,t,e){return Yz.f(n,t,$z(1,e))}:function(n,t,e){return n[t]=e,n}});var Rp=ot((fQ,wS)=>{"use strict";var Zz=yS(),ES=so(),Jz=Ys(),Kz=pc(),M0=Ma(),b0=mp(),jz=Mp(),Qz=wp(),xS="Object already initialized",A0=ES.TypeError,tG=ES.WeakMap,Pp,Hf,Ip,eG=function(n){return Ip(n)?Hf(n):Pp(n,{})},nG=function(n){return function(t){var e;if(!Jz(t)||(e=Hf(t)).type!==n)throw new A0("Incompatible receiver, "+n+" required");return e}};Zz||b0.state?(Js=b0.state||(b0.state=new tG),Js.get=Js.get,Js.has=Js.has,Js.set=Js.set,Pp=function(n,t){if(Js.has(n))throw new A0(xS);return t.facade=n,Js.set(n,t),t},Hf=function(n){return Js.get(n)||{}},Ip=function(n){return Js.has(n)}):(wl=jz("state"),Qz[wl]=!0,Pp=function(n,t){if(M0(n,wl))throw new A0(xS);return t.facade=n,Kz(n,wl,t),t},Hf=function(n){return M0(n,wl)?n[wl]:{}},Ip=function(n){return M0(n,wl)});var Js,wl;wS.exports={set:Pp,get:Hf,has:Ip,enforce:eG,getterFor:nG}});var AS=ot(bS=>{"use strict";var SS={}.propertyIsEnumerable,MS=Object.getOwnPropertyDescriptor,rG=MS&&!SS.call({1:2},1);bS.f=rG?function(t){var e=MS(this,t);return!!e&&e.enumerable}:SS});var T0=ot(CS=>{"use strict";var iG=Zs(),oG=Os(),sG=AS(),aG=Cp(),uG=lc(),lG=c0(),cG=Ma(),fG=i0(),TS=Object.getOwnPropertyDescriptor;CS.f=iG?TS:function(t,e){if(t=uG(t),e=lG(e),fG)try{return TS(t,e)}catch(o){}if(cG(t,e))return aG(!oG(sG.f,t,e),t[e])}});var I0=ot((dQ,IS)=>{"use strict";var C0=Zs(),hG=Ma(),PS=Function.prototype,pG=C0&&Object.getOwnPropertyDescriptor,P0=hG(PS,"name"),dG=P0&&function(){}.name==="something",gG=P0&&(!C0||C0&&pG(PS,"name").configurable);IS.exports={EXISTS:P0,PROPER:dG,CONFIGURABLE:gG}});var L0=ot((gQ,RS)=>{"use strict";var mG=yi(),yG=Ui(),R0=mp(),vG=mG(Function.toString);yG(R0.inspectSource)||(R0.inspectSource=function(n){return vG(n)});RS.exports=R0.inspectSource});var DS=ot((mQ,OS)=>{"use strict";var O0=yi(),_G=mi(),xG=Ui(),Lp=Ma(),N0=Zs(),EG=I0().CONFIGURABLE,wG=L0(),NS=Rp(),SG=NS.enforce,MG=NS.get,LS=String,Np=Object.defineProperty,bG=O0("".slice),AG=O0("".replace),TG=O0([].join),CG=N0&&!_G(function(){return Np(function(){},"length",{value:8}).length!==8}),PG=String(String).split("String"),IG=OS.exports=function(n,t,e){bG(LS(t),0,7)==="Symbol("&&(t="["+AG(LS(t),/^Symbol\\(([^)]*)\\).*$/,"$1")+"]"),e&&e.getter&&(t="get "+t),e&&e.setter&&(t="set "+t),(!Lp(n,"name")||EG&&n.name!==t)&&(N0?Np(n,"name",{value:t,configurable:!0}):n.name=t),CG&&e&&Lp(e,"arity")&&n.length!==e.arity&&Np(n,"length",{value:e.arity});try{e&&Lp(e,"constructor")&&e.constructor?N0&&Np(n,"prototype",{writable:!1}):n.prototype&&(n.prototype=void 0)}catch(s){}var o=SG(n);return Lp(o,"source")||(o.source=TG(PG,typeof t=="string"?t:"")),n};Function.prototype.toString=IG(function(){return xG(this)&&MG(this).source||wG(this)},"toString")});var Vf=ot((yQ,FS)=>{"use strict";var RG=Ui(),LG=Lu(),NG=DS(),OG=gp();FS.exports=function(n,t,e,o){o||(o={});var s=o.enumerable,l=o.name!==void 0?o.name:t;if(RG(e)&&NG(e,l,o),o.global)s?n[t]=e:OG(t,e);else{try{o.unsafe?n[t]&&(s=!0):delete n[t]}catch(p){}s?n[t]=e:LG.f(n,t,{value:e,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return n}});var BS=ot(US=>{"use strict";var DG=y0(),FG=Sp(),UG=FG.concat("length","prototype");US.f=Object.getOwnPropertyNames||function(t){return DG(t,UG)}});var GS=ot(zS=>{"use strict";zS.f=Object.getOwnPropertySymbols});var qS=ot((xQ,kS)=>{"use strict";var BG=hc(),zG=yi(),GG=BS(),kG=GS(),qG=ba(),HG=zG([].concat);kS.exports=BG("Reflect","ownKeys")||function(t){var e=GG.f(qG(t)),o=kG.f;return o?HG(e,o(t)):e}});var WS=ot((EQ,VS)=>{"use strict";var HS=Ma(),VG=qS(),WG=T0(),XG=Lu();VS.exports=function(n,t,e){for(var o=VG(t),s=XG.f,l=WG.f,p=0;p<o.length;p++){var h=o[p];!HS(n,h)&&!(e&&HS(e,h))&&s(n,h,l(t,h))}}});var YS=ot((wQ,XS)=>{"use strict";var YG=mi(),$G=Ui(),ZG=/#|\\.prototype\\./,Wf=function(n,t){var e=KG[JG(n)];return e===QG?!0:e===jG?!1:$G(t)?YG(t):!!t},JG=Wf.normalize=function(n){return String(n).replace(ZG,".").toLowerCase()},KG=Wf.data={},jG=Wf.NATIVE="N",QG=Wf.POLYFILL="P";XS.exports=Wf});var Ds=ot((SQ,$S)=>{"use strict";var Op=so(),t4=T0().f,e4=pc(),n4=Vf(),r4=gp(),i4=WS(),o4=YS();$S.exports=function(n,t){var e=n.target,o=n.global,s=n.stat,l,p,h,g,m,_;if(o?p=Op:s?p=Op[e]||r4(e,{}):p=Op[e]&&Op[e].prototype,p)for(h in t){if(m=t[h],n.dontCallGetSet?(_=t4(p,h),g=_&&_.value):g=p[h],l=o4(o?h:e+(s?".":"#")+h,n.forced),!l&&g!==void 0){if(typeof m==typeof g)continue;i4(m,g)}(n.sham||g&&g.sham)&&e4(m,"sham",!0),n4(p,h,m,n)}}});var JS=ot((MQ,ZS)=>{"use strict";var s4=mi();ZS.exports=!s4(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype})});var F0=ot((bQ,jS)=>{"use strict";var a4=Ma(),u4=Ui(),l4=cc(),c4=Mp(),f4=JS(),KS=c4("IE_PROTO"),D0=Object,h4=D0.prototype;jS.exports=f4?D0.getPrototypeOf:function(n){var t=l4(n);if(a4(t,KS))return t[KS];var e=t.constructor;return u4(e)&&t instanceof e?e.prototype:t instanceof D0?h4:null}});var G0=ot((AQ,eM)=>{"use strict";var p4=mi(),d4=Ui(),g4=Ys(),m4=qf(),QS=F0(),y4=Vf(),v4=Ns(),_4=zf(),z0=v4("iterator"),tM=!1,nu,U0,B0;[].keys&&(B0=[].keys(),"next"in B0?(U0=QS(QS(B0)),U0!==Object.prototype&&(nu=U0)):tM=!0);var x4=!g4(nu)||p4(function(){var n={};return nu[z0].call(n)!==n});x4?nu={}:_4&&(nu=m4(nu));d4(nu[z0])||y4(nu,z0,function(){return this});eM.exports={IteratorPrototype:nu,BUGGY_SAFARI_ITERATORS:tM}});var Dp=ot((TQ,rM)=>{"use strict";var E4=Lu().f,w4=Ma(),S4=Ns(),nM=S4("toStringTag");rM.exports=function(n,t,e){n&&!e&&(n=n.prototype),n&&!w4(n,nM)&&E4(n,nM,{configurable:!0,value:t})}});var oM=ot((CQ,iM)=>{"use strict";var M4=G0().IteratorPrototype,b4=qf(),A4=Cp(),T4=Dp(),C4=Tp(),P4=function(){return this};iM.exports=function(n,t,e,o){var s=t+" Iterator";return n.prototype=b4(M4,{next:A4(+!o,e)}),T4(n,s,!1,!0),C4[s]=P4,n}});var k0=ot((PQ,sM)=>{"use strict";var I4=yi(),R4=Gf();sM.exports=function(n,t,e){try{return I4(R4(Object.getOwnPropertyDescriptor(n,t)[e]))}catch(o){}}});var uM=ot((IQ,aM)=>{"use strict";var L4=Ys();aM.exports=function(n){return L4(n)||n===null}});var cM=ot((RQ,lM)=>{"use strict";var N4=uM(),O4=String,D4=TypeError;lM.exports=function(n){if(N4(n))return n;throw new D4("Can't set "+O4(n)+" as a prototype")}});var hM=ot((LQ,fM)=>{"use strict";var F4=k0(),U4=Ys(),B4=uc(),z4=cM();fM.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var n=!1,t={},e;try{e=F4(Object.prototype,"__proto__","set"),e(t,[]),n=t instanceof Array}catch(o){}return function(s,l){return B4(s),z4(l),U4(s)&&(n?e(s,l):s.__proto__=l),s}}():void 0)});var SM=ot((NQ,wM)=>{"use strict";var G4=Ds(),k4=Os(),Fp=zf(),xM=I0(),q4=Ui(),H4=oM(),pM=F0(),dM=hM(),V4=Dp(),W4=pc(),q0=Vf(),X4=Ns(),gM=Tp(),EM=G0(),Y4=xM.PROPER,$4=xM.CONFIGURABLE,mM=EM.IteratorPrototype,Up=EM.BUGGY_SAFARI_ITERATORS,Xf=X4("iterator"),yM="keys",Yf="values",vM="entries",_M=function(){return this};wM.exports=function(n,t,e,o,s,l,p){H4(e,t,o);var h=function(x){if(x===s&&S)return S;if(!Up&&x&&x in _)return _[x];switch(x){case yM:return function(){return new e(this,x)};case Yf:return function(){return new e(this,x)};case vM:return function(){return new e(this,x)}}return function(){return new e(this)}},g=t+" Iterator",m=!1,_=n.prototype,E=_[Xf]||_["@@iterator"]||s&&_[s],S=!Up&&E||h(s),b=t==="Array"&&_.entries||E,A,I,w;if(b&&(A=pM(b.call(new n)),A!==Object.prototype&&A.next&&(!Fp&&pM(A)!==mM&&(dM?dM(A,mM):q4(A[Xf])||q0(A,Xf,_M)),V4(A,g,!0,!0),Fp&&(gM[g]=_M))),Y4&&s===Yf&&E&&E.name!==Yf&&(!Fp&&$4?W4(_,"name",Yf):(m=!0,S=function(){return k4(E,this)})),s)if(I={values:h(Yf),keys:l?S:h(yM),entries:h(vM)},p)for(w in I)(Up||m||!(w in _))&&q0(_,w,I[w]);else G4({target:t,proto:!0,forced:Up||m},I);return(!Fp||p)&&_[Xf]!==S&&q0(_,Xf,S,{name:s}),gM[t]=S,I}});var bM=ot((OQ,MM)=>{"use strict";MM.exports=function(n,t){return{value:n,done:t}}});var RM=ot((DQ,IM)=>{"use strict";var Z4=lc(),H0=S0(),AM=Tp(),CM=Rp(),J4=Lu().f,K4=SM(),Bp=bM(),j4=zf(),Q4=Zs(),PM="Array Iterator",tk=CM.set,ek=CM.getterFor(PM);IM.exports=K4(Array,"Array",function(n,t){tk(this,{type:PM,target:Z4(n),index:0,kind:t})},function(){var n=ek(this),t=n.target,e=n.index++;if(!t||e>=t.length)return n.target=null,Bp(void 0,!0);switch(n.kind){case"keys":return Bp(e,!1);case"values":return Bp(t[e],!1)}return Bp([e,t[e]],!1)},"values");var TM=AM.Arguments=AM.Array;H0("keys");H0("values");H0("entries");if(!j4&&Q4&&TM.name!=="values")try{J4(TM,"name",{value:"values"})}catch(n){}});var Gp=ot(()=>{"use strict";var LM=so(),OM=SE(),nk=IE(),$f=RM(),NM=pc(),rk=Dp(),ik=Ns(),V0=ik("iterator"),W0=$f.values,DM=function(n,t){if(n){if(n[V0]!==W0)try{NM(n,V0,W0)}catch(o){n[V0]=W0}if(rk(n,t,!0),OM[t]){for(var e in $f)if(n[e]!==$f[e])try{NM(n,e,$f[e])}catch(o){n[e]=$f[e]}}}};for(zp in OM)DM(LM[zp]&&LM[zp].prototype,zp);var zp;DM(nk,"DOMTokenList")});var BM=ot((BQ,UM)=>{"use strict";var ok=Ns(),sk=ok("toStringTag"),FM={};FM[sk]="z";UM.exports=String(FM)==="[object z]"});var X0=ot((zQ,zM)=>{"use strict";var ak=BM(),uk=Ui(),kp=ac(),lk=Ns(),ck=lk("toStringTag"),fk=Object,hk=kp(function(){return arguments}())==="Arguments",pk=function(n,t){try{return n[t]}catch(e){}};zM.exports=ak?kp:function(n){var t,e,o;return n===void 0?"Undefined":n===null?"Null":typeof(e=pk(t=fk(n),ck))=="string"?e:hk?kp(t):(o=kp(t))==="Object"&&uk(t.callee)?"Arguments":o}});var qp=ot((GQ,GM)=>{"use strict";var dk=X0(),gk=String;GM.exports=function(n){if(dk(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return gk(n)}});var qM=ot((kQ,kM)=>{"use strict";var mk=ba();kM.exports=function(){var n=mk(this),t="";return n.hasIndices&&(t+="d"),n.global&&(t+="g"),n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.dotAll&&(t+="s"),n.unicode&&(t+="u"),n.unicodeSets&&(t+="v"),n.sticky&&(t+="y"),t}});var VM=ot((qQ,HM)=>{"use strict";var Y0=mi(),yk=so(),$0=yk.RegExp,Z0=Y0(function(){var n=$0("a","y");return n.lastIndex=2,n.exec("abcd")!==null}),vk=Z0||Y0(function(){return!$0("a","y").sticky}),_k=Z0||Y0(function(){var n=$0("^r","gy");return n.lastIndex=2,n.exec("str")!==null});HM.exports={BROKEN_CARET:_k,MISSED_STICKY:vk,UNSUPPORTED_Y:Z0}});var XM=ot((HQ,WM)=>{"use strict";var xk=mi(),Ek=so(),wk=Ek.RegExp;WM.exports=xk(function(){var n=wk(".","s");return!(n.dotAll&&n.test(\`
16126
16126
  \`)&&n.flags==="s")})});var $M=ot((VQ,YM)=>{"use strict";var Sk=mi(),Mk=so(),bk=Mk.RegExp;YM.exports=Sk(function(){var n=bk("(?<a>b)","g");return n.exec("b").groups.a!=="b"||"b".replace(n,"$<a>c")!=="bc"})});var Wp=ot((WQ,JM)=>{"use strict";var dc=Os(),Vp=yi(),Ak=qp(),Tk=qM(),Ck=VM(),Pk=yp(),Ik=qf(),Rk=Rp().get,Lk=XM(),Nk=$M(),Ok=Pk("native-string-replace",String.prototype.replace),Hp=RegExp.prototype.exec,K0=Hp,Dk=Vp("".charAt),Fk=Vp("".indexOf),Uk=Vp("".replace),J0=Vp("".slice),j0=function(){var n=/a/,t=/b*/g;return dc(Hp,n,"a"),dc(Hp,t,"a"),n.lastIndex!==0||t.lastIndex!==0}(),ZM=Ck.BROKEN_CARET,Q0=/()??/.exec("")[1]!==void 0,Bk=j0||Q0||ZM||Lk||Nk;Bk&&(K0=function(t){var e=this,o=Rk(e),s=Ak(t),l=o.raw,p,h,g,m,_,E,S;if(l)return l.lastIndex=e.lastIndex,p=dc(K0,l,s),e.lastIndex=l.lastIndex,p;var b=o.groups,A=ZM&&e.sticky,I=dc(Tk,e),w=e.source,x=0,R=s;if(A&&(I=Uk(I,"y",""),Fk(I,"g")===-1&&(I+="g"),R=J0(s,e.lastIndex),e.lastIndex>0&&(!e.multiline||e.multiline&&Dk(s,e.lastIndex-1)!==\`
16127
16127
  \`)&&(w="(?: "+w+")",R=" "+R,x++),h=new RegExp("^(?:"+w+")",I)),Q0&&(h=new RegExp("^"+w+"$(?!\\\\s)",I)),j0&&(g=e.lastIndex),m=dc(Hp,A?h:e,R),A?m?(m.input=J0(m.input,x),m[0]=J0(m[0],x),m.index=e.lastIndex,e.lastIndex+=m[0].length):e.lastIndex=0:j0&&m&&(e.lastIndex=e.global?m.index+m[0].length:g),Q0&&m&&m.length>1&&dc(Ok,m[0],h,function(){for(_=1;_<arguments.length-2;_++)arguments[_]===void 0&&(m[_]=void 0)}),m&&b)for(m.groups=E=Ik(null),_=0;_<b.length;_++)S=b[_],E[S[0]]=m[S[1]];return m});JM.exports=K0});var Xp=ot(()=>{"use strict";var zk=Ds(),KM=Wp();zk({target:"RegExp",proto:!0,forced:/./.exec!==KM},{exec:KM})});var Yp=ot(($Q,jM)=>{"use strict";var Gk=ac();jM.exports=Array.isArray||function(t){return Gk(t)==="Array"}});var tb=ot((ZQ,QM)=>{"use strict";var kk=Zs(),qk=Yp(),Hk=TypeError,Vk=Object.getOwnPropertyDescriptor,Wk=kk&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(n){return n instanceof TypeError}}();QM.exports=Wk?function(n,t){if(qk(n)&&!Vk(n,"length").writable)throw new Hk("Cannot set read only .length");return n.length=t}:function(n,t){return n.length=t}});var ty=ot((JQ,eb)=>{"use strict";var Xk=TypeError,Yk=9007199254740991;eb.exports=function(n){if(n>Yk)throw Xk("Maximum allowed index exceeded");return n}});var ey=ot(()=>{"use strict";var $k=Ds(),Zk=cc(),Jk=kf(),Kk=tb(),jk=ty(),Qk=mi(),tq=Qk(function(){return[].push.call({length:4294967296},1)!==4294967297}),eq=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(n){return n instanceof TypeError}},nq=tq||!eq();$k({target:"Array",proto:!0,arity:1,forced:nq},{push:function(t){var e=Zk(this),o=Jk(e),s=arguments.length;jk(o+s);for(var l=0;l<s;l++)e[o]=arguments[l],o++;return Kk(e,o),o}})});var Ks=ot((QQ,nb)=>{"use strict";var ny=yi(),$p=Set.prototype;nb.exports={Set,add:ny($p.add),has:ny($p.has),remove:ny($p.delete),proto:$p}});var Nu=ot((ttt,rb)=>{"use strict";var rq=Ks().has;rb.exports=function(n){return rq(n),n}});var Ou=ot((ett,ib)=>{"use strict";var iq=Os();ib.exports=function(n,t,e){for(var o=e?n:n.iterator,s=n.next,l,p;!(l=iq(s,o)).done;)if(p=t(l.value),p!==void 0)return p}});var gc=ot((ntt,lb)=>{"use strict";var ob=yi(),oq=Ou(),sb=Ks(),sq=sb.Set,ab=sb.proto,aq=ob(ab.forEach),ub=ob(ab.keys),uq=ub(new sq).next;lb.exports=function(n,t,e){return e?oq({iterator:ub(n),next:uq},t):aq(n,t)}});var Zp=ot((rtt,fb)=>{"use strict";var cb=Ks(),lq=gc(),cq=cb.Set,fq=cb.add;fb.exports=function(n){var t=new cq;return lq(n,function(e){fq(t,e)}),t}});var mc=ot((itt,hb)=>{"use strict";var hq=k0(),pq=Ks();hb.exports=hq(pq.proto,"size","get")||function(n){return n.size}});var db=ot((ott,pb)=>{"use strict";pb.exports=function(n){return{iterator:n,next:n.next,done:!1}}});var Du=ot((stt,xb)=>{"use strict";var gb=Gf(),vb=ba(),mb=Os(),dq=El(),gq=db(),yb="Invalid size",mq=RangeError,yq=TypeError,vq=Math.max,_b=function(n,t){this.set=n,this.size=vq(t,0),this.has=gb(n.has),this.keys=gb(n.keys)};_b.prototype={getIterator:function(){return gq(vb(mb(this.keys,this.set)))},includes:function(n){return mb(this.has,this.set,n)}};xb.exports=function(n){vb(n);var t=+n.size;if(t!==t)throw new yq(yb);var e=dq(t);if(e<0)throw new mq(yb);return new _b(n,e)}});var Mb=ot((att,Sb)=>{"use strict";var _q=Nu(),wb=Ks(),xq=Zp(),Eq=mc(),wq=Du(),Sq=gc(),Mq=Ou(),bq=wb.has,Eb=wb.remove;Sb.exports=function(t){var e=_q(this),o=wq(t),s=xq(e);return Eq(e)<=o.size?Sq(e,function(l){o.includes(l)&&Eb(s,l)}):Mq(o.getIterator(),function(l){bq(e,l)&&Eb(s,l)}),s}});var Fu=ot((utt,Tb)=>{"use strict";var Aq=hc(),bb=function(n){return{size:n,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},Ab=function(n){return{size:n,has:function(){return!0},keys:function(){throw new Error("e")}}};Tb.exports=function(n,t){var e=Aq("Set");try{new e()[n](bb(0));try{return new e()[n](bb(-1)),!1}catch(s){if(!t)return!0;try{return new e()[n](Ab(-1/0)),!1}catch(l){var o=new e;return o.add(1),o.add(2),t(o[n](Ab(1/0)))}}}catch(s){return!1}}});var Cb=ot(()=>{"use strict";var Tq=Ds(),Cq=Mb(),Pq=Fu(),Iq=!Pq("difference",function(n){return n.size===0});Tq({target:"Set",proto:!0,real:!0,forced:Iq},{difference:Cq})});var Rb=ot((ftt,Ib)=>{"use strict";var Rq=Nu(),ry=Ks(),Lq=mc(),Nq=Du(),Oq=gc(),Dq=Ou(),Fq=ry.Set,Pb=ry.add,Uq=ry.has;Ib.exports=function(t){var e=Rq(this),o=Nq(t),s=new Fq;return Lq(e)>o.size?Dq(o.getIterator(),function(l){Uq(e,l)&&Pb(s,l)}):Oq(e,function(l){o.includes(l)&&Pb(s,l)}),s}});var Lb=ot(()=>{"use strict";var Bq=Ds(),zq=mi(),Gq=Rb(),kq=Fu(),qq=!kq("intersection",function(n){return n.size===2&&n.has(1)&&n.has(2)})||zq(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});Bq({target:"Set",proto:!0,real:!0,forced:qq},{intersection:Gq})});var iy=ot((dtt,Ob)=>{"use strict";var Hq=Os(),Nb=ba(),Vq=xp();Ob.exports=function(n,t,e){var o,s;Nb(n);try{if(o=Vq(n,"return"),!o){if(t==="throw")throw e;return e}o=Hq(o,n)}catch(l){s=!0,o=l}if(t==="throw")throw e;if(s)throw o;return Nb(o),e}});var Fb=ot((gtt,Db)=>{"use strict";var Wq=Nu(),Xq=Ks().has,Yq=mc(),$q=Du(),Zq=gc(),Jq=Ou(),Kq=iy();Db.exports=function(t){var e=Wq(this),o=$q(t);if(Yq(e)<=o.size)return Zq(e,function(l){if(o.includes(l))return!1},!0)!==!1;var s=o.getIterator();return Jq(s,function(l){if(Xq(e,l))return Kq(s,"normal",!1)})!==!1}});var Ub=ot(()=>{"use strict";var jq=Ds(),Qq=Fb(),t5=Fu(),e5=!t5("isDisjointFrom",function(n){return!n});jq({target:"Set",proto:!0,real:!0,forced:e5},{isDisjointFrom:Qq})});var zb=ot((vtt,Bb)=>{"use strict";var n5=Nu(),r5=mc(),i5=gc(),o5=Du();Bb.exports=function(t){var e=n5(this),o=o5(t);return r5(e)>o.size?!1:i5(e,function(s){if(!o.includes(s))return!1},!0)!==!1}});var Gb=ot(()=>{"use strict";var s5=Ds(),a5=zb(),u5=Fu(),l5=!u5("isSubsetOf",function(n){return n});s5({target:"Set",proto:!0,real:!0,forced:l5},{isSubsetOf:a5})});var qb=ot((Ett,kb)=>{"use strict";var c5=Nu(),f5=Ks().has,h5=mc(),p5=Du(),d5=Ou(),g5=iy();kb.exports=function(t){var e=c5(this),o=p5(t);if(h5(e)<o.size)return!1;var s=o.getIterator();return d5(s,function(l){if(!f5(e,l))return g5(s,"normal",!1)})!==!1}});var Hb=ot(()=>{"use strict";var m5=Ds(),y5=qb(),v5=Fu(),_5=!v5("isSupersetOf",function(n){return!n});m5({target:"Set",proto:!0,real:!0,forced:_5},{isSupersetOf:y5})});var Wb=ot((Mtt,Vb)=>{"use strict";var x5=Nu(),oy=Ks(),E5=Zp(),w5=Du(),S5=Ou(),M5=oy.add,b5=oy.has,A5=oy.remove;Vb.exports=function(t){var e=x5(this),o=w5(t).getIterator(),s=E5(e);return S5(o,function(l){b5(e,l)?A5(s,l):M5(s,l)}),s}});var Xb=ot(()=>{"use strict";var T5=Ds(),C5=Wb(),P5=Fu();T5({target:"Set",proto:!0,real:!0,forced:!P5("symmetricDifference")},{symmetricDifference:C5})});var $b=ot((Ttt,Yb)=>{"use strict";var I5=Nu(),R5=Ks().add,L5=Zp(),N5=Du(),O5=Ou();Yb.exports=function(t){var e=I5(this),o=N5(t).getIterator(),s=L5(e);return O5(o,function(l){R5(s,l)}),s}});var Zb=ot(()=>{"use strict";var D5=Ds(),F5=$b(),U5=Fu();D5({target:"Set",proto:!0,real:!0,forced:!U5("union")},{union:F5})});var Kb=ot((Itt,Jb)=>{"use strict";var B5=ac(),z5=yi();Jb.exports=function(n){if(B5(n)==="Function")return z5(n)}});var tA=ot((Rtt,Qb)=>{"use strict";var jb=Kb(),G5=Gf(),k5=Bf(),q5=jb(jb.bind);Qb.exports=function(n,t){return G5(n),t===void 0?n:k5?q5(n,t):function(){return n.apply(t,arguments)}}});var rA=ot((Ltt,nA)=>{"use strict";var H5=Yp(),V5=kf(),W5=ty(),X5=tA(),eA=function(n,t,e,o,s,l,p,h){for(var g=s,m=0,_=p?X5(p,h):!1,E,S;m<o;)m in e&&(E=_?_(e[m],m,t):e[m],l>0&&H5(E)?(S=V5(E),g=eA(n,t,E,S,g,l-1)-1):(W5(g+1),n[g]=E),g++),m++;return g};nA.exports=eA});var lA=ot((Ntt,uA)=>{"use strict";var Y5=yi(),$5=mi(),iA=Ui(),Z5=X0(),J5=hc(),K5=L0(),oA=function(){},sA=J5("Reflect","construct"),sy=/^\\s*(?:class|function)\\b/,j5=Y5(sy.exec),Q5=!sy.test(oA),Zf=function(t){if(!iA(t))return!1;try{return sA(oA,[],t),!0}catch(e){return!1}},aA=function(t){if(!iA(t))return!1;switch(Z5(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Q5||!!j5(sy,K5(t))}catch(e){return!0}};aA.sham=!0;uA.exports=!sA||$5(function(){var n;return Zf(Zf.call)||!Zf(Object)||!Zf(function(){n=!0})||n})?aA:Zf});var pA=ot((Ott,hA)=>{"use strict";var cA=Yp(),tH=lA(),eH=Ys(),nH=Ns(),rH=nH("species"),fA=Array;hA.exports=function(n){var t;return cA(n)&&(t=n.constructor,tH(t)&&(t===fA||cA(t.prototype))?t=void 0:eH(t)&&(t=t[rH],t===null&&(t=void 0))),t===void 0?fA:t}});var gA=ot((Dtt,dA)=>{"use strict";var iH=pA();dA.exports=function(n,t){return new(iH(n))(t===0?0:t)}});var mA=ot(()=>{"use strict";var oH=Ds(),sH=rA(),aH=cc(),uH=kf(),lH=El(),cH=gA();oH({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=aH(this),o=uH(e),s=cH(e,0);return s.length=sH(s,e,e,o,0,t===void 0?1:lH(t)),s}})});var yA=ot(()=>{"use strict";var fH=S0();fH("flat")});var _A=ot((Gtt,vA)=>{var ay=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((t,e)=>t.priority-e.priority)}set(t,e){let o=Number(e);if(isNaN(o))throw new TypeError('"priority" must be a number');return this.keys.has(t)?this.queue.map(s=>(s.key===t&&Object.assign(s,{priority:o}),s)):(this.keys.add(t),this.queue.push({key:t,priority:o})),this.sort(),this.queue.length}next(){let t=this.queue.shift();return this.keys.delete(t.key),t}isEmpty(){return this.queue.length===0}has(t){return this.keys.has(t)}get(t){return this.queue.find(e=>e.key===t)}};vA.exports=ay});var wA=ot((ktt,EA)=>{function xA(n,t){let e=new Map;for(let[o,s]of n)o!==t&&s instanceof Map?e.set(o,xA(s,t)):o!==t&&e.set(o,s);return e}EA.exports=xA});var bA=ot((qtt,MA)=>{function hH(n){let t=Number(n);return!(isNaN(t)||t<=0)}function SA(n){let t=new Map;return Object.keys(n).forEach(o=>{let s=n[o];if(s!==null&&typeof s=="object"&&!Array.isArray(s))return t.set(o,SA(s));if(!hH(s))throw new Error(\`Could not add node at key "\${o}", make sure it's a valid node\`,s);return t.set(o,Number(s))}),t}MA.exports=SA});var CA=ot((Htt,TA)=>{function AA(n){if(!(n instanceof Map))throw new Error(\`Invalid graph: Expected Map instead found \${typeof n}\`);n.forEach((t,e)=>{if(typeof t=="object"&&t instanceof Map){AA(t);return}if(typeof t!="number"||t<=0)throw new Error(\`Values must be numbers greater than 0. Found value \${t} at \${e}\`)})}TA.exports=AA});var LA=ot((Vtt,RA)=>{var pH=_A(),dH=wA(),PA=bA(),IA=CA(),uy=class{constructor(t){t instanceof Map?(IA(t),this.graph=t):t?this.graph=PA(t):this.graph=new Map}addNode(t,e){let o;return e instanceof Map?(IA(e),o=e):o=PA(e),this.graph.set(t,o),this}addVertex(t,e){return this.addNode(t,e)}removeNode(t){return this.graph=dH(this.graph,t),this}path(t,e,o={}){if(!this.graph.size)return o.cost?{path:null,cost:0}:null;let s=new Set,l=new pH,p=new Map,h=[],g=0,m=[];if(o.avoid&&(m=[].concat(o.avoid)),m.includes(t))throw new Error(\`Starting node (\${t}) cannot be avoided\`);if(m.includes(e))throw new Error(\`Ending node (\${e}) cannot be avoided\`);for(l.set(t,0);!l.isEmpty();){let _=l.next();if(_.key===e){g=_.priority;let S=_.key;for(;p.has(S);)h.push(S),S=p.get(S);break}s.add(_.key),(this.graph.get(_.key)||new Map).forEach((S,b)=>{if(s.has(b)||m.includes(b))return null;if(!l.has(b))return p.set(b,_.key),l.set(b,_.priority+S);let A=l.get(b).priority,I=_.priority+S;return I<A?(p.set(b,_.key),l.set(b,I)):null})}return h.length?(o.trim?h.shift():h=h.concat([t]),o.reverse||(h=h.reverse()),o.cost?{path:h,cost:g}:h):o.cost?{path:null,cost:0}:null}shortestPath(...t){return this.path(...t)}};RA.exports=uy});var Xd=ot((net,CC)=>{"use strict";var TC=Object.getOwnPropertySymbols,AX=Object.prototype.hasOwnProperty,TX=Object.prototype.propertyIsEnumerable;function CX(n){if(n==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function PX(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[0]==="5")return!1;for(var t={},e=0;e<10;e++)t["_"+String.fromCharCode(e)]=e;var o=Object.getOwnPropertyNames(t).map(function(l){return t[l]});if(o.join("")!=="0123456789")return!1;var s={};return"abcdefghijklmnopqrst".split("").forEach(function(l){s[l]=l}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch(l){return!1}}CC.exports=PX()?Object.assign:function(n,t){for(var e,o=CX(n),s,l=1;l<arguments.length;l++){e=Object(arguments[l]);for(var p in e)AX.call(e,p)&&(o[p]=e[p]);if(TC){s=TC(e);for(var h=0;h<s.length;h++)TX.call(e,s[h])&&(o[s[h]]=e[s[h]])}}return o}});var qv=ot((Gv,kv)=>{(function(n,t){typeof Gv=="object"&&typeof kv!="undefined"?kv.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self).RBush=t()})(Gv,function(){"use strict";function n(w,x,R,C,F){(function V(X,q,D,xt,B){for(;xt>D;){if(xt-D>600){var j=xt-D+1,J=q-D+1,Dt=Math.log(j),Q=.5*Math.exp(2*Dt/3),At=.5*Math.sqrt(Dt*Q*(j-Q)/j)*(J-j/2<0?-1:1),Mt=Math.max(D,Math.floor(q-J*Q/j+At)),Lt=Math.min(xt,Math.floor(q+(j-J)*Q/j+At));V(X,q,Mt,Lt,B)}var pt=X[q],yt=D,K=xt;for(t(X,D,q),B(X[xt],pt)>0&&t(X,D,xt);yt<K;){for(t(X,yt,K),yt++,K--;B(X[yt],pt)<0;)yt++;for(;B(X[K],pt)>0;)K--}B(X[D],pt)===0?t(X,D,K):t(X,++K,xt),K<=q&&(D=K+1),q<=K&&(xt=K-1)}})(w,x,R||0,C||w.length-1,F||e)}function t(w,x,R){var C=w[x];w[x]=w[R],w[R]=C}function e(w,x){return w<x?-1:w>x?1:0}var o=function(w){w===void 0&&(w=9),this._maxEntries=Math.max(4,w),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function s(w,x,R){if(!R)return x.indexOf(w);for(var C=0;C<x.length;C++)if(R(w,x[C]))return C;return-1}function l(w,x){p(w,0,w.children.length,x,w)}function p(w,x,R,C,F){F||(F=A(null)),F.minX=1/0,F.minY=1/0,F.maxX=-1/0,F.maxY=-1/0;for(var V=x;V<R;V++){var X=w.children[V];h(F,w.leaf?C(X):X)}return F}function h(w,x){return w.minX=Math.min(w.minX,x.minX),w.minY=Math.min(w.minY,x.minY),w.maxX=Math.max(w.maxX,x.maxX),w.maxY=Math.max(w.maxY,x.maxY),w}function g(w,x){return w.minX-x.minX}function m(w,x){return w.minY-x.minY}function _(w){return(w.maxX-w.minX)*(w.maxY-w.minY)}function E(w){return w.maxX-w.minX+(w.maxY-w.minY)}function S(w,x){return w.minX<=x.minX&&w.minY<=x.minY&&x.maxX<=w.maxX&&x.maxY<=w.maxY}function b(w,x){return x.minX<=w.maxX&&x.minY<=w.maxY&&x.maxX>=w.minX&&x.maxY>=w.minY}function A(w){return{children:w,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function I(w,x,R,C,F){for(var V=[x,R];V.length;)if(!((R=V.pop())-(x=V.pop())<=C)){var X=x+Math.ceil((R-x)/C/2)*C;n(w,X,x,R,F),V.push(x,X,X,R)}}return o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(w){var x=this.data,R=[];if(!b(w,x))return R;for(var C=this.toBBox,F=[];x;){for(var V=0;V<x.children.length;V++){var X=x.children[V],q=x.leaf?C(X):X;b(w,q)&&(x.leaf?R.push(X):S(w,q)?this._all(X,R):F.push(X))}x=F.pop()}return R},o.prototype.collides=function(w){var x=this.data;if(!b(w,x))return!1;for(var R=[];x;){for(var C=0;C<x.children.length;C++){var F=x.children[C],V=x.leaf?this.toBBox(F):F;if(b(w,V)){if(x.leaf||S(w,V))return!0;R.push(F)}}x=R.pop()}return!1},o.prototype.load=function(w){if(!w||!w.length)return this;if(w.length<this._minEntries){for(var x=0;x<w.length;x++)this.insert(w[x]);return this}var R=this._build(w.slice(),0,w.length-1,0);if(this.data.children.length)if(this.data.height===R.height)this._splitRoot(this.data,R);else{if(this.data.height<R.height){var C=this.data;this.data=R,R=C}this._insert(R,this.data.height-R.height-1,!0)}else this.data=R;return this},o.prototype.insert=function(w){return w&&this._insert(w,this.data.height-1),this},o.prototype.clear=function(){return this.data=A([]),this},o.prototype.remove=function(w,x){if(!w)return this;for(var R,C,F,V=this.data,X=this.toBBox(w),q=[],D=[];V||q.length;){if(V||(V=q.pop(),C=q[q.length-1],R=D.pop(),F=!0),V.leaf){var xt=s(w,V.children,x);if(xt!==-1)return V.children.splice(xt,1),q.push(V),this._condense(q),this}F||V.leaf||!S(V,X)?C?(R++,V=C.children[R],F=!1):V=null:(q.push(V),D.push(R),R=0,C=V,V=V.children[0])}return this},o.prototype.toBBox=function(w){return w},o.prototype.compareMinX=function(w,x){return w.minX-x.minX},o.prototype.compareMinY=function(w,x){return w.minY-x.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(w){return this.data=w,this},o.prototype._all=function(w,x){for(var R=[];w;)w.leaf?x.push.apply(x,w.children):R.push.apply(R,w.children),w=R.pop();return x},o.prototype._build=function(w,x,R,C){var F,V=R-x+1,X=this._maxEntries;if(V<=X)return l(F=A(w.slice(x,R+1)),this.toBBox),F;C||(C=Math.ceil(Math.log(V)/Math.log(X)),X=Math.ceil(V/Math.pow(X,C-1))),(F=A([])).leaf=!1,F.height=C;var q=Math.ceil(V/X),D=q*Math.ceil(Math.sqrt(X));I(w,x,R,D,this.compareMinX);for(var xt=x;xt<=R;xt+=D){var B=Math.min(xt+D-1,R);I(w,xt,B,q,this.compareMinY);for(var j=xt;j<=B;j+=q){var J=Math.min(j+q-1,B);F.children.push(this._build(w,j,J,C-1))}}return l(F,this.toBBox),F},o.prototype._chooseSubtree=function(w,x,R,C){for(;C.push(x),!x.leaf&&C.length-1!==R;){for(var F=1/0,V=1/0,X=void 0,q=0;q<x.children.length;q++){var D=x.children[q],xt=_(D),B=(j=w,J=D,(Math.max(J.maxX,j.maxX)-Math.min(J.minX,j.minX))*(Math.max(J.maxY,j.maxY)-Math.min(J.minY,j.minY))-xt);B<V?(V=B,F=xt<F?xt:F,X=D):B===V&&xt<F&&(F=xt,X=D)}x=X||x.children[0]}var j,J;return x},o.prototype._insert=function(w,x,R){var C=R?w:this.toBBox(w),F=[],V=this._chooseSubtree(C,this.data,x,F);for(V.children.push(w),h(V,C);x>=0&&F[x].children.length>this._maxEntries;)this._split(F,x),x--;this._adjustParentBBoxes(C,F,x)},o.prototype._split=function(w,x){var R=w[x],C=R.children.length,F=this._minEntries;this._chooseSplitAxis(R,F,C);var V=this._chooseSplitIndex(R,F,C),X=A(R.children.splice(V,R.children.length-V));X.height=R.height,X.leaf=R.leaf,l(R,this.toBBox),l(X,this.toBBox),x?w[x-1].children.push(X):this._splitRoot(R,X)},o.prototype._splitRoot=function(w,x){this.data=A([w,x]),this.data.height=w.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(w,x,R){for(var C,F,V,X,q,D,xt,B=1/0,j=1/0,J=x;J<=R-x;J++){var Dt=p(w,0,J,this.toBBox),Q=p(w,J,R,this.toBBox),At=(F=Dt,V=Q,X=void 0,q=void 0,D=void 0,xt=void 0,X=Math.max(F.minX,V.minX),q=Math.max(F.minY,V.minY),D=Math.min(F.maxX,V.maxX),xt=Math.min(F.maxY,V.maxY),Math.max(0,D-X)*Math.max(0,xt-q)),Mt=_(Dt)+_(Q);At<B?(B=At,C=J,j=Mt<j?Mt:j):At===B&&Mt<j&&(j=Mt,C=J)}return C||R-x},o.prototype._chooseSplitAxis=function(w,x,R){var C=w.leaf?this.compareMinX:g,F=w.leaf?this.compareMinY:m;this._allDistMargin(w,x,R,C)<this._allDistMargin(w,x,R,F)&&w.children.sort(C)},o.prototype._allDistMargin=function(w,x,R,C){w.children.sort(C);for(var F=this.toBBox,V=p(w,0,x,F),X=p(w,R-x,R,F),q=E(V)+E(X),D=x;D<R-x;D++){var xt=w.children[D];h(V,w.leaf?F(xt):xt),q+=E(V)}for(var B=R-x-1;B>=x;B--){var j=w.children[B];h(X,w.leaf?F(j):j),q+=E(X)}return q},o.prototype._adjustParentBBoxes=function(w,x,R){for(var C=R;C>=0;C--)h(x[C],w)},o.prototype._condense=function(w){for(var x=w.length-1,R=void 0;x>=0;x--)w[x].children.length===0?x>0?(R=w[x-1].children).splice(R.indexOf(w[x]),1):this.clear():l(w[x],this.toBBox)},o})});var PC=ot((Hv,Vv)=>{(function(n,t){typeof Hv=="object"&&typeof Vv!="undefined"?Vv.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self,n.TinyQueue=t())})(Hv,function(){"use strict";var n=function(o,s){if(o===void 0&&(o=[]),s===void 0&&(s=t),this.data=o,this.length=this.data.length,this.compare=s,this.length>0)for(var l=(this.length>>1)-1;l>=0;l--)this._down(l)};n.prototype.push=function(o){this.data.push(o),this.length++,this._up(this.length-1)},n.prototype.pop=function(){if(this.length!==0){var o=this.data[0],s=this.data.pop();return this.length--,this.length>0&&(this.data[0]=s,this._down(0)),o}},n.prototype.peek=function(){return this.data[0]},n.prototype._up=function(o){for(var s=this,l=s.data,p=s.compare,h=l[o];o>0;){var g=o-1>>1,m=l[g];if(p(h,m)>=0)break;l[o]=m,o=g}l[o]=h},n.prototype._down=function(o){for(var s=this,l=s.data,p=s.compare,h=this.length>>1,g=l[o];o<h;){var m=(o<<1)+1,_=l[m],E=m+1;if(E<this.length&&p(l[E],_)<0&&(m=E,_=l[E]),p(_,g)>=0)break;l[o]=_,o=m}l[o]=g};function t(e,o){return e<o?-1:e>o?1:0}return n})});var RC=ot((uet,IC)=>{IC.exports=function(t,e,o,s){var l=t[0],p=t[1],h=!1;o===void 0&&(o=0),s===void 0&&(s=e.length);for(var g=(s-o)/2,m=0,_=g-1;m<g;_=m++){var E=e[o+m*2+0],S=e[o+m*2+1],b=e[o+_*2+0],A=e[o+_*2+1],I=S>p!=A>p&&l<(b-E)*(p-S)/(A-S)+E;I&&(h=!h)}return h}});var NC=ot((cet,LC)=>{LC.exports=function(t,e,o,s){var l=t[0],p=t[1],h=!1;o===void 0&&(o=0),s===void 0&&(s=e.length);for(var g=s-o,m=0,_=g-1;m<g;_=m++){var E=e[m+o][0],S=e[m+o][1],b=e[_+o][0],A=e[_+o][1],I=S>p!=A>p&&l<(b-E)*(p-S)/(A-S)+E;I&&(h=!h)}return h}});var FC=ot((fet,Zd)=>{var OC=RC(),DC=NC();Zd.exports=function(t,e,o,s){return e.length>0&&Array.isArray(e[0])?DC(t,e,o,s):OC(t,e,o,s)};Zd.exports.nested=DC;Zd.exports.flat=OC});var BC=ot((Jd,UC)=>{(function(n,t){typeof Jd=="object"&&typeof UC!="undefined"?t(Jd):typeof define=="function"&&define.amd?define(["exports"],t):t((n=n||self).predicates={})})(Jd,function(n){"use strict";let e=33306690738754706e-32;function o(b,A,I,w,x){let R,C,F,V,X=A[0],q=w[0],D=0,xt=0;q>X==q>-X?(R=X,X=A[++D]):(R=q,q=w[++xt]);let B=0;if(D<b&&xt<I)for(q>X==q>-X?(F=R-((C=X+R)-X),X=A[++D]):(F=R-((C=q+R)-q),q=w[++xt]),R=C,F!==0&&(x[B++]=F);D<b&&xt<I;)q>X==q>-X?(F=R-((C=R+X)-(V=C-R))+(X-V),X=A[++D]):(F=R-((C=R+q)-(V=C-R))+(q-V),q=w[++xt]),R=C,F!==0&&(x[B++]=F);for(;D<b;)F=R-((C=R+X)-(V=C-R))+(X-V),X=A[++D],R=C,F!==0&&(x[B++]=F);for(;xt<I;)F=R-((C=R+q)-(V=C-R))+(q-V),q=w[++xt],R=C,F!==0&&(x[B++]=F);return R===0&&B!==0||(x[B++]=R),B}function s(b){return new Float64Array(b)}let l=33306690738754716e-32,p=22204460492503146e-32,h=11093356479670487e-47,g=s(4),m=s(8),_=s(12),E=s(16),S=s(4);n.orient2d=function(b,A,I,w,x,R){let C=(A-R)*(I-x),F=(b-x)*(w-R),V=C-F;if(C===0||F===0||C>0!=F>0)return V;let X=Math.abs(C+F);return Math.abs(V)>=l*X?V:-function(q,D,xt,B,j,J,Dt){let Q,At,Mt,Lt,pt,yt,K,Bt,Gt,ae,ut,Ut,jt,ce,te,$t,qt,xe,ft=q-j,Xe=xt-j,ee=D-J,ge=B-J;pt=(te=(Bt=ft-(K=(yt=134217729*ft)-(yt-ft)))*(ae=ge-(Gt=(yt=134217729*ge)-(yt-ge)))-((ce=ft*ge)-K*Gt-Bt*Gt-K*ae))-(ut=te-(qt=(Bt=ee-(K=(yt=134217729*ee)-(yt-ee)))*(ae=Xe-(Gt=(yt=134217729*Xe)-(yt-Xe)))-(($t=ee*Xe)-K*Gt-Bt*Gt-K*ae))),g[0]=te-(ut+pt)+(pt-qt),pt=(jt=ce-((Ut=ce+ut)-(pt=Ut-ce))+(ut-pt))-(ut=jt-$t),g[1]=jt-(ut+pt)+(pt-$t),pt=(xe=Ut+ut)-Ut,g[2]=Ut-(xe-pt)+(ut-pt),g[3]=xe;let fe=function(tt,z){let It=z[0];for(let Ot=1;Ot<tt;Ot++)It+=z[Ot];return It}(4,g),Te=p*Dt;if(fe>=Te||-fe>=Te||(Q=q-(ft+(pt=q-ft))+(pt-j),Mt=xt-(Xe+(pt=xt-Xe))+(pt-j),At=D-(ee+(pt=D-ee))+(pt-J),Lt=B-(ge+(pt=B-ge))+(pt-J),Q===0&&At===0&&Mt===0&&Lt===0)||(Te=h*Dt+e*Math.abs(fe),(fe+=ft*Lt+ge*Q-(ee*Mt+Xe*At))>=Te||-fe>=Te))return fe;pt=(te=(Bt=Q-(K=(yt=134217729*Q)-(yt-Q)))*(ae=ge-(Gt=(yt=134217729*ge)-(yt-ge)))-((ce=Q*ge)-K*Gt-Bt*Gt-K*ae))-(ut=te-(qt=(Bt=At-(K=(yt=134217729*At)-(yt-At)))*(ae=Xe-(Gt=(yt=134217729*Xe)-(yt-Xe)))-(($t=At*Xe)-K*Gt-Bt*Gt-K*ae))),S[0]=te-(ut+pt)+(pt-qt),pt=(jt=ce-((Ut=ce+ut)-(pt=Ut-ce))+(ut-pt))-(ut=jt-$t),S[1]=jt-(ut+pt)+(pt-$t),pt=(xe=Ut+ut)-Ut,S[2]=Ut-(xe-pt)+(ut-pt),S[3]=xe;let be=o(4,g,4,S,m);pt=(te=(Bt=ft-(K=(yt=134217729*ft)-(yt-ft)))*(ae=Lt-(Gt=(yt=134217729*Lt)-(yt-Lt)))-((ce=ft*Lt)-K*Gt-Bt*Gt-K*ae))-(ut=te-(qt=(Bt=ee-(K=(yt=134217729*ee)-(yt-ee)))*(ae=Mt-(Gt=(yt=134217729*Mt)-(yt-Mt)))-(($t=ee*Mt)-K*Gt-Bt*Gt-K*ae))),S[0]=te-(ut+pt)+(pt-qt),pt=(jt=ce-((Ut=ce+ut)-(pt=Ut-ce))+(ut-pt))-(ut=jt-$t),S[1]=jt-(ut+pt)+(pt-$t),pt=(xe=Ut+ut)-Ut,S[2]=Ut-(xe-pt)+(ut-pt),S[3]=xe;let Wt=o(be,m,4,S,_);pt=(te=(Bt=Q-(K=(yt=134217729*Q)-(yt-Q)))*(ae=Lt-(Gt=(yt=134217729*Lt)-(yt-Lt)))-((ce=Q*Lt)-K*Gt-Bt*Gt-K*ae))-(ut=te-(qt=(Bt=At-(K=(yt=134217729*At)-(yt-At)))*(ae=Mt-(Gt=(yt=134217729*Mt)-(yt-Mt)))-(($t=At*Mt)-K*Gt-Bt*Gt-K*ae))),S[0]=te-(ut+pt)+(pt-qt),pt=(jt=ce-((Ut=ce+ut)-(pt=Ut-ce))+(ut-pt))-(ut=jt-$t),S[1]=jt-(ut+pt)+(pt-$t),pt=(xe=Ut+ut)-Ut,S[2]=Ut-(xe-pt)+(ut-pt),S[3]=xe;let Me=o(Wt,_,4,S,E);return E[Me-1]}(b,A,I,w,x,R,X)},n.orient2dfast=function(b,A,I,w,x,R){return(A-R)*(I-x)-(b-x)*(w-R)},Object.defineProperty(n,"__esModule",{value:!0})})});var VC=ot((het,$v)=>{"use strict";var zC=qv(),jd=PC(),RX=FC(),LX=BC().orient2d;jd.default&&(jd=jd.default);$v.exports=HC;$v.exports.default=HC;function HC(n,t,e){t=Math.max(0,t===void 0?2:t),e=e||0;var o=UX(n),s=new zC(16);s.toBBox=function(R){return{minX:R[0],minY:R[1],maxX:R[0],maxY:R[1]}},s.compareMinX=function(R,C){return R[0]-C[0]},s.compareMinY=function(R,C){return R[1]-C[1]},s.load(n);for(var l=[],p=0,h;p<o.length;p++){var g=o[p];s.remove(g),h=qC(g,h),l.push(h)}var m=new zC(16);for(p=0;p<l.length;p++)m.insert(Wv(l[p]));for(var _=t*t,E=e*e;l.length;){var S=l.shift(),b=S.p,A=S.next.p,I=Xv(b,A);if(!(I<E)){var w=I/_;g=NX(s,S.prev.p,b,A,S.next.next.p,w,m),g&&Math.min(Xv(g,b),Xv(g,A))<=w&&(l.push(S),l.push(qC(g,S)),s.remove(g),m.remove(S),m.insert(Wv(S)),m.insert(Wv(S.next)))}}S=h;var x=[];do x.push(S.p),S=S.next;while(S!==h);return x.push(S.p),x}function NX(n,t,e,o,s,l,p){for(var h=new jd([],OX),g=n.data;g;){for(var m=0;m<g.children.length;m++){var _=g.children[m],E=g.leaf?Yv(_,e,o):DX(e,o,_);E>l||h.push({node:_,dist:E})}for(;h.length&&!h.peek().node.children;){var S=h.pop(),b=S.node,A=Yv(b,t,e),I=Yv(b,o,s);if(S.dist<A&&S.dist<I&&kC(e,b,p)&&kC(o,b,p))return b}g=h.pop(),g&&(g=g.node)}return null}function OX(n,t){return n.dist-t.dist}function DX(n,t,e){if(GC(n,e)||GC(t,e))return 0;var o=Kd(n[0],n[1],t[0],t[1],e.minX,e.minY,e.maxX,e.minY);if(o===0)return 0;var s=Kd(n[0],n[1],t[0],t[1],e.minX,e.minY,e.minX,e.maxY);if(s===0)return 0;var l=Kd(n[0],n[1],t[0],t[1],e.maxX,e.minY,e.maxX,e.maxY);if(l===0)return 0;var p=Kd(n[0],n[1],t[0],t[1],e.minX,e.maxY,e.maxX,e.maxY);return p===0?0:Math.min(o,s,l,p)}function GC(n,t){return n[0]>=t.minX&&n[0]<=t.maxX&&n[1]>=t.minY&&n[1]<=t.maxY}function kC(n,t,e){for(var o=Math.min(n[0],t[0]),s=Math.min(n[1],t[1]),l=Math.max(n[0],t[0]),p=Math.max(n[1],t[1]),h=e.search({minX:o,minY:s,maxX:l,maxY:p}),g=0;g<h.length;g++)if(FX(h[g].p,h[g].next.p,n,t))return!1;return!0}function $c(n,t,e){return LX(n[0],n[1],t[0],t[1],e[0],e[1])}function FX(n,t,e,o){return n!==o&&t!==e&&$c(n,t,e)>0!=$c(n,t,o)>0&&$c(e,o,n)>0!=$c(e,o,t)>0}function Wv(n){var t=n.p,e=n.next.p;return n.minX=Math.min(t[0],e[0]),n.minY=Math.min(t[1],e[1]),n.maxX=Math.max(t[0],e[0]),n.maxY=Math.max(t[1],e[1]),n}function UX(n){for(var t=n[0],e=n[0],o=n[0],s=n[0],l=0;l<n.length;l++){var p=n[l];p[0]<t[0]&&(t=p),p[0]>o[0]&&(o=p),p[1]<e[1]&&(e=p),p[1]>s[1]&&(s=p)}var h=[t,e,o,s],g=h.slice();for(l=0;l<n.length;l++)RX(n[l],h)||g.push(n[l]);return zX(g)}function qC(n,t){var e={p:n,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return t?(e.next=t.next,e.prev=t,t.next.prev=e,t.next=e):(e.prev=e,e.next=e),e}function Xv(n,t){var e=n[0]-t[0],o=n[1]-t[1];return e*e+o*o}function Yv(n,t,e){var o=t[0],s=t[1],l=e[0]-o,p=e[1]-s;if(l!==0||p!==0){var h=((n[0]-o)*l+(n[1]-s)*p)/(l*l+p*p);h>1?(o=e[0],s=e[1]):h>0&&(o+=l*h,s+=p*h)}return l=n[0]-o,p=n[1]-s,l*l+p*p}function Kd(n,t,e,o,s,l,p,h){var g=e-n,m=o-t,_=p-s,E=h-l,S=n-s,b=t-l,A=g*g+m*m,I=g*_+m*E,w=_*_+E*E,x=g*S+m*b,R=_*S+E*b,C=A*w-I*I,F,V,X,q,D=C,xt=C;C===0?(V=0,D=1,q=R,xt=w):(V=I*R-w*x,q=A*R-I*x,V<0?(V=0,q=R,xt=w):V>D&&(V=D,q=R+I,xt=w)),q<0?(q=0,-x<0?V=0:-x>A?V=D:(V=-x,D=A)):q>xt&&(q=xt,-x+I<0?V=0:-x+I>A?V=D:(V=-x+I,D=A)),F=V===0?0:V/D,X=q===0?0:q/xt;var B=(1-F)*n+F*e,j=(1-F)*t+F*o,J=(1-X)*s+X*p,Dt=(1-X)*l+X*h,Q=J-B,At=Dt-j;return Q*Q+At*At}function BX(n,t){return n[0]===t[0]?n[1]-t[1]:n[0]-t[0]}function zX(n){n.sort(BX);for(var t=[],e=0;e<n.length;e++){for(;t.length>=2&&$c(t[t.length-2],t[t.length-1],n[e])<=0;)t.pop();t.push(n[e])}for(var o=[],s=n.length-1;s>=0;s--){for(;o.length>=2&&$c(o[o.length-2],o[o.length-1],n[s])<=0;)o.pop();o.push(n[s])}return o.pop(),t.pop(),t.concat(o)}});var JC=ot((Jv,Kv)=>{(function(n,t){typeof Jv=="object"&&typeof Kv!="undefined"?Kv.exports=t():typeof define=="function"&&define.amd?define(t):n.quickselect=t()})(Jv,function(){"use strict";function n(s,l,p,h,g){t(s,l,p||0,h||s.length-1,g||o)}function t(s,l,p,h,g){for(;h>p;){if(h-p>600){var m=h-p+1,_=l-p+1,E=Math.log(m),S=.5*Math.exp(2*E/3),b=.5*Math.sqrt(E*S*(m-S)/m)*(_-m/2<0?-1:1),A=Math.max(p,Math.floor(l-_*S/m+b)),I=Math.min(h,Math.floor(l+(m-_)*S/m+b));t(s,l,A,I,g)}var w=s[l],x=p,R=h;for(e(s,p,l),g(s[h],w)>0&&e(s,p,h);x<R;){for(e(s,x,R),x++,R--;g(s[x],w)<0;)x++;for(;g(s[R],w)>0;)R--}g(s[p],w)===0?e(s,p,R):(R++,e(s,R,h)),R<=l&&(p=R+1),l<=R&&(h=R-1)}}function e(s,l,p){var h=s[l];s[l]=s[p],s[p]=h}function o(s,l){return s<l?-1:s>l?1:0}return n})});var e_=ot((zrt,t_)=>{"use strict";t_.exports=fh;t_.exports.default=fh;var jX=JC();function fh(n,t){if(!(this instanceof fh))return new fh(n,t);this._maxEntries=Math.max(4,n||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),t&&this._initFormat(t),this.clear()}fh.prototype={all:function(){return this._all(this.data,[])},search:function(n){var t=this.data,e=[],o=this.toBBox;if(!tg(n,t))return e;for(var s=[],l,p,h,g;t;){for(l=0,p=t.children.length;l<p;l++)h=t.children[l],g=t.leaf?o(h):h,tg(n,g)&&(t.leaf?e.push(h):Qv(n,g)?this._all(h,e):s.push(h));t=s.pop()}return e},collides:function(n){var t=this.data,e=this.toBBox;if(!tg(n,t))return!1;for(var o=[],s,l,p,h;t;){for(s=0,l=t.children.length;s<l;s++)if(p=t.children[s],h=t.leaf?e(p):p,tg(n,h)){if(t.leaf||Qv(n,h))return!0;o.push(p)}t=o.pop()}return!1},load:function(n){if(!(n&&n.length))return this;if(n.length<this._minEntries){for(var t=0,e=n.length;t<e;t++)this.insert(n[t]);return this}var o=this._build(n.slice(),0,n.length-1,0);if(!this.data.children.length)this.data=o;else if(this.data.height===o.height)this._splitRoot(this.data,o);else{if(this.data.height<o.height){var s=this.data;this.data=o,o=s}this._insert(o,this.data.height-o.height-1,!0)}return this},insert:function(n){return n&&this._insert(n,this.data.height-1),this},clear:function(){return this.data=Kc([]),this},remove:function(n,t){if(!n)return this;for(var e=this.data,o=this.toBBox(n),s=[],l=[],p,h,g,m;e||s.length;){if(e||(e=s.pop(),h=s[s.length-1],p=l.pop(),m=!0),e.leaf&&(g=QX(n,e.children,t),g!==-1))return e.children.splice(g,1),s.push(e),this._condense(s),this;!m&&!e.leaf&&Qv(e,o)?(s.push(e),l.push(p),p=0,h=e,e=e.children[0]):h?(p++,e=h.children[p],m=!1):e=null}return this},toBBox:function(n){return n},compareMinX:KC,compareMinY:jC,toJSON:function(){return this.data},fromJSON:function(n){return this.data=n,this},_all:function(n,t){for(var e=[];n;)n.leaf?t.push.apply(t,n.children):e.push.apply(e,n.children),n=e.pop();return t},_build:function(n,t,e,o){var s=e-t+1,l=this._maxEntries,p;if(s<=l)return p=Kc(n.slice(t,e+1)),Jc(p,this.toBBox),p;o||(o=Math.ceil(Math.log(s)/Math.log(l)),l=Math.ceil(s/Math.pow(l,o-1))),p=Kc([]),p.leaf=!1,p.height=o;var h=Math.ceil(s/l),g=h*Math.ceil(Math.sqrt(l)),m,_,E,S;for(QC(n,t,e,g,this.compareMinX),m=t;m<=e;m+=g)for(E=Math.min(m+g-1,e),QC(n,m,E,h,this.compareMinY),_=m;_<=E;_+=h)S=Math.min(_+h-1,E),p.children.push(this._build(n,_,S,o-1));return Jc(p,this.toBBox),p},_chooseSubtree:function(n,t,e,o){for(var s,l,p,h,g,m,_,E;o.push(t),!(t.leaf||o.length-1===e);){for(_=E=1/0,s=0,l=t.children.length;s<l;s++)p=t.children[s],g=jv(p),m=t7(n,p)-g,m<E?(E=m,_=g<_?g:_,h=p):m===E&&g<_&&(_=g,h=p);t=h||t.children[0]}return t},_insert:function(n,t,e){var o=this.toBBox,s=e?n:o(n),l=[],p=this._chooseSubtree(s,this.data,t,l);for(p.children.push(n),ch(p,s);t>=0&&l[t].children.length>this._maxEntries;)this._split(l,t),t--;this._adjustParentBBoxes(s,l,t)},_split:function(n,t){var e=n[t],o=e.children.length,s=this._minEntries;this._chooseSplitAxis(e,s,o);var l=this._chooseSplitIndex(e,s,o),p=Kc(e.children.splice(l,e.children.length-l));p.height=e.height,p.leaf=e.leaf,Jc(e,this.toBBox),Jc(p,this.toBBox),t?n[t-1].children.push(p):this._splitRoot(e,p)},_splitRoot:function(n,t){this.data=Kc([n,t]),this.data.height=n.height+1,this.data.leaf=!1,Jc(this.data,this.toBBox)},_chooseSplitIndex:function(n,t,e){var o,s,l,p,h,g,m,_;for(g=m=1/0,o=t;o<=e-t;o++)s=lh(n,0,o,this.toBBox),l=lh(n,o,e,this.toBBox),p=e7(s,l),h=jv(s)+jv(l),p<g?(g=p,_=o,m=h<m?h:m):p===g&&h<m&&(m=h,_=o);return _},_chooseSplitAxis:function(n,t,e){var o=n.leaf?this.compareMinX:KC,s=n.leaf?this.compareMinY:jC,l=this._allDistMargin(n,t,e,o),p=this._allDistMargin(n,t,e,s);l<p&&n.children.sort(o)},_allDistMargin:function(n,t,e,o){n.children.sort(o);var s=this.toBBox,l=lh(n,0,t,s),p=lh(n,e-t,e,s),h=Qd(l)+Qd(p),g,m;for(g=t;g<e-t;g++)m=n.children[g],ch(l,n.leaf?s(m):m),h+=Qd(l);for(g=e-t-1;g>=t;g--)m=n.children[g],ch(p,n.leaf?s(m):m),h+=Qd(p);return h},_adjustParentBBoxes:function(n,t,e){for(var o=e;o>=0;o--)ch(t[o],n)},_condense:function(n){for(var t=n.length-1,e;t>=0;t--)n[t].children.length===0?t>0?(e=n[t-1].children,e.splice(e.indexOf(n[t]),1)):this.clear():Jc(n[t],this.toBBox)},_initFormat:function(n){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(n[0])),this.compareMinY=new Function("a","b",t.join(n[1])),this.toBBox=new Function("a","return {minX: a"+n[0]+", minY: a"+n[1]+", maxX: a"+n[2]+", maxY: a"+n[3]+"};")}};function QX(n,t,e){if(!e)return t.indexOf(n);for(var o=0;o<t.length;o++)if(e(n,t[o]))return o;return-1}function Jc(n,t){lh(n,0,n.children.length,t,n)}function lh(n,t,e,o,s){s||(s=Kc(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(var l=t,p;l<e;l++)p=n.children[l],ch(s,n.leaf?o(p):p);return s}function ch(n,t){return n.minX=Math.min(n.minX,t.minX),n.minY=Math.min(n.minY,t.minY),n.maxX=Math.max(n.maxX,t.maxX),n.maxY=Math.max(n.maxY,t.maxY),n}function KC(n,t){return n.minX-t.minX}function jC(n,t){return n.minY-t.minY}function jv(n){return(n.maxX-n.minX)*(n.maxY-n.minY)}function Qd(n){return n.maxX-n.minX+(n.maxY-n.minY)}function t7(n,t){return(Math.max(t.maxX,n.maxX)-Math.min(t.minX,n.minX))*(Math.max(t.maxY,n.maxY)-Math.min(t.minY,n.minY))}function e7(n,t){var e=Math.max(n.minX,t.minX),o=Math.max(n.minY,t.minY),s=Math.min(n.maxX,t.maxX),l=Math.min(n.maxY,t.maxY);return Math.max(0,s-e)*Math.max(0,l-o)}function Qv(n,t){return n.minX<=t.minX&&n.minY<=t.minY&&t.maxX<=n.maxX&&t.maxY<=n.maxY}function tg(n,t){return t.minX<=n.maxX&&t.minY<=n.maxY&&t.maxX>=n.minX&&t.maxY>=n.minY}function Kc(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function QC(n,t,e,o,s){for(var l=[t,e],p;l.length;)e=l.pop(),t=l.pop(),!(e-t<=o)&&(p=t+Math.ceil((e-t)/o/2)*o,jX(n,p,t,e,s),l.push(t,p,p,e))}});var oP=ot((jit,a_)=>{"use strict";a_.exports=ig;a_.exports.default=ig;function ig(n,t,e){e=e||2;var o=t&&t.length,s=o?t[0]*e:n.length,l=nP(n,0,s,e,!0),p=[];if(!l||l.next===l.prev)return p;var h,g,m,_,E,S,b;if(o&&(l=f7(n,t,l,e)),n.length>80*e){h=m=n[0],g=_=n[1];for(var A=e;A<s;A+=e)E=n[A],S=n[A+1],E<h&&(h=E),S<g&&(g=S),E>m&&(m=E),S>_&&(_=S);b=Math.max(m-h,_-g),b=b!==0?32767/b:0}return dh(l,p,e,h,g,b,0),p}function nP(n,t,e,o,s){var l,p;if(s===s_(n,t,e,o)>0)for(l=t;l<e;l+=o)p=eP(l,n[l],n[l+1],p);else for(l=e-o;l>=t;l-=o)p=eP(l,n[l],n[l+1],p);return p&&og(p,p.next)&&(mh(p),p=p.next),p}function kl(n,t){if(!n)return n;t||(t=n);var e=n,o;do if(o=!1,!e.steiner&&(og(e,e.next)||Hr(e.prev,e,e.next)===0)){if(mh(e),e=t=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==t);return t}function dh(n,t,e,o,s,l,p){if(n){!p&&l&&m7(n,o,s,l);for(var h=n,g,m;n.prev!==n.next;){if(g=n.prev,m=n.next,l?u7(n,o,s,l):a7(n)){t.push(g.i/e|0),t.push(n.i/e|0),t.push(m.i/e|0),mh(n),n=m.next,h=m.next;continue}if(n=m,n===h){p?p===1?(n=l7(kl(n),t,e),dh(n,t,e,o,s,l,2)):p===2&&c7(n,t,e,o,s,l):dh(kl(n),t,e,o,s,l,1);break}}}}function a7(n){var t=n.prev,e=n,o=n.next;if(Hr(t,e,o)>=0)return!1;for(var s=t.x,l=e.x,p=o.x,h=t.y,g=e.y,m=o.y,_=s<l?s<p?s:p:l<p?l:p,E=h<g?h<m?h:m:g<m?g:m,S=s>l?s>p?s:p:l>p?l:p,b=h>g?h>m?h:m:g>m?g:m,A=o.next;A!==t;){if(A.x>=_&&A.x<=S&&A.y>=E&&A.y<=b&&tf(s,h,l,g,p,m,A.x,A.y)&&Hr(A.prev,A,A.next)>=0)return!1;A=A.next}return!0}function u7(n,t,e,o){var s=n.prev,l=n,p=n.next;if(Hr(s,l,p)>=0)return!1;for(var h=s.x,g=l.x,m=p.x,_=s.y,E=l.y,S=p.y,b=h<g?h<m?h:m:g<m?g:m,A=_<E?_<S?_:S:E<S?E:S,I=h>g?h>m?h:m:g>m?g:m,w=_>E?_>S?_:S:E>S?E:S,x=i_(b,A,t,e,o),R=i_(I,w,t,e,o),C=n.prevZ,F=n.nextZ;C&&C.z>=x&&F&&F.z<=R;){if(C.x>=b&&C.x<=I&&C.y>=A&&C.y<=w&&C!==s&&C!==p&&tf(h,_,g,E,m,S,C.x,C.y)&&Hr(C.prev,C,C.next)>=0||(C=C.prevZ,F.x>=b&&F.x<=I&&F.y>=A&&F.y<=w&&F!==s&&F!==p&&tf(h,_,g,E,m,S,F.x,F.y)&&Hr(F.prev,F,F.next)>=0))return!1;F=F.nextZ}for(;C&&C.z>=x;){if(C.x>=b&&C.x<=I&&C.y>=A&&C.y<=w&&C!==s&&C!==p&&tf(h,_,g,E,m,S,C.x,C.y)&&Hr(C.prev,C,C.next)>=0)return!1;C=C.prevZ}for(;F&&F.z<=R;){if(F.x>=b&&F.x<=I&&F.y>=A&&F.y<=w&&F!==s&&F!==p&&tf(h,_,g,E,m,S,F.x,F.y)&&Hr(F.prev,F,F.next)>=0)return!1;F=F.nextZ}return!0}function l7(n,t,e){var o=n;do{var s=o.prev,l=o.next.next;!og(s,l)&&rP(s,o,o.next,l)&&gh(s,l)&&gh(l,s)&&(t.push(s.i/e|0),t.push(o.i/e|0),t.push(l.i/e|0),mh(o),mh(o.next),o=n=l),o=o.next}while(o!==n);return kl(o)}function c7(n,t,e,o,s,l){var p=n;do{for(var h=p.next.next;h!==p.prev;){if(p.i!==h.i&&_7(p,h)){var g=iP(p,h);p=kl(p,p.next),g=kl(g,g.next),dh(p,t,e,o,s,l,0),dh(g,t,e,o,s,l,0);return}h=h.next}p=p.next}while(p!==n)}function f7(n,t,e,o){var s=[],l,p,h,g,m;for(l=0,p=t.length;l<p;l++)h=t[l]*o,g=l<p-1?t[l+1]*o:n.length,m=nP(n,h,g,o,!1),m===m.next&&(m.steiner=!0),s.push(v7(m));for(s.sort(h7),l=0;l<s.length;l++)e=p7(s[l],e);return e}function h7(n,t){return n.x-t.x}function p7(n,t){var e=d7(n,t);if(!e)return t;var o=iP(e,n);return kl(o,o.next),kl(e,e.next)}function d7(n,t){var e=t,o=n.x,s=n.y,l=-1/0,p;do{if(s<=e.y&&s>=e.next.y&&e.next.y!==e.y){var h=e.x+(s-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(h<=o&&h>l&&(l=h,p=e.x<e.next.x?e:e.next,h===o))return p}e=e.next}while(e!==t);if(!p)return null;var g=p,m=p.x,_=p.y,E=1/0,S;e=p;do o>=e.x&&e.x>=m&&o!==e.x&&tf(s<_?o:l,s,m,_,s<_?l:o,s,e.x,e.y)&&(S=Math.abs(s-e.y)/(o-e.x),gh(e,n)&&(S<E||S===E&&(e.x>p.x||e.x===p.x&&g7(p,e)))&&(p=e,E=S)),e=e.next;while(e!==g);return p}function g7(n,t){return Hr(n.prev,n,t.prev)<0&&Hr(t.next,n,n.next)<0}function m7(n,t,e,o){var s=n;do s.z===0&&(s.z=i_(s.x,s.y,t,e,o)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==n);s.prevZ.nextZ=null,s.prevZ=null,y7(s)}function y7(n){var t,e,o,s,l,p,h,g,m=1;do{for(e=n,n=null,l=null,p=0;e;){for(p++,o=e,h=0,t=0;t<m&&(h++,o=o.nextZ,!!o);t++);for(g=m;h>0||g>0&&o;)h!==0&&(g===0||!o||e.z<=o.z)?(s=e,e=e.nextZ,h--):(s=o,o=o.nextZ,g--),l?l.nextZ=s:n=s,s.prevZ=l,l=s;e=o}l.nextZ=null,m*=2}while(p>1);return n}function i_(n,t,e,o,s){return n=(n-e)*s|0,t=(t-o)*s|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n|t<<1}function v7(n){var t=n,e=n;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==n);return e}function tf(n,t,e,o,s,l,p,h){return(s-p)*(t-h)>=(n-p)*(l-h)&&(n-p)*(o-h)>=(e-p)*(t-h)&&(e-p)*(l-h)>=(s-p)*(o-h)}function _7(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!x7(n,t)&&(gh(n,t)&&gh(t,n)&&E7(n,t)&&(Hr(n.prev,n,t.prev)||Hr(n,t.prev,t))||og(n,t)&&Hr(n.prev,n,n.next)>0&&Hr(t.prev,t,t.next)>0)}function Hr(n,t,e){return(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y)}function og(n,t){return n.x===t.x&&n.y===t.y}function rP(n,t,e,o){var s=rg(Hr(n,t,e)),l=rg(Hr(n,t,o)),p=rg(Hr(e,o,n)),h=rg(Hr(e,o,t));return!!(s!==l&&p!==h||s===0&&ng(n,e,t)||l===0&&ng(n,o,t)||p===0&&ng(e,n,o)||h===0&&ng(e,t,o))}function ng(n,t,e){return t.x<=Math.max(n.x,e.x)&&t.x>=Math.min(n.x,e.x)&&t.y<=Math.max(n.y,e.y)&&t.y>=Math.min(n.y,e.y)}function rg(n){return n>0?1:n<0?-1:0}function x7(n,t){var e=n;do{if(e.i!==n.i&&e.next.i!==n.i&&e.i!==t.i&&e.next.i!==t.i&&rP(e,e.next,n,t))return!0;e=e.next}while(e!==n);return!1}function gh(n,t){return Hr(n.prev,n,n.next)<0?Hr(n,t,n.next)>=0&&Hr(n,n.prev,t)>=0:Hr(n,t,n.prev)<0||Hr(n,n.next,t)<0}function E7(n,t){var e=n,o=!1,s=(n.x+t.x)/2,l=(n.y+t.y)/2;do e.y>l!=e.next.y>l&&e.next.y!==e.y&&s<(e.next.x-e.x)*(l-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==n);return o}function iP(n,t){var e=new o_(n.i,n.x,n.y),o=new o_(t.i,t.x,t.y),s=n.next,l=t.prev;return n.next=t,t.prev=n,e.next=s,s.prev=e,o.next=e,e.prev=o,l.next=o,o.prev=l,o}function eP(n,t,e,o){var s=new o_(n,t,e);return o?(s.next=o.next,s.prev=o,o.next.prev=s,o.next=s):(s.prev=s,s.next=s),s}function mh(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function o_(n,t,e){this.i=n,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}ig.deviation=function(n,t,e,o){var s=t&&t.length,l=s?t[0]*e:n.length,p=Math.abs(s_(n,0,l,e));if(s)for(var h=0,g=t.length;h<g;h++){var m=t[h]*e,_=h<g-1?t[h+1]*e:n.length;p-=Math.abs(s_(n,m,_,e))}var E=0;for(h=0;h<o.length;h+=3){var S=o[h]*e,b=o[h+1]*e,A=o[h+2]*e;E+=Math.abs((n[S]-n[A])*(n[b+1]-n[S+1])-(n[S]-n[b])*(n[A+1]-n[S+1]))}return p===0&&E===0?0:Math.abs((E-p)/p)};function s_(n,t,e,o){for(var s=0,l=t,p=e-o;l<e;l+=o)s+=(n[p]-n[l])*(n[l+1]+n[p+1]),p=l;return s}ig.flatten=function(n){for(var t=n[0][0].length,e={vertices:[],holes:[],dimensions:t},o=0,s=0;s<n.length;s++){for(var l=0;l<n[s].length;l++)for(var p=0;p<t;p++)e.vertices.push(n[s][l][p]);s>0&&(o+=n[s-1].length,e.holes.push(o))}return e}});var h_=ot(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.earthRadius=63710088e-1;Oe.factors={centimeters:Oe.earthRadius*100,centimetres:Oe.earthRadius*100,degrees:Oe.earthRadius/111325,feet:Oe.earthRadius*3.28084,inches:Oe.earthRadius*39.37,kilometers:Oe.earthRadius/1e3,kilometres:Oe.earthRadius/1e3,meters:Oe.earthRadius,metres:Oe.earthRadius,miles:Oe.earthRadius/1609.344,millimeters:Oe.earthRadius*1e3,millimetres:Oe.earthRadius*1e3,nauticalmiles:Oe.earthRadius/1852,radians:1,yards:Oe.earthRadius*1.0936};Oe.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/Oe.earthRadius,yards:1.0936133};Oe.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function nl(n,t,e){e===void 0&&(e={});var o={type:"Feature"};return(e.id===0||e.id)&&(o.id=e.id),e.bbox&&(o.bbox=e.bbox),o.properties=t||{},o.geometry=n,o}Oe.feature=nl;function S7(n,t,e){switch(e===void 0&&(e={}),n){case"Point":return u_(t).geometry;case"LineString":return c_(t).geometry;case"Polygon":return l_(t).geometry;case"MultiPoint":return aP(t).geometry;case"MultiLineString":return sP(t).geometry;case"MultiPolygon":return uP(t).geometry;default:throw new Error(n+" is invalid")}}Oe.geometry=S7;function u_(n,t,e){if(e===void 0&&(e={}),!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!sg(n[0])||!sg(n[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:n};return nl(o,t,e)}Oe.point=u_;function M7(n,t,e){return e===void 0&&(e={}),ag(n.map(function(o){return u_(o,t)}),e)}Oe.points=M7;function l_(n,t,e){e===void 0&&(e={});for(var o=0,s=n;o<s.length;o++){var l=s[o];if(l.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var p=0;p<l[l.length-1].length;p++)if(l[l.length-1][p]!==l[0][p])throw new Error("First and last Position are not equivalent.")}var h={type:"Polygon",coordinates:n};return nl(h,t,e)}Oe.polygon=l_;function b7(n,t,e){return e===void 0&&(e={}),ag(n.map(function(o){return l_(o,t)}),e)}Oe.polygons=b7;function c_(n,t,e){if(e===void 0&&(e={}),n.length<2)throw new Error("coordinates must be an array of two or more positions");var o={type:"LineString",coordinates:n};return nl(o,t,e)}Oe.lineString=c_;function A7(n,t,e){return e===void 0&&(e={}),ag(n.map(function(o){return c_(o,t)}),e)}Oe.lineStrings=A7;function ag(n,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=n,e}Oe.featureCollection=ag;function sP(n,t,e){e===void 0&&(e={});var o={type:"MultiLineString",coordinates:n};return nl(o,t,e)}Oe.multiLineString=sP;function aP(n,t,e){e===void 0&&(e={});var o={type:"MultiPoint",coordinates:n};return nl(o,t,e)}Oe.multiPoint=aP;function uP(n,t,e){e===void 0&&(e={});var o={type:"MultiPolygon",coordinates:n};return nl(o,t,e)}Oe.multiPolygon=uP;function T7(n,t,e){e===void 0&&(e={});var o={type:"GeometryCollection",geometries:n};return nl(o,t,e)}Oe.geometryCollection=T7;function C7(n,t){if(t===void 0&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,t||0);return Math.round(n*e)/e}Oe.round=C7;function lP(n,t){t===void 0&&(t="kilometers");var e=Oe.factors[t];if(!e)throw new Error(t+" units is invalid");return n*e}Oe.radiansToLength=lP;function f_(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=f_;function P7(n,t){return cP(f_(n,t))}Oe.lengthToDegrees=P7;function I7(n){var t=n%360;return t<0&&(t+=360),t}Oe.bearingToAzimuth=I7;function cP(n){var t=n%(2*Math.PI);return t*180/Math.PI}Oe.radiansToDegrees=cP;function R7(n){var t=n%360;return t*Math.PI/180}Oe.degreesToRadians=R7;function L7(n,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(n>=0))throw new Error("length must be a positive number");return lP(f_(n,t),e)}Oe.convertLength=L7;function N7(n,t,e){if(t===void 0&&(t="meters"),e===void 0&&(e="kilometers"),!(n>=0))throw new Error("area must be a positive number");var o=Oe.areaFactors[t];if(!o)throw new Error("invalid original units");var s=Oe.areaFactors[e];if(!s)throw new Error("invalid final units");return n/o*s}Oe.convertArea=N7;function sg(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}Oe.isNumber=sg;function O7(n){return!!n&&n.constructor===Object}Oe.isObject=O7;function D7(n){if(!n)throw new Error("bbox is required");if(!Array.isArray(n))throw new Error("bbox must be an Array");if(n.length!==4&&n.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");n.forEach(function(t){if(!sg(t))throw new Error("bbox must only contain numbers")})}Oe.validateBBox=D7;function F7(n){if(!n)throw new Error("id is required");if(["string","number"].indexOf(typeof n)===-1)throw new Error("id must be a number or a string")}Oe.validateId=F7});var d_=ot(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});var co=h_();function yh(n,t,e){if(n!==null)for(var o,s,l,p,h,g,m,_=0,E=0,S,b=n.type,A=b==="FeatureCollection",I=b==="Feature",w=A?n.features.length:1,x=0;x<w;x++){m=A?n.features[x].geometry:I?n.geometry:n,S=m?m.type==="GeometryCollection":!1,h=S?m.geometries.length:1;for(var R=0;R<h;R++){var C=0,F=0;if(p=S?m.geometries[R]:m,p!==null){g=p.coordinates;var V=p.type;switch(_=e&&(V==="Polygon"||V==="MultiPolygon")?1:0,V){case null:break;case"Point":if(t(g,E,x,C,F)===!1)return!1;E++,C++;break;case"LineString":case"MultiPoint":for(o=0;o<g.length;o++){if(t(g[o],E,x,C,F)===!1)return!1;E++,V==="MultiPoint"&&C++}V==="LineString"&&C++;break;case"Polygon":case"MultiLineString":for(o=0;o<g.length;o++){for(s=0;s<g[o].length-_;s++){if(t(g[o][s],E,x,C,F)===!1)return!1;E++}V==="MultiLineString"&&C++,V==="Polygon"&&F++}V==="Polygon"&&C++;break;case"MultiPolygon":for(o=0;o<g.length;o++){for(F=0,s=0;s<g[o].length;s++){for(l=0;l<g[o][s].length-_;l++){if(t(g[o][s][l],E,x,C,F)===!1)return!1;E++}F++}C++}break;case"GeometryCollection":for(o=0;o<p.geometries.length;o++)if(yh(p.geometries[o],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function U7(n,t,e,o){var s=e;return yh(n,function(l,p,h,g,m){p===0&&e===void 0?s=l:s=t(s,l,p,h,g,m)},o),s}function fP(n,t){var e;switch(n.type){case"FeatureCollection":for(e=0;e<n.features.length&&t(n.features[e].properties,e)!==!1;e++);break;case"Feature":t(n.properties,0);break}}function B7(n,t,e){var o=e;return fP(n,function(s,l){l===0&&e===void 0?o=s:o=t(o,s,l)}),o}function hP(n,t){if(n.type==="Feature")t(n,0);else if(n.type==="FeatureCollection")for(var e=0;e<n.features.length&&t(n.features[e],e)!==!1;e++);}function z7(n,t,e){var o=e;return hP(n,function(s,l){l===0&&e===void 0?o=s:o=t(o,s,l)}),o}function G7(n){var t=[];return yh(n,function(e){t.push(e)}),t}function p_(n,t){var e,o,s,l,p,h,g,m,_,E,S=0,b=n.type==="FeatureCollection",A=n.type==="Feature",I=b?n.features.length:1;for(e=0;e<I;e++){for(h=b?n.features[e].geometry:A?n.geometry:n,m=b?n.features[e].properties:A?n.properties:{},_=b?n.features[e].bbox:A?n.bbox:void 0,E=b?n.features[e].id:A?n.id:void 0,g=h?h.type==="GeometryCollection":!1,p=g?h.geometries.length:1,s=0;s<p;s++){if(l=g?h.geometries[s]:h,l===null){if(t(null,S,m,_,E)===!1)return!1;continue}switch(l.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(l,S,m,_,E)===!1)return!1;break}case"GeometryCollection":{for(o=0;o<l.geometries.length;o++)if(t(l.geometries[o],S,m,_,E)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}S++}}function k7(n,t,e){var o=e;return p_(n,function(s,l,p,h,g){l===0&&e===void 0?o=s:o=t(o,s,l,p,h,g)}),o}function ug(n,t){p_(n,function(e,o,s,l,p){var h=e===null?null:e.type;switch(h){case null:case"Point":case"LineString":case"Polygon":return t(co.feature(e,s,{bbox:l,id:p}),o,0)===!1?!1:void 0}var g;switch(h){case"MultiPoint":g="Point";break;case"MultiLineString":g="LineString";break;case"MultiPolygon":g="Polygon";break}for(var m=0;m<e.coordinates.length;m++){var _=e.coordinates[m],E={type:g,coordinates:_};if(t(co.feature(E,s),o,m)===!1)return!1}})}function q7(n,t,e){var o=e;return ug(n,function(s,l,p){l===0&&p===0&&e===void 0?o=s:o=t(o,s,l,p)}),o}function pP(n,t){ug(n,function(e,o,s){var l=0;if(e.geometry){var p=e.geometry.type;if(!(p==="Point"||p==="MultiPoint")){var h,g=0,m=0,_=0;if(yh(e,function(E,S,b,A,I){if(h===void 0||o>g||A>m||I>_){h=E,g=o,m=A,_=I,l=0;return}var w=co.lineString([h,E],e.properties);if(t(w,o,s,I,l)===!1)return!1;l++,h=E})===!1)return!1}}})}function H7(n,t,e){var o=e,s=!1;return pP(n,function(l,p,h,g,m){s===!1&&e===void 0?o=l:o=t(o,l,p,h,g,m),s=!0}),o}function dP(n,t){if(!n)throw new Error("geojson is required");ug(n,function(e,o,s){if(e.geometry!==null){var l=e.geometry.type,p=e.geometry.coordinates;switch(l){case"LineString":if(t(e,o,s,0,0)===!1)return!1;break;case"Polygon":for(var h=0;h<p.length;h++)if(t(co.lineString(p[h],e.properties),o,s,h)===!1)return!1;break}}})}function V7(n,t,e){var o=e;return dP(n,function(s,l,p,h){l===0&&e===void 0?o=s:o=t(o,s,l,p,h)}),o}function W7(n,t){if(t=t||{},!co.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,s=t.geometryIndex||0,l=t.segmentIndex||0,p=t.properties,h;switch(n.type){case"FeatureCollection":e<0&&(e=n.features.length+e),p=p||n.features[e].properties,h=n.features[e].geometry;break;case"Feature":p=p||n.properties,h=n.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":h=n;break;default:throw new Error("geojson is invalid")}if(h===null)return null;var g=h.coordinates;switch(h.type){case"Point":case"MultiPoint":return null;case"LineString":return l<0&&(l=g.length+l-1),co.lineString([g[l],g[l+1]],p,t);case"Polygon":return s<0&&(s=g.length+s),l<0&&(l=g[s].length+l-1),co.lineString([g[s][l],g[s][l+1]],p,t);case"MultiLineString":return o<0&&(o=g.length+o),l<0&&(l=g[o].length+l-1),co.lineString([g[o][l],g[o][l+1]],p,t);case"MultiPolygon":return o<0&&(o=g.length+o),s<0&&(s=g[o].length+s),l<0&&(l=g[o][s].length-l-1),co.lineString([g[o][s][l],g[o][s][l+1]],p,t)}throw new Error("geojson is invalid")}function X7(n,t){if(t=t||{},!co.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,s=t.geometryIndex||0,l=t.coordIndex||0,p=t.properties,h;switch(n.type){case"FeatureCollection":e<0&&(e=n.features.length+e),p=p||n.features[e].properties,h=n.features[e].geometry;break;case"Feature":p=p||n.properties,h=n.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":h=n;break;default:throw new Error("geojson is invalid")}if(h===null)return null;var g=h.coordinates;switch(h.type){case"Point":return co.point(g,p,t);case"MultiPoint":return o<0&&(o=g.length+o),co.point(g[o],p,t);case"LineString":return l<0&&(l=g.length+l),co.point(g[l],p,t);case"Polygon":return s<0&&(s=g.length+s),l<0&&(l=g[s].length+l),co.point(g[s][l],p,t);case"MultiLineString":return o<0&&(o=g.length+o),l<0&&(l=g[o].length+l),co.point(g[o][l],p,t);case"MultiPolygon":return o<0&&(o=g.length+o),s<0&&(s=g[o].length+s),l<0&&(l=g[o][s].length-l),co.point(g[o][s][l],p,t)}throw new Error("geojson is invalid")}Si.coordAll=G7;Si.coordEach=yh;Si.coordReduce=U7;Si.featureEach=hP;Si.featureReduce=z7;Si.findPoint=X7;Si.findSegment=W7;Si.flattenEach=ug;Si.flattenReduce=q7;Si.geomEach=p_;Si.geomReduce=k7;Si.lineEach=dP;Si.lineReduce=V7;Si.propEach=fP;Si.propReduce=B7;Si.segmentEach=pP;Si.segmentReduce=H7});var gP=ot(m_=>{"use strict";Object.defineProperty(m_,"__esModule",{value:!0});var Y7=d_();function g_(n){var t=[1/0,1/0,-1/0,-1/0];return Y7.coordEach(n,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}g_.default=g_;m_.default=g_});var lg=ot((dot,y_)=>{var Ra=qv(),yP=h_(),vP=d_(),ef=gP().default,$7=vP.featureEach,hot=vP.coordEach,pot=yP.polygon,mP=yP.featureCollection;function _P(n){var t=new Ra(n);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:ef(e),Ra.prototype.insert.call(this,e)},t.load=function(e){var o=[];return Array.isArray(e)?e.forEach(function(s){if(s.type!=="Feature")throw new Error("invalid features");s.bbox=s.bbox?s.bbox:ef(s),o.push(s)}):$7(e,function(s){if(s.type!=="Feature")throw new Error("invalid features");s.bbox=s.bbox?s.bbox:ef(s),o.push(s)}),Ra.prototype.load.call(this,o)},t.remove=function(e,o){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:ef(e),Ra.prototype.remove.call(this,e,o)},t.clear=function(){return Ra.prototype.clear.call(this)},t.search=function(e){var o=Ra.prototype.search.call(this,this.toBBox(e));return mP(o)},t.collides=function(e){return Ra.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=Ra.prototype.all.call(this);return mP(e)},t.toJSON=function(){return Ra.prototype.toJSON.call(this)},t.fromJSON=function(e){return Ra.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var o;if(e.bbox)o=e.bbox;else if(Array.isArray(e)&&e.length===4)o=e;else if(Array.isArray(e)&&e.length===6)o=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")o=ef(e);else if(e.type==="FeatureCollection")o=ef(e);else throw new Error("invalid geojson");return{minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]}},t}y_.exports=_P;y_.exports.default=_P});var S_=ot((Sat,PP)=>{"use strict";var CP=Object.prototype.toString;PP.exports=function(t){var e=CP.call(t),o=e==="[object Arguments]";return o||(o=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&CP.call(t.callee)==="[object Function]"),o}});var BP=ot((Mat,UP)=>{"use strict";var FP;Object.keys||(xh=Object.prototype.hasOwnProperty,M_=Object.prototype.toString,IP=S_(),b_=Object.prototype.propertyIsEnumerable,RP=!b_.call({toString:null},"toString"),LP=b_.call(function(){},"prototype"),Eh=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],dg=function(n){var t=n.constructor;return t&&t.prototype===n},NP={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},OP=function(){if(typeof window=="undefined")return!1;for(var n in window)try{if(!NP["$"+n]&&xh.call(window,n)&&window[n]!==null&&typeof window[n]=="object")try{dg(window[n])}catch(t){return!0}}catch(t){return!0}return!1}(),DP=function(n){if(typeof window=="undefined"||!OP)return dg(n);try{return dg(n)}catch(t){return!1}},FP=function(t){var e=t!==null&&typeof t=="object",o=M_.call(t)==="[object Function]",s=IP(t),l=e&&M_.call(t)==="[object String]",p=[];if(!e&&!o&&!s)throw new TypeError("Object.keys called on a non-object");var h=LP&&o;if(l&&t.length>0&&!xh.call(t,0))for(var g=0;g<t.length;++g)p.push(String(g));if(s&&t.length>0)for(var m=0;m<t.length;++m)p.push(String(m));else for(var _ in t)!(h&&_==="prototype")&&xh.call(t,_)&&p.push(String(_));if(RP)for(var E=DP(t),S=0;S<Eh.length;++S)!(E&&Eh[S]==="constructor")&&xh.call(t,Eh[S])&&p.push(Eh[S]);return p});var xh,M_,IP,b_,RP,LP,Eh,dg,NP,OP,DP;UP.exports=FP});var A_=ot((bat,kP)=>{"use strict";var iY=Array.prototype.slice,oY=S_(),zP=Object.keys,gg=zP?function(t){return zP(t)}:BP(),GP=Object.keys;gg.shim=function(){if(Object.keys){var t=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);t||(Object.keys=function(o){return oY(o)?GP(iY.call(o)):GP(o)})}else Object.keys=gg;return Object.keys||gg};kP.exports=gg});var T_=ot((Aat,qP)=>{"use strict";qP.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),o=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var s=42;t[e]=s;for(var l in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var p=Object.getOwnPropertySymbols(t);if(p.length!==1||p[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var h=Object.getOwnPropertyDescriptor(t,e);if(h.value!==s||h.enumerable!==!0)return!1}return!0}});var mg=ot((Tat,HP)=>{"use strict";var sY=T_();HP.exports=function(){return sY()&&!!Symbol.toStringTag}});var C_=ot((Cat,VP)=>{"use strict";VP.exports=Object});var P_=ot((Pat,WP)=>{"use strict";WP.exports=Error});var YP=ot((Iat,XP)=>{"use strict";XP.exports=EvalError});var ZP=ot((Rat,$P)=>{"use strict";$P.exports=RangeError});var KP=ot((Lat,JP)=>{"use strict";JP.exports=ReferenceError});var I_=ot((Nat,jP)=>{"use strict";jP.exports=SyntaxError});var ql=ot((Oat,QP)=>{"use strict";QP.exports=TypeError});var eI=ot((Dat,tI)=>{"use strict";tI.exports=URIError});var rI=ot((Fat,nI)=>{"use strict";nI.exports=Math.abs});var oI=ot((Uat,iI)=>{"use strict";iI.exports=Math.floor});var aI=ot((Bat,sI)=>{"use strict";sI.exports=Math.max});var lI=ot((zat,uI)=>{"use strict";uI.exports=Math.min});var fI=ot((Gat,cI)=>{"use strict";cI.exports=Math.pow});var pI=ot((kat,hI)=>{"use strict";hI.exports=Math.round});var gI=ot((qat,dI)=>{"use strict";dI.exports=Number.isNaN||function(t){return t!==t}});var yI=ot((Hat,mI)=>{"use strict";var aY=gI();mI.exports=function(t){return aY(t)||t===0?t:t<0?-1:1}});var _I=ot((Vat,vI)=>{"use strict";vI.exports=Object.getOwnPropertyDescriptor});var Hl=ot((Wat,xI)=>{"use strict";var yg=_I();if(yg)try{yg([],"length")}catch(n){yg=null}xI.exports=yg});var wh=ot((Xat,EI)=>{"use strict";var vg=Object.defineProperty||!1;if(vg)try{vg({},"a",{value:1})}catch(n){vg=!1}EI.exports=vg});var MI=ot((Yat,SI)=>{"use strict";var wI=typeof Symbol!="undefined"&&Symbol,uY=T_();SI.exports=function(){return typeof wI!="function"||typeof Symbol!="function"||typeof wI("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:uY()}});var R_=ot(($at,bI)=>{"use strict";bI.exports=typeof Reflect!="undefined"&&Reflect.getPrototypeOf||null});var L_=ot((Zat,AI)=>{"use strict";var lY=C_();AI.exports=lY.getPrototypeOf||null});var PI=ot((Jat,CI)=>{"use strict";var cY="Function.prototype.bind called on incompatible ",fY=Object.prototype.toString,hY=Math.max,pY="[object Function]",TI=function(t,e){for(var o=[],s=0;s<t.length;s+=1)o[s]=t[s];for(var l=0;l<e.length;l+=1)o[l+t.length]=e[l];return o},dY=function(t,e){for(var o=[],s=e||0,l=0;s<t.length;s+=1,l+=1)o[l]=t[s];return o},gY=function(n,t){for(var e="",o=0;o<n.length;o+=1)e+=n[o],o+1<n.length&&(e+=t);return e};CI.exports=function(t){var e=this;if(typeof e!="function"||fY.apply(e)!==pY)throw new TypeError(cY+e);for(var o=dY(arguments,1),s,l=function(){if(this instanceof s){var _=e.apply(this,TI(o,arguments));return Object(_)===_?_:this}return e.apply(t,TI(o,arguments))},p=hY(0,e.length-o.length),h=[],g=0;g<p;g++)h[g]="$"+g;if(s=Function("binder","return function ("+gY(h,",")+"){ return binder.apply(this,arguments); }")(l),e.prototype){var m=function(){};m.prototype=e.prototype,s.prototype=new m,m.prototype=null}return s}});var nf=ot((Kat,II)=>{"use strict";var mY=PI();II.exports=Function.prototype.bind||mY});var _g=ot((jat,RI)=>{"use strict";RI.exports=Function.prototype.call});var xg=ot((Qat,LI)=>{"use strict";LI.exports=Function.prototype.apply});var OI=ot((tut,NI)=>{"use strict";NI.exports=typeof Reflect!="undefined"&&Reflect&&Reflect.apply});var N_=ot((eut,DI)=>{"use strict";var yY=nf(),vY=xg(),_Y=_g(),xY=OI();DI.exports=xY||yY.call(_Y,vY)});var Eg=ot((nut,FI)=>{"use strict";var EY=nf(),wY=ql(),SY=_g(),MY=N_();FI.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new wY("a function is required");return MY(EY,SY,t)}});var qI=ot((rut,kI)=>{"use strict";var bY=Eg(),UI=Hl(),zI;try{zI=[].__proto__===Array.prototype}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var O_=!!zI&&UI&&UI(Object.prototype,"__proto__"),GI=Object,BI=GI.getPrototypeOf;kI.exports=O_&&typeof O_.get=="function"?bY([O_.get]):typeof BI=="function"?function(t){return BI(t==null?t:GI(t))}:!1});var D_=ot((iut,XI)=>{"use strict";var HI=R_(),VI=L_(),WI=qI();XI.exports=HI?function(t){return HI(t)}:VI?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return VI(t)}:WI?function(t){return WI(t)}:null});var F_=ot((out,YI)=>{"use strict";var AY=Function.prototype.call,TY=Object.prototype.hasOwnProperty,CY=nf();YI.exports=CY.call(AY,TY)});var z_=ot((sut,QI)=>{"use strict";var Un,PY=C_(),IY=P_(),RY=YP(),LY=ZP(),NY=KP(),af=I_(),sf=ql(),OY=eI(),DY=rI(),FY=oI(),UY=aI(),BY=lI(),zY=fI(),GY=pI(),kY=yI(),KI=Function,U_=function(n){try{return KI('"use strict"; return ('+n+").constructor;")()}catch(t){}},Sh=Hl(),qY=wh(),B_=function(){throw new sf},HY=Sh?function(){try{return arguments.callee,B_}catch(n){try{return Sh(arguments,"callee").get}catch(t){return B_}}}():B_,rf=MI()(),qi=D_(),VY=L_(),WY=R_(),jI=xg(),Mh=_g(),of={},XY=typeof Uint8Array=="undefined"||!qi?Un:qi(Uint8Array),Vl={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?Un:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?Un:ArrayBuffer,"%ArrayIteratorPrototype%":rf&&qi?qi([][Symbol.iterator]()):Un,"%AsyncFromSyncIteratorPrototype%":Un,"%AsyncFunction%":of,"%AsyncGenerator%":of,"%AsyncGeneratorFunction%":of,"%AsyncIteratorPrototype%":of,"%Atomics%":typeof Atomics=="undefined"?Un:Atomics,"%BigInt%":typeof BigInt=="undefined"?Un:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?Un:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?Un:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?Un:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":IY,"%eval%":eval,"%EvalError%":RY,"%Float16Array%":typeof Float16Array=="undefined"?Un:Float16Array,"%Float32Array%":typeof Float32Array=="undefined"?Un:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?Un:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?Un:FinalizationRegistry,"%Function%":KI,"%GeneratorFunction%":of,"%Int8Array%":typeof Int8Array=="undefined"?Un:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?Un:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?Un:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":rf&&qi?qi(qi([][Symbol.iterator]())):Un,"%JSON%":typeof JSON=="object"?JSON:Un,"%Map%":typeof Map=="undefined"?Un:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!rf||!qi?Un:qi(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":PY,"%Object.getOwnPropertyDescriptor%":Sh,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?Un:Promise,"%Proxy%":typeof Proxy=="undefined"?Un:Proxy,"%RangeError%":LY,"%ReferenceError%":NY,"%Reflect%":typeof Reflect=="undefined"?Un:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?Un:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!rf||!qi?Un:qi(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?Un:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":rf&&qi?qi(""[Symbol.iterator]()):Un,"%Symbol%":rf?Symbol:Un,"%SyntaxError%":af,"%ThrowTypeError%":HY,"%TypedArray%":XY,"%TypeError%":sf,"%Uint8Array%":typeof Uint8Array=="undefined"?Un:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?Un:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?Un:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?Un:Uint32Array,"%URIError%":OY,"%WeakMap%":typeof WeakMap=="undefined"?Un:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?Un:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?Un:WeakSet,"%Function.prototype.call%":Mh,"%Function.prototype.apply%":jI,"%Object.defineProperty%":qY,"%Object.getPrototypeOf%":VY,"%Math.abs%":DY,"%Math.floor%":FY,"%Math.max%":UY,"%Math.min%":BY,"%Math.pow%":zY,"%Math.round%":GY,"%Math.sign%":kY,"%Reflect.getPrototypeOf%":WY};if(qi)try{null.error}catch(n){$I=qi(qi(n)),Vl["%Error.prototype%"]=$I}var $I,YY=function n(t){var e;if(t==="%AsyncFunction%")e=U_("async function () {}");else if(t==="%GeneratorFunction%")e=U_("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=U_("async function* () {}");else if(t==="%AsyncGenerator%"){var o=n("%AsyncGeneratorFunction%");o&&(e=o.prototype)}else if(t==="%AsyncIteratorPrototype%"){var s=n("%AsyncGenerator%");s&&qi&&(e=qi(s.prototype))}return Vl[t]=e,e},ZI={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bh=nf(),wg=F_(),$Y=bh.call(Mh,Array.prototype.concat),ZY=bh.call(jI,Array.prototype.splice),JI=bh.call(Mh,String.prototype.replace),Sg=bh.call(Mh,String.prototype.slice),JY=bh.call(Mh,RegExp.prototype.exec),KY=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,jY=/\\\\(\\\\)?/g,QY=function(t){var e=Sg(t,0,1),o=Sg(t,-1);if(e==="%"&&o!=="%")throw new af("invalid intrinsic syntax, expected closing \`%\`");if(o==="%"&&e!=="%")throw new af("invalid intrinsic syntax, expected opening \`%\`");var s=[];return JI(t,KY,function(l,p,h,g){s[s.length]=h?JI(g,jY,"$1"):p||l}),s},t$=function(t,e){var o=t,s;if(wg(ZI,o)&&(s=ZI[o],o="%"+s[0]+"%"),wg(Vl,o)){var l=Vl[o];if(l===of&&(l=YY(o)),typeof l=="undefined"&&!e)throw new sf("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:s,name:o,value:l}}throw new af("intrinsic "+t+" does not exist!")};QI.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new sf("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new sf('"allowMissing" argument must be a boolean');if(JY(/^%?[^%]*%?$/,t)===null)throw new af("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var o=QY(t),s=o.length>0?o[0]:"",l=t$("%"+s+"%",e),p=l.name,h=l.value,g=!1,m=l.alias;m&&(s=m[0],ZY(o,$Y([0,1],m)));for(var _=1,E=!0;_<o.length;_+=1){var S=o[_],b=Sg(S,0,1),A=Sg(S,-1);if((b==='"'||b==="'"||b==="\`"||A==='"'||A==="'"||A==="\`")&&b!==A)throw new af("property names with quotes must have matching quotes");if((S==="constructor"||!E)&&(g=!0),s+="."+S,p="%"+s+"%",wg(Vl,p))h=Vl[p];else if(h!=null){if(!(S in h)){if(!e)throw new sf("base intrinsic for "+t+" exists, but the property is not available.");return}if(Sh&&_+1>=o.length){var I=Sh(h,S);E=!!I,E&&"get"in I&&!("originalValue"in I.get)?h=I.get:h=h[S]}else E=wg(h,S),h=h[S];E&&!g&&(Vl[p]=h)}}return h}});var Mg=ot((aut,nR)=>{"use strict";var tR=z_(),eR=Eg(),e$=eR([tR("%String.prototype.indexOf%")]);nR.exports=function(t,e){var o=tR(t,!!e);return typeof o=="function"&&e$(t,".prototype.")>-1?eR([o]):o}});var oR=ot((uut,iR)=>{"use strict";var n$=mg()(),r$=Mg(),G_=r$("Object.prototype.toString"),bg=function(t){return n$&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:G_(t)==="[object Arguments]"},rR=function(t){return bg(t)?!0:t!==null&&typeof t=="object"&&"length"in t&&typeof t.length=="number"&&t.length>=0&&G_(t)!=="[object Array]"&&"callee"in t&&G_(t.callee)==="[object Function]"},i$=function(){return bg(arguments)}();bg.isLegacyArguments=rR;iR.exports=i$?bg:rR});var Ag=ot((lut,uR)=>{"use strict";var sR=wh(),o$=I_(),uf=ql(),aR=Hl();uR.exports=function(t,e,o){if(!t||typeof t!="object"&&typeof t!="function")throw new uf("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new uf("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new uf("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new uf("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new uf("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new uf("\`loose\`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,p=arguments.length>5?arguments[5]:null,h=arguments.length>6?arguments[6]:!1,g=!!aR&&aR(t,e);if(sR)sR(t,e,{configurable:p===null&&g?g.configurable:!p,enumerable:s===null&&g?g.enumerable:!s,value:o,writable:l===null&&g?g.writable:!l});else if(h||!s&&!l&&!p)t[e]=o;else throw new o$("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Tg=ot((cut,cR)=>{"use strict";var k_=wh(),lR=function(){return!!k_};lR.hasArrayLengthDefineBug=function(){if(!k_)return null;try{return k_([],"length",{value:1}).length!==1}catch(t){return!0}};cR.exports=lR});var lf=ot((fut,dR)=>{"use strict";var s$=A_(),a$=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",u$=Object.prototype.toString,l$=Array.prototype.concat,fR=Ag(),c$=function(n){return typeof n=="function"&&u$.call(n)==="[object Function]"},hR=Tg()(),f$=function(n,t,e,o){if(t in n){if(o===!0){if(n[t]===e)return}else if(!c$(o)||!o())return}hR?fR(n,t,e,!0):fR(n,t,e)},pR=function(n,t){var e=arguments.length>2?arguments[2]:{},o=s$(t);a$&&(o=l$.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s<o.length;s+=1)f$(n,o[s],t[o[s]],e[o[s]])};pR.supportsDescriptors=!!hR;dR.exports=pR});var _R=ot((hut,vR)=>{"use strict";var h$=z_(),gR=Ag(),p$=Tg()(),mR=Hl(),yR=ql(),d$=h$("%Math.floor%");vR.exports=function(t,e){if(typeof t!="function")throw new yR("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||d$(e)!==e)throw new yR("\`length\` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],s=!0,l=!0;if("length"in t&&mR){var p=mR(t,"length");p&&!p.configurable&&(s=!1),p&&!p.writable&&(l=!1)}return(s||l||!o)&&(p$?gR(t,"length",e,!0,!0):gR(t,"length",e)),t}});var ER=ot((put,xR)=>{"use strict";var g$=nf(),m$=xg(),y$=N_();xR.exports=function(){return y$(g$,m$,arguments)}});var q_=ot((dut,Cg)=>{"use strict";var v$=_R(),wR=wh(),_$=Eg(),SR=ER();Cg.exports=function(t){var e=_$(arguments),o=t.length-(arguments.length-1);return v$(e,1+(o>0?o:0),!0)};wR?wR(Cg.exports,"apply",{value:SR}):Cg.exports.apply=SR});var H_=ot((gut,bR)=>{"use strict";var MR=function(n){return n!==n};bR.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||MR(t)&&MR(e))}});var V_=ot((mut,AR)=>{"use strict";var x$=H_();AR.exports=function(){return typeof Object.is=="function"?Object.is:x$}});var CR=ot((yut,TR)=>{"use strict";var E$=V_(),w$=lf();TR.exports=function(){var t=E$();return w$(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var LR=ot((vut,RR)=>{"use strict";var S$=lf(),M$=q_(),b$=H_(),PR=V_(),A$=CR(),IR=M$(PR(),Object);S$(IR,{getPolyfill:PR,implementation:b$,shim:A$});RR.exports=IR});var BR=ot((_ut,UR)=>{"use strict";var NR=Mg(),T$=mg()(),C$=F_(),P$=Hl(),Y_;T$?(OR=NR("RegExp.prototype.exec"),W_={},Pg=function(){throw W_},X_={toString:Pg,valueOf:Pg},typeof Symbol.toPrimitive=="symbol"&&(X_[Symbol.toPrimitive]=Pg),Y_=function(t){if(!t||typeof t!="object")return!1;var e=P$(t,"lastIndex"),o=e&&C$(e,"value");if(!o)return!1;try{OR(t,X_)}catch(s){return s===W_}}):(DR=NR("Object.prototype.toString"),FR="[object RegExp]",Y_=function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:DR(t)===FR});var OR,W_,Pg,X_,DR,FR;UR.exports=Y_});var GR=ot((xut,zR)=>{"use strict";var Th=function(){return typeof function(){}.name=="string"},Ah=Object.getOwnPropertyDescriptor;if(Ah)try{Ah([],"length")}catch(n){Ah=null}Th.functionsHaveConfigurableNames=function(){if(!Th()||!Ah)return!1;var t=Ah(function(){},"name");return!!t&&!!t.configurable};var I$=Function.prototype.bind;Th.boundFunctionsHaveNames=function(){return Th()&&typeof I$=="function"&&function(){}.bind().name!==""};zR.exports=Th});var HR=ot((Eut,qR)=>{"use strict";var kR=Ag(),R$=Tg()(),L$=GR().functionsHaveConfigurableNames(),N$=ql();qR.exports=function(t,e){if(typeof t!="function")throw new N$("\`fn\` is not a function");var o=arguments.length>2&&!!arguments[2];return(!o||L$)&&(R$?kR(t,"name",e,!0,!0):kR(t,"name",e)),t}});var $_=ot((wut,VR)=>{"use strict";var O$=HR(),D$=ql(),F$=Object;VR.exports=O$(function(){if(this==null||this!==F$(this))throw new D$("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0)});var Z_=ot((Sut,WR)=>{"use strict";var U$=$_(),B$=lf().supportsDescriptors,z$=Object.getOwnPropertyDescriptor;WR.exports=function(){if(B$&&/a/mig.flags==="gim"){var t=z$(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",o={};if(Object.defineProperty(o,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(o,"sticky",{get:function(){e+="y"}}),t.get.call(o),e==="dy")return t.get}}return U$}});var $R=ot((Mut,YR)=>{"use strict";var G$=lf().supportsDescriptors,k$=Z_(),q$=Hl(),H$=Object.defineProperty,V$=P_(),XR=D_(),W$=/a/;YR.exports=function(){if(!G$||!XR)throw new V$("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=k$(),e=XR(W$),o=q$(e,"flags");return(!o||o.get!==t)&&H$(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var jR=ot((but,KR)=>{"use strict";var X$=lf(),Y$=q_(),$$=$_(),ZR=Z_(),Z$=$R(),JR=Y$(ZR());X$(JR,{getPolyfill:ZR,implementation:$$,shim:Z$});KR.exports=JR});var eL=ot((Aut,tL)=>{"use strict";var QR=Mg(),J$=QR("Date.prototype.getDay"),K$=function(t){try{return J$(t),!0}catch(e){return!1}},j$=QR("Object.prototype.toString"),Q$="[object Date]",tZ=mg()();tL.exports=function(t){return typeof t!="object"||t===null?!1:tZ?K$(t):j$(t)===Q$}});var J_=ot((Tut,hL)=>{var nL=A_(),rL=oR(),iL=LR(),oL=BR(),sL=jR(),aL=eL(),uL=Date.prototype.getTime;function fL(n,t,e){var o=e||{};return(o.strict?iL(n,t):n===t)?!0:!n||!t||typeof n!="object"&&typeof t!="object"?o.strict?iL(n,t):n==t:eZ(n,t,o)}function lL(n){return n==null}function cL(n){return!(!n||typeof n!="object"||typeof n.length!="number"||typeof n.copy!="function"||typeof n.slice!="function"||n.length>0&&typeof n[0]!="number")}function eZ(n,t,e){var o,s;if(typeof n!=typeof t||lL(n)||lL(t)||n.prototype!==t.prototype||rL(n)!==rL(t))return!1;var l=oL(n),p=oL(t);if(l!==p)return!1;if(l||p)return n.source===t.source&&sL(n)===sL(t);if(aL(n)&&aL(t))return uL.call(n)===uL.call(t);var h=cL(n),g=cL(t);if(h!==g)return!1;if(h||g){if(n.length!==t.length)return!1;for(o=0;o<n.length;o++)if(n[o]!==t[o])return!1;return!0}if(typeof n!=typeof t)return!1;try{var m=nL(n),_=nL(t)}catch(E){return!1}if(m.length!==_.length)return!1;for(m.sort(),_.sort(),o=m.length-1;o>=0;o--)if(m[o]!=_[o])return!1;for(o=m.length-1;o>=0;o--)if(s=m[o],!fL(n[s],t[s],e))return!1;return!0}hL.exports=fL});var u1=ot((Nct,_L)=>{var WZ=J_(),La=function(n){this.precision=n&&n.precision?n.precision:17,this.direction=n&&n.direction?n.direction:!1,this.pseudoNode=n&&n.pseudoNode?n.pseudoNode:!1,this.objectComparator=n&&n.objectComparator?n.objectComparator:XZ};La.prototype.compare=function(n,t){if(n.type!==t.type||!vL(n,t))return!1;switch(n.type){case"Point":return this.compareCoord(n.coordinates,t.coordinates);case"LineString":return this.compareLine(n.coordinates,t.coordinates,0,!1);case"Polygon":return this.comparePolygon(n,t);case"Feature":return this.compareFeature(n,t);default:if(n.type.indexOf("Multi")===0){var e=this,o=yL(n),s=yL(t);return o.every(function(l){return this.some(function(p){return e.compare(l,p)})},s)}}return!1};function yL(n){return n.coordinates.map(function(t){return{type:n.type.replace("Multi",""),coordinates:t}})}function vL(n,t){return n.hasOwnProperty("coordinates")?n.coordinates.length===t.coordinates.length:n.length===t.length}La.prototype.compareCoord=function(n,t){if(n.length!==t.length)return!1;for(var e=0;e<n.length;e++)if(n[e].toFixed(this.precision)!==t[e].toFixed(this.precision))return!1;return!0};La.prototype.compareLine=function(n,t,e,o){if(!vL(n,t))return!1;var s=this.pseudoNode?n:this.removePseudo(n),l=this.pseudoNode?t:this.removePseudo(t);if(!(o&&!this.compareCoord(s[0],l[0])&&(l=this.fixStartIndex(l,s),!l))){var p=this.compareCoord(s[e],l[e]);return this.direction||p?this.comparePath(s,l):this.compareCoord(s[e],l[l.length-(1+e)])?this.comparePath(s.slice().reverse(),l):!1}};La.prototype.fixStartIndex=function(n,t){for(var e,o=-1,s=0;s<n.length;s++)if(this.compareCoord(n[s],t[0])){o=s;break}return o>=0&&(e=[].concat(n.slice(o,n.length),n.slice(1,o+1))),e};La.prototype.comparePath=function(n,t){var e=this;return n.every(function(o,s){return e.compareCoord(o,this[s])},t)};La.prototype.comparePolygon=function(n,t){if(this.compareLine(n.coordinates[0],t.coordinates[0],1,!0)){var e=n.coordinates.slice(1,n.coordinates.length),o=t.coordinates.slice(1,t.coordinates.length),s=this;return e.every(function(l){return this.some(function(p){return s.compareLine(l,p,1,!0)})},o)}else return!1};La.prototype.compareFeature=function(n,t){return n.id!==t.id||!this.objectComparator(n.properties,t.properties)||!this.compareBBox(n,t)?!1:this.compare(n.geometry,t.geometry)};La.prototype.compareBBox=function(n,t){return!!(!n.bbox&&!t.bbox||n.bbox&&t.bbox&&this.compareCoord(n.bbox,t.bbox))};La.prototype.removePseudo=function(n){return n};function XZ(n,t){return WZ(n,t,{strict:!0})}_L.exports=La});var xL=ot((Wct,Lg)=>{function il(n,t,e,o){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(n,t,e,o)}il.prototype.run=function(n,t,e,o){this._init(n,t,e,o);for(var s=0;s<this._datasetLength;s++)if(this._visited[s]!==1){this._visited[s]=1;var l=this._regionQuery(s);if(l.length<this.minPts)this.noise.push(s);else{var p=this.clusters.length;this.clusters.push([]),this._addToCluster(s,p),this._expandCluster(p,l)}}return this.clusters};il.prototype._init=function(n,t,e,o){if(n){if(!(n instanceof Array))throw Error("Dataset must be of type array, "+typeof n+" given");this.dataset=n,this.clusters=[],this.noise=[],this._datasetLength=n.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}t&&(this.epsilon=t),e&&(this.minPts=e),o&&(this.distance=o)};il.prototype._expandCluster=function(n,t){for(var e=0;e<t.length;e++){var o=t[e];if(this._visited[o]!==1){this._visited[o]=1;var s=this._regionQuery(o);s.length>=this.minPts&&(t=this._mergeArrays(t,s))}this._assigned[o]!==1&&this._addToCluster(o,n)}};il.prototype._addToCluster=function(n,t){this.clusters[t].push(n),this._assigned[n]=1};il.prototype._regionQuery=function(n){for(var t=[],e=0;e<this._datasetLength;e++){var o=this.distance(this.dataset[n],this.dataset[e]);o<this.epsilon&&t.push(e)}return t};il.prototype._mergeArrays=function(n,t){for(var e=t.length,o=0;o<e;o++){var s=t[o];n.indexOf(s)<0&&n.push(s)}return n};il.prototype._euclideanDistance=function(n,t){for(var e=0,o=Math.min(n.length,t.length);o--;)e+=(n[o]-t[o])*(n[o]-t[o]);return Math.sqrt(e)};typeof Lg!="undefined"&&Lg.exports&&(Lg.exports=il)});var EL=ot((Xct,Ng)=>{function ol(n,t,e){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(n,t,e)}ol.prototype.init=function(n,t,e){this.assignments=[],this.centroids=[],typeof n!="undefined"&&(this.dataset=n),typeof t!="undefined"&&(this.k=t),typeof e!="undefined"&&(this.distance=e)};ol.prototype.run=function(n,t){this.init(n,t);for(var e=this.dataset.length,o=0;o<this.k;o++)this.centroids[o]=this.randomCentroid();for(var s=!0;s;){s=this.assign();for(var l=0;l<this.k;l++){for(var p=new Array(_),h=0,g=0;g<_;g++)p[g]=0;for(var m=0;m<e;m++){var _=this.dataset[m].length;if(l===this.assignments[m]){for(var g=0;g<_;g++)p[g]+=this.dataset[m][g];h++}}if(h>0){for(var g=0;g<_;g++)p[g]/=h;this.centroids[l]=p}else this.centroids[l]=this.randomCentroid(),s=!0}}return this.getClusters()};ol.prototype.randomCentroid=function(){var n=this.dataset.length-1,t,e;do e=Math.round(Math.random()*n),t=this.dataset[e];while(this.centroids.indexOf(t)>=0);return t};ol.prototype.assign=function(){for(var n=!1,t=this.dataset.length,e,o=0;o<t;o++)e=this.argmin(this.dataset[o],this.centroids,this.distance),e!=this.assignments[o]&&(this.assignments[o]=e,n=!0);return n};ol.prototype.getClusters=function(){for(var n=new Array(this.k),t,e=0;e<this.assignments.length;e++)t=this.assignments[e],typeof n[t]=="undefined"&&(n[t]=[]),n[t].push(e);return n};ol.prototype.argmin=function(n,t,e){for(var o=Number.MAX_VALUE,s=0,l=t.length,p,h=0;h<l;h++)p=e(n,t[h]),p<o&&(o=p,s=h);return s};ol.prototype.distance=function(n,t){for(var e=0,o=Math.min(n.length,t.length);o--;){var s=n[o]-t[o];e+=s*s}return Math.sqrt(e)};typeof Ng!="undefined"&&Ng.exports&&(Ng.exports=ol)});var l1=ot((Yct,Og)=>{function Na(n,t,e){this._queue=[],this._priorities=[],this._sorting="desc",this._init(n,t,e)}Na.prototype.insert=function(n,t){for(var e=this._queue.length,o=e;o--;){var s=this._priorities[o];this._sorting==="desc"?t>s&&(e=o):t<s&&(e=o)}this._insertAt(n,t,e)};Na.prototype.remove=function(n){for(var t=this._queue.length;t--;){var e=this._queue[t];if(n===e){this._queue.splice(t,1),this._priorities.splice(t,1);break}}};Na.prototype.forEach=function(n){this._queue.forEach(n)};Na.prototype.getElements=function(){return this._queue};Na.prototype.getElementPriority=function(n){return this._priorities[n]};Na.prototype.getPriorities=function(){return this._priorities};Na.prototype.getElementsWithPriorities=function(){for(var n=[],t=0,e=this._queue.length;t<e;t++)n.push([this._queue[t],this._priorities[t]]);return n};Na.prototype._init=function(n,t,e){if(n&&t){if(this._queue=[],this._priorities=[],n.length!==t.length)throw new Error("Arrays must have the same length");for(var o=0;o<n.length;o++)this.insert(n[o],t[o])}e&&(this._sorting=e)};Na.prototype._insertAt=function(n,t,e){this._queue.length===e?(this._queue.push(n),this._priorities.push(t)):(this._queue.splice(e,0,n),this._priorities.splice(e,0,t))};typeof Og!="undefined"&&Og.exports&&(Og.exports=Na)});var SL=ot(($ct,ff)=>{typeof ff!="undefined"&&ff.exports&&(wL=l1());var wL;function gu(n,t,e,o){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(n,t,e,o)}gu.prototype.run=function(n,t,e,o){this._init(n,t,e,o);for(var s=0,l=this.dataset.length;s<l;s++)if(this._processed[s]!==1){this._processed[s]=1,this.clusters.push([s]);var p=this.clusters.length-1;this._orderedList.push(s);var h=new wL(null,null,"asc"),g=this._regionQuery(s);this._distanceToCore(s)!==void 0&&(this._updateQueue(s,g,h),this._expandCluster(p,h))}return this.clusters};gu.prototype.getReachabilityPlot=function(){for(var n=[],t=0,e=this._orderedList.length;t<e;t++){var o=this._orderedList[t],s=this._reachability[o];n.push([o,s])}return n};gu.prototype._init=function(n,t,e,o){if(n){if(!(n instanceof Array))throw Error("Dataset must be of type array, "+typeof n+" given");this.dataset=n,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}t&&(this.epsilon=t),e&&(this.minPts=e),o&&(this.distance=o)};gu.prototype._updateQueue=function(n,t,e){var o=this;this._coreDistance=this._distanceToCore(n),t.forEach(function(s){if(o._processed[s]===void 0){var l=o.distance(o.dataset[n],o.dataset[s]),p=Math.max(o._coreDistance,l);o._reachability[s]===void 0?(o._reachability[s]=p,e.insert(s,p)):p<o._reachability[s]&&(o._reachability[s]=p,e.remove(s),e.insert(s,p))}})};gu.prototype._expandCluster=function(n,t){for(var e=t.getElements(),o=0,s=e.length;o<s;o++){var l=e[o];if(this._processed[l]===void 0){var p=this._regionQuery(l);this._processed[l]=1,this.clusters[n].push(l),this._orderedList.push(l),this._distanceToCore(l)!==void 0&&(this._updateQueue(l,p,t),this._expandCluster(n,t))}}};gu.prototype._distanceToCore=function(n){for(var t=this.epsilon,e=0;e<t;e++){var o=this._regionQuery(n,e);if(o.length>=this.minPts)return e}};gu.prototype._regionQuery=function(n,t){t=t||this.epsilon;for(var e=[],o=0,s=this.dataset.length;o<s;o++)this.distance(this.dataset[n],this.dataset[o])<t&&e.push(o);return e};gu.prototype._euclideanDistance=function(n,t){for(var e=0,o=Math.min(n.length,t.length);o--;)e+=(n[o]-t[o])*(n[o]-t[o]);return Math.sqrt(e)};typeof ff!="undefined"&&ff.exports&&(ff.exports=gu)});var ML=ot((Zct,Dg)=>{typeof Dg!="undefined"&&Dg.exports&&(Dg.exports={DBSCAN:xL(),KMEANS:EL(),OPTICS:SL(),PriorityQueue:l1()})});var c1=ot((eft,AL)=>{"use strict";AL.exports={eudist:function(t,e,o){for(var s=t.length,l=0,p=0;p<s;p++){var h=(t[p]||0)-(e[p]||0);l+=h*h}return o?Math.sqrt(l):l},mandist:function(t,e,o){for(var s=t.length,l=0,p=0;p<s;p++)l+=Math.abs((t[p]||0)-(e[p]||0));return o?Math.sqrt(l):l},dist:function(t,e,o){var s=Math.abs(t-e);return o?s:s*s}}});var PL=ot((nft,CL)=>{"use strict";var TL=c1(),jZ=TL.eudist,QZ=TL.dist;CL.exports={kmrand:function(t,e){for(var o={},s=[],l=e<<2,p=t.length,h=t[0].length>0;s.length<e&&l-- >0;){var g=t[Math.floor(Math.random()*p)],m=h?g.join("_"):""+g;o[m]||(o[m]=!0,s.push(g))}if(s.length<e)throw new Error("Error initializating clusters");return s},kmpp:function(t,e){var o=t[0].length?jZ:QZ,s=[],l=t.length,p=t[0].length>0,h={},g=t[Math.floor(Math.random()*l)],m=p?g.join("_"):""+g;for(s.push(g),h[m]=!0;s.length<e;){for(var _=[],E=s.length,S=0,b=[],A=0;A<l;A++){for(var I=1/0,w=0;w<E;w++){var x=o(t[A],s[w]);x<=I&&(I=x)}_[A]=I}for(var R=0;R<l;R++)S+=_[R];for(var C=0;C<l;C++)b[C]={i:C,v:t[C],pr:_[C]/S,cs:0};b.sort(function(q,D){return q.pr-D.pr}),b[0].cs=b[0].pr;for(var F=1;F<l;F++)b[F].cs=b[F-1].cs+b[F].pr;for(var V=Math.random(),X=0;X<l-1&&b[X++].cs<V;);s.push(b[X-1].v)}return s}}});var OL=ot((oft,NL)=>{"use strict";var f1=c1(),LL=PL(),tJ=f1.eudist,rft=f1.mandist,ift=f1.dist,eJ=LL.kmrand,nJ=LL.kmpp,IL=1e4;function RL(n,t,e){e=e||[];for(var o=0;o<n;o++)e[o]=t;return e}function rJ(n,t,e,o){var s=[],l=[],p=[],h=[],g=!1,m=o||IL,_=n.length,E=n[0].length,S=E>0,b=[];if(e)e=="kmrand"?s=eJ(n,t):e=="kmpp"?s=nJ(n,t):s=e;else for(var A={};s.length<t;){var I=Math.floor(Math.random()*_);A[I]||(A[I]=!0,s.push(n[I]))}do{RL(t,0,b);for(var w=0;w<_;w++){for(var x=1/0,R=0,C=0;C<t;C++){var h=S?tJ(n[w],s[C]):Math.abs(n[w]-s[C]);h<=x&&(x=h,R=C)}p[w]=R,b[R]++}for(var F=[],l=[],V=0,X=0;X<t;X++)F[X]=S?RL(E,0,F[X]):0,l[X]=s[X];if(S){for(var q=0;q<t;q++)s[q]=[];for(var D=0;D<_;D++)for(var xt=p[D],B=F[xt],j=n[D],J=0;J<E;J++)B[J]+=j[J];g=!0;for(var Dt=0;Dt<t;Dt++){for(var Q=s[Dt],At=F[Dt],Mt=l[Dt],Lt=b[Dt],pt=0;pt<E;pt++)Q[pt]=At[pt]/Lt||0;if(g){for(var yt=0;yt<E;yt++)if(Mt[yt]!=Q[yt]){g=!1;break}}}}else{for(var K=0;K<_;K++){var Bt=p[K];F[Bt]+=n[K]}for(var Gt=0;Gt<t;Gt++)s[Gt]=F[Gt]/b[Gt]||0;g=!0;for(var ae=0;ae<t;ae++)if(l[ae]!=s[ae]){g=!1;break}}g=g||--m<=0}while(!g);return{it:IL-m,k:t,idxs:p,centroids:s}}NL.exports=rJ});var mf=ot((y1,v1)=>{(function(n,t){typeof y1=="object"&&typeof v1!="undefined"?v1.exports=t():typeof define=="function"&&define.amd?define(t):(n=typeof globalThis!="undefined"?globalThis:n||self,n.polygonClipping=t())})(y1,function(){"use strict";function n(rt,P){var N={label:0,sent:function(){if(W[0]&1)throw W[1];return W[1]},trys:[],ops:[]},k,$,W,ht;return ht={next:at(0),throw:at(1),return:at(2)},typeof Symbol=="function"&&(ht[Symbol.iterator]=function(){return this}),ht;function at(Et){return function(G){return wt([Et,G])}}function wt(Et){if(k)throw new TypeError("Generator is already executing.");for(;N;)try{if(k=1,$&&(W=Et[0]&2?$.return:Et[0]?$.throw||((W=$.return)&&W.call($),0):$.next)&&!(W=W.call($,Et[1])).done)return W;switch($=0,W&&(Et=[Et[0]&2,W.value]),Et[0]){case 0:case 1:W=Et;break;case 4:return N.label++,{value:Et[1],done:!1};case 5:N.label++,$=Et[1],Et=[0];continue;case 7:Et=N.ops.pop(),N.trys.pop();continue;default:if(W=N.trys,!(W=W.length>0&&W[W.length-1])&&(Et[0]===6||Et[0]===2)){N=0;continue}if(Et[0]===3&&(!W||Et[1]>W[0]&&Et[1]<W[3])){N.label=Et[1];break}if(Et[0]===6&&N.label<W[1]){N.label=W[1],W=Et;break}if(W&&N.label<W[2]){N.label=W[2],N.ops.push(Et);break}W[2]&&N.ops.pop(),N.trys.pop();continue}Et=P.call(rt,N)}catch(G){Et=[6,G],$=0}finally{k=W=0}if(Et[0]&5)throw Et[1];return{value:Et[0]?Et[1]:void 0,done:!0}}}var t=function(){function rt(P,N){this.next=null,this.key=P,this.data=N,this.left=null,this.right=null}return rt}();function e(rt,P){return rt>P?1:rt<P?-1:0}function o(rt,P,N){for(var k=new t(null,null),$=k,W=k;;){var ht=N(rt,P.key);if(ht<0){if(P.left===null)break;if(N(rt,P.left.key)<0){var at=P.left;if(P.left=at.right,at.right=P,P=at,P.left===null)break}W.left=P,W=P,P=P.left}else if(ht>0){if(P.right===null)break;if(N(rt,P.right.key)>0){var at=P.right;if(P.right=at.left,at.left=P,P=at,P.right===null)break}$.right=P,$=P,P=P.right}else break}return $.right=P.left,W.left=P.right,P.left=k.right,P.right=k.left,P}function s(rt,P,N,k){var $=new t(rt,P);if(N===null)return $.left=$.right=null,$;N=o(rt,N,k);var W=k(rt,N.key);return W<0?($.left=N.left,$.right=N,N.left=null):W>=0&&($.right=N.right,$.left=N,N.right=null),$}function l(rt,P,N){var k=null,$=null;if(P){P=o(rt,P,N);var W=N(P.key,rt);W===0?(k=P.left,$=P.right):W<0?($=P.right,P.right=null,k=P):(k=P.left,P.left=null,$=P)}return{left:k,right:$}}function p(rt,P,N){return P===null?rt:(rt===null||(P=o(rt.key,P,N),P.left=rt),P)}function h(rt,P,N,k,$){if(rt){k(""+P+(N?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+$(rt)+\`
16128
16128
  \`);var W=P+(N?" ":"\\u2502 ");rt.left&&h(rt.left,W,!1,k,$),rt.right&&h(rt.right,W,!0,k,$)}}var g=function(){function rt(P){P===void 0&&(P=e),this._root=null,this._size=0,this._comparator=P}return rt.prototype.insert=function(P,N){return this._size++,this._root=s(P,N,this._root,this._comparator)},rt.prototype.add=function(P,N){var k=new t(P,N);this._root===null&&(k.left=k.right=null,this._size++,this._root=k);var $=this._comparator,W=o(P,this._root,$),ht=$(P,W.key);return ht===0?this._root=W:(ht<0?(k.left=W.left,k.right=W,W.left=null):ht>0&&(k.right=W.right,k.left=W,W.right=null),this._size++,this._root=k),this._root},rt.prototype.remove=function(P){this._root=this._remove(P,this._root,this._comparator)},rt.prototype._remove=function(P,N,k){var $;if(N===null)return null;N=o(P,N,k);var W=k(P,N.key);return W===0?(N.left===null?$=N.right:($=o(P,N.left,k),$.right=N.right),this._size--,$):N},rt.prototype.pop=function(){var P=this._root;if(P){for(;P.left;)P=P.left;return this._root=o(P.key,this._root,this._comparator),this._root=this._remove(P.key,this._root,this._comparator),{key:P.key,data:P.data}}return null},rt.prototype.findStatic=function(P){for(var N=this._root,k=this._comparator;N;){var $=k(P,N.key);if($===0)return N;$<0?N=N.left:N=N.right}return null},rt.prototype.find=function(P){return this._root&&(this._root=o(P,this._root,this._comparator),this._comparator(P,this._root.key)!==0)?null:this._root},rt.prototype.contains=function(P){for(var N=this._root,k=this._comparator;N;){var $=k(P,N.key);if($===0)return!0;$<0?N=N.left:N=N.right}return!1},rt.prototype.forEach=function(P,N){for(var k=this._root,$=[],W=!1;!W;)k!==null?($.push(k),k=k.left):$.length!==0?(k=$.pop(),P.call(N,k),k=k.right):W=!0;return this},rt.prototype.range=function(P,N,k,$){for(var W=[],ht=this._comparator,at=this._root,wt;W.length!==0||at;)if(at)W.push(at),at=at.left;else{if(at=W.pop(),wt=ht(at.key,N),wt>0)break;if(ht(at.key,P)>=0&&k.call($,at))return this;at=at.right}return this},rt.prototype.keys=function(){var P=[];return this.forEach(function(N){var k=N.key;return P.push(k)}),P},rt.prototype.values=function(){var P=[];return this.forEach(function(N){var k=N.data;return P.push(k)}),P},rt.prototype.min=function(){return this._root?this.minNode(this._root).key:null},rt.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},rt.prototype.minNode=function(P){if(P===void 0&&(P=this._root),P)for(;P.left;)P=P.left;return P},rt.prototype.maxNode=function(P){if(P===void 0&&(P=this._root),P)for(;P.right;)P=P.right;return P},rt.prototype.at=function(P){for(var N=this._root,k=!1,$=0,W=[];!k;)if(N)W.push(N),N=N.left;else if(W.length>0){if(N=W.pop(),$===P)return N;$++,N=N.right}else k=!0;return null},rt.prototype.next=function(P){var N=this._root,k=null;if(P.right){for(k=P.right;k.left;)k=k.left;return k}for(var $=this._comparator;N;){var W=$(P.key,N.key);if(W===0)break;W<0?(k=N,N=N.left):N=N.right}return k},rt.prototype.prev=function(P){var N=this._root,k=null;if(P.left!==null){for(k=P.left;k.right;)k=k.right;return k}for(var $=this._comparator;N;){var W=$(P.key,N.key);if(W===0)break;W<0?N=N.left:(k=N,N=N.right)}return k},rt.prototype.clear=function(){return this._root=null,this._size=0,this},rt.prototype.toList=function(){return E(this._root)},rt.prototype.load=function(P,N,k){N===void 0&&(N=[]),k===void 0&&(k=!1);var $=P.length,W=this._comparator;if(k&&A(P,N,0,$-1,W),this._root===null)this._root=m(P,N,0,$),this._size=$;else{var ht=b(this.toList(),_(P,N),W);$=this._size+$,this._root=S({head:ht},0,$)}return this},rt.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(rt.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),rt.prototype.toString=function(P){P===void 0&&(P=function(k){return String(k.key)});var N=[];return h(this._root,"",!0,function(k){return N.push(k)},P),N.join("")},rt.prototype.update=function(P,N,k){var $=this._comparator,W=l(P,this._root,$),ht=W.left,at=W.right;$(P,N)<0?at=s(N,k,at,$):ht=s(N,k,ht,$),this._root=p(ht,at,$)},rt.prototype.split=function(P){return l(P,this._root,this._comparator)},rt.prototype[Symbol.iterator]=function(){var P,N,k;return n(this,function($){switch($.label){case 0:P=this._root,N=[],k=!1,$.label=1;case 1:return k?[3,6]:P===null?[3,2]:(N.push(P),P=P.left,[3,5]);case 2:return N.length===0?[3,4]:(P=N.pop(),[4,P]);case 3:return $.sent(),P=P.right,[3,5];case 4:k=!0,$.label=5;case 5:return[3,1];case 6:return[2]}})},rt}();function m(rt,P,N,k){var $=k-N;if($>0){var W=N+Math.floor($/2),ht=rt[W],at=P[W],wt=new t(ht,at);return wt.left=m(rt,P,N,W),wt.right=m(rt,P,W+1,k),wt}return null}function _(rt,P){for(var N=new t(null,null),k=N,$=0;$<rt.length;$++)k=k.next=new t(rt[$],P[$]);return k.next=null,N.next}function E(rt){for(var P=rt,N=[],k=!1,$=new t(null,null),W=$;!k;)P?(N.push(P),P=P.left):N.length>0?(P=W=W.next=N.pop(),P=P.right):k=!0;return W.next=null,$.next}function S(rt,P,N){var k=N-P;if(k>0){var $=P+Math.floor(k/2),W=S(rt,P,$),ht=rt.head;return ht.left=W,rt.head=rt.head.next,ht.right=S(rt,$+1,N),ht}return null}function b(rt,P,N){for(var k=new t(null,null),$=k,W=rt,ht=P;W!==null&&ht!==null;)N(W.key,ht.key)<0?($.next=W,W=W.next):($.next=ht,ht=ht.next),$=$.next;return W!==null?$.next=W:ht!==null&&($.next=ht),k.next}function A(rt,P,N,k,$){if(!(N>=k)){for(var W=rt[N+k>>1],ht=N-1,at=k+1;;){do ht++;while($(rt[ht],W)<0);do at--;while($(rt[at],W)>0);if(ht>=at)break;var wt=rt[ht];rt[ht]=rt[at],rt[at]=wt,wt=P[ht],P[ht]=P[at],P[at]=wt}A(rt,P,N,at,$),A(rt,P,at+1,k,$)}}let I=(rt,P)=>rt.ll.x<=P.x&&P.x<=rt.ur.x&&rt.ll.y<=P.y&&P.y<=rt.ur.y,w=(rt,P)=>{if(P.ur.x<rt.ll.x||rt.ur.x<P.ll.x||P.ur.y<rt.ll.y||rt.ur.y<P.ll.y)return null;let N=rt.ll.x<P.ll.x?P.ll.x:rt.ll.x,k=rt.ur.x<P.ur.x?rt.ur.x:P.ur.x,$=rt.ll.y<P.ll.y?P.ll.y:rt.ll.y,W=rt.ur.y<P.ur.y?rt.ur.y:P.ur.y;return{ll:{x:N,y:$},ur:{x:k,y:W}}},x=Number.EPSILON;x===void 0&&(x=Math.pow(2,-52));let R=x*x,C=(rt,P)=>{if(-x<rt&&rt<x&&-x<P&&P<x)return 0;let N=rt-P;return N*N<R*rt*P?0:rt<P?-1:1};class F{constructor(){this.reset()}reset(){this.xRounder=new V,this.yRounder=new V}round(P,N){return{x:this.xRounder.round(P),y:this.yRounder.round(N)}}}class V{constructor(){this.tree=new g,this.round(0)}round(P){let N=this.tree.add(P),k=this.tree.prev(N);if(k!==null&&C(N.key,k.key)===0)return this.tree.remove(P),k.key;let $=this.tree.next(N);return $!==null&&C(N.key,$.key)===0?(this.tree.remove(P),$.key):P}}let X=new F,q=11102230246251565e-32,D=134217729,xt=(3+8*q)*q;function B(rt,P,N,k,$){let W,ht,at,wt,Et=P[0],G=k[0],st=0,et=0;G>Et==G>-Et?(W=Et,Et=P[++st]):(W=G,G=k[++et]);let lt=0;if(st<rt&&et<N)for(G>Et==G>-Et?(ht=Et+W,at=W-(ht-Et),Et=P[++st]):(ht=G+W,at=W-(ht-G),G=k[++et]),W=ht,at!==0&&($[lt++]=at);st<rt&&et<N;)G>Et==G>-Et?(ht=W+Et,wt=ht-W,at=W-(ht-wt)+(Et-wt),Et=P[++st]):(ht=W+G,wt=ht-W,at=W-(ht-wt)+(G-wt),G=k[++et]),W=ht,at!==0&&($[lt++]=at);for(;st<rt;)ht=W+Et,wt=ht-W,at=W-(ht-wt)+(Et-wt),Et=P[++st],W=ht,at!==0&&($[lt++]=at);for(;et<N;)ht=W+G,wt=ht-W,at=W-(ht-wt)+(G-wt),G=k[++et],W=ht,at!==0&&($[lt++]=at);return(W!==0||lt===0)&&($[lt++]=W),lt}function j(rt,P){let N=P[0];for(let k=1;k<rt;k++)N+=P[k];return N}function J(rt){return new Float64Array(rt)}let Dt=(3+16*q)*q,Q=(2+12*q)*q,At=(9+64*q)*q*q,Mt=J(4),Lt=J(8),pt=J(12),yt=J(16),K=J(4);function Bt(rt,P,N,k,$,W,ht){let at,wt,Et,G,st,et,lt,Ft,Kt,me,ve,He,Ue,Ye,je,wr,Jr,nr,Ie=rt-$,rr=N-$,pr=P-W,ur=k-W;Ye=Ie*ur,et=D*Ie,lt=et-(et-Ie),Ft=Ie-lt,et=D*ur,Kt=et-(et-ur),me=ur-Kt,je=Ft*me-(Ye-lt*Kt-Ft*Kt-lt*me),wr=pr*rr,et=D*pr,lt=et-(et-pr),Ft=pr-lt,et=D*rr,Kt=et-(et-rr),me=rr-Kt,Jr=Ft*me-(wr-lt*Kt-Ft*Kt-lt*me),ve=je-Jr,st=je-ve,Mt[0]=je-(ve+st)+(st-Jr),He=Ye+ve,st=He-Ye,Ue=Ye-(He-st)+(ve-st),ve=Ue-wr,st=Ue-ve,Mt[1]=Ue-(ve+st)+(st-wr),nr=He+ve,st=nr-He,Mt[2]=He-(nr-st)+(ve-st),Mt[3]=nr;let Qn=j(4,Mt),bi=Q*ht;if(Qn>=bi||-Qn>=bi||(st=rt-Ie,at=rt-(Ie+st)+(st-$),st=N-rr,Et=N-(rr+st)+(st-$),st=P-pr,wt=P-(pr+st)+(st-W),st=k-ur,G=k-(ur+st)+(st-W),at===0&&wt===0&&Et===0&&G===0)||(bi=At*ht+xt*Math.abs(Qn),Qn+=Ie*G+ur*at-(pr*Et+rr*wt),Qn>=bi||-Qn>=bi))return Qn;Ye=at*ur,et=D*at,lt=et-(et-at),Ft=at-lt,et=D*ur,Kt=et-(et-ur),me=ur-Kt,je=Ft*me-(Ye-lt*Kt-Ft*Kt-lt*me),wr=wt*rr,et=D*wt,lt=et-(et-wt),Ft=wt-lt,et=D*rr,Kt=et-(et-rr),me=rr-Kt,Jr=Ft*me-(wr-lt*Kt-Ft*Kt-lt*me),ve=je-Jr,st=je-ve,K[0]=je-(ve+st)+(st-Jr),He=Ye+ve,st=He-Ye,Ue=Ye-(He-st)+(ve-st),ve=Ue-wr,st=Ue-ve,K[1]=Ue-(ve+st)+(st-wr),nr=He+ve,st=nr-He,K[2]=He-(nr-st)+(ve-st),K[3]=nr;let oi=B(4,Mt,4,K,Lt);Ye=Ie*G,et=D*Ie,lt=et-(et-Ie),Ft=Ie-lt,et=D*G,Kt=et-(et-G),me=G-Kt,je=Ft*me-(Ye-lt*Kt-Ft*Kt-lt*me),wr=pr*Et,et=D*pr,lt=et-(et-pr),Ft=pr-lt,et=D*Et,Kt=et-(et-Et),me=Et-Kt,Jr=Ft*me-(wr-lt*Kt-Ft*Kt-lt*me),ve=je-Jr,st=je-ve,K[0]=je-(ve+st)+(st-Jr),He=Ye+ve,st=He-Ye,Ue=Ye-(He-st)+(ve-st),ve=Ue-wr,st=Ue-ve,K[1]=Ue-(ve+st)+(st-wr),nr=He+ve,st=nr-He,K[2]=He-(nr-st)+(ve-st),K[3]=nr;let Z=B(oi,Lt,4,K,pt);Ye=at*G,et=D*at,lt=et-(et-at),Ft=at-lt,et=D*G,Kt=et-(et-G),me=G-Kt,je=Ft*me-(Ye-lt*Kt-Ft*Kt-lt*me),wr=wt*Et,et=D*wt,lt=et-(et-wt),Ft=wt-lt,et=D*Et,Kt=et-(et-Et),me=Et-Kt,Jr=Ft*me-(wr-lt*Kt-Ft*Kt-lt*me),ve=je-Jr,st=je-ve,K[0]=je-(ve+st)+(st-Jr),He=Ye+ve,st=He-Ye,Ue=Ye-(He-st)+(ve-st),ve=Ue-wr,st=Ue-ve,K[1]=Ue-(ve+st)+(st-wr),nr=He+ve,st=nr-He,K[2]=He-(nr-st)+(ve-st),K[3]=nr;let mt=B(Z,pt,4,K,yt);return yt[mt-1]}function Gt(rt,P,N,k,$,W){let ht=(P-W)*(N-$),at=(rt-$)*(k-W),wt=ht-at,Et=Math.abs(ht+at);return Math.abs(wt)>=Dt*Et?wt:-Bt(rt,P,N,k,$,W,Et)}let ae=(rt,P)=>rt.x*P.y-rt.y*P.x,ut=(rt,P)=>rt.x*P.x+rt.y*P.y,Ut=(rt,P,N)=>{let k=Gt(rt.x,rt.y,P.x,P.y,N.x,N.y);return k>0?-1:k<0?1:0},jt=rt=>Math.sqrt(ut(rt,rt)),ce=(rt,P,N)=>{let k={x:P.x-rt.x,y:P.y-rt.y},$={x:N.x-rt.x,y:N.y-rt.y};return ae($,k)/jt($)/jt(k)},te=(rt,P,N)=>{let k={x:P.x-rt.x,y:P.y-rt.y},$={x:N.x-rt.x,y:N.y-rt.y};return ut($,k)/jt($)/jt(k)},$t=(rt,P,N)=>P.y===0?null:{x:rt.x+P.x/P.y*(N-rt.y),y:N},qt=(rt,P,N)=>P.x===0?null:{x:N,y:rt.y+P.y/P.x*(N-rt.x)},xe=(rt,P,N,k)=>{if(P.x===0)return qt(N,k,rt.x);if(k.x===0)return qt(rt,P,N.x);if(P.y===0)return $t(N,k,rt.y);if(k.y===0)return $t(rt,P,N.y);let $=ae(P,k);if($==0)return null;let W={x:N.x-rt.x,y:N.y-rt.y},ht=ae(W,P)/$,at=ae(W,k)/$,wt=rt.x+at*P.x,Et=N.x+ht*k.x,G=rt.y+at*P.y,st=N.y+ht*k.y,et=(wt+Et)/2,lt=(G+st)/2;return{x:et,y:lt}};class ft{static compare(P,N){let k=ft.comparePoints(P.point,N.point);return k!==0?k:(P.point!==N.point&&P.link(N),P.isLeft!==N.isLeft?P.isLeft?1:-1:ee.compare(P.segment,N.segment))}static comparePoints(P,N){return P.x<N.x?-1:P.x>N.x?1:P.y<N.y?-1:P.y>N.y?1:0}constructor(P,N){P.events===void 0?P.events=[this]:P.events.push(this),this.point=P,this.isLeft=N}link(P){if(P.point===this.point)throw new Error("Tried to link already linked events");let N=P.point.events;for(let k=0,$=N.length;k<$;k++){let W=N[k];this.point.events.push(W),W.point=this.point}this.checkForConsuming()}checkForConsuming(){let P=this.point.events.length;for(let N=0;N<P;N++){let k=this.point.events[N];if(k.segment.consumedBy===void 0)for(let $=N+1;$<P;$++){let W=this.point.events[$];W.consumedBy===void 0&&k.otherSE.point.events===W.otherSE.point.events&&k.segment.consume(W.segment)}}}getAvailableLinkedEvents(){let P=[];for(let N=0,k=this.point.events.length;N<k;N++){let $=this.point.events[N];$!==this&&!$.segment.ringOut&&$.segment.isInResult()&&P.push($)}return P}getLeftmostComparator(P){let N=new Map,k=$=>{let W=$.otherSE;N.set($,{sine:ce(this.point,P.point,W.point),cosine:te(this.point,P.point,W.point)})};return($,W)=>{N.has($)||k($),N.has(W)||k(W);let{sine:ht,cosine:at}=N.get($),{sine:wt,cosine:Et}=N.get(W);return ht>=0&&wt>=0?at<Et?1:at>Et?-1:0:ht<0&&wt<0?at<Et?-1:at>Et?1:0:wt<ht?-1:wt>ht?1:0}}}let Xe=0;class ee{static compare(P,N){let k=P.leftSE.point.x,$=N.leftSE.point.x,W=P.rightSE.point.x,ht=N.rightSE.point.x;if(ht<k)return 1;if(W<$)return-1;let at=P.leftSE.point.y,wt=N.leftSE.point.y,Et=P.rightSE.point.y,G=N.rightSE.point.y;if(k<$){if(wt<at&&wt<Et)return 1;if(wt>at&&wt>Et)return-1;let st=P.comparePoint(N.leftSE.point);if(st<0)return 1;if(st>0)return-1;let et=N.comparePoint(P.rightSE.point);return et!==0?et:-1}if(k>$){if(at<wt&&at<G)return-1;if(at>wt&&at>G)return 1;let st=N.comparePoint(P.leftSE.point);if(st!==0)return st;let et=P.comparePoint(N.rightSE.point);return et<0?1:et>0?-1:1}if(at<wt)return-1;if(at>wt)return 1;if(W<ht){let st=N.comparePoint(P.rightSE.point);if(st!==0)return st}if(W>ht){let st=P.comparePoint(N.rightSE.point);if(st<0)return 1;if(st>0)return-1}if(W!==ht){let st=Et-at,et=W-k,lt=G-wt,Ft=ht-$;if(st>et&&lt<Ft)return 1;if(st<et&&lt>Ft)return-1}return W>ht?1:W<ht||Et<G?-1:Et>G?1:P.id<N.id?-1:P.id>N.id?1:0}constructor(P,N,k,$){this.id=++Xe,this.leftSE=P,P.segment=this,P.otherSE=N,this.rightSE=N,N.segment=this,N.otherSE=P,this.rings=k,this.windings=$}static fromRing(P,N,k){let $,W,ht,at=ft.comparePoints(P,N);if(at<0)$=P,W=N,ht=1;else if(at>0)$=N,W=P,ht=-1;else throw new Error(\`Tried to create degenerate segment at [\${P.x}, \${P.y}]\`);let wt=new ft($,!0),Et=new ft(W,!1);return new ee(wt,Et,[k],[ht])}replaceRightSE(P){this.rightSE=P,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let P=this.leftSE.point.y,N=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:P<N?P:N},ur:{x:this.rightSE.point.x,y:P>N?P:N}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(P){return P.x===this.leftSE.point.x&&P.y===this.leftSE.point.y||P.x===this.rightSE.point.x&&P.y===this.rightSE.point.y}comparePoint(P){if(this.isAnEndpoint(P))return 0;let N=this.leftSE.point,k=this.rightSE.point,$=this.vector();if(N.x===k.x)return P.x===N.x?0:P.x<N.x?1:-1;let W=(P.y-N.y)/$.y,ht=N.x+W*$.x;if(P.x===ht)return 0;let at=(P.x-N.x)/$.x,wt=N.y+at*$.y;return P.y===wt?0:P.y<wt?-1:1}getIntersection(P){let N=this.bbox(),k=P.bbox(),$=w(N,k);if($===null)return null;let W=this.leftSE.point,ht=this.rightSE.point,at=P.leftSE.point,wt=P.rightSE.point,Et=I(N,at)&&this.comparePoint(at)===0,G=I(k,W)&&P.comparePoint(W)===0,st=I(N,wt)&&this.comparePoint(wt)===0,et=I(k,ht)&&P.comparePoint(ht)===0;if(G&&Et)return et&&!st?ht:!et&&st?wt:null;if(G)return st&&W.x===wt.x&&W.y===wt.y?null:W;if(Et)return et&&ht.x===at.x&&ht.y===at.y?null:at;if(et&&st)return null;if(et)return ht;if(st)return wt;let lt=xe(W,this.vector(),at,P.vector());return lt===null||!I($,lt)?null:X.round(lt.x,lt.y)}split(P){let N=[],k=P.events!==void 0,$=new ft(P,!0),W=new ft(P,!1),ht=this.rightSE;this.replaceRightSE(W),N.push(W),N.push($);let at=new ee($,ht,this.rings.slice(),this.windings.slice());return ft.comparePoints(at.leftSE.point,at.rightSE.point)>0&&at.swapEvents(),ft.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),k&&($.checkForConsuming(),W.checkForConsuming()),N}swapEvents(){let P=this.rightSE;this.rightSE=this.leftSE,this.leftSE=P,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let N=0,k=this.windings.length;N<k;N++)this.windings[N]*=-1}consume(P){let N=this,k=P;for(;N.consumedBy;)N=N.consumedBy;for(;k.consumedBy;)k=k.consumedBy;let $=ee.compare(N,k);if($!==0){if($>0){let W=N;N=k,k=W}if(N.prev===k){let W=N;N=k,k=W}for(let W=0,ht=k.rings.length;W<ht;W++){let at=k.rings[W],wt=k.windings[W],Et=N.rings.indexOf(at);Et===-1?(N.rings.push(at),N.windings.push(wt)):N.windings[Et]+=wt}k.rings=null,k.windings=null,k.consumedBy=N,k.leftSE.consumedBy=N.leftSE,k.rightSE.consumedBy=N.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let P=this.prev.consumedBy||this.prev;this._beforeState=P.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let P=this.beforeState();this._afterState={rings:P.rings.slice(0),windings:P.windings.slice(0),multiPolys:[]};let N=this._afterState.rings,k=this._afterState.windings,$=this._afterState.multiPolys;for(let at=0,wt=this.rings.length;at<wt;at++){let Et=this.rings[at],G=this.windings[at],st=N.indexOf(Et);st===-1?(N.push(Et),k.push(G)):k[st]+=G}let W=[],ht=[];for(let at=0,wt=N.length;at<wt;at++){if(k[at]===0)continue;let Et=N[at],G=Et.poly;if(ht.indexOf(G)===-1)if(Et.isExterior)W.push(G);else{ht.indexOf(G)===-1&&ht.push(G);let st=W.indexOf(Et.poly);st!==-1&&W.splice(st,1)}}for(let at=0,wt=W.length;at<wt;at++){let Et=W[at].multiPoly;$.indexOf(Et)===-1&&$.push(Et)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let P=this.beforeState().multiPolys,N=this.afterState().multiPolys;switch(dt.type){case"union":{let k=P.length===0,$=N.length===0;this._isInResult=k!==$;break}case"intersection":{let k,$;P.length<N.length?(k=P.length,$=N.length):(k=N.length,$=P.length),this._isInResult=$===dt.numMultiPolys&&k<$;break}case"xor":{let k=Math.abs(P.length-N.length);this._isInResult=k%2===1;break}case"difference":{let k=$=>$.length===1&&$[0].isSubject;this._isInResult=k(P)!==k(N);break}default:throw new Error(\`Unrecognized operation type found \${dt.type}\`)}return this._isInResult}}class ge{constructor(P,N,k){if(!Array.isArray(P)||P.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=N,this.isExterior=k,this.segments=[],typeof P[0][0]!="number"||typeof P[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let $=X.round(P[0][0],P[0][1]);this.bbox={ll:{x:$.x,y:$.y},ur:{x:$.x,y:$.y}};let W=$;for(let ht=1,at=P.length;ht<at;ht++){if(typeof P[ht][0]!="number"||typeof P[ht][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let wt=X.round(P[ht][0],P[ht][1]);wt.x===W.x&&wt.y===W.y||(this.segments.push(ee.fromRing(W,wt,this)),wt.x<this.bbox.ll.x&&(this.bbox.ll.x=wt.x),wt.y<this.bbox.ll.y&&(this.bbox.ll.y=wt.y),wt.x>this.bbox.ur.x&&(this.bbox.ur.x=wt.x),wt.y>this.bbox.ur.y&&(this.bbox.ur.y=wt.y),W=wt)}($.x!==W.x||$.y!==W.y)&&this.segments.push(ee.fromRing(W,$,this))}getSweepEvents(){let P=[];for(let N=0,k=this.segments.length;N<k;N++){let $=this.segments[N];P.push($.leftSE),P.push($.rightSE)}return P}}class fe{constructor(P,N){if(!Array.isArray(P))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new ge(P[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let k=1,$=P.length;k<$;k++){let W=new ge(P[k],this,!1);W.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=W.bbox.ll.x),W.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=W.bbox.ll.y),W.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=W.bbox.ur.x),W.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=W.bbox.ur.y),this.interiorRings.push(W)}this.multiPoly=N}getSweepEvents(){let P=this.exteriorRing.getSweepEvents();for(let N=0,k=this.interiorRings.length;N<k;N++){let $=this.interiorRings[N].getSweepEvents();for(let W=0,ht=$.length;W<ht;W++)P.push($[W])}return P}}class Te{constructor(P,N){if(!Array.isArray(P))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof P[0][0][0]=="number"&&(P=[P])}catch(k){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let k=0,$=P.length;k<$;k++){let W=new fe(P[k],this);W.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=W.bbox.ll.x),W.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=W.bbox.ll.y),W.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=W.bbox.ur.x),W.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=W.bbox.ur.y),this.polys.push(W)}this.isSubject=N}getSweepEvents(){let P=[];for(let N=0,k=this.polys.length;N<k;N++){let $=this.polys[N].getSweepEvents();for(let W=0,ht=$.length;W<ht;W++)P.push($[W])}return P}}class be{static factory(P){let N=[];for(let k=0,$=P.length;k<$;k++){let W=P[k];if(!W.isInResult()||W.ringOut)continue;let ht=null,at=W.leftSE,wt=W.rightSE,Et=[at],G=at.point,st=[];for(;ht=at,at=wt,Et.push(at),at.point!==G;)for(;;){let et=at.getAvailableLinkedEvents();if(et.length===0){let Kt=Et[0].point,me=Et[Et.length-1].point;throw new Error(\`Unable to complete output ring starting at [\${Kt.x}, \${Kt.y}]. Last matching segment found ends at [\${me.x}, \${me.y}].\`)}if(et.length===1){wt=et[0].otherSE;break}let lt=null;for(let Kt=0,me=st.length;Kt<me;Kt++)if(st[Kt].point===at.point){lt=Kt;break}if(lt!==null){let Kt=st.splice(lt)[0],me=Et.splice(Kt.index);me.unshift(me[0].otherSE),N.push(new be(me.reverse()));continue}st.push({index:Et.length,point:at.point});let Ft=at.getLeftmostComparator(ht);wt=et.sort(Ft)[0].otherSE;break}N.push(new be(Et))}return N}constructor(P){this.events=P;for(let N=0,k=P.length;N<k;N++)P[N].segment.ringOut=this;this.poly=null}getGeom(){let P=this.events[0].point,N=[P];for(let Et=1,G=this.events.length-1;Et<G;Et++){let st=this.events[Et].point,et=this.events[Et+1].point;Ut(st,P,et)!==0&&(N.push(st),P=st)}if(N.length===1)return null;let k=N[0],$=N[1];Ut(k,P,$)===0&&N.shift(),N.push(N[0]);let W=this.isExteriorRing()?1:-1,ht=this.isExteriorRing()?0:N.length-1,at=this.isExteriorRing()?N.length:-1,wt=[];for(let Et=ht;Et!=at;Et+=W)wt.push([N[Et].x,N[Et].y]);return wt}isExteriorRing(){if(this._isExteriorRing===void 0){let P=this.enclosingRing();this._isExteriorRing=P?!P.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let P=this.events[0];for(let $=1,W=this.events.length;$<W;$++){let ht=this.events[$];ft.compare(P,ht)>0&&(P=ht)}let N=P.segment.prevInResult(),k=N?N.prevInResult():null;for(;;){if(!N)return null;if(!k)return N.ringOut;if(k.ringOut!==N.ringOut)return k.ringOut.enclosingRing()!==N.ringOut?N.ringOut:N.ringOut.enclosingRing();N=k.prevInResult(),k=N?N.prevInResult():null}}}class Wt{constructor(P){this.exteriorRing=P,P.poly=this,this.interiorRings=[]}addInterior(P){this.interiorRings.push(P),P.poly=this}getGeom(){let P=[this.exteriorRing.getGeom()];if(P[0]===null)return null;for(let N=0,k=this.interiorRings.length;N<k;N++){let $=this.interiorRings[N].getGeom();$!==null&&P.push($)}return P}}class Me{constructor(P){this.rings=P,this.polys=this._composePolys(P)}getGeom(){let P=[];for(let N=0,k=this.polys.length;N<k;N++){let $=this.polys[N].getGeom();$!==null&&P.push($)}return P}_composePolys(P){let N=[];for(let k=0,$=P.length;k<$;k++){let W=P[k];if(!W.poly)if(W.isExteriorRing())N.push(new Wt(W));else{let ht=W.enclosingRing();ht.poly||N.push(new Wt(ht)),ht.poly.addInterior(W)}}return N}}class tt{constructor(P){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ee.compare;this.queue=P,this.tree=new g(N),this.segments=[]}process(P){let N=P.segment,k=[];if(P.consumedBy)return P.isLeft?this.queue.remove(P.otherSE):this.tree.remove(N),k;let $=P.isLeft?this.tree.add(N):this.tree.find(N);if(!$)throw new Error(\`Unable to find segment #\${N.id} [\${N.leftSE.point.x}, \${N.leftSE.point.y}] -> [\${N.rightSE.point.x}, \${N.rightSE.point.y}] in SweepLine tree.\`);let W=$,ht=$,at,wt;for(;at===void 0;)W=this.tree.prev(W),W===null?at=null:W.key.consumedBy===void 0&&(at=W.key);for(;wt===void 0;)ht=this.tree.next(ht),ht===null?wt=null:ht.key.consumedBy===void 0&&(wt=ht.key);if(P.isLeft){let Et=null;if(at){let st=at.getIntersection(N);if(st!==null&&(N.isAnEndpoint(st)||(Et=st),!at.isAnEndpoint(st))){let et=this._splitSafely(at,st);for(let lt=0,Ft=et.length;lt<Ft;lt++)k.push(et[lt])}}let G=null;if(wt){let st=wt.getIntersection(N);if(st!==null&&(N.isAnEndpoint(st)||(G=st),!wt.isAnEndpoint(st))){let et=this._splitSafely(wt,st);for(let lt=0,Ft=et.length;lt<Ft;lt++)k.push(et[lt])}}if(Et!==null||G!==null){let st=null;Et===null?st=G:G===null?st=Et:st=ft.comparePoints(Et,G)<=0?Et:G,this.queue.remove(N.rightSE),k.push(N.rightSE);let et=N.split(st);for(let lt=0,Ft=et.length;lt<Ft;lt++)k.push(et[lt])}k.length>0?(this.tree.remove(N),k.push(P)):(this.segments.push(N),N.prev=at)}else{if(at&&wt){let Et=at.getIntersection(wt);if(Et!==null){if(!at.isAnEndpoint(Et)){let G=this._splitSafely(at,Et);for(let st=0,et=G.length;st<et;st++)k.push(G[st])}if(!wt.isAnEndpoint(Et)){let G=this._splitSafely(wt,Et);for(let st=0,et=G.length;st<et;st++)k.push(G[st])}}}this.tree.remove(N)}return k}_splitSafely(P,N){this.tree.remove(P);let k=P.rightSE;this.queue.remove(k);let $=P.split(N);return $.push(k),P.consumedBy===void 0&&this.tree.add(P),$}}let z=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,It=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Ot{run(P,N,k){dt.type=P,X.reset();let $=[new Te(N,!0)];for(let st=0,et=k.length;st<et;st++)$.push(new Te(k[st],!1));if(dt.numMultiPolys=$.length,dt.type==="difference"){let st=$[0],et=1;for(;et<$.length;)w($[et].bbox,st.bbox)!==null?et++:$.splice(et,1)}if(dt.type==="intersection")for(let st=0,et=$.length;st<et;st++){let lt=$[st];for(let Ft=st+1,Kt=$.length;Ft<Kt;Ft++)if(w(lt.bbox,$[Ft].bbox)===null)return[]}let W=new g(ft.compare);for(let st=0,et=$.length;st<et;st++){let lt=$[st].getSweepEvents();for(let Ft=0,Kt=lt.length;Ft<Kt;Ft++)if(W.insert(lt[Ft]),W.size>z)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let ht=new tt(W),at=W.size,wt=W.pop();for(;wt;){let st=wt.key;if(W.size===at){let lt=st.segment;throw new Error(\`Unable to pop() \${st.isLeft?"left":"right"} SweepEvent [\${st.point.x}, \${st.point.y}] from segment #\${lt.id} [\${lt.leftSE.point.x}, \${lt.leftSE.point.y}] -> [\${lt.rightSE.point.x}, \${lt.rightSE.point.y}] from queue.\`)}if(W.size>z)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(ht.segments.length>It)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let et=ht.process(st);for(let lt=0,Ft=et.length;lt<Ft;lt++){let Kt=et[lt];Kt.consumedBy===void 0&&W.insert(Kt)}at=W.size,wt=W.pop()}X.reset();let Et=be.factory(ht.segments);return new Me(Et).getGeom()}}let dt=new Ot;var ne={union:function(rt){for(var P=arguments.length,N=new Array(P>1?P-1:0),k=1;k<P;k++)N[k-1]=arguments[k];return dt.run("union",rt,N)},intersection:function(rt){for(var P=arguments.length,N=new Array(P>1?P-1:0),k=1;k<P;k++)N[k-1]=arguments[k];return dt.run("intersection",rt,N)},xor:function(rt){for(var P=arguments.length,N=new Array(P>1?P-1:0),k=1;k<P;k++)N[k-1]=arguments[k];return dt.run("xor",rt,N)},difference:function(rt){for(var P=arguments.length,N=new Array(P>1?P-1:0),k=1;k<P;k++)N[k-1]=arguments[k];return dt.run("difference",rt,N)}};return ne})});var QL=ot((zg,jL)=>{(function(n,t){typeof zg=="object"&&typeof jL!="undefined"?t(zg):typeof define=="function"&&define.amd?define(["exports"],t):t(n.jsts={})})(zg,function(n){"use strict";function t(){}function e(r){this.message=r||""}function o(r){this.message=r||""}function s(r){this.message=r||""}function l(){}function p(r){return r===null?je:r.color}function h(r){return r===null?null:r.parent}function g(r,i){r!==null&&(r.color=i)}function m(r){return r===null?null:r.left}function _(r){return r===null?null:r.right}function E(){this.root_=null,this.size_=0}function S(){}function b(){this.array_=[],arguments[0]instanceof at&&this.addAll(arguments[0])}function A(){}function I(r){this.message=r||""}function w(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(r){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var i=Object(this),a=Math.max(Math.min(i.length,9007199254740991),0)||0,c=1 in arguments&&parseInt(Number(arguments[1]),10)||0;c=c<0?Math.max(a+c,0):Math.min(c,a);var d=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:a;for(d=d<0?Math.max(a+arguments[2],0):Math.min(d,a);c<d;)i[c]=r,++c;return i},writable:!0}),Number.isFinite=Number.isFinite||function(r){return typeof r=="number"&&isFinite(r)},Number.isInteger=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(r){return r!=r},Math.trunc=Math.trunc||function(r){return r<0?Math.ceil(r):Math.floor(r)};var x=function(){};x.prototype.interfaces_=function(){return[]},x.prototype.getClass=function(){return x},x.prototype.equalsWithTolerance=function(r,i,a){return Math.abs(r-i)<=a};var R=function(r){function i(a){r.call(this,a),this.name="IllegalArgumentException",this.message=a,this.stack=new r().stack}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i}(Error),C=function(){},F={MAX_VALUE:{configurable:!0}};C.isNaN=function(r){return Number.isNaN(r)},C.doubleToLongBits=function(r){return r},C.longBitsToDouble=function(r){return r},C.isInfinite=function(r){return!Number.isFinite(r)},F.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(C,F);var V=function(){},X=function(){},q=function(){},D=function r(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=r.NULL_ORDINATE;else if(arguments.length===1){var i=arguments[0];this.x=i.x,this.y=i.y,this.z=i.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=r.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},xt={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};D.prototype.setOrdinate=function(r,i){switch(r){case D.X:this.x=i;break;case D.Y:this.y=i;break;case D.Z:this.z=i;break;default:throw new R("Invalid ordinate index: "+r)}},D.prototype.equals2D=function(){if(arguments.length===1){var r=arguments[0];return this.x===r.x&&this.y===r.y}if(arguments.length===2){var i=arguments[0],a=arguments[1];return!!x.equalsWithTolerance(this.x,i.x,a)&&!!x.equalsWithTolerance(this.y,i.y,a)}},D.prototype.getOrdinate=function(r){switch(r){case D.X:return this.x;case D.Y:return this.y;case D.Z:return this.z}throw new R("Invalid ordinate index: "+r)},D.prototype.equals3D=function(r){return this.x===r.x&&this.y===r.y&&(this.z===r.z||C.isNaN(this.z))&&C.isNaN(r.z)},D.prototype.equals=function(r){return r instanceof D&&this.equals2D(r)},D.prototype.equalInZ=function(r,i){return x.equalsWithTolerance(this.z,r.z,i)},D.prototype.compareTo=function(r){var i=r;return this.x<i.x?-1:this.x>i.x?1:this.y<i.y?-1:this.y>i.y?1:0},D.prototype.clone=function(){},D.prototype.copy=function(){return new D(this)},D.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},D.prototype.distance3D=function(r){var i=this.x-r.x,a=this.y-r.y,c=this.z-r.z;return Math.sqrt(i*i+a*a+c*c)},D.prototype.distance=function(r){var i=this.x-r.x,a=this.y-r.y;return Math.sqrt(i*i+a*a)},D.prototype.hashCode=function(){var r=17;return r=37*r+D.hashCode(this.x),r=37*r+D.hashCode(this.y)},D.prototype.setCoordinate=function(r){this.x=r.x,this.y=r.y,this.z=r.z},D.prototype.interfaces_=function(){return[V,X,t]},D.prototype.getClass=function(){return D},D.hashCode=function(){if(arguments.length===1){var r=arguments[0],i=C.doubleToLongBits(r);return Math.trunc((i^i)>>>32)}},xt.DimensionalComparator.get=function(){return B},xt.serialVersionUID.get=function(){return 6683108902428367e3},xt.NULL_ORDINATE.get=function(){return C.NaN},xt.X.get=function(){return 0},xt.Y.get=function(){return 1},xt.Z.get=function(){return 2},Object.defineProperties(D,xt);var B=function(r){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var i=arguments[0];if(i!==2&&i!==3)throw new R("only 2 or 3 dimensions may be specified");this._dimensionsToTest=i}}};B.prototype.compare=function(r,i){var a=r,c=i,d=B.compare(a.x,c.x);if(d!==0)return d;var v=B.compare(a.y,c.y);return v!==0?v:this._dimensionsToTest<=2?0:B.compare(a.z,c.z)},B.prototype.interfaces_=function(){return[q]},B.prototype.getClass=function(){return B},B.compare=function(r,i){return r<i?-1:r>i?1:C.isNaN(r)?C.isNaN(i)?0:-1:C.isNaN(i)?1:0};var j=function(){};j.prototype.create=function(){},j.prototype.interfaces_=function(){return[]},j.prototype.getClass=function(){return j};var J=function(){},Dt={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};J.prototype.interfaces_=function(){return[]},J.prototype.getClass=function(){return J},J.toLocationSymbol=function(r){switch(r){case J.EXTERIOR:return"e";case J.BOUNDARY:return"b";case J.INTERIOR:return"i";case J.NONE:return"-"}throw new R("Unknown location value: "+r)},Dt.INTERIOR.get=function(){return 0},Dt.BOUNDARY.get=function(){return 1},Dt.EXTERIOR.get=function(){return 2},Dt.NONE.get=function(){return-1},Object.defineProperties(J,Dt);var Q=function(r,i){return r.interfaces_&&r.interfaces_().indexOf(i)>-1},At=function(){},Mt={LOG_10:{configurable:!0}};At.prototype.interfaces_=function(){return[]},At.prototype.getClass=function(){return At},At.log10=function(r){var i=Math.log(r);return C.isInfinite(i)||C.isNaN(i)?i:i/At.LOG_10},At.min=function(r,i,a,c){var d=r;return i<d&&(d=i),a<d&&(d=a),c<d&&(d=c),d},At.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var r=arguments[0],i=arguments[1],a=arguments[2];return r<i?i:r>a?a:r}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var c=arguments[0],d=arguments[1],v=arguments[2];return c<d?d:c>v?v:c}},At.wrap=function(r,i){return r<0?i- -r%i:r%i},At.max=function(){if(arguments.length===3){var r=arguments[0],i=arguments[1],a=arguments[2],c=r;return i>c&&(c=i),a>c&&(c=a),c}if(arguments.length===4){var d=arguments[0],v=arguments[1],M=arguments[2],L=arguments[3],H=d;return v>H&&(H=v),M>H&&(H=M),L>H&&(H=L),H}},At.average=function(r,i){return(r+i)/2},Mt.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(At,Mt);var Lt=function(r){this.str=r};Lt.prototype.append=function(r){this.str+=r},Lt.prototype.setCharAt=function(r,i){this.str=this.str.substr(0,r)+i+this.str.substr(r+1)},Lt.prototype.toString=function(r){return this.str};var pt=function(r){this.value=r};pt.prototype.intValue=function(){return this.value},pt.prototype.compareTo=function(r){return this.value<r?-1:this.value>r?1:0},pt.isNaN=function(r){return Number.isNaN(r)};var yt=function(){};yt.isWhitespace=function(r){return r<=32&&r>=0||r===127},yt.toUpperCase=function(r){return r.toUpperCase()};var K=function r(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var i=arguments[0];this.init(i)}else if(arguments[0]instanceof r){var a=arguments[0];this.init(a)}else if(typeof arguments[0]=="string"){var c=arguments[0];r.call(this,r.parse(c))}}else if(arguments.length===2){var d=arguments[0],v=arguments[1];this.init(d,v)}},Bt={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};K.prototype.le=function(r){return(this._hi<r._hi||this._hi===r._hi)&&this._lo<=r._lo},K.prototype.extractSignificantDigits=function(r,i){var a=this.abs(),c=K.magnitude(a._hi),d=K.TEN.pow(c);(a=a.divide(d)).gt(K.TEN)?(a=a.divide(K.TEN),c+=1):a.lt(K.ONE)&&(a=a.multiply(K.TEN),c-=1);for(var v=c+1,M=new Lt,L=K.MAX_PRINT_DIGITS-1,H=0;H<=L;H++){r&&H===v&&M.append(".");var it=Math.trunc(a._hi);if(it<0)break;var bt=!1,Tt=0;it>9?(bt=!0,Tt="9"):Tt="0"+it,M.append(Tt),a=a.subtract(K.valueOf(it)).multiply(K.TEN),bt&&a.selfAdd(K.TEN);var Jt=!0,Qt=K.magnitude(a._hi);if(Qt<0&&Math.abs(Qt)>=L-H&&(Jt=!1),!Jt)break}return i[0]=c,M.toString()},K.prototype.sqr=function(){return this.multiply(this)},K.prototype.doubleValue=function(){return this._hi+this._lo},K.prototype.subtract=function(){if(arguments[0]instanceof K){var r=arguments[0];return this.add(r.negate())}if(typeof arguments[0]=="number"){var i=arguments[0];return this.add(-i)}},K.prototype.equals=function(){if(arguments.length===1){var r=arguments[0];return this._hi===r._hi&&this._lo===r._lo}},K.prototype.isZero=function(){return this._hi===0&&this._lo===0},K.prototype.selfSubtract=function(){if(arguments[0]instanceof K){var r=arguments[0];return this.isNaN()?this:this.selfAdd(-r._hi,-r._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.isNaN()?this:this.selfAdd(-i,0)}},K.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},K.prototype.min=function(r){return this.le(r)?this:r},K.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof K){var r=arguments[0];return this.selfDivide(r._hi,r._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.selfDivide(i,0)}}else if(arguments.length===2){var a=arguments[0],c=arguments[1],d=null,v=null,M=null,L=null,H=null,it=null,bt=null,Tt=null;return H=this._hi/a,it=K.SPLIT*H,d=it-H,Tt=K.SPLIT*a,d=it-d,v=H-d,M=Tt-a,bt=H*a,M=Tt-M,L=a-M,Tt=d*M-bt+d*L+v*M+v*L,it=(this._hi-bt-Tt+this._lo-H*c)/a,Tt=H+it,this._hi=Tt,this._lo=H-Tt+it,this}},K.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},K.prototype.divide=function(){if(arguments[0]instanceof K){var r=arguments[0],i=null,a=null,c=null,d=null,v=null,M=null,L=null,H=null;return a=(v=this._hi/r._hi)-(i=(M=K.SPLIT*v)-(i=M-v)),H=i*(c=(H=K.SPLIT*r._hi)-(c=H-r._hi))-(L=v*r._hi)+i*(d=r._hi-c)+a*c+a*d,M=(this._hi-L-H+this._lo-v*r._lo)/r._hi,new K(H=v+M,v-H+M)}if(typeof arguments[0]=="number"){var it=arguments[0];return C.isNaN(it)?K.createNaN():K.copy(this).selfDivide(it,0)}},K.prototype.ge=function(r){return(this._hi>r._hi||this._hi===r._hi)&&this._lo>=r._lo},K.prototype.pow=function(r){if(r===0)return K.valueOf(1);var i=new K(this),a=K.valueOf(1),c=Math.abs(r);if(c>1)for(;c>0;)c%2==1&&a.selfMultiply(i),(c/=2)>0&&(i=i.sqr());else a=i;return r<0?a.reciprocal():a},K.prototype.ceil=function(){if(this.isNaN())return K.NaN;var r=Math.ceil(this._hi),i=0;return r===this._hi&&(i=Math.ceil(this._lo)),new K(r,i)},K.prototype.compareTo=function(r){var i=r;return this._hi<i._hi?-1:this._hi>i._hi?1:this._lo<i._lo?-1:this._lo>i._lo?1:0},K.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},K.prototype.setValue=function(){if(arguments[0]instanceof K){var r=arguments[0];return this.init(r),this}if(typeof arguments[0]=="number"){var i=arguments[0];return this.init(i),this}},K.prototype.max=function(r){return this.ge(r)?this:r},K.prototype.sqrt=function(){if(this.isZero())return K.valueOf(0);if(this.isNegative())return K.NaN;var r=1/Math.sqrt(this._hi),i=this._hi*r,a=K.valueOf(i),c=this.subtract(a.sqr())._hi*(.5*r);return a.add(c)},K.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof K){var r=arguments[0];return this.selfAdd(r._hi,r._lo)}if(typeof arguments[0]=="number"){var i=arguments[0],a=null,c=null,d=null,v=null,M=null,L=null;return d=this._hi+i,M=d-this._hi,v=d-M,v=i-M+(this._hi-v),L=v+this._lo,a=d+L,c=L+(d-a),this._hi=a+c,this._lo=c+(a-this._hi),this}}else if(arguments.length===2){var H=arguments[0],it=arguments[1],bt=null,Tt=null,Jt=null,Qt=null,le=null,Ee=null,Dn=null;Qt=this._hi+H,Tt=this._lo+it,le=Qt-(Ee=Qt-this._hi),Jt=Tt-(Dn=Tt-this._lo);var Kn=(bt=Qt+(Ee=(le=H-Ee+(this._hi-le))+Tt))+(Ee=(Jt=it-Dn+(this._lo-Jt))+(Ee+(Qt-bt))),fi=Ee+(bt-Kn);return this._hi=Kn,this._lo=fi,this}},K.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof K){var r=arguments[0];return this.selfMultiply(r._hi,r._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.selfMultiply(i,0)}}else if(arguments.length===2){var a=arguments[0],c=arguments[1],d=null,v=null,M=null,L=null,H=null,it=null;d=(H=K.SPLIT*this._hi)-this._hi,it=K.SPLIT*a,d=H-d,v=this._hi-d,M=it-a;var bt=(H=this._hi*a)+(it=d*(M=it-M)-H+d*(L=a-M)+v*M+v*L+(this._hi*c+this._lo*a)),Tt=it+(d=H-bt);return this._hi=bt,this._lo=Tt,this}},K.prototype.selfSqr=function(){return this.selfMultiply(this)},K.prototype.floor=function(){if(this.isNaN())return K.NaN;var r=Math.floor(this._hi),i=0;return r===this._hi&&(i=Math.floor(this._lo)),new K(r,i)},K.prototype.negate=function(){return this.isNaN()?this:new K(-this._hi,-this._lo)},K.prototype.clone=function(){},K.prototype.multiply=function(){if(arguments[0]instanceof K){var r=arguments[0];return r.isNaN()?K.createNaN():K.copy(this).selfMultiply(r)}if(typeof arguments[0]=="number"){var i=arguments[0];return C.isNaN(i)?K.createNaN():K.copy(this).selfMultiply(i,0)}},K.prototype.isNaN=function(){return C.isNaN(this._hi)},K.prototype.intValue=function(){return Math.trunc(this._hi)},K.prototype.toString=function(){var r=K.magnitude(this._hi);return r>=-3&&r<=20?this.toStandardNotation():this.toSciNotation()},K.prototype.toStandardNotation=function(){var r=this.getSpecialNumberString();if(r!==null)return r;var i=new Array(1).fill(null),a=this.extractSignificantDigits(!0,i),c=i[0]+1,d=a;if(a.charAt(0)===".")d="0"+a;else if(c<0)d="0."+K.stringOfChar("0",-c)+a;else if(a.indexOf(".")===-1){var v=c-a.length;d=a+K.stringOfChar("0",v)+".0"}return this.isNegative()?"-"+d:d},K.prototype.reciprocal=function(){var r=null,i=null,a=null,c=null,d=null,v=null,M=null,L=null;i=(d=1/this._hi)-(r=(v=K.SPLIT*d)-(r=v-d)),a=(L=K.SPLIT*this._hi)-this._hi;var H=d+(v=(1-(M=d*this._hi)-(L=r*(a=L-a)-M+r*(c=this._hi-a)+i*a+i*c)-d*this._lo)/this._hi);return new K(H,d-H+v)},K.prototype.toSciNotation=function(){if(this.isZero())return K.SCI_NOT_ZERO;var r=this.getSpecialNumberString();if(r!==null)return r;var i=new Array(1).fill(null),a=this.extractSignificantDigits(!1,i),c=K.SCI_NOT_EXPONENT_CHAR+i[0];if(a.charAt(0)==="0")throw new Error("Found leading zero: "+a);var d="";a.length>1&&(d=a.substring(1));var v=a.charAt(0)+"."+d;return this.isNegative()?"-"+v+c:v+c},K.prototype.abs=function(){return this.isNaN()?K.NaN:this.isNegative()?this.negate():new K(this)},K.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},K.prototype.lt=function(r){return(this._hi<r._hi||this._hi===r._hi)&&this._lo<r._lo},K.prototype.add=function(){if(arguments[0]instanceof K){var r=arguments[0];return K.copy(this).selfAdd(r)}if(typeof arguments[0]=="number"){var i=arguments[0];return K.copy(this).selfAdd(i)}},K.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var r=arguments[0];this._hi=r,this._lo=0}else if(arguments[0]instanceof K){var i=arguments[0];this._hi=i._hi,this._lo=i._lo}}else if(arguments.length===2){var a=arguments[0],c=arguments[1];this._hi=a,this._lo=c}},K.prototype.gt=function(r){return(this._hi>r._hi||this._hi===r._hi)&&this._lo>r._lo},K.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},K.prototype.trunc=function(){return this.isNaN()?K.NaN:this.isPositive()?this.floor():this.ceil()},K.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},K.prototype.interfaces_=function(){return[t,V,X]},K.prototype.getClass=function(){return K},K.sqr=function(r){return K.valueOf(r).selfMultiply(r)},K.valueOf=function(){if(typeof arguments[0]=="string"){var r=arguments[0];return K.parse(r)}if(typeof arguments[0]=="number"){var i=arguments[0];return new K(i)}},K.sqrt=function(r){return K.valueOf(r).sqrt()},K.parse=function(r){for(var i=0,a=r.length;yt.isWhitespace(r.charAt(i));)i++;var c=!1;if(i<a){var d=r.charAt(i);d!=="-"&&d!=="+"||(i++,d==="-"&&(c=!0))}for(var v=new K,M=0,L=0,H=0;!(i>=a);){var it=r.charAt(i);if(i++,yt.isDigit(it)){var bt=it-"0";v.selfMultiply(K.TEN),v.selfAdd(bt),M++}else{if(it!=="."){if(it==="e"||it==="E"){var Tt=r.substring(i);try{H=pt.parseInt(Tt)}catch(Dn){throw Dn instanceof Error?new Error("Invalid exponent "+Tt+" in string "+r):Dn}break}throw new Error("Unexpected character '"+it+"' at position "+i+" in string "+r)}L=M}}var Jt=v,Qt=M-L-H;if(Qt===0)Jt=v;else if(Qt>0){var le=K.TEN.pow(Qt);Jt=v.divide(le)}else if(Qt<0){var Ee=K.TEN.pow(-Qt);Jt=v.multiply(Ee)}return c?Jt.negate():Jt},K.createNaN=function(){return new K(C.NaN,C.NaN)},K.copy=function(r){return new K(r)},K.magnitude=function(r){var i=Math.abs(r),a=Math.log(i)/Math.log(10),c=Math.trunc(Math.floor(a));return 10*Math.pow(10,c)<=i&&(c+=1),c},K.stringOfChar=function(r,i){for(var a=new Lt,c=0;c<i;c++)a.append(r);return a.toString()},Bt.PI.get=function(){return new K(3.141592653589793,12246467991473532e-32)},Bt.TWO_PI.get=function(){return new K(6.283185307179586,24492935982947064e-32)},Bt.PI_2.get=function(){return new K(1.5707963267948966,6123233995736766e-32)},Bt.E.get=function(){return new K(2.718281828459045,14456468917292502e-32)},Bt.NaN.get=function(){return new K(C.NaN,C.NaN)},Bt.EPS.get=function(){return 123259516440783e-46},Bt.SPLIT.get=function(){return 134217729},Bt.MAX_PRINT_DIGITS.get=function(){return 32},Bt.TEN.get=function(){return K.valueOf(10)},Bt.ONE.get=function(){return K.valueOf(1)},Bt.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},Bt.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(K,Bt);var Gt=function(){},ae={DP_SAFE_EPSILON:{configurable:!0}};Gt.prototype.interfaces_=function(){return[]},Gt.prototype.getClass=function(){return Gt},Gt.orientationIndex=function(r,i,a){var c=Gt.orientationIndexFilter(r,i,a);if(c<=1)return c;var d=K.valueOf(i.x).selfAdd(-r.x),v=K.valueOf(i.y).selfAdd(-r.y),M=K.valueOf(a.x).selfAdd(-i.x),L=K.valueOf(a.y).selfAdd(-i.y);return d.selfMultiply(L).selfSubtract(v.selfMultiply(M)).signum()},Gt.signOfDet2x2=function(r,i,a,c){return r.multiply(c).selfSubtract(i.multiply(a)).signum()},Gt.intersection=function(r,i,a,c){var d=K.valueOf(c.y).selfSubtract(a.y).selfMultiply(K.valueOf(i.x).selfSubtract(r.x)),v=K.valueOf(c.x).selfSubtract(a.x).selfMultiply(K.valueOf(i.y).selfSubtract(r.y)),M=d.subtract(v),L=K.valueOf(c.x).selfSubtract(a.x).selfMultiply(K.valueOf(r.y).selfSubtract(a.y)),H=K.valueOf(c.y).selfSubtract(a.y).selfMultiply(K.valueOf(r.x).selfSubtract(a.x)),it=L.subtract(H).selfDivide(M).doubleValue(),bt=K.valueOf(r.x).selfAdd(K.valueOf(i.x).selfSubtract(r.x).selfMultiply(it)).doubleValue(),Tt=K.valueOf(i.x).selfSubtract(r.x).selfMultiply(K.valueOf(r.y).selfSubtract(a.y)),Jt=K.valueOf(i.y).selfSubtract(r.y).selfMultiply(K.valueOf(r.x).selfSubtract(a.x)),Qt=Tt.subtract(Jt).selfDivide(M).doubleValue(),le=K.valueOf(a.y).selfAdd(K.valueOf(c.y).selfSubtract(a.y).selfMultiply(Qt)).doubleValue();return new D(bt,le)},Gt.orientationIndexFilter=function(r,i,a){var c=null,d=(r.x-a.x)*(i.y-a.y),v=(r.y-a.y)*(i.x-a.x),M=d-v;if(d>0){if(v<=0)return Gt.signum(M);c=d+v}else{if(!(d<0)||v>=0)return Gt.signum(M);c=-d-v}var L=Gt.DP_SAFE_EPSILON*c;return M>=L||-M>=L?Gt.signum(M):2},Gt.signum=function(r){return r>0?1:r<0?-1:0},ae.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(Gt,ae);var ut=function(){},Ut={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Ut.X.get=function(){return 0},Ut.Y.get=function(){return 1},Ut.Z.get=function(){return 2},Ut.M.get=function(){return 3},ut.prototype.setOrdinate=function(r,i,a){},ut.prototype.size=function(){},ut.prototype.getOrdinate=function(r,i){},ut.prototype.getCoordinate=function(){},ut.prototype.getCoordinateCopy=function(r){},ut.prototype.getDimension=function(){},ut.prototype.getX=function(r){},ut.prototype.clone=function(){},ut.prototype.expandEnvelope=function(r){},ut.prototype.copy=function(){},ut.prototype.getY=function(r){},ut.prototype.toCoordinateArray=function(){},ut.prototype.interfaces_=function(){return[X]},ut.prototype.getClass=function(){return ut},Object.defineProperties(ut,Ut);var jt=function(){},ce=function(r){function i(){r.call(this,"Projective point not representable on the Cartesian plane.")}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(jt),te=function(){};te.arraycopy=function(r,i,a,c,d){for(var v=0,M=i;M<i+d;M++)a[c+v]=r[M],v++},te.getProperty=function(r){return{"line.separator":\`