leiting-bim 2.1.187 → 2.1.190
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/leiting-bim.es.js +1 -1
- package/leiting-bim.umd.js +2 -2
- package/package.json +1 -1
package/leiting-bim.umd.js
CHANGED
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
material.diffuse *= u_tilesBrightness;
|
|
11
11
|
}
|
|
12
12
|
`});d.isModelAdjustment=!0,c.customShader=d}else{let d="color('white')";e!==1&&(d=`${d} * ${e}`),c.style=new n.Cesium3DTileStyle({color:d})}}}}var Pa=typeof global=="object"&&global&&global.Object===Object&&global,Lh=typeof self=="object"&&self&&self.Object===Object&&self,$t=Pa||Lh||Function("return this")(),Ln=$t.Symbol,_a=Object.prototype,Oh=_a.hasOwnProperty,Gh=_a.toString,Oi=Ln?Ln.toStringTag:void 0;function Uh(i){var e=Oh.call(i,Oi),t=i[Oi];try{i[Oi]=void 0;var n=!0}catch{}var s=Gh.call(i);return n&&(e?i[Oi]=t:delete i[Oi]),s}var Vh=Object.prototype,Qh=Vh.toString;function Hh(i){return Qh.call(i)}var Yh="[object Null]",zh="[object Undefined]",Da=Ln?Ln.toStringTag:void 0;function Gi(i){return i==null?i===void 0?zh:Yh:Da&&Da in Object(i)?Uh(i):Hh(i)}function hi(i){return i!=null&&typeof i=="object"}var jh="[object Symbol]";function Wh(i){return typeof i=="symbol"||hi(i)&&Gi(i)==jh}var On=Array.isArray,$h=/\s/;function Kh(i){for(var e=i.length;e--&&$h.test(i.charAt(e)););return e}var qh=/^\s+/;function Xh(i){return i&&i.slice(0,Kh(i)+1).replace(qh,"")}function pt(i){var e=typeof i;return i!=null&&(e=="object"||e=="function")}var ka=NaN,Jh=/^[-+]0x[0-9a-f]+$/i,Zh=/^0b[01]+$/i,eu=/^0o[0-7]+$/i,tu=parseInt;function Na(i){if(typeof i=="number")return i;if(Wh(i))return ka;if(pt(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=pt(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=Xh(i);var t=Zh.test(i);return t||eu.test(i)?tu(i.slice(2),t?2:8):Jh.test(i)?ka:+i}function Ra(i){return i}var iu="[object AsyncFunction]",nu="[object Function]",su="[object GeneratorFunction]",ou="[object Proxy]";function Ks(i){if(!pt(i))return!1;var e=Gi(i);return e==nu||e==su||e==iu||e==ou}var qs=$t["__core-js_shared__"],Fa=(function(){var i=/[^.]+$/.exec(qs&&qs.keys&&qs.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""})();function au(i){return!!Fa&&Fa in i}var ru=Function.prototype,lu=ru.toString;function cu(i){if(i!=null){try{return lu.call(i)}catch{}try{return i+""}catch{}}return""}var du=/[\\^$.*+?()[\]{}|]/g,hu=/^\[object .+?Constructor\]$/,uu=Function.prototype,fu=Object.prototype,mu=uu.toString,gu=fu.hasOwnProperty,pu=RegExp("^"+mu.call(gu).replace(du,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Au(i){if(!pt(i)||au(i))return!1;var e=Ks(i)?pu:hu;return e.test(cu(i))}function yu(i,e){return i?.[e]}function Xs(i,e){var t=yu(i,e);return Au(t)?t:void 0}var La=Object.create,Eu=(function(){function i(){}return function(e){if(!pt(e))return{};if(La)return La(e);i.prototype=e;var t=new i;return i.prototype=void 0,t}})();function Cu(i,e,t){switch(t.length){case 0:return i.call(e);case 1:return i.call(e,t[0]);case 2:return i.call(e,t[0],t[1]);case 3:return i.call(e,t[0],t[1],t[2])}return i.apply(e,t)}function vu(i,e){var t=-1,n=i.length;for(e||(e=Array(n));++t<n;)e[t]=i[t];return e}var bu=800,wu=16,Iu=Date.now;function Su(i){var e=0,t=0;return function(){var n=Iu(),s=wu-(n-t);if(t=n,s>0){if(++e>=bu)return arguments[0]}else e=0;return i.apply(void 0,arguments)}}function xu(i){return function(){return i}}var Gn=(function(){try{var i=Xs(Object,"defineProperty");return i({},"",{}),i}catch{}})(),Mu=Gn?function(i,e){return Gn(i,"toString",{configurable:!0,enumerable:!1,value:xu(e),writable:!0})}:Ra,Bu=Su(Mu),Tu=9007199254740991,Pu=/^(?:0|[1-9]\d*)$/;function Oa(i,e){var t=typeof i;return e=e??Tu,!!e&&(t=="number"||t!="symbol"&&Pu.test(i))&&i>-1&&i%1==0&&i<e}function Js(i,e,t){e=="__proto__"&&Gn?Gn(i,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):i[e]=t}function Un(i,e){return i===e||i!==i&&e!==e}var _u=Object.prototype,Du=_u.hasOwnProperty;function ku(i,e,t){var n=i[e];(!(Du.call(i,e)&&Un(n,t))||t===void 0&&!(e in i))&&Js(i,e,t)}function Nu(i,e,t,n){var s=!t;t||(t={});for(var o=-1,r=e.length;++o<r;){var l=e[o],c=void 0;c===void 0&&(c=i[l]),s?Js(t,l,c):ku(t,l,c)}return t}var Ga=Math.max;function Ru(i,e,t){return e=Ga(e===void 0?i.length-1:e,0),function(){for(var n=arguments,s=-1,o=Ga(n.length-e,0),r=Array(o);++s<o;)r[s]=n[e+s];s=-1;for(var l=Array(e+1);++s<e;)l[s]=n[s];return l[e]=t(r),Cu(i,this,l)}}function Fu(i,e){return Bu(Ru(i,e,Ra),i+"")}var Lu=9007199254740991;function Ua(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=Lu}function Zs(i){return i!=null&&Ua(i.length)&&!Ks(i)}function Ou(i,e,t){if(!pt(t))return!1;var n=typeof e;return(n=="number"?Zs(t)&&Oa(e,t.length):n=="string"&&e in t)?Un(t[e],i):!1}function Gu(i){return Fu(function(e,t){var n=-1,s=t.length,o=s>1?t[s-1]:void 0,r=s>2?t[2]:void 0;for(o=i.length>3&&typeof o=="function"?(s--,o):void 0,r&&Ou(t[0],t[1],r)&&(o=s<3?void 0:o,s=1),e=Object(e);++n<s;){var l=t[n];l&&i(e,l,n,o)}return e})}var Uu=Object.prototype;function Va(i){var e=i&&i.constructor,t=typeof e=="function"&&e.prototype||Uu;return i===t}function Vu(i,e){for(var t=-1,n=Array(i);++t<i;)n[t]=e(t);return n}var Qu="[object Arguments]";function Qa(i){return hi(i)&&Gi(i)==Qu}var Ha=Object.prototype,Hu=Ha.hasOwnProperty,Yu=Ha.propertyIsEnumerable,eo=Qa((function(){return arguments})())?Qa:function(i){return hi(i)&&Hu.call(i,"callee")&&!Yu.call(i,"callee")};function zu(){return!1}var Ya=typeof V=="object"&&V&&!V.nodeType&&V,za=Ya&&typeof module=="object"&&module&&!module.nodeType&&module,ju=za&&za.exports===Ya,ja=ju?$t.Buffer:void 0,Wu=ja?ja.isBuffer:void 0,Wa=Wu||zu,$u="[object Arguments]",Ku="[object Array]",qu="[object Boolean]",Xu="[object Date]",Ju="[object Error]",Zu="[object Function]",ef="[object Map]",tf="[object Number]",nf="[object Object]",sf="[object RegExp]",of="[object Set]",af="[object String]",rf="[object WeakMap]",lf="[object ArrayBuffer]",cf="[object DataView]",df="[object Float32Array]",hf="[object Float64Array]",uf="[object Int8Array]",ff="[object Int16Array]",mf="[object Int32Array]",gf="[object Uint8Array]",pf="[object Uint8ClampedArray]",Af="[object Uint16Array]",yf="[object Uint32Array]",ye={};ye[df]=ye[hf]=ye[uf]=ye[ff]=ye[mf]=ye[gf]=ye[pf]=ye[Af]=ye[yf]=!0,ye[$u]=ye[Ku]=ye[lf]=ye[qu]=ye[cf]=ye[Xu]=ye[Ju]=ye[Zu]=ye[ef]=ye[tf]=ye[nf]=ye[sf]=ye[of]=ye[af]=ye[rf]=!1;function Ef(i){return hi(i)&&Ua(i.length)&&!!ye[Gi(i)]}function Cf(i){return function(e){return i(e)}}var $a=typeof V=="object"&&V&&!V.nodeType&&V,Ui=$a&&typeof module=="object"&&module&&!module.nodeType&&module,vf=Ui&&Ui.exports===$a,to=vf&&Pa.process,Ka=(function(){try{var i=Ui&&Ui.require&&Ui.require("util").types;return i||to&&to.binding&&to.binding("util")}catch{}})(),qa=Ka&&Ka.isTypedArray,Xa=qa?Cf(qa):Ef;function bf(i,e){var t=On(i),n=!t&&eo(i),s=!t&&!n&&Wa(i),o=!t&&!n&&!s&&Xa(i),r=t||n||s||o,l=r?Vu(i.length,String):[],c=l.length;for(var d in i)r&&(d=="length"||s&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Oa(d,c))||l.push(d);return l}function wf(i,e){return function(t){return i(e(t))}}function If(i){var e=[];if(i!=null)for(var t in Object(i))e.push(t);return e}var Sf=Object.prototype,xf=Sf.hasOwnProperty;function Mf(i){if(!pt(i))return If(i);var e=Va(i),t=[];for(var n in i)n=="constructor"&&(e||!xf.call(i,n))||t.push(n);return t}function Ja(i){return Zs(i)?bf(i):Mf(i)}var Vi=Xs(Object,"create");function Bf(){this.__data__=Vi?Vi(null):{},this.size=0}function Tf(i){var e=this.has(i)&&delete this.__data__[i];return this.size-=e?1:0,e}var Pf="__lodash_hash_undefined__",_f=Object.prototype,Df=_f.hasOwnProperty;function kf(i){var e=this.__data__;if(Vi){var t=e[i];return t===Pf?void 0:t}return Df.call(e,i)?e[i]:void 0}var Nf=Object.prototype,Rf=Nf.hasOwnProperty;function Ff(i){var e=this.__data__;return Vi?e[i]!==void 0:Rf.call(e,i)}var Lf="__lodash_hash_undefined__";function Of(i,e){var t=this.__data__;return this.size+=this.has(i)?0:1,t[i]=Vi&&e===void 0?Lf:e,this}function Kt(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var n=i[e];this.set(n[0],n[1])}}Kt.prototype.clear=Bf,Kt.prototype.delete=Tf,Kt.prototype.get=kf,Kt.prototype.has=Ff,Kt.prototype.set=Of;function Gf(){this.__data__=[],this.size=0}function Vn(i,e){for(var t=i.length;t--;)if(Un(i[t][0],e))return t;return-1}var Uf=Array.prototype,Vf=Uf.splice;function Qf(i){var e=this.__data__,t=Vn(e,i);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():Vf.call(e,t,1),--this.size,!0}function Hf(i){var e=this.__data__,t=Vn(e,i);return t<0?void 0:e[t][1]}function Yf(i){return Vn(this.__data__,i)>-1}function zf(i,e){var t=this.__data__,n=Vn(t,i);return n<0?(++this.size,t.push([i,e])):t[n][1]=e,this}function It(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var n=i[e];this.set(n[0],n[1])}}It.prototype.clear=Gf,It.prototype.delete=Qf,It.prototype.get=Hf,It.prototype.has=Yf,It.prototype.set=zf;var Za=Xs($t,"Map");function jf(){this.size=0,this.__data__={hash:new Kt,map:new(Za||It),string:new Kt}}function Wf(i){var e=typeof i;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?i!=="__proto__":i===null}function Qn(i,e){var t=i.__data__;return Wf(e)?t[typeof e=="string"?"string":"hash"]:t.map}function $f(i){var e=Qn(this,i).delete(i);return this.size-=e?1:0,e}function Kf(i){return Qn(this,i).get(i)}function qf(i){return Qn(this,i).has(i)}function Xf(i,e){var t=Qn(this,i),n=t.size;return t.set(i,e),this.size+=t.size==n?0:1,this}function ui(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var n=i[e];this.set(n[0],n[1])}}ui.prototype.clear=jf,ui.prototype.delete=$f,ui.prototype.get=Kf,ui.prototype.has=qf,ui.prototype.set=Xf;var er=wf(Object.getPrototypeOf,Object),Jf="[object Object]",Zf=Function.prototype,em=Object.prototype,tr=Zf.toString,tm=em.hasOwnProperty,im=tr.call(Object);function nm(i){if(!hi(i)||Gi(i)!=Jf)return!1;var e=er(i);if(e===null)return!0;var t=tm.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&tr.call(t)==im}function sm(){this.__data__=new It,this.size=0}function om(i){var e=this.__data__,t=e.delete(i);return this.size=e.size,t}function am(i){return this.__data__.get(i)}function rm(i){return this.__data__.has(i)}var lm=200;function cm(i,e){var t=this.__data__;if(t instanceof It){var n=t.__data__;if(!Za||n.length<lm-1)return n.push([i,e]),this.size=++t.size,this;t=this.__data__=new ui(n)}return t.set(i,e),this.size=t.size,this}function fi(i){var e=this.__data__=new It(i);this.size=e.size}fi.prototype.clear=sm,fi.prototype.delete=om,fi.prototype.get=am,fi.prototype.has=rm,fi.prototype.set=cm;var ir=typeof V=="object"&&V&&!V.nodeType&&V,nr=ir&&typeof module=="object"&&module&&!module.nodeType&&module,dm=nr&&nr.exports===ir,sr=dm?$t.Buffer:void 0;sr&&sr.allocUnsafe;function hm(i,e){return i.slice()}var or=$t.Uint8Array;function um(i){var e=new i.constructor(i.byteLength);return new or(e).set(new or(i)),e}function fm(i,e){var t=um(i.buffer);return new i.constructor(t,i.byteOffset,i.length)}function mm(i){return typeof i.constructor=="function"&&!Va(i)?Eu(er(i)):{}}function gm(i){return function(e,t,n){for(var s=-1,o=Object(e),r=n(e),l=r.length;l--;){var c=r[++s];if(t(o[c],c,o)===!1)break}return e}}var pm=gm(),io=function(){return $t.Date.now()},Am="Expected a function",ym=Math.max,Em=Math.min;function Hn(i,e,t){var n,s,o,r,l,c,d=0,h=!1,f=!1,m=!0;if(typeof i!="function")throw new TypeError(Am);e=Na(e)||0,pt(t)&&(h=!!t.leading,f="maxWait"in t,o=f?ym(Na(t.maxWait)||0,e):o,m="trailing"in t?!!t.trailing:m);function u(M){var B=n,_=s;return n=s=void 0,d=M,r=i.apply(_,B),r}function g(M){return d=M,l=setTimeout(y,e),h?u(M):r}function A(M){var B=M-c,_=M-d,E=e-B;return f?Em(E,o-_):E}function p(M){var B=M-c,_=M-d;return c===void 0||B>=e||B<0||f&&_>=o}function y(){var M=io();if(p(M))return C(M);l=setTimeout(y,A(M))}function C(M){return l=void 0,m&&n?u(M):(n=s=void 0,r)}function I(){l!==void 0&&clearTimeout(l),d=0,n=c=s=l=void 0}function P(){return l===void 0?r:C(io())}function k(){var M=io(),B=p(M);if(n=arguments,s=this,c=M,B){if(l===void 0)return g(c);if(f)return clearTimeout(l),l=setTimeout(y,e),u(c)}return l===void 0&&(l=setTimeout(y,e)),r}return k.cancel=I,k.flush=P,k}function no(i,e,t){(t!==void 0&&!Un(i[e],t)||t===void 0&&!(e in i))&&Js(i,e,t)}function Cm(i){return hi(i)&&Zs(i)}function so(i,e){if(!(e==="constructor"&&typeof i[e]=="function")&&e!="__proto__")return i[e]}function vm(i){return Nu(i,Ja(i))}function bm(i,e,t,n,s,o,r){var l=so(i,t),c=so(e,t),d=r.get(c);if(d){no(i,t,d);return}var h=o?o(l,c,t+"",i,e,r):void 0,f=h===void 0;if(f){var m=On(c),u=!m&&Wa(c),g=!m&&!u&&Xa(c);h=c,m||u||g?On(l)?h=l:Cm(l)?h=vu(l):u?(f=!1,h=hm(c)):g?(f=!1,h=fm(c)):h=[]:nm(c)||eo(c)?(h=l,eo(l)?h=vm(l):(!pt(l)||Ks(l))&&(h=mm(c))):f=!1}f&&(r.set(c,h),s(h,c,n,o,r),r.delete(c)),no(i,t,h)}function ar(i,e,t,n,s){i!==e&&pm(e,function(o,r){if(s||(s=new fi),pt(o))bm(i,e,r,t,ar,n,s);else{var l=n?n(so(i,r),o,r+"",i,e,s):void 0;l===void 0&&(l=o),no(i,r,l)}},Ja)}var wm=Gu(function(i,e,t){ar(i,e,t)});function oo({Cesium:i,tileset:e}){const t=e.leiting;if(!t||!t.model||!t.model.formData)return;const n=t.model.formData,s=t.box,o=i.Quaternion.fromAxisAngle(i.Cartesian3.UNIT_Z,i.Math.toRadians(n.totalRotation||0)),r=i.Matrix4.fromRotationTranslation(i.Matrix3.fromQuaternion(o),i.Cartesian3.ZERO),l=i.Cartesian3.fromDegrees(n.longitude,n.latitude,n.height),c=i.Transforms.eastNorthUpToFixedFrame(l),d=i.Matrix4.multiply(c,r,new i.Matrix4);if(e._root){if(!s){e._root.transform=d;return}try{const{center:h}=s,f=e.root.boundingVolume.boundingSphere,m=new i.Cartesian3(h.x,h.y,0),u=i.Matrix4.multiplyByPoint(d,m,new i.Cartesian3),g=i.Cartographic.fromCartesian(u),A=f.center,p=i.Transforms.eastNorthUpToFixedFrame(new i.Cartesian3(A.x,A.y,A.z)),y=new i.Cartesian3(-h.x+(n.X||0),-h.y+(n.Y||0),n.Z||0),C=i.Matrix4.fromTranslation(y),I=i.Matrix4.multiply(r,C,new i.Matrix4),P=i.Cartesian3.fromDegrees(g.longitude/Math.PI*180,g.latitude/Math.PI*180,n.height),k=i.Transforms.eastNorthUpToFixedFrame(P),M=i.Matrix4.multiply(k,I,new i.Matrix4);i.Matrix4.multiply(p,I,p),e._root.transform=M}catch(h){console.error("Update model position failed:",h)}}}const mi={NotLoaded:0,Loading:1,Loaded:2,Error:3},qt=4294967295,At=65535,ao=255,Im=8,rr=9,Sm=0,xm=99,Mm=67324752,lr=134695760,Bm=lr,cr=33639248,Tm=101010256,dr=101075792,Pm=117853008,gi=22,ro=20,lo=56,_m=12,Dm=20,hr=4,km=1,Nm=39169,Rm=10,Fm=1,Lm=21589,Om=28789,Gm=25461,Um=6534,Vm=30837,Qm=30805,ur=1,Hm=6,fr=8,mr=2048,Ym=16,zm=1,jm=2,Wm=4,$m=32,gr=61440,co=16384,ho=73,Km=420,qm=2048,Xm=1024,Jm=512,Zm="/",uo=30,eg=10,tg=14,ig=18,Ee=void 0,_t="undefined",Xt="function",ng=64;let pr=2;try{typeof navigator!=_t&&navigator.hardwareConcurrency&&(pr=navigator.hardwareConcurrency)}catch{}const sg={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:64*1024,maxWorkers:pr,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,CompressionStream:typeof CompressionStream!=_t&&CompressionStream,DecompressionStream:typeof DecompressionStream!=_t&&DecompressionStream},Ar=Object.assign({},sg);function og(){return Ar}function ag(i){return Math.max(i.chunkSize,ng)}function Yn(i){const{baseURI:e,chunkSize:t,maxWorkers:n,terminateWorkerTimeout:s,useCompressionStream:o,useWebWorkers:r,CompressionStream:l,DecompressionStream:c,CompressionStreamZlib:d,DecompressionStreamZlib:h,workerURI:f,wasmURI:m}=i;it("baseURI",e),it("wasmURI",m),it("workerURI",f),it("chunkSize",t),it("maxWorkers",n),it("terminateWorkerTimeout",s),it("useCompressionStream",o),it("useWebWorkers",r),it("CompressionStream",l),it("DecompressionStream",c),it("CompressionStreamZlib",d),it("DecompressionStreamZlib",h)}function it(i,e){e!==Ee&&(Ar[i]=e)}function rg(i){let e;i({workerURI:()=>(e||(e="data:text/javascript,"+encodeURIComponent(`(t=>{"function"==typeof define&&define.amd?define(t):t()})(function(){"use strict";const{Array:t,Object:e,Number:n,Math:s,Error:r,Uint8Array:o,Uint16Array:i,Uint32Array:c,Int32Array:a,Map:h,DataView:f,Promise:l,TextEncoder:u,crypto:w,postMessage:p,TransformStream:d,ReadableStream:y,WritableStream:m,CompressionStream:g,DecompressionStream:S}=self,b=void 0,v="undefined",k="function",z=[];for(let t=0;256>t;t++){let e=t;for(let t=0;8>t;t++)1&e?e=e>>>1^3988292384:e>>>=1;z[t]=e}class C{constructor(t){this.t=t||-1}append(t){let e=0|this.t;for(let n=0,s=0|t.length;s>n;n++)e=e>>>8^z[255&(e^t[n])];this.t=e}get(){return~this.t}}class A extends d{constructor(){let t;const e=new C;super({transform(t,n){e.append(t),n.enqueue(t)},flush(){const n=new o(4);new f(n.buffer).setUint32(0,e.get()),t.value=n}}),t=this}}const x={concat(t,e){if(0===t.length||0===e.length)return t.concat(e);const n=t[t.length-1],s=x.o(n);return 32===s?t.concat(e):x.i(e,s,0|n,t.slice(0,t.length-1))},h(t){const e=t.length;if(0===e)return 0;const n=t[e-1];return 32*(e-1)+x.o(n)},l(t,e){if(32*t.length<e)return t;const n=(t=t.slice(0,s.ceil(e/32))).length;return e&=31,n>0&&e&&(t[n-1]=x.u(e,t[n-1]&2147483648>>e-1,1)),t},u:(t,e,n)=>32===t?e:(n?0|e:e<<32-t)+1099511627776*t,o:t=>s.round(t/1099511627776)||32,i(t,e,n,s){for(void 0===s&&(s=[]);e>=32;e-=32)s.push(n),n=0;if(0===e)return s.concat(t);for(let r=0;r<t.length;r++)s.push(n|t[r]>>>e),n=t[r]<<32-e;const r=t.length?t[t.length-1]:0,o=x.o(r);return s.push(x.u(e+o&31,e+o>32?n:s.pop(),1)),s}},I={bytes:{p(t){const e=x.h(t)/8,n=new o(e);let s;for(let r=0;e>r;r++)3&r||(s=t[r/4]),n[r]=s>>>24,s<<=8;return n},m(t){const e=[];let n,s=0;for(n=0;n<t.length;n++)s=s<<8|t[n],3&~n||(e.push(s),s=0);return 3&n&&e.push(x.u(8*(3&n),s)),e}}},R=class{constructor(t){const e=this;e.blockSize=512,e.S=[1732584193,4023233417,2562383102,271733878,3285377520],e.v=[1518500249,1859775393,2400959708,3395469782],t?(e.k=t.k.slice(0),e.C=t.C.slice(0),e.A=t.A):e.reset()}reset(){const t=this;return t.k=t.S.slice(0),t.C=[],t.A=0,t}update(t){const e=this;"string"==typeof t&&(t=I.I.m(t));const n=e.C=x.concat(e.C,t),s=e.A,o=e.A=s+x.h(t);if(o>9007199254740991)throw new r("Cannot hash more than 2^53 - 1 bits");const i=new c(n);let a=0;for(let t=e.blockSize+s-(e.blockSize+s&e.blockSize-1);o>=t;t+=e.blockSize)e.R(i.subarray(16*a,16*(a+1))),a+=1;return n.splice(0,16*a),e}P(){const t=this;let e=t.C;const n=t.k;e=x.concat(e,[x.u(1,1)]);for(let t=e.length+2;15&t;t++)e.push(0);for(e.push(s.floor(t.A/4294967296)),e.push(0|t.A);e.length;)t.R(e.splice(0,16));return t.reset(),n}U(t,e,n,s){return t>19?t>39?t>59?t>79?void 0:e^n^s:e&n|e&s|n&s:e^n^s:e&n|~e&s}V(t,e){return e<<t|e>>>32-t}R(e){const n=this,r=n.k,o=t(80);for(let t=0;16>t;t++)o[t]=e[t];let i=r[0],c=r[1],a=r[2],h=r[3],f=r[4];for(let t=0;79>=t;t++){16>t||(o[t]=n.V(1,o[t-3]^o[t-8]^o[t-14]^o[t-16]));const e=n.V(5,i)+n.U(t,c,a,h)+f+o[t]+n.v[s.floor(t/20)]|0;f=h,h=a,a=n.V(30,c),c=i,i=e}r[0]=r[0]+i|0,r[1]=r[1]+c|0,r[2]=r[2]+a|0,r[3]=r[3]+h|0,r[4]=r[4]+f|0}},P={getRandomValues(t){const e=new c(t.buffer),n=t=>{let e=987654321;const n=4294967295;return()=>(e=36969*(65535&e)+(e>>16)&n,(((e<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n)/4294967296+.5)*(s.random()>.5?1:-1))};for(let r,o=0;o<t.length;o+=4){const t=n(4294967296*(r||s.random()));r=987654071*t(),e[o/4]=4294967296*t()|0}return t}},U={importKey:t=>new U.M(I.bytes.m(t)),_(t,e,n,s){if(n=n||1e4,0>s||0>n)throw new r("invalid params to pbkdf2");const o=1+(s>>5)<<2;let i,c,a,h,l;const u=new ArrayBuffer(o),w=new f(u);let p=0;const d=x;for(e=I.bytes.m(e),l=1;(o||1)>p;l++){for(i=c=t.encrypt(d.concat(e,[l])),a=1;n>a;a++)for(c=t.encrypt(c),h=0;h<c.length;h++)i[h]^=c[h];for(a=0;(o||1)>p&&a<i.length;a++)w.setInt32(p,i[a]),p+=4}return u.slice(0,s/8)},M:class{constructor(t){const e=this,n=e.B=R,s=[[],[]];e.D=[new n,new n];const r=e.D[0].blockSize/32;t.length>r&&(t=(new n).update(t).P());for(let e=0;r>e;e++)s[0][e]=909522486^t[e],s[1][e]=1549556828^t[e];e.D[0].update(s[0]),e.D[1].update(s[1]),e.W=new n(e.D[0])}reset(){const t=this;t.W=new t.B(t.D[0]),t.K=!1}update(t){this.K=!0,this.W.update(t)}digest(){const t=this,e=t.W.P(),n=new t.B(t.D[1]).update(e).P();return t.reset(),n}encrypt(t){if(this.K)throw new r("encrypt on already updated hmac called!");return this.update(t),this.digest(t)}}},V=typeof w!=v&&typeof w.getRandomValues==k,M="Invalid password",_="Invalid signature",B="zipjs-abort-check-password";function D(t){return V?w.getRandomValues(t):P.getRandomValues(t)}const W=16,K={name:"PBKDF2"},E=e.assign({hash:{name:"HMAC"}},K),L=e.assign({iterations:1e3,hash:{name:"SHA-1"}},K),O=["deriveBits"],T=[8,12,16],j=[16,24,32],H=10,Z=[0,0,0,0],F=typeof w!=v,N=F&&w.subtle,q=F&&typeof N!=v,G=I.bytes,J=class{constructor(t){const e=this;e.L=[[[],[],[],[],[]],[[],[],[],[],[]]],e.L[0][0][0]||e.O();const n=e.L[0][4],s=e.L[1],o=t.length;let i,c,a,h=1;if(4!==o&&6!==o&&8!==o)throw new r("invalid aes key size");for(e.v=[c=t.slice(0),a=[]],i=o;4*o+28>i;i++){let t=c[i-1];(i%o===0||8===o&&i%o===4)&&(t=n[t>>>24]<<24^n[t>>16&255]<<16^n[t>>8&255]<<8^n[255&t],i%o===0&&(t=t<<8^t>>>24^h<<24,h=h<<1^283*(h>>7))),c[i]=c[i-o]^t}for(let t=0;i;t++,i--){const e=c[3&t?i:i-4];a[t]=4>=i||4>t?e:s[0][n[e>>>24]]^s[1][n[e>>16&255]]^s[2][n[e>>8&255]]^s[3][n[255&e]]}}encrypt(t){return this.T(t,0)}decrypt(t){return this.T(t,1)}O(){const t=this.L[0],e=this.L[1],n=t[4],s=e[4],r=[],o=[];let i,c,a,h;for(let t=0;256>t;t++)o[(r[t]=t<<1^283*(t>>7))^t]=t;for(let f=i=0;!n[f];f^=c||1,i=o[i]||1){let o=i^i<<1^i<<2^i<<3^i<<4;o=o>>8^255&o^99,n[f]=o,s[o]=f,h=r[a=r[c=r[f]]];let l=16843009*h^65537*a^257*c^16843008*f,u=257*r[o]^16843008*o;for(let n=0;4>n;n++)t[n][f]=u=u<<24^u>>>8,e[n][o]=l=l<<24^l>>>8}for(let n=0;5>n;n++)t[n]=t[n].slice(0),e[n]=e[n].slice(0)}T(t,e){if(4!==t.length)throw new r("invalid aes block size");const n=this.v[e],s=n.length/4-2,o=[0,0,0,0],i=this.L[e],c=i[0],a=i[1],h=i[2],f=i[3],l=i[4];let u,w,p,d=t[0]^n[0],y=t[e?3:1]^n[1],m=t[2]^n[2],g=t[e?1:3]^n[3],S=4;for(let t=0;s>t;t++)u=c[d>>>24]^a[y>>16&255]^h[m>>8&255]^f[255&g]^n[S],w=c[y>>>24]^a[m>>16&255]^h[g>>8&255]^f[255&d]^n[S+1],p=c[m>>>24]^a[g>>16&255]^h[d>>8&255]^f[255&y]^n[S+2],g=c[g>>>24]^a[d>>16&255]^h[y>>8&255]^f[255&m]^n[S+3],S+=4,d=u,y=w,m=p;for(let t=0;4>t;t++)o[e?3&-t:t]=l[d>>>24]<<24^l[y>>16&255]<<16^l[m>>8&255]<<8^l[255&g]^n[S++],u=d,d=y,y=m,m=g,g=u;return o}},Q=class{constructor(t,e){this.j=t,this.H=e,this.Z=e}reset(){this.Z=this.H}update(t){return this.F(this.j,t,this.Z)}N(t){if(255&~(t>>24))t+=1<<24;else{let e=t>>16&255,n=t>>8&255,s=255&t;255===e?(e=0,255===n?(n=0,255===s?s=0:++s):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=s}return t}q(t){0===(t[0]=this.N(t[0]))&&(t[1]=this.N(t[1]))}F(t,e,n){let s;if(!(s=e.length))return[];const r=x.h(e);for(let r=0;s>r;r+=4){this.q(n);const s=t.encrypt(n);e[r]^=s[0],e[r+1]^=s[1],e[r+2]^=s[2],e[r+3]^=s[3]}return x.l(e,r)}},X=U.M;let Y=F&&q&&typeof N.importKey==k,$=F&&q&&typeof N.deriveBits==k;class tt extends d{constructor({password:t,rawPassword:n,signed:s,encryptionStrength:i,checkPasswordOnly:c}){super({start(){e.assign(this,{ready:new l(t=>this.G=t),password:rt(t,n),signed:s,J:i-1,pending:new o})},async transform(t,e){const n=this,{password:s,J:i,G:a,ready:h}=n;s?(await(async(t,e,n,s)=>{const o=await st(t,e,n,it(s,0,T[e])),i=it(s,T[e]);if(o[0]!=i[0]||o[1]!=i[1])throw new r(M)})(n,i,s,it(t,0,T[i]+2)),t=it(t,T[i]+2),c?e.error(new r(B)):a()):await h;const f=new o(t.length-H-(t.length-H)%W);e.enqueue(nt(n,t,f,0,H,!0))},async flush(t){const{signed:e,X:n,Y:s,pending:i,ready:c}=this;if(s&&n){await c;const a=it(i,0,i.length-H),h=it(i,i.length-H);let f=new o;if(a.length){const t=at(G,a);s.update(t);const e=n.update(t);f=ct(G,e)}if(e){const t=it(ct(G,s.digest()),0,H);for(let e=0;H>e;e++)if(t[e]!=h[e])throw new r(_)}t.enqueue(f)}}})}}class et extends d{constructor({password:t,rawPassword:n,encryptionStrength:s}){let r;super({start(){e.assign(this,{ready:new l(t=>this.G=t),password:rt(t,n),J:s-1,pending:new o})},async transform(t,e){const n=this,{password:s,J:r,G:i,ready:c}=n;let a=new o;s?(a=await(async(t,e,n)=>{const s=D(new o(T[e]));return ot(s,await st(t,e,n,s))})(n,r,s),i()):await c;const h=new o(a.length+t.length-t.length%W);h.set(a,0),e.enqueue(nt(n,t,h,a.length,0))},async flush(t){const{X:e,Y:n,pending:s,ready:i}=this;if(n&&e){await i;let c=new o;if(s.length){const t=e.update(at(G,s));n.update(t),c=ct(G,t)}r.signature=ct(G,n.digest()).slice(0,H),t.enqueue(ot(c,r.signature))}}}),r=this}}function nt(t,e,n,s,r,i){const{X:c,Y:a,pending:h}=t,f=e.length-r;let l;for(h.length&&(e=ot(h,e),n=((t,e)=>{if(e&&e>t.length){const n=t;(t=new o(e)).set(n,0)}return t})(n,f-f%W)),l=0;f-W>=l;l+=W){const t=at(G,it(e,l,l+W));i&&a.update(t);const r=c.update(t);i||a.update(r),n.set(ct(G,r),l+s)}return t.pending=it(e,l),n}async function st(n,s,r,i){n.password=null;const c=await(async(t,e,n,s,r)=>{if(!Y)return U.importKey(e);try{return await N.importKey("raw",e,n,!1,r)}catch{return Y=!1,U.importKey(e)}})(0,r,E,0,O),a=await(async(t,e,n)=>{if(!$)return U._(e,t.salt,L.iterations,n);try{return await N.deriveBits(t,e,n)}catch{return $=!1,U._(e,t.salt,L.iterations,n)}})(e.assign({salt:i},L),c,8*(2*j[s]+2)),h=new o(a),f=at(G,it(h,0,j[s])),l=at(G,it(h,j[s],2*j[s])),u=it(h,2*j[s]);return e.assign(n,{keys:{key:f,$:l,passwordVerification:u},X:new Q(new J(f),t.from(Z)),Y:new X(l)}),u}function rt(t,e){return e===b?(t=>{if(typeof u==v){const e=new o((t=unescape(encodeURIComponent(t))).length);for(let n=0;n<e.length;n++)e[n]=t.charCodeAt(n);return e}return(new u).encode(t)})(t):e}function ot(t,e){let n=t;return t.length+e.length&&(n=new o(t.length+e.length),n.set(t,0),n.set(e,t.length)),n}function it(t,e,n){return t.subarray(e,n)}function ct(t,e){return t.p(e)}function at(t,e){return t.m(e)}class ht extends d{constructor({password:t,passwordVerification:n,checkPasswordOnly:s}){super({start(){e.assign(this,{password:t,passwordVerification:n}),wt(this,t)},transform(t,e){const n=this;if(n.password){const e=lt(n,t.subarray(0,12));if(n.password=null,e.at(-1)!=n.passwordVerification)throw new r(M);t=t.subarray(12)}s?e.error(new r(B)):e.enqueue(lt(n,t))}})}}class ft extends d{constructor({password:t,passwordVerification:n}){super({start(){e.assign(this,{password:t,passwordVerification:n}),wt(this,t)},transform(t,e){const n=this;let s,r;if(n.password){n.password=null;const e=D(new o(12));e[11]=n.passwordVerification,s=new o(t.length+e.length),s.set(ut(n,e),0),r=12}else s=new o(t.length),r=0;s.set(ut(n,t),r),e.enqueue(s)}})}}function lt(t,e){const n=new o(e.length);for(let s=0;s<e.length;s++)n[s]=dt(t)^e[s],pt(t,n[s]);return n}function ut(t,e){const n=new o(e.length);for(let s=0;s<e.length;s++)n[s]=dt(t)^e[s],pt(t,e[s]);return n}function wt(t,n){const s=[305419896,591751049,878082192];e.assign(t,{keys:s,tt:new C(s[0]),et:new C(s[2])});for(let e=0;e<n.length;e++)pt(t,n.charCodeAt(e))}function pt(t,e){let[n,r,o]=t.keys;t.tt.append([e]),n=~t.tt.get(),r=mt(s.imul(mt(r+yt(n)),134775813)+1),t.et.append([r>>>24]),o=~t.et.get(),t.keys=[n,r,o]}function dt(t){const e=2|t.keys[2];return yt(s.imul(e,1^e)>>>8)}function yt(t){return 255&t}function mt(t){return 4294967295&t}class gt extends d{constructor(t,{chunkSize:e,nt:n,CompressionStream:s}){super({});const{compressed:r,encrypted:o,useCompressionStream:i,zipCrypto:c,signed:a,level:h}=t,l=this;let u,w,p=super.readable;o&&!c||!a||(u=new A,p=kt(p,u)),r&&(p=vt(p,i,{level:h,chunkSize:e},s,n,s)),o&&(c?p=kt(p,new ft(t)):(w=new et(t),p=kt(p,w))),bt(l,p,()=>{let t;o&&!c&&(t=w.signature),o&&!c||!a||(t=new f(u.value.buffer).getUint32(0)),l.signature=t})}}class St extends d{constructor(t,{chunkSize:e,st:n,DecompressionStream:s}){super({});const{zipCrypto:o,encrypted:i,signed:c,signature:a,compressed:h,useCompressionStream:l,rt:u}=t;let w,p,d=super.readable;i&&(o?d=kt(d,new ht(t)):(p=new tt(t),d=kt(d,p))),h&&(d=vt(d,l,{chunkSize:e,rt:u},s,n,s)),i&&!o||!c||(w=new A,d=kt(d,w)),bt(this,d,()=>{if((!i||o)&&c){const t=new f(w.value.buffer);if(a!=t.getUint32(0,!1))throw new r(_)}})}}function bt(t,n,s){n=kt(n,new d({flush:s})),e.defineProperty(t,"readable",{get:()=>n})}function vt(t,e,n,s,r,o){const i=e&&s?s:r||o,c=n.rt?"deflate64-raw":"deflate-raw";try{t=kt(t,new i(c,n))}catch(s){if(!e)throw s;if(r)t=kt(t,new r(c,n));else{if(!o)throw s;t=kt(t,new o(c,n))}}return t}function kt(t,e){return t.pipeThrough(e)}const zt="data",Ct="close";class At extends d{constructor(t,n){super({});const s=this,{codecType:o}=t;let i;o.startsWith("deflate")?i=gt:o.startsWith("inflate")&&(i=St),s.outputSize=0;let c=0;const a=new i(t,n),h=super.readable,f=new d({transform(t,e){t&&t.length&&(c+=t.length,e.enqueue(t))},flush(){e.assign(s,{inputSize:c})}}),l=new d({transform(e,n){if(e&&e.length&&(n.enqueue(e),s.outputSize+=e.length,t.outputSize!==b&&s.outputSize>t.outputSize))throw new r("Invalid uncompressed size")},flush(){const{signature:t}=a;e.assign(s,{signature:t,inputSize:c})}});e.defineProperty(s,"readable",{get:()=>h.pipeThrough(f).pipeThrough(a).pipeThrough(l)})}}class xt extends d{constructor(t){let e;super({transform:function n(s,r){if(e){const t=new o(e.length+s.length);t.set(e),t.set(s,e.length),s=t,e=null}s.length>t?(r.enqueue(s.slice(0,t)),n(s.slice(t),r)):e=s},flush(t){e&&e.length&&t.enqueue(e)}})}}const It=new h,Rt=new h;let Pt,Ut,Vt,Mt,_t,Bt=0;async function Dt(t){try{const{options:e,config:s}=t;if(!e.useCompressionStream)try{await self.initModule(t.config)}catch{e.useCompressionStream=!0}s.CompressionStream=self.CompressionStream,s.DecompressionStream=self.DecompressionStream;const r={highWaterMark:1},o=t.readable||new y({async pull(t){const e=new l(t=>It.set(Bt,t));Wt({type:"pull",messageId:Bt}),Bt=(Bt+1)%n.MAX_SAFE_INTEGER;const{value:s,done:r}=await e;t.enqueue(s),r&&t.close()}},r),i=t.writable||new m({async write(t){let e;const s=new l(t=>e=t);Rt.set(Bt,e),Wt({type:zt,value:t,messageId:Bt}),Bt=(Bt+1)%n.MAX_SAFE_INTEGER,await s}},r),c=new At(e,s);Pt=new AbortController;const{signal:a}=Pt;await o.pipeThrough(c).pipeThrough(new xt(s.chunkSize)).pipeTo(i,{signal:a,preventClose:!0,preventAbort:!0}),await i.getWriter().close();const{signature:h,inputSize:f,outputSize:u}=c;Wt({type:Ct,result:{signature:h,inputSize:f,outputSize:u}})}catch(t){t.outputSize=0,Kt(t)}}function Wt(t){let{value:e}=t;if(e)if(e.length)try{e=new o(e),t.value=e.buffer,p(t,[t.value])}catch{p(t)}else p(t);else p(t)}function Kt(t=new r("Unknown error")){const{message:e,stack:n,code:s,name:o,outputSize:i}=t;p({error:{message:e,stack:n,code:s,name:o,outputSize:i}})}function Et(t,e,n={}){const i="number"==typeof n.level?n.level:-1,c="number"==typeof n.ot?n.ot:65536,a="number"==typeof n.it?n.it:65536;return new d({start(){let n;if(this.ct=Vt(c),this.in=Vt(a),this.it=a,this.ht=new o(c),t?(this.ft=Ut.deflate_process,this.lt=Ut.deflate_last_consumed,this.ut=Ut.deflate_end,this.wt=Ut.deflate_new(),n="gzip"===e?Ut.deflate_init_gzip(this.wt,i):"deflate-raw"===e?Ut.deflate_init_raw(this.wt,i):Ut.deflate_init(this.wt,i)):"deflate64-raw"===e?(this.ft=Ut.inflate9_process,this.lt=Ut.inflate9_last_consumed,this.ut=Ut.inflate9_end,this.wt=Ut.inflate9_new(),n=Ut.inflate9_init_raw(this.wt)):(this.ft=Ut.inflate_process,this.lt=Ut.inflate_last_consumed,this.ut=Ut.inflate_end,this.wt=Ut.inflate_new(),n="deflate-raw"===e?Ut.inflate_init_raw(this.wt):"gzip"===e?Ut.inflate_init_gzip(this.wt):Ut.inflate_init(this.wt)),0!==n)throw new r("init failed:"+n)},transform(e,n){try{const i=e,a=new o(_t.buffer),h=this.ft,f=this.lt,l=this.ct,u=this.ht;let w=0;for(;w<i.length;){const e=s.min(i.length-w,32768);this.in&&this.it>=e||(this.in&&Mt&&Mt(this.in),this.in=Vt(e),this.it=e),a.set(i.subarray(w,w+e),this.in);const o=h(this.wt,this.in,e,l,c,0),p=16777215&o;if(p&&(u.set(a.subarray(l,l+p),0),n.enqueue(u.slice(0,p))),!t){const t=o>>24&255,e=128&t?t-256:t;if(0>e)throw new r("process error:"+e)}const d=f(this.wt);if(0===d)break;w+=d}}catch(t){this.ut&&this.wt&&this.ut(this.wt),this.in&&Mt&&Mt(this.in),this.ct&&Mt&&Mt(this.ct),n.error(t)}},flush(e){try{const n=new o(_t.buffer),s=this.ft,i=this.ct,a=this.ht;for(;;){const o=s(this.wt,0,0,i,c,4),h=16777215&o,f=o>>24&255;if(!t){const t=128&f?f-256:f;if(0>t)throw new r("process error:"+t)}if(h&&(a.set(n.subarray(i,i+h),0),e.enqueue(a.slice(0,h))),1===f||0===h)break}}catch(t){e.error(t)}finally{if(this.ut&&this.wt){const t=this.ut(this.wt);0!==t&&e.error(new r("end error:"+t))}this.in&&Mt&&Mt(this.in),this.ct&&Mt&&Mt(this.ct)}}})}addEventListener("message",({data:t})=>{const{type:e,messageId:n,value:s,done:r}=t;try{if("start"==e&&Dt(t),e==zt){const t=It.get(n);It.delete(n),t({value:new o(s),done:r})}if("ack"==e){const t=Rt.get(n);Rt.delete(n),t()}e==Ct&&Pt.abort()}catch(t){Kt(t)}});class Lt{constructor(t="deflate",e){return Et(!0,t,e)}}class Ot{constructor(t="deflate",e){return Et(!1,t,e)}}let Tt=!1;self.initModule=async t=>{try{const e=await(async(t,{baseURI:e})=>{if(!Tt){let n,s;try{try{s=new URL(t,e)}catch{}const r=await fetch(s);n=await r.arrayBuffer()}catch(e){if(!t.startsWith("data:application/wasm;base64,"))throw e;n=(t=>{const e=t.split(",")[1],n=atob(e),s=n.length,r=new o(s);for(let t=0;s>t;++t)r[t]=n.charCodeAt(t);return r.buffer})(t)}(t=>{if(Ut=t,({malloc:Vt,free:Mt,memory:_t}=Ut),"function"!=typeof Vt||"function"!=typeof Mt||!_t)throw Ut=Vt=Mt=_t=null,new r("Invalid WASM module")})((await WebAssembly.instantiate(n)).instance.exports),Tt=!0}})(t.wasmURI,t);return t.nt=Lt,t.st=Ot,e}catch{}}});
|
|
13
|
-
`)),e)})}const yr=[];for(let i=0;i<256;i++){let e=i;for(let t=0;t<8;t++)e&1?e=e>>>1^3988292384:e=e>>>1;yr[i]=e}class zn{constructor(e){this.crc=e||-1}append(e){let t=this.crc|0;for(let n=0,s=e.length|0;n<s;n++)t=t>>>8^yr[(t^e[n])&255];this.crc=t}get(){return~this.crc}}class Er extends TransformStream{constructor(){let e;const t=new zn;super({transform(n,s){t.append(n),s.enqueue(n)},flush(){const n=new Uint8Array(4);new DataView(n.buffer).setUint32(0,t.get()),e.value=n}}),e=this}}function lg(i){if(typeof TextEncoder==_t){i=unescape(encodeURIComponent(i));const e=new Uint8Array(i.length);for(let t=0;t<e.length;t++)e[t]=i.charCodeAt(t);return e}else return new TextEncoder().encode(i)}const Ye={concat(i,e){if(i.length===0||e.length===0)return i.concat(e);const t=i[i.length-1],n=Ye.getPartial(t);return n===32?i.concat(e):Ye._shiftRight(e,n,t|0,i.slice(0,i.length-1))},bitLength(i){const e=i.length;if(e===0)return 0;const t=i[e-1];return(e-1)*32+Ye.getPartial(t)},clamp(i,e){if(i.length*32<e)return i;i=i.slice(0,Math.ceil(e/32));const t=i.length;return e=e&31,t>0&&e&&(i[t-1]=Ye.partial(e,i[t-1]&2147483648>>e-1,1)),i},partial(i,e,t){return i===32?e:(t?e|0:e<<32-i)+i*1099511627776},getPartial(i){return Math.round(i/1099511627776)||32},_shiftRight(i,e,t,n){for(n===void 0&&(n=[]);e>=32;e-=32)n.push(t),t=0;if(e===0)return n.concat(i);for(let r=0;r<i.length;r++)n.push(t|i[r]>>>e),t=i[r]<<32-e;const s=i.length?i[i.length-1]:0,o=Ye.getPartial(s);return n.push(Ye.partial(e+o&31,e+o>32?t:n.pop(),1)),n}},jn={bytes:{fromBits(i){const t=Ye.bitLength(i)/8,n=new Uint8Array(t);let s;for(let o=0;o<t;o++)(o&3)===0&&(s=i[o/4]),n[o]=s>>>24,s<<=8;return n},toBits(i){const e=[];let t,n=0;for(t=0;t<i.length;t++)n=n<<8|i[t],(t&3)===3&&(e.push(n),n=0);return t&3&&e.push(Ye.partial(8*(t&3),n)),e}}},Cr={};Cr.sha1=class{constructor(i){const e=this;e.blockSize=512,e._init=[1732584193,4023233417,2562383102,271733878,3285377520],e._key=[1518500249,1859775393,2400959708,3395469782],i?(e._h=i._h.slice(0),e._buffer=i._buffer.slice(0),e._length=i._length):e.reset()}reset(){const i=this;return i._h=i._init.slice(0),i._buffer=[],i._length=0,i}update(i){const e=this;typeof i=="string"&&(i=jn.utf8String.toBits(i));const t=e._buffer=Ye.concat(e._buffer,i),n=e._length,s=e._length=n+Ye.bitLength(i);if(s>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");const o=new Uint32Array(t);let r=0;for(let l=e.blockSize+n-(e.blockSize+n&e.blockSize-1);l<=s;l+=e.blockSize)e._block(o.subarray(16*r,16*(r+1))),r+=1;return t.splice(0,16*r),e}finalize(){const i=this;let e=i._buffer;const t=i._h;e=Ye.concat(e,[Ye.partial(1,1)]);for(let n=e.length+2;n&15;n++)e.push(0);for(e.push(Math.floor(i._length/4294967296)),e.push(i._length|0);e.length;)i._block(e.splice(0,16));return i.reset(),t}_f(i,e,t,n){if(i<=19)return e&t|~e&n;if(i<=39)return e^t^n;if(i<=59)return e&t|e&n|t&n;if(i<=79)return e^t^n}_S(i,e){return e<<i|e>>>32-i}_block(i){const e=this,t=e._h,n=Array(80);for(let d=0;d<16;d++)n[d]=i[d];let s=t[0],o=t[1],r=t[2],l=t[3],c=t[4];for(let d=0;d<=79;d++){d>=16&&(n[d]=e._S(1,n[d-3]^n[d-8]^n[d-14]^n[d-16]));const h=e._S(5,s)+e._f(d,o,r,l)+c+n[d]+e._key[Math.floor(d/20)]|0;c=l,l=r,r=e._S(30,o),o=s,s=h}t[0]=t[0]+s|0,t[1]=t[1]+o|0,t[2]=t[2]+r|0,t[3]=t[3]+l|0,t[4]=t[4]+c|0}};const vr={};vr.aes=class{constructor(i){const e=this;e._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],e._tables[0][0][0]||e._precompute();const t=e._tables[0][4],n=e._tables[1],s=i.length;let o,r,l,c=1;if(s!==4&&s!==6&&s!==8)throw new Error("invalid aes key size");for(e._key=[r=i.slice(0),l=[]],o=s;o<4*s+28;o++){let d=r[o-1];(o%s===0||s===8&&o%s===4)&&(d=t[d>>>24]<<24^t[d>>16&255]<<16^t[d>>8&255]<<8^t[d&255],o%s===0&&(d=d<<8^d>>>24^c<<24,c=c<<1^(c>>7)*283)),r[o]=r[o-s]^d}for(let d=0;o;d++,o--){const h=r[d&3?o:o-4];o<=4||d<4?l[d]=h:l[d]=n[0][t[h>>>24]]^n[1][t[h>>16&255]]^n[2][t[h>>8&255]]^n[3][t[h&255]]}}encrypt(i){return this._crypt(i,0)}decrypt(i){return this._crypt(i,1)}_precompute(){const i=this._tables[0],e=this._tables[1],t=i[4],n=e[4],s=[],o=[];let r,l,c,d;for(let h=0;h<256;h++)o[(s[h]=h<<1^(h>>7)*283)^h]=h;for(let h=r=0;!t[h];h^=l||1,r=o[r]||1){let f=r^r<<1^r<<2^r<<3^r<<4;f=f>>8^f&255^99,t[h]=f,n[f]=h,d=s[c=s[l=s[h]]];let m=d*16843009^c*65537^l*257^h*16843008,u=s[f]*257^f*16843008;for(let g=0;g<4;g++)i[g][h]=u=u<<24^u>>>8,e[g][f]=m=m<<24^m>>>8}for(let h=0;h<5;h++)i[h]=i[h].slice(0),e[h]=e[h].slice(0)}_crypt(i,e){if(i.length!==4)throw new Error("invalid aes block size");const t=this._key[e],n=t.length/4-2,s=[0,0,0,0],o=this._tables[e],r=o[0],l=o[1],c=o[2],d=o[3],h=o[4];let f=i[0]^t[0],m=i[e?3:1]^t[1],u=i[2]^t[2],g=i[e?1:3]^t[3],A=4,p,y,C;for(let I=0;I<n;I++)p=r[f>>>24]^l[m>>16&255]^c[u>>8&255]^d[g&255]^t[A],y=r[m>>>24]^l[u>>16&255]^c[g>>8&255]^d[f&255]^t[A+1],C=r[u>>>24]^l[g>>16&255]^c[f>>8&255]^d[m&255]^t[A+2],g=r[g>>>24]^l[f>>16&255]^c[m>>8&255]^d[u&255]^t[A+3],A+=4,f=p,m=y,u=C;for(let I=0;I<4;I++)s[e?3&-I:I]=h[f>>>24]<<24^h[m>>16&255]<<16^h[u>>8&255]<<8^h[g&255]^t[A++],p=f,f=m,m=u,u=g,g=p;return s}};const cg={getRandomValues(i){const e=new Uint32Array(i.buffer),t=n=>{let s=987654321;const o=4294967295;return function(){return s=36969*(s&65535)+(s>>16)&o,n=18e3*(n&65535)+(n>>16)&o,(((s<<16)+n&o)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let n=0,s;n<i.length;n+=4){const o=t((s||Math.random())*4294967296);s=o()*987654071,e[n/4]=o()*4294967296|0}return i}},br={};br.ctrGladman=class{constructor(i,e){this._prf=i,this._initIv=e,this._iv=e}reset(){this._iv=this._initIv}update(i){return this.calculate(this._prf,i,this._iv)}incWord(i){if((i>>24&255)===255){let e=i>>16&255,t=i>>8&255,n=i&255;e===255?(e=0,t===255?(t=0,n===255?n=0:++n):++t):++e,i=0,i+=e<<16,i+=t<<8,i+=n}else i+=1<<24;return i}incCounter(i){(i[0]=this.incWord(i[0]))===0&&(i[1]=this.incWord(i[1]))}calculate(i,e,t){let n;if(!(n=e.length))return[];const s=Ye.bitLength(e);for(let o=0;o<n;o+=4){this.incCounter(t);const r=i.encrypt(t);e[o]^=r[0],e[o+1]^=r[1],e[o+2]^=r[2],e[o+3]^=r[3]}return Ye.clamp(e,s)}};const Jt={importKey(i){return new Jt.hmacSha1(jn.bytes.toBits(i))},pbkdf2(i,e,t,n){if(t=t||1e4,n<0||t<0)throw new Error("invalid params to pbkdf2");const s=(n>>5)+1<<2;let o,r,l,c,d;const h=new ArrayBuffer(s),f=new DataView(h);let m=0;const u=Ye;for(e=jn.bytes.toBits(e),d=1;m<(s||1);d++){for(o=r=i.encrypt(u.concat(e,[d])),l=1;l<t;l++)for(r=i.encrypt(r),c=0;c<r.length;c++)o[c]^=r[c];for(l=0;m<(s||1)&&l<o.length;l++)f.setInt32(m,o[l]),m+=4}return h.slice(0,n/8)}};Jt.hmacSha1=class{constructor(i){const e=this,t=e._hash=Cr.sha1,n=[[],[]];e._baseHash=[new t,new t];const s=e._baseHash[0].blockSize/32;i.length>s&&(i=new t().update(i).finalize());for(let o=0;o<s;o++)n[0][o]=i[o]^909522486,n[1][o]=i[o]^1549556828;e._baseHash[0].update(n[0]),e._baseHash[1].update(n[1]),e._resultHash=new t(e._baseHash[0])}reset(){const i=this;i._resultHash=new i._hash(i._baseHash[0]),i._updated=!1}update(i){const e=this;e._updated=!0,e._resultHash.update(i)}digest(){const i=this,e=i._resultHash.finalize(),t=new i._hash(i._baseHash[1]).update(e).finalize();return i.reset(),t}encrypt(i){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(i),this.digest(i)}};const dg=typeof crypto!=_t&&typeof crypto.getRandomValues==Xt,wr="Invalid password",Ir="Invalid signature",fo="zipjs-abort-check-password";function Sr(i){return dg?crypto.getRandomValues(i):cg.getRandomValues(i)}const pi=16,hg="raw",xr={name:"PBKDF2"},ug={name:"HMAC"},fg="SHA-1",mg=Object.assign({hash:ug},xr),mo=Object.assign({iterations:1e3,hash:{name:fg}},xr),gg=["deriveBits"],Qi=[8,12,16],Hi=[16,24,32],Dt=10,pg=[0,0,0,0],Wn=typeof crypto!=_t,Yi=Wn&&crypto.subtle,Mr=Wn&&typeof Yi!=_t,yt=jn.bytes,Ag=vr.aes,yg=br.ctrGladman,Eg=Jt.hmacSha1;let Br=Wn&&Mr&&typeof Yi.importKey==Xt,Tr=Wn&&Mr&&typeof Yi.deriveBits==Xt;class Cg extends TransformStream{constructor({password:e,rawPassword:t,signed:n,encryptionStrength:s,checkPasswordOnly:o}){super({start(){Object.assign(this,{ready:new Promise(r=>this.resolveReady=r),password:Dr(e,t),signed:n,strength:s-1,pending:new Uint8Array})},async transform(r,l){const c=this,{password:d,strength:h,resolveReady:f,ready:m}=c;d?(await bg(c,h,d,nt(r,0,Qi[h]+2)),r=nt(r,Qi[h]+2),o?l.error(new Error(fo)):f()):await m;const u=new Uint8Array(r.length-Dt-(r.length-Dt)%pi);l.enqueue(Pr(c,r,u,0,Dt,!0))},async flush(r){const{signed:l,ctr:c,hmac:d,pending:h,ready:f}=this;if(d&&c){await f;const m=nt(h,0,h.length-Dt),u=nt(h,h.length-Dt);let g=new Uint8Array;if(m.length){const A=ji(yt,m);d.update(A);const p=c.update(A);g=zi(yt,p)}if(l){const A=nt(zi(yt,d.digest()),0,Dt);for(let p=0;p<Dt;p++)if(A[p]!=u[p])throw new Error(Ir)}r.enqueue(g)}}})}}class vg extends TransformStream{constructor({password:e,rawPassword:t,encryptionStrength:n}){let s;super({start(){Object.assign(this,{ready:new Promise(o=>this.resolveReady=o),password:Dr(e,t),strength:n-1,pending:new Uint8Array})},async transform(o,r){const l=this,{password:c,strength:d,resolveReady:h,ready:f}=l;let m=new Uint8Array;c?(m=await wg(l,d,c),h()):await f;const u=new Uint8Array(m.length+o.length-o.length%pi);u.set(m,0),r.enqueue(Pr(l,o,u,m.length,0))},async flush(o){const{ctr:r,hmac:l,pending:c,ready:d}=this;if(l&&r){await d;let h=new Uint8Array;if(c.length){const f=r.update(ji(yt,c));l.update(f),h=zi(yt,f)}s.signature=zi(yt,l.digest()).slice(0,Dt),o.enqueue(go(h,s.signature))}}}),s=this}}function Pr(i,e,t,n,s,o){const{ctr:r,hmac:l,pending:c}=i,d=e.length-s;c.length&&(e=go(c,e),t=xg(t,d-d%pi));let h;for(h=0;h<=d-pi;h+=pi){const f=ji(yt,nt(e,h,h+pi));o&&l.update(f);const m=r.update(f);o||l.update(m),t.set(zi(yt,m),h+n)}return i.pending=nt(e,h),t}async function bg(i,e,t,n){const s=await _r(i,e,t,nt(n,0,Qi[e])),o=nt(n,Qi[e]);if(s[0]!=o[0]||s[1]!=o[1])throw new Error(wr)}async function wg(i,e,t){const n=Sr(new Uint8Array(Qi[e])),s=await _r(i,e,t,n);return go(n,s)}async function _r(i,e,t,n){i.password=null;const s=await Ig(hg,t,mg,!1,gg),o=await Sg(Object.assign({salt:n},mo),s,8*(Hi[e]*2+2)),r=new Uint8Array(o),l=ji(yt,nt(r,0,Hi[e])),c=ji(yt,nt(r,Hi[e],Hi[e]*2)),d=nt(r,Hi[e]*2);return Object.assign(i,{keys:{key:l,authentication:c,passwordVerification:d},ctr:new yg(new Ag(l),Array.from(pg)),hmac:new Eg(c)}),d}async function Ig(i,e,t,n,s){if(Br)try{return await Yi.importKey(i,e,t,n,s)}catch{return Br=!1,Jt.importKey(e)}else return Jt.importKey(e)}async function Sg(i,e,t){if(Tr)try{return await Yi.deriveBits(i,e,t)}catch{return Tr=!1,Jt.pbkdf2(e,i.salt,mo.iterations,t)}else return Jt.pbkdf2(e,i.salt,mo.iterations,t)}function Dr(i,e){return e===Ee?lg(i):e}function go(i,e){let t=i;return i.length+e.length&&(t=new Uint8Array(i.length+e.length),t.set(i,0),t.set(e,i.length)),t}function xg(i,e){if(e&&e>i.length){const t=i;i=new Uint8Array(e),i.set(t,0)}return i}function nt(i,e,t){return i.subarray(e,t)}function zi(i,e){return i.fromBits(e)}function ji(i,e){return i.toBits(e)}const Wi=12;class Mg extends TransformStream{constructor({password:e,passwordVerification:t,checkPasswordOnly:n}){super({start(){Object.assign(this,{password:e,passwordVerification:t}),Rr(this,e)},transform(s,o){const r=this;if(r.password){const l=kr(r,s.subarray(0,Wi));if(r.password=null,l.at(-1)!=r.passwordVerification)throw new Error(wr);s=s.subarray(Wi)}n?o.error(new Error(fo)):o.enqueue(kr(r,s))}})}}class Bg extends TransformStream{constructor({password:e,passwordVerification:t}){super({start(){Object.assign(this,{password:e,passwordVerification:t}),Rr(this,e)},transform(n,s){const o=this;let r,l;if(o.password){o.password=null;const c=Sr(new Uint8Array(Wi));c[Wi-1]=o.passwordVerification,r=new Uint8Array(n.length+c.length),r.set(Nr(o,c),0),l=Wi}else r=new Uint8Array(n.length),l=0;r.set(Nr(o,n),l),s.enqueue(r)}})}}function kr(i,e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=Fr(i)^e[n],po(i,t[n]);return t}function Nr(i,e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=Fr(i)^e[n],po(i,e[n]);return t}function Rr(i,e){const t=[305419896,591751049,878082192];Object.assign(i,{keys:t,crcKey0:new zn(t[0]),crcKey2:new zn(t[2])});for(let n=0;n<e.length;n++)po(i,e.charCodeAt(n))}function po(i,e){let[t,n,s]=i.keys;i.crcKey0.append([e]),t=~i.crcKey0.get(),n=Or(Math.imul(Or(n+Lr(t)),134775813)+1),i.crcKey2.append([n>>>24]),s=~i.crcKey2.get(),i.keys=[t,n,s]}function Fr(i){const e=i.keys[2]|2;return Lr(Math.imul(e,e^1)>>>8)}function Lr(i){return i&255}function Or(i){return i&4294967295}const Gr="Invalid uncompressed size",Tg="deflate-raw",Pg="deflate64-raw";class _g extends TransformStream{constructor(e,{chunkSize:t,CompressionStreamZlib:n,CompressionStream:s}){super({});const{compressed:o,encrypted:r,useCompressionStream:l,zipCrypto:c,signed:d,level:h}=e,f=this;let m,u,g=super.readable;(!r||c)&&d&&(m=new Er,g=Et(g,m)),o&&(g=Vr(g,l,{level:h,chunkSize:t},s,n,s)),r&&(c?g=Et(g,new Bg(e)):(u=new vg(e),g=Et(g,u))),Ur(f,g,()=>{let A;r&&!c&&(A=u.signature),(!r||c)&&d&&(A=new DataView(m.value.buffer).getUint32(0)),f.signature=A})}}class Dg extends TransformStream{constructor(e,{chunkSize:t,DecompressionStreamZlib:n,DecompressionStream:s}){super({});const{zipCrypto:o,encrypted:r,signed:l,signature:c,compressed:d,useCompressionStream:h,deflate64:f}=e;let m,u,g=super.readable;r&&(o?g=Et(g,new Mg(e)):(u=new Cg(e),g=Et(g,u))),d&&(g=Vr(g,h,{chunkSize:t,deflate64:f},s,n,s)),(!r||o)&&l&&(m=new Er,g=Et(g,m)),Ur(this,g,()=>{if((!r||o)&&l){const A=new DataView(m.value.buffer);if(c!=A.getUint32(0,!1))throw new Error(Ir)}})}}function Ur(i,e,t){e=Et(e,new TransformStream({flush:t})),Object.defineProperty(i,"readable",{get(){return e}})}function Vr(i,e,t,n,s,o){const r=e&&n?n:s||o,l=t.deflate64?Pg:Tg;try{i=Et(i,new r(l,t))}catch(c){if(e)if(s)i=Et(i,new s(l,t));else if(o)i=Et(i,new o(l,t));else throw c;else throw c}return i}function Et(i,e){return i.pipeThrough(e)}const kg="message",Ng="start",Rg="pull",Qr="data",Fg="ack",Hr="close",Lg="deflate",Yr="inflate";class Og extends TransformStream{constructor(e,t){super({});const n=this,{codecType:s}=e;let o;s.startsWith(Lg)?o=_g:s.startsWith(Yr)&&(o=Dg),n.outputSize=0;let r=0;const l=new o(e,t),c=super.readable,d=new TransformStream({transform(f,m){f&&f.length&&(r+=f.length,m.enqueue(f))},flush(){Object.assign(n,{inputSize:r})}}),h=new TransformStream({transform(f,m){if(f&&f.length&&(m.enqueue(f),n.outputSize+=f.length,e.outputSize!==Ee&&n.outputSize>e.outputSize))throw new Error(Gr)},flush(){const{signature:f}=l;Object.assign(n,{signature:f,inputSize:r})}});Object.defineProperty(n,"readable",{get(){return c.pipeThrough(d).pipeThrough(l).pipeThrough(h)}})}}class Gg extends TransformStream{constructor(e){let t;super({transform:n,flush(s){t&&t.length&&s.enqueue(t)}});function n(s,o){if(t){const r=new Uint8Array(t.length+s.length);r.set(t),r.set(s,t.length),s=r,t=null}s.length>e?(o.enqueue(s.slice(0,e)),n(s.slice(e),o)):t=s}}}let zr=typeof Worker!=_t,jr=()=>{};function Ug({initModule:i}){jr=i}class Ao{constructor(e,{readable:t,writable:n},{options:s,config:o,streamOptions:r,useWebWorkers:l,transferStreams:c,workerURI:d},h){const{signal:f}=r;return Object.assign(e,{busy:!0,readable:t.pipeThrough(new Gg(o.chunkSize)).pipeThrough(new Vg(r),{signal:f}),writable:n,options:Object.assign({},s),workerURI:d,transferStreams:c,terminate(){return new Promise(m=>{const{worker:u,busy:g}=e;u?(g?e.resolveTerminated=m:(u.terminate(),m()),e.interface=null):m()})},onTaskFinished(){const{resolveTerminated:m}=e;m&&(e.resolveTerminated=null,e.terminated=!0,e.worker.terminate(),m()),e.busy=!1,h(e)}}),(l&&zr?Qg:Wr)(e,o)}}class Vg extends TransformStream{constructor({onstart:e,onprogress:t,size:n,onend:s}){let o=0;super({async start(){e&&await yo(e,n)},async transform(r,l){o+=r.length,t&&await yo(t,o,n),l.enqueue(r)},async flush(){s&&await yo(s,o)}})}}async function yo(i,...e){try{await i(...e)}catch{}}function Wr(i,e){return{run:()=>Hg(i,e)}}function Qg(i,e){const{baseURI:t,chunkSize:n}=e;let{wasmURI:s}=e;if(!i.interface){typeof s==Xt&&(s=s());let o;try{o=jg(i.workerURI,t,i)}catch{return zr=!1,Wr(i,e)}Object.assign(i,{worker:o,interface:{run:()=>Yg(i,{chunkSize:n,wasmURI:s,baseURI:t})}})}return i.interface}async function Hg({options:i,readable:e,writable:t,onTaskFinished:n},s){let o;try{if(!i.useCompressionStream)try{await jr(s)}catch{i.useCompressionStream=!0}o=new Og(i,s),await e.pipeThrough(o).pipeTo(t,{preventClose:!0,preventAbort:!0});const{signature:r,inputSize:l,outputSize:c}=o;return{signature:r,inputSize:l,outputSize:c}}catch(r){throw o&&(r.outputSize=o.outputSize),r}finally{n()}}async function Yg(i,e){let t,n;const s=new Promise((f,m)=>{t=f,n=m});Object.assign(i,{reader:null,writer:null,resolveResult:t,rejectResult:n,result:s});const{readable:o,options:r}=i,{writable:l,closed:c}=zg(i.writable),d=$n({type:Ng,options:r,config:e,readable:o,writable:l},i);d||Object.assign(i,{reader:o.getReader(),writer:l.getWriter()});const h=await s;return d||await l.getWriter().close(),await c,h}function zg(i){let e;const t=new Promise(s=>e=s);return{writable:new WritableStream({async write(s){const o=i.getWriter();await o.ready,await o.write(s),o.releaseLock()},close(){e()},abort(s){return i.getWriter().abort(s)}}),closed:t}}let $r=!0;function jg(i,e,t){const n={type:"module"};let s,o;if(typeof i==Xt&&(i=i()),i.startsWith("data:")||i.startsWith("blob:"))try{o=new Worker(i)}catch{o=new Worker(i,n)}else{try{s=new URL(i,e)}catch{s=i}o=new Worker(s,n)}return o.addEventListener(kg,r=>Wg(r,t)),o}function $n(i,{worker:e,writer:t,onTaskFinished:n,transferStreams:s}){try{const{value:o,readable:r,writable:l}=i,c=[];if(o&&(i.value=o,c.push(i.value.buffer)),s&&$r?(r&&c.push(r),l&&c.push(l)):i.readable=i.writable=null,c.length)try{return e.postMessage(i,c),!0}catch{$r=!1,i.readable=i.writable=null,e.postMessage(i)}else e.postMessage(i)}catch(o){throw t&&t.releaseLock(),n(),o}}async function Wg({data:i},e){const{type:t,value:n,messageId:s,result:o,error:r}=i,{reader:l,writer:c,resolveResult:d,rejectResult:h,onTaskFinished:f}=e;try{if(r){const{message:u,stack:g,code:A,name:p,outputSize:y}=r,C=new Error(u);Object.assign(C,{stack:g,code:A,name:p,outputSize:y}),m(C)}else{if(t==Rg){const{value:u,done:g}=await l.read();$n({type:Qr,value:u,done:g,messageId:s},e)}t==Qr&&(await c.ready,await c.write(new Uint8Array(n)),$n({type:Fg,messageId:s},e)),t==Hr&&m(null,o)}}catch(u){$n({type:Hr,messageId:s},e),m(u)}function m(u,g){u?h(u):d(g),c&&c.releaseLock(),f()}}let Zt=[];const Eo=[];let Kr=0;async function $g(i,e){const{options:t,config:n}=e,{transferStreams:s,useWebWorkers:o,useCompressionStream:r,compressed:l,signed:c,encrypted:d}=t,{workerURI:h,maxWorkers:f}=n;e.transferStreams=s||s===Ee;const m=!l&&!c&&!d&&!e.transferStreams;return e.useWebWorkers=!m&&(o||o===Ee&&n.useWebWorkers),e.workerURI=e.useWebWorkers&&h?h:Ee,t.useCompressionStream=r||r===Ee&&n.useCompressionStream,(await u()).run();async function u(){const A=Zt.find(p=>!p.busy);if(A)return qr(A),new Ao(A,i,e,g);if(Zt.length<f){const p={indexWorker:Kr};return Kr++,Zt.push(p),new Ao(p,i,e,g)}else return new Promise(p=>Eo.push({resolve:p,stream:i,workerOptions:e}))}function g(A){if(Eo.length){const[{resolve:p,stream:y,workerOptions:C}]=Eo.splice(0,1);p(new Ao(A,y,C,g))}else A.worker?(qr(A),Kg(A,e)):Zt=Zt.filter(p=>p!=A)}}function Kg(i,e){const{config:t}=e,{terminateWorkerTimeout:n}=t;Number.isFinite(n)&&n>=0&&(i.terminated?i.terminated=!1:i.terminateTimeout=setTimeout(async()=>{Zt=Zt.filter(s=>s!=i);try{await i.terminate()}catch{}},n))}function qr(i){const{terminateTimeout:e}=i;e&&(clearTimeout(e),i.terminateTimeout=null)}const qg="Writer iterator completed too soon",Xg="Content-Type",Jg=64*1024,Xr="writable";class Co{constructor(){this.size=0}init(){this.initialized=!0}}class Jr extends Co{get readable(){const e=this,{chunkSize:t=Jg}=e,n=new ReadableStream({start(){this.chunkOffset=0},async pull(s){const{offset:o=0,size:r,diskNumberStart:l}=n,{chunkOffset:c}=this,d=r===Ee?t:Math.min(t,r-c),h=await Le(e,o+c,d,l);s.enqueue(h),c+t>r||r===Ee&&!h.length&&d?s.close():this.chunkOffset+=t}});return n}}class Kn extends Jr{constructor(e){super(),Object.assign(this,{blob:e,size:e.size})}async readUint8Array(e,t){const n=this,s=e+t;let r=await(e||s<n.size?n.blob.slice(e,s):n.blob).arrayBuffer();return r.byteLength>t&&(r=r.slice(e,s)),new Uint8Array(r)}}class Zg extends Co{constructor(e){super();const t=this,n=new TransformStream,s=[];e&&s.push([Xg,e]),Object.defineProperty(t,Xr,{get(){return n.writable}}),t.blob=new Response(n.readable,{headers:s}).blob()}getData(){return this.blob}}class ep extends Zg{constructor(e){super(e),Object.assign(this,{encoding:e,utf8:!e||e.toLowerCase()=="utf-8"})}async getData(){const{encoding:e,utf8:t}=this,n=await super.getData();if(n.text&&t)return n.text();{const s=new FileReader;return new Promise((o,r)=>{Object.assign(s,{onload:({target:l})=>o(l.result),onerror:()=>r(s.error)}),s.readAsText(n,e)})}}}class tp extends Jr{constructor(e){super(),this.readers=e}async init(){const e=this,{readers:t}=e;e.lastDiskNumber=0,e.lastDiskOffset=0,await Promise.all(t.map(async(n,s)=>{await n.init(),s!=t.length-1&&(e.lastDiskOffset+=n.size),e.size+=n.size})),super.init()}async readUint8Array(e,t,n=0){const s=this,{readers:o}=this;let r,l=n;l==-1&&(l=o.length-1);let c=e;for(;o[l]&&c>=o[l].size;)c-=o[l].size,l++;const d=o[l];if(d){const h=d.size;if(c+t<=h)r=await Le(d,c,t);else{const f=h-c;r=new Uint8Array(t);const m=await Le(d,c,f);r.set(m,0);const u=await s.readUint8Array(e+f,t-f,n);r.set(u,f),m.length+u.length<t&&(r=r.subarray(0,m.length+u.length))}}else r=new Uint8Array;return s.lastDiskNumber=Math.max(l,s.lastDiskNumber),r}}class Zr extends Co{constructor(e,t=4294967295){super();const n=this;Object.assign(n,{diskNumber:0,diskOffset:0,size:0,maxSize:t,availableSize:t});let s,o,r;const l=new WritableStream({async write(h){const{availableSize:f}=n;if(r)h.length>=f?(await c(h.subarray(0,f)),await d(),n.diskOffset+=s.size,n.diskNumber++,r=null,await this.write(h.subarray(f))):await c(h);else{const{value:m,done:u}=await e.next();if(u&&!m)throw new Error(qg);s=m,s.size=0,s.maxSize&&(n.maxSize=s.maxSize),n.availableSize=n.maxSize,await qn(s),o=m.writable,r=o.getWriter(),await this.write(h)}},async close(){await r.ready,await d()}});Object.defineProperty(n,Xr,{get(){return l}});async function c(h){const f=h.length;f&&(await r.ready,await r.write(h),s.size+=f,n.size+=f,n.availableSize-=f)}async function d(){await r.close()}}}class ip{constructor(e){return Array.isArray(e)&&(e=new tp(e)),e instanceof ReadableStream&&(e={readable:e}),e}}class np{constructor(e){return e.writable===Ee&&typeof e.next==Xt&&(e=new Zr(e)),e instanceof WritableStream&&(e={writable:e}),e.size===Ee&&(e.size=0),e instanceof Zr||Object.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}}async function qn(i,e){if(i.init&&!i.initialized)await i.init(e);else return Promise.resolve()}function Le(i,e,t,n){return i.readUint8Array(e,t,n)}const el="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(""),sp=el.length==256;function op(i){if(sp){let e="";for(let t=0;t<i.length;t++)e+=el[i[t]];return e}else return new TextDecoder().decode(i)}function Xn(i,e){return e&&e.trim().toLowerCase()=="cp437"?op(i):new TextDecoder(e).decode(i)}const tl="filename",il="rawFilename",nl="comment",sl="rawComment",ol="uncompressedSize",al="compressedSize",rl="offset",ll="diskNumberStart",vo="lastModDate",bo="rawLastModDate",cl="lastAccessDate",ap="rawLastAccessDate",dl="creationDate",hl="rawCreationDate",rp=[tl,il,ol,al,vo,bo,nl,sl,cl,dl,hl,rl,ll,"internalFileAttributes","externalFileAttributes","msdosAttributesRaw","msdosAttributes","msDosCompatible","zip64","encrypted","version","versionMadeBy","zipCrypto","directory","executable","compressionMethod","signature","extraField","extraFieldUnix","extraFieldInfoZip","uid","gid","unixMode","setuid","setgid","sticky","bitFlag","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"];class ul{constructor(e){rp.forEach(t=>this[t]=e[t])}}const lp="filenameEncoding",cp="commentEncoding",dp="decodeText",hp="extractPrependedData",up="extractAppendedData",fp="password",mp="rawPassword",gp="passThrough",pp="signal",Ap="checkPasswordOnly",yp="checkOverlappingEntryOnly",Ep="checkOverlappingEntry",Cp="checkSignature",vp="useWebWorkers",bp="useCompressionStream",wp="transferStreams",Ip="preventClose",wo="File format is not recognized",Sp="End of central directory not found",xp="End of Zip64 central directory locator not found",Mp="Central directory header not found",Bp="Local file header not found",Tp="Zip64 extra field not found",Pp="File contains encrypted entry",_p="Encryption method not supported",fl="Compression method not supported",ml="Split zip file",Dp="Overlapping entry found",gl="utf-8",kp="UTF8",pl="cp437",Np=[[ol,qt],[al,qt],[rl,qt],[ll,At]],Rp={[At]:{getValue:Ce,bytes:4},[qt]:{getValue:Ai,bytes:8}};class Io{constructor(e,t={}){Object.assign(this,{reader:new ip(e),options:t,config:og(),readRanges:[]})}async*getEntriesGenerator(e={}){const t=this;let{reader:n}=t;const{config:s}=t;if(await qn(n),(n.size===Ee||!n.readUint8Array)&&(n=new Kn(await new Response(n.readable).blob()),await qn(n)),n.size<gi)throw new Error(wo);n.chunkSize=ag(s);const o=await Qp(n,Tm,n.size,gi,At*16);if(!o){const w=await Le(n,0,4),D=ve(w);throw Ce(D)==lr?new Error(ml):new Error(Sp)}const r=ve(o);let l=Ce(r,12),c=Ce(r,16);const d=o.offset,h=Fe(r,20),f=d+gi+h;let m=Fe(r,4);const u=n.lastDiskNumber||0;let g=Fe(r,6),A=Fe(r,8),p=0,y=0;if(c==qt||l==qt||A==At||g==At){const w=await Le(n,o.offset-ro,ro),D=ve(w);if(Ce(D,0)==Pm){c=Ai(D,8);let F=await Le(n,c,lo,-1),U=ve(F);const R=o.offset-ro-lo;if(Ce(U,0)!=dr&&c!=R){const b=c;c=R,c>b&&(p=c-b),F=await Le(n,c,lo,-1),U=ve(F)}if(Ce(U,0)!=dr)throw new Error(xp);m==At&&(m=Ce(U,16)),g==At&&(g=Ce(U,20)),A==At&&(A=Ai(U,32)),l==qt&&(l=Ai(U,40)),c-=l}}if(c>=n.size&&(p=n.size-c-l-gi,c=n.size-l-gi),u!=m)throw new Error(ml);if(c<0)throw new Error(wo);let C=0,I=await Le(n,c,l,g),P=ve(I);if(l){const w=o.offset-l;if(Ce(P,C)!=cr&&c!=w){const D=c;c=w,c>D&&(p+=c-D),I=await Le(n,c,l,g),P=ve(I)}}const k=o.offset-c-(n.lastDiskOffset||0);if(l!=k&&k>=0&&(l=k,I=await Le(n,c,l,g),P=ve(I)),c<0||c>=n.size)throw new Error(wo);const M=Oe(t,e,lp),B=Oe(t,e,cp);for(let w=0;w<A;w++){const D=new Fp(n,s,t.options);if(Ce(P,C)!=cr)throw new Error(Mp);Al(D,P,C+6);const F=!!D.bitFlag.languageEncodingFlag,U=C+46,R=U+D.filenameLength,b=R+D.extraFieldLength,v=Fe(P,C+4),x=v>>8==0,N=v>>8==3,O=I.subarray(U,R),Q=Fe(P,C+32),L=b+Q,T=I.subarray(b,L),S=F,G=F,Y=Ce(P,C+38),q=Y&ao,W={readOnly:!!(q&zm),hidden:!!(q&jm),system:!!(q&Wm),directory:!!(q&Ym),archive:!!(q&$m)},re=Ce(P,C+42)+p,ae=Oe(t,e,dp)||Xn,de=S?gl:M||pl,he=G?gl:B||pl;let ge=ae(O,de);ge===Ee&&(ge=Xn(O,de));let De=ae(T,he);De===Ee&&(De=Xn(T,he)),Object.assign(D,{versionMadeBy:v,msDosCompatible:x,compressedSize:0,uncompressedSize:0,commentLength:Q,offset:re,diskNumberStart:Fe(P,C+34),internalFileAttributes:Fe(P,C+36),externalFileAttributes:Y,msdosAttributesRaw:q,msdosAttributes:W,rawFilename:O,filenameUTF8:S,commentUTF8:G,rawExtraField:I.subarray(R,b),rawComment:T,filename:ge,comment:De}),y=Math.max(re,y),yl(D,D,P,C+6);const Re=D.externalFileAttributes>>16&At;D.unixMode===Ee&&(Re&(Km|ho|co))!=0&&(D.unixMode=Re);const We=!!(D.unixMode&qm),Ve=!!(D.unixMode&Xm),et=!!(D.unixMode&Jm),$=D.unixMode!==Ee?(D.unixMode&ho)!=0:N&&(Re&ho)!=0,z=D.unixMode!==Ee&&(D.unixMode&gr)==co,ee=(Re&gr)==co;Object.assign(D,{setuid:We,setgid:Ve,sticky:et,unixExternalUpper:Re,internalFileAttribute:D.internalFileAttributes,externalFileAttribute:D.externalFileAttributes,executable:$,directory:z||ee||x&&W.directory||ge.endsWith(Zm)&&!D.uncompressedSize,zipCrypto:D.encrypted&&!D.extraFieldAES});const ke=new ul(D);ke.getData=(tt,Ri)=>D.getData(tt,ke,t.readRanges,Ri),ke.arrayBuffer=async tt=>{const Ri=new TransformStream,[zt]=await Promise.all([new Response(Ri.readable).arrayBuffer(),D.getData(Ri,ke,t.readRanges,tt)]);return zt},C=L;const{onprogress:rt}=e;if(rt)try{await rt(w+1,A,new ul(D))}catch{}yield ke}const _=Oe(t,e,hp),E=Oe(t,e,up);return _&&(t.prependedData=y>0?await Le(n,0,y):new Uint8Array),t.comment=h?await Le(n,d+gi,h):new Uint8Array,E&&(t.appendedData=f<n.size?await Le(n,f,n.size-f):new Uint8Array),!0}async getEntries(e={}){const t=[];for await(const n of this.getEntriesGenerator(e))t.push(n);return t}async close(){}}class Fp{constructor(e,t,n){Object.assign(this,{reader:e,config:t,options:n})}async getData(e,t,n,s={}){const o=this,{reader:r,offset:l,diskNumberStart:c,extraFieldAES:d,extraFieldZip64:h,compressionMethod:f,config:m,bitFlag:u,signature:g,rawLastModDate:A,uncompressedSize:p,compressedSize:y}=o,{dataDescriptor:C}=u,I=t.localDirectory={},P=await Le(r,l,uo,c),k=ve(P);let M=Oe(o,s,fp),B=Oe(o,s,mp);const _=Oe(o,s,gp);if(M=M&&M.length&&M,B=B&&B.length&&B,d&&d.originalCompressionMethod!=xm)throw new Error(fl);if(f!=Sm&&f!=Im&&f!=rr&&!_)throw new Error(fl);if(Ce(k,0)!=Mm)throw new Error(Bp);Al(I,k,4);const{extraFieldLength:E,filenameLength:w,lastAccessDate:D,creationDate:F}=I;I.rawExtraField=E?await Le(r,l+uo+w,E,c):new Uint8Array,yl(o,I,k,4,!0),Object.assign(t,{lastAccessDate:D,creationDate:F});const U=o.encrypted&&I.encrypted&&!_,R=U&&!d;if(_||(t.zipCrypto=R),U){if(!R&&d.strength===Ee)throw new Error(_p);if(!M&&!B)throw new Error(Pp)}const b=l+uo+w+E,v=y,x=r.readable;Object.assign(x,{diskNumberStart:c,offset:b,size:v});const N=Oe(o,s,pp),O=Oe(o,s,Ap);let Q=Oe(o,s,Ep);const L=Oe(o,s,yp);L&&(Q=!0);const{onstart:T,onprogress:S,onend:G}=s,Y=f==rr;let q=Oe(o,s,bp);Y&&(q=!1);const W={options:{codecType:Yr,password:M,rawPassword:B,zipCrypto:R,encryptionStrength:d&&d.strength,signed:Oe(o,s,Cp)&&!_,passwordVerification:R&&(C?A>>>8&ao:g>>>24&ao),outputSize:_?y:p,signature:g,compressed:f!=0&&!_,encrypted:o.encrypted&&!_,useWebWorkers:Oe(o,s,vp),useCompressionStream:q,transferStreams:Oe(o,s,wp),deflate64:Y,checkPasswordOnly:O},config:m,streamOptions:{signal:N,size:v,onstart:T,onprogress:S,onend:G}};Q&&await Vp({reader:r,fileEntry:t,offset:l,diskNumberStart:c,signature:g,compressedSize:y,uncompressedSize:p,dataOffset:b,dataDescriptor:C||I.bitFlag.dataDescriptor,extraFieldZip64:h||I.extraFieldZip64,readRanges:n});let re;try{if(!L){O&&(e=new WritableStream),e=new np(e),await qn(e,_?y:p),{writable:re}=e;const{outputSize:ae}=await $g({readable:x,writable:re},W);if(e.size+=ae,ae!=(_?y:p))throw new Error(Gr)}}catch(ae){if(ae.outputSize!==Ee&&(e.size+=ae.outputSize),!O||ae.message!=fo)throw ae}finally{!Oe(o,s,Ip)&&re&&!re.locked&&await re.getWriter().close()}return O||L?Ee:e.getData?e.getData():re}}function Al(i,e,t){const n=i.rawBitFlag=Fe(e,t+2),s=(n&ur)==ur,o=Ce(e,t+6);Object.assign(i,{encrypted:s,version:Fe(e,t),bitFlag:{level:(n&Hm)>>1,dataDescriptor:(n&fr)==fr,languageEncodingFlag:(n&mr)==mr},rawLastModDate:o,lastModDate:Hp(o),filenameLength:Fe(e,t+22),extraFieldLength:Fe(e,t+24)})}function yl(i,e,t,n,s){const{rawExtraField:o}=e,r=e.extraField=new Map,l=ve(new Uint8Array(o));let c=0;try{for(;c<o.length;){const C=Fe(l,c),I=Fe(l,c+2);r.set(C,{type:C,data:o.slice(c+4,c+4+I)}),c+=4+I}}catch{}const d=Fe(t,n+4);Object.assign(e,{signature:Ce(t,n+eg),compressedSize:Ce(t,n+tg),uncompressedSize:Ce(t,n+ig)});const h=r.get(km);h&&(Lp(h,e),e.extraFieldZip64=h);const f=r.get(Om);f&&(El(f,tl,il,e,i),e.extraFieldUnicodePath=f);const m=r.get(Gm);m&&(El(m,nl,sl,e,i),e.extraFieldUnicodeComment=m);const u=r.get(Nm);u?(Op(u,e,d),e.extraFieldAES=u):e.compressionMethod=d;const g=r.get(Rm);g&&(Gp(g,e),e.extraFieldNTFS=g);const A=r.get(Qm);if(A)Cl(A,e,!1),e.extraFieldUnix=A;else{const C=r.get(Vm);C&&(Cl(C,e,!0),e.extraFieldInfoZip=C)}const p=r.get(Lm);p&&(Up(p,e,s),e.extraFieldExtendedTimestamp=p);const y=r.get(Um);y&&(e.extraFieldUSDZ=y)}function Lp(i,e){e.zip64=!0;const t=ve(i.data),n=Np.filter(([s,o])=>e[s]==o);for(let s=0,o=0;s<n.length;s++){const[r,l]=n[s];if(e[r]==l){const c=Rp[l];e[r]=i[r]=c.getValue(t,o),o+=c.bytes}else if(i[r])throw new Error(Tp)}}function El(i,e,t,n,s){const o=ve(i.data),r=new zn;r.append(s[t]);const l=ve(new Uint8Array(4));l.setUint32(0,r.get(),!0);const c=Ce(o,1);Object.assign(i,{version:kt(o,0),[e]:Xn(i.data.subarray(5)),valid:!s.bitFlag.languageEncodingFlag&&c==Ce(l,0)}),i.valid&&(n[e]=i[e],n[e+kp]=!0)}function Op(i,e,t){const n=ve(i.data),s=kt(n,4);Object.assign(i,{vendorVersion:kt(n,0),vendorId:kt(n,2),strength:s,originalCompressionMethod:t,compressionMethod:Fe(n,5)}),e.compressionMethod=i.compressionMethod}function Gp(i,e){const t=ve(i.data);let n=4,s;try{for(;n<i.data.length&&!s;){const o=Fe(t,n),r=Fe(t,n+2);o==Fm&&(s=i.data.slice(n+4,n+4+r)),n+=4+r}}catch{}try{if(s&&s.length==24){const o=ve(s),r=o.getBigUint64(0,!0),l=o.getBigUint64(8,!0),c=o.getBigUint64(16,!0);Object.assign(i,{rawLastModDate:r,rawLastAccessDate:l,rawCreationDate:c});const d=So(r),h=So(l),f=So(c),m={lastModDate:d,lastAccessDate:h,creationDate:f};Object.assign(i,m),Object.assign(e,m)}}catch{}}function Cl(i,e,t){try{const n=ve(new Uint8Array(i.data));let s=0;const o=kt(n,s++),r=kt(n,s++),l=i.data.subarray(s,s+r);s+=r;const c=vl(l),d=kt(n,s++),h=i.data.subarray(s,s+d);s+=d;const f=vl(h);let m=Ee;if(!t&&s+2<=i.data.length){const u=i.data;m=new DataView(u.buffer,u.byteOffset+s,2).getUint16(0,!0)}Object.assign(i,{version:o,uid:c,gid:f,unixMode:m}),c!==Ee&&(e.uid=c),f!==Ee&&(e.gid=f),m!==Ee&&(e.unixMode=m)}catch{}}function vl(i){const e=new Uint8Array(4);return e.set(i,0),new DataView(e.buffer,e.byteOffset,4).getUint32(0,!0)}function Up(i,e,t){const n=ve(i.data),s=kt(n,0),o=[],r=[];t?((s&1)==1&&(o.push(vo),r.push(bo)),(s&2)==2&&(o.push(cl),r.push(ap)),(s&4)==4&&(o.push(dl),r.push(hl))):i.data.length>=5&&(o.push(vo),r.push(bo));let l=1;o.forEach((c,d)=>{if(i.data.length>=l+4){const h=Ce(n,l);e[c]=i[c]=new Date(h*1e3);const f=r[d];i[f]=h}l+=4})}async function Vp({reader:i,fileEntry:e,offset:t,diskNumberStart:n,signature:s,compressedSize:o,uncompressedSize:r,dataOffset:l,dataDescriptor:c,extraFieldZip64:d,readRanges:h}){let f=0;if(n)for(let g=0;g<n;g++){const A=i.readers[g];f+=A.size}let m=0;if(c&&(d?m=Dm:m=_m),m){const g=await Le(i,l+o,m+hr,n);if(Ce(ve(g),0)==Bm){const p=Ce(ve(g),4);let y,C;d?(y=Ai(ve(g),8),C=Ai(ve(g),16)):(y=Ce(ve(g),8),C=Ce(ve(g),12)),(e.encrypted&&!e.zipCrypto||p==s)&&y==o&&C==r&&(m+=hr)}}const u={start:f+t,end:f+l+o+m,fileEntry:e};for(const g of h)if(g.fileEntry!=e&&u.start>=g.start&&u.start<g.end){const A=new Error(Dp);throw A.overlappingEntry=g.fileEntry,A}h.push(u)}async function Qp(i,e,t,n,s){const o=new Uint8Array(4),r=ve(o);Yp(r,0,e);const l=n+s;return await c(n)||await c(Math.min(l,t));async function c(d){const h=t-d,f=await Le(i,h,d);for(let m=f.length-n;m>=0;m--)if(f[m]==o[0]&&f[m+1]==o[1]&&f[m+2]==o[2]&&f[m+3]==o[3])return{offset:h+m,buffer:f.slice(m,m+n).buffer}}}function Oe(i,e,t){return e[t]===Ee?i.options[t]:e[t]}function Hp(i){const e=(i&4294901760)>>16,t=i&At;try{return new Date(1980+((e&65024)>>9),((e&480)>>5)-1,e&31,(t&63488)>>11,(t&2016)>>5,(t&31)*2,0)}catch{}}function So(i){return new Date(Number(i/BigInt(1e4)-BigInt(116444736e5)))}function kt(i,e){return i.getUint8(e)}function Fe(i,e){return i.getUint16(e,!0)}function Ce(i,e){return i.getUint32(e,!0)}function Ai(i,e){return Number(i.getBigUint64(e,!0))}function Yp(i,e,t){i.setUint32(e,t,!0)}function ve(i){return new DataView(i.buffer)}try{Yn({baseURI:typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:we&&we.tagName.toUpperCase()==="SCRIPT"&&we.src||new URL("leiting-bim.umd.js",document.baseURI).href})}catch{}const Je="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function zp(i){let e;i({wasmURI:()=>(e||(e="data:application/wasm;base64,"+(t=>{t=(r=>{const l=(r=(r+"").replace(/[^A-Za-z0-9+/=]/g,"")).length,c=[];for(let d=0;l>d;d+=4){const h=Je.indexOf(r[d])<<18|Je.indexOf(r[d+1])<<12|(63&Je.indexOf(r[d+2]))<<6|63&Je.indexOf(r[d+3]);c.push(h>>16&255),r[d+2]!=="="&&c.push(h>>8&255),r[d+3]!=="="&&c.push(255&h)}return new Uint8Array(c)})(t);let n=new Uint8Array(1024),s=0;for(let r=0;r<t.length;){const l=t[r++];if(128&l){const c=3+(127&l),d=t[r++]<<8|t[r++],h=s-d;o(s+c);for(let f=0;c>f;f++)n[s++]=n[h+f]}else{const c=l;o(s+c);for(let d=0;c>d&&r<t.length;d++)n[s++]=t[r++]}}return(r=>{let l="";const c=r.length;let d=0;for(;c>d+2;d+=3){const f=r[d]<<16|r[d+1]<<8|r[d+2];l+=Je[f>>18&63]+Je[f>>12&63]+Je[f>>6&63]+Je[63&f]}const h=c-d;if(h===1){const f=r[d]<<16;l+=Je[f>>18&63]+Je[f>>12&63]+"=="}else if(h===2){const f=r[d]<<16|r[d+1]<<8;l+=Je[f>>18&63]+Je[f>>12&63]+Je[f>>6&63]+"="}return l})(new Uint8Array(n.buffer.slice(0,s)));function o(r){if(n.length<r){let l=2*n.length;for(;r>l;)l*=2;const c=new Uint8Array(l);c.set(n.subarray(0,s)),n=c}}})("FQBhc20BAAAAAUULYAF/AX9gAn9/AIEABYAACwIDf4IABwEBgAARAQaAAAuDAA6BABUDAGAAgAADgAANAQSBABUDAGAHgwAegAAfEgNCQQcABAEABAgIAAIABQIKAIAAB4EAAwEFgQAHAgICgQAHEAEDAAUGAAMDBQQJBAQJAQaAAAEeAAIEAwIEAgIBBAcDAwQFAXABDQ0FBgEBggKCAgYIgACYIkHQ1QQLB4oEHAZtZW1vcnkCAAxpbmZsYXRlOV9uZXcABw2GAA8HaW5pdAAIEYoAEAdfcmF3AAoQhgAUCXByb2Nlc3MAC4cARgZlbmQADhaGAA8QbGFzdF9jb25zdW1lZAARC4QAGYMAbYUANoMAbAEShQBYhwBrARSFAH+DABMHZ3ppcAAVD4UAFIUAfgEWhgBWgQB9AhgVhQAOjQB8AmRliQB8hQAOggB8AhoQiQAPggB8AhsRigATggB8AhwPhQAUhQB8AR2GAFaBAHwJHwRmcmVlAAIVhQAVjACDCgZtYWxsb2MAAQuCAFUKaWFsaXplAAAZX4AADxZkaXJlY3RfZnVuY3Rpb25fdGFibGUBgAAcG2Vtc2NyaXB0ZW5fc3RhY2tfcmVzdG9yZQAFHI4AGwJnZYAAbw51cnJlbnQABiJfX2N4YYAAWwRjcmVtgAASBl9leGNlcIIAXQZyZWZjb3WAACUtPQkSAQBBAQsMACEiDA8XGR4+NTg7CqHlAkECAAu/JwELfyMAQRBrIgokAAJAjwACEiAAQfQBTQRAQaQnKAIAIgNBEIAAEgYLakH4A3GBAAkQSRsiBkEDdi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AyBnqyAqmuEACSBB3OBAE8BCIAACIEAGIUADIEIt4MADAEggQCUgDKEgQBrAYCBCC8BBIMADIA/SAoBABAMAEGRIQv/gCUfgMDAgIKxBQgJCQoKgEk3gAABAQ2AAAEBDoAAAQEPgAABARCEAAEBEYQAAQEShAABAROEAAEBFIwAAQEVjAABARaMAAEBF4wAAQEYnAABARmcAAEBGpwAAQEbmwABARyBffsEBAQFBYHB1QEHgAABAQiEAAGAXSqCAAEBCowAAYAnsooAAYEBMJkAAYEBTJkAAYEBaLkAAYEBpLkAAYIDdYABzoUBvI0BqJ0BkLwBgAIbHLwAAQEdvAABgA9PgH05A9AqAQ==")),e)})}let Se,yi,Ze,$i;function jp(i){if(Se=i,{malloc:yi,free:Ze,memory:$i}=Se,typeof yi!="function"||typeof Ze!="function"||!$i)throw Se=yi=Ze=$i=null,new Error("Invalid WASM module")}function bl(i,e,t={}){const n=typeof t.level=="number"?t.level:-1,s=typeof t.outBuffer=="number"?t.outBuffer:64*1024,o=typeof t.inBufferSize=="number"?t.inBufferSize:64*1024;return new TransformStream({start(){let r;if(this.out=yi(s),this.in=yi(o),this.inBufferSize=o,this._scratch=new Uint8Array(s),i?(this._process=Se.deflate_process,this._last_consumed=Se.deflate_last_consumed,this._end=Se.deflate_end,this.streamHandle=Se.deflate_new(),e==="gzip"?r=Se.deflate_init_gzip(this.streamHandle,n):e==="deflate-raw"?r=Se.deflate_init_raw(this.streamHandle,n):r=Se.deflate_init(this.streamHandle,n)):e==="deflate64-raw"?(this._process=Se.inflate9_process,this._last_consumed=Se.inflate9_last_consumed,this._end=Se.inflate9_end,this.streamHandle=Se.inflate9_new(),r=Se.inflate9_init_raw(this.streamHandle)):(this._process=Se.inflate_process,this._last_consumed=Se.inflate_last_consumed,this._end=Se.inflate_end,this.streamHandle=Se.inflate_new(),e==="deflate-raw"?r=Se.inflate_init_raw(this.streamHandle):e==="gzip"?r=Se.inflate_init_gzip(this.streamHandle):r=Se.inflate_init(this.streamHandle)),r!==0)throw new Error("init failed:"+r)},transform(r,l){try{const c=r,d=new Uint8Array($i.buffer),h=this._process,f=this._last_consumed,m=this.out,u=this._scratch;let g=0;for(;g<c.length;){const A=Math.min(c.length-g,32768);(!this.in||this.inBufferSize<A)&&(this.in&&Ze&&Ze(this.in),this.in=yi(A),this.inBufferSize=A),d.set(c.subarray(g,g+A),this.in);const p=h(this.streamHandle,this.in,A,m,s,0),y=p&16777215;if(y&&(u.set(d.subarray(m,m+y),0),l.enqueue(u.slice(0,y))),!i){const I=p>>24&255,P=I&128?I-256:I;if(P<0)throw new Error("process error:"+P)}const C=f(this.streamHandle);if(C===0)break;g+=C}}catch(c){this._end&&this.streamHandle&&this._end(this.streamHandle),this.in&&Ze&&Ze(this.in),this.out&&Ze&&Ze(this.out),l.error(c)}},flush(r){try{const l=new Uint8Array($i.buffer),c=this._process,d=this.out,h=this._scratch;for(;;){const f=c(this.streamHandle,0,0,d,s,4),m=f&16777215,u=f>>24&255;if(!i){const g=u&128?u-256:u;if(g<0)throw new Error("process error:"+g)}if(m&&(h.set(l.subarray(d,d+m),0),r.enqueue(h.slice(0,m))),u===1||m===0)break}}catch(l){r.error(l)}finally{if(this._end&&this.streamHandle){const l=this._end(this.streamHandle);l!==0&&r.error(new Error("end error:"+l))}this.in&&Ze&&Ze(this.in),this.out&&Ze&&Ze(this.out)}}})}class Wp{constructor(e="deflate",t){return bl(!0,e,t)}}class $p{constructor(e="deflate",t){return bl(!1,e,t)}}let wl=!1;async function Kp(i,{baseURI:e}){if(!wl){let t,n;try{try{n=new URL(i,e)}catch{}t=await(await fetch(n)).arrayBuffer()}catch(o){if(i.startsWith("data:application/wasm;base64,"))t=qp(i);else throw o}const s=await WebAssembly.instantiate(t);jp(s.instance.exports),wl=!0}}function qp(i){const e=i.split(",")[1],t=atob(e),n=t.length,s=new Uint8Array(n);for(let o=0;o<n;++o)s[o]=t.charCodeAt(o);return s.buffer}let xo;zp(Yn),Ug({initModule:i=>{if(!xo){let{wasmURI:e}=i;typeof e==Xt&&(e=e()),xo=Kp(e,i)}return xo}}),Yn({CompressionStreamZlib:Wp,DecompressionStreamZlib:$p});const Mo={application:{"andrew-inset":"ez",annodex:"anx","atom+xml":"atom","atomcat+xml":"atomcat","atomserv+xml":"atomsrv",bbolin:"lin","cu-seeme":"cu","davmount+xml":"davmount",dsptype:"tsp",ecmascript:["es","ecma"],futuresplash:"spl",hta:"hta","java-archive":"jar","java-serialized-object":"ser","java-vm":"class",m3g:"m3g","mac-binhex40":"hqx",mathematica:["nb","ma","mb"],msaccess:"mdb",msword:["doc","dot","wiz"],mxf:"mxf",oda:"oda",ogg:"ogx",pdf:"pdf","pgp-keys":"key","pgp-signature":["asc","sig"],"pics-rules":"prf",postscript:["ps","ai","eps","epsi","epsf","eps2","eps3"],rar:"rar","rdf+xml":"rdf","rss+xml":"rss",rtf:"rtf","xhtml+xml":["xhtml","xht"],xml:["xml","xsl","xsd","xpdl"],"xspf+xml":"xspf",zip:"zip","vnd.android.package-archive":"apk","vnd.cinderella":"cdy","vnd.google-earth.kml+xml":"kml","vnd.google-earth.kmz":"kmz","vnd.mozilla.xul+xml":"xul","vnd.ms-excel":["xls","xlb","xlt","xlm","xla","xlc","xlw"],"vnd.ms-pki.seccat":"cat","vnd.ms-pki.stl":"stl","vnd.ms-powerpoint":["ppt","pps","pot","ppa","pwz"],"vnd.oasis.opendocument.chart":"odc","vnd.oasis.opendocument.database":"odb","vnd.oasis.opendocument.formula":"odf","vnd.oasis.opendocument.graphics":"odg","vnd.oasis.opendocument.graphics-template":"otg","vnd.oasis.opendocument.image":"odi","vnd.oasis.opendocument.presentation":"odp","vnd.oasis.opendocument.presentation-template":"otp","vnd.oasis.opendocument.spreadsheet":"ods","vnd.oasis.opendocument.spreadsheet-template":"ots","vnd.oasis.opendocument.text":"odt","vnd.oasis.opendocument.text-master":["odm","otm"],"vnd.oasis.opendocument.text-template":"ott","vnd.oasis.opendocument.text-web":"oth","vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","vnd.openxmlformats-officedocument.spreadsheetml.template":"xltx","vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","vnd.openxmlformats-officedocument.presentationml.slideshow":"ppsx","vnd.openxmlformats-officedocument.presentationml.template":"potx","vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","vnd.openxmlformats-officedocument.wordprocessingml.template":"dotx","vnd.smaf":"mmf","vnd.stardivision.calc":"sdc","vnd.stardivision.chart":"sds","vnd.stardivision.draw":"sda","vnd.stardivision.impress":"sdd","vnd.stardivision.math":["sdf","smf"],"vnd.stardivision.writer":["sdw","vor"],"vnd.stardivision.writer-global":"sgl","vnd.sun.xml.calc":"sxc","vnd.sun.xml.calc.template":"stc","vnd.sun.xml.draw":"sxd","vnd.sun.xml.draw.template":"std","vnd.sun.xml.impress":"sxi","vnd.sun.xml.impress.template":"sti","vnd.sun.xml.math":"sxm","vnd.sun.xml.writer":"sxw","vnd.sun.xml.writer.global":"sxg","vnd.sun.xml.writer.template":"stw","vnd.symbian.install":["sis","sisx"],"vnd.visio":["vsd","vst","vss","vsw","vsdx","vssx","vstx","vssm","vstm"],"vnd.wap.wbxml":"wbxml","vnd.wap.wmlc":"wmlc","vnd.wap.wmlscriptc":"wmlsc","vnd.wordperfect":"wpd","vnd.wordperfect5.1":"wp5","x-123":"wk","x-7z-compressed":"7z","x-abiword":"abw","x-apple-diskimage":"dmg","x-bcpio":"bcpio","x-bittorrent":"torrent","x-cbr":["cbr","cba","cbt","cb7"],"x-cbz":"cbz","x-cdf":["cdf","cda"],"x-cdlink":"vcd","x-chess-pgn":"pgn","x-cpio":"cpio","x-csh":"csh","x-director":["dir","dxr","cst","cct","cxt","w3d","fgd","swa"],"x-dms":"dms","x-doom":"wad","x-dvi":"dvi","x-httpd-eruby":"rhtml","x-font":"pcf.Z","x-freemind":"mm","x-gnumeric":"gnumeric","x-go-sgf":"sgf","x-graphing-calculator":"gcf","x-gtar":["gtar","taz"],"x-hdf":"hdf","x-httpd-php":["phtml","pht","php"],"x-httpd-php-source":"phps","x-httpd-php3":"php3","x-httpd-php3-preprocessed":"php3p","x-httpd-php4":"php4","x-httpd-php5":"php5","x-ica":"ica","x-info":"info","x-internet-signup":["ins","isp"],"x-iphone":"iii","x-iso9660-image":"iso","x-java-jnlp-file":"jnlp","x-jmol":"jmz","x-killustrator":"kil","x-latex":"latex","x-lyx":"lyx","x-lzx":"lzx","x-maker":["frm","fb","fbdoc"],"x-ms-wmd":"wmd","x-msdos-program":["com","exe","bat","dll"],"x-netcdf":["nc"],"x-ns-proxy-autoconfig":["pac","dat"],"x-nwc":"nwc","x-object":"o","x-oz-application":"oza","x-pkcs7-certreqresp":"p7r","x-python-code":["pyc","pyo"],"x-qgis":["qgs","shp","shx"],"x-quicktimeplayer":"qtl","x-redhat-package-manager":["rpm","rpa"],"x-ruby":"rb","x-sh":"sh","x-shar":"shar","x-shockwave-flash":["swf","swfl"],"x-silverlight":"scr","x-stuffit":"sit","x-sv4cpio":"sv4cpio","x-sv4crc":"sv4crc","x-tar":"tar","x-tex-gf":"gf","x-tex-pk":"pk","x-texinfo":["texinfo","texi"],"x-trash":["~","%","bak","old","sik"],"x-ustar":"ustar","x-wais-source":"src","x-wingz":"wz","x-x509-ca-cert":["crt","der","cer"],"x-xcf":"xcf","x-xfig":"fig","x-xpinstall":"xpi",applixware:"aw","atomsvc+xml":"atomsvc","ccxml+xml":"ccxml","cdmi-capability":"cdmia","cdmi-container":"cdmic","cdmi-domain":"cdmid","cdmi-object":"cdmio","cdmi-queue":"cdmiq","docbook+xml":"dbk","dssc+der":"dssc","dssc+xml":"xdssc","emma+xml":"emma","epub+zip":"epub",exi:"exi","font-tdpfr":"pfr","gml+xml":"gml","gpx+xml":"gpx",gxf:"gxf",hyperstudio:"stk","inkml+xml":["ink","inkml"],ipfix:"ipfix","jsonml+json":"jsonml","lost+xml":"lostxml","mads+xml":"mads",marc:"mrc","marcxml+xml":"mrcx","mathml+xml":["mathml","mml"],mbox:"mbox","mediaservercontrol+xml":"mscml","metalink+xml":"metalink","metalink4+xml":"meta4","mets+xml":"mets","mods+xml":"mods",mp21:["m21","mp21"],mp4:"mp4s","oebps-package+xml":"opf","omdoc+xml":"omdoc",onenote:["onetoc","onetoc2","onetmp","onepkg"],oxps:"oxps","patch-ops-error+xml":"xer","pgp-encrypted":"pgp",pkcs10:"p10","pkcs7-mime":["p7m","p7c"],"pkcs7-signature":"p7s",pkcs8:"p8","pkix-attr-cert":"ac","pkix-crl":"crl","pkix-pkipath":"pkipath",pkixcmp:"pki","pls+xml":"pls","prs.cww":"cww","pskc+xml":"pskcxml","reginfo+xml":"rif","relax-ng-compact-syntax":"rnc","resource-lists+xml":"rl","resource-lists-diff+xml":"rld","rls-services+xml":"rs","rpki-ghostbusters":"gbr","rpki-manifest":"mft","rpki-roa":"roa","rsd+xml":"rsd","sbml+xml":"sbml","scvp-cv-request":"scq","scvp-cv-response":"scs","scvp-vp-request":"spq","scvp-vp-response":"spp",sdp:"sdp","set-payment-initiation":"setpay","set-registration-initiation":"setreg","shf+xml":"shf","sparql-query":"rq","sparql-results+xml":"srx",srgs:"gram","srgs+xml":"grxml","sru+xml":"sru","ssdl+xml":"ssdl","ssml+xml":"ssml","tei+xml":["tei","teicorpus"],"thraud+xml":"tfi","timestamped-data":"tsd","vnd.3gpp.pic-bw-large":"plb","vnd.3gpp.pic-bw-small":"psb","vnd.3gpp.pic-bw-var":"pvb","vnd.3gpp2.tcap":"tcap","vnd.3m.post-it-notes":"pwn","vnd.accpac.simply.aso":"aso","vnd.accpac.simply.imp":"imp","vnd.acucobol":"acu","vnd.acucorp":["atc","acutc"],"vnd.adobe.air-application-installer-package+zip":"air","vnd.adobe.formscentral.fcdt":"fcdt","vnd.adobe.fxp":["fxp","fxpl"],"vnd.adobe.xdp+xml":"xdp","vnd.adobe.xfdf":"xfdf","vnd.ahead.space":"ahead","vnd.airzip.filesecure.azf":"azf","vnd.airzip.filesecure.azs":"azs","vnd.amazon.ebook":"azw","vnd.americandynamics.acc":"acc","vnd.amiga.ami":"ami","vnd.anser-web-certificate-issue-initiation":"cii","vnd.anser-web-funds-transfer-initiation":"fti","vnd.antix.game-component":"atx","vnd.apple.installer+xml":"mpkg","vnd.apple.mpegurl":"m3u8","vnd.aristanetworks.swi":"swi","vnd.astraea-software.iota":"iota","vnd.audiograph":"aep","vnd.blueice.multipass":"mpm","vnd.bmi":"bmi","vnd.businessobjects":"rep","vnd.chemdraw+xml":"cdxml","vnd.chipnuts.karaoke-mmd":"mmd","vnd.claymore":"cla","vnd.cloanto.rp9":"rp9","vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"vnd.cluetrust.cartomobile-config":"c11amc","vnd.cluetrust.cartomobile-config-pkg":"c11amz","vnd.commonspace":"csp","vnd.contact.cmsg":"cdbcmsg","vnd.cosmocaller":"cmc","vnd.crick.clicker":"clkx","vnd.crick.clicker.keyboard":"clkk","vnd.crick.clicker.palette":"clkp","vnd.crick.clicker.template":"clkt","vnd.crick.clicker.wordbank":"clkw","vnd.criticaltools.wbs+xml":"wbs","vnd.ctc-posml":"pml","vnd.cups-ppd":"ppd","vnd.curl.car":"car","vnd.curl.pcurl":"pcurl","vnd.dart":"dart","vnd.data-vision.rdz":"rdz","vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"vnd.dece.ttml+xml":["uvt","uvvt"],"vnd.dece.unspecified":["uvx","uvvx"],"vnd.dece.zip":["uvz","uvvz"],"vnd.denovo.fcselayout-link":"fe_launch","vnd.dna":"dna","vnd.dolby.mlp":"mlp","vnd.dpgraph":"dpg","vnd.dreamfactory":"dfac","vnd.ds-keypoint":"kpxx","vnd.dvb.ait":"ait","vnd.dvb.service":"svc","vnd.dynageo":"geo","vnd.ecowin.chart":"mag","vnd.enliven":"nml","vnd.epson.esf":"esf","vnd.epson.msf":"msf","vnd.epson.quickanime":"qam","vnd.epson.salt":"slt","vnd.epson.ssf":"ssf","vnd.eszigno3+xml":["es3","et3"],"vnd.ezpix-album":"ez2","vnd.ezpix-package":"ez3","vnd.fdf":"fdf","vnd.fdsn.mseed":"mseed","vnd.fdsn.seed":["seed","dataless"],"vnd.flographit":"gph","vnd.fluxtime.clip":"ftc","vnd.framemaker":["fm","frame","maker","book"],"vnd.frogans.fnc":"fnc","vnd.frogans.ltf":"ltf","vnd.fsc.weblaunch":"fsc","vnd.fujitsu.oasys":"oas","vnd.fujitsu.oasys2":"oa2","vnd.fujitsu.oasys3":"oa3","vnd.fujitsu.oasysgp":"fg5","vnd.fujitsu.oasysprs":"bh2","vnd.fujixerox.ddd":"ddd","vnd.fujixerox.docuworks":"xdw","vnd.fujixerox.docuworks.binder":"xbd","vnd.fuzzysheet":"fzs","vnd.genomatix.tuxedo":"txd","vnd.geogebra.file":"ggb","vnd.geogebra.tool":"ggt","vnd.geometry-explorer":["gex","gre"],"vnd.geonext":"gxt","vnd.geoplan":"g2w","vnd.geospace":"g3w","vnd.gmx":"gmx","vnd.grafeq":["gqf","gqs"],"vnd.groove-account":"gac","vnd.groove-help":"ghf","vnd.groove-identity-message":"gim","vnd.groove-injector":"grv","vnd.groove-tool-message":"gtm","vnd.groove-tool-template":"tpl","vnd.groove-vcard":"vcg","vnd.hal+xml":"hal","vnd.handheld-entertainment+xml":"zmm","vnd.hbci":"hbci","vnd.hhe.lesson-player":"les","vnd.hp-hpgl":"hpgl","vnd.hp-hpid":"hpid","vnd.hp-hps":"hps","vnd.hp-jlyt":"jlt","vnd.hp-pcl":"pcl","vnd.hp-pclxl":"pclxl","vnd.hydrostatix.sof-data":"sfd-hdstx","vnd.ibm.minipay":"mpy","vnd.ibm.modcap":["afp","listafp","list3820"],"vnd.ibm.rights-management":"irm","vnd.ibm.secure-container":"sc","vnd.iccprofile":["icc","icm"],"vnd.igloader":"igl","vnd.immervision-ivp":"ivp","vnd.immervision-ivu":"ivu","vnd.insors.igm":"igm","vnd.intercon.formnet":["xpw","xpx"],"vnd.intergeo":"i2g","vnd.intu.qbo":"qbo","vnd.intu.qfx":"qfx","vnd.ipunplugged.rcprofile":"rcprofile","vnd.irepository.package+xml":"irp","vnd.is-xpr":"xpr","vnd.isac.fcs":"fcs","vnd.jam":"jam","vnd.jcp.javame.midlet-rms":"rms","vnd.jisp":"jisp","vnd.joost.joda-archive":"joda","vnd.kahootz":["ktz","ktr"],"vnd.kde.karbon":"karbon","vnd.kde.kchart":"chrt","vnd.kde.kformula":"kfo","vnd.kde.kivio":"flw","vnd.kde.kontour":"kon","vnd.kde.kpresenter":["kpr","kpt"],"vnd.kde.kspread":"ksp","vnd.kde.kword":["kwd","kwt"],"vnd.kenameaapp":"htke","vnd.kidspiration":"kia","vnd.kinar":["kne","knp"],"vnd.koan":["skp","skd","skt","skm"],"vnd.kodak-descriptor":"sse","vnd.las.las+xml":"lasxml","vnd.llamagraphics.life-balance.desktop":"lbd","vnd.llamagraphics.life-balance.exchange+xml":"lbe","vnd.lotus-1-2-3":"123","vnd.lotus-approach":"apr","vnd.lotus-freelance":"pre","vnd.lotus-notes":"nsf","vnd.lotus-organizer":"org","vnd.lotus-screencam":"scm","vnd.lotus-wordpro":"lwp","vnd.macports.portpkg":"portpkg","vnd.mcd":"mcd","vnd.medcalcdata":"mc1","vnd.mediastation.cdkey":"cdkey","vnd.mfer":"mwf","vnd.mfmp":"mfm","vnd.micrografx.flo":"flo","vnd.micrografx.igx":"igx","vnd.mif":"mif","vnd.mobius.daf":"daf","vnd.mobius.dis":"dis","vnd.mobius.mbk":"mbk","vnd.mobius.mqy":"mqy","vnd.mobius.msl":"msl","vnd.mobius.plc":"plc","vnd.mobius.txf":"txf","vnd.mophun.application":"mpn","vnd.mophun.certificate":"mpc","vnd.ms-artgalry":"cil","vnd.ms-cab-compressed":"cab","vnd.ms-excel.addin.macroenabled.12":"xlam","vnd.ms-excel.sheet.binary.macroenabled.12":"xlsb","vnd.ms-excel.sheet.macroenabled.12":"xlsm","vnd.ms-excel.template.macroenabled.12":"xltm","vnd.ms-fontobject":"eot","vnd.ms-htmlhelp":"chm","vnd.ms-ims":"ims","vnd.ms-lrm":"lrm","vnd.ms-officetheme":"thmx","vnd.ms-powerpoint.addin.macroenabled.12":"ppam","vnd.ms-powerpoint.presentation.macroenabled.12":"pptm","vnd.ms-powerpoint.slide.macroenabled.12":"sldm","vnd.ms-powerpoint.slideshow.macroenabled.12":"ppsm","vnd.ms-powerpoint.template.macroenabled.12":"potm","vnd.ms-project":["mpp","mpt"],"vnd.ms-word.document.macroenabled.12":"docm","vnd.ms-word.template.macroenabled.12":"dotm","vnd.ms-works":["wps","wks","wcm","wdb"],"vnd.ms-wpl":"wpl","vnd.ms-xpsdocument":"xps","vnd.mseq":"mseq","vnd.musician":"mus","vnd.muvee.style":"msty","vnd.mynfc":"taglet","vnd.neurolanguage.nlu":"nlu","vnd.nitf":["ntf","nitf"],"vnd.noblenet-directory":"nnd","vnd.noblenet-sealer":"nns","vnd.noblenet-web":"nnw","vnd.nokia.n-gage.data":"ngdat","vnd.nokia.n-gage.symbian.install":"n-gage","vnd.nokia.radio-preset":"rpst","vnd.nokia.radio-presets":"rpss","vnd.novadigm.edm":"edm","vnd.novadigm.edx":"edx","vnd.novadigm.ext":"ext","vnd.oasis.opendocument.chart-template":"otc","vnd.oasis.opendocument.formula-template":"odft","vnd.oasis.opendocument.image-template":"oti","vnd.olpc-sugar":"xo","vnd.oma.dd2+xml":"dd2","vnd.openofficeorg.extension":"oxt","vnd.openxmlformats-officedocument.presentationml.slide":"sldx","vnd.osgeo.mapguide.package":"mgp","vnd.osgi.dp":"dp","vnd.osgi.subsystem":"esa","vnd.palm":["pdb","pqa","oprc"],"vnd.pawaafile":"paw","vnd.pg.format":"str","vnd.pg.osasli":"ei6","vnd.picsel":"efif","vnd.pmi.widget":"wg","vnd.pocketlearn":"plf","vnd.powerbuilder6":"pbd","vnd.previewsystems.box":"box","vnd.proteus.magazine":"mgz","vnd.publishare-delta-tree":"qps","vnd.pvi.ptid1":"ptid","vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"vnd.realvnc.bed":"bed","vnd.recordare.musicxml":"mxl","vnd.recordare.musicxml+xml":"musicxml","vnd.rig.cryptonote":"cryptonote","vnd.rn-realmedia":"rm","vnd.rn-realmedia-vbr":"rmvb","vnd.route66.link66+xml":"link66","vnd.sailingtracker.track":"st","vnd.seemail":"see","vnd.sema":"sema","vnd.semd":"semd","vnd.semf":"semf","vnd.shana.informed.formdata":"ifm","vnd.shana.informed.formtemplate":"itp","vnd.shana.informed.interchange":"iif","vnd.shana.informed.package":"ipk","vnd.simtech-mindmapper":["twd","twds"],"vnd.smart.teacher":"teacher","vnd.solent.sdkm+xml":["sdkm","sdkd"],"vnd.spotfire.dxp":"dxp","vnd.spotfire.sfs":"sfs","vnd.stepmania.package":"smzip","vnd.stepmania.stepchart":"sm","vnd.sus-calendar":["sus","susp"],"vnd.svd":"svd","vnd.syncml+xml":"xsm","vnd.syncml.dm+wbxml":"bdm","vnd.syncml.dm+xml":"xdm","vnd.tao.intent-module-archive":"tao","vnd.tcpdump.pcap":["pcap","cap","dmp"],"vnd.tmobile-livetv":"tmo","vnd.trid.tpt":"tpt","vnd.triscape.mxs":"mxs","vnd.trueapp":"tra","vnd.ufdl":["ufd","ufdl"],"vnd.uiq.theme":"utz","vnd.umajin":"umj","vnd.unity":"unityweb","vnd.uoml+xml":"uoml","vnd.vcx":"vcx","vnd.visionary":"vis","vnd.vsf":"vsf","vnd.webturbo":"wtb","vnd.wolfram.player":"nbp","vnd.wqd":"wqd","vnd.wt.stf":"stf","vnd.xara":"xar","vnd.xfdl":"xfdl","vnd.yamaha.hv-dic":"hvd","vnd.yamaha.hv-script":"hvs","vnd.yamaha.hv-voice":"hvp","vnd.yamaha.openscoreformat":"osf","vnd.yamaha.openscoreformat.osfpvg+xml":"osfpvg","vnd.yamaha.smaf-audio":"saf","vnd.yamaha.smaf-phrase":"spf","vnd.yellowriver-custom-menu":"cmp","vnd.zul":["zir","zirz"],"vnd.zzazz.deck+xml":"zaz","voicexml+xml":"vxml",widget:"wgt",winhlp:"hlp","wsdl+xml":"wsdl","wspolicy+xml":"wspolicy","x-ace-compressed":"ace","x-authorware-bin":["aab","x32","u32","vox"],"x-authorware-map":"aam","x-authorware-seg":"aas","x-blorb":["blb","blorb"],"x-bzip":"bz","x-bzip2":["bz2","boz"],"x-cfs-compressed":"cfs","x-chat":"chat","x-conference":"nsc","x-dgc-compressed":"dgc","x-dtbncx+xml":"ncx","x-dtbook+xml":"dtb","x-dtbresource+xml":"res","x-eva":"eva","x-font-bdf":"bdf","x-font-ghostscript":"gsf","x-font-linux-psf":"psf","x-font-pcf":"pcf","x-font-snf":"snf","x-font-ttf":["ttf","ttc"],"x-font-type1":["pfa","pfb","pfm","afm"],"x-freearc":"arc","x-gca-compressed":"gca","x-glulx":"ulx","x-gramps-xml":"gramps","x-install-instructions":"install","x-lzh-compressed":["lzh","lha"],"x-mie":"mie","x-mobipocket-ebook":["prc","mobi"],"x-ms-application":"application","x-ms-shortcut":"lnk","x-ms-xbap":"xbap","x-msbinder":"obd","x-mscardfile":"crd","x-msclip":"clp","application/x-ms-installer":"msi","x-msmediaview":["mvb","m13","m14"],"x-msmetafile":["wmf","wmz","emf","emz"],"x-msmoney":"mny","x-mspublisher":"pub","x-msschedule":"scd","x-msterminal":"trm","x-mswrite":"wri","x-nzb":"nzb","x-pkcs12":["p12","pfx"],"x-pkcs7-certificates":["p7b","spc"],"x-research-info-systems":"ris","x-silverlight-app":"xap","x-sql":"sql","x-stuffitx":"sitx","x-subrip":"srt","x-t3vm-image":"t3","x-tex-tfm":"tfm","x-tgif":"obj","x-xliff+xml":"xlf","x-xz":"xz","x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"xaml+xml":"xaml","xcap-diff+xml":"xdf","xenc+xml":"xenc","xml-dtd":"dtd","xop+xml":"xop","xproc+xml":"xpl","xslt+xml":"xslt","xv+xml":["mxml","xhvml","xvml","xvm"],yang:"yang","yin+xml":"yin",envoy:"evy",fractals:"fif","internet-property-stream":"acx",olescript:"axs","vnd.ms-outlook":"msg","vnd.ms-pkicertstore":"sst","x-compress":"z","x-perfmon":["pma","pmc","pmr","pmw"],"ynd.ms-pkipko":"pko",gzip:["gz","tgz"],"smil+xml":["smi","smil"],"vnd.debian.binary-package":["deb","udeb"],"vnd.hzn-3d-crossword":"x3d","vnd.sqlite3":["db","sqlite","sqlite3","db-wal","sqlite-wal","db-shm","sqlite-shm"],"vnd.wap.sic":"sic","vnd.wap.slc":"slc","x-krita":["kra","krz"],"x-perl":["pm","pl"],yaml:["yaml","yml"]},audio:{amr:"amr","amr-wb":"awb",annodex:"axa",basic:["au","snd"],flac:"flac",midi:["mid","midi","kar","rmi"],mpeg:["mpga","mpega","mp3","m4a","mp2a","m2a","m3a"],mpegurl:"m3u",ogg:["oga","ogg","spx"],"prs.sid":"sid","x-aiff":"aifc","x-gsm":"gsm","x-ms-wma":"wma","x-ms-wax":"wax","x-pn-realaudio":"ram","x-realaudio":"ra","x-sd2":"sd2",adpcm:"adp",mp4:"mp4a",s3m:"s3m",silk:"sil","vnd.dece.audio":["uva","uvva"],"vnd.digital-winds":"eol","vnd.dra":"dra","vnd.dts":"dts","vnd.dts.hd":"dtshd","vnd.lucent.voice":"lvp","vnd.ms-playready.media.pya":"pya","vnd.nuera.ecelp4800":"ecelp4800","vnd.nuera.ecelp7470":"ecelp7470","vnd.nuera.ecelp9600":"ecelp9600","vnd.rip":"rip",webm:"weba","x-caf":"caf","x-matroska":"mka","x-pn-realaudio-plugin":"rmp",xm:"xm",aac:"aac",aiff:["aiff","aif","aff"],opus:"opus",wav:"wav"},chemical:{"x-alchemy":"alc","x-cache":["cac","cache"],"x-cache-csf":"csf","x-cactvs-binary":["cbin","cascii","ctab"],"x-cdx":"cdx","x-chem3d":"c3d","x-cif":"cif","x-cmdf":"cmdf","x-cml":"cml","x-compass":"cpa","x-crossfire":"bsd","x-csml":["csml","csm"],"x-ctx":"ctx","x-cxf":["cxf","cef"],"x-embl-dl-nucleotide":["emb","embl"],"x-gamess-input":["inp","gam","gamin"],"x-gaussian-checkpoint":["fch","fchk"],"x-gaussian-cube":"cub","x-gaussian-input":["gau","gjc","gjf"],"x-gaussian-log":"gal","x-gcg8-sequence":"gcg","x-genbank":"gen","x-hin":"hin","x-isostar":["istr","ist"],"x-jcamp-dx":["jdx","dx"],"x-kinemage":"kin","x-macmolecule":"mcm","x-macromodel-input":"mmod","x-mdl-molfile":"mol","x-mdl-rdfile":"rd","x-mdl-rxnfile":"rxn","x-mdl-sdfile":"sd","x-mdl-tgf":"tgf","x-mmcif":"mcif","x-mol2":"mol2","x-molconn-Z":"b","x-mopac-graph":"gpt","x-mopac-input":["mop","mopcrt","zmt"],"x-mopac-out":"moo","x-ncbi-asn1":"asn","x-ncbi-asn1-ascii":["prt","ent"],"x-ncbi-asn1-binary":"val","x-rosdal":"ros","x-swissprot":"sw","x-vamas-iso14976":"vms","x-vmd":"vmd","x-xtel":"xtel","x-xyz":"xyz"},font:{otf:"otf",woff:"woff",woff2:"woff2"},image:{gif:"gif",ief:"ief",jpeg:["jpeg","jpg","jpe","jfif","jfif-tbnl","jif"],pcx:"pcx",png:"png","svg+xml":["svg","svgz"],tiff:["tiff","tif"],"vnd.djvu":["djvu","djv"],"vnd.wap.wbmp":"wbmp","x-canon-cr2":"cr2","x-canon-crw":"crw","x-cmu-raster":"ras","x-coreldraw":"cdr","x-coreldrawpattern":"pat","x-coreldrawtemplate":"cdt","x-corelphotopaint":"cpt","x-epson-erf":"erf","x-icon":"ico","x-jg":"art","x-jng":"jng","x-nikon-nef":"nef","x-olympus-orf":"orf","x-portable-anymap":"pnm","x-portable-bitmap":"pbm","x-portable-graymap":"pgm","x-portable-pixmap":"ppm","x-rgb":"rgb","x-xbitmap":"xbm","x-xpixmap":"xpm","x-xwindowdump":"xwd",bmp:"bmp",cgm:"cgm",g3fax:"g3",ktx:"ktx","prs.btif":"btif",sgi:"sgi","vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"vnd.dwg":"dwg","vnd.dxf":"dxf","vnd.fastbidsheet":"fbs","vnd.fpx":"fpx","vnd.fst":"fst","vnd.fujixerox.edmics-mmr":"mmr","vnd.fujixerox.edmics-rlc":"rlc","vnd.ms-modi":"mdi","vnd.ms-photo":"wdp","vnd.net-fpx":"npx","vnd.xiff":"xif",webp:"webp","x-3ds":"3ds","x-cmx":"cmx","x-freehand":["fh","fhc","fh4","fh5","fh7"],"x-pict":["pic","pct"],"x-tga":"tga","cis-cod":"cod",avif:"avifs",heic:["heif","heic"],pjpeg:["pjpg"],"vnd.adobe.photoshop":"psd","x-adobe-dng":"dng","x-fuji-raf":"raf","x-icns":"icns","x-kodak-dcr":"dcr","x-kodak-k25":"k25","x-kodak-kdc":"kdc","x-minolta-mrw":"mrw","x-panasonic-raw":["raw","rw2","rwl"],"x-pentax-pef":["pef","ptx"],"x-sigma-x3f":"x3f","x-sony-arw":"arw","x-sony-sr2":"sr2","x-sony-srf":"srf"},message:{rfc822:["eml","mime","mht","mhtml","nws"]},model:{iges:["igs","iges"],mesh:["msh","mesh","silo"],vrml:["wrl","vrml"],"x3d+vrml":["x3dv","x3dvz"],"x3d+xml":"x3dz","x3d+binary":["x3db","x3dbz"],"vnd.collada+xml":"dae","vnd.dwf":"dwf","vnd.gdl":"gdl","vnd.gtw":"gtw","vnd.mts":"mts","vnd.usdz+zip":"usdz","vnd.vtu":"vtu"},text:{"cache-manifest":["manifest","appcache"],calendar:["ics","icz","ifb"],css:"css",csv:"csv",h323:"323",html:["html","htm","shtml","stm"],iuls:"uls",plain:["txt","text","brf","conf","def","list","log","in","bas","diff","ksh"],richtext:"rtx",scriptlet:["sct","wsc"],texmacs:"tm","tab-separated-values":"tsv","vnd.sun.j2me.app-descriptor":"jad","vnd.wap.wml":"wml","vnd.wap.wmlscript":"wmls","x-bibtex":"bib","x-boo":"boo","x-c++hdr":["h++","hpp","hxx","hh"],"x-c++src":["c++","cpp","cxx","cc"],"x-component":"htc","x-dsrc":"d","x-diff":"patch","x-haskell":"hs","x-java":"java","x-literate-haskell":"lhs","x-moc":"moc","x-pascal":["p","pas","pp","inc"],"x-pcs-gcd":"gcd","x-python":"py","x-scala":"scala","x-setext":"etx","x-tcl":["tcl","tk"],"x-tex":["tex","ltx","sty","cls"],"x-vcalendar":"vcs","x-vcard":"vcf",n3:"n3","prs.lines.tag":"dsc",sgml:["sgml","sgm"],troff:["t","tr","roff","man","me","ms"],turtle:"ttl","uri-list":["uri","uris","urls"],vcard:"vcard","vnd.curl":"curl","vnd.curl.dcurl":"dcurl","vnd.curl.scurl":"scurl","vnd.curl.mcurl":"mcurl","vnd.dvb.subtitle":"sub","vnd.fly":"fly","vnd.fmi.flexstor":"flx","vnd.graphviz":"gv","vnd.in3d.3dml":"3dml","vnd.in3d.spot":"spot","x-asm":["s","asm"],"x-c":["c","h","dic"],"x-fortran":["f","for","f77","f90"],"x-opml":"opml","x-nfo":"nfo","x-sfv":"sfv","x-uuencode":"uu",webviewhtml:"htt",javascript:"js",json:"json",markdown:["md","markdown","mdown","markdn"],"vnd.wap.si":"si","vnd.wap.sl":"sl"},video:{avif:"avif","3gpp":"3gp",annodex:"axv",dl:"dl",dv:["dif","dv"],fli:"fli",gl:"gl",mpeg:["mpeg","mpg","mpe","m1v","m2v","mp2","mpa","mpv2"],mp4:["mp4","mp4v","mpg4"],quicktime:["qt","mov"],ogg:"ogv","vnd.mpegurl":["mxu","m4u"],"x-flv":"flv","x-la-asf":["lsf","lsx"],"x-mng":"mng","x-ms-asf":["asf","asx","asr"],"x-ms-wm":"wm","x-ms-wmv":"wmv","x-ms-wmx":"wmx","x-ms-wvx":"wvx","x-msvideo":"avi","x-sgi-movie":"movie","x-matroska":["mpv","mkv","mk3d","mks"],"3gpp2":"3g2",h261:"h261",h263:"h263",h264:"h264",jpeg:"jpgv",jpm:["jpm","jpgm"],mj2:["mj2","mjp2"],"vnd.dece.hd":["uvh","uvvh"],"vnd.dece.mobile":["uvm","uvvm"],"vnd.dece.pd":["uvp","uvvp"],"vnd.dece.sd":["uvs","uvvs"],"vnd.dece.video":["uvv","uvvv"],"vnd.dvb.file":"dvb","vnd.fvt":"fvt","vnd.ms-playready.media.pyv":"pyv","vnd.uvvu.mp4":["uvu","uvvu"],"vnd.vivo":"viv",webm:"webm","x-f4v":"f4v","x-m4v":"m4v","x-ms-vob":"vob","x-smv":"smv",mp2t:"ts"},"x-conference":{"x-cooltalk":"ice"},"x-world":{"x-vrml":["vrm","flr","wrz","xaf","xof"]}};(()=>{const i={};for(const e of Object.keys(Mo))for(const t of Object.keys(Mo[e])){const n=Mo[e][t];if(typeof n=="string")i[n]=e+"/"+t;else for(let s=0;s<n.length;s++)i[n[s]]=e+"/"+t}return i})(),rg(Yn);const Xp="E84#E3C4!8C4&A1";async function St(i){try{const e=await fetch(i);if(!e.ok)return!1;const t=await e.blob();try{const n=new Io(new Kn(t),{password:Xp}),o=(await n.getEntries()).find(l=>!l.directory&&l.filename.endsWith(".json"));if(!o)return await n.close(),!1;const r=await o.getData(new ep);return await n.close(),JSON.parse(r.trim())}catch{const n=await t.text();try{return JSON.parse(n.trim())}catch(s){throw console.error(`[loadModelFile] JSON parse error: ${i}`,s),s}}}catch(e){return console.error("[loadModelFile] 加载失败",`${i} ${e}`),!1}}function Jp(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){const e=Math.random()*16|0;return(i==="x"?e:e&3|8).toString(16)})}class Ki{events={};on(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t)}emit(e,...t){this.events[e]&&this.events[e].forEach(n=>n(...t))}off(e,t){this.events[e]&&(this.events[e]=this.events[e].filter(n=>n!==t))}}const Il="35aa3175ce8b1a55331e.64c93d5e3268979d98c900";class Sl{cesium;viewer;modelList=[];hasLoaded3dTiles={};mapRecordModelId={};mapTileset={};BIMmodelId="";lazyLoadingCount=0;events=new Ki;options={flyTo:!0,flyToDuration:0,loadTreeNodeDetails:!0,loadTreeNodeDetailsUrl:"/elementInfo.zip",loadTree:!0,loadTreeUrl:"/allElementsInfo.zip",boxRegionUrl:"/BoundingBoxInfo.zip",regionUrl:"/region.zip",batchIDInfoUrl:"/batchIDInfo.zip",enabledSection:!0,delay:0,tilesetOptions:{cullWithChildrenBounds:!0,cullRequestsWhileMoving:!0,cullRequestsWhileMovingMultiplier:10,backFaceCulling:!0,colorBlendAmount:0,minimumPixelSize:128,maximumScreenSpaceError:32,skipLevelOfDetail:!0,baseScreenSpaceError:1024,skipScreenSpaceErrorFactor:128,skipLevels:5,immediatelyLoadDesiredLevelOfDetail:!1,loadSiblings:!1,maximumMemoryUsage:4096*10,preloadWhenHidden:!0,preferLeaves:!0,progressiveResolutionHeightFraction:.5,dynamicScreenSpaceErrorDensity:.002,dynamicScreenSpaceErrorFactor:4,dynamicScreenSpaceError:!0,dynamicScreenSpaceErrorHeightFalloff:.25,foveatedConeSize:0,foveatedTimeDelay:10,foveatedMinimumScreenSpaceErrorRelaxation:0}};constructor(e){this.cesium=e.cesium,this.viewer=e.viewer,this.options.tilesetOptions&&(this.options.tilesetOptions.colorBlendMode=this.cesium.Cesium3DTileColorBlendMode.REPLACE)}deleteAllModels(){const e=[];return Object.keys(this.mapTileset).forEach(t=>{const n=this.mapTileset[t];n&&(this.viewer.scene.primitives.remove(n),e.push(t)),delete this.mapTileset[t],delete this.hasLoaded3dTiles[t],delete this.mapRecordModelId[t]}),this.modelList=[],this.viewer.scene.requestRender(),this.events.emit("updateModels",{modelList:[]}),e}deleteModels(e){const t=[];return e.forEach(({modelId:n})=>{const s=this.mapTileset[n];s&&(this.viewer.scene.primitives.remove(s),t.push(n)),delete this.mapTileset[n],delete this.hasLoaded3dTiles[n],delete this.mapRecordModelId[n]}),this.modelList=this.modelList.filter(n=>!t.includes(n.modelId)),this.viewer.scene.requestRender(),this.events.emit("updateModels",{modelList:this.modelList}),t}showModels(e){const t=[];return e.forEach(n=>{const s=`${n.modelId}`,o=this.mapTileset[s];o&&(o.show=!!n.show,t.push(s))}),t.length&&this.viewer.scene.requestRender(),t}async addModels({files:e,fileNames:t,options:n}){const s=e||t||[];s.length>0&&await this.add3DTilesModel(s,n)}async add3DTilesModel(e,t){const n=t?wm({},this.options,t):{...this.options};if(e?.length){for(const s of e){const o=`${s.modelId}`;if(this.mapRecordModelId[o])continue;const r=`${s.outPutPath}${s.dbName}/tileset.json`;this.modelList.push({...s,url:r,state:mi.NotLoaded}),this.mapRecordModelId[o]=!1}await this.load3DTilesModel(n)}}async load3DTilesModel(e){const t=this.modelList.filter(r=>r.state===mi.NotLoaded);if(!t.length)return;const n=t.length;this.events.emit("loadingStatus",`正在加载 ${n} 个模型`);let s=0,o=!1;for(const r of t){s++;try{r.state=mi.Loading;const l=r.url,c=this.getBaseUrlPath(l);e.loadTreeNodeDetails=!1,e.loadTreeNodeDetails&&this.events.emit("loadingStatus",`正在加载第 ${s}/${n} 个模型: 加载${r.modelName}构件信息`);let d=e.loadTreeNodeDetails?await St(`${c}${e.loadTreeNodeDetailsUrl}`):!1;e.loadTree=!1,e.loadTree&&this.events.emit("loadingStatus",`正在加载第 ${s}/${n} 个模型: 加载${r.modelName}目录树`);const h=e.loadTree?await St(`${c}${e.loadTreeUrl}`):!1;this.events.emit("loadingStatus",`正在加载第 ${s}/${n} 个模型: 加载${r.modelName}模型数据`);const f=e.boxRegionUrl?await St(`${c}${e.boxRegionUrl}`):!1,m=e.batchIDInfoUrl?await St(`${c}${e.batchIDInfoUrl}`):!1;m&&(d||(d=m));const u=await this.loadTilesetWithZipSupport(l,r.modelId,e.tilesetOptions||{},this.cesium);this.viewer.scene.primitives.add(u),await u.readyPromise;const g=`${u?.asset?.tilesetVersion??r.modelId}`;this.mapTileset[`${r.modelId}`]=u;const A={versionId:g,selectedFn:e.selectedFn,model:{modelId:r.modelId,modelName:r.modelName,dbName:r.dbName,fileType:r.fileType,outPutPath:r.outPutPath,url:r.url,treeUrl:`${c}${e.loadTreeUrl}`,nodeUrl:`${c}${e.loadTreeNodeDetailsUrl}`,formData:r.formData,type:"BIM"},node:d||null,tree:h||null,box:null};if(f?.min&&f?.max){const p={x:f.min.X,y:f.min.Y,z:f.min.Z},y={x:f.max.X,y:f.max.Y,z:f.max.Z},C={x:(p.x+y.x)/2,y:(p.y+y.y)/2,z:(p.z+y.z)/2};A.box={min:p,max:y,center:C}}if(!r.formData){const p=await St(`${r.outPutPath}${r.dbName}${e.regionUrl}`);if(p)r.formData={modelId:r.modelId.toString(),longitude:p.Longitude,latitude:p.Latitude,distance:1e-6,rotation:30,totalRotation:p.DAngle||0,height:p.MinHeight,lonlat:1e-5,heightDistance:1,modelOptions:[{value:r.modelId.toString(),label:r.modelName}],X:p?.X||0,Y:p?.Y||0,Z:p?.Z||0};else{const y=t.indexOf(r);r.formData={modelId:r.modelId.toString(),longitude:118.12548706388897,latitude:24.596796919444404,distance:1e-5,rotation:0,totalRotation:0,heightDistance:1,height:0,lonlat:1e-5,modelOptions:[{value:y+1,label:r.modelName}],X:0,Y:0,Z:0}}}r.formData&&(r.formData.heightDistance=r.formData.heightDistance??1,A.model.formData=r.formData),u.leiting=A,oo({Cesium:this.cesium,tileset:u}),r.state=mi.Loaded,this.mapRecordModelId[r.modelId]=!0,this.events.emit("tilesetLoaded",u),e.tilesLoad3dTiles&&e.tilesLoad3dTiles(u),!o&&e.flyTo&&(this.BIMmodelId=r.modelId,this.flyToTileset({modelId:this.BIMmodelId,options:{duration:e.flyToDuration??0}}),o=!0),e.delay&&await new Promise(p=>setTimeout(p,e.delay))}catch(l){console.error(`模型 ${r.modelName} 加载失败:`,l),this.events.emit("loadingStatus",`模型 ${r.modelName} 加载失败`),r.state=mi.Error}}e.mountAll3Dtiles&&e.mountAll3Dtiles(this.modelList),e.onMountAll3Dtiles&&e.onMountAll3Dtiles(this.modelList),this.events.emit("loadingStatus",""),this.events.emit("mountAll3Dtiles",{modelList:this.modelList,mapTileset:this.mapTileset})}async addOSGB({files:e,options:t}){const n=this.cesium;if(!e?.length)return;this.events.emit("loadingStatus",`正在加载 ${e.length} 个倾斜摄影模型`);let s=!1,o=0;for(const r of e){o++,this.events.emit("loadingStatus",`正在加载第 ${o}/${e.length} 个模型: 加载${r.modelName}`);try{const{outPutPath:l,dbName:c,modelId:d}=r,h=`${l}${c}/tileset.json`,f=await n.Cesium3DTileset.fromUrl(h,{maximumScreenSpaceError:16,preferLeaves:!0,cullWithChildrenBounds:!0,...t?.tilesetOptions});if(f.colorBlendMode=this.cesium.Cesium3DTileColorBlendMode.REPLACE,this.viewer.scene.primitives.add(f),await f.readyPromise,this.mapTileset[`${d}`]=f,this.hasLoaded3dTiles[`${d}`]=(this.hasLoaded3dTiles[`${d}`]||0)+1,this.mapRecordModelId[`${d}`]=!0,!r?.formData){const m=f.root.computedTransform;if(m){const u=n.Matrix4.fromColumnMajorArray(m),g=n.Matrix4.getTranslation(u,new n.Cartesian3),A=n.Ellipsoid.WGS84.cartesianToCartographic(g),p=n.Math.toDegrees(A.longitude),y=n.Math.toDegrees(A.latitude),C=A.height;r.formData={modelId:r.modelId.toString(),longitude:p,latitude:y,distance:1e-5,rotation:0,totalRotation:0,heightDistance:1,height:C,lonlat:1e-5,modelOptions:[{value:r.modelId.toString(),label:r.modelName}],X:0,Y:0,Z:0}}else console.warn(`OSGB模型 ${d} 无法获取初始位置信息`)}r.formData&&(r.formData.heightDistance=r.formData.heightDistance??1),f.leiting={versionId:`${f?.asset?.tilesetVersion??d}`,selectedFn:t?.selectedFn,model:{modelId:r.modelId,modelName:r.modelName,dbName:r.dbName,fileType:r.fileType,outPutPath:r.outPutPath,url:h,formData:r.formData,type:"OSGB"},box:null},oo({Cesium:this.cesium,tileset:f}),this.modelList.push({...r,url:h,state:mi.Loaded}),!s&&t?.flyTo&&(this.BIMmodelId=r.modelId,this.viewer.zoomTo(f),s=!0)}catch(l){console.error(`OSGB模型 ${r.dbName} 加载失败:`,l);continue}}this.events.emit("loadingStatus",""),this.events.emit("onMountAllOsgb3Dtiles",{modelList:this.modelList,mapTileset:this.mapTileset}),t?.onMountAllOsgb3Dtiles(this.modelList)}updateOSGBMatrix(e){const{X:t,Y:n,Z:s,modelId:o}=e,r=this.cesium,l=this.mapTileset[o];if(!l){console.warn("tileSet not found for modelId:",o);return}let c=t||0,d=n||0,h=s||0;const f=l.boundingSphere.center,m=r.Transforms.eastNorthUpToFixedFrame(f),u=new r.Cartesian3(c,d,h),g=r.Matrix4.multiplyByPoint(m,u,new r.Cartesian3(0,0,0)),A=r.Cartesian3.subtract(g,f,new r.Cartesian3);l.modelMatrix=r.Matrix4.fromTranslation(A)}flyToTileset({modelId:e=this.BIMmodelId,options:t={}}={}){const s=this.getMapTileset()[e];if(!s||!this.viewer)return;const{complete:o,cancel:r,...l}=t,c={duration:0,...l};this.viewer.flyTo(s,c).then(d=>{d?o&&o():r&&r()}).catch(d=>{r&&r(),console.error("FlyTo error",d)})}getMapTileset(){return this.mapTileset}getBIMmodelId(){return this.BIMmodelId}getModelList(){return this.modelList}setMapTileset(e){this.mapTileset=e}setBIMmodelId(e){this.BIMmodelId=e}setModelList(e){this.modelList=e}getBaseUrlPath(e){const t=e.lastIndexOf("/");return t===-1?".":e.substr(0,t)}async loadTilesetWithZipSupport(e,t,n,s){try{const o=encodeURI(`${this.getBaseUrlPath(e)}/tileset.zip`);if((await fetch(o,{method:"HEAD"})).status===200){const c=await St(o);if(c){const d=this.getBaseUrlPath(e),h=u=>{!u||typeof u!="object"||(typeof u.uri=="string"&&!/^(data:|https?:\/\/)/i.test(u.uri)&&(u.uri=encodeURI(`${d}/${u.uri.replace(/^\.?\//,"")}`)),Object.values(u).forEach(g=>{if(Array.isArray(g)){g.forEach(A=>h(A));return}g&&typeof g=="object"&&h(g)}))};h(c);const f=`data:text/plain;base64,${btoa(unescape(encodeURIComponent(JSON.stringify(c))))}`,m=new s.Resource({url:f});try{return await s.Cesium3DTileset.fromUrl(m,{id:t,...n})}catch{return await s.Cesium3DTileset.fromUrl(e,{url:e,id:t,...n})}}}return await s.Cesium3DTileset.fromUrl(e,{url:e,id:t,...n})}catch{return await s.Cesium3DTileset.fromUrl(e,{url:e,id:t,...n})}}async loadTreeForModel(e){const t=this.mapTileset[e];if(!t||!t.leiting)return null;if(t.leiting.tree)return t.leiting.tree;const n=t.leiting.model?.modelName||e,s=t.leiting.model?.treeUrl;if(!t.leiting.model?.dbName&&!s)return null;this.lazyLoadingCount++,this.events.emit("loadingStatus",`正在加载 ${n} 目录树...`);try{if(s){const r=await St(s);if(On(r)&&r[0].name&&(r[0].name=n),r)return t.leiting.tree=r,r}}catch(r){console.error(`Failed to load tree for model ${e}:`,r)}finally{this.lazyLoadingCount--,this.lazyLoadingCount<=0&&(this.lazyLoadingCount=0,this.events.emit("loadingStatus",""))}return null}async _loadNodeDetailsForModel(e){const t=this.mapTileset[e];if(!t||!t.leiting)return null;if(t.leiting?.node?.nodeExtras)return t.leiting.node;const n=t.leiting.model?.nodeUrl,s=t.leiting.model?.modelName||e;if(!n)return null;this.lazyLoadingCount++,this.events.emit("loadingStatus",`正在加载 ${s} 构件详情...`);try{const o=await St(n);if(o)return o.batchIdEIDInfos||(o.batchIdEIDInfos=t.leiting.node.batchIdEIDInfos),t.leiting.node=o,o}catch(o){console.error(`Failed to load node details for model ${e}:`,o)}finally{this.lazyLoadingCount--,this.lazyLoadingCount<=0&&(this.lazyLoadingCount=0,this.events.emit("loadingStatus",""))}return null}async loadNodeDetailsForModel(e){const t=this.mapTileset[e];if(!t||!t.leiting)return null;if(t.leiting?.node?.nodeExtras)return t.leiting.node;const n=t.leiting.model?.nodeUrl,s=t.leiting.model?.modelName||e;if(!n)return null;this.lazyLoadingCount++,this.events.emit("loadingStatus",`正在加载 ${s} 构件详情...`);try{const o=await St(n);if(o)return o.batchIdEIDInfos||(o.batchIdEIDInfos=t.leiting.node.batchIdEIDInfos),t.leiting.node=o,o}catch(o){console.error(`Failed to load node details for model ${e}:`,o)}finally{this.lazyLoadingCount--,this.lazyLoadingCount<=0&&(this.lazyLoadingCount=0,this.events.emit("loadingStatus",""))}return null}}const xl={normal:0,process:2},Zp={color:1};function Ml(i){return i===1||i==="exist"?1:i===2||i==="process"?2:0}function Ei(i){return Number.isNaN(i)?0:i<=1?Math.min(Math.max(i,0),1):Math.min(Math.max(i/255,0),1)}function Bl(i){return Number.isNaN(i)?1:i<=1?Math.min(Math.max(i,0),1):1}function Bo(i){if(!i)return null;const e=Number(i.r),t=Number(i.g),n=Number(i.b),s=i.a===void 0?1:Number(i.a);if([e,t,n,s].some(c=>Number.isNaN(c)))return null;const o=Math.round(e*255),r=Math.round(t*255),l=Math.round(n*255);return`rgba(${o},${r},${l},${s})`}function e0(i){if(!i||typeof i!="string")return null;const t=i.replace(/\s+/g,"").match(/^rgba?\((\d+),(\d+),(\d+)(?:,([0-9.]+))?\)$/i);if(!t)return null;const n=Number(t[1]),s=Number(t[2]),o=Number(t[3]),r=t[4]===void 0?1:Number(t[4]);return[n,s,o,r].some(l=>Number.isNaN(l))?null:{r:Math.min(Math.max(n/255,0),1),g:Math.min(Math.max(s/255,0),1),b:Math.min(Math.max(o/255,0),1),a:Math.min(Math.max(r,0),1)}}function t0(i){if(i==null)return null;const e=Number(i);return Number.isNaN(e)?null:e}function i0(i){const e=i.lastIndexOf("-"),t=i.substring(0,e),n=i.substring(e+1);return[t,n]}function To(i){if(!i)return null;const e=i.Min??i.min,t=i.Max??i.max;if(!e||!t)return null;const n=Number(e.x??e.X),s=Number(e.y??e.Y),o=Number(e.z??e.Z),r=Number(t.x??t.X),l=Number(t.y??t.Y),c=Number(t.z??t.Z);return[n,s,o,r,l,c].some(d=>Number.isNaN(d))?null:{min:{x:n,y:s,z:o},max:{x:r,y:l,z:c}}}function qi(i,e){if(e)return`${e}`;const t=i?.leiting?.model?.modelId??i?.modelId??i?.id;return t==null?null:`${t}`}function n0(i,e){if(e==null)return null;const t=i?.leiting?.node;if(!t)return null;const n=`${e}`,s=t?.[n],o=To(s?.box3??s?.box);if(o)return o;const r=t?.element?.[n]??t?.elements?.[n]??t?.nodeExtras?.element?.[n]??t?.nodeExtras?.elements?.[n];return To(r?.box3??r?.box)}function s0(i){const e=i?.leiting?.box;return e?To({min:e.min,max:e.max}):null}class o0{base;constructor(e){this.base=e}initTime(){const t=this.base.cesium.JulianDate.fromDate(new Date(2023,3,21,10,0));this.base.viewer.clock.currentTime=t,this.base.start=this.base.viewer.clock.currentTime.secondsOfDay*1e3}processAnimation(e,t,n,s=null){if(this.base.start==null)return;const o=this.base.start+(e?.delay??0),r=this.base.start+(e?.playtime??0)+(e?.delay??0);t<=o&&(e.cash=!0,e.groupData.forEach(l=>{const{batchIds:c,modelId:d,rgba:h}=l;if(Array.isArray(c)&&c[0]){c[0][1]=h;const f=n[d];f?f.push(c[0]):n[d]=[c[0]]}})),t>=o&&t<r&&(s!==null&&(this.base.viewer.scene.ambientLightIntensity=s),e.cash=!1,e.playCash=!0,e.groupData.forEach(l=>{const{batchIds:c,playTimeColor:d,modelId:h}=l;if(Array.isArray(c)&&c[0]){c[0][1]=d;const f=n[h];f?f.push(c[0]):n[h]=[c[0]]}})),t>=r&&(e.finished=!0)}onTick=e=>{if(!this.base.cesium||!this.base.viewer)return;const t=e?.currentTime?.secondsOfDay?e.currentTime.secondsOfDay*1e3:this.base.viewer.clock.currentTime.secondsOfDay*1e3,n={};Array.isArray(this.base.data)&&this.base.data.forEach(o=>{this.processAnimation(o,t,n,.1)});const s=Object.entries(n);if(s.forEach(([o,r])=>{this.base.setTileSyltByConstructionProcessTracking({modelId:o,batchIds:r})}),Object.keys(this.base.mapAnimations).forEach(o=>{const r=this.base.mapAnimations[o];r.length&&r.every(l=>l.finished)&&!this.base.clearedModelIds.has(o)&&(this.base.setTileSyltByConstructionProcessTracking({modelId:o,batchIds:[]}),this.base.clearedModelIds.add(o))}),this.base.recoverStaus){s.length&&(this.base.recoverStaus=!1);return}s.length===0&&Array.isArray(this.base.data)&&this.base.data.forEach(o=>{o.groupData.forEach(r=>{const{modelId:l}=r;this.base.setTileSyltByConstructionProcessTracking({modelId:l,batchIds:[]})}),this.base.recoverStaus=!0})};enableConstructionProgressTracking(){this.base.clearedModelIds.clear(),this.initTime(),this.base.groupBatchIds={},Array.isArray(this.base.data)&&(this.base.data.forEach(e=>{e.cash=!1,e.playCash=!1,e.groupData.forEach(t=>{const{batchIds:n,modelId:s,rgba:o}=t;if(Array.isArray(n)&&n[0]){n[0][1]=o;const r=this.base.groupBatchIds[s];r?r.push(n[0]):this.base.groupBatchIds[s]=[n[0]]}})}),Object.entries(this.base.groupBatchIds).forEach(([e,t])=>{this.base.setTileSyltByConstructionProcessTracking({modelId:e,batchIds:t})})),this.base.viewer.clock.onTick.addEventListener(this.onTick)}disableConstructionProgressTracking(){this.base.viewer.clock.onTick.removeEventListener(this.onTick),this.base.viewer.scene.ambientLightIntensity=1,Array.isArray(this.base.data)&&this.base.data.forEach(e=>{e.cash=!0,e.playCash=!0,e.groupData.forEach(t=>{const{modelId:n}=t,s=[];this.base.setTileSyltByConstructionProcessTracking({modelId:n,batchIds:s})})}),this.base.start=null}freshConstructionProgressTracking(){const e=this.base.viewer.clock.currentTime.secondsOfDay*1e3,t={};Array.isArray(this.base.data)&&this.base.data.forEach(s=>{s.playCash=!1,this.processAnimation(s,e,t)});const n=Object.entries(t);n.forEach(([s,o])=>{this.base.setTileSyltByConstructionProcessTracking({modelId:s,batchIds:o})}),n.length===0&&Array.isArray(this.base.data)&&this.base.data.forEach(s=>{s.groupData.forEach(o=>{const{modelId:r}=o;this.base.setTileSyltByConstructionProcessTracking({modelId:r,batchIds:[]})})})}reStartAnimation(){let e={};this.base.clearedModelIds.clear(),Array.isArray(this.base.data)&&this.base.data.forEach(t=>{t.cash=!1,t.playCash=!1,t.groupData.forEach(n=>{const{batchIds:s,modelId:o,rgba:r}=n;if(Array.isArray(s)&&s[0]){s[0][1]=r;const l=e[o];l?l.push(s[0]):e[o]=[s[0]]}})}),Object.entries(e).forEach(([t,n])=>{this.base.setTileSyltByConstructionProcessTracking({modelId:t,batchIds:n})}),this.initTime()}setAllConstructionProgressTracking(e){this.base.data=e,Array.isArray(this.base.data)&&this.base.data.forEach(t=>{t.cash=!1,t.playCash=!1,t.groupData=[],t.finished=!1,t.mergeCpts.forEach(n=>{const s=[];n.cpts.forEach(c=>{s.push({dbName:n.linkModelId,modelId:n.modelId,elementId:`${c}`,show:!0,rgba:t.rgba??{r:.2,g:.2,b:.2,a:.2}})});const o=xl.process,r=Zp.color,{allElements:l}=this.base.groupByModelId(s);this.base.mapAnimations[n.modelId]=this.base.mapAnimations[n.modelId]||[],this.base.mapAnimations[n.modelId].push(t),Object.entries(l).forEach(([c,d])=>{const[h,f]=i0(c),m=this.base.getTileSyltByConstructionProcessTracking({elementIds:d,modelId:h,color:f,colorRank:o,show:!0,selectionRank:r}),u=t?.playTimeColor?.r??1,g=t?.playTimeColor?.g??1,A=t?.playTimeColor?.b??0,p=t?.playTimeColor?.a??.1,y=this.base.setColor({r:u,g,b:A,a:p}),C=this.base.setColor(t.rgba??{r:.2,g:.2,b:.2,a:.2});t.groupData.push({modelId:h,batchIds:m,playTimeColor:y,rgba:C})})})})}}class a0{base;constructor(e){this.base=e}attachTileset(e,t,n){const s=this.base.cesium;this.base.handler||(this.base.handler=new s.ScreenSpaceEventHandler(this.base.viewer.scene.canvas));const o=qi(e,n);o&&(this.base.tilesetMap[o]=e),t&&(this.base.selectedColor=t),this.bindInputs()}bindInputs(){if(!this.base.handler)return;const e=this.base.cesium;this.base.handler.setInputAction(async t=>{if(!this.base.clickToHighlightEnabled){await this.base.clearSelection();return}let n;try{n=this.base.viewer.scene.pick(t.position)}catch{}if(e.defined(n)&&n instanceof e.Cesium3DTileFeature){await this.base.clearSelection();const s=qi(n.tileset);if(!s||!this.base.tilesetMap[s])return;const o=this.base.getFeatureId(n);if(o==="-1")return;let r;const l=this.base.viewer.scene.pickPosition(t.position);if(e.defined(l)){const h=e.Cartographic.fromCartesian(l),f=e.Math.toDegrees(h.longitude),m=e.Math.toDegrees(h.latitude),u=h.height;r=[f,m,u]}const d=(this.base.hasSelectedFeaturesMap[s]||[]).filter(h=>h.rank!==0);if(this.base.hasSelectedFeaturesMap[s]=[...d,{batchId:o,selectedColor:this.base.selectedColor,rank:0,point:r,isTrigger:!0}],this.base.setBaseStyle(s),await this.base.triggerSelectionChange(s),n.tileset.leiting?.selectedFn)if(n.tileset.leiting.node){const h=n.tileset.leiting.node.batchIdEIDInfos[o].elementID,f=n.tileset.leiting.node.nodeExtras.element[h];f.elementId=h,f.modelId=n.tileset.leiting.model.modelId,n.tileset.leiting.selectedFn({elementInfo:f,elementId:h,point:r,modelId:n.tileset.leiting.model.modelId,_propsData:f})}else n.tileset.leiting.selectedFn(null)}else await this.base.clearSelection()},e.ScreenSpaceEventType.LEFT_CLICK),this.base.handler.setInputAction(async t=>{let n;try{n=this.base.viewer.scene.pick(t.position)}catch{}if(e.defined(n)&&n instanceof e.Cesium3DTileFeature){const s=qi(n.tileset);if(!s||!this.base.tilesetMap[s])return;const o=this.base.getFeatureId(n);if(o==="-1")return;let r;const l=this.base.viewer.scene.pickPosition(t.position);if(e.defined(l)){const c=e.Cartographic.fromCartesian(l),d=e.Math.toDegrees(c.longitude),h=e.Math.toDegrees(c.latitude),f=c.height;r=[d,h,f]}await this.base.toggleMultiSelect(s,o,this.base.selectedColor,r)}},e.ScreenSpaceEventType.LEFT_CLICK,e.KeyboardEventModifier.CTRL),this.base.handler.setInputAction(t=>{this.base.ensureSelectionDiv();const n=this.base.viewer?.scene?.screenSpaceCameraController;n&&this.base.cameraControllerState===null&&(this.base.cameraControllerState={enableRotate:n.enableRotate,enableTilt:n.enableTilt,enableLook:n.enableLook},n.enableRotate=!1,n.enableTilt=!1,n.enableLook=!1),this.base.selectStart=this.base.cesium.Cartesian2.clone(t.position),this.base.selectEnd=null,this.base.selectionDiv&&this.base.selectStart&&(this.base.selectionDiv.style.left=`${this.base.selectStart.x}px`,this.base.selectionDiv.style.top=`${this.base.selectStart.y}px`,this.base.selectionDiv.style.width="0px",this.base.selectionDiv.style.height="0px",this.base.selectionDiv.style.display="block")},e.ScreenSpaceEventType.LEFT_DOWN,e.KeyboardEventModifier.CTRL),this.base.handler.setInputAction(t=>{if(!this.base.selectStart||!this.base.selectionDiv)return;const n=performance.now();if(n-this.base.lastDrawTime<20)return;this.base.lastDrawTime=n,this.base.selectEnd=this.base.cesium.Cartesian2.clone(t.endPosition);const s=Math.min(this.base.selectStart.x,this.base.selectEnd.x),o=Math.min(this.base.selectStart.y,this.base.selectEnd.y),r=Math.abs(this.base.selectStart.x-this.base.selectEnd.x),l=Math.abs(this.base.selectStart.y-this.base.selectEnd.y);this.base.selectionDiv.style.left=`${s}px`,this.base.selectionDiv.style.top=`${o}px`,this.base.selectionDiv.style.width=`${r}px`,this.base.selectionDiv.style.height=`${l}px`,this.base.selectionDiv.style.backgroundColor="rgba(0, 255, 255, 0.5)",this.base.selectionDiv.style.position="absolute",this.base.selectionDiv.style.zIndex="2"},e.ScreenSpaceEventType.MOUSE_MOVE,e.KeyboardEventModifier.CTRL),this.base.handler.setInputAction(async()=>{if(!this.base.selectStart||!this.base.selectionDiv)return;if(!this.base.selectStart||!this.base.selectEnd){this.base.selectionDiv.style.display="none";const n=this.base.viewer?.scene?.screenSpaceCameraController;n&&this.base.cameraControllerState!==null&&(n.enableRotate=this.base.cameraControllerState.enableRotate,n.enableTilt=this.base.cameraControllerState.enableTilt,n.enableLook=this.base.cameraControllerState.enableLook,this.base.cameraControllerState=null);return}this.base.selectionDiv.style.display="none",await this.base.selectTilesInRectangle(this.base.selectStart,this.base.selectEnd,this.base.selectedColor),this.base.viewer.scene.requestRender(),this.base.selectStart=null,this.base.selectEnd=null;const t=this.base.viewer?.scene?.screenSpaceCameraController;t&&this.base.cameraControllerState!==null&&(t.enableRotate=this.base.cameraControllerState.enableRotate,t.enableTilt=this.base.cameraControllerState.enableTilt,t.enableLook=this.base.cameraControllerState.enableLook,this.base.cameraControllerState=null)},e.ScreenSpaceEventType.LEFT_UP,e.KeyboardEventModifier.CTRL)}unbindInputs(){if(!this.base.handler)return;const e=this.base.cesium;this.base.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_CLICK),this.base.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_CLICK,e.KeyboardEventModifier.CTRL),this.base.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_DOWN,e.KeyboardEventModifier.CTRL),this.base.handler.removeInputAction(e.ScreenSpaceEventType.MOUSE_MOVE,e.KeyboardEventModifier.CTRL),this.base.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_UP,e.KeyboardEventModifier.CTRL)}}class r0{cesium;viewer;data;handler;selectedColor="rgba(255,0,0,1.0)";tilesetMap={};hasSelectedFeaturesMap={};colorRankColor=[];showStateMap={};selectedPosition={x:null,y:null};selectionDiv=null;lastDrawTime=0;selectStart=null;selectEnd=null;cameraControllerState=null;start=null;groupBatchIds={};recoverStaus=!1;mapAnimations={};clearedModelIds=new Set;eidToBatchIdMap={};batchIdToElementIdMap={};animationModule;selectionModule;onSelectionChangeCallbacks=[];loadNodeDetailsForModel;loadNodeDetailsCallback;clickToHighlightEnabled=!0;constructor(e){this.cesium=e.cesium,this.viewer=e.viewer,this.animationModule=new o0(this),this.selectionModule=new a0(this)}attachTileset(e,t,n){this.selectionModule.attachTileset(e,t,n)}setLoadNodeDetailsCallback(e){this.loadNodeDetailsCallback=e}selectionChange(e){e&&typeof e=="function"&&this.onSelectionChangeCallbacks.push(e)}removeSelectionChange(e){this.onSelectionChangeCallbacks=this.onSelectionChangeCallbacks.filter(t=>t!==e)}async triggerSelectionChange(e){if(e)await this.loadNodeDetailsForModel(e);else{const t=Object.keys(this.hasSelectedFeaturesMap);t.length>0&&await Promise.all(t.map(n=>{try{return this.loadNodeDetailsForModel(n)}catch(s){return console.error(`Error loading node details for model ${n}:`,s),Promise.resolve()}}))}if(this.onSelectionChangeCallbacks.length>0){const t=await this.getSelected({rank:0});this.onSelectionChangeCallbacks.forEach(n=>{try{n(t)}catch(s){console.error("Selection callback error:",s)}})}}enableSelection(){this.selectionModule.bindInputs()}disableSelection(){this.selectionModule.unbindInputs()}async clearSelection(e){this.getTargetModelIds(e).forEach(n=>{const s=this.hasSelectedFeaturesMap[n];if(!s?.length)return;const o=s.filter(r=>r.rank!==0);o.length?(this.hasSelectedFeaturesMap[n]=o,this.setBaseStyle(n)):(delete this.hasSelectedFeaturesMap[n],this.applyShowStyleOnly(n))}),this.viewer.scene.requestRender(),await this.triggerSelectionChange(e)}clearExist(e){this.getTargetModelIds(e).forEach(n=>{const s=this.hasSelectedFeaturesMap[n];if(!s?.length)return;const o=s.filter(r=>r.rank!==1);o.length?(this.hasSelectedFeaturesMap[n]=o,this.setBaseStyle(n)):(delete this.hasSelectedFeaturesMap[n],this.applyShowStyleOnly(n))}),this.viewer.scene.requestRender()}clearProcess(e){this.getTargetModelIds(e).forEach(n=>{const s=this.hasSelectedFeaturesMap[n];if(!s?.length)return;const o=s.filter(r=>r.rank!==2);o.length?(this.hasSelectedFeaturesMap[n]=o,this.setBaseStyle(n)):(delete this.hasSelectedFeaturesMap[n],this.applyShowStyleOnly(n))}),this.viewer.scene.requestRender()}async clearAllHaveSelected(){this.getTargetModelIds().forEach(t=>{this.hasSelectedFeaturesMap[t]&&(delete this.hasSelectedFeaturesMap[t],this.applyShowStyleOnly(t))}),this.viewer.scene.requestRender(),await this.triggerSelectionChange()}async loadAllNodeDetailsForModel(){for(const e of Object.keys(this.tilesetMap))await this.loadNodeDetailsForModel(e)}getSelected(e){const t=e&&typeof e=="object"&&"rank"in e?e.rank:e,n=Ml(t),s=[];for(const o of Object.keys(this.hasSelectedFeaturesMap))(this.hasSelectedFeaturesMap[o]||[]).forEach(l=>{if(l.rank!==n)return;const c=e0(l.selectedColor);let d=this.getBatchIdToElementIdSync(l.batchId,o);d===null&&(d=l.batchId),l.isTrigger&&s.push({elementId:d,modelId:o,rgba:c||void 0,point:l?.point||void 0})});return s}getBatchIdToElementIdSync(e,t){if(this.batchIdToElementIdMap[t])return this.batchIdToElementIdMap[t].get(e)??null;const s=this.tilesetMap[t]?.leiting?.node?.batchIdEIDInfos;if(s&&Array.isArray(s)){const o=new Map;return s.forEach(r=>{r&&r.elementID&&o.set(`${r.batchId}`,`${r.elementID}`)}),this.batchIdToElementIdMap[t]=o,o.get(e)??null}return null}setAllConstructionProgressTracking(e){this.animationModule.setAllConstructionProgressTracking(e)}initTime(){this.animationModule.initTime()}processAnimation(e,t,n,s=null){this.animationModule.processAnimation(e,t,n,s)}onTick=e=>{this.animationModule.onTick(e)};enableConstructionProgressTracking(){this.animationModule.enableConstructionProgressTracking()}disableConstructionProgressTracking(){this.animationModule.disableConstructionProgressTracking()}freshConstructionProgressTracking(){this.animationModule.freshConstructionProgressTracking()}reStartAnimation(){this.animationModule.reStartAnimation()}setTileSyltByConstructionProcessTracking({modelId:e,batchIds:t}){const n=this.tilesetMap[e];if(!n)return;const s=n?.style?.show?.conditionsExpression?.conditions;Array.isArray(t)&&t.length?s?n.style=new this.cesium.Cesium3DTileStyle({show:{conditions:s},color:{conditions:t}}):n.style=new this.cesium.Cesium3DTileStyle({color:{conditions:t}}):this.applyShowStyleOnly(e),this.viewer.scene.requestRender()}resumeFlyTo(){this.viewer.clock.shouldAnimate=!0}pauseFlyTo(){this.viewer.clock.shouldAnimate=!1}async flyToObjects({selectCpts:e,options:t}){if(!Array.isArray(e)||e.length===0)return;await this.clearSelection(),await this.setSelectColorUserModelCpt(e,{rank:0});const n=this.cesium,s=t?.scale??1,o=[];for(const r of e){const l=r?.modelId;if(l==null)continue;await this.loadNodeDetailsForModel(l);const c=r?.elementId,d=this.tilesetMap[`${l}`];if(!d)continue;const f=n0(d,c)||s0(d);if(!f)continue;const m=new n.Cartesian3(f.min.x,f.min.y,f.min.z),u=new n.Cartesian3(f.max.x,f.max.y,f.max.z),g=d?.root?.computedTransform??d?.modelMatrix;if(g){const A=n.Matrix4.multiplyByPoint(g,m,new n.Cartesian3),p=n.Matrix4.multiplyByPoint(g,u,new n.Cartesian3);o.push(A,p)}else o.push(m,u)}if(o.length){const r=n.BoundingSphere.fromPoints(o);r.radius=r.radius*s;const l=this.viewer.scene.camera,c=new n.HeadingPitchRange(l.heading,l.pitch,0);l.flyToBoundingSphere(r,{duration:t?.duration??0,complete:t?.complete,offset:c})}else{const r=e[0]?.modelId,l=r?this.tilesetMap[`${r}`]:null;l&&this.viewer.flyTo(l,{duration:t?.duration??0,complete:t?.complete})}}setBaseStyle(e){this.getTargetModelIds(e).forEach(n=>{this.setColorStyle(n)})}setColorStyle(e){this.updateTilesetStyle(e)}buildColorConditions(e){const t=this.tilesetMap[e],n=this.hasSelectedFeaturesMap[e];if(!t||!n?.length)return;const s=new Map;n.forEach(c=>{const d=s.get(c.batchId);(!d||c.rank>=d.rank)&&s.set(c.batchId,c)});const o=new Map;if(s.forEach(({batchId:c,selectedColor:d})=>{o.has(d)||o.set(d,new Set),o.get(d)?.add(c)}),this.colorRankColor.length){const c=new Set;this.colorRankColor.forEach(d=>{const h=o.get(d);h&&h.forEach(f=>c.add(f))}),o.forEach((d,h)=>{if(this.colorRankColor.includes(h))return;const f=new Set;d.forEach(m=>{c.has(m)||f.add(m)}),o.set(h,f)})}const r=[...this.colorRankColor.filter(c=>o.has(c)),...Array.from(o.keys()).filter(c=>!this.colorRankColor.includes(c))],l=[];return r.forEach(c=>{const d=o.get(c);if(!d||!d.size)return;const h=Array.from(d).join("|");h&&l.push([`(regExp('^(${h})$').test(\${id}))`,c])}),l.length?l:void 0}updateTilesetStyle(e){const t=this.tilesetMap[e];if(!t)return;t.colorBlendMode=this.cesium.Cesium3DTileColorBlendMode.REPLACE;const n=this.showStateMap[e],s=n?this.buildShowConditions(n.batchIds,n.mode):void 0,o=this.buildColorConditions(e);s||o?t.style=new this.cesium.Cesium3DTileStyle({show:s?{conditions:s}:void 0,color:o?{conditions:o}:void 0}):t.style=void 0,this.viewer.scene.requestRender()}setShowStyle(e){this.getTargetModelIds(e?.modelId).forEach(n=>{const s=this.showStateMap[n]||{batchIds:[],mode:"include"};this.showStateMap[n]={batchIds:e?.batchIds??s.batchIds,mode:e?.mode??s.mode},this.updateTilesetStyle(n)})}setColor(e){if(!e)return this.selectedColor;if(typeof e=="string")return e;const t=Ei(Number(e.r)),n=Ei(Number(e.g)),s=Ei(Number(e.b)),o=Bl(e.a===void 0?1:Number(e.a));return Bo({r:t,g:n,b:s,a:o})||this.selectedColor}groupByModelId(e){const t={};return e.forEach(n=>{const s=n?.modelId,o=n?.elementId;if(s==null||o===void 0||o===null)return;const r=n?.color??n?.rgba,l=this.setColor(r??{r:.4,g:.4,b:.4,a:.1}),c=`${s}-${l}`;t[c]||(t[c]=[]),t[c].push(`${o}`)}),{allElements:t,transform:null,box:null}}getBatchIds(e,t){const n=`${t}`,s=`${e}`;if(this.eidToBatchIdMap[n]){const c=this.eidToBatchIdMap[n].get(s);if(c!==void 0)return c}const r=this.tilesetMap[n]?.leiting?.node?.batchIdEIDInfos;if(r&&Array.isArray(r)){const c=new Map;r.forEach(h=>{const f=`${h.elementID}`,m=`${h.batchId}`;c.has(f)||c.set(f,[]),c.get(f).push(m)}),this.eidToBatchIdMap[n]=c;const d=c.get(s);if(d!==void 0)return d}const l=t0(e);return l!=null?[String(l)]:[]}async setComponentVisibility(e){if(Array.isArray(e)){Object.keys(this.showStateMap).forEach(t=>{this.showStateMap[t]={batchIds:[],mode:"exclude"}});for(const t of e){const n=`${t.modelId}`;this.showStateMap[n]||(this.showStateMap[n]={batchIds:[],mode:"exclude"});const s=this.showStateMap[n];if(!t.show){const o=this.getBatchIds(t.elementId,n);s.batchIds.push(...o)}}Object.keys(this.showStateMap).forEach(t=>{this.updateTilesetStyle(t)})}}async isolateComponentVisibility(e){const t={};e.forEach(n=>{const s=`${n.modelId}`;t[s]||(t[s]=new Set),t[s].add(`${n.elementId}`)});for(const n of Object.keys(this.tilesetMap)){await this.loadNodeDetailsForModel(n);const o=this.tilesetMap[n]?.leiting?.node?.batchIdEIDInfos;if(!o)continue;this.showStateMap[n]={batchIds:[],mode:"exclude"};const r=t[n];if(r&&r.size>0){const l=[];for(const c of o)r.has(`${c.elementID}`)||l.push(`${c.batchId}`);this.showStateMap[n].batchIds=l;continue}this.showStateMap[n].batchIds=o.map(l=>l.batchId)}Object.keys(this.showStateMap).forEach(n=>{this.updateTilesetStyle(n)})}async setAllComponentsVisibility(e){const t=this.getTargetModelIds();for(const n of t)await this.loadNodeDetailsForModel(n),e?this.setShowStyle({modelId:n,batchIds:[],mode:"exclude"}):this.setShowStyle({modelId:n,batchIds:[],mode:"include"})}getComponentsByVisibility(e){const t=this.getTargetModelIds(),n=[];return t.forEach(s=>{const o=this.showStateMap[s],r=this.tilesetMap[s];if(!r?.leiting?.node?.batchIdEIDInfos)return;const l=r.leiting.node.batchIdEIDInfos,c=new Set(o?.batchIds??[]),d=o?.mode??"exclude",h=new Set;l.forEach(f=>{const m=c.has(`${f.batchId}`);if((d==="include"?m:!m)===e){const g=`${f.elementID}`;h.has(g)||(n.push({elementId:g,modelId:s}),h.add(g))}})}),n}async _getComponentsByVisibility(e){const t=this.getTargetModelIds();for(const s of t)this.loadNodeDetailsForModel(s);const n=[];return t.forEach(s=>{const o=this.showStateMap[s],r=this.tilesetMap[s];if(!r?.leiting?.node?.batchIdEIDInfos)return;const l=r.leiting.node.batchIdEIDInfos,c=new Set(o?.batchIds??[]),d=o?.mode??"exclude",h=new Set;l.forEach(f=>{const m=c.has(`${f.batchId}`);if((d==="include"?m:!m)===e){const g=`${f.elementID}`;h.has(g)||(n.push({elementId:g,modelId:s}),h.add(g))}})}),n}getTileSyltByConstructionProcessTracking({elementIds:e,modelId:t,color:n,colorRank:s,show:o,selectionRank:r}){const l=this.tilesetMap[t];if(!Array.isArray(e))return[];const c=l.leiting.node,d=new Set(e),h=c.batchIdEIDInfos.filter(m=>d.has(`${m.elementID}`)).map(m=>String(m.batchId));return h.length?(s===xl.normal&&!this.colorRankColor.includes(n)&&(this.colorRankColor=[n]),[[`(regExp('^(${h.join("|")})$').test(\${id}))`,n]]):[]}async setSelectColorUserModelCpt(e,t){if(!Array.isArray(e))return;const n=new Map,s=t?.rank===void 0?"exist":t?.rank,o=Ml(s),r=t?.isTrigger??!0;for(const l of e){const c=l?.modelId;if(c==null)continue;const d=`${c}`;await this.loadNodeDetailsForModel(d);const h=Array.isArray(l?.elementIds)?l.elementIds:l?.elementId?[l.elementId]:[];if(!h.length)continue;const f=Bo(l?.rgba)||this.selectedColor;for(const m of h){const u=this.getBatchIds(m,d);if(u.length!==0){n.has(d)||n.set(d,[]);for(const g of u)n.get(d)?.push({batchId:g,selectedColor:f,rank:o,isTrigger:r})}}}for(const[l,c]of n){const d=this.mergeSelections(l,c);this.hasSelectedFeaturesMap[l]=d,this.setBaseStyle(l)}r&&await this.triggerSelectionChange()}async setAllSelectColorUserModelCpt(e,t){const{modelId:n,rgba:s}=e,o=t?.isTrigger??!0;if(!n)return;await this.loadNodeDetailsForModel(n);const r=String(n),l=this.tilesetMap[r];if(!l)return;const c=l?.leiting?.node?.batchIdEIDInfos;if(!c||!Array.isArray(c))return;const d=[];c.forEach(h=>{h&&h.elementID!==void 0&&d.push(h.elementID)}),d.length!==0&&await this.setSelectColorUserModelCpt([{modelId:r,elementIds:d,rgba:s}],{rank:0,isTrigger:o})}getFeatureId(e){if(this.cesium.defined(e)&&this.cesium.defined(e.getProperty)){const t=e.getProperty("id");return t!=null?String(t):"-1"}return"-1"}getTargetModelIds(e){return e?[e]:Object.keys(this.tilesetMap)}buildShowConditions(e,t){const n=e.join("|");return n?t==="include"?[[`(regExp('^(${n})$').test(\${id}))`,"true"],["true","false"]]:[[`(regExp('^(${n})$').test(\${id}))`,"false"],["true","true"]]:t==="include"?[["true","false"]]:void 0}applyShowStyleOnly(e){const t=this.tilesetMap[e];if(!t)return;const n=this.showStateMap[e],s=n?this.buildShowConditions(n.batchIds,n.mode):void 0;s?t.style=new this.cesium.Cesium3DTileStyle({show:{conditions:s}}):t.style=void 0}setSelectedColorRgba(e,t,n,s=1){const o=Ei(e),r=Ei(t),l=Ei(n),c=Bl(s),d=Bo({r:o,g:r,b:l,a:c});d&&(this.selectedColor=d)}mergeSelections(e,t){const n=new Map;return(this.hasSelectedFeaturesMap[e]||[]).forEach(o=>n.set(o.batchId,o)),t.forEach(o=>{const r=n.get(o.batchId);(!r||o.rank>r.rank||o.rank===r.rank)&&n.set(o.batchId,o)}),Array.from(n.values())}async toggleMultiSelect(e,t,n,s){const o=this.hasSelectedFeaturesMap[e]||[],r=o.filter(f=>f.rank!==0),l=o.filter(f=>f.rank===0),d=l.some(f=>f.batchId===t)?l.filter(f=>f.batchId!==t):[...l,{batchId:t,selectedColor:n,rank:0,point:s,isTrigger:!0}],h=[...r,...d];h.length?(this.hasSelectedFeaturesMap[e]=h,this.setBaseStyle(e)):(delete this.hasSelectedFeaturesMap[e],this.applyShowStyleOnly(e)),await this.triggerSelectionChange(e)}ensureSelectionDiv(){if(this.selectionDiv)return;const e=document.createElement("div");e.style.display="none",e.style.pointerEvents="none",e.style.border="1px solid rgba(0, 255, 255, 0.8)",this.viewer.container.appendChild(e),this.selectionDiv=e}isRepeatedClick(e){const t=e?.position;return!t||typeof t.x!="number"||typeof t.y!="number"?!1:this.selectedPosition.x===t.x&&this.selectedPosition.y===t.y?!0:(this.selectedPosition.x=t.x,this.selectedPosition.y=t.y,!1)}async selectTilesInRectangle(e,t,n){const s=Math.min(e.x,t.x),o=Math.max(e.x,t.x),r=Math.min(e.y,t.y),l=Math.max(e.y,t.y),c=o-s,d=l-r;if(Math.abs(c)<15||Math.abs(d)<15)return;const h=s+c/2,f=r+d/2,m=new this.cesium.Cartesian2(h,f),u=this.viewer.scene.drillPick(m,void 0,c,d);if(!Array.isArray(u))return;const g=new Map;u.forEach(A=>{if(!(A instanceof this.cesium.Cesium3DTileFeature))return;const p=qi(A.tileset);if(!p||!this.tilesetMap[p])return;const y=this.getFeatureId(A);y!=="-1"&&(g.has(p)||g.set(p,new Set),g.get(p)?.add(y))}),g.forEach((A,p)=>{const y=this.hasSelectedFeaturesMap[p]||[],C=y.filter(M=>M.rank!==0),I=new Set(y.filter(M=>M.rank===0).map(M=>M.batchId)),P=[];A.forEach(M=>{I.has(M)||P.push({batchId:M,selectedColor:n,rank:0,isTrigger:!0})});const k=y.filter(M=>M.rank===0);this.hasSelectedFeaturesMap[p]=[...C,...k,...P],this.setBaseStyle(p)}),await this.triggerSelectionChange()}}class l0{cesium;viewer;tilesetMap={};planeEntities=[];clippingPlanesMap={};activeModelIds=new Set;boxMatrix=null;boxInverseMatrix=null;boxCenter=null;boxOrientation=null;targetZPlus=0;targetZMinus=0;targetXPlus=0;targetXMinus=0;targetYPlus=0;targetYMinus=0;currentPlaneType="";selectedPlane=null;hoveredPlane=null;dragStartPoint=null;moveCallBack=null;downHandler=null;upHandler=null;moveHandler=null;constructor(e){this.cesium=e.cesium,this.viewer=e.viewer}attachTileset(e,t){this.tilesetMap[t]=e}open(e,t){!this.tilesetMap[e]||this.activeModelIds.has(e)||(this.activeModelIds.add(e),this.moveCallBack=t?.moveCallBack,this.fitToModels(),this.activeModelIds.size===1&&(this.createPlaneEntities(),this.initEventHandlers()))}setupClippingPlanes(e){const t=this.cesium,n=this.tilesetMap[e];if(!n||!this.boxMatrix)return;const s=new t.ClippingPlaneCollection({planes:[new t.ClippingPlane(new t.Cartesian3(1,0,0),this.targetXMinus),new t.ClippingPlane(new t.Cartesian3(-1,0,0),this.targetXPlus),new t.ClippingPlane(new t.Cartesian3(0,1,0),this.targetYMinus),new t.ClippingPlane(new t.Cartesian3(0,-1,0),this.targetYPlus),new t.ClippingPlane(new t.Cartesian3(0,0,1),this.targetZMinus),new t.ClippingPlane(new t.Cartesian3(0,0,-1),this.targetZPlus)],edgeWidth:2,edgeColor:t.Color.WHITE,enabled:!0,unionClippingRegions:!0}),o=t.Matrix4.inverse(n.root.transform,new t.Matrix4);s.modelMatrix=t.Matrix4.multiply(o,this.boxMatrix,new t.Matrix4),n.clippingPlanes=s,this.clippingPlanesMap[e]=s}createPlaneEntities(){const e=this.cesium,t=this.viewer;this.planeEntities.forEach(s=>t.entities.remove(s)),this.planeEntities=[];const n=["left","right","behind","front","top","down"];for(const s of n){const o=t.entities.add({name:s,position:new e.CallbackProperty(()=>{if(!this.boxMatrix)return e.Cartesian3.ZERO;const r=this.getPlaneOffsetCartesian(s);return e.Matrix4.multiplyByPoint(this.boxMatrix,r,new e.Cartesian3)},!1),orientation:new e.CallbackProperty(()=>this.boxOrientation||e.Quaternion.IDENTITY,!1),plane:{dimensions:new e.CallbackProperty(()=>{if(this.activeModelIds.size===0)return new e.Cartesian2(0,0);const r=.1,l=Math.max(r,this.targetXMinus+this.targetXPlus),c=Math.max(r,this.targetYPlus+this.targetYMinus),d=Math.max(r,this.targetZPlus+this.targetZMinus);return s==="top"||s==="down"?new e.Cartesian2(l,c):s==="left"||s==="right"?new e.Cartesian2(c,d):new e.Cartesian2(l,d)},!1),material:e.Color.WHITE.withAlpha(.1),outline:!0,outlineColor:e.Color.YELLOW,plane:new e.CallbackProperty(()=>new e.Plane(this.getNormalByType(s),0),!1)}});this.planeEntities.push(o)}}getPlaneOffsetCartesian(e){const t=(this.targetXPlus-this.targetXMinus)/2,n=(this.targetYPlus-this.targetYMinus)/2,s=(this.targetZPlus-this.targetZMinus)/2;switch(e){case"left":return new this.cesium.Cartesian3(-this.targetXMinus,n,s);case"right":return new this.cesium.Cartesian3(this.targetXPlus,n,s);case"behind":return new this.cesium.Cartesian3(t,-this.targetYMinus,s);case"front":return new this.cesium.Cartesian3(t,this.targetYPlus,s);case"top":return new this.cesium.Cartesian3(t,n,this.targetZPlus);case"down":return new this.cesium.Cartesian3(t,n,-this.targetZMinus);default:return this.cesium.Cartesian3.ZERO}}getNormalByType(e){const t=this.cesium;switch(e){case"left":return new t.Cartesian3(1,0,0);case"right":return new t.Cartesian3(-1,0,0);case"behind":return new t.Cartesian3(0,1,0);case"front":return new t.Cartesian3(0,-1,0);case"top":return new t.Cartesian3(0,0,-1);case"down":return new t.Cartesian3(0,0,1);default:return t.Cartesian3.UNIT_X}}getPlaneByType(e){const t=this.cesium,n=this.getNormalByType(e),s=t.Cartesian3.negate(n,new t.Cartesian3);let o=0;switch(e){case"left":o=this.targetXMinus;break;case"right":o=this.targetXPlus;break;case"behind":o=this.targetYMinus;break;case"front":o=this.targetYPlus;break;case"top":o=this.targetZPlus;break;case"down":o=this.targetZMinus;break}return new t.Plane(s,-o)}initEventHandlers(){const e=this.cesium,t=this.viewer.scene.canvas,n=this.viewer.scene;this.downHandler=new e.ScreenSpaceEventHandler(t),this.upHandler=new e.ScreenSpaceEventHandler(t),this.moveHandler=new e.ScreenSpaceEventHandler(t),this.moveHandler.setInputAction(s=>{if(this.selectedPlane)return;let o;try{o=n.pick(s.endPosition)}catch{}e.defined(o)&&o.id&&o.id.plane?this.hoveredPlane!==o.id.plane&&(this.hoveredPlane&&(this.hoveredPlane.material=e.Color.WHITE.withAlpha(.1)),this.hoveredPlane=o.id.plane,this.hoveredPlane.material=e.Color.YELLOW.withAlpha(.3),t.style.cursor="pointer"):this.hoveredPlane&&(this.hoveredPlane.material=e.Color.WHITE.withAlpha(.1),this.hoveredPlane=null,t.style.cursor="default")},e.ScreenSpaceEventType.MOUSE_MOVE),this.downHandler.setInputAction(s=>{let o;try{o=n.pick(s.position)}catch{}if(e.defined(o)&&o.id&&o.id.plane){this.currentPlaneType=o.id.name,this.selectedPlane=o.id.plane,this.selectedPlane.material=e.Color.RED.withAlpha(.4),n.screenSpaceCameraController.enableInputs=!1;const r=n.camera.getPickRay(s.position),l=this.boxInverseMatrix,c=e.Matrix4.multiplyByPoint(l,r.origin,new e.Cartesian3),d=e.Matrix4.multiplyByPointAsVector(l,r.direction,new e.Cartesian3);e.Cartesian3.normalize(d,d);const h=new e.Ray(c,d),f=this.getPlaneByType(this.currentPlaneType);this.dragStartPoint=e.IntersectionTests.rayPlane(h,f,new e.Cartesian3),this.dragStartPoint||(this.dragStartPoint=this.getPlaneOffsetCartesian(this.currentPlaneType))}},e.ScreenSpaceEventType.LEFT_DOWN),this.moveHandler.setInputAction(s=>{if(!this.selectedPlane||!this.dragStartPoint)return;const o=n.camera.getPickRay(s.endPosition),r=this.boxInverseMatrix,l=e.Matrix4.multiplyByPoint(r,o.origin,new e.Cartesian3),c=e.Matrix4.multiplyByPointAsVector(r,o.direction,new e.Cartesian3);e.Cartesian3.normalize(c,c);const d=new e.Ray(l,c);let h=new e.Cartesian3;this.currentPlaneType==="top"||this.currentPlaneType==="down"?h=Math.abs(c.x)>Math.abs(c.y)?e.Cartesian3.UNIT_X:e.Cartesian3.UNIT_Y:this.currentPlaneType==="left"||this.currentPlaneType==="right"?h=Math.abs(c.y)>Math.abs(c.z)?e.Cartesian3.UNIT_Y:e.Cartesian3.UNIT_Z:h=Math.abs(c.x)>Math.abs(c.z)?e.Cartesian3.UNIT_X:e.Cartesian3.UNIT_Z;const f=-e.Cartesian3.dot(this.dragStartPoint,h),m=new e.Plane(h,f);let u=e.IntersectionTests.rayPlane(d,m,new e.Cartesian3);if(!u){const A=h===e.Cartesian3.UNIT_X?e.Cartesian3.UNIT_Y:h===e.Cartesian3.UNIT_Y&&(this.currentPlaneType==="top"||this.currentPlaneType==="down")?e.Cartesian3.UNIT_X:e.Cartesian3.UNIT_Z,p=-e.Cartesian3.dot(this.dragStartPoint,A);u=e.IntersectionTests.rayPlane(d,new e.Plane(A,p),new e.Cartesian3)}if(!u)return;const g=.01;switch(this.currentPlaneType){case"left":this.targetXMinus=Math.max(-this.targetXPlus+g,-u.x);break;case"right":this.targetXPlus=Math.max(-this.targetXMinus+g,u.x);break;case"behind":this.targetYMinus=Math.max(-this.targetYPlus+g,-u.y);break;case"front":this.targetYPlus=Math.max(-this.targetYMinus+g,u.y);break;case"top":this.targetZPlus=Math.max(-this.targetZMinus+g,u.z);break;case"down":this.targetZMinus=Math.max(-this.targetZPlus+g,-u.z);break}this.syncClippingPlanes(),this.moveCallBack&&this.moveCallBack(this.getRangeParams())},e.ScreenSpaceEventType.MOUSE_MOVE),this.upHandler.setInputAction(()=>{this.selectedPlane&&(this.selectedPlane.material=e.Color.WHITE.withAlpha(.1),this.selectedPlane=null,this.currentPlaneType="",this.dragStartPoint=null),n.screenSpaceCameraController.enableInputs=!0,t.style.cursor="default"},e.ScreenSpaceEventType.LEFT_UP)}syncClippingPlanes(){this.activeModelIds.size!==0&&Object.keys(this.clippingPlanesMap).forEach(e=>{const t=this.clippingPlanesMap[e],n=this.tilesetMap[e];if(t&&n&&!t.isDestroyed()){const s=this.cesium;t.get(0).distance=this.targetXMinus,t.get(1).distance=this.targetXPlus,t.get(2).distance=this.targetYMinus,t.get(3).distance=this.targetYPlus,t.get(4).distance=this.targetZMinus,t.get(5).distance=this.targetZPlus;const o=s.Matrix4.inverse(n.root.transform,new s.Matrix4);t.modelMatrix=s.Matrix4.multiply(o,this.boxMatrix,new s.Matrix4)}})}fitToModels(){const e=this.cesium;if(this.activeModelIds.size===0)return;let t=[];if(this.activeModelIds.forEach(f=>{const m=this.tilesetMap[f];m&&m.boundingSphere&&t.push(m.boundingSphere.center)}),t.length===0)return;const n=new e.Cartesian3;t.forEach(f=>e.Cartesian3.add(n,f,n)),this.boxCenter=e.Cartesian3.divideByScalar(n,t.length,new e.Cartesian3),this.boxMatrix=e.Transforms.eastNorthUpToFixedFrame(this.boxCenter),this.boxInverseMatrix=e.Matrix4.inverse(this.boxMatrix,new e.Matrix4),this.boxOrientation=e.Quaternion.fromRotationMatrix(e.Matrix4.getMatrix3(this.boxMatrix,new e.Matrix3));let s=1/0,o=-1/0,r=1/0,l=-1/0,c=1/0,d=-1/0;this.activeModelIds.forEach(f=>{const m=this.tilesetMap[f];if(!m)return;const u=[],g=m.leiting?.box,A=m.root?.boundingVolume?.boundingVolume;if(g&&g.min&&g.max){const{min:p,max:y}=g,C=[new e.Cartesian3(p.x,p.y,p.z),new e.Cartesian3(y.x,p.y,p.z),new e.Cartesian3(p.x,y.y,p.z),new e.Cartesian3(y.x,y.y,p.z),new e.Cartesian3(p.x,p.y,y.z),new e.Cartesian3(y.x,p.y,y.z),new e.Cartesian3(p.x,y.y,y.z),new e.Cartesian3(y.x,y.y,y.z)],I=m.root.transform;C.forEach(P=>{u.push(e.Matrix4.multiplyByPoint(I,P,new e.Cartesian3))})}else if(A&&A.halfAxes){const p=A.center,y=A.halfAxes,C=e.Matrix3.getColumn(y,0,new e.Cartesian3),I=e.Matrix3.getColumn(y,1,new e.Cartesian3),P=e.Matrix3.getColumn(y,2,new e.Cartesian3);for(let k=0;k<8;k++){const M=e.Cartesian3.clone(p,new e.Cartesian3);e.Cartesian3.add(M,e.Cartesian3.multiplyByScalar(C,k&1?1:-1,new e.Cartesian3),M),e.Cartesian3.add(M,e.Cartesian3.multiplyByScalar(I,k&2?1:-1,new e.Cartesian3),M),e.Cartesian3.add(M,e.Cartesian3.multiplyByScalar(P,k&4?1:-1,new e.Cartesian3),M),u.push(M)}}else if(m.boundingSphere){const p=m.boundingSphere,y=p.center,C=p.radius,I=e.Matrix4.multiplyByPoint(this.boxInverseMatrix,y,new e.Cartesian3);s=Math.min(s,I.x-C),o=Math.max(o,I.x+C),r=Math.min(r,I.y-C),l=Math.max(l,I.y+C),c=Math.min(c,I.z-C),d=Math.max(d,I.z+C)}u.forEach(p=>{const y=e.Matrix4.multiplyByPoint(this.boxInverseMatrix,p,new e.Cartesian3);s=Math.min(s,y.x),o=Math.max(o,y.x),r=Math.min(r,y.y),l=Math.max(l,y.y),c=Math.min(c,y.z),d=Math.max(d,y.z)})});const h=1.01;this.targetXMinus=Math.abs(s)*h,this.targetXPlus=Math.abs(o)*h,this.targetYMinus=Math.abs(r)*h,this.targetYPlus=Math.abs(l)*h,this.targetZMinus=Math.abs(c)*h,this.targetZPlus=Math.abs(d)*h,this.activeModelIds.forEach(f=>{this.setupClippingPlanes(f)}),this.viewer.scene.requestRender()}getRangeParams(){const e=this.cesium;return{targetZPlus:this.targetZPlus,targetZMinus:this.targetZMinus,targetXPlus:this.targetXPlus,targetXMinus:this.targetXMinus,targetYPlus:this.targetYPlus,targetYMinus:this.targetYMinus,maxBox:new e.Cartesian3(this.targetXPlus,this.targetYPlus,this.targetZPlus),minBox:new e.Cartesian3(-this.targetXMinus,-this.targetYMinus,-this.targetZMinus)}}updateRange(e){if(!this.boxMatrix)return;e.targetXMinus!==void 0&&(this.targetXMinus=e.targetXMinus),e.targetXPlus!==void 0&&(this.targetXPlus=e.targetXPlus),e.targetYMinus!==void 0&&(this.targetYMinus=e.targetYMinus),e.targetYPlus!==void 0&&(this.targetYPlus=e.targetYPlus),e.targetZPlus!==void 0&&(this.targetZPlus=e.targetZPlus),e.targetZMinus!==void 0&&(this.targetZMinus=e.targetZMinus);const t=.1;this.targetXMinus+this.targetXPlus<t&&(this.targetXPlus=t-this.targetXMinus),this.targetYPlus+this.targetYMinus<t&&(this.targetYPlus=t-this.targetYMinus),this.targetZPlus+this.targetZMinus<t&&(this.targetZPlus=t-this.targetZMinus),this.syncClippingPlanes(),this.viewer.scene.requestRender()}getRange(){return this.getRangeParams()}setBoxVisibility(e){this.planeEntities.forEach(t=>{t.show=e}),this.viewer.scene.requestRender()}close(e){if(e){const t=this.tilesetMap[e];t&&(t.clippingPlanes&&(t.clippingPlanes.enabled=!1),t.clippingPlanes=void 0),delete this.clippingPlanesMap[e],this.activeModelIds.delete(e),this.activeModelIds.size>0&&this.fitToModels()}else Object.keys(this.clippingPlanesMap).forEach(t=>{const n=this.tilesetMap[t];n&&(n.clippingPlanes&&(n.clippingPlanes.enabled=!1),n.clippingPlanes=void 0)}),this.clippingPlanesMap={},this.activeModelIds.clear();this.activeModelIds.size===0&&(this.planeEntities.forEach(t=>{this.viewer.entities.remove(t)}),this.planeEntities=[],this.destroyEventHandlers(),this.boxMatrix=null,this.boxInverseMatrix=null),this.viewer.scene.requestRender()}destroyEventHandlers(){this.downHandler?.destroy(),this.upHandler?.destroy(),this.moveHandler?.destroy(),this.downHandler=this.upHandler=this.moveHandler=null}}let Po=performance.now();const c0=10;class d0{cesium;viewer;modelInfo={modelName:"Person",modelId:"player_111",url:"person/model.glb",scale:.0032};startTime=0;radian=0;speed=.1;speedVector;position;hpRoll;cameralHpRoll;fixedFrameTransforms;model;transparentTest=!0;gravityTestByMove=!1;gravityTest=!0;lastMoveTime=0;moveInterval=.01;collisionTest=!0;wheelCount=2;isLeftDragging=!1;lastScreenY=0;lastScreenX=0;pauseAnimationFn;resumeAnimationFn;selectedColor;selectedColorRecover;handler;moveState={moveFront:!1,moveBack:!1,moveLeft:!1,moveRight:!1,moveUp:!1,moveDown:!1};onLoading=null;onSuccess=null;onError=null;constructor({cesium:e,viewer:t,modelInfo:n,callbacks:s}){this.cesium=e,this.viewer=t,this.radian=this.cesium.Math.toRadians(4),this.speedVector=new this.cesium.Cartesian3,this.position=new this.cesium.Cartesian3,this.hpRoll=new this.cesium.HeadingPitchRoll,this.cameralHpRoll=new this.cesium.HeadingPitchRoll,this.fixedFrameTransforms=new this.cesium.Transforms.localFrameToFixedFrameGenerator("north","west"),n&&(this.modelInfo=Object.assign(this.modelInfo,n)),s&&(this.onLoading=s.onLoading||null,this.onSuccess=s.onSuccess||null,this.onError=s.onError||null),this.selectedColor=new this.cesium.Color(1,1,1,.4),this.selectedColorRecover=new this.cesium.Color(1,1,1,1);const o=this.viewer.scene.canvas;this.handler=new this.cesium.ScreenSpaceEventHandler(o)}getModel(){return this.model}setPauseAnimation(e){this.pauseAnimationFn=e}setResumeAnimationFn(e){this.resumeAnimationFn=e}async setPersonPosition(e){e&&(this.position=e),this.getModel()?(this.model.modelMatrix=this.cesium.Transforms.headingPitchRollToFixedFrame(e,this.hpRoll,this.cesium.Ellipsoid.WGS84,this.fixedFrameTransforms),this.model.show=!0,this.initKeyBoard()):await this.openPlayer(),this.setCameralDefault(!1)}setModelInfo(e){e&&(this.modelInfo=Object.assign(this.modelInfo,e))}async openPlayer(){if(this.enablePositionSelection(),this.model){this.model.show=!0,this.initKeyBoard(),this.setCameralDefault(!1);return}this.position&&!(this.position.x===0&&this.position.y===0&&this.position.z===0)?(await this.loadModel(),this.initKeyBoard(),this.setCameralDefault(!1)):this.onLoading&&this.onLoading("请按住 Ctrl + 左键点击场景选择初始位置...")}enablePositionSelection(){this._positionHandler&&(this._positionHandler.destroy(),this._positionHandler=null);const e=new this.cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);e.setInputAction(async t=>{const n=this.viewer.scene;let s;try{s=n.pickPosition(t.position)}catch(o){console.warn("pickPosition failed:",o)}s&&(this.position=s,this.model?(this.model.modelMatrix=this.cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpRoll,this.cesium.Ellipsoid.WGS84,this.fixedFrameTransforms),this.updatedCamera(),this.onSuccess&&this.onSuccess("已更新漫游位置")):(this.onSuccess&&this.onSuccess("位置已选择,正在加载模型..."),await this.loadModel(),this.initKeyBoard(),this.setCameralDefault(!1)))},this.cesium.ScreenSpaceEventType.LEFT_CLICK,this.cesium.KeyboardEventModifier.CTRL),this._positionHandler=e}_positionHandler;setDefaultPosition(){const e=this.viewer.scene,t=this.viewer.camera,n=new this.cesium.Cartesian2(e.canvas.clientWidth/2,e.canvas.clientHeight/2);let s;try{s=e.pickPosition(n)}catch(o){console.warn("pickPosition failed:",o)}if(s)this.position=s;else{const o=t.direction,l=this.cesium.Cartesian3.add(t.positionWC,this.cesium.Cartesian3.multiplyByScalar(o,10,new this.cesium.Cartesian3),new this.cesium.Cartesian3);this.position=l}}async loadModel(){let e;try{this.onLoading&&this.onLoading("正在加载漫游人物...");const t=await this.cesium.Model.fromGltfAsync({id:this.modelInfo.modelId,url:this.modelInfo.url,modelMatrix:this.cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpRoll,this.cesium.Ellipsoid.WGS84,this.fixedFrameTransforms),scale:this.modelInfo.scale,allowPicking:!1,debugShowBoundingVolume:!1,debugWireframe:!1,cull:!1,gltfCallback:s=>{e=s.animations},backFaceCulling:!1}),n=()=>{if(e&&e.length>0){console.log("Model has animations:",e.length);try{t.activeAnimations.add({index:0,loop:this.cesium.ModelAnimationLoop.REPEAT,multiplier:1})}catch(s){console.error("Failed to add animation:",s)}this.pauseAnimationFn=()=>{this.viewer.clock.shouldAnimate=!1},this.resumeAnimationFn=()=>{this.viewer.clock.shouldAnimate=!0},this.viewer.clock.shouldAnimate=!1}else console.warn("No animations found in the model.")};t.ready?n():t.readyEvent.addEventListener(n),this.model=await this.viewer.scene.primitives.add(t),this.updatedCamera(),this.onLoading&&this.onLoading(""),this.onSuccess&&this.onSuccess("漫游模型加载完成")}catch(t){console.error("Failed to load model:",t),this.onLoading&&this.onLoading(""),this.onError&&this.onError("漫游模型加载失败")}}initKeyBoard(){const e=this.handler,t=this.cesium;Po=performance.now();const n=(o,r)=>{const l=o.code,c=o.keyCode;l==="KeyA"||c===65?this.moveState.moveLeft=r:l==="KeyW"||c===87?this.moveState.moveFront=r:l==="KeyD"||c===68?this.moveState.moveRight=r:l==="KeyS"||c===83?this.moveState.moveBack=r:l==="KeyQ"||c===81?this.moveState.moveUp=r:(l==="KeyE"||c===69)&&(this.moveState.moveDown=r)};e.setInputAction(o=>{this.wheelCount-=o*.001,this.wheelCount<.1&&(this.wheelCount=.1),this.updatedCamera()},t.ScreenSpaceEventType.WHEEL),this._keydownHandler=o=>{o.target.tagName==="INPUT"||o.target.tagName==="TEXTAREA"||(n(o,!0),this.resumeAnimationFn&&this.resumeAnimationFn())},this._keyupHandler=o=>{o.target.tagName==="INPUT"||o.target.tagName==="TEXTAREA"||(n(o,!1),Object.keys(this.moveState).every(r=>this.moveState[r]==!1)&&this.pauseAnimationFn&&this.pauseAnimationFn())},document.addEventListener("keydown",this._keydownHandler),document.addEventListener("keyup",this._keyupHandler),e.setInputAction(o=>{this.isLeftDragging=!0,this.lastScreenY=o.position.y,this.lastScreenX=o.position.x},this.cesium.ScreenSpaceEventType.LEFT_DOWN),e.setInputAction(o=>{if(!this.isLeftDragging)return;const r=o.endPosition.x,l=o.endPosition.y,c=l-this.lastScreenY,d=r-this.lastScreenX;Math.abs(c)<Math.abs(d)&&(d>0?(this.cameralHpRoll.heading+=this.radian,this.hpRoll.heading+=this.radian):(this.cameralHpRoll.heading-=this.radian,this.hpRoll.heading-=this.radian),s(0),this.lastScreenX=r),this.lastScreenY=l;const h=this.viewer.camera;this.cameralHpRoll.pitch=h.pitch+this.cesium.Math.toRadians(-c*.1),this.updatedCamera()},t.ScreenSpaceEventType.MOUSE_MOVE),e.setInputAction(()=>{this.isLeftDragging&&(this.isLeftDragging=!1)},t.ScreenSpaceEventType.LEFT_UP);const s=o=>{const r=performance.now();if(r-Po<c0)return;Po=r;const l=1.75;if(o===1?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_X,this.speed,this.speedVector),this.gravityTestByMove=!0):o===-1?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_X,-this.speed,this.speedVector),this.gravityTestByMove=!0):o===0?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_X,0,this.speedVector),this.gravityTestByMove=!1):o===2?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_Z,.05,this.speedVector),this.gravityTestByMove=!1):o===-2?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_Z,-.05,this.speedVector),this.gravityTestByMove=!1):o===3?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_Y,this.speed,this.speedVector),this.gravityTestByMove=!0):o===-3&&(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_Y,-this.speed,this.speedVector),this.gravityTestByMove=!0),!this.viewer||!this.model)return;const c=(f,m)=>new this.cesium.Ray(f,m),d=new this.cesium.Cartesian3;this.cesium.Matrix4.getColumn(this.model.modelMatrix,0,d),this.cesium.Cartesian3.normalize(d,d);const h=new this.cesium.Cartesian3;if(this.cesium.Matrix4.getColumn(this.model.modelMatrix,1,h),this.cesium.Cartesian3.normalize(h,h),Math.abs(o)!=2&&this.collisionTest){const f=new this.cesium.Cartesian3(this.position.x,this.position.y,this.position.z),m=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,l),f);let u=d;o===-1?u=this.cesium.Cartesian3.multiplyByScalar(d,-1,new this.cesium.Cartesian3):o===3?u=h:o===-3&&(u=this.cesium.Cartesian3.multiplyByScalar(h,-1,new this.cesium.Cartesian3));const g=c(m,u),A=this.viewer.scene.pickFromRay(g,[this.model],1);if(A&&A.position&&this.cesium.Cartesian3.distance(m,A.position)<.9&&o!==0)return}if(this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,this.speedVector,this.position),this.cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpRoll,this.cesium.Ellipsoid.WGS84,this.fixedFrameTransforms,this.model.modelMatrix),this.gravityTest){const f=new this.cesium.Cartesian3(this.position.x,this.position.y,this.position.z),m=.5,u=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,m),f),g=new this.cesium.Cartesian3;this.cesium.Cartesian3.subtract(this.position,u,g),this.cesium.Cartesian3.normalize(g,g);const A=c(u,g),p=this.viewer.scene.pickFromRay(A,[this.model],1),y=l,C=this.cesium.Cartesian3.add(u,this.cesium.Cartesian3.multiplyByScalar(d,y,new this.cesium.Cartesian3),new this.cesium.Cartesian3);if(t.defined(p)){const I=t.Cartesian3.distance(u,p.position);I-m>.2&&(this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,-.2),this.position)),I-m<-.1&&I<2&&(this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,.2),this.position))}if(!p&&this.gravityTestByMove){const I=c(this.position,g),P=this.viewer.scene.pickFromRay(I,[this.model],1);if(P){const k=this.cesium.Cartesian3.distance(this.position,P.position);Math.abs(k-1)>.05&&k<2&&(this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,-.2),this.position))}}if(p&&this.gravityTestByMove&&this.gravityTest){const I=this.cesium.Cartesian3.distance(C,p.position);Math.abs(I-l)>.1&&(this.cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpRoll,this.cesium.Ellipsoid.WGS84,this.fixedFrameTransforms,this.model.modelMatrix),this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,(l-I)/Math.abs(l-I)*.05),this.position))}}if(this.transparentTest){const f=new this.cesium.Cartesian3(this.position.x,this.position.y,this.position.z),m=1.75,u=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,m),f),g=this.viewer.camera.positionWC,A=u,p=t.Cartesian3.subtract(A,g,new t.Cartesian3),y=t.Cartesian3.distance(u,g),C=t.Cartesian3.normalize(p,new t.Cartesian3),I=new t.Ray(g,C);let P;try{P=this.viewer.scene.pickFromRay(I,void 0,1)}catch{}t.defined(P)&&P.primitive!==this.model&&P.position&&t.Cartesian3.distance(g,P.position)<y&&(this.wheelCount-=.1,this.wheelCount<.1&&(this.wheelCount=.1))}this.cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpRoll,this.cesium.Ellipsoid.WGS84,this.fixedFrameTransforms,this.model.modelMatrix),this.updatedCamera()};this._tickHandler=()=>{const o=performance.now()/1e3;(o-this.lastMoveTime>=this.moveInterval||this.lastMoveTime==0)&&(this.moveState.moveFront?s(1):this.moveState.moveBack?s(-1):this.moveState.moveLeft?s(3):this.moveState.moveRight?s(-3):this.moveState.moveUp?s(2):this.moveState.moveDown&&s(-2),this.lastMoveTime=o)},this.viewer.clock.onTick.addEventListener(this._tickHandler)}updatedCamera(){if(!this.model)return;const e=new this.cesium.Cartesian3(this.position.x,this.position.y,this.position.z),t=1.75,n=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,t),e);this.viewer.camera.viewBoundingSphere(new this.cesium.BoundingSphere(n,this.wheelCount),this.cameralHpRoll)}_keydownHandler;_keyupHandler;_tickHandler;_uiEventListeners=[];bindUiKeys(e){this.unbindUiKeys(),Object.entries(e).forEach(([t,n])=>{if(!n)return;const s=()=>this.setMoveState(t,!0),o=()=>this.setMoveState(t,!1);n.addEventListener("mousedown",s),n.addEventListener("mouseup",o),n.addEventListener("mouseleave",o),n.addEventListener("touchstart",r=>{r.preventDefault(),s()}),n.addEventListener("touchend",r=>{r.preventDefault(),o()}),this._uiEventListeners.push(()=>{n.removeEventListener("mousedown",s),n.removeEventListener("mouseup",o),n.removeEventListener("mouseleave",o),n.removeEventListener("touchstart",s),n.removeEventListener("touchend",o)})})}unbindUiKeys(){this._uiEventListeners.forEach(e=>e()),this._uiEventListeners=[]}openCameraRoam(){const e=this.cesium,t=this.viewer,n=t.camera;this.setDefaultPosition(),this.setCameralDefault(!1);const s=this.handler;let o=!1,r=0,l=0;s.setInputAction(c=>{o=!0,r=c.position.x,l=c.position.y},e.ScreenSpaceEventType.LEFT_DOWN),s.setInputAction(c=>{if(!o)return;const d=c.endPosition.x,h=c.endPosition.y,f=d-r,m=h-l;Math.abs(f)>Math.abs(m)&&(n.heading-=f*.003),n.pitch+=m*.003,r=d,l=h},e.ScreenSpaceEventType.MOUSE_MOVE),s.setInputAction(()=>{o=!1},e.ScreenSpaceEventType.LEFT_UP),s.setInputAction(c=>{this.wheelCount-=c*.001,this.wheelCount<.1&&(this.wheelCount=.1)},e.ScreenSpaceEventType.WHEEL),this._tickHandler=()=>{if(!this.moveState.moveFront&&!this.moveState.moveBack&&!this.moveState.moveLeft&&!this.moveState.moveRight&&!this.moveState.moveUp&&!this.moveState.moveDown)return;const c=(this.speed||.02)*12,d=n.direction,h=n.right,f=n.up;let m=0,u=0,g=0;this.moveState.moveFront&&(m+=d.x*c,u+=d.y*c,g+=d.z*c),this.moveState.moveBack&&(m-=d.x*c,u-=d.y*c,g-=d.z*c),this.moveState.moveRight&&(m+=h.x*c,u+=h.y*c,g+=h.z*c),this.moveState.moveLeft&&(m-=h.x*c,u-=h.y*c,g-=h.z*c),this.moveState.moveUp&&(m+=f.x*c,u+=f.y*c,g+=f.z*c),this.moveState.moveDown&&(m-=f.x*c,u-=f.y*c,g-=f.z*c),n.position=new e.Cartesian3(n.position.x+m,n.position.y+u,n.position.z+g)},t.clock.onTick.addEventListener(this._tickHandler),this.onSuccess&&this.onSuccess("视角漫游已启动")}closePlayer(){const e=this.cesium;this.model&&(this.model.show=!1),this.setCameralDefault(!0),this.handler&&(this.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_DOWN),this.handler.removeInputAction(e.ScreenSpaceEventType.MOUSE_MOVE),this.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_UP),this.handler.removeInputAction(e.ScreenSpaceEventType.WHEEL)),this._positionHandler&&(this._positionHandler.destroy(),this._positionHandler=null),this._keydownHandler&&document.removeEventListener("keydown",this._keydownHandler),this._keyupHandler&&document.removeEventListener("keyup",this._keyupHandler),this._tickHandler&&this.viewer.clock.onTick.removeEventListener(this._tickHandler),this.unbindUiKeys(),this.viewer.camera.lookAtTransform(e.Matrix4.IDENTITY),this.onLoading&&this.onLoading("")}setSpeed({speed:e}){this.speed=e/50}setParams({gravityTest:e,collisionTest:t,transparentTest:n}){e!==void 0&&(this.gravityTest=e),t!==void 0&&(this.collisionTest=t),n!==void 0&&(this.transparentTest=n)}setMoveState(e,t){this.moveState.hasOwnProperty(e)&&(this.moveState[e]=t,t?this.resumeAnimationFn&&this.resumeAnimationFn():Object.keys(this.moveState).every(n=>this.moveState[n]==!1)&&this.pauseAnimationFn&&this.pauseAnimationFn())}setCameralDefault(e){const t=this.viewer;t.scene.screenSpaceCameraController.enableRotate=e,t.scene.screenSpaceCameraController.enableTranslate=e,t.scene.screenSpaceCameraController.enableZoom=e,t.scene.screenSpaceCameraController.enableLook=e,t.scene.screenSpaceCameraController.enableTilt=e}}class h0{cesium;viewer;baseCesium;baseTiles;baseCompt;baseSection;basePlayer;constructor(e){this.cesium=e.cesium,this.viewer=e.viewer,this.baseCesium=new Fh(e),this.baseTiles=new Sl(e),this.baseCompt=new r0(e),this.baseSection=new l0(e),this.basePlayer=new d0({cesium:e.cesium,viewer:e.viewer,modelInfo:{url:e.options?.playerUrl,modelName:e.options?.playerModelName,modelId:e.options?.playerModelId,scale:e.options?.playerScale},callbacks:e.callbacks})}getCesium(){return this.cesium}getViewer(){return this.viewer}setSceneOptions(...e){this.baseCesium.setSceneOptions(...e)}getSnapDomSImageBase64(...e){return this.baseCesium.getSnapDomSImageBase64(...e)}clearBackground(){this.baseCesium.clearBackground()}enableTestLabel(){this.baseCesium.enableTestLabel()}enableCesiumFXAA(e){this.baseCesium.enableCesiumFXAA(e)}updateModelEffect(e){this.baseCesium.updateModelEffect(e)}addModels(...e){return this.baseTiles.addModels(...e)}}class u0{cesium;viewer;mapLayers={};renderGen={};renderGenAll=0;renderGenByModel={};modelId="default";options={flyTo:!0};dxfModelsList=[];open=!1;events=new Ki;showGlobal=!0;constructor({viewer:e,cesium:t}){this.viewer=e,this.cesium=t}getMapLayers(e){const t=typeof e=="object"?e?.modelId:e;return t?this.mapLayers[t]||{}:this.mapLayers}setModelId(e){this.modelId=e}getModelId(){return this.modelId}flyToCadModel(e={}){const t=e.modelId||this.modelId,n=this.dxfModelsList.find(s=>s.modelId===t);n&&this.flyToBounds(n)}setDxfOpen(e){this.open=e}getDxfOpen(){return this.open}getDxfModelsList(){return this.dxfModelsList}getDxfModels(e){const t=typeof e=="object"?e?.modelId:e;return t?this.dxfModelsList.find(n=>n.modelId===t):this.dxfModelsList}showJson({modelId:e,show:t}){this.mapLayers[e]&&Object.values(this.mapLayers[e]).forEach(s=>{s.forEach(o=>{o.primitive&&(o.primitive.show=t)})});const n=this.dxfModelsList.find(s=>s.modelId===e);n&&(n.show=t)}showJsonByLayer({modelId:e,show:t,layers:n}){const s=this.dxfModelsList.find(r=>r.modelId===e);if(!s){console.error("Tileset not found for modelId:",e);return}s.hiddenBatchIds||(s.hiddenBatchIds=new Set),s.layerMap&&Array.isArray(n)&&n.forEach(r=>{const l=s.layerMap[r];l!==void 0&&(t?s.hiddenBatchIds.delete(l):s.hiddenBatchIds.add(l))});const o=Array.from(s.hiddenBatchIds);if(o.length>0){const r=o.map(l=>`\${_BATCHID} !== ${l}`).join(" && ");s.style=new this.cesium.Cesium3DTileStyle({show:r})}else s.style=new this.cesium.Cesium3DTileStyle({show:!0});s.hasVisibilityListener||(s.hasVisibilityListener=!0,s.tileVisible.addEventListener(r=>{const l=r.content,c=l.featuresLength;if(c>0&&s.hiddenBatchIds)for(let d=0;d<c;d++)s.hiddenBatchIds.has(d)?l.getFeature(d).show=!1:l.getFeature(d).show=!0}))}flyToBounds(e,t){const n=this.cesium,s=e.boundingSphere?.radius||1e3,o={offset:new n.HeadingPitchRange(0,n.Math.toRadians(-90),s*2),...t},r=o.duration??0;e&&this.viewer.flyTo(e,{duration:r,offset:o.offset})}async loadModelFile(e){try{if(!e||typeof e!="string")return!1;const t=await fetch(e,{cache:"no-store"});if(!t.ok)throw new Error(`HTTP ${t.status} for ${e}`);if(e.endsWith(".json")||t.headers.get("content-type")?.includes("application/json"))return await t.json();const n=await t.blob(),s=new Io(new Kn(n),{password:Il,useWebWorkers:!1}),r=(await s.getEntries()).find(d=>!d.directory&&d.filename.endsWith(".json"));if(!r)return console.error("未找到 JSON 文件"),await s.close(),!1;const l=await r.arrayBuffer({useWebWorkers:!1});await s.close();const c=new TextDecoder().decode(l);return JSON.parse(c.trim())}catch(t){return console.error("解压或获取失败:",t),!1}}getBaseUrlPath(e){const t=e.lastIndexOf("/");return t===-1?".":e.substring(0,t)}async loadTilesetWithZipSupport(e,t){const n=this.getBaseUrlPath(e),s=encodeURI(`${n}/tileset.zip`);try{if((await fetch(s,{method:"HEAD"})).status===200){const r=await this.loadModelFile(s);if(r){const l=h=>{!h||typeof h!="object"||(typeof h.uri=="string"&&!/^(data:|https?:\/\/)/i.test(h.uri)&&(h.uri=encodeURI(`${n}/${h.uri.replace(/^\.?\//,"")}`)),Object.values(h).forEach(f=>{if(Array.isArray(f)){f.forEach(m=>l(m));return}f&&typeof f=="object"&&l(f)}))};l(r);const c=`data:text/plain;base64,${btoa(unescape(encodeURIComponent(JSON.stringify(r))))}`,d=new this.cesium.Resource({url:c});try{return await this.cesium.Cesium3DTileset.fromUrl(d,t)}catch{return await this.cesium.Cesium3DTileset.fromUrl(e,t)}}}}catch{}return await this.cesium.Cesium3DTileset.fromUrl(e,t)}async addDxfModel({fileNames:e,options:t}){const n=this.renderGenAll;if(e?.length){for(const s of e){if(this.renderGenAll!==n)return;const o=this.renderGenByModel[s.modelId]||0;if((this.renderGenByModel[s.modelId]||0)!==o||~this.dxfModelsList.findIndex(d=>d.modelId===s.modelId))return;/^https?:\/\//i.test(s.outPutPath)||(s.outPutPath=`${window.location.origin}${s.outPutPath}`);const l=`${s.outPutPath}${s.dbName}/tileset.json`,c={...this.options,...t};try{const d=`${s.outPutPath}${s.dbName}/layerInfo.zip`,h=await this.loadModelFile(d);if(this.renderGenAll!==n||(this.renderGenByModel[s.modelId]||0)!==o)return;const f=await this.loadTilesetWithZipSupport(l,{allowPicking:!1,clampToTerrain:!0});if(f.maximumScreenSpaceError=0,this.renderGenAll!==n||(this.renderGenByModel[s.modelId]||0)!==o)return;if(Object.assign(f,{modelId:s.modelId,modelName:s.modelName,deltaLatitude:s.deltaLatitude||0,deltaLongitude:s.deltaLongitude||0,relocated:!0,dbName:s.dbName,outPutPath:s.outPutPath,totalRotation:s.totalRotation||0,layerInfo:h}),s.formData?f.formData=s.formData:f.formData={modelId:f.modelId,longitude:f.deltaLongitude,latitude:f.deltaLatitude,distance:1e-6,rotation:0,totalRotation:f.totalRotation,heightDistance:1,height:0,lonlat:1e-6,modelOptions:[{value:f.modelId,label:f.modelName}],selectPoint:{longitude:0,latitude:0,height:0},selectedMode:!1,X:0,Y:0,Z:0},this.adjustingModelByCad({...f.formData,tileset:f}),Array.isArray(h)){const m=h;f.layerMap={};let u=this.mapLayers[s.modelId];u||(u={},this.mapLayers[s.modelId]=u),m.forEach(g=>{f.layerMap[g.layerName]=g.batchId,u[g.layerName]||(u[g.layerName]=[]),u[g.layerName].push({batchId:g.batchId,color:g.layerColor})})}if(this.dxfModelsList.push(f),this.setModelId(s.modelId),this.viewer.scene.primitives.add(f),this.renderGenAll!==n||(this.renderGenByModel[s.modelId]||0)!==o)return;c.flyTo&&this.flyToBounds(f),c.onSuccess&&c.onSuccess(f)}catch(d){console.error(`Failed to load tileset or layer info: ${l}`,d)}}this.events.emit("mountAllCad",this.dxfModelsList)}}adjustingModelByCad(e){const t=this.cesium,n=t.Quaternion.fromAxisAngle(t.Cartesian3.UNIT_Z,t.Math.toRadians(e.totalRotation)),s=t.Matrix4.fromRotationTranslation(t.Matrix3.fromQuaternion(n),new t.Cartesian3(0,0,0)),o=t.Cartesian3.fromDegrees(e.longitude,e.latitude,e.height),r=t.Transforms.eastNorthUpToFixedFrame(o);t.Matrix4.multiply(r,s,r),e.tileset?._root&&(e.tileset._root.transform=r)}deleteCad({modelId:e}){this.mapLayers[e]&&(Object.values(this.mapLayers[e]).forEach(n=>{n.forEach(s=>{this.viewer.scene.primitives.remove(s.primitive),s.primitive?.destroy()})}),delete this.mapLayers[e]),this.renderGen[e]=(this.renderGen[e]||0)+1,this.renderGenByModel[e]=(this.renderGenByModel[e]||0)+1;const t=this.dxfModelsList.findIndex(n=>n.modelId===e);if(t>-1){const n=this.dxfModelsList[t];this.viewer.scene.primitives.remove(n),n.destroy&&!n.isDestroyed()&&n.destroy(),this.dxfModelsList.splice(t,1)}}deleteAllCad(){Object.keys(this.mapLayers).forEach(e=>{this.deleteCad({modelId:e})}),[...this.dxfModelsList].forEach(e=>{e.modelId&&this.deleteCad({modelId:e.modelId})})}}function f0(i){i("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),i("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),i("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 e=1;e<=60;++e)i("EPSG:"+(32600+e),"+proj=utm +zone="+e+" +datum=WGS84 +units=m"),i("EPSG:"+(32700+e),"+proj=utm +zone="+e+" +south +datum=WGS84 +units=m");i("EPSG:5041","+title=WGS 84 / UPS North (E,N) +proj=stere +lat_0=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),i("EPSG:5042","+title=WGS 84 / UPS South (E,N) +proj=stere +lat_0=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),i.WGS84=i["EPSG:4326"],i["EPSG:3785"]=i["EPSG:3857"],i.GOOGLE=i["EPSG:3857"],i["EPSG:900913"]=i["EPSG:3857"],i["EPSG:102113"]=i["EPSG:3857"]}var ei=1,ti=2,Ci=3,m0=4,_o=5,Tl=6378137,g0=6356752314e-3,Pl=.0066943799901413165,Xi=484813681109536e-20,j=Math.PI/2,p0=.16666666666666666,A0=.04722222222222222,y0=.022156084656084655,K=1e-10,xe=.017453292519943295,$e=57.29577951308232,ue=Math.PI/4,Ji=Math.PI*2,Me=3.14159265359,Ke={};Ke.greenwich=0,Ke.lisbon=-9.131906111111,Ke.paris=2.337229166667,Ke.bogota=-74.080916666667,Ke.madrid=-3.687938888889,Ke.rome=12.452333333333,Ke.bern=7.439583333333,Ke.jakarta=106.807719444444,Ke.ferro=-17.666666666667,Ke.brussels=4.367975,Ke.stockholm=18.058277777778,Ke.athens=23.7163375,Ke.oslo=10.722916666667;const E0={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 _l=/[\s_\-\/\(\)]/g;function Nt(i,e){if(i[e])return i[e];for(var t=Object.keys(i),n=e.toLowerCase().replace(_l,""),s=-1,o,r;++s<t.length;)if(o=t[s],r=o.toLowerCase().replace(_l,""),r===n)return i[o]}function Do(i){var e={},t=i.split("+").map(function(l){return l.trim()}).filter(function(l){return l}).reduce(function(l,c){var d=c.split("=");return d.push(!0),l[d[0].toLowerCase()]=d[1],l},{}),n,s,o,r={proj:"projName",datum:"datumCode",rf:function(l){e.rf=parseFloat(l)},lat_0:function(l){e.lat0=l*xe},lat_1:function(l){e.lat1=l*xe},lat_2:function(l){e.lat2=l*xe},lat_ts:function(l){e.lat_ts=l*xe},lon_0:function(l){e.long0=l*xe},lon_1:function(l){e.long1=l*xe},lon_2:function(l){e.long2=l*xe},alpha:function(l){e.alpha=parseFloat(l)*xe},gamma:function(l){e.rectified_grid_angle=parseFloat(l)*xe},lonc:function(l){e.longc=l*xe},x_0:function(l){e.x0=parseFloat(l)},y_0:function(l){e.y0=parseFloat(l)},k_0:function(l){e.k0=parseFloat(l)},k:function(l){e.k0=parseFloat(l)},a:function(l){e.a=parseFloat(l)},b:function(l){e.b=parseFloat(l)},r:function(l){e.a=e.b=parseFloat(l)},r_a:function(){e.R_A=!0},zone:function(l){e.zone=parseInt(l,10)},south:function(){e.utmSouth=!0},towgs84:function(l){e.datum_params=l.split(",").map(function(c){return parseFloat(c)})},to_meter:function(l){e.to_meter=parseFloat(l)},units:function(l){e.units=l;var c=Nt(E0,l);c&&(e.to_meter=c.to_meter)},from_greenwich:function(l){e.from_greenwich=l*xe},pm:function(l){var c=Nt(Ke,l);e.from_greenwich=(c||parseFloat(l))*xe},nadgrids:function(l){l==="@null"?e.datumCode="none":e.nadgrids=l},axis:function(l){var c="ewnsud";l.length===3&&c.indexOf(l.substr(0,1))!==-1&&c.indexOf(l.substr(1,1))!==-1&&c.indexOf(l.substr(2,1))!==-1&&(e.axis=l)},approx:function(){e.approx=!0},over:function(){e.over=!0}};for(n in t)s=t[n],n in r?(o=r[n],typeof o=="function"?o(s):e[o]=s):e[n]=s;return typeof e.datumCode=="string"&&e.datumCode!=="WGS84"&&(e.datumCode=e.datumCode.toLowerCase()),e.projStr=i,e}class Dl{static getId(e){const t=e.find(n=>Array.isArray(n)&&n[0]==="ID");return t&&t.length>=3?{authority:t[1],code:parseInt(t[2],10)}:null}static convertUnit(e,t="unit"){if(!e||e.length<3)return{type:t,name:"unknown",conversion_factor:null};const n=e[1],s=parseFloat(e[2])||null,o=e.find(l=>Array.isArray(l)&&l[0]==="ID"),r=o?{authority:o[1],code:parseInt(o[2],10)}:null;return{type:t,name:n,conversion_factor:s,id:r}}static convertAxis(e){const t=e[1]||"Unknown";let n;const s=t.match(/^\((.)\)$/);if(s){const d=s[1].toUpperCase();if(d==="E")n="east";else if(d==="N")n="north";else if(d==="U")n="up";else throw new Error(`Unknown axis abbreviation: ${d}`)}else n=e[2]?e[2].toLowerCase():"unknown";const o=e.find(d=>Array.isArray(d)&&d[0]==="ORDER"),r=o?parseInt(o[1],10):null,l=e.find(d=>Array.isArray(d)&&(d[0]==="LENGTHUNIT"||d[0]==="ANGLEUNIT"||d[0]==="SCALEUNIT")),c=this.convertUnit(l);return{name:t,direction:n,unit:c,order:r}}static extractAxes(e){return e.filter(t=>Array.isArray(t)&&t[0]==="AXIS").map(t=>this.convertAxis(t)).sort((t,n)=>(t.order||0)-(n.order||0))}static convert(e,t={}){switch(e[0]){case"PROJCRS":t.type="ProjectedCRS",t.name=e[1],t.base_crs=e.find(m=>Array.isArray(m)&&m[0]==="BASEGEOGCRS")?this.convert(e.find(m=>Array.isArray(m)&&m[0]==="BASEGEOGCRS")):null,t.conversion=e.find(m=>Array.isArray(m)&&m[0]==="CONVERSION")?this.convert(e.find(m=>Array.isArray(m)&&m[0]==="CONVERSION")):null;const n=e.find(m=>Array.isArray(m)&&m[0]==="CS");n&&(t.coordinate_system={type:n[1],axis:this.extractAxes(e)});const s=e.find(m=>Array.isArray(m)&&m[0]==="LENGTHUNIT");if(s){const m=this.convertUnit(s);t.coordinate_system.unit=m}t.id=this.getId(e);break;case"BASEGEOGCRS":case"GEOGCRS":t.type="GeographicCRS",t.name=e[1];const o=e.find(m=>Array.isArray(m)&&(m[0]==="DATUM"||m[0]==="ENSEMBLE"));if(o){const m=this.convert(o);o[0]==="ENSEMBLE"?t.datum_ensemble=m:t.datum=m;const u=e.find(g=>Array.isArray(g)&&g[0]==="PRIMEM");u&&u[1]!=="Greenwich"&&(m.prime_meridian={name:u[1],longitude:parseFloat(u[2])})}t.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(e)},t.id=this.getId(e);break;case"DATUM":t.type="GeodeticReferenceFrame",t.name=e[1],t.ellipsoid=e.find(m=>Array.isArray(m)&&m[0]==="ELLIPSOID")?this.convert(e.find(m=>Array.isArray(m)&&m[0]==="ELLIPSOID")):null;break;case"ENSEMBLE":t.type="DatumEnsemble",t.name=e[1],t.members=e.filter(m=>Array.isArray(m)&&m[0]==="MEMBER").map(m=>({type:"DatumEnsembleMember",name:m[1],id:this.getId(m)}));const r=e.find(m=>Array.isArray(m)&&m[0]==="ENSEMBLEACCURACY");r&&(t.accuracy=parseFloat(r[1]));const l=e.find(m=>Array.isArray(m)&&m[0]==="ELLIPSOID");l&&(t.ellipsoid=this.convert(l)),t.id=this.getId(e);break;case"ELLIPSOID":t.type="Ellipsoid",t.name=e[1],t.semi_major_axis=parseFloat(e[2]),t.inverse_flattening=parseFloat(e[3]),e.find(m=>Array.isArray(m)&&m[0]==="LENGTHUNIT")&&this.convert(e.find(m=>Array.isArray(m)&&m[0]==="LENGTHUNIT"),t);break;case"CONVERSION":t.type="Conversion",t.name=e[1],t.method=e.find(m=>Array.isArray(m)&&m[0]==="METHOD")?this.convert(e.find(m=>Array.isArray(m)&&m[0]==="METHOD")):null,t.parameters=e.filter(m=>Array.isArray(m)&&m[0]==="PARAMETER").map(m=>this.convert(m));break;case"METHOD":t.type="Method",t.name=e[1],t.id=this.getId(e);break;case"PARAMETER":t.type="Parameter",t.name=e[1],t.value=parseFloat(e[2]),t.unit=this.convertUnit(e.find(m=>Array.isArray(m)&&(m[0]==="LENGTHUNIT"||m[0]==="ANGLEUNIT"||m[0]==="SCALEUNIT"))),t.id=this.getId(e);break;case"BOUNDCRS":t.type="BoundCRS";const c=e.find(m=>Array.isArray(m)&&m[0]==="SOURCECRS");if(c){const m=c.find(u=>Array.isArray(u));t.source_crs=m?this.convert(m):null}const d=e.find(m=>Array.isArray(m)&&m[0]==="TARGETCRS");if(d){const m=d.find(u=>Array.isArray(u));t.target_crs=m?this.convert(m):null}const h=e.find(m=>Array.isArray(m)&&m[0]==="ABRIDGEDTRANSFORMATION");h?t.transformation=this.convert(h):t.transformation=null;break;case"ABRIDGEDTRANSFORMATION":if(t.type="Transformation",t.name=e[1],t.method=e.find(m=>Array.isArray(m)&&m[0]==="METHOD")?this.convert(e.find(m=>Array.isArray(m)&&m[0]==="METHOD")):null,t.parameters=e.filter(m=>Array.isArray(m)&&(m[0]==="PARAMETER"||m[0]==="PARAMETERFILE")).map(m=>{if(m[0]==="PARAMETER")return this.convert(m);if(m[0]==="PARAMETERFILE")return{name:m[1],value:m[2],id:{authority:"EPSG",code:8656}}}),t.parameters.length===7){const m=t.parameters[6];m.name==="Scale difference"&&(m.value=Math.round((m.value-1)*1e12)/1e6)}t.id=this.getId(e);break;case"AXIS":t.coordinate_system||(t.coordinate_system={type:"unspecified",axis:[]}),t.coordinate_system.axis.push(this.convertAxis(e));break;case"LENGTHUNIT":const f=this.convertUnit(e,"LinearUnit");t.coordinate_system&&t.coordinate_system.axis&&t.coordinate_system.axis.forEach(m=>{m.unit||(m.unit=f)}),f.conversion_factor&&f.conversion_factor!==1&&t.semi_major_axis&&(t.semi_major_axis={value:t.semi_major_axis,unit:f});break;default:t.keyword=e[0];break}return t}}class C0 extends Dl{static convert(e,t={}){return super.convert(e,t),t.coordinate_system&&t.coordinate_system.subtype==="Cartesian"&&delete t.coordinate_system,t.usage&&delete t.usage,t}}class v0 extends Dl{static convert(e,t={}){super.convert(e,t);const n=e.find(o=>Array.isArray(o)&&o[0]==="CS");n&&(t.coordinate_system={subtype:n[1],axis:this.extractAxes(e)});const s=e.find(o=>Array.isArray(o)&&o[0]==="USAGE");if(s){const o=s.find(c=>Array.isArray(c)&&c[0]==="SCOPE"),r=s.find(c=>Array.isArray(c)&&c[0]==="AREA"),l=s.find(c=>Array.isArray(c)&&c[0]==="BBOX");t.usage={},o&&(t.usage.scope=o[1]),r&&(t.usage.area=r[1]),l&&(t.usage.bbox=l.slice(1))}return t}}function b0(i){return i.find(e=>Array.isArray(e)&&e[0]==="USAGE")?"2019":(i.find(e=>Array.isArray(e)&&e[0]==="CS")||i[0]==="BOUNDCRS"||i[0]==="PROJCRS"||i[0]==="GEOGCRS","2015")}function w0(i){return(b0(i)==="2019"?v0:C0).convert(i)}function I0(i){const e=i.toUpperCase();return e.includes("PROJCRS")||e.includes("GEOGCRS")||e.includes("BOUNDCRS")||e.includes("VERTCRS")||e.includes("LENGTHUNIT")||e.includes("ANGLEUNIT")||e.includes("SCALEUNIT")?"WKT2":(e.includes("PROJCS")||e.includes("GEOGCS")||e.includes("LOCAL_CS")||e.includes("VERT_CS")||e.includes("UNIT"),"WKT1")}var Zi=1,kl=2,Nl=3,Jn=4,Rl=5,ko=-1,S0=/\s/,x0=/[A-Za-z]/,M0=/[A-Za-z84_]/,Zn=/[,\]]/,Fl=/[\d\.E\-\+]/;function xt(i){if(typeof i!="string")throw new Error("not a string");this.text=i.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=Zi}xt.prototype.readCharicter=function(){var i=this.text[this.place++];if(this.state!==Jn)for(;S0.test(i);){if(this.place>=this.text.length)return;i=this.text[this.place++]}switch(this.state){case Zi:return this.neutral(i);case kl:return this.keyword(i);case Jn:return this.quoted(i);case Rl:return this.afterquote(i);case Nl:return this.number(i);case ko:return}},xt.prototype.afterquote=function(i){if(i==='"'){this.word+='"',this.state=Jn;return}if(Zn.test(i)){this.word=this.word.trim(),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in afterquote yet, index '+this.place)},xt.prototype.afterItem=function(i){if(i===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=Zi;return}if(i==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=Zi,this.currentObject=this.stack.pop(),this.currentObject||(this.state=ko);return}},xt.prototype.number=function(i){if(Fl.test(i)){this.word+=i;return}if(Zn.test(i)){this.word=parseFloat(this.word),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in number yet, index '+this.place)},xt.prototype.quoted=function(i){if(i==='"'){this.state=Rl;return}this.word+=i},xt.prototype.keyword=function(i){if(M0.test(i)){this.word+=i;return}if(i==="["){var e=[];e.push(this.word),this.level++,this.root===null?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,this.state=Zi;return}if(Zn.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in keyword yet, index '+this.place)},xt.prototype.neutral=function(i){if(x0.test(i)){this.word=i,this.state=kl;return}if(i==='"'){this.word="",this.state=Jn;return}if(Fl.test(i)){this.word=i,this.state=Nl;return}if(Zn.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in neutral yet, index '+this.place)},xt.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===ko)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function B0(i){var e=new xt(i);return e.output()}function No(i,e,t){Array.isArray(e)&&(t.unshift(e),e=null);var n=e?{}:i,s=t.reduce(function(o,r){return vi(r,o),o},n);e&&(i[e]=s)}function vi(i,e){if(!Array.isArray(i)){e[i]=!0;return}var t=i.shift();if(t==="PARAMETER"&&(t=i.shift()),i.length===1){if(Array.isArray(i[0])){e[t]={},vi(i[0],e[t]);return}e[t]=i[0];return}if(!i.length){e[t]=!0;return}if(t==="TOWGS84"){e[t]=i;return}if(t==="AXIS"){t in e||(e[t]=[]),e[t].push(i);return}Array.isArray(t)||(e[t]={});var n;switch(t){case"UNIT":case"PRIMEM":case"VERT_DATUM":e[t]={name:i[0].toLowerCase(),convert:i[1]},i.length===3&&vi(i[2],e[t]);return;case"SPHEROID":case"ELLIPSOID":e[t]={name:i[0],a:i[1],rf:i[2]},i.length===4&&vi(i[3],e[t]);return;case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":i[0]=["name",i[0]],No(e,t,i);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":i[0]=["name",i[0]],No(e,t,i),e[t].type=t;return;default:for(n=-1;++n<i.length;)if(!Array.isArray(i[n]))return vi(i,e[t]);return No(e,t,i)}}var T0=.017453292519943295;function lt(i){return i*T0}function Ll(i){const e=(i.projName||"").toLowerCase().replace(/_/g," ");!i.long0&&i.longc&&(e==="albers conic equal area"||e==="lambert azimuthal equal area")&&(i.long0=i.longc),!i.lat_ts&&i.lat1&&(e==="stereographic south pole"||e==="polar stereographic (variant b)")?(i.lat0=lt(i.lat1>0?90:-90),i.lat_ts=i.lat1,delete i.lat1):!i.lat_ts&&i.lat0&&(e==="polar stereographic"||e==="polar stereographic (variant a)")&&(i.lat_ts=i.lat0,i.lat0=lt(i.lat0>0?90:-90),delete i.lat1)}function Ol(i){let e={units:null,to_meter:void 0};return typeof i=="string"?(e.units=i.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.units==="meter"&&(e.to_meter=1)):i&&i.name&&(e.units=i.name.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.to_meter=i.conversion_factor),e}function Gl(i){return typeof i=="object"?i.value*i.unit.conversion_factor:i}function Ul(i,e){i.ellipsoid.radius?(e.a=i.ellipsoid.radius,e.rf=0):(e.a=Gl(i.ellipsoid.semi_major_axis),i.ellipsoid.inverse_flattening!==void 0?e.rf=i.ellipsoid.inverse_flattening:i.ellipsoid.semi_major_axis!==void 0&&i.ellipsoid.semi_minor_axis!==void 0&&(e.rf=e.a/(e.a-Gl(i.ellipsoid.semi_minor_axis))))}function es(i,e={}){return!i||typeof i!="object"?i:i.type==="BoundCRS"?(es(i.source_crs,e),i.transformation&&(i.transformation.method&&i.transformation.method.name==="NTv2"?e.nadgrids=i.transformation.parameters[0].value:e.datum_params=i.transformation.parameters.map(t=>t.value)),e):(Object.keys(i).forEach(t=>{const n=i[t];if(n!==null)switch(t){case"name":if(e.srsCode)break;e.name=n,e.srsCode=n;break;case"type":n==="GeographicCRS"?e.projName="longlat":n==="ProjectedCRS"&&i.conversion&&i.conversion.method&&(e.projName=i.conversion.method.name);break;case"datum":case"datum_ensemble":n.ellipsoid&&(e.ellps=n.ellipsoid.name,Ul(n,e)),n.prime_meridian&&(e.from_greenwich=n.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":e.ellps=n.name,Ul(n,e);break;case"prime_meridian":e.long0=(n.longitude||0)*Math.PI/180;break;case"coordinate_system":if(n.axis){if(e.axis=n.axis.map(s=>{const o=s.direction;if(o==="east")return"e";if(o==="north")return"n";if(o==="west")return"w";if(o==="south")return"s";throw new Error(`Unknown axis direction: ${o}`)}).join("")+"u",n.unit){const{units:s,to_meter:o}=Ol(n.unit);e.units=s,e.to_meter=o}else if(n.axis[0]&&n.axis[0].unit){const{units:s,to_meter:o}=Ol(n.axis[0].unit);e.units=s,e.to_meter=o}}break;case"id":n.authority&&n.code&&(e.title=n.authority+":"+n.code);break;case"conversion":n.method&&n.method.name&&(e.projName=n.method.name),n.parameters&&n.parameters.forEach(s=>{const o=s.name.toLowerCase().replace(/\s+/g,"_"),r=s.value;s.unit&&s.unit.conversion_factor?e[o]=r*s.unit.conversion_factor:s.unit==="degree"?e[o]=r*Math.PI/180:e[o]=r});break;case"unit":n.name&&(e.units=n.name.toLowerCase(),e.units==="metre"&&(e.units="meter")),n.conversion_factor&&(e.to_meter=n.conversion_factor);break;case"base_crs":es(n,e),e.datumCode=n.id?n.id.authority+"_"+n.id.code:n.name;break}}),e.latitude_of_false_origin!==void 0&&(e.lat0=e.latitude_of_false_origin),e.longitude_of_false_origin!==void 0&&(e.long0=e.longitude_of_false_origin),e.latitude_of_standard_parallel!==void 0&&(e.lat0=e.latitude_of_standard_parallel,e.lat1=e.latitude_of_standard_parallel),e.latitude_of_1st_standard_parallel!==void 0&&(e.lat1=e.latitude_of_1st_standard_parallel),e.latitude_of_2nd_standard_parallel!==void 0&&(e.lat2=e.latitude_of_2nd_standard_parallel),e.latitude_of_projection_centre!==void 0&&(e.lat0=e.latitude_of_projection_centre),e.longitude_of_projection_centre!==void 0&&(e.longc=e.longitude_of_projection_centre),e.easting_at_false_origin!==void 0&&(e.x0=e.easting_at_false_origin),e.northing_at_false_origin!==void 0&&(e.y0=e.northing_at_false_origin),e.latitude_of_natural_origin!==void 0&&(e.lat0=e.latitude_of_natural_origin),e.longitude_of_natural_origin!==void 0&&(e.long0=e.longitude_of_natural_origin),e.longitude_of_origin!==void 0&&(e.long0=e.longitude_of_origin),e.false_easting!==void 0&&(e.x0=e.false_easting),e.easting_at_projection_centre&&(e.x0=e.easting_at_projection_centre),e.false_northing!==void 0&&(e.y0=e.false_northing),e.northing_at_projection_centre&&(e.y0=e.northing_at_projection_centre),e.standard_parallel_1!==void 0&&(e.lat1=e.standard_parallel_1),e.standard_parallel_2!==void 0&&(e.lat2=e.standard_parallel_2),e.scale_factor_at_natural_origin!==void 0&&(e.k0=e.scale_factor_at_natural_origin),e.scale_factor_at_projection_centre!==void 0&&(e.k0=e.scale_factor_at_projection_centre),e.scale_factor_on_pseudo_standard_parallel!==void 0&&(e.k0=e.scale_factor_on_pseudo_standard_parallel),e.azimuth!==void 0&&(e.alpha=e.azimuth),e.azimuth_at_projection_centre!==void 0&&(e.alpha=e.azimuth_at_projection_centre),e.angle_from_rectified_to_skew_grid&&(e.rectified_grid_angle=e.angle_from_rectified_to_skew_grid),Ll(e),e)}var P0=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function _0(i,e){var t=e[0],n=e[1];!(t in i)&&n in i&&(i[t]=i[n],e.length===3&&(i[t]=e[2](i[t])))}function Vl(i){for(var e=Object.keys(i),t=0,n=e.length;t<n;++t){var s=e[t];P0.indexOf(s)!==-1&&D0(i[s]),typeof i[s]=="object"&&Vl(i[s])}}function D0(i){if(i.AUTHORITY){var e=Object.keys(i.AUTHORITY)[0];e&&e in i.AUTHORITY&&(i.title=e+":"+i.AUTHORITY[e])}if(i.type==="GEOGCS"?i.projName="longlat":i.type==="LOCAL_CS"?(i.projName="identity",i.local=!0):typeof i.PROJECTION=="object"?i.projName=Object.keys(i.PROJECTION)[0]:i.projName=i.PROJECTION,i.AXIS){for(var t="",n=0,s=i.AXIS.length;n<s;++n){var o=[i.AXIS[n][0].toLowerCase(),i.AXIS[n][1].toLowerCase()];o[0].indexOf("north")!==-1||(o[0]==="y"||o[0]==="lat")&&o[1]==="north"?t+="n":o[0].indexOf("south")!==-1||(o[0]==="y"||o[0]==="lat")&&o[1]==="south"?t+="s":o[0].indexOf("east")!==-1||(o[0]==="x"||o[0]==="lon")&&o[1]==="east"?t+="e":(o[0].indexOf("west")!==-1||(o[0]==="x"||o[0]==="lon")&&o[1]==="west")&&(t+="w")}t.length===2&&(t+="u"),t.length===3&&(i.axis=t)}i.UNIT&&(i.units=i.UNIT.name.toLowerCase(),i.units==="metre"&&(i.units="meter"),i.UNIT.convert&&(i.type==="GEOGCS"?i.DATUM&&i.DATUM.SPHEROID&&(i.to_meter=i.UNIT.convert*i.DATUM.SPHEROID.a):i.to_meter=i.UNIT.convert));var r=i.GEOGCS;i.type==="GEOGCS"&&(r=i),r&&(r.DATUM?i.datumCode=r.DATUM.name.toLowerCase():i.datumCode=r.name.toLowerCase(),i.datumCode.slice(0,2)==="d_"&&(i.datumCode=i.datumCode.slice(2)),i.datumCode==="new_zealand_1949"&&(i.datumCode="nzgd49"),(i.datumCode==="wgs_1984"||i.datumCode==="world_geodetic_system_1984")&&(i.PROJECTION==="Mercator_Auxiliary_Sphere"&&(i.sphere=!0),i.datumCode="wgs84"),i.datumCode==="belge_1972"&&(i.datumCode="rnb72"),r.DATUM&&r.DATUM.SPHEROID&&(i.ellps=r.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),i.ellps.toLowerCase().slice(0,13)==="international"&&(i.ellps="intl"),i.a=r.DATUM.SPHEROID.a,i.rf=parseFloat(r.DATUM.SPHEROID.rf,10)),r.DATUM&&r.DATUM.TOWGS84&&(i.datum_params=r.DATUM.TOWGS84),~i.datumCode.indexOf("osgb_1936")&&(i.datumCode="osgb36"),~i.datumCode.indexOf("osni_1952")&&(i.datumCode="osni52"),(~i.datumCode.indexOf("tm65")||~i.datumCode.indexOf("geodetic_datum_of_1965"))&&(i.datumCode="ire65"),i.datumCode==="ch1903+"&&(i.datumCode="ch1903"),~i.datumCode.indexOf("israel")&&(i.datumCode="isr93")),i.b&&!isFinite(i.b)&&(i.b=i.a),i.rectified_grid_angle&&(i.rectified_grid_angle=lt(i.rectified_grid_angle));function l(h){var f=i.to_meter||1;return h*f}var c=function(h){return _0(i,h)},d=[["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",lt],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",lt],["x0","false_easting",l],["y0","false_northing",l],["long0","central_meridian",lt],["lat0","latitude_of_origin",lt],["lat0","standard_parallel_1",lt],["lat1","standard_parallel_1",lt],["lat2","standard_parallel_2",lt],["azimuth","Azimuth"],["alpha","azimuth",lt],["srsCode","name"]];d.forEach(c),Ll(i)}function ts(i){if(typeof i=="object")return es(i);const e=I0(i);var t=B0(i);if(e==="WKT2"){const o=w0(t);return es(o)}var n=t[0],s={};return vi(t,s),Vl(s),s[n]}function Ge(i){var e=this;if(arguments.length===2){var t=arguments[1];typeof t=="string"?t.charAt(0)==="+"?Ge[i]=Do(arguments[1]):Ge[i]=ts(arguments[1]):t&&typeof t=="object"&&!("projName"in t)?Ge[i]=ts(arguments[1]):(Ge[i]=t,t||delete Ge[i])}else if(arguments.length===1){if(Array.isArray(i))return i.map(function(n){return Array.isArray(n)?Ge.apply(e,n):Ge(n)});if(typeof i=="string"){if(i in Ge)return Ge[i]}else"EPSG"in i?Ge["EPSG:"+i.EPSG]=i:"ESRI"in i?Ge["ESRI:"+i.ESRI]=i:"IAU2000"in i?Ge["IAU2000:"+i.IAU2000]=i:console.log(i);return}}f0(Ge);function k0(i){return typeof i=="string"}function N0(i){return i in Ge}function R0(i){return i.indexOf("+")!==0&&i.indexOf("[")!==-1||typeof i=="object"&&!("srsCode"in i)}var F0=["3857","900913","3785","102113"];function L0(i){var e=Nt(i,"authority");if(e){var t=Nt(e,"epsg");return t&&F0.indexOf(t)>-1}}function O0(i){var e=Nt(i,"extension");if(e)return Nt(e,"proj4")}function G0(i){return i[0]==="+"}function U0(i){if(k0(i)){if(N0(i))return Ge[i];if(R0(i)){var e=ts(i);if(L0(e))return Ge["EPSG:3857"];var t=O0(e);return t?Do(t):e}if(G0(i))return Do(i)}else return"projName"in i?i:ts(i)}function Ql(i,e){i=i||{};var t,n;if(!e)return i;for(n in e)t=e[n],t!==void 0&&(i[n]=t);return i}function Ct(i,e,t){var n=i*e;return t/Math.sqrt(1-n*n)}function en(i){return i<0?-1:1}function X(i,e){return e||Math.abs(i)<=Me?i:i-en(i)*Ji}function ct(i,e,t){var n=i*t,s=.5*i;return n=Math.pow((1-n)/(1+n),s),Math.tan(.5*(j-e))/n}function tn(i,e){for(var t=.5*i,n,s,o=j-2*Math.atan(e),r=0;r<=15;r++)if(n=i*Math.sin(o),s=j-2*Math.atan(e*Math.pow((1-n)/(1+n),t))-o,o+=s,Math.abs(s)<=1e-10)return o;return-9999}function V0(){var i=this.b/this.a;this.es=1-i*i,"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=Ct(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function Q0(i){var e=i.x,t=i.y;if(t*$e>90&&t*$e<-90&&e*$e>180&&e*$e<-180)return null;var n,s;if(Math.abs(Math.abs(t)-j)<=K)return null;if(this.sphere)n=this.x0+this.a*this.k0*X(e-this.long0,this.over),s=this.y0+this.a*this.k0*Math.log(Math.tan(ue+.5*t));else{var o=Math.sin(t),r=ct(this.e,t,o);n=this.x0+this.a*this.k0*X(e-this.long0,this.over),s=this.y0-this.a*this.k0*Math.log(r)}return i.x=n,i.y=s,i}function H0(i){var e=i.x-this.x0,t=i.y-this.y0,n,s;if(this.sphere)s=j-2*Math.atan(Math.exp(-t/(this.a*this.k0)));else{var o=Math.exp(-t/(this.a*this.k0));if(s=tn(this.e,o),s===-9999)return null}return n=X(this.long0+e/(this.a*this.k0),this.over),i.x=n,i.y=s,i}var Y0=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"];const z0={init:V0,forward:Q0,inverse:H0,names:Y0};function j0(){}function Hl(i){return i}var Yl=["longlat","identity"],W0=[z0,{init:j0,forward:Hl,inverse:Hl,names:Yl}],ii={},bi=[];function zl(i,e){var t=bi.length;return i.names?(bi[t]=i,i.names.forEach(function(n){ii[n.toLowerCase()]=t}),this):(console.log(e),!0)}function jl(i){return i.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}function $0(i){if(!i)return!1;var e=i.toLowerCase();if(typeof ii[e]<"u"&&bi[ii[e]]||(e=jl(e),e in ii&&bi[ii[e]]))return bi[ii[e]]}function K0(){W0.forEach(zl)}const q0={start:K0,add:zl,get:$0};var Wl={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 X0=Wl.WGS84;function J0(i,e,t,n){var s=i*i,o=e*e,r=(s-o)/s,l=0;n?(i*=1-r*(p0+r*(A0+r*y0)),s=i*i,r=0):l=Math.sqrt(r);var c=(s-o)/o;return{es:r,e:l,ep2:c}}function Z0(i,e,t,n,s){if(!i){var o=Nt(Wl,n);o||(o=X0),i=o.a,e=o.b,t=o.rf}return t&&!e&&(e=(1-1/t)*i),(t===0||Math.abs(i-e)<K)&&(s=!0,e=i),{a:i,b:e,rf:t,sphere:s}}var is={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 eA in is){var Ro=is[eA];Ro.datumName&&(is[Ro.datumName]=Ro)}function tA(i,e,t,n,s,o,r){var l={};return i===void 0||i==="none"?l.datum_type=_o:l.datum_type=m0,e&&(l.datum_params=e.map(parseFloat),(l.datum_params[0]!==0||l.datum_params[1]!==0||l.datum_params[2]!==0)&&(l.datum_type=ei),l.datum_params.length>3&&(l.datum_params[3]!==0||l.datum_params[4]!==0||l.datum_params[5]!==0||l.datum_params[6]!==0)&&(l.datum_type=ti,l.datum_params[3]*=Xi,l.datum_params[4]*=Xi,l.datum_params[5]*=Xi,l.datum_params[6]=l.datum_params[6]/1e6+1)),r&&(l.datum_type=Ci,l.grids=r),l.a=t,l.b=n,l.es=s,l.ep2=o,l}var Fo={};function iA(i,e,t){return e instanceof ArrayBuffer?nA(i,e,t):{ready:sA(i,e)}}function nA(i,e,t){var n=!0;t!==void 0&&t.includeErrorFields===!1&&(n=!1);var s=new DataView(e),o=rA(s),r=lA(s,o),l=cA(s,r,o,n),c={header:r,subgrids:l};return Fo[i]=c,c}async function sA(i,e){for(var t=[],n=await e.getImageCount(),s=n-1;s>=0;s--){var o=await e.getImage(s),r=await o.readRasters(),l=r,c=[o.getWidth(),o.getHeight()],d=o.getBoundingBox().map($l),h=[o.fileDirectory.ModelPixelScale[0],o.fileDirectory.ModelPixelScale[1]].map($l),f=d[0]+(c[0]-1)*h[0],m=d[3]-(c[1]-1)*h[1],u=l[0],g=l[1],A=[];for(let C=c[1]-1;C>=0;C--)for(let I=c[0]-1;I>=0;I--){var p=C*c[0]+I;A.push([-Rt(g[p]),Rt(u[p])])}t.push({del:h,lim:c,ll:[-f,m],cvs:A})}var y={header:{nSubgrids:n},subgrids:t};return Fo[i]=y,y}function oA(i){if(i===void 0)return null;var e=i.split(",");return e.map(aA)}function aA(i){if(i.length===0)return null;var e=i[0]==="@";return e&&(i=i.slice(1)),i==="null"?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:i,mandatory:!e,grid:Fo[i]||null,isNull:!1}}function $l(i){return i*Math.PI/180}function Rt(i){return i/3600*Math.PI/180}function rA(i){var e=i.getInt32(8,!1);return e===11?!1:(e=i.getInt32(8,!0),e!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function lA(i,e){return{nFields:i.getInt32(8,e),nSubgridFields:i.getInt32(24,e),nSubgrids:i.getInt32(40,e),shiftType:Lo(i,56,64).trim(),fromSemiMajorAxis:i.getFloat64(120,e),fromSemiMinorAxis:i.getFloat64(136,e),toSemiMajorAxis:i.getFloat64(152,e),toSemiMinorAxis:i.getFloat64(168,e)}}function Lo(i,e,t){return String.fromCharCode.apply(null,new Uint8Array(i.buffer.slice(e,t)))}function cA(i,e,t,n){for(var s=176,o=[],r=0;r<e.nSubgrids;r++){var l=hA(i,s,t),c=uA(i,s,l,t,n),d=Math.round(1+(l.upperLongitude-l.lowerLongitude)/l.longitudeInterval),h=Math.round(1+(l.upperLatitude-l.lowerLatitude)/l.latitudeInterval);o.push({ll:[Rt(l.lowerLongitude),Rt(l.lowerLatitude)],del:[Rt(l.longitudeInterval),Rt(l.latitudeInterval)],lim:[d,h],count:l.gridNodeCount,cvs:dA(c)});var f=16;n===!1&&(f=8),s+=176+l.gridNodeCount*f}return o}function dA(i){return i.map(function(e){return[Rt(e.longitudeShift),Rt(e.latitudeShift)]})}function hA(i,e,t){return{name:Lo(i,e+8,e+16).trim(),parent:Lo(i,e+24,e+24+8).trim(),lowerLatitude:i.getFloat64(e+72,t),upperLatitude:i.getFloat64(e+88,t),lowerLongitude:i.getFloat64(e+104,t),upperLongitude:i.getFloat64(e+120,t),latitudeInterval:i.getFloat64(e+136,t),longitudeInterval:i.getFloat64(e+152,t),gridNodeCount:i.getInt32(e+168,t)}}function uA(i,e,t,n,s){var o=e+176,r=16;s===!1&&(r=8);for(var l=[],c=0;c<t.gridNodeCount;c++){var d={latitudeShift:i.getFloat32(o+c*r,n),longitudeShift:i.getFloat32(o+c*r+4,n)};s!==!1&&(d.latitudeAccuracy=i.getFloat32(o+c*r+8,n),d.longitudeAccuracy=i.getFloat32(o+c*r+12,n)),l.push(d)}return l}function st(i,e){if(!(this instanceof st))return new st(i);this.forward=null,this.inverse=null,this.init=null,this.name,this.names=null,this.title,e=e||function(d){if(d)throw d};var t=U0(i);if(typeof t!="object"){e("Could not parse to valid json: "+i);return}var n=st.projections.get(t.projName);if(!n){e("Could not get projection name from: "+i);return}if(t.datumCode&&t.datumCode!=="none"){var s=Nt(is,t.datumCode);s&&(t.datum_params=t.datum_params||(s.towgs84?s.towgs84.split(","):null),t.ellps=s.ellipse,t.datumName=s.datumName?s.datumName:t.datumCode)}t.k0=t.k0||1,t.axis=t.axis||"enu",t.ellps=t.ellps||"wgs84",t.lat1=t.lat1||t.lat0;var o=Z0(t.a,t.b,t.rf,t.ellps,t.sphere),r=J0(o.a,o.b,o.rf,t.R_A),l=oA(t.nadgrids),c=t.datum||tA(t.datumCode,t.datum_params,o.a,o.b,r.es,r.ep2,l);Ql(this,t),Ql(this,n),this.a=o.a,this.b=o.b,this.rf=o.rf,this.sphere=o.sphere,this.es=r.es,this.e=r.e,this.ep2=r.ep2,this.datum=c,"init"in this&&typeof this.init=="function"&&this.init(),e(null,this)}st.projections=q0,st.projections.start();function fA(i,e){return i.datum_type!==e.datum_type||i.a!==e.a||Math.abs(i.es-e.es)>5e-11?!1:i.datum_type===ei?i.datum_params[0]===e.datum_params[0]&&i.datum_params[1]===e.datum_params[1]&&i.datum_params[2]===e.datum_params[2]:i.datum_type===ti?i.datum_params[0]===e.datum_params[0]&&i.datum_params[1]===e.datum_params[1]&&i.datum_params[2]===e.datum_params[2]&&i.datum_params[3]===e.datum_params[3]&&i.datum_params[4]===e.datum_params[4]&&i.datum_params[5]===e.datum_params[5]&&i.datum_params[6]===e.datum_params[6]:!0}function Kl(i,e,t){var n=i.x,s=i.y,o=i.z?i.z:0,r,l,c,d;if(s<-j&&s>-1.001*j)s=-j;else if(s>j&&s<1.001*j)s=j;else{if(s<-j)return{x:-1/0,y:-1/0,z:i.z};if(s>j)return{x:1/0,y:1/0,z:i.z}}return n>Math.PI&&(n-=2*Math.PI),l=Math.sin(s),d=Math.cos(s),c=l*l,r=t/Math.sqrt(1-e*c),{x:(r+o)*d*Math.cos(n),y:(r+o)*d*Math.sin(n),z:(r*(1-e)+o)*l}}function ql(i,e,t,n){var s=1e-12,o=s*s,r=30,l,c,d,h,f,m,u,g,A,p,y,C,I,P=i.x,k=i.y,M=i.z?i.z:0,B,_,E;if(l=Math.sqrt(P*P+k*k),c=Math.sqrt(P*P+k*k+M*M),l/t<s){if(B=0,c/t<s)return _=j,E=-n,{x:i.x,y:i.y,z:i.z}}else B=Math.atan2(k,P);d=M/c,h=l/c,f=1/Math.sqrt(1-e*(2-e)*h*h),g=h*(1-e)*f,A=d*f,I=0;do I++,u=t/Math.sqrt(1-e*A*A),E=l*g+M*A-u*(1-e*A*A),m=e*u/(u+E),f=1/Math.sqrt(1-m*(2-m)*h*h),p=h*(1-m)*f,y=d*f,C=y*g-p*A,g=p,A=y;while(C*C>o&&I<r);return _=Math.atan(y/Math.abs(p)),{x:B,y:_,z:E}}function mA(i,e,t){if(e===ei)return{x:i.x+t[0],y:i.y+t[1],z:i.z+t[2]};if(e===ti){var n=t[0],s=t[1],o=t[2],r=t[3],l=t[4],c=t[5],d=t[6];return{x:d*(i.x-c*i.y+l*i.z)+n,y:d*(c*i.x+i.y-r*i.z)+s,z:d*(-l*i.x+r*i.y+i.z)+o}}}function gA(i,e,t){if(e===ei)return{x:i.x-t[0],y:i.y-t[1],z:i.z-t[2]};if(e===ti){var n=t[0],s=t[1],o=t[2],r=t[3],l=t[4],c=t[5],d=t[6],h=(i.x-n)/d,f=(i.y-s)/d,m=(i.z-o)/d;return{x:h+c*f-l*m,y:-c*h+f+r*m,z:l*h-r*f+m}}}function ns(i){return i===ei||i===ti}function pA(i,e,t){if(fA(i,e)||i.datum_type===_o||e.datum_type===_o)return t;var n=i.a,s=i.es;if(i.datum_type===Ci){var o=Xl(i,!1,t);if(o!==0)return;n=Tl,s=Pl}var r=e.a,l=e.b,c=e.es;if(e.datum_type===Ci&&(r=Tl,l=g0,c=Pl),s===c&&n===r&&!ns(i.datum_type)&&!ns(e.datum_type))return t;if(t=Kl(t,s,n),ns(i.datum_type)&&(t=mA(t,i.datum_type,i.datum_params)),ns(e.datum_type)&&(t=gA(t,e.datum_type,e.datum_params)),t=ql(t,c,r,l),e.datum_type===Ci){var d=Xl(e,!0,t);if(d!==0)return}return t}function Xl(i,e,t){if(i.grids===null||i.grids.length===0)return console.log("Grid shift grids not found"),-1;var n={x:-t.x,y:t.y},s={x:Number.NaN,y:Number.NaN},o=[];e:for(var r=0;r<i.grids.length;r++){var l=i.grids[r];if(o.push(l.name),l.isNull){s=n;break}if(l.grid===null){if(l.mandatory)return console.log("Unable to find mandatory grid '"+l.name+"'"),-1;continue}for(var c=l.grid.subgrids,d=0,h=c.length;d<h;d++){var f=c[d],m=(Math.abs(f.del[1])+Math.abs(f.del[0]))/1e4,u=f.ll[0]-m,g=f.ll[1]-m,A=f.ll[0]+(f.lim[0]-1)*f.del[0]+m,p=f.ll[1]+(f.lim[1]-1)*f.del[1]+m;if(!(g>n.y||u>n.x||p<n.y||A<n.x)&&(s=AA(n,e,f),!isNaN(s.x)))break e}}return isNaN(s.x)?(console.log("Failed to find a grid shift table for location '"+-n.x*$e+" "+n.y*$e+" tried: '"+o+"'"),-1):(t.x=-s.x,t.y=s.y,0)}function AA(i,e,t){var n={x:Number.NaN,y:Number.NaN};if(isNaN(i.x))return n;var s={x:i.x,y:i.y};s.x-=t.ll[0],s.y-=t.ll[1],s.x=X(s.x-Math.PI)+Math.PI;var o=Jl(s,t);if(e){if(isNaN(o.x))return n;o.x=s.x-o.x,o.y=s.y-o.y;var r=9,l=1e-12,c,d;do{if(d=Jl(o,t),isNaN(d.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}c={x:s.x-(d.x+o.x),y:s.y-(d.y+o.y)},o.x+=c.x,o.y+=c.y}while(r--&&Math.abs(c.x)>l&&Math.abs(c.y)>l);if(r<0)return console.log("Inverse grid shift iterator failed to converge."),n;n.x=X(o.x+t.ll[0]),n.y=o.y+t.ll[1]}else isNaN(o.x)||(n.x=i.x+o.x,n.y=i.y+o.y);return n}function Jl(i,e){var t={x:i.x/e.del[0],y:i.y/e.del[1]},n={x:Math.floor(t.x),y:Math.floor(t.y)},s={x:t.x-1*n.x,y:t.y-1*n.y},o={x:Number.NaN,y:Number.NaN},r;if(n.x<0||n.x>=e.lim[0]||n.y<0||n.y>=e.lim[1])return o;r=n.y*e.lim[0]+n.x;var l={x:e.cvs[r][0],y:e.cvs[r][1]};r++;var c={x:e.cvs[r][0],y:e.cvs[r][1]};r+=e.lim[0];var d={x:e.cvs[r][0],y:e.cvs[r][1]};r--;var h={x:e.cvs[r][0],y:e.cvs[r][1]},f=s.x*s.y,m=s.x*(1-s.y),u=(1-s.x)*(1-s.y),g=(1-s.x)*s.y;return o.x=u*l.x+m*c.x+g*h.x+f*d.x,o.y=u*l.y+m*c.y+g*h.y+f*d.y,o}function Zl(i,e,t){var n=t.x,s=t.y,o=t.z||0,r,l,c,d={};for(c=0;c<3;c++)if(!(e&&c===2&&t.z===void 0))switch(c===0?(r=n,"ew".indexOf(i.axis[c])!==-1?l="x":l="y"):c===1?(r=s,"ns".indexOf(i.axis[c])!==-1?l="y":l="x"):(r=o,l="z"),i.axis[c]){case"e":d[l]=r;break;case"w":d[l]=-r;break;case"n":d[l]=r;break;case"s":d[l]=-r;break;case"u":t[l]!==void 0&&(d.z=r);break;case"d":t[l]!==void 0&&(d.z=-r);break;default:return null}return d}function ec(i){var e={x:i[0],y:i[1]};return i.length>2&&(e.z=i[2]),i.length>3&&(e.m=i[3]),e}function yA(i){tc(i.x),tc(i.y)}function tc(i){if(typeof Number.isFinite=="function"){if(Number.isFinite(i))return;throw new TypeError("coordinates must be finite numbers")}if(typeof i!="number"||i!==i||!isFinite(i))throw new TypeError("coordinates must be finite numbers")}function EA(i,e){return(i.datum.datum_type===ei||i.datum.datum_type===ti||i.datum.datum_type===Ci)&&e.datumCode!=="WGS84"||(e.datum.datum_type===ei||e.datum.datum_type===ti||e.datum.datum_type===Ci)&&i.datumCode!=="WGS84"}function ss(i,e,t,n){var s;Array.isArray(t)?t=ec(t):t={x:t.x,y:t.y,z:t.z,m:t.m};var o=t.z!==void 0;if(yA(t),i.datum&&e.datum&&EA(i,e)&&(s=new st("WGS84"),t=ss(i,s,t,n),i=s),n&&i.axis!=="enu"&&(t=Zl(i,!1,t)),i.projName==="longlat")t={x:t.x*xe,y:t.y*xe,z:t.z||0};else if(i.to_meter&&(t={x:t.x*i.to_meter,y:t.y*i.to_meter,z:t.z||0}),t=i.inverse(t),!t)return;if(i.from_greenwich&&(t.x+=i.from_greenwich),t=pA(i.datum,e.datum,t),!!t)return t=t,e.from_greenwich&&(t={x:t.x-e.from_greenwich,y:t.y,z:t.z||0}),e.projName==="longlat"?t={x:t.x*$e,y:t.y*$e,z:t.z||0}:(t=e.forward(t),e.to_meter&&(t={x:t.x/e.to_meter,y:t.y/e.to_meter,z:t.z||0})),n&&e.axis!=="enu"?Zl(e,!0,t):(t&&!o&&delete t.z,t)}var ic=st("WGS84");function Oo(i,e,t,n){var s,o,r;return Array.isArray(t)?(s=ss(i,e,t,n)||{x:NaN,y:NaN},t.length>2?typeof i.name<"u"&&i.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"?typeof s.z=="number"?[s.x,s.y,s.z].concat(t.slice(3)):[s.x,s.y,t[2]].concat(t.slice(3)):[s.x,s.y].concat(t.slice(2)):[s.x,s.y]):(o=ss(i,e,t,n),r=Object.keys(t),r.length===2||r.forEach(function(l){if(typeof i.name<"u"&&i.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"){if(l==="x"||l==="y"||l==="z")return}else if(l==="x"||l==="y")return;o[l]=t[l]}),o)}function os(i){return i instanceof st?i:typeof i=="object"&&"oProj"in i?i.oProj:st(i)}function CA(i,e,t){var n,s,o=!1,r;return typeof e>"u"?(s=os(i),n=ic,o=!0):(typeof e.x<"u"||Array.isArray(e))&&(t=e,s=os(i),n=ic,o=!0),n||(n=os(i)),s||(s=os(e)),t?Oo(n,s,t):(r={forward:function(l,c){return Oo(n,s,l,c)},inverse:function(l,c){return Oo(s,n,l,c)}},o&&(r.oProj=s),r)}var nc=6,sc="AJSAJS",oc="AFAFAF",wi=65,qe=73,ot=79,nn=86,sn=90;const vA={forward:ac,inverse:bA,toPoint:rc};function ac(i,e){return e=e||5,SA(wA({lat:i[1],lon:i[0]}),e)}function bA(i){var e=Uo(dc(i.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]}function rc(i){var e=Uo(dc(i.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function Go(i){return i*(Math.PI/180)}function lc(i){return 180*(i/Math.PI)}function wA(i){var e=i.lat,t=i.lon,n=6378137,s=.00669438,o=.9996,r,l,c,d,h,f,m,u=Go(e),g=Go(t),A,p;p=Math.floor((t+180)/6)+1,t===180&&(p=60),e>=56&&e<64&&t>=3&&t<12&&(p=32),e>=72&&e<84&&(t>=0&&t<9?p=31:t>=9&&t<21?p=33:t>=21&&t<33?p=35:t>=33&&t<42&&(p=37)),r=(p-1)*6-180+3,A=Go(r),l=s/(1-s),c=n/Math.sqrt(1-s*Math.sin(u)*Math.sin(u)),d=Math.tan(u)*Math.tan(u),h=l*Math.cos(u)*Math.cos(u),f=Math.cos(u)*(g-A),m=n*((1-s/4-3*s*s/64-5*s*s*s/256)*u-(3*s/8+3*s*s/32+45*s*s*s/1024)*Math.sin(2*u)+(15*s*s/256+45*s*s*s/1024)*Math.sin(4*u)-35*s*s*s/3072*Math.sin(6*u));var y=o*c*(f+(1-d+h)*f*f*f/6+(5-18*d+d*d+72*h-58*l)*f*f*f*f*f/120)+5e5,C=o*(m+c*Math.tan(u)*(f*f/2+(5-d+9*h+4*h*h)*f*f*f*f/24+(61-58*d+d*d+600*h-330*l)*f*f*f*f*f*f/720));return e<0&&(C+=1e7),{northing:Math.round(C),easting:Math.round(y),zoneNumber:p,zoneLetter:IA(e)}}function Uo(i){var e=i.northing,t=i.easting,n=i.zoneLetter,s=i.zoneNumber;if(s<0||s>60)return null;var o=.9996,r=6378137,l=.00669438,c,d=(1-Math.sqrt(1-l))/(1+Math.sqrt(1-l)),h,f,m,u,g,A,p,y,C,I=t-5e5,P=e;n<"N"&&(P-=1e7),p=(s-1)*6-180+3,c=l/(1-l),A=P/o,y=A/(r*(1-l/4-3*l*l/64-5*l*l*l/256)),C=y+(3*d/2-27*d*d*d/32)*Math.sin(2*y)+(21*d*d/16-55*d*d*d*d/32)*Math.sin(4*y)+151*d*d*d/96*Math.sin(6*y),h=r/Math.sqrt(1-l*Math.sin(C)*Math.sin(C)),f=Math.tan(C)*Math.tan(C),m=c*Math.cos(C)*Math.cos(C),u=r*(1-l)/Math.pow(1-l*Math.sin(C)*Math.sin(C),1.5),g=I/(h*o);var k=C-h*Math.tan(C)/u*(g*g/2-(5+3*f+10*m-4*m*m-9*c)*g*g*g*g/24+(61+90*f+298*m+45*f*f-252*c-3*m*m)*g*g*g*g*g*g/720);k=lc(k);var M=(g-(1+2*f+m)*g*g*g/6+(5-2*m+28*f-3*m*m+8*c+24*f*f)*g*g*g*g*g/120)/Math.cos(C);M=p+lc(M);var B;if(i.accuracy){var _=Uo({northing:i.northing+i.accuracy,easting:i.easting+i.accuracy,zoneLetter:i.zoneLetter,zoneNumber:i.zoneNumber});B={top:_.lat,right:_.lon,bottom:k,left:M}}else B={lat:k,lon:M};return B}function IA(i){var e="Z";return 84>=i&&i>=72?e="X":72>i&&i>=64?e="W":64>i&&i>=56?e="V":56>i&&i>=48?e="U":48>i&&i>=40?e="T":40>i&&i>=32?e="S":32>i&&i>=24?e="R":24>i&&i>=16?e="Q":16>i&&i>=8?e="P":8>i&&i>=0?e="N":0>i&&i>=-8?e="M":-8>i&&i>=-16?e="L":-16>i&&i>=-24?e="K":-24>i&&i>=-32?e="J":-32>i&&i>=-40?e="H":-40>i&&i>=-48?e="G":-48>i&&i>=-56?e="F":-56>i&&i>=-64?e="E":-64>i&&i>=-72?e="D":-72>i&&i>=-80&&(e="C"),e}function SA(i,e){var t="00000"+i.easting,n="00000"+i.northing;return i.zoneNumber+i.zoneLetter+xA(i.easting,i.northing,i.zoneNumber)+t.substr(t.length-5,e)+n.substr(n.length-5,e)}function xA(i,e,t){var n=cc(t),s=Math.floor(i/1e5),o=Math.floor(e/1e5)%20;return MA(s,o,n)}function cc(i){var e=i%nc;return e===0&&(e=nc),e}function MA(i,e,t){var n=t-1,s=sc.charCodeAt(n),o=oc.charCodeAt(n),r=s+i-1,l=o+e,c=!1;r>sn&&(r=r-sn+wi-1,c=!0),(r===qe||s<qe&&r>qe||(r>qe||s<qe)&&c)&&r++,(r===ot||s<ot&&r>ot||(r>ot||s<ot)&&c)&&(r++,r===qe&&r++),r>sn&&(r=r-sn+wi-1),l>nn?(l=l-nn+wi-1,c=!0):c=!1,(l===qe||o<qe&&l>qe||(l>qe||o<qe)&&c)&&l++,(l===ot||o<ot&&l>ot||(l>ot||o<ot)&&c)&&(l++,l===qe&&l++),l>nn&&(l=l-nn+wi-1);var d=String.fromCharCode(r)+String.fromCharCode(l);return d}function dc(i){if(i&&i.length===0)throw"MGRSPoint coverting from nothing";for(var e=i.length,t=null,n="",s,o=0;!/[A-Z]/.test(s=i.charAt(o));){if(o>=2)throw"MGRSPoint bad conversion from: "+i;n+=s,o++}var r=parseInt(n,10);if(o===0||o+3>e)throw"MGRSPoint bad conversion from: "+i;var l=i.charAt(o++);if(l<="A"||l==="B"||l==="Y"||l>="Z"||l==="I"||l==="O")throw"MGRSPoint zone letter "+l+" not handled: "+i;t=i.substring(o,o+=2);for(var c=cc(r),d=BA(t.charAt(0),c),h=TA(t.charAt(1),c);h<PA(l);)h+=2e6;var f=e-o;if(f%2!==0)throw`MGRSPoint has to have an even number
|
|
13
|
+
`)),e)})}const yr=[];for(let i=0;i<256;i++){let e=i;for(let t=0;t<8;t++)e&1?e=e>>>1^3988292384:e=e>>>1;yr[i]=e}class zn{constructor(e){this.crc=e||-1}append(e){let t=this.crc|0;for(let n=0,s=e.length|0;n<s;n++)t=t>>>8^yr[(t^e[n])&255];this.crc=t}get(){return~this.crc}}class Er extends TransformStream{constructor(){let e;const t=new zn;super({transform(n,s){t.append(n),s.enqueue(n)},flush(){const n=new Uint8Array(4);new DataView(n.buffer).setUint32(0,t.get()),e.value=n}}),e=this}}function lg(i){if(typeof TextEncoder==_t){i=unescape(encodeURIComponent(i));const e=new Uint8Array(i.length);for(let t=0;t<e.length;t++)e[t]=i.charCodeAt(t);return e}else return new TextEncoder().encode(i)}const Ye={concat(i,e){if(i.length===0||e.length===0)return i.concat(e);const t=i[i.length-1],n=Ye.getPartial(t);return n===32?i.concat(e):Ye._shiftRight(e,n,t|0,i.slice(0,i.length-1))},bitLength(i){const e=i.length;if(e===0)return 0;const t=i[e-1];return(e-1)*32+Ye.getPartial(t)},clamp(i,e){if(i.length*32<e)return i;i=i.slice(0,Math.ceil(e/32));const t=i.length;return e=e&31,t>0&&e&&(i[t-1]=Ye.partial(e,i[t-1]&2147483648>>e-1,1)),i},partial(i,e,t){return i===32?e:(t?e|0:e<<32-i)+i*1099511627776},getPartial(i){return Math.round(i/1099511627776)||32},_shiftRight(i,e,t,n){for(n===void 0&&(n=[]);e>=32;e-=32)n.push(t),t=0;if(e===0)return n.concat(i);for(let r=0;r<i.length;r++)n.push(t|i[r]>>>e),t=i[r]<<32-e;const s=i.length?i[i.length-1]:0,o=Ye.getPartial(s);return n.push(Ye.partial(e+o&31,e+o>32?t:n.pop(),1)),n}},jn={bytes:{fromBits(i){const t=Ye.bitLength(i)/8,n=new Uint8Array(t);let s;for(let o=0;o<t;o++)(o&3)===0&&(s=i[o/4]),n[o]=s>>>24,s<<=8;return n},toBits(i){const e=[];let t,n=0;for(t=0;t<i.length;t++)n=n<<8|i[t],(t&3)===3&&(e.push(n),n=0);return t&3&&e.push(Ye.partial(8*(t&3),n)),e}}},Cr={};Cr.sha1=class{constructor(i){const e=this;e.blockSize=512,e._init=[1732584193,4023233417,2562383102,271733878,3285377520],e._key=[1518500249,1859775393,2400959708,3395469782],i?(e._h=i._h.slice(0),e._buffer=i._buffer.slice(0),e._length=i._length):e.reset()}reset(){const i=this;return i._h=i._init.slice(0),i._buffer=[],i._length=0,i}update(i){const e=this;typeof i=="string"&&(i=jn.utf8String.toBits(i));const t=e._buffer=Ye.concat(e._buffer,i),n=e._length,s=e._length=n+Ye.bitLength(i);if(s>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");const o=new Uint32Array(t);let r=0;for(let l=e.blockSize+n-(e.blockSize+n&e.blockSize-1);l<=s;l+=e.blockSize)e._block(o.subarray(16*r,16*(r+1))),r+=1;return t.splice(0,16*r),e}finalize(){const i=this;let e=i._buffer;const t=i._h;e=Ye.concat(e,[Ye.partial(1,1)]);for(let n=e.length+2;n&15;n++)e.push(0);for(e.push(Math.floor(i._length/4294967296)),e.push(i._length|0);e.length;)i._block(e.splice(0,16));return i.reset(),t}_f(i,e,t,n){if(i<=19)return e&t|~e&n;if(i<=39)return e^t^n;if(i<=59)return e&t|e&n|t&n;if(i<=79)return e^t^n}_S(i,e){return e<<i|e>>>32-i}_block(i){const e=this,t=e._h,n=Array(80);for(let d=0;d<16;d++)n[d]=i[d];let s=t[0],o=t[1],r=t[2],l=t[3],c=t[4];for(let d=0;d<=79;d++){d>=16&&(n[d]=e._S(1,n[d-3]^n[d-8]^n[d-14]^n[d-16]));const h=e._S(5,s)+e._f(d,o,r,l)+c+n[d]+e._key[Math.floor(d/20)]|0;c=l,l=r,r=e._S(30,o),o=s,s=h}t[0]=t[0]+s|0,t[1]=t[1]+o|0,t[2]=t[2]+r|0,t[3]=t[3]+l|0,t[4]=t[4]+c|0}};const vr={};vr.aes=class{constructor(i){const e=this;e._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],e._tables[0][0][0]||e._precompute();const t=e._tables[0][4],n=e._tables[1],s=i.length;let o,r,l,c=1;if(s!==4&&s!==6&&s!==8)throw new Error("invalid aes key size");for(e._key=[r=i.slice(0),l=[]],o=s;o<4*s+28;o++){let d=r[o-1];(o%s===0||s===8&&o%s===4)&&(d=t[d>>>24]<<24^t[d>>16&255]<<16^t[d>>8&255]<<8^t[d&255],o%s===0&&(d=d<<8^d>>>24^c<<24,c=c<<1^(c>>7)*283)),r[o]=r[o-s]^d}for(let d=0;o;d++,o--){const h=r[d&3?o:o-4];o<=4||d<4?l[d]=h:l[d]=n[0][t[h>>>24]]^n[1][t[h>>16&255]]^n[2][t[h>>8&255]]^n[3][t[h&255]]}}encrypt(i){return this._crypt(i,0)}decrypt(i){return this._crypt(i,1)}_precompute(){const i=this._tables[0],e=this._tables[1],t=i[4],n=e[4],s=[],o=[];let r,l,c,d;for(let h=0;h<256;h++)o[(s[h]=h<<1^(h>>7)*283)^h]=h;for(let h=r=0;!t[h];h^=l||1,r=o[r]||1){let f=r^r<<1^r<<2^r<<3^r<<4;f=f>>8^f&255^99,t[h]=f,n[f]=h,d=s[c=s[l=s[h]]];let m=d*16843009^c*65537^l*257^h*16843008,u=s[f]*257^f*16843008;for(let g=0;g<4;g++)i[g][h]=u=u<<24^u>>>8,e[g][f]=m=m<<24^m>>>8}for(let h=0;h<5;h++)i[h]=i[h].slice(0),e[h]=e[h].slice(0)}_crypt(i,e){if(i.length!==4)throw new Error("invalid aes block size");const t=this._key[e],n=t.length/4-2,s=[0,0,0,0],o=this._tables[e],r=o[0],l=o[1],c=o[2],d=o[3],h=o[4];let f=i[0]^t[0],m=i[e?3:1]^t[1],u=i[2]^t[2],g=i[e?1:3]^t[3],A=4,p,y,C;for(let I=0;I<n;I++)p=r[f>>>24]^l[m>>16&255]^c[u>>8&255]^d[g&255]^t[A],y=r[m>>>24]^l[u>>16&255]^c[g>>8&255]^d[f&255]^t[A+1],C=r[u>>>24]^l[g>>16&255]^c[f>>8&255]^d[m&255]^t[A+2],g=r[g>>>24]^l[f>>16&255]^c[m>>8&255]^d[u&255]^t[A+3],A+=4,f=p,m=y,u=C;for(let I=0;I<4;I++)s[e?3&-I:I]=h[f>>>24]<<24^h[m>>16&255]<<16^h[u>>8&255]<<8^h[g&255]^t[A++],p=f,f=m,m=u,u=g,g=p;return s}};const cg={getRandomValues(i){const e=new Uint32Array(i.buffer),t=n=>{let s=987654321;const o=4294967295;return function(){return s=36969*(s&65535)+(s>>16)&o,n=18e3*(n&65535)+(n>>16)&o,(((s<<16)+n&o)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let n=0,s;n<i.length;n+=4){const o=t((s||Math.random())*4294967296);s=o()*987654071,e[n/4]=o()*4294967296|0}return i}},br={};br.ctrGladman=class{constructor(i,e){this._prf=i,this._initIv=e,this._iv=e}reset(){this._iv=this._initIv}update(i){return this.calculate(this._prf,i,this._iv)}incWord(i){if((i>>24&255)===255){let e=i>>16&255,t=i>>8&255,n=i&255;e===255?(e=0,t===255?(t=0,n===255?n=0:++n):++t):++e,i=0,i+=e<<16,i+=t<<8,i+=n}else i+=1<<24;return i}incCounter(i){(i[0]=this.incWord(i[0]))===0&&(i[1]=this.incWord(i[1]))}calculate(i,e,t){let n;if(!(n=e.length))return[];const s=Ye.bitLength(e);for(let o=0;o<n;o+=4){this.incCounter(t);const r=i.encrypt(t);e[o]^=r[0],e[o+1]^=r[1],e[o+2]^=r[2],e[o+3]^=r[3]}return Ye.clamp(e,s)}};const Jt={importKey(i){return new Jt.hmacSha1(jn.bytes.toBits(i))},pbkdf2(i,e,t,n){if(t=t||1e4,n<0||t<0)throw new Error("invalid params to pbkdf2");const s=(n>>5)+1<<2;let o,r,l,c,d;const h=new ArrayBuffer(s),f=new DataView(h);let m=0;const u=Ye;for(e=jn.bytes.toBits(e),d=1;m<(s||1);d++){for(o=r=i.encrypt(u.concat(e,[d])),l=1;l<t;l++)for(r=i.encrypt(r),c=0;c<r.length;c++)o[c]^=r[c];for(l=0;m<(s||1)&&l<o.length;l++)f.setInt32(m,o[l]),m+=4}return h.slice(0,n/8)}};Jt.hmacSha1=class{constructor(i){const e=this,t=e._hash=Cr.sha1,n=[[],[]];e._baseHash=[new t,new t];const s=e._baseHash[0].blockSize/32;i.length>s&&(i=new t().update(i).finalize());for(let o=0;o<s;o++)n[0][o]=i[o]^909522486,n[1][o]=i[o]^1549556828;e._baseHash[0].update(n[0]),e._baseHash[1].update(n[1]),e._resultHash=new t(e._baseHash[0])}reset(){const i=this;i._resultHash=new i._hash(i._baseHash[0]),i._updated=!1}update(i){const e=this;e._updated=!0,e._resultHash.update(i)}digest(){const i=this,e=i._resultHash.finalize(),t=new i._hash(i._baseHash[1]).update(e).finalize();return i.reset(),t}encrypt(i){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(i),this.digest(i)}};const dg=typeof crypto!=_t&&typeof crypto.getRandomValues==Xt,wr="Invalid password",Ir="Invalid signature",fo="zipjs-abort-check-password";function Sr(i){return dg?crypto.getRandomValues(i):cg.getRandomValues(i)}const pi=16,hg="raw",xr={name:"PBKDF2"},ug={name:"HMAC"},fg="SHA-1",mg=Object.assign({hash:ug},xr),mo=Object.assign({iterations:1e3,hash:{name:fg}},xr),gg=["deriveBits"],Qi=[8,12,16],Hi=[16,24,32],Dt=10,pg=[0,0,0,0],Wn=typeof crypto!=_t,Yi=Wn&&crypto.subtle,Mr=Wn&&typeof Yi!=_t,yt=jn.bytes,Ag=vr.aes,yg=br.ctrGladman,Eg=Jt.hmacSha1;let Br=Wn&&Mr&&typeof Yi.importKey==Xt,Tr=Wn&&Mr&&typeof Yi.deriveBits==Xt;class Cg extends TransformStream{constructor({password:e,rawPassword:t,signed:n,encryptionStrength:s,checkPasswordOnly:o}){super({start(){Object.assign(this,{ready:new Promise(r=>this.resolveReady=r),password:Dr(e,t),signed:n,strength:s-1,pending:new Uint8Array})},async transform(r,l){const c=this,{password:d,strength:h,resolveReady:f,ready:m}=c;d?(await bg(c,h,d,nt(r,0,Qi[h]+2)),r=nt(r,Qi[h]+2),o?l.error(new Error(fo)):f()):await m;const u=new Uint8Array(r.length-Dt-(r.length-Dt)%pi);l.enqueue(Pr(c,r,u,0,Dt,!0))},async flush(r){const{signed:l,ctr:c,hmac:d,pending:h,ready:f}=this;if(d&&c){await f;const m=nt(h,0,h.length-Dt),u=nt(h,h.length-Dt);let g=new Uint8Array;if(m.length){const A=ji(yt,m);d.update(A);const p=c.update(A);g=zi(yt,p)}if(l){const A=nt(zi(yt,d.digest()),0,Dt);for(let p=0;p<Dt;p++)if(A[p]!=u[p])throw new Error(Ir)}r.enqueue(g)}}})}}class vg extends TransformStream{constructor({password:e,rawPassword:t,encryptionStrength:n}){let s;super({start(){Object.assign(this,{ready:new Promise(o=>this.resolveReady=o),password:Dr(e,t),strength:n-1,pending:new Uint8Array})},async transform(o,r){const l=this,{password:c,strength:d,resolveReady:h,ready:f}=l;let m=new Uint8Array;c?(m=await wg(l,d,c),h()):await f;const u=new Uint8Array(m.length+o.length-o.length%pi);u.set(m,0),r.enqueue(Pr(l,o,u,m.length,0))},async flush(o){const{ctr:r,hmac:l,pending:c,ready:d}=this;if(l&&r){await d;let h=new Uint8Array;if(c.length){const f=r.update(ji(yt,c));l.update(f),h=zi(yt,f)}s.signature=zi(yt,l.digest()).slice(0,Dt),o.enqueue(go(h,s.signature))}}}),s=this}}function Pr(i,e,t,n,s,o){const{ctr:r,hmac:l,pending:c}=i,d=e.length-s;c.length&&(e=go(c,e),t=xg(t,d-d%pi));let h;for(h=0;h<=d-pi;h+=pi){const f=ji(yt,nt(e,h,h+pi));o&&l.update(f);const m=r.update(f);o||l.update(m),t.set(zi(yt,m),h+n)}return i.pending=nt(e,h),t}async function bg(i,e,t,n){const s=await _r(i,e,t,nt(n,0,Qi[e])),o=nt(n,Qi[e]);if(s[0]!=o[0]||s[1]!=o[1])throw new Error(wr)}async function wg(i,e,t){const n=Sr(new Uint8Array(Qi[e])),s=await _r(i,e,t,n);return go(n,s)}async function _r(i,e,t,n){i.password=null;const s=await Ig(hg,t,mg,!1,gg),o=await Sg(Object.assign({salt:n},mo),s,8*(Hi[e]*2+2)),r=new Uint8Array(o),l=ji(yt,nt(r,0,Hi[e])),c=ji(yt,nt(r,Hi[e],Hi[e]*2)),d=nt(r,Hi[e]*2);return Object.assign(i,{keys:{key:l,authentication:c,passwordVerification:d},ctr:new yg(new Ag(l),Array.from(pg)),hmac:new Eg(c)}),d}async function Ig(i,e,t,n,s){if(Br)try{return await Yi.importKey(i,e,t,n,s)}catch{return Br=!1,Jt.importKey(e)}else return Jt.importKey(e)}async function Sg(i,e,t){if(Tr)try{return await Yi.deriveBits(i,e,t)}catch{return Tr=!1,Jt.pbkdf2(e,i.salt,mo.iterations,t)}else return Jt.pbkdf2(e,i.salt,mo.iterations,t)}function Dr(i,e){return e===Ee?lg(i):e}function go(i,e){let t=i;return i.length+e.length&&(t=new Uint8Array(i.length+e.length),t.set(i,0),t.set(e,i.length)),t}function xg(i,e){if(e&&e>i.length){const t=i;i=new Uint8Array(e),i.set(t,0)}return i}function nt(i,e,t){return i.subarray(e,t)}function zi(i,e){return i.fromBits(e)}function ji(i,e){return i.toBits(e)}const Wi=12;class Mg extends TransformStream{constructor({password:e,passwordVerification:t,checkPasswordOnly:n}){super({start(){Object.assign(this,{password:e,passwordVerification:t}),Rr(this,e)},transform(s,o){const r=this;if(r.password){const l=kr(r,s.subarray(0,Wi));if(r.password=null,l.at(-1)!=r.passwordVerification)throw new Error(wr);s=s.subarray(Wi)}n?o.error(new Error(fo)):o.enqueue(kr(r,s))}})}}class Bg extends TransformStream{constructor({password:e,passwordVerification:t}){super({start(){Object.assign(this,{password:e,passwordVerification:t}),Rr(this,e)},transform(n,s){const o=this;let r,l;if(o.password){o.password=null;const c=Sr(new Uint8Array(Wi));c[Wi-1]=o.passwordVerification,r=new Uint8Array(n.length+c.length),r.set(Nr(o,c),0),l=Wi}else r=new Uint8Array(n.length),l=0;r.set(Nr(o,n),l),s.enqueue(r)}})}}function kr(i,e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=Fr(i)^e[n],po(i,t[n]);return t}function Nr(i,e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=Fr(i)^e[n],po(i,e[n]);return t}function Rr(i,e){const t=[305419896,591751049,878082192];Object.assign(i,{keys:t,crcKey0:new zn(t[0]),crcKey2:new zn(t[2])});for(let n=0;n<e.length;n++)po(i,e.charCodeAt(n))}function po(i,e){let[t,n,s]=i.keys;i.crcKey0.append([e]),t=~i.crcKey0.get(),n=Or(Math.imul(Or(n+Lr(t)),134775813)+1),i.crcKey2.append([n>>>24]),s=~i.crcKey2.get(),i.keys=[t,n,s]}function Fr(i){const e=i.keys[2]|2;return Lr(Math.imul(e,e^1)>>>8)}function Lr(i){return i&255}function Or(i){return i&4294967295}const Gr="Invalid uncompressed size",Tg="deflate-raw",Pg="deflate64-raw";class _g extends TransformStream{constructor(e,{chunkSize:t,CompressionStreamZlib:n,CompressionStream:s}){super({});const{compressed:o,encrypted:r,useCompressionStream:l,zipCrypto:c,signed:d,level:h}=e,f=this;let m,u,g=super.readable;(!r||c)&&d&&(m=new Er,g=Et(g,m)),o&&(g=Vr(g,l,{level:h,chunkSize:t},s,n,s)),r&&(c?g=Et(g,new Bg(e)):(u=new vg(e),g=Et(g,u))),Ur(f,g,()=>{let A;r&&!c&&(A=u.signature),(!r||c)&&d&&(A=new DataView(m.value.buffer).getUint32(0)),f.signature=A})}}class Dg extends TransformStream{constructor(e,{chunkSize:t,DecompressionStreamZlib:n,DecompressionStream:s}){super({});const{zipCrypto:o,encrypted:r,signed:l,signature:c,compressed:d,useCompressionStream:h,deflate64:f}=e;let m,u,g=super.readable;r&&(o?g=Et(g,new Mg(e)):(u=new Cg(e),g=Et(g,u))),d&&(g=Vr(g,h,{chunkSize:t,deflate64:f},s,n,s)),(!r||o)&&l&&(m=new Er,g=Et(g,m)),Ur(this,g,()=>{if((!r||o)&&l){const A=new DataView(m.value.buffer);if(c!=A.getUint32(0,!1))throw new Error(Ir)}})}}function Ur(i,e,t){e=Et(e,new TransformStream({flush:t})),Object.defineProperty(i,"readable",{get(){return e}})}function Vr(i,e,t,n,s,o){const r=e&&n?n:s||o,l=t.deflate64?Pg:Tg;try{i=Et(i,new r(l,t))}catch(c){if(e)if(s)i=Et(i,new s(l,t));else if(o)i=Et(i,new o(l,t));else throw c;else throw c}return i}function Et(i,e){return i.pipeThrough(e)}const kg="message",Ng="start",Rg="pull",Qr="data",Fg="ack",Hr="close",Lg="deflate",Yr="inflate";class Og extends TransformStream{constructor(e,t){super({});const n=this,{codecType:s}=e;let o;s.startsWith(Lg)?o=_g:s.startsWith(Yr)&&(o=Dg),n.outputSize=0;let r=0;const l=new o(e,t),c=super.readable,d=new TransformStream({transform(f,m){f&&f.length&&(r+=f.length,m.enqueue(f))},flush(){Object.assign(n,{inputSize:r})}}),h=new TransformStream({transform(f,m){if(f&&f.length&&(m.enqueue(f),n.outputSize+=f.length,e.outputSize!==Ee&&n.outputSize>e.outputSize))throw new Error(Gr)},flush(){const{signature:f}=l;Object.assign(n,{signature:f,inputSize:r})}});Object.defineProperty(n,"readable",{get(){return c.pipeThrough(d).pipeThrough(l).pipeThrough(h)}})}}class Gg extends TransformStream{constructor(e){let t;super({transform:n,flush(s){t&&t.length&&s.enqueue(t)}});function n(s,o){if(t){const r=new Uint8Array(t.length+s.length);r.set(t),r.set(s,t.length),s=r,t=null}s.length>e?(o.enqueue(s.slice(0,e)),n(s.slice(e),o)):t=s}}}let zr=typeof Worker!=_t,jr=()=>{};function Ug({initModule:i}){jr=i}class Ao{constructor(e,{readable:t,writable:n},{options:s,config:o,streamOptions:r,useWebWorkers:l,transferStreams:c,workerURI:d},h){const{signal:f}=r;return Object.assign(e,{busy:!0,readable:t.pipeThrough(new Gg(o.chunkSize)).pipeThrough(new Vg(r),{signal:f}),writable:n,options:Object.assign({},s),workerURI:d,transferStreams:c,terminate(){return new Promise(m=>{const{worker:u,busy:g}=e;u?(g?e.resolveTerminated=m:(u.terminate(),m()),e.interface=null):m()})},onTaskFinished(){const{resolveTerminated:m}=e;m&&(e.resolveTerminated=null,e.terminated=!0,e.worker.terminate(),m()),e.busy=!1,h(e)}}),(l&&zr?Qg:Wr)(e,o)}}class Vg extends TransformStream{constructor({onstart:e,onprogress:t,size:n,onend:s}){let o=0;super({async start(){e&&await yo(e,n)},async transform(r,l){o+=r.length,t&&await yo(t,o,n),l.enqueue(r)},async flush(){s&&await yo(s,o)}})}}async function yo(i,...e){try{await i(...e)}catch{}}function Wr(i,e){return{run:()=>Hg(i,e)}}function Qg(i,e){const{baseURI:t,chunkSize:n}=e;let{wasmURI:s}=e;if(!i.interface){typeof s==Xt&&(s=s());let o;try{o=jg(i.workerURI,t,i)}catch{return zr=!1,Wr(i,e)}Object.assign(i,{worker:o,interface:{run:()=>Yg(i,{chunkSize:n,wasmURI:s,baseURI:t})}})}return i.interface}async function Hg({options:i,readable:e,writable:t,onTaskFinished:n},s){let o;try{if(!i.useCompressionStream)try{await jr(s)}catch{i.useCompressionStream=!0}o=new Og(i,s),await e.pipeThrough(o).pipeTo(t,{preventClose:!0,preventAbort:!0});const{signature:r,inputSize:l,outputSize:c}=o;return{signature:r,inputSize:l,outputSize:c}}catch(r){throw o&&(r.outputSize=o.outputSize),r}finally{n()}}async function Yg(i,e){let t,n;const s=new Promise((f,m)=>{t=f,n=m});Object.assign(i,{reader:null,writer:null,resolveResult:t,rejectResult:n,result:s});const{readable:o,options:r}=i,{writable:l,closed:c}=zg(i.writable),d=$n({type:Ng,options:r,config:e,readable:o,writable:l},i);d||Object.assign(i,{reader:o.getReader(),writer:l.getWriter()});const h=await s;return d||await l.getWriter().close(),await c,h}function zg(i){let e;const t=new Promise(s=>e=s);return{writable:new WritableStream({async write(s){const o=i.getWriter();await o.ready,await o.write(s),o.releaseLock()},close(){e()},abort(s){return i.getWriter().abort(s)}}),closed:t}}let $r=!0;function jg(i,e,t){const n={type:"module"};let s,o;if(typeof i==Xt&&(i=i()),i.startsWith("data:")||i.startsWith("blob:"))try{o=new Worker(i)}catch{o=new Worker(i,n)}else{try{s=new URL(i,e)}catch{s=i}o=new Worker(s,n)}return o.addEventListener(kg,r=>Wg(r,t)),o}function $n(i,{worker:e,writer:t,onTaskFinished:n,transferStreams:s}){try{const{value:o,readable:r,writable:l}=i,c=[];if(o&&(i.value=o,c.push(i.value.buffer)),s&&$r?(r&&c.push(r),l&&c.push(l)):i.readable=i.writable=null,c.length)try{return e.postMessage(i,c),!0}catch{$r=!1,i.readable=i.writable=null,e.postMessage(i)}else e.postMessage(i)}catch(o){throw t&&t.releaseLock(),n(),o}}async function Wg({data:i},e){const{type:t,value:n,messageId:s,result:o,error:r}=i,{reader:l,writer:c,resolveResult:d,rejectResult:h,onTaskFinished:f}=e;try{if(r){const{message:u,stack:g,code:A,name:p,outputSize:y}=r,C=new Error(u);Object.assign(C,{stack:g,code:A,name:p,outputSize:y}),m(C)}else{if(t==Rg){const{value:u,done:g}=await l.read();$n({type:Qr,value:u,done:g,messageId:s},e)}t==Qr&&(await c.ready,await c.write(new Uint8Array(n)),$n({type:Fg,messageId:s},e)),t==Hr&&m(null,o)}}catch(u){$n({type:Hr,messageId:s},e),m(u)}function m(u,g){u?h(u):d(g),c&&c.releaseLock(),f()}}let Zt=[];const Eo=[];let Kr=0;async function $g(i,e){const{options:t,config:n}=e,{transferStreams:s,useWebWorkers:o,useCompressionStream:r,compressed:l,signed:c,encrypted:d}=t,{workerURI:h,maxWorkers:f}=n;e.transferStreams=s||s===Ee;const m=!l&&!c&&!d&&!e.transferStreams;return e.useWebWorkers=!m&&(o||o===Ee&&n.useWebWorkers),e.workerURI=e.useWebWorkers&&h?h:Ee,t.useCompressionStream=r||r===Ee&&n.useCompressionStream,(await u()).run();async function u(){const A=Zt.find(p=>!p.busy);if(A)return qr(A),new Ao(A,i,e,g);if(Zt.length<f){const p={indexWorker:Kr};return Kr++,Zt.push(p),new Ao(p,i,e,g)}else return new Promise(p=>Eo.push({resolve:p,stream:i,workerOptions:e}))}function g(A){if(Eo.length){const[{resolve:p,stream:y,workerOptions:C}]=Eo.splice(0,1);p(new Ao(A,y,C,g))}else A.worker?(qr(A),Kg(A,e)):Zt=Zt.filter(p=>p!=A)}}function Kg(i,e){const{config:t}=e,{terminateWorkerTimeout:n}=t;Number.isFinite(n)&&n>=0&&(i.terminated?i.terminated=!1:i.terminateTimeout=setTimeout(async()=>{Zt=Zt.filter(s=>s!=i);try{await i.terminate()}catch{}},n))}function qr(i){const{terminateTimeout:e}=i;e&&(clearTimeout(e),i.terminateTimeout=null)}const qg="Writer iterator completed too soon",Xg="Content-Type",Jg=64*1024,Xr="writable";class Co{constructor(){this.size=0}init(){this.initialized=!0}}class Jr extends Co{get readable(){const e=this,{chunkSize:t=Jg}=e,n=new ReadableStream({start(){this.chunkOffset=0},async pull(s){const{offset:o=0,size:r,diskNumberStart:l}=n,{chunkOffset:c}=this,d=r===Ee?t:Math.min(t,r-c),h=await Le(e,o+c,d,l);s.enqueue(h),c+t>r||r===Ee&&!h.length&&d?s.close():this.chunkOffset+=t}});return n}}class Kn extends Jr{constructor(e){super(),Object.assign(this,{blob:e,size:e.size})}async readUint8Array(e,t){const n=this,s=e+t;let r=await(e||s<n.size?n.blob.slice(e,s):n.blob).arrayBuffer();return r.byteLength>t&&(r=r.slice(e,s)),new Uint8Array(r)}}class Zg extends Co{constructor(e){super();const t=this,n=new TransformStream,s=[];e&&s.push([Xg,e]),Object.defineProperty(t,Xr,{get(){return n.writable}}),t.blob=new Response(n.readable,{headers:s}).blob()}getData(){return this.blob}}class ep extends Zg{constructor(e){super(e),Object.assign(this,{encoding:e,utf8:!e||e.toLowerCase()=="utf-8"})}async getData(){const{encoding:e,utf8:t}=this,n=await super.getData();if(n.text&&t)return n.text();{const s=new FileReader;return new Promise((o,r)=>{Object.assign(s,{onload:({target:l})=>o(l.result),onerror:()=>r(s.error)}),s.readAsText(n,e)})}}}class tp extends Jr{constructor(e){super(),this.readers=e}async init(){const e=this,{readers:t}=e;e.lastDiskNumber=0,e.lastDiskOffset=0,await Promise.all(t.map(async(n,s)=>{await n.init(),s!=t.length-1&&(e.lastDiskOffset+=n.size),e.size+=n.size})),super.init()}async readUint8Array(e,t,n=0){const s=this,{readers:o}=this;let r,l=n;l==-1&&(l=o.length-1);let c=e;for(;o[l]&&c>=o[l].size;)c-=o[l].size,l++;const d=o[l];if(d){const h=d.size;if(c+t<=h)r=await Le(d,c,t);else{const f=h-c;r=new Uint8Array(t);const m=await Le(d,c,f);r.set(m,0);const u=await s.readUint8Array(e+f,t-f,n);r.set(u,f),m.length+u.length<t&&(r=r.subarray(0,m.length+u.length))}}else r=new Uint8Array;return s.lastDiskNumber=Math.max(l,s.lastDiskNumber),r}}class Zr extends Co{constructor(e,t=4294967295){super();const n=this;Object.assign(n,{diskNumber:0,diskOffset:0,size:0,maxSize:t,availableSize:t});let s,o,r;const l=new WritableStream({async write(h){const{availableSize:f}=n;if(r)h.length>=f?(await c(h.subarray(0,f)),await d(),n.diskOffset+=s.size,n.diskNumber++,r=null,await this.write(h.subarray(f))):await c(h);else{const{value:m,done:u}=await e.next();if(u&&!m)throw new Error(qg);s=m,s.size=0,s.maxSize&&(n.maxSize=s.maxSize),n.availableSize=n.maxSize,await qn(s),o=m.writable,r=o.getWriter(),await this.write(h)}},async close(){await r.ready,await d()}});Object.defineProperty(n,Xr,{get(){return l}});async function c(h){const f=h.length;f&&(await r.ready,await r.write(h),s.size+=f,n.size+=f,n.availableSize-=f)}async function d(){await r.close()}}}class ip{constructor(e){return Array.isArray(e)&&(e=new tp(e)),e instanceof ReadableStream&&(e={readable:e}),e}}class np{constructor(e){return e.writable===Ee&&typeof e.next==Xt&&(e=new Zr(e)),e instanceof WritableStream&&(e={writable:e}),e.size===Ee&&(e.size=0),e instanceof Zr||Object.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}}async function qn(i,e){if(i.init&&!i.initialized)await i.init(e);else return Promise.resolve()}function Le(i,e,t,n){return i.readUint8Array(e,t,n)}const el="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(""),sp=el.length==256;function op(i){if(sp){let e="";for(let t=0;t<i.length;t++)e+=el[i[t]];return e}else return new TextDecoder().decode(i)}function Xn(i,e){return e&&e.trim().toLowerCase()=="cp437"?op(i):new TextDecoder(e).decode(i)}const tl="filename",il="rawFilename",nl="comment",sl="rawComment",ol="uncompressedSize",al="compressedSize",rl="offset",ll="diskNumberStart",vo="lastModDate",bo="rawLastModDate",cl="lastAccessDate",ap="rawLastAccessDate",dl="creationDate",hl="rawCreationDate",rp=[tl,il,ol,al,vo,bo,nl,sl,cl,dl,hl,rl,ll,"internalFileAttributes","externalFileAttributes","msdosAttributesRaw","msdosAttributes","msDosCompatible","zip64","encrypted","version","versionMadeBy","zipCrypto","directory","executable","compressionMethod","signature","extraField","extraFieldUnix","extraFieldInfoZip","uid","gid","unixMode","setuid","setgid","sticky","bitFlag","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"];class ul{constructor(e){rp.forEach(t=>this[t]=e[t])}}const lp="filenameEncoding",cp="commentEncoding",dp="decodeText",hp="extractPrependedData",up="extractAppendedData",fp="password",mp="rawPassword",gp="passThrough",pp="signal",Ap="checkPasswordOnly",yp="checkOverlappingEntryOnly",Ep="checkOverlappingEntry",Cp="checkSignature",vp="useWebWorkers",bp="useCompressionStream",wp="transferStreams",Ip="preventClose",wo="File format is not recognized",Sp="End of central directory not found",xp="End of Zip64 central directory locator not found",Mp="Central directory header not found",Bp="Local file header not found",Tp="Zip64 extra field not found",Pp="File contains encrypted entry",_p="Encryption method not supported",fl="Compression method not supported",ml="Split zip file",Dp="Overlapping entry found",gl="utf-8",kp="UTF8",pl="cp437",Np=[[ol,qt],[al,qt],[rl,qt],[ll,At]],Rp={[At]:{getValue:Ce,bytes:4},[qt]:{getValue:Ai,bytes:8}};class Io{constructor(e,t={}){Object.assign(this,{reader:new ip(e),options:t,config:og(),readRanges:[]})}async*getEntriesGenerator(e={}){const t=this;let{reader:n}=t;const{config:s}=t;if(await qn(n),(n.size===Ee||!n.readUint8Array)&&(n=new Kn(await new Response(n.readable).blob()),await qn(n)),n.size<gi)throw new Error(wo);n.chunkSize=ag(s);const o=await Qp(n,Tm,n.size,gi,At*16);if(!o){const w=await Le(n,0,4),D=ve(w);throw Ce(D)==lr?new Error(ml):new Error(Sp)}const r=ve(o);let l=Ce(r,12),c=Ce(r,16);const d=o.offset,h=Fe(r,20),f=d+gi+h;let m=Fe(r,4);const u=n.lastDiskNumber||0;let g=Fe(r,6),A=Fe(r,8),p=0,y=0;if(c==qt||l==qt||A==At||g==At){const w=await Le(n,o.offset-ro,ro),D=ve(w);if(Ce(D,0)==Pm){c=Ai(D,8);let F=await Le(n,c,lo,-1),U=ve(F);const R=o.offset-ro-lo;if(Ce(U,0)!=dr&&c!=R){const b=c;c=R,c>b&&(p=c-b),F=await Le(n,c,lo,-1),U=ve(F)}if(Ce(U,0)!=dr)throw new Error(xp);m==At&&(m=Ce(U,16)),g==At&&(g=Ce(U,20)),A==At&&(A=Ai(U,32)),l==qt&&(l=Ai(U,40)),c-=l}}if(c>=n.size&&(p=n.size-c-l-gi,c=n.size-l-gi),u!=m)throw new Error(ml);if(c<0)throw new Error(wo);let C=0,I=await Le(n,c,l,g),P=ve(I);if(l){const w=o.offset-l;if(Ce(P,C)!=cr&&c!=w){const D=c;c=w,c>D&&(p+=c-D),I=await Le(n,c,l,g),P=ve(I)}}const k=o.offset-c-(n.lastDiskOffset||0);if(l!=k&&k>=0&&(l=k,I=await Le(n,c,l,g),P=ve(I)),c<0||c>=n.size)throw new Error(wo);const M=Oe(t,e,lp),B=Oe(t,e,cp);for(let w=0;w<A;w++){const D=new Fp(n,s,t.options);if(Ce(P,C)!=cr)throw new Error(Mp);Al(D,P,C+6);const F=!!D.bitFlag.languageEncodingFlag,U=C+46,R=U+D.filenameLength,b=R+D.extraFieldLength,v=Fe(P,C+4),x=v>>8==0,N=v>>8==3,O=I.subarray(U,R),Q=Fe(P,C+32),L=b+Q,T=I.subarray(b,L),S=F,G=F,Y=Ce(P,C+38),q=Y&ao,W={readOnly:!!(q&zm),hidden:!!(q&jm),system:!!(q&Wm),directory:!!(q&Ym),archive:!!(q&$m)},re=Ce(P,C+42)+p,ae=Oe(t,e,dp)||Xn,de=S?gl:M||pl,he=G?gl:B||pl;let ge=ae(O,de);ge===Ee&&(ge=Xn(O,de));let De=ae(T,he);De===Ee&&(De=Xn(T,he)),Object.assign(D,{versionMadeBy:v,msDosCompatible:x,compressedSize:0,uncompressedSize:0,commentLength:Q,offset:re,diskNumberStart:Fe(P,C+34),internalFileAttributes:Fe(P,C+36),externalFileAttributes:Y,msdosAttributesRaw:q,msdosAttributes:W,rawFilename:O,filenameUTF8:S,commentUTF8:G,rawExtraField:I.subarray(R,b),rawComment:T,filename:ge,comment:De}),y=Math.max(re,y),yl(D,D,P,C+6);const Re=D.externalFileAttributes>>16&At;D.unixMode===Ee&&(Re&(Km|ho|co))!=0&&(D.unixMode=Re);const We=!!(D.unixMode&qm),Ve=!!(D.unixMode&Xm),et=!!(D.unixMode&Jm),$=D.unixMode!==Ee?(D.unixMode&ho)!=0:N&&(Re&ho)!=0,z=D.unixMode!==Ee&&(D.unixMode&gr)==co,ee=(Re&gr)==co;Object.assign(D,{setuid:We,setgid:Ve,sticky:et,unixExternalUpper:Re,internalFileAttribute:D.internalFileAttributes,externalFileAttribute:D.externalFileAttributes,executable:$,directory:z||ee||x&&W.directory||ge.endsWith(Zm)&&!D.uncompressedSize,zipCrypto:D.encrypted&&!D.extraFieldAES});const ke=new ul(D);ke.getData=(tt,Ri)=>D.getData(tt,ke,t.readRanges,Ri),ke.arrayBuffer=async tt=>{const Ri=new TransformStream,[zt]=await Promise.all([new Response(Ri.readable).arrayBuffer(),D.getData(Ri,ke,t.readRanges,tt)]);return zt},C=L;const{onprogress:rt}=e;if(rt)try{await rt(w+1,A,new ul(D))}catch{}yield ke}const _=Oe(t,e,hp),E=Oe(t,e,up);return _&&(t.prependedData=y>0?await Le(n,0,y):new Uint8Array),t.comment=h?await Le(n,d+gi,h):new Uint8Array,E&&(t.appendedData=f<n.size?await Le(n,f,n.size-f):new Uint8Array),!0}async getEntries(e={}){const t=[];for await(const n of this.getEntriesGenerator(e))t.push(n);return t}async close(){}}class Fp{constructor(e,t,n){Object.assign(this,{reader:e,config:t,options:n})}async getData(e,t,n,s={}){const o=this,{reader:r,offset:l,diskNumberStart:c,extraFieldAES:d,extraFieldZip64:h,compressionMethod:f,config:m,bitFlag:u,signature:g,rawLastModDate:A,uncompressedSize:p,compressedSize:y}=o,{dataDescriptor:C}=u,I=t.localDirectory={},P=await Le(r,l,uo,c),k=ve(P);let M=Oe(o,s,fp),B=Oe(o,s,mp);const _=Oe(o,s,gp);if(M=M&&M.length&&M,B=B&&B.length&&B,d&&d.originalCompressionMethod!=xm)throw new Error(fl);if(f!=Sm&&f!=Im&&f!=rr&&!_)throw new Error(fl);if(Ce(k,0)!=Mm)throw new Error(Bp);Al(I,k,4);const{extraFieldLength:E,filenameLength:w,lastAccessDate:D,creationDate:F}=I;I.rawExtraField=E?await Le(r,l+uo+w,E,c):new Uint8Array,yl(o,I,k,4,!0),Object.assign(t,{lastAccessDate:D,creationDate:F});const U=o.encrypted&&I.encrypted&&!_,R=U&&!d;if(_||(t.zipCrypto=R),U){if(!R&&d.strength===Ee)throw new Error(_p);if(!M&&!B)throw new Error(Pp)}const b=l+uo+w+E,v=y,x=r.readable;Object.assign(x,{diskNumberStart:c,offset:b,size:v});const N=Oe(o,s,pp),O=Oe(o,s,Ap);let Q=Oe(o,s,Ep);const L=Oe(o,s,yp);L&&(Q=!0);const{onstart:T,onprogress:S,onend:G}=s,Y=f==rr;let q=Oe(o,s,bp);Y&&(q=!1);const W={options:{codecType:Yr,password:M,rawPassword:B,zipCrypto:R,encryptionStrength:d&&d.strength,signed:Oe(o,s,Cp)&&!_,passwordVerification:R&&(C?A>>>8&ao:g>>>24&ao),outputSize:_?y:p,signature:g,compressed:f!=0&&!_,encrypted:o.encrypted&&!_,useWebWorkers:Oe(o,s,vp),useCompressionStream:q,transferStreams:Oe(o,s,wp),deflate64:Y,checkPasswordOnly:O},config:m,streamOptions:{signal:N,size:v,onstart:T,onprogress:S,onend:G}};Q&&await Vp({reader:r,fileEntry:t,offset:l,diskNumberStart:c,signature:g,compressedSize:y,uncompressedSize:p,dataOffset:b,dataDescriptor:C||I.bitFlag.dataDescriptor,extraFieldZip64:h||I.extraFieldZip64,readRanges:n});let re;try{if(!L){O&&(e=new WritableStream),e=new np(e),await qn(e,_?y:p),{writable:re}=e;const{outputSize:ae}=await $g({readable:x,writable:re},W);if(e.size+=ae,ae!=(_?y:p))throw new Error(Gr)}}catch(ae){if(ae.outputSize!==Ee&&(e.size+=ae.outputSize),!O||ae.message!=fo)throw ae}finally{!Oe(o,s,Ip)&&re&&!re.locked&&await re.getWriter().close()}return O||L?Ee:e.getData?e.getData():re}}function Al(i,e,t){const n=i.rawBitFlag=Fe(e,t+2),s=(n&ur)==ur,o=Ce(e,t+6);Object.assign(i,{encrypted:s,version:Fe(e,t),bitFlag:{level:(n&Hm)>>1,dataDescriptor:(n&fr)==fr,languageEncodingFlag:(n&mr)==mr},rawLastModDate:o,lastModDate:Hp(o),filenameLength:Fe(e,t+22),extraFieldLength:Fe(e,t+24)})}function yl(i,e,t,n,s){const{rawExtraField:o}=e,r=e.extraField=new Map,l=ve(new Uint8Array(o));let c=0;try{for(;c<o.length;){const C=Fe(l,c),I=Fe(l,c+2);r.set(C,{type:C,data:o.slice(c+4,c+4+I)}),c+=4+I}}catch{}const d=Fe(t,n+4);Object.assign(e,{signature:Ce(t,n+eg),compressedSize:Ce(t,n+tg),uncompressedSize:Ce(t,n+ig)});const h=r.get(km);h&&(Lp(h,e),e.extraFieldZip64=h);const f=r.get(Om);f&&(El(f,tl,il,e,i),e.extraFieldUnicodePath=f);const m=r.get(Gm);m&&(El(m,nl,sl,e,i),e.extraFieldUnicodeComment=m);const u=r.get(Nm);u?(Op(u,e,d),e.extraFieldAES=u):e.compressionMethod=d;const g=r.get(Rm);g&&(Gp(g,e),e.extraFieldNTFS=g);const A=r.get(Qm);if(A)Cl(A,e,!1),e.extraFieldUnix=A;else{const C=r.get(Vm);C&&(Cl(C,e,!0),e.extraFieldInfoZip=C)}const p=r.get(Lm);p&&(Up(p,e,s),e.extraFieldExtendedTimestamp=p);const y=r.get(Um);y&&(e.extraFieldUSDZ=y)}function Lp(i,e){e.zip64=!0;const t=ve(i.data),n=Np.filter(([s,o])=>e[s]==o);for(let s=0,o=0;s<n.length;s++){const[r,l]=n[s];if(e[r]==l){const c=Rp[l];e[r]=i[r]=c.getValue(t,o),o+=c.bytes}else if(i[r])throw new Error(Tp)}}function El(i,e,t,n,s){const o=ve(i.data),r=new zn;r.append(s[t]);const l=ve(new Uint8Array(4));l.setUint32(0,r.get(),!0);const c=Ce(o,1);Object.assign(i,{version:kt(o,0),[e]:Xn(i.data.subarray(5)),valid:!s.bitFlag.languageEncodingFlag&&c==Ce(l,0)}),i.valid&&(n[e]=i[e],n[e+kp]=!0)}function Op(i,e,t){const n=ve(i.data),s=kt(n,4);Object.assign(i,{vendorVersion:kt(n,0),vendorId:kt(n,2),strength:s,originalCompressionMethod:t,compressionMethod:Fe(n,5)}),e.compressionMethod=i.compressionMethod}function Gp(i,e){const t=ve(i.data);let n=4,s;try{for(;n<i.data.length&&!s;){const o=Fe(t,n),r=Fe(t,n+2);o==Fm&&(s=i.data.slice(n+4,n+4+r)),n+=4+r}}catch{}try{if(s&&s.length==24){const o=ve(s),r=o.getBigUint64(0,!0),l=o.getBigUint64(8,!0),c=o.getBigUint64(16,!0);Object.assign(i,{rawLastModDate:r,rawLastAccessDate:l,rawCreationDate:c});const d=So(r),h=So(l),f=So(c),m={lastModDate:d,lastAccessDate:h,creationDate:f};Object.assign(i,m),Object.assign(e,m)}}catch{}}function Cl(i,e,t){try{const n=ve(new Uint8Array(i.data));let s=0;const o=kt(n,s++),r=kt(n,s++),l=i.data.subarray(s,s+r);s+=r;const c=vl(l),d=kt(n,s++),h=i.data.subarray(s,s+d);s+=d;const f=vl(h);let m=Ee;if(!t&&s+2<=i.data.length){const u=i.data;m=new DataView(u.buffer,u.byteOffset+s,2).getUint16(0,!0)}Object.assign(i,{version:o,uid:c,gid:f,unixMode:m}),c!==Ee&&(e.uid=c),f!==Ee&&(e.gid=f),m!==Ee&&(e.unixMode=m)}catch{}}function vl(i){const e=new Uint8Array(4);return e.set(i,0),new DataView(e.buffer,e.byteOffset,4).getUint32(0,!0)}function Up(i,e,t){const n=ve(i.data),s=kt(n,0),o=[],r=[];t?((s&1)==1&&(o.push(vo),r.push(bo)),(s&2)==2&&(o.push(cl),r.push(ap)),(s&4)==4&&(o.push(dl),r.push(hl))):i.data.length>=5&&(o.push(vo),r.push(bo));let l=1;o.forEach((c,d)=>{if(i.data.length>=l+4){const h=Ce(n,l);e[c]=i[c]=new Date(h*1e3);const f=r[d];i[f]=h}l+=4})}async function Vp({reader:i,fileEntry:e,offset:t,diskNumberStart:n,signature:s,compressedSize:o,uncompressedSize:r,dataOffset:l,dataDescriptor:c,extraFieldZip64:d,readRanges:h}){let f=0;if(n)for(let g=0;g<n;g++){const A=i.readers[g];f+=A.size}let m=0;if(c&&(d?m=Dm:m=_m),m){const g=await Le(i,l+o,m+hr,n);if(Ce(ve(g),0)==Bm){const p=Ce(ve(g),4);let y,C;d?(y=Ai(ve(g),8),C=Ai(ve(g),16)):(y=Ce(ve(g),8),C=Ce(ve(g),12)),(e.encrypted&&!e.zipCrypto||p==s)&&y==o&&C==r&&(m+=hr)}}const u={start:f+t,end:f+l+o+m,fileEntry:e};for(const g of h)if(g.fileEntry!=e&&u.start>=g.start&&u.start<g.end){const A=new Error(Dp);throw A.overlappingEntry=g.fileEntry,A}h.push(u)}async function Qp(i,e,t,n,s){const o=new Uint8Array(4),r=ve(o);Yp(r,0,e);const l=n+s;return await c(n)||await c(Math.min(l,t));async function c(d){const h=t-d,f=await Le(i,h,d);for(let m=f.length-n;m>=0;m--)if(f[m]==o[0]&&f[m+1]==o[1]&&f[m+2]==o[2]&&f[m+3]==o[3])return{offset:h+m,buffer:f.slice(m,m+n).buffer}}}function Oe(i,e,t){return e[t]===Ee?i.options[t]:e[t]}function Hp(i){const e=(i&4294901760)>>16,t=i&At;try{return new Date(1980+((e&65024)>>9),((e&480)>>5)-1,e&31,(t&63488)>>11,(t&2016)>>5,(t&31)*2,0)}catch{}}function So(i){return new Date(Number(i/BigInt(1e4)-BigInt(116444736e5)))}function kt(i,e){return i.getUint8(e)}function Fe(i,e){return i.getUint16(e,!0)}function Ce(i,e){return i.getUint32(e,!0)}function Ai(i,e){return Number(i.getBigUint64(e,!0))}function Yp(i,e,t){i.setUint32(e,t,!0)}function ve(i){return new DataView(i.buffer)}try{Yn({baseURI:typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:we&&we.tagName.toUpperCase()==="SCRIPT"&&we.src||new URL("leiting-bim.umd.js",document.baseURI).href})}catch{}const Je="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function zp(i){let e;i({wasmURI:()=>(e||(e="data:application/wasm;base64,"+(t=>{t=(r=>{const l=(r=(r+"").replace(/[^A-Za-z0-9+/=]/g,"")).length,c=[];for(let d=0;l>d;d+=4){const h=Je.indexOf(r[d])<<18|Je.indexOf(r[d+1])<<12|(63&Je.indexOf(r[d+2]))<<6|63&Je.indexOf(r[d+3]);c.push(h>>16&255),r[d+2]!=="="&&c.push(h>>8&255),r[d+3]!=="="&&c.push(255&h)}return new Uint8Array(c)})(t);let n=new Uint8Array(1024),s=0;for(let r=0;r<t.length;){const l=t[r++];if(128&l){const c=3+(127&l),d=t[r++]<<8|t[r++],h=s-d;o(s+c);for(let f=0;c>f;f++)n[s++]=n[h+f]}else{const c=l;o(s+c);for(let d=0;c>d&&r<t.length;d++)n[s++]=t[r++]}}return(r=>{let l="";const c=r.length;let d=0;for(;c>d+2;d+=3){const f=r[d]<<16|r[d+1]<<8|r[d+2];l+=Je[f>>18&63]+Je[f>>12&63]+Je[f>>6&63]+Je[63&f]}const h=c-d;if(h===1){const f=r[d]<<16;l+=Je[f>>18&63]+Je[f>>12&63]+"=="}else if(h===2){const f=r[d]<<16|r[d+1]<<8;l+=Je[f>>18&63]+Je[f>>12&63]+Je[f>>6&63]+"="}return l})(new Uint8Array(n.buffer.slice(0,s)));function o(r){if(n.length<r){let l=2*n.length;for(;r>l;)l*=2;const c=new Uint8Array(l);c.set(n.subarray(0,s)),n=c}}})("FQBhc20BAAAAAUULYAF/AX9gAn9/AIEABYAACwIDf4IABwEBgAARAQaAAAuDAA6BABUDAGAAgAADgAANAQSBABUDAGAHgwAegAAfEgNCQQcABAEABAgIAAIABQIKAIAAB4EAAwEFgQAHAgICgQAHEAEDAAUGAAMDBQQJBAQJAQaAAAEeAAIEAwIEAgIBBAcDAwQFAXABDQ0FBgEBggKCAgYIgACYIkHQ1QQLB4oEHAZtZW1vcnkCAAxpbmZsYXRlOV9uZXcABw2GAA8HaW5pdAAIEYoAEAdfcmF3AAoQhgAUCXByb2Nlc3MAC4cARgZlbmQADhaGAA8QbGFzdF9jb25zdW1lZAARC4QAGYMAbYUANoMAbAEShQBYhwBrARSFAH+DABMHZ3ppcAAVD4UAFIUAfgEWhgBWgQB9AhgVhQAOjQB8AmRliQB8hQAOggB8AhoQiQAPggB8AhsRigATggB8AhwPhQAUhQB8AR2GAFaBAHwJHwRmcmVlAAIVhQAVjACDCgZtYWxsb2MAAQuCAFUKaWFsaXplAAAZX4AADxZkaXJlY3RfZnVuY3Rpb25fdGFibGUBgAAcG2Vtc2NyaXB0ZW5fc3RhY2tfcmVzdG9yZQAFHI4AGwJnZYAAbw51cnJlbnQABiJfX2N4YYAAWwRjcmVtgAASBl9leGNlcIIAXQZyZWZjb3WAACUtPQkSAQBBAQsMACEiDA8XGR4+NTg7CqHlAkECAAu/JwELfyMAQRBrIgokAAJAjwACEiAAQfQBTQRAQaQnKAIAIgNBEIAAEgYLakH4A3GBAAkQSRsiBkEDdiIAdiIBQQNxBIEAMgYBQX9zQQGAAB8GaiICQQN0gAAZDMwn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UgDKEgQBrAYCBCC8BBIMADIA/SAoBABAMAEGRIQv/gCUfgMDAgIKxBQgJCQoKgEk3gAABAQ2AAAEBDoAAAQEPgAABARCEAAEBEYQAAQEShAABAROEAAEBFIwAAQEVjAABARaMAAEBF4wAAQEYnAABARmcAAEBGpwAAQEbmwABARyBffsEBAQFBYHB1QEHgAABAQiEAAGAXSqCAAEBCowAAYAnsooAAYEBMJkAAYEBTJkAAYEBaLkAAYEBpLkAAYIDdYABzoUBvI0BqJ0BkLwBgAIbHLwAAQEdvAABgA9PgH05A9AqAQ==")),e)})}let Se,yi,Ze,$i;function jp(i){if(Se=i,{malloc:yi,free:Ze,memory:$i}=Se,typeof yi!="function"||typeof Ze!="function"||!$i)throw Se=yi=Ze=$i=null,new Error("Invalid WASM module")}function bl(i,e,t={}){const n=typeof t.level=="number"?t.level:-1,s=typeof t.outBuffer=="number"?t.outBuffer:64*1024,o=typeof t.inBufferSize=="number"?t.inBufferSize:64*1024;return new TransformStream({start(){let r;if(this.out=yi(s),this.in=yi(o),this.inBufferSize=o,this._scratch=new Uint8Array(s),i?(this._process=Se.deflate_process,this._last_consumed=Se.deflate_last_consumed,this._end=Se.deflate_end,this.streamHandle=Se.deflate_new(),e==="gzip"?r=Se.deflate_init_gzip(this.streamHandle,n):e==="deflate-raw"?r=Se.deflate_init_raw(this.streamHandle,n):r=Se.deflate_init(this.streamHandle,n)):e==="deflate64-raw"?(this._process=Se.inflate9_process,this._last_consumed=Se.inflate9_last_consumed,this._end=Se.inflate9_end,this.streamHandle=Se.inflate9_new(),r=Se.inflate9_init_raw(this.streamHandle)):(this._process=Se.inflate_process,this._last_consumed=Se.inflate_last_consumed,this._end=Se.inflate_end,this.streamHandle=Se.inflate_new(),e==="deflate-raw"?r=Se.inflate_init_raw(this.streamHandle):e==="gzip"?r=Se.inflate_init_gzip(this.streamHandle):r=Se.inflate_init(this.streamHandle)),r!==0)throw new Error("init failed:"+r)},transform(r,l){try{const c=r,d=new Uint8Array($i.buffer),h=this._process,f=this._last_consumed,m=this.out,u=this._scratch;let g=0;for(;g<c.length;){const A=Math.min(c.length-g,32768);(!this.in||this.inBufferSize<A)&&(this.in&&Ze&&Ze(this.in),this.in=yi(A),this.inBufferSize=A),d.set(c.subarray(g,g+A),this.in);const p=h(this.streamHandle,this.in,A,m,s,0),y=p&16777215;if(y&&(u.set(d.subarray(m,m+y),0),l.enqueue(u.slice(0,y))),!i){const I=p>>24&255,P=I&128?I-256:I;if(P<0)throw new Error("process error:"+P)}const C=f(this.streamHandle);if(C===0)break;g+=C}}catch(c){this._end&&this.streamHandle&&this._end(this.streamHandle),this.in&&Ze&&Ze(this.in),this.out&&Ze&&Ze(this.out),l.error(c)}},flush(r){try{const l=new Uint8Array($i.buffer),c=this._process,d=this.out,h=this._scratch;for(;;){const f=c(this.streamHandle,0,0,d,s,4),m=f&16777215,u=f>>24&255;if(!i){const g=u&128?u-256:u;if(g<0)throw new Error("process error:"+g)}if(m&&(h.set(l.subarray(d,d+m),0),r.enqueue(h.slice(0,m))),u===1||m===0)break}}catch(l){r.error(l)}finally{if(this._end&&this.streamHandle){const l=this._end(this.streamHandle);l!==0&&r.error(new Error("end error:"+l))}this.in&&Ze&&Ze(this.in),this.out&&Ze&&Ze(this.out)}}})}class Wp{constructor(e="deflate",t){return bl(!0,e,t)}}class $p{constructor(e="deflate",t){return bl(!1,e,t)}}let wl=!1;async function Kp(i,{baseURI:e}){if(!wl){let t,n;try{try{n=new URL(i,e)}catch{}t=await(await fetch(n)).arrayBuffer()}catch(o){if(i.startsWith("data:application/wasm;base64,"))t=qp(i);else throw o}const s=await WebAssembly.instantiate(t);jp(s.instance.exports),wl=!0}}function qp(i){const e=i.split(",")[1],t=atob(e),n=t.length,s=new Uint8Array(n);for(let o=0;o<n;++o)s[o]=t.charCodeAt(o);return s.buffer}let xo;zp(Yn),Ug({initModule:i=>{if(!xo){let{wasmURI:e}=i;typeof e==Xt&&(e=e()),xo=Kp(e,i)}return xo}}),Yn({CompressionStreamZlib:Wp,DecompressionStreamZlib:$p});const Mo={application:{"andrew-inset":"ez",annodex:"anx","atom+xml":"atom","atomcat+xml":"atomcat","atomserv+xml":"atomsrv",bbolin:"lin","cu-seeme":"cu","davmount+xml":"davmount",dsptype:"tsp",ecmascript:["es","ecma"],futuresplash:"spl",hta:"hta","java-archive":"jar","java-serialized-object":"ser","java-vm":"class",m3g:"m3g","mac-binhex40":"hqx",mathematica:["nb","ma","mb"],msaccess:"mdb",msword:["doc","dot","wiz"],mxf:"mxf",oda:"oda",ogg:"ogx",pdf:"pdf","pgp-keys":"key","pgp-signature":["asc","sig"],"pics-rules":"prf",postscript:["ps","ai","eps","epsi","epsf","eps2","eps3"],rar:"rar","rdf+xml":"rdf","rss+xml":"rss",rtf:"rtf","xhtml+xml":["xhtml","xht"],xml:["xml","xsl","xsd","xpdl"],"xspf+xml":"xspf",zip:"zip","vnd.android.package-archive":"apk","vnd.cinderella":"cdy","vnd.google-earth.kml+xml":"kml","vnd.google-earth.kmz":"kmz","vnd.mozilla.xul+xml":"xul","vnd.ms-excel":["xls","xlb","xlt","xlm","xla","xlc","xlw"],"vnd.ms-pki.seccat":"cat","vnd.ms-pki.stl":"stl","vnd.ms-powerpoint":["ppt","pps","pot","ppa","pwz"],"vnd.oasis.opendocument.chart":"odc","vnd.oasis.opendocument.database":"odb","vnd.oasis.opendocument.formula":"odf","vnd.oasis.opendocument.graphics":"odg","vnd.oasis.opendocument.graphics-template":"otg","vnd.oasis.opendocument.image":"odi","vnd.oasis.opendocument.presentation":"odp","vnd.oasis.opendocument.presentation-template":"otp","vnd.oasis.opendocument.spreadsheet":"ods","vnd.oasis.opendocument.spreadsheet-template":"ots","vnd.oasis.opendocument.text":"odt","vnd.oasis.opendocument.text-master":["odm","otm"],"vnd.oasis.opendocument.text-template":"ott","vnd.oasis.opendocument.text-web":"oth","vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","vnd.openxmlformats-officedocument.spreadsheetml.template":"xltx","vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","vnd.openxmlformats-officedocument.presentationml.slideshow":"ppsx","vnd.openxmlformats-officedocument.presentationml.template":"potx","vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","vnd.openxmlformats-officedocument.wordprocessingml.template":"dotx","vnd.smaf":"mmf","vnd.stardivision.calc":"sdc","vnd.stardivision.chart":"sds","vnd.stardivision.draw":"sda","vnd.stardivision.impress":"sdd","vnd.stardivision.math":["sdf","smf"],"vnd.stardivision.writer":["sdw","vor"],"vnd.stardivision.writer-global":"sgl","vnd.sun.xml.calc":"sxc","vnd.sun.xml.calc.template":"stc","vnd.sun.xml.draw":"sxd","vnd.sun.xml.draw.template":"std","vnd.sun.xml.impress":"sxi","vnd.sun.xml.impress.template":"sti","vnd.sun.xml.math":"sxm","vnd.sun.xml.writer":"sxw","vnd.sun.xml.writer.global":"sxg","vnd.sun.xml.writer.template":"stw","vnd.symbian.install":["sis","sisx"],"vnd.visio":["vsd","vst","vss","vsw","vsdx","vssx","vstx","vssm","vstm"],"vnd.wap.wbxml":"wbxml","vnd.wap.wmlc":"wmlc","vnd.wap.wmlscriptc":"wmlsc","vnd.wordperfect":"wpd","vnd.wordperfect5.1":"wp5","x-123":"wk","x-7z-compressed":"7z","x-abiword":"abw","x-apple-diskimage":"dmg","x-bcpio":"bcpio","x-bittorrent":"torrent","x-cbr":["cbr","cba","cbt","cb7"],"x-cbz":"cbz","x-cdf":["cdf","cda"],"x-cdlink":"vcd","x-chess-pgn":"pgn","x-cpio":"cpio","x-csh":"csh","x-director":["dir","dxr","cst","cct","cxt","w3d","fgd","swa"],"x-dms":"dms","x-doom":"wad","x-dvi":"dvi","x-httpd-eruby":"rhtml","x-font":"pcf.Z","x-freemind":"mm","x-gnumeric":"gnumeric","x-go-sgf":"sgf","x-graphing-calculator":"gcf","x-gtar":["gtar","taz"],"x-hdf":"hdf","x-httpd-php":["phtml","pht","php"],"x-httpd-php-source":"phps","x-httpd-php3":"php3","x-httpd-php3-preprocessed":"php3p","x-httpd-php4":"php4","x-httpd-php5":"php5","x-ica":"ica","x-info":"info","x-internet-signup":["ins","isp"],"x-iphone":"iii","x-iso9660-image":"iso","x-java-jnlp-file":"jnlp","x-jmol":"jmz","x-killustrator":"kil","x-latex":"latex","x-lyx":"lyx","x-lzx":"lzx","x-maker":["frm","fb","fbdoc"],"x-ms-wmd":"wmd","x-msdos-program":["com","exe","bat","dll"],"x-netcdf":["nc"],"x-ns-proxy-autoconfig":["pac","dat"],"x-nwc":"nwc","x-object":"o","x-oz-application":"oza","x-pkcs7-certreqresp":"p7r","x-python-code":["pyc","pyo"],"x-qgis":["qgs","shp","shx"],"x-quicktimeplayer":"qtl","x-redhat-package-manager":["rpm","rpa"],"x-ruby":"rb","x-sh":"sh","x-shar":"shar","x-shockwave-flash":["swf","swfl"],"x-silverlight":"scr","x-stuffit":"sit","x-sv4cpio":"sv4cpio","x-sv4crc":"sv4crc","x-tar":"tar","x-tex-gf":"gf","x-tex-pk":"pk","x-texinfo":["texinfo","texi"],"x-trash":["~","%","bak","old","sik"],"x-ustar":"ustar","x-wais-source":"src","x-wingz":"wz","x-x509-ca-cert":["crt","der","cer"],"x-xcf":"xcf","x-xfig":"fig","x-xpinstall":"xpi",applixware:"aw","atomsvc+xml":"atomsvc","ccxml+xml":"ccxml","cdmi-capability":"cdmia","cdmi-container":"cdmic","cdmi-domain":"cdmid","cdmi-object":"cdmio","cdmi-queue":"cdmiq","docbook+xml":"dbk","dssc+der":"dssc","dssc+xml":"xdssc","emma+xml":"emma","epub+zip":"epub",exi:"exi","font-tdpfr":"pfr","gml+xml":"gml","gpx+xml":"gpx",gxf:"gxf",hyperstudio:"stk","inkml+xml":["ink","inkml"],ipfix:"ipfix","jsonml+json":"jsonml","lost+xml":"lostxml","mads+xml":"mads",marc:"mrc","marcxml+xml":"mrcx","mathml+xml":["mathml","mml"],mbox:"mbox","mediaservercontrol+xml":"mscml","metalink+xml":"metalink","metalink4+xml":"meta4","mets+xml":"mets","mods+xml":"mods",mp21:["m21","mp21"],mp4:"mp4s","oebps-package+xml":"opf","omdoc+xml":"omdoc",onenote:["onetoc","onetoc2","onetmp","onepkg"],oxps:"oxps","patch-ops-error+xml":"xer","pgp-encrypted":"pgp",pkcs10:"p10","pkcs7-mime":["p7m","p7c"],"pkcs7-signature":"p7s",pkcs8:"p8","pkix-attr-cert":"ac","pkix-crl":"crl","pkix-pkipath":"pkipath",pkixcmp:"pki","pls+xml":"pls","prs.cww":"cww","pskc+xml":"pskcxml","reginfo+xml":"rif","relax-ng-compact-syntax":"rnc","resource-lists+xml":"rl","resource-lists-diff+xml":"rld","rls-services+xml":"rs","rpki-ghostbusters":"gbr","rpki-manifest":"mft","rpki-roa":"roa","rsd+xml":"rsd","sbml+xml":"sbml","scvp-cv-request":"scq","scvp-cv-response":"scs","scvp-vp-request":"spq","scvp-vp-response":"spp",sdp:"sdp","set-payment-initiation":"setpay","set-registration-initiation":"setreg","shf+xml":"shf","sparql-query":"rq","sparql-results+xml":"srx",srgs:"gram","srgs+xml":"grxml","sru+xml":"sru","ssdl+xml":"ssdl","ssml+xml":"ssml","tei+xml":["tei","teicorpus"],"thraud+xml":"tfi","timestamped-data":"tsd","vnd.3gpp.pic-bw-large":"plb","vnd.3gpp.pic-bw-small":"psb","vnd.3gpp.pic-bw-var":"pvb","vnd.3gpp2.tcap":"tcap","vnd.3m.post-it-notes":"pwn","vnd.accpac.simply.aso":"aso","vnd.accpac.simply.imp":"imp","vnd.acucobol":"acu","vnd.acucorp":["atc","acutc"],"vnd.adobe.air-application-installer-package+zip":"air","vnd.adobe.formscentral.fcdt":"fcdt","vnd.adobe.fxp":["fxp","fxpl"],"vnd.adobe.xdp+xml":"xdp","vnd.adobe.xfdf":"xfdf","vnd.ahead.space":"ahead","vnd.airzip.filesecure.azf":"azf","vnd.airzip.filesecure.azs":"azs","vnd.amazon.ebook":"azw","vnd.americandynamics.acc":"acc","vnd.amiga.ami":"ami","vnd.anser-web-certificate-issue-initiation":"cii","vnd.anser-web-funds-transfer-initiation":"fti","vnd.antix.game-component":"atx","vnd.apple.installer+xml":"mpkg","vnd.apple.mpegurl":"m3u8","vnd.aristanetworks.swi":"swi","vnd.astraea-software.iota":"iota","vnd.audiograph":"aep","vnd.blueice.multipass":"mpm","vnd.bmi":"bmi","vnd.businessobjects":"rep","vnd.chemdraw+xml":"cdxml","vnd.chipnuts.karaoke-mmd":"mmd","vnd.claymore":"cla","vnd.cloanto.rp9":"rp9","vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"vnd.cluetrust.cartomobile-config":"c11amc","vnd.cluetrust.cartomobile-config-pkg":"c11amz","vnd.commonspace":"csp","vnd.contact.cmsg":"cdbcmsg","vnd.cosmocaller":"cmc","vnd.crick.clicker":"clkx","vnd.crick.clicker.keyboard":"clkk","vnd.crick.clicker.palette":"clkp","vnd.crick.clicker.template":"clkt","vnd.crick.clicker.wordbank":"clkw","vnd.criticaltools.wbs+xml":"wbs","vnd.ctc-posml":"pml","vnd.cups-ppd":"ppd","vnd.curl.car":"car","vnd.curl.pcurl":"pcurl","vnd.dart":"dart","vnd.data-vision.rdz":"rdz","vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"vnd.dece.ttml+xml":["uvt","uvvt"],"vnd.dece.unspecified":["uvx","uvvx"],"vnd.dece.zip":["uvz","uvvz"],"vnd.denovo.fcselayout-link":"fe_launch","vnd.dna":"dna","vnd.dolby.mlp":"mlp","vnd.dpgraph":"dpg","vnd.dreamfactory":"dfac","vnd.ds-keypoint":"kpxx","vnd.dvb.ait":"ait","vnd.dvb.service":"svc","vnd.dynageo":"geo","vnd.ecowin.chart":"mag","vnd.enliven":"nml","vnd.epson.esf":"esf","vnd.epson.msf":"msf","vnd.epson.quickanime":"qam","vnd.epson.salt":"slt","vnd.epson.ssf":"ssf","vnd.eszigno3+xml":["es3","et3"],"vnd.ezpix-album":"ez2","vnd.ezpix-package":"ez3","vnd.fdf":"fdf","vnd.fdsn.mseed":"mseed","vnd.fdsn.seed":["seed","dataless"],"vnd.flographit":"gph","vnd.fluxtime.clip":"ftc","vnd.framemaker":["fm","frame","maker","book"],"vnd.frogans.fnc":"fnc","vnd.frogans.ltf":"ltf","vnd.fsc.weblaunch":"fsc","vnd.fujitsu.oasys":"oas","vnd.fujitsu.oasys2":"oa2","vnd.fujitsu.oasys3":"oa3","vnd.fujitsu.oasysgp":"fg5","vnd.fujitsu.oasysprs":"bh2","vnd.fujixerox.ddd":"ddd","vnd.fujixerox.docuworks":"xdw","vnd.fujixerox.docuworks.binder":"xbd","vnd.fuzzysheet":"fzs","vnd.genomatix.tuxedo":"txd","vnd.geogebra.file":"ggb","vnd.geogebra.tool":"ggt","vnd.geometry-explorer":["gex","gre"],"vnd.geonext":"gxt","vnd.geoplan":"g2w","vnd.geospace":"g3w","vnd.gmx":"gmx","vnd.grafeq":["gqf","gqs"],"vnd.groove-account":"gac","vnd.groove-help":"ghf","vnd.groove-identity-message":"gim","vnd.groove-injector":"grv","vnd.groove-tool-message":"gtm","vnd.groove-tool-template":"tpl","vnd.groove-vcard":"vcg","vnd.hal+xml":"hal","vnd.handheld-entertainment+xml":"zmm","vnd.hbci":"hbci","vnd.hhe.lesson-player":"les","vnd.hp-hpgl":"hpgl","vnd.hp-hpid":"hpid","vnd.hp-hps":"hps","vnd.hp-jlyt":"jlt","vnd.hp-pcl":"pcl","vnd.hp-pclxl":"pclxl","vnd.hydrostatix.sof-data":"sfd-hdstx","vnd.ibm.minipay":"mpy","vnd.ibm.modcap":["afp","listafp","list3820"],"vnd.ibm.rights-management":"irm","vnd.ibm.secure-container":"sc","vnd.iccprofile":["icc","icm"],"vnd.igloader":"igl","vnd.immervision-ivp":"ivp","vnd.immervision-ivu":"ivu","vnd.insors.igm":"igm","vnd.intercon.formnet":["xpw","xpx"],"vnd.intergeo":"i2g","vnd.intu.qbo":"qbo","vnd.intu.qfx":"qfx","vnd.ipunplugged.rcprofile":"rcprofile","vnd.irepository.package+xml":"irp","vnd.is-xpr":"xpr","vnd.isac.fcs":"fcs","vnd.jam":"jam","vnd.jcp.javame.midlet-rms":"rms","vnd.jisp":"jisp","vnd.joost.joda-archive":"joda","vnd.kahootz":["ktz","ktr"],"vnd.kde.karbon":"karbon","vnd.kde.kchart":"chrt","vnd.kde.kformula":"kfo","vnd.kde.kivio":"flw","vnd.kde.kontour":"kon","vnd.kde.kpresenter":["kpr","kpt"],"vnd.kde.kspread":"ksp","vnd.kde.kword":["kwd","kwt"],"vnd.kenameaapp":"htke","vnd.kidspiration":"kia","vnd.kinar":["kne","knp"],"vnd.koan":["skp","skd","skt","skm"],"vnd.kodak-descriptor":"sse","vnd.las.las+xml":"lasxml","vnd.llamagraphics.life-balance.desktop":"lbd","vnd.llamagraphics.life-balance.exchange+xml":"lbe","vnd.lotus-1-2-3":"123","vnd.lotus-approach":"apr","vnd.lotus-freelance":"pre","vnd.lotus-notes":"nsf","vnd.lotus-organizer":"org","vnd.lotus-screencam":"scm","vnd.lotus-wordpro":"lwp","vnd.macports.portpkg":"portpkg","vnd.mcd":"mcd","vnd.medcalcdata":"mc1","vnd.mediastation.cdkey":"cdkey","vnd.mfer":"mwf","vnd.mfmp":"mfm","vnd.micrografx.flo":"flo","vnd.micrografx.igx":"igx","vnd.mif":"mif","vnd.mobius.daf":"daf","vnd.mobius.dis":"dis","vnd.mobius.mbk":"mbk","vnd.mobius.mqy":"mqy","vnd.mobius.msl":"msl","vnd.mobius.plc":"plc","vnd.mobius.txf":"txf","vnd.mophun.application":"mpn","vnd.mophun.certificate":"mpc","vnd.ms-artgalry":"cil","vnd.ms-cab-compressed":"cab","vnd.ms-excel.addin.macroenabled.12":"xlam","vnd.ms-excel.sheet.binary.macroenabled.12":"xlsb","vnd.ms-excel.sheet.macroenabled.12":"xlsm","vnd.ms-excel.template.macroenabled.12":"xltm","vnd.ms-fontobject":"eot","vnd.ms-htmlhelp":"chm","vnd.ms-ims":"ims","vnd.ms-lrm":"lrm","vnd.ms-officetheme":"thmx","vnd.ms-powerpoint.addin.macroenabled.12":"ppam","vnd.ms-powerpoint.presentation.macroenabled.12":"pptm","vnd.ms-powerpoint.slide.macroenabled.12":"sldm","vnd.ms-powerpoint.slideshow.macroenabled.12":"ppsm","vnd.ms-powerpoint.template.macroenabled.12":"potm","vnd.ms-project":["mpp","mpt"],"vnd.ms-word.document.macroenabled.12":"docm","vnd.ms-word.template.macroenabled.12":"dotm","vnd.ms-works":["wps","wks","wcm","wdb"],"vnd.ms-wpl":"wpl","vnd.ms-xpsdocument":"xps","vnd.mseq":"mseq","vnd.musician":"mus","vnd.muvee.style":"msty","vnd.mynfc":"taglet","vnd.neurolanguage.nlu":"nlu","vnd.nitf":["ntf","nitf"],"vnd.noblenet-directory":"nnd","vnd.noblenet-sealer":"nns","vnd.noblenet-web":"nnw","vnd.nokia.n-gage.data":"ngdat","vnd.nokia.n-gage.symbian.install":"n-gage","vnd.nokia.radio-preset":"rpst","vnd.nokia.radio-presets":"rpss","vnd.novadigm.edm":"edm","vnd.novadigm.edx":"edx","vnd.novadigm.ext":"ext","vnd.oasis.opendocument.chart-template":"otc","vnd.oasis.opendocument.formula-template":"odft","vnd.oasis.opendocument.image-template":"oti","vnd.olpc-sugar":"xo","vnd.oma.dd2+xml":"dd2","vnd.openofficeorg.extension":"oxt","vnd.openxmlformats-officedocument.presentationml.slide":"sldx","vnd.osgeo.mapguide.package":"mgp","vnd.osgi.dp":"dp","vnd.osgi.subsystem":"esa","vnd.palm":["pdb","pqa","oprc"],"vnd.pawaafile":"paw","vnd.pg.format":"str","vnd.pg.osasli":"ei6","vnd.picsel":"efif","vnd.pmi.widget":"wg","vnd.pocketlearn":"plf","vnd.powerbuilder6":"pbd","vnd.previewsystems.box":"box","vnd.proteus.magazine":"mgz","vnd.publishare-delta-tree":"qps","vnd.pvi.ptid1":"ptid","vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"vnd.realvnc.bed":"bed","vnd.recordare.musicxml":"mxl","vnd.recordare.musicxml+xml":"musicxml","vnd.rig.cryptonote":"cryptonote","vnd.rn-realmedia":"rm","vnd.rn-realmedia-vbr":"rmvb","vnd.route66.link66+xml":"link66","vnd.sailingtracker.track":"st","vnd.seemail":"see","vnd.sema":"sema","vnd.semd":"semd","vnd.semf":"semf","vnd.shana.informed.formdata":"ifm","vnd.shana.informed.formtemplate":"itp","vnd.shana.informed.interchange":"iif","vnd.shana.informed.package":"ipk","vnd.simtech-mindmapper":["twd","twds"],"vnd.smart.teacher":"teacher","vnd.solent.sdkm+xml":["sdkm","sdkd"],"vnd.spotfire.dxp":"dxp","vnd.spotfire.sfs":"sfs","vnd.stepmania.package":"smzip","vnd.stepmania.stepchart":"sm","vnd.sus-calendar":["sus","susp"],"vnd.svd":"svd","vnd.syncml+xml":"xsm","vnd.syncml.dm+wbxml":"bdm","vnd.syncml.dm+xml":"xdm","vnd.tao.intent-module-archive":"tao","vnd.tcpdump.pcap":["pcap","cap","dmp"],"vnd.tmobile-livetv":"tmo","vnd.trid.tpt":"tpt","vnd.triscape.mxs":"mxs","vnd.trueapp":"tra","vnd.ufdl":["ufd","ufdl"],"vnd.uiq.theme":"utz","vnd.umajin":"umj","vnd.unity":"unityweb","vnd.uoml+xml":"uoml","vnd.vcx":"vcx","vnd.visionary":"vis","vnd.vsf":"vsf","vnd.webturbo":"wtb","vnd.wolfram.player":"nbp","vnd.wqd":"wqd","vnd.wt.stf":"stf","vnd.xara":"xar","vnd.xfdl":"xfdl","vnd.yamaha.hv-dic":"hvd","vnd.yamaha.hv-script":"hvs","vnd.yamaha.hv-voice":"hvp","vnd.yamaha.openscoreformat":"osf","vnd.yamaha.openscoreformat.osfpvg+xml":"osfpvg","vnd.yamaha.smaf-audio":"saf","vnd.yamaha.smaf-phrase":"spf","vnd.yellowriver-custom-menu":"cmp","vnd.zul":["zir","zirz"],"vnd.zzazz.deck+xml":"zaz","voicexml+xml":"vxml",widget:"wgt",winhlp:"hlp","wsdl+xml":"wsdl","wspolicy+xml":"wspolicy","x-ace-compressed":"ace","x-authorware-bin":["aab","x32","u32","vox"],"x-authorware-map":"aam","x-authorware-seg":"aas","x-blorb":["blb","blorb"],"x-bzip":"bz","x-bzip2":["bz2","boz"],"x-cfs-compressed":"cfs","x-chat":"chat","x-conference":"nsc","x-dgc-compressed":"dgc","x-dtbncx+xml":"ncx","x-dtbook+xml":"dtb","x-dtbresource+xml":"res","x-eva":"eva","x-font-bdf":"bdf","x-font-ghostscript":"gsf","x-font-linux-psf":"psf","x-font-pcf":"pcf","x-font-snf":"snf","x-font-ttf":["ttf","ttc"],"x-font-type1":["pfa","pfb","pfm","afm"],"x-freearc":"arc","x-gca-compressed":"gca","x-glulx":"ulx","x-gramps-xml":"gramps","x-install-instructions":"install","x-lzh-compressed":["lzh","lha"],"x-mie":"mie","x-mobipocket-ebook":["prc","mobi"],"x-ms-application":"application","x-ms-shortcut":"lnk","x-ms-xbap":"xbap","x-msbinder":"obd","x-mscardfile":"crd","x-msclip":"clp","application/x-ms-installer":"msi","x-msmediaview":["mvb","m13","m14"],"x-msmetafile":["wmf","wmz","emf","emz"],"x-msmoney":"mny","x-mspublisher":"pub","x-msschedule":"scd","x-msterminal":"trm","x-mswrite":"wri","x-nzb":"nzb","x-pkcs12":["p12","pfx"],"x-pkcs7-certificates":["p7b","spc"],"x-research-info-systems":"ris","x-silverlight-app":"xap","x-sql":"sql","x-stuffitx":"sitx","x-subrip":"srt","x-t3vm-image":"t3","x-tex-tfm":"tfm","x-tgif":"obj","x-xliff+xml":"xlf","x-xz":"xz","x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"xaml+xml":"xaml","xcap-diff+xml":"xdf","xenc+xml":"xenc","xml-dtd":"dtd","xop+xml":"xop","xproc+xml":"xpl","xslt+xml":"xslt","xv+xml":["mxml","xhvml","xvml","xvm"],yang:"yang","yin+xml":"yin",envoy:"evy",fractals:"fif","internet-property-stream":"acx",olescript:"axs","vnd.ms-outlook":"msg","vnd.ms-pkicertstore":"sst","x-compress":"z","x-perfmon":["pma","pmc","pmr","pmw"],"ynd.ms-pkipko":"pko",gzip:["gz","tgz"],"smil+xml":["smi","smil"],"vnd.debian.binary-package":["deb","udeb"],"vnd.hzn-3d-crossword":"x3d","vnd.sqlite3":["db","sqlite","sqlite3","db-wal","sqlite-wal","db-shm","sqlite-shm"],"vnd.wap.sic":"sic","vnd.wap.slc":"slc","x-krita":["kra","krz"],"x-perl":["pm","pl"],yaml:["yaml","yml"]},audio:{amr:"amr","amr-wb":"awb",annodex:"axa",basic:["au","snd"],flac:"flac",midi:["mid","midi","kar","rmi"],mpeg:["mpga","mpega","mp3","m4a","mp2a","m2a","m3a"],mpegurl:"m3u",ogg:["oga","ogg","spx"],"prs.sid":"sid","x-aiff":"aifc","x-gsm":"gsm","x-ms-wma":"wma","x-ms-wax":"wax","x-pn-realaudio":"ram","x-realaudio":"ra","x-sd2":"sd2",adpcm:"adp",mp4:"mp4a",s3m:"s3m",silk:"sil","vnd.dece.audio":["uva","uvva"],"vnd.digital-winds":"eol","vnd.dra":"dra","vnd.dts":"dts","vnd.dts.hd":"dtshd","vnd.lucent.voice":"lvp","vnd.ms-playready.media.pya":"pya","vnd.nuera.ecelp4800":"ecelp4800","vnd.nuera.ecelp7470":"ecelp7470","vnd.nuera.ecelp9600":"ecelp9600","vnd.rip":"rip",webm:"weba","x-caf":"caf","x-matroska":"mka","x-pn-realaudio-plugin":"rmp",xm:"xm",aac:"aac",aiff:["aiff","aif","aff"],opus:"opus",wav:"wav"},chemical:{"x-alchemy":"alc","x-cache":["cac","cache"],"x-cache-csf":"csf","x-cactvs-binary":["cbin","cascii","ctab"],"x-cdx":"cdx","x-chem3d":"c3d","x-cif":"cif","x-cmdf":"cmdf","x-cml":"cml","x-compass":"cpa","x-crossfire":"bsd","x-csml":["csml","csm"],"x-ctx":"ctx","x-cxf":["cxf","cef"],"x-embl-dl-nucleotide":["emb","embl"],"x-gamess-input":["inp","gam","gamin"],"x-gaussian-checkpoint":["fch","fchk"],"x-gaussian-cube":"cub","x-gaussian-input":["gau","gjc","gjf"],"x-gaussian-log":"gal","x-gcg8-sequence":"gcg","x-genbank":"gen","x-hin":"hin","x-isostar":["istr","ist"],"x-jcamp-dx":["jdx","dx"],"x-kinemage":"kin","x-macmolecule":"mcm","x-macromodel-input":"mmod","x-mdl-molfile":"mol","x-mdl-rdfile":"rd","x-mdl-rxnfile":"rxn","x-mdl-sdfile":"sd","x-mdl-tgf":"tgf","x-mmcif":"mcif","x-mol2":"mol2","x-molconn-Z":"b","x-mopac-graph":"gpt","x-mopac-input":["mop","mopcrt","zmt"],"x-mopac-out":"moo","x-ncbi-asn1":"asn","x-ncbi-asn1-ascii":["prt","ent"],"x-ncbi-asn1-binary":"val","x-rosdal":"ros","x-swissprot":"sw","x-vamas-iso14976":"vms","x-vmd":"vmd","x-xtel":"xtel","x-xyz":"xyz"},font:{otf:"otf",woff:"woff",woff2:"woff2"},image:{gif:"gif",ief:"ief",jpeg:["jpeg","jpg","jpe","jfif","jfif-tbnl","jif"],pcx:"pcx",png:"png","svg+xml":["svg","svgz"],tiff:["tiff","tif"],"vnd.djvu":["djvu","djv"],"vnd.wap.wbmp":"wbmp","x-canon-cr2":"cr2","x-canon-crw":"crw","x-cmu-raster":"ras","x-coreldraw":"cdr","x-coreldrawpattern":"pat","x-coreldrawtemplate":"cdt","x-corelphotopaint":"cpt","x-epson-erf":"erf","x-icon":"ico","x-jg":"art","x-jng":"jng","x-nikon-nef":"nef","x-olympus-orf":"orf","x-portable-anymap":"pnm","x-portable-bitmap":"pbm","x-portable-graymap":"pgm","x-portable-pixmap":"ppm","x-rgb":"rgb","x-xbitmap":"xbm","x-xpixmap":"xpm","x-xwindowdump":"xwd",bmp:"bmp",cgm:"cgm",g3fax:"g3",ktx:"ktx","prs.btif":"btif",sgi:"sgi","vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"vnd.dwg":"dwg","vnd.dxf":"dxf","vnd.fastbidsheet":"fbs","vnd.fpx":"fpx","vnd.fst":"fst","vnd.fujixerox.edmics-mmr":"mmr","vnd.fujixerox.edmics-rlc":"rlc","vnd.ms-modi":"mdi","vnd.ms-photo":"wdp","vnd.net-fpx":"npx","vnd.xiff":"xif",webp:"webp","x-3ds":"3ds","x-cmx":"cmx","x-freehand":["fh","fhc","fh4","fh5","fh7"],"x-pict":["pic","pct"],"x-tga":"tga","cis-cod":"cod",avif:"avifs",heic:["heif","heic"],pjpeg:["pjpg"],"vnd.adobe.photoshop":"psd","x-adobe-dng":"dng","x-fuji-raf":"raf","x-icns":"icns","x-kodak-dcr":"dcr","x-kodak-k25":"k25","x-kodak-kdc":"kdc","x-minolta-mrw":"mrw","x-panasonic-raw":["raw","rw2","rwl"],"x-pentax-pef":["pef","ptx"],"x-sigma-x3f":"x3f","x-sony-arw":"arw","x-sony-sr2":"sr2","x-sony-srf":"srf"},message:{rfc822:["eml","mime","mht","mhtml","nws"]},model:{iges:["igs","iges"],mesh:["msh","mesh","silo"],vrml:["wrl","vrml"],"x3d+vrml":["x3dv","x3dvz"],"x3d+xml":"x3dz","x3d+binary":["x3db","x3dbz"],"vnd.collada+xml":"dae","vnd.dwf":"dwf","vnd.gdl":"gdl","vnd.gtw":"gtw","vnd.mts":"mts","vnd.usdz+zip":"usdz","vnd.vtu":"vtu"},text:{"cache-manifest":["manifest","appcache"],calendar:["ics","icz","ifb"],css:"css",csv:"csv",h323:"323",html:["html","htm","shtml","stm"],iuls:"uls",plain:["txt","text","brf","conf","def","list","log","in","bas","diff","ksh"],richtext:"rtx",scriptlet:["sct","wsc"],texmacs:"tm","tab-separated-values":"tsv","vnd.sun.j2me.app-descriptor":"jad","vnd.wap.wml":"wml","vnd.wap.wmlscript":"wmls","x-bibtex":"bib","x-boo":"boo","x-c++hdr":["h++","hpp","hxx","hh"],"x-c++src":["c++","cpp","cxx","cc"],"x-component":"htc","x-dsrc":"d","x-diff":"patch","x-haskell":"hs","x-java":"java","x-literate-haskell":"lhs","x-moc":"moc","x-pascal":["p","pas","pp","inc"],"x-pcs-gcd":"gcd","x-python":"py","x-scala":"scala","x-setext":"etx","x-tcl":["tcl","tk"],"x-tex":["tex","ltx","sty","cls"],"x-vcalendar":"vcs","x-vcard":"vcf",n3:"n3","prs.lines.tag":"dsc",sgml:["sgml","sgm"],troff:["t","tr","roff","man","me","ms"],turtle:"ttl","uri-list":["uri","uris","urls"],vcard:"vcard","vnd.curl":"curl","vnd.curl.dcurl":"dcurl","vnd.curl.scurl":"scurl","vnd.curl.mcurl":"mcurl","vnd.dvb.subtitle":"sub","vnd.fly":"fly","vnd.fmi.flexstor":"flx","vnd.graphviz":"gv","vnd.in3d.3dml":"3dml","vnd.in3d.spot":"spot","x-asm":["s","asm"],"x-c":["c","h","dic"],"x-fortran":["f","for","f77","f90"],"x-opml":"opml","x-nfo":"nfo","x-sfv":"sfv","x-uuencode":"uu",webviewhtml:"htt",javascript:"js",json:"json",markdown:["md","markdown","mdown","markdn"],"vnd.wap.si":"si","vnd.wap.sl":"sl"},video:{avif:"avif","3gpp":"3gp",annodex:"axv",dl:"dl",dv:["dif","dv"],fli:"fli",gl:"gl",mpeg:["mpeg","mpg","mpe","m1v","m2v","mp2","mpa","mpv2"],mp4:["mp4","mp4v","mpg4"],quicktime:["qt","mov"],ogg:"ogv","vnd.mpegurl":["mxu","m4u"],"x-flv":"flv","x-la-asf":["lsf","lsx"],"x-mng":"mng","x-ms-asf":["asf","asx","asr"],"x-ms-wm":"wm","x-ms-wmv":"wmv","x-ms-wmx":"wmx","x-ms-wvx":"wvx","x-msvideo":"avi","x-sgi-movie":"movie","x-matroska":["mpv","mkv","mk3d","mks"],"3gpp2":"3g2",h261:"h261",h263:"h263",h264:"h264",jpeg:"jpgv",jpm:["jpm","jpgm"],mj2:["mj2","mjp2"],"vnd.dece.hd":["uvh","uvvh"],"vnd.dece.mobile":["uvm","uvvm"],"vnd.dece.pd":["uvp","uvvp"],"vnd.dece.sd":["uvs","uvvs"],"vnd.dece.video":["uvv","uvvv"],"vnd.dvb.file":"dvb","vnd.fvt":"fvt","vnd.ms-playready.media.pyv":"pyv","vnd.uvvu.mp4":["uvu","uvvu"],"vnd.vivo":"viv",webm:"webm","x-f4v":"f4v","x-m4v":"m4v","x-ms-vob":"vob","x-smv":"smv",mp2t:"ts"},"x-conference":{"x-cooltalk":"ice"},"x-world":{"x-vrml":["vrm","flr","wrz","xaf","xof"]}};(()=>{const i={};for(const e of Object.keys(Mo))for(const t of Object.keys(Mo[e])){const n=Mo[e][t];if(typeof n=="string")i[n]=e+"/"+t;else for(let s=0;s<n.length;s++)i[n[s]]=e+"/"+t}return i})(),rg(Yn);const Xp="E84#E3C4!8C4&A1";async function St(i){try{const e=await fetch(i);if(!e.ok)return!1;const t=await e.blob();try{const n=new Io(new Kn(t),{password:Xp}),o=(await n.getEntries()).find(l=>!l.directory&&l.filename.endsWith(".json"));if(!o)return await n.close(),!1;const r=await o.getData(new ep);return await n.close(),JSON.parse(r.trim())}catch{const n=await t.text();try{return JSON.parse(n.trim())}catch(s){throw console.error(`[loadModelFile] JSON parse error: ${i}`,s),s}}}catch(e){return console.error("[loadModelFile] 加载失败",`${i} ${e}`),!1}}function Jp(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){const e=Math.random()*16|0;return(i==="x"?e:e&3|8).toString(16)})}class Ki{events={};on(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t)}emit(e,...t){this.events[e]&&this.events[e].forEach(n=>n(...t))}off(e,t){this.events[e]&&(this.events[e]=this.events[e].filter(n=>n!==t))}}const Il="35aa3175ce8b1a55331e.64c93d5e3268979d98c900";class Sl{cesium;viewer;modelList=[];hasLoaded3dTiles={};mapRecordModelId={};mapTileset={};BIMmodelId="";lazyLoadingCount=0;events=new Ki;options={flyTo:!0,flyToDuration:0,loadTreeNodeDetails:!0,loadTreeNodeDetailsUrl:"/elementInfo.zip",loadTree:!0,loadTreeUrl:"/allElementsInfo.zip",boxRegionUrl:"/BoundingBoxInfo.zip",regionUrl:"/region.zip",batchIDInfoUrl:"/batchIDInfo.zip",enabledSection:!0,delay:0,tilesetOptions:{cullWithChildrenBounds:!0,cullRequestsWhileMoving:!0,cullRequestsWhileMovingMultiplier:10,backFaceCulling:!0,colorBlendAmount:0,minimumPixelSize:128,maximumScreenSpaceError:32,skipLevelOfDetail:!0,baseScreenSpaceError:1024,skipScreenSpaceErrorFactor:128,skipLevels:5,immediatelyLoadDesiredLevelOfDetail:!1,loadSiblings:!1,maximumMemoryUsage:4096*10,preloadWhenHidden:!0,preferLeaves:!0,progressiveResolutionHeightFraction:.5,dynamicScreenSpaceErrorDensity:.002,dynamicScreenSpaceErrorFactor:4,dynamicScreenSpaceError:!0,dynamicScreenSpaceErrorHeightFalloff:.25,foveatedConeSize:0,foveatedTimeDelay:10,foveatedMinimumScreenSpaceErrorRelaxation:0}};constructor(e){this.cesium=e.cesium,this.viewer=e.viewer,this.options.tilesetOptions&&(this.options.tilesetOptions.colorBlendMode=this.cesium.Cesium3DTileColorBlendMode.REPLACE)}deleteAllModels(){const e=[];return Object.keys(this.mapTileset).forEach(t=>{const n=this.mapTileset[t];n&&(this.viewer.scene.primitives.remove(n),e.push(t)),delete this.mapTileset[t],delete this.hasLoaded3dTiles[t],delete this.mapRecordModelId[t]}),this.modelList=[],this.viewer.scene.requestRender(),this.events.emit("updateModels",{modelList:[]}),e}deleteModels(e){const t=[];return e.forEach(({modelId:n})=>{const s=this.mapTileset[n];s&&(this.viewer.scene.primitives.remove(s),t.push(n)),delete this.mapTileset[n],delete this.hasLoaded3dTiles[n],delete this.mapRecordModelId[n]}),this.modelList=this.modelList.filter(n=>!t.includes(n.modelId)),this.viewer.scene.requestRender(),this.events.emit("updateModels",{modelList:this.modelList}),t}showModels(e){const t=[];return e.forEach(n=>{const s=`${n.modelId}`,o=this.mapTileset[s];o&&(o.show=!!n.show,t.push(s))}),t.length&&this.viewer.scene.requestRender(),t}async addModels({files:e,fileNames:t,options:n}){const s=e||t||[];s.length>0&&await this.add3DTilesModel(s,n)}async add3DTilesModel(e,t){const n=t?wm({},this.options,t):{...this.options};if(e?.length){for(const s of e){const o=`${s.modelId}`;if(this.mapRecordModelId[o])continue;const r=`${s.outPutPath}${s.dbName}/tileset.json`;this.modelList.push({...s,url:r,state:mi.NotLoaded}),this.mapRecordModelId[o]=!1}await this.load3DTilesModel(n)}}async load3DTilesModel(e){const t=this.modelList.filter(r=>r.state===mi.NotLoaded);if(!t.length)return;const n=t.length;this.events.emit("loadingStatus",`正在加载 ${n} 个模型`);let s=0,o=!1;for(const r of t){s++;try{r.state=mi.Loading;const l=r.url,c=this.getBaseUrlPath(l);e.loadTreeNodeDetails=!1,e.loadTreeNodeDetails&&this.events.emit("loadingStatus",`正在加载第 ${s}/${n} 个模型: 加载${r.modelName}构件信息`);let d=e.loadTreeNodeDetails?await St(`${c}${e.loadTreeNodeDetailsUrl}`):!1;e.loadTree=!1,e.loadTree&&this.events.emit("loadingStatus",`正在加载第 ${s}/${n} 个模型: 加载${r.modelName}目录树`);const h=e.loadTree?await St(`${c}${e.loadTreeUrl}`):!1;this.events.emit("loadingStatus",`正在加载第 ${s}/${n} 个模型: 加载${r.modelName}模型数据`);const f=e.boxRegionUrl?await St(`${c}${e.boxRegionUrl}`):!1,m=e.batchIDInfoUrl?await St(`${c}${e.batchIDInfoUrl}`):!1;m&&(d||(d=m));const u=await this.loadTilesetWithZipSupport(l,r.modelId,e.tilesetOptions||{},this.cesium);this.viewer.scene.primitives.add(u),await u.readyPromise;const g=`${u?.asset?.tilesetVersion??r.modelId}`;this.mapTileset[`${r.modelId}`]=u;const A={versionId:g,selectedFn:e.selectedFn,model:{modelId:r.modelId,modelName:r.modelName,dbName:r.dbName,fileType:r.fileType,outPutPath:r.outPutPath,url:r.url,treeUrl:`${c}${e.loadTreeUrl}`,nodeUrl:`${c}${e.loadTreeNodeDetailsUrl}`,formData:r.formData,type:"BIM"},node:d||null,tree:h||null,box:null};if(f?.min&&f?.max){const p={x:f.min.X,y:f.min.Y,z:f.min.Z},y={x:f.max.X,y:f.max.Y,z:f.max.Z},C={x:(p.x+y.x)/2,y:(p.y+y.y)/2,z:(p.z+y.z)/2};A.box={min:p,max:y,center:C}}if(!r.formData){const p=await St(`${r.outPutPath}${r.dbName}${e.regionUrl}`);if(p)r.formData={modelId:r.modelId.toString(),longitude:p.Longitude,latitude:p.Latitude,distance:1e-6,rotation:30,totalRotation:p.DAngle||0,height:p.MinHeight,lonlat:1e-5,heightDistance:1,modelOptions:[{value:r.modelId.toString(),label:r.modelName}],X:p?.X||0,Y:p?.Y||0,Z:p?.Z||0};else{const y=t.indexOf(r);r.formData={modelId:r.modelId.toString(),longitude:118.12548706388897,latitude:24.596796919444404,distance:1e-5,rotation:0,totalRotation:0,heightDistance:1,height:0,lonlat:1e-5,modelOptions:[{value:y+1,label:r.modelName}],X:0,Y:0,Z:0}}}r.formData&&(r.formData.heightDistance=r.formData.heightDistance??1,A.model.formData=r.formData),u.leiting=A,oo({Cesium:this.cesium,tileset:u}),r.state=mi.Loaded,this.mapRecordModelId[r.modelId]=!0,this.events.emit("tilesetLoaded",u),e.tilesLoad3dTiles&&e.tilesLoad3dTiles(u),!o&&e.flyTo&&(this.BIMmodelId=r.modelId,this.flyToTileset({modelId:this.BIMmodelId,options:{duration:e.flyToDuration??0}}),o=!0),e.delay&&await new Promise(p=>setTimeout(p,e.delay))}catch(l){console.error(`模型 ${r.modelName} 加载失败:`,l),this.events.emit("loadingStatus",`模型 ${r.modelName} 加载失败`),r.state=mi.Error}}e.mountAll3Dtiles&&e.mountAll3Dtiles(this.modelList),e.onMountAll3Dtiles&&e.onMountAll3Dtiles(this.modelList),this.events.emit("loadingStatus",""),this.events.emit("mountAll3Dtiles",{modelList:this.modelList,mapTileset:this.mapTileset})}async addOSGB({files:e,options:t}){const n=this.cesium;if(!e?.length)return;this.events.emit("loadingStatus",`正在加载 ${e.length} 个倾斜摄影模型`);let s=!1,o=0;for(const r of e){o++,this.events.emit("loadingStatus",`正在加载第 ${o}/${e.length} 个模型: 加载${r.modelName}`);try{const{outPutPath:l,dbName:c,modelId:d}=r,f=`${/^https?:\/\//i.test(l)?l:`${window.location.origin}${l}`}${c}/tileset.json`,m=await n.Cesium3DTileset.fromUrl(f,{maximumScreenSpaceError:16,preferLeaves:!0,cullWithChildrenBounds:!0,...t?.tilesetOptions});if(m.colorBlendMode=this.cesium.Cesium3DTileColorBlendMode.REPLACE,this.viewer.scene.primitives.add(m),await m.readyPromise,this.mapTileset[`${d}`]=m,this.hasLoaded3dTiles[`${d}`]=(this.hasLoaded3dTiles[`${d}`]||0)+1,this.mapRecordModelId[`${d}`]=!0,!r?.formData){const u=m.root.computedTransform;if(u){const g=n.Matrix4.fromColumnMajorArray(u),A=n.Matrix4.getTranslation(g,new n.Cartesian3),p=n.Ellipsoid.WGS84.cartesianToCartographic(A),y=n.Math.toDegrees(p.longitude),C=n.Math.toDegrees(p.latitude),I=p.height;r.formData={modelId:r.modelId.toString(),longitude:y,latitude:C,distance:1e-5,rotation:0,totalRotation:0,heightDistance:1,height:I,lonlat:1e-5,modelOptions:[{value:r.modelId.toString(),label:r.modelName}],X:0,Y:0,Z:0}}else console.warn(`OSGB模型 ${d} 无法获取初始位置信息`)}r.formData&&(r.formData.heightDistance=r.formData.heightDistance??1),m.leiting={versionId:`${m?.asset?.tilesetVersion??d}`,selectedFn:t?.selectedFn,model:{modelId:r.modelId,modelName:r.modelName,dbName:r.dbName,fileType:r.fileType,outPutPath:r.outPutPath,url:f,formData:r.formData,type:"OSGB"},box:null},oo({Cesium:this.cesium,tileset:m}),this.modelList.push({...r,url:f,state:mi.Loaded}),!s&&t?.flyTo&&(this.BIMmodelId=r.modelId,this.viewer.zoomTo(m),s=!0)}catch(l){console.error(`OSGB模型 ${r.dbName} 加载失败:`,l);continue}}this.events.emit("loadingStatus",""),this.events.emit("onMountAllOsgb3Dtiles",{modelList:this.modelList,mapTileset:this.mapTileset}),t?.onMountAllOsgb3Dtiles(this.modelList)}updateOSGBMatrix(e){const{X:t,Y:n,Z:s,modelId:o}=e,r=this.cesium,l=this.mapTileset[o];if(!l){console.warn("tileSet not found for modelId:",o);return}let c=t||0,d=n||0,h=s||0;const f=l.boundingSphere.center,m=r.Transforms.eastNorthUpToFixedFrame(f),u=new r.Cartesian3(c,d,h),g=r.Matrix4.multiplyByPoint(m,u,new r.Cartesian3(0,0,0)),A=r.Cartesian3.subtract(g,f,new r.Cartesian3);l.modelMatrix=r.Matrix4.fromTranslation(A)}flyToTileset({modelId:e=this.BIMmodelId,options:t={}}={}){const s=this.getMapTileset()[e];if(!s||!this.viewer)return;const{complete:o,cancel:r,...l}=t,c={duration:0,...l};this.viewer.flyTo(s,c).then(d=>{d?o&&o():r&&r()}).catch(d=>{r&&r(),console.error("FlyTo error",d)})}getMapTileset(){return this.mapTileset}getBIMmodelId(){return this.BIMmodelId}getModelList(){return this.modelList}setMapTileset(e){this.mapTileset=e}setBIMmodelId(e){this.BIMmodelId=e}setModelList(e){this.modelList=e}getBaseUrlPath(e){const t=/^https?:\/\//i.test(e)?e:`${window.location.origin}${e}`,n=t.lastIndexOf("/");return n===-1?".":t.substr(0,n)}async loadTilesetWithZipSupport(e,t,n,s){try{const o=encodeURI(`${this.getBaseUrlPath(e)}/tileset.zip`);if((await fetch(o,{method:"HEAD"})).status===200){const c=await St(o);if(c){const d=this.getBaseUrlPath(e),h=u=>{!u||typeof u!="object"||(typeof u.uri=="string"&&!/^(data:|https?:\/\/)/i.test(u.uri)&&(u.uri=encodeURI(`${d}/${u.uri.replace(/^\.?\//,"")}`)),Object.values(u).forEach(g=>{if(Array.isArray(g)){g.forEach(A=>h(A));return}g&&typeof g=="object"&&h(g)}))};h(c);const f=`data:text/plain;base64,${btoa(unescape(encodeURIComponent(JSON.stringify(c))))}`,m=new s.Resource({url:f});try{return await s.Cesium3DTileset.fromUrl(m,{id:t,...n})}catch{return await s.Cesium3DTileset.fromUrl(e,{url:e,id:t,...n})}}}return await s.Cesium3DTileset.fromUrl(e,{url:e,id:t,...n})}catch{return await s.Cesium3DTileset.fromUrl(e,{url:e,id:t,...n})}}async loadTreeForModel(e){const t=this.mapTileset[e];if(!t||!t.leiting)return null;if(t.leiting.tree)return t.leiting.tree;const n=t.leiting.model?.modelName||e,s=t.leiting.model?.treeUrl;if(!t.leiting.model?.dbName&&!s)return null;this.lazyLoadingCount++,this.events.emit("loadingStatus",`正在加载 ${n} 目录树...`);try{if(s){const r=await St(s);if(On(r)&&r[0].name&&(r[0].name=n),r)return t.leiting.tree=r,r}}catch(r){console.error(`Failed to load tree for model ${e}:`,r)}finally{this.lazyLoadingCount--,this.lazyLoadingCount<=0&&(this.lazyLoadingCount=0,this.events.emit("loadingStatus",""))}return null}async _loadNodeDetailsForModel(e){const t=this.mapTileset[e];if(!t||!t.leiting)return null;if(t.leiting?.node?.nodeExtras)return t.leiting.node;const n=t.leiting.model?.nodeUrl,s=t.leiting.model?.modelName||e;if(!n)return null;this.lazyLoadingCount++,this.events.emit("loadingStatus",`正在加载 ${s} 构件详情...`);try{const o=await St(n);if(o)return o.batchIdEIDInfos||(o.batchIdEIDInfos=t.leiting.node.batchIdEIDInfos),t.leiting.node=o,o}catch(o){console.error(`Failed to load node details for model ${e}:`,o)}finally{this.lazyLoadingCount--,this.lazyLoadingCount<=0&&(this.lazyLoadingCount=0,this.events.emit("loadingStatus",""))}return null}async loadNodeDetailsForModel(e){const t=this.mapTileset[e];if(!t||!t.leiting)return null;if(t.leiting?.node?.nodeExtras)return t.leiting.node;const n=t.leiting.model?.nodeUrl,s=t.leiting.model?.modelName||e;if(!n)return null;this.lazyLoadingCount++,this.events.emit("loadingStatus",`正在加载 ${s} 构件详情...`);try{const o=await St(n);if(o)return o.batchIdEIDInfos||(o.batchIdEIDInfos=t.leiting.node.batchIdEIDInfos),t.leiting.node=o,o}catch(o){console.error(`Failed to load node details for model ${e}:`,o)}finally{this.lazyLoadingCount--,this.lazyLoadingCount<=0&&(this.lazyLoadingCount=0,this.events.emit("loadingStatus",""))}return null}}const xl={normal:0,process:2},Zp={color:1};function Ml(i){return i===1||i==="exist"?1:i===2||i==="process"?2:0}function Ei(i){return Number.isNaN(i)?0:i<=1?Math.min(Math.max(i,0),1):Math.min(Math.max(i/255,0),1)}function Bl(i){return Number.isNaN(i)?1:i<=1?Math.min(Math.max(i,0),1):1}function Bo(i){if(!i)return null;const e=Number(i.r),t=Number(i.g),n=Number(i.b),s=i.a===void 0?1:Number(i.a);if([e,t,n,s].some(c=>Number.isNaN(c)))return null;const o=Math.round(e*255),r=Math.round(t*255),l=Math.round(n*255);return`rgba(${o},${r},${l},${s})`}function e0(i){if(!i||typeof i!="string")return null;const t=i.replace(/\s+/g,"").match(/^rgba?\((\d+),(\d+),(\d+)(?:,([0-9.]+))?\)$/i);if(!t)return null;const n=Number(t[1]),s=Number(t[2]),o=Number(t[3]),r=t[4]===void 0?1:Number(t[4]);return[n,s,o,r].some(l=>Number.isNaN(l))?null:{r:Math.min(Math.max(n/255,0),1),g:Math.min(Math.max(s/255,0),1),b:Math.min(Math.max(o/255,0),1),a:Math.min(Math.max(r,0),1)}}function t0(i){if(i==null)return null;const e=Number(i);return Number.isNaN(e)?null:e}function i0(i){const e=i.lastIndexOf("-"),t=i.substring(0,e),n=i.substring(e+1);return[t,n]}function To(i){if(!i)return null;const e=i.Min??i.min,t=i.Max??i.max;if(!e||!t)return null;const n=Number(e.x??e.X),s=Number(e.y??e.Y),o=Number(e.z??e.Z),r=Number(t.x??t.X),l=Number(t.y??t.Y),c=Number(t.z??t.Z);return[n,s,o,r,l,c].some(d=>Number.isNaN(d))?null:{min:{x:n,y:s,z:o},max:{x:r,y:l,z:c}}}function qi(i,e){if(e)return`${e}`;const t=i?.leiting?.model?.modelId??i?.modelId??i?.id;return t==null?null:`${t}`}function n0(i,e){if(e==null)return null;const t=i?.leiting?.node;if(!t)return null;const n=`${e}`,s=t?.[n],o=To(s?.box3??s?.box);if(o)return o;const r=t?.element?.[n]??t?.elements?.[n]??t?.nodeExtras?.element?.[n]??t?.nodeExtras?.elements?.[n];return To(r?.box3??r?.box)}function s0(i){const e=i?.leiting?.box;return e?To({min:e.min,max:e.max}):null}class o0{base;constructor(e){this.base=e}initTime(){const t=this.base.cesium.JulianDate.fromDate(new Date(2023,3,21,10,0));this.base.viewer.clock.currentTime=t,this.base.start=this.base.viewer.clock.currentTime.secondsOfDay*1e3}processAnimation(e,t,n,s=null){if(this.base.start==null)return;const o=this.base.start+(e?.delay??0),r=this.base.start+(e?.playtime??0)+(e?.delay??0);t<=o&&(e.cash=!0,e.groupData.forEach(l=>{const{batchIds:c,modelId:d,rgba:h}=l;if(Array.isArray(c)&&c[0]){c[0][1]=h;const f=n[d];f?f.push(c[0]):n[d]=[c[0]]}})),t>=o&&t<r&&(s!==null&&(this.base.viewer.scene.ambientLightIntensity=s),e.cash=!1,e.playCash=!0,e.groupData.forEach(l=>{const{batchIds:c,playTimeColor:d,modelId:h}=l;if(Array.isArray(c)&&c[0]){c[0][1]=d;const f=n[h];f?f.push(c[0]):n[h]=[c[0]]}})),t>=r&&(e.finished=!0)}onTick=e=>{if(!this.base.cesium||!this.base.viewer)return;const t=e?.currentTime?.secondsOfDay?e.currentTime.secondsOfDay*1e3:this.base.viewer.clock.currentTime.secondsOfDay*1e3,n={};Array.isArray(this.base.data)&&this.base.data.forEach(o=>{this.processAnimation(o,t,n,.1)});const s=Object.entries(n);if(s.forEach(([o,r])=>{this.base.setTileSyltByConstructionProcessTracking({modelId:o,batchIds:r})}),Object.keys(this.base.mapAnimations).forEach(o=>{const r=this.base.mapAnimations[o];r.length&&r.every(l=>l.finished)&&!this.base.clearedModelIds.has(o)&&(this.base.setTileSyltByConstructionProcessTracking({modelId:o,batchIds:[]}),this.base.clearedModelIds.add(o))}),this.base.recoverStaus){s.length&&(this.base.recoverStaus=!1);return}s.length===0&&Array.isArray(this.base.data)&&this.base.data.forEach(o=>{o.groupData.forEach(r=>{const{modelId:l}=r;this.base.setTileSyltByConstructionProcessTracking({modelId:l,batchIds:[]})}),this.base.recoverStaus=!0})};enableConstructionProgressTracking(){this.base.clearedModelIds.clear(),this.initTime(),this.base.groupBatchIds={},Array.isArray(this.base.data)&&(this.base.data.forEach(e=>{e.cash=!1,e.playCash=!1,e.groupData.forEach(t=>{const{batchIds:n,modelId:s,rgba:o}=t;if(Array.isArray(n)&&n[0]){n[0][1]=o;const r=this.base.groupBatchIds[s];r?r.push(n[0]):this.base.groupBatchIds[s]=[n[0]]}})}),Object.entries(this.base.groupBatchIds).forEach(([e,t])=>{this.base.setTileSyltByConstructionProcessTracking({modelId:e,batchIds:t})})),this.base.viewer.clock.onTick.addEventListener(this.onTick)}disableConstructionProgressTracking(){this.base.viewer.clock.onTick.removeEventListener(this.onTick),this.base.viewer.scene.ambientLightIntensity=1,Array.isArray(this.base.data)&&this.base.data.forEach(e=>{e.cash=!0,e.playCash=!0,e.groupData.forEach(t=>{const{modelId:n}=t,s=[];this.base.setTileSyltByConstructionProcessTracking({modelId:n,batchIds:s})})}),this.base.start=null}freshConstructionProgressTracking(){const e=this.base.viewer.clock.currentTime.secondsOfDay*1e3,t={};Array.isArray(this.base.data)&&this.base.data.forEach(s=>{s.playCash=!1,this.processAnimation(s,e,t)});const n=Object.entries(t);n.forEach(([s,o])=>{this.base.setTileSyltByConstructionProcessTracking({modelId:s,batchIds:o})}),n.length===0&&Array.isArray(this.base.data)&&this.base.data.forEach(s=>{s.groupData.forEach(o=>{const{modelId:r}=o;this.base.setTileSyltByConstructionProcessTracking({modelId:r,batchIds:[]})})})}reStartAnimation(){let e={};this.base.clearedModelIds.clear(),Array.isArray(this.base.data)&&this.base.data.forEach(t=>{t.cash=!1,t.playCash=!1,t.groupData.forEach(n=>{const{batchIds:s,modelId:o,rgba:r}=n;if(Array.isArray(s)&&s[0]){s[0][1]=r;const l=e[o];l?l.push(s[0]):e[o]=[s[0]]}})}),Object.entries(e).forEach(([t,n])=>{this.base.setTileSyltByConstructionProcessTracking({modelId:t,batchIds:n})}),this.initTime()}setAllConstructionProgressTracking(e){this.base.data=e,Array.isArray(this.base.data)&&this.base.data.forEach(t=>{t.cash=!1,t.playCash=!1,t.groupData=[],t.finished=!1,t.mergeCpts.forEach(n=>{const s=[];n.cpts.forEach(c=>{s.push({dbName:n.linkModelId,modelId:n.modelId,elementId:`${c}`,show:!0,rgba:t.rgba??{r:.2,g:.2,b:.2,a:.2}})});const o=xl.process,r=Zp.color,{allElements:l}=this.base.groupByModelId(s);this.base.mapAnimations[n.modelId]=this.base.mapAnimations[n.modelId]||[],this.base.mapAnimations[n.modelId].push(t),Object.entries(l).forEach(([c,d])=>{const[h,f]=i0(c),m=this.base.getTileSyltByConstructionProcessTracking({elementIds:d,modelId:h,color:f,colorRank:o,show:!0,selectionRank:r}),u=t?.playTimeColor?.r??1,g=t?.playTimeColor?.g??1,A=t?.playTimeColor?.b??0,p=t?.playTimeColor?.a??.1,y=this.base.setColor({r:u,g,b:A,a:p}),C=this.base.setColor(t.rgba??{r:.2,g:.2,b:.2,a:.2});t.groupData.push({modelId:h,batchIds:m,playTimeColor:y,rgba:C})})})})}}class a0{base;constructor(e){this.base=e}attachTileset(e,t,n){const s=this.base.cesium;this.base.handler||(this.base.handler=new s.ScreenSpaceEventHandler(this.base.viewer.scene.canvas));const o=qi(e,n);o&&(this.base.tilesetMap[o]=e),t&&(this.base.selectedColor=t),this.bindInputs()}bindInputs(){if(!this.base.handler)return;const e=this.base.cesium;this.base.handler.setInputAction(async t=>{if(!this.base.clickToHighlightEnabled){await this.base.clearSelection();return}let n;try{n=this.base.viewer.scene.pick(t.position)}catch{}if(e.defined(n)&&n instanceof e.Cesium3DTileFeature){await this.base.clearSelection();const s=qi(n.tileset);if(!s||!this.base.tilesetMap[s])return;const o=this.base.getFeatureId(n);if(o==="-1")return;let r;const l=this.base.viewer.scene.pickPosition(t.position);if(e.defined(l)){const h=e.Cartographic.fromCartesian(l),f=e.Math.toDegrees(h.longitude),m=e.Math.toDegrees(h.latitude),u=h.height;r=[f,m,u]}const d=(this.base.hasSelectedFeaturesMap[s]||[]).filter(h=>h.rank!==0);if(this.base.hasSelectedFeaturesMap[s]=[...d,{batchId:o,selectedColor:this.base.selectedColor,rank:0,point:r,isTrigger:!0}],this.base.setBaseStyle(s),await this.base.triggerSelectionChange(s),n.tileset.leiting?.selectedFn)if(n.tileset.leiting.node){const h=n.tileset.leiting.node.batchIdEIDInfos[o].elementID,f=n.tileset.leiting.node.nodeExtras.element[h];f.elementId=h,f.modelId=n.tileset.leiting.model.modelId,n.tileset.leiting.selectedFn({elementInfo:f,elementId:h,point:r,modelId:n.tileset.leiting.model.modelId,_propsData:f})}else n.tileset.leiting.selectedFn(null)}else await this.base.clearSelection()},e.ScreenSpaceEventType.LEFT_CLICK),this.base.handler.setInputAction(async t=>{let n;try{n=this.base.viewer.scene.pick(t.position)}catch{}if(e.defined(n)&&n instanceof e.Cesium3DTileFeature){const s=qi(n.tileset);if(!s||!this.base.tilesetMap[s])return;const o=this.base.getFeatureId(n);if(o==="-1")return;let r;const l=this.base.viewer.scene.pickPosition(t.position);if(e.defined(l)){const c=e.Cartographic.fromCartesian(l),d=e.Math.toDegrees(c.longitude),h=e.Math.toDegrees(c.latitude),f=c.height;r=[d,h,f]}await this.base.toggleMultiSelect(s,o,this.base.selectedColor,r)}},e.ScreenSpaceEventType.LEFT_CLICK,e.KeyboardEventModifier.CTRL),this.base.handler.setInputAction(t=>{this.base.ensureSelectionDiv();const n=this.base.viewer?.scene?.screenSpaceCameraController;n&&this.base.cameraControllerState===null&&(this.base.cameraControllerState={enableRotate:n.enableRotate,enableTilt:n.enableTilt,enableLook:n.enableLook},n.enableRotate=!1,n.enableTilt=!1,n.enableLook=!1),this.base.selectStart=this.base.cesium.Cartesian2.clone(t.position),this.base.selectEnd=null,this.base.selectionDiv&&this.base.selectStart&&(this.base.selectionDiv.style.left=`${this.base.selectStart.x}px`,this.base.selectionDiv.style.top=`${this.base.selectStart.y}px`,this.base.selectionDiv.style.width="0px",this.base.selectionDiv.style.height="0px",this.base.selectionDiv.style.display="block")},e.ScreenSpaceEventType.LEFT_DOWN,e.KeyboardEventModifier.CTRL),this.base.handler.setInputAction(t=>{if(!this.base.selectStart||!this.base.selectionDiv)return;const n=performance.now();if(n-this.base.lastDrawTime<20)return;this.base.lastDrawTime=n,this.base.selectEnd=this.base.cesium.Cartesian2.clone(t.endPosition);const s=Math.min(this.base.selectStart.x,this.base.selectEnd.x),o=Math.min(this.base.selectStart.y,this.base.selectEnd.y),r=Math.abs(this.base.selectStart.x-this.base.selectEnd.x),l=Math.abs(this.base.selectStart.y-this.base.selectEnd.y);this.base.selectionDiv.style.left=`${s}px`,this.base.selectionDiv.style.top=`${o}px`,this.base.selectionDiv.style.width=`${r}px`,this.base.selectionDiv.style.height=`${l}px`,this.base.selectionDiv.style.backgroundColor="rgba(0, 255, 255, 0.5)",this.base.selectionDiv.style.position="absolute",this.base.selectionDiv.style.zIndex="2"},e.ScreenSpaceEventType.MOUSE_MOVE,e.KeyboardEventModifier.CTRL),this.base.handler.setInputAction(async()=>{if(!this.base.selectStart||!this.base.selectionDiv)return;if(!this.base.selectStart||!this.base.selectEnd){this.base.selectionDiv.style.display="none";const n=this.base.viewer?.scene?.screenSpaceCameraController;n&&this.base.cameraControllerState!==null&&(n.enableRotate=this.base.cameraControllerState.enableRotate,n.enableTilt=this.base.cameraControllerState.enableTilt,n.enableLook=this.base.cameraControllerState.enableLook,this.base.cameraControllerState=null);return}this.base.selectionDiv.style.display="none",await this.base.selectTilesInRectangle(this.base.selectStart,this.base.selectEnd,this.base.selectedColor),this.base.viewer.scene.requestRender(),this.base.selectStart=null,this.base.selectEnd=null;const t=this.base.viewer?.scene?.screenSpaceCameraController;t&&this.base.cameraControllerState!==null&&(t.enableRotate=this.base.cameraControllerState.enableRotate,t.enableTilt=this.base.cameraControllerState.enableTilt,t.enableLook=this.base.cameraControllerState.enableLook,this.base.cameraControllerState=null)},e.ScreenSpaceEventType.LEFT_UP,e.KeyboardEventModifier.CTRL)}unbindInputs(){if(!this.base.handler)return;const e=this.base.cesium;this.base.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_CLICK),this.base.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_CLICK,e.KeyboardEventModifier.CTRL),this.base.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_DOWN,e.KeyboardEventModifier.CTRL),this.base.handler.removeInputAction(e.ScreenSpaceEventType.MOUSE_MOVE,e.KeyboardEventModifier.CTRL),this.base.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_UP,e.KeyboardEventModifier.CTRL)}}class r0{cesium;viewer;data;handler;selectedColor="rgba(255,0,0,1.0)";tilesetMap={};hasSelectedFeaturesMap={};colorRankColor=[];showStateMap={};selectedPosition={x:null,y:null};selectionDiv=null;lastDrawTime=0;selectStart=null;selectEnd=null;cameraControllerState=null;start=null;groupBatchIds={};recoverStaus=!1;mapAnimations={};clearedModelIds=new Set;eidToBatchIdMap={};batchIdToElementIdMap={};animationModule;selectionModule;onSelectionChangeCallbacks=[];loadNodeDetailsForModel;loadNodeDetailsCallback;clickToHighlightEnabled=!0;constructor(e){this.cesium=e.cesium,this.viewer=e.viewer,this.animationModule=new o0(this),this.selectionModule=new a0(this)}attachTileset(e,t,n){this.selectionModule.attachTileset(e,t,n)}setLoadNodeDetailsCallback(e){this.loadNodeDetailsCallback=e}selectionChange(e){e&&typeof e=="function"&&this.onSelectionChangeCallbacks.push(e)}removeSelectionChange(e){this.onSelectionChangeCallbacks=this.onSelectionChangeCallbacks.filter(t=>t!==e)}async triggerSelectionChange(e){if(e)await this.loadNodeDetailsForModel(e);else{const t=Object.keys(this.hasSelectedFeaturesMap);t.length>0&&await Promise.all(t.map(n=>{try{return this.loadNodeDetailsForModel(n)}catch(s){return console.error(`Error loading node details for model ${n}:`,s),Promise.resolve()}}))}if(this.onSelectionChangeCallbacks.length>0){const t=await this.getSelected({rank:0});this.onSelectionChangeCallbacks.forEach(n=>{try{n(t)}catch(s){console.error("Selection callback error:",s)}})}}enableSelection(){this.selectionModule.bindInputs()}disableSelection(){this.selectionModule.unbindInputs()}async clearSelection(e){this.getTargetModelIds(e).forEach(n=>{const s=this.hasSelectedFeaturesMap[n];if(!s?.length)return;const o=s.filter(r=>r.rank!==0);o.length?(this.hasSelectedFeaturesMap[n]=o,this.setBaseStyle(n)):(delete this.hasSelectedFeaturesMap[n],this.applyShowStyleOnly(n))}),this.viewer.scene.requestRender(),await this.triggerSelectionChange(e)}clearExist(e){this.getTargetModelIds(e).forEach(n=>{const s=this.hasSelectedFeaturesMap[n];if(!s?.length)return;const o=s.filter(r=>r.rank!==1);o.length?(this.hasSelectedFeaturesMap[n]=o,this.setBaseStyle(n)):(delete this.hasSelectedFeaturesMap[n],this.applyShowStyleOnly(n))}),this.viewer.scene.requestRender()}clearProcess(e){this.getTargetModelIds(e).forEach(n=>{const s=this.hasSelectedFeaturesMap[n];if(!s?.length)return;const o=s.filter(r=>r.rank!==2);o.length?(this.hasSelectedFeaturesMap[n]=o,this.setBaseStyle(n)):(delete this.hasSelectedFeaturesMap[n],this.applyShowStyleOnly(n))}),this.viewer.scene.requestRender()}async clearAllHaveSelected(){this.getTargetModelIds().forEach(t=>{this.hasSelectedFeaturesMap[t]&&(delete this.hasSelectedFeaturesMap[t],this.applyShowStyleOnly(t))}),this.viewer.scene.requestRender(),await this.triggerSelectionChange()}async loadAllNodeDetailsForModel(){for(const e of Object.keys(this.tilesetMap))await this.loadNodeDetailsForModel(e)}getSelected(e){const t=e&&typeof e=="object"&&"rank"in e?e.rank:e,n=Ml(t),s=[];for(const o of Object.keys(this.hasSelectedFeaturesMap))(this.hasSelectedFeaturesMap[o]||[]).forEach(l=>{if(l.rank!==n)return;const c=e0(l.selectedColor);let d=this.getBatchIdToElementIdSync(l.batchId,o);d===null&&(d=l.batchId),l.isTrigger&&s.push({elementId:d,modelId:o,rgba:c||void 0,point:l?.point||void 0})});return s}getBatchIdToElementIdSync(e,t){if(this.batchIdToElementIdMap[t])return this.batchIdToElementIdMap[t].get(e)??null;const s=this.tilesetMap[t]?.leiting?.node?.batchIdEIDInfos;if(s&&Array.isArray(s)){const o=new Map;return s.forEach(r=>{r&&r.elementID&&o.set(`${r.batchId}`,`${r.elementID}`)}),this.batchIdToElementIdMap[t]=o,o.get(e)??null}return null}setAllConstructionProgressTracking(e){this.animationModule.setAllConstructionProgressTracking(e)}initTime(){this.animationModule.initTime()}processAnimation(e,t,n,s=null){this.animationModule.processAnimation(e,t,n,s)}onTick=e=>{this.animationModule.onTick(e)};enableConstructionProgressTracking(){this.animationModule.enableConstructionProgressTracking()}disableConstructionProgressTracking(){this.animationModule.disableConstructionProgressTracking()}freshConstructionProgressTracking(){this.animationModule.freshConstructionProgressTracking()}reStartAnimation(){this.animationModule.reStartAnimation()}setTileSyltByConstructionProcessTracking({modelId:e,batchIds:t}){const n=this.tilesetMap[e];if(!n)return;const s=n?.style?.show?.conditionsExpression?.conditions;Array.isArray(t)&&t.length?s?n.style=new this.cesium.Cesium3DTileStyle({show:{conditions:s},color:{conditions:t}}):n.style=new this.cesium.Cesium3DTileStyle({color:{conditions:t}}):this.applyShowStyleOnly(e),this.viewer.scene.requestRender()}resumeFlyTo(){this.viewer.clock.shouldAnimate=!0}pauseFlyTo(){this.viewer.clock.shouldAnimate=!1}async flyToObjects({selectCpts:e,options:t}){if(!Array.isArray(e)||e.length===0)return;await this.clearSelection(),await this.setSelectColorUserModelCpt(e,{rank:0});const n=this.cesium,s=t?.scale??1,o=[];for(const r of e){const l=r?.modelId;if(l==null)continue;await this.loadNodeDetailsForModel(l);const c=r?.elementId,d=this.tilesetMap[`${l}`];if(!d)continue;const f=n0(d,c)||s0(d);if(!f)continue;const m=new n.Cartesian3(f.min.x,f.min.y,f.min.z),u=new n.Cartesian3(f.max.x,f.max.y,f.max.z),g=d?.root?.computedTransform??d?.modelMatrix;if(g){const A=n.Matrix4.multiplyByPoint(g,m,new n.Cartesian3),p=n.Matrix4.multiplyByPoint(g,u,new n.Cartesian3);o.push(A,p)}else o.push(m,u)}if(o.length){const r=n.BoundingSphere.fromPoints(o);r.radius=r.radius*s;const l=this.viewer.scene.camera,c=new n.HeadingPitchRange(l.heading,l.pitch,0);l.flyToBoundingSphere(r,{duration:t?.duration??0,complete:t?.complete,offset:c})}else{const r=e[0]?.modelId,l=r?this.tilesetMap[`${r}`]:null;l&&this.viewer.flyTo(l,{duration:t?.duration??0,complete:t?.complete})}}setBaseStyle(e){this.getTargetModelIds(e).forEach(n=>{this.setColorStyle(n)})}setColorStyle(e){this.updateTilesetStyle(e)}buildColorConditions(e){const t=this.tilesetMap[e],n=this.hasSelectedFeaturesMap[e];if(!t||!n?.length)return;const s=new Map;n.forEach(c=>{const d=s.get(c.batchId);(!d||c.rank>=d.rank)&&s.set(c.batchId,c)});const o=new Map;if(s.forEach(({batchId:c,selectedColor:d})=>{o.has(d)||o.set(d,new Set),o.get(d)?.add(c)}),this.colorRankColor.length){const c=new Set;this.colorRankColor.forEach(d=>{const h=o.get(d);h&&h.forEach(f=>c.add(f))}),o.forEach((d,h)=>{if(this.colorRankColor.includes(h))return;const f=new Set;d.forEach(m=>{c.has(m)||f.add(m)}),o.set(h,f)})}const r=[...this.colorRankColor.filter(c=>o.has(c)),...Array.from(o.keys()).filter(c=>!this.colorRankColor.includes(c))],l=[];return r.forEach(c=>{const d=o.get(c);if(!d||!d.size)return;const h=Array.from(d).join("|");h&&l.push([`(regExp('^(${h})$').test(\${id}))`,c])}),l.length?l:void 0}updateTilesetStyle(e){const t=this.tilesetMap[e];if(!t)return;t.colorBlendMode=this.cesium.Cesium3DTileColorBlendMode.REPLACE;const n=this.showStateMap[e],s=n?this.buildShowConditions(n.batchIds,n.mode):void 0,o=this.buildColorConditions(e);s||o?t.style=new this.cesium.Cesium3DTileStyle({show:s?{conditions:s}:void 0,color:o?{conditions:o}:void 0}):t.style=void 0,this.viewer.scene.requestRender()}setShowStyle(e){this.getTargetModelIds(e?.modelId).forEach(n=>{const s=this.showStateMap[n]||{batchIds:[],mode:"include"};this.showStateMap[n]={batchIds:e?.batchIds??s.batchIds,mode:e?.mode??s.mode},this.updateTilesetStyle(n)})}setColor(e){if(!e)return this.selectedColor;if(typeof e=="string")return e;const t=Ei(Number(e.r)),n=Ei(Number(e.g)),s=Ei(Number(e.b)),o=Bl(e.a===void 0?1:Number(e.a));return Bo({r:t,g:n,b:s,a:o})||this.selectedColor}groupByModelId(e){const t={};return e.forEach(n=>{const s=n?.modelId,o=n?.elementId;if(s==null||o===void 0||o===null)return;const r=n?.color??n?.rgba,l=this.setColor(r??{r:.4,g:.4,b:.4,a:.1}),c=`${s}-${l}`;t[c]||(t[c]=[]),t[c].push(`${o}`)}),{allElements:t,transform:null,box:null}}getBatchIds(e,t){const n=`${t}`,s=`${e}`;if(this.eidToBatchIdMap[n]){const c=this.eidToBatchIdMap[n].get(s);if(c!==void 0)return c}const r=this.tilesetMap[n]?.leiting?.node?.batchIdEIDInfos;if(r&&Array.isArray(r)){const c=new Map;r.forEach(h=>{const f=`${h.elementID}`,m=`${h.batchId}`;c.has(f)||c.set(f,[]),c.get(f).push(m)}),this.eidToBatchIdMap[n]=c;const d=c.get(s);if(d!==void 0)return d}const l=t0(e);return l!=null?[String(l)]:[]}async setComponentVisibility(e){if(Array.isArray(e)){Object.keys(this.showStateMap).forEach(t=>{this.showStateMap[t]={batchIds:[],mode:"exclude"}});for(const t of e){const n=`${t.modelId}`;this.showStateMap[n]||(this.showStateMap[n]={batchIds:[],mode:"exclude"});const s=this.showStateMap[n];if(!t.show){const o=this.getBatchIds(t.elementId,n);s.batchIds.push(...o)}}Object.keys(this.showStateMap).forEach(t=>{this.updateTilesetStyle(t)})}}async isolateComponentVisibility(e){const t={};e.forEach(n=>{const s=`${n.modelId}`;t[s]||(t[s]=new Set),t[s].add(`${n.elementId}`)});for(const n of Object.keys(this.tilesetMap)){await this.loadNodeDetailsForModel(n);const o=this.tilesetMap[n]?.leiting?.node?.batchIdEIDInfos;if(!o)continue;this.showStateMap[n]={batchIds:[],mode:"exclude"};const r=t[n];if(r&&r.size>0){const l=[];for(const c of o)r.has(`${c.elementID}`)||l.push(`${c.batchId}`);this.showStateMap[n].batchIds=l;continue}this.showStateMap[n].batchIds=o.map(l=>l.batchId)}Object.keys(this.showStateMap).forEach(n=>{this.updateTilesetStyle(n)})}async setAllComponentsVisibility(e){const t=this.getTargetModelIds();for(const n of t)await this.loadNodeDetailsForModel(n),e?this.setShowStyle({modelId:n,batchIds:[],mode:"exclude"}):this.setShowStyle({modelId:n,batchIds:[],mode:"include"})}getComponentsByVisibility(e){const t=this.getTargetModelIds(),n=[];return t.forEach(s=>{const o=this.showStateMap[s],r=this.tilesetMap[s];if(!r?.leiting?.node?.batchIdEIDInfos)return;const l=r.leiting.node.batchIdEIDInfos,c=new Set(o?.batchIds??[]),d=o?.mode??"exclude",h=new Set;l.forEach(f=>{const m=c.has(`${f.batchId}`);if((d==="include"?m:!m)===e){const g=`${f.elementID}`;h.has(g)||(n.push({elementId:g,modelId:s}),h.add(g))}})}),n}async _getComponentsByVisibility(e){const t=this.getTargetModelIds();for(const s of t)this.loadNodeDetailsForModel(s);const n=[];return t.forEach(s=>{const o=this.showStateMap[s],r=this.tilesetMap[s];if(!r?.leiting?.node?.batchIdEIDInfos)return;const l=r.leiting.node.batchIdEIDInfos,c=new Set(o?.batchIds??[]),d=o?.mode??"exclude",h=new Set;l.forEach(f=>{const m=c.has(`${f.batchId}`);if((d==="include"?m:!m)===e){const g=`${f.elementID}`;h.has(g)||(n.push({elementId:g,modelId:s}),h.add(g))}})}),n}getTileSyltByConstructionProcessTracking({elementIds:e,modelId:t,color:n,colorRank:s,show:o,selectionRank:r}){const l=this.tilesetMap[t];if(!Array.isArray(e))return[];const c=l.leiting.node,d=new Set(e),h=c.batchIdEIDInfos.filter(m=>d.has(`${m.elementID}`)).map(m=>String(m.batchId));return h.length?(s===xl.normal&&!this.colorRankColor.includes(n)&&(this.colorRankColor=[n]),[[`(regExp('^(${h.join("|")})$').test(\${id}))`,n]]):[]}async setSelectColorUserModelCpt(e,t){if(!Array.isArray(e))return;const n=new Map,s=t?.rank===void 0?"exist":t?.rank,o=Ml(s),r=t?.isTrigger??!0;for(const l of e){const c=l?.modelId;if(c==null)continue;const d=`${c}`;await this.loadNodeDetailsForModel(d);const h=Array.isArray(l?.elementIds)?l.elementIds:l?.elementId?[l.elementId]:[];if(!h.length)continue;const f=Bo(l?.rgba)||this.selectedColor;for(const m of h){const u=this.getBatchIds(m,d);if(u.length!==0){n.has(d)||n.set(d,[]);for(const g of u)n.get(d)?.push({batchId:g,selectedColor:f,rank:o,isTrigger:r})}}}for(const[l,c]of n){const d=this.mergeSelections(l,c);this.hasSelectedFeaturesMap[l]=d,this.setBaseStyle(l)}r&&await this.triggerSelectionChange()}async setAllSelectColorUserModelCpt(e,t){const{modelId:n,rgba:s}=e,o=t?.isTrigger??!0;if(!n)return;await this.loadNodeDetailsForModel(n);const r=String(n),l=this.tilesetMap[r];if(!l)return;const c=l?.leiting?.node?.batchIdEIDInfos;if(!c||!Array.isArray(c))return;const d=[];c.forEach(h=>{h&&h.elementID!==void 0&&d.push(h.elementID)}),d.length!==0&&await this.setSelectColorUserModelCpt([{modelId:r,elementIds:d,rgba:s}],{rank:0,isTrigger:o})}getFeatureId(e){if(this.cesium.defined(e)&&this.cesium.defined(e.getProperty)){const t=e.getProperty("id");return t!=null?String(t):"-1"}return"-1"}getTargetModelIds(e){return e?[e]:Object.keys(this.tilesetMap)}buildShowConditions(e,t){const n=e.join("|");return n?t==="include"?[[`(regExp('^(${n})$').test(\${id}))`,"true"],["true","false"]]:[[`(regExp('^(${n})$').test(\${id}))`,"false"],["true","true"]]:t==="include"?[["true","false"]]:void 0}applyShowStyleOnly(e){const t=this.tilesetMap[e];if(!t)return;const n=this.showStateMap[e],s=n?this.buildShowConditions(n.batchIds,n.mode):void 0;s?t.style=new this.cesium.Cesium3DTileStyle({show:{conditions:s}}):t.style=void 0}setSelectedColorRgba(e,t,n,s=1){const o=Ei(e),r=Ei(t),l=Ei(n),c=Bl(s),d=Bo({r:o,g:r,b:l,a:c});d&&(this.selectedColor=d)}mergeSelections(e,t){const n=new Map;return(this.hasSelectedFeaturesMap[e]||[]).forEach(o=>n.set(o.batchId,o)),t.forEach(o=>{const r=n.get(o.batchId);(!r||o.rank>r.rank||o.rank===r.rank)&&n.set(o.batchId,o)}),Array.from(n.values())}async toggleMultiSelect(e,t,n,s){const o=this.hasSelectedFeaturesMap[e]||[],r=o.filter(f=>f.rank!==0),l=o.filter(f=>f.rank===0),d=l.some(f=>f.batchId===t)?l.filter(f=>f.batchId!==t):[...l,{batchId:t,selectedColor:n,rank:0,point:s,isTrigger:!0}],h=[...r,...d];h.length?(this.hasSelectedFeaturesMap[e]=h,this.setBaseStyle(e)):(delete this.hasSelectedFeaturesMap[e],this.applyShowStyleOnly(e)),await this.triggerSelectionChange(e)}ensureSelectionDiv(){if(this.selectionDiv)return;const e=document.createElement("div");e.style.display="none",e.style.pointerEvents="none",e.style.border="1px solid rgba(0, 255, 255, 0.8)",this.viewer.container.appendChild(e),this.selectionDiv=e}isRepeatedClick(e){const t=e?.position;return!t||typeof t.x!="number"||typeof t.y!="number"?!1:this.selectedPosition.x===t.x&&this.selectedPosition.y===t.y?!0:(this.selectedPosition.x=t.x,this.selectedPosition.y=t.y,!1)}async selectTilesInRectangle(e,t,n){const s=Math.min(e.x,t.x),o=Math.max(e.x,t.x),r=Math.min(e.y,t.y),l=Math.max(e.y,t.y),c=o-s,d=l-r;if(Math.abs(c)<15||Math.abs(d)<15)return;const h=s+c/2,f=r+d/2,m=new this.cesium.Cartesian2(h,f),u=this.viewer.scene.drillPick(m,void 0,c,d);if(!Array.isArray(u))return;const g=new Map;u.forEach(A=>{if(!(A instanceof this.cesium.Cesium3DTileFeature))return;const p=qi(A.tileset);if(!p||!this.tilesetMap[p])return;const y=this.getFeatureId(A);y!=="-1"&&(g.has(p)||g.set(p,new Set),g.get(p)?.add(y))}),g.forEach((A,p)=>{const y=this.hasSelectedFeaturesMap[p]||[],C=y.filter(M=>M.rank!==0),I=new Set(y.filter(M=>M.rank===0).map(M=>M.batchId)),P=[];A.forEach(M=>{I.has(M)||P.push({batchId:M,selectedColor:n,rank:0,isTrigger:!0})});const k=y.filter(M=>M.rank===0);this.hasSelectedFeaturesMap[p]=[...C,...k,...P],this.setBaseStyle(p)}),await this.triggerSelectionChange()}}class l0{cesium;viewer;tilesetMap={};planeEntities=[];clippingPlanesMap={};activeModelIds=new Set;boxMatrix=null;boxInverseMatrix=null;boxCenter=null;boxOrientation=null;targetZPlus=0;targetZMinus=0;targetXPlus=0;targetXMinus=0;targetYPlus=0;targetYMinus=0;currentPlaneType="";selectedPlane=null;hoveredPlane=null;dragStartPoint=null;moveCallBack=null;downHandler=null;upHandler=null;moveHandler=null;constructor(e){this.cesium=e.cesium,this.viewer=e.viewer}attachTileset(e,t){this.tilesetMap[t]=e}open(e,t){!this.tilesetMap[e]||this.activeModelIds.has(e)||(this.activeModelIds.add(e),this.moveCallBack=t?.moveCallBack,this.fitToModels(),this.activeModelIds.size===1&&(this.createPlaneEntities(),this.initEventHandlers()))}setupClippingPlanes(e){const t=this.cesium,n=this.tilesetMap[e];if(!n||!this.boxMatrix)return;const s=new t.ClippingPlaneCollection({planes:[new t.ClippingPlane(new t.Cartesian3(1,0,0),this.targetXMinus),new t.ClippingPlane(new t.Cartesian3(-1,0,0),this.targetXPlus),new t.ClippingPlane(new t.Cartesian3(0,1,0),this.targetYMinus),new t.ClippingPlane(new t.Cartesian3(0,-1,0),this.targetYPlus),new t.ClippingPlane(new t.Cartesian3(0,0,1),this.targetZMinus),new t.ClippingPlane(new t.Cartesian3(0,0,-1),this.targetZPlus)],edgeWidth:2,edgeColor:t.Color.WHITE,enabled:!0,unionClippingRegions:!0}),o=t.Matrix4.inverse(n.root.transform,new t.Matrix4);s.modelMatrix=t.Matrix4.multiply(o,this.boxMatrix,new t.Matrix4),n.clippingPlanes=s,this.clippingPlanesMap[e]=s}createPlaneEntities(){const e=this.cesium,t=this.viewer;this.planeEntities.forEach(s=>t.entities.remove(s)),this.planeEntities=[];const n=["left","right","behind","front","top","down"];for(const s of n){const o=t.entities.add({name:s,position:new e.CallbackProperty(()=>{if(!this.boxMatrix)return e.Cartesian3.ZERO;const r=this.getPlaneOffsetCartesian(s);return e.Matrix4.multiplyByPoint(this.boxMatrix,r,new e.Cartesian3)},!1),orientation:new e.CallbackProperty(()=>this.boxOrientation||e.Quaternion.IDENTITY,!1),plane:{dimensions:new e.CallbackProperty(()=>{if(this.activeModelIds.size===0)return new e.Cartesian2(0,0);const r=.1,l=Math.max(r,this.targetXMinus+this.targetXPlus),c=Math.max(r,this.targetYPlus+this.targetYMinus),d=Math.max(r,this.targetZPlus+this.targetZMinus);return s==="top"||s==="down"?new e.Cartesian2(l,c):s==="left"||s==="right"?new e.Cartesian2(c,d):new e.Cartesian2(l,d)},!1),material:e.Color.WHITE.withAlpha(.1),outline:!0,outlineColor:e.Color.YELLOW,plane:new e.CallbackProperty(()=>new e.Plane(this.getNormalByType(s),0),!1)}});this.planeEntities.push(o)}}getPlaneOffsetCartesian(e){const t=(this.targetXPlus-this.targetXMinus)/2,n=(this.targetYPlus-this.targetYMinus)/2,s=(this.targetZPlus-this.targetZMinus)/2;switch(e){case"left":return new this.cesium.Cartesian3(-this.targetXMinus,n,s);case"right":return new this.cesium.Cartesian3(this.targetXPlus,n,s);case"behind":return new this.cesium.Cartesian3(t,-this.targetYMinus,s);case"front":return new this.cesium.Cartesian3(t,this.targetYPlus,s);case"top":return new this.cesium.Cartesian3(t,n,this.targetZPlus);case"down":return new this.cesium.Cartesian3(t,n,-this.targetZMinus);default:return this.cesium.Cartesian3.ZERO}}getNormalByType(e){const t=this.cesium;switch(e){case"left":return new t.Cartesian3(1,0,0);case"right":return new t.Cartesian3(-1,0,0);case"behind":return new t.Cartesian3(0,1,0);case"front":return new t.Cartesian3(0,-1,0);case"top":return new t.Cartesian3(0,0,-1);case"down":return new t.Cartesian3(0,0,1);default:return t.Cartesian3.UNIT_X}}getPlaneByType(e){const t=this.cesium,n=this.getNormalByType(e),s=t.Cartesian3.negate(n,new t.Cartesian3);let o=0;switch(e){case"left":o=this.targetXMinus;break;case"right":o=this.targetXPlus;break;case"behind":o=this.targetYMinus;break;case"front":o=this.targetYPlus;break;case"top":o=this.targetZPlus;break;case"down":o=this.targetZMinus;break}return new t.Plane(s,-o)}initEventHandlers(){const e=this.cesium,t=this.viewer.scene.canvas,n=this.viewer.scene;this.downHandler=new e.ScreenSpaceEventHandler(t),this.upHandler=new e.ScreenSpaceEventHandler(t),this.moveHandler=new e.ScreenSpaceEventHandler(t),this.moveHandler.setInputAction(s=>{if(this.selectedPlane)return;let o;try{o=n.pick(s.endPosition)}catch{}e.defined(o)&&o.id&&o.id.plane?this.hoveredPlane!==o.id.plane&&(this.hoveredPlane&&(this.hoveredPlane.material=e.Color.WHITE.withAlpha(.1)),this.hoveredPlane=o.id.plane,this.hoveredPlane.material=e.Color.YELLOW.withAlpha(.3),t.style.cursor="pointer"):this.hoveredPlane&&(this.hoveredPlane.material=e.Color.WHITE.withAlpha(.1),this.hoveredPlane=null,t.style.cursor="default")},e.ScreenSpaceEventType.MOUSE_MOVE),this.downHandler.setInputAction(s=>{let o;try{o=n.pick(s.position)}catch{}if(e.defined(o)&&o.id&&o.id.plane){this.currentPlaneType=o.id.name,this.selectedPlane=o.id.plane,this.selectedPlane.material=e.Color.RED.withAlpha(.4),n.screenSpaceCameraController.enableInputs=!1;const r=n.camera.getPickRay(s.position),l=this.boxInverseMatrix,c=e.Matrix4.multiplyByPoint(l,r.origin,new e.Cartesian3),d=e.Matrix4.multiplyByPointAsVector(l,r.direction,new e.Cartesian3);e.Cartesian3.normalize(d,d);const h=new e.Ray(c,d),f=this.getPlaneByType(this.currentPlaneType);this.dragStartPoint=e.IntersectionTests.rayPlane(h,f,new e.Cartesian3),this.dragStartPoint||(this.dragStartPoint=this.getPlaneOffsetCartesian(this.currentPlaneType))}},e.ScreenSpaceEventType.LEFT_DOWN),this.moveHandler.setInputAction(s=>{if(!this.selectedPlane||!this.dragStartPoint)return;const o=n.camera.getPickRay(s.endPosition),r=this.boxInverseMatrix,l=e.Matrix4.multiplyByPoint(r,o.origin,new e.Cartesian3),c=e.Matrix4.multiplyByPointAsVector(r,o.direction,new e.Cartesian3);e.Cartesian3.normalize(c,c);const d=new e.Ray(l,c);let h=new e.Cartesian3;this.currentPlaneType==="top"||this.currentPlaneType==="down"?h=Math.abs(c.x)>Math.abs(c.y)?e.Cartesian3.UNIT_X:e.Cartesian3.UNIT_Y:this.currentPlaneType==="left"||this.currentPlaneType==="right"?h=Math.abs(c.y)>Math.abs(c.z)?e.Cartesian3.UNIT_Y:e.Cartesian3.UNIT_Z:h=Math.abs(c.x)>Math.abs(c.z)?e.Cartesian3.UNIT_X:e.Cartesian3.UNIT_Z;const f=-e.Cartesian3.dot(this.dragStartPoint,h),m=new e.Plane(h,f);let u=e.IntersectionTests.rayPlane(d,m,new e.Cartesian3);if(!u){const A=h===e.Cartesian3.UNIT_X?e.Cartesian3.UNIT_Y:h===e.Cartesian3.UNIT_Y&&(this.currentPlaneType==="top"||this.currentPlaneType==="down")?e.Cartesian3.UNIT_X:e.Cartesian3.UNIT_Z,p=-e.Cartesian3.dot(this.dragStartPoint,A);u=e.IntersectionTests.rayPlane(d,new e.Plane(A,p),new e.Cartesian3)}if(!u)return;const g=.01;switch(this.currentPlaneType){case"left":this.targetXMinus=Math.max(-this.targetXPlus+g,-u.x);break;case"right":this.targetXPlus=Math.max(-this.targetXMinus+g,u.x);break;case"behind":this.targetYMinus=Math.max(-this.targetYPlus+g,-u.y);break;case"front":this.targetYPlus=Math.max(-this.targetYMinus+g,u.y);break;case"top":this.targetZPlus=Math.max(-this.targetZMinus+g,u.z);break;case"down":this.targetZMinus=Math.max(-this.targetZPlus+g,-u.z);break}this.syncClippingPlanes(),this.moveCallBack&&this.moveCallBack(this.getRangeParams())},e.ScreenSpaceEventType.MOUSE_MOVE),this.upHandler.setInputAction(()=>{this.selectedPlane&&(this.selectedPlane.material=e.Color.WHITE.withAlpha(.1),this.selectedPlane=null,this.currentPlaneType="",this.dragStartPoint=null),n.screenSpaceCameraController.enableInputs=!0,t.style.cursor="default"},e.ScreenSpaceEventType.LEFT_UP)}syncClippingPlanes(){this.activeModelIds.size!==0&&Object.keys(this.clippingPlanesMap).forEach(e=>{const t=this.clippingPlanesMap[e],n=this.tilesetMap[e];if(t&&n&&!t.isDestroyed()){const s=this.cesium;t.get(0).distance=this.targetXMinus,t.get(1).distance=this.targetXPlus,t.get(2).distance=this.targetYMinus,t.get(3).distance=this.targetYPlus,t.get(4).distance=this.targetZMinus,t.get(5).distance=this.targetZPlus;const o=s.Matrix4.inverse(n.root.transform,new s.Matrix4);t.modelMatrix=s.Matrix4.multiply(o,this.boxMatrix,new s.Matrix4)}})}fitToModels(){const e=this.cesium;if(this.activeModelIds.size===0)return;let t=[];if(this.activeModelIds.forEach(f=>{const m=this.tilesetMap[f];m&&m.boundingSphere&&t.push(m.boundingSphere.center)}),t.length===0)return;const n=new e.Cartesian3;t.forEach(f=>e.Cartesian3.add(n,f,n)),this.boxCenter=e.Cartesian3.divideByScalar(n,t.length,new e.Cartesian3),this.boxMatrix=e.Transforms.eastNorthUpToFixedFrame(this.boxCenter),this.boxInverseMatrix=e.Matrix4.inverse(this.boxMatrix,new e.Matrix4),this.boxOrientation=e.Quaternion.fromRotationMatrix(e.Matrix4.getMatrix3(this.boxMatrix,new e.Matrix3));let s=1/0,o=-1/0,r=1/0,l=-1/0,c=1/0,d=-1/0;this.activeModelIds.forEach(f=>{const m=this.tilesetMap[f];if(!m)return;const u=[],g=m.leiting?.box,A=m.root?.boundingVolume?.boundingVolume;if(g&&g.min&&g.max){const{min:p,max:y}=g,C=[new e.Cartesian3(p.x,p.y,p.z),new e.Cartesian3(y.x,p.y,p.z),new e.Cartesian3(p.x,y.y,p.z),new e.Cartesian3(y.x,y.y,p.z),new e.Cartesian3(p.x,p.y,y.z),new e.Cartesian3(y.x,p.y,y.z),new e.Cartesian3(p.x,y.y,y.z),new e.Cartesian3(y.x,y.y,y.z)],I=m.root.transform;C.forEach(P=>{u.push(e.Matrix4.multiplyByPoint(I,P,new e.Cartesian3))})}else if(A&&A.halfAxes){const p=A.center,y=A.halfAxes,C=e.Matrix3.getColumn(y,0,new e.Cartesian3),I=e.Matrix3.getColumn(y,1,new e.Cartesian3),P=e.Matrix3.getColumn(y,2,new e.Cartesian3);for(let k=0;k<8;k++){const M=e.Cartesian3.clone(p,new e.Cartesian3);e.Cartesian3.add(M,e.Cartesian3.multiplyByScalar(C,k&1?1:-1,new e.Cartesian3),M),e.Cartesian3.add(M,e.Cartesian3.multiplyByScalar(I,k&2?1:-1,new e.Cartesian3),M),e.Cartesian3.add(M,e.Cartesian3.multiplyByScalar(P,k&4?1:-1,new e.Cartesian3),M),u.push(M)}}else if(m.boundingSphere){const p=m.boundingSphere,y=p.center,C=p.radius,I=e.Matrix4.multiplyByPoint(this.boxInverseMatrix,y,new e.Cartesian3);s=Math.min(s,I.x-C),o=Math.max(o,I.x+C),r=Math.min(r,I.y-C),l=Math.max(l,I.y+C),c=Math.min(c,I.z-C),d=Math.max(d,I.z+C)}u.forEach(p=>{const y=e.Matrix4.multiplyByPoint(this.boxInverseMatrix,p,new e.Cartesian3);s=Math.min(s,y.x),o=Math.max(o,y.x),r=Math.min(r,y.y),l=Math.max(l,y.y),c=Math.min(c,y.z),d=Math.max(d,y.z)})});const h=1.01;this.targetXMinus=Math.abs(s)*h,this.targetXPlus=Math.abs(o)*h,this.targetYMinus=Math.abs(r)*h,this.targetYPlus=Math.abs(l)*h,this.targetZMinus=Math.abs(c)*h,this.targetZPlus=Math.abs(d)*h,this.activeModelIds.forEach(f=>{this.setupClippingPlanes(f)}),this.viewer.scene.requestRender()}getRangeParams(){const e=this.cesium;return{targetZPlus:this.targetZPlus,targetZMinus:this.targetZMinus,targetXPlus:this.targetXPlus,targetXMinus:this.targetXMinus,targetYPlus:this.targetYPlus,targetYMinus:this.targetYMinus,maxBox:new e.Cartesian3(this.targetXPlus,this.targetYPlus,this.targetZPlus),minBox:new e.Cartesian3(-this.targetXMinus,-this.targetYMinus,-this.targetZMinus)}}updateRange(e){if(!this.boxMatrix)return;e.targetXMinus!==void 0&&(this.targetXMinus=e.targetXMinus),e.targetXPlus!==void 0&&(this.targetXPlus=e.targetXPlus),e.targetYMinus!==void 0&&(this.targetYMinus=e.targetYMinus),e.targetYPlus!==void 0&&(this.targetYPlus=e.targetYPlus),e.targetZPlus!==void 0&&(this.targetZPlus=e.targetZPlus),e.targetZMinus!==void 0&&(this.targetZMinus=e.targetZMinus);const t=.1;this.targetXMinus+this.targetXPlus<t&&(this.targetXPlus=t-this.targetXMinus),this.targetYPlus+this.targetYMinus<t&&(this.targetYPlus=t-this.targetYMinus),this.targetZPlus+this.targetZMinus<t&&(this.targetZPlus=t-this.targetZMinus),this.syncClippingPlanes(),this.viewer.scene.requestRender()}getRange(){return this.getRangeParams()}setBoxVisibility(e){this.planeEntities.forEach(t=>{t.show=e}),this.viewer.scene.requestRender()}close(e){if(e){const t=this.tilesetMap[e];t&&(t.clippingPlanes&&(t.clippingPlanes.enabled=!1),t.clippingPlanes=void 0),delete this.clippingPlanesMap[e],this.activeModelIds.delete(e),this.activeModelIds.size>0&&this.fitToModels()}else Object.keys(this.clippingPlanesMap).forEach(t=>{const n=this.tilesetMap[t];n&&(n.clippingPlanes&&(n.clippingPlanes.enabled=!1),n.clippingPlanes=void 0)}),this.clippingPlanesMap={},this.activeModelIds.clear();this.activeModelIds.size===0&&(this.planeEntities.forEach(t=>{this.viewer.entities.remove(t)}),this.planeEntities=[],this.destroyEventHandlers(),this.boxMatrix=null,this.boxInverseMatrix=null),this.viewer.scene.requestRender()}destroyEventHandlers(){this.downHandler?.destroy(),this.upHandler?.destroy(),this.moveHandler?.destroy(),this.downHandler=this.upHandler=this.moveHandler=null}}let Po=performance.now();const c0=10;class d0{cesium;viewer;modelInfo={modelName:"Person",modelId:"player_111",url:"person/model.glb",scale:.0032};startTime=0;radian=0;speed=.1;speedVector;position;hpRoll;cameralHpRoll;fixedFrameTransforms;model;transparentTest=!0;gravityTestByMove=!1;gravityTest=!0;lastMoveTime=0;moveInterval=.01;collisionTest=!0;wheelCount=2;isLeftDragging=!1;lastScreenY=0;lastScreenX=0;pauseAnimationFn;resumeAnimationFn;selectedColor;selectedColorRecover;handler;moveState={moveFront:!1,moveBack:!1,moveLeft:!1,moveRight:!1,moveUp:!1,moveDown:!1};onLoading=null;onSuccess=null;onError=null;constructor({cesium:e,viewer:t,modelInfo:n,callbacks:s}){this.cesium=e,this.viewer=t,this.radian=this.cesium.Math.toRadians(4),this.speedVector=new this.cesium.Cartesian3,this.position=new this.cesium.Cartesian3,this.hpRoll=new this.cesium.HeadingPitchRoll,this.cameralHpRoll=new this.cesium.HeadingPitchRoll,this.fixedFrameTransforms=new this.cesium.Transforms.localFrameToFixedFrameGenerator("north","west"),n&&(this.modelInfo=Object.assign(this.modelInfo,n)),s&&(this.onLoading=s.onLoading||null,this.onSuccess=s.onSuccess||null,this.onError=s.onError||null),this.selectedColor=new this.cesium.Color(1,1,1,.4),this.selectedColorRecover=new this.cesium.Color(1,1,1,1);const o=this.viewer.scene.canvas;this.handler=new this.cesium.ScreenSpaceEventHandler(o)}getModel(){return this.model}setPauseAnimation(e){this.pauseAnimationFn=e}setResumeAnimationFn(e){this.resumeAnimationFn=e}async setPersonPosition(e){e&&(this.position=e),this.getModel()?(this.model.modelMatrix=this.cesium.Transforms.headingPitchRollToFixedFrame(e,this.hpRoll,this.cesium.Ellipsoid.WGS84,this.fixedFrameTransforms),this.model.show=!0,this.initKeyBoard()):await this.openPlayer(),this.setCameralDefault(!1)}setModelInfo(e){e&&(this.modelInfo=Object.assign(this.modelInfo,e))}async openPlayer(){if(this.enablePositionSelection(),this.model){this.model.show=!0,this.initKeyBoard(),this.setCameralDefault(!1);return}this.position&&!(this.position.x===0&&this.position.y===0&&this.position.z===0)?(await this.loadModel(),this.initKeyBoard(),this.setCameralDefault(!1)):this.onLoading&&this.onLoading("请按住 Ctrl + 左键点击场景选择初始位置...")}enablePositionSelection(){this._positionHandler&&(this._positionHandler.destroy(),this._positionHandler=null);const e=new this.cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);e.setInputAction(async t=>{const n=this.viewer.scene;let s;try{s=n.pickPosition(t.position)}catch(o){console.warn("pickPosition failed:",o)}s&&(this.position=s,this.model?(this.model.modelMatrix=this.cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpRoll,this.cesium.Ellipsoid.WGS84,this.fixedFrameTransforms),this.updatedCamera(),this.onSuccess&&this.onSuccess("已更新漫游位置")):(this.onSuccess&&this.onSuccess("位置已选择,正在加载模型..."),await this.loadModel(),this.initKeyBoard(),this.setCameralDefault(!1)))},this.cesium.ScreenSpaceEventType.LEFT_CLICK,this.cesium.KeyboardEventModifier.CTRL),this._positionHandler=e}_positionHandler;setDefaultPosition(){const e=this.viewer.scene,t=this.viewer.camera,n=new this.cesium.Cartesian2(e.canvas.clientWidth/2,e.canvas.clientHeight/2);let s;try{s=e.pickPosition(n)}catch(o){console.warn("pickPosition failed:",o)}if(s)this.position=s;else{const o=t.direction,l=this.cesium.Cartesian3.add(t.positionWC,this.cesium.Cartesian3.multiplyByScalar(o,10,new this.cesium.Cartesian3),new this.cesium.Cartesian3);this.position=l}}async loadModel(){let e;try{this.onLoading&&this.onLoading("正在加载漫游人物...");const t=await this.cesium.Model.fromGltfAsync({id:this.modelInfo.modelId,url:this.modelInfo.url,modelMatrix:this.cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpRoll,this.cesium.Ellipsoid.WGS84,this.fixedFrameTransforms),scale:this.modelInfo.scale,allowPicking:!1,debugShowBoundingVolume:!1,debugWireframe:!1,cull:!1,gltfCallback:s=>{e=s.animations},backFaceCulling:!1}),n=()=>{if(e&&e.length>0){console.log("Model has animations:",e.length);try{t.activeAnimations.add({index:0,loop:this.cesium.ModelAnimationLoop.REPEAT,multiplier:1})}catch(s){console.error("Failed to add animation:",s)}this.pauseAnimationFn=()=>{this.viewer.clock.shouldAnimate=!1},this.resumeAnimationFn=()=>{this.viewer.clock.shouldAnimate=!0},this.viewer.clock.shouldAnimate=!1}else console.warn("No animations found in the model.")};t.ready?n():t.readyEvent.addEventListener(n),this.model=await this.viewer.scene.primitives.add(t),this.updatedCamera(),this.onLoading&&this.onLoading(""),this.onSuccess&&this.onSuccess("漫游模型加载完成")}catch(t){console.error("Failed to load model:",t),this.onLoading&&this.onLoading(""),this.onError&&this.onError("漫游模型加载失败")}}initKeyBoard(){const e=this.handler,t=this.cesium;Po=performance.now();const n=(o,r)=>{const l=o.code,c=o.keyCode;l==="KeyA"||c===65?this.moveState.moveLeft=r:l==="KeyW"||c===87?this.moveState.moveFront=r:l==="KeyD"||c===68?this.moveState.moveRight=r:l==="KeyS"||c===83?this.moveState.moveBack=r:l==="KeyQ"||c===81?this.moveState.moveUp=r:(l==="KeyE"||c===69)&&(this.moveState.moveDown=r)};e.setInputAction(o=>{this.wheelCount-=o*.001,this.wheelCount<.1&&(this.wheelCount=.1),this.updatedCamera()},t.ScreenSpaceEventType.WHEEL),this._keydownHandler=o=>{o.target.tagName==="INPUT"||o.target.tagName==="TEXTAREA"||(n(o,!0),this.resumeAnimationFn&&this.resumeAnimationFn())},this._keyupHandler=o=>{o.target.tagName==="INPUT"||o.target.tagName==="TEXTAREA"||(n(o,!1),Object.keys(this.moveState).every(r=>this.moveState[r]==!1)&&this.pauseAnimationFn&&this.pauseAnimationFn())},document.addEventListener("keydown",this._keydownHandler),document.addEventListener("keyup",this._keyupHandler),e.setInputAction(o=>{this.isLeftDragging=!0,this.lastScreenY=o.position.y,this.lastScreenX=o.position.x},this.cesium.ScreenSpaceEventType.LEFT_DOWN),e.setInputAction(o=>{if(!this.isLeftDragging)return;const r=o.endPosition.x,l=o.endPosition.y,c=l-this.lastScreenY,d=r-this.lastScreenX;Math.abs(c)<Math.abs(d)&&(d>0?(this.cameralHpRoll.heading+=this.radian,this.hpRoll.heading+=this.radian):(this.cameralHpRoll.heading-=this.radian,this.hpRoll.heading-=this.radian),s(0),this.lastScreenX=r),this.lastScreenY=l;const h=this.viewer.camera;this.cameralHpRoll.pitch=h.pitch+this.cesium.Math.toRadians(-c*.1),this.updatedCamera()},t.ScreenSpaceEventType.MOUSE_MOVE),e.setInputAction(()=>{this.isLeftDragging&&(this.isLeftDragging=!1)},t.ScreenSpaceEventType.LEFT_UP);const s=o=>{const r=performance.now();if(r-Po<c0)return;Po=r;const l=1.75;if(o===1?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_X,this.speed,this.speedVector),this.gravityTestByMove=!0):o===-1?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_X,-this.speed,this.speedVector),this.gravityTestByMove=!0):o===0?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_X,0,this.speedVector),this.gravityTestByMove=!1):o===2?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_Z,.05,this.speedVector),this.gravityTestByMove=!1):o===-2?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_Z,-.05,this.speedVector),this.gravityTestByMove=!1):o===3?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_Y,this.speed,this.speedVector),this.gravityTestByMove=!0):o===-3&&(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_Y,-this.speed,this.speedVector),this.gravityTestByMove=!0),!this.viewer||!this.model)return;const c=(f,m)=>new this.cesium.Ray(f,m),d=new this.cesium.Cartesian3;this.cesium.Matrix4.getColumn(this.model.modelMatrix,0,d),this.cesium.Cartesian3.normalize(d,d);const h=new this.cesium.Cartesian3;if(this.cesium.Matrix4.getColumn(this.model.modelMatrix,1,h),this.cesium.Cartesian3.normalize(h,h),Math.abs(o)!=2&&this.collisionTest){const f=new this.cesium.Cartesian3(this.position.x,this.position.y,this.position.z),m=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,l),f);let u=d;o===-1?u=this.cesium.Cartesian3.multiplyByScalar(d,-1,new this.cesium.Cartesian3):o===3?u=h:o===-3&&(u=this.cesium.Cartesian3.multiplyByScalar(h,-1,new this.cesium.Cartesian3));const g=c(m,u),A=this.viewer.scene.pickFromRay(g,[this.model],1);if(A&&A.position&&this.cesium.Cartesian3.distance(m,A.position)<.9&&o!==0)return}if(this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,this.speedVector,this.position),this.cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpRoll,this.cesium.Ellipsoid.WGS84,this.fixedFrameTransforms,this.model.modelMatrix),this.gravityTest){const f=new this.cesium.Cartesian3(this.position.x,this.position.y,this.position.z),m=.5,u=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,m),f),g=new this.cesium.Cartesian3;this.cesium.Cartesian3.subtract(this.position,u,g),this.cesium.Cartesian3.normalize(g,g);const A=c(u,g),p=this.viewer.scene.pickFromRay(A,[this.model],1),y=l,C=this.cesium.Cartesian3.add(u,this.cesium.Cartesian3.multiplyByScalar(d,y,new this.cesium.Cartesian3),new this.cesium.Cartesian3);if(t.defined(p)){const I=t.Cartesian3.distance(u,p.position);I-m>.2&&(this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,-.2),this.position)),I-m<-.1&&I<2&&(this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,.2),this.position))}if(!p&&this.gravityTestByMove){const I=c(this.position,g),P=this.viewer.scene.pickFromRay(I,[this.model],1);if(P){const k=this.cesium.Cartesian3.distance(this.position,P.position);Math.abs(k-1)>.05&&k<2&&(this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,-.2),this.position))}}if(p&&this.gravityTestByMove&&this.gravityTest){const I=this.cesium.Cartesian3.distance(C,p.position);Math.abs(I-l)>.1&&(this.cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpRoll,this.cesium.Ellipsoid.WGS84,this.fixedFrameTransforms,this.model.modelMatrix),this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,(l-I)/Math.abs(l-I)*.05),this.position))}}if(this.transparentTest){const f=new this.cesium.Cartesian3(this.position.x,this.position.y,this.position.z),m=1.75,u=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,m),f),g=this.viewer.camera.positionWC,A=u,p=t.Cartesian3.subtract(A,g,new t.Cartesian3),y=t.Cartesian3.distance(u,g),C=t.Cartesian3.normalize(p,new t.Cartesian3),I=new t.Ray(g,C);let P;try{P=this.viewer.scene.pickFromRay(I,void 0,1)}catch{}t.defined(P)&&P.primitive!==this.model&&P.position&&t.Cartesian3.distance(g,P.position)<y&&(this.wheelCount-=.1,this.wheelCount<.1&&(this.wheelCount=.1))}this.cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpRoll,this.cesium.Ellipsoid.WGS84,this.fixedFrameTransforms,this.model.modelMatrix),this.updatedCamera()};this._tickHandler=()=>{const o=performance.now()/1e3;(o-this.lastMoveTime>=this.moveInterval||this.lastMoveTime==0)&&(this.moveState.moveFront?s(1):this.moveState.moveBack?s(-1):this.moveState.moveLeft?s(3):this.moveState.moveRight?s(-3):this.moveState.moveUp?s(2):this.moveState.moveDown&&s(-2),this.lastMoveTime=o)},this.viewer.clock.onTick.addEventListener(this._tickHandler)}updatedCamera(){if(!this.model)return;const e=new this.cesium.Cartesian3(this.position.x,this.position.y,this.position.z),t=1.75,n=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,t),e);this.viewer.camera.viewBoundingSphere(new this.cesium.BoundingSphere(n,this.wheelCount),this.cameralHpRoll)}_keydownHandler;_keyupHandler;_tickHandler;_uiEventListeners=[];bindUiKeys(e){this.unbindUiKeys(),Object.entries(e).forEach(([t,n])=>{if(!n)return;const s=()=>this.setMoveState(t,!0),o=()=>this.setMoveState(t,!1);n.addEventListener("mousedown",s),n.addEventListener("mouseup",o),n.addEventListener("mouseleave",o),n.addEventListener("touchstart",r=>{r.preventDefault(),s()}),n.addEventListener("touchend",r=>{r.preventDefault(),o()}),this._uiEventListeners.push(()=>{n.removeEventListener("mousedown",s),n.removeEventListener("mouseup",o),n.removeEventListener("mouseleave",o),n.removeEventListener("touchstart",s),n.removeEventListener("touchend",o)})})}unbindUiKeys(){this._uiEventListeners.forEach(e=>e()),this._uiEventListeners=[]}openCameraRoam(){const e=this.cesium,t=this.viewer,n=t.camera;this.setDefaultPosition(),this.setCameralDefault(!1);const s=this.handler;let o=!1,r=0,l=0;s.setInputAction(c=>{o=!0,r=c.position.x,l=c.position.y},e.ScreenSpaceEventType.LEFT_DOWN),s.setInputAction(c=>{if(!o)return;const d=c.endPosition.x,h=c.endPosition.y,f=d-r,m=h-l;Math.abs(f)>Math.abs(m)&&(n.heading-=f*.003),n.pitch+=m*.003,r=d,l=h},e.ScreenSpaceEventType.MOUSE_MOVE),s.setInputAction(()=>{o=!1},e.ScreenSpaceEventType.LEFT_UP),s.setInputAction(c=>{this.wheelCount-=c*.001,this.wheelCount<.1&&(this.wheelCount=.1)},e.ScreenSpaceEventType.WHEEL),this._tickHandler=()=>{if(!this.moveState.moveFront&&!this.moveState.moveBack&&!this.moveState.moveLeft&&!this.moveState.moveRight&&!this.moveState.moveUp&&!this.moveState.moveDown)return;const c=(this.speed||.02)*12,d=n.direction,h=n.right,f=n.up;let m=0,u=0,g=0;this.moveState.moveFront&&(m+=d.x*c,u+=d.y*c,g+=d.z*c),this.moveState.moveBack&&(m-=d.x*c,u-=d.y*c,g-=d.z*c),this.moveState.moveRight&&(m+=h.x*c,u+=h.y*c,g+=h.z*c),this.moveState.moveLeft&&(m-=h.x*c,u-=h.y*c,g-=h.z*c),this.moveState.moveUp&&(m+=f.x*c,u+=f.y*c,g+=f.z*c),this.moveState.moveDown&&(m-=f.x*c,u-=f.y*c,g-=f.z*c),n.position=new e.Cartesian3(n.position.x+m,n.position.y+u,n.position.z+g)},t.clock.onTick.addEventListener(this._tickHandler),this.onSuccess&&this.onSuccess("视角漫游已启动")}closePlayer(){const e=this.cesium;this.model&&(this.model.show=!1),this.setCameralDefault(!0),this.handler&&(this.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_DOWN),this.handler.removeInputAction(e.ScreenSpaceEventType.MOUSE_MOVE),this.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_UP),this.handler.removeInputAction(e.ScreenSpaceEventType.WHEEL)),this._positionHandler&&(this._positionHandler.destroy(),this._positionHandler=null),this._keydownHandler&&document.removeEventListener("keydown",this._keydownHandler),this._keyupHandler&&document.removeEventListener("keyup",this._keyupHandler),this._tickHandler&&this.viewer.clock.onTick.removeEventListener(this._tickHandler),this.unbindUiKeys(),this.viewer.camera.lookAtTransform(e.Matrix4.IDENTITY),this.onLoading&&this.onLoading("")}setSpeed({speed:e}){this.speed=e/50}setParams({gravityTest:e,collisionTest:t,transparentTest:n}){e!==void 0&&(this.gravityTest=e),t!==void 0&&(this.collisionTest=t),n!==void 0&&(this.transparentTest=n)}setMoveState(e,t){this.moveState.hasOwnProperty(e)&&(this.moveState[e]=t,t?this.resumeAnimationFn&&this.resumeAnimationFn():Object.keys(this.moveState).every(n=>this.moveState[n]==!1)&&this.pauseAnimationFn&&this.pauseAnimationFn())}setCameralDefault(e){const t=this.viewer;t.scene.screenSpaceCameraController.enableRotate=e,t.scene.screenSpaceCameraController.enableTranslate=e,t.scene.screenSpaceCameraController.enableZoom=e,t.scene.screenSpaceCameraController.enableLook=e,t.scene.screenSpaceCameraController.enableTilt=e}}class h0{cesium;viewer;baseCesium;baseTiles;baseCompt;baseSection;basePlayer;constructor(e){this.cesium=e.cesium,this.viewer=e.viewer,this.baseCesium=new Fh(e),this.baseTiles=new Sl(e),this.baseCompt=new r0(e),this.baseSection=new l0(e),this.basePlayer=new d0({cesium:e.cesium,viewer:e.viewer,modelInfo:{url:e.options?.playerUrl,modelName:e.options?.playerModelName,modelId:e.options?.playerModelId,scale:e.options?.playerScale},callbacks:e.callbacks})}getCesium(){return this.cesium}getViewer(){return this.viewer}setSceneOptions(...e){this.baseCesium.setSceneOptions(...e)}getSnapDomSImageBase64(...e){return this.baseCesium.getSnapDomSImageBase64(...e)}clearBackground(){this.baseCesium.clearBackground()}enableTestLabel(){this.baseCesium.enableTestLabel()}enableCesiumFXAA(e){this.baseCesium.enableCesiumFXAA(e)}updateModelEffect(e){this.baseCesium.updateModelEffect(e)}addModels(...e){return this.baseTiles.addModels(...e)}}class u0{cesium;viewer;mapLayers={};renderGen={};renderGenAll=0;renderGenByModel={};modelId="default";options={flyTo:!0};dxfModelsList=[];open=!1;events=new Ki;showGlobal=!0;constructor({viewer:e,cesium:t}){this.viewer=e,this.cesium=t}getMapLayers(e){const t=typeof e=="object"?e?.modelId:e;return t?this.mapLayers[t]||{}:this.mapLayers}setModelId(e){this.modelId=e}getModelId(){return this.modelId}flyToCadModel(e={}){const t=e.modelId||this.modelId,n=this.dxfModelsList.find(s=>s.modelId===t);n&&this.flyToBounds(n)}setDxfOpen(e){this.open=e}getDxfOpen(){return this.open}getDxfModelsList(){return this.dxfModelsList}getDxfModels(e){const t=typeof e=="object"?e?.modelId:e;return t?this.dxfModelsList.find(n=>n.modelId===t):this.dxfModelsList}showJson({modelId:e,show:t}){this.mapLayers[e]&&Object.values(this.mapLayers[e]).forEach(s=>{s.forEach(o=>{o.primitive&&(o.primitive.show=t)})});const n=this.dxfModelsList.find(s=>s.modelId===e);n&&(n.show=t)}showJsonByLayer({modelId:e,show:t,layers:n}){const s=this.dxfModelsList.find(r=>r.modelId===e);if(!s){console.error("Tileset not found for modelId:",e);return}s.hiddenBatchIds||(s.hiddenBatchIds=new Set),s.layerMap&&Array.isArray(n)&&n.forEach(r=>{const l=s.layerMap[r];l!==void 0&&(t?s.hiddenBatchIds.delete(l):s.hiddenBatchIds.add(l))});const o=Array.from(s.hiddenBatchIds);if(o.length>0){const r=o.map(l=>`\${_BATCHID} !== ${l}`).join(" && ");s.style=new this.cesium.Cesium3DTileStyle({show:r})}else s.style=new this.cesium.Cesium3DTileStyle({show:!0});s.hasVisibilityListener||(s.hasVisibilityListener=!0,s.tileVisible.addEventListener(r=>{const l=r.content,c=l.featuresLength;if(c>0&&s.hiddenBatchIds)for(let d=0;d<c;d++)s.hiddenBatchIds.has(d)?l.getFeature(d).show=!1:l.getFeature(d).show=!0}))}flyToBounds(e,t){const n=this.cesium,s=e.boundingSphere?.radius||1e3,o={offset:new n.HeadingPitchRange(0,n.Math.toRadians(-90),s*2),...t},r=o.duration??0;e&&this.viewer.flyTo(e,{duration:r,offset:o.offset})}async loadModelFile(e){try{if(!e||typeof e!="string")return!1;const t=await fetch(e,{cache:"no-store"});if(!t.ok)throw new Error(`HTTP ${t.status} for ${e}`);if(e.endsWith(".json")||t.headers.get("content-type")?.includes("application/json"))return await t.json();const n=await t.blob(),s=new Io(new Kn(n),{password:Il,useWebWorkers:!1}),r=(await s.getEntries()).find(d=>!d.directory&&d.filename.endsWith(".json"));if(!r)return console.error("未找到 JSON 文件"),await s.close(),!1;const l=await r.arrayBuffer({useWebWorkers:!1});await s.close();const c=new TextDecoder().decode(l);return JSON.parse(c.trim())}catch(t){return console.error("解压或获取失败:",t),!1}}getBaseUrlPath(e){const t=e.lastIndexOf("/");return t===-1?".":e.substring(0,t)}async loadTilesetWithZipSupport(e,t){const n=this.getBaseUrlPath(e),s=encodeURI(`${n}/tileset.zip`);try{if((await fetch(s,{method:"HEAD"})).status===200){const r=await this.loadModelFile(s);if(r){const l=h=>{!h||typeof h!="object"||(typeof h.uri=="string"&&!/^(data:|https?:\/\/)/i.test(h.uri)&&(h.uri=encodeURI(`${n}/${h.uri.replace(/^\.?\//,"")}`)),Object.values(h).forEach(f=>{if(Array.isArray(f)){f.forEach(m=>l(m));return}f&&typeof f=="object"&&l(f)}))};l(r);const c=`data:text/plain;base64,${btoa(unescape(encodeURIComponent(JSON.stringify(r))))}`,d=new this.cesium.Resource({url:c});try{return await this.cesium.Cesium3DTileset.fromUrl(d,t)}catch{return await this.cesium.Cesium3DTileset.fromUrl(e,t)}}}}catch{}return await this.cesium.Cesium3DTileset.fromUrl(e,t)}async addDxfModel({fileNames:e,options:t}){const n=this.renderGenAll;if(e?.length){for(const s of e){if(this.renderGenAll!==n)return;const o=this.renderGenByModel[s.modelId]||0;if((this.renderGenByModel[s.modelId]||0)!==o||~this.dxfModelsList.findIndex(d=>d.modelId===s.modelId))return;/^https?:\/\//i.test(s.outPutPath)||(s.outPutPath=`${window.location.origin}${s.outPutPath}`);const l=`${s.outPutPath}${s.dbName}/tileset.json`,c={...this.options,...t};try{const d=`${s.outPutPath}${s.dbName}/layerInfo.zip`,h=await this.loadModelFile(d);if(this.renderGenAll!==n||(this.renderGenByModel[s.modelId]||0)!==o)return;const f=await this.loadTilesetWithZipSupport(l,{allowPicking:!1,clampToTerrain:!0});if(f.maximumScreenSpaceError=0,this.renderGenAll!==n||(this.renderGenByModel[s.modelId]||0)!==o)return;if(Object.assign(f,{modelId:s.modelId,modelName:s.modelName,deltaLatitude:s.deltaLatitude||0,deltaLongitude:s.deltaLongitude||0,relocated:!0,dbName:s.dbName,outPutPath:s.outPutPath,totalRotation:s.totalRotation||0,layerInfo:h}),s.formData?f.formData=s.formData:f.formData={modelId:f.modelId,longitude:f.deltaLongitude,latitude:f.deltaLatitude,distance:1e-6,rotation:0,totalRotation:f.totalRotation,heightDistance:1,height:0,lonlat:1e-6,modelOptions:[{value:f.modelId,label:f.modelName}],selectPoint:{longitude:0,latitude:0,height:0},selectedMode:!1,X:0,Y:0,Z:0},this.adjustingModelByCad({...f.formData,tileset:f}),Array.isArray(h)){const m=h;f.layerMap={};let u=this.mapLayers[s.modelId];u||(u={},this.mapLayers[s.modelId]=u),m.forEach(g=>{f.layerMap[g.layerName]=g.batchId,u[g.layerName]||(u[g.layerName]=[]),u[g.layerName].push({batchId:g.batchId,color:g.layerColor})})}if(this.dxfModelsList.push(f),this.setModelId(s.modelId),this.viewer.scene.primitives.add(f),this.renderGenAll!==n||(this.renderGenByModel[s.modelId]||0)!==o)return;c.flyTo&&this.flyToBounds(f),c.onSuccess&&c.onSuccess(f)}catch(d){console.error(`Failed to load tileset or layer info: ${l}`,d)}}this.events.emit("mountAllCad",this.dxfModelsList)}}adjustingModelByCad(e){const t=this.cesium,n=t.Quaternion.fromAxisAngle(t.Cartesian3.UNIT_Z,t.Math.toRadians(e.totalRotation)),s=t.Matrix4.fromRotationTranslation(t.Matrix3.fromQuaternion(n),new t.Cartesian3(0,0,0)),o=t.Cartesian3.fromDegrees(e.longitude,e.latitude,e.height),r=t.Transforms.eastNorthUpToFixedFrame(o);t.Matrix4.multiply(r,s,r),e.tileset?._root&&(e.tileset._root.transform=r)}deleteCad({modelId:e}){this.mapLayers[e]&&(Object.values(this.mapLayers[e]).forEach(n=>{n.forEach(s=>{this.viewer.scene.primitives.remove(s.primitive),s.primitive?.destroy()})}),delete this.mapLayers[e]),this.renderGen[e]=(this.renderGen[e]||0)+1,this.renderGenByModel[e]=(this.renderGenByModel[e]||0)+1;const t=this.dxfModelsList.findIndex(n=>n.modelId===e);if(t>-1){const n=this.dxfModelsList[t];this.viewer.scene.primitives.remove(n),n.destroy&&!n.isDestroyed()&&n.destroy(),this.dxfModelsList.splice(t,1)}}deleteAllCad(){Object.keys(this.mapLayers).forEach(e=>{this.deleteCad({modelId:e})}),[...this.dxfModelsList].forEach(e=>{e.modelId&&this.deleteCad({modelId:e.modelId})})}}function f0(i){i("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),i("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),i("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 e=1;e<=60;++e)i("EPSG:"+(32600+e),"+proj=utm +zone="+e+" +datum=WGS84 +units=m"),i("EPSG:"+(32700+e),"+proj=utm +zone="+e+" +south +datum=WGS84 +units=m");i("EPSG:5041","+title=WGS 84 / UPS North (E,N) +proj=stere +lat_0=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),i("EPSG:5042","+title=WGS 84 / UPS South (E,N) +proj=stere +lat_0=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),i.WGS84=i["EPSG:4326"],i["EPSG:3785"]=i["EPSG:3857"],i.GOOGLE=i["EPSG:3857"],i["EPSG:900913"]=i["EPSG:3857"],i["EPSG:102113"]=i["EPSG:3857"]}var ei=1,ti=2,Ci=3,m0=4,_o=5,Tl=6378137,g0=6356752314e-3,Pl=.0066943799901413165,Xi=484813681109536e-20,j=Math.PI/2,p0=.16666666666666666,A0=.04722222222222222,y0=.022156084656084655,K=1e-10,xe=.017453292519943295,$e=57.29577951308232,ue=Math.PI/4,Ji=Math.PI*2,Me=3.14159265359,Ke={};Ke.greenwich=0,Ke.lisbon=-9.131906111111,Ke.paris=2.337229166667,Ke.bogota=-74.080916666667,Ke.madrid=-3.687938888889,Ke.rome=12.452333333333,Ke.bern=7.439583333333,Ke.jakarta=106.807719444444,Ke.ferro=-17.666666666667,Ke.brussels=4.367975,Ke.stockholm=18.058277777778,Ke.athens=23.7163375,Ke.oslo=10.722916666667;const E0={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 _l=/[\s_\-\/\(\)]/g;function Nt(i,e){if(i[e])return i[e];for(var t=Object.keys(i),n=e.toLowerCase().replace(_l,""),s=-1,o,r;++s<t.length;)if(o=t[s],r=o.toLowerCase().replace(_l,""),r===n)return i[o]}function Do(i){var e={},t=i.split("+").map(function(l){return l.trim()}).filter(function(l){return l}).reduce(function(l,c){var d=c.split("=");return d.push(!0),l[d[0].toLowerCase()]=d[1],l},{}),n,s,o,r={proj:"projName",datum:"datumCode",rf:function(l){e.rf=parseFloat(l)},lat_0:function(l){e.lat0=l*xe},lat_1:function(l){e.lat1=l*xe},lat_2:function(l){e.lat2=l*xe},lat_ts:function(l){e.lat_ts=l*xe},lon_0:function(l){e.long0=l*xe},lon_1:function(l){e.long1=l*xe},lon_2:function(l){e.long2=l*xe},alpha:function(l){e.alpha=parseFloat(l)*xe},gamma:function(l){e.rectified_grid_angle=parseFloat(l)*xe},lonc:function(l){e.longc=l*xe},x_0:function(l){e.x0=parseFloat(l)},y_0:function(l){e.y0=parseFloat(l)},k_0:function(l){e.k0=parseFloat(l)},k:function(l){e.k0=parseFloat(l)},a:function(l){e.a=parseFloat(l)},b:function(l){e.b=parseFloat(l)},r:function(l){e.a=e.b=parseFloat(l)},r_a:function(){e.R_A=!0},zone:function(l){e.zone=parseInt(l,10)},south:function(){e.utmSouth=!0},towgs84:function(l){e.datum_params=l.split(",").map(function(c){return parseFloat(c)})},to_meter:function(l){e.to_meter=parseFloat(l)},units:function(l){e.units=l;var c=Nt(E0,l);c&&(e.to_meter=c.to_meter)},from_greenwich:function(l){e.from_greenwich=l*xe},pm:function(l){var c=Nt(Ke,l);e.from_greenwich=(c||parseFloat(l))*xe},nadgrids:function(l){l==="@null"?e.datumCode="none":e.nadgrids=l},axis:function(l){var c="ewnsud";l.length===3&&c.indexOf(l.substr(0,1))!==-1&&c.indexOf(l.substr(1,1))!==-1&&c.indexOf(l.substr(2,1))!==-1&&(e.axis=l)},approx:function(){e.approx=!0},over:function(){e.over=!0}};for(n in t)s=t[n],n in r?(o=r[n],typeof o=="function"?o(s):e[o]=s):e[n]=s;return typeof e.datumCode=="string"&&e.datumCode!=="WGS84"&&(e.datumCode=e.datumCode.toLowerCase()),e.projStr=i,e}class Dl{static getId(e){const t=e.find(n=>Array.isArray(n)&&n[0]==="ID");return t&&t.length>=3?{authority:t[1],code:parseInt(t[2],10)}:null}static convertUnit(e,t="unit"){if(!e||e.length<3)return{type:t,name:"unknown",conversion_factor:null};const n=e[1],s=parseFloat(e[2])||null,o=e.find(l=>Array.isArray(l)&&l[0]==="ID"),r=o?{authority:o[1],code:parseInt(o[2],10)}:null;return{type:t,name:n,conversion_factor:s,id:r}}static convertAxis(e){const t=e[1]||"Unknown";let n;const s=t.match(/^\((.)\)$/);if(s){const d=s[1].toUpperCase();if(d==="E")n="east";else if(d==="N")n="north";else if(d==="U")n="up";else throw new Error(`Unknown axis abbreviation: ${d}`)}else n=e[2]?e[2].toLowerCase():"unknown";const o=e.find(d=>Array.isArray(d)&&d[0]==="ORDER"),r=o?parseInt(o[1],10):null,l=e.find(d=>Array.isArray(d)&&(d[0]==="LENGTHUNIT"||d[0]==="ANGLEUNIT"||d[0]==="SCALEUNIT")),c=this.convertUnit(l);return{name:t,direction:n,unit:c,order:r}}static extractAxes(e){return e.filter(t=>Array.isArray(t)&&t[0]==="AXIS").map(t=>this.convertAxis(t)).sort((t,n)=>(t.order||0)-(n.order||0))}static convert(e,t={}){switch(e[0]){case"PROJCRS":t.type="ProjectedCRS",t.name=e[1],t.base_crs=e.find(m=>Array.isArray(m)&&m[0]==="BASEGEOGCRS")?this.convert(e.find(m=>Array.isArray(m)&&m[0]==="BASEGEOGCRS")):null,t.conversion=e.find(m=>Array.isArray(m)&&m[0]==="CONVERSION")?this.convert(e.find(m=>Array.isArray(m)&&m[0]==="CONVERSION")):null;const n=e.find(m=>Array.isArray(m)&&m[0]==="CS");n&&(t.coordinate_system={type:n[1],axis:this.extractAxes(e)});const s=e.find(m=>Array.isArray(m)&&m[0]==="LENGTHUNIT");if(s){const m=this.convertUnit(s);t.coordinate_system.unit=m}t.id=this.getId(e);break;case"BASEGEOGCRS":case"GEOGCRS":t.type="GeographicCRS",t.name=e[1];const o=e.find(m=>Array.isArray(m)&&(m[0]==="DATUM"||m[0]==="ENSEMBLE"));if(o){const m=this.convert(o);o[0]==="ENSEMBLE"?t.datum_ensemble=m:t.datum=m;const u=e.find(g=>Array.isArray(g)&&g[0]==="PRIMEM");u&&u[1]!=="Greenwich"&&(m.prime_meridian={name:u[1],longitude:parseFloat(u[2])})}t.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(e)},t.id=this.getId(e);break;case"DATUM":t.type="GeodeticReferenceFrame",t.name=e[1],t.ellipsoid=e.find(m=>Array.isArray(m)&&m[0]==="ELLIPSOID")?this.convert(e.find(m=>Array.isArray(m)&&m[0]==="ELLIPSOID")):null;break;case"ENSEMBLE":t.type="DatumEnsemble",t.name=e[1],t.members=e.filter(m=>Array.isArray(m)&&m[0]==="MEMBER").map(m=>({type:"DatumEnsembleMember",name:m[1],id:this.getId(m)}));const r=e.find(m=>Array.isArray(m)&&m[0]==="ENSEMBLEACCURACY");r&&(t.accuracy=parseFloat(r[1]));const l=e.find(m=>Array.isArray(m)&&m[0]==="ELLIPSOID");l&&(t.ellipsoid=this.convert(l)),t.id=this.getId(e);break;case"ELLIPSOID":t.type="Ellipsoid",t.name=e[1],t.semi_major_axis=parseFloat(e[2]),t.inverse_flattening=parseFloat(e[3]),e.find(m=>Array.isArray(m)&&m[0]==="LENGTHUNIT")&&this.convert(e.find(m=>Array.isArray(m)&&m[0]==="LENGTHUNIT"),t);break;case"CONVERSION":t.type="Conversion",t.name=e[1],t.method=e.find(m=>Array.isArray(m)&&m[0]==="METHOD")?this.convert(e.find(m=>Array.isArray(m)&&m[0]==="METHOD")):null,t.parameters=e.filter(m=>Array.isArray(m)&&m[0]==="PARAMETER").map(m=>this.convert(m));break;case"METHOD":t.type="Method",t.name=e[1],t.id=this.getId(e);break;case"PARAMETER":t.type="Parameter",t.name=e[1],t.value=parseFloat(e[2]),t.unit=this.convertUnit(e.find(m=>Array.isArray(m)&&(m[0]==="LENGTHUNIT"||m[0]==="ANGLEUNIT"||m[0]==="SCALEUNIT"))),t.id=this.getId(e);break;case"BOUNDCRS":t.type="BoundCRS";const c=e.find(m=>Array.isArray(m)&&m[0]==="SOURCECRS");if(c){const m=c.find(u=>Array.isArray(u));t.source_crs=m?this.convert(m):null}const d=e.find(m=>Array.isArray(m)&&m[0]==="TARGETCRS");if(d){const m=d.find(u=>Array.isArray(u));t.target_crs=m?this.convert(m):null}const h=e.find(m=>Array.isArray(m)&&m[0]==="ABRIDGEDTRANSFORMATION");h?t.transformation=this.convert(h):t.transformation=null;break;case"ABRIDGEDTRANSFORMATION":if(t.type="Transformation",t.name=e[1],t.method=e.find(m=>Array.isArray(m)&&m[0]==="METHOD")?this.convert(e.find(m=>Array.isArray(m)&&m[0]==="METHOD")):null,t.parameters=e.filter(m=>Array.isArray(m)&&(m[0]==="PARAMETER"||m[0]==="PARAMETERFILE")).map(m=>{if(m[0]==="PARAMETER")return this.convert(m);if(m[0]==="PARAMETERFILE")return{name:m[1],value:m[2],id:{authority:"EPSG",code:8656}}}),t.parameters.length===7){const m=t.parameters[6];m.name==="Scale difference"&&(m.value=Math.round((m.value-1)*1e12)/1e6)}t.id=this.getId(e);break;case"AXIS":t.coordinate_system||(t.coordinate_system={type:"unspecified",axis:[]}),t.coordinate_system.axis.push(this.convertAxis(e));break;case"LENGTHUNIT":const f=this.convertUnit(e,"LinearUnit");t.coordinate_system&&t.coordinate_system.axis&&t.coordinate_system.axis.forEach(m=>{m.unit||(m.unit=f)}),f.conversion_factor&&f.conversion_factor!==1&&t.semi_major_axis&&(t.semi_major_axis={value:t.semi_major_axis,unit:f});break;default:t.keyword=e[0];break}return t}}class C0 extends Dl{static convert(e,t={}){return super.convert(e,t),t.coordinate_system&&t.coordinate_system.subtype==="Cartesian"&&delete t.coordinate_system,t.usage&&delete t.usage,t}}class v0 extends Dl{static convert(e,t={}){super.convert(e,t);const n=e.find(o=>Array.isArray(o)&&o[0]==="CS");n&&(t.coordinate_system={subtype:n[1],axis:this.extractAxes(e)});const s=e.find(o=>Array.isArray(o)&&o[0]==="USAGE");if(s){const o=s.find(c=>Array.isArray(c)&&c[0]==="SCOPE"),r=s.find(c=>Array.isArray(c)&&c[0]==="AREA"),l=s.find(c=>Array.isArray(c)&&c[0]==="BBOX");t.usage={},o&&(t.usage.scope=o[1]),r&&(t.usage.area=r[1]),l&&(t.usage.bbox=l.slice(1))}return t}}function b0(i){return i.find(e=>Array.isArray(e)&&e[0]==="USAGE")?"2019":(i.find(e=>Array.isArray(e)&&e[0]==="CS")||i[0]==="BOUNDCRS"||i[0]==="PROJCRS"||i[0]==="GEOGCRS","2015")}function w0(i){return(b0(i)==="2019"?v0:C0).convert(i)}function I0(i){const e=i.toUpperCase();return e.includes("PROJCRS")||e.includes("GEOGCRS")||e.includes("BOUNDCRS")||e.includes("VERTCRS")||e.includes("LENGTHUNIT")||e.includes("ANGLEUNIT")||e.includes("SCALEUNIT")?"WKT2":(e.includes("PROJCS")||e.includes("GEOGCS")||e.includes("LOCAL_CS")||e.includes("VERT_CS")||e.includes("UNIT"),"WKT1")}var Zi=1,kl=2,Nl=3,Jn=4,Rl=5,ko=-1,S0=/\s/,x0=/[A-Za-z]/,M0=/[A-Za-z84_]/,Zn=/[,\]]/,Fl=/[\d\.E\-\+]/;function xt(i){if(typeof i!="string")throw new Error("not a string");this.text=i.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=Zi}xt.prototype.readCharicter=function(){var i=this.text[this.place++];if(this.state!==Jn)for(;S0.test(i);){if(this.place>=this.text.length)return;i=this.text[this.place++]}switch(this.state){case Zi:return this.neutral(i);case kl:return this.keyword(i);case Jn:return this.quoted(i);case Rl:return this.afterquote(i);case Nl:return this.number(i);case ko:return}},xt.prototype.afterquote=function(i){if(i==='"'){this.word+='"',this.state=Jn;return}if(Zn.test(i)){this.word=this.word.trim(),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in afterquote yet, index '+this.place)},xt.prototype.afterItem=function(i){if(i===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=Zi;return}if(i==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=Zi,this.currentObject=this.stack.pop(),this.currentObject||(this.state=ko);return}},xt.prototype.number=function(i){if(Fl.test(i)){this.word+=i;return}if(Zn.test(i)){this.word=parseFloat(this.word),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in number yet, index '+this.place)},xt.prototype.quoted=function(i){if(i==='"'){this.state=Rl;return}this.word+=i},xt.prototype.keyword=function(i){if(M0.test(i)){this.word+=i;return}if(i==="["){var e=[];e.push(this.word),this.level++,this.root===null?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,this.state=Zi;return}if(Zn.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in keyword yet, index '+this.place)},xt.prototype.neutral=function(i){if(x0.test(i)){this.word=i,this.state=kl;return}if(i==='"'){this.word="",this.state=Jn;return}if(Fl.test(i)){this.word=i,this.state=Nl;return}if(Zn.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in neutral yet, index '+this.place)},xt.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===ko)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function B0(i){var e=new xt(i);return e.output()}function No(i,e,t){Array.isArray(e)&&(t.unshift(e),e=null);var n=e?{}:i,s=t.reduce(function(o,r){return vi(r,o),o},n);e&&(i[e]=s)}function vi(i,e){if(!Array.isArray(i)){e[i]=!0;return}var t=i.shift();if(t==="PARAMETER"&&(t=i.shift()),i.length===1){if(Array.isArray(i[0])){e[t]={},vi(i[0],e[t]);return}e[t]=i[0];return}if(!i.length){e[t]=!0;return}if(t==="TOWGS84"){e[t]=i;return}if(t==="AXIS"){t in e||(e[t]=[]),e[t].push(i);return}Array.isArray(t)||(e[t]={});var n;switch(t){case"UNIT":case"PRIMEM":case"VERT_DATUM":e[t]={name:i[0].toLowerCase(),convert:i[1]},i.length===3&&vi(i[2],e[t]);return;case"SPHEROID":case"ELLIPSOID":e[t]={name:i[0],a:i[1],rf:i[2]},i.length===4&&vi(i[3],e[t]);return;case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":i[0]=["name",i[0]],No(e,t,i);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":i[0]=["name",i[0]],No(e,t,i),e[t].type=t;return;default:for(n=-1;++n<i.length;)if(!Array.isArray(i[n]))return vi(i,e[t]);return No(e,t,i)}}var T0=.017453292519943295;function lt(i){return i*T0}function Ll(i){const e=(i.projName||"").toLowerCase().replace(/_/g," ");!i.long0&&i.longc&&(e==="albers conic equal area"||e==="lambert azimuthal equal area")&&(i.long0=i.longc),!i.lat_ts&&i.lat1&&(e==="stereographic south pole"||e==="polar stereographic (variant b)")?(i.lat0=lt(i.lat1>0?90:-90),i.lat_ts=i.lat1,delete i.lat1):!i.lat_ts&&i.lat0&&(e==="polar stereographic"||e==="polar stereographic (variant a)")&&(i.lat_ts=i.lat0,i.lat0=lt(i.lat0>0?90:-90),delete i.lat1)}function Ol(i){let e={units:null,to_meter:void 0};return typeof i=="string"?(e.units=i.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.units==="meter"&&(e.to_meter=1)):i&&i.name&&(e.units=i.name.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.to_meter=i.conversion_factor),e}function Gl(i){return typeof i=="object"?i.value*i.unit.conversion_factor:i}function Ul(i,e){i.ellipsoid.radius?(e.a=i.ellipsoid.radius,e.rf=0):(e.a=Gl(i.ellipsoid.semi_major_axis),i.ellipsoid.inverse_flattening!==void 0?e.rf=i.ellipsoid.inverse_flattening:i.ellipsoid.semi_major_axis!==void 0&&i.ellipsoid.semi_minor_axis!==void 0&&(e.rf=e.a/(e.a-Gl(i.ellipsoid.semi_minor_axis))))}function es(i,e={}){return!i||typeof i!="object"?i:i.type==="BoundCRS"?(es(i.source_crs,e),i.transformation&&(i.transformation.method&&i.transformation.method.name==="NTv2"?e.nadgrids=i.transformation.parameters[0].value:e.datum_params=i.transformation.parameters.map(t=>t.value)),e):(Object.keys(i).forEach(t=>{const n=i[t];if(n!==null)switch(t){case"name":if(e.srsCode)break;e.name=n,e.srsCode=n;break;case"type":n==="GeographicCRS"?e.projName="longlat":n==="ProjectedCRS"&&i.conversion&&i.conversion.method&&(e.projName=i.conversion.method.name);break;case"datum":case"datum_ensemble":n.ellipsoid&&(e.ellps=n.ellipsoid.name,Ul(n,e)),n.prime_meridian&&(e.from_greenwich=n.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":e.ellps=n.name,Ul(n,e);break;case"prime_meridian":e.long0=(n.longitude||0)*Math.PI/180;break;case"coordinate_system":if(n.axis){if(e.axis=n.axis.map(s=>{const o=s.direction;if(o==="east")return"e";if(o==="north")return"n";if(o==="west")return"w";if(o==="south")return"s";throw new Error(`Unknown axis direction: ${o}`)}).join("")+"u",n.unit){const{units:s,to_meter:o}=Ol(n.unit);e.units=s,e.to_meter=o}else if(n.axis[0]&&n.axis[0].unit){const{units:s,to_meter:o}=Ol(n.axis[0].unit);e.units=s,e.to_meter=o}}break;case"id":n.authority&&n.code&&(e.title=n.authority+":"+n.code);break;case"conversion":n.method&&n.method.name&&(e.projName=n.method.name),n.parameters&&n.parameters.forEach(s=>{const o=s.name.toLowerCase().replace(/\s+/g,"_"),r=s.value;s.unit&&s.unit.conversion_factor?e[o]=r*s.unit.conversion_factor:s.unit==="degree"?e[o]=r*Math.PI/180:e[o]=r});break;case"unit":n.name&&(e.units=n.name.toLowerCase(),e.units==="metre"&&(e.units="meter")),n.conversion_factor&&(e.to_meter=n.conversion_factor);break;case"base_crs":es(n,e),e.datumCode=n.id?n.id.authority+"_"+n.id.code:n.name;break}}),e.latitude_of_false_origin!==void 0&&(e.lat0=e.latitude_of_false_origin),e.longitude_of_false_origin!==void 0&&(e.long0=e.longitude_of_false_origin),e.latitude_of_standard_parallel!==void 0&&(e.lat0=e.latitude_of_standard_parallel,e.lat1=e.latitude_of_standard_parallel),e.latitude_of_1st_standard_parallel!==void 0&&(e.lat1=e.latitude_of_1st_standard_parallel),e.latitude_of_2nd_standard_parallel!==void 0&&(e.lat2=e.latitude_of_2nd_standard_parallel),e.latitude_of_projection_centre!==void 0&&(e.lat0=e.latitude_of_projection_centre),e.longitude_of_projection_centre!==void 0&&(e.longc=e.longitude_of_projection_centre),e.easting_at_false_origin!==void 0&&(e.x0=e.easting_at_false_origin),e.northing_at_false_origin!==void 0&&(e.y0=e.northing_at_false_origin),e.latitude_of_natural_origin!==void 0&&(e.lat0=e.latitude_of_natural_origin),e.longitude_of_natural_origin!==void 0&&(e.long0=e.longitude_of_natural_origin),e.longitude_of_origin!==void 0&&(e.long0=e.longitude_of_origin),e.false_easting!==void 0&&(e.x0=e.false_easting),e.easting_at_projection_centre&&(e.x0=e.easting_at_projection_centre),e.false_northing!==void 0&&(e.y0=e.false_northing),e.northing_at_projection_centre&&(e.y0=e.northing_at_projection_centre),e.standard_parallel_1!==void 0&&(e.lat1=e.standard_parallel_1),e.standard_parallel_2!==void 0&&(e.lat2=e.standard_parallel_2),e.scale_factor_at_natural_origin!==void 0&&(e.k0=e.scale_factor_at_natural_origin),e.scale_factor_at_projection_centre!==void 0&&(e.k0=e.scale_factor_at_projection_centre),e.scale_factor_on_pseudo_standard_parallel!==void 0&&(e.k0=e.scale_factor_on_pseudo_standard_parallel),e.azimuth!==void 0&&(e.alpha=e.azimuth),e.azimuth_at_projection_centre!==void 0&&(e.alpha=e.azimuth_at_projection_centre),e.angle_from_rectified_to_skew_grid&&(e.rectified_grid_angle=e.angle_from_rectified_to_skew_grid),Ll(e),e)}var P0=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function _0(i,e){var t=e[0],n=e[1];!(t in i)&&n in i&&(i[t]=i[n],e.length===3&&(i[t]=e[2](i[t])))}function Vl(i){for(var e=Object.keys(i),t=0,n=e.length;t<n;++t){var s=e[t];P0.indexOf(s)!==-1&&D0(i[s]),typeof i[s]=="object"&&Vl(i[s])}}function D0(i){if(i.AUTHORITY){var e=Object.keys(i.AUTHORITY)[0];e&&e in i.AUTHORITY&&(i.title=e+":"+i.AUTHORITY[e])}if(i.type==="GEOGCS"?i.projName="longlat":i.type==="LOCAL_CS"?(i.projName="identity",i.local=!0):typeof i.PROJECTION=="object"?i.projName=Object.keys(i.PROJECTION)[0]:i.projName=i.PROJECTION,i.AXIS){for(var t="",n=0,s=i.AXIS.length;n<s;++n){var o=[i.AXIS[n][0].toLowerCase(),i.AXIS[n][1].toLowerCase()];o[0].indexOf("north")!==-1||(o[0]==="y"||o[0]==="lat")&&o[1]==="north"?t+="n":o[0].indexOf("south")!==-1||(o[0]==="y"||o[0]==="lat")&&o[1]==="south"?t+="s":o[0].indexOf("east")!==-1||(o[0]==="x"||o[0]==="lon")&&o[1]==="east"?t+="e":(o[0].indexOf("west")!==-1||(o[0]==="x"||o[0]==="lon")&&o[1]==="west")&&(t+="w")}t.length===2&&(t+="u"),t.length===3&&(i.axis=t)}i.UNIT&&(i.units=i.UNIT.name.toLowerCase(),i.units==="metre"&&(i.units="meter"),i.UNIT.convert&&(i.type==="GEOGCS"?i.DATUM&&i.DATUM.SPHEROID&&(i.to_meter=i.UNIT.convert*i.DATUM.SPHEROID.a):i.to_meter=i.UNIT.convert));var r=i.GEOGCS;i.type==="GEOGCS"&&(r=i),r&&(r.DATUM?i.datumCode=r.DATUM.name.toLowerCase():i.datumCode=r.name.toLowerCase(),i.datumCode.slice(0,2)==="d_"&&(i.datumCode=i.datumCode.slice(2)),i.datumCode==="new_zealand_1949"&&(i.datumCode="nzgd49"),(i.datumCode==="wgs_1984"||i.datumCode==="world_geodetic_system_1984")&&(i.PROJECTION==="Mercator_Auxiliary_Sphere"&&(i.sphere=!0),i.datumCode="wgs84"),i.datumCode==="belge_1972"&&(i.datumCode="rnb72"),r.DATUM&&r.DATUM.SPHEROID&&(i.ellps=r.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),i.ellps.toLowerCase().slice(0,13)==="international"&&(i.ellps="intl"),i.a=r.DATUM.SPHEROID.a,i.rf=parseFloat(r.DATUM.SPHEROID.rf,10)),r.DATUM&&r.DATUM.TOWGS84&&(i.datum_params=r.DATUM.TOWGS84),~i.datumCode.indexOf("osgb_1936")&&(i.datumCode="osgb36"),~i.datumCode.indexOf("osni_1952")&&(i.datumCode="osni52"),(~i.datumCode.indexOf("tm65")||~i.datumCode.indexOf("geodetic_datum_of_1965"))&&(i.datumCode="ire65"),i.datumCode==="ch1903+"&&(i.datumCode="ch1903"),~i.datumCode.indexOf("israel")&&(i.datumCode="isr93")),i.b&&!isFinite(i.b)&&(i.b=i.a),i.rectified_grid_angle&&(i.rectified_grid_angle=lt(i.rectified_grid_angle));function l(h){var f=i.to_meter||1;return h*f}var c=function(h){return _0(i,h)},d=[["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",lt],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",lt],["x0","false_easting",l],["y0","false_northing",l],["long0","central_meridian",lt],["lat0","latitude_of_origin",lt],["lat0","standard_parallel_1",lt],["lat1","standard_parallel_1",lt],["lat2","standard_parallel_2",lt],["azimuth","Azimuth"],["alpha","azimuth",lt],["srsCode","name"]];d.forEach(c),Ll(i)}function ts(i){if(typeof i=="object")return es(i);const e=I0(i);var t=B0(i);if(e==="WKT2"){const o=w0(t);return es(o)}var n=t[0],s={};return vi(t,s),Vl(s),s[n]}function Ge(i){var e=this;if(arguments.length===2){var t=arguments[1];typeof t=="string"?t.charAt(0)==="+"?Ge[i]=Do(arguments[1]):Ge[i]=ts(arguments[1]):t&&typeof t=="object"&&!("projName"in t)?Ge[i]=ts(arguments[1]):(Ge[i]=t,t||delete Ge[i])}else if(arguments.length===1){if(Array.isArray(i))return i.map(function(n){return Array.isArray(n)?Ge.apply(e,n):Ge(n)});if(typeof i=="string"){if(i in Ge)return Ge[i]}else"EPSG"in i?Ge["EPSG:"+i.EPSG]=i:"ESRI"in i?Ge["ESRI:"+i.ESRI]=i:"IAU2000"in i?Ge["IAU2000:"+i.IAU2000]=i:console.log(i);return}}f0(Ge);function k0(i){return typeof i=="string"}function N0(i){return i in Ge}function R0(i){return i.indexOf("+")!==0&&i.indexOf("[")!==-1||typeof i=="object"&&!("srsCode"in i)}var F0=["3857","900913","3785","102113"];function L0(i){var e=Nt(i,"authority");if(e){var t=Nt(e,"epsg");return t&&F0.indexOf(t)>-1}}function O0(i){var e=Nt(i,"extension");if(e)return Nt(e,"proj4")}function G0(i){return i[0]==="+"}function U0(i){if(k0(i)){if(N0(i))return Ge[i];if(R0(i)){var e=ts(i);if(L0(e))return Ge["EPSG:3857"];var t=O0(e);return t?Do(t):e}if(G0(i))return Do(i)}else return"projName"in i?i:ts(i)}function Ql(i,e){i=i||{};var t,n;if(!e)return i;for(n in e)t=e[n],t!==void 0&&(i[n]=t);return i}function Ct(i,e,t){var n=i*e;return t/Math.sqrt(1-n*n)}function en(i){return i<0?-1:1}function X(i,e){return e||Math.abs(i)<=Me?i:i-en(i)*Ji}function ct(i,e,t){var n=i*t,s=.5*i;return n=Math.pow((1-n)/(1+n),s),Math.tan(.5*(j-e))/n}function tn(i,e){for(var t=.5*i,n,s,o=j-2*Math.atan(e),r=0;r<=15;r++)if(n=i*Math.sin(o),s=j-2*Math.atan(e*Math.pow((1-n)/(1+n),t))-o,o+=s,Math.abs(s)<=1e-10)return o;return-9999}function V0(){var i=this.b/this.a;this.es=1-i*i,"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=Ct(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function Q0(i){var e=i.x,t=i.y;if(t*$e>90&&t*$e<-90&&e*$e>180&&e*$e<-180)return null;var n,s;if(Math.abs(Math.abs(t)-j)<=K)return null;if(this.sphere)n=this.x0+this.a*this.k0*X(e-this.long0,this.over),s=this.y0+this.a*this.k0*Math.log(Math.tan(ue+.5*t));else{var o=Math.sin(t),r=ct(this.e,t,o);n=this.x0+this.a*this.k0*X(e-this.long0,this.over),s=this.y0-this.a*this.k0*Math.log(r)}return i.x=n,i.y=s,i}function H0(i){var e=i.x-this.x0,t=i.y-this.y0,n,s;if(this.sphere)s=j-2*Math.atan(Math.exp(-t/(this.a*this.k0)));else{var o=Math.exp(-t/(this.a*this.k0));if(s=tn(this.e,o),s===-9999)return null}return n=X(this.long0+e/(this.a*this.k0),this.over),i.x=n,i.y=s,i}var Y0=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"];const z0={init:V0,forward:Q0,inverse:H0,names:Y0};function j0(){}function Hl(i){return i}var Yl=["longlat","identity"],W0=[z0,{init:j0,forward:Hl,inverse:Hl,names:Yl}],ii={},bi=[];function zl(i,e){var t=bi.length;return i.names?(bi[t]=i,i.names.forEach(function(n){ii[n.toLowerCase()]=t}),this):(console.log(e),!0)}function jl(i){return i.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}function $0(i){if(!i)return!1;var e=i.toLowerCase();if(typeof ii[e]<"u"&&bi[ii[e]]||(e=jl(e),e in ii&&bi[ii[e]]))return bi[ii[e]]}function K0(){W0.forEach(zl)}const q0={start:K0,add:zl,get:$0};var Wl={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 X0=Wl.WGS84;function J0(i,e,t,n){var s=i*i,o=e*e,r=(s-o)/s,l=0;n?(i*=1-r*(p0+r*(A0+r*y0)),s=i*i,r=0):l=Math.sqrt(r);var c=(s-o)/o;return{es:r,e:l,ep2:c}}function Z0(i,e,t,n,s){if(!i){var o=Nt(Wl,n);o||(o=X0),i=o.a,e=o.b,t=o.rf}return t&&!e&&(e=(1-1/t)*i),(t===0||Math.abs(i-e)<K)&&(s=!0,e=i),{a:i,b:e,rf:t,sphere:s}}var is={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 eA in is){var Ro=is[eA];Ro.datumName&&(is[Ro.datumName]=Ro)}function tA(i,e,t,n,s,o,r){var l={};return i===void 0||i==="none"?l.datum_type=_o:l.datum_type=m0,e&&(l.datum_params=e.map(parseFloat),(l.datum_params[0]!==0||l.datum_params[1]!==0||l.datum_params[2]!==0)&&(l.datum_type=ei),l.datum_params.length>3&&(l.datum_params[3]!==0||l.datum_params[4]!==0||l.datum_params[5]!==0||l.datum_params[6]!==0)&&(l.datum_type=ti,l.datum_params[3]*=Xi,l.datum_params[4]*=Xi,l.datum_params[5]*=Xi,l.datum_params[6]=l.datum_params[6]/1e6+1)),r&&(l.datum_type=Ci,l.grids=r),l.a=t,l.b=n,l.es=s,l.ep2=o,l}var Fo={};function iA(i,e,t){return e instanceof ArrayBuffer?nA(i,e,t):{ready:sA(i,e)}}function nA(i,e,t){var n=!0;t!==void 0&&t.includeErrorFields===!1&&(n=!1);var s=new DataView(e),o=rA(s),r=lA(s,o),l=cA(s,r,o,n),c={header:r,subgrids:l};return Fo[i]=c,c}async function sA(i,e){for(var t=[],n=await e.getImageCount(),s=n-1;s>=0;s--){var o=await e.getImage(s),r=await o.readRasters(),l=r,c=[o.getWidth(),o.getHeight()],d=o.getBoundingBox().map($l),h=[o.fileDirectory.ModelPixelScale[0],o.fileDirectory.ModelPixelScale[1]].map($l),f=d[0]+(c[0]-1)*h[0],m=d[3]-(c[1]-1)*h[1],u=l[0],g=l[1],A=[];for(let C=c[1]-1;C>=0;C--)for(let I=c[0]-1;I>=0;I--){var p=C*c[0]+I;A.push([-Rt(g[p]),Rt(u[p])])}t.push({del:h,lim:c,ll:[-f,m],cvs:A})}var y={header:{nSubgrids:n},subgrids:t};return Fo[i]=y,y}function oA(i){if(i===void 0)return null;var e=i.split(",");return e.map(aA)}function aA(i){if(i.length===0)return null;var e=i[0]==="@";return e&&(i=i.slice(1)),i==="null"?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:i,mandatory:!e,grid:Fo[i]||null,isNull:!1}}function $l(i){return i*Math.PI/180}function Rt(i){return i/3600*Math.PI/180}function rA(i){var e=i.getInt32(8,!1);return e===11?!1:(e=i.getInt32(8,!0),e!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function lA(i,e){return{nFields:i.getInt32(8,e),nSubgridFields:i.getInt32(24,e),nSubgrids:i.getInt32(40,e),shiftType:Lo(i,56,64).trim(),fromSemiMajorAxis:i.getFloat64(120,e),fromSemiMinorAxis:i.getFloat64(136,e),toSemiMajorAxis:i.getFloat64(152,e),toSemiMinorAxis:i.getFloat64(168,e)}}function Lo(i,e,t){return String.fromCharCode.apply(null,new Uint8Array(i.buffer.slice(e,t)))}function cA(i,e,t,n){for(var s=176,o=[],r=0;r<e.nSubgrids;r++){var l=hA(i,s,t),c=uA(i,s,l,t,n),d=Math.round(1+(l.upperLongitude-l.lowerLongitude)/l.longitudeInterval),h=Math.round(1+(l.upperLatitude-l.lowerLatitude)/l.latitudeInterval);o.push({ll:[Rt(l.lowerLongitude),Rt(l.lowerLatitude)],del:[Rt(l.longitudeInterval),Rt(l.latitudeInterval)],lim:[d,h],count:l.gridNodeCount,cvs:dA(c)});var f=16;n===!1&&(f=8),s+=176+l.gridNodeCount*f}return o}function dA(i){return i.map(function(e){return[Rt(e.longitudeShift),Rt(e.latitudeShift)]})}function hA(i,e,t){return{name:Lo(i,e+8,e+16).trim(),parent:Lo(i,e+24,e+24+8).trim(),lowerLatitude:i.getFloat64(e+72,t),upperLatitude:i.getFloat64(e+88,t),lowerLongitude:i.getFloat64(e+104,t),upperLongitude:i.getFloat64(e+120,t),latitudeInterval:i.getFloat64(e+136,t),longitudeInterval:i.getFloat64(e+152,t),gridNodeCount:i.getInt32(e+168,t)}}function uA(i,e,t,n,s){var o=e+176,r=16;s===!1&&(r=8);for(var l=[],c=0;c<t.gridNodeCount;c++){var d={latitudeShift:i.getFloat32(o+c*r,n),longitudeShift:i.getFloat32(o+c*r+4,n)};s!==!1&&(d.latitudeAccuracy=i.getFloat32(o+c*r+8,n),d.longitudeAccuracy=i.getFloat32(o+c*r+12,n)),l.push(d)}return l}function st(i,e){if(!(this instanceof st))return new st(i);this.forward=null,this.inverse=null,this.init=null,this.name,this.names=null,this.title,e=e||function(d){if(d)throw d};var t=U0(i);if(typeof t!="object"){e("Could not parse to valid json: "+i);return}var n=st.projections.get(t.projName);if(!n){e("Could not get projection name from: "+i);return}if(t.datumCode&&t.datumCode!=="none"){var s=Nt(is,t.datumCode);s&&(t.datum_params=t.datum_params||(s.towgs84?s.towgs84.split(","):null),t.ellps=s.ellipse,t.datumName=s.datumName?s.datumName:t.datumCode)}t.k0=t.k0||1,t.axis=t.axis||"enu",t.ellps=t.ellps||"wgs84",t.lat1=t.lat1||t.lat0;var o=Z0(t.a,t.b,t.rf,t.ellps,t.sphere),r=J0(o.a,o.b,o.rf,t.R_A),l=oA(t.nadgrids),c=t.datum||tA(t.datumCode,t.datum_params,o.a,o.b,r.es,r.ep2,l);Ql(this,t),Ql(this,n),this.a=o.a,this.b=o.b,this.rf=o.rf,this.sphere=o.sphere,this.es=r.es,this.e=r.e,this.ep2=r.ep2,this.datum=c,"init"in this&&typeof this.init=="function"&&this.init(),e(null,this)}st.projections=q0,st.projections.start();function fA(i,e){return i.datum_type!==e.datum_type||i.a!==e.a||Math.abs(i.es-e.es)>5e-11?!1:i.datum_type===ei?i.datum_params[0]===e.datum_params[0]&&i.datum_params[1]===e.datum_params[1]&&i.datum_params[2]===e.datum_params[2]:i.datum_type===ti?i.datum_params[0]===e.datum_params[0]&&i.datum_params[1]===e.datum_params[1]&&i.datum_params[2]===e.datum_params[2]&&i.datum_params[3]===e.datum_params[3]&&i.datum_params[4]===e.datum_params[4]&&i.datum_params[5]===e.datum_params[5]&&i.datum_params[6]===e.datum_params[6]:!0}function Kl(i,e,t){var n=i.x,s=i.y,o=i.z?i.z:0,r,l,c,d;if(s<-j&&s>-1.001*j)s=-j;else if(s>j&&s<1.001*j)s=j;else{if(s<-j)return{x:-1/0,y:-1/0,z:i.z};if(s>j)return{x:1/0,y:1/0,z:i.z}}return n>Math.PI&&(n-=2*Math.PI),l=Math.sin(s),d=Math.cos(s),c=l*l,r=t/Math.sqrt(1-e*c),{x:(r+o)*d*Math.cos(n),y:(r+o)*d*Math.sin(n),z:(r*(1-e)+o)*l}}function ql(i,e,t,n){var s=1e-12,o=s*s,r=30,l,c,d,h,f,m,u,g,A,p,y,C,I,P=i.x,k=i.y,M=i.z?i.z:0,B,_,E;if(l=Math.sqrt(P*P+k*k),c=Math.sqrt(P*P+k*k+M*M),l/t<s){if(B=0,c/t<s)return _=j,E=-n,{x:i.x,y:i.y,z:i.z}}else B=Math.atan2(k,P);d=M/c,h=l/c,f=1/Math.sqrt(1-e*(2-e)*h*h),g=h*(1-e)*f,A=d*f,I=0;do I++,u=t/Math.sqrt(1-e*A*A),E=l*g+M*A-u*(1-e*A*A),m=e*u/(u+E),f=1/Math.sqrt(1-m*(2-m)*h*h),p=h*(1-m)*f,y=d*f,C=y*g-p*A,g=p,A=y;while(C*C>o&&I<r);return _=Math.atan(y/Math.abs(p)),{x:B,y:_,z:E}}function mA(i,e,t){if(e===ei)return{x:i.x+t[0],y:i.y+t[1],z:i.z+t[2]};if(e===ti){var n=t[0],s=t[1],o=t[2],r=t[3],l=t[4],c=t[5],d=t[6];return{x:d*(i.x-c*i.y+l*i.z)+n,y:d*(c*i.x+i.y-r*i.z)+s,z:d*(-l*i.x+r*i.y+i.z)+o}}}function gA(i,e,t){if(e===ei)return{x:i.x-t[0],y:i.y-t[1],z:i.z-t[2]};if(e===ti){var n=t[0],s=t[1],o=t[2],r=t[3],l=t[4],c=t[5],d=t[6],h=(i.x-n)/d,f=(i.y-s)/d,m=(i.z-o)/d;return{x:h+c*f-l*m,y:-c*h+f+r*m,z:l*h-r*f+m}}}function ns(i){return i===ei||i===ti}function pA(i,e,t){if(fA(i,e)||i.datum_type===_o||e.datum_type===_o)return t;var n=i.a,s=i.es;if(i.datum_type===Ci){var o=Xl(i,!1,t);if(o!==0)return;n=Tl,s=Pl}var r=e.a,l=e.b,c=e.es;if(e.datum_type===Ci&&(r=Tl,l=g0,c=Pl),s===c&&n===r&&!ns(i.datum_type)&&!ns(e.datum_type))return t;if(t=Kl(t,s,n),ns(i.datum_type)&&(t=mA(t,i.datum_type,i.datum_params)),ns(e.datum_type)&&(t=gA(t,e.datum_type,e.datum_params)),t=ql(t,c,r,l),e.datum_type===Ci){var d=Xl(e,!0,t);if(d!==0)return}return t}function Xl(i,e,t){if(i.grids===null||i.grids.length===0)return console.log("Grid shift grids not found"),-1;var n={x:-t.x,y:t.y},s={x:Number.NaN,y:Number.NaN},o=[];e:for(var r=0;r<i.grids.length;r++){var l=i.grids[r];if(o.push(l.name),l.isNull){s=n;break}if(l.grid===null){if(l.mandatory)return console.log("Unable to find mandatory grid '"+l.name+"'"),-1;continue}for(var c=l.grid.subgrids,d=0,h=c.length;d<h;d++){var f=c[d],m=(Math.abs(f.del[1])+Math.abs(f.del[0]))/1e4,u=f.ll[0]-m,g=f.ll[1]-m,A=f.ll[0]+(f.lim[0]-1)*f.del[0]+m,p=f.ll[1]+(f.lim[1]-1)*f.del[1]+m;if(!(g>n.y||u>n.x||p<n.y||A<n.x)&&(s=AA(n,e,f),!isNaN(s.x)))break e}}return isNaN(s.x)?(console.log("Failed to find a grid shift table for location '"+-n.x*$e+" "+n.y*$e+" tried: '"+o+"'"),-1):(t.x=-s.x,t.y=s.y,0)}function AA(i,e,t){var n={x:Number.NaN,y:Number.NaN};if(isNaN(i.x))return n;var s={x:i.x,y:i.y};s.x-=t.ll[0],s.y-=t.ll[1],s.x=X(s.x-Math.PI)+Math.PI;var o=Jl(s,t);if(e){if(isNaN(o.x))return n;o.x=s.x-o.x,o.y=s.y-o.y;var r=9,l=1e-12,c,d;do{if(d=Jl(o,t),isNaN(d.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}c={x:s.x-(d.x+o.x),y:s.y-(d.y+o.y)},o.x+=c.x,o.y+=c.y}while(r--&&Math.abs(c.x)>l&&Math.abs(c.y)>l);if(r<0)return console.log("Inverse grid shift iterator failed to converge."),n;n.x=X(o.x+t.ll[0]),n.y=o.y+t.ll[1]}else isNaN(o.x)||(n.x=i.x+o.x,n.y=i.y+o.y);return n}function Jl(i,e){var t={x:i.x/e.del[0],y:i.y/e.del[1]},n={x:Math.floor(t.x),y:Math.floor(t.y)},s={x:t.x-1*n.x,y:t.y-1*n.y},o={x:Number.NaN,y:Number.NaN},r;if(n.x<0||n.x>=e.lim[0]||n.y<0||n.y>=e.lim[1])return o;r=n.y*e.lim[0]+n.x;var l={x:e.cvs[r][0],y:e.cvs[r][1]};r++;var c={x:e.cvs[r][0],y:e.cvs[r][1]};r+=e.lim[0];var d={x:e.cvs[r][0],y:e.cvs[r][1]};r--;var h={x:e.cvs[r][0],y:e.cvs[r][1]},f=s.x*s.y,m=s.x*(1-s.y),u=(1-s.x)*(1-s.y),g=(1-s.x)*s.y;return o.x=u*l.x+m*c.x+g*h.x+f*d.x,o.y=u*l.y+m*c.y+g*h.y+f*d.y,o}function Zl(i,e,t){var n=t.x,s=t.y,o=t.z||0,r,l,c,d={};for(c=0;c<3;c++)if(!(e&&c===2&&t.z===void 0))switch(c===0?(r=n,"ew".indexOf(i.axis[c])!==-1?l="x":l="y"):c===1?(r=s,"ns".indexOf(i.axis[c])!==-1?l="y":l="x"):(r=o,l="z"),i.axis[c]){case"e":d[l]=r;break;case"w":d[l]=-r;break;case"n":d[l]=r;break;case"s":d[l]=-r;break;case"u":t[l]!==void 0&&(d.z=r);break;case"d":t[l]!==void 0&&(d.z=-r);break;default:return null}return d}function ec(i){var e={x:i[0],y:i[1]};return i.length>2&&(e.z=i[2]),i.length>3&&(e.m=i[3]),e}function yA(i){tc(i.x),tc(i.y)}function tc(i){if(typeof Number.isFinite=="function"){if(Number.isFinite(i))return;throw new TypeError("coordinates must be finite numbers")}if(typeof i!="number"||i!==i||!isFinite(i))throw new TypeError("coordinates must be finite numbers")}function EA(i,e){return(i.datum.datum_type===ei||i.datum.datum_type===ti||i.datum.datum_type===Ci)&&e.datumCode!=="WGS84"||(e.datum.datum_type===ei||e.datum.datum_type===ti||e.datum.datum_type===Ci)&&i.datumCode!=="WGS84"}function ss(i,e,t,n){var s;Array.isArray(t)?t=ec(t):t={x:t.x,y:t.y,z:t.z,m:t.m};var o=t.z!==void 0;if(yA(t),i.datum&&e.datum&&EA(i,e)&&(s=new st("WGS84"),t=ss(i,s,t,n),i=s),n&&i.axis!=="enu"&&(t=Zl(i,!1,t)),i.projName==="longlat")t={x:t.x*xe,y:t.y*xe,z:t.z||0};else if(i.to_meter&&(t={x:t.x*i.to_meter,y:t.y*i.to_meter,z:t.z||0}),t=i.inverse(t),!t)return;if(i.from_greenwich&&(t.x+=i.from_greenwich),t=pA(i.datum,e.datum,t),!!t)return t=t,e.from_greenwich&&(t={x:t.x-e.from_greenwich,y:t.y,z:t.z||0}),e.projName==="longlat"?t={x:t.x*$e,y:t.y*$e,z:t.z||0}:(t=e.forward(t),e.to_meter&&(t={x:t.x/e.to_meter,y:t.y/e.to_meter,z:t.z||0})),n&&e.axis!=="enu"?Zl(e,!0,t):(t&&!o&&delete t.z,t)}var ic=st("WGS84");function Oo(i,e,t,n){var s,o,r;return Array.isArray(t)?(s=ss(i,e,t,n)||{x:NaN,y:NaN},t.length>2?typeof i.name<"u"&&i.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"?typeof s.z=="number"?[s.x,s.y,s.z].concat(t.slice(3)):[s.x,s.y,t[2]].concat(t.slice(3)):[s.x,s.y].concat(t.slice(2)):[s.x,s.y]):(o=ss(i,e,t,n),r=Object.keys(t),r.length===2||r.forEach(function(l){if(typeof i.name<"u"&&i.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"){if(l==="x"||l==="y"||l==="z")return}else if(l==="x"||l==="y")return;o[l]=t[l]}),o)}function os(i){return i instanceof st?i:typeof i=="object"&&"oProj"in i?i.oProj:st(i)}function CA(i,e,t){var n,s,o=!1,r;return typeof e>"u"?(s=os(i),n=ic,o=!0):(typeof e.x<"u"||Array.isArray(e))&&(t=e,s=os(i),n=ic,o=!0),n||(n=os(i)),s||(s=os(e)),t?Oo(n,s,t):(r={forward:function(l,c){return Oo(n,s,l,c)},inverse:function(l,c){return Oo(s,n,l,c)}},o&&(r.oProj=s),r)}var nc=6,sc="AJSAJS",oc="AFAFAF",wi=65,qe=73,ot=79,nn=86,sn=90;const vA={forward:ac,inverse:bA,toPoint:rc};function ac(i,e){return e=e||5,SA(wA({lat:i[1],lon:i[0]}),e)}function bA(i){var e=Uo(dc(i.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]}function rc(i){var e=Uo(dc(i.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function Go(i){return i*(Math.PI/180)}function lc(i){return 180*(i/Math.PI)}function wA(i){var e=i.lat,t=i.lon,n=6378137,s=.00669438,o=.9996,r,l,c,d,h,f,m,u=Go(e),g=Go(t),A,p;p=Math.floor((t+180)/6)+1,t===180&&(p=60),e>=56&&e<64&&t>=3&&t<12&&(p=32),e>=72&&e<84&&(t>=0&&t<9?p=31:t>=9&&t<21?p=33:t>=21&&t<33?p=35:t>=33&&t<42&&(p=37)),r=(p-1)*6-180+3,A=Go(r),l=s/(1-s),c=n/Math.sqrt(1-s*Math.sin(u)*Math.sin(u)),d=Math.tan(u)*Math.tan(u),h=l*Math.cos(u)*Math.cos(u),f=Math.cos(u)*(g-A),m=n*((1-s/4-3*s*s/64-5*s*s*s/256)*u-(3*s/8+3*s*s/32+45*s*s*s/1024)*Math.sin(2*u)+(15*s*s/256+45*s*s*s/1024)*Math.sin(4*u)-35*s*s*s/3072*Math.sin(6*u));var y=o*c*(f+(1-d+h)*f*f*f/6+(5-18*d+d*d+72*h-58*l)*f*f*f*f*f/120)+5e5,C=o*(m+c*Math.tan(u)*(f*f/2+(5-d+9*h+4*h*h)*f*f*f*f/24+(61-58*d+d*d+600*h-330*l)*f*f*f*f*f*f/720));return e<0&&(C+=1e7),{northing:Math.round(C),easting:Math.round(y),zoneNumber:p,zoneLetter:IA(e)}}function Uo(i){var e=i.northing,t=i.easting,n=i.zoneLetter,s=i.zoneNumber;if(s<0||s>60)return null;var o=.9996,r=6378137,l=.00669438,c,d=(1-Math.sqrt(1-l))/(1+Math.sqrt(1-l)),h,f,m,u,g,A,p,y,C,I=t-5e5,P=e;n<"N"&&(P-=1e7),p=(s-1)*6-180+3,c=l/(1-l),A=P/o,y=A/(r*(1-l/4-3*l*l/64-5*l*l*l/256)),C=y+(3*d/2-27*d*d*d/32)*Math.sin(2*y)+(21*d*d/16-55*d*d*d*d/32)*Math.sin(4*y)+151*d*d*d/96*Math.sin(6*y),h=r/Math.sqrt(1-l*Math.sin(C)*Math.sin(C)),f=Math.tan(C)*Math.tan(C),m=c*Math.cos(C)*Math.cos(C),u=r*(1-l)/Math.pow(1-l*Math.sin(C)*Math.sin(C),1.5),g=I/(h*o);var k=C-h*Math.tan(C)/u*(g*g/2-(5+3*f+10*m-4*m*m-9*c)*g*g*g*g/24+(61+90*f+298*m+45*f*f-252*c-3*m*m)*g*g*g*g*g*g/720);k=lc(k);var M=(g-(1+2*f+m)*g*g*g/6+(5-2*m+28*f-3*m*m+8*c+24*f*f)*g*g*g*g*g/120)/Math.cos(C);M=p+lc(M);var B;if(i.accuracy){var _=Uo({northing:i.northing+i.accuracy,easting:i.easting+i.accuracy,zoneLetter:i.zoneLetter,zoneNumber:i.zoneNumber});B={top:_.lat,right:_.lon,bottom:k,left:M}}else B={lat:k,lon:M};return B}function IA(i){var e="Z";return 84>=i&&i>=72?e="X":72>i&&i>=64?e="W":64>i&&i>=56?e="V":56>i&&i>=48?e="U":48>i&&i>=40?e="T":40>i&&i>=32?e="S":32>i&&i>=24?e="R":24>i&&i>=16?e="Q":16>i&&i>=8?e="P":8>i&&i>=0?e="N":0>i&&i>=-8?e="M":-8>i&&i>=-16?e="L":-16>i&&i>=-24?e="K":-24>i&&i>=-32?e="J":-32>i&&i>=-40?e="H":-40>i&&i>=-48?e="G":-48>i&&i>=-56?e="F":-56>i&&i>=-64?e="E":-64>i&&i>=-72?e="D":-72>i&&i>=-80&&(e="C"),e}function SA(i,e){var t="00000"+i.easting,n="00000"+i.northing;return i.zoneNumber+i.zoneLetter+xA(i.easting,i.northing,i.zoneNumber)+t.substr(t.length-5,e)+n.substr(n.length-5,e)}function xA(i,e,t){var n=cc(t),s=Math.floor(i/1e5),o=Math.floor(e/1e5)%20;return MA(s,o,n)}function cc(i){var e=i%nc;return e===0&&(e=nc),e}function MA(i,e,t){var n=t-1,s=sc.charCodeAt(n),o=oc.charCodeAt(n),r=s+i-1,l=o+e,c=!1;r>sn&&(r=r-sn+wi-1,c=!0),(r===qe||s<qe&&r>qe||(r>qe||s<qe)&&c)&&r++,(r===ot||s<ot&&r>ot||(r>ot||s<ot)&&c)&&(r++,r===qe&&r++),r>sn&&(r=r-sn+wi-1),l>nn?(l=l-nn+wi-1,c=!0):c=!1,(l===qe||o<qe&&l>qe||(l>qe||o<qe)&&c)&&l++,(l===ot||o<ot&&l>ot||(l>ot||o<ot)&&c)&&(l++,l===qe&&l++),l>nn&&(l=l-nn+wi-1);var d=String.fromCharCode(r)+String.fromCharCode(l);return d}function dc(i){if(i&&i.length===0)throw"MGRSPoint coverting from nothing";for(var e=i.length,t=null,n="",s,o=0;!/[A-Z]/.test(s=i.charAt(o));){if(o>=2)throw"MGRSPoint bad conversion from: "+i;n+=s,o++}var r=parseInt(n,10);if(o===0||o+3>e)throw"MGRSPoint bad conversion from: "+i;var l=i.charAt(o++);if(l<="A"||l==="B"||l==="Y"||l>="Z"||l==="I"||l==="O")throw"MGRSPoint zone letter "+l+" not handled: "+i;t=i.substring(o,o+=2);for(var c=cc(r),d=BA(t.charAt(0),c),h=TA(t.charAt(1),c);h<PA(l);)h+=2e6;var f=e-o;if(f%2!==0)throw`MGRSPoint has to have an even number
|
|
14
14
|
of digits after the zone letter and two 100km letters - front
|
|
15
15
|
half for easting meters, second half for
|
|
16
|
-
northing meters`+i;var m=f/2,u=0,g=0,A,p,y,C,I;return m>0&&(A=1e5/Math.pow(10,m),p=i.substring(o,o+m),u=parseFloat(p)*A,y=i.substring(o+m),g=parseFloat(y)*A),C=u+d,I=g+h,{easting:C,northing:I,zoneLetter:l,zoneNumber:r,accuracy:A}}function BA(i,e){for(var t=sc.charCodeAt(e-1),n=1e5,s=!1;t!==i.charCodeAt(0);){if(t++,t===qe&&t++,t===ot&&t++,t>sn){if(s)throw"Bad character: "+i;t=wi,s=!0}n+=1e5}return n}function TA(i,e){if(i>"V")throw"MGRSPoint given invalid Northing "+i;for(var t=oc.charCodeAt(e-1),n=0,s=!1;t!==i.charCodeAt(0);){if(t++,t===qe&&t++,t===ot&&t++,t>nn){if(s)throw"Bad character: "+i;t=wi,s=!0}n+=1e5}return n}function PA(i){var e;switch(i){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+i}function Ii(i,e,t){if(!(this instanceof Ii))return new Ii(i,e,t);if(Array.isArray(i))this.x=i[0],this.y=i[1],this.z=i[2]||0;else if(typeof i=="object")this.x=i.x,this.y=i.y,this.z=i.z||0;else if(typeof i=="string"&&typeof e>"u"){var n=i.split(",");this.x=parseFloat(n[0]),this.y=parseFloat(n[1]),this.z=parseFloat(n[2])||0}else this.x=i,this.y=e,this.z=t||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Ii.fromMGRS=function(i){return new Ii(rc(i))},Ii.prototype.toMGRS=function(i){return ac([this.x,this.y],i)};var _A=1,DA=.25,hc=.046875,uc=.01953125,fc=.01068115234375,kA=.75,NA=.46875,RA=.013020833333333334,FA=.007120768229166667,LA=.3645833333333333,OA=.005696614583333333,GA=.3076171875;function Vo(i){var e=[];e[0]=_A-i*(DA+i*(hc+i*(uc+i*fc))),e[1]=i*(kA-i*(hc+i*(uc+i*fc)));var t=i*i;return e[2]=t*(NA-i*(RA+i*FA)),t*=i,e[3]=t*(LA-i*OA),e[4]=t*i*GA,e}function Si(i,e,t,n){return t*=e,e*=e,n[0]*i-t*(n[1]+e*(n[2]+e*(n[3]+e*n[4])))}var UA=20;function Qo(i,e,t){for(var n=1/(1-e),s=i,o=UA;o;--o){var r=Math.sin(s),l=1-e*r*r;if(l=(Si(s,r,Math.cos(s),t)-i)*(l*Math.sqrt(l))*n,s-=l,Math.abs(l)<K)return s}return s}function VA(){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=Vo(this.es),this.ml0=Si(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function QA(i){var e=i.x,t=i.y,n=X(e-this.long0,this.over),s,o,r,l=Math.sin(t),c=Math.cos(t);if(this.es){var h=c*n,f=Math.pow(h,2),m=this.ep2*Math.pow(c,2),u=Math.pow(m,2),g=Math.abs(c)>K?Math.tan(t):0,A=Math.pow(g,2),p=Math.pow(A,2);s=1-this.es*Math.pow(l,2),h=h/Math.sqrt(s);var y=Si(t,l,c,this.en);o=this.a*(this.k0*h*(1+f/6*(1-A+m+f/20*(5-18*A+p+14*m-58*A*m+f/42*(61+179*p-p*A-479*A)))))+this.x0,r=this.a*(this.k0*(y-this.ml0+l*n*h/2*(1+f/12*(5-A+9*m+4*u+f/30*(61+p-58*A+270*m-330*A*m+f/56*(1385+543*p-p*A-3111*A))))))+this.y0}else{var d=c*Math.sin(n);if(Math.abs(Math.abs(d)-1)<K)return 93;if(o=.5*this.a*this.k0*Math.log((1+d)/(1-d))+this.x0,r=c*Math.cos(n)/Math.sqrt(1-Math.pow(d,2)),d=Math.abs(r),d>=1){if(d-1>K)return 93;r=0}else r=Math.acos(r);t<0&&(r=-r),r=this.a*this.k0*(r-this.lat0)+this.y0}return i.x=o,i.y=r,i}function HA(i){var e,t,n,s,o=(i.x-this.x0)*(1/this.a),r=(i.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+r/this.k0,t=Qo(e,this.es,this.en),Math.abs(t)<j){var f=Math.sin(t),m=Math.cos(t),u=Math.abs(m)>K?Math.tan(t):0,g=this.ep2*Math.pow(m,2),A=Math.pow(g,2),p=Math.pow(u,2),y=Math.pow(p,2);e=1-this.es*Math.pow(f,2);var C=o*Math.sqrt(e)/this.k0,I=Math.pow(C,2);e=e*u,n=t-e*I/(1-this.es)*.5*(1-I/12*(5+3*p-9*g*p+g-4*A-I/30*(61+90*p-252*g*p+45*y+46*g-I/56*(1385+3633*p+4095*y+1574*y*p)))),s=X(this.long0+C*(1-I/6*(1+2*p+g-I/20*(5+28*p+24*y+8*g*p+6*g-I/42*(61+662*p+1320*y+720*y*p))))/m,this.over)}else n=j*en(r),s=0;else{var l=Math.exp(o/this.k0),c=.5*(l-1/l),d=this.lat0+r/this.k0,h=Math.cos(d);e=Math.sqrt((1-Math.pow(h,2))/(1+Math.pow(c,2))),n=Math.asin(e),r<0&&(n=-n),c===0&&h===0?s=0:s=X(Math.atan2(c,h)+this.long0,this.over)}return i.x=s,i.y=n,i}var YA=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const as={init:VA,forward:QA,inverse:HA,names:YA};function mc(i){var e=Math.exp(i);return e=(e-1/e)/2,e}function Xe(i,e){i=Math.abs(i),e=Math.abs(e);var t=Math.max(i,e),n=Math.min(i,e)/(t||1);return t*Math.sqrt(1+Math.pow(n,2))}function zA(i){var e=1+i,t=e-1;return t===0?i:i*Math.log(e)/t}function jA(i){var e=Math.abs(i);return e=zA(e*(1+e/(Xe(1,e)+1))),i<0?-e:e}function Ho(i,e){for(var t=2*Math.cos(2*e),n=i.length-1,s=i[n],o=0,r;--n>=0;)r=-o+t*s+i[n],o=s,s=r;return e+r*Math.sin(2*e)}function WA(i,e){for(var t=2*Math.cos(e),n=i.length-1,s=i[n],o=0,r;--n>=0;)r=-o+t*s+i[n],o=s,s=r;return Math.sin(e)*r}function $A(i){var e=Math.exp(i);return e=(e+1/e)/2,e}function gc(i,e,t){for(var n=Math.sin(e),s=Math.cos(e),o=mc(t),r=$A(t),l=2*s*r,c=-2*n*o,d=i.length-1,h=i[d],f=0,m=0,u=0,g,A;--d>=0;)g=m,A=f,m=h,f=u,h=-g+l*m-c*f+i[d],u=-A+c*m+l*f;return l=n*r,c=s*o,[l*h-c*u,l*u+c*h]}function KA(){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&&(as.init.apply(this),this.forward=as.forward,this.inverse=as.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 i=this.es/(1+Math.sqrt(1-this.es)),e=i/(2-i),t=e;this.cgb[0]=e*(2+e*(-2/3+e*(-2+e*(116/45+e*(26/45+e*(-2854/675)))))),this.cbg[0]=e*(-2+e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))),t=t*e,this.cgb[1]=t*(7/3+e*(-8/5+e*(-227/45+e*(2704/315+e*(2323/945))))),this.cbg[1]=t*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),t=t*e,this.cgb[2]=t*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=t*(-26/15+e*(34/21+e*(8/5+e*(-12686/2835)))),t=t*e,this.cgb[3]=t*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=t*(1237/630+e*(-12/5+e*(-24832/14175))),t=t*e,this.cgb[4]=t*(4174/315+e*(-144838/6237)),this.cbg[4]=t*(-734/315+e*(109598/31185)),t=t*e,this.cgb[5]=t*(601676/22275),this.cbg[5]=t*(444337/155925),t=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+t*(1/4+t*(1/64+t/256))),this.utg[0]=e*(-.5+e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=t*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=t*(13/48+e*(-3/5+e*(557/1440+e*(281/630+e*(-1983433/1935360))))),t=t*e,this.utg[2]=t*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=t*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),t=t*e,this.utg[3]=t*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=t*(49561/161280+e*(-179/168+e*(6601661/7257600))),t=t*e,this.utg[4]=t*(-4583/161280+e*(108847/3991680)),this.gtu[4]=t*(34729/80640+e*(-3418889/1995840)),t=t*e,this.utg[5]=t*(-20648693/638668800),this.gtu[5]=t*(212378941/319334400);var n=Ho(this.cbg,this.lat0);this.Zb=-this.Qn*(n+WA(this.gtu,2*n))}function qA(i){var e=X(i.x-this.long0,this.over),t=i.y;t=Ho(this.cbg,t);var n=Math.sin(t),s=Math.cos(t),o=Math.sin(e),r=Math.cos(e);t=Math.atan2(n,r*s),e=Math.atan2(o*s,Xe(n,s*r)),e=jA(Math.tan(e));var l=gc(this.gtu,2*t,2*e);t=t+l[0],e=e+l[1];var c,d;return Math.abs(e)<=2.623395162778?(c=this.a*(this.Qn*e)+this.x0,d=this.a*(this.Qn*t+this.Zb)+this.y0):(c=1/0,d=1/0),i.x=c,i.y=d,i}function XA(i){var e=(i.x-this.x0)*(1/this.a),t=(i.y-this.y0)*(1/this.a);t=(t-this.Zb)/this.Qn,e=e/this.Qn;var n,s;if(Math.abs(e)<=2.623395162778){var o=gc(this.utg,2*t,2*e);t=t+o[0],e=e+o[1],e=Math.atan(mc(e));var r=Math.sin(t),l=Math.cos(t),c=Math.sin(e),d=Math.cos(e);t=Math.atan2(r*d,Xe(c,d*l)),e=Math.atan2(c,d*l),n=X(e+this.long0,this.over),s=Ho(this.cgb,t)}else n=1/0,s=1/0;return i.x=n,i.y=s,i}var JA=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const rs={init:KA,forward:qA,inverse:XA,names:JA};function ZA(i,e){if(i===void 0){if(i=Math.floor((X(e)+Math.PI)*30/Math.PI)+1,i<0)return 0;if(i>60)return 60}return i}var ey="etmerc";function ty(){var i=ZA(this.zone,this.long0);if(i===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(i)-183)*xe,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,rs.init.apply(this),this.forward=rs.forward,this.inverse=rs.inverse}var iy=["Universal Transverse Mercator System","utm"];const ny={init:ty,names:iy,dependsOn:ey};function Yo(i,e){return Math.pow((1-i)/(1+i),e)}var sy=20;function oy(){var i=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*i*i),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(i/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+ue)/(Math.pow(Math.tan(.5*this.lat0+ue),this.C)*Yo(this.e*i,this.ratexp))}function ay(i){var e=i.x,t=i.y;return i.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*t+ue),this.C)*Yo(this.e*Math.sin(t),this.ratexp))-j,i.x=this.C*e,i}function ry(i){for(var e=1e-14,t=i.x/this.C,n=i.y,s=Math.pow(Math.tan(.5*n+ue)/this.K,1/this.C),o=sy;o>0&&(n=2*Math.atan(s*Yo(this.e*Math.sin(i.y),-.5*this.e))-j,!(Math.abs(n-i.y)<e));--o)i.y=n;return o?(i.x=t,i.y=n,i):null}const zo={init:oy,forward:ay,inverse:ry};function ly(){zo.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 cy(i){var e,t,n,s;return i.x=X(i.x-this.long0,this.over),zo.forward.apply(this,[i]),e=Math.sin(i.y),t=Math.cos(i.y),n=Math.cos(i.x),s=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*t*n),i.x=s*t*Math.sin(i.x),i.y=s*(this.cosc0*e-this.sinc0*t*n),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function dy(i){var e,t,n,s,o;if(i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,i.x/=this.k0,i.y/=this.k0,o=Xe(i.x,i.y)){var r=2*Math.atan2(o,this.R2);e=Math.sin(r),t=Math.cos(r),s=Math.asin(t*this.sinc0+i.y*e*this.cosc0/o),n=Math.atan2(i.x*e,o*this.cosc0*t-i.y*this.sinc0*e)}else s=this.phic0,n=0;return i.x=n,i.y=s,zo.inverse.apply(this,[i]),i.x=X(i.x+this.long0,this.over),i}var hy=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const uy={init:ly,forward:cy,inverse:dy,names:hy};function jo(i,e,t){return e*=t,Math.tan(.5*(j+i))*Math.pow((1-e)/(1+e),.5*t)}function fy(){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)<=K&&(this.k0=.5*(1+en(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=K&&(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)<=K&&Math.abs(Math.cos(this.lat_ts))>K&&(this.k0=.5*this.cons*Ct(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/ct(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Ct(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(jo(this.lat0,this.sinlat0,this.e))-j,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function my(i){var e=i.x,t=i.y,n=Math.sin(t),s=Math.cos(t),o,r,l,c,d,h,f=X(e-this.long0,this.over);return Math.abs(Math.abs(e-this.long0)-Math.PI)<=K&&Math.abs(t+this.lat0)<=K?(i.x=NaN,i.y=NaN,i):this.sphere?(o=2*this.k0/(1+this.sinlat0*n+this.coslat0*s*Math.cos(f)),i.x=this.a*o*s*Math.sin(f)+this.x0,i.y=this.a*o*(this.coslat0*n-this.sinlat0*s*Math.cos(f))+this.y0,i):(r=2*Math.atan(jo(t,n,this.e))-j,c=Math.cos(r),l=Math.sin(r),Math.abs(this.coslat0)<=K?(d=ct(this.e,t*this.con,this.con*n),h=2*this.a*this.k0*d/this.cons,i.x=this.x0+h*Math.sin(e-this.long0),i.y=this.y0-this.con*h*Math.cos(e-this.long0),i):(Math.abs(this.sinlat0)<K?(o=2*this.a*this.k0/(1+c*Math.cos(f)),i.y=o*l):(o=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*l+this.cosX0*c*Math.cos(f))),i.y=o*(this.cosX0*l-this.sinX0*c*Math.cos(f))+this.y0),i.x=o*c*Math.sin(f)+this.x0,i))}function gy(i){i.x-=this.x0,i.y-=this.y0;var e,t,n,s,o,r=Math.sqrt(i.x*i.x+i.y*i.y);if(this.sphere){var l=2*Math.atan(r/(2*this.a*this.k0));return e=this.long0,t=this.lat0,r<=K?(i.x=e,i.y=t,i):(t=Math.asin(Math.cos(l)*this.sinlat0+i.y*Math.sin(l)*this.coslat0/r),Math.abs(this.coslat0)<K?this.lat0>0?e=X(this.long0+Math.atan2(i.x,-1*i.y),this.over):e=X(this.long0+Math.atan2(i.x,i.y),this.over):e=X(this.long0+Math.atan2(i.x*Math.sin(l),r*this.coslat0*Math.cos(l)-i.y*this.sinlat0*Math.sin(l)),this.over),i.x=e,i.y=t,i)}else if(Math.abs(this.coslat0)<=K){if(r<=K)return t=this.lat0,e=this.long0,i.x=e,i.y=t,i;i.x*=this.con,i.y*=this.con,n=r*this.cons/(2*this.a*this.k0),t=this.con*tn(this.e,n),e=this.con*X(this.con*this.long0+Math.atan2(i.x,-1*i.y),this.over)}else s=2*Math.atan(r*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,r<=K?o=this.X0:(o=Math.asin(Math.cos(s)*this.sinX0+i.y*Math.sin(s)*this.cosX0/r),e=X(this.long0+Math.atan2(i.x*Math.sin(s),r*this.cosX0*Math.cos(s)-i.y*this.sinX0*Math.sin(s)),this.over)),t=-1*tn(this.e,Math.tan(.5*(j+o)));return i.x=e,i.y=t,i}var py=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"];const Ay={init:fy,forward:my,inverse:gy,names:py,ssfn_:jo};function yy(){var i=this.lat0;this.lambda0=this.long0;var e=Math.sin(i),t=this.a,n=this.rf,s=1/n,o=2*s-Math.pow(s,2),r=this.e=Math.sqrt(o);this.R=this.k0*t*Math.sqrt(1-o)/(1-o*Math.pow(e,2)),this.alpha=Math.sqrt(1+o/(1-o)*Math.pow(Math.cos(i),4)),this.b0=Math.asin(e/this.alpha);var l=Math.log(Math.tan(Math.PI/4+this.b0/2)),c=Math.log(Math.tan(Math.PI/4+i/2)),d=Math.log((1+r*e)/(1-r*e));this.K=l-this.alpha*c+this.alpha*r/2*d}function Ey(i){var e=Math.log(Math.tan(Math.PI/4-i.y/2)),t=this.e/2*Math.log((1+this.e*Math.sin(i.y))/(1-this.e*Math.sin(i.y))),n=-this.alpha*(e+t)+this.K,s=2*(Math.atan(Math.exp(n))-Math.PI/4),o=this.alpha*(i.x-this.lambda0),r=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(s)+Math.cos(this.b0)*Math.cos(o))),l=Math.asin(Math.cos(this.b0)*Math.sin(s)-Math.sin(this.b0)*Math.cos(s)*Math.cos(o));return i.y=this.R/2*Math.log((1+Math.sin(l))/(1-Math.sin(l)))+this.y0,i.x=this.R*r+this.x0,i}function Cy(i){for(var e=i.x-this.x0,t=i.y-this.y0,n=e/this.R,s=2*(Math.atan(Math.exp(t/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(s)+Math.sin(this.b0)*Math.cos(s)*Math.cos(n)),r=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(s))),l=this.lambda0+r/this.alpha,c=0,d=o,h=-1e3,f=0;Math.abs(d-h)>1e-7;){if(++f>20)return;c=1/this.alpha*(Math.log(Math.tan(Math.PI/4+o/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(d))/2)),h=d,d=2*Math.atan(Math.exp(c))-Math.PI/2}return i.x=l,i.y=d,i}var vy=["somerc"];const by={init:yy,forward:Ey,inverse:Cy,names:vy};var xi=1e-7;function wy(i){var e=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],t=typeof i.projName=="object"?Object.keys(i.projName)[0]:i.projName;return"no_uoff"in i||"no_off"in i||e.indexOf(t)!==-1||e.indexOf(jl(t))!==-1}function Iy(){var i,e,t,n,s,o,r,l,c,d,h=0,f,m=0,u=0,g=0,A=0,p=0,y=0;this.no_off=wy(this),this.no_rot="no_rot"in this;var C=!1;"alpha"in this&&(C=!0);var I=!1;if("rectified_grid_angle"in this&&(I=!0),C&&(y=this.alpha),I&&(h=this.rectified_grid_angle),C||I)m=this.longc;else if(u=this.long1,A=this.lat1,g=this.long2,p=this.lat2,Math.abs(A-p)<=xi||(i=Math.abs(A))<=xi||Math.abs(i-j)<=xi||Math.abs(Math.abs(this.lat0)-j)<=xi||Math.abs(Math.abs(p)-j)<=xi)throw new Error;var P=1-this.es;e=Math.sqrt(P),Math.abs(this.lat0)>K?(l=Math.sin(this.lat0),t=Math.cos(this.lat0),i=1-this.es*l*l,this.B=t*t,this.B=Math.sqrt(1+this.es*this.B*this.B/P),this.A=this.B*this.k0*e/i,n=this.B*e/(t*Math.sqrt(i)),s=n*n-1,s<=0?s=0:(s=Math.sqrt(s),this.lat0<0&&(s=-s)),this.E=s+=n,this.E*=Math.pow(ct(this.e,this.lat0,l),this.B)):(this.B=1/e,this.A=this.k0,this.E=n=s=1),C||I?(C?(f=Math.asin(Math.sin(y)/n),I||(h=y)):(f=h,y=Math.asin(n*Math.sin(f))),this.lam0=m-Math.asin(.5*(s-1/s)*Math.tan(f))/this.B):(o=Math.pow(ct(this.e,A,Math.sin(A)),this.B),r=Math.pow(ct(this.e,p,Math.sin(p)),this.B),s=this.E/o,c=(r-o)/(r+o),d=this.E*this.E,d=(d-r*o)/(d+r*o),i=u-g,i<-Math.PI?g-=Ji:i>Math.PI&&(g+=Ji),this.lam0=X(.5*(u+g)-Math.atan(d*Math.tan(.5*this.B*(u-g))/c)/this.B,this.over),f=Math.atan(2*Math.sin(this.B*X(u-this.lam0,this.over))/(s-1/s)),h=y=Math.asin(n*Math.sin(f))),this.singam=Math.sin(f),this.cosgam=Math.cos(f),this.sinrot=Math.sin(h),this.cosrot=Math.cos(h),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(n*n-1)/Math.cos(y))),this.lat0<0&&(this.u_0=-this.u_0)),s=.5*f,this.v_pole_n=this.ArB*Math.log(Math.tan(ue-s)),this.v_pole_s=this.ArB*Math.log(Math.tan(ue+s))}function Sy(i){var e={},t,n,s,o,r,l,c,d;if(i.x=i.x-this.lam0,Math.abs(Math.abs(i.y)-j)>K){if(r=this.E/Math.pow(ct(this.e,i.y,Math.sin(i.y)),this.B),l=1/r,t=.5*(r-l),n=.5*(r+l),o=Math.sin(this.B*i.x),s=(t*this.singam-o*this.cosgam)/n,Math.abs(Math.abs(s)-1)<K)throw new Error;d=.5*this.ArB*Math.log((1-s)/(1+s)),l=Math.cos(this.B*i.x),Math.abs(l)<xi?c=this.A*i.x:c=this.ArB*Math.atan2(t*this.cosgam+o*this.singam,l)}else d=i.y>0?this.v_pole_n:this.v_pole_s,c=this.ArB*i.y;return this.no_rot?(e.x=c,e.y=d):(c-=this.u_0,e.x=d*this.cosrot+c*this.sinrot,e.y=c*this.cosrot-d*this.sinrot),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function xy(i){var e,t,n,s,o,r,l,c={};if(i.x=(i.x-this.x0)*(1/this.a),i.y=(i.y-this.y0)*(1/this.a),this.no_rot?(t=i.y,e=i.x):(t=i.x*this.cosrot-i.y*this.sinrot,e=i.y*this.cosrot+i.x*this.sinrot+this.u_0),n=Math.exp(-this.BrA*t),s=.5*(n-1/n),o=.5*(n+1/n),r=Math.sin(this.BrA*e),l=(r*this.cosgam+s*this.singam)/o,Math.abs(Math.abs(l)-1)<K)c.x=0,c.y=l<0?-j:j;else{if(c.y=this.E/Math.sqrt((1+l)/(1-l)),c.y=tn(this.e,Math.pow(c.y,1/this.B)),c.y===1/0)throw new Error;c.x=-this.rB*Math.atan2(s*this.cosgam-r*this.singam,Math.cos(this.BrA*e))}return c.x+=this.lam0,c}var My=["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 By={init:Iy,forward:Sy,inverse:xy,names:My};function Ty(){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)<K)){var i=this.b/this.a;this.e=Math.sqrt(1-i*i);var e=Math.sin(this.lat1),t=Math.cos(this.lat1),n=Ct(this.e,e,t),s=ct(this.e,this.lat1,e),o=Math.sin(this.lat2),r=Math.cos(this.lat2),l=Ct(this.e,o,r),c=ct(this.e,this.lat2,o),d=Math.abs(Math.abs(this.lat0)-j)<K?0:ct(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>K?this.ns=Math.log(n/l)/Math.log(s/c):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=n/(this.ns*Math.pow(s,this.ns)),this.rh=this.a*this.f0*Math.pow(d,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function Py(i){var e=i.x,t=i.y;Math.abs(2*Math.abs(t)-Math.PI)<=K&&(t=en(t)*(j-2*K));var n=Math.abs(Math.abs(t)-j),s,o;if(n>K)s=ct(this.e,t,Math.sin(t)),o=this.a*this.f0*Math.pow(s,this.ns);else{if(n=t*this.ns,n<=0)return null;o=0}var r=this.ns*X(e-this.long0,this.over);return i.x=this.k0*(o*Math.sin(r))+this.x0,i.y=this.k0*(this.rh-o*Math.cos(r))+this.y0,i}function _y(i){var e,t,n,s,o,r=(i.x-this.x0)/this.k0,l=this.rh-(i.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(r*r+l*l),t=1):(e=-Math.sqrt(r*r+l*l),t=-1);var c=0;if(e!==0&&(c=Math.atan2(t*r,t*l)),e!==0||this.ns>0){if(t=1/this.ns,n=Math.pow(e/(this.a*this.f0),t),s=tn(this.e,n),s===-9999)return null}else s=-j;return o=X(c/this.ns+this.long0,this.over),i.x=o,i.y=s,i}var Dy=["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 ky={init:Ty,forward:Py,inverse:_y,names:Dy};function Ny(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),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 Ry(i){var e,t,n,s,o,r,l,c=i.x,d=i.y,h=X(c-this.long0,this.over);return e=Math.pow((1+this.e*Math.sin(d))/(1-this.e*Math.sin(d)),this.alfa*this.e/2),t=2*(Math.atan(this.k*Math.pow(Math.tan(d/2+this.s45),this.alfa)/e)-this.s45),n=-h*this.alfa,s=Math.asin(Math.cos(this.ad)*Math.sin(t)+Math.sin(this.ad)*Math.cos(t)*Math.cos(n)),o=Math.asin(Math.cos(t)*Math.sin(n)/Math.cos(s)),r=this.n*o,l=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(s/2+this.s45),this.n),i.y=l*Math.cos(r)/1,i.x=l*Math.sin(r)/1,this.czech||(i.y*=-1,i.x*=-1),i}function Fy(i){var e,t,n,s,o,r,l,c,d=i.x;i.x=i.y,i.y=d,this.czech||(i.y*=-1,i.x*=-1),r=Math.sqrt(i.x*i.x+i.y*i.y),o=Math.atan2(i.y,i.x),s=o/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/r,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(s)),t=Math.asin(Math.cos(n)*Math.sin(s)/Math.cos(e)),i.x=this.long0-t/this.alfa,l=e,c=0;var h=0;do i.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.e/2))-this.s45),Math.abs(l-i.y)<1e-10&&(c=1),l=i.y,h+=1;while(c===0&&h<15);return h>=15?null:i}var Ly=["Krovak","krovak"];const Oy={init:Ny,forward:Ry,inverse:Fy,names:Ly};function ze(i,e,t,n,s){return i*s-e*Math.sin(2*s)+t*Math.sin(4*s)-n*Math.sin(6*s)}function on(i){return 1-.25*i*(1+i/16*(3+1.25*i))}function an(i){return .375*i*(1+.25*i*(1+.46875*i))}function rn(i){return .05859375*i*i*(1+.75*i)}function ln(i){return i*i*i*(35/3072)}function Wo(i,e,t){var n=e*t;return i/Math.sqrt(1-n*n)}function Ft(i){return Math.abs(i)<j?i:i-en(i)*Math.PI}function ls(i,e,t,n,s){var o,r;o=i/e;for(var l=0;l<15;l++)if(r=(i-(e*o-t*Math.sin(2*o)+n*Math.sin(4*o)-s*Math.sin(6*o)))/(e-2*t*Math.cos(2*o)+4*n*Math.cos(4*o)-6*s*Math.cos(6*o)),o+=r,Math.abs(r)<=1e-10)return o;return NaN}function Gy(){this.sphere||(this.e0=on(this.es),this.e1=an(this.es),this.e2=rn(this.es),this.e3=ln(this.es),this.ml0=this.a*ze(this.e0,this.e1,this.e2,this.e3,this.lat0))}function Uy(i){var e,t,n=i.x,s=i.y;if(n=X(n-this.long0,this.over),this.sphere)e=this.a*Math.asin(Math.cos(s)*Math.sin(n)),t=this.a*(Math.atan2(Math.tan(s),Math.cos(n))-this.lat0);else{var o=Math.sin(s),r=Math.cos(s),l=Wo(this.a,this.e,o),c=Math.tan(s)*Math.tan(s),d=n*Math.cos(s),h=d*d,f=this.es*r*r/(1-this.es),m=this.a*ze(this.e0,this.e1,this.e2,this.e3,s);e=l*d*(1-h*c*(1/6-(8-c+8*f)*h/120)),t=m-this.ml0+l*o/r*h*(.5+(5-c+6*f)*h/24)}return i.x=e+this.x0,i.y=t+this.y0,i}function Vy(i){i.x-=this.x0,i.y-=this.y0;var e=i.x/this.a,t=i.y/this.a,n,s;if(this.sphere){var o=t+this.lat0;n=Math.asin(Math.sin(o)*Math.cos(e)),s=Math.atan2(Math.tan(e),Math.cos(o))}else{var r=this.ml0/this.a+t,l=ls(r,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(l)-j)<=K)return i.x=this.long0,i.y=j,t<0&&(i.y*=-1),i;var c=Wo(this.a,this.e,Math.sin(l)),d=c*c*c/this.a/this.a*(1-this.es),h=Math.pow(Math.tan(l),2),f=e*this.a/c,m=f*f;n=l-c*Math.tan(l)/d*f*f*(.5-(1+3*h)*f*f/24),s=f*(1-m*(h/3+(1+3*h)*h*m/15))/Math.cos(l)}return i.x=X(s+this.long0,this.over),i.y=Ft(n),i}var Qy=["Cassini","Cassini_Soldner","cass"];const Hy={init:Gy,forward:Uy,inverse:Vy,names:Qy};function Lt(i,e){var t;return i>1e-7?(t=i*e,(1-i*i)*(e/(1-t*t)-.5/i*Math.log((1-t)/(1+t)))):2*e}var $o=1,Ko=2,qo=3,cs=4;function Yy(){var i=Math.abs(this.lat0);if(Math.abs(i-j)<K?this.mode=this.lat0<0?$o:Ko:Math.abs(i)<K?this.mode=qo:this.mode=cs,this.es>0){var e;switch(this.qp=Lt(this.e,1),this.mmf=.5/(1-this.es),this.apa=Zy(this.es),this.mode){case Ko:this.dd=1;break;case $o:this.dd=1;break;case qo:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case cs:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=Lt(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===cs&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function zy(i){var e,t,n,s,o,r,l,c,d,h,f=i.x,m=i.y;if(f=X(f-this.long0,this.over),this.sphere){if(o=Math.sin(m),h=Math.cos(m),n=Math.cos(f),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t=this.mode===this.EQUIT?1+h*n:1+this.sinph0*o+this.cosph0*h*n,t<=K)return null;t=Math.sqrt(2/t),e=t*h*Math.sin(f),t*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*h*n}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),Math.abs(m+this.lat0)<K)return null;t=ue-m*.5,t=2*(this.mode===this.S_POLE?Math.cos(t):Math.sin(t)),e=t*Math.sin(f),t*=n}}else{switch(l=0,c=0,d=0,n=Math.cos(f),s=Math.sin(f),o=Math.sin(m),r=Lt(this.e,o),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(l=r/this.qp,c=Math.sqrt(1-l*l)),this.mode){case this.OBLIQ:d=1+this.sinb1*l+this.cosb1*c*n;break;case this.EQUIT:d=1+c*n;break;case this.N_POLE:d=j+m,r=this.qp-r;break;case this.S_POLE:d=m-j,r=this.qp+r;break}if(Math.abs(d)<K)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:d=Math.sqrt(2/d),this.mode===this.OBLIQ?t=this.ymf*d*(this.cosb1*l-this.sinb1*c*n):t=(d=Math.sqrt(2/(1+c*n)))*l*this.ymf,e=this.xmf*d*c*s;break;case this.N_POLE:case this.S_POLE:r>=0?(e=(d=Math.sqrt(r))*s,t=n*(this.mode===this.S_POLE?d:-d)):e=t=0;break}}return i.x=this.a*e+this.x0,i.y=this.a*t+this.y0,i}function jy(i){i.x-=this.x0,i.y-=this.y0;var e=i.x/this.a,t=i.y/this.a,n,s,o,r,l,c,d;if(this.sphere){var h=0,f,m=0;if(f=Math.sqrt(e*e+t*t),s=f*.5,s>1)return null;switch(s=2*Math.asin(s),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(m=Math.sin(s),h=Math.cos(s)),this.mode){case this.EQUIT:s=Math.abs(f)<=K?0:Math.asin(t*m/f),e*=m,t=h*f;break;case this.OBLIQ:s=Math.abs(f)<=K?this.lat0:Math.asin(h*this.sinph0+t*m*this.cosph0/f),e*=m*this.cosph0,t=(h-Math.sin(s)*this.sinph0)*f;break;case this.N_POLE:t=-t,s=j-s;break;case this.S_POLE:s-=j;break}n=t===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(e,t)}else{if(d=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e/=this.dd,t*=this.dd,c=Math.sqrt(e*e+t*t),c<K)return i.x=this.long0,i.y=this.lat0,i;r=2*Math.asin(.5*c/this.rq),o=Math.cos(r),e*=r=Math.sin(r),this.mode===this.OBLIQ?(d=o*this.sinb1+t*r*this.cosb1/c,l=this.qp*d,t=c*this.cosb1*o-t*this.sinb1*r):(d=t*r/c,l=this.qp*d,t=c*o)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(t=-t),l=e*e+t*t,!l)return i.x=this.long0,i.y=this.lat0,i;d=1-l/this.qp,this.mode===this.S_POLE&&(d=-d)}n=Math.atan2(e,t),s=e1(Math.asin(d),this.apa)}return i.x=X(this.long0+n,this.over),i.y=s,i}var Wy=.3333333333333333,$y=.17222222222222222,Ky=.10257936507936508,qy=.06388888888888888,Xy=.0664021164021164,Jy=.016415012942191543;function Zy(i){var e,t=[];return t[0]=i*Wy,e=i*i,t[0]+=e*$y,t[1]=e*qy,e*=i,t[0]+=e*Ky,t[1]+=e*Xy,t[2]=e*Jy,t}function e1(i,e){var t=i+i;return i+e[0]*Math.sin(t)+e[1]*Math.sin(t+t)+e[2]*Math.sin(t+t+t)}var t1=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const i1={init:Yy,forward:zy,inverse:jy,names:t1,S_POLE:$o,N_POLE:Ko,EQUIT:qo,OBLIQ:cs};function Ot(i){return Math.abs(i)>1&&(i=i>1?1:-1),Math.asin(i)}function n1(){Math.abs(this.lat1+this.lat2)<K||(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=Ct(this.e3,this.sin_po,this.cos_po),this.qs1=Lt(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=Ct(this.e3,this.sin_po,this.cos_po),this.qs2=Lt(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=Lt(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>K?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 s1(i){var e=i.x,t=i.y;this.sin_phi=Math.sin(t),this.cos_phi=Math.cos(t);var n=Lt(this.e3,this.sin_phi),s=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,o=this.ns0*X(e-this.long0,this.over),r=s*Math.sin(o)+this.x0,l=this.rh-s*Math.cos(o)+this.y0;return i.x=r,i.y=l,i}function o1(i){var e,t,n,s,o,r;return i.x-=this.x0,i.y=this.rh-i.y+this.y0,this.ns0>=0?(e=Math.sqrt(i.x*i.x+i.y*i.y),n=1):(e=-Math.sqrt(i.x*i.x+i.y*i.y),n=-1),s=0,e!==0&&(s=Math.atan2(n*i.x,n*i.y)),n=e*this.ns0/this.a,this.sphere?r=Math.asin((this.c-n*n)/(2*this.ns0)):(t=(this.c-n*n)/this.ns0,r=this.phi1z(this.e3,t)),o=X(s/this.ns0+this.long0,this.over),i.x=o,i.y=r,i}function a1(i,e){var t,n,s,o,r,l=Ot(.5*e);if(i<K)return l;for(var c=i*i,d=1;d<=25;d++)if(t=Math.sin(l),n=Math.cos(l),s=i*t,o=1-s*s,r=.5*o*o/n*(e/(1-c)-t/o+.5/i*Math.log((1-s)/(1+s))),l=l+r,Math.abs(r)<=1e-7)return l;return null}var r1=["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"];const l1={init:n1,forward:s1,inverse:o1,names:r1,phi1z:a1};function c1(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function d1(i){var e,t,n,s,o,r,l,c,d=i.x,h=i.y;return n=X(d-this.long0,this.over),e=Math.sin(h),t=Math.cos(h),s=Math.cos(n),r=this.sin_p14*e+this.cos_p14*t*s,o=1,r>0||Math.abs(r)<=K?(l=this.x0+this.a*o*t*Math.sin(n)/r,c=this.y0+this.a*o*(this.cos_p14*e-this.sin_p14*t*s)/r):(l=this.x0+this.infinity_dist*t*Math.sin(n),c=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*t*s)),i.x=l,i.y=c,i}function h1(i){var e,t,n,s,o,r;return i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,i.x/=this.k0,i.y/=this.k0,(e=Math.sqrt(i.x*i.x+i.y*i.y))?(s=Math.atan2(e,this.rc),t=Math.sin(s),n=Math.cos(s),r=Ot(n*this.sin_p14+i.y*t*this.cos_p14/e),o=Math.atan2(i.x*t,e*this.cos_p14*n-i.y*this.sin_p14*t),o=X(this.long0+o,this.over)):(r=this.phic0,o=0),i.x=o,i.y=r,i}var u1=["gnom"];const f1={init:c1,forward:d1,inverse:h1,names:u1};function m1(i,e){var t=1-(1-i*i)/(2*i)*Math.log((1-i)/(1+i));if(Math.abs(Math.abs(e)-t)<1e-6)return e<0?-1*j:j;for(var n=Math.asin(.5*e),s,o,r,l,c=0;c<30;c++)if(o=Math.sin(n),r=Math.cos(n),l=i*o,s=Math.pow(1-l*l,2)/(2*r)*(e/(1-i*i)-o/(1-l*l)+.5/i*Math.log((1-l)/(1+l))),n+=s,Math.abs(s)<=1e-10)return n;return NaN}function g1(){this.sphere||(this.k0=Ct(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function p1(i){var e=i.x,t=i.y,n,s,o=X(e-this.long0,this.over);if(this.sphere)n=this.x0+this.a*o*Math.cos(this.lat_ts),s=this.y0+this.a*Math.sin(t)/Math.cos(this.lat_ts);else{var r=Lt(this.e,Math.sin(t));n=this.x0+this.a*this.k0*o,s=this.y0+this.a*r*.5/this.k0}return i.x=n,i.y=s,i}function A1(i){i.x-=this.x0,i.y-=this.y0;var e,t;return this.sphere?(e=X(this.long0+i.x/this.a/Math.cos(this.lat_ts),this.over),t=Math.asin(i.y/this.a*Math.cos(this.lat_ts))):(t=m1(this.e,2*i.y*this.k0/this.a),e=X(this.long0+i.x/(this.a*this.k0),this.over)),i.x=e,i.y=t,i}var y1=["cea"];const E1={init:g1,forward:p1,inverse:A1,names:y1};function C1(){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 v1(i){var e=i.x,t=i.y,n=X(e-this.long0,this.over),s=Ft(t-this.lat0);return i.x=this.x0+this.a*n*this.rc,i.y=this.y0+this.a*s,i}function b1(i){var e=i.x,t=i.y;return i.x=X(this.long0+(e-this.x0)/(this.a*this.rc),this.over),i.y=Ft(this.lat0+(t-this.y0)/this.a),i}var w1=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"];const I1={init:C1,forward:v1,inverse:b1,names:w1};var pc=20;function S1(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=on(this.es),this.e1=an(this.es),this.e2=rn(this.es),this.e3=ln(this.es),this.ml0=this.a*ze(this.e0,this.e1,this.e2,this.e3,this.lat0)}function x1(i){var e=i.x,t=i.y,n,s,o,r=X(e-this.long0,this.over);if(o=r*Math.sin(t),this.sphere)Math.abs(t)<=K?(n=this.a*r,s=-1*this.a*this.lat0):(n=this.a*Math.sin(o)/Math.tan(t),s=this.a*(Ft(t-this.lat0)+(1-Math.cos(o))/Math.tan(t)));else if(Math.abs(t)<=K)n=this.a*r,s=-1*this.ml0;else{var l=Wo(this.a,this.e,Math.sin(t))/Math.tan(t);n=l*Math.sin(o),s=this.a*ze(this.e0,this.e1,this.e2,this.e3,t)-this.ml0+l*(1-Math.cos(o))}return i.x=n+this.x0,i.y=s+this.y0,i}function M1(i){var e,t,n,s,o,r,l,c,d;if(n=i.x-this.x0,s=i.y-this.y0,this.sphere)if(Math.abs(s+this.a*this.lat0)<=K)e=X(n/this.a+this.long0,this.over),t=0;else{r=this.lat0+s/this.a,l=n*n/this.a/this.a+r*r,c=r;var h;for(o=pc;o;--o)if(h=Math.tan(c),d=-1*(r*(c*h+1)-c-.5*(c*c+l)*h)/((c-r)/h-1),c+=d,Math.abs(d)<=K){t=c;break}e=X(this.long0+Math.asin(n*Math.tan(c)/this.a)/Math.sin(t),this.over)}else if(Math.abs(s+this.ml0)<=K)t=0,e=X(this.long0+n/this.a,this.over);else{r=(this.ml0+s)/this.a,l=n*n/this.a/this.a+r*r,c=r;var f,m,u,g,A;for(o=pc;o;--o)if(A=this.e*Math.sin(c),f=Math.sqrt(1-A*A)*Math.tan(c),m=this.a*ze(this.e0,this.e1,this.e2,this.e3,c),u=this.e0-2*this.e1*Math.cos(2*c)+4*this.e2*Math.cos(4*c)-6*this.e3*Math.cos(6*c),g=m/this.a,d=(r*(f*g+1)-g-.5*f*(g*g+l))/(this.es*Math.sin(2*c)*(g*g+l-2*r*g)/(4*f)+(r-g)*(f*u-2/Math.sin(2*c))-u),c-=d,Math.abs(d)<=K){t=c;break}f=Math.sqrt(1-this.es*Math.pow(Math.sin(t),2))*Math.tan(t),e=X(this.long0+Math.asin(n*f/this.a)/Math.sin(t),this.over)}return i.x=e,i.y=t,i}var B1=["Polyconic","American_Polyconic","poly"];const T1={init:S1,forward:x1,inverse:M1,names:B1};function P1(){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 _1(i){var e,t=i.x,n=i.y,s=n-this.lat0,o=t-this.long0,r=s/Xi*1e-5,l=o,c=1,d=0;for(e=1;e<=10;e++)c=c*r,d=d+this.A[e]*c;var h=d,f=l,m=1,u=0,g,A,p=0,y=0;for(e=1;e<=6;e++)g=m*h-u*f,A=u*h+m*f,m=g,u=A,p=p+this.B_re[e]*m-this.B_im[e]*u,y=y+this.B_im[e]*m+this.B_re[e]*u;return i.x=y*this.a+this.x0,i.y=p*this.a+this.y0,i}function D1(i){var e,t=i.x,n=i.y,s=t-this.x0,o=n-this.y0,r=o/this.a,l=s/this.a,c=1,d=0,h,f,m=0,u=0;for(e=1;e<=6;e++)h=c*r-d*l,f=d*r+c*l,c=h,d=f,m=m+this.C_re[e]*c-this.C_im[e]*d,u=u+this.C_im[e]*c+this.C_re[e]*d;for(var g=0;g<this.iterations;g++){var A=m,p=u,y,C,I=r,P=l;for(e=2;e<=6;e++)y=A*m-p*u,C=p*m+A*u,A=y,p=C,I=I+(e-1)*(this.B_re[e]*A-this.B_im[e]*p),P=P+(e-1)*(this.B_im[e]*A+this.B_re[e]*p);A=1,p=0;var k=this.B_re[1],M=this.B_im[1];for(e=2;e<=6;e++)y=A*m-p*u,C=p*m+A*u,A=y,p=C,k=k+e*(this.B_re[e]*A-this.B_im[e]*p),M=M+e*(this.B_im[e]*A+this.B_re[e]*p);var B=k*k+M*M;m=(I*k+P*M)/B,u=(P*k-I*M)/B}var _=m,E=u,w=1,D=0;for(e=1;e<=9;e++)w=w*_,D=D+this.D[e]*w;var F=this.lat0+D*Xi*1e5,U=this.long0+E;return i.x=U,i.y=F,i}var k1=["New_Zealand_Map_Grid","nzmg"];const N1={init:P1,forward:_1,inverse:D1,names:k1};function R1(){}function F1(i){var e=i.x,t=i.y,n=X(e-this.long0,this.over),s=this.x0+this.a*n,o=this.y0+this.a*Math.log(Math.tan(Math.PI/4+t/2.5))*1.25;return i.x=s,i.y=o,i}function L1(i){i.x-=this.x0,i.y-=this.y0;var e=X(this.long0+i.x/this.a,this.over),t=2.5*(Math.atan(Math.exp(.8*i.y/this.a))-Math.PI/4);return i.x=e,i.y=t,i}var O1=["Miller_Cylindrical","mill"];const G1={init:R1,forward:F1,inverse:L1,names:O1};var U1=20;function V1(){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=Vo(this.es)}function Q1(i){var e,t,n=i.x,s=i.y;if(n=X(n-this.long0,this.over),this.sphere){if(!this.m)s=this.n!==1?Math.asin(this.n*Math.sin(s)):s;else for(var o=this.n*Math.sin(s),r=U1;r;--r){var l=(this.m*s+Math.sin(s)-o)/(this.m+Math.cos(s));if(s-=l,Math.abs(l)<K)break}e=this.a*this.C_x*n*(this.m+Math.cos(s)),t=this.a*this.C_y*s}else{var c=Math.sin(s),d=Math.cos(s);t=this.a*Si(s,c,d,this.en),e=this.a*n*d/Math.sqrt(1-this.es*c*c)}return i.x=e,i.y=t,i}function H1(i){var e,t,n,s;return i.x-=this.x0,n=i.x/this.a,i.y-=this.y0,e=i.y/this.a,this.sphere?(e/=this.C_y,n=n/(this.C_x*(this.m+Math.cos(e))),this.m?e=Ot((this.m*e+Math.sin(e))/this.n):this.n!==1&&(e=Ot(Math.sin(e)/this.n)),n=X(n+this.long0,this.over),e=Ft(e)):(e=Qo(i.y/this.a,this.es,this.en),s=Math.abs(e),s<j?(s=Math.sin(e),t=this.long0+i.x*Math.sqrt(1-this.es*s*s)/(this.a*Math.cos(e)),n=X(t,this.over)):s-K<j&&(n=this.long0)),i.x=n,i.y=e,i}var Y1=["Sinusoidal","sinu"];const z1={init:V1,forward:Q1,inverse:H1,names:Y1};function j1(){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}function W1(i){for(var e=i.x,t=i.y,n=X(e-this.long0,this.over),s=t,o=Math.PI*Math.sin(t);;){var r=-(s+Math.sin(s)-o)/(1+Math.cos(s));if(s+=r,Math.abs(r)<K)break}s/=2,Math.PI/2-Math.abs(t)<K&&(n=0);var l=.900316316158*this.a*n*Math.cos(s)+this.x0,c=1.4142135623731*this.a*Math.sin(s)+this.y0;return i.x=l,i.y=c,i}function $1(i){var e,t;i.x-=this.x0,i.y-=this.y0,t=i.y/(1.4142135623731*this.a),Math.abs(t)>.999999999999&&(t=.999999999999),e=Math.asin(t);var n=X(this.long0+i.x/(.900316316158*this.a*Math.cos(e)),this.over);n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),t=(2*e+Math.sin(2*e))/Math.PI,Math.abs(t)>1&&(t=1);var s=Math.asin(t);return i.x=n,i.y=s,i}var K1=["Mollweide","moll"];const q1={init:j1,forward:W1,inverse:$1,names:K1};function X1(){Math.abs(this.lat1+this.lat2)<K||(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=on(this.es),this.e1=an(this.es),this.e2=rn(this.es),this.e3=ln(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=Ct(this.e,this.sin_phi,this.cos_phi),this.ml1=ze(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<K?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=Ct(this.e,this.sin_phi,this.cos_phi),this.ml2=ze(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=ze(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function J1(i){var e=i.x,t=i.y,n;if(this.sphere)n=this.a*(this.g-t);else{var s=ze(this.e0,this.e1,this.e2,this.e3,t);n=this.a*(this.g-s)}var o=this.ns*X(e-this.long0,this.over),r=this.x0+n*Math.sin(o),l=this.y0+this.rh-n*Math.cos(o);return i.x=r,i.y=l,i}function Z1(i){i.x-=this.x0,i.y=this.rh-i.y+this.y0;var e,t,n,s;this.ns>=0?(t=Math.sqrt(i.x*i.x+i.y*i.y),e=1):(t=-Math.sqrt(i.x*i.x+i.y*i.y),e=-1);var o=0;if(t!==0&&(o=Math.atan2(e*i.x,e*i.y)),this.sphere)return s=X(this.long0+o/this.ns,this.over),n=Ft(this.g-t/this.a),i.x=s,i.y=n,i;var r=this.g-t/this.a;return n=ls(r,this.e0,this.e1,this.e2,this.e3),s=X(this.long0+o/this.ns,this.over),i.x=s,i.y=n,i}var eE=["Equidistant_Conic","eqdc"];const tE={init:X1,forward:J1,inverse:Z1,names:eE};function iE(){this.R=this.a}function nE(i){var e=i.x,t=i.y,n=X(e-this.long0,this.over),s,o;Math.abs(t)<=K&&(s=this.x0+this.R*n,o=this.y0);var r=Ot(2*Math.abs(t/Math.PI));(Math.abs(n)<=K||Math.abs(Math.abs(t)-j)<=K)&&(s=this.x0,t>=0?o=this.y0+Math.PI*this.R*Math.tan(.5*r):o=this.y0+Math.PI*this.R*-Math.tan(.5*r));var l=.5*Math.abs(Math.PI/n-n/Math.PI),c=l*l,d=Math.sin(r),h=Math.cos(r),f=h/(d+h-1),m=f*f,u=f*(2/d-1),g=u*u,A=Math.PI*this.R*(l*(f-g)+Math.sqrt(c*(f-g)*(f-g)-(g+c)*(m-g)))/(g+c);n<0&&(A=-A),s=this.x0+A;var p=c+f;return A=Math.PI*this.R*(u*p-l*Math.sqrt((g+c)*(c+1)-p*p))/(g+c),t>=0?o=this.y0+A:o=this.y0-A,i.x=s,i.y=o,i}function sE(i){var e,t,n,s,o,r,l,c,d,h,f,m,u;return i.x-=this.x0,i.y-=this.y0,f=Math.PI*this.R,n=i.x/f,s=i.y/f,o=n*n+s*s,r=-Math.abs(s)*(1+o),l=r-2*s*s+n*n,c=-2*r+1+2*s*s+o*o,u=s*s/c+(2*l*l*l/c/c/c-9*r*l/c/c)/27,d=(r-l*l/3/c)/c,h=2*Math.sqrt(-d/3),f=3*u/d/h,Math.abs(f)>1&&(f>=0?f=1:f=-1),m=Math.acos(f)/3,i.y>=0?t=(-h*Math.cos(m+Math.PI/3)-l/3/c)*Math.PI:t=-(-h*Math.cos(m+Math.PI/3)-l/3/c)*Math.PI,Math.abs(n)<K?e=this.long0:e=X(this.long0+Math.PI*(o-1+Math.sqrt(1+2*(n*n-s*s)+o*o))/2/n,this.over),i.x=e,i.y=t,i}var oE=["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"];const aE={init:iE,forward:nE,inverse:sE,names:oE};function rE(i,e,t,n,s,o){const r=n-e,l=Math.atan((1-o)*Math.tan(i)),c=Math.atan((1-o)*Math.tan(t)),d=Math.sin(l),h=Math.cos(l),f=Math.sin(c),m=Math.cos(c);let u=r,g,A=100,p,y,C,I,P,k,M,B,_,E,w,D,F,U;do{if(p=Math.sin(u),y=Math.cos(u),C=Math.sqrt(m*p*(m*p)+(h*f-d*m*y)*(h*f-d*m*y)),C===0)return{azi1:0,s12:0};I=d*f+h*m*y,P=Math.atan2(C,I),k=h*m*p/C,M=1-k*k,B=M!==0?I-2*d*f/M:0,_=o/16*M*(4+o*(4-3*M)),g=u,u=r+(1-_)*o*k*(P+_*C*(B+_*I*(-1+2*B*B)))}while(Math.abs(u-g)>1e-12&&--A>0);return A===0?{azi1:NaN,s12:NaN}:(E=M*(s*s-s*(1-o)*(s*(1-o)))/(s*(1-o)*(s*(1-o))),w=1+E/16384*(4096+E*(-768+E*(320-175*E))),D=E/1024*(256+E*(-128+E*(74-47*E))),F=D*C*(B+D/4*(I*(-1+2*B*B)-D/6*B*(-3+4*C*C)*(-3+4*B*B))),U=s*(1-o)*w*(P-F),{azi1:Math.atan2(m*p,h*f-d*m*y),s12:U})}function lE(i,e,t,n,s,o){const r=Math.atan((1-o)*Math.tan(i)),l=Math.sin(r),c=Math.cos(r),d=Math.sin(t),h=Math.cos(t),f=Math.atan2(l,c*h),m=c*d,u=1-m*m,g=u*(s*s-s*(1-o)*(s*(1-o)))/(s*(1-o)*(s*(1-o))),A=1+g/16384*(4096+g*(-768+g*(320-175*g))),p=g/1024*(256+g*(-128+g*(74-47*g)));let y=n/(s*(1-o)*A),C,I=100,P,k,M,B;do P=Math.cos(2*f+y),k=Math.sin(y),M=Math.cos(y),B=p*k*(P+p/4*(M*(-1+2*P*P)-p/6*P*(-3+4*k*k)*(-3+4*P*P))),C=y,y=n/(s*(1-o)*A)+B;while(Math.abs(y-C)>1e-12&&--I>0);if(I===0)return{lat2:NaN,lon2:NaN};const _=l*k-c*M*h,E=Math.atan2(l*M+c*k*h,(1-o)*Math.sqrt(m*m+_*_)),w=Math.atan2(k*d,c*M-l*k*h),D=o/16*u*(4+o*(4-3*u)),F=w-(1-D)*o*m*(y+D*k*(P+D*M*(-1+2*P*P))),U=e+F;return{lat2:E,lon2:U}}function cE(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.f=this.es/(1+Math.sqrt(1-this.es))}function dE(i){var e=i.x,t=i.y,n=Math.sin(i.y),s=Math.cos(i.y),o=X(e-this.long0,this.over),r,l,c,d,h,f,m,u,g,A,p;return this.sphere?Math.abs(this.sin_p12-1)<=K?(i.x=this.x0+this.a*(j-t)*Math.sin(o),i.y=this.y0-this.a*(j-t)*Math.cos(o),i):Math.abs(this.sin_p12+1)<=K?(i.x=this.x0+this.a*(j+t)*Math.sin(o),i.y=this.y0+this.a*(j+t)*Math.cos(o),i):(g=this.sin_p12*n+this.cos_p12*s*Math.cos(o),m=Math.acos(g),u=m?m/Math.sin(m):1,i.x=this.x0+this.a*u*s*Math.sin(o),i.y=this.y0+this.a*u*(this.cos_p12*n-this.sin_p12*s*Math.cos(o)),i):(r=on(this.es),l=an(this.es),c=rn(this.es),d=ln(this.es),Math.abs(this.sin_p12-1)<=K?(h=this.a*ze(r,l,c,d,j),f=this.a*ze(r,l,c,d,t),i.x=this.x0+(h-f)*Math.sin(o),i.y=this.y0-(h-f)*Math.cos(o),i):Math.abs(this.sin_p12+1)<=K?(h=this.a*ze(r,l,c,d,j),f=this.a*ze(r,l,c,d,t),i.x=this.x0+(h+f)*Math.sin(o),i.y=this.y0+(h+f)*Math.cos(o),i):Math.abs(e)<K&&Math.abs(t-this.lat0)<K?(i.x=i.y=0,i):(A=rE(this.lat0,this.long0,t,e,this.a,this.f),p=A.azi1,i.x=A.s12*Math.sin(p),i.y=A.s12*Math.cos(p),i))}function hE(i){i.x-=this.x0,i.y-=this.y0;var e,t,n,s,o,r,l,c,d,h,f,m,u,g,A,p;return this.sphere?(e=Math.sqrt(i.x*i.x+i.y*i.y),e>2*j*this.a?void 0:(t=e/this.a,n=Math.sin(t),s=Math.cos(t),o=this.long0,Math.abs(e)<=K?r=this.lat0:(r=Ot(s*this.sin_p12+i.y*n*this.cos_p12/e),l=Math.abs(this.lat0)-j,Math.abs(l)<=K?this.lat0>=0?o=X(this.long0+Math.atan2(i.x,-i.y),this.over):o=X(this.long0-Math.atan2(-i.x,i.y),this.over):o=X(this.long0+Math.atan2(i.x*n,e*this.cos_p12*s-i.y*this.sin_p12*n),this.over)),i.x=o,i.y=r,i)):(c=on(this.es),d=an(this.es),h=rn(this.es),f=ln(this.es),Math.abs(this.sin_p12-1)<=K?(m=this.a*ze(c,d,h,f,j),e=Math.sqrt(i.x*i.x+i.y*i.y),u=m-e,r=ls(u/this.a,c,d,h,f),o=X(this.long0+Math.atan2(i.x,-1*i.y),this.over),i.x=o,i.y=r,i):Math.abs(this.sin_p12+1)<=K?(m=this.a*ze(c,d,h,f,j),e=Math.sqrt(i.x*i.x+i.y*i.y),u=e-m,r=ls(u/this.a,c,d,h,f),o=X(this.long0+Math.atan2(i.x,i.y),this.over),i.x=o,i.y=r,i):(g=Math.atan2(i.x,i.y),A=Math.sqrt(i.x*i.x+i.y*i.y),p=lE(this.lat0,this.long0,g,A,this.a,this.f),i.x=p.lon2,i.y=p.lat2,i))}var uE=["Azimuthal_Equidistant","aeqd"];const fE={init:cE,forward:dE,inverse:hE,names:uE};function mE(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function gE(i){var e,t,n,s,o,r,l,c,d=i.x,h=i.y;return n=X(d-this.long0,this.over),e=Math.sin(h),t=Math.cos(h),s=Math.cos(n),r=this.sin_p14*e+this.cos_p14*t*s,o=1,(r>0||Math.abs(r)<=K)&&(l=this.a*o*t*Math.sin(n),c=this.y0+this.a*o*(this.cos_p14*e-this.sin_p14*t*s)),i.x=l,i.y=c,i}function pE(i){var e,t,n,s,o,r,l;return i.x-=this.x0,i.y-=this.y0,e=Math.sqrt(i.x*i.x+i.y*i.y),t=Ot(e/this.a),n=Math.sin(t),s=Math.cos(t),r=this.long0,Math.abs(e)<=K?(l=this.lat0,i.x=r,i.y=l,i):(l=Ot(s*this.sin_p14+i.y*n*this.cos_p14/e),o=Math.abs(this.lat0)-j,Math.abs(o)<=K?(this.lat0>=0?r=X(this.long0+Math.atan2(i.x,-i.y),this.over):r=X(this.long0-Math.atan2(-i.x,i.y),this.over),i.x=r,i.y=l,i):(r=X(this.long0+Math.atan2(i.x*n,e*this.cos_p14*s-i.y*this.sin_p14*n),this.over),i.x=r,i.y=l,i))}var AE=["ortho"];const yE={init:mE,forward:gE,inverse:pE,names:AE};var Ie={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},fe={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function EE(){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>=j-ue/2?this.face=Ie.TOP:this.lat0<=-(j-ue/2)?this.face=Ie.BOTTOM:Math.abs(this.long0)<=ue?this.face=Ie.FRONT:Math.abs(this.long0)<=j+ue?this.face=this.long0>0?Ie.RIGHT:Ie.LEFT:this.face=Ie.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 CE(i){var e={x:0,y:0},t,n,s,o,r,l,c={value:0};if(i.x-=this.long0,this.es!==0?t=Math.atan(this.one_minus_f_squared*Math.tan(i.y)):t=i.y,n=i.x,this.face===Ie.TOP)o=j-t,n>=ue&&n<=j+ue?(c.value=fe.AREA_0,s=n-j):n>j+ue||n<=-(j+ue)?(c.value=fe.AREA_1,s=n>0?n-Me:n+Me):n>-(j+ue)&&n<=-ue?(c.value=fe.AREA_2,s=n+j):(c.value=fe.AREA_3,s=n);else if(this.face===Ie.BOTTOM)o=j+t,n>=ue&&n<=j+ue?(c.value=fe.AREA_0,s=-n+j):n<ue&&n>=-ue?(c.value=fe.AREA_1,s=-n):n<-ue&&n>=-(j+ue)?(c.value=fe.AREA_2,s=-n-j):(c.value=fe.AREA_3,s=n>0?-n+Me:-n-Me);else{var d,h,f,m,u,g,A;this.face===Ie.RIGHT?n=Mi(n,+j):this.face===Ie.BACK?n=Mi(n,+Me):this.face===Ie.LEFT&&(n=Mi(n,-j)),m=Math.sin(t),u=Math.cos(t),g=Math.sin(n),A=Math.cos(n),d=u*A,h=u*g,f=m,this.face===Ie.FRONT?(o=Math.acos(d),s=ds(o,f,h,c)):this.face===Ie.RIGHT?(o=Math.acos(h),s=ds(o,f,-d,c)):this.face===Ie.BACK?(o=Math.acos(-d),s=ds(o,f,-h,c)):this.face===Ie.LEFT?(o=Math.acos(-h),s=ds(o,f,d,c)):(o=s=0,c.value=fe.AREA_0)}return l=Math.atan(12/Me*(s+Math.acos(Math.sin(s)*Math.cos(ue))-j)),r=Math.sqrt((1-Math.cos(o))/(Math.cos(l)*Math.cos(l))/(1-Math.cos(Math.atan(1/Math.cos(s))))),c.value===fe.AREA_1?l+=j:c.value===fe.AREA_2?l+=Me:c.value===fe.AREA_3&&(l+=1.5*Me),e.x=r*Math.cos(l),e.y=r*Math.sin(l),e.x=e.x*this.a+this.x0,e.y=e.y*this.a+this.y0,i.x=e.x,i.y=e.y,i}function vE(i){var e={lam:0,phi:0},t,n,s,o,r,l,c,d,h,f={value:0};if(i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,n=Math.atan(Math.sqrt(i.x*i.x+i.y*i.y)),t=Math.atan2(i.y,i.x),i.x>=0&&i.x>=Math.abs(i.y)?f.value=fe.AREA_0:i.y>=0&&i.y>=Math.abs(i.x)?(f.value=fe.AREA_1,t-=j):i.x<0&&-i.x>=Math.abs(i.y)?(f.value=fe.AREA_2,t=t<0?t+Me:t-Me):(f.value=fe.AREA_3,t+=j),h=Me/12*Math.tan(t),r=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),l=Math.atan(r),s=Math.cos(t),o=Math.tan(n),c=1-s*s*o*o*(1-Math.cos(Math.atan(1/Math.cos(l)))),c<-1?c=-1:c>1&&(c=1),this.face===Ie.TOP)d=Math.acos(c),e.phi=j-d,f.value===fe.AREA_0?e.lam=l+j:f.value===fe.AREA_1?e.lam=l<0?l+Me:l-Me:f.value===fe.AREA_2?e.lam=l-j:e.lam=l;else if(this.face===Ie.BOTTOM)d=Math.acos(c),e.phi=d-j,f.value===fe.AREA_0?e.lam=-l+j:f.value===fe.AREA_1?e.lam=-l:f.value===fe.AREA_2?e.lam=-l-j:e.lam=l<0?-l-Me:-l+Me;else{var m,u,g;m=c,h=m*m,h>=1?g=0:g=Math.sqrt(1-h)*Math.sin(l),h+=g*g,h>=1?u=0:u=Math.sqrt(1-h),f.value===fe.AREA_1?(h=u,u=-g,g=h):f.value===fe.AREA_2?(u=-u,g=-g):f.value===fe.AREA_3&&(h=u,u=g,g=-h),this.face===Ie.RIGHT?(h=m,m=-u,u=h):this.face===Ie.BACK?(m=-m,u=-u):this.face===Ie.LEFT&&(h=m,m=u,u=-h),e.phi=Math.acos(-g)-j,e.lam=Math.atan2(u,m),this.face===Ie.RIGHT?e.lam=Mi(e.lam,-j):this.face===Ie.BACK?e.lam=Mi(e.lam,-Me):this.face===Ie.LEFT&&(e.lam=Mi(e.lam,+j))}if(this.es!==0){var A,p,y;A=e.phi<0?1:0,p=Math.tan(e.phi),y=this.b/Math.sqrt(p*p+this.one_minus_f_squared),e.phi=Math.atan(Math.sqrt(this.a*this.a-y*y)/(this.one_minus_f*y)),A&&(e.phi=-e.phi)}return e.lam+=this.long0,i.x=e.lam,i.y=e.phi,i}function ds(i,e,t,n){var s;return i<K?(n.value=fe.AREA_0,s=0):(s=Math.atan2(e,t),Math.abs(s)<=ue?n.value=fe.AREA_0:s>ue&&s<=j+ue?(n.value=fe.AREA_1,s-=j):s>j+ue||s<=-(j+ue)?(n.value=fe.AREA_2,s=s>=0?s-Me:s+Me):(n.value=fe.AREA_3,s+=j)),s}function Mi(i,e){var t=i+e;return t<-Me?t+=Ji:t>+Me&&(t-=Ji),t}var bE=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const wE={init:EE,forward:CE,inverse:vE,names:bE};var Xo=[[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]],cn=[[-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]],Ac=.8487,yc=1.3523,Ec=$e/5,IE=1/Ec,Bi=18,hs=function(i,e){return i[0]+e*(i[1]+e*(i[2]+e*i[3]))},SE=function(i,e){return i[1]+e*(2*i[2]+e*3*i[3])};function xE(i,e,t,n){for(var s=e;n;--n){var o=i(s);if(s-=o,Math.abs(o)<t)break}return s}function ME(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function BE(i){var e=X(i.x-this.long0,this.over),t=Math.abs(i.y),n=Math.floor(t*Ec);n<0?n=0:n>=Bi&&(n=Bi-1),t=$e*(t-IE*n);var s={x:hs(Xo[n],t)*e,y:hs(cn[n],t)};return i.y<0&&(s.y=-s.y),s.x=s.x*this.a*Ac+this.x0,s.y=s.y*this.a*yc+this.y0,s}function TE(i){var e={x:(i.x-this.x0)/(this.a*Ac),y:Math.abs(i.y-this.y0)/(this.a*yc)};if(e.y>=1)e.x/=Xo[Bi][0],e.y=i.y<0?-j:j;else{var t=Math.floor(e.y*Bi);for(t<0?t=0:t>=Bi&&(t=Bi-1);;)if(cn[t][0]>e.y)--t;else if(cn[t+1][0]<=e.y)++t;else break;var n=cn[t],s=5*(e.y-n[0])/(cn[t+1][0]-n[0]);s=xE(function(o){return(hs(n,o)-e.y)/SE(n,o)},s,K,100),e.x/=hs(Xo[t],s),e.y=(5*t+s)*xe,i.y<0&&(e.y=-e.y)}return e.x=X(e.x+this.long0,this.over),e}var PE=["Robinson","robin"];const _E={init:ME,forward:BE,inverse:TE,names:PE};function DE(){this.name="geocent"}function kE(i){var e=Kl(i,this.es,this.a);return e}function NE(i){var e=ql(i,this.es,this.a,this.b);return e}var RE=["Geocentric","geocentric","geocent","Geocent"];const FE={init:DE,forward:kE,inverse:NE,names:RE};var Qe={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},dn={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 LE(){if(Object.keys(dn).forEach((function(t){if(typeof this[t]>"u")this[t]=dn[t].def;else{if(dn[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);dn[t].num&&(this[t]=parseFloat(this[t]))}dn[t].degrees&&(this[t]=this[t]*xe)}).bind(this)),Math.abs(Math.abs(this.lat0)-j)<K?this.mode=this.lat0<0?Qe.S_POLE:Qe.N_POLE:Math.abs(this.lat0)<K?this.mode=Qe.EQUIT:(this.mode=Qe.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 i=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(i),this.sw=Math.sin(i)}function OE(i){i.x-=this.long0;var e=Math.sin(i.y),t=Math.cos(i.y),n=Math.cos(i.x),s,o;switch(this.mode){case Qe.OBLIQ:o=this.sinph0*e+this.cosph0*t*n;break;case Qe.EQUIT:o=t*n;break;case Qe.S_POLE:o=-e;break;case Qe.N_POLE:o=e;break}switch(o=this.pn1/(this.p-o),s=o*t*Math.sin(i.x),this.mode){case Qe.OBLIQ:o*=this.cosph0*e-this.sinph0*t*n;break;case Qe.EQUIT:o*=e;break;case Qe.N_POLE:o*=-(t*n);break;case Qe.S_POLE:o*=t*n;break}var r,l;return r=o*this.cg+s*this.sg,l=1/(r*this.sw*this.h1+this.cw),s=(s*this.cg-o*this.sg)*this.cw*l,o=r*l,i.x=s*this.a,i.y=o*this.a,i}function GE(i){i.x/=this.a,i.y/=this.a;var e={x:i.x,y:i.y},t,n,s;s=1/(this.pn1-i.y*this.sw),t=this.pn1*i.x*s,n=this.pn1*i.y*this.cw*s,i.x=t*this.cg+n*this.sg,i.y=n*this.cg-t*this.sg;var o=Xe(i.x,i.y);if(Math.abs(o)<K)e.x=0,e.y=i.y;else{var r,l;switch(l=1-o*o*this.pfact,l=(this.p-Math.sqrt(l))/(this.pn1/o+o/this.pn1),r=Math.sqrt(1-l*l),this.mode){case Qe.OBLIQ:e.y=Math.asin(r*this.sinph0+i.y*l*this.cosph0/o),i.y=(r-this.sinph0*Math.sin(e.y))*o,i.x*=l*this.cosph0;break;case Qe.EQUIT:e.y=Math.asin(i.y*l/o),i.y=r*o,i.x*=l;break;case Qe.N_POLE:e.y=Math.asin(r),i.y=-i.y;break;case Qe.S_POLE:e.y=-Math.asin(r);break}e.x=Math.atan2(i.x,i.y)}return i.x=e.x+this.long0,i.y=e.y,i}var UE=["Tilted_Perspective","tpers"];const VE={init:LE,forward:OE,inverse:GE,names:UE};function QE(){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 i=1-this.es,e=1/i;this.radius_p=Math.sqrt(i),this.radius_p2=i,this.radius_p_inv2=e,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 HE(i){var e=i.x,t=i.y,n,s,o,r;if(e=e-this.long0,this.shape==="ellipse"){t=Math.atan(this.radius_p2*Math.tan(t));var l=this.radius_p/Xe(this.radius_p*Math.cos(t),Math.sin(t));if(s=l*Math.cos(e)*Math.cos(t),o=l*Math.sin(e)*Math.cos(t),r=l*Math.sin(t),(this.radius_g-s)*s-o*o-r*r*this.radius_p_inv2<0)return i.x=Number.NaN,i.y=Number.NaN,i;n=this.radius_g-s,this.flip_axis?(i.x=this.radius_g_1*Math.atan(o/Xe(r,n)),i.y=this.radius_g_1*Math.atan(r/n)):(i.x=this.radius_g_1*Math.atan(o/n),i.y=this.radius_g_1*Math.atan(r/Xe(o,n)))}else this.shape==="sphere"&&(n=Math.cos(t),s=Math.cos(e)*n,o=Math.sin(e)*n,r=Math.sin(t),n=this.radius_g-s,this.flip_axis?(i.x=this.radius_g_1*Math.atan(o/Xe(r,n)),i.y=this.radius_g_1*Math.atan(r/n)):(i.x=this.radius_g_1*Math.atan(o/n),i.y=this.radius_g_1*Math.atan(r/Xe(o,n))));return i.x=i.x*this.a,i.y=i.y*this.a,i}function YE(i){var e=-1,t=0,n=0,s,o,r,l;if(i.x=i.x/this.a,i.y=i.y/this.a,this.shape==="ellipse"){this.flip_axis?(n=Math.tan(i.y/this.radius_g_1),t=Math.tan(i.x/this.radius_g_1)*Xe(1,n)):(t=Math.tan(i.x/this.radius_g_1),n=Math.tan(i.y/this.radius_g_1)*Xe(1,t));var c=n/this.radius_p;if(s=t*t+c*c+e*e,o=2*this.radius_g*e,r=o*o-4*s*this.C,r<0)return i.x=Number.NaN,i.y=Number.NaN,i;l=(-o-Math.sqrt(r))/(2*s),e=this.radius_g+l*e,t*=l,n*=l,i.x=Math.atan2(t,e),i.y=Math.atan(n*Math.cos(i.x)/e),i.y=Math.atan(this.radius_p_inv2*Math.tan(i.y))}else if(this.shape==="sphere"){if(this.flip_axis?(n=Math.tan(i.y/this.radius_g_1),t=Math.tan(i.x/this.radius_g_1)*Math.sqrt(1+n*n)):(t=Math.tan(i.x/this.radius_g_1),n=Math.tan(i.y/this.radius_g_1)*Math.sqrt(1+t*t)),s=t*t+n*n+e*e,o=2*this.radius_g*e,r=o*o-4*s*this.C,r<0)return i.x=Number.NaN,i.y=Number.NaN,i;l=(-o-Math.sqrt(r))/(2*s),e=this.radius_g+l*e,t*=l,n*=l,i.x=Math.atan2(t,e),i.y=Math.atan(n*Math.cos(i.x)/e)}return i.x=i.x+this.long0,i}var zE=["Geostationary Satellite View","Geostationary_Satellite","geos"];const jE={init:QE,forward:HE,inverse:YE,names:zE};var hn=1.340264,un=-.081106,fn=893e-6,mn=.003796,us=Math.sqrt(3)/2;function WE(){this.es=0,this.long0=this.long0!==void 0?this.long0:0,this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0}function $E(i){var e=X(i.x-this.long0,this.over),t=i.y,n=Math.asin(us*Math.sin(t)),s=n*n,o=s*s*s;return i.x=e*Math.cos(n)/(us*(hn+3*un*s+o*(7*fn+9*mn*s))),i.y=n*(hn+un*s+o*(fn+mn*s)),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function KE(i){i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a;var e=1e-9,t=12,n=i.y,s,o,r,l,c,d;for(d=0;d<t&&(s=n*n,o=s*s*s,r=n*(hn+un*s+o*(fn+mn*s))-i.y,l=hn+3*un*s+o*(7*fn+9*mn*s),n-=c=r/l,!(Math.abs(c)<e));++d);return s=n*n,o=s*s*s,i.x=us*i.x*(hn+3*un*s+o*(7*fn+9*mn*s))/Math.cos(n),i.y=Math.asin(Math.sin(n)/us),i.x=X(i.x+this.long0,this.over),i}var qE=["eqearth","Equal Earth","Equal_Earth"];const XE={init:WE,forward:$E,inverse:KE,names:qE};var gn=1e-10;function JE(){var i;if(this.phi1=this.lat1,Math.abs(this.phi1)<gn)throw new Error;this.es?(this.en=Vo(this.es),this.m1=Si(this.phi1,this.am1=Math.sin(this.phi1),i=Math.cos(this.phi1),this.en),this.am1=i/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=eC,this.forward=ZE):(Math.abs(this.phi1)+gn>=j?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=iC,this.forward=tC)}function ZE(i){var e=X(i.x-(this.long0||0),this.over),t=i.y,n,s,o;return n=this.am1+this.m1-Si(t,s=Math.sin(t),o=Math.cos(t),this.en),s=o*e/(n*Math.sqrt(1-this.es*s*s)),i.x=n*Math.sin(s),i.y=this.am1-n*Math.cos(s),i.x=this.a*i.x+(this.x0||0),i.y=this.a*i.y+(this.y0||0),i}function eC(i){i.x=(i.x-(this.x0||0))/this.a,i.y=(i.y-(this.y0||0))/this.a;var e,t,n,s;if(t=Xe(i.x,i.y=this.am1-i.y),s=Qo(this.am1+this.m1-t,this.es,this.en),(e=Math.abs(s))<j)e=Math.sin(s),n=t*Math.atan2(i.x,i.y)*Math.sqrt(1-this.es*e*e)/Math.cos(s);else if(Math.abs(e-j)<=gn)n=0;else throw new Error;return i.x=X(n+(this.long0||0),this.over),i.y=Ft(s),i}function tC(i){var e=X(i.x-(this.long0||0),this.over),t=i.y,n,s;return s=this.cphi1+this.phi1-t,Math.abs(s)>gn?(i.x=s*Math.sin(n=e*Math.cos(t)/s),i.y=this.cphi1-s*Math.cos(n)):i.x=i.y=0,i.x=this.a*i.x+(this.x0||0),i.y=this.a*i.y+(this.y0||0),i}function iC(i){i.x=(i.x-(this.x0||0))/this.a,i.y=(i.y-(this.y0||0))/this.a;var e,t,n=Xe(i.x,i.y=this.cphi1-i.y);if(t=this.cphi1+this.phi1-n,Math.abs(t)>j)throw new Error;return Math.abs(Math.abs(t)-j)<=gn?e=0:e=n*Math.atan2(i.x,i.y)/Math.cos(t),i.x=X(e+(this.long0||0),this.over),i.y=Ft(t),i}var nC=["bonne","Bonne (Werner lat_1=90)"];const sC={init:JE,names:nC},Cc={OBLIQUE:{forward:cC,inverse:hC},TRANSVERSE:{forward:dC,inverse:uC}},fs={ROTATE:{o_alpha:"oAlpha",o_lon_c:"oLongC",o_lat_c:"oLatC"},NEW_POLE:{o_lat_p:"oLatP",o_lon_p:"oLongP"},NEW_EQUATOR:{o_lon_1:"oLong1",o_lat_1:"oLat1",o_lon_2:"oLong2",o_lat_2:"oLat2"}};function oC(){if(this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.title=this.title||"General Oblique Transformation",this.isIdentity=Yl.includes(this.o_proj),!this.o_proj)throw new Error("Missing parameter: o_proj");if(this.o_proj==="ob_tran")throw new Error("Invalid value for o_proj: "+this.o_proj);const i=this.projStr.replace("+proj=ob_tran","").replace("+o_proj=","+proj=").trim(),e=st(i);if(!e)throw new Error("Invalid parameter: o_proj. Unknown projection "+this.o_proj);e.long0=0,this.obliqueProjection=e;let t;const n=Object.keys(fs),s=l=>{if(typeof this[l]>"u")return;const c=parseFloat(this[l])*xe;if(isNaN(c))throw new Error("Invalid value for "+l+": "+this[l]);return c};for(let l=0;l<n.length;l++){const c=n[l],d=fs[c],h=Object.entries(d);if(h.some(([m])=>typeof this[m]<"u")){t=d;for(let m=0;m<h.length;m++){const[u,g]=h[m],A=s(u);if(typeof A>"u")throw new Error("Missing parameter: "+u+".");this[g]=A}break}}if(!t)throw new Error("No valid parameters provided for ob_tran projection.");const{lamp:o,phip:r}=lC(this,t);this.lamp=o,Math.abs(r)>K?(this.cphip=Math.cos(r),this.sphip=Math.sin(r),this.projectionType=Cc.OBLIQUE):this.projectionType=Cc.TRANSVERSE}function aC(i){return this.projectionType.forward(this,i)}function rC(i){return this.projectionType.inverse(this,i)}function lC(i,e){let t,n;if(e===fs.ROTATE){let s=i.oLongC,o=i.oLatC,r=i.oAlpha;if(Math.abs(Math.abs(o)-j)<=K)throw new Error("Invalid value for o_lat_c: "+i.o_lat_c+" should be < 90°");n=s+Math.atan2(-1*Math.cos(r),-1*Math.sin(r)*Math.sin(o)),t=Math.asin(Math.cos(o)*Math.sin(r))}else if(e===fs.NEW_POLE)n=i.oLongP,t=i.oLatP;else{let s=i.oLong1,o=i.oLat1,r=i.oLong2,l=i.oLat2,c=Math.abs(o);if(Math.abs(o)>j-K)throw new Error("Invalid value for o_lat_1: "+i.o_lat_1+" should be < 90°");if(Math.abs(l)>j-K)throw new Error("Invalid value for o_lat_2: "+i.o_lat_2+" should be < 90°");if(Math.abs(o-l)<K)throw new Error("Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2");if(c<K)throw new Error("Invalid value for o_lat_1: o_lat_1 should be different from zero");n=Math.atan2(Math.cos(o)*Math.sin(l)*Math.cos(s)-Math.sin(o)*Math.cos(l)*Math.cos(r),Math.sin(o)*Math.cos(l)*Math.sin(r)-Math.cos(o)*Math.sin(l)*Math.sin(s)),t=Math.atan(-1*Math.cos(n-s)/Math.tan(o))}return{lamp:n,phip:t}}function cC(i,e){let{x:t,y:n}=e;t+=i.long0;const s=Math.cos(t),o=Math.sin(n),r=Math.cos(n);e.x=X(Math.atan2(r*Math.sin(t),i.sphip*r*s+i.cphip*o)+i.lamp),e.y=Math.asin(i.sphip*o-i.cphip*r*s);const l=i.obliqueProjection.forward(e);return i.isIdentity&&(l.x*=$e,l.y*=$e),l}function dC(i,e){let{x:t,y:n}=e;t+=i.long0;const s=Math.cos(n),o=Math.cos(t);e.x=X(Math.atan2(s*Math.sin(t),Math.sin(n))+i.lamp),e.y=Math.asin(-1*s*o);const r=i.obliqueProjection.forward(e);return i.isIdentity&&(r.x*=$e,r.y*=$e),r}function hC(i,e){i.isIdentity&&(e.x*=xe,e.y*=xe);const t=i.obliqueProjection.inverse(e);let{x:n,y:s}=t;if(n<Number.MAX_VALUE){n-=i.lamp;const o=Math.cos(n),r=Math.sin(s),l=Math.cos(s);e.x=Math.atan2(l*Math.sin(n),i.sphip*l*o-i.cphip*r),e.y=Math.asin(i.sphip*r+i.cphip*l*o)}return e.x=X(e.x+i.long0),e}function uC(i,e){i.isIdentity&&(e.x*=xe,e.y*=xe);const t=i.obliqueProjection.inverse(e);let{x:n,y:s}=t;if(n<Number.MAX_VALUE){const o=Math.cos(s);n-=i.lamp,e.x=Math.atan2(o*Math.sin(n),-1*Math.sin(s)),e.y=Math.asin(o*Math.cos(n))}return e.x=X(e.x+i.long0),e}var fC=["General Oblique Transformation","General_Oblique_Transformation","ob_tran"];const mC={init:oC,forward:aC,inverse:rC,names:fC};function gC(i){i.Proj.projections.add(as),i.Proj.projections.add(rs),i.Proj.projections.add(ny),i.Proj.projections.add(uy),i.Proj.projections.add(Ay),i.Proj.projections.add(by),i.Proj.projections.add(By),i.Proj.projections.add(ky),i.Proj.projections.add(Oy),i.Proj.projections.add(Hy),i.Proj.projections.add(i1),i.Proj.projections.add(l1),i.Proj.projections.add(f1),i.Proj.projections.add(E1),i.Proj.projections.add(I1),i.Proj.projections.add(T1),i.Proj.projections.add(N1),i.Proj.projections.add(G1),i.Proj.projections.add(z1),i.Proj.projections.add(q1),i.Proj.projections.add(tE),i.Proj.projections.add(aE),i.Proj.projections.add(fE),i.Proj.projections.add(yE),i.Proj.projections.add(wE),i.Proj.projections.add(_E),i.Proj.projections.add(FE),i.Proj.projections.add(VE),i.Proj.projections.add(jE),i.Proj.projections.add(XE),i.Proj.projections.add(sC),i.Proj.projections.add(mC)}const ms=Object.assign(CA,{defaultDatum:"WGS84",Proj:st,WGS84:new st("WGS84"),Point:Ii,toPoint:ec,defs:Ge,nadgrid:iA,transform:ss,mgrs:vA,version:"__VERSION__"});gC(ms);class pC{cesium;viewer;mapLayers={};modelId="default";options={flyTo:!0};gisCadModelsList=[];open=!1;events=new Ki;constructor({viewer:e,cesium:t}){this.viewer=e,this.cesium=t}getMapLayers(e){const t=typeof e=="object"?e?.modelId:e;return t?this.mapLayers[t]||{}:this.mapLayers}setModelId(e){this.modelId=e}getModelId(){return this.modelId}setDxfOpen(e){this.open=e}getDxfOpen(){return this.open}getDxfModelsList(){return this.gisCadModelsList}getDxfModels(e){const t=typeof e=="object"?e?.modelId:e;return t?this.gisCadModelsList.find(n=>n.modelId===t):this.gisCadModelsList}getDefaultCoordinateTransformConfig(){return{centralMeridian:117,latOrigin:0,scaleFactor:1,falseEasting:5e5,falseNorthing:0,ellipsoid:"GRS80"}}buildLongLatProj4Def(e){return`+proj=longlat +ellps=${e?.ellipsoid||this.getDefaultCoordinateTransformConfig().ellipsoid} +no_defs`}buildProjectedProj4Def(e){const t={...this.getDefaultCoordinateTransformConfig(),...e};return["+proj=tmerc",`+lat_0=${t.latOrigin}`,`+lon_0=${t.centralMeridian}`,`+k=${t.scaleFactor}`,`+x_0=${t.falseEasting}`,`+y_0=${t.falseNorthing}`,`+ellps=${t.ellipsoid||"GRS80"}`,"+units=m","+no_defs"].join(" ")}transformCoordinate(e){const t={...this.getDefaultCoordinateTransformConfig(),...e.config},n=this.buildLongLatProj4Def(t),s=this.buildProjectedProj4Def(t);if(e.direction==="lonlatToProjected"){const d=Number(e.longitude),h=Number(e.latitude);if([d,h].some(u=>Number.isNaN(u)))throw new Error("经纬度参数无效");const[f,m]=ms(n,s,[d,h]);return{direction:e.direction,x:f,y:m,config:t}}const o=Number(e.x),r=Number(e.y);if([o,r].some(d=>Number.isNaN(d)))throw new Error("投影坐标参数无效");const[l,c]=ms(s,n,[o,r]);return{direction:e.direction,longitude:l,latitude:c,config:t}}showJson({modelId:e,show:t}){const n=this.getRuntimeModel(e);n?.root&&(n.show=t,n.root.show=t),this.mapLayers[e]&&Object.values(this.mapLayers[e]).forEach(s=>{s.forEach(o=>{o.primitive&&(o.primitive.show=t)})})}showJsonByLayer({modelId:e,show:t,layers:n}){const s=this.mapLayers[e];!s||!Array.isArray(n)||n.forEach(o=>{const r=s[o];r&&r.forEach(l=>{l.primitive&&(l.primitive.show=t)})})}flyToCadModel(e={}){const t=e.modelId||this.modelId,n=this.gisCadModelsList.find(s=>s.modelId===t);n&&this.flyToBounds(n,{duration:e.duration})}flyToBounds(e,t){if(!e)return;const n=t?.duration??0,s=e?.bounds?.rectangleDegrees;if(s){const o=this.cesium.Rectangle.fromDegrees(s.west,s.south,s.east,s.north);this.viewer.camera.flyTo({destination:o,duration:n});return}e.root&&this.viewer.flyTo(e.root,{duration:n})}parseColor(e,t=1){const n=this.cesium.Color.WHITE.withAlpha(t);if(!e||typeof e!="string")return n;const s=e.trim(),o=[s];if(s.startsWith("#")){const r=s.slice(1).replace(/[^0-9a-fA-F]/g,"");[3,4,6,8].includes(r.length)&&o.push(`#${r}`)}for(const r of Array.from(new Set(o)))try{const l=this.cesium.Color.fromCssColorString(r);if(l)return l.withAlpha(t)}catch(l){console.warn("Failed to parse CAD color candidate:",r,l)}return console.warn("Failed to parse CAD color, fallback to white:",e),n}getLineWidth(e){return typeof e!="number"||Number.isNaN(e)?1:Math.max(1,Math.min(4,Math.round(e*4)))}uniqueKey(e){return e.map(t=>`${t??""}`).join("::")}normalizePoint(e){if(!Array.isArray(e)||e.length<2)return null;const t=Number(e[0]),n=Number(e[1]),s=Number(e[2]||0);return[t,n,s].some(o=>Number.isNaN(o))?null:[t,n,s]}mergeLayerItemsMap(e,t){Object.entries(t).forEach(([n,s])=>{e[n]||(e[n]=[]),e[n].push(...s)})}buildDefaultFormData(e,t){return{modelId:e.modelId,longitude:t.originLongitude,latitude:t.originLatitude,height:t.originHeight,scaleToMeter:t.scaleToMeter,scale:t.scale,localOriginX:t.localOriginX,localOriginY:t.localOriginY,totalRotation:e.totalRotation||0,distance:1e-6,heightDistance:1,rotation:1,scaleStep:.1,clampToGround:!1}}normalizeFormData(e,t,n=!1){const s=e.formData||{},o=this.buildDefaultFormData(e,t);return{...o,...s,modelId:e.modelId,longitude:Number(s.longitude??o.longitude),latitude:Number(s.latitude??o.latitude),height:Number(s.height??o.height),scaleToMeter:Number(s.scaleToMeter??o.scaleToMeter),scale:Math.max(1e-6,Number(s.scale??o.scale)),localOriginX:Number(s.localOriginX??o.localOriginX),localOriginY:Number(s.localOriginY??o.localOriginY),totalRotation:Number(s.totalRotation??o.totalRotation),distance:Number(s.distance??o.distance),heightDistance:Number(s.heightDistance??o.heightDistance),rotation:Number(s.rotation??o.rotation),scaleStep:Number(s.scaleStep??o.scaleStep),transformConfig:s.transformConfig,transformDirection:s.transformDirection,clampToGround:s.clampToGround??n}}removeModelNode(e,t){!e||!t||(e.remove(t),t.destroy&&!t.isDestroyed?.()&&t.destroy())}buildTransform(e,t){const n=this.cesium,s=t.formData||{},o=s.longitude??t.deltaLongitude??e.longitude??e.result?.origin?.longitude??0,r=s.latitude??t.deltaLatitude??e.latitude??e.result?.origin?.latitude??0,l=s.height??0,c=e.result?.extMin?.x??0,d=e.result?.extMin?.y??0,h=e.result?.realUnits??e.unit??1,f=Math.max(1e-6,Number(s.scale??1)),m=h*f;let u=null,g=null,A=null;if(s.transformConfig&&s.transformDirection==="projectedToLonlat"){const P=this.buildLongLatProj4Def(s.transformConfig),k=this.buildProjectedProj4Def(s.transformConfig);u=ms(k,P);try{const[M,B]=u.forward([c*h,d*h]);g=n.Cartesian3.fromDegrees(M,B,0);const _=n.Transforms.eastNorthUpToFixedFrame(g);A=n.Matrix4.inverseTransformation(_,new n.Matrix4)}catch(M){console.warn("Failed to calculate projection base",M),u=null}}const p=n.Cartesian3.fromDegrees(o,r,l),y=n.Transforms.eastNorthUpToFixedFrame(p),C=s.totalRotation??t.totalRotation??0;if(C){const P=n.Quaternion.fromAxisAngle(n.Cartesian3.UNIT_Z,n.Math.toRadians(C)),k=n.Matrix4.fromRotationTranslation(n.Matrix3.fromQuaternion(P),new n.Cartesian3(0,0,0));n.Matrix4.multiply(y,k,y)}return{originLongitude:o,originLatitude:r,originHeight:l,localOriginX:c,localOriginY:d,scaleToMeter:h,scale:f,totalScaleToMeter:m,toWorld:P=>{const k=this.normalizePoint(P);if(!k)return null;if(u&&g&&A)try{const B=k[0]*h,_=k[1]*h,[E,w]=u.forward([B,_]),D=n.Cartesian3.fromDegrees(E,w,k[2]*h),F=n.Matrix4.multiplyByPoint(A,D,new n.Cartesian3);return F.x*=f,F.y*=f,F.z*=f,n.Matrix4.multiplyByPoint(y,F,new n.Cartesian3)}catch{}const M=new n.Cartesian3((k[0]-c)*m,(k[1]-d)*m,k[2]*m);return n.Matrix4.multiplyByPoint(y,M,new n.Cartesian3)}}}createLinePrimitive(e,t){return e.length?t.clampToGround?new this.cesium.GroundPolylinePrimitive({geometryInstances:e,appearance:new this.cesium.PolylineColorAppearance,asynchronous:!0,allowPicking:!1}):new this.cesium.Primitive({geometryInstances:e,appearance:new this.cesium.PolylineColorAppearance,asynchronous:!0,allowPicking:!1}):null}createPolygonPrimitive(e,t){return e.length?t.clampToGround?new this.cesium.GroundPrimitive({geometryInstances:e,appearance:new this.cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,closed:!0}),asynchronous:!0,allowPicking:!1}):new this.cesium.Primitive({geometryInstances:e,appearance:new this.cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,closed:!0}),asynchronous:!0,allowPicking:!1}):null}createPointPrimitive(e){if(!e.length)return null;const t=new this.cesium.PointPrimitiveCollection;return e.forEach(n=>{t.add(n)}),t}buildModelPrimitives(e,t,n){const s=this.cesium,o=new s.PrimitiveCollection,r={},l={},c=this.buildTransform(t,e),d=new Map,h=new Map,f=new Map,m=Array.isArray(t.result?.lines)?t.result?.lines||[]:[],u=Array.isArray(t.result?.polygons)?t.result?.polygons||[]:[],g=Array.isArray(t.result?.points)?t.result?.points||[]:[];m.forEach(p=>{const C=(Array.isArray(p?.positions)?p.positions:[]).map(B=>c.toWorld(B)).filter(Boolean);if(C.length<2)return;const I=p.layer||"default",P=p.color||"#ffffff",k=this.uniqueKey([I,"line",this.getLineWidth(p.lineWeight)]),M=d.get(k)||[];M.push(new s.GeometryInstance({geometry:n.clampToGround?new s.GroundPolylineGeometry({positions:C,width:this.getLineWidth(p.lineWeight)}):new s.PolylineGeometry({positions:C,width:this.getLineWidth(p.lineWeight),vertexFormat:s.PolylineColorAppearance.VERTEX_FORMAT}),attributes:{color:s.ColorGeometryInstanceAttribute.fromColor(this.parseColor(P,1))},id:{modelId:e.modelId,layer:I,batchId:p.batchId,type:"line"}})),d.set(k,M)}),u.forEach(p=>{const C=(Array.isArray(p?.outerPositions)?p.outerPositions:[]).map(_=>c.toWorld(_)).filter(Boolean);if(C.length<3)return;const I=Array.isArray(p?.holes)?p.holes.map(_=>{const E=Array.isArray(_)?_.map(w=>c.toWorld(w)).filter(Boolean):[];return E.length<3?null:new s.PolygonHierarchy(E)}).filter(Boolean):[],P=p.layer||"default",k=p.color||"#ffffff",M=this.uniqueKey([P,"polygon"]),B=h.get(M)||[];B.push(new s.GeometryInstance({geometry:new s.PolygonGeometry({polygonHierarchy:new s.PolygonHierarchy(C,I),vertexFormat:s.PerInstanceColorAppearance.VERTEX_FORMAT}),attributes:{color:s.ColorGeometryInstanceAttribute.fromColor(this.parseColor(k,.45))},id:{modelId:e.modelId,layer:P,batchId:p.batchId,type:"polygon"}})),h.set(M,B)}),g.forEach(p=>{const y=p?.position||p?.positions?.[0]||p,C=c.toWorld(y);if(!C)return;const I=p.layer||"default",P=p.color||"#ffffff",k=this.uniqueKey([I,"point"]),M=f.get(k)||[];M.push({position:C,color:this.parseColor(P,1),pixelSize:Math.max(4,Number(p.pixelSize||6)),id:{modelId:e.modelId,layer:I,batchId:p.batchId,type:"point"}}),f.set(k,M)});const A=(p,y,C)=>{y&&(o.add(y),n.recordLayers!==!1&&(l[p]||(l[p]=[]),l[p].push({primitive:y,color:C.color,batchId:C.batchId,type:C.type})),r[p]||(r[p]={}),r[p][C.type]=y)};return d.forEach((p,y)=>{const[C="default"]=y.split("::");A(C,this.createLinePrimitive(p,n),{color:void 0,batchId:p[0]?.id?.batchId,type:"line"})}),h.forEach((p,y)=>{const[C="default"]=y.split("::");A(C,this.createPolygonPrimitive(p,n),{color:void 0,batchId:p[0]?.id?.batchId,type:"polygon"})}),f.forEach((p,y)=>{const[C="default"]=y.split("::");A(C,this.createPointPrimitive(p),{color:void 0,batchId:p[0]?.id?.batchId,type:"point"})}),{root:o,layerPrimitiveMap:r,layerItemsMap:l,transform:c}}buildModelRoot(e,t,n){const s=new this.cesium.PrimitiveCollection,o={};let r=null;return t.forEach(l=>{const c=this.buildModelPrimitives(e,l,n);r||(r=c),s.add(c.root),this.mergeLayerItemsMap(o,c.layerItemsMap)}),{root:s,transform:r.transform,layerItemsMap:o}}getRuntimeModel(e){const t=e||this.modelId;return this.gisCadModelsList.find(n=>n.modelId===t)||null}rebuildPreviewRoot(e){if(!e.editingFormData)return;e.previewRoot&&(this.removeModelNode(e.root,e.previewRoot),e.previewRoot=null);const t=this.buildModelRoot({...e,formData:e.editingFormData},e.sourceDataList,{clampToGround:e.editingFormData.clampToGround??!1,recordLayers:!1});e.previewRoot=t.root,e.root.add(e.previewRoot),e.groundRoot&&(e.groundRoot.show=!1)}replaceGroundRoot(e,t){t.clampToGround!==void 0&&(e.buildOptions.clampToGround=t.clampToGround);const n=this.buildModelRoot({...e,formData:t},e.sourceDataList,e.buildOptions);e.groundRoot&&this.removeModelNode(e.root,e.groundRoot),e.groundRoot=n.root,e.root.add(e.groundRoot),e.groundRoot.show=e.show!==!1,e.transform=n.transform,this.mapLayers[e.modelId]=n.layerItemsMap}async loadModelFile(e){try{if(!e||typeof e!="string")return!1;const t=await fetch(e,{cache:"no-store"});if(!t.ok)throw new Error(`HTTP ${t.status} for ${e}`);if(e.endsWith(".json")||t.headers.get("content-type")?.includes("application/json"))return await t.json();const n=await t.blob(),s=new Io(new Kn(n),{password:Il,useWebWorkers:!1}),r=(await s.getEntries()).find(d=>!d.directory&&d.filename.endsWith(".json"));if(!r)return await s.close(),!1;const l=await r.arrayBuffer({useWebWorkers:!1});await s.close();const c=new TextDecoder().decode(l);return JSON.parse(c.trim())}catch(t){return console.error("Failed to load GIS CAD source:",e,t),!1}}getCandidateUrls(e){const t=e.outPutPath.endsWith("/")?e.outPutPath:`${e.outPutPath}/`,n=[e.sourceUrl,`${t}${e.dbName}/${e.dbName}.zip`,`${t}${e.dbName}/${e.dbName}.json`,`${t}cad/0.json`].filter(Boolean);return Array.from(new Set(n))}getChunkCandidateUrls(e,t,n){const s=e.outPutPath.endsWith("/")?e.outPutPath:`${e.outPutPath}/`,o=[`${s}${e.dbName}/${e.dbName}_${n}.zip`,`${s}${e.dbName}/${e.dbName}${n}.zip`,`${s}${e.dbName}/${e.dbName}_${n}.json`,`${s}${e.dbName}/${e.dbName}${n}.json`,`${s}cad/${e.dbName}_${n}.zip`,`${s}cad/${e.dbName}${n}.zip`,`${s}cad/${e.dbName}_${n}.json`,`${s}cad/${e.dbName}${n}.json`];try{const r=new URL(t),l=r.pathname,c=l.lastIndexOf("/"),d=c>=0?l.slice(0,c+1):"/",h=l.lastIndexOf("."),f=h>=0?l.slice(h):".zip",m=c>=0?l.slice(c+1,h>=0?h:void 0):l.slice(0,h>=0?h:void 0),u=m===e.dbName?e.dbName:m;o.unshift(`${r.origin}${d}${u}_${n}${f}`,`${r.origin}${d}${u}${n}${f}`)}catch(r){console.warn("Failed to resolve chunk urls from primary source:",t,r)}return Array.from(new Set(o))}async loadSourceData(e){const t=this.getCandidateUrls(e);for(const n of t){const s=await this.loadModelFile(n);if(s)return{url:n,data:s}}return{url:t[0]||"",data:!1}}async loadSourceDataList(e){const t=await this.loadSourceData(e);if(!t.data)return{url:t.url,dataList:[]};const n=t.data,s=[n],o=Math.max(1,Number(n.numbersOfFile||1)),r=t.url||"";for(let l=1;l<o;l++){const c=this.getChunkCandidateUrls(e,r,l);let d=!1;for(const h of c){const f=await this.loadModelFile(h);if(f){s.push(f),d=!0;break}}d||console.warn(`Failed to load GIS CAD chunk ${l} for ${e.modelId}`)}return{url:r,dataList:s}}async addGISCadModel({fileNames:e,options:t}){if(!e?.length)return;const n={...this.options,...t},s={clampToGround:n.clampToGround??n.mode!=="2d"};for(const o of e){if(this.gisCadModelsList.find(c=>c.modelId===o.modelId))continue;const l=await this.loadSourceDataList(o);if(!l.dataList.length){console.error("Failed to resolve GIS CAD source for model:",o);continue}try{const c=l.dataList[0],d=this.buildTransform(c,o),h=this.normalizeFormData(o,d,s.clampToGround),f=this.buildModelRoot({...o,formData:h},l.dataList,s),m=new this.cesium.PrimitiveCollection;m.add(f.root);const u=c.bounds||null,g={...o,type:"gis-cad",sourceUrl:l.url,sourceData:c,sourceDataList:l.dataList,root:m,groundRoot:f.root,previewRoot:null,bounds:u,transform:f.transform,show:!0,formData:h,editingFormData:null,isEditing:!1,buildOptions:s};this.mapLayers[o.modelId]=f.layerItemsMap,this.viewer.scene.primitives.add(g.root),this.gisCadModelsList.push(g),this.setModelId(o.modelId),n.flyTo&&this.flyToBounds(g),n.onSuccess&&n.onSuccess(g)}catch(c){console.error("Failed to build GIS CAD model:",o,c)}}this.events.emit("mountAllGISCad",this.gisCadModelsList)}beginEditGISCad({modelId:e}){const t=this.getRuntimeModel(e);return t?(t.isEditing||(t.isEditing=!0,t.editingFormData={...t.formData},this.rebuildPreviewRoot(t)),t):null}adjustGISCadModel(e){const t=this.getRuntimeModel(e.modelId);return t?(t.isEditing||this.beginEditGISCad({modelId:e.modelId}),t.editingFormData={...t.editingFormData||t.formData,...e,modelId:t.modelId,scale:Math.max(1e-6,Number(e.scale??t.editingFormData?.scale??t.formData.scale))},e.clampToGround!==void 0&&(t.buildOptions.clampToGround=e.clampToGround),this.rebuildPreviewRoot(t),t.editingFormData):null}commitEditGISCad({modelId:e}){const t=this.getRuntimeModel(e);return!t||!t.isEditing||!t.editingFormData||(t.formData={...t.editingFormData},this.replaceGroundRoot(t,t.formData),t.previewRoot&&(this.removeModelNode(t.root,t.previewRoot),t.previewRoot=null),t.isEditing=!1,t.editingFormData=null),t}cancelEditGISCad({modelId:e}){const t=this.getRuntimeModel(e);return t?(t.previewRoot&&(this.removeModelNode(t.root,t.previewRoot),t.previewRoot=null),t.groundRoot&&(t.groundRoot.show=t.show!==!1),t.isEditing=!1,t.editingFormData=null,t):null}deleteCad({modelId:e}){this.mapLayers[e]&&delete this.mapLayers[e];const t=this.gisCadModelsList.findIndex(n=>n.modelId===e);if(t>-1){const n=this.gisCadModelsList[t];this.viewer.scene.primitives.remove(n.root),n.root?.destroy&&!n.root.isDestroyed?.()&&n.root.destroy(),this.gisCadModelsList.splice(t,1)}}deleteAllCad(){[...this.gisCadModelsList].forEach(e=>{e.modelId&&this.deleteCad({modelId:e.modelId})})}}class Gt{constructor(e,t){if(this.viewer=e,!this.viewer)return;this.type="prompt",t=t||{};const n=t.type==null?1:t.type;let s={id:new Date().getTime()+""+Math.floor(Math.random()*1e4),type:n,anchor:n==2,closeBtn:n==2,offset:n==2?{x:0,y:-20}:{x:10,y:10},content:"",show:!0,style:{background:"rgba(0,0,0,0.5)",color:"white"}};this.opt=Object.assign(s,t),this.attr=this.opt;const o=this.viewer.container.id;this.isShow=this.opt.show==null?!0:this.opt.show;let r="",l="";const c=this.opt.style.background,d=this.opt.style.color;this.opt.anchor&&(r+=`
|
|
16
|
+
northing meters`+i;var m=f/2,u=0,g=0,A,p,y,C,I;return m>0&&(A=1e5/Math.pow(10,m),p=i.substring(o,o+m),u=parseFloat(p)*A,y=i.substring(o+m),g=parseFloat(y)*A),C=u+d,I=g+h,{easting:C,northing:I,zoneLetter:l,zoneNumber:r,accuracy:A}}function BA(i,e){for(var t=sc.charCodeAt(e-1),n=1e5,s=!1;t!==i.charCodeAt(0);){if(t++,t===qe&&t++,t===ot&&t++,t>sn){if(s)throw"Bad character: "+i;t=wi,s=!0}n+=1e5}return n}function TA(i,e){if(i>"V")throw"MGRSPoint given invalid Northing "+i;for(var t=oc.charCodeAt(e-1),n=0,s=!1;t!==i.charCodeAt(0);){if(t++,t===qe&&t++,t===ot&&t++,t>nn){if(s)throw"Bad character: "+i;t=wi,s=!0}n+=1e5}return n}function PA(i){var e;switch(i){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+i}function Ii(i,e,t){if(!(this instanceof Ii))return new Ii(i,e,t);if(Array.isArray(i))this.x=i[0],this.y=i[1],this.z=i[2]||0;else if(typeof i=="object")this.x=i.x,this.y=i.y,this.z=i.z||0;else if(typeof i=="string"&&typeof e>"u"){var n=i.split(",");this.x=parseFloat(n[0]),this.y=parseFloat(n[1]),this.z=parseFloat(n[2])||0}else this.x=i,this.y=e,this.z=t||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Ii.fromMGRS=function(i){return new Ii(rc(i))},Ii.prototype.toMGRS=function(i){return ac([this.x,this.y],i)};var _A=1,DA=.25,hc=.046875,uc=.01953125,fc=.01068115234375,kA=.75,NA=.46875,RA=.013020833333333334,FA=.007120768229166667,LA=.3645833333333333,OA=.005696614583333333,GA=.3076171875;function Vo(i){var e=[];e[0]=_A-i*(DA+i*(hc+i*(uc+i*fc))),e[1]=i*(kA-i*(hc+i*(uc+i*fc)));var t=i*i;return e[2]=t*(NA-i*(RA+i*FA)),t*=i,e[3]=t*(LA-i*OA),e[4]=t*i*GA,e}function Si(i,e,t,n){return t*=e,e*=e,n[0]*i-t*(n[1]+e*(n[2]+e*(n[3]+e*n[4])))}var UA=20;function Qo(i,e,t){for(var n=1/(1-e),s=i,o=UA;o;--o){var r=Math.sin(s),l=1-e*r*r;if(l=(Si(s,r,Math.cos(s),t)-i)*(l*Math.sqrt(l))*n,s-=l,Math.abs(l)<K)return s}return s}function VA(){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=Vo(this.es),this.ml0=Si(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function QA(i){var e=i.x,t=i.y,n=X(e-this.long0,this.over),s,o,r,l=Math.sin(t),c=Math.cos(t);if(this.es){var h=c*n,f=Math.pow(h,2),m=this.ep2*Math.pow(c,2),u=Math.pow(m,2),g=Math.abs(c)>K?Math.tan(t):0,A=Math.pow(g,2),p=Math.pow(A,2);s=1-this.es*Math.pow(l,2),h=h/Math.sqrt(s);var y=Si(t,l,c,this.en);o=this.a*(this.k0*h*(1+f/6*(1-A+m+f/20*(5-18*A+p+14*m-58*A*m+f/42*(61+179*p-p*A-479*A)))))+this.x0,r=this.a*(this.k0*(y-this.ml0+l*n*h/2*(1+f/12*(5-A+9*m+4*u+f/30*(61+p-58*A+270*m-330*A*m+f/56*(1385+543*p-p*A-3111*A))))))+this.y0}else{var d=c*Math.sin(n);if(Math.abs(Math.abs(d)-1)<K)return 93;if(o=.5*this.a*this.k0*Math.log((1+d)/(1-d))+this.x0,r=c*Math.cos(n)/Math.sqrt(1-Math.pow(d,2)),d=Math.abs(r),d>=1){if(d-1>K)return 93;r=0}else r=Math.acos(r);t<0&&(r=-r),r=this.a*this.k0*(r-this.lat0)+this.y0}return i.x=o,i.y=r,i}function HA(i){var e,t,n,s,o=(i.x-this.x0)*(1/this.a),r=(i.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+r/this.k0,t=Qo(e,this.es,this.en),Math.abs(t)<j){var f=Math.sin(t),m=Math.cos(t),u=Math.abs(m)>K?Math.tan(t):0,g=this.ep2*Math.pow(m,2),A=Math.pow(g,2),p=Math.pow(u,2),y=Math.pow(p,2);e=1-this.es*Math.pow(f,2);var C=o*Math.sqrt(e)/this.k0,I=Math.pow(C,2);e=e*u,n=t-e*I/(1-this.es)*.5*(1-I/12*(5+3*p-9*g*p+g-4*A-I/30*(61+90*p-252*g*p+45*y+46*g-I/56*(1385+3633*p+4095*y+1574*y*p)))),s=X(this.long0+C*(1-I/6*(1+2*p+g-I/20*(5+28*p+24*y+8*g*p+6*g-I/42*(61+662*p+1320*y+720*y*p))))/m,this.over)}else n=j*en(r),s=0;else{var l=Math.exp(o/this.k0),c=.5*(l-1/l),d=this.lat0+r/this.k0,h=Math.cos(d);e=Math.sqrt((1-Math.pow(h,2))/(1+Math.pow(c,2))),n=Math.asin(e),r<0&&(n=-n),c===0&&h===0?s=0:s=X(Math.atan2(c,h)+this.long0,this.over)}return i.x=s,i.y=n,i}var YA=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const as={init:VA,forward:QA,inverse:HA,names:YA};function mc(i){var e=Math.exp(i);return e=(e-1/e)/2,e}function Xe(i,e){i=Math.abs(i),e=Math.abs(e);var t=Math.max(i,e),n=Math.min(i,e)/(t||1);return t*Math.sqrt(1+Math.pow(n,2))}function zA(i){var e=1+i,t=e-1;return t===0?i:i*Math.log(e)/t}function jA(i){var e=Math.abs(i);return e=zA(e*(1+e/(Xe(1,e)+1))),i<0?-e:e}function Ho(i,e){for(var t=2*Math.cos(2*e),n=i.length-1,s=i[n],o=0,r;--n>=0;)r=-o+t*s+i[n],o=s,s=r;return e+r*Math.sin(2*e)}function WA(i,e){for(var t=2*Math.cos(e),n=i.length-1,s=i[n],o=0,r;--n>=0;)r=-o+t*s+i[n],o=s,s=r;return Math.sin(e)*r}function $A(i){var e=Math.exp(i);return e=(e+1/e)/2,e}function gc(i,e,t){for(var n=Math.sin(e),s=Math.cos(e),o=mc(t),r=$A(t),l=2*s*r,c=-2*n*o,d=i.length-1,h=i[d],f=0,m=0,u=0,g,A;--d>=0;)g=m,A=f,m=h,f=u,h=-g+l*m-c*f+i[d],u=-A+c*m+l*f;return l=n*r,c=s*o,[l*h-c*u,l*u+c*h]}function KA(){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&&(as.init.apply(this),this.forward=as.forward,this.inverse=as.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 i=this.es/(1+Math.sqrt(1-this.es)),e=i/(2-i),t=e;this.cgb[0]=e*(2+e*(-2/3+e*(-2+e*(116/45+e*(26/45+e*(-2854/675)))))),this.cbg[0]=e*(-2+e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))),t=t*e,this.cgb[1]=t*(7/3+e*(-8/5+e*(-227/45+e*(2704/315+e*(2323/945))))),this.cbg[1]=t*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),t=t*e,this.cgb[2]=t*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=t*(-26/15+e*(34/21+e*(8/5+e*(-12686/2835)))),t=t*e,this.cgb[3]=t*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=t*(1237/630+e*(-12/5+e*(-24832/14175))),t=t*e,this.cgb[4]=t*(4174/315+e*(-144838/6237)),this.cbg[4]=t*(-734/315+e*(109598/31185)),t=t*e,this.cgb[5]=t*(601676/22275),this.cbg[5]=t*(444337/155925),t=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+t*(1/4+t*(1/64+t/256))),this.utg[0]=e*(-.5+e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=t*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=t*(13/48+e*(-3/5+e*(557/1440+e*(281/630+e*(-1983433/1935360))))),t=t*e,this.utg[2]=t*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=t*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),t=t*e,this.utg[3]=t*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=t*(49561/161280+e*(-179/168+e*(6601661/7257600))),t=t*e,this.utg[4]=t*(-4583/161280+e*(108847/3991680)),this.gtu[4]=t*(34729/80640+e*(-3418889/1995840)),t=t*e,this.utg[5]=t*(-20648693/638668800),this.gtu[5]=t*(212378941/319334400);var n=Ho(this.cbg,this.lat0);this.Zb=-this.Qn*(n+WA(this.gtu,2*n))}function qA(i){var e=X(i.x-this.long0,this.over),t=i.y;t=Ho(this.cbg,t);var n=Math.sin(t),s=Math.cos(t),o=Math.sin(e),r=Math.cos(e);t=Math.atan2(n,r*s),e=Math.atan2(o*s,Xe(n,s*r)),e=jA(Math.tan(e));var l=gc(this.gtu,2*t,2*e);t=t+l[0],e=e+l[1];var c,d;return Math.abs(e)<=2.623395162778?(c=this.a*(this.Qn*e)+this.x0,d=this.a*(this.Qn*t+this.Zb)+this.y0):(c=1/0,d=1/0),i.x=c,i.y=d,i}function XA(i){var e=(i.x-this.x0)*(1/this.a),t=(i.y-this.y0)*(1/this.a);t=(t-this.Zb)/this.Qn,e=e/this.Qn;var n,s;if(Math.abs(e)<=2.623395162778){var o=gc(this.utg,2*t,2*e);t=t+o[0],e=e+o[1],e=Math.atan(mc(e));var r=Math.sin(t),l=Math.cos(t),c=Math.sin(e),d=Math.cos(e);t=Math.atan2(r*d,Xe(c,d*l)),e=Math.atan2(c,d*l),n=X(e+this.long0,this.over),s=Ho(this.cgb,t)}else n=1/0,s=1/0;return i.x=n,i.y=s,i}var JA=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const rs={init:KA,forward:qA,inverse:XA,names:JA};function ZA(i,e){if(i===void 0){if(i=Math.floor((X(e)+Math.PI)*30/Math.PI)+1,i<0)return 0;if(i>60)return 60}return i}var ey="etmerc";function ty(){var i=ZA(this.zone,this.long0);if(i===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(i)-183)*xe,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,rs.init.apply(this),this.forward=rs.forward,this.inverse=rs.inverse}var iy=["Universal Transverse Mercator System","utm"];const ny={init:ty,names:iy,dependsOn:ey};function Yo(i,e){return Math.pow((1-i)/(1+i),e)}var sy=20;function oy(){var i=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*i*i),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(i/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+ue)/(Math.pow(Math.tan(.5*this.lat0+ue),this.C)*Yo(this.e*i,this.ratexp))}function ay(i){var e=i.x,t=i.y;return i.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*t+ue),this.C)*Yo(this.e*Math.sin(t),this.ratexp))-j,i.x=this.C*e,i}function ry(i){for(var e=1e-14,t=i.x/this.C,n=i.y,s=Math.pow(Math.tan(.5*n+ue)/this.K,1/this.C),o=sy;o>0&&(n=2*Math.atan(s*Yo(this.e*Math.sin(i.y),-.5*this.e))-j,!(Math.abs(n-i.y)<e));--o)i.y=n;return o?(i.x=t,i.y=n,i):null}const zo={init:oy,forward:ay,inverse:ry};function ly(){zo.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 cy(i){var e,t,n,s;return i.x=X(i.x-this.long0,this.over),zo.forward.apply(this,[i]),e=Math.sin(i.y),t=Math.cos(i.y),n=Math.cos(i.x),s=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*t*n),i.x=s*t*Math.sin(i.x),i.y=s*(this.cosc0*e-this.sinc0*t*n),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function dy(i){var e,t,n,s,o;if(i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,i.x/=this.k0,i.y/=this.k0,o=Xe(i.x,i.y)){var r=2*Math.atan2(o,this.R2);e=Math.sin(r),t=Math.cos(r),s=Math.asin(t*this.sinc0+i.y*e*this.cosc0/o),n=Math.atan2(i.x*e,o*this.cosc0*t-i.y*this.sinc0*e)}else s=this.phic0,n=0;return i.x=n,i.y=s,zo.inverse.apply(this,[i]),i.x=X(i.x+this.long0,this.over),i}var hy=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const uy={init:ly,forward:cy,inverse:dy,names:hy};function jo(i,e,t){return e*=t,Math.tan(.5*(j+i))*Math.pow((1-e)/(1+e),.5*t)}function fy(){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)<=K&&(this.k0=.5*(1+en(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=K&&(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)<=K&&Math.abs(Math.cos(this.lat_ts))>K&&(this.k0=.5*this.cons*Ct(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/ct(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Ct(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(jo(this.lat0,this.sinlat0,this.e))-j,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function my(i){var e=i.x,t=i.y,n=Math.sin(t),s=Math.cos(t),o,r,l,c,d,h,f=X(e-this.long0,this.over);return Math.abs(Math.abs(e-this.long0)-Math.PI)<=K&&Math.abs(t+this.lat0)<=K?(i.x=NaN,i.y=NaN,i):this.sphere?(o=2*this.k0/(1+this.sinlat0*n+this.coslat0*s*Math.cos(f)),i.x=this.a*o*s*Math.sin(f)+this.x0,i.y=this.a*o*(this.coslat0*n-this.sinlat0*s*Math.cos(f))+this.y0,i):(r=2*Math.atan(jo(t,n,this.e))-j,c=Math.cos(r),l=Math.sin(r),Math.abs(this.coslat0)<=K?(d=ct(this.e,t*this.con,this.con*n),h=2*this.a*this.k0*d/this.cons,i.x=this.x0+h*Math.sin(e-this.long0),i.y=this.y0-this.con*h*Math.cos(e-this.long0),i):(Math.abs(this.sinlat0)<K?(o=2*this.a*this.k0/(1+c*Math.cos(f)),i.y=o*l):(o=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*l+this.cosX0*c*Math.cos(f))),i.y=o*(this.cosX0*l-this.sinX0*c*Math.cos(f))+this.y0),i.x=o*c*Math.sin(f)+this.x0,i))}function gy(i){i.x-=this.x0,i.y-=this.y0;var e,t,n,s,o,r=Math.sqrt(i.x*i.x+i.y*i.y);if(this.sphere){var l=2*Math.atan(r/(2*this.a*this.k0));return e=this.long0,t=this.lat0,r<=K?(i.x=e,i.y=t,i):(t=Math.asin(Math.cos(l)*this.sinlat0+i.y*Math.sin(l)*this.coslat0/r),Math.abs(this.coslat0)<K?this.lat0>0?e=X(this.long0+Math.atan2(i.x,-1*i.y),this.over):e=X(this.long0+Math.atan2(i.x,i.y),this.over):e=X(this.long0+Math.atan2(i.x*Math.sin(l),r*this.coslat0*Math.cos(l)-i.y*this.sinlat0*Math.sin(l)),this.over),i.x=e,i.y=t,i)}else if(Math.abs(this.coslat0)<=K){if(r<=K)return t=this.lat0,e=this.long0,i.x=e,i.y=t,i;i.x*=this.con,i.y*=this.con,n=r*this.cons/(2*this.a*this.k0),t=this.con*tn(this.e,n),e=this.con*X(this.con*this.long0+Math.atan2(i.x,-1*i.y),this.over)}else s=2*Math.atan(r*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,r<=K?o=this.X0:(o=Math.asin(Math.cos(s)*this.sinX0+i.y*Math.sin(s)*this.cosX0/r),e=X(this.long0+Math.atan2(i.x*Math.sin(s),r*this.cosX0*Math.cos(s)-i.y*this.sinX0*Math.sin(s)),this.over)),t=-1*tn(this.e,Math.tan(.5*(j+o)));return i.x=e,i.y=t,i}var py=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"];const Ay={init:fy,forward:my,inverse:gy,names:py,ssfn_:jo};function yy(){var i=this.lat0;this.lambda0=this.long0;var e=Math.sin(i),t=this.a,n=this.rf,s=1/n,o=2*s-Math.pow(s,2),r=this.e=Math.sqrt(o);this.R=this.k0*t*Math.sqrt(1-o)/(1-o*Math.pow(e,2)),this.alpha=Math.sqrt(1+o/(1-o)*Math.pow(Math.cos(i),4)),this.b0=Math.asin(e/this.alpha);var l=Math.log(Math.tan(Math.PI/4+this.b0/2)),c=Math.log(Math.tan(Math.PI/4+i/2)),d=Math.log((1+r*e)/(1-r*e));this.K=l-this.alpha*c+this.alpha*r/2*d}function Ey(i){var e=Math.log(Math.tan(Math.PI/4-i.y/2)),t=this.e/2*Math.log((1+this.e*Math.sin(i.y))/(1-this.e*Math.sin(i.y))),n=-this.alpha*(e+t)+this.K,s=2*(Math.atan(Math.exp(n))-Math.PI/4),o=this.alpha*(i.x-this.lambda0),r=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(s)+Math.cos(this.b0)*Math.cos(o))),l=Math.asin(Math.cos(this.b0)*Math.sin(s)-Math.sin(this.b0)*Math.cos(s)*Math.cos(o));return i.y=this.R/2*Math.log((1+Math.sin(l))/(1-Math.sin(l)))+this.y0,i.x=this.R*r+this.x0,i}function Cy(i){for(var e=i.x-this.x0,t=i.y-this.y0,n=e/this.R,s=2*(Math.atan(Math.exp(t/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(s)+Math.sin(this.b0)*Math.cos(s)*Math.cos(n)),r=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(s))),l=this.lambda0+r/this.alpha,c=0,d=o,h=-1e3,f=0;Math.abs(d-h)>1e-7;){if(++f>20)return;c=1/this.alpha*(Math.log(Math.tan(Math.PI/4+o/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(d))/2)),h=d,d=2*Math.atan(Math.exp(c))-Math.PI/2}return i.x=l,i.y=d,i}var vy=["somerc"];const by={init:yy,forward:Ey,inverse:Cy,names:vy};var xi=1e-7;function wy(i){var e=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],t=typeof i.projName=="object"?Object.keys(i.projName)[0]:i.projName;return"no_uoff"in i||"no_off"in i||e.indexOf(t)!==-1||e.indexOf(jl(t))!==-1}function Iy(){var i,e,t,n,s,o,r,l,c,d,h=0,f,m=0,u=0,g=0,A=0,p=0,y=0;this.no_off=wy(this),this.no_rot="no_rot"in this;var C=!1;"alpha"in this&&(C=!0);var I=!1;if("rectified_grid_angle"in this&&(I=!0),C&&(y=this.alpha),I&&(h=this.rectified_grid_angle),C||I)m=this.longc;else if(u=this.long1,A=this.lat1,g=this.long2,p=this.lat2,Math.abs(A-p)<=xi||(i=Math.abs(A))<=xi||Math.abs(i-j)<=xi||Math.abs(Math.abs(this.lat0)-j)<=xi||Math.abs(Math.abs(p)-j)<=xi)throw new Error;var P=1-this.es;e=Math.sqrt(P),Math.abs(this.lat0)>K?(l=Math.sin(this.lat0),t=Math.cos(this.lat0),i=1-this.es*l*l,this.B=t*t,this.B=Math.sqrt(1+this.es*this.B*this.B/P),this.A=this.B*this.k0*e/i,n=this.B*e/(t*Math.sqrt(i)),s=n*n-1,s<=0?s=0:(s=Math.sqrt(s),this.lat0<0&&(s=-s)),this.E=s+=n,this.E*=Math.pow(ct(this.e,this.lat0,l),this.B)):(this.B=1/e,this.A=this.k0,this.E=n=s=1),C||I?(C?(f=Math.asin(Math.sin(y)/n),I||(h=y)):(f=h,y=Math.asin(n*Math.sin(f))),this.lam0=m-Math.asin(.5*(s-1/s)*Math.tan(f))/this.B):(o=Math.pow(ct(this.e,A,Math.sin(A)),this.B),r=Math.pow(ct(this.e,p,Math.sin(p)),this.B),s=this.E/o,c=(r-o)/(r+o),d=this.E*this.E,d=(d-r*o)/(d+r*o),i=u-g,i<-Math.PI?g-=Ji:i>Math.PI&&(g+=Ji),this.lam0=X(.5*(u+g)-Math.atan(d*Math.tan(.5*this.B*(u-g))/c)/this.B,this.over),f=Math.atan(2*Math.sin(this.B*X(u-this.lam0,this.over))/(s-1/s)),h=y=Math.asin(n*Math.sin(f))),this.singam=Math.sin(f),this.cosgam=Math.cos(f),this.sinrot=Math.sin(h),this.cosrot=Math.cos(h),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(n*n-1)/Math.cos(y))),this.lat0<0&&(this.u_0=-this.u_0)),s=.5*f,this.v_pole_n=this.ArB*Math.log(Math.tan(ue-s)),this.v_pole_s=this.ArB*Math.log(Math.tan(ue+s))}function Sy(i){var e={},t,n,s,o,r,l,c,d;if(i.x=i.x-this.lam0,Math.abs(Math.abs(i.y)-j)>K){if(r=this.E/Math.pow(ct(this.e,i.y,Math.sin(i.y)),this.B),l=1/r,t=.5*(r-l),n=.5*(r+l),o=Math.sin(this.B*i.x),s=(t*this.singam-o*this.cosgam)/n,Math.abs(Math.abs(s)-1)<K)throw new Error;d=.5*this.ArB*Math.log((1-s)/(1+s)),l=Math.cos(this.B*i.x),Math.abs(l)<xi?c=this.A*i.x:c=this.ArB*Math.atan2(t*this.cosgam+o*this.singam,l)}else d=i.y>0?this.v_pole_n:this.v_pole_s,c=this.ArB*i.y;return this.no_rot?(e.x=c,e.y=d):(c-=this.u_0,e.x=d*this.cosrot+c*this.sinrot,e.y=c*this.cosrot-d*this.sinrot),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function xy(i){var e,t,n,s,o,r,l,c={};if(i.x=(i.x-this.x0)*(1/this.a),i.y=(i.y-this.y0)*(1/this.a),this.no_rot?(t=i.y,e=i.x):(t=i.x*this.cosrot-i.y*this.sinrot,e=i.y*this.cosrot+i.x*this.sinrot+this.u_0),n=Math.exp(-this.BrA*t),s=.5*(n-1/n),o=.5*(n+1/n),r=Math.sin(this.BrA*e),l=(r*this.cosgam+s*this.singam)/o,Math.abs(Math.abs(l)-1)<K)c.x=0,c.y=l<0?-j:j;else{if(c.y=this.E/Math.sqrt((1+l)/(1-l)),c.y=tn(this.e,Math.pow(c.y,1/this.B)),c.y===1/0)throw new Error;c.x=-this.rB*Math.atan2(s*this.cosgam-r*this.singam,Math.cos(this.BrA*e))}return c.x+=this.lam0,c}var My=["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 By={init:Iy,forward:Sy,inverse:xy,names:My};function Ty(){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)<K)){var i=this.b/this.a;this.e=Math.sqrt(1-i*i);var e=Math.sin(this.lat1),t=Math.cos(this.lat1),n=Ct(this.e,e,t),s=ct(this.e,this.lat1,e),o=Math.sin(this.lat2),r=Math.cos(this.lat2),l=Ct(this.e,o,r),c=ct(this.e,this.lat2,o),d=Math.abs(Math.abs(this.lat0)-j)<K?0:ct(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>K?this.ns=Math.log(n/l)/Math.log(s/c):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=n/(this.ns*Math.pow(s,this.ns)),this.rh=this.a*this.f0*Math.pow(d,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function Py(i){var e=i.x,t=i.y;Math.abs(2*Math.abs(t)-Math.PI)<=K&&(t=en(t)*(j-2*K));var n=Math.abs(Math.abs(t)-j),s,o;if(n>K)s=ct(this.e,t,Math.sin(t)),o=this.a*this.f0*Math.pow(s,this.ns);else{if(n=t*this.ns,n<=0)return null;o=0}var r=this.ns*X(e-this.long0,this.over);return i.x=this.k0*(o*Math.sin(r))+this.x0,i.y=this.k0*(this.rh-o*Math.cos(r))+this.y0,i}function _y(i){var e,t,n,s,o,r=(i.x-this.x0)/this.k0,l=this.rh-(i.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(r*r+l*l),t=1):(e=-Math.sqrt(r*r+l*l),t=-1);var c=0;if(e!==0&&(c=Math.atan2(t*r,t*l)),e!==0||this.ns>0){if(t=1/this.ns,n=Math.pow(e/(this.a*this.f0),t),s=tn(this.e,n),s===-9999)return null}else s=-j;return o=X(c/this.ns+this.long0,this.over),i.x=o,i.y=s,i}var Dy=["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 ky={init:Ty,forward:Py,inverse:_y,names:Dy};function Ny(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),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 Ry(i){var e,t,n,s,o,r,l,c=i.x,d=i.y,h=X(c-this.long0,this.over);return e=Math.pow((1+this.e*Math.sin(d))/(1-this.e*Math.sin(d)),this.alfa*this.e/2),t=2*(Math.atan(this.k*Math.pow(Math.tan(d/2+this.s45),this.alfa)/e)-this.s45),n=-h*this.alfa,s=Math.asin(Math.cos(this.ad)*Math.sin(t)+Math.sin(this.ad)*Math.cos(t)*Math.cos(n)),o=Math.asin(Math.cos(t)*Math.sin(n)/Math.cos(s)),r=this.n*o,l=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(s/2+this.s45),this.n),i.y=l*Math.cos(r)/1,i.x=l*Math.sin(r)/1,this.czech||(i.y*=-1,i.x*=-1),i}function Fy(i){var e,t,n,s,o,r,l,c,d=i.x;i.x=i.y,i.y=d,this.czech||(i.y*=-1,i.x*=-1),r=Math.sqrt(i.x*i.x+i.y*i.y),o=Math.atan2(i.y,i.x),s=o/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/r,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(s)),t=Math.asin(Math.cos(n)*Math.sin(s)/Math.cos(e)),i.x=this.long0-t/this.alfa,l=e,c=0;var h=0;do i.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.e/2))-this.s45),Math.abs(l-i.y)<1e-10&&(c=1),l=i.y,h+=1;while(c===0&&h<15);return h>=15?null:i}var Ly=["Krovak","krovak"];const Oy={init:Ny,forward:Ry,inverse:Fy,names:Ly};function ze(i,e,t,n,s){return i*s-e*Math.sin(2*s)+t*Math.sin(4*s)-n*Math.sin(6*s)}function on(i){return 1-.25*i*(1+i/16*(3+1.25*i))}function an(i){return .375*i*(1+.25*i*(1+.46875*i))}function rn(i){return .05859375*i*i*(1+.75*i)}function ln(i){return i*i*i*(35/3072)}function Wo(i,e,t){var n=e*t;return i/Math.sqrt(1-n*n)}function Ft(i){return Math.abs(i)<j?i:i-en(i)*Math.PI}function ls(i,e,t,n,s){var o,r;o=i/e;for(var l=0;l<15;l++)if(r=(i-(e*o-t*Math.sin(2*o)+n*Math.sin(4*o)-s*Math.sin(6*o)))/(e-2*t*Math.cos(2*o)+4*n*Math.cos(4*o)-6*s*Math.cos(6*o)),o+=r,Math.abs(r)<=1e-10)return o;return NaN}function Gy(){this.sphere||(this.e0=on(this.es),this.e1=an(this.es),this.e2=rn(this.es),this.e3=ln(this.es),this.ml0=this.a*ze(this.e0,this.e1,this.e2,this.e3,this.lat0))}function Uy(i){var e,t,n=i.x,s=i.y;if(n=X(n-this.long0,this.over),this.sphere)e=this.a*Math.asin(Math.cos(s)*Math.sin(n)),t=this.a*(Math.atan2(Math.tan(s),Math.cos(n))-this.lat0);else{var o=Math.sin(s),r=Math.cos(s),l=Wo(this.a,this.e,o),c=Math.tan(s)*Math.tan(s),d=n*Math.cos(s),h=d*d,f=this.es*r*r/(1-this.es),m=this.a*ze(this.e0,this.e1,this.e2,this.e3,s);e=l*d*(1-h*c*(1/6-(8-c+8*f)*h/120)),t=m-this.ml0+l*o/r*h*(.5+(5-c+6*f)*h/24)}return i.x=e+this.x0,i.y=t+this.y0,i}function Vy(i){i.x-=this.x0,i.y-=this.y0;var e=i.x/this.a,t=i.y/this.a,n,s;if(this.sphere){var o=t+this.lat0;n=Math.asin(Math.sin(o)*Math.cos(e)),s=Math.atan2(Math.tan(e),Math.cos(o))}else{var r=this.ml0/this.a+t,l=ls(r,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(l)-j)<=K)return i.x=this.long0,i.y=j,t<0&&(i.y*=-1),i;var c=Wo(this.a,this.e,Math.sin(l)),d=c*c*c/this.a/this.a*(1-this.es),h=Math.pow(Math.tan(l),2),f=e*this.a/c,m=f*f;n=l-c*Math.tan(l)/d*f*f*(.5-(1+3*h)*f*f/24),s=f*(1-m*(h/3+(1+3*h)*h*m/15))/Math.cos(l)}return i.x=X(s+this.long0,this.over),i.y=Ft(n),i}var Qy=["Cassini","Cassini_Soldner","cass"];const Hy={init:Gy,forward:Uy,inverse:Vy,names:Qy};function Lt(i,e){var t;return i>1e-7?(t=i*e,(1-i*i)*(e/(1-t*t)-.5/i*Math.log((1-t)/(1+t)))):2*e}var $o=1,Ko=2,qo=3,cs=4;function Yy(){var i=Math.abs(this.lat0);if(Math.abs(i-j)<K?this.mode=this.lat0<0?$o:Ko:Math.abs(i)<K?this.mode=qo:this.mode=cs,this.es>0){var e;switch(this.qp=Lt(this.e,1),this.mmf=.5/(1-this.es),this.apa=Zy(this.es),this.mode){case Ko:this.dd=1;break;case $o:this.dd=1;break;case qo:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case cs:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=Lt(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===cs&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function zy(i){var e,t,n,s,o,r,l,c,d,h,f=i.x,m=i.y;if(f=X(f-this.long0,this.over),this.sphere){if(o=Math.sin(m),h=Math.cos(m),n=Math.cos(f),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t=this.mode===this.EQUIT?1+h*n:1+this.sinph0*o+this.cosph0*h*n,t<=K)return null;t=Math.sqrt(2/t),e=t*h*Math.sin(f),t*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*h*n}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),Math.abs(m+this.lat0)<K)return null;t=ue-m*.5,t=2*(this.mode===this.S_POLE?Math.cos(t):Math.sin(t)),e=t*Math.sin(f),t*=n}}else{switch(l=0,c=0,d=0,n=Math.cos(f),s=Math.sin(f),o=Math.sin(m),r=Lt(this.e,o),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(l=r/this.qp,c=Math.sqrt(1-l*l)),this.mode){case this.OBLIQ:d=1+this.sinb1*l+this.cosb1*c*n;break;case this.EQUIT:d=1+c*n;break;case this.N_POLE:d=j+m,r=this.qp-r;break;case this.S_POLE:d=m-j,r=this.qp+r;break}if(Math.abs(d)<K)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:d=Math.sqrt(2/d),this.mode===this.OBLIQ?t=this.ymf*d*(this.cosb1*l-this.sinb1*c*n):t=(d=Math.sqrt(2/(1+c*n)))*l*this.ymf,e=this.xmf*d*c*s;break;case this.N_POLE:case this.S_POLE:r>=0?(e=(d=Math.sqrt(r))*s,t=n*(this.mode===this.S_POLE?d:-d)):e=t=0;break}}return i.x=this.a*e+this.x0,i.y=this.a*t+this.y0,i}function jy(i){i.x-=this.x0,i.y-=this.y0;var e=i.x/this.a,t=i.y/this.a,n,s,o,r,l,c,d;if(this.sphere){var h=0,f,m=0;if(f=Math.sqrt(e*e+t*t),s=f*.5,s>1)return null;switch(s=2*Math.asin(s),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(m=Math.sin(s),h=Math.cos(s)),this.mode){case this.EQUIT:s=Math.abs(f)<=K?0:Math.asin(t*m/f),e*=m,t=h*f;break;case this.OBLIQ:s=Math.abs(f)<=K?this.lat0:Math.asin(h*this.sinph0+t*m*this.cosph0/f),e*=m*this.cosph0,t=(h-Math.sin(s)*this.sinph0)*f;break;case this.N_POLE:t=-t,s=j-s;break;case this.S_POLE:s-=j;break}n=t===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(e,t)}else{if(d=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e/=this.dd,t*=this.dd,c=Math.sqrt(e*e+t*t),c<K)return i.x=this.long0,i.y=this.lat0,i;r=2*Math.asin(.5*c/this.rq),o=Math.cos(r),e*=r=Math.sin(r),this.mode===this.OBLIQ?(d=o*this.sinb1+t*r*this.cosb1/c,l=this.qp*d,t=c*this.cosb1*o-t*this.sinb1*r):(d=t*r/c,l=this.qp*d,t=c*o)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(t=-t),l=e*e+t*t,!l)return i.x=this.long0,i.y=this.lat0,i;d=1-l/this.qp,this.mode===this.S_POLE&&(d=-d)}n=Math.atan2(e,t),s=e1(Math.asin(d),this.apa)}return i.x=X(this.long0+n,this.over),i.y=s,i}var Wy=.3333333333333333,$y=.17222222222222222,Ky=.10257936507936508,qy=.06388888888888888,Xy=.0664021164021164,Jy=.016415012942191543;function Zy(i){var e,t=[];return t[0]=i*Wy,e=i*i,t[0]+=e*$y,t[1]=e*qy,e*=i,t[0]+=e*Ky,t[1]+=e*Xy,t[2]=e*Jy,t}function e1(i,e){var t=i+i;return i+e[0]*Math.sin(t)+e[1]*Math.sin(t+t)+e[2]*Math.sin(t+t+t)}var t1=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const i1={init:Yy,forward:zy,inverse:jy,names:t1,S_POLE:$o,N_POLE:Ko,EQUIT:qo,OBLIQ:cs};function Ot(i){return Math.abs(i)>1&&(i=i>1?1:-1),Math.asin(i)}function n1(){Math.abs(this.lat1+this.lat2)<K||(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=Ct(this.e3,this.sin_po,this.cos_po),this.qs1=Lt(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=Ct(this.e3,this.sin_po,this.cos_po),this.qs2=Lt(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=Lt(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>K?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 s1(i){var e=i.x,t=i.y;this.sin_phi=Math.sin(t),this.cos_phi=Math.cos(t);var n=Lt(this.e3,this.sin_phi),s=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,o=this.ns0*X(e-this.long0,this.over),r=s*Math.sin(o)+this.x0,l=this.rh-s*Math.cos(o)+this.y0;return i.x=r,i.y=l,i}function o1(i){var e,t,n,s,o,r;return i.x-=this.x0,i.y=this.rh-i.y+this.y0,this.ns0>=0?(e=Math.sqrt(i.x*i.x+i.y*i.y),n=1):(e=-Math.sqrt(i.x*i.x+i.y*i.y),n=-1),s=0,e!==0&&(s=Math.atan2(n*i.x,n*i.y)),n=e*this.ns0/this.a,this.sphere?r=Math.asin((this.c-n*n)/(2*this.ns0)):(t=(this.c-n*n)/this.ns0,r=this.phi1z(this.e3,t)),o=X(s/this.ns0+this.long0,this.over),i.x=o,i.y=r,i}function a1(i,e){var t,n,s,o,r,l=Ot(.5*e);if(i<K)return l;for(var c=i*i,d=1;d<=25;d++)if(t=Math.sin(l),n=Math.cos(l),s=i*t,o=1-s*s,r=.5*o*o/n*(e/(1-c)-t/o+.5/i*Math.log((1-s)/(1+s))),l=l+r,Math.abs(r)<=1e-7)return l;return null}var r1=["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"];const l1={init:n1,forward:s1,inverse:o1,names:r1,phi1z:a1};function c1(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function d1(i){var e,t,n,s,o,r,l,c,d=i.x,h=i.y;return n=X(d-this.long0,this.over),e=Math.sin(h),t=Math.cos(h),s=Math.cos(n),r=this.sin_p14*e+this.cos_p14*t*s,o=1,r>0||Math.abs(r)<=K?(l=this.x0+this.a*o*t*Math.sin(n)/r,c=this.y0+this.a*o*(this.cos_p14*e-this.sin_p14*t*s)/r):(l=this.x0+this.infinity_dist*t*Math.sin(n),c=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*t*s)),i.x=l,i.y=c,i}function h1(i){var e,t,n,s,o,r;return i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,i.x/=this.k0,i.y/=this.k0,(e=Math.sqrt(i.x*i.x+i.y*i.y))?(s=Math.atan2(e,this.rc),t=Math.sin(s),n=Math.cos(s),r=Ot(n*this.sin_p14+i.y*t*this.cos_p14/e),o=Math.atan2(i.x*t,e*this.cos_p14*n-i.y*this.sin_p14*t),o=X(this.long0+o,this.over)):(r=this.phic0,o=0),i.x=o,i.y=r,i}var u1=["gnom"];const f1={init:c1,forward:d1,inverse:h1,names:u1};function m1(i,e){var t=1-(1-i*i)/(2*i)*Math.log((1-i)/(1+i));if(Math.abs(Math.abs(e)-t)<1e-6)return e<0?-1*j:j;for(var n=Math.asin(.5*e),s,o,r,l,c=0;c<30;c++)if(o=Math.sin(n),r=Math.cos(n),l=i*o,s=Math.pow(1-l*l,2)/(2*r)*(e/(1-i*i)-o/(1-l*l)+.5/i*Math.log((1-l)/(1+l))),n+=s,Math.abs(s)<=1e-10)return n;return NaN}function g1(){this.sphere||(this.k0=Ct(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function p1(i){var e=i.x,t=i.y,n,s,o=X(e-this.long0,this.over);if(this.sphere)n=this.x0+this.a*o*Math.cos(this.lat_ts),s=this.y0+this.a*Math.sin(t)/Math.cos(this.lat_ts);else{var r=Lt(this.e,Math.sin(t));n=this.x0+this.a*this.k0*o,s=this.y0+this.a*r*.5/this.k0}return i.x=n,i.y=s,i}function A1(i){i.x-=this.x0,i.y-=this.y0;var e,t;return this.sphere?(e=X(this.long0+i.x/this.a/Math.cos(this.lat_ts),this.over),t=Math.asin(i.y/this.a*Math.cos(this.lat_ts))):(t=m1(this.e,2*i.y*this.k0/this.a),e=X(this.long0+i.x/(this.a*this.k0),this.over)),i.x=e,i.y=t,i}var y1=["cea"];const E1={init:g1,forward:p1,inverse:A1,names:y1};function C1(){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 v1(i){var e=i.x,t=i.y,n=X(e-this.long0,this.over),s=Ft(t-this.lat0);return i.x=this.x0+this.a*n*this.rc,i.y=this.y0+this.a*s,i}function b1(i){var e=i.x,t=i.y;return i.x=X(this.long0+(e-this.x0)/(this.a*this.rc),this.over),i.y=Ft(this.lat0+(t-this.y0)/this.a),i}var w1=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"];const I1={init:C1,forward:v1,inverse:b1,names:w1};var pc=20;function S1(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=on(this.es),this.e1=an(this.es),this.e2=rn(this.es),this.e3=ln(this.es),this.ml0=this.a*ze(this.e0,this.e1,this.e2,this.e3,this.lat0)}function x1(i){var e=i.x,t=i.y,n,s,o,r=X(e-this.long0,this.over);if(o=r*Math.sin(t),this.sphere)Math.abs(t)<=K?(n=this.a*r,s=-1*this.a*this.lat0):(n=this.a*Math.sin(o)/Math.tan(t),s=this.a*(Ft(t-this.lat0)+(1-Math.cos(o))/Math.tan(t)));else if(Math.abs(t)<=K)n=this.a*r,s=-1*this.ml0;else{var l=Wo(this.a,this.e,Math.sin(t))/Math.tan(t);n=l*Math.sin(o),s=this.a*ze(this.e0,this.e1,this.e2,this.e3,t)-this.ml0+l*(1-Math.cos(o))}return i.x=n+this.x0,i.y=s+this.y0,i}function M1(i){var e,t,n,s,o,r,l,c,d;if(n=i.x-this.x0,s=i.y-this.y0,this.sphere)if(Math.abs(s+this.a*this.lat0)<=K)e=X(n/this.a+this.long0,this.over),t=0;else{r=this.lat0+s/this.a,l=n*n/this.a/this.a+r*r,c=r;var h;for(o=pc;o;--o)if(h=Math.tan(c),d=-1*(r*(c*h+1)-c-.5*(c*c+l)*h)/((c-r)/h-1),c+=d,Math.abs(d)<=K){t=c;break}e=X(this.long0+Math.asin(n*Math.tan(c)/this.a)/Math.sin(t),this.over)}else if(Math.abs(s+this.ml0)<=K)t=0,e=X(this.long0+n/this.a,this.over);else{r=(this.ml0+s)/this.a,l=n*n/this.a/this.a+r*r,c=r;var f,m,u,g,A;for(o=pc;o;--o)if(A=this.e*Math.sin(c),f=Math.sqrt(1-A*A)*Math.tan(c),m=this.a*ze(this.e0,this.e1,this.e2,this.e3,c),u=this.e0-2*this.e1*Math.cos(2*c)+4*this.e2*Math.cos(4*c)-6*this.e3*Math.cos(6*c),g=m/this.a,d=(r*(f*g+1)-g-.5*f*(g*g+l))/(this.es*Math.sin(2*c)*(g*g+l-2*r*g)/(4*f)+(r-g)*(f*u-2/Math.sin(2*c))-u),c-=d,Math.abs(d)<=K){t=c;break}f=Math.sqrt(1-this.es*Math.pow(Math.sin(t),2))*Math.tan(t),e=X(this.long0+Math.asin(n*f/this.a)/Math.sin(t),this.over)}return i.x=e,i.y=t,i}var B1=["Polyconic","American_Polyconic","poly"];const T1={init:S1,forward:x1,inverse:M1,names:B1};function P1(){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 _1(i){var e,t=i.x,n=i.y,s=n-this.lat0,o=t-this.long0,r=s/Xi*1e-5,l=o,c=1,d=0;for(e=1;e<=10;e++)c=c*r,d=d+this.A[e]*c;var h=d,f=l,m=1,u=0,g,A,p=0,y=0;for(e=1;e<=6;e++)g=m*h-u*f,A=u*h+m*f,m=g,u=A,p=p+this.B_re[e]*m-this.B_im[e]*u,y=y+this.B_im[e]*m+this.B_re[e]*u;return i.x=y*this.a+this.x0,i.y=p*this.a+this.y0,i}function D1(i){var e,t=i.x,n=i.y,s=t-this.x0,o=n-this.y0,r=o/this.a,l=s/this.a,c=1,d=0,h,f,m=0,u=0;for(e=1;e<=6;e++)h=c*r-d*l,f=d*r+c*l,c=h,d=f,m=m+this.C_re[e]*c-this.C_im[e]*d,u=u+this.C_im[e]*c+this.C_re[e]*d;for(var g=0;g<this.iterations;g++){var A=m,p=u,y,C,I=r,P=l;for(e=2;e<=6;e++)y=A*m-p*u,C=p*m+A*u,A=y,p=C,I=I+(e-1)*(this.B_re[e]*A-this.B_im[e]*p),P=P+(e-1)*(this.B_im[e]*A+this.B_re[e]*p);A=1,p=0;var k=this.B_re[1],M=this.B_im[1];for(e=2;e<=6;e++)y=A*m-p*u,C=p*m+A*u,A=y,p=C,k=k+e*(this.B_re[e]*A-this.B_im[e]*p),M=M+e*(this.B_im[e]*A+this.B_re[e]*p);var B=k*k+M*M;m=(I*k+P*M)/B,u=(P*k-I*M)/B}var _=m,E=u,w=1,D=0;for(e=1;e<=9;e++)w=w*_,D=D+this.D[e]*w;var F=this.lat0+D*Xi*1e5,U=this.long0+E;return i.x=U,i.y=F,i}var k1=["New_Zealand_Map_Grid","nzmg"];const N1={init:P1,forward:_1,inverse:D1,names:k1};function R1(){}function F1(i){var e=i.x,t=i.y,n=X(e-this.long0,this.over),s=this.x0+this.a*n,o=this.y0+this.a*Math.log(Math.tan(Math.PI/4+t/2.5))*1.25;return i.x=s,i.y=o,i}function L1(i){i.x-=this.x0,i.y-=this.y0;var e=X(this.long0+i.x/this.a,this.over),t=2.5*(Math.atan(Math.exp(.8*i.y/this.a))-Math.PI/4);return i.x=e,i.y=t,i}var O1=["Miller_Cylindrical","mill"];const G1={init:R1,forward:F1,inverse:L1,names:O1};var U1=20;function V1(){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=Vo(this.es)}function Q1(i){var e,t,n=i.x,s=i.y;if(n=X(n-this.long0,this.over),this.sphere){if(!this.m)s=this.n!==1?Math.asin(this.n*Math.sin(s)):s;else for(var o=this.n*Math.sin(s),r=U1;r;--r){var l=(this.m*s+Math.sin(s)-o)/(this.m+Math.cos(s));if(s-=l,Math.abs(l)<K)break}e=this.a*this.C_x*n*(this.m+Math.cos(s)),t=this.a*this.C_y*s}else{var c=Math.sin(s),d=Math.cos(s);t=this.a*Si(s,c,d,this.en),e=this.a*n*d/Math.sqrt(1-this.es*c*c)}return i.x=e,i.y=t,i}function H1(i){var e,t,n,s;return i.x-=this.x0,n=i.x/this.a,i.y-=this.y0,e=i.y/this.a,this.sphere?(e/=this.C_y,n=n/(this.C_x*(this.m+Math.cos(e))),this.m?e=Ot((this.m*e+Math.sin(e))/this.n):this.n!==1&&(e=Ot(Math.sin(e)/this.n)),n=X(n+this.long0,this.over),e=Ft(e)):(e=Qo(i.y/this.a,this.es,this.en),s=Math.abs(e),s<j?(s=Math.sin(e),t=this.long0+i.x*Math.sqrt(1-this.es*s*s)/(this.a*Math.cos(e)),n=X(t,this.over)):s-K<j&&(n=this.long0)),i.x=n,i.y=e,i}var Y1=["Sinusoidal","sinu"];const z1={init:V1,forward:Q1,inverse:H1,names:Y1};function j1(){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}function W1(i){for(var e=i.x,t=i.y,n=X(e-this.long0,this.over),s=t,o=Math.PI*Math.sin(t);;){var r=-(s+Math.sin(s)-o)/(1+Math.cos(s));if(s+=r,Math.abs(r)<K)break}s/=2,Math.PI/2-Math.abs(t)<K&&(n=0);var l=.900316316158*this.a*n*Math.cos(s)+this.x0,c=1.4142135623731*this.a*Math.sin(s)+this.y0;return i.x=l,i.y=c,i}function $1(i){var e,t;i.x-=this.x0,i.y-=this.y0,t=i.y/(1.4142135623731*this.a),Math.abs(t)>.999999999999&&(t=.999999999999),e=Math.asin(t);var n=X(this.long0+i.x/(.900316316158*this.a*Math.cos(e)),this.over);n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),t=(2*e+Math.sin(2*e))/Math.PI,Math.abs(t)>1&&(t=1);var s=Math.asin(t);return i.x=n,i.y=s,i}var K1=["Mollweide","moll"];const q1={init:j1,forward:W1,inverse:$1,names:K1};function X1(){Math.abs(this.lat1+this.lat2)<K||(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=on(this.es),this.e1=an(this.es),this.e2=rn(this.es),this.e3=ln(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=Ct(this.e,this.sin_phi,this.cos_phi),this.ml1=ze(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<K?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=Ct(this.e,this.sin_phi,this.cos_phi),this.ml2=ze(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=ze(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function J1(i){var e=i.x,t=i.y,n;if(this.sphere)n=this.a*(this.g-t);else{var s=ze(this.e0,this.e1,this.e2,this.e3,t);n=this.a*(this.g-s)}var o=this.ns*X(e-this.long0,this.over),r=this.x0+n*Math.sin(o),l=this.y0+this.rh-n*Math.cos(o);return i.x=r,i.y=l,i}function Z1(i){i.x-=this.x0,i.y=this.rh-i.y+this.y0;var e,t,n,s;this.ns>=0?(t=Math.sqrt(i.x*i.x+i.y*i.y),e=1):(t=-Math.sqrt(i.x*i.x+i.y*i.y),e=-1);var o=0;if(t!==0&&(o=Math.atan2(e*i.x,e*i.y)),this.sphere)return s=X(this.long0+o/this.ns,this.over),n=Ft(this.g-t/this.a),i.x=s,i.y=n,i;var r=this.g-t/this.a;return n=ls(r,this.e0,this.e1,this.e2,this.e3),s=X(this.long0+o/this.ns,this.over),i.x=s,i.y=n,i}var eE=["Equidistant_Conic","eqdc"];const tE={init:X1,forward:J1,inverse:Z1,names:eE};function iE(){this.R=this.a}function nE(i){var e=i.x,t=i.y,n=X(e-this.long0,this.over),s,o;Math.abs(t)<=K&&(s=this.x0+this.R*n,o=this.y0);var r=Ot(2*Math.abs(t/Math.PI));(Math.abs(n)<=K||Math.abs(Math.abs(t)-j)<=K)&&(s=this.x0,t>=0?o=this.y0+Math.PI*this.R*Math.tan(.5*r):o=this.y0+Math.PI*this.R*-Math.tan(.5*r));var l=.5*Math.abs(Math.PI/n-n/Math.PI),c=l*l,d=Math.sin(r),h=Math.cos(r),f=h/(d+h-1),m=f*f,u=f*(2/d-1),g=u*u,A=Math.PI*this.R*(l*(f-g)+Math.sqrt(c*(f-g)*(f-g)-(g+c)*(m-g)))/(g+c);n<0&&(A=-A),s=this.x0+A;var p=c+f;return A=Math.PI*this.R*(u*p-l*Math.sqrt((g+c)*(c+1)-p*p))/(g+c),t>=0?o=this.y0+A:o=this.y0-A,i.x=s,i.y=o,i}function sE(i){var e,t,n,s,o,r,l,c,d,h,f,m,u;return i.x-=this.x0,i.y-=this.y0,f=Math.PI*this.R,n=i.x/f,s=i.y/f,o=n*n+s*s,r=-Math.abs(s)*(1+o),l=r-2*s*s+n*n,c=-2*r+1+2*s*s+o*o,u=s*s/c+(2*l*l*l/c/c/c-9*r*l/c/c)/27,d=(r-l*l/3/c)/c,h=2*Math.sqrt(-d/3),f=3*u/d/h,Math.abs(f)>1&&(f>=0?f=1:f=-1),m=Math.acos(f)/3,i.y>=0?t=(-h*Math.cos(m+Math.PI/3)-l/3/c)*Math.PI:t=-(-h*Math.cos(m+Math.PI/3)-l/3/c)*Math.PI,Math.abs(n)<K?e=this.long0:e=X(this.long0+Math.PI*(o-1+Math.sqrt(1+2*(n*n-s*s)+o*o))/2/n,this.over),i.x=e,i.y=t,i}var oE=["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"];const aE={init:iE,forward:nE,inverse:sE,names:oE};function rE(i,e,t,n,s,o){const r=n-e,l=Math.atan((1-o)*Math.tan(i)),c=Math.atan((1-o)*Math.tan(t)),d=Math.sin(l),h=Math.cos(l),f=Math.sin(c),m=Math.cos(c);let u=r,g,A=100,p,y,C,I,P,k,M,B,_,E,w,D,F,U;do{if(p=Math.sin(u),y=Math.cos(u),C=Math.sqrt(m*p*(m*p)+(h*f-d*m*y)*(h*f-d*m*y)),C===0)return{azi1:0,s12:0};I=d*f+h*m*y,P=Math.atan2(C,I),k=h*m*p/C,M=1-k*k,B=M!==0?I-2*d*f/M:0,_=o/16*M*(4+o*(4-3*M)),g=u,u=r+(1-_)*o*k*(P+_*C*(B+_*I*(-1+2*B*B)))}while(Math.abs(u-g)>1e-12&&--A>0);return A===0?{azi1:NaN,s12:NaN}:(E=M*(s*s-s*(1-o)*(s*(1-o)))/(s*(1-o)*(s*(1-o))),w=1+E/16384*(4096+E*(-768+E*(320-175*E))),D=E/1024*(256+E*(-128+E*(74-47*E))),F=D*C*(B+D/4*(I*(-1+2*B*B)-D/6*B*(-3+4*C*C)*(-3+4*B*B))),U=s*(1-o)*w*(P-F),{azi1:Math.atan2(m*p,h*f-d*m*y),s12:U})}function lE(i,e,t,n,s,o){const r=Math.atan((1-o)*Math.tan(i)),l=Math.sin(r),c=Math.cos(r),d=Math.sin(t),h=Math.cos(t),f=Math.atan2(l,c*h),m=c*d,u=1-m*m,g=u*(s*s-s*(1-o)*(s*(1-o)))/(s*(1-o)*(s*(1-o))),A=1+g/16384*(4096+g*(-768+g*(320-175*g))),p=g/1024*(256+g*(-128+g*(74-47*g)));let y=n/(s*(1-o)*A),C,I=100,P,k,M,B;do P=Math.cos(2*f+y),k=Math.sin(y),M=Math.cos(y),B=p*k*(P+p/4*(M*(-1+2*P*P)-p/6*P*(-3+4*k*k)*(-3+4*P*P))),C=y,y=n/(s*(1-o)*A)+B;while(Math.abs(y-C)>1e-12&&--I>0);if(I===0)return{lat2:NaN,lon2:NaN};const _=l*k-c*M*h,E=Math.atan2(l*M+c*k*h,(1-o)*Math.sqrt(m*m+_*_)),w=Math.atan2(k*d,c*M-l*k*h),D=o/16*u*(4+o*(4-3*u)),F=w-(1-D)*o*m*(y+D*k*(P+D*M*(-1+2*P*P))),U=e+F;return{lat2:E,lon2:U}}function cE(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.f=this.es/(1+Math.sqrt(1-this.es))}function dE(i){var e=i.x,t=i.y,n=Math.sin(i.y),s=Math.cos(i.y),o=X(e-this.long0,this.over),r,l,c,d,h,f,m,u,g,A,p;return this.sphere?Math.abs(this.sin_p12-1)<=K?(i.x=this.x0+this.a*(j-t)*Math.sin(o),i.y=this.y0-this.a*(j-t)*Math.cos(o),i):Math.abs(this.sin_p12+1)<=K?(i.x=this.x0+this.a*(j+t)*Math.sin(o),i.y=this.y0+this.a*(j+t)*Math.cos(o),i):(g=this.sin_p12*n+this.cos_p12*s*Math.cos(o),m=Math.acos(g),u=m?m/Math.sin(m):1,i.x=this.x0+this.a*u*s*Math.sin(o),i.y=this.y0+this.a*u*(this.cos_p12*n-this.sin_p12*s*Math.cos(o)),i):(r=on(this.es),l=an(this.es),c=rn(this.es),d=ln(this.es),Math.abs(this.sin_p12-1)<=K?(h=this.a*ze(r,l,c,d,j),f=this.a*ze(r,l,c,d,t),i.x=this.x0+(h-f)*Math.sin(o),i.y=this.y0-(h-f)*Math.cos(o),i):Math.abs(this.sin_p12+1)<=K?(h=this.a*ze(r,l,c,d,j),f=this.a*ze(r,l,c,d,t),i.x=this.x0+(h+f)*Math.sin(o),i.y=this.y0+(h+f)*Math.cos(o),i):Math.abs(e)<K&&Math.abs(t-this.lat0)<K?(i.x=i.y=0,i):(A=rE(this.lat0,this.long0,t,e,this.a,this.f),p=A.azi1,i.x=A.s12*Math.sin(p),i.y=A.s12*Math.cos(p),i))}function hE(i){i.x-=this.x0,i.y-=this.y0;var e,t,n,s,o,r,l,c,d,h,f,m,u,g,A,p;return this.sphere?(e=Math.sqrt(i.x*i.x+i.y*i.y),e>2*j*this.a?void 0:(t=e/this.a,n=Math.sin(t),s=Math.cos(t),o=this.long0,Math.abs(e)<=K?r=this.lat0:(r=Ot(s*this.sin_p12+i.y*n*this.cos_p12/e),l=Math.abs(this.lat0)-j,Math.abs(l)<=K?this.lat0>=0?o=X(this.long0+Math.atan2(i.x,-i.y),this.over):o=X(this.long0-Math.atan2(-i.x,i.y),this.over):o=X(this.long0+Math.atan2(i.x*n,e*this.cos_p12*s-i.y*this.sin_p12*n),this.over)),i.x=o,i.y=r,i)):(c=on(this.es),d=an(this.es),h=rn(this.es),f=ln(this.es),Math.abs(this.sin_p12-1)<=K?(m=this.a*ze(c,d,h,f,j),e=Math.sqrt(i.x*i.x+i.y*i.y),u=m-e,r=ls(u/this.a,c,d,h,f),o=X(this.long0+Math.atan2(i.x,-1*i.y),this.over),i.x=o,i.y=r,i):Math.abs(this.sin_p12+1)<=K?(m=this.a*ze(c,d,h,f,j),e=Math.sqrt(i.x*i.x+i.y*i.y),u=e-m,r=ls(u/this.a,c,d,h,f),o=X(this.long0+Math.atan2(i.x,i.y),this.over),i.x=o,i.y=r,i):(g=Math.atan2(i.x,i.y),A=Math.sqrt(i.x*i.x+i.y*i.y),p=lE(this.lat0,this.long0,g,A,this.a,this.f),i.x=p.lon2,i.y=p.lat2,i))}var uE=["Azimuthal_Equidistant","aeqd"];const fE={init:cE,forward:dE,inverse:hE,names:uE};function mE(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function gE(i){var e,t,n,s,o,r,l,c,d=i.x,h=i.y;return n=X(d-this.long0,this.over),e=Math.sin(h),t=Math.cos(h),s=Math.cos(n),r=this.sin_p14*e+this.cos_p14*t*s,o=1,(r>0||Math.abs(r)<=K)&&(l=this.a*o*t*Math.sin(n),c=this.y0+this.a*o*(this.cos_p14*e-this.sin_p14*t*s)),i.x=l,i.y=c,i}function pE(i){var e,t,n,s,o,r,l;return i.x-=this.x0,i.y-=this.y0,e=Math.sqrt(i.x*i.x+i.y*i.y),t=Ot(e/this.a),n=Math.sin(t),s=Math.cos(t),r=this.long0,Math.abs(e)<=K?(l=this.lat0,i.x=r,i.y=l,i):(l=Ot(s*this.sin_p14+i.y*n*this.cos_p14/e),o=Math.abs(this.lat0)-j,Math.abs(o)<=K?(this.lat0>=0?r=X(this.long0+Math.atan2(i.x,-i.y),this.over):r=X(this.long0-Math.atan2(-i.x,i.y),this.over),i.x=r,i.y=l,i):(r=X(this.long0+Math.atan2(i.x*n,e*this.cos_p14*s-i.y*this.sin_p14*n),this.over),i.x=r,i.y=l,i))}var AE=["ortho"];const yE={init:mE,forward:gE,inverse:pE,names:AE};var Ie={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},fe={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function EE(){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>=j-ue/2?this.face=Ie.TOP:this.lat0<=-(j-ue/2)?this.face=Ie.BOTTOM:Math.abs(this.long0)<=ue?this.face=Ie.FRONT:Math.abs(this.long0)<=j+ue?this.face=this.long0>0?Ie.RIGHT:Ie.LEFT:this.face=Ie.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 CE(i){var e={x:0,y:0},t,n,s,o,r,l,c={value:0};if(i.x-=this.long0,this.es!==0?t=Math.atan(this.one_minus_f_squared*Math.tan(i.y)):t=i.y,n=i.x,this.face===Ie.TOP)o=j-t,n>=ue&&n<=j+ue?(c.value=fe.AREA_0,s=n-j):n>j+ue||n<=-(j+ue)?(c.value=fe.AREA_1,s=n>0?n-Me:n+Me):n>-(j+ue)&&n<=-ue?(c.value=fe.AREA_2,s=n+j):(c.value=fe.AREA_3,s=n);else if(this.face===Ie.BOTTOM)o=j+t,n>=ue&&n<=j+ue?(c.value=fe.AREA_0,s=-n+j):n<ue&&n>=-ue?(c.value=fe.AREA_1,s=-n):n<-ue&&n>=-(j+ue)?(c.value=fe.AREA_2,s=-n-j):(c.value=fe.AREA_3,s=n>0?-n+Me:-n-Me);else{var d,h,f,m,u,g,A;this.face===Ie.RIGHT?n=Mi(n,+j):this.face===Ie.BACK?n=Mi(n,+Me):this.face===Ie.LEFT&&(n=Mi(n,-j)),m=Math.sin(t),u=Math.cos(t),g=Math.sin(n),A=Math.cos(n),d=u*A,h=u*g,f=m,this.face===Ie.FRONT?(o=Math.acos(d),s=ds(o,f,h,c)):this.face===Ie.RIGHT?(o=Math.acos(h),s=ds(o,f,-d,c)):this.face===Ie.BACK?(o=Math.acos(-d),s=ds(o,f,-h,c)):this.face===Ie.LEFT?(o=Math.acos(-h),s=ds(o,f,d,c)):(o=s=0,c.value=fe.AREA_0)}return l=Math.atan(12/Me*(s+Math.acos(Math.sin(s)*Math.cos(ue))-j)),r=Math.sqrt((1-Math.cos(o))/(Math.cos(l)*Math.cos(l))/(1-Math.cos(Math.atan(1/Math.cos(s))))),c.value===fe.AREA_1?l+=j:c.value===fe.AREA_2?l+=Me:c.value===fe.AREA_3&&(l+=1.5*Me),e.x=r*Math.cos(l),e.y=r*Math.sin(l),e.x=e.x*this.a+this.x0,e.y=e.y*this.a+this.y0,i.x=e.x,i.y=e.y,i}function vE(i){var e={lam:0,phi:0},t,n,s,o,r,l,c,d,h,f={value:0};if(i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,n=Math.atan(Math.sqrt(i.x*i.x+i.y*i.y)),t=Math.atan2(i.y,i.x),i.x>=0&&i.x>=Math.abs(i.y)?f.value=fe.AREA_0:i.y>=0&&i.y>=Math.abs(i.x)?(f.value=fe.AREA_1,t-=j):i.x<0&&-i.x>=Math.abs(i.y)?(f.value=fe.AREA_2,t=t<0?t+Me:t-Me):(f.value=fe.AREA_3,t+=j),h=Me/12*Math.tan(t),r=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),l=Math.atan(r),s=Math.cos(t),o=Math.tan(n),c=1-s*s*o*o*(1-Math.cos(Math.atan(1/Math.cos(l)))),c<-1?c=-1:c>1&&(c=1),this.face===Ie.TOP)d=Math.acos(c),e.phi=j-d,f.value===fe.AREA_0?e.lam=l+j:f.value===fe.AREA_1?e.lam=l<0?l+Me:l-Me:f.value===fe.AREA_2?e.lam=l-j:e.lam=l;else if(this.face===Ie.BOTTOM)d=Math.acos(c),e.phi=d-j,f.value===fe.AREA_0?e.lam=-l+j:f.value===fe.AREA_1?e.lam=-l:f.value===fe.AREA_2?e.lam=-l-j:e.lam=l<0?-l-Me:-l+Me;else{var m,u,g;m=c,h=m*m,h>=1?g=0:g=Math.sqrt(1-h)*Math.sin(l),h+=g*g,h>=1?u=0:u=Math.sqrt(1-h),f.value===fe.AREA_1?(h=u,u=-g,g=h):f.value===fe.AREA_2?(u=-u,g=-g):f.value===fe.AREA_3&&(h=u,u=g,g=-h),this.face===Ie.RIGHT?(h=m,m=-u,u=h):this.face===Ie.BACK?(m=-m,u=-u):this.face===Ie.LEFT&&(h=m,m=u,u=-h),e.phi=Math.acos(-g)-j,e.lam=Math.atan2(u,m),this.face===Ie.RIGHT?e.lam=Mi(e.lam,-j):this.face===Ie.BACK?e.lam=Mi(e.lam,-Me):this.face===Ie.LEFT&&(e.lam=Mi(e.lam,+j))}if(this.es!==0){var A,p,y;A=e.phi<0?1:0,p=Math.tan(e.phi),y=this.b/Math.sqrt(p*p+this.one_minus_f_squared),e.phi=Math.atan(Math.sqrt(this.a*this.a-y*y)/(this.one_minus_f*y)),A&&(e.phi=-e.phi)}return e.lam+=this.long0,i.x=e.lam,i.y=e.phi,i}function ds(i,e,t,n){var s;return i<K?(n.value=fe.AREA_0,s=0):(s=Math.atan2(e,t),Math.abs(s)<=ue?n.value=fe.AREA_0:s>ue&&s<=j+ue?(n.value=fe.AREA_1,s-=j):s>j+ue||s<=-(j+ue)?(n.value=fe.AREA_2,s=s>=0?s-Me:s+Me):(n.value=fe.AREA_3,s+=j)),s}function Mi(i,e){var t=i+e;return t<-Me?t+=Ji:t>+Me&&(t-=Ji),t}var bE=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const wE={init:EE,forward:CE,inverse:vE,names:bE};var Xo=[[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]],cn=[[-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]],Ac=.8487,yc=1.3523,Ec=$e/5,IE=1/Ec,Bi=18,hs=function(i,e){return i[0]+e*(i[1]+e*(i[2]+e*i[3]))},SE=function(i,e){return i[1]+e*(2*i[2]+e*3*i[3])};function xE(i,e,t,n){for(var s=e;n;--n){var o=i(s);if(s-=o,Math.abs(o)<t)break}return s}function ME(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function BE(i){var e=X(i.x-this.long0,this.over),t=Math.abs(i.y),n=Math.floor(t*Ec);n<0?n=0:n>=Bi&&(n=Bi-1),t=$e*(t-IE*n);var s={x:hs(Xo[n],t)*e,y:hs(cn[n],t)};return i.y<0&&(s.y=-s.y),s.x=s.x*this.a*Ac+this.x0,s.y=s.y*this.a*yc+this.y0,s}function TE(i){var e={x:(i.x-this.x0)/(this.a*Ac),y:Math.abs(i.y-this.y0)/(this.a*yc)};if(e.y>=1)e.x/=Xo[Bi][0],e.y=i.y<0?-j:j;else{var t=Math.floor(e.y*Bi);for(t<0?t=0:t>=Bi&&(t=Bi-1);;)if(cn[t][0]>e.y)--t;else if(cn[t+1][0]<=e.y)++t;else break;var n=cn[t],s=5*(e.y-n[0])/(cn[t+1][0]-n[0]);s=xE(function(o){return(hs(n,o)-e.y)/SE(n,o)},s,K,100),e.x/=hs(Xo[t],s),e.y=(5*t+s)*xe,i.y<0&&(e.y=-e.y)}return e.x=X(e.x+this.long0,this.over),e}var PE=["Robinson","robin"];const _E={init:ME,forward:BE,inverse:TE,names:PE};function DE(){this.name="geocent"}function kE(i){var e=Kl(i,this.es,this.a);return e}function NE(i){var e=ql(i,this.es,this.a,this.b);return e}var RE=["Geocentric","geocentric","geocent","Geocent"];const FE={init:DE,forward:kE,inverse:NE,names:RE};var Qe={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},dn={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 LE(){if(Object.keys(dn).forEach((function(t){if(typeof this[t]>"u")this[t]=dn[t].def;else{if(dn[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);dn[t].num&&(this[t]=parseFloat(this[t]))}dn[t].degrees&&(this[t]=this[t]*xe)}).bind(this)),Math.abs(Math.abs(this.lat0)-j)<K?this.mode=this.lat0<0?Qe.S_POLE:Qe.N_POLE:Math.abs(this.lat0)<K?this.mode=Qe.EQUIT:(this.mode=Qe.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 i=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(i),this.sw=Math.sin(i)}function OE(i){i.x-=this.long0;var e=Math.sin(i.y),t=Math.cos(i.y),n=Math.cos(i.x),s,o;switch(this.mode){case Qe.OBLIQ:o=this.sinph0*e+this.cosph0*t*n;break;case Qe.EQUIT:o=t*n;break;case Qe.S_POLE:o=-e;break;case Qe.N_POLE:o=e;break}switch(o=this.pn1/(this.p-o),s=o*t*Math.sin(i.x),this.mode){case Qe.OBLIQ:o*=this.cosph0*e-this.sinph0*t*n;break;case Qe.EQUIT:o*=e;break;case Qe.N_POLE:o*=-(t*n);break;case Qe.S_POLE:o*=t*n;break}var r,l;return r=o*this.cg+s*this.sg,l=1/(r*this.sw*this.h1+this.cw),s=(s*this.cg-o*this.sg)*this.cw*l,o=r*l,i.x=s*this.a,i.y=o*this.a,i}function GE(i){i.x/=this.a,i.y/=this.a;var e={x:i.x,y:i.y},t,n,s;s=1/(this.pn1-i.y*this.sw),t=this.pn1*i.x*s,n=this.pn1*i.y*this.cw*s,i.x=t*this.cg+n*this.sg,i.y=n*this.cg-t*this.sg;var o=Xe(i.x,i.y);if(Math.abs(o)<K)e.x=0,e.y=i.y;else{var r,l;switch(l=1-o*o*this.pfact,l=(this.p-Math.sqrt(l))/(this.pn1/o+o/this.pn1),r=Math.sqrt(1-l*l),this.mode){case Qe.OBLIQ:e.y=Math.asin(r*this.sinph0+i.y*l*this.cosph0/o),i.y=(r-this.sinph0*Math.sin(e.y))*o,i.x*=l*this.cosph0;break;case Qe.EQUIT:e.y=Math.asin(i.y*l/o),i.y=r*o,i.x*=l;break;case Qe.N_POLE:e.y=Math.asin(r),i.y=-i.y;break;case Qe.S_POLE:e.y=-Math.asin(r);break}e.x=Math.atan2(i.x,i.y)}return i.x=e.x+this.long0,i.y=e.y,i}var UE=["Tilted_Perspective","tpers"];const VE={init:LE,forward:OE,inverse:GE,names:UE};function QE(){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 i=1-this.es,e=1/i;this.radius_p=Math.sqrt(i),this.radius_p2=i,this.radius_p_inv2=e,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 HE(i){var e=i.x,t=i.y,n,s,o,r;if(e=e-this.long0,this.shape==="ellipse"){t=Math.atan(this.radius_p2*Math.tan(t));var l=this.radius_p/Xe(this.radius_p*Math.cos(t),Math.sin(t));if(s=l*Math.cos(e)*Math.cos(t),o=l*Math.sin(e)*Math.cos(t),r=l*Math.sin(t),(this.radius_g-s)*s-o*o-r*r*this.radius_p_inv2<0)return i.x=Number.NaN,i.y=Number.NaN,i;n=this.radius_g-s,this.flip_axis?(i.x=this.radius_g_1*Math.atan(o/Xe(r,n)),i.y=this.radius_g_1*Math.atan(r/n)):(i.x=this.radius_g_1*Math.atan(o/n),i.y=this.radius_g_1*Math.atan(r/Xe(o,n)))}else this.shape==="sphere"&&(n=Math.cos(t),s=Math.cos(e)*n,o=Math.sin(e)*n,r=Math.sin(t),n=this.radius_g-s,this.flip_axis?(i.x=this.radius_g_1*Math.atan(o/Xe(r,n)),i.y=this.radius_g_1*Math.atan(r/n)):(i.x=this.radius_g_1*Math.atan(o/n),i.y=this.radius_g_1*Math.atan(r/Xe(o,n))));return i.x=i.x*this.a,i.y=i.y*this.a,i}function YE(i){var e=-1,t=0,n=0,s,o,r,l;if(i.x=i.x/this.a,i.y=i.y/this.a,this.shape==="ellipse"){this.flip_axis?(n=Math.tan(i.y/this.radius_g_1),t=Math.tan(i.x/this.radius_g_1)*Xe(1,n)):(t=Math.tan(i.x/this.radius_g_1),n=Math.tan(i.y/this.radius_g_1)*Xe(1,t));var c=n/this.radius_p;if(s=t*t+c*c+e*e,o=2*this.radius_g*e,r=o*o-4*s*this.C,r<0)return i.x=Number.NaN,i.y=Number.NaN,i;l=(-o-Math.sqrt(r))/(2*s),e=this.radius_g+l*e,t*=l,n*=l,i.x=Math.atan2(t,e),i.y=Math.atan(n*Math.cos(i.x)/e),i.y=Math.atan(this.radius_p_inv2*Math.tan(i.y))}else if(this.shape==="sphere"){if(this.flip_axis?(n=Math.tan(i.y/this.radius_g_1),t=Math.tan(i.x/this.radius_g_1)*Math.sqrt(1+n*n)):(t=Math.tan(i.x/this.radius_g_1),n=Math.tan(i.y/this.radius_g_1)*Math.sqrt(1+t*t)),s=t*t+n*n+e*e,o=2*this.radius_g*e,r=o*o-4*s*this.C,r<0)return i.x=Number.NaN,i.y=Number.NaN,i;l=(-o-Math.sqrt(r))/(2*s),e=this.radius_g+l*e,t*=l,n*=l,i.x=Math.atan2(t,e),i.y=Math.atan(n*Math.cos(i.x)/e)}return i.x=i.x+this.long0,i}var zE=["Geostationary Satellite View","Geostationary_Satellite","geos"];const jE={init:QE,forward:HE,inverse:YE,names:zE};var hn=1.340264,un=-.081106,fn=893e-6,mn=.003796,us=Math.sqrt(3)/2;function WE(){this.es=0,this.long0=this.long0!==void 0?this.long0:0,this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0}function $E(i){var e=X(i.x-this.long0,this.over),t=i.y,n=Math.asin(us*Math.sin(t)),s=n*n,o=s*s*s;return i.x=e*Math.cos(n)/(us*(hn+3*un*s+o*(7*fn+9*mn*s))),i.y=n*(hn+un*s+o*(fn+mn*s)),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function KE(i){i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a;var e=1e-9,t=12,n=i.y,s,o,r,l,c,d;for(d=0;d<t&&(s=n*n,o=s*s*s,r=n*(hn+un*s+o*(fn+mn*s))-i.y,l=hn+3*un*s+o*(7*fn+9*mn*s),n-=c=r/l,!(Math.abs(c)<e));++d);return s=n*n,o=s*s*s,i.x=us*i.x*(hn+3*un*s+o*(7*fn+9*mn*s))/Math.cos(n),i.y=Math.asin(Math.sin(n)/us),i.x=X(i.x+this.long0,this.over),i}var qE=["eqearth","Equal Earth","Equal_Earth"];const XE={init:WE,forward:$E,inverse:KE,names:qE};var gn=1e-10;function JE(){var i;if(this.phi1=this.lat1,Math.abs(this.phi1)<gn)throw new Error;this.es?(this.en=Vo(this.es),this.m1=Si(this.phi1,this.am1=Math.sin(this.phi1),i=Math.cos(this.phi1),this.en),this.am1=i/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=eC,this.forward=ZE):(Math.abs(this.phi1)+gn>=j?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=iC,this.forward=tC)}function ZE(i){var e=X(i.x-(this.long0||0),this.over),t=i.y,n,s,o;return n=this.am1+this.m1-Si(t,s=Math.sin(t),o=Math.cos(t),this.en),s=o*e/(n*Math.sqrt(1-this.es*s*s)),i.x=n*Math.sin(s),i.y=this.am1-n*Math.cos(s),i.x=this.a*i.x+(this.x0||0),i.y=this.a*i.y+(this.y0||0),i}function eC(i){i.x=(i.x-(this.x0||0))/this.a,i.y=(i.y-(this.y0||0))/this.a;var e,t,n,s;if(t=Xe(i.x,i.y=this.am1-i.y),s=Qo(this.am1+this.m1-t,this.es,this.en),(e=Math.abs(s))<j)e=Math.sin(s),n=t*Math.atan2(i.x,i.y)*Math.sqrt(1-this.es*e*e)/Math.cos(s);else if(Math.abs(e-j)<=gn)n=0;else throw new Error;return i.x=X(n+(this.long0||0),this.over),i.y=Ft(s),i}function tC(i){var e=X(i.x-(this.long0||0),this.over),t=i.y,n,s;return s=this.cphi1+this.phi1-t,Math.abs(s)>gn?(i.x=s*Math.sin(n=e*Math.cos(t)/s),i.y=this.cphi1-s*Math.cos(n)):i.x=i.y=0,i.x=this.a*i.x+(this.x0||0),i.y=this.a*i.y+(this.y0||0),i}function iC(i){i.x=(i.x-(this.x0||0))/this.a,i.y=(i.y-(this.y0||0))/this.a;var e,t,n=Xe(i.x,i.y=this.cphi1-i.y);if(t=this.cphi1+this.phi1-n,Math.abs(t)>j)throw new Error;return Math.abs(Math.abs(t)-j)<=gn?e=0:e=n*Math.atan2(i.x,i.y)/Math.cos(t),i.x=X(e+(this.long0||0),this.over),i.y=Ft(t),i}var nC=["bonne","Bonne (Werner lat_1=90)"];const sC={init:JE,names:nC},Cc={OBLIQUE:{forward:cC,inverse:hC},TRANSVERSE:{forward:dC,inverse:uC}},fs={ROTATE:{o_alpha:"oAlpha",o_lon_c:"oLongC",o_lat_c:"oLatC"},NEW_POLE:{o_lat_p:"oLatP",o_lon_p:"oLongP"},NEW_EQUATOR:{o_lon_1:"oLong1",o_lat_1:"oLat1",o_lon_2:"oLong2",o_lat_2:"oLat2"}};function oC(){if(this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.title=this.title||"General Oblique Transformation",this.isIdentity=Yl.includes(this.o_proj),!this.o_proj)throw new Error("Missing parameter: o_proj");if(this.o_proj==="ob_tran")throw new Error("Invalid value for o_proj: "+this.o_proj);const i=this.projStr.replace("+proj=ob_tran","").replace("+o_proj=","+proj=").trim(),e=st(i);if(!e)throw new Error("Invalid parameter: o_proj. Unknown projection "+this.o_proj);e.long0=0,this.obliqueProjection=e;let t;const n=Object.keys(fs),s=l=>{if(typeof this[l]>"u")return;const c=parseFloat(this[l])*xe;if(isNaN(c))throw new Error("Invalid value for "+l+": "+this[l]);return c};for(let l=0;l<n.length;l++){const c=n[l],d=fs[c],h=Object.entries(d);if(h.some(([m])=>typeof this[m]<"u")){t=d;for(let m=0;m<h.length;m++){const[u,g]=h[m],A=s(u);if(typeof A>"u")throw new Error("Missing parameter: "+u+".");this[g]=A}break}}if(!t)throw new Error("No valid parameters provided for ob_tran projection.");const{lamp:o,phip:r}=lC(this,t);this.lamp=o,Math.abs(r)>K?(this.cphip=Math.cos(r),this.sphip=Math.sin(r),this.projectionType=Cc.OBLIQUE):this.projectionType=Cc.TRANSVERSE}function aC(i){return this.projectionType.forward(this,i)}function rC(i){return this.projectionType.inverse(this,i)}function lC(i,e){let t,n;if(e===fs.ROTATE){let s=i.oLongC,o=i.oLatC,r=i.oAlpha;if(Math.abs(Math.abs(o)-j)<=K)throw new Error("Invalid value for o_lat_c: "+i.o_lat_c+" should be < 90°");n=s+Math.atan2(-1*Math.cos(r),-1*Math.sin(r)*Math.sin(o)),t=Math.asin(Math.cos(o)*Math.sin(r))}else if(e===fs.NEW_POLE)n=i.oLongP,t=i.oLatP;else{let s=i.oLong1,o=i.oLat1,r=i.oLong2,l=i.oLat2,c=Math.abs(o);if(Math.abs(o)>j-K)throw new Error("Invalid value for o_lat_1: "+i.o_lat_1+" should be < 90°");if(Math.abs(l)>j-K)throw new Error("Invalid value for o_lat_2: "+i.o_lat_2+" should be < 90°");if(Math.abs(o-l)<K)throw new Error("Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2");if(c<K)throw new Error("Invalid value for o_lat_1: o_lat_1 should be different from zero");n=Math.atan2(Math.cos(o)*Math.sin(l)*Math.cos(s)-Math.sin(o)*Math.cos(l)*Math.cos(r),Math.sin(o)*Math.cos(l)*Math.sin(r)-Math.cos(o)*Math.sin(l)*Math.sin(s)),t=Math.atan(-1*Math.cos(n-s)/Math.tan(o))}return{lamp:n,phip:t}}function cC(i,e){let{x:t,y:n}=e;t+=i.long0;const s=Math.cos(t),o=Math.sin(n),r=Math.cos(n);e.x=X(Math.atan2(r*Math.sin(t),i.sphip*r*s+i.cphip*o)+i.lamp),e.y=Math.asin(i.sphip*o-i.cphip*r*s);const l=i.obliqueProjection.forward(e);return i.isIdentity&&(l.x*=$e,l.y*=$e),l}function dC(i,e){let{x:t,y:n}=e;t+=i.long0;const s=Math.cos(n),o=Math.cos(t);e.x=X(Math.atan2(s*Math.sin(t),Math.sin(n))+i.lamp),e.y=Math.asin(-1*s*o);const r=i.obliqueProjection.forward(e);return i.isIdentity&&(r.x*=$e,r.y*=$e),r}function hC(i,e){i.isIdentity&&(e.x*=xe,e.y*=xe);const t=i.obliqueProjection.inverse(e);let{x:n,y:s}=t;if(n<Number.MAX_VALUE){n-=i.lamp;const o=Math.cos(n),r=Math.sin(s),l=Math.cos(s);e.x=Math.atan2(l*Math.sin(n),i.sphip*l*o-i.cphip*r),e.y=Math.asin(i.sphip*r+i.cphip*l*o)}return e.x=X(e.x+i.long0),e}function uC(i,e){i.isIdentity&&(e.x*=xe,e.y*=xe);const t=i.obliqueProjection.inverse(e);let{x:n,y:s}=t;if(n<Number.MAX_VALUE){const o=Math.cos(s);n-=i.lamp,e.x=Math.atan2(o*Math.sin(n),-1*Math.sin(s)),e.y=Math.asin(o*Math.cos(n))}return e.x=X(e.x+i.long0),e}var fC=["General Oblique Transformation","General_Oblique_Transformation","ob_tran"];const mC={init:oC,forward:aC,inverse:rC,names:fC};function gC(i){i.Proj.projections.add(as),i.Proj.projections.add(rs),i.Proj.projections.add(ny),i.Proj.projections.add(uy),i.Proj.projections.add(Ay),i.Proj.projections.add(by),i.Proj.projections.add(By),i.Proj.projections.add(ky),i.Proj.projections.add(Oy),i.Proj.projections.add(Hy),i.Proj.projections.add(i1),i.Proj.projections.add(l1),i.Proj.projections.add(f1),i.Proj.projections.add(E1),i.Proj.projections.add(I1),i.Proj.projections.add(T1),i.Proj.projections.add(N1),i.Proj.projections.add(G1),i.Proj.projections.add(z1),i.Proj.projections.add(q1),i.Proj.projections.add(tE),i.Proj.projections.add(aE),i.Proj.projections.add(fE),i.Proj.projections.add(yE),i.Proj.projections.add(wE),i.Proj.projections.add(_E),i.Proj.projections.add(FE),i.Proj.projections.add(VE),i.Proj.projections.add(jE),i.Proj.projections.add(XE),i.Proj.projections.add(sC),i.Proj.projections.add(mC)}const ms=Object.assign(CA,{defaultDatum:"WGS84",Proj:st,WGS84:new st("WGS84"),Point:Ii,toPoint:ec,defs:Ge,nadgrid:iA,transform:ss,mgrs:vA,version:"__VERSION__"});gC(ms);class pC{cesium;viewer;mapLayers={};modelId="default";options={flyTo:!0};gisCadModelsList=[];open=!1;events=new Ki;constructor({viewer:e,cesium:t}){this.viewer=e,this.cesium=t}getMapLayers(e){const t=typeof e=="object"?e?.modelId:e;return t?this.mapLayers[t]||{}:this.mapLayers}setModelId(e){this.modelId=e}getModelId(){return this.modelId}setDxfOpen(e){this.open=e}getDxfOpen(){return this.open}getDxfModelsList(){return this.gisCadModelsList}getDxfModels(e){const t=typeof e=="object"?e?.modelId:e;return t?this.gisCadModelsList.find(n=>n.modelId===t):this.gisCadModelsList}getDefaultCoordinateTransformConfig(){return{centralMeridian:117,latOrigin:0,scaleFactor:1,falseEasting:5e5,falseNorthing:0,ellipsoid:"GRS80"}}buildLongLatProj4Def(e){return`+proj=longlat +ellps=${e?.ellipsoid||this.getDefaultCoordinateTransformConfig().ellipsoid} +no_defs`}buildProjectedProj4Def(e){const t={...this.getDefaultCoordinateTransformConfig(),...e};return["+proj=tmerc",`+lat_0=${t.latOrigin}`,`+lon_0=${t.centralMeridian}`,`+k=${t.scaleFactor}`,`+x_0=${t.falseEasting}`,`+y_0=${t.falseNorthing}`,`+ellps=${t.ellipsoid||"GRS80"}`,"+units=m","+no_defs"].join(" ")}transformCoordinate(e){const t={...this.getDefaultCoordinateTransformConfig(),...e.config},n=this.buildLongLatProj4Def(t),s=this.buildProjectedProj4Def(t);if(e.direction==="lonlatToProjected"){const d=Number(e.longitude),h=Number(e.latitude);if([d,h].some(u=>Number.isNaN(u)))throw new Error("经纬度参数无效");const[f,m]=ms(n,s,[d,h]);return{direction:e.direction,x:f,y:m,config:t}}const o=Number(e.x),r=Number(e.y);if([o,r].some(d=>Number.isNaN(d)))throw new Error("投影坐标参数无效");const[l,c]=ms(s,n,[o,r]);return{direction:e.direction,longitude:l,latitude:c,config:t}}showJson({modelId:e,show:t}){const n=this.getRuntimeModel(e);n?.root&&(n.show=t,n.root.show=t),this.mapLayers[e]&&Object.values(this.mapLayers[e]).forEach(s=>{s.forEach(o=>{o.primitive&&(o.primitive.show=t)})})}showJsonByLayer({modelId:e,show:t,layers:n}){const s=this.mapLayers[e];!s||!Array.isArray(n)||n.forEach(o=>{const r=s[o];r&&r.forEach(l=>{l.primitive&&(l.primitive.show=t)})})}flyToCadModel(e={}){const t=e.modelId||this.modelId,n=this.gisCadModelsList.find(s=>s.modelId===t);n&&this.flyToBounds(n,{duration:e.duration})}flyToBounds(e,t){if(!e)return;const n=t?.duration??0,s=e?.bounds?.rectangleDegrees;if(s){const o=this.cesium.Rectangle.fromDegrees(s.west,s.south,s.east,s.north);this.viewer.camera.flyTo({destination:o,duration:n});return}e.root&&this.viewer.flyTo(e.root,{duration:n})}parseColor(e,t=1){const n=this.cesium.Color.WHITE.withAlpha(t);if(!e||typeof e!="string")return n;const s=e.trim(),o=[s];if(s.startsWith("#")){const r=s.slice(1).replace(/[^0-9a-fA-F]/g,"");[3,4,6,8].includes(r.length)&&o.push(`#${r}`)}for(const r of Array.from(new Set(o)))try{const l=this.cesium.Color.fromCssColorString(r);if(l)return l.withAlpha(t)}catch(l){console.warn("Failed to parse CAD color candidate:",r,l)}return console.warn("Failed to parse CAD color, fallback to white:",e),n}getLineWidth(e){return typeof e!="number"||Number.isNaN(e)?1:Math.max(1,Math.min(4,Math.round(e*4)))}uniqueKey(e){return e.map(t=>`${t??""}`).join("::")}normalizePoint(e){if(!Array.isArray(e)||e.length<2)return null;const t=Number(e[0]),n=Number(e[1]),s=Number(e[2]||0);return[t,n,s].some(o=>Number.isNaN(o))?null:[t,n,s]}mergeLayerItemsMap(e,t){Object.entries(t).forEach(([n,s])=>{e[n]||(e[n]=[]),e[n].push(...s)})}buildDefaultFormData(e,t){return{modelId:e.modelId,longitude:t.originLongitude,latitude:t.originLatitude,height:t.originHeight,scaleToMeter:t.scaleToMeter,scale:t.scale,localOriginX:t.localOriginX,localOriginY:t.localOriginY,totalRotation:e.totalRotation||0,distance:1e-6,heightDistance:1,rotation:1,scaleStep:.1,clampToGround:!1}}normalizeFormData(e,t,n=!1){const s=e.formData||{},o=this.buildDefaultFormData(e,t);return{...o,...s,modelId:e.modelId,longitude:Number(s.longitude??o.longitude),latitude:Number(s.latitude??o.latitude),height:Number(s.height??o.height),scaleToMeter:Number(s.scaleToMeter??o.scaleToMeter),scale:Math.max(1e-6,Number(s.scale??o.scale)),localOriginX:Number(s.localOriginX??o.localOriginX),localOriginY:Number(s.localOriginY??o.localOriginY),totalRotation:Number(s.totalRotation??o.totalRotation),distance:Number(s.distance??o.distance),heightDistance:Number(s.heightDistance??o.heightDistance),rotation:Number(s.rotation??o.rotation),scaleStep:Number(s.scaleStep??o.scaleStep),transformConfig:s.transformConfig,transformDirection:s.transformDirection,clampToGround:s.clampToGround??n}}removeModelNode(e,t){!e||!t||(e.remove(t),t.destroy&&!t.isDestroyed?.()&&t.destroy())}buildTransform(e,t){const n=this.cesium,s=t.formData||{};let o=s.longitude??t.deltaLongitude??e.longitude??e.result?.origin?.longitude??0,r=s.latitude??t.deltaLatitude??e.latitude??e.result?.origin?.latitude??0,l=s.height??0;const c=e.result?.extMin?.x??0,d=e.result?.extMin?.y??0,h=e.result?.realUnits??e.unit??1,f=Math.max(1e-6,Number(s.scale??1)),m=h*f;let u=null,g=null,A=null;if(s.transformConfig&&s.transformDirection==="projectedToLonlat"){const P=this.buildLongLatProj4Def(s.transformConfig),k=this.buildProjectedProj4Def(s.transformConfig);u=ms(k,P);try{const[M,B]=u.forward([c*h,d*h]);o=M,r=B,l=0,g=n.Cartesian3.fromDegrees(M,B,0);const _=n.Transforms.eastNorthUpToFixedFrame(g);A=n.Matrix4.inverseTransformation(_,new n.Matrix4)}catch(M){console.warn("Failed to calculate projection base",M),u=null}}const p=n.Cartesian3.fromDegrees(o,r,l),y=n.Transforms.eastNorthUpToFixedFrame(p),C=s.totalRotation??t.totalRotation??0;if(C){const P=n.Quaternion.fromAxisAngle(n.Cartesian3.UNIT_Z,n.Math.toRadians(C)),k=n.Matrix4.fromRotationTranslation(n.Matrix3.fromQuaternion(P),new n.Cartesian3(0,0,0));n.Matrix4.multiply(y,k,y)}return{originLongitude:o,originLatitude:r,originHeight:l,localOriginX:c,localOriginY:d,scaleToMeter:h,scale:f,totalScaleToMeter:m,toWorld:P=>{const k=this.normalizePoint(P);if(!k)return null;if(u&&g&&A)try{const B=k[0]*h,_=k[1]*h,[E,w]=u.forward([B,_]),D=n.Cartesian3.fromDegrees(E,w,k[2]*h),F=n.Matrix4.multiplyByPoint(A,D,new n.Cartesian3);return F.x*=f,F.y*=f,F.z*=f,n.Matrix4.multiplyByPoint(y,F,new n.Cartesian3)}catch{}const M=new n.Cartesian3((k[0]-c)*m,(k[1]-d)*m,k[2]*m);return n.Matrix4.multiplyByPoint(y,M,new n.Cartesian3)}}}createLinePrimitive(e,t){return e.length?t.clampToGround?new this.cesium.GroundPolylinePrimitive({geometryInstances:e,appearance:new this.cesium.PolylineColorAppearance,asynchronous:!0,allowPicking:!1}):new this.cesium.Primitive({geometryInstances:e,appearance:new this.cesium.PolylineColorAppearance,asynchronous:!0,allowPicking:!1}):null}createPolygonPrimitive(e,t){return e.length?t.clampToGround?new this.cesium.GroundPrimitive({geometryInstances:e,appearance:new this.cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,closed:!0}),asynchronous:!0,allowPicking:!1}):new this.cesium.Primitive({geometryInstances:e,appearance:new this.cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,closed:!0}),asynchronous:!0,allowPicking:!1}):null}createPointPrimitive(e){if(!e.length)return null;const t=new this.cesium.PointPrimitiveCollection;return e.forEach(n=>{t.add(n)}),t}buildModelPrimitives(e,t,n){const s=this.cesium,o=new s.PrimitiveCollection,r={},l={},c=this.buildTransform(t,e),d=new Map,h=new Map,f=new Map,m=Array.isArray(t.result?.lines)?t.result?.lines||[]:[],u=Array.isArray(t.result?.polygons)?t.result?.polygons||[]:[],g=Array.isArray(t.result?.points)?t.result?.points||[]:[];m.forEach(p=>{const C=(Array.isArray(p?.positions)?p.positions:[]).map(B=>c.toWorld(B)).filter(Boolean);if(C.length<2)return;const I=p.layer||"default",P=p.color||"#ffffff",k=this.uniqueKey([I,"line",this.getLineWidth(p.lineWeight)]),M=d.get(k)||[];M.push(new s.GeometryInstance({geometry:n.clampToGround?new s.GroundPolylineGeometry({positions:C,width:this.getLineWidth(p.lineWeight)}):new s.PolylineGeometry({positions:C,width:this.getLineWidth(p.lineWeight),vertexFormat:s.PolylineColorAppearance.VERTEX_FORMAT}),attributes:{color:s.ColorGeometryInstanceAttribute.fromColor(this.parseColor(P,1))},id:{modelId:e.modelId,layer:I,batchId:p.batchId,type:"line"}})),d.set(k,M)}),u.forEach(p=>{const C=(Array.isArray(p?.outerPositions)?p.outerPositions:[]).map(_=>c.toWorld(_)).filter(Boolean);if(C.length<3)return;const I=Array.isArray(p?.holes)?p.holes.map(_=>{const E=Array.isArray(_)?_.map(w=>c.toWorld(w)).filter(Boolean):[];return E.length<3?null:new s.PolygonHierarchy(E)}).filter(Boolean):[],P=p.layer||"default",k=p.color||"#ffffff",M=this.uniqueKey([P,"polygon"]),B=h.get(M)||[];B.push(new s.GeometryInstance({geometry:new s.PolygonGeometry({polygonHierarchy:new s.PolygonHierarchy(C,I),vertexFormat:s.PerInstanceColorAppearance.VERTEX_FORMAT}),attributes:{color:s.ColorGeometryInstanceAttribute.fromColor(this.parseColor(k,.45))},id:{modelId:e.modelId,layer:P,batchId:p.batchId,type:"polygon"}})),h.set(M,B)}),g.forEach(p=>{const y=p?.position||p?.positions?.[0]||p,C=c.toWorld(y);if(!C)return;const I=p.layer||"default",P=p.color||"#ffffff",k=this.uniqueKey([I,"point"]),M=f.get(k)||[];M.push({position:C,color:this.parseColor(P,1),pixelSize:Math.max(4,Number(p.pixelSize||6)),id:{modelId:e.modelId,layer:I,batchId:p.batchId,type:"point"}}),f.set(k,M)});const A=(p,y,C)=>{y&&(o.add(y),n.recordLayers!==!1&&(l[p]||(l[p]=[]),l[p].push({primitive:y,color:C.color,batchId:C.batchId,type:C.type})),r[p]||(r[p]={}),r[p][C.type]=y)};return d.forEach((p,y)=>{const[C="default"]=y.split("::");A(C,this.createLinePrimitive(p,n),{color:void 0,batchId:p[0]?.id?.batchId,type:"line"})}),h.forEach((p,y)=>{const[C="default"]=y.split("::");A(C,this.createPolygonPrimitive(p,n),{color:void 0,batchId:p[0]?.id?.batchId,type:"polygon"})}),f.forEach((p,y)=>{const[C="default"]=y.split("::");A(C,this.createPointPrimitive(p),{color:void 0,batchId:p[0]?.id?.batchId,type:"point"})}),{root:o,layerPrimitiveMap:r,layerItemsMap:l,transform:c}}buildModelRoot(e,t,n){const s=new this.cesium.PrimitiveCollection,o={};let r=null;return t.forEach(l=>{const c=this.buildModelPrimitives(e,l,n);r||(r=c),s.add(c.root),this.mergeLayerItemsMap(o,c.layerItemsMap)}),{root:s,transform:r.transform,layerItemsMap:o}}getRuntimeModel(e){const t=e||this.modelId;return this.gisCadModelsList.find(n=>n.modelId===t)||null}rebuildPreviewRoot(e){if(!e.editingFormData)return;e.previewRoot&&(this.removeModelNode(e.root,e.previewRoot),e.previewRoot=null);const t=this.buildModelRoot({...e,formData:e.editingFormData},e.sourceDataList,{clampToGround:e.editingFormData.clampToGround??!1,recordLayers:!1});e.previewRoot=t.root,e.root.add(e.previewRoot),e.groundRoot&&(e.groundRoot.show=!1)}replaceGroundRoot(e,t){t.clampToGround!==void 0&&(e.buildOptions.clampToGround=t.clampToGround);const n=this.buildModelRoot({...e,formData:t},e.sourceDataList,e.buildOptions);e.groundRoot&&this.removeModelNode(e.root,e.groundRoot),e.groundRoot=n.root,e.root.add(e.groundRoot),e.groundRoot.show=e.show!==!1,e.transform=n.transform,this.mapLayers[e.modelId]=n.layerItemsMap}async loadModelFile(e){try{if(!e||typeof e!="string")return!1;const t=await fetch(e,{cache:"no-store"});if(!t.ok)throw new Error(`HTTP ${t.status} for ${e}`);if(e.endsWith(".json")||t.headers.get("content-type")?.includes("application/json"))return await t.json();const n=await t.blob(),s=new Io(new Kn(n),{password:Il,useWebWorkers:!1}),r=(await s.getEntries()).find(d=>!d.directory&&d.filename.endsWith(".json"));if(!r)return await s.close(),!1;const l=await r.arrayBuffer({useWebWorkers:!1});await s.close();const c=new TextDecoder().decode(l);return JSON.parse(c.trim())}catch(t){return console.error("Failed to load GIS CAD source:",e,t),!1}}getCandidateUrls(e){const t=e.outPutPath.endsWith("/")?e.outPutPath:`${e.outPutPath}/`,n=[e.sourceUrl,`${t}${e.dbName}/${e.dbName}.zip`,`${t}${e.dbName}/${e.dbName}.json`,`${t}cad/0.json`].filter(Boolean);return Array.from(new Set(n))}getChunkCandidateUrls(e,t,n){const s=e.outPutPath.endsWith("/")?e.outPutPath:`${e.outPutPath}/`,o=[`${s}${e.dbName}/${e.dbName}_${n}.zip`,`${s}${e.dbName}/${e.dbName}${n}.zip`,`${s}${e.dbName}/${e.dbName}_${n}.json`,`${s}${e.dbName}/${e.dbName}${n}.json`,`${s}cad/${e.dbName}_${n}.zip`,`${s}cad/${e.dbName}${n}.zip`,`${s}cad/${e.dbName}_${n}.json`,`${s}cad/${e.dbName}${n}.json`];try{const r=new URL(t),l=r.pathname,c=l.lastIndexOf("/"),d=c>=0?l.slice(0,c+1):"/",h=l.lastIndexOf("."),f=h>=0?l.slice(h):".zip",m=c>=0?l.slice(c+1,h>=0?h:void 0):l.slice(0,h>=0?h:void 0),u=m===e.dbName?e.dbName:m;o.unshift(`${r.origin}${d}${u}_${n}${f}`,`${r.origin}${d}${u}${n}${f}`)}catch(r){console.warn("Failed to resolve chunk urls from primary source:",t,r)}return Array.from(new Set(o))}async loadSourceData(e){const t=this.getCandidateUrls(e);for(const n of t){const s=await this.loadModelFile(n);if(s)return{url:n,data:s}}return{url:t[0]||"",data:!1}}async loadSourceDataList(e){const t=await this.loadSourceData(e);if(!t.data)return{url:t.url,dataList:[]};const n=t.data,s=[n],o=Math.max(1,Number(n.numbersOfFile||1)),r=t.url||"";for(let l=1;l<o;l++){const c=this.getChunkCandidateUrls(e,r,l);let d=!1;for(const h of c){const f=await this.loadModelFile(h);if(f){s.push(f),d=!0;break}}d||console.warn(`Failed to load GIS CAD chunk ${l} for ${e.modelId}`)}return{url:r,dataList:s}}async addGISCadModel({fileNames:e,options:t}){if(!e?.length)return;const n={...this.options,...t},s={clampToGround:n.clampToGround??n.mode!=="2d"};for(const o of e){if(this.gisCadModelsList.find(f=>f.modelId===o.modelId))continue;const l=await this.loadSourceDataList(o);if(!l.dataList.length){console.error("Failed to resolve GIS CAD source for model:",o);continue}/^https?:\/\//i.test(o.outPutPath)||(o.outPutPath=`${window.location.origin}${o.outPutPath}`);const d=`${o.outPutPath.endsWith("/")?o.outPutPath:`${o.outPutPath}/`}${o.dbName}/region.zip`,h=await this.loadModelFile(d);h&&typeof h=="object"&&h.centralMeridian!==void 0&&(o.formData={...o.formData||{},transformConfig:h,transformDirection:"projectedToLonlat"});try{const f=l.dataList[0],m=this.buildTransform(f,o),u=this.normalizeFormData(o,m,s.clampToGround),g=this.buildModelRoot({...o,formData:u},l.dataList,s),A=new this.cesium.PrimitiveCollection;A.add(g.root);const p=f.bounds||null,y={...o,type:"gis-cad",sourceUrl:l.url,sourceData:f,sourceDataList:l.dataList,root:A,groundRoot:g.root,previewRoot:null,bounds:p,transform:g.transform,show:!0,formData:u,editingFormData:null,isEditing:!1,buildOptions:s};this.mapLayers[o.modelId]=g.layerItemsMap,this.viewer.scene.primitives.add(y.root),this.gisCadModelsList.push(y),this.setModelId(o.modelId),n.flyTo&&this.flyToBounds(y),n.onSuccess&&n.onSuccess(y)}catch(f){console.error("Failed to build GIS CAD model:",o,f)}}this.events.emit("mountAllGISCad",this.gisCadModelsList)}beginEditGISCad({modelId:e}){const t=this.getRuntimeModel(e);return t?(t.isEditing||(t.isEditing=!0,t.editingFormData={...t.formData},this.rebuildPreviewRoot(t)),t):null}adjustGISCadModel(e){const t=this.getRuntimeModel(e.modelId);return t?(t.isEditing||this.beginEditGISCad({modelId:e.modelId}),t.editingFormData={...t.editingFormData||t.formData,...e,modelId:t.modelId,scale:Math.max(1e-6,Number(e.scale??t.editingFormData?.scale??t.formData.scale))},e.clampToGround!==void 0&&(t.buildOptions.clampToGround=e.clampToGround),this.rebuildPreviewRoot(t),t.editingFormData):null}commitEditGISCad({modelId:e}){const t=this.getRuntimeModel(e);return!t||!t.isEditing||!t.editingFormData||(t.formData={...t.editingFormData},this.replaceGroundRoot(t,t.formData),t.previewRoot&&(this.removeModelNode(t.root,t.previewRoot),t.previewRoot=null),t.isEditing=!1,t.editingFormData=null),t}cancelEditGISCad({modelId:e}){const t=this.getRuntimeModel(e);return t?(t.previewRoot&&(this.removeModelNode(t.root,t.previewRoot),t.previewRoot=null),t.groundRoot&&(t.groundRoot.show=t.show!==!1),t.isEditing=!1,t.editingFormData=null,t):null}deleteCad({modelId:e}){this.mapLayers[e]&&delete this.mapLayers[e];const t=this.gisCadModelsList.findIndex(n=>n.modelId===e);if(t>-1){const n=this.gisCadModelsList[t];this.viewer.scene.primitives.remove(n.root),n.root?.destroy&&!n.root.isDestroyed?.()&&n.root.destroy(),this.gisCadModelsList.splice(t,1)}}deleteAllCad(){[...this.gisCadModelsList].forEach(e=>{e.modelId&&this.deleteCad({modelId:e.modelId})})}}class Gt{constructor(e,t){if(this.viewer=e,!this.viewer)return;this.type="prompt",t=t||{};const n=t.type==null?1:t.type;let s={id:new Date().getTime()+""+Math.floor(Math.random()*1e4),type:n,anchor:n==2,closeBtn:n==2,offset:n==2?{x:0,y:-20}:{x:10,y:10},content:"",show:!0,style:{background:"rgba(0,0,0,0.5)",color:"white"}};this.opt=Object.assign(s,t),this.attr=this.opt;const o=this.viewer.container.id;this.isShow=this.opt.show==null?!0:this.opt.show;let r="",l="";const c=this.opt.style.background,d=this.opt.style.color;this.opt.anchor&&(r+=`
|
|
17
17
|
<div class="prompt-anchor-container">
|
|
18
18
|
<div class="prompt-anchor" style="background:${c} !important;">
|
|
19
19
|
</div>
|