earthsdk3 3.4.0-beta.5 → 3.4.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  var EarthSDK3=function(N,d){"use strict";var WI=Object.defineProperty;var HI=(N,d,Xl)=>d in N?WI(N,d,{enumerable:!0,configurable:!0,writable:!0,value:Xl}):N[d]=Xl;var p=(N,d,Xl)=>HI(N,typeof d!="symbol"?d+"":d,Xl);class Xl extends d.Destroyable{constructor(){super(...arguments);p(this,"registerEngines",{})}register(e,i,n){const s=this.registerEngines[e]||new Map;s.has(i)&&console.warn(`register warn:${e}中${i}的实现类已经被注册,再次注册会覆盖。`),s.set(i,n),this.registerEngines[e]=s}getEngineObjConstructor(e,i){const s=(this.registerEngines[i]||new Map).get(e);if(s)return s;console.warn(`未找到${e}在${i}中对应的实现类!`)}createEngineObject(e,i){const n=this.getEngineObjConstructor(e.typeName,i.typeName);if(n){const s=new n(e,i);return s.createdEvent.emit(),s}else{const s=new Aa(e,i);return s.createdEvent.emit(),s}}}class fv extends d.Destroyable{constructor(){super(...arguments);p(this,"registerEngines",{})}register(e,i,n){const s=this.registerEngines[e]||new Map;s.has(i)&&console.warn(`register warn:${e}中${i}的实现类已经被注册,再次注册会覆盖。`),s.set(i,n),this.registerEngines[e]=s}getEngineObjConstructor(e,i){const s=(this.registerEngines[i]||new Map).get(e);if(s)return s;console.warn(`未找到${e}在${i}中对应的实现类!`)}createEngineObject(e,i){const n=this.getEngineObjConstructor(e.typeName,i.typeName);if(n){const s=new n(e,i);return s.createdEvent.emit(),s}else{const s=new Aa(e,i);return s.createdEvent.emit(),s}}}const nn=class nn extends d.Destroyable{constructor(e,i,n=!1){super();p(this,"_createdEvent",this.dv(new d.Event));p(this,"_id",++nn._accumId);this._sceneObject=e,this._viewer=i;{if(n)return;e.viewer=i,e.viewerChanged.emit(i);const s=(a,o)=>{for(let l of a)this._viewer.delete(l);for(let l of o)this._viewer.add(l)};s([],this._sceneObject.components.values()),this.d(this._sceneObject.components.toChange.don(s)),this.d(()=>s(this._sceneObject.components.values(),[]))}}get createdEvent(){return this._createdEvent}get sceneObject(){return this._sceneObject}get viewer(){return this._viewer}get id(){return this._id}};p(nn,"context",new Xl),p(nn,"contextEditing",new fv),p(nn,"register",nn.context.register.bind(nn.context)),p(nn,"registerEditing",nn.contextEditing.register.bind(nn.contextEditing)),p(nn,"_accumId",-1);let Aa=nn;const nf=class nf extends d.Destroyable{constructor(e,i){super();p(this,"_id",++nf._accumId);this._name=e,this._description=i}get id(){return this._id}get name(){return this._name}get description(){return this._description}};p(nf,"_accumId",-1);let Js=nf;class gf extends Js{constructor(t,e,i,n,s){super(t,e),this._withUndefined=i,this._readonly=n,this._defaultValue=s}get withUndefined(){return this._withUndefined}get readonly(){return this._readonly}get defaultValue(){return this._defaultValue instanceof Function?this._defaultValue():this._defaultValue}}class Rt extends gf{constructor(t,e,i,n,s,a){super(t,e,i,n,a),this._reactVar=s}get reactVar(){return this._reactVar}}class U extends Rt{get type(){return"BooleanProperty"}}class nt extends Rt{get type(){return"StringProperty"}}class C extends Rt{get type(){return"NumberProperty"}}class dv extends Rt{get type(){return"MaximumScreenSpaceErrorProperty"}}class np extends Rt{get type(){return"StringsProperty"}}class pv extends Rt{get type(){return"NumbersProperty"}}class gv extends Rt{get type(){return"BooleansProperty"}}class mv extends Rt{get type(){return"String2Property"}}class vv extends Rt{get type(){return"String3Property"}}class yv extends Rt{get type(){return"String4Property"}}class sp extends Rt{get type(){return"String2sProperty"}}class _v extends Rt{get type(){return"String3sProperty"}}class wv extends Rt{get type(){return"String4sProperty"}}class se extends Rt{get type(){return"Number2Property"}}class Qe extends Rt{get type(){return"Number3Property"}}class Lr extends Rt{get type(){return"Number4Property"}}class Ev extends Rt{get type(){return"Number4WithUndefinedProperty"}}class ap extends Rt{get type(){return"Number2sProperty"}}class mf extends Rt{get type(){return"Number3sProperty"}}class Sv extends Rt{get type(){return"Number4sProperty"}}class Pv extends Rt{get type(){return"Boolean2Property"}}class Cv extends Rt{get type(){return"Boolean3Property"}}class Iv extends Rt{get type(){return"Boolean4Property"}}class Mv extends Rt{get type(){return"Boolean2sProperty"}}class Nv extends Rt{get type(){return"Boolean3sProperty"}}class bv extends Rt{get type(){return"Boolean4sProperty"}}class Tv extends Rt{get type(){return"StringNumberProperty"}}class Dv extends Rt{get type(){return"StringNumbersProperty"}}class it extends Lr{get type(){return"ColorProperty"}}class xv extends Qe{get type(){return"ColorRgbProperty"}}class Ov extends C{get type(){return"DashPatternProperty"}}class tt extends Rt{constructor(t,e,i,n,s,a,o){super(t,e,i,n,s,o),this._enums=a}get type(){return"EnumProperty"}get enums(){return this._enums}}class Av extends Rt{constructor(t,e,i,n,s,a,o){super(t,e,i,n,s,o),this._enums=a}get type(){return"EnumStringsProperty"}get enums(){return this._enums}}class Fn extends Rt{constructor(t,e,i,n,s,a,o){super(t,e,i,n,s,a),this._sampleValue=o}get sampleValue(){return this._sampleValue}get type(){return"EvalStringProperty"}}class op extends Rt{constructor(t,e,i,n,s){super(t,e,!1,!1,i,s),this._paramTypes=n}get type(){return"ParamsProperty"}get paramTypes(){return this._paramTypes}}class mt extends Js{constructor(e,i,n,s,a){super(e,i);p(this,"_paramsProperty");p(this,"_getValueFunc");this._func=s;const o=this.disposeVar(d.reactJson(a));this._paramsProperty=this.disposeVar(new op(e+"_params",e+"_params",o,n,a));const[l]=d.getReactFuncs(this._paramsProperty.reactVar);this._getValueFunc=l}get paramsProperty(){return this._paramsProperty}exec(){this._func(...this._getValueFunc())}get type(){return"FunctionProperty"}}class H extends Js{constructor(t,e,i){super(t,e),this._children=i}get type(){return"GroupProperty"}get children(){return this._children}}class Y extends Rt{constructor(t,e,i,n,s,a,o){super(t,e,i,n,s,a),this._sampleValue=o}get sampleValue(){return this._sampleValue}get type(){return"JsonProperty"}}class Kh extends Rt{constructor(t,e,i,n,s,a,o){super(t,e,i,n,s,a),this._sampleValue=o}get sampleValue(){return this._sampleValue}get type(){return"LongStringProperty"}}class Lv extends se{get type(){return"MinmaxProperty"}}class Rv extends Lr{get type(){return"NearFarScalerProperty"}}class lp extends gf{constructor(t,e,i,n,s,a,o){super(t,e,i,n,o),this._getJsonStringFunc=s,this._setJsonStringFunc=a}get type(){return"NonreactiveJsonStringProperty"}get getJsonStringFunc(){return this._getJsonStringFunc}get setJsonStringFunc(){return this._setJsonStringFunc}}class Fv extends se{get type(){return"NumberRangeProperty"}}class Kt extends Rt{constructor(t,e,i,n,s,a,o,l){super(t,e,i,n,s,l),this._step=a,this._minMax=o}get type(){return"NumberSliderProperty"}get minMax(){return this._minMax}get step(){return this._step}}function Gv(r,t){const[e,i,n]=d.getReactFuncs(r),[s,a,o]=d.getReactFuncs(t),l=d.react((e()??0)/(s()??3e3)),u=()=>{const c=l.value,h=s()??3e3,f=e()??0;if(!Number.isFinite(h)||!Number.isFinite(f)){console.warn(`duration || currentTime error: duration: ${h} currentTime: ${f}`);return}Math.abs(c*h-f)<.001||(h<=0?l.value=0:l.value=f/h)};return l.dispose(n.disposableOn(u)),l.dispose(o.disposableOn(u)),l.dispose(l.changed.disposableOn(()=>{const c=l.value,h=s()??3e3,f=e()??0;if(!Number.isFinite(h)||!Number.isFinite(f)){console.warn(`duration || currentTime error: duration: ${h} currentTime: ${f}`);return}Math.abs(c*h-f)<.001||i(c*h)})),l}class Qh extends Js{constructor(e,i,n,s,a,o){super(e,i);p(this,"_defaults",{playing:!1,ratio:0,loop:!1});this._playingReact=n,this._ratioReact=s,this._loopReact=a,o&&(this._defaults.playing=o.playing??this._defaults.playing,this._defaults.ratio=o.ratio??this._defaults.ratio,this._defaults.loop=o.loop??this._defaults.loop)}get type(){return"PlayerProperty"}get playingReact(){return this._playingReact}get ratioReact(){return this._ratioReact}get loopReact(){return this._loopReact}get defaults(){return this._defaults}}p(Qh,"createPlayingRatio",Gv);class ln extends Qe{get type(){return"PositionProperty"}}class up extends Rt{get type(){return"PositionsProperty"}}class kv extends Rt{get type(){return"PositionsSetPropety"}}class Zh extends Qe{get type(){return"RotationProperty"}}class qu extends nt{get type(){return"UriProperty"}}class hp extends Js{constructor(e,i,n,s,a,o){super(e,i);p(this,"_defaults",{playing:!1,loop:!1});this._playingReact=n,this._stopFn=s,this._loopReact=a,o&&(this._defaults.playing=o.playing??this._defaults.playing,this._defaults.loop=o.loop??this._defaults.loop)}get type(){return"ViewPlayerProperty"}get playingReact(){return this._playingReact}get loopReact(){return this._loopReact}get stopFn(){return this._stopFn}get defaults(){return this._defaults}}class vf extends Rt{get type(){return"DatesProperty"}}class Gn extends Rt{get type(){return"DateProperty"}}var vt=(r=>(r.Place="place",r.Translation="translation",r.Rotation="rotation",r.Scale="scale",r.DoublePointsAppend="doublePointsAppend",r.DoublePointsModify="doublePointsModify",r.CircularAppend="circularAppend",r.CircularInsert="circularInsert",r.LineStringAppend="lineStringAppend",r.LineStringInsert="lineStringInsert",r.ScatterAppend="scatterAppend",r.ScatterModify="scatterModify",r.VisibilityAppend="visibilityAppend",r.VisibilityModify="visibilityModify",r.HeightModify="heightModify",r))(vt||{}),cp=(r=>(r.DECIMAL_DEGREE="DECIMAL_DEGREE",r.DEGREES_DECIMAL_MINUTES="DEGREES_DECIMAL_MINUTES",r.SEXAGESIMAL_DEGREE="SEXAGESIMAL_DEGREE",r))(cp||{});class zv{constructor(t){this.childPickedInfo=t}}class Vv{constructor(t,e,i,n,s,a){this.pickResult=t,this.sceneObject=e,this.tilesetPickInfo=i,this.geojsonPickInfo=n,this.attachedInfo=s,this.screenPosition=a}assign(t){t!=null&&t.pickedResult&&(this.pickResult=t.pickedResult),t!=null&&t.sceneObject&&(this.sceneObject=t.sceneObject),t!=null&&t.tilesetPickInfo&&(this.tilesetPickInfo=t.tilesetPickInfo),t!=null&&t.geojsonPickInfo&&(this.geojsonPickInfo=t.geojsonPickInfo),t!=null&&t.attachedInfo&&(this.attachedInfo=t.attachedInfo),t!=null&&t.screenPosition&&(this.screenPosition=t.screenPosition)}}class Uv extends d.Destroyable{constructor(e){super();p(this,"_sceneObjRefs",new Map);p(this,"_refs",{});p(this,"_refsChanged",this.dv(new d.Event));const i=(n,s,a)=>{if(a){const o=this.getLastSceneObject(a),l=this._sceneObjRefs.get(a);if(!l)console.warn(`this._sceneObjRefs中不存在ref(${a}), 可能系统存在逻辑问题`);else{const c=l.indexOf(n);c===-1?console.warn(`this._sceneObjRefs中不存在当前对象(id: ${n.id} type: ${n.typeName})!可能系统存在逻辑问题`):(l.splice(c,1),l.length===0&&this._sceneObjRefs.delete(a))}const u=this.getLastSceneObject(a);this._refs[a]=u,this._refsChanged.emit(u,o)}if(s){const o=this.getLastSceneObject(s),l=this._sceneObjRefs.get(s);l?(l.push(n),l.length>0&&console.warn(`同时存在多个ref${s}相同的场景对象!
2
2
  ${l.map(c=>`${c.id} ${c.typeName}
3
- `).join(" ")}`)):this._sceneObjRefs.set(s,[n]);const u=this.getLastSceneObject(s);this._refs[s]=u,this._refsChanged.emit(u,o)}};this.d(e.sceneObjCreatedEvent.don(n=>{const s=(a,o)=>i(n,a,o);n.ref&&s(n.ref,void 0),n.refChanged.don(s)})),this.d(e.sceneObjToDestroyEvent.don(n=>{n.ref&&i(n,void 0,n.ref)}))}get sceneObjRefs(){return this._sceneObjRefs}get refs(){return this._refs}get refsChanged(){return this._refsChanged}getLastSceneObject(e){const i=this.getSceneObjects(e);if(i)return i[i.length-1]}getSceneObjects(e){const i=this._sceneObjRefs.get(e);if(!(!i||i.length===0))return i}}function fp(r,t){const[e,i,n]=d.getReactFuncs(r),s=d.react(void 0),a=()=>{const o=e()??t;s.value=o&&ft.context.getStrFromEnv(o)};return a(),n&&s.d(n.don(a)),s.d(ft.context.environmentVariablesChanged.don(a)),s}function qv(r){do{const t=r.replace(/\${(.*?)\}/,(e,i)=>{const n=ft.context.getEnv(i);return n===void 0?(console.warn(`环境变量(${i})不存在,无法进行转换`),"{env-error}"):n});if(t===r)break;r=t}while(!0);return r}class Wv extends d.Destroyable{constructor(){super();p(this,"_esObjConstructors",new Map);p(this,"_sceneObjs",new Map);p(this,"_sceneObjCreatedEvent",new d.Event);p(this,"_sceneObjToDestroyEvent",new d.Event);p(this,"_refsManager",this.dv(new Uv(this)));p(this,"_environmentVariables",window.ESSDK_ENV||{});p(this,"_environmentVariablesChanged",this.dv(new d.Event))}get typeNames(){return this._esObjConstructors.keys()}get sceneObjs(){return this._sceneObjs.values()}get sceneObjCreatedEvent(){return this._sceneObjCreatedEvent}get sceneObjToDestroyEvent(){return this._sceneObjToDestroyEvent}get refsManager(){return this._refsManager}get $refs(){return this._refsManager.refs}register(e,i,n){return this._esObjConstructors.has(e)&&console.warn(`register warn: ${e} has registered ! will be override!`),this._esObjConstructors.set(e,i),n&&d.setExtProp(i,"__sceneObjExtraInfo",n),e}_addSceneObject(e){this._sceneObjs.set(e.id,e),this._sceneObjCreatedEvent.emit(e),e.d(()=>this._deleteSceneObject(e))}addSceneObject(e){this._addSceneObject(e)}_deleteSceneObject(e){this._sceneObjToDestroyEvent.emit(e),this._sceneObjs.delete(e.id)}deleteSceneObject(e){this._deleteSceneObject(e)}createSceneObjectFromClass(e,i){if(!i||this._sceneObjs.has(i)){const s=d.createGuid();i&&console.warn(`已存在相同id的对象!id自动变更!${i} -> ${s} 请注意:id变更可能导致引用失效!`),i=s}if(!i)throw new Error("id不能为空!");const n=new e(i);return n.id!==i&&(console.warn(`sceneObj.id(${n.id}) !== id(${i}) sceneObjectType: ${n.typeName}`),console.warn("出现这种问题有可能是自定义的场景对象,没有在构造函数中传递id参数!示例如下:"),console.warn("class XXX extends XXX { constructor(id) { super(id); } }")),this._addSceneObject(n),n}createSceneObject(e,i){if(typeof e=="string"){const n=this._getSceneObjConstructor(e);if(!n){console.warn(`Cannot find SceneObjectType: ${e}`);return}return this.createSceneObjectFromClass(n,i)}else return this.createSceneObjectFromClass(e,i)}createSceneObjectFromJson(e){const i=this.createSceneObject(e.type,e.id);return i&&(i.json=e),i}destroySceneObject(e){return this._deleteSceneObject(e),e.destroy(),e.isDestroyed()}getSceneObjectById(e){return this._sceneObjs.get(e)}getSceneObject(e){if(!e&&e!="")return Array.from(this._sceneObjs.values());if(e.startsWith("ES")){const i=[];for(const n of this._sceneObjs.values())n.typeName===e&&i.push(n);return i}else return this._sceneObjs.get(e)}_getSceneObjConstructor(e){const i=this._esObjConstructors.get(e);if(i)return i}getProps(e){const i=this._getSceneObjConstructor(e);if(!i){console.warn(`cannot get constructor from type: ${e}`);return}return d.getExtProp(i,"__sceneObjExtraInfo")}setProps(e,i){const n=this._getSceneObjConstructor(e);if(!n){console.warn(`cannot get constructor from type: ${e}`);return}let s=d.getExtProp(n,"__sceneObjExtraInfo");s||(s={},d.setExtProp(n,"__sceneObjExtraInfo",s)),Object.assign(s,i)}getProp(e,i){const n=this.getProps(e);return n&&n[i]}setProp(e,i,n){this.setProps(e,{[i]:n})}get environmentVariables(){return this._environmentVariables}set environmentVariables(e){for(let[i,n]of Object.entries(e))this.setEnv(i,n)}get environmentVariablesChanged(){return this._environmentVariablesChanged}setEnv(e,i){if(this._environmentVariables[e]!==i){const n=this._environmentVariables[e];this._environmentVariables[e]=i,this._environmentVariablesChanged.emit(e,i,n)}window.ESSDK_ENV={...this._environmentVariables}}getEnv(e){return this._environmentVariables[e]}getStrFromEnv(e){return qv(e)}createEnvStrReact(e,i){return fp(e,i)}createEvnStrReact(e,i){return fp(e,i)}}const Tt=class Tt extends d.Destroyable{constructor(e){super();p(this,"_components",this.dv(new d.ObservableSet));p(this,"_viewerAttached",this.dv(new d.Event));p(this,"_viewerDetached",this.dv(new d.Event));p(this,"_attachedViewers",(()=>{const e=new Set;return this.d(this._viewerAttached.don(i=>{e.add(i)})),this.d(this._viewerDetached.don(i=>{e.delete(i)})),e})());p(this,"_createdEvent",this.dv(new d.Event));p(this,"_flushEvent",this.dv(new d.Event));p(this,"_id");p(this,"viewer");p(this,"viewerChanged",this.ad(new d.Event));p(this,"combinationClass",!1);p(this,"mainClass");p(this,"_updateFuncReact",this.dv(d.react(void 0)));p(this,"_toDestroyFuncReact",this.dv(d.react(void 0)));p(this,"_parentID",this.disposeVar(d.react(void 0)));e!==void 0&&(typeof e!="string"?console.warn(`对象id必须是字符串类型,当前id的类型是${typeof e},值为${e}`):e.trim()===""?console.warn("场景对象创建时的id不能是空字符串!"):e.trim()!==e&&console.warn(`id前后有空字符串!id: ${e}`)),this._id=e??d.createGuid(),this._initName();{const i=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(n){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${n}`)}};i(),this.d(this.execOnceFuncStrChanged.don(i))}{const i=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(s){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};i(),this.d(this.updateFuncStrChanged.don(i));let n;this.d(()=>n&&n.destroy()),this.d(this.updateFuncChanged.don(()=>{n&&n.cancel(),this.updateFunc&&(n=n||d.createAnimateFrame(),n.restart(void 0,s=>{this.updateFunc&&this.updateFunc(this,s)}))}))}{const i=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(n){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${n}`),this.toDestroyFunc=void 0}};i(),this.d(this.toDestroyFuncStrChanged.don(i)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}}static get envs(){return Tt.context.environmentVariables}static get $refs(){return Tt.context.refsManager.refs}get components(){return this._components}get viewerAttached(){return this._viewerAttached}get viewerDetached(){return this._viewerDetached}get attachedViewers(){return this._attachedViewers}removefromViewer(e){this.attachedViewers.has(e)&&e.delete(this)}addToViewer(e){this.attachedViewers.has(e)||e.add(this)}registerAttachedObject(e){const i=new Map;this.d(()=>{i.size>0&&console.warn("viewerPropSceneObjects.size > 0")}),this.d(this._viewerAttached.don(n=>{const s=e(n);s&&i.set(n,s)})),this.d(this._viewerDetached.don(n=>{if(!i.has(n))return;const s=i.get(n);s&&(s.destroy(),i.delete(n))}))}createAttachedObject(e){const i=new Map,n=()=>{for(let[l,u]of i.entries())u.destroy();i.clear()},s=l=>{const u=e(l);u&&i.set(l,u)};for(let l of this.attachedViewers)s(l);const a=this._viewerAttached.don(s),o=this._viewerDetached.don(l=>{if(!i.has(l))return;const u=i.get(l);u&&(u.destroy(),i.delete(l))});return()=>{o(),a(),n()}}registerAttachedObjectForContainer(e){this.registerAttachedObject(i=>new Hv(i,e))}get createdEvent(){return this._createdEvent}get flushEvent(){return this._flushEvent}flush(){this.flushEvent.emit()}get id(){return this._id}get typeName(){return this.constructor.name}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return Tt.createDefaultProps()}getMainClass(){return this.mainClass??this}_innerGetJson(e=!0){const i={id:this.id,type:this.typeName};for(let n of Object.keys(this.defaultProps))if(e){let s,a=this.defaultProps[n];a instanceof d.ReactiveVariable?s=a.equals(this[n]):s=a===this[n],s||(i[n]=this[n])}else i[n]=this[n];return i}_innerGetJson1(e=!0){const i={id:this.id,type:this.typeName},n=this.constructor.properties;for(let s of Object.keys(n))if(e){let a,o=n[s];o instanceof d.ReactiveVariable?a=o.equals(this[s]):a=o===this[s],a||(i[s]=this[s])}else i[s]=this[s];return i}_innerSetJson(e,i,n){if(!(e instanceof Object)||e.type&&e.type!==this.typeName){console.error(`value.type && value.type${e.type} !== this.typeName${this.typeName}`);return}e.id&&e.id!==this.id&&console.warn(`value.id === undefined || value.id${e.id} !== this.id(${this.id})`);const s=i||[];s.push("id","type");const a=Object.keys(this.defaultProps).filter(o=>!s.includes(o));for(let o of a)if(o in e)this[o]=e[o]===null?void 0:e[o];else if(!(n??!1)){let l=this.defaultProps[o];l instanceof d.ReactiveVariable&&(l=l.value),this[o]=l}}get json(){return this._innerGetJson()}set json(e){this._innerSetJson(e)}get _jsonStr(){return JSON.stringify(this.json,null,4)}set _jsonStr(e){this._innerSetJson(JSON.parse(e))}get updateFunc(){return this._updateFuncReact.value}set updateFunc(e){this._updateFuncReact.value=e}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(e){this._toDestroyFuncReact.value=e}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get parentID(){return this._parentID.value}set parentID(e){this._parentID.value=e}get parentIDChanged(){return this._parentID.changed}getProperties(e){return[new H("ESSceneObject","ESSceneObject",[new nt("对象类型","类型(type)",!1,!0,[this,"typeName"]),new nt("对象id","唯一标识符(id)",!1,!0,[this,"id"]),new nt("对象名称","名称(name)",!1,!1,[this,"name"]),new nt("ref","标识(ref),可通过 ESSceneObject.$refs.xxx快速获取到对象",!0,!1,[this,"ref"]),new Y("extras","扩展属性,必须整体赋值(extras)",!0,!1,[this,"extras"]),new lp("JSON","对象JSON数据动态更改导入导出。",!1,!1,()=>this._jsonStr,i=>i&&(this._jsonStr=i))])]}getESProperties(){return{defaultMenu:"basic",basic:[],general:[],dataSource:[],location:[],coordinate:[],style:[]}}static register1(e,i,n){let s={},a=i;for(;a&&a!==Object;)a.hasOwnProperty("properties")&&(s={...s,...a.properties}),a=Object.getPrototypeOf(a);return i.properties=Object.freeze(s),d.extendClassProps(i.prototype,()=>s),this.register(e,i,n),e}};p(Tt,"context",new Wv),p(Tt,"register",Tt.context.register.bind(Tt.context)),p(Tt,"create",Tt.context.createSceneObject.bind(Tt.context)),p(Tt,"createFromClass",Tt.context.createSceneObjectFromClass.bind(Tt.context)),p(Tt,"createFromJson",Tt.context.createSceneObjectFromJson.bind(Tt.context)),p(Tt,"destroySceneObject",Tt.context.destroySceneObject.bind(Tt.context)),p(Tt,"getSceneObjById",Tt.context.getSceneObjectById.bind(Tt.context)),p(Tt,"getSceneObj",Tt.context.getSceneObject.bind(Tt.context)),p(Tt,"getEnv",Tt.context.getEnv.bind(Tt.context)),p(Tt,"setEnv",Tt.context.setEnv.bind(Tt.context)),p(Tt,"getStrFromEnv",Tt.context.getStrFromEnv.bind(Tt.context)),p(Tt,"getSceneObjectById",Tt.context.getSceneObjectById.bind(Tt.context)),p(Tt,"getSceneObject",Tt.context.getSceneObject.bind(Tt.context)),p(Tt,"defaults",{}),p(Tt,"createDefaultProps",()=>({name:"未命名场景对象",ref:void 0,extras:d.reactJson(void 0),devTags:d.reactArrayWithUndefined(void 0),execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0})),p(Tt,"properties",{reff:void 0});let ft=Tt;d.extendClassProps(ft.prototype,ft.createDefaultProps);class Hv extends d.Destroyable{constructor(t,e){super(),this.dv(new d.ObjResettingWithEvent(t.subContainerChanged,()=>{if(t.subContainer)return e(t,t.subContainer)}))}}function yf(r){return d.reactDeepArrayWithUndefined(r,(t,e)=>t[0]===e[0]&&t[1]===e[1],t=>[...t])}function dp(r,t){const e=new Array;for(let i of r)e.push(t(i));return e}function _f(r,t){return r===void 0&&t===void 0?!0:!r||!t?!1:r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]}var hr=63710088e-1,pp={centimeters:hr*100,centimetres:hr*100,degrees:hr/111325,feet:hr*3.28084,inches:hr*39.37,kilometers:hr/1e3,kilometres:hr/1e3,meters:hr,metres:hr,miles:hr/1609.344,millimeters:hr*1e3,millimetres:hr*1e3,nauticalmiles:hr/1852,radians:1,yards:hr*1.0936};function un(r,t,e){e===void 0&&(e={});var i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=t||{},i.geometry=r,i}function ae(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!gp(r[0])||!gp(r[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:r};return un(i,t,e)}function Pr(r,t,e){e===void 0&&(e={});for(var i=0,n=r;i<n.length;i++){var s=n[i];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<s[s.length-1].length;a++)if(s[s.length-1][a]!==s[0][a])throw new Error("First and last Position are not equivalent.")}var o={type:"Polygon",coordinates:r};return un(o,t,e)}function hn(r,t,e){if(e===void 0&&(e={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:r};return un(i,t,e)}function Yl(r,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}function wf(r,t,e){e===void 0&&(e={});var i={type:"MultiPolygon",coordinates:r};return un(i,t,e)}function Ef(r,t){t===void 0&&(t="kilometers");var e=pp[t];if(!e)throw new Error(t+" units is invalid");return r*e}function Sf(r,t){t===void 0&&(t="kilometers");var e=pp[t];if(!e)throw new Error(t+" units is invalid");return r/e}function Bh(r){var t=r%(2*Math.PI);return t*180/Math.PI}function Cr(r){var t=r%360;return t*Math.PI/180}function Pf(r,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("length must be a positive number");return Ef(Sf(r,t),e)}function gp(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function Jl(r,t,e){if(r!==null)for(var i,n,s,a,o,l,u,c=0,h=0,f,g=r.type,m=g==="FeatureCollection",_=g==="Feature",E=m?r.features.length:1,M=0;M<E;M++){u=m?r.features[M].geometry:_?r.geometry:r,f=u?u.type==="GeometryCollection":!1,o=f?u.geometries.length:1;for(var y=0;y<o;y++){var w=0,v=0;if(a=f?u.geometries[y]:u,a!==null){l=a.coordinates;var S=a.type;switch(c=e&&(S==="Polygon"||S==="MultiPolygon")?1:0,S){case null:break;case"Point":if(t(l,h,M,w,v)===!1)return!1;h++,w++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(t(l[i],h,M,w,v)===!1)return!1;h++,S==="MultiPoint"&&w++}S==="LineString"&&w++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(n=0;n<l[i].length-c;n++){if(t(l[i][n],h,M,w,v)===!1)return!1;h++}S==="MultiLineString"&&w++,S==="Polygon"&&v++}S==="Polygon"&&w++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(v=0,n=0;n<l[i].length;n++){for(s=0;s<l[i][n].length-c;s++){if(t(l[i][n][s],h,M,w,v)===!1)return!1;h++}v++}w++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(Jl(a.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function $h(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}function jh(r,t){var e,i,n,s,a,o,l,u,c,h,f=0,g=r.type==="FeatureCollection",m=r.type==="Feature",_=g?r.features.length:1;for(e=0;e<_;e++){for(o=g?r.features[e].geometry:m?r.geometry:r,u=g?r.features[e].properties:m?r.properties:{},c=g?r.features[e].bbox:m?r.bbox:void 0,h=g?r.features[e].id:m?r.id:void 0,l=o?o.type==="GeometryCollection":!1,a=l?o.geometries.length:1,n=0;n<a;n++){if(s=l?o.geometries[n]:o,s===null){if(t(null,f,u,c,h)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(s,f,u,c,h)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<s.geometries.length;i++)if(t(s.geometries[i],f,u,c,h)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function Xv(r,t,e){var i=e;return jh(r,function(n,s,a,o,l){i=t(i,n,s,a,o,l)}),i}function Cf(r,t){jh(r,function(e,i,n,s,a){var o=e===null?null:e.type;switch(o){case null:case"Point":case"LineString":case"Polygon":return t(un(e,n,{bbox:s,id:a}),i,0)===!1?!1:void 0}var l;switch(o){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var c=e.coordinates[u],h={type:l,coordinates:c};if(t(un(h,n),i,u)===!1)return!1}})}function Yv(r,t){Cf(r,function(e,i,n){var s=0;if(e.geometry){var a=e.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var o,l=0,u=0,c=0;if(Jl(e,function(h,f,g,m,_){if(o===void 0||i>l||m>u||_>c){o=h,l=i,u=m,c=_,s=0;return}var E=hn([o,h],e.properties);if(t(E,i,n,_,s)===!1)return!1;s++,o=h})===!1)return!1}}})}function cn(r){var t=[1/0,1/0,-1/0,-1/0];return Jl(r,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}cn.default=cn;function Rr(r){if(!r)throw new Error("coord is required");if(!Array.isArray(r)){if(r.type==="Feature"&&r.geometry!==null&&r.geometry.type==="Point")return r.geometry.coordinates;if(r.type==="Point")return r.coordinates}if(Array.isArray(r)&&r.length>=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return r;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function La(r){if(Array.isArray(r))return r;if(r.type==="Feature"){if(r.geometry!==null)return r.geometry.coordinates}else if(r.coordinates)return r.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function mp(r,t,e){if(!r)throw new Error("No feature passed");if(!e)throw new Error(".featureOf() requires a name");if(!r||r.type!=="Feature"||!r.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!r.geometry||r.geometry.type!==t)throw new Error("Invalid input to "+e+": must be a "+t+", given "+r.geometry.type)}function yi(r){return r.type==="Feature"?r.geometry:r}function Jv(r,t){return r.type==="FeatureCollection"?"FeatureCollection":r.type==="GeometryCollection"?"GeometryCollection":r.type==="Feature"&&r.geometry!==null?r.geometry.type:r.type}function vp(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Kv(r){if(Object.prototype.hasOwnProperty.call(r,"__esModule"))return r;var t=r.default;if(typeof t=="function"){var e=function i(){return this instanceof i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(r).forEach(function(i){var n=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:function(){return r[i]}})}),e}var tc={exports:{}},ec={exports:{}},Qv=ec.exports,yp;function _p(){return yp||(yp=1,function(r,t){(function(e,i){r.exports=i()})(Qv,function(){function e(y,w,v,S,P){(function I(b,D,O,T,x){for(;T>O;){if(T-O>600){var R=T-O+1,z=D-O+1,rt=Math.log(R),Z=.5*Math.exp(2*rt/3),ct=.5*Math.sqrt(rt*Z*(R-Z)/R)*(z-R/2<0?-1:1),G=Math.max(O,Math.floor(D-z*Z/R+ct)),X=Math.min(T,Math.floor(D+(R-z)*Z/R+ct));I(b,D,G,X,x)}var k=b[D],V=O,A=T;for(i(b,O,D),x(b[T],k)>0&&i(b,O,T);V<A;){for(i(b,V,A),V++,A--;x(b[V],k)<0;)V++;for(;x(b[A],k)>0;)A--}x(b[O],k)===0?i(b,O,A):i(b,++A,T),A<=D&&(O=A+1),D<=A&&(T=A-1)}})(y,w,v||0,S||y.length-1,P||n)}function i(y,w,v){var S=y[w];y[w]=y[v],y[v]=S}function n(y,w){return y<w?-1:y>w?1:0}var s=function(y){y===void 0&&(y=9),this._maxEntries=Math.max(4,y),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(y,w,v){if(!v)return w.indexOf(y);for(var S=0;S<w.length;S++)if(v(y,w[S]))return S;return-1}function o(y,w){l(y,0,y.children.length,w,y)}function l(y,w,v,S,P){P||(P=E(null)),P.minX=1/0,P.minY=1/0,P.maxX=-1/0,P.maxY=-1/0;for(var I=w;I<v;I++){var b=y.children[I];u(P,y.leaf?S(b):b)}return P}function u(y,w){return y.minX=Math.min(y.minX,w.minX),y.minY=Math.min(y.minY,w.minY),y.maxX=Math.max(y.maxX,w.maxX),y.maxY=Math.max(y.maxY,w.maxY),y}function c(y,w){return y.minX-w.minX}function h(y,w){return y.minY-w.minY}function f(y){return(y.maxX-y.minX)*(y.maxY-y.minY)}function g(y){return y.maxX-y.minX+(y.maxY-y.minY)}function m(y,w){return y.minX<=w.minX&&y.minY<=w.minY&&w.maxX<=y.maxX&&w.maxY<=y.maxY}function _(y,w){return w.minX<=y.maxX&&w.minY<=y.maxY&&w.maxX>=y.minX&&w.maxY>=y.minY}function E(y){return{children:y,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function M(y,w,v,S,P){for(var I=[w,v];I.length;)if(!((v=I.pop())-(w=I.pop())<=S)){var b=w+Math.ceil((v-w)/S/2)*S;e(y,b,w,v,P),I.push(w,b,b,v)}}return s.prototype.all=function(){return this._all(this.data,[])},s.prototype.search=function(y){var w=this.data,v=[];if(!_(y,w))return v;for(var S=this.toBBox,P=[];w;){for(var I=0;I<w.children.length;I++){var b=w.children[I],D=w.leaf?S(b):b;_(y,D)&&(w.leaf?v.push(b):m(y,D)?this._all(b,v):P.push(b))}w=P.pop()}return v},s.prototype.collides=function(y){var w=this.data;if(!_(y,w))return!1;for(var v=[];w;){for(var S=0;S<w.children.length;S++){var P=w.children[S],I=w.leaf?this.toBBox(P):P;if(_(y,I)){if(w.leaf||m(y,I))return!0;v.push(P)}}w=v.pop()}return!1},s.prototype.load=function(y){if(!y||!y.length)return this;if(y.length<this._minEntries){for(var w=0;w<y.length;w++)this.insert(y[w]);return this}var v=this._build(y.slice(),0,y.length-1,0);if(this.data.children.length)if(this.data.height===v.height)this._splitRoot(this.data,v);else{if(this.data.height<v.height){var S=this.data;this.data=v,v=S}this._insert(v,this.data.height-v.height-1,!0)}else this.data=v;return this},s.prototype.insert=function(y){return y&&this._insert(y,this.data.height-1),this},s.prototype.clear=function(){return this.data=E([]),this},s.prototype.remove=function(y,w){if(!y)return this;for(var v,S,P,I=this.data,b=this.toBBox(y),D=[],O=[];I||D.length;){if(I||(I=D.pop(),S=D[D.length-1],v=O.pop(),P=!0),I.leaf){var T=a(y,I.children,w);if(T!==-1)return I.children.splice(T,1),D.push(I),this._condense(D),this}P||I.leaf||!m(I,b)?S?(v++,I=S.children[v],P=!1):I=null:(D.push(I),O.push(v),v=0,S=I,I=I.children[0])}return this},s.prototype.toBBox=function(y){return y},s.prototype.compareMinX=function(y,w){return y.minX-w.minX},s.prototype.compareMinY=function(y,w){return y.minY-w.minY},s.prototype.toJSON=function(){return this.data},s.prototype.fromJSON=function(y){return this.data=y,this},s.prototype._all=function(y,w){for(var v=[];y;)y.leaf?w.push.apply(w,y.children):v.push.apply(v,y.children),y=v.pop();return w},s.prototype._build=function(y,w,v,S){var P,I=v-w+1,b=this._maxEntries;if(I<=b)return o(P=E(y.slice(w,v+1)),this.toBBox),P;S||(S=Math.ceil(Math.log(I)/Math.log(b)),b=Math.ceil(I/Math.pow(b,S-1))),(P=E([])).leaf=!1,P.height=S;var D=Math.ceil(I/b),O=D*Math.ceil(Math.sqrt(b));M(y,w,v,O,this.compareMinX);for(var T=w;T<=v;T+=O){var x=Math.min(T+O-1,v);M(y,T,x,D,this.compareMinY);for(var R=T;R<=x;R+=D){var z=Math.min(R+D-1,x);P.children.push(this._build(y,R,z,S-1))}}return o(P,this.toBBox),P},s.prototype._chooseSubtree=function(y,w,v,S){for(;S.push(w),!w.leaf&&S.length-1!==v;){for(var P=1/0,I=1/0,b=void 0,D=0;D<w.children.length;D++){var O=w.children[D],T=f(O),x=(R=y,z=O,(Math.max(z.maxX,R.maxX)-Math.min(z.minX,R.minX))*(Math.max(z.maxY,R.maxY)-Math.min(z.minY,R.minY))-T);x<I?(I=x,P=T<P?T:P,b=O):x===I&&T<P&&(P=T,b=O)}w=b||w.children[0]}var R,z;return w},s.prototype._insert=function(y,w,v){var S=v?y:this.toBBox(y),P=[],I=this._chooseSubtree(S,this.data,w,P);for(I.children.push(y),u(I,S);w>=0&&P[w].children.length>this._maxEntries;)this._split(P,w),w--;this._adjustParentBBoxes(S,P,w)},s.prototype._split=function(y,w){var v=y[w],S=v.children.length,P=this._minEntries;this._chooseSplitAxis(v,P,S);var I=this._chooseSplitIndex(v,P,S),b=E(v.children.splice(I,v.children.length-I));b.height=v.height,b.leaf=v.leaf,o(v,this.toBBox),o(b,this.toBBox),w?y[w-1].children.push(b):this._splitRoot(v,b)},s.prototype._splitRoot=function(y,w){this.data=E([y,w]),this.data.height=y.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},s.prototype._chooseSplitIndex=function(y,w,v){for(var S,P,I,b,D,O,T,x=1/0,R=1/0,z=w;z<=v-w;z++){var rt=l(y,0,z,this.toBBox),Z=l(y,z,v,this.toBBox),ct=(P=rt,I=Z,b=void 0,D=void 0,O=void 0,T=void 0,b=Math.max(P.minX,I.minX),D=Math.max(P.minY,I.minY),O=Math.min(P.maxX,I.maxX),T=Math.min(P.maxY,I.maxY),Math.max(0,O-b)*Math.max(0,T-D)),G=f(rt)+f(Z);ct<x?(x=ct,S=z,R=G<R?G:R):ct===x&&G<R&&(R=G,S=z)}return S||v-w},s.prototype._chooseSplitAxis=function(y,w,v){var S=y.leaf?this.compareMinX:c,P=y.leaf?this.compareMinY:h;this._allDistMargin(y,w,v,S)<this._allDistMargin(y,w,v,P)&&y.children.sort(S)},s.prototype._allDistMargin=function(y,w,v,S){y.children.sort(S);for(var P=this.toBBox,I=l(y,0,w,P),b=l(y,v-w,v,P),D=g(I)+g(b),O=w;O<v-w;O++){var T=y.children[O];u(I,y.leaf?P(T):T),D+=g(I)}for(var x=v-w-1;x>=w;x--){var R=y.children[x];u(b,y.leaf?P(R):R),D+=g(b)}return D},s.prototype._adjustParentBBoxes=function(y,w,v){for(var S=v;S>=0;S--)u(w[S],y)},s.prototype._condense=function(y){for(var w=y.length-1,v=void 0;w>=0;w--)y[w].children.length===0?w>0?(v=y[w-1].children).splice(v.indexOf(y[w]),1):this.clear():o(y[w],this.toBBox)},s})}(ec)),ec.exports}class Zv{constructor(t=[],e=Bv){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let i=(this.length>>1)-1;i>=0;i--)this._down(i)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:i}=this,n=e[t];for(;t>0;){const s=t-1>>1,a=e[s];if(i(n,a)>=0)break;e[t]=a,t=s}e[t]=n}_down(t){const{data:e,compare:i}=this,n=this.length>>1,s=e[t];for(;t<n;){let a=(t<<1)+1,o=e[a];const l=a+1;if(l<this.length&&i(e[l],o)<0&&(a=l,o=e[l]),i(o,s)>=0)break;e[t]=o,t=a}e[t]=s}}function Bv(r,t){return r<t?-1:r>t?1:0}const $v=Kv(Object.freeze(Object.defineProperty({__proto__:null,default:Zv},Symbol.toStringTag,{value:"Module"})));var Wu={exports:{}},If,wp;function jv(){return wp||(wp=1,If=function(t,e,i,n){var s=t[0],a=t[1],o=!1;i===void 0&&(i=0),n===void 0&&(n=e.length);for(var l=(n-i)/2,u=0,c=l-1;u<l;c=u++){var h=e[i+u*2+0],f=e[i+u*2+1],g=e[i+c*2+0],m=e[i+c*2+1],_=f>a!=m>a&&s<(g-h)*(a-f)/(m-f)+h;_&&(o=!o)}return o}),If}var Mf,Ep;function ty(){return Ep||(Ep=1,Mf=function(t,e,i,n){var s=t[0],a=t[1],o=!1;i===void 0&&(i=0),n===void 0&&(n=e.length);for(var l=n-i,u=0,c=l-1;u<l;c=u++){var h=e[u+i][0],f=e[u+i][1],g=e[c+i][0],m=e[c+i][1],_=f>a!=m>a&&s<(g-h)*(a-f)/(m-f)+h;_&&(o=!o)}return o}),Mf}var Sp;function ey(){if(Sp)return Wu.exports;Sp=1;var r=jv(),t=ty();return Wu.exports=function(i,n,s,a){return n.length>0&&Array.isArray(n[0])?t(i,n,s,a):r(i,n,s,a)},Wu.exports.nested=t,Wu.exports.flat=r,Wu.exports}var Hu={exports:{}},ry=Hu.exports,Pp;function iy(){return Pp||(Pp=1,function(r,t){(function(e,i){i(t)})(ry,function(e){const n=33306690738754706e-32;function s(_,E,M,y,w){let v,S,P,I,b=E[0],D=y[0],O=0,T=0;D>b==D>-b?(v=b,b=E[++O]):(v=D,D=y[++T]);let x=0;if(O<_&&T<M)for(D>b==D>-b?(P=v-((S=b+v)-b),b=E[++O]):(P=v-((S=D+v)-D),D=y[++T]),v=S,P!==0&&(w[x++]=P);O<_&&T<M;)D>b==D>-b?(P=v-((S=v+b)-(I=S-v))+(b-I),b=E[++O]):(P=v-((S=v+D)-(I=S-v))+(D-I),D=y[++T]),v=S,P!==0&&(w[x++]=P);for(;O<_;)P=v-((S=v+b)-(I=S-v))+(b-I),b=E[++O],v=S,P!==0&&(w[x++]=P);for(;T<M;)P=v-((S=v+D)-(I=S-v))+(D-I),D=y[++T],v=S,P!==0&&(w[x++]=P);return v===0&&x!==0||(w[x++]=v),x}function a(_){return new Float64Array(_)}const o=33306690738754716e-32,l=22204460492503146e-32,u=11093356479670487e-47,c=a(4),h=a(8),f=a(12),g=a(16),m=a(4);e.orient2d=function(_,E,M,y,w,v){const S=(E-v)*(M-w),P=(_-w)*(y-v),I=S-P;if(S===0||P===0||S>0!=P>0)return I;const b=Math.abs(S+P);return Math.abs(I)>=o*b?I:-function(D,O,T,x,R,z,rt){let Z,ct,G,X,k,V,A,W,J,ot,gt,lt,St,ut,It,Nt,j,Pt;const bt=D-R,Gt=T-R,Ht=O-z,Xt=x-z;k=(It=(W=bt-(A=(V=134217729*bt)-(V-bt)))*(ot=Xt-(J=(V=134217729*Xt)-(V-Xt)))-((ut=bt*Xt)-A*J-W*J-A*ot))-(gt=It-(j=(W=Ht-(A=(V=134217729*Ht)-(V-Ht)))*(ot=Gt-(J=(V=134217729*Gt)-(V-Gt)))-((Nt=Ht*Gt)-A*J-W*J-A*ot))),c[0]=It-(gt+k)+(k-j),k=(St=ut-((lt=ut+gt)-(k=lt-ut))+(gt-k))-(gt=St-Nt),c[1]=St-(gt+k)+(k-Nt),k=(Pt=lt+gt)-lt,c[2]=lt-(Pt-k)+(gt-k),c[3]=Pt;let Bt=function(zt,Ee){let ke=Ee[0];for(let on=1;on<zt;on++)ke+=Ee[on];return ke}(4,c),me=l*rt;if(Bt>=me||-Bt>=me||(Z=D-(bt+(k=D-bt))+(k-R),G=T-(Gt+(k=T-Gt))+(k-R),ct=O-(Ht+(k=O-Ht))+(k-z),X=x-(Xt+(k=x-Xt))+(k-z),Z===0&&ct===0&&G===0&&X===0)||(me=u*rt+n*Math.abs(Bt),(Bt+=bt*X+Xt*Z-(Ht*G+Gt*ct))>=me||-Bt>=me))return Bt;k=(It=(W=Z-(A=(V=134217729*Z)-(V-Z)))*(ot=Xt-(J=(V=134217729*Xt)-(V-Xt)))-((ut=Z*Xt)-A*J-W*J-A*ot))-(gt=It-(j=(W=ct-(A=(V=134217729*ct)-(V-ct)))*(ot=Gt-(J=(V=134217729*Gt)-(V-Gt)))-((Nt=ct*Gt)-A*J-W*J-A*ot))),m[0]=It-(gt+k)+(k-j),k=(St=ut-((lt=ut+gt)-(k=lt-ut))+(gt-k))-(gt=St-Nt),m[1]=St-(gt+k)+(k-Nt),k=(Pt=lt+gt)-lt,m[2]=lt-(Pt-k)+(gt-k),m[3]=Pt;const Ke=s(4,c,4,m,h);k=(It=(W=bt-(A=(V=134217729*bt)-(V-bt)))*(ot=X-(J=(V=134217729*X)-(V-X)))-((ut=bt*X)-A*J-W*J-A*ot))-(gt=It-(j=(W=Ht-(A=(V=134217729*Ht)-(V-Ht)))*(ot=G-(J=(V=134217729*G)-(V-G)))-((Nt=Ht*G)-A*J-W*J-A*ot))),m[0]=It-(gt+k)+(k-j),k=(St=ut-((lt=ut+gt)-(k=lt-ut))+(gt-k))-(gt=St-Nt),m[1]=St-(gt+k)+(k-Nt),k=(Pt=lt+gt)-lt,m[2]=lt-(Pt-k)+(gt-k),m[3]=Pt;const Yt=s(Ke,h,4,m,f);k=(It=(W=Z-(A=(V=134217729*Z)-(V-Z)))*(ot=X-(J=(V=134217729*X)-(V-X)))-((ut=Z*X)-A*J-W*J-A*ot))-(gt=It-(j=(W=ct-(A=(V=134217729*ct)-(V-ct)))*(ot=G-(J=(V=134217729*G)-(V-G)))-((Nt=ct*G)-A*J-W*J-A*ot))),m[0]=It-(gt+k)+(k-j),k=(St=ut-((lt=ut+gt)-(k=lt-ut))+(gt-k))-(gt=St-Nt),m[1]=St-(gt+k)+(k-Nt),k=(Pt=lt+gt)-lt,m[2]=lt-(Pt-k)+(gt-k),m[3]=Pt;const kt=s(Yt,f,4,m,g);return g[kt-1]}(_,E,M,y,w,v,b)},e.orient2dfast=function(_,E,M,y,w,v){return(E-v)*(M-w)-(_-w)*(y-v)},Object.defineProperty(e,"__esModule",{value:!0})})}(Hu,Hu.exports)),Hu.exports}var Cp;function ny(){if(Cp)return tc.exports;Cp=1;var r=_p(),t=$v,e=ey(),i=iy().orient2d;t.default&&(t=t.default),tc.exports=n,tc.exports.default=n;function n(v,S,P){S=Math.max(0,S===void 0?2:S),P=P||0;var I=g(v),b=new r(16);b.toBBox=function(A){return{minX:A[0],minY:A[1],maxX:A[0],maxY:A[1]}},b.compareMinX=function(A,W){return A[0]-W[0]},b.compareMinY=function(A,W){return A[1]-W[1]},b.load(v);for(var D=[],O=0,T;O<I.length;O++){var x=I[O];b.remove(x),T=m(x,T),D.push(T)}var R=new r(16);for(O=0;O<D.length;O++)R.insert(f(D[O]));for(var z=S*S,rt=P*P;D.length;){var Z=D.shift(),ct=Z.p,G=Z.next.p,X=_(ct,G);if(!(X<rt)){var k=X/z;x=s(b,Z.prev.p,ct,G,Z.next.next.p,k,R),x&&Math.min(_(x,ct),_(x,G))<=k&&(D.push(Z),D.push(m(x,Z)),b.remove(x),R.remove(Z),R.insert(f(Z)),R.insert(f(Z.next)))}}Z=T;var V=[];do V.push(Z.p),Z=Z.next;while(Z!==T);return V.push(Z.p),V}function s(v,S,P,I,b,D,O){for(var T=new t([],a),x=v.data;x;){for(var R=0;R<x.children.length;R++){var z=x.children[R],rt=x.leaf?E(z,P,I):o(P,I,z);rt>D||T.push({node:z,dist:rt})}for(;T.length&&!T.peek().node.children;){var Z=T.pop(),ct=Z.node,G=E(ct,S,P),X=E(ct,I,b);if(Z.dist<G&&Z.dist<X&&u(P,ct,O)&&u(I,ct,O))return ct}x=T.pop(),x&&(x=x.node)}return null}function a(v,S){return v.dist-S.dist}function o(v,S,P){if(l(v,P)||l(S,P))return 0;var I=M(v[0],v[1],S[0],S[1],P.minX,P.minY,P.maxX,P.minY);if(I===0)return 0;var b=M(v[0],v[1],S[0],S[1],P.minX,P.minY,P.minX,P.maxY);if(b===0)return 0;var D=M(v[0],v[1],S[0],S[1],P.maxX,P.minY,P.maxX,P.maxY);if(D===0)return 0;var O=M(v[0],v[1],S[0],S[1],P.minX,P.maxY,P.maxX,P.maxY);return O===0?0:Math.min(I,b,D,O)}function l(v,S){return v[0]>=S.minX&&v[0]<=S.maxX&&v[1]>=S.minY&&v[1]<=S.maxY}function u(v,S,P){for(var I=Math.min(v[0],S[0]),b=Math.min(v[1],S[1]),D=Math.max(v[0],S[0]),O=Math.max(v[1],S[1]),T=P.search({minX:I,minY:b,maxX:D,maxY:O}),x=0;x<T.length;x++)if(h(T[x].p,T[x].next.p,v,S))return!1;return!0}function c(v,S,P){return i(v[0],v[1],S[0],S[1],P[0],P[1])}function h(v,S,P,I){return v!==I&&S!==P&&c(v,S,P)>0!=c(v,S,I)>0&&c(P,I,v)>0!=c(P,I,S)>0}function f(v){var S=v.p,P=v.next.p;return v.minX=Math.min(S[0],P[0]),v.minY=Math.min(S[1],P[1]),v.maxX=Math.max(S[0],P[0]),v.maxY=Math.max(S[1],P[1]),v}function g(v){for(var S=v[0],P=v[0],I=v[0],b=v[0],D=0;D<v.length;D++){var O=v[D];O[0]<S[0]&&(S=O),O[0]>I[0]&&(I=O),O[1]<P[1]&&(P=O),O[1]>b[1]&&(b=O)}var T=[S,P,I,b],x=T.slice();for(D=0;D<v.length;D++)e(v[D],T)||x.push(v[D]);return w(x)}function m(v,S){var P={p:v,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return S?(P.next=S.next,P.prev=S,S.next.prev=P,S.next=P):(P.prev=P,P.next=P),P}function _(v,S){var P=v[0]-S[0],I=v[1]-S[1];return P*P+I*I}function E(v,S,P){var I=S[0],b=S[1],D=P[0]-I,O=P[1]-b;if(D!==0||O!==0){var T=((v[0]-I)*D+(v[1]-b)*O)/(D*D+O*O);T>1?(I=P[0],b=P[1]):T>0&&(I+=D*T,b+=O*T)}return D=v[0]-I,O=v[1]-b,D*D+O*O}function M(v,S,P,I,b,D,O,T){var x=P-v,R=I-S,z=O-b,rt=T-D,Z=v-b,ct=S-D,G=x*x+R*R,X=x*z+R*rt,k=z*z+rt*rt,V=x*Z+R*ct,A=z*Z+rt*ct,W=G*k-X*X,J,ot,gt,lt,St=W,ut=W;W===0?(ot=0,St=1,lt=A,ut=k):(ot=X*A-k*V,lt=G*A-X*V,ot<0?(ot=0,lt=A,ut=k):ot>St&&(ot=St,lt=A+X,ut=k)),lt<0?(lt=0,-V<0?ot=0:-V>G?ot=St:(ot=-V,St=G)):lt>ut&&(lt=ut,-V+X<0?ot=0:-V+X>G?ot=St:(ot=-V+X,St=G)),J=ot===0?0:ot/St,gt=lt===0?0:lt/ut;var It=(1-J)*v+J*P,Nt=(1-J)*S+J*I,j=(1-gt)*b+gt*O,Pt=(1-gt)*D+gt*T,bt=j-It,Gt=Pt-Nt;return bt*bt+Gt*Gt}function y(v,S){return v[0]===S[0]?v[1]-S[1]:v[0]-S[0]}function w(v){v.sort(y);for(var S=[],P=0;P<v.length;P++){for(;S.length>=2&&c(S[S.length-2],S[S.length-1],v[P])<=0;)S.pop();S.push(v[P])}for(var I=[],b=v.length-1;b>=0;b--){for(;I.length>=2&&c(I[I.length-2],I[I.length-1],v[b])<=0;)I.pop();I.push(v[b])}return I.pop(),S.pop(),S.concat(I)}return tc.exports}var sy=ny();const ay=vp(sy);function oy(r,t){t===void 0&&(t={}),t.concavity=t.concavity||1/0;var e=[];if(Jl(r,function(n){e.push([n[0],n[1]])}),!e.length)return null;var i=ay(e,t.concavity);return i.length>3?Pr([i]):null}function Fi(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("point is required");if(!t)throw new Error("polygon is required");var i=Rr(r),n=yi(t),s=n.type,a=t.bbox,o=n.coordinates;if(a&&ly(i,a)===!1)return!1;s==="Polygon"&&(o=[o]);for(var l=!1,u=0;u<o.length&&!l;u++)if(Ip(i,o[u][0],e.ignoreBoundary)){for(var c=!1,h=1;h<o[u].length&&!c;)Ip(i,o[u][h],!e.ignoreBoundary)&&(c=!0),h++;c||(l=!0)}return l}function Ip(r,t,e){var i=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var n=0,s=t.length-1;n<t.length;s=n++){var a=t[n][0],o=t[n][1],l=t[s][0],u=t[s][1],c=r[1]*(a-l)+o*(l-r[0])+u*(r[0]-a)===0&&(a-r[0])*(l-r[0])<=0&&(o-r[1])*(u-r[1])<=0;if(c)return!e;var h=o>r[1]!=u>r[1]&&r[0]<(l-a)*(r[1]-o)/(u-o)+a;h&&(i=!i)}return i}function ly(r,t){return t[0]<=r[0]&&t[1]<=r[1]&&t[2]>=r[0]&&t[3]>=r[1]}function ps(r,t,e){e===void 0&&(e={});var i=Rr(r),n=Rr(t),s=Cr(n[1]-i[1]),a=Cr(n[0]-i[0]),o=Cr(i[1]),l=Cr(n[1]),u=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(o)*Math.cos(l);return Ef(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),e.units)}function Kl(r,t,e,i){i===void 0&&(i={});var n=Rr(r),s=Cr(n[0]),a=Cr(n[1]),o=Cr(e),l=Sf(t,i.units),u=Math.asin(Math.sin(a)*Math.cos(l)+Math.cos(a)*Math.sin(l)*Math.cos(o)),c=s+Math.atan2(Math.sin(o)*Math.sin(l)*Math.cos(a),Math.cos(l)-Math.sin(a)*Math.sin(u)),h=Bh(c),f=Bh(u);return ae([h,f],i.properties)}function uy(r,t,e){e===void 0&&(e={});for(var i=e.steps||64,n=e.properties?e.properties:!Array.isArray(r)&&r.type==="Feature"&&r.properties?r.properties:{},s=[],a=0;a<i;a++)s.push(Kl(r,t,a*-360/i,e).geometry.coordinates);return s.push(s[0]),Pr([s],n)}function Xu(r,t,e){if(e===void 0&&(e={}),e.final===!0)return hy(r,t);var i=Rr(r),n=Rr(t),s=Cr(i[0]),a=Cr(n[0]),o=Cr(i[1]),l=Cr(n[1]),u=Math.sin(a-s)*Math.cos(l),c=Math.cos(o)*Math.sin(l)-Math.sin(o)*Math.cos(l)*Math.cos(a-s);return Bh(Math.atan2(u,c))}function hy(r,t){var e=Xu(t,r);return e=(e+180)%360,e}function cy(r,t){var e=ps(r,t),i=Xu(r,t),n=Kl(r,e/2,i);return n}function fy(r,t){t===void 0&&(t={});var e=cn(r),i=(e[0]+e[2])/2,n=(e[1]+e[3])/2;return ae([i,n],t.properties,t)}function Mp(r,t){t===void 0&&(t={});var e=0,i=0,n=0;return Jl(r,function(s){e+=s[0],i+=s[1],n++},!0),ae([e/n,i/n],t.properties)}function Np(r,t){switch(t===void 0&&(t={}),Jv(r)){case"Point":return ae(Rr(r),t.properties);case"Polygon":var e=[];Jl(r,function(v){e.push(v)});var i=Mp(r,{properties:t.properties}),n=i.geometry.coordinates,s=0,a=0,o=0,l,u,c,h,f,g,m,_,E=e.map(function(v){return[v[0]-n[0],v[1]-n[1]]});for(l=0;l<e.length-1;l++)u=E[l],h=u[0],g=u[1],c=E[l+1],f=c[0],m=c[1],_=h*m-f*g,o+=_,s+=(h+f)*_,a+=(g+m)*_;if(o===0)return i;var M=o*.5,y=1/(6*M);return ae([n[0]+y*s,n[1]+y*a],t.properties);default:var w=oy(r);return w?Np(w,{properties:t.properties}):Mp(r,{properties:t.properties})}}function bp(r){if(!r)throw new Error("geojson is required");var t=[];return Cf(r,function(e){dy(e,t)}),Yl(t)}function dy(r,t){var e=[],i=r.geometry;if(i!==null){switch(i.type){case"Polygon":e=La(i);break;case"LineString":e=[La(i)]}e.forEach(function(n){var s=py(n,r.properties);s.forEach(function(a){a.id=t.length,t.push(a)})})}}function py(r,t){var e=[];return r.reduce(function(i,n){var s=hn([i,n],t);return s.bbox=gy(i,n),e.push(s),n}),e}function gy(r,t){var e=r[0],i=r[1],n=t[0],s=t[1],a=e<n?e:n,o=i<s?i:s,l=e>n?e:n,u=i>s?i:s;return[a,o,l,u]}var rc={exports:{}},Nf={},Tp;function Dp(){return Tp||(Tp=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.earthRadius=63710088e-1,r.factors={centimeters:r.earthRadius*100,centimetres:r.earthRadius*100,degrees:r.earthRadius/111325,feet:r.earthRadius*3.28084,inches:r.earthRadius*39.37,kilometers:r.earthRadius/1e3,kilometres:r.earthRadius/1e3,meters:r.earthRadius,metres:r.earthRadius,miles:r.earthRadius/1609.344,millimeters:r.earthRadius*1e3,millimetres:r.earthRadius*1e3,nauticalmiles:r.earthRadius/1852,radians:1,yards:r.earthRadius*1.0936},r.unitsFactors={centimeters:100,centimetres:100,degrees:8982708286548395e-21,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:.0006213711922373339,millimeters:1e3,millimetres:1e3,nauticalmiles:.0005399568034557236,radians:1/r.earthRadius,yards:1.0936133},r.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function t(T,x,R){R===void 0&&(R={});var z={type:"Feature"};return(R.id===0||R.id)&&(z.id=R.id),R.bbox&&(z.bbox=R.bbox),z.properties=x||{},z.geometry=T,z}r.feature=t;function e(T,x,R){switch(T){case"Point":return i(x).geometry;case"LineString":return o(x).geometry;case"Polygon":return s(x).geometry;case"MultiPoint":return h(x).geometry;case"MultiLineString":return c(x).geometry;case"MultiPolygon":return f(x).geometry;default:throw new Error(T+" is invalid")}}r.geometry=e;function i(T,x,R){if(R===void 0&&(R={}),!T)throw new Error("coordinates is required");if(!Array.isArray(T))throw new Error("coordinates must be an Array");if(T.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!I(T[0])||!I(T[1]))throw new Error("coordinates must contain numbers");var z={type:"Point",coordinates:T};return t(z,x,R)}r.point=i;function n(T,x,R){return R===void 0&&(R={}),u(T.map(function(z){return i(z,x)}),R)}r.points=n;function s(T,x,R){R===void 0&&(R={});for(var z=0,rt=T;z<rt.length;z++){var Z=rt[z];if(Z.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var ct=0;ct<Z[Z.length-1].length;ct++)if(Z[Z.length-1][ct]!==Z[0][ct])throw new Error("First and last Position are not equivalent.")}var G={type:"Polygon",coordinates:T};return t(G,x,R)}r.polygon=s;function a(T,x,R){return R===void 0&&(R={}),u(T.map(function(z){return s(z,x)}),R)}r.polygons=a;function o(T,x,R){if(R===void 0&&(R={}),T.length<2)throw new Error("coordinates must be an array of two or more positions");var z={type:"LineString",coordinates:T};return t(z,x,R)}r.lineString=o;function l(T,x,R){return R===void 0&&(R={}),u(T.map(function(z){return o(z,x)}),R)}r.lineStrings=l;function u(T,x){x===void 0&&(x={});var R={type:"FeatureCollection"};return x.id&&(R.id=x.id),x.bbox&&(R.bbox=x.bbox),R.features=T,R}r.featureCollection=u;function c(T,x,R){R===void 0&&(R={});var z={type:"MultiLineString",coordinates:T};return t(z,x,R)}r.multiLineString=c;function h(T,x,R){R===void 0&&(R={});var z={type:"MultiPoint",coordinates:T};return t(z,x,R)}r.multiPoint=h;function f(T,x,R){R===void 0&&(R={});var z={type:"MultiPolygon",coordinates:T};return t(z,x,R)}r.multiPolygon=f;function g(T,x,R){R===void 0&&(R={});var z={type:"GeometryCollection",geometries:T};return t(z,x,R)}r.geometryCollection=g;function m(T,x){if(x===void 0&&(x=0),x&&!(x>=0))throw new Error("precision must be a positive number");var R=Math.pow(10,x||0);return Math.round(T*R)/R}r.round=m;function _(T,x){x===void 0&&(x="kilometers");var R=r.factors[x];if(!R)throw new Error(x+" units is invalid");return T*R}r.radiansToLength=_;function E(T,x){x===void 0&&(x="kilometers");var R=r.factors[x];if(!R)throw new Error(x+" units is invalid");return T/R}r.lengthToRadians=E;function M(T,x){return w(E(T,x))}r.lengthToDegrees=M;function y(T){var x=T%360;return x<0&&(x+=360),x}r.bearingToAzimuth=y;function w(T){var x=T%(2*Math.PI);return x*180/Math.PI}r.radiansToDegrees=w;function v(T){var x=T%360;return x*Math.PI/180}r.degreesToRadians=v;function S(T,x,R){if(x===void 0&&(x="kilometers"),R===void 0&&(R="kilometers"),!(T>=0))throw new Error("length must be a positive number");return _(E(T,x),R)}r.convertLength=S;function P(T,x,R){if(x===void 0&&(x="meters"),R===void 0&&(R="kilometers"),!(T>=0))throw new Error("area must be a positive number");var z=r.areaFactors[x];if(!z)throw new Error("invalid original units");var rt=r.areaFactors[R];if(!rt)throw new Error("invalid final units");return T/z*rt}r.convertArea=P;function I(T){return!isNaN(T)&&T!==null&&!Array.isArray(T)}r.isNumber=I;function b(T){return!!T&&T.constructor===Object}r.isObject=b;function D(T){if(!T)throw new Error("bbox is required");if(!Array.isArray(T))throw new Error("bbox must be an Array");if(T.length!==4&&T.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");T.forEach(function(x){if(!I(x))throw new Error("bbox must only contain numbers")})}r.validateBBox=D;function O(T){if(!T)throw new Error("id is required");if(["string","number"].indexOf(typeof T)===-1)throw new Error("id must be a number or a string")}r.validateId=O}(Nf)),Nf}var ze={},xp;function Op(){if(xp)return ze;xp=1,Object.defineProperty(ze,"__esModule",{value:!0});var r=Dp();function t(y,w,v){if(y!==null)for(var S,P,I,b,D,O,T,x=0,R=0,z,rt=y.type,Z=rt==="FeatureCollection",ct=rt==="Feature",G=Z?y.features.length:1,X=0;X<G;X++){T=Z?y.features[X].geometry:ct?y.geometry:y,z=T?T.type==="GeometryCollection":!1,D=z?T.geometries.length:1;for(var k=0;k<D;k++){var V=0,A=0;if(b=z?T.geometries[k]:T,b!==null){O=b.coordinates;var W=b.type;switch(x=v&&(W==="Polygon"||W==="MultiPolygon")?1:0,W){case null:break;case"Point":if(w(O,R,X,V,A)===!1)return!1;R++,V++;break;case"LineString":case"MultiPoint":for(S=0;S<O.length;S++){if(w(O[S],R,X,V,A)===!1)return!1;R++,W==="MultiPoint"&&V++}W==="LineString"&&V++;break;case"Polygon":case"MultiLineString":for(S=0;S<O.length;S++){for(P=0;P<O[S].length-x;P++){if(w(O[S][P],R,X,V,A)===!1)return!1;R++}W==="MultiLineString"&&V++,W==="Polygon"&&A++}W==="Polygon"&&V++;break;case"MultiPolygon":for(S=0;S<O.length;S++){for(A=0,P=0;P<O[S].length;P++){for(I=0;I<O[S][P].length-x;I++){if(w(O[S][P][I],R,X,V,A)===!1)return!1;R++}A++}V++}break;case"GeometryCollection":for(S=0;S<b.geometries.length;S++)if(t(b.geometries[S],w,v)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function e(y,w,v,S){var P=v;return t(y,function(I,b,D,O,T){b===0&&v===void 0?P=I:P=w(P,I,b,D,O,T)},S),P}function i(y,w){var v;switch(y.type){case"FeatureCollection":for(v=0;v<y.features.length&&w(y.features[v].properties,v)!==!1;v++);break;case"Feature":w(y.properties,0);break}}function n(y,w,v){var S=v;return i(y,function(P,I){I===0&&v===void 0?S=P:S=w(S,P,I)}),S}function s(y,w){if(y.type==="Feature")w(y,0);else if(y.type==="FeatureCollection")for(var v=0;v<y.features.length&&w(y.features[v],v)!==!1;v++);}function a(y,w,v){var S=v;return s(y,function(P,I){I===0&&v===void 0?S=P:S=w(S,P,I)}),S}function o(y){var w=[];return t(y,function(v){w.push(v)}),w}function l(y,w){var v,S,P,I,b,D,O,T,x,R,z=0,rt=y.type==="FeatureCollection",Z=y.type==="Feature",ct=rt?y.features.length:1;for(v=0;v<ct;v++){for(D=rt?y.features[v].geometry:Z?y.geometry:y,T=rt?y.features[v].properties:Z?y.properties:{},x=rt?y.features[v].bbox:Z?y.bbox:void 0,R=rt?y.features[v].id:Z?y.id:void 0,O=D?D.type==="GeometryCollection":!1,b=O?D.geometries.length:1,P=0;P<b;P++){if(I=O?D.geometries[P]:D,I===null){if(w(null,z,T,x,R)===!1)return!1;continue}switch(I.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(w(I,z,T,x,R)===!1)return!1;break}case"GeometryCollection":{for(S=0;S<I.geometries.length;S++)if(w(I.geometries[S],z,T,x,R)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}z++}}function u(y,w,v){var S=v;return l(y,function(P,I,b,D,O){I===0&&v===void 0?S=P:S=w(S,P,I,b,D,O)}),S}function c(y,w){l(y,function(v,S,P,I,b){var D=v===null?null:v.type;switch(D){case null:case"Point":case"LineString":case"Polygon":return w(r.feature(v,P,{bbox:I,id:b}),S,0)===!1?!1:void 0}var O;switch(D){case"MultiPoint":O="Point";break;case"MultiLineString":O="LineString";break;case"MultiPolygon":O="Polygon";break}for(var T=0;T<v.coordinates.length;T++){var x=v.coordinates[T],R={type:O,coordinates:x};if(w(r.feature(R,P),S,T)===!1)return!1}})}function h(y,w,v){var S=v;return c(y,function(P,I,b){I===0&&b===0&&v===void 0?S=P:S=w(S,P,I,b)}),S}function f(y,w){c(y,function(v,S,P){var I=0;if(v.geometry){var b=v.geometry.type;if(!(b==="Point"||b==="MultiPoint")){var D,O=0,T=0,x=0;if(t(v,function(R,z,rt,Z,ct){if(D===void 0||S>O||Z>T||ct>x){D=R,O=S,T=Z,x=ct,I=0;return}var G=r.lineString([D,R],v.properties);if(w(G,S,P,ct,I)===!1)return!1;I++,D=R})===!1)return!1}}})}function g(y,w,v){var S=v,P=!1;return f(y,function(I,b,D,O,T){P===!1&&v===void 0?S=I:S=w(S,I,b,D,O,T),P=!0}),S}function m(y,w){if(!y)throw new Error("geojson is required");c(y,function(v,S,P){if(v.geometry!==null){var I=v.geometry.type,b=v.geometry.coordinates;switch(I){case"LineString":if(w(v,S,P,0,0)===!1)return!1;break;case"Polygon":for(var D=0;D<b.length;D++)if(w(r.lineString(b[D],v.properties),S,P,D)===!1)return!1;break}}})}function _(y,w,v){var S=v;return m(y,function(P,I,b,D){I===0&&v===void 0?S=P:S=w(S,P,I,b,D)}),S}function E(y,w){if(w=w||{},!r.isObject(w))throw new Error("options is invalid");var v=w.featureIndex||0,S=w.multiFeatureIndex||0,P=w.geometryIndex||0,I=w.segmentIndex||0,b=w.properties,D;switch(y.type){case"FeatureCollection":v<0&&(v=y.features.length+v),b=b||y.features[v].properties,D=y.features[v].geometry;break;case"Feature":b=b||y.properties,D=y.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":D=y;break;default:throw new Error("geojson is invalid")}if(D===null)return null;var O=D.coordinates;switch(D.type){case"Point":case"MultiPoint":return null;case"LineString":return I<0&&(I=O.length+I-1),r.lineString([O[I],O[I+1]],b,w);case"Polygon":return P<0&&(P=O.length+P),I<0&&(I=O[P].length+I-1),r.lineString([O[P][I],O[P][I+1]],b,w);case"MultiLineString":return S<0&&(S=O.length+S),I<0&&(I=O[S].length+I-1),r.lineString([O[S][I],O[S][I+1]],b,w);case"MultiPolygon":return S<0&&(S=O.length+S),P<0&&(P=O[S].length+P),I<0&&(I=O[S][P].length-I-1),r.lineString([O[S][P][I],O[S][P][I+1]],b,w)}throw new Error("geojson is invalid")}function M(y,w){if(w=w||{},!r.isObject(w))throw new Error("options is invalid");var v=w.featureIndex||0,S=w.multiFeatureIndex||0,P=w.geometryIndex||0,I=w.coordIndex||0,b=w.properties,D;switch(y.type){case"FeatureCollection":v<0&&(v=y.features.length+v),b=b||y.features[v].properties,D=y.features[v].geometry;break;case"Feature":b=b||y.properties,D=y.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":D=y;break;default:throw new Error("geojson is invalid")}if(D===null)return null;var O=D.coordinates;switch(D.type){case"Point":return r.point(O,b,w);case"MultiPoint":return S<0&&(S=O.length+S),r.point(O[S],b,w);case"LineString":return I<0&&(I=O.length+I),r.point(O[I],b,w);case"Polygon":return P<0&&(P=O.length+P),I<0&&(I=O[P].length+I),r.point(O[P][I],b,w);case"MultiLineString":return S<0&&(S=O.length+S),I<0&&(I=O[S].length+I),r.point(O[S][I],b,w);case"MultiPolygon":return S<0&&(S=O.length+S),P<0&&(P=O[S].length+P),I<0&&(I=O[S][P].length-I),r.point(O[S][P][I],b,w)}throw new Error("geojson is invalid")}return ze.coordAll=o,ze.coordEach=t,ze.coordReduce=e,ze.featureEach=s,ze.featureReduce=a,ze.findPoint=M,ze.findSegment=E,ze.flattenEach=c,ze.flattenReduce=h,ze.geomEach=l,ze.geomReduce=u,ze.lineEach=m,ze.lineReduce=_,ze.propEach=i,ze.propReduce=n,ze.segmentEach=f,ze.segmentReduce=g,ze}var ic={},Ap;function my(){if(Ap)return ic;Ap=1,Object.defineProperty(ic,"__esModule",{value:!0});var r=Op();function t(e){var i=[1/0,1/0,-1/0,-1/0];return r.coordEach(e,function(n){i[0]>n[0]&&(i[0]=n[0]),i[1]>n[1]&&(i[1]=n[1]),i[2]<n[0]&&(i[2]=n[0]),i[3]<n[1]&&(i[3]=n[1])}),i}return t.default=t,ic.default=t,ic}var Lp;function vy(){if(Lp)return rc.exports;Lp=1;var r=_p(),t=Dp(),e=Op(),i=my().default,n=e.featureEach;e.coordEach,t.polygon;var s=t.featureCollection;function a(o){var l=new r(o);return l.insert=function(u){if(u.type!=="Feature")throw new Error("invalid feature");return u.bbox=u.bbox?u.bbox:i(u),r.prototype.insert.call(this,u)},l.load=function(u){var c=[];return Array.isArray(u)?u.forEach(function(h){if(h.type!=="Feature")throw new Error("invalid features");h.bbox=h.bbox?h.bbox:i(h),c.push(h)}):n(u,function(h){if(h.type!=="Feature")throw new Error("invalid features");h.bbox=h.bbox?h.bbox:i(h),c.push(h)}),r.prototype.load.call(this,c)},l.remove=function(u,c){if(u.type!=="Feature")throw new Error("invalid feature");return u.bbox=u.bbox?u.bbox:i(u),r.prototype.remove.call(this,u,c)},l.clear=function(){return r.prototype.clear.call(this)},l.search=function(u){var c=r.prototype.search.call(this,this.toBBox(u));return s(c)},l.collides=function(u){return r.prototype.collides.call(this,this.toBBox(u))},l.all=function(){var u=r.prototype.all.call(this);return s(u)},l.toJSON=function(){return r.prototype.toJSON.call(this)},l.fromJSON=function(u){return r.prototype.fromJSON.call(this,u)},l.toBBox=function(u){var c;if(u.bbox)c=u.bbox;else if(Array.isArray(u)&&u.length===4)c=u;else if(Array.isArray(u)&&u.length===6)c=[u[0],u[1],u[3],u[4]];else if(u.type==="Feature")c=i(u);else if(u.type==="FeatureCollection")c=i(u);else throw new Error("invalid geojson");return{minX:c[0],minY:c[1],maxX:c[2],maxY:c[3]}},l}return rc.exports=a,rc.exports.default=a,rc.exports}var yy=vy();const _y=vp(yy);function Rp(r,t){var e={},i=[];if(r.type==="LineString"&&(r=un(r)),t.type==="LineString"&&(t=un(t)),r.type==="Feature"&&t.type==="Feature"&&r.geometry!==null&&t.geometry!==null&&r.geometry.type==="LineString"&&t.geometry.type==="LineString"&&r.geometry.coordinates.length===2&&t.geometry.coordinates.length===2){var n=Fp(r,t);return n&&i.push(n),Yl(i)}var s=_y();return s.load(bp(t)),$h(bp(r),function(a){$h(s.search(a),function(o){var l=Fp(a,o);if(l){var u=La(l).join(",");e[u]||(e[u]=!0,i.push(l))}})}),Yl(i)}function Fp(r,t){var e=La(r),i=La(t);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(i.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var n=e[0][0],s=e[0][1],a=e[1][0],o=e[1][1],l=i[0][0],u=i[0][1],c=i[1][0],h=i[1][1],f=(h-u)*(a-n)-(c-l)*(o-s),g=(c-l)*(s-u)-(h-u)*(n-l),m=(a-n)*(s-u)-(o-s)*(n-l);if(f===0)return null;var _=g/f,E=m/f;if(_>=0&&_<=1&&E>=0&&E<=1){var M=n+_*(a-n),y=s+_*(o-s);return ae([M,y])}return null}function wy(r,t,e){e===void 0&&(e={});var i=ae([1/0,1/0],{dist:1/0}),n=0;return Cf(r,function(s){for(var a=La(s),o=0;o<a.length-1;o++){var l=ae(a[o]);l.properties.dist=ps(t,l,e);var u=ae(a[o+1]);u.properties.dist=ps(t,u,e);var c=ps(l,u,e),h=Math.max(l.properties.dist,u.properties.dist),f=Xu(l,u),g=Kl(t,h,f+90,e),m=Kl(t,h,f-90,e),_=Rp(hn([g.geometry.coordinates,m.geometry.coordinates]),hn([l.geometry.coordinates,u.geometry.coordinates])),E=null;_.features.length>0&&(E=_.features[0],E.properties.dist=ps(t,E,e),E.properties.location=n+ps(l,E,e)),l.properties.dist<i.properties.dist&&(i=l,i.properties.index=o,i.properties.location=n),u.properties.dist<i.properties.dist&&(i=u,i.properties.index=o+1,i.properties.location=n+c),E&&E.properties.dist<i.properties.dist&&(i=E,i.properties.index=o),n+=c}}),i}function Gp(r,t,e){e===void 0&&(e={});var i=Rr(r),n=Rr(t);n[0]+=n[0]-i[0]>180?-360:i[0]-n[0]>180?360:0;var s=Ey(i,n),a=Pf(s,"meters",e.units);return a}function Ey(r,t,e){e=e===void 0?hr:Number(e);var i=e,n=r[1]*Math.PI/180,s=t[1]*Math.PI/180,a=s-n,o=Math.abs(t[0]-r[0])*Math.PI/180;o>Math.PI&&(o-=2*Math.PI);var l=Math.log(Math.tan(s/2+Math.PI/4)/Math.tan(n/2+Math.PI/4)),u=Math.abs(l)>1e-11?a/l:Math.cos(n),c=Math.sqrt(a*a+u*u*o*o),h=c*i;return h}function Sy(r,t,e){if(e===void 0&&(e={}),e.method||(e.method="geodesic"),e.units||(e.units="kilometers"),!r)throw new Error("pt is required");if(Array.isArray(r)?r=ae(r):r.type==="Point"?r=un(r):mp(r,"Point","point"),!t)throw new Error("line is required");Array.isArray(t)?t=hn(t):t.type==="LineString"?t=un(t):mp(t,"LineString","line");var i=1/0,n=r.geometry.coordinates;return Yv(t,function(s){var a=s.geometry.coordinates[0],o=s.geometry.coordinates[1],l=Py(n,a,o,e);l<i&&(i=l)}),Pf(i,"degrees",e.units)}function Py(r,t,e,i){var n=[e[0]-t[0],e[1]-t[1]],s=[r[0]-t[0],r[1]-t[1]],a=kp(s,n);if(a<=0)return bf(r,t,{method:i.method,units:"degrees"});var o=kp(n,n);if(o<=a)return bf(r,e,{method:i.method,units:"degrees"});var l=a/o,u=[t[0]+l*n[0],t[1]+l*n[1]];return bf(r,u,{method:i.method,units:"degrees"})}function kp(r,t){return r[0]*t[0]+r[1]*t[1]}function bf(r,t,e){return e.method==="planar"?Gp(r,t,e):ps(r,t,e)}var zp=6378137;function Cy(r){return Xv(r,function(t,e){return t+Iy(e)},0)}function Iy(r){var t=0,e;switch(r.type){case"Polygon":return Vp(r.coordinates);case"MultiPolygon":for(e=0;e<r.coordinates.length;e++)t+=Vp(r.coordinates[e]);return t;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}function Vp(r){var t=0;if(r&&r.length>0){t+=Math.abs(Up(r[0]));for(var e=1;e<r.length;e++)t-=Math.abs(Up(r[e]))}return t}function Up(r){var t,e,i,n,s,a,o,l=0,u=r.length;if(u>2){for(o=0;o<u;o++)o===u-2?(n=u-2,s=u-1,a=0):o===u-1?(n=u-1,s=0,a=1):(n=o,s=o+1,a=o+2),t=r[n],e=r[s],i=r[a],l+=(Tf(i[0])-Tf(t[0]))*Math.sin(Tf(e[1]));l=l*zp*zp/2}return l}function Tf(r){return r*Math.PI/180}function My(r,t,e){e===void 0&&(e={});for(var i=yi(r),n=i.coordinates,s=0,a=0;a<n.length&&!(t>=s&&a===n.length-1);a++)if(s>=t){var o=t-s;if(o){var l=Xu(n[a],n[a-1])-180,u=Kl(n[a],o,l,e);return u}else return ae(n[a])}else s+=ps(n[a],n[a+1],e);return ae(n[n.length-1])}function gs(r,t,e){e===void 0&&(e={});for(var i=Rr(r),n=La(t),s=0;s<n.length-1;s++){var a=!1;if(e.ignoreEndVertices&&(s===0&&(a="start"),s===n.length-2&&(a="end"),s===0&&s+1===n.length-1&&(a="both")),Ny(n[s],n[s+1],i,a,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function Ny(r,t,e,i,n){var s=e[0],a=e[1],o=r[0],l=r[1],u=t[0],c=t[1],h=e[0]-o,f=e[1]-l,g=u-o,m=c-l,_=h*m-f*g;if(n!==null){if(Math.abs(_)>n)return!1}else if(_!==0)return!1;if(i){if(i==="start")return Math.abs(g)>=Math.abs(m)?g>0?o<s&&s<=u:u<=s&&s<o:m>0?l<a&&a<=c:c<=a&&a<l;if(i==="end")return Math.abs(g)>=Math.abs(m)?g>0?o<=s&&s<u:u<s&&s<=o:m>0?l<=a&&a<c:c<a&&a<=l;if(i==="both")return Math.abs(g)>=Math.abs(m)?g>0?o<s&&s<u:u<s&&s<o:m>0?l<a&&a<c:c<a&&a<l}else return Math.abs(g)>=Math.abs(m)?g>0?o<=s&&s<=u:u<=s&&s<=o:m>0?l<=a&&a<=c:c<=a&&a<=l;return!1}function by(r,t){var e=yi(r),i=yi(t),n=e.type,s=i.type;switch(n){case"Point":switch(s){case"MultiPoint":return Ty(e,i);case"LineString":return gs(e,i,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return Fi(e,i,{ignoreBoundary:!0});default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"MultiPoint":return Dy(e,i);case"LineString":return xy(e,i);case"Polygon":case"MultiPolygon":return Oy(e,i);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"LineString":return Ay(e,i);case"Polygon":case"MultiPolygon":return Ly(e,i);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Polygon":case"MultiPolygon":return Ry(e,i);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+n+" geometry not supported")}}function Ty(r,t){var e,i=!1;for(e=0;e<t.coordinates.length;e++)if(Wp(t.coordinates[e],r.coordinates)){i=!0;break}return i}function Dy(r,t){for(var e=0;e<r.coordinates.length;e++){for(var i=!1,n=0;n<t.coordinates.length;n++)Wp(r.coordinates[e],t.coordinates[n])&&(i=!0);if(!i)return!1}return!0}function xy(r,t){for(var e=!1,i=0;i<r.coordinates.length;i++){if(!gs(r.coordinates[i],t))return!1;e||(e=gs(r.coordinates[i],t,{ignoreEndVertices:!0}))}return e}function Oy(r,t){for(var e=!0,i=!1,n=0;n<r.coordinates.length;n++){if(i=Fi(r.coordinates[1],t),!i){e=!1;break}i=Fi(r.coordinates[1],t,{ignoreBoundary:!0})}return e&&i}function Ay(r,t){for(var e=0;e<r.coordinates.length;e++)if(!gs(r.coordinates[e],t))return!1;return!0}function Ly(r,t){var e=cn(t),i=cn(r);if(!qp(e,i))return!1;for(var n=!1,s=0;s<r.coordinates.length-1;s++){if(!Fi(r.coordinates[s],t))return!1;if(n||(n=Fi(r.coordinates[s],t,{ignoreBoundary:!0})),!n){var a=Fy(r.coordinates[s],r.coordinates[s+1]);n=Fi(a,t,{ignoreBoundary:!0})}}return n}function Ry(r,t){var e=cn(r),i=cn(t);if(!qp(i,e))return!1;for(var n=0;n<r.coordinates[0].length;n++)if(!Fi(r.coordinates[0][n],t))return!1;return!0}function qp(r,t){return!(r[0]>t[0]||r[2]<t[2]||r[1]>t[1]||r[3]<t[3])}function Wp(r,t){return r[0]===t[0]&&r[1]===t[1]}function Fy(r,t){return[(r[0]+t[0])/2,(r[1]+t[1])/2]}function Gy(r,t,e){e===void 0&&(e={});var i;e.final?i=Hp(Rr(t),Rr(r)):i=Hp(Rr(r),Rr(t));var n=i>180?-(360-i):i;return n}function Hp(r,t){var e=Cr(r[1]),i=Cr(t[1]),n=Cr(t[0]-r[0]);n>Math.PI&&(n-=2*Math.PI),n<-Math.PI&&(n+=2*Math.PI);var s=Math.log(Math.tan(i/2+Math.PI/4)/Math.tan(e/2+Math.PI/4)),a=Math.atan2(n,s);return(Bh(a)+360)%360}function ky(r,t,e,i){i===void 0&&(i={});var n=t<0,s=Pf(Math.abs(t),i.units,"meters");n&&(s=-Math.abs(s));var a=Rr(r),o=zy(a,s,e);return o[0]+=o[0]-a[0]>180?-360:a[0]-o[0]>180?360:0,ae(o,i.properties)}function zy(r,t,e,i){i=i===void 0?hr:Number(i);var n=t/i,s=r[0]*Math.PI/180,a=Cr(r[1]),o=Cr(e),l=n*Math.cos(o),u=a+l;Math.abs(u)>Math.PI/2&&(u=u>0?Math.PI-u:-Math.PI-u);var c=Math.log(Math.tan(u/2+Math.PI/4)/Math.tan(a/2+Math.PI/4)),h=Math.abs(c)>1e-11?l/c:Math.cos(a),f=n*Math.sin(o)/h,g=s+f;return[(g*180/Math.PI+540)%360-180,u*180/Math.PI]}function Vy(r,t){var e=yi(r),i=yi(t),n=e.type,s=i.type,a=e.coordinates,o=i.coordinates;switch(n){case"Point":switch(s){case"Point":return Df(a,o);default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"Point":return Uy(e,i);case"MultiPoint":return qy(e,i);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"Point":return gs(i,e,{ignoreEndVertices:!0});case"LineString":return Xy(e,i);case"MultiPoint":return Wy(e,i);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Point":return Fi(i,e,{ignoreBoundary:!0});case"LineString":return Yy(e,i);case"Polygon":return Jy(e,i);case"MultiPoint":return Hy(e,i);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+n+" geometry not supported")}}function Uy(r,t){var e,i=!1;for(e=0;e<r.coordinates.length;e++)if(Df(r.coordinates[e],t.coordinates)){i=!0;break}return i}function qy(r,t){for(var e=0,i=t.coordinates;e<i.length;e++){for(var n=i[e],s=!1,a=0,o=r.coordinates;a<o.length;a++){var l=o[a];if(Df(n,l)){s=!0;break}}if(!s)return!1}return!0}function Wy(r,t){for(var e=!1,i=0,n=t.coordinates;i<n.length;i++){var s=n[i];if(gs(s,r,{ignoreEndVertices:!0})&&(e=!0),!gs(s,r))return!1}return!!e}function Hy(r,t){for(var e=0,i=t.coordinates;e<i.length;e++){var n=i[e];if(!Fi(n,r,{ignoreBoundary:!0}))return!1}return!0}function Xy(r,t){for(var e=!1,i=0,n=t.coordinates;i<n.length;i++){var s=n[i];if(gs({type:"Point",coordinates:s},r,{ignoreEndVertices:!0})&&(e=!0),!gs({type:"Point",coordinates:s},r,{ignoreEndVertices:!1}))return!1}return e}function Yy(r,t){var e=!1,i=0,n=cn(r),s=cn(t);if(!Xp(n,s))return!1;for(i;i<t.coordinates.length-1;i++){var a=Ky(t.coordinates[i],t.coordinates[i+1]);if(Fi({type:"Point",coordinates:a},r,{ignoreBoundary:!0})){e=!0;break}}return e}function Jy(r,t){if(r.type==="Feature"&&r.geometry===null||t.type==="Feature"&&t.geometry===null)return!1;var e=cn(r),i=cn(t);if(!Xp(e,i))return!1;for(var n=yi(t).coordinates,s=0,a=n;s<a.length;s++)for(var o=a[s],l=0,u=o;l<u.length;l++){var c=u[l];if(!Fi(c,r))return!1}return!0}function Xp(r,t){return!(r[0]>t[0]||r[2]<t[2]||r[1]>t[1]||r[3]<t[3])}function Df(r,t){return r[0]===t[0]&&r[1]===t[1]}function Ky(r,t){return[(r[0]+t[0])/2,(r[1]+t[1])/2]}/**
3
+ `).join(" ")}`)):this._sceneObjRefs.set(s,[n]);const u=this.getLastSceneObject(s);this._refs[s]=u,this._refsChanged.emit(u,o)}};this.d(e.sceneObjCreatedEvent.don(n=>{const s=(a,o)=>i(n,a,o);n.ref&&s(n.ref,void 0),n.refChanged.don(s)})),this.d(e.sceneObjToDestroyEvent.don(n=>{n.ref&&i(n,void 0,n.ref)}))}get sceneObjRefs(){return this._sceneObjRefs}get refs(){return this._refs}get refsChanged(){return this._refsChanged}getLastSceneObject(e){const i=this.getSceneObjects(e);if(i)return i[i.length-1]}getSceneObjects(e){const i=this._sceneObjRefs.get(e);if(!(!i||i.length===0))return i}}function fp(r,t){const[e,i,n]=d.getReactFuncs(r),s=d.react(void 0),a=()=>{const o=e()??t;s.value=o&&ft.context.getStrFromEnv(o)};return a(),n&&s.d(n.don(a)),s.d(ft.context.environmentVariablesChanged.don(a)),s}function qv(r){do{const t=r.replace(/\${(.*?)\}/,(e,i)=>{const n=ft.context.getEnv(i);return n===void 0?(console.warn(`环境变量(${i})不存在,无法进行转换`),"{env-error}"):n});if(t===r)break;r=t}while(!0);return r}class Wv extends d.Destroyable{constructor(){super();p(this,"_esObjConstructors",new Map);p(this,"_sceneObjs",new Map);p(this,"_sceneObjCreatedEvent",new d.Event);p(this,"_sceneObjToDestroyEvent",new d.Event);p(this,"_refsManager",this.dv(new Uv(this)));p(this,"_environmentVariables",window.ESSDK_ENV||{});p(this,"_environmentVariablesChanged",this.dv(new d.Event))}get typeNames(){return this._esObjConstructors.keys()}get sceneObjs(){return this._sceneObjs.values()}get sceneObjCreatedEvent(){return this._sceneObjCreatedEvent}get sceneObjToDestroyEvent(){return this._sceneObjToDestroyEvent}get refsManager(){return this._refsManager}get $refs(){return this._refsManager.refs}register(e,i,n){return this._esObjConstructors.has(e)&&console.warn(`register warn: ${e} has registered ! will be override!`),this._esObjConstructors.set(e,i),n&&d.setExtProp(i,"__sceneObjExtraInfo",n),e}_addSceneObject(e){this._sceneObjs.set(e.id,e),this._sceneObjCreatedEvent.emit(e),e.d(()=>this._deleteSceneObject(e))}addSceneObject(e){this._addSceneObject(e)}_deleteSceneObject(e){this._sceneObjToDestroyEvent.emit(e),this._sceneObjs.delete(e.id)}deleteSceneObject(e){this._deleteSceneObject(e)}createSceneObjectFromClass(e,i){if(!i||this._sceneObjs.has(i)){const s=d.createGuid();i&&console.warn(`已存在相同id的对象!id自动变更!${i} -> ${s} 请注意:id变更可能导致引用失效!`),i=s}if(!i)throw new Error("id不能为空!");const n=new e(i);return n.id!==i&&(console.warn(`sceneObj.id(${n.id}) !== id(${i}) sceneObjectType: ${n.typeName}`),console.warn("出现这种问题有可能是自定义的场景对象,没有在构造函数中传递id参数!示例如下:"),console.warn("class XXX extends XXX { constructor(id) { super(id); } }")),this._addSceneObject(n),n}createSceneObject(e,i){if(typeof e=="string"){const n=this._getSceneObjConstructor(e);if(!n){console.warn(`Cannot find SceneObjectType: ${e}`);return}return this.createSceneObjectFromClass(n,i)}else return this.createSceneObjectFromClass(e,i)}createSceneObjectFromJson(e){const i=this.createSceneObject(e.type,e.id);return i&&(i.json=e),i}destroySceneObject(e){return this._deleteSceneObject(e),e.destroy(),e.isDestroyed()}getSceneObjectById(e){return this._sceneObjs.get(e)}getSceneObject(e){if(!e&&e!="")return Array.from(this._sceneObjs.values());if(e.startsWith("ES")){const i=[];for(const n of this._sceneObjs.values())n.typeName===e&&i.push(n);return i}else return this._sceneObjs.get(e)}_getSceneObjConstructor(e){const i=this._esObjConstructors.get(e);if(i)return i}getProps(e){const i=this._getSceneObjConstructor(e);if(!i){console.warn(`cannot get constructor from type: ${e}`);return}return d.getExtProp(i,"__sceneObjExtraInfo")}setProps(e,i){const n=this._getSceneObjConstructor(e);if(!n){console.warn(`cannot get constructor from type: ${e}`);return}let s=d.getExtProp(n,"__sceneObjExtraInfo");s||(s={},d.setExtProp(n,"__sceneObjExtraInfo",s)),Object.assign(s,i)}getProp(e,i){const n=this.getProps(e);return n&&n[i]}setProp(e,i,n){this.setProps(e,{[i]:n})}get environmentVariables(){return this._environmentVariables}set environmentVariables(e){for(let[i,n]of Object.entries(e))this.setEnv(i,n)}get environmentVariablesChanged(){return this._environmentVariablesChanged}setEnv(e,i){if(this._environmentVariables[e]!==i){const n=this._environmentVariables[e];this._environmentVariables[e]=i,this._environmentVariablesChanged.emit(e,i,n)}window.ESSDK_ENV={...this._environmentVariables}}getEnv(e){return this._environmentVariables[e]}getStrFromEnv(e){return qv(e)}createEnvStrReact(e,i){return fp(e,i)}createEvnStrReact(e,i){return fp(e,i)}}const Nt=class Nt extends d.Destroyable{constructor(e){super();p(this,"_components",this.dv(new d.ObservableSet));p(this,"_viewerAttached",this.dv(new d.Event));p(this,"_viewerDetached",this.dv(new d.Event));p(this,"_attachedViewers",(()=>{const e=new Set;return this.d(this._viewerAttached.don(i=>{e.add(i)})),this.d(this._viewerDetached.don(i=>{e.delete(i)})),e})());p(this,"_createdEvent",this.dv(new d.Event));p(this,"_flushEvent",this.dv(new d.Event));p(this,"_id");p(this,"viewer");p(this,"viewerChanged",this.ad(new d.Event));p(this,"combinationClass",!1);p(this,"mainClass");p(this,"_updateFuncReact",this.dv(d.react(void 0)));p(this,"_toDestroyFuncReact",this.dv(d.react(void 0)));p(this,"_parentID",this.disposeVar(d.react(void 0)));e!==void 0&&(typeof e!="string"?console.warn(`对象id必须是字符串类型,当前id的类型是${typeof e},值为${e}`):e.trim()===""?console.warn("场景对象创建时的id不能是空字符串!"):e.trim()!==e&&console.warn(`id前后有空字符串!id: ${e}`)),this._id=e??d.createGuid(),this._initName();{const i=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(n){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${n}`)}};i(),this.d(this.execOnceFuncStrChanged.don(i))}{const i=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(s){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};i(),this.d(this.updateFuncStrChanged.don(i));let n;this.d(()=>n&&n.destroy()),this.d(this.updateFuncChanged.don(()=>{n&&n.cancel(),this.updateFunc&&(n=n||d.createAnimateFrame(),n.restart(void 0,s=>{this.updateFunc&&this.updateFunc(this,s)}))}))}{const i=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(n){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${n}`),this.toDestroyFunc=void 0}};i(),this.d(this.toDestroyFuncStrChanged.don(i)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}}static get envs(){return Nt.context.environmentVariables}static get $refs(){return Nt.context.refsManager.refs}get components(){return this._components}get viewerAttached(){return this._viewerAttached}get viewerDetached(){return this._viewerDetached}get attachedViewers(){return this._attachedViewers}removefromViewer(e){this.attachedViewers.has(e)&&e.delete(this)}addToViewer(e){this.attachedViewers.has(e)||e.add(this)}registerAttachedObject(e){const i=new Map;this.d(()=>{i.size>0&&console.warn("viewerPropSceneObjects.size > 0")}),this.d(this._viewerAttached.don(n=>{const s=e(n);s&&i.set(n,s)})),this.d(this._viewerDetached.don(n=>{if(!i.has(n))return;const s=i.get(n);s&&(s.destroy(),i.delete(n))}))}createAttachedObject(e){const i=new Map,n=()=>{for(let[l,u]of i.entries())u.destroy();i.clear()},s=l=>{const u=e(l);u&&i.set(l,u)};for(let l of this.attachedViewers)s(l);const a=this._viewerAttached.don(s),o=this._viewerDetached.don(l=>{if(!i.has(l))return;const u=i.get(l);u&&(u.destroy(),i.delete(l))});return()=>{o(),a(),n()}}registerAttachedObjectForContainer(e){this.registerAttachedObject(i=>new Hv(i,e))}get createdEvent(){return this._createdEvent}get flushEvent(){return this._flushEvent}flush(){this.flushEvent.emit()}get id(){return this._id}get typeName(){return this.constructor.type}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return Nt.createDefaultProps()}getMainClass(){return this.mainClass??this}_innerGetJson(e=!0){const i={id:this.id,type:this.typeName};for(let n of Object.keys(this.defaultProps))if(e){let s,a=this.defaultProps[n];a instanceof d.ReactiveVariable?s=a.equals(this[n]):s=a===this[n],s||(i[n]=this[n])}else i[n]=this[n];return i}_innerGetJson1(e=!0){const i={id:this.id,type:this.typeName},n=this.constructor.properties;for(let s of Object.keys(n))if(e){let a,o=n[s];o instanceof d.ReactiveVariable?a=o.equals(this[s]):a=o===this[s],a||(i[s]=this[s])}else i[s]=this[s];return i}_innerSetJson(e,i,n){if(!(e instanceof Object)||e.type&&e.type!==this.typeName){console.error(`value.type && value.type${e.type} !== this.typeName${this.typeName}`);return}e.id&&e.id!==this.id&&console.warn(`value.id === undefined || value.id${e.id} !== this.id(${this.id})`);const s=i||[];s.push("id","type");const a=Object.keys(this.defaultProps).filter(o=>!s.includes(o));for(let o of a)if(o in e)this[o]=e[o]===null?void 0:e[o];else if(!(n??!1)){let l=this.defaultProps[o];l instanceof d.ReactiveVariable&&(l=l.value),this[o]=l}}get json(){return this._innerGetJson()}set json(e){this._innerSetJson(e)}get _jsonStr(){return JSON.stringify(this.json,null,4)}set _jsonStr(e){this._innerSetJson(JSON.parse(e))}get updateFunc(){return this._updateFuncReact.value}set updateFunc(e){this._updateFuncReact.value=e}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(e){this._toDestroyFuncReact.value=e}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get parentID(){return this._parentID.value}set parentID(e){this._parentID.value=e}get parentIDChanged(){return this._parentID.changed}getProperties(e){return[new H("ESSceneObject","ESSceneObject",[new nt("对象类型","类型(type)",!1,!0,[this,"typeName"]),new nt("对象id","唯一标识符(id)",!1,!0,[this,"id"]),new nt("对象名称","名称(name)",!1,!1,[this,"name"]),new nt("ref","标识(ref),可通过 ESSceneObject.$refs.xxx快速获取到对象",!0,!1,[this,"ref"]),new Y("extras","扩展属性,必须整体赋值(extras)",!0,!1,[this,"extras"]),new lp("JSON","对象JSON数据动态更改导入导出。",!1,!1,()=>this._jsonStr,i=>i&&(this._jsonStr=i))])]}getESProperties(){return{defaultMenu:"basic",basic:[],general:[],dataSource:[],location:[],coordinate:[],style:[]}}static register1(e,i,n){let s={},a=i;for(;a&&a!==Object;)a.hasOwnProperty("properties")&&(s={...s,...a.properties}),a=Object.getPrototypeOf(a);return i.properties=Object.freeze(s),d.extendClassProps(i.prototype,()=>s),this.register(e,i,n),e}};p(Nt,"context",new Wv),p(Nt,"register",Nt.context.register.bind(Nt.context)),p(Nt,"create",Nt.context.createSceneObject.bind(Nt.context)),p(Nt,"createFromClass",Nt.context.createSceneObjectFromClass.bind(Nt.context)),p(Nt,"createFromJson",Nt.context.createSceneObjectFromJson.bind(Nt.context)),p(Nt,"destroySceneObject",Nt.context.destroySceneObject.bind(Nt.context)),p(Nt,"getSceneObjById",Nt.context.getSceneObjectById.bind(Nt.context)),p(Nt,"getSceneObj",Nt.context.getSceneObject.bind(Nt.context)),p(Nt,"getEnv",Nt.context.getEnv.bind(Nt.context)),p(Nt,"setEnv",Nt.context.setEnv.bind(Nt.context)),p(Nt,"getStrFromEnv",Nt.context.getStrFromEnv.bind(Nt.context)),p(Nt,"getSceneObjectById",Nt.context.getSceneObjectById.bind(Nt.context)),p(Nt,"getSceneObject",Nt.context.getSceneObject.bind(Nt.context)),p(Nt,"defaults",{}),p(Nt,"createDefaultProps",()=>({name:"未命名场景对象",ref:void 0,extras:d.reactJson(void 0),devTags:d.reactArrayWithUndefined(void 0),execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0})),p(Nt,"type",Nt.register1("ESSceneObject",Nt,{chsName:"场景类",tags:["ESObjects"],description:""})),p(Nt,"properties",{reff:void 0});let ft=Nt;d.extendClassProps(ft.prototype,ft.createDefaultProps);class Hv extends d.Destroyable{constructor(t,e){super(),this.dv(new d.ObjResettingWithEvent(t.subContainerChanged,()=>{if(t.subContainer)return e(t,t.subContainer)}))}}function yf(r){return d.reactDeepArrayWithUndefined(r,(t,e)=>t[0]===e[0]&&t[1]===e[1],t=>[...t])}function dp(r,t){const e=new Array;for(let i of r)e.push(t(i));return e}function _f(r,t){return r===void 0&&t===void 0?!0:!r||!t?!1:r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]}var hr=63710088e-1,pp={centimeters:hr*100,centimetres:hr*100,degrees:hr/111325,feet:hr*3.28084,inches:hr*39.37,kilometers:hr/1e3,kilometres:hr/1e3,meters:hr,metres:hr,miles:hr/1609.344,millimeters:hr*1e3,millimetres:hr*1e3,nauticalmiles:hr/1852,radians:1,yards:hr*1.0936};function un(r,t,e){e===void 0&&(e={});var i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=t||{},i.geometry=r,i}function ae(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!gp(r[0])||!gp(r[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:r};return un(i,t,e)}function Pr(r,t,e){e===void 0&&(e={});for(var i=0,n=r;i<n.length;i++){var s=n[i];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<s[s.length-1].length;a++)if(s[s.length-1][a]!==s[0][a])throw new Error("First and last Position are not equivalent.")}var o={type:"Polygon",coordinates:r};return un(o,t,e)}function hn(r,t,e){if(e===void 0&&(e={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:r};return un(i,t,e)}function Yl(r,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}function wf(r,t,e){e===void 0&&(e={});var i={type:"MultiPolygon",coordinates:r};return un(i,t,e)}function Ef(r,t){t===void 0&&(t="kilometers");var e=pp[t];if(!e)throw new Error(t+" units is invalid");return r*e}function Sf(r,t){t===void 0&&(t="kilometers");var e=pp[t];if(!e)throw new Error(t+" units is invalid");return r/e}function Bh(r){var t=r%(2*Math.PI);return t*180/Math.PI}function Cr(r){var t=r%360;return t*Math.PI/180}function Pf(r,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("length must be a positive number");return Ef(Sf(r,t),e)}function gp(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function Jl(r,t,e){if(r!==null)for(var i,n,s,a,o,l,u,c=0,h=0,f,g=r.type,m=g==="FeatureCollection",_=g==="Feature",E=m?r.features.length:1,M=0;M<E;M++){u=m?r.features[M].geometry:_?r.geometry:r,f=u?u.type==="GeometryCollection":!1,o=f?u.geometries.length:1;for(var y=0;y<o;y++){var w=0,v=0;if(a=f?u.geometries[y]:u,a!==null){l=a.coordinates;var S=a.type;switch(c=e&&(S==="Polygon"||S==="MultiPolygon")?1:0,S){case null:break;case"Point":if(t(l,h,M,w,v)===!1)return!1;h++,w++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(t(l[i],h,M,w,v)===!1)return!1;h++,S==="MultiPoint"&&w++}S==="LineString"&&w++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(n=0;n<l[i].length-c;n++){if(t(l[i][n],h,M,w,v)===!1)return!1;h++}S==="MultiLineString"&&w++,S==="Polygon"&&v++}S==="Polygon"&&w++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(v=0,n=0;n<l[i].length;n++){for(s=0;s<l[i][n].length-c;s++){if(t(l[i][n][s],h,M,w,v)===!1)return!1;h++}v++}w++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(Jl(a.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function $h(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}function jh(r,t){var e,i,n,s,a,o,l,u,c,h,f=0,g=r.type==="FeatureCollection",m=r.type==="Feature",_=g?r.features.length:1;for(e=0;e<_;e++){for(o=g?r.features[e].geometry:m?r.geometry:r,u=g?r.features[e].properties:m?r.properties:{},c=g?r.features[e].bbox:m?r.bbox:void 0,h=g?r.features[e].id:m?r.id:void 0,l=o?o.type==="GeometryCollection":!1,a=l?o.geometries.length:1,n=0;n<a;n++){if(s=l?o.geometries[n]:o,s===null){if(t(null,f,u,c,h)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(s,f,u,c,h)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<s.geometries.length;i++)if(t(s.geometries[i],f,u,c,h)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function Xv(r,t,e){var i=e;return jh(r,function(n,s,a,o,l){i=t(i,n,s,a,o,l)}),i}function Cf(r,t){jh(r,function(e,i,n,s,a){var o=e===null?null:e.type;switch(o){case null:case"Point":case"LineString":case"Polygon":return t(un(e,n,{bbox:s,id:a}),i,0)===!1?!1:void 0}var l;switch(o){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var c=e.coordinates[u],h={type:l,coordinates:c};if(t(un(h,n),i,u)===!1)return!1}})}function Yv(r,t){Cf(r,function(e,i,n){var s=0;if(e.geometry){var a=e.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var o,l=0,u=0,c=0;if(Jl(e,function(h,f,g,m,_){if(o===void 0||i>l||m>u||_>c){o=h,l=i,u=m,c=_,s=0;return}var E=hn([o,h],e.properties);if(t(E,i,n,_,s)===!1)return!1;s++,o=h})===!1)return!1}}})}function cn(r){var t=[1/0,1/0,-1/0,-1/0];return Jl(r,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}cn.default=cn;function Rr(r){if(!r)throw new Error("coord is required");if(!Array.isArray(r)){if(r.type==="Feature"&&r.geometry!==null&&r.geometry.type==="Point")return r.geometry.coordinates;if(r.type==="Point")return r.coordinates}if(Array.isArray(r)&&r.length>=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return r;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function La(r){if(Array.isArray(r))return r;if(r.type==="Feature"){if(r.geometry!==null)return r.geometry.coordinates}else if(r.coordinates)return r.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function mp(r,t,e){if(!r)throw new Error("No feature passed");if(!e)throw new Error(".featureOf() requires a name");if(!r||r.type!=="Feature"||!r.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!r.geometry||r.geometry.type!==t)throw new Error("Invalid input to "+e+": must be a "+t+", given "+r.geometry.type)}function yi(r){return r.type==="Feature"?r.geometry:r}function Jv(r,t){return r.type==="FeatureCollection"?"FeatureCollection":r.type==="GeometryCollection"?"GeometryCollection":r.type==="Feature"&&r.geometry!==null?r.geometry.type:r.type}function vp(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Kv(r){if(Object.prototype.hasOwnProperty.call(r,"__esModule"))return r;var t=r.default;if(typeof t=="function"){var e=function i(){return this instanceof i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(r).forEach(function(i){var n=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:function(){return r[i]}})}),e}var tc={exports:{}},ec={exports:{}},Qv=ec.exports,yp;function _p(){return yp||(yp=1,function(r,t){(function(e,i){r.exports=i()})(Qv,function(){function e(y,w,v,S,P){(function I(b,D,O,T,x){for(;T>O;){if(T-O>600){var R=T-O+1,z=D-O+1,rt=Math.log(R),Z=.5*Math.exp(2*rt/3),ct=.5*Math.sqrt(rt*Z*(R-Z)/R)*(z-R/2<0?-1:1),G=Math.max(O,Math.floor(D-z*Z/R+ct)),X=Math.min(T,Math.floor(D+(R-z)*Z/R+ct));I(b,D,G,X,x)}var k=b[D],V=O,A=T;for(i(b,O,D),x(b[T],k)>0&&i(b,O,T);V<A;){for(i(b,V,A),V++,A--;x(b[V],k)<0;)V++;for(;x(b[A],k)>0;)A--}x(b[O],k)===0?i(b,O,A):i(b,++A,T),A<=D&&(O=A+1),D<=A&&(T=A-1)}})(y,w,v||0,S||y.length-1,P||n)}function i(y,w,v){var S=y[w];y[w]=y[v],y[v]=S}function n(y,w){return y<w?-1:y>w?1:0}var s=function(y){y===void 0&&(y=9),this._maxEntries=Math.max(4,y),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(y,w,v){if(!v)return w.indexOf(y);for(var S=0;S<w.length;S++)if(v(y,w[S]))return S;return-1}function o(y,w){l(y,0,y.children.length,w,y)}function l(y,w,v,S,P){P||(P=E(null)),P.minX=1/0,P.minY=1/0,P.maxX=-1/0,P.maxY=-1/0;for(var I=w;I<v;I++){var b=y.children[I];u(P,y.leaf?S(b):b)}return P}function u(y,w){return y.minX=Math.min(y.minX,w.minX),y.minY=Math.min(y.minY,w.minY),y.maxX=Math.max(y.maxX,w.maxX),y.maxY=Math.max(y.maxY,w.maxY),y}function c(y,w){return y.minX-w.minX}function h(y,w){return y.minY-w.minY}function f(y){return(y.maxX-y.minX)*(y.maxY-y.minY)}function g(y){return y.maxX-y.minX+(y.maxY-y.minY)}function m(y,w){return y.minX<=w.minX&&y.minY<=w.minY&&w.maxX<=y.maxX&&w.maxY<=y.maxY}function _(y,w){return w.minX<=y.maxX&&w.minY<=y.maxY&&w.maxX>=y.minX&&w.maxY>=y.minY}function E(y){return{children:y,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function M(y,w,v,S,P){for(var I=[w,v];I.length;)if(!((v=I.pop())-(w=I.pop())<=S)){var b=w+Math.ceil((v-w)/S/2)*S;e(y,b,w,v,P),I.push(w,b,b,v)}}return s.prototype.all=function(){return this._all(this.data,[])},s.prototype.search=function(y){var w=this.data,v=[];if(!_(y,w))return v;for(var S=this.toBBox,P=[];w;){for(var I=0;I<w.children.length;I++){var b=w.children[I],D=w.leaf?S(b):b;_(y,D)&&(w.leaf?v.push(b):m(y,D)?this._all(b,v):P.push(b))}w=P.pop()}return v},s.prototype.collides=function(y){var w=this.data;if(!_(y,w))return!1;for(var v=[];w;){for(var S=0;S<w.children.length;S++){var P=w.children[S],I=w.leaf?this.toBBox(P):P;if(_(y,I)){if(w.leaf||m(y,I))return!0;v.push(P)}}w=v.pop()}return!1},s.prototype.load=function(y){if(!y||!y.length)return this;if(y.length<this._minEntries){for(var w=0;w<y.length;w++)this.insert(y[w]);return this}var v=this._build(y.slice(),0,y.length-1,0);if(this.data.children.length)if(this.data.height===v.height)this._splitRoot(this.data,v);else{if(this.data.height<v.height){var S=this.data;this.data=v,v=S}this._insert(v,this.data.height-v.height-1,!0)}else this.data=v;return this},s.prototype.insert=function(y){return y&&this._insert(y,this.data.height-1),this},s.prototype.clear=function(){return this.data=E([]),this},s.prototype.remove=function(y,w){if(!y)return this;for(var v,S,P,I=this.data,b=this.toBBox(y),D=[],O=[];I||D.length;){if(I||(I=D.pop(),S=D[D.length-1],v=O.pop(),P=!0),I.leaf){var T=a(y,I.children,w);if(T!==-1)return I.children.splice(T,1),D.push(I),this._condense(D),this}P||I.leaf||!m(I,b)?S?(v++,I=S.children[v],P=!1):I=null:(D.push(I),O.push(v),v=0,S=I,I=I.children[0])}return this},s.prototype.toBBox=function(y){return y},s.prototype.compareMinX=function(y,w){return y.minX-w.minX},s.prototype.compareMinY=function(y,w){return y.minY-w.minY},s.prototype.toJSON=function(){return this.data},s.prototype.fromJSON=function(y){return this.data=y,this},s.prototype._all=function(y,w){for(var v=[];y;)y.leaf?w.push.apply(w,y.children):v.push.apply(v,y.children),y=v.pop();return w},s.prototype._build=function(y,w,v,S){var P,I=v-w+1,b=this._maxEntries;if(I<=b)return o(P=E(y.slice(w,v+1)),this.toBBox),P;S||(S=Math.ceil(Math.log(I)/Math.log(b)),b=Math.ceil(I/Math.pow(b,S-1))),(P=E([])).leaf=!1,P.height=S;var D=Math.ceil(I/b),O=D*Math.ceil(Math.sqrt(b));M(y,w,v,O,this.compareMinX);for(var T=w;T<=v;T+=O){var x=Math.min(T+O-1,v);M(y,T,x,D,this.compareMinY);for(var R=T;R<=x;R+=D){var z=Math.min(R+D-1,x);P.children.push(this._build(y,R,z,S-1))}}return o(P,this.toBBox),P},s.prototype._chooseSubtree=function(y,w,v,S){for(;S.push(w),!w.leaf&&S.length-1!==v;){for(var P=1/0,I=1/0,b=void 0,D=0;D<w.children.length;D++){var O=w.children[D],T=f(O),x=(R=y,z=O,(Math.max(z.maxX,R.maxX)-Math.min(z.minX,R.minX))*(Math.max(z.maxY,R.maxY)-Math.min(z.minY,R.minY))-T);x<I?(I=x,P=T<P?T:P,b=O):x===I&&T<P&&(P=T,b=O)}w=b||w.children[0]}var R,z;return w},s.prototype._insert=function(y,w,v){var S=v?y:this.toBBox(y),P=[],I=this._chooseSubtree(S,this.data,w,P);for(I.children.push(y),u(I,S);w>=0&&P[w].children.length>this._maxEntries;)this._split(P,w),w--;this._adjustParentBBoxes(S,P,w)},s.prototype._split=function(y,w){var v=y[w],S=v.children.length,P=this._minEntries;this._chooseSplitAxis(v,P,S);var I=this._chooseSplitIndex(v,P,S),b=E(v.children.splice(I,v.children.length-I));b.height=v.height,b.leaf=v.leaf,o(v,this.toBBox),o(b,this.toBBox),w?y[w-1].children.push(b):this._splitRoot(v,b)},s.prototype._splitRoot=function(y,w){this.data=E([y,w]),this.data.height=y.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},s.prototype._chooseSplitIndex=function(y,w,v){for(var S,P,I,b,D,O,T,x=1/0,R=1/0,z=w;z<=v-w;z++){var rt=l(y,0,z,this.toBBox),Z=l(y,z,v,this.toBBox),ct=(P=rt,I=Z,b=void 0,D=void 0,O=void 0,T=void 0,b=Math.max(P.minX,I.minX),D=Math.max(P.minY,I.minY),O=Math.min(P.maxX,I.maxX),T=Math.min(P.maxY,I.maxY),Math.max(0,O-b)*Math.max(0,T-D)),G=f(rt)+f(Z);ct<x?(x=ct,S=z,R=G<R?G:R):ct===x&&G<R&&(R=G,S=z)}return S||v-w},s.prototype._chooseSplitAxis=function(y,w,v){var S=y.leaf?this.compareMinX:c,P=y.leaf?this.compareMinY:h;this._allDistMargin(y,w,v,S)<this._allDistMargin(y,w,v,P)&&y.children.sort(S)},s.prototype._allDistMargin=function(y,w,v,S){y.children.sort(S);for(var P=this.toBBox,I=l(y,0,w,P),b=l(y,v-w,v,P),D=g(I)+g(b),O=w;O<v-w;O++){var T=y.children[O];u(I,y.leaf?P(T):T),D+=g(I)}for(var x=v-w-1;x>=w;x--){var R=y.children[x];u(b,y.leaf?P(R):R),D+=g(b)}return D},s.prototype._adjustParentBBoxes=function(y,w,v){for(var S=v;S>=0;S--)u(w[S],y)},s.prototype._condense=function(y){for(var w=y.length-1,v=void 0;w>=0;w--)y[w].children.length===0?w>0?(v=y[w-1].children).splice(v.indexOf(y[w]),1):this.clear():o(y[w],this.toBBox)},s})}(ec)),ec.exports}class Zv{constructor(t=[],e=Bv){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let i=(this.length>>1)-1;i>=0;i--)this._down(i)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:i}=this,n=e[t];for(;t>0;){const s=t-1>>1,a=e[s];if(i(n,a)>=0)break;e[t]=a,t=s}e[t]=n}_down(t){const{data:e,compare:i}=this,n=this.length>>1,s=e[t];for(;t<n;){let a=(t<<1)+1,o=e[a];const l=a+1;if(l<this.length&&i(e[l],o)<0&&(a=l,o=e[l]),i(o,s)>=0)break;e[t]=o,t=a}e[t]=s}}function Bv(r,t){return r<t?-1:r>t?1:0}const $v=Kv(Object.freeze(Object.defineProperty({__proto__:null,default:Zv},Symbol.toStringTag,{value:"Module"})));var Wu={exports:{}},If,wp;function jv(){return wp||(wp=1,If=function(t,e,i,n){var s=t[0],a=t[1],o=!1;i===void 0&&(i=0),n===void 0&&(n=e.length);for(var l=(n-i)/2,u=0,c=l-1;u<l;c=u++){var h=e[i+u*2+0],f=e[i+u*2+1],g=e[i+c*2+0],m=e[i+c*2+1],_=f>a!=m>a&&s<(g-h)*(a-f)/(m-f)+h;_&&(o=!o)}return o}),If}var Mf,Ep;function ty(){return Ep||(Ep=1,Mf=function(t,e,i,n){var s=t[0],a=t[1],o=!1;i===void 0&&(i=0),n===void 0&&(n=e.length);for(var l=n-i,u=0,c=l-1;u<l;c=u++){var h=e[u+i][0],f=e[u+i][1],g=e[c+i][0],m=e[c+i][1],_=f>a!=m>a&&s<(g-h)*(a-f)/(m-f)+h;_&&(o=!o)}return o}),Mf}var Sp;function ey(){if(Sp)return Wu.exports;Sp=1;var r=jv(),t=ty();return Wu.exports=function(i,n,s,a){return n.length>0&&Array.isArray(n[0])?t(i,n,s,a):r(i,n,s,a)},Wu.exports.nested=t,Wu.exports.flat=r,Wu.exports}var Hu={exports:{}},ry=Hu.exports,Pp;function iy(){return Pp||(Pp=1,function(r,t){(function(e,i){i(t)})(ry,function(e){const n=33306690738754706e-32;function s(_,E,M,y,w){let v,S,P,I,b=E[0],D=y[0],O=0,T=0;D>b==D>-b?(v=b,b=E[++O]):(v=D,D=y[++T]);let x=0;if(O<_&&T<M)for(D>b==D>-b?(P=v-((S=b+v)-b),b=E[++O]):(P=v-((S=D+v)-D),D=y[++T]),v=S,P!==0&&(w[x++]=P);O<_&&T<M;)D>b==D>-b?(P=v-((S=v+b)-(I=S-v))+(b-I),b=E[++O]):(P=v-((S=v+D)-(I=S-v))+(D-I),D=y[++T]),v=S,P!==0&&(w[x++]=P);for(;O<_;)P=v-((S=v+b)-(I=S-v))+(b-I),b=E[++O],v=S,P!==0&&(w[x++]=P);for(;T<M;)P=v-((S=v+D)-(I=S-v))+(D-I),D=y[++T],v=S,P!==0&&(w[x++]=P);return v===0&&x!==0||(w[x++]=v),x}function a(_){return new Float64Array(_)}const o=33306690738754716e-32,l=22204460492503146e-32,u=11093356479670487e-47,c=a(4),h=a(8),f=a(12),g=a(16),m=a(4);e.orient2d=function(_,E,M,y,w,v){const S=(E-v)*(M-w),P=(_-w)*(y-v),I=S-P;if(S===0||P===0||S>0!=P>0)return I;const b=Math.abs(S+P);return Math.abs(I)>=o*b?I:-function(D,O,T,x,R,z,rt){let Z,ct,G,X,k,V,A,W,J,ot,gt,lt,St,ut,It,bt,j,Pt;const Tt=D-R,Gt=T-R,Ht=O-z,Xt=x-z;k=(It=(W=Tt-(A=(V=134217729*Tt)-(V-Tt)))*(ot=Xt-(J=(V=134217729*Xt)-(V-Xt)))-((ut=Tt*Xt)-A*J-W*J-A*ot))-(gt=It-(j=(W=Ht-(A=(V=134217729*Ht)-(V-Ht)))*(ot=Gt-(J=(V=134217729*Gt)-(V-Gt)))-((bt=Ht*Gt)-A*J-W*J-A*ot))),c[0]=It-(gt+k)+(k-j),k=(St=ut-((lt=ut+gt)-(k=lt-ut))+(gt-k))-(gt=St-bt),c[1]=St-(gt+k)+(k-bt),k=(Pt=lt+gt)-lt,c[2]=lt-(Pt-k)+(gt-k),c[3]=Pt;let Bt=function(zt,Ee){let ke=Ee[0];for(let on=1;on<zt;on++)ke+=Ee[on];return ke}(4,c),me=l*rt;if(Bt>=me||-Bt>=me||(Z=D-(Tt+(k=D-Tt))+(k-R),G=T-(Gt+(k=T-Gt))+(k-R),ct=O-(Ht+(k=O-Ht))+(k-z),X=x-(Xt+(k=x-Xt))+(k-z),Z===0&&ct===0&&G===0&&X===0)||(me=u*rt+n*Math.abs(Bt),(Bt+=Tt*X+Xt*Z-(Ht*G+Gt*ct))>=me||-Bt>=me))return Bt;k=(It=(W=Z-(A=(V=134217729*Z)-(V-Z)))*(ot=Xt-(J=(V=134217729*Xt)-(V-Xt)))-((ut=Z*Xt)-A*J-W*J-A*ot))-(gt=It-(j=(W=ct-(A=(V=134217729*ct)-(V-ct)))*(ot=Gt-(J=(V=134217729*Gt)-(V-Gt)))-((bt=ct*Gt)-A*J-W*J-A*ot))),m[0]=It-(gt+k)+(k-j),k=(St=ut-((lt=ut+gt)-(k=lt-ut))+(gt-k))-(gt=St-bt),m[1]=St-(gt+k)+(k-bt),k=(Pt=lt+gt)-lt,m[2]=lt-(Pt-k)+(gt-k),m[3]=Pt;const Ke=s(4,c,4,m,h);k=(It=(W=Tt-(A=(V=134217729*Tt)-(V-Tt)))*(ot=X-(J=(V=134217729*X)-(V-X)))-((ut=Tt*X)-A*J-W*J-A*ot))-(gt=It-(j=(W=Ht-(A=(V=134217729*Ht)-(V-Ht)))*(ot=G-(J=(V=134217729*G)-(V-G)))-((bt=Ht*G)-A*J-W*J-A*ot))),m[0]=It-(gt+k)+(k-j),k=(St=ut-((lt=ut+gt)-(k=lt-ut))+(gt-k))-(gt=St-bt),m[1]=St-(gt+k)+(k-bt),k=(Pt=lt+gt)-lt,m[2]=lt-(Pt-k)+(gt-k),m[3]=Pt;const Yt=s(Ke,h,4,m,f);k=(It=(W=Z-(A=(V=134217729*Z)-(V-Z)))*(ot=X-(J=(V=134217729*X)-(V-X)))-((ut=Z*X)-A*J-W*J-A*ot))-(gt=It-(j=(W=ct-(A=(V=134217729*ct)-(V-ct)))*(ot=G-(J=(V=134217729*G)-(V-G)))-((bt=ct*G)-A*J-W*J-A*ot))),m[0]=It-(gt+k)+(k-j),k=(St=ut-((lt=ut+gt)-(k=lt-ut))+(gt-k))-(gt=St-bt),m[1]=St-(gt+k)+(k-bt),k=(Pt=lt+gt)-lt,m[2]=lt-(Pt-k)+(gt-k),m[3]=Pt;const kt=s(Yt,f,4,m,g);return g[kt-1]}(_,E,M,y,w,v,b)},e.orient2dfast=function(_,E,M,y,w,v){return(E-v)*(M-w)-(_-w)*(y-v)},Object.defineProperty(e,"__esModule",{value:!0})})}(Hu,Hu.exports)),Hu.exports}var Cp;function ny(){if(Cp)return tc.exports;Cp=1;var r=_p(),t=$v,e=ey(),i=iy().orient2d;t.default&&(t=t.default),tc.exports=n,tc.exports.default=n;function n(v,S,P){S=Math.max(0,S===void 0?2:S),P=P||0;var I=g(v),b=new r(16);b.toBBox=function(A){return{minX:A[0],minY:A[1],maxX:A[0],maxY:A[1]}},b.compareMinX=function(A,W){return A[0]-W[0]},b.compareMinY=function(A,W){return A[1]-W[1]},b.load(v);for(var D=[],O=0,T;O<I.length;O++){var x=I[O];b.remove(x),T=m(x,T),D.push(T)}var R=new r(16);for(O=0;O<D.length;O++)R.insert(f(D[O]));for(var z=S*S,rt=P*P;D.length;){var Z=D.shift(),ct=Z.p,G=Z.next.p,X=_(ct,G);if(!(X<rt)){var k=X/z;x=s(b,Z.prev.p,ct,G,Z.next.next.p,k,R),x&&Math.min(_(x,ct),_(x,G))<=k&&(D.push(Z),D.push(m(x,Z)),b.remove(x),R.remove(Z),R.insert(f(Z)),R.insert(f(Z.next)))}}Z=T;var V=[];do V.push(Z.p),Z=Z.next;while(Z!==T);return V.push(Z.p),V}function s(v,S,P,I,b,D,O){for(var T=new t([],a),x=v.data;x;){for(var R=0;R<x.children.length;R++){var z=x.children[R],rt=x.leaf?E(z,P,I):o(P,I,z);rt>D||T.push({node:z,dist:rt})}for(;T.length&&!T.peek().node.children;){var Z=T.pop(),ct=Z.node,G=E(ct,S,P),X=E(ct,I,b);if(Z.dist<G&&Z.dist<X&&u(P,ct,O)&&u(I,ct,O))return ct}x=T.pop(),x&&(x=x.node)}return null}function a(v,S){return v.dist-S.dist}function o(v,S,P){if(l(v,P)||l(S,P))return 0;var I=M(v[0],v[1],S[0],S[1],P.minX,P.minY,P.maxX,P.minY);if(I===0)return 0;var b=M(v[0],v[1],S[0],S[1],P.minX,P.minY,P.minX,P.maxY);if(b===0)return 0;var D=M(v[0],v[1],S[0],S[1],P.maxX,P.minY,P.maxX,P.maxY);if(D===0)return 0;var O=M(v[0],v[1],S[0],S[1],P.minX,P.maxY,P.maxX,P.maxY);return O===0?0:Math.min(I,b,D,O)}function l(v,S){return v[0]>=S.minX&&v[0]<=S.maxX&&v[1]>=S.minY&&v[1]<=S.maxY}function u(v,S,P){for(var I=Math.min(v[0],S[0]),b=Math.min(v[1],S[1]),D=Math.max(v[0],S[0]),O=Math.max(v[1],S[1]),T=P.search({minX:I,minY:b,maxX:D,maxY:O}),x=0;x<T.length;x++)if(h(T[x].p,T[x].next.p,v,S))return!1;return!0}function c(v,S,P){return i(v[0],v[1],S[0],S[1],P[0],P[1])}function h(v,S,P,I){return v!==I&&S!==P&&c(v,S,P)>0!=c(v,S,I)>0&&c(P,I,v)>0!=c(P,I,S)>0}function f(v){var S=v.p,P=v.next.p;return v.minX=Math.min(S[0],P[0]),v.minY=Math.min(S[1],P[1]),v.maxX=Math.max(S[0],P[0]),v.maxY=Math.max(S[1],P[1]),v}function g(v){for(var S=v[0],P=v[0],I=v[0],b=v[0],D=0;D<v.length;D++){var O=v[D];O[0]<S[0]&&(S=O),O[0]>I[0]&&(I=O),O[1]<P[1]&&(P=O),O[1]>b[1]&&(b=O)}var T=[S,P,I,b],x=T.slice();for(D=0;D<v.length;D++)e(v[D],T)||x.push(v[D]);return w(x)}function m(v,S){var P={p:v,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return S?(P.next=S.next,P.prev=S,S.next.prev=P,S.next=P):(P.prev=P,P.next=P),P}function _(v,S){var P=v[0]-S[0],I=v[1]-S[1];return P*P+I*I}function E(v,S,P){var I=S[0],b=S[1],D=P[0]-I,O=P[1]-b;if(D!==0||O!==0){var T=((v[0]-I)*D+(v[1]-b)*O)/(D*D+O*O);T>1?(I=P[0],b=P[1]):T>0&&(I+=D*T,b+=O*T)}return D=v[0]-I,O=v[1]-b,D*D+O*O}function M(v,S,P,I,b,D,O,T){var x=P-v,R=I-S,z=O-b,rt=T-D,Z=v-b,ct=S-D,G=x*x+R*R,X=x*z+R*rt,k=z*z+rt*rt,V=x*Z+R*ct,A=z*Z+rt*ct,W=G*k-X*X,J,ot,gt,lt,St=W,ut=W;W===0?(ot=0,St=1,lt=A,ut=k):(ot=X*A-k*V,lt=G*A-X*V,ot<0?(ot=0,lt=A,ut=k):ot>St&&(ot=St,lt=A+X,ut=k)),lt<0?(lt=0,-V<0?ot=0:-V>G?ot=St:(ot=-V,St=G)):lt>ut&&(lt=ut,-V+X<0?ot=0:-V+X>G?ot=St:(ot=-V+X,St=G)),J=ot===0?0:ot/St,gt=lt===0?0:lt/ut;var It=(1-J)*v+J*P,bt=(1-J)*S+J*I,j=(1-gt)*b+gt*O,Pt=(1-gt)*D+gt*T,Tt=j-It,Gt=Pt-bt;return Tt*Tt+Gt*Gt}function y(v,S){return v[0]===S[0]?v[1]-S[1]:v[0]-S[0]}function w(v){v.sort(y);for(var S=[],P=0;P<v.length;P++){for(;S.length>=2&&c(S[S.length-2],S[S.length-1],v[P])<=0;)S.pop();S.push(v[P])}for(var I=[],b=v.length-1;b>=0;b--){for(;I.length>=2&&c(I[I.length-2],I[I.length-1],v[b])<=0;)I.pop();I.push(v[b])}return I.pop(),S.pop(),S.concat(I)}return tc.exports}var sy=ny();const ay=vp(sy);function oy(r,t){t===void 0&&(t={}),t.concavity=t.concavity||1/0;var e=[];if(Jl(r,function(n){e.push([n[0],n[1]])}),!e.length)return null;var i=ay(e,t.concavity);return i.length>3?Pr([i]):null}function Fi(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("point is required");if(!t)throw new Error("polygon is required");var i=Rr(r),n=yi(t),s=n.type,a=t.bbox,o=n.coordinates;if(a&&ly(i,a)===!1)return!1;s==="Polygon"&&(o=[o]);for(var l=!1,u=0;u<o.length&&!l;u++)if(Ip(i,o[u][0],e.ignoreBoundary)){for(var c=!1,h=1;h<o[u].length&&!c;)Ip(i,o[u][h],!e.ignoreBoundary)&&(c=!0),h++;c||(l=!0)}return l}function Ip(r,t,e){var i=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var n=0,s=t.length-1;n<t.length;s=n++){var a=t[n][0],o=t[n][1],l=t[s][0],u=t[s][1],c=r[1]*(a-l)+o*(l-r[0])+u*(r[0]-a)===0&&(a-r[0])*(l-r[0])<=0&&(o-r[1])*(u-r[1])<=0;if(c)return!e;var h=o>r[1]!=u>r[1]&&r[0]<(l-a)*(r[1]-o)/(u-o)+a;h&&(i=!i)}return i}function ly(r,t){return t[0]<=r[0]&&t[1]<=r[1]&&t[2]>=r[0]&&t[3]>=r[1]}function ps(r,t,e){e===void 0&&(e={});var i=Rr(r),n=Rr(t),s=Cr(n[1]-i[1]),a=Cr(n[0]-i[0]),o=Cr(i[1]),l=Cr(n[1]),u=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(o)*Math.cos(l);return Ef(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),e.units)}function Kl(r,t,e,i){i===void 0&&(i={});var n=Rr(r),s=Cr(n[0]),a=Cr(n[1]),o=Cr(e),l=Sf(t,i.units),u=Math.asin(Math.sin(a)*Math.cos(l)+Math.cos(a)*Math.sin(l)*Math.cos(o)),c=s+Math.atan2(Math.sin(o)*Math.sin(l)*Math.cos(a),Math.cos(l)-Math.sin(a)*Math.sin(u)),h=Bh(c),f=Bh(u);return ae([h,f],i.properties)}function uy(r,t,e){e===void 0&&(e={});for(var i=e.steps||64,n=e.properties?e.properties:!Array.isArray(r)&&r.type==="Feature"&&r.properties?r.properties:{},s=[],a=0;a<i;a++)s.push(Kl(r,t,a*-360/i,e).geometry.coordinates);return s.push(s[0]),Pr([s],n)}function Xu(r,t,e){if(e===void 0&&(e={}),e.final===!0)return hy(r,t);var i=Rr(r),n=Rr(t),s=Cr(i[0]),a=Cr(n[0]),o=Cr(i[1]),l=Cr(n[1]),u=Math.sin(a-s)*Math.cos(l),c=Math.cos(o)*Math.sin(l)-Math.sin(o)*Math.cos(l)*Math.cos(a-s);return Bh(Math.atan2(u,c))}function hy(r,t){var e=Xu(t,r);return e=(e+180)%360,e}function cy(r,t){var e=ps(r,t),i=Xu(r,t),n=Kl(r,e/2,i);return n}function fy(r,t){t===void 0&&(t={});var e=cn(r),i=(e[0]+e[2])/2,n=(e[1]+e[3])/2;return ae([i,n],t.properties,t)}function Mp(r,t){t===void 0&&(t={});var e=0,i=0,n=0;return Jl(r,function(s){e+=s[0],i+=s[1],n++},!0),ae([e/n,i/n],t.properties)}function Np(r,t){switch(t===void 0&&(t={}),Jv(r)){case"Point":return ae(Rr(r),t.properties);case"Polygon":var e=[];Jl(r,function(v){e.push(v)});var i=Mp(r,{properties:t.properties}),n=i.geometry.coordinates,s=0,a=0,o=0,l,u,c,h,f,g,m,_,E=e.map(function(v){return[v[0]-n[0],v[1]-n[1]]});for(l=0;l<e.length-1;l++)u=E[l],h=u[0],g=u[1],c=E[l+1],f=c[0],m=c[1],_=h*m-f*g,o+=_,s+=(h+f)*_,a+=(g+m)*_;if(o===0)return i;var M=o*.5,y=1/(6*M);return ae([n[0]+y*s,n[1]+y*a],t.properties);default:var w=oy(r);return w?Np(w,{properties:t.properties}):Mp(r,{properties:t.properties})}}function bp(r){if(!r)throw new Error("geojson is required");var t=[];return Cf(r,function(e){dy(e,t)}),Yl(t)}function dy(r,t){var e=[],i=r.geometry;if(i!==null){switch(i.type){case"Polygon":e=La(i);break;case"LineString":e=[La(i)]}e.forEach(function(n){var s=py(n,r.properties);s.forEach(function(a){a.id=t.length,t.push(a)})})}}function py(r,t){var e=[];return r.reduce(function(i,n){var s=hn([i,n],t);return s.bbox=gy(i,n),e.push(s),n}),e}function gy(r,t){var e=r[0],i=r[1],n=t[0],s=t[1],a=e<n?e:n,o=i<s?i:s,l=e>n?e:n,u=i>s?i:s;return[a,o,l,u]}var rc={exports:{}},Nf={},Tp;function Dp(){return Tp||(Tp=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.earthRadius=63710088e-1,r.factors={centimeters:r.earthRadius*100,centimetres:r.earthRadius*100,degrees:r.earthRadius/111325,feet:r.earthRadius*3.28084,inches:r.earthRadius*39.37,kilometers:r.earthRadius/1e3,kilometres:r.earthRadius/1e3,meters:r.earthRadius,metres:r.earthRadius,miles:r.earthRadius/1609.344,millimeters:r.earthRadius*1e3,millimetres:r.earthRadius*1e3,nauticalmiles:r.earthRadius/1852,radians:1,yards:r.earthRadius*1.0936},r.unitsFactors={centimeters:100,centimetres:100,degrees:8982708286548395e-21,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:.0006213711922373339,millimeters:1e3,millimetres:1e3,nauticalmiles:.0005399568034557236,radians:1/r.earthRadius,yards:1.0936133},r.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function t(T,x,R){R===void 0&&(R={});var z={type:"Feature"};return(R.id===0||R.id)&&(z.id=R.id),R.bbox&&(z.bbox=R.bbox),z.properties=x||{},z.geometry=T,z}r.feature=t;function e(T,x,R){switch(T){case"Point":return i(x).geometry;case"LineString":return o(x).geometry;case"Polygon":return s(x).geometry;case"MultiPoint":return h(x).geometry;case"MultiLineString":return c(x).geometry;case"MultiPolygon":return f(x).geometry;default:throw new Error(T+" is invalid")}}r.geometry=e;function i(T,x,R){if(R===void 0&&(R={}),!T)throw new Error("coordinates is required");if(!Array.isArray(T))throw new Error("coordinates must be an Array");if(T.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!I(T[0])||!I(T[1]))throw new Error("coordinates must contain numbers");var z={type:"Point",coordinates:T};return t(z,x,R)}r.point=i;function n(T,x,R){return R===void 0&&(R={}),u(T.map(function(z){return i(z,x)}),R)}r.points=n;function s(T,x,R){R===void 0&&(R={});for(var z=0,rt=T;z<rt.length;z++){var Z=rt[z];if(Z.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var ct=0;ct<Z[Z.length-1].length;ct++)if(Z[Z.length-1][ct]!==Z[0][ct])throw new Error("First and last Position are not equivalent.")}var G={type:"Polygon",coordinates:T};return t(G,x,R)}r.polygon=s;function a(T,x,R){return R===void 0&&(R={}),u(T.map(function(z){return s(z,x)}),R)}r.polygons=a;function o(T,x,R){if(R===void 0&&(R={}),T.length<2)throw new Error("coordinates must be an array of two or more positions");var z={type:"LineString",coordinates:T};return t(z,x,R)}r.lineString=o;function l(T,x,R){return R===void 0&&(R={}),u(T.map(function(z){return o(z,x)}),R)}r.lineStrings=l;function u(T,x){x===void 0&&(x={});var R={type:"FeatureCollection"};return x.id&&(R.id=x.id),x.bbox&&(R.bbox=x.bbox),R.features=T,R}r.featureCollection=u;function c(T,x,R){R===void 0&&(R={});var z={type:"MultiLineString",coordinates:T};return t(z,x,R)}r.multiLineString=c;function h(T,x,R){R===void 0&&(R={});var z={type:"MultiPoint",coordinates:T};return t(z,x,R)}r.multiPoint=h;function f(T,x,R){R===void 0&&(R={});var z={type:"MultiPolygon",coordinates:T};return t(z,x,R)}r.multiPolygon=f;function g(T,x,R){R===void 0&&(R={});var z={type:"GeometryCollection",geometries:T};return t(z,x,R)}r.geometryCollection=g;function m(T,x){if(x===void 0&&(x=0),x&&!(x>=0))throw new Error("precision must be a positive number");var R=Math.pow(10,x||0);return Math.round(T*R)/R}r.round=m;function _(T,x){x===void 0&&(x="kilometers");var R=r.factors[x];if(!R)throw new Error(x+" units is invalid");return T*R}r.radiansToLength=_;function E(T,x){x===void 0&&(x="kilometers");var R=r.factors[x];if(!R)throw new Error(x+" units is invalid");return T/R}r.lengthToRadians=E;function M(T,x){return w(E(T,x))}r.lengthToDegrees=M;function y(T){var x=T%360;return x<0&&(x+=360),x}r.bearingToAzimuth=y;function w(T){var x=T%(2*Math.PI);return x*180/Math.PI}r.radiansToDegrees=w;function v(T){var x=T%360;return x*Math.PI/180}r.degreesToRadians=v;function S(T,x,R){if(x===void 0&&(x="kilometers"),R===void 0&&(R="kilometers"),!(T>=0))throw new Error("length must be a positive number");return _(E(T,x),R)}r.convertLength=S;function P(T,x,R){if(x===void 0&&(x="meters"),R===void 0&&(R="kilometers"),!(T>=0))throw new Error("area must be a positive number");var z=r.areaFactors[x];if(!z)throw new Error("invalid original units");var rt=r.areaFactors[R];if(!rt)throw new Error("invalid final units");return T/z*rt}r.convertArea=P;function I(T){return!isNaN(T)&&T!==null&&!Array.isArray(T)}r.isNumber=I;function b(T){return!!T&&T.constructor===Object}r.isObject=b;function D(T){if(!T)throw new Error("bbox is required");if(!Array.isArray(T))throw new Error("bbox must be an Array");if(T.length!==4&&T.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");T.forEach(function(x){if(!I(x))throw new Error("bbox must only contain numbers")})}r.validateBBox=D;function O(T){if(!T)throw new Error("id is required");if(["string","number"].indexOf(typeof T)===-1)throw new Error("id must be a number or a string")}r.validateId=O}(Nf)),Nf}var ze={},xp;function Op(){if(xp)return ze;xp=1,Object.defineProperty(ze,"__esModule",{value:!0});var r=Dp();function t(y,w,v){if(y!==null)for(var S,P,I,b,D,O,T,x=0,R=0,z,rt=y.type,Z=rt==="FeatureCollection",ct=rt==="Feature",G=Z?y.features.length:1,X=0;X<G;X++){T=Z?y.features[X].geometry:ct?y.geometry:y,z=T?T.type==="GeometryCollection":!1,D=z?T.geometries.length:1;for(var k=0;k<D;k++){var V=0,A=0;if(b=z?T.geometries[k]:T,b!==null){O=b.coordinates;var W=b.type;switch(x=v&&(W==="Polygon"||W==="MultiPolygon")?1:0,W){case null:break;case"Point":if(w(O,R,X,V,A)===!1)return!1;R++,V++;break;case"LineString":case"MultiPoint":for(S=0;S<O.length;S++){if(w(O[S],R,X,V,A)===!1)return!1;R++,W==="MultiPoint"&&V++}W==="LineString"&&V++;break;case"Polygon":case"MultiLineString":for(S=0;S<O.length;S++){for(P=0;P<O[S].length-x;P++){if(w(O[S][P],R,X,V,A)===!1)return!1;R++}W==="MultiLineString"&&V++,W==="Polygon"&&A++}W==="Polygon"&&V++;break;case"MultiPolygon":for(S=0;S<O.length;S++){for(A=0,P=0;P<O[S].length;P++){for(I=0;I<O[S][P].length-x;I++){if(w(O[S][P][I],R,X,V,A)===!1)return!1;R++}A++}V++}break;case"GeometryCollection":for(S=0;S<b.geometries.length;S++)if(t(b.geometries[S],w,v)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function e(y,w,v,S){var P=v;return t(y,function(I,b,D,O,T){b===0&&v===void 0?P=I:P=w(P,I,b,D,O,T)},S),P}function i(y,w){var v;switch(y.type){case"FeatureCollection":for(v=0;v<y.features.length&&w(y.features[v].properties,v)!==!1;v++);break;case"Feature":w(y.properties,0);break}}function n(y,w,v){var S=v;return i(y,function(P,I){I===0&&v===void 0?S=P:S=w(S,P,I)}),S}function s(y,w){if(y.type==="Feature")w(y,0);else if(y.type==="FeatureCollection")for(var v=0;v<y.features.length&&w(y.features[v],v)!==!1;v++);}function a(y,w,v){var S=v;return s(y,function(P,I){I===0&&v===void 0?S=P:S=w(S,P,I)}),S}function o(y){var w=[];return t(y,function(v){w.push(v)}),w}function l(y,w){var v,S,P,I,b,D,O,T,x,R,z=0,rt=y.type==="FeatureCollection",Z=y.type==="Feature",ct=rt?y.features.length:1;for(v=0;v<ct;v++){for(D=rt?y.features[v].geometry:Z?y.geometry:y,T=rt?y.features[v].properties:Z?y.properties:{},x=rt?y.features[v].bbox:Z?y.bbox:void 0,R=rt?y.features[v].id:Z?y.id:void 0,O=D?D.type==="GeometryCollection":!1,b=O?D.geometries.length:1,P=0;P<b;P++){if(I=O?D.geometries[P]:D,I===null){if(w(null,z,T,x,R)===!1)return!1;continue}switch(I.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(w(I,z,T,x,R)===!1)return!1;break}case"GeometryCollection":{for(S=0;S<I.geometries.length;S++)if(w(I.geometries[S],z,T,x,R)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}z++}}function u(y,w,v){var S=v;return l(y,function(P,I,b,D,O){I===0&&v===void 0?S=P:S=w(S,P,I,b,D,O)}),S}function c(y,w){l(y,function(v,S,P,I,b){var D=v===null?null:v.type;switch(D){case null:case"Point":case"LineString":case"Polygon":return w(r.feature(v,P,{bbox:I,id:b}),S,0)===!1?!1:void 0}var O;switch(D){case"MultiPoint":O="Point";break;case"MultiLineString":O="LineString";break;case"MultiPolygon":O="Polygon";break}for(var T=0;T<v.coordinates.length;T++){var x=v.coordinates[T],R={type:O,coordinates:x};if(w(r.feature(R,P),S,T)===!1)return!1}})}function h(y,w,v){var S=v;return c(y,function(P,I,b){I===0&&b===0&&v===void 0?S=P:S=w(S,P,I,b)}),S}function f(y,w){c(y,function(v,S,P){var I=0;if(v.geometry){var b=v.geometry.type;if(!(b==="Point"||b==="MultiPoint")){var D,O=0,T=0,x=0;if(t(v,function(R,z,rt,Z,ct){if(D===void 0||S>O||Z>T||ct>x){D=R,O=S,T=Z,x=ct,I=0;return}var G=r.lineString([D,R],v.properties);if(w(G,S,P,ct,I)===!1)return!1;I++,D=R})===!1)return!1}}})}function g(y,w,v){var S=v,P=!1;return f(y,function(I,b,D,O,T){P===!1&&v===void 0?S=I:S=w(S,I,b,D,O,T),P=!0}),S}function m(y,w){if(!y)throw new Error("geojson is required");c(y,function(v,S,P){if(v.geometry!==null){var I=v.geometry.type,b=v.geometry.coordinates;switch(I){case"LineString":if(w(v,S,P,0,0)===!1)return!1;break;case"Polygon":for(var D=0;D<b.length;D++)if(w(r.lineString(b[D],v.properties),S,P,D)===!1)return!1;break}}})}function _(y,w,v){var S=v;return m(y,function(P,I,b,D){I===0&&v===void 0?S=P:S=w(S,P,I,b,D)}),S}function E(y,w){if(w=w||{},!r.isObject(w))throw new Error("options is invalid");var v=w.featureIndex||0,S=w.multiFeatureIndex||0,P=w.geometryIndex||0,I=w.segmentIndex||0,b=w.properties,D;switch(y.type){case"FeatureCollection":v<0&&(v=y.features.length+v),b=b||y.features[v].properties,D=y.features[v].geometry;break;case"Feature":b=b||y.properties,D=y.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":D=y;break;default:throw new Error("geojson is invalid")}if(D===null)return null;var O=D.coordinates;switch(D.type){case"Point":case"MultiPoint":return null;case"LineString":return I<0&&(I=O.length+I-1),r.lineString([O[I],O[I+1]],b,w);case"Polygon":return P<0&&(P=O.length+P),I<0&&(I=O[P].length+I-1),r.lineString([O[P][I],O[P][I+1]],b,w);case"MultiLineString":return S<0&&(S=O.length+S),I<0&&(I=O[S].length+I-1),r.lineString([O[S][I],O[S][I+1]],b,w);case"MultiPolygon":return S<0&&(S=O.length+S),P<0&&(P=O[S].length+P),I<0&&(I=O[S][P].length-I-1),r.lineString([O[S][P][I],O[S][P][I+1]],b,w)}throw new Error("geojson is invalid")}function M(y,w){if(w=w||{},!r.isObject(w))throw new Error("options is invalid");var v=w.featureIndex||0,S=w.multiFeatureIndex||0,P=w.geometryIndex||0,I=w.coordIndex||0,b=w.properties,D;switch(y.type){case"FeatureCollection":v<0&&(v=y.features.length+v),b=b||y.features[v].properties,D=y.features[v].geometry;break;case"Feature":b=b||y.properties,D=y.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":D=y;break;default:throw new Error("geojson is invalid")}if(D===null)return null;var O=D.coordinates;switch(D.type){case"Point":return r.point(O,b,w);case"MultiPoint":return S<0&&(S=O.length+S),r.point(O[S],b,w);case"LineString":return I<0&&(I=O.length+I),r.point(O[I],b,w);case"Polygon":return P<0&&(P=O.length+P),I<0&&(I=O[P].length+I),r.point(O[P][I],b,w);case"MultiLineString":return S<0&&(S=O.length+S),I<0&&(I=O[S].length+I),r.point(O[S][I],b,w);case"MultiPolygon":return S<0&&(S=O.length+S),P<0&&(P=O[S].length+P),I<0&&(I=O[S][P].length-I),r.point(O[S][P][I],b,w)}throw new Error("geojson is invalid")}return ze.coordAll=o,ze.coordEach=t,ze.coordReduce=e,ze.featureEach=s,ze.featureReduce=a,ze.findPoint=M,ze.findSegment=E,ze.flattenEach=c,ze.flattenReduce=h,ze.geomEach=l,ze.geomReduce=u,ze.lineEach=m,ze.lineReduce=_,ze.propEach=i,ze.propReduce=n,ze.segmentEach=f,ze.segmentReduce=g,ze}var ic={},Ap;function my(){if(Ap)return ic;Ap=1,Object.defineProperty(ic,"__esModule",{value:!0});var r=Op();function t(e){var i=[1/0,1/0,-1/0,-1/0];return r.coordEach(e,function(n){i[0]>n[0]&&(i[0]=n[0]),i[1]>n[1]&&(i[1]=n[1]),i[2]<n[0]&&(i[2]=n[0]),i[3]<n[1]&&(i[3]=n[1])}),i}return t.default=t,ic.default=t,ic}var Lp;function vy(){if(Lp)return rc.exports;Lp=1;var r=_p(),t=Dp(),e=Op(),i=my().default,n=e.featureEach;e.coordEach,t.polygon;var s=t.featureCollection;function a(o){var l=new r(o);return l.insert=function(u){if(u.type!=="Feature")throw new Error("invalid feature");return u.bbox=u.bbox?u.bbox:i(u),r.prototype.insert.call(this,u)},l.load=function(u){var c=[];return Array.isArray(u)?u.forEach(function(h){if(h.type!=="Feature")throw new Error("invalid features");h.bbox=h.bbox?h.bbox:i(h),c.push(h)}):n(u,function(h){if(h.type!=="Feature")throw new Error("invalid features");h.bbox=h.bbox?h.bbox:i(h),c.push(h)}),r.prototype.load.call(this,c)},l.remove=function(u,c){if(u.type!=="Feature")throw new Error("invalid feature");return u.bbox=u.bbox?u.bbox:i(u),r.prototype.remove.call(this,u,c)},l.clear=function(){return r.prototype.clear.call(this)},l.search=function(u){var c=r.prototype.search.call(this,this.toBBox(u));return s(c)},l.collides=function(u){return r.prototype.collides.call(this,this.toBBox(u))},l.all=function(){var u=r.prototype.all.call(this);return s(u)},l.toJSON=function(){return r.prototype.toJSON.call(this)},l.fromJSON=function(u){return r.prototype.fromJSON.call(this,u)},l.toBBox=function(u){var c;if(u.bbox)c=u.bbox;else if(Array.isArray(u)&&u.length===4)c=u;else if(Array.isArray(u)&&u.length===6)c=[u[0],u[1],u[3],u[4]];else if(u.type==="Feature")c=i(u);else if(u.type==="FeatureCollection")c=i(u);else throw new Error("invalid geojson");return{minX:c[0],minY:c[1],maxX:c[2],maxY:c[3]}},l}return rc.exports=a,rc.exports.default=a,rc.exports}var yy=vy();const _y=vp(yy);function Rp(r,t){var e={},i=[];if(r.type==="LineString"&&(r=un(r)),t.type==="LineString"&&(t=un(t)),r.type==="Feature"&&t.type==="Feature"&&r.geometry!==null&&t.geometry!==null&&r.geometry.type==="LineString"&&t.geometry.type==="LineString"&&r.geometry.coordinates.length===2&&t.geometry.coordinates.length===2){var n=Fp(r,t);return n&&i.push(n),Yl(i)}var s=_y();return s.load(bp(t)),$h(bp(r),function(a){$h(s.search(a),function(o){var l=Fp(a,o);if(l){var u=La(l).join(",");e[u]||(e[u]=!0,i.push(l))}})}),Yl(i)}function Fp(r,t){var e=La(r),i=La(t);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(i.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var n=e[0][0],s=e[0][1],a=e[1][0],o=e[1][1],l=i[0][0],u=i[0][1],c=i[1][0],h=i[1][1],f=(h-u)*(a-n)-(c-l)*(o-s),g=(c-l)*(s-u)-(h-u)*(n-l),m=(a-n)*(s-u)-(o-s)*(n-l);if(f===0)return null;var _=g/f,E=m/f;if(_>=0&&_<=1&&E>=0&&E<=1){var M=n+_*(a-n),y=s+_*(o-s);return ae([M,y])}return null}function wy(r,t,e){e===void 0&&(e={});var i=ae([1/0,1/0],{dist:1/0}),n=0;return Cf(r,function(s){for(var a=La(s),o=0;o<a.length-1;o++){var l=ae(a[o]);l.properties.dist=ps(t,l,e);var u=ae(a[o+1]);u.properties.dist=ps(t,u,e);var c=ps(l,u,e),h=Math.max(l.properties.dist,u.properties.dist),f=Xu(l,u),g=Kl(t,h,f+90,e),m=Kl(t,h,f-90,e),_=Rp(hn([g.geometry.coordinates,m.geometry.coordinates]),hn([l.geometry.coordinates,u.geometry.coordinates])),E=null;_.features.length>0&&(E=_.features[0],E.properties.dist=ps(t,E,e),E.properties.location=n+ps(l,E,e)),l.properties.dist<i.properties.dist&&(i=l,i.properties.index=o,i.properties.location=n),u.properties.dist<i.properties.dist&&(i=u,i.properties.index=o+1,i.properties.location=n+c),E&&E.properties.dist<i.properties.dist&&(i=E,i.properties.index=o),n+=c}}),i}function Gp(r,t,e){e===void 0&&(e={});var i=Rr(r),n=Rr(t);n[0]+=n[0]-i[0]>180?-360:i[0]-n[0]>180?360:0;var s=Ey(i,n),a=Pf(s,"meters",e.units);return a}function Ey(r,t,e){e=e===void 0?hr:Number(e);var i=e,n=r[1]*Math.PI/180,s=t[1]*Math.PI/180,a=s-n,o=Math.abs(t[0]-r[0])*Math.PI/180;o>Math.PI&&(o-=2*Math.PI);var l=Math.log(Math.tan(s/2+Math.PI/4)/Math.tan(n/2+Math.PI/4)),u=Math.abs(l)>1e-11?a/l:Math.cos(n),c=Math.sqrt(a*a+u*u*o*o),h=c*i;return h}function Sy(r,t,e){if(e===void 0&&(e={}),e.method||(e.method="geodesic"),e.units||(e.units="kilometers"),!r)throw new Error("pt is required");if(Array.isArray(r)?r=ae(r):r.type==="Point"?r=un(r):mp(r,"Point","point"),!t)throw new Error("line is required");Array.isArray(t)?t=hn(t):t.type==="LineString"?t=un(t):mp(t,"LineString","line");var i=1/0,n=r.geometry.coordinates;return Yv(t,function(s){var a=s.geometry.coordinates[0],o=s.geometry.coordinates[1],l=Py(n,a,o,e);l<i&&(i=l)}),Pf(i,"degrees",e.units)}function Py(r,t,e,i){var n=[e[0]-t[0],e[1]-t[1]],s=[r[0]-t[0],r[1]-t[1]],a=kp(s,n);if(a<=0)return bf(r,t,{method:i.method,units:"degrees"});var o=kp(n,n);if(o<=a)return bf(r,e,{method:i.method,units:"degrees"});var l=a/o,u=[t[0]+l*n[0],t[1]+l*n[1]];return bf(r,u,{method:i.method,units:"degrees"})}function kp(r,t){return r[0]*t[0]+r[1]*t[1]}function bf(r,t,e){return e.method==="planar"?Gp(r,t,e):ps(r,t,e)}var zp=6378137;function Cy(r){return Xv(r,function(t,e){return t+Iy(e)},0)}function Iy(r){var t=0,e;switch(r.type){case"Polygon":return Vp(r.coordinates);case"MultiPolygon":for(e=0;e<r.coordinates.length;e++)t+=Vp(r.coordinates[e]);return t;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}function Vp(r){var t=0;if(r&&r.length>0){t+=Math.abs(Up(r[0]));for(var e=1;e<r.length;e++)t-=Math.abs(Up(r[e]))}return t}function Up(r){var t,e,i,n,s,a,o,l=0,u=r.length;if(u>2){for(o=0;o<u;o++)o===u-2?(n=u-2,s=u-1,a=0):o===u-1?(n=u-1,s=0,a=1):(n=o,s=o+1,a=o+2),t=r[n],e=r[s],i=r[a],l+=(Tf(i[0])-Tf(t[0]))*Math.sin(Tf(e[1]));l=l*zp*zp/2}return l}function Tf(r){return r*Math.PI/180}function My(r,t,e){e===void 0&&(e={});for(var i=yi(r),n=i.coordinates,s=0,a=0;a<n.length&&!(t>=s&&a===n.length-1);a++)if(s>=t){var o=t-s;if(o){var l=Xu(n[a],n[a-1])-180,u=Kl(n[a],o,l,e);return u}else return ae(n[a])}else s+=ps(n[a],n[a+1],e);return ae(n[n.length-1])}function gs(r,t,e){e===void 0&&(e={});for(var i=Rr(r),n=La(t),s=0;s<n.length-1;s++){var a=!1;if(e.ignoreEndVertices&&(s===0&&(a="start"),s===n.length-2&&(a="end"),s===0&&s+1===n.length-1&&(a="both")),Ny(n[s],n[s+1],i,a,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function Ny(r,t,e,i,n){var s=e[0],a=e[1],o=r[0],l=r[1],u=t[0],c=t[1],h=e[0]-o,f=e[1]-l,g=u-o,m=c-l,_=h*m-f*g;if(n!==null){if(Math.abs(_)>n)return!1}else if(_!==0)return!1;if(i){if(i==="start")return Math.abs(g)>=Math.abs(m)?g>0?o<s&&s<=u:u<=s&&s<o:m>0?l<a&&a<=c:c<=a&&a<l;if(i==="end")return Math.abs(g)>=Math.abs(m)?g>0?o<=s&&s<u:u<s&&s<=o:m>0?l<=a&&a<c:c<a&&a<=l;if(i==="both")return Math.abs(g)>=Math.abs(m)?g>0?o<s&&s<u:u<s&&s<o:m>0?l<a&&a<c:c<a&&a<l}else return Math.abs(g)>=Math.abs(m)?g>0?o<=s&&s<=u:u<=s&&s<=o:m>0?l<=a&&a<=c:c<=a&&a<=l;return!1}function by(r,t){var e=yi(r),i=yi(t),n=e.type,s=i.type;switch(n){case"Point":switch(s){case"MultiPoint":return Ty(e,i);case"LineString":return gs(e,i,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return Fi(e,i,{ignoreBoundary:!0});default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"MultiPoint":return Dy(e,i);case"LineString":return xy(e,i);case"Polygon":case"MultiPolygon":return Oy(e,i);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"LineString":return Ay(e,i);case"Polygon":case"MultiPolygon":return Ly(e,i);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Polygon":case"MultiPolygon":return Ry(e,i);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+n+" geometry not supported")}}function Ty(r,t){var e,i=!1;for(e=0;e<t.coordinates.length;e++)if(Wp(t.coordinates[e],r.coordinates)){i=!0;break}return i}function Dy(r,t){for(var e=0;e<r.coordinates.length;e++){for(var i=!1,n=0;n<t.coordinates.length;n++)Wp(r.coordinates[e],t.coordinates[n])&&(i=!0);if(!i)return!1}return!0}function xy(r,t){for(var e=!1,i=0;i<r.coordinates.length;i++){if(!gs(r.coordinates[i],t))return!1;e||(e=gs(r.coordinates[i],t,{ignoreEndVertices:!0}))}return e}function Oy(r,t){for(var e=!0,i=!1,n=0;n<r.coordinates.length;n++){if(i=Fi(r.coordinates[1],t),!i){e=!1;break}i=Fi(r.coordinates[1],t,{ignoreBoundary:!0})}return e&&i}function Ay(r,t){for(var e=0;e<r.coordinates.length;e++)if(!gs(r.coordinates[e],t))return!1;return!0}function Ly(r,t){var e=cn(t),i=cn(r);if(!qp(e,i))return!1;for(var n=!1,s=0;s<r.coordinates.length-1;s++){if(!Fi(r.coordinates[s],t))return!1;if(n||(n=Fi(r.coordinates[s],t,{ignoreBoundary:!0})),!n){var a=Fy(r.coordinates[s],r.coordinates[s+1]);n=Fi(a,t,{ignoreBoundary:!0})}}return n}function Ry(r,t){var e=cn(r),i=cn(t);if(!qp(i,e))return!1;for(var n=0;n<r.coordinates[0].length;n++)if(!Fi(r.coordinates[0][n],t))return!1;return!0}function qp(r,t){return!(r[0]>t[0]||r[2]<t[2]||r[1]>t[1]||r[3]<t[3])}function Wp(r,t){return r[0]===t[0]&&r[1]===t[1]}function Fy(r,t){return[(r[0]+t[0])/2,(r[1]+t[1])/2]}function Gy(r,t,e){e===void 0&&(e={});var i;e.final?i=Hp(Rr(t),Rr(r)):i=Hp(Rr(r),Rr(t));var n=i>180?-(360-i):i;return n}function Hp(r,t){var e=Cr(r[1]),i=Cr(t[1]),n=Cr(t[0]-r[0]);n>Math.PI&&(n-=2*Math.PI),n<-Math.PI&&(n+=2*Math.PI);var s=Math.log(Math.tan(i/2+Math.PI/4)/Math.tan(e/2+Math.PI/4)),a=Math.atan2(n,s);return(Bh(a)+360)%360}function ky(r,t,e,i){i===void 0&&(i={});var n=t<0,s=Pf(Math.abs(t),i.units,"meters");n&&(s=-Math.abs(s));var a=Rr(r),o=zy(a,s,e);return o[0]+=o[0]-a[0]>180?-360:a[0]-o[0]>180?360:0,ae(o,i.properties)}function zy(r,t,e,i){i=i===void 0?hr:Number(i);var n=t/i,s=r[0]*Math.PI/180,a=Cr(r[1]),o=Cr(e),l=n*Math.cos(o),u=a+l;Math.abs(u)>Math.PI/2&&(u=u>0?Math.PI-u:-Math.PI-u);var c=Math.log(Math.tan(u/2+Math.PI/4)/Math.tan(a/2+Math.PI/4)),h=Math.abs(c)>1e-11?l/c:Math.cos(a),f=n*Math.sin(o)/h,g=s+f;return[(g*180/Math.PI+540)%360-180,u*180/Math.PI]}function Vy(r,t){var e=yi(r),i=yi(t),n=e.type,s=i.type,a=e.coordinates,o=i.coordinates;switch(n){case"Point":switch(s){case"Point":return Df(a,o);default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"Point":return Uy(e,i);case"MultiPoint":return qy(e,i);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"Point":return gs(i,e,{ignoreEndVertices:!0});case"LineString":return Xy(e,i);case"MultiPoint":return Wy(e,i);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Point":return Fi(i,e,{ignoreBoundary:!0});case"LineString":return Yy(e,i);case"Polygon":return Jy(e,i);case"MultiPoint":return Hy(e,i);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+n+" geometry not supported")}}function Uy(r,t){var e,i=!1;for(e=0;e<r.coordinates.length;e++)if(Df(r.coordinates[e],t.coordinates)){i=!0;break}return i}function qy(r,t){for(var e=0,i=t.coordinates;e<i.length;e++){for(var n=i[e],s=!1,a=0,o=r.coordinates;a<o.length;a++){var l=o[a];if(Df(n,l)){s=!0;break}}if(!s)return!1}return!0}function Wy(r,t){for(var e=!1,i=0,n=t.coordinates;i<n.length;i++){var s=n[i];if(gs(s,r,{ignoreEndVertices:!0})&&(e=!0),!gs(s,r))return!1}return!!e}function Hy(r,t){for(var e=0,i=t.coordinates;e<i.length;e++){var n=i[e];if(!Fi(n,r,{ignoreBoundary:!0}))return!1}return!0}function Xy(r,t){for(var e=!1,i=0,n=t.coordinates;i<n.length;i++){var s=n[i];if(gs({type:"Point",coordinates:s},r,{ignoreEndVertices:!0})&&(e=!0),!gs({type:"Point",coordinates:s},r,{ignoreEndVertices:!1}))return!1}return e}function Yy(r,t){var e=!1,i=0,n=cn(r),s=cn(t);if(!Xp(n,s))return!1;for(i;i<t.coordinates.length-1;i++){var a=Ky(t.coordinates[i],t.coordinates[i+1]);if(Fi({type:"Point",coordinates:a},r,{ignoreBoundary:!0})){e=!0;break}}return e}function Jy(r,t){if(r.type==="Feature"&&r.geometry===null||t.type==="Feature"&&t.geometry===null)return!1;var e=cn(r),i=cn(t);if(!Xp(e,i))return!1;for(var n=yi(t).coordinates,s=0,a=n;s<a.length;s++)for(var o=a[s],l=0,u=o;l<u.length;l++){var c=u[l];if(!Fi(c,r))return!1}return!0}function Xp(r,t){return!(r[0]>t[0]||r[2]<t[2]||r[1]>t[1]||r[3]<t[3])}function Df(r,t){return r[0]===t[0]&&r[1]===t[1]}function Ky(r,t){return[(r[0]+t[0])/2,(r[1]+t[1])/2]}/**
4
4
  * splaytree v3.1.2
5
5
  * Fast Splay tree for Node and browser
6
6
  *
@@ -27,7 +27,7 @@ ${l.map(c=>`${c.id} ${c.typeName}
27
27
  `)}return t.toString()},$e.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();){var i=e.next();i.computeLabel(t)}},$e.prototype.computeLabelling=function(t){var e=this;this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var i=[!1,!1],n=this.iterator();n.hasNext();)for(var s=n.next(),a=s.getLabel(),o=0;o<2;o++)a.isLine(o)&&a.getLocation(o)===F.BOUNDARY&&(i[o]=!0);for(var l=this.iterator();l.hasNext();)for(var u=l.next(),c=u.getLabel(),h=0;h<2;h++)if(c.isAnyNull(h)){var f=F.NONE;if(i[h])f=F.EXTERIOR;else{var g=u.getCoordinate();f=e.getLocation(h,g,t)}c.setAllLocationsIfNull(h,f)}},$e.prototype.getDegree=function(){return this._edgeMap.size()},$e.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},$e.prototype.interfaces_=function(){return[]},$e.prototype.getClass=function(){return $e};var A_=function(r){function t(){r.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.linkResultDirectedEdges=function(){var i=this;this.getResultAreaEdges();for(var n=null,s=null,a=this._SCANNING_FOR_INCOMING,o=0;o<this._resultAreaEdgeList.size();o++){var l=i._resultAreaEdgeList.get(o),u=l.getSym();if(l.getLabel().isArea())switch(n===null&&l.isInResult()&&(n=l),a){case i._SCANNING_FOR_INCOMING:if(!u.isInResult())continue;s=u,a=i._LINKING_TO_OUTGOING;break;case i._LINKING_TO_OUTGOING:if(!l.isInResult())continue;s.setNext(l),a=i._SCANNING_FOR_INCOMING;break}}if(a===this._LINKING_TO_OUTGOING){if(n===null)throw new Xn("no outgoing dirEdge found",this.getCoordinate());Mt.isTrue(n.isInResult(),"unable to link last incoming dirEdge"),s.setNext(n)}},t.prototype.insert=function(i){var n=i;this.insertEdgeEnd(n,n)},t.prototype.getRightmostEdge=function(){var i=this.getEdges(),n=i.size();if(n<1)return null;var s=i.get(0);if(n===1)return s;var a=i.get(n-1),o=s.getQuadrant(),l=a.getQuadrant();return Qt.isNorthern(o)&&Qt.isNorthern(l)?s:!Qt.isNorthern(o)&&!Qt.isNorthern(l)?a:s.getDy()!==0?s:a.getDy()!==0?a:(Mt.shouldNeverReachHere("found two horizontal edges incident on node"),null)},t.prototype.print=function(i){Ve.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var n=this.iterator();n.hasNext();){var s=n.next();i.print("out "),s.print(i),i.println(),i.print("in "),s.getSym().print(i),i.println()}},t.prototype.getResultAreaEdges=function(){var i=this;if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new B;for(var n=this.iterator();n.hasNext();){var s=n.next();(s.isInResult()||s.getSym().isInResult())&&i._resultAreaEdgeList.add(s)}return this._resultAreaEdgeList},t.prototype.updateLabelling=function(i){for(var n=this.iterator();n.hasNext();){var s=n.next(),a=s.getLabel();a.setAllLocationsIfNull(0,i.getLocation(0)),a.setAllLocationsIfNull(1,i.getLocation(1))}},t.prototype.linkAllDirectedEdges=function(){var i=this;this.getEdges();for(var n=null,s=null,a=this._edgeList.size()-1;a>=0;a--){var o=i._edgeList.get(a),l=o.getSym();s===null&&(s=l),n!==null&&l.setNext(n),n=o}s.setNext(n)},t.prototype.computeDepths=function(){var i=this;if(arguments.length===1){var n=arguments[0],s=this.findIndex(n),a=n.getDepth(K.LEFT),o=n.getDepth(K.RIGHT),l=this.computeDepths(s+1,this._edgeList.size(),a),u=this.computeDepths(0,s,l);if(u!==o)throw new Xn("depth mismatch at "+n.getCoordinate())}else if(arguments.length===3){for(var c=arguments[0],h=arguments[1],f=arguments[2],g=f,m=c;m<h;m++){var _=i._edgeList.get(m);_.setEdgeDepths(K.RIGHT,g),g=_.getDepth(K.LEFT)}return g}},t.prototype.mergeSymLabels=function(){for(var i=this.iterator();i.hasNext();){var n=i.next(),s=n.getLabel();s.merge(n.getSym().getLabel())}},t.prototype.linkMinimalDirectedEdges=function(i){for(var n=this,s=null,a=null,o=this._SCANNING_FOR_INCOMING,l=this._resultAreaEdgeList.size()-1;l>=0;l--){var u=n._resultAreaEdgeList.get(l),c=u.getSym();switch(s===null&&u.getEdgeRing()===i&&(s=u),o){case n._SCANNING_FOR_INCOMING:if(c.getEdgeRing()!==i)continue;a=c,o=n._LINKING_TO_OUTGOING;break;case n._LINKING_TO_OUTGOING:if(u.getEdgeRing()!==i)continue;a.setNextMin(u),o=n._SCANNING_FOR_INCOMING;break}}o===this._LINKING_TO_OUTGOING&&(Mt.isTrue(s!==null,"found null for first outgoing dirEdge"),Mt.isTrue(s.getEdgeRing()===i,"unable to link last incoming dirEdge"),a.setNextMin(s))},t.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var i=0,n=this.iterator();n.hasNext();){var s=n.next();s.isInResult()&&i++}return i}else if(arguments.length===1){for(var a=arguments[0],o=0,l=this.iterator();l.hasNext();){var u=l.next();u.getEdgeRing()===a&&o++}return o}},t.prototype.getLabel=function(){return this._label},t.prototype.findCoveredLineEdges=function(){for(var i=F.NONE,n=this.iterator();n.hasNext();){var s=n.next(),a=s.getSym();if(!s.isLineEdge()){if(s.isInResult()){i=F.INTERIOR;break}if(a.isInResult()){i=F.EXTERIOR;break}}}if(i===F.NONE)return null;for(var o=i,l=this.iterator();l.hasNext();){var u=l.next(),c=u.getSym();u.isLineEdge()?u.getEdge().setCovered(o===F.INTERIOR):(u.isInResult()&&(o=F.EXTERIOR),c.isInResult()&&(o=F.INTERIOR))}},t.prototype.computeLabelling=function(i){var n=this;r.prototype.computeLabelling.call(this,i),this._label=new Jt(F.NONE);for(var s=this.iterator();s.hasNext();)for(var a=s.next(),o=a.getEdge(),l=o.getLabel(),u=0;u<2;u++){var c=l.getLocation(u);(c===F.INTERIOR||c===F.BOUNDARY)&&n._label.setLocation(u,F.INTERIOR)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}($e),Ig=function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.createNode=function(i){return new _c(i,new A_)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(lu),Es=function r(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=r.orientation(t)};Es.prototype.compareTo=function(t){var e=t,i=Es.compareOriented(this._pts,this._orientation,e._pts,e._orientation);return i},Es.prototype.interfaces_=function(){return[Br]},Es.prototype.getClass=function(){return Es},Es.orientation=function(t){return Dt.increasingDirection(t)===1},Es.compareOriented=function(t,e,i,n){for(var s=e?1:-1,a=n?1:-1,o=e?t.length:-1,l=n?i.length:-1,u=e?0:t.length-1,c=n?0:i.length-1;;){var h=t[u].compareTo(i[c]);if(h!==0)return h;u+=s,c+=a;var f=u===o,g=c===l;if(f&&!g)return-1;if(!f&&g)return 1;if(f&&g)return 0}};var Ni=function(){this._edges=new B,this._ocaMap=new Ze};Ni.prototype.print=function(t){var e=this;t.print("MULTILINESTRING ( ");for(var i=0;i<this._edges.size();i++){var n=e._edges.get(i);i>0&&t.print(","),t.print("(");for(var s=n.getCoordinates(),a=0;a<s.length;a++)a>0&&t.print(","),t.print(s[a].x+" "+s[a].y);t.println(")")}t.print(") ")},Ni.prototype.addAll=function(t){for(var e=this,i=t.iterator();i.hasNext();)e.add(i.next())},Ni.prototype.findEdgeIndex=function(t){for(var e=this,i=0;i<this._edges.size();i++)if(e._edges.get(i).equals(t))return i;return-1},Ni.prototype.iterator=function(){return this._edges.iterator()},Ni.prototype.getEdges=function(){return this._edges},Ni.prototype.get=function(t){return this._edges.get(t)},Ni.prototype.findEqualEdge=function(t){var e=new Es(t.getCoordinates()),i=this._ocaMap.get(e);return i},Ni.prototype.add=function(t){this._edges.add(t);var e=new Es(t.getCoordinates());this._ocaMap.put(e,t)},Ni.prototype.interfaces_=function(){return[]},Ni.prototype.getClass=function(){return Ni};var na=function(){};na.prototype.processIntersections=function(t,e,i,n){},na.prototype.isDone=function(){},na.prototype.interfaces_=function(){return[]},na.prototype.getClass=function(){return na};var Ur=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this._li=t};Ur.prototype.isTrivialIntersection=function(t,e,i,n){if(t===i&&this._li.getIntersectionNum()===1){if(Ur.isAdjacentSegments(e,n))return!0;if(t.isClosed()){var s=t.size()-1;if(e===0&&n===s||n===0&&e===s)return!0}}return!1},Ur.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Ur.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Ur.prototype.getLineIntersector=function(){return this._li},Ur.prototype.hasProperIntersection=function(){return this._hasProper},Ur.prototype.processIntersections=function(t,e,i,n){if(t===i&&e===n)return null;this.numTests++;var s=t.getCoordinates()[e],a=t.getCoordinates()[e+1],o=i.getCoordinates()[n],l=i.getCoordinates()[n+1];this._li.computeIntersection(s,a,o,l),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,i,n)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),i.addIntersections(this._li,n,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},Ur.prototype.hasIntersection=function(){return this._hasIntersection},Ur.prototype.isDone=function(){return!1},Ur.prototype.hasInteriorIntersection=function(){return this._hasInterior},Ur.prototype.interfaces_=function(){return[na]},Ur.prototype.getClass=function(){return Ur},Ur.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var Zi=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],i=arguments[2];this.coord=new L(t),this.segmentIndex=e,this.dist=i};Zi.prototype.getSegmentIndex=function(){return this.segmentIndex},Zi.prototype.getCoordinate=function(){return this.coord},Zi.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},Zi.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},Zi.prototype.isEndPoint=function(t){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===t},Zi.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Zi.prototype.getDistance=function(){return this.dist},Zi.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},Zi.prototype.interfaces_=function(){return[Br]},Zi.prototype.getClass=function(){return Zi};var wn=function(){this._nodeMap=new Ze,this.edge=null;var t=arguments[0];this.edge=t};wn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var i=e.next();i.print(t)}},wn.prototype.iterator=function(){return this._nodeMap.values().iterator()},wn.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints();for(var i=this.iterator(),n=i.next();i.hasNext();){var s=i.next(),a=e.createSplitEdge(n,s);t.add(a),n=s}},wn.prototype.addEndpoints=function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)},wn.prototype.createSplitEdge=function(t,e){var i=this,n=e.segmentIndex-t.segmentIndex+2,s=this.edge.pts[e.segmentIndex],a=e.dist>0||!e.coord.equals2D(s);a||n--;var o=new Array(n).fill(null),l=0;o[l++]=new L(t.coord);for(var u=t.segmentIndex+1;u<=e.segmentIndex;u++)o[l++]=i.edge.pts[u];return a&&(o[l]=e.coord),new Ec(o,new Jt(this.edge._label))},wn.prototype.add=function(t,e,i){var n=new Zi(t,e,i),s=this._nodeMap.get(n);return s!==null?s:(this._nodeMap.put(n,n),n)},wn.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){var i=e.next();if(i.coord.equals(t))return!0}return!1},wn.prototype.interfaces_=function(){return[]},wn.prototype.getClass=function(){return wn};var sa=function(){};sa.prototype.getChainStartIndices=function(t){var e=this,i=0,n=new B;n.add(new zi(i));do{var s=e.findChainEnd(t,i);n.add(new zi(s)),i=s}while(i<t.length-1);var a=sa.toIntArray(n);return a},sa.prototype.findChainEnd=function(t,e){for(var i=Qt.quadrant(t[e],t[e+1]),n=e+1;n<t.length;){var s=Qt.quadrant(t[n-1],t[n]);if(s!==i)break;n++}return n-1},sa.prototype.interfaces_=function(){return[]},sa.prototype.getClass=function(){return sa},sa.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),i=0;i<e.length;i++)e[i]=t.get(i).intValue();return e};var Kn=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new dt,this.env2=new dt;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new sa;this.startIndex=e.getChainStartIndices(this.pts)};Kn.prototype.getCoordinates=function(){return this.pts},Kn.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,i=this.pts[this.startIndex[t+1]].x;return e>i?e:i},Kn.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,i=this.pts[this.startIndex[t+1]].x;return e<i?e:i},Kn.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var t=arguments[0],e=arguments[1],i=arguments[2],n=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[i],e.startIndex[i+1],n)}else if(arguments.length===6){var s=arguments[0],a=arguments[1],o=arguments[2],l=arguments[3],u=arguments[4],c=arguments[5],h=this.pts[s],f=this.pts[a],g=o.pts[l],m=o.pts[u];if(a-s===1&&u-l===1)return c.addIntersections(this.e,s,o.e,l),null;if(this.env1.init(h,f),this.env2.init(g,m),!this.env1.intersects(this.env2))return null;var _=Math.trunc((s+a)/2),E=Math.trunc((l+u)/2);s<_&&(l<E&&this.computeIntersectsForChain(s,_,o,l,E,c),E<u&&this.computeIntersectsForChain(s,_,o,E,u,c)),_<a&&(l<E&&this.computeIntersectsForChain(_,a,o,l,E,c),E<u&&this.computeIntersectsForChain(_,a,o,E,u,c))}},Kn.prototype.getStartIndexes=function(){return this.startIndex},Kn.prototype.computeIntersects=function(t,e){for(var i=this,n=0;n<this.startIndex.length-1;n++)for(var s=0;s<t.startIndex.length-1;s++)i.computeIntersectsForChain(n,t,s,e)},Kn.prototype.interfaces_=function(){return[]},Kn.prototype.getClass=function(){return Kn};var Ue=function r(){var t=this;this._depth=Array(2).fill().map(function(){return Array(3)});for(var e=0;e<2;e++)for(var i=0;i<3;i++)t._depth[e][i]=r.NULL_VALUE},Mg={NULL_VALUE:{configurable:!0}};Ue.prototype.getDepth=function(t,e){return this._depth[t][e]},Ue.prototype.setDepth=function(t,e,i){this._depth[t][e]=i},Ue.prototype.isNull=function(){var t=this;if(arguments.length===0){for(var e=0;e<2;e++)for(var i=0;i<3;i++)if(t._depth[e][i]!==Ue.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var n=arguments[0];return this._depth[n][1]===Ue.NULL_VALUE}else if(arguments.length===2){var s=arguments[0],a=arguments[1];return this._depth[s][a]===Ue.NULL_VALUE}},Ue.prototype.normalize=function(){for(var t=this,e=0;e<2;e++)if(!t.isNull(e)){var i=t._depth[e][1];t._depth[e][2]<i&&(i=t._depth[e][2]),i<0&&(i=0);for(var n=1;n<3;n++){var s=0;t._depth[e][n]>i&&(s=1),t._depth[e][n]=s}}},Ue.prototype.getDelta=function(t){return this._depth[t][K.RIGHT]-this._depth[t][K.LEFT]},Ue.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?F.EXTERIOR:F.INTERIOR},Ue.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},Ue.prototype.add=function(){var t=this;if(arguments.length===1)for(var e=arguments[0],i=0;i<2;i++)for(var n=1;n<3;n++){var s=e.getLocation(i,n);(s===F.EXTERIOR||s===F.INTERIOR)&&(t.isNull(i,n)?t._depth[i][n]=Ue.depthAtLocation(s):t._depth[i][n]+=Ue.depthAtLocation(s))}else if(arguments.length===3){var a=arguments[0],o=arguments[1],l=arguments[2];l===F.INTERIOR&&this._depth[a][o]++}},Ue.prototype.interfaces_=function(){return[]},Ue.prototype.getClass=function(){return Ue},Ue.depthAtLocation=function(t){return t===F.EXTERIOR?0:t===F.INTERIOR?1:Ue.NULL_VALUE},Mg.NULL_VALUE.get=function(){return-1},Object.defineProperties(Ue,Mg);var Ec=function(r){function t(){if(r.call(this),this.pts=null,this._env=null,this.eiList=new wn(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Ue,this._depthDelta=0,arguments.length===1){var e=arguments[0];t.call(this,e,null)}else if(arguments.length===2){var i=arguments[0],n=arguments[1];this.pts=i,this._label=n}}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.getDepth=function(){return this._depth},t.prototype.getCollapsedEdge=function(){var i=new Array(2).fill(null);i[0]=this.pts[0],i[1]=this.pts[1];var n=new t(i,Jt.toLineLabel(this._label));return n},t.prototype.isIsolated=function(){return this._isIsolated},t.prototype.getCoordinates=function(){return this.pts},t.prototype.setIsolated=function(i){this._isIsolated=i},t.prototype.setName=function(i){this._name=i},t.prototype.equals=function(i){var n=this;if(!(i instanceof t))return!1;var s=i;if(this.pts.length!==s.pts.length)return!1;for(var a=!0,o=!0,l=this.pts.length,u=0;u<this.pts.length;u++)if(n.pts[u].equals2D(s.pts[u])||(a=!1),n.pts[u].equals2D(s.pts[--l])||(o=!1),!a&&!o)return!1;return!0},t.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var i=arguments[0];return this.pts[i]}},t.prototype.print=function(i){var n=this;i.print("edge "+this._name+": "),i.print("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&i.print(","),i.print(n.pts[s].x+" "+n.pts[s].y);i.print(") "+this._label+" "+this._depthDelta)},t.prototype.computeIM=function(i){t.updateIM(this._label,i)},t.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},t.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},t.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},t.prototype.getDepthDelta=function(){return this._depthDelta},t.prototype.getNumPoints=function(){return this.pts.length},t.prototype.printReverse=function(i){var n=this;i.print("edge "+this._name+": ");for(var s=this.pts.length-1;s>=0;s--)i.print(n.pts[s]+" ");i.println("")},t.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new Kn(this)),this._mce},t.prototype.getEnvelope=function(){var i=this;if(this._env===null){this._env=new dt;for(var n=0;n<this.pts.length;n++)i._env.expandToInclude(i.pts[n])}return this._env},t.prototype.addIntersection=function(i,n,s,a){var o=new L(i.getIntersection(a)),l=n,u=i.getEdgeDistance(s,a),c=l+1;if(c<this.pts.length){var h=this.pts[c];o.equals2D(h)&&(l=c,u=0)}this.eiList.add(o,l,u)},t.prototype.toString=function(){var i=this,n=new ki;n.append("edge "+this._name+": "),n.append("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&n.append(","),n.append(i.pts[s].x+" "+i.pts[s].y);return n.append(") "+this._label+" "+this._depthDelta),n.toString()},t.prototype.isPointwiseEqual=function(i){var n=this;if(this.pts.length!==i.pts.length)return!1;for(var s=0;s<this.pts.length;s++)if(!n.pts[s].equals2D(i.pts[s]))return!1;return!0},t.prototype.setDepthDelta=function(i){this._depthDelta=i},t.prototype.getEdgeIntersectionList=function(){return this.eiList},t.prototype.addIntersections=function(i,n,s){for(var a=this,o=0;o<i.getIntersectionNum();o++)a.addIntersection(i,n,s,o)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.updateIM=function(){if(arguments.length===2){var i=arguments[0],n=arguments[1];n.setAtLeastIfValid(i.getLocation(0,K.ON),i.getLocation(1,K.ON),1),i.isArea()&&(n.setAtLeastIfValid(i.getLocation(0,K.LEFT),i.getLocation(1,K.LEFT),2),n.setAtLeastIfValid(i.getLocation(0,K.RIGHT),i.getLocation(1,K.RIGHT),2))}else return r.prototype.updateIM.apply(this,arguments)},t}(kr),nr=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Ni,this._bufParams=t||null};nr.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},nr.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(e!==null){var i=e.getLabel(),n=t.getLabel();e.isPointwiseEqual(t)||(n=new Jt(t.getLabel()),n.flip()),i.merge(n);var s=nr.depthDelta(n),a=e.getDepthDelta(),o=a+s;e.setDepthDelta(o)}else this._edgeList.add(t),t.setDepthDelta(nr.depthDelta(t.getLabel()))},nr.prototype.buildSubgraphs=function(t,e){for(var i=new B,n=t.iterator();n.hasNext();){var s=n.next(),a=s.getRightmostCoordinate(),o=new Ha(i),l=o.getDepth(a);s.computeDepth(l),s.findResultEdges(),i.add(s),e.add(s.getDirectedEdges(),s.getNodes())}},nr.prototype.createSubgraphs=function(t){for(var e=new B,i=t.getNodes().iterator();i.hasNext();){var n=i.next();if(!n.isVisited()){var s=new rr;s.create(n),e.add(s)}}return Mi.sort(e,Mi.reverseOrder()),e},nr.prototype.createEmptyResultGeometry=function(){var t=this._geomFact.createPolygon();return t},nr.prototype.getNoder=function(t){if(this._workingNoder!==null)return this._workingNoder;var e=new Zf,i=new $s;return i.setPrecisionModel(t),e.setSegmentIntersector(new Ur(i)),e},nr.prototype.buffer=function(t,e){var i=this._workingPrecisionModel;i===null&&(i=t.getPrecisionModel()),this._geomFact=t.getFactory();var n=new dr(i,this._bufParams),s=new ii(t,e,n),a=s.getCurves();if(a.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(a,i),this._graph=new fe(new Ig),this._graph.addEdges(this._edgeList.getEdges());var o=this.createSubgraphs(this._graph),l=new Nr(this._geomFact);this.buildSubgraphs(o,l);var u=l.getPolygons();if(u.size()<=0)return this.createEmptyResultGeometry();var c=this._geomFact.buildGeometry(u);return c},nr.prototype.computeNodedEdges=function(t,e){var i=this,n=this.getNoder(e);n.computeNodes(t);for(var s=n.getNodedSubstrings(),a=s.iterator();a.hasNext();){var o=a.next(),l=o.getCoordinates();if(!(l.length===2&&l[0].equals2D(l[1]))){var u=o.getData(),c=new Ec(o.getCoordinates(),new Jt(u));i.insertUniqueEdge(c)}}},nr.prototype.setNoder=function(t){this._workingNoder=t},nr.prototype.interfaces_=function(){return[]},nr.prototype.getClass=function(){return nr},nr.depthDelta=function(t){var e=t.getLocation(0,K.LEFT),i=t.getLocation(0,K.RIGHT);return e===F.INTERIOR&&i===F.EXTERIOR?1:e===F.EXTERIOR&&i===F.INTERIOR?-1:0},nr.convertSegStrings=function(t){for(var e=new xt,i=new B;t.hasNext();){var n=t.next(),s=e.createLineString(n.getCoordinates());i.add(s)}return e.buildGeometry(i)};var Ss=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(arguments.length===4){var i=arguments[0],n=arguments[1],s=arguments[2],a=arguments[3];this._noder=i,this._scaleFactor=n,this._offsetX=s,this._offsetY=a,this._isScaled=!this.isIntegerPrecision()}};Ss.prototype.rescale=function(){var t=this;if(_t(arguments[0],Me))for(var e=arguments[0],i=e.iterator();i.hasNext();){var n=i.next();t.rescale(n.getCoordinates())}else if(arguments[0]instanceof Array){for(var s=arguments[0],a=0;a<s.length;a++)s[a].x=s[a].x/t._scaleFactor+t._offsetX,s[a].y=s[a].y/t._scaleFactor+t._offsetY;s.length===2&&s[0].equals2D(s[1])&&Ve.out.println(s)}},Ss.prototype.scale=function(){var t=this;if(_t(arguments[0],Me)){for(var e=arguments[0],i=new B,n=e.iterator();n.hasNext();){var s=n.next();i.add(new _e(t.scale(s.getCoordinates()),s.getData()))}return i}else if(arguments[0]instanceof Array){for(var a=arguments[0],o=new Array(a.length).fill(null),l=0;l<a.length;l++)o[l]=new L(Math.round((a[l].x-t._offsetX)*t._scaleFactor),Math.round((a[l].y-t._offsetY)*t._scaleFactor),a[l].z);var u=Dt.removeRepeatedPoints(o);return u}},Ss.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},Ss.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},Ss.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},Ss.prototype.interfaces_=function(){return[ra]},Ss.prototype.getClass=function(){return Ss};var Bi=function(){this._li=new $s,this._segStrings=null;var t=arguments[0];this._segStrings=t},Ng={fact:{configurable:!0}};Bi.prototype.checkEndPtVertexIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var i=e.next(),n=i.getCoordinates();t.checkEndPtVertexIntersections(n[0],t._segStrings),t.checkEndPtVertexIntersections(n[n.length-1],t._segStrings)}else if(arguments.length===2){for(var s=arguments[0],a=arguments[1],o=a.iterator();o.hasNext();)for(var l=o.next(),u=l.getCoordinates(),c=1;c<u.length-1;c++)if(u[c].equals(s))throw new zn("found endpt/interior pt intersection at index "+c+" :pt "+s)}},Bi.prototype.checkInteriorIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();)for(var i=e.next(),n=this._segStrings.iterator();n.hasNext();){var s=n.next();t.checkInteriorIntersections(i,s)}else if(arguments.length===2)for(var a=arguments[0],o=arguments[1],l=a.getCoordinates(),u=o.getCoordinates(),c=0;c<l.length-1;c++)for(var h=0;h<u.length-1;h++)t.checkInteriorIntersections(a,c,o,h);else if(arguments.length===4){var f=arguments[0],g=arguments[1],m=arguments[2],_=arguments[3];if(f===m&&g===_)return null;var E=f.getCoordinates()[g],M=f.getCoordinates()[g+1],y=m.getCoordinates()[_],w=m.getCoordinates()[_+1];if(this._li.computeIntersection(E,M,y,w),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,E,M)||this.hasInteriorIntersection(this._li,y,w)))throw new zn("found non-noded intersection at "+E+"-"+M+" and "+y+"-"+w)}},Bi.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},Bi.prototype.checkCollapses=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var i=e.next();t.checkCollapses(i)}else if(arguments.length===1)for(var n=arguments[0],s=n.getCoordinates(),a=0;a<s.length-2;a++)t.checkCollapse(s[a],s[a+1],s[a+2])},Bi.prototype.hasInteriorIntersection=function(t,e,i){for(var n=0;n<t.getIntersectionNum();n++){var s=t.getIntersection(n);if(!(s.equals(e)||s.equals(i)))return!0}return!1},Bi.prototype.checkCollapse=function(t,e,i){if(t.equals(i))throw new zn("found non-noded collapse at "+Bi.fact.createLineString([t,e,i]))},Bi.prototype.interfaces_=function(){return[]},Bi.prototype.getClass=function(){return Bi},Ng.fact.get=function(){return new xt},Object.defineProperties(Bi,Ng);var pr=function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var t=arguments[0],e=arguments[1],i=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=i,e<=0)throw new oe("Scale factor must be non-zero");e!==1&&(this._pt=new L(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new L,this._p1Scaled=new L),this.initCorners(this._pt)},bg={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};pr.prototype.intersectsScaled=function(t,e){var i=Math.min(t.x,e.x),n=Math.max(t.x,e.x),s=Math.min(t.y,e.y),a=Math.max(t.y,e.y),o=this._maxx<i||this._minx>n||this._maxy<s||this._miny>a;if(o)return!1;var l=this.intersectsToleranceSquare(t,e);return Mt.isTrue(!(o&&l),"Found bad envelope test"),l},pr.prototype.initCorners=function(t){var e=.5;this._minx=t.x-e,this._maxx=t.x+e,this._miny=t.y-e,this._maxy=t.y+e,this._corner[0]=new L(this._maxx,this._maxy),this._corner[1]=new L(this._minx,this._maxy),this._corner[2]=new L(this._minx,this._miny),this._corner[3]=new L(this._maxx,this._miny)},pr.prototype.intersects=function(t,e){return this._scaleFactor===1?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},pr.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},pr.prototype.getCoordinate=function(){return this._originalPt},pr.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},pr.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var t=pr.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new dt(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},pr.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))},pr.prototype.intersectsToleranceSquare=function(t,e){var i=!1,n=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper())||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper())||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper())||i&&n||t.equals(this._pt)||e.equals(this._pt))},pr.prototype.addSnappedNode=function(t,e){var i=t.getCoordinate(e),n=t.getCoordinate(e+1);return this.intersects(i,n)?(t.addIntersection(this.getCoordinate(),e),!0):!1},pr.prototype.interfaces_=function(){return[]},pr.prototype.getClass=function(){return pr},bg.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(pr,bg);var fh=function(){this.tempEnv1=new dt,this.selectedSegment=new pt};fh.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}}},fh.prototype.interfaces_=function(){return[]},fh.prototype.getClass=function(){return fh};var fu=function(){this._index=null;var t=arguments[0];this._index=t},Tg={HotPixelSnapAction:{configurable:!0}};fu.prototype.snap=function(){if(arguments.length===1){var t=arguments[0];return this.snap(t,null,-1)}else if(arguments.length===3){var e=arguments[0],i=arguments[1],n=arguments[2],s=e.getSafeEnvelope(),a=new Dg(e,i,n);return this._index.query(s,{interfaces_:function(){return[_s]},visitItem:function(o){var l=o;l.select(s,a)}}),a.isNodeAdded()}},fu.prototype.interfaces_=function(){return[]},fu.prototype.getClass=function(){return fu},Tg.HotPixelSnapAction.get=function(){return Dg},Object.defineProperties(fu,Tg);var Dg=function(r){function t(){r.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],i=arguments[1],n=arguments[2];this._hotPixel=e,this._parentEdge=i,this._hotPixelVertexIndex=n}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.isNodeAdded=function(){return this._isNodeAdded},t.prototype.select=function(){if(arguments.length===2){var i=arguments[0],n=arguments[1],s=i.getContext();if(this._parentEdge!==null&&s===this._parentEdge&&n===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(s,n)}else return r.prototype.select.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(fh),Xa=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new B};Xa.prototype.processIntersections=function(t,e,i,n){var s=this;if(t===i&&e===n)return null;var a=t.getCoordinates()[e],o=t.getCoordinates()[e+1],l=i.getCoordinates()[n],u=i.getCoordinates()[n+1];if(this._li.computeIntersection(a,o,l,u),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var c=0;c<this._li.getIntersectionNum();c++)s._interiorIntersections.add(s._li.getIntersection(c));t.addIntersections(this._li,e,0),i.addIntersections(this._li,n,1)}},Xa.prototype.isDone=function(){return!1},Xa.prototype.getInteriorIntersections=function(){return this._interiorIntersections},Xa.prototype.interfaces_=function(){return[na]},Xa.prototype.getClass=function(){return Xa};var En=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var t=arguments[0];this._pm=t,this._li=new $s,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};En.prototype.checkCorrectness=function(t){var e=_e.getNodedSubstrings(t),i=new Bi(e);try{i.checkValid()}catch(n){if(n instanceof ug)n.printStackTrace();else throw n}finally{}},En.prototype.getNodedSubstrings=function(){return _e.getNodedSubstrings(this._nodedSegStrings)},En.prototype.snapRound=function(t,e){var i=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(i),this.computeVertexSnaps(t)},En.prototype.findInteriorIntersections=function(t,e){var i=new Xa(e);return this._noder.setSegmentIntersector(i),this._noder.computeNodes(t),i.getInteriorIntersections()},En.prototype.computeVertexSnaps=function(){var t=this;if(_t(arguments[0],Me))for(var e=arguments[0],i=e.iterator();i.hasNext();){var n=i.next();t.computeVertexSnaps(n)}else if(arguments[0]instanceof _e)for(var s=arguments[0],a=s.getCoordinates(),o=0;o<a.length;o++){var l=new pr(a[o],t._scaleFactor,t._li),u=t._pointSnapper.snap(l,s,o);u&&s.addIntersection(a[o],o)}},En.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new Zf,this._pointSnapper=new fu(this._noder.getIndex()),this.snapRound(t,this._li)},En.prototype.computeIntersectionSnaps=function(t){for(var e=this,i=t.iterator();i.hasNext();){var n=i.next(),s=new pr(n,e._scaleFactor,e._li);e._pointSnapper.snap(s)}},En.prototype.interfaces_=function(){return[ra]},En.prototype.getClass=function(){return En};var qe=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new qt,this._resultGeometry=null,this._saveException=null,arguments.length===1){var t=arguments[0];this._argGeom=t}else if(arguments.length===2){var e=arguments[0],i=arguments[1];this._argGeom=e,this._bufParams=i}},du={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};qe.prototype.bufferFixedPrecision=function(t){var e=new Ss(new En(new Ut(1)),t.getScale()),i=new nr(this._bufParams);i.setWorkingPrecisionModel(t),i.setNoder(e),this._resultGeometry=i.buffer(this._argGeom,this._distance)},qe.prototype.bufferReducedPrecision=function(){var t=this;if(arguments.length===0){for(var e=qe.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(a){if(a instanceof Xn)t._saveException=a;else throw a}finally{}if(t._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var i=arguments[0],n=qe.precisionScaleFactor(this._argGeom,this._distance,i),s=new Ut(n);this.bufferFixedPrecision(s)}},qe.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===Ut.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},qe.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},qe.prototype.bufferOriginalPrecision=function(){try{var t=new nr(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(e){if(e instanceof zn)this._saveException=e;else throw e}finally{}},qe.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},qe.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},qe.prototype.interfaces_=function(){return[]},qe.prototype.getClass=function(){return qe},qe.bufferOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],i=new qe(t),n=i.getResultGeometry(e);return n}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof yt&&typeof arguments[1]=="number"){var s=arguments[0],a=arguments[1],o=arguments[2],l=new qe(s);l.setQuadrantSegments(o);var u=l.getResultGeometry(a);return u}else if(arguments[2]instanceof qt&&arguments[0]instanceof yt&&typeof arguments[1]=="number"){var c=arguments[0],h=arguments[1],f=arguments[2],g=new qe(c,f),m=g.getResultGeometry(h);return m}}else if(arguments.length===4){var _=arguments[0],E=arguments[1],M=arguments[2],y=arguments[3],w=new qe(_);w.setQuadrantSegments(M),w.setEndCapStyle(y);var v=w.getResultGeometry(E);return v}},qe.precisionScaleFactor=function(t,e,i){var n=t.getEnvelopeInternal(),s=Gr.max(Math.abs(n.getMaxX()),Math.abs(n.getMaxY()),Math.abs(n.getMinX()),Math.abs(n.getMinY())),a=e>0?e:0,o=s+2*a,l=Math.trunc(Math.log(o)/Math.log(10)+1),u=i-l,c=Math.pow(10,u);return c},du.CAP_ROUND.get=function(){return qt.CAP_ROUND},du.CAP_BUTT.get=function(){return qt.CAP_FLAT},du.CAP_FLAT.get=function(){return qt.CAP_FLAT},du.CAP_SQUARE.get=function(){return qt.CAP_SQUARE},du.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(qe,du);var sr=function(){this._pt=[new L,new L],this._distance=Et.NaN,this._isNull=!0};sr.prototype.getCoordinates=function(){return this._pt},sr.prototype.getCoordinate=function(t){return this._pt[t]},sr.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],i=arguments[1];if(this._isNull)return this.initialize(e,i),null;var n=e.distance(i);n<this._distance&&this.initialize(e,i,n)}},sr.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var i=arguments[0],n=arguments[1],s=arguments[2];this._pt[0].setCoordinate(i),this._pt[1].setCoordinate(n),this._distance=s,this._isNull=!1}},sr.prototype.getDistance=function(){return this._distance},sr.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],i=arguments[1];if(this._isNull)return this.initialize(e,i),null;var n=e.distance(i);n>this._distance&&this.initialize(e,i,n)}},sr.prototype.interfaces_=function(){return[]},sr.prototype.getClass=function(){return sr};var Sn=function(){};Sn.prototype.interfaces_=function(){return[]},Sn.prototype.getClass=function(){return Sn},Sn.computeDistance=function(){if(arguments[2]instanceof sr&&arguments[0]instanceof pe&&arguments[1]instanceof L)for(var t=arguments[0],e=arguments[1],i=arguments[2],n=t.getCoordinates(),s=new pt,a=0;a<n.length-1;a++){s.setCoordinates(n[a],n[a+1]);var o=s.closestPoint(e);i.setMinimum(o,e)}else if(arguments[2]instanceof sr&&arguments[0]instanceof Ne&&arguments[1]instanceof L){var l=arguments[0],u=arguments[1],c=arguments[2];Sn.computeDistance(l.getExteriorRing(),u,c);for(var h=0;h<l.getNumInteriorRing();h++)Sn.computeDistance(l.getInteriorRingN(h),u,c)}else if(arguments[2]instanceof sr&&arguments[0]instanceof yt&&arguments[1]instanceof L){var f=arguments[0],g=arguments[1],m=arguments[2];if(f instanceof pe)Sn.computeDistance(f,g,m);else if(f instanceof Ne)Sn.computeDistance(f,g,m);else if(f instanceof er)for(var _=f,E=0;E<_.getNumGeometries();E++){var M=_.getGeometryN(E);Sn.computeDistance(M,g,m)}else m.setMinimum(f.getCoordinate(),g)}else if(arguments[2]instanceof sr&&arguments[0]instanceof pt&&arguments[1]instanceof L){var y=arguments[0],w=arguments[1],v=arguments[2],S=y.closestPoint(w);v.setMinimum(S,w)}};var aa=function(t){this._maxPtDist=new sr,this._inputGeom=t||null},Bf={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};aa.prototype.computeMaxMidpointDistance=function(t){var e=new Ps(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},aa.prototype.computeMaxVertexDistance=function(t){var e=new Ya(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},aa.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},aa.prototype.getDistancePoints=function(){return this._maxPtDist},aa.prototype.interfaces_=function(){return[]},aa.prototype.getClass=function(){return aa},Bf.MaxPointDistanceFilter.get=function(){return Ya},Bf.MaxMidpointDistanceFilter.get=function(){return Ps},Object.defineProperties(aa,Bf);var Ya=function(t){this._maxPtDist=new sr,this._minPtDist=new sr,this._geom=t||null};Ya.prototype.filter=function(t){this._minPtDist.initialize(),Sn.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ya.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ya.prototype.interfaces_=function(){return[pn]},Ya.prototype.getClass=function(){return Ya};var Ps=function(t){this._maxPtDist=new sr,this._minPtDist=new sr,this._geom=t||null};Ps.prototype.filter=function(t,e){if(e===0)return null;var i=t.getCoordinate(e-1),n=t.getCoordinate(e),s=new L((i.x+n.x)/2,(i.y+n.y)/2);this._minPtDist.initialize(),Sn.computeDistance(this._geom,s,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ps.prototype.isDone=function(){return!1},Ps.prototype.isGeometryChanged=function(){return!1},Ps.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ps.prototype.interfaces_=function(){return[Ci]},Ps.prototype.getClass=function(){return Ps};var Qn=function(t){this._comps=t||null};Qn.prototype.filter=function(t){t instanceof Ne&&this._comps.add(t)},Qn.prototype.interfaces_=function(){return[Wi]},Qn.prototype.getClass=function(){return Qn},Qn.getPolygons=function(){if(arguments.length===1){var t=arguments[0];return Qn.getPolygons(t,new B)}else if(arguments.length===2){var e=arguments[0],i=arguments[1];return e instanceof Ne?i.add(e):e instanceof er&&e.apply(new Qn(i)),i}};var We=function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var t=arguments[0];this._lines=t}else if(arguments.length===2){var e=arguments[0],i=arguments[1];this._lines=e,this._isForcedToLineString=i}};We.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof gn){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof pe&&this._lines.add(t)},We.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},We.prototype.interfaces_=function(){return[Vn]},We.prototype.getClass=function(){return We},We.getGeometry=function(){if(arguments.length===1){var t=arguments[0];return t.getFactory().buildGeometry(We.getLines(t))}else if(arguments.length===2){var e=arguments[0],i=arguments[1];return e.getFactory().buildGeometry(We.getLines(e,i))}},We.getLines=function(){if(arguments.length===1){var t=arguments[0];return We.getLines(t,!1)}else if(arguments.length===2){if(_t(arguments[0],Me)&&_t(arguments[1],Me)){for(var e=arguments[0],i=arguments[1],n=e.iterator();n.hasNext();){var s=n.next();We.getLines(s,i)}return i}else if(arguments[0]instanceof yt&&typeof arguments[1]=="boolean"){var a=arguments[0],o=arguments[1],l=new B;return a.apply(new We(l,o)),l}else if(arguments[0]instanceof yt&&_t(arguments[1],Me)){var u=arguments[0],c=arguments[1];return u instanceof pe?c.add(u):u.apply(new We(c)),c}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&_t(arguments[0],Me)&&_t(arguments[1],Me)){for(var h=arguments[0],f=arguments[1],g=arguments[2],m=h.iterator();m.hasNext();){var _=m.next();We.getLines(_,f,g)}return f}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof yt&&_t(arguments[1],Me)){var E=arguments[0],M=arguments[1],y=arguments[2];return E.apply(new We(M,y)),M}}};var bi=function(){if(this._boundaryRule=jr.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];if(t===null)throw new oe("Rule must be non-null");this._boundaryRule=t}}};bi.prototype.locateInternal=function(){var t=this;if(arguments[0]instanceof L&&arguments[1]instanceof Ne){var e=arguments[0],i=arguments[1];if(i.isEmpty())return F.EXTERIOR;var n=i.getExteriorRing(),s=this.locateInPolygonRing(e,n);if(s===F.EXTERIOR)return F.EXTERIOR;if(s===F.BOUNDARY)return F.BOUNDARY;for(var a=0;a<i.getNumInteriorRing();a++){var o=i.getInteriorRingN(a),l=t.locateInPolygonRing(e,o);if(l===F.INTERIOR)return F.EXTERIOR;if(l===F.BOUNDARY)return F.BOUNDARY}return F.INTERIOR}else if(arguments[0]instanceof L&&arguments[1]instanceof pe){var u=arguments[0],c=arguments[1];if(!c.getEnvelopeInternal().intersects(u))return F.EXTERIOR;var h=c.getCoordinates();return!c.isClosed()&&(u.equals(h[0])||u.equals(h[h.length-1]))?F.BOUNDARY:et.isOnLine(u,h)?F.INTERIOR:F.EXTERIOR}else if(arguments[0]instanceof L&&arguments[1]instanceof Mr){var f=arguments[0],g=arguments[1],m=g.getCoordinate();return m.equals2D(f)?F.INTERIOR:F.EXTERIOR}},bi.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?et.locatePointInRing(t,e.getCoordinates()):F.EXTERIOR},bi.prototype.intersects=function(t,e){return this.locate(t,e)!==F.EXTERIOR},bi.prototype.updateLocationInfo=function(t){t===F.INTERIOR&&(this._isIn=!0),t===F.BOUNDARY&&this._numBoundaries++},bi.prototype.computeLocation=function(t,e){var i=this;if(e instanceof Mr&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof pe)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Ne)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof ea)for(var n=e,s=0;s<n.getNumGeometries();s++){var a=n.getGeometryN(s);i.updateLocationInfo(i.locateInternal(t,a))}else if(e instanceof mn)for(var o=e,l=0;l<o.getNumGeometries();l++){var u=o.getGeometryN(l);i.updateLocationInfo(i.locateInternal(t,u))}else if(e instanceof er)for(var c=new _n(e);c.hasNext();){var h=c.next();h!==e&&i.computeLocation(t,h)}},bi.prototype.locate=function(t,e){return e.isEmpty()?F.EXTERIOR:e instanceof pe?this.locateInternal(t,e):e instanceof Ne?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?F.BOUNDARY:this._numBoundaries>0||this._isIn?F.INTERIOR:F.EXTERIOR)},bi.prototype.interfaces_=function(){return[]},bi.prototype.getClass=function(){return bi};var ar=function r(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var t=arguments[0],e=arguments[1];r.call(this,t,r.INSIDE_AREA,e)}else if(arguments.length===3){var i=arguments[0],n=arguments[1],s=arguments[2];this._component=i,this._segIndex=n,this._pt=s}},xg={INSIDE_AREA:{configurable:!0}};ar.prototype.isInsideArea=function(){return this._segIndex===ar.INSIDE_AREA},ar.prototype.getCoordinate=function(){return this._pt},ar.prototype.getGeometryComponent=function(){return this._component},ar.prototype.getSegmentIndex=function(){return this._segIndex},ar.prototype.interfaces_=function(){return[]},ar.prototype.getClass=function(){return ar},xg.INSIDE_AREA.get=function(){return-1},Object.defineProperties(ar,xg);var Cs=function(t){this._pts=t||null};Cs.prototype.filter=function(t){t instanceof Mr&&this._pts.add(t)},Cs.prototype.interfaces_=function(){return[Wi]},Cs.prototype.getClass=function(){return Cs},Cs.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof Mr?Mi.singletonList(t):Cs.getPoints(t,new B)}else if(arguments.length===2){var e=arguments[0],i=arguments[1];return e instanceof Mr?i.add(e):e instanceof er&&e.apply(new Cs(i)),i}};var Ja=function(){this._locations=null;var t=arguments[0];this._locations=t};Ja.prototype.filter=function(t){(t instanceof Mr||t instanceof pe||t instanceof Ne)&&this._locations.add(new ar(t,0,t.getCoordinate()))},Ja.prototype.interfaces_=function(){return[Wi]},Ja.prototype.getClass=function(){return Ja},Ja.getLocations=function(t){var e=new B;return t.apply(new Ja(e)),e};var He=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new bi,this._minDistanceLocation=null,this._minDistance=Et.MAX_VALUE,arguments.length===2){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(arguments.length===3){var i=arguments[0],n=arguments[1],s=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=i,this._geom[1]=n,this._terminateDistance=s}};He.prototype.computeContainmentDistance=function(){var t=this;if(arguments.length===0){var e=new Array(2).fill(null);if(this.computeContainmentDistance(0,e),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(arguments.length===2){var i=arguments[0],n=arguments[1],s=1-i,a=Qn.getPolygons(this._geom[i]);if(a.size()>0){var o=Ja.getLocations(this._geom[s]);if(this.computeContainmentDistance(o,a,n),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[s]=n[0],this._minDistanceLocation[i]=n[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&_t(arguments[0],Si)&&_t(arguments[1],Si)){for(var l=arguments[0],u=arguments[1],c=arguments[2],h=0;h<l.size();h++)for(var f=l.get(h),g=0;g<u.size();g++)if(t.computeContainmentDistance(f,u.get(g),c),t._minDistance<=t._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof ar&&arguments[1]instanceof Ne){var m=arguments[0],_=arguments[1],E=arguments[2],M=m.getCoordinate();if(F.EXTERIOR!==this._ptLocator.locate(M,_))return this._minDistance=0,E[0]=m,E[1]=new ar(_,M),null}}},He.prototype.computeMinDistanceLinesPoints=function(t,e,i){for(var n=this,s=0;s<t.size();s++)for(var a=t.get(s),o=0;o<e.size();o++){var l=e.get(o);if(n.computeMinDistance(a,l,i),n._minDistance<=n._terminateDistance)return null}},He.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=We.getLines(this._geom[0]),i=We.getLines(this._geom[1]),n=Cs.getPoints(this._geom[0]),s=Cs.getPoints(this._geom[1]);if(this.computeMinDistanceLines(e,i,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,s,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance)||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(i,n,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance))return null;t[0]=null,t[1]=null,this.computeMinDistancePoints(n,s,t),this.updateMinDistance(t,!1)},He.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},He.prototype.updateMinDistance=function(t,e){if(t[0]===null)return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},He.prototype.nearestPoints=function(){this.computeMinDistance();var t=[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()];return t},He.prototype.computeMinDistance=function(){var t=this;if(arguments.length===0){if(this._minDistanceLocation!==null||(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance))return null;this.computeFacetDistance()}else if(arguments.length===3){if(arguments[2]instanceof Array&&arguments[0]instanceof pe&&arguments[1]instanceof Mr){var e=arguments[0],i=arguments[1],n=arguments[2];if(e.getEnvelopeInternal().distance(i.getEnvelopeInternal())>this._minDistance)return null;for(var s=e.getCoordinates(),a=i.getCoordinate(),o=0;o<s.length-1;o++){var l=et.distancePointLine(a,s[o],s[o+1]);if(l<t._minDistance){t._minDistance=l;var u=new pt(s[o],s[o+1]),c=u.closestPoint(a);n[0]=new ar(e,o,c),n[1]=new ar(i,0,a)}if(t._minDistance<=t._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof pe&&arguments[1]instanceof pe){var h=arguments[0],f=arguments[1],g=arguments[2];if(h.getEnvelopeInternal().distance(f.getEnvelopeInternal())>this._minDistance)return null;for(var m=h.getCoordinates(),_=f.getCoordinates(),E=0;E<m.length-1;E++)for(var M=0;M<_.length-1;M++){var y=et.distanceLineLine(m[E],m[E+1],_[M],_[M+1]);if(y<t._minDistance){t._minDistance=y;var w=new pt(m[E],m[E+1]),v=new pt(_[M],_[M+1]),S=w.closestPoints(v);g[0]=new ar(h,E,S[0]),g[1]=new ar(f,M,S[1])}if(t._minDistance<=t._terminateDistance)return null}}}},He.prototype.computeMinDistancePoints=function(t,e,i){for(var n=this,s=0;s<t.size();s++)for(var a=t.get(s),o=0;o<e.size();o++){var l=e.get(o),u=a.getCoordinate().distance(l.getCoordinate());if(u<n._minDistance&&(n._minDistance=u,i[0]=new ar(a,0,a.getCoordinate()),i[1]=new ar(l,0,l.getCoordinate())),n._minDistance<=n._terminateDistance)return null}},He.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new oe("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},He.prototype.computeMinDistanceLines=function(t,e,i){for(var n=this,s=0;s<t.size();s++)for(var a=t.get(s),o=0;o<e.size();o++){var l=e.get(o);if(n.computeMinDistance(a,l,i),n._minDistance<=n._terminateDistance)return null}},He.prototype.interfaces_=function(){return[]},He.prototype.getClass=function(){return He},He.distance=function(t,e){var i=new He(t,e);return i.distance()},He.isWithinDistance=function(t,e,i){var n=new He(t,e,i);return n.distance()<=i},He.nearestPoints=function(t,e){var i=new He(t,e);return i.nearestPoints()};var je=function(){this._pt=[new L,new L],this._distance=Et.NaN,this._isNull=!0};je.prototype.getCoordinates=function(){return this._pt},je.prototype.getCoordinate=function(t){return this._pt[t]},je.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],i=arguments[1];if(this._isNull)return this.initialize(e,i),null;var n=e.distance(i);n<this._distance&&this.initialize(e,i,n)}},je.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var i=arguments[0],n=arguments[1],s=arguments[2];this._pt[0].setCoordinate(i),this._pt[1].setCoordinate(n),this._distance=s,this._isNull=!1}},je.prototype.toString=function(){return Ei.toLineString(this._pt[0],this._pt[1])},je.prototype.getDistance=function(){return this._distance},je.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],i=arguments[1];if(this._isNull)return this.initialize(e,i),null;var n=e.distance(i);n>this._distance&&this.initialize(e,i,n)}},je.prototype.interfaces_=function(){return[]},je.prototype.getClass=function(){return je};var $i=function(){};$i.prototype.interfaces_=function(){return[]},$i.prototype.getClass=function(){return $i},$i.computeDistance=function(){if(arguments[2]instanceof je&&arguments[0]instanceof pe&&arguments[1]instanceof L)for(var t=arguments[0],e=arguments[1],i=arguments[2],n=new pt,s=t.getCoordinates(),a=0;a<s.length-1;a++){n.setCoordinates(s[a],s[a+1]);var o=n.closestPoint(e);i.setMinimum(o,e)}else if(arguments[2]instanceof je&&arguments[0]instanceof Ne&&arguments[1]instanceof L){var l=arguments[0],u=arguments[1],c=arguments[2];$i.computeDistance(l.getExteriorRing(),u,c);for(var h=0;h<l.getNumInteriorRing();h++)$i.computeDistance(l.getInteriorRingN(h),u,c)}else if(arguments[2]instanceof je&&arguments[0]instanceof yt&&arguments[1]instanceof L){var f=arguments[0],g=arguments[1],m=arguments[2];if(f instanceof pe)$i.computeDistance(f,g,m);else if(f instanceof Ne)$i.computeDistance(f,g,m);else if(f instanceof er)for(var _=f,E=0;E<_.getNumGeometries();E++){var M=_.getGeometryN(E);$i.computeDistance(M,g,m)}else m.setMinimum(f.getCoordinate(),g)}else if(arguments[2]instanceof je&&arguments[0]instanceof pt&&arguments[1]instanceof L){var y=arguments[0],w=arguments[1],v=arguments[2],S=y.closestPoint(w);v.setMinimum(S,w)}};var ni=function(){this._g0=null,this._g1=null,this._ptDist=new je,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},$f={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};ni.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},ni.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new oe("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},ni.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},ni.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},ni.prototype.computeOrientedDistance=function(t,e,i){var n=new Ka(e);if(t.apply(n),i.setMaximum(n.getMaxPointDistance()),this._densifyFrac>0){var s=new Is(e,this._densifyFrac);t.apply(s),i.setMaximum(s.getMaxPointDistance())}},ni.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},ni.prototype.interfaces_=function(){return[]},ni.prototype.getClass=function(){return ni},ni.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],i=new ni(t,e);return i.distance()}else if(arguments.length===3){var n=arguments[0],s=arguments[1],a=arguments[2],o=new ni(n,s);return o.setDensifyFraction(a),o.distance()}},$f.MaxPointDistanceFilter.get=function(){return Ka},$f.MaxDensifiedByFractionDistanceFilter.get=function(){return Is},Object.defineProperties(ni,$f);var Ka=function(){this._maxPtDist=new je,this._minPtDist=new je,this._euclideanDist=new $i,this._geom=null;var t=arguments[0];this._geom=t};Ka.prototype.filter=function(t){this._minPtDist.initialize(),$i.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ka.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ka.prototype.interfaces_=function(){return[pn]},Ka.prototype.getClass=function(){return Ka};var Is=function(){this._maxPtDist=new je,this._minPtDist=new je,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};Is.prototype.filter=function(t,e){var i=this;if(e===0)return null;for(var n=t.getCoordinate(e-1),s=t.getCoordinate(e),a=(s.x-n.x)/this._numSubSegs,o=(s.y-n.y)/this._numSubSegs,l=0;l<this._numSubSegs;l++){var u=n.x+l*a,c=n.y+l*o,h=new L(u,c);i._minPtDist.initialize(),$i.computeDistance(i._geom,h,i._minPtDist),i._maxPtDist.setMaximum(i._minPtDist)}},Is.prototype.isDone=function(){return!1},Is.prototype.isGeometryChanged=function(){return!1},Is.prototype.getMaxPointDistance=function(){return this._maxPtDist},Is.prototype.interfaces_=function(){return[Ci]},Is.prototype.getClass=function(){return Is};var Tr=function(t,e,i){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=e||null,this._result=i||null},jf={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Tr.prototype.checkMaximumDistance=function(t,e,i){var n=new ni(e,t);if(n.setDensifyFraction(.25),this._maxDistanceFound=n.orientedDistance(),this._maxDistanceFound>i){this._isValid=!1;var s=n.getCoordinates();this._errorLocation=s[1],this._errorIndicator=t.getFactory().createLineString(s),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Ei.toLineString(s[0],s[1])+")"}},Tr.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Tr.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Tr.VERBOSE&&Ve.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Tr.prototype.checkNegativeValid=function(){if(!(this._input instanceof Ne||this._input instanceof mn||this._input instanceof er))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},Tr.prototype.getErrorIndicator=function(){return this._errorIndicator},Tr.prototype.checkMinimumDistance=function(t,e,i){var n=new He(t,e,i);if(this._minDistanceFound=n.distance(),this._minDistanceFound<i){this._isValid=!1;var s=n.nearestPoints();this._errorLocation=n.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(s),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+Ei.toLineString(s[0],s[1])+" )"}},Tr.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();if(this.checkMinimumDistance(this._input,t,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,t,this._maxValidDistance)},Tr.prototype.getErrorLocation=function(){return this._errorLocation},Tr.prototype.getPolygonLines=function(t){for(var e=new B,i=new We(e),n=Qn.getPolygons(t),s=n.iterator();s.hasNext();){var a=s.next();a.apply(i)}return t.getFactory().buildGeometry(e)},Tr.prototype.getErrorMessage=function(){return this._errMsg},Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr},jf.VERBOSE.get=function(){return!1},jf.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Tr,jf);var Xe=function(t,e,i){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=i||null},td={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Xe.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},Xe.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Xe.MAX_ENV_DIFF_FRAC;t===0&&(t=.001);var e=new dt(this._input.getEnvelopeInternal());e.expandBy(this._distance);var i=new dt(this._result.getEnvelopeInternal());i.expandBy(t),i.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(i)),this.report("Envelope")},Xe.prototype.checkDistance=function(){var t=new Tr(this._input,this._distance,this._result);t.isValid()||(this._isValid=!1,this._errorMsg=t.getErrorMessage(),this._errorLocation=t.getErrorLocation(),this._errorIndicator=t.getErrorIndicator()),this.report("Distance")},Xe.prototype.checkArea=function(){var t=this._input.getArea(),e=this._result.getArea();this._distance>0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<e&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},Xe.prototype.checkPolygonal=function(){this._result instanceof Ne||this._result instanceof mn||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Xe.prototype.getErrorIndicator=function(){return this._errorIndicator},Xe.prototype.getErrorLocation=function(){return this._errorLocation},Xe.prototype.checkExpectedEmpty=function(){if(this._input.getDimension()>=2||this._distance>0)return null;this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),this.report("ExpectedEmpty")},Xe.prototype.report=function(t){if(!Xe.VERBOSE)return null;Ve.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Xe.prototype.getErrorMessage=function(){return this._errorMsg},Xe.prototype.interfaces_=function(){return[]},Xe.prototype.getClass=function(){return Xe},Xe.isValidMsg=function(t,e,i){var n=new Xe(t,e,i);return n.isValid()?null:n.getErrorMessage()},Xe.isValid=function(t,e,i){var n=new Xe(t,e,i);return!!n.isValid()},td.VERBOSE.get=function(){return!1},td.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Xe,td);var ji=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};ji.prototype.getCoordinates=function(){return this._pts},ji.prototype.size=function(){return this._pts.length},ji.prototype.getCoordinate=function(t){return this._pts[t]},ji.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},ji.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:qa.octant(this.getCoordinate(t),this.getCoordinate(t+1))},ji.prototype.setData=function(t){this._data=t},ji.prototype.getData=function(){return this._data},ji.prototype.toString=function(){return Ei.toLineString(new ye(this._pts))},ji.prototype.interfaces_=function(){return[yn]},ji.prototype.getClass=function(){return ji};var Ae=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new B,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};Ae.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Ae.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},Ae.prototype.getIntersectionSegments=function(){return this._intSegments},Ae.prototype.count=function(){return this._intersectionCount},Ae.prototype.getIntersections=function(){return this._intersections},Ae.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Ae.prototype.setKeepIntersections=function(t){this._keepIntersections=t},Ae.prototype.processIntersections=function(t,e,i,n){if(!this._findAllIntersections&&this.hasIntersection()||t===i&&e===n)return null;if(this._isCheckEndSegmentsOnly){var s=this.isEndSegment(t,e)||this.isEndSegment(i,n);if(!s)return null}var a=t.getCoordinates()[e],o=t.getCoordinates()[e+1],l=i.getCoordinates()[n],u=i.getCoordinates()[n+1];this._li.computeIntersection(a,o,l,u),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=a,this._intSegments[1]=o,this._intSegments[2]=l,this._intSegments[3]=u,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Ae.prototype.isEndSegment=function(t,e){return e===0||e>=t.size()-2},Ae.prototype.hasIntersection=function(){return this._interiorIntersection!==null},Ae.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null},Ae.prototype.interfaces_=function(){return[na]},Ae.prototype.getClass=function(){return Ae},Ae.createAllIntersectionsFinder=function(t){var e=new Ae(t);return e.setFindAllIntersections(!0),e},Ae.createAnyIntersectionFinder=function(t){return new Ae(t)},Ae.createIntersectionCounter=function(t){var e=new Ae(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Ti=function(){this._li=new $s,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Ti.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},Ti.prototype.getIntersections=function(){return this._segInt.getIntersections()},Ti.prototype.isValid=function(){return this.execute(),this._isValid},Ti.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Ti.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Ae(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new Zf;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Ti.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Xn(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Ti.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Ei.toLineString(t[0],t[1])+" and "+Ei.toLineString(t[2],t[3])},Ti.prototype.interfaces_=function(){return[]},Ti.prototype.getClass=function(){return Ti},Ti.computeIntersections=function(t){var e=new Ti(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var oa=function r(){this._nv=null;var t=arguments[0];this._nv=new Ti(r.toSegmentStrings(t))};oa.prototype.checkValid=function(){this._nv.checkValid()},oa.prototype.interfaces_=function(){return[]},oa.prototype.getClass=function(){return oa},oa.toSegmentStrings=function(t){for(var e=new B,i=t.iterator();i.hasNext();){var n=i.next();e.add(new ji(n.getCoordinates(),n))}return e},oa.checkValid=function(t){var e=new oa(t);e.checkValid()};var Qa=function(t){this._mapOp=t};Qa.prototype.map=function(t){for(var e=this,i=new B,n=0;n<t.getNumGeometries();n++){var s=e._mapOp.map(t.getGeometryN(n));s.isEmpty()||i.add(s)}return t.getFactory().createGeometryCollection(xt.toGeometryArray(i))},Qa.prototype.interfaces_=function(){return[]},Qa.prototype.getClass=function(){return Qa},Qa.map=function(t,e){var i=new Qa(e);return i.map(t)};var tn=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new B,this._resultLineList=new B;var t=arguments[0],e=arguments[1],i=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=i};tn.prototype.collectLines=function(t){for(var e=this,i=this._op.getGraph().getEdgeEnds().iterator();i.hasNext();){var n=i.next();e.collectLineEdge(n,t,e._lineEdgesList),e.collectBoundaryTouchEdge(n,t,e._lineEdgesList)}},tn.prototype.labelIsolatedLine=function(t,e){var i=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,i)},tn.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},tn.prototype.collectLineEdge=function(t,e,i){var n=t.getLabel(),s=t.getEdge();t.isLineEdge()&&!t.isVisited()&&Ct.isResultOfOp(n,e)&&!s.isCovered()&&(i.add(s),t.setVisitedEdge(!0))},tn.prototype.findCoveredLineEdges=function(){for(var t=this,e=this._op.getGraph().getNodes().iterator();e.hasNext();){var i=e.next();i.getEdges().findCoveredLineEdges()}for(var n=this._op.getGraph().getEdgeEnds().iterator();n.hasNext();){var s=n.next(),a=s.getEdge();if(s.isLineEdge()&&!a.isCoveredSet()){var o=t._op.isCoveredByA(s.getCoordinate());a.setCovered(o)}}},tn.prototype.labelIsolatedLines=function(t){for(var e=this,i=t.iterator();i.hasNext();){var n=i.next(),s=n.getLabel();n.isIsolated()&&(s.isNull(0)?e.labelIsolatedLine(n,0):e.labelIsolatedLine(n,1))}},tn.prototype.buildLines=function(t){for(var e=this,i=this._lineEdgesList.iterator();i.hasNext();){var n=i.next(),s=e._geometryFactory.createLineString(n.getCoordinates());e._resultLineList.add(s),n.setInResult(!0)}},tn.prototype.collectBoundaryTouchEdge=function(t,e,i){var n=t.getLabel();if(t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult())return null;Mt.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),Ct.isResultOfOp(n,e)&&e===Ct.INTERSECTION&&(i.add(t.getEdge()),t.setVisitedEdge(!0))},tn.prototype.interfaces_=function(){return[]},tn.prototype.getClass=function(){return tn};var Za=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new B;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};Za.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var i=this._geometryFactory.createPoint(e);this._resultPointList.add(i)}},Za.prototype.extractNonCoveredResultNodes=function(t){for(var e=this,i=this._op.getGraph().getNodes().iterator();i.hasNext();){var n=i.next();if(!n.isInResult()&&!n.isIncidentEdgeInResult()&&(n.getEdges().getDegree()===0||t===Ct.INTERSECTION)){var s=n.getLabel();Ct.isResultOfOp(s,t)&&e.filterCoveredNodeToPoint(n)}}},Za.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Za.prototype.interfaces_=function(){return[]},Za.prototype.getClass=function(){return Za};var gr=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};gr.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},gr.prototype.transformPolygon=function(t,e){var i=this,n=!0,s=this.transformLinearRing(t.getExteriorRing(),t);(s===null||!(s instanceof gn)||s.isEmpty())&&(n=!1);for(var a=new B,o=0;o<t.getNumInteriorRing();o++){var l=i.transformLinearRing(t.getInteriorRingN(o),t);l===null||l.isEmpty()||(l instanceof gn||(n=!1),a.add(l))}if(n)return this._factory.createPolygon(s,a.toArray([]));var u=new B;return s!==null&&u.add(s),u.addAll(a),this._factory.buildGeometry(u)},gr.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},gr.prototype.getInputGeometry=function(){return this._inputGeom},gr.prototype.transformMultiLineString=function(t,e){for(var i=this,n=new B,s=0;s<t.getNumGeometries();s++){var a=i.transformLineString(t.getGeometryN(s),t);a!==null&&(a.isEmpty()||n.add(a))}return this._factory.buildGeometry(n)},gr.prototype.transformCoordinates=function(t,e){return this.copy(t)},gr.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},gr.prototype.transformMultiPoint=function(t,e){for(var i=this,n=new B,s=0;s<t.getNumGeometries();s++){var a=i.transformPoint(t.getGeometryN(s),t);a!==null&&(a.isEmpty()||n.add(a))}return this._factory.buildGeometry(n)},gr.prototype.transformMultiPolygon=function(t,e){for(var i=this,n=new B,s=0;s<t.getNumGeometries();s++){var a=i.transformPolygon(t.getGeometryN(s),t);a!==null&&(a.isEmpty()||n.add(a))}return this._factory.buildGeometry(n)},gr.prototype.copy=function(t){return t.copy()},gr.prototype.transformGeometryCollection=function(t,e){for(var i=this,n=new B,s=0;s<t.getNumGeometries();s++){var a=i.transform(t.getGeometryN(s));a!==null&&(i._pruneEmptyGeometry&&a.isEmpty()||n.add(a))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(xt.toGeometryArray(n)):this._factory.buildGeometry(n)},gr.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof Mr)return this.transformPoint(t,null);if(t instanceof ou)return this.transformMultiPoint(t,null);if(t instanceof gn)return this.transformLinearRing(t,null);if(t instanceof pe)return this.transformLineString(t,null);if(t instanceof ea)return this.transformMultiLineString(t,null);if(t instanceof Ne)return this.transformPolygon(t,null);if(t instanceof mn)return this.transformMultiPolygon(t,null);if(t instanceof er)return this.transformGeometryCollection(t,null);throw new oe("Unknown Geometry subtype: "+t.getClass().getName())},gr.prototype.transformLinearRing=function(t,e){var i=this.transformCoordinates(t.getCoordinateSequence(),t);if(i===null)return this._factory.createLinearRing(null);var n=i.size();return n>0&&n<4&&!this._preserveType?this._factory.createLineString(i):this._factory.createLinearRing(i)},gr.prototype.interfaces_=function(){return[]},gr.prototype.getClass=function(){return gr};var Pn=function r(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new pt,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof pe&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];r.call(this,t.getCoordinates(),e)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var i=arguments[0],n=arguments[1];this._srcPts=i,this._isClosed=r.isClosed(i),this._snapTolerance=n}};Pn.prototype.snapVertices=function(t,e){for(var i=this,n=this._isClosed?t.size()-1:t.size(),s=0;s<n;s++){var a=t.get(s),o=i.findSnapForVertex(a,e);o!==null&&(t.set(s,new L(o)),s===0&&i._isClosed&&t.set(t.size()-1,new L(o)))}},Pn.prototype.findSnapForVertex=function(t,e){for(var i=this,n=0;n<e.length;n++){if(t.equals2D(e[n]))return null;if(t.distance(e[n])<i._snapTolerance)return e[n]}return null},Pn.prototype.snapTo=function(t){var e=new $u(this._srcPts);this.snapVertices(e,t),this.snapSegments(e,t);var i=e.toCoordinateArray();return i},Pn.prototype.snapSegments=function(t,e){var i=this;if(e.length===0)return null;var n=e.length;e[0].equals2D(e[e.length-1])&&(n=e.length-1);for(var s=0;s<n;s++){var a=e[s],o=i.findSegmentIndexToSnap(a,t);o>=0&&t.add(o+1,new L(a),!1)}},Pn.prototype.findSegmentIndexToSnap=function(t,e){for(var i=this,n=Et.MAX_VALUE,s=-1,a=0;a<e.size()-1;a++){if(i._seg.p0=e.get(a),i._seg.p1=e.get(a+1),i._seg.p0.equals2D(t)||i._seg.p1.equals2D(t)){if(i._allowSnappingToSourceVertices)continue;return-1}var o=i._seg.distance(t);o<i._snapTolerance&&o<n&&(n=o,s=a)}return s},Pn.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Pn.prototype.interfaces_=function(){return[]},Pn.prototype.getClass=function(){return Pn},Pn.isClosed=function(t){return t.length<=1?!1:t[0].equals2D(t[t.length-1])};var we=function(t){this._srcGeom=t||null},Og={SNAP_PRECISION_FACTOR:{configurable:!0}};we.prototype.snapTo=function(t,e){var i=this.extractTargetCoordinates(t),n=new Ag(e,i);return n.transform(this._srcGeom)},we.prototype.snapToSelf=function(t,e){var i=this.extractTargetCoordinates(this._srcGeom),n=new Ag(t,i,!0),s=n.transform(this._srcGeom),a=s;return e&&_t(a,ys)&&(a=s.buffer(0)),a},we.prototype.computeSnapTolerance=function(t){var e=this.computeMinimumSegmentLength(t),i=e/10;return i},we.prototype.extractTargetCoordinates=function(t){for(var e=new qi,i=t.getCoordinates(),n=0;n<i.length;n++)e.add(i[n]);return e.toArray(new Array(0).fill(null))},we.prototype.computeMinimumSegmentLength=function(t){for(var e=Et.MAX_VALUE,i=0;i<t.length-1;i++){var n=t[i].distance(t[i+1]);n<e&&(e=n)}return e},we.prototype.interfaces_=function(){return[]},we.prototype.getClass=function(){return we},we.snap=function(t,e,i){var n=new Array(2).fill(null),s=new we(t);n[0]=s.snapTo(e,i);var a=new we(e);return n[1]=a.snapTo(n[0],i),n},we.computeOverlaySnapTolerance=function(){if(arguments.length===1){var t=arguments[0],e=we.computeSizeBasedSnapTolerance(t),i=t.getPrecisionModel();if(i.getType()===Ut.FIXED){var n=1/i.getScale()*2/1.415;n>e&&(e=n)}return e}else if(arguments.length===2){var s=arguments[0],a=arguments[1];return Math.min(we.computeOverlaySnapTolerance(s),we.computeOverlaySnapTolerance(a))}},we.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal(),i=Math.min(e.getHeight(),e.getWidth()),n=i*we.SNAP_PRECISION_FACTOR;return n},we.snapToSelf=function(t,e,i){var n=new we(t);return n.snapToSelf(e,i)},Og.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(we,Og);var Ag=function(r){function t(e,i,n){r.call(this),this._snapTolerance=e||null,this._snapPts=i||null,this._isSelfSnap=n!==void 0?n:!1}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.snapLine=function(i,n){var s=new Pn(i,this._snapTolerance);return s.setAllowSnappingToSourceVertices(this._isSelfSnap),s.snapTo(n)},t.prototype.transformCoordinates=function(i,n){var s=i.toCoordinateArray(),a=this.snapLine(s,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(a)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(gr),or=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};or.prototype.getCommon=function(){return Et.longBitsToDouble(this._commonBits)},or.prototype.add=function(t){var e=Et.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=or.signExpBits(this._commonBits),this._isFirst=!1,null;var i=or.signExpBits(e);if(i!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=or.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=or.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},or.prototype.toString=function(){if(arguments.length===1){var t=arguments[0],e=Et.longBitsToDouble(t),i=Et.toBinaryString(t),n="0000000000000000000000000000000000000000000000000000000000000000"+i,s=n.substring(n.length-64),a=s.substring(0,1)+" "+s.substring(1,12)+"(exp) "+s.substring(12)+" [ "+e+" ]";return a}},or.prototype.interfaces_=function(){return[]},or.prototype.getClass=function(){return or},or.getBit=function(t,e){var i=1<<e;return(t&i)!==0?1:0},or.signExpBits=function(t){return t>>52},or.zeroLowerBits=function(t,e){var i=(1<<e)-1,n=~i,s=t&n;return s},or.numCommonMostSigMantissaBits=function(t,e){for(var i=0,n=52;n>=0;n--){if(or.getBit(t,n)!==or.getBit(e,n))return i;i++}return 52};var Ms=function(){this._commonCoord=null,this._ccFilter=new Ba},ed={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};Ms.prototype.addCommonBits=function(t){var e=new Ns(this._commonCoord);t.apply(e),t.geometryChanged()},Ms.prototype.removeCommonBits=function(t){if(this._commonCoord.x===0&&this._commonCoord.y===0)return t;var e=new L(this._commonCoord);e.x=-e.x,e.y=-e.y;var i=new Ns(e);return t.apply(i),t.geometryChanged(),t},Ms.prototype.getCommonCoordinate=function(){return this._commonCoord},Ms.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},Ms.prototype.interfaces_=function(){return[]},Ms.prototype.getClass=function(){return Ms},ed.CommonCoordinateFilter.get=function(){return Ba},ed.Translater.get=function(){return Ns},Object.defineProperties(Ms,ed);var Ba=function(){this._commonBitsX=new or,this._commonBitsY=new or};Ba.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},Ba.prototype.getCommonCoordinate=function(){return new L(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},Ba.prototype.interfaces_=function(){return[pn]},Ba.prototype.getClass=function(){return Ba};var Ns=function(){this.trans=null;var t=arguments[0];this.trans=t};Ns.prototype.filter=function(t,e){var i=t.getOrdinate(e,0)+this.trans.x,n=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,i),t.setOrdinate(e,1,n)},Ns.prototype.isDone=function(){return!1},Ns.prototype.isGeometryChanged=function(){return!0},Ns.prototype.interfaces_=function(){return[Ci]},Ns.prototype.getClass=function(){return Ns};var Le=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};Le.prototype.selfSnap=function(t){var e=new we(t),i=e.snapTo(t,this._snapTolerance);return i},Le.prototype.removeCommonBits=function(t){this._cbr=new Ms,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},Le.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},Le.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),i=Ct.overlayOp(e[0],e[1],t);return this.prepareResult(i)},Le.prototype.checkValid=function(t){t.isValid()||Ve.out.println("Snapped geometry is invalid")},Le.prototype.computeSnapTolerance=function(){this._snapTolerance=we.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},Le.prototype.snap=function(t){var e=this.removeCommonBits(t),i=we.snap(e[0],e[1],this._snapTolerance);return i},Le.prototype.interfaces_=function(){return[]},Le.prototype.getClass=function(){return Le},Le.overlayOp=function(t,e,i){var n=new Le(t,e);return n.getResultGeometry(i)},Le.union=function(t,e){return Le.overlayOp(t,e,Ct.UNION)},Le.intersection=function(t,e){return Le.overlayOp(t,e,Ct.INTERSECTION)},Le.symDifference=function(t,e){return Le.overlayOp(t,e,Ct.SYMDIFFERENCE)},Le.difference=function(t,e){return Le.overlayOp(t,e,Ct.DIFFERENCE)};var lr=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};lr.prototype.getResultGeometry=function(t){var e=null,i=!1,n=null;try{e=Ct.overlayOp(this._geom[0],this._geom[1],t);var s=!0;s&&(i=!0)}catch(a){if(a instanceof zn)n=a;else throw a}finally{}if(!i)try{e=Le.overlayOp(this._geom[0],this._geom[1],t)}catch(a){throw a instanceof zn?n:a}finally{}return e},lr.prototype.interfaces_=function(){return[]},lr.prototype.getClass=function(){return lr},lr.overlayOp=function(t,e,i){var n=new lr(t,e);return n.getResultGeometry(i)},lr.union=function(t,e){return lr.overlayOp(t,e,Ct.UNION)},lr.intersection=function(t,e){return lr.overlayOp(t,e,Ct.INTERSECTION)},lr.symDifference=function(t,e){return lr.overlayOp(t,e,Ct.SYMDIFFERENCE)},lr.difference=function(t,e){return lr.overlayOp(t,e,Ct.DIFFERENCE)};var dh=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};dh.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},dh.prototype.interfaces_=function(){return[]},dh.prototype.getClass=function(){return dh};var Dr=function r(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var t=arguments[0],e=arguments[1];this._eventType=r.DELETE,this._xValue=t,this._insertEvent=e}else if(arguments.length===3){var i=arguments[0],n=arguments[1],s=arguments[2];this._eventType=r.INSERT,this._label=i,this._xValue=n,this._obj=s}},rd={INSERT:{configurable:!0},DELETE:{configurable:!0}};Dr.prototype.isDelete=function(){return this._eventType===Dr.DELETE},Dr.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},Dr.prototype.getObject=function(){return this._obj},Dr.prototype.compareTo=function(t){var e=t;return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:this._eventType>e._eventType?1:0},Dr.prototype.getInsertEvent=function(){return this._insertEvent},Dr.prototype.isInsert=function(){return this._eventType===Dr.INSERT},Dr.prototype.isSameLabel=function(t){return this._label===null?!1:this._label===t._label},Dr.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},Dr.prototype.interfaces_=function(){return[Br]},Dr.prototype.getClass=function(){return Dr},rd.INSERT.get=function(){return 1},rd.DELETE.get=function(){return 2},Object.defineProperties(Dr,rd);var Sc=function(){};Sc.prototype.interfaces_=function(){return[]},Sc.prototype.getClass=function(){return Sc};var Ye=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],i=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=i};Ye.prototype.isTrivialIntersection=function(t,e,i,n){if(t===i&&this._li.getIntersectionNum()===1){if(Ye.isAdjacentSegments(e,n))return!0;if(t.isClosed()){var s=t.getNumPoints()-1;if(e===0&&n===s||n===0&&e===s)return!0}}return!1},Ye.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Ye.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},Ye.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Ye.prototype.isBoundaryPointInternal=function(t,e){for(var i=e.iterator();i.hasNext();){var n=i.next(),s=n.getCoordinate();if(t.isIntersection(s))return!0}return!1},Ye.prototype.hasProperIntersection=function(){return this._hasProper},Ye.prototype.hasIntersection=function(){return this._hasIntersection},Ye.prototype.isDone=function(){return this._isDone},Ye.prototype.isBoundaryPoint=function(t,e){return e===null?!1:!!(this.isBoundaryPointInternal(t,e[0])||this.isBoundaryPointInternal(t,e[1]))},Ye.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},Ye.prototype.addIntersections=function(t,e,i,n){if(t===i&&e===n)return null;this.numTests++;var s=t.getCoordinates()[e],a=t.getCoordinates()[e+1],o=i.getCoordinates()[n],l=i.getCoordinates()[n+1];this._li.computeIntersection(s,a,o,l),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),i.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,i,n)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(t.addIntersections(this._li,e,0),i.addIntersections(this._li,n,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye},Ye.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var L_=function(r){function t(){r.call(this),this.events=new B,this.nOverlaps=null}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.prepareEvents=function(){var i=this;Mi.sort(this.events);for(var n=0;n<this.events.size();n++){var s=i.events.get(n);s.isDelete()&&s.getInsertEvent().setDeleteEventIndex(n)}},t.prototype.computeIntersections=function(){var i=this;if(arguments.length===1){var n=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var s=0;s<this.events.size();s++){var a=i.events.get(s);if(a.isInsert()&&i.processOverlaps(s,a.getDeleteEventIndex(),a,n),n.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof Ye&&_t(arguments[0],Si)&&_t(arguments[1],Si)){var o=arguments[0],l=arguments[1],u=arguments[2];this.addEdges(o,o),this.addEdges(l,l),this.computeIntersections(u)}else if(typeof arguments[2]=="boolean"&&_t(arguments[0],Si)&&arguments[1]instanceof Ye){var c=arguments[0],h=arguments[1],f=arguments[2];f?this.addEdges(c,null):this.addEdges(c),this.computeIntersections(h)}}},t.prototype.addEdge=function(i,n){for(var s=this,a=i.getMonotoneChainEdge(),o=a.getStartIndexes(),l=0;l<o.length-1;l++){var u=new dh(a,l),c=new Dr(n,a.getMinX(l),u);s.events.add(c),s.events.add(new Dr(a.getMaxX(l),c))}},t.prototype.processOverlaps=function(i,n,s,a){for(var o=this,l=s.getObject(),u=i;u<n;u++){var c=o.events.get(u);if(c.isInsert()){var h=c.getObject();s.isSameLabel(c)||(l.computeIntersections(h,a),o.nOverlaps++)}}},t.prototype.addEdges=function(){var i=this;if(arguments.length===1)for(var n=arguments[0],s=n.iterator();s.hasNext();){var a=s.next();i.addEdge(a,a)}else if(arguments.length===2)for(var o=arguments[0],l=arguments[1],u=o.iterator();u.hasNext();){var c=u.next();i.addEdge(c,l)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Sc),Cn=function(){this._min=Et.POSITIVE_INFINITY,this._max=Et.NEGATIVE_INFINITY},Lg={NodeComparator:{configurable:!0}};Cn.prototype.getMin=function(){return this._min},Cn.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},Cn.prototype.getMax=function(){return this._max},Cn.prototype.toString=function(){return Ei.toLineString(new L(this._min,0),new L(this._max,0))},Cn.prototype.interfaces_=function(){return[]},Cn.prototype.getClass=function(){return Cn},Lg.NodeComparator.get=function(){return ph},Object.defineProperties(Cn,Lg);var ph=function(){};ph.prototype.compare=function(t,e){var i=t,n=e,s=(i._min+i._max)/2,a=(n._min+n._max)/2;return s<a?-1:s>a?1:0},ph.prototype.interfaces_=function(){return[Zl]},ph.prototype.getClass=function(){return ph};var R_=function(r){function t(){r.call(this),this._item=null;var e=arguments[0],i=arguments[1],n=arguments[2];this._min=e,this._max=i,this._item=n}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.query=function(i,n,s){if(!this.intersects(i,n))return null;s.visitItem(this._item)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Cn),F_=function(r){function t(){r.call(this),this._node1=null,this._node2=null;var e=arguments[0],i=arguments[1];this._node1=e,this._node2=i,this.buildExtent(this._node1,this._node2)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.buildExtent=function(i,n){this._min=Math.min(i._min,n._min),this._max=Math.max(i._max,n._max)},t.prototype.query=function(i,n,s){if(!this.intersects(i,n))return null;this._node1!==null&&this._node1.query(i,n,s),this._node2!==null&&this._node2.query(i,n,s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Cn),In=function(){this._leaves=new B,this._root=null,this._level=0};In.prototype.buildTree=function(){var t=this;Mi.sort(this._leaves,new Cn.NodeComparator);for(var e=this._leaves,i=null,n=new B;;){if(t.buildLevel(e,n),n.size()===1)return n.get(0);i=e,e=n,n=i}},In.prototype.insert=function(t,e,i){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new R_(t,e,i))},In.prototype.query=function(t,e,i){this.init(),this._root.query(t,e,i)},In.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},In.prototype.printNode=function(t){Ve.out.println(Ei.toLineString(new L(t._min,this._level),new L(t._max,this._level)))},In.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},In.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var i=0;i<t.size();i+=2){var n=t.get(i),s=i+1<t.size()?t.get(i):null;if(s===null)e.add(n);else{var a=new F_(t.get(i),t.get(i+1));e.add(a)}}},In.prototype.interfaces_=function(){return[]},In.prototype.getClass=function(){return In};var pu=function(){this._items=new B};pu.prototype.visitItem=function(t){this._items.add(t)},pu.prototype.getItems=function(){return this._items},pu.prototype.interfaces_=function(){return[_s]},pu.prototype.getClass=function(){return pu};var gu=function(){this._index=null;var t=arguments[0];if(!_t(t,ys))throw new oe("Argument must be Polygonal");this._index=new la(t)},id={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};gu.prototype.locate=function(t){var e=new Ui(t),i=new mu(e);return this._index.query(t.y,t.y,i),e.getLocation()},gu.prototype.interfaces_=function(){return[cu]},gu.prototype.getClass=function(){return gu},id.SegmentVisitor.get=function(){return mu},id.IntervalIndexedGeometry.get=function(){return la},Object.defineProperties(gu,id);var mu=function(){this._counter=null;var t=arguments[0];this._counter=t};mu.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},mu.prototype.interfaces_=function(){return[_s]},mu.prototype.getClass=function(){return mu};var la=function(){this._index=new In;var t=arguments[0];this.init(t)};la.prototype.init=function(t){for(var e=this,i=We.getLines(t),n=i.iterator();n.hasNext();){var s=n.next(),a=s.getCoordinates();e.addLine(a)}},la.prototype.addLine=function(t){for(var e=this,i=1;i<t.length;i++){var n=new pt(t[i-1],t[i]),s=Math.min(n.p0.y,n.p1.y),a=Math.max(n.p0.y,n.p1.y);e._index.insert(s,a,n)}},la.prototype.query=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],i=new pu;return this._index.query(t,e,i),i.getItems()}else if(arguments.length===3){var n=arguments[0],s=arguments[1],a=arguments[2];this._index.query(n,s,a)}},la.prototype.interfaces_=function(){return[]},la.prototype.getClass=function(){return la};var gh=function(r){function t(){if(r.call(this),this._parentGeom=null,this._lineEdgeMap=new gg,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new bi,arguments.length===2){var e=arguments[0],i=arguments[1],n=jr.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=i,this._boundaryNodeRule=n,i!==null&&this.add(i)}else if(arguments.length===3){var s=arguments[0],a=arguments[1],o=arguments[2];this._argIndex=s,this._parentGeom=a,this._boundaryNodeRule=o,a!==null&&this.add(a)}}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.insertBoundaryPoint=function(i,n){var s=this._nodes.addNode(n),a=s.getLabel(),o=1,l=F.NONE;l=a.getLocation(i,K.ON),l===F.BOUNDARY&&o++;var u=t.determineBoundary(this._boundaryNodeRule,o);a.setLocation(i,u)},t.prototype.computeSelfNodes=function(){if(arguments.length===2){var i=arguments[0],n=arguments[1];return this.computeSelfNodes(i,n,!1)}else if(arguments.length===3){var s=arguments[0],a=arguments[1],o=arguments[2],l=new Ye(s,!0,!1);l.setIsDoneIfProperInt(o);var u=this.createEdgeSetIntersector(),c=this._parentGeom instanceof gn||this._parentGeom instanceof Ne||this._parentGeom instanceof mn,h=a||!c;return u.computeIntersections(this._edges,l,h),this.addSelfIntersectionNodes(this._argIndex),l}},t.prototype.computeSplitEdges=function(i){for(var n=this._edges.iterator();n.hasNext();){var s=n.next();s.eiList.addSplitEdges(i)}},t.prototype.computeEdgeIntersections=function(i,n,s){var a=new Ye(n,s,!0);a.setBoundaryNodes(this.getBoundaryNodes(),i.getBoundaryNodes());var o=this.createEdgeSetIntersector();return o.computeIntersections(this._edges,i._edges,a),a},t.prototype.getGeometry=function(){return this._parentGeom},t.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},t.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},t.prototype.addPoint=function(){if(arguments[0]instanceof Mr){var i=arguments[0],n=i.getCoordinate();this.insertPoint(this._argIndex,n,F.INTERIOR)}else if(arguments[0]instanceof L){var s=arguments[0];this.insertPoint(this._argIndex,s,F.INTERIOR)}},t.prototype.addPolygon=function(i){var n=this;this.addPolygonRing(i.getExteriorRing(),F.EXTERIOR,F.INTERIOR);for(var s=0;s<i.getNumInteriorRing();s++){var a=i.getInteriorRingN(s);n.addPolygonRing(a,F.INTERIOR,F.EXTERIOR)}},t.prototype.addEdge=function(i){this.insertEdge(i);var n=i.getCoordinates();this.insertPoint(this._argIndex,n[0],F.BOUNDARY),this.insertPoint(this._argIndex,n[n.length-1],F.BOUNDARY)},t.prototype.addLineString=function(i){var n=Dt.removeRepeatedPoints(i.getCoordinates());if(n.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=n[0],null;var s=new Ec(n,new Jt(this._argIndex,F.INTERIOR));this._lineEdgeMap.put(i,s),this.insertEdge(s),Mt.isTrue(n.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,n[0]),this.insertBoundaryPoint(this._argIndex,n[n.length-1])},t.prototype.getInvalidPoint=function(){return this._invalidPoint},t.prototype.getBoundaryPoints=function(){for(var i=this.getBoundaryNodes(),n=new Array(i.size()).fill(null),s=0,a=i.iterator();a.hasNext();){var o=a.next();n[s++]=o.getCoordinate().copy()}return n},t.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},t.prototype.addSelfIntersectionNode=function(i,n,s){if(this.isBoundaryNode(i,n))return null;s===F.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(i,n):this.insertPoint(i,n,s)},t.prototype.addPolygonRing=function(i,n,s){if(i.isEmpty())return null;var a=Dt.removeRepeatedPoints(i.getCoordinates());if(a.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=a[0],null;var o=n,l=s;et.isCCW(a)&&(o=s,l=n);var u=new Ec(a,new Jt(this._argIndex,F.BOUNDARY,o,l));this._lineEdgeMap.put(i,u),this.insertEdge(u),this.insertPoint(this._argIndex,a[0],F.BOUNDARY)},t.prototype.insertPoint=function(i,n,s){var a=this._nodes.addNode(n),o=a.getLabel();o===null?a._label=new Jt(i,s):o.setLocation(i,s)},t.prototype.createEdgeSetIntersector=function(){return new L_},t.prototype.addSelfIntersectionNodes=function(i){for(var n=this,s=this._edges.iterator();s.hasNext();)for(var a=s.next(),o=a.getLabel().getLocation(i),l=a.eiList.iterator();l.hasNext();){var u=l.next();n.addSelfIntersectionNode(i,u.coord,o)}},t.prototype.add=function(){if(arguments.length===1){var i=arguments[0];if(i.isEmpty())return null;if(i instanceof mn&&(this._useBoundaryDeterminationRule=!1),i instanceof Ne)this.addPolygon(i);else if(i instanceof pe)this.addLineString(i);else if(i instanceof Mr)this.addPoint(i);else if(i instanceof ou)this.addCollection(i);else if(i instanceof ea)this.addCollection(i);else if(i instanceof mn)this.addCollection(i);else if(i instanceof er)this.addCollection(i);else throw new Error(i.getClass().getName())}else return r.prototype.add.apply(this,arguments)},t.prototype.addCollection=function(i){for(var n=this,s=0;s<i.getNumGeometries();s++){var a=i.getGeometryN(s);n.add(a)}},t.prototype.locate=function(i){return _t(this._parentGeom,ys)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new gu(this._parentGeom)),this._areaPtLocator.locate(i)):this._ptLocator.locate(i,this._parentGeom)},t.prototype.findEdge=function(){if(arguments.length===1){var i=arguments[0];return this._lineEdgeMap.get(i)}else return r.prototype.findEdge.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.determineBoundary=function(i,n){return i.isInBoundary(n)?F.BOUNDARY:F.INTERIOR},t}(fe),vu=function(){if(this._li=new $s,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new gh(0,t)}else if(arguments.length===2){var e=arguments[0],i=arguments[1],n=jr.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(i.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(i.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new gh(0,e,n),this._arg[1]=new gh(1,i,n)}else if(arguments.length===3){var s=arguments[0],a=arguments[1],o=arguments[2];s.getPrecisionModel().compareTo(a.getPrecisionModel())>=0?this.setComputationPrecision(s.getPrecisionModel()):this.setComputationPrecision(a.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new gh(0,s,o),this._arg[1]=new gh(1,a,o)}};vu.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},vu.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},vu.prototype.interfaces_=function(){return[]},vu.prototype.getClass=function(){return vu};var ua=function(){};ua.prototype.interfaces_=function(){return[]},ua.prototype.getClass=function(){return ua},ua.map=function(){if(arguments[0]instanceof yt&&_t(arguments[1],ua.MapOp)){for(var t=arguments[0],e=arguments[1],i=new B,n=0;n<t.getNumGeometries();n++){var s=e.map(t.getGeometryN(n));s!==null&&i.add(s)}return t.getFactory().buildGeometry(i)}else if(_t(arguments[0],Me)&&_t(arguments[1],ua.MapOp)){for(var a=arguments[0],o=arguments[1],l=new B,u=a.iterator();u.hasNext();){var c=u.next(),h=o.map(c);h!==null&&l.add(h)}return l}},ua.MapOp=function(){};var Ct=function(r){function t(){var e=arguments[0],i=arguments[1];r.call(this,e,i),this._ptLocator=new bi,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Ni,this._resultPolyList=new B,this._resultLineList=new B,this._resultPointList=new B,this._graph=new fe(new Ig),this._geomFact=e.getFactory()}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.insertUniqueEdge=function(i){var n=this._edgeList.findEqualEdge(i);if(n!==null){var s=n.getLabel(),a=i.getLabel();n.isPointwiseEqual(i)||(a=new Jt(i.getLabel()),a.flip());var o=n.getDepth();o.isNull()&&o.add(s),o.add(a),s.merge(a)}else this._edgeList.add(i)},t.prototype.getGraph=function(){return this._graph},t.prototype.cancelDuplicateResultEdges=function(){for(var i=this._graph.getEdgeEnds().iterator();i.hasNext();){var n=i.next(),s=n.getSym();n.isInResult()&&s.isInResult()&&(n.setInResult(!1),s.setInResult(!1))}},t.prototype.isCoveredByLA=function(i){return!!(this.isCovered(i,this._resultLineList)||this.isCovered(i,this._resultPolyList))},t.prototype.computeGeometry=function(i,n,s,a){var o=new B;return o.addAll(i),o.addAll(n),o.addAll(s),o.isEmpty()?t.createEmptyResult(a,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(o)},t.prototype.mergeSymLabels=function(){for(var i=this._graph.getNodes().iterator();i.hasNext();){var n=i.next();n.getEdges().mergeSymLabels()}},t.prototype.isCovered=function(i,n){for(var s=this,a=n.iterator();a.hasNext();){var o=a.next(),l=s._ptLocator.locate(i,o);if(l!==F.EXTERIOR)return!0}return!1},t.prototype.replaceCollapsedEdges=function(){for(var i=new B,n=this._edgeList.iterator();n.hasNext();){var s=n.next();s.isCollapsed()&&(n.remove(),i.add(s.getCollapsedEdge()))}this._edgeList.addAll(i)},t.prototype.updateNodeLabelling=function(){for(var i=this._graph.getNodes().iterator();i.hasNext();){var n=i.next(),s=n.getEdges().getLabel();n.getLabel().merge(s)}},t.prototype.getResultGeometry=function(i){return this.computeOverlay(i),this._resultGeom},t.prototype.insertUniqueEdges=function(i){for(var n=this,s=i.iterator();s.hasNext();){var a=s.next();n.insertUniqueEdge(a)}},t.prototype.computeOverlay=function(i){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var n=new B;this._arg[0].computeSplitEdges(n),this._arg[1].computeSplitEdges(n),this.insertUniqueEdges(n),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),oa.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(i),this.cancelDuplicateResultEdges();var s=new Nr(this._geomFact);s.add(this._graph),this._resultPolyList=s.getPolygons();var a=new tn(this,this._geomFact,this._ptLocator);this._resultLineList=a.build(i);var o=new Za(this,this._geomFact,this._ptLocator);this._resultPointList=o.build(i),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,i)},t.prototype.labelIncompleteNode=function(i,n){var s=this._ptLocator.locate(i.getCoordinate(),this._arg[n].getGeometry());i.getLabel().setLocation(n,s)},t.prototype.copyPoints=function(i){for(var n=this,s=this._arg[i].getNodeIterator();s.hasNext();){var a=s.next(),o=n._graph.addNode(a.getCoordinate());o.setLabel(i,a.getLabel().getLocation(i))}},t.prototype.findResultAreaEdges=function(i){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var s=n.next(),a=s.getLabel();a.isArea()&&!s.isInteriorAreaEdge()&&t.isResultOfOp(a.getLocation(0,K.RIGHT),a.getLocation(1,K.RIGHT),i)&&s.setInResult(!0)}},t.prototype.computeLabelsFromDepths=function(){for(var i=this._edgeList.iterator();i.hasNext();){var n=i.next(),s=n.getLabel(),a=n.getDepth();if(!a.isNull()){a.normalize();for(var o=0;o<2;o++)!s.isNull(o)&&s.isArea()&&!a.isNull(o)&&(a.getDelta(o)===0?s.toLine(o):(Mt.isTrue(!a.isNull(o,K.LEFT),"depth of LEFT side has not been initialized"),s.setLocation(o,K.LEFT,a.getLocation(o,K.LEFT)),Mt.isTrue(!a.isNull(o,K.RIGHT),"depth of RIGHT side has not been initialized"),s.setLocation(o,K.RIGHT,a.getLocation(o,K.RIGHT))))}}},t.prototype.computeLabelling=function(){for(var i=this,n=this._graph.getNodes().iterator();n.hasNext();){var s=n.next();s.getEdges().computeLabelling(i._arg)}this.mergeSymLabels(),this.updateNodeLabelling()},t.prototype.labelIncompleteNodes=function(){for(var i=this,n=this._graph.getNodes().iterator();n.hasNext();){var s=n.next(),a=s.getLabel();s.isIsolated()&&(a.isNull(0)?i.labelIncompleteNode(s,0):i.labelIncompleteNode(s,1)),s.getEdges().updateLabelling(a)}},t.prototype.isCoveredByA=function(i){return!!this.isCovered(i,this._resultPolyList)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(vu);Ct.overlayOp=function(r,t,e){var i=new Ct(r,t),n=i.getResultGeometry(e);return n},Ct.intersection=function(r,t){if(r.isEmpty()||t.isEmpty())return Ct.createEmptyResult(Ct.INTERSECTION,r,t,r.getFactory());if(r.isGeometryCollection()){var e=t;return Qa.map(r,{interfaces_:function(){return[ua.MapOp]},map:function(i){return i.intersection(e)}})}return r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(t),lr.overlayOp(r,t,Ct.INTERSECTION)},Ct.symDifference=function(r,t){if(r.isEmpty()||t.isEmpty()){if(r.isEmpty()&&t.isEmpty())return Ct.createEmptyResult(Ct.SYMDIFFERENCE,r,t,r.getFactory());if(r.isEmpty())return t.copy();if(t.isEmpty())return r.copy()}return r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(t),lr.overlayOp(r,t,Ct.SYMDIFFERENCE)},Ct.resultDimension=function(r,t,e){var i=t.getDimension(),n=e.getDimension(),s=-1;switch(r){case Ct.INTERSECTION:s=Math.min(i,n);break;case Ct.UNION:s=Math.max(i,n);break;case Ct.DIFFERENCE:s=i;break;case Ct.SYMDIFFERENCE:s=Math.max(i,n);break}return s},Ct.createEmptyResult=function(r,t,e,i){var n=null;switch(Ct.resultDimension(r,t,e)){case-1:n=i.createGeometryCollection(new Array(0).fill(null));break;case 0:n=i.createPoint();break;case 1:n=i.createLineString();break;case 2:n=i.createPolygon();break}return n},Ct.difference=function(r,t){return r.isEmpty()?Ct.createEmptyResult(Ct.DIFFERENCE,r,t,r.getFactory()):t.isEmpty()?r.copy():(r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(t),lr.overlayOp(r,t,Ct.DIFFERENCE))},Ct.isResultOfOp=function(){if(arguments.length===2){var r=arguments[0],t=arguments[1],e=r.getLocation(0),i=r.getLocation(1);return Ct.isResultOfOp(e,i,t)}else if(arguments.length===3){var n=arguments[0],s=arguments[1],a=arguments[2];switch(n===F.BOUNDARY&&(n=F.INTERIOR),s===F.BOUNDARY&&(s=F.INTERIOR),a){case Ct.INTERSECTION:return n===F.INTERIOR&&s===F.INTERIOR;case Ct.UNION:return n===F.INTERIOR||s===F.INTERIOR;case Ct.DIFFERENCE:return n===F.INTERIOR&&s!==F.INTERIOR;case Ct.SYMDIFFERENCE:return n===F.INTERIOR&&s!==F.INTERIOR||n!==F.INTERIOR&&s===F.INTERIOR}return!1}},Ct.INTERSECTION=1,Ct.UNION=2,Ct.DIFFERENCE=3,Ct.SYMDIFFERENCE=4;var bs=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new bi,this._seg=new pt;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};bs.prototype.isWithinToleranceOfBoundary=function(t){for(var e=this,i=0;i<this._linework.getNumGeometries();i++)for(var n=e._linework.getGeometryN(i),s=n.getCoordinateSequence(),a=0;a<s.size()-1;a++){s.getCoordinate(a,e._seg.p0),s.getCoordinate(a+1,e._seg.p1);var o=e._seg.distance(t);if(o<=e._boundaryDistanceTolerance)return!0}return!1},bs.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?F.BOUNDARY:this._ptLocator.locate(t,this._g)},bs.prototype.extractLinework=function(t){var e=new yu;t.apply(e);var i=e.getLinework(),n=xt.toLineStringArray(i);return t.getFactory().createMultiLineString(n)},bs.prototype.interfaces_=function(){return[]},bs.prototype.getClass=function(){return bs};var yu=function(){this._linework=null,this._linework=new B};yu.prototype.getLinework=function(){return this._linework},yu.prototype.filter=function(t){var e=this;if(t instanceof Ne){var i=t;this._linework.add(i.getExteriorRing());for(var n=0;n<i.getNumInteriorRing();n++)e._linework.add(i.getInteriorRingN(n))}},yu.prototype.interfaces_=function(){return[Wi]},yu.prototype.getClass=function(){return yu};var ha=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};ha.prototype.extractPoints=function(t,e,i){for(var n=this,s=t.getCoordinates(),a=0;a<s.length-1;a++)n.computeOffsetPoints(s[a],s[a+1],e,i)},ha.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},ha.prototype.getPoints=function(t){for(var e=this,i=new B,n=We.getLines(this._g),s=n.iterator();s.hasNext();){var a=s.next();e.extractPoints(a,t,i)}return i},ha.prototype.computeOffsetPoints=function(t,e,i,n){var s=e.x-t.x,a=e.y-t.y,o=Math.sqrt(s*s+a*a),l=i*s/o,u=i*a/o,c=(e.x+t.x)/2,h=(e.y+t.y)/2;if(this._doLeft){var f=new L(c-u,h+l);n.add(f)}if(this._doRight){var g=new L(c+u,h-l);n.add(g)}},ha.prototype.interfaces_=function(){return[]},ha.prototype.getClass=function(){return ha};var qr=function r(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=r.TOLERANCE,this._testCoords=new B;var t=arguments[0],e=arguments[1],i=arguments[2];this._boundaryDistanceTolerance=r.computeBoundaryDistanceTolerance(t,e),this._geom=[t,e,i],this._locFinder=[new bs(this._geom[0],this._boundaryDistanceTolerance),new bs(this._geom[1],this._boundaryDistanceTolerance),new bs(this._geom[2],this._boundaryDistanceTolerance)]},Rg={TOLERANCE:{configurable:!0}};qr.prototype.reportResult=function(t,e,i){Ve.out.println("Overlay result invalid - A:"+F.toLocationSymbol(e[0])+" B:"+F.toLocationSymbol(e[1])+" expected:"+(i?"i":"e")+" actual:"+F.toLocationSymbol(e[2]))},qr.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e},qr.prototype.checkValid=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],i=0;i<this._testCoords.size();i++){var n=t._testCoords.get(i);if(!t.checkValid(e,n))return t._invalidLocation=n,!1}return!0}else if(arguments.length===2){var s=arguments[0],a=arguments[1];return this._location[0]=this._locFinder[0].getLocation(a),this._location[1]=this._locFinder[1].getLocation(a),this._location[2]=this._locFinder[2].getLocation(a),qr.hasLocation(this._location,F.BOUNDARY)?!0:this.isValidResult(s,this._location)}},qr.prototype.addTestPts=function(t){var e=new ha(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},qr.prototype.isValidResult=function(t,e){var i=Ct.isResultOfOp(e[0],e[1],t),n=e[2]===F.INTERIOR,s=!(i^n);return s||this.reportResult(t,e,i),s},qr.prototype.getInvalidLocation=function(){return this._invalidLocation},qr.prototype.interfaces_=function(){return[]},qr.prototype.getClass=function(){return qr},qr.hasLocation=function(t,e){for(var i=0;i<3;i++)if(t[i]===e)return!0;return!1},qr.computeBoundaryDistanceTolerance=function(t,e){return Math.min(we.computeSizeBasedSnapTolerance(t),we.computeSizeBasedSnapTolerance(e))},qr.isValid=function(t,e,i,n){var s=new qr(t,e,n);return s.isValid(i)},Rg.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(qr,Rg);var Wr=function r(t){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=r.extractFactory(t),this._inputGeoms=t};Wr.prototype.extractElements=function(t,e){var i=this;if(t===null)return null;for(var n=0;n<t.getNumGeometries();n++){var s=t.getGeometryN(n);i._skipEmpty&&s.isEmpty()||e.add(s)}},Wr.prototype.combine=function(){for(var t=this,e=new B,i=this._inputGeoms.iterator();i.hasNext();){var n=i.next();t.extractElements(n,e)}return e.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(e)},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr},Wr.combine=function(){if(arguments.length===1){var t=arguments[0],e=new Wr(t);return e.combine()}else if(arguments.length===2){var i=arguments[0],n=arguments[1],s=new Wr(Wr.createList(i,n));return s.combine()}else if(arguments.length===3){var a=arguments[0],o=arguments[1],l=arguments[2],u=new Wr(Wr.createList(a,o,l));return u.combine()}},Wr.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},Wr.createList=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],i=new B;return i.add(t),i.add(e),i}else if(arguments.length===3){var n=arguments[0],s=arguments[1],a=arguments[2],o=new B;return o.add(n),o.add(s),o.add(a),o}};var Ce=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,this._inputPolys===null&&(this._inputPolys=new B)},Fg={STRTREE_NODE_CAPACITY:{configurable:!0}};Ce.prototype.reduceToGeometries=function(t){for(var e=this,i=new B,n=t.iterator();n.hasNext();){var s=n.next(),a=null;_t(s,Si)?a=e.unionTree(s):s instanceof yt&&(a=s),i.add(a)}return i},Ce.prototype.extractByEnvelope=function(t,e,i){for(var n=new B,s=0;s<e.getNumGeometries();s++){var a=e.getGeometryN(s);a.getEnvelopeInternal().intersects(t)?n.add(a):i.add(a)}return this._geomFactory.buildGeometry(n)},Ce.prototype.unionOptimized=function(t,e){var i=t.getEnvelopeInternal(),n=e.getEnvelopeInternal();if(!i.intersects(n)){var s=Wr.combine(t,e);return s}if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var a=i.intersection(n);return this.unionUsingEnvelopeIntersection(t,e,a)},Ce.prototype.union=function(){if(this._inputPolys===null)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var t=new _g(Ce.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var i=e.next();t.insert(i.getEnvelopeInternal(),i)}this._inputPolys=null;var n=t.itemsTree(),s=this.unionTree(n);return s},Ce.prototype.binaryUnion=function(){if(arguments.length===1){var t=arguments[0];return this.binaryUnion(t,0,t.size())}else if(arguments.length===3){var e=arguments[0],i=arguments[1],n=arguments[2];if(n-i<=1){var s=Ce.getGeometry(e,i);return this.unionSafe(s,null)}else{if(n-i===2)return this.unionSafe(Ce.getGeometry(e,i),Ce.getGeometry(e,i+1));var a=Math.trunc((n+i)/2),o=this.binaryUnion(e,i,a),l=this.binaryUnion(e,a,n);return this.unionSafe(o,l)}}},Ce.prototype.repeatedUnion=function(t){for(var e=null,i=t.iterator();i.hasNext();){var n=i.next();e===null?e=n.copy():e=e.union(n)}return e},Ce.prototype.unionSafe=function(t,e){return t===null&&e===null?null:t===null?e.copy():e===null?t.copy():this.unionOptimized(t,e)},Ce.prototype.unionActual=function(t,e){return Ce.restrictToPolygons(t.union(e))},Ce.prototype.unionTree=function(t){var e=this.reduceToGeometries(t),i=this.binaryUnion(e);return i},Ce.prototype.unionUsingEnvelopeIntersection=function(t,e,i){var n=new B,s=this.extractByEnvelope(i,t,n),a=this.extractByEnvelope(i,e,n),o=this.unionActual(s,a);n.add(o);var l=Wr.combine(n);return l},Ce.prototype.bufferUnion=function(){if(arguments.length===1){var t=arguments[0],e=t.get(0).getFactory(),i=e.buildGeometry(t),n=i.buffer(0);return n}else if(arguments.length===2){var s=arguments[0],a=arguments[1],o=s.getFactory(),l=o.createGeometryCollection([s,a]),u=l.buffer(0);return u}},Ce.prototype.interfaces_=function(){return[]},Ce.prototype.getClass=function(){return Ce},Ce.restrictToPolygons=function(t){if(_t(t,ys))return t;var e=Qn.getPolygons(t);return e.size()===1?e.get(0):t.getFactory().createMultiPolygon(xt.toPolygonArray(e))},Ce.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Ce.union=function(t){var e=new Ce(t);return e.union()},Fg.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Ce,Fg);var Pc=function(){};Pc.prototype.interfaces_=function(){return[]},Pc.prototype.getClass=function(){return Pc},Pc.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Ct.createEmptyResult(Ct.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),lr.overlayOp(t,e,Ct.UNION)};function ca(){return new Cc}function Cc(){this.reset()}Cc.prototype={constructor:Cc,reset:function(){this.s=this.t=0},add:function(r){Gg(Ic,r,this.t),Gg(this,Ic.s,this.s),this.s?this.t+=Ic.t:this.s=Ic.t},valueOf:function(){return this.s}};var Ic=new Cc;function Gg(r,t,e){var i=r.s=t+e,n=i-t,s=i-n;r.t=t-s+(e-n)}var Ie=1e-6,Zt=Math.PI,Zn=Zt/2,kg=Zt/4,Bn=Zt*2,fa=180/Zt,en=Zt/180,ur=Math.abs,G_=Math.atan,_u=Math.atan2,Te=Math.cos,De=Math.sin,wu=Math.sqrt;function zg(r){return r>1?0:r<-1?Zt:Math.acos(r)}function $a(r){return r>1?Zn:r<-1?-Zn:Math.asin(r)}function mh(){}function Mc(r,t){r&&Ug.hasOwnProperty(r.type)&&Ug[r.type](r,t)}var Vg={Feature:function(r,t){Mc(r.geometry,t)},FeatureCollection:function(r,t){for(var e=r.features,i=-1,n=e.length;++i<n;)Mc(e[i].geometry,t)}},Ug={Sphere:function(r,t){t.sphere()},Point:function(r,t){r=r.coordinates,t.point(r[0],r[1],r[2])},MultiPoint:function(r,t){for(var e=r.coordinates,i=-1,n=e.length;++i<n;)r=e[i],t.point(r[0],r[1],r[2])},LineString:function(r,t){nd(r.coordinates,t,0)},MultiLineString:function(r,t){for(var e=r.coordinates,i=-1,n=e.length;++i<n;)nd(e[i],t,0)},Polygon:function(r,t){qg(r.coordinates,t)},MultiPolygon:function(r,t){for(var e=r.coordinates,i=-1,n=e.length;++i<n;)qg(e[i],t)},GeometryCollection:function(r,t){for(var e=r.geometries,i=-1,n=e.length;++i<n;)Mc(e[i],t)}};function nd(r,t,e){var i=-1,n=r.length-e,s;for(t.lineStart();++i<n;)s=r[i],t.point(s[0],s[1],s[2]);t.lineEnd()}function qg(r,t){var e=-1,i=r.length;for(t.polygonStart();++e<i;)nd(r[e],t,1);t.polygonEnd()}function k_(r,t){r&&Vg.hasOwnProperty(r.type)?Vg[r.type](r,t):Mc(r,t)}ca(),ca();function sd(r){return[_u(r[1],r[0]),$a(r[2])]}function Eu(r){var t=r[0],e=r[1],i=Te(e);return[i*Te(t),i*De(t),De(e)]}function Nc(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]}function bc(r,t){return[r[1]*t[2]-r[2]*t[1],r[2]*t[0]-r[0]*t[2],r[0]*t[1]-r[1]*t[0]]}function ad(r,t){r[0]+=t[0],r[1]+=t[1],r[2]+=t[2]}function Tc(r,t){return[r[0]*t,r[1]*t,r[2]*t]}function od(r){var t=wu(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]);r[0]/=t,r[1]/=t,r[2]/=t}ca();function Wg(r,t){function e(i,n){return i=r(i,n),t(i[0],i[1])}return r.invert&&t.invert&&(e.invert=function(i,n){return i=t.invert(i,n),i&&r.invert(i[0],i[1])}),e}function ld(r,t){return[r>Zt?r-Bn:r<-Zt?r+Bn:r,t]}ld.invert=ld;function z_(r,t,e){return(r%=Bn)?t||e?Wg(Xg(r),Yg(t,e)):Xg(r):t||e?Yg(t,e):ld}function Hg(r){return function(t,e){return t+=r,[t>Zt?t-Bn:t<-Zt?t+Bn:t,e]}}function Xg(r){var t=Hg(r);return t.invert=Hg(-r),t}function Yg(r,t){var e=Te(r),i=De(r),n=Te(t),s=De(t);function a(o,l){var u=Te(l),c=Te(o)*u,h=De(o)*u,f=De(l),g=f*e+c*i;return[_u(h*n-g*s,c*e-f*i),$a(g*n+h*s)]}return a.invert=function(o,l){var u=Te(l),c=Te(o)*u,h=De(o)*u,f=De(l),g=f*n-h*s;return[_u(h*n+f*s,c*e+g*i),$a(g*e-c*i)]},a}function V_(r,t,e,i,n,s){if(e){var a=Te(t),o=De(t),l=i*e;n==null?(n=t+i*Bn,s=t-l/2):(n=Jg(a,n),s=Jg(a,s),(i>0?n<s:n>s)&&(n+=i*Bn));for(var u,c=n;i>0?c>s:c<s;c-=l)u=sd([a,-o*Te(c),-o*De(c)]),r.point(u[0],u[1])}}function Jg(r,t){t=Eu(t),t[0]-=r,od(t);var e=zg(-t[1]);return((-t[2]<0?-e:e)+Bn-Ie)%Bn}function Kg(){var r=[],t;return{point:function(e,i){t.push([e,i])},lineStart:function(){r.push(t=[])},lineEnd:mh,rejoin:function(){r.length>1&&r.push(r.pop().concat(r.shift()))},result:function(){var e=r;return r=[],t=null,e}}}function U_(r,t,e,i,n,s){var a=r[0],o=r[1],l=t[0],u=t[1],c=0,h=1,f=l-a,g=u-o,m;if(m=e-a,!(!f&&m>0)){if(m/=f,f<0){if(m<c)return;m<h&&(h=m)}else if(f>0){if(m>h)return;m>c&&(c=m)}if(m=n-a,!(!f&&m<0)){if(m/=f,f<0){if(m>h)return;m>c&&(c=m)}else if(f>0){if(m<c)return;m<h&&(h=m)}if(m=i-o,!(!g&&m>0)){if(m/=g,g<0){if(m<c)return;m<h&&(h=m)}else if(g>0){if(m>h)return;m>c&&(c=m)}if(m=s-o,!(!g&&m<0)){if(m/=g,g<0){if(m>h)return;m>c&&(c=m)}else if(g>0){if(m<c)return;m<h&&(h=m)}return c>0&&(r[0]=a+c*f,r[1]=o+c*g),h<1&&(t[0]=a+h*f,t[1]=o+h*g),!0}}}}}function Dc(r,t){return ur(r[0]-t[0])<Ie&&ur(r[1]-t[1])<Ie}function xc(r,t,e,i){this.x=r,this.z=t,this.o=e,this.e=i,this.v=!1,this.n=this.p=null}function Qg(r,t,e,i,n){var s=[],a=[],o,l;if(r.forEach(function(m){if(!((_=m.length-1)<=0)){var _,E=m[0],M=m[_],y;if(Dc(E,M)){for(n.lineStart(),o=0;o<_;++o)n.point((E=m[o])[0],E[1]);n.lineEnd();return}s.push(y=new xc(E,m,null,!0)),a.push(y.o=new xc(E,null,y,!1)),s.push(y=new xc(M,m,null,!1)),a.push(y.o=new xc(M,null,y,!0))}}),!!s.length){for(a.sort(t),Zg(s),Zg(a),o=0,l=a.length;o<l;++o)a[o].e=e=!e;for(var u=s[0],c,h;;){for(var f=u,g=!0;f.v;)if((f=f.n)===u)return;c=f.z,n.lineStart();do{if(f.v=f.o.v=!0,f.e){if(g)for(o=0,l=c.length;o<l;++o)n.point((h=c[o])[0],h[1]);else i(f.x,f.n.x,1,n);f=f.n}else{if(g)for(c=f.p.z,o=c.length-1;o>=0;--o)n.point((h=c[o])[0],h[1]);else i(f.x,f.p.x,-1,n);f=f.p}f=f.o,c=f.z,g=!g}while(!f.v);n.lineEnd()}}}function Zg(r){if(t=r.length){for(var t,e=0,i=r[0],n;++e<t;)i.n=n=r[e],n.p=i,i=n;i.n=n=r[0],n.p=i}}function Bg(r,t){return r<t?-1:r>t?1:r>=t?0:NaN}function q_(r){return r.length===1&&(r=W_(r)),{left:function(t,e,i,n){for(i==null&&(i=0),n==null&&(n=t.length);i<n;){var s=i+n>>>1;r(t[s],e)<0?i=s+1:n=s}return i},right:function(t,e,i,n){for(i==null&&(i=0),n==null&&(n=t.length);i<n;){var s=i+n>>>1;r(t[s],e)>0?n=s:i=s+1}return i}}}function W_(r){return function(t,e){return Bg(r(t),e)}}q_(Bg);function $g(r){for(var t=r.length,e,i=-1,n=0,s,a;++i<t;)n+=r[i].length;for(s=new Array(n);--t>=0;)for(a=r[t],e=a.length;--e>=0;)s[--n]=a[e];return s}var Oc=1e9,Ac=-1e9;function H_(r,t,e,i){function n(u,c){return r<=u&&u<=e&&t<=c&&c<=i}function s(u,c,h,f){var g=0,m=0;if(u==null||(g=a(u,h))!==(m=a(c,h))||l(u,c)<0^h>0)do f.point(g===0||g===3?r:e,g>1?i:t);while((g=(g+h+4)%4)!==m);else f.point(c[0],c[1])}function a(u,c){return ur(u[0]-r)<Ie?c>0?0:3:ur(u[0]-e)<Ie?c>0?2:1:ur(u[1]-t)<Ie?c>0?1:0:c>0?3:2}function o(u,c){return l(u.x,c.x)}function l(u,c){var h=a(u,1),f=a(c,1);return h!==f?h-f:h===0?c[1]-u[1]:h===1?u[0]-c[0]:h===2?u[1]-c[1]:c[0]-u[0]}return function(u){var c=u,h=Kg(),f,g,m,_,E,M,y,w,v,S,P,I={point:b,lineStart:x,lineEnd:R,polygonStart:O,polygonEnd:T};function b(rt,Z){n(rt,Z)&&c.point(rt,Z)}function D(){for(var rt=0,Z=0,ct=g.length;Z<ct;++Z)for(var G=g[Z],X=1,k=G.length,V=G[0],A,W,J=V[0],ot=V[1];X<k;++X)A=J,W=ot,V=G[X],J=V[0],ot=V[1],W<=i?ot>i&&(J-A)*(i-W)>(ot-W)*(r-A)&&++rt:ot<=i&&(J-A)*(i-W)<(ot-W)*(r-A)&&--rt;return rt}function O(){c=h,f=[],g=[],P=!0}function T(){var rt=D(),Z=P&&rt,ct=(f=$g(f)).length;(Z||ct)&&(u.polygonStart(),Z&&(u.lineStart(),s(null,null,1,u),u.lineEnd()),ct&&Qg(f,o,rt,s,u),u.polygonEnd()),c=u,f=g=m=null}function x(){I.point=z,g&&g.push(m=[]),S=!0,v=!1,y=w=NaN}function R(){f&&(z(_,E),M&&v&&h.rejoin(),f.push(h.result())),I.point=b,v&&c.lineEnd()}function z(rt,Z){var ct=n(rt,Z);if(g&&m.push([rt,Z]),S)_=rt,E=Z,M=ct,S=!1,ct&&(c.lineStart(),c.point(rt,Z));else if(ct&&v)c.point(rt,Z);else{var G=[y=Math.max(Ac,Math.min(Oc,y)),w=Math.max(Ac,Math.min(Oc,w))],X=[rt=Math.max(Ac,Math.min(Oc,rt)),Z=Math.max(Ac,Math.min(Oc,Z))];U_(G,X,r,t,e,i)?(v||(c.lineStart(),c.point(G[0],G[1])),c.point(X[0],X[1]),ct||c.lineEnd(),P=!1):ct&&(c.lineStart(),c.point(rt,Z),P=!1)}y=rt,w=Z,v=ct}return I}}var ud=ca();function X_(r,t){var e=t[0],i=t[1],n=[De(e),-Te(e),0],s=0,a=0;ud.reset();for(var o=0,l=r.length;o<l;++o)if(c=(u=r[o]).length)for(var u,c,h=u[c-1],f=h[0],g=h[1]/2+kg,m=De(g),_=Te(g),E=0;E<c;++E,f=y,m=v,_=S,h=M){var M=u[E],y=M[0],w=M[1]/2+kg,v=De(w),S=Te(w),P=y-f,I=P>=0?1:-1,b=I*P,D=b>Zt,O=m*v;if(ud.add(_u(O*I*De(b),_*S+O*Te(b))),s+=D?P+I*Bn:P,D^f>=e^y>=e){var T=bc(Eu(h),Eu(M));od(T);var x=bc(n,T);od(x);var R=(D^P>=0?-1:1)*$a(x[2]);(i>R||i===R&&(T[0]||T[1]))&&(a+=D^P>=0?1:-1)}}return(s<-1e-6||s<Ie&&ud<-1e-6)^a&1}ca();function jg(r){return r}ca(),ca();var Su=1/0,Lc=Su,vh=-Su,Rc=vh,tm={point:Y_,lineStart:mh,lineEnd:mh,polygonStart:mh,polygonEnd:mh,result:function(){var r=[[Su,Lc],[vh,Rc]];return vh=Rc=-(Lc=Su=1/0),r}};function Y_(r,t){r<Su&&(Su=r),r>vh&&(vh=r),t<Lc&&(Lc=t),t>Rc&&(Rc=t)}ca();function em(r,t,e,i){return function(n,s){var a=t(s),o=n.invert(i[0],i[1]),l=Kg(),u=t(l),c=!1,h,f,g,m={point:_,lineStart:M,lineEnd:y,polygonStart:function(){m.point=w,m.lineStart=v,m.lineEnd=S,f=[],h=[]},polygonEnd:function(){m.point=_,m.lineStart=M,m.lineEnd=y,f=$g(f);var P=X_(h,o);f.length?(c||(s.polygonStart(),c=!0),Qg(f,K_,P,e,s)):P&&(c||(s.polygonStart(),c=!0),s.lineStart(),e(null,null,1,s),s.lineEnd()),c&&(s.polygonEnd(),c=!1),f=h=null},sphere:function(){s.polygonStart(),s.lineStart(),e(null,null,1,s),s.lineEnd(),s.polygonEnd()}};function _(P,I){var b=n(P,I);r(P=b[0],I=b[1])&&s.point(P,I)}function E(P,I){var b=n(P,I);a.point(b[0],b[1])}function M(){m.point=E,a.lineStart()}function y(){m.point=_,a.lineEnd()}function w(P,I){g.push([P,I]);var b=n(P,I);u.point(b[0],b[1])}function v(){u.lineStart(),g=[]}function S(){w(g[0][0],g[0][1]),u.lineEnd();var P=u.clean(),I=l.result(),b,D=I.length,O,T,x;if(g.pop(),h.push(g),g=null,!!D){if(P&1){if(T=I[0],(O=T.length-1)>0){for(c||(s.polygonStart(),c=!0),s.lineStart(),b=0;b<O;++b)s.point((x=T[b])[0],x[1]);s.lineEnd()}return}D>1&&P&2&&I.push(I.pop().concat(I.shift())),f.push(I.filter(J_))}}return m}}function J_(r){return r.length>1}function K_(r,t){return((r=r.x)[0]<0?r[1]-Zn-Ie:Zn-r[1])-((t=t.x)[0]<0?t[1]-Zn-Ie:Zn-t[1])}const rm=em(function(){return!0},Q_,B_,[-Zt,-Zn]);function Q_(r){var t=NaN,e=NaN,i=NaN,n;return{lineStart:function(){r.lineStart(),n=1},point:function(s,a){var o=s>0?Zt:-Zt,l=ur(s-t);ur(l-Zt)<Ie?(r.point(t,e=(e+a)/2>0?Zn:-Zn),r.point(i,e),r.lineEnd(),r.lineStart(),r.point(o,e),r.point(s,e),n=0):i!==o&&l>=Zt&&(ur(t-i)<Ie&&(t-=i*Ie),ur(s-o)<Ie&&(s-=o*Ie),e=Z_(t,e,s,a),r.point(i,e),r.lineEnd(),r.lineStart(),r.point(o,e),n=0),r.point(t=s,e=a),i=o},lineEnd:function(){r.lineEnd(),t=e=NaN},clean:function(){return 2-n}}}function Z_(r,t,e,i){var n,s,a=De(r-e);return ur(a)>Ie?G_((De(t)*(s=Te(i))*De(e)-De(i)*(n=Te(t))*De(r))/(n*s*a)):(t+i)/2}function B_(r,t,e,i){var n;if(r==null)n=e*Zn,i.point(-Zt,n),i.point(0,n),i.point(Zt,n),i.point(Zt,0),i.point(Zt,-n),i.point(0,-n),i.point(-Zt,-n),i.point(-Zt,0),i.point(-Zt,n);else if(ur(r[0]-t[0])>Ie){var s=r[0]<t[0]?Zt:-Zt;n=e*s/2,i.point(-s,n),i.point(0,n),i.point(s,n)}else i.point(t[0],t[1])}function $_(r,t){var e=Te(r),i=e>0,n=ur(e)>Ie;function s(c,h,f,g){V_(g,r,t,f,c,h)}function a(c,h){return Te(c)*Te(h)>e}function o(c){var h,f,g,m,_;return{lineStart:function(){m=g=!1,_=1},point:function(E,M){var y=[E,M],w,v=a(E,M),S=i?v?0:u(E,M):v?u(E+(E<0?Zt:-Zt),M):0;if(!h&&(m=g=v)&&c.lineStart(),v!==g&&(w=l(h,y),(!w||Dc(h,w)||Dc(y,w))&&(y[0]+=Ie,y[1]+=Ie,v=a(y[0],y[1]))),v!==g)_=0,v?(c.lineStart(),w=l(y,h),c.point(w[0],w[1])):(w=l(h,y),c.point(w[0],w[1]),c.lineEnd()),h=w;else if(n&&h&&i^v){var P;!(S&f)&&(P=l(y,h,!0))&&(_=0,i?(c.lineStart(),c.point(P[0][0],P[0][1]),c.point(P[1][0],P[1][1]),c.lineEnd()):(c.point(P[1][0],P[1][1]),c.lineEnd(),c.lineStart(),c.point(P[0][0],P[0][1])))}v&&(!h||!Dc(h,y))&&c.point(y[0],y[1]),h=y,g=v,f=S},lineEnd:function(){g&&c.lineEnd(),h=null},clean:function(){return _|(m&&g)<<1}}}function l(c,h,f){var g=Eu(c),m=Eu(h),_=[1,0,0],E=bc(g,m),M=Nc(E,E),y=E[0],w=M-y*y;if(!w)return!f&&c;var v=e*M/w,S=-e*y/w,P=bc(_,E),I=Tc(_,v),b=Tc(E,S);ad(I,b);var D=P,O=Nc(I,D),T=Nc(D,D),x=O*O-T*(Nc(I,I)-1);if(!(x<0)){var R=wu(x),z=Tc(D,(-O-R)/T);if(ad(z,I),z=sd(z),!f)return z;var rt=c[0],Z=h[0],ct=c[1],G=h[1],X;Z<rt&&(X=rt,rt=Z,Z=X);var k=Z-rt,V=ur(k-Zt)<Ie,A=V||k<Ie;if(!V&&G<ct&&(X=ct,ct=G,G=X),A?V?ct+G>0^z[1]<(ur(z[0]-rt)<Ie?ct:G):ct<=z[1]&&z[1]<=G:k>Zt^(rt<=z[0]&&z[0]<=Z)){var W=Tc(D,(-O+R)/T);return ad(W,I),[z,sd(W)]}}}function u(c,h){var f=i?r:Zt-r,g=0;return c<-f?g|=1:c>f&&(g|=2),h<-f?g|=4:h>f&&(g|=8),g}return em(a,o,s,i?[0,-r]:[-Zt,r-Zt])}function im(r){return function(t){var e=new hd;for(var i in r)e[i]=r[i];return e.stream=t,e}}function hd(){}hd.prototype={constructor:hd,point:function(r,t){this.stream.point(r,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function nm(r,t,e){var i=t[1][0]-t[0][0],n=t[1][1]-t[0][1],s=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),s!=null&&r.clipExtent(null),k_(e,r.stream(tm));var a=tm.result(),o=Math.min(i/(a[1][0]-a[0][0]),n/(a[1][1]-a[0][1])),l=+t[0][0]+(i-o*(a[1][0]+a[0][0]))/2,u=+t[0][1]+(n-o*(a[1][1]+a[0][1]))/2;return s!=null&&r.clipExtent(s),r.scale(o*150).translate([l,u])}function j_(r,t,e){return nm(r,[[0,0],t],e)}var sm=16,t1=Te(30*en);function am(r,t){return+t?r1(r,t):e1(r)}function e1(r){return im({point:function(t,e){t=r(t,e),this.stream.point(t[0],t[1])}})}function r1(r,t){function e(i,n,s,a,o,l,u,c,h,f,g,m,_,E){var M=u-i,y=c-n,w=M*M+y*y;if(w>4*t&&_--){var v=a+f,S=o+g,P=l+m,I=wu(v*v+S*S+P*P),b=$a(P/=I),D=ur(ur(P)-1)<Ie||ur(s-h)<Ie?(s+h)/2:_u(S,v),O=r(D,b),T=O[0],x=O[1],R=T-i,z=x-n,rt=y*R-M*z;(rt*rt/w>t||ur((M*R+y*z)/w-.5)>.3||a*f+o*g+l*m<t1)&&(e(i,n,s,a,o,l,T,x,D,v/=I,S/=I,P,_,E),E.point(T,x),e(T,x,D,v,S,P,u,c,h,f,g,m,_,E))}}return function(i){var n,s,a,o,l,u,c,h,f,g,m,_,E={point:M,lineStart:y,lineEnd:v,polygonStart:function(){i.polygonStart(),E.lineStart=S},polygonEnd:function(){i.polygonEnd(),E.lineStart=y}};function M(b,D){b=r(b,D),i.point(b[0],b[1])}function y(){h=NaN,E.point=w,i.lineStart()}function w(b,D){var O=Eu([b,D]),T=r(b,D);e(h,f,c,g,m,_,h=T[0],f=T[1],c=b,g=O[0],m=O[1],_=O[2],sm,i),i.point(h,f)}function v(){E.point=M,i.lineEnd()}function S(){y(),E.point=P,E.lineEnd=I}function P(b,D){w(n=b,D),s=h,a=f,o=g,l=m,u=_,E.point=w}function I(){e(h,f,c,g,m,_,s,a,n,o,l,u,sm,i),E.lineEnd=v,v()}return E}}var i1=im({point:function(r,t){this.stream.point(r*en,t*en)}});function n1(r){return s1(function(){return r})()}function s1(r){var t,e=150,i=480,n=250,s,a,o=0,l=0,u=0,c=0,h=0,f,g,m=null,_=rm,E=null,M,y,w,v=jg,S=.5,P=am(T,S),I,b;function D(z){return z=g(z[0]*en,z[1]*en),[z[0]*e+s,a-z[1]*e]}function O(z){return z=g.invert((z[0]-s)/e,(a-z[1])/e),z&&[z[0]*fa,z[1]*fa]}function T(z,rt){return z=t(z,rt),[z[0]*e+s,a-z[1]*e]}D.stream=function(z){return I&&b===z?I:I=i1(_(f,P(v(b=z))))},D.clipAngle=function(z){return arguments.length?(_=+z?$_(m=z*en,6*en):(m=null,rm),R()):m*fa},D.clipExtent=function(z){return arguments.length?(v=z==null?(E=M=y=w=null,jg):H_(E=+z[0][0],M=+z[0][1],y=+z[1][0],w=+z[1][1]),R()):E==null?null:[[E,M],[y,w]]},D.scale=function(z){return arguments.length?(e=+z,x()):e},D.translate=function(z){return arguments.length?(i=+z[0],n=+z[1],x()):[i,n]},D.center=function(z){return arguments.length?(o=z[0]%360*en,l=z[1]%360*en,x()):[o*fa,l*fa]},D.rotate=function(z){return arguments.length?(u=z[0]%360*en,c=z[1]%360*en,h=z.length>2?z[2]%360*en:0,x()):[u*fa,c*fa,h*fa]},D.precision=function(z){return arguments.length?(P=am(T,S=z*z),R()):wu(S)},D.fitExtent=function(z,rt){return nm(D,z,rt)},D.fitSize=function(z,rt){return j_(D,z,rt)};function x(){g=Wg(f=z_(u,c,h),t);var z=t(o,l);return s=i-z[0]*e,a=n+z[1]*e,R()}function R(){return I=b=null,D}return function(){return t=r.apply(this,arguments),D.invert=t.invert&&O,x()}}function om(r){return function(t,e){var i=Te(t),n=Te(e),s=r(i*n);return[s*n*De(t),s*De(e)]}}function lm(r){return function(t,e){var i=wu(t*t+e*e),n=r(i),s=De(n),a=Te(n);return[_u(t*s,i*a),$a(i&&e*s/i)]}}var a1=om(function(r){return wu(2/(1+r))});a1.invert=lm(function(r){return 2*$a(r/2)});var um=om(function(r){return(r=zg(r))&&r/De(r)});um.invert=lm(function(r){return r});function o1(){return n1(um).scale(79.4188).clipAngle(179.999)}function hm(r,t){return[r,t]}hm.invert=hm;function l1(r,t,e){e=e||{};var i=e.units||"kilometers",n=e.steps||8;if(!r)throw new Error("geojson is required");if(typeof e!="object")throw new Error("options must be an object");if(typeof n!="number")throw new Error("steps must be an number");if(t===void 0)throw new Error("radius is required");if(n<=0)throw new Error("steps must be greater than 0");var s=[];switch(r.type){case"GeometryCollection":return jh(r,function(a){var o=Fc(a,t,i,n);o&&s.push(o)}),Yl(s);case"FeatureCollection":return $h(r,function(a){var o=Fc(a,t,i,n);o&&$h(o,function(l){l&&s.push(l)})}),Yl(s)}return Fc(r,t,i,n)}function Fc(r,t,e,i){var n=r.properties||{},s=r.type==="Feature"?r.geometry:r;if(s.type==="GeometryCollection"){var a=[];return jh(r,function(_){var E=Fc(_,t,e,i);E&&a.push(E)}),Yl(a)}var o=u1(s),l={type:s.type,coordinates:fm(s.coordinates,o)},u=new Kf,c=u.read(l),h=Ef(Sf(t,e),"meters"),f=qe.bufferOp(c,h,i),g=new vg;if(f=g.write(f),!cm(f.coordinates)){var m={type:f.type,coordinates:dm(f.coordinates,o)};return un(m,n)}}function cm(r){return Array.isArray(r[0])?cm(r[0]):isNaN(r[0])}function fm(r,t){return typeof r[0]!="object"?t(r):r.map(function(e){return fm(e,t)})}function dm(r,t){return typeof r[0]!="object"?t.invert(r):r.map(function(e){return dm(e,t)})}function u1(r){var t=fy(r).geometry.coordinates,e=[-t[0],-t[1]];return o1().rotate(e).scale(hr)}function h1(r,t,e){e===void 0&&(e={});var i=yi(r),n=yi(t),s=zf.union(i.coordinates,n.coordinates);return s.length===0?null:s.length===1?Pr(s[0],e.properties):wf(s,e.properties)}function c1(r,t,e){e===void 0&&(e={});var i=yi(r),n=yi(t),s=zf.intersection(i.coordinates,n.coordinates);return s.length===0?null:s.length===1?Pr(s[0],e.properties):wf(s,e.properties)}function f1(r,t){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1])&&r.push(r[0]);const e=ae(t),i=Pr([r]);return Fi(e,i)}function d1(r,t){const e=hn(r);return My(e,t,{units:"meters"}).geometry.coordinates}function cd(r){if((r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]),r.length<=3)return 0;const t=Pr([r]);return Cy(t)}function p1(r){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]);const t=Pr([r]),i=Np(t).geometry.coordinates;return[i[0],i[1],i[2]??r[0][2]??0]}function g1(r,t,e,i){const[n,s,a]=r,o=Kl(ae([n,s]),t,e,{units:"meters"});if(!(!o||!o.geometry||!o.geometry.coordinates))return i=i||[0,0,0],i[0]=o.geometry.coordinates[0],i[1]=o.geometry.coordinates[1],i[2]=a,i}function fd(r,t){return ps(ae(r),ae(t),{units:"meters"})}function Gc(r,t){return Xu(ae(r),ae(t))}function m1(r,t){return Rp(hn(r),hn(t))}function v1(r,t){const e=ae(r),i=ae(t),n=cy(e,i),s=(r[2]+t[2])/2;return[...n.geometry.coordinates,s]}function y1(r,t){const e=ae(t),i=hn(r);return wy(i,e,{units:"meters"})}function _1(r,t){const e=ae(r),i=hn(t);return Sy(e,i,{units:"meters"})}function w1(r,t,e,i){const[n,s,a]=r,o=ky(ae([n,s]),t,e,{units:"meters"});if(!(!o||!o.geometry||!o.geometry.coordinates))return i=i||[0,0,0],i[0]=o.geometry.coordinates[0],i[1]=o.geometry.coordinates[1],i[2]=a,i}function pm(r,t){return Gp(ae(r),ae(t),{units:"meters"})}function E1(r,t){return Gy(ae(r),ae(t))}function gm(r,t){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]),(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||t[0][2]!==t[t.length-1][2])&&t.push(t[0]);const e=c1(Pr([r]),Pr([t]));if(e)return e.geometry.coordinates}function mm(r,t){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]),(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||t[0][2]!==t[t.length-1][2])&&t.push(t[0]);const e=h1(Pr([r]),Pr([t]));if(e)return e.geometry.coordinates}function vm(r,t=500,e="meters"){const i=l1(hn(r),t,{units:e});if(i)return i.geometry.coordinates}function ym(r,t){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]),(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||t[0][2]!==t[t.length-1][2])&&t.push(t[0]);const e=__(Pr([r]),Pr([t]));if(e)return e.geometry.coordinates}function _m(r,t,e=10,i="meters"){return uy(r,t,{steps:e,units:i}).geometry.coordinates}function dd(r,t){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]),(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||t[0][2]!==t[t.length-1][2])&&t.push(t[0]);const e=Pr([r]),i=Pr([t]);return Vy(e,i)?"oneBig":by(e,i)?"twoBig":!1}function wm(r){const t=d.min(d.objsIterator(r,["0"])),e=d.min(d.objsIterator(r,["1"])),i=d.min(d.objsIterator(r,["2"])),n=d.max(d.objsIterator(r,["0"])),s=d.max(d.objsIterator(r,["1"])),a=d.max(d.objsIterator(r,["2"]));return{minPos:[t,e,i],maxPos:[n,s,a],center:[(t+n)*.5,(e+s)*.5,(i+a)*.5]}}function S1(r){const{minPos:t,maxPos:e,center:i}=wm(r);if(t.some(o=>!Number.isFinite(o)||e.some(l=>!Number.isFinite(l))||i.some(l=>!Number.isFinite(l)))){console.warn("geoCenterAndRadiusFromPositions error: minPos.some(e => !Number.isFinite(e) || maxPos.some(e => !Number.isFinite(e)) || center.some(e => !Number.isFinite(e))");return}const n=fd(t,e);let s=n*.5;const a=Math.abs(t[2]-e[2]);return a!=0&&(s=Math.sqrt(n*n+a*a)*.5),{center:i,radius:s}}function P1(r){r("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),r("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),r("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");for(var t=1;t<=60;++t)r("EPSG:"+(32600+t),"+proj=utm +zone="+t+" +datum=WGS84 +units=m"),r("EPSG:"+(32700+t),"+proj=utm +zone="+t+" +south +datum=WGS84 +units=m");r.WGS84=r["EPSG:4326"],r["EPSG:3785"]=r["EPSG:3857"],r.GOOGLE=r["EPSG:3857"],r["EPSG:900913"]=r["EPSG:3857"],r["EPSG:102113"]=r["EPSG:3857"]}var ja=1,to=2,Pu=3,C1=4,pd=5,Em=6378137,I1=6356752314e-3,Sm=.0066943799901413165,yh=484813681109536e-20,Q=Math.PI/2,M1=.16666666666666666,N1=.04722222222222222,b1=.022156084656084655,st=1e-10,de=.017453292519943295,$n=57.29577951308232,ee=Math.PI/4,_h=Math.PI*2,mr=3.14159265359,si={};si.greenwich=0,si.lisbon=-9.131906111111,si.paris=2.337229166667,si.bogota=-74.080916666667,si.madrid=-3.687938888889,si.rome=12.452333333333,si.bern=7.439583333333,si.jakarta=106.807719444444,si.ferro=-17.666666666667,si.brussels=4.367975,si.stockholm=18.058277777778,si.athens=23.7163375,si.oslo=10.722916666667;const T1={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.1},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}};var Pm=/[\s_\-\/\(\)]/g;function da(r,t){if(r[t])return r[t];for(var e=Object.keys(r),i=t.toLowerCase().replace(Pm,""),n=-1,s,a;++n<e.length;)if(s=e[n],a=s.toLowerCase().replace(Pm,""),a===i)return r[s]}function gd(r){var t={},e=r.split("+").map(function(o){return o.trim()}).filter(function(o){return o}).reduce(function(o,l){var u=l.split("=");return u.push(!0),o[u[0].toLowerCase()]=u[1],o},{}),i,n,s,a={proj:"projName",datum:"datumCode",rf:function(o){t.rf=parseFloat(o)},lat_0:function(o){t.lat0=o*de},lat_1:function(o){t.lat1=o*de},lat_2:function(o){t.lat2=o*de},lat_ts:function(o){t.lat_ts=o*de},lon_0:function(o){t.long0=o*de},lon_1:function(o){t.long1=o*de},lon_2:function(o){t.long2=o*de},alpha:function(o){t.alpha=parseFloat(o)*de},gamma:function(o){t.rectified_grid_angle=parseFloat(o)*de},lonc:function(o){t.longc=o*de},x_0:function(o){t.x0=parseFloat(o)},y_0:function(o){t.y0=parseFloat(o)},k_0:function(o){t.k0=parseFloat(o)},k:function(o){t.k0=parseFloat(o)},a:function(o){t.a=parseFloat(o)},b:function(o){t.b=parseFloat(o)},r:function(o){t.a=t.b=parseFloat(o)},r_a:function(){t.R_A=!0},zone:function(o){t.zone=parseInt(o,10)},south:function(){t.utmSouth=!0},towgs84:function(o){t.datum_params=o.split(",").map(function(l){return parseFloat(l)})},to_meter:function(o){t.to_meter=parseFloat(o)},units:function(o){t.units=o;var l=da(T1,o);l&&(t.to_meter=l.to_meter)},from_greenwich:function(o){t.from_greenwich=o*de},pm:function(o){var l=da(si,o);t.from_greenwich=(l||parseFloat(o))*de},nadgrids:function(o){o==="@null"?t.datumCode="none":t.nadgrids=o},axis:function(o){var l="ewnsud";o.length===3&&l.indexOf(o.substr(0,1))!==-1&&l.indexOf(o.substr(1,1))!==-1&&l.indexOf(o.substr(2,1))!==-1&&(t.axis=o)},approx:function(){t.approx=!0}};for(i in e)n=e[i],i in a?(s=a[i],typeof s=="function"?s(n):t[s]=n):t[i]=n;return typeof t.datumCode=="string"&&t.datumCode!=="WGS84"&&(t.datumCode=t.datumCode.toLowerCase()),t}class Cm{static getId(t){const e=t.find(i=>Array.isArray(i)&&i[0]==="ID");return e&&e.length>=3?{authority:e[1],code:parseInt(e[2],10)}:null}static convertUnit(t,e="unit"){if(!t||t.length<3)return{type:e,name:"unknown",conversion_factor:null};const i=t[1],n=parseFloat(t[2])||null,s=t.find(o=>Array.isArray(o)&&o[0]==="ID"),a=s?{authority:s[1],code:parseInt(s[2],10)}:null;return{type:e,name:i,conversion_factor:n,id:a}}static convertAxis(t){const e=t[1]||"Unknown";let i;const n=e.match(/^\((.)\)$/);if(n){const u=n[1].toUpperCase();if(u==="E")i="east";else if(u==="N")i="north";else if(u==="U")i="up";else throw new Error(`Unknown axis abbreviation: ${u}`)}else i=t[2]?t[2].toLowerCase():"unknown";const s=t.find(u=>Array.isArray(u)&&u[0]==="ORDER"),a=s?parseInt(s[1],10):null,o=t.find(u=>Array.isArray(u)&&(u[0]==="LENGTHUNIT"||u[0]==="ANGLEUNIT"||u[0]==="SCALEUNIT")),l=this.convertUnit(o);return{name:e,direction:i,unit:l,order:a}}static extractAxes(t){return t.filter(e=>Array.isArray(e)&&e[0]==="AXIS").map(e=>this.convertAxis(e)).sort((e,i)=>(e.order||0)-(i.order||0))}static convert(t,e={}){switch(t[0]){case"PROJCRS":e.type="ProjectedCRS",e.name=t[1],e.base_crs=t.find(f=>Array.isArray(f)&&f[0]==="BASEGEOGCRS")?this.convert(t.find(f=>Array.isArray(f)&&f[0]==="BASEGEOGCRS")):null,e.conversion=t.find(f=>Array.isArray(f)&&f[0]==="CONVERSION")?this.convert(t.find(f=>Array.isArray(f)&&f[0]==="CONVERSION")):null;const i=t.find(f=>Array.isArray(f)&&f[0]==="CS");i&&(e.coordinate_system={type:i[1],axis:this.extractAxes(t)});const n=t.find(f=>Array.isArray(f)&&f[0]==="LENGTHUNIT");if(n){const f=this.convertUnit(n);e.coordinate_system.unit=f}e.id=this.getId(t);break;case"BASEGEOGCRS":case"GEOGCRS":e.type="GeographicCRS",e.name=t[1];const s=t.find(f=>Array.isArray(f)&&(f[0]==="DATUM"||f[0]==="ENSEMBLE"));if(s){const f=this.convert(s);s[0]==="ENSEMBLE"?e.datum_ensemble=f:e.datum=f;const g=t.find(m=>Array.isArray(m)&&m[0]==="PRIMEM");g&&g[1]!=="Greenwich"&&(f.prime_meridian={name:g[1],longitude:parseFloat(g[2])})}e.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(t)},e.id=this.getId(t);break;case"DATUM":e.type="GeodeticReferenceFrame",e.name=t[1],e.ellipsoid=t.find(f=>Array.isArray(f)&&f[0]==="ELLIPSOID")?this.convert(t.find(f=>Array.isArray(f)&&f[0]==="ELLIPSOID")):null;break;case"ENSEMBLE":e.type="DatumEnsemble",e.name=t[1],e.members=t.filter(f=>Array.isArray(f)&&f[0]==="MEMBER").map(f=>({type:"DatumEnsembleMember",name:f[1],id:this.getId(f)}));const a=t.find(f=>Array.isArray(f)&&f[0]==="ENSEMBLEACCURACY");a&&(e.accuracy=parseFloat(a[1]));const o=t.find(f=>Array.isArray(f)&&f[0]==="ELLIPSOID");o&&(e.ellipsoid=this.convert(o)),e.id=this.getId(t);break;case"ELLIPSOID":e.type="Ellipsoid",e.name=t[1],e.semi_major_axis=parseFloat(t[2]),e.inverse_flattening=parseFloat(t[3]),t.find(f=>Array.isArray(f)&&f[0]==="LENGTHUNIT")&&this.convert(t.find(f=>Array.isArray(f)&&f[0]==="LENGTHUNIT"),e);break;case"CONVERSION":e.type="Conversion",e.name=t[1],e.method=t.find(f=>Array.isArray(f)&&f[0]==="METHOD")?this.convert(t.find(f=>Array.isArray(f)&&f[0]==="METHOD")):null,e.parameters=t.filter(f=>Array.isArray(f)&&f[0]==="PARAMETER").map(f=>this.convert(f));break;case"METHOD":e.type="Method",e.name=t[1],e.id=this.getId(t);break;case"PARAMETER":e.type="Parameter",e.name=t[1],e.value=parseFloat(t[2]),e.unit=this.convertUnit(t.find(f=>Array.isArray(f)&&(f[0]==="LENGTHUNIT"||f[0]==="ANGLEUNIT"||f[0]==="SCALEUNIT"))),e.id=this.getId(t);break;case"BOUNDCRS":e.type="BoundCRS";const l=t.find(f=>Array.isArray(f)&&f[0]==="SOURCECRS");if(l){const f=l.find(g=>Array.isArray(g));e.source_crs=f?this.convert(f):null}const u=t.find(f=>Array.isArray(f)&&f[0]==="TARGETCRS");if(u){const f=u.find(g=>Array.isArray(g));e.target_crs=f?this.convert(f):null}const c=t.find(f=>Array.isArray(f)&&f[0]==="ABRIDGEDTRANSFORMATION");c?e.transformation=this.convert(c):e.transformation=null;break;case"ABRIDGEDTRANSFORMATION":if(e.type="Transformation",e.name=t[1],e.method=t.find(f=>Array.isArray(f)&&f[0]==="METHOD")?this.convert(t.find(f=>Array.isArray(f)&&f[0]==="METHOD")):null,e.parameters=t.filter(f=>Array.isArray(f)&&(f[0]==="PARAMETER"||f[0]==="PARAMETERFILE")).map(f=>{if(f[0]==="PARAMETER")return this.convert(f);if(f[0]==="PARAMETERFILE")return{name:f[1],value:f[2],id:{authority:"EPSG",code:8656}}}),e.parameters.length===7){const f=e.parameters[6];f.name==="Scale difference"&&(f.value=Math.round((f.value-1)*1e12)/1e6)}e.id=this.getId(t);break;case"AXIS":e.coordinate_system||(e.coordinate_system={type:"unspecified",axis:[]}),e.coordinate_system.axis.push(this.convertAxis(t));break;case"LENGTHUNIT":const h=this.convertUnit(t,"LinearUnit");e.coordinate_system&&e.coordinate_system.axis&&e.coordinate_system.axis.forEach(f=>{f.unit||(f.unit=h)}),h.conversion_factor&&h.conversion_factor!==1&&e.semi_major_axis&&(e.semi_major_axis={value:e.semi_major_axis,unit:h});break;default:e.keyword=t[0];break}return e}}class D1 extends Cm{static convert(t,e={}){return super.convert(t,e),e.coordinate_system&&e.coordinate_system.subtype==="Cartesian"&&delete e.coordinate_system,e.usage&&delete e.usage,e}}class x1 extends Cm{static convert(t,e={}){super.convert(t,e);const i=t.find(s=>Array.isArray(s)&&s[0]==="CS");i&&(e.coordinate_system={subtype:i[1],axis:this.extractAxes(t)});const n=t.find(s=>Array.isArray(s)&&s[0]==="USAGE");if(n){const s=n.find(l=>Array.isArray(l)&&l[0]==="SCOPE"),a=n.find(l=>Array.isArray(l)&&l[0]==="AREA"),o=n.find(l=>Array.isArray(l)&&l[0]==="BBOX");e.usage={},s&&(e.usage.scope=s[1]),a&&(e.usage.area=a[1]),o&&(e.usage.bbox=o.slice(1))}return e}}function O1(r){return r.find(t=>Array.isArray(t)&&t[0]==="USAGE")?"2019":(r.find(t=>Array.isArray(t)&&t[0]==="CS")||r[0]==="BOUNDCRS"||r[0]==="PROJCRS"||r[0]==="GEOGCRS","2015")}function A1(r){return(O1(r)==="2019"?x1:D1).convert(r)}function L1(r){const t=r.toUpperCase();return t.includes("PROJCRS")||t.includes("GEOGCRS")||t.includes("BOUNDCRS")||t.includes("VERTCRS")||t.includes("LENGTHUNIT")||t.includes("ANGLEUNIT")||t.includes("SCALEUNIT")?"WKT2":(t.includes("PROJCS")||t.includes("GEOGCS")||t.includes("LOCAL_CS")||t.includes("VERT_CS")||t.includes("UNIT"),"WKT1")}var wh=1,Im=2,Mm=3,kc=4,Nm=5,md=-1,R1=/\s/,F1=/[A-Za-z]/,G1=/[A-Za-z84_]/,zc=/[,\]]/,bm=/[\d\.E\-\+]/;function Ts(r){if(typeof r!="string")throw new Error("not a string");this.text=r.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=wh}Ts.prototype.readCharicter=function(){var r=this.text[this.place++];if(this.state!==kc)for(;R1.test(r);){if(this.place>=this.text.length)return;r=this.text[this.place++]}switch(this.state){case wh:return this.neutral(r);case Im:return this.keyword(r);case kc:return this.quoted(r);case Nm:return this.afterquote(r);case Mm:return this.number(r);case md:return}},Ts.prototype.afterquote=function(r){if(r==='"'){this.word+='"',this.state=kc;return}if(zc.test(r)){this.word=this.word.trim(),this.afterItem(r);return}throw new Error(`havn't handled "`+r+'" in afterquote yet, index '+this.place)},Ts.prototype.afterItem=function(r){if(r===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=wh;return}if(r==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=wh,this.currentObject=this.stack.pop(),this.currentObject||(this.state=md);return}},Ts.prototype.number=function(r){if(bm.test(r)){this.word+=r;return}if(zc.test(r)){this.word=parseFloat(this.word),this.afterItem(r);return}throw new Error(`havn't handled "`+r+'" in number yet, index '+this.place)},Ts.prototype.quoted=function(r){if(r==='"'){this.state=Nm;return}this.word+=r},Ts.prototype.keyword=function(r){if(G1.test(r)){this.word+=r;return}if(r==="["){var t=[];t.push(this.word),this.level++,this.root===null?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,this.state=wh;return}if(zc.test(r)){this.afterItem(r);return}throw new Error(`havn't handled "`+r+'" in keyword yet, index '+this.place)},Ts.prototype.neutral=function(r){if(F1.test(r)){this.word=r,this.state=Im;return}if(r==='"'){this.word="",this.state=kc;return}if(bm.test(r)){this.word=r,this.state=Mm;return}if(zc.test(r)){this.afterItem(r);return}throw new Error(`havn't handled "`+r+'" in neutral yet, index '+this.place)},Ts.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===md)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function k1(r){var t=new Ts(r);return t.output()}function vd(r,t,e){Array.isArray(t)&&(e.unshift(t),t=null);var i=t?{}:r,n=e.reduce(function(s,a){return Cu(a,s),s},i);t&&(r[t]=n)}function Cu(r,t){if(!Array.isArray(r)){t[r]=!0;return}var e=r.shift();if(e==="PARAMETER"&&(e=r.shift()),r.length===1){if(Array.isArray(r[0])){t[e]={},Cu(r[0],t[e]);return}t[e]=r[0];return}if(!r.length){t[e]=!0;return}if(e==="TOWGS84"){t[e]=r;return}if(e==="AXIS"){e in t||(t[e]=[]),t[e].push(r);return}Array.isArray(e)||(t[e]={});var i;switch(e){case"UNIT":case"PRIMEM":case"VERT_DATUM":t[e]={name:r[0].toLowerCase(),convert:r[1]},r.length===3&&Cu(r[2],t[e]);return;case"SPHEROID":case"ELLIPSOID":t[e]={name:r[0],a:r[1],rf:r[2]},r.length===4&&Cu(r[3],t[e]);return;case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":r[0]=["name",r[0]],vd(t,e,r);return;case"COMPD_CS":case"COMPOUNDCRS":case"FITTED_CS":case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"ENGCRS":case"ENGINEERINGCRS":r[0]=["name",r[0]],vd(t,e,r),t[e].type=e;return;default:for(i=-1;++i<r.length;)if(!Array.isArray(r[i]))return Cu(r,t[e]);return vd(t,e,r)}}var z1=.017453292519943295;function Mn(r){return r*z1}function Tm(r){const t=(r.projName||"").toLowerCase().replace(/_/g," ");!r.long0&&r.longc&&(t==="albers conic equal area"||t==="lambert azimuthal equal area")&&(r.long0=r.longc),!r.lat_ts&&r.lat1&&(t==="stereographic south pole"||t==="polar stereographic (variant b)")?(r.lat0=Mn(r.lat1>0?90:-90),r.lat_ts=r.lat1,delete r.lat1):!r.lat_ts&&r.lat0&&(t==="polar stereographic"||t==="polar stereographic (variant a)")&&(r.lat_ts=r.lat0,r.lat0=Mn(r.lat0>0?90:-90),delete r.lat1)}function Dm(r){let t={units:null,to_meter:void 0};return typeof r=="string"?(t.units=r.toLowerCase(),t.units==="metre"&&(t.units="meter"),t.units==="meter"&&(t.to_meter=1)):r&&r.name&&(t.units=r.name.toLowerCase(),t.units==="metre"&&(t.units="meter"),t.to_meter=r.conversion_factor),t}function xm(r){return typeof r=="object"?r.value*r.unit.conversion_factor:r}function Om(r,t){r.ellipsoid.radius?(t.a=r.ellipsoid.radius,t.rf=0):(t.a=xm(r.ellipsoid.semi_major_axis),r.ellipsoid.inverse_flattening!==void 0?t.rf=r.ellipsoid.inverse_flattening:r.ellipsoid.semi_major_axis!==void 0&&r.ellipsoid.semi_minor_axis!==void 0&&(t.rf=t.a/(t.a-xm(r.ellipsoid.semi_minor_axis))))}function Vc(r,t={}){return!r||typeof r!="object"?r:r.type==="BoundCRS"?(Vc(r.source_crs,t),r.transformation&&(r.transformation.method&&r.transformation.method.name==="NTv2"?t.nadgrids=r.transformation.parameters[0].value:t.datum_params=r.transformation.parameters.map(e=>e.value)),t):(Object.keys(r).forEach(e=>{const i=r[e];if(i!==null)switch(e){case"name":if(t.srsCode)break;t.name=i,t.srsCode=i;break;case"type":i==="GeographicCRS"?t.projName="longlat":i==="ProjectedCRS"&&r.conversion&&r.conversion.method&&(t.projName=r.conversion.method.name);break;case"datum":case"datum_ensemble":i.ellipsoid&&(t.ellps=i.ellipsoid.name,Om(i,t)),i.prime_meridian&&(t.from_greenwich=i.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":t.ellps=i.name,Om(i,t);break;case"prime_meridian":t.long0=(i.longitude||0)*Math.PI/180;break;case"coordinate_system":if(i.axis){if(t.axis=i.axis.map(n=>{const s=n.direction;if(s==="east")return"e";if(s==="north")return"n";if(s==="west")return"w";if(s==="south")return"s";throw new Error(`Unknown axis direction: ${s}`)}).join("")+"u",i.unit){const{units:n,to_meter:s}=Dm(i.unit);t.units=n,t.to_meter=s}else if(i.axis[0]&&i.axis[0].unit){const{units:n,to_meter:s}=Dm(i.axis[0].unit);t.units=n,t.to_meter=s}}break;case"id":i.authority&&i.code&&(t.title=i.authority+":"+i.code);break;case"conversion":i.method&&i.method.name&&(t.projName=i.method.name),i.parameters&&i.parameters.forEach(n=>{const s=n.name.toLowerCase().replace(/\s+/g,"_"),a=n.value;n.unit&&n.unit.conversion_factor?t[s]=a*n.unit.conversion_factor:n.unit==="degree"?t[s]=a*Math.PI/180:t[s]=a});break;case"unit":i.name&&(t.units=i.name.toLowerCase(),t.units==="metre"&&(t.units="meter")),i.conversion_factor&&(t.to_meter=i.conversion_factor);break;case"base_crs":Vc(i,t),t.datumCode=i.id?i.id.authority+"_"+i.id.code:i.name;break}}),t.latitude_of_false_origin!==void 0&&(t.lat0=t.latitude_of_false_origin),t.longitude_of_false_origin!==void 0&&(t.long0=t.longitude_of_false_origin),t.latitude_of_standard_parallel!==void 0&&(t.lat0=t.latitude_of_standard_parallel,t.lat1=t.latitude_of_standard_parallel),t.latitude_of_1st_standard_parallel!==void 0&&(t.lat1=t.latitude_of_1st_standard_parallel),t.latitude_of_2nd_standard_parallel!==void 0&&(t.lat2=t.latitude_of_2nd_standard_parallel),t.latitude_of_projection_centre!==void 0&&(t.lat0=t.latitude_of_projection_centre),t.longitude_of_projection_centre!==void 0&&(t.longc=t.longitude_of_projection_centre),t.easting_at_false_origin!==void 0&&(t.x0=t.easting_at_false_origin),t.northing_at_false_origin!==void 0&&(t.y0=t.northing_at_false_origin),t.latitude_of_natural_origin!==void 0&&(t.lat0=t.latitude_of_natural_origin),t.longitude_of_natural_origin!==void 0&&(t.long0=t.longitude_of_natural_origin),t.longitude_of_origin!==void 0&&(t.long0=t.longitude_of_origin),t.false_easting!==void 0&&(t.x0=t.false_easting),t.easting_at_projection_centre&&(t.x0=t.easting_at_projection_centre),t.false_northing!==void 0&&(t.y0=t.false_northing),t.northing_at_projection_centre&&(t.y0=t.northing_at_projection_centre),t.standard_parallel_1!==void 0&&(t.lat1=t.standard_parallel_1),t.standard_parallel_2!==void 0&&(t.lat2=t.standard_parallel_2),t.scale_factor_at_natural_origin!==void 0&&(t.k0=t.scale_factor_at_natural_origin),t.scale_factor_at_projection_centre!==void 0&&(t.k0=t.scale_factor_at_projection_centre),t.scale_factor_on_pseudo_standard_parallel!==void 0&&(t.k0=t.scale_factor_on_pseudo_standard_parallel),t.azimuth!==void 0&&(t.alpha=t.azimuth),t.azimuth_at_projection_centre!==void 0&&(t.alpha=t.azimuth_at_projection_centre),t.angle_from_rectified_to_skew_grid&&(t.rectified_grid_angle=t.angle_from_rectified_to_skew_grid),Tm(t),t)}var V1=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function U1(r,t){var e=t[0],i=t[1];!(e in r)&&i in r&&(r[e]=r[i],t.length===3&&(r[e]=t[2](r[e])))}function Am(r){for(var t=Object.keys(r),e=0,i=t.length;e<i;++e){var n=t[e];V1.indexOf(n)!==-1&&q1(r[n]),typeof r[n]=="object"&&Am(r[n])}}function q1(r){if(r.AUTHORITY){var t=Object.keys(r.AUTHORITY)[0];t&&t in r.AUTHORITY&&(r.title=t+":"+r.AUTHORITY[t])}if(r.type==="GEOGCS"?r.projName="longlat":r.type==="LOCAL_CS"?(r.projName="identity",r.local=!0):typeof r.PROJECTION=="object"?r.projName=Object.keys(r.PROJECTION)[0]:r.projName=r.PROJECTION,r.AXIS){for(var e="",i=0,n=r.AXIS.length;i<n;++i){var s=[r.AXIS[i][0].toLowerCase(),r.AXIS[i][1].toLowerCase()];s[0].indexOf("north")!==-1||(s[0]==="y"||s[0]==="lat")&&s[1]==="north"?e+="n":s[0].indexOf("south")!==-1||(s[0]==="y"||s[0]==="lat")&&s[1]==="south"?e+="s":s[0].indexOf("east")!==-1||(s[0]==="x"||s[0]==="lon")&&s[1]==="east"?e+="e":(s[0].indexOf("west")!==-1||(s[0]==="x"||s[0]==="lon")&&s[1]==="west")&&(e+="w")}e.length===2&&(e+="u"),e.length===3&&(r.axis=e)}r.UNIT&&(r.units=r.UNIT.name.toLowerCase(),r.units==="metre"&&(r.units="meter"),r.UNIT.convert&&(r.type==="GEOGCS"?r.DATUM&&r.DATUM.SPHEROID&&(r.to_meter=r.UNIT.convert*r.DATUM.SPHEROID.a):r.to_meter=r.UNIT.convert));var a=r.GEOGCS;r.type==="GEOGCS"&&(a=r),a&&(a.DATUM?r.datumCode=a.DATUM.name.toLowerCase():r.datumCode=a.name.toLowerCase(),r.datumCode.slice(0,2)==="d_"&&(r.datumCode=r.datumCode.slice(2)),r.datumCode==="new_zealand_1949"&&(r.datumCode="nzgd49"),(r.datumCode==="wgs_1984"||r.datumCode==="world_geodetic_system_1984")&&(r.PROJECTION==="Mercator_Auxiliary_Sphere"&&(r.sphere=!0),r.datumCode="wgs84"),r.datumCode==="belge_1972"&&(r.datumCode="rnb72"),a.DATUM&&a.DATUM.SPHEROID&&(r.ellps=a.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),r.ellps.toLowerCase().slice(0,13)==="international"&&(r.ellps="intl"),r.a=a.DATUM.SPHEROID.a,r.rf=parseFloat(a.DATUM.SPHEROID.rf,10)),a.DATUM&&a.DATUM.TOWGS84&&(r.datum_params=a.DATUM.TOWGS84),~r.datumCode.indexOf("osgb_1936")&&(r.datumCode="osgb36"),~r.datumCode.indexOf("osni_1952")&&(r.datumCode="osni52"),(~r.datumCode.indexOf("tm65")||~r.datumCode.indexOf("geodetic_datum_of_1965"))&&(r.datumCode="ire65"),r.datumCode==="ch1903+"&&(r.datumCode="ch1903"),~r.datumCode.indexOf("israel")&&(r.datumCode="isr93")),r.b&&!isFinite(r.b)&&(r.b=r.a),r.rectified_grid_angle&&(r.rectified_grid_angle=Mn(r.rectified_grid_angle));function o(c){var h=r.to_meter||1;return c*h}var l=function(c){return U1(r,c)},u=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",Mn],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",Mn],["x0","false_easting",o],["y0","false_northing",o],["long0","central_meridian",Mn],["lat0","latitude_of_origin",Mn],["lat0","standard_parallel_1",Mn],["lat1","standard_parallel_1",Mn],["lat2","standard_parallel_2",Mn],["azimuth","Azimuth"],["alpha","azimuth",Mn],["srsCode","name"]];u.forEach(l),Tm(r)}function yd(r){if(typeof r=="object")return Vc(r);const t=L1(r);var e=k1(r);if(t==="WKT2"){const s=A1(e);return Vc(s)}var i=e[0],n={};return Cu(e,n),Am(n),n[i]}function Hr(r){var t=this;if(arguments.length===2){var e=arguments[1];typeof e=="string"?e.charAt(0)==="+"?Hr[r]=gd(arguments[1]):Hr[r]=yd(arguments[1]):Hr[r]=e}else if(arguments.length===1){if(Array.isArray(r))return r.map(function(i){Array.isArray(i)?Hr.apply(t,i):Hr(i)});if(typeof r=="string"){if(r in Hr)return Hr[r]}else"EPSG"in r?Hr["EPSG:"+r.EPSG]=r:"ESRI"in r?Hr["ESRI:"+r.ESRI]=r:"IAU2000"in r?Hr["IAU2000:"+r.IAU2000]=r:console.log(r);return}}P1(Hr);function W1(r){return typeof r=="string"}function H1(r){return r in Hr}function X1(r){return r.indexOf("+")!==0&&r.indexOf("[")!==-1||typeof r=="object"&&!("srsCode"in r)}var Y1=["3857","900913","3785","102113"];function J1(r){var t=da(r,"authority");if(t){var e=da(t,"epsg");return e&&Y1.indexOf(e)>-1}}function K1(r){var t=da(r,"extension");if(t)return da(t,"proj4")}function Q1(r){return r[0]==="+"}function Z1(r){if(W1(r)){if(H1(r))return Hr[r];if(X1(r)){var t=yd(r);if(J1(t))return Hr["EPSG:3857"];var e=K1(t);return e?gd(e):t}if(Q1(r))return gd(r)}else return r.projName?r:yd(r)}function Lm(r,t){r=r||{};var e,i;if(!t)return r;for(i in t)e=t[i],e!==void 0&&(r[i]=e);return r}function jn(r,t,e){var i=r*t;return e/Math.sqrt(1-i*i)}function Eh(r){return r<0?-1:1}function ht(r){return Math.abs(r)<=mr?r:r-Eh(r)*_h}function Nn(r,t,e){var i=r*e,n=.5*r;return i=Math.pow((1-i)/(1+i),n),Math.tan(.5*(Q-t))/i}function Sh(r,t){for(var e=.5*r,i,n,s=Q-2*Math.atan(t),a=0;a<=15;a++)if(i=r*Math.sin(s),n=Q-2*Math.atan(t*Math.pow((1-i)/(1+i),e))-s,s+=n,Math.abs(n)<=1e-10)return s;return-9999}function B1(){var r=this.b/this.a;this.es=1-r*r,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=jn(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function $1(r){var t=r.x,e=r.y;if(e*$n>90&&e*$n<-90&&t*$n>180&&t*$n<-180)return null;var i,n;if(Math.abs(Math.abs(e)-Q)<=st)return null;if(this.sphere)i=this.x0+this.a*this.k0*ht(t-this.long0),n=this.y0+this.a*this.k0*Math.log(Math.tan(ee+.5*e));else{var s=Math.sin(e),a=Nn(this.e,e,s);i=this.x0+this.a*this.k0*ht(t-this.long0),n=this.y0-this.a*this.k0*Math.log(a)}return r.x=i,r.y=n,r}function j1(r){var t=r.x-this.x0,e=r.y-this.y0,i,n;if(this.sphere)n=Q-2*Math.atan(Math.exp(-e/(this.a*this.k0)));else{var s=Math.exp(-e/(this.a*this.k0));if(n=Sh(this.e,s),n===-9999)return null}return i=ht(this.long0+t/(this.a*this.k0)),r.x=i,r.y=n,r}var tw=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"];const ew={init:B1,forward:$1,inverse:j1,names:tw};function rw(){}function Rm(r){return r}var iw=["longlat","identity"],nw=[ew,{init:rw,forward:Rm,inverse:Rm,names:iw}],eo={},Iu=[];function Fm(r,t){var e=Iu.length;return r.names?(Iu[e]=r,r.names.forEach(function(i){eo[i.toLowerCase()]=e}),this):(console.log(t),!0)}function Gm(r){return r.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}function sw(r){if(!r)return!1;var t=r.toLowerCase();if(typeof eo[t]<"u"&&Iu[eo[t]]||(t=Gm(t),t in eo&&Iu[eo[t]]))return Iu[eo[t]]}function aw(){nw.forEach(Fm)}const ow={start:aw,add:Fm,get:sw};var km={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},andrae:{a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},clrk80:{a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}};const lw=km.WGS84;function uw(r,t,e,i){var n=r*r,s=t*t,a=(n-s)/n,o=0;i?(r*=1-a*(M1+a*(N1+a*b1)),n=r*r,a=0):o=Math.sqrt(a);var l=(n-s)/s;return{es:a,e:o,ep2:l}}function hw(r,t,e,i,n){if(!r){var s=da(km,i);s||(s=lw),r=s.a,t=s.b,e=s.rf}return e&&!t&&(t=(1-1/e)*r),(e===0||Math.abs(r-t)<st)&&(n=!0,t=r),{a:r,b:t,rf:e,sphere:n}}var Uc={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},mgi:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},EPSG_5451:{towgs84:"6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649"},IGNF_LURESG:{towgs84:"-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43"},EPSG_4614:{towgs84:"-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065"},EPSG_4615:{towgs84:"-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748"},ESRI_37241:{towgs84:"-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031"},ESRI_37249:{towgs84:"-440.296,58.548,296.265,1.128,10.202,4.559,-0.438"},ESRI_37245:{towgs84:"-511.151,-181.269,139.609,1.05,2.703,1.798,3.071"},EPSG_4178:{towgs84:"24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01"},EPSG_4622:{towgs84:"-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984"},EPSG_4625:{towgs84:"126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227"},EPSG_5252:{towgs84:"0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439"},EPSG_4314:{towgs84:"597.1,71.4,412.1,0.894,0.068,-1.563,7.58"},EPSG_4282:{towgs84:"-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166"},EPSG_4231:{towgs84:"-83.11,-97.38,-117.22,0.0276,-0.2167,0.2147,0.1218"},EPSG_4274:{towgs84:"-230.994,102.591,25.199,0.633,-0.239,0.9,1.95"},EPSG_4134:{towgs84:"-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006"},EPSG_4254:{towgs84:"18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013"},EPSG_4159:{towgs84:"-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175"},EPSG_4687:{towgs84:"0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093"},EPSG_4227:{towgs84:"-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225"},EPSG_4746:{towgs84:"599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46"},EPSG_4745:{towgs84:"612.4,77,440.2,-0.054,0.057,-2.797,2.55"},EPSG_6311:{towgs84:"8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926"},EPSG_4289:{towgs84:"565.7381,50.4018,465.2904,-1.91514,1.60363,-9.09546,4.07244"},EPSG_4230:{towgs84:"-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4"},EPSG_4154:{towgs84:"-123.02,-158.95,-168.47"},EPSG_4156:{towgs84:"570.8,85.7,462.8,4.998,1.587,5.261,3.56"},EPSG_4299:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4179:{towgs84:"33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84"},EPSG_4313:{towgs84:"-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747"},EPSG_4194:{towgs84:"163.511,127.533,-159.789"},EPSG_4195:{towgs84:"105,326,-102.5"},EPSG_4196:{towgs84:"-45,417,-3.5"},EPSG_4611:{towgs84:"-162.619,-276.959,-161.764,0.067753,-2.243649,-1.158827,-1.094246"},EPSG_4633:{towgs84:"137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824"},EPSG_4641:{towgs84:"-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993"},EPSG_4643:{towgs84:"-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002"},EPSG_4300:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4188:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4660:{towgs84:"982.6087,552.753,-540.873,32.39344,-153.25684,-96.2266,16.805"},EPSG_4662:{towgs84:"97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259"},EPSG_3906:{towgs84:"577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664"},EPSG_4307:{towgs84:"-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547"},EPSG_6892:{towgs84:"-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686"},EPSG_4690:{towgs84:"221.597,152.441,176.523,2.403,1.3893,0.884,11.4648"},EPSG_4691:{towgs84:"218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817"},EPSG_4629:{towgs84:"72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653"},EPSG_4630:{towgs84:"165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111"},EPSG_4692:{towgs84:"217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093"},EPSG_9333:{towgs84:"0,0,0,-8.393,0.749,-10.276,0"},EPSG_9059:{towgs84:"0,0,0"},EPSG_4312:{towgs84:"601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887"},EPSG_4123:{towgs84:"-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496"},EPSG_4309:{towgs84:"-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365"},ESRI_104106:{towgs84:"-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058"},EPSG_4281:{towgs84:"-219.247,-73.802,269.529"},EPSG_4322:{towgs84:"0,0,4.5"},EPSG_4324:{towgs84:"0,0,1.9"},EPSG_4284:{towgs84:"43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549"},EPSG_4277:{towgs84:"446.448,-125.157,542.06,0.15,0.247,0.842,-20.489"},EPSG_4207:{towgs84:"-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46"},EPSG_4688:{towgs84:"347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647"},EPSG_4689:{towgs84:"410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218"},EPSG_4720:{towgs84:"0,0,4.5"},EPSG_4273:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},EPSG_4240:{towgs84:"204.64,834.74,293.8"},EPSG_4817:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},ESRI_104131:{towgs84:"426.62,142.62,460.09,4.98,4.49,-12.42,-17.1"},EPSG_4265:{towgs84:"-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68"},EPSG_4263:{towgs84:"-111.92,-87.85,114.5,1.875,0.202,0.219,0.032"},EPSG_4298:{towgs84:"-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536"},EPSG_4270:{towgs84:"-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424"},EPSG_4229:{towgs84:"-121.8,98.1,-10.7"},EPSG_4220:{towgs84:"-55.5,-348,-229.2"},EPSG_4214:{towgs84:"12.646,-155.176,-80.863"},EPSG_4232:{towgs84:"-345,3,223"},EPSG_4238:{towgs84:"-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037"},EPSG_4168:{towgs84:"-170,33,326"},EPSG_4131:{towgs84:"199,931,318.9"},EPSG_4152:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_5228:{towgs84:"572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378"},EPSG_8351:{towgs84:"485.021,169.465,483.839,7.786342,4.397554,4.102655,0"},EPSG_4683:{towgs84:"-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06"},EPSG_4133:{towgs84:"0,0,0"},EPSG_7373:{towgs84:"0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693"},EPSG_9075:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9072:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9294:{towgs84:"1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388"},EPSG_4212:{towgs84:"-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492"},EPSG_4191:{towgs84:"-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703"},EPSG_4237:{towgs84:"52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191"},EPSG_4740:{towgs84:"-1.08,-0.27,-0.9"},EPSG_4124:{towgs84:"419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496"},EPSG_5681:{towgs84:"584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922"},EPSG_4141:{towgs84:"23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262"},EPSG_4204:{towgs84:"-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194"},EPSG_4319:{towgs84:"226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798"},EPSG_4200:{towgs84:"24.82,-131.21,-82.66"},EPSG_4130:{towgs84:"0,0,0"},EPSG_4127:{towgs84:"-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359"},EPSG_4149:{towgs84:"674.374,15.056,405.346"},EPSG_4617:{towgs84:"-0.991,1.9072,0.5129,1.25033e-7,4.6785e-8,5.6529e-8,0"},EPSG_4663:{towgs84:"-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485"},EPSG_4664:{towgs84:"-211.939,137.626,58.3,-0.089,0.251,0.079,0.384"},EPSG_4665:{towgs84:"-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048"},EPSG_4666:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},EPSG_4756:{towgs84:"-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188"},EPSG_4723:{towgs84:"-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925"},EPSG_4726:{towgs84:"8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081"},EPSG_4267:{towgs84:"-8.0,160.0,176.0"},EPSG_5365:{towgs84:"-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693"},EPSG_4218:{towgs84:"304.5,306.5,-318.1"},EPSG_4242:{towgs84:"-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95"},EPSG_4216:{towgs84:"-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289"},ESRI_104105:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},ESRI_104129:{towgs84:"0,0,0"},EPSG_4673:{towgs84:"174.05,-25.49,112.57"},EPSG_4202:{towgs84:"-124,-60,154"},EPSG_4203:{towgs84:"-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191"},EPSG_3819:{towgs84:"595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408"},EPSG_8694:{towgs84:"-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169"},EPSG_4145:{towgs84:"275.57,676.78,229.6"},EPSG_4283:{towgs84:"61.55,-10.87,-40.19,39.4924,32.7221,32.8979,-9.994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.3092483,0.32482185,0.49729934,5.68906266"},EPSG_4272:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993"},EPSG_4248:{towgs84:"-307.7,265.3,-363.5"},EPSG_5561:{towgs84:"24,-121,-76"},EPSG_5233:{towgs84:"-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338"},ESRI_104130:{towgs84:"-86,-98,-119"},ESRI_104102:{towgs84:"682,-203,480"},ESRI_37207:{towgs84:"7,-10,-26"},EPSG_4675:{towgs84:"59.935,118.4,-10.871"},ESRI_104109:{towgs84:"-89.121,-348.182,260.871"},ESRI_104112:{towgs84:"-185.583,-230.096,281.361"},ESRI_104113:{towgs84:"25.1,-275.6,222.6"},IGNF_WGS72G:{towgs84:"0,12,6"},IGNF_NTFG:{towgs84:"-168,-60,320"},IGNF_EFATE57G:{towgs84:"-127,-769,472"},IGNF_PGP50G:{towgs84:"324.8,153.6,172.1"},IGNF_REUN47G:{towgs84:"94,-948,-1262"},IGNF_CSG67G:{towgs84:"-186,230,110"},IGNF_GUAD48G:{towgs84:"-467,-16,-300"},IGNF_TAHI51G:{towgs84:"162,117,154"},IGNF_TAHAAG:{towgs84:"65,342,77"},IGNF_NUKU72G:{towgs84:"84,274,65"},IGNF_PETRELS72G:{towgs84:"365,194,166"},IGNF_WALL78G:{towgs84:"253,-133,-127"},IGNF_MAYO50G:{towgs84:"-382,-59,-262"},IGNF_TANNAG:{towgs84:"-139,-967,436"},IGNF_IGN72G:{towgs84:"-13,-348,292"},IGNF_ATIGG:{towgs84:"1118,23,66"},IGNF_FANGA84G:{towgs84:"150.57,158.33,118.32"},IGNF_RUSAT84G:{towgs84:"202.13,174.6,-15.74"},IGNF_KAUE70G:{towgs84:"126.74,300.1,-75.49"},IGNF_MOP90G:{towgs84:"-10.8,-1.8,12.77"},IGNF_MHPF67G:{towgs84:"338.08,212.58,-296.17"},IGNF_TAHI79G:{towgs84:"160.61,116.05,153.69"},IGNF_ANAA92G:{towgs84:"1.5,3.84,4.81"},IGNF_MARQUI72G:{towgs84:"330.91,-13.92,58.56"},IGNF_APAT86G:{towgs84:"143.6,197.82,74.05"},IGNF_TUBU69G:{towgs84:"237.17,171.61,-77.84"},IGNF_STPM50G:{towgs84:"11.363,424.148,373.13"},EPSG_4150:{towgs84:"674.374,15.056,405.346"},EPSG_4754:{towgs84:"-208.4058,-109.8777,-2.5764"},ESRI_104101:{towgs84:"374,150,588"},EPSG_4693:{towgs84:"0,-0.15,0.68"},EPSG_6207:{towgs84:"293.17,726.18,245.36"},EPSG_4153:{towgs84:"-133.63,-157.5,-158.62"},EPSG_4132:{towgs84:"-241.54,-163.64,396.06"},EPSG_4221:{towgs84:"-154.5,150.7,100.4"},EPSG_4266:{towgs84:"-80.7,-132.5,41.1"},EPSG_4193:{towgs84:"-70.9,-151.8,-41.4"},EPSG_5340:{towgs84:"-0.41,0.46,-0.35"},EPSG_4246:{towgs84:"-294.7,-200.1,525.5"},EPSG_4318:{towgs84:"-3.2,-5.7,2.8"},EPSG_4121:{towgs84:"-199.87,74.79,246.62"},EPSG_4223:{towgs84:"-260.1,5.5,432.2"},EPSG_4158:{towgs84:"-0.465,372.095,171.736"},EPSG_4285:{towgs84:"-128.16,-282.42,21.93"},EPSG_4613:{towgs84:"-404.78,685.68,45.47"},EPSG_4607:{towgs84:"195.671,332.517,274.607"},EPSG_4475:{towgs84:"-381.788,-57.501,-256.673"},EPSG_4208:{towgs84:"-157.84,308.54,-146.6"},EPSG_4743:{towgs84:"70.995,-335.916,262.898"},EPSG_4710:{towgs84:"-323.65,551.39,-491.22"},EPSG_7881:{towgs84:"-0.077,0.079,0.086"},EPSG_4682:{towgs84:"283.729,735.942,261.143"},EPSG_4739:{towgs84:"-156,-271,-189"},EPSG_4679:{towgs84:"-80.01,253.26,291.19"},EPSG_4750:{towgs84:"-56.263,16.136,-22.856"},EPSG_4644:{towgs84:"-10.18,-350.43,291.37"},EPSG_4695:{towgs84:"-103.746,-9.614,-255.95"},EPSG_4292:{towgs84:"-355,21,72"},EPSG_4302:{towgs84:"-61.702,284.488,472.052"},EPSG_4143:{towgs84:"-124.76,53,466.79"},EPSG_4606:{towgs84:"-153,153,307"},EPSG_4699:{towgs84:"-770.1,158.4,-498.2"},EPSG_4247:{towgs84:"-273.5,110.6,-357.9"},EPSG_4160:{towgs84:"8.88,184.86,106.69"},EPSG_4161:{towgs84:"-233.43,6.65,173.64"},EPSG_9251:{towgs84:"-9.5,122.9,138.2"},EPSG_9253:{towgs84:"-78.1,101.6,133.3"},EPSG_4297:{towgs84:"-198.383,-240.517,-107.909"},EPSG_4269:{towgs84:"0,0,0"},EPSG_4301:{towgs84:"-147,506,687"},EPSG_4618:{towgs84:"-59,-11,-52"},EPSG_4612:{towgs84:"0,0,0"},EPSG_4678:{towgs84:"44.585,-131.212,-39.544"},EPSG_4250:{towgs84:"-130,29,364"},EPSG_4144:{towgs84:"214,804,268"},EPSG_4147:{towgs84:"-17.51,-108.32,-62.39"},EPSG_4259:{towgs84:"-254.1,-5.36,-100.29"},EPSG_4164:{towgs84:"-76,-138,67"},EPSG_4211:{towgs84:"-378.873,676.002,-46.255"},EPSG_4182:{towgs84:"-422.651,-172.995,84.02"},EPSG_4224:{towgs84:"-143.87,243.37,-33.52"},EPSG_4225:{towgs84:"-205.57,168.77,-4.12"},EPSG_5527:{towgs84:"-67.35,3.88,-38.22"},EPSG_4752:{towgs84:"98,390,-22"},EPSG_4310:{towgs84:"-30,190,89"},EPSG_9248:{towgs84:"-192.26,65.72,132.08"},EPSG_4680:{towgs84:"124.5,-63.5,-281"},EPSG_4701:{towgs84:"-79.9,-158,-168.9"},EPSG_4706:{towgs84:"-146.21,112.63,4.05"},EPSG_4805:{towgs84:"682,-203,480"},EPSG_4201:{towgs84:"-165,-11,206"},EPSG_4210:{towgs84:"-157,-2,-299"},EPSG_4183:{towgs84:"-104,167,-38"},EPSG_4139:{towgs84:"11,72,-101"},EPSG_4668:{towgs84:"-86,-98,-119"},EPSG_4717:{towgs84:"-2,151,181"},EPSG_4732:{towgs84:"102,52,-38"},EPSG_4280:{towgs84:"-377,681,-50"},EPSG_4209:{towgs84:"-138,-105,-289"},EPSG_4261:{towgs84:"31,146,47"},EPSG_4658:{towgs84:"-73,46,-86"},EPSG_4721:{towgs84:"265.025,384.929,-194.046"},EPSG_4222:{towgs84:"-136,-108,-292"},EPSG_4601:{towgs84:"-255,-15,71"},EPSG_4602:{towgs84:"725,685,536"},EPSG_4603:{towgs84:"72,213.7,93"},EPSG_4605:{towgs84:"9,183,236"},EPSG_4621:{towgs84:"137,248,-430"},EPSG_4657:{towgs84:"-28,199,5"},EPSG_4316:{towgs84:"103.25,-100.4,-307.19"},EPSG_4642:{towgs84:"-13,-348,292"},EPSG_4698:{towgs84:"145,-187,103"},EPSG_4192:{towgs84:"-206.1,-174.7,-87.7"},EPSG_4311:{towgs84:"-265,120,-358"},EPSG_4135:{towgs84:"58,-283,-182"},ESRI_104138:{towgs84:"198,-226,-347"},EPSG_4245:{towgs84:"-11,851,5"},EPSG_4142:{towgs84:"-125,53,467"},EPSG_4213:{towgs84:"-106,-87,188"},EPSG_4253:{towgs84:"-133,-77,-51"},EPSG_4129:{towgs84:"-132,-110,-335"},EPSG_4713:{towgs84:"-77,-128,142"},EPSG_4239:{towgs84:"217,823,299"},EPSG_4146:{towgs84:"295,736,257"},EPSG_4155:{towgs84:"-83,37,124"},EPSG_4165:{towgs84:"-173,253,27"},EPSG_4672:{towgs84:"175,-38,113"},EPSG_4236:{towgs84:"-637,-549,-203"},EPSG_4251:{towgs84:"-90,40,88"},EPSG_4271:{towgs84:"-2,374,172"},EPSG_4175:{towgs84:"-88,4,101"},EPSG_4716:{towgs84:"298,-304,-375"},EPSG_4315:{towgs84:"-23,259,-9"},EPSG_4744:{towgs84:"-242.2,-144.9,370.3"},EPSG_4244:{towgs84:"-97,787,86"},EPSG_4293:{towgs84:"616,97,-251"},EPSG_4714:{towgs84:"-127,-769,472"},EPSG_4736:{towgs84:"260,12,-147"},EPSG_6883:{towgs84:"-235,-110,393"},EPSG_6894:{towgs84:"-63,176,185"},EPSG_4205:{towgs84:"-43,-163,45"},EPSG_4256:{towgs84:"41,-220,-134"},EPSG_4262:{towgs84:"639,405,60"},EPSG_4604:{towgs84:"174,359,365"},EPSG_4169:{towgs84:"-115,118,426"},EPSG_4620:{towgs84:"-106,-129,165"},EPSG_4184:{towgs84:"-203,141,53"},EPSG_4616:{towgs84:"-289,-124,60"},EPSG_9403:{towgs84:"-307,-92,127"},EPSG_4684:{towgs84:"-133,-321,50"},EPSG_4708:{towgs84:"-491,-22,435"},EPSG_4707:{towgs84:"114,-116,-333"},EPSG_4709:{towgs84:"145,75,-272"},EPSG_4712:{towgs84:"-205,107,53"},EPSG_4711:{towgs84:"124,-234,-25"},EPSG_4718:{towgs84:"230,-199,-752"},EPSG_4719:{towgs84:"211,147,111"},EPSG_4724:{towgs84:"208,-435,-229"},EPSG_4725:{towgs84:"189,-79,-202"},EPSG_4735:{towgs84:"647,1777,-1124"},EPSG_4722:{towgs84:"-794,119,-298"},EPSG_4728:{towgs84:"-307,-92,127"},EPSG_4734:{towgs84:"-632,438,-609"},EPSG_4727:{towgs84:"912,-58,1227"},EPSG_4729:{towgs84:"185,165,42"},EPSG_4730:{towgs84:"170,42,84"},EPSG_4733:{towgs84:"276,-57,149"},ESRI_37218:{towgs84:"230,-199,-752"},ESRI_37240:{towgs84:"-7,215,225"},ESRI_37221:{towgs84:"252,-209,-751"},ESRI_4305:{towgs84:"-123,-206,219"},ESRI_104139:{towgs84:"-73,-247,227"},EPSG_4748:{towgs84:"51,391,-36"},EPSG_4219:{towgs84:"-384,664,-48"},EPSG_4255:{towgs84:"-333,-222,114"},EPSG_4257:{towgs84:"-587.8,519.75,145.76"},EPSG_4646:{towgs84:"-963,510,-359"},EPSG_6881:{towgs84:"-24,-203,268"},EPSG_6882:{towgs84:"-183,-15,273"},EPSG_4715:{towgs84:"-104,-129,239"},IGNF_RGF93GDD:{towgs84:"0,0,0"},IGNF_RGM04GDD:{towgs84:"0,0,0"},IGNF_RGSPM06GDD:{towgs84:"0,0,0"},IGNF_RGTAAF07GDD:{towgs84:"0,0,0"},IGNF_RGFG95GDD:{towgs84:"0,0,0"},IGNF_RGNCG:{towgs84:"0,0,0"},IGNF_RGPFGDD:{towgs84:"0,0,0"},IGNF_ETRS89G:{towgs84:"0,0,0"},IGNF_RGR92GDD:{towgs84:"0,0,0"},EPSG_4173:{towgs84:"0,0,0"},EPSG_4180:{towgs84:"0,0,0"},EPSG_4619:{towgs84:"0,0,0"},EPSG_4667:{towgs84:"0,0,0"},EPSG_4075:{towgs84:"0,0,0"},EPSG_6706:{towgs84:"0,0,0"},EPSG_7798:{towgs84:"0,0,0"},EPSG_4661:{towgs84:"0,0,0"},EPSG_4669:{towgs84:"0,0,0"},EPSG_8685:{towgs84:"0,0,0"},EPSG_4151:{towgs84:"0,0,0"},EPSG_9702:{towgs84:"0,0,0"},EPSG_4758:{towgs84:"0,0,0"},EPSG_4761:{towgs84:"0,0,0"},EPSG_4765:{towgs84:"0,0,0"},EPSG_8997:{towgs84:"0,0,0"},EPSG_4023:{towgs84:"0,0,0"},EPSG_4670:{towgs84:"0,0,0"},EPSG_4694:{towgs84:"0,0,0"},EPSG_4148:{towgs84:"0,0,0"},EPSG_4163:{towgs84:"0,0,0"},EPSG_4167:{towgs84:"0,0,0"},EPSG_4189:{towgs84:"0,0,0"},EPSG_4190:{towgs84:"0,0,0"},EPSG_4176:{towgs84:"0,0,0"},EPSG_4659:{towgs84:"0,0,0"},EPSG_3824:{towgs84:"0,0,0"},EPSG_3889:{towgs84:"0,0,0"},EPSG_4046:{towgs84:"0,0,0"},EPSG_4081:{towgs84:"0,0,0"},EPSG_4558:{towgs84:"0,0,0"},EPSG_4483:{towgs84:"0,0,0"},EPSG_5013:{towgs84:"0,0,0"},EPSG_5264:{towgs84:"0,0,0"},EPSG_5324:{towgs84:"0,0,0"},EPSG_5354:{towgs84:"0,0,0"},EPSG_5371:{towgs84:"0,0,0"},EPSG_5373:{towgs84:"0,0,0"},EPSG_5381:{towgs84:"0,0,0"},EPSG_5393:{towgs84:"0,0,0"},EPSG_5489:{towgs84:"0,0,0"},EPSG_5593:{towgs84:"0,0,0"},EPSG_6135:{towgs84:"0,0,0"},EPSG_6365:{towgs84:"0,0,0"},EPSG_5246:{towgs84:"0,0,0"},EPSG_7886:{towgs84:"0,0,0"},EPSG_8431:{towgs84:"0,0,0"},EPSG_8427:{towgs84:"0,0,0"},EPSG_8699:{towgs84:"0,0,0"},EPSG_8818:{towgs84:"0,0,0"},EPSG_4757:{towgs84:"0,0,0"},EPSG_9140:{towgs84:"0,0,0"},EPSG_8086:{towgs84:"0,0,0"},EPSG_4686:{towgs84:"0,0,0"},EPSG_4737:{towgs84:"0,0,0"},EPSG_4702:{towgs84:"0,0,0"},EPSG_4747:{towgs84:"0,0,0"},EPSG_4749:{towgs84:"0,0,0"},EPSG_4674:{towgs84:"0,0,0"},EPSG_4755:{towgs84:"0,0,0"},EPSG_4759:{towgs84:"0,0,0"},EPSG_4762:{towgs84:"0,0,0"},EPSG_4763:{towgs84:"0,0,0"},EPSG_4764:{towgs84:"0,0,0"},EPSG_4166:{towgs84:"0,0,0"},EPSG_4170:{towgs84:"0,0,0"},EPSG_5546:{towgs84:"0,0,0"},EPSG_7844:{towgs84:"0,0,0"},EPSG_4818:{towgs84:"589,76,480"}};for(var cw in Uc){var _d=Uc[cw];_d.datumName&&(Uc[_d.datumName]=_d)}function fw(r,t,e,i,n,s,a){var o={};return r===void 0||r==="none"?o.datum_type=pd:o.datum_type=C1,t&&(o.datum_params=t.map(parseFloat),(o.datum_params[0]!==0||o.datum_params[1]!==0||o.datum_params[2]!==0)&&(o.datum_type=ja),o.datum_params.length>3&&(o.datum_params[3]!==0||o.datum_params[4]!==0||o.datum_params[5]!==0||o.datum_params[6]!==0)&&(o.datum_type=to,o.datum_params[3]*=yh,o.datum_params[4]*=yh,o.datum_params[5]*=yh,o.datum_params[6]=o.datum_params[6]/1e6+1)),a&&(o.datum_type=Pu,o.grids=a),o.a=e,o.b=i,o.es=n,o.ep2=s,o}var wd={};function dw(r,t,e){return t instanceof ArrayBuffer?pw(r,t,e):{ready:gw(r,t)}}function pw(r,t,e){var i=!0;e!==void 0&&e.includeErrorFields===!1&&(i=!1);var n=new DataView(t),s=yw(n),a=_w(n,s),o=ww(n,a,s,i),l={header:a,subgrids:o};return wd[r]=l,l}async function gw(r,t){for(var e=[],i=await t.getImageCount(),n=i-1;n>=0;n--){var s=await t.getImage(n),a=await s.readRasters(),o=a,l=[s.getWidth(),s.getHeight()],u=s.getBoundingBox().map(zm),c=[s.fileDirectory.ModelPixelScale[0],s.fileDirectory.ModelPixelScale[1]].map(zm),h=u[0]+(l[0]-1)*c[0],f=u[3]-(l[1]-1)*c[1],g=o[0],m=o[1],_=[];for(let y=l[1]-1;y>=0;y--)for(let w=l[0]-1;w>=0;w--){var E=y*l[0]+w;_.push([-pa(m[E]),pa(g[E])])}e.push({del:c,lim:l,ll:[-h,f],cvs:_})}var M={header:{nSubgrids:i},subgrids:e};return wd[r]=M,M}function mw(r){if(r===void 0)return null;var t=r.split(",");return t.map(vw)}function vw(r){if(r.length===0)return null;var t=r[0]==="@";return t&&(r=r.slice(1)),r==="null"?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:r,mandatory:!t,grid:wd[r]||null,isNull:!1}}function zm(r){return r*Math.PI/180}function pa(r){return r/3600*Math.PI/180}function yw(r){var t=r.getInt32(8,!1);return t===11?!1:(t=r.getInt32(8,!0),t!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function _w(r,t){return{nFields:r.getInt32(8,t),nSubgridFields:r.getInt32(24,t),nSubgrids:r.getInt32(40,t),shiftType:Ed(r,56,64).trim(),fromSemiMajorAxis:r.getFloat64(120,t),fromSemiMinorAxis:r.getFloat64(136,t),toSemiMajorAxis:r.getFloat64(152,t),toSemiMinorAxis:r.getFloat64(168,t)}}function Ed(r,t,e){return String.fromCharCode.apply(null,new Uint8Array(r.buffer.slice(t,e)))}function ww(r,t,e,i){for(var n=176,s=[],a=0;a<t.nSubgrids;a++){var o=Sw(r,n,e),l=Pw(r,n,o,e,i),u=Math.round(1+(o.upperLongitude-o.lowerLongitude)/o.longitudeInterval),c=Math.round(1+(o.upperLatitude-o.lowerLatitude)/o.latitudeInterval);s.push({ll:[pa(o.lowerLongitude),pa(o.lowerLatitude)],del:[pa(o.longitudeInterval),pa(o.latitudeInterval)],lim:[u,c],count:o.gridNodeCount,cvs:Ew(l)});var h=16;i===!1&&(h=8),n+=176+o.gridNodeCount*h}return s}function Ew(r){return r.map(function(t){return[pa(t.longitudeShift),pa(t.latitudeShift)]})}function Sw(r,t,e){return{name:Ed(r,t+8,t+16).trim(),parent:Ed(r,t+24,t+24+8).trim(),lowerLatitude:r.getFloat64(t+72,e),upperLatitude:r.getFloat64(t+88,e),lowerLongitude:r.getFloat64(t+104,e),upperLongitude:r.getFloat64(t+120,e),latitudeInterval:r.getFloat64(t+136,e),longitudeInterval:r.getFloat64(t+152,e),gridNodeCount:r.getInt32(t+168,e)}}function Pw(r,t,e,i,n){var s=t+176,a=16;n===!1&&(a=8);for(var o=[],l=0;l<e.gridNodeCount;l++){var u={latitudeShift:r.getFloat32(s+l*a,i),longitudeShift:r.getFloat32(s+l*a+4,i)};n!==!1&&(u.latitudeAccuracy=r.getFloat32(s+l*a+8,i),u.longitudeAccuracy=r.getFloat32(s+l*a+12,i)),o.push(u)}return o}function ts(r,t){if(!(this instanceof ts))return new ts(r);t=t||function(u){if(u)throw u};var e=Z1(r);if(typeof e!="object"){t("Could not parse to valid json: "+r);return}var i=ts.projections.get(e.projName);if(!i){t("Could not get projection name from: "+r);return}if(e.datumCode&&e.datumCode!=="none"){var n=da(Uc,e.datumCode);n&&(e.datum_params=e.datum_params||(n.towgs84?n.towgs84.split(","):null),e.ellps=n.ellipse,e.datumName=n.datumName?n.datumName:e.datumCode)}e.k0=e.k0||1,e.axis=e.axis||"enu",e.ellps=e.ellps||"wgs84",e.lat1=e.lat1||e.lat0;var s=hw(e.a,e.b,e.rf,e.ellps,e.sphere),a=uw(s.a,s.b,s.rf,e.R_A),o=mw(e.nadgrids),l=e.datum||fw(e.datumCode,e.datum_params,s.a,s.b,a.es,a.ep2,o);Lm(this,e),Lm(this,i),this.a=s.a,this.b=s.b,this.rf=s.rf,this.sphere=s.sphere,this.es=a.es,this.e=a.e,this.ep2=a.ep2,this.datum=l,this.init(),t(null,this)}ts.projections=ow,ts.projections.start();function Cw(r,t){return r.datum_type!==t.datum_type||r.a!==t.a||Math.abs(r.es-t.es)>5e-11?!1:r.datum_type===ja?r.datum_params[0]===t.datum_params[0]&&r.datum_params[1]===t.datum_params[1]&&r.datum_params[2]===t.datum_params[2]:r.datum_type===to?r.datum_params[0]===t.datum_params[0]&&r.datum_params[1]===t.datum_params[1]&&r.datum_params[2]===t.datum_params[2]&&r.datum_params[3]===t.datum_params[3]&&r.datum_params[4]===t.datum_params[4]&&r.datum_params[5]===t.datum_params[5]&&r.datum_params[6]===t.datum_params[6]:!0}function Vm(r,t,e){var i=r.x,n=r.y,s=r.z?r.z:0,a,o,l,u;if(n<-Q&&n>-1.001*Q)n=-Q;else if(n>Q&&n<1.001*Q)n=Q;else{if(n<-Q)return{x:-1/0,y:-1/0,z:r.z};if(n>Q)return{x:1/0,y:1/0,z:r.z}}return i>Math.PI&&(i-=2*Math.PI),o=Math.sin(n),u=Math.cos(n),l=o*o,a=e/Math.sqrt(1-t*l),{x:(a+s)*u*Math.cos(i),y:(a+s)*u*Math.sin(i),z:(a*(1-t)+s)*o}}function Um(r,t,e,i){var n=1e-12,s=n*n,a=30,o,l,u,c,h,f,g,m,_,E,M,y,w,v=r.x,S=r.y,P=r.z?r.z:0,I,b,D;if(o=Math.sqrt(v*v+S*S),l=Math.sqrt(v*v+S*S+P*P),o/e<n){if(I=0,l/e<n)return b=Q,D=-i,{x:r.x,y:r.y,z:r.z}}else I=Math.atan2(S,v);u=P/l,c=o/l,h=1/Math.sqrt(1-t*(2-t)*c*c),m=c*(1-t)*h,_=u*h,w=0;do w++,g=e/Math.sqrt(1-t*_*_),D=o*m+P*_-g*(1-t*_*_),f=t*g/(g+D),h=1/Math.sqrt(1-f*(2-f)*c*c),E=c*(1-f)*h,M=u*h,y=M*m-E*_,m=E,_=M;while(y*y>s&&w<a);return b=Math.atan(M/Math.abs(E)),{x:I,y:b,z:D}}function Iw(r,t,e){if(t===ja)return{x:r.x+e[0],y:r.y+e[1],z:r.z+e[2]};if(t===to){var i=e[0],n=e[1],s=e[2],a=e[3],o=e[4],l=e[5],u=e[6];return{x:u*(r.x-l*r.y+o*r.z)+i,y:u*(l*r.x+r.y-a*r.z)+n,z:u*(-o*r.x+a*r.y+r.z)+s}}}function Mw(r,t,e){if(t===ja)return{x:r.x-e[0],y:r.y-e[1],z:r.z-e[2]};if(t===to){var i=e[0],n=e[1],s=e[2],a=e[3],o=e[4],l=e[5],u=e[6],c=(r.x-i)/u,h=(r.y-n)/u,f=(r.z-s)/u;return{x:c+l*h-o*f,y:-l*c+h+a*f,z:o*c-a*h+f}}}function qc(r){return r===ja||r===to}function Nw(r,t,e){if(Cw(r,t)||r.datum_type===pd||t.datum_type===pd)return e;var i=r.a,n=r.es;if(r.datum_type===Pu){var s=qm(r,!1,e);if(s!==0)return;i=Em,n=Sm}var a=t.a,o=t.b,l=t.es;if(t.datum_type===Pu&&(a=Em,o=I1,l=Sm),n===l&&i===a&&!qc(r.datum_type)&&!qc(t.datum_type))return e;if(e=Vm(e,n,i),qc(r.datum_type)&&(e=Iw(e,r.datum_type,r.datum_params)),qc(t.datum_type)&&(e=Mw(e,t.datum_type,t.datum_params)),e=Um(e,l,a,o),t.datum_type===Pu){var u=qm(t,!0,e);if(u!==0)return}return e}function qm(r,t,e){if(r.grids===null||r.grids.length===0)return console.log("Grid shift grids not found"),-1;var i={x:-e.x,y:e.y},n={x:Number.NaN,y:Number.NaN},s=[];t:for(var a=0;a<r.grids.length;a++){var o=r.grids[a];if(s.push(o.name),o.isNull){n=i;break}if(o.grid===null){if(o.mandatory)return console.log("Unable to find mandatory grid '"+o.name+"'"),-1;continue}for(var l=o.grid.subgrids,u=0,c=l.length;u<c;u++){var h=l[u],f=(Math.abs(h.del[1])+Math.abs(h.del[0]))/1e4,g=h.ll[0]-f,m=h.ll[1]-f,_=h.ll[0]+(h.lim[0]-1)*h.del[0]+f,E=h.ll[1]+(h.lim[1]-1)*h.del[1]+f;if(!(m>i.y||g>i.x||E<i.y||_<i.x)&&(n=bw(i,t,h),!isNaN(n.x)))break t}}return isNaN(n.x)?(console.log("Failed to find a grid shift table for location '"+-i.x*$n+" "+i.y*$n+" tried: '"+s+"'"),-1):(e.x=-n.x,e.y=n.y,0)}function bw(r,t,e){var i={x:Number.NaN,y:Number.NaN};if(isNaN(r.x))return i;var n={x:r.x,y:r.y};n.x-=e.ll[0],n.y-=e.ll[1],n.x=ht(n.x-Math.PI)+Math.PI;var s=Wm(n,e);if(t){if(isNaN(s.x))return i;s.x=n.x-s.x,s.y=n.y-s.y;var a=9,o=1e-12,l,u;do{if(u=Wm(s,e),isNaN(u.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}l={x:n.x-(u.x+s.x),y:n.y-(u.y+s.y)},s.x+=l.x,s.y+=l.y}while(a--&&Math.abs(l.x)>o&&Math.abs(l.y)>o);if(a<0)return console.log("Inverse grid shift iterator failed to converge."),i;i.x=ht(s.x+e.ll[0]),i.y=s.y+e.ll[1]}else isNaN(s.x)||(i.x=r.x+s.x,i.y=r.y+s.y);return i}function Wm(r,t){var e={x:r.x/t.del[0],y:r.y/t.del[1]},i={x:Math.floor(e.x),y:Math.floor(e.y)},n={x:e.x-1*i.x,y:e.y-1*i.y},s={x:Number.NaN,y:Number.NaN},a;if(i.x<0||i.x>=t.lim[0]||i.y<0||i.y>=t.lim[1])return s;a=i.y*t.lim[0]+i.x;var o={x:t.cvs[a][0],y:t.cvs[a][1]};a++;var l={x:t.cvs[a][0],y:t.cvs[a][1]};a+=t.lim[0];var u={x:t.cvs[a][0],y:t.cvs[a][1]};a--;var c={x:t.cvs[a][0],y:t.cvs[a][1]},h=n.x*n.y,f=n.x*(1-n.y),g=(1-n.x)*(1-n.y),m=(1-n.x)*n.y;return s.x=g*o.x+f*l.x+m*c.x+h*u.x,s.y=g*o.y+f*l.y+m*c.y+h*u.y,s}function Hm(r,t,e){var i=e.x,n=e.y,s=e.z||0,a,o,l,u={};for(l=0;l<3;l++)if(!(t&&l===2&&e.z===void 0))switch(l===0?(a=i,"ew".indexOf(r.axis[l])!==-1?o="x":o="y"):l===1?(a=n,"ns".indexOf(r.axis[l])!==-1?o="y":o="x"):(a=s,o="z"),r.axis[l]){case"e":u[o]=a;break;case"w":u[o]=-a;break;case"n":u[o]=a;break;case"s":u[o]=-a;break;case"u":e[o]!==void 0&&(u.z=a);break;case"d":e[o]!==void 0&&(u.z=-a);break;default:return null}return u}function Xm(r){var t={x:r[0],y:r[1]};return r.length>2&&(t.z=r[2]),r.length>3&&(t.m=r[3]),t}function Tw(r){Ym(r.x),Ym(r.y)}function Ym(r){if(typeof Number.isFinite=="function"){if(Number.isFinite(r))return;throw new TypeError("coordinates must be finite numbers")}if(typeof r!="number"||r!==r||!isFinite(r))throw new TypeError("coordinates must be finite numbers")}function Dw(r,t){return(r.datum.datum_type===ja||r.datum.datum_type===to||r.datum.datum_type===Pu)&&t.datumCode!=="WGS84"||(t.datum.datum_type===ja||t.datum.datum_type===to||t.datum.datum_type===Pu)&&r.datumCode!=="WGS84"}function Wc(r,t,e,i){var n;Array.isArray(e)?e=Xm(e):e={x:e.x,y:e.y,z:e.z,m:e.m};var s=e.z!==void 0;if(Tw(e),r.datum&&t.datum&&Dw(r,t)&&(n=new ts("WGS84"),e=Wc(r,n,e,i),r=n),i&&r.axis!=="enu"&&(e=Hm(r,!1,e)),r.projName==="longlat")e={x:e.x*de,y:e.y*de,z:e.z||0};else if(r.to_meter&&(e={x:e.x*r.to_meter,y:e.y*r.to_meter,z:e.z||0}),e=r.inverse(e),!e)return;if(r.from_greenwich&&(e.x+=r.from_greenwich),e=Nw(r.datum,t.datum,e),!!e)return t.from_greenwich&&(e={x:e.x-t.from_greenwich,y:e.y,z:e.z||0}),t.projName==="longlat"?e={x:e.x*$n,y:e.y*$n,z:e.z||0}:(e=t.forward(e),t.to_meter&&(e={x:e.x/t.to_meter,y:e.y/t.to_meter,z:e.z||0})),i&&t.axis!=="enu"?Hm(t,!0,e):(e&&!s&&delete e.z,e)}var Jm=ts("WGS84");function Sd(r,t,e,i){var n,s,a;return Array.isArray(e)?(n=Wc(r,t,e,i)||{x:NaN,y:NaN},e.length>2?typeof r.name<"u"&&r.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"?typeof n.z=="number"?[n.x,n.y,n.z].concat(e.slice(3)):[n.x,n.y,e[2]].concat(e.slice(3)):[n.x,n.y].concat(e.slice(2)):[n.x,n.y]):(s=Wc(r,t,e,i),a=Object.keys(e),a.length===2||a.forEach(function(o){if(typeof r.name<"u"&&r.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"){if(o==="x"||o==="y"||o==="z")return}else if(o==="x"||o==="y")return;s[o]=e[o]}),s)}function Km(r){return r instanceof ts?r:r.oProj?r.oProj:ts(r)}function ai(r,t,e){r=Km(r);var i=!1,n;return typeof t>"u"?(t=r,r=Jm,i=!0):(typeof t.x<"u"||Array.isArray(t))&&(e=t,t=r,r=Jm,i=!0),t=Km(t),e?Sd(r,t,e):(n={forward:function(s,a){return Sd(r,t,s,a)},inverse:function(s,a){return Sd(t,r,s,a)}},i&&(n.oProj=t),n)}var Qm=6,Zm="AJSAJS",Bm="AFAFAF",Mu=65,oi=73,rn=79,Ph=86,Ch=90;const xw={forward:$m,inverse:Ow,toPoint:jm};function $m(r,t){return t=t||5,Rw(Aw({lat:r[1],lon:r[0]}),t)}function Ow(r){var t=Cd(r0(r.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]}function jm(r){var t=Cd(r0(r.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function Pd(r){return r*(Math.PI/180)}function t0(r){return 180*(r/Math.PI)}function Aw(r){var t=r.lat,e=r.lon,i=6378137,n=.00669438,s=.9996,a,o,l,u,c,h,f,g=Pd(t),m=Pd(e),_,E;E=Math.floor((e+180)/6)+1,e===180&&(E=60),t>=56&&t<64&&e>=3&&e<12&&(E=32),t>=72&&t<84&&(e>=0&&e<9?E=31:e>=9&&e<21?E=33:e>=21&&e<33?E=35:e>=33&&e<42&&(E=37)),a=(E-1)*6-180+3,_=Pd(a),o=n/(1-n),l=i/Math.sqrt(1-n*Math.sin(g)*Math.sin(g)),u=Math.tan(g)*Math.tan(g),c=o*Math.cos(g)*Math.cos(g),h=Math.cos(g)*(m-_),f=i*((1-n/4-3*n*n/64-5*n*n*n/256)*g-(3*n/8+3*n*n/32+45*n*n*n/1024)*Math.sin(2*g)+(15*n*n/256+45*n*n*n/1024)*Math.sin(4*g)-35*n*n*n/3072*Math.sin(6*g));var M=s*l*(h+(1-u+c)*h*h*h/6+(5-18*u+u*u+72*c-58*o)*h*h*h*h*h/120)+5e5,y=s*(f+l*Math.tan(g)*(h*h/2+(5-u+9*c+4*c*c)*h*h*h*h/24+(61-58*u+u*u+600*c-330*o)*h*h*h*h*h*h/720));return t<0&&(y+=1e7),{northing:Math.round(y),easting:Math.round(M),zoneNumber:E,zoneLetter:Lw(t)}}function Cd(r){var t=r.northing,e=r.easting,i=r.zoneLetter,n=r.zoneNumber;if(n<0||n>60)return null;var s=.9996,a=6378137,o=.00669438,l,u=(1-Math.sqrt(1-o))/(1+Math.sqrt(1-o)),c,h,f,g,m,_,E,M,y,w=e-5e5,v=t;i<"N"&&(v-=1e7),E=(n-1)*6-180+3,l=o/(1-o),_=v/s,M=_/(a*(1-o/4-3*o*o/64-5*o*o*o/256)),y=M+(3*u/2-27*u*u*u/32)*Math.sin(2*M)+(21*u*u/16-55*u*u*u*u/32)*Math.sin(4*M)+151*u*u*u/96*Math.sin(6*M),c=a/Math.sqrt(1-o*Math.sin(y)*Math.sin(y)),h=Math.tan(y)*Math.tan(y),f=l*Math.cos(y)*Math.cos(y),g=a*(1-o)/Math.pow(1-o*Math.sin(y)*Math.sin(y),1.5),m=w/(c*s);var S=y-c*Math.tan(y)/g*(m*m/2-(5+3*h+10*f-4*f*f-9*l)*m*m*m*m/24+(61+90*h+298*f+45*h*h-252*l-3*f*f)*m*m*m*m*m*m/720);S=t0(S);var P=(m-(1+2*h+f)*m*m*m/6+(5-2*f+28*h-3*f*f+8*l+24*h*h)*m*m*m*m*m/120)/Math.cos(y);P=E+t0(P);var I;if(r.accuracy){var b=Cd({northing:r.northing+r.accuracy,easting:r.easting+r.accuracy,zoneLetter:r.zoneLetter,zoneNumber:r.zoneNumber});I={top:b.lat,right:b.lon,bottom:S,left:P}}else I={lat:S,lon:P};return I}function Lw(r){var t="Z";return 84>=r&&r>=72?t="X":72>r&&r>=64?t="W":64>r&&r>=56?t="V":56>r&&r>=48?t="U":48>r&&r>=40?t="T":40>r&&r>=32?t="S":32>r&&r>=24?t="R":24>r&&r>=16?t="Q":16>r&&r>=8?t="P":8>r&&r>=0?t="N":0>r&&r>=-8?t="M":-8>r&&r>=-16?t="L":-16>r&&r>=-24?t="K":-24>r&&r>=-32?t="J":-32>r&&r>=-40?t="H":-40>r&&r>=-48?t="G":-48>r&&r>=-56?t="F":-56>r&&r>=-64?t="E":-64>r&&r>=-72?t="D":-72>r&&r>=-80&&(t="C"),t}function Rw(r,t){var e="00000"+r.easting,i="00000"+r.northing;return r.zoneNumber+r.zoneLetter+Fw(r.easting,r.northing,r.zoneNumber)+e.substr(e.length-5,t)+i.substr(i.length-5,t)}function Fw(r,t,e){var i=e0(e),n=Math.floor(r/1e5),s=Math.floor(t/1e5)%20;return Gw(n,s,i)}function e0(r){var t=r%Qm;return t===0&&(t=Qm),t}function Gw(r,t,e){var i=e-1,n=Zm.charCodeAt(i),s=Bm.charCodeAt(i),a=n+r-1,o=s+t,l=!1;a>Ch&&(a=a-Ch+Mu-1,l=!0),(a===oi||n<oi&&a>oi||(a>oi||n<oi)&&l)&&a++,(a===rn||n<rn&&a>rn||(a>rn||n<rn)&&l)&&(a++,a===oi&&a++),a>Ch&&(a=a-Ch+Mu-1),o>Ph?(o=o-Ph+Mu-1,l=!0):l=!1,(o===oi||s<oi&&o>oi||(o>oi||s<oi)&&l)&&o++,(o===rn||s<rn&&o>rn||(o>rn||s<rn)&&l)&&(o++,o===oi&&o++),o>Ph&&(o=o-Ph+Mu-1);var u=String.fromCharCode(a)+String.fromCharCode(o);return u}function r0(r){if(r&&r.length===0)throw"MGRSPoint coverting from nothing";for(var t=r.length,e=null,i="",n,s=0;!/[A-Z]/.test(n=r.charAt(s));){if(s>=2)throw"MGRSPoint bad conversion from: "+r;i+=n,s++}var a=parseInt(i,10);if(s===0||s+3>t)throw"MGRSPoint bad conversion from: "+r;var o=r.charAt(s++);if(o<="A"||o==="B"||o==="Y"||o>="Z"||o==="I"||o==="O")throw"MGRSPoint zone letter "+o+" not handled: "+r;e=r.substring(s,s+=2);for(var l=e0(a),u=kw(e.charAt(0),l),c=zw(e.charAt(1),l);c<Vw(o);)c+=2e6;var h=t-s;if(h%2!==0)throw`MGRSPoint has to have an even number
28
28
  of digits after the zone letter and two 100km letters - front
29
29
  half for easting meters, second half for
30
- northing meters`+r;var f=h/2,g=0,m=0,_,E,M,y,w;return f>0&&(_=1e5/Math.pow(10,f),E=r.substring(s,s+f),g=parseFloat(E)*_,M=r.substring(s+f),m=parseFloat(M)*_),y=g+u,w=m+c,{easting:y,northing:w,zoneLetter:o,zoneNumber:a,accuracy:_}}function kw(r,t){for(var e=Zm.charCodeAt(t-1),i=1e5,n=!1;e!==r.charCodeAt(0);){if(e++,e===oi&&e++,e===rn&&e++,e>Ch){if(n)throw"Bad character: "+r;e=Mu,n=!0}i+=1e5}return i}function zw(r,t){if(r>"V")throw"MGRSPoint given invalid Northing "+r;for(var e=Bm.charCodeAt(t-1),i=0,n=!1;e!==r.charCodeAt(0);){if(e++,e===oi&&e++,e===rn&&e++,e>Ph){if(n)throw"Bad character: "+r;e=Mu,n=!0}i+=1e5}return i}function Vw(r){var t;switch(r){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+r}function Nu(r,t,e){if(!(this instanceof Nu))return new Nu(r,t,e);if(Array.isArray(r))this.x=r[0],this.y=r[1],this.z=r[2]||0;else if(typeof r=="object")this.x=r.x,this.y=r.y,this.z=r.z||0;else if(typeof r=="string"&&typeof t>"u"){var i=r.split(",");this.x=parseFloat(i[0],10),this.y=parseFloat(i[1],10),this.z=parseFloat(i[2],10)||0}else this.x=r,this.y=t,this.z=e||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Nu.fromMGRS=function(r){return new Nu(jm(r))},Nu.prototype.toMGRS=function(r){return $m([this.x,this.y],r)};var Uw=1,qw=.25,i0=.046875,n0=.01953125,s0=.01068115234375,Ww=.75,Hw=.46875,Xw=.013020833333333334,Yw=.007120768229166667,Jw=.3645833333333333,Kw=.005696614583333333,Qw=.3076171875;function Id(r){var t=[];t[0]=Uw-r*(qw+r*(i0+r*(n0+r*s0))),t[1]=r*(Ww-r*(i0+r*(n0+r*s0)));var e=r*r;return t[2]=e*(Hw-r*(Xw+r*Yw)),e*=r,t[3]=e*(Jw-r*Kw),t[4]=e*r*Qw,t}function bu(r,t,e,i){return e*=t,t*=t,i[0]*r-e*(i[1]+t*(i[2]+t*(i[3]+t*i[4])))}var Zw=20;function Md(r,t,e){for(var i=1/(1-t),n=r,s=Zw;s;--s){var a=Math.sin(n),o=1-t*a*a;if(o=(bu(n,a,Math.cos(n),e)-r)*(o*Math.sqrt(o))*i,n-=o,Math.abs(o)<st)return n}return n}function Bw(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=Id(this.es),this.ml0=bu(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function $w(r){var t=r.x,e=r.y,i=ht(t-this.long0),n,s,a,o=Math.sin(e),l=Math.cos(e);if(this.es){var c=l*i,h=Math.pow(c,2),f=this.ep2*Math.pow(l,2),g=Math.pow(f,2),m=Math.abs(l)>st?Math.tan(e):0,_=Math.pow(m,2),E=Math.pow(_,2);n=1-this.es*Math.pow(o,2),c=c/Math.sqrt(n);var M=bu(e,o,l,this.en);s=this.a*(this.k0*c*(1+h/6*(1-_+f+h/20*(5-18*_+E+14*f-58*_*f+h/42*(61+179*E-E*_-479*_)))))+this.x0,a=this.a*(this.k0*(M-this.ml0+o*i*c/2*(1+h/12*(5-_+9*f+4*g+h/30*(61+E-58*_+270*f-330*_*f+h/56*(1385+543*E-E*_-3111*_))))))+this.y0}else{var u=l*Math.sin(i);if(Math.abs(Math.abs(u)-1)<st)return 93;if(s=.5*this.a*this.k0*Math.log((1+u)/(1-u))+this.x0,a=l*Math.cos(i)/Math.sqrt(1-Math.pow(u,2)),u=Math.abs(a),u>=1){if(u-1>st)return 93;a=0}else a=Math.acos(a);e<0&&(a=-a),a=this.a*this.k0*(a-this.lat0)+this.y0}return r.x=s,r.y=a,r}function jw(r){var t,e,i,n,s=(r.x-this.x0)*(1/this.a),a=(r.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+a/this.k0,e=Md(t,this.es,this.en),Math.abs(e)<Q){var h=Math.sin(e),f=Math.cos(e),g=Math.abs(f)>st?Math.tan(e):0,m=this.ep2*Math.pow(f,2),_=Math.pow(m,2),E=Math.pow(g,2),M=Math.pow(E,2);t=1-this.es*Math.pow(h,2);var y=s*Math.sqrt(t)/this.k0,w=Math.pow(y,2);t=t*g,i=e-t*w/(1-this.es)*.5*(1-w/12*(5+3*E-9*m*E+m-4*_-w/30*(61+90*E-252*m*E+45*M+46*m-w/56*(1385+3633*E+4095*M+1574*M*E)))),n=ht(this.long0+y*(1-w/6*(1+2*E+m-w/20*(5+28*E+24*M+8*m*E+6*m-w/42*(61+662*E+1320*M+720*M*E))))/f)}else i=Q*Eh(a),n=0;else{var o=Math.exp(s/this.k0),l=.5*(o-1/o),u=this.lat0+a/this.k0,c=Math.cos(u);t=Math.sqrt((1-Math.pow(c,2))/(1+Math.pow(l,2))),i=Math.asin(t),a<0&&(i=-i),l===0&&c===0?n=0:n=ht(Math.atan2(l,c)+this.long0)}return r.x=n,r.y=i,r}var tE=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const Hc={init:Bw,forward:$w,inverse:jw,names:tE};function a0(r){var t=Math.exp(r);return t=(t-1/t)/2,t}function li(r,t){r=Math.abs(r),t=Math.abs(t);var e=Math.max(r,t),i=Math.min(r,t)/(e||1);return e*Math.sqrt(1+Math.pow(i,2))}function eE(r){var t=1+r,e=t-1;return e===0?r:r*Math.log(t)/e}function rE(r){var t=Math.abs(r);return t=eE(t*(1+t/(li(1,t)+1))),r<0?-t:t}function Nd(r,t){for(var e=2*Math.cos(2*t),i=r.length-1,n=r[i],s=0,a;--i>=0;)a=-s+e*n+r[i],s=n,n=a;return t+a*Math.sin(2*t)}function iE(r,t){for(var e=2*Math.cos(t),i=r.length-1,n=r[i],s=0,a;--i>=0;)a=-s+e*n+r[i],s=n,n=a;return Math.sin(t)*a}function nE(r){var t=Math.exp(r);return t=(t+1/t)/2,t}function o0(r,t,e){for(var i=Math.sin(t),n=Math.cos(t),s=a0(e),a=nE(e),o=2*n*a,l=-2*i*s,u=r.length-1,c=r[u],h=0,f=0,g=0,m,_;--u>=0;)m=f,_=h,f=c,h=g,c=-m+o*f-l*h+r[u],g=-_+l*f+o*h;return o=i*a,l=n*s,[o*c-l*g,o*g+l*c]}function sE(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Hc.init.apply(this),this.forward=Hc.forward,this.inverse=Hc.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var r=this.es/(1+Math.sqrt(1-this.es)),t=r/(2-r),e=t;this.cgb[0]=t*(2+t*(-.6666666666666666+t*(-2+t*(2.577777777777778+t*(.5777777777777777+t*-4.228148148148148))))),this.cbg[0]=t*(-2+t*(.6666666666666666+t*(1.3333333333333333+t*(-1.8222222222222222+t*(.7111111111111111+t*.9824338624338624))))),e=e*t,this.cgb[1]=e*(2.3333333333333335+t*(-1.6+t*(-5.044444444444444+t*(8.584126984126984+t*2.458201058201058)))),this.cbg[1]=e*(1.6666666666666667+t*(-1.0666666666666667+t*(-1.4444444444444444+t*(2.86984126984127+t*-1.6105820105820106)))),e=e*t,this.cgb[2]=e*(3.7333333333333334+t*(-3.8857142857142857+t*(-12.019047619047619+t*26.03668430335097))),this.cbg[2]=e*(-1.7333333333333334+t*(1.619047619047619+t*(1.6+t*-4.474779541446208))),e=e*t,this.cgb[3]=e*(6.792063492063492+t*(-9.485714285714286+t*-28.188500881834216)),this.cbg[3]=e*(1.9634920634920634+t*(-2.4+t*-1.7518165784832451)),e=e*t,this.cgb[4]=e*(13.250793650793652+t*-23.22238255571589),this.cbg[4]=e*(-2.3301587301587303+t*3.5144460477793813),e=e*t,this.cgb[5]=e*27.011268237934903,this.cbg[5]=e*2.8496841430174764,e=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+e*(.25+e*(.015625+e/256))),this.utg[0]=t*(-.5+t*(.6666666666666666+t*(-.3854166666666667+t*(.002777777777777778+t*(.158203125+t*-.15905919312169312))))),this.gtu[0]=t*(.5+t*(-.6666666666666666+t*(.3125+t*(.22777777777777777+t*(-.4409722222222222+t*.20875661375661375))))),this.utg[1]=e*(-.020833333333333332+t*(-.06666666666666667+t*(.3034722222222222+t*(-.4380952380952381+t*.2890188388723545)))),this.gtu[1]=e*(.2708333333333333+t*(-.6+t*(.38680555555555557+t*(.44603174603174606+t*-1.0248393063822752)))),e=e*t,this.utg[2]=e*(-.035416666666666666+t*(.04404761904761905+t*(.046651785714285715+t*-.06138668430335097))),this.gtu[2]=e*(.25416666666666665+t*(-.7357142857142858+t*(.5603050595238095+t*.9237378747795415))),e=e*t,this.utg[3]=e*(-.02726314484126984+t*(.021825396825396824+t*.11439745921516754)),this.gtu[3]=e*(.30729786706349205+t*(-1.0654761904761905+t*.9096203979276896)),e=e*t,this.utg[4]=e*(-.02841641865079365+t*.027268468414301746),this.gtu[4]=e*(.4306671626984127+t*-1.713007555715889),e=e*t,this.utg[5]=e*-.03233083094085698,this.gtu[5]=e*.6650675310896665;var i=Nd(this.cbg,this.lat0);this.Zb=-this.Qn*(i+iE(this.gtu,2*i))}function aE(r){var t=ht(r.x-this.long0),e=r.y;e=Nd(this.cbg,e);var i=Math.sin(e),n=Math.cos(e),s=Math.sin(t),a=Math.cos(t);e=Math.atan2(i,a*n),t=Math.atan2(s*n,li(i,n*a)),t=rE(Math.tan(t));var o=o0(this.gtu,2*e,2*t);e=e+o[0],t=t+o[1];var l,u;return Math.abs(t)<=2.623395162778?(l=this.a*(this.Qn*t)+this.x0,u=this.a*(this.Qn*e+this.Zb)+this.y0):(l=1/0,u=1/0),r.x=l,r.y=u,r}function oE(r){var t=(r.x-this.x0)*(1/this.a),e=(r.y-this.y0)*(1/this.a);e=(e-this.Zb)/this.Qn,t=t/this.Qn;var i,n;if(Math.abs(t)<=2.623395162778){var s=o0(this.utg,2*e,2*t);e=e+s[0],t=t+s[1],t=Math.atan(a0(t));var a=Math.sin(e),o=Math.cos(e),l=Math.sin(t),u=Math.cos(t);e=Math.atan2(a*u,li(l,u*o)),t=Math.atan2(l,u*o),i=ht(t+this.long0),n=Nd(this.cgb,e)}else i=1/0,n=1/0;return r.x=i,r.y=n,r}var lE=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const Xc={init:sE,forward:aE,inverse:oE,names:lE};function uE(r,t){if(r===void 0){if(r=Math.floor((ht(t)+Math.PI)*30/Math.PI)+1,r<0)return 0;if(r>60)return 60}return r}var hE="etmerc";function cE(){var r=uE(this.zone,this.long0);if(r===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(r)-183)*de,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Xc.init.apply(this),this.forward=Xc.forward,this.inverse=Xc.inverse}var fE=["Universal Transverse Mercator System","utm"];const dE={init:cE,names:fE,dependsOn:hE};function bd(r,t){return Math.pow((1-r)/(1+r),t)}var pE=20;function gE(){var r=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*r*r),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(r/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+ee)/(Math.pow(Math.tan(.5*this.lat0+ee),this.C)*bd(this.e*r,this.ratexp))}function mE(r){var t=r.x,e=r.y;return r.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*e+ee),this.C)*bd(this.e*Math.sin(e),this.ratexp))-Q,r.x=this.C*t,r}function vE(r){for(var t=1e-14,e=r.x/this.C,i=r.y,n=Math.pow(Math.tan(.5*i+ee)/this.K,1/this.C),s=pE;s>0&&(i=2*Math.atan(n*bd(this.e*Math.sin(r.y),-.5*this.e))-Q,!(Math.abs(i-r.y)<t));--s)r.y=i;return s?(r.x=e,r.y=i,r):null}const Td={init:gE,forward:mE,inverse:vE};function yE(){Td.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function _E(r){var t,e,i,n;return r.x=ht(r.x-this.long0),Td.forward.apply(this,[r]),t=Math.sin(r.y),e=Math.cos(r.y),i=Math.cos(r.x),n=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*e*i),r.x=n*e*Math.sin(r.x),r.y=n*(this.cosc0*t-this.sinc0*e*i),r.x=this.a*r.x+this.x0,r.y=this.a*r.y+this.y0,r}function wE(r){var t,e,i,n,s;if(r.x=(r.x-this.x0)/this.a,r.y=(r.y-this.y0)/this.a,r.x/=this.k0,r.y/=this.k0,s=li(r.x,r.y)){var a=2*Math.atan2(s,this.R2);t=Math.sin(a),e=Math.cos(a),n=Math.asin(e*this.sinc0+r.y*t*this.cosc0/s),i=Math.atan2(r.x*t,s*this.cosc0*e-r.y*this.sinc0*t)}else n=this.phic0,i=0;return r.x=i,r.y=n,Td.inverse.apply(this,[r]),r.x=ht(r.x+this.long0),r}var EE=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const SE={init:yE,forward:_E,inverse:wE,names:EE};function PE(r,t,e){return t*=e,Math.tan(.5*(Q+r))*Math.pow((1-t)/(1+t),.5*e)}function CE(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=st&&(this.k0=.5*(1+Eh(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=st&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=st&&Math.abs(Math.cos(this.lat_ts))>st&&(this.k0=.5*this.cons*jn(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Nn(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=jn(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-Q,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function IE(r){var t=r.x,e=r.y,i=Math.sin(e),n=Math.cos(e),s,a,o,l,u,c,h=ht(t-this.long0);return Math.abs(Math.abs(t-this.long0)-Math.PI)<=st&&Math.abs(e+this.lat0)<=st?(r.x=NaN,r.y=NaN,r):this.sphere?(s=2*this.k0/(1+this.sinlat0*i+this.coslat0*n*Math.cos(h)),r.x=this.a*s*n*Math.sin(h)+this.x0,r.y=this.a*s*(this.coslat0*i-this.sinlat0*n*Math.cos(h))+this.y0,r):(a=2*Math.atan(this.ssfn_(e,i,this.e))-Q,l=Math.cos(a),o=Math.sin(a),Math.abs(this.coslat0)<=st?(u=Nn(this.e,e*this.con,this.con*i),c=2*this.a*this.k0*u/this.cons,r.x=this.x0+c*Math.sin(t-this.long0),r.y=this.y0-this.con*c*Math.cos(t-this.long0),r):(Math.abs(this.sinlat0)<st?(s=2*this.a*this.k0/(1+l*Math.cos(h)),r.y=s*o):(s=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*o+this.cosX0*l*Math.cos(h))),r.y=s*(this.cosX0*o-this.sinX0*l*Math.cos(h))+this.y0),r.x=s*l*Math.sin(h)+this.x0,r))}function ME(r){r.x-=this.x0,r.y-=this.y0;var t,e,i,n,s,a=Math.sqrt(r.x*r.x+r.y*r.y);if(this.sphere){var o=2*Math.atan(a/(2*this.a*this.k0));return t=this.long0,e=this.lat0,a<=st?(r.x=t,r.y=e,r):(e=Math.asin(Math.cos(o)*this.sinlat0+r.y*Math.sin(o)*this.coslat0/a),Math.abs(this.coslat0)<st?this.lat0>0?t=ht(this.long0+Math.atan2(r.x,-1*r.y)):t=ht(this.long0+Math.atan2(r.x,r.y)):t=ht(this.long0+Math.atan2(r.x*Math.sin(o),a*this.coslat0*Math.cos(o)-r.y*this.sinlat0*Math.sin(o))),r.x=t,r.y=e,r)}else if(Math.abs(this.coslat0)<=st){if(a<=st)return e=this.lat0,t=this.long0,r.x=t,r.y=e,r;r.x*=this.con,r.y*=this.con,i=a*this.cons/(2*this.a*this.k0),e=this.con*Sh(this.e,i),t=this.con*ht(this.con*this.long0+Math.atan2(r.x,-1*r.y))}else n=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,a<=st?s=this.X0:(s=Math.asin(Math.cos(n)*this.sinX0+r.y*Math.sin(n)*this.cosX0/a),t=ht(this.long0+Math.atan2(r.x*Math.sin(n),a*this.cosX0*Math.cos(n)-r.y*this.sinX0*Math.sin(n)))),e=-1*Sh(this.e,Math.tan(.5*(Q+s)));return r.x=t,r.y=e,r}var NE=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"];const bE={init:CE,forward:IE,inverse:ME,names:NE,ssfn_:PE};function TE(){var r=this.lat0;this.lambda0=this.long0;var t=Math.sin(r),e=this.a,i=this.rf,n=1/i,s=2*n-Math.pow(n,2),a=this.e=Math.sqrt(s);this.R=this.k0*e*Math.sqrt(1-s)/(1-s*Math.pow(t,2)),this.alpha=Math.sqrt(1+s/(1-s)*Math.pow(Math.cos(r),4)),this.b0=Math.asin(t/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),l=Math.log(Math.tan(Math.PI/4+r/2)),u=Math.log((1+a*t)/(1-a*t));this.K=o-this.alpha*l+this.alpha*a/2*u}function DE(r){var t=Math.log(Math.tan(Math.PI/4-r.y/2)),e=this.e/2*Math.log((1+this.e*Math.sin(r.y))/(1-this.e*Math.sin(r.y))),i=-this.alpha*(t+e)+this.K,n=2*(Math.atan(Math.exp(i))-Math.PI/4),s=this.alpha*(r.x-this.lambda0),a=Math.atan(Math.sin(s)/(Math.sin(this.b0)*Math.tan(n)+Math.cos(this.b0)*Math.cos(s))),o=Math.asin(Math.cos(this.b0)*Math.sin(n)-Math.sin(this.b0)*Math.cos(n)*Math.cos(s));return r.y=this.R/2*Math.log((1+Math.sin(o))/(1-Math.sin(o)))+this.y0,r.x=this.R*a+this.x0,r}function xE(r){for(var t=r.x-this.x0,e=r.y-this.y0,i=t/this.R,n=2*(Math.atan(Math.exp(e/this.R))-Math.PI/4),s=Math.asin(Math.cos(this.b0)*Math.sin(n)+Math.sin(this.b0)*Math.cos(n)*Math.cos(i)),a=Math.atan(Math.sin(i)/(Math.cos(this.b0)*Math.cos(i)-Math.sin(this.b0)*Math.tan(n))),o=this.lambda0+a/this.alpha,l=0,u=s,c=-1e3,h=0;Math.abs(u-c)>1e-7;){if(++h>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+s/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(u))/2)),c=u,u=2*Math.atan(Math.exp(l))-Math.PI/2}return r.x=o,r.y=u,r}var OE=["somerc"];const AE={init:TE,forward:DE,inverse:xE,names:OE};var Tu=1e-7;function LE(r){var t=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],e=typeof r.projName=="object"?Object.keys(r.projName)[0]:r.projName;return"no_uoff"in r||"no_off"in r||t.indexOf(e)!==-1||t.indexOf(Gm(e))!==-1}function RE(){var r,t,e,i,n,s,a,o,l,u,c=0,h,f=0,g=0,m=0,_=0,E=0,M=0;this.no_off=LE(this),this.no_rot="no_rot"in this;var y=!1;"alpha"in this&&(y=!0);var w=!1;if("rectified_grid_angle"in this&&(w=!0),y&&(M=this.alpha),w&&(c=this.rectified_grid_angle),y||w)f=this.longc;else if(g=this.long1,_=this.lat1,m=this.long2,E=this.lat2,Math.abs(_-E)<=Tu||(r=Math.abs(_))<=Tu||Math.abs(r-Q)<=Tu||Math.abs(Math.abs(this.lat0)-Q)<=Tu||Math.abs(Math.abs(E)-Q)<=Tu)throw new Error;var v=1-this.es;t=Math.sqrt(v),Math.abs(this.lat0)>st?(o=Math.sin(this.lat0),e=Math.cos(this.lat0),r=1-this.es*o*o,this.B=e*e,this.B=Math.sqrt(1+this.es*this.B*this.B/v),this.A=this.B*this.k0*t/r,i=this.B*t/(e*Math.sqrt(r)),n=i*i-1,n<=0?n=0:(n=Math.sqrt(n),this.lat0<0&&(n=-n)),this.E=n+=i,this.E*=Math.pow(Nn(this.e,this.lat0,o),this.B)):(this.B=1/t,this.A=this.k0,this.E=i=n=1),y||w?(y?(h=Math.asin(Math.sin(M)/i),w||(c=M)):(h=c,M=Math.asin(i*Math.sin(h))),this.lam0=f-Math.asin(.5*(n-1/n)*Math.tan(h))/this.B):(s=Math.pow(Nn(this.e,_,Math.sin(_)),this.B),a=Math.pow(Nn(this.e,E,Math.sin(E)),this.B),n=this.E/s,l=(a-s)/(a+s),u=this.E*this.E,u=(u-a*s)/(u+a*s),r=g-m,r<-Math.pi?m-=_h:r>Math.pi&&(m+=_h),this.lam0=ht(.5*(g+m)-Math.atan(u*Math.tan(.5*this.B*(g-m))/l)/this.B),h=Math.atan(2*Math.sin(this.B*ht(g-this.lam0))/(n-1/n)),c=M=Math.asin(i*Math.sin(h))),this.singam=Math.sin(h),this.cosgam=Math.cos(h),this.sinrot=Math.sin(c),this.cosrot=Math.cos(c),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(i*i-1)/Math.cos(M))),this.lat0<0&&(this.u_0=-this.u_0)),n=.5*h,this.v_pole_n=this.ArB*Math.log(Math.tan(ee-n)),this.v_pole_s=this.ArB*Math.log(Math.tan(ee+n))}function FE(r){var t={},e,i,n,s,a,o,l,u;if(r.x=r.x-this.lam0,Math.abs(Math.abs(r.y)-Q)>st){if(a=this.E/Math.pow(Nn(this.e,r.y,Math.sin(r.y)),this.B),o=1/a,e=.5*(a-o),i=.5*(a+o),s=Math.sin(this.B*r.x),n=(e*this.singam-s*this.cosgam)/i,Math.abs(Math.abs(n)-1)<st)throw new Error;u=.5*this.ArB*Math.log((1-n)/(1+n)),o=Math.cos(this.B*r.x),Math.abs(o)<Tu?l=this.A*r.x:l=this.ArB*Math.atan2(e*this.cosgam+s*this.singam,o)}else u=r.y>0?this.v_pole_n:this.v_pole_s,l=this.ArB*r.y;return this.no_rot?(t.x=l,t.y=u):(l-=this.u_0,t.x=u*this.cosrot+l*this.sinrot,t.y=l*this.cosrot-u*this.sinrot),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function GE(r){var t,e,i,n,s,a,o,l={};if(r.x=(r.x-this.x0)*(1/this.a),r.y=(r.y-this.y0)*(1/this.a),this.no_rot?(e=r.y,t=r.x):(e=r.x*this.cosrot-r.y*this.sinrot,t=r.y*this.cosrot+r.x*this.sinrot+this.u_0),i=Math.exp(-this.BrA*e),n=.5*(i-1/i),s=.5*(i+1/i),a=Math.sin(this.BrA*t),o=(a*this.cosgam+n*this.singam)/s,Math.abs(Math.abs(o)-1)<st)l.x=0,l.y=o<0?-Q:Q;else{if(l.y=this.E/Math.sqrt((1+o)/(1-o)),l.y=Sh(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(n*this.cosgam-a*this.singam,Math.cos(this.BrA*t))}return l.x+=this.lam0,l}var kE=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"];const zE={init:RE,forward:FE,inverse:GE,names:kE};function VE(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<st)){var r=this.b/this.a;this.e=Math.sqrt(1-r*r);var t=Math.sin(this.lat1),e=Math.cos(this.lat1),i=jn(this.e,t,e),n=Nn(this.e,this.lat1,t),s=Math.sin(this.lat2),a=Math.cos(this.lat2),o=jn(this.e,s,a),l=Nn(this.e,this.lat2,s),u=Math.abs(Math.abs(this.lat0)-Q)<st?0:Nn(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>st?this.ns=Math.log(i/o)/Math.log(n/l):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=i/(this.ns*Math.pow(n,this.ns)),this.rh=this.a*this.f0*Math.pow(u,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function UE(r){var t=r.x,e=r.y;Math.abs(2*Math.abs(e)-Math.PI)<=st&&(e=Eh(e)*(Q-2*st));var i=Math.abs(Math.abs(e)-Q),n,s;if(i>st)n=Nn(this.e,e,Math.sin(e)),s=this.a*this.f0*Math.pow(n,this.ns);else{if(i=e*this.ns,i<=0)return null;s=0}var a=this.ns*ht(t-this.long0);return r.x=this.k0*(s*Math.sin(a))+this.x0,r.y=this.k0*(this.rh-s*Math.cos(a))+this.y0,r}function qE(r){var t,e,i,n,s,a=(r.x-this.x0)/this.k0,o=this.rh-(r.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(a*a+o*o),e=1):(t=-Math.sqrt(a*a+o*o),e=-1);var l=0;if(t!==0&&(l=Math.atan2(e*a,e*o)),t!==0||this.ns>0){if(e=1/this.ns,i=Math.pow(t/(this.a*this.f0),e),n=Sh(this.e,i),n===-9999)return null}else n=-Q;return s=ht(l/this.ns+this.long0),r.x=s,r.y=n,r}var WE=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const HE={init:VE,forward:UE,inverse:qE,names:WE};function XE(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function YE(r){var t,e,i,n,s,a,o,l=r.x,u=r.y,c=ht(l-this.long0);return t=Math.pow((1+this.e*Math.sin(u))/(1-this.e*Math.sin(u)),this.alfa*this.e/2),e=2*(Math.atan(this.k*Math.pow(Math.tan(u/2+this.s45),this.alfa)/t)-this.s45),i=-c*this.alfa,n=Math.asin(Math.cos(this.ad)*Math.sin(e)+Math.sin(this.ad)*Math.cos(e)*Math.cos(i)),s=Math.asin(Math.cos(e)*Math.sin(i)/Math.cos(n)),a=this.n*s,o=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(n/2+this.s45),this.n),r.y=o*Math.cos(a)/1,r.x=o*Math.sin(a)/1,this.czech||(r.y*=-1,r.x*=-1),r}function JE(r){var t,e,i,n,s,a,o,l,u=r.x;r.x=r.y,r.y=u,this.czech||(r.y*=-1,r.x*=-1),a=Math.sqrt(r.x*r.x+r.y*r.y),s=Math.atan2(r.y,r.x),n=s/Math.sin(this.s0),i=2*(Math.atan(Math.pow(this.ro0/a,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(i)-Math.sin(this.ad)*Math.cos(i)*Math.cos(n)),e=Math.asin(Math.cos(i)*Math.sin(n)/Math.cos(t)),r.x=this.long0-e/this.alfa,o=t,l=0;var c=0;do r.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-r.y)<1e-10&&(l=1),o=r.y,c+=1;while(l===0&&c<15);return c>=15?null:r}var KE=["Krovak","krovak"];const QE={init:XE,forward:YE,inverse:JE,names:KE};function Xr(r,t,e,i,n){return r*n-t*Math.sin(2*n)+e*Math.sin(4*n)-i*Math.sin(6*n)}function Ih(r){return 1-.25*r*(1+r/16*(3+1.25*r))}function Mh(r){return .375*r*(1+.25*r*(1+.46875*r))}function Nh(r){return .05859375*r*r*(1+.75*r)}function bh(r){return r*r*r*.011393229166666666}function Dd(r,t,e){var i=t*e;return r/Math.sqrt(1-i*i)}function ga(r){return Math.abs(r)<Q?r:r-Eh(r)*Math.PI}function Yc(r,t,e,i,n){var s,a;s=r/t;for(var o=0;o<15;o++)if(a=(r-(t*s-e*Math.sin(2*s)+i*Math.sin(4*s)-n*Math.sin(6*s)))/(t-2*e*Math.cos(2*s)+4*i*Math.cos(4*s)-6*n*Math.cos(6*s)),s+=a,Math.abs(a)<=1e-10)return s;return NaN}function ZE(){this.sphere||(this.e0=Ih(this.es),this.e1=Mh(this.es),this.e2=Nh(this.es),this.e3=bh(this.es),this.ml0=this.a*Xr(this.e0,this.e1,this.e2,this.e3,this.lat0))}function BE(r){var t,e,i=r.x,n=r.y;if(i=ht(i-this.long0),this.sphere)t=this.a*Math.asin(Math.cos(n)*Math.sin(i)),e=this.a*(Math.atan2(Math.tan(n),Math.cos(i))-this.lat0);else{var s=Math.sin(n),a=Math.cos(n),o=Dd(this.a,this.e,s),l=Math.tan(n)*Math.tan(n),u=i*Math.cos(n),c=u*u,h=this.es*a*a/(1-this.es),f=this.a*Xr(this.e0,this.e1,this.e2,this.e3,n);t=o*u*(1-c*l*(.16666666666666666-(8-l+8*h)*c/120)),e=f-this.ml0+o*s/a*c*(.5+(5-l+6*h)*c/24)}return r.x=t+this.x0,r.y=e+this.y0,r}function $E(r){r.x-=this.x0,r.y-=this.y0;var t=r.x/this.a,e=r.y/this.a,i,n;if(this.sphere){var s=e+this.lat0;i=Math.asin(Math.sin(s)*Math.cos(t)),n=Math.atan2(Math.tan(t),Math.cos(s))}else{var a=this.ml0/this.a+e,o=Yc(a,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(o)-Q)<=st)return r.x=this.long0,r.y=Q,e<0&&(r.y*=-1),r;var l=Dd(this.a,this.e,Math.sin(o)),u=l*l*l/this.a/this.a*(1-this.es),c=Math.pow(Math.tan(o),2),h=t*this.a/l,f=h*h;i=o-l*Math.tan(o)/u*h*h*(.5-(1+3*c)*h*h/24),n=h*(1-f*(c/3+(1+3*c)*c*f/15))/Math.cos(o)}return r.x=ht(n+this.long0),r.y=ga(i),r}var jE=["Cassini","Cassini_Soldner","cass"];const tS={init:ZE,forward:BE,inverse:$E,names:jE};function ma(r,t){var e;return r>1e-7?(e=r*t,(1-r*r)*(t/(1-e*e)-.5/r*Math.log((1-e)/(1+e)))):2*t}var eS=1,rS=2,iS=3,nS=4;function sS(){var r=Math.abs(this.lat0);if(Math.abs(r-Q)<st?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(r)<st?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var t;switch(this.qp=ma(this.e,1),this.mmf=.5/(1-this.es),this.apa=pS(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=ma(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function aS(r){var t,e,i,n,s,a,o,l,u,c,h=r.x,f=r.y;if(h=ht(h-this.long0),this.sphere){if(s=Math.sin(f),c=Math.cos(f),i=Math.cos(h),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e=this.mode===this.EQUIT?1+c*i:1+this.sinph0*s+this.cosph0*c*i,e<=st)return null;e=Math.sqrt(2/e),t=e*c*Math.sin(h),e*=this.mode===this.EQUIT?s:this.cosph0*s-this.sinph0*c*i}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(i=-i),Math.abs(f+this.lat0)<st)return null;e=ee-f*.5,e=2*(this.mode===this.S_POLE?Math.cos(e):Math.sin(e)),t=e*Math.sin(h),e*=i}}else{switch(o=0,l=0,u=0,i=Math.cos(h),n=Math.sin(h),s=Math.sin(f),a=ma(this.e,s),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(o=a/this.qp,l=Math.sqrt(1-o*o)),this.mode){case this.OBLIQ:u=1+this.sinb1*o+this.cosb1*l*i;break;case this.EQUIT:u=1+l*i;break;case this.N_POLE:u=Q+f,a=this.qp-a;break;case this.S_POLE:u=f-Q,a=this.qp+a;break}if(Math.abs(u)<st)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:u=Math.sqrt(2/u),this.mode===this.OBLIQ?e=this.ymf*u*(this.cosb1*o-this.sinb1*l*i):e=(u=Math.sqrt(2/(1+l*i)))*o*this.ymf,t=this.xmf*u*l*n;break;case this.N_POLE:case this.S_POLE:a>=0?(t=(u=Math.sqrt(a))*n,e=i*(this.mode===this.S_POLE?u:-u)):t=e=0;break}}return r.x=this.a*t+this.x0,r.y=this.a*e+this.y0,r}function oS(r){r.x-=this.x0,r.y-=this.y0;var t=r.x/this.a,e=r.y/this.a,i,n,s,a,o,l,u;if(this.sphere){var c=0,h,f=0;if(h=Math.sqrt(t*t+e*e),n=h*.5,n>1)return null;switch(n=2*Math.asin(n),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(f=Math.sin(n),c=Math.cos(n)),this.mode){case this.EQUIT:n=Math.abs(h)<=st?0:Math.asin(e*f/h),t*=f,e=c*h;break;case this.OBLIQ:n=Math.abs(h)<=st?this.lat0:Math.asin(c*this.sinph0+e*f*this.cosph0/h),t*=f*this.cosph0,e=(c-Math.sin(n)*this.sinph0)*h;break;case this.N_POLE:e=-e,n=Q-n;break;case this.S_POLE:n-=Q;break}i=e===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(t,e)}else{if(u=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t/=this.dd,e*=this.dd,l=Math.sqrt(t*t+e*e),l<st)return r.x=this.long0,r.y=this.lat0,r;a=2*Math.asin(.5*l/this.rq),s=Math.cos(a),t*=a=Math.sin(a),this.mode===this.OBLIQ?(u=s*this.sinb1+e*a*this.cosb1/l,o=this.qp*u,e=l*this.cosb1*s-e*this.sinb1*a):(u=e*a/l,o=this.qp*u,e=l*s)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(e=-e),o=t*t+e*e,!o)return r.x=this.long0,r.y=this.lat0,r;u=1-o/this.qp,this.mode===this.S_POLE&&(u=-u)}i=Math.atan2(t,e),n=gS(Math.asin(u),this.apa)}return r.x=ht(this.long0+i),r.y=n,r}var lS=.3333333333333333,uS=.17222222222222222,hS=.10257936507936508,cS=.06388888888888888,fS=.0664021164021164,dS=.016415012942191543;function pS(r){var t,e=[];return e[0]=r*lS,t=r*r,e[0]+=t*uS,e[1]=t*cS,t*=r,e[0]+=t*hS,e[1]+=t*fS,e[2]=t*dS,e}function gS(r,t){var e=r+r;return r+t[0]*Math.sin(e)+t[1]*Math.sin(e+e)+t[2]*Math.sin(e+e+e)}var mS=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const vS={init:sS,forward:aS,inverse:oS,names:mS,S_POLE:eS,N_POLE:rS,EQUIT:iS,OBLIQ:nS};function va(r){return Math.abs(r)>1&&(r=r>1?1:-1),Math.asin(r)}function yS(){Math.abs(this.lat1+this.lat2)<st||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=jn(this.e3,this.sin_po,this.cos_po),this.qs1=ma(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=jn(this.e3,this.sin_po,this.cos_po),this.qs2=ma(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=ma(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>st?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function _S(r){var t=r.x,e=r.y;this.sin_phi=Math.sin(e),this.cos_phi=Math.cos(e);var i=ma(this.e3,this.sin_phi),n=this.a*Math.sqrt(this.c-this.ns0*i)/this.ns0,s=this.ns0*ht(t-this.long0),a=n*Math.sin(s)+this.x0,o=this.rh-n*Math.cos(s)+this.y0;return r.x=a,r.y=o,r}function wS(r){var t,e,i,n,s,a;return r.x-=this.x0,r.y=this.rh-r.y+this.y0,this.ns0>=0?(t=Math.sqrt(r.x*r.x+r.y*r.y),i=1):(t=-Math.sqrt(r.x*r.x+r.y*r.y),i=-1),n=0,t!==0&&(n=Math.atan2(i*r.x,i*r.y)),i=t*this.ns0/this.a,this.sphere?a=Math.asin((this.c-i*i)/(2*this.ns0)):(e=(this.c-i*i)/this.ns0,a=this.phi1z(this.e3,e)),s=ht(n/this.ns0+this.long0),r.x=s,r.y=a,r}function ES(r,t){var e,i,n,s,a,o=va(.5*t);if(r<st)return o;for(var l=r*r,u=1;u<=25;u++)if(e=Math.sin(o),i=Math.cos(o),n=r*e,s=1-n*n,a=.5*s*s/i*(t/(1-l)-e/s+.5/r*Math.log((1-n)/(1+n))),o=o+a,Math.abs(a)<=1e-7)return o;return null}var SS=["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"];const PS={init:yS,forward:_S,inverse:wS,names:SS,phi1z:ES};function CS(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function IS(r){var t,e,i,n,s,a,o,l,u=r.x,c=r.y;return i=ht(u-this.long0),t=Math.sin(c),e=Math.cos(c),n=Math.cos(i),a=this.sin_p14*t+this.cos_p14*e*n,s=1,a>0||Math.abs(a)<=st?(o=this.x0+this.a*s*e*Math.sin(i)/a,l=this.y0+this.a*s*(this.cos_p14*t-this.sin_p14*e*n)/a):(o=this.x0+this.infinity_dist*e*Math.sin(i),l=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*e*n)),r.x=o,r.y=l,r}function MS(r){var t,e,i,n,s,a;return r.x=(r.x-this.x0)/this.a,r.y=(r.y-this.y0)/this.a,r.x/=this.k0,r.y/=this.k0,(t=Math.sqrt(r.x*r.x+r.y*r.y))?(n=Math.atan2(t,this.rc),e=Math.sin(n),i=Math.cos(n),a=va(i*this.sin_p14+r.y*e*this.cos_p14/t),s=Math.atan2(r.x*e,t*this.cos_p14*i-r.y*this.sin_p14*e),s=ht(this.long0+s)):(a=this.phic0,s=0),r.x=s,r.y=a,r}var NS=["gnom"];const bS={init:CS,forward:IS,inverse:MS,names:NS};function TS(r,t){var e=1-(1-r*r)/(2*r)*Math.log((1-r)/(1+r));if(Math.abs(Math.abs(t)-e)<1e-6)return t<0?-1*Q:Q;for(var i=Math.asin(.5*t),n,s,a,o,l=0;l<30;l++)if(s=Math.sin(i),a=Math.cos(i),o=r*s,n=Math.pow(1-o*o,2)/(2*a)*(t/(1-r*r)-s/(1-o*o)+.5/r*Math.log((1-o)/(1+o))),i+=n,Math.abs(n)<=1e-10)return i;return NaN}function DS(){this.sphere||(this.k0=jn(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function xS(r){var t=r.x,e=r.y,i,n,s=ht(t-this.long0);if(this.sphere)i=this.x0+this.a*s*Math.cos(this.lat_ts),n=this.y0+this.a*Math.sin(e)/Math.cos(this.lat_ts);else{var a=ma(this.e,Math.sin(e));i=this.x0+this.a*this.k0*s,n=this.y0+this.a*a*.5/this.k0}return r.x=i,r.y=n,r}function OS(r){r.x-=this.x0,r.y-=this.y0;var t,e;return this.sphere?(t=ht(this.long0+r.x/this.a/Math.cos(this.lat_ts)),e=Math.asin(r.y/this.a*Math.cos(this.lat_ts))):(e=TS(this.e,2*r.y*this.k0/this.a),t=ht(this.long0+r.x/(this.a*this.k0))),r.x=t,r.y=e,r}var AS=["cea"];const LS={init:DS,forward:xS,inverse:OS,names:AS};function RS(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function FS(r){var t=r.x,e=r.y,i=ht(t-this.long0),n=ga(e-this.lat0);return r.x=this.x0+this.a*i*this.rc,r.y=this.y0+this.a*n,r}function GS(r){var t=r.x,e=r.y;return r.x=ht(this.long0+(t-this.x0)/(this.a*this.rc)),r.y=ga(this.lat0+(e-this.y0)/this.a),r}var kS=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"];const zS={init:RS,forward:FS,inverse:GS,names:kS};var l0=20;function VS(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Ih(this.es),this.e1=Mh(this.es),this.e2=Nh(this.es),this.e3=bh(this.es),this.ml0=this.a*Xr(this.e0,this.e1,this.e2,this.e3,this.lat0)}function US(r){var t=r.x,e=r.y,i,n,s,a=ht(t-this.long0);if(s=a*Math.sin(e),this.sphere)Math.abs(e)<=st?(i=this.a*a,n=-1*this.a*this.lat0):(i=this.a*Math.sin(s)/Math.tan(e),n=this.a*(ga(e-this.lat0)+(1-Math.cos(s))/Math.tan(e)));else if(Math.abs(e)<=st)i=this.a*a,n=-1*this.ml0;else{var o=Dd(this.a,this.e,Math.sin(e))/Math.tan(e);i=o*Math.sin(s),n=this.a*Xr(this.e0,this.e1,this.e2,this.e3,e)-this.ml0+o*(1-Math.cos(s))}return r.x=i+this.x0,r.y=n+this.y0,r}function qS(r){var t,e,i,n,s,a,o,l,u;if(i=r.x-this.x0,n=r.y-this.y0,this.sphere)if(Math.abs(n+this.a*this.lat0)<=st)t=ht(i/this.a+this.long0),e=0;else{a=this.lat0+n/this.a,o=i*i/this.a/this.a+a*a,l=a;var c;for(s=l0;s;--s)if(c=Math.tan(l),u=-1*(a*(l*c+1)-l-.5*(l*l+o)*c)/((l-a)/c-1),l+=u,Math.abs(u)<=st){e=l;break}t=ht(this.long0+Math.asin(i*Math.tan(l)/this.a)/Math.sin(e))}else if(Math.abs(n+this.ml0)<=st)e=0,t=ht(this.long0+i/this.a);else{a=(this.ml0+n)/this.a,o=i*i/this.a/this.a+a*a,l=a;var h,f,g,m,_;for(s=l0;s;--s)if(_=this.e*Math.sin(l),h=Math.sqrt(1-_*_)*Math.tan(l),f=this.a*Xr(this.e0,this.e1,this.e2,this.e3,l),g=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),m=f/this.a,u=(a*(h*m+1)-m-.5*h*(m*m+o))/(this.es*Math.sin(2*l)*(m*m+o-2*a*m)/(4*h)+(a-m)*(h*g-2/Math.sin(2*l))-g),l-=u,Math.abs(u)<=st){e=l;break}h=Math.sqrt(1-this.es*Math.pow(Math.sin(e),2))*Math.tan(e),t=ht(this.long0+Math.asin(i*h/this.a)/Math.sin(e))}return r.x=t,r.y=e,r}var WS=["Polyconic","American_Polyconic","poly"];const HS={init:VS,forward:US,inverse:qS,names:WS};function XS(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function YS(r){var t,e=r.x,i=r.y,n=i-this.lat0,s=e-this.long0,a=n/yh*1e-5,o=s,l=1,u=0;for(t=1;t<=10;t++)l=l*a,u=u+this.A[t]*l;var c=u,h=o,f=1,g=0,m,_,E=0,M=0;for(t=1;t<=6;t++)m=f*c-g*h,_=g*c+f*h,f=m,g=_,E=E+this.B_re[t]*f-this.B_im[t]*g,M=M+this.B_im[t]*f+this.B_re[t]*g;return r.x=M*this.a+this.x0,r.y=E*this.a+this.y0,r}function JS(r){var t,e=r.x,i=r.y,n=e-this.x0,s=i-this.y0,a=s/this.a,o=n/this.a,l=1,u=0,c,h,f=0,g=0;for(t=1;t<=6;t++)c=l*a-u*o,h=u*a+l*o,l=c,u=h,f=f+this.C_re[t]*l-this.C_im[t]*u,g=g+this.C_im[t]*l+this.C_re[t]*u;for(var m=0;m<this.iterations;m++){var _=f,E=g,M,y,w=a,v=o;for(t=2;t<=6;t++)M=_*f-E*g,y=E*f+_*g,_=M,E=y,w=w+(t-1)*(this.B_re[t]*_-this.B_im[t]*E),v=v+(t-1)*(this.B_im[t]*_+this.B_re[t]*E);_=1,E=0;var S=this.B_re[1],P=this.B_im[1];for(t=2;t<=6;t++)M=_*f-E*g,y=E*f+_*g,_=M,E=y,S=S+t*(this.B_re[t]*_-this.B_im[t]*E),P=P+t*(this.B_im[t]*_+this.B_re[t]*E);var I=S*S+P*P;f=(w*S+v*P)/I,g=(v*S-w*P)/I}var b=f,D=g,O=1,T=0;for(t=1;t<=9;t++)O=O*b,T=T+this.D[t]*O;var x=this.lat0+T*yh*1e5,R=this.long0+D;return r.x=R,r.y=x,r}var KS=["New_Zealand_Map_Grid","nzmg"];const QS={init:XS,forward:YS,inverse:JS,names:KS};function ZS(){}function BS(r){var t=r.x,e=r.y,i=ht(t-this.long0),n=this.x0+this.a*i,s=this.y0+this.a*Math.log(Math.tan(Math.PI/4+e/2.5))*1.25;return r.x=n,r.y=s,r}function $S(r){r.x-=this.x0,r.y-=this.y0;var t=ht(this.long0+r.x/this.a),e=2.5*(Math.atan(Math.exp(.8*r.y/this.a))-Math.PI/4);return r.x=t,r.y=e,r}var jS=["Miller_Cylindrical","mill"];const tP={init:ZS,forward:BS,inverse:$S,names:jS};var eP=20;function rP(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Id(this.es)}function iP(r){var t,e,i=r.x,n=r.y;if(i=ht(i-this.long0),this.sphere){if(!this.m)n=this.n!==1?Math.asin(this.n*Math.sin(n)):n;else for(var s=this.n*Math.sin(n),a=eP;a;--a){var o=(this.m*n+Math.sin(n)-s)/(this.m+Math.cos(n));if(n-=o,Math.abs(o)<st)break}t=this.a*this.C_x*i*(this.m+Math.cos(n)),e=this.a*this.C_y*n}else{var l=Math.sin(n),u=Math.cos(n);e=this.a*bu(n,l,u,this.en),t=this.a*i*u/Math.sqrt(1-this.es*l*l)}return r.x=t,r.y=e,r}function nP(r){var t,e,i,n;return r.x-=this.x0,i=r.x/this.a,r.y-=this.y0,t=r.y/this.a,this.sphere?(t/=this.C_y,i=i/(this.C_x*(this.m+Math.cos(t))),this.m?t=va((this.m*t+Math.sin(t))/this.n):this.n!==1&&(t=va(Math.sin(t)/this.n)),i=ht(i+this.long0),t=ga(t)):(t=Md(r.y/this.a,this.es,this.en),n=Math.abs(t),n<Q?(n=Math.sin(t),e=this.long0+r.x*Math.sqrt(1-this.es*n*n)/(this.a*Math.cos(t)),i=ht(e)):n-st<Q&&(i=this.long0)),r.x=i,r.y=t,r}var sP=["Sinusoidal","sinu"];const aP={init:rP,forward:iP,inverse:nP,names:sP};function oP(){}function lP(r){for(var t=r.x,e=r.y,i=ht(t-this.long0),n=e,s=Math.PI*Math.sin(e);;){var a=-(n+Math.sin(n)-s)/(1+Math.cos(n));if(n+=a,Math.abs(a)<st)break}n/=2,Math.PI/2-Math.abs(e)<st&&(i=0);var o=.900316316158*this.a*i*Math.cos(n)+this.x0,l=1.4142135623731*this.a*Math.sin(n)+this.y0;return r.x=o,r.y=l,r}function uP(r){var t,e;r.x-=this.x0,r.y-=this.y0,e=r.y/(1.4142135623731*this.a),Math.abs(e)>.999999999999&&(e=.999999999999),t=Math.asin(e);var i=ht(this.long0+r.x/(.900316316158*this.a*Math.cos(t)));i<-Math.PI&&(i=-Math.PI),i>Math.PI&&(i=Math.PI),e=(2*t+Math.sin(2*t))/Math.PI,Math.abs(e)>1&&(e=1);var n=Math.asin(e);return r.x=i,r.y=n,r}var hP=["Mollweide","moll"];const cP={init:oP,forward:lP,inverse:uP,names:hP};function fP(){Math.abs(this.lat1+this.lat2)<st||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Ih(this.es),this.e1=Mh(this.es),this.e2=Nh(this.es),this.e3=bh(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=jn(this.e,this.sinphi,this.cosphi),this.ml1=Xr(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<st?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=jn(this.e,this.sinphi,this.cosphi),this.ml2=Xr(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=Xr(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function dP(r){var t=r.x,e=r.y,i;if(this.sphere)i=this.a*(this.g-e);else{var n=Xr(this.e0,this.e1,this.e2,this.e3,e);i=this.a*(this.g-n)}var s=this.ns*ht(t-this.long0),a=this.x0+i*Math.sin(s),o=this.y0+this.rh-i*Math.cos(s);return r.x=a,r.y=o,r}function pP(r){r.x-=this.x0,r.y=this.rh-r.y+this.y0;var t,e,i,n;this.ns>=0?(e=Math.sqrt(r.x*r.x+r.y*r.y),t=1):(e=-Math.sqrt(r.x*r.x+r.y*r.y),t=-1);var s=0;if(e!==0&&(s=Math.atan2(t*r.x,t*r.y)),this.sphere)return n=ht(this.long0+s/this.ns),i=ga(this.g-e/this.a),r.x=n,r.y=i,r;var a=this.g-e/this.a;return i=Yc(a,this.e0,this.e1,this.e2,this.e3),n=ht(this.long0+s/this.ns),r.x=n,r.y=i,r}var gP=["Equidistant_Conic","eqdc"];const mP={init:fP,forward:dP,inverse:pP,names:gP};function vP(){this.R=this.a}function yP(r){var t=r.x,e=r.y,i=ht(t-this.long0),n,s;Math.abs(e)<=st&&(n=this.x0+this.R*i,s=this.y0);var a=va(2*Math.abs(e/Math.PI));(Math.abs(i)<=st||Math.abs(Math.abs(e)-Q)<=st)&&(n=this.x0,e>=0?s=this.y0+Math.PI*this.R*Math.tan(.5*a):s=this.y0+Math.PI*this.R*-Math.tan(.5*a));var o=.5*Math.abs(Math.PI/i-i/Math.PI),l=o*o,u=Math.sin(a),c=Math.cos(a),h=c/(u+c-1),f=h*h,g=h*(2/u-1),m=g*g,_=Math.PI*this.R*(o*(h-m)+Math.sqrt(l*(h-m)*(h-m)-(m+l)*(f-m)))/(m+l);i<0&&(_=-_),n=this.x0+_;var E=l+h;return _=Math.PI*this.R*(g*E-o*Math.sqrt((m+l)*(l+1)-E*E))/(m+l),e>=0?s=this.y0+_:s=this.y0-_,r.x=n,r.y=s,r}function _P(r){var t,e,i,n,s,a,o,l,u,c,h,f,g;return r.x-=this.x0,r.y-=this.y0,h=Math.PI*this.R,i=r.x/h,n=r.y/h,s=i*i+n*n,a=-Math.abs(n)*(1+s),o=a-2*n*n+i*i,l=-2*a+1+2*n*n+s*s,g=n*n/l+(2*o*o*o/l/l/l-9*a*o/l/l)/27,u=(a-o*o/3/l)/l,c=2*Math.sqrt(-u/3),h=3*g/u/c,Math.abs(h)>1&&(h>=0?h=1:h=-1),f=Math.acos(h)/3,r.y>=0?e=(-c*Math.cos(f+Math.PI/3)-o/3/l)*Math.PI:e=-(-c*Math.cos(f+Math.PI/3)-o/3/l)*Math.PI,Math.abs(i)<st?t=this.long0:t=ht(this.long0+Math.PI*(s-1+Math.sqrt(1+2*(i*i-n*n)+s*s))/2/i),r.x=t,r.y=e,r}var wP=["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"];const EP={init:vP,forward:yP,inverse:_P,names:wP};var xd={exports:{}},u0;function SP(){return u0||(u0=1,function(r){(function(t){var e={};e.Constants={},e.Math={},e.Accumulator={},function(i){i.WGS84={a:6378137,f:.0033528106647474805},i.version={major:2,minor:1,patch:1},i.version_string="2.1.1"}(e.Constants),function(i){i.digits=53,i.epsilon=Math.pow(.5,i.digits-1),i.degree=Math.PI/180,i.sq=function(n){return n*n},i.hypot=function(n,s){return Math.sqrt(n*n+s*s)},i.cbrt=Math.cbrt||function(n){var s=Math.pow(Math.abs(n),.3333333333333333);return n>0?s:n<0?-s:n},i.log1p=Math.log1p||function(n){var s=1+n,a=s-1;return a===0?n:n*Math.log(s)/a},i.atanh=Math.atanh||function(n){var s=Math.abs(n);return s=i.log1p(2*s/(1-s))/2,n>0?s:n<0?-s:n},i.copysign=function(n,s){return Math.abs(n)*(s<0||s===0&&1/s<0?-1:1)},i.sum=function(n,s){var a=n+s,o=a-s,l=a-o,u;return o-=n,l-=s,u=a&&0-(o+l),{s:a,t:u}},i.polyval=function(n,s,a,o){for(var l=n<0?0:s[a++];--n>=0;)l=l*o+s[a++];return l},i.AngRound=function(n){var s=.0625,a=Math.abs(n);return a=a<s?s-(s-a):a,i.copysign(a,n)},i.remainder=function(n,s){return n%=s,n<-s/2?n+s:n<s/2?n:n-s},i.AngNormalize=function(n){var s=i.remainder(n,360);return Math.abs(s)===180?i.copysign(180,n):s},i.LatFix=function(n){return Math.abs(n)>90?NaN:n},i.AngDiff=function(n,s){var a=i.sum(i.remainder(-n,360),i.remainder(s,360)),o,l;return a=i.sum(i.remainder(a.s,360),a.t),o=a.s,l=a.t,(o===0||Math.abs(o)===180)&&(o=i.copysign(o,l===0?s-n:-l)),{d:o,e:l}},i.sincosd=function(n){var s,a,o,l,u,c,h;switch(s=n%360,o=Math.round(s/90),s-=90*o,a=s*this.degree,l=Math.sin(a),u=Math.cos(a),Math.abs(s)===45?(u=Math.sqrt(.5),l=i.copysign(u,a)):Math.abs(s)===30&&(u=Math.sqrt(.75),l=i.copysign(.5,a)),o&3){case 0:c=l,h=u;break;case 1:c=u,h=-l;break;case 2:c=-l,h=-u;break;default:c=-u,h=l;break}return h+=0,c===0&&(c=i.copysign(c,n)),{s:c,c:h}},i.sincosde=function(n,s){var a,o,l,u,c,h,f;switch(a=n%360,l=Math.round(a/90),a=i.AngRound(a-90*l+s),o=a*this.degree,u=Math.sin(o),c=Math.cos(o),Math.abs(a)===45?(c=Math.sqrt(.5),u=i.copysign(c,o)):Math.abs(a)===30&&(c=Math.sqrt(.75),u=i.copysign(.5,o)),l&3){case 0:h=u,f=c;break;case 1:h=c,f=-u;break;case 2:h=-u,f=-c;break;default:h=-c,f=u;break}return f+=0,h===0&&(h=i.copysign(h,n+s)),{s:h,c:f}},i.atan2d=function(n,s){var a=0,o;switch(Math.abs(n)>Math.abs(s)&&([n,s]=[s,n],a=2),i.copysign(1,s)<0&&(s=-s,++a),o=Math.atan2(n,s)/this.degree,a){case 1:o=i.copysign(180,n)-o;break;case 2:o=90-o;break;case 3:o=-90+o;break}return o}}(e.Math),function(i,n){i.Accumulator=function(s){this.Set(s)},i.Accumulator.prototype.Set=function(s){s||(s=0),s.constructor===i.Accumulator?(this._s=s._s,this._t=s._t):(this._s=s,this._t=0)},i.Accumulator.prototype.Add=function(s){var a=n.sum(s,this._t),o=n.sum(a.s,this._s);a=a.t,this._s=o.s,this._t=o.t,this._s===0?this._s=a:this._t+=a},i.Accumulator.prototype.Sum=function(s){var a;return s?(a=new i.Accumulator(this),a.Add(s),a._s):this._s},i.Accumulator.prototype.Negate=function(){this._s*=-1,this._t*=-1},i.Accumulator.prototype.Remainder=function(s){this._s=n.remainder(this._s,s),this.Add(0)}}(e.Accumulator,e.Math),e.Geodesic={},e.GeodesicLine={},e.PolygonArea={},function(i,n,s,a,o){var l=6,u=l,c=l,h=l,f=h,g,m,_=20,E=_+a.digits+10,M=a.epsilon,y=200*M,w=Math.sqrt(M),v=M,S=1e3*w,P=0,I=31,b=32640,D,O,T,x,R,z,rt,Z,ct;i.tiny_=Math.sqrt(Number.MIN_VALUE/Number.EPSILON),i.nC1_=l,i.nC1p_=l,i.nC2_=l,i.nC3_=l,i.nC4_=l,g=i.nC3_*(i.nC3_-1)/2,m=i.nC4_*(i.nC4_+1)/2,i.CAP_C1=1,i.CAP_C1p=2,i.CAP_C2=4,i.CAP_C3=8,i.CAP_C4=16,i.NONE=0,i.ARC=64,i.LATITUDE=128|P,i.LONGITUDE=256|i.CAP_C3,i.AZIMUTH=512|P,i.DISTANCE=1024|i.CAP_C1,i.STANDARD=i.LATITUDE|i.LONGITUDE|i.AZIMUTH|i.DISTANCE,i.DISTANCE_IN=2048|i.CAP_C1|i.CAP_C1p,i.REDUCEDLENGTH=4096|i.CAP_C1|i.CAP_C2,i.GEODESICSCALE=8192|i.CAP_C1|i.CAP_C2,i.AREA=16384|i.CAP_C4,i.ALL=b|I,i.LONG_UNROLL=32768,i.OUT_MASK=b|i.LONG_UNROLL,i.SinCosSeries=function(G,X,k,V){var A=V.length,W=A-(G?1:0),J=2*(k-X)*(k+X),ot=W&1?V[--A]:0,gt=0;for(W=Math.floor(W/2);W--;)gt=J*ot-gt+V[--A],ot=J*gt-ot+V[--A];return G?2*X*k*ot:k*(ot-gt)},D=function(G,X){var k,V=a.sq(G),A=a.sq(X),W=(V+A-1)/6,J,ot,gt,lt,St,ut,It,Nt,j,Pt,bt;return A===0&&W<=0?k=0:(J=V*A/4,ot=a.sq(W),gt=W*ot,lt=J*(J+2*gt),St=W,lt>=0?(ut=J+gt,ut+=ut<0?-Math.sqrt(lt):Math.sqrt(lt),It=a.cbrt(ut),St+=It+(It!==0?ot/It:0)):(Nt=Math.atan2(Math.sqrt(-lt),-(J+gt)),St+=2*W*Math.cos(Nt/3)),j=Math.sqrt(a.sq(St)+A),Pt=St<0?A/(j-St):St+j,bt=(Pt-A)/(2*j),k=Pt/(Math.sqrt(Pt+a.sq(bt))+bt)),k},O=[1,4,64,0,256],i.A1m1f=function(G){var X=Math.floor(u/2),k=a.polyval(X,O,0,a.sq(G))/O[X+1];return(k+G)/(1-G)},T=[-1,6,-16,32,-9,64,-128,2048,9,-16,768,3,-5,512,-7,1280,-7,2048],i.C1f=function(G,X){var k=a.sq(G),V=G,A=0,W,J;for(W=1;W<=i.nC1_;++W)J=Math.floor((i.nC1_-W)/2),X[W]=V*a.polyval(J,T,A,k)/T[A+J+1],A+=J+2,V*=G},x=[205,-432,768,1536,4005,-4736,3840,12288,-225,116,384,-7173,2695,7680,3467,7680,38081,61440],i.C1pf=function(G,X){var k=a.sq(G),V=G,A=0,W,J;for(W=1;W<=i.nC1p_;++W)J=Math.floor((i.nC1p_-W)/2),X[W]=V*a.polyval(J,x,A,k)/x[A+J+1],A+=J+2,V*=G},R=[-11,-28,-192,0,256],i.A2m1f=function(G){var X=Math.floor(c/2),k=a.polyval(X,R,0,a.sq(G))/R[X+1];return(k-G)/(1+G)},z=[1,2,16,32,35,64,384,2048,15,80,768,7,35,512,63,1280,77,2048],i.C2f=function(G,X){var k=a.sq(G),V=G,A=0,W,J;for(W=1;W<=i.nC2_;++W)J=Math.floor((i.nC2_-W)/2),X[W]=V*a.polyval(J,z,A,k)/z[A+J+1],A+=J+2,V*=G},i.Geodesic=function(G,X){if(this.a=G,this.f=X,this._f1=1-this.f,this._e2=this.f*(2-this.f),this._ep2=this._e2/a.sq(this._f1),this._n=this.f/(2-this.f),this._b=this.a*this._f1,this._c2=(a.sq(this.a)+a.sq(this._b)*(this._e2===0?1:(this._e2>0?a.atanh(Math.sqrt(this._e2)):Math.atan(Math.sqrt(-this._e2)))/Math.sqrt(Math.abs(this._e2))))/2,this._etol2=.1*w/Math.sqrt(Math.max(.001,Math.abs(this.f))*Math.min(1,1-this.f/2)/2),!(isFinite(this.a)&&this.a>0))throw new Error("Equatorial radius is not positive");if(!(isFinite(this._b)&&this._b>0))throw new Error("Polar semi-axis is not positive");this._A3x=new Array(f),this._C3x=new Array(g),this._C4x=new Array(m),this.A3coeff(),this.C3coeff(),this.C4coeff()},rt=[-3,128,-2,-3,64,-1,-3,-1,16,3,-1,-2,8,1,-1,2,1,1],i.Geodesic.prototype.A3coeff=function(){var G=0,X=0,k,V;for(k=h-1;k>=0;--k)V=Math.min(h-k-1,k),this._A3x[X++]=a.polyval(V,rt,G,this._n)/rt[G+V+1],G+=V+2},Z=[3,128,2,5,128,-1,3,3,64,-1,0,1,8,-1,1,4,5,256,1,3,128,-3,-2,3,64,1,-3,2,32,7,512,-10,9,384,5,-9,5,192,7,512,-14,7,512,21,2560],i.Geodesic.prototype.C3coeff=function(){var G=0,X=0,k,V,A;for(k=1;k<i.nC3_;++k)for(V=i.nC3_-1;V>=k;--V)A=Math.min(i.nC3_-V-1,V),this._C3x[X++]=a.polyval(A,Z,G,this._n)/Z[G+A+1],G+=A+2},ct=[97,15015,1088,156,45045,-224,-4784,1573,45045,-10656,14144,-4576,-858,45045,64,624,-4576,6864,-3003,15015,100,208,572,3432,-12012,30030,45045,1,9009,-2944,468,135135,5792,1040,-1287,135135,5952,-11648,9152,-2574,135135,-64,-624,4576,-6864,3003,135135,8,10725,1856,-936,225225,-8448,4992,-1144,225225,-1440,4160,-4576,1716,225225,-136,63063,1024,-208,105105,3584,-3328,1144,315315,-128,135135,-2560,832,405405,128,99099],i.Geodesic.prototype.C4coeff=function(){var G=0,X=0,k,V,A;for(k=0;k<i.nC4_;++k)for(V=i.nC4_-1;V>=k;--V)A=i.nC4_-V-1,this._C4x[X++]=a.polyval(A,ct,G,this._n)/ct[G+A+1],G+=A+2},i.Geodesic.prototype.A3f=function(G){return a.polyval(f-1,this._A3x,0,G)},i.Geodesic.prototype.C3f=function(G,X){var k=1,V=0,A,W;for(A=1;A<i.nC3_;++A)W=i.nC3_-A-1,k*=G,X[A]=k*a.polyval(W,this._C3x,V,G),V+=W+1},i.Geodesic.prototype.C4f=function(G,X){var k=1,V=0,A,W;for(A=0;A<i.nC4_;++A)W=i.nC4_-A-1,X[A]=k*a.polyval(W,this._C4x,V,G),V+=W+1,k*=G},i.Geodesic.prototype.Lengths=function(G,X,k,V,A,W,J,ot,gt,lt,St,ut,It){St&=i.OUT_MASK;var Nt={},j=0,Pt=0,bt=0,Gt=0,Ht,Xt,Bt,me,Ke;if(St&(i.DISTANCE|i.REDUCEDLENGTH|i.GEODESICSCALE)&&(bt=i.A1m1f(G),i.C1f(G,ut),St&(i.REDUCEDLENGTH|i.GEODESICSCALE)&&(Gt=i.A2m1f(G),i.C2f(G,It),j=bt-Gt,Gt=1+Gt),bt=1+bt),St&i.DISTANCE)Ht=i.SinCosSeries(!0,W,J,ut)-i.SinCosSeries(!0,k,V,ut),Nt.s12b=bt*(X+Ht),St&(i.REDUCEDLENGTH|i.GEODESICSCALE)&&(Xt=i.SinCosSeries(!0,W,J,It)-i.SinCosSeries(!0,k,V,It),Pt=j*X+(bt*Ht-Gt*Xt));else if(St&(i.REDUCEDLENGTH|i.GEODESICSCALE)){for(Bt=1;Bt<=i.nC2_;++Bt)It[Bt]=bt*ut[Bt]-Gt*It[Bt];Pt=j*X+(i.SinCosSeries(!0,W,J,It)-i.SinCosSeries(!0,k,V,It))}return St&i.REDUCEDLENGTH&&(Nt.m0=j,Nt.m12b=ot*(V*W)-A*(k*J)-V*J*Pt),St&i.GEODESICSCALE&&(me=V*J+k*W,Ke=this._ep2*(gt-lt)*(gt+lt)/(A+ot),Nt.M12=me+(Ke*W-J*Pt)*k/A,Nt.M21=me-(Ke*k-V*Pt)*W/ot),Nt},i.Geodesic.prototype.InverseStart=function(G,X,k,V,A,W,J,ot,gt,lt,St){var ut={},It=V*X-A*G,Nt=A*X+V*G,j,Pt,bt,Gt,Ht,Xt,Bt,me,Ke,Yt,kt,zt,Ee,ke,on,Oa,Uh,ds,$t,mi,Ar,vi,Ri;return ut.sig12=-1,j=V*X,j+=A*G,Pt=Nt>=0&&It<.5&&A*J<.5,Pt?(Gt=a.sq(G+V),Gt/=Gt+a.sq(X+A),ut.dnm=Math.sqrt(1+this._ep2*Gt),bt=J/(this._f1*ut.dnm),Ht=Math.sin(bt),Xt=Math.cos(bt)):(Ht=ot,Xt=gt),ut.salp1=A*Ht,ut.calp1=Xt>=0?It+A*G*a.sq(Ht)/(1+Xt):j-A*G*a.sq(Ht)/(1-Xt),me=a.hypot(ut.salp1,ut.calp1),Ke=G*V+X*A*Xt,Pt&&me<this._etol2?(ut.salp2=X*Ht,ut.calp2=It-X*V*(Xt>=0?a.sq(Ht)/(1+Xt):1-Xt),Bt=a.hypot(ut.salp2,ut.calp2),ut.salp2/=Bt,ut.calp2/=Bt,ut.sig12=Math.atan2(me,Ke)):Math.abs(this._n)>.1||Ke>=0||me>=6*Math.abs(this._n)*Math.PI*a.sq(X)||(Ri=Math.atan2(-ot,-gt),this.f>=0?(ke=a.sq(G)*this._ep2,on=ke/(2*(1+Math.sqrt(1+ke))+ke),zt=this.f*X*this.A3f(on)*Math.PI,Ee=zt*X,Yt=Ri/zt,kt=j/Ee):(Oa=A*X-V*G,Uh=Math.atan2(j,Oa),mi=this.Lengths(this._n,Math.PI+Uh,G,-X,k,V,A,W,X,A,i.REDUCEDLENGTH,lt,St),ds=mi.m12b,$t=mi.m0,Yt=-1+ds/(X*A*$t*Math.PI),Ee=Yt<-.01?j/Yt:-this.f*a.sq(X)*Math.PI,zt=Ee/X,kt=J/zt),kt>-y&&Yt>-1-S?this.f>=0?(ut.salp1=Math.min(1,-Yt),ut.calp1=-Math.sqrt(1-a.sq(ut.salp1))):(ut.calp1=Math.max(Yt>-y?0:-1,Yt),ut.salp1=Math.sqrt(1-a.sq(ut.calp1))):(Ar=D(Yt,kt),vi=zt*(this.f>=0?-Yt*Ar/(1+Ar):-kt*(1+Ar)/Ar),Ht=Math.sin(vi),Xt=-Math.cos(vi),ut.salp1=A*Ht,ut.calp1=j-A*G*a.sq(Ht)/(1-Xt))),ut.salp1<=0?(ut.salp1=1,ut.calp1=0):(Bt=a.hypot(ut.salp1,ut.calp1),ut.salp1/=Bt,ut.calp1/=Bt),ut},i.Geodesic.prototype.Lambda12=function(G,X,k,V,A,W,J,ot,gt,lt,St,ut,It,Nt){var j={},Pt,bt,Gt,Ht,Xt,Bt,me,Ke,Yt,kt,zt,Ee,ke;return G===0&&ot===0&&(ot=-i.tiny_),bt=J*X,Gt=a.hypot(ot,J*G),j.ssig1=G,Ht=bt*G,j.csig1=Xt=ot*X,Pt=a.hypot(j.ssig1,j.csig1),j.ssig1/=Pt,j.csig1/=Pt,j.salp2=A!==X?bt/A:J,j.calp2=A!==X||Math.abs(V)!==-G?Math.sqrt(a.sq(ot*X)+(X<-G?(A-X)*(X+A):(G-V)*(G+V)))/A:Math.abs(ot),j.ssig2=V,Bt=bt*V,j.csig2=me=j.calp2*A,Pt=a.hypot(j.ssig2,j.csig2),j.ssig2/=Pt,j.csig2/=Pt,j.sig12=Math.atan2(Math.max(0,j.csig1*j.ssig2-j.ssig1*j.csig2),j.csig1*j.csig2+j.ssig1*j.ssig2),Ke=Math.max(0,Xt*Bt-Ht*me),Yt=Xt*me+Ht*Bt,zt=Math.atan2(Ke*lt-Yt*gt,Yt*lt+Ke*gt),Ee=a.sq(Gt)*this._ep2,j.eps=Ee/(2*(1+Math.sqrt(1+Ee))+Ee),this.C3f(j.eps,Nt),kt=i.SinCosSeries(!0,j.ssig2,j.csig2,Nt)-i.SinCosSeries(!0,j.ssig1,j.csig1,Nt),j.domg12=-this.f*this.A3f(j.eps)*bt*(j.sig12+kt),j.lam12=zt+j.domg12,St&&(j.calp2===0?j.dlam12=-2*this._f1*k/G:(ke=this.Lengths(j.eps,j.sig12,j.ssig1,j.csig1,k,j.ssig2,j.csig2,W,X,A,i.REDUCEDLENGTH,ut,It),j.dlam12=ke.m12b,j.dlam12*=this._f1/(j.calp2*A))),j},i.Geodesic.prototype.Inverse=function(G,X,k,V,A){var W,J;return A||(A=i.STANDARD),A===i.LONG_UNROLL&&(A|=i.STANDARD),A&=i.OUT_MASK,W=this.InverseInt(G,X,k,V,A),J=W.vals,A&i.AZIMUTH&&(J.azi1=a.atan2d(W.salp1,W.calp1),J.azi2=a.atan2d(W.salp2,W.calp2)),J},i.Geodesic.prototype.InverseInt=function(G,X,k,V,A){var W={},J,ot,gt,lt,St,ut,It,Nt,j,Pt,bt,Gt,Ht,Xt,Bt,me,Ke,Yt,kt,zt,Ee,ke,on,Oa,Uh,ds,$t,mi,Ar,vi,Ri,sf,af,Vu,Hl,qh,Wh,Hh,Xh,of,Jd,Uu,Kd,lf,Qd,Zd,Bd,lv,$d,uf,jd,hf,uv,cf,hv,cv,Yh,ff,Jh,tp,ep,df,pf,rp,ip;if(W.lat1=G=a.LatFix(G),W.lat2=k=a.LatFix(k),G=a.AngRound(G),k=a.AngRound(k),J=a.AngDiff(X,V),ot=J.e,J=J.d,A&i.LONG_UNROLL?(W.lon1=X,W.lon2=X+J+ot):(W.lon1=a.AngNormalize(X),W.lon2=a.AngNormalize(V)),gt=a.copysign(1,J),J*=gt,ot*=gt,Bt=J*a.degree,lt=a.sincosde(J,ot),me=lt.s,Ke=lt.c,ot=180-J-ot,St=Math.abs(G)<Math.abs(k)||isNaN(k)?-1:1,St<0&&(gt*=-1,[k,G]=[G,k]),ut=a.copysign(1,-G),G*=ut,k*=ut,lt=a.sincosd(G),It=this._f1*lt.s,Nt=lt.c,lt=a.hypot(It,Nt),It/=lt,Nt/=lt,Nt=Math.max(i.tiny_,Nt),lt=a.sincosd(k),j=this._f1*lt.s,Pt=lt.c,lt=a.hypot(j,Pt),j/=lt,Pt/=lt,Pt=Math.max(i.tiny_,Pt),Nt<-It?Pt===Nt&&(j=a.copysign(It,j)):Math.abs(j)===-It&&(Pt=Nt),Ht=Math.sqrt(1+this._ep2*a.sq(It)),Xt=Math.sqrt(1+this._ep2*a.sq(j)),on=new Array(i.nC1_+1),Oa=new Array(i.nC2_+1),Uh=new Array(i.nC3_),ds=G===-90||me===0,ds&&(kt=Ke,zt=me,Ee=1,ke=0,mi=It,Ar=kt*Nt,vi=j,Ri=Ee*Pt,Yt=Math.atan2(Math.max(0,Ar*vi-mi*Ri),Ar*Ri+mi*vi),$t=this.Lengths(this._n,Yt,mi,Ar,Ht,vi,Ri,Xt,Nt,Pt,A|i.DISTANCE|i.REDUCEDLENGTH,on,Oa),bt=$t.s12b,Gt=$t.m12b,A&i.GEODESICSCALE&&(W.M12=$t.M12,W.M21=$t.M21),Yt<1||Gt>=0?((Yt<3*i.tiny_||Yt<M&&(bt<0||Gt<0))&&(Yt=Gt=bt=0),Gt*=this._b,bt*=this._b,W.a12=Yt/a.degree):ds=!1),Yh=2,!ds&&It===0&&(this.f<=0||ot>=this.f*180))kt=Ee=0,zt=ke=1,bt=this.a*Bt,Yt=af=Bt/this._f1,Gt=this._b*Math.sin(Yt),A&i.GEODESICSCALE&&(W.M12=W.M21=Math.cos(Yt)),W.a12=J/this._f1;else if(!ds)if($t=this.InverseStart(It,Nt,Ht,j,Pt,Xt,Bt,me,Ke,on,Oa),Yt=$t.sig12,zt=$t.salp1,kt=$t.calp1,Yt>=0)ke=$t.salp2,Ee=$t.calp2,Vu=$t.dnm,bt=Yt*this._b*Vu,Gt=a.sq(Vu)*this._b*Math.sin(Yt/Vu),A&i.GEODESICSCALE&&(W.M12=W.M21=Math.cos(Yt/Vu)),W.a12=Yt/a.degree,af=Bt/(this._f1*Vu);else{for(Hl=0,qh=i.tiny_,Wh=1,Hh=i.tiny_,Xh=-1,of=!1,Jd=!1;$t=this.Lambda12(It,Nt,Ht,j,Pt,Xt,zt,kt,me,Ke,Hl<_,on,Oa,Uh),Uu=$t.lam12,ke=$t.salp2,Ee=$t.calp2,Yt=$t.sig12,mi=$t.ssig1,Ar=$t.csig1,vi=$t.ssig2,Ri=$t.csig2,sf=$t.eps,Jh=$t.domg12,Kd=$t.dlam12,!(Jd||!(Math.abs(Uu)>=(of?8:1)*M)||Hl==E);++Hl){if(Uu>0&&(Hl<_||kt/zt>Xh/Hh)?(Hh=zt,Xh=kt):Uu<0&&(Hl<_||kt/zt<Wh/qh)&&(qh=zt,Wh=kt),Hl<_&&Kd>0&&(lf=-Uu/Kd,Math.abs(lf)<Math.PI&&(Qd=Math.sin(lf),Zd=Math.cos(lf),Bd=zt*Zd+kt*Qd,Bd>0))){kt=kt*Zd-zt*Qd,zt=Bd,lt=a.hypot(zt,kt),zt/=lt,kt/=lt,of=Math.abs(Uu)<=16*M;continue}zt=(qh+Hh)/2,kt=(Wh+Xh)/2,lt=a.hypot(zt,kt),zt/=lt,kt/=lt,of=!1,Jd=Math.abs(qh-zt)+(Wh-kt)<v||Math.abs(zt-Hh)+(kt-Xh)<v}lv=A|(A&(i.REDUCEDLENGTH|i.GEODESICSCALE)?i.DISTANCE:i.NONE),$t=this.Lengths(sf,Yt,mi,Ar,Ht,vi,Ri,Xt,Nt,Pt,lv,on,Oa),bt=$t.s12b,Gt=$t.m12b,A&i.GEODESICSCALE&&(W.M12=$t.M12,W.M21=$t.M21),Gt*=this._b,bt*=this._b,W.a12=Yt/a.degree,A&i.AREA&&(rp=Math.sin(Jh),ip=Math.cos(Jh),Yh=me*ip-Ke*rp,ff=Ke*ip+me*rp)}return A&i.DISTANCE&&(W.s12=0+bt),A&i.REDUCEDLENGTH&&(W.m12=0+Gt),A&i.AREA&&($d=zt*Nt,uf=a.hypot(kt,zt*It),uf!==0&&$d!==0?(mi=It,Ar=kt*Nt,vi=j,Ri=Ee*Pt,hf=a.sq(uf)*this._ep2,sf=hf/(2*(1+Math.sqrt(1+hf))+hf),uv=a.sq(this.a)*uf*$d*this._e2,lt=a.hypot(mi,Ar),mi/=lt,Ar/=lt,lt=a.hypot(vi,Ri),vi/=lt,Ri/=lt,cf=new Array(i.nC4_),this.C4f(sf,cf),hv=i.SinCosSeries(!1,mi,Ar,cf),cv=i.SinCosSeries(!1,vi,Ri,cf),W.S12=uv*(cv-hv)):W.S12=0,!ds&&Yh==2&&(Yh=Math.sin(af),ff=Math.cos(af)),!ds&&ff>-.7071&&j-It<1.75?(Jh=1+ff,tp=1+Nt,ep=1+Pt,jd=2*Math.atan2(Yh*(It*ep+j*tp),Jh*(It*j+tp*ep))):(df=ke*kt-Ee*zt,pf=Ee*kt+ke*zt,df===0&&pf<0&&(df=i.tiny_*kt,pf=-1),jd=Math.atan2(df,pf)),W.S12+=this._c2*jd,W.S12*=St*gt*ut,W.S12+=0),St<0&&([ke,zt]=[zt,ke],[Ee,kt]=[kt,Ee],A&i.GEODESICSCALE&&([W.M21,W.M12]=[W.M12,W.M21])),zt*=St*gt,kt*=St*ut,ke*=St*gt,Ee*=St*ut,{vals:W,salp1:zt,calp1:kt,salp2:ke,calp2:Ee}},i.Geodesic.prototype.GenDirect=function(G,X,k,V,A,W){var J;return W?W===i.LONG_UNROLL&&(W|=i.STANDARD):W=i.STANDARD,V||(W|=i.DISTANCE_IN),J=new n.GeodesicLine(this,G,X,k,W),J.GenPosition(V,A,W)},i.Geodesic.prototype.Direct=function(G,X,k,V,A){return this.GenDirect(G,X,k,!1,V,A)},i.Geodesic.prototype.ArcDirect=function(G,X,k,V,A){return this.GenDirect(G,X,k,!0,V,A)},i.Geodesic.prototype.Line=function(G,X,k,V){return new n.GeodesicLine(this,G,X,k,V)},i.Geodesic.prototype.DirectLine=function(G,X,k,V,A){return this.GenDirectLine(G,X,k,!1,V,A)},i.Geodesic.prototype.ArcDirectLine=function(G,X,k,V,A){return this.GenDirectLine(G,X,k,!0,V,A)},i.Geodesic.prototype.GenDirectLine=function(G,X,k,V,A,W){var J;return W||(W=i.STANDARD|i.DISTANCE_IN),V||(W|=i.DISTANCE_IN),J=new n.GeodesicLine(this,G,X,k,W),J.GenSetDistance(V,A),J},i.Geodesic.prototype.InverseLine=function(G,X,k,V,A){var W,J,ot;return A||(A=i.STANDARD|i.DISTANCE_IN),W=this.InverseInt(G,X,k,V,i.ARC),ot=a.atan2d(W.salp1,W.calp1),A&(i.OUT_MASK&i.DISTANCE_IN)&&(A|=i.DISTANCE),J=new n.GeodesicLine(this,G,X,ot,A,W.salp1,W.calp1),J.SetArc(W.vals.a12),J},i.Geodesic.prototype.Polygon=function(G){return new s.PolygonArea(this,G)},i.WGS84=new i.Geodesic(o.WGS84.a,o.WGS84.f)}(e.Geodesic,e.GeodesicLine,e.PolygonArea,e.Math,e.Constants),function(i,n,s){n.GeodesicLine=function(a,o,l,u,c,h,f){var g,m,_,E,M,y;c||(c=i.STANDARD|i.DISTANCE_IN),this.a=a.a,this.f=a.f,this._b=a._b,this._c2=a._c2,this._f1=a._f1,this.caps=c|i.LATITUDE|i.AZIMUTH|i.LONG_UNROLL,this.lat1=s.LatFix(o),this.lon1=l,typeof h>"u"||typeof f>"u"?(this.azi1=s.AngNormalize(u),g=s.sincosd(s.AngRound(this.azi1)),this.salp1=g.s,this.calp1=g.c):(this.azi1=u,this.salp1=h,this.calp1=f),g=s.sincosd(s.AngRound(this.lat1)),_=this._f1*g.s,m=g.c,g=s.hypot(_,m),_/=g,m/=g,m=Math.max(i.tiny_,m),this._dn1=Math.sqrt(1+a._ep2*s.sq(_)),this._salp0=this.salp1*m,this._calp0=s.hypot(this.calp1,this.salp1*_),this._ssig1=_,this._somg1=this._salp0*_,this._csig1=this._comg1=_!==0||this.calp1!==0?m*this.calp1:1,g=s.hypot(this._ssig1,this._csig1),this._ssig1/=g,this._csig1/=g,this._k2=s.sq(this._calp0)*a._ep2,E=this._k2/(2*(1+Math.sqrt(1+this._k2))+this._k2),this.caps&i.CAP_C1&&(this._A1m1=i.A1m1f(E),this._C1a=new Array(i.nC1_+1),i.C1f(E,this._C1a),this._B11=i.SinCosSeries(!0,this._ssig1,this._csig1,this._C1a),M=Math.sin(this._B11),y=Math.cos(this._B11),this._stau1=this._ssig1*y+this._csig1*M,this._ctau1=this._csig1*y-this._ssig1*M),this.caps&i.CAP_C1p&&(this._C1pa=new Array(i.nC1p_+1),i.C1pf(E,this._C1pa)),this.caps&i.CAP_C2&&(this._A2m1=i.A2m1f(E),this._C2a=new Array(i.nC2_+1),i.C2f(E,this._C2a),this._B21=i.SinCosSeries(!0,this._ssig1,this._csig1,this._C2a)),this.caps&i.CAP_C3&&(this._C3a=new Array(i.nC3_),a.C3f(E,this._C3a),this._A3c=-this.f*this._salp0*a.A3f(E),this._B31=i.SinCosSeries(!0,this._ssig1,this._csig1,this._C3a)),this.caps&i.CAP_C4&&(this._C4a=new Array(i.nC4_),a.C4f(E,this._C4a),this._A4=s.sq(this.a)*this._calp0*this._salp0*a._e2,this._B41=i.SinCosSeries(!1,this._ssig1,this._csig1,this._C4a)),this.a13=this.s13=NaN},n.GeodesicLine.prototype.GenPosition=function(a,o,l){var u={},c,h,f,g,m,_,E,M,y,w,v,S,P,I,b,D,O,T,x,R,z,rt,Z,ct,G,X,k,V,A;return l?l===i.LONG_UNROLL&&(l|=i.STANDARD):l=i.STANDARD,l&=this.caps&i.OUT_MASK,u.lat1=this.lat1,u.azi1=this.azi1,u.lon1=l&i.LONG_UNROLL?this.lon1:s.AngNormalize(this.lon1),a?u.a12=o:u.s12=o,a||this.caps&i.DISTANCE_IN&i.OUT_MASK?(g=0,m=0,a?(c=o*s.degree,X=s.sincosd(o),h=X.s,f=X.c):(M=o/(this._b*(1+this._A1m1)),y=Math.sin(M),w=Math.cos(M),g=-i.SinCosSeries(!0,this._stau1*w+this._ctau1*y,this._ctau1*w-this._stau1*y,this._C1pa),c=M-(g-this._B11),h=Math.sin(c),f=Math.cos(c),Math.abs(this.f)>.01&&(_=this._ssig1*f+this._csig1*h,E=this._csig1*f-this._ssig1*h,g=i.SinCosSeries(!0,_,E,this._C1a),v=(1+this._A1m1)*(c+(g-this._B11))-o/this._b,c=c-v/Math.sqrt(1+this._k2*s.sq(_)),h=Math.sin(c),f=Math.cos(c))),_=this._ssig1*f+this._csig1*h,E=this._csig1*f-this._ssig1*h,rt=Math.sqrt(1+this._k2*s.sq(_)),l&(i.DISTANCE|i.REDUCEDLENGTH|i.GEODESICSCALE)&&((a||Math.abs(this.f)>.01)&&(g=i.SinCosSeries(!0,_,E,this._C1a)),m=(1+this._A1m1)*(g-this._B11)),D=this._calp0*_,O=s.hypot(this._salp0,this._calp0*E),O===0&&(O=E=i.tiny_),R=this._salp0,z=this._calp0*E,a&&l&i.DISTANCE&&(u.s12=this._b*((1+this._A1m1)*c+m)),l&i.LONGITUDE&&(T=this._salp0*_,x=E,b=s.copysign(1,this._salp0),S=l&i.LONG_UNROLL?b*(c-(Math.atan2(_,E)-Math.atan2(this._ssig1,this._csig1))+(Math.atan2(b*T,x)-Math.atan2(b*this._somg1,this._comg1))):Math.atan2(T*this._comg1-x*this._somg1,x*this._comg1+T*this._somg1),P=S+this._A3c*(c+(i.SinCosSeries(!0,_,E,this._C3a)-this._B31)),I=P/s.degree,u.lon2=l&i.LONG_UNROLL?this.lon1+I:s.AngNormalize(s.AngNormalize(this.lon1)+s.AngNormalize(I))),l&i.LATITUDE&&(u.lat2=s.atan2d(D,this._f1*O)),l&i.AZIMUTH&&(u.azi2=s.atan2d(R,z)),l&(i.REDUCEDLENGTH|i.GEODESICSCALE)&&(Z=i.SinCosSeries(!0,_,E,this._C2a),ct=(1+this._A2m1)*(Z-this._B21),G=(this._A1m1-this._A2m1)*c+(m-ct),l&i.REDUCEDLENGTH&&(u.m12=this._b*(rt*(this._csig1*_)-this._dn1*(this._ssig1*E)-this._csig1*E*G)),l&i.GEODESICSCALE&&(X=this._k2*(_-this._ssig1)*(_+this._ssig1)/(this._dn1+rt),u.M12=f+(X*_-E*G)*this._ssig1/this._dn1,u.M21=f-(X*this._ssig1-this._csig1*G)*_/rt)),l&i.AREA&&(k=i.SinCosSeries(!1,_,E,this._C4a),this._calp0===0||this._salp0===0?(V=R*this.calp1-z*this.salp1,A=z*this.calp1+R*this.salp1):(V=this._calp0*this._salp0*(f<=0?this._csig1*(1-f)+h*this._ssig1:h*(this._csig1*h/(1+f)+this._ssig1)),A=s.sq(this._salp0)+s.sq(this._calp0)*this._csig1*E),u.S12=this._c2*Math.atan2(V,A)+this._A4*(k-this._B41)),a||(u.a12=c/s.degree),u):(u.a12=NaN,u)},n.GeodesicLine.prototype.Position=function(a,o){return this.GenPosition(!1,a,o)},n.GeodesicLine.prototype.ArcPosition=function(a,o){return this.GenPosition(!0,a,o)},n.GeodesicLine.prototype.GenSetDistance=function(a,o){a?this.SetArc(o):this.SetDistance(o)},n.GeodesicLine.prototype.SetDistance=function(a){var o;this.s13=a,o=this.GenPosition(!1,this.s13,i.ARC),this.a13=0+o.a12},n.GeodesicLine.prototype.SetArc=function(a){var o;this.a13=a,o=this.GenPosition(!0,this.a13,i.DISTANCE),this.s13=0+o.s12}}(e.Geodesic,e.GeodesicLine,e.Math),function(i,n,s,a){var o,l,u,c;o=function(h,f){var g=s.AngDiff(h,f).d;return h=s.AngNormalize(h),f=s.AngNormalize(f),g>0&&(h<0&&f>=0||h>0&&f===0)?1:g<0&&h>=0&&f<0?-1:0},l=function(h,f){return h=h%720,f=f%720,(0<=f&&f<360||f<-360?0:1)-(0<=h&&h<360||h<-360?0:1)},u=function(h,f,g,m,_){return h.Remainder(f),g&1&&h.Add((h.Sum()<0?1:-1)*f/2),m||h.Negate(),_?h.Sum()>f/2?h.Add(-f):h.Sum()<=-f/2&&h.Add(+f):h.Sum()>=f?h.Add(-f):h.Sum()<0&&h.Add(+f),0+h.Sum()},c=function(h,f,g,m,_){return h=s.remainder(h,f),g&1&&(h+=(h<0?1:-1)*f/2),m||(h*=-1),_?h>f/2?h-=f:h<=-f/2&&(h+=f):h>=f?h-=f:h<0&&(h+=f),0+h},i.PolygonArea=function(h,f){this._geod=h,this.a=this._geod.a,this.f=this._geod.f,this._area0=4*Math.PI*h._c2,this.polyline=f||!1,this._mask=n.LATITUDE|n.LONGITUDE|n.DISTANCE|(this.polyline?n.NONE:n.AREA|n.LONG_UNROLL),this.polyline||(this._areasum=new a.Accumulator(0)),this._perimetersum=new a.Accumulator(0),this.Clear()},i.PolygonArea.prototype.Clear=function(){this.num=0,this._crossings=0,this.polyline||this._areasum.Set(0),this._perimetersum.Set(0),this._lat0=this._lon0=this.lat=this.lon=NaN},i.PolygonArea.prototype.AddPoint=function(h,f){var g;this.num===0?(this._lat0=this.lat=h,this._lon0=this.lon=f):(g=this._geod.Inverse(this.lat,this.lon,h,f,this._mask),this._perimetersum.Add(g.s12),this.polyline||(this._areasum.Add(g.S12),this._crossings+=o(this.lon,f)),this.lat=h,this.lon=f),++this.num},i.PolygonArea.prototype.AddEdge=function(h,f){var g;this.num&&(g=this._geod.Direct(this.lat,this.lon,h,f,this._mask),this._perimetersum.Add(f),this.polyline||(this._areasum.Add(g.S12),this._crossings+=l(this.lon,g.lon2)),this.lat=g.lat2,this.lon=g.lon2),++this.num},i.PolygonArea.prototype.Compute=function(h,f){var g={number:this.num},m,_;return this.num<2?(g.perimeter=0,this.polyline||(g.area=0),g):this.polyline?(g.perimeter=this._perimetersum.Sum(),g):(m=this._geod.Inverse(this.lat,this.lon,this._lat0,this._lon0,this._mask),g.perimeter=this._perimetersum.Sum(m.s12),_=new a.Accumulator(this._areasum),_.Add(m.S12),g.area=u(_,this._area0,this._crossings+o(this.lon,this._lon0),h,f),g)},i.PolygonArea.prototype.TestPoint=function(h,f,g,m){var _={number:this.num+1},E,M,y,w;if(this.num===0)return _.perimeter=0,this.polyline||(_.area=0),_;for(_.perimeter=this._perimetersum.Sum(),M=this.polyline?0:this._areasum.Sum(),y=this._crossings,w=0;w<(this.polyline?1:2);++w)E=this._geod.Inverse(w===0?this.lat:h,w===0?this.lon:f,w!==0?this._lat0:h,w!==0?this._lon0:f,this._mask),_.perimeter+=E.s12,this.polyline||(M+=E.S12,y+=o(w===0?this.lon:f,w!==0?this._lon0:f));return this.polyline||(_.area=c(M,this._area0,y,g,m)),_},i.PolygonArea.prototype.TestEdge=function(h,f,g,m){var _={number:this.num?this.num+1:0},E,M,y;return this.num===0||(_.perimeter=this._perimetersum.Sum()+f,this.polyline)||(M=this._areasum.Sum(),y=this._crossings,E=this._geod.Direct(this.lat,this.lon,h,f,this._mask),M+=E.S12,y+=l(this.lon,E.lon2),y+=o(E.lon2,this._lon0),E=this._geod.Inverse(E.lat2,E.lon2,this._lat0,this._lon0,this._mask),_.perimeter+=E.s12,M+=E.S12,_.area=c(M,this._area0,y,g,m)),_}}(e.PolygonArea,e.Geodesic,e.Math,e.Accumulator),t(e)})(function(t){r.exports?r.exports=t:window.geodesic=t})}(xd)),xd.exports}var PP=SP();function CP(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.g=new PP.Geodesic.Geodesic(this.a,this.es/(1+Math.sqrt(1-this.es)))}function IP(r){var t=r.x,e=r.y,i=Math.sin(r.y),n=Math.cos(r.y),s=ht(t-this.long0),a,o,l,u,c,h,f,g,m,_,E,M,y,w,v;return this.sphere?Math.abs(this.sin_p12-1)<=st?(r.x=this.x0+this.a*(Q-e)*Math.sin(s),r.y=this.y0-this.a*(Q-e)*Math.cos(s),r):Math.abs(this.sin_p12+1)<=st?(r.x=this.x0+this.a*(Q+e)*Math.sin(s),r.y=this.y0+this.a*(Q+e)*Math.cos(s),r):(m=this.sin_p12*i+this.cos_p12*n*Math.cos(s),f=Math.acos(m),g=f?f/Math.sin(f):1,r.x=this.x0+this.a*g*n*Math.sin(s),r.y=this.y0+this.a*g*(this.cos_p12*i-this.sin_p12*n*Math.cos(s)),r):(a=Ih(this.es),o=Mh(this.es),l=Nh(this.es),u=bh(this.es),Math.abs(this.sin_p12-1)<=st?(c=this.a*Xr(a,o,l,u,Q),h=this.a*Xr(a,o,l,u,e),r.x=this.x0+(c-h)*Math.sin(s),r.y=this.y0-(c-h)*Math.cos(s),r):Math.abs(this.sin_p12+1)<=st?(c=this.a*Xr(a,o,l,u,Q),h=this.a*Xr(a,o,l,u,e),r.x=this.x0+(c+h)*Math.sin(s),r.y=this.y0+(c+h)*Math.cos(s),r):Math.abs(t)<st&&Math.abs(e-this.lat0)<st?(r.x=r.y=0,r):(_=this.lat0/de,E=this.long0/de,M=e/de,y=t/de,w=this.g.Inverse(_,E,M,y,this.g.AZIMUTH),v=w.azi1*de,r.x=w.s12*Math.sin(v),r.y=w.s12*Math.cos(v),r))}function MP(r){r.x-=this.x0,r.y-=this.y0;var t,e,i,n,s,a,o,l,u,c,h,f,g,m,_,E,M,y;return this.sphere?(t=Math.sqrt(r.x*r.x+r.y*r.y),t>2*Q*this.a?void 0:(e=t/this.a,i=Math.sin(e),n=Math.cos(e),s=this.long0,Math.abs(t)<=st?a=this.lat0:(a=va(n*this.sin_p12+r.y*i*this.cos_p12/t),o=Math.abs(this.lat0)-Q,Math.abs(o)<=st?this.lat0>=0?s=ht(this.long0+Math.atan2(r.x,-r.y)):s=ht(this.long0-Math.atan2(-r.x,r.y)):s=ht(this.long0+Math.atan2(r.x*i,t*this.cos_p12*n-r.y*this.sin_p12*i))),r.x=s,r.y=a,r)):(l=Ih(this.es),u=Mh(this.es),c=Nh(this.es),h=bh(this.es),Math.abs(this.sin_p12-1)<=st?(f=this.a*Xr(l,u,c,h,Q),t=Math.sqrt(r.x*r.x+r.y*r.y),g=f-t,a=Yc(g/this.a,l,u,c,h),s=ht(this.long0+Math.atan2(r.x,-1*r.y)),r.x=s,r.y=a,r):Math.abs(this.sin_p12+1)<=st?(f=this.a*Xr(l,u,c,h,Q),t=Math.sqrt(r.x*r.x+r.y*r.y),g=t-f,a=Yc(g/this.a,l,u,c,h),s=ht(this.long0+Math.atan2(r.x,r.y)),r.x=s,r.y=a,r):(m=this.lat0/de,_=this.long0/de,E=Math.atan2(r.x,r.y)/de,M=Math.sqrt(r.x*r.x+r.y*r.y),y=this.g.Direct(m,_,E,M,this.g.STANDARD),r.x=y.lon2*de,r.y=y.lat2*de,r))}var NP=["Azimuthal_Equidistant","aeqd"];const bP={init:CP,forward:IP,inverse:MP,names:NP};function TP(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function DP(r){var t,e,i,n,s,a,o,l,u=r.x,c=r.y;return i=ht(u-this.long0),t=Math.sin(c),e=Math.cos(c),n=Math.cos(i),a=this.sin_p14*t+this.cos_p14*e*n,s=1,(a>0||Math.abs(a)<=st)&&(o=this.a*s*e*Math.sin(i),l=this.y0+this.a*s*(this.cos_p14*t-this.sin_p14*e*n)),r.x=o,r.y=l,r}function xP(r){var t,e,i,n,s,a,o;return r.x-=this.x0,r.y-=this.y0,t=Math.sqrt(r.x*r.x+r.y*r.y),e=va(t/this.a),i=Math.sin(e),n=Math.cos(e),a=this.long0,Math.abs(t)<=st?(o=this.lat0,r.x=a,r.y=o,r):(o=va(n*this.sin_p14+r.y*i*this.cos_p14/t),s=Math.abs(this.lat0)-Q,Math.abs(s)<=st?(this.lat0>=0?a=ht(this.long0+Math.atan2(r.x,-r.y)):a=ht(this.long0-Math.atan2(-r.x,r.y)),r.x=a,r.y=o,r):(a=ht(this.long0+Math.atan2(r.x*i,t*this.cos_p14*n-r.y*this.sin_p14*i)),r.x=a,r.y=o,r))}var OP=["ortho"];const AP={init:TP,forward:DP,inverse:xP,names:OP};var xe={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},re={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function LP(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=Q-ee/2?this.face=xe.TOP:this.lat0<=-(Q-ee/2)?this.face=xe.BOTTOM:Math.abs(this.long0)<=ee?this.face=xe.FRONT:Math.abs(this.long0)<=Q+ee?this.face=this.long0>0?xe.RIGHT:xe.LEFT:this.face=xe.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function RP(r){var t={x:0,y:0},e,i,n,s,a,o,l={value:0};if(r.x-=this.long0,this.es!==0?e=Math.atan(this.one_minus_f_squared*Math.tan(r.y)):e=r.y,i=r.x,this.face===xe.TOP)s=Q-e,i>=ee&&i<=Q+ee?(l.value=re.AREA_0,n=i-Q):i>Q+ee||i<=-(Q+ee)?(l.value=re.AREA_1,n=i>0?i-mr:i+mr):i>-(Q+ee)&&i<=-ee?(l.value=re.AREA_2,n=i+Q):(l.value=re.AREA_3,n=i);else if(this.face===xe.BOTTOM)s=Q+e,i>=ee&&i<=Q+ee?(l.value=re.AREA_0,n=-i+Q):i<ee&&i>=-ee?(l.value=re.AREA_1,n=-i):i<-ee&&i>=-(Q+ee)?(l.value=re.AREA_2,n=-i-Q):(l.value=re.AREA_3,n=i>0?-i+mr:-i-mr);else{var u,c,h,f,g,m,_;this.face===xe.RIGHT?i=Du(i,+Q):this.face===xe.BACK?i=Du(i,3.14159265359):this.face===xe.LEFT&&(i=Du(i,-Q)),f=Math.sin(e),g=Math.cos(e),m=Math.sin(i),_=Math.cos(i),u=g*_,c=g*m,h=f,this.face===xe.FRONT?(s=Math.acos(u),n=Jc(s,h,c,l)):this.face===xe.RIGHT?(s=Math.acos(c),n=Jc(s,h,-u,l)):this.face===xe.BACK?(s=Math.acos(-u),n=Jc(s,h,-c,l)):this.face===xe.LEFT?(s=Math.acos(-c),n=Jc(s,h,u,l)):(s=n=0,l.value=re.AREA_0)}return o=Math.atan(12/mr*(n+Math.acos(Math.sin(n)*Math.cos(ee))-Q)),a=Math.sqrt((1-Math.cos(s))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(n))))),l.value===re.AREA_1?o+=Q:l.value===re.AREA_2?o+=mr:l.value===re.AREA_3&&(o+=1.5*mr),t.x=a*Math.cos(o),t.y=a*Math.sin(o),t.x=t.x*this.a+this.x0,t.y=t.y*this.a+this.y0,r.x=t.x,r.y=t.y,r}function FP(r){var t={lam:0,phi:0},e,i,n,s,a,o,l,u,c,h={value:0};if(r.x=(r.x-this.x0)/this.a,r.y=(r.y-this.y0)/this.a,i=Math.atan(Math.sqrt(r.x*r.x+r.y*r.y)),e=Math.atan2(r.y,r.x),r.x>=0&&r.x>=Math.abs(r.y)?h.value=re.AREA_0:r.y>=0&&r.y>=Math.abs(r.x)?(h.value=re.AREA_1,e-=Q):r.x<0&&-r.x>=Math.abs(r.y)?(h.value=re.AREA_2,e=e<0?e+mr:e-mr):(h.value=re.AREA_3,e+=Q),c=mr/12*Math.tan(e),a=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),o=Math.atan(a),n=Math.cos(e),s=Math.tan(i),l=1-n*n*s*s*(1-Math.cos(Math.atan(1/Math.cos(o)))),l<-1?l=-1:l>1&&(l=1),this.face===xe.TOP)u=Math.acos(l),t.phi=Q-u,h.value===re.AREA_0?t.lam=o+Q:h.value===re.AREA_1?t.lam=o<0?o+mr:o-mr:h.value===re.AREA_2?t.lam=o-Q:t.lam=o;else if(this.face===xe.BOTTOM)u=Math.acos(l),t.phi=u-Q,h.value===re.AREA_0?t.lam=-o+Q:h.value===re.AREA_1?t.lam=-o:h.value===re.AREA_2?t.lam=-o-Q:t.lam=o<0?-o-mr:-o+mr;else{var f,g,m;f=l,c=f*f,c>=1?m=0:m=Math.sqrt(1-c)*Math.sin(o),c+=m*m,c>=1?g=0:g=Math.sqrt(1-c),h.value===re.AREA_1?(c=g,g=-m,m=c):h.value===re.AREA_2?(g=-g,m=-m):h.value===re.AREA_3&&(c=g,g=m,m=-c),this.face===xe.RIGHT?(c=f,f=-g,g=c):this.face===xe.BACK?(f=-f,g=-g):this.face===xe.LEFT&&(c=f,f=g,g=-c),t.phi=Math.acos(-m)-Q,t.lam=Math.atan2(g,f),this.face===xe.RIGHT?t.lam=Du(t.lam,-Q):this.face===xe.BACK?t.lam=Du(t.lam,-3.14159265359):this.face===xe.LEFT&&(t.lam=Du(t.lam,+Q))}if(this.es!==0){var _,E,M;_=t.phi<0?1:0,E=Math.tan(t.phi),M=this.b/Math.sqrt(E*E+this.one_minus_f_squared),t.phi=Math.atan(Math.sqrt(this.a*this.a-M*M)/(this.one_minus_f*M)),_&&(t.phi=-t.phi)}return t.lam+=this.long0,r.x=t.lam,r.y=t.phi,r}function Jc(r,t,e,i){var n;return r<st?(i.value=re.AREA_0,n=0):(n=Math.atan2(t,e),Math.abs(n)<=ee?i.value=re.AREA_0:n>ee&&n<=Q+ee?(i.value=re.AREA_1,n-=Q):n>Q+ee||n<=-(Q+ee)?(i.value=re.AREA_2,n=n>=0?n-mr:n+mr):(i.value=re.AREA_3,n+=Q)),n}function Du(r,t){var e=r+t;return e<-3.14159265359?e+=_h:e>3.14159265359&&(e-=_h),e}var GP=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const kP={init:LP,forward:RP,inverse:FP,names:GP};var Od=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Th=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],h0=.8487,c0=1.3523,f0=$n/5,zP=1/f0,xu=18,Kc=function(r,t){return r[0]+t*(r[1]+t*(r[2]+t*r[3]))},VP=function(r,t){return r[1]+t*(2*r[2]+t*3*r[3])};function UP(r,t,e,i){for(var n=t;i;--i){var s=r(n);if(n-=s,Math.abs(s)<e)break}return n}function qP(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function WP(r){var t=ht(r.x-this.long0),e=Math.abs(r.y),i=Math.floor(e*f0);i<0?i=0:i>=xu&&(i=xu-1),e=$n*(e-zP*i);var n={x:Kc(Od[i],e)*t,y:Kc(Th[i],e)};return r.y<0&&(n.y=-n.y),n.x=n.x*this.a*h0+this.x0,n.y=n.y*this.a*c0+this.y0,n}function HP(r){var t={x:(r.x-this.x0)/(this.a*h0),y:Math.abs(r.y-this.y0)/(this.a*c0)};if(t.y>=1)t.x/=Od[xu][0],t.y=r.y<0?-Q:Q;else{var e=Math.floor(t.y*xu);for(e<0?e=0:e>=xu&&(e=xu-1);;)if(Th[e][0]>t.y)--e;else if(Th[e+1][0]<=t.y)++e;else break;var i=Th[e],n=5*(t.y-i[0])/(Th[e+1][0]-i[0]);n=UP(function(s){return(Kc(i,s)-t.y)/VP(i,s)},n,st,100),t.x/=Kc(Od[e],n),t.y=(5*e+n)*de,r.y<0&&(t.y=-t.y)}return t.x=ht(t.x+this.long0),t}var XP=["Robinson","robin"];const YP={init:qP,forward:WP,inverse:HP,names:XP};function JP(){this.name="geocent"}function KP(r){var t=Vm(r,this.es,this.a);return t}function QP(r){var t=Um(r,this.es,this.a,this.b);return t}var ZP=["Geocentric","geocentric","geocent","Geocent"];const BP={init:JP,forward:KP,inverse:QP,names:ZP};var xr={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},Dh={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function $P(){if(Object.keys(Dh).forEach((function(e){if(typeof this[e]>"u")this[e]=Dh[e].def;else{if(Dh[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);Dh[e].num&&(this[e]=parseFloat(this[e]))}Dh[e].degrees&&(this[e]=this[e]*de)}).bind(this)),Math.abs(Math.abs(this.lat0)-Q)<st?this.mode=this.lat0<0?xr.S_POLE:xr.N_POLE:Math.abs(this.lat0)<st?this.mode=xr.EQUIT:(this.mode=xr.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var r=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(r),this.sw=Math.sin(r)}function jP(r){r.x-=this.long0;var t=Math.sin(r.y),e=Math.cos(r.y),i=Math.cos(r.x),n,s;switch(this.mode){case xr.OBLIQ:s=this.sinph0*t+this.cosph0*e*i;break;case xr.EQUIT:s=e*i;break;case xr.S_POLE:s=-t;break;case xr.N_POLE:s=t;break}switch(s=this.pn1/(this.p-s),n=s*e*Math.sin(r.x),this.mode){case xr.OBLIQ:s*=this.cosph0*t-this.sinph0*e*i;break;case xr.EQUIT:s*=t;break;case xr.N_POLE:s*=-(e*i);break;case xr.S_POLE:s*=e*i;break}var a,o;return a=s*this.cg+n*this.sg,o=1/(a*this.sw*this.h1+this.cw),n=(n*this.cg-s*this.sg)*this.cw*o,s=a*o,r.x=n*this.a,r.y=s*this.a,r}function tC(r){r.x/=this.a,r.y/=this.a;var t={x:r.x,y:r.y},e,i,n;n=1/(this.pn1-r.y*this.sw),e=this.pn1*r.x*n,i=this.pn1*r.y*this.cw*n,r.x=e*this.cg+i*this.sg,r.y=i*this.cg-e*this.sg;var s=li(r.x,r.y);if(Math.abs(s)<st)t.x=0,t.y=r.y;else{var a,o;switch(o=1-s*s*this.pfact,o=(this.p-Math.sqrt(o))/(this.pn1/s+s/this.pn1),a=Math.sqrt(1-o*o),this.mode){case xr.OBLIQ:t.y=Math.asin(a*this.sinph0+r.y*o*this.cosph0/s),r.y=(a-this.sinph0*Math.sin(t.y))*s,r.x*=o*this.cosph0;break;case xr.EQUIT:t.y=Math.asin(r.y*o/s),r.y=a*s,r.x*=o;break;case xr.N_POLE:t.y=Math.asin(a),r.y=-r.y;break;case xr.S_POLE:t.y=-Math.asin(a);break}t.x=Math.atan2(r.x,r.y)}return r.x=t.x+this.long0,r.y=t.y,r}var eC=["Tilted_Perspective","tpers"];const rC={init:$P,forward:jP,inverse:tC,names:eC};function iC(){if(this.flip_axis=this.sweep==="x"?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var r=1-this.es,t=1/r;this.radius_p=Math.sqrt(r),this.radius_p2=r,this.radius_p_inv2=t,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function nC(r){var t=r.x,e=r.y,i,n,s,a;if(t=t-this.long0,this.shape==="ellipse"){e=Math.atan(this.radius_p2*Math.tan(e));var o=this.radius_p/li(this.radius_p*Math.cos(e),Math.sin(e));if(n=o*Math.cos(t)*Math.cos(e),s=o*Math.sin(t)*Math.cos(e),a=o*Math.sin(e),(this.radius_g-n)*n-s*s-a*a*this.radius_p_inv2<0)return r.x=Number.NaN,r.y=Number.NaN,r;i=this.radius_g-n,this.flip_axis?(r.x=this.radius_g_1*Math.atan(s/li(a,i)),r.y=this.radius_g_1*Math.atan(a/i)):(r.x=this.radius_g_1*Math.atan(s/i),r.y=this.radius_g_1*Math.atan(a/li(s,i)))}else this.shape==="sphere"&&(i=Math.cos(e),n=Math.cos(t)*i,s=Math.sin(t)*i,a=Math.sin(e),i=this.radius_g-n,this.flip_axis?(r.x=this.radius_g_1*Math.atan(s/li(a,i)),r.y=this.radius_g_1*Math.atan(a/i)):(r.x=this.radius_g_1*Math.atan(s/i),r.y=this.radius_g_1*Math.atan(a/li(s,i))));return r.x=r.x*this.a,r.y=r.y*this.a,r}function sC(r){var t=-1,e=0,i=0,n,s,a,o;if(r.x=r.x/this.a,r.y=r.y/this.a,this.shape==="ellipse"){this.flip_axis?(i=Math.tan(r.y/this.radius_g_1),e=Math.tan(r.x/this.radius_g_1)*li(1,i)):(e=Math.tan(r.x/this.radius_g_1),i=Math.tan(r.y/this.radius_g_1)*li(1,e));var l=i/this.radius_p;if(n=e*e+l*l+t*t,s=2*this.radius_g*t,a=s*s-4*n*this.C,a<0)return r.x=Number.NaN,r.y=Number.NaN,r;o=(-s-Math.sqrt(a))/(2*n),t=this.radius_g+o*t,e*=o,i*=o,r.x=Math.atan2(e,t),r.y=Math.atan(i*Math.cos(r.x)/t),r.y=Math.atan(this.radius_p_inv2*Math.tan(r.y))}else if(this.shape==="sphere"){if(this.flip_axis?(i=Math.tan(r.y/this.radius_g_1),e=Math.tan(r.x/this.radius_g_1)*Math.sqrt(1+i*i)):(e=Math.tan(r.x/this.radius_g_1),i=Math.tan(r.y/this.radius_g_1)*Math.sqrt(1+e*e)),n=e*e+i*i+t*t,s=2*this.radius_g*t,a=s*s-4*n*this.C,a<0)return r.x=Number.NaN,r.y=Number.NaN,r;o=(-s-Math.sqrt(a))/(2*n),t=this.radius_g+o*t,e*=o,i*=o,r.x=Math.atan2(e,t),r.y=Math.atan(i*Math.cos(r.x)/t)}return r.x=r.x+this.long0,r}var aC=["Geostationary Satellite View","Geostationary_Satellite","geos"];const oC={init:iC,forward:nC,inverse:sC,names:aC};var xh=1.340264,Oh=-.081106,Ah=893e-6,Lh=.003796,Qc=Math.sqrt(3)/2;function lC(){this.es=0,this.long0=this.long0!==void 0?this.long0:0}function uC(r){var t=ht(r.x-this.long0),e=r.y,i=Math.asin(Qc*Math.sin(e)),n=i*i,s=n*n*n;return r.x=t*Math.cos(i)/(Qc*(xh+3*Oh*n+s*(7*Ah+9*Lh*n))),r.y=i*(xh+Oh*n+s*(Ah+Lh*n)),r.x=this.a*r.x+this.x0,r.y=this.a*r.y+this.y0,r}function hC(r){r.x=(r.x-this.x0)/this.a,r.y=(r.y-this.y0)/this.a;var t=1e-9,e=12,i=r.y,n,s,a,o,l,u;for(u=0;u<e&&(n=i*i,s=n*n*n,a=i*(xh+Oh*n+s*(Ah+Lh*n))-r.y,o=xh+3*Oh*n+s*(7*Ah+9*Lh*n),i-=l=a/o,!(Math.abs(l)<t));++u);return n=i*i,s=n*n*n,r.x=Qc*r.x*(xh+3*Oh*n+s*(7*Ah+9*Lh*n))/Math.cos(i),r.y=Math.asin(Math.sin(i)/Qc),r.x=ht(r.x+this.long0),r}var cC=["eqearth","Equal Earth","Equal_Earth"];const fC={init:lC,forward:uC,inverse:hC,names:cC};var Rh=1e-10;function dC(){var r;if(this.phi1=this.lat1,Math.abs(this.phi1)<Rh)throw new Error;this.es?(this.en=Id(this.es),this.m1=bu(this.phi1,this.am1=Math.sin(this.phi1),r=Math.cos(this.phi1),this.en),this.am1=r/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=gC,this.forward=pC):(Math.abs(this.phi1)+Rh>=Q?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=vC,this.forward=mC)}function pC(r){var t=ht(r.x-(this.long0||0)),e=r.y,i,n,s;return i=this.am1+this.m1-bu(e,n=Math.sin(e),s=Math.cos(e),this.en),n=s*t/(i*Math.sqrt(1-this.es*n*n)),r.x=i*Math.sin(n),r.y=this.am1-i*Math.cos(n),r.x=this.a*r.x+(this.x0||0),r.y=this.a*r.y+(this.y0||0),r}function gC(r){r.x=(r.x-(this.x0||0))/this.a,r.y=(r.y-(this.y0||0))/this.a;var t,e,i,n;if(e=li(r.x,r.y=this.am1-r.y),n=Md(this.am1+this.m1-e,this.es,this.en),(t=Math.abs(n))<Q)t=Math.sin(n),i=e*Math.atan2(r.x,r.y)*Math.sqrt(1-this.es*t*t)/Math.cos(n);else if(Math.abs(t-Q)<=Rh)i=0;else throw new Error;return r.x=ht(i+(this.long0||0)),r.y=ga(n),r}function mC(r){var t=ht(r.x-(this.long0||0)),e=r.y,i,n;return n=this.cphi1+this.phi1-e,Math.abs(n)>Rh?(r.x=n*Math.sin(i=t*Math.cos(e)/n),r.y=this.cphi1-n*Math.cos(i)):r.x=r.y=0,r.x=this.a*r.x+(this.x0||0),r.y=this.a*r.y+(this.y0||0),r}function vC(r){r.x=(r.x-(this.x0||0))/this.a,r.y=(r.y-(this.y0||0))/this.a;var t,e,i=li(r.x,r.y=this.cphi1-r.y);if(e=this.cphi1+this.phi1-i,Math.abs(e)>Q)throw new Error;return Math.abs(Math.abs(e)-Q)<=Rh?t=0:t=i*Math.atan2(r.x,r.y)/Math.cos(e),r.x=ht(t+(this.long0||0)),r.y=ga(e),r}var yC=["bonne","Bonne (Werner lat_1=90)"];const _C={init:dC,names:yC};function wC(r){r.Proj.projections.add(Hc),r.Proj.projections.add(Xc),r.Proj.projections.add(dE),r.Proj.projections.add(SE),r.Proj.projections.add(bE),r.Proj.projections.add(AE),r.Proj.projections.add(zE),r.Proj.projections.add(HE),r.Proj.projections.add(QE),r.Proj.projections.add(tS),r.Proj.projections.add(vS),r.Proj.projections.add(PS),r.Proj.projections.add(bS),r.Proj.projections.add(LS),r.Proj.projections.add(zS),r.Proj.projections.add(HS),r.Proj.projections.add(QS),r.Proj.projections.add(tP),r.Proj.projections.add(aP),r.Proj.projections.add(cP),r.Proj.projections.add(mP),r.Proj.projections.add(EP),r.Proj.projections.add(bP),r.Proj.projections.add(AP),r.Proj.projections.add(kP),r.Proj.projections.add(YP),r.Proj.projections.add(BP),r.Proj.projections.add(rC),r.Proj.projections.add(oC),r.Proj.projections.add(fC),r.Proj.projections.add(_C)}ai.defaultDatum="WGS84",ai.Proj=ts,ai.WGS84=new ai.Proj("WGS84"),ai.Point=Nu,ai.toPoint=Xm,ai.defs=Hr,ai.nadgrid=dw,ai.transform=Wc,ai.mgrs=xw,ai.version="__VERSION__",wC(ai);const d0=ai("+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees","+proj=geocent +datum=WGS84");function es(r){return d0.forward(r)}function p0(r){return d0.inverse(r)}const g0=ai("+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees","+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs +type=crs");function EC(r){const t=g0.forward([r[0],r[1]]);return[t[0],t[1],r[2]]}function SC(r){const t=g0.inverse([r[0],r[1]]);return[t[0],t[1],r[2]]}function m0(r,t){const e=es(r),i=es(t);return d.Vector.distance(e,i)}function Fh(r,t){const e=[];do{const i=r.length;let n=0;for(let s=0;s<i-1;++s){if(t===void 0||t==="GEODESIC"){const a=fd(r[s],r[s+1]),o=Math.abs(r[s][2]-r[s+1][2]);if(o===0)n+=a;else{const l=Math.sqrt(a*a+o*o);n+=l}}else if(t==="RHUMB"){const a=pm(r[s],r[s+1]),o=Math.abs(r[s][2]-r[s+1][2]);if(o===0)n+=a;else{const l=Math.sqrt(a*a+o*o);n+=l}}else if(t==="NONE"){const a=m0(r[s],r[s+1]);n+=a}else console.warn(`未知的arcType: ${t},导致距离无法计算!`);e.push(n)}}while(!1);return e}function Ad(r){const t="__getXyzFromPostion";let e=d.getExtProp(r,t);return(!e||!d.Vector.equals(e[0],r))&&(e=[[...r],es(r)],d.setExtProp(r,t,e)),e[1]}class v0 extends d.Destroyable{constructor(){super();p(this,"_data",this.dv(d.react(void 0)))}set data(e){this._data.value=e}get data(){return this._data.value}get dataChanged(){return this._data.changed}}class y0 extends d.Destroyable{constructor(){super(...arguments);p(this,"_dragStartEvent",this.dv(new d.Event));p(this,"_dragOverEvent",this.dv(new d.Event));p(this,"_dragLeaveEvent",this.dv(new d.Event));p(this,"_dropEvent",this.dv(new d.Event))}dragStart(e){this._dragStartEvent.emit(e)}dragOver(e){this._dragOverEvent.emit(e)}dragLeave(e){this._dragLeaveEvent.emit(e)}drop(e){this._dropEvent.emit(e)}}function PC(r,t){t&&(Reflect.has(t,"editing")?t.editing=!0:Reflect.has(t,"positionEditing")&&(t.positionEditing=!0))}function CC(r){["Czm3DTiles","View","ESCameraView","OlView","GeoCameraController"].includes(r.typeName)||(Reflect.has(r,"editing")?r.editing=!0:Reflect.has(r,"positionEditing")&&(r.positionEditing=!0)),typeof r.execOnCreating=="function"&&r.execOnCreating()}function Zc(r,t){d.getExtProp(r,"__treeItem")&&console.error("setSceneObjectTreeItem error!"),d.setExtProp(r,"__treeItem",t)}function IC(r){return d.getExtProp(r,"__treeItem")}function MC(r){if(!(r.startsWith("./")||r.startsWith("../")||r.startsWith("/")))return r;const t=document.createElement("a");t.href=r;const e=t.href;return t.remove(),e}function NC(r){try{return JSON.parse(r),!0}catch{return!1}}function bC(r){return r instanceof Function?r():r}function _0(r,t){for(let e of r)if(t.includes(e))return!0;return!1}function Ds(r,t){const e=r,i=t;return e===void 0||e.length===0||i===void 0||i.length===0?!0:_0(e,i)}function TC(r){const t=setTimeout(()=>{r(),clearTimeout(t)})}function Ou(r){let t=r%360;return t=t<0?360+t:t,t}function w0(r){return Ou(r+180)-180}function Bc(r,t,e){let i=Ou(r),n=Ou(t);Math.abs(i-n)>180&&(i<n?i+=360:n+=360);const s=i*(1-e)+n*e;return w0(s)}function Ld(r,t,e,i){return i=i||[0,0,0],i[0]=Bc(r[0],t[0],e),i[1]=Bc(r[1],t[1],e),i[2]=Bc(r[2],t[2],e),i}async function E0(r,t,e="editing"){const i=new d.Destroyable;r.ad(i);const n=t.bind(r);let s=r.viewer;if(s||await new Promise(a=>{i.ad(r.viewerChanged.don(o=>{s=o,a()}))}),!s){console.warn("viewer is undefined!,无法绑定编辑");return}return i.ad(r[`${e}Changed`].don(()=>{var a;r[`${e}`]?n():(a=(r.combinationClass?r.getMainClass():r).editingID)!=null&&a.includes("inner")&&s&&s.stopEditing()})),i.ad(s.editingEvent.don(a=>{if(a.objectIDs.includes(r.id)&&a.type==="end"){const o=r.combinationClass?r.getMainClass():r;o.editingID&&a.editingID.includes(o.editingID)?r[`${e}`]=!1:r[`${e}`]=!o.editingID.includes("outer")}})),r[`${e}`]&&n(),i}function DC(r,t){const{type:e,id:i}=r;if(e){const n=ft.create(e,i);if(n)return n.json=r,n;console.warn(`cannot create sceneObject from type(${e})`)}else console.warn(`cannot create sceneObject from type(${e})`)}function S0(r){const t=r.children&&d.every(r.children,i=>{if(!(i instanceof Or))throw new Error("!(treeItem instanceof SceneTreeItem)");return!i.show})||!1,e=r.sceneTree.getSceneObjectShowFunc(r.sceneObject);return!t||e}class Or extends d.TreeItem{constructor(e,i=!1,n,s,a=!0){super(e,i,n);p(this,"_dragDrop");p(this,"_showChangedNotAffectChildren",!1);p(this,"_showChangedNotAffectParent",!1);p(this,"_type",this.dv(d.react("Unknown")));p(this,"_isExport",this.dv(d.react(!0)));const o=()=>this.tree&&this.tree.itemsChanged.emit([this]);this.dispose(this.nameChanged.disposableOn(o)),this.name=`未命名条目(${this.id})`,this.extras=s,this._isExport.value=a;let l;const u=()=>{l&&(l(),l=void 0)};this.dispose(u),this.dispose(this.sceneObjectChanged.disposableOn(c=>{u(),c&&(l=d.bind([this,"name"],[c,"name"]))})),this.dispose(this.showChanged.disposableOn(c=>{if(e.setSceneObjectShowFunc(this.sceneObject,c),this.tree&&this.tree.forceRedraw(),this.children&&!this._showChangedNotAffectChildren)for(let h of this.children)h instanceof Or&&(h._showChangedNotAffectParent=!0,h.show=c,h._showChangedNotAffectParent=!1);this.parent&&this.parent instanceof Or&&!this._showChangedNotAffectParent&&(this.parent._showChangedNotAffectChildren=!0,this.parent.show=S0(this.parent),this.parent._showChangedNotAffectChildren=!1)})),this.dv(new d.ObjResettingWithEvent(this.sceneObjectChanged,()=>{if(!this.sceneObject)return;const c=new d.Destroyable;if("show"in this.sceneObject&&"showChanged"in this.sceneObject&&this.sceneObject.showChanged instanceof Event){const h=()=>{this.show=e.getSceneObjectShowFunc(this.sceneObject)};h(),c.dispose(this.sceneObject.showChanged.disposableOn(h))}else if("enabled"in this.sceneObject&&"enabledChanged"in this.sceneObject&&this.sceneObject.enabledChanged instanceof Event){const h=()=>{this.show=e.getSceneObjectShowFunc(this.sceneObject)};h(),c.dispose(this.sceneObject.enabledChanged.disposableOn(h))}return c})),this.childrenChangedEvent.disposableOn(()=>{const c=S0(this);this._showChangedNotAffectChildren=!0,this.show=c,this._showChangedNotAffectChildren=!1});{const c=()=>{let h="Unknown";this.sceneObject?h=this.sceneObject.typeName:this.children&&(h="Folder"),this._type.value=h};this.dispose(this.sceneObjectChanged.disposableOn(c)),this.dispose(this.childrenResetedEvent.disposableOn(c)),c()}}get dragDrop(){return this._dragDrop||(this._dragDrop=this.dv(this.sceneTree.createTreeItemDragDropFunc(this))),this._dragDrop}get type(){return this._type.value}get typeChanged(){return this._type.changed}get isExport(){return this._isExport.value}get isExportChanged(){return this._isExport.changed}set isExport(e){this._isExport.value=e}get sceneTree(){return this.tree}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(e){try{this.json=JSON.parse(e)}catch(i){console.error(`sceneTreeItem.jsonStr error ${i}`,i)}}get json(){const e=this.children&&[...this.children].filter(i=>i.isExport).map(i=>i.json);return{name:this.name,show:this.show?void 0:!1,collapsed:this.uiTreeObject.collapsed?!0:void 0,sceneObj:this.sceneObject&&this.sceneObject.json,children:e,extras:this.extras}}set json(e){if(e.name!==void 0&&(this.name=e.name),this.extras=e.extras,this._showChangedNotAffectChildren=!0,this._showChangedNotAffectParent=!0,this.show=e.show??!0,this._showChangedNotAffectChildren=!1,this._showChangedNotAffectParent=!1,this.uiTreeObject.collapsed=e.collapsed??!1,this.sceneObject=void 0,e.sceneObj&&(this.sceneObject=this.sceneTree.createSceneObjectFunc(e.sceneObj,this)),!!e.children){if(this.resetChildren(!0),!this.children)throw new Error("resetChildren(true) cannot get children!");for(let i of e.children){const n=new Or(this.tree,!0);n.json=i,this.children.push(n)}}}clone(){try{const e=new Or(this.sceneTree,!!this.children,void 0,this.extras,this.isExport);return e.json=this.json,e.name=this.sceneTree.getSceneTreeItemCloneNameFunc(this),e}catch(e){console.error(`SceneTreeItem.clone error: ${e}`,e)}}insertNewTreeItem(e,i){if(e==="FolderInnerOrAfter"||e==="FolderInnerOrBefore"||e==="FolderInner"){if(i&&i.tree!==this.tree)return console.warn("newTreeItem.tree !== this.tree"),!1;do{if(!this.children||e.includes("Or")&&this.sceneObject)break;return i&&this.children.push(i),!0}while(!1);if(e==="FolderInner")return!1;if(e==="FolderInnerOrAfter")return super.insertNewTreeItem("After",i);if(e==="FolderInnerOrBefore")return super.insertNewTreeItem("Before",i);throw new Error("should not be here!")}else return super.insertNewTreeItem(e,i)}}(r=>{r.createDefaultProps=()=>({name:"未命名条目",nameEditing:!1,sceneObject:void 0,show:!0,extras:d.reactJsonWithUndefined(void 0)})})(Or||(Or={})),d.extendClassProps(Or.prototype,Or.createDefaultProps);function P0(r,t,e){let{offsetY:i}=t;if(!t.target||!("clientTop"in t.target))return"none";i+=2,i+=t.target.clientTop;let n="none";return r.children?i<=e*.3?n="before":i>=e*.7?!r.uiTreeObject.collapsed&&r.children.length>0?n="inner":n="after":n="inner":i<=e*.5?n="before":n="after",n}class C0 extends y0{constructor(t){super(),this._treeItem=t;const{dragStartDataManager:e}=this._treeItem.sceneTree;let i="none";const n=this.disposeVar(d.createTimeoutWithStartValues(()=>{this._treeItem.uiTreeObject.moveToPositionMode=i,console.log(`uiTreeObject.moveToPositionMode = lastDragMode(${i});`)},200));function s(a){i!==a&&(i=a,n.restart())}this.dispose(this._dragStartEvent.disposableOn(a=>{e.data={type:"UITreeA",value:this._treeItem}})),this.dispose(this._dragOverEvent.disposableOn(a=>{if(a.dataTransfer){a.preventDefault();do{const o=e;if(!(o.data&&o.data.type==="UITreeA"&&o.data.value!==void 0))break;const l=o.data.value,u=this._treeItem,{tree:c}=u;if(!c)break;const h=[...c.selectedItems];~h.indexOf(l)||h.push(l);const f=P0(u,a,c.itemDivHeight);if(f==="none"||!d.Tree.canMoveToTreeItems(h,u,f))break;a.dataTransfer.dropEffect="move",s(f);return}while(!1);a.dataTransfer.dropEffect="none",s("none")}})),this.dispose(this._dropEvent.disposableOn(a=>{const o=e;if(!(o.data&&o.data.type==="UITreeA"&&o.data.value!==void 0))return;const l=o.data.value,u=this._treeItem,{tree:c}=u;if(!c)return;const h=[...c.selectedItems];~h.indexOf(l)||h.push(l);const f=P0(u,a,c.itemDivHeight);f!=="none"&&d.Tree.canMoveToTreeItems(h,u,f)&&(d.Tree.moveToTreeItems(h,u,f),o.data=void 0,s("none"))})),this.dispose(this._dragLeaveEvent.disposableOn(()=>{i="none",n.restart()}))}}function xC(r){if(!(r instanceof Or))throw new Error("defaultCreateTreeItemDragDrop !(treeItem instanceof SceneTreeItem)");return new C0(r)}function OC(r){let t=!1;do{if(!r)break;"show"in r?t=r.show??!0:"enabled"in r&&(t=r.enabled??!0)}while(!1);return t}function AC(r,t){r&&("show"in r?r.show=t:"enabled"in r&&(r.enabled=t))}const LC=["EnvironmentVariables","ScriptsLoader","SceneScript","ScriptLoader"];function RC(r){const t=[],{root:e={}}=r,i=[e];for(;i.length>0;){const n=i.pop();if(!n)throw new Error("!todo");if(n.children){for(let s of n.children)if(s.children&&i.unshift(s),s.sceneObj){const{type:a=void 0}=s.sceneObj;a||(console.warn("sceneObjJson has no type! treeItem.sceneObj: "),console.warn(s.sceneObj)),a&&LC.includes(a)&&t.push(s.sceneObj)}}}return t}async function FC(r,t){const e=RC(r);let i=0;const n=e.length;for(let s of e)if(++i,t){const a=i/n;t(a,i,n)}}class I0 extends d.Destroyable{constructor(e,i){super();p(this,"treeItemContexMenuCallback");this._sceneTree=e,this._projectManager=i}get sceneTree(){return this._sceneTree}}class GC extends d.Destroyable{constructor(e){super();p(this,"_jsonLoadingEvent",this.disposeVar(new d.Event));p(this,"_setJsonProcessing",this.disposeVar(d.createProcessingFromAsyncFunc(async(e,i)=>{this._jsonLoadingEvent.emit({type:"init"}),this._jsonLoadingEvent.emit({type:"loading"}),i&&await e.promise(this._sceneTree.preloadFunc(i)),this._setJson(i),this._jsonLoadingEvent.emit({type:"loaded"})})));this._sceneTree=e,this._setJsonProcessing.errorFunc=i=>{this._jsonLoadingEvent.emit({type:"error",error:i})}}get jsonLoadingEvent(){return this._jsonLoadingEvent}_setJson(e){try{this._sceneTree.setJson(e||{})}catch(i){console.error(`json数据装配时发生错误!error: ${i}`)}}get json(){return this._sceneTree.getJson()}set json(e){this._setJsonProcessing.restart(new d.CancelError("JSON重新赋值!"),e)}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(e){this.json=JSON.parse(e)}}function kC(r){return r.name+"_clone"}function Rd(r,t,e){if(r instanceof Or)return r.insertNewTreeItem(t,e);{const i={FolderInnerOrAfter:"InnerOrAfter",FolderInnerOrBefore:"InnerOrBefore",FolderInner:"Inner",InnerOrAfter:"InnerOrAfter",InnerOrBefore:"InnerOrBefore",Inner:"Inner",After:"After",Before:"Before"};return r.insertNewTreeItem(i[t],e)}}function zC(r){[r,...r.getDescendants()].forEach(t=>t.destroy())}const hi=class hi extends d.Tree{constructor(e,i,n,s){super(n);p(this,"_jsonLoading",this.disposeVar(new GC(this)));p(this,"createSceneObjectFunc",hi.defaultCreateSceneObjectFunc);p(this,"createTreeItemDragDropFunc",hi.defaultCreateTreeItemDragDropFunc);p(this,"preloadFunc",hi.defaultPreload);p(this,"getSceneObjectShowFunc",hi.defaultGetSceneObjectShow);p(this,"setSceneObjectShowFunc",hi.defaultSetSceneObjectShow);p(this,"getSceneTreeItemCloneNameFunc",hi.defaultGetSceneTreeItemCloneNameFunc);p(this,"debug",!1);p(this,"_contextMenu",this.disposeVar(new I0(this,this.projectManager)));p(this,"_showPropUiOnSelecting",this.disposeVar(d.react(!0)));this._name=e,this._dragStartDataManager=i,this._projectManager=s,this.dispose(this.selectedItems.changedEvent.disposableOn(()=>{var o,l;window.lssn=this.lastSelectedItem,window.lsso=(o=this.lastSelectedItem)==null?void 0:o.sceneObject,this.debug&&console.log(((l=this.lastSelectedItem)==null?void 0:l.sceneObject)??"select null")}));const{sceneObjectsManager:a}=this._projectManager;this.dispose(this.itemsDeleted.disposableOn(o=>{for(let l of o){const u=l,{sceneObject:c}=u;c&&a.deleteSceneObject(c)&&c.destroy()&&Zc(c,void 0);for(let h of u.getDescendants()){const{sceneObject:f}=h;f&&a.deleteSceneObject(f)&&f.destroy()&&Zc(f,void 0)}zC(l)}})),this.dispose(this.itemsAdded.disposableOn(o=>{for(let l of o){const u=l;u.sceneObject&&a.addSceneObject(u.sceneObject)&&Zc(u.sceneObject,u)}})),this.dispose(this.selectedItems.changedEvent.disposableOn(()=>{if(!this.showPropUiOnSelecting)return;this._projectManager.propUiTreeManager.sceneObject=void 0;const{lastSelectedItem:o}=this;o&&(this._projectManager.propUiTreeManager.sceneObject=o.sceneObject)}))}get json(){return this._jsonLoading.json}set json(e){this._jsonLoading.json=e}get jsonStr(){return this._jsonLoading.jsonStr}set jsonStr(e){this._jsonLoading.jsonStr=e}get jsonLoadingEvent(){return this._jsonLoading.jsonLoadingEvent}get name(){return this._name}get projectManager(){return this._projectManager}get contextMenu(){return this._contextMenu}get showPropUiOnSelecting(){return this._showPropUiOnSelecting.value}set showPropUiOnSelecting(e){this._showPropUiOnSelecting.value=e}get showPropUiOnSelectingChanged(){return this._showPropUiOnSelecting.changed}get sceneUiTree(){return this.uiTree}getTreeItemFromSceneObjId(e){const i=this.getDescendants();let n;for(let s of i)if(s.sceneObject&&s.sceneObject.id===e){n=s;break}return n}get dragStartDataManager(){return this._dragStartDataManager}getJson(){return{root:{children:[...this.children].filter(e=>e.isExport).map(e=>e.json)}}}setJson(e){var n;e.root=e.root||{};const i=e.root.children??[];this.root.resetChildren(!0);for(let s of i){const a=new Or(this,!0);a.json=s,(n=this.root.children)==null||n.push(a)}}testAddNewTreeItem(e,i){const n=e||this.lastSelectedItem||this.root;return n?Rd(n,i):!1}addNewTreeItem(e,i,n,s){const a=e||this.lastSelectedItem||this.root;if(a&&Rd(a,i)){const o=new Or(this,n);if(o.sceneObject=s,!Rd(a,i,o))throw new Error("currentTreeItem.insertNewTreeItem return false!");return o}}createSceneObjectTreeItem(e,i,n,s){const a=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(n,a)){console.warn(`cannot addNewTreeItem! currentTreeItem(${n?n.id:"root"})`);return}const o=ft.create(e,i);return o?this.addNewTreeItem(n,s??"FolderInnerOrAfter",!0,o):void 0}createGroupTreeItem(e,i,n,s){const a=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(n,a)){console.warn(`cannot addNewTreeItem! currentTreeItem(${n?n.id:"root"})`);return}const o=this.addNewTreeItem(n,s??"FolderInnerOrAfter",!0);if(!o){console.warn("addNewTreeItem error!");return}return o.name=e??"未命名组节点",o}createSceneObjectTreeItemFromClass(e,i,n,s){const a=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(n,a))return;const o=ft.createFromClass(e,i);return o?this.addNewTreeItem(n,a,!0,o):void 0}createSceneObjectTreeItemFromJson(e,i,n){const s=n??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(i,s))return;const a=ft.createFromJson(e);return a?this.addNewTreeItem(i,n??"FolderInnerOrAfter",!0,a):void 0}destroySceneObjectTreeItem(e){if(e===this.root){console.warn("cannot destroy root! please use function destroyAllSceneObjectTreeItems!");return}e.detachFromParent()}destroyAllSceneObjectTreeItems(){if(!this.root.children)return;const e=[...this.root.children];for(let i of e)this.destroySceneObjectTreeItem(i)}};p(hi,"defaultCreateSceneObjectFunc",DC),p(hi,"defaultCreateTreeItemDragDropFunc",xC),p(hi,"defaultPreload",FC),p(hi,"defaultGetSceneObjectShow",OC),p(hi,"defaultSetSceneObjectShow",AC),p(hi,"defaultGetSceneTreeItemCloneNameFunc",kC);let Gh=hi;const Fd={saturation:.35,brightness:1.4,gamma:.8,atmosphereScatteringIntensity:5,groundColor:[0,.09411764705882353,.3137254901960784,1]};class M0 extends d.Tree{constructor(t){super(t)}get propUiTree(){return this.uiTree}}class Gd extends d.TreeItem{constructor(t,e,i){super(t,e),this._property=i}get property(){return this._property}}class kd extends Gd{constructor(t,e){super(t,!1,e)}}class zd extends Gd{constructor(t,e){super(t,!0,e)}get groupChildren(){return this.children}}function N0(r,t){const e=new M0(t),i=r.getProperties("chinese"),n=[];for(let s of i)if(s instanceof H){const a=new zd(e,s);a.d(()=>s.destroy()),e.children.push(a),n.push(a)}else{const a=new kd(e,s);e.children.push(a),a.d(()=>s.destroy())}for(;n.length>0;){const s=n.pop();if(!s)throw new Error("should not be here!");const a=s;if(!(a.property instanceof H))throw new Error("!(treeItem.property instanceof GroupProperty)");for(let o of a.property.children)if(o instanceof H){const l=new zd(e,o);l.d(()=>o.destroy()),a.groupChildren.push(l),n.push(l)}else{const l=new kd(e,o);a.groupChildren.push(l),l.d(()=>o.destroy())}}return e.d(()=>{e.itemChildrenChanged.reset(),e.itemChildrenToChange.reset();const s=[...e.getDescendants()];s.forEach(a=>{a.children&&(a.children.length=0),a.destroy()}),s.length=0}),e}class Au extends d.Destroyable{constructor(e){super();p(this,"_propTreeReact",this.dv(d.react(void 0)));this.d(()=>this._propTreeReact.value=void 0),this.dv(new d.ObjResettingWithEvent(this.sceneObjectChanged,i=>{if(!i)return;const n=new d.Destroyable;return n.d(i.toDestroyEvent.don(()=>{this.sceneObject=void 0})),n})),this.d(this.sceneObjectChanged.don(i=>{this._propTreeReact.value=void 0,!(!i||!(i instanceof ft))&&(this._propTreeReact.value=N0(i,e))}))}get propTree(){return this._propTreeReact.value}get propTreeChanged(){return this._propTreeReact.changed}}(r=>{r.createDefaultProps=()=>({sceneObject:void 0})})(Au||(Au={})),d.extendClassProps(Au.prototype,Au.createDefaultProps);function VC(r,t,e,i=!0){i&&e(),r.dispose(t.disposableOn(e))}class UC extends d.Destroyable{constructor(e,i,n,s){super();p(this,"_sceneObjectId",this.dv(new d.SceneObjectWithId));this._id=e,this._startTimeStamp=i,this._duration=n,this._parent=s,this._sceneObjectId.id=this._id;const a=()=>{if(!this.player)return;const{currentTime:o=0}=this._parent,l=o-this._startTimeStamp;this.player.currentTime=d.clamp(l,0,this._duration)*(this.player.speed??1)};a(),this.d(this._parent.currentTimeChanged.don(a)),this.d(this.playerChanged.don(a))}get player(){return this._sceneObjectId.sceneObject instanceof bn?this._sceneObjectId.sceneObject:void 0}get playerChanged(){return this._sceneObjectId.sceneObjectChanged}}const qC=`
30
+ northing meters`+r;var f=h/2,g=0,m=0,_,E,M,y,w;return f>0&&(_=1e5/Math.pow(10,f),E=r.substring(s,s+f),g=parseFloat(E)*_,M=r.substring(s+f),m=parseFloat(M)*_),y=g+u,w=m+c,{easting:y,northing:w,zoneLetter:o,zoneNumber:a,accuracy:_}}function kw(r,t){for(var e=Zm.charCodeAt(t-1),i=1e5,n=!1;e!==r.charCodeAt(0);){if(e++,e===oi&&e++,e===rn&&e++,e>Ch){if(n)throw"Bad character: "+r;e=Mu,n=!0}i+=1e5}return i}function zw(r,t){if(r>"V")throw"MGRSPoint given invalid Northing "+r;for(var e=Bm.charCodeAt(t-1),i=0,n=!1;e!==r.charCodeAt(0);){if(e++,e===oi&&e++,e===rn&&e++,e>Ph){if(n)throw"Bad character: "+r;e=Mu,n=!0}i+=1e5}return i}function Vw(r){var t;switch(r){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+r}function Nu(r,t,e){if(!(this instanceof Nu))return new Nu(r,t,e);if(Array.isArray(r))this.x=r[0],this.y=r[1],this.z=r[2]||0;else if(typeof r=="object")this.x=r.x,this.y=r.y,this.z=r.z||0;else if(typeof r=="string"&&typeof t>"u"){var i=r.split(",");this.x=parseFloat(i[0],10),this.y=parseFloat(i[1],10),this.z=parseFloat(i[2],10)||0}else this.x=r,this.y=t,this.z=e||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Nu.fromMGRS=function(r){return new Nu(jm(r))},Nu.prototype.toMGRS=function(r){return $m([this.x,this.y],r)};var Uw=1,qw=.25,i0=.046875,n0=.01953125,s0=.01068115234375,Ww=.75,Hw=.46875,Xw=.013020833333333334,Yw=.007120768229166667,Jw=.3645833333333333,Kw=.005696614583333333,Qw=.3076171875;function Id(r){var t=[];t[0]=Uw-r*(qw+r*(i0+r*(n0+r*s0))),t[1]=r*(Ww-r*(i0+r*(n0+r*s0)));var e=r*r;return t[2]=e*(Hw-r*(Xw+r*Yw)),e*=r,t[3]=e*(Jw-r*Kw),t[4]=e*r*Qw,t}function bu(r,t,e,i){return e*=t,t*=t,i[0]*r-e*(i[1]+t*(i[2]+t*(i[3]+t*i[4])))}var Zw=20;function Md(r,t,e){for(var i=1/(1-t),n=r,s=Zw;s;--s){var a=Math.sin(n),o=1-t*a*a;if(o=(bu(n,a,Math.cos(n),e)-r)*(o*Math.sqrt(o))*i,n-=o,Math.abs(o)<st)return n}return n}function Bw(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=Id(this.es),this.ml0=bu(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function $w(r){var t=r.x,e=r.y,i=ht(t-this.long0),n,s,a,o=Math.sin(e),l=Math.cos(e);if(this.es){var c=l*i,h=Math.pow(c,2),f=this.ep2*Math.pow(l,2),g=Math.pow(f,2),m=Math.abs(l)>st?Math.tan(e):0,_=Math.pow(m,2),E=Math.pow(_,2);n=1-this.es*Math.pow(o,2),c=c/Math.sqrt(n);var M=bu(e,o,l,this.en);s=this.a*(this.k0*c*(1+h/6*(1-_+f+h/20*(5-18*_+E+14*f-58*_*f+h/42*(61+179*E-E*_-479*_)))))+this.x0,a=this.a*(this.k0*(M-this.ml0+o*i*c/2*(1+h/12*(5-_+9*f+4*g+h/30*(61+E-58*_+270*f-330*_*f+h/56*(1385+543*E-E*_-3111*_))))))+this.y0}else{var u=l*Math.sin(i);if(Math.abs(Math.abs(u)-1)<st)return 93;if(s=.5*this.a*this.k0*Math.log((1+u)/(1-u))+this.x0,a=l*Math.cos(i)/Math.sqrt(1-Math.pow(u,2)),u=Math.abs(a),u>=1){if(u-1>st)return 93;a=0}else a=Math.acos(a);e<0&&(a=-a),a=this.a*this.k0*(a-this.lat0)+this.y0}return r.x=s,r.y=a,r}function jw(r){var t,e,i,n,s=(r.x-this.x0)*(1/this.a),a=(r.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+a/this.k0,e=Md(t,this.es,this.en),Math.abs(e)<Q){var h=Math.sin(e),f=Math.cos(e),g=Math.abs(f)>st?Math.tan(e):0,m=this.ep2*Math.pow(f,2),_=Math.pow(m,2),E=Math.pow(g,2),M=Math.pow(E,2);t=1-this.es*Math.pow(h,2);var y=s*Math.sqrt(t)/this.k0,w=Math.pow(y,2);t=t*g,i=e-t*w/(1-this.es)*.5*(1-w/12*(5+3*E-9*m*E+m-4*_-w/30*(61+90*E-252*m*E+45*M+46*m-w/56*(1385+3633*E+4095*M+1574*M*E)))),n=ht(this.long0+y*(1-w/6*(1+2*E+m-w/20*(5+28*E+24*M+8*m*E+6*m-w/42*(61+662*E+1320*M+720*M*E))))/f)}else i=Q*Eh(a),n=0;else{var o=Math.exp(s/this.k0),l=.5*(o-1/o),u=this.lat0+a/this.k0,c=Math.cos(u);t=Math.sqrt((1-Math.pow(c,2))/(1+Math.pow(l,2))),i=Math.asin(t),a<0&&(i=-i),l===0&&c===0?n=0:n=ht(Math.atan2(l,c)+this.long0)}return r.x=n,r.y=i,r}var tE=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const Hc={init:Bw,forward:$w,inverse:jw,names:tE};function a0(r){var t=Math.exp(r);return t=(t-1/t)/2,t}function li(r,t){r=Math.abs(r),t=Math.abs(t);var e=Math.max(r,t),i=Math.min(r,t)/(e||1);return e*Math.sqrt(1+Math.pow(i,2))}function eE(r){var t=1+r,e=t-1;return e===0?r:r*Math.log(t)/e}function rE(r){var t=Math.abs(r);return t=eE(t*(1+t/(li(1,t)+1))),r<0?-t:t}function Nd(r,t){for(var e=2*Math.cos(2*t),i=r.length-1,n=r[i],s=0,a;--i>=0;)a=-s+e*n+r[i],s=n,n=a;return t+a*Math.sin(2*t)}function iE(r,t){for(var e=2*Math.cos(t),i=r.length-1,n=r[i],s=0,a;--i>=0;)a=-s+e*n+r[i],s=n,n=a;return Math.sin(t)*a}function nE(r){var t=Math.exp(r);return t=(t+1/t)/2,t}function o0(r,t,e){for(var i=Math.sin(t),n=Math.cos(t),s=a0(e),a=nE(e),o=2*n*a,l=-2*i*s,u=r.length-1,c=r[u],h=0,f=0,g=0,m,_;--u>=0;)m=f,_=h,f=c,h=g,c=-m+o*f-l*h+r[u],g=-_+l*f+o*h;return o=i*a,l=n*s,[o*c-l*g,o*g+l*c]}function sE(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Hc.init.apply(this),this.forward=Hc.forward,this.inverse=Hc.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var r=this.es/(1+Math.sqrt(1-this.es)),t=r/(2-r),e=t;this.cgb[0]=t*(2+t*(-.6666666666666666+t*(-2+t*(2.577777777777778+t*(.5777777777777777+t*-4.228148148148148))))),this.cbg[0]=t*(-2+t*(.6666666666666666+t*(1.3333333333333333+t*(-1.8222222222222222+t*(.7111111111111111+t*.9824338624338624))))),e=e*t,this.cgb[1]=e*(2.3333333333333335+t*(-1.6+t*(-5.044444444444444+t*(8.584126984126984+t*2.458201058201058)))),this.cbg[1]=e*(1.6666666666666667+t*(-1.0666666666666667+t*(-1.4444444444444444+t*(2.86984126984127+t*-1.6105820105820106)))),e=e*t,this.cgb[2]=e*(3.7333333333333334+t*(-3.8857142857142857+t*(-12.019047619047619+t*26.03668430335097))),this.cbg[2]=e*(-1.7333333333333334+t*(1.619047619047619+t*(1.6+t*-4.474779541446208))),e=e*t,this.cgb[3]=e*(6.792063492063492+t*(-9.485714285714286+t*-28.188500881834216)),this.cbg[3]=e*(1.9634920634920634+t*(-2.4+t*-1.7518165784832451)),e=e*t,this.cgb[4]=e*(13.250793650793652+t*-23.22238255571589),this.cbg[4]=e*(-2.3301587301587303+t*3.5144460477793813),e=e*t,this.cgb[5]=e*27.011268237934903,this.cbg[5]=e*2.8496841430174764,e=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+e*(.25+e*(.015625+e/256))),this.utg[0]=t*(-.5+t*(.6666666666666666+t*(-.3854166666666667+t*(.002777777777777778+t*(.158203125+t*-.15905919312169312))))),this.gtu[0]=t*(.5+t*(-.6666666666666666+t*(.3125+t*(.22777777777777777+t*(-.4409722222222222+t*.20875661375661375))))),this.utg[1]=e*(-.020833333333333332+t*(-.06666666666666667+t*(.3034722222222222+t*(-.4380952380952381+t*.2890188388723545)))),this.gtu[1]=e*(.2708333333333333+t*(-.6+t*(.38680555555555557+t*(.44603174603174606+t*-1.0248393063822752)))),e=e*t,this.utg[2]=e*(-.035416666666666666+t*(.04404761904761905+t*(.046651785714285715+t*-.06138668430335097))),this.gtu[2]=e*(.25416666666666665+t*(-.7357142857142858+t*(.5603050595238095+t*.9237378747795415))),e=e*t,this.utg[3]=e*(-.02726314484126984+t*(.021825396825396824+t*.11439745921516754)),this.gtu[3]=e*(.30729786706349205+t*(-1.0654761904761905+t*.9096203979276896)),e=e*t,this.utg[4]=e*(-.02841641865079365+t*.027268468414301746),this.gtu[4]=e*(.4306671626984127+t*-1.713007555715889),e=e*t,this.utg[5]=e*-.03233083094085698,this.gtu[5]=e*.6650675310896665;var i=Nd(this.cbg,this.lat0);this.Zb=-this.Qn*(i+iE(this.gtu,2*i))}function aE(r){var t=ht(r.x-this.long0),e=r.y;e=Nd(this.cbg,e);var i=Math.sin(e),n=Math.cos(e),s=Math.sin(t),a=Math.cos(t);e=Math.atan2(i,a*n),t=Math.atan2(s*n,li(i,n*a)),t=rE(Math.tan(t));var o=o0(this.gtu,2*e,2*t);e=e+o[0],t=t+o[1];var l,u;return Math.abs(t)<=2.623395162778?(l=this.a*(this.Qn*t)+this.x0,u=this.a*(this.Qn*e+this.Zb)+this.y0):(l=1/0,u=1/0),r.x=l,r.y=u,r}function oE(r){var t=(r.x-this.x0)*(1/this.a),e=(r.y-this.y0)*(1/this.a);e=(e-this.Zb)/this.Qn,t=t/this.Qn;var i,n;if(Math.abs(t)<=2.623395162778){var s=o0(this.utg,2*e,2*t);e=e+s[0],t=t+s[1],t=Math.atan(a0(t));var a=Math.sin(e),o=Math.cos(e),l=Math.sin(t),u=Math.cos(t);e=Math.atan2(a*u,li(l,u*o)),t=Math.atan2(l,u*o),i=ht(t+this.long0),n=Nd(this.cgb,e)}else i=1/0,n=1/0;return r.x=i,r.y=n,r}var lE=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const Xc={init:sE,forward:aE,inverse:oE,names:lE};function uE(r,t){if(r===void 0){if(r=Math.floor((ht(t)+Math.PI)*30/Math.PI)+1,r<0)return 0;if(r>60)return 60}return r}var hE="etmerc";function cE(){var r=uE(this.zone,this.long0);if(r===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(r)-183)*de,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Xc.init.apply(this),this.forward=Xc.forward,this.inverse=Xc.inverse}var fE=["Universal Transverse Mercator System","utm"];const dE={init:cE,names:fE,dependsOn:hE};function bd(r,t){return Math.pow((1-r)/(1+r),t)}var pE=20;function gE(){var r=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*r*r),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(r/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+ee)/(Math.pow(Math.tan(.5*this.lat0+ee),this.C)*bd(this.e*r,this.ratexp))}function mE(r){var t=r.x,e=r.y;return r.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*e+ee),this.C)*bd(this.e*Math.sin(e),this.ratexp))-Q,r.x=this.C*t,r}function vE(r){for(var t=1e-14,e=r.x/this.C,i=r.y,n=Math.pow(Math.tan(.5*i+ee)/this.K,1/this.C),s=pE;s>0&&(i=2*Math.atan(n*bd(this.e*Math.sin(r.y),-.5*this.e))-Q,!(Math.abs(i-r.y)<t));--s)r.y=i;return s?(r.x=e,r.y=i,r):null}const Td={init:gE,forward:mE,inverse:vE};function yE(){Td.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function _E(r){var t,e,i,n;return r.x=ht(r.x-this.long0),Td.forward.apply(this,[r]),t=Math.sin(r.y),e=Math.cos(r.y),i=Math.cos(r.x),n=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*e*i),r.x=n*e*Math.sin(r.x),r.y=n*(this.cosc0*t-this.sinc0*e*i),r.x=this.a*r.x+this.x0,r.y=this.a*r.y+this.y0,r}function wE(r){var t,e,i,n,s;if(r.x=(r.x-this.x0)/this.a,r.y=(r.y-this.y0)/this.a,r.x/=this.k0,r.y/=this.k0,s=li(r.x,r.y)){var a=2*Math.atan2(s,this.R2);t=Math.sin(a),e=Math.cos(a),n=Math.asin(e*this.sinc0+r.y*t*this.cosc0/s),i=Math.atan2(r.x*t,s*this.cosc0*e-r.y*this.sinc0*t)}else n=this.phic0,i=0;return r.x=i,r.y=n,Td.inverse.apply(this,[r]),r.x=ht(r.x+this.long0),r}var EE=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const SE={init:yE,forward:_E,inverse:wE,names:EE};function PE(r,t,e){return t*=e,Math.tan(.5*(Q+r))*Math.pow((1-t)/(1+t),.5*e)}function CE(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=st&&(this.k0=.5*(1+Eh(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=st&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=st&&Math.abs(Math.cos(this.lat_ts))>st&&(this.k0=.5*this.cons*jn(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Nn(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=jn(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-Q,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function IE(r){var t=r.x,e=r.y,i=Math.sin(e),n=Math.cos(e),s,a,o,l,u,c,h=ht(t-this.long0);return Math.abs(Math.abs(t-this.long0)-Math.PI)<=st&&Math.abs(e+this.lat0)<=st?(r.x=NaN,r.y=NaN,r):this.sphere?(s=2*this.k0/(1+this.sinlat0*i+this.coslat0*n*Math.cos(h)),r.x=this.a*s*n*Math.sin(h)+this.x0,r.y=this.a*s*(this.coslat0*i-this.sinlat0*n*Math.cos(h))+this.y0,r):(a=2*Math.atan(this.ssfn_(e,i,this.e))-Q,l=Math.cos(a),o=Math.sin(a),Math.abs(this.coslat0)<=st?(u=Nn(this.e,e*this.con,this.con*i),c=2*this.a*this.k0*u/this.cons,r.x=this.x0+c*Math.sin(t-this.long0),r.y=this.y0-this.con*c*Math.cos(t-this.long0),r):(Math.abs(this.sinlat0)<st?(s=2*this.a*this.k0/(1+l*Math.cos(h)),r.y=s*o):(s=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*o+this.cosX0*l*Math.cos(h))),r.y=s*(this.cosX0*o-this.sinX0*l*Math.cos(h))+this.y0),r.x=s*l*Math.sin(h)+this.x0,r))}function ME(r){r.x-=this.x0,r.y-=this.y0;var t,e,i,n,s,a=Math.sqrt(r.x*r.x+r.y*r.y);if(this.sphere){var o=2*Math.atan(a/(2*this.a*this.k0));return t=this.long0,e=this.lat0,a<=st?(r.x=t,r.y=e,r):(e=Math.asin(Math.cos(o)*this.sinlat0+r.y*Math.sin(o)*this.coslat0/a),Math.abs(this.coslat0)<st?this.lat0>0?t=ht(this.long0+Math.atan2(r.x,-1*r.y)):t=ht(this.long0+Math.atan2(r.x,r.y)):t=ht(this.long0+Math.atan2(r.x*Math.sin(o),a*this.coslat0*Math.cos(o)-r.y*this.sinlat0*Math.sin(o))),r.x=t,r.y=e,r)}else if(Math.abs(this.coslat0)<=st){if(a<=st)return e=this.lat0,t=this.long0,r.x=t,r.y=e,r;r.x*=this.con,r.y*=this.con,i=a*this.cons/(2*this.a*this.k0),e=this.con*Sh(this.e,i),t=this.con*ht(this.con*this.long0+Math.atan2(r.x,-1*r.y))}else n=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,a<=st?s=this.X0:(s=Math.asin(Math.cos(n)*this.sinX0+r.y*Math.sin(n)*this.cosX0/a),t=ht(this.long0+Math.atan2(r.x*Math.sin(n),a*this.cosX0*Math.cos(n)-r.y*this.sinX0*Math.sin(n)))),e=-1*Sh(this.e,Math.tan(.5*(Q+s)));return r.x=t,r.y=e,r}var NE=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"];const bE={init:CE,forward:IE,inverse:ME,names:NE,ssfn_:PE};function TE(){var r=this.lat0;this.lambda0=this.long0;var t=Math.sin(r),e=this.a,i=this.rf,n=1/i,s=2*n-Math.pow(n,2),a=this.e=Math.sqrt(s);this.R=this.k0*e*Math.sqrt(1-s)/(1-s*Math.pow(t,2)),this.alpha=Math.sqrt(1+s/(1-s)*Math.pow(Math.cos(r),4)),this.b0=Math.asin(t/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),l=Math.log(Math.tan(Math.PI/4+r/2)),u=Math.log((1+a*t)/(1-a*t));this.K=o-this.alpha*l+this.alpha*a/2*u}function DE(r){var t=Math.log(Math.tan(Math.PI/4-r.y/2)),e=this.e/2*Math.log((1+this.e*Math.sin(r.y))/(1-this.e*Math.sin(r.y))),i=-this.alpha*(t+e)+this.K,n=2*(Math.atan(Math.exp(i))-Math.PI/4),s=this.alpha*(r.x-this.lambda0),a=Math.atan(Math.sin(s)/(Math.sin(this.b0)*Math.tan(n)+Math.cos(this.b0)*Math.cos(s))),o=Math.asin(Math.cos(this.b0)*Math.sin(n)-Math.sin(this.b0)*Math.cos(n)*Math.cos(s));return r.y=this.R/2*Math.log((1+Math.sin(o))/(1-Math.sin(o)))+this.y0,r.x=this.R*a+this.x0,r}function xE(r){for(var t=r.x-this.x0,e=r.y-this.y0,i=t/this.R,n=2*(Math.atan(Math.exp(e/this.R))-Math.PI/4),s=Math.asin(Math.cos(this.b0)*Math.sin(n)+Math.sin(this.b0)*Math.cos(n)*Math.cos(i)),a=Math.atan(Math.sin(i)/(Math.cos(this.b0)*Math.cos(i)-Math.sin(this.b0)*Math.tan(n))),o=this.lambda0+a/this.alpha,l=0,u=s,c=-1e3,h=0;Math.abs(u-c)>1e-7;){if(++h>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+s/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(u))/2)),c=u,u=2*Math.atan(Math.exp(l))-Math.PI/2}return r.x=o,r.y=u,r}var OE=["somerc"];const AE={init:TE,forward:DE,inverse:xE,names:OE};var Tu=1e-7;function LE(r){var t=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],e=typeof r.projName=="object"?Object.keys(r.projName)[0]:r.projName;return"no_uoff"in r||"no_off"in r||t.indexOf(e)!==-1||t.indexOf(Gm(e))!==-1}function RE(){var r,t,e,i,n,s,a,o,l,u,c=0,h,f=0,g=0,m=0,_=0,E=0,M=0;this.no_off=LE(this),this.no_rot="no_rot"in this;var y=!1;"alpha"in this&&(y=!0);var w=!1;if("rectified_grid_angle"in this&&(w=!0),y&&(M=this.alpha),w&&(c=this.rectified_grid_angle),y||w)f=this.longc;else if(g=this.long1,_=this.lat1,m=this.long2,E=this.lat2,Math.abs(_-E)<=Tu||(r=Math.abs(_))<=Tu||Math.abs(r-Q)<=Tu||Math.abs(Math.abs(this.lat0)-Q)<=Tu||Math.abs(Math.abs(E)-Q)<=Tu)throw new Error;var v=1-this.es;t=Math.sqrt(v),Math.abs(this.lat0)>st?(o=Math.sin(this.lat0),e=Math.cos(this.lat0),r=1-this.es*o*o,this.B=e*e,this.B=Math.sqrt(1+this.es*this.B*this.B/v),this.A=this.B*this.k0*t/r,i=this.B*t/(e*Math.sqrt(r)),n=i*i-1,n<=0?n=0:(n=Math.sqrt(n),this.lat0<0&&(n=-n)),this.E=n+=i,this.E*=Math.pow(Nn(this.e,this.lat0,o),this.B)):(this.B=1/t,this.A=this.k0,this.E=i=n=1),y||w?(y?(h=Math.asin(Math.sin(M)/i),w||(c=M)):(h=c,M=Math.asin(i*Math.sin(h))),this.lam0=f-Math.asin(.5*(n-1/n)*Math.tan(h))/this.B):(s=Math.pow(Nn(this.e,_,Math.sin(_)),this.B),a=Math.pow(Nn(this.e,E,Math.sin(E)),this.B),n=this.E/s,l=(a-s)/(a+s),u=this.E*this.E,u=(u-a*s)/(u+a*s),r=g-m,r<-Math.pi?m-=_h:r>Math.pi&&(m+=_h),this.lam0=ht(.5*(g+m)-Math.atan(u*Math.tan(.5*this.B*(g-m))/l)/this.B),h=Math.atan(2*Math.sin(this.B*ht(g-this.lam0))/(n-1/n)),c=M=Math.asin(i*Math.sin(h))),this.singam=Math.sin(h),this.cosgam=Math.cos(h),this.sinrot=Math.sin(c),this.cosrot=Math.cos(c),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(i*i-1)/Math.cos(M))),this.lat0<0&&(this.u_0=-this.u_0)),n=.5*h,this.v_pole_n=this.ArB*Math.log(Math.tan(ee-n)),this.v_pole_s=this.ArB*Math.log(Math.tan(ee+n))}function FE(r){var t={},e,i,n,s,a,o,l,u;if(r.x=r.x-this.lam0,Math.abs(Math.abs(r.y)-Q)>st){if(a=this.E/Math.pow(Nn(this.e,r.y,Math.sin(r.y)),this.B),o=1/a,e=.5*(a-o),i=.5*(a+o),s=Math.sin(this.B*r.x),n=(e*this.singam-s*this.cosgam)/i,Math.abs(Math.abs(n)-1)<st)throw new Error;u=.5*this.ArB*Math.log((1-n)/(1+n)),o=Math.cos(this.B*r.x),Math.abs(o)<Tu?l=this.A*r.x:l=this.ArB*Math.atan2(e*this.cosgam+s*this.singam,o)}else u=r.y>0?this.v_pole_n:this.v_pole_s,l=this.ArB*r.y;return this.no_rot?(t.x=l,t.y=u):(l-=this.u_0,t.x=u*this.cosrot+l*this.sinrot,t.y=l*this.cosrot-u*this.sinrot),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function GE(r){var t,e,i,n,s,a,o,l={};if(r.x=(r.x-this.x0)*(1/this.a),r.y=(r.y-this.y0)*(1/this.a),this.no_rot?(e=r.y,t=r.x):(e=r.x*this.cosrot-r.y*this.sinrot,t=r.y*this.cosrot+r.x*this.sinrot+this.u_0),i=Math.exp(-this.BrA*e),n=.5*(i-1/i),s=.5*(i+1/i),a=Math.sin(this.BrA*t),o=(a*this.cosgam+n*this.singam)/s,Math.abs(Math.abs(o)-1)<st)l.x=0,l.y=o<0?-Q:Q;else{if(l.y=this.E/Math.sqrt((1+o)/(1-o)),l.y=Sh(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(n*this.cosgam-a*this.singam,Math.cos(this.BrA*t))}return l.x+=this.lam0,l}var kE=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"];const zE={init:RE,forward:FE,inverse:GE,names:kE};function VE(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<st)){var r=this.b/this.a;this.e=Math.sqrt(1-r*r);var t=Math.sin(this.lat1),e=Math.cos(this.lat1),i=jn(this.e,t,e),n=Nn(this.e,this.lat1,t),s=Math.sin(this.lat2),a=Math.cos(this.lat2),o=jn(this.e,s,a),l=Nn(this.e,this.lat2,s),u=Math.abs(Math.abs(this.lat0)-Q)<st?0:Nn(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>st?this.ns=Math.log(i/o)/Math.log(n/l):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=i/(this.ns*Math.pow(n,this.ns)),this.rh=this.a*this.f0*Math.pow(u,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function UE(r){var t=r.x,e=r.y;Math.abs(2*Math.abs(e)-Math.PI)<=st&&(e=Eh(e)*(Q-2*st));var i=Math.abs(Math.abs(e)-Q),n,s;if(i>st)n=Nn(this.e,e,Math.sin(e)),s=this.a*this.f0*Math.pow(n,this.ns);else{if(i=e*this.ns,i<=0)return null;s=0}var a=this.ns*ht(t-this.long0);return r.x=this.k0*(s*Math.sin(a))+this.x0,r.y=this.k0*(this.rh-s*Math.cos(a))+this.y0,r}function qE(r){var t,e,i,n,s,a=(r.x-this.x0)/this.k0,o=this.rh-(r.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(a*a+o*o),e=1):(t=-Math.sqrt(a*a+o*o),e=-1);var l=0;if(t!==0&&(l=Math.atan2(e*a,e*o)),t!==0||this.ns>0){if(e=1/this.ns,i=Math.pow(t/(this.a*this.f0),e),n=Sh(this.e,i),n===-9999)return null}else n=-Q;return s=ht(l/this.ns+this.long0),r.x=s,r.y=n,r}var WE=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const HE={init:VE,forward:UE,inverse:qE,names:WE};function XE(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function YE(r){var t,e,i,n,s,a,o,l=r.x,u=r.y,c=ht(l-this.long0);return t=Math.pow((1+this.e*Math.sin(u))/(1-this.e*Math.sin(u)),this.alfa*this.e/2),e=2*(Math.atan(this.k*Math.pow(Math.tan(u/2+this.s45),this.alfa)/t)-this.s45),i=-c*this.alfa,n=Math.asin(Math.cos(this.ad)*Math.sin(e)+Math.sin(this.ad)*Math.cos(e)*Math.cos(i)),s=Math.asin(Math.cos(e)*Math.sin(i)/Math.cos(n)),a=this.n*s,o=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(n/2+this.s45),this.n),r.y=o*Math.cos(a)/1,r.x=o*Math.sin(a)/1,this.czech||(r.y*=-1,r.x*=-1),r}function JE(r){var t,e,i,n,s,a,o,l,u=r.x;r.x=r.y,r.y=u,this.czech||(r.y*=-1,r.x*=-1),a=Math.sqrt(r.x*r.x+r.y*r.y),s=Math.atan2(r.y,r.x),n=s/Math.sin(this.s0),i=2*(Math.atan(Math.pow(this.ro0/a,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(i)-Math.sin(this.ad)*Math.cos(i)*Math.cos(n)),e=Math.asin(Math.cos(i)*Math.sin(n)/Math.cos(t)),r.x=this.long0-e/this.alfa,o=t,l=0;var c=0;do r.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-r.y)<1e-10&&(l=1),o=r.y,c+=1;while(l===0&&c<15);return c>=15?null:r}var KE=["Krovak","krovak"];const QE={init:XE,forward:YE,inverse:JE,names:KE};function Xr(r,t,e,i,n){return r*n-t*Math.sin(2*n)+e*Math.sin(4*n)-i*Math.sin(6*n)}function Ih(r){return 1-.25*r*(1+r/16*(3+1.25*r))}function Mh(r){return .375*r*(1+.25*r*(1+.46875*r))}function Nh(r){return .05859375*r*r*(1+.75*r)}function bh(r){return r*r*r*.011393229166666666}function Dd(r,t,e){var i=t*e;return r/Math.sqrt(1-i*i)}function ga(r){return Math.abs(r)<Q?r:r-Eh(r)*Math.PI}function Yc(r,t,e,i,n){var s,a;s=r/t;for(var o=0;o<15;o++)if(a=(r-(t*s-e*Math.sin(2*s)+i*Math.sin(4*s)-n*Math.sin(6*s)))/(t-2*e*Math.cos(2*s)+4*i*Math.cos(4*s)-6*n*Math.cos(6*s)),s+=a,Math.abs(a)<=1e-10)return s;return NaN}function ZE(){this.sphere||(this.e0=Ih(this.es),this.e1=Mh(this.es),this.e2=Nh(this.es),this.e3=bh(this.es),this.ml0=this.a*Xr(this.e0,this.e1,this.e2,this.e3,this.lat0))}function BE(r){var t,e,i=r.x,n=r.y;if(i=ht(i-this.long0),this.sphere)t=this.a*Math.asin(Math.cos(n)*Math.sin(i)),e=this.a*(Math.atan2(Math.tan(n),Math.cos(i))-this.lat0);else{var s=Math.sin(n),a=Math.cos(n),o=Dd(this.a,this.e,s),l=Math.tan(n)*Math.tan(n),u=i*Math.cos(n),c=u*u,h=this.es*a*a/(1-this.es),f=this.a*Xr(this.e0,this.e1,this.e2,this.e3,n);t=o*u*(1-c*l*(.16666666666666666-(8-l+8*h)*c/120)),e=f-this.ml0+o*s/a*c*(.5+(5-l+6*h)*c/24)}return r.x=t+this.x0,r.y=e+this.y0,r}function $E(r){r.x-=this.x0,r.y-=this.y0;var t=r.x/this.a,e=r.y/this.a,i,n;if(this.sphere){var s=e+this.lat0;i=Math.asin(Math.sin(s)*Math.cos(t)),n=Math.atan2(Math.tan(t),Math.cos(s))}else{var a=this.ml0/this.a+e,o=Yc(a,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(o)-Q)<=st)return r.x=this.long0,r.y=Q,e<0&&(r.y*=-1),r;var l=Dd(this.a,this.e,Math.sin(o)),u=l*l*l/this.a/this.a*(1-this.es),c=Math.pow(Math.tan(o),2),h=t*this.a/l,f=h*h;i=o-l*Math.tan(o)/u*h*h*(.5-(1+3*c)*h*h/24),n=h*(1-f*(c/3+(1+3*c)*c*f/15))/Math.cos(o)}return r.x=ht(n+this.long0),r.y=ga(i),r}var jE=["Cassini","Cassini_Soldner","cass"];const tS={init:ZE,forward:BE,inverse:$E,names:jE};function ma(r,t){var e;return r>1e-7?(e=r*t,(1-r*r)*(t/(1-e*e)-.5/r*Math.log((1-e)/(1+e)))):2*t}var eS=1,rS=2,iS=3,nS=4;function sS(){var r=Math.abs(this.lat0);if(Math.abs(r-Q)<st?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(r)<st?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var t;switch(this.qp=ma(this.e,1),this.mmf=.5/(1-this.es),this.apa=pS(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=ma(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function aS(r){var t,e,i,n,s,a,o,l,u,c,h=r.x,f=r.y;if(h=ht(h-this.long0),this.sphere){if(s=Math.sin(f),c=Math.cos(f),i=Math.cos(h),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e=this.mode===this.EQUIT?1+c*i:1+this.sinph0*s+this.cosph0*c*i,e<=st)return null;e=Math.sqrt(2/e),t=e*c*Math.sin(h),e*=this.mode===this.EQUIT?s:this.cosph0*s-this.sinph0*c*i}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(i=-i),Math.abs(f+this.lat0)<st)return null;e=ee-f*.5,e=2*(this.mode===this.S_POLE?Math.cos(e):Math.sin(e)),t=e*Math.sin(h),e*=i}}else{switch(o=0,l=0,u=0,i=Math.cos(h),n=Math.sin(h),s=Math.sin(f),a=ma(this.e,s),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(o=a/this.qp,l=Math.sqrt(1-o*o)),this.mode){case this.OBLIQ:u=1+this.sinb1*o+this.cosb1*l*i;break;case this.EQUIT:u=1+l*i;break;case this.N_POLE:u=Q+f,a=this.qp-a;break;case this.S_POLE:u=f-Q,a=this.qp+a;break}if(Math.abs(u)<st)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:u=Math.sqrt(2/u),this.mode===this.OBLIQ?e=this.ymf*u*(this.cosb1*o-this.sinb1*l*i):e=(u=Math.sqrt(2/(1+l*i)))*o*this.ymf,t=this.xmf*u*l*n;break;case this.N_POLE:case this.S_POLE:a>=0?(t=(u=Math.sqrt(a))*n,e=i*(this.mode===this.S_POLE?u:-u)):t=e=0;break}}return r.x=this.a*t+this.x0,r.y=this.a*e+this.y0,r}function oS(r){r.x-=this.x0,r.y-=this.y0;var t=r.x/this.a,e=r.y/this.a,i,n,s,a,o,l,u;if(this.sphere){var c=0,h,f=0;if(h=Math.sqrt(t*t+e*e),n=h*.5,n>1)return null;switch(n=2*Math.asin(n),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(f=Math.sin(n),c=Math.cos(n)),this.mode){case this.EQUIT:n=Math.abs(h)<=st?0:Math.asin(e*f/h),t*=f,e=c*h;break;case this.OBLIQ:n=Math.abs(h)<=st?this.lat0:Math.asin(c*this.sinph0+e*f*this.cosph0/h),t*=f*this.cosph0,e=(c-Math.sin(n)*this.sinph0)*h;break;case this.N_POLE:e=-e,n=Q-n;break;case this.S_POLE:n-=Q;break}i=e===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(t,e)}else{if(u=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t/=this.dd,e*=this.dd,l=Math.sqrt(t*t+e*e),l<st)return r.x=this.long0,r.y=this.lat0,r;a=2*Math.asin(.5*l/this.rq),s=Math.cos(a),t*=a=Math.sin(a),this.mode===this.OBLIQ?(u=s*this.sinb1+e*a*this.cosb1/l,o=this.qp*u,e=l*this.cosb1*s-e*this.sinb1*a):(u=e*a/l,o=this.qp*u,e=l*s)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(e=-e),o=t*t+e*e,!o)return r.x=this.long0,r.y=this.lat0,r;u=1-o/this.qp,this.mode===this.S_POLE&&(u=-u)}i=Math.atan2(t,e),n=gS(Math.asin(u),this.apa)}return r.x=ht(this.long0+i),r.y=n,r}var lS=.3333333333333333,uS=.17222222222222222,hS=.10257936507936508,cS=.06388888888888888,fS=.0664021164021164,dS=.016415012942191543;function pS(r){var t,e=[];return e[0]=r*lS,t=r*r,e[0]+=t*uS,e[1]=t*cS,t*=r,e[0]+=t*hS,e[1]+=t*fS,e[2]=t*dS,e}function gS(r,t){var e=r+r;return r+t[0]*Math.sin(e)+t[1]*Math.sin(e+e)+t[2]*Math.sin(e+e+e)}var mS=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const vS={init:sS,forward:aS,inverse:oS,names:mS,S_POLE:eS,N_POLE:rS,EQUIT:iS,OBLIQ:nS};function va(r){return Math.abs(r)>1&&(r=r>1?1:-1),Math.asin(r)}function yS(){Math.abs(this.lat1+this.lat2)<st||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=jn(this.e3,this.sin_po,this.cos_po),this.qs1=ma(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=jn(this.e3,this.sin_po,this.cos_po),this.qs2=ma(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=ma(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>st?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function _S(r){var t=r.x,e=r.y;this.sin_phi=Math.sin(e),this.cos_phi=Math.cos(e);var i=ma(this.e3,this.sin_phi),n=this.a*Math.sqrt(this.c-this.ns0*i)/this.ns0,s=this.ns0*ht(t-this.long0),a=n*Math.sin(s)+this.x0,o=this.rh-n*Math.cos(s)+this.y0;return r.x=a,r.y=o,r}function wS(r){var t,e,i,n,s,a;return r.x-=this.x0,r.y=this.rh-r.y+this.y0,this.ns0>=0?(t=Math.sqrt(r.x*r.x+r.y*r.y),i=1):(t=-Math.sqrt(r.x*r.x+r.y*r.y),i=-1),n=0,t!==0&&(n=Math.atan2(i*r.x,i*r.y)),i=t*this.ns0/this.a,this.sphere?a=Math.asin((this.c-i*i)/(2*this.ns0)):(e=(this.c-i*i)/this.ns0,a=this.phi1z(this.e3,e)),s=ht(n/this.ns0+this.long0),r.x=s,r.y=a,r}function ES(r,t){var e,i,n,s,a,o=va(.5*t);if(r<st)return o;for(var l=r*r,u=1;u<=25;u++)if(e=Math.sin(o),i=Math.cos(o),n=r*e,s=1-n*n,a=.5*s*s/i*(t/(1-l)-e/s+.5/r*Math.log((1-n)/(1+n))),o=o+a,Math.abs(a)<=1e-7)return o;return null}var SS=["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"];const PS={init:yS,forward:_S,inverse:wS,names:SS,phi1z:ES};function CS(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function IS(r){var t,e,i,n,s,a,o,l,u=r.x,c=r.y;return i=ht(u-this.long0),t=Math.sin(c),e=Math.cos(c),n=Math.cos(i),a=this.sin_p14*t+this.cos_p14*e*n,s=1,a>0||Math.abs(a)<=st?(o=this.x0+this.a*s*e*Math.sin(i)/a,l=this.y0+this.a*s*(this.cos_p14*t-this.sin_p14*e*n)/a):(o=this.x0+this.infinity_dist*e*Math.sin(i),l=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*e*n)),r.x=o,r.y=l,r}function MS(r){var t,e,i,n,s,a;return r.x=(r.x-this.x0)/this.a,r.y=(r.y-this.y0)/this.a,r.x/=this.k0,r.y/=this.k0,(t=Math.sqrt(r.x*r.x+r.y*r.y))?(n=Math.atan2(t,this.rc),e=Math.sin(n),i=Math.cos(n),a=va(i*this.sin_p14+r.y*e*this.cos_p14/t),s=Math.atan2(r.x*e,t*this.cos_p14*i-r.y*this.sin_p14*e),s=ht(this.long0+s)):(a=this.phic0,s=0),r.x=s,r.y=a,r}var NS=["gnom"];const bS={init:CS,forward:IS,inverse:MS,names:NS};function TS(r,t){var e=1-(1-r*r)/(2*r)*Math.log((1-r)/(1+r));if(Math.abs(Math.abs(t)-e)<1e-6)return t<0?-1*Q:Q;for(var i=Math.asin(.5*t),n,s,a,o,l=0;l<30;l++)if(s=Math.sin(i),a=Math.cos(i),o=r*s,n=Math.pow(1-o*o,2)/(2*a)*(t/(1-r*r)-s/(1-o*o)+.5/r*Math.log((1-o)/(1+o))),i+=n,Math.abs(n)<=1e-10)return i;return NaN}function DS(){this.sphere||(this.k0=jn(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function xS(r){var t=r.x,e=r.y,i,n,s=ht(t-this.long0);if(this.sphere)i=this.x0+this.a*s*Math.cos(this.lat_ts),n=this.y0+this.a*Math.sin(e)/Math.cos(this.lat_ts);else{var a=ma(this.e,Math.sin(e));i=this.x0+this.a*this.k0*s,n=this.y0+this.a*a*.5/this.k0}return r.x=i,r.y=n,r}function OS(r){r.x-=this.x0,r.y-=this.y0;var t,e;return this.sphere?(t=ht(this.long0+r.x/this.a/Math.cos(this.lat_ts)),e=Math.asin(r.y/this.a*Math.cos(this.lat_ts))):(e=TS(this.e,2*r.y*this.k0/this.a),t=ht(this.long0+r.x/(this.a*this.k0))),r.x=t,r.y=e,r}var AS=["cea"];const LS={init:DS,forward:xS,inverse:OS,names:AS};function RS(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function FS(r){var t=r.x,e=r.y,i=ht(t-this.long0),n=ga(e-this.lat0);return r.x=this.x0+this.a*i*this.rc,r.y=this.y0+this.a*n,r}function GS(r){var t=r.x,e=r.y;return r.x=ht(this.long0+(t-this.x0)/(this.a*this.rc)),r.y=ga(this.lat0+(e-this.y0)/this.a),r}var kS=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"];const zS={init:RS,forward:FS,inverse:GS,names:kS};var l0=20;function VS(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Ih(this.es),this.e1=Mh(this.es),this.e2=Nh(this.es),this.e3=bh(this.es),this.ml0=this.a*Xr(this.e0,this.e1,this.e2,this.e3,this.lat0)}function US(r){var t=r.x,e=r.y,i,n,s,a=ht(t-this.long0);if(s=a*Math.sin(e),this.sphere)Math.abs(e)<=st?(i=this.a*a,n=-1*this.a*this.lat0):(i=this.a*Math.sin(s)/Math.tan(e),n=this.a*(ga(e-this.lat0)+(1-Math.cos(s))/Math.tan(e)));else if(Math.abs(e)<=st)i=this.a*a,n=-1*this.ml0;else{var o=Dd(this.a,this.e,Math.sin(e))/Math.tan(e);i=o*Math.sin(s),n=this.a*Xr(this.e0,this.e1,this.e2,this.e3,e)-this.ml0+o*(1-Math.cos(s))}return r.x=i+this.x0,r.y=n+this.y0,r}function qS(r){var t,e,i,n,s,a,o,l,u;if(i=r.x-this.x0,n=r.y-this.y0,this.sphere)if(Math.abs(n+this.a*this.lat0)<=st)t=ht(i/this.a+this.long0),e=0;else{a=this.lat0+n/this.a,o=i*i/this.a/this.a+a*a,l=a;var c;for(s=l0;s;--s)if(c=Math.tan(l),u=-1*(a*(l*c+1)-l-.5*(l*l+o)*c)/((l-a)/c-1),l+=u,Math.abs(u)<=st){e=l;break}t=ht(this.long0+Math.asin(i*Math.tan(l)/this.a)/Math.sin(e))}else if(Math.abs(n+this.ml0)<=st)e=0,t=ht(this.long0+i/this.a);else{a=(this.ml0+n)/this.a,o=i*i/this.a/this.a+a*a,l=a;var h,f,g,m,_;for(s=l0;s;--s)if(_=this.e*Math.sin(l),h=Math.sqrt(1-_*_)*Math.tan(l),f=this.a*Xr(this.e0,this.e1,this.e2,this.e3,l),g=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),m=f/this.a,u=(a*(h*m+1)-m-.5*h*(m*m+o))/(this.es*Math.sin(2*l)*(m*m+o-2*a*m)/(4*h)+(a-m)*(h*g-2/Math.sin(2*l))-g),l-=u,Math.abs(u)<=st){e=l;break}h=Math.sqrt(1-this.es*Math.pow(Math.sin(e),2))*Math.tan(e),t=ht(this.long0+Math.asin(i*h/this.a)/Math.sin(e))}return r.x=t,r.y=e,r}var WS=["Polyconic","American_Polyconic","poly"];const HS={init:VS,forward:US,inverse:qS,names:WS};function XS(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function YS(r){var t,e=r.x,i=r.y,n=i-this.lat0,s=e-this.long0,a=n/yh*1e-5,o=s,l=1,u=0;for(t=1;t<=10;t++)l=l*a,u=u+this.A[t]*l;var c=u,h=o,f=1,g=0,m,_,E=0,M=0;for(t=1;t<=6;t++)m=f*c-g*h,_=g*c+f*h,f=m,g=_,E=E+this.B_re[t]*f-this.B_im[t]*g,M=M+this.B_im[t]*f+this.B_re[t]*g;return r.x=M*this.a+this.x0,r.y=E*this.a+this.y0,r}function JS(r){var t,e=r.x,i=r.y,n=e-this.x0,s=i-this.y0,a=s/this.a,o=n/this.a,l=1,u=0,c,h,f=0,g=0;for(t=1;t<=6;t++)c=l*a-u*o,h=u*a+l*o,l=c,u=h,f=f+this.C_re[t]*l-this.C_im[t]*u,g=g+this.C_im[t]*l+this.C_re[t]*u;for(var m=0;m<this.iterations;m++){var _=f,E=g,M,y,w=a,v=o;for(t=2;t<=6;t++)M=_*f-E*g,y=E*f+_*g,_=M,E=y,w=w+(t-1)*(this.B_re[t]*_-this.B_im[t]*E),v=v+(t-1)*(this.B_im[t]*_+this.B_re[t]*E);_=1,E=0;var S=this.B_re[1],P=this.B_im[1];for(t=2;t<=6;t++)M=_*f-E*g,y=E*f+_*g,_=M,E=y,S=S+t*(this.B_re[t]*_-this.B_im[t]*E),P=P+t*(this.B_im[t]*_+this.B_re[t]*E);var I=S*S+P*P;f=(w*S+v*P)/I,g=(v*S-w*P)/I}var b=f,D=g,O=1,T=0;for(t=1;t<=9;t++)O=O*b,T=T+this.D[t]*O;var x=this.lat0+T*yh*1e5,R=this.long0+D;return r.x=R,r.y=x,r}var KS=["New_Zealand_Map_Grid","nzmg"];const QS={init:XS,forward:YS,inverse:JS,names:KS};function ZS(){}function BS(r){var t=r.x,e=r.y,i=ht(t-this.long0),n=this.x0+this.a*i,s=this.y0+this.a*Math.log(Math.tan(Math.PI/4+e/2.5))*1.25;return r.x=n,r.y=s,r}function $S(r){r.x-=this.x0,r.y-=this.y0;var t=ht(this.long0+r.x/this.a),e=2.5*(Math.atan(Math.exp(.8*r.y/this.a))-Math.PI/4);return r.x=t,r.y=e,r}var jS=["Miller_Cylindrical","mill"];const tP={init:ZS,forward:BS,inverse:$S,names:jS};var eP=20;function rP(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Id(this.es)}function iP(r){var t,e,i=r.x,n=r.y;if(i=ht(i-this.long0),this.sphere){if(!this.m)n=this.n!==1?Math.asin(this.n*Math.sin(n)):n;else for(var s=this.n*Math.sin(n),a=eP;a;--a){var o=(this.m*n+Math.sin(n)-s)/(this.m+Math.cos(n));if(n-=o,Math.abs(o)<st)break}t=this.a*this.C_x*i*(this.m+Math.cos(n)),e=this.a*this.C_y*n}else{var l=Math.sin(n),u=Math.cos(n);e=this.a*bu(n,l,u,this.en),t=this.a*i*u/Math.sqrt(1-this.es*l*l)}return r.x=t,r.y=e,r}function nP(r){var t,e,i,n;return r.x-=this.x0,i=r.x/this.a,r.y-=this.y0,t=r.y/this.a,this.sphere?(t/=this.C_y,i=i/(this.C_x*(this.m+Math.cos(t))),this.m?t=va((this.m*t+Math.sin(t))/this.n):this.n!==1&&(t=va(Math.sin(t)/this.n)),i=ht(i+this.long0),t=ga(t)):(t=Md(r.y/this.a,this.es,this.en),n=Math.abs(t),n<Q?(n=Math.sin(t),e=this.long0+r.x*Math.sqrt(1-this.es*n*n)/(this.a*Math.cos(t)),i=ht(e)):n-st<Q&&(i=this.long0)),r.x=i,r.y=t,r}var sP=["Sinusoidal","sinu"];const aP={init:rP,forward:iP,inverse:nP,names:sP};function oP(){}function lP(r){for(var t=r.x,e=r.y,i=ht(t-this.long0),n=e,s=Math.PI*Math.sin(e);;){var a=-(n+Math.sin(n)-s)/(1+Math.cos(n));if(n+=a,Math.abs(a)<st)break}n/=2,Math.PI/2-Math.abs(e)<st&&(i=0);var o=.900316316158*this.a*i*Math.cos(n)+this.x0,l=1.4142135623731*this.a*Math.sin(n)+this.y0;return r.x=o,r.y=l,r}function uP(r){var t,e;r.x-=this.x0,r.y-=this.y0,e=r.y/(1.4142135623731*this.a),Math.abs(e)>.999999999999&&(e=.999999999999),t=Math.asin(e);var i=ht(this.long0+r.x/(.900316316158*this.a*Math.cos(t)));i<-Math.PI&&(i=-Math.PI),i>Math.PI&&(i=Math.PI),e=(2*t+Math.sin(2*t))/Math.PI,Math.abs(e)>1&&(e=1);var n=Math.asin(e);return r.x=i,r.y=n,r}var hP=["Mollweide","moll"];const cP={init:oP,forward:lP,inverse:uP,names:hP};function fP(){Math.abs(this.lat1+this.lat2)<st||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Ih(this.es),this.e1=Mh(this.es),this.e2=Nh(this.es),this.e3=bh(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=jn(this.e,this.sinphi,this.cosphi),this.ml1=Xr(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<st?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=jn(this.e,this.sinphi,this.cosphi),this.ml2=Xr(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=Xr(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function dP(r){var t=r.x,e=r.y,i;if(this.sphere)i=this.a*(this.g-e);else{var n=Xr(this.e0,this.e1,this.e2,this.e3,e);i=this.a*(this.g-n)}var s=this.ns*ht(t-this.long0),a=this.x0+i*Math.sin(s),o=this.y0+this.rh-i*Math.cos(s);return r.x=a,r.y=o,r}function pP(r){r.x-=this.x0,r.y=this.rh-r.y+this.y0;var t,e,i,n;this.ns>=0?(e=Math.sqrt(r.x*r.x+r.y*r.y),t=1):(e=-Math.sqrt(r.x*r.x+r.y*r.y),t=-1);var s=0;if(e!==0&&(s=Math.atan2(t*r.x,t*r.y)),this.sphere)return n=ht(this.long0+s/this.ns),i=ga(this.g-e/this.a),r.x=n,r.y=i,r;var a=this.g-e/this.a;return i=Yc(a,this.e0,this.e1,this.e2,this.e3),n=ht(this.long0+s/this.ns),r.x=n,r.y=i,r}var gP=["Equidistant_Conic","eqdc"];const mP={init:fP,forward:dP,inverse:pP,names:gP};function vP(){this.R=this.a}function yP(r){var t=r.x,e=r.y,i=ht(t-this.long0),n,s;Math.abs(e)<=st&&(n=this.x0+this.R*i,s=this.y0);var a=va(2*Math.abs(e/Math.PI));(Math.abs(i)<=st||Math.abs(Math.abs(e)-Q)<=st)&&(n=this.x0,e>=0?s=this.y0+Math.PI*this.R*Math.tan(.5*a):s=this.y0+Math.PI*this.R*-Math.tan(.5*a));var o=.5*Math.abs(Math.PI/i-i/Math.PI),l=o*o,u=Math.sin(a),c=Math.cos(a),h=c/(u+c-1),f=h*h,g=h*(2/u-1),m=g*g,_=Math.PI*this.R*(o*(h-m)+Math.sqrt(l*(h-m)*(h-m)-(m+l)*(f-m)))/(m+l);i<0&&(_=-_),n=this.x0+_;var E=l+h;return _=Math.PI*this.R*(g*E-o*Math.sqrt((m+l)*(l+1)-E*E))/(m+l),e>=0?s=this.y0+_:s=this.y0-_,r.x=n,r.y=s,r}function _P(r){var t,e,i,n,s,a,o,l,u,c,h,f,g;return r.x-=this.x0,r.y-=this.y0,h=Math.PI*this.R,i=r.x/h,n=r.y/h,s=i*i+n*n,a=-Math.abs(n)*(1+s),o=a-2*n*n+i*i,l=-2*a+1+2*n*n+s*s,g=n*n/l+(2*o*o*o/l/l/l-9*a*o/l/l)/27,u=(a-o*o/3/l)/l,c=2*Math.sqrt(-u/3),h=3*g/u/c,Math.abs(h)>1&&(h>=0?h=1:h=-1),f=Math.acos(h)/3,r.y>=0?e=(-c*Math.cos(f+Math.PI/3)-o/3/l)*Math.PI:e=-(-c*Math.cos(f+Math.PI/3)-o/3/l)*Math.PI,Math.abs(i)<st?t=this.long0:t=ht(this.long0+Math.PI*(s-1+Math.sqrt(1+2*(i*i-n*n)+s*s))/2/i),r.x=t,r.y=e,r}var wP=["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"];const EP={init:vP,forward:yP,inverse:_P,names:wP};var xd={exports:{}},u0;function SP(){return u0||(u0=1,function(r){(function(t){var e={};e.Constants={},e.Math={},e.Accumulator={},function(i){i.WGS84={a:6378137,f:.0033528106647474805},i.version={major:2,minor:1,patch:1},i.version_string="2.1.1"}(e.Constants),function(i){i.digits=53,i.epsilon=Math.pow(.5,i.digits-1),i.degree=Math.PI/180,i.sq=function(n){return n*n},i.hypot=function(n,s){return Math.sqrt(n*n+s*s)},i.cbrt=Math.cbrt||function(n){var s=Math.pow(Math.abs(n),.3333333333333333);return n>0?s:n<0?-s:n},i.log1p=Math.log1p||function(n){var s=1+n,a=s-1;return a===0?n:n*Math.log(s)/a},i.atanh=Math.atanh||function(n){var s=Math.abs(n);return s=i.log1p(2*s/(1-s))/2,n>0?s:n<0?-s:n},i.copysign=function(n,s){return Math.abs(n)*(s<0||s===0&&1/s<0?-1:1)},i.sum=function(n,s){var a=n+s,o=a-s,l=a-o,u;return o-=n,l-=s,u=a&&0-(o+l),{s:a,t:u}},i.polyval=function(n,s,a,o){for(var l=n<0?0:s[a++];--n>=0;)l=l*o+s[a++];return l},i.AngRound=function(n){var s=.0625,a=Math.abs(n);return a=a<s?s-(s-a):a,i.copysign(a,n)},i.remainder=function(n,s){return n%=s,n<-s/2?n+s:n<s/2?n:n-s},i.AngNormalize=function(n){var s=i.remainder(n,360);return Math.abs(s)===180?i.copysign(180,n):s},i.LatFix=function(n){return Math.abs(n)>90?NaN:n},i.AngDiff=function(n,s){var a=i.sum(i.remainder(-n,360),i.remainder(s,360)),o,l;return a=i.sum(i.remainder(a.s,360),a.t),o=a.s,l=a.t,(o===0||Math.abs(o)===180)&&(o=i.copysign(o,l===0?s-n:-l)),{d:o,e:l}},i.sincosd=function(n){var s,a,o,l,u,c,h;switch(s=n%360,o=Math.round(s/90),s-=90*o,a=s*this.degree,l=Math.sin(a),u=Math.cos(a),Math.abs(s)===45?(u=Math.sqrt(.5),l=i.copysign(u,a)):Math.abs(s)===30&&(u=Math.sqrt(.75),l=i.copysign(.5,a)),o&3){case 0:c=l,h=u;break;case 1:c=u,h=-l;break;case 2:c=-l,h=-u;break;default:c=-u,h=l;break}return h+=0,c===0&&(c=i.copysign(c,n)),{s:c,c:h}},i.sincosde=function(n,s){var a,o,l,u,c,h,f;switch(a=n%360,l=Math.round(a/90),a=i.AngRound(a-90*l+s),o=a*this.degree,u=Math.sin(o),c=Math.cos(o),Math.abs(a)===45?(c=Math.sqrt(.5),u=i.copysign(c,o)):Math.abs(a)===30&&(c=Math.sqrt(.75),u=i.copysign(.5,o)),l&3){case 0:h=u,f=c;break;case 1:h=c,f=-u;break;case 2:h=-u,f=-c;break;default:h=-c,f=u;break}return f+=0,h===0&&(h=i.copysign(h,n+s)),{s:h,c:f}},i.atan2d=function(n,s){var a=0,o;switch(Math.abs(n)>Math.abs(s)&&([n,s]=[s,n],a=2),i.copysign(1,s)<0&&(s=-s,++a),o=Math.atan2(n,s)/this.degree,a){case 1:o=i.copysign(180,n)-o;break;case 2:o=90-o;break;case 3:o=-90+o;break}return o}}(e.Math),function(i,n){i.Accumulator=function(s){this.Set(s)},i.Accumulator.prototype.Set=function(s){s||(s=0),s.constructor===i.Accumulator?(this._s=s._s,this._t=s._t):(this._s=s,this._t=0)},i.Accumulator.prototype.Add=function(s){var a=n.sum(s,this._t),o=n.sum(a.s,this._s);a=a.t,this._s=o.s,this._t=o.t,this._s===0?this._s=a:this._t+=a},i.Accumulator.prototype.Sum=function(s){var a;return s?(a=new i.Accumulator(this),a.Add(s),a._s):this._s},i.Accumulator.prototype.Negate=function(){this._s*=-1,this._t*=-1},i.Accumulator.prototype.Remainder=function(s){this._s=n.remainder(this._s,s),this.Add(0)}}(e.Accumulator,e.Math),e.Geodesic={},e.GeodesicLine={},e.PolygonArea={},function(i,n,s,a,o){var l=6,u=l,c=l,h=l,f=h,g,m,_=20,E=_+a.digits+10,M=a.epsilon,y=200*M,w=Math.sqrt(M),v=M,S=1e3*w,P=0,I=31,b=32640,D,O,T,x,R,z,rt,Z,ct;i.tiny_=Math.sqrt(Number.MIN_VALUE/Number.EPSILON),i.nC1_=l,i.nC1p_=l,i.nC2_=l,i.nC3_=l,i.nC4_=l,g=i.nC3_*(i.nC3_-1)/2,m=i.nC4_*(i.nC4_+1)/2,i.CAP_C1=1,i.CAP_C1p=2,i.CAP_C2=4,i.CAP_C3=8,i.CAP_C4=16,i.NONE=0,i.ARC=64,i.LATITUDE=128|P,i.LONGITUDE=256|i.CAP_C3,i.AZIMUTH=512|P,i.DISTANCE=1024|i.CAP_C1,i.STANDARD=i.LATITUDE|i.LONGITUDE|i.AZIMUTH|i.DISTANCE,i.DISTANCE_IN=2048|i.CAP_C1|i.CAP_C1p,i.REDUCEDLENGTH=4096|i.CAP_C1|i.CAP_C2,i.GEODESICSCALE=8192|i.CAP_C1|i.CAP_C2,i.AREA=16384|i.CAP_C4,i.ALL=b|I,i.LONG_UNROLL=32768,i.OUT_MASK=b|i.LONG_UNROLL,i.SinCosSeries=function(G,X,k,V){var A=V.length,W=A-(G?1:0),J=2*(k-X)*(k+X),ot=W&1?V[--A]:0,gt=0;for(W=Math.floor(W/2);W--;)gt=J*ot-gt+V[--A],ot=J*gt-ot+V[--A];return G?2*X*k*ot:k*(ot-gt)},D=function(G,X){var k,V=a.sq(G),A=a.sq(X),W=(V+A-1)/6,J,ot,gt,lt,St,ut,It,bt,j,Pt,Tt;return A===0&&W<=0?k=0:(J=V*A/4,ot=a.sq(W),gt=W*ot,lt=J*(J+2*gt),St=W,lt>=0?(ut=J+gt,ut+=ut<0?-Math.sqrt(lt):Math.sqrt(lt),It=a.cbrt(ut),St+=It+(It!==0?ot/It:0)):(bt=Math.atan2(Math.sqrt(-lt),-(J+gt)),St+=2*W*Math.cos(bt/3)),j=Math.sqrt(a.sq(St)+A),Pt=St<0?A/(j-St):St+j,Tt=(Pt-A)/(2*j),k=Pt/(Math.sqrt(Pt+a.sq(Tt))+Tt)),k},O=[1,4,64,0,256],i.A1m1f=function(G){var X=Math.floor(u/2),k=a.polyval(X,O,0,a.sq(G))/O[X+1];return(k+G)/(1-G)},T=[-1,6,-16,32,-9,64,-128,2048,9,-16,768,3,-5,512,-7,1280,-7,2048],i.C1f=function(G,X){var k=a.sq(G),V=G,A=0,W,J;for(W=1;W<=i.nC1_;++W)J=Math.floor((i.nC1_-W)/2),X[W]=V*a.polyval(J,T,A,k)/T[A+J+1],A+=J+2,V*=G},x=[205,-432,768,1536,4005,-4736,3840,12288,-225,116,384,-7173,2695,7680,3467,7680,38081,61440],i.C1pf=function(G,X){var k=a.sq(G),V=G,A=0,W,J;for(W=1;W<=i.nC1p_;++W)J=Math.floor((i.nC1p_-W)/2),X[W]=V*a.polyval(J,x,A,k)/x[A+J+1],A+=J+2,V*=G},R=[-11,-28,-192,0,256],i.A2m1f=function(G){var X=Math.floor(c/2),k=a.polyval(X,R,0,a.sq(G))/R[X+1];return(k-G)/(1+G)},z=[1,2,16,32,35,64,384,2048,15,80,768,7,35,512,63,1280,77,2048],i.C2f=function(G,X){var k=a.sq(G),V=G,A=0,W,J;for(W=1;W<=i.nC2_;++W)J=Math.floor((i.nC2_-W)/2),X[W]=V*a.polyval(J,z,A,k)/z[A+J+1],A+=J+2,V*=G},i.Geodesic=function(G,X){if(this.a=G,this.f=X,this._f1=1-this.f,this._e2=this.f*(2-this.f),this._ep2=this._e2/a.sq(this._f1),this._n=this.f/(2-this.f),this._b=this.a*this._f1,this._c2=(a.sq(this.a)+a.sq(this._b)*(this._e2===0?1:(this._e2>0?a.atanh(Math.sqrt(this._e2)):Math.atan(Math.sqrt(-this._e2)))/Math.sqrt(Math.abs(this._e2))))/2,this._etol2=.1*w/Math.sqrt(Math.max(.001,Math.abs(this.f))*Math.min(1,1-this.f/2)/2),!(isFinite(this.a)&&this.a>0))throw new Error("Equatorial radius is not positive");if(!(isFinite(this._b)&&this._b>0))throw new Error("Polar semi-axis is not positive");this._A3x=new Array(f),this._C3x=new Array(g),this._C4x=new Array(m),this.A3coeff(),this.C3coeff(),this.C4coeff()},rt=[-3,128,-2,-3,64,-1,-3,-1,16,3,-1,-2,8,1,-1,2,1,1],i.Geodesic.prototype.A3coeff=function(){var G=0,X=0,k,V;for(k=h-1;k>=0;--k)V=Math.min(h-k-1,k),this._A3x[X++]=a.polyval(V,rt,G,this._n)/rt[G+V+1],G+=V+2},Z=[3,128,2,5,128,-1,3,3,64,-1,0,1,8,-1,1,4,5,256,1,3,128,-3,-2,3,64,1,-3,2,32,7,512,-10,9,384,5,-9,5,192,7,512,-14,7,512,21,2560],i.Geodesic.prototype.C3coeff=function(){var G=0,X=0,k,V,A;for(k=1;k<i.nC3_;++k)for(V=i.nC3_-1;V>=k;--V)A=Math.min(i.nC3_-V-1,V),this._C3x[X++]=a.polyval(A,Z,G,this._n)/Z[G+A+1],G+=A+2},ct=[97,15015,1088,156,45045,-224,-4784,1573,45045,-10656,14144,-4576,-858,45045,64,624,-4576,6864,-3003,15015,100,208,572,3432,-12012,30030,45045,1,9009,-2944,468,135135,5792,1040,-1287,135135,5952,-11648,9152,-2574,135135,-64,-624,4576,-6864,3003,135135,8,10725,1856,-936,225225,-8448,4992,-1144,225225,-1440,4160,-4576,1716,225225,-136,63063,1024,-208,105105,3584,-3328,1144,315315,-128,135135,-2560,832,405405,128,99099],i.Geodesic.prototype.C4coeff=function(){var G=0,X=0,k,V,A;for(k=0;k<i.nC4_;++k)for(V=i.nC4_-1;V>=k;--V)A=i.nC4_-V-1,this._C4x[X++]=a.polyval(A,ct,G,this._n)/ct[G+A+1],G+=A+2},i.Geodesic.prototype.A3f=function(G){return a.polyval(f-1,this._A3x,0,G)},i.Geodesic.prototype.C3f=function(G,X){var k=1,V=0,A,W;for(A=1;A<i.nC3_;++A)W=i.nC3_-A-1,k*=G,X[A]=k*a.polyval(W,this._C3x,V,G),V+=W+1},i.Geodesic.prototype.C4f=function(G,X){var k=1,V=0,A,W;for(A=0;A<i.nC4_;++A)W=i.nC4_-A-1,X[A]=k*a.polyval(W,this._C4x,V,G),V+=W+1,k*=G},i.Geodesic.prototype.Lengths=function(G,X,k,V,A,W,J,ot,gt,lt,St,ut,It){St&=i.OUT_MASK;var bt={},j=0,Pt=0,Tt=0,Gt=0,Ht,Xt,Bt,me,Ke;if(St&(i.DISTANCE|i.REDUCEDLENGTH|i.GEODESICSCALE)&&(Tt=i.A1m1f(G),i.C1f(G,ut),St&(i.REDUCEDLENGTH|i.GEODESICSCALE)&&(Gt=i.A2m1f(G),i.C2f(G,It),j=Tt-Gt,Gt=1+Gt),Tt=1+Tt),St&i.DISTANCE)Ht=i.SinCosSeries(!0,W,J,ut)-i.SinCosSeries(!0,k,V,ut),bt.s12b=Tt*(X+Ht),St&(i.REDUCEDLENGTH|i.GEODESICSCALE)&&(Xt=i.SinCosSeries(!0,W,J,It)-i.SinCosSeries(!0,k,V,It),Pt=j*X+(Tt*Ht-Gt*Xt));else if(St&(i.REDUCEDLENGTH|i.GEODESICSCALE)){for(Bt=1;Bt<=i.nC2_;++Bt)It[Bt]=Tt*ut[Bt]-Gt*It[Bt];Pt=j*X+(i.SinCosSeries(!0,W,J,It)-i.SinCosSeries(!0,k,V,It))}return St&i.REDUCEDLENGTH&&(bt.m0=j,bt.m12b=ot*(V*W)-A*(k*J)-V*J*Pt),St&i.GEODESICSCALE&&(me=V*J+k*W,Ke=this._ep2*(gt-lt)*(gt+lt)/(A+ot),bt.M12=me+(Ke*W-J*Pt)*k/A,bt.M21=me-(Ke*k-V*Pt)*W/ot),bt},i.Geodesic.prototype.InverseStart=function(G,X,k,V,A,W,J,ot,gt,lt,St){var ut={},It=V*X-A*G,bt=A*X+V*G,j,Pt,Tt,Gt,Ht,Xt,Bt,me,Ke,Yt,kt,zt,Ee,ke,on,Oa,Uh,ds,$t,mi,Ar,vi,Ri;return ut.sig12=-1,j=V*X,j+=A*G,Pt=bt>=0&&It<.5&&A*J<.5,Pt?(Gt=a.sq(G+V),Gt/=Gt+a.sq(X+A),ut.dnm=Math.sqrt(1+this._ep2*Gt),Tt=J/(this._f1*ut.dnm),Ht=Math.sin(Tt),Xt=Math.cos(Tt)):(Ht=ot,Xt=gt),ut.salp1=A*Ht,ut.calp1=Xt>=0?It+A*G*a.sq(Ht)/(1+Xt):j-A*G*a.sq(Ht)/(1-Xt),me=a.hypot(ut.salp1,ut.calp1),Ke=G*V+X*A*Xt,Pt&&me<this._etol2?(ut.salp2=X*Ht,ut.calp2=It-X*V*(Xt>=0?a.sq(Ht)/(1+Xt):1-Xt),Bt=a.hypot(ut.salp2,ut.calp2),ut.salp2/=Bt,ut.calp2/=Bt,ut.sig12=Math.atan2(me,Ke)):Math.abs(this._n)>.1||Ke>=0||me>=6*Math.abs(this._n)*Math.PI*a.sq(X)||(Ri=Math.atan2(-ot,-gt),this.f>=0?(ke=a.sq(G)*this._ep2,on=ke/(2*(1+Math.sqrt(1+ke))+ke),zt=this.f*X*this.A3f(on)*Math.PI,Ee=zt*X,Yt=Ri/zt,kt=j/Ee):(Oa=A*X-V*G,Uh=Math.atan2(j,Oa),mi=this.Lengths(this._n,Math.PI+Uh,G,-X,k,V,A,W,X,A,i.REDUCEDLENGTH,lt,St),ds=mi.m12b,$t=mi.m0,Yt=-1+ds/(X*A*$t*Math.PI),Ee=Yt<-.01?j/Yt:-this.f*a.sq(X)*Math.PI,zt=Ee/X,kt=J/zt),kt>-y&&Yt>-1-S?this.f>=0?(ut.salp1=Math.min(1,-Yt),ut.calp1=-Math.sqrt(1-a.sq(ut.salp1))):(ut.calp1=Math.max(Yt>-y?0:-1,Yt),ut.salp1=Math.sqrt(1-a.sq(ut.calp1))):(Ar=D(Yt,kt),vi=zt*(this.f>=0?-Yt*Ar/(1+Ar):-kt*(1+Ar)/Ar),Ht=Math.sin(vi),Xt=-Math.cos(vi),ut.salp1=A*Ht,ut.calp1=j-A*G*a.sq(Ht)/(1-Xt))),ut.salp1<=0?(ut.salp1=1,ut.calp1=0):(Bt=a.hypot(ut.salp1,ut.calp1),ut.salp1/=Bt,ut.calp1/=Bt),ut},i.Geodesic.prototype.Lambda12=function(G,X,k,V,A,W,J,ot,gt,lt,St,ut,It,bt){var j={},Pt,Tt,Gt,Ht,Xt,Bt,me,Ke,Yt,kt,zt,Ee,ke;return G===0&&ot===0&&(ot=-i.tiny_),Tt=J*X,Gt=a.hypot(ot,J*G),j.ssig1=G,Ht=Tt*G,j.csig1=Xt=ot*X,Pt=a.hypot(j.ssig1,j.csig1),j.ssig1/=Pt,j.csig1/=Pt,j.salp2=A!==X?Tt/A:J,j.calp2=A!==X||Math.abs(V)!==-G?Math.sqrt(a.sq(ot*X)+(X<-G?(A-X)*(X+A):(G-V)*(G+V)))/A:Math.abs(ot),j.ssig2=V,Bt=Tt*V,j.csig2=me=j.calp2*A,Pt=a.hypot(j.ssig2,j.csig2),j.ssig2/=Pt,j.csig2/=Pt,j.sig12=Math.atan2(Math.max(0,j.csig1*j.ssig2-j.ssig1*j.csig2),j.csig1*j.csig2+j.ssig1*j.ssig2),Ke=Math.max(0,Xt*Bt-Ht*me),Yt=Xt*me+Ht*Bt,zt=Math.atan2(Ke*lt-Yt*gt,Yt*lt+Ke*gt),Ee=a.sq(Gt)*this._ep2,j.eps=Ee/(2*(1+Math.sqrt(1+Ee))+Ee),this.C3f(j.eps,bt),kt=i.SinCosSeries(!0,j.ssig2,j.csig2,bt)-i.SinCosSeries(!0,j.ssig1,j.csig1,bt),j.domg12=-this.f*this.A3f(j.eps)*Tt*(j.sig12+kt),j.lam12=zt+j.domg12,St&&(j.calp2===0?j.dlam12=-2*this._f1*k/G:(ke=this.Lengths(j.eps,j.sig12,j.ssig1,j.csig1,k,j.ssig2,j.csig2,W,X,A,i.REDUCEDLENGTH,ut,It),j.dlam12=ke.m12b,j.dlam12*=this._f1/(j.calp2*A))),j},i.Geodesic.prototype.Inverse=function(G,X,k,V,A){var W,J;return A||(A=i.STANDARD),A===i.LONG_UNROLL&&(A|=i.STANDARD),A&=i.OUT_MASK,W=this.InverseInt(G,X,k,V,A),J=W.vals,A&i.AZIMUTH&&(J.azi1=a.atan2d(W.salp1,W.calp1),J.azi2=a.atan2d(W.salp2,W.calp2)),J},i.Geodesic.prototype.InverseInt=function(G,X,k,V,A){var W={},J,ot,gt,lt,St,ut,It,bt,j,Pt,Tt,Gt,Ht,Xt,Bt,me,Ke,Yt,kt,zt,Ee,ke,on,Oa,Uh,ds,$t,mi,Ar,vi,Ri,sf,af,Vu,Hl,qh,Wh,Hh,Xh,of,Jd,Uu,Kd,lf,Qd,Zd,Bd,lv,$d,uf,jd,hf,uv,cf,hv,cv,Yh,ff,Jh,tp,ep,df,pf,rp,ip;if(W.lat1=G=a.LatFix(G),W.lat2=k=a.LatFix(k),G=a.AngRound(G),k=a.AngRound(k),J=a.AngDiff(X,V),ot=J.e,J=J.d,A&i.LONG_UNROLL?(W.lon1=X,W.lon2=X+J+ot):(W.lon1=a.AngNormalize(X),W.lon2=a.AngNormalize(V)),gt=a.copysign(1,J),J*=gt,ot*=gt,Bt=J*a.degree,lt=a.sincosde(J,ot),me=lt.s,Ke=lt.c,ot=180-J-ot,St=Math.abs(G)<Math.abs(k)||isNaN(k)?-1:1,St<0&&(gt*=-1,[k,G]=[G,k]),ut=a.copysign(1,-G),G*=ut,k*=ut,lt=a.sincosd(G),It=this._f1*lt.s,bt=lt.c,lt=a.hypot(It,bt),It/=lt,bt/=lt,bt=Math.max(i.tiny_,bt),lt=a.sincosd(k),j=this._f1*lt.s,Pt=lt.c,lt=a.hypot(j,Pt),j/=lt,Pt/=lt,Pt=Math.max(i.tiny_,Pt),bt<-It?Pt===bt&&(j=a.copysign(It,j)):Math.abs(j)===-It&&(Pt=bt),Ht=Math.sqrt(1+this._ep2*a.sq(It)),Xt=Math.sqrt(1+this._ep2*a.sq(j)),on=new Array(i.nC1_+1),Oa=new Array(i.nC2_+1),Uh=new Array(i.nC3_),ds=G===-90||me===0,ds&&(kt=Ke,zt=me,Ee=1,ke=0,mi=It,Ar=kt*bt,vi=j,Ri=Ee*Pt,Yt=Math.atan2(Math.max(0,Ar*vi-mi*Ri),Ar*Ri+mi*vi),$t=this.Lengths(this._n,Yt,mi,Ar,Ht,vi,Ri,Xt,bt,Pt,A|i.DISTANCE|i.REDUCEDLENGTH,on,Oa),Tt=$t.s12b,Gt=$t.m12b,A&i.GEODESICSCALE&&(W.M12=$t.M12,W.M21=$t.M21),Yt<1||Gt>=0?((Yt<3*i.tiny_||Yt<M&&(Tt<0||Gt<0))&&(Yt=Gt=Tt=0),Gt*=this._b,Tt*=this._b,W.a12=Yt/a.degree):ds=!1),Yh=2,!ds&&It===0&&(this.f<=0||ot>=this.f*180))kt=Ee=0,zt=ke=1,Tt=this.a*Bt,Yt=af=Bt/this._f1,Gt=this._b*Math.sin(Yt),A&i.GEODESICSCALE&&(W.M12=W.M21=Math.cos(Yt)),W.a12=J/this._f1;else if(!ds)if($t=this.InverseStart(It,bt,Ht,j,Pt,Xt,Bt,me,Ke,on,Oa),Yt=$t.sig12,zt=$t.salp1,kt=$t.calp1,Yt>=0)ke=$t.salp2,Ee=$t.calp2,Vu=$t.dnm,Tt=Yt*this._b*Vu,Gt=a.sq(Vu)*this._b*Math.sin(Yt/Vu),A&i.GEODESICSCALE&&(W.M12=W.M21=Math.cos(Yt/Vu)),W.a12=Yt/a.degree,af=Bt/(this._f1*Vu);else{for(Hl=0,qh=i.tiny_,Wh=1,Hh=i.tiny_,Xh=-1,of=!1,Jd=!1;$t=this.Lambda12(It,bt,Ht,j,Pt,Xt,zt,kt,me,Ke,Hl<_,on,Oa,Uh),Uu=$t.lam12,ke=$t.salp2,Ee=$t.calp2,Yt=$t.sig12,mi=$t.ssig1,Ar=$t.csig1,vi=$t.ssig2,Ri=$t.csig2,sf=$t.eps,Jh=$t.domg12,Kd=$t.dlam12,!(Jd||!(Math.abs(Uu)>=(of?8:1)*M)||Hl==E);++Hl){if(Uu>0&&(Hl<_||kt/zt>Xh/Hh)?(Hh=zt,Xh=kt):Uu<0&&(Hl<_||kt/zt<Wh/qh)&&(qh=zt,Wh=kt),Hl<_&&Kd>0&&(lf=-Uu/Kd,Math.abs(lf)<Math.PI&&(Qd=Math.sin(lf),Zd=Math.cos(lf),Bd=zt*Zd+kt*Qd,Bd>0))){kt=kt*Zd-zt*Qd,zt=Bd,lt=a.hypot(zt,kt),zt/=lt,kt/=lt,of=Math.abs(Uu)<=16*M;continue}zt=(qh+Hh)/2,kt=(Wh+Xh)/2,lt=a.hypot(zt,kt),zt/=lt,kt/=lt,of=!1,Jd=Math.abs(qh-zt)+(Wh-kt)<v||Math.abs(zt-Hh)+(kt-Xh)<v}lv=A|(A&(i.REDUCEDLENGTH|i.GEODESICSCALE)?i.DISTANCE:i.NONE),$t=this.Lengths(sf,Yt,mi,Ar,Ht,vi,Ri,Xt,bt,Pt,lv,on,Oa),Tt=$t.s12b,Gt=$t.m12b,A&i.GEODESICSCALE&&(W.M12=$t.M12,W.M21=$t.M21),Gt*=this._b,Tt*=this._b,W.a12=Yt/a.degree,A&i.AREA&&(rp=Math.sin(Jh),ip=Math.cos(Jh),Yh=me*ip-Ke*rp,ff=Ke*ip+me*rp)}return A&i.DISTANCE&&(W.s12=0+Tt),A&i.REDUCEDLENGTH&&(W.m12=0+Gt),A&i.AREA&&($d=zt*bt,uf=a.hypot(kt,zt*It),uf!==0&&$d!==0?(mi=It,Ar=kt*bt,vi=j,Ri=Ee*Pt,hf=a.sq(uf)*this._ep2,sf=hf/(2*(1+Math.sqrt(1+hf))+hf),uv=a.sq(this.a)*uf*$d*this._e2,lt=a.hypot(mi,Ar),mi/=lt,Ar/=lt,lt=a.hypot(vi,Ri),vi/=lt,Ri/=lt,cf=new Array(i.nC4_),this.C4f(sf,cf),hv=i.SinCosSeries(!1,mi,Ar,cf),cv=i.SinCosSeries(!1,vi,Ri,cf),W.S12=uv*(cv-hv)):W.S12=0,!ds&&Yh==2&&(Yh=Math.sin(af),ff=Math.cos(af)),!ds&&ff>-.7071&&j-It<1.75?(Jh=1+ff,tp=1+bt,ep=1+Pt,jd=2*Math.atan2(Yh*(It*ep+j*tp),Jh*(It*j+tp*ep))):(df=ke*kt-Ee*zt,pf=Ee*kt+ke*zt,df===0&&pf<0&&(df=i.tiny_*kt,pf=-1),jd=Math.atan2(df,pf)),W.S12+=this._c2*jd,W.S12*=St*gt*ut,W.S12+=0),St<0&&([ke,zt]=[zt,ke],[Ee,kt]=[kt,Ee],A&i.GEODESICSCALE&&([W.M21,W.M12]=[W.M12,W.M21])),zt*=St*gt,kt*=St*ut,ke*=St*gt,Ee*=St*ut,{vals:W,salp1:zt,calp1:kt,salp2:ke,calp2:Ee}},i.Geodesic.prototype.GenDirect=function(G,X,k,V,A,W){var J;return W?W===i.LONG_UNROLL&&(W|=i.STANDARD):W=i.STANDARD,V||(W|=i.DISTANCE_IN),J=new n.GeodesicLine(this,G,X,k,W),J.GenPosition(V,A,W)},i.Geodesic.prototype.Direct=function(G,X,k,V,A){return this.GenDirect(G,X,k,!1,V,A)},i.Geodesic.prototype.ArcDirect=function(G,X,k,V,A){return this.GenDirect(G,X,k,!0,V,A)},i.Geodesic.prototype.Line=function(G,X,k,V){return new n.GeodesicLine(this,G,X,k,V)},i.Geodesic.prototype.DirectLine=function(G,X,k,V,A){return this.GenDirectLine(G,X,k,!1,V,A)},i.Geodesic.prototype.ArcDirectLine=function(G,X,k,V,A){return this.GenDirectLine(G,X,k,!0,V,A)},i.Geodesic.prototype.GenDirectLine=function(G,X,k,V,A,W){var J;return W||(W=i.STANDARD|i.DISTANCE_IN),V||(W|=i.DISTANCE_IN),J=new n.GeodesicLine(this,G,X,k,W),J.GenSetDistance(V,A),J},i.Geodesic.prototype.InverseLine=function(G,X,k,V,A){var W,J,ot;return A||(A=i.STANDARD|i.DISTANCE_IN),W=this.InverseInt(G,X,k,V,i.ARC),ot=a.atan2d(W.salp1,W.calp1),A&(i.OUT_MASK&i.DISTANCE_IN)&&(A|=i.DISTANCE),J=new n.GeodesicLine(this,G,X,ot,A,W.salp1,W.calp1),J.SetArc(W.vals.a12),J},i.Geodesic.prototype.Polygon=function(G){return new s.PolygonArea(this,G)},i.WGS84=new i.Geodesic(o.WGS84.a,o.WGS84.f)}(e.Geodesic,e.GeodesicLine,e.PolygonArea,e.Math,e.Constants),function(i,n,s){n.GeodesicLine=function(a,o,l,u,c,h,f){var g,m,_,E,M,y;c||(c=i.STANDARD|i.DISTANCE_IN),this.a=a.a,this.f=a.f,this._b=a._b,this._c2=a._c2,this._f1=a._f1,this.caps=c|i.LATITUDE|i.AZIMUTH|i.LONG_UNROLL,this.lat1=s.LatFix(o),this.lon1=l,typeof h>"u"||typeof f>"u"?(this.azi1=s.AngNormalize(u),g=s.sincosd(s.AngRound(this.azi1)),this.salp1=g.s,this.calp1=g.c):(this.azi1=u,this.salp1=h,this.calp1=f),g=s.sincosd(s.AngRound(this.lat1)),_=this._f1*g.s,m=g.c,g=s.hypot(_,m),_/=g,m/=g,m=Math.max(i.tiny_,m),this._dn1=Math.sqrt(1+a._ep2*s.sq(_)),this._salp0=this.salp1*m,this._calp0=s.hypot(this.calp1,this.salp1*_),this._ssig1=_,this._somg1=this._salp0*_,this._csig1=this._comg1=_!==0||this.calp1!==0?m*this.calp1:1,g=s.hypot(this._ssig1,this._csig1),this._ssig1/=g,this._csig1/=g,this._k2=s.sq(this._calp0)*a._ep2,E=this._k2/(2*(1+Math.sqrt(1+this._k2))+this._k2),this.caps&i.CAP_C1&&(this._A1m1=i.A1m1f(E),this._C1a=new Array(i.nC1_+1),i.C1f(E,this._C1a),this._B11=i.SinCosSeries(!0,this._ssig1,this._csig1,this._C1a),M=Math.sin(this._B11),y=Math.cos(this._B11),this._stau1=this._ssig1*y+this._csig1*M,this._ctau1=this._csig1*y-this._ssig1*M),this.caps&i.CAP_C1p&&(this._C1pa=new Array(i.nC1p_+1),i.C1pf(E,this._C1pa)),this.caps&i.CAP_C2&&(this._A2m1=i.A2m1f(E),this._C2a=new Array(i.nC2_+1),i.C2f(E,this._C2a),this._B21=i.SinCosSeries(!0,this._ssig1,this._csig1,this._C2a)),this.caps&i.CAP_C3&&(this._C3a=new Array(i.nC3_),a.C3f(E,this._C3a),this._A3c=-this.f*this._salp0*a.A3f(E),this._B31=i.SinCosSeries(!0,this._ssig1,this._csig1,this._C3a)),this.caps&i.CAP_C4&&(this._C4a=new Array(i.nC4_),a.C4f(E,this._C4a),this._A4=s.sq(this.a)*this._calp0*this._salp0*a._e2,this._B41=i.SinCosSeries(!1,this._ssig1,this._csig1,this._C4a)),this.a13=this.s13=NaN},n.GeodesicLine.prototype.GenPosition=function(a,o,l){var u={},c,h,f,g,m,_,E,M,y,w,v,S,P,I,b,D,O,T,x,R,z,rt,Z,ct,G,X,k,V,A;return l?l===i.LONG_UNROLL&&(l|=i.STANDARD):l=i.STANDARD,l&=this.caps&i.OUT_MASK,u.lat1=this.lat1,u.azi1=this.azi1,u.lon1=l&i.LONG_UNROLL?this.lon1:s.AngNormalize(this.lon1),a?u.a12=o:u.s12=o,a||this.caps&i.DISTANCE_IN&i.OUT_MASK?(g=0,m=0,a?(c=o*s.degree,X=s.sincosd(o),h=X.s,f=X.c):(M=o/(this._b*(1+this._A1m1)),y=Math.sin(M),w=Math.cos(M),g=-i.SinCosSeries(!0,this._stau1*w+this._ctau1*y,this._ctau1*w-this._stau1*y,this._C1pa),c=M-(g-this._B11),h=Math.sin(c),f=Math.cos(c),Math.abs(this.f)>.01&&(_=this._ssig1*f+this._csig1*h,E=this._csig1*f-this._ssig1*h,g=i.SinCosSeries(!0,_,E,this._C1a),v=(1+this._A1m1)*(c+(g-this._B11))-o/this._b,c=c-v/Math.sqrt(1+this._k2*s.sq(_)),h=Math.sin(c),f=Math.cos(c))),_=this._ssig1*f+this._csig1*h,E=this._csig1*f-this._ssig1*h,rt=Math.sqrt(1+this._k2*s.sq(_)),l&(i.DISTANCE|i.REDUCEDLENGTH|i.GEODESICSCALE)&&((a||Math.abs(this.f)>.01)&&(g=i.SinCosSeries(!0,_,E,this._C1a)),m=(1+this._A1m1)*(g-this._B11)),D=this._calp0*_,O=s.hypot(this._salp0,this._calp0*E),O===0&&(O=E=i.tiny_),R=this._salp0,z=this._calp0*E,a&&l&i.DISTANCE&&(u.s12=this._b*((1+this._A1m1)*c+m)),l&i.LONGITUDE&&(T=this._salp0*_,x=E,b=s.copysign(1,this._salp0),S=l&i.LONG_UNROLL?b*(c-(Math.atan2(_,E)-Math.atan2(this._ssig1,this._csig1))+(Math.atan2(b*T,x)-Math.atan2(b*this._somg1,this._comg1))):Math.atan2(T*this._comg1-x*this._somg1,x*this._comg1+T*this._somg1),P=S+this._A3c*(c+(i.SinCosSeries(!0,_,E,this._C3a)-this._B31)),I=P/s.degree,u.lon2=l&i.LONG_UNROLL?this.lon1+I:s.AngNormalize(s.AngNormalize(this.lon1)+s.AngNormalize(I))),l&i.LATITUDE&&(u.lat2=s.atan2d(D,this._f1*O)),l&i.AZIMUTH&&(u.azi2=s.atan2d(R,z)),l&(i.REDUCEDLENGTH|i.GEODESICSCALE)&&(Z=i.SinCosSeries(!0,_,E,this._C2a),ct=(1+this._A2m1)*(Z-this._B21),G=(this._A1m1-this._A2m1)*c+(m-ct),l&i.REDUCEDLENGTH&&(u.m12=this._b*(rt*(this._csig1*_)-this._dn1*(this._ssig1*E)-this._csig1*E*G)),l&i.GEODESICSCALE&&(X=this._k2*(_-this._ssig1)*(_+this._ssig1)/(this._dn1+rt),u.M12=f+(X*_-E*G)*this._ssig1/this._dn1,u.M21=f-(X*this._ssig1-this._csig1*G)*_/rt)),l&i.AREA&&(k=i.SinCosSeries(!1,_,E,this._C4a),this._calp0===0||this._salp0===0?(V=R*this.calp1-z*this.salp1,A=z*this.calp1+R*this.salp1):(V=this._calp0*this._salp0*(f<=0?this._csig1*(1-f)+h*this._ssig1:h*(this._csig1*h/(1+f)+this._ssig1)),A=s.sq(this._salp0)+s.sq(this._calp0)*this._csig1*E),u.S12=this._c2*Math.atan2(V,A)+this._A4*(k-this._B41)),a||(u.a12=c/s.degree),u):(u.a12=NaN,u)},n.GeodesicLine.prototype.Position=function(a,o){return this.GenPosition(!1,a,o)},n.GeodesicLine.prototype.ArcPosition=function(a,o){return this.GenPosition(!0,a,o)},n.GeodesicLine.prototype.GenSetDistance=function(a,o){a?this.SetArc(o):this.SetDistance(o)},n.GeodesicLine.prototype.SetDistance=function(a){var o;this.s13=a,o=this.GenPosition(!1,this.s13,i.ARC),this.a13=0+o.a12},n.GeodesicLine.prototype.SetArc=function(a){var o;this.a13=a,o=this.GenPosition(!0,this.a13,i.DISTANCE),this.s13=0+o.s12}}(e.Geodesic,e.GeodesicLine,e.Math),function(i,n,s,a){var o,l,u,c;o=function(h,f){var g=s.AngDiff(h,f).d;return h=s.AngNormalize(h),f=s.AngNormalize(f),g>0&&(h<0&&f>=0||h>0&&f===0)?1:g<0&&h>=0&&f<0?-1:0},l=function(h,f){return h=h%720,f=f%720,(0<=f&&f<360||f<-360?0:1)-(0<=h&&h<360||h<-360?0:1)},u=function(h,f,g,m,_){return h.Remainder(f),g&1&&h.Add((h.Sum()<0?1:-1)*f/2),m||h.Negate(),_?h.Sum()>f/2?h.Add(-f):h.Sum()<=-f/2&&h.Add(+f):h.Sum()>=f?h.Add(-f):h.Sum()<0&&h.Add(+f),0+h.Sum()},c=function(h,f,g,m,_){return h=s.remainder(h,f),g&1&&(h+=(h<0?1:-1)*f/2),m||(h*=-1),_?h>f/2?h-=f:h<=-f/2&&(h+=f):h>=f?h-=f:h<0&&(h+=f),0+h},i.PolygonArea=function(h,f){this._geod=h,this.a=this._geod.a,this.f=this._geod.f,this._area0=4*Math.PI*h._c2,this.polyline=f||!1,this._mask=n.LATITUDE|n.LONGITUDE|n.DISTANCE|(this.polyline?n.NONE:n.AREA|n.LONG_UNROLL),this.polyline||(this._areasum=new a.Accumulator(0)),this._perimetersum=new a.Accumulator(0),this.Clear()},i.PolygonArea.prototype.Clear=function(){this.num=0,this._crossings=0,this.polyline||this._areasum.Set(0),this._perimetersum.Set(0),this._lat0=this._lon0=this.lat=this.lon=NaN},i.PolygonArea.prototype.AddPoint=function(h,f){var g;this.num===0?(this._lat0=this.lat=h,this._lon0=this.lon=f):(g=this._geod.Inverse(this.lat,this.lon,h,f,this._mask),this._perimetersum.Add(g.s12),this.polyline||(this._areasum.Add(g.S12),this._crossings+=o(this.lon,f)),this.lat=h,this.lon=f),++this.num},i.PolygonArea.prototype.AddEdge=function(h,f){var g;this.num&&(g=this._geod.Direct(this.lat,this.lon,h,f,this._mask),this._perimetersum.Add(f),this.polyline||(this._areasum.Add(g.S12),this._crossings+=l(this.lon,g.lon2)),this.lat=g.lat2,this.lon=g.lon2),++this.num},i.PolygonArea.prototype.Compute=function(h,f){var g={number:this.num},m,_;return this.num<2?(g.perimeter=0,this.polyline||(g.area=0),g):this.polyline?(g.perimeter=this._perimetersum.Sum(),g):(m=this._geod.Inverse(this.lat,this.lon,this._lat0,this._lon0,this._mask),g.perimeter=this._perimetersum.Sum(m.s12),_=new a.Accumulator(this._areasum),_.Add(m.S12),g.area=u(_,this._area0,this._crossings+o(this.lon,this._lon0),h,f),g)},i.PolygonArea.prototype.TestPoint=function(h,f,g,m){var _={number:this.num+1},E,M,y,w;if(this.num===0)return _.perimeter=0,this.polyline||(_.area=0),_;for(_.perimeter=this._perimetersum.Sum(),M=this.polyline?0:this._areasum.Sum(),y=this._crossings,w=0;w<(this.polyline?1:2);++w)E=this._geod.Inverse(w===0?this.lat:h,w===0?this.lon:f,w!==0?this._lat0:h,w!==0?this._lon0:f,this._mask),_.perimeter+=E.s12,this.polyline||(M+=E.S12,y+=o(w===0?this.lon:f,w!==0?this._lon0:f));return this.polyline||(_.area=c(M,this._area0,y,g,m)),_},i.PolygonArea.prototype.TestEdge=function(h,f,g,m){var _={number:this.num?this.num+1:0},E,M,y;return this.num===0||(_.perimeter=this._perimetersum.Sum()+f,this.polyline)||(M=this._areasum.Sum(),y=this._crossings,E=this._geod.Direct(this.lat,this.lon,h,f,this._mask),M+=E.S12,y+=l(this.lon,E.lon2),y+=o(E.lon2,this._lon0),E=this._geod.Inverse(E.lat2,E.lon2,this._lat0,this._lon0,this._mask),_.perimeter+=E.s12,M+=E.S12,_.area=c(M,this._area0,y,g,m)),_}}(e.PolygonArea,e.Geodesic,e.Math,e.Accumulator),t(e)})(function(t){r.exports?r.exports=t:window.geodesic=t})}(xd)),xd.exports}var PP=SP();function CP(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.g=new PP.Geodesic.Geodesic(this.a,this.es/(1+Math.sqrt(1-this.es)))}function IP(r){var t=r.x,e=r.y,i=Math.sin(r.y),n=Math.cos(r.y),s=ht(t-this.long0),a,o,l,u,c,h,f,g,m,_,E,M,y,w,v;return this.sphere?Math.abs(this.sin_p12-1)<=st?(r.x=this.x0+this.a*(Q-e)*Math.sin(s),r.y=this.y0-this.a*(Q-e)*Math.cos(s),r):Math.abs(this.sin_p12+1)<=st?(r.x=this.x0+this.a*(Q+e)*Math.sin(s),r.y=this.y0+this.a*(Q+e)*Math.cos(s),r):(m=this.sin_p12*i+this.cos_p12*n*Math.cos(s),f=Math.acos(m),g=f?f/Math.sin(f):1,r.x=this.x0+this.a*g*n*Math.sin(s),r.y=this.y0+this.a*g*(this.cos_p12*i-this.sin_p12*n*Math.cos(s)),r):(a=Ih(this.es),o=Mh(this.es),l=Nh(this.es),u=bh(this.es),Math.abs(this.sin_p12-1)<=st?(c=this.a*Xr(a,o,l,u,Q),h=this.a*Xr(a,o,l,u,e),r.x=this.x0+(c-h)*Math.sin(s),r.y=this.y0-(c-h)*Math.cos(s),r):Math.abs(this.sin_p12+1)<=st?(c=this.a*Xr(a,o,l,u,Q),h=this.a*Xr(a,o,l,u,e),r.x=this.x0+(c+h)*Math.sin(s),r.y=this.y0+(c+h)*Math.cos(s),r):Math.abs(t)<st&&Math.abs(e-this.lat0)<st?(r.x=r.y=0,r):(_=this.lat0/de,E=this.long0/de,M=e/de,y=t/de,w=this.g.Inverse(_,E,M,y,this.g.AZIMUTH),v=w.azi1*de,r.x=w.s12*Math.sin(v),r.y=w.s12*Math.cos(v),r))}function MP(r){r.x-=this.x0,r.y-=this.y0;var t,e,i,n,s,a,o,l,u,c,h,f,g,m,_,E,M,y;return this.sphere?(t=Math.sqrt(r.x*r.x+r.y*r.y),t>2*Q*this.a?void 0:(e=t/this.a,i=Math.sin(e),n=Math.cos(e),s=this.long0,Math.abs(t)<=st?a=this.lat0:(a=va(n*this.sin_p12+r.y*i*this.cos_p12/t),o=Math.abs(this.lat0)-Q,Math.abs(o)<=st?this.lat0>=0?s=ht(this.long0+Math.atan2(r.x,-r.y)):s=ht(this.long0-Math.atan2(-r.x,r.y)):s=ht(this.long0+Math.atan2(r.x*i,t*this.cos_p12*n-r.y*this.sin_p12*i))),r.x=s,r.y=a,r)):(l=Ih(this.es),u=Mh(this.es),c=Nh(this.es),h=bh(this.es),Math.abs(this.sin_p12-1)<=st?(f=this.a*Xr(l,u,c,h,Q),t=Math.sqrt(r.x*r.x+r.y*r.y),g=f-t,a=Yc(g/this.a,l,u,c,h),s=ht(this.long0+Math.atan2(r.x,-1*r.y)),r.x=s,r.y=a,r):Math.abs(this.sin_p12+1)<=st?(f=this.a*Xr(l,u,c,h,Q),t=Math.sqrt(r.x*r.x+r.y*r.y),g=t-f,a=Yc(g/this.a,l,u,c,h),s=ht(this.long0+Math.atan2(r.x,r.y)),r.x=s,r.y=a,r):(m=this.lat0/de,_=this.long0/de,E=Math.atan2(r.x,r.y)/de,M=Math.sqrt(r.x*r.x+r.y*r.y),y=this.g.Direct(m,_,E,M,this.g.STANDARD),r.x=y.lon2*de,r.y=y.lat2*de,r))}var NP=["Azimuthal_Equidistant","aeqd"];const bP={init:CP,forward:IP,inverse:MP,names:NP};function TP(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function DP(r){var t,e,i,n,s,a,o,l,u=r.x,c=r.y;return i=ht(u-this.long0),t=Math.sin(c),e=Math.cos(c),n=Math.cos(i),a=this.sin_p14*t+this.cos_p14*e*n,s=1,(a>0||Math.abs(a)<=st)&&(o=this.a*s*e*Math.sin(i),l=this.y0+this.a*s*(this.cos_p14*t-this.sin_p14*e*n)),r.x=o,r.y=l,r}function xP(r){var t,e,i,n,s,a,o;return r.x-=this.x0,r.y-=this.y0,t=Math.sqrt(r.x*r.x+r.y*r.y),e=va(t/this.a),i=Math.sin(e),n=Math.cos(e),a=this.long0,Math.abs(t)<=st?(o=this.lat0,r.x=a,r.y=o,r):(o=va(n*this.sin_p14+r.y*i*this.cos_p14/t),s=Math.abs(this.lat0)-Q,Math.abs(s)<=st?(this.lat0>=0?a=ht(this.long0+Math.atan2(r.x,-r.y)):a=ht(this.long0-Math.atan2(-r.x,r.y)),r.x=a,r.y=o,r):(a=ht(this.long0+Math.atan2(r.x*i,t*this.cos_p14*n-r.y*this.sin_p14*i)),r.x=a,r.y=o,r))}var OP=["ortho"];const AP={init:TP,forward:DP,inverse:xP,names:OP};var xe={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},re={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function LP(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=Q-ee/2?this.face=xe.TOP:this.lat0<=-(Q-ee/2)?this.face=xe.BOTTOM:Math.abs(this.long0)<=ee?this.face=xe.FRONT:Math.abs(this.long0)<=Q+ee?this.face=this.long0>0?xe.RIGHT:xe.LEFT:this.face=xe.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function RP(r){var t={x:0,y:0},e,i,n,s,a,o,l={value:0};if(r.x-=this.long0,this.es!==0?e=Math.atan(this.one_minus_f_squared*Math.tan(r.y)):e=r.y,i=r.x,this.face===xe.TOP)s=Q-e,i>=ee&&i<=Q+ee?(l.value=re.AREA_0,n=i-Q):i>Q+ee||i<=-(Q+ee)?(l.value=re.AREA_1,n=i>0?i-mr:i+mr):i>-(Q+ee)&&i<=-ee?(l.value=re.AREA_2,n=i+Q):(l.value=re.AREA_3,n=i);else if(this.face===xe.BOTTOM)s=Q+e,i>=ee&&i<=Q+ee?(l.value=re.AREA_0,n=-i+Q):i<ee&&i>=-ee?(l.value=re.AREA_1,n=-i):i<-ee&&i>=-(Q+ee)?(l.value=re.AREA_2,n=-i-Q):(l.value=re.AREA_3,n=i>0?-i+mr:-i-mr);else{var u,c,h,f,g,m,_;this.face===xe.RIGHT?i=Du(i,+Q):this.face===xe.BACK?i=Du(i,3.14159265359):this.face===xe.LEFT&&(i=Du(i,-Q)),f=Math.sin(e),g=Math.cos(e),m=Math.sin(i),_=Math.cos(i),u=g*_,c=g*m,h=f,this.face===xe.FRONT?(s=Math.acos(u),n=Jc(s,h,c,l)):this.face===xe.RIGHT?(s=Math.acos(c),n=Jc(s,h,-u,l)):this.face===xe.BACK?(s=Math.acos(-u),n=Jc(s,h,-c,l)):this.face===xe.LEFT?(s=Math.acos(-c),n=Jc(s,h,u,l)):(s=n=0,l.value=re.AREA_0)}return o=Math.atan(12/mr*(n+Math.acos(Math.sin(n)*Math.cos(ee))-Q)),a=Math.sqrt((1-Math.cos(s))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(n))))),l.value===re.AREA_1?o+=Q:l.value===re.AREA_2?o+=mr:l.value===re.AREA_3&&(o+=1.5*mr),t.x=a*Math.cos(o),t.y=a*Math.sin(o),t.x=t.x*this.a+this.x0,t.y=t.y*this.a+this.y0,r.x=t.x,r.y=t.y,r}function FP(r){var t={lam:0,phi:0},e,i,n,s,a,o,l,u,c,h={value:0};if(r.x=(r.x-this.x0)/this.a,r.y=(r.y-this.y0)/this.a,i=Math.atan(Math.sqrt(r.x*r.x+r.y*r.y)),e=Math.atan2(r.y,r.x),r.x>=0&&r.x>=Math.abs(r.y)?h.value=re.AREA_0:r.y>=0&&r.y>=Math.abs(r.x)?(h.value=re.AREA_1,e-=Q):r.x<0&&-r.x>=Math.abs(r.y)?(h.value=re.AREA_2,e=e<0?e+mr:e-mr):(h.value=re.AREA_3,e+=Q),c=mr/12*Math.tan(e),a=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),o=Math.atan(a),n=Math.cos(e),s=Math.tan(i),l=1-n*n*s*s*(1-Math.cos(Math.atan(1/Math.cos(o)))),l<-1?l=-1:l>1&&(l=1),this.face===xe.TOP)u=Math.acos(l),t.phi=Q-u,h.value===re.AREA_0?t.lam=o+Q:h.value===re.AREA_1?t.lam=o<0?o+mr:o-mr:h.value===re.AREA_2?t.lam=o-Q:t.lam=o;else if(this.face===xe.BOTTOM)u=Math.acos(l),t.phi=u-Q,h.value===re.AREA_0?t.lam=-o+Q:h.value===re.AREA_1?t.lam=-o:h.value===re.AREA_2?t.lam=-o-Q:t.lam=o<0?-o-mr:-o+mr;else{var f,g,m;f=l,c=f*f,c>=1?m=0:m=Math.sqrt(1-c)*Math.sin(o),c+=m*m,c>=1?g=0:g=Math.sqrt(1-c),h.value===re.AREA_1?(c=g,g=-m,m=c):h.value===re.AREA_2?(g=-g,m=-m):h.value===re.AREA_3&&(c=g,g=m,m=-c),this.face===xe.RIGHT?(c=f,f=-g,g=c):this.face===xe.BACK?(f=-f,g=-g):this.face===xe.LEFT&&(c=f,f=g,g=-c),t.phi=Math.acos(-m)-Q,t.lam=Math.atan2(g,f),this.face===xe.RIGHT?t.lam=Du(t.lam,-Q):this.face===xe.BACK?t.lam=Du(t.lam,-3.14159265359):this.face===xe.LEFT&&(t.lam=Du(t.lam,+Q))}if(this.es!==0){var _,E,M;_=t.phi<0?1:0,E=Math.tan(t.phi),M=this.b/Math.sqrt(E*E+this.one_minus_f_squared),t.phi=Math.atan(Math.sqrt(this.a*this.a-M*M)/(this.one_minus_f*M)),_&&(t.phi=-t.phi)}return t.lam+=this.long0,r.x=t.lam,r.y=t.phi,r}function Jc(r,t,e,i){var n;return r<st?(i.value=re.AREA_0,n=0):(n=Math.atan2(t,e),Math.abs(n)<=ee?i.value=re.AREA_0:n>ee&&n<=Q+ee?(i.value=re.AREA_1,n-=Q):n>Q+ee||n<=-(Q+ee)?(i.value=re.AREA_2,n=n>=0?n-mr:n+mr):(i.value=re.AREA_3,n+=Q)),n}function Du(r,t){var e=r+t;return e<-3.14159265359?e+=_h:e>3.14159265359&&(e-=_h),e}var GP=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const kP={init:LP,forward:RP,inverse:FP,names:GP};var Od=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Th=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],h0=.8487,c0=1.3523,f0=$n/5,zP=1/f0,xu=18,Kc=function(r,t){return r[0]+t*(r[1]+t*(r[2]+t*r[3]))},VP=function(r,t){return r[1]+t*(2*r[2]+t*3*r[3])};function UP(r,t,e,i){for(var n=t;i;--i){var s=r(n);if(n-=s,Math.abs(s)<e)break}return n}function qP(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function WP(r){var t=ht(r.x-this.long0),e=Math.abs(r.y),i=Math.floor(e*f0);i<0?i=0:i>=xu&&(i=xu-1),e=$n*(e-zP*i);var n={x:Kc(Od[i],e)*t,y:Kc(Th[i],e)};return r.y<0&&(n.y=-n.y),n.x=n.x*this.a*h0+this.x0,n.y=n.y*this.a*c0+this.y0,n}function HP(r){var t={x:(r.x-this.x0)/(this.a*h0),y:Math.abs(r.y-this.y0)/(this.a*c0)};if(t.y>=1)t.x/=Od[xu][0],t.y=r.y<0?-Q:Q;else{var e=Math.floor(t.y*xu);for(e<0?e=0:e>=xu&&(e=xu-1);;)if(Th[e][0]>t.y)--e;else if(Th[e+1][0]<=t.y)++e;else break;var i=Th[e],n=5*(t.y-i[0])/(Th[e+1][0]-i[0]);n=UP(function(s){return(Kc(i,s)-t.y)/VP(i,s)},n,st,100),t.x/=Kc(Od[e],n),t.y=(5*e+n)*de,r.y<0&&(t.y=-t.y)}return t.x=ht(t.x+this.long0),t}var XP=["Robinson","robin"];const YP={init:qP,forward:WP,inverse:HP,names:XP};function JP(){this.name="geocent"}function KP(r){var t=Vm(r,this.es,this.a);return t}function QP(r){var t=Um(r,this.es,this.a,this.b);return t}var ZP=["Geocentric","geocentric","geocent","Geocent"];const BP={init:JP,forward:KP,inverse:QP,names:ZP};var xr={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},Dh={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function $P(){if(Object.keys(Dh).forEach((function(e){if(typeof this[e]>"u")this[e]=Dh[e].def;else{if(Dh[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);Dh[e].num&&(this[e]=parseFloat(this[e]))}Dh[e].degrees&&(this[e]=this[e]*de)}).bind(this)),Math.abs(Math.abs(this.lat0)-Q)<st?this.mode=this.lat0<0?xr.S_POLE:xr.N_POLE:Math.abs(this.lat0)<st?this.mode=xr.EQUIT:(this.mode=xr.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var r=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(r),this.sw=Math.sin(r)}function jP(r){r.x-=this.long0;var t=Math.sin(r.y),e=Math.cos(r.y),i=Math.cos(r.x),n,s;switch(this.mode){case xr.OBLIQ:s=this.sinph0*t+this.cosph0*e*i;break;case xr.EQUIT:s=e*i;break;case xr.S_POLE:s=-t;break;case xr.N_POLE:s=t;break}switch(s=this.pn1/(this.p-s),n=s*e*Math.sin(r.x),this.mode){case xr.OBLIQ:s*=this.cosph0*t-this.sinph0*e*i;break;case xr.EQUIT:s*=t;break;case xr.N_POLE:s*=-(e*i);break;case xr.S_POLE:s*=e*i;break}var a,o;return a=s*this.cg+n*this.sg,o=1/(a*this.sw*this.h1+this.cw),n=(n*this.cg-s*this.sg)*this.cw*o,s=a*o,r.x=n*this.a,r.y=s*this.a,r}function tC(r){r.x/=this.a,r.y/=this.a;var t={x:r.x,y:r.y},e,i,n;n=1/(this.pn1-r.y*this.sw),e=this.pn1*r.x*n,i=this.pn1*r.y*this.cw*n,r.x=e*this.cg+i*this.sg,r.y=i*this.cg-e*this.sg;var s=li(r.x,r.y);if(Math.abs(s)<st)t.x=0,t.y=r.y;else{var a,o;switch(o=1-s*s*this.pfact,o=(this.p-Math.sqrt(o))/(this.pn1/s+s/this.pn1),a=Math.sqrt(1-o*o),this.mode){case xr.OBLIQ:t.y=Math.asin(a*this.sinph0+r.y*o*this.cosph0/s),r.y=(a-this.sinph0*Math.sin(t.y))*s,r.x*=o*this.cosph0;break;case xr.EQUIT:t.y=Math.asin(r.y*o/s),r.y=a*s,r.x*=o;break;case xr.N_POLE:t.y=Math.asin(a),r.y=-r.y;break;case xr.S_POLE:t.y=-Math.asin(a);break}t.x=Math.atan2(r.x,r.y)}return r.x=t.x+this.long0,r.y=t.y,r}var eC=["Tilted_Perspective","tpers"];const rC={init:$P,forward:jP,inverse:tC,names:eC};function iC(){if(this.flip_axis=this.sweep==="x"?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var r=1-this.es,t=1/r;this.radius_p=Math.sqrt(r),this.radius_p2=r,this.radius_p_inv2=t,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function nC(r){var t=r.x,e=r.y,i,n,s,a;if(t=t-this.long0,this.shape==="ellipse"){e=Math.atan(this.radius_p2*Math.tan(e));var o=this.radius_p/li(this.radius_p*Math.cos(e),Math.sin(e));if(n=o*Math.cos(t)*Math.cos(e),s=o*Math.sin(t)*Math.cos(e),a=o*Math.sin(e),(this.radius_g-n)*n-s*s-a*a*this.radius_p_inv2<0)return r.x=Number.NaN,r.y=Number.NaN,r;i=this.radius_g-n,this.flip_axis?(r.x=this.radius_g_1*Math.atan(s/li(a,i)),r.y=this.radius_g_1*Math.atan(a/i)):(r.x=this.radius_g_1*Math.atan(s/i),r.y=this.radius_g_1*Math.atan(a/li(s,i)))}else this.shape==="sphere"&&(i=Math.cos(e),n=Math.cos(t)*i,s=Math.sin(t)*i,a=Math.sin(e),i=this.radius_g-n,this.flip_axis?(r.x=this.radius_g_1*Math.atan(s/li(a,i)),r.y=this.radius_g_1*Math.atan(a/i)):(r.x=this.radius_g_1*Math.atan(s/i),r.y=this.radius_g_1*Math.atan(a/li(s,i))));return r.x=r.x*this.a,r.y=r.y*this.a,r}function sC(r){var t=-1,e=0,i=0,n,s,a,o;if(r.x=r.x/this.a,r.y=r.y/this.a,this.shape==="ellipse"){this.flip_axis?(i=Math.tan(r.y/this.radius_g_1),e=Math.tan(r.x/this.radius_g_1)*li(1,i)):(e=Math.tan(r.x/this.radius_g_1),i=Math.tan(r.y/this.radius_g_1)*li(1,e));var l=i/this.radius_p;if(n=e*e+l*l+t*t,s=2*this.radius_g*t,a=s*s-4*n*this.C,a<0)return r.x=Number.NaN,r.y=Number.NaN,r;o=(-s-Math.sqrt(a))/(2*n),t=this.radius_g+o*t,e*=o,i*=o,r.x=Math.atan2(e,t),r.y=Math.atan(i*Math.cos(r.x)/t),r.y=Math.atan(this.radius_p_inv2*Math.tan(r.y))}else if(this.shape==="sphere"){if(this.flip_axis?(i=Math.tan(r.y/this.radius_g_1),e=Math.tan(r.x/this.radius_g_1)*Math.sqrt(1+i*i)):(e=Math.tan(r.x/this.radius_g_1),i=Math.tan(r.y/this.radius_g_1)*Math.sqrt(1+e*e)),n=e*e+i*i+t*t,s=2*this.radius_g*t,a=s*s-4*n*this.C,a<0)return r.x=Number.NaN,r.y=Number.NaN,r;o=(-s-Math.sqrt(a))/(2*n),t=this.radius_g+o*t,e*=o,i*=o,r.x=Math.atan2(e,t),r.y=Math.atan(i*Math.cos(r.x)/t)}return r.x=r.x+this.long0,r}var aC=["Geostationary Satellite View","Geostationary_Satellite","geos"];const oC={init:iC,forward:nC,inverse:sC,names:aC};var xh=1.340264,Oh=-.081106,Ah=893e-6,Lh=.003796,Qc=Math.sqrt(3)/2;function lC(){this.es=0,this.long0=this.long0!==void 0?this.long0:0}function uC(r){var t=ht(r.x-this.long0),e=r.y,i=Math.asin(Qc*Math.sin(e)),n=i*i,s=n*n*n;return r.x=t*Math.cos(i)/(Qc*(xh+3*Oh*n+s*(7*Ah+9*Lh*n))),r.y=i*(xh+Oh*n+s*(Ah+Lh*n)),r.x=this.a*r.x+this.x0,r.y=this.a*r.y+this.y0,r}function hC(r){r.x=(r.x-this.x0)/this.a,r.y=(r.y-this.y0)/this.a;var t=1e-9,e=12,i=r.y,n,s,a,o,l,u;for(u=0;u<e&&(n=i*i,s=n*n*n,a=i*(xh+Oh*n+s*(Ah+Lh*n))-r.y,o=xh+3*Oh*n+s*(7*Ah+9*Lh*n),i-=l=a/o,!(Math.abs(l)<t));++u);return n=i*i,s=n*n*n,r.x=Qc*r.x*(xh+3*Oh*n+s*(7*Ah+9*Lh*n))/Math.cos(i),r.y=Math.asin(Math.sin(i)/Qc),r.x=ht(r.x+this.long0),r}var cC=["eqearth","Equal Earth","Equal_Earth"];const fC={init:lC,forward:uC,inverse:hC,names:cC};var Rh=1e-10;function dC(){var r;if(this.phi1=this.lat1,Math.abs(this.phi1)<Rh)throw new Error;this.es?(this.en=Id(this.es),this.m1=bu(this.phi1,this.am1=Math.sin(this.phi1),r=Math.cos(this.phi1),this.en),this.am1=r/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=gC,this.forward=pC):(Math.abs(this.phi1)+Rh>=Q?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=vC,this.forward=mC)}function pC(r){var t=ht(r.x-(this.long0||0)),e=r.y,i,n,s;return i=this.am1+this.m1-bu(e,n=Math.sin(e),s=Math.cos(e),this.en),n=s*t/(i*Math.sqrt(1-this.es*n*n)),r.x=i*Math.sin(n),r.y=this.am1-i*Math.cos(n),r.x=this.a*r.x+(this.x0||0),r.y=this.a*r.y+(this.y0||0),r}function gC(r){r.x=(r.x-(this.x0||0))/this.a,r.y=(r.y-(this.y0||0))/this.a;var t,e,i,n;if(e=li(r.x,r.y=this.am1-r.y),n=Md(this.am1+this.m1-e,this.es,this.en),(t=Math.abs(n))<Q)t=Math.sin(n),i=e*Math.atan2(r.x,r.y)*Math.sqrt(1-this.es*t*t)/Math.cos(n);else if(Math.abs(t-Q)<=Rh)i=0;else throw new Error;return r.x=ht(i+(this.long0||0)),r.y=ga(n),r}function mC(r){var t=ht(r.x-(this.long0||0)),e=r.y,i,n;return n=this.cphi1+this.phi1-e,Math.abs(n)>Rh?(r.x=n*Math.sin(i=t*Math.cos(e)/n),r.y=this.cphi1-n*Math.cos(i)):r.x=r.y=0,r.x=this.a*r.x+(this.x0||0),r.y=this.a*r.y+(this.y0||0),r}function vC(r){r.x=(r.x-(this.x0||0))/this.a,r.y=(r.y-(this.y0||0))/this.a;var t,e,i=li(r.x,r.y=this.cphi1-r.y);if(e=this.cphi1+this.phi1-i,Math.abs(e)>Q)throw new Error;return Math.abs(Math.abs(e)-Q)<=Rh?t=0:t=i*Math.atan2(r.x,r.y)/Math.cos(e),r.x=ht(t+(this.long0||0)),r.y=ga(e),r}var yC=["bonne","Bonne (Werner lat_1=90)"];const _C={init:dC,names:yC};function wC(r){r.Proj.projections.add(Hc),r.Proj.projections.add(Xc),r.Proj.projections.add(dE),r.Proj.projections.add(SE),r.Proj.projections.add(bE),r.Proj.projections.add(AE),r.Proj.projections.add(zE),r.Proj.projections.add(HE),r.Proj.projections.add(QE),r.Proj.projections.add(tS),r.Proj.projections.add(vS),r.Proj.projections.add(PS),r.Proj.projections.add(bS),r.Proj.projections.add(LS),r.Proj.projections.add(zS),r.Proj.projections.add(HS),r.Proj.projections.add(QS),r.Proj.projections.add(tP),r.Proj.projections.add(aP),r.Proj.projections.add(cP),r.Proj.projections.add(mP),r.Proj.projections.add(EP),r.Proj.projections.add(bP),r.Proj.projections.add(AP),r.Proj.projections.add(kP),r.Proj.projections.add(YP),r.Proj.projections.add(BP),r.Proj.projections.add(rC),r.Proj.projections.add(oC),r.Proj.projections.add(fC),r.Proj.projections.add(_C)}ai.defaultDatum="WGS84",ai.Proj=ts,ai.WGS84=new ai.Proj("WGS84"),ai.Point=Nu,ai.toPoint=Xm,ai.defs=Hr,ai.nadgrid=dw,ai.transform=Wc,ai.mgrs=xw,ai.version="__VERSION__",wC(ai);const d0=ai("+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees","+proj=geocent +datum=WGS84");function es(r){return d0.forward(r)}function p0(r){return d0.inverse(r)}const g0=ai("+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees","+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs +type=crs");function EC(r){const t=g0.forward([r[0],r[1]]);return[t[0],t[1],r[2]]}function SC(r){const t=g0.inverse([r[0],r[1]]);return[t[0],t[1],r[2]]}function m0(r,t){const e=es(r),i=es(t);return d.Vector.distance(e,i)}function Fh(r,t){const e=[];do{const i=r.length;let n=0;for(let s=0;s<i-1;++s){if(t===void 0||t==="GEODESIC"){const a=fd(r[s],r[s+1]),o=Math.abs(r[s][2]-r[s+1][2]);if(o===0)n+=a;else{const l=Math.sqrt(a*a+o*o);n+=l}}else if(t==="RHUMB"){const a=pm(r[s],r[s+1]),o=Math.abs(r[s][2]-r[s+1][2]);if(o===0)n+=a;else{const l=Math.sqrt(a*a+o*o);n+=l}}else if(t==="NONE"){const a=m0(r[s],r[s+1]);n+=a}else console.warn(`未知的arcType: ${t},导致距离无法计算!`);e.push(n)}}while(!1);return e}function Ad(r){const t="__getXyzFromPostion";let e=d.getExtProp(r,t);return(!e||!d.Vector.equals(e[0],r))&&(e=[[...r],es(r)],d.setExtProp(r,t,e)),e[1]}class v0 extends d.Destroyable{constructor(){super();p(this,"_data",this.dv(d.react(void 0)))}set data(e){this._data.value=e}get data(){return this._data.value}get dataChanged(){return this._data.changed}}class y0 extends d.Destroyable{constructor(){super(...arguments);p(this,"_dragStartEvent",this.dv(new d.Event));p(this,"_dragOverEvent",this.dv(new d.Event));p(this,"_dragLeaveEvent",this.dv(new d.Event));p(this,"_dropEvent",this.dv(new d.Event))}dragStart(e){this._dragStartEvent.emit(e)}dragOver(e){this._dragOverEvent.emit(e)}dragLeave(e){this._dragLeaveEvent.emit(e)}drop(e){this._dropEvent.emit(e)}}function PC(r,t){t&&(Reflect.has(t,"editing")?t.editing=!0:Reflect.has(t,"positionEditing")&&(t.positionEditing=!0))}function CC(r){["Czm3DTiles","View","ESCameraView","OlView","GeoCameraController"].includes(r.typeName)||(Reflect.has(r,"editing")?r.editing=!0:Reflect.has(r,"positionEditing")&&(r.positionEditing=!0)),typeof r.execOnCreating=="function"&&r.execOnCreating()}function Zc(r,t){d.getExtProp(r,"__treeItem")&&console.error("setSceneObjectTreeItem error!"),d.setExtProp(r,"__treeItem",t)}function IC(r){return d.getExtProp(r,"__treeItem")}function MC(r){if(!(r.startsWith("./")||r.startsWith("../")||r.startsWith("/")))return r;const t=document.createElement("a");t.href=r;const e=t.href;return t.remove(),e}function NC(r){try{return JSON.parse(r),!0}catch{return!1}}function bC(r){return r instanceof Function?r():r}function _0(r,t){for(let e of r)if(t.includes(e))return!0;return!1}function Ds(r,t){const e=r,i=t;return e===void 0||e.length===0||i===void 0||i.length===0?!0:_0(e,i)}function TC(r){const t=setTimeout(()=>{r(),clearTimeout(t)})}function Ou(r){let t=r%360;return t=t<0?360+t:t,t}function w0(r){return Ou(r+180)-180}function Bc(r,t,e){let i=Ou(r),n=Ou(t);Math.abs(i-n)>180&&(i<n?i+=360:n+=360);const s=i*(1-e)+n*e;return w0(s)}function Ld(r,t,e,i){return i=i||[0,0,0],i[0]=Bc(r[0],t[0],e),i[1]=Bc(r[1],t[1],e),i[2]=Bc(r[2],t[2],e),i}async function E0(r,t,e="editing"){const i=new d.Destroyable;r.ad(i);const n=t.bind(r);let s=r.viewer;if(s||await new Promise(a=>{i.ad(r.viewerChanged.don(o=>{s=o,a()}))}),!s){console.warn("viewer is undefined!,无法绑定编辑");return}return i.ad(r[`${e}Changed`].don(()=>{var a;r[`${e}`]?n():(a=(r.combinationClass?r.getMainClass():r).editingID)!=null&&a.includes("inner")&&s&&s.stopEditing()})),i.ad(s.editingEvent.don(a=>{if(a.objectIDs.includes(r.id)&&a.type==="end"){const o=r.combinationClass?r.getMainClass():r;o.editingID&&a.editingID.includes(o.editingID)?r[`${e}`]=!1:r[`${e}`]=!o.editingID.includes("outer")}})),r[`${e}`]&&n(),i}function DC(r,t){const{type:e,id:i}=r;if(e){const n=ft.create(e,i);if(n)return n.json=r,n;console.warn(`cannot create sceneObject from type(${e})`)}else console.warn(`cannot create sceneObject from type(${e})`)}function S0(r){const t=r.children&&d.every(r.children,i=>{if(!(i instanceof Or))throw new Error("!(treeItem instanceof SceneTreeItem)");return!i.show})||!1,e=r.sceneTree.getSceneObjectShowFunc(r.sceneObject);return!t||e}class Or extends d.TreeItem{constructor(e,i=!1,n,s,a=!0){super(e,i,n);p(this,"_dragDrop");p(this,"_showChangedNotAffectChildren",!1);p(this,"_showChangedNotAffectParent",!1);p(this,"_type",this.dv(d.react("Unknown")));p(this,"_isExport",this.dv(d.react(!0)));const o=()=>this.tree&&this.tree.itemsChanged.emit([this]);this.dispose(this.nameChanged.disposableOn(o)),this.name=`未命名条目(${this.id})`,this.extras=s,this._isExport.value=a;let l;const u=()=>{l&&(l(),l=void 0)};this.dispose(u),this.dispose(this.sceneObjectChanged.disposableOn(c=>{u(),c&&(l=d.bind([this,"name"],[c,"name"]))})),this.dispose(this.showChanged.disposableOn(c=>{if(e.setSceneObjectShowFunc(this.sceneObject,c),this.tree&&this.tree.forceRedraw(),this.children&&!this._showChangedNotAffectChildren)for(let h of this.children)h instanceof Or&&(h._showChangedNotAffectParent=!0,h.show=c,h._showChangedNotAffectParent=!1);this.parent&&this.parent instanceof Or&&!this._showChangedNotAffectParent&&(this.parent._showChangedNotAffectChildren=!0,this.parent.show=S0(this.parent),this.parent._showChangedNotAffectChildren=!1)})),this.dv(new d.ObjResettingWithEvent(this.sceneObjectChanged,()=>{if(!this.sceneObject)return;const c=new d.Destroyable;if("show"in this.sceneObject&&"showChanged"in this.sceneObject&&this.sceneObject.showChanged instanceof Event){const h=()=>{this.show=e.getSceneObjectShowFunc(this.sceneObject)};h(),c.dispose(this.sceneObject.showChanged.disposableOn(h))}else if("enabled"in this.sceneObject&&"enabledChanged"in this.sceneObject&&this.sceneObject.enabledChanged instanceof Event){const h=()=>{this.show=e.getSceneObjectShowFunc(this.sceneObject)};h(),c.dispose(this.sceneObject.enabledChanged.disposableOn(h))}return c})),this.childrenChangedEvent.disposableOn(()=>{const c=S0(this);this._showChangedNotAffectChildren=!0,this.show=c,this._showChangedNotAffectChildren=!1});{const c=()=>{let h="Unknown";this.sceneObject?h=this.sceneObject.typeName:this.children&&(h="Folder"),this._type.value=h};this.dispose(this.sceneObjectChanged.disposableOn(c)),this.dispose(this.childrenResetedEvent.disposableOn(c)),c()}}get dragDrop(){return this._dragDrop||(this._dragDrop=this.dv(this.sceneTree.createTreeItemDragDropFunc(this))),this._dragDrop}get type(){return this._type.value}get typeChanged(){return this._type.changed}get isExport(){return this._isExport.value}get isExportChanged(){return this._isExport.changed}set isExport(e){this._isExport.value=e}get sceneTree(){return this.tree}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(e){try{this.json=JSON.parse(e)}catch(i){console.error(`sceneTreeItem.jsonStr error ${i}`,i)}}get json(){const e=this.children&&[...this.children].filter(i=>i.isExport).map(i=>i.json);return{name:this.name,show:this.show?void 0:!1,collapsed:this.uiTreeObject.collapsed?!0:void 0,sceneObj:this.sceneObject&&this.sceneObject.json,children:e,extras:this.extras}}set json(e){if(e.name!==void 0&&(this.name=e.name),this.extras=e.extras,this._showChangedNotAffectChildren=!0,this._showChangedNotAffectParent=!0,this.show=e.show??!0,this._showChangedNotAffectChildren=!1,this._showChangedNotAffectParent=!1,this.uiTreeObject.collapsed=e.collapsed??!1,this.sceneObject=void 0,e.sceneObj&&(this.sceneObject=this.sceneTree.createSceneObjectFunc(e.sceneObj,this)),!!e.children){if(this.resetChildren(!0),!this.children)throw new Error("resetChildren(true) cannot get children!");for(let i of e.children){const n=new Or(this.tree,!0);n.json=i,this.children.push(n)}}}clone(){try{const e=new Or(this.sceneTree,!!this.children,void 0,this.extras,this.isExport);return e.json=this.json,e.name=this.sceneTree.getSceneTreeItemCloneNameFunc(this),e}catch(e){console.error(`SceneTreeItem.clone error: ${e}`,e)}}insertNewTreeItem(e,i){if(e==="FolderInnerOrAfter"||e==="FolderInnerOrBefore"||e==="FolderInner"){if(i&&i.tree!==this.tree)return console.warn("newTreeItem.tree !== this.tree"),!1;do{if(!this.children||e.includes("Or")&&this.sceneObject)break;return i&&this.children.push(i),!0}while(!1);if(e==="FolderInner")return!1;if(e==="FolderInnerOrAfter")return super.insertNewTreeItem("After",i);if(e==="FolderInnerOrBefore")return super.insertNewTreeItem("Before",i);throw new Error("should not be here!")}else return super.insertNewTreeItem(e,i)}}(r=>{r.createDefaultProps=()=>({name:"未命名条目",nameEditing:!1,sceneObject:void 0,show:!0,extras:d.reactJsonWithUndefined(void 0)})})(Or||(Or={})),d.extendClassProps(Or.prototype,Or.createDefaultProps);function P0(r,t,e){let{offsetY:i}=t;if(!t.target||!("clientTop"in t.target))return"none";i+=2,i+=t.target.clientTop;let n="none";return r.children?i<=e*.3?n="before":i>=e*.7?!r.uiTreeObject.collapsed&&r.children.length>0?n="inner":n="after":n="inner":i<=e*.5?n="before":n="after",n}class C0 extends y0{constructor(t){super(),this._treeItem=t;const{dragStartDataManager:e}=this._treeItem.sceneTree;let i="none";const n=this.disposeVar(d.createTimeoutWithStartValues(()=>{this._treeItem.uiTreeObject.moveToPositionMode=i,console.log(`uiTreeObject.moveToPositionMode = lastDragMode(${i});`)},200));function s(a){i!==a&&(i=a,n.restart())}this.dispose(this._dragStartEvent.disposableOn(a=>{e.data={type:"UITreeA",value:this._treeItem}})),this.dispose(this._dragOverEvent.disposableOn(a=>{if(a.dataTransfer){a.preventDefault();do{const o=e;if(!(o.data&&o.data.type==="UITreeA"&&o.data.value!==void 0))break;const l=o.data.value,u=this._treeItem,{tree:c}=u;if(!c)break;const h=[...c.selectedItems];~h.indexOf(l)||h.push(l);const f=P0(u,a,c.itemDivHeight);if(f==="none"||!d.Tree.canMoveToTreeItems(h,u,f))break;a.dataTransfer.dropEffect="move",s(f);return}while(!1);a.dataTransfer.dropEffect="none",s("none")}})),this.dispose(this._dropEvent.disposableOn(a=>{const o=e;if(!(o.data&&o.data.type==="UITreeA"&&o.data.value!==void 0))return;const l=o.data.value,u=this._treeItem,{tree:c}=u;if(!c)return;const h=[...c.selectedItems];~h.indexOf(l)||h.push(l);const f=P0(u,a,c.itemDivHeight);f!=="none"&&d.Tree.canMoveToTreeItems(h,u,f)&&(d.Tree.moveToTreeItems(h,u,f),o.data=void 0,s("none"))})),this.dispose(this._dragLeaveEvent.disposableOn(()=>{i="none",n.restart()}))}}function xC(r){if(!(r instanceof Or))throw new Error("defaultCreateTreeItemDragDrop !(treeItem instanceof SceneTreeItem)");return new C0(r)}function OC(r){let t=!1;do{if(!r)break;"show"in r?t=r.show??!0:"enabled"in r&&(t=r.enabled??!0)}while(!1);return t}function AC(r,t){r&&("show"in r?r.show=t:"enabled"in r&&(r.enabled=t))}const LC=["EnvironmentVariables","ScriptsLoader","SceneScript","ScriptLoader"];function RC(r){const t=[],{root:e={}}=r,i=[e];for(;i.length>0;){const n=i.pop();if(!n)throw new Error("!todo");if(n.children){for(let s of n.children)if(s.children&&i.unshift(s),s.sceneObj){const{type:a=void 0}=s.sceneObj;a||(console.warn("sceneObjJson has no type! treeItem.sceneObj: "),console.warn(s.sceneObj)),a&&LC.includes(a)&&t.push(s.sceneObj)}}}return t}async function FC(r,t){const e=RC(r);let i=0;const n=e.length;for(let s of e)if(++i,t){const a=i/n;t(a,i,n)}}class I0 extends d.Destroyable{constructor(e,i){super();p(this,"treeItemContexMenuCallback");this._sceneTree=e,this._projectManager=i}get sceneTree(){return this._sceneTree}}class GC extends d.Destroyable{constructor(e){super();p(this,"_jsonLoadingEvent",this.disposeVar(new d.Event));p(this,"_setJsonProcessing",this.disposeVar(d.createProcessingFromAsyncFunc(async(e,i)=>{this._jsonLoadingEvent.emit({type:"init"}),this._jsonLoadingEvent.emit({type:"loading"}),i&&await e.promise(this._sceneTree.preloadFunc(i)),this._setJson(i),this._jsonLoadingEvent.emit({type:"loaded"})})));this._sceneTree=e,this._setJsonProcessing.errorFunc=i=>{this._jsonLoadingEvent.emit({type:"error",error:i})}}get jsonLoadingEvent(){return this._jsonLoadingEvent}_setJson(e){try{this._sceneTree.setJson(e||{})}catch(i){console.error(`json数据装配时发生错误!error: ${i}`)}}get json(){return this._sceneTree.getJson()}set json(e){this._setJsonProcessing.restart(new d.CancelError("JSON重新赋值!"),e)}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(e){this.json=JSON.parse(e)}}function kC(r){return r.name+"_clone"}function Rd(r,t,e){if(r instanceof Or)return r.insertNewTreeItem(t,e);{const i={FolderInnerOrAfter:"InnerOrAfter",FolderInnerOrBefore:"InnerOrBefore",FolderInner:"Inner",InnerOrAfter:"InnerOrAfter",InnerOrBefore:"InnerOrBefore",Inner:"Inner",After:"After",Before:"Before"};return r.insertNewTreeItem(i[t],e)}}function zC(r){[r,...r.getDescendants()].forEach(t=>t.destroy())}const hi=class hi extends d.Tree{constructor(e,i,n,s){super(n);p(this,"_jsonLoading",this.disposeVar(new GC(this)));p(this,"createSceneObjectFunc",hi.defaultCreateSceneObjectFunc);p(this,"createTreeItemDragDropFunc",hi.defaultCreateTreeItemDragDropFunc);p(this,"preloadFunc",hi.defaultPreload);p(this,"getSceneObjectShowFunc",hi.defaultGetSceneObjectShow);p(this,"setSceneObjectShowFunc",hi.defaultSetSceneObjectShow);p(this,"getSceneTreeItemCloneNameFunc",hi.defaultGetSceneTreeItemCloneNameFunc);p(this,"debug",!1);p(this,"_contextMenu",this.disposeVar(new I0(this,this.projectManager)));p(this,"_showPropUiOnSelecting",this.disposeVar(d.react(!0)));this._name=e,this._dragStartDataManager=i,this._projectManager=s,this.dispose(this.selectedItems.changedEvent.disposableOn(()=>{var o,l;window.lssn=this.lastSelectedItem,window.lsso=(o=this.lastSelectedItem)==null?void 0:o.sceneObject,this.debug&&console.log(((l=this.lastSelectedItem)==null?void 0:l.sceneObject)??"select null")}));const{sceneObjectsManager:a}=this._projectManager;this.dispose(this.itemsDeleted.disposableOn(o=>{for(let l of o){const u=l,{sceneObject:c}=u;c&&a.deleteSceneObject(c)&&c.destroy()&&Zc(c,void 0);for(let h of u.getDescendants()){const{sceneObject:f}=h;f&&a.deleteSceneObject(f)&&f.destroy()&&Zc(f,void 0)}zC(l)}})),this.dispose(this.itemsAdded.disposableOn(o=>{for(let l of o){const u=l;u.sceneObject&&a.addSceneObject(u.sceneObject)&&Zc(u.sceneObject,u)}})),this.dispose(this.selectedItems.changedEvent.disposableOn(()=>{if(!this.showPropUiOnSelecting)return;this._projectManager.propUiTreeManager.sceneObject=void 0;const{lastSelectedItem:o}=this;o&&(this._projectManager.propUiTreeManager.sceneObject=o.sceneObject)}))}get json(){return this._jsonLoading.json}set json(e){this._jsonLoading.json=e}get jsonStr(){return this._jsonLoading.jsonStr}set jsonStr(e){this._jsonLoading.jsonStr=e}get jsonLoadingEvent(){return this._jsonLoading.jsonLoadingEvent}get name(){return this._name}get projectManager(){return this._projectManager}get contextMenu(){return this._contextMenu}get showPropUiOnSelecting(){return this._showPropUiOnSelecting.value}set showPropUiOnSelecting(e){this._showPropUiOnSelecting.value=e}get showPropUiOnSelectingChanged(){return this._showPropUiOnSelecting.changed}get sceneUiTree(){return this.uiTree}getTreeItemFromSceneObjId(e){const i=this.getDescendants();let n;for(let s of i)if(s.sceneObject&&s.sceneObject.id===e){n=s;break}return n}get dragStartDataManager(){return this._dragStartDataManager}getJson(){return{root:{children:[...this.children].filter(e=>e.isExport).map(e=>e.json)}}}setJson(e){var n;e.root=e.root||{};const i=e.root.children??[];this.root.resetChildren(!0);for(let s of i){const a=new Or(this,!0);a.json=s,(n=this.root.children)==null||n.push(a)}}testAddNewTreeItem(e,i){const n=e||this.lastSelectedItem||this.root;return n?Rd(n,i):!1}addNewTreeItem(e,i,n,s){const a=e||this.lastSelectedItem||this.root;if(a&&Rd(a,i)){const o=new Or(this,n);if(o.sceneObject=s,!Rd(a,i,o))throw new Error("currentTreeItem.insertNewTreeItem return false!");return o}}createSceneObjectTreeItem(e,i,n,s){const a=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(n,a)){console.warn(`cannot addNewTreeItem! currentTreeItem(${n?n.id:"root"})`);return}const o=ft.create(e,i);return o?this.addNewTreeItem(n,s??"FolderInnerOrAfter",!0,o):void 0}createGroupTreeItem(e,i,n,s){const a=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(n,a)){console.warn(`cannot addNewTreeItem! currentTreeItem(${n?n.id:"root"})`);return}const o=this.addNewTreeItem(n,s??"FolderInnerOrAfter",!0);if(!o){console.warn("addNewTreeItem error!");return}return o.name=e??"未命名组节点",o}createSceneObjectTreeItemFromClass(e,i,n,s){const a=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(n,a))return;const o=ft.createFromClass(e,i);return o?this.addNewTreeItem(n,a,!0,o):void 0}createSceneObjectTreeItemFromJson(e,i,n){const s=n??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(i,s))return;const a=ft.createFromJson(e);return a?this.addNewTreeItem(i,n??"FolderInnerOrAfter",!0,a):void 0}destroySceneObjectTreeItem(e){if(e===this.root){console.warn("cannot destroy root! please use function destroyAllSceneObjectTreeItems!");return}e.detachFromParent()}destroyAllSceneObjectTreeItems(){if(!this.root.children)return;const e=[...this.root.children];for(let i of e)this.destroySceneObjectTreeItem(i)}};p(hi,"defaultCreateSceneObjectFunc",DC),p(hi,"defaultCreateTreeItemDragDropFunc",xC),p(hi,"defaultPreload",FC),p(hi,"defaultGetSceneObjectShow",OC),p(hi,"defaultSetSceneObjectShow",AC),p(hi,"defaultGetSceneTreeItemCloneNameFunc",kC);let Gh=hi;const Fd={saturation:.35,brightness:1.4,gamma:.8,atmosphereScatteringIntensity:5,groundColor:[0,.09411764705882353,.3137254901960784,1]};class M0 extends d.Tree{constructor(t){super(t)}get propUiTree(){return this.uiTree}}class Gd extends d.TreeItem{constructor(t,e,i){super(t,e),this._property=i}get property(){return this._property}}class kd extends Gd{constructor(t,e){super(t,!1,e)}}class zd extends Gd{constructor(t,e){super(t,!0,e)}get groupChildren(){return this.children}}function N0(r,t){const e=new M0(t),i=r.getProperties("chinese"),n=[];for(let s of i)if(s instanceof H){const a=new zd(e,s);a.d(()=>s.destroy()),e.children.push(a),n.push(a)}else{const a=new kd(e,s);e.children.push(a),a.d(()=>s.destroy())}for(;n.length>0;){const s=n.pop();if(!s)throw new Error("should not be here!");const a=s;if(!(a.property instanceof H))throw new Error("!(treeItem.property instanceof GroupProperty)");for(let o of a.property.children)if(o instanceof H){const l=new zd(e,o);l.d(()=>o.destroy()),a.groupChildren.push(l),n.push(l)}else{const l=new kd(e,o);a.groupChildren.push(l),l.d(()=>o.destroy())}}return e.d(()=>{e.itemChildrenChanged.reset(),e.itemChildrenToChange.reset();const s=[...e.getDescendants()];s.forEach(a=>{a.children&&(a.children.length=0),a.destroy()}),s.length=0}),e}class Au extends d.Destroyable{constructor(e){super();p(this,"_propTreeReact",this.dv(d.react(void 0)));this.d(()=>this._propTreeReact.value=void 0),this.dv(new d.ObjResettingWithEvent(this.sceneObjectChanged,i=>{if(!i)return;const n=new d.Destroyable;return n.d(i.toDestroyEvent.don(()=>{this.sceneObject=void 0})),n})),this.d(this.sceneObjectChanged.don(i=>{this._propTreeReact.value=void 0,!(!i||!(i instanceof ft))&&(this._propTreeReact.value=N0(i,e))}))}get propTree(){return this._propTreeReact.value}get propTreeChanged(){return this._propTreeReact.changed}}(r=>{r.createDefaultProps=()=>({sceneObject:void 0})})(Au||(Au={})),d.extendClassProps(Au.prototype,Au.createDefaultProps);function VC(r,t,e,i=!0){i&&e(),r.dispose(t.disposableOn(e))}class UC extends d.Destroyable{constructor(e,i,n,s){super();p(this,"_sceneObjectId",this.dv(new d.SceneObjectWithId));this._id=e,this._startTimeStamp=i,this._duration=n,this._parent=s,this._sceneObjectId.id=this._id;const a=()=>{if(!this.player)return;const{currentTime:o=0}=this._parent,l=o-this._startTimeStamp;this.player.currentTime=d.clamp(l,0,this._duration)*(this.player.speed??1)};a(),this.d(this._parent.currentTimeChanged.don(a)),this.d(this.playerChanged.don(a))}get player(){return this._sceneObjectId.sceneObject instanceof bn?this._sceneObjectId.sceneObject:void 0}get playerChanged(){return this._sceneObjectId.sceneObjectChanged}}const qC=`
31
31
  用来配置子播放器,它是一个数组形式,数组的每个元素仍然是一个数组,形式是[子播放器的ID, 起始时间, 持续时间]。
32
32
  注意时间的单位是毫秒。
33
33
  示例如下:
@@ -534,10 +534,10 @@ ${$0}
534
534
  `,j0=Date.now();new Date(j0).toISOString(),new Date(j0+864e5).toISOString();const Ge=class Ge extends ft{constructor(e){super(e);p(this,"_flyToEvent",this.disposeVar(new d.Event));p(this,"_resetClockEvent",this.disposeVar(new d.Event))}get typeName(){return"ESCzml"}get defaultProps(){return Ge.createDefaultProps()}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new Y("数据","数据",!0,!1,[this,"data"],Ge.defaults.data,Ge.defaults.dataMd),new Y("路径","路径",!1,!1,[this,"uri"],""),new U("启用","启用",!1,!1,[this,"clockEnabled"],!1),new C("倍速","倍速.",!1,!1,[this,"multiplier"],Ge.defaults.multiplier),new U("自动设置时钟","自动设置时钟",!1,!1,[this,"autoResetClock"],!0),new Gn("开始时间","开始时间",!0,!1,[this,"startTime"],Ge.defaults.startTime),new Gn("结束时间","结束时间",!0,!1,[this,"stopTime"],Ge.defaults.stopTime),new Gn("当前时间","当前时间",!0,!1,[this,"currentTime"],Ge.defaults.currentTime),new tt("clockStep","clockStep",!1,!1,[this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"SYSTEM_CLOCK_MULTIPLIER"),new tt("clockRange","clockRange",!1,!1,[this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"UNBOUNDED"),new U("是否启用动画","是否启用动画",!1,!1,[this,"shouldAnimate"],!1)],general:[...e.general,new nt("唯一标识","id",!1,!0,[this,"id"]),new nt("名称","name",!0,!1,[this,"name"]),new U("是否显示","show",!1,!1,[this,"show"],!0),new U("开启碰撞","collision",!1,!1,[this,"collision"],!1),new U("允许拾取","allowPicking",!1,!1,[this,"allowPicking"],!1)]}}getProperties(e){return[...super.getProperties(e),new H("通用","通用",[new U("是否显示","A boolean Property specifying the visibility .",!1,!1,[this,"show"]),new U("允许拾取","是否允许拾取",!1,!1,[this,"allowPicking"]),new mt("飞入","飞入",["number"],i=>this.flyTo(i),[1e3]),new Y("数据","数据",!0,!1,[this,"data"],Ge.defaults.data,Ge.defaults.dataMd),new Y("路径","路径",!1,!1,[this,"uri"]),new U("自动设置时钟","自动设置时钟",!1,!1,[this,"autoResetClock"]),new mt("重设时钟","根据当前加载的数据重设始终",[],()=>this.resetClock(),[]),new Fn("loadFnStr","loadFnStr",!0,!1,[this,"loadFuncStr"],Ge.defaults.defaultLoadFuncStr,Ge.defaults.defaultLoadFuncDocStr)]),new H("时钟","时钟",[new U("启用","启用",!1,!1,[this,"clockEnabled"]),new Gn("开始时间","开始时间",!0,!1,[this,"startTime"],Ge.defaults.startTime),new Gn("结束时间","结束时间",!0,!1,[this,"stopTime"],Ge.defaults.stopTime),new Gn("当前时间","当前时间",!0,!1,[this,"currentTime"],Ge.defaults.currentTime),new C("倍速","倍速.",!1,!1,[this,"multiplier"],Ge.defaults.multiplier),new tt("clockStep","clockStep",!1,!1,[this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]]),new tt("clockRange","clockRange",!1,!1,[this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]]),new U("是否启用动画","是否启用动画",!1,!1,[this,"shouldAnimate"])])]}};p(Ge,"type",Ge.register("ESCzml",Ge,{chsName:"ESCzml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Czml数据加载"})),p(Ge,"defaults",{...ft.defaults,show:!0,allowPicking:!0,data:yI,dataMd:_I,autoResetClock:!0,clockEnabled:!1,startTime:()=>Date.now(),stopTime:()=>Date.now()+864e5,currentTime:()=>Date.now(),multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,uri:"${earthsdk3-assets-script-dir}/assets/misc/simple.czml",defaultLoadFuncStr:$0,defaultLoadFuncDocStr:wI});let hl=Ge;(r=>{r.createDefaultProps=()=>({show:!0,uri:"",allowPicking:!1,data:d.reactJsonWithUndefined(void 0),autoResetClock:!0,clockEnabled:!1,startTime:void 0,stopTime:void 0,currentTime:void 0,multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,loadFuncStr:void 0,...ft.createDefaultProps()})})(hl||(hl={})),d.extendClassProps(hl.prototype,hl.createDefaultProps);const zl=class zl extends ft{get typeName(){return"ESNavigator"}get defaultProps(){return zl.createDefaultProps()}getProperties(t){return[...super.getProperties(t),new H("通用","通用",[new U("是否显示","A boolean Property specifying the visibility .",!1,!1,[this,"show"]),new C("尺寸","尺寸",!1,!1,[this,"cssSize"]),new se("位置","位置(top,right)",!1,!1,[this,"cssPosition"]),new qu("图片地址","图片地址",!1,!1,[this,"imgUrl"])])]}};p(zl,"type",zl.register("ESNavigator",zl,{chsName:"导航控件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"导航控件"})),p(zl,"defaults",{...ft.defaults,show:!0,cssPosition:[170,30],cssSize:100,imgUrl:ft.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/zhinanzhen.png")});let cl=zl;(r=>{r.createDefaultProps=()=>({...ft.createDefaultProps(),show:!0,cssSize:100,cssPosition:[170,30],imgUrl:r.defaults.imgUrl})})(cl||(cl={})),d.extendClassProps(cl.prototype,cl.createDefaultProps);const Ln=class Ln extends ft{get typeName(){return"ESViewerStatusBar"}get defaultProps(){return Ln.createDefaultProps()}constructor(t){super(t)}getProperties(t){return[...super.getProperties(t),new H("通用","通用",[new U("是否显示","A boolean Property specifying the visibility .",!1,!1,[this,"show"],Ln.defaults.show),new C("高度","height",!0,!1,[this,"height"],Ln.defaults.height),new C("文字大小","fontSize",!0,!1,[this,"fontSize"],Ln.defaults.fontSize),new it("背景颜色"," 背景颜色",!0,!1,[this,"bgColor"],Ln.defaults.bgColor)])]}};p(Ln,"type",Ln.register("ESViewerStatusBar",Ln,{chsName:"状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"})),p(Ln,"defaults",{...ft.defaults,show:!0,height:30,fontSize:14,bgColor:[71,71,71,.8]});let fl=Ln;(r=>{r.createDefaultProps=()=>({...ft.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:d.reactArray([.2784313725490196,.2784313725490196,.2784313725490196,.8])})})(fl||(fl={})),d.extendClassProps(fl.prototype,fl.createDefaultProps);const Rn=class Rn extends ft{get typeName(){return"ESViewerStatusBarScale"}get defaultProps(){return Rn.createDefaultProps()}constructor(t){super(t)}getProperties(t){return[...super.getProperties(t),new H("通用","通用",[new U("是否显示","A boolean Property specifying the visibility .",!1,!1,[this,"show"],Rn.defaults.show),new C("高度","height",!0,!1,[this,"height"],Rn.defaults.height),new C("文字大小","fontSize",!0,!1,[this,"fontSize"],Rn.defaults.fontSize),new it("背景颜色"," 背景颜色",!0,!1,[this,"bgColor"],Rn.defaults.bgColor)])]}};p(Rn,"type",Rn.register("ESViewerStatusBarScale",Rn,{chsName:"比例尺状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"})),p(Rn,"defaults",{...ft.defaults,show:!0,height:30,fontSize:14,bgColor:[71,71,71,.8]});let dl=Rn;(r=>{r.createDefaultProps=()=>({...ft.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:d.reactArray([.2784313725490196,.2784313725490196,.2784313725490196,.8])})})(dl||(dl={})),d.extendClassProps(dl.prototype,dl.createDefaultProps);const Vl=class Vl extends ${get typeName(){return"ESGaussianSplatting"}get defaultProps(){return Vl.createDefaultProps()}constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new nt("路径","url",!0,!1,[this,"url"]),new C("进度","progress",!1,!0,[this,"progress"],0)]}}getProperties(t){return[...super.getProperties(t),new H("通用","通用",[new nt("路径","url",!0,!1,[this,"url"]),new C("进度","progress",!1,!0,[this,"progress"],0)])]}};p(Vl,"type",Vl.register("ESGaussianSplatting",Vl,{chsName:"高斯溅射模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载高斯溅射模型的 ES 对象"})),p(Vl,"defaults",{...$.defaults});let pl=Vl;(r=>{r.createDefaultProps=()=>({...$.createDefaultProps(),url:"",progress:0})})(pl||(pl={})),d.extendClassProps(pl.prototype,pl.createDefaultProps);const Ys=class Ys extends ${get typeName(){return"ESStaticMesh"}get defaultProps(){return Ys.createDefaultProps()}constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()},e=[new nt("mesh地址","mesh地址",!1,!1,[this,"mesh"],Ys.defaults.mesh)];return t.basic.push(...e),t}getProperties(t){return[...super.getProperties(t),new H("ESStaticMesh","ESStaticMesh",[new nt("mesh地址","mesh地址",!1,!1,[this,"mesh"],Ys.defaults.mesh)])]}};p(Ys,"type",Ys.register("ESStaticMesh",Ys,{chsName:"静态网格",tags:["ESObjects","_ES_Impl_UE"],description:"Unreal的Mesh对象"})),p(Ys,"defaults",{...$.defaults,mesh:"StaticMesh'/Engine/BasicShapes/Sphere.Sphere'"});let gl=Ys;(r=>{r.createDefaultProps=()=>({...$.createDefaultProps(),mesh:""})})(gl||(gl={})),d.extendClassProps(gl.prototype,gl.createDefaultProps);const Ul=class Ul extends wt{constructor(e){super(e);p(this,"_startEvent",this.dv(new d.Event));p(this,"_clearEvent",this.dv(new d.Event));p(this,"_eSGeoExtrudedPolygon");this._eSGeoExtrudedPolygon=this.disposeVar(new Os),this._eSGeoExtrudedPolygon.parentID=this.id,this.ad(this.components.disposableAdd(this._eSGeoExtrudedPolygon)),this.eSGeoExtrudedPolygon.perPositionHeight=!0,this.eSGeoExtrudedPolygon.extrudedHeight=0,this.stroked=!0,this.strokeWidth=2,this.strokeColor=[1,0,0,1],this.ad(d.track([this.eSGeoExtrudedPolygon,"show"],[this,"show"])),this.ad(d.track([this.eSGeoExtrudedPolygon,"stroked"],[this,"stroked"])),this.ad(d.track([this.eSGeoExtrudedPolygon,"strokeWidth"],[this,"strokeWidth"])),this.ad(d.track([this.eSGeoExtrudedPolygon,"strokeColor"],[this,"strokeColor"])),this.ad(d.track([this.eSGeoExtrudedPolygon,"filled"],[this,"filled"])),this.ad(d.track([this.eSGeoExtrudedPolygon,"fillColor"],[this,"fillColor"])),this.ad(d.track([this.eSGeoExtrudedPolygon,"points"],[this,"points"])),this.ad(this.clearEvent.don(()=>{this.points=void 0,this.depths=void 0,this.windowPositions=void 0}))}get typeName(){return"ESSkylineAnalysis"}get defaultProps(){return Ul.createDefaultProps()}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get clearEvent(){return this._clearEvent}clear(){this._clearEvent.emit()}get eSGeoExtrudedPolygon(){return this._eSGeoExtrudedPolygon}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new mt("开始分析","开始分析",[],()=>this.start(),[]),new mt("清除分析","清除分析",[],()=>this.clear(),[]),new Y("屏幕坐标","windowPositions",!1,!0,[this,"windowPositions"]),new Y("深度值","depths",!1,!0,[this,"depths"]),new C("半径","半径",!0,!1,[this,"radius"],1e4)]}}getProperties(e){return[...super.getProperties(e),new H("通用","通用",[new mt("开始分析","开始分析",[],()=>this.start(),[]),new mt("清除分析","清除分析",[],()=>this.clear(),[]),new Y("屏幕坐标","windowPositions",!1,!0,[this,"windowPositions"]),new Y("深度值","depths",!1,!0,[this,"depths"]),new C("半径","半径",!0,!1,[this,"radius"],1e4)])]}};p(Ul,"type",Ul.register("ESSkylineAnalysis",Ul,{chsName:"天际线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"分析类"})),p(Ul,"defaults",{...wt.defaults,windowPositions:[],depths:[],radius:1e4});let ml=Ul;(r=>{r.createDefaultProps=()=>({...wt.createDefaultProps(),windowPositions:yf(void 0),depths:d.reactArrayWithUndefined(void 0),radius:d.react(void 0)})})(ml||(ml={})),d.extendClassProps(ml.prototype,ml.createDefaultProps);const Li=class Li extends Ot{get typeName(){return"ESHeatMap"}get defaultProps(){return Li.createDefaultProps()}constructor(t){super(t)}getESProperties(){const t=super.getESProperties();return{...t,basic:[...t.basic,new Y("data","数据",!0,!1,[this,"data"]),new Y("gradient","渐变",!0,!1,[this,"gradient"],Li.defaults.gradient),new C("radius","半径",!0,!1,[this,"radius"],Li.defaults.radius),new C("blur","模糊",!0,!1,[this,"blur"],Li.defaults.blur),new U("is3D","3D",!0,!1,[this,"is3D"])]}}getProperties(t){return[...super.getProperties(t),new H("通用","通用",[new Y("data","数据",!0,!1,[this,"data"]),new Y("gradient","渐变",!0,!1,[this,"gradient"],Li.defaults.gradient),new C("radius","半径",!0,!1,[this,"radius"],Li.defaults.radius),new C("blur","模糊",!0,!1,[this,"blur"],Li.defaults.blur),new U("is3D","3D",!0,!1,[this,"is3D"])])]}};p(Li,"type",Li.register("ESHeatMap",Li,{chsName:"热力图",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于热力图的显示"})),p(Li,"defaults",{...Ot.defaults,is3D:!1,data:[],radius:10,gradient:{".5":"green",".7":"yellow",".95":"red"},blur:.85});let vl=Li;(r=>{r.createDefaultProps=()=>({...Ot.createDefaultProps(),is3D:d.react(void 0),data:d.reactPositions(void 0),gradient:d.reactJsonWithUndefined(void 0),radius:d.react(void 0),blur:d.react(void 0)})})(vl||(vl={})),d.extendClassProps(vl.prototype,vl.createDefaultProps);const ql=class ql extends wt{constructor(e){super(e);p(this,"editingBindMode","scatter")}get typeName(){return"ESGeoPoints"}get defaultProps(){return ql.createDefaultProps()}};p(ql,"type",ql.register("ESGeoPoints",ql,{chsName:"地理点集合",tags:["ESObjects","_ES_Impl_Cesium"],description:"地图中的可视化地理点集合"})),p(ql,"supportEditingModes",[...wt.supportEditingModes,vt.ScatterAppend,vt.ScatterModify]);let yl=ql;(r=>{r.createDefaultProps=()=>({...wt.createDefaultProps(),pointed:!0})})(yl||(yl={})),d.extendClassProps(yl.prototype,yl.createDefaultProps);function tv(r){return typeof r=="string"?document.getElementById(r):r}function Xd(r){if(!r)throw new Error("container is not defined");r.innerHTML="";const t=document.createElement("div");return t.style.cssText="width: 100%; height: 100%; margin: 0px; padding: 0px; border: none; overflow: hidden; position: relative; z-index: 0; background: rgba(0,0,0,0);",r.appendChild(t),t}class ev extends d.Destroyable{constructor(e,i){super();p(this,"_listeningSceneObjects",new Map);this._sceneObjectsMananger=e,this._createSceneObjectListeningFunc=i;const n=this._listeningSceneObjects,s=(a,o)=>{if(a)for(let l of a){const u=n.get(l);u&&(u.destroy(),n.delete(l))}if(o)for(let l of o){if(n.get(l)){console.warn(`listeningSceneObjects已存在某对象:${l.name}`,l);debugger}const c=this.createSceneObjectListeningFunc(l);c&&n.set(l,c)}};s(void 0,this._sceneObjectsMananger.sceneObjects),this.dispose(this._sceneObjectsMananger.sceneObjectsToChange.disposableOn(s)),this.dispose(()=>{for(let a of this._listeningSceneObjects.values())a.destroy();this._listeningSceneObjects.clear()})}get listeningSceneObjects(){return this._listeningSceneObjects}get createSceneObjectListeningFunc(){return this._createSceneObjectListeningFunc}}class EI extends d.Destroyable{constructor(t){super(),this._esObjectsManager=t;{const e=this._esObjectsManager;class i extends d.Destroyable{constructor(s){super(),this._esPath=s,this.dv(new d.ObjResettingWithEvent(e.activeViewerChanged,()=>{const a=e.activeViewer;if(!a)return;class o extends d.Destroyable{constructor(u){if(super(),this._esPath=u,!a)throw new Error("!viewer");const c=()=>{const h=e.activeViewer;h&&(this._esPath.path.currentTime=h.simulationTime)};c(),this.d(a.simulationTimeChanged.don(c))}}return new o(this._esPath)}))}}this.dv(new ev(e.sceneObjectsManager,n=>{if(n instanceof Ls)return new i(n)}))}{const e=this._esObjectsManager;class i extends d.Destroyable{constructor(s){super();const a=()=>{const o=e.activeViewer;o&&(o.simulationTime=s.currentTime??0)};a(),this.d(s.currentTimeChanged.don(a))}}this.dv(new ev(e.sceneObjectsManager,n=>{if(n instanceof As)return new i(n)}))}}}class SI extends d.Destroyable{constructor(t){super(),t.forEach(e=>{this.d(e.path.currentPositionChanged.don(i=>{i&&e.sceneObjects.forEach(n=>{Reflect.has(n,"position")&&(n.position=[...i])})})),this.d(e.path.currentRotationChanged.don(i=>{i&&e.sceneObjects.forEach(n=>{Reflect.has(n,"rotation")&&(n.rotation=[...i])})}))})}}class PI extends d.Destroyable{constructor(e){super();p(this,"_player");p(this,"_channels",this.dv(d.reactArray([])));this._objectManager=e,this._player=this._objectManager.player,this.dv(new d.ObjResettingWithEvent(this.channelsChanged,()=>{if(this.channels.length===0)return;const i=[];for(let n=0;n<this.channels.length;n++){const s=this.channels[n],a=ft.getSceneObjById(s.pathId);if(!a||!(a instanceof Ls))continue;const l=s.sceneObjectIds.map(u=>ft.getSceneObjById(u)).filter(u=>u!==void 0);l.length!==0&&i.push({path:a,sceneObjects:l})}if(i.length!==0)return new SI(i)}))}get player(){return this._player}get channels(){return this._channels.value}get channelsChanged(){return this._channels.changed}set channels(e){this._channels.value=e}}function ef(r){if(r.data){const{type:t,value:e}=r.data;if(t==="UITreeA"&&e instanceof Or){const{sceneObject:i}=e;if(i)return i.id}}}function CI(r,t){const{property:e,customEventName:i,otherParams:n}=t,{dragstartDataMananger:s}=r;if(!(e instanceof ln)){if(!(e instanceof up)){if(e instanceof nt){const[a,o]=d.getReactFuncs(e.reactVar);if(i==="ondragover"){if(console.log("ondragover"),!n)throw new Error("!otherParams");const l=n[0];if(l.preventDefault(),!l.dataTransfer)return;ef(s)?l.dataTransfer.dropEffect="move":l.dataTransfer.dropEffect="none"}else if(i==="ondrop"){if(!n)throw new Error("!otherParams");n[0].preventDefault();const u=ef(s);u!==void 0&&o(u)}}else if(e instanceof np){const[a,o]=d.getReactFuncs(e.reactVar);if(i==="ondragover"){if(console.log("ondragover"),!n)throw new Error("!otherParams");const l=n[0];if(l.preventDefault(),!l.dataTransfer)return;ef(s)?l.dataTransfer.dropEffect="move":l.dataTransfer.dropEffect="none"}else if(i==="ondrop"){if(!n)throw new Error("!otherParams");const l=n[0].$event,u=n[0].strinsPropDom,c=n[0].index;l.preventDefault();const h=ef(s);if(h!==void 0){u[c].firstChild.value=h;const f=new Event("input",{bubbles:!0,cancelable:!0});u[c].firstChild.dispatchEvent(f)}}}else if(e instanceof sp){const[a,o]=d.getReactFuncs(e.reactVar)}}}}function rv(r,t,e,i){if(e)i.currentActiveEditing=[r,t];else if(i.currentActiveEditing){const[n,s]=i.currentActiveEditing;n===r&&s===t&&(e||(i.currentActiveEditing=void 0))}}const II=["editing","positionEditing","locationEditing","pointEditing","rotationEditing"];class MI extends d.Destroyable{constructor(t,e){super(),this._sceneObject=t;const i=this._sceneObject;for(let n of II){const s=n+"Changed",a=i[s];if(a){{const o=i[n];rv(i,n,o,e)}this.dispose(a.disposableOn(o=>rv(i,n,o,e)))}}}get sceneObject(){return this._sceneObject}}class NI extends d.Destroyable{constructor(){super();p(this,"_currentActiveEditing",this.disposeVar(d.reactArrayWithUndefined(void 0)));p(this,"_currentActiveEditingLastChangedTime",0);this.dispose(this._currentActiveEditing.changed.disposableOn((e,i)=>{if(this._currentActiveEditingLastChangedTime=Date.now(),i){const[n,s]=i;n[s]===!0&&(n[s]=!1)}if(e){const[n,s]=e;n[s]=!0}})),ft.context.sceneObjCreatedEvent.don(e=>{e.dv(new MI(e,this))})}get currentActiveEditing(){return this._currentActiveEditing.value}set currentActiveEditing(e){this._currentActiveEditing.value=e}get currentActiveEditingChanged(){return this._currentActiveEditing.changed}get currentActiveEditingLastChangedTime(){return this._currentActiveEditingLastChangedTime}}class bI extends d.Destroyable{constructor(){super();p(this,"_sceneObjects",new Set);p(this,"_sceneObjectsToChange",this.dv(new d.Event));this.d(()=>{const e=d.length(this._sceneObjects);e!==0&&console.warn(`场景对象管理器销毁时仍然管理着${e}个场景对象!`)})}get sceneObjects(){return this._sceneObjects}get sceneObjectsToChange(){return this._sceneObjectsToChange}addSceneObject(e){if(this._sceneObjects.has(e))return console.warn(`创建失败:对象${e.typeName+":"+e.id}已经存在于场景对象管理器中!}`),!1;do this._sceneObjectsToChange.emit([],[e]),this._sceneObjects.add(e);while(!1);return!0}deleteSceneObject(e){if(!this._sceneObjects.has(e))return console.warn(`删除失败:对象${e.typeName+":"+e.id}不存在于场景对象管理器中!}`),!1;do this._sceneObjectsToChange.emit([e],[]),this._sceneObjects.delete(e);while(!1);return!0}createSceneObject(e,i){const n=ft.context.createSceneObject(e,i);return n&&this.addSceneObject(n),n}createSceneObjectFromClass(e,i){const n=ft.context.createSceneObjectFromClass(e,i);return n&&this.addSceneObject(n),n}createSceneObjectFromJson(e){const i=ft.context.createSceneObjectFromJson(e);return i&&this.addSceneObject(i),i}}function iv(r,t){return r.length===t.length&&r.every((e,i)=>e===t[i])}class TI extends d.Destroyable{constructor(t){super(),this._viewer=t,this.d(d.track([this._viewer,"currentTime"],[this._viewer,"simulationTime"]))}}class DI extends d.Destroyable{constructor(t,e){super(),this._viewer=t,this._activeViewer=e;const i=Dn.createCommonProps(),n=[];Object.keys(i).forEach(l=>{const u=this._activeViewer[l+"Changed"];n.push(u)});const s=this.dv(d.createNextAnimateFrameEvent(...n)),a=()=>{this._viewer.status!=="Created"||this._activeViewer.status!=="Created"||Object.keys(i).forEach(l=>{this._viewer[l]=this._activeViewer[l]})};this.d(s.don(a));const o=this.dv(d.createAnimateFrame());o.restart(void 0,async()=>{if(this._viewer.status!=="Created"||this._activeViewer.status!=="Created")return;const l=this._activeViewer.getCurrentCameraInfo(),u=this._viewer.getCurrentCameraInfo();if(!l)return;const{position:c,rotation:h}=l;u&&iv(c,u.position)&&iv(h,u.rotation)||this._viewer.flyIn(c,h,0)}),this.d(()=>o.cancel())}}const xI=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="40" height="40" style="shape-rendering: auto; display: block; background: rgba(255, 255, 255, 0);" xmlns:xlink="http://www.w3.org/1999/xlink"><g><circle stroke-linecap="round" fill="none" stroke-dasharray="50.26548245743669 50.26548245743669" stroke="#ffffff" stroke-width="8" r="32" cy="50" cx="50">
535
535
  <animateTransform values="0 50 50;360 50 50" keyTimes="0;1" dur="1s" repeatCount="indefinite" type="rotate" attributeName="transform"></animateTransform>
536
536
  </circle><g></g></g></svg>
537
- `,OI='<svg t="1747028305766" class="icon" viewBox="0 0 1032 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3881" width="40" height="40"><path d="M0.1536 547.700736c-0.205824-0.187392-0.205824-0.49152 0.008192-0.68608l80.672768-73.590784a0.63488 0.63488 0 0 1 0.7936-0.029696l263.043072 203.0336c0.667648 0.515072 1.738752 0.498688 2.393088-0.038912l609.191936-500.133888a0.605184 0.605184 0 0 1 0.768 0.022528l74.84928 67.229696a0.454656 0.454656 0 0 1-0.002048 0.685056l-685.234176 618.19904a1.14688 1.14688 0 0 1-1.518592-0.012288L0.1536 547.700736z" fill="#ffffff" p-id="3882"></path></svg>',AI='<svg t="1747028398107" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1146" width="40" height="40"><path d="M415.744006 1.033277A0.992256 0.992256 0 0 1 416.747526 0.000061h189.5045c0.569344 0 1.017856 0.45056 1.001472 1.033216l-21.227518 754.803667a1.062912 1.062912 0 0 1-1.05984 1.032192h-146.933752c-0.569344 0-1.04448-0.45056-1.059839-1.032192L415.744006 1.033277zM511.510528 1024c-52.595709 0-95.231994-39.866366-95.231994-89.043963 0-49.176573 42.636285-89.042939 95.231994-89.042938 52.594685 0 95.231994 39.866366 95.231994 89.042938 0 49.177597-42.637309 89.043963-95.231994 89.043963z" fill="#ffffff" p-id="1147"></path></svg>',Wl=class Wl extends d.Destroyable{constructor(t){super();const e=()=>{const i=this.dv(new Ea);this.d(d.track([i,"show"],[t,"useDefaultStatusDiv"]));{const n=()=>{i.show=(t.useDefaultStatusDiv??!0)&&t.status!=="Created"};n(),this.d(t.useDefaultStatusDivChanged.don(n)),this.d(t.statusChanged.don(n)),i.cssText="width:100%;height:100%;position:absolute;left:0px;top:0px;"}t.add(i),this.d(()=>t.delete(i)),i.instanceClass=class extends d.Destroyable{constructor(a,o,l){super();p(this,"_div",document.createElement("div"));if(this._subContainer=a,!l)return;this._subContainer.appendChild(this._div),this.d(()=>this._subContainer.removeChild(this._div));{const m=()=>{o.show?this._div.style.opacity="1":this._div.style.opacity="0"};m(),this.d(o.showChanged.don(m))}let u,c,h,f,g;this._div.style.pointerEvents="none",this._div.style.position="absolute",this._div.style.width="100%",this._div.style.height="100%",this._div.style.backgroundColor="rgba(0, 0, 0, 0.4)",this._div.style.zIndex="100",this._div.style.transition="opacity 2s",u=document.createElement("div"),this._div.appendChild(u),u.style.width="auto",u.style.position="absolute",u.style.left="50%",u.style.top="50%",u.style.transform="translate(-50%,-50%)",u.style.background="rgba(120, 120, 0, 0.7)",u.style.color="white",u.style.fontSize="10px",u.style.background="none",u.style.display="flex",u.style.justifyContent="center",u.style.alignItems="center",c=document.createElement("div"),u.appendChild(c),c.style.pointerEvents="none",c.style.display="block",c.style.width="40px",c.innerHTML=Wl.defaultsSvg.loadingSvg,c.style.filter="drop-shadow(0px 0px 1px black)",h=document.createElement("div"),u.appendChild(h),h.style.pointerEvents="none",h.style.marginLeft="10px",h.style.display="flex",h.style.flexFlow="column",h.style.maxWidth="300px",f=document.createElement("div"),h.appendChild(f),f.style.fontSize="14px",f.style.fontWeight="800",f.style.marginBottom="5px",f.style.textShadow="0 0 2px black",g=document.createElement("div"),h.appendChild(g),g.style.fontWeight="400",g.style.textShadow="0 0 2px black";{const m=()=>{let E="Raw";l.status==="Raw"?E="初始状态":l.status==="Creating"?E="正在创建":l.status==="Created"?E="创建完成":l.status==="Error"?E="创建失败":l.status==="Reconnecting"&&(E="重新连接"),f.innerText=`${E}(${l.status})`,g.innerText=`${l.statusLog}`,(l.status==="Creating"||l.status==="Reconnecting")&&(c.innerHTML=Wl.defaultsSvg.loadingSvg),l.status==="Created"&&(c.innerHTML=Wl.defaultsSvg.successSvg),l.status==="Error"&&(c.innerHTML=Wl.defaultsSvg.warnSvg)};m();const _=this.dv(d.createNextAnimateFrameEvent(l.statusLogChanged,l.statusChanged));this.d(_.don(m))}}update(){const a=255*Math.random()|0,o=255*Math.random()|0,l=255*Math.random()|0;this._div.style.background=`rgba(${a}, ${o}, ${l}, 0.8)`}}};this.d(t.containerChanged.don(()=>{e()}))}};p(Wl,"defaultsSvg",{loadingSvg:xI,successSvg:OI,warnSvg:AI});let Yd=Wl;class LI extends d.Destroyable{constructor(t,e,i){super(),this._subContainer=t,this._overlayContainer=e,this._viewer=i;const n=this._subContainer,s=this._overlayContainer,a=this._viewer,o=()=>{const c=a.zIndex??"";n.style.zIndex=c,s.style.zIndex=c};o(),this.d(a.zIndexChanged.don(o));const l=()=>{n.style.display=a.show??!0?"block":"none"};l(),this.d(a.showChanged.don(l));const u=()=>{n.style.opacity=`${a.opacity??1}`};u(),this.d(a.opacityChanged.don(u))}}function rf(r){let t=d.getExtProp(r,"_relativeContainer");return t||(t=document.createElement("div"),t.style.position="relative",t.style.width="100%",t.style.height="100%",t.style.padding="0",t.style.margin="0",r.appendChild(t),d.setExtProp(r,"_relativeContainer",t)),t}class RI extends d.Destroyable{constructor(e,i){super();p(this,"_subContainer",document.createElement("div"));p(this,"_overlayContainer",document.createElement("div"));p(this,"_containerStyleController");this._container=e,this._viewer=i,this._containerStyleController=this.dv(new LI(this._subContainer,this._overlayContainer,this._viewer));const{subContainer:n,overlayContainer:s}=this;n.tabIndex=-1,n.style.outline="none",n.style.width="100%",n.style.height="100%",n.onpointerdown=()=>n.focus(),s.style.position="relative",s.setAttribute("earthsdk3","earthsdk3-overlayContainer"),n.setAttribute("earthsdk3","earthsdk3-subContainer"),rf(this._container).appendChild(n),this.d(()=>rf(this._container).removeChild(n)),rf(this._container).appendChild(s),this.d(()=>rf(this._container).removeChild(s))}get subContainer(){return this._subContainer}get overlayContainer(){return this._overlayContainer}get containerStyleController(){return this._containerStyleController}get container(){return this._container}}class FI extends d.Destroyable{constructor(){super(...arguments);p(this,"registerObjsMap",new Map)}register(e,i){return this.registerObjsMap.has(e)&&console.warn(`register warn:${e}已经被注册,再次注册会覆盖。`),this.registerObjsMap.set(e,i),e}getViewerConstructor(e){const i=this.registerObjsMap.get(e);if(!i){console.warn(`未找到${e}类!`);return}return i}createViewer(e){const i=e.type;console.log(e);const n=this.getViewerConstructor(i);if(!n)throw new Error(`没有找到类型为${i}的Viewer构造器!`);return new n(e)}}class nv extends d.Destroyable{constructor(t,e,i=!1,n=!1){if(super(),this._viewer=t,!e)throw new Error("ViewerCustomInteraction: container is null");const s=this.dv(d.DomElementEvent.create(e,"pointerdown")),a=this.dv(d.DomElementEvent.create(e,"pointermove")),o=this.dv(d.DomElementEvent.create(e,"pointerup")),l=this.dv(d.DomElementEvent.create(e,"pointerout")),u=this.dv(d.DomElementEvent.create(e,"pointerover")),c=this.dv(new d.PointerClick),h=this.dv(new d.PointerHover),f=()=>{const v=this._viewer.hoverTime*1e3;h.delayTime=v};this.d(this._viewer.hoverTimeChanged.don(()=>{f()})),this.d(s.don(v=>c.pointerDown(v))),this.d(a.don(v=>c.pointerMove(v))),this.d(o.don(v=>c.pointerUp(v))),this.d(l.don(v=>c.pointerOut(v))),this.d(s.don(v=>h.pointerDown(v))),this.d(a.don(v=>h.pointerMove(v))),this.d(o.don(v=>h.pointerUp(v))),this.d(l.don(v=>h.pointerOut(v)));const{x:g,y:m}=e.getBoundingClientRect(),_=n?g:0,E=n?m:0;this.d(h.hoverEvent.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,i);this._viewer.hoverEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(c.clickEvent.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,i);this._viewer.clickEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(c.dbclickEvent.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,i);v.button===0&&this._viewer.dblclickEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(s.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,i);v.button===0&&this._viewer.pointerDownEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(o.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,i);v.button===0&&this._viewer.pointerUpEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(a.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,i);this._viewer.pointerMoveEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(u.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,i);this._viewer.pointerOverEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(l.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,i);this._viewer.pointerOutEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})}));const M=this.dv(d.DomElementEvent.create(e,"keydown"));this.d(M.don(v=>this._viewer.keyDownEvent.emit(v)));const y=this.dv(d.DomElementEvent.create(e,"keyup"));this.d(y.don(v=>this._viewer.keyUpEvent.emit(v)));const w=this.dv(d.DomElementEvent.create(e,"wheel"));this.d(w.don(v=>this._viewer.wheelEvent.emit(v)))}}class GI extends d.Destroyable{constructor(e){super();p(this,"viewer");const i=this.viewer=e;this.ad(new d.ObjResettingWithEvent(i.rollerShutterChanged,()=>{const n=i.container;if(!n||!i.rollerShutter)return;const s=new d.Destroyable;this.viewer.splitPosition=.5;let a=this.getRollerShutterDIV();return n.appendChild(a),s.d(()=>{this.viewer.splitPosition=0,n.removeChild(a)}),s}))}getRollerShutterDIV(){let e=document.createElement("div");e.style.position="absolute",e.style.left="50%",e.style.top="0",e.style.backgroundColor="#d3d3d3",e.style.width="5px",e.style.height="100%",e.style.zIndex="9999";const i=n=>{if(!e.parentElement)return;n.preventDefault?n.preventDefault():n.returnValue=!1;const a=n.x/e.parentElement.offsetWidth;e.style.left=`${100*a}%`,this.viewer.splitPosition=a};return e.addEventListener("mouseenter",n=>{e.style.cursor="ew-resize"}),e.addEventListener("mouseleave",n=>{e.style.cursor="default"}),e.addEventListener("mousedown",n=>{e.style.cursor="ew-resize",document.addEventListener("mousemove",i)}),document.addEventListener("mouseup",n=>{e.style.cursor="default",document.removeEventListener("mousemove",i)}),e}}class kI extends d.Destroyable{constructor(e){super();p(this,"rollerShutterAnalysis");this.rollerShutterAnalysis=this.ad(new GI(e))}}const fs=class fs extends d.Destroyable{constructor(e){super();p(this,"_forceRecreateEvent",this.dv(new d.Event));p(this,"_container",this.dv(d.react(void 0)));p(this,"_containerSize",this.dv(d.react(void 0)));p(this,"_editingEvent",this.disposeVar(new d.Event));p(this,"_status",this.dv(d.react("Raw")));p(this,"_statusLog",this.dv(d.react("")));p(this,"_statusContainer",this.dv(new Yd(this)));p(this,"_useCustomInteraction",this.dv(d.react(!0)));p(this,"_resetInteractionEvent",this.dv(d.createNextAnimateFrameEvent(this.containerChanged,this._useCustomInteraction.changed,this._forceRecreateEvent)));p(this,"_interactionResetting",this.dv(new d.ObjResettingWithEvent(this._resetInteractionEvent,()=>{if(!(!this.container||!this._useCustomInteraction.value))return new nv(this,this.container)})));p(this,"_viewerChanged",this.dv(new d.Event));p(this,"_containerResetEvent",this.dv(d.createNextAnimateFrameEvent(this.containerChanged,this._forceRecreateEvent)));p(this,"_containerResetting",this.dv(new d.ObjResettingWithEvent(this._containerResetEvent,()=>{if(this.container)return new RI(this.container,this)})));p(this,"_sceneObjectsMap",new Map);p(this,"_id");p(this,"_typeName");p(this,"_updateFuncReact",this.dv(d.react(void 0)));p(this,"_toDestroyFuncReact",this.dv(d.react(void 0)));p(this,"_statusInfo",fs.defaults.statusInfo);p(this,"_navigationMode",this.dv(d.react("Map")));p(this,"_syncViewer",this.dv(d.react(void 0)));p(this,"_syncEventDon",this.dv(new d.ObjResettingWithEvent(this.syncViewerChanged,()=>{const e=this.syncViewer;if(e)return new DI(this,e)})));p(this,"_timeSyncdon",this.dv(new d.ObjResettingWithEvent(this.timeSyncChanged,()=>{if(this.timeSync)return new TI(this)})));p(this,"_hoverEvent",this.dv(new d.Event));p(this,"_pointerOverEvent",this.dv(new d.Event));p(this,"_pointerMoveEvent",this.dv(new d.Event));p(this,"_pointerDownEvent",this.dv(new d.Event));p(this,"_pointerUpEvent",this.dv(new d.Event));p(this,"_pointerOutEvent",this.dv(new d.Event));p(this,"_clickEvent",this.dv(new d.Event));p(this,"_dblclickEvent",this.dv(new d.Event));p(this,"_keyDownEvent",this.dv(new d.Event));p(this,"_keyUpEvent",this.dv(new d.Event));p(this,"_wheelEvent",this.dv(new d.Event));p(this,"_actived",this.dv(d.react(!1)));this._id=e.id??d.createGuid();const i=tv(e.container);if(i)this._container.value=Xd(i),this._typeName=e.type,this._initName();else throw new Error("container is not defined");{const n=()=>{i&&(this.show??!0?i.style.display="block":i.style.display="none")};n(),this.d(this.showChanged.don(n))}{const n=this._sceneObjectsMap,s=()=>{for(let[o,l]of n.entries())if(!l&&o){const u=Aa.context.createEngineObject(o,this);u&&n.set(o,u)}},a=()=>{for(let[o,l]of n.entries())l&&!l.isDestroyed()&&l.destroy(),n.set(o,void 0)};this.d(a),this.d(this.viewerChanged.don(o=>{a(),o&&s()}))}{const n=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(s){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};n(),this.d(this.execOnceFuncStrChanged.don(n))}{const n=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(a){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${a}`)}};n(),this.d(this.updateFuncStrChanged.don(n));let s;this.d(()=>s&&s.destroy()),this.d(this.updateFuncChanged.don(()=>{s&&s.cancel(),this.updateFunc&&(s=s||d.createAnimateFrame(),s.restart(void 0,a=>{this.updateFunc&&this.updateFunc(this,a)}))}))}{const n=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(s){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`),this.toDestroyFunc=void 0}};n(),this.d(this.toDestroyFuncStrChanged.don(n)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}this.ad(new kI(this))}forceRecreate(){this._forceRecreateEvent.emit()}get container(){return this._container.value}set container(e){this._container.value=e}set containerOrId(e){if(typeof e=="string"){const i=document.getElementById(e);i&&i instanceof HTMLDivElement?this._container.value=Xd(i):console.warn("containerOrId warn: !(container instanceof HTMLDivElement)")}else e instanceof HTMLDivElement?this._container.value=Xd(e):console.warn("containerOrId warn: setting container failed!")}get containerChanged(){return this._container.changed}get containerSize(){return this._containerSize.value}set containerSize(e){this._containerSize.value=e}get containerSizeChanged(){return this._containerSize.changed}get editingEvent(){return this._editingEvent}get status(){return this._status.value}get statusChanged(){return this._status.changed}setStatus(e){this._status.value=e}get statusLog(){return this._statusLog.value}get statusLogChanged(){return this._statusLog.changed}setStatusLog(e){this._statusLog.value=e}get useCustomInteraction(){return this._useCustomInteraction.value}set useCustomInteraction(e){this._useCustomInteraction.value=e}get viewerChanged(){return this._viewerChanged}get containerResetEvent(){return this._containerResetEvent}get subContainer(){var e;return(e=this._containerResetting.obj)==null?void 0:e.subContainer}get subContainerChanged(){return this._containerResetting.objChanged}get overlayContainer(){var e;return(e=this._containerResetting.obj)==null?void 0:e.overlayContainer}get overlayContainerChanged(){return this._containerResetting.objChanged}get sceneObjectsMap(){return this._sceneObjectsMap}get sceneObjects(){return this._sceneObjectsMap.keys()}getEngineObject(e){return this.sceneObjectsMap.get(e)}add(...e){for(let i of e)if(!this.has(i)){ft.context.addSceneObject(i);const n=Aa.context.createEngineObject(i,this);n&&this._sceneObjectsMap.set(i,n),i.viewerAttached.emit(this)}}delete(...e){for(let i of e)if(this.has(i)){const n=this._sceneObjectsMap.get(i);n&&n.destroy(),ft.context.deleteSceneObject(i),this._sceneObjectsMap.delete(i),i.viewerDetached.emit(this)}}disposableAdd(...e){return this.add(...e),()=>this.delete(...e)}disAdd(...e){return this.disposableAdd(...e)}has(e){return this._sceneObjectsMap.has(e)}clearAllSceneObjects(){for(let e of this.sceneObjects)this.delete(e)}get id(){return this._id}set id(e){console.warn("ESViewer id is readonly")}get typeName(){return this._typeName}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return fs.createDefaultProps()}_getJson(e=!0){const i={id:this.id,type:this.typeName};for(let n of Object.keys(this.defaultProps))if(e){let s,a=this.defaultProps[n];a instanceof d.ReactiveVariable?s=a.equals(this[n]):s=a===this[n],s||(i[n]=this[n])}else i[n]=this[n];return i}_setJson(e,i,n){if(!(e instanceof Object)||e.type&&e.type!==this.typeName){console.error(`value.type && value.type${e.type} !== this.typeName${this.typeName}`);return}e.id&&e.id!==this.id&&console.warn(`value.id === undefined || value.id${e.id} !== this.id(${this.id})`);const s=i||[];s.push("id","type");const a=Object.keys(this.defaultProps).filter(o=>!s.includes(o));for(let o of a)if(o in e)this[o]=e[o]===null?void 0:e[o];else if(!(n??!1)){let l=this.defaultProps[o];l instanceof d.ReactiveVariable&&(l=l.value),this[o]=l}}get json(){return this._getJson()}set json(e){this._setJson(e,["devTags"])}get updateFunc(){return this._updateFuncReact.value}set updateFunc(e){this._updateFuncReact.value=e}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(e){this._toDestroyFuncReact.value=e}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get navigationMode(){return this._navigationMode.value}get navigationModeChanged(){return this._navigationMode.changed}getNavigationMode(){return this._navigationMode.value}getEngineType(){return this._typeName}get syncViewer(){return this._syncViewer.value}set syncViewer(e){this._syncViewer.value=e}get syncViewerChanged(){return this._syncViewer.changed}syncOtherViewer(e){e&&e.syncViewer&&(e.syncViewer=void 0),e===this?this._syncViewer.value=void 0:this._syncViewer.value=e}setCurrentTime(e){try{this.currentTime=typeof e=="string"?Date.parse(e):e}catch(i){console.warn(`时间格式不正确! value: ${e} error: ${i}`)}}async getVersion(){return window.g_XE3CopyRights??{}}get hoverEvent(){return this._hoverEvent}get pointerOverEvent(){return this._pointerOverEvent}get pointerMoveEvent(){return this._pointerMoveEvent}get pointerDownEvent(){return this._pointerDownEvent}get pointerUpEvent(){return this._pointerUpEvent}get pointerOutEvent(){return this._pointerOutEvent}get clickEvent(){return this._clickEvent}get dblclickEvent(){return this._dblclickEvent}get keyDownEvent(){return this._keyDownEvent}get keyUpEvent(){return this._keyUpEvent}get wheelEvent(){return this._wheelEvent}getProperties(e){return[new H("ESViewer","ESViewer",[new mt("强制刷新","重载",[],()=>this.forceRecreate(),[]),new U("debug","debug",!0,!1,[this,"debug"],fs.defaults.debug),new U("是否可见","是否可见",!0,!1,[this,"show"]),new tt("位置点单位","lonLatFormat",!0,!1,[this,"lonLatFormat"],[["度","DECIMAL_DEGREE"],["度分","DEGREES_DECIMAL_MINUTES"],["度分秒","SEXAGESIMAL_DEGREE"]]),new U("是否开启文字避让","textAvoidance",!0,!1,[this,"textAvoidance"],!1),new nt("ionAccessToken","ionAccessToken",!1,!1,[this,"ionAccessToken"]),new C("时钟","时钟",!1,!1,[this,"currentTime"]),new U("globeShow","globeShow",!0,!1,[this,"globeShow"]),new U("atmosphere","atmosphere",!1,!1,[this,"atmosphere"])]),new C("飞行像素范围","默认飞行定位时对象包围球所占的屏幕像素大小",!1,!1,[this,"flyToBoundingSize"]),new C("编辑高度偏移","编辑时默认的高度偏移",!1,!1,[this,"editingHeightOffset"]),new H("Globe","Globe",[new Y("地形着色器","可以设置地形全局坡度,坡向,高程带,等高线等",!1,!1,[this,"terrainShader"])])]}get actived(){return this._actived.value}set actived(e){this._actived.value=e}get activedChanged(){return this._actived.changed}};p(fs,"context",new FI),p(fs,"register",fs.context.register.bind(fs.context)),p(fs,"defaults",{show:!0,debug:!1,statusInfo:{fps:0,position:[0,0,0],rotation:[0,0,0],length:0},terrainShader:{slope:{show:!1},aspect:{show:!1},elevationRamp:{show:!1,minHeight:-414,maxHeight:8777,color:[]},elevationContour:{show:!1,color:[1,0,0,1],spacing:150,width:2}},globeShow:!0,splitPosition:0});let Dn=fs;(r=>{r.createBaseProps=()=>({name:"未命名场景对象",extras:d.reactJson(void 0),devTags:d.reactArrayWithUndefined(void 0),debug:void 0,show:void 0,opacity:void 0,zIndex:void 0,useDefaultStatusDiv:!0,execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0}),r.createCommonProps=()=>({globeShow:!0,ionAccessToken:"",lonLatFormat:"DECIMAL_DEGREE",fov:60,textAvoidance:!1,flyToBoundingSize:256,hoverTime:2,currentTime:Date.now(),simulationTime:Date.now(),timeSync:!1,rain:0,snow:0,cloud:0,fog:0,depthOfField:0,atmosphere:!0,editingPointSize:void 0,editingPointColor:d.reactArrayWithUndefined(void 0),editingAuxiliaryPointColor:d.reactArrayWithUndefined(void 0),editingLineWidth:void 0,editingLineColor:d.reactArrayWithUndefined(void 0),editingAxisSize:void 0,editingAuxiliaryPointSize:void 0,editingHeightOffset:0,editingLineShow:!0,editingEventListening:!0,terrainShader:r.defaults.terrainShader,splitPosition:d.react(void 0),rollerShutter:!1}),r.createDefaultProps=()=>({...(0,r.createBaseProps)(),...(0,r.createCommonProps)()})})(Dn||(Dn={})),d.extendClassProps(Dn.prototype,Dn.createDefaultProps);function sv(r,t){const e=r._lastCameraInfo;if(e){const i=t.viewerChanged.don(n=>{if(!n||!e)return;const{position:s,rotation:a}=e;t.flyIn(s,a,0),r._lastCameraInfo=void 0,i()})}}const zI=r=>{const t=Dn.createCommonProps(),e={};try{Object.keys(t).forEach(i=>{e[i]=r[i]})}catch(i){console.warn(i)}return e},av=(r,t)=>{const e=Dn.createCommonProps();try{Object.keys(e).forEach(i=>{r[i]=t[i]})}catch(i){console.warn(i)}};class VI extends d.Destroyable{constructor(e){super();p(this,"_viewersChanged",this.disposeVar(new d.Event));p(this,"_viewers",new Set);p(this,"_viewersToChange",this.dv(new d.Event));this._sceneObjectsManager=e,this.d(()=>{for(const i of this._viewers)this.destroyViewer(i);this._viewers.clear()}),this.viewers.forEach(i=>{const n=this._sceneObjectsManager.sceneObjects;i.add(...n)}),this.d(()=>{const i=this._sceneObjectsManager.sceneObjects;this.viewers.forEach(n=>{n.delete(...i)})}),this.d(this._sceneObjectsManager.sceneObjectsToChange.don((i,n)=>{this.viewers.forEach(s=>{n.forEach(a=>{Ds(s.devTags,a.devTags)&&(s.has(a)?console.warn(`${s.typeName}中已存${a.typeName},检查逻辑是否有问题!`):s.add(a))}),i.forEach(a=>{Ds(s.devTags,a.devTags)&&(s.has(a)?s.delete(a):console.warn(`${s.typeName}中不存在${a.typeName},检查逻辑是否有问题!`))})}),n.length>0&&n.forEach(s=>{s.d(s.devTagsChanged.don(()=>{this.viewers.forEach(a=>{a.has(s)&&a.delete(s),console.log("sceneObjectsToChange",a.devTags,s.devTags,Ds(a.devTags,s.devTags)),Ds(a.devTags,s.devTags)&&(a.has(s)?console.warn(`${a.typeName}中已存${s.typeName},检查逻辑是否有问题!`):a.add(s))})}))})})),this.d(this.viewersChanged.don((i,n)=>{const s=this._sceneObjectsManager.sceneObjects;n.forEach(a=>{for(let o of s)Ds(a.devTags,o.devTags)&&(a.has(o)?console.warn(`${a.typeName}中已存${o.typeName},检查逻辑是否有问题!`):a.add(o))}),i.forEach(a=>{for(let o of s)Ds(a.devTags,o.devTags)&&(a.has(o)?a.delete(o):console.warn(`${a.typeName}中不存在${o.typeName},检查逻辑是否有问题!`))}),n.length>0&&n.forEach(a=>{a.d(a.devTagsChanged.don(()=>{a.clearAllSceneObjects();const o=this._sceneObjectsManager.sceneObjects;for(let l of o)console.log("viewersChanged",a.devTags,l.devTags,Ds(a.devTags,l.devTags)),Ds(a.devTags,l.devTags)&&(a.has(l)?console.warn(`${a.typeName}中已存${l.typeName},检查逻辑是否有问题!`):a.add(l))}))})}))}get viewersChanged(){return this._viewersChanged}get viewers(){return this._viewers}getViewers(){return[...this._viewers]}get viewersToChange(){return this._viewersToChange}createViewer(e){const i=Dn.context.createViewer(e);return this._viewers.add(i),this._viewersChanged.emit([],[i]),i}destroyViewer(e){return e.isDestroyed()?!0:(this._viewers.delete(e),this._viewersChanged.emit([e],[]),e.destroy(),e.isDestroyed())}}class Pa extends d.Destroyable{constructor(...e){super();p(this,"_drgm",this.dv(new v0));p(this,"_sobjm",this.dv(new bI));p(this,"_vrm",this.dv(new VI(this._sobjm)));p(this,"_sceneObjectEditingManager",this.disposeVar(new NI));p(this,"_activeViewer",this.dv(d.react(void 0)));p(this,"_syncOtherViewersToActived",this.dv(d.react(!1)));p(this,"_cmrvm",this.createSceneObjectFromClass(_a));p(this,"_cmrvmdon",this.d(()=>this._cmrvm&&this.destroySceneObject(this._cmrvm)));p(this,"_asset",{type:"ESObjectsManager",version:"0.1.0",createdTime:"",modifiedTime:"",name:"未命名项目"});p(this,"_sceneTree",this.dv(new Gh("default",this.dragstartDataMananger,24,this)));p(this,"_propUiTreeManager",this.dv(new Au(24)));p(this,"_sceneTreeMap",new Map);p(this,"_viewerCreatedEvent",this.dv(new d.Event));p(this,"_lastCameraInfo");p(this,"_lastActiveViewerJson");p(this,"syncEvent",this.dv(d.createNextAnimateFrameEvent(this.activeViewerChanged,this.syncOtherViewersToActivedChanged)));p(this,"_syncEventDon",this.d(this.syncEvent.don(()=>{const e=this.syncOtherViewersToActived;this.viewers.forEach(i=>{e?i.syncOtherViewer(this.activeViewer):i.syncOtherViewer(void 0)})})));p(this,"_player",this.createSceneObjectFromClass(As));p(this,"_playerdon",this.d(()=>this._player&&this.destroySceneObject(this._player)));p(this,"_esPlyarAndPathTime",this.dv(new EI(this)));p(this,"_pathAnimationManager",this.dv(new PI(this)))}static get envs(){return ft.context.environmentVariables}getSceneObjectById(e){return ft.getSceneObjectById(e)}getSceneObject(e){return ft.getSceneObject(e)}get $refs(){return ft.$refs}get dragstartDataMananger(){return this._drgm}get sceneObjectsManager(){return this._sobjm}get viewers(){return this._vrm.viewers}getViewers(){return this._vrm.getViewers()}get sceneObjectEditingManager(){return this._sceneObjectEditingManager}get activeViewer(){return this._activeViewer.value}set activeViewer(e){this._activeViewer.value=e}get activeViewerChanged(){return this._activeViewer.changed}get syncOtherViewersToActived(){return this._syncOtherViewersToActived.value}set syncOtherViewersToActived(e){this._syncOtherViewersToActived.value=e}get syncOtherViewersToActivedChanged(){return this._syncOtherViewersToActived.changed}get cameraViewsManager(){return this._cmrvm}get json(){var h;const e=this._asset.createdTime||new Date().toISOString(),i=new Date().toISOString(),n=this._asset.name||"未命名项目",a={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:e,modifiedTime:i,name:n},o=this.sceneTree.json,l=this._cmrvm.views,u=[...this._vrm.viewers].map(f=>f.json),c=(h=this.activeViewer)==null?void 0:h.getCurrentCameraInfo();return{asset:a,viewers:u,sceneTree:o,viewCollection:l,lastView:c}}set json(e){try{if(!e.asset)return;if(!e.asset.type||e.asset.type!=="ESObjectsManager"){console.warn("json装配失败! asset.type 不存在或者不是'ESObjectsManager'");return}if(this._asset.createdTime=e.asset&&e.asset.createdTime||new Date().toISOString(),this._asset.modifiedTime=e.asset&&e.asset.modifiedTime||"",this._asset.name=e.asset&&e.asset.name||"未命名项目",this._asset.version=e.asset&&e.asset.version||"0.1.0",e.sceneTree&&(this.sceneTree.json=e.sceneTree),e.viewCollection&&(this._cmrvm.views=e.viewCollection),!e.viewers||!Array.isArray(e.viewers)){console.warn("viewers is not an array or does not exist !");return}if(this._vrm.viewers.size===0||e.viewers.length===0){console.warn("viewers is empty !");return}this._vrm.viewers.forEach(i=>{const n=e.viewers.find(s=>s.id===i.id);n&&(i.json=n)})}catch(i){console.error(`ESObjectsManager解析json数据时发生错误! error: ${i}`)}}get sceneTree(){return this._sceneTree}get jsonLoadingEvent(){return this._sceneTree.jsonLoadingEvent}get propUiTreeManager(){return this._propUiTreeManager}propTreeCallback(e){return CI(this,e)}getSceneTrees(){return[...this._sceneTreeMap.values()]}getSceneTree(e="default"){if(e==="default")return this._sceneTree;if(!this._sceneTreeMap.has(e)){console.warn(`id为${e}的SceneTree不存在!`);return}return this._sceneTreeMap.get(e)}createSceneTree(e,i=24){if(this._sceneTreeMap.has(e)||e==="default")console.warn(`id为${e}的SceneTree已存在!`);else{const n=this.dv(new Gh(e,this.dragstartDataMananger,i,this));this._sceneTreeMap.set(e,n)}return this.getSceneTree(e)}get viewerCreatedEvent(){return this._viewerCreatedEvent}createViewer(e){const i=this._vrm.createViewer(e);this.activeViewer||(this.activeViewer=i);const n=this.d(i.viewerChanged.don(s=>{s&&(this._viewerCreatedEvent.emit(i),n())}));return i}destroyViewer(e){return this._activeViewer.value===e&&(this._activeViewer.value=void 0),this._vrm.destroyViewer(e)}switchViewer(e,i=!0,n=!0,s=!0){var u;this.activeViewer&&this.activeViewer.getNavigationMode()!=="Map"&&this.activeViewer.changeToMap(),!this._lastCameraInfo&&i&&(this._lastCameraInfo=(u=this.activeViewer)==null?void 0:u.getCurrentCameraInfo()),!this._lastActiveViewerJson&&n&&(this._lastActiveViewerJson=this.activeViewer?zI(this.activeViewer):void 0),s&&this.activeViewer&&this.destroyViewer(this.activeViewer);const a=e.id,o=a?[...this.getViewers()].find(c=>c.id===a):[...this.getViewers()].find(c=>c.typeName===e.type);if(o)if(a&&o.typeName!==e.type)console.warn(`id为${a}的viewer的typeName和option.type${e.type}不相同!,虽然id一致但是typeName不同,所以会销毁并创建新的viewer`),this.destroyViewer(o);else return console.log("ESViewer exists, will be used"),i&&sv(this,o),n&&this._lastActiveViewerJson&&(av(o,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),o.container===tv(e.container)?(o.containerOrId=e.container,o.forceRecreate()):o.containerOrId=e.container,this.activeViewer=o,o;console.log("No ESViewer exists, will be created");const l=this.createViewer(e);return console.log(e),console.log(this),i&&sv(this,l),n&&this._lastActiveViewerJson&&(av(l,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),this.activeViewer=l,l}switchToCesiumViewer(...e){if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)){const{container:i,viewSync:n,attributeSync:s,destroy:a,id:o}=e[0];return this.switchViewer({type:"ESCesiumViewer",container:i,id:o},n??!0,s??!0,a??!0)}else if(typeof e[0]=="string"||e[0]instanceof HTMLDivElement){const i={container:e[0],viewSync:e[1]??!0,attributeSync:e[2]??!0,destroy:e[3]??!0,id:e[4]},{container:n,viewSync:s,attributeSync:a,destroy:o,id:l}=i;return this.switchViewer({type:"ESCesiumViewer",container:n,id:l},s,a,o)}}switchToUEViewer(...e){let i,n={viewSync:!0,attributeSync:!0,destroy:!0};if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("uri")){const{container:l,uri:u,app:c,token:h,viewSync:f,attributeSync:g,destroy:m,id:_}=e[0];i={type:"ESUeViewer",container:l,id:_,options:{uri:u,app:c,token:h}},n={viewSync:f??!0,attributeSync:g??!0,destroy:m??!0}}else if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("ws")){const{container:l,ws:u,esmsg:c,viewSync:h,attributeSync:f,id:g,destroy:m}=e[0];i={type:"ESUeViewer",container:l,id:g,options:{ws:u,esmsg:c}},n={viewSync:h??!0,attributeSync:f??!0,destroy:m??!0}}else if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("project")){const{container:l,project:u,baseUrl:c,viewSync:h,attributeSync:f,id:g,destroy:m}=e[0];i={type:"ESUeViewer",container:l,id:g,options:{project:u,baseUrl:c}},n={viewSync:h??!0,attributeSync:f??!0,destroy:m??!0}}else(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(typeof e[1]=="string"&&e[1].startsWith("ws")?(i={type:"ESUeViewer",container:e[0],id:e[6],options:{ws:e[1],esmsg:e[2]??void 0}},n={viewSync:e[3]??!0,attributeSync:e[4]??!0,destroy:e[5]??!0}):typeof e[1]=="string"&&e[1].startsWith("http")?(i={type:"ESUeViewer",container:e[0],id:e[7],options:{uri:e[1],app:e[2],token:e[3]??void 0}},n={viewSync:e[4]??!0,attributeSync:e[5]??!0,destroy:e[6]??!0}):(i={type:"ESUeViewer",container:e[0],id:e[6],options:{project:e[1],baseUrl:e[2]??void 0}},n={viewSync:e[3]??!0,attributeSync:e[4]??!0,destroy:e[5]??!0}));if(!i)throw new Error("参数错误");const{viewSync:s,attributeSync:a,destroy:o}=n;return this.switchViewer(i,s,a,o)}createCesiumViewer(...e){let i;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?i={...e[0],type:"ESCesiumViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(i={container:e[0],options:e[1]??void 0,id:e[2]??void 0,type:"ESCesiumViewer"}),!i)throw new Error("参数错误");return this.createViewer(i)}createOpenLayersViewer(...e){let i;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?i={...e[0],type:"ESOlViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(i={container:e[0],options:e[1]??void 0,id:e[2]??void 0,type:"ESOlViewer"}),!i)throw new Error("参数错误");return this.createViewer(i)}createUeViewer(...e){let i;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?i={...e[0],type:"ESUeViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(typeof e[1]=="string"&&e[1].startsWith("ws")?i={type:"ESUeViewer",container:e[0],id:e[3]??void 0,options:{ws:e[1],esmsg:e[2]??void 0}}:typeof e[1]=="string"&&e[1].startsWith("http")?i={type:"ESUeViewer",container:e[0],id:e[4]??void 0,options:{uri:e[1],app:e[2],token:e[3]??void 0}}:i={type:"ESUeViewer",container:e[0],id:e[3]??void 0,options:{project:e[1],baseUrl:e[2]??void 0}}),!i)throw new Error("参数错误");return this.createViewer(i)}createSceneObject(e,i){return this._sobjm.createSceneObject(e,i)}createSceneObjectFromClass(e,i){return this._sobjm.createSceneObjectFromClass(e,i)}createSceneObjectFromJson(e){return this._sobjm.createSceneObjectFromJson(e)}destroySceneObject(e){const i=this._sobjm.deleteSceneObject(e);return e.destroy(),i}destroyAllSceneObjects(){const e=[...this._sobjm.sceneObjects];for(let i of e)i!=this._player&&i!=this._cmrvm&&this.destroySceneObject(i)}get player(){return this._player}get esPlyarAndPathTime(){return this._esPlyarAndPathTime}get pathAnimationManager(){return this._pathAnimationManager}}p(Pa,"getSceneObjById",ft.context.getSceneObjectById.bind(ft.context)),p(Pa,"getEnv",ft.context.getEnv.bind(ft.context)),p(Pa,"setEnv",ft.context.setEnv.bind(ft.context)),(r=>{r.createDefaultProps=()=>({})})(Pa||(Pa={})),d.extendClassProps(Pa.prototype,Pa.createDefaultProps);function UI(){const r=navigator.userAgent;let t="Unknown";/Windows/.test(r)?t="Windows":/Macintosh/.test(r)?t="MacOS":/Linux/.test(r)?t="Linux":/Android/.test(r)?t="Android":/iOS|iPhone|iPad|iPod/.test(r)&&(t="iOS");let e="Unknown";return/x64|x86_64|Win64|WOW64/.test(r)?e="x64":/x86|i686|Win32/.test(r)?e="x86":/arm64|aarch64/.test(r)?e="arm64":/arm/.test(r)&&(e="arm"),{os:t.toLocaleLowerCase(),arch:e.toLocaleLowerCase()}}const qI=Date.now();function ov(r){const{os:t,arch:e}=UI(),i={version:r.version,commitdate:r.date,commitId:r.commitId,runningTime:(Date.now()-qI)/1e3/60|0,date:new Date().toLocaleString(),href:window.location.href,os:t,arch:e},s={method:"GET",headers:new Headers,redirect:"follow"},a=window.encodeURIComponent(JSON.stringify(i));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${a}`,s).then(o=>o.text()).then(o=>console.log(o)).catch(o=>console.log("error",o))}N.copyright=void 0;try{const r="earthsdk3",t="3.4.0-beta.5",e="2025-08-13T02:44:57.000Z",i="北京西部世界科技有限公司",n="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="1db9138c470e4d98418a0699adcb1700a2168ceb",o=((Date.now()-1755053097e3)/36e5).toFixed(1),l=`%c🌏 ${r}%c ${t}.${s.slice(0,8)}.${e} (距今${o}个小时)
537
+ `,OI='<svg t="1747028305766" class="icon" viewBox="0 0 1032 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3881" width="40" height="40"><path d="M0.1536 547.700736c-0.205824-0.187392-0.205824-0.49152 0.008192-0.68608l80.672768-73.590784a0.63488 0.63488 0 0 1 0.7936-0.029696l263.043072 203.0336c0.667648 0.515072 1.738752 0.498688 2.393088-0.038912l609.191936-500.133888a0.605184 0.605184 0 0 1 0.768 0.022528l74.84928 67.229696a0.454656 0.454656 0 0 1-0.002048 0.685056l-685.234176 618.19904a1.14688 1.14688 0 0 1-1.518592-0.012288L0.1536 547.700736z" fill="#ffffff" p-id="3882"></path></svg>',AI='<svg t="1747028398107" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1146" width="40" height="40"><path d="M415.744006 1.033277A0.992256 0.992256 0 0 1 416.747526 0.000061h189.5045c0.569344 0 1.017856 0.45056 1.001472 1.033216l-21.227518 754.803667a1.062912 1.062912 0 0 1-1.05984 1.032192h-146.933752c-0.569344 0-1.04448-0.45056-1.059839-1.032192L415.744006 1.033277zM511.510528 1024c-52.595709 0-95.231994-39.866366-95.231994-89.043963 0-49.176573 42.636285-89.042939 95.231994-89.042938 52.594685 0 95.231994 39.866366 95.231994 89.042938 0 49.177597-42.637309 89.043963-95.231994 89.043963z" fill="#ffffff" p-id="1147"></path></svg>',Wl=class Wl extends d.Destroyable{constructor(t){super();const e=()=>{const i=this.dv(new Ea);this.d(d.track([i,"show"],[t,"useDefaultStatusDiv"]));{const n=()=>{i.show=(t.useDefaultStatusDiv??!0)&&t.status!=="Created"};n(),this.d(t.useDefaultStatusDivChanged.don(n)),this.d(t.statusChanged.don(n)),i.cssText="width:100%;height:100%;position:absolute;left:0px;top:0px;"}t.add(i),this.d(()=>t.delete(i)),i.instanceClass=class extends d.Destroyable{constructor(a,o,l){super();p(this,"_div",document.createElement("div"));if(this._subContainer=a,!l)return;this._subContainer.appendChild(this._div),this.d(()=>this._subContainer.removeChild(this._div));{const m=()=>{o.show?this._div.style.opacity="1":this._div.style.opacity="0"};m(),this.d(o.showChanged.don(m))}let u,c,h,f,g;this._div.style.pointerEvents="none",this._div.style.position="absolute",this._div.style.width="100%",this._div.style.height="100%",this._div.style.backgroundColor="rgba(0, 0, 0, 0.4)",this._div.style.zIndex="100",this._div.style.transition="opacity 2s",u=document.createElement("div"),this._div.appendChild(u),u.style.width="auto",u.style.position="absolute",u.style.left="50%",u.style.top="50%",u.style.transform="translate(-50%,-50%)",u.style.background="rgba(120, 120, 0, 0.7)",u.style.color="white",u.style.fontSize="10px",u.style.background="none",u.style.display="flex",u.style.justifyContent="center",u.style.alignItems="center",c=document.createElement("div"),u.appendChild(c),c.style.pointerEvents="none",c.style.display="block",c.style.width="40px",c.innerHTML=Wl.defaultsSvg.loadingSvg,c.style.filter="drop-shadow(0px 0px 1px black)",h=document.createElement("div"),u.appendChild(h),h.style.pointerEvents="none",h.style.marginLeft="10px",h.style.display="flex",h.style.flexFlow="column",h.style.maxWidth="300px",f=document.createElement("div"),h.appendChild(f),f.style.fontSize="14px",f.style.fontWeight="800",f.style.marginBottom="5px",f.style.textShadow="0 0 2px black",g=document.createElement("div"),h.appendChild(g),g.style.fontWeight="400",g.style.textShadow="0 0 2px black";{const m=()=>{let E="Raw";l.status==="Raw"?E="初始状态":l.status==="Creating"?E="正在创建":l.status==="Created"?E="创建完成":l.status==="Error"?E="创建失败":l.status==="Reconnecting"&&(E="重新连接"),f.innerText=`${E}(${l.status})`,g.innerText=`${l.statusLog}`,(l.status==="Creating"||l.status==="Reconnecting")&&(c.innerHTML=Wl.defaultsSvg.loadingSvg),l.status==="Created"&&(c.innerHTML=Wl.defaultsSvg.successSvg),l.status==="Error"&&(c.innerHTML=Wl.defaultsSvg.warnSvg)};m();const _=this.dv(d.createNextAnimateFrameEvent(l.statusLogChanged,l.statusChanged));this.d(_.don(m))}}update(){const a=255*Math.random()|0,o=255*Math.random()|0,l=255*Math.random()|0;this._div.style.background=`rgba(${a}, ${o}, ${l}, 0.8)`}}};this.d(t.containerChanged.don(()=>{e()}))}};p(Wl,"defaultsSvg",{loadingSvg:xI,successSvg:OI,warnSvg:AI});let Yd=Wl;class LI extends d.Destroyable{constructor(t,e,i){super(),this._subContainer=t,this._overlayContainer=e,this._viewer=i;const n=this._subContainer,s=this._overlayContainer,a=this._viewer,o=()=>{const c=a.zIndex??"";n.style.zIndex=c,s.style.zIndex=c};o(),this.d(a.zIndexChanged.don(o));const l=()=>{n.style.display=a.show??!0?"block":"none"};l(),this.d(a.showChanged.don(l));const u=()=>{n.style.opacity=`${a.opacity??1}`};u(),this.d(a.opacityChanged.don(u))}}function rf(r){let t=d.getExtProp(r,"_relativeContainer");return t||(t=document.createElement("div"),t.style.position="relative",t.style.width="100%",t.style.height="100%",t.style.padding="0",t.style.margin="0",r.appendChild(t),d.setExtProp(r,"_relativeContainer",t)),t}class RI extends d.Destroyable{constructor(e,i){super();p(this,"_subContainer",document.createElement("div"));p(this,"_overlayContainer",document.createElement("div"));p(this,"_containerStyleController");this._container=e,this._viewer=i,this._containerStyleController=this.dv(new LI(this._subContainer,this._overlayContainer,this._viewer));const{subContainer:n,overlayContainer:s}=this;n.tabIndex=-1,n.style.outline="none",n.style.width="100%",n.style.height="100%",n.onpointerdown=()=>n.focus(),s.style.position="relative",s.setAttribute("earthsdk3","earthsdk3-overlayContainer"),n.setAttribute("earthsdk3","earthsdk3-subContainer"),rf(this._container).appendChild(n),this.d(()=>rf(this._container).removeChild(n)),rf(this._container).appendChild(s),this.d(()=>rf(this._container).removeChild(s))}get subContainer(){return this._subContainer}get overlayContainer(){return this._overlayContainer}get containerStyleController(){return this._containerStyleController}get container(){return this._container}}class FI extends d.Destroyable{constructor(){super(...arguments);p(this,"registerObjsMap",new Map)}register(e,i){return this.registerObjsMap.has(e)&&console.warn(`register warn:${e}已经被注册,再次注册会覆盖。`),this.registerObjsMap.set(e,i),e}getViewerConstructor(e){const i=this.registerObjsMap.get(e);if(!i){console.warn(`未找到${e}类!`);return}return i}createViewer(e){const i=e.type;console.log(e);const n=this.getViewerConstructor(i);if(!n)throw new Error(`没有找到类型为${i}的Viewer构造器!`);return new n(e)}}class nv extends d.Destroyable{constructor(t,e,i=!1,n=!1){if(super(),this._viewer=t,!e)throw new Error("ViewerCustomInteraction: container is null");const s=this.dv(d.DomElementEvent.create(e,"pointerdown")),a=this.dv(d.DomElementEvent.create(e,"pointermove")),o=this.dv(d.DomElementEvent.create(e,"pointerup")),l=this.dv(d.DomElementEvent.create(e,"pointerout")),u=this.dv(d.DomElementEvent.create(e,"pointerover")),c=this.dv(new d.PointerClick),h=this.dv(new d.PointerHover),f=()=>{const v=this._viewer.hoverTime*1e3;h.delayTime=v};this.d(this._viewer.hoverTimeChanged.don(()=>{f()})),this.d(s.don(v=>c.pointerDown(v))),this.d(a.don(v=>c.pointerMove(v))),this.d(o.don(v=>c.pointerUp(v))),this.d(l.don(v=>c.pointerOut(v))),this.d(s.don(v=>h.pointerDown(v))),this.d(a.don(v=>h.pointerMove(v))),this.d(o.don(v=>h.pointerUp(v))),this.d(l.don(v=>h.pointerOut(v)));const{x:g,y:m}=e.getBoundingClientRect(),_=n?g:0,E=n?m:0;this.d(h.hoverEvent.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,i);this._viewer.hoverEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(c.clickEvent.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,i);this._viewer.clickEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(c.dbclickEvent.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,i);v.button===0&&this._viewer.dblclickEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(s.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,i);v.button===0&&this._viewer.pointerDownEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(o.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,i);v.button===0&&this._viewer.pointerUpEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(a.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,i);this._viewer.pointerMoveEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(u.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,i);this._viewer.pointerOverEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(l.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,i);this._viewer.pointerOutEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})}));const M=this.dv(d.DomElementEvent.create(e,"keydown"));this.d(M.don(v=>this._viewer.keyDownEvent.emit(v)));const y=this.dv(d.DomElementEvent.create(e,"keyup"));this.d(y.don(v=>this._viewer.keyUpEvent.emit(v)));const w=this.dv(d.DomElementEvent.create(e,"wheel"));this.d(w.don(v=>this._viewer.wheelEvent.emit(v)))}}class GI extends d.Destroyable{constructor(e){super();p(this,"viewer");const i=this.viewer=e;this.ad(new d.ObjResettingWithEvent(i.rollerShutterChanged,()=>{const n=i.container;if(!n||!i.rollerShutter)return;const s=new d.Destroyable;this.viewer.splitPosition=.5;let a=this.getRollerShutterDIV();return n.appendChild(a),s.d(()=>{this.viewer.splitPosition=0,n.removeChild(a)}),s}))}getRollerShutterDIV(){let e=document.createElement("div");e.style.position="absolute",e.style.left="50%",e.style.top="0",e.style.backgroundColor="#d3d3d3",e.style.width="5px",e.style.height="100%",e.style.zIndex="9999";const i=n=>{if(!e.parentElement)return;n.preventDefault?n.preventDefault():n.returnValue=!1;const a=n.x/e.parentElement.offsetWidth;e.style.left=`${100*a}%`,this.viewer.splitPosition=a};return e.addEventListener("mouseenter",n=>{e.style.cursor="ew-resize"}),e.addEventListener("mouseleave",n=>{e.style.cursor="default"}),e.addEventListener("mousedown",n=>{e.style.cursor="ew-resize",document.addEventListener("mousemove",i)}),document.addEventListener("mouseup",n=>{e.style.cursor="default",document.removeEventListener("mousemove",i)}),e}}class kI extends d.Destroyable{constructor(e){super();p(this,"rollerShutterAnalysis");this.rollerShutterAnalysis=this.ad(new GI(e))}}const fs=class fs extends d.Destroyable{constructor(e){super();p(this,"_forceRecreateEvent",this.dv(new d.Event));p(this,"_container",this.dv(d.react(void 0)));p(this,"_containerSize",this.dv(d.react(void 0)));p(this,"_editingEvent",this.disposeVar(new d.Event));p(this,"_status",this.dv(d.react("Raw")));p(this,"_statusLog",this.dv(d.react("")));p(this,"_statusContainer",this.dv(new Yd(this)));p(this,"_useCustomInteraction",this.dv(d.react(!0)));p(this,"_resetInteractionEvent",this.dv(d.createNextAnimateFrameEvent(this.containerChanged,this._useCustomInteraction.changed,this._forceRecreateEvent)));p(this,"_interactionResetting",this.dv(new d.ObjResettingWithEvent(this._resetInteractionEvent,()=>{if(!(!this.container||!this._useCustomInteraction.value))return new nv(this,this.container)})));p(this,"_viewerChanged",this.dv(new d.Event));p(this,"_containerResetEvent",this.dv(d.createNextAnimateFrameEvent(this.containerChanged,this._forceRecreateEvent)));p(this,"_containerResetting",this.dv(new d.ObjResettingWithEvent(this._containerResetEvent,()=>{if(this.container)return new RI(this.container,this)})));p(this,"_sceneObjectsMap",new Map);p(this,"_id");p(this,"_typeName");p(this,"_updateFuncReact",this.dv(d.react(void 0)));p(this,"_toDestroyFuncReact",this.dv(d.react(void 0)));p(this,"_statusInfo",fs.defaults.statusInfo);p(this,"_navigationMode",this.dv(d.react("Map")));p(this,"_syncViewer",this.dv(d.react(void 0)));p(this,"_syncEventDon",this.dv(new d.ObjResettingWithEvent(this.syncViewerChanged,()=>{const e=this.syncViewer;if(e)return new DI(this,e)})));p(this,"_timeSyncdon",this.dv(new d.ObjResettingWithEvent(this.timeSyncChanged,()=>{if(this.timeSync)return new TI(this)})));p(this,"_hoverEvent",this.dv(new d.Event));p(this,"_pointerOverEvent",this.dv(new d.Event));p(this,"_pointerMoveEvent",this.dv(new d.Event));p(this,"_pointerDownEvent",this.dv(new d.Event));p(this,"_pointerUpEvent",this.dv(new d.Event));p(this,"_pointerOutEvent",this.dv(new d.Event));p(this,"_clickEvent",this.dv(new d.Event));p(this,"_dblclickEvent",this.dv(new d.Event));p(this,"_keyDownEvent",this.dv(new d.Event));p(this,"_keyUpEvent",this.dv(new d.Event));p(this,"_wheelEvent",this.dv(new d.Event));p(this,"_actived",this.dv(d.react(!1)));this._id=e.id??d.createGuid();const i=tv(e.container);if(i)this._container.value=Xd(i),this._typeName=e.type,this._initName();else throw new Error("container is not defined");{const n=()=>{i&&(this.show??!0?i.style.display="block":i.style.display="none")};n(),this.d(this.showChanged.don(n))}{const n=this._sceneObjectsMap,s=()=>{for(let[o,l]of n.entries())if(!l&&o){const u=Aa.context.createEngineObject(o,this);u&&n.set(o,u)}},a=()=>{for(let[o,l]of n.entries())l&&!l.isDestroyed()&&l.destroy(),n.set(o,void 0)};this.d(a),this.d(this.viewerChanged.don(o=>{a(),o&&s()}))}{const n=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(s){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};n(),this.d(this.execOnceFuncStrChanged.don(n))}{const n=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(a){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${a}`)}};n(),this.d(this.updateFuncStrChanged.don(n));let s;this.d(()=>s&&s.destroy()),this.d(this.updateFuncChanged.don(()=>{s&&s.cancel(),this.updateFunc&&(s=s||d.createAnimateFrame(),s.restart(void 0,a=>{this.updateFunc&&this.updateFunc(this,a)}))}))}{const n=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(s){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`),this.toDestroyFunc=void 0}};n(),this.d(this.toDestroyFuncStrChanged.don(n)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}this.ad(new kI(this))}forceRecreate(){this._forceRecreateEvent.emit()}get container(){return this._container.value}set container(e){this._container.value=e}set containerOrId(e){if(typeof e=="string"){const i=document.getElementById(e);i&&i instanceof HTMLDivElement?this._container.value=Xd(i):console.warn("containerOrId warn: !(container instanceof HTMLDivElement)")}else e instanceof HTMLDivElement?this._container.value=Xd(e):console.warn("containerOrId warn: setting container failed!")}get containerChanged(){return this._container.changed}get containerSize(){return this._containerSize.value}set containerSize(e){this._containerSize.value=e}get containerSizeChanged(){return this._containerSize.changed}get editingEvent(){return this._editingEvent}get status(){return this._status.value}get statusChanged(){return this._status.changed}setStatus(e){this._status.value=e}get statusLog(){return this._statusLog.value}get statusLogChanged(){return this._statusLog.changed}setStatusLog(e){this._statusLog.value=e}get useCustomInteraction(){return this._useCustomInteraction.value}set useCustomInteraction(e){this._useCustomInteraction.value=e}get viewerChanged(){return this._viewerChanged}get containerResetEvent(){return this._containerResetEvent}get subContainer(){var e;return(e=this._containerResetting.obj)==null?void 0:e.subContainer}get subContainerChanged(){return this._containerResetting.objChanged}get overlayContainer(){var e;return(e=this._containerResetting.obj)==null?void 0:e.overlayContainer}get overlayContainerChanged(){return this._containerResetting.objChanged}get sceneObjectsMap(){return this._sceneObjectsMap}get sceneObjects(){return this._sceneObjectsMap.keys()}getEngineObject(e){return this.sceneObjectsMap.get(e)}add(...e){for(let i of e)if(!this.has(i)){ft.context.addSceneObject(i);const n=Aa.context.createEngineObject(i,this);n&&this._sceneObjectsMap.set(i,n),i.viewerAttached.emit(this)}}delete(...e){for(let i of e)if(this.has(i)){const n=this._sceneObjectsMap.get(i);n&&n.destroy(),ft.context.deleteSceneObject(i),this._sceneObjectsMap.delete(i),i.viewerDetached.emit(this)}}disposableAdd(...e){return this.add(...e),()=>this.delete(...e)}disAdd(...e){return this.disposableAdd(...e)}has(e){return this._sceneObjectsMap.has(e)}clearAllSceneObjects(){for(let e of this.sceneObjects)this.delete(e)}get id(){return this._id}set id(e){console.warn("ESViewer id is readonly")}get typeName(){return this._typeName}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return fs.createDefaultProps()}_getJson(e=!0){const i={id:this.id,type:this.typeName};for(let n of Object.keys(this.defaultProps))if(e){let s,a=this.defaultProps[n];a instanceof d.ReactiveVariable?s=a.equals(this[n]):s=a===this[n],s||(i[n]=this[n])}else i[n]=this[n];return i}_setJson(e,i,n){if(!(e instanceof Object)||e.type&&e.type!==this.typeName){console.error(`value.type && value.type${e.type} !== this.typeName${this.typeName}`);return}e.id&&e.id!==this.id&&console.warn(`value.id === undefined || value.id${e.id} !== this.id(${this.id})`);const s=i||[];s.push("id","type");const a=Object.keys(this.defaultProps).filter(o=>!s.includes(o));for(let o of a)if(o in e)this[o]=e[o]===null?void 0:e[o];else if(!(n??!1)){let l=this.defaultProps[o];l instanceof d.ReactiveVariable&&(l=l.value),this[o]=l}}get json(){return this._getJson()}set json(e){this._setJson(e,["devTags"])}get updateFunc(){return this._updateFuncReact.value}set updateFunc(e){this._updateFuncReact.value=e}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(e){this._toDestroyFuncReact.value=e}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get navigationMode(){return this._navigationMode.value}get navigationModeChanged(){return this._navigationMode.changed}getNavigationMode(){return this._navigationMode.value}getEngineType(){return this._typeName}get syncViewer(){return this._syncViewer.value}set syncViewer(e){this._syncViewer.value=e}get syncViewerChanged(){return this._syncViewer.changed}syncOtherViewer(e){e&&e.syncViewer&&(e.syncViewer=void 0),e===this?this._syncViewer.value=void 0:this._syncViewer.value=e}setCurrentTime(e){try{this.currentTime=typeof e=="string"?Date.parse(e):e}catch(i){console.warn(`时间格式不正确! value: ${e} error: ${i}`)}}async getVersion(){return window.g_XE3CopyRights??{}}get hoverEvent(){return this._hoverEvent}get pointerOverEvent(){return this._pointerOverEvent}get pointerMoveEvent(){return this._pointerMoveEvent}get pointerDownEvent(){return this._pointerDownEvent}get pointerUpEvent(){return this._pointerUpEvent}get pointerOutEvent(){return this._pointerOutEvent}get clickEvent(){return this._clickEvent}get dblclickEvent(){return this._dblclickEvent}get keyDownEvent(){return this._keyDownEvent}get keyUpEvent(){return this._keyUpEvent}get wheelEvent(){return this._wheelEvent}getProperties(e){return[new H("ESViewer","ESViewer",[new mt("强制刷新","重载",[],()=>this.forceRecreate(),[]),new U("debug","debug",!0,!1,[this,"debug"],fs.defaults.debug),new U("是否可见","是否可见",!0,!1,[this,"show"]),new tt("位置点单位","lonLatFormat",!0,!1,[this,"lonLatFormat"],[["度","DECIMAL_DEGREE"],["度分","DEGREES_DECIMAL_MINUTES"],["度分秒","SEXAGESIMAL_DEGREE"]]),new U("是否开启文字避让","textAvoidance",!0,!1,[this,"textAvoidance"],!1),new nt("ionAccessToken","ionAccessToken",!1,!1,[this,"ionAccessToken"]),new C("时钟","时钟",!1,!1,[this,"currentTime"]),new U("globeShow","globeShow",!0,!1,[this,"globeShow"]),new U("atmosphere","atmosphere",!1,!1,[this,"atmosphere"])]),new C("飞行像素范围","默认飞行定位时对象包围球所占的屏幕像素大小",!1,!1,[this,"flyToBoundingSize"]),new C("编辑高度偏移","编辑时默认的高度偏移",!1,!1,[this,"editingHeightOffset"]),new H("Globe","Globe",[new Y("地形着色器","可以设置地形全局坡度,坡向,高程带,等高线等",!1,!1,[this,"terrainShader"])])]}get actived(){return this._actived.value}set actived(e){this._actived.value=e}get activedChanged(){return this._actived.changed}};p(fs,"context",new FI),p(fs,"register",fs.context.register.bind(fs.context)),p(fs,"defaults",{show:!0,debug:!1,statusInfo:{fps:0,position:[0,0,0],rotation:[0,0,0],length:0},terrainShader:{slope:{show:!1},aspect:{show:!1},elevationRamp:{show:!1,minHeight:-414,maxHeight:8777,color:[]},elevationContour:{show:!1,color:[1,0,0,1],spacing:150,width:2}},globeShow:!0,splitPosition:0});let Dn=fs;(r=>{r.createBaseProps=()=>({name:"未命名场景对象",extras:d.reactJson(void 0),devTags:d.reactArrayWithUndefined(void 0),debug:void 0,show:void 0,opacity:void 0,zIndex:void 0,useDefaultStatusDiv:!0,execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0}),r.createCommonProps=()=>({globeShow:!0,ionAccessToken:"",lonLatFormat:"DECIMAL_DEGREE",fov:60,textAvoidance:!1,flyToBoundingSize:256,hoverTime:2,currentTime:Date.now(),simulationTime:Date.now(),timeSync:!1,rain:0,snow:0,cloud:0,fog:0,depthOfField:0,atmosphere:!0,editingPointSize:void 0,editingPointColor:d.reactArrayWithUndefined(void 0),editingAuxiliaryPointColor:d.reactArrayWithUndefined(void 0),editingLineWidth:void 0,editingLineColor:d.reactArrayWithUndefined(void 0),editingAxisSize:void 0,editingAuxiliaryPointSize:void 0,editingHeightOffset:0,editingLineShow:!0,editingEventListening:!0,terrainShader:r.defaults.terrainShader,splitPosition:d.react(void 0),rollerShutter:!1}),r.createDefaultProps=()=>({...(0,r.createBaseProps)(),...(0,r.createCommonProps)()})})(Dn||(Dn={})),d.extendClassProps(Dn.prototype,Dn.createDefaultProps);function sv(r,t){const e=r._lastCameraInfo;if(e){const i=t.viewerChanged.don(n=>{if(!n||!e)return;const{position:s,rotation:a}=e;t.flyIn(s,a,0),r._lastCameraInfo=void 0,i()})}}const zI=r=>{const t=Dn.createCommonProps(),e={};try{Object.keys(t).forEach(i=>{e[i]=r[i]})}catch(i){console.warn(i)}return e},av=(r,t)=>{const e=Dn.createCommonProps();try{Object.keys(e).forEach(i=>{r[i]=t[i]})}catch(i){console.warn(i)}};class VI extends d.Destroyable{constructor(e){super();p(this,"_viewersChanged",this.disposeVar(new d.Event));p(this,"_viewers",new Set);p(this,"_viewersToChange",this.dv(new d.Event));this._sceneObjectsManager=e,this.d(()=>{for(const i of this._viewers)this.destroyViewer(i);this._viewers.clear()}),this.viewers.forEach(i=>{const n=this._sceneObjectsManager.sceneObjects;i.add(...n)}),this.d(()=>{const i=this._sceneObjectsManager.sceneObjects;this.viewers.forEach(n=>{n.delete(...i)})}),this.d(this._sceneObjectsManager.sceneObjectsToChange.don((i,n)=>{this.viewers.forEach(s=>{n.forEach(a=>{Ds(s.devTags,a.devTags)&&(s.has(a)?console.warn(`${s.typeName}中已存${a.typeName},检查逻辑是否有问题!`):s.add(a))}),i.forEach(a=>{Ds(s.devTags,a.devTags)&&(s.has(a)?s.delete(a):console.warn(`${s.typeName}中不存在${a.typeName},检查逻辑是否有问题!`))})}),n.length>0&&n.forEach(s=>{s.d(s.devTagsChanged.don(()=>{this.viewers.forEach(a=>{a.has(s)&&a.delete(s),console.log("sceneObjectsToChange",a.devTags,s.devTags,Ds(a.devTags,s.devTags)),Ds(a.devTags,s.devTags)&&(a.has(s)?console.warn(`${a.typeName}中已存${s.typeName},检查逻辑是否有问题!`):a.add(s))})}))})})),this.d(this.viewersChanged.don((i,n)=>{const s=this._sceneObjectsManager.sceneObjects;n.forEach(a=>{for(let o of s)Ds(a.devTags,o.devTags)&&(a.has(o)?console.warn(`${a.typeName}中已存${o.typeName},检查逻辑是否有问题!`):a.add(o))}),i.forEach(a=>{for(let o of s)Ds(a.devTags,o.devTags)&&(a.has(o)?a.delete(o):console.warn(`${a.typeName}中不存在${o.typeName},检查逻辑是否有问题!`))}),n.length>0&&n.forEach(a=>{a.d(a.devTagsChanged.don(()=>{a.clearAllSceneObjects();const o=this._sceneObjectsManager.sceneObjects;for(let l of o)console.log("viewersChanged",a.devTags,l.devTags,Ds(a.devTags,l.devTags)),Ds(a.devTags,l.devTags)&&(a.has(l)?console.warn(`${a.typeName}中已存${l.typeName},检查逻辑是否有问题!`):a.add(l))}))})}))}get viewersChanged(){return this._viewersChanged}get viewers(){return this._viewers}getViewers(){return[...this._viewers]}get viewersToChange(){return this._viewersToChange}createViewer(e){const i=Dn.context.createViewer(e);return this._viewers.add(i),this._viewersChanged.emit([],[i]),i}destroyViewer(e){return e.isDestroyed()?!0:(this._viewers.delete(e),this._viewersChanged.emit([e],[]),e.destroy(),e.isDestroyed())}}class Pa extends d.Destroyable{constructor(...e){super();p(this,"_drgm",this.dv(new v0));p(this,"_sobjm",this.dv(new bI));p(this,"_vrm",this.dv(new VI(this._sobjm)));p(this,"_sceneObjectEditingManager",this.disposeVar(new NI));p(this,"_activeViewer",this.dv(d.react(void 0)));p(this,"_syncOtherViewersToActived",this.dv(d.react(!1)));p(this,"_cmrvm",this.createSceneObjectFromClass(_a));p(this,"_cmrvmdon",this.d(()=>this._cmrvm&&this.destroySceneObject(this._cmrvm)));p(this,"_asset",{type:"ESObjectsManager",version:"0.1.0",createdTime:"",modifiedTime:"",name:"未命名项目"});p(this,"_sceneTree",this.dv(new Gh("default",this.dragstartDataMananger,24,this)));p(this,"_propUiTreeManager",this.dv(new Au(24)));p(this,"_sceneTreeMap",new Map);p(this,"_viewerCreatedEvent",this.dv(new d.Event));p(this,"_lastCameraInfo");p(this,"_lastActiveViewerJson");p(this,"syncEvent",this.dv(d.createNextAnimateFrameEvent(this.activeViewerChanged,this.syncOtherViewersToActivedChanged)));p(this,"_syncEventDon",this.d(this.syncEvent.don(()=>{const e=this.syncOtherViewersToActived;this.viewers.forEach(i=>{e?i.syncOtherViewer(this.activeViewer):i.syncOtherViewer(void 0)})})));p(this,"_player",this.createSceneObjectFromClass(As));p(this,"_playerdon",this.d(()=>this._player&&this.destroySceneObject(this._player)));p(this,"_esPlyarAndPathTime",this.dv(new EI(this)));p(this,"_pathAnimationManager",this.dv(new PI(this)))}static get envs(){return ft.context.environmentVariables}getSceneObjectById(e){return ft.getSceneObjectById(e)}getSceneObject(e){return ft.getSceneObject(e)}get $refs(){return ft.$refs}get dragstartDataMananger(){return this._drgm}get sceneObjectsManager(){return this._sobjm}get viewers(){return this._vrm.viewers}getViewers(){return this._vrm.getViewers()}get sceneObjectEditingManager(){return this._sceneObjectEditingManager}get activeViewer(){return this._activeViewer.value}set activeViewer(e){this._activeViewer.value=e}get activeViewerChanged(){return this._activeViewer.changed}get syncOtherViewersToActived(){return this._syncOtherViewersToActived.value}set syncOtherViewersToActived(e){this._syncOtherViewersToActived.value=e}get syncOtherViewersToActivedChanged(){return this._syncOtherViewersToActived.changed}get cameraViewsManager(){return this._cmrvm}get json(){var h;const e=this._asset.createdTime||new Date().toISOString(),i=new Date().toISOString(),n=this._asset.name||"未命名项目",a={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:e,modifiedTime:i,name:n},o=this.sceneTree.json,l=this._cmrvm.views,u=[...this._vrm.viewers].map(f=>f.json),c=(h=this.activeViewer)==null?void 0:h.getCurrentCameraInfo();return{asset:a,viewers:u,sceneTree:o,viewCollection:l,lastView:c}}set json(e){try{if(!e.asset)return;if(!e.asset.type||e.asset.type!=="ESObjectsManager"){console.warn("json装配失败! asset.type 不存在或者不是'ESObjectsManager'");return}if(this._asset.createdTime=e.asset&&e.asset.createdTime||new Date().toISOString(),this._asset.modifiedTime=e.asset&&e.asset.modifiedTime||"",this._asset.name=e.asset&&e.asset.name||"未命名项目",this._asset.version=e.asset&&e.asset.version||"0.1.0",e.sceneTree&&(this.sceneTree.json=e.sceneTree),e.viewCollection&&(this._cmrvm.views=e.viewCollection),!e.viewers||!Array.isArray(e.viewers)){console.warn("viewers is not an array or does not exist !");return}if(this._vrm.viewers.size===0||e.viewers.length===0){console.warn("viewers is empty !");return}this._vrm.viewers.forEach(i=>{const n=e.viewers.find(s=>s.id===i.id);n&&(i.json=n)})}catch(i){console.error(`ESObjectsManager解析json数据时发生错误! error: ${i}`)}}get sceneTree(){return this._sceneTree}get jsonLoadingEvent(){return this._sceneTree.jsonLoadingEvent}get propUiTreeManager(){return this._propUiTreeManager}propTreeCallback(e){return CI(this,e)}getSceneTrees(){return[...this._sceneTreeMap.values()]}getSceneTree(e="default"){if(e==="default")return this._sceneTree;if(!this._sceneTreeMap.has(e)){console.warn(`id为${e}的SceneTree不存在!`);return}return this._sceneTreeMap.get(e)}createSceneTree(e,i=24){if(this._sceneTreeMap.has(e)||e==="default")console.warn(`id为${e}的SceneTree已存在!`);else{const n=this.dv(new Gh(e,this.dragstartDataMananger,i,this));this._sceneTreeMap.set(e,n)}return this.getSceneTree(e)}get viewerCreatedEvent(){return this._viewerCreatedEvent}createViewer(e){const i=this._vrm.createViewer(e);this.activeViewer||(this.activeViewer=i);const n=this.d(i.viewerChanged.don(s=>{s&&(this._viewerCreatedEvent.emit(i),n())}));return i}destroyViewer(e){return this._activeViewer.value===e&&(this._activeViewer.value=void 0),this._vrm.destroyViewer(e)}switchViewer(e,i=!0,n=!0,s=!0){var u;this.activeViewer&&this.activeViewer.getNavigationMode()!=="Map"&&this.activeViewer.changeToMap(),!this._lastCameraInfo&&i&&(this._lastCameraInfo=(u=this.activeViewer)==null?void 0:u.getCurrentCameraInfo()),!this._lastActiveViewerJson&&n&&(this._lastActiveViewerJson=this.activeViewer?zI(this.activeViewer):void 0),s&&this.activeViewer&&this.destroyViewer(this.activeViewer);const a=e.id,o=a?[...this.getViewers()].find(c=>c.id===a):[...this.getViewers()].find(c=>c.typeName===e.type);if(o)if(a&&o.typeName!==e.type)console.warn(`id为${a}的viewer的typeName和option.type${e.type}不相同!,虽然id一致但是typeName不同,所以会销毁并创建新的viewer`),this.destroyViewer(o);else return console.log("ESViewer exists, will be used"),i&&sv(this,o),n&&this._lastActiveViewerJson&&(av(o,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),o.container===tv(e.container)?(o.containerOrId=e.container,o.forceRecreate()):o.containerOrId=e.container,this.activeViewer=o,o;console.log("No ESViewer exists, will be created");const l=this.createViewer(e);return console.log(e),console.log(this),i&&sv(this,l),n&&this._lastActiveViewerJson&&(av(l,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),this.activeViewer=l,l}switchToCesiumViewer(...e){if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)){const{container:i,viewSync:n,attributeSync:s,destroy:a,id:o}=e[0];return this.switchViewer({type:"ESCesiumViewer",container:i,id:o},n??!0,s??!0,a??!0)}else if(typeof e[0]=="string"||e[0]instanceof HTMLDivElement){const i={container:e[0],viewSync:e[1]??!0,attributeSync:e[2]??!0,destroy:e[3]??!0,id:e[4]},{container:n,viewSync:s,attributeSync:a,destroy:o,id:l}=i;return this.switchViewer({type:"ESCesiumViewer",container:n,id:l},s,a,o)}}switchToUEViewer(...e){let i,n={viewSync:!0,attributeSync:!0,destroy:!0};if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("uri")){const{container:l,uri:u,app:c,token:h,viewSync:f,attributeSync:g,destroy:m,id:_}=e[0];i={type:"ESUeViewer",container:l,id:_,options:{uri:u,app:c,token:h}},n={viewSync:f??!0,attributeSync:g??!0,destroy:m??!0}}else if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("ws")){const{container:l,ws:u,esmsg:c,viewSync:h,attributeSync:f,id:g,destroy:m}=e[0];i={type:"ESUeViewer",container:l,id:g,options:{ws:u,esmsg:c}},n={viewSync:h??!0,attributeSync:f??!0,destroy:m??!0}}else if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("project")){const{container:l,project:u,baseUrl:c,viewSync:h,attributeSync:f,id:g,destroy:m}=e[0];i={type:"ESUeViewer",container:l,id:g,options:{project:u,baseUrl:c}},n={viewSync:h??!0,attributeSync:f??!0,destroy:m??!0}}else(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(typeof e[1]=="string"&&e[1].startsWith("ws")?(i={type:"ESUeViewer",container:e[0],id:e[6],options:{ws:e[1],esmsg:e[2]??void 0}},n={viewSync:e[3]??!0,attributeSync:e[4]??!0,destroy:e[5]??!0}):typeof e[1]=="string"&&e[1].startsWith("http")?(i={type:"ESUeViewer",container:e[0],id:e[7],options:{uri:e[1],app:e[2],token:e[3]??void 0}},n={viewSync:e[4]??!0,attributeSync:e[5]??!0,destroy:e[6]??!0}):(i={type:"ESUeViewer",container:e[0],id:e[6],options:{project:e[1],baseUrl:e[2]??void 0}},n={viewSync:e[3]??!0,attributeSync:e[4]??!0,destroy:e[5]??!0}));if(!i)throw new Error("参数错误");const{viewSync:s,attributeSync:a,destroy:o}=n;return this.switchViewer(i,s,a,o)}createCesiumViewer(...e){let i;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?i={...e[0],type:"ESCesiumViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(i={container:e[0],options:e[1]??void 0,id:e[2]??void 0,type:"ESCesiumViewer"}),!i)throw new Error("参数错误");return this.createViewer(i)}createOpenLayersViewer(...e){let i;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?i={...e[0],type:"ESOlViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(i={container:e[0],options:e[1]??void 0,id:e[2]??void 0,type:"ESOlViewer"}),!i)throw new Error("参数错误");return this.createViewer(i)}createUeViewer(...e){let i;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?i={...e[0],type:"ESUeViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(typeof e[1]=="string"&&e[1].startsWith("ws")?i={type:"ESUeViewer",container:e[0],id:e[3]??void 0,options:{ws:e[1],esmsg:e[2]??void 0}}:typeof e[1]=="string"&&e[1].startsWith("http")?i={type:"ESUeViewer",container:e[0],id:e[4]??void 0,options:{uri:e[1],app:e[2],token:e[3]??void 0}}:i={type:"ESUeViewer",container:e[0],id:e[3]??void 0,options:{project:e[1],baseUrl:e[2]??void 0}}),!i)throw new Error("参数错误");return this.createViewer(i)}createSceneObject(e,i){return this._sobjm.createSceneObject(e,i)}createSceneObjectFromClass(e,i){return this._sobjm.createSceneObjectFromClass(e,i)}createSceneObjectFromJson(e){return this._sobjm.createSceneObjectFromJson(e)}destroySceneObject(e){const i=this._sobjm.deleteSceneObject(e);return e.destroy(),i}destroyAllSceneObjects(){const e=[...this._sobjm.sceneObjects];for(let i of e)i!=this._player&&i!=this._cmrvm&&this.destroySceneObject(i)}get player(){return this._player}get esPlyarAndPathTime(){return this._esPlyarAndPathTime}get pathAnimationManager(){return this._pathAnimationManager}}p(Pa,"getSceneObjById",ft.context.getSceneObjectById.bind(ft.context)),p(Pa,"getEnv",ft.context.getEnv.bind(ft.context)),p(Pa,"setEnv",ft.context.setEnv.bind(ft.context)),(r=>{r.createDefaultProps=()=>({})})(Pa||(Pa={})),d.extendClassProps(Pa.prototype,Pa.createDefaultProps);function UI(){const r=navigator.userAgent;let t="Unknown";/Windows/.test(r)?t="Windows":/Macintosh/.test(r)?t="MacOS":/Linux/.test(r)?t="Linux":/Android/.test(r)?t="Android":/iOS|iPhone|iPad|iPod/.test(r)&&(t="iOS");let e="Unknown";return/x64|x86_64|Win64|WOW64/.test(r)?e="x64":/x86|i686|Win32/.test(r)?e="x86":/arm64|aarch64/.test(r)?e="arm64":/arm/.test(r)&&(e="arm"),{os:t.toLocaleLowerCase(),arch:e.toLocaleLowerCase()}}const qI=Date.now();function ov(r){const{os:t,arch:e}=UI(),i={version:r.version,commitdate:r.date,commitId:r.commitId,runningTime:(Date.now()-qI)/1e3/60|0,date:new Date().toLocaleString(),href:window.location.href,os:t,arch:e},s={method:"GET",headers:new Headers,redirect:"follow"},a=window.encodeURIComponent(JSON.stringify(i));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${a}`,s).then(o=>o.text()).then(o=>console.log(o)).catch(o=>console.log("error",o))}N.copyright=void 0;try{const r="earthsdk3",t="3.4.0-beta.6",e="2025-08-13T02:44:57.000Z",i="北京西部世界科技有限公司",n="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="1db9138c470e4d98418a0699adcb1700a2168ceb",o=((Date.now()-1755053097e3)/36e5).toFixed(1),l=`%c🌏 ${r}%c ${t}.${s.slice(0,8)}.${e} (距今${o}个小时)
538
538
  %c${n?n+`
539
539
  `:""}当前网站正在使用${r},此软件版权归${i}所有
540
- `;N.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","1db9138c470e4d98418a0699adcb1700a2168ceb")},get info(){return l},get date(){return"2025-08-13T02:44:57.000Z"},get author(){return"suplyang"},get version(){return"3.4.0-beta.5"},get name(){return"earthsdk3"},get commitId(){return"1db9138c470e4d98418a0699adcb1700a2168ceb"},print(){console.info(this.info,`
540
+ `;N.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","1db9138c470e4d98418a0699adcb1700a2168ceb")},get info(){return l},get date(){return"2025-08-13T02:44:57.000Z"},get author(){return"suplyang"},get version(){return"3.4.0-beta.6"},get name(){return"earthsdk3"},get commitId(){return"1db9138c470e4d98418a0699adcb1700a2168ceb"},print(){console.info(this.info,`
541
541
  font-size: 18px;
542
542
  font-weight: 1000;
543
543
  line-height: 1;