acmi-parser 1.0.0

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.
@@ -0,0 +1,45 @@
1
+ "use strict";var Ki=Object.create;var Mn=Object.defineProperty;var er=Object.getOwnPropertyDescriptor;var tr=Object.getOwnPropertyNames;var nr=Object.getPrototypeOf,or=Object.prototype.hasOwnProperty;var ir=(e,t,n)=>t in e?Mn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var rr=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of tr(t))!or.call(e,i)&&i!==n&&Mn(e,i,{get:()=>t[i],enumerable:!(o=er(t,i))||o.enumerable});return e};var Vt=(e,t,n)=>(n=e!=null?Ki(nr(e)):{},rr(t||!e||!e.__esModule?Mn(n,"default",{value:e,enumerable:!0}):n,e));var Z=(e,t,n)=>(ir(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var Gt=typeof document<"u"?document.currentScript:null,We=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Et(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function sr(e,t,n,o,i){for(var s=i+1;o<=i;){var r=o+i>>>1,c=e[r],u=n!==void 0?n(c,t):c-t;u>=0?(s=r,i=r-1):o=r+1}return s}function cr(e,t,n,o,i){for(var s=i+1;o<=i;){var r=o+i>>>1,c=e[r],u=n!==void 0?n(c,t):c-t;u>0?(s=r,i=r-1):o=r+1}return s}function ar(e,t,n,o,i){for(var s=o-1;o<=i;){var r=o+i>>>1,c=e[r],u=n!==void 0?n(c,t):c-t;u<0?(s=r,o=r+1):i=r-1}return s}function fr(e,t,n,o,i){for(var s=o-1;o<=i;){var r=o+i>>>1,c=e[r],u=n!==void 0?n(c,t):c-t;u<=0?(s=r,o=r+1):i=r-1}return s}function ur(e,t,n,o,i){for(;o<=i;){var s=o+i>>>1,r=e[s],c=n!==void 0?n(r,t):r-t;if(c===0)return s;c<=0?o=s+1:i=s-1}return-1}function At(e,t,n,o,i,s){return typeof n=="function"?s(e,t,n,o===void 0?0:o|0,i===void 0?e.length-1:i|0):s(e,t,void 0,n===void 0?0:n|0,o===void 0?e.length-1:o|0)}var hr={ge:function(e,t,n,o,i){return At(e,t,n,o,i,sr)},gt:function(e,t,n,o,i){return At(e,t,n,o,i,cr)},lt:function(e,t,n,o,i){return At(e,t,n,o,i,ar)},le:function(e,t,n,o,i){return At(e,t,n,o,i,fr)},eq:function(e,t,n,o,i){return At(e,t,n,o,i,ur)}};const dr=Et(hr);function d(e){return e!=null}function E(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}d(Object.create)&&(E.prototype=Object.create(Error.prototype),E.prototype.constructor=E);E.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return d(this.stack)&&(e+=`
2
+ ${this.stack.toString()}`),e};E.throwInstantiationError=function(){throw new E("This function defines an interface and should not be called directly.")};const f={};f.typeOf={};function pr(e){return`${e} is required, actual value was undefined`}function Tt(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}f.defined=function(e,t){if(!d(t))throw new E(pr(e))};f.typeOf.func=function(e,t){if(typeof t!="function")throw new E(Tt(typeof t,"function",e))};f.typeOf.string=function(e,t){if(typeof t!="string")throw new E(Tt(typeof t,"string",e))};f.typeOf.number=function(e,t){if(typeof t!="number")throw new E(Tt(typeof t,"number",e))};f.typeOf.number.lessThan=function(e,t,n){if(f.typeOf.number(e,t),t>=n)throw new E(`Expected ${e} to be less than ${n}, actual value was ${t}`)};f.typeOf.number.lessThanOrEquals=function(e,t,n){if(f.typeOf.number(e,t),t>n)throw new E(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};f.typeOf.number.greaterThan=function(e,t,n){if(f.typeOf.number(e,t),t<=n)throw new E(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};f.typeOf.number.greaterThanOrEquals=function(e,t,n){if(f.typeOf.number(e,t),t<n)throw new E(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};f.typeOf.object=function(e,t){if(typeof t!="object")throw new E(Tt(typeof t,"object",e))};f.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new E(Tt(typeof t,"boolean",e))};f.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new E(Tt(typeof t,"bigint",e))};f.typeOf.number.equals=function(e,t,n,o){if(f.typeOf.number(e,n),f.typeOf.number(t,o),n!==o)throw new E(`${e} must be equal to ${t}, the actual values are ${n} and ${o}`)};function j(e,t){return e??t}j.EMPTY_OBJECT=Object.freeze({});var Qe=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};Qe.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};Qe.prototype.init_by_array=function(e,t){var n,o,i;for(this.init_seed(19650218),n=1,o=0,i=this.N>t?this.N:t;i;i--){var s=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((s&4294901760)>>>16)*1664525<<16)+(s&65535)*1664525)+e[o]+o,this.mt[n]>>>=0,n++,o++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),o>=t&&(o=0)}for(i=this.N-1;i;i--){var s=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((s&4294901760)>>>16)*1566083941<<16)+(s&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};Qe.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[e&1];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0};Qe.prototype.random_int31=function(){return this.random_int()>>>1};Qe.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};Qe.prototype.random=function(){return this.random_int()*(1/4294967296)};Qe.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};Qe.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};var lr=Qe;const oi=Et(lr),S={};S.EPSILON1=.1;S.EPSILON2=.01;S.EPSILON3=.001;S.EPSILON4=1e-4;S.EPSILON5=1e-5;S.EPSILON6=1e-6;S.EPSILON7=1e-7;S.EPSILON8=1e-8;S.EPSILON9=1e-9;S.EPSILON10=1e-10;S.EPSILON11=1e-11;S.EPSILON12=1e-12;S.EPSILON13=1e-13;S.EPSILON14=1e-14;S.EPSILON15=1e-15;S.EPSILON16=1e-16;S.EPSILON17=1e-17;S.EPSILON18=1e-18;S.EPSILON19=1e-19;S.EPSILON20=1e-20;S.EPSILON21=1e-21;S.GRAVITATIONALPARAMETER=3986004418e5;S.SOLAR_RADIUS=6955e5;S.LUNAR_RADIUS=1737400;S.SIXTY_FOUR_KILOBYTES=64*1024;S.FOUR_GIGABYTES=4*1024*1024*1024;S.sign=j(Math.sign,function(t){return t=+t,t===0||t!==t?t:t>0?1:-1});S.signNotZero=function(e){return e<0?-1:1};S.toSNorm=function(e,t){return t=j(t,255),Math.round((S.clamp(e,-1,1)*.5+.5)*t)};S.fromSNorm=function(e,t){return t=j(t,255),S.clamp(e,0,t)/t*2-1};S.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:S.clamp((e-t)/n,0,1)};S.sinh=j(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2});S.cosh=j(Math.cosh,function(t){return(Math.exp(t)+Math.exp(-t))/2});S.lerp=function(e,t,n){return(1-n)*e+n*t};S.PI=Math.PI;S.ONE_OVER_PI=1/Math.PI;S.PI_OVER_TWO=Math.PI/2;S.PI_OVER_THREE=Math.PI/3;S.PI_OVER_FOUR=Math.PI/4;S.PI_OVER_SIX=Math.PI/6;S.THREE_PI_OVER_TWO=3*Math.PI/2;S.TWO_PI=2*Math.PI;S.ONE_OVER_TWO_PI=1/(2*Math.PI);S.RADIANS_PER_DEGREE=Math.PI/180;S.DEGREES_PER_RADIAN=180/Math.PI;S.RADIANS_PER_ARCSECOND=S.RADIANS_PER_DEGREE/3600;S.toRadians=function(e){if(!d(e))throw new E("degrees is required.");return e*S.RADIANS_PER_DEGREE};S.toDegrees=function(e){if(!d(e))throw new E("radians is required.");return e*S.DEGREES_PER_RADIAN};S.convertLongitudeRange=function(e){if(!d(e))throw new E("angle is required.");const t=S.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};S.clampToLatitudeRange=function(e){if(!d(e))throw new E("angle is required.");return S.clamp(e,-1*S.PI_OVER_TWO,S.PI_OVER_TWO)};S.negativePiToPi=function(e){if(!d(e))throw new E("angle is required.");return e>=-S.PI&&e<=S.PI?e:S.zeroToTwoPi(e+S.PI)-S.PI};S.zeroToTwoPi=function(e){if(!d(e))throw new E("angle is required.");if(e>=0&&e<=S.TWO_PI)return e;const t=S.mod(e,S.TWO_PI);return Math.abs(t)<S.EPSILON14&&Math.abs(e)>S.EPSILON14?S.TWO_PI:t};S.mod=function(e,t){if(!d(e))throw new E("m is required.");if(!d(t))throw new E("n is required.");if(t===0)throw new E("divisor cannot be 0.");return S.sign(e)===S.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};S.equalsEpsilon=function(e,t,n,o){if(!d(e))throw new E("left is required.");if(!d(t))throw new E("right is required.");n=j(n,0),o=j(o,n);const i=Math.abs(e-t);return i<=o||i<=n*Math.max(Math.abs(e),Math.abs(t))};S.lessThan=function(e,t,n){if(!d(e))throw new E("first is required.");if(!d(t))throw new E("second is required.");if(!d(n))throw new E("absoluteEpsilon is required.");return e-t<-n};S.lessThanOrEquals=function(e,t,n){if(!d(e))throw new E("first is required.");if(!d(t))throw new E("second is required.");if(!d(n))throw new E("absoluteEpsilon is required.");return e-t<n};S.greaterThan=function(e,t,n){if(!d(e))throw new E("first is required.");if(!d(t))throw new E("second is required.");if(!d(n))throw new E("absoluteEpsilon is required.");return e-t>n};S.greaterThanOrEquals=function(e,t,n){if(!d(e))throw new E("first is required.");if(!d(t))throw new E("second is required.");if(!d(n))throw new E("absoluteEpsilon is required.");return e-t>-n};const Zt=[1];S.factorial=function(e){if(typeof e!="number"||e<0)throw new E("A number greater than or equal to 0 is required.");const t=Zt.length;if(e>=t){let n=Zt[t-1];for(let o=t;o<=e;o++){const i=n*o;Zt.push(i),n=i}}return Zt[e]};S.incrementWrap=function(e,t,n){if(n=j(n,0),!d(e))throw new E("n is required.");if(t<=n)throw new E("maximumValue must be greater than minimumValue.");return++e,e>t&&(e=n),e};S.isPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>4294967295)throw new E("A number between 0 and (2^32)-1 is required.");return e!==0&&(e&e-1)===0};S.nextPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>2147483648)throw new E("A number between 0 and 2^31 is required.");return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};S.previousPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>4294967295)throw new E("A number between 0 and (2^32)-1 is required.");return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};S.clamp=function(e,t,n){return f.typeOf.number("value",e),f.typeOf.number("min",t),f.typeOf.number("max",n),e<t?t:e>n?n:e};let ii=new oi;S.setRandomNumberSeed=function(e){if(!d(e))throw new E("seed is required.");ii=new oi(e)};S.nextRandomNumber=function(){return ii.random()};S.randomBetween=function(e,t){return S.nextRandomNumber()*(t-e)+e};S.acosClamped=function(e){if(!d(e))throw new E("value is required.");return Math.acos(S.clamp(e,-1,1))};S.asinClamped=function(e){if(!d(e))throw new E("value is required.");return Math.asin(S.clamp(e,-1,1))};S.chordLength=function(e,t){if(!d(e))throw new E("angle is required.");if(!d(t))throw new E("radius is required.");return 2*t*Math.sin(e*.5)};S.logBase=function(e,t){if(!d(e))throw new E("number is required.");if(!d(t))throw new E("base is required.");return Math.log(e)/Math.log(t)};S.cbrt=j(Math.cbrt,function(t){const n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n});S.log2=j(Math.log2,function(t){return Math.log(t)*Math.LOG2E});S.fog=function(e,t){const n=e*t;return 1-Math.exp(-(n*n))};S.fastApproximateAtan=function(e){return f.typeOf.number("x",e),e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};S.fastApproximateAtan2=function(e,t){f.typeOf.number("x",e),f.typeOf.number("y",t);let n,o=Math.abs(e);n=Math.abs(t);const i=Math.max(o,n);n=Math.min(o,n);const s=n/i;if(isNaN(s))throw new E("either x or y must be nonzero");return o=S.fastApproximateAtan(s),o=Math.abs(t)>Math.abs(e)?S.PI_OVER_TWO-o:o,o=e<0?S.PI-o:o,o=t<0?-o:o,o};function p(e,t,n){this.x=j(e,0),this.y=j(t,0),this.z=j(n,0)}p.fromSpherical=function(e,t){f.typeOf.object("spherical",e),d(t)||(t=new p);const n=e.clock,o=e.cone,i=j(e.magnitude,1),s=i*Math.sin(o);return t.x=s*Math.cos(n),t.y=s*Math.sin(n),t.z=i*Math.cos(o),t};p.fromElements=function(e,t,n,o){return d(o)?(o.x=e,o.y=t,o.z=n,o):new p(e,t,n)};p.clone=function(e,t){if(d(e))return d(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new p(e.x,e.y,e.z)};p.fromCartesian4=p.clone;p.packedLength=3;p.pack=function(e,t,n){return f.typeOf.object("value",e),f.defined("array",t),n=j(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};p.unpack=function(e,t,n){return f.defined("array",e),t=j(t,0),d(n)||(n=new p),n.x=e[t++],n.y=e[t++],n.z=e[t],n};p.packArray=function(e,t){f.defined("array",e);const n=e.length,o=n*3;if(!d(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new E("If result is a typed array, it must have exactly array.length * 3 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)p.pack(e[i],t,i*3);return t};p.unpackArray=function(e,t){if(f.defined("array",e),f.typeOf.number.greaterThanOrEquals("array.length",e.length,3),e.length%3!==0)throw new E("array length must be a multiple of 3.");const n=e.length;d(t)?t.length=n/3:t=new Array(n/3);for(let o=0;o<n;o+=3){const i=o/3;t[i]=p.unpack(e,o,t[i])}return t};p.fromArray=p.unpack;p.maximumComponent=function(e){return f.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z)};p.minimumComponent=function(e){return f.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z)};p.minimumByComponent=function(e,t,n){return f.typeOf.object("first",e),f.typeOf.object("second",t),f.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n};p.maximumByComponent=function(e,t,n){return f.typeOf.object("first",e),f.typeOf.object("second",t),f.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n};p.clamp=function(e,t,n,o){f.typeOf.object("value",e),f.typeOf.object("min",t),f.typeOf.object("max",n),f.typeOf.object("result",o);const i=S.clamp(e.x,t.x,n.x),s=S.clamp(e.y,t.y,n.y),r=S.clamp(e.z,t.z,n.z);return o.x=i,o.y=s,o.z=r,o};p.magnitudeSquared=function(e){return f.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z};p.magnitude=function(e){return Math.sqrt(p.magnitudeSquared(e))};const yn=new p;p.distance=function(e,t){return f.typeOf.object("left",e),f.typeOf.object("right",t),p.subtract(e,t,yn),p.magnitude(yn)};p.distanceSquared=function(e,t){return f.typeOf.object("left",e),f.typeOf.object("right",t),p.subtract(e,t,yn),p.magnitudeSquared(yn)};p.normalize=function(e,t){f.typeOf.object("cartesian",e),f.typeOf.object("result",t);const n=p.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new E("normalized result is not a number");return t};p.dot=function(e,t){return f.typeOf.object("left",e),f.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z};p.multiplyComponents=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n};p.divideComponents=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n};p.add=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n};p.subtract=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n};p.multiplyByScalar=function(e,t,n){return f.typeOf.object("cartesian",e),f.typeOf.number("scalar",t),f.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n};p.divideByScalar=function(e,t,n){return f.typeOf.object("cartesian",e),f.typeOf.number("scalar",t),f.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n};p.negate=function(e,t){return f.typeOf.object("cartesian",e),f.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t};p.abs=function(e,t){return f.typeOf.object("cartesian",e),f.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};const _o=new p;p.lerp=function(e,t,n,o){return f.typeOf.object("start",e),f.typeOf.object("end",t),f.typeOf.number("t",n),f.typeOf.object("result",o),p.multiplyByScalar(t,n,_o),o=p.multiplyByScalar(e,1-n,o),p.add(_o,o,o)};const Xt=new p,zn=new p;p.angleBetween=function(e,t){f.typeOf.object("left",e),f.typeOf.object("right",t),p.normalize(e,Xt),p.normalize(t,zn);const n=p.dot(Xt,zn),o=p.magnitude(p.cross(Xt,zn,Xt));return Math.atan2(o,n)};const mr=new p;p.mostOrthogonalAxis=function(e,t){f.typeOf.object("cartesian",e),f.typeOf.object("result",t);const n=p.normalize(e,mr);return p.abs(n,n),n.x<=n.y?n.x<=n.z?t=p.clone(p.UNIT_X,t):t=p.clone(p.UNIT_Z,t):n.y<=n.z?t=p.clone(p.UNIT_Y,t):t=p.clone(p.UNIT_Z,t),t};p.projectVector=function(e,t,n){f.defined("a",e),f.defined("b",t),f.defined("result",n);const o=p.dot(e,t)/p.dot(t,t);return p.multiplyByScalar(t,o,n)};p.equals=function(e,t){return e===t||d(e)&&d(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z};p.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]};p.equalsEpsilon=function(e,t,n,o){return e===t||d(e)&&d(t)&&S.equalsEpsilon(e.x,t.x,n,o)&&S.equalsEpsilon(e.y,t.y,n,o)&&S.equalsEpsilon(e.z,t.z,n,o)};p.cross=function(e,t,n){f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n);const o=e.x,i=e.y,s=e.z,r=t.x,c=t.y,u=t.z,y=i*u-s*c,m=s*r-o*u,w=o*c-i*r;return n.x=y,n.y=m,n.z=w,n};p.midpoint=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=(e.x+t.x)*.5,n.y=(e.y+t.y)*.5,n.z=(e.z+t.z)*.5,n};p.fromDegrees=function(e,t,n,o,i){return f.typeOf.number("longitude",e),f.typeOf.number("latitude",t),e=S.toRadians(e),t=S.toRadians(t),p.fromRadians(e,t,n,o,i)};let qe=new p,ut=new p;const yr=new p(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);p.fromRadians=function(e,t,n,o,i){f.typeOf.number("longitude",e),f.typeOf.number("latitude",t),n=j(n,0);const s=d(o)?o.radiiSquared:yr,r=Math.cos(t);qe.x=r*Math.cos(e),qe.y=r*Math.sin(e),qe.z=Math.sin(t),qe=p.normalize(qe,qe),p.multiplyComponents(s,qe,ut);const c=Math.sqrt(p.dot(qe,ut));return ut=p.divideByScalar(ut,c,ut),qe=p.multiplyByScalar(qe,n,qe),d(i)||(i=new p),p.add(ut,qe,i)};p.fromDegreesArray=function(e,t,n){if(f.defined("coordinates",e),e.length<2||e.length%2!==0)throw new E("the number of coordinates must be a multiple of 2 and at least 2");const o=e.length;d(n)?n.length=o/2:n=new Array(o/2);for(let i=0;i<o;i+=2){const s=e[i],r=e[i+1],c=i/2;n[c]=p.fromDegrees(s,r,0,t,n[c])}return n};p.fromRadiansArray=function(e,t,n){if(f.defined("coordinates",e),e.length<2||e.length%2!==0)throw new E("the number of coordinates must be a multiple of 2 and at least 2");const o=e.length;d(n)?n.length=o/2:n=new Array(o/2);for(let i=0;i<o;i+=2){const s=e[i],r=e[i+1],c=i/2;n[c]=p.fromRadians(s,r,0,t,n[c])}return n};p.fromDegreesArrayHeights=function(e,t,n){if(f.defined("coordinates",e),e.length<3||e.length%3!==0)throw new E("the number of coordinates must be a multiple of 3 and at least 3");const o=e.length;d(n)?n.length=o/3:n=new Array(o/3);for(let i=0;i<o;i+=3){const s=e[i],r=e[i+1],c=e[i+2],u=i/3;n[u]=p.fromDegrees(s,r,c,t,n[u])}return n};p.fromRadiansArrayHeights=function(e,t,n){if(f.defined("coordinates",e),e.length<3||e.length%3!==0)throw new E("the number of coordinates must be a multiple of 3 and at least 3");const o=e.length;d(n)?n.length=o/3:n=new Array(o/3);for(let i=0;i<o;i+=3){const s=e[i],r=e[i+1],c=e[i+2],u=i/3;n[u]=p.fromRadians(s,r,c,t,n[u])}return n};p.ZERO=Object.freeze(new p(0,0,0));p.ONE=Object.freeze(new p(1,1,1));p.UNIT_X=Object.freeze(new p(1,0,0));p.UNIT_Y=Object.freeze(new p(0,1,0));p.UNIT_Z=Object.freeze(new p(0,0,1));p.prototype.clone=function(e){return p.clone(this,e)};p.prototype.equals=function(e){return p.equals(this,e)};p.prototype.equalsEpsilon=function(e,t,n){return p.equalsEpsilon(this,e,t,n)};p.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};const wr=new p,gr=new p;function ri(e,t,n,o,i){if(!d(e))throw new E("cartesian is required.");if(!d(t))throw new E("oneOverRadii is required.");if(!d(n))throw new E("oneOverRadiiSquared is required.");if(!d(o))throw new E("centerToleranceSquared is required.");const s=e.x,r=e.y,c=e.z,u=t.x,y=t.y,m=t.z,w=s*s*u*u,b=r*r*y*y,O=c*c*m*m,R=w+b+O,T=Math.sqrt(1/R),z=p.multiplyByScalar(e,T,wr);if(R<o)return isFinite(T)?p.clone(z,i):void 0;const D=n.x,q=n.y,x=n.z,Y=gr;Y.x=z.x*D*2,Y.y=z.y*q*2,Y.z=z.z*x*2;let N=(1-T)*p.magnitude(e)/(.5*p.magnitude(Y)),H=0,B,U,G,V,k,J,a,h,l,g,_;do{N-=H,G=1/(1+N*D),V=1/(1+N*q),k=1/(1+N*x),J=G*G,a=V*V,h=k*k,l=J*G,g=a*V,_=h*k,B=w*J+b*a+O*h-1,U=w*l*D+b*g*q+O*_*x;const v=-2*U;H=B/v}while(Math.abs(B)>S.EPSILON12);return d(i)?(i.x=s*G,i.y=r*V,i.z=c*k,i):new p(s*G,r*V,c*k)}function le(e,t,n){this.longitude=j(e,0),this.latitude=j(t,0),this.height=j(n,0)}le.fromRadians=function(e,t,n,o){return f.typeOf.number("longitude",e),f.typeOf.number("latitude",t),n=j(n,0),d(o)?(o.longitude=e,o.latitude=t,o.height=n,o):new le(e,t,n)};le.fromDegrees=function(e,t,n,o){return f.typeOf.number("longitude",e),f.typeOf.number("latitude",t),e=S.toRadians(e),t=S.toRadians(t),le.fromRadians(e,t,n,o)};const br=new p,Or=new p,_r=new p,Sr=new p(1/6378137,1/6378137,1/6356752314245179e-9),vr=new p(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9)),Er=S.EPSILON1;le.fromCartesian=function(e,t,n){const o=d(t)?t.oneOverRadii:Sr,i=d(t)?t.oneOverRadiiSquared:vr,s=d(t)?t._centerToleranceSquared:Er,r=ri(e,o,i,s,Or);if(!d(r))return;let c=p.multiplyComponents(r,i,br);c=p.normalize(c,c);const u=p.subtract(e,r,_r),y=Math.atan2(c.y,c.x),m=Math.asin(c.z),w=S.sign(p.dot(u,e))*p.magnitude(u);return d(n)?(n.longitude=y,n.latitude=m,n.height=w,n):new le(y,m,w)};le.toCartesian=function(e,t,n){return f.defined("cartographic",e),p.fromRadians(e.longitude,e.latitude,e.height,t,n)};le.clone=function(e,t){if(d(e))return d(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new le(e.longitude,e.latitude,e.height)};le.equals=function(e,t){return e===t||d(e)&&d(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};le.equalsEpsilon=function(e,t,n){return n=j(n,0),e===t||d(e)&&d(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n};le.ZERO=Object.freeze(new le(0,0,0));le.prototype.clone=function(e){return le.clone(this,e)};le.prototype.equals=function(e){return le.equals(this,e)};le.prototype.equalsEpsilon=function(e,t){return le.equalsEpsilon(this,e,t)};le.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};function Q(e,t){this.x=j(e,0),this.y=j(t,0)}Q.fromElements=function(e,t,n){return d(n)?(n.x=e,n.y=t,n):new Q(e,t)};Q.clone=function(e,t){if(d(e))return d(t)?(t.x=e.x,t.y=e.y,t):new Q(e.x,e.y)};Q.fromCartesian3=Q.clone;Q.fromCartesian4=Q.clone;Q.packedLength=2;Q.pack=function(e,t,n){return f.typeOf.object("value",e),f.defined("array",t),n=j(n,0),t[n++]=e.x,t[n]=e.y,t};Q.unpack=function(e,t,n){return f.defined("array",e),t=j(t,0),d(n)||(n=new Q),n.x=e[t++],n.y=e[t],n};Q.packArray=function(e,t){f.defined("array",e);const n=e.length,o=n*2;if(!d(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new E("If result is a typed array, it must have exactly array.length * 2 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)Q.pack(e[i],t,i*2);return t};Q.unpackArray=function(e,t){if(f.defined("array",e),f.typeOf.number.greaterThanOrEquals("array.length",e.length,2),e.length%2!==0)throw new E("array length must be a multiple of 2.");const n=e.length;d(t)?t.length=n/2:t=new Array(n/2);for(let o=0;o<n;o+=2){const i=o/2;t[i]=Q.unpack(e,o,t[i])}return t};Q.fromArray=Q.unpack;Q.maximumComponent=function(e){return f.typeOf.object("cartesian",e),Math.max(e.x,e.y)};Q.minimumComponent=function(e){return f.typeOf.object("cartesian",e),Math.min(e.x,e.y)};Q.minimumByComponent=function(e,t,n){return f.typeOf.object("first",e),f.typeOf.object("second",t),f.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n};Q.maximumByComponent=function(e,t,n){return f.typeOf.object("first",e),f.typeOf.object("second",t),f.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n};Q.clamp=function(e,t,n,o){f.typeOf.object("value",e),f.typeOf.object("min",t),f.typeOf.object("max",n),f.typeOf.object("result",o);const i=S.clamp(e.x,t.x,n.x),s=S.clamp(e.y,t.y,n.y);return o.x=i,o.y=s,o};Q.magnitudeSquared=function(e){return f.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y};Q.magnitude=function(e){return Math.sqrt(Q.magnitudeSquared(e))};const wn=new Q;Q.distance=function(e,t){return f.typeOf.object("left",e),f.typeOf.object("right",t),Q.subtract(e,t,wn),Q.magnitude(wn)};Q.distanceSquared=function(e,t){return f.typeOf.object("left",e),f.typeOf.object("right",t),Q.subtract(e,t,wn),Q.magnitudeSquared(wn)};Q.normalize=function(e,t){f.typeOf.object("cartesian",e),f.typeOf.object("result",t);const n=Q.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,isNaN(t.x)||isNaN(t.y))throw new E("normalized result is not a number");return t};Q.dot=function(e,t){return f.typeOf.object("left",e),f.typeOf.object("right",t),e.x*t.x+e.y*t.y};Q.cross=function(e,t){return f.typeOf.object("left",e),f.typeOf.object("right",t),e.x*t.y-e.y*t.x};Q.multiplyComponents=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n};Q.divideComponents=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n};Q.add=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n};Q.subtract=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n};Q.multiplyByScalar=function(e,t,n){return f.typeOf.object("cartesian",e),f.typeOf.number("scalar",t),f.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n};Q.divideByScalar=function(e,t,n){return f.typeOf.object("cartesian",e),f.typeOf.number("scalar",t),f.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n};Q.negate=function(e,t){return f.typeOf.object("cartesian",e),f.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t};Q.abs=function(e,t){return f.typeOf.object("cartesian",e),f.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};const So=new Q;Q.lerp=function(e,t,n,o){return f.typeOf.object("start",e),f.typeOf.object("end",t),f.typeOf.number("t",n),f.typeOf.object("result",o),Q.multiplyByScalar(t,n,So),o=Q.multiplyByScalar(e,1-n,o),Q.add(So,o,o)};const vo=new Q,Eo=new Q;Q.angleBetween=function(e,t){return f.typeOf.object("left",e),f.typeOf.object("right",t),Q.normalize(e,vo),Q.normalize(t,Eo),S.acosClamped(Q.dot(vo,Eo))};const Tr=new Q;Q.mostOrthogonalAxis=function(e,t){f.typeOf.object("cartesian",e),f.typeOf.object("result",t);const n=Q.normalize(e,Tr);return Q.abs(n,n),n.x<=n.y?t=Q.clone(Q.UNIT_X,t):t=Q.clone(Q.UNIT_Y,t),t};Q.equals=function(e,t){return e===t||d(e)&&d(t)&&e.x===t.x&&e.y===t.y};Q.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]};Q.equalsEpsilon=function(e,t,n,o){return e===t||d(e)&&d(t)&&S.equalsEpsilon(e.x,t.x,n,o)&&S.equalsEpsilon(e.y,t.y,n,o)};Q.ZERO=Object.freeze(new Q(0,0));Q.ONE=Object.freeze(new Q(1,1));Q.UNIT_X=Object.freeze(new Q(1,0));Q.UNIT_Y=Object.freeze(new Q(0,1));Q.prototype.clone=function(e){return Q.clone(this,e)};Q.prototype.equals=function(e){return Q.equals(this,e)};Q.prototype.equalsEpsilon=function(e,t,n){return Q.equalsEpsilon(this,e,t,n)};Q.prototype.toString=function(){return`(${this.x}, ${this.y})`};function si(e,t,n,o){t=j(t,0),n=j(n,0),o=j(o,0),f.typeOf.number.greaterThanOrEquals("x",t,0),f.typeOf.number.greaterThanOrEquals("y",n,0),f.typeOf.number.greaterThanOrEquals("z",o,0),e._radii=new p(t,n,o),e._radiiSquared=new p(t*t,n*n,o*o),e._radiiToTheFourth=new p(t*t*t*t,n*n*n*n,o*o*o*o),e._oneOverRadii=new p(t===0?0:1/t,n===0?0:1/n,o===0?0:1/o),e._oneOverRadiiSquared=new p(t===0?0:1/(t*t),n===0?0:1/(n*n),o===0?0:1/(o*o)),e._minimumRadius=Math.min(t,n,o),e._maximumRadius=Math.max(t,n,o),e._centerToleranceSquared=S.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function oe(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,si(this,e,t,n)}Object.defineProperties(oe.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}});oe.clone=function(e,t){if(!d(e))return;const n=e._radii;return d(t)?(p.clone(n,t._radii),p.clone(e._radiiSquared,t._radiiSquared),p.clone(e._radiiToTheFourth,t._radiiToTheFourth),p.clone(e._oneOverRadii,t._oneOverRadii),p.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new oe(n.x,n.y,n.z)};oe.fromCartesian3=function(e,t){return d(t)||(t=new oe),d(e)&&si(t,e.x,e.y,e.z),t};oe.WGS84=Object.freeze(new oe(6378137,6378137,6356752314245179e-9));oe.UNIT_SPHERE=Object.freeze(new oe(1,1,1));oe.MOON=Object.freeze(new oe(S.LUNAR_RADIUS,S.LUNAR_RADIUS,S.LUNAR_RADIUS));oe.prototype.clone=function(e){return oe.clone(this,e)};oe.packedLength=p.packedLength;oe.pack=function(e,t,n){return f.typeOf.object("value",e),f.defined("array",t),n=j(n,0),p.pack(e._radii,t,n),t};oe.unpack=function(e,t,n){f.defined("array",e),t=j(t,0);const o=p.unpack(e,t);return oe.fromCartesian3(o,n)};oe.prototype.geocentricSurfaceNormal=p.normalize;oe.prototype.geodeticSurfaceNormalCartographic=function(e,t){f.typeOf.object("cartographic",e);const n=e.longitude,o=e.latitude,i=Math.cos(o),s=i*Math.cos(n),r=i*Math.sin(n),c=Math.sin(o);return d(t)||(t=new p),t.x=s,t.y=r,t.z=c,p.normalize(t,t)};oe.prototype.geodeticSurfaceNormal=function(e,t){if(!p.equalsEpsilon(e,p.ZERO,S.EPSILON14))return d(t)||(t=new p),t=p.multiplyComponents(e,this._oneOverRadiiSquared,t),p.normalize(t,t)};const Rr=new p,Ar=new p;oe.prototype.cartographicToCartesian=function(e,t){const n=Rr,o=Ar;this.geodeticSurfaceNormalCartographic(e,n),p.multiplyComponents(this._radiiSquared,n,o);const i=Math.sqrt(p.dot(n,o));return p.divideByScalar(o,i,o),p.multiplyByScalar(n,e.height,n),d(t)||(t=new p),p.add(o,n,t)};oe.prototype.cartographicArrayToCartesianArray=function(e,t){f.defined("cartographics",e);const n=e.length;d(t)?t.length=n:t=new Array(n);for(let o=0;o<n;o++)t[o]=this.cartographicToCartesian(e[o],t[o]);return t};const Mr=new p,zr=new p,jr=new p;oe.prototype.cartesianToCartographic=function(e,t){const n=this.scaleToGeodeticSurface(e,zr);if(!d(n))return;const o=this.geodeticSurfaceNormal(n,Mr),i=p.subtract(e,n,jr),s=Math.atan2(o.y,o.x),r=Math.asin(o.z),c=S.sign(p.dot(i,e))*p.magnitude(i);return d(t)?(t.longitude=s,t.latitude=r,t.height=c,t):new le(s,r,c)};oe.prototype.cartesianArrayToCartographicArray=function(e,t){f.defined("cartesians",e);const n=e.length;d(t)?t.length=n:t=new Array(n);for(let o=0;o<n;++o)t[o]=this.cartesianToCartographic(e[o],t[o]);return t};oe.prototype.scaleToGeodeticSurface=function(e,t){return ri(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)};oe.prototype.scaleToGeocentricSurface=function(e,t){f.typeOf.object("cartesian",e),d(t)||(t=new p);const n=e.x,o=e.y,i=e.z,s=this._oneOverRadiiSquared,r=1/Math.sqrt(n*n*s.x+o*o*s.y+i*i*s.z);return p.multiplyByScalar(e,r,t)};oe.prototype.transformPositionToScaledSpace=function(e,t){return d(t)||(t=new p),p.multiplyComponents(e,this._oneOverRadii,t)};oe.prototype.transformPositionFromScaledSpace=function(e,t){return d(t)||(t=new p),p.multiplyComponents(e,this._radii,t)};oe.prototype.equals=function(e){return this===e||d(e)&&p.equals(this._radii,e._radii)};oe.prototype.toString=function(){return this._radii.toString()};oe.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){if(f.typeOf.object("position",e),!S.equalsEpsilon(this._radii.x,this._radii.y,S.EPSILON15))throw new E("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");f.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),t=j(t,0);const o=this._squaredXOverSquaredZ;if(d(n)||(n=new p),n.x=0,n.y=0,n.z=e.z*(1-o),!(Math.abs(n.z)>=this._radii.z-t))return n};const Pr=new p;oe.prototype.getLocalCurvature=function(e,t){f.typeOf.object("surfacePosition",e),d(t)||(t=new Q);const n=this.getSurfaceNormalIntersectionWithZAxis(e,0,Pr),o=p.distance(e,n),i=this.minimumRadius*o/this.maximumRadius**2,s=o*i**2;return Q.fromElements(1/o,1/s,t)};const Cr=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],Ir=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function To(e,t,n){f.typeOf.number("a",e),f.typeOf.number("b",t),f.typeOf.func("func",n);const o=.5*(t+e),i=.5*(t-e);let s=0;for(let r=0;r<5;r++){const c=i*Cr[r];s+=Ir[r]*(n(o+c)+n(o-c))}return s*=i,s}oe.prototype.surfaceArea=function(e){f.typeOf.object("rectangle",e);const t=e.west;let n=e.east;const o=e.south,i=e.north;for(;n<t;)n+=S.TWO_PI;const s=this._radiiSquared,r=s.x,c=s.y,u=s.z,y=r*c;return To(o,i,function(m){const w=Math.cos(m),b=Math.sin(m);return Math.cos(m)*To(t,n,function(O){const R=Math.cos(O),T=Math.sin(O);return Math.sqrt(y*b*b+u*(c*R*R+r*T*T)*w*w)})})};function M(e,t,n,o,i,s,r,c,u){this[0]=j(e,0),this[1]=j(o,0),this[2]=j(r,0),this[3]=j(t,0),this[4]=j(i,0),this[5]=j(c,0),this[6]=j(n,0),this[7]=j(s,0),this[8]=j(u,0)}M.packedLength=9;M.pack=function(e,t,n){return f.typeOf.object("value",e),f.defined("array",t),n=j(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t};M.unpack=function(e,t,n){return f.defined("array",e),t=j(t,0),d(n)||(n=new M),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n};M.packArray=function(e,t){f.defined("array",e);const n=e.length,o=n*9;if(!d(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new E("If result is a typed array, it must have exactly array.length * 9 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)M.pack(e[i],t,i*9);return t};M.unpackArray=function(e,t){if(f.defined("array",e),f.typeOf.number.greaterThanOrEquals("array.length",e.length,9),e.length%9!==0)throw new E("array length must be a multiple of 9.");const n=e.length;d(t)?t.length=n/9:t=new Array(n/9);for(let o=0;o<n;o+=9){const i=o/9;t[i]=M.unpack(e,o,t[i])}return t};M.clone=function(e,t){if(d(e))return d(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new M(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])};M.fromArray=M.unpack;M.fromColumnMajorArray=function(e,t){return f.defined("values",e),M.clone(e,t)};M.fromRowMajorArray=function(e,t){return f.defined("values",e),d(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new M(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};M.fromQuaternion=function(e,t){f.typeOf.object("quaternion",e);const n=e.x*e.x,o=e.x*e.y,i=e.x*e.z,s=e.x*e.w,r=e.y*e.y,c=e.y*e.z,u=e.y*e.w,y=e.z*e.z,m=e.z*e.w,w=e.w*e.w,b=n-r-y+w,O=2*(o-m),R=2*(i+u),T=2*(o+m),z=-n+r-y+w,D=2*(c-s),q=2*(i-u),x=2*(c+s),Y=-n-r+y+w;return d(t)?(t[0]=b,t[1]=T,t[2]=q,t[3]=O,t[4]=z,t[5]=x,t[6]=R,t[7]=D,t[8]=Y,t):new M(b,O,R,T,z,D,q,x,Y)};M.fromHeadingPitchRoll=function(e,t){f.typeOf.object("headingPitchRoll",e);const n=Math.cos(-e.pitch),o=Math.cos(-e.heading),i=Math.cos(e.roll),s=Math.sin(-e.pitch),r=Math.sin(-e.heading),c=Math.sin(e.roll),u=n*o,y=-i*r+c*s*o,m=c*r+i*s*o,w=n*r,b=i*o+c*s*r,O=-c*o+i*s*r,R=-s,T=c*n,z=i*n;return d(t)?(t[0]=u,t[1]=w,t[2]=R,t[3]=y,t[4]=b,t[5]=T,t[6]=m,t[7]=O,t[8]=z,t):new M(u,y,m,w,b,O,R,T,z)};M.fromScale=function(e,t){return f.typeOf.object("scale",e),d(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new M(e.x,0,0,0,e.y,0,0,0,e.z)};M.fromUniformScale=function(e,t){return f.typeOf.number("scale",e),d(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new M(e,0,0,0,e,0,0,0,e)};M.fromCrossProduct=function(e,t){return f.typeOf.object("vector",e),d(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new M(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)};M.fromRotationX=function(e,t){f.typeOf.number("angle",e);const n=Math.cos(e),o=Math.sin(e);return d(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=o,t[6]=0,t[7]=-o,t[8]=n,t):new M(1,0,0,0,n,-o,0,o,n)};M.fromRotationY=function(e,t){f.typeOf.number("angle",e);const n=Math.cos(e),o=Math.sin(e);return d(t)?(t[0]=n,t[1]=0,t[2]=-o,t[3]=0,t[4]=1,t[5]=0,t[6]=o,t[7]=0,t[8]=n,t):new M(n,0,o,0,1,0,-o,0,n)};M.fromRotationZ=function(e,t){f.typeOf.number("angle",e);const n=Math.cos(e),o=Math.sin(e);return d(t)?(t[0]=n,t[1]=o,t[2]=0,t[3]=-o,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new M(n,-o,0,o,n,0,0,0,1)};M.toArray=function(e,t){return f.typeOf.object("matrix",e),d(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]};M.getElementIndex=function(e,t){return f.typeOf.number.greaterThanOrEquals("row",t,0),f.typeOf.number.lessThanOrEquals("row",t,2),f.typeOf.number.greaterThanOrEquals("column",e,0),f.typeOf.number.lessThanOrEquals("column",e,2),e*3+t};M.getColumn=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.number.greaterThanOrEquals("index",t,0),f.typeOf.number.lessThanOrEquals("index",t,2),f.typeOf.object("result",n);const o=t*3,i=e[o],s=e[o+1],r=e[o+2];return n.x=i,n.y=s,n.z=r,n};M.setColumn=function(e,t,n,o){f.typeOf.object("matrix",e),f.typeOf.number.greaterThanOrEquals("index",t,0),f.typeOf.number.lessThanOrEquals("index",t,2),f.typeOf.object("cartesian",n),f.typeOf.object("result",o),o=M.clone(e,o);const i=t*3;return o[i]=n.x,o[i+1]=n.y,o[i+2]=n.z,o};M.getRow=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.number.greaterThanOrEquals("index",t,0),f.typeOf.number.lessThanOrEquals("index",t,2),f.typeOf.object("result",n);const o=e[t],i=e[t+3],s=e[t+6];return n.x=o,n.y=i,n.z=s,n};M.setRow=function(e,t,n,o){return f.typeOf.object("matrix",e),f.typeOf.number.greaterThanOrEquals("index",t,0),f.typeOf.number.lessThanOrEquals("index",t,2),f.typeOf.object("cartesian",n),f.typeOf.object("result",o),o=M.clone(e,o),o[t]=n.x,o[t+3]=n.y,o[t+6]=n.z,o};const qr=new p;M.setScale=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.object("scale",t),f.typeOf.object("result",n);const o=M.getScale(e,qr),i=t.x/o.x,s=t.y/o.y,r=t.z/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=e[3]*s,n[4]=e[4]*s,n[5]=e[5]*s,n[6]=e[6]*r,n[7]=e[7]*r,n[8]=e[8]*r,n};const Ur=new p;M.setUniformScale=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.number("scale",t),f.typeOf.object("result",n);const o=M.getScale(e,Ur),i=t/o.x,s=t/o.y,r=t/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=e[3]*s,n[4]=e[4]*s,n[5]=e[5]*s,n[6]=e[6]*r,n[7]=e[7]*r,n[8]=e[8]*r,n};const jn=new p;M.getScale=function(e,t){return f.typeOf.object("matrix",e),f.typeOf.object("result",t),t.x=p.magnitude(p.fromElements(e[0],e[1],e[2],jn)),t.y=p.magnitude(p.fromElements(e[3],e[4],e[5],jn)),t.z=p.magnitude(p.fromElements(e[6],e[7],e[8],jn)),t};const Ro=new p;M.getMaximumScale=function(e){return M.getScale(e,Ro),p.maximumComponent(Ro)};const Nr=new p;M.setRotation=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.object("result",n);const o=M.getScale(e,Nr);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.x,n[3]=t[3]*o.y,n[4]=t[4]*o.y,n[5]=t[5]*o.y,n[6]=t[6]*o.z,n[7]=t[7]*o.z,n[8]=t[8]*o.z,n};const Dr=new p;M.getRotation=function(e,t){f.typeOf.object("matrix",e),f.typeOf.object("result",t);const n=M.getScale(e,Dr);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[3]/n.y,t[4]=e[4]/n.y,t[5]=e[5]/n.y,t[6]=e[6]/n.z,t[7]=e[7]/n.z,t[8]=e[8]/n.z,t};M.multiply=function(e,t,n){f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n);const o=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],s=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],r=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],c=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],u=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],y=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],m=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],w=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=o,n[1]=i,n[2]=s,n[3]=r,n[4]=c,n[5]=u,n[6]=y,n[7]=m,n[8]=w,n};M.add=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n};M.subtract=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n};M.multiplyByVector=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.object("cartesian",t),f.typeOf.object("result",n);const o=t.x,i=t.y,s=t.z,r=e[0]*o+e[3]*i+e[6]*s,c=e[1]*o+e[4]*i+e[7]*s,u=e[2]*o+e[5]*i+e[8]*s;return n.x=r,n.y=c,n.z=u,n};M.multiplyByScalar=function(e,t,n){return f.typeOf.object("matrix",e),f.typeOf.number("scalar",t),f.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};M.multiplyByScale=function(e,t,n){return f.typeOf.object("matrix",e),f.typeOf.object("scale",t),f.typeOf.object("result",n),n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n};M.multiplyByUniformScale=function(e,t,n){return f.typeOf.object("matrix",e),f.typeOf.number("scale",t),f.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};M.negate=function(e,t){return f.typeOf.object("matrix",e),f.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t};M.transpose=function(e,t){f.typeOf.object("matrix",e),f.typeOf.object("result",t);const n=e[0],o=e[3],i=e[6],s=e[1],r=e[4],c=e[7],u=e[2],y=e[5],m=e[8];return t[0]=n,t[1]=o,t[2]=i,t[3]=s,t[4]=r,t[5]=c,t[6]=u,t[7]=y,t[8]=m,t};function xr(e){let t=0;for(let n=0;n<9;++n){const o=e[n];t+=o*o}return Math.sqrt(t)}const Zn=[1,0,0],Xn=[2,2,1];function $r(e){let t=0;for(let n=0;n<3;++n){const o=e[M.getElementIndex(Xn[n],Zn[n])];t+=2*o*o}return Math.sqrt(t)}function Fr(e,t){const n=S.EPSILON15;let o=0,i=1;for(let y=0;y<3;++y){const m=Math.abs(e[M.getElementIndex(Xn[y],Zn[y])]);m>o&&(i=y,o=m)}let s=1,r=0;const c=Zn[i],u=Xn[i];if(Math.abs(e[M.getElementIndex(u,c)])>n){const y=e[M.getElementIndex(u,u)],m=e[M.getElementIndex(c,c)],w=e[M.getElementIndex(u,c)],b=(y-m)/2/w;let O;b<0?O=-1/(-b+Math.sqrt(1+b*b)):O=1/(b+Math.sqrt(1+b*b)),s=1/Math.sqrt(1+O*O),r=O*s}return t=M.clone(M.IDENTITY,t),t[M.getElementIndex(c,c)]=t[M.getElementIndex(u,u)]=s,t[M.getElementIndex(u,c)]=r,t[M.getElementIndex(c,u)]=-r,t}const Jt=new M,Ao=new M;M.computeEigenDecomposition=function(e,t){f.typeOf.object("matrix",e);const n=S.EPSILON20,o=10;let i=0,s=0;d(t)||(t={});const r=t.unitary=M.clone(M.IDENTITY,t.unitary),c=t.diagonal=M.clone(e,t.diagonal),u=n*xr(c);for(;s<o&&$r(c)>u;)Fr(c,Jt),M.transpose(Jt,Ao),M.multiply(c,Jt,c),M.multiply(Ao,c,c),M.multiply(r,Jt,r),++i>2&&(++s,i=0);return t};M.abs=function(e,t){return f.typeOf.object("matrix",e),f.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t};M.determinant=function(e){f.typeOf.object("matrix",e);const t=e[0],n=e[3],o=e[6],i=e[1],s=e[4],r=e[7],c=e[2],u=e[5],y=e[8];return t*(s*y-u*r)+i*(u*o-n*y)+c*(n*r-s*o)};M.inverse=function(e,t){f.typeOf.object("matrix",e),f.typeOf.object("result",t);const n=e[0],o=e[1],i=e[2],s=e[3],r=e[4],c=e[5],u=e[6],y=e[7],m=e[8],w=M.determinant(e);if(Math.abs(w)<=S.EPSILON15)throw new E("matrix is not invertible");t[0]=r*m-y*c,t[1]=y*i-o*m,t[2]=o*c-r*i,t[3]=u*c-s*m,t[4]=n*m-u*i,t[5]=s*i-n*c,t[6]=s*y-u*r,t[7]=u*o-n*y,t[8]=n*r-s*o;const b=1/w;return M.multiplyByScalar(t,b,t)};const Lr=new M;M.inverseTranspose=function(e,t){return f.typeOf.object("matrix",e),f.typeOf.object("result",t),M.inverse(M.transpose(e,Lr),t)};M.equals=function(e,t){return e===t||d(e)&&d(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]};M.equalsEpsilon=function(e,t,n){return n=j(n,0),e===t||d(e)&&d(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n};M.IDENTITY=Object.freeze(new M(1,0,0,0,1,0,0,0,1));M.ZERO=Object.freeze(new M(0,0,0,0,0,0,0,0,0));M.COLUMN0ROW0=0;M.COLUMN0ROW1=1;M.COLUMN0ROW2=2;M.COLUMN1ROW0=3;M.COLUMN1ROW1=4;M.COLUMN1ROW2=5;M.COLUMN2ROW0=6;M.COLUMN2ROW1=7;M.COLUMN2ROW2=8;Object.defineProperties(M.prototype,{length:{get:function(){return M.packedLength}}});M.prototype.clone=function(e){return M.clone(this,e)};M.prototype.equals=function(e){return M.equals(this,e)};M.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]};M.prototype.equalsEpsilon=function(e,t){return M.equalsEpsilon(this,e,t)};M.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})
3
+ (${this[1]}, ${this[4]}, ${this[7]})
4
+ (${this[2]}, ${this[5]}, ${this[8]})`};function L(e,t,n,o){this.x=j(e,0),this.y=j(t,0),this.z=j(n,0),this.w=j(o,0)}L.fromElements=function(e,t,n,o,i){return d(i)?(i.x=e,i.y=t,i.z=n,i.w=o,i):new L(e,t,n,o)};L.fromColor=function(e,t){return f.typeOf.object("color",e),d(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new L(e.red,e.green,e.blue,e.alpha)};L.clone=function(e,t){if(d(e))return d(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new L(e.x,e.y,e.z,e.w)};L.packedLength=4;L.pack=function(e,t,n){return f.typeOf.object("value",e),f.defined("array",t),n=j(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};L.unpack=function(e,t,n){return f.defined("array",e),t=j(t,0),d(n)||(n=new L),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};L.packArray=function(e,t){f.defined("array",e);const n=e.length,o=n*4;if(!d(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new E("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)L.pack(e[i],t,i*4);return t};L.unpackArray=function(e,t){if(f.defined("array",e),f.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new E("array length must be a multiple of 4.");const n=e.length;d(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){const i=o/4;t[i]=L.unpack(e,o,t[i])}return t};L.fromArray=L.unpack;L.maximumComponent=function(e){return f.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)};L.minimumComponent=function(e){return f.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)};L.minimumByComponent=function(e,t,n){return f.typeOf.object("first",e),f.typeOf.object("second",t),f.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};L.maximumByComponent=function(e,t,n){return f.typeOf.object("first",e),f.typeOf.object("second",t),f.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};L.clamp=function(e,t,n,o){f.typeOf.object("value",e),f.typeOf.object("min",t),f.typeOf.object("max",n),f.typeOf.object("result",o);const i=S.clamp(e.x,t.x,n.x),s=S.clamp(e.y,t.y,n.y),r=S.clamp(e.z,t.z,n.z),c=S.clamp(e.w,t.w,n.w);return o.x=i,o.y=s,o.z=r,o.w=c,o};L.magnitudeSquared=function(e){return f.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};L.magnitude=function(e){return Math.sqrt(L.magnitudeSquared(e))};const gn=new L;L.distance=function(e,t){return f.typeOf.object("left",e),f.typeOf.object("right",t),L.subtract(e,t,gn),L.magnitude(gn)};L.distanceSquared=function(e,t){return f.typeOf.object("left",e),f.typeOf.object("right",t),L.subtract(e,t,gn),L.magnitudeSquared(gn)};L.normalize=function(e,t){f.typeOf.object("cartesian",e),f.typeOf.object("result",t);const n=L.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(t.w))throw new E("normalized result is not a number");return t};L.dot=function(e,t){return f.typeOf.object("left",e),f.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};L.multiplyComponents=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};L.divideComponents=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};L.add=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};L.subtract=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};L.multiplyByScalar=function(e,t,n){return f.typeOf.object("cartesian",e),f.typeOf.number("scalar",t),f.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};L.divideByScalar=function(e,t,n){return f.typeOf.object("cartesian",e),f.typeOf.number("scalar",t),f.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};L.negate=function(e,t){return f.typeOf.object("cartesian",e),f.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};L.abs=function(e,t){return f.typeOf.object("cartesian",e),f.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};const Mo=new L;L.lerp=function(e,t,n,o){return f.typeOf.object("start",e),f.typeOf.object("end",t),f.typeOf.number("t",n),f.typeOf.object("result",o),L.multiplyByScalar(t,n,Mo),o=L.multiplyByScalar(e,1-n,o),L.add(Mo,o,o)};const kr=new L;L.mostOrthogonalAxis=function(e,t){f.typeOf.object("cartesian",e),f.typeOf.object("result",t);const n=L.normalize(e,kr);return L.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=L.clone(L.UNIT_X,t):t=L.clone(L.UNIT_W,t):n.z<=n.w?t=L.clone(L.UNIT_Z,t):t=L.clone(L.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=L.clone(L.UNIT_Y,t):t=L.clone(L.UNIT_W,t):n.z<=n.w?t=L.clone(L.UNIT_Z,t):t=L.clone(L.UNIT_W,t),t};L.equals=function(e,t){return e===t||d(e)&&d(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};L.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]};L.equalsEpsilon=function(e,t,n,o){return e===t||d(e)&&d(t)&&S.equalsEpsilon(e.x,t.x,n,o)&&S.equalsEpsilon(e.y,t.y,n,o)&&S.equalsEpsilon(e.z,t.z,n,o)&&S.equalsEpsilon(e.w,t.w,n,o)};L.ZERO=Object.freeze(new L(0,0,0,0));L.ONE=Object.freeze(new L(1,1,1,1));L.UNIT_X=Object.freeze(new L(1,0,0,0));L.UNIT_Y=Object.freeze(new L(0,1,0,0));L.UNIT_Z=Object.freeze(new L(0,0,1,0));L.UNIT_W=Object.freeze(new L(0,0,0,1));L.prototype.clone=function(e){return L.clone(this,e)};L.prototype.equals=function(e){return L.equals(this,e)};L.prototype.equalsEpsilon=function(e,t,n){return L.equalsEpsilon(this,e,t,n)};L.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const co=new Float32Array(1),Te=new Uint8Array(co.buffer),Br=new Uint32Array([287454020]),Wr=new Uint8Array(Br.buffer),ci=Wr[0]===68;L.packFloat=function(e,t){return f.typeOf.number("value",e),d(t)||(t=new L),co[0]=e,ci?(t.x=Te[0],t.y=Te[1],t.z=Te[2],t.w=Te[3]):(t.x=Te[3],t.y=Te[2],t.z=Te[1],t.w=Te[0]),t};L.unpackFloat=function(e){return f.typeOf.object("packedFloat",e),ci?(Te[0]=e.x,Te[1]=e.y,Te[2]=e.z,Te[3]=e.w):(Te[0]=e.w,Te[1]=e.z,Te[2]=e.y,Te[3]=e.x),co[0]};function Ie(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}d(Object.create)&&(Ie.prototype=Object.create(Error.prototype),Ie.prototype.constructor=Ie);Ie.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return d(this.stack)&&(e+=`
5
+ ${this.stack.toString()}`),e};function A(e,t,n,o,i,s,r,c,u,y,m,w,b,O,R,T){this[0]=j(e,0),this[1]=j(i,0),this[2]=j(u,0),this[3]=j(b,0),this[4]=j(t,0),this[5]=j(s,0),this[6]=j(y,0),this[7]=j(O,0),this[8]=j(n,0),this[9]=j(r,0),this[10]=j(m,0),this[11]=j(R,0),this[12]=j(o,0),this[13]=j(c,0),this[14]=j(w,0),this[15]=j(T,0)}A.packedLength=16;A.pack=function(e,t,n){return f.typeOf.object("value",e),f.defined("array",t),n=j(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};A.unpack=function(e,t,n){return f.defined("array",e),t=j(t,0),d(n)||(n=new A),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n};A.packArray=function(e,t){f.defined("array",e);const n=e.length,o=n*16;if(!d(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new E("If result is a typed array, it must have exactly array.length * 16 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)A.pack(e[i],t,i*16);return t};A.unpackArray=function(e,t){if(f.defined("array",e),f.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)throw new E("array length must be a multiple of 16.");const n=e.length;d(t)?t.length=n/16:t=new Array(n/16);for(let o=0;o<n;o+=16){const i=o/16;t[i]=A.unpack(e,o,t[i])}return t};A.clone=function(e,t){if(d(e))return d(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new A(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])};A.fromArray=A.unpack;A.fromColumnMajorArray=function(e,t){return f.defined("values",e),A.clone(e,t)};A.fromRowMajorArray=function(e,t){return f.defined("values",e),d(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new A(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])};A.fromRotationTranslation=function(e,t,n){return f.typeOf.object("rotation",e),t=j(t,p.ZERO),d(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=0,n[4]=e[3],n[5]=e[4],n[6]=e[5],n[7]=0,n[8]=e[6],n[9]=e[7],n[10]=e[8],n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n):new A(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)};A.fromTranslationQuaternionRotationScale=function(e,t,n,o){f.typeOf.object("translation",e),f.typeOf.object("rotation",t),f.typeOf.object("scale",n),d(o)||(o=new A);const i=n.x,s=n.y,r=n.z,c=t.x*t.x,u=t.x*t.y,y=t.x*t.z,m=t.x*t.w,w=t.y*t.y,b=t.y*t.z,O=t.y*t.w,R=t.z*t.z,T=t.z*t.w,z=t.w*t.w,D=c-w-R+z,q=2*(u-T),x=2*(y+O),Y=2*(u+T),N=-c+w-R+z,H=2*(b-m),B=2*(y-O),U=2*(b+m),G=-c-w+R+z;return o[0]=D*i,o[1]=Y*i,o[2]=B*i,o[3]=0,o[4]=q*s,o[5]=N*s,o[6]=U*s,o[7]=0,o[8]=x*r,o[9]=H*r,o[10]=G*r,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,o};A.fromTranslationRotationScale=function(e,t){return f.typeOf.object("translationRotationScale",e),A.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};A.fromTranslation=function(e,t){return f.typeOf.object("translation",e),A.fromRotationTranslation(M.IDENTITY,e,t)};A.fromScale=function(e,t){return f.typeOf.object("scale",e),d(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new A(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};A.fromUniformScale=function(e,t){return f.typeOf.number("scale",e),d(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new A(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};A.fromRotation=function(e,t){return f.typeOf.object("rotation",e),d(t)||(t=new A),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};const ht=new p,dt=new p,Mt=new p;A.fromCamera=function(e,t){f.typeOf.object("camera",e);const n=e.position,o=e.direction,i=e.up;f.typeOf.object("camera.position",n),f.typeOf.object("camera.direction",o),f.typeOf.object("camera.up",i),p.normalize(o,ht),p.normalize(p.cross(ht,i,dt),dt),p.normalize(p.cross(dt,ht,Mt),Mt);const s=dt.x,r=dt.y,c=dt.z,u=ht.x,y=ht.y,m=ht.z,w=Mt.x,b=Mt.y,O=Mt.z,R=n.x,T=n.y,z=n.z,D=s*-R+r*-T+c*-z,q=w*-R+b*-T+O*-z,x=u*R+y*T+m*z;return d(t)?(t[0]=s,t[1]=w,t[2]=-u,t[3]=0,t[4]=r,t[5]=b,t[6]=-y,t[7]=0,t[8]=c,t[9]=O,t[10]=-m,t[11]=0,t[12]=D,t[13]=q,t[14]=x,t[15]=1,t):new A(s,r,c,D,w,b,O,q,-u,-y,-m,x,0,0,0,1)};A.computePerspectiveFieldOfView=function(e,t,n,o,i){f.typeOf.number.greaterThan("fovY",e,0),f.typeOf.number.lessThan("fovY",e,Math.PI),f.typeOf.number.greaterThan("near",n,0),f.typeOf.number.greaterThan("far",o,0),f.typeOf.object("result",i);const r=1/Math.tan(e*.5),c=r/t,u=(o+n)/(n-o),y=2*o*n/(n-o);return i[0]=c,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=r,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=u,i[11]=-1,i[12]=0,i[13]=0,i[14]=y,i[15]=0,i};A.computeOrthographicOffCenter=function(e,t,n,o,i,s,r){f.typeOf.number("left",e),f.typeOf.number("right",t),f.typeOf.number("bottom",n),f.typeOf.number("top",o),f.typeOf.number("near",i),f.typeOf.number("far",s),f.typeOf.object("result",r);let c=1/(t-e),u=1/(o-n),y=1/(s-i);const m=-(t+e)*c,w=-(o+n)*u,b=-(s+i)*y;return c*=2,u*=2,y*=-2,r[0]=c,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=u,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=y,r[11]=0,r[12]=m,r[13]=w,r[14]=b,r[15]=1,r};A.computePerspectiveOffCenter=function(e,t,n,o,i,s,r){f.typeOf.number("left",e),f.typeOf.number("right",t),f.typeOf.number("bottom",n),f.typeOf.number("top",o),f.typeOf.number("near",i),f.typeOf.number("far",s),f.typeOf.object("result",r);const c=2*i/(t-e),u=2*i/(o-n),y=(t+e)/(t-e),m=(o+n)/(o-n),w=-(s+i)/(s-i),b=-1,O=-2*s*i/(s-i);return r[0]=c,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=u,r[6]=0,r[7]=0,r[8]=y,r[9]=m,r[10]=w,r[11]=b,r[12]=0,r[13]=0,r[14]=O,r[15]=0,r};A.computeInfinitePerspectiveOffCenter=function(e,t,n,o,i,s){f.typeOf.number("left",e),f.typeOf.number("right",t),f.typeOf.number("bottom",n),f.typeOf.number("top",o),f.typeOf.number("near",i),f.typeOf.object("result",s);const r=2*i/(t-e),c=2*i/(o-n),u=(t+e)/(t-e),y=(o+n)/(o-n),m=-1,w=-1,b=-2*i;return s[0]=r,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=u,s[9]=y,s[10]=m,s[11]=w,s[12]=0,s[13]=0,s[14]=b,s[15]=0,s};A.computeViewportTransformation=function(e,t,n,o){d(o)||(o=new A),e=j(e,j.EMPTY_OBJECT);const i=j(e.x,0),s=j(e.y,0),r=j(e.width,0),c=j(e.height,0);t=j(t,0),n=j(n,1);const u=r*.5,y=c*.5,m=(n-t)*.5,w=u,b=y,O=m,R=i+u,T=s+y,z=t+m,D=1;return o[0]=w,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=b,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=O,o[11]=0,o[12]=R,o[13]=T,o[14]=z,o[15]=D,o};A.computeView=function(e,t,n,o,i){return f.typeOf.object("position",e),f.typeOf.object("direction",t),f.typeOf.object("up",n),f.typeOf.object("right",o),f.typeOf.object("result",i),i[0]=o.x,i[1]=n.x,i[2]=-t.x,i[3]=0,i[4]=o.y,i[5]=n.y,i[6]=-t.y,i[7]=0,i[8]=o.z,i[9]=n.z,i[10]=-t.z,i[11]=0,i[12]=-p.dot(o,e),i[13]=-p.dot(n,e),i[14]=p.dot(t,e),i[15]=1,i};A.toArray=function(e,t){return f.typeOf.object("matrix",e),d(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]};A.getElementIndex=function(e,t){return f.typeOf.number.greaterThanOrEquals("row",t,0),f.typeOf.number.lessThanOrEquals("row",t,3),f.typeOf.number.greaterThanOrEquals("column",e,0),f.typeOf.number.lessThanOrEquals("column",e,3),e*4+t};A.getColumn=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.number.greaterThanOrEquals("index",t,0),f.typeOf.number.lessThanOrEquals("index",t,3),f.typeOf.object("result",n);const o=t*4,i=e[o],s=e[o+1],r=e[o+2],c=e[o+3];return n.x=i,n.y=s,n.z=r,n.w=c,n};A.setColumn=function(e,t,n,o){f.typeOf.object("matrix",e),f.typeOf.number.greaterThanOrEquals("index",t,0),f.typeOf.number.lessThanOrEquals("index",t,3),f.typeOf.object("cartesian",n),f.typeOf.object("result",o),o=A.clone(e,o);const i=t*4;return o[i]=n.x,o[i+1]=n.y,o[i+2]=n.z,o[i+3]=n.w,o};A.getRow=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.number.greaterThanOrEquals("index",t,0),f.typeOf.number.lessThanOrEquals("index",t,3),f.typeOf.object("result",n);const o=e[t],i=e[t+4],s=e[t+8],r=e[t+12];return n.x=o,n.y=i,n.z=s,n.w=r,n};A.setRow=function(e,t,n,o){return f.typeOf.object("matrix",e),f.typeOf.number.greaterThanOrEquals("index",t,0),f.typeOf.number.lessThanOrEquals("index",t,3),f.typeOf.object("cartesian",n),f.typeOf.object("result",o),o=A.clone(e,o),o[t]=n.x,o[t+4]=n.y,o[t+8]=n.z,o[t+12]=n.w,o};A.setTranslation=function(e,t,n){return f.typeOf.object("matrix",e),f.typeOf.object("translation",t),f.typeOf.object("result",n),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};const Hr=new p;A.setScale=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.object("scale",t),f.typeOf.object("result",n);const o=A.getScale(e,Hr),i=t.x/o.x,s=t.y/o.y,r=t.z/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=e[3],n[4]=e[4]*s,n[5]=e[5]*s,n[6]=e[6]*s,n[7]=e[7],n[8]=e[8]*r,n[9]=e[9]*r,n[10]=e[10]*r,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};const Qr=new p;A.setUniformScale=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.number("scale",t),f.typeOf.object("result",n);const o=A.getScale(e,Qr),i=t/o.x,s=t/o.y,r=t/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=e[3],n[4]=e[4]*s,n[5]=e[5]*s,n[6]=e[6]*s,n[7]=e[7],n[8]=e[8]*r,n[9]=e[9]*r,n[10]=e[10]*r,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};const Pn=new p;A.getScale=function(e,t){return f.typeOf.object("matrix",e),f.typeOf.object("result",t),t.x=p.magnitude(p.fromElements(e[0],e[1],e[2],Pn)),t.y=p.magnitude(p.fromElements(e[4],e[5],e[6],Pn)),t.z=p.magnitude(p.fromElements(e[8],e[9],e[10],Pn)),t};const zo=new p;A.getMaximumScale=function(e){return A.getScale(e,zo),p.maximumComponent(zo)};const Yr=new p;A.setRotation=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.object("result",n);const o=A.getScale(e,Yr);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.x,n[3]=e[3],n[4]=t[3]*o.y,n[5]=t[4]*o.y,n[6]=t[5]*o.y,n[7]=e[7],n[8]=t[6]*o.z,n[9]=t[7]*o.z,n[10]=t[8]*o.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};const Vr=new p;A.getRotation=function(e,t){f.typeOf.object("matrix",e),f.typeOf.object("result",t);const n=A.getScale(e,Vr);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[4]/n.y,t[4]=e[5]/n.y,t[5]=e[6]/n.y,t[6]=e[8]/n.z,t[7]=e[9]/n.z,t[8]=e[10]/n.z,t};A.multiply=function(e,t,n){f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n);const o=e[0],i=e[1],s=e[2],r=e[3],c=e[4],u=e[5],y=e[6],m=e[7],w=e[8],b=e[9],O=e[10],R=e[11],T=e[12],z=e[13],D=e[14],q=e[15],x=t[0],Y=t[1],N=t[2],H=t[3],B=t[4],U=t[5],G=t[6],V=t[7],k=t[8],J=t[9],a=t[10],h=t[11],l=t[12],g=t[13],_=t[14],v=t[15],P=o*x+c*Y+w*N+T*H,C=i*x+u*Y+b*N+z*H,$=s*x+y*Y+O*N+D*H,X=r*x+m*Y+R*N+q*H,ee=o*B+c*U+w*G+T*V,te=i*B+u*U+b*G+z*V,ie=s*B+y*U+O*G+D*V,ce=r*B+m*U+R*G+q*V,ue=o*k+c*J+w*a+T*h,ye=i*k+u*J+b*a+z*h,he=s*k+y*J+O*a+D*h,ne=r*k+m*J+R*a+q*h,pe=o*l+c*g+w*_+T*v,_e=i*l+u*g+b*_+z*v,Se=s*l+y*g+O*_+D*v,xe=r*l+m*g+R*_+q*v;return n[0]=P,n[1]=C,n[2]=$,n[3]=X,n[4]=ee,n[5]=te,n[6]=ie,n[7]=ce,n[8]=ue,n[9]=ye,n[10]=he,n[11]=ne,n[12]=pe,n[13]=_e,n[14]=Se,n[15]=xe,n};A.add=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};A.subtract=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};A.multiplyTransformation=function(e,t,n){f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n);const o=e[0],i=e[1],s=e[2],r=e[4],c=e[5],u=e[6],y=e[8],m=e[9],w=e[10],b=e[12],O=e[13],R=e[14],T=t[0],z=t[1],D=t[2],q=t[4],x=t[5],Y=t[6],N=t[8],H=t[9],B=t[10],U=t[12],G=t[13],V=t[14],k=o*T+r*z+y*D,J=i*T+c*z+m*D,a=s*T+u*z+w*D,h=o*q+r*x+y*Y,l=i*q+c*x+m*Y,g=s*q+u*x+w*Y,_=o*N+r*H+y*B,v=i*N+c*H+m*B,P=s*N+u*H+w*B,C=o*U+r*G+y*V+b,$=i*U+c*G+m*V+O,X=s*U+u*G+w*V+R;return n[0]=k,n[1]=J,n[2]=a,n[3]=0,n[4]=h,n[5]=l,n[6]=g,n[7]=0,n[8]=_,n[9]=v,n[10]=P,n[11]=0,n[12]=C,n[13]=$,n[14]=X,n[15]=1,n};A.multiplyByMatrix3=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.object("rotation",t),f.typeOf.object("result",n);const o=e[0],i=e[1],s=e[2],r=e[4],c=e[5],u=e[6],y=e[8],m=e[9],w=e[10],b=t[0],O=t[1],R=t[2],T=t[3],z=t[4],D=t[5],q=t[6],x=t[7],Y=t[8],N=o*b+r*O+y*R,H=i*b+c*O+m*R,B=s*b+u*O+w*R,U=o*T+r*z+y*D,G=i*T+c*z+m*D,V=s*T+u*z+w*D,k=o*q+r*x+y*Y,J=i*q+c*x+m*Y,a=s*q+u*x+w*Y;return n[0]=N,n[1]=H,n[2]=B,n[3]=0,n[4]=U,n[5]=G,n[6]=V,n[7]=0,n[8]=k,n[9]=J,n[10]=a,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};A.multiplyByTranslation=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.object("translation",t),f.typeOf.object("result",n);const o=t.x,i=t.y,s=t.z,r=o*e[0]+i*e[4]+s*e[8]+e[12],c=o*e[1]+i*e[5]+s*e[9]+e[13],u=o*e[2]+i*e[6]+s*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=r,n[13]=c,n[14]=u,n[15]=e[15],n};A.multiplyByScale=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.object("scale",t),f.typeOf.object("result",n);const o=t.x,i=t.y,s=t.z;return o===1&&i===1&&s===1?A.clone(e,n):(n[0]=o*e[0],n[1]=o*e[1],n[2]=o*e[2],n[3]=e[3],n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=e[7],n[8]=s*e[8],n[9]=s*e[9],n[10]=s*e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n)};A.multiplyByUniformScale=function(e,t,n){return f.typeOf.object("matrix",e),f.typeOf.number("scale",t),f.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};A.multiplyByVector=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.object("cartesian",t),f.typeOf.object("result",n);const o=t.x,i=t.y,s=t.z,r=t.w,c=e[0]*o+e[4]*i+e[8]*s+e[12]*r,u=e[1]*o+e[5]*i+e[9]*s+e[13]*r,y=e[2]*o+e[6]*i+e[10]*s+e[14]*r,m=e[3]*o+e[7]*i+e[11]*s+e[15]*r;return n.x=c,n.y=u,n.z=y,n.w=m,n};A.multiplyByPointAsVector=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.object("cartesian",t),f.typeOf.object("result",n);const o=t.x,i=t.y,s=t.z,r=e[0]*o+e[4]*i+e[8]*s,c=e[1]*o+e[5]*i+e[9]*s,u=e[2]*o+e[6]*i+e[10]*s;return n.x=r,n.y=c,n.z=u,n};A.multiplyByPoint=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.object("cartesian",t),f.typeOf.object("result",n);const o=t.x,i=t.y,s=t.z,r=e[0]*o+e[4]*i+e[8]*s+e[12],c=e[1]*o+e[5]*i+e[9]*s+e[13],u=e[2]*o+e[6]*i+e[10]*s+e[14];return n.x=r,n.y=c,n.z=u,n};A.multiplyByScalar=function(e,t,n){return f.typeOf.object("matrix",e),f.typeOf.number("scalar",t),f.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};A.negate=function(e,t){return f.typeOf.object("matrix",e),f.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};A.transpose=function(e,t){f.typeOf.object("matrix",e),f.typeOf.object("result",t);const n=e[1],o=e[2],i=e[3],s=e[6],r=e[7],c=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=o,t[9]=s,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=r,t[14]=c,t[15]=e[15],t};A.abs=function(e,t){return f.typeOf.object("matrix",e),f.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};A.equals=function(e,t){return e===t||d(e)&&d(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]};A.equalsEpsilon=function(e,t,n){return n=j(n,0),e===t||d(e)&&d(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n};A.getTranslation=function(e,t){return f.typeOf.object("matrix",e),f.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t};A.getMatrix3=function(e,t){return f.typeOf.object("matrix",e),f.typeOf.object("result",t),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};const Gr=new M,Zr=new M,Xr=new L,Jr=new L(0,0,0,1);A.inverse=function(e,t){f.typeOf.object("matrix",e),f.typeOf.object("result",t);const n=e[0],o=e[4],i=e[8],s=e[12],r=e[1],c=e[5],u=e[9],y=e[13],m=e[2],w=e[6],b=e[10],O=e[14],R=e[3],T=e[7],z=e[11],D=e[15];let q=b*D,x=O*z,Y=w*D,N=O*T,H=w*z,B=b*T,U=m*D,G=O*R,V=m*z,k=b*R,J=m*T,a=w*R;const h=q*c+N*u+H*y-(x*c+Y*u+B*y),l=x*r+U*u+k*y-(q*r+G*u+V*y),g=Y*r+G*c+J*y-(N*r+U*c+a*y),_=B*r+V*c+a*u-(H*r+k*c+J*u),v=x*o+Y*i+B*s-(q*o+N*i+H*s),P=q*n+G*i+V*s-(x*n+U*i+k*s),C=N*n+U*o+a*s-(Y*n+G*o+J*s),$=H*n+k*o+J*i-(B*n+V*o+a*i);q=i*y,x=s*u,Y=o*y,N=s*c,H=o*u,B=i*c,U=n*y,G=s*r,V=n*u,k=i*r,J=n*c,a=o*r;const X=q*T+N*z+H*D-(x*T+Y*z+B*D),ee=x*R+U*z+k*D-(q*R+G*z+V*D),te=Y*R+G*T+J*D-(N*R+U*T+a*D),ie=B*R+V*T+a*z-(H*R+k*T+J*z),ce=Y*b+B*O+x*w-(H*O+q*w+N*b),ue=V*O+q*m+G*b-(U*b+k*O+x*m),ye=U*w+a*O+N*m-(J*O+Y*m+G*w),he=J*b+H*m+k*w-(V*w+a*b+B*m);let ne=n*h+o*l+i*g+s*_;if(Math.abs(ne)<S.EPSILON21){if(M.equalsEpsilon(A.getMatrix3(e,Gr),Zr,S.EPSILON7)&&L.equals(A.getRow(e,3,Xr),Jr))return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=1,t;throw new Ie("matrix is not invertible because its determinate is zero.")}return ne=1/ne,t[0]=h*ne,t[1]=l*ne,t[2]=g*ne,t[3]=_*ne,t[4]=v*ne,t[5]=P*ne,t[6]=C*ne,t[7]=$*ne,t[8]=X*ne,t[9]=ee*ne,t[10]=te*ne,t[11]=ie*ne,t[12]=ce*ne,t[13]=ue*ne,t[14]=ye*ne,t[15]=he*ne,t};A.inverseTransformation=function(e,t){f.typeOf.object("matrix",e),f.typeOf.object("result",t);const n=e[0],o=e[1],i=e[2],s=e[4],r=e[5],c=e[6],u=e[8],y=e[9],m=e[10],w=e[12],b=e[13],O=e[14],R=-n*w-o*b-i*O,T=-s*w-r*b-c*O,z=-u*w-y*b-m*O;return t[0]=n,t[1]=s,t[2]=u,t[3]=0,t[4]=o,t[5]=r,t[6]=y,t[7]=0,t[8]=i,t[9]=c,t[10]=m,t[11]=0,t[12]=R,t[13]=T,t[14]=z,t[15]=1,t};const Kr=new A;A.inverseTranspose=function(e,t){return f.typeOf.object("matrix",e),f.typeOf.object("result",t),A.inverse(A.transpose(e,Kr),t)};A.IDENTITY=Object.freeze(new A(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));A.ZERO=Object.freeze(new A(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));A.COLUMN0ROW0=0;A.COLUMN0ROW1=1;A.COLUMN0ROW2=2;A.COLUMN0ROW3=3;A.COLUMN1ROW0=4;A.COLUMN1ROW1=5;A.COLUMN1ROW2=6;A.COLUMN1ROW3=7;A.COLUMN2ROW0=8;A.COLUMN2ROW1=9;A.COLUMN2ROW2=10;A.COLUMN2ROW3=11;A.COLUMN3ROW0=12;A.COLUMN3ROW1=13;A.COLUMN3ROW2=14;A.COLUMN3ROW3=15;Object.defineProperties(A.prototype,{length:{get:function(){return A.packedLength}}});A.prototype.clone=function(e){return A.clone(this,e)};A.prototype.equals=function(e){return A.equals(this,e)};A.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]};A.prototype.equalsEpsilon=function(e,t){return A.equalsEpsilon(this,e,t)};A.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})
6
+ (${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})
7
+ (${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})
8
+ (${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};var ai={exports:{}},Ct={exports:{}};/*! https://mths.be/punycode v1.4.0 by @mathias */Ct.exports;var jo;function es(){return jo||(jo=1,function(e,t){(function(n){var o=t&&!t.nodeType&&t,i=e&&!e.nodeType&&e,s=typeof We=="object"&&We;(s.global===s||s.window===s||s.self===s)&&(n=s);var r,c=2147483647,u=36,y=1,m=26,w=38,b=700,O=72,R=128,T="-",z=/^xn--/,D=/[^\x20-\x7E]/,q=/[\x2E\u3002\uFF0E\uFF61]/g,x={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Y=u-y,N=Math.floor,H=String.fromCharCode,B;function U(C){throw new RangeError(x[C])}function G(C,$){for(var X=C.length,ee=[];X--;)ee[X]=$(C[X]);return ee}function V(C,$){var X=C.split("@"),ee="";X.length>1&&(ee=X[0]+"@",C=X[1]),C=C.replace(q,".");var te=C.split("."),ie=G(te,$).join(".");return ee+ie}function k(C){for(var $=[],X=0,ee=C.length,te,ie;X<ee;)te=C.charCodeAt(X++),te>=55296&&te<=56319&&X<ee?(ie=C.charCodeAt(X++),(ie&64512)==56320?$.push(((te&1023)<<10)+(ie&1023)+65536):($.push(te),X--)):$.push(te);return $}function J(C){return G(C,function($){var X="";return $>65535&&($-=65536,X+=H($>>>10&1023|55296),$=56320|$&1023),X+=H($),X}).join("")}function a(C){return C-48<10?C-22:C-65<26?C-65:C-97<26?C-97:u}function h(C,$){return C+22+75*(C<26)-(($!=0)<<5)}function l(C,$,X){var ee=0;for(C=X?N(C/b):C>>1,C+=N(C/$);C>Y*m>>1;ee+=u)C=N(C/Y);return N(ee+(Y+1)*C/(C+w))}function g(C){var $=[],X=C.length,ee,te=0,ie=R,ce=O,ue,ye,he,ne,pe,_e,Se,xe,nt;for(ue=C.lastIndexOf(T),ue<0&&(ue=0),ye=0;ye<ue;++ye)C.charCodeAt(ye)>=128&&U("not-basic"),$.push(C.charCodeAt(ye));for(he=ue>0?ue+1:0;he<X;){for(ne=te,pe=1,_e=u;he>=X&&U("invalid-input"),Se=a(C.charCodeAt(he++)),(Se>=u||Se>N((c-te)/pe))&&U("overflow"),te+=Se*pe,xe=_e<=ce?y:_e>=ce+m?m:_e-ce,!(Se<xe);_e+=u)nt=u-xe,pe>N(c/nt)&&U("overflow"),pe*=nt;ee=$.length+1,ce=l(te-ne,ee,ne==0),N(te/ee)>c-ie&&U("overflow"),ie+=N(te/ee),te%=ee,$.splice(te++,0,ie)}return J($)}function _(C){var $,X,ee,te,ie,ce,ue,ye,he,ne,pe,_e=[],Se,xe,nt,An;for(C=k(C),Se=C.length,$=R,X=0,ie=O,ce=0;ce<Se;++ce)pe=C[ce],pe<128&&_e.push(H(pe));for(ee=te=_e.length,te&&_e.push(T);ee<Se;){for(ue=c,ce=0;ce<Se;++ce)pe=C[ce],pe>=$&&pe<ue&&(ue=pe);for(xe=ee+1,ue-$>N((c-X)/xe)&&U("overflow"),X+=(ue-$)*xe,$=ue,ce=0;ce<Se;++ce)if(pe=C[ce],pe<$&&++X>c&&U("overflow"),pe==$){for(ye=X,he=u;ne=he<=ie?y:he>=ie+m?m:he-ie,!(ye<ne);he+=u)An=ye-ne,nt=u-ne,_e.push(H(h(ne+An%nt,0))),ye=N(An/nt);_e.push(H(h(ye,0))),ie=l(X,xe,ee==te),X=0,++ee}++X,++$}return _e.join("")}function v(C){return V(C,function($){return z.test($)?g($.slice(4).toLowerCase()):$})}function P(C){return V(C,function($){return D.test($)?"xn--"+_($):$})}if(r={version:"1.3.2",ucs2:{decode:k,encode:J},decode:g,encode:_,toASCII:P,toUnicode:v},o&&i)if(e.exports==o)i.exports=r;else for(B in r)r.hasOwnProperty(B)&&(o[B]=r[B]);else n.punycode=r})(We)}(Ct,Ct.exports)),Ct.exports}var Cn={exports:{}};/*!
9
+ * URI.js - Mutating URLs
10
+ * IPv6 Support
11
+ *
12
+ * Version: 1.19.11
13
+ *
14
+ * Author: Rodney Rehm
15
+ * Web: http://medialize.github.io/URI.js/
16
+ *
17
+ * Licensed under
18
+ * MIT License http://www.opensource.org/licenses/mit-license
19
+ *
20
+ */var Po;function ts(){return Po||(Po=1,function(e){(function(t,n){e.exports?e.exports=n():t.IPv6=n(t)})(We,function(t){var n=t&&t.IPv6;function o(s){var r=s.toLowerCase(),c=r.split(":"),u=c.length,y=8;c[0]===""&&c[1]===""&&c[2]===""?(c.shift(),c.shift()):c[0]===""&&c[1]===""?c.shift():c[u-1]===""&&c[u-2]===""&&c.pop(),u=c.length,c[u-1].indexOf(".")!==-1&&(y=7);var m;for(m=0;m<u&&c[m]!=="";m++);if(m<y)for(c.splice(m,1,"0000");c.length<y;)c.splice(m,0,"0000");for(var w,b=0;b<y;b++){w=c[b].split("");for(var O=0;O<3&&(w[0]==="0"&&w.length>1);O++)w.splice(0,1);c[b]=w.join("")}var R=-1,T=0,z=0,D=-1,q=!1;for(b=0;b<y;b++)q?c[b]==="0"?z+=1:(q=!1,z>T&&(R=D,T=z)):c[b]==="0"&&(q=!0,D=b,z=1);z>T&&(R=D,T=z),T>1&&c.splice(R,T,""),u=c.length;var x="";for(c[0]===""&&(x=":"),b=0;b<u&&(x+=c[b],b!==u-1);b++)x+=":";return c[u-1]===""&&(x+=":"),x}function i(){return t.IPv6===this&&(t.IPv6=n),this}return{best:o,noConflict:i}})}(Cn)),Cn.exports}var In={exports:{}};/*!
21
+ * URI.js - Mutating URLs
22
+ * Second Level Domain (SLD) Support
23
+ *
24
+ * Version: 1.19.11
25
+ *
26
+ * Author: Rodney Rehm
27
+ * Web: http://medialize.github.io/URI.js/
28
+ *
29
+ * Licensed under
30
+ * MIT License http://www.opensource.org/licenses/mit-license
31
+ *
32
+ */var Co;function ns(){return Co||(Co=1,function(e){(function(t,n){e.exports?e.exports=n():t.SecondLevelDomains=n(t)})(We,function(t){var n=t&&t.SecondLevelDomains,o={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(i){var s=i.lastIndexOf(".");if(s<=0||s>=i.length-1)return!1;var r=i.lastIndexOf(".",s-1);if(r<=0||r>=s-1)return!1;var c=o.list[i.slice(s+1)];return c?c.indexOf(" "+i.slice(r+1,s)+" ")>=0:!1},is:function(i){var s=i.lastIndexOf(".");if(s<=0||s>=i.length-1)return!1;var r=i.lastIndexOf(".",s-1);if(r>=0)return!1;var c=o.list[i.slice(s+1)];return c?c.indexOf(" "+i.slice(0,s)+" ")>=0:!1},get:function(i){var s=i.lastIndexOf(".");if(s<=0||s>=i.length-1)return null;var r=i.lastIndexOf(".",s-1);if(r<=0||r>=s-1)return null;var c=o.list[i.slice(s+1)];return!c||c.indexOf(" "+i.slice(r+1,s)+" ")<0?null:i.slice(r+1)},noConflict:function(){return t.SecondLevelDomains===this&&(t.SecondLevelDomains=n),this}};return o})}(In)),In.exports}/*!
33
+ * URI.js - Mutating URLs
34
+ *
35
+ * Version: 1.19.11
36
+ *
37
+ * Author: Rodney Rehm
38
+ * Web: http://medialize.github.io/URI.js/
39
+ *
40
+ * Licensed under
41
+ * MIT License http://www.opensource.org/licenses/mit-license
42
+ *
43
+ */(function(e){(function(t,n){e.exports?e.exports=n(es(),ts(),ns()):t.URI=n(t.punycode,t.IPv6,t.SecondLevelDomains,t)})(We,function(t,n,o,i){var s=i&&i.URI;function r(a,h){var l=arguments.length>=1,g=arguments.length>=2;if(!(this instanceof r))return l?g?new r(a,h):new r(a):new r;if(a===void 0){if(l)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?a=location.href+"":a=""}if(a===null&&l)throw new TypeError("null is not a valid argument for URI");return this.href(a),h!==void 0?this.absoluteTo(h):this}function c(a){return/^[0-9]+$/.test(a)}r.version="1.19.11";var u=r.prototype,y=Object.prototype.hasOwnProperty;function m(a){return a.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function w(a){return a===void 0?"Undefined":String(Object.prototype.toString.call(a)).slice(8,-1)}function b(a){return w(a)==="Array"}function O(a,h){var l={},g,_;if(w(h)==="RegExp")l=null;else if(b(h))for(g=0,_=h.length;g<_;g++)l[h[g]]=!0;else l[h]=!0;for(g=0,_=a.length;g<_;g++){var v=l&&l[a[g]]!==void 0||!l&&h.test(a[g]);v&&(a.splice(g,1),_--,g--)}return a}function R(a,h){var l,g;if(b(h)){for(l=0,g=h.length;l<g;l++)if(!R(a,h[l]))return!1;return!0}var _=w(h);for(l=0,g=a.length;l<g;l++)if(_==="RegExp"){if(typeof a[l]=="string"&&a[l].match(h))return!0}else if(a[l]===h)return!0;return!1}function T(a,h){if(!b(a)||!b(h)||a.length!==h.length)return!1;a.sort(),h.sort();for(var l=0,g=a.length;l<g;l++)if(a[l]!==h[l])return!1;return!0}function z(a){var h=/^\/+|\/+$/g;return a.replace(h,"")}r._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:r.preventInvalidHostname,duplicateQueryParameters:r.duplicateQueryParameters,escapeQuerySpace:r.escapeQuerySpace}},r.preventInvalidHostname=!1,r.duplicateQueryParameters=!1,r.escapeQuerySpace=!0,r.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,r.idn_expression=/[^a-z0-9\._-]/i,r.punycode_expression=/(xn--)/i,r.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,r.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,r.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,r.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},r.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,r.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,r.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},r.hostProtocols=["http","https"],r.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,r.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},r.getDomAttribute=function(a){if(!(!a||!a.nodeName)){var h=a.nodeName.toLowerCase();if(!(h==="input"&&a.type!=="image"))return r.domAttributes[h]}};function D(a){return escape(a)}function q(a){return encodeURIComponent(a).replace(/[!'()*]/g,D).replace(/\*/g,"%2A")}r.encode=q,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=q,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(a,h){var l=r.encode(a+"");return h===void 0&&(h=r.escapeQuerySpace),h?l.replace(/%20/g,"+"):l},r.decodeQuery=function(a,h){a+="",h===void 0&&(h=r.escapeQuerySpace);try{return r.decode(h?a.replace(/\+/g,"%20"):a)}catch{return a}};var x={encode:"encode",decode:"decode"},Y,N=function(a,h){return function(l){try{return r[h](l+"").replace(r.characters[a][h].expression,function(g){return r.characters[a][h].map[g]})}catch{return l}}};for(Y in x)r[Y+"PathSegment"]=N("pathname",x[Y]),r[Y+"UrnPathSegment"]=N("urnpath",x[Y]);var H=function(a,h,l){return function(g){var _;l?_=function($){return r[h](r[l]($))}:_=r[h];for(var v=(g+"").split(a),P=0,C=v.length;P<C;P++)v[P]=_(v[P]);return v.join(a)}};r.decodePath=H("/","decodePathSegment"),r.decodeUrnPath=H(":","decodeUrnPathSegment"),r.recodePath=H("/","encodePathSegment","decode"),r.recodeUrnPath=H(":","encodeUrnPathSegment","decode"),r.encodeReserved=N("reserved","encode"),r.parse=function(a,h){var l;return h||(h={preventInvalidHostname:r.preventInvalidHostname}),a=a.replace(r.leading_whitespace_expression,""),a=a.replace(r.ascii_tab_whitespace,""),l=a.indexOf("#"),l>-1&&(h.fragment=a.substring(l+1)||null,a=a.substring(0,l)),l=a.indexOf("?"),l>-1&&(h.query=a.substring(l+1)||null,a=a.substring(0,l)),a=a.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),a=a.replace(/^[/\\]{2,}/i,"//"),a.substring(0,2)==="//"?(h.protocol=null,a=a.substring(2),a=r.parseAuthority(a,h)):(l=a.indexOf(":"),l>-1&&(h.protocol=a.substring(0,l)||null,h.protocol&&!h.protocol.match(r.protocol_expression)?h.protocol=void 0:a.substring(l+1,l+3).replace(/\\/g,"/")==="//"?(a=a.substring(l+3),a=r.parseAuthority(a,h)):(a=a.substring(l+1),h.urn=!0))),h.path=a,h},r.parseHost=function(a,h){a||(a=""),a=a.replace(/\\/g,"/");var l=a.indexOf("/"),g,_;if(l===-1&&(l=a.length),a.charAt(0)==="[")g=a.indexOf("]"),h.hostname=a.substring(1,g)||null,h.port=a.substring(g+2,l)||null,h.port==="/"&&(h.port=null);else{var v=a.indexOf(":"),P=a.indexOf("/"),C=a.indexOf(":",v+1);C!==-1&&(P===-1||C<P)?(h.hostname=a.substring(0,l)||null,h.port=null):(_=a.substring(0,l).split(":"),h.hostname=_[0]||null,h.port=_[1]||null)}return h.hostname&&a.substring(l).charAt(0)!=="/"&&(l++,a="/"+a),h.preventInvalidHostname&&r.ensureValidHostname(h.hostname,h.protocol),h.port&&r.ensureValidPort(h.port),a.substring(l)||"/"},r.parseAuthority=function(a,h){return a=r.parseUserinfo(a,h),r.parseHost(a,h)},r.parseUserinfo=function(a,h){var l=a,g=a.indexOf("\\");g!==-1&&(a=a.replace(/\\/g,"/"));var _=a.indexOf("/"),v=a.lastIndexOf("@",_>-1?_:a.length-1),P;return v>-1&&(_===-1||v<_)?(P=a.substring(0,v).split(":"),h.username=P[0]?r.decode(P[0]):null,P.shift(),h.password=P[0]?r.decode(P.join(":")):null,a=l.substring(v+1)):(h.username=null,h.password=null),a},r.parseQuery=function(a,h){if(!a)return{};if(a=a.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!a)return{};for(var l={},g=a.split("&"),_=g.length,v,P,C,$=0;$<_;$++)v=g[$].split("="),P=r.decodeQuery(v.shift(),h),C=v.length?r.decodeQuery(v.join("="),h):null,P!=="__proto__"&&(y.call(l,P)?((typeof l[P]=="string"||l[P]===null)&&(l[P]=[l[P]]),l[P].push(C)):l[P]=C);return l},r.build=function(a){var h="",l=!1;return a.protocol&&(h+=a.protocol+":"),!a.urn&&(h||a.hostname)&&(h+="//",l=!0),h+=r.buildAuthority(a)||"",typeof a.path=="string"&&(a.path.charAt(0)!=="/"&&l&&(h+="/"),h+=a.path),typeof a.query=="string"&&a.query&&(h+="?"+a.query),typeof a.fragment=="string"&&a.fragment&&(h+="#"+a.fragment),h},r.buildHost=function(a){var h="";if(a.hostname)r.ip6_expression.test(a.hostname)?h+="["+a.hostname+"]":h+=a.hostname;else return"";return a.port&&(h+=":"+a.port),h},r.buildAuthority=function(a){return r.buildUserinfo(a)+r.buildHost(a)},r.buildUserinfo=function(a){var h="";return a.username&&(h+=r.encode(a.username)),a.password&&(h+=":"+r.encode(a.password)),h&&(h+="@"),h},r.buildQuery=function(a,h,l){var g="",_,v,P,C;for(v in a)if(v!=="__proto__"&&y.call(a,v))if(b(a[v]))for(_={},P=0,C=a[v].length;P<C;P++)a[v][P]!==void 0&&_[a[v][P]+""]===void 0&&(g+="&"+r.buildQueryParameter(v,a[v][P],l),h!==!0&&(_[a[v][P]+""]=!0));else a[v]!==void 0&&(g+="&"+r.buildQueryParameter(v,a[v],l));return g.substring(1)},r.buildQueryParameter=function(a,h,l){return r.encodeQuery(a,l)+(h!==null?"="+r.encodeQuery(h,l):"")},r.addQuery=function(a,h,l){if(typeof h=="object")for(var g in h)y.call(h,g)&&r.addQuery(a,g,h[g]);else if(typeof h=="string"){if(a[h]===void 0){a[h]=l;return}else typeof a[h]=="string"&&(a[h]=[a[h]]);b(l)||(l=[l]),a[h]=(a[h]||[]).concat(l)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(a,h,l){if(typeof h=="object")for(var g in h)y.call(h,g)&&r.setQuery(a,g,h[g]);else if(typeof h=="string")a[h]=l===void 0?null:l;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(a,h,l){var g,_,v;if(b(h))for(g=0,_=h.length;g<_;g++)a[h[g]]=void 0;else if(w(h)==="RegExp")for(v in a)h.test(v)&&(a[v]=void 0);else if(typeof h=="object")for(v in h)y.call(h,v)&&r.removeQuery(a,v,h[v]);else if(typeof h=="string")l!==void 0?w(l)==="RegExp"?!b(a[h])&&l.test(a[h])?a[h]=void 0:a[h]=O(a[h],l):a[h]===String(l)&&(!b(l)||l.length===1)?a[h]=void 0:b(a[h])&&(a[h]=O(a[h],l)):a[h]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(a,h,l,g){switch(w(h)){case"String":break;case"RegExp":for(var _ in a)if(y.call(a,_)&&h.test(_)&&(l===void 0||r.hasQuery(a,_,l)))return!0;return!1;case"Object":for(var v in h)if(y.call(h,v)&&!r.hasQuery(a,v,h[v]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(w(l)){case"Undefined":return h in a;case"Boolean":var P=!!(b(a[h])?a[h].length:a[h]);return l===P;case"Function":return!!l(a[h],h,a);case"Array":if(!b(a[h]))return!1;var C=g?R:T;return C(a[h],l);case"RegExp":return b(a[h])?g?R(a[h],l):!1:!!(a[h]&&a[h].match(l));case"Number":l=String(l);case"String":return b(a[h])?g?R(a[h],l):!1:a[h]===l;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var a=[],h=[],l=0,g=0;g<arguments.length;g++){var _=new r(arguments[g]);a.push(_);for(var v=_.segment(),P=0;P<v.length;P++)typeof v[P]=="string"&&h.push(v[P]),v[P]&&l++}if(!h.length||!l)return new r("");var C=new r("").segment(h);return(a[0].path()===""||a[0].path().slice(0,1)==="/")&&C.path("/"+C.path()),C.normalize()},r.commonPath=function(a,h){var l=Math.min(a.length,h.length),g;for(g=0;g<l;g++)if(a.charAt(g)!==h.charAt(g)){g--;break}return g<1?a.charAt(0)===h.charAt(0)&&a.charAt(0)==="/"?"/":"":((a.charAt(g)!=="/"||h.charAt(g)!=="/")&&(g=a.substring(0,g).lastIndexOf("/")),a.substring(0,g+1))},r.withinString=function(a,h,l){l||(l={});var g=l.start||r.findUri.start,_=l.end||r.findUri.end,v=l.trim||r.findUri.trim,P=l.parens||r.findUri.parens,C=/[a-z0-9-]=["']?$/i;for(g.lastIndex=0;;){var $=g.exec(a);if(!$)break;var X=$.index;if(l.ignoreHtml){var ee=a.slice(Math.max(X-3,0),X);if(ee&&C.test(ee))continue}for(var te=X+a.slice(X).search(_),ie=a.slice(X,te),ce=-1;;){var ue=P.exec(ie);if(!ue)break;var ye=ue.index+ue[0].length;ce=Math.max(ce,ye)}if(ce>-1?ie=ie.slice(0,ce)+ie.slice(ce).replace(v,""):ie=ie.replace(v,""),!(ie.length<=$[0].length)&&!(l.ignore&&l.ignore.test(ie))){te=X+ie.length;var he=h(ie,X,te,a);if(he===void 0){g.lastIndex=te;continue}he=String(he),a=a.slice(0,X)+he+a.slice(te),g.lastIndex=X+he.length}}return g.lastIndex=0,a},r.ensureValidHostname=function(a,h){var l=!!a,g=!!h,_=!1;if(g&&(_=R(r.hostProtocols,h)),_&&!l)throw new TypeError("Hostname cannot be empty, if protocol is "+h);if(a&&a.match(r.invalid_hostname_characters)){if(!t)throw new TypeError('Hostname "'+a+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(t.toASCII(a).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+a+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(a){if(a){var h=Number(a);if(!(c(h)&&h>0&&h<65536))throw new TypeError('Port "'+a+'" is not a valid port')}},r.noConflict=function(a){if(a){var h={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(h.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(h.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(h.SecondLevelDomains=i.SecondLevelDomains.noConflict()),h}else i.URI===this&&(i.URI=s);return this},u.build=function(a){return a===!0?this._deferred_build=!0:(a===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},u.clone=function(){return new r(this)},u.valueOf=u.toString=function(){return this.build(!1)._string};function B(a){return function(h,l){return h===void 0?this._parts[a]||"":(this._parts[a]=h||null,this.build(!l),this)}}function U(a,h){return function(l,g){return l===void 0?this._parts[a]||"":(l!==null&&(l=l+"",l.charAt(0)===h&&(l=l.substring(1))),this._parts[a]=l,this.build(!g),this)}}u.protocol=B("protocol"),u.username=B("username"),u.password=B("password"),u.hostname=B("hostname"),u.port=B("port"),u.query=U("query","?"),u.fragment=U("fragment","#"),u.search=function(a,h){var l=this.query(a,h);return typeof l=="string"&&l.length?"?"+l:l},u.hash=function(a,h){var l=this.fragment(a,h);return typeof l=="string"&&l.length?"#"+l:l},u.pathname=function(a,h){if(a===void 0||a===!0){var l=this._parts.path||(this._parts.hostname?"/":"");return a?(this._parts.urn?r.decodeUrnPath:r.decodePath)(l):l}else return this._parts.urn?this._parts.path=a?r.recodeUrnPath(a):"":this._parts.path=a?r.recodePath(a):"/",this.build(!h),this},u.path=u.pathname,u.href=function(a,h){var l;if(a===void 0)return this.toString();this._string="",this._parts=r._parts();var g=a instanceof r,_=typeof a=="object"&&(a.hostname||a.path||a.pathname);if(a.nodeName){var v=r.getDomAttribute(a);a=a[v]||"",_=!1}if(!g&&_&&a.pathname!==void 0&&(a=a.toString()),typeof a=="string"||a instanceof String)this._parts=r.parse(String(a),this._parts);else if(g||_){var P=g?a._parts:a;for(l in P)l!=="query"&&y.call(this._parts,l)&&(this._parts[l]=P[l]);P.query&&this.query(P.query,!1)}else throw new TypeError("invalid input");return this.build(!h),this},u.is=function(a){var h=!1,l=!1,g=!1,_=!1,v=!1,P=!1,C=!1,$=!this._parts.urn;switch(this._parts.hostname&&($=!1,l=r.ip4_expression.test(this._parts.hostname),g=r.ip6_expression.test(this._parts.hostname),h=l||g,_=!h,v=_&&o&&o.has(this._parts.hostname),P=_&&r.idn_expression.test(this._parts.hostname),C=_&&r.punycode_expression.test(this._parts.hostname)),a.toLowerCase()){case"relative":return $;case"absolute":return!$;case"domain":case"name":return _;case"sld":return v;case"ip":return h;case"ip4":case"ipv4":case"inet4":return l;case"ip6":case"ipv6":case"inet6":return g;case"idn":return P;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return C}return null};var G=u.protocol,V=u.port,k=u.hostname;u.protocol=function(a,h){if(a&&(a=a.replace(/:(\/\/)?$/,""),!a.match(r.protocol_expression)))throw new TypeError('Protocol "'+a+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return G.call(this,a,h)},u.scheme=u.protocol,u.port=function(a,h){return this._parts.urn?a===void 0?"":this:(a!==void 0&&(a===0&&(a=null),a&&(a+="",a.charAt(0)===":"&&(a=a.substring(1)),r.ensureValidPort(a))),V.call(this,a,h))},u.hostname=function(a,h){if(this._parts.urn)return a===void 0?"":this;if(a!==void 0){var l={preventInvalidHostname:this._parts.preventInvalidHostname},g=r.parseHost(a,l);if(g!=="/")throw new TypeError('Hostname "'+a+'" contains characters other than [A-Z0-9.-]');a=l.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(a,this._parts.protocol)}return k.call(this,a,h)},u.origin=function(a,h){if(this._parts.urn)return a===void 0?"":this;if(a===void 0){var l=this.protocol(),g=this.authority();return g?(l?l+"://":"")+this.authority():""}else{var _=r(a);return this.protocol(_.protocol()).authority(_.authority()).build(!h),this}},u.host=function(a,h){if(this._parts.urn)return a===void 0?"":this;if(a===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var l=r.parseHost(a,this._parts);if(l!=="/")throw new TypeError('Hostname "'+a+'" contains characters other than [A-Z0-9.-]');return this.build(!h),this},u.authority=function(a,h){if(this._parts.urn)return a===void 0?"":this;if(a===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var l=r.parseAuthority(a,this._parts);if(l!=="/")throw new TypeError('Hostname "'+a+'" contains characters other than [A-Z0-9.-]');return this.build(!h),this},u.userinfo=function(a,h){if(this._parts.urn)return a===void 0?"":this;if(a===void 0){var l=r.buildUserinfo(this._parts);return l&&l.substring(0,l.length-1)}else return a[a.length-1]!=="@"&&(a+="@"),r.parseUserinfo(a,this._parts),this.build(!h),this},u.resource=function(a,h){var l;return a===void 0?this.path()+this.search()+this.hash():(l=r.parse(a),this._parts.path=l.path,this._parts.query=l.query,this._parts.fragment=l.fragment,this.build(!h),this)},u.subdomain=function(a,h){if(this._parts.urn)return a===void 0?"":this;if(a===void 0){if(!this._parts.hostname||this.is("IP"))return"";var l=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,l)||""}else{var g=this._parts.hostname.length-this.domain().length,_=this._parts.hostname.substring(0,g),v=new RegExp("^"+m(_));if(a&&a.charAt(a.length-1)!=="."&&(a+="."),a.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return a&&r.ensureValidHostname(a,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(v,a),this.build(!h),this}},u.domain=function(a,h){if(this._parts.urn)return a===void 0?"":this;if(typeof a=="boolean"&&(h=a,a=void 0),a===void 0){if(!this._parts.hostname||this.is("IP"))return"";var l=this._parts.hostname.match(/\./g);if(l&&l.length<2)return this._parts.hostname;var g=this._parts.hostname.length-this.tld(h).length-1;return g=this._parts.hostname.lastIndexOf(".",g-1)+1,this._parts.hostname.substring(g)||""}else{if(!a)throw new TypeError("cannot set domain empty");if(a.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(a,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=a;else{var _=new RegExp(m(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(_,a)}return this.build(!h),this}},u.tld=function(a,h){if(this._parts.urn)return a===void 0?"":this;if(typeof a=="boolean"&&(h=a,a=void 0),a===void 0){if(!this._parts.hostname||this.is("IP"))return"";var l=this._parts.hostname.lastIndexOf("."),g=this._parts.hostname.substring(l+1);return h!==!0&&o&&o.list[g.toLowerCase()]&&o.get(this._parts.hostname)||g}else{var _;if(a)if(a.match(/[^a-zA-Z0-9-]/))if(o&&o.is(a))_=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(_,a);else throw new TypeError('TLD "'+a+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");_=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(_,a)}else throw new TypeError("cannot set TLD empty");return this.build(!h),this}},u.directory=function(a,h){if(this._parts.urn)return a===void 0?"":this;if(a===void 0||a===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var l=this._parts.path.length-this.filename().length-1,g=this._parts.path.substring(0,l)||(this._parts.hostname?"/":"");return a?r.decodePath(g):g}else{var _=this._parts.path.length-this.filename().length,v=this._parts.path.substring(0,_),P=new RegExp("^"+m(v));return this.is("relative")||(a||(a="/"),a.charAt(0)!=="/"&&(a="/"+a)),a&&a.charAt(a.length-1)!=="/"&&(a+="/"),a=r.recodePath(a),this._parts.path=this._parts.path.replace(P,a),this.build(!h),this}},u.filename=function(a,h){if(this._parts.urn)return a===void 0?"":this;if(typeof a!="string"){if(!this._parts.path||this._parts.path==="/")return"";var l=this._parts.path.lastIndexOf("/"),g=this._parts.path.substring(l+1);return a?r.decodePathSegment(g):g}else{var _=!1;a.charAt(0)==="/"&&(a=a.substring(1)),a.match(/\.?\//)&&(_=!0);var v=new RegExp(m(this.filename())+"$");return a=r.recodePath(a),this._parts.path=this._parts.path.replace(v,a),_?this.normalizePath(h):this.build(!h),this}},u.suffix=function(a,h){if(this._parts.urn)return a===void 0?"":this;if(a===void 0||a===!0){if(!this._parts.path||this._parts.path==="/")return"";var l=this.filename(),g=l.lastIndexOf("."),_,v;return g===-1?"":(_=l.substring(g+1),v=/^[a-z0-9%]+$/i.test(_)?_:"",a?r.decodePathSegment(v):v)}else{a.charAt(0)==="."&&(a=a.substring(1));var P=this.suffix(),C;if(P)a?C=new RegExp(m(P)+"$"):C=new RegExp(m("."+P)+"$");else{if(!a)return this;this._parts.path+="."+r.recodePath(a)}return C&&(a=r.recodePath(a),this._parts.path=this._parts.path.replace(C,a)),this.build(!h),this}},u.segment=function(a,h,l){var g=this._parts.urn?":":"/",_=this.path(),v=_.substring(0,1)==="/",P=_.split(g);if(a!==void 0&&typeof a!="number"&&(l=h,h=a,a=void 0),a!==void 0&&typeof a!="number")throw new Error('Bad segment "'+a+'", must be 0-based integer');if(v&&P.shift(),a<0&&(a=Math.max(P.length+a,0)),h===void 0)return a===void 0?P:P[a];if(a===null||P[a]===void 0)if(b(h)){P=[];for(var C=0,$=h.length;C<$;C++)!h[C].length&&(!P.length||!P[P.length-1].length)||(P.length&&!P[P.length-1].length&&P.pop(),P.push(z(h[C])))}else(h||typeof h=="string")&&(h=z(h),P[P.length-1]===""?P[P.length-1]=h:P.push(h));else h?P[a]=z(h):P.splice(a,1);return v&&P.unshift(""),this.path(P.join(g),l)},u.segmentCoded=function(a,h,l){var g,_,v;if(typeof a!="number"&&(l=h,h=a,a=void 0),h===void 0){if(g=this.segment(a,h,l),!b(g))g=g!==void 0?r.decode(g):void 0;else for(_=0,v=g.length;_<v;_++)g[_]=r.decode(g[_]);return g}if(!b(h))h=typeof h=="string"||h instanceof String?r.encode(h):h;else for(_=0,v=h.length;_<v;_++)h[_]=r.encode(h[_]);return this.segment(a,h,l)};var J=u.query;return u.query=function(a,h){if(a===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof a=="function"){var l=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),g=a.call(this,l);return this._parts.query=r.buildQuery(g||l,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!h),this}else return a!==void 0&&typeof a!="string"?(this._parts.query=r.buildQuery(a,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!h),this):J.call(this,a,h)},u.setQuery=function(a,h,l){var g=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof a=="string"||a instanceof String)g[a]=h!==void 0?h:null;else if(typeof a=="object")for(var _ in a)y.call(a,_)&&(g[_]=a[_]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(g,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof a!="string"&&(l=h),this.build(!l),this},u.addQuery=function(a,h,l){var g=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(g,a,h===void 0?null:h),this._parts.query=r.buildQuery(g,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof a!="string"&&(l=h),this.build(!l),this},u.removeQuery=function(a,h,l){var g=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(g,a,h),this._parts.query=r.buildQuery(g,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof a!="string"&&(l=h),this.build(!l),this},u.hasQuery=function(a,h,l){var g=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(g,a,h,l)},u.setSearch=u.setQuery,u.addSearch=u.addQuery,u.removeSearch=u.removeQuery,u.hasSearch=u.hasQuery,u.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},u.normalizeProtocol=function(a){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!a)),this},u.normalizeHostname=function(a){return this._parts.hostname&&(this.is("IDN")&&t?this._parts.hostname=t.toASCII(this._parts.hostname):this.is("IPv6")&&n&&(this._parts.hostname=n.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!a)),this},u.normalizePort=function(a){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!a)),this},u.normalizePath=function(a){var h=this._parts.path;if(!h)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!a),this;if(this._parts.path==="/")return this;h=r.recodePath(h);var l,g="",_,v;for(h.charAt(0)!=="/"&&(l=!0,h="/"+h),(h.slice(-3)==="/.."||h.slice(-2)==="/.")&&(h+="/"),h=h.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),l&&(g=h.substring(1).match(/^(\.\.\/)+/)||"",g&&(g=g[0]));_=h.search(/\/\.\.(\/|$)/),_!==-1;){if(_===0){h=h.substring(3);continue}v=h.substring(0,_).lastIndexOf("/"),v===-1&&(v=_),h=h.substring(0,v)+h.substring(_+3)}return l&&this.is("relative")&&(h=g+h.substring(1)),this._parts.path=h,this.build(!a),this},u.normalizePathname=u.normalizePath,u.normalizeQuery=function(a){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(r.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!a)),this},u.normalizeFragment=function(a){return this._parts.fragment||(this._parts.fragment=null,this.build(!a)),this},u.normalizeSearch=u.normalizeQuery,u.normalizeHash=u.normalizeFragment,u.iso8859=function(){var a=r.encode,h=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=a,r.decode=h}return this},u.unicode=function(){var a=r.encode,h=r.decode;r.encode=q,r.decode=unescape;try{this.normalize()}finally{r.encode=a,r.decode=h}return this},u.readable=function(){var a=this.clone();a.username("").password("").normalize();var h="";if(a._parts.protocol&&(h+=a._parts.protocol+"://"),a._parts.hostname&&(a.is("punycode")&&t?(h+=t.toUnicode(a._parts.hostname),a._parts.port&&(h+=":"+a._parts.port)):h+=a.host()),a._parts.hostname&&a._parts.path&&a._parts.path.charAt(0)!=="/"&&(h+="/"),h+=a.path(!0),a._parts.query){for(var l="",g=0,_=a._parts.query.split("&"),v=_.length;g<v;g++){var P=(_[g]||"").split("=");l+="&"+r.decodeQuery(P[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),P[1]!==void 0&&(l+="="+r.decodeQuery(P[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}h+="?"+l.substring(1)}return h+=r.decodeQuery(a.hash(),!0),h},u.absoluteTo=function(a){var h=this.clone(),l=["protocol","username","password","hostname","port"],g,_,v;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(a instanceof r||(a=new r(a)),h._parts.protocol||(h._parts.protocol=a._parts.protocol,this._parts.hostname))return h;for(_=0;v=l[_];_++)h._parts[v]=a._parts[v];return h._parts.path?(h._parts.path.substring(-2)===".."&&(h._parts.path+="/"),h.path().charAt(0)!=="/"&&(g=a.directory(),g=g||(a.path().indexOf("/")===0?"/":""),h._parts.path=(g?g+"/":"")+h._parts.path,h.normalizePath())):(h._parts.path=a._parts.path,h._parts.query||(h._parts.query=a._parts.query)),h.build(),h},u.relativeTo=function(a){var h=this.clone().normalize(),l,g,_,v,P;if(h._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(a=new r(a).normalize(),l=h._parts,g=a._parts,v=h.path(),P=a.path(),v.charAt(0)!=="/")throw new Error("URI is already relative");if(P.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(l.protocol===g.protocol&&(l.protocol=null),l.username!==g.username||l.password!==g.password||l.protocol!==null||l.username!==null||l.password!==null)return h.build();if(l.hostname===g.hostname&&l.port===g.port)l.hostname=null,l.port=null;else return h.build();if(v===P)return l.path="",h.build();if(_=r.commonPath(v,P),!_)return h.build();var C=g.path.substring(_.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return l.path=C+l.path.substring(_.length)||"./",h.build()},u.equals=function(a){var h=this.clone(),l=new r(a),g={},_={},v={},P,C,$;if(h.normalize(),l.normalize(),h.toString()===l.toString())return!0;if(P=h.query(),C=l.query(),h.query(""),l.query(""),h.toString()!==l.toString()||P.length!==C.length)return!1;g=r.parseQuery(P,this._parts.escapeQuerySpace),_=r.parseQuery(C,this._parts.escapeQuerySpace);for($ in g)if(y.call(g,$)){if(b(g[$])){if(!T(g[$],_[$]))return!1}else if(g[$]!==_[$])return!1;v[$]=!0}for($ in _)if(y.call(_,$)&&!v[$])return!1;return!0},u.preventInvalidHostname=function(a){return this._parts.preventInvalidHostname=!!a,this},u.duplicateQueryParameters=function(a){return this._parts.duplicateQueryParameters=!!a,this},u.escapeQuerySpace=function(a){return this._parts.escapeQuerySpace=!!a,this},r})})(ai);var os=ai.exports;const Ke=Et(os);function $t(e,t){let n;return typeof document<"u"&&(n=document),$t._implementation(e,t,n)}$t._implementation=function(e,t,n){if(!d(e))throw new E("relative uri is required.");if(!d(t)){if(typeof n>"u")return e;t=j(n.baseURI,n.location.href)}const o=new Ke(e);return o.scheme()!==""?o.toString():o.absoluteTo(t).toString()};function is(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}function bt(e,t){if(e===null||typeof e!="object")return e;t=j(t,!1);const n=new e.constructor;for(const o in e)if(e.hasOwnProperty(o)){let i=e[o];t&&(i=bt(i,t)),n[o]=i}return n}function Je(e,t,n){n=j(n,!1);const o={},i=d(e),s=d(t);let r,c,u;if(i)for(r in e)e.hasOwnProperty(r)&&(c=e[r],s&&n&&typeof c=="object"&&t.hasOwnProperty(r)?(u=t[r],typeof u=="object"?o[r]=Je(c,u,n):o[r]=c):o[r]=c);if(s)for(r in t)t.hasOwnProperty(r)&&!o.hasOwnProperty(r)&&(u=t[r],o[r]=u);return o}function Ht(){let e,t;const n=new Promise(function(o,i){e=o,t=i});return{resolve:e,reject:t,promise:n}}function rs(e,t){if(!d(e))throw new E("uri is required.");let n="";const o=e.lastIndexOf("/");return o!==-1&&(n=e.substring(0,o+1)),t&&(e=new Ke(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}function ss(e){if(!d(e))throw new E("uri is required.");const t=new Ke(e);t.normalize();let n=t.path(),o=n.lastIndexOf("/");return o!==-1&&(n=n.substr(o+1)),o=n.lastIndexOf("."),o===-1?n="":n=n.substr(o+1),n}const Io={};function qo(e,t,n){d(t)||(t=e.width),d(n)||(n=e.height);let o=Io[t];d(o)||(o={},Io[t]=o);let i=o[n];if(!d(i)){const s=document.createElement("canvas");s.width=t,s.height=n,i=s.getContext("2d",{willReadFrequently:!0}),i.globalCompositeOperation="copy",o[n]=i}return i.drawImage(e,0,0,t,n),i.getImageData(0,0,t,n).data}const cs=/^blob:/i;function fi(e){return f.typeOf.string("uri",e),cs.test(e)}let $e;function as(e){d($e)||($e=document.createElement("a")),$e.href=window.location.href;const t=$e.host,n=$e.protocol;return $e.href=e,$e.href=$e.href,n!==$e.protocol||t!==$e.host}const fs=/^data:/i;function ui(e){return f.typeOf.string("uri",e),fs.test(e)}function us(e){const t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,o)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");const i=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,i.removeChild(t),n()},t.onerror=function(s){o(s)},i.appendChild(t)})}function hs(e){if(!d(e))throw new E("obj is required.");let t="";for(const n in e)if(e.hasOwnProperty(n)){const o=e[n],i=`${encodeURIComponent(n)}=`;if(Array.isArray(o))for(let s=0,r=o.length;s<r;++s)t+=`${i+encodeURIComponent(o[s])}&`;else t+=`${i+encodeURIComponent(o)}&`}return t=t.slice(0,-1),t}function ds(e){if(!d(e))throw new E("queryString is required.");const t={};if(e==="")return t;const n=e.replace(/\+/g,"%20").split(/[&;]/);for(let o=0,i=n.length;o<i;++o){const s=n[o].split("="),r=decodeURIComponent(s[0]);let c=s[1];d(c)?c=decodeURIComponent(c):c="";const u=t[r];typeof u=="string"?t[r]=[u,c]:Array.isArray(u)?u.push(c):t[r]=c}return t}const ps={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},ge=Object.freeze(ps),ls={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},ms=Object.freeze(ls);function bn(e){e=j(e,j.EMPTY_OBJECT);const t=j(e.throttleByServer,!1),n=j(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=j(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=j(e.type,ms.OTHER),this.serverKey=e.serverKey,this.state=ge.UNISSUED,this.deferred=void 0,this.cancelled=!1}bn.prototype.cancel=function(){this.cancelled=!0};bn.prototype.clone=function(e){return d(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=ge.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new bn(this)};function ys(e){const t={};if(!e)return t;const n=e.split(`\r
44
+ `);for(let o=0;o<n.length;++o){const i=n[o],s=i.indexOf(": ");if(s>0){const r=i.substring(0,s),c=i.substring(s+2);t[r]=c}}return t}function Ft(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=ys(this.responseHeaders))}Ft.prototype.toString=function(){let e="Request has failed.";return d(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};function Qt(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(Qt.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});Qt.prototype.addEventListener=function(e,t){f.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);const n=this;return function(){n.removeEventListener(e,t)}};Qt.prototype.removeEventListener=function(e,t){f.typeOf.func("listener",e);const n=this._listeners,o=this._scopes;let i=-1;for(let s=0;s<n.length;s++)if(n[s]===e&&o[s]===t){i=s;break}return i!==-1?(this._insideRaiseEvent?(this._toRemove.push(i),n[i]=void 0,o[i]=void 0):(n.splice(i,1),o.splice(i,1)),!0):!1};function ws(e,t){return t-e}Qt.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e;const t=this._listeners,n=this._scopes;let o=t.length;for(e=0;e<o;e++){const s=t[e];d(s)&&t[e].apply(n[e],arguments)}const i=this._toRemove;if(o=i.length,o>0){for(i.sort(ws),e=0;e<o;e++){const s=i[e];t.splice(s,1),n.splice(s,1)}i.length=0}this._insideRaiseEvent=!1};function ct(e){f.typeOf.object("options",e),f.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(ct.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){f.typeOf.number.greaterThanOrEquals("maximumLength",e,0);const t=this._length;if(e<t){const n=this._array;for(let o=e;o<t;++o)n[o]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function ao(e,t,n){const o=e[t];e[t]=e[n],e[n]=o}ct.prototype.reserve=function(e){e=j(e,this._length),this._array.length=e};ct.prototype.heapify=function(e){e=j(e,0);const t=this._length,n=this._comparator,o=this._array;let i=-1,s=!0;for(;s;){const r=2*(e+1),c=r-1;c<t&&n(o[c],o[e])<0?i=c:i=e,r<t&&n(o[r],o[i])<0&&(i=r),i!==e?(ao(o,i,e),e=i):s=!1}};ct.prototype.resort=function(){const e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};ct.prototype.insert=function(e){f.defined("element",e);const t=this._array,n=this._comparator,o=this._maximumLength;let i=this._length++;for(i<t.length?t[i]=e:t.push(e);i!==0;){const r=Math.floor((i-1)/2);if(n(t[i],t[r])<0)ao(t,i,r),i=r;else break}let s;return d(o)&&this._length>o&&(s=t[o],this._length=o),s};ct.prototype.pop=function(e){if(e=j(e,0),this._length===0)return;f.typeOf.number.lessThan("index",e,this._length);const t=this._array,n=t[e];return ao(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};function gs(e,t){return e.priority-t.priority}const ae={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0};let Ot=20;const Re=new ct({comparator:gs});Re.maximumLength=Ot;Re.reserve(Ot);const Fe=[];let He={};const bs=typeof document<"u"?new Ke(document.location.href):new Ke,vn=new Qt;function de(){}de.maximumRequests=50;de.maximumRequestsPerServer=18;de.requestsByServer={};de.throttleRequests=!0;de.debugShowStatistics=!1;de.requestCompletedEvent=vn;Object.defineProperties(de,{statistics:{get:function(){return ae}},priorityHeapLength:{get:function(){return Ot},set:function(e){if(e<Ot)for(;Re.length>e;){const t=Re.pop();rt(t)}Ot=e,Re.maximumLength=e,Re.reserve(e)}}});function hi(e){d(e.priorityFunction)&&(e.priority=e.priorityFunction())}de.serverHasOpenSlots=function(e,t){t=j(t,1);const n=j(de.requestsByServer[e],de.maximumRequestsPerServer);return He[e]+t<=n};de.heapHasOpenSlots=function(e){return Re.length+e<=Ot};function di(e){return e.state===ge.UNISSUED&&(e.state=ge.ISSUED,e.deferred=Ht()),e.deferred.promise}function Os(e){return function(t){if(e.state===ge.CANCELLED)return;const n=e.deferred;--ae.numberOfActiveRequests,--He[e.serverKey],vn.raiseEvent(),e.state=ge.RECEIVED,e.deferred=void 0,n.resolve(t)}}function _s(e){return function(t){e.state!==ge.CANCELLED&&(++ae.numberOfFailedRequests,--ae.numberOfActiveRequests,--He[e.serverKey],vn.raiseEvent(t),e.state=ge.FAILED,e.deferred.reject(t))}}function pi(e){const t=di(e);return e.state=ge.ACTIVE,Fe.push(e),++ae.numberOfActiveRequests,++ae.numberOfActiveRequestsEver,++He[e.serverKey],e.requestFunction().then(Os(e)).catch(_s(e)),t}function rt(e){const t=e.state===ge.ACTIVE;if(e.state=ge.CANCELLED,++ae.numberOfCancelledRequests,d(e.deferred)){const n=e.deferred;e.deferred=void 0,n.reject()}t&&(--ae.numberOfActiveRequests,--He[e.serverKey],++ae.numberOfCancelledActiveRequests),d(e.cancelFunction)&&e.cancelFunction()}de.update=function(){let e,t,n=0;const o=Fe.length;for(e=0;e<o;++e){if(t=Fe[e],t.cancelled&&rt(t),t.state!==ge.ACTIVE){++n;continue}n>0&&(Fe[e-n]=t)}Fe.length-=n;const i=Re.internalArray,s=Re.length;for(e=0;e<s;++e)hi(i[e]);Re.resort();const r=Math.max(de.maximumRequests-Fe.length,0);let c=0;for(;c<r&&Re.length>0;){if(t=Re.pop(),t.cancelled){rt(t);continue}if(t.throttleByServer&&!de.serverHasOpenSlots(t.serverKey)){rt(t);continue}pi(t),++c}Ss()};de.getServerKey=function(e){f.typeOf.string("url",e);let t=new Ke(e);t.scheme()===""&&(t=t.absoluteTo(bs),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);const o=He[n];return d(o)||(He[n]=0),n};de.request=function(e){if(f.typeOf.object("request",e),f.typeOf.string("request.url",e.url),f.typeOf.func("request.requestFunction",e.requestFunction),ui(e.url)||fi(e.url))return vn.raiseEvent(),e.state=ge.RECEIVED,e.requestFunction();if(++ae.numberOfAttemptedRequests,d(e.serverKey)||(e.serverKey=de.getServerKey(e.url)),de.throttleRequests&&e.throttleByServer&&!de.serverHasOpenSlots(e.serverKey))return;if(!de.throttleRequests||!e.throttle)return pi(e);if(Fe.length>=de.maximumRequests)return;hi(e);const t=Re.insert(e);if(d(t)){if(t===e)return;rt(t)}return di(e)};function Ss(){de.debugShowStatistics&&(ae.numberOfActiveRequests===0&&ae.lastNumberOfActiveRequests>0&&(ae.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${ae.numberOfAttemptedRequests}`),ae.numberOfAttemptedRequests=0),ae.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${ae.numberOfCancelledRequests}`),ae.numberOfCancelledRequests=0),ae.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${ae.numberOfCancelledActiveRequests}`),ae.numberOfCancelledActiveRequests=0),ae.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${ae.numberOfFailedRequests}`),ae.numberOfFailedRequests=0)),ae.lastNumberOfActiveRequests=ae.numberOfActiveRequests)}de.clearForSpecs=function(){for(;Re.length>0;){const t=Re.pop();rt(t)}const e=Fe.length;for(let t=0;t<e;++t)rt(Fe[t]);Fe.length=0,He={},ae.numberOfAttemptedRequests=0,ae.numberOfActiveRequests=0,ae.numberOfCancelledRequests=0,ae.numberOfCancelledActiveRequests=0,ae.numberOfFailedRequests=0,ae.numberOfActiveRequestsEver=0,ae.lastNumberOfActiveRequests=0};de.numberOfActiveRequestsByServer=function(e){return He[e]};de.requestHeap=Re;const Rt={};let _t={};Rt.add=function(e,t){if(!d(e))throw new E("host is required.");if(!d(t)||t<=0)throw new E("port is required to be greater than 0.");const n=`${e.toLowerCase()}:${t}`;d(_t[n])||(_t[n]=!0)};Rt.remove=function(e,t){if(!d(e))throw new E("host is required.");if(!d(t)||t<=0)throw new E("port is required to be greater than 0.");const n=`${e.toLowerCase()}:${t}`;d(_t[n])&&delete _t[n]};function vs(e){const t=new Ke(e);t.normalize();let n=t.authority();if(n.length!==0){if(t.authority(n),n.indexOf("@")!==-1&&(n=n.split("@")[1]),n.indexOf(":")===-1){let o=t.scheme();if(o.length===0&&(o=window.location.protocol,o=o.substring(0,o.length-1)),o==="http")n+=":80";else if(o==="https")n+=":443";else return}return n}}Rt.contains=function(e){if(!d(e))throw new E("url is required.");const t=vs(e);return!!(d(t)&&d(_t[t]))};Rt.clear=function(){_t={}};const li=function(){try{const e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function W(e){e=j(e,j.EMPTY_OBJECT),typeof e=="string"&&(e={url:e}),f.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=Le(e.templateValues,{}),this._queryParameters=Le(e.queryParameters,{}),this.headers=Le(e.headers,{}),this.request=j(e.request,new bn),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=j(e.retryAttempts,0),this._retryCount=0,j(e.parseUrl,!0)?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function Le(e,t){return d(e)?bt(e):t}W.createIfNeeded=function(e){return e instanceof W?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new W({url:e})};let pt;W.supportsImageBitmapOptions=function(){return d(pt)?pt:typeof createImageBitmap!="function"?(pt=Promise.resolve(!1),pt):(pt=W.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(t){const n={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(t,n),createImageBitmap(t)])}).then(function(t){const n=qo(t[0]),o=qo(t[1]);return n[1]!==o[1]}).catch(function(){return!1}),pt)};Object.defineProperties(W,{isBlobSupported:{get:function(){return li}}});Object.defineProperties(W.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return ss(this._url)}},isDataUri:{get:function(){return ui(this._url)}},isBlobUri:{get:function(){return fi(this._url)}},isCrossOriginUrl:{get:function(){return as(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});W.prototype.toString=function(){return this.getUrlComponent(!0,!0)};W.prototype.parseUrl=function(e,t,n,o){let i=new Ke(e);const s=Es(i.query());this._queryParameters=t?On(s,this.queryParameters,n):s,i.search(""),i.fragment(""),d(o)&&i.scheme()===""&&(i=i.absoluteTo($t(o))),this._url=i.toString()};function Es(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:ds(e)}function On(e,t,n){if(!n)return Je(e,t);const o=bt(e,!0);for(const i in t)if(t.hasOwnProperty(i)){let s=o[i];const r=t[i];d(s)?(Array.isArray(s)||(s=o[i]=[s]),o[i]=s.concat(r)):o[i]=Array.isArray(r)?r.slice():r}return o}W.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${Ts(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");const o=this._templateValues;return Object.keys(o).length>0&&(n=n.replace(/{(.*?)}/g,function(i,s){const r=o[s];return d(r)?encodeURIComponent(r):i})),t&&d(this.proxy)&&(n=this.proxy.getURL(n)),n};function Ts(e){const t=Object.keys(e);return t.length===0?"":t.length===1&&!d(e[t[0]])?`?${t[0]}`:`?${hs(e)}`}W.prototype.setQueryParameters=function(e,t){t?this._queryParameters=On(this._queryParameters,e,!1):this._queryParameters=On(e,this._queryParameters,!1)};W.prototype.appendQueryParameters=function(e){this._queryParameters=On(e,this._queryParameters,!0)};W.prototype.setTemplateValues=function(e,t){t?this._templateValues=Je(this._templateValues,e):this._templateValues=Je(e,this._templateValues)};W.prototype.getDerivedResource=function(e){const t=this.clone();if(t._retryCount=0,d(e.url)){const n=j(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,n,this._url)}return d(e.queryParameters)&&(t._queryParameters=Je(e.queryParameters,t.queryParameters)),d(e.templateValues)&&(t._templateValues=Je(e.templateValues,t.templateValues)),d(e.headers)&&(t.headers=Je(e.headers,t.headers)),d(e.proxy)&&(t.proxy=e.proxy),d(e.request)&&(t.request=e.request),d(e.retryCallback)&&(t.retryCallback=e.retryCallback),d(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};W.prototype.retryOnError=function(e){const t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);const n=this;return Promise.resolve(t(this,e)).then(function(o){return++n._retryCount,o})};W.prototype.clone=function(e){return d(e)?(e._url=this._url,e._queryParameters=bt(this._queryParameters),e._templateValues=bt(this._templateValues),e.headers=bt(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new W({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:d(this.credits)?this.credits.slice():void 0})};W.prototype.getBaseUri=function(e){return rs(this.getUrlComponent(e),e)};W.prototype.appendForwardSlash=function(){this._url=is(this._url)};W.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};W.fetchArrayBuffer=function(e){return new W(e).fetchArrayBuffer()};W.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};W.fetchBlob=function(e){return new W(e).fetchBlob()};W.prototype.fetchImage=function(e){e=j(e,j.EMPTY_OBJECT);const t=j(e.preferImageBitmap,!1),n=j(e.preferBlob,!1),o=j(e.flipY,!1),i=j(e.skipColorSpaceConversion,!1);if(fo(this.request),!li||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return Jn({resource:this,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:t});const s=this.fetchBlob();if(!d(s))return;let r,c,u,y;return W.supportsImageBitmapOptions().then(function(m){return r=m,c=r&&t,s}).then(function(m){if(!d(m))return;if(y=m,c)return W.createImageBitmapFromBlob(m,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});const w=window.URL.createObjectURL(m);return u=new W({url:w}),Jn({resource:u,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:!1})}).then(function(m){if(d(m))return m.blob=y,c||window.URL.revokeObjectURL(u.url),m}).catch(function(m){return d(u)&&window.URL.revokeObjectURL(u.url),m.blob=y,Promise.reject(m)})};function Jn(e){const t=e.resource,n=e.flipY,o=e.skipColorSpaceConversion,i=e.preferImageBitmap,s=t.request;s.url=t.url,s.requestFunction=function(){let c=!1;!t.isDataUri&&!t.isBlobUri&&(c=t.isCrossOriginUrl);const u=Ht();return W._Implementations.createImage(s,c,u,n,o,i),u.promise};const r=de.request(s);if(d(r))return r.catch(function(c){return s.state!==ge.FAILED?Promise.reject(c):t.retryOnError(c).then(function(u){return u?(s.state=ge.UNISSUED,s.deferred=void 0,Jn({resource:t,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:i})):Promise.reject(c)})})}W.fetchImage=function(e){return new W(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};W.prototype.fetchText=function(){return this.fetch({responseType:"text"})};W.fetchText=function(e){return new W(e).fetchText()};W.prototype.fetchJson=function(){const e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(d(e))return e.then(function(t){if(d(t))return JSON.parse(t)})};W.fetchJson=function(e){return new W(e).fetchJson()};W.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};W.fetchXML=function(e){return new W(e).fetchXML()};W.prototype.fetchJsonp=function(e){e=j(e,"callback"),fo(this.request);let t;do t=`loadJsonp${S.nextRandomNumber().toString().substring(2,8)}`;while(d(window[t]));return mi(this,e,t)};function mi(e,t,n){const o={};o[t]=n,e.setQueryParameters(o);const i=e.request,s=e.url;i.url=s,i.requestFunction=function(){const c=Ht();return window[n]=function(u){c.resolve(u);try{delete window[n]}catch{window[n]=void 0}},W._Implementations.loadAndExecuteScript(s,n,c),c.promise};const r=de.request(i);if(d(r))return r.catch(function(c){return i.state!==ge.FAILED?Promise.reject(c):e.retryOnError(c).then(function(u){return u?(i.state=ge.UNISSUED,i.deferred=void 0,mi(e,t,n)):Promise.reject(c)})})}W.fetchJsonp=function(e){return new W(e).fetchJsonp(e.callbackParameterName)};W.prototype._makeRequest=function(e){const t=this;fo(t.request);const n=t.request,o=t.url;n.url=o,n.requestFunction=function(){const s=e.responseType,r=Je(e.headers,t.headers),c=e.overrideMimeType,u=e.method,y=e.data,m=Ht(),w=W._Implementations.loadWithXhr(o,s,u,y,r,m,c);return d(w)&&d(w.abort)&&(n.cancelFunction=function(){w.abort()}),m.promise};const i=de.request(n);if(d(i))return i.then(function(s){return n.cancelFunction=void 0,s}).catch(function(s){return n.cancelFunction=void 0,n.state!==ge.FAILED?Promise.reject(s):t.retryOnError(s).then(function(r){return r?(n.state=ge.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(s)})})};function fo(e){if(e.state===ge.ISSUED||e.state===ge.ACTIVE)throw new Ie("The Resource is already being fetched.");e.state=ge.UNISSUED,e.deferred=void 0}const Rs=/^data:(.*?)(;base64)?,(.*)$/;function ln(e,t){const n=decodeURIComponent(t);return e?atob(n):n}function Uo(e,t){const n=ln(e,t),o=new ArrayBuffer(n.length),i=new Uint8Array(o);for(let s=0;s<n.length;s++)i[s]=n.charCodeAt(s);return o}function As(e,t){t=j(t,"");const n=e[1],o=!!e[2],i=e[3];let s,r;switch(t){case"":case"text":return ln(o,i);case"arraybuffer":return Uo(o,i);case"blob":return s=Uo(o,i),new Blob([s],{type:n});case"document":return r=new DOMParser,r.parseFromString(ln(o,i),n);case"json":return JSON.parse(ln(o,i));default:throw new E(`Unhandled responseType: ${t}`)}}W.prototype.fetch=function(e){return e=Le(e,{}),e.method="GET",this._makeRequest(e)};W.fetch=function(e){return new W(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};W.prototype.delete=function(e){return e=Le(e,{}),e.method="DELETE",this._makeRequest(e)};W.delete=function(e){return new W(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};W.prototype.head=function(e){return e=Le(e,{}),e.method="HEAD",this._makeRequest(e)};W.head=function(e){return new W(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};W.prototype.options=function(e){return e=Le(e,{}),e.method="OPTIONS",this._makeRequest(e)};W.options=function(e){return new W(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};W.prototype.post=function(e,t){return f.defined("data",e),t=Le(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};W.post=function(e){return new W(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};W.prototype.put=function(e,t){return f.defined("data",e),t=Le(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};W.put=function(e){return new W(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};W.prototype.patch=function(e,t){return f.defined("data",e),t=Le(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};W.patch=function(e){return new W(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};W._Implementations={};W._Implementations.loadImageElement=function(e,t,n){const o=new Image;o.onload=function(){o.naturalWidth===0&&o.naturalHeight===0&&o.width===0&&o.height===0&&(o.width=300,o.height=150),n.resolve(o)},o.onerror=function(i){n.reject(i)},t&&(Rt.contains(e)?o.crossOrigin="use-credentials":o.crossOrigin=""),o.src=e};W._Implementations.createImage=function(e,t,n,o,i,s){const r=e.url;W.supportsImageBitmapOptions().then(function(c){if(!(c&&s)){W._Implementations.loadImageElement(r,t,n);return}const u="blob",y="GET",m=Ht(),w=W._Implementations.loadWithXhr(r,u,y,void 0,void 0,m,void 0,void 0,void 0);return d(w)&&d(w.abort)&&(e.cancelFunction=function(){w.abort()}),m.promise.then(function(b){if(!d(b)){n.reject(new Ie(`Successfully retrieved ${r} but it contained no content.`));return}return W.createImageBitmapFromBlob(b,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i})}).then(function(b){n.resolve(b)})}).catch(function(c){n.reject(c)})};W.createImageBitmapFromBlob=function(e,t){return f.defined("options",t),f.typeOf.bool("options.flipY",t.flipY),f.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),f.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function No(e,t){switch(t){case"text":return e.toString("utf8");case"json":return JSON.parse(e.toString("utf8"));default:return new Uint8Array(e).buffer}}function Ms(e,t,n,o,i,s,r){let c,u;Promise.all([import("url"),import("zlib")]).then(([y,m])=>(c=y.parse(e),u=m,c.protocol==="https:"?import("https"):import("http"))).then(y=>{const m={protocol:c.protocol,hostname:c.hostname,port:c.port,path:c.path,query:c.query,method:n,headers:i};y.request(m).on("response",function(w){if(w.statusCode<200||w.statusCode>=300){s.reject(new Ft(w.statusCode,w,w.headers));return}const b=[];w.on("data",function(O){b.push(O)}),w.on("end",function(){const O=Buffer.concat(b);w.headers["content-encoding"]==="gzip"?u.gunzip(O,function(R,T){R?s.reject(new Ie("Error decompressing response.")):s.resolve(No(T,t))}):s.resolve(No(O,t))})}).on("error",function(w){s.reject(new Ft)}).end()})}const zs=typeof XMLHttpRequest>"u";W._Implementations.loadWithXhr=function(e,t,n,o,i,s,r){const c=Rs.exec(e);if(c!==null){s.resolve(As(c,t));return}if(zs){Ms(e,t,n,o,i,s);return}const u=new XMLHttpRequest;if(Rt.contains(e)&&(u.withCredentials=!0),u.open(n,e,!0),d(r)&&d(u.overrideMimeType)&&u.overrideMimeType(r),d(i))for(const m in i)i.hasOwnProperty(m)&&u.setRequestHeader(m,i[m]);d(t)&&(u.responseType=t);let y=!1;return typeof e=="string"&&(y=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),u.onload=function(){if((u.status<200||u.status>=300)&&!(y&&u.status===0)){s.reject(new Ft(u.status,u.response,u.getAllResponseHeaders()));return}const m=u.response,w=u.responseType;if(n==="HEAD"||n==="OPTIONS"){const O=u.getAllResponseHeaders().trim().split(/[\r\n]+/),R={};O.forEach(function(T){const z=T.split(": "),D=z.shift();R[D]=z.join(": ")}),s.resolve(R);return}if(u.status===204)s.resolve();else if(d(m)&&(!d(t)||w===t))s.resolve(m);else if(t==="json"&&typeof m=="string")try{s.resolve(JSON.parse(m))}catch(b){s.reject(b)}else(w===""||w==="document")&&d(u.responseXML)&&u.responseXML.hasChildNodes()?s.resolve(u.responseXML):(w===""||w==="text")&&d(u.responseText)?s.resolve(u.responseText):s.reject(new Ie("Invalid XMLHttpRequest response type."))},u.onerror=function(m){s.reject(new Ft)},u.send(o),u};W._Implementations.loadAndExecuteScript=function(e,t,n){return us(e).catch(function(o){n.reject(o)})};W._DefaultImplementations={};W._DefaultImplementations.createImage=W._Implementations.createImage;W._DefaultImplementations.loadWithXhr=W._Implementations.loadWithXhr;W._DefaultImplementations.loadAndExecuteScript=W._Implementations.loadAndExecuteScript;W.DEFAULT=Object.freeze(new W({url:typeof document>"u"?"":document.location.href.split("?")[0]}));const yi=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function js(){const e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){const o=e[t].getAttribute("src"),i=yi.exec(o);if(i!==null)return i[1]}}let Kt;function wi(e){return typeof document>"u"?e:(d(Kt)||(Kt=document.createElement("a")),Kt.href=e,Kt.href)}let ot;function gi(){if(d(ot))return ot;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:d(typeof document>"u"?require("url").pathToFileURL(__filename).href:Gt&&Gt.src||new URL("acmi-parser.cjs",document.baseURI).href)?e=$t(".",typeof document>"u"?require("url").pathToFileURL(__filename).href:Gt&&Gt.src||new URL("acmi-parser.cjs",document.baseURI).href):typeof define=="object"&&d(define.amd)&&!define.amd.toUrlUndefined&&d(require.toUrl)?e=$t("..",at("Core/buildModuleUrl.js")):e=js(),!d(e))throw new E("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return ot=new W({url:wi(e)}),ot.appendForwardSlash(),ot}function Ps(e){return wi(require.toUrl(`../${e}`))}function bi(e){return gi().getDerivedResource({url:e}).url}let en;function at(e){return d(en)||(typeof define=="object"&&d(define.amd)&&!define.amd.toUrlUndefined&&d(require.toUrl)?en=Ps:en=bi),en(e)}at._cesiumScriptRegex=yi;at._buildModuleUrlFromBaseUrl=bi;at._clearBaseResource=function(){ot=void 0};at.setBaseUrl=function(e){ot=W.DEFAULT.getDerivedResource({url:e})};at.getCesiumBaseUrl=gi;function Yt(e,t,n){f.defined("array",e),f.defined("itemToFind",t),f.defined("comparator",n);let o=0,i=e.length-1,s,r;for(;o<=i;){if(s=~~((o+i)/2),r=n(e[s],t),r<0){o=s+1;continue}if(r>0){i=s-1;continue}return s}return~(i+1)}function uo(e,t,n,o,i){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=o,this.ut1MinusUtc=i}function ho(e,t,n,o,i,s,r,c){this.year=e,this.month=t,this.day=n,this.hour=o,this.minute=i,this.second=s,this.millisecond=r,this.isLeapSecond=c}function Do(e){if(e===null||isNaN(e))throw new E("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}function fe(e,t){this.julianDate=e,this.offset=t}const Cs={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1},me=Object.freeze(Cs),Is={UTC:0,TAI:1},se=Object.freeze(Is),Oi=new ho,tn=[31,28,31,30,31,30,31,31,30,31,30,31],nn=29;function po(e,t){return F.compare(e.julianDate,t.julianDate)}const St=new fe;function En(e){St.julianDate=e;const t=F.leapSeconds;let n=Yt(t,St,po);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let o=t[n].offset;n>0&&F.secondsDifference(t[n].julianDate,e)>o&&(n--,o=t[n].offset),F.addSeconds(e,o,e)}function xo(e,t){St.julianDate=e;const n=F.leapSeconds;let o=Yt(n,St,po);if(o<0&&(o=~o),o===0)return F.addSeconds(e,-n[0].offset,t);if(o>=n.length)return F.addSeconds(e,-n[o-1].offset,t);const i=F.secondsDifference(n[o].julianDate,e);if(i===0)return F.addSeconds(e,-n[o].offset,t);if(!(i<=1))return F.addSeconds(e,-n[--o].offset,t)}function et(e,t,n){const o=t/me.SECONDS_PER_DAY|0;return e+=o,t-=me.SECONDS_PER_DAY*o,t<0&&(e--,t+=me.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function lo(e,t,n,o,i,s,r){const c=(t-14)/12|0,u=e+4800+c;let y=(1461*u/4|0)+(367*(t-2-12*c)/12|0)-(3*((u+100)/100|0)/4|0)+n-32075;o=o-12,o<0&&(o+=24);const m=s+(o*me.SECONDS_PER_HOUR+i*me.SECONDS_PER_MINUTE+r*me.SECONDS_PER_MILLISECOND);return m>=43200&&(y-=1),[y,m]}const qs=/^(\d{4})$/,Us=/^(\d{4})-(\d{2})$/,Ns=/^(\d{4})-?(\d{3})$/,Ds=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,xs=/^(\d{4})-?(\d{2})-?(\d{2})$/,mo=/([Z+\-])?(\d{2})?:?(\d{2})?$/,$s=/^(\d{2})(\.\d+)?/.source+mo.source,Fs=/^(\d{2}):?(\d{2})(\.\d+)?/.source+mo.source,Ls=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+mo.source,Ne="Invalid ISO 8601 date.";function F(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=j(e,0),t=j(t,0),n=j(n,se.UTC);const o=e|0;t=t+(e-o)*me.SECONDS_PER_DAY,et(o,t,this),n===se.UTC&&En(this)}F.fromGregorianDate=function(e,t){if(!(e instanceof ho))throw new E("date must be a valid GregorianDate.");const n=lo(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return d(t)?(et(n[0],n[1],t),En(t),t):new F(n[0],n[1],se.UTC)};F.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new E("date must be a valid JavaScript Date.");const n=lo(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return d(t)?(et(n[0],n[1],t),En(t),t):new F(n[0],n[1],se.UTC)};F.fromIso8601=function(e,t){if(typeof e!="string")throw new E(Ne);e=e.replace(",",".");let n=e.split("T"),o,i=1,s=1,r=0,c=0,u=0,y=0;const m=n[0],w=n[1];let b,O;if(!d(m))throw new E(Ne);let R;if(n=m.match(xs),n!==null){if(R=m.split("-").length-1,R>0&&R!==2)throw new E(Ne);o=+n[1],i=+n[2],s=+n[3]}else if(n=m.match(Us),n!==null)o=+n[1],i=+n[2];else if(n=m.match(qs),n!==null)o=+n[1];else{let q;if(n=m.match(Ns),n!==null){if(o=+n[1],q=+n[2],O=Do(o),q<1||O&&q>366||!O&&q>365)throw new E(Ne)}else if(n=m.match(Ds),n!==null){o=+n[1];const x=+n[2],Y=+n[3]||0;if(R=m.split("-").length-1,R>0&&(!d(n[3])&&R!==1||d(n[3])&&R!==2))throw new E(Ne);const N=new Date(Date.UTC(o,0,4));q=x*7+Y-N.getUTCDay()-3}else throw new E(Ne);b=new Date(Date.UTC(o,0,1)),b.setUTCDate(q),i=b.getUTCMonth()+1,s=b.getUTCDate()}if(O=Do(o),i<1||i>12||s<1||(i!==2||!O)&&s>tn[i-1]||O&&i===2&&s>nn)throw new E(Ne);let T;if(d(w)){if(n=w.match(Ls),n!==null){if(R=w.split(":").length-1,R>0&&R!==2&&R!==3)throw new E(Ne);r=+n[1],c=+n[2],u=+n[3],y=+(n[4]||0)*1e3,T=5}else if(n=w.match(Fs),n!==null){if(R=w.split(":").length-1,R>2)throw new E(Ne);r=+n[1],c=+n[2],u=+(n[3]||0)*60,T=4}else if(n=w.match($s),n!==null)r=+n[1],c=+(n[2]||0)*60,T=3;else throw new E(Ne);if(c>=60||u>=61||r>24||r===24&&(c>0||u>0||y>0))throw new E(Ne);const q=n[T],x=+n[T+1],Y=+(n[T+2]||0);switch(q){case"+":r=r-x,c=c-Y;break;case"-":r=r+x,c=c+Y;break;case"Z":break;default:c=c+new Date(Date.UTC(o,i-1,s,r,c)).getTimezoneOffset();break}}const z=u===60;for(z&&u--;c>=60;)c-=60,r++;for(;r>=24;)r-=24,s++;for(b=O&&i===2?nn:tn[i-1];s>b;)s-=b,i++,i>12&&(i-=12,o++),b=O&&i===2?nn:tn[i-1];for(;c<0;)c+=60,r--;for(;r<0;)r+=24,s--;for(;s<1;)i--,i<1&&(i+=12,o--),b=O&&i===2?nn:tn[i-1],s+=b;const D=lo(o,i,s,r,c,u,y);return d(t)?(et(D[0],D[1],t),En(t)):t=new F(D[0],D[1],se.UTC),z&&F.addSeconds(t,1,t),t};F.now=function(e){return F.fromDate(new Date,e)};const on=new F(0,0,se.TAI);F.toGregorianDate=function(e,t){if(!d(e))throw new E("julianDate is required.");let n=!1,o=xo(e,on);d(o)||(F.addSeconds(e,-1,on),o=xo(on,on),n=!0);let i=o.dayNumber;const s=o.secondsOfDay;s>=43200&&(i+=1);let r=i+68569|0;const c=4*r/146097|0;r=r-((146097*c+3)/4|0)|0;const u=4e3*(r+1)/1461001|0;r=r-(1461*u/4|0)+31|0;const y=80*r/2447|0,m=r-(2447*y/80|0)|0;r=y/11|0;const w=y+2-12*r|0,b=100*(c-49)+u+r|0;let O=s/me.SECONDS_PER_HOUR|0,R=s-O*me.SECONDS_PER_HOUR;const T=R/me.SECONDS_PER_MINUTE|0;R=R-T*me.SECONDS_PER_MINUTE;let z=R|0;const D=(R-z)/me.SECONDS_PER_MILLISECOND;return O+=12,O>23&&(O-=24),n&&(z+=1),d(t)?(t.year=b,t.month=w,t.day=m,t.hour=O,t.minute=T,t.second=z,t.millisecond=D,t.isLeapSecond=n,t):new ho(b,w,m,O,T,z,D,n)};F.toDate=function(e){if(!d(e))throw new E("julianDate is required.");const t=F.toGregorianDate(e,Oi);let n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))};F.toIso8601=function(e,t){if(!d(e))throw new E("julianDate is required.");const n=F.toGregorianDate(e,Oi);let o=n.year,i=n.month,s=n.day,r=n.hour;const c=n.minute,u=n.second,y=n.millisecond;o===1e4&&i===1&&s===1&&r===0&&c===0&&u===0&&y===0&&(o=9999,i=12,s=31,r=24);let m;return!d(t)&&y!==0?(m=(y*.01).toString().replace(".",""),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${r.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}.${m}Z`):!d(t)||t===0?`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${r.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}Z`:(m=(y*.01).toFixed(t).replace(".","").slice(0,t),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${r.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}.${m}Z`)};F.clone=function(e,t){if(d(e))return d(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new F(e.dayNumber,e.secondsOfDay,se.TAI)};F.compare=function(e,t){if(!d(e))throw new E("left is required.");if(!d(t))throw new E("right is required.");const n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};F.equals=function(e,t){return e===t||d(e)&&d(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};F.equalsEpsilon=function(e,t,n){return n=j(n,0),e===t||d(e)&&d(t)&&Math.abs(F.secondsDifference(e,t))<=n};F.totalDays=function(e){if(!d(e))throw new E("julianDate is required.");return e.dayNumber+e.secondsOfDay/me.SECONDS_PER_DAY};F.secondsDifference=function(e,t){if(!d(e))throw new E("left is required.");if(!d(t))throw new E("right is required.");return(e.dayNumber-t.dayNumber)*me.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};F.daysDifference=function(e,t){if(!d(e))throw new E("left is required.");if(!d(t))throw new E("right is required.");const n=e.dayNumber-t.dayNumber,o=(e.secondsOfDay-t.secondsOfDay)/me.SECONDS_PER_DAY;return n+o};F.computeTaiMinusUtc=function(e){St.julianDate=e;const t=F.leapSeconds;let n=Yt(t,St,po);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};F.addSeconds=function(e,t,n){if(!d(e))throw new E("julianDate is required.");if(!d(t))throw new E("seconds is required.");if(!d(n))throw new E("result is required.");return et(e.dayNumber,e.secondsOfDay+t,n)};F.addMinutes=function(e,t,n){if(!d(e))throw new E("julianDate is required.");if(!d(t))throw new E("minutes is required.");if(!d(n))throw new E("result is required.");const o=e.secondsOfDay+t*me.SECONDS_PER_MINUTE;return et(e.dayNumber,o,n)};F.addHours=function(e,t,n){if(!d(e))throw new E("julianDate is required.");if(!d(t))throw new E("hours is required.");if(!d(n))throw new E("result is required.");const o=e.secondsOfDay+t*me.SECONDS_PER_HOUR;return et(e.dayNumber,o,n)};F.addDays=function(e,t,n){if(!d(e))throw new E("julianDate is required.");if(!d(t))throw new E("days is required.");if(!d(n))throw new E("result is required.");const o=e.dayNumber+t;return et(o,e.secondsOfDay,n)};F.lessThan=function(e,t){return F.compare(e,t)<0};F.lessThanOrEquals=function(e,t){return F.compare(e,t)<=0};F.greaterThan=function(e,t){return F.compare(e,t)>0};F.greaterThanOrEquals=function(e,t){return F.compare(e,t)>=0};F.prototype.clone=function(e){return F.clone(this,e)};F.prototype.equals=function(e){return F.equals(this,e)};F.prototype.equalsEpsilon=function(e,t){return F.equalsEpsilon(this,e,t)};F.prototype.toString=function(){return F.toIso8601(this)};F.leapSeconds=[new fe(new F(2441317,43210,se.TAI),10),new fe(new F(2441499,43211,se.TAI),11),new fe(new F(2441683,43212,se.TAI),12),new fe(new F(2442048,43213,se.TAI),13),new fe(new F(2442413,43214,se.TAI),14),new fe(new F(2442778,43215,se.TAI),15),new fe(new F(2443144,43216,se.TAI),16),new fe(new F(2443509,43217,se.TAI),17),new fe(new F(2443874,43218,se.TAI),18),new fe(new F(2444239,43219,se.TAI),19),new fe(new F(2444786,43220,se.TAI),20),new fe(new F(2445151,43221,se.TAI),21),new fe(new F(2445516,43222,se.TAI),22),new fe(new F(2446247,43223,se.TAI),23),new fe(new F(2447161,43224,se.TAI),24),new fe(new F(2447892,43225,se.TAI),25),new fe(new F(2448257,43226,se.TAI),26),new fe(new F(2448804,43227,se.TAI),27),new fe(new F(2449169,43228,se.TAI),28),new fe(new F(2449534,43229,se.TAI),29),new fe(new F(2450083,43230,se.TAI),30),new fe(new F(2450630,43231,se.TAI),31),new fe(new F(2451179,43232,se.TAI),32),new fe(new F(2453736,43233,se.TAI),33),new fe(new F(2454832,43234,se.TAI),34),new fe(new F(2456109,43235,se.TAI),35),new fe(new F(2457204,43236,se.TAI),36),new fe(new F(2457754,43237,se.TAI),37)];function Lt(e){e=j(e,j.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=j(e.addNewLeapSeconds,!0),d(e.data)?$o(this,e.data):$o(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}Lt.fromUrl=async function(e,t){f.defined("url",e),t=j(t,j.EMPTY_OBJECT);const n=W.createIfNeeded(e);let o;try{o=await n.fetchJson()}catch{throw new Ie(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new Lt({addNewLeapSeconds:t.addNewLeapSeconds,data:o})};Lt.NONE=Object.freeze({compute:function(e,t){return d(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new uo(0,0,0,0,0),t}});Lt.prototype.compute=function(e,t){if(!d(this._samples))return;if(d(t)||(t=new uo(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;const n=this._dates,o=this._lastIndex;let i=0,s=0;if(d(o)){const c=n[o],u=n[o+1],y=F.lessThanOrEquals(c,e),m=!d(u),w=m||F.greaterThanOrEquals(u,e);if(y&&w)return i=o,!m&&u.equals(e)&&++i,s=i+1,Lo(this,n,this._samples,e,i,s,t),t}let r=Yt(n,e,F.compare,this._dateColumn);return r>=0?(r<n.length-1&&n[r+1].equals(e)&&++r,i=r,s=r):(s=~r,i=s-1,i<0&&(i=0)),this._lastIndex=i,Lo(this,n,this._samples,e,i,s,t),t};function ks(e,t){return F.compare(e.julianDate,t)}function $o(e,t){if(!d(t.columnNames))throw new Ie("Error in loaded EOP data: The columnNames property is required.");if(!d(t.samples))throw new Ie("Error in loaded EOP data: The samples property is required.");const n=t.columnNames.indexOf("modifiedJulianDateUtc"),o=t.columnNames.indexOf("xPoleWanderRadians"),i=t.columnNames.indexOf("yPoleWanderRadians"),s=t.columnNames.indexOf("ut1MinusUtcSeconds"),r=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),u=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||i<0||s<0||r<0||c<0||u<0)throw new Ie("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");const y=e._samples=t.samples,m=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=i,e._ut1MinusUtcSecondsColumn=s,e._xCelestialPoleOffsetRadiansColumn=r,e._yCelestialPoleOffsetRadiansColumn=c,e._taiMinusUtcSecondsColumn=u,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let w;const b=e._addNewLeapSeconds;for(let O=0,R=y.length;O<R;O+=e._columnCount){const T=y[O+n],z=y[O+u],D=T+me.MODIFIED_JULIAN_DATE_DIFFERENCE,q=new F(D,z,se.TAI);if(m.push(q),b){if(z!==w&&d(w)){const x=F.leapSeconds,Y=Yt(x,q,ks);if(Y<0){const N=new fe(q,z);x.splice(~Y,0,N)}}w=z}}}function Fo(e,t,n,o,i){const s=n*o;i.xPoleWander=t[s+e._xPoleWanderRadiansColumn],i.yPoleWander=t[s+e._yPoleWanderRadiansColumn],i.xPoleOffset=t[s+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=t[s+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=t[s+e._ut1MinusUtcSecondsColumn]}function zt(e,t,n){return t+e*(n-t)}function Lo(e,t,n,o,i,s,r){const c=e._columnCount;if(s>t.length-1)return r.xPoleWander=0,r.yPoleWander=0,r.xPoleOffset=0,r.yPoleOffset=0,r.ut1MinusUtc=0,r;const u=t[i],y=t[s];if(u.equals(y)||o.equals(u))return Fo(e,n,i,c,r),r;if(o.equals(y))return Fo(e,n,s,c,r),r;const m=F.secondsDifference(o,u)/F.secondsDifference(y,u),w=i*c,b=s*c;let O=n[w+e._ut1MinusUtcSecondsColumn],R=n[b+e._ut1MinusUtcSecondsColumn];const T=R-O;if(T>.5||T<-.5){const z=n[w+e._taiMinusUtcSecondsColumn],D=n[b+e._taiMinusUtcSecondsColumn];z!==D&&(y.equals(o)?O=R:R-=D-z)}return r.xPoleWander=zt(m,n[w+e._xPoleWanderRadiansColumn],n[b+e._xPoleWanderRadiansColumn]),r.yPoleWander=zt(m,n[w+e._yPoleWanderRadiansColumn],n[b+e._yPoleWanderRadiansColumn]),r.xPoleOffset=zt(m,n[w+e._xCelestialPoleOffsetRadiansColumn],n[b+e._xCelestialPoleOffsetRadiansColumn]),r.yPoleOffset=zt(m,n[w+e._yCelestialPoleOffsetRadiansColumn],n[b+e._yCelestialPoleOffsetRadiansColumn]),r.ut1MinusUtc=zt(m,O,R),r}function be(e,t,n){this.heading=j(e,0),this.pitch=j(t,0),this.roll=j(n,0)}be.fromQuaternion=function(e,t){if(!d(e))throw new E("quaternion is required");d(t)||(t=new be);const n=2*(e.w*e.y-e.z*e.x),o=1-2*(e.x*e.x+e.y*e.y),i=2*(e.w*e.x+e.y*e.z),s=1-2*(e.y*e.y+e.z*e.z),r=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(r,s),t.roll=Math.atan2(i,o),t.pitch=-S.asinClamped(n),t};be.fromDegrees=function(e,t,n,o){if(!d(e))throw new E("heading is required");if(!d(t))throw new E("pitch is required");if(!d(n))throw new E("roll is required");return d(o)||(o=new be),o.heading=e*S.RADIANS_PER_DEGREE,o.pitch=t*S.RADIANS_PER_DEGREE,o.roll=n*S.RADIANS_PER_DEGREE,o};be.clone=function(e,t){if(d(e))return d(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new be(e.heading,e.pitch,e.roll)};be.equals=function(e,t){return e===t||d(e)&&d(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};be.equalsEpsilon=function(e,t,n,o){return e===t||d(e)&&d(t)&&S.equalsEpsilon(e.heading,t.heading,n,o)&&S.equalsEpsilon(e.pitch,t.pitch,n,o)&&S.equalsEpsilon(e.roll,t.roll,n,o)};be.prototype.clone=function(e){return be.clone(this,e)};be.prototype.equals=function(e){return be.equals(this,e)};be.prototype.equalsEpsilon=function(e,t,n){return be.equalsEpsilon(this,e,t,n)};be.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};function _i(e,t,n){this.x=e,this.y=t,this.s=n}function yo(e){e=j(e,j.EMPTY_OBJECT),this._xysFileUrlTemplate=W.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=j(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=j(e.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new F(this._sampleZeroJulianEphemerisDate,0,se.TAI),this._stepSizeDays=j(e.stepSizeDays,1),this._samplesPerXysFile=j(e.samplesPerXysFile,1e3),this._totalSamples=j(e.totalSamples,27426),this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];const t=this._interpolationOrder,n=this._denominators=new Array(t+1),o=this._xTable=new Array(t+1),i=Math.pow(this._stepSizeDays,t);for(let s=0;s<=t;++s){n[s]=i,o[s]=s*this._stepSizeDays;for(let r=0;r<=t;++r)r!==s&&(n[s]*=s-r);n[s]=1/n[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}const Bs=new F(0,0,se.TAI);function Kn(e,t,n){const o=Bs;return o.dayNumber=t,o.secondsOfDay=n,F.daysDifference(o,e._sampleZeroDateTT)}yo.prototype.preload=function(e,t,n,o){const i=Kn(this,e,t),s=Kn(this,n,o);let r=i/this._stepSizeDays-this._interpolationOrder/2|0;r<0&&(r=0);let c=s/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;c>=this._totalSamples&&(c=this._totalSamples-1);const u=r/this._samplesPerXysFile|0,y=c/this._samplesPerXysFile|0,m=[];for(let w=u;w<=y;++w)m.push(eo(this,w));return Promise.all(m)};yo.prototype.computeXysRadians=function(e,t,n){const o=Kn(this,e,t);if(o<0)return;const i=o/this._stepSizeDays|0;if(i>=this._totalSamples)return;const s=this._interpolationOrder;let r=i-(s/2|0);r<0&&(r=0);let c=r+s;c>=this._totalSamples&&(c=this._totalSamples-1,r=c-s,r<0&&(r=0));let u=!1;const y=this._samples;if(d(y[r*3])||(eo(this,r/this._samplesPerXysFile|0),u=!0),d(y[c*3])||(eo(this,c/this._samplesPerXysFile|0),u=!0),u)return;d(n)?(n.x=0,n.y=0,n.s=0):n=new _i(0,0,0);const m=o-r*this._stepSizeDays,w=this._work,b=this._denominators,O=this._coef,R=this._xTable;let T,z;for(T=0;T<=s;++T)w[T]=m-R[T];for(T=0;T<=s;++T){for(O[T]=1,z=0;z<=s;++z)z!==T&&(O[T]*=w[z]);O[T]*=b[T];let D=(r+T)*3;n.x+=O[T]*y[D++],n.y+=O[T]*y[D++],n.s+=O[T]*y[D]}return n};function eo(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n;const o=e._xysFileUrlTemplate;d(o)?n=o.getDerivedResource({templateValues:{0:t}}):n=new W({url:at(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});const i=n.fetchJson().then(function(s){e._chunkDownloadsInProgress[t]=!1;const r=e._samples,c=s.samples,u=t*e._samplesPerXysFile*3;for(let y=0,m=c.length;y<m;++y)r[u+y]=c[y]});return e._chunkDownloadsInProgress[t]=i,i}let Ye;const we={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},Ce={};Object.defineProperties(Ce,{element:{get:function(){if(Ce.supportsFullscreen())return document[we.fullscreenElement]}},changeEventName:{get:function(){if(Ce.supportsFullscreen())return we.fullscreenchange}},errorEventName:{get:function(){if(Ce.supportsFullscreen())return we.fullscreenerror}},enabled:{get:function(){if(Ce.supportsFullscreen())return document[we.fullscreenEnabled]}},fullscreen:{get:function(){if(Ce.supportsFullscreen())return Ce.element!==null}}});Ce.supportsFullscreen=function(){if(d(Ye))return Ye;Ye=!1;const e=document.body;if(typeof e.requestFullscreen=="function")return we.requestFullscreen="requestFullscreen",we.exitFullscreen="exitFullscreen",we.fullscreenEnabled="fullscreenEnabled",we.fullscreenElement="fullscreenElement",we.fullscreenchange="fullscreenchange",we.fullscreenerror="fullscreenerror",Ye=!0,Ye;const t=["webkit","moz","o","ms","khtml"];let n;for(let o=0,i=t.length;o<i;++o){const s=t[o];n=`${s}RequestFullscreen`,typeof e[n]=="function"?(we.requestFullscreen=n,Ye=!0):(n=`${s}RequestFullScreen`,typeof e[n]=="function"&&(we.requestFullscreen=n,Ye=!0)),n=`${s}ExitFullscreen`,typeof document[n]=="function"?we.exitFullscreen=n:(n=`${s}CancelFullScreen`,typeof document[n]=="function"&&(we.exitFullscreen=n)),n=`${s}FullscreenEnabled`,document[n]!==void 0?we.fullscreenEnabled=n:(n=`${s}FullScreenEnabled`,document[n]!==void 0&&(we.fullscreenEnabled=n)),n=`${s}FullscreenElement`,document[n]!==void 0?we.fullscreenElement=n:(n=`${s}FullScreenElement`,document[n]!==void 0&&(we.fullscreenElement=n)),n=`${s}fullscreenchange`,document[`on${n}`]!==void 0&&(s==="ms"&&(n="MSFullscreenChange"),we.fullscreenchange=n),n=`${s}fullscreenerror`,document[`on${n}`]!==void 0&&(s==="ms"&&(n="MSFullscreenError"),we.fullscreenerror=n)}return Ye};Ce.requestFullscreen=function(e,t){Ce.supportsFullscreen()&&e[we.requestFullscreen]({vrDisplay:t})};Ce.exitFullscreen=function(){Ce.supportsFullscreen()&&document[we.exitFullscreen]()};Ce._names=we;let Ae;typeof navigator<"u"?Ae=navigator:Ae={};function st(e){const t=e.split(".");for(let n=0,o=t.length;n<o;++n)t[n]=parseInt(t[n],10);return t}let rn,Si;function wo(){if(!d(rn)&&(rn=!1,!Tn())){const e=/ Chrome\/([\.0-9]+)/.exec(Ae.userAgent);e!==null&&(rn=!0,Si=st(e[1]))}return rn}function Ws(){return wo()&&Si}let sn,vi;function Ei(){if(!d(sn)&&(sn=!1,!wo()&&!Tn()&&/ Safari\/[\.0-9]+/.test(Ae.userAgent))){const e=/ Version\/([\.0-9]+)/.exec(Ae.userAgent);e!==null&&(sn=!0,vi=st(e[1]))}return sn}function Hs(){return Ei()&&vi}let cn,to;function Ti(){if(!d(cn)){cn=!1;const e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Ae.userAgent);e!==null&&(cn=!0,to=st(e[1]),to.isNightly=!!e[2])}return cn}function Qs(){return Ti()&&to}let jt,no;function Ri(){if(!d(jt)){jt=!1;let e;Ae.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(Ae.userAgent),e!==null&&(jt=!0,no=st(e[1]))):Ae.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(Ae.userAgent),e!==null&&(jt=!0,no=st(e[1])))}return jt}function Ys(){return Ri()&&no}let an,Ai;function Tn(){if(!d(an)){an=!1;const e=/ Edg\/([\.0-9]+)/.exec(Ae.userAgent);e!==null&&(an=!0,Ai=st(e[1]))}return an}function Vs(){return Tn()&&Ai}let fn,go;function Rn(){if(!d(fn)){fn=!1;const e=/Firefox\/([\.0-9]+)/.exec(Ae.userAgent);e!==null&&(fn=!0,go=st(e[1]))}return fn}let qn;function Gs(){return d(qn)||(qn=/Windows/i.test(Ae.appVersion)),qn}let Un;function Zs(){return d(Un)||(Un=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),Un}function Xs(){return Rn()&&go}let Nn;function Js(){return d(Nn)||(Nn=!Rn()&&typeof PointerEvent<"u"&&(!d(Ae.pointerEnabled)||Ae.pointerEnabled)),Nn}let Mi,un;function zi(){if(!d(un)){const e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");const t=e.style.imageRendering;un=d(t)&&t!=="",un&&(Mi=t)}return un}function Ks(){return zi()?Mi:void 0}function Ee(){if(!Ee.initialized)throw new E("You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP");return Ee._result}Ee._promise=void 0;Ee._result=void 0;Ee.initialize=function(){return d(Ee._promise)||(Ee._promise=new Promise(e=>{const t=new Image;t.onload=function(){Ee._result=t.width>0&&t.height>0,e(Ee._result)},t.onerror=function(){Ee._result=!1,e(Ee._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),Ee._promise};Object.defineProperties(Ee,{initialized:{get:function(){return d(Ee._result)}}});const wt=[];typeof ArrayBuffer<"u"&&(wt.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&wt.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&wt.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&wt.push(BigInt64Array),typeof BigUint64Array<"u"&&wt.push(BigUint64Array));const ze={isChrome:wo,chromeVersion:Ws,isSafari:Ei,safariVersion:Hs,isWebkit:Ti,webkitVersion:Qs,isInternetExplorer:Ri,internetExplorerVersion:Ys,isEdge:Tn,edgeVersion:Vs,isFirefox:Rn,firefoxVersion:Xs,isWindows:Gs,isIPadOrIOS:Zs,hardwareConcurrency:j(Ae.hardwareConcurrency,3),supportsPointerEvents:Js,supportsImageRenderingPixelated:zi,supportsWebP:Ee,imageRenderingValue:Ks,typedArrayTypes:wt};ze.supportsBasis=function(e){return ze.supportsWebAssembly()&&e.context.supportsBasis};ze.supportsFullscreen=function(){return Ce.supportsFullscreen()};ze.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};ze.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};ze.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};ze.supportsBigInt=function(){return typeof BigInt<"u"};ze.supportsWebWorkers=function(){return typeof Worker<"u"};ze.supportsWebAssembly=function(){return typeof WebAssembly<"u"};ze.supportsWebgl2=function(e){return f.defined("scene",e),e.context.webgl2};ze.supportsEsmWebWorkers=function(){return!Rn()||parseInt(go)>=114};function I(e,t,n,o){this.x=j(e,0),this.y=j(t,0),this.z=j(n,0),this.w=j(o,0)}let Pt=new p;I.fromAxisAngle=function(e,t,n){f.typeOf.object("axis",e),f.typeOf.number("angle",t);const o=t/2,i=Math.sin(o);Pt=p.normalize(e,Pt);const s=Pt.x*i,r=Pt.y*i,c=Pt.z*i,u=Math.cos(o);return d(n)?(n.x=s,n.y=r,n.z=c,n.w=u,n):new I(s,r,c,u)};const ec=[1,2,0],tc=new Array(3);I.fromRotationMatrix=function(e,t){f.typeOf.object("matrix",e);let n,o,i,s,r;const c=e[M.COLUMN0ROW0],u=e[M.COLUMN1ROW1],y=e[M.COLUMN2ROW2],m=c+u+y;if(m>0)n=Math.sqrt(m+1),r=.5*n,n=.5/n,o=(e[M.COLUMN1ROW2]-e[M.COLUMN2ROW1])*n,i=(e[M.COLUMN2ROW0]-e[M.COLUMN0ROW2])*n,s=(e[M.COLUMN0ROW1]-e[M.COLUMN1ROW0])*n;else{const w=ec;let b=0;u>c&&(b=1),y>c&&y>u&&(b=2);const O=w[b],R=w[O];n=Math.sqrt(e[M.getElementIndex(b,b)]-e[M.getElementIndex(O,O)]-e[M.getElementIndex(R,R)]+1);const T=tc;T[b]=.5*n,n=.5/n,r=(e[M.getElementIndex(R,O)]-e[M.getElementIndex(O,R)])*n,T[O]=(e[M.getElementIndex(O,b)]+e[M.getElementIndex(b,O)])*n,T[R]=(e[M.getElementIndex(R,b)]+e[M.getElementIndex(b,R)])*n,o=-T[0],i=-T[1],s=-T[2]}return d(t)?(t.x=o,t.y=i,t.z=s,t.w=r,t):new I(o,i,s,r)};const ko=new I;let Bo=new I,Dn=new I,Wo=new I;I.fromHeadingPitchRoll=function(e,t){return f.typeOf.object("headingPitchRoll",e),Wo=I.fromAxisAngle(p.UNIT_X,e.roll,ko),Dn=I.fromAxisAngle(p.UNIT_Y,-e.pitch,t),t=I.multiply(Dn,Wo,Dn),Bo=I.fromAxisAngle(p.UNIT_Z,-e.heading,ko),I.multiply(Bo,t,t)};const hn=new p,xn=new p,De=new I,Ho=new I,dn=new I;I.packedLength=4;I.pack=function(e,t,n){return f.typeOf.object("value",e),f.defined("array",t),n=j(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};I.unpack=function(e,t,n){return f.defined("array",e),t=j(t,0),d(n)||(n=new I),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};I.packedInterpolationLength=3;I.convertPackedArrayForInterpolation=function(e,t,n,o){I.unpack(e,n*4,dn),I.conjugate(dn,dn);for(let i=0,s=n-t+1;i<s;i++){const r=i*3;I.unpack(e,(t+i)*4,De),I.multiply(De,dn,De),De.w<0&&I.negate(De,De),I.computeAxis(De,hn);const c=I.computeAngle(De);d(o)||(o=[]),o[r]=hn.x*c,o[r+1]=hn.y*c,o[r+2]=hn.z*c}};I.unpackInterpolationResult=function(e,t,n,o,i){d(i)||(i=new I),p.fromArray(e,0,xn);const s=p.magnitude(xn);return I.unpack(t,o*4,Ho),s===0?I.clone(I.IDENTITY,De):I.fromAxisAngle(xn,s,De),I.multiply(De,Ho,i)};I.clone=function(e,t){if(d(e))return d(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new I(e.x,e.y,e.z,e.w)};I.conjugate=function(e,t){return f.typeOf.object("quaternion",e),f.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};I.magnitudeSquared=function(e){return f.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};I.magnitude=function(e){return Math.sqrt(I.magnitudeSquared(e))};I.normalize=function(e,t){f.typeOf.object("result",t);const n=1/I.magnitude(e),o=e.x*n,i=e.y*n,s=e.z*n,r=e.w*n;return t.x=o,t.y=i,t.z=s,t.w=r,t};I.inverse=function(e,t){f.typeOf.object("result",t);const n=I.magnitudeSquared(e);return t=I.conjugate(e,t),I.multiplyByScalar(t,1/n,t)};I.add=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};I.subtract=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};I.negate=function(e,t){return f.typeOf.object("quaternion",e),f.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};I.dot=function(e,t){return f.typeOf.object("left",e),f.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};I.multiply=function(e,t,n){f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n);const o=e.x,i=e.y,s=e.z,r=e.w,c=t.x,u=t.y,y=t.z,m=t.w,w=r*c+o*m+i*y-s*u,b=r*u-o*y+i*m+s*c,O=r*y+o*u-i*c+s*m,R=r*m-o*c-i*u-s*y;return n.x=w,n.y=b,n.z=O,n.w=R,n};I.multiplyByScalar=function(e,t,n){return f.typeOf.object("quaternion",e),f.typeOf.number("scalar",t),f.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};I.divideByScalar=function(e,t,n){return f.typeOf.object("quaternion",e),f.typeOf.number("scalar",t),f.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};I.computeAxis=function(e,t){f.typeOf.object("quaternion",e),f.typeOf.object("result",t);const n=e.w;if(Math.abs(n-1)<S.EPSILON6||Math.abs(n+1)<S.EPSILON6)return t.x=1,t.y=t.z=0,t;const o=1/Math.sqrt(1-n*n);return t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t};I.computeAngle=function(e){return f.typeOf.object("quaternion",e),Math.abs(e.w-1)<S.EPSILON6?0:2*Math.acos(e.w)};let $n=new I;I.lerp=function(e,t,n,o){return f.typeOf.object("start",e),f.typeOf.object("end",t),f.typeOf.number("t",n),f.typeOf.object("result",o),$n=I.multiplyByScalar(t,n,$n),o=I.multiplyByScalar(e,1-n,o),I.add($n,o,o)};let Qo=new I,Fn=new I,Ln=new I;I.slerp=function(e,t,n,o){f.typeOf.object("start",e),f.typeOf.object("end",t),f.typeOf.number("t",n),f.typeOf.object("result",o);let i=I.dot(e,t),s=t;if(i<0&&(i=-i,s=Qo=I.negate(t,Qo)),1-i<S.EPSILON6)return I.lerp(e,s,n,o);const r=Math.acos(i);return Fn=I.multiplyByScalar(e,Math.sin((1-n)*r),Fn),Ln=I.multiplyByScalar(s,Math.sin(n*r),Ln),o=I.add(Fn,Ln,o),I.multiplyByScalar(o,1/Math.sin(r),o)};I.log=function(e,t){f.typeOf.object("quaternion",e),f.typeOf.object("result",t);const n=S.acosClamped(e.w);let o=0;return n!==0&&(o=n/Math.sin(n)),p.multiplyByScalar(e,o,t)};I.exp=function(e,t){f.typeOf.object("cartesian",e),f.typeOf.object("result",t);const n=p.magnitude(e);let o=0;return n!==0&&(o=Math.sin(n)/n),t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t.w=Math.cos(n),t};const nc=new p,oc=new p,It=new I,gt=new I;I.computeInnerQuadrangle=function(e,t,n,o){f.typeOf.object("q0",e),f.typeOf.object("q1",t),f.typeOf.object("q2",n),f.typeOf.object("result",o);const i=I.conjugate(t,It);I.multiply(i,n,gt);const s=I.log(gt,nc);I.multiply(i,e,gt);const r=I.log(gt,oc);return p.add(s,r,s),p.multiplyByScalar(s,.25,s),p.negate(s,s),I.exp(s,It),I.multiply(t,It,o)};I.squad=function(e,t,n,o,i,s){f.typeOf.object("q0",e),f.typeOf.object("q1",t),f.typeOf.object("s0",n),f.typeOf.object("s1",o),f.typeOf.number("t",i),f.typeOf.object("result",s);const r=I.slerp(e,t,i,It),c=I.slerp(n,o,i,gt);return I.slerp(r,c,2*i*(1-i),s)};const ic=new I,ji=1.9011074535173003,_n=ze.supportsTypedArrays()?new Float32Array(8):[],Sn=ze.supportsTypedArrays()?new Float32Array(8):[],ke=ze.supportsTypedArrays()?new Float32Array(8):[],Be=ze.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){const t=e+1,n=2*t+1;_n[e]=1/(t*n),Sn[e]=t/n}_n[7]=ji/(8*17);Sn[7]=ji*8/17;I.fastSlerp=function(e,t,n,o){f.typeOf.object("start",e),f.typeOf.object("end",t),f.typeOf.number("t",n),f.typeOf.object("result",o);let i=I.dot(e,t),s;i>=0?s=1:(s=-1,i=-i);const r=i-1,c=1-n,u=n*n,y=c*c;for(let O=7;O>=0;--O)ke[O]=(_n[O]*u-Sn[O])*r,Be[O]=(_n[O]*y-Sn[O])*r;const m=s*n*(1+ke[0]*(1+ke[1]*(1+ke[2]*(1+ke[3]*(1+ke[4]*(1+ke[5]*(1+ke[6]*(1+ke[7])))))))),w=c*(1+Be[0]*(1+Be[1]*(1+Be[2]*(1+Be[3]*(1+Be[4]*(1+Be[5]*(1+Be[6]*(1+Be[7])))))))),b=I.multiplyByScalar(e,w,ic);return I.multiplyByScalar(t,m,o),I.add(b,o,o)};I.fastSquad=function(e,t,n,o,i,s){f.typeOf.object("q0",e),f.typeOf.object("q1",t),f.typeOf.object("s0",n),f.typeOf.object("s1",o),f.typeOf.number("t",i),f.typeOf.object("result",s);const r=I.fastSlerp(e,t,i,It),c=I.fastSlerp(n,o,i,gt);return I.fastSlerp(r,c,2*i*(1-i),s)};I.equals=function(e,t){return e===t||d(e)&&d(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};I.equalsEpsilon=function(e,t,n){return n=j(n,0),e===t||d(e)&&d(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};I.ZERO=Object.freeze(new I(0,0,0,0));I.IDENTITY=Object.freeze(new I(0,0,0,1));I.prototype.clone=function(e){return I.clone(this,e)};I.prototype.equals=function(e){return I.equals(this,e)};I.prototype.equalsEpsilon=function(e,t){return I.equalsEpsilon(this,e,t)};I.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const re={},kn={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},lt={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Bn={},Pe={east:new p,north:new p,up:new p,west:new p,south:new p,down:new p};let Ve=new p,Ge=new p,Ze=new p;re.localFrameToFixedFrameGenerator=function(e,t){if(!kn.hasOwnProperty(e)||!kn[e].hasOwnProperty(t))throw new E("firstAxis and secondAxis must be east, north, up, west, south or down.");const n=kn[e][t];let o;const i=e+t;return d(Bn[i])?o=Bn[i]:(o=function(s,r,c){if(!d(s))throw new E("origin is required.");if(d(c)||(c=new A),p.equalsEpsilon(s,p.ZERO,S.EPSILON14))p.unpack(lt[e],0,Ve),p.unpack(lt[t],0,Ge),p.unpack(lt[n],0,Ze);else if(S.equalsEpsilon(s.x,0,S.EPSILON14)&&S.equalsEpsilon(s.y,0,S.EPSILON14)){const u=S.sign(s.z);p.unpack(lt[e],0,Ve),e!=="east"&&e!=="west"&&p.multiplyByScalar(Ve,u,Ve),p.unpack(lt[t],0,Ge),t!=="east"&&t!=="west"&&p.multiplyByScalar(Ge,u,Ge),p.unpack(lt[n],0,Ze),n!=="east"&&n!=="west"&&p.multiplyByScalar(Ze,u,Ze)}else{r=j(r,oe.WGS84),r.geodeticSurfaceNormal(s,Pe.up);const u=Pe.up,y=Pe.east;y.x=-s.y,y.y=s.x,y.z=0,p.normalize(y,Pe.east),p.cross(u,y,Pe.north),p.multiplyByScalar(Pe.up,-1,Pe.down),p.multiplyByScalar(Pe.east,-1,Pe.west),p.multiplyByScalar(Pe.north,-1,Pe.south),Ve=Pe[e],Ge=Pe[t],Ze=Pe[n]}return c[0]=Ve.x,c[1]=Ve.y,c[2]=Ve.z,c[3]=0,c[4]=Ge.x,c[5]=Ge.y,c[6]=Ge.z,c[7]=0,c[8]=Ze.x,c[9]=Ze.y,c[10]=Ze.z,c[11]=0,c[12]=s.x,c[13]=s.y,c[14]=s.z,c[15]=1,c},Bn[i]=o),o};re.eastNorthUpToFixedFrame=re.localFrameToFixedFrameGenerator("east","north");re.northEastDownToFixedFrame=re.localFrameToFixedFrameGenerator("north","east");re.northUpEastToFixedFrame=re.localFrameToFixedFrameGenerator("north","up");re.northWestUpToFixedFrame=re.localFrameToFixedFrameGenerator("north","west");const rc=new I,sc=new p(1,1,1),cc=new A;re.headingPitchRollToFixedFrame=function(e,t,n,o,i){f.typeOf.object("HeadingPitchRoll",t),o=j(o,re.eastNorthUpToFixedFrame);const s=I.fromHeadingPitchRoll(t,rc),r=A.fromTranslationQuaternionRotationScale(p.ZERO,s,sc,cc);return i=o(e,n,i),A.multiply(i,r,i)};const ac=new A,fc=new M;re.headingPitchRollQuaternion=function(e,t,n,o,i){f.typeOf.object("HeadingPitchRoll",t);const s=re.headingPitchRollToFixedFrame(e,t,n,o,ac),r=A.getMatrix3(s,fc);return I.fromRotationMatrix(r,i)};const uc=new p(1,1,1),hc=new p,Yo=new A,dc=new A,pc=new M,lc=new I;re.fixedFrameToHeadingPitchRoll=function(e,t,n,o){f.defined("transform",e),t=j(t,oe.WGS84),n=j(n,re.eastNorthUpToFixedFrame),d(o)||(o=new be);const i=A.getTranslation(e,hc);if(p.equals(i,p.ZERO))return o.heading=0,o.pitch=0,o.roll=0,o;let s=A.inverseTransformation(n(i,t,Yo),Yo),r=A.setScale(e,uc,dc);r=A.setTranslation(r,p.ZERO,r),s=A.multiply(s,r,s);let c=I.fromRotationMatrix(A.getMatrix3(s,pc),lc);return c=I.normalize(c,c),be.fromQuaternion(c,o)};const mc=6*3600+41*60+50.54841,yc=8640184812866e-6,wc=.093104,gc=-62e-7,bc=11772758384668e-32,Oc=72921158553e-15,_c=S.TWO_PI/86400;let pn=new F;re.computeTemeToPseudoFixedMatrix=function(e,t){if(!d(e))throw new E("date is required.");pn=F.addSeconds(e,-F.computeTaiMinusUtc(e),pn);const n=pn.dayNumber,o=pn.secondsOfDay;let i;const s=n-2451545;o>=43200?i=(s+.5)/me.DAYS_PER_JULIAN_CENTURY:i=(s-.5)/me.DAYS_PER_JULIAN_CENTURY;const c=(mc+i*(yc+i*(wc+i*gc)))*_c%S.TWO_PI,u=Oc+bc*(n-24515455e-1),y=(o+me.SECONDS_PER_DAY*.5)%me.SECONDS_PER_DAY,m=c+u*y,w=Math.cos(m),b=Math.sin(m);return d(t)?(t[0]=w,t[1]=-b,t[2]=0,t[3]=b,t[4]=w,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new M(w,b,0,-b,w,0,0,0,1)};re.iau2006XysData=new yo;re.earthOrientationParameters=Lt.NONE;const oo=32.184,Sc=2451545;re.preloadIcrfFixed=function(e){const t=e.start.dayNumber,n=e.start.secondsOfDay+oo,o=e.stop.dayNumber,i=e.stop.secondsOfDay+oo;return re.iau2006XysData.preload(t,n,o,i)};re.computeIcrfToFixedMatrix=function(e,t){if(!d(e))throw new E("date is required.");d(t)||(t=new M);const n=re.computeFixedToIcrfMatrix(e,t);if(d(n))return M.transpose(n,t)};const vc=new _i(0,0,0),Ec=new uo(0,0,0,0,0),Wn=new M,Hn=new M;re.computeFixedToIcrfMatrix=function(e,t){if(!d(e))throw new E("date is required.");d(t)||(t=new M);const n=re.earthOrientationParameters.compute(e,Ec);if(!d(n))return;const o=e.dayNumber,i=e.secondsOfDay+oo,s=re.iau2006XysData.computeXysRadians(o,i,vc);if(!d(s))return;const r=s.x+n.xPoleOffset,c=s.y+n.yPoleOffset,u=1/(1+Math.sqrt(1-r*r-c*c)),y=Wn;y[0]=1-u*r*r,y[3]=-u*r*c,y[6]=r,y[1]=-u*r*c,y[4]=1-u*c*c,y[7]=c,y[2]=-r,y[5]=-c,y[8]=1-u*(r*r+c*c);const m=M.fromRotationZ(-s.s,Hn),w=M.multiply(y,m,Wn),b=e.dayNumber,O=e.secondsOfDay-F.computeTaiMinusUtc(e)+n.ut1MinusUtc,R=b-2451545,T=O/me.SECONDS_PER_DAY;let z=.779057273264+T+.00273781191135448*(R+T);z=z%1*S.TWO_PI;const D=M.fromRotationZ(z,Hn),q=M.multiply(w,D,Wn),x=Math.cos(n.xPoleWander),Y=Math.cos(n.yPoleWander),N=Math.sin(n.xPoleWander),H=Math.sin(n.yPoleWander);let B=o-Sc+i/me.SECONDS_PER_DAY;B/=36525;const U=-47e-6*B*S.RADIANS_PER_DEGREE/3600,G=Math.cos(U),V=Math.sin(U),k=Hn;return k[0]=x*G,k[1]=x*V,k[2]=N,k[3]=-Y*V+H*N*G,k[4]=Y*G+H*N*V,k[5]=-H*x,k[6]=-H*V-Y*N*G,k[7]=H*G-Y*N*V,k[8]=Y*x,M.multiply(q,k,t)};const Tc=new L;re.pointToWindowCoordinates=function(e,t,n,o){return o=re.pointToGLWindowCoordinates(e,t,n,o),o.y=2*t[5]-o.y,o};re.pointToGLWindowCoordinates=function(e,t,n,o){if(!d(e))throw new E("modelViewProjectionMatrix is required.");if(!d(t))throw new E("viewportTransformation is required.");if(!d(n))throw new E("point is required.");d(o)||(o=new Q);const i=Tc;return A.multiplyByVector(e,L.fromElements(n.x,n.y,n.z,1,i),i),L.multiplyByScalar(i,1/i.w,i),A.multiplyByVector(t,i,i),Q.fromCartesian4(i,o)};const Rc=new p,Ac=new p,Mc=new p;re.rotationMatrixFromPositionVelocity=function(e,t,n,o){if(!d(e))throw new E("position is required.");if(!d(t))throw new E("velocity is required.");const i=j(n,oe.WGS84).geodeticSurfaceNormal(e,Rc);let s=p.cross(t,i,Ac);p.equalsEpsilon(s,p.ZERO,S.EPSILON6)&&(s=p.clone(p.UNIT_X,s));const r=p.cross(s,t,Mc);return p.normalize(r,r),p.cross(t,r,s),p.negate(s,s),p.normalize(s,s),d(o)||(o=new M),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=s.x,o[4]=s.y,o[5]=s.z,o[6]=r.x,o[7]=r.y,o[8]=r.z,o};const Pi=new A(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),Ci=new le,Ii=new p,zc=new p,jc=new M,io=new A,qi=new A;re.basisTo2D=function(e,t,n){if(!d(e))throw new E("projection is required.");if(!d(t))throw new E("matrix is required.");if(!d(n))throw new E("result is required.");const o=A.getTranslation(t,zc),i=e.ellipsoid,s=i.cartesianToCartographic(o,Ci),r=e.project(s,Ii);p.fromElements(r.z,r.x,r.y,r);const c=re.eastNorthUpToFixedFrame(o,i,io),u=A.inverseTransformation(c,qi),y=A.getMatrix3(t,jc),m=A.multiplyByMatrix3(u,y,n);return A.multiply(Pi,m,n),A.setTranslation(n,r,n),n};re.wgs84To2DModelMatrix=function(e,t,n){if(!d(e))throw new E("projection is required.");if(!d(t))throw new E("center is required.");if(!d(n))throw new E("result is required.");const o=e.ellipsoid,i=re.eastNorthUpToFixedFrame(t,o,io),s=A.inverseTransformation(i,qi),r=o.cartesianToCartographic(t,Ci),c=e.project(r,Ii);p.fromElements(c.z,c.x,c.y,c);const u=A.fromTranslation(c,io);return A.multiply(Pi,s,n),A.multiply(u,n,n),n};function Oe(){this.times=void 0,this.points=void 0,E.throwInstantiationError()}Oe.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof p)return p;if(e instanceof I)return I;throw new E("point must be a Cartesian3, Quaternion, or number.")};Oe.prototype.evaluate=E.throwInstantiationError;Oe.prototype.findTimeInterval=function(e,t){const n=this.times,o=n.length;if(f.typeOf.number("time",e),e<n[0]||e>n[o-1])throw new E("time is out of range.");if(t=j(t,0),e>=n[t]){if(t+1<o&&e<n[t+1])return t;if(t+2<o&&e<n[t+2])return t+1}else if(t-1>=0&&e>=n[t-1])return t-1;let i;if(e>n[t])for(i=t;i<o-1&&!(e>=n[i]&&e<n[i+1]);++i);else for(i=t-1;i>=0&&!(e>=n[i]&&e<n[i+1]);--i);return i===o-1&&(i=o-2),i};Oe.prototype.wrapTime=function(e){f.typeOf.number("time",e);const t=this.times,n=t[t.length-1],o=t[0],i=n-o;let s;return e<o&&(s=Math.floor((o-e)/i)+1,e+=s*i),e>n&&(s=Math.floor((e-n)/i)+1,e-=s*i),e};Oe.prototype.clampTime=function(e){f.typeOf.number("time",e);const t=this.times;return S.clamp(e,t[0],t[t.length-1])};function ft(e){e=j(e,j.EMPTY_OBJECT);const t=e.points,n=e.times;if(!d(t)||!d(n))throw new E("points and times are required.");if(t.length<2)throw new E("points.length must be greater than or equal to 2.");if(n.length!==t.length)throw new E("times.length must be equal to points.length.");this._times=n,this._points=t,this._pointType=Oe.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(ft.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});ft.prototype.findTimeInterval=Oe.prototype.findTimeInterval;ft.prototype.wrapTime=Oe.prototype.wrapTime;ft.prototype.clampTime=Oe.prototype.clampTime;ft.prototype.evaluate=function(e,t){const n=this.points,o=this.times,i=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),s=(e-o[i])/(o[i+1]-o[i]);return this._pointType===Number?(1-s)*n[i]+s*n[i+1]:(d(t)||(t=new p),p.lerp(n[i],n[i+1],s,t))};const bo={};bo.solve=function(e,t,n,o){if(!d(e)||!(e instanceof Array))throw new E("The array lower is required.");if(!d(t)||!(t instanceof Array))throw new E("The array diagonal is required.");if(!d(n)||!(n instanceof Array))throw new E("The array upper is required.");if(!d(o)||!(o instanceof Array))throw new E("The array right is required.");if(t.length!==o.length)throw new E("diagonal and right must have the same lengths.");if(e.length!==n.length)throw new E("lower and upper must have the same lengths.");if(e.length!==t.length-1)throw new E("lower and upper must be one less than the length of diagonal.");const i=new Array(n.length),s=new Array(o.length),r=new Array(o.length);let c;for(c=0;c<s.length;c++)s[c]=new p,r[c]=new p;i[0]=n[0]/t[0],s[0]=p.multiplyByScalar(o[0],1/t[0],s[0]);let u;for(c=1;c<i.length;++c)u=1/(t[c]-i[c-1]*e[c-1]),i[c]=n[c]*u,s[c]=p.subtract(o[c],p.multiplyByScalar(s[c-1],e[c-1],s[c]),s[c]),s[c]=p.multiplyByScalar(s[c],u,s[c]);for(u=1/(t[c]-i[c-1]*e[c-1]),s[c]=p.subtract(o[c],p.multiplyByScalar(s[c-1],e[c-1],s[c]),s[c]),s[c]=p.multiplyByScalar(s[c],u,s[c]),r[r.length-1]=s[s.length-1],c=r.length-2;c>=0;--c)r[c]=p.subtract(s[c],p.multiplyByScalar(r[c+1],i[c],r[c]),r[c]);return r};const Ui=[],Ni=[],Di=[],xi=[];function Pc(e,t,n){const o=Ui,i=Di,s=Ni,r=xi;o.length=i.length=e.length-1,s.length=r.length=e.length;let c;o[0]=s[0]=1,i[0]=0;let u=r[0];for(d(u)||(u=r[0]=new p),p.clone(t,u),c=1;c<o.length-1;++c)o[c]=i[c]=1,s[c]=4,u=r[c],d(u)||(u=r[c]=new p),p.subtract(e[c+1],e[c-1],u),p.multiplyByScalar(u,3,u);return o[c]=0,i[c]=1,s[c]=4,u=r[c],d(u)||(u=r[c]=new p),p.subtract(e[c+1],e[c-1],u),p.multiplyByScalar(u,3,u),s[c+1]=1,u=r[c+1],d(u)||(u=r[c+1]=new p),p.clone(n,u),bo.solve(o,s,i,r)}function Cc(e){const t=Ui,n=Di,o=Ni,i=xi;t.length=n.length=e.length-1,o.length=i.length=e.length;let s;t[0]=n[0]=1,o[0]=2;let r=i[0];for(d(r)||(r=i[0]=new p),p.subtract(e[1],e[0],r),p.multiplyByScalar(r,3,r),s=1;s<t.length;++s)t[s]=n[s]=1,o[s]=4,r=i[s],d(r)||(r=i[s]=new p),p.subtract(e[s+1],e[s-1],r),p.multiplyByScalar(r,3,r);return o[s]=2,r=i[s],d(r)||(r=i[s]=new p),p.subtract(e[s],e[s-1],r),p.multiplyByScalar(r,3,r),bo.solve(t,o,n,i)}function je(e){e=j(e,j.EMPTY_OBJECT);const t=e.points,n=e.times,o=e.inTangents,i=e.outTangents;if(!d(t)||!d(n)||!d(o)||!d(i))throw new E("times, points, inTangents, and outTangents are required.");if(t.length<2)throw new E("points.length must be greater than or equal to 2.");if(n.length!==t.length)throw new E("times.length must be equal to points.length.");if(o.length!==i.length||o.length!==t.length-1)throw new E("inTangents and outTangents must have a length equal to points.length - 1.");if(this._times=n,this._points=t,this._pointType=Oe.getPointType(t[0]),this._pointType!==Oe.getPointType(o[0])||this._pointType!==Oe.getPointType(i[0]))throw new E("inTangents and outTangents must be of the same type as points.");this._inTangents=o,this._outTangents=i,this._lastTimeIndex=0}Object.defineProperties(je.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}});je.createC1=function(e){e=j(e,j.EMPTY_OBJECT);const t=e.times,n=e.points,o=e.tangents;if(!d(n)||!d(t)||!d(o))throw new E("points, times and tangents are required.");if(n.length<2)throw new E("points.length must be greater than or equal to 2.");if(t.length!==n.length||t.length!==o.length)throw new E("times, points and tangents must have the same length.");const i=o.slice(0,o.length-1),s=o.slice(1,o.length);return new je({times:t,points:n,inTangents:s,outTangents:i})};je.createNaturalCubic=function(e){e=j(e,j.EMPTY_OBJECT);const t=e.times,n=e.points;if(!d(n)||!d(t))throw new E("points and times are required.");if(n.length<2)throw new E("points.length must be greater than or equal to 2.");if(t.length!==n.length)throw new E("times.length must be equal to points.length.");if(n.length<3)return new ft({points:n,times:t});const o=Cc(n),i=o.slice(0,o.length-1),s=o.slice(1,o.length);return new je({times:t,points:n,inTangents:s,outTangents:i})};je.createClampedCubic=function(e){e=j(e,j.EMPTY_OBJECT);const t=e.times,n=e.points,o=e.firstTangent,i=e.lastTangent;if(!d(n)||!d(t)||!d(o)||!d(i))throw new E("points, times, firstTangent and lastTangent are required.");if(n.length<2)throw new E("points.length must be greater than or equal to 2.");if(t.length!==n.length)throw new E("times.length must be equal to points.length.");const s=Oe.getPointType(n[0]);if(s!==Oe.getPointType(o)||s!==Oe.getPointType(i))throw new E("firstTangent and lastTangent must be of the same type as points.");if(n.length<3)return new ft({points:n,times:t});const r=Pc(n,o,i),c=r.slice(0,r.length-1),u=r.slice(1,r.length);return new je({times:t,points:n,inTangents:u,outTangents:c})};je.hermiteCoefficientMatrix=new A(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);je.prototype.findTimeInterval=Oe.prototype.findTimeInterval;const Ic=new L,mt=new p;je.prototype.wrapTime=Oe.prototype.wrapTime;je.prototype.clampTime=Oe.prototype.clampTime;je.prototype.evaluate=function(e,t){const n=this.points,o=this.times,i=this.inTangents,s=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);const r=this._lastTimeIndex,c=o[r+1]-o[r],u=(e-o[r])/c,y=Ic;y.z=u,y.y=u*u,y.x=y.y*u,y.w=1;const m=A.multiplyByVector(je.hermiteCoefficientMatrix,y,y);m.z*=c,m.w*=c;const w=this._pointType;return w===Number?n[r]*m.x+n[r+1]*m.y+s[r]*m.z+i[r]*m.w:(d(t)||(t=new w),t=w.multiplyByScalar(n[r],m.x,t),w.multiplyByScalar(n[r+1],m.y,mt),w.add(t,mt,t),w.multiplyByScalar(s[r],m.z,mt),w.add(t,mt,t),w.multiplyByScalar(i[r],m.w,mt),w.add(t,mt,t))};const qc=new L,Vo=new p,yt=new p;function Uc(e){const t=e.points,n=e.times;if(t.length<3){const o=n[0],i=1/(n[1]-o),s=t[0],r=t[1];return function(c,u){d(u)||(u=new p);const y=(c-o)*i;return p.lerp(s,r,y,u)}}return function(o,i){d(i)||(i=new p);const s=e._lastTimeIndex=e.findTimeInterval(o,e._lastTimeIndex),r=(o-n[s])/(n[s+1]-n[s]),c=qc;c.z=r,c.y=r*r,c.x=c.y*r,c.w=1;let u,y,m,w,b;return s===0?(u=t[0],y=t[1],m=e.firstTangent,w=p.subtract(t[2],u,Vo),p.multiplyByScalar(w,.5,w),b=A.multiplyByVector(je.hermiteCoefficientMatrix,c,c)):s===t.length-2?(u=t[s],y=t[s+1],w=e.lastTangent,m=p.subtract(y,t[s-1],Vo),p.multiplyByScalar(m,.5,m),b=A.multiplyByVector(je.hermiteCoefficientMatrix,c,c)):(u=t[s-1],y=t[s],m=t[s+1],w=t[s+2],b=A.multiplyByVector(tt.catmullRomCoefficientMatrix,c,c)),i=p.multiplyByScalar(u,b.x,i),p.multiplyByScalar(y,b.y,yt),p.add(i,yt,i),p.multiplyByScalar(m,b.z,yt),p.add(i,yt,i),p.multiplyByScalar(w,b.w,yt),p.add(i,yt,i)}}const Nc=new p,Dc=new p;function tt(e){e=j(e,j.EMPTY_OBJECT);const t=e.points,n=e.times;let o=e.firstTangent,i=e.lastTangent;if(f.defined("points",t),f.defined("times",n),f.typeOf.number.greaterThanOrEquals("points.length",t.length,2),f.typeOf.number.equals("times.length","points.length",n.length,t.length),t.length>2&&(d(o)||(o=Nc,p.multiplyByScalar(t[1],2,o),p.subtract(o,t[2],o),p.subtract(o,t[0],o),p.multiplyByScalar(o,.5,o)),!d(i))){const s=t.length-1;i=Dc,p.multiplyByScalar(t[s-1],2,i),p.subtract(t[s],i,i),p.add(i,t[s-2],i),p.multiplyByScalar(i,.5,i)}this._times=n,this._points=t,this._firstTangent=p.clone(o),this._lastTangent=p.clone(i),this._evaluateFunction=Uc(this),this._lastTimeIndex=0}Object.defineProperties(tt.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}});tt.catmullRomCoefficientMatrix=new A(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);tt.prototype.findTimeInterval=Oe.prototype.findTimeInterval;tt.prototype.wrapTime=Oe.prototype.wrapTime;tt.prototype.clampTime=Oe.prototype.clampTime;tt.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var $i={exports:{}};(function(e,t){(function(n,o){e.exports=o()})(We,function(){var n=1e3,o=6e4,i=36e5,s="millisecond",r="second",c="minute",u="hour",y="day",m="week",w="month",b="quarter",O="year",R="date",T="Invalid Date",z=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,D=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,q={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(h){var l=["th","st","nd","rd"],g=h%100;return"["+h+(l[(g-20)%10]||l[g]||l[0])+"]"}},x=function(h,l,g){var _=String(h);return!_||_.length>=l?h:""+Array(l+1-_.length).join(g)+h},Y={s:x,z:function(h){var l=-h.utcOffset(),g=Math.abs(l),_=Math.floor(g/60),v=g%60;return(l<=0?"+":"-")+x(_,2,"0")+":"+x(v,2,"0")},m:function h(l,g){if(l.date()<g.date())return-h(g,l);var _=12*(g.year()-l.year())+(g.month()-l.month()),v=l.clone().add(_,w),P=g-v<0,C=l.clone().add(_+(P?-1:1),w);return+(-(_+(g-v)/(P?v-C:C-v))||0)},a:function(h){return h<0?Math.ceil(h)||0:Math.floor(h)},p:function(h){return{M:w,y:O,w:m,d:y,D:R,h:u,m:c,s:r,ms:s,Q:b}[h]||String(h||"").toLowerCase().replace(/s$/,"")},u:function(h){return h===void 0}},N="en",H={};H[N]=q;var B="$isDayjsObject",U=function(h){return h instanceof J||!(!h||!h[B])},G=function h(l,g,_){var v;if(!l)return N;if(typeof l=="string"){var P=l.toLowerCase();H[P]&&(v=P),g&&(H[P]=g,v=P);var C=l.split("-");if(!v&&C.length>1)return h(C[0])}else{var $=l.name;H[$]=l,v=$}return!_&&v&&(N=v),v||!_&&N},V=function(h,l){if(U(h))return h.clone();var g=typeof l=="object"?l:{};return g.date=h,g.args=arguments,new J(g)},k=Y;k.l=G,k.i=U,k.w=function(h,l){return V(h,{locale:l.$L,utc:l.$u,x:l.$x,$offset:l.$offset})};var J=function(){function h(g){this.$L=G(g.locale,null,!0),this.parse(g),this.$x=this.$x||g.x||{},this[B]=!0}var l=h.prototype;return l.parse=function(g){this.$d=function(_){var v=_.date,P=_.utc;if(v===null)return new Date(NaN);if(k.u(v))return new Date;if(v instanceof Date)return new Date(v);if(typeof v=="string"&&!/Z$/i.test(v)){var C=v.match(z);if(C){var $=C[2]-1||0,X=(C[7]||"0").substring(0,3);return P?new Date(Date.UTC(C[1],$,C[3]||1,C[4]||0,C[5]||0,C[6]||0,X)):new Date(C[1],$,C[3]||1,C[4]||0,C[5]||0,C[6]||0,X)}}return new Date(v)}(g),this.init()},l.init=function(){var g=this.$d;this.$y=g.getFullYear(),this.$M=g.getMonth(),this.$D=g.getDate(),this.$W=g.getDay(),this.$H=g.getHours(),this.$m=g.getMinutes(),this.$s=g.getSeconds(),this.$ms=g.getMilliseconds()},l.$utils=function(){return k},l.isValid=function(){return this.$d.toString()!==T},l.isSame=function(g,_){var v=V(g);return this.startOf(_)<=v&&v<=this.endOf(_)},l.isAfter=function(g,_){return V(g)<this.startOf(_)},l.isBefore=function(g,_){return this.endOf(_)<V(g)},l.$g=function(g,_,v){return k.u(g)?this[_]:this.set(v,g)},l.unix=function(){return Math.floor(this.valueOf()/1e3)},l.valueOf=function(){return this.$d.getTime()},l.startOf=function(g,_){var v=this,P=!!k.u(_)||_,C=k.p(g),$=function(he,ne){var pe=k.w(v.$u?Date.UTC(v.$y,ne,he):new Date(v.$y,ne,he),v);return P?pe:pe.endOf(y)},X=function(he,ne){return k.w(v.toDate()[he].apply(v.toDate("s"),(P?[0,0,0,0]:[23,59,59,999]).slice(ne)),v)},ee=this.$W,te=this.$M,ie=this.$D,ce="set"+(this.$u?"UTC":"");switch(C){case O:return P?$(1,0):$(31,11);case w:return P?$(1,te):$(0,te+1);case m:var ue=this.$locale().weekStart||0,ye=(ee<ue?ee+7:ee)-ue;return $(P?ie-ye:ie+(6-ye),te);case y:case R:return X(ce+"Hours",0);case u:return X(ce+"Minutes",1);case c:return X(ce+"Seconds",2);case r:return X(ce+"Milliseconds",3);default:return this.clone()}},l.endOf=function(g){return this.startOf(g,!1)},l.$set=function(g,_){var v,P=k.p(g),C="set"+(this.$u?"UTC":""),$=(v={},v[y]=C+"Date",v[R]=C+"Date",v[w]=C+"Month",v[O]=C+"FullYear",v[u]=C+"Hours",v[c]=C+"Minutes",v[r]=C+"Seconds",v[s]=C+"Milliseconds",v)[P],X=P===y?this.$D+(_-this.$W):_;if(P===w||P===O){var ee=this.clone().set(R,1);ee.$d[$](X),ee.init(),this.$d=ee.set(R,Math.min(this.$D,ee.daysInMonth())).$d}else $&&this.$d[$](X);return this.init(),this},l.set=function(g,_){return this.clone().$set(g,_)},l.get=function(g){return this[k.p(g)]()},l.add=function(g,_){var v,P=this;g=Number(g);var C=k.p(_),$=function(te){var ie=V(P);return k.w(ie.date(ie.date()+Math.round(te*g)),P)};if(C===w)return this.set(w,this.$M+g);if(C===O)return this.set(O,this.$y+g);if(C===y)return $(1);if(C===m)return $(7);var X=(v={},v[c]=o,v[u]=i,v[r]=n,v)[C]||1,ee=this.$d.getTime()+g*X;return k.w(ee,this)},l.subtract=function(g,_){return this.add(-1*g,_)},l.format=function(g){var _=this,v=this.$locale();if(!this.isValid())return v.invalidDate||T;var P=g||"YYYY-MM-DDTHH:mm:ssZ",C=k.z(this),$=this.$H,X=this.$m,ee=this.$M,te=v.weekdays,ie=v.months,ce=v.meridiem,ue=function(ne,pe,_e,Se){return ne&&(ne[pe]||ne(_,P))||_e[pe].slice(0,Se)},ye=function(ne){return k.s($%12||12,ne,"0")},he=ce||function(ne,pe,_e){var Se=ne<12?"AM":"PM";return _e?Se.toLowerCase():Se};return P.replace(D,function(ne,pe){return pe||function(_e){switch(_e){case"YY":return String(_.$y).slice(-2);case"YYYY":return k.s(_.$y,4,"0");case"M":return ee+1;case"MM":return k.s(ee+1,2,"0");case"MMM":return ue(v.monthsShort,ee,ie,3);case"MMMM":return ue(ie,ee);case"D":return _.$D;case"DD":return k.s(_.$D,2,"0");case"d":return String(_.$W);case"dd":return ue(v.weekdaysMin,_.$W,te,2);case"ddd":return ue(v.weekdaysShort,_.$W,te,3);case"dddd":return te[_.$W];case"H":return String($);case"HH":return k.s($,2,"0");case"h":return ye(1);case"hh":return ye(2);case"a":return he($,X,!0);case"A":return he($,X,!1);case"m":return String(X);case"mm":return k.s(X,2,"0");case"s":return String(_.$s);case"ss":return k.s(_.$s,2,"0");case"SSS":return k.s(_.$ms,3,"0");case"Z":return C}return null}(ne)||C.replace(":","")})},l.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},l.diff=function(g,_,v){var P,C=this,$=k.p(_),X=V(g),ee=(X.utcOffset()-this.utcOffset())*o,te=this-X,ie=function(){return k.m(C,X)};switch($){case O:P=ie()/12;break;case w:P=ie();break;case b:P=ie()/3;break;case m:P=(te-ee)/6048e5;break;case y:P=(te-ee)/864e5;break;case u:P=te/i;break;case c:P=te/o;break;case r:P=te/n;break;default:P=te}return v?P:k.a(P)},l.daysInMonth=function(){return this.endOf(w).$D},l.$locale=function(){return H[this.$L]},l.locale=function(g,_){if(!g)return this.$L;var v=this.clone(),P=G(g,_,!0);return P&&(v.$L=P),v},l.clone=function(){return k.w(this.$d,this)},l.toDate=function(){return new Date(this.valueOf())},l.toJSON=function(){return this.isValid()?this.toISOString():null},l.toISOString=function(){return this.$d.toISOString()},l.toString=function(){return this.$d.toUTCString()},h}(),a=J.prototype;return V.prototype=a,[["$ms",s],["$s",r],["$m",c],["$H",u],["$W",y],["$M",w],["$y",O],["$D",R]].forEach(function(h){a[h[1]]=function(l){return this.$g(l,h[0],h[1])}}),V.extend=function(h,l){return h.$i||(h(l,J,V),h.$i=!0),V},V.locale=G,V.isDayjs=U,V.unix=function(h){return V(1e3*h)},V.en=H[N],V.Ls=H,V.p={},V})})($i);var xc=$i.exports;const Ue=Et(xc);var Fi={exports:{}};(function(e,t){(function(n,o){e.exports=o()})(We,function(){var n,o,i=1e3,s=6e4,r=36e5,c=864e5,u=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y=31536e6,m=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,b={years:y,months:m,days:c,hours:r,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},O=function(H){return H instanceof Y},R=function(H,B,U){return new Y(H,U,B.$l)},T=function(H){return o.p(H)+"s"},z=function(H){return H<0},D=function(H){return z(H)?Math.ceil(H):Math.floor(H)},q=function(H){return Math.abs(H)},x=function(H,B){return H?z(H)?{negative:!0,format:""+q(H)+B}:{negative:!1,format:""+H+B}:{negative:!1,format:""}},Y=function(){function H(U,G,V){var k=this;if(this.$d={},this.$l=V,U===void 0&&(this.$ms=0,this.parseFromMilliseconds()),G)return R(U*b[T(G)],this);if(typeof U=="number")return this.$ms=U,this.parseFromMilliseconds(),this;if(typeof U=="object")return Object.keys(U).forEach(function(h){k.$d[T(h)]=U[h]}),this.calMilliseconds(),this;if(typeof U=="string"){var J=U.match(w);if(J){var a=J.slice(2).map(function(h){return h!=null?Number(h):0});return this.$d.years=a[0],this.$d.months=a[1],this.$d.weeks=a[2],this.$d.days=a[3],this.$d.hours=a[4],this.$d.minutes=a[5],this.$d.seconds=a[6],this.calMilliseconds(),this}}return this}var B=H.prototype;return B.calMilliseconds=function(){var U=this;this.$ms=Object.keys(this.$d).reduce(function(G,V){return G+(U.$d[V]||0)*b[V]},0)},B.parseFromMilliseconds=function(){var U=this.$ms;this.$d.years=D(U/y),U%=y,this.$d.months=D(U/m),U%=m,this.$d.days=D(U/c),U%=c,this.$d.hours=D(U/r),U%=r,this.$d.minutes=D(U/s),U%=s,this.$d.seconds=D(U/i),U%=i,this.$d.milliseconds=U},B.toISOString=function(){var U=x(this.$d.years,"Y"),G=x(this.$d.months,"M"),V=+this.$d.days||0;this.$d.weeks&&(V+=7*this.$d.weeks);var k=x(V,"D"),J=x(this.$d.hours,"H"),a=x(this.$d.minutes,"M"),h=this.$d.seconds||0;this.$d.milliseconds&&(h+=this.$d.milliseconds/1e3,h=Math.round(1e3*h)/1e3);var l=x(h,"S"),g=U.negative||G.negative||k.negative||J.negative||a.negative||l.negative,_=J.format||a.format||l.format?"T":"",v=(g?"-":"")+"P"+U.format+G.format+k.format+_+J.format+a.format+l.format;return v==="P"||v==="-P"?"P0D":v},B.toJSON=function(){return this.toISOString()},B.format=function(U){var G=U||"YYYY-MM-DDTHH:mm:ss",V={Y:this.$d.years,YY:o.s(this.$d.years,2,"0"),YYYY:o.s(this.$d.years,4,"0"),M:this.$d.months,MM:o.s(this.$d.months,2,"0"),D:this.$d.days,DD:o.s(this.$d.days,2,"0"),H:this.$d.hours,HH:o.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:o.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:o.s(this.$d.seconds,2,"0"),SSS:o.s(this.$d.milliseconds,3,"0")};return G.replace(u,function(k,J){return J||String(V[k])})},B.as=function(U){return this.$ms/b[T(U)]},B.get=function(U){var G=this.$ms,V=T(U);return V==="milliseconds"?G%=1e3:G=V==="weeks"?D(G/b[V]):this.$d[V],G||0},B.add=function(U,G,V){var k;return k=G?U*b[T(G)]:O(U)?U.$ms:R(U,this).$ms,R(this.$ms+k*(V?-1:1),this)},B.subtract=function(U,G){return this.add(U,G,!0)},B.locale=function(U){var G=this.clone();return G.$l=U,G},B.clone=function(){return R(this.$ms,this)},B.humanize=function(U){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!U)},B.valueOf=function(){return this.asMilliseconds()},B.milliseconds=function(){return this.get("milliseconds")},B.asMilliseconds=function(){return this.as("milliseconds")},B.seconds=function(){return this.get("seconds")},B.asSeconds=function(){return this.as("seconds")},B.minutes=function(){return this.get("minutes")},B.asMinutes=function(){return this.as("minutes")},B.hours=function(){return this.get("hours")},B.asHours=function(){return this.as("hours")},B.days=function(){return this.get("days")},B.asDays=function(){return this.as("days")},B.weeks=function(){return this.get("weeks")},B.asWeeks=function(){return this.as("weeks")},B.months=function(){return this.get("months")},B.asMonths=function(){return this.as("months")},B.years=function(){return this.get("years")},B.asYears=function(){return this.as("years")},H}(),N=function(H,B,U){return H.add(B.years()*U,"y").add(B.months()*U,"M").add(B.days()*U,"d").add(B.hours()*U,"h").add(B.minutes()*U,"m").add(B.seconds()*U,"s").add(B.milliseconds()*U,"ms")};return function(H,B,U){n=U,o=U().$utils(),U.duration=function(k,J){var a=U.locale();return R(k,{$l:a},J)},U.isDuration=O;var G=B.prototype.add,V=B.prototype.subtract;B.prototype.add=function(k,J){return O(k)?N(this,k,1):G.bind(this)(k,J)},B.prototype.subtract=function(k,J){return O(k)?N(this,k,-1):V.bind(this)(k,J)}}})})(Fi);var $c=Fi.exports;const Li=Et($c);var ki={exports:{}};(function(e,t){(function(n,o){e.exports=o()})(We,function(){return function(n,o){o.prototype.isSameOrBefore=function(i,s){return this.isSame(i,s)||this.isBefore(i,s)}}})})(ki);var Fc=ki.exports;const Lc=Et(Fc);function kt(e){"@babel/helpers - typeof";return kt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kt(e)}function kc(e,t){if(kt(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t||"default");if(kt(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Bc(e){var t=kc(e,"string");return kt(t)=="symbol"?t:String(t)}function Xe(e,t,n){return t=Bc(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Wc=240,Hc=[9,-18,-88,0,96,90,0,0,-60,-20,-9,18,8,0,-96,30,0,0,60,-20,9,-88,-18,90,96,0,-20,-60,0,0,186,-42,-42,-150,-96,-150,60,60,60,60,54,162,-78,30,-24,-90,-60,60,-60,60,-9,-32,18,30,24,0,20,-60,0,0,-9,8,18,30,-96,0,-20,60,0,0,54,-78,162,-90,-24,30,60,-60,60,-60,-54,78,78,90,144,90,-60,-60,-60,-60,9,-8,-18,-30,-24,0,20,60,0,0,-9,18,-32,0,24,30,0,0,-60,20,9,-18,-8,0,-24,-30,0,0,60,20],Qc=372,Yc=[0,0,-131,0,138,144,0,0,-102,-31,0,0,7,0,-138,42,0,0,102,-31,62,0,-31,0,0,-62,0,0,0,31,124,0,-62,0,0,-124,0,0,0,62,124,0,-62,0,0,-124,0,0,0,62,62,0,-31,0,0,-62,0,0,0,31,0,0,45,0,-183,-9,0,93,18,0,0,0,216,0,33,87,0,-93,12,-93,0,0,156,0,153,99,0,-93,-12,-93,0,0,-45,0,-3,9,0,93,-18,0,0,0,-55,0,48,42,0,0,-84,31,0,0,-7,0,-48,-42,0,0,84,31],Vc=372,Gc=[18,-36,-122,0,120,135,0,0,-84,-31,-18,36,-2,0,-120,51,0,0,84,-31,36,-165,-27,93,147,-9,0,-93,18,0,210,45,-111,-93,-57,-192,0,93,12,93,162,141,-75,-93,-129,-180,0,93,-12,93,-36,-21,27,93,39,9,0,-93,-18,0,0,0,62,0,0,31,0,0,0,-31,0,0,124,0,0,62,0,0,0,-62,0,0,124,0,0,62,0,0,0,-62,0,0,62,0,0,31,0,0,0,-31,-18,36,-64,0,66,51,0,0,-102,31,18,-36,2,0,-66,-51,0,0,102,31],Zc=12,Qn=4*5/2,Xc=2;class Jc{constructor(t){Xe(this,"_v00",0),Xe(this,"_v01",0),Xe(this,"_v10",0),Xe(this,"_v11",0),Xe(this,"_t",[]),Xe(this,"_ix",void 0),Xe(this,"_iy",void 0),Xe(this,"options",void 0),this.options=t,this._ix=this.options._width,this._iy=this.options._height}getHeight(t,n){if(t=Math.abs(t)>90?NaN:t,isNaN(t)||isNaN(n))return NaN;const o=Kc(n,360);n=o!==-180?o:180;let i=n*this.options._rlonres,s=-t*this.options._rlatres,r=Math.floor(i),c=Math.min(Math.round((this.options._height-1)/2-1),Math.floor(s));i-=r,s-=c,c+=(this.options._height-1)/2,r+=r<0?this.options._width:r>=this.options._width?-this.options._width:0;let u=0,y=0,m=0,w=0,b=new Array(Qn);if(r===this._ix&&c===this._iy)this.options.cubic?b=this._t:(u=this._v00,y=this._v01,m=this._v10,w=this._v11);else if(!this.options.cubic)u=this._rawval(r,c),y=this._rawval(r+1,c),m=this._rawval(r,c+1),w=this._rawval(r+1,c+1);else{const R=[this._rawval(r,c-1),this._rawval(r+1,c-1),this._rawval(r-1,c),this._rawval(r,c),this._rawval(r+1,c),this._rawval(r+2,c),this._rawval(r-1,c+1),this._rawval(r,c+1),this._rawval(r+1,c+1),this._rawval(r+2,c+1),this._rawval(r,c+2),this._rawval(r+1,c+2)];let T=Yc;c!==0&&(T=c===this.options._height-2?Gc:Hc);let z=Qc;c!==0&&(z=c===this.options._height-2?Vc:Wc);for(let D=0;D<Qn;++D){b[D]=0;for(let q=0;q<Zc;++q)b[D]+=R[q]*T[Qn*q+D];b[D]/=z}}if(!this.options.cubic){const R=(1-i)*u+i*y,T=(1-i)*m+i*w,z=(1-s)*R+s*T,D=this.options._offset+this.options._scale*z;return this._ix=r,this._iy=c,this._v00=u,this._v01=y,this._v10=m,this._v11=w,D}let O=b[0]+i*(b[1]+i*(b[3]+i*b[6]))+s*(b[2]+i*(b[4]+i*b[7])+s*(b[5]+i*b[8]+s*b[9]));return O=this.options._offset+this.options._scale*O,this._ix=r,this._iy=c,this._t=b,O}_rawval(t,n){t<0?t+=this.options._width:t>=this.options._width&&(t-=this.options._width),(n<0||n>=this.options._height)&&(n=n<0?-n:2*(this.options._height-1)-n,t+=(t<this.options._width/2?1:-1)*this.options._width/2);const o=this.options._datastart+Xc*(n*this.options._swidth+t),i=this.options.data[o],s=this.options.data[o+1];return i<<8|s}}function Kc(e,t){t=Math.abs(t);let n=Go(e,t);return 2*Math.abs(n)===t?n-=Go(e,2*t)-n:2*Math.abs(n)>t&&(n+=n<0?t:-t),n}function Go(e,t){return e-Math.floor(e/t)*t}const ea=10,ta=65535;function na(e,t){const n=oa(e);let o=n.next();if(o.done||o.value.line!=="P5")throw new Error("Geoid model file: File not in PGM format");let i=Number.MAX_VALUE,s=0,r=-1,c=-1,u="NONE",y="UNKNOWN",m=0,w=0,b=null,O=null;do{o=n.next();const D=o.value.line;if(D.length)if(D[0]==="#"){const q=D.split(" "),x=q[0],Y=q[1];if(x!=="#"||!Y)continue;const N=q.length>2?q.slice(2):[];if(Y==="Description")u=N.join(" ");else if(Y==="DateTime")y=N.join(" ");else if(Y==="Offset"){if(!q[2])throw new Error("Geoid model file: Error reading offset");i=parseInt(q[2],10)}else if(Y==="Scale"){if(!q[2])throw new Error("Geoid model file: Error reading scale");s=parseFloat(q[2])}else Y===(t.cubic?"MaxCubicError":"MaxBilinearError")?isFinite(parseFloat(q[2]))&&(r=parseFloat(q[2])):Y===(t.cubic?"RMSCubicError":"RMSBilinearError")&&isFinite(parseFloat(q[2]))&&(c=parseFloat(q[2]))}else{let q=D.split(" ");if(q=q.filter(x=>x!==""),m=parseInt(q[0],10),w=parseInt(q[1],10),!(m&&w))throw new Error("Geoid model file: Error reading raster size");break}}while(!o.done);o=n.next();const R=parseInt(o.value.line,10);if(o.done)throw new Error("Geoid model file: Error reading maxval");if(R!==ta)throw new Error("Geoid model file: Incorrect value of maxval");if(b=o.value.offset,O=m,i===Number.MAX_VALUE)throw new Error("Geoid model file: Offset not set");if(s===0)throw new Error("Geoid model file: Scale not set");if(s<0)throw new Error("Geoid model file: Scale must be positive");if(w<2||m<2)throw new Error("Geoid model file: Raster size too small");if(m&1)throw new Error("Geoid model file: Raster width is odd");if(!(w&1))throw new Error("Geoid model file: Raster height is even");const T=m/360,z=(w-1)/180;return new Jc({cubic:t.cubic,_width:m,_height:w,_rlonres:T,_rlatres:z,_offset:i,_scale:s,_swidth:O,_datastart:b,_maxerror:r,_rmserror:c,_description:u,_datetime:y,data:e})}function*oa(e){let t=0;do{const n=e.indexOf(ea,t);if(n!==-1){const o=e.subarray(t,n);t=n+1,yield{offset:t,line:Zo(o)}}else{const o=e.subarray(t,e.length);t=e.length,yield{offset:t,line:Zo(o)}}}while(t<e.length);return{offset:t,line:""}}function Zo(e){let t="";for(const n of e)t+=String.fromCharCode(n);return t}Ue.extend(Li);const ia=9.80665,xt=class xt{constructor(){Z(this,"samples",[]);Z(this,"_mslHeightFixed",!1);Z(this,"_fixedFrame",re.localFrameToFixedFrameGenerator("north","west"));Z(this,"_lastRoll",0);Z(this,"_m0",new A);Z(this,"_m1",new A);Z(this,"_hpr0",new be);Z(this,"_hpr1",new be);Z(this,"_alpha",.05);Z(this,"_p0",new p);Z(this,"_p1",new p);Z(this,"_p2",new p);Z(this,"_v0",new p);Z(this,"_v1",new p);Z(this,"_r0",new M);Z(this,"_r1",new M);Z(this,"_q0",new I);Z(this,"_q1",new I);Z(this,"_rollQuat",new I);Z(this,"_defaultHpr",new be);Z(this,"_cartographicScratch",new le)}static loadGeoidModel(t){this._geoid=na(t,{})}hasOrientations(){var t;return((t=this.samples[0])==null?void 0:t.state.orientation)!==void 0}_simpleSmooth(t,n){return t=n*t+(1-n)*this._lastRoll,t<2*S.RADIANS_PER_DEGREE&&(t=0),this._lastRoll=t,t}_computeRoll(t,n,o,i,s,r){const c=A.fromTranslationQuaternionRotationScale(t,n,p.ONE,this._m0),u=A.fromTranslationQuaternionRotationScale(o,i,p.ONE,this._m1),y=re.fixedFrameToHeadingPitchRoll(c,oe.WGS84,this._fixedFrame,this._hpr0),m=re.fixedFrameToHeadingPitchRoll(u,oe.WGS84,this._fixedFrame,this._hpr1);let w=y.heading;w<0&&(w+=S.TWO_PI);let b=m.heading;b<0&&(b+=S.TWO_PI);let O=b-w,R=Math.abs(O);R>Math.PI&&(R=S.TWO_PI-R,O=S.TWO_PI+O);const T=Math.sign(O)*R;return this._simpleSmooth(Math.atan(s*T/(ia*r)),this._alpha)}_computeOrientation(t,n,o,i,s){const r=o-n,c=t.evaluate(n,this._p0),u=t.evaluate(o,this._p1),y=p.subtract(u,c,this._v0);p.divideByScalar(y,o-n,y);const m=p.magnitude(y);if(m>S.EPSILON6){p.normalize(y,y);const w=re.rotationMatrixFromPositionVelocity(c,y,oe.WGS84,this._r0),b=I.fromRotationMatrix(w,this._q0);let O=0;if(s){const T=t.evaluate(i,this._p2),z=p.subtract(T,u,this._v1);p.divideByScalar(z,i-o,z),p.normalize(z,z);const D=re.rotationMatrixFromPositionVelocity(u,z,oe.WGS84,this._r1),q=I.fromRotationMatrix(D,this._q1);O=this._computeRoll(c,b,u,q,m,r)}const R=I.fromAxisAngle(y,O,this._rollQuat);return I.multiply(R,b,new I)}else return re.headingPitchRollQuaternion(c,this._defaultHpr,oe.WGS84,this._fixedFrame,new I)}emulateOrientations(t,n){const o=this.samples;if(o.length<2||Ue.duration(o[1].time.diff(o[0].time)).asSeconds()<2*t)return;const i=o.length-1,s=o[0].time,r=o.map(b=>Ue.duration(b.time.diff(s)).asSeconds()),c=o.map(b=>p.fromElements(b.state.position.x,b.state.position.y,b.state.position.z)),u=new tt({times:r,points:c});n=n??!1;for(let b=0;b<i;++b){const O=r[b],R=O+t,T=R+t;o[b].state.orientation=this._computeOrientation(u,O,R,T,n)}const y=r[i],m=y-t,w=m-t;o[i].state.orientation=this._computeOrientation(u,w,m,y,n)}fixMslHeight(){if(this._mslHeightFixed||xt._geoid===void 0)return;const t=xt._geoid,n=this.samples;n.forEach((o,i)=>{const s=le.fromCartesian(o.state.position,oe.WGS84,this._cartographicScratch);s.height+=t==null?void 0:t.getHeight(s.latitude*S.DEGREES_PER_RADIAN,s.longitude*S.DEGREES_PER_RADIAN),n[i].state.position=le.toCartesian(s,oe.WGS84,new p)}),this._mslHeightFixed=!0}};Z(xt,"_geoid");let Bt=xt;Ue.extend(Li);Ue.extend(Lc);class Bi{constructor(){Z(this,"fileType","");Z(this,"fileVersion","")}}class Oo{constructor(){Z(this,"start",Ue(null));Z(this,"end",Ue(null))}isValid(){return this.start.isValid()&&this.end.isValid()}duration(){return this.isValid()?Ue.duration(this.end.diff(this.start)).asSeconds():-1}}class Wi{constructor(){Z(this,"referenceTime",Ue(null));Z(this,"dataSource");Z(this,"dataRecorder");Z(this,"recordingTime");Z(this,"author");Z(this,"title");Z(this,"category");Z(this,"briefing");Z(this,"debriefing");Z(this,"comments");Z(this,"referenceLongitude");Z(this,"referenceLatitude");Z(this,"additionalProps")}}class Hi{constructor(t){Z(this,"id");Z(this,"timeSpan",new Oo);Z(this,"name");Z(this,"types");Z(this,"callsign");Z(this,"pilot");Z(this,"group");Z(this,"country");Z(this,"coalition");Z(this,"color");this.id=t}}class qt{constructor(t,n){Z(this,"timeStamp");Z(this,"scene");this.timeStamp=t,n?this.scene=new Map(n):this.scene=new Map}}class ro{constructor(){Z(this,"isValid",!0);Z(this,"header",new Bi);Z(this,"globalProperties",new Wi);Z(this,"timeSpan",new Oo);Z(this,"entities",new Map);Z(this,"frames",[]);Z(this,"_fixedFrame",re.localFrameToFixedFrameGenerator("north","west"))}getFrame(t){if(this.timeSpan.isValid()){const n=this.globalProperties.referenceTime,o=this.timeSpan.end,i=this.frames;if(n.isSameOrBefore(t)&&t.isSameOrBefore(o)){const s=Ue.duration(t.diff(n)).asSeconds(),r=dr.le(i,new qt(s),(c,u)=>c.timeStamp-u.timeStamp);return i[r]}}}_addFrame(t,n,o,i){const s=o.scene;i=i??!1,s.forEach((r,c)=>{let u,y=t.get(c);y===void 0&&(y=new Bt,t.set(c,y));const m=y.samples,w=p.fromDegrees(r.longitude,r.latitude,r.altitude,oe.WGS84,new p);if(r.yaw!==void 0){const O=new be(r.yaw*S.RADIANS_PER_DEGREE,(r.pitch??0)*S.RADIANS_PER_DEGREE,(r.roll??0)*S.RADIANS_PER_DEGREE);u=re.headingPitchRollQuaternion(w,O,oe.WGS84,this._fixedFrame,new I)}const b=m.length;if(!i&&b>0){const O=m[b-1],R=O.state.position,T=O.state.orientation;if(p.equalsEpsilon(R,w,S.EPSILON6)&&I.equalsEpsilon(T,u,S.EPSILON6))return}m.push({time:n,state:{position:w,orientation:u}})})}createSampledTrajectories(t){const n=(t==null?void 0:t.sampleRate)??1,o=(t==null?void 0:t.fixMslHeight)??!1,i=(t==null?void 0:t.emulateOrientation)??!1,s=new Map,r=this.timeSpan;if(r.isValid()){const c=r.duration(),u=r.start,y=r.end;let m=0;do{const w=u.add(m,"seconds"),b=this.getFrame(w);b!==void 0&&this._addFrame(s,w,b),m+=n}while(m<=c);if(m>c){const w=this.getFrame(y);w!==void 0&&this._addFrame(s,y,w,!0)}}return o&&s.forEach(c=>c.fixMslHeight()),i&&s.forEach(c=>{c.hasOrientations()||c.emulateOrientations(.01,!0)}),s}}function Qi(e){return e.arrayBuffer?e.arrayBuffer():new Promise((t,n)=>{const o=new FileReader;o.addEventListener("loadend",()=>{t(o.result)}),o.addEventListener("error",n),o.readAsArrayBuffer(e)})}async function ra(e){const t=await Qi(e);return new Uint8Array(t)}function Yi(e){return typeof Blob<"u"&&e instanceof Blob}function Wt(e){return typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer}const sa=typeof process<"u"&&process.versions&&typeof process.versions.node<"u"&&typeof process.versions.electron>"u";function ca(e){return e.byteOffset===0&&e.byteLength===e.buffer.byteLength}class Xo{constructor(t){this.typedArray=t instanceof ArrayBuffer||Wt(t)?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}async getLength(){return this.typedArray.byteLength}async read(t,n){return new Uint8Array(this.typedArray.buffer,this.typedArray.byteOffset+t,n)}}class Jo{constructor(t){this.blob=t}async getLength(){return this.blob.size}async read(t,n){const o=this.blob.slice(t,t+n),i=await Qi(o);return new Uint8Array(i)}async sliceAsBlob(t,n,o=""){return this.blob.slice(t,t+n,o)}}function aa(e,t){var n=Uint8Array;if(e[0]==3&&e[1]==0)return t||new n(0);var o=ua,i=Vi,s=fa,r=Gi,c=t==null;c&&(t=new n(e.length>>>2<<3));for(var u=0,y=0,m=0,w=0,b=0,O=0,R=0,T=0,z=0,D,q;u==0;){if(u=o(e,z,1),y=o(e,z+1,2),z+=3,y==0){z&7&&(z+=8-(z&7));var x=(z>>>3)+4,Y=e[x-4]|e[x-3]<<8;c&&(t=Yn(t,T+Y)),t.set(new n(e.buffer,e.byteOffset+x,Y),T),z=x+Y<<3,T+=Y;continue}if(c&&(t=Yn(t,T+(1<<17))),y==1&&(D=K.flmap,q=K.fdmap,O=511,R=31),y==2){m=i(e,z,5)+257,w=i(e,z+5,5)+1,b=i(e,z+10,4)+4,z+=14;for(var N=0;N<38;N+=2)K.itree[N]=0,K.itree[N+1]=0;for(var H=1,N=0;N<b;N++){var B=i(e,z+N*3,3);K.itree[(K.ordr[N]<<1)+1]=B,B>H&&(H=B)}z+=3*b,Ut(K.itree,H),Nt(K.itree,H,K.imap),D=K.lmap,q=K.dmap,z=s(K.imap,(1<<H)-1,m+w,e,z,K.ttree);var U=Ko(K.ttree,0,m,K.ltree);O=(1<<U)-1;var G=Ko(K.ttree,m,w,K.dtree);R=(1<<G)-1,Ut(K.ltree,U),Nt(K.ltree,U,D),Ut(K.dtree,G),Nt(K.dtree,G,q)}for(;;){var V=D[r(e,z)&O];z+=V&15;var k=V>>>4;if(!(k>>>8))t[T++]=k;else{if(k==256)break;var J=T+k-254;if(k>264){var a=K.ldef[k-257];J=T+(a>>>3)+i(e,z,a&7),z+=a&7}var h=q[r(e,z)&R];z+=h&15;var l=h>>>4,g=K.ddef[l],_=(g>>>4)+o(e,z,g&15);for(z+=g&15,c&&(t=Yn(t,T+(1<<17)));T<J;)t[T]=t[T++-_],t[T]=t[T++-_],t[T]=t[T++-_],t[T]=t[T++-_];T=J}}}return t.length==T?t:t.slice(0,T)}function Yn(e,t){var n=e.length;if(t<=n)return e;var o=new Uint8Array(Math.max(n<<1,t));return o.set(e,0),o}function fa(e,t,n,o,i,s){for(var r=Vi,c=Gi,u=0;u<n;){var y=e[c(o,i)&t];i+=y&15;var m=y>>>4;if(m<=15)s[u]=m,u++;else{var w=0,b=0;m==16?(b=3+r(o,i,2),i+=2,w=s[u-1]):m==17?(b=3+r(o,i,3),i+=3):m==18&&(b=11+r(o,i,7),i+=7);for(var O=u+b;u<O;)s[u]=w,u++}}return i}function Ko(e,t,n,o){for(var i=0,s=0,r=o.length>>>1;s<n;){var c=e[s+t];o[s<<1]=0,o[(s<<1)+1]=c,c>i&&(i=c),s++}for(;s<r;)o[s<<1]=0,o[(s<<1)+1]=0,s++;return i}function Ut(e,t){for(var n=e.length,o,i,s,r,c,u=K.bl_count,r=0;r<=t;r++)u[r]=0;for(r=1;r<n;r+=2)u[e[r]]++;var y=K.next_code;for(o=0,u[0]=0,i=1;i<=t;i++)o=o+u[i-1]<<1,y[i]=o;for(s=0;s<n;s+=2)c=e[s+1],c!=0&&(e[s]=y[c],y[c]++)}function Nt(e,t,n){for(var o=e.length,i=K.rev15,s=0;s<o;s+=2)if(e[s+1]!=0)for(var r=s>>1,c=e[s+1],u=r<<4|c,y=t-c,m=e[s]<<y,w=m+(1<<y);m!=w;){var b=i[m]>>>15-t;n[b]=u,m++}}function ei(e,t){for(var n=K.rev15,o=15-t,i=0;i<e.length;i+=2){var s=e[i]<<t-e[i+1];e[i]=n[s]>>>o}}function Vi(e,t,n){return(e[t>>>3]|e[(t>>>3)+1]<<8)>>>(t&7)&(1<<n)-1}function ua(e,t,n){return(e[t>>>3]|e[(t>>>3)+1]<<8|e[(t>>>3)+2]<<16)>>>(t&7)&(1<<n)-1}function Gi(e,t){return(e[t>>>3]|e[(t>>>3)+1]<<8|e[(t>>>3)+2]<<16)>>>(t&7)}const K=function(){var e=Uint16Array,t=Uint32Array;return{next_code:new e(16),bl_count:new e(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new e(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new t(32),flmap:new e(512),fltree:[],fdmap:new e(32),fdtree:[],lmap:new e(32768),ltree:[],ttree:[],dmap:new e(32768),dtree:[],imap:new e(512),itree:[],rev15:new e(32768),lhst:new t(286),dhst:new t(30),ihst:new t(19),lits:new t(15e3),strt:new e(65536),prev:new e(32768)}}();(function(){for(var e=32768,t=0;t<e;t++){var n=t;n=(n&2863311530)>>>1|(n&1431655765)<<1,n=(n&3435973836)>>>2|(n&858993459)<<2,n=(n&4042322160)>>>4|(n&252645135)<<4,n=(n&4278255360)>>>8|(n&16711935)<<8,K.rev15[t]=(n>>>16|n<<16)>>>17}function o(i,s,r){for(;s--!=0;)i.push(0,r)}for(var t=0;t<32;t++)K.ldef[t]=K.of0[t]<<3|K.exb[t],K.ddef[t]=K.df0[t]<<4|K.dxb[t];o(K.fltree,144,8),o(K.fltree,112,9),o(K.fltree,24,7),o(K.fltree,8,8),Ut(K.fltree,9),Nt(K.fltree,9,K.flmap),ei(K.fltree,9),o(K.fdtree,32,5),Ut(K.fdtree,5),Nt(K.fdtree,5,K.fdmap),ei(K.fdtree,5),o(K.itree,19,0),o(K.ltree,286,0),o(K.dtree,30,0),o(K.ttree,320,0)})();const ti={table:function(){for(var e=new Uint32Array(256),t=0;t<256;t++){for(var n=t,o=0;o<8;o++)n&1?n=3988292384^n>>>1:n=n>>>1;e[t]=n}return e}(),update:function(e,t,n,o){for(var i=0;i<o;i++)e=ti.table[(e^t[n+i])&255]^e>>>8;return e},crc:function(e,t,n){return ti.update(4294967295,e,t,n)^4294967295}};function ha(e,t){return aa(e,t)}const ni={numWorkers:1,workerURL:"",useWorkers:!1};let da=0;const mn=[];function Vn(e){return new Promise((t,n)=>{const o=new Worker(e);o.onmessage=i=>{i.data==="start"?(o.onerror=void 0,o.onmessage=void 0,t(o)):n(new Error(`unexpected message: ${i.data}`))},o.onerror=n})}function pa(e,t){return e.require?e.require(t):{}}(function(){if(sa){const{Worker:e}=pa(module,"worker_threads");return{async createWorker(t){return new e(t)},addEventListener(t,n){t.on("message",o=>{n({target:t,data:o})})},async terminate(t){await t.terminate()}}}else return{async createWorker(e){try{return await Vn(e)}catch{console.warn("could not load worker:",e)}let t;try{const n=await fetch(e,{mode:"cors"});if(!n.ok)throw new Error(`could not load: ${e}`);t=await n.text(),e=URL.createObjectURL(new Blob([t],{type:"application/javascript"}));const o=await Vn(e);return ni.workerURL=e,o}catch{console.warn("could not load worker via fetch:",e)}if(t!==void 0)try{e=`data:application/javascript;base64,${btoa(t)}`;const n=await Vn(e);return ni.workerURL=e,n}catch{console.warn("could not load worker via dataURI")}throw console.warn("workers will not be used"),new Error("can not start workers")},addEventListener(e,t){e.addEventListener("message",t)},async terminate(e){e.terminate()}}})();function la(e,t,n,o){const i=new Uint8Array(t);ha(e,i),o(n?new Blob([i],{type:n}):i.buffer)}async function ma(){if(mn.length!==0)for(;mn.length;){const{src:e,uncompressedSize:t,type:n,resolve:o}=mn.shift();let i=e;Yi(e)&&(i=await ra(e)),la(i,t,n,o)}}function Zi(e,t,n){return new Promise((o,i)=>{mn.push({src:e,uncompressedSize:t,type:n,resolve:o,reject:i,id:da++}),ma()})}function ya(e,t){const n=e&31,o=(e>>5&15)-1,i=(e>>9&127)+1980,s=0,r=(t&31)*2,c=t>>5&63,u=t>>11&31;return new Date(i,o,n,u,c,r,s)}class wa{constructor(t,n){this._reader=t,this._rawEntry=n,this.name=n.name,this.nameBytes=n.nameBytes,this.size=n.uncompressedSize,this.compressedSize=n.compressedSize,this.comment=n.comment,this.commentBytes=n.commentBytes,this.compressionMethod=n.compressionMethod,this.lastModDate=ya(n.lastModFileDate,n.lastModFileTime),this.isDirectory=n.uncompressedSize===0&&n.name.endsWith("/"),this.encrypted=!!(n.generalPurposeBitFlag&1),this.externalFileAttributes=n.externalFileAttributes,this.versionMadeBy=n.versionMadeBy}async blob(t="application/octet-stream"){return await Ma(this._reader,this._rawEntry,t)}async arrayBuffer(){return await Aa(this._reader,this._rawEntry)}async text(){const t=await this.arrayBuffer();return Dt(new Uint8Array(t))}async json(){const t=await this.text();return JSON.parse(t)}}const Gn=22,ga=65535,ba=101010256,Oa=101075792;async function vt(e,t,n){return await e.read(t,n)}async function so(e,t,n,o){return e.sliceAsBlob?await e.sliceAsBlob(t,n,o):await e.read(t,n)}const _a={unsigned(){return 0}};function ve(e,t){return e[t]+e[t+1]*256}function Me(e,t){return e[t]+e[t+1]*256+e[t+2]*65536+e[t+3]*16777216}function it(e,t){return Me(e,t)+Me(e,t+4)*4294967296}const Sa=new TextDecoder;function Dt(e,t){return Wt(e.buffer)&&(e=new Uint8Array(e)),Sa.decode(e)}async function va(e,t){const n=Math.min(Gn+ga,t),o=t-n,i=await vt(e,o,n);for(let s=n-Gn;s>=0;--s){if(Me(i,s)!==ba)continue;const r=new Uint8Array(i.buffer,i.byteOffset+s,i.byteLength-s),c=ve(r,4);if(c!==0)throw new Error(`multi-volume zip files are not supported. This is volume: ${c}`);const u=ve(r,10),y=Me(r,12),m=Me(r,16),w=ve(r,20),b=r.length-Gn;if(w!==b)throw new Error(`invalid comment length. expected: ${b}, actual: ${w}`);const O=new Uint8Array(r.buffer,r.byteOffset+22,w),R=Dt(O);return u===65535||m===4294967295?await Ta(e,o+s,R,O):await Xi(e,m,y,u,R,O)}throw new Error("could not find end of central directory. maybe not zip file")}const Ea=117853008;async function Ta(e,t,n,o){const i=t-20,s=await vt(e,i,20);if(Me(s,0)!==Ea)throw new Error("invalid zip64 end of central directory locator signature");const r=it(s,8),c=await vt(e,r,56);if(Me(c,0)!==Oa)throw new Error("invalid zip64 end of central directory record signature");const u=it(c,32),y=it(c,40),m=it(c,48);return Xi(e,m,y,u,n,o)}const Ra=33639248;async function Xi(e,t,n,o,i,s){let r=0;const c=await vt(e,t,n),u=[];for(let m=0;m<o;++m){const w=c.subarray(r,r+46),b=Me(w,0);if(b!==Ra)throw new Error(`invalid central directory file header signature: 0x${b.toString(16)}`);const O={versionMadeBy:ve(w,4),versionNeededToExtract:ve(w,6),generalPurposeBitFlag:ve(w,8),compressionMethod:ve(w,10),lastModFileTime:ve(w,12),lastModFileDate:ve(w,14),crc32:Me(w,16),compressedSize:Me(w,20),uncompressedSize:Me(w,24),fileNameLength:ve(w,28),extraFieldLength:ve(w,30),fileCommentLength:ve(w,32),internalFileAttributes:ve(w,36),externalFileAttributes:Me(w,38),relativeOffsetOfLocalHeader:Me(w,42)};if(O.generalPurposeBitFlag&64)throw new Error("strong encryption is not supported");r+=46;const R=c.subarray(r,r+O.fileNameLength+O.extraFieldLength+O.fileCommentLength);O.nameBytes=R.slice(0,O.fileNameLength),O.name=Dt(O.nameBytes);const T=O.fileNameLength+O.extraFieldLength,z=R.slice(O.fileNameLength,T);O.extraFields=[];let D=0;for(;D<z.length-3;){const x=ve(z,D+0),Y=ve(z,D+2),N=D+4,H=N+Y;if(H>z.length)throw new Error("extra field length exceeds extra field buffer size");O.extraFields.push({id:x,data:z.slice(N,H)}),D=H}if(O.commentBytes=R.slice(T,T+O.fileCommentLength),O.comment=Dt(O.commentBytes),r+=R.length,O.uncompressedSize===4294967295||O.compressedSize===4294967295||O.relativeOffsetOfLocalHeader===4294967295){const x=O.extraFields.find(H=>H.id===1);if(!x)throw new Error("expected zip64 extended information extra field");const Y=x.data;let N=0;if(O.uncompressedSize===4294967295){if(N+8>Y.length)throw new Error("zip64 extended information extra field does not include uncompressed size");O.uncompressedSize=it(Y,N),N+=8}if(O.compressedSize===4294967295){if(N+8>Y.length)throw new Error("zip64 extended information extra field does not include compressed size");O.compressedSize=it(Y,N),N+=8}if(O.relativeOffsetOfLocalHeader===4294967295){if(N+8>Y.length)throw new Error("zip64 extended information extra field does not include relative header offset");O.relativeOffsetOfLocalHeader=it(Y,N),N+=8}}const q=O.extraFields.find(x=>x.id===28789&&x.data.length>=6&&x.data[0]===1&&Me(x.data,1),_a.unsigned(O.nameBytes));if(q&&(O.fileName=Dt(q.data.slice(5))),O.compressionMethod===0){let x=O.uncompressedSize;if(O.generalPurposeBitFlag&1&&(x+=12),O.compressedSize!==x)throw new Error(`compressed size mismatch for stored file: ${O.compressedSize} != ${x}`)}u.push(O)}return{zip:{comment:i,commentBytes:s},entries:u.map(m=>new wa(e,m))}}async function Ji(e,t){if(t.generalPurposeBitFlag&1)throw new Error("encrypted entries not supported");const n=await vt(e,t.relativeOffsetOfLocalHeader,30),o=await e.getLength(),i=Me(n,0);if(i!==67324752)throw new Error(`invalid local file header signature: 0x${i.toString(16)}`);const s=ve(n,26),r=ve(n,28),c=t.relativeOffsetOfLocalHeader+n.length+s+r;let u;if(t.compressionMethod===0)u=!1;else if(t.compressionMethod===8)u=!0;else throw new Error(`unsupported compression method: ${t.compressionMethod}`);const y=c,m=y+t.compressedSize;if(t.compressedSize!==0&&m>o)throw new Error(`file data overflows file bounds: ${y} + ${t.compressedSize} > ${o}`);return{decompress:u,fileDataStart:y}}async function Aa(e,t){const{decompress:n,fileDataStart:o}=await Ji(e,t);if(!n){const r=await vt(e,o,t.compressedSize);return ca(r)?r.buffer:r.slice().buffer}const i=await so(e,o,t.compressedSize);return await Zi(i,t.uncompressedSize)}async function Ma(e,t,n){const{decompress:o,fileDataStart:i}=await Ji(e,t);if(!o){const c=await so(e,i,t.compressedSize,n);return Yi(c)?c:new Blob([Wt(c.buffer)?new Uint8Array(c):c],{type:n})}const s=await so(e,i,t.compressedSize);return await Zi(s,t.uncompressedSize,n)}async function za(e){let t;if(typeof Blob<"u"&&e instanceof Blob)t=new Jo(e);else if(e instanceof ArrayBuffer||e&&e.buffer&&e.buffer instanceof ArrayBuffer)t=new Xo(e);else if(Wt(e)||Wt(e.buffer))t=new Xo(e);else if(typeof e=="string"){const o=await fetch(e);if(!o.ok)throw new Error(`failed http request ${e}, status: ${o.status}: ${o.statusText}`);const i=await o.blob();t=new Jo(i)}else if(typeof e.getLength=="function"&&typeof e.read=="function")t=e;else throw new Error("unsupported source type");const n=await t.getLength();if(n>Number.MAX_SAFE_INTEGER)throw new Error(`file too large. size: ${n}. Only file sizes up 4503599627370496 bytes are supported`);return await va(t,n)}async function ja(e){const{zip:t,entries:n}=await za(e);return{zip:t,entries:Object.fromEntries(n.map(o=>[o.name,o]))}}class Pa{constructor(t){Z(this,"_decoder",new TextDecoder);Z(this,"_currentLine","");Z(this,"_currentTimeStamp",0);Z(this,"_currentFrame",new qt(0));Z(this,"_destroyedIds",[]);Z(this,"_filteredIds",[]);Z(this,"_data",new ro);Z(this,"_filter",[]);Z(this,"_refLat",0);Z(this,"_refLong",0);Z(this,"_acmiVersions",["2.1","2.2"]);Z(this,"_acmiType","text/acmi/tacview");Z(this,"_propertySeparator",new RegExp("(?<!\\\\),"));Z(this,"_headerPattern",/^\ufeff?FileType=(?<type>.*)\r?\nFileVersion=(?<version>.*)\r?\n/);Bt.loadGeoidModel(t)}_isValidVersion(){return this._acmiVersions.find(t=>t===this._data.header.fileVersion)!==void 0}_isValidType(){return this._data.header.fileType===this._acmiType}_parseHeader(t){const n=this._data,o=this._decoder.decode(t.slice(0,64)),i=this._headerPattern.exec(o);i!==null&&i.groups!==void 0&&(n.header.fileType=i.groups.type,n.header.fileVersion=i.groups.version,n.isValid=this._isValidType()&&this._isValidVersion())}async _parseContent(t){const n=t.length;let o=0,i=0,s=!1,r=0,c="",u=0;for(;i<n;)t[i]===13?s=!0:t[i]===10&&(s?(s=!1,r=i-1):r=i,c=this._decoder.decode(t.slice(o,r)),o=i+1,u>1&&c.trim().length!==0&&!c.startsWith("//")&&(c.endsWith("\\")?this._currentLine+=c.slice(0,c.length-1)+`
45
+ `:(this._currentLine+=c,this._parseLine())),++u),++i;const y=this._data,m=y.frames;if(m.length>0){m.push(this._currentFrame);const w=y.globalProperties.referenceTime,b=m.findIndex(O=>O.scene.size>0);w.isValid()&&b!==-1?(y.timeSpan.start=w.add(m[b].timeStamp,"seconds"),y.timeSpan.end=w.add(m[m.length-1].timeStamp,"seconds")):y.isValid=!1}}_parseLine(){const t=this._data,n=t.frames,o=this._currentFrame,i=this._destroyedIds,s=this._filteredIds;let r=this._currentLine;if(!r.startsWith("0,Event"))if(r.startsWith("0,"))r=r.slice(2),r.split(this._propertySeparator).forEach(u=>{const y=u.indexOf("=");if(y>=0){const m=u.slice(0,y),w=u.slice(y+1),b=t.globalProperties;switch(m){case"DataSource":b.dataSource=w;break;case"DataRecorder":b.dataRecorder=w;break;case"ReferenceTime":b.referenceTime=Ue(w);break;case"RecordingTime":b.recordingTime=Ue(w);break;case"Author":b.author=w;break;case"Title":b.title=w;break;case"Category":b.category=w;break;case"Briefing":b.briefing=w;break;case"Debriefing":b.debriefing=w;break;case"Comments":b.comments=w;break;case"ReferenceLongitude":b.referenceLongitude=+w,this._refLong=b.referenceLongitude;break;case"ReferenceLatitude":b.referenceLatitude=+w,this._refLat=b.referenceLatitude;break;default:b.additionalProps===void 0&&(b.additionalProps=new Map),b.additionalProps.set(m,w);break}}else t.isValid=!1});else if(r.startsWith("#")){i.length>0&&(i.forEach(u=>o.scene.delete(u)),this._destroyedIds=[]);const c=+r.slice(1);c!==this._currentTimeStamp&&(n.push(o),this._currentTimeStamp=c,this._currentFrame=new qt(this._currentTimeStamp,o.scene))}else if(r.startsWith("-")){const c=parseInt(r.slice(1),16),u=t.entities.get(c);u&&(u.timeSpan.end=t.globalProperties.referenceTime.add(this._currentTimeStamp,"second")),s.indexOf(c)>=0&&i.push(c)}else{const c=r.indexOf(",");if(c>=0){const u=parseInt(r.slice(0,c),16),y=r.slice(c+1);let m=t.entities.get(u),w=!1;m===void 0&&(w=!0,m=new Hi(u),m.timeSpan.start=t.globalProperties.referenceTime.add(this._currentTimeStamp,"second"));const b=y.split(this._propertySeparator);if(b.forEach(O=>{const R=O.indexOf("=");if(R>=0){const T=O.slice(0,R),z=O.slice(R+1);switch(T){case"Name":m.name=z;break;case"Type":m.types=z.split("+");break;case"CallSign":m.callsign=z;break;case"Pilot":m.pilot=z;break;case"Group":m.group=z;break;case"Country":m.country=z;break;case"Coalition":m.coalition=z;break;case"Color":m.color=z;break;case"destroyed":+z==1&&(m.timeSpan.end=t.globalProperties.referenceTime.add(this._currentTimeStamp,"second"));break}}else t.isValid=!1}),w){const O=this._filter;let R=!0;if(O!==void 0&&O.length>0){const T=m.types;R=T!==void 0?T.every(z=>!O.includes(z)):!O.includes("Untyped")}R&&(t.entities.set(u,m),s.push(u))}if(s.indexOf(u)>=0){const O=this._refLong,R=this._refLat,T=b.findIndex(z=>z.startsWith("T="));if(T>=0){const z=b[T],D=z.indexOf("=");if(D>=0){const q=o.scene.get(u),x={latitude:(q==null?void 0:q.latitude)??0,longitude:(q==null?void 0:q.longitude)??0,altitude:(q==null?void 0:q.altitude)??0,yaw:q==null?void 0:q.yaw,pitch:q==null?void 0:q.pitch,roll:q==null?void 0:q.roll},N=z.slice(D+1).split("|");N.length<=5?(N[0].length&&(x.longitude=O+ +N[0]),N[1].length&&(x.latitude=R+ +N[1]),N[2].length&&(x.altitude=+N[2])):(N[0].length&&(x.longitude=O+ +N[0]),N[1].length&&(x.latitude=R+ +N[1]),N[2].length&&(x.altitude=+N[2]),N[3].length&&(x.roll=+N[3]),N[4].length&&(x.pitch=+N[4]),N[5].length&&(x.yaw=+N[5])),o.scene.set(u,x)}}}}else t.isValid=!1}this._currentLine=""}_isZipped(t){return t.length>1?new TextDecoder().decode(t.slice(0,2))==="PK":!1}async _unzip(t){const{entries:n}=await ja(t),o=Object.values(n);if(o.length===1)return new Uint8Array(await o[0].arrayBuffer());throw"Invalid compressed ACMI file"}async _parseBuffer(t){return this._parseHeader(t),await this._parseContent(t),this._data.entities.forEach(n=>{n.timeSpan.end.isValid()||(n.timeSpan.end=this._data.timeSpan.end.clone())}),this._data}async parse(t,n){return new Promise((o,i)=>{var s;(s=n==null?void 0:n.controller)==null||s.signal.addEventListener("abort",i),this._data=new ro,this._filter=(n==null?void 0:n.filter)??[],this._currentLine="",this._currentTimeStamp=0,this._currentFrame=new qt(this._currentTimeStamp),this._destroyedIds=[],this._filteredIds=[],this._isZipped(t)?this._unzip(t).then(r=>this._parseBuffer(r).then(c=>o(c))):this._parseBuffer(t).then(r=>o(r))})}}exports.AcmiData=ro;exports.AcmiHeader=Bi;exports.EntityProps=Hi;exports.Frame=qt;exports.GlobalProperties=Wi;exports.TimeSpan=Oo;exports.Trajectory=Bt;exports.default=Pa;