@aibee/crc-bmap 0.8.22 → 0.8.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/bmap.cjs.min.js +1 -1
- package/lib/bmap.esm.js +3 -0
- package/lib/bmap.esm.min.js +1 -1
- package/lib/bmap.min.js +1 -1
- package/package.json +1 -1
package/lib/bmap.cjs.min.js
CHANGED
|
@@ -7224,7 +7224,7 @@ void main() {
|
|
|
7224
7224
|
#include <fog_fragment>
|
|
7225
7225
|
}\`,ve={alphahash_fragment:ty,alphahash_pars_fragment:ey,alphamap_fragment:ny,alphamap_pars_fragment:ry,alphatest_fragment:iy,alphatest_pars_fragment:oy,aomap_fragment:sy,aomap_pars_fragment:ay,batching_pars_vertex:uy,batching_vertex:ly,begin_vertex:cy,beginnormal_vertex:hy,bsdfs:fy,iridescence_fragment:py,bumpmap_pars_fragment:dy,clipping_planes_fragment:my,clipping_planes_pars_fragment:gy,clipping_planes_pars_vertex:yy,clipping_planes_vertex:vy,color_fragment:_y,color_pars_fragment:xy,color_pars_vertex:Ey,color_vertex:My,common:wy,cube_uv_reflection_fragment:Sy,defaultnormal_vertex:by,displacementmap_pars_vertex:Ay,displacementmap_vertex:Ty,emissivemap_fragment:Cy,emissivemap_pars_fragment:Iy,colorspace_fragment:Py,colorspace_pars_fragment:Ry,envmap_fragment:Ny,envmap_common_pars_fragment:Ly,envmap_pars_fragment:Dy,envmap_pars_vertex:Oy,envmap_physical_pars_fragment:Xy,envmap_vertex:Fy,fog_vertex:Uy,fog_pars_vertex:By,fog_fragment:zy,fog_pars_fragment:ky,gradientmap_pars_fragment:Gy,lightmap_pars_fragment:Vy,lights_lambert_fragment:Hy,lights_lambert_pars_fragment:qy,lights_pars_begin:Wy,lights_toon_fragment:Yy,lights_toon_pars_fragment:$y,lights_phong_fragment:Zy,lights_phong_pars_fragment:Jy,lights_physical_fragment:Ky,lights_physical_pars_fragment:Qy,lights_fragment_begin:jy,lights_fragment_maps:tv,lights_fragment_end:ev,logdepthbuf_fragment:nv,logdepthbuf_pars_fragment:rv,logdepthbuf_pars_vertex:iv,logdepthbuf_vertex:ov,map_fragment:sv,map_pars_fragment:av,map_particle_fragment:uv,map_particle_pars_fragment:lv,metalnessmap_fragment:cv,metalnessmap_pars_fragment:hv,morphinstance_vertex:fv,morphcolor_vertex:pv,morphnormal_vertex:dv,morphtarget_pars_vertex:mv,morphtarget_vertex:gv,normal_fragment_begin:yv,normal_fragment_maps:vv,normal_pars_fragment:_v,normal_pars_vertex:xv,normal_vertex:Ev,normalmap_pars_fragment:Mv,clearcoat_normal_fragment_begin:wv,clearcoat_normal_fragment_maps:Sv,clearcoat_pars_fragment:bv,iridescence_pars_fragment:Av,opaque_fragment:Tv,packing:Cv,premultiplied_alpha_fragment:Iv,project_vertex:Pv,dithering_fragment:Rv,dithering_pars_fragment:Nv,roughnessmap_fragment:Lv,roughnessmap_pars_fragment:Dv,shadowmap_pars_fragment:Ov,shadowmap_pars_vertex:Fv,shadowmap_vertex:Uv,shadowmask_pars_fragment:Bv,skinbase_vertex:zv,skinning_pars_vertex:kv,skinning_vertex:Gv,skinnormal_vertex:Vv,specularmap_fragment:Hv,specularmap_pars_fragment:qv,tonemapping_fragment:Wv,tonemapping_pars_fragment:Xv,transmission_fragment:Yv,transmission_pars_fragment:$v,uv_pars_fragment:Zv,uv_pars_vertex:Jv,uv_vertex:Kv,worldpos_vertex:Qv,background_vert:jv,background_frag:t_,backgroundCube_vert:e_,backgroundCube_frag:n_,cube_vert:r_,cube_frag:i_,depth_vert:o_,depth_frag:s_,distanceRGBA_vert:a_,distanceRGBA_frag:u_,equirect_vert:l_,equirect_frag:c_,linedashed_vert:h_,linedashed_frag:f_,meshbasic_vert:p_,meshbasic_frag:d_,meshlambert_vert:m_,meshlambert_frag:g_,meshmatcap_vert:y_,meshmatcap_frag:v_,meshnormal_vert:__,meshnormal_frag:x_,meshphong_vert:E_,meshphong_frag:M_,meshphysical_vert:w_,meshphysical_frag:S_,meshtoon_vert:b_,meshtoon_frag:A_,points_vert:T_,points_frag:C_,shadow_vert:I_,shadow_frag:P_,sprite_vert:R_,sprite_frag:N_},ht={common:{diffuse:{value:new rr(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Dt},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Dt}},envmap:{envMap:{value:null},envMapRotation:{value:new Dt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Dt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Dt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Dt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Dt},normalScale:{value:new br(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Dt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Dt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Dt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Dt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new rr(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new rr(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new rr(16777215)},opacity:{value:1},center:{value:new br(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Dt},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0}}},qf={basic:{uniforms:Or([ht.common,ht.specularmap,ht.envmap,ht.aomap,ht.lightmap,ht.fog]),vertexShader:ve.meshbasic_vert,fragmentShader:ve.meshbasic_frag},lambert:{uniforms:Or([ht.common,ht.specularmap,ht.envmap,ht.aomap,ht.lightmap,ht.emissivemap,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.fog,ht.lights,{emissive:{value:new rr(0)}}]),vertexShader:ve.meshlambert_vert,fragmentShader:ve.meshlambert_frag},phong:{uniforms:Or([ht.common,ht.specularmap,ht.envmap,ht.aomap,ht.lightmap,ht.emissivemap,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.fog,ht.lights,{emissive:{value:new rr(0)},specular:{value:new rr(1118481)},shininess:{value:30}}]),vertexShader:ve.meshphong_vert,fragmentShader:ve.meshphong_frag},standard:{uniforms:Or([ht.common,ht.envmap,ht.aomap,ht.lightmap,ht.emissivemap,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.roughnessmap,ht.metalnessmap,ht.fog,ht.lights,{emissive:{value:new rr(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ve.meshphysical_vert,fragmentShader:ve.meshphysical_frag},toon:{uniforms:Or([ht.common,ht.aomap,ht.lightmap,ht.emissivemap,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.gradientmap,ht.fog,ht.lights,{emissive:{value:new rr(0)}}]),vertexShader:ve.meshtoon_vert,fragmentShader:ve.meshtoon_frag},matcap:{uniforms:Or([ht.common,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.fog,{matcap:{value:null}}]),vertexShader:ve.meshmatcap_vert,fragmentShader:ve.meshmatcap_frag},points:{uniforms:Or([ht.points,ht.fog]),vertexShader:ve.points_vert,fragmentShader:ve.points_frag},dashed:{uniforms:Or([ht.common,ht.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ve.linedashed_vert,fragmentShader:ve.linedashed_frag},depth:{uniforms:Or([ht.common,ht.displacementmap]),vertexShader:ve.depth_vert,fragmentShader:ve.depth_frag},normal:{uniforms:Or([ht.common,ht.bumpmap,ht.normalmap,ht.displacementmap,{opacity:{value:1}}]),vertexShader:ve.meshnormal_vert,fragmentShader:ve.meshnormal_frag},sprite:{uniforms:Or([ht.sprite,ht.fog]),vertexShader:ve.sprite_vert,fragmentShader:ve.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:ve.background_vert,fragmentShader:ve.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Dt}},vertexShader:ve.backgroundCube_vert,fragmentShader:ve.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ve.cube_vert,fragmentShader:ve.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ve.equirect_vert,fragmentShader:ve.equirect_frag},distanceRGBA:{uniforms:Or([ht.common,ht.displacementmap,{referencePosition:{value:new Pe},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ve.distanceRGBA_vert,fragmentShader:ve.distanceRGBA_frag},shadow:{uniforms:Or([ht.lights,ht.fog,{color:{value:new rr(0)},opacity:{value:1}}]),vertexShader:ve.shadow_vert,fragmentShader:ve.shadow_frag}};qf.physical={uniforms:Or([qf.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Dt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Dt},clearcoatNormalScale:{value:new br(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Dt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Dt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Dt},sheen:{value:0},sheenColor:{value:new rr(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Dt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Dt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Dt},transmissionSamplerSize:{value:new br},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Dt},attenuationDistance:{value:0},attenuationColor:{value:new rr(0)},specularColor:{value:new rr(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Dt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Dt},anisotropyVector:{value:new br},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Dt}}]),vertexShader:ve.meshphysical_vert,fragmentShader:ve.meshphysical_frag};var Oo=(1+Math.sqrt(5))/2,cs=1/Oo,bS=[new Pe(-Oo,cs,0),new Pe(Oo,cs,0),new Pe(-cs,0,Oo),new Pe(cs,0,Oo),new Pe(0,Oo,-cs),new Pe(0,Oo,cs),new Pe(-1,1,-1),new Pe(1,1,-1),new Pe(-1,1,1),new Pe(1,1,1)];var AS=new Float32Array(16),TS=new Float32Array(9),CS=new Float32Array(4);var IS={[gf]:yf,[vf]:Mf,[xf]:wf,[_f]:Ef,[yf]:gf,[Mf]:vf,[wf]:xf,[Ef]:_f};function za(o,e,r){return!o||!r&&o.constructor===e?o:typeof e.BYTES_PER_ELEMENT=="number"?new e(o):Array.prototype.slice.call(o)}function L_(o){return ArrayBuffer.isView(o)&&!(o instanceof DataView)}var fs=class{constructor(e,r,a,u){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=u!==void 0?u:new r.constructor(a),this.sampleValues=r,this.valueSize=a,this.settings=null,this.DefaultSettings_={}}evaluate(e){let r=this.parameterPositions,a=this._cachedIndex,u=r[a],c=r[a-1];n:{t:{let h;e:{r:if(!(e<u)){for(let p=a+2;;){if(u===void 0){if(e<c)break r;return a=r.length,this._cachedIndex=a,this.copySampleValue_(a-1)}if(a===p)break;if(c=u,u=r[++a],e<u)break t}h=r.length;break e}if(!(e>=c)){let p=r[1];e<p&&(a=2,c=p);for(let d=a-2;;){if(c===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(a===d)break;if(u=c,c=r[--a-1],e>=c)break t}h=a,a=0;break e}break n}for(;a<h;){let p=a+h>>>1;e<r[p]?h=p:a=p+1}if(u=r[a],c=r[a-1],c===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(u===void 0)return a=r.length,this._cachedIndex=a,this.copySampleValue_(a-1)}this._cachedIndex=a,this.intervalChanged_(a,c,u)}return this.interpolate_(a,c,e,u)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let r=this.resultBuffer,a=this.sampleValues,u=this.valueSize,c=e*u;for(let h=0;h!==u;++h)r[h]=a[c+h];return r}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},bl=class extends fs{constructor(e,r,a,u){super(e,r,a,u),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Af,endingEnd:Af}}intervalChanged_(e,r,a){let u=this.parameterPositions,c=e-2,h=e+1,p=u[c],d=u[h];if(p===void 0)switch(this.getSettings_().endingStart){case Tf:c=e,p=2*r-a;break;case Cf:c=u.length-2,p=r+u[c]-u[c+1];break;default:c=e,p=a}if(d===void 0)switch(this.getSettings_().endingEnd){case Tf:h=e,d=2*a-r;break;case Cf:h=1,d=a+u[1]-u[0];break;default:h=e-1,d=r}let g=(a-r)*.5,v=this.valueSize;this._weightPrev=g/(r-p),this._weightNext=g/(d-a),this._offsetPrev=c*v,this._offsetNext=h*v}interpolate_(e,r,a,u){let c=this.resultBuffer,h=this.sampleValues,p=this.valueSize,d=e*p,g=d-p,v=this._offsetPrev,x=this._offsetNext,M=this._weightPrev,w=this._weightNext,I=(a-r)/(u-r),D=I*I,b=D*I,T=-M*b+2*M*D-M*I,L=(1+M)*b+(-1.5-2*M)*D+(-.5+M)*I+1,P=(-1-w)*b+(1.5+w)*D+.5*I,z=w*b-w*D;for(let k=0;k!==p;++k)c[k]=T*h[v+k]+L*h[g+k]+P*h[d+k]+z*h[x+k];return c}},Al=class extends fs{constructor(e,r,a,u){super(e,r,a,u)}interpolate_(e,r,a,u){let c=this.resultBuffer,h=this.sampleValues,p=this.valueSize,d=e*p,g=d-p,v=(a-r)/(u-r),x=1-v;for(let M=0;M!==p;++M)c[M]=h[g+M]*x+h[d+M]*v;return c}},Tl=class extends fs{constructor(e,r,a,u){super(e,r,a,u)}interpolate_(e){return this.copySampleValue_(e-1)}},wi=class{constructor(e,r,a,u){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(r===void 0||r.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=za(r,this.TimeBufferType),this.values=za(a,this.ValueBufferType),this.setInterpolation(u||this.DefaultInterpolation)}static toJSON(e){let r=e.constructor,a;if(r.toJSON!==this.toJSON)a=r.toJSON(e);else{a={name:e.name,times:za(e.times,Array),values:za(e.values,Array)};let u=e.getInterpolation();u!==e.DefaultInterpolation&&(a.interpolation=u)}return a.type=e.ValueTypeName,a}InterpolantFactoryMethodDiscrete(e){return new Tl(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Al(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new bl(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let r;switch(e){case ka:r=this.InterpolantFactoryMethodDiscrete;break;case xl:r=this.InterpolantFactoryMethodLinear;break;case fl:r=this.InterpolantFactoryMethodSmooth;break}if(r===void 0){let a="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(a);return console.warn("THREE.KeyframeTrack:",a),this}return this.createInterpolant=r,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return ka;case this.InterpolantFactoryMethodLinear:return xl;case this.InterpolantFactoryMethodSmooth:return fl}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){let r=this.times;for(let a=0,u=r.length;a!==u;++a)r[a]+=e}return this}scale(e){if(e!==1){let r=this.times;for(let a=0,u=r.length;a!==u;++a)r[a]*=e}return this}trim(e,r){let a=this.times,u=a.length,c=0,h=u-1;for(;c!==u&&a[c]<e;)++c;for(;h!==-1&&a[h]>r;)--h;if(++h,c!==0||h!==u){c>=h&&(h=Math.max(h,1),c=h-1);let p=this.getValueSize();this.times=a.slice(c,h),this.values=this.values.slice(c*p,h*p)}return this}validate(){let e=!0,r=this.getValueSize();r-Math.floor(r)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let a=this.times,u=this.values,c=a.length;c===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let h=null;for(let p=0;p!==c;p++){let d=a[p];if(typeof d=="number"&&isNaN(d)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,p,d),e=!1;break}if(h!==null&&h>d){console.error("THREE.KeyframeTrack: Out of order keys.",this,p,d,h),e=!1;break}h=d}if(u!==void 0&&L_(u))for(let p=0,d=u.length;p!==d;++p){let g=u[p];if(isNaN(g)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,p,g),e=!1;break}}return e}optimize(){let e=this.times.slice(),r=this.values.slice(),a=this.getValueSize(),u=this.getInterpolation()===fl,c=e.length-1,h=1;for(let p=1;p<c;++p){let d=!1,g=e[p],v=e[p+1];if(g!==v&&(p!==1||g!==e[0]))if(u)d=!0;else{let x=p*a,M=x-a,w=x+a;for(let I=0;I!==a;++I){let D=r[x+I];if(D!==r[M+I]||D!==r[w+I]){d=!0;break}}}if(d){if(p!==h){e[h]=e[p];let x=p*a,M=h*a;for(let w=0;w!==a;++w)r[M+w]=r[x+w]}++h}}if(c>0){e[h]=e[c];for(let p=c*a,d=h*a,g=0;g!==a;++g)r[d+g]=r[p+g];++h}return h!==e.length?(this.times=e.slice(0,h),this.values=r.slice(0,h*a)):(this.times=e,this.values=r),this}clone(){let e=this.times.slice(),r=this.values.slice(),a=this.constructor,u=new a(this.name,e,r);return u.createInterpolant=this.createInterpolant,u}};wi.prototype.TimeBufferType=Float32Array;wi.prototype.ValueBufferType=Float32Array;wi.prototype.DefaultInterpolation=xl;var Fo=class extends wi{constructor(e,r,a){super(e,r,a)}};Fo.prototype.ValueTypeName="bool";Fo.prototype.ValueBufferType=Array;Fo.prototype.DefaultInterpolation=ka;Fo.prototype.InterpolantFactoryMethodLinear=void 0;Fo.prototype.InterpolantFactoryMethodSmooth=void 0;var Cl=class extends wi{};Cl.prototype.ValueTypeName="color";var Il=class extends wi{};Il.prototype.ValueTypeName="number";var Pl=class extends fs{constructor(e,r,a,u){super(e,r,a,u)}interpolate_(e,r,a,u){let c=this.resultBuffer,h=this.sampleValues,p=this.valueSize,d=(a-r)/(u-r),g=e*p;for(let v=g+p;g!==v;g+=4)mo.slerpFlat(c,0,h,g-p,h,g,d);return c}},Ha=class extends wi{InterpolantFactoryMethodLinear(e){return new Pl(this.times,this.values,this.getValueSize(),e)}};Ha.prototype.ValueTypeName="quaternion";Ha.prototype.InterpolantFactoryMethodSmooth=void 0;var Uo=class extends wi{constructor(e,r,a){super(e,r,a)}};Uo.prototype.ValueTypeName="string";Uo.prototype.ValueBufferType=Array;Uo.prototype.DefaultInterpolation=ka;Uo.prototype.InterpolantFactoryMethodLinear=void 0;Uo.prototype.InterpolantFactoryMethodSmooth=void 0;var Rl=class extends wi{};Rl.prototype.ValueTypeName="vector";var Nl=class{constructor(e,r,a){let u=this,c=!1,h=0,p=0,d,g=[];this.onStart=void 0,this.onLoad=e,this.onProgress=r,this.onError=a,this.itemStart=function(v){p++,c===!1&&u.onStart!==void 0&&u.onStart(v,h,p),c=!0},this.itemEnd=function(v){h++,u.onProgress!==void 0&&u.onProgress(v,h,p),h===p&&(c=!1,u.onLoad!==void 0&&u.onLoad())},this.itemError=function(v){u.onError!==void 0&&u.onError(v)},this.resolveURL=function(v){return d?d(v):v},this.setURLModifier=function(v){return d=v,this},this.addHandler=function(v,x){return g.push(v,x),this},this.removeHandler=function(v){let x=g.indexOf(v);return x!==-1&&g.splice(x,2),this},this.getHandler=function(v){for(let x=0,M=g.length;x<M;x+=2){let w=g[x],I=g[x+1];if(w.global&&(w.lastIndex=0),w.test(v))return I}return null}}},D_=new Nl,Ll=class{constructor(e){this.manager=e!==void 0?e:D_,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,r){let a=this;return new Promise(function(u,c){a.load(e,u,r,c)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}};Ll.DEFAULT_MATERIAL_NAME="__DEFAULT";var Ul="\\\\[\\\\]\\\\.:\\\\/",O_=new RegExp("["+Ul+"]","g"),Bl="[^"+Ul+"]",F_="[^"+Ul.replace("\\\\.","")+"]",U_=/((?:WC+[\\/:])*)/.source.replace("WC",Bl),B_=/(WCOD+)?/.source.replace("WCOD",F_),z_=/(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace("WC",Bl),k_=/\\.(WC+)(?:\\[(.+)\\])?/.source.replace("WC",Bl),G_=new RegExp("^"+U_+B_+z_+k_+"$"),V_=["material","materials","bones","map"],Dl=class{constructor(e,r,a){let u=a||on.parseTrackName(r);this._targetGroup=e,this._bindings=e.subscribe_(r,u)}getValue(e,r){this.bind();let a=this._targetGroup.nCachedObjects_,u=this._bindings[a];u!==void 0&&u.getValue(e,r)}setValue(e,r){let a=this._bindings;for(let u=this._targetGroup.nCachedObjects_,c=a.length;u!==c;++u)a[u].setValue(e,r)}bind(){let e=this._bindings;for(let r=this._targetGroup.nCachedObjects_,a=e.length;r!==a;++r)e[r].bind()}unbind(){let e=this._bindings;for(let r=this._targetGroup.nCachedObjects_,a=e.length;r!==a;++r)e[r].unbind()}},on=class o{constructor(e,r,a){this.path=r,this.parsedPath=a||o.parseTrackName(r),this.node=o.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,r,a){return e&&e.isAnimationObjectGroup?new o.Composite(e,r,a):new o(e,r,a)}static sanitizeNodeName(e){return e.replace(/\\s/g,"_").replace(O_,"")}static parseTrackName(e){let r=G_.exec(e);if(r===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let a={nodeName:r[2],objectName:r[3],objectIndex:r[4],propertyName:r[5],propertyIndex:r[6]},u=a.nodeName&&a.nodeName.lastIndexOf(".");if(u!==void 0&&u!==-1){let c=a.nodeName.substring(u+1);V_.indexOf(c)!==-1&&(a.nodeName=a.nodeName.substring(0,u),a.objectName=c)}if(a.propertyName===null||a.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return a}static findNode(e,r){if(r===void 0||r===""||r==="."||r===-1||r===e.name||r===e.uuid)return e;if(e.skeleton){let a=e.skeleton.getBoneByName(r);if(a!==void 0)return a}if(e.children){let a=function(c){for(let h=0;h<c.length;h++){let p=c[h];if(p.name===r||p.uuid===r)return p;let d=a(p.children);if(d)return d}return null},u=a(e.children);if(u)return u}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,r){e[r]=this.targetObject[this.propertyName]}_getValue_array(e,r){let a=this.resolvedProperty;for(let u=0,c=a.length;u!==c;++u)e[r++]=a[u]}_getValue_arrayElement(e,r){e[r]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,r){this.resolvedProperty.toArray(e,r)}_setValue_direct(e,r){this.targetObject[this.propertyName]=e[r]}_setValue_direct_setNeedsUpdate(e,r){this.targetObject[this.propertyName]=e[r],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,r){this.targetObject[this.propertyName]=e[r],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,r){let a=this.resolvedProperty;for(let u=0,c=a.length;u!==c;++u)a[u]=e[r++]}_setValue_array_setNeedsUpdate(e,r){let a=this.resolvedProperty;for(let u=0,c=a.length;u!==c;++u)a[u]=e[r++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,r){let a=this.resolvedProperty;for(let u=0,c=a.length;u!==c;++u)a[u]=e[r++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,r){this.resolvedProperty[this.propertyIndex]=e[r]}_setValue_arrayElement_setNeedsUpdate(e,r){this.resolvedProperty[this.propertyIndex]=e[r],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,r){this.resolvedProperty[this.propertyIndex]=e[r],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,r){this.resolvedProperty.fromArray(e,r)}_setValue_fromArray_setNeedsUpdate(e,r){this.resolvedProperty.fromArray(e,r),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,r){this.resolvedProperty.fromArray(e,r),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,r){this.bind(),this.getValue(e,r)}_setValue_unbound(e,r){this.bind(),this.setValue(e,r)}bind(){let e=this.node,r=this.parsedPath,a=r.objectName,u=r.propertyName,c=r.propertyIndex;if(e||(e=o.findNode(this.rootNode,r.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(a){let g=r.objectIndex;switch(a){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let v=0;v<e.length;v++)if(e[v].name===g){g=v;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[a]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[a]}if(g!==void 0){if(e[g]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[g]}}let h=e[u];if(h===void 0){let g=r.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+g+"."+u+" but it wasn't found.",e);return}let p=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?p=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(p=this.Versioning.MatrixWorldNeedsUpdate);let d=this.BindingType.Direct;if(c!==void 0){if(u==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[c]!==void 0&&(c=e.morphTargetDictionary[c])}d=this.BindingType.ArrayElement,this.resolvedProperty=h,this.propertyIndex=c}else h.fromArray!==void 0&&h.toArray!==void 0?(d=this.BindingType.HasFromToArray,this.resolvedProperty=h):Array.isArray(h)?(d=this.BindingType.EntireArray,this.resolvedProperty=h):this.propertyName=u;this.getValue=this.GetterByBindingType[d],this.setValue=this.SetterByBindingTypeAndVersioning[d][p]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};on.Composite=Dl;on.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};on.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};on.prototype.GetterByBindingType=[on.prototype._getValue_direct,on.prototype._getValue_array,on.prototype._getValue_arrayElement,on.prototype._getValue_toArray];on.prototype.SetterByBindingTypeAndVersioning=[[on.prototype._setValue_direct,on.prototype._setValue_direct_setNeedsUpdate,on.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[on.prototype._setValue_array,on.prototype._setValue_array_setNeedsUpdate,on.prototype._setValue_array_setMatrixWorldNeedsUpdate],[on.prototype._setValue_arrayElement,on.prototype._setValue_arrayElement_setNeedsUpdate,on.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[on.prototype._setValue_fromArray,on.prototype._setValue_fromArray_setNeedsUpdate,on.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var PS=new Float32Array(1);typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Wf}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Wf);var Xn=63710088e-1,NS={centimeters:Xn*100,centimetres:Xn*100,degrees:Xn/111325,feet:Xn*3.28084,inches:Xn*39.37,kilometers:Xn/1e3,kilometres:Xn/1e3,meters:Xn,metres:Xn,miles:Xn/1609.344,millimeters:Xn*1e3,millimetres:Xn*1e3,nauticalmiles:Xn/1852,radians:1,yards:Xn*1.0936},LS={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/Xn,yards:1.0936133};function Ar(o,e,r){r===void 0&&(r={});var a={type:"Feature"};return(r.id===0||r.id)&&(a.id=r.id),r.bbox&&(a.bbox=r.bbox),a.properties=e||{},a.geometry=o,a}function He(o,e,r){if(r===void 0&&(r={}),!o)throw new Error("coordinates is required");if(!Array.isArray(o))throw new Error("coordinates must be an Array");if(o.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Li(o[0])||!Li(o[1]))throw new Error("coordinates must contain numbers");var a={type:"Point",coordinates:o};return Ar(a,e,r)}function sn(o,e,r){r===void 0&&(r={});for(var a=0,u=o;a<u.length;a++){var c=u[a];if(c.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var h=0;h<c[c.length-1].length;h++)if(c[c.length-1][h]!==c[0][h])throw new Error("First and last Position are not equivalent.")}var p={type:"Polygon",coordinates:o};return Ar(p,e,r)}function Yn(o,e,r){if(r===void 0&&(r={}),o.length<2)throw new Error("coordinates must be an array of two or more positions");var a={type:"LineString",coordinates:o};return Ar(a,e,r)}function zl(o,e,r){r===void 0&&(r={});var a={type:"MultiPoint",coordinates:o};return Ar(a,e,r)}function Li(o){return!isNaN(o)&&o!==null&&!Array.isArray(o)}function Nn(o,e,r){if(o!==null)for(var a,u,c,h,p,d,g,v=0,x=0,M,w=o.type,I=w==="FeatureCollection",D=w==="Feature",b=I?o.features.length:1,T=0;T<b;T++){g=I?o.features[T].geometry:D?o.geometry:o,M=g?g.type==="GeometryCollection":!1,p=M?g.geometries.length:1;for(var L=0;L<p;L++){var P=0,z=0;if(h=M?g.geometries[L]:g,h!==null){d=h.coordinates;var k=h.type;switch(v=r&&(k==="Polygon"||k==="MultiPolygon")?1:0,k){case null:break;case"Point":if(e(d,x,T,P,z)===!1)return!1;x++,P++;break;case"LineString":case"MultiPoint":for(a=0;a<d.length;a++){if(e(d[a],x,T,P,z)===!1)return!1;x++,k==="MultiPoint"&&P++}k==="LineString"&&P++;break;case"Polygon":case"MultiLineString":for(a=0;a<d.length;a++){for(u=0;u<d[a].length-v;u++){if(e(d[a][u],x,T,P,z)===!1)return!1;x++}k==="MultiLineString"&&P++,k==="Polygon"&&z++}k==="Polygon"&&P++;break;case"MultiPolygon":for(a=0;a<d.length;a++){for(z=0,u=0;u<d[a].length;u++){for(c=0;c<d[a][u].length-v;c++){if(e(d[a][u][c],x,T,P,z)===!1)return!1;x++}z++}P++}break;case"GeometryCollection":for(a=0;a<h.geometries.length;a++)if(Nn(h.geometries[a],e,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Jf(o,e,r,a){var u=r;return Nn(o,function(c,h,p,d,g){h===0&&r===void 0?u=c:u=e(u,c,h,p,d,g)},a),u}function go(o,e){var r,a,u,c,h,p,d,g,v,x,M=0,w=o.type==="FeatureCollection",I=o.type==="Feature",D=w?o.features.length:1;for(r=0;r<D;r++){for(p=w?o.features[r].geometry:I?o.geometry:o,g=w?o.features[r].properties:I?o.properties:{},v=w?o.features[r].bbox:I?o.bbox:void 0,x=w?o.features[r].id:I?o.id:void 0,d=p?p.type==="GeometryCollection":!1,h=d?p.geometries.length:1,u=0;u<h;u++){if(c=d?p.geometries[u]:p,c===null){if(e(null,M,g,v,x)===!1)return!1;continue}switch(c.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(c,M,g,v,x)===!1)return!1;break}case"GeometryCollection":{for(a=0;a<c.geometries.length;a++)if(e(c.geometries[a],M,g,v,x)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}M++}}function Xr(o,e){go(o,function(r,a,u,c,h){var p=r===null?null:r.type;switch(p){case null:case"Point":case"LineString":case"Polygon":return e(Ar(r,u,{bbox:c,id:h}),a,0)===!1?!1:void 0}var d;switch(p){case"MultiPoint":d="Point";break;case"MultiLineString":d="LineString";break;case"MultiPolygon":d="Polygon";break}for(var g=0;g<r.coordinates.length;g++){var v=r.coordinates[g],x={type:d,coordinates:v};if(e(Ar(x,u),a,g)===!1)return!1}})}function kl(o){var e=[1/0,1/0,-1/0,-1/0];return Nn(o,function(r){e[0]>r[0]&&(e[0]=r[0]),e[1]>r[1]&&(e[1]=r[1]),e[2]<r[0]&&(e[2]=r[0]),e[3]<r[1]&&(e[3]=r[1])}),e}kl.default=kl;var Tr=kl;function ir(o){if(!o)throw new Error("coord is required");if(!Array.isArray(o)){if(o.type==="Feature"&&o.geometry!==null&&o.geometry.type==="Point")return o.geometry.coordinates;if(o.type==="Point")return o.coordinates}if(Array.isArray(o)&&o.length>=2&&!Array.isArray(o[0])&&!Array.isArray(o[1]))return o;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Gl(o,e,r){if(!o)throw new Error("No feature passed");if(!r)throw new Error(".featureOf() requires a name");if(!o||o.type!=="Feature"||!o.geometry)throw new Error("Invalid input to "+r+", Feature with geometry required");if(!o.geometry||o.geometry.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+o.geometry.type)}function or(o){return o.type==="Feature"?o.geometry:o}var J_=ln(qa(),1);var s1=ln(dp(),1);function $n(o,e,r){if(r===void 0&&(r={}),!o)throw new Error("point is required");if(!e)throw new Error("polygon is required");var a=ir(o),u=or(e),c=u.type,h=e.bbox,p=u.coordinates;if(h&&a1(a,h)===!1)return!1;c==="Polygon"&&(p=[p]);for(var d=!1,g=0;g<p.length&&!d;g++)if(mp(a,p[g][0],r.ignoreBoundary)){for(var v=!1,x=1;x<p[g].length&&!v;)mp(a,p[g][x],!r.ignoreBoundary)&&(v=!0),x++;v||(d=!0)}return d}function mp(o,e,r){var a=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var u=0,c=e.length-1;u<e.length;c=u++){var h=e[u][0],p=e[u][1],d=e[c][0],g=e[c][1],v=o[1]*(h-d)+p*(d-o[0])+g*(o[0]-h)===0&&(h-o[0])*(d-o[0])<=0&&(p-o[1])*(g-o[1])<=0;if(v)return!r;var x=p>o[1]!=g>o[1]&&o[0]<(d-h)*(o[1]-p)/(g-p)+h;x&&(a=!a)}return a}function a1(o,e){return e[0]<=o[0]&&e[1]<=o[1]&&e[2]>=o[0]&&e[3]>=o[1]}var vp=new ArrayBuffer(16),uA=new Float64Array(vp),lA=new Uint32Array(vp);var M1=ln(rc(),1);var OT=function(){function o(e){this.points=e.points||[],this.duration=e.duration||1e4,this.sharpness=e.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=e.stepLength||60,this.length=this.points.length,this.delay=0;for(var r=0;r<this.length;r++)this.points[r].z=this.points[r].z||0;for(var r=0;r<this.length-1;r++){var a=this.points[r],u=this.points[r+1];this.centers.push({x:(a.x+u.x)/2,y:(a.y+u.y)/2,z:(a.z+u.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var r=0;r<this.centers.length-1;r++){var c=this.points[r+1].x-(this.centers[r].x+this.centers[r+1].x)/2,h=this.points[r+1].y-(this.centers[r].y+this.centers[r+1].y)/2,p=this.points[r+1].z-(this.centers[r].y+this.centers[r+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[r+1].x+this.sharpness*(this.centers[r].x+c),y:(1-this.sharpness)*this.points[r+1].y+this.sharpness*(this.centers[r].y+h),z:(1-this.sharpness)*this.points[r+1].z+this.sharpness*(this.centers[r].z+p)},{x:(1-this.sharpness)*this.points[r+1].x+this.sharpness*(this.centers[r+1].x+c),y:(1-this.sharpness)*this.points[r+1].y+this.sharpness*(this.centers[r+1].y+h),z:(1-this.sharpness)*this.points[r+1].z+this.sharpness*(this.centers[r+1].z+p)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}return o.prototype.cacheSteps=function(e){var r=[],a=this.pos(0);r.push(0);for(var u=0;u<this.duration;u+=10){var c=this.pos(u),h=Math.sqrt((c.x-a.x)*(c.x-a.x)+(c.y-a.y)*(c.y-a.y)+(c.z-a.z)*(c.z-a.z));h>e&&(r.push(u),a=c)}return r},o.prototype.vector=function(e){var r=this.pos(e+10),a=this.pos(e-10);return{angle:180*Math.atan2(r.y-a.y,r.x-a.x)/3.14,speed:Math.sqrt((a.x-r.x)*(a.x-r.x)+(a.y-r.y)*(a.y-r.y)+(a.z-r.z)*(a.z-r.z))}},o.prototype.pos=function(e){var r=e-this.delay;r<0&&(r=0),r>this.duration&&(r=this.duration-1);var a=r/this.duration;if(a>=1)return this.points[this.length-1];var u=Math.floor((this.points.length-1)*a),c=(this.length-1)*a-u;return w1(c,this.points[u],this.controls[u][1],this.controls[u+1][0],this.points[u+1])},o}();function w1(o,e,r,a,u){var c=S1(o),h={x:u.x*c[0]+a.x*c[1]+r.x*c[2]+e.x*c[3],y:u.y*c[0]+a.y*c[1]+r.y*c[2]+e.y*c[3],z:u.z*c[0]+a.z*c[1]+r.z*c[2]+e.z*c[3]};return h}function S1(o){var e=o*o,r=e*o;return[r,3*e*(1-o),3*o*(1-o)*(1-o),(1-o)*(1-o)*(1-o)]}function oa(o,e){e===void 0&&(e={});var r=Number(o[0]),a=Number(o[1]),u=Number(o[2]),c=Number(o[3]);if(o.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var h=[r,a],p=[r,c],d=[u,c],g=[u,a];return sn([[h,g,d,p,h]],e.properties,{bbox:o,id:e.id})}function b1(o){return oa(Tr(o))}var ic=b1;var V1=ln(Ip(),1);var mx=ln(au(),1);var yx=ln(qa(),1);var xx=ln(rc(),1);var Yp=Math.PI/180,$p=180/Math.PI,fa=function(o,e){this.lon=o,this.lat=e,this.x=Yp*o,this.y=Yp*e};fa.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)};fa.prototype.antipode=function(){var o=-1*this.lat,e=this.lon<0?180+this.lon:(180-this.lon)*-1;return new fa(e,o)};var Zp=function(){this.coords=[],this.length=0};Zp.prototype.move_to=function(o){this.length++,this.coords.push(o)};var Sc=function(o){this.properties=o||{},this.geometries=[]};Sc.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 o=[],e=0;e<this.geometries.length;e++)o.push(this.geometries[e].coords);return{geometry:{type:"MultiLineString",coordinates:o},type:"Feature",properties:this.properties}};Sc.prototype.wkt=function(){for(var o="",e="LINESTRING(",r=function(c){e+=c[0]+" "+c[1]+","},a=0;a<this.geometries.length;a++){if(this.geometries[a].coords.length===0)return"LINESTRING(empty)";var u=this.geometries[a].coords;u.forEach(r),o+=e.substring(0,e.length-1)+")"}return o};var Jp=function(o,e,r){if(!o||o.x===void 0||o.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!e||e.x===void 0||e.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new fa(o.x,o.y),this.end=new fa(e.x,e.y),this.properties=r||{};var a=this.start.x-this.end.x,u=this.start.y-this.end.y,c=Math.pow(Math.sin(u/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(a/2),2);if(this.g=2*Math.asin(Math.sqrt(c)),this.g===Math.PI)throw new Error("it appears "+o.view()+" and "+e.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 "+o+" and "+e)};Jp.prototype.interpolate=function(o){var e=Math.sin((1-o)*this.g)/Math.sin(this.g),r=Math.sin(o*this.g)/Math.sin(this.g),a=e*Math.cos(this.start.y)*Math.cos(this.start.x)+r*Math.cos(this.end.y)*Math.cos(this.end.x),u=e*Math.cos(this.start.y)*Math.sin(this.start.x)+r*Math.cos(this.end.y)*Math.sin(this.end.x),c=e*Math.sin(this.start.y)+r*Math.sin(this.end.y),h=$p*Math.atan2(c,Math.sqrt(Math.pow(a,2)+Math.pow(u,2))),p=$p*Math.atan2(u,a);return[p,h]};Jp.prototype.Arc=function(o,e){var r=[];if(!o||o<=2)r.push([this.start.lon,this.start.lat]),r.push([this.end.lon,this.end.lat]);else for(var a=1/(o-1),u=0;u<o;++u){var c=a*u,h=this.interpolate(c);r.push(h)}for(var p=!1,d=0,g=e&&e.offset?e.offset:10,v=180-g,x=-180+g,M=360-g,w=1;w<r.length;++w){var I=r[w-1][0],D=r[w][0],b=Math.abs(D-I);b>M&&(D>v&&I<x||I>v&&D<x)?p=!0:b>d&&(d=b)}var T=[];if(p&&d<g){var L=[];T.push(L);for(var P=0;P<r.length;++P){var z=parseFloat(r[P][0]);if(P>0&&Math.abs(z-r[P-1][0])>M){var k=parseFloat(r[P-1][0]),Y=parseFloat(r[P-1][1]),q=parseFloat(r[P][0]),C=parseFloat(r[P][1]);if(k>-180&&k<x&&q===180&&P+1<r.length&&r[P-1][0]>-180&&r[P-1][0]<x){L.push([-180,r[P][1]]),P++,L.push([r[P][0],r[P][1]]);continue}else if(k>v&&k<180&&q===-180&&P+1<r.length&&r[P-1][0]>v&&r[P-1][0]<180){L.push([180,r[P][1]]),P++,L.push([r[P][0],r[P][1]]);continue}if(k<x&&q>v){var ot=k;k=q,q=ot;var pt=Y;Y=C,C=pt}if(k>v&&q<x&&(q+=360),k<=180&&q>=180&&k<q){var dt=(180-k)/(q-k),F=dt*C+(1-dt)*Y;L.push([r[P-1][0]>v?180:-180,F]),L=[],L.push([r[P-1][0]>v?-180:180,F]),T.push(L)}else L=[],T.push(L);L.push([z,r[P][1]])}else L.push([r[P][0],r[P][1]])}}else{var ye=[];T.push(ye);for(var et=0;et<r.length;++et)ye.push([r[et][0],r[et][1]])}for(var St=new Sc(this.properties),Pt=0;Pt<T.length;++Pt){var Rt=new Zp;St.geometries.push(Rt);for(var it=T[Pt],mt=0;mt<it.length;++mt)Rt.move_to(it[mt])}return St};var wx=ln(au(),1);var nM=ln(au(),1);var rM=ln(Xc(),1);var sM=ln(qa(),1);var Ot=[],Ft=[],Ut=[],Bt=[],zt=[],kt=[],Gt=[],Vt=[],Ht=[],qt=[],Wt=[],Xt=[],Yt=[],$t=[],Zt=[],Jt=[],Kt=[],Qt=[],jt=[],te=[],ee=[],ne=[],re=[],ie=[];Gt[85]=qt[85]=-1;Vt[85]=Wt[85]=0;Ht[85]=Xt[85]=1;jt[85]=ne[85]=1;te[85]=re[85]=0;ee[85]=ie[85]=1;Ot[85]=Bt[85]=0;Ft[85]=zt[85]=-1;Ut[85]=Zt[85]=0;Jt[85]=Yt[85]=0;Kt[85]=$t[85]=1;kt[85]=Qt[85]=1;ne[1]=ne[169]=0;re[1]=re[169]=-1;ie[1]=ie[169]=0;Yt[1]=Yt[169]=-1;$t[1]=$t[169]=0;Zt[1]=Zt[169]=0;qt[4]=qt[166]=0;Wt[4]=Wt[166]=-1;Xt[4]=Xt[166]=1;Jt[4]=Jt[166]=1;Kt[4]=Kt[166]=0;Qt[4]=Qt[166]=0;Gt[16]=Gt[154]=0;Vt[16]=Vt[154]=1;Ht[16]=Ht[154]=1;Bt[16]=Bt[154]=1;zt[16]=zt[154]=0;kt[16]=kt[154]=1;jt[64]=jt[106]=0;te[64]=te[106]=1;ee[64]=ee[106]=0;Ot[64]=Ot[106]=-1;Ft[64]=Ft[106]=0;Ut[64]=Ut[106]=1;jt[2]=jt[168]=0;te[2]=te[168]=-1;ee[2]=ee[168]=1;ne[2]=ne[168]=0;re[2]=re[168]=-1;ie[2]=ie[168]=0;Yt[2]=Yt[168]=-1;$t[2]=$t[168]=0;Zt[2]=Zt[168]=0;Jt[2]=Jt[168]=-1;Kt[2]=Kt[168]=0;Qt[2]=Qt[168]=1;Gt[8]=Gt[162]=0;Vt[8]=Vt[162]=-1;Ht[8]=Ht[162]=0;qt[8]=qt[162]=0;Wt[8]=Wt[162]=-1;Xt[8]=Xt[162]=1;Yt[8]=Yt[162]=1;$t[8]=$t[162]=0;Zt[8]=Zt[162]=1;Jt[8]=Jt[162]=1;Kt[8]=Kt[162]=0;Qt[8]=Qt[162]=0;Gt[32]=Gt[138]=0;Vt[32]=Vt[138]=1;Ht[32]=Ht[138]=1;qt[32]=qt[138]=0;Wt[32]=Wt[138]=1;Xt[32]=Xt[138]=0;Ot[32]=Ot[138]=1;Ft[32]=Ft[138]=0;Ut[32]=Ut[138]=0;Bt[32]=Bt[138]=1;zt[32]=zt[138]=0;kt[32]=kt[138]=1;ne[128]=ne[42]=0;re[128]=re[42]=1;ie[128]=ie[42]=1;jt[128]=jt[42]=0;te[128]=te[42]=1;ee[128]=ee[42]=0;Ot[128]=Ot[42]=-1;Ft[128]=Ft[42]=0;Ut[128]=Ut[42]=1;Bt[128]=Bt[42]=-1;zt[128]=zt[42]=0;kt[128]=kt[42]=0;qt[5]=qt[165]=-1;Wt[5]=Wt[165]=0;Xt[5]=Xt[165]=0;ne[5]=ne[165]=1;re[5]=re[165]=0;ie[5]=ie[165]=0;Jt[20]=Jt[150]=0;Kt[20]=Kt[150]=1;Qt[20]=Qt[150]=1;Bt[20]=Bt[150]=0;zt[20]=zt[150]=-1;kt[20]=kt[150]=1;Gt[80]=Gt[90]=-1;Vt[80]=Vt[90]=0;Ht[80]=Ht[90]=1;jt[80]=jt[90]=1;te[80]=te[90]=0;ee[80]=ee[90]=1;Yt[65]=Yt[105]=0;$t[65]=$t[105]=1;Zt[65]=Zt[105]=0;Ot[65]=Ot[105]=0;Ft[65]=Ft[105]=-1;Ut[65]=Ut[105]=0;Gt[160]=Gt[10]=-1;Vt[160]=Vt[10]=0;Ht[160]=Ht[10]=1;qt[160]=qt[10]=-1;Wt[160]=Wt[10]=0;Xt[160]=Xt[10]=0;ne[160]=ne[10]=1;re[160]=re[10]=0;ie[160]=ie[10]=0;jt[160]=jt[10]=1;te[160]=te[10]=0;ee[160]=ee[10]=1;Jt[130]=Jt[40]=0;Kt[130]=Kt[40]=1;Qt[130]=Qt[40]=1;Yt[130]=Yt[40]=0;$t[130]=$t[40]=1;Zt[130]=Zt[40]=0;Ot[130]=Ot[40]=0;Ft[130]=Ft[40]=-1;Ut[130]=Ut[40]=0;Bt[130]=Bt[40]=0;zt[130]=zt[40]=-1;kt[130]=kt[40]=1;qt[37]=qt[133]=0;Wt[37]=Wt[133]=1;Xt[37]=Xt[133]=1;ne[37]=ne[133]=0;re[37]=re[133]=1;ie[37]=ie[133]=0;Ot[37]=Ot[133]=-1;Ft[37]=Ft[133]=0;Ut[37]=Ut[133]=0;Bt[37]=Bt[133]=1;zt[37]=zt[133]=0;kt[37]=kt[133]=0;Jt[148]=Jt[22]=-1;Kt[148]=Kt[22]=0;Qt[148]=Qt[22]=0;ne[148]=ne[22]=0;re[148]=re[22]=-1;ie[148]=ie[22]=1;jt[148]=jt[22]=0;te[148]=te[22]=1;ee[148]=ee[22]=1;Bt[148]=Bt[22]=-1;zt[148]=zt[22]=0;kt[148]=kt[22]=1;Gt[82]=Gt[88]=0;Vt[82]=Vt[88]=-1;Ht[82]=Ht[88]=1;Jt[82]=Jt[88]=1;Kt[82]=Kt[88]=0;Qt[82]=Qt[88]=1;Yt[82]=Yt[88]=-1;$t[82]=$t[88]=0;Zt[82]=Zt[88]=1;jt[82]=jt[88]=0;te[82]=te[88]=-1;ee[82]=ee[88]=0;Gt[73]=Gt[97]=0;Vt[73]=Vt[97]=1;Ht[73]=Ht[97]=0;qt[73]=qt[97]=0;Wt[73]=Wt[97]=-1;Xt[73]=Xt[97]=0;Yt[73]=Yt[97]=1;$t[73]=$t[97]=0;Zt[73]=Zt[97]=0;Ot[73]=Ot[97]=1;Ft[73]=Ft[97]=0;Ut[73]=Ut[97]=1;Gt[145]=Gt[25]=0;Vt[145]=Vt[25]=-1;Ht[145]=Ht[25]=0;Yt[145]=Yt[25]=1;$t[145]=$t[25]=0;Zt[145]=Zt[25]=1;ne[145]=ne[25]=0;re[145]=re[25]=1;ie[145]=ie[25]=1;Bt[145]=Bt[25]=-1;zt[145]=zt[25]=0;kt[145]=kt[25]=0;qt[70]=qt[100]=0;Wt[70]=Wt[100]=1;Xt[70]=Xt[100]=0;Jt[70]=Jt[100]=-1;Kt[70]=Kt[100]=0;Qt[70]=Qt[100]=1;jt[70]=jt[100]=0;te[70]=te[100]=-1;ee[70]=ee[100]=1;Ot[70]=Ot[100]=1;Ft[70]=Ft[100]=0;Ut[70]=Ut[100]=0;qt[101]=qt[69]=0;Wt[101]=Wt[69]=1;Xt[101]=Xt[69]=0;Ot[101]=Ot[69]=1;Ft[101]=Ft[69]=0;Ut[101]=Ut[69]=0;ne[149]=ne[21]=0;re[149]=re[21]=1;ie[149]=ie[21]=1;Bt[149]=Bt[21]=-1;zt[149]=zt[21]=0;kt[149]=kt[21]=0;Jt[86]=Jt[84]=-1;Kt[86]=Kt[84]=0;Qt[86]=Qt[84]=1;jt[86]=jt[84]=0;te[86]=te[84]=-1;ee[86]=ee[84]=1;Gt[89]=Gt[81]=0;Vt[89]=Vt[81]=-1;Ht[89]=Ht[81]=0;Yt[89]=Yt[81]=1;$t[89]=$t[81]=0;Zt[89]=Zt[81]=1;Gt[96]=Gt[74]=0;Vt[96]=Vt[74]=1;Ht[96]=Ht[74]=0;qt[96]=qt[74]=-1;Wt[96]=Wt[74]=0;Xt[96]=Xt[74]=1;jt[96]=jt[74]=1;te[96]=te[74]=0;ee[96]=ee[74]=0;Ot[96]=Ot[74]=1;Ft[96]=Ft[74]=0;Ut[96]=Ut[74]=1;Gt[24]=Gt[146]=0;Vt[24]=Vt[146]=-1;Ht[24]=Ht[146]=1;Jt[24]=Jt[146]=1;Kt[24]=Kt[146]=0;Qt[24]=Qt[146]=1;Yt[24]=Yt[146]=0;$t[24]=$t[146]=1;Zt[24]=Zt[146]=1;Bt[24]=Bt[146]=0;zt[24]=zt[146]=-1;kt[24]=kt[146]=0;qt[6]=qt[164]=-1;Wt[6]=Wt[164]=0;Xt[6]=Xt[164]=1;Jt[6]=Jt[164]=-1;Kt[6]=Kt[164]=0;Qt[6]=Qt[164]=0;ne[6]=ne[164]=0;re[6]=re[164]=-1;ie[6]=ie[164]=1;jt[6]=jt[164]=1;te[6]=te[164]=0;ee[6]=ee[164]=0;Yt[129]=Yt[41]=0;$t[129]=$t[41]=1;Zt[129]=Zt[41]=1;ne[129]=ne[41]=0;re[129]=re[41]=1;ie[129]=ie[41]=0;Ot[129]=Ot[41]=-1;Ft[129]=Ft[41]=0;Ut[129]=Ut[41]=0;Bt[129]=Bt[41]=0;zt[129]=zt[41]=-1;kt[129]=kt[41]=0;Jt[66]=Jt[104]=0;Kt[66]=Kt[104]=1;Qt[66]=Qt[104]=0;Yt[66]=Yt[104]=-1;$t[66]=$t[104]=0;Zt[66]=Zt[104]=1;jt[66]=jt[104]=0;te[66]=te[104]=-1;ee[66]=ee[104]=0;Ot[66]=Ot[104]=0;Ft[66]=Ft[104]=-1;Ut[66]=Ut[104]=1;Gt[144]=Gt[26]=-1;Vt[144]=Vt[26]=0;Ht[144]=Ht[26]=0;ne[144]=ne[26]=1;re[144]=re[26]=0;ie[144]=ie[26]=1;jt[144]=jt[26]=0;te[144]=te[26]=1;ee[144]=ee[26]=1;Bt[144]=Bt[26]=-1;zt[144]=zt[26]=0;kt[144]=kt[26]=1;qt[36]=qt[134]=0;Wt[36]=Wt[134]=1;Xt[36]=Xt[134]=1;Jt[36]=Jt[134]=0;Kt[36]=Kt[134]=1;Qt[36]=Qt[134]=0;Ot[36]=Ot[134]=0;Ft[36]=Ft[134]=-1;Ut[36]=Ut[134]=1;Bt[36]=Bt[134]=1;zt[36]=zt[134]=0;kt[36]=kt[134]=0;Gt[9]=Gt[161]=-1;Vt[9]=Vt[161]=0;Ht[9]=Ht[161]=0;qt[9]=qt[161]=0;Wt[9]=Wt[161]=-1;Xt[9]=Xt[161]=0;Yt[9]=Yt[161]=1;$t[9]=$t[161]=0;Zt[9]=Zt[161]=0;ne[9]=ne[161]=1;re[9]=re[161]=0;ie[9]=ie[161]=1;Gt[136]=0;Vt[136]=1;Ht[136]=1;qt[136]=0;Wt[136]=1;Xt[136]=0;Jt[136]=-1;Kt[136]=0;Qt[136]=1;Yt[136]=-1;$t[136]=0;Zt[136]=0;ne[136]=0;re[136]=-1;ie[136]=0;jt[136]=0;te[136]=-1;ee[136]=1;Ot[136]=1;Ft[136]=0;Ut[136]=0;Bt[136]=1;zt[136]=0;kt[136]=1;Gt[34]=0;Vt[34]=-1;Ht[34]=0;qt[34]=0;Wt[34]=-1;Xt[34]=1;Jt[34]=1;Kt[34]=0;Qt[34]=0;Yt[34]=1;$t[34]=0;Zt[34]=1;ne[34]=0;re[34]=1;ie[34]=1;jt[34]=0;te[34]=1;ee[34]=0;Ot[34]=-1;Ft[34]=0;Ut[34]=1;Bt[34]=-1;zt[34]=0;kt[34]=0;Gt[35]=0;Vt[35]=1;Ht[35]=1;qt[35]=0;Wt[35]=-1;Xt[35]=1;Jt[35]=1;Kt[35]=0;Qt[35]=0;Yt[35]=-1;$t[35]=0;Zt[35]=0;ne[35]=0;re[35]=-1;ie[35]=0;jt[35]=0;te[35]=1;ee[35]=0;Ot[35]=-1;Ft[35]=0;Ut[35]=1;Bt[35]=1;zt[35]=0;kt[35]=1;Gt[153]=0;Vt[153]=1;Ht[153]=1;Yt[153]=-1;$t[153]=0;Zt[153]=0;ne[153]=0;re[153]=-1;ie[153]=0;Bt[153]=1;zt[153]=0;kt[153]=1;qt[102]=0;Wt[102]=-1;Xt[102]=1;Jt[102]=1;Kt[102]=0;Qt[102]=0;jt[102]=0;te[102]=1;ee[102]=0;Ot[102]=-1;Ft[102]=0;Ut[102]=1;Gt[155]=0;Vt[155]=-1;Ht[155]=0;Yt[155]=1;$t[155]=0;Zt[155]=1;ne[155]=0;re[155]=1;ie[155]=1;Bt[155]=-1;zt[155]=0;kt[155]=0;qt[103]=0;Wt[103]=1;Xt[103]=0;Jt[103]=-1;Kt[103]=0;Qt[103]=1;jt[103]=0;te[103]=-1;ee[103]=1;Ot[103]=1;Ft[103]=0;Ut[103]=0;Gt[152]=0;Vt[152]=1;Ht[152]=1;Jt[152]=-1;Kt[152]=0;Qt[152]=1;Yt[152]=-1;$t[152]=0;Zt[152]=0;ne[152]=0;re[152]=-1;ie[152]=0;jt[152]=0;te[152]=-1;ee[152]=1;Bt[152]=1;zt[152]=0;kt[152]=1;Gt[156]=0;Vt[156]=-1;Ht[156]=1;Jt[156]=1;Kt[156]=0;Qt[156]=1;Yt[156]=-1;$t[156]=0;Zt[156]=0;ne[156]=0;re[156]=-1;ie[156]=0;jt[156]=0;te[156]=1;ee[156]=1;Bt[156]=-1;zt[156]=0;kt[156]=1;Gt[137]=0;Vt[137]=1;Ht[137]=1;qt[137]=0;Wt[137]=1;Xt[137]=0;Yt[137]=-1;$t[137]=0;Zt[137]=0;ne[137]=0;re[137]=-1;ie[137]=0;Ot[137]=1;Ft[137]=0;Ut[137]=0;Bt[137]=1;zt[137]=0;kt[137]=1;Gt[139]=0;Vt[139]=1;Ht[139]=1;qt[139]=0;Wt[139]=-1;Xt[139]=0;Yt[139]=1;$t[139]=0;Zt[139]=0;ne[139]=0;re[139]=1;ie[139]=0;Ot[139]=-1;Ft[139]=0;Ut[139]=0;Bt[139]=1;zt[139]=0;kt[139]=1;Gt[98]=0;Vt[98]=-1;Ht[98]=0;qt[98]=0;Wt[98]=-1;Xt[98]=1;Jt[98]=1;Kt[98]=0;Qt[98]=0;Yt[98]=1;$t[98]=0;Zt[98]=1;jt[98]=0;te[98]=1;ee[98]=0;Ot[98]=-1;Ft[98]=0;Ut[98]=1;Gt[99]=0;Vt[99]=1;Ht[99]=0;qt[99]=0;Wt[99]=-1;Xt[99]=1;Jt[99]=1;Kt[99]=0;Qt[99]=0;Yt[99]=-1;$t[99]=0;Zt[99]=1;jt[99]=0;te[99]=-1;ee[99]=0;Ot[99]=1;Ft[99]=0;Ut[99]=1;qt[38]=0;Wt[38]=-1;Xt[38]=1;Jt[38]=1;Kt[38]=0;Qt[38]=0;ne[38]=0;re[38]=1;ie[38]=1;jt[38]=0;te[38]=1;ee[38]=0;Ot[38]=-1;Ft[38]=0;Ut[38]=1;Bt[38]=-1;zt[38]=0;kt[38]=0;qt[39]=0;Wt[39]=1;Xt[39]=1;Jt[39]=-1;Kt[39]=0;Qt[39]=0;ne[39]=0;re[39]=-1;ie[39]=1;jt[39]=0;te[39]=1;ee[39]=0;Ot[39]=-1;Ft[39]=0;Ut[39]=1;Bt[39]=1;zt[39]=0;kt[39]=0;var Yc=function(o){return[[o.bottomleft,0],[0,0],[0,o.leftbottom]]},$c=function(o){return[[1,o.rightbottom],[1,0],[o.bottomright,0]]},Zc=function(o){return[[o.topright,1],[1,1],[1,o.righttop]]},Jc=function(o){return[[0,o.lefttop],[0,1],[o.topleft,1]]},Kc=function(o){return[[o.bottomright,0],[o.bottomleft,0],[0,o.leftbottom],[0,o.lefttop]]},Qc=function(o){return[[o.bottomright,0],[o.bottomleft,0],[1,o.righttop],[1,o.rightbottom]]},jc=function(o){return[[1,o.righttop],[1,o.rightbottom],[o.topleft,1],[o.topright,1]]},th=function(o){return[[0,o.leftbottom],[0,o.lefttop],[o.topleft,1],[o.topright,1]]},aM=function(o){return[[0,0],[0,o.leftbottom],[1,o.rightbottom],[1,0]]},uM=function(o){return[[1,0],[o.bottomright,0],[o.topright,1],[1,1]]},lM=function(o){return[[1,1],[1,o.righttop],[0,o.lefttop],[0,1]]},cM=function(o){return[[o.bottomleft,0],[0,0],[0,1],[o.topleft,1]]},hM=function(o){return[[1,o.righttop],[1,o.rightbottom],[0,o.leftbottom],[0,o.lefttop]]},fM=function(o){return[[o.topleft,1],[o.topright,1],[o.bottomright,0],[o.bottomleft,0]]},pM=function(){return[[0,0],[0,1],[1,1],[1,0]]},dM=function(o){return[[1,o.rightbottom],[1,0],[0,0],[0,1],[o.topleft,1]]},mM=function(o){return[[o.topright,1],[1,1],[1,0],[0,0],[0,o.leftbottom]]},gM=function(o){return[[1,0],[o.bottomright,0],[0,o.lefttop],[0,1],[1,1]]},yM=function(o){return[[1,1],[1,o.righttop],[o.bottomleft,0],[0,0],[0,1]]},vM=function(o){return[[1,o.righttop],[1,o.rightbottom],[0,o.lefttop],[0,1],[o.topleft,1]]},_M=function(o){return[[1,1],[1,o.righttop],[o.bottomright,0],[o.bottomleft,0],[o.topright,1]]},xM=function(o){return[[1,o.rightbottom],[1,0],[o.bottomright,0],[0,o.leftbottom],[0,o.lefttop]]},EM=function(o){return[[o.topright,1],[o.bottomleft,0],[0,0],[0,o.leftbottom],[o.topleft,1]]},MM=function(o){return[[o.bottomright,0],[o.bottomleft,0],[0,o.lefttop],[0,1],[o.topleft,1]]},wM=function(o){return[[1,1],[1,o.righttop],[0,o.leftbottom],[0,o.lefttop],[o.topright,1]]},SM=function(o){return[[1,o.rightbottom],[1,0],[o.bottomright,0],[o.topleft,1],[o.topright,1]]},bM=function(o){return[[1,o.righttop],[1,o.rightbottom],[o.bottomleft,0],[0,0],[0,o.leftbottom]]},AM=function(o){return[[1,o.rightbottom],[1,0],[0,0],[0,o.leftbottom],[o.topleft,1],[o.topright,1]]},TM=function(o){return[[1,1],[1,0],[o.bottomright,0],[0,o.leftbottom],[0,o.lefttop],[o.topright,1]]},CM=function(o){return[[1,1],[1,o.righttop],[o.bottomright,0],[o.bottomleft,0],[0,o.lefttop],[0,1]]},IM=function(o){return[[1,o.righttop],[1,o.rightbottom],[o.bottomleft,0],[0,0],[0,1],[o.topleft,1]]},PM=function(o){return[[1,1],[1,o.righttop],[o.bottomleft,0],[0,0],[0,o.leftbottom],[o.topright,1]]},RM=function(o){return[[1,o.rightbottom],[1,0],[o.bottomright,0],[0,o.lefttop],[0,1],[o.topleft,1]]},NM=function(o){return[[1,o.righttop],[1,o.rightbottom],[o.bottomright,0],[o.bottomleft,0],[0,o.leftbottom],[0,o.lefttop],[o.topleft,1],[o.topright,1]]},LM=function(o){return[[1,1],[1,o.righttop],[o.bottomleft,0],[0,0],[0,o.leftbottom],[o.topright,1]]},DM=function(o){return[[1,o.rightbottom],[1,0],[o.bottomright,0],[0,o.lefttop],[0,1],[o.topleft,1]]},OM=function(o){return[[1,1],[1,o.righttop],[o.bottomright,0],[o.bottomleft,0],[0,o.leftbottom],[0,o.lefttop],[o.topright,1]]},FM=function(o){return[[1,o.righttop],[1,o.rightbottom],[o.bottomleft,0],[0,0],[0,o.leftbottom],[o.topleft,1],[o.topright,1]]},UM=function(o){return[[1,o.righttop],[1,o.rightbottom],[o.bottomright,0],[o.bottomleft,0],[0,o.lefttop],[0,1],[o.topleft,1]]},BM=function(o){return[[1,o.rightbottom],[1,0],[o.bottomright,0],[0,o.leftbottom],[0,o.lefttop],[o.topleft,1],[o.topright,1]]},le=[],ce=[],he=[],fe=[],pe=[],de=[],me=[],ge=[];fe[1]=pe[1]=18;fe[169]=pe[169]=18;he[4]=ce[4]=12;he[166]=ce[166]=12;le[16]=ge[16]=4;le[154]=ge[154]=4;de[64]=me[64]=22;de[106]=me[106]=22;he[2]=de[2]=17;fe[2]=pe[2]=18;he[168]=de[168]=17;fe[168]=pe[168]=18;le[8]=fe[8]=9;ce[8]=he[8]=12;le[162]=fe[162]=9;ce[162]=he[162]=12;le[32]=ge[32]=4;ce[32]=me[32]=1;le[138]=ge[138]=4;ce[138]=me[138]=1;pe[128]=ge[128]=21;de[128]=me[128]=22;pe[42]=ge[42]=21;de[42]=me[42]=22;ce[5]=pe[5]=14;ce[165]=pe[165]=14;he[20]=ge[20]=6;he[150]=ge[150]=6;le[80]=de[80]=11;le[90]=de[90]=11;fe[65]=me[65]=3;fe[105]=me[105]=3;le[160]=de[160]=11;ce[160]=pe[160]=14;le[10]=de[10]=11;ce[10]=pe[10]=14;he[130]=ge[130]=6;fe[130]=me[130]=3;he[40]=ge[40]=6;fe[40]=me[40]=3;ce[101]=me[101]=1;ce[69]=me[69]=1;pe[149]=ge[149]=21;pe[21]=ge[21]=21;he[86]=de[86]=17;he[84]=de[84]=17;le[89]=fe[89]=9;le[81]=fe[81]=9;le[96]=me[96]=0;ce[96]=de[96]=15;le[74]=me[74]=0;ce[74]=de[74]=15;le[24]=he[24]=8;fe[24]=ge[24]=7;le[146]=he[146]=8;fe[146]=ge[146]=7;ce[6]=de[6]=15;he[6]=pe[6]=16;ce[164]=de[164]=15;he[164]=pe[164]=16;fe[129]=ge[129]=7;pe[129]=me[129]=20;fe[41]=ge[41]=7;pe[41]=me[41]=20;he[66]=me[66]=2;fe[66]=de[66]=19;he[104]=me[104]=2;fe[104]=de[104]=19;le[144]=pe[144]=10;de[144]=ge[144]=23;le[26]=pe[26]=10;de[26]=ge[26]=23;ce[36]=ge[36]=5;he[36]=me[36]=2;ce[134]=ge[134]=5;he[134]=me[134]=2;le[9]=pe[9]=10;ce[9]=fe[9]=13;le[161]=pe[161]=10;ce[161]=fe[161]=13;ce[37]=ge[37]=5;pe[37]=me[37]=20;ce[133]=ge[133]=5;pe[133]=me[133]=20;he[148]=pe[148]=16;de[148]=ge[148]=23;he[22]=pe[22]=16;de[22]=ge[22]=23;le[82]=he[82]=8;fe[82]=de[82]=19;le[88]=he[88]=8;fe[88]=de[88]=19;le[73]=me[73]=0;ce[73]=fe[73]=13;le[97]=me[97]=0;ce[97]=fe[97]=13;le[145]=fe[145]=9;pe[145]=ge[145]=21;le[25]=fe[25]=9;pe[25]=ge[25]=21;ce[70]=me[70]=1;he[70]=de[70]=17;ce[100]=me[100]=1;he[100]=de[100]=17;le[34]=fe[34]=9;ce[34]=he[34]=12;pe[34]=ge[34]=21;de[34]=me[34]=22;le[136]=ge[136]=4;ce[136]=me[136]=1;he[136]=de[136]=17;fe[136]=pe[136]=18;le[35]=ge[35]=4;ce[35]=he[35]=12;fe[35]=pe[35]=18;de[35]=me[35]=22;le[153]=ge[153]=4;fe[153]=pe[153]=18;ce[102]=he[102]=12;de[102]=me[102]=22;le[155]=fe[155]=9;pe[155]=ge[155]=23;ce[103]=me[103]=1;he[103]=de[103]=17;le[152]=ge[152]=4;he[152]=de[152]=17;fe[152]=pe[152]=18;le[156]=he[156]=8;fe[156]=pe[156]=18;de[156]=ge[156]=23;le[137]=ge[137]=4;ce[137]=me[137]=1;fe[137]=pe[137]=18;le[139]=ge[139]=4;ce[139]=fe[139]=13;pe[139]=me[139]=20;le[98]=fe[98]=9;ce[98]=he[98]=12;de[98]=me[98]=22;le[99]=me[99]=0;ce[99]=he[99]=12;fe[99]=de[99]=19;ce[38]=he[38]=12;pe[38]=ge[38]=21;de[38]=me[38]=22;ce[39]=ge[39]=5;he[39]=pe[39]=16;de[39]=me[39]=22;var st=[];st[1]=st[169]=Yc;st[4]=st[166]=$c;st[16]=st[154]=Zc;st[64]=st[106]=Jc;st[168]=st[2]=Kc;st[162]=st[8]=Qc;st[138]=st[32]=jc;st[42]=st[128]=th;st[5]=st[165]=aM;st[20]=st[150]=uM;st[80]=st[90]=lM;st[65]=st[105]=cM;st[160]=st[10]=hM;st[130]=st[40]=fM;st[85]=pM;st[101]=st[69]=dM;st[149]=st[21]=mM;st[86]=st[84]=gM;st[89]=st[81]=yM;st[96]=st[74]=vM;st[24]=st[146]=_M;st[6]=st[164]=xM;st[129]=st[41]=EM;st[66]=st[104]=MM;st[144]=st[26]=wM;st[36]=st[134]=SM;st[9]=st[161]=bM;st[37]=st[133]=AM;st[148]=st[22]=TM;st[82]=st[88]=CM;st[73]=st[97]=IM;st[145]=st[25]=PM;st[70]=st[100]=RM;st[34]=function(o){return[th(o),Qc(o)]};st[35]=NM;st[136]=function(o){return[jc(o),Kc(o)]};st[153]=function(o){return[Zc(o),Yc(o)]};st[102]=function(o){return[$c(o),Jc(o)]};st[155]=LM;st[103]=DM;st[152]=function(o){return[Zc(o),Kc(o)]};st[156]=OM;st[137]=function(o){return[jc(o),Yc(o)]};st[139]=FM;st[98]=function(o){return[Qc(o),Jc(o)]};st[99]=UM;st[38]=function(o){return[$c(o),th(o)]};st[39]=BM;function kM(o){return(o>0)-(o<0)||+o}function Cs(o,e,r){var a=e[0]-o[0],u=e[1]-o[1],c=r[0]-e[0],h=r[1]-e[1];return kM(a*h-c*u)}function ng(o,e){var r=o.geometry.coordinates[0].map(function(h){return h[0]}),a=o.geometry.coordinates[0].map(function(h){return h[1]}),u=e.geometry.coordinates[0].map(function(h){return h[0]}),c=e.geometry.coordinates[0].map(function(h){return h[1]});return Math.max.apply(null,r)===Math.max.apply(null,u)&&Math.max.apply(null,a)===Math.max.apply(null,c)&&Math.min.apply(null,r)===Math.min.apply(null,u)&&Math.min.apply(null,a)===Math.min.apply(null,c)}function eh(o,e){return e.geometry.coordinates[0].every(function(r){return $n(He(r),o)})}function rg(o,e){return o[0]===e[0]&&o[1]===e[1]}var GM=function(){function o(e){this.id=o.buildId(e),this.coordinates=e,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return o.buildId=function(e){return e.join(",")},o.prototype.removeInnerEdge=function(e){this.innerEdges=this.innerEdges.filter(function(r){return r.from.id!==e.from.id})},o.prototype.removeOuterEdge=function(e){this.outerEdges=this.outerEdges.filter(function(r){return r.to.id!==e.to.id})},o.prototype.addOuterEdge=function(e){this.outerEdges.push(e),this.outerEdgesSorted=!1},o.prototype.sortOuterEdges=function(){var e=this;this.outerEdgesSorted||(this.outerEdges.sort(function(r,a){var u=r.to,c=a.to;if(u.coordinates[0]-e.coordinates[0]>=0&&c.coordinates[0]-e.coordinates[0]<0)return 1;if(u.coordinates[0]-e.coordinates[0]<0&&c.coordinates[0]-e.coordinates[0]>=0)return-1;if(u.coordinates[0]-e.coordinates[0]===0&&c.coordinates[0]-e.coordinates[0]===0)return u.coordinates[1]-e.coordinates[1]>=0||c.coordinates[1]-e.coordinates[1]>=0?u.coordinates[1]-c.coordinates[1]:c.coordinates[1]-u.coordinates[1];var h=Cs(e.coordinates,u.coordinates,c.coordinates);if(h<0)return 1;if(h>0)return-1;var p=Math.pow(u.coordinates[0]-e.coordinates[0],2)+Math.pow(u.coordinates[1]-e.coordinates[1],2),d=Math.pow(c.coordinates[0]-e.coordinates[0],2)+Math.pow(c.coordinates[1]-e.coordinates[1],2);return p-d}),this.outerEdgesSorted=!0)},o.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},o.prototype.getOuterEdge=function(e){return this.sortOuterEdges(),this.outerEdges[e]},o.prototype.addInnerEdge=function(e){this.innerEdges.push(e)},o}(),nh=GM;var VM=function(){function o(e,r){this.from=e,this.to=r,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 o.prototype.getSymetric=function(){return this.symetric||(this.symetric=new o(this.to,this.from),this.symetric.symetric=this),this.symetric},o.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},o.prototype.isEqual=function(e){return this.from.id===e.from.id&&this.to.id===e.to.id},o.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},o.prototype.toLineString=function(){return Yn([this.from.coordinates,this.to.coordinates])},o.prototype.compareTo=function(e){return Cs(e.from.coordinates,e.to.coordinates,this.to.coordinates)},o}(),ig=VM;var HM=function(){function o(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return o.prototype.push=function(e){this.edges.push(e),this.polygon=this.envelope=void 0},o.prototype.get=function(e){return this.edges[e]},Object.defineProperty(o.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}),o.prototype.forEach=function(e){this.edges.forEach(e)},o.prototype.map=function(e){return this.edges.map(e)},o.prototype.some=function(e){return this.edges.some(e)},o.prototype.isValid=function(){return!0},o.prototype.isHole=function(){var e=this,r=this.edges.reduce(function(h,p,d){return p.from.coordinates[1]>e.edges[h].from.coordinates[1]&&(h=d),h},0),a=(r===0?this.length:r)-1,u=(r+1)%this.length,c=Cs(this.edges[a].from.coordinates,this.edges[r].from.coordinates,this.edges[u].from.coordinates);return c===0?this.edges[a].from.coordinates[0]>this.edges[u].from.coordinates[0]:c>0},o.prototype.toMultiPoint=function(){return zl(this.edges.map(function(e){return e.from.coordinates}))},o.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var e=this.edges.map(function(r){return r.from.coordinates});return e.push(this.edges[0].from.coordinates),this.polygon=sn([e])},o.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=ic(this.toPolygon())},o.findEdgeRingContaining=function(e,r){var a=e.getEnvelope(),u,c;return r.forEach(function(h){var p=h.getEnvelope();if(c&&(u=c.getEnvelope()),!ng(p,a)&&eh(p,a)){for(var d=e.map(function(I){return I.from.coordinates}),g=void 0,v=function(I){h.some(function(D){return rg(I,D.from.coordinates)})||(g=I)},x=0,M=d;x<M.length;x++){var w=M[x];v(w)}g&&h.inside(He(g))&&(!c||eh(u,p))&&(c=h)}}),c},o.prototype.inside=function(e){return $n(e,this.toPolygon())},o}(),rh=HM;function qM(o){if(!o)throw new Error("No geojson passed");if(o.type!=="FeatureCollection"&&o.type!=="GeometryCollection"&&o.type!=="MultiLineString"&&o.type!=="LineString"&&o.type!=="Feature")throw new Error("Invalid input type '"+o.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}var SL=function(){function o(){this.edges=[],this.nodes={}}return o.fromGeoJson=function(e){qM(e);var r=new o;return Xr(e,function(a){Gl(a,"LineString","Graph::fromGeoJson"),Jf(a,function(u,c){if(u){var h=r.getNode(u),p=r.getNode(c);r.addEdge(h,p)}return c})}),r},o.prototype.getNode=function(e){var r=nh.buildId(e),a=this.nodes[r];return a||(a=this.nodes[r]=new nh(e)),a},o.prototype.addEdge=function(e,r){var a=new ig(e,r),u=a.getSymetric();this.edges.push(a),this.edges.push(u)},o.prototype.deleteDangles=function(){var e=this;Object.keys(this.nodes).map(function(r){return e.nodes[r]}).forEach(function(r){return e._removeIfDangle(r)})},o.prototype._removeIfDangle=function(e){var r=this;if(e.innerEdges.length<=1){var a=e.getOuterEdges().map(function(u){return u.to});this.removeNode(e),a.forEach(function(u){return r._removeIfDangle(u)})}},o.prototype.deleteCutEdges=function(){var e=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(r){r.label===r.symetric.label&&(e.removeEdge(r.symetric),e.removeEdge(r))})},o.prototype._computeNextCWEdges=function(e){var r=this;typeof e>"u"?Object.keys(this.nodes).forEach(function(a){return r._computeNextCWEdges(r.nodes[a])}):e.getOuterEdges().forEach(function(a,u){e.getOuterEdge((u===0?e.getOuterEdges().length:u)-1).symetric.next=a})},o.prototype._computeNextCCWEdges=function(e,r){for(var a=e.getOuterEdges(),u,c,h=a.length-1;h>=0;--h){var p=a[h],d=p.symetric,g=void 0,v=void 0;p.label===r&&(g=p),d.label===r&&(v=d),!(!g||!v)&&(v&&(c=v),g&&(c&&(c.next=g,c=void 0),u||(u=g)))}c&&(c.next=u)},o.prototype._findLabeledEdgeRings=function(){var e=[],r=0;return this.edges.forEach(function(a){if(!(a.label>=0)){e.push(a);var u=a;do u.label=r,u=u.next;while(!a.isEqual(u));r++}}),e},o.prototype.getEdgeRings=function(){var e=this;this._computeNextCWEdges(),this.edges.forEach(function(a){a.label=void 0}),this._findLabeledEdgeRings().forEach(function(a){e._findIntersectionNodes(a).forEach(function(u){e._computeNextCCWEdges(u,a.label)})});var r=[];return this.edges.forEach(function(a){a.ring||r.push(e._findEdgeRing(a))}),r},o.prototype._findIntersectionNodes=function(e){var r=[],a=e,u=function(){var c=0;a.from.getOuterEdges().forEach(function(h){h.label===e.label&&++c}),c>1&&r.push(a.from),a=a.next};do u();while(!e.isEqual(a));return r},o.prototype._findEdgeRing=function(e){var r=e,a=new rh;do a.push(r),r.ring=a,r=r.next;while(!e.isEqual(r));return a},o.prototype.removeNode=function(e){var r=this;e.getOuterEdges().forEach(function(a){return r.removeEdge(a)}),e.innerEdges.forEach(function(a){return r.removeEdge(a)}),delete this.nodes[e.id]},o.prototype.removeEdge=function(e){this.edges=this.edges.filter(function(r){return!r.isEqual(e)}),e.deleteEdge()},o}();var $M=ln(ih(),1);var ZM=ln(ih(),1);var KM=ln(pg(),1);var iw=ln(wg(),1);function bg(o){for(var e=o,r=[];e.parent;)r.unshift(e),e=e.parent;return r}function sw(){return new Ag(function(o){return o.f})}var uh={search:function(o,e,r,a){o.cleanDirty(),a=a||{};var u=a.heuristic||uh.heuristics.manhattan,c=a.closest||!1,h=sw(),p=e;for(e.h=u(e,r),h.push(e);h.size()>0;){var d=h.pop();if(d===r)return bg(d);d.closed=!0;for(var g=o.neighbors(d),v=0,x=g.length;v<x;++v){var M=g[v];if(!(M.closed||M.isWall())){var w=d.g+M.getCost(d),I=M.visited;(!I||w<M.g)&&(M.visited=!0,M.parent=d,M.h=M.h||u(M,r),M.g=w,M.f=M.g+M.h,o.markDirty(M),c&&(M.h<p.h||M.h===p.h&&M.g<p.g)&&(p=M),I?h.rescoreElement(M):h.push(M))}}}return c?bg(p):[]},heuristics:{manhattan:function(o,e){var r=Math.abs(e.x-o.x),a=Math.abs(e.y-o.y);return r+a},diagonal:function(o,e){var r=1,a=Math.sqrt(2),u=Math.abs(e.x-o.x),c=Math.abs(e.y-o.y);return r*(u+c)+(a-2*r)*Math.min(u,c)}},cleanNode:function(o){o.f=0,o.g=0,o.h=0,o.visited=!1,o.closed=!1,o.parent=null}};function va(o,e){e=e||{},this.nodes=[],this.diagonal=!!e.diagonal,this.grid=[];for(var r=0;r<o.length;r++){this.grid[r]=[];for(var a=0,u=o[r];a<u.length;a++){var c=new Du(r,a,u[a]);this.grid[r][a]=c,this.nodes.push(c)}}this.init()}va.prototype.init=function(){this.dirtyNodes=[];for(var o=0;o<this.nodes.length;o++)uh.cleanNode(this.nodes[o])};va.prototype.cleanDirty=function(){for(var o=0;o<this.dirtyNodes.length;o++)uh.cleanNode(this.dirtyNodes[o]);this.dirtyNodes=[]};va.prototype.markDirty=function(o){this.dirtyNodes.push(o)};va.prototype.neighbors=function(o){var e=[],r=o.x,a=o.y,u=this.grid;return u[r-1]&&u[r-1][a]&&e.push(u[r-1][a]),u[r+1]&&u[r+1][a]&&e.push(u[r+1][a]),u[r]&&u[r][a-1]&&e.push(u[r][a-1]),u[r]&&u[r][a+1]&&e.push(u[r][a+1]),this.diagonal&&(u[r-1]&&u[r-1][a-1]&&e.push(u[r-1][a-1]),u[r+1]&&u[r+1][a-1]&&e.push(u[r+1][a-1]),u[r-1]&&u[r-1][a+1]&&e.push(u[r-1][a+1]),u[r+1]&&u[r+1][a+1]&&e.push(u[r+1][a+1])),e};va.prototype.toString=function(){for(var o=[],e=this.grid,r,a,u,c,h=0,p=e.length;h<p;h++){for(r=[],a=e[h],u=0,c=a.length;u<c;u++)r.push(a[u].weight);o.push(r.join(" "))}return o.join(\`
|
|
7226
7226
|
\`)};function Du(o,e,r){this.x=o,this.y=e,this.weight=r}Du.prototype.toString=function(){return"["+this.x+" "+this.y+"]"};Du.prototype.getCost=function(o){return o&&o.x!==this.x&&o.y!==this.y?this.weight*1.41421:this.weight};Du.prototype.isWall=function(){return this.weight===0};function Ag(o){this.content=[],this.scoreFunction=o}Ag.prototype={push:function(o){this.content.push(o),this.sinkDown(this.content.length-1)},pop:function(){var o=this.content[0],e=this.content.pop();return this.content.length>0&&(this.content[0]=e,this.bubbleUp(0)),o},remove:function(o){var e=this.content.indexOf(o),r=this.content.pop();e!==this.content.length-1&&(this.content[e]=r,this.scoreFunction(r)<this.scoreFunction(o)?this.sinkDown(e):this.bubbleUp(e))},size:function(){return this.content.length},rescoreElement:function(o){this.sinkDown(this.content.indexOf(o))},sinkDown:function(o){for(var e=this.content[o];o>0;){var r=(o+1>>1)-1,a=this.content[r];if(this.scoreFunction(e)<this.scoreFunction(a))this.content[r]=e,this.content[o]=a,o=r;else break}},bubbleUp:function(o){for(var e=this.content.length,r=this.content[o],a=this.scoreFunction(r);;){var u=o+1<<1,c=u-1,h=null,p;if(c<e){var d=this.content[c];p=this.scoreFunction(d),p<a&&(h=c)}if(u<e){var g=this.content[u],v=this.scoreFunction(g);v<(h===null?a:p)&&(h=u)}if(h!==null)this.content[o]=this.content[h],this.content[h]=r,o=h;else break}}};function lh(){this._=null}function Ps(o){o.U=o.C=o.L=o.R=o.P=o.N=null}lh.prototype={constructor:lh,insert:function(o,e){var r,a,u;if(o){if(e.P=o,e.N=o.N,o.N&&(o.N.P=e),o.N=e,o.R){for(o=o.R;o.L;)o=o.L;o.L=e}else o.R=e;r=o}else this._?(o=Tg(this._),e.P=null,e.N=o,o.P=o.L=e,r=o):(e.P=e.N=null,this._=e,r=null);for(e.L=e.R=null,e.U=r,e.C=!0,o=e;r&&r.C;)a=r.U,r===a.L?(u=a.R,u&&u.C?(r.C=u.C=!1,a.C=!0,o=a):(o===r.R&&(_a(this,r),o=r,r=o.U),r.C=!1,a.C=!0,xa(this,a))):(u=a.L,u&&u.C?(r.C=u.C=!1,a.C=!0,o=a):(o===r.L&&(xa(this,r),o=r,r=o.U),r.C=!1,a.C=!0,_a(this,a))),r=o.U;this._.C=!1},remove:function(o){o.N&&(o.N.P=o.P),o.P&&(o.P.N=o.N),o.N=o.P=null;var e=o.U,r,a=o.L,u=o.R,c,h;if(a?u?c=Tg(u):c=a:c=u,e?e.L===o?e.L=c:e.R=c:this._=c,a&&u?(h=c.C,c.C=o.C,c.L=a,a.U=c,c!==u?(e=c.U,c.U=o.U,o=c.R,e.L=o,c.R=u,u.U=c):(c.U=e,e=c,o=c.R)):(h=o.C,o=c),o&&(o.U=e),!h){if(o&&o.C){o.C=!1;return}do{if(o===this._)break;if(o===e.L){if(r=e.R,r.C&&(r.C=!1,e.C=!0,_a(this,e),r=e.R),r.L&&r.L.C||r.R&&r.R.C){(!r.R||!r.R.C)&&(r.L.C=!1,r.C=!0,xa(this,r),r=e.R),r.C=e.C,e.C=r.R.C=!1,_a(this,e),o=this._;break}}else if(r=e.L,r.C&&(r.C=!1,e.C=!0,xa(this,e),r=e.L),r.L&&r.L.C||r.R&&r.R.C){(!r.L||!r.L.C)&&(r.R.C=!1,r.C=!0,_a(this,r),r=e.L),r.C=e.C,e.C=r.L.C=!1,xa(this,e),o=this._;break}r.C=!0,o=e,e=e.U}while(!o.C);o&&(o.C=!1)}}};function _a(o,e){var r=e,a=e.R,u=r.U;u?u.L===r?u.L=a:u.R=a:o._=a,a.U=u,r.U=a,r.R=a.L,r.R&&(r.R.U=r),a.L=r}function xa(o,e){var r=e,a=e.L,u=r.U;u?u.L===r?u.L=a:u.R=a:o._=a,a.U=u,r.U=a,r.L=a.R,r.L&&(r.L.U=r),a.R=r}function Tg(o){for(;o.L;)o=o.L;return o}var ch=lh;function Rs(o,e,r,a){var u=[null,null],c=Jn.push(u)-1;return u.left=o,u.right=e,r&&Ea(u,o,e,r),a&&Ea(u,e,o,a),Cr[o.index].halfedges.push(c),Cr[e.index].halfedges.push(c),u}function Ns(o,e,r){var a=[e,r];return a.left=o,a}function Ea(o,e,r,a){!o[0]&&!o[1]?(o[0]=a,o.left=e,o.right=r):o.left===r?o[1]=a:o[0]=a}function aw(o,e,r,a,u){var c=o[0],h=o[1],p=c[0],d=c[1],g=h[0],v=h[1],x=0,M=1,w=g-p,I=v-d,D;if(D=e-p,!(!w&&D>0)){if(D/=w,w<0){if(D<x)return;D<M&&(M=D)}else if(w>0){if(D>M)return;D>x&&(x=D)}if(D=a-p,!(!w&&D<0)){if(D/=w,w<0){if(D>M)return;D>x&&(x=D)}else if(w>0){if(D<x)return;D<M&&(M=D)}if(D=r-d,!(!I&&D>0)){if(D/=I,I<0){if(D<x)return;D<M&&(M=D)}else if(I>0){if(D>M)return;D>x&&(x=D)}if(D=u-d,!(!I&&D<0)){if(D/=I,I<0){if(D>M)return;D>x&&(x=D)}else if(I>0){if(D<x)return;D<M&&(M=D)}return!(x>0)&&!(M<1)||(x>0&&(o[0]=[p+x*w,d+x*I]),M<1&&(o[1]=[p+M*w,d+M*I])),!0}}}}}function uw(o,e,r,a,u){var c=o[1];if(c)return!0;var h=o[0],p=o.left,d=o.right,g=p[0],v=p[1],x=d[0],M=d[1],w=(g+x)/2,I=(v+M)/2,D,b;if(M===v){if(w<e||w>=a)return;if(g>x){if(!h)h=[w,r];else if(h[1]>=u)return;c=[w,u]}else{if(!h)h=[w,u];else if(h[1]<r)return;c=[w,r]}}else if(D=(g-x)/(M-v),b=I-D*w,D<-1||D>1)if(g>x){if(!h)h=[(r-b)/D,r];else if(h[1]>=u)return;c=[(u-b)/D,u]}else{if(!h)h=[(u-b)/D,u];else if(h[1]<r)return;c=[(r-b)/D,r]}else if(v<M){if(!h)h=[e,D*e+b];else if(h[0]>=a)return;c=[a,D*a+b]}else{if(!h)h=[a,D*a+b];else if(h[0]<e)return;c=[e,D*e+b]}return o[0]=h,o[1]=c,!0}function Cg(o,e,r,a){for(var u=Jn.length,c;u--;)(!uw(c=Jn[u],o,e,r,a)||!aw(c,o,e,r,a)||!(Math.abs(c[0][0]-c[1][0])>Ue||Math.abs(c[0][1]-c[1][1])>Ue))&&delete Jn[u]}function Ig(o){return Cr[o.index]={site:o,halfedges:[]}}function lw(o,e){var r=o.site,a=e.left,u=e.right;return r===u&&(u=a,a=r),u?Math.atan2(u[1]-a[1],u[0]-a[0]):(r===a?(a=e[1],u=e[0]):(a=e[0],u=e[1]),Math.atan2(a[0]-u[0],u[1]-a[1]))}function hh(o,e){return e[+(e.left!==o.site)]}function cw(o,e){return e[+(e.left===o.site)]}function Pg(){for(var o=0,e=Cr.length,r,a,u,c;o<e;++o)if((r=Cr[o])&&(c=(a=r.halfedges).length)){var h=new Array(c),p=new Array(c);for(u=0;u<c;++u)h[u]=u,p[u]=lw(r,Jn[a[u]]);for(h.sort(function(d,g){return p[g]-p[d]}),u=0;u<c;++u)p[u]=a[h[u]];for(u=0;u<c;++u)a[u]=p[u]}}function Rg(o,e,r,a){var u=Cr.length,c,h,p,d,g,v,x,M,w,I,D,b,T=!0;for(c=0;c<u;++c)if(h=Cr[c]){for(p=h.site,g=h.halfedges,d=g.length;d--;)Jn[g[d]]||g.splice(d,1);for(d=0,v=g.length;d<v;)I=cw(h,Jn[g[d]]),D=I[0],b=I[1],x=hh(h,Jn[g[++d%v]]),M=x[0],w=x[1],(Math.abs(D-M)>Ue||Math.abs(b-w)>Ue)&&(g.splice(d,0,Jn.push(Ns(p,I,Math.abs(D-o)<Ue&&a-b>Ue?[o,Math.abs(M-o)<Ue?w:a]:Math.abs(b-a)<Ue&&r-D>Ue?[Math.abs(w-a)<Ue?M:r,a]:Math.abs(D-r)<Ue&&b-e>Ue?[r,Math.abs(M-r)<Ue?w:e]:Math.abs(b-e)<Ue&&D-o>Ue?[Math.abs(w-e)<Ue?M:o,e]:null))-1),++v);v&&(T=!1)}if(T){var L,P,z,k=1/0;for(c=0,T=null;c<u;++c)(h=Cr[c])&&(p=h.site,L=p[0]-o,P=p[1]-e,z=L*L+P*P,z<k&&(k=z,T=h));if(T){var Y=[o,e],q=[o,a],C=[r,a],ot=[r,e];T.halfedges.push(Jn.push(Ns(p=T.site,Y,q))-1,Jn.push(Ns(p,q,C))-1,Jn.push(Ns(p,C,ot))-1,Jn.push(Ns(p,ot,Y))-1)}}for(c=0;c<u;++c)(h=Cr[c])&&(h.halfedges.length||delete Cr[c])}var Ng=[],Ou;function hw(){Ps(this),this.x=this.y=this.arc=this.site=this.cy=null}function Vo(o){var e=o.P,r=o.N;if(!(!e||!r)){var a=e.site,u=o.site,c=r.site;if(a!==c){var h=u[0],p=u[1],d=a[0]-h,g=a[1]-p,v=c[0]-h,x=c[1]-p,M=2*(d*x-g*v);if(!(M>=-Lg)){var w=d*d+g*g,I=v*v+x*x,D=(x*w-g*I)/M,b=(d*I-v*w)/M,T=Ng.pop()||new hw;T.arc=o,T.site=u,T.x=D+h,T.y=(T.cy=b+p)+Math.sqrt(D*D+b*b),o.circle=T;for(var L=null,P=Ls._;P;)if(T.y<P.y||T.y===P.y&&T.x<=P.x)if(P.L)P=P.L;else{L=P.P;break}else if(P.R)P=P.R;else{L=P;break}Ls.insert(L,T),L||(Ou=T)}}}}function Ho(o){var e=o.circle;e&&(e.P||(Ou=e.N),Ls.remove(e),Ng.push(e),Ps(e),o.circle=null)}var Og=[];function fw(){Ps(this),this.edge=this.site=this.circle=null}function Dg(o){var e=Og.pop()||new fw;return e.site=o,e}function fh(o){Ho(o),qo.remove(o),Og.push(o),Ps(o)}function Fg(o){var e=o.circle,r=e.x,a=e.cy,u=[r,a],c=o.P,h=o.N,p=[o];fh(o);for(var d=c;d.circle&&Math.abs(r-d.circle.x)<Ue&&Math.abs(a-d.circle.cy)<Ue;)c=d.P,p.unshift(d),fh(d),d=c;p.unshift(d),Ho(d);for(var g=h;g.circle&&Math.abs(r-g.circle.x)<Ue&&Math.abs(a-g.circle.cy)<Ue;)h=g.N,p.push(g),fh(g),g=h;p.push(g),Ho(g);var v=p.length,x;for(x=1;x<v;++x)g=p[x],d=p[x-1],Ea(g.edge,d.site,g.site,u);d=p[0],g=p[v-1],g.edge=Rs(d.site,g.site,null,u),Vo(d),Vo(g)}function Ug(o){for(var e=o[0],r=o[1],a,u,c,h,p=qo._;p;)if(c=Bg(p,r)-e,c>Ue)p=p.L;else if(h=e-pw(p,r),h>Ue){if(!p.R){a=p;break}p=p.R}else{c>-Ue?(a=p.P,u=p):h>-Ue?(a=p,u=p.N):a=u=p;break}Ig(o);var d=Dg(o);if(qo.insert(a,d),!(!a&&!u)){if(a===u){Ho(a),u=Dg(a.site),qo.insert(d,u),d.edge=u.edge=Rs(a.site,d.site),Vo(a),Vo(u);return}if(!u){d.edge=Rs(a.site,d.site);return}Ho(a),Ho(u);var g=a.site,v=g[0],x=g[1],M=o[0]-v,w=o[1]-x,I=u.site,D=I[0]-v,b=I[1]-x,T=2*(M*b-w*D),L=M*M+w*w,P=D*D+b*b,z=[(b*L-w*P)/T+v,(M*P-D*L)/T+x];Ea(u.edge,g,I,z),d.edge=Rs(g,o,null,z),u.edge=Rs(o,I,null,z),Vo(a),Vo(u)}}function Bg(o,e){var r=o.site,a=r[0],u=r[1],c=u-e;if(!c)return a;var h=o.P;if(!h)return-1/0;r=h.site;var p=r[0],d=r[1],g=d-e;if(!g)return p;var v=p-a,x=1/c-1/g,M=v/g;return x?(-M+Math.sqrt(M*M-2*x*(v*v/(-2*g)-d+g/2+u-c/2)))/x+a:(a+p)/2}function pw(o,e){var r=o.N;if(r)return Bg(r,e);var a=o.site;return a[1]===e?a[0]:1/0}var Ue=1e-6,Lg=1e-12,qo,Cr,Ls,Jn;function dw(o,e,r){return(o[0]-r[0])*(e[1]-o[1])-(o[0]-e[0])*(r[1]-o[1])}function mw(o,e){return e[1]-o[1]||e[0]-o[0]}function Fu(o,e){var r=o.sort(mw).pop(),a,u,c;for(Jn=[],Cr=new Array(o.length),qo=new ch,Ls=new ch;;)if(c=Ou,r&&(!c||r[1]<c.y||r[1]===c.y&&r[0]<c.x))(r[0]!==a||r[1]!==u)&&(Ug(r),a=r[0],u=r[1]),r=o.pop();else if(c)Fg(c.arc);else break;if(Pg(),e){var h=+e[0][0],p=+e[0][1],d=+e[1][0],g=+e[1][1];Cg(h,p,d,g),Rg(h,p,d,g)}this.edges=Jn,this.cells=Cr,qo=Ls=Jn=Cr=null}Fu.prototype={constructor:Fu,polygons:function(){var o=this.edges;return this.cells.map(function(e){var r=e.halfedges.map(function(a){return hh(e,o[a])});return r.data=e.site.data,r})},triangles:function(){var o=[],e=this.edges;return this.cells.forEach(function(r,a){if(p=(c=r.halfedges).length)for(var u=r.site,c,h=-1,p,d,g=e[c[p-1]],v=g.left===u?g.right:g.left;++h<p;)d=v,g=e[c[h]],v=g.left===u?g.right:g.left,d&&v&&a<d.index&&a<v.index&&dw(u,d,v)<0&&o.push([u.data,d.data,v.data])}),o},links:function(){return this.edges.filter(function(o){return o.right}).map(function(o){return{source:o.left.data,target:o.right.data}})},find:function(o,e,r){for(var a=this,u,c=a._found||0,h=a.cells.length,p;!(p=a.cells[c]);)if(++c>=h)return null;var d=o-p.site[0],g=e-p.site[1],v=d*d+g*g;do p=a.cells[u=c],c=null,p.halfedges.forEach(function(x){var M=a.edges[x],w=M.left;if(!((w===p.site||!w)&&!(w=M.right))){var I=o-w[0],D=e-w[1],b=I*I+D*D;b<v&&(v=b,c=w.index)}});while(c!==null);return a._found=u,r==null||v<=r*r?p.site:null}};var ww=ln(Ds(),1);var Th=ln(Vg(),1);function Ur(){return new zu}function zu(){this.reset()}zu.prototype={constructor:zu,reset:function(){this.s=this.t=0},add:function(o){Hg(Bu,o,this.t),Hg(this,Bu.s,this.s),this.s?this.t+=Bu.t:this.s=Bu.t},valueOf:function(){return this.s}};var Bu=new zu;function Hg(o,e,r){var a=o.s=e+r,u=a-e,c=a-u;o.t=e-c+(r-u)}var Ae=1e-6;var Oe=Math.PI,On=Oe/2,ku=Oe/4,Ui=Oe*2,Wo=180/Oe,Br=Oe/180,mn=Math.abs,bi=Math.atan,zr=Math.atan2,xe=Math.cos;var Gu=Math.exp;var Ma=Math.log;var Lt=Math.sin;var ar=Math.sqrt,wa=Math.tan;function mh(o){return o>1?0:o<-1?Oe:Math.acos(o)}function Ir(o){return o>1?On:o<-1?-On:Math.asin(o)}function Ai(){}var Sw=Ur(),vO=Ur();function Xo(o){var e=o[0],r=o[1],a=xe(r);return[a*xe(e),a*Lt(e),Lt(r)]}function Sa(o,e){return[o[1]*e[2]-o[2]*e[1],o[2]*e[0]-o[0]*e[2],o[0]*e[1]-o[1]*e[0]]}function ba(o){var e=ar(o[0]*o[0]+o[1]*o[1]+o[2]*o[2]);o[0]/=e,o[1]/=e,o[2]/=e}var CO=Ur();function Wg(o,e){return[o>Oe?o-Ui:o<-Oe?o+Ui:o,e]}Wg.invert=Wg;function gh(){var o=[],e;return{point:function(r,a){e.push([r,a])},lineStart:function(){o.push(e=[])},lineEnd:Ai,rejoin:function(){o.length>1&&o.push(o.pop().concat(o.shift()))},result:function(){var r=o;return o=[],e=null,r}}}function yh(o,e){return mn(o[0]-e[0])<Ae&&mn(o[1]-e[1])<Ae}function Vu(o,e,r,a){this.x=o,this.z=e,this.o=r,this.e=a,this.v=!1,this.n=this.p=null}function vh(o,e,r,a,u){var c=[],h=[],p,d;if(o.forEach(function(I){if(!((D=I.length-1)<=0)){var D,b=I[0],T=I[D],L;if(yh(b,T)){for(u.lineStart(),p=0;p<D;++p)u.point((b=I[p])[0],b[1]);u.lineEnd();return}c.push(L=new Vu(b,I,null,!0)),h.push(L.o=new Vu(b,null,L,!1)),c.push(L=new Vu(T,I,null,!1)),h.push(L.o=new Vu(T,null,L,!0))}}),!!c.length){for(h.sort(e),Xg(c),Xg(h),p=0,d=h.length;p<d;++p)h[p].e=r=!r;for(var g=c[0],v,x;;){for(var M=g,w=!0;M.v;)if((M=M.n)===g)return;v=M.z,u.lineStart();do{if(M.v=M.o.v=!0,M.e){if(w)for(p=0,d=v.length;p<d;++p)u.point((x=v[p])[0],x[1]);else a(M.x,M.n.x,1,u);M=M.n}else{if(w)for(v=M.p.z,p=v.length-1;p>=0;--p)u.point((x=v[p])[0],x[1]);else a(M.x,M.p.x,-1,u);M=M.p}M=M.o,v=M.z,w=!w}while(!M.v);u.lineEnd()}}}function Xg(o){if(e=o.length){for(var e,r=0,a=o[0],u;++r<e;)a.n=u=o[r],u.p=a,a=u;a.n=u=o[0],u.p=a}}function Eo(o,e){return o<e?-1:o>e?1:o>=e?0:NaN}function _h(o){return o.length===1&&(o=Tw(o)),{left:function(e,r,a,u){for(a==null&&(a=0),u==null&&(u=e.length);a<u;){var c=a+u>>>1;o(e[c],r)<0?a=c+1:u=c}return a},right:function(e,r,a,u){for(a==null&&(a=0),u==null&&(u=e.length);a<u;){var c=a+u>>>1;o(e[c],r)>0?u=c:a=c+1}return a}}}function Tw(o){return function(e,r){return Eo(o(e),r)}}var Yg=_h(Eo),Cw=Yg.right,Iw=Yg.left;var $g=Array.prototype,Rw=$g.slice,Nw=$g.map;var x3=Math.sqrt(50),E3=Math.sqrt(10),M3=Math.sqrt(2);function qu(o){for(var e=o.length,r,a=-1,u=0,c,h;++a<e;)u+=o[a].length;for(c=new Array(u);--e>=0;)for(h=o[e],r=h.length;--r>=0;)c[--u]=h[r];return c}var kw=1e9,oU=-kw;var xh=Ur();function Eh(o,e){var r=e[0],a=e[1],u=[Lt(r),-xe(r),0],c=0,h=0;xh.reset();for(var p=0,d=o.length;p<d;++p)if(v=(g=o[p]).length)for(var g,v,x=g[v-1],M=x[0],w=x[1]/2+ku,I=Lt(w),D=xe(w),b=0;b<v;++b,M=L,I=z,D=k,x=T){var T=g[b],L=T[0],P=T[1]/2+ku,z=Lt(P),k=xe(P),Y=L-M,q=Y>=0?1:-1,C=q*Y,ot=C>Oe,pt=I*z;if(xh.add(zr(pt*q*Lt(C),D*k+pt*xe(C))),c+=ot?Y+q*Ui:Y,ot^M>=r^L>=r){var dt=Sa(Xo(x),Xo(T));ba(dt);var F=Sa(u,dt);ba(F);var ye=(ot^Y>=0?-1:1)*Ir(F[2]);(a>ye||a===ye&&(dt[0]||dt[1]))&&(h+=ot^Y>=0?1:-1)}}return(c<-Ae||c<Ae&&xh<-Ae)^h&1}var mU=Ur();var DU=Ur(),OU=Ur();var Hw=1/0;var BU=-Hw;function Mh(o){this._context=o}Mh.prototype={_radius:4.5,pointRadius:function(o){return this._radius=o,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(o,e){switch(this._point){case 0:{this._context.moveTo(o,e),this._point=1;break}case 1:{this._context.lineTo(o,e);break}default:{this._context.moveTo(o+this._radius,e),this._context.arc(o,e,this._radius,0,Ui);break}}},result:Ai};var $U=Ur();function wh(){this._string=[]}wh.prototype={_radius:4.5,_circle:Kg(4.5),pointRadius:function(o){return(o=+o)!==this._radius&&(this._radius=o,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(o,e){switch(this._point){case 0:{this._string.push("M",o,",",e),this._point=1;break}case 1:{this._string.push("L",o,",",e);break}default:{this._circle==null&&(this._circle=Kg(this._radius)),this._string.push("M",o,",",e,this._circle);break}}},result:function(){if(this._string.length){var o=this._string.join("");return this._string=[],o}else return null}};function Kg(o){return"m0,"+o+"a"+o+","+o+" 0 1,1 0,"+-2*o+"a"+o+","+o+" 0 1,1 0,"+2*o+"z"}function Sh(o,e,r,a){return function(u,c){var h=e(c),p=u.invert(a[0],a[1]),d=gh(),g=e(d),v=!1,x,M,w,I={point:D,lineStart:T,lineEnd:L,polygonStart:function(){I.point=P,I.lineStart=z,I.lineEnd=k,M=[],x=[]},polygonEnd:function(){I.point=D,I.lineStart=T,I.lineEnd=L,M=qu(M);var Y=Eh(x,p);M.length?(v||(c.polygonStart(),v=!0),vh(M,Xw,Y,r,c)):Y&&(v||(c.polygonStart(),v=!0),c.lineStart(),r(null,null,1,c),c.lineEnd()),v&&(c.polygonEnd(),v=!1),M=x=null},sphere:function(){c.polygonStart(),c.lineStart(),r(null,null,1,c),c.lineEnd(),c.polygonEnd()}};function D(Y,q){var C=u(Y,q);o(Y=C[0],q=C[1])&&c.point(Y,q)}function b(Y,q){var C=u(Y,q);h.point(C[0],C[1])}function T(){I.point=b,h.lineStart()}function L(){I.point=D,h.lineEnd()}function P(Y,q){w.push([Y,q]);var C=u(Y,q);g.point(C[0],C[1])}function z(){g.lineStart(),w=[]}function k(){P(w[0][0],w[0][1]),g.lineEnd();var Y=g.clean(),q=d.result(),C,ot=q.length,pt,dt,F;if(w.pop(),x.push(w),w=null,!!ot){if(Y&1){if(dt=q[0],(pt=dt.length-1)>0){for(v||(c.polygonStart(),v=!0),c.lineStart(),C=0;C<pt;++C)c.point((F=dt[C])[0],F[1]);c.lineEnd()}return}ot>1&&Y&2&&q.push(q.pop().concat(q.shift())),M.push(q.filter(Ww))}}return I}}function Ww(o){return o.length>1}function Xw(o,e){return((o=o.x)[0]<0?o[1]-On-Ae:On-o[1])-((e=e.x)[0]<0?e[1]-On-Ae:On-e[1])}var Yw=Sh(function(){return!0},$w,Jw,[-Oe,-On]);function $w(o){var e=NaN,r=NaN,a=NaN,u;return{lineStart:function(){o.lineStart(),u=1},point:function(c,h){var p=c>0?Oe:-Oe,d=mn(c-e);mn(d-Oe)<Ae?(o.point(e,r=(r+h)/2>0?On:-On),o.point(a,r),o.lineEnd(),o.lineStart(),o.point(p,r),o.point(c,r),u=0):a!==p&&d>=Oe&&(mn(e-a)<Ae&&(e-=a*Ae),mn(c-p)<Ae&&(c-=p*Ae),r=Zw(e,r,c,h),o.point(a,r),o.lineEnd(),o.lineStart(),o.point(p,r),u=0),o.point(e=c,r=h),a=p},lineEnd:function(){o.lineEnd(),e=r=NaN},clean:function(){return 2-u}}}function Zw(o,e,r,a){var u,c,h=Lt(o-r);return mn(h)>Ae?bi((Lt(e)*(c=xe(a))*Lt(r)-Lt(a)*(u=xe(e))*Lt(o))/(u*c*h)):(e+a)/2}function Jw(o,e,r,a){var u;if(o==null)u=r*On,a.point(-Oe,u),a.point(0,u),a.point(Oe,u),a.point(Oe,0),a.point(Oe,-u),a.point(0,-u),a.point(-Oe,-u),a.point(-Oe,0),a.point(-Oe,u);else if(mn(o[0]-e[0])>Ae){var c=o[0]<e[0]?Oe:-Oe;u=r*c/2,a.point(-c,u),a.point(0,u),a.point(c,u)}else a.point(e[0],e[1])}function Wu(o){return function(e){var r=new bh;for(var a in o)r[a]=o[a];return r.stream=e,r}}function bh(){}bh.prototype={constructor:bh,point:function(o,e){this.stream.point(o,e)},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 OB=xe(30*Br);var ZB=Wu({point:function(o,e){this.stream.point(o*Br,e*Br)}});function Xu(o){return function(e,r){var a=xe(e),u=xe(r),c=o(a*u);return[c*u*Lt(e),c*Lt(r)]}}function Bi(o){return function(e,r){var a=ar(e*e+r*r),u=o(a),c=Lt(u),h=xe(u);return[zr(e*c,a*h),Ir(a&&r*c/a)]}}var i0=Xu(function(o){return ar(2/(1+o))});i0.invert=Bi(function(o){return 2*Ir(o/2)});var o0=Xu(function(o){return(o=mh(o))&&o/Lt(o)});o0.invert=Bi(function(o){return o});function Ah(o,e){return[o,Ma(wa((On+e)/2))]}Ah.invert=function(o,e){return[o,2*bi(Gu(e))-On]};function Yu(o,e){return[o,e]}Yu.invert=Yu;function s0(o,e){var r=xe(e),a=xe(o)*r;return[r*Lt(o)/a,Lt(e)/a]}s0.invert=Bi(bi);function a0(o,e){var r=e*e,a=r*r;return[o*(.8707-.131979*r+a*(-.013791+a*(.003971*r-.001529*a))),e*(1.007226+r*(.015085+a*(-.044475+.028874*r-.005916*a)))]}a0.invert=function(o,e){var r=e,a=25,u;do{var c=r*r,h=c*c;r-=u=(r*(1.007226+c*(.015085+h*(-.044475+.028874*c-.005916*h)))-e)/(1.007226+c*(.015085*3+h*(-.044475*7+.028874*9*c-.005916*11*h)))}while(mn(u)>Ae&&--a>0);return[o/(.8707+(c=r*r)*(-.131979+c*(-.013791+c*c*c*(.003971-.001529*c)))),r]};function u0(o,e){return[xe(e)*Lt(o),Lt(e)]}u0.invert=Bi(Ir);function l0(o,e){var r=xe(e),a=1+xe(o)*r;return[r*Lt(o)/a,Lt(e)/a]}l0.invert=Bi(function(o){return 2*bi(o)});function c0(o,e){return[Ma(wa((On+e)/2)),-o]}c0.invert=function(o,e){return[-e,2*bi(Gu(o))-On]};var nS=ln(Ds(),1);var rS=ln(Ds(),1);var oS=ln(Ds(),1);var sS=ln(Ds(),1);function wo(o,e){return Math.sqrt((e[0]-o[0])**2+(e[1]-o[1])**2)}function Ch(o){let e=0;for(let r=0;r<o.length-1;r++)e+=wo(o[r],o[r+1]);return e}function f0(o,e,r){let a=new br(e[0]-o[0],e[1]-o[1]),u=new br(e[0]-r[0],e[1]-r[1]),h=a.angleTo(u)*180/Math.PI,p=new br(e[0]-o[0],e[1]-o[1]);return new br(r[0]-o[0],r[1]-o[1]).cross(p)>0?h:-h}var oi="___",$u=class{constructor(e=3){this.lift_priority=e}roadInfo=[];pointMap=new Map;nodeMap=new Map;facilityMap=new Map;straightLadderMap=new Map;escalatorMap=new Map;staircaseMap=new Map;lineMap=new Map;baseRoute=new zi.default;escalatorRoute=new zi.default;straightLadderRoute=new zi.default;initRoute(e){this.clear(),this.roadInfo=e,e.length&&(e.forEach(r=>{r.points.forEach(a=>{let u=\`\${r.floor}\${oi}\${a.id}\`;if(this.pointMap.set(u,a),this.nodeMap.set(\`\${a.floor}\${oi}\${a.nodeId}\`,u),a.type==="straightLadder"){let c=this.straightLadderMap.get(a.name)||[];c.push({...a}),this.straightLadderMap.set(a.name,c)}if(a.type==="staircase"){let c=this.staircaseMap.get(a.name)||[];c.push({...a}),this.staircaseMap.set(a.name,c)}if(a.type==="escalator"){let c=this.escalatorMap.get(a.name)||{};a.escalatorDirection==="exit"?c.end={floor:a.floor,id:a.id}:c.start={floor:a.floor,id:a.id},this.escalatorMap.set(a.name,c)}if(a.type==="facility"){let c=this.facilityMap.get(a.targetId)||[];c.push({...a}),this.facilityMap.set(a.targetId,c)}}),r.lines.filter(a=>a.direction!=="no").forEach(a=>{let u=\`\${r.floor}\${oi}\${a.from}\`,c=\`\${r.floor}\${oi}\${a.to}\`,h=this.pointMap.get(u)?.cds,p=this.pointMap.get(c)?.cds;if(h?.length&&p?.length){let d=wo(h,p);this.addLineItem(u,c,d),a.direction==="double"&&this.addLineItem(c,u,d)}})}),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute())}addLineItem(e,r,a,u=this.lineMap){let c=u.get(e)||new Map;c.set(r,a),u.set(e,c)}addFacilityToLineMap(e,r,a,u){[...this.straightLadderMap,...this.staircaseMap].forEach(([c,h])=>{if(!(h.length<2))for(let p=0;p<h.length;p++){let d=\`\${h[p].floor}\${oi}\${h[p].id}\`;for(let g=0;g<h.length;g++)if(p!==g){let v=\`\${h[g].floor}\${oi}\${h[g].id}\`,x=this.pointMap.get(d)?.cds,M=this.pointMap.get(v)?.cds;if(x?.length&&M?.length)if(h[p].type==="straightLadder"){let w=r;this.addLineItem(d,v,w,u)}else{let w=a;this.addLineItem(d,v,w,u)}}}}),this.escalatorMap.forEach((c,h)=>{if(c.start&&c.end){let p=\`\${c.start.floor}\${oi}\${c.start.id}\`,d=\`\${c.end.floor}\${oi}\${c.end.id}\`,g=this.pointMap.get(p)?.cds,v=this.pointMap.get(d)?.cds;if(g?.length&&v?.length){let x=e;this.addLineItem(p,d,x,u)}}})}initBaseRoute(){let e=new Map([...this.lineMap]);this.addFacilityToLineMap(1,this.lift_priority,3e4,e),this.baseRoute=new zi.default(e)}initEscalatorRoute(){let e=new Map([...this.lineMap]),r=1e4;this.addFacilityToLineMap(1*r,this.lift_priority*r,3e4*r,e),this.escalatorRoute=new zi.default(e)}initStraightLadderRoute(){let e=new Map([...this.lineMap]),r=1e4;this.addFacilityToLineMap(3*r,1*r,3e4*r,e),this.straightLadderRoute=new zi.default(e)}checkStart(e){return!(!e.floor||!e.nodeId&&(!e.coord||e.coord.length<2))}checkEnd(e){return e.facility?!0:this.checkStart(e)}transformStart(e){if(e.nodeId){let r=this.nodeMap.get(\`\${e.floor}\${oi}\${e.nodeId}\`);if(r){let[a,u]=r.split(oi);return{floor:a,id:u}}}if(e.coord?.length){let r=this.roadInfo.find(u=>u.floor===e.floor);if(!r)return null;let a=r.points.reduce((u,c)=>{let h=wo(e.coord,c.cds);return h<u.min&&(u.min=h,u.point=c),u},{min:1/0,point:r.points[0]});return{floor:a.point.floor,id:a.point.id}}return null}transformEnd(e){if(e.floor){let r=this.transformStart(e);if(r)return r}return e.facility&&this.facilityMap.get(e.facility)?.length?{floor:e.floor,facility:e.facility}:null}getPath(e,r,a=""){if(!this.checkStart(e))return"start-error";if(!this.checkEnd(r))return"end-error";let u=this.transformStart(e);if(!u)return"no-start";let c=this.transformEnd(r);if(!c)return"no-end";let h=this.getBasePath.bind(this);switch(a){case"escalator":h=this.getEscalatorPath.bind(this);break;case"straightLadder":h=this.getStraightLadderPath.bind(this);break;default:h=this.getBasePath.bind(this);break}if(c.id)return h(u,c);if(c.facility){let p=this.facilityMap.get(c.facility).filter(g=>c.floor?g.floor===c.floor:!0);if(!p.length)return null;let d=p.map(g=>h(u,{floor:g.floor,id:g.id})).filter(g=>!!g);return d.reduce((g,v)=>{let x=v.reduce((M,w)=>M+Ch(w.points),0);return x<g.distance&&(g.distance=x,g.path=v),g},{distance:1/0,path:d[0]}).path}}getRoutePath(e,r,a){let u=\`\${e.floor}\${oi}\${e.id}\`,c=\`\${r.floor}\${oi}\${r.id}\`,h=a.path(u,c);if(!h)return null;let p=[];return h.map(d=>{let g=this.pointMap.get(d);if(g){let{floor:v}=g;if(p[p.length-1]?.floor===v){let x=p[p.length-1];x.points.push(g.cds),x.endType=g.type,x.destId=g.nodeId,x.distance=Ch(x.points)}else p.push({floor:v,points:[g.cds],endType:g.type,destId:g.nodeId,distance:0})}}),p}getBasePath(e,r){return this.getRoutePath(e,r,this.baseRoute)}getEscalatorPath(e,r){return this.getRoutePath(e,r,this.escalatorRoute)}getStraightLadderPath(e,r){return this.getRoutePath(e,r,this.straightLadderRoute)}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 zi.default,this.escalatorRoute=new zi.default,this.straightLadderRoute=new zi.default}};var mS=ln(y0(),1);function gS(o,e,r){let a=f0(o,e,r);return 180-Math.abs(a)<15?"front":a>135?"right_front":a<-135?"left_front":a<=135&&a>=60?"right":a>=-135&&a<=-60?"left":a<60&&a>0?"right_back":a>-60&&a<0?"left_back":"front"}function v0(o){if(!o.length)return[];if(o.length===1)return[{direction:"start",distance:0,points:o}];let e=[{direction:"start",distance:wo(o[0],o[1]),points:[o[0],o[1]]}];for(let r=2;r<o.length;r++){let a=gS(o[r-2],o[r-1],o[r]);if(a==="front"){let u=e[e.length-1],c=wo(o[r-1],o[r]);u.distance+=c,r!==2&&u.points.push(o[r-1])}else e.push({direction:a,distance:wo(o[r-1],o[r]),points:[o[r-1],o[r]]})}return e.push({direction:"end",distance:0,points:[o[o.length-1]]}),e}function _0(o){return o.replace(/[A-Z]/g,e=>"_"+e.toLowerCase()).replace(/^_/,"")}function x0(o){let e={};for(let a in o)a.startsWith("on")&&(e[_0(a.slice(2))]=o[a]);let r=async({data:a})=>{if(e[a.type])try{let u=await e[a.type](a.data);self.postMessage({type:\`\${a.type}_result\`,key:a.key,data:u})}catch(u){self.postMessage({type:\`\${a.type}_result\`,key:a.key,error:u})}else self.postMessage({type:\`\${a.type}_result\`,key:a.key,error:"no_event"})};return self.addEventListener("message",r),()=>{self.removeEventListener("message",r)}}var Ih=new $u;x0({onSetRoadInfo({roadData:o}){Ih.initRoute(o)},onGetPath({start:o,end:e,type:r}){return Ih.getPath(o,e,r)},onGetDirectionPath(o){return v0(o)},onClear(){Ih.clear()}});
|
|
7227
|
-
`],{type:"text/javascript"}),e=URL.createObjectURL(r),t=new Worker(e);return URL.revokeObjectURL(e),t}var Jo=class extends ju.EventDispatcher{worker=Yo();initRoadStatus=!1;constructor(){super()}async setRoadData(e){this.initRoadStatus=!1,this.dispatchEvent({type:"init-road-status",status:!1}),await Qe(this.worker,"set_road_info",{roadData:e}),this.initRoadStatus=!0,this.dispatchEvent({type:"init-road-status",status:!0})}async getPath(e,t,n=""){return new Promise((i,o)=>{let a=()=>{Qe(this.worker,"get_path",{start:e,end:t,type:n}).then(s=>{s?typeof s=="string"?o(s):i(s):o("no-path")})};if(this.initRoadStatus)a();else{let s=({status:u})=>{u&&(this.removeEventListener("init-road-status",s),a())};this.addEventListener("init-road-status",s)}})}getDirectionPath(e){return Qe(this.worker,"get_direction_path",e)}async dispose(){Qe(this.worker,"clear",""),this.worker.terminate()}};var qu=require("three"),$i=class extends Pe{startPoint;endPoint;rect;frustum=new qu.Frustum;constructor(e){super(e);let{config:{selectBox:{fill:t,stroke:n}}}=e;this.rect=ln(n,t),this.svg.appendChild(this.rect),this.registryEvent()}setEnable(e){super.setEnable(e),se(this.rect,0,0,0,0),e?this.registryEvent():(this.startPoint=void 0,this.unRegistryEvent())}onPointerDown=e=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(e);t&&(this.startPoint=t),this.endPoint=void 0};onPointerMove=e=>{if(!this.enable||!this.startPoint)return;let t=this.getIntersectByPointerEvent(e);t&&(this.endPoint=t)};onPointerUp=e=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(e);t&&(this.endPoint=t),this.doSelect(),this.startPoint=void 0};onUpdate=()=>{if(this.startPoint){let e=this.getSvgCoordinate(this.startPoint),t={...e};this.endPoint&&(t=this.getSvgCoordinate(this.endPoint));let n={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y)},i=Math.abs(t.x-e.x),o=Math.abs(t.y-e.y);se(this.rect,n.x,n.y,i,o)}else se(this.rect,0,0,0,0)};registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointermove",this.onPointerMove),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointermove",this.onPointerMove),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.removeEventListener("update",this.onUpdate)}doSelect(){if(this.startPoint&&this.endPoint){if(this.startPoint.distanceTo(this.endPoint)<.1)return;let{context:{camera:t,container:{clientWidth:n,clientHeight:i}}}=this,o=rt(this.startPoint,t,n,i),a=rt(this.endPoint,t,n,i),s={x:Math.min(o.x,a.x),y:Math.min(o.y,a.y)},u={x:Math.max(o.x,a.x),y:Math.max(o.y,a.y)},c=this.searchMapInFrustum(s,u);this.dispatchEvent({type:"selected",list:c})}}searchMapInFrustum(e,t){let{context:n}=this;return n.currentFloor?.graphicLayer.children.filter(i=>i instanceof Qt&&this.searchChildInFrustum(i,e,t))||[]}searchChildInFrustum(e,t,n){let{context:{camera:i,container:{clientWidth:o,clientHeight:a}}}=this;if(!e)return!1;if(!e.mesh){let p=e.getPosition();if(p){let d=rt(p,i,o,a);return un(d,t,n)}return!1}e.mesh.geometry.boundingBox||e.mesh.geometry.computeBoundingBox();let s=e.mesh.geometry.boundingBox;if(!s)return!1;let{min:u,max:c}=s,l=rt(u,i,o,a),h=rt(c,i,o,a);return!(!un(l,t,n)||!un(h,t,n))}dispose(){this.unRegistryEvent()}};var Vh={boxSelection:!1,elements:["graphic","poi"]},Zo=class extends $e{options;_list=new Set;_poiList=new Set;boxSelection;prevPanStatus;prevRotateStatus;downPoint=null;isMultipleSelect=!1;constructor(e,t={}){super(e),this.options={...Vh,...t},this.boxSelection=new $i(this.bmap.context),this.boxSelection.setEnable(!1),this.registryEvent()}get list(){return this._list}enableBoxSelection(){this.isMultipleSelect||!this.options.boxSelection||(this.isMultipleSelect=!0,this.boxSelection.setEnable(!0),this.prevPanStatus=this.bmap.context.control.enablePan,this.prevRotateStatus=this.bmap.context.control.enableRotate,this.bmap.context.control.enablePan=!1,this.bmap.context.control.enableRotate=!1)}disableBoxSelection(){this.isMultipleSelect&&(this.isMultipleSelect=!1,this.boxSelection.setEnable(!1),this.bmap.context.control.enablePan=!!this.prevPanStatus,this.bmap.context.control.enableRotate=!!this.prevRotateStatus)}onPointerDown=e=>{this.downPoint={x:e.offsetX,y:e.offsetY}};onPointerUp=e=>{if(!this.downPoint)return;let{offsetX:t,offsetY:n}=e,{x:i,y:o}=this.downPoint;if(Math.sqrt((i-t)**2+(o-n)**2)>3)return;let a=new Set,s=[],u=[];if(this.options.elements.includes("graphic")){let{graphics:c}=this.bmap.context.getGraphicsByDeviceXy(t,n);c.map(l=>a.add(l.options.id)),s.push(...c)}if(this.options.elements.includes("poi")){let c=this.bmap.context.getPoisByDeviceXy(t,n);u.push(...c),c.forEach(l=>{if(!a.has(l.options.id)){let h=this.bmap.context.currentFloor?.graphicLayer.graphicMap.get(l.options.id)||null;h&&(a.add(l.options.id),s.push(h))}})}(!this.options.boxSelection||!(Ln?e.metaKey:e.ctrlKey))&&(this._list.clear(),this._poiList.clear()),s.forEach(c=>this._list.add(c)),u.forEach(c=>this._poiList.add(c)),this.selectEnd(),this.downPoint=null};onPointerOut=e=>{this.disableBoxSelection()};onKeyDown=e=>{On(e.key)&&this.enableBoxSelection()};onKeyUp=e=>{On(e.key)&&this.disableBoxSelection()};onBoxSelected=({list:e})=>{this._list.clear(),this._poiList.clear(),e.forEach(t=>{if(this.options.elements.includes("graphic")&&this._list.add(t),this.options.elements.includes("poi")){let n=this.bmap.getPoiById(t.options.id);n&&this._poiList.add(n)}}),this.selectEnd()};selectEnd(){this.dispatchEvent({type:"select",graphics:[...this._list],pois:[...this._poiList],isMultipleSelect:this.isMultipleSelect})}registryEvent(){this.bmap.context.container.addEventListener("pointerdown",this.onPointerDown),this.bmap.context.container.addEventListener("pointerup",this.onPointerUp),this.bmap.context.container.addEventListener("pointerout",this.onPointerOut),this.bmap.context.container.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.boxSelection.addEventListener("selected",this.onBoxSelected)}unRegistryEvent(){this.bmap.context.container.removeEventListener("pointerdown",this.onPointerDown),this.bmap.context.container.removeEventListener("pointerup",this.onPointerUp),this.bmap.context.container.removeEventListener("pointerout",this.onPointerOut),this.bmap.context.container.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp),this.boxSelection.removeEventListener("selected",this.onBoxSelected)}clear(){this._list.clear()}remove(e){this._list.delete(e)}dispose(){this.unRegistryEvent()}};var Ee=require("lodash");var Qu=require("three");var Xh={time:1e3,elements:["compass","deviceMotion","acceleration","gps"]},Kr=class extends Qu.EventDispatcher{options;gpsTimer=null;data=[];timer=new ee;dispatchTimer=null;constructor(e={}){super(),this.options={...Xh,...e}}start(){this.options.elements.some(e=>["deviceMotion","compass"].includes(e))&&this.listenDeviceOrientation(),this.options.elements.includes("acceleration")&&this.listenAcceleration(),this.options.elements.includes("gps")&&this.listenGps(),this.dispatchEvent({type:"start"}),this.dispatchTimer=this.timer.setInterval(()=>{this.dispatchEvent({type:"sensor-data",data:(0,Ee.cloneDeep)(this.data)}),this.data=[]},this.options.time)}addDataItem(e){this.data.push(e),this.dispatchEvent({type:"add-data-item",item:e})}addAcceleration=(0,Ee.throttle)(e=>{this.addDataItem(e)},20);deviceOrientationAbsHandler=(0,Ee.throttle)(e=>{let t=Date.now(),{alpha:n,beta:i,gamma:o}=e;if((0,Ee.isNil)(n)||(0,Ee.isNil)(i)||(0,Ee.isNil)(o))return;let a;Zn?a=e.webkitCompassHeading:a=360-n,this.options.elements.includes("deviceMotion")&&this.addDataItem({type:"deviceMotion",timestamp:t,res:[n,i,o]}),this.options.elements.includes("compass")&&this.addDataItem({type:"compass",timestamp:t,res:a})},200);listenDeviceOrientation(){Zn?window.addEventListener("deviceorientation",this.deviceOrientationAbsHandler,!1):window.addEventListener("deviceorientationabsolute",this.deviceOrientationAbsHandler,{absolute:!0})}handleAcceleration=e=>{let t=e.accelerationIncludingGravity;(0,Ee.isNil)(t)||(0,Ee.isNil)(t.x)||(0,Ee.isNil)(t.y)||(0,Ee.isNil)(t.z)||this.addAcceleration({type:"acceleration",timestamp:Date.now(),res:[t.x,t.y,t.z]})};listenAcceleration(){window.addEventListener("devicemotion",this.handleAcceleration,!1)}listenGps(){this.gpsTimer=navigator.geolocation.watchPosition(e=>{console.log("position",e),this.addDataItem({type:"gps",timestamp:Date.now(),res:[e.coords.longitude,e.coords.latitude,e.coords.accuracy]})})}async checkSensor(){return{deviceOrientation:await this.checkDeviceOrientation()}}async checkDeviceOrientation(){if(!Zn)return!0;if(typeof window.DeviceOrientationEvent<"u"&&typeof window.DeviceOrientationEvent?.requestPermission=="function")try{return await window.DeviceOrientationEvent?.requestPermission()==="granted"}catch{return!1}return!1}stop(){window.removeEventListener("devicemotion",this.handleAcceleration,!1),Zn?window.removeEventListener("deviceorientation",this.deviceOrientationAbsHandler,!1):window.removeEventListener("deviceorientationabsolute",this.deviceOrientationAbsHandler,{absolute:!0}),(0,Ee.isNil)(this.gpsTimer)||navigator.geolocation.clearWatch(this.gpsTimer),this.dispatchTimer&&this.timer.clearInterval(this.dispatchTimer),this.data=[],this.dispatchEvent({type:"stop"})}};var Cl=require("three");function zi(r,e){return 1/Math.sqrt(2*Math.PI*Math.pow(e,2))*Math.exp(-Math.pow(r,2)/(2*Math.pow(e,2)))}function Yr(r){return(r+360)%360}function Wu(r,e){let n=6378137*r*Math.PI/180,i=6378137*Math.log(Math.tan(Math.PI/4+e*Math.PI/180/2));return{x:n,y:i}}function or(r,e,t,n){return Math.sqrt(Math.pow(Math.abs(r-t),2)+Math.pow(Math.abs(e-n),2))}function ar(){return ar=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},ar.apply(null,arguments)}var ta={relTol:1e-12,absTol:1e-15,matrix:"Matrix",number:"number",numberFallback:"number",precision:64,predictable:!1,randomSeed:null};function Ku(r,e){if(Jr(r,e))return r[e];throw typeof r[e]=="function"&&Hh(r,e)?new Error('Cannot access method "'+e+'" as a property'):new Error('No access to property "'+e+'"')}function Yu(r,e,t){if(Jr(r,e))return r[e]=t,t;throw new Error('No access to property "'+e+'"')}function Jr(r,e){return!jh(r)&&!Array.isArray(r)?!1:sr(qh,e)?!0:!(e in Object.prototype||e in Function.prototype)}function Hh(r,e){return r==null||typeof r[e]!="function"||sr(r,e)&&Object.getPrototypeOf&&e in Object.getPrototypeOf(r)?!1:sr(Qh,e)?!0:!(e in Object.prototype||e in Function.prototype)}function jh(r){return typeof r=="object"&&r&&r.constructor===Object}var qh={length:!0,name:!0},Qh={toString:!0,valueOf:!0,toLocaleString:!0};var ki=class{constructor(e){this.wrappedObject=e,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).filter(e=>this.has(e)).values()}get(e){return Ku(this.wrappedObject,e)}set(e,t){return Yu(this.wrappedObject,e,t),this}has(e){return Jr(this.wrappedObject,e)&&e in this.wrappedObject}entries(){return Wh(this.keys(),e=>[e,this.get(e)])}forEach(e){for(var t of this.keys())e(this.get(t),t,this)}delete(e){Jr(this.wrappedObject,e)&&delete this.wrappedObject[e]}clear(){for(var e of this.keys())this.delete(e)}get size(){return Object.keys(this.wrappedObject).length}};function Wh(r,e){return{next:()=>{var t=r.next();return t.done?t:{value:e(t.value),done:!1}}}}function ct(r){return typeof r=="number"}function ht(r){return!r||typeof r!="object"||typeof r.constructor!="function"?!1:r.isBigNumber===!0&&typeof r.constructor.prototype=="object"&&r.constructor.prototype.isBigNumber===!0||typeof r.constructor.isDecimal=="function"&&r.constructor.isDecimal(r)===!0}function Ju(r){return typeof r=="bigint"}function ea(r){return r&&typeof r=="object"&&Object.getPrototypeOf(r).isComplex===!0||!1}function na(r){return r&&typeof r=="object"&&Object.getPrototypeOf(r).isFraction===!0||!1}function Gi(r){return r&&r.constructor.prototype.isUnit===!0||!1}function ye(r){return typeof r=="string"}var Rt=Array.isArray;function yt(r){return r&&r.constructor.prototype.isMatrix===!0||!1}function pn(r){return Array.isArray(r)||yt(r)}function Zu(r){return r&&r.isDenseMatrix&&r.constructor.prototype.isMatrix===!0||!1}function t0(r){return r&&r.isSparseMatrix&&r.constructor.prototype.isMatrix===!0||!1}function e0(r){return r&&r.constructor.prototype.isRange===!0||!1}function ur(r){return r&&r.constructor.prototype.isIndex===!0||!1}function n0(r){return typeof r=="boolean"}function r0(r){return r&&r.constructor.prototype.isResultSet===!0||!1}function i0(r){return r&&r.constructor.prototype.isHelp===!0||!1}function o0(r){return typeof r=="function"}function a0(r){return r instanceof Date}function s0(r){return r instanceof RegExp}function cr(r){return!!(r&&typeof r=="object"&&r.constructor===Object&&!ea(r)&&!na(r))}function u0(r){return r?r instanceof Map||r instanceof ki||typeof r.set=="function"&&typeof r.get=="function"&&typeof r.keys=="function"&&typeof r.has=="function":!1}function c0(r){return r===null}function l0(r){return r===void 0}function h0(r){return r&&r.isAccessorNode===!0&&r.constructor.prototype.isNode===!0||!1}function p0(r){return r&&r.isArrayNode===!0&&r.constructor.prototype.isNode===!0||!1}function f0(r){return r&&r.isAssignmentNode===!0&&r.constructor.prototype.isNode===!0||!1}function d0(r){return r&&r.isBlockNode===!0&&r.constructor.prototype.isNode===!0||!1}function m0(r){return r&&r.isConditionalNode===!0&&r.constructor.prototype.isNode===!0||!1}function g0(r){return r&&r.isConstantNode===!0&&r.constructor.prototype.isNode===!0||!1}function y0(r){return r&&r.isFunctionAssignmentNode===!0&&r.constructor.prototype.isNode===!0||!1}function v0(r){return r&&r.isFunctionNode===!0&&r.constructor.prototype.isNode===!0||!1}function _0(r){return r&&r.isIndexNode===!0&&r.constructor.prototype.isNode===!0||!1}function C0(r){return r&&r.isNode===!0&&r.constructor.prototype.isNode===!0||!1}function A0(r){return r&&r.isObjectNode===!0&&r.constructor.prototype.isNode===!0||!1}function x0(r){return r&&r.isOperatorNode===!0&&r.constructor.prototype.isNode===!0||!1}function E0(r){return r&&r.isParenthesisNode===!0&&r.constructor.prototype.isNode===!0||!1}function b0(r){return r&&r.isRangeNode===!0&&r.constructor.prototype.isNode===!0||!1}function w0(r){return r&&r.isRelationalNode===!0&&r.constructor.prototype.isNode===!0||!1}function S0(r){return r&&r.isSymbolNode===!0&&r.constructor.prototype.isNode===!0||!1}function I0(r){return r&&r.constructor.prototype.isChain===!0||!1}function ce(r){var e=typeof r;return e==="object"?r===null?"null":ht(r)?"BigNumber":r.constructor&&r.constructor.name?r.constructor.name:"Object":e}function bt(r){var e=typeof r;if(e==="number"||e==="bigint"||e==="string"||e==="boolean"||r===null||r===void 0)return r;if(typeof r.clone=="function")return r.clone();if(Array.isArray(r))return r.map(function(t){return bt(t)});if(r instanceof Date)return new Date(r.valueOf());if(ht(r))return r;if(cr(r))return Kh(r,bt);throw new TypeError("Cannot clone: unknown type of value (value: ".concat(r,")"))}function Kh(r,e){var t={};for(var n in r)sr(r,n)&&(t[n]=e(r[n]));return t}function Vi(r,e){for(var t in e)sr(e,t)&&(r[t]=e[t]);return r}function ke(r,e){var t,n,i;if(Array.isArray(r)){if(!Array.isArray(e)||r.length!==e.length)return!1;for(n=0,i=r.length;n<i;n++)if(!ke(r[n],e[n]))return!1;return!0}else{if(typeof r=="function")return r===e;if(r instanceof Object){if(Array.isArray(e)||!(e instanceof Object))return!1;for(t in r)if(!(t in e)||!ke(r[t],e[t]))return!1;for(t in e)if(!(t in r))return!1;return!0}else return r===e}}function sr(r,e){return r&&Object.hasOwnProperty.call(r,e)}function M0(r,e){for(var t={},n=0;n<e.length;n++){var i=e[n],o=r[i];o!==void 0&&(t[i]=o)}return t}var T0=["Matrix","Array"],P0=["number","BigNumber","Fraction"];var Ge=function(e){if(e)throw new Error(`The global config is readonly.
|
|
7227
|
+
`],{type:"text/javascript"}),e=URL.createObjectURL(r),t=new Worker(e);return URL.revokeObjectURL(e),t}var Jo=class extends ju.EventDispatcher{worker=Yo();initRoadStatus=!1;constructor(){super()}async setRoadData(e){this.initRoadStatus=!1,this.dispatchEvent({type:"init-road-status",status:!1}),await Qe(this.worker,"set_road_info",{roadData:e}),this.initRoadStatus=!0,this.dispatchEvent({type:"init-road-status",status:!0})}async getPath(e,t,n=""){return new Promise((i,o)=>{let a=()=>{Qe(this.worker,"get_path",{start:e,end:t,type:n}).then(s=>{s?typeof s=="string"?o(s):i(s):o("no-path")})};if(this.initRoadStatus)a();else{let s=({status:u})=>{u&&(this.removeEventListener("init-road-status",s),a())};this.addEventListener("init-road-status",s)}})}getDirectionPath(e){return Qe(this.worker,"get_direction_path",e)}async dispose(){Qe(this.worker,"clear",""),this.worker.terminate()}};var qu=require("three"),$i=class extends Pe{startPoint;endPoint;rect;frustum=new qu.Frustum;constructor(e){super(e);let{config:{selectBox:{fill:t,stroke:n}}}=e;this.rect=ln(n,t),this.svg.appendChild(this.rect),this.registryEvent()}setEnable(e){super.setEnable(e),se(this.rect,0,0,0,0),e?this.registryEvent():(this.startPoint=void 0,this.unRegistryEvent())}onPointerDown=e=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(e);t&&(this.startPoint=t),this.endPoint=void 0};onPointerMove=e=>{if(!this.enable||!this.startPoint)return;let t=this.getIntersectByPointerEvent(e);t&&(this.endPoint=t)};onPointerUp=e=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(e);t&&(this.endPoint=t),this.doSelect(),this.startPoint=void 0};onUpdate=()=>{if(this.startPoint){let e=this.getSvgCoordinate(this.startPoint),t={...e};this.endPoint&&(t=this.getSvgCoordinate(this.endPoint));let n={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y)},i=Math.abs(t.x-e.x),o=Math.abs(t.y-e.y);se(this.rect,n.x,n.y,i,o)}else se(this.rect,0,0,0,0)};registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointermove",this.onPointerMove),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointermove",this.onPointerMove),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.removeEventListener("update",this.onUpdate)}doSelect(){if(this.startPoint&&this.endPoint){if(this.startPoint.distanceTo(this.endPoint)<.1)return;let{context:{camera:t,container:{clientWidth:n,clientHeight:i}}}=this,o=rt(this.startPoint,t,n,i),a=rt(this.endPoint,t,n,i),s={x:Math.min(o.x,a.x),y:Math.min(o.y,a.y)},u={x:Math.max(o.x,a.x),y:Math.max(o.y,a.y)},c=this.searchMapInFrustum(s,u);this.dispatchEvent({type:"selected",list:c})}}searchMapInFrustum(e,t){let{context:n}=this;return n.currentFloor?.graphicLayer.children.filter(i=>i instanceof Qt&&this.searchChildInFrustum(i,e,t))||[]}searchChildInFrustum(e,t,n){let{context:{camera:i,container:{clientWidth:o,clientHeight:a}}}=this;if(!e)return!1;if(!e.mesh){let p=e.getPosition();if(p){let d=rt(p,i,o,a);return un(d,t,n)}return!1}e.mesh.geometry.boundingBox||e.mesh.geometry.computeBoundingBox();let s=e.mesh.geometry.boundingBox;if(!s)return!1;let{min:u,max:c}=s,l=rt(u,i,o,a),h=rt(c,i,o,a);return!(!un(l,t,n)||!un(h,t,n))}dispose(){this.unRegistryEvent()}};var Vh={boxSelection:!1,elements:["graphic","poi"]},Zo=class extends $e{options;_list=new Set;_poiList=new Set;boxSelection;prevPanStatus;prevRotateStatus;downPoint=null;isMultipleSelect=!1;constructor(e,t={}){super(e),this.options={...Vh,...t},this.boxSelection=new $i(this.bmap.context),this.boxSelection.setEnable(!1),this.registryEvent()}get list(){return this._list}enableBoxSelection(){this.isMultipleSelect||!this.options.boxSelection||(this.isMultipleSelect=!0,this.boxSelection.setEnable(!0),this.prevPanStatus=this.bmap.context.control.enablePan,this.prevRotateStatus=this.bmap.context.control.enableRotate,this.bmap.context.control.enablePan=!1,this.bmap.context.control.enableRotate=!1)}disableBoxSelection(){this.isMultipleSelect&&(this.isMultipleSelect=!1,this.boxSelection.setEnable(!1),this.bmap.context.control.enablePan=!!this.prevPanStatus,this.bmap.context.control.enableRotate=!!this.prevRotateStatus)}onPointerDown=e=>{this.downPoint={x:e.offsetX,y:e.offsetY}};onPointerUp=e=>{if(!this.downPoint)return;let{offsetX:t,offsetY:n}=e,{x:i,y:o}=this.downPoint;if(Math.sqrt((i-t)**2+(o-n)**2)>3)return;let a=new Set,s=[],u=[];if(this.options.elements.includes("graphic")){let{graphics:c}=this.bmap.context.getGraphicsByDeviceXy(t,n);c.map(l=>a.add(l.options.id)),s.push(...c)}if(this.options.elements.includes("poi")){let c=this.bmap.context.getPoisByDeviceXy(t,n);u.push(...c),c.forEach(l=>{if(!a.has(l.options.id)){let h=this.bmap.context.currentFloor?.graphicLayer.graphicMap.get(l.options.id)||null;h&&(a.add(l.options.id),s.push(h))}})}(!this.options.boxSelection||!(Ln?e.metaKey:e.ctrlKey))&&(this._list.clear(),this._poiList.clear()),s.forEach(c=>this._list.add(c)),u.forEach(c=>this._poiList.add(c)),this.selectEnd(),this.downPoint=null};onPointerOut=e=>{this.disableBoxSelection()};onKeyDown=e=>{On(e.key)&&this.enableBoxSelection()};onKeyUp=e=>{On(e.key)&&this.disableBoxSelection()};onBoxSelected=({list:e})=>{this._list.clear(),this._poiList.clear(),e.forEach(t=>{if(this.options.elements.includes("graphic")&&this._list.add(t),this.options.elements.includes("poi")){let n=this.bmap.getPoiById(t.options.id);n&&this._poiList.add(n)}}),this.selectEnd()};selectEnd(){this.dispatchEvent({type:"select",graphics:[...this._list],pois:[...this._poiList],isMultipleSelect:this.isMultipleSelect})}registryEvent(){this.bmap.context.container.addEventListener("pointerdown",this.onPointerDown),this.bmap.context.container.addEventListener("pointerup",this.onPointerUp),this.bmap.context.container.addEventListener("pointerout",this.onPointerOut),this.bmap.context.container.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.boxSelection.addEventListener("selected",this.onBoxSelected)}unRegistryEvent(){this.bmap.context.container.removeEventListener("pointerdown",this.onPointerDown),this.bmap.context.container.removeEventListener("pointerup",this.onPointerUp),this.bmap.context.container.removeEventListener("pointerout",this.onPointerOut),this.bmap.context.container.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp),this.boxSelection.removeEventListener("selected",this.onBoxSelected)}clear(){this._list.clear()}remove(e){this._list.delete(e)}dispose(){this.unRegistryEvent()}};var Ee=require("lodash");var Qu=require("three");var Xh={time:1e3,elements:["compass","deviceMotion","acceleration","gps"]},Kr=class extends Qu.EventDispatcher{options;gpsTimer=null;data=[];timer=new ee;dispatchTimer=null;constructor(e={}){super(),this.options={...Xh,...e}}start(){this.options.elements.some(e=>["deviceMotion","compass"].includes(e))&&this.listenDeviceOrientation(),this.options.elements.includes("acceleration")&&this.listenAcceleration(),this.options.elements.includes("gps")&&this.listenGps(),this.dispatchEvent({type:"start"}),this.dispatchTimer=this.timer.setInterval(()=>{this.dispatchEvent({type:"sensor-data",data:(0,Ee.cloneDeep)(this.data)}),this.data=[]},this.options.time)}addDataItem(e){this.data.push(e),this.dispatchEvent({type:"add-data-item",item:e})}addAcceleration=(0,Ee.throttle)(e=>{this.addDataItem(e)},20);deviceOrientationAbsHandler=(0,Ee.throttle)(e=>{let t=Date.now(),{alpha:n,beta:i,gamma:o}=e;if((0,Ee.isNil)(n)||(0,Ee.isNil)(i)||(0,Ee.isNil)(o))return;let a;Zn?a=e.webkitCompassHeading:a=360-n,this.options.elements.includes("deviceMotion")&&this.addDataItem({type:"deviceMotion",timestamp:t,res:[n,i,o]}),this.options.elements.includes("compass")&&this.addDataItem({type:"compass",timestamp:t,res:a})},200);listenDeviceOrientation(){Zn?window.addEventListener("deviceorientation",this.deviceOrientationAbsHandler,!1):window.addEventListener("deviceorientationabsolute",this.deviceOrientationAbsHandler,{absolute:!0})}handleAcceleration=e=>{let t=e.accelerationIncludingGravity;(0,Ee.isNil)(t)||(0,Ee.isNil)(t.x)||(0,Ee.isNil)(t.y)||(0,Ee.isNil)(t.z)||this.addAcceleration({type:"acceleration",timestamp:Date.now(),res:[t.x,t.y,t.z]})};listenAcceleration(){window.addEventListener("devicemotion",this.handleAcceleration,!1)}listenGps(){this.gpsTimer=navigator.geolocation.watchPosition(e=>{console.log("position",e),this.addDataItem({type:"gps",timestamp:Date.now(),res:[e.coords.longitude,e.coords.latitude,e.coords.accuracy]})},()=>{},{enableHighAccuracy:!0})}async checkSensor(){return{deviceOrientation:await this.checkDeviceOrientation()}}async checkDeviceOrientation(){if(!Zn)return!0;if(typeof window.DeviceOrientationEvent<"u"&&typeof window.DeviceOrientationEvent?.requestPermission=="function")try{return await window.DeviceOrientationEvent?.requestPermission()==="granted"}catch{return!1}return!1}stop(){window.removeEventListener("devicemotion",this.handleAcceleration,!1),Zn?window.removeEventListener("deviceorientation",this.deviceOrientationAbsHandler,!1):window.removeEventListener("deviceorientationabsolute",this.deviceOrientationAbsHandler,{absolute:!0}),(0,Ee.isNil)(this.gpsTimer)||navigator.geolocation.clearWatch(this.gpsTimer),this.dispatchTimer&&this.timer.clearInterval(this.dispatchTimer),this.data=[],this.dispatchEvent({type:"stop"})}};var Cl=require("three");function zi(r,e){return 1/Math.sqrt(2*Math.PI*Math.pow(e,2))*Math.exp(-Math.pow(r,2)/(2*Math.pow(e,2)))}function Yr(r){return(r+360)%360}function Wu(r,e){let n=6378137*r*Math.PI/180,i=6378137*Math.log(Math.tan(Math.PI/4+e*Math.PI/180/2));return{x:n,y:i}}function or(r,e,t,n){return Math.sqrt(Math.pow(Math.abs(r-t),2)+Math.pow(Math.abs(e-n),2))}function ar(){return ar=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},ar.apply(null,arguments)}var ta={relTol:1e-12,absTol:1e-15,matrix:"Matrix",number:"number",numberFallback:"number",precision:64,predictable:!1,randomSeed:null};function Ku(r,e){if(Jr(r,e))return r[e];throw typeof r[e]=="function"&&Hh(r,e)?new Error('Cannot access method "'+e+'" as a property'):new Error('No access to property "'+e+'"')}function Yu(r,e,t){if(Jr(r,e))return r[e]=t,t;throw new Error('No access to property "'+e+'"')}function Jr(r,e){return!jh(r)&&!Array.isArray(r)?!1:sr(qh,e)?!0:!(e in Object.prototype||e in Function.prototype)}function Hh(r,e){return r==null||typeof r[e]!="function"||sr(r,e)&&Object.getPrototypeOf&&e in Object.getPrototypeOf(r)?!1:sr(Qh,e)?!0:!(e in Object.prototype||e in Function.prototype)}function jh(r){return typeof r=="object"&&r&&r.constructor===Object}var qh={length:!0,name:!0},Qh={toString:!0,valueOf:!0,toLocaleString:!0};var ki=class{constructor(e){this.wrappedObject=e,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).filter(e=>this.has(e)).values()}get(e){return Ku(this.wrappedObject,e)}set(e,t){return Yu(this.wrappedObject,e,t),this}has(e){return Jr(this.wrappedObject,e)&&e in this.wrappedObject}entries(){return Wh(this.keys(),e=>[e,this.get(e)])}forEach(e){for(var t of this.keys())e(this.get(t),t,this)}delete(e){Jr(this.wrappedObject,e)&&delete this.wrappedObject[e]}clear(){for(var e of this.keys())this.delete(e)}get size(){return Object.keys(this.wrappedObject).length}};function Wh(r,e){return{next:()=>{var t=r.next();return t.done?t:{value:e(t.value),done:!1}}}}function ct(r){return typeof r=="number"}function ht(r){return!r||typeof r!="object"||typeof r.constructor!="function"?!1:r.isBigNumber===!0&&typeof r.constructor.prototype=="object"&&r.constructor.prototype.isBigNumber===!0||typeof r.constructor.isDecimal=="function"&&r.constructor.isDecimal(r)===!0}function Ju(r){return typeof r=="bigint"}function ea(r){return r&&typeof r=="object"&&Object.getPrototypeOf(r).isComplex===!0||!1}function na(r){return r&&typeof r=="object"&&Object.getPrototypeOf(r).isFraction===!0||!1}function Gi(r){return r&&r.constructor.prototype.isUnit===!0||!1}function ye(r){return typeof r=="string"}var Rt=Array.isArray;function yt(r){return r&&r.constructor.prototype.isMatrix===!0||!1}function pn(r){return Array.isArray(r)||yt(r)}function Zu(r){return r&&r.isDenseMatrix&&r.constructor.prototype.isMatrix===!0||!1}function t0(r){return r&&r.isSparseMatrix&&r.constructor.prototype.isMatrix===!0||!1}function e0(r){return r&&r.constructor.prototype.isRange===!0||!1}function ur(r){return r&&r.constructor.prototype.isIndex===!0||!1}function n0(r){return typeof r=="boolean"}function r0(r){return r&&r.constructor.prototype.isResultSet===!0||!1}function i0(r){return r&&r.constructor.prototype.isHelp===!0||!1}function o0(r){return typeof r=="function"}function a0(r){return r instanceof Date}function s0(r){return r instanceof RegExp}function cr(r){return!!(r&&typeof r=="object"&&r.constructor===Object&&!ea(r)&&!na(r))}function u0(r){return r?r instanceof Map||r instanceof ki||typeof r.set=="function"&&typeof r.get=="function"&&typeof r.keys=="function"&&typeof r.has=="function":!1}function c0(r){return r===null}function l0(r){return r===void 0}function h0(r){return r&&r.isAccessorNode===!0&&r.constructor.prototype.isNode===!0||!1}function p0(r){return r&&r.isArrayNode===!0&&r.constructor.prototype.isNode===!0||!1}function f0(r){return r&&r.isAssignmentNode===!0&&r.constructor.prototype.isNode===!0||!1}function d0(r){return r&&r.isBlockNode===!0&&r.constructor.prototype.isNode===!0||!1}function m0(r){return r&&r.isConditionalNode===!0&&r.constructor.prototype.isNode===!0||!1}function g0(r){return r&&r.isConstantNode===!0&&r.constructor.prototype.isNode===!0||!1}function y0(r){return r&&r.isFunctionAssignmentNode===!0&&r.constructor.prototype.isNode===!0||!1}function v0(r){return r&&r.isFunctionNode===!0&&r.constructor.prototype.isNode===!0||!1}function _0(r){return r&&r.isIndexNode===!0&&r.constructor.prototype.isNode===!0||!1}function C0(r){return r&&r.isNode===!0&&r.constructor.prototype.isNode===!0||!1}function A0(r){return r&&r.isObjectNode===!0&&r.constructor.prototype.isNode===!0||!1}function x0(r){return r&&r.isOperatorNode===!0&&r.constructor.prototype.isNode===!0||!1}function E0(r){return r&&r.isParenthesisNode===!0&&r.constructor.prototype.isNode===!0||!1}function b0(r){return r&&r.isRangeNode===!0&&r.constructor.prototype.isNode===!0||!1}function w0(r){return r&&r.isRelationalNode===!0&&r.constructor.prototype.isNode===!0||!1}function S0(r){return r&&r.isSymbolNode===!0&&r.constructor.prototype.isNode===!0||!1}function I0(r){return r&&r.constructor.prototype.isChain===!0||!1}function ce(r){var e=typeof r;return e==="object"?r===null?"null":ht(r)?"BigNumber":r.constructor&&r.constructor.name?r.constructor.name:"Object":e}function bt(r){var e=typeof r;if(e==="number"||e==="bigint"||e==="string"||e==="boolean"||r===null||r===void 0)return r;if(typeof r.clone=="function")return r.clone();if(Array.isArray(r))return r.map(function(t){return bt(t)});if(r instanceof Date)return new Date(r.valueOf());if(ht(r))return r;if(cr(r))return Kh(r,bt);throw new TypeError("Cannot clone: unknown type of value (value: ".concat(r,")"))}function Kh(r,e){var t={};for(var n in r)sr(r,n)&&(t[n]=e(r[n]));return t}function Vi(r,e){for(var t in e)sr(e,t)&&(r[t]=e[t]);return r}function ke(r,e){var t,n,i;if(Array.isArray(r)){if(!Array.isArray(e)||r.length!==e.length)return!1;for(n=0,i=r.length;n<i;n++)if(!ke(r[n],e[n]))return!1;return!0}else{if(typeof r=="function")return r===e;if(r instanceof Object){if(Array.isArray(e)||!(e instanceof Object))return!1;for(t in r)if(!(t in e)||!ke(r[t],e[t]))return!1;for(t in e)if(!(t in r))return!1;return!0}else return r===e}}function sr(r,e){return r&&Object.hasOwnProperty.call(r,e)}function M0(r,e){for(var t={},n=0;n<e.length;n++){var i=e[n],o=r[i];o!==void 0&&(t[i]=o)}return t}var T0=["Matrix","Array"],P0=["number","BigNumber","Fraction"];var Ge=function(e){if(e)throw new Error(`The global config is readonly.
|
|
7228
7228
|
Please create a mathjs instance if you want to change the default configuration.
|
|
7229
7229
|
Example:
|
|
7230
7230
|
|
package/lib/bmap.esm.js
CHANGED
|
@@ -12220,6 +12220,9 @@ var Sensor = class extends EventDispatcher16 {
|
|
|
12220
12220
|
timestamp: Date.now(),
|
|
12221
12221
|
res: [position.coords.longitude, position.coords.latitude, position.coords.accuracy]
|
|
12222
12222
|
});
|
|
12223
|
+
}, () => {
|
|
12224
|
+
}, {
|
|
12225
|
+
enableHighAccuracy: true
|
|
12223
12226
|
});
|
|
12224
12227
|
}
|
|
12225
12228
|
async checkSensor() {
|
package/lib/bmap.esm.min.js
CHANGED
|
@@ -7224,7 +7224,7 @@ void main() {
|
|
|
7224
7224
|
#include <fog_fragment>
|
|
7225
7225
|
}\`,ve={alphahash_fragment:ty,alphahash_pars_fragment:ey,alphamap_fragment:ny,alphamap_pars_fragment:ry,alphatest_fragment:iy,alphatest_pars_fragment:oy,aomap_fragment:sy,aomap_pars_fragment:ay,batching_pars_vertex:uy,batching_vertex:ly,begin_vertex:cy,beginnormal_vertex:hy,bsdfs:fy,iridescence_fragment:py,bumpmap_pars_fragment:dy,clipping_planes_fragment:my,clipping_planes_pars_fragment:gy,clipping_planes_pars_vertex:yy,clipping_planes_vertex:vy,color_fragment:_y,color_pars_fragment:xy,color_pars_vertex:Ey,color_vertex:My,common:wy,cube_uv_reflection_fragment:Sy,defaultnormal_vertex:by,displacementmap_pars_vertex:Ay,displacementmap_vertex:Ty,emissivemap_fragment:Cy,emissivemap_pars_fragment:Iy,colorspace_fragment:Py,colorspace_pars_fragment:Ry,envmap_fragment:Ny,envmap_common_pars_fragment:Ly,envmap_pars_fragment:Dy,envmap_pars_vertex:Oy,envmap_physical_pars_fragment:Xy,envmap_vertex:Fy,fog_vertex:Uy,fog_pars_vertex:By,fog_fragment:zy,fog_pars_fragment:ky,gradientmap_pars_fragment:Gy,lightmap_pars_fragment:Vy,lights_lambert_fragment:Hy,lights_lambert_pars_fragment:qy,lights_pars_begin:Wy,lights_toon_fragment:Yy,lights_toon_pars_fragment:$y,lights_phong_fragment:Zy,lights_phong_pars_fragment:Jy,lights_physical_fragment:Ky,lights_physical_pars_fragment:Qy,lights_fragment_begin:jy,lights_fragment_maps:tv,lights_fragment_end:ev,logdepthbuf_fragment:nv,logdepthbuf_pars_fragment:rv,logdepthbuf_pars_vertex:iv,logdepthbuf_vertex:ov,map_fragment:sv,map_pars_fragment:av,map_particle_fragment:uv,map_particle_pars_fragment:lv,metalnessmap_fragment:cv,metalnessmap_pars_fragment:hv,morphinstance_vertex:fv,morphcolor_vertex:pv,morphnormal_vertex:dv,morphtarget_pars_vertex:mv,morphtarget_vertex:gv,normal_fragment_begin:yv,normal_fragment_maps:vv,normal_pars_fragment:_v,normal_pars_vertex:xv,normal_vertex:Ev,normalmap_pars_fragment:Mv,clearcoat_normal_fragment_begin:wv,clearcoat_normal_fragment_maps:Sv,clearcoat_pars_fragment:bv,iridescence_pars_fragment:Av,opaque_fragment:Tv,packing:Cv,premultiplied_alpha_fragment:Iv,project_vertex:Pv,dithering_fragment:Rv,dithering_pars_fragment:Nv,roughnessmap_fragment:Lv,roughnessmap_pars_fragment:Dv,shadowmap_pars_fragment:Ov,shadowmap_pars_vertex:Fv,shadowmap_vertex:Uv,shadowmask_pars_fragment:Bv,skinbase_vertex:zv,skinning_pars_vertex:kv,skinning_vertex:Gv,skinnormal_vertex:Vv,specularmap_fragment:Hv,specularmap_pars_fragment:qv,tonemapping_fragment:Wv,tonemapping_pars_fragment:Xv,transmission_fragment:Yv,transmission_pars_fragment:$v,uv_pars_fragment:Zv,uv_pars_vertex:Jv,uv_vertex:Kv,worldpos_vertex:Qv,background_vert:jv,background_frag:t_,backgroundCube_vert:e_,backgroundCube_frag:n_,cube_vert:r_,cube_frag:i_,depth_vert:o_,depth_frag:s_,distanceRGBA_vert:a_,distanceRGBA_frag:u_,equirect_vert:l_,equirect_frag:c_,linedashed_vert:h_,linedashed_frag:f_,meshbasic_vert:p_,meshbasic_frag:d_,meshlambert_vert:m_,meshlambert_frag:g_,meshmatcap_vert:y_,meshmatcap_frag:v_,meshnormal_vert:__,meshnormal_frag:x_,meshphong_vert:E_,meshphong_frag:M_,meshphysical_vert:w_,meshphysical_frag:S_,meshtoon_vert:b_,meshtoon_frag:A_,points_vert:T_,points_frag:C_,shadow_vert:I_,shadow_frag:P_,sprite_vert:R_,sprite_frag:N_},ht={common:{diffuse:{value:new rr(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Dt},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Dt}},envmap:{envMap:{value:null},envMapRotation:{value:new Dt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Dt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Dt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Dt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Dt},normalScale:{value:new br(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Dt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Dt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Dt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Dt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new rr(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new rr(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new rr(16777215)},opacity:{value:1},center:{value:new br(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Dt},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0}}},qf={basic:{uniforms:Or([ht.common,ht.specularmap,ht.envmap,ht.aomap,ht.lightmap,ht.fog]),vertexShader:ve.meshbasic_vert,fragmentShader:ve.meshbasic_frag},lambert:{uniforms:Or([ht.common,ht.specularmap,ht.envmap,ht.aomap,ht.lightmap,ht.emissivemap,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.fog,ht.lights,{emissive:{value:new rr(0)}}]),vertexShader:ve.meshlambert_vert,fragmentShader:ve.meshlambert_frag},phong:{uniforms:Or([ht.common,ht.specularmap,ht.envmap,ht.aomap,ht.lightmap,ht.emissivemap,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.fog,ht.lights,{emissive:{value:new rr(0)},specular:{value:new rr(1118481)},shininess:{value:30}}]),vertexShader:ve.meshphong_vert,fragmentShader:ve.meshphong_frag},standard:{uniforms:Or([ht.common,ht.envmap,ht.aomap,ht.lightmap,ht.emissivemap,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.roughnessmap,ht.metalnessmap,ht.fog,ht.lights,{emissive:{value:new rr(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ve.meshphysical_vert,fragmentShader:ve.meshphysical_frag},toon:{uniforms:Or([ht.common,ht.aomap,ht.lightmap,ht.emissivemap,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.gradientmap,ht.fog,ht.lights,{emissive:{value:new rr(0)}}]),vertexShader:ve.meshtoon_vert,fragmentShader:ve.meshtoon_frag},matcap:{uniforms:Or([ht.common,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.fog,{matcap:{value:null}}]),vertexShader:ve.meshmatcap_vert,fragmentShader:ve.meshmatcap_frag},points:{uniforms:Or([ht.points,ht.fog]),vertexShader:ve.points_vert,fragmentShader:ve.points_frag},dashed:{uniforms:Or([ht.common,ht.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ve.linedashed_vert,fragmentShader:ve.linedashed_frag},depth:{uniforms:Or([ht.common,ht.displacementmap]),vertexShader:ve.depth_vert,fragmentShader:ve.depth_frag},normal:{uniforms:Or([ht.common,ht.bumpmap,ht.normalmap,ht.displacementmap,{opacity:{value:1}}]),vertexShader:ve.meshnormal_vert,fragmentShader:ve.meshnormal_frag},sprite:{uniforms:Or([ht.sprite,ht.fog]),vertexShader:ve.sprite_vert,fragmentShader:ve.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:ve.background_vert,fragmentShader:ve.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Dt}},vertexShader:ve.backgroundCube_vert,fragmentShader:ve.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ve.cube_vert,fragmentShader:ve.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ve.equirect_vert,fragmentShader:ve.equirect_frag},distanceRGBA:{uniforms:Or([ht.common,ht.displacementmap,{referencePosition:{value:new Pe},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ve.distanceRGBA_vert,fragmentShader:ve.distanceRGBA_frag},shadow:{uniforms:Or([ht.lights,ht.fog,{color:{value:new rr(0)},opacity:{value:1}}]),vertexShader:ve.shadow_vert,fragmentShader:ve.shadow_frag}};qf.physical={uniforms:Or([qf.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Dt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Dt},clearcoatNormalScale:{value:new br(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Dt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Dt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Dt},sheen:{value:0},sheenColor:{value:new rr(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Dt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Dt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Dt},transmissionSamplerSize:{value:new br},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Dt},attenuationDistance:{value:0},attenuationColor:{value:new rr(0)},specularColor:{value:new rr(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Dt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Dt},anisotropyVector:{value:new br},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Dt}}]),vertexShader:ve.meshphysical_vert,fragmentShader:ve.meshphysical_frag};var Oo=(1+Math.sqrt(5))/2,cs=1/Oo,bS=[new Pe(-Oo,cs,0),new Pe(Oo,cs,0),new Pe(-cs,0,Oo),new Pe(cs,0,Oo),new Pe(0,Oo,-cs),new Pe(0,Oo,cs),new Pe(-1,1,-1),new Pe(1,1,-1),new Pe(-1,1,1),new Pe(1,1,1)];var AS=new Float32Array(16),TS=new Float32Array(9),CS=new Float32Array(4);var IS={[gf]:yf,[vf]:Mf,[xf]:wf,[_f]:Ef,[yf]:gf,[Mf]:vf,[wf]:xf,[Ef]:_f};function za(o,e,r){return!o||!r&&o.constructor===e?o:typeof e.BYTES_PER_ELEMENT=="number"?new e(o):Array.prototype.slice.call(o)}function L_(o){return ArrayBuffer.isView(o)&&!(o instanceof DataView)}var fs=class{constructor(e,r,a,u){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=u!==void 0?u:new r.constructor(a),this.sampleValues=r,this.valueSize=a,this.settings=null,this.DefaultSettings_={}}evaluate(e){let r=this.parameterPositions,a=this._cachedIndex,u=r[a],c=r[a-1];n:{t:{let h;e:{r:if(!(e<u)){for(let p=a+2;;){if(u===void 0){if(e<c)break r;return a=r.length,this._cachedIndex=a,this.copySampleValue_(a-1)}if(a===p)break;if(c=u,u=r[++a],e<u)break t}h=r.length;break e}if(!(e>=c)){let p=r[1];e<p&&(a=2,c=p);for(let d=a-2;;){if(c===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(a===d)break;if(u=c,c=r[--a-1],e>=c)break t}h=a,a=0;break e}break n}for(;a<h;){let p=a+h>>>1;e<r[p]?h=p:a=p+1}if(u=r[a],c=r[a-1],c===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(u===void 0)return a=r.length,this._cachedIndex=a,this.copySampleValue_(a-1)}this._cachedIndex=a,this.intervalChanged_(a,c,u)}return this.interpolate_(a,c,e,u)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let r=this.resultBuffer,a=this.sampleValues,u=this.valueSize,c=e*u;for(let h=0;h!==u;++h)r[h]=a[c+h];return r}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},bl=class extends fs{constructor(e,r,a,u){super(e,r,a,u),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Af,endingEnd:Af}}intervalChanged_(e,r,a){let u=this.parameterPositions,c=e-2,h=e+1,p=u[c],d=u[h];if(p===void 0)switch(this.getSettings_().endingStart){case Tf:c=e,p=2*r-a;break;case Cf:c=u.length-2,p=r+u[c]-u[c+1];break;default:c=e,p=a}if(d===void 0)switch(this.getSettings_().endingEnd){case Tf:h=e,d=2*a-r;break;case Cf:h=1,d=a+u[1]-u[0];break;default:h=e-1,d=r}let g=(a-r)*.5,v=this.valueSize;this._weightPrev=g/(r-p),this._weightNext=g/(d-a),this._offsetPrev=c*v,this._offsetNext=h*v}interpolate_(e,r,a,u){let c=this.resultBuffer,h=this.sampleValues,p=this.valueSize,d=e*p,g=d-p,v=this._offsetPrev,x=this._offsetNext,M=this._weightPrev,w=this._weightNext,I=(a-r)/(u-r),D=I*I,b=D*I,T=-M*b+2*M*D-M*I,L=(1+M)*b+(-1.5-2*M)*D+(-.5+M)*I+1,P=(-1-w)*b+(1.5+w)*D+.5*I,z=w*b-w*D;for(let k=0;k!==p;++k)c[k]=T*h[v+k]+L*h[g+k]+P*h[d+k]+z*h[x+k];return c}},Al=class extends fs{constructor(e,r,a,u){super(e,r,a,u)}interpolate_(e,r,a,u){let c=this.resultBuffer,h=this.sampleValues,p=this.valueSize,d=e*p,g=d-p,v=(a-r)/(u-r),x=1-v;for(let M=0;M!==p;++M)c[M]=h[g+M]*x+h[d+M]*v;return c}},Tl=class extends fs{constructor(e,r,a,u){super(e,r,a,u)}interpolate_(e){return this.copySampleValue_(e-1)}},wi=class{constructor(e,r,a,u){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(r===void 0||r.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=za(r,this.TimeBufferType),this.values=za(a,this.ValueBufferType),this.setInterpolation(u||this.DefaultInterpolation)}static toJSON(e){let r=e.constructor,a;if(r.toJSON!==this.toJSON)a=r.toJSON(e);else{a={name:e.name,times:za(e.times,Array),values:za(e.values,Array)};let u=e.getInterpolation();u!==e.DefaultInterpolation&&(a.interpolation=u)}return a.type=e.ValueTypeName,a}InterpolantFactoryMethodDiscrete(e){return new Tl(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Al(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new bl(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let r;switch(e){case ka:r=this.InterpolantFactoryMethodDiscrete;break;case xl:r=this.InterpolantFactoryMethodLinear;break;case fl:r=this.InterpolantFactoryMethodSmooth;break}if(r===void 0){let a="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(a);return console.warn("THREE.KeyframeTrack:",a),this}return this.createInterpolant=r,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return ka;case this.InterpolantFactoryMethodLinear:return xl;case this.InterpolantFactoryMethodSmooth:return fl}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){let r=this.times;for(let a=0,u=r.length;a!==u;++a)r[a]+=e}return this}scale(e){if(e!==1){let r=this.times;for(let a=0,u=r.length;a!==u;++a)r[a]*=e}return this}trim(e,r){let a=this.times,u=a.length,c=0,h=u-1;for(;c!==u&&a[c]<e;)++c;for(;h!==-1&&a[h]>r;)--h;if(++h,c!==0||h!==u){c>=h&&(h=Math.max(h,1),c=h-1);let p=this.getValueSize();this.times=a.slice(c,h),this.values=this.values.slice(c*p,h*p)}return this}validate(){let e=!0,r=this.getValueSize();r-Math.floor(r)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let a=this.times,u=this.values,c=a.length;c===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let h=null;for(let p=0;p!==c;p++){let d=a[p];if(typeof d=="number"&&isNaN(d)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,p,d),e=!1;break}if(h!==null&&h>d){console.error("THREE.KeyframeTrack: Out of order keys.",this,p,d,h),e=!1;break}h=d}if(u!==void 0&&L_(u))for(let p=0,d=u.length;p!==d;++p){let g=u[p];if(isNaN(g)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,p,g),e=!1;break}}return e}optimize(){let e=this.times.slice(),r=this.values.slice(),a=this.getValueSize(),u=this.getInterpolation()===fl,c=e.length-1,h=1;for(let p=1;p<c;++p){let d=!1,g=e[p],v=e[p+1];if(g!==v&&(p!==1||g!==e[0]))if(u)d=!0;else{let x=p*a,M=x-a,w=x+a;for(let I=0;I!==a;++I){let D=r[x+I];if(D!==r[M+I]||D!==r[w+I]){d=!0;break}}}if(d){if(p!==h){e[h]=e[p];let x=p*a,M=h*a;for(let w=0;w!==a;++w)r[M+w]=r[x+w]}++h}}if(c>0){e[h]=e[c];for(let p=c*a,d=h*a,g=0;g!==a;++g)r[d+g]=r[p+g];++h}return h!==e.length?(this.times=e.slice(0,h),this.values=r.slice(0,h*a)):(this.times=e,this.values=r),this}clone(){let e=this.times.slice(),r=this.values.slice(),a=this.constructor,u=new a(this.name,e,r);return u.createInterpolant=this.createInterpolant,u}};wi.prototype.TimeBufferType=Float32Array;wi.prototype.ValueBufferType=Float32Array;wi.prototype.DefaultInterpolation=xl;var Fo=class extends wi{constructor(e,r,a){super(e,r,a)}};Fo.prototype.ValueTypeName="bool";Fo.prototype.ValueBufferType=Array;Fo.prototype.DefaultInterpolation=ka;Fo.prototype.InterpolantFactoryMethodLinear=void 0;Fo.prototype.InterpolantFactoryMethodSmooth=void 0;var Cl=class extends wi{};Cl.prototype.ValueTypeName="color";var Il=class extends wi{};Il.prototype.ValueTypeName="number";var Pl=class extends fs{constructor(e,r,a,u){super(e,r,a,u)}interpolate_(e,r,a,u){let c=this.resultBuffer,h=this.sampleValues,p=this.valueSize,d=(a-r)/(u-r),g=e*p;for(let v=g+p;g!==v;g+=4)mo.slerpFlat(c,0,h,g-p,h,g,d);return c}},Ha=class extends wi{InterpolantFactoryMethodLinear(e){return new Pl(this.times,this.values,this.getValueSize(),e)}};Ha.prototype.ValueTypeName="quaternion";Ha.prototype.InterpolantFactoryMethodSmooth=void 0;var Uo=class extends wi{constructor(e,r,a){super(e,r,a)}};Uo.prototype.ValueTypeName="string";Uo.prototype.ValueBufferType=Array;Uo.prototype.DefaultInterpolation=ka;Uo.prototype.InterpolantFactoryMethodLinear=void 0;Uo.prototype.InterpolantFactoryMethodSmooth=void 0;var Rl=class extends wi{};Rl.prototype.ValueTypeName="vector";var Nl=class{constructor(e,r,a){let u=this,c=!1,h=0,p=0,d,g=[];this.onStart=void 0,this.onLoad=e,this.onProgress=r,this.onError=a,this.itemStart=function(v){p++,c===!1&&u.onStart!==void 0&&u.onStart(v,h,p),c=!0},this.itemEnd=function(v){h++,u.onProgress!==void 0&&u.onProgress(v,h,p),h===p&&(c=!1,u.onLoad!==void 0&&u.onLoad())},this.itemError=function(v){u.onError!==void 0&&u.onError(v)},this.resolveURL=function(v){return d?d(v):v},this.setURLModifier=function(v){return d=v,this},this.addHandler=function(v,x){return g.push(v,x),this},this.removeHandler=function(v){let x=g.indexOf(v);return x!==-1&&g.splice(x,2),this},this.getHandler=function(v){for(let x=0,M=g.length;x<M;x+=2){let w=g[x],I=g[x+1];if(w.global&&(w.lastIndex=0),w.test(v))return I}return null}}},D_=new Nl,Ll=class{constructor(e){this.manager=e!==void 0?e:D_,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,r){let a=this;return new Promise(function(u,c){a.load(e,u,r,c)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}};Ll.DEFAULT_MATERIAL_NAME="__DEFAULT";var Ul="\\\\[\\\\]\\\\.:\\\\/",O_=new RegExp("["+Ul+"]","g"),Bl="[^"+Ul+"]",F_="[^"+Ul.replace("\\\\.","")+"]",U_=/((?:WC+[\\/:])*)/.source.replace("WC",Bl),B_=/(WCOD+)?/.source.replace("WCOD",F_),z_=/(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace("WC",Bl),k_=/\\.(WC+)(?:\\[(.+)\\])?/.source.replace("WC",Bl),G_=new RegExp("^"+U_+B_+z_+k_+"$"),V_=["material","materials","bones","map"],Dl=class{constructor(e,r,a){let u=a||on.parseTrackName(r);this._targetGroup=e,this._bindings=e.subscribe_(r,u)}getValue(e,r){this.bind();let a=this._targetGroup.nCachedObjects_,u=this._bindings[a];u!==void 0&&u.getValue(e,r)}setValue(e,r){let a=this._bindings;for(let u=this._targetGroup.nCachedObjects_,c=a.length;u!==c;++u)a[u].setValue(e,r)}bind(){let e=this._bindings;for(let r=this._targetGroup.nCachedObjects_,a=e.length;r!==a;++r)e[r].bind()}unbind(){let e=this._bindings;for(let r=this._targetGroup.nCachedObjects_,a=e.length;r!==a;++r)e[r].unbind()}},on=class o{constructor(e,r,a){this.path=r,this.parsedPath=a||o.parseTrackName(r),this.node=o.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,r,a){return e&&e.isAnimationObjectGroup?new o.Composite(e,r,a):new o(e,r,a)}static sanitizeNodeName(e){return e.replace(/\\s/g,"_").replace(O_,"")}static parseTrackName(e){let r=G_.exec(e);if(r===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let a={nodeName:r[2],objectName:r[3],objectIndex:r[4],propertyName:r[5],propertyIndex:r[6]},u=a.nodeName&&a.nodeName.lastIndexOf(".");if(u!==void 0&&u!==-1){let c=a.nodeName.substring(u+1);V_.indexOf(c)!==-1&&(a.nodeName=a.nodeName.substring(0,u),a.objectName=c)}if(a.propertyName===null||a.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return a}static findNode(e,r){if(r===void 0||r===""||r==="."||r===-1||r===e.name||r===e.uuid)return e;if(e.skeleton){let a=e.skeleton.getBoneByName(r);if(a!==void 0)return a}if(e.children){let a=function(c){for(let h=0;h<c.length;h++){let p=c[h];if(p.name===r||p.uuid===r)return p;let d=a(p.children);if(d)return d}return null},u=a(e.children);if(u)return u}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,r){e[r]=this.targetObject[this.propertyName]}_getValue_array(e,r){let a=this.resolvedProperty;for(let u=0,c=a.length;u!==c;++u)e[r++]=a[u]}_getValue_arrayElement(e,r){e[r]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,r){this.resolvedProperty.toArray(e,r)}_setValue_direct(e,r){this.targetObject[this.propertyName]=e[r]}_setValue_direct_setNeedsUpdate(e,r){this.targetObject[this.propertyName]=e[r],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,r){this.targetObject[this.propertyName]=e[r],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,r){let a=this.resolvedProperty;for(let u=0,c=a.length;u!==c;++u)a[u]=e[r++]}_setValue_array_setNeedsUpdate(e,r){let a=this.resolvedProperty;for(let u=0,c=a.length;u!==c;++u)a[u]=e[r++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,r){let a=this.resolvedProperty;for(let u=0,c=a.length;u!==c;++u)a[u]=e[r++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,r){this.resolvedProperty[this.propertyIndex]=e[r]}_setValue_arrayElement_setNeedsUpdate(e,r){this.resolvedProperty[this.propertyIndex]=e[r],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,r){this.resolvedProperty[this.propertyIndex]=e[r],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,r){this.resolvedProperty.fromArray(e,r)}_setValue_fromArray_setNeedsUpdate(e,r){this.resolvedProperty.fromArray(e,r),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,r){this.resolvedProperty.fromArray(e,r),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,r){this.bind(),this.getValue(e,r)}_setValue_unbound(e,r){this.bind(),this.setValue(e,r)}bind(){let e=this.node,r=this.parsedPath,a=r.objectName,u=r.propertyName,c=r.propertyIndex;if(e||(e=o.findNode(this.rootNode,r.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(a){let g=r.objectIndex;switch(a){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let v=0;v<e.length;v++)if(e[v].name===g){g=v;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[a]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[a]}if(g!==void 0){if(e[g]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[g]}}let h=e[u];if(h===void 0){let g=r.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+g+"."+u+" but it wasn't found.",e);return}let p=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?p=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(p=this.Versioning.MatrixWorldNeedsUpdate);let d=this.BindingType.Direct;if(c!==void 0){if(u==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[c]!==void 0&&(c=e.morphTargetDictionary[c])}d=this.BindingType.ArrayElement,this.resolvedProperty=h,this.propertyIndex=c}else h.fromArray!==void 0&&h.toArray!==void 0?(d=this.BindingType.HasFromToArray,this.resolvedProperty=h):Array.isArray(h)?(d=this.BindingType.EntireArray,this.resolvedProperty=h):this.propertyName=u;this.getValue=this.GetterByBindingType[d],this.setValue=this.SetterByBindingTypeAndVersioning[d][p]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};on.Composite=Dl;on.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};on.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};on.prototype.GetterByBindingType=[on.prototype._getValue_direct,on.prototype._getValue_array,on.prototype._getValue_arrayElement,on.prototype._getValue_toArray];on.prototype.SetterByBindingTypeAndVersioning=[[on.prototype._setValue_direct,on.prototype._setValue_direct_setNeedsUpdate,on.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[on.prototype._setValue_array,on.prototype._setValue_array_setNeedsUpdate,on.prototype._setValue_array_setMatrixWorldNeedsUpdate],[on.prototype._setValue_arrayElement,on.prototype._setValue_arrayElement_setNeedsUpdate,on.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[on.prototype._setValue_fromArray,on.prototype._setValue_fromArray_setNeedsUpdate,on.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var PS=new Float32Array(1);typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Wf}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Wf);var Xn=63710088e-1,NS={centimeters:Xn*100,centimetres:Xn*100,degrees:Xn/111325,feet:Xn*3.28084,inches:Xn*39.37,kilometers:Xn/1e3,kilometres:Xn/1e3,meters:Xn,metres:Xn,miles:Xn/1609.344,millimeters:Xn*1e3,millimetres:Xn*1e3,nauticalmiles:Xn/1852,radians:1,yards:Xn*1.0936},LS={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/Xn,yards:1.0936133};function Ar(o,e,r){r===void 0&&(r={});var a={type:"Feature"};return(r.id===0||r.id)&&(a.id=r.id),r.bbox&&(a.bbox=r.bbox),a.properties=e||{},a.geometry=o,a}function He(o,e,r){if(r===void 0&&(r={}),!o)throw new Error("coordinates is required");if(!Array.isArray(o))throw new Error("coordinates must be an Array");if(o.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Li(o[0])||!Li(o[1]))throw new Error("coordinates must contain numbers");var a={type:"Point",coordinates:o};return Ar(a,e,r)}function sn(o,e,r){r===void 0&&(r={});for(var a=0,u=o;a<u.length;a++){var c=u[a];if(c.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var h=0;h<c[c.length-1].length;h++)if(c[c.length-1][h]!==c[0][h])throw new Error("First and last Position are not equivalent.")}var p={type:"Polygon",coordinates:o};return Ar(p,e,r)}function Yn(o,e,r){if(r===void 0&&(r={}),o.length<2)throw new Error("coordinates must be an array of two or more positions");var a={type:"LineString",coordinates:o};return Ar(a,e,r)}function zl(o,e,r){r===void 0&&(r={});var a={type:"MultiPoint",coordinates:o};return Ar(a,e,r)}function Li(o){return!isNaN(o)&&o!==null&&!Array.isArray(o)}function Nn(o,e,r){if(o!==null)for(var a,u,c,h,p,d,g,v=0,x=0,M,w=o.type,I=w==="FeatureCollection",D=w==="Feature",b=I?o.features.length:1,T=0;T<b;T++){g=I?o.features[T].geometry:D?o.geometry:o,M=g?g.type==="GeometryCollection":!1,p=M?g.geometries.length:1;for(var L=0;L<p;L++){var P=0,z=0;if(h=M?g.geometries[L]:g,h!==null){d=h.coordinates;var k=h.type;switch(v=r&&(k==="Polygon"||k==="MultiPolygon")?1:0,k){case null:break;case"Point":if(e(d,x,T,P,z)===!1)return!1;x++,P++;break;case"LineString":case"MultiPoint":for(a=0;a<d.length;a++){if(e(d[a],x,T,P,z)===!1)return!1;x++,k==="MultiPoint"&&P++}k==="LineString"&&P++;break;case"Polygon":case"MultiLineString":for(a=0;a<d.length;a++){for(u=0;u<d[a].length-v;u++){if(e(d[a][u],x,T,P,z)===!1)return!1;x++}k==="MultiLineString"&&P++,k==="Polygon"&&z++}k==="Polygon"&&P++;break;case"MultiPolygon":for(a=0;a<d.length;a++){for(z=0,u=0;u<d[a].length;u++){for(c=0;c<d[a][u].length-v;c++){if(e(d[a][u][c],x,T,P,z)===!1)return!1;x++}z++}P++}break;case"GeometryCollection":for(a=0;a<h.geometries.length;a++)if(Nn(h.geometries[a],e,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Jf(o,e,r,a){var u=r;return Nn(o,function(c,h,p,d,g){h===0&&r===void 0?u=c:u=e(u,c,h,p,d,g)},a),u}function go(o,e){var r,a,u,c,h,p,d,g,v,x,M=0,w=o.type==="FeatureCollection",I=o.type==="Feature",D=w?o.features.length:1;for(r=0;r<D;r++){for(p=w?o.features[r].geometry:I?o.geometry:o,g=w?o.features[r].properties:I?o.properties:{},v=w?o.features[r].bbox:I?o.bbox:void 0,x=w?o.features[r].id:I?o.id:void 0,d=p?p.type==="GeometryCollection":!1,h=d?p.geometries.length:1,u=0;u<h;u++){if(c=d?p.geometries[u]:p,c===null){if(e(null,M,g,v,x)===!1)return!1;continue}switch(c.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(c,M,g,v,x)===!1)return!1;break}case"GeometryCollection":{for(a=0;a<c.geometries.length;a++)if(e(c.geometries[a],M,g,v,x)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}M++}}function Xr(o,e){go(o,function(r,a,u,c,h){var p=r===null?null:r.type;switch(p){case null:case"Point":case"LineString":case"Polygon":return e(Ar(r,u,{bbox:c,id:h}),a,0)===!1?!1:void 0}var d;switch(p){case"MultiPoint":d="Point";break;case"MultiLineString":d="LineString";break;case"MultiPolygon":d="Polygon";break}for(var g=0;g<r.coordinates.length;g++){var v=r.coordinates[g],x={type:d,coordinates:v};if(e(Ar(x,u),a,g)===!1)return!1}})}function kl(o){var e=[1/0,1/0,-1/0,-1/0];return Nn(o,function(r){e[0]>r[0]&&(e[0]=r[0]),e[1]>r[1]&&(e[1]=r[1]),e[2]<r[0]&&(e[2]=r[0]),e[3]<r[1]&&(e[3]=r[1])}),e}kl.default=kl;var Tr=kl;function ir(o){if(!o)throw new Error("coord is required");if(!Array.isArray(o)){if(o.type==="Feature"&&o.geometry!==null&&o.geometry.type==="Point")return o.geometry.coordinates;if(o.type==="Point")return o.coordinates}if(Array.isArray(o)&&o.length>=2&&!Array.isArray(o[0])&&!Array.isArray(o[1]))return o;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Gl(o,e,r){if(!o)throw new Error("No feature passed");if(!r)throw new Error(".featureOf() requires a name");if(!o||o.type!=="Feature"||!o.geometry)throw new Error("Invalid input to "+r+", Feature with geometry required");if(!o.geometry||o.geometry.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+o.geometry.type)}function or(o){return o.type==="Feature"?o.geometry:o}var J_=ln(qa(),1);var s1=ln(dp(),1);function $n(o,e,r){if(r===void 0&&(r={}),!o)throw new Error("point is required");if(!e)throw new Error("polygon is required");var a=ir(o),u=or(e),c=u.type,h=e.bbox,p=u.coordinates;if(h&&a1(a,h)===!1)return!1;c==="Polygon"&&(p=[p]);for(var d=!1,g=0;g<p.length&&!d;g++)if(mp(a,p[g][0],r.ignoreBoundary)){for(var v=!1,x=1;x<p[g].length&&!v;)mp(a,p[g][x],!r.ignoreBoundary)&&(v=!0),x++;v||(d=!0)}return d}function mp(o,e,r){var a=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var u=0,c=e.length-1;u<e.length;c=u++){var h=e[u][0],p=e[u][1],d=e[c][0],g=e[c][1],v=o[1]*(h-d)+p*(d-o[0])+g*(o[0]-h)===0&&(h-o[0])*(d-o[0])<=0&&(p-o[1])*(g-o[1])<=0;if(v)return!r;var x=p>o[1]!=g>o[1]&&o[0]<(d-h)*(o[1]-p)/(g-p)+h;x&&(a=!a)}return a}function a1(o,e){return e[0]<=o[0]&&e[1]<=o[1]&&e[2]>=o[0]&&e[3]>=o[1]}var vp=new ArrayBuffer(16),uA=new Float64Array(vp),lA=new Uint32Array(vp);var M1=ln(rc(),1);var OT=function(){function o(e){this.points=e.points||[],this.duration=e.duration||1e4,this.sharpness=e.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=e.stepLength||60,this.length=this.points.length,this.delay=0;for(var r=0;r<this.length;r++)this.points[r].z=this.points[r].z||0;for(var r=0;r<this.length-1;r++){var a=this.points[r],u=this.points[r+1];this.centers.push({x:(a.x+u.x)/2,y:(a.y+u.y)/2,z:(a.z+u.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var r=0;r<this.centers.length-1;r++){var c=this.points[r+1].x-(this.centers[r].x+this.centers[r+1].x)/2,h=this.points[r+1].y-(this.centers[r].y+this.centers[r+1].y)/2,p=this.points[r+1].z-(this.centers[r].y+this.centers[r+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[r+1].x+this.sharpness*(this.centers[r].x+c),y:(1-this.sharpness)*this.points[r+1].y+this.sharpness*(this.centers[r].y+h),z:(1-this.sharpness)*this.points[r+1].z+this.sharpness*(this.centers[r].z+p)},{x:(1-this.sharpness)*this.points[r+1].x+this.sharpness*(this.centers[r+1].x+c),y:(1-this.sharpness)*this.points[r+1].y+this.sharpness*(this.centers[r+1].y+h),z:(1-this.sharpness)*this.points[r+1].z+this.sharpness*(this.centers[r+1].z+p)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}return o.prototype.cacheSteps=function(e){var r=[],a=this.pos(0);r.push(0);for(var u=0;u<this.duration;u+=10){var c=this.pos(u),h=Math.sqrt((c.x-a.x)*(c.x-a.x)+(c.y-a.y)*(c.y-a.y)+(c.z-a.z)*(c.z-a.z));h>e&&(r.push(u),a=c)}return r},o.prototype.vector=function(e){var r=this.pos(e+10),a=this.pos(e-10);return{angle:180*Math.atan2(r.y-a.y,r.x-a.x)/3.14,speed:Math.sqrt((a.x-r.x)*(a.x-r.x)+(a.y-r.y)*(a.y-r.y)+(a.z-r.z)*(a.z-r.z))}},o.prototype.pos=function(e){var r=e-this.delay;r<0&&(r=0),r>this.duration&&(r=this.duration-1);var a=r/this.duration;if(a>=1)return this.points[this.length-1];var u=Math.floor((this.points.length-1)*a),c=(this.length-1)*a-u;return w1(c,this.points[u],this.controls[u][1],this.controls[u+1][0],this.points[u+1])},o}();function w1(o,e,r,a,u){var c=S1(o),h={x:u.x*c[0]+a.x*c[1]+r.x*c[2]+e.x*c[3],y:u.y*c[0]+a.y*c[1]+r.y*c[2]+e.y*c[3],z:u.z*c[0]+a.z*c[1]+r.z*c[2]+e.z*c[3]};return h}function S1(o){var e=o*o,r=e*o;return[r,3*e*(1-o),3*o*(1-o)*(1-o),(1-o)*(1-o)*(1-o)]}function oa(o,e){e===void 0&&(e={});var r=Number(o[0]),a=Number(o[1]),u=Number(o[2]),c=Number(o[3]);if(o.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var h=[r,a],p=[r,c],d=[u,c],g=[u,a];return sn([[h,g,d,p,h]],e.properties,{bbox:o,id:e.id})}function b1(o){return oa(Tr(o))}var ic=b1;var V1=ln(Ip(),1);var mx=ln(au(),1);var yx=ln(qa(),1);var xx=ln(rc(),1);var Yp=Math.PI/180,$p=180/Math.PI,fa=function(o,e){this.lon=o,this.lat=e,this.x=Yp*o,this.y=Yp*e};fa.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)};fa.prototype.antipode=function(){var o=-1*this.lat,e=this.lon<0?180+this.lon:(180-this.lon)*-1;return new fa(e,o)};var Zp=function(){this.coords=[],this.length=0};Zp.prototype.move_to=function(o){this.length++,this.coords.push(o)};var Sc=function(o){this.properties=o||{},this.geometries=[]};Sc.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 o=[],e=0;e<this.geometries.length;e++)o.push(this.geometries[e].coords);return{geometry:{type:"MultiLineString",coordinates:o},type:"Feature",properties:this.properties}};Sc.prototype.wkt=function(){for(var o="",e="LINESTRING(",r=function(c){e+=c[0]+" "+c[1]+","},a=0;a<this.geometries.length;a++){if(this.geometries[a].coords.length===0)return"LINESTRING(empty)";var u=this.geometries[a].coords;u.forEach(r),o+=e.substring(0,e.length-1)+")"}return o};var Jp=function(o,e,r){if(!o||o.x===void 0||o.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!e||e.x===void 0||e.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new fa(o.x,o.y),this.end=new fa(e.x,e.y),this.properties=r||{};var a=this.start.x-this.end.x,u=this.start.y-this.end.y,c=Math.pow(Math.sin(u/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(a/2),2);if(this.g=2*Math.asin(Math.sqrt(c)),this.g===Math.PI)throw new Error("it appears "+o.view()+" and "+e.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 "+o+" and "+e)};Jp.prototype.interpolate=function(o){var e=Math.sin((1-o)*this.g)/Math.sin(this.g),r=Math.sin(o*this.g)/Math.sin(this.g),a=e*Math.cos(this.start.y)*Math.cos(this.start.x)+r*Math.cos(this.end.y)*Math.cos(this.end.x),u=e*Math.cos(this.start.y)*Math.sin(this.start.x)+r*Math.cos(this.end.y)*Math.sin(this.end.x),c=e*Math.sin(this.start.y)+r*Math.sin(this.end.y),h=$p*Math.atan2(c,Math.sqrt(Math.pow(a,2)+Math.pow(u,2))),p=$p*Math.atan2(u,a);return[p,h]};Jp.prototype.Arc=function(o,e){var r=[];if(!o||o<=2)r.push([this.start.lon,this.start.lat]),r.push([this.end.lon,this.end.lat]);else for(var a=1/(o-1),u=0;u<o;++u){var c=a*u,h=this.interpolate(c);r.push(h)}for(var p=!1,d=0,g=e&&e.offset?e.offset:10,v=180-g,x=-180+g,M=360-g,w=1;w<r.length;++w){var I=r[w-1][0],D=r[w][0],b=Math.abs(D-I);b>M&&(D>v&&I<x||I>v&&D<x)?p=!0:b>d&&(d=b)}var T=[];if(p&&d<g){var L=[];T.push(L);for(var P=0;P<r.length;++P){var z=parseFloat(r[P][0]);if(P>0&&Math.abs(z-r[P-1][0])>M){var k=parseFloat(r[P-1][0]),Y=parseFloat(r[P-1][1]),q=parseFloat(r[P][0]),C=parseFloat(r[P][1]);if(k>-180&&k<x&&q===180&&P+1<r.length&&r[P-1][0]>-180&&r[P-1][0]<x){L.push([-180,r[P][1]]),P++,L.push([r[P][0],r[P][1]]);continue}else if(k>v&&k<180&&q===-180&&P+1<r.length&&r[P-1][0]>v&&r[P-1][0]<180){L.push([180,r[P][1]]),P++,L.push([r[P][0],r[P][1]]);continue}if(k<x&&q>v){var ot=k;k=q,q=ot;var pt=Y;Y=C,C=pt}if(k>v&&q<x&&(q+=360),k<=180&&q>=180&&k<q){var dt=(180-k)/(q-k),F=dt*C+(1-dt)*Y;L.push([r[P-1][0]>v?180:-180,F]),L=[],L.push([r[P-1][0]>v?-180:180,F]),T.push(L)}else L=[],T.push(L);L.push([z,r[P][1]])}else L.push([r[P][0],r[P][1]])}}else{var ye=[];T.push(ye);for(var et=0;et<r.length;++et)ye.push([r[et][0],r[et][1]])}for(var St=new Sc(this.properties),Pt=0;Pt<T.length;++Pt){var Rt=new Zp;St.geometries.push(Rt);for(var it=T[Pt],mt=0;mt<it.length;++mt)Rt.move_to(it[mt])}return St};var wx=ln(au(),1);var nM=ln(au(),1);var rM=ln(Xc(),1);var sM=ln(qa(),1);var Ot=[],Ft=[],Ut=[],Bt=[],zt=[],kt=[],Gt=[],Vt=[],Ht=[],qt=[],Wt=[],Xt=[],Yt=[],$t=[],Zt=[],Jt=[],Kt=[],Qt=[],jt=[],te=[],ee=[],ne=[],re=[],ie=[];Gt[85]=qt[85]=-1;Vt[85]=Wt[85]=0;Ht[85]=Xt[85]=1;jt[85]=ne[85]=1;te[85]=re[85]=0;ee[85]=ie[85]=1;Ot[85]=Bt[85]=0;Ft[85]=zt[85]=-1;Ut[85]=Zt[85]=0;Jt[85]=Yt[85]=0;Kt[85]=$t[85]=1;kt[85]=Qt[85]=1;ne[1]=ne[169]=0;re[1]=re[169]=-1;ie[1]=ie[169]=0;Yt[1]=Yt[169]=-1;$t[1]=$t[169]=0;Zt[1]=Zt[169]=0;qt[4]=qt[166]=0;Wt[4]=Wt[166]=-1;Xt[4]=Xt[166]=1;Jt[4]=Jt[166]=1;Kt[4]=Kt[166]=0;Qt[4]=Qt[166]=0;Gt[16]=Gt[154]=0;Vt[16]=Vt[154]=1;Ht[16]=Ht[154]=1;Bt[16]=Bt[154]=1;zt[16]=zt[154]=0;kt[16]=kt[154]=1;jt[64]=jt[106]=0;te[64]=te[106]=1;ee[64]=ee[106]=0;Ot[64]=Ot[106]=-1;Ft[64]=Ft[106]=0;Ut[64]=Ut[106]=1;jt[2]=jt[168]=0;te[2]=te[168]=-1;ee[2]=ee[168]=1;ne[2]=ne[168]=0;re[2]=re[168]=-1;ie[2]=ie[168]=0;Yt[2]=Yt[168]=-1;$t[2]=$t[168]=0;Zt[2]=Zt[168]=0;Jt[2]=Jt[168]=-1;Kt[2]=Kt[168]=0;Qt[2]=Qt[168]=1;Gt[8]=Gt[162]=0;Vt[8]=Vt[162]=-1;Ht[8]=Ht[162]=0;qt[8]=qt[162]=0;Wt[8]=Wt[162]=-1;Xt[8]=Xt[162]=1;Yt[8]=Yt[162]=1;$t[8]=$t[162]=0;Zt[8]=Zt[162]=1;Jt[8]=Jt[162]=1;Kt[8]=Kt[162]=0;Qt[8]=Qt[162]=0;Gt[32]=Gt[138]=0;Vt[32]=Vt[138]=1;Ht[32]=Ht[138]=1;qt[32]=qt[138]=0;Wt[32]=Wt[138]=1;Xt[32]=Xt[138]=0;Ot[32]=Ot[138]=1;Ft[32]=Ft[138]=0;Ut[32]=Ut[138]=0;Bt[32]=Bt[138]=1;zt[32]=zt[138]=0;kt[32]=kt[138]=1;ne[128]=ne[42]=0;re[128]=re[42]=1;ie[128]=ie[42]=1;jt[128]=jt[42]=0;te[128]=te[42]=1;ee[128]=ee[42]=0;Ot[128]=Ot[42]=-1;Ft[128]=Ft[42]=0;Ut[128]=Ut[42]=1;Bt[128]=Bt[42]=-1;zt[128]=zt[42]=0;kt[128]=kt[42]=0;qt[5]=qt[165]=-1;Wt[5]=Wt[165]=0;Xt[5]=Xt[165]=0;ne[5]=ne[165]=1;re[5]=re[165]=0;ie[5]=ie[165]=0;Jt[20]=Jt[150]=0;Kt[20]=Kt[150]=1;Qt[20]=Qt[150]=1;Bt[20]=Bt[150]=0;zt[20]=zt[150]=-1;kt[20]=kt[150]=1;Gt[80]=Gt[90]=-1;Vt[80]=Vt[90]=0;Ht[80]=Ht[90]=1;jt[80]=jt[90]=1;te[80]=te[90]=0;ee[80]=ee[90]=1;Yt[65]=Yt[105]=0;$t[65]=$t[105]=1;Zt[65]=Zt[105]=0;Ot[65]=Ot[105]=0;Ft[65]=Ft[105]=-1;Ut[65]=Ut[105]=0;Gt[160]=Gt[10]=-1;Vt[160]=Vt[10]=0;Ht[160]=Ht[10]=1;qt[160]=qt[10]=-1;Wt[160]=Wt[10]=0;Xt[160]=Xt[10]=0;ne[160]=ne[10]=1;re[160]=re[10]=0;ie[160]=ie[10]=0;jt[160]=jt[10]=1;te[160]=te[10]=0;ee[160]=ee[10]=1;Jt[130]=Jt[40]=0;Kt[130]=Kt[40]=1;Qt[130]=Qt[40]=1;Yt[130]=Yt[40]=0;$t[130]=$t[40]=1;Zt[130]=Zt[40]=0;Ot[130]=Ot[40]=0;Ft[130]=Ft[40]=-1;Ut[130]=Ut[40]=0;Bt[130]=Bt[40]=0;zt[130]=zt[40]=-1;kt[130]=kt[40]=1;qt[37]=qt[133]=0;Wt[37]=Wt[133]=1;Xt[37]=Xt[133]=1;ne[37]=ne[133]=0;re[37]=re[133]=1;ie[37]=ie[133]=0;Ot[37]=Ot[133]=-1;Ft[37]=Ft[133]=0;Ut[37]=Ut[133]=0;Bt[37]=Bt[133]=1;zt[37]=zt[133]=0;kt[37]=kt[133]=0;Jt[148]=Jt[22]=-1;Kt[148]=Kt[22]=0;Qt[148]=Qt[22]=0;ne[148]=ne[22]=0;re[148]=re[22]=-1;ie[148]=ie[22]=1;jt[148]=jt[22]=0;te[148]=te[22]=1;ee[148]=ee[22]=1;Bt[148]=Bt[22]=-1;zt[148]=zt[22]=0;kt[148]=kt[22]=1;Gt[82]=Gt[88]=0;Vt[82]=Vt[88]=-1;Ht[82]=Ht[88]=1;Jt[82]=Jt[88]=1;Kt[82]=Kt[88]=0;Qt[82]=Qt[88]=1;Yt[82]=Yt[88]=-1;$t[82]=$t[88]=0;Zt[82]=Zt[88]=1;jt[82]=jt[88]=0;te[82]=te[88]=-1;ee[82]=ee[88]=0;Gt[73]=Gt[97]=0;Vt[73]=Vt[97]=1;Ht[73]=Ht[97]=0;qt[73]=qt[97]=0;Wt[73]=Wt[97]=-1;Xt[73]=Xt[97]=0;Yt[73]=Yt[97]=1;$t[73]=$t[97]=0;Zt[73]=Zt[97]=0;Ot[73]=Ot[97]=1;Ft[73]=Ft[97]=0;Ut[73]=Ut[97]=1;Gt[145]=Gt[25]=0;Vt[145]=Vt[25]=-1;Ht[145]=Ht[25]=0;Yt[145]=Yt[25]=1;$t[145]=$t[25]=0;Zt[145]=Zt[25]=1;ne[145]=ne[25]=0;re[145]=re[25]=1;ie[145]=ie[25]=1;Bt[145]=Bt[25]=-1;zt[145]=zt[25]=0;kt[145]=kt[25]=0;qt[70]=qt[100]=0;Wt[70]=Wt[100]=1;Xt[70]=Xt[100]=0;Jt[70]=Jt[100]=-1;Kt[70]=Kt[100]=0;Qt[70]=Qt[100]=1;jt[70]=jt[100]=0;te[70]=te[100]=-1;ee[70]=ee[100]=1;Ot[70]=Ot[100]=1;Ft[70]=Ft[100]=0;Ut[70]=Ut[100]=0;qt[101]=qt[69]=0;Wt[101]=Wt[69]=1;Xt[101]=Xt[69]=0;Ot[101]=Ot[69]=1;Ft[101]=Ft[69]=0;Ut[101]=Ut[69]=0;ne[149]=ne[21]=0;re[149]=re[21]=1;ie[149]=ie[21]=1;Bt[149]=Bt[21]=-1;zt[149]=zt[21]=0;kt[149]=kt[21]=0;Jt[86]=Jt[84]=-1;Kt[86]=Kt[84]=0;Qt[86]=Qt[84]=1;jt[86]=jt[84]=0;te[86]=te[84]=-1;ee[86]=ee[84]=1;Gt[89]=Gt[81]=0;Vt[89]=Vt[81]=-1;Ht[89]=Ht[81]=0;Yt[89]=Yt[81]=1;$t[89]=$t[81]=0;Zt[89]=Zt[81]=1;Gt[96]=Gt[74]=0;Vt[96]=Vt[74]=1;Ht[96]=Ht[74]=0;qt[96]=qt[74]=-1;Wt[96]=Wt[74]=0;Xt[96]=Xt[74]=1;jt[96]=jt[74]=1;te[96]=te[74]=0;ee[96]=ee[74]=0;Ot[96]=Ot[74]=1;Ft[96]=Ft[74]=0;Ut[96]=Ut[74]=1;Gt[24]=Gt[146]=0;Vt[24]=Vt[146]=-1;Ht[24]=Ht[146]=1;Jt[24]=Jt[146]=1;Kt[24]=Kt[146]=0;Qt[24]=Qt[146]=1;Yt[24]=Yt[146]=0;$t[24]=$t[146]=1;Zt[24]=Zt[146]=1;Bt[24]=Bt[146]=0;zt[24]=zt[146]=-1;kt[24]=kt[146]=0;qt[6]=qt[164]=-1;Wt[6]=Wt[164]=0;Xt[6]=Xt[164]=1;Jt[6]=Jt[164]=-1;Kt[6]=Kt[164]=0;Qt[6]=Qt[164]=0;ne[6]=ne[164]=0;re[6]=re[164]=-1;ie[6]=ie[164]=1;jt[6]=jt[164]=1;te[6]=te[164]=0;ee[6]=ee[164]=0;Yt[129]=Yt[41]=0;$t[129]=$t[41]=1;Zt[129]=Zt[41]=1;ne[129]=ne[41]=0;re[129]=re[41]=1;ie[129]=ie[41]=0;Ot[129]=Ot[41]=-1;Ft[129]=Ft[41]=0;Ut[129]=Ut[41]=0;Bt[129]=Bt[41]=0;zt[129]=zt[41]=-1;kt[129]=kt[41]=0;Jt[66]=Jt[104]=0;Kt[66]=Kt[104]=1;Qt[66]=Qt[104]=0;Yt[66]=Yt[104]=-1;$t[66]=$t[104]=0;Zt[66]=Zt[104]=1;jt[66]=jt[104]=0;te[66]=te[104]=-1;ee[66]=ee[104]=0;Ot[66]=Ot[104]=0;Ft[66]=Ft[104]=-1;Ut[66]=Ut[104]=1;Gt[144]=Gt[26]=-1;Vt[144]=Vt[26]=0;Ht[144]=Ht[26]=0;ne[144]=ne[26]=1;re[144]=re[26]=0;ie[144]=ie[26]=1;jt[144]=jt[26]=0;te[144]=te[26]=1;ee[144]=ee[26]=1;Bt[144]=Bt[26]=-1;zt[144]=zt[26]=0;kt[144]=kt[26]=1;qt[36]=qt[134]=0;Wt[36]=Wt[134]=1;Xt[36]=Xt[134]=1;Jt[36]=Jt[134]=0;Kt[36]=Kt[134]=1;Qt[36]=Qt[134]=0;Ot[36]=Ot[134]=0;Ft[36]=Ft[134]=-1;Ut[36]=Ut[134]=1;Bt[36]=Bt[134]=1;zt[36]=zt[134]=0;kt[36]=kt[134]=0;Gt[9]=Gt[161]=-1;Vt[9]=Vt[161]=0;Ht[9]=Ht[161]=0;qt[9]=qt[161]=0;Wt[9]=Wt[161]=-1;Xt[9]=Xt[161]=0;Yt[9]=Yt[161]=1;$t[9]=$t[161]=0;Zt[9]=Zt[161]=0;ne[9]=ne[161]=1;re[9]=re[161]=0;ie[9]=ie[161]=1;Gt[136]=0;Vt[136]=1;Ht[136]=1;qt[136]=0;Wt[136]=1;Xt[136]=0;Jt[136]=-1;Kt[136]=0;Qt[136]=1;Yt[136]=-1;$t[136]=0;Zt[136]=0;ne[136]=0;re[136]=-1;ie[136]=0;jt[136]=0;te[136]=-1;ee[136]=1;Ot[136]=1;Ft[136]=0;Ut[136]=0;Bt[136]=1;zt[136]=0;kt[136]=1;Gt[34]=0;Vt[34]=-1;Ht[34]=0;qt[34]=0;Wt[34]=-1;Xt[34]=1;Jt[34]=1;Kt[34]=0;Qt[34]=0;Yt[34]=1;$t[34]=0;Zt[34]=1;ne[34]=0;re[34]=1;ie[34]=1;jt[34]=0;te[34]=1;ee[34]=0;Ot[34]=-1;Ft[34]=0;Ut[34]=1;Bt[34]=-1;zt[34]=0;kt[34]=0;Gt[35]=0;Vt[35]=1;Ht[35]=1;qt[35]=0;Wt[35]=-1;Xt[35]=1;Jt[35]=1;Kt[35]=0;Qt[35]=0;Yt[35]=-1;$t[35]=0;Zt[35]=0;ne[35]=0;re[35]=-1;ie[35]=0;jt[35]=0;te[35]=1;ee[35]=0;Ot[35]=-1;Ft[35]=0;Ut[35]=1;Bt[35]=1;zt[35]=0;kt[35]=1;Gt[153]=0;Vt[153]=1;Ht[153]=1;Yt[153]=-1;$t[153]=0;Zt[153]=0;ne[153]=0;re[153]=-1;ie[153]=0;Bt[153]=1;zt[153]=0;kt[153]=1;qt[102]=0;Wt[102]=-1;Xt[102]=1;Jt[102]=1;Kt[102]=0;Qt[102]=0;jt[102]=0;te[102]=1;ee[102]=0;Ot[102]=-1;Ft[102]=0;Ut[102]=1;Gt[155]=0;Vt[155]=-1;Ht[155]=0;Yt[155]=1;$t[155]=0;Zt[155]=1;ne[155]=0;re[155]=1;ie[155]=1;Bt[155]=-1;zt[155]=0;kt[155]=0;qt[103]=0;Wt[103]=1;Xt[103]=0;Jt[103]=-1;Kt[103]=0;Qt[103]=1;jt[103]=0;te[103]=-1;ee[103]=1;Ot[103]=1;Ft[103]=0;Ut[103]=0;Gt[152]=0;Vt[152]=1;Ht[152]=1;Jt[152]=-1;Kt[152]=0;Qt[152]=1;Yt[152]=-1;$t[152]=0;Zt[152]=0;ne[152]=0;re[152]=-1;ie[152]=0;jt[152]=0;te[152]=-1;ee[152]=1;Bt[152]=1;zt[152]=0;kt[152]=1;Gt[156]=0;Vt[156]=-1;Ht[156]=1;Jt[156]=1;Kt[156]=0;Qt[156]=1;Yt[156]=-1;$t[156]=0;Zt[156]=0;ne[156]=0;re[156]=-1;ie[156]=0;jt[156]=0;te[156]=1;ee[156]=1;Bt[156]=-1;zt[156]=0;kt[156]=1;Gt[137]=0;Vt[137]=1;Ht[137]=1;qt[137]=0;Wt[137]=1;Xt[137]=0;Yt[137]=-1;$t[137]=0;Zt[137]=0;ne[137]=0;re[137]=-1;ie[137]=0;Ot[137]=1;Ft[137]=0;Ut[137]=0;Bt[137]=1;zt[137]=0;kt[137]=1;Gt[139]=0;Vt[139]=1;Ht[139]=1;qt[139]=0;Wt[139]=-1;Xt[139]=0;Yt[139]=1;$t[139]=0;Zt[139]=0;ne[139]=0;re[139]=1;ie[139]=0;Ot[139]=-1;Ft[139]=0;Ut[139]=0;Bt[139]=1;zt[139]=0;kt[139]=1;Gt[98]=0;Vt[98]=-1;Ht[98]=0;qt[98]=0;Wt[98]=-1;Xt[98]=1;Jt[98]=1;Kt[98]=0;Qt[98]=0;Yt[98]=1;$t[98]=0;Zt[98]=1;jt[98]=0;te[98]=1;ee[98]=0;Ot[98]=-1;Ft[98]=0;Ut[98]=1;Gt[99]=0;Vt[99]=1;Ht[99]=0;qt[99]=0;Wt[99]=-1;Xt[99]=1;Jt[99]=1;Kt[99]=0;Qt[99]=0;Yt[99]=-1;$t[99]=0;Zt[99]=1;jt[99]=0;te[99]=-1;ee[99]=0;Ot[99]=1;Ft[99]=0;Ut[99]=1;qt[38]=0;Wt[38]=-1;Xt[38]=1;Jt[38]=1;Kt[38]=0;Qt[38]=0;ne[38]=0;re[38]=1;ie[38]=1;jt[38]=0;te[38]=1;ee[38]=0;Ot[38]=-1;Ft[38]=0;Ut[38]=1;Bt[38]=-1;zt[38]=0;kt[38]=0;qt[39]=0;Wt[39]=1;Xt[39]=1;Jt[39]=-1;Kt[39]=0;Qt[39]=0;ne[39]=0;re[39]=-1;ie[39]=1;jt[39]=0;te[39]=1;ee[39]=0;Ot[39]=-1;Ft[39]=0;Ut[39]=1;Bt[39]=1;zt[39]=0;kt[39]=0;var Yc=function(o){return[[o.bottomleft,0],[0,0],[0,o.leftbottom]]},$c=function(o){return[[1,o.rightbottom],[1,0],[o.bottomright,0]]},Zc=function(o){return[[o.topright,1],[1,1],[1,o.righttop]]},Jc=function(o){return[[0,o.lefttop],[0,1],[o.topleft,1]]},Kc=function(o){return[[o.bottomright,0],[o.bottomleft,0],[0,o.leftbottom],[0,o.lefttop]]},Qc=function(o){return[[o.bottomright,0],[o.bottomleft,0],[1,o.righttop],[1,o.rightbottom]]},jc=function(o){return[[1,o.righttop],[1,o.rightbottom],[o.topleft,1],[o.topright,1]]},th=function(o){return[[0,o.leftbottom],[0,o.lefttop],[o.topleft,1],[o.topright,1]]},aM=function(o){return[[0,0],[0,o.leftbottom],[1,o.rightbottom],[1,0]]},uM=function(o){return[[1,0],[o.bottomright,0],[o.topright,1],[1,1]]},lM=function(o){return[[1,1],[1,o.righttop],[0,o.lefttop],[0,1]]},cM=function(o){return[[o.bottomleft,0],[0,0],[0,1],[o.topleft,1]]},hM=function(o){return[[1,o.righttop],[1,o.rightbottom],[0,o.leftbottom],[0,o.lefttop]]},fM=function(o){return[[o.topleft,1],[o.topright,1],[o.bottomright,0],[o.bottomleft,0]]},pM=function(){return[[0,0],[0,1],[1,1],[1,0]]},dM=function(o){return[[1,o.rightbottom],[1,0],[0,0],[0,1],[o.topleft,1]]},mM=function(o){return[[o.topright,1],[1,1],[1,0],[0,0],[0,o.leftbottom]]},gM=function(o){return[[1,0],[o.bottomright,0],[0,o.lefttop],[0,1],[1,1]]},yM=function(o){return[[1,1],[1,o.righttop],[o.bottomleft,0],[0,0],[0,1]]},vM=function(o){return[[1,o.righttop],[1,o.rightbottom],[0,o.lefttop],[0,1],[o.topleft,1]]},_M=function(o){return[[1,1],[1,o.righttop],[o.bottomright,0],[o.bottomleft,0],[o.topright,1]]},xM=function(o){return[[1,o.rightbottom],[1,0],[o.bottomright,0],[0,o.leftbottom],[0,o.lefttop]]},EM=function(o){return[[o.topright,1],[o.bottomleft,0],[0,0],[0,o.leftbottom],[o.topleft,1]]},MM=function(o){return[[o.bottomright,0],[o.bottomleft,0],[0,o.lefttop],[0,1],[o.topleft,1]]},wM=function(o){return[[1,1],[1,o.righttop],[0,o.leftbottom],[0,o.lefttop],[o.topright,1]]},SM=function(o){return[[1,o.rightbottom],[1,0],[o.bottomright,0],[o.topleft,1],[o.topright,1]]},bM=function(o){return[[1,o.righttop],[1,o.rightbottom],[o.bottomleft,0],[0,0],[0,o.leftbottom]]},AM=function(o){return[[1,o.rightbottom],[1,0],[0,0],[0,o.leftbottom],[o.topleft,1],[o.topright,1]]},TM=function(o){return[[1,1],[1,0],[o.bottomright,0],[0,o.leftbottom],[0,o.lefttop],[o.topright,1]]},CM=function(o){return[[1,1],[1,o.righttop],[o.bottomright,0],[o.bottomleft,0],[0,o.lefttop],[0,1]]},IM=function(o){return[[1,o.righttop],[1,o.rightbottom],[o.bottomleft,0],[0,0],[0,1],[o.topleft,1]]},PM=function(o){return[[1,1],[1,o.righttop],[o.bottomleft,0],[0,0],[0,o.leftbottom],[o.topright,1]]},RM=function(o){return[[1,o.rightbottom],[1,0],[o.bottomright,0],[0,o.lefttop],[0,1],[o.topleft,1]]},NM=function(o){return[[1,o.righttop],[1,o.rightbottom],[o.bottomright,0],[o.bottomleft,0],[0,o.leftbottom],[0,o.lefttop],[o.topleft,1],[o.topright,1]]},LM=function(o){return[[1,1],[1,o.righttop],[o.bottomleft,0],[0,0],[0,o.leftbottom],[o.topright,1]]},DM=function(o){return[[1,o.rightbottom],[1,0],[o.bottomright,0],[0,o.lefttop],[0,1],[o.topleft,1]]},OM=function(o){return[[1,1],[1,o.righttop],[o.bottomright,0],[o.bottomleft,0],[0,o.leftbottom],[0,o.lefttop],[o.topright,1]]},FM=function(o){return[[1,o.righttop],[1,o.rightbottom],[o.bottomleft,0],[0,0],[0,o.leftbottom],[o.topleft,1],[o.topright,1]]},UM=function(o){return[[1,o.righttop],[1,o.rightbottom],[o.bottomright,0],[o.bottomleft,0],[0,o.lefttop],[0,1],[o.topleft,1]]},BM=function(o){return[[1,o.rightbottom],[1,0],[o.bottomright,0],[0,o.leftbottom],[0,o.lefttop],[o.topleft,1],[o.topright,1]]},le=[],ce=[],he=[],fe=[],pe=[],de=[],me=[],ge=[];fe[1]=pe[1]=18;fe[169]=pe[169]=18;he[4]=ce[4]=12;he[166]=ce[166]=12;le[16]=ge[16]=4;le[154]=ge[154]=4;de[64]=me[64]=22;de[106]=me[106]=22;he[2]=de[2]=17;fe[2]=pe[2]=18;he[168]=de[168]=17;fe[168]=pe[168]=18;le[8]=fe[8]=9;ce[8]=he[8]=12;le[162]=fe[162]=9;ce[162]=he[162]=12;le[32]=ge[32]=4;ce[32]=me[32]=1;le[138]=ge[138]=4;ce[138]=me[138]=1;pe[128]=ge[128]=21;de[128]=me[128]=22;pe[42]=ge[42]=21;de[42]=me[42]=22;ce[5]=pe[5]=14;ce[165]=pe[165]=14;he[20]=ge[20]=6;he[150]=ge[150]=6;le[80]=de[80]=11;le[90]=de[90]=11;fe[65]=me[65]=3;fe[105]=me[105]=3;le[160]=de[160]=11;ce[160]=pe[160]=14;le[10]=de[10]=11;ce[10]=pe[10]=14;he[130]=ge[130]=6;fe[130]=me[130]=3;he[40]=ge[40]=6;fe[40]=me[40]=3;ce[101]=me[101]=1;ce[69]=me[69]=1;pe[149]=ge[149]=21;pe[21]=ge[21]=21;he[86]=de[86]=17;he[84]=de[84]=17;le[89]=fe[89]=9;le[81]=fe[81]=9;le[96]=me[96]=0;ce[96]=de[96]=15;le[74]=me[74]=0;ce[74]=de[74]=15;le[24]=he[24]=8;fe[24]=ge[24]=7;le[146]=he[146]=8;fe[146]=ge[146]=7;ce[6]=de[6]=15;he[6]=pe[6]=16;ce[164]=de[164]=15;he[164]=pe[164]=16;fe[129]=ge[129]=7;pe[129]=me[129]=20;fe[41]=ge[41]=7;pe[41]=me[41]=20;he[66]=me[66]=2;fe[66]=de[66]=19;he[104]=me[104]=2;fe[104]=de[104]=19;le[144]=pe[144]=10;de[144]=ge[144]=23;le[26]=pe[26]=10;de[26]=ge[26]=23;ce[36]=ge[36]=5;he[36]=me[36]=2;ce[134]=ge[134]=5;he[134]=me[134]=2;le[9]=pe[9]=10;ce[9]=fe[9]=13;le[161]=pe[161]=10;ce[161]=fe[161]=13;ce[37]=ge[37]=5;pe[37]=me[37]=20;ce[133]=ge[133]=5;pe[133]=me[133]=20;he[148]=pe[148]=16;de[148]=ge[148]=23;he[22]=pe[22]=16;de[22]=ge[22]=23;le[82]=he[82]=8;fe[82]=de[82]=19;le[88]=he[88]=8;fe[88]=de[88]=19;le[73]=me[73]=0;ce[73]=fe[73]=13;le[97]=me[97]=0;ce[97]=fe[97]=13;le[145]=fe[145]=9;pe[145]=ge[145]=21;le[25]=fe[25]=9;pe[25]=ge[25]=21;ce[70]=me[70]=1;he[70]=de[70]=17;ce[100]=me[100]=1;he[100]=de[100]=17;le[34]=fe[34]=9;ce[34]=he[34]=12;pe[34]=ge[34]=21;de[34]=me[34]=22;le[136]=ge[136]=4;ce[136]=me[136]=1;he[136]=de[136]=17;fe[136]=pe[136]=18;le[35]=ge[35]=4;ce[35]=he[35]=12;fe[35]=pe[35]=18;de[35]=me[35]=22;le[153]=ge[153]=4;fe[153]=pe[153]=18;ce[102]=he[102]=12;de[102]=me[102]=22;le[155]=fe[155]=9;pe[155]=ge[155]=23;ce[103]=me[103]=1;he[103]=de[103]=17;le[152]=ge[152]=4;he[152]=de[152]=17;fe[152]=pe[152]=18;le[156]=he[156]=8;fe[156]=pe[156]=18;de[156]=ge[156]=23;le[137]=ge[137]=4;ce[137]=me[137]=1;fe[137]=pe[137]=18;le[139]=ge[139]=4;ce[139]=fe[139]=13;pe[139]=me[139]=20;le[98]=fe[98]=9;ce[98]=he[98]=12;de[98]=me[98]=22;le[99]=me[99]=0;ce[99]=he[99]=12;fe[99]=de[99]=19;ce[38]=he[38]=12;pe[38]=ge[38]=21;de[38]=me[38]=22;ce[39]=ge[39]=5;he[39]=pe[39]=16;de[39]=me[39]=22;var st=[];st[1]=st[169]=Yc;st[4]=st[166]=$c;st[16]=st[154]=Zc;st[64]=st[106]=Jc;st[168]=st[2]=Kc;st[162]=st[8]=Qc;st[138]=st[32]=jc;st[42]=st[128]=th;st[5]=st[165]=aM;st[20]=st[150]=uM;st[80]=st[90]=lM;st[65]=st[105]=cM;st[160]=st[10]=hM;st[130]=st[40]=fM;st[85]=pM;st[101]=st[69]=dM;st[149]=st[21]=mM;st[86]=st[84]=gM;st[89]=st[81]=yM;st[96]=st[74]=vM;st[24]=st[146]=_M;st[6]=st[164]=xM;st[129]=st[41]=EM;st[66]=st[104]=MM;st[144]=st[26]=wM;st[36]=st[134]=SM;st[9]=st[161]=bM;st[37]=st[133]=AM;st[148]=st[22]=TM;st[82]=st[88]=CM;st[73]=st[97]=IM;st[145]=st[25]=PM;st[70]=st[100]=RM;st[34]=function(o){return[th(o),Qc(o)]};st[35]=NM;st[136]=function(o){return[jc(o),Kc(o)]};st[153]=function(o){return[Zc(o),Yc(o)]};st[102]=function(o){return[$c(o),Jc(o)]};st[155]=LM;st[103]=DM;st[152]=function(o){return[Zc(o),Kc(o)]};st[156]=OM;st[137]=function(o){return[jc(o),Yc(o)]};st[139]=FM;st[98]=function(o){return[Qc(o),Jc(o)]};st[99]=UM;st[38]=function(o){return[$c(o),th(o)]};st[39]=BM;function kM(o){return(o>0)-(o<0)||+o}function Cs(o,e,r){var a=e[0]-o[0],u=e[1]-o[1],c=r[0]-e[0],h=r[1]-e[1];return kM(a*h-c*u)}function ng(o,e){var r=o.geometry.coordinates[0].map(function(h){return h[0]}),a=o.geometry.coordinates[0].map(function(h){return h[1]}),u=e.geometry.coordinates[0].map(function(h){return h[0]}),c=e.geometry.coordinates[0].map(function(h){return h[1]});return Math.max.apply(null,r)===Math.max.apply(null,u)&&Math.max.apply(null,a)===Math.max.apply(null,c)&&Math.min.apply(null,r)===Math.min.apply(null,u)&&Math.min.apply(null,a)===Math.min.apply(null,c)}function eh(o,e){return e.geometry.coordinates[0].every(function(r){return $n(He(r),o)})}function rg(o,e){return o[0]===e[0]&&o[1]===e[1]}var GM=function(){function o(e){this.id=o.buildId(e),this.coordinates=e,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return o.buildId=function(e){return e.join(",")},o.prototype.removeInnerEdge=function(e){this.innerEdges=this.innerEdges.filter(function(r){return r.from.id!==e.from.id})},o.prototype.removeOuterEdge=function(e){this.outerEdges=this.outerEdges.filter(function(r){return r.to.id!==e.to.id})},o.prototype.addOuterEdge=function(e){this.outerEdges.push(e),this.outerEdgesSorted=!1},o.prototype.sortOuterEdges=function(){var e=this;this.outerEdgesSorted||(this.outerEdges.sort(function(r,a){var u=r.to,c=a.to;if(u.coordinates[0]-e.coordinates[0]>=0&&c.coordinates[0]-e.coordinates[0]<0)return 1;if(u.coordinates[0]-e.coordinates[0]<0&&c.coordinates[0]-e.coordinates[0]>=0)return-1;if(u.coordinates[0]-e.coordinates[0]===0&&c.coordinates[0]-e.coordinates[0]===0)return u.coordinates[1]-e.coordinates[1]>=0||c.coordinates[1]-e.coordinates[1]>=0?u.coordinates[1]-c.coordinates[1]:c.coordinates[1]-u.coordinates[1];var h=Cs(e.coordinates,u.coordinates,c.coordinates);if(h<0)return 1;if(h>0)return-1;var p=Math.pow(u.coordinates[0]-e.coordinates[0],2)+Math.pow(u.coordinates[1]-e.coordinates[1],2),d=Math.pow(c.coordinates[0]-e.coordinates[0],2)+Math.pow(c.coordinates[1]-e.coordinates[1],2);return p-d}),this.outerEdgesSorted=!0)},o.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},o.prototype.getOuterEdge=function(e){return this.sortOuterEdges(),this.outerEdges[e]},o.prototype.addInnerEdge=function(e){this.innerEdges.push(e)},o}(),nh=GM;var VM=function(){function o(e,r){this.from=e,this.to=r,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 o.prototype.getSymetric=function(){return this.symetric||(this.symetric=new o(this.to,this.from),this.symetric.symetric=this),this.symetric},o.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},o.prototype.isEqual=function(e){return this.from.id===e.from.id&&this.to.id===e.to.id},o.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},o.prototype.toLineString=function(){return Yn([this.from.coordinates,this.to.coordinates])},o.prototype.compareTo=function(e){return Cs(e.from.coordinates,e.to.coordinates,this.to.coordinates)},o}(),ig=VM;var HM=function(){function o(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return o.prototype.push=function(e){this.edges.push(e),this.polygon=this.envelope=void 0},o.prototype.get=function(e){return this.edges[e]},Object.defineProperty(o.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}),o.prototype.forEach=function(e){this.edges.forEach(e)},o.prototype.map=function(e){return this.edges.map(e)},o.prototype.some=function(e){return this.edges.some(e)},o.prototype.isValid=function(){return!0},o.prototype.isHole=function(){var e=this,r=this.edges.reduce(function(h,p,d){return p.from.coordinates[1]>e.edges[h].from.coordinates[1]&&(h=d),h},0),a=(r===0?this.length:r)-1,u=(r+1)%this.length,c=Cs(this.edges[a].from.coordinates,this.edges[r].from.coordinates,this.edges[u].from.coordinates);return c===0?this.edges[a].from.coordinates[0]>this.edges[u].from.coordinates[0]:c>0},o.prototype.toMultiPoint=function(){return zl(this.edges.map(function(e){return e.from.coordinates}))},o.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var e=this.edges.map(function(r){return r.from.coordinates});return e.push(this.edges[0].from.coordinates),this.polygon=sn([e])},o.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=ic(this.toPolygon())},o.findEdgeRingContaining=function(e,r){var a=e.getEnvelope(),u,c;return r.forEach(function(h){var p=h.getEnvelope();if(c&&(u=c.getEnvelope()),!ng(p,a)&&eh(p,a)){for(var d=e.map(function(I){return I.from.coordinates}),g=void 0,v=function(I){h.some(function(D){return rg(I,D.from.coordinates)})||(g=I)},x=0,M=d;x<M.length;x++){var w=M[x];v(w)}g&&h.inside(He(g))&&(!c||eh(u,p))&&(c=h)}}),c},o.prototype.inside=function(e){return $n(e,this.toPolygon())},o}(),rh=HM;function qM(o){if(!o)throw new Error("No geojson passed");if(o.type!=="FeatureCollection"&&o.type!=="GeometryCollection"&&o.type!=="MultiLineString"&&o.type!=="LineString"&&o.type!=="Feature")throw new Error("Invalid input type '"+o.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}var SL=function(){function o(){this.edges=[],this.nodes={}}return o.fromGeoJson=function(e){qM(e);var r=new o;return Xr(e,function(a){Gl(a,"LineString","Graph::fromGeoJson"),Jf(a,function(u,c){if(u){var h=r.getNode(u),p=r.getNode(c);r.addEdge(h,p)}return c})}),r},o.prototype.getNode=function(e){var r=nh.buildId(e),a=this.nodes[r];return a||(a=this.nodes[r]=new nh(e)),a},o.prototype.addEdge=function(e,r){var a=new ig(e,r),u=a.getSymetric();this.edges.push(a),this.edges.push(u)},o.prototype.deleteDangles=function(){var e=this;Object.keys(this.nodes).map(function(r){return e.nodes[r]}).forEach(function(r){return e._removeIfDangle(r)})},o.prototype._removeIfDangle=function(e){var r=this;if(e.innerEdges.length<=1){var a=e.getOuterEdges().map(function(u){return u.to});this.removeNode(e),a.forEach(function(u){return r._removeIfDangle(u)})}},o.prototype.deleteCutEdges=function(){var e=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(r){r.label===r.symetric.label&&(e.removeEdge(r.symetric),e.removeEdge(r))})},o.prototype._computeNextCWEdges=function(e){var r=this;typeof e>"u"?Object.keys(this.nodes).forEach(function(a){return r._computeNextCWEdges(r.nodes[a])}):e.getOuterEdges().forEach(function(a,u){e.getOuterEdge((u===0?e.getOuterEdges().length:u)-1).symetric.next=a})},o.prototype._computeNextCCWEdges=function(e,r){for(var a=e.getOuterEdges(),u,c,h=a.length-1;h>=0;--h){var p=a[h],d=p.symetric,g=void 0,v=void 0;p.label===r&&(g=p),d.label===r&&(v=d),!(!g||!v)&&(v&&(c=v),g&&(c&&(c.next=g,c=void 0),u||(u=g)))}c&&(c.next=u)},o.prototype._findLabeledEdgeRings=function(){var e=[],r=0;return this.edges.forEach(function(a){if(!(a.label>=0)){e.push(a);var u=a;do u.label=r,u=u.next;while(!a.isEqual(u));r++}}),e},o.prototype.getEdgeRings=function(){var e=this;this._computeNextCWEdges(),this.edges.forEach(function(a){a.label=void 0}),this._findLabeledEdgeRings().forEach(function(a){e._findIntersectionNodes(a).forEach(function(u){e._computeNextCCWEdges(u,a.label)})});var r=[];return this.edges.forEach(function(a){a.ring||r.push(e._findEdgeRing(a))}),r},o.prototype._findIntersectionNodes=function(e){var r=[],a=e,u=function(){var c=0;a.from.getOuterEdges().forEach(function(h){h.label===e.label&&++c}),c>1&&r.push(a.from),a=a.next};do u();while(!e.isEqual(a));return r},o.prototype._findEdgeRing=function(e){var r=e,a=new rh;do a.push(r),r.ring=a,r=r.next;while(!e.isEqual(r));return a},o.prototype.removeNode=function(e){var r=this;e.getOuterEdges().forEach(function(a){return r.removeEdge(a)}),e.innerEdges.forEach(function(a){return r.removeEdge(a)}),delete this.nodes[e.id]},o.prototype.removeEdge=function(e){this.edges=this.edges.filter(function(r){return!r.isEqual(e)}),e.deleteEdge()},o}();var $M=ln(ih(),1);var ZM=ln(ih(),1);var KM=ln(pg(),1);var iw=ln(wg(),1);function bg(o){for(var e=o,r=[];e.parent;)r.unshift(e),e=e.parent;return r}function sw(){return new Ag(function(o){return o.f})}var uh={search:function(o,e,r,a){o.cleanDirty(),a=a||{};var u=a.heuristic||uh.heuristics.manhattan,c=a.closest||!1,h=sw(),p=e;for(e.h=u(e,r),h.push(e);h.size()>0;){var d=h.pop();if(d===r)return bg(d);d.closed=!0;for(var g=o.neighbors(d),v=0,x=g.length;v<x;++v){var M=g[v];if(!(M.closed||M.isWall())){var w=d.g+M.getCost(d),I=M.visited;(!I||w<M.g)&&(M.visited=!0,M.parent=d,M.h=M.h||u(M,r),M.g=w,M.f=M.g+M.h,o.markDirty(M),c&&(M.h<p.h||M.h===p.h&&M.g<p.g)&&(p=M),I?h.rescoreElement(M):h.push(M))}}}return c?bg(p):[]},heuristics:{manhattan:function(o,e){var r=Math.abs(e.x-o.x),a=Math.abs(e.y-o.y);return r+a},diagonal:function(o,e){var r=1,a=Math.sqrt(2),u=Math.abs(e.x-o.x),c=Math.abs(e.y-o.y);return r*(u+c)+(a-2*r)*Math.min(u,c)}},cleanNode:function(o){o.f=0,o.g=0,o.h=0,o.visited=!1,o.closed=!1,o.parent=null}};function va(o,e){e=e||{},this.nodes=[],this.diagonal=!!e.diagonal,this.grid=[];for(var r=0;r<o.length;r++){this.grid[r]=[];for(var a=0,u=o[r];a<u.length;a++){var c=new Du(r,a,u[a]);this.grid[r][a]=c,this.nodes.push(c)}}this.init()}va.prototype.init=function(){this.dirtyNodes=[];for(var o=0;o<this.nodes.length;o++)uh.cleanNode(this.nodes[o])};va.prototype.cleanDirty=function(){for(var o=0;o<this.dirtyNodes.length;o++)uh.cleanNode(this.dirtyNodes[o]);this.dirtyNodes=[]};va.prototype.markDirty=function(o){this.dirtyNodes.push(o)};va.prototype.neighbors=function(o){var e=[],r=o.x,a=o.y,u=this.grid;return u[r-1]&&u[r-1][a]&&e.push(u[r-1][a]),u[r+1]&&u[r+1][a]&&e.push(u[r+1][a]),u[r]&&u[r][a-1]&&e.push(u[r][a-1]),u[r]&&u[r][a+1]&&e.push(u[r][a+1]),this.diagonal&&(u[r-1]&&u[r-1][a-1]&&e.push(u[r-1][a-1]),u[r+1]&&u[r+1][a-1]&&e.push(u[r+1][a-1]),u[r-1]&&u[r-1][a+1]&&e.push(u[r-1][a+1]),u[r+1]&&u[r+1][a+1]&&e.push(u[r+1][a+1])),e};va.prototype.toString=function(){for(var o=[],e=this.grid,r,a,u,c,h=0,p=e.length;h<p;h++){for(r=[],a=e[h],u=0,c=a.length;u<c;u++)r.push(a[u].weight);o.push(r.join(" "))}return o.join(\`
|
|
7226
7226
|
\`)};function Du(o,e,r){this.x=o,this.y=e,this.weight=r}Du.prototype.toString=function(){return"["+this.x+" "+this.y+"]"};Du.prototype.getCost=function(o){return o&&o.x!==this.x&&o.y!==this.y?this.weight*1.41421:this.weight};Du.prototype.isWall=function(){return this.weight===0};function Ag(o){this.content=[],this.scoreFunction=o}Ag.prototype={push:function(o){this.content.push(o),this.sinkDown(this.content.length-1)},pop:function(){var o=this.content[0],e=this.content.pop();return this.content.length>0&&(this.content[0]=e,this.bubbleUp(0)),o},remove:function(o){var e=this.content.indexOf(o),r=this.content.pop();e!==this.content.length-1&&(this.content[e]=r,this.scoreFunction(r)<this.scoreFunction(o)?this.sinkDown(e):this.bubbleUp(e))},size:function(){return this.content.length},rescoreElement:function(o){this.sinkDown(this.content.indexOf(o))},sinkDown:function(o){for(var e=this.content[o];o>0;){var r=(o+1>>1)-1,a=this.content[r];if(this.scoreFunction(e)<this.scoreFunction(a))this.content[r]=e,this.content[o]=a,o=r;else break}},bubbleUp:function(o){for(var e=this.content.length,r=this.content[o],a=this.scoreFunction(r);;){var u=o+1<<1,c=u-1,h=null,p;if(c<e){var d=this.content[c];p=this.scoreFunction(d),p<a&&(h=c)}if(u<e){var g=this.content[u],v=this.scoreFunction(g);v<(h===null?a:p)&&(h=u)}if(h!==null)this.content[o]=this.content[h],this.content[h]=r,o=h;else break}}};function lh(){this._=null}function Ps(o){o.U=o.C=o.L=o.R=o.P=o.N=null}lh.prototype={constructor:lh,insert:function(o,e){var r,a,u;if(o){if(e.P=o,e.N=o.N,o.N&&(o.N.P=e),o.N=e,o.R){for(o=o.R;o.L;)o=o.L;o.L=e}else o.R=e;r=o}else this._?(o=Tg(this._),e.P=null,e.N=o,o.P=o.L=e,r=o):(e.P=e.N=null,this._=e,r=null);for(e.L=e.R=null,e.U=r,e.C=!0,o=e;r&&r.C;)a=r.U,r===a.L?(u=a.R,u&&u.C?(r.C=u.C=!1,a.C=!0,o=a):(o===r.R&&(_a(this,r),o=r,r=o.U),r.C=!1,a.C=!0,xa(this,a))):(u=a.L,u&&u.C?(r.C=u.C=!1,a.C=!0,o=a):(o===r.L&&(xa(this,r),o=r,r=o.U),r.C=!1,a.C=!0,_a(this,a))),r=o.U;this._.C=!1},remove:function(o){o.N&&(o.N.P=o.P),o.P&&(o.P.N=o.N),o.N=o.P=null;var e=o.U,r,a=o.L,u=o.R,c,h;if(a?u?c=Tg(u):c=a:c=u,e?e.L===o?e.L=c:e.R=c:this._=c,a&&u?(h=c.C,c.C=o.C,c.L=a,a.U=c,c!==u?(e=c.U,c.U=o.U,o=c.R,e.L=o,c.R=u,u.U=c):(c.U=e,e=c,o=c.R)):(h=o.C,o=c),o&&(o.U=e),!h){if(o&&o.C){o.C=!1;return}do{if(o===this._)break;if(o===e.L){if(r=e.R,r.C&&(r.C=!1,e.C=!0,_a(this,e),r=e.R),r.L&&r.L.C||r.R&&r.R.C){(!r.R||!r.R.C)&&(r.L.C=!1,r.C=!0,xa(this,r),r=e.R),r.C=e.C,e.C=r.R.C=!1,_a(this,e),o=this._;break}}else if(r=e.L,r.C&&(r.C=!1,e.C=!0,xa(this,e),r=e.L),r.L&&r.L.C||r.R&&r.R.C){(!r.L||!r.L.C)&&(r.R.C=!1,r.C=!0,_a(this,r),r=e.L),r.C=e.C,e.C=r.L.C=!1,xa(this,e),o=this._;break}r.C=!0,o=e,e=e.U}while(!o.C);o&&(o.C=!1)}}};function _a(o,e){var r=e,a=e.R,u=r.U;u?u.L===r?u.L=a:u.R=a:o._=a,a.U=u,r.U=a,r.R=a.L,r.R&&(r.R.U=r),a.L=r}function xa(o,e){var r=e,a=e.L,u=r.U;u?u.L===r?u.L=a:u.R=a:o._=a,a.U=u,r.U=a,r.L=a.R,r.L&&(r.L.U=r),a.R=r}function Tg(o){for(;o.L;)o=o.L;return o}var ch=lh;function Rs(o,e,r,a){var u=[null,null],c=Jn.push(u)-1;return u.left=o,u.right=e,r&&Ea(u,o,e,r),a&&Ea(u,e,o,a),Cr[o.index].halfedges.push(c),Cr[e.index].halfedges.push(c),u}function Ns(o,e,r){var a=[e,r];return a.left=o,a}function Ea(o,e,r,a){!o[0]&&!o[1]?(o[0]=a,o.left=e,o.right=r):o.left===r?o[1]=a:o[0]=a}function aw(o,e,r,a,u){var c=o[0],h=o[1],p=c[0],d=c[1],g=h[0],v=h[1],x=0,M=1,w=g-p,I=v-d,D;if(D=e-p,!(!w&&D>0)){if(D/=w,w<0){if(D<x)return;D<M&&(M=D)}else if(w>0){if(D>M)return;D>x&&(x=D)}if(D=a-p,!(!w&&D<0)){if(D/=w,w<0){if(D>M)return;D>x&&(x=D)}else if(w>0){if(D<x)return;D<M&&(M=D)}if(D=r-d,!(!I&&D>0)){if(D/=I,I<0){if(D<x)return;D<M&&(M=D)}else if(I>0){if(D>M)return;D>x&&(x=D)}if(D=u-d,!(!I&&D<0)){if(D/=I,I<0){if(D>M)return;D>x&&(x=D)}else if(I>0){if(D<x)return;D<M&&(M=D)}return!(x>0)&&!(M<1)||(x>0&&(o[0]=[p+x*w,d+x*I]),M<1&&(o[1]=[p+M*w,d+M*I])),!0}}}}}function uw(o,e,r,a,u){var c=o[1];if(c)return!0;var h=o[0],p=o.left,d=o.right,g=p[0],v=p[1],x=d[0],M=d[1],w=(g+x)/2,I=(v+M)/2,D,b;if(M===v){if(w<e||w>=a)return;if(g>x){if(!h)h=[w,r];else if(h[1]>=u)return;c=[w,u]}else{if(!h)h=[w,u];else if(h[1]<r)return;c=[w,r]}}else if(D=(g-x)/(M-v),b=I-D*w,D<-1||D>1)if(g>x){if(!h)h=[(r-b)/D,r];else if(h[1]>=u)return;c=[(u-b)/D,u]}else{if(!h)h=[(u-b)/D,u];else if(h[1]<r)return;c=[(r-b)/D,r]}else if(v<M){if(!h)h=[e,D*e+b];else if(h[0]>=a)return;c=[a,D*a+b]}else{if(!h)h=[a,D*a+b];else if(h[0]<e)return;c=[e,D*e+b]}return o[0]=h,o[1]=c,!0}function Cg(o,e,r,a){for(var u=Jn.length,c;u--;)(!uw(c=Jn[u],o,e,r,a)||!aw(c,o,e,r,a)||!(Math.abs(c[0][0]-c[1][0])>Ue||Math.abs(c[0][1]-c[1][1])>Ue))&&delete Jn[u]}function Ig(o){return Cr[o.index]={site:o,halfedges:[]}}function lw(o,e){var r=o.site,a=e.left,u=e.right;return r===u&&(u=a,a=r),u?Math.atan2(u[1]-a[1],u[0]-a[0]):(r===a?(a=e[1],u=e[0]):(a=e[0],u=e[1]),Math.atan2(a[0]-u[0],u[1]-a[1]))}function hh(o,e){return e[+(e.left!==o.site)]}function cw(o,e){return e[+(e.left===o.site)]}function Pg(){for(var o=0,e=Cr.length,r,a,u,c;o<e;++o)if((r=Cr[o])&&(c=(a=r.halfedges).length)){var h=new Array(c),p=new Array(c);for(u=0;u<c;++u)h[u]=u,p[u]=lw(r,Jn[a[u]]);for(h.sort(function(d,g){return p[g]-p[d]}),u=0;u<c;++u)p[u]=a[h[u]];for(u=0;u<c;++u)a[u]=p[u]}}function Rg(o,e,r,a){var u=Cr.length,c,h,p,d,g,v,x,M,w,I,D,b,T=!0;for(c=0;c<u;++c)if(h=Cr[c]){for(p=h.site,g=h.halfedges,d=g.length;d--;)Jn[g[d]]||g.splice(d,1);for(d=0,v=g.length;d<v;)I=cw(h,Jn[g[d]]),D=I[0],b=I[1],x=hh(h,Jn[g[++d%v]]),M=x[0],w=x[1],(Math.abs(D-M)>Ue||Math.abs(b-w)>Ue)&&(g.splice(d,0,Jn.push(Ns(p,I,Math.abs(D-o)<Ue&&a-b>Ue?[o,Math.abs(M-o)<Ue?w:a]:Math.abs(b-a)<Ue&&r-D>Ue?[Math.abs(w-a)<Ue?M:r,a]:Math.abs(D-r)<Ue&&b-e>Ue?[r,Math.abs(M-r)<Ue?w:e]:Math.abs(b-e)<Ue&&D-o>Ue?[Math.abs(w-e)<Ue?M:o,e]:null))-1),++v);v&&(T=!1)}if(T){var L,P,z,k=1/0;for(c=0,T=null;c<u;++c)(h=Cr[c])&&(p=h.site,L=p[0]-o,P=p[1]-e,z=L*L+P*P,z<k&&(k=z,T=h));if(T){var Y=[o,e],q=[o,a],C=[r,a],ot=[r,e];T.halfedges.push(Jn.push(Ns(p=T.site,Y,q))-1,Jn.push(Ns(p,q,C))-1,Jn.push(Ns(p,C,ot))-1,Jn.push(Ns(p,ot,Y))-1)}}for(c=0;c<u;++c)(h=Cr[c])&&(h.halfedges.length||delete Cr[c])}var Ng=[],Ou;function hw(){Ps(this),this.x=this.y=this.arc=this.site=this.cy=null}function Vo(o){var e=o.P,r=o.N;if(!(!e||!r)){var a=e.site,u=o.site,c=r.site;if(a!==c){var h=u[0],p=u[1],d=a[0]-h,g=a[1]-p,v=c[0]-h,x=c[1]-p,M=2*(d*x-g*v);if(!(M>=-Lg)){var w=d*d+g*g,I=v*v+x*x,D=(x*w-g*I)/M,b=(d*I-v*w)/M,T=Ng.pop()||new hw;T.arc=o,T.site=u,T.x=D+h,T.y=(T.cy=b+p)+Math.sqrt(D*D+b*b),o.circle=T;for(var L=null,P=Ls._;P;)if(T.y<P.y||T.y===P.y&&T.x<=P.x)if(P.L)P=P.L;else{L=P.P;break}else if(P.R)P=P.R;else{L=P;break}Ls.insert(L,T),L||(Ou=T)}}}}function Ho(o){var e=o.circle;e&&(e.P||(Ou=e.N),Ls.remove(e),Ng.push(e),Ps(e),o.circle=null)}var Og=[];function fw(){Ps(this),this.edge=this.site=this.circle=null}function Dg(o){var e=Og.pop()||new fw;return e.site=o,e}function fh(o){Ho(o),qo.remove(o),Og.push(o),Ps(o)}function Fg(o){var e=o.circle,r=e.x,a=e.cy,u=[r,a],c=o.P,h=o.N,p=[o];fh(o);for(var d=c;d.circle&&Math.abs(r-d.circle.x)<Ue&&Math.abs(a-d.circle.cy)<Ue;)c=d.P,p.unshift(d),fh(d),d=c;p.unshift(d),Ho(d);for(var g=h;g.circle&&Math.abs(r-g.circle.x)<Ue&&Math.abs(a-g.circle.cy)<Ue;)h=g.N,p.push(g),fh(g),g=h;p.push(g),Ho(g);var v=p.length,x;for(x=1;x<v;++x)g=p[x],d=p[x-1],Ea(g.edge,d.site,g.site,u);d=p[0],g=p[v-1],g.edge=Rs(d.site,g.site,null,u),Vo(d),Vo(g)}function Ug(o){for(var e=o[0],r=o[1],a,u,c,h,p=qo._;p;)if(c=Bg(p,r)-e,c>Ue)p=p.L;else if(h=e-pw(p,r),h>Ue){if(!p.R){a=p;break}p=p.R}else{c>-Ue?(a=p.P,u=p):h>-Ue?(a=p,u=p.N):a=u=p;break}Ig(o);var d=Dg(o);if(qo.insert(a,d),!(!a&&!u)){if(a===u){Ho(a),u=Dg(a.site),qo.insert(d,u),d.edge=u.edge=Rs(a.site,d.site),Vo(a),Vo(u);return}if(!u){d.edge=Rs(a.site,d.site);return}Ho(a),Ho(u);var g=a.site,v=g[0],x=g[1],M=o[0]-v,w=o[1]-x,I=u.site,D=I[0]-v,b=I[1]-x,T=2*(M*b-w*D),L=M*M+w*w,P=D*D+b*b,z=[(b*L-w*P)/T+v,(M*P-D*L)/T+x];Ea(u.edge,g,I,z),d.edge=Rs(g,o,null,z),u.edge=Rs(o,I,null,z),Vo(a),Vo(u)}}function Bg(o,e){var r=o.site,a=r[0],u=r[1],c=u-e;if(!c)return a;var h=o.P;if(!h)return-1/0;r=h.site;var p=r[0],d=r[1],g=d-e;if(!g)return p;var v=p-a,x=1/c-1/g,M=v/g;return x?(-M+Math.sqrt(M*M-2*x*(v*v/(-2*g)-d+g/2+u-c/2)))/x+a:(a+p)/2}function pw(o,e){var r=o.N;if(r)return Bg(r,e);var a=o.site;return a[1]===e?a[0]:1/0}var Ue=1e-6,Lg=1e-12,qo,Cr,Ls,Jn;function dw(o,e,r){return(o[0]-r[0])*(e[1]-o[1])-(o[0]-e[0])*(r[1]-o[1])}function mw(o,e){return e[1]-o[1]||e[0]-o[0]}function Fu(o,e){var r=o.sort(mw).pop(),a,u,c;for(Jn=[],Cr=new Array(o.length),qo=new ch,Ls=new ch;;)if(c=Ou,r&&(!c||r[1]<c.y||r[1]===c.y&&r[0]<c.x))(r[0]!==a||r[1]!==u)&&(Ug(r),a=r[0],u=r[1]),r=o.pop();else if(c)Fg(c.arc);else break;if(Pg(),e){var h=+e[0][0],p=+e[0][1],d=+e[1][0],g=+e[1][1];Cg(h,p,d,g),Rg(h,p,d,g)}this.edges=Jn,this.cells=Cr,qo=Ls=Jn=Cr=null}Fu.prototype={constructor:Fu,polygons:function(){var o=this.edges;return this.cells.map(function(e){var r=e.halfedges.map(function(a){return hh(e,o[a])});return r.data=e.site.data,r})},triangles:function(){var o=[],e=this.edges;return this.cells.forEach(function(r,a){if(p=(c=r.halfedges).length)for(var u=r.site,c,h=-1,p,d,g=e[c[p-1]],v=g.left===u?g.right:g.left;++h<p;)d=v,g=e[c[h]],v=g.left===u?g.right:g.left,d&&v&&a<d.index&&a<v.index&&dw(u,d,v)<0&&o.push([u.data,d.data,v.data])}),o},links:function(){return this.edges.filter(function(o){return o.right}).map(function(o){return{source:o.left.data,target:o.right.data}})},find:function(o,e,r){for(var a=this,u,c=a._found||0,h=a.cells.length,p;!(p=a.cells[c]);)if(++c>=h)return null;var d=o-p.site[0],g=e-p.site[1],v=d*d+g*g;do p=a.cells[u=c],c=null,p.halfedges.forEach(function(x){var M=a.edges[x],w=M.left;if(!((w===p.site||!w)&&!(w=M.right))){var I=o-w[0],D=e-w[1],b=I*I+D*D;b<v&&(v=b,c=w.index)}});while(c!==null);return a._found=u,r==null||v<=r*r?p.site:null}};var ww=ln(Ds(),1);var Th=ln(Vg(),1);function Ur(){return new zu}function zu(){this.reset()}zu.prototype={constructor:zu,reset:function(){this.s=this.t=0},add:function(o){Hg(Bu,o,this.t),Hg(this,Bu.s,this.s),this.s?this.t+=Bu.t:this.s=Bu.t},valueOf:function(){return this.s}};var Bu=new zu;function Hg(o,e,r){var a=o.s=e+r,u=a-e,c=a-u;o.t=e-c+(r-u)}var Ae=1e-6;var Oe=Math.PI,On=Oe/2,ku=Oe/4,Ui=Oe*2,Wo=180/Oe,Br=Oe/180,mn=Math.abs,bi=Math.atan,zr=Math.atan2,xe=Math.cos;var Gu=Math.exp;var Ma=Math.log;var Lt=Math.sin;var ar=Math.sqrt,wa=Math.tan;function mh(o){return o>1?0:o<-1?Oe:Math.acos(o)}function Ir(o){return o>1?On:o<-1?-On:Math.asin(o)}function Ai(){}var Sw=Ur(),vO=Ur();function Xo(o){var e=o[0],r=o[1],a=xe(r);return[a*xe(e),a*Lt(e),Lt(r)]}function Sa(o,e){return[o[1]*e[2]-o[2]*e[1],o[2]*e[0]-o[0]*e[2],o[0]*e[1]-o[1]*e[0]]}function ba(o){var e=ar(o[0]*o[0]+o[1]*o[1]+o[2]*o[2]);o[0]/=e,o[1]/=e,o[2]/=e}var CO=Ur();function Wg(o,e){return[o>Oe?o-Ui:o<-Oe?o+Ui:o,e]}Wg.invert=Wg;function gh(){var o=[],e;return{point:function(r,a){e.push([r,a])},lineStart:function(){o.push(e=[])},lineEnd:Ai,rejoin:function(){o.length>1&&o.push(o.pop().concat(o.shift()))},result:function(){var r=o;return o=[],e=null,r}}}function yh(o,e){return mn(o[0]-e[0])<Ae&&mn(o[1]-e[1])<Ae}function Vu(o,e,r,a){this.x=o,this.z=e,this.o=r,this.e=a,this.v=!1,this.n=this.p=null}function vh(o,e,r,a,u){var c=[],h=[],p,d;if(o.forEach(function(I){if(!((D=I.length-1)<=0)){var D,b=I[0],T=I[D],L;if(yh(b,T)){for(u.lineStart(),p=0;p<D;++p)u.point((b=I[p])[0],b[1]);u.lineEnd();return}c.push(L=new Vu(b,I,null,!0)),h.push(L.o=new Vu(b,null,L,!1)),c.push(L=new Vu(T,I,null,!1)),h.push(L.o=new Vu(T,null,L,!0))}}),!!c.length){for(h.sort(e),Xg(c),Xg(h),p=0,d=h.length;p<d;++p)h[p].e=r=!r;for(var g=c[0],v,x;;){for(var M=g,w=!0;M.v;)if((M=M.n)===g)return;v=M.z,u.lineStart();do{if(M.v=M.o.v=!0,M.e){if(w)for(p=0,d=v.length;p<d;++p)u.point((x=v[p])[0],x[1]);else a(M.x,M.n.x,1,u);M=M.n}else{if(w)for(v=M.p.z,p=v.length-1;p>=0;--p)u.point((x=v[p])[0],x[1]);else a(M.x,M.p.x,-1,u);M=M.p}M=M.o,v=M.z,w=!w}while(!M.v);u.lineEnd()}}}function Xg(o){if(e=o.length){for(var e,r=0,a=o[0],u;++r<e;)a.n=u=o[r],u.p=a,a=u;a.n=u=o[0],u.p=a}}function Eo(o,e){return o<e?-1:o>e?1:o>=e?0:NaN}function _h(o){return o.length===1&&(o=Tw(o)),{left:function(e,r,a,u){for(a==null&&(a=0),u==null&&(u=e.length);a<u;){var c=a+u>>>1;o(e[c],r)<0?a=c+1:u=c}return a},right:function(e,r,a,u){for(a==null&&(a=0),u==null&&(u=e.length);a<u;){var c=a+u>>>1;o(e[c],r)>0?u=c:a=c+1}return a}}}function Tw(o){return function(e,r){return Eo(o(e),r)}}var Yg=_h(Eo),Cw=Yg.right,Iw=Yg.left;var $g=Array.prototype,Rw=$g.slice,Nw=$g.map;var x3=Math.sqrt(50),E3=Math.sqrt(10),M3=Math.sqrt(2);function qu(o){for(var e=o.length,r,a=-1,u=0,c,h;++a<e;)u+=o[a].length;for(c=new Array(u);--e>=0;)for(h=o[e],r=h.length;--r>=0;)c[--u]=h[r];return c}var kw=1e9,oU=-kw;var xh=Ur();function Eh(o,e){var r=e[0],a=e[1],u=[Lt(r),-xe(r),0],c=0,h=0;xh.reset();for(var p=0,d=o.length;p<d;++p)if(v=(g=o[p]).length)for(var g,v,x=g[v-1],M=x[0],w=x[1]/2+ku,I=Lt(w),D=xe(w),b=0;b<v;++b,M=L,I=z,D=k,x=T){var T=g[b],L=T[0],P=T[1]/2+ku,z=Lt(P),k=xe(P),Y=L-M,q=Y>=0?1:-1,C=q*Y,ot=C>Oe,pt=I*z;if(xh.add(zr(pt*q*Lt(C),D*k+pt*xe(C))),c+=ot?Y+q*Ui:Y,ot^M>=r^L>=r){var dt=Sa(Xo(x),Xo(T));ba(dt);var F=Sa(u,dt);ba(F);var ye=(ot^Y>=0?-1:1)*Ir(F[2]);(a>ye||a===ye&&(dt[0]||dt[1]))&&(h+=ot^Y>=0?1:-1)}}return(c<-Ae||c<Ae&&xh<-Ae)^h&1}var mU=Ur();var DU=Ur(),OU=Ur();var Hw=1/0;var BU=-Hw;function Mh(o){this._context=o}Mh.prototype={_radius:4.5,pointRadius:function(o){return this._radius=o,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(o,e){switch(this._point){case 0:{this._context.moveTo(o,e),this._point=1;break}case 1:{this._context.lineTo(o,e);break}default:{this._context.moveTo(o+this._radius,e),this._context.arc(o,e,this._radius,0,Ui);break}}},result:Ai};var $U=Ur();function wh(){this._string=[]}wh.prototype={_radius:4.5,_circle:Kg(4.5),pointRadius:function(o){return(o=+o)!==this._radius&&(this._radius=o,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(o,e){switch(this._point){case 0:{this._string.push("M",o,",",e),this._point=1;break}case 1:{this._string.push("L",o,",",e);break}default:{this._circle==null&&(this._circle=Kg(this._radius)),this._string.push("M",o,",",e,this._circle);break}}},result:function(){if(this._string.length){var o=this._string.join("");return this._string=[],o}else return null}};function Kg(o){return"m0,"+o+"a"+o+","+o+" 0 1,1 0,"+-2*o+"a"+o+","+o+" 0 1,1 0,"+2*o+"z"}function Sh(o,e,r,a){return function(u,c){var h=e(c),p=u.invert(a[0],a[1]),d=gh(),g=e(d),v=!1,x,M,w,I={point:D,lineStart:T,lineEnd:L,polygonStart:function(){I.point=P,I.lineStart=z,I.lineEnd=k,M=[],x=[]},polygonEnd:function(){I.point=D,I.lineStart=T,I.lineEnd=L,M=qu(M);var Y=Eh(x,p);M.length?(v||(c.polygonStart(),v=!0),vh(M,Xw,Y,r,c)):Y&&(v||(c.polygonStart(),v=!0),c.lineStart(),r(null,null,1,c),c.lineEnd()),v&&(c.polygonEnd(),v=!1),M=x=null},sphere:function(){c.polygonStart(),c.lineStart(),r(null,null,1,c),c.lineEnd(),c.polygonEnd()}};function D(Y,q){var C=u(Y,q);o(Y=C[0],q=C[1])&&c.point(Y,q)}function b(Y,q){var C=u(Y,q);h.point(C[0],C[1])}function T(){I.point=b,h.lineStart()}function L(){I.point=D,h.lineEnd()}function P(Y,q){w.push([Y,q]);var C=u(Y,q);g.point(C[0],C[1])}function z(){g.lineStart(),w=[]}function k(){P(w[0][0],w[0][1]),g.lineEnd();var Y=g.clean(),q=d.result(),C,ot=q.length,pt,dt,F;if(w.pop(),x.push(w),w=null,!!ot){if(Y&1){if(dt=q[0],(pt=dt.length-1)>0){for(v||(c.polygonStart(),v=!0),c.lineStart(),C=0;C<pt;++C)c.point((F=dt[C])[0],F[1]);c.lineEnd()}return}ot>1&&Y&2&&q.push(q.pop().concat(q.shift())),M.push(q.filter(Ww))}}return I}}function Ww(o){return o.length>1}function Xw(o,e){return((o=o.x)[0]<0?o[1]-On-Ae:On-o[1])-((e=e.x)[0]<0?e[1]-On-Ae:On-e[1])}var Yw=Sh(function(){return!0},$w,Jw,[-Oe,-On]);function $w(o){var e=NaN,r=NaN,a=NaN,u;return{lineStart:function(){o.lineStart(),u=1},point:function(c,h){var p=c>0?Oe:-Oe,d=mn(c-e);mn(d-Oe)<Ae?(o.point(e,r=(r+h)/2>0?On:-On),o.point(a,r),o.lineEnd(),o.lineStart(),o.point(p,r),o.point(c,r),u=0):a!==p&&d>=Oe&&(mn(e-a)<Ae&&(e-=a*Ae),mn(c-p)<Ae&&(c-=p*Ae),r=Zw(e,r,c,h),o.point(a,r),o.lineEnd(),o.lineStart(),o.point(p,r),u=0),o.point(e=c,r=h),a=p},lineEnd:function(){o.lineEnd(),e=r=NaN},clean:function(){return 2-u}}}function Zw(o,e,r,a){var u,c,h=Lt(o-r);return mn(h)>Ae?bi((Lt(e)*(c=xe(a))*Lt(r)-Lt(a)*(u=xe(e))*Lt(o))/(u*c*h)):(e+a)/2}function Jw(o,e,r,a){var u;if(o==null)u=r*On,a.point(-Oe,u),a.point(0,u),a.point(Oe,u),a.point(Oe,0),a.point(Oe,-u),a.point(0,-u),a.point(-Oe,-u),a.point(-Oe,0),a.point(-Oe,u);else if(mn(o[0]-e[0])>Ae){var c=o[0]<e[0]?Oe:-Oe;u=r*c/2,a.point(-c,u),a.point(0,u),a.point(c,u)}else a.point(e[0],e[1])}function Wu(o){return function(e){var r=new bh;for(var a in o)r[a]=o[a];return r.stream=e,r}}function bh(){}bh.prototype={constructor:bh,point:function(o,e){this.stream.point(o,e)},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 OB=xe(30*Br);var ZB=Wu({point:function(o,e){this.stream.point(o*Br,e*Br)}});function Xu(o){return function(e,r){var a=xe(e),u=xe(r),c=o(a*u);return[c*u*Lt(e),c*Lt(r)]}}function Bi(o){return function(e,r){var a=ar(e*e+r*r),u=o(a),c=Lt(u),h=xe(u);return[zr(e*c,a*h),Ir(a&&r*c/a)]}}var i0=Xu(function(o){return ar(2/(1+o))});i0.invert=Bi(function(o){return 2*Ir(o/2)});var o0=Xu(function(o){return(o=mh(o))&&o/Lt(o)});o0.invert=Bi(function(o){return o});function Ah(o,e){return[o,Ma(wa((On+e)/2))]}Ah.invert=function(o,e){return[o,2*bi(Gu(e))-On]};function Yu(o,e){return[o,e]}Yu.invert=Yu;function s0(o,e){var r=xe(e),a=xe(o)*r;return[r*Lt(o)/a,Lt(e)/a]}s0.invert=Bi(bi);function a0(o,e){var r=e*e,a=r*r;return[o*(.8707-.131979*r+a*(-.013791+a*(.003971*r-.001529*a))),e*(1.007226+r*(.015085+a*(-.044475+.028874*r-.005916*a)))]}a0.invert=function(o,e){var r=e,a=25,u;do{var c=r*r,h=c*c;r-=u=(r*(1.007226+c*(.015085+h*(-.044475+.028874*c-.005916*h)))-e)/(1.007226+c*(.015085*3+h*(-.044475*7+.028874*9*c-.005916*11*h)))}while(mn(u)>Ae&&--a>0);return[o/(.8707+(c=r*r)*(-.131979+c*(-.013791+c*c*c*(.003971-.001529*c)))),r]};function u0(o,e){return[xe(e)*Lt(o),Lt(e)]}u0.invert=Bi(Ir);function l0(o,e){var r=xe(e),a=1+xe(o)*r;return[r*Lt(o)/a,Lt(e)/a]}l0.invert=Bi(function(o){return 2*bi(o)});function c0(o,e){return[Ma(wa((On+e)/2)),-o]}c0.invert=function(o,e){return[-e,2*bi(Gu(o))-On]};var nS=ln(Ds(),1);var rS=ln(Ds(),1);var oS=ln(Ds(),1);var sS=ln(Ds(),1);function wo(o,e){return Math.sqrt((e[0]-o[0])**2+(e[1]-o[1])**2)}function Ch(o){let e=0;for(let r=0;r<o.length-1;r++)e+=wo(o[r],o[r+1]);return e}function f0(o,e,r){let a=new br(e[0]-o[0],e[1]-o[1]),u=new br(e[0]-r[0],e[1]-r[1]),h=a.angleTo(u)*180/Math.PI,p=new br(e[0]-o[0],e[1]-o[1]);return new br(r[0]-o[0],r[1]-o[1]).cross(p)>0?h:-h}var oi="___",$u=class{constructor(e=3){this.lift_priority=e}roadInfo=[];pointMap=new Map;nodeMap=new Map;facilityMap=new Map;straightLadderMap=new Map;escalatorMap=new Map;staircaseMap=new Map;lineMap=new Map;baseRoute=new zi.default;escalatorRoute=new zi.default;straightLadderRoute=new zi.default;initRoute(e){this.clear(),this.roadInfo=e,e.length&&(e.forEach(r=>{r.points.forEach(a=>{let u=\`\${r.floor}\${oi}\${a.id}\`;if(this.pointMap.set(u,a),this.nodeMap.set(\`\${a.floor}\${oi}\${a.nodeId}\`,u),a.type==="straightLadder"){let c=this.straightLadderMap.get(a.name)||[];c.push({...a}),this.straightLadderMap.set(a.name,c)}if(a.type==="staircase"){let c=this.staircaseMap.get(a.name)||[];c.push({...a}),this.staircaseMap.set(a.name,c)}if(a.type==="escalator"){let c=this.escalatorMap.get(a.name)||{};a.escalatorDirection==="exit"?c.end={floor:a.floor,id:a.id}:c.start={floor:a.floor,id:a.id},this.escalatorMap.set(a.name,c)}if(a.type==="facility"){let c=this.facilityMap.get(a.targetId)||[];c.push({...a}),this.facilityMap.set(a.targetId,c)}}),r.lines.filter(a=>a.direction!=="no").forEach(a=>{let u=\`\${r.floor}\${oi}\${a.from}\`,c=\`\${r.floor}\${oi}\${a.to}\`,h=this.pointMap.get(u)?.cds,p=this.pointMap.get(c)?.cds;if(h?.length&&p?.length){let d=wo(h,p);this.addLineItem(u,c,d),a.direction==="double"&&this.addLineItem(c,u,d)}})}),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute())}addLineItem(e,r,a,u=this.lineMap){let c=u.get(e)||new Map;c.set(r,a),u.set(e,c)}addFacilityToLineMap(e,r,a,u){[...this.straightLadderMap,...this.staircaseMap].forEach(([c,h])=>{if(!(h.length<2))for(let p=0;p<h.length;p++){let d=\`\${h[p].floor}\${oi}\${h[p].id}\`;for(let g=0;g<h.length;g++)if(p!==g){let v=\`\${h[g].floor}\${oi}\${h[g].id}\`,x=this.pointMap.get(d)?.cds,M=this.pointMap.get(v)?.cds;if(x?.length&&M?.length)if(h[p].type==="straightLadder"){let w=r;this.addLineItem(d,v,w,u)}else{let w=a;this.addLineItem(d,v,w,u)}}}}),this.escalatorMap.forEach((c,h)=>{if(c.start&&c.end){let p=\`\${c.start.floor}\${oi}\${c.start.id}\`,d=\`\${c.end.floor}\${oi}\${c.end.id}\`,g=this.pointMap.get(p)?.cds,v=this.pointMap.get(d)?.cds;if(g?.length&&v?.length){let x=e;this.addLineItem(p,d,x,u)}}})}initBaseRoute(){let e=new Map([...this.lineMap]);this.addFacilityToLineMap(1,this.lift_priority,3e4,e),this.baseRoute=new zi.default(e)}initEscalatorRoute(){let e=new Map([...this.lineMap]),r=1e4;this.addFacilityToLineMap(1*r,this.lift_priority*r,3e4*r,e),this.escalatorRoute=new zi.default(e)}initStraightLadderRoute(){let e=new Map([...this.lineMap]),r=1e4;this.addFacilityToLineMap(3*r,1*r,3e4*r,e),this.straightLadderRoute=new zi.default(e)}checkStart(e){return!(!e.floor||!e.nodeId&&(!e.coord||e.coord.length<2))}checkEnd(e){return e.facility?!0:this.checkStart(e)}transformStart(e){if(e.nodeId){let r=this.nodeMap.get(\`\${e.floor}\${oi}\${e.nodeId}\`);if(r){let[a,u]=r.split(oi);return{floor:a,id:u}}}if(e.coord?.length){let r=this.roadInfo.find(u=>u.floor===e.floor);if(!r)return null;let a=r.points.reduce((u,c)=>{let h=wo(e.coord,c.cds);return h<u.min&&(u.min=h,u.point=c),u},{min:1/0,point:r.points[0]});return{floor:a.point.floor,id:a.point.id}}return null}transformEnd(e){if(e.floor){let r=this.transformStart(e);if(r)return r}return e.facility&&this.facilityMap.get(e.facility)?.length?{floor:e.floor,facility:e.facility}:null}getPath(e,r,a=""){if(!this.checkStart(e))return"start-error";if(!this.checkEnd(r))return"end-error";let u=this.transformStart(e);if(!u)return"no-start";let c=this.transformEnd(r);if(!c)return"no-end";let h=this.getBasePath.bind(this);switch(a){case"escalator":h=this.getEscalatorPath.bind(this);break;case"straightLadder":h=this.getStraightLadderPath.bind(this);break;default:h=this.getBasePath.bind(this);break}if(c.id)return h(u,c);if(c.facility){let p=this.facilityMap.get(c.facility).filter(g=>c.floor?g.floor===c.floor:!0);if(!p.length)return null;let d=p.map(g=>h(u,{floor:g.floor,id:g.id})).filter(g=>!!g);return d.reduce((g,v)=>{let x=v.reduce((M,w)=>M+Ch(w.points),0);return x<g.distance&&(g.distance=x,g.path=v),g},{distance:1/0,path:d[0]}).path}}getRoutePath(e,r,a){let u=\`\${e.floor}\${oi}\${e.id}\`,c=\`\${r.floor}\${oi}\${r.id}\`,h=a.path(u,c);if(!h)return null;let p=[];return h.map(d=>{let g=this.pointMap.get(d);if(g){let{floor:v}=g;if(p[p.length-1]?.floor===v){let x=p[p.length-1];x.points.push(g.cds),x.endType=g.type,x.destId=g.nodeId,x.distance=Ch(x.points)}else p.push({floor:v,points:[g.cds],endType:g.type,destId:g.nodeId,distance:0})}}),p}getBasePath(e,r){return this.getRoutePath(e,r,this.baseRoute)}getEscalatorPath(e,r){return this.getRoutePath(e,r,this.escalatorRoute)}getStraightLadderPath(e,r){return this.getRoutePath(e,r,this.straightLadderRoute)}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 zi.default,this.escalatorRoute=new zi.default,this.straightLadderRoute=new zi.default}};var mS=ln(y0(),1);function gS(o,e,r){let a=f0(o,e,r);return 180-Math.abs(a)<15?"front":a>135?"right_front":a<-135?"left_front":a<=135&&a>=60?"right":a>=-135&&a<=-60?"left":a<60&&a>0?"right_back":a>-60&&a<0?"left_back":"front"}function v0(o){if(!o.length)return[];if(o.length===1)return[{direction:"start",distance:0,points:o}];let e=[{direction:"start",distance:wo(o[0],o[1]),points:[o[0],o[1]]}];for(let r=2;r<o.length;r++){let a=gS(o[r-2],o[r-1],o[r]);if(a==="front"){let u=e[e.length-1],c=wo(o[r-1],o[r]);u.distance+=c,r!==2&&u.points.push(o[r-1])}else e.push({direction:a,distance:wo(o[r-1],o[r]),points:[o[r-1],o[r]]})}return e.push({direction:"end",distance:0,points:[o[o.length-1]]}),e}function _0(o){return o.replace(/[A-Z]/g,e=>"_"+e.toLowerCase()).replace(/^_/,"")}function x0(o){let e={};for(let a in o)a.startsWith("on")&&(e[_0(a.slice(2))]=o[a]);let r=async({data:a})=>{if(e[a.type])try{let u=await e[a.type](a.data);self.postMessage({type:\`\${a.type}_result\`,key:a.key,data:u})}catch(u){self.postMessage({type:\`\${a.type}_result\`,key:a.key,error:u})}else self.postMessage({type:\`\${a.type}_result\`,key:a.key,error:"no_event"})};return self.addEventListener("message",r),()=>{self.removeEventListener("message",r)}}var Ih=new $u;x0({onSetRoadInfo({roadData:o}){Ih.initRoute(o)},onGetPath({start:o,end:e,type:r}){return Ih.getPath(o,e,r)},onGetDirectionPath(o){return v0(o)},onClear(){Ih.clear()}});
|
|
7227
|
-
`],{type:"text/javascript"}),e=URL.createObjectURL(r),t=new Worker(e);return URL.revokeObjectURL(e),t}var hu=class extends ed{worker=lo();initRoadStatus=!1;constructor(){super()}async setRoadData(e){this.initRoadStatus=!1,this.dispatchEvent({type:"init-road-status",status:!1}),await Fe(this.worker,"set_road_info",{roadData:e}),this.initRoadStatus=!0,this.dispatchEvent({type:"init-road-status",status:!0})}async getPath(e,t,n=""){return new Promise((i,o)=>{let a=()=>{Fe(this.worker,"get_path",{start:e,end:t,type:n}).then(s=>{s?typeof s=="string"?o(s):i(s):o("no-path")})};if(this.initRoadStatus)a();else{let s=({status:u})=>{u&&(this.removeEventListener("init-road-status",s),a())};this.addEventListener("init-road-status",s)}})}getDirectionPath(e){return Fe(this.worker,"get_direction_path",e)}async dispose(){Fe(this.worker,"clear",""),this.worker.terminate()}};import{Frustum as nd}from"three";var gi=class extends ve{startPoint;endPoint;rect;frustum=new nd;constructor(e){super(e);let{config:{selectBox:{fill:t,stroke:n}}}=e;this.rect=Ze(n,t),this.svg.appendChild(this.rect),this.registryEvent()}setEnable(e){super.setEnable(e),te(this.rect,0,0,0,0),e?this.registryEvent():(this.startPoint=void 0,this.unRegistryEvent())}onPointerDown=e=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(e);t&&(this.startPoint=t),this.endPoint=void 0};onPointerMove=e=>{if(!this.enable||!this.startPoint)return;let t=this.getIntersectByPointerEvent(e);t&&(this.endPoint=t)};onPointerUp=e=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(e);t&&(this.endPoint=t),this.doSelect(),this.startPoint=void 0};onUpdate=()=>{if(this.startPoint){let e=this.getSvgCoordinate(this.startPoint),t={...e};this.endPoint&&(t=this.getSvgCoordinate(this.endPoint));let n={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y)},i=Math.abs(t.x-e.x),o=Math.abs(t.y-e.y);te(this.rect,n.x,n.y,i,o)}else te(this.rect,0,0,0,0)};registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointermove",this.onPointerMove),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointermove",this.onPointerMove),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.removeEventListener("update",this.onUpdate)}doSelect(){if(this.startPoint&&this.endPoint){if(this.startPoint.distanceTo(this.endPoint)<.1)return;let{context:{camera:t,container:{clientWidth:n,clientHeight:i}}}=this,o=et(this.startPoint,t,n,i),a=et(this.endPoint,t,n,i),s={x:Math.min(o.x,a.x),y:Math.min(o.y,a.y)},u={x:Math.max(o.x,a.x),y:Math.max(o.y,a.y)},c=this.searchMapInFrustum(s,u);this.dispatchEvent({type:"selected",list:c})}}searchMapInFrustum(e,t){let{context:n}=this;return n.currentFloor?.graphicLayer.children.filter(i=>i instanceof Vt&&this.searchChildInFrustum(i,e,t))||[]}searchChildInFrustum(e,t,n){let{context:{camera:i,container:{clientWidth:o,clientHeight:a}}}=this;if(!e)return!1;if(!e.mesh){let p=e.getPosition();if(p){let d=et(p,i,o,a);return Ye(d,t,n)}return!1}e.mesh.geometry.boundingBox||e.mesh.geometry.computeBoundingBox();let s=e.mesh.geometry.boundingBox;if(!s)return!1;let{min:u,max:c}=s,l=et(u,i,o,a),h=et(c,i,o,a);return!(!Ye(l,t,n)||!Ye(h,t,n))}dispose(){this.unRegistryEvent()}};var rd={boxSelection:!1,elements:["graphic","poi"]},pu=class extends Ce{options;_list=new Set;_poiList=new Set;boxSelection;prevPanStatus;prevRotateStatus;downPoint=null;isMultipleSelect=!1;constructor(e,t={}){super(e),this.options={...rd,...t},this.boxSelection=new gi(this.bmap.context),this.boxSelection.setEnable(!1),this.registryEvent()}get list(){return this._list}enableBoxSelection(){this.isMultipleSelect||!this.options.boxSelection||(this.isMultipleSelect=!0,this.boxSelection.setEnable(!0),this.prevPanStatus=this.bmap.context.control.enablePan,this.prevRotateStatus=this.bmap.context.control.enableRotate,this.bmap.context.control.enablePan=!1,this.bmap.context.control.enableRotate=!1)}disableBoxSelection(){this.isMultipleSelect&&(this.isMultipleSelect=!1,this.boxSelection.setEnable(!1),this.bmap.context.control.enablePan=!!this.prevPanStatus,this.bmap.context.control.enableRotate=!!this.prevRotateStatus)}onPointerDown=e=>{this.downPoint={x:e.offsetX,y:e.offsetY}};onPointerUp=e=>{if(!this.downPoint)return;let{offsetX:t,offsetY:n}=e,{x:i,y:o}=this.downPoint;if(Math.sqrt((i-t)**2+(o-n)**2)>3)return;let a=new Set,s=[],u=[];if(this.options.elements.includes("graphic")){let{graphics:c}=this.bmap.context.getGraphicsByDeviceXy(t,n);c.map(l=>a.add(l.options.id)),s.push(...c)}if(this.options.elements.includes("poi")){let c=this.bmap.context.getPoisByDeviceXy(t,n);u.push(...c),c.forEach(l=>{if(!a.has(l.options.id)){let h=this.bmap.context.currentFloor?.graphicLayer.graphicMap.get(l.options.id)||null;h&&(a.add(l.options.id),s.push(h))}})}(!this.options.boxSelection||!(Mn?e.metaKey:e.ctrlKey))&&(this._list.clear(),this._poiList.clear()),s.forEach(c=>this._list.add(c)),u.forEach(c=>this._poiList.add(c)),this.selectEnd(),this.downPoint=null};onPointerOut=e=>{this.disableBoxSelection()};onKeyDown=e=>{Tn(e.key)&&this.enableBoxSelection()};onKeyUp=e=>{Tn(e.key)&&this.disableBoxSelection()};onBoxSelected=({list:e})=>{this._list.clear(),this._poiList.clear(),e.forEach(t=>{if(this.options.elements.includes("graphic")&&this._list.add(t),this.options.elements.includes("poi")){let n=this.bmap.getPoiById(t.options.id);n&&this._poiList.add(n)}}),this.selectEnd()};selectEnd(){this.dispatchEvent({type:"select",graphics:[...this._list],pois:[...this._poiList],isMultipleSelect:this.isMultipleSelect})}registryEvent(){this.bmap.context.container.addEventListener("pointerdown",this.onPointerDown),this.bmap.context.container.addEventListener("pointerup",this.onPointerUp),this.bmap.context.container.addEventListener("pointerout",this.onPointerOut),this.bmap.context.container.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.boxSelection.addEventListener("selected",this.onBoxSelected)}unRegistryEvent(){this.bmap.context.container.removeEventListener("pointerdown",this.onPointerDown),this.bmap.context.container.removeEventListener("pointerup",this.onPointerUp),this.bmap.context.container.removeEventListener("pointerout",this.onPointerOut),this.bmap.context.container.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp),this.boxSelection.removeEventListener("selected",this.onBoxSelected)}clear(){this._list.clear()}remove(e){this._list.delete(e)}dispose(){this.unRegistryEvent()}};import{cloneDeep as id,isNil as on,throttle as fu}from"lodash";import{EventDispatcher as od}from"three";var ad={time:1e3,elements:["compass","deviceMotion","acceleration","gps"]},yi=class extends od{options;gpsTimer=null;data=[];timer=new jt;dispatchTimer=null;constructor(e={}){super(),this.options={...ad,...e}}start(){this.options.elements.some(e=>["deviceMotion","compass"].includes(e))&&this.listenDeviceOrientation(),this.options.elements.includes("acceleration")&&this.listenAcceleration(),this.options.elements.includes("gps")&&this.listenGps(),this.dispatchEvent({type:"start"}),this.dispatchTimer=this.timer.setInterval(()=>{this.dispatchEvent({type:"sensor-data",data:id(this.data)}),this.data=[]},this.options.time)}addDataItem(e){this.data.push(e),this.dispatchEvent({type:"add-data-item",item:e})}addAcceleration=fu(e=>{this.addDataItem(e)},20);deviceOrientationAbsHandler=fu(e=>{let t=Date.now(),{alpha:n,beta:i,gamma:o}=e;if(on(n)||on(i)||on(o))return;let a;or?a=e.webkitCompassHeading:a=360-n,this.options.elements.includes("deviceMotion")&&this.addDataItem({type:"deviceMotion",timestamp:t,res:[n,i,o]}),this.options.elements.includes("compass")&&this.addDataItem({type:"compass",timestamp:t,res:a})},200);listenDeviceOrientation(){or?window.addEventListener("deviceorientation",this.deviceOrientationAbsHandler,!1):window.addEventListener("deviceorientationabsolute",this.deviceOrientationAbsHandler,{absolute:!0})}handleAcceleration=e=>{let t=e.accelerationIncludingGravity;on(t)||on(t.x)||on(t.y)||on(t.z)||this.addAcceleration({type:"acceleration",timestamp:Date.now(),res:[t.x,t.y,t.z]})};listenAcceleration(){window.addEventListener("devicemotion",this.handleAcceleration,!1)}listenGps(){this.gpsTimer=navigator.geolocation.watchPosition(e=>{console.log("position",e),this.addDataItem({type:"gps",timestamp:Date.now(),res:[e.coords.longitude,e.coords.latitude,e.coords.accuracy]})})}async checkSensor(){return{deviceOrientation:await this.checkDeviceOrientation()}}async checkDeviceOrientation(){if(!or)return!0;if(typeof window.DeviceOrientationEvent<"u"&&typeof window.DeviceOrientationEvent?.requestPermission=="function")try{return await window.DeviceOrientationEvent?.requestPermission()==="granted"}catch{return!1}return!1}stop(){window.removeEventListener("devicemotion",this.handleAcceleration,!1),or?window.removeEventListener("deviceorientation",this.deviceOrientationAbsHandler,!1):window.removeEventListener("deviceorientationabsolute",this.deviceOrientationAbsHandler,{absolute:!0}),on(this.gpsTimer)||navigator.geolocation.clearWatch(this.gpsTimer),this.dispatchTimer&&this.timer.clearInterval(this.dispatchTimer),this.data=[],this.dispatchEvent({type:"stop"})}};import{EventDispatcher as Jy}from"three";function vi(r,e){return 1/Math.sqrt(2*Math.PI*Math.pow(e,2))*Math.exp(-Math.pow(r,2)/(2*Math.pow(e,2)))}function lr(r){return(r+360)%360}function du(r,e){let n=6378137*r*Math.PI/180,i=6378137*Math.log(Math.tan(Math.PI/4+e*Math.PI/180/2));return{x:n,y:i}}function On(r,e,t,n){return Math.sqrt(Math.pow(Math.abs(r-t),2)+Math.pow(Math.abs(e-n),2))}function Fn(){return Fn=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},Fn.apply(null,arguments)}var ho={relTol:1e-12,absTol:1e-15,matrix:"Matrix",number:"number",numberFallback:"number",precision:64,predictable:!1,randomSeed:null};function mu(r,e){if(hr(r,e))return r[e];throw typeof r[e]=="function"&&sd(r,e)?new Error('Cannot access method "'+e+'" as a property'):new Error('No access to property "'+e+'"')}function gu(r,e,t){if(hr(r,e))return r[e]=t,t;throw new Error('No access to property "'+e+'"')}function hr(r,e){return!ud(r)&&!Array.isArray(r)?!1:Un(cd,e)?!0:!(e in Object.prototype||e in Function.prototype)}function sd(r,e){return r==null||typeof r[e]!="function"||Un(r,e)&&Object.getPrototypeOf&&e in Object.getPrototypeOf(r)?!1:Un(ld,e)?!0:!(e in Object.prototype||e in Function.prototype)}function ud(r){return typeof r=="object"&&r&&r.constructor===Object}var cd={length:!0,name:!0},ld={toString:!0,valueOf:!0,toLocaleString:!0};var _i=class{constructor(e){this.wrappedObject=e,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).filter(e=>this.has(e)).values()}get(e){return mu(this.wrappedObject,e)}set(e,t){return gu(this.wrappedObject,e,t),this}has(e){return hr(this.wrappedObject,e)&&e in this.wrappedObject}entries(){return hd(this.keys(),e=>[e,this.get(e)])}forEach(e){for(var t of this.keys())e(this.get(t),t,this)}delete(e){hr(this.wrappedObject,e)&&delete this.wrappedObject[e]}clear(){for(var e of this.keys())this.delete(e)}get size(){return Object.keys(this.wrappedObject).length}};function hd(r,e){return{next:()=>{var t=r.next();return t.done?t:{value:e(t.value),done:!1}}}}function at(r){return typeof r=="number"}function ut(r){return!r||typeof r!="object"||typeof r.constructor!="function"?!1:r.isBigNumber===!0&&typeof r.constructor.prototype=="object"&&r.constructor.prototype.isBigNumber===!0||typeof r.constructor.isDecimal=="function"&&r.constructor.isDecimal(r)===!0}function yu(r){return typeof r=="bigint"}function po(r){return r&&typeof r=="object"&&Object.getPrototypeOf(r).isComplex===!0||!1}function fo(r){return r&&typeof r=="object"&&Object.getPrototypeOf(r).isFraction===!0||!1}function Ci(r){return r&&r.constructor.prototype.isUnit===!0||!1}function ne(r){return typeof r=="string"}var Mt=Array.isArray;function dt(r){return r&&r.constructor.prototype.isMatrix===!0||!1}function He(r){return Array.isArray(r)||dt(r)}function vu(r){return r&&r.isDenseMatrix&&r.constructor.prototype.isMatrix===!0||!1}function _u(r){return r&&r.isSparseMatrix&&r.constructor.prototype.isMatrix===!0||!1}function Cu(r){return r&&r.constructor.prototype.isRange===!0||!1}function $n(r){return r&&r.constructor.prototype.isIndex===!0||!1}function Au(r){return typeof r=="boolean"}function xu(r){return r&&r.constructor.prototype.isResultSet===!0||!1}function Eu(r){return r&&r.constructor.prototype.isHelp===!0||!1}function bu(r){return typeof r=="function"}function wu(r){return r instanceof Date}function Su(r){return r instanceof RegExp}function zn(r){return!!(r&&typeof r=="object"&&r.constructor===Object&&!po(r)&&!fo(r))}function Iu(r){return r?r instanceof Map||r instanceof _i||typeof r.set=="function"&&typeof r.get=="function"&&typeof r.keys=="function"&&typeof r.has=="function":!1}function Mu(r){return r===null}function Tu(r){return r===void 0}function Pu(r){return r&&r.isAccessorNode===!0&&r.constructor.prototype.isNode===!0||!1}function Du(r){return r&&r.isArrayNode===!0&&r.constructor.prototype.isNode===!0||!1}function Bu(r){return r&&r.isAssignmentNode===!0&&r.constructor.prototype.isNode===!0||!1}function Ru(r){return r&&r.isBlockNode===!0&&r.constructor.prototype.isNode===!0||!1}function Nu(r){return r&&r.isConditionalNode===!0&&r.constructor.prototype.isNode===!0||!1}function Lu(r){return r&&r.isConstantNode===!0&&r.constructor.prototype.isNode===!0||!1}function Ou(r){return r&&r.isFunctionAssignmentNode===!0&&r.constructor.prototype.isNode===!0||!1}function Fu(r){return r&&r.isFunctionNode===!0&&r.constructor.prototype.isNode===!0||!1}function Uu(r){return r&&r.isIndexNode===!0&&r.constructor.prototype.isNode===!0||!1}function $u(r){return r&&r.isNode===!0&&r.constructor.prototype.isNode===!0||!1}function zu(r){return r&&r.isObjectNode===!0&&r.constructor.prototype.isNode===!0||!1}function ku(r){return r&&r.isOperatorNode===!0&&r.constructor.prototype.isNode===!0||!1}function Gu(r){return r&&r.isParenthesisNode===!0&&r.constructor.prototype.isNode===!0||!1}function Vu(r){return r&&r.isRangeNode===!0&&r.constructor.prototype.isNode===!0||!1}function Xu(r){return r&&r.isRelationalNode===!0&&r.constructor.prototype.isNode===!0||!1}function Hu(r){return r&&r.isSymbolNode===!0&&r.constructor.prototype.isNode===!0||!1}function ju(r){return r&&r.constructor.prototype.isChain===!0||!1}function Kt(r){var e=typeof r;return e==="object"?r===null?"null":ut(r)?"BigNumber":r.constructor&&r.constructor.name?r.constructor.name:"Object":e}function Ct(r){var e=typeof r;if(e==="number"||e==="bigint"||e==="string"||e==="boolean"||r===null||r===void 0)return r;if(typeof r.clone=="function")return r.clone();if(Array.isArray(r))return r.map(function(t){return Ct(t)});if(r instanceof Date)return new Date(r.valueOf());if(ut(r))return r;if(zn(r))return pd(r,Ct);throw new TypeError("Cannot clone: unknown type of value (value: ".concat(r,")"))}function pd(r,e){var t={};for(var n in r)Un(r,n)&&(t[n]=e(r[n]));return t}function Ai(r,e){for(var t in e)Un(e,t)&&(r[t]=e[t]);return r}function Ae(r,e){var t,n,i;if(Array.isArray(r)){if(!Array.isArray(e)||r.length!==e.length)return!1;for(n=0,i=r.length;n<i;n++)if(!Ae(r[n],e[n]))return!1;return!0}else{if(typeof r=="function")return r===e;if(r instanceof Object){if(Array.isArray(e)||!(e instanceof Object))return!1;for(t in r)if(!(t in e)||!Ae(r[t],e[t]))return!1;for(t in e)if(!(t in r))return!1;return!0}else return r===e}}function Un(r,e){return r&&Object.hasOwnProperty.call(r,e)}function qu(r,e){for(var t={},n=0;n<e.length;n++){var i=e[n],o=r[i];o!==void 0&&(t[i]=o)}return t}var Qu=["Matrix","Array"],Wu=["number","BigNumber","Fraction"];var xe=function(e){if(e)throw new Error(`The global config is readonly.
|
|
7227
|
+
`],{type:"text/javascript"}),e=URL.createObjectURL(r),t=new Worker(e);return URL.revokeObjectURL(e),t}var hu=class extends ed{worker=lo();initRoadStatus=!1;constructor(){super()}async setRoadData(e){this.initRoadStatus=!1,this.dispatchEvent({type:"init-road-status",status:!1}),await Fe(this.worker,"set_road_info",{roadData:e}),this.initRoadStatus=!0,this.dispatchEvent({type:"init-road-status",status:!0})}async getPath(e,t,n=""){return new Promise((i,o)=>{let a=()=>{Fe(this.worker,"get_path",{start:e,end:t,type:n}).then(s=>{s?typeof s=="string"?o(s):i(s):o("no-path")})};if(this.initRoadStatus)a();else{let s=({status:u})=>{u&&(this.removeEventListener("init-road-status",s),a())};this.addEventListener("init-road-status",s)}})}getDirectionPath(e){return Fe(this.worker,"get_direction_path",e)}async dispose(){Fe(this.worker,"clear",""),this.worker.terminate()}};import{Frustum as nd}from"three";var gi=class extends ve{startPoint;endPoint;rect;frustum=new nd;constructor(e){super(e);let{config:{selectBox:{fill:t,stroke:n}}}=e;this.rect=Ze(n,t),this.svg.appendChild(this.rect),this.registryEvent()}setEnable(e){super.setEnable(e),te(this.rect,0,0,0,0),e?this.registryEvent():(this.startPoint=void 0,this.unRegistryEvent())}onPointerDown=e=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(e);t&&(this.startPoint=t),this.endPoint=void 0};onPointerMove=e=>{if(!this.enable||!this.startPoint)return;let t=this.getIntersectByPointerEvent(e);t&&(this.endPoint=t)};onPointerUp=e=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(e);t&&(this.endPoint=t),this.doSelect(),this.startPoint=void 0};onUpdate=()=>{if(this.startPoint){let e=this.getSvgCoordinate(this.startPoint),t={...e};this.endPoint&&(t=this.getSvgCoordinate(this.endPoint));let n={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y)},i=Math.abs(t.x-e.x),o=Math.abs(t.y-e.y);te(this.rect,n.x,n.y,i,o)}else te(this.rect,0,0,0,0)};registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointermove",this.onPointerMove),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointermove",this.onPointerMove),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.removeEventListener("update",this.onUpdate)}doSelect(){if(this.startPoint&&this.endPoint){if(this.startPoint.distanceTo(this.endPoint)<.1)return;let{context:{camera:t,container:{clientWidth:n,clientHeight:i}}}=this,o=et(this.startPoint,t,n,i),a=et(this.endPoint,t,n,i),s={x:Math.min(o.x,a.x),y:Math.min(o.y,a.y)},u={x:Math.max(o.x,a.x),y:Math.max(o.y,a.y)},c=this.searchMapInFrustum(s,u);this.dispatchEvent({type:"selected",list:c})}}searchMapInFrustum(e,t){let{context:n}=this;return n.currentFloor?.graphicLayer.children.filter(i=>i instanceof Vt&&this.searchChildInFrustum(i,e,t))||[]}searchChildInFrustum(e,t,n){let{context:{camera:i,container:{clientWidth:o,clientHeight:a}}}=this;if(!e)return!1;if(!e.mesh){let p=e.getPosition();if(p){let d=et(p,i,o,a);return Ye(d,t,n)}return!1}e.mesh.geometry.boundingBox||e.mesh.geometry.computeBoundingBox();let s=e.mesh.geometry.boundingBox;if(!s)return!1;let{min:u,max:c}=s,l=et(u,i,o,a),h=et(c,i,o,a);return!(!Ye(l,t,n)||!Ye(h,t,n))}dispose(){this.unRegistryEvent()}};var rd={boxSelection:!1,elements:["graphic","poi"]},pu=class extends Ce{options;_list=new Set;_poiList=new Set;boxSelection;prevPanStatus;prevRotateStatus;downPoint=null;isMultipleSelect=!1;constructor(e,t={}){super(e),this.options={...rd,...t},this.boxSelection=new gi(this.bmap.context),this.boxSelection.setEnable(!1),this.registryEvent()}get list(){return this._list}enableBoxSelection(){this.isMultipleSelect||!this.options.boxSelection||(this.isMultipleSelect=!0,this.boxSelection.setEnable(!0),this.prevPanStatus=this.bmap.context.control.enablePan,this.prevRotateStatus=this.bmap.context.control.enableRotate,this.bmap.context.control.enablePan=!1,this.bmap.context.control.enableRotate=!1)}disableBoxSelection(){this.isMultipleSelect&&(this.isMultipleSelect=!1,this.boxSelection.setEnable(!1),this.bmap.context.control.enablePan=!!this.prevPanStatus,this.bmap.context.control.enableRotate=!!this.prevRotateStatus)}onPointerDown=e=>{this.downPoint={x:e.offsetX,y:e.offsetY}};onPointerUp=e=>{if(!this.downPoint)return;let{offsetX:t,offsetY:n}=e,{x:i,y:o}=this.downPoint;if(Math.sqrt((i-t)**2+(o-n)**2)>3)return;let a=new Set,s=[],u=[];if(this.options.elements.includes("graphic")){let{graphics:c}=this.bmap.context.getGraphicsByDeviceXy(t,n);c.map(l=>a.add(l.options.id)),s.push(...c)}if(this.options.elements.includes("poi")){let c=this.bmap.context.getPoisByDeviceXy(t,n);u.push(...c),c.forEach(l=>{if(!a.has(l.options.id)){let h=this.bmap.context.currentFloor?.graphicLayer.graphicMap.get(l.options.id)||null;h&&(a.add(l.options.id),s.push(h))}})}(!this.options.boxSelection||!(Mn?e.metaKey:e.ctrlKey))&&(this._list.clear(),this._poiList.clear()),s.forEach(c=>this._list.add(c)),u.forEach(c=>this._poiList.add(c)),this.selectEnd(),this.downPoint=null};onPointerOut=e=>{this.disableBoxSelection()};onKeyDown=e=>{Tn(e.key)&&this.enableBoxSelection()};onKeyUp=e=>{Tn(e.key)&&this.disableBoxSelection()};onBoxSelected=({list:e})=>{this._list.clear(),this._poiList.clear(),e.forEach(t=>{if(this.options.elements.includes("graphic")&&this._list.add(t),this.options.elements.includes("poi")){let n=this.bmap.getPoiById(t.options.id);n&&this._poiList.add(n)}}),this.selectEnd()};selectEnd(){this.dispatchEvent({type:"select",graphics:[...this._list],pois:[...this._poiList],isMultipleSelect:this.isMultipleSelect})}registryEvent(){this.bmap.context.container.addEventListener("pointerdown",this.onPointerDown),this.bmap.context.container.addEventListener("pointerup",this.onPointerUp),this.bmap.context.container.addEventListener("pointerout",this.onPointerOut),this.bmap.context.container.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.boxSelection.addEventListener("selected",this.onBoxSelected)}unRegistryEvent(){this.bmap.context.container.removeEventListener("pointerdown",this.onPointerDown),this.bmap.context.container.removeEventListener("pointerup",this.onPointerUp),this.bmap.context.container.removeEventListener("pointerout",this.onPointerOut),this.bmap.context.container.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp),this.boxSelection.removeEventListener("selected",this.onBoxSelected)}clear(){this._list.clear()}remove(e){this._list.delete(e)}dispose(){this.unRegistryEvent()}};import{cloneDeep as id,isNil as on,throttle as fu}from"lodash";import{EventDispatcher as od}from"three";var ad={time:1e3,elements:["compass","deviceMotion","acceleration","gps"]},yi=class extends od{options;gpsTimer=null;data=[];timer=new jt;dispatchTimer=null;constructor(e={}){super(),this.options={...ad,...e}}start(){this.options.elements.some(e=>["deviceMotion","compass"].includes(e))&&this.listenDeviceOrientation(),this.options.elements.includes("acceleration")&&this.listenAcceleration(),this.options.elements.includes("gps")&&this.listenGps(),this.dispatchEvent({type:"start"}),this.dispatchTimer=this.timer.setInterval(()=>{this.dispatchEvent({type:"sensor-data",data:id(this.data)}),this.data=[]},this.options.time)}addDataItem(e){this.data.push(e),this.dispatchEvent({type:"add-data-item",item:e})}addAcceleration=fu(e=>{this.addDataItem(e)},20);deviceOrientationAbsHandler=fu(e=>{let t=Date.now(),{alpha:n,beta:i,gamma:o}=e;if(on(n)||on(i)||on(o))return;let a;or?a=e.webkitCompassHeading:a=360-n,this.options.elements.includes("deviceMotion")&&this.addDataItem({type:"deviceMotion",timestamp:t,res:[n,i,o]}),this.options.elements.includes("compass")&&this.addDataItem({type:"compass",timestamp:t,res:a})},200);listenDeviceOrientation(){or?window.addEventListener("deviceorientation",this.deviceOrientationAbsHandler,!1):window.addEventListener("deviceorientationabsolute",this.deviceOrientationAbsHandler,{absolute:!0})}handleAcceleration=e=>{let t=e.accelerationIncludingGravity;on(t)||on(t.x)||on(t.y)||on(t.z)||this.addAcceleration({type:"acceleration",timestamp:Date.now(),res:[t.x,t.y,t.z]})};listenAcceleration(){window.addEventListener("devicemotion",this.handleAcceleration,!1)}listenGps(){this.gpsTimer=navigator.geolocation.watchPosition(e=>{console.log("position",e),this.addDataItem({type:"gps",timestamp:Date.now(),res:[e.coords.longitude,e.coords.latitude,e.coords.accuracy]})},()=>{},{enableHighAccuracy:!0})}async checkSensor(){return{deviceOrientation:await this.checkDeviceOrientation()}}async checkDeviceOrientation(){if(!or)return!0;if(typeof window.DeviceOrientationEvent<"u"&&typeof window.DeviceOrientationEvent?.requestPermission=="function")try{return await window.DeviceOrientationEvent?.requestPermission()==="granted"}catch{return!1}return!1}stop(){window.removeEventListener("devicemotion",this.handleAcceleration,!1),or?window.removeEventListener("deviceorientation",this.deviceOrientationAbsHandler,!1):window.removeEventListener("deviceorientationabsolute",this.deviceOrientationAbsHandler,{absolute:!0}),on(this.gpsTimer)||navigator.geolocation.clearWatch(this.gpsTimer),this.dispatchTimer&&this.timer.clearInterval(this.dispatchTimer),this.data=[],this.dispatchEvent({type:"stop"})}};import{EventDispatcher as Jy}from"three";function vi(r,e){return 1/Math.sqrt(2*Math.PI*Math.pow(e,2))*Math.exp(-Math.pow(r,2)/(2*Math.pow(e,2)))}function lr(r){return(r+360)%360}function du(r,e){let n=6378137*r*Math.PI/180,i=6378137*Math.log(Math.tan(Math.PI/4+e*Math.PI/180/2));return{x:n,y:i}}function On(r,e,t,n){return Math.sqrt(Math.pow(Math.abs(r-t),2)+Math.pow(Math.abs(e-n),2))}function Fn(){return Fn=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},Fn.apply(null,arguments)}var ho={relTol:1e-12,absTol:1e-15,matrix:"Matrix",number:"number",numberFallback:"number",precision:64,predictable:!1,randomSeed:null};function mu(r,e){if(hr(r,e))return r[e];throw typeof r[e]=="function"&&sd(r,e)?new Error('Cannot access method "'+e+'" as a property'):new Error('No access to property "'+e+'"')}function gu(r,e,t){if(hr(r,e))return r[e]=t,t;throw new Error('No access to property "'+e+'"')}function hr(r,e){return!ud(r)&&!Array.isArray(r)?!1:Un(cd,e)?!0:!(e in Object.prototype||e in Function.prototype)}function sd(r,e){return r==null||typeof r[e]!="function"||Un(r,e)&&Object.getPrototypeOf&&e in Object.getPrototypeOf(r)?!1:Un(ld,e)?!0:!(e in Object.prototype||e in Function.prototype)}function ud(r){return typeof r=="object"&&r&&r.constructor===Object}var cd={length:!0,name:!0},ld={toString:!0,valueOf:!0,toLocaleString:!0};var _i=class{constructor(e){this.wrappedObject=e,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).filter(e=>this.has(e)).values()}get(e){return mu(this.wrappedObject,e)}set(e,t){return gu(this.wrappedObject,e,t),this}has(e){return hr(this.wrappedObject,e)&&e in this.wrappedObject}entries(){return hd(this.keys(),e=>[e,this.get(e)])}forEach(e){for(var t of this.keys())e(this.get(t),t,this)}delete(e){hr(this.wrappedObject,e)&&delete this.wrappedObject[e]}clear(){for(var e of this.keys())this.delete(e)}get size(){return Object.keys(this.wrappedObject).length}};function hd(r,e){return{next:()=>{var t=r.next();return t.done?t:{value:e(t.value),done:!1}}}}function at(r){return typeof r=="number"}function ut(r){return!r||typeof r!="object"||typeof r.constructor!="function"?!1:r.isBigNumber===!0&&typeof r.constructor.prototype=="object"&&r.constructor.prototype.isBigNumber===!0||typeof r.constructor.isDecimal=="function"&&r.constructor.isDecimal(r)===!0}function yu(r){return typeof r=="bigint"}function po(r){return r&&typeof r=="object"&&Object.getPrototypeOf(r).isComplex===!0||!1}function fo(r){return r&&typeof r=="object"&&Object.getPrototypeOf(r).isFraction===!0||!1}function Ci(r){return r&&r.constructor.prototype.isUnit===!0||!1}function ne(r){return typeof r=="string"}var Mt=Array.isArray;function dt(r){return r&&r.constructor.prototype.isMatrix===!0||!1}function He(r){return Array.isArray(r)||dt(r)}function vu(r){return r&&r.isDenseMatrix&&r.constructor.prototype.isMatrix===!0||!1}function _u(r){return r&&r.isSparseMatrix&&r.constructor.prototype.isMatrix===!0||!1}function Cu(r){return r&&r.constructor.prototype.isRange===!0||!1}function $n(r){return r&&r.constructor.prototype.isIndex===!0||!1}function Au(r){return typeof r=="boolean"}function xu(r){return r&&r.constructor.prototype.isResultSet===!0||!1}function Eu(r){return r&&r.constructor.prototype.isHelp===!0||!1}function bu(r){return typeof r=="function"}function wu(r){return r instanceof Date}function Su(r){return r instanceof RegExp}function zn(r){return!!(r&&typeof r=="object"&&r.constructor===Object&&!po(r)&&!fo(r))}function Iu(r){return r?r instanceof Map||r instanceof _i||typeof r.set=="function"&&typeof r.get=="function"&&typeof r.keys=="function"&&typeof r.has=="function":!1}function Mu(r){return r===null}function Tu(r){return r===void 0}function Pu(r){return r&&r.isAccessorNode===!0&&r.constructor.prototype.isNode===!0||!1}function Du(r){return r&&r.isArrayNode===!0&&r.constructor.prototype.isNode===!0||!1}function Bu(r){return r&&r.isAssignmentNode===!0&&r.constructor.prototype.isNode===!0||!1}function Ru(r){return r&&r.isBlockNode===!0&&r.constructor.prototype.isNode===!0||!1}function Nu(r){return r&&r.isConditionalNode===!0&&r.constructor.prototype.isNode===!0||!1}function Lu(r){return r&&r.isConstantNode===!0&&r.constructor.prototype.isNode===!0||!1}function Ou(r){return r&&r.isFunctionAssignmentNode===!0&&r.constructor.prototype.isNode===!0||!1}function Fu(r){return r&&r.isFunctionNode===!0&&r.constructor.prototype.isNode===!0||!1}function Uu(r){return r&&r.isIndexNode===!0&&r.constructor.prototype.isNode===!0||!1}function $u(r){return r&&r.isNode===!0&&r.constructor.prototype.isNode===!0||!1}function zu(r){return r&&r.isObjectNode===!0&&r.constructor.prototype.isNode===!0||!1}function ku(r){return r&&r.isOperatorNode===!0&&r.constructor.prototype.isNode===!0||!1}function Gu(r){return r&&r.isParenthesisNode===!0&&r.constructor.prototype.isNode===!0||!1}function Vu(r){return r&&r.isRangeNode===!0&&r.constructor.prototype.isNode===!0||!1}function Xu(r){return r&&r.isRelationalNode===!0&&r.constructor.prototype.isNode===!0||!1}function Hu(r){return r&&r.isSymbolNode===!0&&r.constructor.prototype.isNode===!0||!1}function ju(r){return r&&r.constructor.prototype.isChain===!0||!1}function Kt(r){var e=typeof r;return e==="object"?r===null?"null":ut(r)?"BigNumber":r.constructor&&r.constructor.name?r.constructor.name:"Object":e}function Ct(r){var e=typeof r;if(e==="number"||e==="bigint"||e==="string"||e==="boolean"||r===null||r===void 0)return r;if(typeof r.clone=="function")return r.clone();if(Array.isArray(r))return r.map(function(t){return Ct(t)});if(r instanceof Date)return new Date(r.valueOf());if(ut(r))return r;if(zn(r))return pd(r,Ct);throw new TypeError("Cannot clone: unknown type of value (value: ".concat(r,")"))}function pd(r,e){var t={};for(var n in r)Un(r,n)&&(t[n]=e(r[n]));return t}function Ai(r,e){for(var t in e)Un(e,t)&&(r[t]=e[t]);return r}function Ae(r,e){var t,n,i;if(Array.isArray(r)){if(!Array.isArray(e)||r.length!==e.length)return!1;for(n=0,i=r.length;n<i;n++)if(!Ae(r[n],e[n]))return!1;return!0}else{if(typeof r=="function")return r===e;if(r instanceof Object){if(Array.isArray(e)||!(e instanceof Object))return!1;for(t in r)if(!(t in e)||!Ae(r[t],e[t]))return!1;for(t in e)if(!(t in r))return!1;return!0}else return r===e}}function Un(r,e){return r&&Object.hasOwnProperty.call(r,e)}function qu(r,e){for(var t={},n=0;n<e.length;n++){var i=e[n],o=r[i];o!==void 0&&(t[i]=o)}return t}var Qu=["Matrix","Array"],Wu=["number","BigNumber","Fraction"];var xe=function(e){if(e)throw new Error(`The global config is readonly.
|
|
7228
7228
|
Please create a mathjs instance if you want to change the default configuration.
|
|
7229
7229
|
Example:
|
|
7230
7230
|
|
package/lib/bmap.min.js
CHANGED
|
@@ -7224,7 +7224,7 @@ void main() {
|
|
|
7224
7224
|
#include <fog_fragment>
|
|
7225
7225
|
}\`,ve={alphahash_fragment:ty,alphahash_pars_fragment:ey,alphamap_fragment:ny,alphamap_pars_fragment:ry,alphatest_fragment:iy,alphatest_pars_fragment:oy,aomap_fragment:sy,aomap_pars_fragment:ay,batching_pars_vertex:uy,batching_vertex:ly,begin_vertex:cy,beginnormal_vertex:hy,bsdfs:fy,iridescence_fragment:py,bumpmap_pars_fragment:dy,clipping_planes_fragment:my,clipping_planes_pars_fragment:gy,clipping_planes_pars_vertex:yy,clipping_planes_vertex:vy,color_fragment:_y,color_pars_fragment:xy,color_pars_vertex:Ey,color_vertex:My,common:wy,cube_uv_reflection_fragment:Sy,defaultnormal_vertex:by,displacementmap_pars_vertex:Ay,displacementmap_vertex:Ty,emissivemap_fragment:Cy,emissivemap_pars_fragment:Iy,colorspace_fragment:Py,colorspace_pars_fragment:Ry,envmap_fragment:Ny,envmap_common_pars_fragment:Ly,envmap_pars_fragment:Dy,envmap_pars_vertex:Oy,envmap_physical_pars_fragment:Xy,envmap_vertex:Fy,fog_vertex:Uy,fog_pars_vertex:By,fog_fragment:zy,fog_pars_fragment:ky,gradientmap_pars_fragment:Gy,lightmap_pars_fragment:Vy,lights_lambert_fragment:Hy,lights_lambert_pars_fragment:qy,lights_pars_begin:Wy,lights_toon_fragment:Yy,lights_toon_pars_fragment:$y,lights_phong_fragment:Zy,lights_phong_pars_fragment:Jy,lights_physical_fragment:Ky,lights_physical_pars_fragment:Qy,lights_fragment_begin:jy,lights_fragment_maps:tv,lights_fragment_end:ev,logdepthbuf_fragment:nv,logdepthbuf_pars_fragment:rv,logdepthbuf_pars_vertex:iv,logdepthbuf_vertex:ov,map_fragment:sv,map_pars_fragment:av,map_particle_fragment:uv,map_particle_pars_fragment:lv,metalnessmap_fragment:cv,metalnessmap_pars_fragment:hv,morphinstance_vertex:fv,morphcolor_vertex:pv,morphnormal_vertex:dv,morphtarget_pars_vertex:mv,morphtarget_vertex:gv,normal_fragment_begin:yv,normal_fragment_maps:vv,normal_pars_fragment:_v,normal_pars_vertex:xv,normal_vertex:Ev,normalmap_pars_fragment:Mv,clearcoat_normal_fragment_begin:wv,clearcoat_normal_fragment_maps:Sv,clearcoat_pars_fragment:bv,iridescence_pars_fragment:Av,opaque_fragment:Tv,packing:Cv,premultiplied_alpha_fragment:Iv,project_vertex:Pv,dithering_fragment:Rv,dithering_pars_fragment:Nv,roughnessmap_fragment:Lv,roughnessmap_pars_fragment:Dv,shadowmap_pars_fragment:Ov,shadowmap_pars_vertex:Fv,shadowmap_vertex:Uv,shadowmask_pars_fragment:Bv,skinbase_vertex:zv,skinning_pars_vertex:kv,skinning_vertex:Gv,skinnormal_vertex:Vv,specularmap_fragment:Hv,specularmap_pars_fragment:qv,tonemapping_fragment:Wv,tonemapping_pars_fragment:Xv,transmission_fragment:Yv,transmission_pars_fragment:$v,uv_pars_fragment:Zv,uv_pars_vertex:Jv,uv_vertex:Kv,worldpos_vertex:Qv,background_vert:jv,background_frag:t_,backgroundCube_vert:e_,backgroundCube_frag:n_,cube_vert:r_,cube_frag:i_,depth_vert:o_,depth_frag:s_,distanceRGBA_vert:a_,distanceRGBA_frag:u_,equirect_vert:l_,equirect_frag:c_,linedashed_vert:h_,linedashed_frag:f_,meshbasic_vert:p_,meshbasic_frag:d_,meshlambert_vert:m_,meshlambert_frag:g_,meshmatcap_vert:y_,meshmatcap_frag:v_,meshnormal_vert:__,meshnormal_frag:x_,meshphong_vert:E_,meshphong_frag:M_,meshphysical_vert:w_,meshphysical_frag:S_,meshtoon_vert:b_,meshtoon_frag:A_,points_vert:T_,points_frag:C_,shadow_vert:I_,shadow_frag:P_,sprite_vert:R_,sprite_frag:N_},ht={common:{diffuse:{value:new rr(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Dt},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Dt}},envmap:{envMap:{value:null},envMapRotation:{value:new Dt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Dt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Dt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Dt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Dt},normalScale:{value:new br(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Dt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Dt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Dt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Dt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new rr(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new rr(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new rr(16777215)},opacity:{value:1},center:{value:new br(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Dt},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0}}},qf={basic:{uniforms:Or([ht.common,ht.specularmap,ht.envmap,ht.aomap,ht.lightmap,ht.fog]),vertexShader:ve.meshbasic_vert,fragmentShader:ve.meshbasic_frag},lambert:{uniforms:Or([ht.common,ht.specularmap,ht.envmap,ht.aomap,ht.lightmap,ht.emissivemap,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.fog,ht.lights,{emissive:{value:new rr(0)}}]),vertexShader:ve.meshlambert_vert,fragmentShader:ve.meshlambert_frag},phong:{uniforms:Or([ht.common,ht.specularmap,ht.envmap,ht.aomap,ht.lightmap,ht.emissivemap,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.fog,ht.lights,{emissive:{value:new rr(0)},specular:{value:new rr(1118481)},shininess:{value:30}}]),vertexShader:ve.meshphong_vert,fragmentShader:ve.meshphong_frag},standard:{uniforms:Or([ht.common,ht.envmap,ht.aomap,ht.lightmap,ht.emissivemap,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.roughnessmap,ht.metalnessmap,ht.fog,ht.lights,{emissive:{value:new rr(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ve.meshphysical_vert,fragmentShader:ve.meshphysical_frag},toon:{uniforms:Or([ht.common,ht.aomap,ht.lightmap,ht.emissivemap,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.gradientmap,ht.fog,ht.lights,{emissive:{value:new rr(0)}}]),vertexShader:ve.meshtoon_vert,fragmentShader:ve.meshtoon_frag},matcap:{uniforms:Or([ht.common,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.fog,{matcap:{value:null}}]),vertexShader:ve.meshmatcap_vert,fragmentShader:ve.meshmatcap_frag},points:{uniforms:Or([ht.points,ht.fog]),vertexShader:ve.points_vert,fragmentShader:ve.points_frag},dashed:{uniforms:Or([ht.common,ht.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ve.linedashed_vert,fragmentShader:ve.linedashed_frag},depth:{uniforms:Or([ht.common,ht.displacementmap]),vertexShader:ve.depth_vert,fragmentShader:ve.depth_frag},normal:{uniforms:Or([ht.common,ht.bumpmap,ht.normalmap,ht.displacementmap,{opacity:{value:1}}]),vertexShader:ve.meshnormal_vert,fragmentShader:ve.meshnormal_frag},sprite:{uniforms:Or([ht.sprite,ht.fog]),vertexShader:ve.sprite_vert,fragmentShader:ve.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:ve.background_vert,fragmentShader:ve.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Dt}},vertexShader:ve.backgroundCube_vert,fragmentShader:ve.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ve.cube_vert,fragmentShader:ve.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ve.equirect_vert,fragmentShader:ve.equirect_frag},distanceRGBA:{uniforms:Or([ht.common,ht.displacementmap,{referencePosition:{value:new Pe},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ve.distanceRGBA_vert,fragmentShader:ve.distanceRGBA_frag},shadow:{uniforms:Or([ht.lights,ht.fog,{color:{value:new rr(0)},opacity:{value:1}}]),vertexShader:ve.shadow_vert,fragmentShader:ve.shadow_frag}};qf.physical={uniforms:Or([qf.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Dt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Dt},clearcoatNormalScale:{value:new br(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Dt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Dt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Dt},sheen:{value:0},sheenColor:{value:new rr(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Dt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Dt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Dt},transmissionSamplerSize:{value:new br},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Dt},attenuationDistance:{value:0},attenuationColor:{value:new rr(0)},specularColor:{value:new rr(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Dt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Dt},anisotropyVector:{value:new br},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Dt}}]),vertexShader:ve.meshphysical_vert,fragmentShader:ve.meshphysical_frag};var Oo=(1+Math.sqrt(5))/2,cs=1/Oo,bS=[new Pe(-Oo,cs,0),new Pe(Oo,cs,0),new Pe(-cs,0,Oo),new Pe(cs,0,Oo),new Pe(0,Oo,-cs),new Pe(0,Oo,cs),new Pe(-1,1,-1),new Pe(1,1,-1),new Pe(-1,1,1),new Pe(1,1,1)];var AS=new Float32Array(16),TS=new Float32Array(9),CS=new Float32Array(4);var IS={[gf]:yf,[vf]:Mf,[xf]:wf,[_f]:Ef,[yf]:gf,[Mf]:vf,[wf]:xf,[Ef]:_f};function za(o,e,r){return!o||!r&&o.constructor===e?o:typeof e.BYTES_PER_ELEMENT=="number"?new e(o):Array.prototype.slice.call(o)}function L_(o){return ArrayBuffer.isView(o)&&!(o instanceof DataView)}var fs=class{constructor(e,r,a,u){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=u!==void 0?u:new r.constructor(a),this.sampleValues=r,this.valueSize=a,this.settings=null,this.DefaultSettings_={}}evaluate(e){let r=this.parameterPositions,a=this._cachedIndex,u=r[a],c=r[a-1];n:{t:{let h;e:{r:if(!(e<u)){for(let p=a+2;;){if(u===void 0){if(e<c)break r;return a=r.length,this._cachedIndex=a,this.copySampleValue_(a-1)}if(a===p)break;if(c=u,u=r[++a],e<u)break t}h=r.length;break e}if(!(e>=c)){let p=r[1];e<p&&(a=2,c=p);for(let d=a-2;;){if(c===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(a===d)break;if(u=c,c=r[--a-1],e>=c)break t}h=a,a=0;break e}break n}for(;a<h;){let p=a+h>>>1;e<r[p]?h=p:a=p+1}if(u=r[a],c=r[a-1],c===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(u===void 0)return a=r.length,this._cachedIndex=a,this.copySampleValue_(a-1)}this._cachedIndex=a,this.intervalChanged_(a,c,u)}return this.interpolate_(a,c,e,u)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let r=this.resultBuffer,a=this.sampleValues,u=this.valueSize,c=e*u;for(let h=0;h!==u;++h)r[h]=a[c+h];return r}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},bl=class extends fs{constructor(e,r,a,u){super(e,r,a,u),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Af,endingEnd:Af}}intervalChanged_(e,r,a){let u=this.parameterPositions,c=e-2,h=e+1,p=u[c],d=u[h];if(p===void 0)switch(this.getSettings_().endingStart){case Tf:c=e,p=2*r-a;break;case Cf:c=u.length-2,p=r+u[c]-u[c+1];break;default:c=e,p=a}if(d===void 0)switch(this.getSettings_().endingEnd){case Tf:h=e,d=2*a-r;break;case Cf:h=1,d=a+u[1]-u[0];break;default:h=e-1,d=r}let g=(a-r)*.5,v=this.valueSize;this._weightPrev=g/(r-p),this._weightNext=g/(d-a),this._offsetPrev=c*v,this._offsetNext=h*v}interpolate_(e,r,a,u){let c=this.resultBuffer,h=this.sampleValues,p=this.valueSize,d=e*p,g=d-p,v=this._offsetPrev,x=this._offsetNext,M=this._weightPrev,w=this._weightNext,I=(a-r)/(u-r),D=I*I,b=D*I,T=-M*b+2*M*D-M*I,L=(1+M)*b+(-1.5-2*M)*D+(-.5+M)*I+1,P=(-1-w)*b+(1.5+w)*D+.5*I,z=w*b-w*D;for(let k=0;k!==p;++k)c[k]=T*h[v+k]+L*h[g+k]+P*h[d+k]+z*h[x+k];return c}},Al=class extends fs{constructor(e,r,a,u){super(e,r,a,u)}interpolate_(e,r,a,u){let c=this.resultBuffer,h=this.sampleValues,p=this.valueSize,d=e*p,g=d-p,v=(a-r)/(u-r),x=1-v;for(let M=0;M!==p;++M)c[M]=h[g+M]*x+h[d+M]*v;return c}},Tl=class extends fs{constructor(e,r,a,u){super(e,r,a,u)}interpolate_(e){return this.copySampleValue_(e-1)}},wi=class{constructor(e,r,a,u){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(r===void 0||r.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=za(r,this.TimeBufferType),this.values=za(a,this.ValueBufferType),this.setInterpolation(u||this.DefaultInterpolation)}static toJSON(e){let r=e.constructor,a;if(r.toJSON!==this.toJSON)a=r.toJSON(e);else{a={name:e.name,times:za(e.times,Array),values:za(e.values,Array)};let u=e.getInterpolation();u!==e.DefaultInterpolation&&(a.interpolation=u)}return a.type=e.ValueTypeName,a}InterpolantFactoryMethodDiscrete(e){return new Tl(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Al(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new bl(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let r;switch(e){case ka:r=this.InterpolantFactoryMethodDiscrete;break;case xl:r=this.InterpolantFactoryMethodLinear;break;case fl:r=this.InterpolantFactoryMethodSmooth;break}if(r===void 0){let a="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(a);return console.warn("THREE.KeyframeTrack:",a),this}return this.createInterpolant=r,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return ka;case this.InterpolantFactoryMethodLinear:return xl;case this.InterpolantFactoryMethodSmooth:return fl}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){let r=this.times;for(let a=0,u=r.length;a!==u;++a)r[a]+=e}return this}scale(e){if(e!==1){let r=this.times;for(let a=0,u=r.length;a!==u;++a)r[a]*=e}return this}trim(e,r){let a=this.times,u=a.length,c=0,h=u-1;for(;c!==u&&a[c]<e;)++c;for(;h!==-1&&a[h]>r;)--h;if(++h,c!==0||h!==u){c>=h&&(h=Math.max(h,1),c=h-1);let p=this.getValueSize();this.times=a.slice(c,h),this.values=this.values.slice(c*p,h*p)}return this}validate(){let e=!0,r=this.getValueSize();r-Math.floor(r)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let a=this.times,u=this.values,c=a.length;c===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let h=null;for(let p=0;p!==c;p++){let d=a[p];if(typeof d=="number"&&isNaN(d)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,p,d),e=!1;break}if(h!==null&&h>d){console.error("THREE.KeyframeTrack: Out of order keys.",this,p,d,h),e=!1;break}h=d}if(u!==void 0&&L_(u))for(let p=0,d=u.length;p!==d;++p){let g=u[p];if(isNaN(g)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,p,g),e=!1;break}}return e}optimize(){let e=this.times.slice(),r=this.values.slice(),a=this.getValueSize(),u=this.getInterpolation()===fl,c=e.length-1,h=1;for(let p=1;p<c;++p){let d=!1,g=e[p],v=e[p+1];if(g!==v&&(p!==1||g!==e[0]))if(u)d=!0;else{let x=p*a,M=x-a,w=x+a;for(let I=0;I!==a;++I){let D=r[x+I];if(D!==r[M+I]||D!==r[w+I]){d=!0;break}}}if(d){if(p!==h){e[h]=e[p];let x=p*a,M=h*a;for(let w=0;w!==a;++w)r[M+w]=r[x+w]}++h}}if(c>0){e[h]=e[c];for(let p=c*a,d=h*a,g=0;g!==a;++g)r[d+g]=r[p+g];++h}return h!==e.length?(this.times=e.slice(0,h),this.values=r.slice(0,h*a)):(this.times=e,this.values=r),this}clone(){let e=this.times.slice(),r=this.values.slice(),a=this.constructor,u=new a(this.name,e,r);return u.createInterpolant=this.createInterpolant,u}};wi.prototype.TimeBufferType=Float32Array;wi.prototype.ValueBufferType=Float32Array;wi.prototype.DefaultInterpolation=xl;var Fo=class extends wi{constructor(e,r,a){super(e,r,a)}};Fo.prototype.ValueTypeName="bool";Fo.prototype.ValueBufferType=Array;Fo.prototype.DefaultInterpolation=ka;Fo.prototype.InterpolantFactoryMethodLinear=void 0;Fo.prototype.InterpolantFactoryMethodSmooth=void 0;var Cl=class extends wi{};Cl.prototype.ValueTypeName="color";var Il=class extends wi{};Il.prototype.ValueTypeName="number";var Pl=class extends fs{constructor(e,r,a,u){super(e,r,a,u)}interpolate_(e,r,a,u){let c=this.resultBuffer,h=this.sampleValues,p=this.valueSize,d=(a-r)/(u-r),g=e*p;for(let v=g+p;g!==v;g+=4)mo.slerpFlat(c,0,h,g-p,h,g,d);return c}},Ha=class extends wi{InterpolantFactoryMethodLinear(e){return new Pl(this.times,this.values,this.getValueSize(),e)}};Ha.prototype.ValueTypeName="quaternion";Ha.prototype.InterpolantFactoryMethodSmooth=void 0;var Uo=class extends wi{constructor(e,r,a){super(e,r,a)}};Uo.prototype.ValueTypeName="string";Uo.prototype.ValueBufferType=Array;Uo.prototype.DefaultInterpolation=ka;Uo.prototype.InterpolantFactoryMethodLinear=void 0;Uo.prototype.InterpolantFactoryMethodSmooth=void 0;var Rl=class extends wi{};Rl.prototype.ValueTypeName="vector";var Nl=class{constructor(e,r,a){let u=this,c=!1,h=0,p=0,d,g=[];this.onStart=void 0,this.onLoad=e,this.onProgress=r,this.onError=a,this.itemStart=function(v){p++,c===!1&&u.onStart!==void 0&&u.onStart(v,h,p),c=!0},this.itemEnd=function(v){h++,u.onProgress!==void 0&&u.onProgress(v,h,p),h===p&&(c=!1,u.onLoad!==void 0&&u.onLoad())},this.itemError=function(v){u.onError!==void 0&&u.onError(v)},this.resolveURL=function(v){return d?d(v):v},this.setURLModifier=function(v){return d=v,this},this.addHandler=function(v,x){return g.push(v,x),this},this.removeHandler=function(v){let x=g.indexOf(v);return x!==-1&&g.splice(x,2),this},this.getHandler=function(v){for(let x=0,M=g.length;x<M;x+=2){let w=g[x],I=g[x+1];if(w.global&&(w.lastIndex=0),w.test(v))return I}return null}}},D_=new Nl,Ll=class{constructor(e){this.manager=e!==void 0?e:D_,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,r){let a=this;return new Promise(function(u,c){a.load(e,u,r,c)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}};Ll.DEFAULT_MATERIAL_NAME="__DEFAULT";var Ul="\\\\[\\\\]\\\\.:\\\\/",O_=new RegExp("["+Ul+"]","g"),Bl="[^"+Ul+"]",F_="[^"+Ul.replace("\\\\.","")+"]",U_=/((?:WC+[\\/:])*)/.source.replace("WC",Bl),B_=/(WCOD+)?/.source.replace("WCOD",F_),z_=/(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace("WC",Bl),k_=/\\.(WC+)(?:\\[(.+)\\])?/.source.replace("WC",Bl),G_=new RegExp("^"+U_+B_+z_+k_+"$"),V_=["material","materials","bones","map"],Dl=class{constructor(e,r,a){let u=a||on.parseTrackName(r);this._targetGroup=e,this._bindings=e.subscribe_(r,u)}getValue(e,r){this.bind();let a=this._targetGroup.nCachedObjects_,u=this._bindings[a];u!==void 0&&u.getValue(e,r)}setValue(e,r){let a=this._bindings;for(let u=this._targetGroup.nCachedObjects_,c=a.length;u!==c;++u)a[u].setValue(e,r)}bind(){let e=this._bindings;for(let r=this._targetGroup.nCachedObjects_,a=e.length;r!==a;++r)e[r].bind()}unbind(){let e=this._bindings;for(let r=this._targetGroup.nCachedObjects_,a=e.length;r!==a;++r)e[r].unbind()}},on=class o{constructor(e,r,a){this.path=r,this.parsedPath=a||o.parseTrackName(r),this.node=o.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,r,a){return e&&e.isAnimationObjectGroup?new o.Composite(e,r,a):new o(e,r,a)}static sanitizeNodeName(e){return e.replace(/\\s/g,"_").replace(O_,"")}static parseTrackName(e){let r=G_.exec(e);if(r===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let a={nodeName:r[2],objectName:r[3],objectIndex:r[4],propertyName:r[5],propertyIndex:r[6]},u=a.nodeName&&a.nodeName.lastIndexOf(".");if(u!==void 0&&u!==-1){let c=a.nodeName.substring(u+1);V_.indexOf(c)!==-1&&(a.nodeName=a.nodeName.substring(0,u),a.objectName=c)}if(a.propertyName===null||a.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return a}static findNode(e,r){if(r===void 0||r===""||r==="."||r===-1||r===e.name||r===e.uuid)return e;if(e.skeleton){let a=e.skeleton.getBoneByName(r);if(a!==void 0)return a}if(e.children){let a=function(c){for(let h=0;h<c.length;h++){let p=c[h];if(p.name===r||p.uuid===r)return p;let d=a(p.children);if(d)return d}return null},u=a(e.children);if(u)return u}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,r){e[r]=this.targetObject[this.propertyName]}_getValue_array(e,r){let a=this.resolvedProperty;for(let u=0,c=a.length;u!==c;++u)e[r++]=a[u]}_getValue_arrayElement(e,r){e[r]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,r){this.resolvedProperty.toArray(e,r)}_setValue_direct(e,r){this.targetObject[this.propertyName]=e[r]}_setValue_direct_setNeedsUpdate(e,r){this.targetObject[this.propertyName]=e[r],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,r){this.targetObject[this.propertyName]=e[r],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,r){let a=this.resolvedProperty;for(let u=0,c=a.length;u!==c;++u)a[u]=e[r++]}_setValue_array_setNeedsUpdate(e,r){let a=this.resolvedProperty;for(let u=0,c=a.length;u!==c;++u)a[u]=e[r++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,r){let a=this.resolvedProperty;for(let u=0,c=a.length;u!==c;++u)a[u]=e[r++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,r){this.resolvedProperty[this.propertyIndex]=e[r]}_setValue_arrayElement_setNeedsUpdate(e,r){this.resolvedProperty[this.propertyIndex]=e[r],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,r){this.resolvedProperty[this.propertyIndex]=e[r],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,r){this.resolvedProperty.fromArray(e,r)}_setValue_fromArray_setNeedsUpdate(e,r){this.resolvedProperty.fromArray(e,r),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,r){this.resolvedProperty.fromArray(e,r),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,r){this.bind(),this.getValue(e,r)}_setValue_unbound(e,r){this.bind(),this.setValue(e,r)}bind(){let e=this.node,r=this.parsedPath,a=r.objectName,u=r.propertyName,c=r.propertyIndex;if(e||(e=o.findNode(this.rootNode,r.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(a){let g=r.objectIndex;switch(a){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let v=0;v<e.length;v++)if(e[v].name===g){g=v;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[a]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[a]}if(g!==void 0){if(e[g]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[g]}}let h=e[u];if(h===void 0){let g=r.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+g+"."+u+" but it wasn't found.",e);return}let p=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?p=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(p=this.Versioning.MatrixWorldNeedsUpdate);let d=this.BindingType.Direct;if(c!==void 0){if(u==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[c]!==void 0&&(c=e.morphTargetDictionary[c])}d=this.BindingType.ArrayElement,this.resolvedProperty=h,this.propertyIndex=c}else h.fromArray!==void 0&&h.toArray!==void 0?(d=this.BindingType.HasFromToArray,this.resolvedProperty=h):Array.isArray(h)?(d=this.BindingType.EntireArray,this.resolvedProperty=h):this.propertyName=u;this.getValue=this.GetterByBindingType[d],this.setValue=this.SetterByBindingTypeAndVersioning[d][p]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};on.Composite=Dl;on.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};on.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};on.prototype.GetterByBindingType=[on.prototype._getValue_direct,on.prototype._getValue_array,on.prototype._getValue_arrayElement,on.prototype._getValue_toArray];on.prototype.SetterByBindingTypeAndVersioning=[[on.prototype._setValue_direct,on.prototype._setValue_direct_setNeedsUpdate,on.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[on.prototype._setValue_array,on.prototype._setValue_array_setNeedsUpdate,on.prototype._setValue_array_setMatrixWorldNeedsUpdate],[on.prototype._setValue_arrayElement,on.prototype._setValue_arrayElement_setNeedsUpdate,on.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[on.prototype._setValue_fromArray,on.prototype._setValue_fromArray_setNeedsUpdate,on.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var PS=new Float32Array(1);typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Wf}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Wf);var Xn=63710088e-1,NS={centimeters:Xn*100,centimetres:Xn*100,degrees:Xn/111325,feet:Xn*3.28084,inches:Xn*39.37,kilometers:Xn/1e3,kilometres:Xn/1e3,meters:Xn,metres:Xn,miles:Xn/1609.344,millimeters:Xn*1e3,millimetres:Xn*1e3,nauticalmiles:Xn/1852,radians:1,yards:Xn*1.0936},LS={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/Xn,yards:1.0936133};function Ar(o,e,r){r===void 0&&(r={});var a={type:"Feature"};return(r.id===0||r.id)&&(a.id=r.id),r.bbox&&(a.bbox=r.bbox),a.properties=e||{},a.geometry=o,a}function He(o,e,r){if(r===void 0&&(r={}),!o)throw new Error("coordinates is required");if(!Array.isArray(o))throw new Error("coordinates must be an Array");if(o.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Li(o[0])||!Li(o[1]))throw new Error("coordinates must contain numbers");var a={type:"Point",coordinates:o};return Ar(a,e,r)}function sn(o,e,r){r===void 0&&(r={});for(var a=0,u=o;a<u.length;a++){var c=u[a];if(c.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var h=0;h<c[c.length-1].length;h++)if(c[c.length-1][h]!==c[0][h])throw new Error("First and last Position are not equivalent.")}var p={type:"Polygon",coordinates:o};return Ar(p,e,r)}function Yn(o,e,r){if(r===void 0&&(r={}),o.length<2)throw new Error("coordinates must be an array of two or more positions");var a={type:"LineString",coordinates:o};return Ar(a,e,r)}function zl(o,e,r){r===void 0&&(r={});var a={type:"MultiPoint",coordinates:o};return Ar(a,e,r)}function Li(o){return!isNaN(o)&&o!==null&&!Array.isArray(o)}function Nn(o,e,r){if(o!==null)for(var a,u,c,h,p,d,g,v=0,x=0,M,w=o.type,I=w==="FeatureCollection",D=w==="Feature",b=I?o.features.length:1,T=0;T<b;T++){g=I?o.features[T].geometry:D?o.geometry:o,M=g?g.type==="GeometryCollection":!1,p=M?g.geometries.length:1;for(var L=0;L<p;L++){var P=0,z=0;if(h=M?g.geometries[L]:g,h!==null){d=h.coordinates;var k=h.type;switch(v=r&&(k==="Polygon"||k==="MultiPolygon")?1:0,k){case null:break;case"Point":if(e(d,x,T,P,z)===!1)return!1;x++,P++;break;case"LineString":case"MultiPoint":for(a=0;a<d.length;a++){if(e(d[a],x,T,P,z)===!1)return!1;x++,k==="MultiPoint"&&P++}k==="LineString"&&P++;break;case"Polygon":case"MultiLineString":for(a=0;a<d.length;a++){for(u=0;u<d[a].length-v;u++){if(e(d[a][u],x,T,P,z)===!1)return!1;x++}k==="MultiLineString"&&P++,k==="Polygon"&&z++}k==="Polygon"&&P++;break;case"MultiPolygon":for(a=0;a<d.length;a++){for(z=0,u=0;u<d[a].length;u++){for(c=0;c<d[a][u].length-v;c++){if(e(d[a][u][c],x,T,P,z)===!1)return!1;x++}z++}P++}break;case"GeometryCollection":for(a=0;a<h.geometries.length;a++)if(Nn(h.geometries[a],e,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Jf(o,e,r,a){var u=r;return Nn(o,function(c,h,p,d,g){h===0&&r===void 0?u=c:u=e(u,c,h,p,d,g)},a),u}function go(o,e){var r,a,u,c,h,p,d,g,v,x,M=0,w=o.type==="FeatureCollection",I=o.type==="Feature",D=w?o.features.length:1;for(r=0;r<D;r++){for(p=w?o.features[r].geometry:I?o.geometry:o,g=w?o.features[r].properties:I?o.properties:{},v=w?o.features[r].bbox:I?o.bbox:void 0,x=w?o.features[r].id:I?o.id:void 0,d=p?p.type==="GeometryCollection":!1,h=d?p.geometries.length:1,u=0;u<h;u++){if(c=d?p.geometries[u]:p,c===null){if(e(null,M,g,v,x)===!1)return!1;continue}switch(c.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(c,M,g,v,x)===!1)return!1;break}case"GeometryCollection":{for(a=0;a<c.geometries.length;a++)if(e(c.geometries[a],M,g,v,x)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}M++}}function Xr(o,e){go(o,function(r,a,u,c,h){var p=r===null?null:r.type;switch(p){case null:case"Point":case"LineString":case"Polygon":return e(Ar(r,u,{bbox:c,id:h}),a,0)===!1?!1:void 0}var d;switch(p){case"MultiPoint":d="Point";break;case"MultiLineString":d="LineString";break;case"MultiPolygon":d="Polygon";break}for(var g=0;g<r.coordinates.length;g++){var v=r.coordinates[g],x={type:d,coordinates:v};if(e(Ar(x,u),a,g)===!1)return!1}})}function kl(o){var e=[1/0,1/0,-1/0,-1/0];return Nn(o,function(r){e[0]>r[0]&&(e[0]=r[0]),e[1]>r[1]&&(e[1]=r[1]),e[2]<r[0]&&(e[2]=r[0]),e[3]<r[1]&&(e[3]=r[1])}),e}kl.default=kl;var Tr=kl;function ir(o){if(!o)throw new Error("coord is required");if(!Array.isArray(o)){if(o.type==="Feature"&&o.geometry!==null&&o.geometry.type==="Point")return o.geometry.coordinates;if(o.type==="Point")return o.coordinates}if(Array.isArray(o)&&o.length>=2&&!Array.isArray(o[0])&&!Array.isArray(o[1]))return o;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Gl(o,e,r){if(!o)throw new Error("No feature passed");if(!r)throw new Error(".featureOf() requires a name");if(!o||o.type!=="Feature"||!o.geometry)throw new Error("Invalid input to "+r+", Feature with geometry required");if(!o.geometry||o.geometry.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+o.geometry.type)}function or(o){return o.type==="Feature"?o.geometry:o}var J_=ln(qa(),1);var s1=ln(dp(),1);function $n(o,e,r){if(r===void 0&&(r={}),!o)throw new Error("point is required");if(!e)throw new Error("polygon is required");var a=ir(o),u=or(e),c=u.type,h=e.bbox,p=u.coordinates;if(h&&a1(a,h)===!1)return!1;c==="Polygon"&&(p=[p]);for(var d=!1,g=0;g<p.length&&!d;g++)if(mp(a,p[g][0],r.ignoreBoundary)){for(var v=!1,x=1;x<p[g].length&&!v;)mp(a,p[g][x],!r.ignoreBoundary)&&(v=!0),x++;v||(d=!0)}return d}function mp(o,e,r){var a=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var u=0,c=e.length-1;u<e.length;c=u++){var h=e[u][0],p=e[u][1],d=e[c][0],g=e[c][1],v=o[1]*(h-d)+p*(d-o[0])+g*(o[0]-h)===0&&(h-o[0])*(d-o[0])<=0&&(p-o[1])*(g-o[1])<=0;if(v)return!r;var x=p>o[1]!=g>o[1]&&o[0]<(d-h)*(o[1]-p)/(g-p)+h;x&&(a=!a)}return a}function a1(o,e){return e[0]<=o[0]&&e[1]<=o[1]&&e[2]>=o[0]&&e[3]>=o[1]}var vp=new ArrayBuffer(16),uA=new Float64Array(vp),lA=new Uint32Array(vp);var M1=ln(rc(),1);var OT=function(){function o(e){this.points=e.points||[],this.duration=e.duration||1e4,this.sharpness=e.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=e.stepLength||60,this.length=this.points.length,this.delay=0;for(var r=0;r<this.length;r++)this.points[r].z=this.points[r].z||0;for(var r=0;r<this.length-1;r++){var a=this.points[r],u=this.points[r+1];this.centers.push({x:(a.x+u.x)/2,y:(a.y+u.y)/2,z:(a.z+u.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var r=0;r<this.centers.length-1;r++){var c=this.points[r+1].x-(this.centers[r].x+this.centers[r+1].x)/2,h=this.points[r+1].y-(this.centers[r].y+this.centers[r+1].y)/2,p=this.points[r+1].z-(this.centers[r].y+this.centers[r+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[r+1].x+this.sharpness*(this.centers[r].x+c),y:(1-this.sharpness)*this.points[r+1].y+this.sharpness*(this.centers[r].y+h),z:(1-this.sharpness)*this.points[r+1].z+this.sharpness*(this.centers[r].z+p)},{x:(1-this.sharpness)*this.points[r+1].x+this.sharpness*(this.centers[r+1].x+c),y:(1-this.sharpness)*this.points[r+1].y+this.sharpness*(this.centers[r+1].y+h),z:(1-this.sharpness)*this.points[r+1].z+this.sharpness*(this.centers[r+1].z+p)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}return o.prototype.cacheSteps=function(e){var r=[],a=this.pos(0);r.push(0);for(var u=0;u<this.duration;u+=10){var c=this.pos(u),h=Math.sqrt((c.x-a.x)*(c.x-a.x)+(c.y-a.y)*(c.y-a.y)+(c.z-a.z)*(c.z-a.z));h>e&&(r.push(u),a=c)}return r},o.prototype.vector=function(e){var r=this.pos(e+10),a=this.pos(e-10);return{angle:180*Math.atan2(r.y-a.y,r.x-a.x)/3.14,speed:Math.sqrt((a.x-r.x)*(a.x-r.x)+(a.y-r.y)*(a.y-r.y)+(a.z-r.z)*(a.z-r.z))}},o.prototype.pos=function(e){var r=e-this.delay;r<0&&(r=0),r>this.duration&&(r=this.duration-1);var a=r/this.duration;if(a>=1)return this.points[this.length-1];var u=Math.floor((this.points.length-1)*a),c=(this.length-1)*a-u;return w1(c,this.points[u],this.controls[u][1],this.controls[u+1][0],this.points[u+1])},o}();function w1(o,e,r,a,u){var c=S1(o),h={x:u.x*c[0]+a.x*c[1]+r.x*c[2]+e.x*c[3],y:u.y*c[0]+a.y*c[1]+r.y*c[2]+e.y*c[3],z:u.z*c[0]+a.z*c[1]+r.z*c[2]+e.z*c[3]};return h}function S1(o){var e=o*o,r=e*o;return[r,3*e*(1-o),3*o*(1-o)*(1-o),(1-o)*(1-o)*(1-o)]}function oa(o,e){e===void 0&&(e={});var r=Number(o[0]),a=Number(o[1]),u=Number(o[2]),c=Number(o[3]);if(o.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var h=[r,a],p=[r,c],d=[u,c],g=[u,a];return sn([[h,g,d,p,h]],e.properties,{bbox:o,id:e.id})}function b1(o){return oa(Tr(o))}var ic=b1;var V1=ln(Ip(),1);var mx=ln(au(),1);var yx=ln(qa(),1);var xx=ln(rc(),1);var Yp=Math.PI/180,$p=180/Math.PI,fa=function(o,e){this.lon=o,this.lat=e,this.x=Yp*o,this.y=Yp*e};fa.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)};fa.prototype.antipode=function(){var o=-1*this.lat,e=this.lon<0?180+this.lon:(180-this.lon)*-1;return new fa(e,o)};var Zp=function(){this.coords=[],this.length=0};Zp.prototype.move_to=function(o){this.length++,this.coords.push(o)};var Sc=function(o){this.properties=o||{},this.geometries=[]};Sc.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 o=[],e=0;e<this.geometries.length;e++)o.push(this.geometries[e].coords);return{geometry:{type:"MultiLineString",coordinates:o},type:"Feature",properties:this.properties}};Sc.prototype.wkt=function(){for(var o="",e="LINESTRING(",r=function(c){e+=c[0]+" "+c[1]+","},a=0;a<this.geometries.length;a++){if(this.geometries[a].coords.length===0)return"LINESTRING(empty)";var u=this.geometries[a].coords;u.forEach(r),o+=e.substring(0,e.length-1)+")"}return o};var Jp=function(o,e,r){if(!o||o.x===void 0||o.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!e||e.x===void 0||e.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new fa(o.x,o.y),this.end=new fa(e.x,e.y),this.properties=r||{};var a=this.start.x-this.end.x,u=this.start.y-this.end.y,c=Math.pow(Math.sin(u/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(a/2),2);if(this.g=2*Math.asin(Math.sqrt(c)),this.g===Math.PI)throw new Error("it appears "+o.view()+" and "+e.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 "+o+" and "+e)};Jp.prototype.interpolate=function(o){var e=Math.sin((1-o)*this.g)/Math.sin(this.g),r=Math.sin(o*this.g)/Math.sin(this.g),a=e*Math.cos(this.start.y)*Math.cos(this.start.x)+r*Math.cos(this.end.y)*Math.cos(this.end.x),u=e*Math.cos(this.start.y)*Math.sin(this.start.x)+r*Math.cos(this.end.y)*Math.sin(this.end.x),c=e*Math.sin(this.start.y)+r*Math.sin(this.end.y),h=$p*Math.atan2(c,Math.sqrt(Math.pow(a,2)+Math.pow(u,2))),p=$p*Math.atan2(u,a);return[p,h]};Jp.prototype.Arc=function(o,e){var r=[];if(!o||o<=2)r.push([this.start.lon,this.start.lat]),r.push([this.end.lon,this.end.lat]);else for(var a=1/(o-1),u=0;u<o;++u){var c=a*u,h=this.interpolate(c);r.push(h)}for(var p=!1,d=0,g=e&&e.offset?e.offset:10,v=180-g,x=-180+g,M=360-g,w=1;w<r.length;++w){var I=r[w-1][0],D=r[w][0],b=Math.abs(D-I);b>M&&(D>v&&I<x||I>v&&D<x)?p=!0:b>d&&(d=b)}var T=[];if(p&&d<g){var L=[];T.push(L);for(var P=0;P<r.length;++P){var z=parseFloat(r[P][0]);if(P>0&&Math.abs(z-r[P-1][0])>M){var k=parseFloat(r[P-1][0]),Y=parseFloat(r[P-1][1]),q=parseFloat(r[P][0]),C=parseFloat(r[P][1]);if(k>-180&&k<x&&q===180&&P+1<r.length&&r[P-1][0]>-180&&r[P-1][0]<x){L.push([-180,r[P][1]]),P++,L.push([r[P][0],r[P][1]]);continue}else if(k>v&&k<180&&q===-180&&P+1<r.length&&r[P-1][0]>v&&r[P-1][0]<180){L.push([180,r[P][1]]),P++,L.push([r[P][0],r[P][1]]);continue}if(k<x&&q>v){var ot=k;k=q,q=ot;var pt=Y;Y=C,C=pt}if(k>v&&q<x&&(q+=360),k<=180&&q>=180&&k<q){var dt=(180-k)/(q-k),F=dt*C+(1-dt)*Y;L.push([r[P-1][0]>v?180:-180,F]),L=[],L.push([r[P-1][0]>v?-180:180,F]),T.push(L)}else L=[],T.push(L);L.push([z,r[P][1]])}else L.push([r[P][0],r[P][1]])}}else{var ye=[];T.push(ye);for(var et=0;et<r.length;++et)ye.push([r[et][0],r[et][1]])}for(var St=new Sc(this.properties),Pt=0;Pt<T.length;++Pt){var Rt=new Zp;St.geometries.push(Rt);for(var it=T[Pt],mt=0;mt<it.length;++mt)Rt.move_to(it[mt])}return St};var wx=ln(au(),1);var nM=ln(au(),1);var rM=ln(Xc(),1);var sM=ln(qa(),1);var Ot=[],Ft=[],Ut=[],Bt=[],zt=[],kt=[],Gt=[],Vt=[],Ht=[],qt=[],Wt=[],Xt=[],Yt=[],$t=[],Zt=[],Jt=[],Kt=[],Qt=[],jt=[],te=[],ee=[],ne=[],re=[],ie=[];Gt[85]=qt[85]=-1;Vt[85]=Wt[85]=0;Ht[85]=Xt[85]=1;jt[85]=ne[85]=1;te[85]=re[85]=0;ee[85]=ie[85]=1;Ot[85]=Bt[85]=0;Ft[85]=zt[85]=-1;Ut[85]=Zt[85]=0;Jt[85]=Yt[85]=0;Kt[85]=$t[85]=1;kt[85]=Qt[85]=1;ne[1]=ne[169]=0;re[1]=re[169]=-1;ie[1]=ie[169]=0;Yt[1]=Yt[169]=-1;$t[1]=$t[169]=0;Zt[1]=Zt[169]=0;qt[4]=qt[166]=0;Wt[4]=Wt[166]=-1;Xt[4]=Xt[166]=1;Jt[4]=Jt[166]=1;Kt[4]=Kt[166]=0;Qt[4]=Qt[166]=0;Gt[16]=Gt[154]=0;Vt[16]=Vt[154]=1;Ht[16]=Ht[154]=1;Bt[16]=Bt[154]=1;zt[16]=zt[154]=0;kt[16]=kt[154]=1;jt[64]=jt[106]=0;te[64]=te[106]=1;ee[64]=ee[106]=0;Ot[64]=Ot[106]=-1;Ft[64]=Ft[106]=0;Ut[64]=Ut[106]=1;jt[2]=jt[168]=0;te[2]=te[168]=-1;ee[2]=ee[168]=1;ne[2]=ne[168]=0;re[2]=re[168]=-1;ie[2]=ie[168]=0;Yt[2]=Yt[168]=-1;$t[2]=$t[168]=0;Zt[2]=Zt[168]=0;Jt[2]=Jt[168]=-1;Kt[2]=Kt[168]=0;Qt[2]=Qt[168]=1;Gt[8]=Gt[162]=0;Vt[8]=Vt[162]=-1;Ht[8]=Ht[162]=0;qt[8]=qt[162]=0;Wt[8]=Wt[162]=-1;Xt[8]=Xt[162]=1;Yt[8]=Yt[162]=1;$t[8]=$t[162]=0;Zt[8]=Zt[162]=1;Jt[8]=Jt[162]=1;Kt[8]=Kt[162]=0;Qt[8]=Qt[162]=0;Gt[32]=Gt[138]=0;Vt[32]=Vt[138]=1;Ht[32]=Ht[138]=1;qt[32]=qt[138]=0;Wt[32]=Wt[138]=1;Xt[32]=Xt[138]=0;Ot[32]=Ot[138]=1;Ft[32]=Ft[138]=0;Ut[32]=Ut[138]=0;Bt[32]=Bt[138]=1;zt[32]=zt[138]=0;kt[32]=kt[138]=1;ne[128]=ne[42]=0;re[128]=re[42]=1;ie[128]=ie[42]=1;jt[128]=jt[42]=0;te[128]=te[42]=1;ee[128]=ee[42]=0;Ot[128]=Ot[42]=-1;Ft[128]=Ft[42]=0;Ut[128]=Ut[42]=1;Bt[128]=Bt[42]=-1;zt[128]=zt[42]=0;kt[128]=kt[42]=0;qt[5]=qt[165]=-1;Wt[5]=Wt[165]=0;Xt[5]=Xt[165]=0;ne[5]=ne[165]=1;re[5]=re[165]=0;ie[5]=ie[165]=0;Jt[20]=Jt[150]=0;Kt[20]=Kt[150]=1;Qt[20]=Qt[150]=1;Bt[20]=Bt[150]=0;zt[20]=zt[150]=-1;kt[20]=kt[150]=1;Gt[80]=Gt[90]=-1;Vt[80]=Vt[90]=0;Ht[80]=Ht[90]=1;jt[80]=jt[90]=1;te[80]=te[90]=0;ee[80]=ee[90]=1;Yt[65]=Yt[105]=0;$t[65]=$t[105]=1;Zt[65]=Zt[105]=0;Ot[65]=Ot[105]=0;Ft[65]=Ft[105]=-1;Ut[65]=Ut[105]=0;Gt[160]=Gt[10]=-1;Vt[160]=Vt[10]=0;Ht[160]=Ht[10]=1;qt[160]=qt[10]=-1;Wt[160]=Wt[10]=0;Xt[160]=Xt[10]=0;ne[160]=ne[10]=1;re[160]=re[10]=0;ie[160]=ie[10]=0;jt[160]=jt[10]=1;te[160]=te[10]=0;ee[160]=ee[10]=1;Jt[130]=Jt[40]=0;Kt[130]=Kt[40]=1;Qt[130]=Qt[40]=1;Yt[130]=Yt[40]=0;$t[130]=$t[40]=1;Zt[130]=Zt[40]=0;Ot[130]=Ot[40]=0;Ft[130]=Ft[40]=-1;Ut[130]=Ut[40]=0;Bt[130]=Bt[40]=0;zt[130]=zt[40]=-1;kt[130]=kt[40]=1;qt[37]=qt[133]=0;Wt[37]=Wt[133]=1;Xt[37]=Xt[133]=1;ne[37]=ne[133]=0;re[37]=re[133]=1;ie[37]=ie[133]=0;Ot[37]=Ot[133]=-1;Ft[37]=Ft[133]=0;Ut[37]=Ut[133]=0;Bt[37]=Bt[133]=1;zt[37]=zt[133]=0;kt[37]=kt[133]=0;Jt[148]=Jt[22]=-1;Kt[148]=Kt[22]=0;Qt[148]=Qt[22]=0;ne[148]=ne[22]=0;re[148]=re[22]=-1;ie[148]=ie[22]=1;jt[148]=jt[22]=0;te[148]=te[22]=1;ee[148]=ee[22]=1;Bt[148]=Bt[22]=-1;zt[148]=zt[22]=0;kt[148]=kt[22]=1;Gt[82]=Gt[88]=0;Vt[82]=Vt[88]=-1;Ht[82]=Ht[88]=1;Jt[82]=Jt[88]=1;Kt[82]=Kt[88]=0;Qt[82]=Qt[88]=1;Yt[82]=Yt[88]=-1;$t[82]=$t[88]=0;Zt[82]=Zt[88]=1;jt[82]=jt[88]=0;te[82]=te[88]=-1;ee[82]=ee[88]=0;Gt[73]=Gt[97]=0;Vt[73]=Vt[97]=1;Ht[73]=Ht[97]=0;qt[73]=qt[97]=0;Wt[73]=Wt[97]=-1;Xt[73]=Xt[97]=0;Yt[73]=Yt[97]=1;$t[73]=$t[97]=0;Zt[73]=Zt[97]=0;Ot[73]=Ot[97]=1;Ft[73]=Ft[97]=0;Ut[73]=Ut[97]=1;Gt[145]=Gt[25]=0;Vt[145]=Vt[25]=-1;Ht[145]=Ht[25]=0;Yt[145]=Yt[25]=1;$t[145]=$t[25]=0;Zt[145]=Zt[25]=1;ne[145]=ne[25]=0;re[145]=re[25]=1;ie[145]=ie[25]=1;Bt[145]=Bt[25]=-1;zt[145]=zt[25]=0;kt[145]=kt[25]=0;qt[70]=qt[100]=0;Wt[70]=Wt[100]=1;Xt[70]=Xt[100]=0;Jt[70]=Jt[100]=-1;Kt[70]=Kt[100]=0;Qt[70]=Qt[100]=1;jt[70]=jt[100]=0;te[70]=te[100]=-1;ee[70]=ee[100]=1;Ot[70]=Ot[100]=1;Ft[70]=Ft[100]=0;Ut[70]=Ut[100]=0;qt[101]=qt[69]=0;Wt[101]=Wt[69]=1;Xt[101]=Xt[69]=0;Ot[101]=Ot[69]=1;Ft[101]=Ft[69]=0;Ut[101]=Ut[69]=0;ne[149]=ne[21]=0;re[149]=re[21]=1;ie[149]=ie[21]=1;Bt[149]=Bt[21]=-1;zt[149]=zt[21]=0;kt[149]=kt[21]=0;Jt[86]=Jt[84]=-1;Kt[86]=Kt[84]=0;Qt[86]=Qt[84]=1;jt[86]=jt[84]=0;te[86]=te[84]=-1;ee[86]=ee[84]=1;Gt[89]=Gt[81]=0;Vt[89]=Vt[81]=-1;Ht[89]=Ht[81]=0;Yt[89]=Yt[81]=1;$t[89]=$t[81]=0;Zt[89]=Zt[81]=1;Gt[96]=Gt[74]=0;Vt[96]=Vt[74]=1;Ht[96]=Ht[74]=0;qt[96]=qt[74]=-1;Wt[96]=Wt[74]=0;Xt[96]=Xt[74]=1;jt[96]=jt[74]=1;te[96]=te[74]=0;ee[96]=ee[74]=0;Ot[96]=Ot[74]=1;Ft[96]=Ft[74]=0;Ut[96]=Ut[74]=1;Gt[24]=Gt[146]=0;Vt[24]=Vt[146]=-1;Ht[24]=Ht[146]=1;Jt[24]=Jt[146]=1;Kt[24]=Kt[146]=0;Qt[24]=Qt[146]=1;Yt[24]=Yt[146]=0;$t[24]=$t[146]=1;Zt[24]=Zt[146]=1;Bt[24]=Bt[146]=0;zt[24]=zt[146]=-1;kt[24]=kt[146]=0;qt[6]=qt[164]=-1;Wt[6]=Wt[164]=0;Xt[6]=Xt[164]=1;Jt[6]=Jt[164]=-1;Kt[6]=Kt[164]=0;Qt[6]=Qt[164]=0;ne[6]=ne[164]=0;re[6]=re[164]=-1;ie[6]=ie[164]=1;jt[6]=jt[164]=1;te[6]=te[164]=0;ee[6]=ee[164]=0;Yt[129]=Yt[41]=0;$t[129]=$t[41]=1;Zt[129]=Zt[41]=1;ne[129]=ne[41]=0;re[129]=re[41]=1;ie[129]=ie[41]=0;Ot[129]=Ot[41]=-1;Ft[129]=Ft[41]=0;Ut[129]=Ut[41]=0;Bt[129]=Bt[41]=0;zt[129]=zt[41]=-1;kt[129]=kt[41]=0;Jt[66]=Jt[104]=0;Kt[66]=Kt[104]=1;Qt[66]=Qt[104]=0;Yt[66]=Yt[104]=-1;$t[66]=$t[104]=0;Zt[66]=Zt[104]=1;jt[66]=jt[104]=0;te[66]=te[104]=-1;ee[66]=ee[104]=0;Ot[66]=Ot[104]=0;Ft[66]=Ft[104]=-1;Ut[66]=Ut[104]=1;Gt[144]=Gt[26]=-1;Vt[144]=Vt[26]=0;Ht[144]=Ht[26]=0;ne[144]=ne[26]=1;re[144]=re[26]=0;ie[144]=ie[26]=1;jt[144]=jt[26]=0;te[144]=te[26]=1;ee[144]=ee[26]=1;Bt[144]=Bt[26]=-1;zt[144]=zt[26]=0;kt[144]=kt[26]=1;qt[36]=qt[134]=0;Wt[36]=Wt[134]=1;Xt[36]=Xt[134]=1;Jt[36]=Jt[134]=0;Kt[36]=Kt[134]=1;Qt[36]=Qt[134]=0;Ot[36]=Ot[134]=0;Ft[36]=Ft[134]=-1;Ut[36]=Ut[134]=1;Bt[36]=Bt[134]=1;zt[36]=zt[134]=0;kt[36]=kt[134]=0;Gt[9]=Gt[161]=-1;Vt[9]=Vt[161]=0;Ht[9]=Ht[161]=0;qt[9]=qt[161]=0;Wt[9]=Wt[161]=-1;Xt[9]=Xt[161]=0;Yt[9]=Yt[161]=1;$t[9]=$t[161]=0;Zt[9]=Zt[161]=0;ne[9]=ne[161]=1;re[9]=re[161]=0;ie[9]=ie[161]=1;Gt[136]=0;Vt[136]=1;Ht[136]=1;qt[136]=0;Wt[136]=1;Xt[136]=0;Jt[136]=-1;Kt[136]=0;Qt[136]=1;Yt[136]=-1;$t[136]=0;Zt[136]=0;ne[136]=0;re[136]=-1;ie[136]=0;jt[136]=0;te[136]=-1;ee[136]=1;Ot[136]=1;Ft[136]=0;Ut[136]=0;Bt[136]=1;zt[136]=0;kt[136]=1;Gt[34]=0;Vt[34]=-1;Ht[34]=0;qt[34]=0;Wt[34]=-1;Xt[34]=1;Jt[34]=1;Kt[34]=0;Qt[34]=0;Yt[34]=1;$t[34]=0;Zt[34]=1;ne[34]=0;re[34]=1;ie[34]=1;jt[34]=0;te[34]=1;ee[34]=0;Ot[34]=-1;Ft[34]=0;Ut[34]=1;Bt[34]=-1;zt[34]=0;kt[34]=0;Gt[35]=0;Vt[35]=1;Ht[35]=1;qt[35]=0;Wt[35]=-1;Xt[35]=1;Jt[35]=1;Kt[35]=0;Qt[35]=0;Yt[35]=-1;$t[35]=0;Zt[35]=0;ne[35]=0;re[35]=-1;ie[35]=0;jt[35]=0;te[35]=1;ee[35]=0;Ot[35]=-1;Ft[35]=0;Ut[35]=1;Bt[35]=1;zt[35]=0;kt[35]=1;Gt[153]=0;Vt[153]=1;Ht[153]=1;Yt[153]=-1;$t[153]=0;Zt[153]=0;ne[153]=0;re[153]=-1;ie[153]=0;Bt[153]=1;zt[153]=0;kt[153]=1;qt[102]=0;Wt[102]=-1;Xt[102]=1;Jt[102]=1;Kt[102]=0;Qt[102]=0;jt[102]=0;te[102]=1;ee[102]=0;Ot[102]=-1;Ft[102]=0;Ut[102]=1;Gt[155]=0;Vt[155]=-1;Ht[155]=0;Yt[155]=1;$t[155]=0;Zt[155]=1;ne[155]=0;re[155]=1;ie[155]=1;Bt[155]=-1;zt[155]=0;kt[155]=0;qt[103]=0;Wt[103]=1;Xt[103]=0;Jt[103]=-1;Kt[103]=0;Qt[103]=1;jt[103]=0;te[103]=-1;ee[103]=1;Ot[103]=1;Ft[103]=0;Ut[103]=0;Gt[152]=0;Vt[152]=1;Ht[152]=1;Jt[152]=-1;Kt[152]=0;Qt[152]=1;Yt[152]=-1;$t[152]=0;Zt[152]=0;ne[152]=0;re[152]=-1;ie[152]=0;jt[152]=0;te[152]=-1;ee[152]=1;Bt[152]=1;zt[152]=0;kt[152]=1;Gt[156]=0;Vt[156]=-1;Ht[156]=1;Jt[156]=1;Kt[156]=0;Qt[156]=1;Yt[156]=-1;$t[156]=0;Zt[156]=0;ne[156]=0;re[156]=-1;ie[156]=0;jt[156]=0;te[156]=1;ee[156]=1;Bt[156]=-1;zt[156]=0;kt[156]=1;Gt[137]=0;Vt[137]=1;Ht[137]=1;qt[137]=0;Wt[137]=1;Xt[137]=0;Yt[137]=-1;$t[137]=0;Zt[137]=0;ne[137]=0;re[137]=-1;ie[137]=0;Ot[137]=1;Ft[137]=0;Ut[137]=0;Bt[137]=1;zt[137]=0;kt[137]=1;Gt[139]=0;Vt[139]=1;Ht[139]=1;qt[139]=0;Wt[139]=-1;Xt[139]=0;Yt[139]=1;$t[139]=0;Zt[139]=0;ne[139]=0;re[139]=1;ie[139]=0;Ot[139]=-1;Ft[139]=0;Ut[139]=0;Bt[139]=1;zt[139]=0;kt[139]=1;Gt[98]=0;Vt[98]=-1;Ht[98]=0;qt[98]=0;Wt[98]=-1;Xt[98]=1;Jt[98]=1;Kt[98]=0;Qt[98]=0;Yt[98]=1;$t[98]=0;Zt[98]=1;jt[98]=0;te[98]=1;ee[98]=0;Ot[98]=-1;Ft[98]=0;Ut[98]=1;Gt[99]=0;Vt[99]=1;Ht[99]=0;qt[99]=0;Wt[99]=-1;Xt[99]=1;Jt[99]=1;Kt[99]=0;Qt[99]=0;Yt[99]=-1;$t[99]=0;Zt[99]=1;jt[99]=0;te[99]=-1;ee[99]=0;Ot[99]=1;Ft[99]=0;Ut[99]=1;qt[38]=0;Wt[38]=-1;Xt[38]=1;Jt[38]=1;Kt[38]=0;Qt[38]=0;ne[38]=0;re[38]=1;ie[38]=1;jt[38]=0;te[38]=1;ee[38]=0;Ot[38]=-1;Ft[38]=0;Ut[38]=1;Bt[38]=-1;zt[38]=0;kt[38]=0;qt[39]=0;Wt[39]=1;Xt[39]=1;Jt[39]=-1;Kt[39]=0;Qt[39]=0;ne[39]=0;re[39]=-1;ie[39]=1;jt[39]=0;te[39]=1;ee[39]=0;Ot[39]=-1;Ft[39]=0;Ut[39]=1;Bt[39]=1;zt[39]=0;kt[39]=0;var Yc=function(o){return[[o.bottomleft,0],[0,0],[0,o.leftbottom]]},$c=function(o){return[[1,o.rightbottom],[1,0],[o.bottomright,0]]},Zc=function(o){return[[o.topright,1],[1,1],[1,o.righttop]]},Jc=function(o){return[[0,o.lefttop],[0,1],[o.topleft,1]]},Kc=function(o){return[[o.bottomright,0],[o.bottomleft,0],[0,o.leftbottom],[0,o.lefttop]]},Qc=function(o){return[[o.bottomright,0],[o.bottomleft,0],[1,o.righttop],[1,o.rightbottom]]},jc=function(o){return[[1,o.righttop],[1,o.rightbottom],[o.topleft,1],[o.topright,1]]},th=function(o){return[[0,o.leftbottom],[0,o.lefttop],[o.topleft,1],[o.topright,1]]},aM=function(o){return[[0,0],[0,o.leftbottom],[1,o.rightbottom],[1,0]]},uM=function(o){return[[1,0],[o.bottomright,0],[o.topright,1],[1,1]]},lM=function(o){return[[1,1],[1,o.righttop],[0,o.lefttop],[0,1]]},cM=function(o){return[[o.bottomleft,0],[0,0],[0,1],[o.topleft,1]]},hM=function(o){return[[1,o.righttop],[1,o.rightbottom],[0,o.leftbottom],[0,o.lefttop]]},fM=function(o){return[[o.topleft,1],[o.topright,1],[o.bottomright,0],[o.bottomleft,0]]},pM=function(){return[[0,0],[0,1],[1,1],[1,0]]},dM=function(o){return[[1,o.rightbottom],[1,0],[0,0],[0,1],[o.topleft,1]]},mM=function(o){return[[o.topright,1],[1,1],[1,0],[0,0],[0,o.leftbottom]]},gM=function(o){return[[1,0],[o.bottomright,0],[0,o.lefttop],[0,1],[1,1]]},yM=function(o){return[[1,1],[1,o.righttop],[o.bottomleft,0],[0,0],[0,1]]},vM=function(o){return[[1,o.righttop],[1,o.rightbottom],[0,o.lefttop],[0,1],[o.topleft,1]]},_M=function(o){return[[1,1],[1,o.righttop],[o.bottomright,0],[o.bottomleft,0],[o.topright,1]]},xM=function(o){return[[1,o.rightbottom],[1,0],[o.bottomright,0],[0,o.leftbottom],[0,o.lefttop]]},EM=function(o){return[[o.topright,1],[o.bottomleft,0],[0,0],[0,o.leftbottom],[o.topleft,1]]},MM=function(o){return[[o.bottomright,0],[o.bottomleft,0],[0,o.lefttop],[0,1],[o.topleft,1]]},wM=function(o){return[[1,1],[1,o.righttop],[0,o.leftbottom],[0,o.lefttop],[o.topright,1]]},SM=function(o){return[[1,o.rightbottom],[1,0],[o.bottomright,0],[o.topleft,1],[o.topright,1]]},bM=function(o){return[[1,o.righttop],[1,o.rightbottom],[o.bottomleft,0],[0,0],[0,o.leftbottom]]},AM=function(o){return[[1,o.rightbottom],[1,0],[0,0],[0,o.leftbottom],[o.topleft,1],[o.topright,1]]},TM=function(o){return[[1,1],[1,0],[o.bottomright,0],[0,o.leftbottom],[0,o.lefttop],[o.topright,1]]},CM=function(o){return[[1,1],[1,o.righttop],[o.bottomright,0],[o.bottomleft,0],[0,o.lefttop],[0,1]]},IM=function(o){return[[1,o.righttop],[1,o.rightbottom],[o.bottomleft,0],[0,0],[0,1],[o.topleft,1]]},PM=function(o){return[[1,1],[1,o.righttop],[o.bottomleft,0],[0,0],[0,o.leftbottom],[o.topright,1]]},RM=function(o){return[[1,o.rightbottom],[1,0],[o.bottomright,0],[0,o.lefttop],[0,1],[o.topleft,1]]},NM=function(o){return[[1,o.righttop],[1,o.rightbottom],[o.bottomright,0],[o.bottomleft,0],[0,o.leftbottom],[0,o.lefttop],[o.topleft,1],[o.topright,1]]},LM=function(o){return[[1,1],[1,o.righttop],[o.bottomleft,0],[0,0],[0,o.leftbottom],[o.topright,1]]},DM=function(o){return[[1,o.rightbottom],[1,0],[o.bottomright,0],[0,o.lefttop],[0,1],[o.topleft,1]]},OM=function(o){return[[1,1],[1,o.righttop],[o.bottomright,0],[o.bottomleft,0],[0,o.leftbottom],[0,o.lefttop],[o.topright,1]]},FM=function(o){return[[1,o.righttop],[1,o.rightbottom],[o.bottomleft,0],[0,0],[0,o.leftbottom],[o.topleft,1],[o.topright,1]]},UM=function(o){return[[1,o.righttop],[1,o.rightbottom],[o.bottomright,0],[o.bottomleft,0],[0,o.lefttop],[0,1],[o.topleft,1]]},BM=function(o){return[[1,o.rightbottom],[1,0],[o.bottomright,0],[0,o.leftbottom],[0,o.lefttop],[o.topleft,1],[o.topright,1]]},le=[],ce=[],he=[],fe=[],pe=[],de=[],me=[],ge=[];fe[1]=pe[1]=18;fe[169]=pe[169]=18;he[4]=ce[4]=12;he[166]=ce[166]=12;le[16]=ge[16]=4;le[154]=ge[154]=4;de[64]=me[64]=22;de[106]=me[106]=22;he[2]=de[2]=17;fe[2]=pe[2]=18;he[168]=de[168]=17;fe[168]=pe[168]=18;le[8]=fe[8]=9;ce[8]=he[8]=12;le[162]=fe[162]=9;ce[162]=he[162]=12;le[32]=ge[32]=4;ce[32]=me[32]=1;le[138]=ge[138]=4;ce[138]=me[138]=1;pe[128]=ge[128]=21;de[128]=me[128]=22;pe[42]=ge[42]=21;de[42]=me[42]=22;ce[5]=pe[5]=14;ce[165]=pe[165]=14;he[20]=ge[20]=6;he[150]=ge[150]=6;le[80]=de[80]=11;le[90]=de[90]=11;fe[65]=me[65]=3;fe[105]=me[105]=3;le[160]=de[160]=11;ce[160]=pe[160]=14;le[10]=de[10]=11;ce[10]=pe[10]=14;he[130]=ge[130]=6;fe[130]=me[130]=3;he[40]=ge[40]=6;fe[40]=me[40]=3;ce[101]=me[101]=1;ce[69]=me[69]=1;pe[149]=ge[149]=21;pe[21]=ge[21]=21;he[86]=de[86]=17;he[84]=de[84]=17;le[89]=fe[89]=9;le[81]=fe[81]=9;le[96]=me[96]=0;ce[96]=de[96]=15;le[74]=me[74]=0;ce[74]=de[74]=15;le[24]=he[24]=8;fe[24]=ge[24]=7;le[146]=he[146]=8;fe[146]=ge[146]=7;ce[6]=de[6]=15;he[6]=pe[6]=16;ce[164]=de[164]=15;he[164]=pe[164]=16;fe[129]=ge[129]=7;pe[129]=me[129]=20;fe[41]=ge[41]=7;pe[41]=me[41]=20;he[66]=me[66]=2;fe[66]=de[66]=19;he[104]=me[104]=2;fe[104]=de[104]=19;le[144]=pe[144]=10;de[144]=ge[144]=23;le[26]=pe[26]=10;de[26]=ge[26]=23;ce[36]=ge[36]=5;he[36]=me[36]=2;ce[134]=ge[134]=5;he[134]=me[134]=2;le[9]=pe[9]=10;ce[9]=fe[9]=13;le[161]=pe[161]=10;ce[161]=fe[161]=13;ce[37]=ge[37]=5;pe[37]=me[37]=20;ce[133]=ge[133]=5;pe[133]=me[133]=20;he[148]=pe[148]=16;de[148]=ge[148]=23;he[22]=pe[22]=16;de[22]=ge[22]=23;le[82]=he[82]=8;fe[82]=de[82]=19;le[88]=he[88]=8;fe[88]=de[88]=19;le[73]=me[73]=0;ce[73]=fe[73]=13;le[97]=me[97]=0;ce[97]=fe[97]=13;le[145]=fe[145]=9;pe[145]=ge[145]=21;le[25]=fe[25]=9;pe[25]=ge[25]=21;ce[70]=me[70]=1;he[70]=de[70]=17;ce[100]=me[100]=1;he[100]=de[100]=17;le[34]=fe[34]=9;ce[34]=he[34]=12;pe[34]=ge[34]=21;de[34]=me[34]=22;le[136]=ge[136]=4;ce[136]=me[136]=1;he[136]=de[136]=17;fe[136]=pe[136]=18;le[35]=ge[35]=4;ce[35]=he[35]=12;fe[35]=pe[35]=18;de[35]=me[35]=22;le[153]=ge[153]=4;fe[153]=pe[153]=18;ce[102]=he[102]=12;de[102]=me[102]=22;le[155]=fe[155]=9;pe[155]=ge[155]=23;ce[103]=me[103]=1;he[103]=de[103]=17;le[152]=ge[152]=4;he[152]=de[152]=17;fe[152]=pe[152]=18;le[156]=he[156]=8;fe[156]=pe[156]=18;de[156]=ge[156]=23;le[137]=ge[137]=4;ce[137]=me[137]=1;fe[137]=pe[137]=18;le[139]=ge[139]=4;ce[139]=fe[139]=13;pe[139]=me[139]=20;le[98]=fe[98]=9;ce[98]=he[98]=12;de[98]=me[98]=22;le[99]=me[99]=0;ce[99]=he[99]=12;fe[99]=de[99]=19;ce[38]=he[38]=12;pe[38]=ge[38]=21;de[38]=me[38]=22;ce[39]=ge[39]=5;he[39]=pe[39]=16;de[39]=me[39]=22;var st=[];st[1]=st[169]=Yc;st[4]=st[166]=$c;st[16]=st[154]=Zc;st[64]=st[106]=Jc;st[168]=st[2]=Kc;st[162]=st[8]=Qc;st[138]=st[32]=jc;st[42]=st[128]=th;st[5]=st[165]=aM;st[20]=st[150]=uM;st[80]=st[90]=lM;st[65]=st[105]=cM;st[160]=st[10]=hM;st[130]=st[40]=fM;st[85]=pM;st[101]=st[69]=dM;st[149]=st[21]=mM;st[86]=st[84]=gM;st[89]=st[81]=yM;st[96]=st[74]=vM;st[24]=st[146]=_M;st[6]=st[164]=xM;st[129]=st[41]=EM;st[66]=st[104]=MM;st[144]=st[26]=wM;st[36]=st[134]=SM;st[9]=st[161]=bM;st[37]=st[133]=AM;st[148]=st[22]=TM;st[82]=st[88]=CM;st[73]=st[97]=IM;st[145]=st[25]=PM;st[70]=st[100]=RM;st[34]=function(o){return[th(o),Qc(o)]};st[35]=NM;st[136]=function(o){return[jc(o),Kc(o)]};st[153]=function(o){return[Zc(o),Yc(o)]};st[102]=function(o){return[$c(o),Jc(o)]};st[155]=LM;st[103]=DM;st[152]=function(o){return[Zc(o),Kc(o)]};st[156]=OM;st[137]=function(o){return[jc(o),Yc(o)]};st[139]=FM;st[98]=function(o){return[Qc(o),Jc(o)]};st[99]=UM;st[38]=function(o){return[$c(o),th(o)]};st[39]=BM;function kM(o){return(o>0)-(o<0)||+o}function Cs(o,e,r){var a=e[0]-o[0],u=e[1]-o[1],c=r[0]-e[0],h=r[1]-e[1];return kM(a*h-c*u)}function ng(o,e){var r=o.geometry.coordinates[0].map(function(h){return h[0]}),a=o.geometry.coordinates[0].map(function(h){return h[1]}),u=e.geometry.coordinates[0].map(function(h){return h[0]}),c=e.geometry.coordinates[0].map(function(h){return h[1]});return Math.max.apply(null,r)===Math.max.apply(null,u)&&Math.max.apply(null,a)===Math.max.apply(null,c)&&Math.min.apply(null,r)===Math.min.apply(null,u)&&Math.min.apply(null,a)===Math.min.apply(null,c)}function eh(o,e){return e.geometry.coordinates[0].every(function(r){return $n(He(r),o)})}function rg(o,e){return o[0]===e[0]&&o[1]===e[1]}var GM=function(){function o(e){this.id=o.buildId(e),this.coordinates=e,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return o.buildId=function(e){return e.join(",")},o.prototype.removeInnerEdge=function(e){this.innerEdges=this.innerEdges.filter(function(r){return r.from.id!==e.from.id})},o.prototype.removeOuterEdge=function(e){this.outerEdges=this.outerEdges.filter(function(r){return r.to.id!==e.to.id})},o.prototype.addOuterEdge=function(e){this.outerEdges.push(e),this.outerEdgesSorted=!1},o.prototype.sortOuterEdges=function(){var e=this;this.outerEdgesSorted||(this.outerEdges.sort(function(r,a){var u=r.to,c=a.to;if(u.coordinates[0]-e.coordinates[0]>=0&&c.coordinates[0]-e.coordinates[0]<0)return 1;if(u.coordinates[0]-e.coordinates[0]<0&&c.coordinates[0]-e.coordinates[0]>=0)return-1;if(u.coordinates[0]-e.coordinates[0]===0&&c.coordinates[0]-e.coordinates[0]===0)return u.coordinates[1]-e.coordinates[1]>=0||c.coordinates[1]-e.coordinates[1]>=0?u.coordinates[1]-c.coordinates[1]:c.coordinates[1]-u.coordinates[1];var h=Cs(e.coordinates,u.coordinates,c.coordinates);if(h<0)return 1;if(h>0)return-1;var p=Math.pow(u.coordinates[0]-e.coordinates[0],2)+Math.pow(u.coordinates[1]-e.coordinates[1],2),d=Math.pow(c.coordinates[0]-e.coordinates[0],2)+Math.pow(c.coordinates[1]-e.coordinates[1],2);return p-d}),this.outerEdgesSorted=!0)},o.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},o.prototype.getOuterEdge=function(e){return this.sortOuterEdges(),this.outerEdges[e]},o.prototype.addInnerEdge=function(e){this.innerEdges.push(e)},o}(),nh=GM;var VM=function(){function o(e,r){this.from=e,this.to=r,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 o.prototype.getSymetric=function(){return this.symetric||(this.symetric=new o(this.to,this.from),this.symetric.symetric=this),this.symetric},o.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},o.prototype.isEqual=function(e){return this.from.id===e.from.id&&this.to.id===e.to.id},o.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},o.prototype.toLineString=function(){return Yn([this.from.coordinates,this.to.coordinates])},o.prototype.compareTo=function(e){return Cs(e.from.coordinates,e.to.coordinates,this.to.coordinates)},o}(),ig=VM;var HM=function(){function o(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return o.prototype.push=function(e){this.edges.push(e),this.polygon=this.envelope=void 0},o.prototype.get=function(e){return this.edges[e]},Object.defineProperty(o.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}),o.prototype.forEach=function(e){this.edges.forEach(e)},o.prototype.map=function(e){return this.edges.map(e)},o.prototype.some=function(e){return this.edges.some(e)},o.prototype.isValid=function(){return!0},o.prototype.isHole=function(){var e=this,r=this.edges.reduce(function(h,p,d){return p.from.coordinates[1]>e.edges[h].from.coordinates[1]&&(h=d),h},0),a=(r===0?this.length:r)-1,u=(r+1)%this.length,c=Cs(this.edges[a].from.coordinates,this.edges[r].from.coordinates,this.edges[u].from.coordinates);return c===0?this.edges[a].from.coordinates[0]>this.edges[u].from.coordinates[0]:c>0},o.prototype.toMultiPoint=function(){return zl(this.edges.map(function(e){return e.from.coordinates}))},o.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var e=this.edges.map(function(r){return r.from.coordinates});return e.push(this.edges[0].from.coordinates),this.polygon=sn([e])},o.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=ic(this.toPolygon())},o.findEdgeRingContaining=function(e,r){var a=e.getEnvelope(),u,c;return r.forEach(function(h){var p=h.getEnvelope();if(c&&(u=c.getEnvelope()),!ng(p,a)&&eh(p,a)){for(var d=e.map(function(I){return I.from.coordinates}),g=void 0,v=function(I){h.some(function(D){return rg(I,D.from.coordinates)})||(g=I)},x=0,M=d;x<M.length;x++){var w=M[x];v(w)}g&&h.inside(He(g))&&(!c||eh(u,p))&&(c=h)}}),c},o.prototype.inside=function(e){return $n(e,this.toPolygon())},o}(),rh=HM;function qM(o){if(!o)throw new Error("No geojson passed");if(o.type!=="FeatureCollection"&&o.type!=="GeometryCollection"&&o.type!=="MultiLineString"&&o.type!=="LineString"&&o.type!=="Feature")throw new Error("Invalid input type '"+o.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}var SL=function(){function o(){this.edges=[],this.nodes={}}return o.fromGeoJson=function(e){qM(e);var r=new o;return Xr(e,function(a){Gl(a,"LineString","Graph::fromGeoJson"),Jf(a,function(u,c){if(u){var h=r.getNode(u),p=r.getNode(c);r.addEdge(h,p)}return c})}),r},o.prototype.getNode=function(e){var r=nh.buildId(e),a=this.nodes[r];return a||(a=this.nodes[r]=new nh(e)),a},o.prototype.addEdge=function(e,r){var a=new ig(e,r),u=a.getSymetric();this.edges.push(a),this.edges.push(u)},o.prototype.deleteDangles=function(){var e=this;Object.keys(this.nodes).map(function(r){return e.nodes[r]}).forEach(function(r){return e._removeIfDangle(r)})},o.prototype._removeIfDangle=function(e){var r=this;if(e.innerEdges.length<=1){var a=e.getOuterEdges().map(function(u){return u.to});this.removeNode(e),a.forEach(function(u){return r._removeIfDangle(u)})}},o.prototype.deleteCutEdges=function(){var e=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(r){r.label===r.symetric.label&&(e.removeEdge(r.symetric),e.removeEdge(r))})},o.prototype._computeNextCWEdges=function(e){var r=this;typeof e>"u"?Object.keys(this.nodes).forEach(function(a){return r._computeNextCWEdges(r.nodes[a])}):e.getOuterEdges().forEach(function(a,u){e.getOuterEdge((u===0?e.getOuterEdges().length:u)-1).symetric.next=a})},o.prototype._computeNextCCWEdges=function(e,r){for(var a=e.getOuterEdges(),u,c,h=a.length-1;h>=0;--h){var p=a[h],d=p.symetric,g=void 0,v=void 0;p.label===r&&(g=p),d.label===r&&(v=d),!(!g||!v)&&(v&&(c=v),g&&(c&&(c.next=g,c=void 0),u||(u=g)))}c&&(c.next=u)},o.prototype._findLabeledEdgeRings=function(){var e=[],r=0;return this.edges.forEach(function(a){if(!(a.label>=0)){e.push(a);var u=a;do u.label=r,u=u.next;while(!a.isEqual(u));r++}}),e},o.prototype.getEdgeRings=function(){var e=this;this._computeNextCWEdges(),this.edges.forEach(function(a){a.label=void 0}),this._findLabeledEdgeRings().forEach(function(a){e._findIntersectionNodes(a).forEach(function(u){e._computeNextCCWEdges(u,a.label)})});var r=[];return this.edges.forEach(function(a){a.ring||r.push(e._findEdgeRing(a))}),r},o.prototype._findIntersectionNodes=function(e){var r=[],a=e,u=function(){var c=0;a.from.getOuterEdges().forEach(function(h){h.label===e.label&&++c}),c>1&&r.push(a.from),a=a.next};do u();while(!e.isEqual(a));return r},o.prototype._findEdgeRing=function(e){var r=e,a=new rh;do a.push(r),r.ring=a,r=r.next;while(!e.isEqual(r));return a},o.prototype.removeNode=function(e){var r=this;e.getOuterEdges().forEach(function(a){return r.removeEdge(a)}),e.innerEdges.forEach(function(a){return r.removeEdge(a)}),delete this.nodes[e.id]},o.prototype.removeEdge=function(e){this.edges=this.edges.filter(function(r){return!r.isEqual(e)}),e.deleteEdge()},o}();var $M=ln(ih(),1);var ZM=ln(ih(),1);var KM=ln(pg(),1);var iw=ln(wg(),1);function bg(o){for(var e=o,r=[];e.parent;)r.unshift(e),e=e.parent;return r}function sw(){return new Ag(function(o){return o.f})}var uh={search:function(o,e,r,a){o.cleanDirty(),a=a||{};var u=a.heuristic||uh.heuristics.manhattan,c=a.closest||!1,h=sw(),p=e;for(e.h=u(e,r),h.push(e);h.size()>0;){var d=h.pop();if(d===r)return bg(d);d.closed=!0;for(var g=o.neighbors(d),v=0,x=g.length;v<x;++v){var M=g[v];if(!(M.closed||M.isWall())){var w=d.g+M.getCost(d),I=M.visited;(!I||w<M.g)&&(M.visited=!0,M.parent=d,M.h=M.h||u(M,r),M.g=w,M.f=M.g+M.h,o.markDirty(M),c&&(M.h<p.h||M.h===p.h&&M.g<p.g)&&(p=M),I?h.rescoreElement(M):h.push(M))}}}return c?bg(p):[]},heuristics:{manhattan:function(o,e){var r=Math.abs(e.x-o.x),a=Math.abs(e.y-o.y);return r+a},diagonal:function(o,e){var r=1,a=Math.sqrt(2),u=Math.abs(e.x-o.x),c=Math.abs(e.y-o.y);return r*(u+c)+(a-2*r)*Math.min(u,c)}},cleanNode:function(o){o.f=0,o.g=0,o.h=0,o.visited=!1,o.closed=!1,o.parent=null}};function va(o,e){e=e||{},this.nodes=[],this.diagonal=!!e.diagonal,this.grid=[];for(var r=0;r<o.length;r++){this.grid[r]=[];for(var a=0,u=o[r];a<u.length;a++){var c=new Du(r,a,u[a]);this.grid[r][a]=c,this.nodes.push(c)}}this.init()}va.prototype.init=function(){this.dirtyNodes=[];for(var o=0;o<this.nodes.length;o++)uh.cleanNode(this.nodes[o])};va.prototype.cleanDirty=function(){for(var o=0;o<this.dirtyNodes.length;o++)uh.cleanNode(this.dirtyNodes[o]);this.dirtyNodes=[]};va.prototype.markDirty=function(o){this.dirtyNodes.push(o)};va.prototype.neighbors=function(o){var e=[],r=o.x,a=o.y,u=this.grid;return u[r-1]&&u[r-1][a]&&e.push(u[r-1][a]),u[r+1]&&u[r+1][a]&&e.push(u[r+1][a]),u[r]&&u[r][a-1]&&e.push(u[r][a-1]),u[r]&&u[r][a+1]&&e.push(u[r][a+1]),this.diagonal&&(u[r-1]&&u[r-1][a-1]&&e.push(u[r-1][a-1]),u[r+1]&&u[r+1][a-1]&&e.push(u[r+1][a-1]),u[r-1]&&u[r-1][a+1]&&e.push(u[r-1][a+1]),u[r+1]&&u[r+1][a+1]&&e.push(u[r+1][a+1])),e};va.prototype.toString=function(){for(var o=[],e=this.grid,r,a,u,c,h=0,p=e.length;h<p;h++){for(r=[],a=e[h],u=0,c=a.length;u<c;u++)r.push(a[u].weight);o.push(r.join(" "))}return o.join(\`
|
|
7226
7226
|
\`)};function Du(o,e,r){this.x=o,this.y=e,this.weight=r}Du.prototype.toString=function(){return"["+this.x+" "+this.y+"]"};Du.prototype.getCost=function(o){return o&&o.x!==this.x&&o.y!==this.y?this.weight*1.41421:this.weight};Du.prototype.isWall=function(){return this.weight===0};function Ag(o){this.content=[],this.scoreFunction=o}Ag.prototype={push:function(o){this.content.push(o),this.sinkDown(this.content.length-1)},pop:function(){var o=this.content[0],e=this.content.pop();return this.content.length>0&&(this.content[0]=e,this.bubbleUp(0)),o},remove:function(o){var e=this.content.indexOf(o),r=this.content.pop();e!==this.content.length-1&&(this.content[e]=r,this.scoreFunction(r)<this.scoreFunction(o)?this.sinkDown(e):this.bubbleUp(e))},size:function(){return this.content.length},rescoreElement:function(o){this.sinkDown(this.content.indexOf(o))},sinkDown:function(o){for(var e=this.content[o];o>0;){var r=(o+1>>1)-1,a=this.content[r];if(this.scoreFunction(e)<this.scoreFunction(a))this.content[r]=e,this.content[o]=a,o=r;else break}},bubbleUp:function(o){for(var e=this.content.length,r=this.content[o],a=this.scoreFunction(r);;){var u=o+1<<1,c=u-1,h=null,p;if(c<e){var d=this.content[c];p=this.scoreFunction(d),p<a&&(h=c)}if(u<e){var g=this.content[u],v=this.scoreFunction(g);v<(h===null?a:p)&&(h=u)}if(h!==null)this.content[o]=this.content[h],this.content[h]=r,o=h;else break}}};function lh(){this._=null}function Ps(o){o.U=o.C=o.L=o.R=o.P=o.N=null}lh.prototype={constructor:lh,insert:function(o,e){var r,a,u;if(o){if(e.P=o,e.N=o.N,o.N&&(o.N.P=e),o.N=e,o.R){for(o=o.R;o.L;)o=o.L;o.L=e}else o.R=e;r=o}else this._?(o=Tg(this._),e.P=null,e.N=o,o.P=o.L=e,r=o):(e.P=e.N=null,this._=e,r=null);for(e.L=e.R=null,e.U=r,e.C=!0,o=e;r&&r.C;)a=r.U,r===a.L?(u=a.R,u&&u.C?(r.C=u.C=!1,a.C=!0,o=a):(o===r.R&&(_a(this,r),o=r,r=o.U),r.C=!1,a.C=!0,xa(this,a))):(u=a.L,u&&u.C?(r.C=u.C=!1,a.C=!0,o=a):(o===r.L&&(xa(this,r),o=r,r=o.U),r.C=!1,a.C=!0,_a(this,a))),r=o.U;this._.C=!1},remove:function(o){o.N&&(o.N.P=o.P),o.P&&(o.P.N=o.N),o.N=o.P=null;var e=o.U,r,a=o.L,u=o.R,c,h;if(a?u?c=Tg(u):c=a:c=u,e?e.L===o?e.L=c:e.R=c:this._=c,a&&u?(h=c.C,c.C=o.C,c.L=a,a.U=c,c!==u?(e=c.U,c.U=o.U,o=c.R,e.L=o,c.R=u,u.U=c):(c.U=e,e=c,o=c.R)):(h=o.C,o=c),o&&(o.U=e),!h){if(o&&o.C){o.C=!1;return}do{if(o===this._)break;if(o===e.L){if(r=e.R,r.C&&(r.C=!1,e.C=!0,_a(this,e),r=e.R),r.L&&r.L.C||r.R&&r.R.C){(!r.R||!r.R.C)&&(r.L.C=!1,r.C=!0,xa(this,r),r=e.R),r.C=e.C,e.C=r.R.C=!1,_a(this,e),o=this._;break}}else if(r=e.L,r.C&&(r.C=!1,e.C=!0,xa(this,e),r=e.L),r.L&&r.L.C||r.R&&r.R.C){(!r.L||!r.L.C)&&(r.R.C=!1,r.C=!0,_a(this,r),r=e.L),r.C=e.C,e.C=r.L.C=!1,xa(this,e),o=this._;break}r.C=!0,o=e,e=e.U}while(!o.C);o&&(o.C=!1)}}};function _a(o,e){var r=e,a=e.R,u=r.U;u?u.L===r?u.L=a:u.R=a:o._=a,a.U=u,r.U=a,r.R=a.L,r.R&&(r.R.U=r),a.L=r}function xa(o,e){var r=e,a=e.L,u=r.U;u?u.L===r?u.L=a:u.R=a:o._=a,a.U=u,r.U=a,r.L=a.R,r.L&&(r.L.U=r),a.R=r}function Tg(o){for(;o.L;)o=o.L;return o}var ch=lh;function Rs(o,e,r,a){var u=[null,null],c=Jn.push(u)-1;return u.left=o,u.right=e,r&&Ea(u,o,e,r),a&&Ea(u,e,o,a),Cr[o.index].halfedges.push(c),Cr[e.index].halfedges.push(c),u}function Ns(o,e,r){var a=[e,r];return a.left=o,a}function Ea(o,e,r,a){!o[0]&&!o[1]?(o[0]=a,o.left=e,o.right=r):o.left===r?o[1]=a:o[0]=a}function aw(o,e,r,a,u){var c=o[0],h=o[1],p=c[0],d=c[1],g=h[0],v=h[1],x=0,M=1,w=g-p,I=v-d,D;if(D=e-p,!(!w&&D>0)){if(D/=w,w<0){if(D<x)return;D<M&&(M=D)}else if(w>0){if(D>M)return;D>x&&(x=D)}if(D=a-p,!(!w&&D<0)){if(D/=w,w<0){if(D>M)return;D>x&&(x=D)}else if(w>0){if(D<x)return;D<M&&(M=D)}if(D=r-d,!(!I&&D>0)){if(D/=I,I<0){if(D<x)return;D<M&&(M=D)}else if(I>0){if(D>M)return;D>x&&(x=D)}if(D=u-d,!(!I&&D<0)){if(D/=I,I<0){if(D>M)return;D>x&&(x=D)}else if(I>0){if(D<x)return;D<M&&(M=D)}return!(x>0)&&!(M<1)||(x>0&&(o[0]=[p+x*w,d+x*I]),M<1&&(o[1]=[p+M*w,d+M*I])),!0}}}}}function uw(o,e,r,a,u){var c=o[1];if(c)return!0;var h=o[0],p=o.left,d=o.right,g=p[0],v=p[1],x=d[0],M=d[1],w=(g+x)/2,I=(v+M)/2,D,b;if(M===v){if(w<e||w>=a)return;if(g>x){if(!h)h=[w,r];else if(h[1]>=u)return;c=[w,u]}else{if(!h)h=[w,u];else if(h[1]<r)return;c=[w,r]}}else if(D=(g-x)/(M-v),b=I-D*w,D<-1||D>1)if(g>x){if(!h)h=[(r-b)/D,r];else if(h[1]>=u)return;c=[(u-b)/D,u]}else{if(!h)h=[(u-b)/D,u];else if(h[1]<r)return;c=[(r-b)/D,r]}else if(v<M){if(!h)h=[e,D*e+b];else if(h[0]>=a)return;c=[a,D*a+b]}else{if(!h)h=[a,D*a+b];else if(h[0]<e)return;c=[e,D*e+b]}return o[0]=h,o[1]=c,!0}function Cg(o,e,r,a){for(var u=Jn.length,c;u--;)(!uw(c=Jn[u],o,e,r,a)||!aw(c,o,e,r,a)||!(Math.abs(c[0][0]-c[1][0])>Ue||Math.abs(c[0][1]-c[1][1])>Ue))&&delete Jn[u]}function Ig(o){return Cr[o.index]={site:o,halfedges:[]}}function lw(o,e){var r=o.site,a=e.left,u=e.right;return r===u&&(u=a,a=r),u?Math.atan2(u[1]-a[1],u[0]-a[0]):(r===a?(a=e[1],u=e[0]):(a=e[0],u=e[1]),Math.atan2(a[0]-u[0],u[1]-a[1]))}function hh(o,e){return e[+(e.left!==o.site)]}function cw(o,e){return e[+(e.left===o.site)]}function Pg(){for(var o=0,e=Cr.length,r,a,u,c;o<e;++o)if((r=Cr[o])&&(c=(a=r.halfedges).length)){var h=new Array(c),p=new Array(c);for(u=0;u<c;++u)h[u]=u,p[u]=lw(r,Jn[a[u]]);for(h.sort(function(d,g){return p[g]-p[d]}),u=0;u<c;++u)p[u]=a[h[u]];for(u=0;u<c;++u)a[u]=p[u]}}function Rg(o,e,r,a){var u=Cr.length,c,h,p,d,g,v,x,M,w,I,D,b,T=!0;for(c=0;c<u;++c)if(h=Cr[c]){for(p=h.site,g=h.halfedges,d=g.length;d--;)Jn[g[d]]||g.splice(d,1);for(d=0,v=g.length;d<v;)I=cw(h,Jn[g[d]]),D=I[0],b=I[1],x=hh(h,Jn[g[++d%v]]),M=x[0],w=x[1],(Math.abs(D-M)>Ue||Math.abs(b-w)>Ue)&&(g.splice(d,0,Jn.push(Ns(p,I,Math.abs(D-o)<Ue&&a-b>Ue?[o,Math.abs(M-o)<Ue?w:a]:Math.abs(b-a)<Ue&&r-D>Ue?[Math.abs(w-a)<Ue?M:r,a]:Math.abs(D-r)<Ue&&b-e>Ue?[r,Math.abs(M-r)<Ue?w:e]:Math.abs(b-e)<Ue&&D-o>Ue?[Math.abs(w-e)<Ue?M:o,e]:null))-1),++v);v&&(T=!1)}if(T){var L,P,z,k=1/0;for(c=0,T=null;c<u;++c)(h=Cr[c])&&(p=h.site,L=p[0]-o,P=p[1]-e,z=L*L+P*P,z<k&&(k=z,T=h));if(T){var Y=[o,e],q=[o,a],C=[r,a],ot=[r,e];T.halfedges.push(Jn.push(Ns(p=T.site,Y,q))-1,Jn.push(Ns(p,q,C))-1,Jn.push(Ns(p,C,ot))-1,Jn.push(Ns(p,ot,Y))-1)}}for(c=0;c<u;++c)(h=Cr[c])&&(h.halfedges.length||delete Cr[c])}var Ng=[],Ou;function hw(){Ps(this),this.x=this.y=this.arc=this.site=this.cy=null}function Vo(o){var e=o.P,r=o.N;if(!(!e||!r)){var a=e.site,u=o.site,c=r.site;if(a!==c){var h=u[0],p=u[1],d=a[0]-h,g=a[1]-p,v=c[0]-h,x=c[1]-p,M=2*(d*x-g*v);if(!(M>=-Lg)){var w=d*d+g*g,I=v*v+x*x,D=(x*w-g*I)/M,b=(d*I-v*w)/M,T=Ng.pop()||new hw;T.arc=o,T.site=u,T.x=D+h,T.y=(T.cy=b+p)+Math.sqrt(D*D+b*b),o.circle=T;for(var L=null,P=Ls._;P;)if(T.y<P.y||T.y===P.y&&T.x<=P.x)if(P.L)P=P.L;else{L=P.P;break}else if(P.R)P=P.R;else{L=P;break}Ls.insert(L,T),L||(Ou=T)}}}}function Ho(o){var e=o.circle;e&&(e.P||(Ou=e.N),Ls.remove(e),Ng.push(e),Ps(e),o.circle=null)}var Og=[];function fw(){Ps(this),this.edge=this.site=this.circle=null}function Dg(o){var e=Og.pop()||new fw;return e.site=o,e}function fh(o){Ho(o),qo.remove(o),Og.push(o),Ps(o)}function Fg(o){var e=o.circle,r=e.x,a=e.cy,u=[r,a],c=o.P,h=o.N,p=[o];fh(o);for(var d=c;d.circle&&Math.abs(r-d.circle.x)<Ue&&Math.abs(a-d.circle.cy)<Ue;)c=d.P,p.unshift(d),fh(d),d=c;p.unshift(d),Ho(d);for(var g=h;g.circle&&Math.abs(r-g.circle.x)<Ue&&Math.abs(a-g.circle.cy)<Ue;)h=g.N,p.push(g),fh(g),g=h;p.push(g),Ho(g);var v=p.length,x;for(x=1;x<v;++x)g=p[x],d=p[x-1],Ea(g.edge,d.site,g.site,u);d=p[0],g=p[v-1],g.edge=Rs(d.site,g.site,null,u),Vo(d),Vo(g)}function Ug(o){for(var e=o[0],r=o[1],a,u,c,h,p=qo._;p;)if(c=Bg(p,r)-e,c>Ue)p=p.L;else if(h=e-pw(p,r),h>Ue){if(!p.R){a=p;break}p=p.R}else{c>-Ue?(a=p.P,u=p):h>-Ue?(a=p,u=p.N):a=u=p;break}Ig(o);var d=Dg(o);if(qo.insert(a,d),!(!a&&!u)){if(a===u){Ho(a),u=Dg(a.site),qo.insert(d,u),d.edge=u.edge=Rs(a.site,d.site),Vo(a),Vo(u);return}if(!u){d.edge=Rs(a.site,d.site);return}Ho(a),Ho(u);var g=a.site,v=g[0],x=g[1],M=o[0]-v,w=o[1]-x,I=u.site,D=I[0]-v,b=I[1]-x,T=2*(M*b-w*D),L=M*M+w*w,P=D*D+b*b,z=[(b*L-w*P)/T+v,(M*P-D*L)/T+x];Ea(u.edge,g,I,z),d.edge=Rs(g,o,null,z),u.edge=Rs(o,I,null,z),Vo(a),Vo(u)}}function Bg(o,e){var r=o.site,a=r[0],u=r[1],c=u-e;if(!c)return a;var h=o.P;if(!h)return-1/0;r=h.site;var p=r[0],d=r[1],g=d-e;if(!g)return p;var v=p-a,x=1/c-1/g,M=v/g;return x?(-M+Math.sqrt(M*M-2*x*(v*v/(-2*g)-d+g/2+u-c/2)))/x+a:(a+p)/2}function pw(o,e){var r=o.N;if(r)return Bg(r,e);var a=o.site;return a[1]===e?a[0]:1/0}var Ue=1e-6,Lg=1e-12,qo,Cr,Ls,Jn;function dw(o,e,r){return(o[0]-r[0])*(e[1]-o[1])-(o[0]-e[0])*(r[1]-o[1])}function mw(o,e){return e[1]-o[1]||e[0]-o[0]}function Fu(o,e){var r=o.sort(mw).pop(),a,u,c;for(Jn=[],Cr=new Array(o.length),qo=new ch,Ls=new ch;;)if(c=Ou,r&&(!c||r[1]<c.y||r[1]===c.y&&r[0]<c.x))(r[0]!==a||r[1]!==u)&&(Ug(r),a=r[0],u=r[1]),r=o.pop();else if(c)Fg(c.arc);else break;if(Pg(),e){var h=+e[0][0],p=+e[0][1],d=+e[1][0],g=+e[1][1];Cg(h,p,d,g),Rg(h,p,d,g)}this.edges=Jn,this.cells=Cr,qo=Ls=Jn=Cr=null}Fu.prototype={constructor:Fu,polygons:function(){var o=this.edges;return this.cells.map(function(e){var r=e.halfedges.map(function(a){return hh(e,o[a])});return r.data=e.site.data,r})},triangles:function(){var o=[],e=this.edges;return this.cells.forEach(function(r,a){if(p=(c=r.halfedges).length)for(var u=r.site,c,h=-1,p,d,g=e[c[p-1]],v=g.left===u?g.right:g.left;++h<p;)d=v,g=e[c[h]],v=g.left===u?g.right:g.left,d&&v&&a<d.index&&a<v.index&&dw(u,d,v)<0&&o.push([u.data,d.data,v.data])}),o},links:function(){return this.edges.filter(function(o){return o.right}).map(function(o){return{source:o.left.data,target:o.right.data}})},find:function(o,e,r){for(var a=this,u,c=a._found||0,h=a.cells.length,p;!(p=a.cells[c]);)if(++c>=h)return null;var d=o-p.site[0],g=e-p.site[1],v=d*d+g*g;do p=a.cells[u=c],c=null,p.halfedges.forEach(function(x){var M=a.edges[x],w=M.left;if(!((w===p.site||!w)&&!(w=M.right))){var I=o-w[0],D=e-w[1],b=I*I+D*D;b<v&&(v=b,c=w.index)}});while(c!==null);return a._found=u,r==null||v<=r*r?p.site:null}};var ww=ln(Ds(),1);var Th=ln(Vg(),1);function Ur(){return new zu}function zu(){this.reset()}zu.prototype={constructor:zu,reset:function(){this.s=this.t=0},add:function(o){Hg(Bu,o,this.t),Hg(this,Bu.s,this.s),this.s?this.t+=Bu.t:this.s=Bu.t},valueOf:function(){return this.s}};var Bu=new zu;function Hg(o,e,r){var a=o.s=e+r,u=a-e,c=a-u;o.t=e-c+(r-u)}var Ae=1e-6;var Oe=Math.PI,On=Oe/2,ku=Oe/4,Ui=Oe*2,Wo=180/Oe,Br=Oe/180,mn=Math.abs,bi=Math.atan,zr=Math.atan2,xe=Math.cos;var Gu=Math.exp;var Ma=Math.log;var Lt=Math.sin;var ar=Math.sqrt,wa=Math.tan;function mh(o){return o>1?0:o<-1?Oe:Math.acos(o)}function Ir(o){return o>1?On:o<-1?-On:Math.asin(o)}function Ai(){}var Sw=Ur(),vO=Ur();function Xo(o){var e=o[0],r=o[1],a=xe(r);return[a*xe(e),a*Lt(e),Lt(r)]}function Sa(o,e){return[o[1]*e[2]-o[2]*e[1],o[2]*e[0]-o[0]*e[2],o[0]*e[1]-o[1]*e[0]]}function ba(o){var e=ar(o[0]*o[0]+o[1]*o[1]+o[2]*o[2]);o[0]/=e,o[1]/=e,o[2]/=e}var CO=Ur();function Wg(o,e){return[o>Oe?o-Ui:o<-Oe?o+Ui:o,e]}Wg.invert=Wg;function gh(){var o=[],e;return{point:function(r,a){e.push([r,a])},lineStart:function(){o.push(e=[])},lineEnd:Ai,rejoin:function(){o.length>1&&o.push(o.pop().concat(o.shift()))},result:function(){var r=o;return o=[],e=null,r}}}function yh(o,e){return mn(o[0]-e[0])<Ae&&mn(o[1]-e[1])<Ae}function Vu(o,e,r,a){this.x=o,this.z=e,this.o=r,this.e=a,this.v=!1,this.n=this.p=null}function vh(o,e,r,a,u){var c=[],h=[],p,d;if(o.forEach(function(I){if(!((D=I.length-1)<=0)){var D,b=I[0],T=I[D],L;if(yh(b,T)){for(u.lineStart(),p=0;p<D;++p)u.point((b=I[p])[0],b[1]);u.lineEnd();return}c.push(L=new Vu(b,I,null,!0)),h.push(L.o=new Vu(b,null,L,!1)),c.push(L=new Vu(T,I,null,!1)),h.push(L.o=new Vu(T,null,L,!0))}}),!!c.length){for(h.sort(e),Xg(c),Xg(h),p=0,d=h.length;p<d;++p)h[p].e=r=!r;for(var g=c[0],v,x;;){for(var M=g,w=!0;M.v;)if((M=M.n)===g)return;v=M.z,u.lineStart();do{if(M.v=M.o.v=!0,M.e){if(w)for(p=0,d=v.length;p<d;++p)u.point((x=v[p])[0],x[1]);else a(M.x,M.n.x,1,u);M=M.n}else{if(w)for(v=M.p.z,p=v.length-1;p>=0;--p)u.point((x=v[p])[0],x[1]);else a(M.x,M.p.x,-1,u);M=M.p}M=M.o,v=M.z,w=!w}while(!M.v);u.lineEnd()}}}function Xg(o){if(e=o.length){for(var e,r=0,a=o[0],u;++r<e;)a.n=u=o[r],u.p=a,a=u;a.n=u=o[0],u.p=a}}function Eo(o,e){return o<e?-1:o>e?1:o>=e?0:NaN}function _h(o){return o.length===1&&(o=Tw(o)),{left:function(e,r,a,u){for(a==null&&(a=0),u==null&&(u=e.length);a<u;){var c=a+u>>>1;o(e[c],r)<0?a=c+1:u=c}return a},right:function(e,r,a,u){for(a==null&&(a=0),u==null&&(u=e.length);a<u;){var c=a+u>>>1;o(e[c],r)>0?u=c:a=c+1}return a}}}function Tw(o){return function(e,r){return Eo(o(e),r)}}var Yg=_h(Eo),Cw=Yg.right,Iw=Yg.left;var $g=Array.prototype,Rw=$g.slice,Nw=$g.map;var x3=Math.sqrt(50),E3=Math.sqrt(10),M3=Math.sqrt(2);function qu(o){for(var e=o.length,r,a=-1,u=0,c,h;++a<e;)u+=o[a].length;for(c=new Array(u);--e>=0;)for(h=o[e],r=h.length;--r>=0;)c[--u]=h[r];return c}var kw=1e9,oU=-kw;var xh=Ur();function Eh(o,e){var r=e[0],a=e[1],u=[Lt(r),-xe(r),0],c=0,h=0;xh.reset();for(var p=0,d=o.length;p<d;++p)if(v=(g=o[p]).length)for(var g,v,x=g[v-1],M=x[0],w=x[1]/2+ku,I=Lt(w),D=xe(w),b=0;b<v;++b,M=L,I=z,D=k,x=T){var T=g[b],L=T[0],P=T[1]/2+ku,z=Lt(P),k=xe(P),Y=L-M,q=Y>=0?1:-1,C=q*Y,ot=C>Oe,pt=I*z;if(xh.add(zr(pt*q*Lt(C),D*k+pt*xe(C))),c+=ot?Y+q*Ui:Y,ot^M>=r^L>=r){var dt=Sa(Xo(x),Xo(T));ba(dt);var F=Sa(u,dt);ba(F);var ye=(ot^Y>=0?-1:1)*Ir(F[2]);(a>ye||a===ye&&(dt[0]||dt[1]))&&(h+=ot^Y>=0?1:-1)}}return(c<-Ae||c<Ae&&xh<-Ae)^h&1}var mU=Ur();var DU=Ur(),OU=Ur();var Hw=1/0;var BU=-Hw;function Mh(o){this._context=o}Mh.prototype={_radius:4.5,pointRadius:function(o){return this._radius=o,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(o,e){switch(this._point){case 0:{this._context.moveTo(o,e),this._point=1;break}case 1:{this._context.lineTo(o,e);break}default:{this._context.moveTo(o+this._radius,e),this._context.arc(o,e,this._radius,0,Ui);break}}},result:Ai};var $U=Ur();function wh(){this._string=[]}wh.prototype={_radius:4.5,_circle:Kg(4.5),pointRadius:function(o){return(o=+o)!==this._radius&&(this._radius=o,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(o,e){switch(this._point){case 0:{this._string.push("M",o,",",e),this._point=1;break}case 1:{this._string.push("L",o,",",e);break}default:{this._circle==null&&(this._circle=Kg(this._radius)),this._string.push("M",o,",",e,this._circle);break}}},result:function(){if(this._string.length){var o=this._string.join("");return this._string=[],o}else return null}};function Kg(o){return"m0,"+o+"a"+o+","+o+" 0 1,1 0,"+-2*o+"a"+o+","+o+" 0 1,1 0,"+2*o+"z"}function Sh(o,e,r,a){return function(u,c){var h=e(c),p=u.invert(a[0],a[1]),d=gh(),g=e(d),v=!1,x,M,w,I={point:D,lineStart:T,lineEnd:L,polygonStart:function(){I.point=P,I.lineStart=z,I.lineEnd=k,M=[],x=[]},polygonEnd:function(){I.point=D,I.lineStart=T,I.lineEnd=L,M=qu(M);var Y=Eh(x,p);M.length?(v||(c.polygonStart(),v=!0),vh(M,Xw,Y,r,c)):Y&&(v||(c.polygonStart(),v=!0),c.lineStart(),r(null,null,1,c),c.lineEnd()),v&&(c.polygonEnd(),v=!1),M=x=null},sphere:function(){c.polygonStart(),c.lineStart(),r(null,null,1,c),c.lineEnd(),c.polygonEnd()}};function D(Y,q){var C=u(Y,q);o(Y=C[0],q=C[1])&&c.point(Y,q)}function b(Y,q){var C=u(Y,q);h.point(C[0],C[1])}function T(){I.point=b,h.lineStart()}function L(){I.point=D,h.lineEnd()}function P(Y,q){w.push([Y,q]);var C=u(Y,q);g.point(C[0],C[1])}function z(){g.lineStart(),w=[]}function k(){P(w[0][0],w[0][1]),g.lineEnd();var Y=g.clean(),q=d.result(),C,ot=q.length,pt,dt,F;if(w.pop(),x.push(w),w=null,!!ot){if(Y&1){if(dt=q[0],(pt=dt.length-1)>0){for(v||(c.polygonStart(),v=!0),c.lineStart(),C=0;C<pt;++C)c.point((F=dt[C])[0],F[1]);c.lineEnd()}return}ot>1&&Y&2&&q.push(q.pop().concat(q.shift())),M.push(q.filter(Ww))}}return I}}function Ww(o){return o.length>1}function Xw(o,e){return((o=o.x)[0]<0?o[1]-On-Ae:On-o[1])-((e=e.x)[0]<0?e[1]-On-Ae:On-e[1])}var Yw=Sh(function(){return!0},$w,Jw,[-Oe,-On]);function $w(o){var e=NaN,r=NaN,a=NaN,u;return{lineStart:function(){o.lineStart(),u=1},point:function(c,h){var p=c>0?Oe:-Oe,d=mn(c-e);mn(d-Oe)<Ae?(o.point(e,r=(r+h)/2>0?On:-On),o.point(a,r),o.lineEnd(),o.lineStart(),o.point(p,r),o.point(c,r),u=0):a!==p&&d>=Oe&&(mn(e-a)<Ae&&(e-=a*Ae),mn(c-p)<Ae&&(c-=p*Ae),r=Zw(e,r,c,h),o.point(a,r),o.lineEnd(),o.lineStart(),o.point(p,r),u=0),o.point(e=c,r=h),a=p},lineEnd:function(){o.lineEnd(),e=r=NaN},clean:function(){return 2-u}}}function Zw(o,e,r,a){var u,c,h=Lt(o-r);return mn(h)>Ae?bi((Lt(e)*(c=xe(a))*Lt(r)-Lt(a)*(u=xe(e))*Lt(o))/(u*c*h)):(e+a)/2}function Jw(o,e,r,a){var u;if(o==null)u=r*On,a.point(-Oe,u),a.point(0,u),a.point(Oe,u),a.point(Oe,0),a.point(Oe,-u),a.point(0,-u),a.point(-Oe,-u),a.point(-Oe,0),a.point(-Oe,u);else if(mn(o[0]-e[0])>Ae){var c=o[0]<e[0]?Oe:-Oe;u=r*c/2,a.point(-c,u),a.point(0,u),a.point(c,u)}else a.point(e[0],e[1])}function Wu(o){return function(e){var r=new bh;for(var a in o)r[a]=o[a];return r.stream=e,r}}function bh(){}bh.prototype={constructor:bh,point:function(o,e){this.stream.point(o,e)},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 OB=xe(30*Br);var ZB=Wu({point:function(o,e){this.stream.point(o*Br,e*Br)}});function Xu(o){return function(e,r){var a=xe(e),u=xe(r),c=o(a*u);return[c*u*Lt(e),c*Lt(r)]}}function Bi(o){return function(e,r){var a=ar(e*e+r*r),u=o(a),c=Lt(u),h=xe(u);return[zr(e*c,a*h),Ir(a&&r*c/a)]}}var i0=Xu(function(o){return ar(2/(1+o))});i0.invert=Bi(function(o){return 2*Ir(o/2)});var o0=Xu(function(o){return(o=mh(o))&&o/Lt(o)});o0.invert=Bi(function(o){return o});function Ah(o,e){return[o,Ma(wa((On+e)/2))]}Ah.invert=function(o,e){return[o,2*bi(Gu(e))-On]};function Yu(o,e){return[o,e]}Yu.invert=Yu;function s0(o,e){var r=xe(e),a=xe(o)*r;return[r*Lt(o)/a,Lt(e)/a]}s0.invert=Bi(bi);function a0(o,e){var r=e*e,a=r*r;return[o*(.8707-.131979*r+a*(-.013791+a*(.003971*r-.001529*a))),e*(1.007226+r*(.015085+a*(-.044475+.028874*r-.005916*a)))]}a0.invert=function(o,e){var r=e,a=25,u;do{var c=r*r,h=c*c;r-=u=(r*(1.007226+c*(.015085+h*(-.044475+.028874*c-.005916*h)))-e)/(1.007226+c*(.015085*3+h*(-.044475*7+.028874*9*c-.005916*11*h)))}while(mn(u)>Ae&&--a>0);return[o/(.8707+(c=r*r)*(-.131979+c*(-.013791+c*c*c*(.003971-.001529*c)))),r]};function u0(o,e){return[xe(e)*Lt(o),Lt(e)]}u0.invert=Bi(Ir);function l0(o,e){var r=xe(e),a=1+xe(o)*r;return[r*Lt(o)/a,Lt(e)/a]}l0.invert=Bi(function(o){return 2*bi(o)});function c0(o,e){return[Ma(wa((On+e)/2)),-o]}c0.invert=function(o,e){return[-e,2*bi(Gu(o))-On]};var nS=ln(Ds(),1);var rS=ln(Ds(),1);var oS=ln(Ds(),1);var sS=ln(Ds(),1);function wo(o,e){return Math.sqrt((e[0]-o[0])**2+(e[1]-o[1])**2)}function Ch(o){let e=0;for(let r=0;r<o.length-1;r++)e+=wo(o[r],o[r+1]);return e}function f0(o,e,r){let a=new br(e[0]-o[0],e[1]-o[1]),u=new br(e[0]-r[0],e[1]-r[1]),h=a.angleTo(u)*180/Math.PI,p=new br(e[0]-o[0],e[1]-o[1]);return new br(r[0]-o[0],r[1]-o[1]).cross(p)>0?h:-h}var oi="___",$u=class{constructor(e=3){this.lift_priority=e}roadInfo=[];pointMap=new Map;nodeMap=new Map;facilityMap=new Map;straightLadderMap=new Map;escalatorMap=new Map;staircaseMap=new Map;lineMap=new Map;baseRoute=new zi.default;escalatorRoute=new zi.default;straightLadderRoute=new zi.default;initRoute(e){this.clear(),this.roadInfo=e,e.length&&(e.forEach(r=>{r.points.forEach(a=>{let u=\`\${r.floor}\${oi}\${a.id}\`;if(this.pointMap.set(u,a),this.nodeMap.set(\`\${a.floor}\${oi}\${a.nodeId}\`,u),a.type==="straightLadder"){let c=this.straightLadderMap.get(a.name)||[];c.push({...a}),this.straightLadderMap.set(a.name,c)}if(a.type==="staircase"){let c=this.staircaseMap.get(a.name)||[];c.push({...a}),this.staircaseMap.set(a.name,c)}if(a.type==="escalator"){let c=this.escalatorMap.get(a.name)||{};a.escalatorDirection==="exit"?c.end={floor:a.floor,id:a.id}:c.start={floor:a.floor,id:a.id},this.escalatorMap.set(a.name,c)}if(a.type==="facility"){let c=this.facilityMap.get(a.targetId)||[];c.push({...a}),this.facilityMap.set(a.targetId,c)}}),r.lines.filter(a=>a.direction!=="no").forEach(a=>{let u=\`\${r.floor}\${oi}\${a.from}\`,c=\`\${r.floor}\${oi}\${a.to}\`,h=this.pointMap.get(u)?.cds,p=this.pointMap.get(c)?.cds;if(h?.length&&p?.length){let d=wo(h,p);this.addLineItem(u,c,d),a.direction==="double"&&this.addLineItem(c,u,d)}})}),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute())}addLineItem(e,r,a,u=this.lineMap){let c=u.get(e)||new Map;c.set(r,a),u.set(e,c)}addFacilityToLineMap(e,r,a,u){[...this.straightLadderMap,...this.staircaseMap].forEach(([c,h])=>{if(!(h.length<2))for(let p=0;p<h.length;p++){let d=\`\${h[p].floor}\${oi}\${h[p].id}\`;for(let g=0;g<h.length;g++)if(p!==g){let v=\`\${h[g].floor}\${oi}\${h[g].id}\`,x=this.pointMap.get(d)?.cds,M=this.pointMap.get(v)?.cds;if(x?.length&&M?.length)if(h[p].type==="straightLadder"){let w=r;this.addLineItem(d,v,w,u)}else{let w=a;this.addLineItem(d,v,w,u)}}}}),this.escalatorMap.forEach((c,h)=>{if(c.start&&c.end){let p=\`\${c.start.floor}\${oi}\${c.start.id}\`,d=\`\${c.end.floor}\${oi}\${c.end.id}\`,g=this.pointMap.get(p)?.cds,v=this.pointMap.get(d)?.cds;if(g?.length&&v?.length){let x=e;this.addLineItem(p,d,x,u)}}})}initBaseRoute(){let e=new Map([...this.lineMap]);this.addFacilityToLineMap(1,this.lift_priority,3e4,e),this.baseRoute=new zi.default(e)}initEscalatorRoute(){let e=new Map([...this.lineMap]),r=1e4;this.addFacilityToLineMap(1*r,this.lift_priority*r,3e4*r,e),this.escalatorRoute=new zi.default(e)}initStraightLadderRoute(){let e=new Map([...this.lineMap]),r=1e4;this.addFacilityToLineMap(3*r,1*r,3e4*r,e),this.straightLadderRoute=new zi.default(e)}checkStart(e){return!(!e.floor||!e.nodeId&&(!e.coord||e.coord.length<2))}checkEnd(e){return e.facility?!0:this.checkStart(e)}transformStart(e){if(e.nodeId){let r=this.nodeMap.get(\`\${e.floor}\${oi}\${e.nodeId}\`);if(r){let[a,u]=r.split(oi);return{floor:a,id:u}}}if(e.coord?.length){let r=this.roadInfo.find(u=>u.floor===e.floor);if(!r)return null;let a=r.points.reduce((u,c)=>{let h=wo(e.coord,c.cds);return h<u.min&&(u.min=h,u.point=c),u},{min:1/0,point:r.points[0]});return{floor:a.point.floor,id:a.point.id}}return null}transformEnd(e){if(e.floor){let r=this.transformStart(e);if(r)return r}return e.facility&&this.facilityMap.get(e.facility)?.length?{floor:e.floor,facility:e.facility}:null}getPath(e,r,a=""){if(!this.checkStart(e))return"start-error";if(!this.checkEnd(r))return"end-error";let u=this.transformStart(e);if(!u)return"no-start";let c=this.transformEnd(r);if(!c)return"no-end";let h=this.getBasePath.bind(this);switch(a){case"escalator":h=this.getEscalatorPath.bind(this);break;case"straightLadder":h=this.getStraightLadderPath.bind(this);break;default:h=this.getBasePath.bind(this);break}if(c.id)return h(u,c);if(c.facility){let p=this.facilityMap.get(c.facility).filter(g=>c.floor?g.floor===c.floor:!0);if(!p.length)return null;let d=p.map(g=>h(u,{floor:g.floor,id:g.id})).filter(g=>!!g);return d.reduce((g,v)=>{let x=v.reduce((M,w)=>M+Ch(w.points),0);return x<g.distance&&(g.distance=x,g.path=v),g},{distance:1/0,path:d[0]}).path}}getRoutePath(e,r,a){let u=\`\${e.floor}\${oi}\${e.id}\`,c=\`\${r.floor}\${oi}\${r.id}\`,h=a.path(u,c);if(!h)return null;let p=[];return h.map(d=>{let g=this.pointMap.get(d);if(g){let{floor:v}=g;if(p[p.length-1]?.floor===v){let x=p[p.length-1];x.points.push(g.cds),x.endType=g.type,x.destId=g.nodeId,x.distance=Ch(x.points)}else p.push({floor:v,points:[g.cds],endType:g.type,destId:g.nodeId,distance:0})}}),p}getBasePath(e,r){return this.getRoutePath(e,r,this.baseRoute)}getEscalatorPath(e,r){return this.getRoutePath(e,r,this.escalatorRoute)}getStraightLadderPath(e,r){return this.getRoutePath(e,r,this.straightLadderRoute)}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 zi.default,this.escalatorRoute=new zi.default,this.straightLadderRoute=new zi.default}};var mS=ln(y0(),1);function gS(o,e,r){let a=f0(o,e,r);return 180-Math.abs(a)<15?"front":a>135?"right_front":a<-135?"left_front":a<=135&&a>=60?"right":a>=-135&&a<=-60?"left":a<60&&a>0?"right_back":a>-60&&a<0?"left_back":"front"}function v0(o){if(!o.length)return[];if(o.length===1)return[{direction:"start",distance:0,points:o}];let e=[{direction:"start",distance:wo(o[0],o[1]),points:[o[0],o[1]]}];for(let r=2;r<o.length;r++){let a=gS(o[r-2],o[r-1],o[r]);if(a==="front"){let u=e[e.length-1],c=wo(o[r-1],o[r]);u.distance+=c,r!==2&&u.points.push(o[r-1])}else e.push({direction:a,distance:wo(o[r-1],o[r]),points:[o[r-1],o[r]]})}return e.push({direction:"end",distance:0,points:[o[o.length-1]]}),e}function _0(o){return o.replace(/[A-Z]/g,e=>"_"+e.toLowerCase()).replace(/^_/,"")}function x0(o){let e={};for(let a in o)a.startsWith("on")&&(e[_0(a.slice(2))]=o[a]);let r=async({data:a})=>{if(e[a.type])try{let u=await e[a.type](a.data);self.postMessage({type:\`\${a.type}_result\`,key:a.key,data:u})}catch(u){self.postMessage({type:\`\${a.type}_result\`,key:a.key,error:u})}else self.postMessage({type:\`\${a.type}_result\`,key:a.key,error:"no_event"})};return self.addEventListener("message",r),()=>{self.removeEventListener("message",r)}}var Ih=new $u;x0({onSetRoadInfo({roadData:o}){Ih.initRoute(o)},onGetPath({start:o,end:e,type:r}){return Ih.getPath(o,e,r)},onGetDirectionPath(o){return v0(o)},onClear(){Ih.clear()}});
|
|
7227
|
-
`],{type:"text/javascript"}),e=URL.createObjectURL(r),t=new Worker(e);return URL.revokeObjectURL(e),t}var Du=class extends Bu.EventDispatcher{worker=Io();initRoadStatus=!1;constructor(){super()}async setRoadData(e){this.initRoadStatus=!1,this.dispatchEvent({type:"init-road-status",status:!1}),await nn(this.worker,"set_road_info",{roadData:e}),this.initRoadStatus=!0,this.dispatchEvent({type:"init-road-status",status:!0})}async getPath(e,t,n=""){return new Promise((i,o)=>{let a=()=>{nn(this.worker,"get_path",{start:e,end:t,type:n}).then(s=>{s?typeof s=="string"?o(s):i(s):o("no-path")})};if(this.initRoadStatus)a();else{let s=({status:u})=>{u&&(this.removeEventListener("init-road-status",s),a())};this.addEventListener("init-road-status",s)}})}getDirectionPath(e){return nn(this.worker,"get_direction_path",e)}async dispose(){nn(this.worker,"clear",""),this.worker.terminate()}};var Ru=X("three"),Ni=class extends Oe{startPoint;endPoint;rect;frustum=new Ru.Frustum;constructor(e){super(e);let{config:{selectBox:{fill:t,stroke:n}}}=e;this.rect=yn(n,t),this.svg.appendChild(this.rect),this.registryEvent()}setEnable(e){super.setEnable(e),fe(this.rect,0,0,0,0),e?this.registryEvent():(this.startPoint=void 0,this.unRegistryEvent())}onPointerDown=e=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(e);t&&(this.startPoint=t),this.endPoint=void 0};onPointerMove=e=>{if(!this.enable||!this.startPoint)return;let t=this.getIntersectByPointerEvent(e);t&&(this.endPoint=t)};onPointerUp=e=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(e);t&&(this.endPoint=t),this.doSelect(),this.startPoint=void 0};onUpdate=()=>{if(this.startPoint){let e=this.getSvgCoordinate(this.startPoint),t={...e};this.endPoint&&(t=this.getSvgCoordinate(this.endPoint));let n={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y)},i=Math.abs(t.x-e.x),o=Math.abs(t.y-e.y);fe(this.rect,n.x,n.y,i,o)}else fe(this.rect,0,0,0,0)};registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointermove",this.onPointerMove),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointermove",this.onPointerMove),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.removeEventListener("update",this.onUpdate)}doSelect(){if(this.startPoint&&this.endPoint){if(this.startPoint.distanceTo(this.endPoint)<.1)return;let{context:{camera:t,container:{clientWidth:n,clientHeight:i}}}=this,o=it(this.startPoint,t,n,i),a=it(this.endPoint,t,n,i),s={x:Math.min(o.x,a.x),y:Math.min(o.y,a.y)},u={x:Math.max(o.x,a.x),y:Math.max(o.y,a.y)},c=this.searchMapInFrustum(s,u);this.dispatchEvent({type:"selected",list:c})}}searchMapInFrustum(e,t){let{context:n}=this;return n.currentFloor?.graphicLayer.children.filter(i=>i instanceof te&&this.searchChildInFrustum(i,e,t))||[]}searchChildInFrustum(e,t,n){let{context:{camera:i,container:{clientWidth:o,clientHeight:a}}}=this;if(!e)return!1;if(!e.mesh){let p=e.getPosition();if(p){let d=it(p,i,o,a);return mn(d,t,n)}return!1}e.mesh.geometry.boundingBox||e.mesh.geometry.computeBoundingBox();let s=e.mesh.geometry.boundingBox;if(!s)return!1;let{min:u,max:c}=s,l=it(u,i,o,a),h=it(c,i,o,a);return!(!mn(l,t,n)||!mn(h,t,n))}dispose(){this.unRegistryEvent()}};var Dh={boxSelection:!1,elements:["graphic","poi"]},Nu=class extends Ue{options;_list=new Set;_poiList=new Set;boxSelection;prevPanStatus;prevRotateStatus;downPoint=null;isMultipleSelect=!1;constructor(e,t={}){super(e),this.options={...Dh,...t},this.boxSelection=new Ni(this.bmap.context),this.boxSelection.setEnable(!1),this.registryEvent()}get list(){return this._list}enableBoxSelection(){this.isMultipleSelect||!this.options.boxSelection||(this.isMultipleSelect=!0,this.boxSelection.setEnable(!0),this.prevPanStatus=this.bmap.context.control.enablePan,this.prevRotateStatus=this.bmap.context.control.enableRotate,this.bmap.context.control.enablePan=!1,this.bmap.context.control.enableRotate=!1)}disableBoxSelection(){this.isMultipleSelect&&(this.isMultipleSelect=!1,this.boxSelection.setEnable(!1),this.bmap.context.control.enablePan=!!this.prevPanStatus,this.bmap.context.control.enableRotate=!!this.prevRotateStatus)}onPointerDown=e=>{this.downPoint={x:e.offsetX,y:e.offsetY}};onPointerUp=e=>{if(!this.downPoint)return;let{offsetX:t,offsetY:n}=e,{x:i,y:o}=this.downPoint;if(Math.sqrt((i-t)**2+(o-n)**2)>3)return;let a=new Set,s=[],u=[];if(this.options.elements.includes("graphic")){let{graphics:c}=this.bmap.context.getGraphicsByDeviceXy(t,n);c.map(l=>a.add(l.options.id)),s.push(...c)}if(this.options.elements.includes("poi")){let c=this.bmap.context.getPoisByDeviceXy(t,n);u.push(...c),c.forEach(l=>{if(!a.has(l.options.id)){let h=this.bmap.context.currentFloor?.graphicLayer.graphicMap.get(l.options.id)||null;h&&(a.add(l.options.id),s.push(h))}})}(!this.options.boxSelection||!(Qn?e.metaKey:e.ctrlKey))&&(this._list.clear(),this._poiList.clear()),s.forEach(c=>this._list.add(c)),u.forEach(c=>this._poiList.add(c)),this.selectEnd(),this.downPoint=null};onPointerOut=e=>{this.disableBoxSelection()};onKeyDown=e=>{Wn(e.key)&&this.enableBoxSelection()};onKeyUp=e=>{Wn(e.key)&&this.disableBoxSelection()};onBoxSelected=({list:e})=>{this._list.clear(),this._poiList.clear(),e.forEach(t=>{if(this.options.elements.includes("graphic")&&this._list.add(t),this.options.elements.includes("poi")){let n=this.bmap.getPoiById(t.options.id);n&&this._poiList.add(n)}}),this.selectEnd()};selectEnd(){this.dispatchEvent({type:"select",graphics:[...this._list],pois:[...this._poiList],isMultipleSelect:this.isMultipleSelect})}registryEvent(){this.bmap.context.container.addEventListener("pointerdown",this.onPointerDown),this.bmap.context.container.addEventListener("pointerup",this.onPointerUp),this.bmap.context.container.addEventListener("pointerout",this.onPointerOut),this.bmap.context.container.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.boxSelection.addEventListener("selected",this.onBoxSelected)}unRegistryEvent(){this.bmap.context.container.removeEventListener("pointerdown",this.onPointerDown),this.bmap.context.container.removeEventListener("pointerup",this.onPointerUp),this.bmap.context.container.removeEventListener("pointerout",this.onPointerOut),this.bmap.context.container.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp),this.boxSelection.removeEventListener("selected",this.onBoxSelected)}clear(){this._list.clear()}remove(e){this._list.delete(e)}dispose(){this.unRegistryEvent()}};var be=X("lodash");var Lu=X("three");var Bh={time:1e3,elements:["compass","deviceMotion","acceleration","gps"]},Li=class extends Lu.EventDispatcher{options;gpsTimer=null;data=[];timer=new oe;dispatchTimer=null;constructor(e={}){super(),this.options={...Bh,...e}}start(){this.options.elements.some(e=>["deviceMotion","compass"].includes(e))&&this.listenDeviceOrientation(),this.options.elements.includes("acceleration")&&this.listenAcceleration(),this.options.elements.includes("gps")&&this.listenGps(),this.dispatchEvent({type:"start"}),this.dispatchTimer=this.timer.setInterval(()=>{this.dispatchEvent({type:"sensor-data",data:(0,be.cloneDeep)(this.data)}),this.data=[]},this.options.time)}addDataItem(e){this.data.push(e),this.dispatchEvent({type:"add-data-item",item:e})}addAcceleration=(0,be.throttle)(e=>{this.addDataItem(e)},20);deviceOrientationAbsHandler=(0,be.throttle)(e=>{let t=Date.now(),{alpha:n,beta:i,gamma:o}=e;if((0,be.isNil)(n)||(0,be.isNil)(i)||(0,be.isNil)(o))return;let a;Sr?a=e.webkitCompassHeading:a=360-n,this.options.elements.includes("deviceMotion")&&this.addDataItem({type:"deviceMotion",timestamp:t,res:[n,i,o]}),this.options.elements.includes("compass")&&this.addDataItem({type:"compass",timestamp:t,res:a})},200);listenDeviceOrientation(){Sr?window.addEventListener("deviceorientation",this.deviceOrientationAbsHandler,!1):window.addEventListener("deviceorientationabsolute",this.deviceOrientationAbsHandler,{absolute:!0})}handleAcceleration=e=>{let t=e.accelerationIncludingGravity;(0,be.isNil)(t)||(0,be.isNil)(t.x)||(0,be.isNil)(t.y)||(0,be.isNil)(t.z)||this.addAcceleration({type:"acceleration",timestamp:Date.now(),res:[t.x,t.y,t.z]})};listenAcceleration(){window.addEventListener("devicemotion",this.handleAcceleration,!1)}listenGps(){this.gpsTimer=navigator.geolocation.watchPosition(e=>{console.log("position",e),this.addDataItem({type:"gps",timestamp:Date.now(),res:[e.coords.longitude,e.coords.latitude,e.coords.accuracy]})})}async checkSensor(){return{deviceOrientation:await this.checkDeviceOrientation()}}async checkDeviceOrientation(){if(!Sr)return!0;if(typeof window.DeviceOrientationEvent<"u"&&typeof window.DeviceOrientationEvent?.requestPermission=="function")try{return await window.DeviceOrientationEvent?.requestPermission()==="granted"}catch{return!1}return!1}stop(){window.removeEventListener("devicemotion",this.handleAcceleration,!1),Sr?window.removeEventListener("deviceorientation",this.deviceOrientationAbsHandler,!1):window.removeEventListener("deviceorientationabsolute",this.deviceOrientationAbsHandler,{absolute:!0}),(0,be.isNil)(this.gpsTimer)||navigator.geolocation.clearWatch(this.gpsTimer),this.dispatchTimer&&this.timer.clearInterval(this.dispatchTimer),this.data=[],this.dispatchEvent({type:"stop"})}};var ul=X("three");function Oi(r,e){return 1/Math.sqrt(2*Math.PI*Math.pow(e,2))*Math.exp(-Math.pow(r,2)/(2*Math.pow(e,2)))}function Pr(r){return(r+360)%360}function Ou(r,e){let n=6378137*r*Math.PI/180,i=6378137*Math.log(Math.tan(Math.PI/4+e*Math.PI/180/2));return{x:n,y:i}}function nr(r,e,t,n){return Math.sqrt(Math.pow(Math.abs(r-t),2)+Math.pow(Math.abs(e-n),2))}function rr(){return rr=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},rr.apply(null,arguments)}var Mo={relTol:1e-12,absTol:1e-15,matrix:"Matrix",number:"number",numberFallback:"number",precision:64,predictable:!1,randomSeed:null};function Fu(r,e){if(Dr(r,e))return r[e];throw typeof r[e]=="function"&&Rh(r,e)?new Error('Cannot access method "'+e+'" as a property'):new Error('No access to property "'+e+'"')}function Uu(r,e,t){if(Dr(r,e))return r[e]=t,t;throw new Error('No access to property "'+e+'"')}function Dr(r,e){return!Nh(r)&&!Array.isArray(r)?!1:ir(Lh,e)?!0:!(e in Object.prototype||e in Function.prototype)}function Rh(r,e){return r==null||typeof r[e]!="function"||ir(r,e)&&Object.getPrototypeOf&&e in Object.getPrototypeOf(r)?!1:ir(Oh,e)?!0:!(e in Object.prototype||e in Function.prototype)}function Nh(r){return typeof r=="object"&&r&&r.constructor===Object}var Lh={length:!0,name:!0},Oh={toString:!0,valueOf:!0,toLocaleString:!0};var Fi=class{constructor(e){this.wrappedObject=e,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).filter(e=>this.has(e)).values()}get(e){return Fu(this.wrappedObject,e)}set(e,t){return Uu(this.wrappedObject,e,t),this}has(e){return Dr(this.wrappedObject,e)&&e in this.wrappedObject}entries(){return Fh(this.keys(),e=>[e,this.get(e)])}forEach(e){for(var t of this.keys())e(this.get(t),t,this)}delete(e){Dr(this.wrappedObject,e)&&delete this.wrappedObject[e]}clear(){for(var e of this.keys())this.delete(e)}get size(){return Object.keys(this.wrappedObject).length}};function Fh(r,e){return{next:()=>{var t=r.next();return t.done?t:{value:e(t.value),done:!1}}}}function lt(r){return typeof r=="number"}function pt(r){return!r||typeof r!="object"||typeof r.constructor!="function"?!1:r.isBigNumber===!0&&typeof r.constructor.prototype=="object"&&r.constructor.prototype.isBigNumber===!0||typeof r.constructor.isDecimal=="function"&&r.constructor.isDecimal(r)===!0}function $u(r){return typeof r=="bigint"}function To(r){return r&&typeof r=="object"&&Object.getPrototypeOf(r).isComplex===!0||!1}function Po(r){return r&&typeof r=="object"&&Object.getPrototypeOf(r).isFraction===!0||!1}function Ui(r){return r&&r.constructor.prototype.isUnit===!0||!1}function ye(r){return typeof r=="string"}var Nt=Array.isArray;function vt(r){return r&&r.constructor.prototype.isMatrix===!0||!1}function cn(r){return Array.isArray(r)||vt(r)}function zu(r){return r&&r.isDenseMatrix&&r.constructor.prototype.isMatrix===!0||!1}function ku(r){return r&&r.isSparseMatrix&&r.constructor.prototype.isMatrix===!0||!1}function Gu(r){return r&&r.constructor.prototype.isRange===!0||!1}function or(r){return r&&r.constructor.prototype.isIndex===!0||!1}function Vu(r){return typeof r=="boolean"}function Xu(r){return r&&r.constructor.prototype.isResultSet===!0||!1}function Hu(r){return r&&r.constructor.prototype.isHelp===!0||!1}function ju(r){return typeof r=="function"}function qu(r){return r instanceof Date}function Qu(r){return r instanceof RegExp}function ar(r){return!!(r&&typeof r=="object"&&r.constructor===Object&&!To(r)&&!Po(r))}function Wu(r){return r?r instanceof Map||r instanceof Fi||typeof r.set=="function"&&typeof r.get=="function"&&typeof r.keys=="function"&&typeof r.has=="function":!1}function Ku(r){return r===null}function Yu(r){return r===void 0}function Ju(r){return r&&r.isAccessorNode===!0&&r.constructor.prototype.isNode===!0||!1}function Zu(r){return r&&r.isArrayNode===!0&&r.constructor.prototype.isNode===!0||!1}function t0(r){return r&&r.isAssignmentNode===!0&&r.constructor.prototype.isNode===!0||!1}function e0(r){return r&&r.isBlockNode===!0&&r.constructor.prototype.isNode===!0||!1}function n0(r){return r&&r.isConditionalNode===!0&&r.constructor.prototype.isNode===!0||!1}function r0(r){return r&&r.isConstantNode===!0&&r.constructor.prototype.isNode===!0||!1}function i0(r){return r&&r.isFunctionAssignmentNode===!0&&r.constructor.prototype.isNode===!0||!1}function o0(r){return r&&r.isFunctionNode===!0&&r.constructor.prototype.isNode===!0||!1}function a0(r){return r&&r.isIndexNode===!0&&r.constructor.prototype.isNode===!0||!1}function s0(r){return r&&r.isNode===!0&&r.constructor.prototype.isNode===!0||!1}function u0(r){return r&&r.isObjectNode===!0&&r.constructor.prototype.isNode===!0||!1}function c0(r){return r&&r.isOperatorNode===!0&&r.constructor.prototype.isNode===!0||!1}function l0(r){return r&&r.isParenthesisNode===!0&&r.constructor.prototype.isNode===!0||!1}function h0(r){return r&&r.isRangeNode===!0&&r.constructor.prototype.isNode===!0||!1}function p0(r){return r&&r.isRelationalNode===!0&&r.constructor.prototype.isNode===!0||!1}function f0(r){return r&&r.isSymbolNode===!0&&r.constructor.prototype.isNode===!0||!1}function d0(r){return r&&r.constructor.prototype.isChain===!0||!1}function ce(r){var e=typeof r;return e==="object"?r===null?"null":pt(r)?"BigNumber":r.constructor&&r.constructor.name?r.constructor.name:"Object":e}function wt(r){var e=typeof r;if(e==="number"||e==="bigint"||e==="string"||e==="boolean"||r===null||r===void 0)return r;if(typeof r.clone=="function")return r.clone();if(Array.isArray(r))return r.map(function(t){return wt(t)});if(r instanceof Date)return new Date(r.valueOf());if(pt(r))return r;if(ar(r))return Uh(r,wt);throw new TypeError("Cannot clone: unknown type of value (value: ".concat(r,")"))}function Uh(r,e){var t={};for(var n in r)ir(r,n)&&(t[n]=e(r[n]));return t}function $i(r,e){for(var t in e)ir(e,t)&&(r[t]=e[t]);return r}function ze(r,e){var t,n,i;if(Array.isArray(r)){if(!Array.isArray(e)||r.length!==e.length)return!1;for(n=0,i=r.length;n<i;n++)if(!ze(r[n],e[n]))return!1;return!0}else{if(typeof r=="function")return r===e;if(r instanceof Object){if(Array.isArray(e)||!(e instanceof Object))return!1;for(t in r)if(!(t in e)||!ze(r[t],e[t]))return!1;for(t in e)if(!(t in r))return!1;return!0}else return r===e}}function ir(r,e){return r&&Object.hasOwnProperty.call(r,e)}function m0(r,e){for(var t={},n=0;n<e.length;n++){var i=e[n],o=r[i];o!==void 0&&(t[i]=o)}return t}var g0=["Matrix","Array"],y0=["number","BigNumber","Fraction"];var ke=function(e){if(e)throw new Error(`The global config is readonly.
|
|
7227
|
+
`],{type:"text/javascript"}),e=URL.createObjectURL(r),t=new Worker(e);return URL.revokeObjectURL(e),t}var Du=class extends Bu.EventDispatcher{worker=Io();initRoadStatus=!1;constructor(){super()}async setRoadData(e){this.initRoadStatus=!1,this.dispatchEvent({type:"init-road-status",status:!1}),await nn(this.worker,"set_road_info",{roadData:e}),this.initRoadStatus=!0,this.dispatchEvent({type:"init-road-status",status:!0})}async getPath(e,t,n=""){return new Promise((i,o)=>{let a=()=>{nn(this.worker,"get_path",{start:e,end:t,type:n}).then(s=>{s?typeof s=="string"?o(s):i(s):o("no-path")})};if(this.initRoadStatus)a();else{let s=({status:u})=>{u&&(this.removeEventListener("init-road-status",s),a())};this.addEventListener("init-road-status",s)}})}getDirectionPath(e){return nn(this.worker,"get_direction_path",e)}async dispose(){nn(this.worker,"clear",""),this.worker.terminate()}};var Ru=X("three"),Ni=class extends Oe{startPoint;endPoint;rect;frustum=new Ru.Frustum;constructor(e){super(e);let{config:{selectBox:{fill:t,stroke:n}}}=e;this.rect=yn(n,t),this.svg.appendChild(this.rect),this.registryEvent()}setEnable(e){super.setEnable(e),fe(this.rect,0,0,0,0),e?this.registryEvent():(this.startPoint=void 0,this.unRegistryEvent())}onPointerDown=e=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(e);t&&(this.startPoint=t),this.endPoint=void 0};onPointerMove=e=>{if(!this.enable||!this.startPoint)return;let t=this.getIntersectByPointerEvent(e);t&&(this.endPoint=t)};onPointerUp=e=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(e);t&&(this.endPoint=t),this.doSelect(),this.startPoint=void 0};onUpdate=()=>{if(this.startPoint){let e=this.getSvgCoordinate(this.startPoint),t={...e};this.endPoint&&(t=this.getSvgCoordinate(this.endPoint));let n={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y)},i=Math.abs(t.x-e.x),o=Math.abs(t.y-e.y);fe(this.rect,n.x,n.y,i,o)}else fe(this.rect,0,0,0,0)};registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointermove",this.onPointerMove),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointermove",this.onPointerMove),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.removeEventListener("update",this.onUpdate)}doSelect(){if(this.startPoint&&this.endPoint){if(this.startPoint.distanceTo(this.endPoint)<.1)return;let{context:{camera:t,container:{clientWidth:n,clientHeight:i}}}=this,o=it(this.startPoint,t,n,i),a=it(this.endPoint,t,n,i),s={x:Math.min(o.x,a.x),y:Math.min(o.y,a.y)},u={x:Math.max(o.x,a.x),y:Math.max(o.y,a.y)},c=this.searchMapInFrustum(s,u);this.dispatchEvent({type:"selected",list:c})}}searchMapInFrustum(e,t){let{context:n}=this;return n.currentFloor?.graphicLayer.children.filter(i=>i instanceof te&&this.searchChildInFrustum(i,e,t))||[]}searchChildInFrustum(e,t,n){let{context:{camera:i,container:{clientWidth:o,clientHeight:a}}}=this;if(!e)return!1;if(!e.mesh){let p=e.getPosition();if(p){let d=it(p,i,o,a);return mn(d,t,n)}return!1}e.mesh.geometry.boundingBox||e.mesh.geometry.computeBoundingBox();let s=e.mesh.geometry.boundingBox;if(!s)return!1;let{min:u,max:c}=s,l=it(u,i,o,a),h=it(c,i,o,a);return!(!mn(l,t,n)||!mn(h,t,n))}dispose(){this.unRegistryEvent()}};var Dh={boxSelection:!1,elements:["graphic","poi"]},Nu=class extends Ue{options;_list=new Set;_poiList=new Set;boxSelection;prevPanStatus;prevRotateStatus;downPoint=null;isMultipleSelect=!1;constructor(e,t={}){super(e),this.options={...Dh,...t},this.boxSelection=new Ni(this.bmap.context),this.boxSelection.setEnable(!1),this.registryEvent()}get list(){return this._list}enableBoxSelection(){this.isMultipleSelect||!this.options.boxSelection||(this.isMultipleSelect=!0,this.boxSelection.setEnable(!0),this.prevPanStatus=this.bmap.context.control.enablePan,this.prevRotateStatus=this.bmap.context.control.enableRotate,this.bmap.context.control.enablePan=!1,this.bmap.context.control.enableRotate=!1)}disableBoxSelection(){this.isMultipleSelect&&(this.isMultipleSelect=!1,this.boxSelection.setEnable(!1),this.bmap.context.control.enablePan=!!this.prevPanStatus,this.bmap.context.control.enableRotate=!!this.prevRotateStatus)}onPointerDown=e=>{this.downPoint={x:e.offsetX,y:e.offsetY}};onPointerUp=e=>{if(!this.downPoint)return;let{offsetX:t,offsetY:n}=e,{x:i,y:o}=this.downPoint;if(Math.sqrt((i-t)**2+(o-n)**2)>3)return;let a=new Set,s=[],u=[];if(this.options.elements.includes("graphic")){let{graphics:c}=this.bmap.context.getGraphicsByDeviceXy(t,n);c.map(l=>a.add(l.options.id)),s.push(...c)}if(this.options.elements.includes("poi")){let c=this.bmap.context.getPoisByDeviceXy(t,n);u.push(...c),c.forEach(l=>{if(!a.has(l.options.id)){let h=this.bmap.context.currentFloor?.graphicLayer.graphicMap.get(l.options.id)||null;h&&(a.add(l.options.id),s.push(h))}})}(!this.options.boxSelection||!(Qn?e.metaKey:e.ctrlKey))&&(this._list.clear(),this._poiList.clear()),s.forEach(c=>this._list.add(c)),u.forEach(c=>this._poiList.add(c)),this.selectEnd(),this.downPoint=null};onPointerOut=e=>{this.disableBoxSelection()};onKeyDown=e=>{Wn(e.key)&&this.enableBoxSelection()};onKeyUp=e=>{Wn(e.key)&&this.disableBoxSelection()};onBoxSelected=({list:e})=>{this._list.clear(),this._poiList.clear(),e.forEach(t=>{if(this.options.elements.includes("graphic")&&this._list.add(t),this.options.elements.includes("poi")){let n=this.bmap.getPoiById(t.options.id);n&&this._poiList.add(n)}}),this.selectEnd()};selectEnd(){this.dispatchEvent({type:"select",graphics:[...this._list],pois:[...this._poiList],isMultipleSelect:this.isMultipleSelect})}registryEvent(){this.bmap.context.container.addEventListener("pointerdown",this.onPointerDown),this.bmap.context.container.addEventListener("pointerup",this.onPointerUp),this.bmap.context.container.addEventListener("pointerout",this.onPointerOut),this.bmap.context.container.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.boxSelection.addEventListener("selected",this.onBoxSelected)}unRegistryEvent(){this.bmap.context.container.removeEventListener("pointerdown",this.onPointerDown),this.bmap.context.container.removeEventListener("pointerup",this.onPointerUp),this.bmap.context.container.removeEventListener("pointerout",this.onPointerOut),this.bmap.context.container.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp),this.boxSelection.removeEventListener("selected",this.onBoxSelected)}clear(){this._list.clear()}remove(e){this._list.delete(e)}dispose(){this.unRegistryEvent()}};var be=X("lodash");var Lu=X("three");var Bh={time:1e3,elements:["compass","deviceMotion","acceleration","gps"]},Li=class extends Lu.EventDispatcher{options;gpsTimer=null;data=[];timer=new oe;dispatchTimer=null;constructor(e={}){super(),this.options={...Bh,...e}}start(){this.options.elements.some(e=>["deviceMotion","compass"].includes(e))&&this.listenDeviceOrientation(),this.options.elements.includes("acceleration")&&this.listenAcceleration(),this.options.elements.includes("gps")&&this.listenGps(),this.dispatchEvent({type:"start"}),this.dispatchTimer=this.timer.setInterval(()=>{this.dispatchEvent({type:"sensor-data",data:(0,be.cloneDeep)(this.data)}),this.data=[]},this.options.time)}addDataItem(e){this.data.push(e),this.dispatchEvent({type:"add-data-item",item:e})}addAcceleration=(0,be.throttle)(e=>{this.addDataItem(e)},20);deviceOrientationAbsHandler=(0,be.throttle)(e=>{let t=Date.now(),{alpha:n,beta:i,gamma:o}=e;if((0,be.isNil)(n)||(0,be.isNil)(i)||(0,be.isNil)(o))return;let a;Sr?a=e.webkitCompassHeading:a=360-n,this.options.elements.includes("deviceMotion")&&this.addDataItem({type:"deviceMotion",timestamp:t,res:[n,i,o]}),this.options.elements.includes("compass")&&this.addDataItem({type:"compass",timestamp:t,res:a})},200);listenDeviceOrientation(){Sr?window.addEventListener("deviceorientation",this.deviceOrientationAbsHandler,!1):window.addEventListener("deviceorientationabsolute",this.deviceOrientationAbsHandler,{absolute:!0})}handleAcceleration=e=>{let t=e.accelerationIncludingGravity;(0,be.isNil)(t)||(0,be.isNil)(t.x)||(0,be.isNil)(t.y)||(0,be.isNil)(t.z)||this.addAcceleration({type:"acceleration",timestamp:Date.now(),res:[t.x,t.y,t.z]})};listenAcceleration(){window.addEventListener("devicemotion",this.handleAcceleration,!1)}listenGps(){this.gpsTimer=navigator.geolocation.watchPosition(e=>{console.log("position",e),this.addDataItem({type:"gps",timestamp:Date.now(),res:[e.coords.longitude,e.coords.latitude,e.coords.accuracy]})},()=>{},{enableHighAccuracy:!0})}async checkSensor(){return{deviceOrientation:await this.checkDeviceOrientation()}}async checkDeviceOrientation(){if(!Sr)return!0;if(typeof window.DeviceOrientationEvent<"u"&&typeof window.DeviceOrientationEvent?.requestPermission=="function")try{return await window.DeviceOrientationEvent?.requestPermission()==="granted"}catch{return!1}return!1}stop(){window.removeEventListener("devicemotion",this.handleAcceleration,!1),Sr?window.removeEventListener("deviceorientation",this.deviceOrientationAbsHandler,!1):window.removeEventListener("deviceorientationabsolute",this.deviceOrientationAbsHandler,{absolute:!0}),(0,be.isNil)(this.gpsTimer)||navigator.geolocation.clearWatch(this.gpsTimer),this.dispatchTimer&&this.timer.clearInterval(this.dispatchTimer),this.data=[],this.dispatchEvent({type:"stop"})}};var ul=X("three");function Oi(r,e){return 1/Math.sqrt(2*Math.PI*Math.pow(e,2))*Math.exp(-Math.pow(r,2)/(2*Math.pow(e,2)))}function Pr(r){return(r+360)%360}function Ou(r,e){let n=6378137*r*Math.PI/180,i=6378137*Math.log(Math.tan(Math.PI/4+e*Math.PI/180/2));return{x:n,y:i}}function nr(r,e,t,n){return Math.sqrt(Math.pow(Math.abs(r-t),2)+Math.pow(Math.abs(e-n),2))}function rr(){return rr=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},rr.apply(null,arguments)}var Mo={relTol:1e-12,absTol:1e-15,matrix:"Matrix",number:"number",numberFallback:"number",precision:64,predictable:!1,randomSeed:null};function Fu(r,e){if(Dr(r,e))return r[e];throw typeof r[e]=="function"&&Rh(r,e)?new Error('Cannot access method "'+e+'" as a property'):new Error('No access to property "'+e+'"')}function Uu(r,e,t){if(Dr(r,e))return r[e]=t,t;throw new Error('No access to property "'+e+'"')}function Dr(r,e){return!Nh(r)&&!Array.isArray(r)?!1:ir(Lh,e)?!0:!(e in Object.prototype||e in Function.prototype)}function Rh(r,e){return r==null||typeof r[e]!="function"||ir(r,e)&&Object.getPrototypeOf&&e in Object.getPrototypeOf(r)?!1:ir(Oh,e)?!0:!(e in Object.prototype||e in Function.prototype)}function Nh(r){return typeof r=="object"&&r&&r.constructor===Object}var Lh={length:!0,name:!0},Oh={toString:!0,valueOf:!0,toLocaleString:!0};var Fi=class{constructor(e){this.wrappedObject=e,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).filter(e=>this.has(e)).values()}get(e){return Fu(this.wrappedObject,e)}set(e,t){return Uu(this.wrappedObject,e,t),this}has(e){return Dr(this.wrappedObject,e)&&e in this.wrappedObject}entries(){return Fh(this.keys(),e=>[e,this.get(e)])}forEach(e){for(var t of this.keys())e(this.get(t),t,this)}delete(e){Dr(this.wrappedObject,e)&&delete this.wrappedObject[e]}clear(){for(var e of this.keys())this.delete(e)}get size(){return Object.keys(this.wrappedObject).length}};function Fh(r,e){return{next:()=>{var t=r.next();return t.done?t:{value:e(t.value),done:!1}}}}function lt(r){return typeof r=="number"}function pt(r){return!r||typeof r!="object"||typeof r.constructor!="function"?!1:r.isBigNumber===!0&&typeof r.constructor.prototype=="object"&&r.constructor.prototype.isBigNumber===!0||typeof r.constructor.isDecimal=="function"&&r.constructor.isDecimal(r)===!0}function $u(r){return typeof r=="bigint"}function To(r){return r&&typeof r=="object"&&Object.getPrototypeOf(r).isComplex===!0||!1}function Po(r){return r&&typeof r=="object"&&Object.getPrototypeOf(r).isFraction===!0||!1}function Ui(r){return r&&r.constructor.prototype.isUnit===!0||!1}function ye(r){return typeof r=="string"}var Nt=Array.isArray;function vt(r){return r&&r.constructor.prototype.isMatrix===!0||!1}function cn(r){return Array.isArray(r)||vt(r)}function zu(r){return r&&r.isDenseMatrix&&r.constructor.prototype.isMatrix===!0||!1}function ku(r){return r&&r.isSparseMatrix&&r.constructor.prototype.isMatrix===!0||!1}function Gu(r){return r&&r.constructor.prototype.isRange===!0||!1}function or(r){return r&&r.constructor.prototype.isIndex===!0||!1}function Vu(r){return typeof r=="boolean"}function Xu(r){return r&&r.constructor.prototype.isResultSet===!0||!1}function Hu(r){return r&&r.constructor.prototype.isHelp===!0||!1}function ju(r){return typeof r=="function"}function qu(r){return r instanceof Date}function Qu(r){return r instanceof RegExp}function ar(r){return!!(r&&typeof r=="object"&&r.constructor===Object&&!To(r)&&!Po(r))}function Wu(r){return r?r instanceof Map||r instanceof Fi||typeof r.set=="function"&&typeof r.get=="function"&&typeof r.keys=="function"&&typeof r.has=="function":!1}function Ku(r){return r===null}function Yu(r){return r===void 0}function Ju(r){return r&&r.isAccessorNode===!0&&r.constructor.prototype.isNode===!0||!1}function Zu(r){return r&&r.isArrayNode===!0&&r.constructor.prototype.isNode===!0||!1}function t0(r){return r&&r.isAssignmentNode===!0&&r.constructor.prototype.isNode===!0||!1}function e0(r){return r&&r.isBlockNode===!0&&r.constructor.prototype.isNode===!0||!1}function n0(r){return r&&r.isConditionalNode===!0&&r.constructor.prototype.isNode===!0||!1}function r0(r){return r&&r.isConstantNode===!0&&r.constructor.prototype.isNode===!0||!1}function i0(r){return r&&r.isFunctionAssignmentNode===!0&&r.constructor.prototype.isNode===!0||!1}function o0(r){return r&&r.isFunctionNode===!0&&r.constructor.prototype.isNode===!0||!1}function a0(r){return r&&r.isIndexNode===!0&&r.constructor.prototype.isNode===!0||!1}function s0(r){return r&&r.isNode===!0&&r.constructor.prototype.isNode===!0||!1}function u0(r){return r&&r.isObjectNode===!0&&r.constructor.prototype.isNode===!0||!1}function c0(r){return r&&r.isOperatorNode===!0&&r.constructor.prototype.isNode===!0||!1}function l0(r){return r&&r.isParenthesisNode===!0&&r.constructor.prototype.isNode===!0||!1}function h0(r){return r&&r.isRangeNode===!0&&r.constructor.prototype.isNode===!0||!1}function p0(r){return r&&r.isRelationalNode===!0&&r.constructor.prototype.isNode===!0||!1}function f0(r){return r&&r.isSymbolNode===!0&&r.constructor.prototype.isNode===!0||!1}function d0(r){return r&&r.constructor.prototype.isChain===!0||!1}function ce(r){var e=typeof r;return e==="object"?r===null?"null":pt(r)?"BigNumber":r.constructor&&r.constructor.name?r.constructor.name:"Object":e}function wt(r){var e=typeof r;if(e==="number"||e==="bigint"||e==="string"||e==="boolean"||r===null||r===void 0)return r;if(typeof r.clone=="function")return r.clone();if(Array.isArray(r))return r.map(function(t){return wt(t)});if(r instanceof Date)return new Date(r.valueOf());if(pt(r))return r;if(ar(r))return Uh(r,wt);throw new TypeError("Cannot clone: unknown type of value (value: ".concat(r,")"))}function Uh(r,e){var t={};for(var n in r)ir(r,n)&&(t[n]=e(r[n]));return t}function $i(r,e){for(var t in e)ir(e,t)&&(r[t]=e[t]);return r}function ze(r,e){var t,n,i;if(Array.isArray(r)){if(!Array.isArray(e)||r.length!==e.length)return!1;for(n=0,i=r.length;n<i;n++)if(!ze(r[n],e[n]))return!1;return!0}else{if(typeof r=="function")return r===e;if(r instanceof Object){if(Array.isArray(e)||!(e instanceof Object))return!1;for(t in r)if(!(t in e)||!ze(r[t],e[t]))return!1;for(t in e)if(!(t in r))return!1;return!0}else return r===e}}function ir(r,e){return r&&Object.hasOwnProperty.call(r,e)}function m0(r,e){for(var t={},n=0;n<e.length;n++){var i=e[n],o=r[i];o!==void 0&&(t[i]=o)}return t}var g0=["Matrix","Array"],y0=["number","BigNumber","Fraction"];var ke=function(e){if(e)throw new Error(`The global config is readonly.
|
|
7228
7228
|
Please create a mathjs instance if you want to change the default configuration.
|
|
7229
7229
|
Example:
|
|
7230
7230
|
|