1 |
- define(["exports","./Cartographic-67e73ef9","./Check-52a7d806","./when-92c6cf3c","./Rectangle-bab7abf0","./Intersect-b97e930a","./Math-92c3b5f7","./PrimitiveType-cdfe443e","./Event-3390cd7d","./RuntimeError-c6a62a80"],(function(e,t,r,n,o,i,a,u,s,c){"use strict";function p(e,t){this.start=n.u(e,0),this.stop=n.u(t,0)}function f(e,r){this.center=t.t.clone(n.u(e,t.t.ZERO)),this.radius=n.u(r,0)}var l=new t.t,h=new t.t,d=new t.t,y=new t.t,m=new t.t,v=new t.t,g=new t.t,q=new t.t,b=new t.t,w=new t.t,R=new t.t,O=new t.t,A=4/3*a.e.PI;f.fromPoints=function(e,r){if(n.e(r)||(r=new f),!n.e(e)||0===e.length)return r.center=t.t.clone(t.t.ZERO,r.center),r.radius=0,r;var o,i=t.t.clone(e[0],g),a=t.t.clone(i,l),u=t.t.clone(i,h),s=t.t.clone(i,d),c=t.t.clone(i,y),p=t.t.clone(i,m),A=t.t.clone(i,v),x=e.length;for(o=1;o<x;o++){t.t.clone(e[o],i);var S=i.x,E=i.y,_=i.z;S<a.x&&t.t.clone(i,a),S>c.x&&t.t.clone(i,c),E<u.y&&t.t.clone(i,u),E>p.y&&t.t.clone(i,p),_<s.z&&t.t.clone(i,s),_>A.z&&t.t.clone(i,A)}var C=t.t.magnitudeSquared(t.t.subtract(c,a,q)),I=t.t.magnitudeSquared(t.t.subtract(p,u,q)),T=t.t.magnitudeSquared(t.t.subtract(A,s,q)),P=a,U=c,B=C;I>B&&(B=I,P=u,U=p),T>B&&(B=T,P=s,U=A);var k=b;k.x=.5*(P.x+U.x),k.y=.5*(P.y+U.y),k.z=.5*(P.z+U.z);var j=t.t.magnitudeSquared(t.t.subtract(U,k,q)),D=Math.sqrt(j),z=w;z.x=a.x,z.y=u.y,z.z=s.z;var L=R;L.x=c.x,L.y=p.y,L.z=A.z;var K=t.t.midpoint(z,L,O),M=0;for(o=0;o<x;o++){t.t.clone(e[o],i);var F=t.t.magnitude(t.t.subtract(i,K,q));F>M&&(M=F);var N=t.t.magnitudeSquared(t.t.subtract(i,k,q));if(N>j){var H=Math.sqrt(N);j=(D=.5*(D+H))*D;var V=H-D;k.x=(D*k.x+V*i.x)/H,k.y=(D*k.y+V*i.y)/H,k.z=(D*k.z+V*i.z)/H}}return D<M?(t.t.clone(k,r.center),r.radius=D):(t.t.clone(K,r.center),r.radius=M),r};var x=new i.n,S=new t.t,E=new t.t,_=new t.t$1,C=new t.t$1;f.fromRectangle2D=function(e,t,r){return f.fromRectangleWithHeights2D(e,t,0,0,r)},f.fromRectangleWithHeights2D=function(e,r,i,a,u){if(n.e(u)||(u=new f),!n.e(e))return u.center=t.t.clone(t.t.ZERO,u.center),u.radius=0,u;r=n.u(r,x),o.h.southwest(e,_),_.height=i,o.h.northeast(e,C),C.height=a;var s=r.project(_,S),c=r.project(C,E),p=c.x-s.x,l=c.y-s.y,h=c.z-s.z;u.radius=.5*Math.sqrt(p*p+l*l+h*h);var d=u.center;return d.x=s.x+.5*p,d.y=s.y+.5*l,d.z=s.z+.5*h,u};var I=[];f.fromRectangle3D=function(e,r,i,a){if(r=n.u(r,o.t.WGS84),i=n.u(i,0),n.e(a)||(a=new f),!n.e(e))return a.center=t.t.clone(t.t.ZERO,a.center),a.radius=0,a;var u=o.h.subsample(e,r,i,I);return f.fromPoints(u,a)},f.fromVertices=function(e,o,i,a){if(n.e(a)||(a=new f),!n.e(e)||0===e.length)return a.center=t.t.clone(t.t.ZERO,a.center),a.radius=0,a;o=n.u(o,t.t.ZERO),i=n.u(i,3),r.o.typeOf.number.greaterThanOrEquals("stride",i,3);var u=g;u.x=e[0]+o.x,u.y=e[1]+o.y,u.z=e[2]+o.z;var s,c=t.t.clone(u,l),p=t.t.clone(u,h),A=t.t.clone(u,d),x=t.t.clone(u,y),S=t.t.clone(u,m),E=t.t.clone(u,v),_=e.length;for(s=0;s<_;s+=i){var C=e[s]+o.x,I=e[s+1]+o.y,T=e[s+2]+o.z;u.x=C,u.y=I,u.z=T,C<c.x&&t.t.clone(u,c),C>x.x&&t.t.clone(u,x),I<p.y&&t.t.clone(u,p),I>S.y&&t.t.clone(u,S),T<A.z&&t.t.clone(u,A),T>E.z&&t.t.clone(u,E)}var P=t.t.magnitudeSquared(t.t.subtract(x,c,q)),U=t.t.magnitudeSquared(t.t.subtract(S,p,q)),B=t.t.magnitudeSquared(t.t.subtract(E,A,q)),k=c,j=x,D=P;U>D&&(D=U,k=p,j=S),B>D&&(D=B,k=A,j=E);var z=b;z.x=.5*(k.x+j.x),z.y=.5*(k.y+j.y),z.z=.5*(k.z+j.z);var L=t.t.magnitudeSquared(t.t.subtract(j,z,q)),K=Math.sqrt(L),M=w;M.x=c.x,M.y=p.y,M.z=A.z;var F=R;F.x=x.x,F.y=S.y,F.z=E.z;var N=t.t.midpoint(M,F,O),H=0;for(s=0;s<_;s+=i){u.x=e[s]+o.x,u.y=e[s+1]+o.y,u.z=e[s+2]+o.z;var V=t.t.magnitude(t.t.subtract(u,N,q));V>H&&(H=V);var Y=t.t.magnitudeSquared(t.t.subtract(u,z,q));if(Y>L){var J=Math.sqrt(Y);L=(K=.5*(K+J))*K;var X=J-K;z.x=(K*z.x+X*u.x)/J,z.y=(K*z.y+X*u.y)/J,z.z=(K*z.z+X*u.z)/J}}return K<H?(t.t.clone(z,a.center),a.radius=K):(t.t.clone(N,a.center),a.radius=H),a},f.fromEncodedCartesianVertices=function(e,r,o){if(n.e(o)||(o=new f),!n.e(e)||!n.e(r)||e.length!==r.length||0===e.length)return o.center=t.t.clone(t.t.ZERO,o.center),o.radius=0,o;var i=g;i.x=e[0]+r[0],i.y=e[1]+r[1],i.z=e[2]+r[2];var a,u=t.t.clone(i,l),s=t.t.clone(i,h),c=t.t.clone(i,d),p=t.t.clone(i,y),A=t.t.clone(i,m),x=t.t.clone(i,v),S=e.length;for(a=0;a<S;a+=3){var E=e[a]+r[a],_=e[a+1]+r[a+1],C=e[a+2]+r[a+2];i.x=E,i.y=_,i.z=C,E<u.x&&t.t.clone(i,u),E>p.x&&t.t.clone(i,p),_<s.y&&t.t.clone(i,s),_>A.y&&t.t.clone(i,A),C<c.z&&t.t.clone(i,c),C>x.z&&t.t.clone(i,x)}var I=t.t.magnitudeSquared(t.t.subtract(p,u,q)),T=t.t.magnitudeSquared(t.t.subtract(A,s,q)),P=t.t.magnitudeSquared(t.t.subtract(x,c,q)),U=u,B=p,k=I;T>k&&(k=T,U=s,B=A),P>k&&(k=P,U=c,B=x);var j=b;j.x=.5*(U.x+B.x),j.y=.5*(U.y+B.y),j.z=.5*(U.z+B.z);var D=t.t.magnitudeSquared(t.t.subtract(B,j,q)),z=Math.sqrt(D),L=w;L.x=u.x,L.y=s.y,L.z=c.z;var K=R;K.x=p.x,K.y=A.y,K.z=x.z;var M=t.t.midpoint(L,K,O),F=0;for(a=0;a<S;a+=3){i.x=e[a]+r[a],i.y=e[a+1]+r[a+1],i.z=e[a+2]+r[a+2];var N=t.t.magnitude(t.t.subtract(i,M,q));N>F&&(F=N);var H=t.t.magnitudeSquared(t.t.subtract(i,j,q));if(H>D){var V=Math.sqrt(H);D=(z=.5*(z+V))*z;var Y=V-z;j.x=(z*j.x+Y*i.x)/V,j.y=(z*j.y+Y*i.y)/V,j.z=(z*j.z+Y*i.z)/V}}return z<F?(t.t.clone(j,o.center),o.radius=z):(t.t.clone(M,o.center),o.radius=F),o},f.fromCornerPoints=function(e,o,i){r.o.typeOf.object("corner",e),r.o.typeOf.object("oppositeCorner",o),n.e(i)||(i=new f);var a=t.t.midpoint(e,o,i.center);return i.radius=t.t.distance(a,o),i},f.fromEllipsoid=function(e,o){return r.o.typeOf.object("ellipsoid",e),n.e(o)||(o=new f),t.t.clone(t.t.ZERO,o.center),o.radius=e.maximumRadius,o};var T=new t.t;f.fromBoundingSpheres=function(e,r){if(n.e(r)||(r=new f),!n.e(e)||0===e.length)return r.center=t.t.clone(t.t.ZERO,r.center),r.radius=0,r;var o=e.length;if(1===o)return f.clone(e[0],r);if(2===o)return f.union(e[0],e[1],r);var i,a=[];for(i=0;i<o;i++)a.push(e[i].center);var u=(r=f.fromPoints(a,r)).center,s=r.radius;for(i=0;i<o;i++){var c=e[i];s=Math.max(s,t.t.distance(u,c.center,T)+c.radius)}return r.radius=s,r};var P=new t.t,U=new t.t,B=new t.t;f.fromOrientedBoundingBox=function(e,o){r.o.defined("orientedBoundingBox",e),n.e(o)||(o=new f);var i=e.halfAxes,a=u.p.getColumn(i,0,P),s=u.p.getColumn(i,1,U),c=u.p.getColumn(i,2,B);return t.t.add(a,s,a),t.t.add(a,c,a),o.center=t.t.clone(e.center,o.center),o.radius=t.t.magnitude(a),o},f.clone=function(e,r){if(n.e(e))return n.e(r)?(r.center=t.t.clone(e.center,r.center),r.radius=e.radius,r):new f(e.center,e.radius)},f.packedLength=4,f.pack=function(e,t,o){r.o.typeOf.object("value",e),r.o.defined("array",t),o=n.u(o,0);var i=e.center;return t[o++]=i.x,t[o++]=i.y,t[o++]=i.z,t[o]=e.radius,t},f.unpack=function(e,t,o){r.o.defined("array",e),t=n.u(t,0),n.e(o)||(o=new f);var i=o.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],o.radius=e[t],o};var k=new t.t,j=new t.t;f.union=function(e,o,i){r.o.typeOf.object("left",e),r.o.typeOf.object("right",o),n.e(i)||(i=new f);var a=e.center,u=e.radius,s=o.center,c=o.radius,p=t.t.subtract(s,a,k),l=t.t.magnitude(p);if(u>=l+c)return e.clone(i),i;if(c>=l+u)return o.clone(i),i;var h=.5*(u+l+c),d=t.t.multiplyByScalar(p,(-u+h)/l,j);return t.t.add(d,a,d),t.t.clone(d,i.center),i.radius=h,i};var D=new t.t;f.expand=function(e,n,o){r.o.typeOf.object("sphere",e),r.o.typeOf.object("point",n),o=f.clone(e,o);var i=t.t.magnitude(t.t.subtract(n,o.center,D));return i>o.radius&&(o.radius=i),o},f.intersectPlane=function(e,n){r.o.typeOf.object("sphere",e),r.o.typeOf.object("plane",n);var o=e.center,a=e.radius,u=n.normal,s=t.t.dot(u,o)+n.distance;return s<-a?i.S.OUTSIDE:s<a?i.S.INTERSECTING:i.S.INSIDE},f.transform=function(e,t,o){return r.o.typeOf.object("sphere",e),r.o.typeOf.object("transform",t),n.e(o)||(o=new f),o.center=u.y.multiplyByPoint(t,e.center,o.center),o.radius=u.y.getMaximumScale(t)*e.radius,o};var z=new t.t;f.distanceSquaredTo=function(e,n){r.o.typeOf.object("sphere",e),r.o.typeOf.object("cartesian",n);var o=t.t.subtract(e.center,n,z);return t.t.magnitudeSquared(o)-e.radius*e.radius},f.transformWithoutScale=function(e,t,o){return r.o.typeOf.object("sphere",e),r.o.typeOf.object("transform",t),n.e(o)||(o=new f),o.center=u.y.multiplyByPoint(t,e.center,o.center),o.radius=e.radius,o};var L=new t.t;f.computePlaneDistances=function(e,o,i,a){r.o.typeOf.object("sphere",e),r.o.typeOf.object("position",o),r.o.typeOf.object("direction",i),n.e(a)||(a=new p);var u=t.t.subtract(e.center,o,L),s=t.t.dot(i,u);return a.start=s-e.radius,a.stop=s+e.radius,a};for(var K=new t.t,M=new t.t,F=new t.t,N=new t.t,H=new t.t,V=new t.t$1,Y=new Array(8),J=0;J<8;++J)Y[J]=new t.t;var X=new i.n;function G(e){if(e instanceof G)this.scheme=e.scheme,this.authority=e.authority,this.path=e.path,this.query=e.query,this.fragment=e.fragment;else if(e){var t=Q.exec(e);this.scheme=t[1],this.authority=t[2],this.path=t[3],this.query=t[4],this.fragment=t[5]}}f.projectTo2D=function(e,o,i){r.o.typeOf.object("sphere",e);var a,u=(o=n.u(o,X)).ellipsoid,s=e.center,c=e.radius;a=t.t.equals(s,t.t.ZERO)?t.t.clone(t.t.UNIT_X,K):u.geodeticSurfaceNormal(s,K);var p=t.t.cross(t.t.UNIT_Z,a,M);t.t.normalize(p,p);var l=t.t.cross(a,p,F);t.t.normalize(l,l),t.t.multiplyByScalar(a,c,a),t.t.multiplyByScalar(l,c,l),t.t.multiplyByScalar(p,c,p);var h=t.t.negate(l,H),d=t.t.negate(p,N),y=Y,m=y[0];t.t.add(a,l,m),t.t.add(m,p,m),m=y[1],t.t.add(a,l,m),t.t.add(m,d,m),m=y[2],t.t.add(a,h,m),t.t.add(m,d,m),m=y[3],t.t.add(a,h,m),t.t.add(m,p,m),t.t.negate(a,a),m=y[4],t.t.add(a,l,m),t.t.add(m,p,m),m=y[5],t.t.add(a,l,m),t.t.add(m,d,m),m=y[6],t.t.add(a,h,m),t.t.add(m,d,m),m=y[7],t.t.add(a,h,m),t.t.add(m,p,m);for(var v=y.length,g=0;g<v;++g){var q=y[g];t.t.add(s,q,q);var b=u.cartesianToCartographic(q,V);o.project(b,q)}var w=(s=(i=f.fromPoints(y,i)).center).x,R=s.y,O=s.z;return s.x=O,s.y=w,s.z=R,i},f.isOccluded=function(e,t){return r.o.typeOf.object("sphere",e),r.o.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)},f.equals=function(e,r){return e===r||n.e(e)&&n.e(r)&&t.t.equals(e.center,r.center)&&e.radius===r.radius},f.prototype.intersectPlane=function(e){return f.intersectPlane(this,e)},f.prototype.distanceSquaredTo=function(e){return f.distanceSquaredTo(this,e)},f.prototype.computePlaneDistances=function(e,t,r){return f.computePlaneDistances(this,e,t,r)},f.prototype.isOccluded=function(e){return f.isOccluded(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.volume=function(){var e=this.radius;return A*e*e*e},G.prototype.scheme=null,G.prototype.authority=null,G.prototype.path="",G.prototype.query=null,G.prototype.fragment=null;var Q=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");G.prototype.getScheme=function(){return this.scheme},G.prototype.getAuthority=function(){return this.authority},G.prototype.getPath=function(){return this.path},G.prototype.getQuery=function(){return this.query},G.prototype.getFragment=function(){return this.fragment},G.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},G.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},G.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},G.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace($,te).replace(Z,ee)),this.path&&(this.path=this.path.replace(Z,ee)),this.query&&(this.query=this.query.replace(Z,ee)),this.fragment&&(this.fragment=this.fragment.replace(Z,ee))};var Z=/%[0-9a-z]{2}/gi,W=/[a-zA-Z0-9\-\._~]/,$=/(.*@)?([^@:]*)(:.*)?/;function ee(e){var t=unescape(e);return W.test(t)?t:e.toUpperCase()}function te(e,t,r,n){return(t||"")+r.toLowerCase()+(n||"")}function re(e,t){if(null===e||"object"!=typeof e)return e;t=n.u(t,!1);var r=new e.constructor;for(var o in e)if(e.hasOwnProperty(o)){var i=e[o];t&&(i=re(i,t)),r[o]=i}return r}function ne(e,t,r){r=n.u(r,!1);var o,i,a,u={},s=n.e(e),c=n.e(t);if(s)for(o in e)e.hasOwnProperty(o)&&(i=e[o],c&&r&&"object"==typeof i&&t.hasOwnProperty(o)?(a=t[o],u[o]="object"==typeof a?ne(i,a,r):i):u[o]=i);if(c)for(o in t)t.hasOwnProperty(o)&&!u.hasOwnProperty(o)&&(a=t[o],u[o]=a);return u}function oe(e,t){var r;return typeof document<"u"&&(r=document),oe._implementation(e,t,r)}G.prototype.resolve=function(e){var t=new G;return this.scheme?(t.scheme=this.scheme,t.authority=this.authority,t.path=this.path,t.query=this.query):(t.scheme=e.scheme,this.authority?(t.authority=this.authority,t.path=this.path,t.query=this.query):(t.authority=e.authority,""==this.path?(t.path=e.path,t.query=this.query||e.query):("/"==this.path.charAt(0)?(t.path=this.path,t.removeDotSegments()):(e.authority&&""==e.path?t.path="/"+this.path:t.path=e.path.substring(0,e.path.lastIndexOf("/")+1)+this.path,t.removeDotSegments()),t.query=this.query))),t.fragment=this.fragment,t},G.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),r=[],n=""==t[0];n&&t.shift();for(""==t[0]&&t.shift();t.length;)".."==(e=t.shift())?r.pop():"."!=e&&r.push(e);("."==e||".."==e)&&r.push(""),n&&r.unshift(""),this.path=r.join("/")},G.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},oe._implementation=function(e,t,o){if(!n.e(e))throw new r.t("relative uri is required.");if(!n.e(t)){if(typeof o>"u")return e;t=n.u(o.baseURI,o.location.href)}var i=new G(t);return new G(e).resolve(i).toString()};var ie,ae=/^blob:/i;function ue(e){return r.o.typeOf.string("uri",e),ae.test(e)}var se=/^data:/i;function ce(e){return r.o.typeOf.string("uri",e),se.test(e)}var pe=Object.freeze({UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5}),fe=Object.freeze({TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3,PACK:4,BLOCK:5,BLOCKPACK:6});function le(e){e=n.u(e,n.u.EMPTY_OBJECT);var t=n.u(e.throttleByServer,!1),r=n.u(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=n.u(e.priority,0),this.throttle=r,this.throttleByServer=t,this.type=n.u(e.type,fe.OTHER),this.serverKey=void 0,this.state=pe.UNISSUED,this.deferred=void 0,this.cancelled=!1}function he(e,t,r){this.statusCode=e,this.response=t,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=function(e){var t={};if(!e)return t;for(var r=e.split("\r\n"),n=0;n<r.length;++n){var o=r[n],i=o.indexOf(": ");if(i>0){var a=o.substring(0,i),u=o.substring(i+2);t[a]=u}}return t}(this.responseHeaders))}function de(e){r.o.typeOf.object("options",e),r.o.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}function ye(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}le.prototype.cancel=function(){this.cancelled=!0},le.prototype.clone=function(e){return n.e(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 le(this)},he.prototype.toString=function(){var e="Request has failed.";return n.e(this.statusCode)&&(e+=" Status Code: "+this.statusCode),e},Object.defineProperties(de.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){this._maximumLength=e,this._length>e&&e>0&&(this._length=e,this._array.length=e)}},comparator:{get:function(){return this._comparator}}}),de.prototype.reserve=function(e){e=n.u(e,this._length),this._array.length=e},de.prototype.heapify=function(e){e=n.u(e,0);for(var t=this._length,r=this._comparator,o=this._array,i=-1,a=!0;a;){var u=2*(e+1),s=u-1;i=s<t&&r(o[s],o[e])<0?s:e,u<t&&r(o[u],o[i])<0&&(i=u),i!==e?(ye(o,i,e),e=i):a=!1}},de.prototype.resort=function(){for(var e=this._length,t=Math.ceil(e/2);t>=0;--t)this.heapify(t)},de.prototype.insert=function(e){r.o.defined("element",e);var t,o=this._array,i=this._comparator,a=this._maximumLength,u=this._length++;for(u<o.length?o[u]=e:o.push(e);0!==u;){var s=Math.floor((u-1)/2);if(!(i(o[u],o[s])<0))break;ye(o,u,s),u=s}return n.e(a)&&this._length>a&&(t=o[a],o.pop(),this._length=a),t},de.prototype.pop=function(e){if(e=n.u(e,0),0!==this._length){r.o.typeOf.number.lessThan("index",e,this._length);var t=this._array,o=t[e];return ye(t,e,--this._length),t[this._length]=void 0,this.heapify(e),o}};var me=typeof performance<"u"&&"function"==typeof performance.now&&isFinite(performance.now())?function(){return performance.now()}:function(){return Date.now()};function ve(e,t){return e.priority-t.priority}var ge={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0,totalRequestTime:0},qe=20,be=new de({comparator:ve});be.maximumLength=qe,be.reserve(qe);var we=[],Re={},Oe=typeof document<"u"?new G(document.location.href):new G,Ae=new s.o;function xe(){}function Se(e){n.e(e.priorityFunction)&&(e.priority=e.priorityFunction())}function Ee(e){var t=n.u(xe.requestsByServer[e],xe.maximumRequestsPerServer);return Re[e]<t}function _e(e){return n.e(e.packKey)||(e.packKey=e.serverKey+"_"+e.providerName),e.packKey}function Ce(e){return n.e(e.blockKey)||(e.blockKey=e.serverKey+"_"+e.providerName+"_"+e.quadKey+e.url.substring(e.url.indexOf("dataVersion"))),e.blockKey}function Ie(e){var t=_e(e);return n.e(xe.packRequestGroup[t])||(xe.packRequestGroup[t]=[]),n.e(xe.packRequestQuadKey[t])||(xe.packRequestQuadKey[t]=""),n.e(xe.packRequestPromise[t])||(xe.packRequestPromise[t]=n.o.defer()),n.e(xe.quadKeyIndex[t])||(xe.quadKeyIndex[t]=0),e.quadKeyIndex=xe.quadKeyIndex[t]++,e.deferred=xe.packRequestPromise[t],e.state=pe.ISSUED,xe.packRequestGroup[t].push(e),e.deferred.promise}function Te(e){for(var t=0,r=e.length;t<r;t++){e[t].state=pe.CANCELLED}}function Pe(e){for(var t=[],r={},n=0,o=e.length;n<o;n++){var i=e[n];if(!i.cancelled){var a=i.quadKey;r[a]||(r[a]=!0,t.push(a))}}return t}function Ue(){var e=xe.packRequestGroup;for(var t in e)if(e.hasOwnProperty(t)){var r=e[t];if(r.length<1)continue;var o=r[0].clone(),i=-1!==o.url.indexOf("rest/maps");o.serverKey=r[0].serverKey,o.state=r[0].state;var a=o.url,u=Pe(r);if(u.length<1)continue;xe.packRequestQuadKey[t]=i?u.join(","):u.join(";");var s=xe.packRequestQuadKey[t];if(o.throttleByServer&&!Ee(o.serverKey)){Te(r),xe.packRequestPromise[t].reject();continue}o.deferred=xe.packRequestPromise[t];var c=new G(a);c.query=i?n.e(c.query)?c.query+"&tiles="+s:"tiles="+s:n.e(c.query)?c.query+"&extratiles="+s:"extratiles="+s,o.url=c.toString(),je(o,o.url)}xe.packRequestGroup={},xe.packRequestPromise={},xe.packRequestQuadKey={},xe.quadKeyIndex={}}function Be(){var e=xe.blockRequest;for(var t in e)if(e.hasOwnProperty(t)){je(e[t])}xe.blockRequest={}}function ke(e){if(e.state===pe.UNISSUED)if(e.state=pe.ISSUED,e.type===fe.PACK||e.type===fe.BLOCKPACK){var t=_e(e);n.e(xe.packRequestPromise[t])||(xe.packRequestPromise[t]=n.o.defer()),e.deferred=xe.packRequestPromise[t]}else e.deferred=n.o.defer();return e.deferred.promise}function je(e,t){var r=ke(e);return e.state=pe.ACTIVE,we.push(e),++ge.numberOfActiveRequests,++ge.numberOfActiveRequestsEver,++Re[e.serverKey],e.startTime=me(),e.requestFunction(t).then(function(e){return function(t){if(e.state!==pe.CANCELLED&&(--ge.numberOfActiveRequests,--Re[e.serverKey],Ae.raiseEvent(),e.state=pe.RECEIVED,e.deferred.resolve(t),e.endTime=me(),(xe.statisticRequestTime>0||e.type!==fe.OTHER)&&(ge.totalRequestTime+=e.endTime-e.startTime),e.type===fe.BLOCK||e.type===fe.BLOCKPACK)){var r=Ce(e);n.e(xe.blockDefer[r])&&(xe.blockDefer[r]=void 0,delete xe.blockDefer[r])}}}(e)).otherwise(function(e){return function(t){e.state!==pe.CANCELLED&&(++ge.numberOfFailedRequests,--ge.numberOfActiveRequests,--Re[e.serverKey],Ae.raiseEvent(t),e.state=pe.FAILED,e.deferred.reject(t))}}(e)),r}function De(e){var t=e.state===pe.ACTIVE;e.state=pe.CANCELLED,++ge.numberOfCancelledRequests,e.deferred.reject(),t&&(--ge.numberOfActiveRequests,--Re[e.serverKey],++ge.numberOfCancelledActiveRequests),n.e(e.cancelFunction)&&e.cancelFunction()}xe.TIMEOUT=5e3,xe.CANCLE_COUNT=3,xe.statisticRequestTime=-1,xe.maximumRequests=50,xe.maximumRequestsPerServer=6,xe.perPacketCount=20,xe.requestsByServer={},xe.throttleRequests=!0,xe.debugShowStatistics=!1,xe.requestCompletedEvent=Ae,Object.defineProperties(xe,{activeRequestLength:{get:function(){return we.length}},statistics:{get:function(){return ge}},priorityHeapLength:{get:function(){return qe},set:function(e){if(e<qe)for(;be.length>e;){De(be.pop())}qe=e,be.maximumLength=e,be.reserve(e)}}}),xe.packRequestGroup={},xe.packRequestPromise={},xe.packRequestQuadKey={},xe.quadKeyIndex={},xe.packRequestHeap={},xe.blockDefer={},xe.blockRequest={},xe.update=function(){var e,t,r=0,n=we.length;for(e=0;e<n;++e)(t=we[e]).cancelled&&De(t),t.state===pe.ACTIVE?r>0&&(we[e-r]=t):++r;we.length-=r;var o=be.internalArray,i=be.length;for(e=0;e<i;++e)Se(o[e]);be.resort(),function(){for(var e in xe.packRequestHeap)if(xe.packRequestHeap.hasOwnProperty(e)){for(var t=xe.packRequestHeap[e],r=t.internalArray,n=t.length,o=0;o<n;++o)Se(r[o]);t.resort()}}(),Be(),function(){for(var e in xe.packRequestHeap)if(xe.packRequestHeap.hasOwnProperty(e))for(var t=xe.packRequestHeap[e];t.length>0;){var r=t.pop();r.cancelled?De(r):Ie(r)}Ue()}();for(var a=Math.max(xe.maximumRequests-we.length,0),u=0;u<a&&be.length>0;)(t=be.pop()).cancelled?De(t):!t.throttleByServer||Ee(t.serverKey)?(je(t),++u):De(t);!xe.debugShowStatistics||(0===ge.numberOfActiveRequests&&ge.lastNumberOfActiveRequests>0&&(ge.numberOfAttemptedRequests>0&&(console.log("Number of attempted requests: "+ge.numberOfAttemptedRequests),ge.numberOfAttemptedRequests=0),ge.numberOfCancelledRequests>0&&(console.log("Number of cancelled requests: "+ge.numberOfCancelledRequests),ge.numberOfCancelledRequests=0),ge.numberOfCancelledActiveRequests>0&&(console.log("Number of cancelled active requests: "+ge.numberOfCancelledActiveRequests),ge.numberOfCancelledActiveRequests=0),ge.numberOfFailedRequests>0&&(console.log("Number of failed requests: "+ge.numberOfFailedRequests),ge.numberOfFailedRequests=0)),ge.lastNumberOfActiveRequests=ge.numberOfActiveRequests)},xe.getServerKey=function(e){r.o.typeOf.string("url",e);var t=new G(e).resolve(Oe);t.normalize();var o=t.authority;/:/.test(o)||(o=o+":"+("https"===t.scheme?"443":"80"));var i=Re[o];return n.e(i)||(Re[o]=0),o},xe.request=function(e){if(r.o.typeOf.object("request",e),r.o.typeOf.string("request.url",e.url),r.o.typeOf.func("request.requestFunction",e.requestFunction),ce(e.url)||ue(e.url))return Ae.raiseEvent(),e.state=pe.RECEIVED,e.requestFunction();if(++ge.numberOfAttemptedRequests,n.e(e.serverKey)||(e.serverKey=xe.getServerKey(e.url)),e.type===fe.BLOCK)return function(e){var t=Ce(e),r=xe.blockDefer[t];return n.e(r)||(r=xe.blockDefer[t]=n.o.defer(),xe.blockRequest[t]=e),e.deferred=r,e.state=pe.ISSUED,e.deferred.promise}(e);if(!e.throttleByServer||Ee(e.serverKey)){if(!xe.throttleRequests||!e.throttle)return je(e);if(!(we.length>=xe.maximumRequests)){var t;if(Se(e),e.type===fe.PACK||e.type===fe.BLOCKPACK){var o=function(e){var t=_e(e),r=xe.packRequestHeap[t];return n.e(r)||((r=xe.packRequestHeap[t]=new de({comparator:ve})).maximumLength=xe.perPacketCount,r.reserve(qe)),r}(e),i=!0;if(e.type===fe.BLOCKPACK)for(var a=0;a<o.length;a++)if(o._array[a].quadKey===e.quadKey){e.blockRequest=o._array[a],i=!1;break}i&&(t=o.insert(e))}else t=be.insert(e);if(n.e(t)){if(t===e)return;De(t)}return ke(e)}}},xe.clearForSpecs=function(){for(;be.length>0;){De(be.pop())}for(var e=we.length,t=0;t<e;++t)De(we[t]);we.length=0,Re={},ge.numberOfAttemptedRequests=0,ge.numberOfActiveRequests=0,ge.numberOfCancelledRequests=0,ge.numberOfCancelledActiveRequests=0,ge.numberOfFailedRequests=0,ge.numberOfActiveRequestsEver=0,ge.lastNumberOfActiveRequests=0,ge.totalRequestTime=0},xe.numberOfActiveRequestsByServer=function(e){return Re[e]},xe.requestHeap=be;var ze={},Le={};ze.add=function(e,t){if(!n.e(e))throw new r.t("host is required.");if(!n.e(t)||t<=0)throw new r.t("port is required to be greater than 0.");var o=e.toLowerCase()+":"+t;n.e(Le[o])||(Le[o]=!0)},ze.remove=function(e,t){if(!n.e(e))throw new r.t("host is required.");if(!n.e(t)||t<=0)throw new r.t("port is required to be greater than 0.");var o=e.toLowerCase()+":"+t;n.e(Le[o])&&delete Le[o]},ze.contains=function(e){if(!n.e(e))throw new r.t("url is required.");var t=function(e){var t=new G(e);t.normalize();var r=t.getAuthority();if(n.e(r)){if(-1!==r.indexOf("@")){var o=r.split("@");r=o[1]}if(-1===r.indexOf(":")){var i=t.getScheme();if(n.e(i)||(i=(i=window.location.protocol).substring(0,i.length-1)),"http"===i)r+=":80";else{if("https"!==i)return;r+=":443"}}return r}}(e);return!(!n.e(t)||!n.e(Le[t]))},ze.clear=function(){Le={}};var Ke={};function Me(e,t){if(!n.e(e))throw new r.t("identifier is required.");n.e(Ke[e])||(Ke[e]=!0,console.warn(n.u(t,e)))}Me.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",Me.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",Me.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",Me.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var Fe,Ne=function(){try{var e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob","blob"===e.responseType}catch{return!1}}();function He(e,t,o,i){var a,u=e.query;if(!n.e(u)||0===u.length)return{};if(-1===u.indexOf("=")){var s={};s[u]=void 0,a=s}else a=function(e){if(!n.e(e))throw new r.t("queryString is required.");var t={};if(""===e)return t;for(var o=e.replace(/\+/g,"%20").split(/[&;]/),i=0,a=o.length;i<a;++i){var u=o[i].split("=");if(u.length>2){var s=o[i].indexOf("=");u=[o[i].substring(0,s),o[i].substring(s+1,o[i].length)]}var c=decodeURIComponent(u[0]),p=u[1];p=n.e(p)?decodeURIComponent(p):"";var f=t[c];"string"==typeof f?t[c]=[f,p]:Array.isArray(f)?f.push(p):t[c]=p}return t}(u);t._queryParameters=o?Xe(a,t._queryParameters,i):a,e.query=void 0}function Ve(e,t){var o=t._queryParameters,i=Object.keys(o);1!==i.length||n.e(o[i[0]])?e.query=function(e,t){if(!n.e(e))throw new r.t("obj is required.");var o="";for(var i in e)if(e.hasOwnProperty(i)){var a=e[i],u=encodeURIComponent(i)+"=";if(Array.isArray(a))for(var s=0,c=a.length;s<c;++s)o+=!0===t?u+encodeURI(a[s])+"&":u+encodeURIComponent(a[s])+"&";else o+=!0===t?u+encodeURI(a)+"&":u+encodeURIComponent(a)+"&"}return o.slice(0,-1)}(o):e.query=i[0]}function Ye(e,t){return n.e(e)?n.e(e.clone)?e.clone():re(e):t}function Je(e){if(e.state===pe.ISSUED||e.state===pe.ACTIVE)throw new c.t("The Resource is already being fetched.");e.state=pe.UNISSUED,e.deferred=void 0}function Xe(e,t,r){if(!r)return ne(e,t);var o=re(e,!0);for(var i in t)if(t.hasOwnProperty(i)){var a=o[i],u=t[i];n.e(a)?(Array.isArray(a)||(a=o[i]=[a]),o[i]=a.concat(u)):o[i]=Array.isArray(u)?u.slice():u}return o}function Ge(e){"string"==typeof(e=n.u(e,n.u.EMPTY_OBJECT))&&(e={url:e}),r.o.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=Ye(e.templateValues,{}),this._queryParameters=Ye(e.queryParameters,{}),this.headers=Ye(e.headers,{}),this.request=n.u(e.request,new le),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=n.u(e.retryAttempts,0),this._retryCount=0;var t=new G(e.url);He(t,this,!0,!0),t.fragment=void 0,this._url=t.toString()}function Qe(e){var t=e.resource,r=e.flipY,o=e.preferImageBitmap,i=t.request;i.url=t.url,i.requestFunction=function(){var e=!1;!t.isDataUri&&!t.isBlobUri&&(e=t.isCrossOriginUrl);var a=n.o.defer();return Ge._Implementations.createImage(i,e,a,r,o),a.promise};var a=xe.request(i);if(n.e(a))return a.otherwise((function(e){return i.state!==pe.FAILED?n.o.reject(e):t.retryOnError(e).then((function(a){return a?(i.state=pe.UNISSUED,i.deferred=void 0,Qe({resource:t,flipY:r,preferImageBitmap:o})):n.o.reject(e)}))}))}function Ze(e,t,r){var o={};o[t]=r,e.setQueryParameters(o);var i=e.request;i.url=e.url,i.requestFunction=function(){var t=n.o.defer();return window[r]=function(e){t.resolve(e);try{delete window[r]}catch{window[r]=void 0}},Ge._Implementations.loadAndExecuteScript(e.url,r,t),t.promise};var a=xe.request(i);if(n.e(a))return a.otherwise((function(o){return i.state!==pe.FAILED?n.o.reject(o):e.retryOnError(o).then((function(a){return a?(i.state=pe.UNISSUED,i.deferred=void 0,Ze(e,t,r)):n.o.reject(o)}))}))}Ge.createIfNeeded=function(e){return e instanceof Ge?e.getDerivedResource({request:e.request}):"string"!=typeof e?e:new Ge({url:e})},Ge.supportsImageBitmapOptions=function(){if(n.e(Fe))return Fe;if("function"!=typeof createImageBitmap)return Fe=n.o.resolve(!1);return Fe=Ge.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWP4////fwAJ+wP9CNHoHgAAAABJRU5ErkJggg=="}).then((function(e){return createImageBitmap(e,{imageOrientation:"flipY",premultiplyAlpha:"none"})})).then((function(e){return!0})).otherwise((function(){return!1})),Fe},Object.defineProperties(Ge,{isBlobSupported:{get:function(){return Ne}}}),Object.defineProperties(Ge.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){var t=new G(e);He(t,this,!1),t.fragment=void 0,this._url=t.toString()}},extension:{get:function(){return function(e){if(!n.e(e))throw new r.t("uri is required.");var t=new G(e);t.normalize();var o=t.path,i=o.lastIndexOf("/");return-1!==i&&(o=o.substr(i+1)),i=o.lastIndexOf("."),-1===i?"":o.substr(i+1)}(this._url)}},isDataUri:{get:function(){return ce(this._url)}},isBlobUri:{get:function(){return ue(this._url)}},isCrossOriginUrl:{get:function(){return function(e){n.e(ie)||(ie=document.createElement("a")),ie.href=window.location.href;var t=ie.host,r=ie.protocol;return ie.href=e,ie.href=ie.href,r!==ie.protocol||t!==ie.host}(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}}}),Ge.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;var r=new G(this._url);e&&Ve(r,this);var o=r.toString().replace(/%7B/g,"{").replace(/%7D/g,"}"),i=this._templateValues;return o=o.replace(/{(.*?)}/g,(function(e,t){var r=i[t];return n.e(r)&&"s"==t?encodeURI(r):n.e(r)?encodeURIComponent(r):e})),t&&n.e(this.proxy)&&(o=this.proxy.getURL(o)),o},Ge.prototype.setQueryParameters=function(e,t){this._queryParameters=t?Xe(this._queryParameters,e,!1):Xe(e,this._queryParameters,!1)},Ge.prototype.appendQueryParameters=function(e){this._queryParameters=Xe(e,this._queryParameters,!0)},Ge.prototype.setTemplateValues=function(e,t){this._templateValues=t?ne(this._templateValues,e):ne(e,this._templateValues)},Ge.prototype.getDerivedResource=function(e){var t=this.clone();if(t._retryCount=0,n.e(e.url)){var r=new G(e.url);He(r,t,!0,n.u(e.preserveQueryParameters,!1)),r.fragment=void 0,t._url=r.resolve(new G(oe(this._url))).toString()}return n.e(e.queryParameters)&&(t._queryParameters=ne(e.queryParameters,t._queryParameters)),n.e(e.templateValues)&&(t._templateValues=ne(e.templateValues,t.templateValues)),n.e(e.headers)&&(t.headers=ne(e.headers,t.headers)),n.e(e.proxy)&&(t.proxy=e.proxy),n.e(e.request)&&(t.request=e.request),n.e(e.retryCallback)&&(t.retryCallback=e.retryCallback),n.e(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t},Ge.prototype.retryOnError=function(e){var t=this.retryCallback;if("function"!=typeof t||this._retryCount>=this.retryAttempts)return n.o(!1);var r=this;return n.o(t(this,e)).then((function(e){return++r._retryCount,e}))},Ge.prototype.clone=function(e){return n.e(e)||(e=new Ge({url:this._url})),e._url=this._url,e._queryParameters=re(this._queryParameters),e._templateValues=re(this._templateValues),e.headers=re(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e},Ge.prototype.getBaseUri=function(e){return function(e,t){if(!n.e(e))throw new r.t("uri is required.");var o="",i=e.lastIndexOf("/");return-1!==i&&(o=e.substring(0,i+1)),t&&(e=new G(e),n.e(e.query)&&(o+="?"+e.query),n.e(e.fragment)&&(o+="#"+e.fragment)),o}(this.getUrlComponent(e),e)},Ge.prototype.appendForwardSlash=function(){this._url=function(e){return(0===e.length||"/"!==e[e.length-1])&&(e+="/"),e}(this._url)},Ge.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},Ge.fetchArrayBuffer=function(e){return new Ge(e).fetchArrayBuffer()},Ge.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},Ge.fetchBlob=function(e){return new Ge(e).fetchBlob()},Ge.prototype.fetchImage=function(e){e=n.u(e,n.u.EMPTY_OBJECT);var t=n.u(e.preferImageBitmap,!1),r=n.u(e.preferBlob,!1),o=n.u(e.flipY,!1);if(Je(this.request),!Ne||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!r)return Qe({resource:this,flipY:o,preferImageBitmap:t});var i,a,u,s=this.fetchBlob();return n.e(s)?Ge.supportsImageBitmapOptions().then((function(e){return i=e&&t,s})).then((function(e){if(n.e(e)){if(u=e,i)return Ge.createImageBitmapFromBlob(e,{flipY:o,premultiplyAlpha:!1});var t=window.URL.createObjectURL(e);return Qe({resource:a=new Ge({url:t}),flipY:o,preferImageBitmap:!1})}})).then((function(e){if(n.e(e))return e.blob=u,i||window.URL.revokeObjectURL(a.url),e})).otherwise((function(e){return n.e(a)&&window.URL.revokeObjectURL(a.url),e.blob=u,n.o.reject(e)})):void 0},Ge.fetchImage=function(e){return new Ge(e).fetchImage({flipY:e.flipY,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},Ge.prototype.fetchText=function(){return this.fetch({responseType:"text"})},Ge.fetchText=function(e){return new Ge(e).fetchText()},Ge.prototype.fetchJson=function(){var e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(n.e(e))return e.then((function(e){if(n.e(e))return JSON.parse(e)}))},Ge.fetchJson=function(e){return new Ge(e).fetchJson()},Ge.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},Ge.fetchXML=function(e){return new Ge(e).fetchXML()},Ge.prototype.fetchJsonp=function(e){var t;e=n.u(e,"callback"),Je(this.request);do{t="loadJsonp"+Math.random().toString().substring(2,8)}while(n.e(window[t]));return Ze(this,e,t)},Ge.fetchJsonp=function(e){return new Ge(e).fetchJsonp(e.callbackParameterName)},Ge.prototype._makeRequest=function(e){var t=this;Je(t.request);var r=t.request;r.url=t.url,r.requestFunction=function(o){var i=e.responseType,a=ne(e.headers,t.headers),u=e.overrideMimeType,s=e.method,c=e.data,p=n.o.defer(),f=n.e(o)?o:t.url,l=Ge._Implementations.loadWithXhr(f,i,s,c,a,p,u);return n.e(l)&&n.e(l.abort)&&(r.cancelFunction=function(){l.abort()}),p.promise};var o=xe.request(r);if(n.e(o))return o.then((function(e){return e})).otherwise((function(o){return r.state!==pe.FAILED?n.o.reject(o):t.retryOnError(o).then((function(i){return i?(r.state=pe.UNISSUED,r.deferred=void 0,t.fetch(e)):n.o.reject(o)}))}))};var We=/^data:(.*?)(;base64)?,(.*)$/;function $e(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function et(e,t){for(var r=$e(e,t),n=new ArrayBuffer(r.length),o=new Uint8Array(n),i=0;i<r.length;i++)o[i]=r.charCodeAt(i);return n}function tt(e,t){switch(t){case"text":return e.toString("utf8");case"json":return JSON.parse(e.toString("utf8"));default:return new Uint8Array(e).buffer}}Ge.prototype.fetch=function(e){return(e=Ye(e,{})).method="GET",this._makeRequest(e)},Ge.fetch=function(e){return new Ge(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Ge.prototype.delete=function(e){return(e=Ye(e,{})).method="DELETE",this._makeRequest(e)},Ge.delete=function(e){return new Ge(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})},Ge.prototype.head=function(e){return(e=Ye(e,{})).method="HEAD",this._makeRequest(e)},Ge.head=function(e){return new Ge(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Ge.prototype.options=function(e){return(e=Ye(e,{})).method="OPTIONS",this._makeRequest(e)},Ge.options=function(e){return new Ge(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Ge.prototype.post=function(e,t){return r.o.defined("data",e),(t=Ye(t,{})).method="POST",t.data=e,this._makeRequest(t)},Ge.post=function(e){return new Ge(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Ge.prototype.put=function(e,t){return r.o.defined("data",e),(t=Ye(t,{})).method="PUT",t.data=e,this._makeRequest(t)},Ge.put=function(e){return new Ge(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Ge.prototype.patch=function(e,t){return r.o.defined("data",e),(t=Ye(t,{})).method="PATCH",t.data=e,this._makeRequest(t)},Ge.patch=function(e){return new Ge(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Ge._Implementations={},Ge._Implementations.createImage=function(e,t,r,o,i){var a=e.url;Ge.supportsImageBitmapOptions().then((function(u){if(u&&i){var s=n.o.defer(),p=Ge._Implementations.loadWithXhr(a,"blob","GET",void 0,void 0,s,void 0,void 0,void 0);return n.e(p)&&n.e(p.abort)&&(e.cancelFunction=function(){p.abort()}),s.promise.then((function(e){if(n.e(e))return Ge.createImageBitmapFromBlob(e,{flipY:o,premultiplyAlpha:!1});r.reject(new c.t("Successfully retrieved "+a+" but it contained no content."))})).then(r.resolve)}!function(e,t,r){var n=new Image;n.onload=function(){r.resolve(n)},n.onerror=function(e){r.reject(e)},t&&(ze.contains(e)?n.crossOrigin="use-credentials":n.crossOrigin=""),n.src=e}(a,t,r)})).otherwise(r.reject)},Ge.createImageBitmapFromBlob=function(e,t){return r.o.defined("options",t),r.o.typeOf.bool("options.flipY",t.flipY),r.o.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none"})};var rt=typeof XMLHttpRequest>"u";Ge._Implementations.loadWithXhr=function(e,t,o,i,a,u,s){var p=We.exec(e);if(null===p){if(!rt){var f=new XMLHttpRequest;if(ze.contains(e)&&(f.withCredentials=!0),e=e.replace(/{/g,"%7B").replace(/}/g,"%7D"),f.open(o,e,!0),n.e(s)&&n.e(f.overrideMimeType)&&f.overrideMimeType(s),n.e(a))for(var l in a)a.hasOwnProperty(l)&&f.setRequestHeader(l,a[l]);n.e(t)&&(f.responseType=t);var h=!1;return"string"==typeof e&&(h=0===e.indexOf("file://")||typeof window<"u"&&"file://"===window.location.origin),f.onload=function(){if(!(f.status<200||f.status>=300)||h&&0===f.status){var e=f.response,r=f.responseType;if("HEAD"===o||"OPTIONS"===o){var i=f.getAllResponseHeaders().trim().split(/[\r\n]+/),a={};return i.forEach((function(e){var t=e.split(": "),r=t.shift();a[r]=t.join(": ")})),void u.resolve(a)}if(204===f.status)u.resolve();else if(!n.e(e)||n.e(t)&&r!==t)if("json"===t&&"string"==typeof e)try{u.resolve(JSON.parse(e))}catch(e){u.reject(e)}else(""===r||"document"===r)&&n.e(f.responseXML)&&f.responseXML.hasChildNodes()?u.resolve(f.responseXML):""!==r&&"text"!==r||!n.e(f.responseText)?u.reject(new c.t("Invalid XMLHttpRequest response type.")):u.resolve(f.responseText);else u.resolve(e)}else u.reject(new he(f.status,f.response,f.getAllResponseHeaders()))},f.onerror=function(e){u.reject(new he)},f.send(i),f}!function(e,t,r,n,o,i,a){var u=require("url").parse(e),s="https:"===u.protocol?require("https"):require("http"),p=require("zlib"),f={protocol:u.protocol,hostname:u.hostname,port:u.port,path:u.path,query:u.query,method:r,headers:o};s.request(f).on("response",(function(e){if(e.statusCode<200||e.statusCode>=300)i.reject(new he(e.statusCode,e,e.headers));else{var r=[];e.on("data",(function(e){r.push(e)})),e.on("end",(function(){var n=Buffer.concat(r);"gzip"===e.headers["content-encoding"]?p.gunzip(n,(function(e,r){e?i.reject(new c.t("Error decompressing response.")):i.resolve(tt(r,t))})):i.resolve(tt(n,t))}))}})).on("error",(function(e){i.reject(new he)})).end()}(e,t,o,0,a,u)}else u.resolve(function(e,t){t=n.u(t,"");var o=e[1],i=!!e[2],a=e[3];switch(t){case"":case"text":return $e(i,a);case"arraybuffer":return et(i,a);case"blob":var u=et(i,a);return new Blob([u],{type:o});case"document":return(new DOMParser).parseFromString($e(i,a),o);case"json":return JSON.parse($e(i,a));default:throw new r.t("Unhandled responseType: "+t)}}(p,t))},Ge._Implementations.loadAndExecuteScript=function(e,t,r){return function(e){var t=n.o.defer(),r=document.createElement("script");r.async=!0,r.src=e;var o=document.getElementsByTagName("head")[0];return r.onload=function(){r.onload=void 0,o.removeChild(r),t.resolve()},r.onerror=function(e){t.reject(e)},o.appendChild(r),t.promise}(e).otherwise(r.reject)},Ge._DefaultImplementations={},Ge._DefaultImplementations.createImage=Ge._Implementations.createImage,Ge._DefaultImplementations.loadWithXhr=Ge._Implementations.loadWithXhr,Ge._DefaultImplementations.loadAndExecuteScript=Ge._Implementations.loadAndExecuteScript,Ge.DEFAULT=Object.freeze(new Ge({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var nt,ot,it,at=/((?:.*\/)|^)Cesium\.js$/;function ut(e){return typeof document>"u"?e:(n.e(nt)||(nt=document.createElement("a")),nt.href=e,nt.href=nt.href,nt.href)}function st(){if(n.e(ot))return ot;var e;if(e=typeof CESIUM_BASE_URL<"u"?CESIUM_BASE_URL:"object"==typeof define&&n.e(define.amd)&&!define.amd.toUrlUndefined&&n.e(require.toUrl)?oe("..",ft("Core/buildModuleUrl.js")):function(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;t<r;++t){var n=e[t].getAttribute("src"),o=at.exec(n);if(null!==o)return o[1]}}(),!n.e(e))throw new r.t("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return(ot=new Ge({url:ut(e)})).appendForwardSlash(),ot}function ct(e){return ut(require.toUrl("../"+e))}function pt(e){return st().getDerivedResource({url:e}).url}function ft(e){return n.e(it)||(it="object"==typeof define&&n.e(define.amd)&&!define.amd.toUrlUndefined&&n.e(require.toUrl)?ct:pt),it(e)}ft._cesiumScriptRegex=at,ft._buildModuleUrlFromBaseUrl=pt,ft._clearBaseResource=function(){ot=void 0},ft.setBaseUrl=function(e){ot=Ge.DEFAULT.getDerivedResource({url:e})},ft.getCesiumBaseUrl=st,e.e=Me,e.i=f,e.n=ft,e.o=p,e.t=Ge}));
|