@aibee/crc-bmap 0.14.20 → 0.14.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.cjs +19 -19
- package/lib/index.esm.min.js +20 -20
- package/lib/meta.json +254 -34
- package/lib/src/elements/base-svg.d.ts +1 -1
- package/lib/src/elements/svg-line.d.ts +1 -0
- package/lib/src/elements/svg-polygon.d.ts +1 -0
- package/lib/src/factory/unique-key.d.ts +1 -0
- package/lib/src/plugins/car-inertial-position/car-inertial-position.d.ts +1 -0
- package/lib/src/plugins/graphic-draw/graphic-draw.d.ts +71 -0
- package/lib/src/plugins/graphic-draw/index.d.ts +4 -0
- package/lib/src/plugins/graphic-draw/svg-drawer.d.ts +38 -0
- package/lib/src/plugins/graphic-draw/transform-box.d.ts +77 -0
- package/lib/src/plugins/graphic-draw/types.d.ts +44 -0
- package/lib/src/plugins/index.d.ts +1 -0
- package/lib/src/plugins/nav-path/nav-path.d.ts +1 -0
- package/lib/src/plugins/recommend-parking-space/recommand-parking-space.d.ts +5 -2
- package/lib/src/plugins/recommend-parking-space/recommend-core.d.ts +30 -0
- package/lib/src/plugins/recommend-parking-space/recommend.worker.d.ts +1 -5
- package/lib/src/utils/road2.d.ts +1 -0
- package/lib/worker/{path.worker-W3VDPRQY.js → path.worker-2A5W4SXQ.js} +1 -1
- package/lib/worker/{recommend.worker-DNMNFDYX.js → recommend.worker-5LGR2EOJ.js} +176 -176
- package/package.json +1 -1
|
@@ -3822,4 +3822,4 @@ void main() {
|
|
|
3822
3822
|
}
|
|
3823
3823
|
|
|
3824
3824
|
}`,gv=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,o){if(this.texture===null){let s=new Fs,c=t.properties.get(s);c.__webglTexture=e.texture,(e.depthNear!=o.depthNear||e.depthFar!=o.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=s}}render(t,e){if(this.texture!==null){if(this.mesh===null){let o=e.cameras[0].viewport,s=new Ca({extensions:{fragDepth:!0},vertexShader:lX,fragmentShader:cX,uniforms:{depthColor:{value:this.texture},depthWidth:{value:o.z},depthHeight:{value:o.w}}});this.mesh=new na(new kd(20,20),s)}t.render(this.mesh,e)}}reset(){this.texture=null,this.mesh=null}},mv=class extends Zu{constructor(t,e){super();let o=this,s=null,c=1,p=null,h="local-floor",g=1,m=null,_=null,w=null,S=null,b=null,T=null,R=new gv,x=e.getContextAttributes(),E=null,I=null,C=[],F=[],V=new ze,X=null,q=new ds;q.layers.enable(1),q.viewport=new ji;let D=new ds;D.layers.enable(2),D.viewport=new ji;let xt=[q,D],B=new dv;B.layers.enable(1),B.layers.enable(2);let j=null,K=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ut){let Ut=C[ut];return Ut===void 0&&(Ut=new ih,C[ut]=Ut),Ut.getTargetRaySpace()},this.getControllerGrip=function(ut){let Ut=C[ut];return Ut===void 0&&(Ut=new ih,C[ut]=Ut),Ut.getGripSpace()},this.getHand=function(ut){let Ut=C[ut];return Ut===void 0&&(Ut=new ih,C[ut]=Ut),Ut.getHandSpace()};function Dt(ut){let Ut=F.indexOf(ut.inputSource);if(Ut===-1)return;let jt=C[Ut];jt!==void 0&&(jt.update(ut.inputSource,ut.frame,m||p),jt.dispatchEvent({type:ut.type,data:ut.inputSource}))}function Q(){s.removeEventListener("select",Dt),s.removeEventListener("selectstart",Dt),s.removeEventListener("selectend",Dt),s.removeEventListener("squeeze",Dt),s.removeEventListener("squeezestart",Dt),s.removeEventListener("squeezeend",Dt),s.removeEventListener("end",Q),s.removeEventListener("inputsourceschange",At);for(let ut=0;ut<C.length;ut++){let Ut=F[ut];Ut!==null&&(F[ut]=null,C[ut].disconnect(Ut))}j=null,K=null,R.reset(),t.setRenderTarget(E),b=null,S=null,w=null,s=null,I=null,ae.stop(),o.isPresenting=!1,t.setPixelRatio(X),t.setSize(V.width,V.height,!1),o.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(ut){c=ut,o.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(ut){h=ut,o.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return m||p},this.setReferenceSpace=function(ut){m=ut},this.getBaseLayer=function(){return S!==null?S:b},this.getBinding=function(){return w},this.getFrame=function(){return T},this.getSession=function(){return s},this.setSession=function(ut){return dp(this,null,function*(){if(s=ut,s!==null){if(E=t.getRenderTarget(),s.addEventListener("select",Dt),s.addEventListener("selectstart",Dt),s.addEventListener("selectend",Dt),s.addEventListener("squeeze",Dt),s.addEventListener("squeezestart",Dt),s.addEventListener("squeezeend",Dt),s.addEventListener("end",Q),s.addEventListener("inputsourceschange",At),x.xrCompatible!==!0&&(yield e.makeXRCompatible()),X=t.getPixelRatio(),t.getSize(V),s.renderState.layers===void 0||t.capabilities.isWebGL2===!1){let Ut={antialias:s.renderState.layers===void 0?x.antialias:!0,alpha:!0,depth:x.depth,stencil:x.stencil,framebufferScaleFactor:c};b=new XRWebGLLayer(s,e,Ut),s.updateRenderState({baseLayer:b}),t.setPixelRatio(1),t.setSize(b.framebufferWidth,b.framebufferHeight,!1),I=new pu(b.framebufferWidth,b.framebufferHeight,{format:ea,type:Xu,colorSpace:t.outputColorSpace,stencilBuffer:x.stencil})}else{let Ut=null,jt=null,ce=null;x.depth&&(ce=x.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,Ut=x.stencil?Vc:Dl,jt=x.stencil?Ol:Hu);let te={colorFormat:e.RGBA8,depthFormat:ce,scaleFactor:c};w=new XRWebGLBinding(s,e),S=w.createProjectionLayer(te),s.updateRenderState({layers:[S]}),t.setPixelRatio(1),t.setSize(S.textureWidth,S.textureHeight,!1),I=new pu(S.textureWidth,S.textureHeight,{format:ea,type:Xu,depthTexture:new Hd(S.textureWidth,S.textureHeight,jt,void 0,void 0,void 0,void 0,void 0,void 0,Ut),stencilBuffer:x.stencil,colorSpace:t.outputColorSpace,samples:x.antialias?4:0});let $t=t.properties.get(I);$t.__ignoreDepthValues=S.ignoreDepthValues}I.isXRRenderTarget=!0,this.setFoveation(g),m=null,p=yield s.requestReferenceSpace(h),ae.setContext(s),ae.start(),o.isPresenting=!0,o.dispatchEvent({type:"sessionstart"})}})},this.getEnvironmentBlendMode=function(){if(s!==null)return s.environmentBlendMode};function At(ut){for(let Ut=0;Ut<ut.removed.length;Ut++){let jt=ut.removed[Ut],ce=F.indexOf(jt);ce>=0&&(F[ce]=null,C[ce].disconnect(jt))}for(let Ut=0;Ut<ut.added.length;Ut++){let jt=ut.added[Ut],ce=F.indexOf(jt);if(ce===-1){for(let $t=0;$t<C.length;$t++)if($t>=F.length){F.push(jt),ce=$t;break}else if(F[$t]===null){F[$t]=jt,ce=$t;break}if(ce===-1)break}let te=C[ce];te&&te.connect(jt)}}let Mt=new Pt,Lt=new Pt;function pt(ut,Ut,jt){Mt.setFromMatrixPosition(Ut.matrixWorld),Lt.setFromMatrixPosition(jt.matrixWorld);let ce=Mt.distanceTo(Lt),te=Ut.projectionMatrix.elements,$t=jt.projectionMatrix.elements,qt=te[14]/(te[10]-1),xe=te[14]/(te[10]+1),ft=(te[9]+1)/te[5],Xe=(te[9]-1)/te[5],ee=(te[8]-1)/te[0],ge=($t[8]+1)/$t[0],fe=qt*ee,Te=qt*ge,be=ce/(-ee+ge),Wt=be*-ee;Ut.matrixWorld.decompose(ut.position,ut.quaternion,ut.scale),ut.translateX(Wt),ut.translateZ(be),ut.matrixWorld.compose(ut.position,ut.quaternion,ut.scale),ut.matrixWorldInverse.copy(ut.matrixWorld).invert();let Me=qt+be,tt=xe+be,z=fe-Wt,It=Te+(ce-Wt),Ot=ft*xe/tt*Me,dt=Xe*xe/tt*Me;ut.projectionMatrix.makePerspective(z,It,Ot,dt,Me,tt),ut.projectionMatrixInverse.copy(ut.projectionMatrix).invert()}function yt(ut,Ut){Ut===null?ut.matrixWorld.copy(ut.matrix):ut.matrixWorld.multiplyMatrices(Ut.matrixWorld,ut.matrix),ut.matrixWorldInverse.copy(ut.matrixWorld).invert()}this.updateCamera=function(ut){if(s===null)return;R.texture!==null&&(ut.near=R.depthNear,ut.far=R.depthFar),B.near=D.near=q.near=ut.near,B.far=D.far=q.far=ut.far,(j!==B.near||K!==B.far)&&(s.updateRenderState({depthNear:B.near,depthFar:B.far}),j=B.near,K=B.far,q.near=j,q.far=K,D.near=j,D.far=K,q.updateProjectionMatrix(),D.updateProjectionMatrix(),ut.updateProjectionMatrix());let Ut=ut.parent,jt=B.cameras;yt(B,Ut);for(let ce=0;ce<jt.length;ce++)yt(jt[ce],Ut);jt.length===2?pt(B,q,D):B.projectionMatrix.copy(q.projectionMatrix),J(ut,B,Ut)};function J(ut,Ut,jt){jt===null?ut.matrix.copy(Ut.matrixWorld):(ut.matrix.copy(jt.matrixWorld),ut.matrix.invert(),ut.matrix.multiply(Ut.matrixWorld)),ut.matrix.decompose(ut.position,ut.quaternion,ut.scale),ut.updateMatrixWorld(!0),ut.projectionMatrix.copy(Ut.projectionMatrix),ut.projectionMatrixInverse.copy(Ut.projectionMatrixInverse),ut.isPerspectiveCamera&&(ut.fov=jy*2*Math.atan(1/ut.projectionMatrix.elements[5]),ut.zoom=1)}this.getCamera=function(){return B},this.getFoveation=function(){if(!(S===null&&b===null))return g},this.setFoveation=function(ut){g=ut,S!==null&&(S.fixedFoveation=ut),b!==null&&b.fixedFoveation!==void 0&&(b.fixedFoveation=ut)},this.hasDepthSensing=function(){return R.texture!==null};let Bt=null;function Gt(ut,Ut){if(_=Ut.getViewerPose(m||p),T=Ut,_!==null){let jt=_.views;b!==null&&(t.setRenderTargetFramebuffer(I,b.framebuffer),t.setRenderTarget(I));let ce=!1;jt.length!==B.cameras.length&&(B.cameras.length=0,ce=!0);for(let $t=0;$t<jt.length;$t++){let qt=jt[$t],xe=null;if(b!==null)xe=b.getViewport(qt);else{let Xe=w.getViewSubImage(S,qt);xe=Xe.viewport,$t===0&&(t.setRenderTargetTextures(I,Xe.colorTexture,S.ignoreDepthValues?void 0:Xe.depthStencilTexture),t.setRenderTarget(I))}let ft=xt[$t];ft===void 0&&(ft=new ds,ft.layers.enable($t),ft.viewport=new ji,xt[$t]=ft),ft.matrix.fromArray(qt.transform.matrix),ft.matrix.decompose(ft.position,ft.quaternion,ft.scale),ft.projectionMatrix.fromArray(qt.projectionMatrix),ft.projectionMatrixInverse.copy(ft.projectionMatrix).invert(),ft.viewport.set(xe.x,xe.y,xe.width,xe.height),$t===0&&(B.matrix.copy(ft.matrix),B.matrix.decompose(B.position,B.quaternion,B.scale)),ce===!0&&B.cameras.push(ft)}let te=s.enabledFeatures;if(te&&te.includes("depth-sensing")){let $t=w.getDepthInformation(jt[0]);$t&&$t.isValid&&$t.texture&&R.init(t,$t,s.renderState)}}for(let jt=0;jt<C.length;jt++){let ce=F[jt],te=C[jt];ce!==null&&te!==void 0&&te.update(ce,Ut,m||p)}R.render(t,B),Bt&&Bt(ut,Ut),Ut.detectedPlanes&&o.dispatchEvent({type:"planesdetected",data:Ut}),T=null}let ae=new xC;ae.setAnimationLoop(Gt),this.setAnimationLoop=function(ut){Bt=ut},this.dispose=function(){}}},Cl=new Ul,fX=new vi;function hX(n,t){function e(x,E){x.matrixAutoUpdate===!0&&x.updateMatrix(),E.value.copy(x.matrix)}function o(x,E){E.color.getRGB(x.fogColor.value,_C(n)),E.isFog?(x.fogNear.value=E.near,x.fogFar.value=E.far):E.isFogExp2&&(x.fogDensity.value=E.density)}function s(x,E,I,C,F){E.isMeshBasicMaterial||E.isMeshLambertMaterial?c(x,E):E.isMeshToonMaterial?(c(x,E),w(x,E)):E.isMeshPhongMaterial?(c(x,E),_(x,E)):E.isMeshStandardMaterial?(c(x,E),S(x,E),E.isMeshPhysicalMaterial&&b(x,E,F)):E.isMeshMatcapMaterial?(c(x,E),T(x,E)):E.isMeshDepthMaterial?c(x,E):E.isMeshDistanceMaterial?(c(x,E),R(x,E)):E.isMeshNormalMaterial?c(x,E):E.isLineBasicMaterial?(p(x,E),E.isLineDashedMaterial&&h(x,E)):E.isPointsMaterial?g(x,E,I,C):E.isSpriteMaterial?m(x,E):E.isShadowMaterial?(x.color.value.copy(E.color),x.opacity.value=E.opacity):E.isShaderMaterial&&(E.uniformsNeedUpdate=!1)}function c(x,E){x.opacity.value=E.opacity,E.color&&x.diffuse.value.copy(E.color),E.emissive&&x.emissive.value.copy(E.emissive).multiplyScalar(E.emissiveIntensity),E.map&&(x.map.value=E.map,e(E.map,x.mapTransform)),E.alphaMap&&(x.alphaMap.value=E.alphaMap,e(E.alphaMap,x.alphaMapTransform)),E.bumpMap&&(x.bumpMap.value=E.bumpMap,e(E.bumpMap,x.bumpMapTransform),x.bumpScale.value=E.bumpScale,E.side===$o&&(x.bumpScale.value*=-1)),E.normalMap&&(x.normalMap.value=E.normalMap,e(E.normalMap,x.normalMapTransform),x.normalScale.value.copy(E.normalScale),E.side===$o&&x.normalScale.value.negate()),E.displacementMap&&(x.displacementMap.value=E.displacementMap,e(E.displacementMap,x.displacementMapTransform),x.displacementScale.value=E.displacementScale,x.displacementBias.value=E.displacementBias),E.emissiveMap&&(x.emissiveMap.value=E.emissiveMap,e(E.emissiveMap,x.emissiveMapTransform)),E.specularMap&&(x.specularMap.value=E.specularMap,e(E.specularMap,x.specularMapTransform)),E.alphaTest>0&&(x.alphaTest.value=E.alphaTest);let I=t.get(E),C=I.envMap,F=I.envMapRotation;if(C&&(x.envMap.value=C,Cl.copy(F),Cl.x*=-1,Cl.y*=-1,Cl.z*=-1,C.isCubeTexture&&C.isRenderTargetTexture===!1&&(Cl.y*=-1,Cl.z*=-1),x.envMapRotation.value.setFromMatrix4(fX.makeRotationFromEuler(Cl)),x.flipEnvMap.value=C.isCubeTexture&&C.isRenderTargetTexture===!1?-1:1,x.reflectivity.value=E.reflectivity,x.ior.value=E.ior,x.refractionRatio.value=E.refractionRatio),E.lightMap){x.lightMap.value=E.lightMap;let V=n._useLegacyLights===!0?Math.PI:1;x.lightMapIntensity.value=E.lightMapIntensity*V,e(E.lightMap,x.lightMapTransform)}E.aoMap&&(x.aoMap.value=E.aoMap,x.aoMapIntensity.value=E.aoMapIntensity,e(E.aoMap,x.aoMapTransform))}function p(x,E){x.diffuse.value.copy(E.color),x.opacity.value=E.opacity,E.map&&(x.map.value=E.map,e(E.map,x.mapTransform))}function h(x,E){x.dashSize.value=E.dashSize,x.totalSize.value=E.dashSize+E.gapSize,x.scale.value=E.scale}function g(x,E,I,C){x.diffuse.value.copy(E.color),x.opacity.value=E.opacity,x.size.value=E.size*I,x.scale.value=C*.5,E.map&&(x.map.value=E.map,e(E.map,x.uvTransform)),E.alphaMap&&(x.alphaMap.value=E.alphaMap,e(E.alphaMap,x.alphaMapTransform)),E.alphaTest>0&&(x.alphaTest.value=E.alphaTest)}function m(x,E){x.diffuse.value.copy(E.color),x.opacity.value=E.opacity,x.rotation.value=E.rotation,E.map&&(x.map.value=E.map,e(E.map,x.mapTransform)),E.alphaMap&&(x.alphaMap.value=E.alphaMap,e(E.alphaMap,x.alphaMapTransform)),E.alphaTest>0&&(x.alphaTest.value=E.alphaTest)}function _(x,E){x.specular.value.copy(E.specular),x.shininess.value=Math.max(E.shininess,1e-4)}function w(x,E){E.gradientMap&&(x.gradientMap.value=E.gradientMap)}function S(x,E){x.metalness.value=E.metalness,E.metalnessMap&&(x.metalnessMap.value=E.metalnessMap,e(E.metalnessMap,x.metalnessMapTransform)),x.roughness.value=E.roughness,E.roughnessMap&&(x.roughnessMap.value=E.roughnessMap,e(E.roughnessMap,x.roughnessMapTransform)),t.get(E).envMap&&(x.envMapIntensity.value=E.envMapIntensity)}function b(x,E,I){x.ior.value=E.ior,E.sheen>0&&(x.sheenColor.value.copy(E.sheenColor).multiplyScalar(E.sheen),x.sheenRoughness.value=E.sheenRoughness,E.sheenColorMap&&(x.sheenColorMap.value=E.sheenColorMap,e(E.sheenColorMap,x.sheenColorMapTransform)),E.sheenRoughnessMap&&(x.sheenRoughnessMap.value=E.sheenRoughnessMap,e(E.sheenRoughnessMap,x.sheenRoughnessMapTransform))),E.clearcoat>0&&(x.clearcoat.value=E.clearcoat,x.clearcoatRoughness.value=E.clearcoatRoughness,E.clearcoatMap&&(x.clearcoatMap.value=E.clearcoatMap,e(E.clearcoatMap,x.clearcoatMapTransform)),E.clearcoatRoughnessMap&&(x.clearcoatRoughnessMap.value=E.clearcoatRoughnessMap,e(E.clearcoatRoughnessMap,x.clearcoatRoughnessMapTransform)),E.clearcoatNormalMap&&(x.clearcoatNormalMap.value=E.clearcoatNormalMap,e(E.clearcoatNormalMap,x.clearcoatNormalMapTransform),x.clearcoatNormalScale.value.copy(E.clearcoatNormalScale),E.side===$o&&x.clearcoatNormalScale.value.negate())),E.iridescence>0&&(x.iridescence.value=E.iridescence,x.iridescenceIOR.value=E.iridescenceIOR,x.iridescenceThicknessMinimum.value=E.iridescenceThicknessRange[0],x.iridescenceThicknessMaximum.value=E.iridescenceThicknessRange[1],E.iridescenceMap&&(x.iridescenceMap.value=E.iridescenceMap,e(E.iridescenceMap,x.iridescenceMapTransform)),E.iridescenceThicknessMap&&(x.iridescenceThicknessMap.value=E.iridescenceThicknessMap,e(E.iridescenceThicknessMap,x.iridescenceThicknessMapTransform))),E.transmission>0&&(x.transmission.value=E.transmission,x.transmissionSamplerMap.value=I.texture,x.transmissionSamplerSize.value.set(I.width,I.height),E.transmissionMap&&(x.transmissionMap.value=E.transmissionMap,e(E.transmissionMap,x.transmissionMapTransform)),x.thickness.value=E.thickness,E.thicknessMap&&(x.thicknessMap.value=E.thicknessMap,e(E.thicknessMap,x.thicknessMapTransform)),x.attenuationDistance.value=E.attenuationDistance,x.attenuationColor.value.copy(E.attenuationColor)),E.anisotropy>0&&(x.anisotropyVector.value.set(E.anisotropy*Math.cos(E.anisotropyRotation),E.anisotropy*Math.sin(E.anisotropyRotation)),E.anisotropyMap&&(x.anisotropyMap.value=E.anisotropyMap,e(E.anisotropyMap,x.anisotropyMapTransform))),x.specularIntensity.value=E.specularIntensity,x.specularColor.value.copy(E.specularColor),E.specularColorMap&&(x.specularColorMap.value=E.specularColorMap,e(E.specularColorMap,x.specularColorMapTransform)),E.specularIntensityMap&&(x.specularIntensityMap.value=E.specularIntensityMap,e(E.specularIntensityMap,x.specularIntensityMapTransform))}function T(x,E){E.matcap&&(x.matcap.value=E.matcap)}function R(x,E){let I=t.get(E).light;x.referencePosition.value.setFromMatrixPosition(I.matrixWorld),x.nearDistance.value=I.shadow.camera.near,x.farDistance.value=I.shadow.camera.far}return{refreshFogUniforms:o,refreshMaterialUniforms:s}}function pX(n,t,e,o){let s={},c={},p=[],h=e.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function g(I,C){let F=C.program;o.uniformBlockBinding(I,F)}function m(I,C){let F=s[I.id];F===void 0&&(T(I),F=_(I),s[I.id]=F,I.addEventListener("dispose",x));let V=C.program;o.updateUBOMapping(I,V);let X=t.render.frame;c[I.id]!==X&&(S(I),c[I.id]=X)}function _(I){let C=w();I.__bindingPointIndex=C;let F=n.createBuffer(),V=I.__size,X=I.usage;return n.bindBuffer(n.UNIFORM_BUFFER,F),n.bufferData(n.UNIFORM_BUFFER,V,X),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,C,F),F}function w(){for(let I=0;I<h;I++)if(p.indexOf(I)===-1)return p.push(I),I;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function S(I){let C=s[I.id],F=I.uniforms,V=I.__cache;n.bindBuffer(n.UNIFORM_BUFFER,C);for(let X=0,q=F.length;X<q;X++){let D=Array.isArray(F[X])?F[X]:[F[X]];for(let xt=0,B=D.length;xt<B;xt++){let j=D[xt];if(b(j,X,xt,V)===!0){let K=j.__offset,Dt=Array.isArray(j.value)?j.value:[j.value],Q=0;for(let At=0;At<Dt.length;At++){let Mt=Dt[At],Lt=R(Mt);typeof Mt=="number"||typeof Mt=="boolean"?(j.__data[0]=Mt,n.bufferSubData(n.UNIFORM_BUFFER,K+Q,j.__data)):Mt.isMatrix3?(j.__data[0]=Mt.elements[0],j.__data[1]=Mt.elements[1],j.__data[2]=Mt.elements[2],j.__data[3]=0,j.__data[4]=Mt.elements[3],j.__data[5]=Mt.elements[4],j.__data[6]=Mt.elements[5],j.__data[7]=0,j.__data[8]=Mt.elements[6],j.__data[9]=Mt.elements[7],j.__data[10]=Mt.elements[8],j.__data[11]=0):(Mt.toArray(j.__data,Q),Q+=Lt.storage/Float32Array.BYTES_PER_ELEMENT)}n.bufferSubData(n.UNIFORM_BUFFER,K,j.__data)}}}n.bindBuffer(n.UNIFORM_BUFFER,null)}function b(I,C,F,V){let X=I.value,q=C+"_"+F;if(V[q]===void 0)return typeof X=="number"||typeof X=="boolean"?V[q]=X:V[q]=X.clone(),!0;{let D=V[q];if(typeof X=="number"||typeof X=="boolean"){if(D!==X)return V[q]=X,!0}else if(D.equals(X)===!1)return D.copy(X),!0}return!1}function T(I){let C=I.uniforms,F=0,V=16;for(let q=0,D=C.length;q<D;q++){let xt=Array.isArray(C[q])?C[q]:[C[q]];for(let B=0,j=xt.length;B<j;B++){let K=xt[B],Dt=Array.isArray(K.value)?K.value:[K.value];for(let Q=0,At=Dt.length;Q<At;Q++){let Mt=Dt[Q],Lt=R(Mt),pt=F%V;pt!==0&&V-pt<Lt.boundary&&(F+=V-pt),K.__data=new Float32Array(Lt.storage/Float32Array.BYTES_PER_ELEMENT),K.__offset=F,F+=Lt.storage}}}let X=F%V;return X>0&&(F+=V-X),I.__size=F,I.__cache={},this}function R(I){let C={boundary:0,storage:0};return typeof I=="number"||typeof I=="boolean"?(C.boundary=4,C.storage=4):I.isVector2?(C.boundary=8,C.storage=8):I.isVector3||I.isColor?(C.boundary=16,C.storage=12):I.isVector4?(C.boundary=16,C.storage=16):I.isMatrix3?(C.boundary=48,C.storage=48):I.isMatrix4?(C.boundary=64,C.storage=64):I.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",I),C}function x(I){let C=I.target;C.removeEventListener("dispose",x);let F=p.indexOf(C.__bindingPointIndex);p.splice(F,1),n.deleteBuffer(s[C.id]),delete s[C.id],delete c[C.id]}function E(){for(let I in s)n.deleteBuffer(s[I]);p=[],s={},c={}}return{bind:g,update:m,dispose:E}}var yv=class{constructor(t={}){let{canvas:e=y6(),context:o=null,depth:s=!0,stencil:c=!0,alpha:p=!1,antialias:h=!1,premultipliedAlpha:g=!0,preserveDrawingBuffer:m=!1,powerPreference:_="default",failIfMajorPerformanceCaveat:w=!1}=t;this.isWebGLRenderer=!0;let S;o!==null?S=o.getContextAttributes().alpha:S=p;let b=new Uint32Array(4),T=new Int32Array(4),R=null,x=null,E=[],I=[];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=ba,this._useLegacyLights=!1,this.toneMapping=Wu,this.toneMappingExposure=1;let C=this,F=!1,V=0,X=0,q=null,D=-1,xt=null,B=new ji,j=new ji,K=null,Dt=new ar(0),Q=0,At=e.width,Mt=e.height,Lt=1,pt=null,yt=null,J=new ji(0,0,At,Mt),Bt=new ji(0,0,At,Mt),Gt=!1,ae=new Gd,ut=!1,Ut=!1,jt=null,ce=new vi,te=new ze,$t=new Pt,qt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function xe(){return q===null?Lt:1}let ft=o;function Xe(Z,mt){for(let Rt=0;Rt<Z.length;Rt++){let St=Z[Rt],vt=e.getContext(St,mt);if(vt!==null)return vt}return null}try{let Z={alpha:!0,depth:s,stencil:c,antialias:h,premultipliedAlpha:g,preserveDrawingBuffer:m,powerPreference:_,failIfMajorPerformanceCaveat:w};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${Lv}`),e.addEventListener("webglcontextlost",Et,!1),e.addEventListener("webglcontextrestored",G,!1),e.addEventListener("webglcontextcreationerror",st,!1),ft===null){let mt=["webgl2","webgl","experimental-webgl"];if(C.isWebGL1Renderer===!0&&mt.shift(),ft=Xe(mt,Z),ft===null)throw Xe(mt)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}typeof WebGLRenderingContext!="undefined"&&ft instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),ft.getShaderPrecisionFormat===void 0&&(ft.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(Z){throw console.error("THREE.WebGLRenderer: "+Z.message),Z}let ee,ge,fe,Te,be,Wt,Me,tt,z,It,Ot,dt,Ht,Ce,Vt,Zt,ne,rt,P,N,k,$,W,ht;function at(){ee=new PW(ft),ge=new SW(ft,ee,t),ee.init(ge),$=new aX(ft,ee,ge),fe=new oX(ft,ee,ge),Te=new LW(ft),be=new Y9,Wt=new sX(ft,ee,fe,be,ge,$,Te),Me=new bW(C),tt=new CW(C),z=new B6(ft,ge),W=new EW(ft,ee,z,ge),It=new IW(ft,z,Te,W),Ot=new FW(ft,It,z,Te),P=new DW(ft,ge,Wt),Zt=new MW(be),dt=new X9(C,Me,tt,ee,ge,W,Zt),Ht=new hX(C,be),Ce=new Z9,Vt=new eX(ee,ge),rt=new xW(C,Me,tt,fe,Ot,S,g),ne=new iX(C,Ot,ge),ht=new pX(ft,Te,ge,fe),N=new wW(ft,ee,Te,ge),k=new RW(ft,ee,Te,ge),Te.programs=dt.programs,C.capabilities=ge,C.extensions=ee,C.properties=be,C.renderLists=Ce,C.shadowMap=ne,C.state=fe,C.info=Te}at();let wt=new mv(C,ft);this.xr=wt,this.getContext=function(){return ft},this.getContextAttributes=function(){return ft.getContextAttributes()},this.forceContextLoss=function(){let Z=ee.get("WEBGL_lose_context");Z&&Z.loseContext()},this.forceContextRestore=function(){let Z=ee.get("WEBGL_lose_context");Z&&Z.restoreContext()},this.getPixelRatio=function(){return Lt},this.setPixelRatio=function(Z){Z!==void 0&&(Lt=Z,this.setSize(At,Mt,!1))},this.getSize=function(Z){return Z.set(At,Mt)},this.setSize=function(Z,mt,Rt=!0){if(wt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}At=Z,Mt=mt,e.width=Math.floor(Z*Lt),e.height=Math.floor(mt*Lt),Rt===!0&&(e.style.width=Z+"px",e.style.height=mt+"px"),this.setViewport(0,0,Z,mt)},this.getDrawingBufferSize=function(Z){return Z.set(At*Lt,Mt*Lt).floor()},this.setDrawingBufferSize=function(Z,mt,Rt){At=Z,Mt=mt,Lt=Rt,e.width=Math.floor(Z*Rt),e.height=Math.floor(mt*Rt),this.setViewport(0,0,Z,mt)},this.getCurrentViewport=function(Z){return Z.copy(B)},this.getViewport=function(Z){return Z.copy(J)},this.setViewport=function(Z,mt,Rt,St){Z.isVector4?J.set(Z.x,Z.y,Z.z,Z.w):J.set(Z,mt,Rt,St),fe.viewport(B.copy(J).multiplyScalar(Lt).round())},this.getScissor=function(Z){return Z.copy(Bt)},this.setScissor=function(Z,mt,Rt,St){Z.isVector4?Bt.set(Z.x,Z.y,Z.z,Z.w):Bt.set(Z,mt,Rt,St),fe.scissor(j.copy(Bt).multiplyScalar(Lt).round())},this.getScissorTest=function(){return Gt},this.setScissorTest=function(Z){fe.setScissorTest(Gt=Z)},this.setOpaqueSort=function(Z){pt=Z},this.setTransparentSort=function(Z){yt=Z},this.getClearColor=function(Z){return Z.copy(rt.getClearColor())},this.setClearColor=function(){rt.setClearColor.apply(rt,arguments)},this.getClearAlpha=function(){return rt.getClearAlpha()},this.setClearAlpha=function(){rt.setClearAlpha.apply(rt,arguments)},this.clear=function(Z=!0,mt=!0,Rt=!0){let St=0;if(Z){let vt=!1;if(q!==null){let he=q.texture.format;vt=he===pC||he===hC||he===fC}if(vt){let he=q.texture.type,ue=he===Xu||he===Hu||he===Nv||he===Ol||he===lC||he===cC,we=rt.getClearColor(),de=rt.getClearAlpha(),Be=we.r,Ae=we.g,Pe=we.b;ue?(b[0]=Be,b[1]=Ae,b[2]=Pe,b[3]=de,ft.clearBufferuiv(ft.COLOR,0,b)):(T[0]=Be,T[1]=Ae,T[2]=Pe,T[3]=de,ft.clearBufferiv(ft.COLOR,0,T))}else St|=ft.COLOR_BUFFER_BIT}mt&&(St|=ft.DEPTH_BUFFER_BIT),Rt&&(St|=ft.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),ft.clear(St)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",Et,!1),e.removeEventListener("webglcontextrestored",G,!1),e.removeEventListener("webglcontextcreationerror",st,!1),Ce.dispose(),Vt.dispose(),be.dispose(),Me.dispose(),tt.dispose(),Ot.dispose(),W.dispose(),ht.dispose(),dt.dispose(),ne.dispose(),wt.dispose(),wt.removeEventListener("sessionstart",He),wt.removeEventListener("sessionend",Ue),jt&&(jt.dispose(),jt=null),Ye.stop()};function Et(Z){Z.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),F=!0}function G(){console.log("THREE.WebGLRenderer: Context Restored."),F=!1;let Z=Te.autoReset,mt=ne.enabled,Rt=ne.autoUpdate,St=ne.needsUpdate,vt=ne.type;at(),Te.autoReset=Z,ne.enabled=mt,ne.autoUpdate=Rt,ne.needsUpdate=St,ne.type=vt}function st(Z){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",Z.statusMessage)}function et(Z){let mt=Z.target;mt.removeEventListener("dispose",et),lt(mt)}function lt(Z){Ft(Z),be.remove(Z)}function Ft(Z){let mt=be.get(Z).programs;mt!==void 0&&(mt.forEach(function(Rt){dt.releaseProgram(Rt)}),Z.isShaderMaterial&&dt.releaseShaderCache(Z))}this.renderBufferDirect=function(Z,mt,Rt,St,vt,he){mt===null&&(mt=qt);let ue=vt.isMesh&&vt.matrixWorld.determinant()<0,we=Qn(Z,mt,Rt,St,vt);fe.setMaterial(St,ue);let de=Rt.index,Be=1;if(St.wireframe===!0){if(de=It.getWireframeAttribute(Rt),de===void 0)return;Be=2}let Ae=Rt.drawRange,Pe=Rt.attributes.position,nn=Ae.start*Be,si=(Ae.start+Ae.count)*Be;he!==null&&(nn=Math.max(nn,he.start*Be),si=Math.min(si,(he.start+he.count)*Be)),de!==null?(nn=Math.max(nn,0),si=Math.min(si,de.count)):Pe!=null&&(nn=Math.max(nn,0),si=Math.min(si,Pe.count));let br=si-nn;if(br<0||br===1/0)return;W.setup(vt,St,we,Rt,de);let Vi,sr=N;if(de!==null&&(Vi=z.get(de),sr=k,sr.setIndex(Vi)),vt.isMesh)St.wireframe===!0?(fe.setLineWidth(St.wireframeLinewidth*xe()),sr.setMode(ft.LINES)):sr.setMode(ft.TRIANGLES);else if(vt.isLine){let ye=St.linewidth;ye===void 0&&(ye=1),fe.setLineWidth(ye*xe()),vt.isLineSegments?sr.setMode(ft.LINES):vt.isLineLoop?sr.setMode(ft.LINE_LOOP):sr.setMode(ft.LINE_STRIP)}else vt.isPoints?sr.setMode(ft.POINTS):vt.isSprite&&sr.setMode(ft.TRIANGLES);if(vt.isBatchedMesh)sr.renderMultiDraw(vt._multiDrawStarts,vt._multiDrawCounts,vt._multiDrawCount);else if(vt.isInstancedMesh)sr.renderInstances(nn,br,vt.count);else if(Rt.isInstancedBufferGeometry){let ye=Rt._maxInstanceCount!==void 0?Rt._maxInstanceCount:1/0,Fa=Math.min(Rt.instanceCount,ye);sr.renderInstances(nn,br,Fa)}else sr.render(nn,br)};function Jt(Z,mt,Rt){Z.transparent===!0&&Z.side===lu&&Z.forceSinglePass===!1?(Z.side=$o,Z.needsUpdate=!0,rr(Z,mt,Rt),Z.side=$u,Z.needsUpdate=!0,rr(Z,mt,Rt),Z.side=lu):rr(Z,mt,Rt)}this.compile=function(Z,mt,Rt=null){Rt===null&&(Rt=Z),x=Vt.get(Rt),x.init(),I.push(x),Rt.traverseVisible(function(vt){vt.isLight&&vt.layers.test(mt.layers)&&(x.pushLight(vt),vt.castShadow&&x.pushShadow(vt))}),Z!==Rt&&Z.traverseVisible(function(vt){vt.isLight&&vt.layers.test(mt.layers)&&(x.pushLight(vt),vt.castShadow&&x.pushShadow(vt))}),x.setupLights(C._useLegacyLights);let St=new Set;return Z.traverse(function(vt){let he=vt.material;if(he)if(Array.isArray(he))for(let ue=0;ue<he.length;ue++){let we=he[ue];Jt(we,Rt,vt),St.add(we)}else Jt(he,Rt,vt),St.add(he)}),I.pop(),x=null,St},this.compileAsync=function(Z,mt,Rt=null){let St=this.compile(Z,mt,Rt);return new Promise(vt=>{function he(){if(St.forEach(function(ue){be.get(ue).currentProgram.isReady()&&St.delete(ue)}),St.size===0){vt(Z);return}setTimeout(he,10)}ee.get("KHR_parallel_shader_compile")!==null?he():setTimeout(he,10)})};let me=null;function ve(Z){me&&me(Z)}function He(){Ye.stop()}function Ue(){Ye.start()}let Ye=new xC;Ye.setAnimationLoop(ve),typeof self!="undefined"&&Ye.setContext(self),this.setAnimationLoop=function(Z){me=Z,wt.setAnimationLoop(Z),Z===null?Ye.stop():Ye.start()},wt.addEventListener("sessionstart",He),wt.addEventListener("sessionend",Ue),this.render=function(Z,mt){if(mt!==void 0&&mt.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(F===!0)return;Z.matrixWorldAutoUpdate===!0&&Z.updateMatrixWorld(),mt.parent===null&&mt.matrixWorldAutoUpdate===!0&&mt.updateMatrixWorld(),wt.enabled===!0&&wt.isPresenting===!0&&(wt.cameraAutoUpdate===!0&&wt.updateCamera(mt),mt=wt.getCamera()),Z.isScene===!0&&Z.onBeforeRender(C,Z,mt,q),x=Vt.get(Z,I.length),x.init(),I.push(x),ce.multiplyMatrices(mt.projectionMatrix,mt.matrixWorldInverse),ae.setFromProjectionMatrix(ce),Ut=this.localClippingEnabled,ut=Zt.init(this.clippingPlanes,Ut),R=Ce.get(Z,E.length),R.init(),E.push(R),je(Z,mt,0,C.sortObjects),R.finish(),C.sortObjects===!0&&R.sort(pt,yt),this.info.render.frame++,ut===!0&&Zt.beginShadows();let Rt=x.state.shadowsArray;if(ne.render(Rt,Z,mt),ut===!0&&Zt.endShadows(),this.info.autoReset===!0&&this.info.reset(),(wt.enabled===!1||wt.isPresenting===!1||wt.hasDepthSensing()===!1)&&rt.render(R,Z),x.setupLights(C._useLegacyLights),mt.isArrayCamera){let St=mt.cameras;for(let vt=0,he=St.length;vt<he;vt++){let ue=St[vt];wr(R,Z,ue,ue.viewport)}}else wr(R,Z,mt);q!==null&&(Wt.updateMultisampleRenderTarget(q),Wt.updateRenderTargetMipmap(q)),Z.isScene===!0&&Z.onAfterRender(C,Z,mt),W.resetDefaultState(),D=-1,xt=null,I.pop(),I.length>0?x=I[I.length-1]:x=null,E.pop(),E.length>0?R=E[E.length-1]:R=null};function je(Z,mt,Rt,St){if(Z.visible===!1)return;if(Z.layers.test(mt.layers)){if(Z.isGroup)Rt=Z.renderOrder;else if(Z.isLOD)Z.autoUpdate===!0&&Z.update(mt);else if(Z.isLight)x.pushLight(Z),Z.castShadow&&x.pushShadow(Z);else if(Z.isSprite){if(!Z.frustumCulled||ae.intersectsSprite(Z)){St&&$t.setFromMatrixPosition(Z.matrixWorld).applyMatrix4(ce);let ue=Ot.update(Z),we=Z.material;we.visible&&R.push(Z,ue,we,Rt,$t.z,null)}}else if((Z.isMesh||Z.isLine||Z.isPoints)&&(!Z.frustumCulled||ae.intersectsObject(Z))){let ue=Ot.update(Z),we=Z.material;if(St&&(Z.boundingSphere!==void 0?(Z.boundingSphere===null&&Z.computeBoundingSphere(),$t.copy(Z.boundingSphere.center)):(ue.boundingSphere===null&&ue.computeBoundingSphere(),$t.copy(ue.boundingSphere.center)),$t.applyMatrix4(Z.matrixWorld).applyMatrix4(ce)),Array.isArray(we)){let de=ue.groups;for(let Be=0,Ae=de.length;Be<Ae;Be++){let Pe=de[Be],nn=we[Pe.materialIndex];nn&&nn.visible&&R.push(Z,ue,nn,Rt,$t.z,Pe)}}else we.visible&&R.push(Z,ue,we,Rt,$t.z,null)}}let he=Z.children;for(let ue=0,we=he.length;ue<we;ue++)je(he[ue],mt,Rt,St)}function wr(Z,mt,Rt,St){let vt=Z.opaque,he=Z.transmissive,ue=Z.transparent;x.setupLightsView(Rt),ut===!0&&Zt.setGlobalState(C.clippingPlanes,Rt),he.length>0&&Kr(vt,he,mt,Rt),St&&fe.viewport(B.copy(St)),vt.length>0&&nr(vt,mt,Rt),he.length>0&&nr(he,mt,Rt),ue.length>0&&nr(ue,mt,Rt),fe.buffers.depth.setTest(!0),fe.buffers.depth.setMask(!0),fe.buffers.color.setMask(!0),fe.setPolygonOffset(!1)}function Kr(Z,mt,Rt,St){if((Rt.isScene===!0?Rt.overrideMaterial:null)!==null)return;let he=ge.isWebGL2;jt===null&&(jt=new pu(1,1,{generateMipmaps:!0,type:ee.has("EXT_color_buffer_half_float")?oh:Xu,minFilter:Ll,samples:he?4:0})),C.getDrawingBufferSize(te),he?jt.setSize(te.x,te.y):jt.setSize(Qy(te.x),Qy(te.y));let ue=C.getRenderTarget();C.setRenderTarget(jt),C.getClearColor(Dt),Q=C.getClearAlpha(),Q<1&&C.setClearColor(16777215,.5),C.clear();let we=C.toneMapping;C.toneMapping=Wu,nr(Z,Rt,St),Wt.updateMultisampleRenderTarget(jt),Wt.updateRenderTargetMipmap(jt);let de=!1;for(let Be=0,Ae=mt.length;Be<Ae;Be++){let Pe=mt[Be],nn=Pe.object,si=Pe.geometry,br=Pe.material,Vi=Pe.group;if(br.side===lu&&nn.layers.test(St.layers)){let sr=br.side;br.side=$o,br.needsUpdate=!0,Ie(nn,Rt,St,si,br,Vi),br.side=sr,br.needsUpdate=!0,de=!0}}de===!0&&(Wt.updateMultisampleRenderTarget(jt),Wt.updateRenderTargetMipmap(jt)),C.setRenderTarget(ue),C.setClearColor(Dt,Q),C.toneMapping=we}function nr(Z,mt,Rt){let St=mt.isScene===!0?mt.overrideMaterial:null;for(let vt=0,he=Z.length;vt<he;vt++){let ue=Z[vt],we=ue.object,de=ue.geometry,Be=St===null?ue.material:St,Ae=ue.group;we.layers.test(Rt.layers)&&Ie(we,mt,Rt,de,Be,Ae)}}function Ie(Z,mt,Rt,St,vt,he){Z.onBeforeRender(C,mt,Rt,St,vt,he),Z.modelViewMatrix.multiplyMatrices(Rt.matrixWorldInverse,Z.matrixWorld),Z.normalMatrix.getNormalMatrix(Z.modelViewMatrix),vt.onBeforeRender(C,mt,Rt,St,Z,he),vt.transparent===!0&&vt.side===lu&&vt.forceSinglePass===!1?(vt.side=$o,vt.needsUpdate=!0,C.renderBufferDirect(Rt,mt,St,vt,Z,he),vt.side=$u,vt.needsUpdate=!0,C.renderBufferDirect(Rt,mt,St,vt,Z,he),vt.side=lu):C.renderBufferDirect(Rt,mt,St,vt,Z,he),Z.onAfterRender(C,mt,Rt,St,vt,he)}function rr(Z,mt,Rt){mt.isScene!==!0&&(mt=qt);let St=be.get(Z),vt=x.state.lights,he=x.state.shadowsArray,ue=vt.state.version,we=dt.getParameters(Z,vt.state,he,mt,Rt),de=dt.getProgramCacheKey(we),Be=St.programs;St.environment=Z.isMeshStandardMaterial?mt.environment:null,St.fog=mt.fog,St.envMap=(Z.isMeshStandardMaterial?tt:Me).get(Z.envMap||St.environment),St.envMapRotation=St.environment!==null&&Z.envMap===null?mt.environmentRotation:Z.envMapRotation,Be===void 0&&(Z.addEventListener("dispose",et),Be=new Map,St.programs=Be);let Ae=Be.get(de);if(Ae!==void 0){if(St.currentProgram===Ae&&St.lightsStateVersion===ue)return ur(Z,we),Ae}else we.uniforms=dt.getUniforms(Z),Z.onBuild(Rt,we,C),Z.onBeforeCompile(we,C),Ae=dt.acquireProgram(we,de),Be.set(de,Ae),St.uniforms=we.uniforms;let Pe=St.uniforms;return(!Z.isShaderMaterial&&!Z.isRawShaderMaterial||Z.clipping===!0)&&(Pe.clippingPlanes=Zt.uniform),ur(Z,we),St.needsLights=oi(Z),St.lightsStateVersion=ue,St.needsLights&&(Pe.ambientLightColor.value=vt.state.ambient,Pe.lightProbe.value=vt.state.probe,Pe.directionalLights.value=vt.state.directional,Pe.directionalLightShadows.value=vt.state.directionalShadow,Pe.spotLights.value=vt.state.spot,Pe.spotLightShadows.value=vt.state.spotShadow,Pe.rectAreaLights.value=vt.state.rectArea,Pe.ltc_1.value=vt.state.rectAreaLTC1,Pe.ltc_2.value=vt.state.rectAreaLTC2,Pe.pointLights.value=vt.state.point,Pe.pointLightShadows.value=vt.state.pointShadow,Pe.hemisphereLights.value=vt.state.hemi,Pe.directionalShadowMap.value=vt.state.directionalShadowMap,Pe.directionalShadowMatrix.value=vt.state.directionalShadowMatrix,Pe.spotShadowMap.value=vt.state.spotShadowMap,Pe.spotLightMatrix.value=vt.state.spotLightMatrix,Pe.spotLightMap.value=vt.state.spotLightMap,Pe.pointShadowMap.value=vt.state.pointShadowMap,Pe.pointShadowMatrix.value=vt.state.pointShadowMatrix),St.currentProgram=Ae,St.uniformsList=null,Ae}function pr(Z){if(Z.uniformsList===null){let mt=Z.currentProgram.getUniforms();Z.uniformsList=kc.seqWithValue(mt.seq,Z.uniforms)}return Z.uniformsList}function ur(Z,mt){let Rt=be.get(Z);Rt.outputColorSpace=mt.outputColorSpace,Rt.batching=mt.batching,Rt.instancing=mt.instancing,Rt.instancingColor=mt.instancingColor,Rt.instancingMorph=mt.instancingMorph,Rt.skinning=mt.skinning,Rt.morphTargets=mt.morphTargets,Rt.morphNormals=mt.morphNormals,Rt.morphColors=mt.morphColors,Rt.morphTargetsCount=mt.morphTargetsCount,Rt.numClippingPlanes=mt.numClippingPlanes,Rt.numIntersection=mt.numClipIntersection,Rt.vertexAlphas=mt.vertexAlphas,Rt.vertexTangents=mt.vertexTangents,Rt.toneMapping=mt.toneMapping}function Qn(Z,mt,Rt,St,vt){mt.isScene!==!0&&(mt=qt),Wt.resetTextureUnits();let he=mt.fog,ue=St.isMeshStandardMaterial?mt.environment:null,we=q===null?C.outputColorSpace:q.isXRRenderTarget===!0?q.texture.colorSpace:ju,de=(St.isMeshStandardMaterial?tt:Me).get(St.envMap||ue),Be=St.vertexColors===!0&&!!Rt.attributes.color&&Rt.attributes.color.itemSize===4,Ae=!!Rt.attributes.tangent&&(!!St.normalMap||St.anisotropy>0),Pe=!!Rt.morphAttributes.position,nn=!!Rt.morphAttributes.normal,si=!!Rt.morphAttributes.color,br=Wu;St.toneMapped&&(q===null||q.isXRRenderTarget===!0)&&(br=C.toneMapping);let Vi=Rt.morphAttributes.position||Rt.morphAttributes.normal||Rt.morphAttributes.color,sr=Vi!==void 0?Vi.length:0,ye=be.get(St),Fa=x.state.lights;if(ut===!0&&(Ut===!0||Z!==xt)){let Ai=Z===xt&&St.id===D;Zt.setState(St,Z,Ai)}let rn=!1;St.version===ye.__version?(ye.needsLights&&ye.lightsStateVersion!==Fa.state.version||ye.outputColorSpace!==we||vt.isBatchedMesh&&ye.batching===!1||!vt.isBatchedMesh&&ye.batching===!0||vt.isInstancedMesh&&ye.instancing===!1||!vt.isInstancedMesh&&ye.instancing===!0||vt.isSkinnedMesh&&ye.skinning===!1||!vt.isSkinnedMesh&&ye.skinning===!0||vt.isInstancedMesh&&ye.instancingColor===!0&&vt.instanceColor===null||vt.isInstancedMesh&&ye.instancingColor===!1&&vt.instanceColor!==null||vt.isInstancedMesh&&ye.instancingMorph===!0&&vt.morphTexture===null||vt.isInstancedMesh&&ye.instancingMorph===!1&&vt.morphTexture!==null||ye.envMap!==de||St.fog===!0&&ye.fog!==he||ye.numClippingPlanes!==void 0&&(ye.numClippingPlanes!==Zt.numPlanes||ye.numIntersection!==Zt.numIntersection)||ye.vertexAlphas!==Be||ye.vertexTangents!==Ae||ye.morphTargets!==Pe||ye.morphNormals!==nn||ye.morphColors!==si||ye.toneMapping!==br||ge.isWebGL2===!0&&ye.morphTargetsCount!==sr)&&(rn=!0):(rn=!0,ye.__version=St.version);let fo=ye.currentProgram;rn===!0&&(fo=rr(St,mt,vt));let al=!1,Ge=!1,ys=!1,ir=fo.getUniforms(),jo=ye.uniforms;if(fe.useProgram(fo.program)&&(al=!0,Ge=!0,ys=!0),St.id!==D&&(D=St.id,Ge=!0),al||xt!==Z){ir.setValue(ft,"projectionMatrix",Z.projectionMatrix),ir.setValue(ft,"viewMatrix",Z.matrixWorldInverse);let Ai=ir.map.cameraPosition;Ai!==void 0&&Ai.setValue(ft,$t.setFromMatrixPosition(Z.matrixWorld)),ge.logarithmicDepthBuffer&&ir.setValue(ft,"logDepthBufFC",2/(Math.log(Z.far+1)/Math.LN2)),(St.isMeshPhongMaterial||St.isMeshToonMaterial||St.isMeshLambertMaterial||St.isMeshBasicMaterial||St.isMeshStandardMaterial||St.isShaderMaterial)&&ir.setValue(ft,"isOrthographic",Z.isOrthographicCamera===!0),xt!==Z&&(xt=Z,Ge=!0,ys=!0)}if(vt.isSkinnedMesh){ir.setOptional(ft,vt,"bindMatrix"),ir.setOptional(ft,vt,"bindMatrixInverse");let Ai=vt.skeleton;Ai&&(ge.floatVertexTextures?(Ai.boneTexture===null&&Ai.computeBoneTexture(),ir.setValue(ft,"boneTexture",Ai.boneTexture,Wt)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}vt.isBatchedMesh&&(ir.setOptional(ft,vt,"batchingTexture"),ir.setValue(ft,"batchingTexture",vt._matricesTexture,Wt));let Le=Rt.morphAttributes;if((Le.position!==void 0||Le.normal!==void 0||Le.color!==void 0&&ge.isWebGL2===!0)&&P.update(vt,Rt,fo),(Ge||ye.receiveShadow!==vt.receiveShadow)&&(ye.receiveShadow=vt.receiveShadow,ir.setValue(ft,"receiveShadow",vt.receiveShadow)),St.isMeshGouraudMaterial&&St.envMap!==null&&(jo.envMap.value=de,jo.flipEnvMap.value=de.isCubeTexture&&de.isRenderTargetTexture===!1?-1:1),Ge&&(ir.setValue(ft,"toneMappingExposure",C.toneMappingExposure),ye.needsLights&&bi(jo,ys),he&&St.fog===!0&&Ht.refreshFogUniforms(jo,he),Ht.refreshMaterialUniforms(jo,St,Lt,Mt,jt),kc.upload(ft,pr(ye),jo,Wt)),St.isShaderMaterial&&St.uniformsNeedUpdate===!0&&(kc.upload(ft,pr(ye),jo,Wt),St.uniformsNeedUpdate=!1),St.isSpriteMaterial&&ir.setValue(ft,"center",vt.center),ir.setValue(ft,"modelViewMatrix",vt.modelViewMatrix),ir.setValue(ft,"normalMatrix",vt.normalMatrix),ir.setValue(ft,"modelMatrix",vt.matrixWorld),St.isShaderMaterial||St.isRawShaderMaterial){let Ai=St.uniformsGroups;for(let Ua=0,gu=Ai.length;Ua<gu;Ua++)if(ge.isWebGL2){let Ti=Ai[Ua];ht.update(Ti,fo),ht.bind(Ti,fo)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return fo}function bi(Z,mt){Z.ambientLightColor.needsUpdate=mt,Z.lightProbe.needsUpdate=mt,Z.directionalLights.needsUpdate=mt,Z.directionalLightShadows.needsUpdate=mt,Z.pointLights.needsUpdate=mt,Z.pointLightShadows.needsUpdate=mt,Z.spotLights.needsUpdate=mt,Z.spotLightShadows.needsUpdate=mt,Z.rectAreaLights.needsUpdate=mt,Z.hemisphereLights.needsUpdate=mt}function oi(Z){return Z.isMeshLambertMaterial||Z.isMeshToonMaterial||Z.isMeshPhongMaterial||Z.isMeshStandardMaterial||Z.isShadowMaterial||Z.isShaderMaterial&&Z.lights===!0}this.getActiveCubeFace=function(){return V},this.getActiveMipmapLevel=function(){return X},this.getRenderTarget=function(){return q},this.setRenderTargetTextures=function(Z,mt,Rt){be.get(Z.texture).__webglTexture=mt,be.get(Z.depthTexture).__webglTexture=Rt;let St=be.get(Z);St.__hasExternalTextures=!0,St.__autoAllocateDepthBuffer=Rt===void 0,St.__autoAllocateDepthBuffer||ee.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),St.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(Z,mt){let Rt=be.get(Z);Rt.__webglFramebuffer=mt,Rt.__useDefaultFramebuffer=mt===void 0},this.setRenderTarget=function(Z,mt=0,Rt=0){q=Z,V=mt,X=Rt;let St=!0,vt=null,he=!1,ue=!1;if(Z){let de=be.get(Z);de.__useDefaultFramebuffer!==void 0?(fe.bindFramebuffer(ft.FRAMEBUFFER,null),St=!1):de.__webglFramebuffer===void 0?Wt.setupRenderTarget(Z):de.__hasExternalTextures&&Wt.rebindTextures(Z,be.get(Z.texture).__webglTexture,be.get(Z.depthTexture).__webglTexture);let Be=Z.texture;(Be.isData3DTexture||Be.isDataArrayTexture||Be.isCompressedArrayTexture)&&(ue=!0);let Ae=be.get(Z).__webglFramebuffer;Z.isWebGLCubeRenderTarget?(Array.isArray(Ae[mt])?vt=Ae[mt][Rt]:vt=Ae[mt],he=!0):ge.isWebGL2&&Z.samples>0&&Wt.useMultisampledRTT(Z)===!1?vt=be.get(Z).__webglMultisampledFramebuffer:Array.isArray(Ae)?vt=Ae[Rt]:vt=Ae,B.copy(Z.viewport),j.copy(Z.scissor),K=Z.scissorTest}else B.copy(J).multiplyScalar(Lt).floor(),j.copy(Bt).multiplyScalar(Lt).floor(),K=Gt;if(fe.bindFramebuffer(ft.FRAMEBUFFER,vt)&&ge.drawBuffers&&St&&fe.drawBuffers(Z,vt),fe.viewport(B),fe.scissor(j),fe.setScissorTest(K),he){let de=be.get(Z.texture);ft.framebufferTexture2D(ft.FRAMEBUFFER,ft.COLOR_ATTACHMENT0,ft.TEXTURE_CUBE_MAP_POSITIVE_X+mt,de.__webglTexture,Rt)}else if(ue){let de=be.get(Z.texture),Be=mt||0;ft.framebufferTextureLayer(ft.FRAMEBUFFER,ft.COLOR_ATTACHMENT0,de.__webglTexture,Rt||0,Be)}D=-1},this.readRenderTargetPixels=function(Z,mt,Rt,St,vt,he,ue){if(!(Z&&Z.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let we=be.get(Z).__webglFramebuffer;if(Z.isWebGLCubeRenderTarget&&ue!==void 0&&(we=we[ue]),we){fe.bindFramebuffer(ft.FRAMEBUFFER,we);try{let de=Z.texture,Be=de.format,Ae=de.type;if(Be!==ea&&$.convert(Be)!==ft.getParameter(ft.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}let Pe=Ae===oh&&(ee.has("EXT_color_buffer_half_float")||ge.isWebGL2&&ee.has("EXT_color_buffer_float"));if(Ae!==Xu&&$.convert(Ae)!==ft.getParameter(ft.IMPLEMENTATION_COLOR_READ_TYPE)&&!(Ae===cu&&(ge.isWebGL2||ee.has("OES_texture_float")||ee.has("WEBGL_color_buffer_float")))&&!Pe){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}mt>=0&&mt<=Z.width-St&&Rt>=0&&Rt<=Z.height-vt&&ft.readPixels(mt,Rt,St,vt,$.convert(Be),$.convert(Ae),he)}finally{let de=q!==null?be.get(q).__webglFramebuffer:null;fe.bindFramebuffer(ft.FRAMEBUFFER,de)}}},this.copyFramebufferToTexture=function(Z,mt,Rt=0){let St=Math.pow(2,-Rt),vt=Math.floor(mt.image.width*St),he=Math.floor(mt.image.height*St);Wt.setTexture2D(mt,0),ft.copyTexSubImage2D(ft.TEXTURE_2D,Rt,0,0,Z.x,Z.y,vt,he),fe.unbindTexture()},this.copyTextureToTexture=function(Z,mt,Rt,St=0){let vt=mt.image.width,he=mt.image.height,ue=$.convert(Rt.format),we=$.convert(Rt.type);Wt.setTexture2D(Rt,0),ft.pixelStorei(ft.UNPACK_FLIP_Y_WEBGL,Rt.flipY),ft.pixelStorei(ft.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Rt.premultiplyAlpha),ft.pixelStorei(ft.UNPACK_ALIGNMENT,Rt.unpackAlignment),mt.isDataTexture?ft.texSubImage2D(ft.TEXTURE_2D,St,Z.x,Z.y,vt,he,ue,we,mt.image.data):mt.isCompressedTexture?ft.compressedTexSubImage2D(ft.TEXTURE_2D,St,Z.x,Z.y,mt.mipmaps[0].width,mt.mipmaps[0].height,ue,mt.mipmaps[0].data):ft.texSubImage2D(ft.TEXTURE_2D,St,Z.x,Z.y,ue,we,mt.image),St===0&&Rt.generateMipmaps&&ft.generateMipmap(ft.TEXTURE_2D),fe.unbindTexture()},this.copyTextureToTexture3D=function(Z,mt,Rt,St,vt=0){if(C.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let he=Math.round(Z.max.x-Z.min.x),ue=Math.round(Z.max.y-Z.min.y),we=Z.max.z-Z.min.z+1,de=$.convert(St.format),Be=$.convert(St.type),Ae;if(St.isData3DTexture)Wt.setTexture3D(St,0),Ae=ft.TEXTURE_3D;else if(St.isDataArrayTexture||St.isCompressedArrayTexture)Wt.setTexture2DArray(St,0),Ae=ft.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}ft.pixelStorei(ft.UNPACK_FLIP_Y_WEBGL,St.flipY),ft.pixelStorei(ft.UNPACK_PREMULTIPLY_ALPHA_WEBGL,St.premultiplyAlpha),ft.pixelStorei(ft.UNPACK_ALIGNMENT,St.unpackAlignment);let Pe=ft.getParameter(ft.UNPACK_ROW_LENGTH),nn=ft.getParameter(ft.UNPACK_IMAGE_HEIGHT),si=ft.getParameter(ft.UNPACK_SKIP_PIXELS),br=ft.getParameter(ft.UNPACK_SKIP_ROWS),Vi=ft.getParameter(ft.UNPACK_SKIP_IMAGES),sr=Rt.isCompressedTexture?Rt.mipmaps[vt]:Rt.image;ft.pixelStorei(ft.UNPACK_ROW_LENGTH,sr.width),ft.pixelStorei(ft.UNPACK_IMAGE_HEIGHT,sr.height),ft.pixelStorei(ft.UNPACK_SKIP_PIXELS,Z.min.x),ft.pixelStorei(ft.UNPACK_SKIP_ROWS,Z.min.y),ft.pixelStorei(ft.UNPACK_SKIP_IMAGES,Z.min.z),Rt.isDataTexture||Rt.isData3DTexture?ft.texSubImage3D(Ae,vt,mt.x,mt.y,mt.z,he,ue,we,de,Be,sr.data):St.isCompressedArrayTexture?ft.compressedTexSubImage3D(Ae,vt,mt.x,mt.y,mt.z,he,ue,we,de,sr.data):ft.texSubImage3D(Ae,vt,mt.x,mt.y,mt.z,he,ue,we,de,Be,sr),ft.pixelStorei(ft.UNPACK_ROW_LENGTH,Pe),ft.pixelStorei(ft.UNPACK_IMAGE_HEIGHT,nn),ft.pixelStorei(ft.UNPACK_SKIP_PIXELS,si),ft.pixelStorei(ft.UNPACK_SKIP_ROWS,br),ft.pixelStorei(ft.UNPACK_SKIP_IMAGES,Vi),vt===0&&St.generateMipmaps&&ft.generateMipmap(Ae),fe.unbindTexture()},this.initTexture=function(Z){Z.isCubeTexture?Wt.setTextureCube(Z,0):Z.isData3DTexture?Wt.setTexture3D(Z,0):Z.isDataArrayTexture||Z.isCompressedArrayTexture?Wt.setTexture2DArray(Z,0):Wt.setTexture2D(Z,0),fe.unbindTexture()},this.resetState=function(){V=0,X=0,q=null,fe.reset(),W.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return fu}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;let e=this.getContext();e.drawingBufferColorSpace=t===Ov?"display-p3":"srgb",e.unpackColorSpace=xr.workingColorSpace===Xd?"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}},vv=class extends yv{};vv.prototype.isWebGL1Renderer=!0;var _v=class{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=Ky,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Yu()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return yC("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,o){t*=this.stride,o*=e.stride;for(let s=0,c=this.stride;s<c;s++)this.array[t+s]=e.array[o+s];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Yu()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),o=new this.constructor(e,this.stride);return o.setUsage(this.usage),o}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Yu()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}},wo=new Pt,Vd=class n{constructor(t,e,o,s=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=o,this.normalized=s}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,o=this.data.count;e<o;e++)wo.fromBufferAttribute(this,e),wo.applyMatrix4(t),this.setXYZ(e,wo.x,wo.y,wo.z);return this}applyNormalMatrix(t){for(let e=0,o=this.count;e<o;e++)wo.fromBufferAttribute(this,e),wo.applyNormalMatrix(t),this.setXYZ(e,wo.x,wo.y,wo.z);return this}transformDirection(t){for(let e=0,o=this.count;e<o;e++)wo.fromBufferAttribute(this,e),wo.transformDirection(t),this.setXYZ(e,wo.x,wo.y,wo.z);return this}getComponent(t,e){let o=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(o=Ta(o,this.array)),o}setComponent(t,e,o){return this.normalized&&(o=_r(o,this.array)),this.data.array[t*this.data.stride+this.offset+e]=o,this}setX(t,e){return this.normalized&&(e=_r(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=_r(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=_r(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=_r(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=Ta(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=Ta(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=Ta(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=Ta(e,this.array)),e}setXY(t,e,o){return t=t*this.data.stride+this.offset,this.normalized&&(e=_r(e,this.array),o=_r(o,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=o,this}setXYZ(t,e,o,s){return t=t*this.data.stride+this.offset,this.normalized&&(e=_r(e,this.array),o=_r(o,this.array),s=_r(s,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=o,this.data.array[t+2]=s,this}setXYZW(t,e,o,s,c){return t=t*this.data.stride+this.offset,this.normalized&&(e=_r(e,this.array),o=_r(o,this.array),s=_r(s,this.array),c=_r(c,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=o,this.data.array[t+2]=s,this.data.array[t+3]=c,this}clone(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let e=[];for(let o=0;o<this.count;o++){let s=o*this.data.stride+this.offset;for(let c=0;c<this.itemSize;c++)e.push(this.data.array[s+c])}return new gs(new this.array.constructor(e),this.itemSize,this.normalized)}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new n(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");let e=[];for(let o=0;o<this.count;o++){let s=o*this.data.stride+this.offset;for(let c=0;c<this.itemSize;c++)e.push(this.data.array[s+c])}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}}},xv=class extends Bl{constructor(t){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new ar(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}},ku,eh=new Pt,Nc=new Pt,Oc=new Pt,Dc=new ze,nh=new ze,AC=new vi,_d=new Pt,rh=new Pt,xd=new Pt,rC=new ze,Hy=new ze,iC=new ze,Ev=class extends ra{constructor(t=new xv){if(super(),this.isSprite=!0,this.type="Sprite",ku===void 0){ku=new Ju;let e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),o=new _v(e,5);ku.setIndex([0,1,2,0,2,3]),ku.setAttribute("position",new Vd(o,3,0,!1)),ku.setAttribute("uv",new Vd(o,2,3,!1))}this.geometry=ku,this.material=t,this.center=new ze(.5,.5)}raycast(t,e){t.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Nc.setFromMatrixScale(this.matrixWorld),AC.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),Oc.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Nc.multiplyScalar(-Oc.z);let o=this.material.rotation,s,c;o!==0&&(c=Math.cos(o),s=Math.sin(o));let p=this.center;Ed(_d.set(-.5,-.5,0),Oc,p,Nc,s,c),Ed(rh.set(.5,-.5,0),Oc,p,Nc,s,c),Ed(xd.set(.5,.5,0),Oc,p,Nc,s,c),rC.set(0,0),Hy.set(1,0),iC.set(1,1);let h=t.ray.intersectTriangle(_d,rh,xd,!1,eh);if(h===null&&(Ed(rh.set(-.5,.5,0),Oc,p,Nc,s,c),Hy.set(0,1),h=t.ray.intersectTriangle(_d,xd,rh,!1,eh),h===null))return;let g=t.ray.origin.distanceTo(eh);g<t.near||g>t.far||e.push({distance:g,point:eh.clone(),uv:Nl.getInterpolation(eh,_d,rh,xd,rC,Hy,iC,new ze),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}};Ev.Dispose=function(){ku.dispose(),ku=void 0};function Ed(n,t,e,o,s,c){Dc.subVectors(n,e).addScalar(.5).multiply(o),s!==void 0?(nh.x=c*Dc.x-s*Dc.y,nh.y=s*Dc.x+c*Dc.y):nh.copy(Dc),n.copy(t),n.x+=nh.x,n.y+=nh.y,n.applyMatrix4(AC)}function wd(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 dX(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}var Xc=class{constructor(t,e,o,s){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=s!==void 0?s:new e.constructor(o),this.sampleValues=e,this.valueSize=o,this.settings=null,this.DefaultSettings_={}}evaluate(t){let e=this.parameterPositions,o=this._cachedIndex,s=e[o],c=e[o-1];t:{e:{let p;n:{r:if(!(t<s)){for(let h=o+2;;){if(s===void 0){if(t<c)break r;return o=e.length,this._cachedIndex=o,this.copySampleValue_(o-1)}if(o===h)break;if(c=s,s=e[++o],t<s)break e}p=e.length;break n}if(!(t>=c)){let h=e[1];t<h&&(o=2,c=h);for(let g=o-2;;){if(c===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(o===g)break;if(s=c,c=e[--o-1],t>=c)break e}p=o,o=0;break n}break t}for(;o<p;){let h=o+p>>>1;t<e[h]?p=h:o=h+1}if(s=e[o],c=e[o-1],c===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(s===void 0)return o=e.length,this._cachedIndex=o,this.copySampleValue_(o-1)}this._cachedIndex=o,this.intervalChanged_(o,c,s)}return this.interpolate_(o,c,t,s)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,o=this.sampleValues,s=this.valueSize,c=t*s;for(let p=0;p!==s;++p)e[p]=o[c+p];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},wv=class extends Xc{constructor(t,e,o,s){super(t,e,o,s),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:hT,endingEnd:hT}}intervalChanged_(t,e,o){let s=this.parameterPositions,c=t-2,p=t+1,h=s[c],g=s[p];if(h===void 0)switch(this.getSettings_().endingStart){case pT:c=t,h=2*e-o;break;case dT:c=s.length-2,h=e+s[c]-s[c+1];break;default:c=t,h=o}if(g===void 0)switch(this.getSettings_().endingEnd){case pT:p=t,g=2*o-e;break;case dT:p=1,g=o+s[1]-s[0];break;default:p=t-1,g=e}let m=(o-e)*.5,_=this.valueSize;this._weightPrev=m/(e-h),this._weightNext=m/(g-o),this._offsetPrev=c*_,this._offsetNext=p*_}interpolate_(t,e,o,s){let c=this.resultBuffer,p=this.sampleValues,h=this.valueSize,g=t*h,m=g-h,_=this._offsetPrev,w=this._offsetNext,S=this._weightPrev,b=this._weightNext,T=(o-e)/(s-e),R=T*T,x=R*T,E=-S*x+2*S*R-S*T,I=(1+S)*x+(-1.5-2*S)*R+(-.5+S)*T+1,C=(-1-b)*x+(1.5+b)*R+.5*T,F=b*x-b*R;for(let V=0;V!==h;++V)c[V]=E*p[_+V]+I*p[m+V]+C*p[g+V]+F*p[w+V];return c}},Sv=class extends Xc{constructor(t,e,o,s){super(t,e,o,s)}interpolate_(t,e,o,s){let c=this.resultBuffer,p=this.sampleValues,h=this.valueSize,g=t*h,m=g-h,_=(o-e)/(s-e),w=1-_;for(let S=0;S!==h;++S)c[S]=p[m+S]*w+p[g+S]*_;return c}},Mv=class extends Xc{constructor(t,e,o,s){super(t,e,o,s)}interpolate_(t){return this.copySampleValue_(t-1)}},ia=class{constructor(t,e,o,s){if(t===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(e===void 0||e.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=wd(e,this.TimeBufferType),this.values=wd(o,this.ValueBufferType),this.setInterpolation(s||this.DefaultInterpolation)}static toJSON(t){let e=t.constructor,o;if(e.toJSON!==this.toJSON)o=e.toJSON(t);else{o={name:t.name,times:wd(t.times,Array),values:wd(t.values,Array)};let s=t.getInterpolation();s!==t.DefaultInterpolation&&(o.interpolation=s)}return o.type=t.ValueTypeName,o}InterpolantFactoryMethodDiscrete(t){return new Mv(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new Sv(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new wv(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case Md:e=this.InterpolantFactoryMethodDiscrete;break;case bd:e=this.InterpolantFactoryMethodLinear;break;case my:e=this.InterpolantFactoryMethodSmooth;break}if(e===void 0){let o="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(o);return console.warn("THREE.KeyframeTrack:",o),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Md;case this.InterpolantFactoryMethodLinear:return bd;case this.InterpolantFactoryMethodSmooth:return my}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){let e=this.times;for(let o=0,s=e.length;o!==s;++o)e[o]+=t}return this}scale(t){if(t!==1){let e=this.times;for(let o=0,s=e.length;o!==s;++o)e[o]*=t}return this}trim(t,e){let o=this.times,s=o.length,c=0,p=s-1;for(;c!==s&&o[c]<t;)++c;for(;p!==-1&&o[p]>e;)--p;if(++p,c!==0||p!==s){c>=p&&(p=Math.max(p,1),c=p-1);let h=this.getValueSize();this.times=o.slice(c,p),this.values=this.values.slice(c*h,p*h)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);let o=this.times,s=this.values,c=o.length;c===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let p=null;for(let h=0;h!==c;h++){let g=o[h];if(typeof g=="number"&&isNaN(g)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,h,g),t=!1;break}if(p!==null&&p>g){console.error("THREE.KeyframeTrack: Out of order keys.",this,h,g,p),t=!1;break}p=g}if(s!==void 0&&dX(s))for(let h=0,g=s.length;h!==g;++h){let m=s[h];if(isNaN(m)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,h,m),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),o=this.getValueSize(),s=this.getInterpolation()===my,c=t.length-1,p=1;for(let h=1;h<c;++h){let g=!1,m=t[h],_=t[h+1];if(m!==_&&(h!==1||m!==t[0]))if(s)g=!0;else{let w=h*o,S=w-o,b=w+o;for(let T=0;T!==o;++T){let R=e[w+T];if(R!==e[S+T]||R!==e[b+T]){g=!0;break}}}if(g){if(h!==p){t[p]=t[h];let w=h*o,S=p*o;for(let b=0;b!==o;++b)e[S+b]=e[w+b]}++p}}if(c>0){t[p]=t[c];for(let h=c*o,g=p*o,m=0;m!==o;++m)e[g+m]=e[h+m];++p}return p!==t.length?(this.times=t.slice(0,p),this.values=e.slice(0,p*o)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),o=this.constructor,s=new o(this.name,t,e);return s.createInterpolant=this.createInterpolant,s}};ia.prototype.TimeBufferType=Float32Array;ia.prototype.ValueBufferType=Float32Array;ia.prototype.DefaultInterpolation=bd;var zl=class extends ia{};zl.prototype.ValueTypeName="bool";zl.prototype.ValueBufferType=Array;zl.prototype.DefaultInterpolation=Md;zl.prototype.InterpolantFactoryMethodLinear=void 0;zl.prototype.InterpolantFactoryMethodSmooth=void 0;var bv=class extends ia{};bv.prototype.ValueTypeName="color";var Av=class extends ia{};Av.prototype.ValueTypeName="number";var Tv=class extends Xc{constructor(t,e,o,s){super(t,e,o,s)}interpolate_(t,e,o,s){let c=this.resultBuffer,p=this.sampleValues,h=this.valueSize,g=(o-e)/(s-e),m=t*h;for(let _=m+h;m!==_;m+=4)Ku.slerpFlat(c,0,p,m-h,p,m,g);return c}},uh=class extends ia{InterpolantFactoryMethodLinear(t){return new Tv(this.times,this.values,this.getValueSize(),t)}};uh.prototype.ValueTypeName="quaternion";uh.prototype.DefaultInterpolation=bd;uh.prototype.InterpolantFactoryMethodSmooth=void 0;var Gl=class extends ia{};Gl.prototype.ValueTypeName="string";Gl.prototype.ValueBufferType=Array;Gl.prototype.DefaultInterpolation=Md;Gl.prototype.InterpolantFactoryMethodLinear=void 0;Gl.prototype.InterpolantFactoryMethodSmooth=void 0;var Cv=class extends ia{};Cv.prototype.ValueTypeName="vector";var Pv=class{constructor(t,e,o){let s=this,c=!1,p=0,h=0,g,m=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=o,this.itemStart=function(_){h++,c===!1&&s.onStart!==void 0&&s.onStart(_,p,h),c=!0},this.itemEnd=function(_){p++,s.onProgress!==void 0&&s.onProgress(_,p,h),p===h&&(c=!1,s.onLoad!==void 0&&s.onLoad())},this.itemError=function(_){s.onError!==void 0&&s.onError(_)},this.resolveURL=function(_){return g?g(_):_},this.setURLModifier=function(_){return g=_,this},this.addHandler=function(_,w){return m.push(_,w),this},this.removeHandler=function(_){let w=m.indexOf(_);return w!==-1&&m.splice(w,2),this},this.getHandler=function(_){for(let w=0,S=m.length;w<S;w+=2){let b=m[w],T=m[w+1];if(b.global&&(b.lastIndex=0),b.test(_))return T}return null}}},gX=new Pv,Iv=class{constructor(t){this.manager=t!==void 0?t:gX,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){let o=this;return new Promise(function(s,c){o.load(t,s,e,c)})}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}};Iv.DEFAULT_MATERIAL_NAME="__DEFAULT";var Fv="\\[\\]\\.:\\/",mX=new RegExp("["+Fv+"]","g"),Uv="[^"+Fv+"]",yX="[^"+Fv.replace("\\.","")+"]",vX=/((?:WC+[\/:])*)/.source.replace("WC",Uv),_X=/(WCOD+)?/.source.replace("WCOD",yX),xX=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Uv),EX=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Uv),wX=new RegExp("^"+vX+_X+xX+EX+"$"),SX=["material","materials","bones","map"],Rv=class{constructor(t,e,o){let s=o||Or.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,s)}getValue(t,e){this.bind();let o=this._targetGroup.nCachedObjects_,s=this._bindings[o];s!==void 0&&s.getValue(t,e)}setValue(t,e){let o=this._bindings;for(let s=this._targetGroup.nCachedObjects_,c=o.length;s!==c;++s)o[s].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,o=t.length;e!==o;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,o=t.length;e!==o;++e)t[e].unbind()}},Or=class n{constructor(t,e,o){this.path=e,this.parsedPath=o||n.parseTrackName(e),this.node=n.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,o){return t&&t.isAnimationObjectGroup?new n.Composite(t,e,o):new n(t,e,o)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(mX,"")}static parseTrackName(t){let e=wX.exec(t);if(e===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);let o={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},s=o.nodeName&&o.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){let c=o.nodeName.substring(s+1);SX.indexOf(c)!==-1&&(o.nodeName=o.nodeName.substring(0,s),o.objectName=c)}if(o.propertyName===null||o.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return o}static findNode(t,e){if(e===void 0||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){let o=t.skeleton.getBoneByName(e);if(o!==void 0)return o}if(t.children){let o=function(c){for(let p=0;p<c.length;p++){let h=c[p];if(h.name===e||h.uuid===e)return h;let g=o(h.children);if(g)return g}return null},s=o(t.children);if(s)return s}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){let o=this.resolvedProperty;for(let s=0,c=o.length;s!==c;++s)t[e++]=o[s]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){let o=this.resolvedProperty;for(let s=0,c=o.length;s!==c;++s)o[s]=t[e++]}_setValue_array_setNeedsUpdate(t,e){let o=this.resolvedProperty;for(let s=0,c=o.length;s!==c;++s)o[s]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){let o=this.resolvedProperty;for(let s=0,c=o.length;s!==c;++s)o[s]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node,e=this.parsedPath,o=e.objectName,s=e.propertyName,c=e.propertyIndex;if(t||(t=n.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(o){let m=e.objectIndex;switch(o){case"materials":if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}t=t.material.materials;break;case"bones":if(!t.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}t=t.skeleton.bones;for(let _=0;_<t.length;_++)if(t[_].name===m){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[o]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}t=t[o]}if(m!==void 0){if(t[m]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);return}t=t[m]}}let p=t[s];if(p===void 0){let m=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+m+"."+s+" but it wasn't found.",t);return}let h=this.Versioning.None;this.targetObject=t,t.needsUpdate!==void 0?h=this.Versioning.NeedsUpdate:t.matrixWorldNeedsUpdate!==void 0&&(h=this.Versioning.MatrixWorldNeedsUpdate);let g=this.BindingType.Direct;if(c!==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[c]!==void 0&&(c=t.morphTargetDictionary[c])}g=this.BindingType.ArrayElement,this.resolvedProperty=p,this.propertyIndex=c}else p.fromArray!==void 0&&p.toArray!==void 0?(g=this.BindingType.HasFromToArray,this.resolvedProperty=p):Array.isArray(p)?(g=this.BindingType.EntireArray,this.resolvedProperty=p):this.propertyName=s;this.getValue=this.GetterByBindingType[g],this.setValue=this.SetterByBindingTypeAndVersioning[g][h]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};Or.Composite=Rv;Or.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Or.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Or.prototype.GetterByBindingType=[Or.prototype._getValue_direct,Or.prototype._getValue_array,Or.prototype._getValue_arrayElement,Or.prototype._getValue_toArray];Or.prototype.SetterByBindingTypeAndVersioning=[[Or.prototype._setValue_direct,Or.prototype._setValue_direct_setNeedsUpdate,Or.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Or.prototype._setValue_array,Or.prototype._setValue_array_setNeedsUpdate,Or.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Or.prototype._setValue_arrayElement,Or.prototype._setValue_arrayElement_setNeedsUpdate,Or.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Or.prototype._setValue_fromArray,Or.prototype._setValue_fromArray_setNeedsUpdate,Or.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var $tt=new Float32Array(1);typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Lv}}));typeof window!="undefined"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Lv);var zi=63710088e-1,Jtt={centimeters:zi*100,centimetres:zi*100,degrees:zi/111325,feet:zi*3.28084,inches:zi*39.37,kilometers:zi/1e3,kilometres:zi/1e3,meters:zi,metres:zi,miles:zi/1609.344,millimeters:zi*1e3,millimetres:zi*1e3,nauticalmiles:zi/1852,radians:1,yards:zi*1.0936},jtt={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/zi,yards:1.0936133};function bo(n,t,e){e===void 0&&(e={});var o={type:"Feature"};return(e.id===0||e.id)&&(o.id=e.id),e.bbox&&(o.bbox=e.bbox),o.properties=t||{},o.geometry=n,o}function Pr(n,t,e){if(e===void 0&&(e={}),!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Pa(n[0])||!Pa(n[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:n};return bo(o,t,e)}function Dr(n,t,e){e===void 0&&(e={});for(var o=0,s=n;o<s.length;o++){var c=s[o];if(c.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var p=0;p<c[c.length-1].length;p++)if(c[c.length-1][p]!==c[0][p])throw new Error("First and last Position are not equivalent.")}var h={type:"Polygon",coordinates:n};return bo(h,t,e)}function Gi(n,t,e){if(e===void 0&&(e={}),n.length<2)throw new Error("coordinates must be an array of two or more positions");var o={type:"LineString",coordinates:n};return bo(o,t,e)}function Bv(n,t,e){e===void 0&&(e={});var o={type:"MultiPoint",coordinates:n};return bo(o,t,e)}function Pa(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}function Ei(n,t,e){if(n!==null)for(var o,s,c,p,h,g,m,_=0,w=0,S,b=n.type,T=b==="FeatureCollection",R=b==="Feature",x=T?n.features.length:1,E=0;E<x;E++){m=T?n.features[E].geometry:R?n.geometry:n,S=m?m.type==="GeometryCollection":!1,h=S?m.geometries.length:1;for(var I=0;I<h;I++){var C=0,F=0;if(p=S?m.geometries[I]: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,w,E,C,F)===!1)return!1;w++,C++;break;case"LineString":case"MultiPoint":for(o=0;o<g.length;o++){if(t(g[o],w,E,C,F)===!1)return!1;w++,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],w,E,C,F)===!1)return!1;w++}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(c=0;c<g[o][s].length-_;c++){if(t(g[o][s][c],w,E,C,F)===!1)return!1;w++}F++}C++}break;case"GeometryCollection":for(o=0;o<p.geometries.length;o++)if(Ei(p.geometries[o],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function TC(n,t,e,o){var s=e;return Ei(n,function(c,p,h,g,m){p===0&&e===void 0?s=c:s=t(s,c,p,h,g,m)},o),s}function Qu(n,t){var e,o,s,c,p,h,g,m,_,w,S=0,b=n.type==="FeatureCollection",T=n.type==="Feature",R=b?n.features.length:1;for(e=0;e<R;e++){for(h=b?n.features[e].geometry:T?n.geometry:n,m=b?n.features[e].properties:T?n.properties:{},_=b?n.features[e].bbox:T?n.bbox:void 0,w=b?n.features[e].id:T?n.id:void 0,g=h?h.type==="GeometryCollection":!1,p=g?h.geometries.length:1,s=0;s<p;s++){if(c=g?h.geometries[s]:h,c===null){if(t(null,S,m,_,w)===!1)return!1;continue}switch(c.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(c,S,m,_,w)===!1)return!1;break}case"GeometryCollection":{for(o=0;o<c.geometries.length;o++)if(t(c.geometries[o],S,m,_,w)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}S++}}function ms(n,t){Qu(n,function(e,o,s,c,p){var h=e===null?null:e.type;switch(h){case null:case"Point":case"LineString":case"Polygon":return t(bo(e,s,{bbox:c,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],w={type:g,coordinates:_};if(t(bo(w,s),o,m)===!1)return!1}})}function zv(n){var t=[1/0,1/0,-1/0,-1/0];return Ei(n,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}zv.default=zv;var Ao=zv;function Qi(n){if(!n)throw new Error("coord is required");if(!Array.isArray(n)){if(n.type==="Feature"&&n.geometry!==null&&n.geometry.type==="Point")return n.geometry.coordinates;if(n.type==="Point")return n.coordinates}if(Array.isArray(n)&&n.length>=2&&!Array.isArray(n[0])&&!Array.isArray(n[1]))return n;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Gv(n,t,e){if(!n)throw new Error("No feature passed");if(!e)throw new Error(".featureOf() requires a name");if(!n||n.type!=="Feature"||!n.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!n.geometry||n.geometry.type!==t)throw new Error("Invalid input to "+e+": must be a "+t+", given "+n.geometry.type)}function to(n){return n.type==="Feature"?n.geometry:n}var RX=$e($d(),1);var kX=$e(WC(),1);function ki(n,t,e){if(e===void 0&&(e={}),!n)throw new Error("point is required");if(!t)throw new Error("polygon is required");var o=Qi(n),s=to(t),c=s.type,p=t.bbox,h=s.coordinates;if(p&&qX(o,p)===!1)return!1;c==="Polygon"&&(h=[h]);for(var g=!1,m=0;m<h.length&&!g;m++)if(XC(o,h[m][0],e.ignoreBoundary)){for(var _=!1,w=1;w<h[m].length&&!_;)XC(o,h[m][w],!e.ignoreBoundary)&&(_=!0),w++;_||(g=!0)}return g}function XC(n,t,e){var o=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var s=0,c=t.length-1;s<t.length;c=s++){var p=t[s][0],h=t[s][1],g=t[c][0],m=t[c][1],_=n[1]*(p-g)+h*(g-n[0])+m*(n[0]-p)===0&&(p-n[0])*(g-n[0])<=0&&(h-n[1])*(m-n[1])<=0;if(_)return!e;var w=h>n[1]!=m>n[1]&&n[0]<(g-p)*(n[1]-h)/(m-h)+p;w&&(o=!o)}return o}function qX(n,t){return t[0]<=n[0]&&t[1]<=n[1]&&t[2]>=n[0]&&t[3]>=n[1]}var ZC=new ArrayBuffer(16),Pnt=new Float64Array(ZC),Int=new Uint32Array(ZC);var r7=$e(n_(),1);var nit=function(){function n(t){this.points=t.points||[],this.duration=t.duration||1e4,this.sharpness=t.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=t.stepLength||60,this.length=this.points.length,this.delay=0;for(var e=0;e<this.length;e++)this.points[e].z=this.points[e].z||0;for(var e=0;e<this.length-1;e++){var o=this.points[e],s=this.points[e+1];this.centers.push({x:(o.x+s.x)/2,y:(o.y+s.y)/2,z:(o.z+s.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var e=0;e<this.centers.length-1;e++){var c=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,p=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,h=this.points[e+1].z-(this.centers[e].y+this.centers[e+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e].x+c),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+p),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+h)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+c),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+p),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+h)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}return n.prototype.cacheSteps=function(t){var e=[],o=this.pos(0);e.push(0);for(var s=0;s<this.duration;s+=10){var c=this.pos(s),p=Math.sqrt((c.x-o.x)*(c.x-o.x)+(c.y-o.y)*(c.y-o.y)+(c.z-o.z)*(c.z-o.z));p>t&&(e.push(s),o=c)}return e},n.prototype.vector=function(t){var e=this.pos(t+10),o=this.pos(t-10);return{angle:180*Math.atan2(e.y-o.y,e.x-o.x)/3.14,speed:Math.sqrt((o.x-e.x)*(o.x-e.x)+(o.y-e.y)*(o.y-e.y)+(o.z-e.z)*(o.z-e.z))}},n.prototype.pos=function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var o=e/this.duration;if(o>=1)return this.points[this.length-1];var s=Math.floor((this.points.length-1)*o),c=(this.length-1)*o-s;return i7(c,this.points[s],this.controls[s][1],this.controls[s+1][0],this.points[s+1])},n}();function i7(n,t,e,o,s){var c=o7(n),p={x:s.x*c[0]+o.x*c[1]+e.x*c[2]+t.x*c[3],y:s.y*c[0]+o.y*c[1]+e.y*c[2]+t.y*c[3],z:s.z*c[0]+o.z*c[1]+e.z*c[2]+t.z*c[3]};return p}function o7(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 hh(n,t){t===void 0&&(t={});var e=Number(n[0]),o=Number(n[1]),s=Number(n[2]),c=Number(n[3]);if(n.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var p=[e,o],h=[e,c],g=[s,c],m=[s,o];return Dr([[p,m,g,h,p]],t.properties,{bbox:n,id:t.id})}function s7(n){return hh(Ao(n))}var r_=s7;var S7=$e(sP(),1);var K7=$e(fg(),1);var j7=$e($d(),1);var eY=$e(n_(),1);var MP=Math.PI/180,bP=180/Math.PI,_h=function(n,t){this.lon=n,this.lat=t,this.x=MP*n,this.y=MP*t};_h.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)};_h.prototype.antipode=function(){var n=-1*this.lat,t=this.lon<0?180+this.lon:(180-this.lon)*-1;return new _h(t,n)};var AP=function(){this.coords=[],this.length=0};AP.prototype.move_to=function(n){this.length++,this.coords.push(n)};var S_=function(n){this.properties=n||{},this.geometries=[]};S_.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}};S_.prototype.wkt=function(){for(var n="",t="LINESTRING(",e=function(c){t+=c[0]+" "+c[1]+","},o=0;o<this.geometries.length;o++){if(this.geometries[o].coords.length===0)return"LINESTRING(empty)";var s=this.geometries[o].coords;s.forEach(e),n+=t.substring(0,t.length-1)+")"}return n};var TP=function(n,t,e){if(!n||n.x===void 0||n.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!t||t.x===void 0||t.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new _h(n.x,n.y),this.end=new _h(t.x,t.y),this.properties=e||{};var o=this.start.x-this.end.x,s=this.start.y-this.end.y,c=Math.pow(Math.sin(s/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(o/2),2);if(this.g=2*Math.asin(Math.sqrt(c)),this.g===Math.PI)throw new Error("it appears "+n.view()+" and "+t.view()+" are 'antipodal', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw new Error("could not calculate great circle between "+n+" and "+t)};TP.prototype.interpolate=function(n){var t=Math.sin((1-n)*this.g)/Math.sin(this.g),e=Math.sin(n*this.g)/Math.sin(this.g),o=t*Math.cos(this.start.y)*Math.cos(this.start.x)+e*Math.cos(this.end.y)*Math.cos(this.end.x),s=t*Math.cos(this.start.y)*Math.sin(this.start.x)+e*Math.cos(this.end.y)*Math.sin(this.end.x),c=t*Math.sin(this.start.y)+e*Math.sin(this.end.y),p=bP*Math.atan2(c,Math.sqrt(Math.pow(o,2)+Math.pow(s,2))),h=bP*Math.atan2(s,o);return[h,p]};TP.prototype.Arc=function(n,t){var e=[];if(!n||n<=2)e.push([this.start.lon,this.start.lat]),e.push([this.end.lon,this.end.lat]);else for(var o=1/(n-1),s=0;s<n;++s){var c=o*s,p=this.interpolate(c);e.push(p)}for(var h=!1,g=0,m=t&&t.offset?t.offset:10,_=180-m,w=-180+m,S=360-m,b=1;b<e.length;++b){var T=e[b-1][0],R=e[b][0],x=Math.abs(R-T);x>S&&(R>_&&T<w||T>_&&R<w)?h=!0:x>g&&(g=x)}var E=[];if(h&&g<m){var I=[];E.push(I);for(var C=0;C<e.length;++C){var F=parseFloat(e[C][0]);if(C>0&&Math.abs(F-e[C-1][0])>S){var V=parseFloat(e[C-1][0]),X=parseFloat(e[C-1][1]),q=parseFloat(e[C][0]),D=parseFloat(e[C][1]);if(V>-180&&V<w&&q===180&&C+1<e.length&&e[C-1][0]>-180&&e[C-1][0]<w){I.push([-180,e[C][1]]),C++,I.push([e[C][0],e[C][1]]);continue}else if(V>_&&V<180&&q===-180&&C+1<e.length&&e[C-1][0]>_&&e[C-1][0]<180){I.push([180,e[C][1]]),C++,I.push([e[C][0],e[C][1]]);continue}if(V<w&&q>_){var xt=V;V=q,q=xt;var B=X;X=D,D=B}if(V>_&&q<w&&(q+=360),V<=180&&q>=180&&V<q){var j=(180-V)/(q-V),K=j*D+(1-j)*X;I.push([e[C-1][0]>_?180:-180,K]),I=[],I.push([e[C-1][0]>_?-180:180,K]),E.push(I)}else I=[],E.push(I);I.push([F,e[C][1]])}else I.push([e[C][0],e[C][1]])}}else{var Dt=[];E.push(Dt);for(var Q=0;Q<e.length;++Q)Dt.push([e[Q][0],e[Q][1]])}for(var At=new S_(this.properties),Mt=0;Mt<E.length;++Mt){var Lt=new AP;At.geometries.push(Lt);for(var pt=E[Mt],yt=0;yt<pt.length;++yt)Lt.move_to(pt[yt])}return At};var iY=$e(fg(),1);var rZ=$e(fg(),1);var iZ=$e(J_(),1);var aZ=$e($d(),1);var ln=[],cn=[],fn=[],hn=[],pn=[],dn=[],gn=[],mn=[],yn=[],vn=[],_n=[],xn=[],En=[],wn=[],Sn=[],Mn=[],bn=[],An=[],Tn=[],Cn=[],Pn=[],In=[],Rn=[],Ln=[];gn[85]=vn[85]=-1;mn[85]=_n[85]=0;yn[85]=xn[85]=1;Tn[85]=In[85]=1;Cn[85]=Rn[85]=0;Pn[85]=Ln[85]=1;ln[85]=hn[85]=0;cn[85]=pn[85]=-1;fn[85]=Sn[85]=0;Mn[85]=En[85]=0;bn[85]=wn[85]=1;dn[85]=An[85]=1;In[1]=In[169]=0;Rn[1]=Rn[169]=-1;Ln[1]=Ln[169]=0;En[1]=En[169]=-1;wn[1]=wn[169]=0;Sn[1]=Sn[169]=0;vn[4]=vn[166]=0;_n[4]=_n[166]=-1;xn[4]=xn[166]=1;Mn[4]=Mn[166]=1;bn[4]=bn[166]=0;An[4]=An[166]=0;gn[16]=gn[154]=0;mn[16]=mn[154]=1;yn[16]=yn[154]=1;hn[16]=hn[154]=1;pn[16]=pn[154]=0;dn[16]=dn[154]=1;Tn[64]=Tn[106]=0;Cn[64]=Cn[106]=1;Pn[64]=Pn[106]=0;ln[64]=ln[106]=-1;cn[64]=cn[106]=0;fn[64]=fn[106]=1;Tn[2]=Tn[168]=0;Cn[2]=Cn[168]=-1;Pn[2]=Pn[168]=1;In[2]=In[168]=0;Rn[2]=Rn[168]=-1;Ln[2]=Ln[168]=0;En[2]=En[168]=-1;wn[2]=wn[168]=0;Sn[2]=Sn[168]=0;Mn[2]=Mn[168]=-1;bn[2]=bn[168]=0;An[2]=An[168]=1;gn[8]=gn[162]=0;mn[8]=mn[162]=-1;yn[8]=yn[162]=0;vn[8]=vn[162]=0;_n[8]=_n[162]=-1;xn[8]=xn[162]=1;En[8]=En[162]=1;wn[8]=wn[162]=0;Sn[8]=Sn[162]=1;Mn[8]=Mn[162]=1;bn[8]=bn[162]=0;An[8]=An[162]=0;gn[32]=gn[138]=0;mn[32]=mn[138]=1;yn[32]=yn[138]=1;vn[32]=vn[138]=0;_n[32]=_n[138]=1;xn[32]=xn[138]=0;ln[32]=ln[138]=1;cn[32]=cn[138]=0;fn[32]=fn[138]=0;hn[32]=hn[138]=1;pn[32]=pn[138]=0;dn[32]=dn[138]=1;In[128]=In[42]=0;Rn[128]=Rn[42]=1;Ln[128]=Ln[42]=1;Tn[128]=Tn[42]=0;Cn[128]=Cn[42]=1;Pn[128]=Pn[42]=0;ln[128]=ln[42]=-1;cn[128]=cn[42]=0;fn[128]=fn[42]=1;hn[128]=hn[42]=-1;pn[128]=pn[42]=0;dn[128]=dn[42]=0;vn[5]=vn[165]=-1;_n[5]=_n[165]=0;xn[5]=xn[165]=0;In[5]=In[165]=1;Rn[5]=Rn[165]=0;Ln[5]=Ln[165]=0;Mn[20]=Mn[150]=0;bn[20]=bn[150]=1;An[20]=An[150]=1;hn[20]=hn[150]=0;pn[20]=pn[150]=-1;dn[20]=dn[150]=1;gn[80]=gn[90]=-1;mn[80]=mn[90]=0;yn[80]=yn[90]=1;Tn[80]=Tn[90]=1;Cn[80]=Cn[90]=0;Pn[80]=Pn[90]=1;En[65]=En[105]=0;wn[65]=wn[105]=1;Sn[65]=Sn[105]=0;ln[65]=ln[105]=0;cn[65]=cn[105]=-1;fn[65]=fn[105]=0;gn[160]=gn[10]=-1;mn[160]=mn[10]=0;yn[160]=yn[10]=1;vn[160]=vn[10]=-1;_n[160]=_n[10]=0;xn[160]=xn[10]=0;In[160]=In[10]=1;Rn[160]=Rn[10]=0;Ln[160]=Ln[10]=0;Tn[160]=Tn[10]=1;Cn[160]=Cn[10]=0;Pn[160]=Pn[10]=1;Mn[130]=Mn[40]=0;bn[130]=bn[40]=1;An[130]=An[40]=1;En[130]=En[40]=0;wn[130]=wn[40]=1;Sn[130]=Sn[40]=0;ln[130]=ln[40]=0;cn[130]=cn[40]=-1;fn[130]=fn[40]=0;hn[130]=hn[40]=0;pn[130]=pn[40]=-1;dn[130]=dn[40]=1;vn[37]=vn[133]=0;_n[37]=_n[133]=1;xn[37]=xn[133]=1;In[37]=In[133]=0;Rn[37]=Rn[133]=1;Ln[37]=Ln[133]=0;ln[37]=ln[133]=-1;cn[37]=cn[133]=0;fn[37]=fn[133]=0;hn[37]=hn[133]=1;pn[37]=pn[133]=0;dn[37]=dn[133]=0;Mn[148]=Mn[22]=-1;bn[148]=bn[22]=0;An[148]=An[22]=0;In[148]=In[22]=0;Rn[148]=Rn[22]=-1;Ln[148]=Ln[22]=1;Tn[148]=Tn[22]=0;Cn[148]=Cn[22]=1;Pn[148]=Pn[22]=1;hn[148]=hn[22]=-1;pn[148]=pn[22]=0;dn[148]=dn[22]=1;gn[82]=gn[88]=0;mn[82]=mn[88]=-1;yn[82]=yn[88]=1;Mn[82]=Mn[88]=1;bn[82]=bn[88]=0;An[82]=An[88]=1;En[82]=En[88]=-1;wn[82]=wn[88]=0;Sn[82]=Sn[88]=1;Tn[82]=Tn[88]=0;Cn[82]=Cn[88]=-1;Pn[82]=Pn[88]=0;gn[73]=gn[97]=0;mn[73]=mn[97]=1;yn[73]=yn[97]=0;vn[73]=vn[97]=0;_n[73]=_n[97]=-1;xn[73]=xn[97]=0;En[73]=En[97]=1;wn[73]=wn[97]=0;Sn[73]=Sn[97]=0;ln[73]=ln[97]=1;cn[73]=cn[97]=0;fn[73]=fn[97]=1;gn[145]=gn[25]=0;mn[145]=mn[25]=-1;yn[145]=yn[25]=0;En[145]=En[25]=1;wn[145]=wn[25]=0;Sn[145]=Sn[25]=1;In[145]=In[25]=0;Rn[145]=Rn[25]=1;Ln[145]=Ln[25]=1;hn[145]=hn[25]=-1;pn[145]=pn[25]=0;dn[145]=dn[25]=0;vn[70]=vn[100]=0;_n[70]=_n[100]=1;xn[70]=xn[100]=0;Mn[70]=Mn[100]=-1;bn[70]=bn[100]=0;An[70]=An[100]=1;Tn[70]=Tn[100]=0;Cn[70]=Cn[100]=-1;Pn[70]=Pn[100]=1;ln[70]=ln[100]=1;cn[70]=cn[100]=0;fn[70]=fn[100]=0;vn[101]=vn[69]=0;_n[101]=_n[69]=1;xn[101]=xn[69]=0;ln[101]=ln[69]=1;cn[101]=cn[69]=0;fn[101]=fn[69]=0;In[149]=In[21]=0;Rn[149]=Rn[21]=1;Ln[149]=Ln[21]=1;hn[149]=hn[21]=-1;pn[149]=pn[21]=0;dn[149]=dn[21]=0;Mn[86]=Mn[84]=-1;bn[86]=bn[84]=0;An[86]=An[84]=1;Tn[86]=Tn[84]=0;Cn[86]=Cn[84]=-1;Pn[86]=Pn[84]=1;gn[89]=gn[81]=0;mn[89]=mn[81]=-1;yn[89]=yn[81]=0;En[89]=En[81]=1;wn[89]=wn[81]=0;Sn[89]=Sn[81]=1;gn[96]=gn[74]=0;mn[96]=mn[74]=1;yn[96]=yn[74]=0;vn[96]=vn[74]=-1;_n[96]=_n[74]=0;xn[96]=xn[74]=1;Tn[96]=Tn[74]=1;Cn[96]=Cn[74]=0;Pn[96]=Pn[74]=0;ln[96]=ln[74]=1;cn[96]=cn[74]=0;fn[96]=fn[74]=1;gn[24]=gn[146]=0;mn[24]=mn[146]=-1;yn[24]=yn[146]=1;Mn[24]=Mn[146]=1;bn[24]=bn[146]=0;An[24]=An[146]=1;En[24]=En[146]=0;wn[24]=wn[146]=1;Sn[24]=Sn[146]=1;hn[24]=hn[146]=0;pn[24]=pn[146]=-1;dn[24]=dn[146]=0;vn[6]=vn[164]=-1;_n[6]=_n[164]=0;xn[6]=xn[164]=1;Mn[6]=Mn[164]=-1;bn[6]=bn[164]=0;An[6]=An[164]=0;In[6]=In[164]=0;Rn[6]=Rn[164]=-1;Ln[6]=Ln[164]=1;Tn[6]=Tn[164]=1;Cn[6]=Cn[164]=0;Pn[6]=Pn[164]=0;En[129]=En[41]=0;wn[129]=wn[41]=1;Sn[129]=Sn[41]=1;In[129]=In[41]=0;Rn[129]=Rn[41]=1;Ln[129]=Ln[41]=0;ln[129]=ln[41]=-1;cn[129]=cn[41]=0;fn[129]=fn[41]=0;hn[129]=hn[41]=0;pn[129]=pn[41]=-1;dn[129]=dn[41]=0;Mn[66]=Mn[104]=0;bn[66]=bn[104]=1;An[66]=An[104]=0;En[66]=En[104]=-1;wn[66]=wn[104]=0;Sn[66]=Sn[104]=1;Tn[66]=Tn[104]=0;Cn[66]=Cn[104]=-1;Pn[66]=Pn[104]=0;ln[66]=ln[104]=0;cn[66]=cn[104]=-1;fn[66]=fn[104]=1;gn[144]=gn[26]=-1;mn[144]=mn[26]=0;yn[144]=yn[26]=0;In[144]=In[26]=1;Rn[144]=Rn[26]=0;Ln[144]=Ln[26]=1;Tn[144]=Tn[26]=0;Cn[144]=Cn[26]=1;Pn[144]=Pn[26]=1;hn[144]=hn[26]=-1;pn[144]=pn[26]=0;dn[144]=dn[26]=1;vn[36]=vn[134]=0;_n[36]=_n[134]=1;xn[36]=xn[134]=1;Mn[36]=Mn[134]=0;bn[36]=bn[134]=1;An[36]=An[134]=0;ln[36]=ln[134]=0;cn[36]=cn[134]=-1;fn[36]=fn[134]=1;hn[36]=hn[134]=1;pn[36]=pn[134]=0;dn[36]=dn[134]=0;gn[9]=gn[161]=-1;mn[9]=mn[161]=0;yn[9]=yn[161]=0;vn[9]=vn[161]=0;_n[9]=_n[161]=-1;xn[9]=xn[161]=0;En[9]=En[161]=1;wn[9]=wn[161]=0;Sn[9]=Sn[161]=0;In[9]=In[161]=1;Rn[9]=Rn[161]=0;Ln[9]=Ln[161]=1;gn[136]=0;mn[136]=1;yn[136]=1;vn[136]=0;_n[136]=1;xn[136]=0;Mn[136]=-1;bn[136]=0;An[136]=1;En[136]=-1;wn[136]=0;Sn[136]=0;In[136]=0;Rn[136]=-1;Ln[136]=0;Tn[136]=0;Cn[136]=-1;Pn[136]=1;ln[136]=1;cn[136]=0;fn[136]=0;hn[136]=1;pn[136]=0;dn[136]=1;gn[34]=0;mn[34]=-1;yn[34]=0;vn[34]=0;_n[34]=-1;xn[34]=1;Mn[34]=1;bn[34]=0;An[34]=0;En[34]=1;wn[34]=0;Sn[34]=1;In[34]=0;Rn[34]=1;Ln[34]=1;Tn[34]=0;Cn[34]=1;Pn[34]=0;ln[34]=-1;cn[34]=0;fn[34]=1;hn[34]=-1;pn[34]=0;dn[34]=0;gn[35]=0;mn[35]=1;yn[35]=1;vn[35]=0;_n[35]=-1;xn[35]=1;Mn[35]=1;bn[35]=0;An[35]=0;En[35]=-1;wn[35]=0;Sn[35]=0;In[35]=0;Rn[35]=-1;Ln[35]=0;Tn[35]=0;Cn[35]=1;Pn[35]=0;ln[35]=-1;cn[35]=0;fn[35]=1;hn[35]=1;pn[35]=0;dn[35]=1;gn[153]=0;mn[153]=1;yn[153]=1;En[153]=-1;wn[153]=0;Sn[153]=0;In[153]=0;Rn[153]=-1;Ln[153]=0;hn[153]=1;pn[153]=0;dn[153]=1;vn[102]=0;_n[102]=-1;xn[102]=1;Mn[102]=1;bn[102]=0;An[102]=0;Tn[102]=0;Cn[102]=1;Pn[102]=0;ln[102]=-1;cn[102]=0;fn[102]=1;gn[155]=0;mn[155]=-1;yn[155]=0;En[155]=1;wn[155]=0;Sn[155]=1;In[155]=0;Rn[155]=1;Ln[155]=1;hn[155]=-1;pn[155]=0;dn[155]=0;vn[103]=0;_n[103]=1;xn[103]=0;Mn[103]=-1;bn[103]=0;An[103]=1;Tn[103]=0;Cn[103]=-1;Pn[103]=1;ln[103]=1;cn[103]=0;fn[103]=0;gn[152]=0;mn[152]=1;yn[152]=1;Mn[152]=-1;bn[152]=0;An[152]=1;En[152]=-1;wn[152]=0;Sn[152]=0;In[152]=0;Rn[152]=-1;Ln[152]=0;Tn[152]=0;Cn[152]=-1;Pn[152]=1;hn[152]=1;pn[152]=0;dn[152]=1;gn[156]=0;mn[156]=-1;yn[156]=1;Mn[156]=1;bn[156]=0;An[156]=1;En[156]=-1;wn[156]=0;Sn[156]=0;In[156]=0;Rn[156]=-1;Ln[156]=0;Tn[156]=0;Cn[156]=1;Pn[156]=1;hn[156]=-1;pn[156]=0;dn[156]=1;gn[137]=0;mn[137]=1;yn[137]=1;vn[137]=0;_n[137]=1;xn[137]=0;En[137]=-1;wn[137]=0;Sn[137]=0;In[137]=0;Rn[137]=-1;Ln[137]=0;ln[137]=1;cn[137]=0;fn[137]=0;hn[137]=1;pn[137]=0;dn[137]=1;gn[139]=0;mn[139]=1;yn[139]=1;vn[139]=0;_n[139]=-1;xn[139]=0;En[139]=1;wn[139]=0;Sn[139]=0;In[139]=0;Rn[139]=1;Ln[139]=0;ln[139]=-1;cn[139]=0;fn[139]=0;hn[139]=1;pn[139]=0;dn[139]=1;gn[98]=0;mn[98]=-1;yn[98]=0;vn[98]=0;_n[98]=-1;xn[98]=1;Mn[98]=1;bn[98]=0;An[98]=0;En[98]=1;wn[98]=0;Sn[98]=1;Tn[98]=0;Cn[98]=1;Pn[98]=0;ln[98]=-1;cn[98]=0;fn[98]=1;gn[99]=0;mn[99]=1;yn[99]=0;vn[99]=0;_n[99]=-1;xn[99]=1;Mn[99]=1;bn[99]=0;An[99]=0;En[99]=-1;wn[99]=0;Sn[99]=1;Tn[99]=0;Cn[99]=-1;Pn[99]=0;ln[99]=1;cn[99]=0;fn[99]=1;vn[38]=0;_n[38]=-1;xn[38]=1;Mn[38]=1;bn[38]=0;An[38]=0;In[38]=0;Rn[38]=1;Ln[38]=1;Tn[38]=0;Cn[38]=1;Pn[38]=0;ln[38]=-1;cn[38]=0;fn[38]=1;hn[38]=-1;pn[38]=0;dn[38]=0;vn[39]=0;_n[39]=1;xn[39]=1;Mn[39]=-1;bn[39]=0;An[39]=0;In[39]=0;Rn[39]=-1;Ln[39]=1;Tn[39]=0;Cn[39]=1;Pn[39]=0;ln[39]=-1;cn[39]=0;fn[39]=1;hn[39]=1;pn[39]=0;dn[39]=0;var j_=function(n){return[[n.bottomleft,0],[0,0],[0,n.leftbottom]]},Q_=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0]]},t1=function(n){return[[n.topright,1],[1,1],[1,n.righttop]]},e1=function(n){return[[0,n.lefttop],[0,1],[n.topleft,1]]},n1=function(n){return[[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop]]},r1=function(n){return[[n.bottomright,0],[n.bottomleft,0],[1,n.righttop],[1,n.rightbottom]]},i1=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.topleft,1],[n.topright,1]]},o1=function(n){return[[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},uZ=function(n){return[[0,0],[0,n.leftbottom],[1,n.rightbottom],[1,0]]},lZ=function(n){return[[1,0],[n.bottomright,0],[n.topright,1],[1,1]]},cZ=function(n){return[[1,1],[1,n.righttop],[0,n.lefttop],[0,1]]},fZ=function(n){return[[n.bottomleft,0],[0,0],[0,1],[n.topleft,1]]},hZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[0,n.leftbottom],[0,n.lefttop]]},pZ=function(n){return[[n.topleft,1],[n.topright,1],[n.bottomright,0],[n.bottomleft,0]]},dZ=function(){return[[0,0],[0,1],[1,1],[1,0]]},gZ=function(n){return[[1,n.rightbottom],[1,0],[0,0],[0,1],[n.topleft,1]]},mZ=function(n){return[[n.topright,1],[1,1],[1,0],[0,0],[0,n.leftbottom]]},yZ=function(n){return[[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[1,1]]},vZ=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,1]]},_Z=function(n){return[[1,n.righttop],[1,n.rightbottom],[0,n.lefttop],[0,1],[n.topleft,1]]},xZ=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[n.topright,1]]},EZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop]]},wZ=function(n){return[[n.topright,1],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topleft,1]]},SZ=function(n){return[[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1],[n.topleft,1]]},MZ=function(n){return[[1,1],[1,n.righttop],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},bZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[n.topleft,1],[n.topright,1]]},AZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,n.leftbottom]]},TZ=function(n){return[[1,n.rightbottom],[1,0],[0,0],[0,n.leftbottom],[n.topleft,1],[n.topright,1]]},CZ=function(n){return[[1,1],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},PZ=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1]]},IZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,1],[n.topleft,1]]},RZ=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topright,1]]},LZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[n.topleft,1]]},NZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},OZ=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topright,1]]},DZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[n.topleft,1]]},FZ=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},UZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topleft,1],[n.topright,1]]},BZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1],[n.topleft,1]]},zZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},Bn=[],zn=[],Gn=[],kn=[],qn=[],Hn=[],Vn=[],Wn=[];kn[1]=qn[1]=18;kn[169]=qn[169]=18;Gn[4]=zn[4]=12;Gn[166]=zn[166]=12;Bn[16]=Wn[16]=4;Bn[154]=Wn[154]=4;Hn[64]=Vn[64]=22;Hn[106]=Vn[106]=22;Gn[2]=Hn[2]=17;kn[2]=qn[2]=18;Gn[168]=Hn[168]=17;kn[168]=qn[168]=18;Bn[8]=kn[8]=9;zn[8]=Gn[8]=12;Bn[162]=kn[162]=9;zn[162]=Gn[162]=12;Bn[32]=Wn[32]=4;zn[32]=Vn[32]=1;Bn[138]=Wn[138]=4;zn[138]=Vn[138]=1;qn[128]=Wn[128]=21;Hn[128]=Vn[128]=22;qn[42]=Wn[42]=21;Hn[42]=Vn[42]=22;zn[5]=qn[5]=14;zn[165]=qn[165]=14;Gn[20]=Wn[20]=6;Gn[150]=Wn[150]=6;Bn[80]=Hn[80]=11;Bn[90]=Hn[90]=11;kn[65]=Vn[65]=3;kn[105]=Vn[105]=3;Bn[160]=Hn[160]=11;zn[160]=qn[160]=14;Bn[10]=Hn[10]=11;zn[10]=qn[10]=14;Gn[130]=Wn[130]=6;kn[130]=Vn[130]=3;Gn[40]=Wn[40]=6;kn[40]=Vn[40]=3;zn[101]=Vn[101]=1;zn[69]=Vn[69]=1;qn[149]=Wn[149]=21;qn[21]=Wn[21]=21;Gn[86]=Hn[86]=17;Gn[84]=Hn[84]=17;Bn[89]=kn[89]=9;Bn[81]=kn[81]=9;Bn[96]=Vn[96]=0;zn[96]=Hn[96]=15;Bn[74]=Vn[74]=0;zn[74]=Hn[74]=15;Bn[24]=Gn[24]=8;kn[24]=Wn[24]=7;Bn[146]=Gn[146]=8;kn[146]=Wn[146]=7;zn[6]=Hn[6]=15;Gn[6]=qn[6]=16;zn[164]=Hn[164]=15;Gn[164]=qn[164]=16;kn[129]=Wn[129]=7;qn[129]=Vn[129]=20;kn[41]=Wn[41]=7;qn[41]=Vn[41]=20;Gn[66]=Vn[66]=2;kn[66]=Hn[66]=19;Gn[104]=Vn[104]=2;kn[104]=Hn[104]=19;Bn[144]=qn[144]=10;Hn[144]=Wn[144]=23;Bn[26]=qn[26]=10;Hn[26]=Wn[26]=23;zn[36]=Wn[36]=5;Gn[36]=Vn[36]=2;zn[134]=Wn[134]=5;Gn[134]=Vn[134]=2;Bn[9]=qn[9]=10;zn[9]=kn[9]=13;Bn[161]=qn[161]=10;zn[161]=kn[161]=13;zn[37]=Wn[37]=5;qn[37]=Vn[37]=20;zn[133]=Wn[133]=5;qn[133]=Vn[133]=20;Gn[148]=qn[148]=16;Hn[148]=Wn[148]=23;Gn[22]=qn[22]=16;Hn[22]=Wn[22]=23;Bn[82]=Gn[82]=8;kn[82]=Hn[82]=19;Bn[88]=Gn[88]=8;kn[88]=Hn[88]=19;Bn[73]=Vn[73]=0;zn[73]=kn[73]=13;Bn[97]=Vn[97]=0;zn[97]=kn[97]=13;Bn[145]=kn[145]=9;qn[145]=Wn[145]=21;Bn[25]=kn[25]=9;qn[25]=Wn[25]=21;zn[70]=Vn[70]=1;Gn[70]=Hn[70]=17;zn[100]=Vn[100]=1;Gn[100]=Hn[100]=17;Bn[34]=kn[34]=9;zn[34]=Gn[34]=12;qn[34]=Wn[34]=21;Hn[34]=Vn[34]=22;Bn[136]=Wn[136]=4;zn[136]=Vn[136]=1;Gn[136]=Hn[136]=17;kn[136]=qn[136]=18;Bn[35]=Wn[35]=4;zn[35]=Gn[35]=12;kn[35]=qn[35]=18;Hn[35]=Vn[35]=22;Bn[153]=Wn[153]=4;kn[153]=qn[153]=18;zn[102]=Gn[102]=12;Hn[102]=Vn[102]=22;Bn[155]=kn[155]=9;qn[155]=Wn[155]=23;zn[103]=Vn[103]=1;Gn[103]=Hn[103]=17;Bn[152]=Wn[152]=4;Gn[152]=Hn[152]=17;kn[152]=qn[152]=18;Bn[156]=Gn[156]=8;kn[156]=qn[156]=18;Hn[156]=Wn[156]=23;Bn[137]=Wn[137]=4;zn[137]=Vn[137]=1;kn[137]=qn[137]=18;Bn[139]=Wn[139]=4;zn[139]=kn[139]=13;qn[139]=Vn[139]=20;Bn[98]=kn[98]=9;zn[98]=Gn[98]=12;Hn[98]=Vn[98]=22;Bn[99]=Vn[99]=0;zn[99]=Gn[99]=12;kn[99]=Hn[99]=19;zn[38]=Gn[38]=12;qn[38]=Wn[38]=21;Hn[38]=Vn[38]=22;zn[39]=Wn[39]=5;Gn[39]=qn[39]=16;Hn[39]=Vn[39]=22;var re=[];re[1]=re[169]=j_;re[4]=re[166]=Q_;re[16]=re[154]=t1;re[64]=re[106]=e1;re[168]=re[2]=n1;re[162]=re[8]=r1;re[138]=re[32]=i1;re[42]=re[128]=o1;re[5]=re[165]=uZ;re[20]=re[150]=lZ;re[80]=re[90]=cZ;re[65]=re[105]=fZ;re[160]=re[10]=hZ;re[130]=re[40]=pZ;re[85]=dZ;re[101]=re[69]=gZ;re[149]=re[21]=mZ;re[86]=re[84]=yZ;re[89]=re[81]=vZ;re[96]=re[74]=_Z;re[24]=re[146]=xZ;re[6]=re[164]=EZ;re[129]=re[41]=wZ;re[66]=re[104]=SZ;re[144]=re[26]=MZ;re[36]=re[134]=bZ;re[9]=re[161]=AZ;re[37]=re[133]=TZ;re[148]=re[22]=CZ;re[82]=re[88]=PZ;re[73]=re[97]=IZ;re[145]=re[25]=RZ;re[70]=re[100]=LZ;re[34]=function(n){return[o1(n),r1(n)]};re[35]=NZ;re[136]=function(n){return[i1(n),n1(n)]};re[153]=function(n){return[t1(n),j_(n)]};re[102]=function(n){return[Q_(n),e1(n)]};re[155]=OZ;re[103]=DZ;re[152]=function(n){return[t1(n),n1(n)]};re[156]=FZ;re[137]=function(n){return[i1(n),j_(n)]};re[139]=UZ;re[98]=function(n){return[r1(n),e1(n)]};re[99]=BZ;re[38]=function(n){return[Q_(n),o1(n)]};re[39]=zZ;function kZ(n){return(n>0)-(n<0)||+n}function cf(n,t,e){var o=t[0]-n[0],s=t[1]-n[1],c=e[0]-t[0],p=e[1]-t[1];return kZ(o*p-c*s)}function dL(n,t){var e=n.geometry.coordinates[0].map(function(p){return p[0]}),o=n.geometry.coordinates[0].map(function(p){return p[1]}),s=t.geometry.coordinates[0].map(function(p){return p[0]}),c=t.geometry.coordinates[0].map(function(p){return p[1]});return Math.max.apply(null,e)===Math.max.apply(null,s)&&Math.max.apply(null,o)===Math.max.apply(null,c)&&Math.min.apply(null,e)===Math.min.apply(null,s)&&Math.min.apply(null,o)===Math.min.apply(null,c)}function s1(n,t){return t.geometry.coordinates[0].every(function(e){return ki(Pr(e),n)})}function gL(n,t){return n[0]===t[0]&&n[1]===t[1]}var qZ=function(){function n(t){this.id=n.buildId(t),this.coordinates=t,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return n.buildId=function(t){return t.join(",")},n.prototype.removeInnerEdge=function(t){this.innerEdges=this.innerEdges.filter(function(e){return e.from.id!==t.from.id})},n.prototype.removeOuterEdge=function(t){this.outerEdges=this.outerEdges.filter(function(e){return e.to.id!==t.to.id})},n.prototype.addOuterEdge=function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1},n.prototype.sortOuterEdges=function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort(function(e,o){var s=e.to,c=o.to;if(s.coordinates[0]-t.coordinates[0]>=0&&c.coordinates[0]-t.coordinates[0]<0)return 1;if(s.coordinates[0]-t.coordinates[0]<0&&c.coordinates[0]-t.coordinates[0]>=0)return-1;if(s.coordinates[0]-t.coordinates[0]===0&&c.coordinates[0]-t.coordinates[0]===0)return s.coordinates[1]-t.coordinates[1]>=0||c.coordinates[1]-t.coordinates[1]>=0?s.coordinates[1]-c.coordinates[1]:c.coordinates[1]-s.coordinates[1];var p=cf(t.coordinates,s.coordinates,c.coordinates);if(p<0)return 1;if(p>0)return-1;var h=Math.pow(s.coordinates[0]-t.coordinates[0],2)+Math.pow(s.coordinates[1]-t.coordinates[1],2),g=Math.pow(c.coordinates[0]-t.coordinates[0],2)+Math.pow(c.coordinates[1]-t.coordinates[1],2);return h-g}),this.outerEdgesSorted=!0)},n.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},n.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},n.prototype.addInnerEdge=function(t){this.innerEdges.push(t)},n}(),a1=qZ;var HZ=function(){function n(t,e){this.from=t,this.to=e,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return n.prototype.getSymetric=function(){return this.symetric||(this.symetric=new n(this.to,this.from),this.symetric.symetric=this),this.symetric},n.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},n.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},n.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},n.prototype.toLineString=function(){return Gi([this.from.coordinates,this.to.coordinates])},n.prototype.compareTo=function(t){return cf(t.from.coordinates,t.to.coordinates,this.to.coordinates)},n}(),mL=HZ;var VZ=function(){function n(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return n.prototype.push=function(t){this.edges.push(t),this.polygon=this.envelope=void 0},n.prototype.get=function(t){return this.edges[t]},Object.defineProperty(n.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}),n.prototype.forEach=function(t){this.edges.forEach(t)},n.prototype.map=function(t){return this.edges.map(t)},n.prototype.some=function(t){return this.edges.some(t)},n.prototype.isValid=function(){return!0},n.prototype.isHole=function(){var t=this,e=this.edges.reduce(function(p,h,g){return h.from.coordinates[1]>t.edges[p].from.coordinates[1]&&(p=g),p},0),o=(e===0?this.length:e)-1,s=(e+1)%this.length,c=cf(this.edges[o].from.coordinates,this.edges[e].from.coordinates,this.edges[s].from.coordinates);return c===0?this.edges[o].from.coordinates[0]>this.edges[s].from.coordinates[0]:c>0},n.prototype.toMultiPoint=function(){return Bv(this.edges.map(function(t){return t.from.coordinates}))},n.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map(function(e){return e.from.coordinates});return t.push(this.edges[0].from.coordinates),this.polygon=Dr([t])},n.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=r_(this.toPolygon())},n.findEdgeRingContaining=function(t,e){var o=t.getEnvelope(),s,c;return e.forEach(function(p){var h=p.getEnvelope();if(c&&(s=c.getEnvelope()),!dL(h,o)&&s1(h,o)){for(var g=t.map(function(T){return T.from.coordinates}),m=void 0,_=function(T){p.some(function(R){return gL(T,R.from.coordinates)})||(m=T)},w=0,S=g;w<S.length;w++){var b=S[w];_(b)}m&&p.inside(Pr(m))&&(!c||s1(s,h))&&(c=p)}}),c},n.prototype.inside=function(t){return ki(t,this.toPolygon())},n}(),u1=VZ;function WZ(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 cct=function(){function n(){this.edges=[],this.nodes={}}return n.fromGeoJson=function(t){WZ(t);var e=new n;return ms(t,function(o){Gv(o,"LineString","Graph::fromGeoJson"),TC(o,function(s,c){if(s){var p=e.getNode(s),h=e.getNode(c);e.addEdge(p,h)}return c})}),e},n.prototype.getNode=function(t){var e=a1.buildId(t),o=this.nodes[e];return o||(o=this.nodes[e]=new a1(t)),o},n.prototype.addEdge=function(t,e){var o=new mL(t,e),s=o.getSymetric();this.edges.push(o),this.edges.push(s)},n.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map(function(e){return t.nodes[e]}).forEach(function(e){return t._removeIfDangle(e)})},n.prototype._removeIfDangle=function(t){var e=this;if(t.innerEdges.length<=1){var o=t.getOuterEdges().map(function(s){return s.to});this.removeNode(t),o.forEach(function(s){return e._removeIfDangle(s)})}},n.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))})},n.prototype._computeNextCWEdges=function(t){var e=this;typeof t=="undefined"?Object.keys(this.nodes).forEach(function(o){return e._computeNextCWEdges(e.nodes[o])}):t.getOuterEdges().forEach(function(o,s){t.getOuterEdge((s===0?t.getOuterEdges().length:s)-1).symetric.next=o})},n.prototype._computeNextCCWEdges=function(t,e){for(var o=t.getOuterEdges(),s,c,p=o.length-1;p>=0;--p){var h=o[p],g=h.symetric,m=void 0,_=void 0;h.label===e&&(m=h),g.label===e&&(_=g),!(!m||!_)&&(_&&(c=_),m&&(c&&(c.next=m,c=void 0),s||(s=m)))}c&&(c.next=s)},n.prototype._findLabeledEdgeRings=function(){var t=[],e=0;return this.edges.forEach(function(o){if(!(o.label>=0)){t.push(o);var s=o;do s.label=e,s=s.next;while(!o.isEqual(s));e++}}),t},n.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach(function(o){o.label=void 0}),this._findLabeledEdgeRings().forEach(function(o){t._findIntersectionNodes(o).forEach(function(s){t._computeNextCCWEdges(s,o.label)})});var e=[];return this.edges.forEach(function(o){o.ring||e.push(t._findEdgeRing(o))}),e},n.prototype._findIntersectionNodes=function(t){var e=[],o=t,s=function(){var c=0;o.from.getOuterEdges().forEach(function(p){p.label===t.label&&++c}),c>1&&e.push(o.from),o=o.next};do s();while(!t.isEqual(o));return e},n.prototype._findEdgeRing=function(t){var e=t,o=new u1;do o.push(e),e.ring=o,e=e.next;while(!t.isEqual(e));return o},n.prototype.removeNode=function(t){var e=this;t.getOuterEdges().forEach(function(o){return e.removeEdge(o)}),t.innerEdges.forEach(function(o){return e.removeEdge(o)}),delete this.nodes[t.id]},n.prototype.removeEdge=function(t){this.edges=this.edges.filter(function(e){return!e.isEqual(t)}),t.deleteEdge()},n}();var ZZ=$e(l1(),1);var KZ=$e(l1(),1);var jZ=$e(bL(),1);var oK=$e(DL(),1);function UL(n){for(var t=n,e=[];t.parent;)e.unshift(t),t=t.parent;return e}function aK(){return new BL(function(n){return n.f})}var p1={search:function(n,t,e,o){n.cleanDirty(),o=o||{};var s=o.heuristic||p1.heuristics.manhattan,c=o.closest||!1,p=aK(),h=t;for(t.h=s(t,e),p.push(t);p.size()>0;){var g=p.pop();if(g===e)return UL(g);g.closed=!0;for(var m=n.neighbors(g),_=0,w=m.length;_<w;++_){var S=m[_];if(!(S.closed||S.isWall())){var b=g.g+S.getCost(g),T=S.visited;(!T||b<S.g)&&(S.visited=!0,S.parent=g,S.h=S.h||s(S,e),S.g=b,S.f=S.g+S.h,n.markDirty(S),c&&(S.h<h.h||S.h===h.h&&S.g<h.g)&&(h=S),T?p.rescoreElement(S):p.push(S))}}}return c?UL(h):[]},heuristics:{manhattan:function(n,t){var e=Math.abs(t.x-n.x),o=Math.abs(t.y-n.y);return e+o},diagonal:function(n,t){var e=1,o=Math.sqrt(2),s=Math.abs(t.x-n.x),c=Math.abs(t.y-n.y);return e*(s+c)+(o-2*e)*Math.min(s,c)}},cleanNode:function(n){n.f=0,n.g=0,n.h=0,n.visited=!1,n.closed=!1,n.parent=null}};function Ch(n,t){t=t||{},this.nodes=[],this.diagonal=!!t.diagonal,this.grid=[];for(var e=0;e<n.length;e++){this.grid[e]=[];for(var o=0,s=n[e];o<s.length;o++){var c=new Bg(e,o,s[o]);this.grid[e][o]=c,this.nodes.push(c)}}this.init()}Ch.prototype.init=function(){this.dirtyNodes=[];for(var n=0;n<this.nodes.length;n++)p1.cleanNode(this.nodes[n])};Ch.prototype.cleanDirty=function(){for(var n=0;n<this.dirtyNodes.length;n++)p1.cleanNode(this.dirtyNodes[n]);this.dirtyNodes=[]};Ch.prototype.markDirty=function(n){this.dirtyNodes.push(n)};Ch.prototype.neighbors=function(n){var t=[],e=n.x,o=n.y,s=this.grid;return s[e-1]&&s[e-1][o]&&t.push(s[e-1][o]),s[e+1]&&s[e+1][o]&&t.push(s[e+1][o]),s[e]&&s[e][o-1]&&t.push(s[e][o-1]),s[e]&&s[e][o+1]&&t.push(s[e][o+1]),this.diagonal&&(s[e-1]&&s[e-1][o-1]&&t.push(s[e-1][o-1]),s[e+1]&&s[e+1][o-1]&&t.push(s[e+1][o-1]),s[e-1]&&s[e-1][o+1]&&t.push(s[e-1][o+1]),s[e+1]&&s[e+1][o+1]&&t.push(s[e+1][o+1])),t};Ch.prototype.toString=function(){for(var n=[],t=this.grid,e,o,s,c,p=0,h=t.length;p<h;p++){for(e=[],o=t[p],s=0,c=o.length;s<c;s++)e.push(o[s].weight);n.push(e.join(" "))}return n.join(`
|
|
3825
|
-
`)};function Bg(n,t,e){this.x=n,this.y=t,this.weight=e}Bg.prototype.toString=function(){return"["+this.x+" "+this.y+"]"};Bg.prototype.getCost=function(n){return n&&n.x!==this.x&&n.y!==this.y?this.weight*1.41421:this.weight};Bg.prototype.isWall=function(){return this.weight===0};function BL(n){this.content=[],this.scoreFunction=n}BL.prototype={push:function(n){this.content.push(n),this.sinkDown(this.content.length-1)},pop:function(){var n=this.content[0],t=this.content.pop();return this.content.length>0&&(this.content[0]=t,this.bubbleUp(0)),n},remove:function(n){var t=this.content.indexOf(n),e=this.content.pop();t!==this.content.length-1&&(this.content[t]=e,this.scoreFunction(e)<this.scoreFunction(n)?this.sinkDown(t):this.bubbleUp(t))},size:function(){return this.content.length},rescoreElement:function(n){this.sinkDown(this.content.indexOf(n))},sinkDown:function(n){for(var t=this.content[n];n>0;){var e=(n+1>>1)-1,o=this.content[e];if(this.scoreFunction(t)<this.scoreFunction(o))this.content[e]=t,this.content[n]=o,n=e;else break}},bubbleUp:function(n){for(var t=this.content.length,e=this.content[n],o=this.scoreFunction(e);;){var s=n+1<<1,c=s-1,p=null,h;if(c<t){var g=this.content[c];h=this.scoreFunction(g),h<o&&(p=c)}if(s<t){var m=this.content[s],_=this.scoreFunction(m);_<(p===null?o:h)&&(p=s)}if(p!==null)this.content[n]=this.content[p],this.content[p]=e,n=p;else break}}};function d1(){this._=null}function hf(n){n.U=n.C=n.L=n.R=n.P=n.N=null}d1.prototype={constructor:d1,insert:function(n,t){var e,o,s;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=zL(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)o=e.U,e===o.L?(s=o.R,s&&s.C?(e.C=s.C=!1,o.C=!0,n=o):(n===e.R&&(Ph(this,e),n=e,e=n.U),e.C=!1,o.C=!0,Ih(this,o))):(s=o.L,s&&s.C?(e.C=s.C=!1,o.C=!0,n=o):(n===e.L&&(Ih(this,e),n=e,e=n.U),e.C=!1,o.C=!0,Ph(this,o))),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t=n.U,e,o=n.L,s=n.R,c,p;if(o?s?c=zL(s):c=o:c=s,t?t.L===n?t.L=c:t.R=c:this._=c,o&&s?(p=c.C,c.C=n.C,c.L=o,o.U=c,c!==s?(t=c.U,c.U=n.U,n=c.R,t.L=n,c.R=s,s.U=c):(c.U=t,t=c,n=c.R)):(p=n.C,n=c),n&&(n.U=t),!p){if(n&&n.C){n.C=!1;return}do{if(n===this._)break;if(n===t.L){if(e=t.R,e.C&&(e.C=!1,t.C=!0,Ph(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,Ih(this,e),e=t.R),e.C=t.C,t.C=e.R.C=!1,Ph(this,t),n=this._;break}}else if(e=t.L,e.C&&(e.C=!1,t.C=!0,Ih(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,Ph(this,e),e=t.L),e.C=t.C,t.C=e.L.C=!1,Ih(this,t),n=this._;break}e.C=!0,n=t,t=t.U}while(!n.C);n&&(n.C=!1)}}};function Ph(n,t){var e=t,o=t.R,s=e.U;s?s.L===e?s.L=o:s.R=o:n._=o,o.U=s,e.U=o,e.R=o.L,e.R&&(e.R.U=e),o.L=e}function Ih(n,t){var e=t,o=t.L,s=e.U;s?s.L===e?s.L=o:s.R=o:n._=o,o.U=s,e.U=o,e.L=o.R,e.L&&(e.L.U=e),o.R=e}function zL(n){for(;n.L;)n=n.L;return n}var g1=d1;function pf(n,t,e,o){var s=[null,null],c=Hi.push(s)-1;return s.left=n,s.right=t,e&&Rh(s,n,t,e),o&&Rh(s,t,n,o),To[n.index].halfedges.push(c),To[t.index].halfedges.push(c),s}function df(n,t,e){var o=[t,e];return o.left=n,o}function Rh(n,t,e,o){!n[0]&&!n[1]?(n[0]=o,n.left=t,n.right=e):n.left===e?n[1]=o:n[0]=o}function uK(n,t,e,o,s){var c=n[0],p=n[1],h=c[0],g=c[1],m=p[0],_=p[1],w=0,S=1,b=m-h,T=_-g,R;if(R=t-h,!(!b&&R>0)){if(R/=b,b<0){if(R<w)return;R<S&&(S=R)}else if(b>0){if(R>S)return;R>w&&(w=R)}if(R=o-h,!(!b&&R<0)){if(R/=b,b<0){if(R>S)return;R>w&&(w=R)}else if(b>0){if(R<w)return;R<S&&(S=R)}if(R=e-g,!(!T&&R>0)){if(R/=T,T<0){if(R<w)return;R<S&&(S=R)}else if(T>0){if(R>S)return;R>w&&(w=R)}if(R=s-g,!(!T&&R<0)){if(R/=T,T<0){if(R>S)return;R>w&&(w=R)}else if(T>0){if(R<w)return;R<S&&(S=R)}return!(w>0)&&!(S<1)||(w>0&&(n[0]=[h+w*b,g+w*T]),S<1&&(n[1]=[h+S*b,g+S*T])),!0}}}}}function lK(n,t,e,o,s){var c=n[1];if(c)return!0;var p=n[0],h=n.left,g=n.right,m=h[0],_=h[1],w=g[0],S=g[1],b=(m+w)/2,T=(_+S)/2,R,x;if(S===_){if(b<t||b>=o)return;if(m>w){if(!p)p=[b,e];else if(p[1]>=s)return;c=[b,s]}else{if(!p)p=[b,s];else if(p[1]<e)return;c=[b,e]}}else if(R=(m-w)/(S-_),x=T-R*b,R<-1||R>1)if(m>w){if(!p)p=[(e-x)/R,e];else if(p[1]>=s)return;c=[(s-x)/R,s]}else{if(!p)p=[(s-x)/R,s];else if(p[1]<e)return;c=[(e-x)/R,e]}else if(_<S){if(!p)p=[t,R*t+x];else if(p[0]>=o)return;c=[o,R*o+x]}else{if(!p)p=[o,R*o+x];else if(p[0]<t)return;c=[t,R*t+x]}return n[0]=p,n[1]=c,!0}function GL(n,t,e,o){for(var s=Hi.length,c;s--;)(!lK(c=Hi[s],n,t,e,o)||!uK(c,n,t,e,o)||!(Math.abs(c[0][0]-c[1][0])>Er||Math.abs(c[0][1]-c[1][1])>Er))&&delete Hi[s]}function kL(n){return To[n.index]={site:n,halfedges:[]}}function cK(n,t){var e=n.site,o=t.left,s=t.right;return e===s&&(s=o,o=e),s?Math.atan2(s[1]-o[1],s[0]-o[0]):(e===o?(o=t[1],s=t[0]):(o=t[0],s=t[1]),Math.atan2(o[0]-s[0],s[1]-o[1]))}function m1(n,t){return t[+(t.left!==n.site)]}function fK(n,t){return t[+(t.left===n.site)]}function qL(){for(var n=0,t=To.length,e,o,s,c;n<t;++n)if((e=To[n])&&(c=(o=e.halfedges).length)){var p=new Array(c),h=new Array(c);for(s=0;s<c;++s)p[s]=s,h[s]=cK(e,Hi[o[s]]);for(p.sort(function(g,m){return h[m]-h[g]}),s=0;s<c;++s)h[s]=o[p[s]];for(s=0;s<c;++s)o[s]=h[s]}}function HL(n,t,e,o){var s=To.length,c,p,h,g,m,_,w,S,b,T,R,x,E=!0;for(c=0;c<s;++c)if(p=To[c]){for(h=p.site,m=p.halfedges,g=m.length;g--;)Hi[m[g]]||m.splice(g,1);for(g=0,_=m.length;g<_;)T=fK(p,Hi[m[g]]),R=T[0],x=T[1],w=m1(p,Hi[m[++g%_]]),S=w[0],b=w[1],(Math.abs(R-S)>Er||Math.abs(x-b)>Er)&&(m.splice(g,0,Hi.push(df(h,T,Math.abs(R-n)<Er&&o-x>Er?[n,Math.abs(S-n)<Er?b:o]:Math.abs(x-o)<Er&&e-R>Er?[Math.abs(b-o)<Er?S:e,o]:Math.abs(R-e)<Er&&x-t>Er?[e,Math.abs(S-e)<Er?b:t]:Math.abs(x-t)<Er&&R-n>Er?[Math.abs(b-t)<Er?S:n,t]:null))-1),++_);_&&(E=!1)}if(E){var I,C,F,V=1/0;for(c=0,E=null;c<s;++c)(p=To[c])&&(h=p.site,I=h[0]-n,C=h[1]-t,F=I*I+C*C,F<V&&(V=F,E=p));if(E){var X=[n,t],q=[n,o],D=[e,o],xt=[e,t];E.halfedges.push(Hi.push(df(h=E.site,X,q))-1,Hi.push(df(h,q,D))-1,Hi.push(df(h,D,xt))-1,Hi.push(df(h,xt,X))-1)}}for(c=0;c<s;++c)(p=To[c])&&(p.halfedges.length||delete To[c])}var VL=[],zg;function hK(){hf(this),this.x=this.y=this.arc=this.site=this.cy=null}function Wl(n){var t=n.P,e=n.N;if(!(!t||!e)){var o=t.site,s=n.site,c=e.site;if(o!==c){var p=s[0],h=s[1],g=o[0]-p,m=o[1]-h,_=c[0]-p,w=c[1]-h,S=2*(g*w-m*_);if(!(S>=-WL)){var b=g*g+m*m,T=_*_+w*w,R=(w*b-m*T)/S,x=(g*T-_*b)/S,E=VL.pop()||new hK;E.arc=n,E.site=s,E.x=R+p,E.y=(E.cy=x+h)+Math.sqrt(R*R+x*x),n.circle=E;for(var I=null,C=gf._;C;)if(E.y<C.y||E.y===C.y&&E.x<=C.x)if(C.L)C=C.L;else{I=C.P;break}else if(C.R)C=C.R;else{I=C;break}gf.insert(I,E),I||(zg=E)}}}}function Xl(n){var t=n.circle;t&&(t.P||(zg=t.N),gf.remove(t),VL.push(t),hf(t),n.circle=null)}var YL=[];function pK(){hf(this),this.edge=this.site=this.circle=null}function XL(n){var t=YL.pop()||new pK;return t.site=n,t}function y1(n){Xl(n),Yl.remove(n),YL.push(n),hf(n)}function $L(n){var t=n.circle,e=t.x,o=t.cy,s=[e,o],c=n.P,p=n.N,h=[n];y1(n);for(var g=c;g.circle&&Math.abs(e-g.circle.x)<Er&&Math.abs(o-g.circle.cy)<Er;)c=g.P,h.unshift(g),y1(g),g=c;h.unshift(g),Xl(g);for(var m=p;m.circle&&Math.abs(e-m.circle.x)<Er&&Math.abs(o-m.circle.cy)<Er;)p=m.N,h.push(m),y1(m),m=p;h.push(m),Xl(m);var _=h.length,w;for(w=1;w<_;++w)m=h[w],g=h[w-1],Rh(m.edge,g.site,m.site,s);g=h[0],m=h[_-1],m.edge=pf(g.site,m.site,null,s),Wl(g),Wl(m)}function ZL(n){for(var t=n[0],e=n[1],o,s,c,p,h=Yl._;h;)if(c=KL(h,e)-t,c>Er)h=h.L;else if(p=t-dK(h,e),p>Er){if(!h.R){o=h;break}h=h.R}else{c>-Er?(o=h.P,s=h):p>-Er?(o=h,s=h.N):o=s=h;break}kL(n);var g=XL(n);if(Yl.insert(o,g),!(!o&&!s)){if(o===s){Xl(o),s=XL(o.site),Yl.insert(g,s),g.edge=s.edge=pf(o.site,g.site),Wl(o),Wl(s);return}if(!s){g.edge=pf(o.site,g.site);return}Xl(o),Xl(s);var m=o.site,_=m[0],w=m[1],S=n[0]-_,b=n[1]-w,T=s.site,R=T[0]-_,x=T[1]-w,E=2*(S*x-b*R),I=S*S+b*b,C=R*R+x*x,F=[(x*I-b*C)/E+_,(S*C-R*I)/E+w];Rh(s.edge,m,T,F),g.edge=pf(m,n,null,F),s.edge=pf(n,T,null,F),Wl(o),Wl(s)}}function KL(n,t){var e=n.site,o=e[0],s=e[1],c=s-t;if(!c)return o;var p=n.P;if(!p)return-1/0;e=p.site;var h=e[0],g=e[1],m=g-t;if(!m)return h;var _=h-o,w=1/c-1/m,S=_/m;return w?(-S+Math.sqrt(S*S-2*w*(_*_/(-2*m)-g+m/2+s-c/2)))/w+o:(o+h)/2}function dK(n,t){var e=n.N;if(e)return KL(e,t);var o=n.site;return o[1]===t?o[0]:1/0}var Er=1e-6,WL=1e-12,Yl,To,gf,Hi;function gK(n,t,e){return(n[0]-e[0])*(t[1]-n[1])-(n[0]-t[0])*(e[1]-n[1])}function mK(n,t){return t[1]-n[1]||t[0]-n[0]}function Gg(n,t){var e=n.sort(mK).pop(),o,s,c;for(Hi=[],To=new Array(n.length),Yl=new g1,gf=new g1;;)if(c=zg,e&&(!c||e[1]<c.y||e[1]===c.y&&e[0]<c.x))(e[0]!==o||e[1]!==s)&&(ZL(e),o=e[0],s=e[1]),e=n.pop();else if(c)$L(c.arc);else break;if(qL(),t){var p=+t[0][0],h=+t[0][1],g=+t[1][0],m=+t[1][1];GL(p,h,g,m),HL(p,h,g,m)}this.edges=Hi,this.cells=To,Yl=gf=Hi=To=null}Gg.prototype={constructor:Gg,polygons:function(){var n=this.edges;return this.cells.map(function(t){var e=t.halfedges.map(function(o){return m1(t,n[o])});return e.data=t.site.data,e})},triangles:function(){var n=[],t=this.edges;return this.cells.forEach(function(e,o){if(h=(c=e.halfedges).length)for(var s=e.site,c,p=-1,h,g,m=t[c[h-1]],_=m.left===s?m.right:m.left;++p<h;)g=_,m=t[c[p]],_=m.left===s?m.right:m.left,g&&_&&o<g.index&&o<_.index&&gK(s,g,_)<0&&n.push([s.data,g.data,_.data])}),n},links:function(){return this.edges.filter(function(n){return n.right}).map(function(n){return{source:n.left.data,target:n.right.data}})},find:function(n,t,e){for(var o=this,s,c=o._found||0,p=o.cells.length,h;!(h=o.cells[c]);)if(++c>=p)return null;var g=n-h.site[0],m=t-h.site[1],_=g*g+m*m;do h=o.cells[s=c],c=null,h.halfedges.forEach(function(w){var S=o.edges[w],b=S.left;if(!((b===h.site||!b)&&!(b=S.right))){var T=n-b[0],R=t-b[1],x=T*T+R*R;x<_&&(_=x,c=b.index)}});while(c!==null);return o._found=s,e==null||_<=e*e?h.site:null}};var MK=$e(mf(),1);var L1=$e(tN(),1);function Zo(){return new Hg}function Hg(){this.reset()}Hg.prototype={constructor:Hg,reset:function(){this.s=this.t=0},add:function(n){eN(qg,n,this.t),eN(this,qg.s,this.s),this.s?this.t+=qg.t:this.s=qg.t},valueOf:function(){return this.s}};var qg=new Hg;function eN(n,t,e){var o=n.s=t+e,s=o-t,c=o-s;n.t=t-c+(e-s)}var er=1e-6;var gr=Math.PI,Mi=gr/2,Vg=gr/4,Na=gr*2,$l=180/gr,Ko=gr/180,Zr=Math.abs,sa=Math.atan,Jo=Math.atan2,Xn=Math.cos;var Wg=Math.exp;var Lh=Math.log;var an=Math.sin;var no=Math.sqrt,Nh=Math.tan;function x1(n){return n>1?0:n<-1?gr:Math.acos(n)}function Co(n){return n>1?Mi:n<-1?-Mi:Math.asin(n)}function aa(){}var bK=Zo(),ipt=Zo();function Zl(n){var t=n[0],e=n[1],o=Xn(e);return[o*Xn(t),o*an(t),an(e)]}function Oh(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 Dh(n){var t=no(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}var dpt=Zo();function rN(n,t){return[n>gr?n-Na:n<-gr?n+Na:n,t]}rN.invert=rN;function E1(){var n=[],t;return{point:function(e,o){t.push([e,o])},lineStart:function(){n.push(t=[])},lineEnd:aa,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function w1(n,t){return Zr(n[0]-t[0])<er&&Zr(n[1]-t[1])<er}function Xg(n,t,e,o){this.x=n,this.z=t,this.o=e,this.e=o,this.v=!1,this.n=this.p=null}function S1(n,t,e,o,s){var c=[],p=[],h,g;if(n.forEach(function(T){if(!((R=T.length-1)<=0)){var R,x=T[0],E=T[R],I;if(w1(x,E)){for(s.lineStart(),h=0;h<R;++h)s.point((x=T[h])[0],x[1]);s.lineEnd();return}c.push(I=new Xg(x,T,null,!0)),p.push(I.o=new Xg(x,null,I,!1)),c.push(I=new Xg(E,T,null,!1)),p.push(I.o=new Xg(E,null,I,!0))}}),!!c.length){for(p.sort(t),iN(c),iN(p),h=0,g=p.length;h<g;++h)p[h].e=e=!e;for(var m=c[0],_,w;;){for(var S=m,b=!0;S.v;)if((S=S.n)===m)return;_=S.z,s.lineStart();do{if(S.v=S.o.v=!0,S.e){if(b)for(h=0,g=_.length;h<g;++h)s.point((w=_[h])[0],w[1]);else o(S.x,S.n.x,1,s);S=S.n}else{if(b)for(_=S.p.z,h=_.length-1;h>=0;--h)s.point((w=_[h])[0],w[1]);else o(S.x,S.p.x,-1,s);S=S.p}S=S.o,_=S.z,b=!b}while(!S.v);s.lineEnd()}}}function iN(n){if(t=n.length){for(var t,e=0,o=n[0],s;++e<t;)o.n=s=n[e],s.p=o,o=s;o.n=s=n[0],s.p=o}}function il(n,t){return n<t?-1:n>t?1:n>=t?0:NaN}function M1(n){return n.length===1&&(n=CK(n)),{left:function(t,e,o,s){for(o==null&&(o=0),s==null&&(s=t.length);o<s;){var c=o+s>>>1;n(t[c],e)<0?o=c+1:s=c}return o},right:function(t,e,o,s){for(o==null&&(o=0),s==null&&(s=t.length);o<s;){var c=o+s>>>1;n(t[c],e)>0?s=c:o=c+1}return o}}}function CK(n){return function(t,e){return il(n(t),e)}}var oN=M1(il),PK=oN.right,IK=oN.left;var sN=Array.prototype,LK=sN.slice,NK=sN.map;var sdt=Math.sqrt(50),adt=Math.sqrt(10),udt=Math.sqrt(2);function $g(n){for(var t=n.length,e,o=-1,s=0,c,p;++o<t;)s+=n[o].length;for(c=new Array(s);--t>=0;)for(p=n[t],e=p.length;--e>=0;)c[--s]=p[e];return c}var kK=1e9,Wgt=-kK;var b1=Zo();function A1(n,t){var e=t[0],o=t[1],s=[an(e),-Xn(e),0],c=0,p=0;b1.reset();for(var h=0,g=n.length;h<g;++h)if(_=(m=n[h]).length)for(var m,_,w=m[_-1],S=w[0],b=w[1]/2+Vg,T=an(b),R=Xn(b),x=0;x<_;++x,S=I,T=F,R=V,w=E){var E=m[x],I=E[0],C=E[1]/2+Vg,F=an(C),V=Xn(C),X=I-S,q=X>=0?1:-1,D=q*X,xt=D>gr,B=T*F;if(b1.add(Jo(B*q*an(D),R*V+B*Xn(D))),c+=xt?X+q*Na:X,xt^S>=e^I>=e){var j=Oh(Zl(w),Zl(E));Dh(j);var K=Oh(s,j);Dh(K);var Dt=(xt^X>=0?-1:1)*Co(K[2]);(o>Dt||o===Dt&&(j[0]||j[1]))&&(p+=xt^X>=0?1:-1)}}return(c<-er||c<er&&b1<-er)^p&1}var emt=Zo();var xmt=Zo(),Emt=Zo();var VK=1/0;var Mmt=-VK;function T1(n){this._context=n}T1.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,Na);break}}},result:aa};var Omt=Zo();function C1(){this._string=[]}C1.prototype={_radius:4.5,_circle:lN(4.5),pointRadius:function(n){return(n=+n)!==this._radius&&(this._radius=n,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(n,t){switch(this._point){case 0:{this._string.push("M",n,",",t),this._point=1;break}case 1:{this._string.push("L",n,",",t);break}default:{this._circle==null&&(this._circle=lN(this._radius)),this._string.push("M",n,",",t,this._circle);break}}},result:function(){if(this._string.length){var n=this._string.join("");return this._string=[],n}else return null}};function lN(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function P1(n,t,e,o){return function(s,c){var p=t(c),h=s.invert(o[0],o[1]),g=E1(),m=t(g),_=!1,w,S,b,T={point:R,lineStart:E,lineEnd:I,polygonStart:function(){T.point=C,T.lineStart=F,T.lineEnd=V,S=[],w=[]},polygonEnd:function(){T.point=R,T.lineStart=E,T.lineEnd=I,S=$g(S);var X=A1(w,h);S.length?(_||(c.polygonStart(),_=!0),S1(S,YK,X,e,c)):X&&(_||(c.polygonStart(),_=!0),c.lineStart(),e(null,null,1,c),c.lineEnd()),_&&(c.polygonEnd(),_=!1),S=w=null},sphere:function(){c.polygonStart(),c.lineStart(),e(null,null,1,c),c.lineEnd(),c.polygonEnd()}};function R(X,q){var D=s(X,q);n(X=D[0],q=D[1])&&c.point(X,q)}function x(X,q){var D=s(X,q);p.point(D[0],D[1])}function E(){T.point=x,p.lineStart()}function I(){T.point=R,p.lineEnd()}function C(X,q){b.push([X,q]);var D=s(X,q);m.point(D[0],D[1])}function F(){m.lineStart(),b=[]}function V(){C(b[0][0],b[0][1]),m.lineEnd();var X=m.clean(),q=g.result(),D,xt=q.length,B,j,K;if(b.pop(),w.push(b),b=null,!!xt){if(X&1){if(j=q[0],(B=j.length-1)>0){for(_||(c.polygonStart(),_=!0),c.lineStart(),D=0;D<B;++D)c.point((K=j[D])[0],K[1]);c.lineEnd()}return}xt>1&&X&2&&q.push(q.pop().concat(q.shift())),S.push(q.filter(XK))}}return T}}function XK(n){return n.length>1}function YK(n,t){return((n=n.x)[0]<0?n[1]-Mi-er:Mi-n[1])-((t=t.x)[0]<0?t[1]-Mi-er:Mi-t[1])}var $K=P1(function(){return!0},ZK,JK,[-gr,-Mi]);function ZK(n){var t=NaN,e=NaN,o=NaN,s;return{lineStart:function(){n.lineStart(),s=1},point:function(c,p){var h=c>0?gr:-gr,g=Zr(c-t);Zr(g-gr)<er?(n.point(t,e=(e+p)/2>0?Mi:-Mi),n.point(o,e),n.lineEnd(),n.lineStart(),n.point(h,e),n.point(c,e),s=0):o!==h&&g>=gr&&(Zr(t-o)<er&&(t-=o*er),Zr(c-h)<er&&(c-=h*er),e=KK(t,e,c,p),n.point(o,e),n.lineEnd(),n.lineStart(),n.point(h,e),s=0),n.point(t=c,e=p),o=h},lineEnd:function(){n.lineEnd(),t=e=NaN},clean:function(){return 2-s}}}function KK(n,t,e,o){var s,c,p=an(n-e);return Zr(p)>er?sa((an(t)*(c=Xn(o))*an(e)-an(o)*(s=Xn(t))*an(n))/(s*c*p)):(t+o)/2}function JK(n,t,e,o){var s;if(n==null)s=e*Mi,o.point(-gr,s),o.point(0,s),o.point(gr,s),o.point(gr,0),o.point(gr,-s),o.point(0,-s),o.point(-gr,-s),o.point(-gr,0),o.point(-gr,s);else if(Zr(n[0]-t[0])>er){var c=n[0]<t[0]?gr:-gr;s=e*c/2,o.point(-c,s),o.point(0,s),o.point(c,s)}else o.point(t[0],t[1])}function Zg(n){return function(t){var e=new I1;for(var o in n)e[o]=n[o];return e.stream=t,e}}function I1(){}I1.prototype={constructor:I1,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 E0t=Xn(30*Ko);var D0t=Zg({point:function(n,t){this.stream.point(n*Ko,t*Ko)}});function Kg(n){return function(t,e){var o=Xn(t),s=Xn(e),c=n(o*s);return[c*s*an(t),c*an(e)]}}function Oa(n){return function(t,e){var o=no(t*t+e*e),s=n(o),c=an(s),p=Xn(s);return[Jo(t*c,o*p),Co(o&&e*c/o)]}}var mN=Kg(function(n){return no(2/(1+n))});mN.invert=Oa(function(n){return 2*Co(n/2)});var yN=Kg(function(n){return(n=x1(n))&&n/an(n)});yN.invert=Oa(function(n){return n});function R1(n,t){return[n,Lh(Nh((Mi+t)/2))]}R1.invert=function(n,t){return[n,2*sa(Wg(t))-Mi]};function Jg(n,t){return[n,t]}Jg.invert=Jg;function vN(n,t){var e=Xn(t),o=Xn(n)*e;return[e*an(n)/o,an(t)/o]}vN.invert=Oa(sa);function _N(n,t){var e=t*t,o=e*e;return[n*(.8707-.131979*e+o*(-.013791+o*(.003971*e-.001529*o))),t*(1.007226+e*(.015085+o*(-.044475+.028874*e-.005916*o)))]}_N.invert=function(n,t){var e=t,o=25,s;do{var c=e*e,p=c*c;e-=s=(e*(1.007226+c*(.015085+p*(-.044475+.028874*c-.005916*p)))-t)/(1.007226+c*(.015085*3+p*(-.044475*7+.028874*9*c-.005916*11*p)))}while(Zr(s)>er&&--o>0);return[n/(.8707+(c=e*e)*(-.131979+c*(-.013791+c*c*c*(.003971-.001529*c)))),e]};function xN(n,t){return[Xn(t)*an(n),an(t)]}xN.invert=Oa(Co);function EN(n,t){var e=Xn(t),o=1+Xn(n)*e;return[e*an(n)/o,an(t)/o]}EN.invert=Oa(function(n){return 2*sa(n)});function wN(n,t){return[Lh(Nh((Mi+t)/2)),-n]}wN.invert=function(n,t){return[-t,2*sa(Wg(n))-Mi]};var rJ=$e(mf(),1);var iJ=$e(mf(),1);var sJ=$e(mf(),1);var aJ=$e(mf(),1);function Da(n,t){return Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2)}function MN(n){let t=0;for(let e=0;e<n.length-1;e++)t+=Da(n[e],n[e+1]);return t}function bN(n,t,e){let o=new ze(t[0]-n[0],t[1]-n[1]),s=new ze(t[0]-e[0],t[1]-e[1]),p=o.angleTo(s)*180/Math.PI,h=new ze(t[0]-n[0],t[1]-n[1]);return new ze(e[0]-n[0],e[1]-n[1]).cross(h)>0?p:-p}var Uh=$e(AN(),1);var Nn="___";function sl(n){let t=new Map;return n.forEach((e,o)=>{t.set(o,new Map(e))}),t}var jg=class{setLiftPriority(t){this.lift_priority=t}isFacilityByType(t){return["facility","escalator","straightLadder","staircase","ramp","connectionPoint"].includes(t)}initFacilities(t){this.facilities=t.map(e=>{let o=[];try{o=JSON.parse(e.entry_end_floor)}catch(c){o=[]}let s=[];try{s=JSON.parse(e.entry_start_floor)}catch(c){s=[]}return xl({},e,{entry_start_floor:s,entry_end_floor:o})})}getParkingSpaceInfo(t,e){let o=""+t+Nn+e;var s;return(s=this.parkingMap.get(o))!=null?s:null}getNodeInfo(t,e){let o=""+t+Nn+e,s=this.nodeMap.get(o);if(!(s!=null&&s.length))return null;let c=this.pointMap.get(s[0]);return c!=null?c:null}initRoute(t,e){this.clear(),this.roadInfo=t,this.initFacilities(e);let o=new Date,s=o.getHours()*60+o.getMinutes();t.length&&(t.forEach(c=>{let p=(c.points||[]).filter(h=>!(0,Uh.isNil)(h.passWeight)&&h.passWeight!==1&&!(0,Uh.isNil)(h.coverageArea)&&h.coverageArea!==0);this.weightPointMap.set(c.floor,p),(c.points||[]).filter(h=>h.openStatus!==!1).filter(h=>{if(!h.startTime||!h.endTime)return!0;let[g,m]=h.startTime.split(":").map(T=>+T),[_,w]=h.endTime.split(":").map(T=>+T),S=g*60+m,b=_*60+w;return s>=S&&s<=b}).forEach(h=>{h.floor=c.floor;let g=""+c.floor+Nn+h.id,m=""+c.floor+Nn+h.nodeId,_=this.nodeMap.get(m)||[];if(_.push(""+c.floor+Nn+(h.relatedId||h.id)),this.nodeMap.set(""+c.floor+Nn+h.nodeId,_),this.pointMap.set(g,h),this.isFacilityByType(h.type)){let w=this.facilities.find(S=>S.id===+h.targetId);if(w){switch(w.entry_infra_type){case"straightLadder":if(w.entry_end_floor.find(x=>x.floor===c.floor)&&w.entry_start_floor.find(x=>x.floor===c.floor)){let x=this.straightLadderMap.get(h.targetId)||[];x.push(xl({},h)),this.straightLadderMap.set(h.targetId,x)}break;case"staircase":if(w.entry_end_floor.find(x=>x.floor===c.floor)&&w.entry_start_floor.find(x=>x.floor===c.floor)){let x=this.staircaseMap.get(h.targetId)||[];x.push(xl({},h)),this.staircaseMap.set(h.targetId,x)}break;case"escalator":let b=this.escalatorMap.get(h.targetId)||[];if(w.entry_start_floor.find(x=>x.floor===c.floor)){let x=b.find(E=>{var I;return((I=E.end)==null?void 0:I.floor)!==c.floor&&!E.start});x?x.start=h:b.push({start:h})}if(w.entry_end_floor.find(x=>x.floor===c.floor)){let x=b.find(E=>{var I;return((I=E.start)==null?void 0:I.floor)!==c.floor&&!E.end});x?x.end=h:b.push({end:h})}this.escalatorMap.set(h.targetId,b);break;case"ramp":let T=this.rampMap.get(h.targetId)||[];if(w.entry_start_floor.find(x=>x.floor===c.floor)){let x=T.find(E=>{var I;return((I=E.end)==null?void 0:I.floor)!==c.floor&&!E.start});x?x.start=h:T.push({start:h})}if(w.entry_end_floor.find(x=>x.floor===c.floor)){let x=T.find(E=>{var I;return((I=E.start)==null?void 0:I.floor)!==c.floor&&!E.end});x?x.end=h:T.push({end:h})}this.rampMap.set(h.targetId,T);break;case"connectionPoint":let R=this.connectionPointMap.get(h.targetId)||[];if(w.entry_start_floor.find(x=>x.floor===c.floor)){let x=R.find(E=>{var I;return((I=E.end)==null?void 0:I.floor)!==c.floor&&!E.start});x?x.start=h:R.push({start:h})}if(w.entry_end_floor.find(x=>x.floor===c.floor)){let x=R.find(E=>{var I;return((I=E.start)==null?void 0:I.floor)!==c.floor&&!E.end});x?x.end=h:R.push({end:h})}this.connectionPointMap.set(h.targetId,R);break}let S=this.facilityMap.get(h.targetId)||[];S.push(xl({},h)),this.facilityMap.set(h.targetId,S)}}h.type==="parkingSpace"&&h.name.split(/[,,]/).forEach(S=>{this.parkingMap.set(""+c.floor+Nn+S,h)})}),(c.lines||[]).filter(h=>h.to!==h.from).forEach(h=>{let g=""+c.floor+Nn+h.from,m=""+c.floor+Nn+h.to,_=this.pointMap.get(g),w=this.pointMap.get(m);if(!_||!w)return;let S=_.cds,b=w.cds,T=Da(S,b);if(!_.permission&&!w.permission){switch(h.direction){case"single-people":this.addLineItem(g,m,T);break;case"back-people":this.addLineItem(m,g,T);break;default:this.addLineItem(g,m,T),this.addLineItem(m,g,T)}switch(h.direction){case"double":this.addLineItem(g,m,T,this.forwardLineMap),this.addLineItem(m,g,T,this.forwardLineMap);break;case"single":this.addLineItem(g,m,T,this.forwardLineMap);break;case"back":this.addLineItem(m,g,T,this.forwardLineMap);break}(_.type==="parkingSpace"||w.type==="parkingSpace")&&h.direction==="noDir"&&(this.addLineItem(g,m,T,this.forwardLineMap),this.addLineItem(m,g,T,this.forwardLineMap))}else _.permission&&this.setPermissionLine(g,m,_.permission,T,"",h.direction),w.permission&&w.permission!==_.permission&&this.setPermissionLine(g,m,w.permission,T,"",h.direction)})}),this.addPermissionFacility(),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute(),this.initForwardRoute())}getPermissionMap(t){return this["permission_"+t]||(this["permission_"+t]=new Set),this["permission_"+t]}setPermissionLine(t,e,o,s,c,p){this.getPermissionMap(o).add({fromKey:t,toKey:e,distance:s,type:c,direction:p})}addPermissionFacility(){this.straightLadderMap.forEach((t,e)=>{if(t.length<2){this.straightLadderMap.delete(e);return}for(let o=0;o<t.length;o++){let s=""+t[o].floor+Nn+t[o].id,c=this.pointMap.get(s);if(c){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Nn+t[p].id,g=this.pointMap.get(h);if(!g)continue;c.permission&&this.setPermissionLine(s,h,c.permission,1,"straightLadder"),g.permission&&g.permission!==c.permission&&this.setPermissionLine(s,h,g.permission,1,"straightLadder")}}}}),this.staircaseMap.forEach((t,e)=>{if(t.length<2){this.staircaseMap.delete(e);return}for(let o=0;o<t.length;o++){let s=""+t[o].floor+Nn+t[o].id,c=this.pointMap.get(s);if(c){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Nn+t[p].id,g=this.pointMap.get(h);if(!g)continue;c.permission&&this.setPermissionLine(s,h,c.permission,1,"staircase"),g.permission&&g.permission!==c.permission&&this.setPermissionLine(s,h,g.permission,1,"staircase")}}}}),this.escalatorMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Nn+o.start.id,c=""+o.end.floor+Nn+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(c);p&&h&&(p.permission&&this.setPermissionLine(s,c,p.permission,1,"escalator"),h.permission&&h.permission!==p.permission&&this.setPermissionLine(s,c,h.permission,1,"escalator"))}})}),this.rampMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Nn+o.start.id,c=""+o.end.floor+Nn+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(c);p&&h&&(p.permission&&this.setPermissionLine(s,c,p.permission,10,"ramp"),h.permission&&h.permission!==p.permission&&this.setPermissionLine(s,c,h.permission,10,"ramp"))}})}),this.connectionPointMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Nn+o.start.id,c=""+o.end.floor+Nn+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(c);p&&h&&(p.permission&&this.setPermissionLine(s,c,p.permission,1,"connectionPoint"),h.permission&&h.permission!==p.permission&&this.setPermissionLine(s,c,h.permission,1,"connectionPoint"))}})})}addPermissionLineToMap(t,e,o,s){this.getPermissionMap(t).forEach(p=>{if(e.includes(p.type))if(p.type==="")switch(p.direction){case"single":this.addLineItem(p.fromKey,p.toKey,p.distance,o);break;case"back":this.addLineItem(p.toKey,p.fromKey,p.distance,o);break;case"single-people":this.addLineItem(p.fromKey,p.toKey,p.distance,o);break;case"back-people":this.addLineItem(p.toKey,p.fromKey,p.distance,o);break;default:this.addLineItem(p.fromKey,p.toKey,p.distance,o),this.addLineItem(p.toKey,p.fromKey,p.distance,o);break}else this.addLineItem(p.fromKey,p.toKey,s.get(p.type),o)})}addLineItem(t,e,o,s){s===void 0&&(s=this.lineMap);let c=s.get(t)||new Map,p=this.pointMap.get(t),h=this.pointMap.get(e);if(!p||!h)return;let g=this.weightPointMap.get(p.floor)||[],m=this.weightPointMap.get(h.floor)||[];g.forEach(_=>{_.id===p.id&&(o=o/_.passWeight),Da(p.cds,_.cds)<=_.coverageArea&&(o=o/_.passWeight)}),m.forEach(_=>{_.id===h.id&&(o=o/_.passWeight),Da(h.cds,_.cds)<=_.coverageArea&&(o=o/_.passWeight)}),c.set(e,o),s.set(t,c)}addFacilityToLineMap(t,e,o,s){[...this.straightLadderMap,...this.staircaseMap].forEach(c=>{let[p,h]=c;if(!(h.length<2))for(let g=0;g<h.length;g++){let m=""+h[g].floor+Nn+h[g].id,_=this.pointMap.get(m);if(!(!_||_.permission)){for(let w=0;w<h.length;w++)if(g!==w){let S=""+h[w].floor+Nn+h[w].id,b=this.pointMap.get(S);if(!b||b.permission)continue;if(h[g].type==="straightLadder"){let T=e;this.addLineItem(m,S,T,s)}else{let T=o;this.addLineItem(m,S,T,s)}}}}}),this.escalatorMap.forEach((c,p)=>{c.forEach(h=>{if(h.start&&h.end){let g=""+h.start.floor+Nn+h.start.id,m=""+h.end.floor+Nn+h.end.id,_=this.pointMap.get(g),w=this.pointMap.get(m);if(_&&w&&!_.permission&&!w.permission){let S=t;this.addLineItem(g,m,S,s)}}})}),this.connectionPointMap.forEach((c,p)=>{c.forEach(h=>{if(h.start&&h.end){let g=""+h.start.floor+Nn+h.start.id,m=""+h.end.floor+Nn+h.end.id,_=this.pointMap.get(g),w=this.pointMap.get(m);_&&w&&!_.permission&&!w.permission&&this.addLineItem(g,m,100,s)}})})}initBaseRoute(){let t=new Map(sl(this.lineMap));this.addFacilityToLineMap(100,100*this.lift_priority,3e4,t),this.baseRoute=new ro.default(t)}initEscalatorRoute(){let t=new Map(sl(this.lineMap)),e=1e4;this.addFacilityToLineMap(100,this.lift_priority*e,3e4*e,t),this.escalatorRoute=new ro.default(t)}initStraightLadderRoute(){let t=new Map(sl(this.lineMap)),e=1e4;this.addFacilityToLineMap(3*e,300,3e4*e,t),this.straightLadderRoute=new ro.default(t)}initForwardRoute(){this.rampMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Nn+o.start.id,c=""+o.end.floor+Nn+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(c);p&&h&&!p.permission&&!h.permission&&this.addLineItem(s,c,10,this.forwardLineMap)}})}),this.connectionPointMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Nn+o.start.id,c=""+o.end.floor+Nn+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(c);p&&h&&!p.permission&&!h.permission&&this.addLineItem(s,c,100,this.forwardLineMap)}})}),this.forwardRoute=new ro.default(this.forwardLineMap)}checkStart(t){return!(!t.floor||!t.nodeId&&(!t.coord||t.coord.length<2))}checkEnd(t){return t.facility||t.parkingSpace&&t.floor?!0:this.checkStart(t)}transformStart(t,e,o){o===void 0&&(o={});var s;if(t.nodeId){let c=this.nodeMap.get(""+t.floor+Nn+t.nodeId);if(c!=null&&c.length)return c.map(p=>{let[h,g]=p.split(Nn);return{floor:h,id:g}})}if((s=t.coord)!=null&&s.length){let c=this.roadInfo.find(m=>m.floor===t.floor);if(!c)return null;let p=c.points.filter(m=>m.isStarted),h=c.points.filter(m=>{let _=""+m.floor+Nn+m.id;if(e==="forward"){if(!this.forwardLineMap.has(_)||o.adsorptionIntersection&&p.length&&!m.isStarted)return!1}else if(!this.lineMap.has(_))return!1;return!0});if(!h.length)return null;let g=h.reduce((m,_)=>{if(_.relatedId)return m;let w=Da(t.coord,_.cds);return w<m.min&&(m.min=w,m.point=_),m},{min:1/0,point:h[0]});return[{floor:c.floor,id:g.point.id}]}return null}transformEnd(t,e){if(t.floor){if(t.parkingSpace){let s=this.parkingMap.get(""+t.floor+Nn+t.parkingSpace);if(s)return[{floor:t.floor,id:s.id}]}let o=this.transformStart(t,e);if(o)return o}if(t.facility){let s=this.facilities.filter(c=>+c.type_id==+t.facility).map(c=>c.id).map(c=>this.facilityMap.get(""+c)).flat(2);if(s!=null&&s.length)return{floor:t.floor,facility:t.facility}}return null}getPath(t,e,o,s,c,p){if(o===void 0&&(o=""),p===void 0&&(p={}),!this.checkStart(t))return"start-error";if(!this.checkEnd(e))return"end-error";let h=this.transformStart(t,o,p);if(!h)return"no-start";let g=this.transformEnd(e,o);if(!g)return"no-end";let m=[];if(Array.isArray(g))for(let S=0;S<h.length;S++){let b=h[S];for(let T=0;T<g.length;T++){let R=g[T];if(b.floor===R.floor&&b.id===R.id)return"near"}}else{m=this.facilities.filter(b=>+b.type_id==+e.facility).map(b=>b.id).map(b=>this.facilityMap.get(""+b)).flat(2).filter(b=>b).filter(b=>g.floor?b.floor===g.floor:!0);for(let b=0;b<h.length;b++){let T=h[b];for(let R=0;R<m.length;R++){let x=m[R];if(T.floor===x.floor&&T.id===x.id)return"near"}}}let _;switch(o){case"escalator":_=this.getEscalatorPath.bind(this);break;case"straightLadder":_=this.getStraightLadderPath.bind(this);break;case"forward":_=this.getForwardPath.bind(this);break;default:_=this.getBasePath.bind(this);break}let w=null;return h.forEach(S=>{if(Array.isArray(g))g.forEach(b=>{let T=_(S,b,s,c);T&&T&&(!w||T[0].consume<w[0].consume)&&(w=T)});else{if(!m.length)return null;let b=m.map(T=>_(S,{floor:T.floor,id:T.id},s,c)).filter(T=>!!T);w=b.reduce((T,R)=>{let x=R[0].consume;return x<T.distance&&(T.distance=x,T.path=R),T},{distance:1/0,path:b[0]}).path}}),w}getRoutePath(t,e,o){let s=""+t.floor+Nn+t.id,c=this.pointMap.get(s),p=""+e.floor+Nn+e.id,h=this.pointMap.get(p);if(!c||!h)return null;let g=""+c.floor+Nn+(c.relatedId||c.id),m=""+h.floor+Nn+(h.relatedId||h.id),_=o.path(g,m);if(!_)return null;let w=[],S=_.reduce((b,T,R,x)=>{if(R===0)return 0;let E=x[R-1],I=o.graph.get(E).get(T);return b+I},0);return _.map(b=>{let T=this.pointMap.get(b);if(T){var R;let{floor:x}=T,E=T.type;if(this.isFacilityByType(T.type)){let I=this.facilities.find(C=>C.id===+T.targetId);I&&(E=I.entry_infra_type)}if(((R=w[w.length-1])==null?void 0:R.floor)===x){let I=w[w.length-1];I.points.push(T.cds),I.pointInfos.push(T),I.endType=E,I.destId=T.nodeId,I.distance=MN(I.points)}else w.push({floor:x,points:[T.cds],pointInfos:[T],endType:E,destId:T.nodeId,distance:0,consume:S})}}),w}getBasePath(t,e,o){if(!o)return this.getRoutePath(t,e,this.baseRoute);let s=sl(this.baseRoute.graph),c=h=>{this.addPermissionLineToMap(h,["","escalator","staircase","straightLadder","connectionPoint"],s,new Map([["escalator",100],["connectionPoint",100],["straightLadder",100*this.lift_priority],["staircase",3e4]]))};Array.isArray(o)?o.forEach(h=>{c(h)}):c(o);let p=new ro.default(s);return this.getRoutePath(t,e,p)}getEscalatorPath(t,e,o){if(!o)return this.getRoutePath(t,e,this.escalatorRoute);let s=sl(this.escalatorRoute.graph),c=1e4,p=g=>{this.addPermissionLineToMap(g,["","escalator","staircase","straightLadder","connectionPoint"],s,new Map([["escalator",100],["connectionPoint",100],["straightLadder",this.lift_priority*c],["staircase",3e4*c]]))};Array.isArray(o)?o.forEach(g=>{p(g)}):p(o);let h=new ro.default(s);return this.getRoutePath(t,e,h)}getStraightLadderPath(t,e,o){if(!o)return this.getRoutePath(t,e,this.straightLadderRoute);let s=sl(this.straightLadderRoute.graph),c=1e4,p=g=>{this.addPermissionLineToMap(g,["","escalator","staircase","straightLadder","connectionPoint"],s,new Map([["escalator",3*c],["connectionPoint",100],["straightLadder",300],["staircase",3e4*c]]))};Array.isArray(o)?o.forEach(g=>{p(g)}):p(o);let h=new ro.default(s);return this.getRoutePath(t,e,h)}getForwardPath(t,e,o,s){let c=new Map,p=b=>{let T=this.forwardRoute.graph.get(g);b.forEach(R=>{let x=T.get(R);(0,Uh.isNil)(x)||(c.set(R,x),T.delete(R))})},h=()=>{let b=this.forwardRoute.graph.get(g);c.forEach((T,R)=>{b.set(R,T)})},g=""+t.floor+Nn+t.id;if(!(0,Uh.isNil)(s)){let b=this.forwardLineMap.get(g),T=this.pointMap.get(g);if(T&&(b!=null&&b.size)&&b.size>1){let R=new ze(T.cds[0],T.cds[1]),x=new Map;b.forEach((I,C)=>{let F=this.pointMap.get(C);if(F){let V=new ze(F.cds[0],F.cds[1]),q=360-(new ze().subVectors(V,R).angle()/Math.PI*180-90+360)%360;x.set(C,q)}});let E=Array.from(x).filter(I=>{let[C,F]=I;return Math.abs(F-s)<=60}).map(I=>{let[C]=I;return C});if(E.length)E.forEach(I=>x.delete(I)),p([...x.keys()]);else{let I=Array.from(x).reduce((C,F)=>{let V=Math.abs(F[1]-s);return V<C.diff?{diff:V,key:F[0]}:C},{diff:1/0,key:""});x.delete(I.key),p([...x.keys()])}}}if(!o){let b=this.getRoutePath(t,e,this.forwardRoute);return h(),b||this.getRoutePath(t,e,this.forwardRoute)}let m=sl(this.forwardRoute.graph),_=b=>{this.addPermissionLineToMap(b,["","ramp"],m,new Map([["ramp",10]]))};Array.isArray(o)?o.forEach(b=>{_(b)}):_(o);let w=new ro.default(m),S=this.getRoutePath(t,e,w);if(h(),S)return S;{let b=sl(this.forwardRoute.graph);Array.isArray(o)?o.forEach(x=>{_(x)}):_(o);let T=new ro.default(b);return this.getRoutePath(t,e,T)}}clear(){this.roadInfo=[],this.pointMap.clear(),this.nodeMap.clear(),this.facilityMap.clear(),this.straightLadderMap.clear(),this.escalatorMap.clear(),this.staircaseMap.clear(),this.lineMap.clear(),this.baseRoute=new ro.default,this.escalatorRoute=new ro.default,this.straightLadderRoute=new ro.default}constructor(t=3){this.lift_priority=t,this.roadInfo=[],this.facilities=[],this.pointMap=new Map,this.nodeMap=new Map,this.facilityMap=new Map,this.straightLadderMap=new Map,this.escalatorMap=new Map,this.rampMap=new Map,this.staircaseMap=new Map,this.connectionPointMap=new Map,this.parkingMap=new Map,this.lineMap=new Map,this.weightPointMap=new Map,this.baseRoute=new ro.default,this.escalatorRoute=new ro.default,this.straightLadderRoute=new ro.default,this.forwardLineMap=new Map,this.forwardRoute=new ro.default}};var iwt=$e(kp(),1),owt=$e(Zp(),1);var mJ=$e(RN(),1);function yJ(n,t,e){let o=bN(n,t,e);return vJ(o)}function vJ(n){return 180-Math.abs(n)<15?"front":n>135?"right_front":n<-135?"left_front":n<=135&&n>=60?"right":n>=-135&&n<=-60?"left":n<60&&n>0?"right_back":n>-60&&n<0?"left_back":"front"}function LN(n){if(!n.length)return[];if(n.length===1)return[{direction:"start",distance:0,points:n}];let t=[{direction:"start",distance:Da(n[0],n[1]),points:[n[0],n[1]]}];for(let e=2;e<n.length;e++){let o=yJ(n[e-2],n[e-1],n[e]);if(o==="front"){let s=t[t.length-1],c=Da(n[e-1],n[e]);s.distance+=c,e!==2&&s.points.push(n[e-1])}else t.push({direction:o,distance:Da(n[e-1],n[e]),points:[n[e-1],n[e]]})}return t.push({direction:"end",distance:0,points:[n[n.length-1]]}),t}var mwt=$e(o2(),1),ywt=$e(Yp(),1),vwt=$e(Zp(),1);function s2(n){return n.replace(/[A-Z]/g,t=>"_"+t.toLowerCase()).replace(/^_/,"")}function a2(n){let t={};for(let o in n)o.startsWith("on")&&(t[s2(o.slice(2))]=n[o],t[o]=n[o]);let e=o=>dp(this,null,function*(){let{data:s}=o;if(t[s.type])try{let c=yield t[s.type](s.data);if(c!=null&&c.$transfer&&Array.isArray(c.$transfer)){let p=c.$transfer;delete c.$transfer,self.postMessage({type:""+s.type+"_result",key:s.key,data:c},p)}else self.postMessage({type:""+s.type+"_result",key:s.key,data:c})}catch(c){self.postMessage({type:""+s.type+"_result",key:s.key,error:c})}else self.postMessage({type:""+s.type+"_result",key:s.key,error:"no_event"})});return self.addEventListener("message",e),()=>{self.removeEventListener("message",e)}}var tm=new jg;a2({onSetLiftPriority(n){tm.setLiftPriority(n)},onSetRoadInfo(n){let{roadData:t,facilities:e}=n;tm.initRoute(t,e)},onGetPath(n){let{start:t,end:e,type:o,permission:s,travelDirection:c,options:p}=n;return tm.getPath(t,e,o,s,c,p)},onGetDirectionPath(n){return LN(n)},onClear(){tm.clear()}});
|
|
3825
|
+
`)};function Bg(n,t,e){this.x=n,this.y=t,this.weight=e}Bg.prototype.toString=function(){return"["+this.x+" "+this.y+"]"};Bg.prototype.getCost=function(n){return n&&n.x!==this.x&&n.y!==this.y?this.weight*1.41421:this.weight};Bg.prototype.isWall=function(){return this.weight===0};function BL(n){this.content=[],this.scoreFunction=n}BL.prototype={push:function(n){this.content.push(n),this.sinkDown(this.content.length-1)},pop:function(){var n=this.content[0],t=this.content.pop();return this.content.length>0&&(this.content[0]=t,this.bubbleUp(0)),n},remove:function(n){var t=this.content.indexOf(n),e=this.content.pop();t!==this.content.length-1&&(this.content[t]=e,this.scoreFunction(e)<this.scoreFunction(n)?this.sinkDown(t):this.bubbleUp(t))},size:function(){return this.content.length},rescoreElement:function(n){this.sinkDown(this.content.indexOf(n))},sinkDown:function(n){for(var t=this.content[n];n>0;){var e=(n+1>>1)-1,o=this.content[e];if(this.scoreFunction(t)<this.scoreFunction(o))this.content[e]=t,this.content[n]=o,n=e;else break}},bubbleUp:function(n){for(var t=this.content.length,e=this.content[n],o=this.scoreFunction(e);;){var s=n+1<<1,c=s-1,p=null,h;if(c<t){var g=this.content[c];h=this.scoreFunction(g),h<o&&(p=c)}if(s<t){var m=this.content[s],_=this.scoreFunction(m);_<(p===null?o:h)&&(p=s)}if(p!==null)this.content[n]=this.content[p],this.content[p]=e,n=p;else break}}};function d1(){this._=null}function hf(n){n.U=n.C=n.L=n.R=n.P=n.N=null}d1.prototype={constructor:d1,insert:function(n,t){var e,o,s;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=zL(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)o=e.U,e===o.L?(s=o.R,s&&s.C?(e.C=s.C=!1,o.C=!0,n=o):(n===e.R&&(Ph(this,e),n=e,e=n.U),e.C=!1,o.C=!0,Ih(this,o))):(s=o.L,s&&s.C?(e.C=s.C=!1,o.C=!0,n=o):(n===e.L&&(Ih(this,e),n=e,e=n.U),e.C=!1,o.C=!0,Ph(this,o))),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t=n.U,e,o=n.L,s=n.R,c,p;if(o?s?c=zL(s):c=o:c=s,t?t.L===n?t.L=c:t.R=c:this._=c,o&&s?(p=c.C,c.C=n.C,c.L=o,o.U=c,c!==s?(t=c.U,c.U=n.U,n=c.R,t.L=n,c.R=s,s.U=c):(c.U=t,t=c,n=c.R)):(p=n.C,n=c),n&&(n.U=t),!p){if(n&&n.C){n.C=!1;return}do{if(n===this._)break;if(n===t.L){if(e=t.R,e.C&&(e.C=!1,t.C=!0,Ph(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,Ih(this,e),e=t.R),e.C=t.C,t.C=e.R.C=!1,Ph(this,t),n=this._;break}}else if(e=t.L,e.C&&(e.C=!1,t.C=!0,Ih(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,Ph(this,e),e=t.L),e.C=t.C,t.C=e.L.C=!1,Ih(this,t),n=this._;break}e.C=!0,n=t,t=t.U}while(!n.C);n&&(n.C=!1)}}};function Ph(n,t){var e=t,o=t.R,s=e.U;s?s.L===e?s.L=o:s.R=o:n._=o,o.U=s,e.U=o,e.R=o.L,e.R&&(e.R.U=e),o.L=e}function Ih(n,t){var e=t,o=t.L,s=e.U;s?s.L===e?s.L=o:s.R=o:n._=o,o.U=s,e.U=o,e.L=o.R,e.L&&(e.L.U=e),o.R=e}function zL(n){for(;n.L;)n=n.L;return n}var g1=d1;function pf(n,t,e,o){var s=[null,null],c=Hi.push(s)-1;return s.left=n,s.right=t,e&&Rh(s,n,t,e),o&&Rh(s,t,n,o),To[n.index].halfedges.push(c),To[t.index].halfedges.push(c),s}function df(n,t,e){var o=[t,e];return o.left=n,o}function Rh(n,t,e,o){!n[0]&&!n[1]?(n[0]=o,n.left=t,n.right=e):n.left===e?n[1]=o:n[0]=o}function uK(n,t,e,o,s){var c=n[0],p=n[1],h=c[0],g=c[1],m=p[0],_=p[1],w=0,S=1,b=m-h,T=_-g,R;if(R=t-h,!(!b&&R>0)){if(R/=b,b<0){if(R<w)return;R<S&&(S=R)}else if(b>0){if(R>S)return;R>w&&(w=R)}if(R=o-h,!(!b&&R<0)){if(R/=b,b<0){if(R>S)return;R>w&&(w=R)}else if(b>0){if(R<w)return;R<S&&(S=R)}if(R=e-g,!(!T&&R>0)){if(R/=T,T<0){if(R<w)return;R<S&&(S=R)}else if(T>0){if(R>S)return;R>w&&(w=R)}if(R=s-g,!(!T&&R<0)){if(R/=T,T<0){if(R>S)return;R>w&&(w=R)}else if(T>0){if(R<w)return;R<S&&(S=R)}return!(w>0)&&!(S<1)||(w>0&&(n[0]=[h+w*b,g+w*T]),S<1&&(n[1]=[h+S*b,g+S*T])),!0}}}}}function lK(n,t,e,o,s){var c=n[1];if(c)return!0;var p=n[0],h=n.left,g=n.right,m=h[0],_=h[1],w=g[0],S=g[1],b=(m+w)/2,T=(_+S)/2,R,x;if(S===_){if(b<t||b>=o)return;if(m>w){if(!p)p=[b,e];else if(p[1]>=s)return;c=[b,s]}else{if(!p)p=[b,s];else if(p[1]<e)return;c=[b,e]}}else if(R=(m-w)/(S-_),x=T-R*b,R<-1||R>1)if(m>w){if(!p)p=[(e-x)/R,e];else if(p[1]>=s)return;c=[(s-x)/R,s]}else{if(!p)p=[(s-x)/R,s];else if(p[1]<e)return;c=[(e-x)/R,e]}else if(_<S){if(!p)p=[t,R*t+x];else if(p[0]>=o)return;c=[o,R*o+x]}else{if(!p)p=[o,R*o+x];else if(p[0]<t)return;c=[t,R*t+x]}return n[0]=p,n[1]=c,!0}function GL(n,t,e,o){for(var s=Hi.length,c;s--;)(!lK(c=Hi[s],n,t,e,o)||!uK(c,n,t,e,o)||!(Math.abs(c[0][0]-c[1][0])>Er||Math.abs(c[0][1]-c[1][1])>Er))&&delete Hi[s]}function kL(n){return To[n.index]={site:n,halfedges:[]}}function cK(n,t){var e=n.site,o=t.left,s=t.right;return e===s&&(s=o,o=e),s?Math.atan2(s[1]-o[1],s[0]-o[0]):(e===o?(o=t[1],s=t[0]):(o=t[0],s=t[1]),Math.atan2(o[0]-s[0],s[1]-o[1]))}function m1(n,t){return t[+(t.left!==n.site)]}function fK(n,t){return t[+(t.left===n.site)]}function qL(){for(var n=0,t=To.length,e,o,s,c;n<t;++n)if((e=To[n])&&(c=(o=e.halfedges).length)){var p=new Array(c),h=new Array(c);for(s=0;s<c;++s)p[s]=s,h[s]=cK(e,Hi[o[s]]);for(p.sort(function(g,m){return h[m]-h[g]}),s=0;s<c;++s)h[s]=o[p[s]];for(s=0;s<c;++s)o[s]=h[s]}}function HL(n,t,e,o){var s=To.length,c,p,h,g,m,_,w,S,b,T,R,x,E=!0;for(c=0;c<s;++c)if(p=To[c]){for(h=p.site,m=p.halfedges,g=m.length;g--;)Hi[m[g]]||m.splice(g,1);for(g=0,_=m.length;g<_;)T=fK(p,Hi[m[g]]),R=T[0],x=T[1],w=m1(p,Hi[m[++g%_]]),S=w[0],b=w[1],(Math.abs(R-S)>Er||Math.abs(x-b)>Er)&&(m.splice(g,0,Hi.push(df(h,T,Math.abs(R-n)<Er&&o-x>Er?[n,Math.abs(S-n)<Er?b:o]:Math.abs(x-o)<Er&&e-R>Er?[Math.abs(b-o)<Er?S:e,o]:Math.abs(R-e)<Er&&x-t>Er?[e,Math.abs(S-e)<Er?b:t]:Math.abs(x-t)<Er&&R-n>Er?[Math.abs(b-t)<Er?S:n,t]:null))-1),++_);_&&(E=!1)}if(E){var I,C,F,V=1/0;for(c=0,E=null;c<s;++c)(p=To[c])&&(h=p.site,I=h[0]-n,C=h[1]-t,F=I*I+C*C,F<V&&(V=F,E=p));if(E){var X=[n,t],q=[n,o],D=[e,o],xt=[e,t];E.halfedges.push(Hi.push(df(h=E.site,X,q))-1,Hi.push(df(h,q,D))-1,Hi.push(df(h,D,xt))-1,Hi.push(df(h,xt,X))-1)}}for(c=0;c<s;++c)(p=To[c])&&(p.halfedges.length||delete To[c])}var VL=[],zg;function hK(){hf(this),this.x=this.y=this.arc=this.site=this.cy=null}function Wl(n){var t=n.P,e=n.N;if(!(!t||!e)){var o=t.site,s=n.site,c=e.site;if(o!==c){var p=s[0],h=s[1],g=o[0]-p,m=o[1]-h,_=c[0]-p,w=c[1]-h,S=2*(g*w-m*_);if(!(S>=-WL)){var b=g*g+m*m,T=_*_+w*w,R=(w*b-m*T)/S,x=(g*T-_*b)/S,E=VL.pop()||new hK;E.arc=n,E.site=s,E.x=R+p,E.y=(E.cy=x+h)+Math.sqrt(R*R+x*x),n.circle=E;for(var I=null,C=gf._;C;)if(E.y<C.y||E.y===C.y&&E.x<=C.x)if(C.L)C=C.L;else{I=C.P;break}else if(C.R)C=C.R;else{I=C;break}gf.insert(I,E),I||(zg=E)}}}}function Xl(n){var t=n.circle;t&&(t.P||(zg=t.N),gf.remove(t),VL.push(t),hf(t),n.circle=null)}var YL=[];function pK(){hf(this),this.edge=this.site=this.circle=null}function XL(n){var t=YL.pop()||new pK;return t.site=n,t}function y1(n){Xl(n),Yl.remove(n),YL.push(n),hf(n)}function $L(n){var t=n.circle,e=t.x,o=t.cy,s=[e,o],c=n.P,p=n.N,h=[n];y1(n);for(var g=c;g.circle&&Math.abs(e-g.circle.x)<Er&&Math.abs(o-g.circle.cy)<Er;)c=g.P,h.unshift(g),y1(g),g=c;h.unshift(g),Xl(g);for(var m=p;m.circle&&Math.abs(e-m.circle.x)<Er&&Math.abs(o-m.circle.cy)<Er;)p=m.N,h.push(m),y1(m),m=p;h.push(m),Xl(m);var _=h.length,w;for(w=1;w<_;++w)m=h[w],g=h[w-1],Rh(m.edge,g.site,m.site,s);g=h[0],m=h[_-1],m.edge=pf(g.site,m.site,null,s),Wl(g),Wl(m)}function ZL(n){for(var t=n[0],e=n[1],o,s,c,p,h=Yl._;h;)if(c=KL(h,e)-t,c>Er)h=h.L;else if(p=t-dK(h,e),p>Er){if(!h.R){o=h;break}h=h.R}else{c>-Er?(o=h.P,s=h):p>-Er?(o=h,s=h.N):o=s=h;break}kL(n);var g=XL(n);if(Yl.insert(o,g),!(!o&&!s)){if(o===s){Xl(o),s=XL(o.site),Yl.insert(g,s),g.edge=s.edge=pf(o.site,g.site),Wl(o),Wl(s);return}if(!s){g.edge=pf(o.site,g.site);return}Xl(o),Xl(s);var m=o.site,_=m[0],w=m[1],S=n[0]-_,b=n[1]-w,T=s.site,R=T[0]-_,x=T[1]-w,E=2*(S*x-b*R),I=S*S+b*b,C=R*R+x*x,F=[(x*I-b*C)/E+_,(S*C-R*I)/E+w];Rh(s.edge,m,T,F),g.edge=pf(m,n,null,F),s.edge=pf(n,T,null,F),Wl(o),Wl(s)}}function KL(n,t){var e=n.site,o=e[0],s=e[1],c=s-t;if(!c)return o;var p=n.P;if(!p)return-1/0;e=p.site;var h=e[0],g=e[1],m=g-t;if(!m)return h;var _=h-o,w=1/c-1/m,S=_/m;return w?(-S+Math.sqrt(S*S-2*w*(_*_/(-2*m)-g+m/2+s-c/2)))/w+o:(o+h)/2}function dK(n,t){var e=n.N;if(e)return KL(e,t);var o=n.site;return o[1]===t?o[0]:1/0}var Er=1e-6,WL=1e-12,Yl,To,gf,Hi;function gK(n,t,e){return(n[0]-e[0])*(t[1]-n[1])-(n[0]-t[0])*(e[1]-n[1])}function mK(n,t){return t[1]-n[1]||t[0]-n[0]}function Gg(n,t){var e=n.sort(mK).pop(),o,s,c;for(Hi=[],To=new Array(n.length),Yl=new g1,gf=new g1;;)if(c=zg,e&&(!c||e[1]<c.y||e[1]===c.y&&e[0]<c.x))(e[0]!==o||e[1]!==s)&&(ZL(e),o=e[0],s=e[1]),e=n.pop();else if(c)$L(c.arc);else break;if(qL(),t){var p=+t[0][0],h=+t[0][1],g=+t[1][0],m=+t[1][1];GL(p,h,g,m),HL(p,h,g,m)}this.edges=Hi,this.cells=To,Yl=gf=Hi=To=null}Gg.prototype={constructor:Gg,polygons:function(){var n=this.edges;return this.cells.map(function(t){var e=t.halfedges.map(function(o){return m1(t,n[o])});return e.data=t.site.data,e})},triangles:function(){var n=[],t=this.edges;return this.cells.forEach(function(e,o){if(h=(c=e.halfedges).length)for(var s=e.site,c,p=-1,h,g,m=t[c[h-1]],_=m.left===s?m.right:m.left;++p<h;)g=_,m=t[c[p]],_=m.left===s?m.right:m.left,g&&_&&o<g.index&&o<_.index&&gK(s,g,_)<0&&n.push([s.data,g.data,_.data])}),n},links:function(){return this.edges.filter(function(n){return n.right}).map(function(n){return{source:n.left.data,target:n.right.data}})},find:function(n,t,e){for(var o=this,s,c=o._found||0,p=o.cells.length,h;!(h=o.cells[c]);)if(++c>=p)return null;var g=n-h.site[0],m=t-h.site[1],_=g*g+m*m;do h=o.cells[s=c],c=null,h.halfedges.forEach(function(w){var S=o.edges[w],b=S.left;if(!((b===h.site||!b)&&!(b=S.right))){var T=n-b[0],R=t-b[1],x=T*T+R*R;x<_&&(_=x,c=b.index)}});while(c!==null);return o._found=s,e==null||_<=e*e?h.site:null}};var MK=$e(mf(),1);var L1=$e(tN(),1);function Zo(){return new Hg}function Hg(){this.reset()}Hg.prototype={constructor:Hg,reset:function(){this.s=this.t=0},add:function(n){eN(qg,n,this.t),eN(this,qg.s,this.s),this.s?this.t+=qg.t:this.s=qg.t},valueOf:function(){return this.s}};var qg=new Hg;function eN(n,t,e){var o=n.s=t+e,s=o-t,c=o-s;n.t=t-c+(e-s)}var er=1e-6;var gr=Math.PI,Mi=gr/2,Vg=gr/4,Na=gr*2,$l=180/gr,Ko=gr/180,Zr=Math.abs,sa=Math.atan,Jo=Math.atan2,Xn=Math.cos;var Wg=Math.exp;var Lh=Math.log;var an=Math.sin;var no=Math.sqrt,Nh=Math.tan;function x1(n){return n>1?0:n<-1?gr:Math.acos(n)}function Co(n){return n>1?Mi:n<-1?-Mi:Math.asin(n)}function aa(){}var bK=Zo(),ipt=Zo();function Zl(n){var t=n[0],e=n[1],o=Xn(e);return[o*Xn(t),o*an(t),an(e)]}function Oh(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 Dh(n){var t=no(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}var dpt=Zo();function rN(n,t){return[n>gr?n-Na:n<-gr?n+Na:n,t]}rN.invert=rN;function E1(){var n=[],t;return{point:function(e,o){t.push([e,o])},lineStart:function(){n.push(t=[])},lineEnd:aa,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function w1(n,t){return Zr(n[0]-t[0])<er&&Zr(n[1]-t[1])<er}function Xg(n,t,e,o){this.x=n,this.z=t,this.o=e,this.e=o,this.v=!1,this.n=this.p=null}function S1(n,t,e,o,s){var c=[],p=[],h,g;if(n.forEach(function(T){if(!((R=T.length-1)<=0)){var R,x=T[0],E=T[R],I;if(w1(x,E)){for(s.lineStart(),h=0;h<R;++h)s.point((x=T[h])[0],x[1]);s.lineEnd();return}c.push(I=new Xg(x,T,null,!0)),p.push(I.o=new Xg(x,null,I,!1)),c.push(I=new Xg(E,T,null,!1)),p.push(I.o=new Xg(E,null,I,!0))}}),!!c.length){for(p.sort(t),iN(c),iN(p),h=0,g=p.length;h<g;++h)p[h].e=e=!e;for(var m=c[0],_,w;;){for(var S=m,b=!0;S.v;)if((S=S.n)===m)return;_=S.z,s.lineStart();do{if(S.v=S.o.v=!0,S.e){if(b)for(h=0,g=_.length;h<g;++h)s.point((w=_[h])[0],w[1]);else o(S.x,S.n.x,1,s);S=S.n}else{if(b)for(_=S.p.z,h=_.length-1;h>=0;--h)s.point((w=_[h])[0],w[1]);else o(S.x,S.p.x,-1,s);S=S.p}S=S.o,_=S.z,b=!b}while(!S.v);s.lineEnd()}}}function iN(n){if(t=n.length){for(var t,e=0,o=n[0],s;++e<t;)o.n=s=n[e],s.p=o,o=s;o.n=s=n[0],s.p=o}}function il(n,t){return n<t?-1:n>t?1:n>=t?0:NaN}function M1(n){return n.length===1&&(n=CK(n)),{left:function(t,e,o,s){for(o==null&&(o=0),s==null&&(s=t.length);o<s;){var c=o+s>>>1;n(t[c],e)<0?o=c+1:s=c}return o},right:function(t,e,o,s){for(o==null&&(o=0),s==null&&(s=t.length);o<s;){var c=o+s>>>1;n(t[c],e)>0?s=c:o=c+1}return o}}}function CK(n){return function(t,e){return il(n(t),e)}}var oN=M1(il),PK=oN.right,IK=oN.left;var sN=Array.prototype,LK=sN.slice,NK=sN.map;var sdt=Math.sqrt(50),adt=Math.sqrt(10),udt=Math.sqrt(2);function $g(n){for(var t=n.length,e,o=-1,s=0,c,p;++o<t;)s+=n[o].length;for(c=new Array(s);--t>=0;)for(p=n[t],e=p.length;--e>=0;)c[--s]=p[e];return c}var kK=1e9,Wgt=-kK;var b1=Zo();function A1(n,t){var e=t[0],o=t[1],s=[an(e),-Xn(e),0],c=0,p=0;b1.reset();for(var h=0,g=n.length;h<g;++h)if(_=(m=n[h]).length)for(var m,_,w=m[_-1],S=w[0],b=w[1]/2+Vg,T=an(b),R=Xn(b),x=0;x<_;++x,S=I,T=F,R=V,w=E){var E=m[x],I=E[0],C=E[1]/2+Vg,F=an(C),V=Xn(C),X=I-S,q=X>=0?1:-1,D=q*X,xt=D>gr,B=T*F;if(b1.add(Jo(B*q*an(D),R*V+B*Xn(D))),c+=xt?X+q*Na:X,xt^S>=e^I>=e){var j=Oh(Zl(w),Zl(E));Dh(j);var K=Oh(s,j);Dh(K);var Dt=(xt^X>=0?-1:1)*Co(K[2]);(o>Dt||o===Dt&&(j[0]||j[1]))&&(p+=xt^X>=0?1:-1)}}return(c<-er||c<er&&b1<-er)^p&1}var emt=Zo();var xmt=Zo(),Emt=Zo();var VK=1/0;var Mmt=-VK;function T1(n){this._context=n}T1.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,Na);break}}},result:aa};var Omt=Zo();function C1(){this._string=[]}C1.prototype={_radius:4.5,_circle:lN(4.5),pointRadius:function(n){return(n=+n)!==this._radius&&(this._radius=n,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(n,t){switch(this._point){case 0:{this._string.push("M",n,",",t),this._point=1;break}case 1:{this._string.push("L",n,",",t);break}default:{this._circle==null&&(this._circle=lN(this._radius)),this._string.push("M",n,",",t,this._circle);break}}},result:function(){if(this._string.length){var n=this._string.join("");return this._string=[],n}else return null}};function lN(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function P1(n,t,e,o){return function(s,c){var p=t(c),h=s.invert(o[0],o[1]),g=E1(),m=t(g),_=!1,w,S,b,T={point:R,lineStart:E,lineEnd:I,polygonStart:function(){T.point=C,T.lineStart=F,T.lineEnd=V,S=[],w=[]},polygonEnd:function(){T.point=R,T.lineStart=E,T.lineEnd=I,S=$g(S);var X=A1(w,h);S.length?(_||(c.polygonStart(),_=!0),S1(S,YK,X,e,c)):X&&(_||(c.polygonStart(),_=!0),c.lineStart(),e(null,null,1,c),c.lineEnd()),_&&(c.polygonEnd(),_=!1),S=w=null},sphere:function(){c.polygonStart(),c.lineStart(),e(null,null,1,c),c.lineEnd(),c.polygonEnd()}};function R(X,q){var D=s(X,q);n(X=D[0],q=D[1])&&c.point(X,q)}function x(X,q){var D=s(X,q);p.point(D[0],D[1])}function E(){T.point=x,p.lineStart()}function I(){T.point=R,p.lineEnd()}function C(X,q){b.push([X,q]);var D=s(X,q);m.point(D[0],D[1])}function F(){m.lineStart(),b=[]}function V(){C(b[0][0],b[0][1]),m.lineEnd();var X=m.clean(),q=g.result(),D,xt=q.length,B,j,K;if(b.pop(),w.push(b),b=null,!!xt){if(X&1){if(j=q[0],(B=j.length-1)>0){for(_||(c.polygonStart(),_=!0),c.lineStart(),D=0;D<B;++D)c.point((K=j[D])[0],K[1]);c.lineEnd()}return}xt>1&&X&2&&q.push(q.pop().concat(q.shift())),S.push(q.filter(XK))}}return T}}function XK(n){return n.length>1}function YK(n,t){return((n=n.x)[0]<0?n[1]-Mi-er:Mi-n[1])-((t=t.x)[0]<0?t[1]-Mi-er:Mi-t[1])}var $K=P1(function(){return!0},ZK,JK,[-gr,-Mi]);function ZK(n){var t=NaN,e=NaN,o=NaN,s;return{lineStart:function(){n.lineStart(),s=1},point:function(c,p){var h=c>0?gr:-gr,g=Zr(c-t);Zr(g-gr)<er?(n.point(t,e=(e+p)/2>0?Mi:-Mi),n.point(o,e),n.lineEnd(),n.lineStart(),n.point(h,e),n.point(c,e),s=0):o!==h&&g>=gr&&(Zr(t-o)<er&&(t-=o*er),Zr(c-h)<er&&(c-=h*er),e=KK(t,e,c,p),n.point(o,e),n.lineEnd(),n.lineStart(),n.point(h,e),s=0),n.point(t=c,e=p),o=h},lineEnd:function(){n.lineEnd(),t=e=NaN},clean:function(){return 2-s}}}function KK(n,t,e,o){var s,c,p=an(n-e);return Zr(p)>er?sa((an(t)*(c=Xn(o))*an(e)-an(o)*(s=Xn(t))*an(n))/(s*c*p)):(t+o)/2}function JK(n,t,e,o){var s;if(n==null)s=e*Mi,o.point(-gr,s),o.point(0,s),o.point(gr,s),o.point(gr,0),o.point(gr,-s),o.point(0,-s),o.point(-gr,-s),o.point(-gr,0),o.point(-gr,s);else if(Zr(n[0]-t[0])>er){var c=n[0]<t[0]?gr:-gr;s=e*c/2,o.point(-c,s),o.point(0,s),o.point(c,s)}else o.point(t[0],t[1])}function Zg(n){return function(t){var e=new I1;for(var o in n)e[o]=n[o];return e.stream=t,e}}function I1(){}I1.prototype={constructor:I1,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 E0t=Xn(30*Ko);var D0t=Zg({point:function(n,t){this.stream.point(n*Ko,t*Ko)}});function Kg(n){return function(t,e){var o=Xn(t),s=Xn(e),c=n(o*s);return[c*s*an(t),c*an(e)]}}function Oa(n){return function(t,e){var o=no(t*t+e*e),s=n(o),c=an(s),p=Xn(s);return[Jo(t*c,o*p),Co(o&&e*c/o)]}}var mN=Kg(function(n){return no(2/(1+n))});mN.invert=Oa(function(n){return 2*Co(n/2)});var yN=Kg(function(n){return(n=x1(n))&&n/an(n)});yN.invert=Oa(function(n){return n});function R1(n,t){return[n,Lh(Nh((Mi+t)/2))]}R1.invert=function(n,t){return[n,2*sa(Wg(t))-Mi]};function Jg(n,t){return[n,t]}Jg.invert=Jg;function vN(n,t){var e=Xn(t),o=Xn(n)*e;return[e*an(n)/o,an(t)/o]}vN.invert=Oa(sa);function _N(n,t){var e=t*t,o=e*e;return[n*(.8707-.131979*e+o*(-.013791+o*(.003971*e-.001529*o))),t*(1.007226+e*(.015085+o*(-.044475+.028874*e-.005916*o)))]}_N.invert=function(n,t){var e=t,o=25,s;do{var c=e*e,p=c*c;e-=s=(e*(1.007226+c*(.015085+p*(-.044475+.028874*c-.005916*p)))-t)/(1.007226+c*(.015085*3+p*(-.044475*7+.028874*9*c-.005916*11*p)))}while(Zr(s)>er&&--o>0);return[n/(.8707+(c=e*e)*(-.131979+c*(-.013791+c*c*c*(.003971-.001529*c)))),e]};function xN(n,t){return[Xn(t)*an(n),an(t)]}xN.invert=Oa(Co);function EN(n,t){var e=Xn(t),o=1+Xn(n)*e;return[e*an(n)/o,an(t)/o]}EN.invert=Oa(function(n){return 2*sa(n)});function wN(n,t){return[Lh(Nh((Mi+t)/2)),-n]}wN.invert=function(n,t){return[-t,2*sa(Wg(n))-Mi]};var rJ=$e(mf(),1);var iJ=$e(mf(),1);var sJ=$e(mf(),1);var aJ=$e(mf(),1);function Da(n,t){return Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2)}function MN(n){let t=0;for(let e=0;e<n.length-1;e++)t+=Da(n[e],n[e+1]);return t}function bN(n,t,e){let o=new ze(t[0]-n[0],t[1]-n[1]),s=new ze(t[0]-e[0],t[1]-e[1]),p=o.angleTo(s)*180/Math.PI,h=new ze(t[0]-n[0],t[1]-n[1]);return new ze(e[0]-n[0],e[1]-n[1]).cross(h)>0?p:-p}var Uh=$e(AN(),1);var Nn="___";function sl(n){let t=new Map;return n.forEach((e,o)=>{t.set(o,new Map(e))}),t}var jg=class{setLiftPriority(t){this.lift_priority=t}isFacilityByType(t){return["facility","escalator","straightLadder","staircase","ramp","connectionPoint"].includes(t)}initFacilities(t){this.facilities=t.map(e=>{let o=[];try{o=JSON.parse(e.entry_end_floor)}catch(c){o=[]}let s=[];try{s=JSON.parse(e.entry_start_floor)}catch(c){s=[]}return xl({},e,{entry_start_floor:s,entry_end_floor:o})})}getParkingSpaceInfo(t,e){let o=""+t+Nn+e;var s;return(s=this.parkingMap.get(o))!=null?s:null}getNodeInfo(t,e){let o=""+t+Nn+e,s=this.nodeMap.get(o);if(!(s!=null&&s.length))return null;let c=this.pointMap.get(s[0]);return c!=null?c:null}initRoute(t,e){this.clear(),this.roadInfo=t,this.initFacilities(e);let o=new Date,s=o.getHours()*60+o.getMinutes();t.length&&(t.forEach(c=>{let p=(c.points||[]).filter(h=>!(0,Uh.isNil)(h.passWeight)&&h.passWeight!==1&&!(0,Uh.isNil)(h.coverageArea)&&h.coverageArea!==0);this.weightPointMap.set(c.floor,p),(c.points||[]).filter(h=>h.openStatus!==!1).filter(h=>{if(!h.startTime||!h.endTime)return!0;let[g,m]=h.startTime.split(":").map(T=>+T),[_,w]=h.endTime.split(":").map(T=>+T),S=g*60+m,b=_*60+w;return s>=S&&s<=b}).forEach(h=>{h.floor=c.floor;let g=""+c.floor+Nn+h.id,m=""+c.floor+Nn+h.nodeId,_=this.nodeMap.get(m)||[];if(_.push(""+c.floor+Nn+(h.relatedId||h.id)),this.nodeMap.set(""+c.floor+Nn+h.nodeId,_),this.pointMap.set(g,h),this.isFacilityByType(h.type)){let w=this.facilities.find(S=>S.id===+h.targetId);if(w){switch(w.entry_infra_type){case"straightLadder":if(w.entry_end_floor.find(x=>x.floor===c.floor)&&w.entry_start_floor.find(x=>x.floor===c.floor)){let x=this.straightLadderMap.get(h.targetId)||[];x.push(xl({},h)),this.straightLadderMap.set(h.targetId,x)}break;case"staircase":if(w.entry_end_floor.find(x=>x.floor===c.floor)&&w.entry_start_floor.find(x=>x.floor===c.floor)){let x=this.staircaseMap.get(h.targetId)||[];x.push(xl({},h)),this.staircaseMap.set(h.targetId,x)}break;case"escalator":let b=this.escalatorMap.get(h.targetId)||[];if(w.entry_start_floor.find(x=>x.floor===c.floor)){let x=b.find(E=>{var I;return((I=E.end)==null?void 0:I.floor)!==c.floor&&!E.start});x?x.start=h:b.push({start:h})}if(w.entry_end_floor.find(x=>x.floor===c.floor)){let x=b.find(E=>{var I;return((I=E.start)==null?void 0:I.floor)!==c.floor&&!E.end});x?x.end=h:b.push({end:h})}this.escalatorMap.set(h.targetId,b);break;case"ramp":let T=this.rampMap.get(h.targetId)||[];if(w.entry_start_floor.find(x=>x.floor===c.floor)){let x=T.find(E=>{var I;return((I=E.end)==null?void 0:I.floor)!==c.floor&&!E.start});x?x.start=h:T.push({start:h})}if(w.entry_end_floor.find(x=>x.floor===c.floor)){let x=T.find(E=>{var I;return((I=E.start)==null?void 0:I.floor)!==c.floor&&!E.end});x?x.end=h:T.push({end:h})}this.rampMap.set(h.targetId,T);break;case"connectionPoint":let R=this.connectionPointMap.get(h.targetId)||[];if(w.entry_start_floor.find(x=>x.floor===c.floor)){let x=R.find(E=>{var I;return((I=E.end)==null?void 0:I.floor)!==c.floor&&!E.start});x?x.start=h:R.push({start:h})}if(w.entry_end_floor.find(x=>x.floor===c.floor)){let x=R.find(E=>{var I;return((I=E.start)==null?void 0:I.floor)!==c.floor&&!E.end});x?x.end=h:R.push({end:h})}this.connectionPointMap.set(h.targetId,R);break}let S=this.facilityMap.get(h.targetId)||[];S.push(xl({},h)),this.facilityMap.set(h.targetId,S)}}h.type==="parkingSpace"&&h.name.split(/[,,]/).forEach(S=>{this.parkingMap.set(""+c.floor+Nn+S,h)})}),(c.lines||[]).filter(h=>h.to!==h.from).forEach(h=>{let g=""+c.floor+Nn+h.from,m=""+c.floor+Nn+h.to,_=this.pointMap.get(g),w=this.pointMap.get(m);if(!_||!w)return;let S=_.cds,b=w.cds,T=Da(S,b);if(!_.permission&&!w.permission){switch(h.direction){case"single-people":this.addLineItem(g,m,T);break;case"back-people":this.addLineItem(m,g,T);break;default:this.addLineItem(g,m,T),this.addLineItem(m,g,T)}switch(h.direction){case"double":this.addLineItem(g,m,T,this.forwardLineMap),this.addLineItem(m,g,T,this.forwardLineMap);break;case"single":this.addLineItem(g,m,T,this.forwardLineMap);break;case"back":this.addLineItem(m,g,T,this.forwardLineMap);break}(_.type==="parkingSpace"||w.type==="parkingSpace")&&h.direction==="noDir"&&(this.addLineItem(g,m,T,this.forwardLineMap),this.addLineItem(m,g,T,this.forwardLineMap))}else _.permission&&this.setPermissionLine(g,m,_.permission,T,"",h.direction),w.permission&&w.permission!==_.permission&&this.setPermissionLine(g,m,w.permission,T,"",h.direction)})}),this.addPermissionFacility(),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute(),this.initForwardRoute())}getPermissionMap(t){return this["permission_"+t]||(this["permission_"+t]=new Set),this["permission_"+t]}setPermissionLine(t,e,o,s,c,p){this.getPermissionMap(o).add({fromKey:t,toKey:e,distance:s,type:c,direction:p})}addPermissionFacility(){this.straightLadderMap.forEach((t,e)=>{if(t.length<2){this.straightLadderMap.delete(e);return}for(let o=0;o<t.length;o++){let s=""+t[o].floor+Nn+t[o].id,c=this.pointMap.get(s);if(c){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Nn+t[p].id,g=this.pointMap.get(h);if(!g)continue;c.permission&&this.setPermissionLine(s,h,c.permission,1,"straightLadder"),g.permission&&g.permission!==c.permission&&this.setPermissionLine(s,h,g.permission,1,"straightLadder")}}}}),this.staircaseMap.forEach((t,e)=>{if(t.length<2){this.staircaseMap.delete(e);return}for(let o=0;o<t.length;o++){let s=""+t[o].floor+Nn+t[o].id,c=this.pointMap.get(s);if(c){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Nn+t[p].id,g=this.pointMap.get(h);if(!g)continue;c.permission&&this.setPermissionLine(s,h,c.permission,1,"staircase"),g.permission&&g.permission!==c.permission&&this.setPermissionLine(s,h,g.permission,1,"staircase")}}}}),this.escalatorMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Nn+o.start.id,c=""+o.end.floor+Nn+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(c);p&&h&&(p.permission&&this.setPermissionLine(s,c,p.permission,1,"escalator"),h.permission&&h.permission!==p.permission&&this.setPermissionLine(s,c,h.permission,1,"escalator"))}})}),this.rampMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Nn+o.start.id,c=""+o.end.floor+Nn+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(c);p&&h&&(p.permission&&this.setPermissionLine(s,c,p.permission,10,"ramp"),h.permission&&h.permission!==p.permission&&this.setPermissionLine(s,c,h.permission,10,"ramp"))}})}),this.connectionPointMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Nn+o.start.id,c=""+o.end.floor+Nn+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(c);p&&h&&(p.permission&&this.setPermissionLine(s,c,p.permission,1,"connectionPoint"),h.permission&&h.permission!==p.permission&&this.setPermissionLine(s,c,h.permission,1,"connectionPoint"))}})})}addPermissionLineToMap(t,e,o,s){this.getPermissionMap(t).forEach(p=>{if(e.includes(p.type))if(p.type==="")switch(p.direction){case"single":this.addLineItem(p.fromKey,p.toKey,p.distance,o);break;case"back":this.addLineItem(p.toKey,p.fromKey,p.distance,o);break;case"single-people":this.addLineItem(p.fromKey,p.toKey,p.distance,o);break;case"back-people":this.addLineItem(p.toKey,p.fromKey,p.distance,o);break;default:this.addLineItem(p.fromKey,p.toKey,p.distance,o),this.addLineItem(p.toKey,p.fromKey,p.distance,o);break}else this.addLineItem(p.fromKey,p.toKey,s.get(p.type),o)})}addLineItem(t,e,o,s){s===void 0&&(s=this.lineMap);let c=s.get(t)||new Map,p=this.pointMap.get(t),h=this.pointMap.get(e);if(!p||!h)return;let g=this.weightPointMap.get(p.floor)||[],m=this.weightPointMap.get(h.floor)||[];g.forEach(_=>{_.id===p.id&&(o=o/_.passWeight),Da(p.cds,_.cds)<=_.coverageArea&&(o=o/_.passWeight)}),m.forEach(_=>{_.id===h.id&&(o=o/_.passWeight),Da(h.cds,_.cds)<=_.coverageArea&&(o=o/_.passWeight)}),c.set(e,o),s.set(t,c)}addFacilityToLineMap(t,e,o,s){[...this.straightLadderMap,...this.staircaseMap].forEach(c=>{let[p,h]=c;if(!(h.length<2))for(let g=0;g<h.length;g++){let m=""+h[g].floor+Nn+h[g].id,_=this.pointMap.get(m);if(!(!_||_.permission)){for(let w=0;w<h.length;w++)if(g!==w){let S=""+h[w].floor+Nn+h[w].id,b=this.pointMap.get(S);if(!b||b.permission)continue;if(h[g].type==="straightLadder"){let T=e;this.addLineItem(m,S,T,s)}else{let T=o;this.addLineItem(m,S,T,s)}}}}}),this.escalatorMap.forEach((c,p)=>{c.forEach(h=>{if(h.start&&h.end){let g=""+h.start.floor+Nn+h.start.id,m=""+h.end.floor+Nn+h.end.id,_=this.pointMap.get(g),w=this.pointMap.get(m);if(_&&w&&!_.permission&&!w.permission){let S=t;this.addLineItem(g,m,S,s)}}})}),this.connectionPointMap.forEach((c,p)=>{c.forEach(h=>{if(h.start&&h.end){let g=""+h.start.floor+Nn+h.start.id,m=""+h.end.floor+Nn+h.end.id,_=this.pointMap.get(g),w=this.pointMap.get(m);_&&w&&!_.permission&&!w.permission&&this.addLineItem(g,m,100,s)}})})}initBaseRoute(){let t=new Map(sl(this.lineMap));this.addFacilityToLineMap(100,100*this.lift_priority,3e4,t),this.baseRoute=new ro.default(t)}initEscalatorRoute(){let t=new Map(sl(this.lineMap)),e=1e4;this.addFacilityToLineMap(100,this.lift_priority*e,3e4*e,t),this.escalatorRoute=new ro.default(t)}initStraightLadderRoute(){let t=new Map(sl(this.lineMap)),e=1e4;this.addFacilityToLineMap(3*e,300,3e4*e,t),this.straightLadderRoute=new ro.default(t)}initForwardRoute(){this.rampMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Nn+o.start.id,c=""+o.end.floor+Nn+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(c);p&&h&&!p.permission&&!h.permission&&this.addLineItem(s,c,10,this.forwardLineMap)}})}),this.connectionPointMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Nn+o.start.id,c=""+o.end.floor+Nn+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(c);p&&h&&!p.permission&&!h.permission&&this.addLineItem(s,c,100,this.forwardLineMap)}})}),this.forwardRoute=new ro.default(this.forwardLineMap)}checkStart(t){return!(!t.floor||!t.routePointId&&!t.nodeId&&(!t.coord||t.coord.length<2))}checkEnd(t){return t.facility||t.parkingSpace&&t.floor?!0:this.checkStart(t)}transformStart(t,e,o){o===void 0&&(o={});var s;if(t.routePointId)return[{floor:t.floor,id:t.routePointId}];if(t.nodeId){let c=this.nodeMap.get(""+t.floor+Nn+t.nodeId);if(c!=null&&c.length)return c.map(p=>{let[h,g]=p.split(Nn);return{floor:h,id:g}})}if((s=t.coord)!=null&&s.length){let c=this.roadInfo.find(m=>m.floor===t.floor);if(!c)return null;let p=c.points.filter(m=>m.isStarted),h=c.points.filter(m=>{let _=""+m.floor+Nn+m.id;if(e==="forward"){if(!this.forwardLineMap.has(_)||o.adsorptionIntersection&&p.length&&!m.isStarted)return!1}else if(!this.lineMap.has(_))return!1;return!0});if(!h.length)return null;let g=h.reduce((m,_)=>{if(_.relatedId)return m;let w=Da(t.coord,_.cds);return w<m.min&&(m.min=w,m.point=_),m},{min:1/0,point:h[0]});return[{floor:c.floor,id:g.point.id}]}return null}transformEnd(t,e){if(t.routePointId&&t.floor)return[{floor:t.floor,id:t.routePointId}];if(t.floor){if(t.parkingSpace){let s=this.parkingMap.get(""+t.floor+Nn+t.parkingSpace);if(s)return[{floor:t.floor,id:s.id}]}let o=this.transformStart(t,e);if(o)return o}if(t.facility){let s=this.facilities.filter(c=>+c.type_id==+t.facility).map(c=>c.id).map(c=>this.facilityMap.get(""+c)).flat(2);if(s!=null&&s.length)return{floor:t.floor,facility:t.facility}}return null}getPath(t,e,o,s,c,p){if(o===void 0&&(o=""),p===void 0&&(p={}),!this.checkStart(t))return"start-error";if(!this.checkEnd(e))return"end-error";let h=this.transformStart(t,o,p);if(!h)return"no-start";let g=this.transformEnd(e,o);if(!g)return"no-end";let m=[];if(Array.isArray(g))for(let S=0;S<h.length;S++){let b=h[S];for(let T=0;T<g.length;T++){let R=g[T];if(b.floor===R.floor&&b.id===R.id)return"near"}}else{m=this.facilities.filter(b=>+b.type_id==+e.facility).map(b=>b.id).map(b=>this.facilityMap.get(""+b)).flat(2).filter(b=>b).filter(b=>g.floor?b.floor===g.floor:!0);for(let b=0;b<h.length;b++){let T=h[b];for(let R=0;R<m.length;R++){let x=m[R];if(T.floor===x.floor&&T.id===x.id)return"near"}}}let _;switch(o){case"escalator":_=this.getEscalatorPath.bind(this);break;case"straightLadder":_=this.getStraightLadderPath.bind(this);break;case"forward":_=this.getForwardPath.bind(this);break;default:_=this.getBasePath.bind(this);break}let w=null;return h.forEach(S=>{if(Array.isArray(g))g.forEach(b=>{let T=_(S,b,s,c);T&&T&&(!w||T[0].consume<w[0].consume)&&(w=T)});else{if(!m.length)return null;let b=m.map(T=>_(S,{floor:T.floor,id:T.id},s,c)).filter(T=>!!T);w=b.reduce((T,R)=>{let x=R[0].consume;return x<T.distance&&(T.distance=x,T.path=R),T},{distance:1/0,path:b[0]}).path}}),w}getRoutePath(t,e,o){let s=""+t.floor+Nn+t.id,c=this.pointMap.get(s),p=""+e.floor+Nn+e.id,h=this.pointMap.get(p);if(!c||!h)return null;let g=""+c.floor+Nn+(c.relatedId||c.id),m=""+h.floor+Nn+(h.relatedId||h.id),_=o.path(g,m);if(!_)return null;let w=[],S=_.reduce((b,T,R,x)=>{if(R===0)return 0;let E=x[R-1],I=o.graph.get(E).get(T);return b+I},0);return _.map(b=>{let T=this.pointMap.get(b);if(T){var R;let{floor:x}=T,E=T.type;if(this.isFacilityByType(T.type)){let I=this.facilities.find(C=>C.id===+T.targetId);I&&(E=I.entry_infra_type)}if(((R=w[w.length-1])==null?void 0:R.floor)===x){let I=w[w.length-1];I.points.push(T.cds),I.pointInfos.push(T),I.endType=E,I.destId=T.nodeId,I.distance=MN(I.points)}else w.push({floor:x,points:[T.cds],pointInfos:[T],endType:E,destId:T.nodeId,distance:0,consume:S})}}),w}getBasePath(t,e,o){if(!o)return this.getRoutePath(t,e,this.baseRoute);let s=sl(this.baseRoute.graph),c=h=>{this.addPermissionLineToMap(h,["","escalator","staircase","straightLadder","connectionPoint"],s,new Map([["escalator",100],["connectionPoint",100],["straightLadder",100*this.lift_priority],["staircase",3e4]]))};Array.isArray(o)?o.forEach(h=>{c(h)}):c(o);let p=new ro.default(s);return this.getRoutePath(t,e,p)}getEscalatorPath(t,e,o){if(!o)return this.getRoutePath(t,e,this.escalatorRoute);let s=sl(this.escalatorRoute.graph),c=1e4,p=g=>{this.addPermissionLineToMap(g,["","escalator","staircase","straightLadder","connectionPoint"],s,new Map([["escalator",100],["connectionPoint",100],["straightLadder",this.lift_priority*c],["staircase",3e4*c]]))};Array.isArray(o)?o.forEach(g=>{p(g)}):p(o);let h=new ro.default(s);return this.getRoutePath(t,e,h)}getStraightLadderPath(t,e,o){if(!o)return this.getRoutePath(t,e,this.straightLadderRoute);let s=sl(this.straightLadderRoute.graph),c=1e4,p=g=>{this.addPermissionLineToMap(g,["","escalator","staircase","straightLadder","connectionPoint"],s,new Map([["escalator",3*c],["connectionPoint",100],["straightLadder",300],["staircase",3e4*c]]))};Array.isArray(o)?o.forEach(g=>{p(g)}):p(o);let h=new ro.default(s);return this.getRoutePath(t,e,h)}getForwardPath(t,e,o,s){let c=new Map,p=b=>{let T=this.forwardRoute.graph.get(g);b.forEach(R=>{let x=T.get(R);(0,Uh.isNil)(x)||(c.set(R,x),T.delete(R))})},h=()=>{let b=this.forwardRoute.graph.get(g);c.forEach((T,R)=>{b.set(R,T)})},g=""+t.floor+Nn+t.id;if(!(0,Uh.isNil)(s)){let b=this.forwardLineMap.get(g),T=this.pointMap.get(g);if(T&&(b!=null&&b.size)&&b.size>1){let R=new ze(T.cds[0],T.cds[1]),x=new Map;b.forEach((I,C)=>{let F=this.pointMap.get(C);if(F){let V=new ze(F.cds[0],F.cds[1]),q=360-(new ze().subVectors(V,R).angle()/Math.PI*180-90+360)%360;x.set(C,q)}});let E=Array.from(x).filter(I=>{let[C,F]=I;return Math.abs(F-s)<=60}).map(I=>{let[C]=I;return C});if(E.length)E.forEach(I=>x.delete(I)),p([...x.keys()]);else{let I=Array.from(x).reduce((C,F)=>{let V=Math.abs(F[1]-s);return V<C.diff?{diff:V,key:F[0]}:C},{diff:1/0,key:""});x.delete(I.key),p([...x.keys()])}}}if(!o){let b=this.getRoutePath(t,e,this.forwardRoute);return h(),b||this.getRoutePath(t,e,this.forwardRoute)}let m=sl(this.forwardRoute.graph),_=b=>{this.addPermissionLineToMap(b,["","ramp"],m,new Map([["ramp",10]]))};Array.isArray(o)?o.forEach(b=>{_(b)}):_(o);let w=new ro.default(m),S=this.getRoutePath(t,e,w);if(h(),S)return S;{let b=sl(this.forwardRoute.graph);Array.isArray(o)?o.forEach(x=>{_(x)}):_(o);let T=new ro.default(b);return this.getRoutePath(t,e,T)}}clear(){this.roadInfo=[],this.pointMap.clear(),this.nodeMap.clear(),this.facilityMap.clear(),this.straightLadderMap.clear(),this.escalatorMap.clear(),this.staircaseMap.clear(),this.lineMap.clear(),this.baseRoute=new ro.default,this.escalatorRoute=new ro.default,this.straightLadderRoute=new ro.default}constructor(t=3){this.lift_priority=t,this.roadInfo=[],this.facilities=[],this.pointMap=new Map,this.nodeMap=new Map,this.facilityMap=new Map,this.straightLadderMap=new Map,this.escalatorMap=new Map,this.rampMap=new Map,this.staircaseMap=new Map,this.connectionPointMap=new Map,this.parkingMap=new Map,this.lineMap=new Map,this.weightPointMap=new Map,this.baseRoute=new ro.default,this.escalatorRoute=new ro.default,this.straightLadderRoute=new ro.default,this.forwardLineMap=new Map,this.forwardRoute=new ro.default}};var iwt=$e(kp(),1),owt=$e(Zp(),1);var mJ=$e(RN(),1);function yJ(n,t,e){let o=bN(n,t,e);return vJ(o)}function vJ(n){return 180-Math.abs(n)<15?"front":n>135?"right_front":n<-135?"left_front":n<=135&&n>=60?"right":n>=-135&&n<=-60?"left":n<60&&n>0?"right_back":n>-60&&n<0?"left_back":"front"}function LN(n){if(!n.length)return[];if(n.length===1)return[{direction:"start",distance:0,points:n}];let t=[{direction:"start",distance:Da(n[0],n[1]),points:[n[0],n[1]]}];for(let e=2;e<n.length;e++){let o=yJ(n[e-2],n[e-1],n[e]);if(o==="front"){let s=t[t.length-1],c=Da(n[e-1],n[e]);s.distance+=c,e!==2&&s.points.push(n[e-1])}else t.push({direction:o,distance:Da(n[e-1],n[e]),points:[n[e-1],n[e]]})}return t.push({direction:"end",distance:0,points:[n[n.length-1]]}),t}var mwt=$e(o2(),1),ywt=$e(Yp(),1),vwt=$e(Zp(),1);function s2(n){return n.replace(/[A-Z]/g,t=>"_"+t.toLowerCase()).replace(/^_/,"")}function a2(n){let t={};for(let o in n)o.startsWith("on")&&(t[s2(o.slice(2))]=n[o],t[o]=n[o]);let e=o=>dp(this,null,function*(){let{data:s}=o;if(t[s.type])try{let c=yield t[s.type](s.data);if(c!=null&&c.$transfer&&Array.isArray(c.$transfer)){let p=c.$transfer;delete c.$transfer,self.postMessage({type:""+s.type+"_result",key:s.key,data:c},p)}else self.postMessage({type:""+s.type+"_result",key:s.key,data:c})}catch(c){self.postMessage({type:""+s.type+"_result",key:s.key,error:c})}else self.postMessage({type:""+s.type+"_result",key:s.key,error:"no_event"})});return self.addEventListener("message",e),()=>{self.removeEventListener("message",e)}}var tm=new jg;a2({onSetLiftPriority(n){tm.setLiftPriority(n)},onSetRoadInfo(n){let{roadData:t,facilities:e}=n;tm.initRoute(t,e)},onGetPath(n){let{start:t,end:e,type:o,permission:s,travelDirection:c,options:p}=n;return tm.getPath(t,e,o,s,c,p)},onGetDirectionPath(n){return LN(n)},onClear(){tm.clear()}});
|