define(["exports","./Matrix2-c6c16658","./RuntimeError-5b082e8f","./when-4bbc8319","./ComponentDatatype-3d0a0aac","./combine-e9466e32"],(function(e,t,n,r,o,i){"use strict";function s(e){this._ellipsoid=r.defaultValue(e,t.Ellipsoid.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.prototype.project=function(e,n){const o=this._semimajorAxis,i=e.longitude*o,s=e.latitude*o,a=e.height;return r.defined(n)?(n.x=i,n.y=s,n.z=a,n):new t.Cartesian3(i,s,a)},s.prototype.unproject=function(e,n){const o=this._oneOverSemimajorAxis,i=e.x*o,s=e.y*o,a=e.z;return r.defined(n)?(n.longitude=i,n.latitude=s,n.height=a,n):new t.Cartographic(i,s,a)};var a=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});function u(e,t){this.start=r.defaultValue(e,0),this.stop=r.defaultValue(t,0)}function c(e,n){this.center=t.Cartesian3.clone(r.defaultValue(e,t.Cartesian3.ZERO)),this.radius=r.defaultValue(n,0)}const l=new t.Cartesian3,d=new t.Cartesian3,f=new t.Cartesian3,p=new t.Cartesian3,h=new t.Cartesian3,m=new t.Cartesian3,g=new t.Cartesian3,y=new t.Cartesian3,v=new t.Cartesian3,w=new t.Cartesian3,C=new t.Cartesian3,_=new t.Cartesian3,b=4/3*o.CesiumMath.PI;c.fromPoints=function(e,n){if(r.defined(n)||(n=new c),!r.defined(e)||0===e.length)return n.center=t.Cartesian3.clone(t.Cartesian3.ZERO,n.center),n.radius=0,n;const o=t.Cartesian3.clone(e[0],g),i=t.Cartesian3.clone(o,l),s=t.Cartesian3.clone(o,d),a=t.Cartesian3.clone(o,f),u=t.Cartesian3.clone(o,p),b=t.Cartesian3.clone(o,h),x=t.Cartesian3.clone(o,m),S=e.length;let A;for(A=1;Au.x&&t.Cartesian3.clone(o,u),rb.y&&t.Cartesian3.clone(o,b),cx.z&&t.Cartesian3.clone(o,x)}const E=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(u,i,y)),O=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(b,s,y)),I=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(x,a,y));let R=i,P=u,T=E;O>T&&(T=O,R=s,P=b),I>T&&(T=I,R=a,P=x);const q=v;q.x=.5*(R.x+P.x),q.y=.5*(R.y+P.y),q.z=.5*(R.z+P.z);let z=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(P,q,y)),M=Math.sqrt(z);const D=w;D.x=i.x,D.y=s.y,D.z=a.z;const U=C;U.x=u.x,U.y=b.y,U.z=x.z;const k=t.Cartesian3.midpoint(D,U,_);let F=0;for(A=0;AF&&(F=n);const r=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(o,q,y));if(r>z){const e=Math.sqrt(r);M=.5*(M+e),z=M*M;const t=e-M;q.x=(M*q.x+t*o.x)/e,q.y=(M*q.y+t*o.y)/e,q.z=(M*q.z+t*o.z)/e}}return Mx.x&&t.Cartesian3.clone(s,x),oS.y&&t.Cartesian3.clone(s,S),iA.z&&t.Cartesian3.clone(s,A)}const I=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(x,a,y)),R=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(S,u,y)),P=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(A,b,y));let T=a,q=x,z=I;R>z&&(z=R,T=u,q=S),P>z&&(z=P,T=b,q=A);const M=v;M.x=.5*(T.x+q.x),M.y=.5*(T.y+q.y),M.z=.5*(T.z+q.z);let D=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(q,M,y)),U=Math.sqrt(D);const k=w;k.x=a.x,k.y=u.y,k.z=b.z;const F=C;F.x=x.x,F.y=S.y,F.z=A.z;const N=t.Cartesian3.midpoint(k,F,_);let j=0;for(O=0;Oj&&(j=r);const o=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(s,M,y));if(o>D){const e=Math.sqrt(o);U=.5*(U+e),D=U*U;const t=e-U;M.x=(U*M.x+t*s.x)/e,M.y=(U*M.y+t*s.y)/e,M.z=(U*M.z+t*s.z)/e}}return Ub.x&&t.Cartesian3.clone(i,b),ox.y&&t.Cartesian3.clone(i,x),cS.z&&t.Cartesian3.clone(i,S)}const O=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(b,s,y)),I=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(x,a,y)),R=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(S,u,y));let P=s,T=b,q=O;I>q&&(q=I,P=a,T=x),R>q&&(q=R,P=u,T=S);const z=v;z.x=.5*(P.x+T.x),z.y=.5*(P.y+T.y),z.z=.5*(P.z+T.z);let M=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(T,z,y)),D=Math.sqrt(M);const U=w;U.x=s.x,U.y=a.y,U.z=u.z;const k=C;k.x=b.x,k.y=x.y,k.z=S.z;const F=t.Cartesian3.midpoint(U,k,_);let N=0;for(E=0;EN&&(N=r);const o=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(i,z,y));if(o>M){const e=Math.sqrt(o);D=.5*(D+e),M=D*D;const t=e-D;z.x=(D*z.x+t*i.x)/e,z.y=(D*z.y+t*i.y)/e,z.z=(D*z.z+t*i.z)/e}}return D=d+u)return e.clone(o),o;if(u>=d+s)return n.clone(o),o;const f=.5*(s+d+u),p=t.Cartesian3.multiplyByScalar(l,(-s+f)/d,U);return t.Cartesian3.add(p,i,p),t.Cartesian3.clone(p,o.center),o.radius=f,o};const k=new t.Cartesian3;c.expand=function(e,n,r){r=c.clone(e,r);const o=t.Cartesian3.magnitude(t.Cartesian3.subtract(n,r.center,k));return o>r.radius&&(r.radius=o),r},c.intersectPlane=function(e,n){const r=e.center,o=e.radius,i=n.normal,s=t.Cartesian3.dot(i,r)+n.distance;return s<-o?a.OUTSIDE:s0&&t.height>0,e.resolve(be._result)},t.onerror=function(){be._result=!1,e.resolve(be._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.promise},Object.defineProperties(be,{initialized:{get:function(){return r.defined(be._result)}}});const xe=[];"undefined"!=typeof ArrayBuffer&&(xe.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),"undefined"!=typeof Uint8ClampedArray&&xe.push(Uint8ClampedArray),"undefined"!=typeof Uint8ClampedArray&&xe.push(Uint8ClampedArray),"undefined"!=typeof BigInt64Array&&xe.push(BigInt64Array),"undefined"!=typeof BigUint64Array&&xe.push(BigUint64Array));const Se={isChrome:me,chromeVersion:function(){return me()&&K},isSafari:ge,safariVersion:function(){return ge()&&te},isWebkit:ye,webkitVersion:function(){return ye()&&re},isInternetExplorer:ve,internetExplorerVersion:function(){return ve()&&ie},isEdge:we,edgeVersion:function(){return we()&&ae},isFirefox:Ce,firefoxVersion:function(){return Ce()&&ce},isWindows:function(){return r.defined(le)||(le=/Windows/i.test(J.appVersion)),le},hardwareConcurrency:r.defaultValue(J.hardwareConcurrency,3),supportsPointerEvents:function(){return r.defined(de)||(de=!Ce()&&"undefined"!=typeof PointerEvent&&(!r.defined(J.pointerEnabled)||J.pointerEnabled)),de},supportsImageRenderingPixelated:_e,supportsWebP:be,imageRenderingValue:function(){return _e()?fe:void 0},typedArrayTypes:xe};function Ae(e,t,n,o){this.x=r.defaultValue(e,0),this.y=r.defaultValue(t,0),this.z=r.defaultValue(n,0),this.w=r.defaultValue(o,0)}Se.supportsBasis=function(e){return Se.supportsWebAssembly()&&e.context.supportsBasis},Se.supportsFullscreen=function(){return G.supportsFullscreen()},Se.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},Se.supportsBigInt64Array=function(){return"undefined"!=typeof BigInt64Array},Se.supportsBigUint64Array=function(){return"undefined"!=typeof BigUint64Array},Se.supportsBigInt=function(){return"undefined"!=typeof BigInt},Se.supportsWebWorkers=function(){return"undefined"!=typeof Worker},Se.supportsWebAssembly=function(){return"undefined"!=typeof WebAssembly&&!Se.isEdge()};let Ee=new t.Cartesian3;Ae.fromAxisAngle=function(e,n,o){const i=n/2,s=Math.sin(i);Ee=t.Cartesian3.normalize(e,Ee);const a=Ee.x*s,u=Ee.y*s,c=Ee.z*s,l=Math.cos(i);return r.defined(o)?(o.x=a,o.y=u,o.z=c,o.w=l,o):new Ae(a,u,c,l)};const Oe=[1,2,0],Ie=new Array(3);Ae.fromRotationMatrix=function(e,n){let o,i,s,a,u;const c=e[t.Matrix3.COLUMN0ROW0],l=e[t.Matrix3.COLUMN1ROW1],d=e[t.Matrix3.COLUMN2ROW2],f=c+l+d;if(f>0)o=Math.sqrt(f+1),u=.5*o,o=.5/o,i=(e[t.Matrix3.COLUMN1ROW2]-e[t.Matrix3.COLUMN2ROW1])*o,s=(e[t.Matrix3.COLUMN2ROW0]-e[t.Matrix3.COLUMN0ROW2])*o,a=(e[t.Matrix3.COLUMN0ROW1]-e[t.Matrix3.COLUMN1ROW0])*o;else{const n=Oe;let r=0;l>c&&(r=1),d>c&&d>l&&(r=2);const f=n[r],p=n[f];o=Math.sqrt(e[t.Matrix3.getElementIndex(r,r)]-e[t.Matrix3.getElementIndex(f,f)]-e[t.Matrix3.getElementIndex(p,p)]+1);const h=Ie;h[r]=.5*o,o=.5/o,u=(e[t.Matrix3.getElementIndex(p,f)]-e[t.Matrix3.getElementIndex(f,p)])*o,h[f]=(e[t.Matrix3.getElementIndex(f,r)]+e[t.Matrix3.getElementIndex(r,f)])*o,h[p]=(e[t.Matrix3.getElementIndex(p,r)]+e[t.Matrix3.getElementIndex(r,p)])*o,i=-h[0],s=-h[1],a=-h[2]}return r.defined(n)?(n.x=i,n.y=s,n.z=a,n.w=u,n):new Ae(i,s,a,u)};const Re=new Ae;let Pe=new Ae,Te=new Ae,qe=new Ae;Ae.fromHeadingPitchRoll=function(e,n){return qe=Ae.fromAxisAngle(t.Cartesian3.UNIT_X,e.roll,Re),Te=Ae.fromAxisAngle(t.Cartesian3.UNIT_Y,-e.pitch,n),n=Ae.multiply(Te,qe,Te),Pe=Ae.fromAxisAngle(t.Cartesian3.UNIT_Z,-e.heading,Re),Ae.multiply(Pe,n,n)};const ze=new t.Cartesian3,Me=new t.Cartesian3,De=new Ae,Ue=new Ae,ke=new Ae;Ae.packedLength=4,Ae.pack=function(e,t,n){return n=r.defaultValue(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t},Ae.unpack=function(e,t,n){return t=r.defaultValue(t,0),r.defined(n)||(n=new Ae),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n},Ae.packedInterpolationLength=3,Ae.convertPackedArrayForInterpolation=function(e,t,n,o){Ae.unpack(e,4*n,ke),Ae.conjugate(ke,ke);for(let i=0,s=n-t+1;i0))return r;s=r-1}return~(s+1)}function Ke(e,t,n,r,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=o}function et(e,t,n,r,o,i,s,a){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=o,this.second=i,this.millisecond=s,this.isLeapSecond=a}function tt(e){return e%4==0&&e%100!=0||e%400==0}function nt(e,t){this.julianDate=e,this.offset=t}Ye[7]=He/136,Ze[7]=8*He/17,Ae.fastSlerp=function(e,t,n,r){let o,i=Ae.dot(e,t);i>=0?o=1:(o=-1,i=-i);const s=i-1,a=1-n,u=n*n,c=a*a;for(let e=7;e>=0;--e)Ge[e]=(Ye[e]*u-Ze[e])*s,Je[e]=(Ye[e]*c-Ze[e])*s;const l=o*n*(1+Ge[0]*(1+Ge[1]*(1+Ge[2]*(1+Ge[3]*(1+Ge[4]*(1+Ge[5]*(1+Ge[6]*(1+Ge[7])))))))),d=a*(1+Je[0]*(1+Je[1]*(1+Je[2]*(1+Je[3]*(1+Je[4]*(1+Je[5]*(1+Je[6]*(1+Je[7])))))))),f=Ae.multiplyByScalar(e,d,We);return Ae.multiplyByScalar(t,l,r),Ae.add(f,r,r)},Ae.fastSquad=function(e,t,n,r,o,i){const s=Ae.fastSlerp(e,t,o,Qe),a=Ae.fastSlerp(n,r,o,$e);return Ae.fastSlerp(s,a,2*o*(1-o),i)},Ae.equals=function(e,t){return e===t||r.defined(e)&&r.defined(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},Ae.equalsEpsilon=function(e,t,n){return n=r.defaultValue(n,0),e===t||r.defined(e)&&r.defined(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},Ae.ZERO=Object.freeze(new Ae(0,0,0,0)),Ae.IDENTITY=Object.freeze(new Ae(0,0,0,1)),Ae.prototype.clone=function(e){return Ae.clone(this,e)},Ae.prototype.equals=function(e){return Ae.equals(this,e)},Ae.prototype.equalsEpsilon=function(e,t){return Ae.equalsEpsilon(this,e,t)},Ae.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var rt=Object.freeze({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:2400000.5});var ot=Object.freeze({UTC:0,TAI:1});const it=new et,st=[31,28,31,30,31,30,31,31,30,31,30,31];function at(e,t){return bt.compare(e.julianDate,t.julianDate)}const ut=new nt;function ct(e){ut.julianDate=e;const t=bt.leapSeconds;let n=Xe(t,ut,at);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let r=t[n].offset;if(n>0){bt.secondsDifference(t[n].julianDate,e)>r&&(n--,r=t[n].offset)}bt.addSeconds(e,r,e)}function lt(e,t){ut.julianDate=e;const n=bt.leapSeconds;let r=Xe(n,ut,at);if(r<0&&(r=~r),0===r)return bt.addSeconds(e,-n[0].offset,t);if(r>=n.length)return bt.addSeconds(e,-n[r-1].offset,t);const o=bt.secondsDifference(n[r].julianDate,e);return 0===o?bt.addSeconds(e,-n[r].offset,t):o<=1?void 0:bt.addSeconds(e,-n[--r].offset,t)}function dt(e,t,n){const r=t/rt.SECONDS_PER_DAY|0;return e+=r,(t-=rt.SECONDS_PER_DAY*r)<0&&(e--,t+=rt.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function ft(e,t,n,r,o,i,s){const a=(t-14)/12|0,u=e+4800+a;let c=(1461*u/4|0)+(367*(t-2-12*a)/12|0)-(3*((u+100)/100|0)/4|0)+n-32075;(r-=12)<0&&(r+=24);const l=i+(r*rt.SECONDS_PER_HOUR+o*rt.SECONDS_PER_MINUTE+s*rt.SECONDS_PER_MILLISECOND);return l>=43200&&(c-=1),[c,l]}const pt=/^(\d{4})$/,ht=/^(\d{4})-(\d{2})$/,mt=/^(\d{4})-?(\d{3})$/,gt=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,yt=/^(\d{4})-?(\d{2})-?(\d{2})$/,vt=/([Z+\-])?(\d{2})?:?(\d{2})?$/,wt=/^(\d{2})(\.\d+)?/.source+vt.source,Ct=/^(\d{2}):?(\d{2})(\.\d+)?/.source+vt.source,_t=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+vt.source;function bt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=r.defaultValue(e,0),t=r.defaultValue(t,0),n=r.defaultValue(n,ot.UTC);const o=0|e;dt(o,t+=(e-o)*rt.SECONDS_PER_DAY,this),n===ot.UTC&&ct(this)}bt.fromGregorianDate=function(e,t){const n=ft(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return r.defined(t)?(dt(n[0],n[1],t),ct(t),t):new bt(n[0],n[1],ot.UTC)},bt.fromDate=function(e,t){const n=ft(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r.defined(t)?(dt(n[0],n[1],t),ct(t),t):new bt(n[0],n[1],ot.UTC)},bt.fromIso8601=function(e,t){let n,o=(e=e.replace(",",".")).split("T"),i=1,s=1,a=0,u=0,c=0,l=0;const d=o[0],f=o[1];let p,h,m;if(o=d.match(yt),null!==o)n=+o[1],i=+o[2],s=+o[3];else if(o=d.match(ht),null!==o)n=+o[1],i=+o[2];else if(o=d.match(pt),null!==o)n=+o[1];else{let e;if(o=d.match(mt),null!==o)n=+o[1],e=+o[2],h=tt(n);else if(o=d.match(gt),null!==o){n=+o[1];e=7*+o[2]+(+o[3]||0)-new Date(Date.UTC(n,0,4)).getUTCDay()-3}p=new Date(Date.UTC(n,0,1)),p.setUTCDate(e),i=p.getUTCMonth()+1,s=p.getUTCDate()}if(h=tt(n),r.defined(f)){o=f.match(_t),null!==o?(a=+o[1],u=+o[2],c=+o[3],l=1e3*+(o[4]||0),m=5):(o=f.match(Ct),null!==o?(a=+o[1],u=+o[2],c=60*+(o[3]||0),m=4):(o=f.match(wt),null!==o&&(a=+o[1],u=60*+(o[2]||0),m=3)));const e=o[m],t=+o[m+1],r=+(o[m+2]||0);switch(e){case"+":a-=t,u-=r;break;case"-":a+=t,u+=r;break;case"Z":break;default:u+=new Date(Date.UTC(n,i-1,s,a,u)).getTimezoneOffset()}}const g=60===c;for(g&&c--;u>=60;)u-=60,a++;for(;a>=24;)a-=24,s++;for(p=h&&2===i?29:st[i-1];s>p;)s-=p,i++,i>12&&(i-=12,n++),p=h&&2===i?29:st[i-1];for(;u<0;)u+=60,a--;for(;a<0;)a+=24,s--;for(;s<1;)i--,i<1&&(i+=12,n--),p=h&&2===i?29:st[i-1],s+=p;const y=ft(n,i,s,a,u,c,l);return r.defined(t)?(dt(y[0],y[1],t),ct(t)):t=new bt(y[0],y[1],ot.UTC),g&&bt.addSeconds(t,1,t),t},bt.now=function(e){return bt.fromDate(new Date,e)};const xt=new bt(0,0,ot.TAI);bt.toGregorianDate=function(e,t){let n=!1,o=lt(e,xt);r.defined(o)||(bt.addSeconds(e,-1,xt),o=lt(xt,xt),n=!0);let i=o.dayNumber;const s=o.secondsOfDay;s>=43200&&(i+=1);let a=i+68569|0;const u=4*a/146097|0;a=a-((146097*u+3)/4|0)|0;const c=4e3*(a+1)/1461001|0;a=a-(1461*c/4|0)+31|0;const l=80*a/2447|0,d=a-(2447*l/80|0)|0;a=l/11|0;const f=l+2-12*a|0,p=100*(u-49)+c+a|0;let h=s/rt.SECONDS_PER_HOUR|0,m=s-h*rt.SECONDS_PER_HOUR;const g=m/rt.SECONDS_PER_MINUTE|0;m-=g*rt.SECONDS_PER_MINUTE;let y=0|m;const v=(m-y)/rt.SECONDS_PER_MILLISECOND;return h+=12,h>23&&(h-=24),n&&(y+=1),r.defined(t)?(t.year=p,t.month=f,t.day=d,t.hour=h,t.minute=g,t.second=y,t.millisecond=v,t.isLeapSecond=n,t):new et(p,f,d,h,g,y,v,n)},bt.toDate=function(e){const t=bt.toGregorianDate(e,it);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))},bt.toIso8601=function(e,t){const n=bt.toGregorianDate(e,it);let o=n.year,i=n.month,s=n.day,a=n.hour;const u=n.minute,c=n.second,l=n.millisecond;let d;return 1e4===o&&1===i&&1===s&&0===a&&0===u&&0===c&&0===l&&(o=9999,i=12,s=31,a=24),r.defined(t)||0===l?r.defined(t)&&0!==t?(d=(.01*l).toFixed(t).replace(".","").slice(0,t),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${d}Z`):`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(d=(.01*l).toString().replace(".",""),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${d}Z`)},bt.clone=function(e,t){if(r.defined(e))return r.defined(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new bt(e.dayNumber,e.secondsOfDay,ot.TAI)},bt.compare=function(e,t){const n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},bt.equals=function(e,t){return e===t||r.defined(e)&&r.defined(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},bt.equalsEpsilon=function(e,t,n){return n=r.defaultValue(n,0),e===t||r.defined(e)&&r.defined(t)&&Math.abs(bt.secondsDifference(e,t))<=n},bt.totalDays=function(e){return e.dayNumber+e.secondsOfDay/rt.SECONDS_PER_DAY},bt.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*rt.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)},bt.daysDifference=function(e,t){return e.dayNumber-t.dayNumber+(e.secondsOfDay-t.secondsOfDay)/rt.SECONDS_PER_DAY},bt.computeTaiMinusUtc=function(e){ut.julianDate=e;const t=bt.leapSeconds;let n=Xe(t,ut,at);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset},bt.addSeconds=function(e,t,n){return dt(e.dayNumber,e.secondsOfDay+t,n)},bt.addMinutes=function(e,t,n){const r=e.secondsOfDay+t*rt.SECONDS_PER_MINUTE;return dt(e.dayNumber,r,n)},bt.addHours=function(e,t,n){const r=e.secondsOfDay+t*rt.SECONDS_PER_HOUR;return dt(e.dayNumber,r,n)},bt.addDays=function(e,t,n){return dt(e.dayNumber+t,e.secondsOfDay,n)},bt.lessThan=function(e,t){return bt.compare(e,t)<0},bt.lessThanOrEquals=function(e,t){return bt.compare(e,t)<=0},bt.greaterThan=function(e,t){return bt.compare(e,t)>0},bt.greaterThanOrEquals=function(e,t){return bt.compare(e,t)>=0},bt.prototype.clone=function(e){return bt.clone(this,e)},bt.prototype.equals=function(e){return bt.equals(this,e)},bt.prototype.equalsEpsilon=function(e,t){return bt.equalsEpsilon(this,e,t)},bt.prototype.toString=function(){return bt.toIso8601(this)},bt.leapSeconds=[new nt(new bt(2441317,43210,ot.TAI),10),new nt(new bt(2441499,43211,ot.TAI),11),new nt(new bt(2441683,43212,ot.TAI),12),new nt(new bt(2442048,43213,ot.TAI),13),new nt(new bt(2442413,43214,ot.TAI),14),new nt(new bt(2442778,43215,ot.TAI),15),new nt(new bt(2443144,43216,ot.TAI),16),new nt(new bt(2443509,43217,ot.TAI),17),new nt(new bt(2443874,43218,ot.TAI),18),new nt(new bt(2444239,43219,ot.TAI),19),new nt(new bt(2444786,43220,ot.TAI),20),new nt(new bt(2445151,43221,ot.TAI),21),new nt(new bt(2445516,43222,ot.TAI),22),new nt(new bt(2446247,43223,ot.TAI),23),new nt(new bt(2447161,43224,ot.TAI),24),new nt(new bt(2447892,43225,ot.TAI),25),new nt(new bt(2448257,43226,ot.TAI),26),new nt(new bt(2448804,43227,ot.TAI),27),new nt(new bt(2449169,43228,ot.TAI),28),new nt(new bt(2449534,43229,ot.TAI),29),new nt(new bt(2450083,43230,ot.TAI),30),new nt(new bt(2450630,43231,ot.TAI),31),new nt(new bt(2451179,43232,ot.TAI),32),new nt(new bt(2453736,43233,ot.TAI),33),new nt(new bt(2454832,43234,ot.TAI),34),new nt(new bt(2456109,43235,ot.TAI),35),new nt(new bt(2457204,43236,ot.TAI),36),new nt(new bt(2457754,43237,ot.TAI),37)];var St=r.createCommonjsModule((function(e,t){!function(n){var o=t&&!t.nodeType&&t,i=e&&!e.nodeType&&e,s="object"==typeof r.commonjsGlobal&&r.commonjsGlobal;s.global!==s&&s.window!==s&&s.self!==s||(n=s);var a,u,c=2147483647,l=36,d=/^xn--/,f=/[^\x20-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,g=String.fromCharCode;function y(e){throw new RangeError(h[e])}function v(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function w(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+v((e=e.replace(p,".")).split("."),t).join(".")}function C(e){for(var t,n,r=[],o=0,i=e.length;o=55296&&t<=56319&&o65535&&(t+=g((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=g(e)})).join("")}function b(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function x(e,t,n){var r=0;for(e=n?m(e/700):e>>1,e+=m(e/t);e>455;r+=l)e=m(e/35);return m(r+36*e/(e+38))}function S(e){var t,n,r,o,i,s,a,u,d,f,p,h=[],g=e.length,v=0,w=128,C=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r=128&&y("not-basic"),h.push(e.charCodeAt(r));for(o=n>0?n+1:0;o=g&&y("invalid-input"),((u=(p=e.charCodeAt(o++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:l)>=l||u>m((c-v)/s))&&y("overflow"),v+=u*s,!(u<(d=a<=C?1:a>=C+26?26:a-C));a+=l)s>m(c/(f=l-d))&&y("overflow"),s*=f;C=x(v-i,t=h.length+1,0==i),m(v/t)>c-w&&y("overflow"),w+=m(v/t),v%=t,h.splice(v++,0,w)}return _(h)}function A(e){var t,n,r,o,i,s,a,u,d,f,p,h,v,w,_,S=[];for(h=(e=C(e)).length,t=128,n=0,i=72,s=0;s=t&&pm((c-n)/(v=r+1))&&y("overflow"),n+=(a-t)*v,t=a,s=0;sc&&y("overflow"),p==t){for(u=n,d=l;!(u<(f=d<=i?1:d>=i+26?26:d-i));d+=l)_=u-f,w=l-f,S.push(g(b(f+_%w,0))),u=m(_/w);S.push(g(b(u,0))),i=x(n,v,r==o),n=0,++r}++n,++t}return S.join("")}if(a={version:"1.3.2",ucs2:{decode:C,encode:_},decode:S,encode:A,toASCII:function(e){return w(e,(function(e){return f.test(e)?"xn--"+A(e):e}))},toUnicode:function(e){return w(e,(function(e){return d.test(e)?S(e.slice(4).toLowerCase()):e}))}},o&&i)if(e.exports==o)i.exports=a;else for(u in a)a.hasOwnProperty(u)&&(o[u]=a[u]);else n.punycode=a}(r.commonjsGlobal)})),At=r.createCommonjsModule((function(e){ /*! * URI.js - Mutating URLs * IPv6 Support * * Version: 1.19.8 * * Author: Rodney Rehm * Web: http://medialize.github.io/URI.js/ * * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * */var t,n;t=r.commonjsGlobal,n=function(e){var t=e&&e.IPv6;return{best:function(e){var t,n,r=e.toLowerCase().split(":"),o=r.length,i=8;for(""===r[0]&&""===r[1]&&""===r[2]?(r.shift(),r.shift()):""===r[0]&&""===r[1]?r.shift():""===r[o-1]&&""===r[o-2]&&r.pop(),-1!==r[(o=r.length)-1].indexOf(".")&&(i=7),t=0;t1;a++)n.splice(0,1);r[s]=n.join("")}var u=-1,c=0,l=0,d=-1,f=!1;for(s=0;sc&&(u=d,c=l)):"0"===r[s]&&(f=!0,d=s,l=1);l>c&&(u=d,c=l),c>1&&r.splice(u,c,""),o=r.length;var p="";for(""===r[0]&&(p=":"),s=0;s=e.length-1)return!1;var r=e.lastIndexOf(".",t-1);if(r<=0||r>=t-1)return!1;var o=n.list[e.slice(t+1)];return!!o&&o.indexOf(" "+e.slice(r+1,t)+" ")>=0},is:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;if(e.lastIndexOf(".",t-1)>=0)return!1;var r=n.list[e.slice(t+1)];return!!r&&r.indexOf(" "+e.slice(0,t)+" ")>=0},get:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return null;var r=e.lastIndexOf(".",t-1);if(r<=0||r>=t-1)return null;var o=n.list[e.slice(t+1)];return o?o.indexOf(" "+e.slice(r+1,t)+" ")<0?null:e.slice(r+1):null},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n},e.exports?e.exports=n():t.SecondLevelDomains=n(t)})),Ot=r.createCommonjsModule((function(e){ /*! * URI.js - Mutating URLs * * Version: 1.19.8 * * Author: Rodney Rehm * Web: http://medialize.github.io/URI.js/ * * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * */var t,n;t=r.commonjsGlobal,n=function(e,t,n,r){var o=r&&r.URI;function i(e,t){var n=arguments.length>=1,r=arguments.length>=2;if(!(this instanceof i))return n?r?new i(e,t):new i(e):new i;if(void 0===e){if(n)throw new TypeError("undefined is not a valid argument for URI");e="undefined"!=typeof location?location.href+"":""}if(null===e&&n)throw new TypeError("null is not a valid argument for URI");return this.href(e),void 0!==t?this.absoluteTo(t):this}i.version="1.19.8";var s=i.prototype,a=Object.prototype.hasOwnProperty;function u(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function c(e){return void 0===e?"Undefined":String(Object.prototype.toString.call(e)).slice(8,-1)}function l(e){return"Array"===c(e)}function d(e,t){var n,r,o={};if("RegExp"===c(t))o=null;else if(l(t))for(n=0,r=t.length;n]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,i.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},i.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},i.hostProtocols=["http","https"],i.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,i.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"},i.getDomAttribute=function(e){if(e&&e.nodeName){var t=e.nodeName.toLowerCase();if("input"!==t||"image"===e.type)return i.domAttributes[t]}},i.encode=g,i.decode=decodeURIComponent,i.iso8859=function(){i.encode=escape,i.decode=unescape},i.unicode=function(){i.encode=g,i.decode=decodeURIComponent},i.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,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)/gi,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)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},i.encodeQuery=function(e,t){var n=i.encode(e+"");return void 0===t&&(t=i.escapeQuerySpace),t?n.replace(/%20/g,"+"):n},i.decodeQuery=function(e,t){e+="",void 0===t&&(t=i.escapeQuerySpace);try{return i.decode(t?e.replace(/\+/g,"%20"):e)}catch(t){return e}};var y,v={encode:"encode",decode:"decode"},w=function(e,t){return function(n){try{return i[t](n+"").replace(i.characters[e][t].expression,(function(n){return i.characters[e][t].map[n]}))}catch(e){return n}}};for(y in v)i[y+"PathSegment"]=w("pathname",v[y]),i[y+"UrnPathSegment"]=w("urnpath",v[y]);var C=function(e,t,n){return function(r){var o;o=n?function(e){return i[t](i[n](e))}:i[t];for(var s=(r+"").split(e),a=0,u=s.length;a-1&&(t.fragment=e.substring(n+1)||null,e=e.substring(0,n)),(n=e.indexOf("?"))>-1&&(t.query=e.substring(n+1)||null,e=e.substring(0,n)),"//"===(e=e.replace(/^(https?|ftp|wss?)?:[/\\]*/i,"$1://")).substring(0,2)?(t.protocol=null,e=e.substring(2),e=i.parseAuthority(e,t)):(n=e.indexOf(":"))>-1&&(t.protocol=e.substring(0,n)||null,t.protocol&&!t.protocol.match(i.protocol_expression)?t.protocol=void 0:"//"===e.substring(n+1,n+3).replace(/\\/g,"/")?(e=e.substring(n+3),e=i.parseAuthority(e,t)):(e=e.substring(n+1),t.urn=!0)),t.path=e,t},i.parseHost=function(e,t){e||(e="");var n,r,o=(e=e.replace(/\\/g,"/")).indexOf("/");if(-1===o&&(o=e.length),"["===e.charAt(0))n=e.indexOf("]"),t.hostname=e.substring(1,n)||null,t.port=e.substring(n+2,o)||null,"/"===t.port&&(t.port=null);else{var s=e.indexOf(":"),a=e.indexOf("/"),u=e.indexOf(":",s+1);-1!==u&&(-1===a||u-1?o:e.length-1);return s>-1&&(-1===o||s-1?p.slice(0,h)+p.slice(h).replace(s,""):p.replace(s,"")).length<=c[0].length||n.ignore&&n.ignore.test(p))){var y=t(p,l,f=l+p.length,e);void 0!==y?(y=String(y),e=e.slice(0,l)+y+e.slice(f),r.lastIndex=l+y.length):r.lastIndex=f}}return r.lastIndex=0,e},i.ensureValidHostname=function(t,n){var r=!!t,o=!1;if(!!n&&(o=f(i.hostProtocols,n)),o&&!r)throw new TypeError("Hostname cannot be empty, if protocol is "+n);if(t&&t.match(i.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(t).match(i.invalid_hostname_characters))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_]')}},i.ensureValidPort=function(e){if(e){var t=Number(e);if(!(/^[0-9]+$/.test(t)&&t>0&&t<65536))throw new TypeError('Port "'+e+'" is not a valid port')}},i.noConflict=function(e){if(e){var t={URI:this.noConflict()};return r.URITemplate&&"function"==typeof r.URITemplate.noConflict&&(t.URITemplate=r.URITemplate.noConflict()),r.IPv6&&"function"==typeof r.IPv6.noConflict&&(t.IPv6=r.IPv6.noConflict()),r.SecondLevelDomains&&"function"==typeof r.SecondLevelDomains.noConflict&&(t.SecondLevelDomains=r.SecondLevelDomains.noConflict()),t}return r.URI===this&&(r.URI=o),this},s.build=function(e){return!0===e?this._deferred_build=!0:(void 0===e||this._deferred_build)&&(this._string=i.build(this._parts),this._deferred_build=!1),this},s.clone=function(){return new i(this)},s.valueOf=s.toString=function(){return this.build(!1)._string},s.protocol=_("protocol"),s.username=_("username"),s.password=_("password"),s.hostname=_("hostname"),s.port=_("port"),s.query=b("query","?"),s.fragment=b("fragment","#"),s.search=function(e,t){var n=this.query(e,t);return"string"==typeof n&&n.length?"?"+n:n},s.hash=function(e,t){var n=this.fragment(e,t);return"string"==typeof n&&n.length?"#"+n:n},s.pathname=function(e,t){if(void 0===e||!0===e){var n=this._parts.path||(this._parts.hostname?"/":"");return e?(this._parts.urn?i.decodeUrnPath:i.decodePath)(n):n}return this._parts.urn?this._parts.path=e?i.recodeUrnPath(e):"":this._parts.path=e?i.recodePath(e):"/",this.build(!t),this},s.path=s.pathname,s.href=function(e,t){var n;if(void 0===e)return this.toString();this._string="",this._parts=i._parts();var r=e instanceof i,o="object"==typeof e&&(e.hostname||e.path||e.pathname);if(e.nodeName&&(e=e[i.getDomAttribute(e)]||"",o=!1),!r&&o&&void 0!==e.pathname&&(e=e.toString()),"string"==typeof e||e instanceof String)this._parts=i.parse(String(e),this._parts);else{if(!r&&!o)throw new TypeError("invalid input");var s=r?e._parts:e;for(n in s)"query"!==n&&a.call(this._parts,n)&&(this._parts[n]=s[n]);s.query&&this.query(s.query,!1)}return this.build(!t),this},s.is=function(e){var t=!1,r=!1,o=!1,s=!1,a=!1,u=!1,c=!1,l=!this._parts.urn;switch(this._parts.hostname&&(l=!1,r=i.ip4_expression.test(this._parts.hostname),o=i.ip6_expression.test(this._parts.hostname),a=(s=!(t=r||o))&&n&&n.has(this._parts.hostname),u=s&&i.idn_expression.test(this._parts.hostname),c=s&&i.punycode_expression.test(this._parts.hostname)),e.toLowerCase()){case"relative":return l;case"absolute":return!l;case"domain":case"name":return s;case"sld":return a;case"ip":return t;case"ip4":case"ipv4":case"inet4":return r;case"ip6":case"ipv6":case"inet6":return o;case"idn":return u;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return c}return null};var x=s.protocol,S=s.port,A=s.hostname;s.protocol=function(e,t){if(e&&!(e=e.replace(/:(\/\/)?$/,"")).match(i.protocol_expression))throw new TypeError('Protocol "'+e+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return x.call(this,e,t)},s.scheme=s.protocol,s.port=function(e,t){return this._parts.urn?void 0===e?"":this:(void 0!==e&&(0===e&&(e=null),e&&(":"===(e+="").charAt(0)&&(e=e.substring(1)),i.ensureValidPort(e))),S.call(this,e,t))},s.hostname=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0!==e){var n={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==i.parseHost(e,n))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');e=n.hostname,this._parts.preventInvalidHostname&&i.ensureValidHostname(e,this._parts.protocol)}return A.call(this,e,t)},s.origin=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var n=this.protocol();return this.authority()?(n?n+"://":"")+this.authority():""}var r=i(e);return this.protocol(r.protocol()).authority(r.authority()).build(!t),this},s.host=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?i.buildHost(this._parts):"";if("/"!==i.parseHost(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},s.authority=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?i.buildAuthority(this._parts):"";if("/"!==i.parseAuthority(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},s.userinfo=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var n=i.buildUserinfo(this._parts);return n?n.substring(0,n.length-1):n}return"@"!==e[e.length-1]&&(e+="@"),i.parseUserinfo(e,this._parts),this.build(!t),this},s.resource=function(e,t){var n;return void 0===e?this.path()+this.search()+this.hash():(n=i.parse(e),this._parts.path=n.path,this._parts.query=n.query,this._parts.fragment=n.fragment,this.build(!t),this)},s.subdomain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,n)||""}var r=this._parts.hostname.length-this.domain().length,o=this._parts.hostname.substring(0,r),s=new RegExp("^"+u(o));if(e&&"."!==e.charAt(e.length-1)&&(e+="."),-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");return e&&i.ensureValidHostname(e,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(s,e),this.build(!t),this},s.domain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.match(/\./g);if(n&&n.length<2)return this._parts.hostname;var r=this._parts.hostname.length-this.tld(t).length-1;return r=this._parts.hostname.lastIndexOf(".",r-1)+1,this._parts.hostname.substring(r)||""}if(!e)throw new TypeError("cannot set domain empty");if(-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");if(i.ensureValidHostname(e,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=e;else{var o=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(o,e)}return this.build(!t),this},s.tld=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.lastIndexOf("."),o=this._parts.hostname.substring(r+1);return!0!==t&&n&&n.list[o.toLowerCase()]&&n.get(this._parts.hostname)||o}var i;if(!e)throw new TypeError("cannot set TLD empty");if(e.match(/[^a-zA-Z0-9-]/)){if(!n||!n.is(e))throw new TypeError('TLD "'+e+'" contains characters other than [A-Z0-9]');i=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");i=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}return this.build(!t),this},s.directory=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var n=this._parts.path.length-this.filename().length-1,r=this._parts.path.substring(0,n)||(this._parts.hostname?"/":"");return e?i.decodePath(r):r}var o=this._parts.path.length-this.filename().length,s=this._parts.path.substring(0,o),a=new RegExp("^"+u(s));return this.is("relative")||(e||(e="/"),"/"!==e.charAt(0)&&(e="/"+e)),e&&"/"!==e.charAt(e.length-1)&&(e+="/"),e=i.recodePath(e),this._parts.path=this._parts.path.replace(a,e),this.build(!t),this},s.filename=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("string"!=typeof e){if(!this._parts.path||"/"===this._parts.path)return"";var n=this._parts.path.lastIndexOf("/"),r=this._parts.path.substring(n+1);return e?i.decodePathSegment(r):r}var o=!1;"/"===e.charAt(0)&&(e=e.substring(1)),e.match(/\.?\//)&&(o=!0);var s=new RegExp(u(this.filename())+"$");return e=i.recodePath(e),this._parts.path=this._parts.path.replace(s,e),o?this.normalizePath(t):this.build(!t),this},s.suffix=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path||"/"===this._parts.path)return"";var n,r,o=this.filename(),s=o.lastIndexOf(".");return-1===s?"":(n=o.substring(s+1),r=/^[a-z0-9%]+$/i.test(n)?n:"",e?i.decodePathSegment(r):r)}"."===e.charAt(0)&&(e=e.substring(1));var a,c=this.suffix();if(c)a=e?new RegExp(u(c)+"$"):new RegExp(u("."+c)+"$");else{if(!e)return this;this._parts.path+="."+i.recodePath(e)}return a&&(e=i.recodePath(e),this._parts.path=this._parts.path.replace(a,e)),this.build(!t),this},s.segment=function(e,t,n){var r=this._parts.urn?":":"/",o=this.path(),i="/"===o.substring(0,1),s=o.split(r);if(void 0!==e&&"number"!=typeof e&&(n=t,t=e,e=void 0),void 0!==e&&"number"!=typeof e)throw new Error('Bad segment "'+e+'", must be 0-based integer');if(i&&s.shift(),e<0&&(e=Math.max(s.length+e,0)),void 0===t)return void 0===e?s:s[e];if(null===e||void 0===s[e])if(l(t)){s=[];for(var a=0,u=t.length;a0){const e=r.substring(0,o),n=r.substring(o+2);t[e]=n}}return t}(this.responseHeaders))}function Bt(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}function Vt(e,t){return t-e}function Lt(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}function Qt(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}Nt.prototype.cancel=function(){this.cancelled=!0},Nt.prototype.clone=function(e){return r.defined(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=this.RequestState.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new Nt(this)},jt.prototype.toString=function(){let e="Request has failed.";return r.defined(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e},Object.defineProperties(Bt.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),Bt.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);const n=this;return function(){n.removeEventListener(e,t)}},Bt.prototype.removeEventListener=function(e,t){const n=this._listeners,r=this._scopes;let o=-1;for(let i=0;i0){for(i.sort(Vt),e=0;e=0;--t)this.heapify(t)},Lt.prototype.insert=function(e){const t=this._array,n=this._comparator,o=this._maximumLength;let i,s=this._length++;for(so&&(i=t[o],this._length=o),i},Lt.prototype.pop=function(e){if(e=r.defaultValue(e,0),0===this._length)return;const t=this._array,n=t[e];return Qt(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};const $t={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0};let Wt=20;const Ht=new Lt({comparator:function(e,t){return e.priority-t.priority}});Ht.maximumLength=Wt,Ht.reserve(Wt);const Yt=[];let Zt={};const Gt="undefined"!=typeof document?new Ot(document.location.href):new Ot,Jt=new Bt;function Xt(){}function Kt(e){r.defined(e.priorityFunction)&&(e.priority=e.priorityFunction())}function en(e){return e.state===kt.UNISSUED&&(e.state=kt.ISSUED,e.deferred=r.when.defer()),e.deferred.promise}function tn(e){const t=en(e);return e.state=kt.ACTIVE,Yt.push(e),++$t.numberOfActiveRequests,++$t.numberOfActiveRequestsEver,++Zt[e.serverKey],e.requestFunction().then(function(e){return function(t){if(e.state===kt.CANCELLED)return;const n=e.deferred;--$t.numberOfActiveRequests,--Zt[e.serverKey],Jt.raiseEvent(),e.state=kt.RECEIVED,e.deferred=void 0,n.resolve(t)}}(e)).otherwise(function(e){return function(t){e.state!==kt.CANCELLED&&(++$t.numberOfFailedRequests,--$t.numberOfActiveRequests,--Zt[e.serverKey],Jt.raiseEvent(t),e.state=kt.FAILED,e.deferred.reject(t))}}(e)),t}function nn(e){const t=e.state===kt.ACTIVE;if(e.state=kt.CANCELLED,++$t.numberOfCancelledRequests,r.defined(e.deferred)){const t=e.deferred;e.deferred=void 0,t.reject()}t&&(--$t.numberOfActiveRequests,--Zt[e.serverKey],++$t.numberOfCancelledActiveRequests),r.defined(e.cancelFunction)&&e.cancelFunction()}Xt.maximumRequests=50,Xt.maximumRequestsPerServer=6,Xt.requestsByServer={"api.cesium.com:443":18,"assets.cesium.com:443":18},Xt.throttleRequests=!0,Xt.debugShowStatistics=!1,Xt.requestCompletedEvent=Jt,Object.defineProperties(Xt,{statistics:{get:function(){return $t}},priorityHeapLength:{get:function(){return Wt},set:function(e){if(ee;){nn(Ht.pop())}Wt=e,Ht.maximumLength=e,Ht.reserve(e)}}}),Xt.serverHasOpenSlots=function(e,t){t=r.defaultValue(t,1);const n=r.defaultValue(Xt.requestsByServer[e],Xt.maximumRequestsPerServer);return Zt[e]+t<=n},Xt.heapHasOpenSlots=function(e){return Ht.length+e<=Wt},Xt.update=function(){let e,t,n=0;const r=Yt.length;for(e=0;e0&&(Yt[e-n]=t):++n;Yt.length-=n;const o=Ht.internalArray,i=Ht.length;for(e=0;e0;)t=Ht.pop(),t.cancelled?nn(t):!t.throttleByServer||Xt.serverHasOpenSlots(t.serverKey)?(tn(t),++a):nn(t);!function(){if(!Xt.debugShowStatistics)return;0===$t.numberOfActiveRequests&&$t.lastNumberOfActiveRequests>0&&($t.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${$t.numberOfAttemptedRequests}`),$t.numberOfAttemptedRequests=0),$t.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${$t.numberOfCancelledRequests}`),$t.numberOfCancelledRequests=0),$t.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${$t.numberOfCancelledActiveRequests}`),$t.numberOfCancelledActiveRequests=0),$t.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${$t.numberOfFailedRequests}`),$t.numberOfFailedRequests=0));$t.lastNumberOfActiveRequests=$t.numberOfActiveRequests}()},Xt.getServerKey=function(e){let t=new Ot(e);""===t.scheme()&&(t=new Ot(e).absoluteTo(Gt),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${"https"===t.scheme()?"443":"80"}`);const o=Zt[n];return r.defined(o)||(Zt[n]=0),n},Xt.request=function(e){if(Ut(e.url)||zt(e.url))return Jt.raiseEvent(),e.state=kt.RECEIVED,e.requestFunction();if(++$t.numberOfAttemptedRequests,r.defined(e.serverKey)||(e.serverKey=Xt.getServerKey(e.url)),Xt.throttleRequests&&e.throttleByServer&&!Xt.serverHasOpenSlots(e.serverKey))return;if(!Xt.throttleRequests||!e.throttle)return tn(e);if(Yt.length>=Xt.maximumRequests)return;Kt(e);const t=Ht.insert(e);if(r.defined(t)){if(t===e)return;nn(t)}return en(e)},Xt.clearForSpecs=function(){for(;Ht.length>0;){nn(Ht.pop())}const e=Yt.length;for(let t=0;t0}}}),fn.prototype.toString=function(){return this.getUrlComponent(!0,!0)},fn.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;const n=new Ot(this._url);e&&un(n,this);let o=n.toString().replace(/%7B/g,"{").replace(/%7D/g,"}");const i=this._templateValues;return o=o.replace(/{(.*?)}/g,(function(e,t){const n=i[t];return r.defined(n)?encodeURIComponent(n):e})),t&&r.defined(this.proxy)&&(o=this.proxy.getURL(o)),o},fn.prototype.setQueryParameters=function(e,t){this._queryParameters=t?dn(this._queryParameters,e,!1):dn(e,this._queryParameters,!1)},fn.prototype.appendQueryParameters=function(e){this._queryParameters=dn(e,this._queryParameters,!0)},fn.prototype.setTemplateValues=function(e,t){this._templateValues=t?i.combine(this._templateValues,e):i.combine(e,this._templateValues)},fn.prototype.getDerivedResource=function(e){const t=this.clone();if(t._retryCount=0,r.defined(e.url)){const n=new Ot(e.url);an(n,t,!0,r.defaultValue(e.preserveQueryParameters,!1)),n.fragment(""),""!==n.scheme()?t._url=n.toString():t._url=n.absoluteTo(new Ot(Rt(this._url))).toString()}return r.defined(e.queryParameters)&&(t._queryParameters=i.combine(e.queryParameters,t._queryParameters)),r.defined(e.templateValues)&&(t._templateValues=i.combine(e.templateValues,t.templateValues)),r.defined(e.headers)&&(t.headers=i.combine(e.headers,t.headers)),r.defined(e.proxy)&&(t.proxy=e.proxy),r.defined(e.request)&&(t.request=e.request),r.defined(e.retryCallback)&&(t.retryCallback=e.retryCallback),r.defined(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t},fn.prototype.retryOnError=function(e){const t=this.retryCallback;if("function"!=typeof t||this._retryCount>=this.retryAttempts)return r.when(!1);const n=this;return r.when(t(this,e)).then((function(e){return++n._retryCount,e}))},fn.prototype.clone=function(e){return r.defined(e)||(e=new fn({url:this._url})),e._url=this._url,e._queryParameters=It(this._queryParameters),e._templateValues=It(this._templateValues),e.headers=It(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e},fn.prototype.getBaseUri=function(e){return function(e,t){let n="";const r=e.lastIndexOf("/");return-1!==r&&(n=e.substring(0,r+1)),t?(0!==(e=new Ot(e)).query().length&&(n+=`?${e.query()}`),0!==e.fragment().length&&(n+=`#${e.fragment()}`),n):n}(this.getUrlComponent(e),e)},fn.prototype.appendForwardSlash=function(){var e;this._url=(0!==(e=this._url).length&&"/"===e[e.length-1]||(e=`${e}/`),e)},fn.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},fn.fetchArrayBuffer=function(e){return new fn(e).fetchArrayBuffer()},fn.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},fn.fetchBlob=function(e){return new fn(e).fetchBlob()},fn.prototype.fetchImage=function(e){e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT);const t=r.defaultValue(e.preferImageBitmap,!1),n=r.defaultValue(e.preferBlob,!1),o=r.defaultValue(e.flipY,!1),i=r.defaultValue(e.skipColorSpaceConversion,!1);if(ln(this.request),!sn||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return hn({resource:this,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:t});const s=this.fetchBlob();if(!r.defined(s))return;let a,u,c,l;return fn.supportsImageBitmapOptions().then((function(e){return a=e,u=a&&t,s})).then((function(e){if(!r.defined(e))return;if(l=e,u)return fn.createImageBitmapFromBlob(e,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});const t=window.URL.createObjectURL(e);return c=new fn({url:t}),hn({resource:c,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:!1})})).then((function(e){if(r.defined(e))return e.blob=l,u||window.URL.revokeObjectURL(c.url),e})).otherwise((function(e){return r.defined(c)&&window.URL.revokeObjectURL(c.url),e.blob=l,r.when.reject(e)}))},fn.fetchImage=function(e){return new fn(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},fn.prototype.fetchText=function(){return this.fetch({responseType:"text"})},fn.fetchText=function(e){return new fn(e).fetchText()},fn.prototype.fetchJson=function(){const e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(r.defined(e))return e.then((function(e){if(r.defined(e))return JSON.parse(e)}))},fn.fetchJson=function(e){return new fn(e).fetchJson()},fn.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},fn.fetchXML=function(e){return new fn(e).fetchXML()},fn.prototype.fetchJsonp=function(e){let t;e=r.defaultValue(e,"callback"),ln(this.request);do{t=`loadJsonp${o.CesiumMath.nextRandomNumber().toString().substring(2,8)}`}while(r.defined(window[t]));return mn(this,e,t)},fn.fetchJsonp=function(e){return new fn(e).fetchJsonp(e.callbackParameterName)},fn.prototype._makeRequest=function(e){const t=this;ln(t.request);const n=t.request;n.url=t.url,n.requestFunction=function(){const o=e.responseType,s=i.combine(e.headers,t.headers),a=e.overrideMimeType,u=e.method,c=e.data,l=r.when.defer(),d=fn._Implementations.loadWithXhr(t.url,o,u,c,s,l,a);return r.defined(d)&&r.defined(d.abort)&&(n.cancelFunction=function(){d.abort()}),l.promise};const o=Xt.request(n);if(r.defined(o))return o.then((function(e){return n.cancelFunction=void 0,e})).otherwise((function(o){return n.cancelFunction=void 0,n.state!==kt.FAILED?r.when.reject(o):t.retryOnError(o).then((function(i){return i?(n.state=kt.UNISSUED,n.deferred=void 0,t.fetch(e)):r.when.reject(o)}))}))};const gn=/^data:(.*?)(;base64)?,(.*)$/;function yn(e,t){const n=decodeURIComponent(t);return e?atob(n):n}function vn(e,t){const n=yn(e,t),r=new ArrayBuffer(n.length),o=new Uint8Array(r);for(let e=0;et.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;const u=t[o],c=t[i];if(u.equals(c)||r.equals(u))return Sn(e,n,o,a,s),s;if(r.equals(c))return Sn(e,n,i,a,s),s;const l=bt.secondsDifference(r,u)/bt.secondsDifference(c,u),d=o*a,f=i*a;let p=n[d+e._ut1MinusUtcSecondsColumn],h=n[f+e._ut1MinusUtcSecondsColumn];const m=h-p;if(m>.5||m<-.5){const t=n[d+e._taiMinusUtcSecondsColumn],o=n[f+e._taiMinusUtcSecondsColumn];t!==o&&(c.equals(r)?p=h:h-=o-t)}return s.xPoleWander=An(l,n[d+e._xPoleWanderRadiansColumn],n[f+e._xPoleWanderRadiansColumn]),s.yPoleWander=An(l,n[d+e._yPoleWanderRadiansColumn],n[f+e._yPoleWanderRadiansColumn]),s.xPoleOffset=An(l,n[d+e._xCelestialPoleOffsetRadiansColumn],n[f+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=An(l,n[d+e._yCelestialPoleOffsetRadiansColumn],n[f+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=An(l,p,h),s}function On(e,t,n){this.heading=r.defaultValue(e,0),this.pitch=r.defaultValue(t,0),this.roll=r.defaultValue(n,0)}fn._Implementations.loadWithXhr=function(e,t,o,i,s,a,u){const c=gn.exec(e);if(null!==c)return void a.resolve(function(e,t){t=r.defaultValue(t,"");const n=e[1],o=!!e[2],i=e[3];let s,a;switch(t){case"":case"text":return yn(o,i);case"arraybuffer":return vn(o,i);case"blob":return s=vn(o,i),new Blob([s],{type:n});case"document":return a=new DOMParser,a.parseFromString(yn(o,i),n);case"json":return JSON.parse(yn(o,i))}}(c,t));if(Cn)return void function(e,t,r,o,i,s,a){const u=require("url").parse(e),c="https:"===u.protocol?require("https"):require("http"),l=require("zlib"),d={protocol:u.protocol,hostname:u.hostname,port:u.port,path:u.path,query:u.query,method:r,headers:i};c.request(d).on("response",(function(e){if(e.statusCode<200||e.statusCode>=300)return void s.reject(new jt(e.statusCode,e,e.headers));const r=[];e.on("data",(function(e){r.push(e)})),e.on("end",(function(){const o=Buffer.concat(r);"gzip"===e.headers["content-encoding"]?l.gunzip(o,(function(e,r){e?s.reject(new n.RuntimeError("Error decompressing response.")):s.resolve(wn(r,t))})):s.resolve(wn(o,t))}))})).on("error",(function(e){s.reject(new jt)})).end()}(e,t,o,0,s,a);const l=new XMLHttpRequest;if(rn.contains(e)&&(l.withCredentials=!0),l.open(o,e,!0),r.defined(u)&&r.defined(l.overrideMimeType)&&l.overrideMimeType(u),r.defined(s))for(const e in s)s.hasOwnProperty(e)&&l.setRequestHeader(e,s[e]);r.defined(t)&&(l.responseType=t);let d=!1;return"string"==typeof e&&(d=0===e.indexOf("file://")||"undefined"!=typeof window&&"file://"===window.location.origin),l.onload=function(){if((l.status<200||l.status>=300)&&(!d||0!==l.status))return void a.reject(new jt(l.status,l.response,l.getAllResponseHeaders()));const e=l.response,i=l.responseType;if("HEAD"===o||"OPTIONS"===o){const e=l.getAllResponseHeaders().trim().split(/[\r\n]+/),t={};return e.forEach((function(e){const n=e.split(": "),r=n.shift();t[r]=n.join(": ")})),void a.resolve(t)}if(204===l.status)a.resolve();else if(!r.defined(e)||r.defined(t)&&i!==t)if("json"===t&&"string"==typeof e)try{a.resolve(JSON.parse(e))}catch(e){a.reject(e)}else(""===i||"document"===i)&&r.defined(l.responseXML)&&l.responseXML.hasChildNodes()?a.resolve(l.responseXML):""!==i&&"text"!==i||!r.defined(l.responseText)?a.reject(new n.RuntimeError("Invalid XMLHttpRequest response type.")):a.resolve(l.responseText);else a.resolve(e)},l.onerror=function(e){a.reject(new jt)},l.send(i),l},fn._Implementations.loadAndExecuteScript=function(e,t,n){return function(e){const t=r.when.defer(),n=document.createElement("script");n.async=!0,n.src=e;const o=document.getElementsByTagName("head")[0];return n.onload=function(){n.onload=void 0,o.removeChild(n),t.resolve()},n.onerror=function(e){t.reject(e)},o.appendChild(n),t.promise}(e).otherwise(n.reject)},fn._DefaultImplementations={},fn._DefaultImplementations.createImage=fn._Implementations.createImage,fn._DefaultImplementations.loadWithXhr=fn._Implementations.loadWithXhr,fn._DefaultImplementations.loadAndExecuteScript=fn._Implementations.loadAndExecuteScript,fn.DEFAULT=Object.freeze(new fn({url:"undefined"==typeof document?"":document.location.href.split("?")[0]})),_n.NONE=Object.freeze({getPromiseToLoad:function(){return r.when.resolve()},compute:function(e,t){return r.defined(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new Ke(0,0,0,0,0),t}}),_n.prototype.getPromiseToLoad=function(){return r.when(this._downloadPromise)},_n.prototype.compute=function(e,t){if(!r.defined(this._samples)){if(r.defined(this._dataError))throw new n.RuntimeError(this._dataError);return}if(r.defined(t)||(t=new Ke(0,0,0,0,0)),0===this._samples.length)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;const o=this._dates,i=this._lastIndex;let s=0,a=0;if(r.defined(i)){const n=o[i],u=o[i+1],c=bt.lessThanOrEquals(n,e),l=!r.defined(u),d=l||bt.greaterThanOrEquals(u,e);if(c&&d)return s=i,!l&&u.equals(e)&&++s,a=s+1,En(this,o,this._samples,e,s,a,t),t}let u=Xe(o,e,bt.compare,this._dateColumn);return u>=0?(u=this._totalSamples&&(u=this._totalSamples-1);const c=a/this._samplesPerXysFile|0,l=u/this._samplesPerXysFile|0,d=[];for(let e=c;e<=l;++e)d.push(Bn(this,e));return r.when.all(d)},Fn.prototype.computeXysRadians=function(e,t,n){const o=jn(this,e,t);if(o<0)return;const i=o/this._stepSizeDays|0;if(i>=this._totalSamples)return;const s=this._interpolationOrder;let a=i-(s/2|0);a<0&&(a=0);let u=a+s;u>=this._totalSamples&&(u=this._totalSamples-1,a=u-s,a<0&&(a=0));let c=!1;const l=this._samples;if(r.defined(l[3*a])||(Bn(this,a/this._samplesPerXysFile|0),c=!0),r.defined(l[3*u])||(Bn(this,u/this._samplesPerXysFile|0),c=!0),c)return;r.defined(n)?(n.x=0,n.y=0,n.s=0):n=new kn(0,0,0);const d=o-a*this._stepSizeDays,f=this._work,p=this._denominators,h=this._coef,m=this._xTable;let g,y;for(g=0;g<=s;++g)f[g]=d-m[g];for(g=0;g<=s;++g){for(h[g]=1,y=0;y<=s;++y)y!==g&&(h[g]*=f[y]);h[g]*=p[g];let e=3*(a+g);n.x+=h[g]*l[e++],n.y+=h[g]*l[e++],n.s+=h[g]*l[e]}return n};const Vn={},Ln={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"}},Qn={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},$n={},Wn={east:new t.Cartesian3,north:new t.Cartesian3,up:new t.Cartesian3,west:new t.Cartesian3,south:new t.Cartesian3,down:new t.Cartesian3};let Hn=new t.Cartesian3,Yn=new t.Cartesian3,Zn=new t.Cartesian3;Vn.localFrameToFixedFrameGenerator=function(e,i){if(!Ln.hasOwnProperty(e)||!Ln[e].hasOwnProperty(i))throw new n.DeveloperError("firstAxis and secondAxis must be east, north, up, west, south or down.");const s=Ln[e][i];let a;const u=e+i;return r.defined($n[u])?a=$n[u]:(a=function(n,a,u){if(r.defined(u)||(u=new t.Matrix4),t.Cartesian3.equalsEpsilon(n,t.Cartesian3.ZERO,o.CesiumMath.EPSILON14))t.Cartesian3.unpack(Qn[e],0,Hn),t.Cartesian3.unpack(Qn[i],0,Yn),t.Cartesian3.unpack(Qn[s],0,Zn);else if(o.CesiumMath.equalsEpsilon(n.x,0,o.CesiumMath.EPSILON14)&&o.CesiumMath.equalsEpsilon(n.y,0,o.CesiumMath.EPSILON14)){const r=o.CesiumMath.sign(n.z);t.Cartesian3.unpack(Qn[e],0,Hn),"east"!==e&&"west"!==e&&t.Cartesian3.multiplyByScalar(Hn,r,Hn),t.Cartesian3.unpack(Qn[i],0,Yn),"east"!==i&&"west"!==i&&t.Cartesian3.multiplyByScalar(Yn,r,Yn),t.Cartesian3.unpack(Qn[s],0,Zn),"east"!==s&&"west"!==s&&t.Cartesian3.multiplyByScalar(Zn,r,Zn)}else{(a=r.defaultValue(a,t.Ellipsoid.WGS84)).geodeticSurfaceNormal(n,Wn.up);const o=Wn.up,u=Wn.east;u.x=-n.y,u.y=n.x,u.z=0,t.Cartesian3.normalize(u,Wn.east),t.Cartesian3.cross(o,u,Wn.north),t.Cartesian3.multiplyByScalar(Wn.up,-1,Wn.down),t.Cartesian3.multiplyByScalar(Wn.east,-1,Wn.west),t.Cartesian3.multiplyByScalar(Wn.north,-1,Wn.south),Hn=Wn[e],Yn=Wn[i],Zn=Wn[s]}return u[0]=Hn.x,u[1]=Hn.y,u[2]=Hn.z,u[3]=0,u[4]=Yn.x,u[5]=Yn.y,u[6]=Yn.z,u[7]=0,u[8]=Zn.x,u[9]=Zn.y,u[10]=Zn.z,u[11]=0,u[12]=n.x,u[13]=n.y,u[14]=n.z,u[15]=1,u},$n[u]=a),a},Vn.eastNorthUpToFixedFrame=Vn.localFrameToFixedFrameGenerator("east","north"),Vn.northEastDownToFixedFrame=Vn.localFrameToFixedFrameGenerator("north","east"),Vn.northUpEastToFixedFrame=Vn.localFrameToFixedFrameGenerator("north","up"),Vn.northWestUpToFixedFrame=Vn.localFrameToFixedFrameGenerator("north","west");const Gn=new Ae,Jn=new t.Cartesian3(1,1,1),Xn=new t.Matrix4;Vn.headingPitchRollToFixedFrame=function(e,n,o,i,s){i=r.defaultValue(i,Vn.eastNorthUpToFixedFrame);const a=Ae.fromHeadingPitchRoll(n,Gn),u=t.Matrix4.fromTranslationQuaternionRotationScale(t.Cartesian3.ZERO,a,Jn,Xn);return s=i(e,o,s),t.Matrix4.multiply(s,u,s)};const Kn=new t.Matrix4,er=new t.Matrix3;Vn.headingPitchRollQuaternion=function(e,n,r,o,i){const s=Vn.headingPitchRollToFixedFrame(e,n,r,o,Kn),a=t.Matrix4.getMatrix3(s,er);return Ae.fromRotationMatrix(a,i)};const tr=new t.Cartesian3(1,1,1),nr=new t.Cartesian3,rr=new t.Matrix4,or=new t.Matrix4,ir=new t.Matrix3,sr=new Ae;Vn.fixedFrameToHeadingPitchRoll=function(e,n,o,i){n=r.defaultValue(n,t.Ellipsoid.WGS84),o=r.defaultValue(o,Vn.eastNorthUpToFixedFrame),r.defined(i)||(i=new On);const s=t.Matrix4.getTranslation(e,nr);if(t.Cartesian3.equals(s,t.Cartesian3.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let a=t.Matrix4.inverseTransformation(o(s,n,rr),rr),u=t.Matrix4.setScale(e,tr,or);u=t.Matrix4.setTranslation(u,t.Cartesian3.ZERO,u),a=t.Matrix4.multiply(a,u,a);let c=Ae.fromRotationMatrix(t.Matrix4.getMatrix3(a,ir),sr);return c=Ae.normalize(c,c),On.fromQuaternion(c,i)};const ar=o.CesiumMath.TWO_PI/86400;let ur=new bt;Vn.computeTemeToPseudoFixedMatrix=function(e,n){ur=bt.addSeconds(e,-bt.computeTaiMinusUtc(e),ur);const i=ur.dayNumber,s=ur.secondsOfDay;let a;const u=i-2451545;a=s>=43200?(u+.5)/rt.DAYS_PER_JULIAN_CENTURY:(u-.5)/rt.DAYS_PER_JULIAN_CENTURY;const c=(24110.54841+a*(8640184.812866+a*(.093104+-62e-7*a)))*ar%o.CesiumMath.TWO_PI+(72921158553e-15+11772758384668e-32*(i-2451545.5))*((s+.5*rt.SECONDS_PER_DAY)%rt.SECONDS_PER_DAY),l=Math.cos(c),d=Math.sin(c);return r.defined(n)?(n[0]=l,n[1]=-d,n[2]=0,n[3]=d,n[4]=l,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n):new t.Matrix3(l,d,0,-d,l,0,0,0,1)},Vn.iau2006XysData=new Fn,Vn.earthOrientationParameters=_n.NONE;const cr=32.184;Vn.preloadIcrfFixed=function(e){const t=e.start.dayNumber,n=e.start.secondsOfDay+cr,o=e.stop.dayNumber,i=e.stop.secondsOfDay+cr,s=Vn.iau2006XysData.preload(t,n,o,i),a=Vn.earthOrientationParameters.getPromiseToLoad();return r.when.all([s,a])},Vn.computeIcrfToFixedMatrix=function(e,n){r.defined(n)||(n=new t.Matrix3);const o=Vn.computeFixedToIcrfMatrix(e,n);if(r.defined(o))return t.Matrix3.transpose(o,n)};const lr=new kn(0,0,0),dr=new Ke(0,0,0,0,0,0),fr=new t.Matrix3,pr=new t.Matrix3;Vn.computeFixedToIcrfMatrix=function(e,n){r.defined(n)||(n=new t.Matrix3);const i=Vn.earthOrientationParameters.compute(e,dr);if(!r.defined(i))return;const s=e.dayNumber,a=e.secondsOfDay+cr,u=Vn.iau2006XysData.computeXysRadians(s,a,lr);if(!r.defined(u))return;const c=u.x+i.xPoleOffset,l=u.y+i.yPoleOffset,d=1/(1+Math.sqrt(1-c*c-l*l)),f=fr;f[0]=1-d*c*c,f[3]=-d*c*l,f[6]=c,f[1]=-d*c*l,f[4]=1-d*l*l,f[7]=l,f[2]=-c,f[5]=-l,f[8]=1-d*(c*c+l*l);const p=t.Matrix3.fromRotationZ(-u.s,pr),h=t.Matrix3.multiply(f,p,fr),m=e.dayNumber-2451545,g=(e.secondsOfDay-bt.computeTaiMinusUtc(e)+i.ut1MinusUtc)/rt.SECONDS_PER_DAY;let y=.779057273264+g+.00273781191135448*(m+g);y=y%1*o.CesiumMath.TWO_PI;const v=t.Matrix3.fromRotationZ(y,pr),w=t.Matrix3.multiply(h,v,fr),C=Math.cos(i.xPoleWander),_=Math.cos(i.yPoleWander),b=Math.sin(i.xPoleWander),x=Math.sin(i.yPoleWander);let S=s-2451545+a/rt.SECONDS_PER_DAY;S/=36525;const A=-47e-6*S*o.CesiumMath.RADIANS_PER_DEGREE/3600,E=Math.cos(A),O=Math.sin(A),I=pr;return I[0]=C*E,I[1]=C*O,I[2]=b,I[3]=-_*O+x*b*E,I[4]=_*E+x*b*O,I[5]=-x*C,I[6]=-x*O-_*b*E,I[7]=x*E-_*b*O,I[8]=_*C,t.Matrix3.multiply(w,I,n)};const hr=new t.Cartesian4;Vn.pointToWindowCoordinates=function(e,t,n,r){return(r=Vn.pointToGLWindowCoordinates(e,t,n,r)).y=2*t[5]-r.y,r},Vn.pointToGLWindowCoordinates=function(e,n,o,i){r.defined(i)||(i=new t.Cartesian2);const s=hr;return t.Matrix4.multiplyByVector(e,t.Cartesian4.fromElements(o.x,o.y,o.z,1,s),s),t.Cartesian4.multiplyByScalar(s,1/s.w,s),t.Matrix4.multiplyByVector(n,s,s),t.Cartesian2.fromCartesian4(s,i)};const mr=new t.Cartesian3,gr=new t.Cartesian3,yr=new t.Cartesian3;Vn.rotationMatrixFromPositionVelocity=function(e,n,i,s){const a=r.defaultValue(i,t.Ellipsoid.WGS84).geodeticSurfaceNormal(e,mr);let u=t.Cartesian3.cross(n,a,gr);t.Cartesian3.equalsEpsilon(u,t.Cartesian3.ZERO,o.CesiumMath.EPSILON6)&&(u=t.Cartesian3.clone(t.Cartesian3.UNIT_X,u));const c=t.Cartesian3.cross(u,n,yr);return t.Cartesian3.normalize(c,c),t.Cartesian3.cross(n,c,u),t.Cartesian3.negate(u,u),t.Cartesian3.normalize(u,u),r.defined(s)||(s=new t.Matrix3),s[0]=n.x,s[1]=n.y,s[2]=n.z,s[3]=u.x,s[4]=u.y,s[5]=u.z,s[6]=c.x,s[7]=c.y,s[8]=c.z,s};const vr=new t.Matrix4(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),wr=new t.Cartographic,Cr=new t.Cartesian3,_r=new t.Cartesian3,br=new t.Matrix3,xr=new t.Matrix4,Sr=new t.Matrix4;Vn.basisTo2D=function(e,n,r){const o=t.Matrix4.getTranslation(n,_r),i=e.ellipsoid,s=i.cartesianToCartographic(o,wr),a=e.project(s,Cr);t.Cartesian3.fromElements(a.z,a.x,a.y,a);const u=Vn.eastNorthUpToFixedFrame(o,i,xr),c=t.Matrix4.inverseTransformation(u,Sr),l=t.Matrix4.getMatrix3(n,br),d=t.Matrix4.multiplyByMatrix3(c,l,r);return t.Matrix4.multiply(vr,d,r),t.Matrix4.setTranslation(r,a,r),r},Vn.wgs84To2DModelMatrix=function(e,n,r){const o=e.ellipsoid,i=Vn.eastNorthUpToFixedFrame(n,o,xr),s=t.Matrix4.inverseTransformation(i,Sr),a=o.cartesianToCartographic(n,wr),u=e.project(a,Cr);t.Cartesian3.fromElements(u.z,u.x,u.y,u);const c=t.Matrix4.fromTranslation(u,xr);return t.Matrix4.multiply(vr,s,r),t.Matrix4.multiply(c,r,r),r},e.BoundingSphere=c,e.FeatureDetection=Se,e.GeographicProjection=s,e.Intersect=a,e.Interval=u,e.Quaternion=Ae,e.Resource=fn,e.Transforms=Vn,e.buildModuleUrl=Un}));