/** * @license * Cesium - https://github.com/CesiumGS/cesium * Version 1.99 * * Copyright 2011-2022 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Columbus View (Pat. Pend.) * * Portions licensed separately. * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ define(["require","exports","./Matrix3-edb29a7e","./defaultValue-135942ca","./Math-a304e2d6","./Matrix2-7a2bab7e","./combine-462d91dd","./RuntimeError-f0dada00"],(function(e,t,n,r,o,i,s,a){"use strict";function u(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}function c(e){let t;this.name="DeveloperError",this.message=e;try{throw new Error}catch(e){t=e.stack}this.stack=t}r.defined(Object.create)&&(c.prototype=Object.create(Error.prototype),c.prototype.constructor=c),c.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return r.defined(this.stack)&&(e+=`\n${this.stack.toString()}`),e},c.throwInstantiationError=function(){throw new c("This function defines an interface and should not be called directly.")};const l={};function d(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}l.typeOf={},l.defined=function(e,t){if(!r.defined(t))throw new c(function(e){return`${e} is required, actual value was undefined`}(e))},l.typeOf.func=function(e,t){if("function"!=typeof t)throw new c(d(typeof t,"function",e))},l.typeOf.string=function(e,t){if("string"!=typeof t)throw new c(d(typeof t,"string",e))},l.typeOf.number=function(e,t){if("number"!=typeof t)throw new c(d(typeof t,"number",e))},l.typeOf.number.lessThan=function(e,t,n){if(l.typeOf.number(e,t),t>=n)throw new c(`Expected ${e} to be less than ${n}, actual value was ${t}`)},l.typeOf.number.lessThanOrEquals=function(e,t,n){if(l.typeOf.number(e,t),t>n)throw new c(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)},l.typeOf.number.greaterThan=function(e,t,n){if(l.typeOf.number(e,t),t<=n)throw new c(`Expected ${e} to be greater than ${n}, actual value was ${t}`)},l.typeOf.number.greaterThanOrEquals=function(e,t,n){if(l.typeOf.number(e,t),tu.x&&n.Cartesian3.clone(o,u),rc.y&&n.Cartesian3.clone(o,c),dl.z&&n.Cartesian3.clone(o,l)}const p=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(u,i,A)),h=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(c,s,A)),m=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(l,a,A));let g=i,R=u,T=p;h>T&&(T=h,g=s,R=c),m>T&&(T=m,g=a,R=l);const q=E;q.x=.5*(g.x+R.x),q.y=.5*(g.y+R.y),q.z=.5*(g.z+R.z);let z=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(R,q,A)),M=Math.sqrt(z);const D=O;D.x=i.x,D.y=s.y,D.z=a.z;const U=I;U.x=u.x,U.y=c.y,U.z=l.z;const k=n.Cartesian3.midpoint(D,U,P);let F=0;for(f=0;fF&&(F=t);const r=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(o,q,A));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 Ml.x&&n.Cartesian3.clone(s,l),od.y&&n.Cartesian3.clone(s,d),if.z&&n.Cartesian3.clone(s,f)}const m=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(l,a,A)),g=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(d,u,A)),R=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(f,c,A));let T=a,q=l,z=m;g>z&&(z=g,T=u,q=d),R>z&&(z=R,T=c,q=f);const M=E;M.x=.5*(T.x+q.x),M.y=.5*(T.y+q.y),M.z=.5*(T.z+q.z);let D=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(q,M,A)),U=Math.sqrt(D);const k=O;k.x=a.x,k.y=u.y,k.z=c.z;const F=I;F.x=l.x,F.y=d.y,F.z=f.z;const N=n.Cartesian3.midpoint(k,F,P);let j=0;for(h=0;hj&&(j=r);const o=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(s,M,A));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 Uc.x&&n.Cartesian3.clone(i,c),ol.y&&n.Cartesian3.clone(i,l),fd.z&&n.Cartesian3.clone(i,d)}const h=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(c,s,A)),m=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(l,a,A)),g=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(d,u,A));let R=s,T=c,q=h;m>q&&(q=m,R=a,T=l),g>q&&(q=g,R=u,T=d);const z=E;z.x=.5*(R.x+T.x),z.y=.5*(R.y+T.y),z.z=.5*(R.z+T.z);let M=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(T,z,A)),D=Math.sqrt(M);const U=O;U.x=s.x,U.y=a.y,U.z=u.z;const k=I;k.x=c.x,k.y=l.y,k.z=d.z;const F=n.Cartesian3.midpoint(U,k,P);let N=0;for(p=0;pN&&(N=r);const o=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(i,z,A));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=l+u)return e.clone(o),o;if(u>=l+s)return t.clone(o),o;const d=.5*(s+l+u),f=n.Cartesian3.multiplyByScalar(c,(-s+d)/l,L);return n.Cartesian3.add(f,i,f),n.Cartesian3.clone(f,o.center),o.radius=d,o};const Q=new n.Cartesian3;y.expand=function(e,t,r){r=y.clone(e,r);const o=n.Cartesian3.magnitude(n.Cartesian3.subtract(t,r.center,Q));return o>r.radius&&(r.radius=o),r},y.intersectPlane=function(e,t){const r=e.center,o=e.radius,i=t.normal,s=n.Cartesian3.dot(i,r)+t.distance;return s<-o?m.OUTSIDE:s{const t=new Image;t.onload=function(){qe._result=t.width>0&&t.height>0,e(qe._result)},t.onerror=function(){qe._result=!1,e(qe._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"}))),qe._promise},Object.defineProperties(qe,{initialized:{get:function(){return r.defined(qe._result)}}});const ze=[];"undefined"!=typeof ArrayBuffer&&(ze.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),"undefined"!=typeof Uint8ClampedArray&&ze.push(Uint8ClampedArray),"undefined"!=typeof Uint8ClampedArray&&ze.push(Uint8ClampedArray),"undefined"!=typeof BigInt64Array&&ze.push(BigInt64Array),"undefined"!=typeof BigUint64Array&&ze.push(BigUint64Array));const Me={isChrome:Ae,chromeVersion:function(){return Ae()&&ue},isSafari:Ee,safariVersion:function(){return Ee()&&le},isWebkit:Oe,webkitVersion:function(){return Oe()&&fe},isInternetExplorer:Ie,internetExplorerVersion:function(){return Ie()&&he},isEdge:Pe,edgeVersion:function(){return Pe()&&ge},isFirefox:Re,firefoxVersion:function(){return Re()&&ve},isWindows:function(){return r.defined(we)||(we=/Windows/i.test(se.appVersion)),we},isIPadOrIOS:function(){return r.defined(_e)||(_e="iPhone"===navigator.platform||"iPod"===navigator.platform||"iPad"===navigator.platform),_e},hardwareConcurrency:r.defaultValue(se.hardwareConcurrency,3),supportsPointerEvents:function(){return r.defined(Ce)||(Ce=!Re()&&"undefined"!=typeof PointerEvent&&(!r.defined(se.pointerEnabled)||se.pointerEnabled)),Ce},supportsImageRenderingPixelated:Te,supportsWebP:qe,imageRenderingValue:function(){return Te()?be:void 0},typedArrayTypes:ze,supportsBasis:function(e){return Me.supportsWebAssembly()&&e.context.supportsBasis},supportsFullscreen:function(){return ie.supportsFullscreen()},supportsTypedArrays:function(){return"undefined"!=typeof ArrayBuffer},supportsBigInt64Array:function(){return"undefined"!=typeof BigInt64Array},supportsBigUint64Array:function(){return"undefined"!=typeof BigUint64Array},supportsBigInt:function(){return"undefined"!=typeof BigInt},supportsWebWorkers:function(){return"undefined"!=typeof Worker},supportsWebAssembly:function(){return"undefined"!=typeof WebAssembly}};var De=Me;function Ue(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)}let ke=new n.Cartesian3;Ue.fromAxisAngle=function(e,t,o){const i=t/2,s=Math.sin(i);ke=n.Cartesian3.normalize(e,ke);const a=ke.x*s,u=ke.y*s,c=ke.z*s,l=Math.cos(i);return r.defined(o)?(o.x=a,o.y=u,o.z=c,o.w=l,o):new Ue(a,u,c,l)};const Fe=[1,2,0],Ne=new Array(3);Ue.fromRotationMatrix=function(e,t){let o,i,s,a,u;const c=e[n.Matrix3.COLUMN0ROW0],l=e[n.Matrix3.COLUMN1ROW1],d=e[n.Matrix3.COLUMN2ROW2],f=c+l+d;if(f>0)o=Math.sqrt(f+1),u=.5*o,o=.5/o,i=(e[n.Matrix3.COLUMN1ROW2]-e[n.Matrix3.COLUMN2ROW1])*o,s=(e[n.Matrix3.COLUMN2ROW0]-e[n.Matrix3.COLUMN0ROW2])*o,a=(e[n.Matrix3.COLUMN0ROW1]-e[n.Matrix3.COLUMN1ROW0])*o;else{const t=Fe;let r=0;l>c&&(r=1),d>c&&d>l&&(r=2);const f=t[r],p=t[f];o=Math.sqrt(e[n.Matrix3.getElementIndex(r,r)]-e[n.Matrix3.getElementIndex(f,f)]-e[n.Matrix3.getElementIndex(p,p)]+1);const h=Ne;h[r]=.5*o,o=.5/o,u=(e[n.Matrix3.getElementIndex(p,f)]-e[n.Matrix3.getElementIndex(f,p)])*o,h[f]=(e[n.Matrix3.getElementIndex(f,r)]+e[n.Matrix3.getElementIndex(r,f)])*o,h[p]=(e[n.Matrix3.getElementIndex(p,r)]+e[n.Matrix3.getElementIndex(r,p)])*o,i=-h[0],s=-h[1],a=-h[2]}return r.defined(t)?(t.x=i,t.y=s,t.z=a,t.w=u,t):new Ue(i,s,a,u)};const je=new Ue;let Be=new Ue,Ve=new Ue,$e=new Ue;Ue.fromHeadingPitchRoll=function(e,t){return $e=Ue.fromAxisAngle(n.Cartesian3.UNIT_X,e.roll,je),Ve=Ue.fromAxisAngle(n.Cartesian3.UNIT_Y,-e.pitch,t),t=Ue.multiply(Ve,$e,Ve),Be=Ue.fromAxisAngle(n.Cartesian3.UNIT_Z,-e.heading,je),Ue.multiply(Be,t,t)};const Le=new n.Cartesian3,Qe=new n.Cartesian3,We=new Ue,He=new Ue,Ye=new Ue;Ue.packedLength=4,Ue.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},Ue.unpack=function(e,t,n){return t=r.defaultValue(t,0),r.defined(n)||(n=new Ue),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n},Ue.packedInterpolationLength=3,Ue.convertPackedArrayForInterpolation=function(e,t,n,o){Ue.unpack(e,4*n,Ye),Ue.conjugate(Ye,Ye);for(let i=0,s=n-t+1;i0))return r;s=r-1}return~(s+1)}function lt(e,t,n,r,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=o}function dt(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 ft(e){return e%4==0&&e%100!=0||e%400==0}function pt(e,t){this.julianDate=e,this.offset=t}it[7]=ot/136,st[7]=8*ot/17,Ue.fastSlerp=function(e,t,n,r){let o,i=Ue.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)at[e]=(it[e]*u-st[e])*s,ut[e]=(it[e]*c-st[e])*s;const l=o*n*(1+at[0]*(1+at[1]*(1+at[2]*(1+at[3]*(1+at[4]*(1+at[5]*(1+at[6]*(1+at[7])))))))),d=a*(1+ut[0]*(1+ut[1]*(1+ut[2]*(1+ut[3]*(1+ut[4]*(1+ut[5]*(1+ut[6]*(1+ut[7])))))))),f=Ue.multiplyByScalar(e,d,rt);return Ue.multiplyByScalar(t,l,r),Ue.add(f,r,r)},Ue.fastSquad=function(e,t,n,r,o,i){const s=Ue.fastSlerp(e,t,o,tt),a=Ue.fastSlerp(n,r,o,nt);return Ue.fastSlerp(s,a,2*o*(1-o),i)},Ue.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},Ue.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},Ue.ZERO=Object.freeze(new Ue(0,0,0,0)),Ue.IDENTITY=Object.freeze(new Ue(0,0,0,1)),Ue.prototype.clone=function(e){return Ue.clone(this,e)},Ue.prototype.equals=function(e){return Ue.equals(this,e)},Ue.prototype.equalsEpsilon=function(e,t){return Ue.equalsEpsilon(this,e,t)},Ue.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var ht=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 mt=Object.freeze({UTC:0,TAI:1});const gt=new dt,yt=[31,28,31,30,31,30,31,31,30,31,30,31];function vt(e,t){return zt.compare(e.julianDate,t.julianDate)}const wt=new pt;function _t(e){wt.julianDate=e;const t=zt.leapSeconds;let n=ct(t,wt,vt);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let r=t[n].offset;if(n>0){zt.secondsDifference(t[n].julianDate,e)>r&&(n--,r=t[n].offset)}zt.addSeconds(e,r,e)}function Ct(e,t){wt.julianDate=e;const n=zt.leapSeconds;let r=ct(n,wt,vt);if(r<0&&(r=~r),0===r)return zt.addSeconds(e,-n[0].offset,t);if(r>=n.length)return zt.addSeconds(e,-n[r-1].offset,t);const o=zt.secondsDifference(n[r].julianDate,e);return 0===o?zt.addSeconds(e,-n[r].offset,t):o<=1?void 0:zt.addSeconds(e,-n[--r].offset,t)}function bt(e,t,n){const r=t/ht.SECONDS_PER_DAY|0;return e+=r,(t-=ht.SECONDS_PER_DAY*r)<0&&(e--,t+=ht.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function xt(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*ht.SECONDS_PER_HOUR+o*ht.SECONDS_PER_MINUTE+s*ht.SECONDS_PER_MILLISECOND);return l>=43200&&(c-=1),[c,l]}const St=/^(\d{4})$/,At=/^(\d{4})-(\d{2})$/,Et=/^(\d{4})-?(\d{3})$/,Ot=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,It=/^(\d{4})-?(\d{2})-?(\d{2})$/,Pt=/([Z+\-])?(\d{2})?:?(\d{2})?$/,Rt=/^(\d{2})(\.\d+)?/.source+Pt.source,Tt=/^(\d{2}):?(\d{2})(\.\d+)?/.source+Pt.source,qt=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+Pt.source;function zt(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,mt.UTC);const o=0|e;bt(o,t+=(e-o)*ht.SECONDS_PER_DAY,this),n===mt.UTC&&_t(this)}zt.fromGregorianDate=function(e,t){const n=xt(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return r.defined(t)?(bt(n[0],n[1],t),_t(t),t):new zt(n[0],n[1],mt.UTC)},zt.fromDate=function(e,t){const n=xt(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r.defined(t)?(bt(n[0],n[1],t),_t(t),t):new zt(n[0],n[1],mt.UTC)},zt.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(It),null!==o)n=+o[1],i=+o[2],s=+o[3];else if(o=d.match(At),null!==o)n=+o[1],i=+o[2];else if(o=d.match(St),null!==o)n=+o[1];else{let e;if(o=d.match(Et),null!==o)n=+o[1],e=+o[2],h=ft(n);else if(o=d.match(Ot),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=ft(n),r.defined(f)){o=f.match(qt),null!==o?(a=+o[1],u=+o[2],c=+o[3],l=1e3*+(o[4]||0),m=5):(o=f.match(Tt),null!==o?(a=+o[1],u=+o[2],c=60*+(o[3]||0),m=4):(o=f.match(Rt),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:yt[i-1];s>p;)s-=p,i++,i>12&&(i-=12,n++),p=h&&2===i?29:yt[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:yt[i-1],s+=p;const y=xt(n,i,s,a,u,c,l);return r.defined(t)?(bt(y[0],y[1],t),_t(t)):t=new zt(y[0],y[1],mt.UTC),g&&zt.addSeconds(t,1,t),t},zt.now=function(e){return zt.fromDate(new Date,e)};const Mt=new zt(0,0,mt.TAI);zt.toGregorianDate=function(e,t){let n=!1,o=Ct(e,Mt);r.defined(o)||(zt.addSeconds(e,-1,Mt),o=Ct(Mt,Mt),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/ht.SECONDS_PER_HOUR|0,m=s-h*ht.SECONDS_PER_HOUR;const g=m/ht.SECONDS_PER_MINUTE|0;m-=g*ht.SECONDS_PER_MINUTE;let y=0|m;const v=(m-y)/ht.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 dt(p,f,d,h,g,y,v,n)},zt.toDate=function(e){const t=zt.toGregorianDate(e,gt);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))},zt.toIso8601=function(e,t){const n=zt.toGregorianDate(e,gt);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`)},zt.clone=function(e,t){if(r.defined(e))return r.defined(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new zt(e.dayNumber,e.secondsOfDay,mt.TAI)},zt.compare=function(e,t){const n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},zt.equals=function(e,t){return e===t||r.defined(e)&&r.defined(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},zt.equalsEpsilon=function(e,t,n){return n=r.defaultValue(n,0),e===t||r.defined(e)&&r.defined(t)&&Math.abs(zt.secondsDifference(e,t))<=n},zt.totalDays=function(e){return e.dayNumber+e.secondsOfDay/ht.SECONDS_PER_DAY},zt.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*ht.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)},zt.daysDifference=function(e,t){return e.dayNumber-t.dayNumber+(e.secondsOfDay-t.secondsOfDay)/ht.SECONDS_PER_DAY},zt.computeTaiMinusUtc=function(e){wt.julianDate=e;const t=zt.leapSeconds;let n=ct(t,wt,vt);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset},zt.addSeconds=function(e,t,n){return bt(e.dayNumber,e.secondsOfDay+t,n)},zt.addMinutes=function(e,t,n){const r=e.secondsOfDay+t*ht.SECONDS_PER_MINUTE;return bt(e.dayNumber,r,n)},zt.addHours=function(e,t,n){const r=e.secondsOfDay+t*ht.SECONDS_PER_HOUR;return bt(e.dayNumber,r,n)},zt.addDays=function(e,t,n){return bt(e.dayNumber+t,e.secondsOfDay,n)},zt.lessThan=function(e,t){return zt.compare(e,t)<0},zt.lessThanOrEquals=function(e,t){return zt.compare(e,t)<=0},zt.greaterThan=function(e,t){return zt.compare(e,t)>0},zt.greaterThanOrEquals=function(e,t){return zt.compare(e,t)>=0},zt.prototype.clone=function(e){return zt.clone(this,e)},zt.prototype.equals=function(e){return zt.equals(this,e)},zt.prototype.equalsEpsilon=function(e,t){return zt.equalsEpsilon(this,e,t)},zt.prototype.toString=function(){return zt.toIso8601(this)},zt.leapSeconds=[new pt(new zt(2441317,43210,mt.TAI),10),new pt(new zt(2441499,43211,mt.TAI),11),new pt(new zt(2441683,43212,mt.TAI),12),new pt(new zt(2442048,43213,mt.TAI),13),new pt(new zt(2442413,43214,mt.TAI),14),new pt(new zt(2442778,43215,mt.TAI),15),new pt(new zt(2443144,43216,mt.TAI),16),new pt(new zt(2443509,43217,mt.TAI),17),new pt(new zt(2443874,43218,mt.TAI),18),new pt(new zt(2444239,43219,mt.TAI),19),new pt(new zt(2444786,43220,mt.TAI),20),new pt(new zt(2445151,43221,mt.TAI),21),new pt(new zt(2445516,43222,mt.TAI),22),new pt(new zt(2446247,43223,mt.TAI),23),new pt(new zt(2447161,43224,mt.TAI),24),new pt(new zt(2447892,43225,mt.TAI),25),new pt(new zt(2448257,43226,mt.TAI),26),new pt(new zt(2448804,43227,mt.TAI),27),new pt(new zt(2449169,43228,mt.TAI),28),new pt(new zt(2449534,43229,mt.TAI),29),new pt(new zt(2450083,43230,mt.TAI),30),new pt(new zt(2450630,43231,mt.TAI),31),new pt(new zt(2451179,43232,mt.TAI),32),new pt(new zt(2453736,43233,mt.TAI),33),new pt(new zt(2454832,43234,mt.TAI),34),new pt(new zt(2456109,43235,mt.TAI),35),new pt(new zt(2457204,43236,mt.TAI),36),new pt(new zt(2457754,43237,mt.TAI),37)];var Dt,Ut={exports:{}},kt={exports:{}};var Ft,Nt={exports:{}}; /*! * URI.js - Mutating URLs * IPv6 Support * * Version: 1.19.11 * * Author: Rodney Rehm * Web: http://medialize.github.io/URI.js/ * * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * */var jt,Bt,Vt,$t,Lt={exports:{}}; /*! * URI.js - Mutating URLs * Second Level Domain (SLD) Support * * Version: 1.19.11 * * Author: Rodney Rehm * Web: http://medialize.github.io/URI.js/ * * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * */Vt=p,$t=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.11";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.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/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 _=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=e.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://")).replace(/^[/\\]{2,}/i,"//")).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=C("protocol"),s.username=C("username"),s.password=C("password"),s.hostname=C("hostname"),s.port=C("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;a= 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(f,".")).split("."),t).join(".")}function _(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+=c)e=m(e/35);return m(r+36*e/(e+38))}function S(e){var t,n,r,o,i,s,a,l,d,f,p,h=[],g=e.length,v=0,w=128,_=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"),((l=(p=e.charCodeAt(o++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:c)>=c||l>m((u-v)/s))&&y("overflow"),v+=l*s,!(l<(d=a<=_?1:a>=_+26?26:a-_));a+=c)s>m(u/(f=c-d))&&y("overflow"),s*=f;_=x(v-i,t=h.length+1,0==i),m(v/t)>u-w&&y("overflow"),w+=m(v/t),v%=t,h.splice(v++,0,w)}return C(h)}function A(e){var t,n,r,o,i,s,a,l,d,f,p,h,v,w,C,S=[];for(h=(e=_(e)).length,t=128,n=0,i=72,s=0;s=t&&pm((u-n)/(v=r+1))&&y("overflow"),n+=(a-t)*v,t=a,s=0;su&&y("overflow"),p==t){for(l=n,d=c;!(l<(f=d<=i?1:d>=i+26?26:d-i));d+=c)C=l-f,w=c-f,S.push(g(b(f+C%w,0))),l=m(C/w);S.push(g(b(l,0))),i=x(n,v,r==o),n=0,++r}++n,++t}return S.join("")}if(s={version:"1.3.2",ucs2:{decode:_,encode:C},decode:S,encode:A,toASCII:function(e){return w(e,(function(e){return d.test(e)?"xn--"+A(e):e}))},toUnicode:function(e){return w(e,(function(e){return l.test(e)?S(e.slice(4).toLowerCase()):e}))}},r&&o)if(e.exports==r)o.exports=s;else for(a in s)s.hasOwnProperty(a)&&(r[a]=s[a]);else n.punycode=s}(p)}(kt,kt.exports)),kt.exports),function(){return Ft||(Ft=1,t=p,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=Lt).exports?e.exports=n():t.SecondLevelDomains=n(t)),Lt.exports;var e,t,n}()):Vt.URI=$t(Vt.punycode,Vt.IPv6,Vt.SecondLevelDomains,Vt);var Qt=Ut.exports;function Wt(e,t){if(null===e||"object"!=typeof e)return e;t=r.defaultValue(t,!1);const n=new e.constructor;for(const r in e)if(e.hasOwnProperty(r)){let o=e[r];t&&(o=Wt(o,t)),n[r]=o}return n}function Ht(){let e,t;const n=new Promise((function(n,r){e=n,t=r}));return{resolve:e,reject:t,promise:n}}function Yt(e,t){let n;return"undefined"!=typeof document&&(n=document),Yt._implementation(e,t,n)}Yt._implementation=function(e,t,n){if(!r.defined(t)){if(void 0===n)return e;t=r.defaultValue(n.baseURI,n.location.href)}const o=new Qt(e);return""!==o.scheme()?o.toString():o.absoluteTo(t).toString()};const Zt={};function Jt(e,t,n){r.defined(t)||(t=e.width),r.defined(n)||(n=e.height);let o=Zt[t];r.defined(o)||(o={},Zt[t]=o);let i=o[n];if(!r.defined(i)){const e=document.createElement("canvas");e.width=t,e.height=n,i=e.getContext("2d"),i.globalCompositeOperation="copy",o[n]=i}return i.drawImage(e,0,0,t,n),i.getImageData(0,0,t,n).data}const Xt=/^blob:/i;function Gt(e){return Xt.test(e)}let Kt;const en=/^data:/i;function tn(e){return en.test(e)}var nn=Object.freeze({UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5});var rn=Object.freeze({TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3});function on(e){e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT);const t=r.defaultValue(e.throttleByServer,!1),n=r.defaultValue(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=r.defaultValue(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=r.defaultValue(e.type,rn.OTHER),this.serverKey=void 0,this.state=nn.UNISSUED,this.deferred=void 0,this.cancelled=!1}function sn(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,"string"==typeof this.responseHeaders&&(this.responseHeaders=function(e){const t={};if(!e)return t;const n=e.split("\r\n");for(let e=0;e0){const e=r.substring(0,o),n=r.substring(o+2);t[e]=n}}return t}(this.responseHeaders))}function an(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}function un(e,t){return t-e}function cn(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}function ln(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}on.prototype.cancel=function(){this.cancelled=!0},on.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 on(this)},sn.prototype.toString=function(){let e="Request has failed.";return r.defined(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e},Object.defineProperties(an.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),an.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);const n=this;return function(){n.removeEventListener(e,t)}},an.prototype.removeEventListener=function(e,t){const n=this._listeners,r=this._scopes;let o=-1;for(let i=0;i0){for(i.sort(un),e=0;e=0;--t)this.heapify(t)},cn.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},cn.prototype.pop=function(e){if(e=r.defaultValue(e,0),0===this._length)return;const t=this._array,n=t[e];return ln(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};const dn={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0};let fn=20;const pn=new cn({comparator:function(e,t){return e.priority-t.priority}});pn.maximumLength=fn,pn.reserve(fn);const hn=[];let mn={};const gn="undefined"!=typeof document?new Qt(document.location.href):new Qt,yn=new an;function vn(){}function wn(e){r.defined(e.priorityFunction)&&(e.priority=e.priorityFunction())}function _n(e){return e.state===nn.UNISSUED&&(e.state=nn.ISSUED,e.deferred=Ht()),e.deferred.promise}function Cn(e){const t=_n(e);return e.state=nn.ACTIVE,hn.push(e),++dn.numberOfActiveRequests,++dn.numberOfActiveRequestsEver,++mn[e.serverKey],e.requestFunction().then(function(e){return function(t){if(e.state===nn.CANCELLED)return;const n=e.deferred;--dn.numberOfActiveRequests,--mn[e.serverKey],yn.raiseEvent(),e.state=nn.RECEIVED,e.deferred=void 0,n.resolve(t)}}(e)).catch(function(e){return function(t){e.state!==nn.CANCELLED&&(++dn.numberOfFailedRequests,--dn.numberOfActiveRequests,--mn[e.serverKey],yn.raiseEvent(t),e.state=nn.FAILED,e.deferred.reject(t))}}(e)),t}function bn(e){const t=e.state===nn.ACTIVE;if(e.state=nn.CANCELLED,++dn.numberOfCancelledRequests,r.defined(e.deferred)){const t=e.deferred;e.deferred=void 0,t.reject()}t&&(--dn.numberOfActiveRequests,--mn[e.serverKey],++dn.numberOfCancelledActiveRequests),r.defined(e.cancelFunction)&&e.cancelFunction()}vn.maximumRequests=50,vn.maximumRequestsPerServer=6,vn.requestsByServer={"api.cesium.com:443":18,"assets.cesium.com:443":18},vn.throttleRequests=!0,vn.debugShowStatistics=!1,vn.requestCompletedEvent=yn,Object.defineProperties(vn,{statistics:{get:function(){return dn}},priorityHeapLength:{get:function(){return fn},set:function(e){if(ee;){bn(pn.pop())}fn=e,pn.maximumLength=e,pn.reserve(e)}}}),vn.serverHasOpenSlots=function(e,t){t=r.defaultValue(t,1);const n=r.defaultValue(vn.requestsByServer[e],vn.maximumRequestsPerServer);return mn[e]+t<=n},vn.heapHasOpenSlots=function(e){return pn.length+e<=fn},vn.update=function(){let e,t,n=0;const r=hn.length;for(e=0;e0&&(hn[e-n]=t):++n;hn.length-=n;const o=pn.internalArray,i=pn.length;for(e=0;e0;)t=pn.pop(),t.cancelled?bn(t):!t.throttleByServer||vn.serverHasOpenSlots(t.serverKey)?(Cn(t),++a):bn(t);!function(){if(!vn.debugShowStatistics)return;0===dn.numberOfActiveRequests&&dn.lastNumberOfActiveRequests>0&&(dn.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${dn.numberOfAttemptedRequests}`),dn.numberOfAttemptedRequests=0),dn.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${dn.numberOfCancelledRequests}`),dn.numberOfCancelledRequests=0),dn.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${dn.numberOfCancelledActiveRequests}`),dn.numberOfCancelledActiveRequests=0),dn.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${dn.numberOfFailedRequests}`),dn.numberOfFailedRequests=0));dn.lastNumberOfActiveRequests=dn.numberOfActiveRequests}()},vn.getServerKey=function(e){let t=new Qt(e);""===t.scheme()&&(t=new Qt(e).absoluteTo(gn),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${"https"===t.scheme()?"443":"80"}`);const o=mn[n];return r.defined(o)||(mn[n]=0),n},vn.request=function(e){if(tn(e.url)||Gt(e.url))return yn.raiseEvent(),e.state=nn.RECEIVED,e.requestFunction();if(++dn.numberOfAttemptedRequests,r.defined(e.serverKey)||(e.serverKey=vn.getServerKey(e.url)),vn.throttleRequests&&e.throttleByServer&&!vn.serverHasOpenSlots(e.serverKey))return;if(!vn.throttleRequests||!e.throttle)return Cn(e);if(hn.length>=vn.maximumRequests)return;wn(e);const t=pn.insert(e);if(r.defined(t)){if(t===e)return;bn(t)}return _n(e)},vn.clearForSpecs=function(){for(;pn.length>0;){bn(pn.pop())}const e=hn.length;for(let t=0;t0}}}),qn.prototype.toString=function(){return this.getUrlComponent(!0,!0)},qn.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;const n=new Qt(this._url);e&&In(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},qn.prototype.setQueryParameters=function(e,t){this._queryParameters=t?Tn(this._queryParameters,e,!1):Tn(e,this._queryParameters,!1)},qn.prototype.appendQueryParameters=function(e){this._queryParameters=Tn(e,this._queryParameters,!0)},qn.prototype.setTemplateValues=function(e,t){this._templateValues=t?s.combine(this._templateValues,e):s.combine(e,this._templateValues)},qn.prototype.getDerivedResource=function(e){const t=this.clone();if(t._retryCount=0,r.defined(e.url)){const n=new Qt(e.url);On(n,t,!0,r.defaultValue(e.preserveQueryParameters,!1)),n.fragment(""),""!==n.scheme()?t._url=n.toString():t._url=n.absoluteTo(new Qt(Yt(this._url))).toString()}return r.defined(e.queryParameters)&&(t._queryParameters=s.combine(e.queryParameters,t._queryParameters)),r.defined(e.templateValues)&&(t._templateValues=s.combine(e.templateValues,t.templateValues)),r.defined(e.headers)&&(t.headers=s.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},qn.prototype.retryOnError=function(e){const t=this.retryCallback;if("function"!=typeof t||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);const n=this;return Promise.resolve(t(this,e)).then((function(e){return++n._retryCount,e}))},qn.prototype.clone=function(e){return r.defined(e)||(e=new qn({url:this._url})),e._url=this._url,e._queryParameters=Wt(this._queryParameters),e._templateValues=Wt(this._templateValues),e.headers=Wt(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e},qn.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 Qt(e)).query().length&&(n+=`?${e.query()}`),0!==e.fragment().length&&(n+=`#${e.fragment()}`),n):n}(this.getUrlComponent(e),e)},qn.prototype.appendForwardSlash=function(){var e;this._url=(0!==(e=this._url).length&&"/"===e[e.length-1]||(e=`${e}/`),e)},qn.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},qn.fetchArrayBuffer=function(e){return new qn(e).fetchArrayBuffer()},qn.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},qn.fetchBlob=function(e){return new qn(e).fetchBlob()},qn.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(Rn(this.request),!En||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return Mn({resource:this,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:t});const s=this.fetchBlob();if(!r.defined(s))return;let a,u,c,l;return qn.supportsImageBitmapOptions().then((function(e){return a=e,u=a&&t,s})).then((function(e){if(!r.defined(e))return;if(l=e,u)return qn.createImageBitmapFromBlob(e,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});const t=window.URL.createObjectURL(e);return c=new qn({url:t}),Mn({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})).catch((function(e){return r.defined(c)&&window.URL.revokeObjectURL(c.url),e.blob=l,Promise.reject(e)}))},qn.fetchImage=function(e){return new qn(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},qn.prototype.fetchText=function(){return this.fetch({responseType:"text"})},qn.fetchText=function(e){return new qn(e).fetchText()},qn.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)}))},qn.fetchJson=function(e){return new qn(e).fetchJson()},qn.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},qn.fetchXML=function(e){return new qn(e).fetchXML()},qn.prototype.fetchJsonp=function(e){let t;e=r.defaultValue(e,"callback"),Rn(this.request);do{t=`loadJsonp${o.CesiumMath.nextRandomNumber().toString().substring(2,8)}`}while(r.defined(window[t]));return Dn(this,e,t)},qn.fetchJsonp=function(e){return new qn(e).fetchJsonp(e.callbackParameterName)},qn.prototype._makeRequest=function(e){const t=this;Rn(t.request);const n=t.request;n.url=t.url,n.requestFunction=function(){const o=e.responseType,i=s.combine(e.headers,t.headers),a=e.overrideMimeType,u=e.method,c=e.data,l=Ht(),d=qn._Implementations.loadWithXhr(t.url,o,u,c,i,l,a);return r.defined(d)&&r.defined(d.abort)&&(n.cancelFunction=function(){d.abort()}),l.promise};const o=vn.request(n);if(r.defined(o))return o.then((function(e){return n.cancelFunction=void 0,e})).catch((function(r){return n.cancelFunction=void 0,n.state!==nn.FAILED?Promise.reject(r):t.retryOnError(r).then((function(o){return o?(n.state=nn.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)}))}))};const Un=/^data:(.*?)(;base64)?,(.*)$/;function kn(e,t){const n=decodeURIComponent(t);return e?atob(n):n}function Fn(e,t){const n=kn(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 Ln(e,n,o,a,s),s;if(r.equals(c))return Ln(e,n,i,a,s),s;const l=zt.secondsDifference(r,u)/zt.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=Qn(l,n[d+e._xPoleWanderRadiansColumn],n[f+e._xPoleWanderRadiansColumn]),s.yPoleWander=Qn(l,n[d+e._yPoleWanderRadiansColumn],n[f+e._yPoleWanderRadiansColumn]),s.xPoleOffset=Qn(l,n[d+e._xCelestialPoleOffsetRadiansColumn],n[f+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=Qn(l,n[d+e._yCelestialPoleOffsetRadiansColumn],n[f+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=Qn(l,p,h),s}function Hn(e,t,n){this.heading=r.defaultValue(e,0),this.pitch=r.defaultValue(t,0),this.roll=r.defaultValue(n,0)}qn._Implementations.loadWithXhr=function(t,n,o,i,s,c,l){const d=Un.exec(t);if(null!==d)return void c.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 kn(o,i);case"arraybuffer":return Fn(o,i);case"blob":return s=Fn(o,i),new Blob([s],{type:n});case"document":return a=new DOMParser,a.parseFromString(kn(o,i),n);case"json":return JSON.parse(kn(o,i))}}(d,n));if(jn)return void function(t,n,r,o,i,s,c){let l,d;Promise.all([new Promise((function(t,n){e(["url"],(function(e){t(u(e))}),n)})),new Promise((function(t,n){e(["zlib"],(function(e){t(u(e))}),n)}))]).then((([n,r])=>(l=n.parse(t),d=r,"https:"===l.protocol?new Promise((function(t,n){e(["https"],(function(e){t(u(e))}),n)})):new Promise((function(t,n){e(["http"],(function(e){t(u(e))}),n)}))))).then((e=>{const t={protocol:l.protocol,hostname:l.hostname,port:l.port,path:l.path,query:l.query,method:r,headers:i};e.request(t).on("response",(function(e){if(e.statusCode<200||e.statusCode>=300)return void s.reject(new sn(e.statusCode,e,e.headers));const t=[];e.on("data",(function(e){t.push(e)})),e.on("end",(function(){const r=Buffer.concat(t);"gzip"===e.headers["content-encoding"]?d.gunzip(r,(function(e,t){e?s.reject(new a.RuntimeError("Error decompressing response.")):s.resolve(Nn(t,n))})):s.resolve(Nn(r,n))}))})).on("error",(function(e){s.reject(new sn)})).end()}))}(t,n,o,0,s,c);const f=new XMLHttpRequest;if(An.contains(t)&&(f.withCredentials=!0),f.open(o,t,!0),r.defined(l)&&r.defined(f.overrideMimeType)&&f.overrideMimeType(l),r.defined(s))for(const e in s)s.hasOwnProperty(e)&&f.setRequestHeader(e,s[e]);r.defined(n)&&(f.responseType=n);let p=!1;return"string"==typeof t&&(p=0===t.indexOf("file://")||"undefined"!=typeof window&&"file://"===window.location.origin),f.onload=function(){if((f.status<200||f.status>=300)&&(!p||0!==f.status))return void c.reject(new sn(f.status,f.response,f.getAllResponseHeaders()));const e=f.response,t=f.responseType;if("HEAD"===o||"OPTIONS"===o){const e=f.getAllResponseHeaders().trim().split(/[\r\n]+/),t={};return e.forEach((function(e){const n=e.split(": "),r=n.shift();t[r]=n.join(": ")})),void c.resolve(t)}if(204===f.status)c.resolve();else if(!r.defined(e)||r.defined(n)&&t!==n)if("json"===n&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===t||"document"===t)&&r.defined(f.responseXML)&&f.responseXML.hasChildNodes()?c.resolve(f.responseXML):""!==t&&"text"!==t||!r.defined(f.responseText)?c.reject(new a.RuntimeError("Invalid XMLHttpRequest response type.")):c.resolve(f.responseText);else c.resolve(e)},f.onerror=function(e){c.reject(new sn)},f.send(i),f},qn._Implementations.loadAndExecuteScript=function(e,t,n){return function(e){const t=document.createElement("script");return t.async=!0,t.src=e,new Promise(((e,n)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");const r=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,r.removeChild(t),e()},t.onerror=function(e){n(e)},r.appendChild(t)}))}(e).catch((function(e){n.reject(e)}))},qn._DefaultImplementations={},qn._DefaultImplementations.createImage=qn._Implementations.createImage,qn._DefaultImplementations.loadWithXhr=qn._Implementations.loadWithXhr,qn._DefaultImplementations.loadAndExecuteScript=qn._Implementations.loadAndExecuteScript,qn.DEFAULT=Object.freeze(new qn({url:"undefined"==typeof document?"":document.location.href.split("?")[0]})),Bn.NONE=Object.freeze({getPromiseToLoad:function(){return Promise.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 lt(0,0,0,0,0),t}}),Bn.prototype.getPromiseToLoad=function(){return Promise.resolve(this._downloadPromise)},Bn.prototype.compute=function(e,t){if(!r.defined(this._samples)){if(r.defined(this._dataError))throw new a.RuntimeError(this._dataError);return}if(r.defined(t)||(t=new lt(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 n=this._dates,o=this._lastIndex;let i=0,s=0;if(r.defined(o)){const a=n[o],u=n[o+1],c=zt.lessThanOrEquals(a,e),l=!r.defined(u),d=l||zt.greaterThanOrEquals(u,e);if(c&&d)return i=o,!l&&u.equals(e)&&++i,s=i+1,Wn(this,n,this._samples,e,i,s,t),t}let u=ct(n,e,zt.compare,this._dateColumn);return u>=0?(u=this._totalSamples&&(a=this._totalSamples-1);const u=s/this._samplesPerXysFile|0,c=a/this._samplesPerXysFile|0,l=[];for(let e=u;e<=c;++e)l.push(ar(this,e));return Promise.all(l)},or.prototype.computeXysRadians=function(e,t,n){const o=sr(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])||(ar(this,a/this._samplesPerXysFile|0),c=!0),r.defined(l[3*u])||(ar(this,u/this._samplesPerXysFile|0),c=!0),c)return;r.defined(n)?(n.x=0,n.y=0,n.s=0):n=new rr(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 ur={},cr={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"}},lr={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},dr={},fr={east:new n.Cartesian3,north:new n.Cartesian3,up:new n.Cartesian3,west:new n.Cartesian3,south:new n.Cartesian3,down:new n.Cartesian3};let pr=new n.Cartesian3,hr=new n.Cartesian3,mr=new n.Cartesian3;ur.localFrameToFixedFrameGenerator=function(e,t){if(!cr.hasOwnProperty(e)||!cr[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");const s=cr[e][t];let a;const u=e+t;return r.defined(dr[u])?a=dr[u]:(a=function(a,u,c){if(r.defined(c)||(c=new i.Matrix4),n.Cartesian3.equalsEpsilon(a,n.Cartesian3.ZERO,o.CesiumMath.EPSILON14))n.Cartesian3.unpack(lr[e],0,pr),n.Cartesian3.unpack(lr[t],0,hr),n.Cartesian3.unpack(lr[s],0,mr);else if(o.CesiumMath.equalsEpsilon(a.x,0,o.CesiumMath.EPSILON14)&&o.CesiumMath.equalsEpsilon(a.y,0,o.CesiumMath.EPSILON14)){const r=o.CesiumMath.sign(a.z);n.Cartesian3.unpack(lr[e],0,pr),"east"!==e&&"west"!==e&&n.Cartesian3.multiplyByScalar(pr,r,pr),n.Cartesian3.unpack(lr[t],0,hr),"east"!==t&&"west"!==t&&n.Cartesian3.multiplyByScalar(hr,r,hr),n.Cartesian3.unpack(lr[s],0,mr),"east"!==s&&"west"!==s&&n.Cartesian3.multiplyByScalar(mr,r,mr)}else{(u=r.defaultValue(u,n.Ellipsoid.WGS84)).geodeticSurfaceNormal(a,fr.up);const o=fr.up,i=fr.east;i.x=-a.y,i.y=a.x,i.z=0,n.Cartesian3.normalize(i,fr.east),n.Cartesian3.cross(o,i,fr.north),n.Cartesian3.multiplyByScalar(fr.up,-1,fr.down),n.Cartesian3.multiplyByScalar(fr.east,-1,fr.west),n.Cartesian3.multiplyByScalar(fr.north,-1,fr.south),pr=fr[e],hr=fr[t],mr=fr[s]}return c[0]=pr.x,c[1]=pr.y,c[2]=pr.z,c[3]=0,c[4]=hr.x,c[5]=hr.y,c[6]=hr.z,c[7]=0,c[8]=mr.x,c[9]=mr.y,c[10]=mr.z,c[11]=0,c[12]=a.x,c[13]=a.y,c[14]=a.z,c[15]=1,c},dr[u]=a),a},ur.eastNorthUpToFixedFrame=ur.localFrameToFixedFrameGenerator("east","north"),ur.northEastDownToFixedFrame=ur.localFrameToFixedFrameGenerator("north","east"),ur.northUpEastToFixedFrame=ur.localFrameToFixedFrameGenerator("north","up"),ur.northWestUpToFixedFrame=ur.localFrameToFixedFrameGenerator("north","west");const gr=new Ue,yr=new n.Cartesian3(1,1,1),vr=new i.Matrix4;ur.headingPitchRollToFixedFrame=function(e,t,o,s,a){s=r.defaultValue(s,ur.eastNorthUpToFixedFrame);const u=Ue.fromHeadingPitchRoll(t,gr),c=i.Matrix4.fromTranslationQuaternionRotationScale(n.Cartesian3.ZERO,u,yr,vr);return a=s(e,o,a),i.Matrix4.multiply(a,c,a)};const wr=new i.Matrix4,_r=new n.Matrix3;ur.headingPitchRollQuaternion=function(e,t,n,r,o){const s=ur.headingPitchRollToFixedFrame(e,t,n,r,wr),a=i.Matrix4.getMatrix3(s,_r);return Ue.fromRotationMatrix(a,o)};const Cr=new n.Cartesian3(1,1,1),br=new n.Cartesian3,xr=new i.Matrix4,Sr=new i.Matrix4,Ar=new n.Matrix3,Er=new Ue;ur.fixedFrameToHeadingPitchRoll=function(e,t,o,s){t=r.defaultValue(t,n.Ellipsoid.WGS84),o=r.defaultValue(o,ur.eastNorthUpToFixedFrame),r.defined(s)||(s=new Hn);const a=i.Matrix4.getTranslation(e,br);if(n.Cartesian3.equals(a,n.Cartesian3.ZERO))return s.heading=0,s.pitch=0,s.roll=0,s;let u=i.Matrix4.inverseTransformation(o(a,t,xr),xr),c=i.Matrix4.setScale(e,Cr,Sr);c=i.Matrix4.setTranslation(c,n.Cartesian3.ZERO,c),u=i.Matrix4.multiply(u,c,u);let l=Ue.fromRotationMatrix(i.Matrix4.getMatrix3(u,Ar),Er);return l=Ue.normalize(l,l),Hn.fromQuaternion(l,s)};const Or=o.CesiumMath.TWO_PI/86400;let Ir=new zt;ur.computeTemeToPseudoFixedMatrix=function(e,t){Ir=zt.addSeconds(e,-zt.computeTaiMinusUtc(e),Ir);const i=Ir.dayNumber,s=Ir.secondsOfDay;let a;const u=i-2451545;a=s>=43200?(u+.5)/ht.DAYS_PER_JULIAN_CENTURY:(u-.5)/ht.DAYS_PER_JULIAN_CENTURY;const c=(24110.54841+a*(8640184.812866+a*(.093104+-62e-7*a)))*Or%o.CesiumMath.TWO_PI+(72921158553e-15+11772758384668e-32*(i-2451545.5))*((s+.5*ht.SECONDS_PER_DAY)%ht.SECONDS_PER_DAY),l=Math.cos(c),d=Math.sin(c);return r.defined(t)?(t[0]=l,t[1]=-d,t[2]=0,t[3]=d,t[4]=l,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new n.Matrix3(l,d,0,-d,l,0,0,0,1)},ur.iau2006XysData=new or,ur.earthOrientationParameters=Bn.NONE;const Pr=32.184;ur.preloadIcrfFixed=function(e){const t=e.start.dayNumber,n=e.start.secondsOfDay+Pr,r=e.stop.dayNumber,o=e.stop.secondsOfDay+Pr,i=ur.iau2006XysData.preload(t,n,r,o),s=ur.earthOrientationParameters.getPromiseToLoad();return Promise.all([i,s])},ur.computeIcrfToFixedMatrix=function(e,t){r.defined(t)||(t=new n.Matrix3);const o=ur.computeFixedToIcrfMatrix(e,t);if(r.defined(o))return n.Matrix3.transpose(o,t)};const Rr=new rr(0,0,0),Tr=new lt(0,0,0,0,0),qr=new n.Matrix3,zr=new n.Matrix3;ur.computeFixedToIcrfMatrix=function(e,t){r.defined(t)||(t=new n.Matrix3);const i=ur.earthOrientationParameters.compute(e,Tr);if(!r.defined(i))return;const s=e.dayNumber,a=e.secondsOfDay+Pr,u=ur.iau2006XysData.computeXysRadians(s,a,Rr);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=qr;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=n.Matrix3.fromRotationZ(-u.s,zr),h=n.Matrix3.multiply(f,p,qr),m=e.dayNumber-2451545,g=(e.secondsOfDay-zt.computeTaiMinusUtc(e)+i.ut1MinusUtc)/ht.SECONDS_PER_DAY;let y=.779057273264+g+.00273781191135448*(m+g);y=y%1*o.CesiumMath.TWO_PI;const v=n.Matrix3.fromRotationZ(y,zr),w=n.Matrix3.multiply(h,v,qr),_=Math.cos(i.xPoleWander),C=Math.cos(i.yPoleWander),b=Math.sin(i.xPoleWander),x=Math.sin(i.yPoleWander);let S=s-2451545+a/ht.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=zr;return I[0]=_*E,I[1]=_*O,I[2]=b,I[3]=-C*O+x*b*E,I[4]=C*E+x*b*O,I[5]=-x*_,I[6]=-x*O-C*b*E,I[7]=x*E-C*b*O,I[8]=C*_,n.Matrix3.multiply(w,I,t)};const Mr=new i.Cartesian4;ur.pointToWindowCoordinates=function(e,t,n,r){return(r=ur.pointToGLWindowCoordinates(e,t,n,r)).y=2*t[5]-r.y,r},ur.pointToGLWindowCoordinates=function(e,t,n,o){r.defined(o)||(o=new i.Cartesian2);const s=Mr;return i.Matrix4.multiplyByVector(e,i.Cartesian4.fromElements(n.x,n.y,n.z,1,s),s),i.Cartesian4.multiplyByScalar(s,1/s.w,s),i.Matrix4.multiplyByVector(t,s,s),i.Cartesian2.fromCartesian4(s,o)};const Dr=new n.Cartesian3,Ur=new n.Cartesian3,kr=new n.Cartesian3;ur.rotationMatrixFromPositionVelocity=function(e,t,i,s){const a=r.defaultValue(i,n.Ellipsoid.WGS84).geodeticSurfaceNormal(e,Dr);let u=n.Cartesian3.cross(t,a,Ur);n.Cartesian3.equalsEpsilon(u,n.Cartesian3.ZERO,o.CesiumMath.EPSILON6)&&(u=n.Cartesian3.clone(n.Cartesian3.UNIT_X,u));const c=n.Cartesian3.cross(u,t,kr);return n.Cartesian3.normalize(c,c),n.Cartesian3.cross(t,c,u),n.Cartesian3.negate(u,u),n.Cartesian3.normalize(u,u),r.defined(s)||(s=new n.Matrix3),s[0]=t.x,s[1]=t.y,s[2]=t.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 Fr=new i.Matrix4(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),Nr=new n.Cartographic,jr=new n.Cartesian3,Br=new n.Cartesian3,Vr=new n.Matrix3,$r=new i.Matrix4,Lr=new i.Matrix4;ur.basisTo2D=function(e,t,r){const o=i.Matrix4.getTranslation(t,Br),s=e.ellipsoid,a=s.cartesianToCartographic(o,Nr),u=e.project(a,jr);n.Cartesian3.fromElements(u.z,u.x,u.y,u);const c=ur.eastNorthUpToFixedFrame(o,s,$r),l=i.Matrix4.inverseTransformation(c,Lr),d=i.Matrix4.getMatrix3(t,Vr),f=i.Matrix4.multiplyByMatrix3(l,d,r);return i.Matrix4.multiply(Fr,f,r),i.Matrix4.setTranslation(r,u,r),r},ur.wgs84To2DModelMatrix=function(e,t,r){const o=e.ellipsoid,s=ur.eastNorthUpToFixedFrame(t,o,$r),a=i.Matrix4.inverseTransformation(s,Lr),u=o.cartesianToCartographic(t,Nr),c=e.project(u,jr);n.Cartesian3.fromElements(c.z,c.x,c.y,c);const l=i.Matrix4.fromTranslation(c,$r);return i.Matrix4.multiply(Fr,a,r),i.Matrix4.multiply(l,r,r),r};var Qr=ur;t.BoundingSphere=y,t.DeveloperError=c,t.FeatureDetection=De,t.GeographicProjection=h,t.Intersect=m,t.Interval=g,t.Quaternion=Ue,t.Resource=qn,t.Transforms=Qr,t.buildModuleUrl=nr}));