diff --git a/Cesium.js b/Cesium.js index 08d1e1d..d43a417 100644 --- a/Cesium.js +++ b/Cesium.js @@ -421,58 +421,58 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * MIT license **/ -!function(){var e,t,i;!function(r){function n(e,t){return C.call(e,t)}function o(e,t){var i,r,n,o,a,s,l,u,c,h,d,p=t&&t.split("/"),m=_.map,f=m&&m["*"]||{};if(e&&"."===e.charAt(0))if(t){for(e=e.split("/"),a=e.length-1,_.nodeIdCompat&&S.test(e[a])&&(e[a]=e[a].replace(S,"")),e=p.slice(0,p.length-1).concat(e),c=0;c0&&(e.splice(c-1,2),c-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((p||f)&&m){for(i=e.split("/"),c=i.length;c>0;c-=1){if(r=i.slice(0,c).join("/"),p)for(h=p.length;h>0;h-=1)if(n=m[p.slice(0,h).join("/")],n&&(n=n[r])){o=n,s=c;break}if(o)break;!l&&f&&f[r]&&(l=f[r],u=c)}!o&&l&&(o=l,s=u),o&&(i.splice(0,s,o),e=i.join("/"))}return e}function a(e,t){return function(){var i=E.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),p.apply(r,i.concat([e,t]))}}function s(e){return function(t){return o(t,e)}}function l(e){return function(t){v[e]=t}}function u(e){if(n(g,e)){var t=g[e];delete g[e],y[e]=!0,d.apply(r,t)}if(!n(v,e)&&!n(y,e))throw new Error("No "+e);return v[e]}function c(e){var t,i=e?e.indexOf("!"):-1;return i>-1&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}function h(e){return function(){return _&&_.config&&_.config[e]||{}}}var d,p,m,f,v={},g={},_={},y={},C=Object.prototype.hasOwnProperty,E=[].slice,S=/\.js$/;m=function(e,t){var i,r=c(e),n=r[0];return e=r[1],n&&(n=o(n,t),i=u(n)),n?e=i&&i.normalize?i.normalize(e,s(t)):o(e,t):(e=o(e,t),r=c(e),n=r[0],e=r[1],n&&(i=u(n))),{f:n?n+"!"+e:e,n:e,pr:n,p:i}},f={require:function(e){return a(e)},exports:function(e){var t=v[e];return"undefined"!=typeof t?t:v[e]={}},module:function(e){return{id:e,uri:"",exports:v[e],config:h(e)}}},d=function(e,t,i,o){var s,c,h,d,p,_,C=[],E=typeof i;if(o=o||e,"undefined"===E||"function"===E){for(t=!t.length&&i.length?["require","exports","module"]:t,p=0;p>>0,u=Math.max(0,Math.min(i,_)),h=[],c=_-u+1,d=[],p=a(),u)for(v=p.progress,f=function(e){d.push(e),--c||(m=f=g,p.reject(d))},m=function(e){h.push(e),--u||(m=f=g,p.resolve(h))},y=0;_>y;++y)y in t&&e(t[y],l,s,v);else p.resolve(h);return p.then(r,n,o)})}function u(e,t,i,r){function n(e){return t?t(e[0]):e[0]}return l(e,1,n,i,r)}function c(e,t,i,r){return v(1,arguments),d(e,_).then(t,i,r)}function h(){return d(arguments,_)}function d(t,i){return e(t,function(t){var r,n,o,s,l,u;if(o=n=t.length>>>0,r=[],u=a(),o)for(s=function(t,n){e(t,i).then(function(e){r[n]=e,--o||u.resolve(r)},u.reject)},l=0;n>l;l++)l in t?s(t[l],l):--o;else u.resolve(r);return u.promise})}function p(t,i){var r=C.call(arguments,1);return e(t,function(t){var n;return n=t.length,r[0]=function(t,r,o){return e(t,function(t){return e(r,function(e){return i(t,e,o,n)})})},y.apply(t,r)})}function m(t,i,r){var n=arguments.length>2;return e(t,function(e){return e=n?r:e,i.resolve(e),e},function(e){return i.reject(e),o(e)},i.progress)}function f(e,t){for(var i,r=0;i=e[r++];)i(t)}function v(e,t){for(var i,r=t.length;r>e;)if(i=t[--r],null!=i&&"function"!=typeof i)throw new Error("arg "+r+" must be a function")}function g(){}function _(e){return e}var y,C,E;return e.defer=a,e.resolve=t,e.reject=i,e.join=h,e.all=c,e.map=d,e.reduce=p,e.any=u,e.some=l,e.chain=m,e.isPromise=s,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(E,e)},"yield":function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return c(t,function(t){return e.apply(E,t)})})}},C=[].slice,y=[].reduce||function(e){var t,i,r,n,o;if(o=0,t=Object(this),n=t.length>>>0,i=arguments,i.length<=1)for(;;){if(o in t){r=t[o++];break}if(++o>=n)throw new TypeError}else r=i[1];for(;n>o;++o)o in t&&(r=e(r,t[o],o,t));return r},e})}("function"==typeof i&&i.amd?i:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),i("Core/defined",[],function(){"use strict";function e(e){return void 0!==e}return e}),i("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),i=Object.defineProperties;return t&&e(i)||(i=function(e){return e}),i}),i("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(i){t=i.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),i("Core/Credit",["./defined","./defineProperties","./DeveloperError"],function(e,t,i){"use strict";function r(t,i,r){var a=e(r),s=e(i),l=e(t);l||s||(t=r),this._text=t,this._imageUrl=i,this._link=r,this._hasLink=a,this._hasImage=s;var u,c=JSON.stringify([t,i,r]);e(o[c])?u=o[c]:(u=n++,o[c]=u),this._id=u}var n=0,o={};return t(r.prototype,{text:{get:function(){return this._text}},imageUrl:{get:function(){return this._imageUrl}},link:{get:function(){return this._link}},id:{get:function(){return this._id}}}),r.prototype.hasImage=function(){return this._hasImage},r.prototype.hasLink=function(){return this._hasLink},r.equals=function(t,i){return t===i||e(t)&&e(i)&&t._id===i._id},r.prototype.equals=function(e){return r.equals(this,e)},r}),i("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),i("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),i("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var i;for(this.mti==this.N+1&&this.init_genrand(5489),i=0;i>>1^t[1&e];for(;i>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),i("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r){"use strict";var n={};n.EPSILON1=.1,n.EPSILON2=.01,n.EPSILON3=.001,n.EPSILON4=1e-4,n.EPSILON5=1e-5,n.EPSILON6=1e-6,n.EPSILON7=1e-7,n.EPSILON8=1e-8,n.EPSILON9=1e-9,n.EPSILON10=1e-10,n.EPSILON11=1e-11,n.EPSILON12=1e-12,n.EPSILON13=1e-13,n.EPSILON14=1e-14,n.EPSILON15=1e-15,n.EPSILON16=1e-16,n.EPSILON17=1e-17,n.EPSILON18=1e-18,n.EPSILON19=1e-19,n.EPSILON20=1e-20,n.GRAVITATIONALPARAMETER=3986004418e5,n.SOLAR_RADIUS=6955e5,n.LUNAR_RADIUS=1737400,n.SIXTY_FOUR_KILOBYTES=65536,n.sign=function(e){return e>0?1:0>e?-1:0},n.signNotZero=function(e){return 0>e?-1:1},n.toSNorm=function(e){return Math.round(255*(.5*n.clamp(e,-1,1)+.5))},n.fromSNorm=function(e){return n.clamp(e,0,255)/255*2-1},n.sinh=function(e){var t=Math.pow(Math.E,e),i=Math.pow(Math.E,-1*e);return.5*(t-i)},n.cosh=function(e){var t=Math.pow(Math.E,e),i=Math.pow(Math.E,-1*e);return.5*(t+i)},n.lerp=function(e,t,i){return(1-i)*e+i*t},n.PI=Math.PI,n.ONE_OVER_PI=1/Math.PI,n.PI_OVER_TWO=.5*Math.PI,n.PI_OVER_THREE=Math.PI/3,n.PI_OVER_FOUR=Math.PI/4,n.PI_OVER_SIX=Math.PI/6,n.THREE_PI_OVER_TWO=3*Math.PI*.5,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(e){return e*n.RADIANS_PER_DEGREE},n.toDegrees=function(e){return e*n.DEGREES_PER_RADIAN},n.convertLongitudeRange=function(e){var t=n.TWO_PI,i=e-Math.floor(e/t)*t;return i<-Math.PI?i+t:i>=Math.PI?i-t:i},n.negativePiToPi=function(e){return n.zeroToTwoPi(e+n.PI)-n.PI},n.zeroToTwoPi=function(e){var t=n.mod(e,n.TWO_PI);return Math.abs(t)n.EPSILON14?n.TWO_PI:t},n.mod=function(e,t){return(e%t+t)%t},n.equalsEpsilon=function(e,i,r,n){n=t(n,r);var o=Math.abs(e-i);return n>=o||o<=r*Math.max(Math.abs(e),Math.abs(i))};var o=[1];n.factorial=function(e){var t=o.length;if(e>=t)for(var i=o[t-1],r=t;e>=r;r++)o.push(i*r);return o[e]},n.incrementWrap=function(e,i,r){return r=t(r,0),++e,e>i&&(e=r),e},n.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},n.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},n.clamp=function(e,t,i){return t>e?t:e>i?i:e};var a=new e;return n.setRandomNumberSeed=function(t){a=new e(t)},n.nextRandomNumber=function(){return a.random()},n.acosClamped=function(e){return Math.acos(n.clamp(e,-1,1))},n.asinClamped=function(e){return Math.asin(n.clamp(e,-1,1))},n.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},n.logBase=function(e,t){return Math.log(e)/Math.log(t)},n.fog=function(e,t){var i=e*t;return 1-Math.exp(-(i*i))},n}),i("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n){"use strict";function o(t,i,r){this.x=e(t,0),this.y=e(i,0),this.z=e(r,0)}o.fromSpherical=function(i,r){t(r)||(r=new o);var n=i.clock,a=i.cone,s=e(i.magnitude,1),l=s*Math.sin(a);return r.x=l*Math.cos(n),r.y=l*Math.sin(n),r.z=s*Math.cos(a),r},o.fromElements=function(e,i,r,n){return t(n)?(n.x=e,n.y=i,n.z=r,n):new o(e,i,r)},o.clone=function(e,i){return t(e)?t(i)?(i.x=e.x,i.y=e.y,i.z=e.z,i):new o(e.x,e.y,e.z):void 0},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,i,r){r=e(r,0),i[r++]=t.x,i[r++]=t.y,i[r]=t.z},o.unpack=function(i,r,n){return r=e(r,0),t(n)||(n=new o),n.x=i[r++],n.y=i[r++],n.z=i[r],n},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,i){return i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i.z=Math.min(e.z,t.z),i},o.maximumByComponent=function(e,t,i){return i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i.z=Math.max(e.z,t.z),i},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var a=new o;o.distance=function(e,t){return o.subtract(e,t,a),o.magnitude(a)},o.distanceSquared=function(e,t){return o.subtract(e,t,a),o.magnitudeSquared(a)},o.normalize=function(e,t){var i=o.magnitude(e);return t.x=e.x/i,t.y=e.y/i,t.z=e.z/i,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,i){return i.x=e.x*t.x,i.y=e.y*t.y,i.z=e.z*t.z,i},o.add=function(e,t,i){return i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i},o.subtract=function(e,t,i){return i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i},o.multiplyByScalar=function(e,t,i){return i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i},o.divideByScalar=function(e,t,i){return i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,i,r){return o.multiplyByScalar(t,i,s),r=o.multiplyByScalar(e,1-i,r),o.add(s,r,r)};var l=new o,u=new o;o.angleBetween=function(e,t){o.normalize(e,l),o.normalize(t,u);var i=o.dot(l,u),r=o.magnitude(o.cross(l,u,l));return Math.atan2(r,i)};var c=new o;o.mostOrthogonalAxis=function(e,t){var i=o.normalize(e,c);return o.abs(i,i),t=i.x<=i.y?i.x<=i.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):i.y<=i.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,i){return e===i||t(e)&&t(i)&&e.x===i.x&&e.y===i.y&&e.z===i.z},o.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]&&e.z===t[i+2]},o.equalsEpsilon=function(e,i,r,o){return e===i||t(e)&&t(i)&&n.equalsEpsilon(e.x,i.x,r,o)&&n.equalsEpsilon(e.y,i.y,r,o)&&n.equalsEpsilon(e.z,i.z,r,o)},o.cross=function(e,t,i){var r=e.x,n=e.y,o=e.z,a=t.x,s=t.y,l=t.z,u=n*l-o*s,c=o*a-r*l,h=r*s-n*a;return i.x=u,i.y=c,i.z=h,i},o.fromDegrees=function(e,t,i,r,a){var s=n.toRadians(e),l=n.toRadians(t);return o.fromRadians(s,l,i,r,a)};var h=new o,d=new o,p=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(i,r,n,a,s){n=e(n,0);var l=t(a)?a.radiiSquared:p,u=Math.cos(r);h.x=u*Math.cos(i),h.y=u*Math.sin(i),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(l,h,d);var c=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,c,d),h=o.multiplyByScalar(h,n,h),t(s)||(s=new o),o.add(d,h,s)},o.fromDegreesArray=function(e,t,i){for(var r=new Array(e.length),a=0;aa;a+=2){var s=e[a],l=e[a+1];r[a/2]=o.fromRadians(s,l,0,i,r[a/2])}return r},o.fromDegreesArrayHeights=function(e,t,i){for(var r=new Array(e.length),a=0;aa;a+=3){var s=e[a],l=e[a+1],u=e[a+2];r[a/3]=o.fromRadians(s,l,u,i,r[a/3])}return r},o.ZERO=r(new o(0,0,0)),o.UNIT_X=r(new o(1,0,0)),o.UNIT_Y=r(new o(0,1,0)),o.UNIT_Z=r(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,i){return o.equalsEpsilon(this,e,t,i)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),i("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,i,r){"use strict";function n(i,n,s,l,u){var c=i.x,h=i.y,d=i.z,p=n.x,m=n.y,f=n.z,v=c*c*p*p,g=h*h*m*m,_=d*d*f*f,y=v+g+_,C=Math.sqrt(1/y),E=e.multiplyByScalar(i,C,o);if(l>y)return isFinite(C)?e.clone(E,u):void 0;var S=s.x,w=s.y,T=s.z,x=a;x.x=E.x*S*2,x.y=E.y*w*2,x.z=E.z*T*2;var b,A,P,I,M,D,R,O,N,L,F,B=(1-C)*e.magnitude(i)/(.5*e.magnitude(x)),V=0;do{B-=V,P=1/(1+B*S),I=1/(1+B*w),M=1/(1+B*T),D=P*P,R=I*I,O=M*M,N=D*P,L=R*I,F=O*M,b=v*D+g*R+_*O-1,A=v*N*S+g*L*w+_*F*T;var k=-2*A;V=b/k}while(Math.abs(b)>r.EPSILON12);return t(u)?(u.x=c*P,u.y=h*I,u.z=d*M,u):new e(c*P,h*I,d*M)}var o=new e,a=new e;return n}),i("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,i,r,n,o,a){"use strict";function s(e,i,r){this.longitude=t(e,0),this.latitude=t(i,0),this.height=t(r,0)}s.fromRadians=function(e,r,n,o){return n=t(n,0),i(o)?(o.longitude=e,o.latitude=r,o.height=n,o):new s(e,r,n)},s.fromDegrees=function(e,t,i,r){return e=o.toRadians(e),t=o.toRadians(t),s.fromRadians(e,t,i,r)};var l=new e,u=new e,c=new e,h=new e(1/6378137,1/6378137,1/6356752.314245179),d=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),p=o.EPSILON1;return s.fromCartesian=function(t,r,n){var m=i(r)?r.oneOverRadii:h,f=i(r)?r.oneOverRadiiSquared:d,v=i(r)?r._centerToleranceSquared:p,g=a(t,m,f,v,u);if(i(g)){var _=e.multiplyComponents(t,f,l);_=e.normalize(_,_);var y=e.subtract(t,g,c),C=Math.atan2(_.y,_.x),E=Math.asin(_.z),S=o.sign(e.dot(y,t))*e.magnitude(y);return i(n)?(n.longitude=C,n.latitude=E,n.height=S,n):new s(C,E,S)}},s.clone=function(e,t){return i(e)?i(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new s(e.longitude,e.latitude,e.height):void 0},s.equals=function(e,t){return e===t||i(e)&&i(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},s.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},s.ZERO=n(new s(0,0,0)),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},s}),i("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,r,n,o){r=i(r,0),n=i(n,0),o=i(o,0),t._radii=new e(r,n,o),t._radiiSquared=new e(r*r,n*n,o*o),t._radiiToTheFourth=new e(r*r*r*r,n*n*n*n,o*o*o*o),t._oneOverRadii=new e(0===r?0:1/r,0===n?0:1/n,0===o?0:1/o),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===n?0:1/(n*n),0===o?0:1/(o*o)),t._minimumRadius=Math.min(r,n,o),t._maximumRadius=Math.max(r,n,o),t._centerToleranceSquared=s.EPSILON1}function c(e,t,i){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,u(this,e,t,i)}n(c.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),c.clone=function(t,i){if(r(t)){var n=t._radii;return r(i)?(e.clone(n,i._radii),e.clone(t._radiiSquared,i._radiiSquared),e.clone(t._radiiToTheFourth,i._radiiToTheFourth),e.clone(t._oneOverRadii,i._oneOverRadii),e.clone(t._oneOverRadiiSquared,i._oneOverRadiiSquared),i._minimumRadius=t._minimumRadius,i._maximumRadius=t._maximumRadius,i._centerToleranceSquared=t._centerToleranceSquared,i):new c(n.x,n.y,n.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(u(t,e.x,e.y,e.z),t):t},c.WGS84=a(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=a(new c(1,1,1)),c.MOON=a(new c(s.LUNAR_RADIUS,s.LUNAR_RADIUS,s.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,n){n=i(n,0),e.pack(t._radii,r,n)},c.unpack=function(t,r,n){r=i(r,0);var o=e.unpack(t,r);return c.fromCartesian3(o,n)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,i){var n=t.longitude,o=t.latitude,a=Math.cos(o),s=a*Math.cos(n),l=a*Math.sin(n),u=Math.sin(o);return r(i)||(i=new e),i.x=s,i.y=l,i.z=u,e.normalize(i,i)},c.prototype.geodeticSurfaceNormal=function(t,i){return r(i)||(i=new e),i=e.multiplyComponents(t,this._oneOverRadiiSquared,i),e.normalize(i,i)};var h=new e,d=new e;c.prototype.cartographicToCartesian=function(t,i){var n=h,o=d;this.geodeticSurfaceNormalCartographic(t,n),e.multiplyComponents(this._radiiSquared,n,o);var a=Math.sqrt(e.dot(n,o));return e.divideByScalar(o,a,o),e.multiplyByScalar(n,t.height,n),r(i)||(i=new e),e.add(o,n,i)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var i=e.length;r(t)?t.length=i:t=new Array(i);for(var n=0;i>n;n++)t[n]=this.cartographicToCartesian(e[n],t[n]);return t};var p=new e,m=new e,f=new e;return c.prototype.cartesianToCartographic=function(i,n){var o=this.scaleToGeodeticSurface(i,m);if(r(o)){var a=this.geodeticSurfaceNormal(o,p),l=e.subtract(i,o,f),u=Math.atan2(a.y,a.x),c=Math.asin(a.z),h=s.sign(e.dot(l,i))*e.magnitude(l);return r(n)?(n.longitude=u,n.latitude=c,n.height=h,n):new t(u,c,h)}},c.prototype.cartesianArrayToCartographicArray=function(e,t){var i=e.length;r(t)?t.length=i:t=new Array(i);for(var n=0;i>n;++n)t[n]=this.cartesianToCartographic(e[n],t[n]);return t},c.prototype.scaleToGeodeticSurface=function(e,t){return l(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},c.prototype.scaleToGeocentricSurface=function(t,i){r(i)||(i=new e);var n=t.x,o=t.y,a=t.z,s=this._oneOverRadiiSquared,l=1/Math.sqrt(n*n*s.x+o*o*s.y+a*a*s.z);return e.multiplyByScalar(t,l,i)},c.prototype.transformPositionToScaledSpace=function(t,i){return r(i)||(i=new e),e.multiplyComponents(t,this._oneOverRadii,i)},c.prototype.transformPositionFromScaledSpace=function(t,i){return r(i)||(i=new e),e.multiplyComponents(t,this._radii,i)},c.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c}),i("Core/Event",["./defined","./defineProperties","./DeveloperError"],function(e,t,i){"use strict";function r(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}return t(r.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),r.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);var i=this;return function(){i.removeEventListener(e,t)}},r.prototype.removeEventListener=function(e,t){for(var i=this._listeners,r=this._scopes,n=-1,o=0;ot;t++){var o=i[t];e(o)&&i[t].apply(r[t],arguments)}var a=this._toRemove;for(n=a.length,t=0;n>t;t++){var s=a[t];i.splice(s,1),r.splice(s,1)}a.length=0,this._insideRaiseEvent=!1},r}),i("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n){"use strict";function o(t,i){this.x=e(t,0),this.y=e(i,0)}o.fromElements=function(e,i,r){return t(r)?(r.x=e,r.y=i,r):new o(e,i)},o.clone=function(e,i){return t(e)?t(i)?(i.x=e.x,i.y=e.y,i):new o(e.x,e.y):void 0},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(t,i,r){r=e(r,0),i[r++]=t.x,i[r]=t.y},o.unpack=function(i,r,n){return r=e(r,0),t(n)||(n=new o),n.x=i[r++],n.y=i[r],n},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,i){return i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i},o.maximumByComponent=function(e,t,i){return i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var a=new o;o.distance=function(e,t){return o.subtract(e,t,a),o.magnitude(a)},o.distanceSquared=function(e,t){return o.subtract(e,t,a),o.magnitudeSquared(a)},o.normalize=function(e,t){var i=o.magnitude(e);return t.x=e.x/i,t.y=e.y/i,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,i){return i.x=e.x*t.x,i.y=e.y*t.y,i},o.add=function(e,t,i){return i.x=e.x+t.x,i.y=e.y+t.y,i},o.subtract=function(e,t,i){return i.x=e.x-t.x,i.y=e.y-t.y,i},o.multiplyByScalar=function(e,t,i){return i.x=e.x*t,i.y=e.y*t,i},o.divideByScalar=function(e,t,i){return i.x=e.x/t,i.y=e.y/t,i},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,i,r){return o.multiplyByScalar(t,i,s),r=o.multiplyByScalar(e,1-i,r),o.add(s,r,r)};var l=new o,u=new o;o.angleBetween=function(e,t){return o.normalize(e,l),o.normalize(t,u),n.acosClamped(o.dot(l,u))};var c=new o;return o.mostOrthogonalAxis=function(e,t){var i=o.normalize(e,c);return o.abs(i,i),t=i.x<=i.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,i){return e===i||t(e)&&t(i)&&e.x===i.x&&e.y===i.y},o.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]},o.equalsEpsilon=function(e,i,r,o){return e===i||t(e)&&t(i)&&n.equalsEpsilon(e.x,i.x,r,o)&&n.equalsEpsilon(e.y,i.y,r,o)},o.ZERO=r(new o(0,0)),o.UNIT_X=r(new o(1,0)),o.UNIT_Y=r(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,i){return o.equalsEpsilon(this,e,t,i)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),i("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,i,r,n,o,a){"use strict";function s(e){this._ellipsoid=i(e,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return n(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.prototype.project=function(t,i){var n=this._semimajorAxis,o=t.longitude*n,a=t.latitude*n,s=t.height;return r(i)?(i.x=o,i.y=a,i.z=s,i):new e(o,a,s)},s.prototype.unproject=function(e,i){var n=this._oneOverSemimajorAxis,o=e.x*n,a=e.y*n,s=e.z;return r(i)?(i.longitude=o,i.latitude=a,i.height=s,i):new t(o,a,s)},s}),i("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,i,r,n){this.west=t(e,0),this.south=t(i,0),this.east=t(r,0),this.north=t(n,0)}r(l.prototype,{width:{get:function(){return l.computeWidth(this)}},height:{get:function(){return l.computeHeight(this)}}}),l.packedLength=4,l.pack=function(e,i,r){r=t(r,0),i[r++]=e.west,i[r++]=e.south,i[r++]=e.east,i[r]=e.north},l.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new l),n.west=e[r++],n.south=e[r++],n.east=e[r++],n.north=e[r],n},l.computeWidth=function(e){var t=e.east,i=e.west;return i>t&&(t+=s.TWO_PI),t-i},l.computeHeight=function(e){return e.north-e.south},l.fromDegrees=function(e,r,n,o,a){return e=s.toRadians(t(e,0)),r=s.toRadians(t(r,0)),n=s.toRadians(t(n,0)),o=s.toRadians(t(o,0)),i(a)?(a.west=e,a.south=r,a.east=n,a.north=o,a):new l(e,r,n,o)},l.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,n=-Number.MAX_VALUE,o=Number.MAX_VALUE,a=-Number.MAX_VALUE,u=Number.MAX_VALUE,c=-Number.MAX_VALUE,h=0,d=e.length;d>h;h++){var p=e[h];r=Math.min(r,p.longitude),n=Math.max(n,p.longitude),u=Math.min(u,p.latitude),c=Math.max(c,p.latitude);var m=p.longitude>=0?p.longitude:p.longitude+s.TWO_PI;o=Math.min(o,m),a=Math.max(a,m)}return n-r>a-o&&(r=o,n=a,n>s.PI&&(n-=s.TWO_PI),r>s.PI&&(r-=s.TWO_PI)),i(t)?(t.west=r,t.south=u,t.east=n,t.north=c,t):new l(r,u,n,c)},l.clone=function(e,t){return i(e)?i(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new l(e.west,e.south,e.east,e.north):void 0},l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equals=function(e,t){return e===t||i(e)&&i(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},l.prototype.equalsEpsilon=function(e,t){return i(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},l.validate=function(e){},l.southwest=function(t,r){return i(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},l.northwest=function(t,r){return i(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},l.northeast=function(t,r){return i(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},l.southeast=function(t,r){return i(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},l.center=function(t,r){var n=t.east,o=t.west;o>n&&(n+=s.TWO_PI);var a=s.negativePiToPi(.5*(o+n)),l=.5*(t.south+t.north);return i(r)?(r.longitude=a,r.latitude=l,r.height=0,r):new e(a,l)},l.intersection=function(e,t,r){var n=e.east,o=e.west,a=t.east,u=t.west;o>n&&a>0?n+=s.TWO_PI:u>a&&n>0&&(a+=s.TWO_PI),o>n&&0>u?u+=s.TWO_PI:u>a&&0>o&&(o+=s.TWO_PI);var c=s.negativePiToPi(Math.max(o,u)),h=s.negativePiToPi(Math.min(n,a));if(!((e.west=h)){var d=Math.max(e.south,t.south),p=Math.min(e.north,t.north);if(!(d>=p))return i(r)?(r.west=c,r.south=d,r.east=h,r.north=p,r):new l(c,d,h,p)}},l.union=function(e,t,r){return i(r)||(r=new l),r.west=Math.min(e.west,t.west),r.south=Math.min(e.south,t.south),r.east=Math.max(e.east,t.east),r.north=Math.max(e.north,t.north),r},l.expand=function(e,t,r){return i(r)||(r=new l),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},l.contains=function(e,t){var i=t.longitude,r=t.latitude,n=e.west,o=e.east;return n>o&&(o+=s.TWO_PI,0>i&&(i+=s.TWO_PI)),(i>n||s.equalsEpsilon(i,n,s.EPSILON14))&&(o>i||s.equalsEpsilon(i,o,s.EPSILON14))&&r>=e.south&&r<=e.north};var u=new e;return l.subsample=function(e,r,n,a){r=t(r,o.WGS84),n=t(n,0),i(a)||(a=[]);var c=0,h=e.north,d=e.south,p=e.east,m=e.west,f=u;f.height=n,f.longitude=m,f.latitude=h,a[c]=r.cartographicToCartesian(f,a[c]),c++,f.longitude=p,a[c]=r.cartographicToCartesian(f,a[c]),c++,f.latitude=d,a[c]=r.cartographicToCartesian(f,a[c]),c++,f.longitude=m,a[c]=r.cartographicToCartesian(f,a[c]),c++,0>h?f.latitude=h:d>0?f.latitude=d:f.latitude=0;for(var v=1;8>v;++v)f.longitude=-Math.PI+v*s.PI_OVER_TWO,l.contains(e,f)&&(a[c]=r.cartographicToCartesian(f,a[c]),c++);return 0===f.latitude&&(f.longitude=m,a[c]=r.cartographicToCartesian(f,a[c]),c++,f.longitude=p,a[c]=r.cartographicToCartesian(f,a[c]),c++),a.length=c,a},l.MAX_VALUE=a(new l(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),l}),i("Core/GeographicTilingScheme",["./Cartesian2","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./GeographicProjection","./Math","./Rectangle"],function(e,t,i,r,n,o,a,s,l){ -"use strict";function u(e){e=t(e,{}),this._ellipsoid=t(e.ellipsoid,o.WGS84),this._rectangle=t(e.rectangle,l.MAX_VALUE),this._projection=new a(this._ellipsoid),this._numberOfLevelZeroTilesX=t(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=t(e.numberOfLevelZeroTilesY,1)}return r(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),u.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<=a&&(p=a-1);var m=(o.north-t.latitude)/h|0;return m>=u&&(m=u-1),i(n)?(n.x=p,n.y=m,n):new e(p,m)}},u}),i("Core/getImagePixels",["./defined"],function(e){"use strict";function t(t,r,n){e(r)||(r=t.width),e(n)||(n=t.height);var o=i[r];e(o)||(o={},i[r]=o);var a=o[n];if(!e(a)){var s=document.createElement("canvas");s.width=r,s.height=n,a=s.getContext("2d"),a.globalCompositeOperation="copy",o[n]=a}return a.drawImage(t,0,0,r,n),a.getImageData(0,0,r,n).data}var i={};return t}),i("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),i("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,i,r,n){"use strict";function o(r,n,o){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(n,e.ZERO)),i(o)?o=e.clone(o):(o=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(o,.5,o)),this.center=o}o.fromPoints=function(t,r){if(i(r)||(r=new o),!i(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var n=t[0].x,a=t[0].y,s=t[0].z,l=t[0].x,u=t[0].y,c=t[0].z,h=t.length,d=1;h>d;d++){var p=t[d],m=p.x,f=p.y,v=p.z;n=Math.min(m,n),l=Math.max(m,l),a=Math.min(f,a),u=Math.max(f,u),s=Math.min(v,s),c=Math.max(v,c)}var g=r.minimum;g.x=n,g.y=a,g.z=s;var _=r.maximum;_.x=l,_.y=u,_.z=c;var y=e.add(g,_,r.center);return e.multiplyByScalar(y,.5,y),r},o.clone=function(t,r){return i(t)?i(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new o(t.minimum,t.maximum):void 0},o.equals=function(t,r){return t===r||i(t)&&i(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var a=new e;return o.intersectPlane=function(t,i){a=e.subtract(t.maximum,t.minimum,a);var r=e.multiplyByScalar(a,.5,a),o=i.normal,s=r.x*Math.abs(o.x)+r.y*Math.abs(o.y)+r.z*Math.abs(o.z),l=e.dot(t.center,o)+i.distance;return l-s>0?n.INSIDE:0>l+s?n.OUTSIDE:n.INTERSECTING},o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.intersectPlane=function(e){return o.intersectPlane(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o}),i("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,i){this.start=e(t,0),this.stop=e(i,0)}return t}),i("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n,o){"use strict";function a(e,i,r,n,o,a,s,l,u){this[0]=t(e,0),this[1]=t(n,0),this[2]=t(s,0),this[3]=t(i,0),this[4]=t(o,0),this[5]=t(l,0),this[6]=t(r,0),this[7]=t(a,0),this[8]=t(u,0)}function s(e){for(var t=0,i=0;9>i;++i){var r=e[i];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,i=0;3>i;++i){var r=e[a.getElementIndex(p[i],d[i])];t+=2*r*r}return Math.sqrt(t)}function u(e,t){for(var i=o.EPSILON15,r=0,n=1,s=0;3>s;++s){var l=Math.abs(e[a.getElementIndex(p[s],d[s])]);l>r&&(n=s,r=l)}var u=1,c=0,h=d[n],m=p[n];if(Math.abs(e[a.getElementIndex(m,h)])>i){var f,v=e[a.getElementIndex(m,m)],g=e[a.getElementIndex(h,h)],_=e[a.getElementIndex(m,h)],y=(v-g)/2/_;f=0>y?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),u=1/Math.sqrt(1+f*f),c=f*u}return t=a.clone(a.IDENTITY,t),t[a.getElementIndex(h,h)]=t[a.getElementIndex(m,m)]=u,t[a.getElementIndex(m,h)]=c,t[a.getElementIndex(h,m)]=-c,t}a.packedLength=9,a.pack=function(e,i,r){r=t(r,0),i[r++]=e[0],i[r++]=e[1],i[r++]=e[2],i[r++]=e[3],i[r++]=e[4],i[r++]=e[5],i[r++]=e[6],i[r++]=e[7],i[r++]=e[8]},a.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new a),n[0]=e[r++],n[1]=e[r++],n[2]=e[r++],n[3]=e[r++],n[4]=e[r++],n[5]=e[r++],n[6]=e[r++],n[7]=e[r++],n[8]=e[r++],n},a.clone=function(e,t){return i(e)?i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new a(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},a.fromArray=function(e,r,n){return r=t(r,0),i(n)||(n=new a),n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],n[8]=e[r+8],n},a.fromColumnMajorArray=function(e,t){return a.clone(e,t)},a.fromRowMajorArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new a(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},a.fromQuaternion=function(e,t){var r=e.x*e.x,n=e.x*e.y,o=e.x*e.z,s=e.x*e.w,l=e.y*e.y,u=e.y*e.z,c=e.y*e.w,h=e.z*e.z,d=e.z*e.w,p=e.w*e.w,m=r-l-h+p,f=2*(n-d),v=2*(o+c),g=2*(n+d),_=-r+l-h+p,y=2*(u-s),C=2*(o-c),E=2*(u+s),S=-r-l+h+p;return i(t)?(t[0]=m,t[1]=g,t[2]=C,t[3]=f,t[4]=_,t[5]=E,t[6]=v,t[7]=y,t[8]=S,t):new a(m,f,v,g,_,y,C,E,S)},a.fromScale=function(e,t){return i(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new a(e.x,0,0,0,e.y,0,0,0,e.z)},a.fromUniformScale=function(e,t){return i(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new a(e,0,0,0,e,0,0,0,e)},a.fromCrossProduct=function(e,t){return i(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new a(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},a.fromRotationX=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=n,t[6]=0,t[7]=-n,t[8]=r,t):new a(1,0,0,0,r,-n,0,n,r)},a.fromRotationY=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=1,t[5]=0,t[6]=n,t[7]=0,t[8]=r,t):new a(r,0,n,0,1,0,-n,0,r)},a.fromRotationZ=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new a(r,-n,0,n,r,0,0,0,1)},a.toArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},a.getElementIndex=function(e,t){return 3*e+t},a.getColumn=function(e,t,i){var r=3*t,n=e[r],o=e[r+1],a=e[r+2];return i.x=n,i.y=o,i.z=a,i},a.setColumn=function(e,t,i,r){r=a.clone(e,r);var n=3*t;return r[n]=i.x,r[n+1]=i.y,r[n+2]=i.z,r},a.getRow=function(e,t,i){var r=e[t],n=e[t+3],o=e[t+6];return i.x=r,i.y=n,i.z=o,i},a.setRow=function(e,t,i,r){return r=a.clone(e,r),r[t]=i.x,r[t+3]=i.y,r[t+6]=i.z,r};var c=new e;a.getScale=function(t,i){return i.x=e.magnitude(e.fromElements(t[0],t[1],t[2],c)),i.y=e.magnitude(e.fromElements(t[3],t[4],t[5],c)),i.z=e.magnitude(e.fromElements(t[6],t[7],t[8],c)),i};var h=new e;a.getMaximumScale=function(t){return a.getScale(t,h),e.maximumComponent(h)},a.multiply=function(e,t,i){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],n=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],o=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],a=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],s=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],l=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],h=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return i[0]=r,i[1]=n,i[2]=o,i[3]=a,i[4]=s,i[5]=l,i[6]=u,i[7]=c,i[8]=h,i},a.add=function(e,t,i){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i[4]=e[4]+t[4],i[5]=e[5]+t[5],i[6]=e[6]+t[6],i[7]=e[7]+t[7],i[8]=e[8]+t[8],i},a.subtract=function(e,t,i){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i[4]=e[4]-t[4],i[5]=e[5]-t[5],i[6]=e[6]-t[6],i[7]=e[7]-t[7],i[8]=e[8]-t[8],i},a.multiplyByVector=function(e,t,i){var r=t.x,n=t.y,o=t.z,a=e[0]*r+e[3]*n+e[6]*o,s=e[1]*r+e[4]*n+e[7]*o,l=e[2]*r+e[5]*n+e[8]*o;return i.x=a,i.y=s,i.z=l,i},a.multiplyByScalar=function(e,t,i){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i[6]=e[6]*t,i[7]=e[7]*t,i[8]=e[8]*t,i},a.multiplyByScale=function(e,t,i){return i[0]=e[0]*t.x,i[1]=e[1]*t.x,i[2]=e[2]*t.x,i[3]=e[3]*t.y,i[4]=e[4]*t.y,i[5]=e[5]*t.y,i[6]=e[6]*t.z,i[7]=e[7]*t.z,i[8]=e[8]*t.z,i},a.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},a.transpose=function(e,t){var i=e[0],r=e[3],n=e[6],o=e[1],a=e[4],s=e[7],l=e[2],u=e[5],c=e[8];return t[0]=i,t[1]=r,t[2]=n,t[3]=o,t[4]=a,t[5]=s,t[6]=l,t[7]=u,t[8]=c,t};var d=[1,0,0],p=[2,2,1],m=new a,f=new a;return a.computeEigenDecomposition=function(e,t){var r=o.EPSILON20,n=10,c=0,h=0;i(t)||(t={});for(var d=t.unitary=a.clone(a.IDENTITY,t.unitary),p=t.diagonal=a.clone(e,t.diagonal),v=r*s(p);n>h&&l(p)>v;)u(p,m),a.transpose(m,f),a.multiply(p,m,p),a.multiply(f,p,p),a.multiply(d,m,d),++c>2&&(++h,c=0);return t},a.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},a.determinant=function(e){var t=e[0],i=e[3],r=e[6],n=e[1],o=e[4],a=e[7],s=e[2],l=e[5],u=e[8];return t*(o*u-l*a)+n*(l*r-i*u)+s*(i*a-o*r)},a.inverse=function(e,t){var i=e[0],n=e[1],s=e[2],l=e[3],u=e[4],c=e[5],h=e[6],d=e[7],p=e[8],m=a.determinant(e);if(Math.abs(m)<=o.EPSILON15)throw new r("matrix is not invertible");t[0]=u*p-d*c,t[1]=d*s-n*p,t[2]=n*c-u*s,t[3]=h*c-l*p,t[4]=i*p-h*s,t[5]=l*s-i*c,t[6]=l*d-h*u,t[7]=h*n-i*d,t[8]=i*u-l*n;var f=1/m;return a.multiplyByScalar(t,f,t)},a.equals=function(e,t){return e===t||i(e)&&i(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},a.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},a.IDENTITY=n(new a(1,0,0,0,1,0,0,0,1)),a.ZERO=n(new a(0,0,0,0,0,0,0,0,0)),a.COLUMN0ROW0=0,a.COLUMN0ROW1=1,a.COLUMN0ROW2=2,a.COLUMN1ROW0=3,a.COLUMN1ROW1=4,a.COLUMN1ROW2=5,a.COLUMN2ROW0=6,a.COLUMN2ROW1=7,a.COLUMN2ROW2=8,a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.equalsArray=function(e,t,i){return e[0]===t[i]&&e[1]===t[i+1]&&e[2]===t[i+2]&&e[3]===t[i+3]&&e[4]===t[i+4]&&e[5]===t[i+5]&&e[6]===t[i+6]&&e[7]===t[i+7]&&e[8]===t[i+8]},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},a}),i("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n){"use strict";function o(t,i,r,n){this.x=e(t,0),this.y=e(i,0),this.z=e(r,0),this.w=e(n,0)}o.fromElements=function(e,i,r,n,a){return t(a)?(a.x=e,a.y=i,a.z=r,a.w=n,a):new o(e,i,r,n)},o.fromColor=function(e,i){return t(i)?(i.x=e.red,i.y=e.green,i.z=e.blue,i.w=e.alpha,i):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,i){return t(e)?t(i)?(i.x=e.x,i.y=e.y,i.z=e.z,i.w=e.w,i):new o(e.x,e.y,e.z,e.w):void 0},o.packedLength=4,o.pack=function(t,i,r){r=e(r,0),i[r++]=t.x,i[r++]=t.y,i[r++]=t.z,i[r]=t.w},o.unpack=function(i,r,n){return r=e(r,0),t(n)||(n=new o),n.x=i[r++],n.y=i[r++],n.z=i[r++],n.w=i[r],n},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,i){return i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i.z=Math.min(e.z,t.z),i.w=Math.min(e.w,t.w),i},o.maximumByComponent=function(e,t,i){return i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i.z=Math.max(e.z,t.z),i.w=Math.max(e.w,t.w),i},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var a=new o;o.distance=function(e,t){return o.subtract(e,t,a),o.magnitude(a)},o.distanceSquared=function(e,t){return o.subtract(e,t,a),o.magnitudeSquared(a)},o.normalize=function(e,t){var i=o.magnitude(e);return t.x=e.x/i,t.y=e.y/i,t.z=e.z/i,t.w=e.w/i,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,i){return i.x=e.x*t.x,i.y=e.y*t.y,i.z=e.z*t.z,i.w=e.w*t.w,i},o.add=function(e,t,i){return i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i.w=e.w+t.w,i},o.subtract=function(e,t,i){return i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i.w=e.w-t.w,i},o.multiplyByScalar=function(e,t,i){return i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i.w=e.w*t,i},o.divideByScalar=function(e,t,i){return i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i.w=e.w/t,i},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,i,r){return o.multiplyByScalar(t,i,s),r=o.multiplyByScalar(e,1-i,r),o.add(s,r,r)};var l=new o;return o.mostOrthogonalAxis=function(e,t){var i=o.normalize(e,l);return o.abs(i,i),t=i.x<=i.y?i.x<=i.z?i.x<=i.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):i.z<=i.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):i.y<=i.z?i.y<=i.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):i.z<=i.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,i){return e===i||t(e)&&t(i)&&e.x===i.x&&e.y===i.y&&e.z===i.z&&e.w===i.w},o.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]&&e.z===t[i+2]&&e.w===t[i+3]},o.equalsEpsilon=function(e,i,r,o){return e===i||t(e)&&t(i)&&n.equalsEpsilon(e.x,i.x,r,o)&&n.equalsEpsilon(e.y,i.y,r,o)&&n.equalsEpsilon(e.z,i.z,r,o)&&n.equalsEpsilon(e.w,i.w,r,o)},o.ZERO=r(new o(0,0,0,0)),o.UNIT_X=r(new o(1,0,0,0)),o.UNIT_Y=r(new o(0,1,0,0)),o.UNIT_Z=r(new o(0,0,1,0)),o.UNIT_W=r(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,i){return o.equalsEpsilon(this,e,t,i)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),i("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(i){t=i.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),i("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e,t,r,n,o,a,s,l,u,c,h,d,p,m,f,v){this[0]=i(e,0),this[1]=i(o,0),this[2]=i(u,0),this[3]=i(p,0),this[4]=i(t,0),this[5]=i(a,0),this[6]=i(c,0),this[7]=i(m,0),this[8]=i(r,0),this[9]=i(s,0),this[10]=i(h,0),this[11]=i(f,0),this[12]=i(n,0),this[13]=i(l,0),this[14]=i(d,0),this[15]=i(v,0)}u.packedLength=16,u.pack=function(e,t,r){r=i(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15]},u.unpack=function(e,t,n){return t=i(t,0),r(n)||(n=new u),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},u.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new u(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15]):void 0},u.fromArray=u.unpack,u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},u.fromRotationTranslation=function(t,n,o){return n=i(n,e.ZERO),r(o)?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=0,o[4]=t[3],o[5]=t[4],o[6]=t[5],o[7]=0,o[8]=t[6],o[9]=t[7],o[10]=t[8],o[11]=0,o[12]=n.x,o[13]=n.y,o[14]=n.z,o[15]=1,o):new u(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},u.fromTranslationQuaternionRotationScale=function(e,t,i,n){r(n)||(n=new u);var o=i.x,a=i.y,s=i.z,l=t.x*t.x,c=t.x*t.y,h=t.x*t.z,d=t.x*t.w,p=t.y*t.y,m=t.y*t.z,f=t.y*t.w,v=t.z*t.z,g=t.z*t.w,_=t.w*t.w,y=l-p-v+_,C=2*(c-g),E=2*(h+f),S=2*(c+g),w=-l+p-v+_,T=2*(m-d),x=2*(h-f),b=2*(m+d),A=-l-p+v+_;return n[0]=y*o,n[1]=S*o,n[2]=x*o,n[3]=0,n[4]=C*a,n[5]=w*a,n[6]=b*a,n[7]=0,n[8]=E*s,n[9]=T*s,n[10]=A*s,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n},u.fromTranslationRotationScale=function(e,t){return u.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},u.fromTranslation=function(e,t){return u.fromRotationTranslation(s.IDENTITY,e,t)},u.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new u(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},u.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new u(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var c=new e,h=new e,d=new e;u.fromCamera=function(t,i){var n=t.eye,o=t.target,a=t.up;e.normalize(e.subtract(o,n,c),c),e.normalize(e.cross(c,a,h),h),e.normalize(e.cross(h,c,d),d);var s=h.x,l=h.y,p=h.z,m=c.x,f=c.y,v=c.z,g=d.x,_=d.y,y=d.z,C=n.x,E=n.y,S=n.z,w=s*-C+l*-E+p*-S,T=g*-C+_*-E+y*-S,x=m*C+f*E+v*S;return r(i)?(i[0]=s,i[1]=g,i[2]=-m,i[3]=0,i[4]=l,i[5]=_,i[6]=-f,i[7]=0,i[8]=p,i[9]=y,i[10]=-v,i[11]=0,i[12]=w,i[13]=T,i[14]=x,i[15]=1,i):new u(s,l,p,w,g,_,y,T,-m,-f,-v,x,0,0,0,1)},u.computePerspectiveFieldOfView=function(e,t,i,r,n){var o=Math.tan(.5*e),a=1/o,s=a/t,l=(r+i)/(i-r),u=2*r*i/(i-r);return n[0]=s,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=a,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=l,n[11]=-1,n[12]=0,n[13]=0,n[14]=u,n[15]=0,n},u.computeOrthographicOffCenter=function(e,t,i,r,n,o,a){var s=1/(t-e),l=1/(r-i),u=1/(o-n),c=-(t+e)*s,h=-(r+i)*l,d=-(o+n)*u;return s*=2,l*=2,u*=-2,a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=u,a[11]=0,a[12]=c,a[13]=h,a[14]=d,a[15]=1,a},u.computePerspectiveOffCenter=function(e,t,i,r,n,o,a){var s=2*n/(t-e),l=2*n/(r-i),u=(t+e)/(t-e),c=(r+i)/(r-i),h=-(o+n)/(o-n),d=-1,p=-2*o*n/(o-n);return a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=u,a[9]=c,a[10]=h,a[11]=d,a[12]=0,a[13]=0,a[14]=p,a[15]=0,a},u.computeInfinitePerspectiveOffCenter=function(e,t,i,r,n,o){var a=2*n/(t-e),s=2*n/(r-i),l=(t+e)/(t-e),u=(r+i)/(r-i),c=-1,h=-1,d=-2*n;return o[0]=a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=l,o[9]=u,o[10]=c,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},u.computeViewportTransformation=function(e,t,r,n){e=i(e,i.EMPTY_OBJECT);var o=i(e.x,0),a=i(e.y,0),s=i(e.width,0),l=i(e.height,0);t=i(t,0),r=i(r,1);var u=.5*s,c=.5*l,h=.5*(r-t),d=u,p=c,m=h,f=o+u,v=a+c,g=t+h,_=1;return n[0]=d,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=p,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=m,n[11]=0,n[12]=f,n[13]=v,n[14]=g,n[15]=_,n},u.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},u.getElementIndex=function(e,t){return 4*e+t},u.getColumn=function(e,t,i){var r=4*t,n=e[r],o=e[r+1],a=e[r+2],s=e[r+3];return i.x=n,i.y=o,i.z=a,i.w=s,i},u.setColumn=function(e,t,i,r){r=u.clone(e,r);var n=4*t;return r[n]=i.x,r[n+1]=i.y,r[n+2]=i.z,r[n+3]=i.w,r},u.setTranslation=function(e,t,i){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=e[15],i},u.getRow=function(e,t,i){var r=e[t],n=e[t+4],o=e[t+8],a=e[t+12];return i.x=r,i.y=n,i.z=o,i.w=a,i},u.setRow=function(e,t,i,r){return r=u.clone(e,r),r[t]=i.x,r[t+4]=i.y,r[t+8]=i.z,r[t+12]=i.w,r};var p=new e;u.getScale=function(t,i){return i.x=e.magnitude(e.fromElements(t[0],t[1],t[2],p)),i.y=e.magnitude(e.fromElements(t[4],t[5],t[6],p)),i.z=e.magnitude(e.fromElements(t[8],t[9],t[10],p)),i};var m=new e;u.getMaximumScale=function(t){return u.getScale(t,m),e.maximumComponent(m)},u.multiply=function(e,t,i){var r=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],d=e[9],p=e[10],m=e[11],f=e[12],v=e[13],g=e[14],_=e[15],y=t[0],C=t[1],E=t[2],S=t[3],w=t[4],T=t[5],x=t[6],b=t[7],A=t[8],P=t[9],I=t[10],M=t[11],D=t[12],R=t[13],O=t[14],N=t[15],L=r*y+s*C+h*E+f*S,F=n*y+l*C+d*E+v*S,B=o*y+u*C+p*E+g*S,V=a*y+c*C+m*E+_*S,k=r*w+s*T+h*x+f*b,z=n*w+l*T+d*x+v*b,U=o*w+u*T+p*x+g*b,G=a*w+c*T+m*x+_*b,W=r*A+s*P+h*I+f*M,H=n*A+l*P+d*I+v*M,q=o*A+u*P+p*I+g*M,j=a*A+c*P+m*I+_*M,Y=r*D+s*R+h*O+f*N,X=n*D+l*R+d*O+v*N,Z=o*D+u*R+p*O+g*N,K=a*D+c*R+m*O+_*N;return i[0]=L,i[1]=F,i[2]=B,i[3]=V,i[4]=k,i[5]=z,i[6]=U,i[7]=G,i[8]=W,i[9]=H,i[10]=q,i[11]=j,i[12]=Y,i[13]=X,i[14]=Z,i[15]=K,i},u.add=function(e,t,i){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i[4]=e[4]+t[4],i[5]=e[5]+t[5],i[6]=e[6]+t[6],i[7]=e[7]+t[7],i[8]=e[8]+t[8],i[9]=e[9]+t[9],i[10]=e[10]+t[10],i[11]=e[11]+t[11],i[12]=e[12]+t[12],i[13]=e[13]+t[13],i[14]=e[14]+t[14],i[15]=e[15]+t[15],i},u.subtract=function(e,t,i){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i[4]=e[4]-t[4],i[5]=e[5]-t[5],i[6]=e[6]-t[6],i[7]=e[7]-t[7],i[8]=e[8]-t[8],i[9]=e[9]-t[9],i[10]=e[10]-t[10],i[11]=e[11]-t[11],i[12]=e[12]-t[12],i[13]=e[13]-t[13],i[14]=e[14]-t[14],i[15]=e[15]-t[15],i},u.multiplyTransformation=function(e,t,i){var r=e[0],n=e[1],o=e[2],a=e[4],s=e[5],l=e[6],u=e[8],c=e[9],h=e[10],d=e[12],p=e[13],m=e[14],f=t[0],v=t[1],g=t[2],_=t[4],y=t[5],C=t[6],E=t[8],S=t[9],w=t[10],T=t[12],x=t[13],b=t[14],A=r*f+a*v+u*g,P=n*f+s*v+c*g,I=o*f+l*v+h*g,M=r*_+a*y+u*C,D=n*_+s*y+c*C,R=o*_+l*y+h*C,O=r*E+a*S+u*w,N=n*E+s*S+c*w,L=o*E+l*S+h*w,F=r*T+a*x+u*b+d,B=n*T+s*x+c*b+p,V=o*T+l*x+h*b+m;return i[0]=A,i[1]=P,i[2]=I,i[3]=0,i[4]=M,i[5]=D,i[6]=R,i[7]=0,i[8]=O,i[9]=N,i[10]=L,i[11]=0,i[12]=F,i[13]=B,i[14]=V,i[15]=1,i},u.multiplyByMatrix3=function(e,t,i){var r=e[0],n=e[1],o=e[2],a=e[4],s=e[5],l=e[6],u=e[8],c=e[9],h=e[10],d=t[0],p=t[1],m=t[2],f=t[3],v=t[4],g=t[5],_=t[6],y=t[7],C=t[8],E=r*d+a*p+u*m,S=n*d+s*p+c*m,w=o*d+l*p+h*m,T=r*f+a*v+u*g,x=n*f+s*v+c*g,b=o*f+l*v+h*g,A=r*_+a*y+u*C,P=n*_+s*y+c*C,I=o*_+l*y+h*C;return i[0]=E,i[1]=S,i[2]=w,i[3]=0,i[4]=T,i[5]=x,i[6]=b,i[7]=0,i[8]=A,i[9]=P,i[10]=I,i[11]=0,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},u.multiplyByTranslation=function(e,t,i){var r=t.x,n=t.y,o=t.z,a=r*e[0]+n*e[4]+o*e[8]+e[12],s=r*e[1]+n*e[5]+o*e[9]+e[13],l=r*e[2]+n*e[6]+o*e[10]+e[14];return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=a,i[13]=s,i[14]=l,i[15]=e[15],i};var f=new e;u.multiplyByUniformScale=function(e,t,i){return f.x=t,f.y=t,f.z=t,u.multiplyByScale(e,f,i)},u.multiplyByScale=function(e,t,i){var r=t.x,n=t.y,o=t.z;return 1===r&&1===n&&1===o?u.clone(e,i):(i[0]=r*e[0],i[1]=r*e[1],i[2]=r*e[2],i[3]=0,i[4]=n*e[4],i[5]=n*e[5],i[6]=n*e[6],i[7]=0,i[8]=o*e[8],i[9]=o*e[9],i[10]=o*e[10],i[11]=0,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=1,i)},u.multiplyByVector=function(e,t,i){var r=t.x,n=t.y,o=t.z,a=t.w,s=e[0]*r+e[4]*n+e[8]*o+e[12]*a,l=e[1]*r+e[5]*n+e[9]*o+e[13]*a,u=e[2]*r+e[6]*n+e[10]*o+e[14]*a,c=e[3]*r+e[7]*n+e[11]*o+e[15]*a;return i.x=s,i.y=l,i.z=u,i.w=c,i},u.multiplyByPointAsVector=function(e,t,i){var r=t.x,n=t.y,o=t.z,a=e[0]*r+e[4]*n+e[8]*o,s=e[1]*r+e[5]*n+e[9]*o,l=e[2]*r+e[6]*n+e[10]*o;return i.x=a,i.y=s,i.z=l,i},u.multiplyByPoint=function(e,t,i){var r=t.x,n=t.y,o=t.z,a=e[0]*r+e[4]*n+e[8]*o+e[12],s=e[1]*r+e[5]*n+e[9]*o+e[13],l=e[2]*r+e[6]*n+e[10]*o+e[14];return i.x=a,i.y=s,i.z=l,i},u.multiplyByScalar=function(e,t,i){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i[6]=e[6]*t,i[7]=e[7]*t,i[8]=e[8]*t,i[9]=e[9]*t,i[10]=e[10]*t,i[11]=e[11]*t,i[12]=e[12]*t,i[13]=e[13]*t,i[14]=e[14]*t,i[15]=e[15]*t,i},u.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},u.transpose=function(e,t){var i=e[1],r=e[2],n=e[3],o=e[6],a=e[7],s=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=i,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[10]=e[10],t[11]=e[14],t[12]=n,t[13]=a,t[14]=s,t[15]=e[15],t},u.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},u.equalsEpsilon=function(e,t,i){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i&&Math.abs(e[4]-t[4])<=i&&Math.abs(e[5]-t[5])<=i&&Math.abs(e[6]-t[6])<=i&&Math.abs(e[7]-t[7])<=i&&Math.abs(e[8]-t[8])<=i&&Math.abs(e[9]-t[9])<=i&&Math.abs(e[10]-t[10])<=i&&Math.abs(e[11]-t[11])<=i&&Math.abs(e[12]-t[12])<=i&&Math.abs(e[13]-t[13])<=i&&Math.abs(e[14]-t[14])<=i&&Math.abs(e[15]-t[15])<=i},u.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},u.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var v=new s,g=new s,_=new t,y=new t(0,0,0,1);return u.inverse=function(e,i){if(s.equalsEpsilon(u.getRotation(e,v),g,a.EPSILON7)&&t.equals(u.getRow(e,3,_),y))return i[0]=0,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=0,i[11]=0,i[12]=-e[12],i[13]=-e[13],i[14]=-e[14],i[15]=1,i;var r=e[0],n=e[4],o=e[8],c=e[12],h=e[1],d=e[5],p=e[9],m=e[13],f=e[2],C=e[6],E=e[10],S=e[14],w=e[3],T=e[7],x=e[11],b=e[15],A=E*b,P=S*x,I=C*b,M=S*T,D=C*x,R=E*T,O=f*b,N=S*w,L=f*x,F=E*w,B=f*T,V=C*w,k=A*d+M*p+D*m-(P*d+I*p+R*m),z=P*h+O*p+F*m-(A*h+N*p+L*m),U=I*h+N*d+B*m-(M*h+O*d+V*m),G=R*h+L*d+V*p-(D*h+F*d+B*p),W=P*n+I*o+R*c-(A*n+M*o+D*c),H=A*r+N*o+L*c-(P*r+O*o+F*c),q=M*r+O*n+V*c-(I*r+N*n+B*c),j=D*r+F*n+B*o-(R*r+L*n+V*o);A=o*m,P=c*p,I=n*m,M=c*d,D=n*p,R=o*d,O=r*m,N=c*h,L=r*p,F=o*h,B=r*d,V=n*h;var Y=A*T+M*x+D*b-(P*T+I*x+R*b),X=P*w+O*x+F*b-(A*w+N*x+L*b),Z=I*w+N*T+B*b-(M*w+O*T+V*b),K=R*w+L*T+V*x-(D*w+F*T+B*x),Q=I*E+R*S+P*C-(D*S+A*C+M*E),J=L*S+A*f+N*E-(O*E+F*S+P*f),$=O*C+V*S+M*f-(B*S+I*f+N*C),ee=B*E+D*f+F*C-(L*C+V*E+R*f),te=r*k+n*z+o*U+c*G;if(Math.abs(te)d;d++){e.clone(t[d],n);var b=n.x,A=n.y,P=n.z;bl.x&&e.clone(n,l),Au.y&&e.clone(n,u),Pc.z&&e.clone(n,c)}var I=e.magnitudeSquared(e.subtract(l,o,E)),M=e.magnitudeSquared(e.subtract(u,a,E)),D=e.magnitudeSquared(e.subtract(c,s,E)),R=o,O=l,N=I;M>N&&(N=M,R=a,O=u),D>N&&(N=D,R=s,O=c);var L=S;L.x=.5*(R.x+O.x),L.y=.5*(R.y+O.y),L.z=.5*(R.z+O.z);var F=e.magnitudeSquared(e.subtract(O,L,E)),B=Math.sqrt(F),V=w;V.x=o.x,V.y=a.y,V.z=s.z;var k=T;k.x=l.x,k.y=u.y,k.z=c.z;var z=e.multiplyByScalar(e.add(V,k,E),.5,x),U=0;for(d=0;h>d;d++){e.clone(t[d],n);var G=e.magnitude(e.subtract(n,z,E));G>U&&(U=G);var W=e.magnitudeSquared(e.subtract(n,L,E));if(W>F){var H=Math.sqrt(W);B=.5*(B+H),F=B*B;var q=H-B;L.x=(B*L.x+q*n.x)/H,L.y=(B*L.y+q*n.y)/H,L.z=(B*L.z+q*n.z)/H}}return U>B?(e.clone(L,i.center), -i.radius=B):(e.clone(z,i.center),i.radius=U),i};var b=new a,A=new e,P=new e,I=new t,M=new t;p.fromRectangle2D=function(e,t,i){return p.fromRectangleWithHeights2D(e,t,0,0,i)},p.fromRectangleWithHeights2D=function(t,n,o,a,s){if(r(s)||(s=new p),!r(t))return s.center=e.clone(e.ZERO,s.center),s.radius=0,s;n=i(n,b),d.southwest(t,I),I.height=o,d.northeast(t,M),M.height=a;var l=n.project(I,A),u=n.project(M,P),c=u.x-l.x,h=u.y-l.y,m=u.z-l.z;s.radius=.5*Math.sqrt(c*c+h*h+m*m);var f=s.center;return f.x=l.x+.5*c,f.y=l.y+.5*h,f.z=l.z+.5*m,s};var D=[];p.fromRectangle3D=function(e,t,n,a){t=i(t,o.WGS84),n=i(n,0);var s;return r(e)&&(s=d.subsample(e,t,n,D)),p.fromPoints(s,a)},p.fromVertices=function(t,n,o,a){if(r(a)||(a=new p),!r(t)||0===t.length)return a.center=e.clone(e.ZERO,a.center),a.radius=0,a;n=i(n,e.ZERO),o=i(o,3);var s=C;s.x=t[0]+n.x,s.y=t[1]+n.y,s.z=t[2]+n.z;for(var l=e.clone(s,m),u=e.clone(s,f),c=e.clone(s,v),h=e.clone(s,g),d=e.clone(s,_),b=e.clone(s,y),A=t.length,P=0;A>P;P+=o){var I=t[P]+n.x,M=t[P+1]+n.y,D=t[P+2]+n.z;s.x=I,s.y=M,s.z=D,Ih.x&&e.clone(s,h),Md.y&&e.clone(s,d),Db.z&&e.clone(s,b)}var R=e.magnitudeSquared(e.subtract(h,l,E)),O=e.magnitudeSquared(e.subtract(d,u,E)),N=e.magnitudeSquared(e.subtract(b,c,E)),L=l,F=h,B=R;O>B&&(B=O,L=u,F=d),N>B&&(B=N,L=c,F=b);var V=S;V.x=.5*(L.x+F.x),V.y=.5*(L.y+F.y),V.z=.5*(L.z+F.z);var k=e.magnitudeSquared(e.subtract(F,V,E)),z=Math.sqrt(k),U=w;U.x=l.x,U.y=u.y,U.z=c.z;var G=T;G.x=h.x,G.y=d.y,G.z=b.z;var W=e.multiplyByScalar(e.add(U,G,E),.5,x),H=0;for(P=0;A>P;P+=o){s.x=t[P]+n.x,s.y=t[P+1]+n.y,s.z=t[P+2]+n.z;var q=e.magnitude(e.subtract(s,W,E));q>H&&(H=q);var j=e.magnitudeSquared(e.subtract(s,V,E));if(j>k){var Y=Math.sqrt(j);z=.5*(z+Y),k=z*z;var X=Y-z;V.x=(z*V.x+X*s.x)/Y,V.y=(z*V.y+X*s.y)/Y,V.z=(z*V.z+X*s.z)/Y}}return H>z?(e.clone(V,a.center),a.radius=z):(e.clone(W,a.center),a.radius=H),a},p.fromEncodedCartesianVertices=function(t,i,n){if(r(n)||(n=new p),!r(t)||!r(i)||t.length!==i.length||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var o=C;o.x=t[0]+i[0],o.y=t[1]+i[1],o.z=t[2]+i[2];for(var a=e.clone(o,m),s=e.clone(o,f),l=e.clone(o,v),u=e.clone(o,g),c=e.clone(o,_),h=e.clone(o,y),d=t.length,b=0;d>b;b+=3){var A=t[b]+i[b],P=t[b+1]+i[b+1],I=t[b+2]+i[b+2];o.x=A,o.y=P,o.z=I,Au.x&&e.clone(o,u),Pc.y&&e.clone(o,c),Ih.z&&e.clone(o,h)}var M=e.magnitudeSquared(e.subtract(u,a,E)),D=e.magnitudeSquared(e.subtract(c,s,E)),R=e.magnitudeSquared(e.subtract(h,l,E)),O=a,N=u,L=M;D>L&&(L=D,O=s,N=c),R>L&&(L=R,O=l,N=h);var F=S;F.x=.5*(O.x+N.x),F.y=.5*(O.y+N.y),F.z=.5*(O.z+N.z);var B=e.magnitudeSquared(e.subtract(N,F,E)),V=Math.sqrt(B),k=w;k.x=a.x,k.y=s.y,k.z=l.z;var z=T;z.x=u.x,z.y=c.y,z.z=h.z;var U=e.multiplyByScalar(e.add(k,z,E),.5,x),G=0;for(b=0;d>b;b+=3){o.x=t[b]+i[b],o.y=t[b+1]+i[b+1],o.z=t[b+2]+i[b+2];var W=e.magnitude(e.subtract(o,U,E));W>G&&(G=W);var H=e.magnitudeSquared(e.subtract(o,F,E));if(H>B){var q=Math.sqrt(H);V=.5*(V+q),B=V*V;var j=q-V;F.x=(V*F.x+j*o.x)/q,F.y=(V*F.y+j*o.y)/q,F.z=(V*F.z+j*o.z)/q}}return G>V?(e.clone(F,n.center),n.radius=V):(e.clone(U,n.center),n.radius=G),n},p.fromCornerPoints=function(t,i,n){r(n)||(n=new p);var o=n.center;return e.add(t,i,o),e.multiplyByScalar(o,.5,o),n.radius=e.distance(o,i),n},p.fromEllipsoid=function(t,i){return r(i)||(i=new p),e.clone(e.ZERO,i.center),i.radius=t.maximumRadius,i};var R=new e;p.fromBoundingSpheres=function(t,i){if(r(i)||(i=new p),!r(t)||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;var n=t.length;if(1===n)return p.clone(t[0],i);if(2===n)return p.union(t[0],t[1],i);for(var o=[],a=0;n>a;a++)o.push(t[a].center);i=p.fromPoints(o,i);var s=i.center,l=i.radius;for(a=0;n>a;a++){var u=t[a];l=Math.max(l,e.distance(s,u.center,R)+u.radius)}return i.radius=l,i};var O=new e,N=new e,L=new e;p.fromOrientedBoundingBox=function(t,i){r(i)||(i=new p);var n=t.halfAxes,o=u.getColumn(n,0,O),a=u.getColumn(n,1,N),s=u.getColumn(n,2,L),l=e.magnitude(o),c=e.magnitude(a),h=e.magnitude(s);return i.center=e.clone(t.center,i.center),i.radius=Math.max(l,c,h),i},p.clone=function(t,i){return r(t)?r(i)?(i.center=e.clone(t.center,i.center),i.radius=t.radius,i):new p(t.center,t.radius):void 0},p.packedLength=4,p.pack=function(e,t,r){r=i(r,0);var n=e.center;t[r++]=n.x,t[r++]=n.y,t[r++]=n.z,t[r]=e.radius},p.unpack=function(e,t,n){t=i(t,0),r(n)||(n=new p);var o=n.center;return o.x=e[t++],o.y=e[t++],o.z=e[t++],n.radius=e[t],n};var F=new e,B=new e;p.union=function(t,i,n){r(n)||(n=new p);var o=t.center,a=t.radius,s=i.center,l=i.radius,u=e.subtract(s,o,F),c=e.magnitude(u);if(a>=c+l)return t.clone(n),n;if(l>=c+a)return i.clone(n),n;var h=.5*(a+c+l),d=e.multiplyByScalar(u,(-a+h)/c,B);return e.add(d,o,d),e.clone(d,n.center),n.radius=h,n};var V=new e;p.expand=function(t,i,r){r=p.clone(t,r);var n=e.magnitude(e.subtract(i,r.center,V));return n>r.radius&&(r.radius=n),r},p.intersectPlane=function(t,i){var r=t.center,n=t.radius,o=i.normal,a=e.dot(o,r)+i.distance;return-n>a?s.OUTSIDE:n>a?s.INTERSECTING:s.INSIDE},p.transform=function(e,t,i){return r(i)||(i=new p),i.center=c.multiplyByPoint(t,e.center,i.center),i.radius=c.getMaximumScale(t)*e.radius,i};var k=new e;p.distanceSquaredTo=function(t,i){var r=e.subtract(t.center,i,k);return e.magnitudeSquared(r)-t.radius*t.radius},p.transformWithoutScale=function(e,t,i){return r(i)||(i=new p),i.center=c.multiplyByPoint(t,e.center,i.center),i.radius=e.radius,i};var z=new e;p.computePlaneDistances=function(t,i,n,o){r(o)||(o=new l);var a=e.subtract(t.center,i,z),s=e.dot(n,a);return o.start=s-t.radius,o.stop=s+t.radius,o};for(var U=new e,G=new e,W=new e,H=new e,q=new e,j=new t,Y=new Array(8),X=0;8>X;++X)Y[X]=new e;var Z=new a;return p.projectTo2D=function(t,r,n){r=i(r,Z);var o=r.ellipsoid,a=t.center,s=t.radius,l=o.geodeticSurfaceNormal(a,U),u=e.cross(e.UNIT_Z,l,G);e.normalize(u,u);var c=e.cross(l,u,W);e.normalize(c,c),e.multiplyByScalar(l,s,l),e.multiplyByScalar(c,s,c),e.multiplyByScalar(u,s,u);var h=e.negate(c,q),d=e.negate(u,H),m=Y,f=m[0];e.add(l,c,f),e.add(f,u,f),f=m[1],e.add(l,c,f),e.add(f,d,f),f=m[2],e.add(l,h,f),e.add(f,d,f),f=m[3],e.add(l,h,f),e.add(f,u,f),e.negate(l,l),f=m[4],e.add(l,c,f),e.add(f,u,f),f=m[5],e.add(l,c,f),e.add(f,d,f),f=m[6],e.add(l,h,f),e.add(f,d,f),f=m[7],e.add(l,h,f),e.add(f,u,f);for(var v=m.length,g=0;v>g;++g){var _=m[g];e.add(a,_,_);var y=o.cartesianToCartographic(_,j);r.project(y,_)}n=p.fromPoints(m,n),a=n.center;var C=a.x,E=a.y,S=a.z;return a.x=S,a.y=C,a.z=E,n},p.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},p.equals=function(t,i){return t===i||r(t)&&r(i)&&e.equals(t.center,i.center)&&t.radius===i.radius},p.prototype.intersectPlane=function(e){return p.intersectPlane(this,e)},p.prototype.distanceSquaredTo=function(e){return p.distanceSquaredTo(this,e)},p.prototype.computePlaneDistances=function(e,t,i){return p.computePlaneDistances(this,e,t,i)},p.prototype.isOccluded=function(e){return p.isOccluded(this,e)},p.prototype.equals=function(e){return p.equals(this,e)},p.prototype.clone=function(e){return p.clone(this,e)},p}),i("Core/EllipsoidalOccluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Rectangle"],function(e,t,i,r,n,o,a){"use strict";function s(e,i){this._ellipsoid=e,this._cameraPosition=new t,this._cameraPositionInScaledSpace=new t,this._distanceToLimbInScaledSpaceSquared=0,r(i)&&(this.cameraPosition=i)}function l(e,i,r){var n=e.transformPositionToScaledSpace(i,m),o=t.magnitudeSquared(n),a=Math.sqrt(o),s=t.divideByScalar(n,a,f);o=Math.max(1,o),a=Math.max(1,a);var l=t.dot(s,r),u=t.magnitude(t.cross(s,r,s)),c=1/a,h=Math.sqrt(o-1)*c;return 1/(l*c-u*h)}function u(e,i,r){return 0>=i||i===1/0||i!==i?void 0:t.multiplyByScalar(e,i,r)}function c(e,i){return e.transformPositionToScaledSpace(i,v),t.normalize(v,v)}n(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){var i=this._ellipsoid,r=i.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),n=t.magnitudeSquared(r)-1;t.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=r,this._distanceToLimbInScaledSpaceSquared=n}}});var h=new t;s.prototype.isPointVisible=function(e){var t=this._ellipsoid,i=t.transformPositionToScaledSpace(e,h);return this.isScaledSpacePointVisible(i)},s.prototype.isScaledSpacePointVisible=function(e){var i=this._cameraPositionInScaledSpace,r=this._distanceToLimbInScaledSpaceSquared,n=t.subtract(e,i,h),o=-t.dot(n,i),a=0>r?o>0:o>r&&o*o/t.magnitudeSquared(n)>r;return!a},s.prototype.computeHorizonCullingPoint=function(e,i,n){r(n)||(n=new t);for(var o=this._ellipsoid,a=c(o,e),s=0,h=0,d=i.length;d>h;++h){var p=i[h],m=l(o,p,a);s=Math.max(s,m)}return u(a,s,n)};var d=new t;s.prototype.computeHorizonCullingPointFromVertices=function(e,n,o,a,s){r(s)||(s=new t),a=i(a,t.ZERO);for(var h=this._ellipsoid,p=c(h,e),m=0,f=0,v=n.length;v>f;f+=o){d.x=n[f]+a.x,d.y=n[f+1]+a.y,d.z=n[f+2]+a.z;var g=l(h,d,p);m=Math.max(m,g)}return u(p,m,s)},s.prototype.computeHorizonCullingPointFromPoints=function(e,i,n){r(n)||(n=new t);for(var o=this._ellipsoid,a=c(o,e),s=0,h=0,d=i.length;d>h;++h){var p=l(o,i[h],a);s=Math.max(s,p)}return u(a,s,n)};var p=[];s.prototype.computeHorizonCullingPointFromRectangle=function(i,r,n){var o=a.subsample(i,r,0,p),s=e.fromPoints(o);return t.magnitude(s.center)<.1*r.minimumRadius?void 0:this.computeHorizonCullingPoint(s.center,o,n)};var m=new t,f=new t,v=new t;return s}),i("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function i(e,i,r){var n=e+i;return t.sign(e)!==t.sign(i)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(i)))a&&a/ss&&s/ao)return[];var l=Math.sqrt(o);return[-l,l]}if(0===n)return o=-r/e,0>o?[o,0]:[0,o];var u=r*r,c=4*e*n,h=i(u,-c,t.EPSILON14);if(0>h)return[];var d=-.5*i(r,t.sign(r)*Math.sqrt(h),t.EPSILON14);return r>0?[d/e,n/d]:[n/d,d/e]},r}),i("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function i(e,t,i,r){var n,o,a=e,s=t/3,l=i/3,u=r,c=a*l,h=s*u,d=s*s,p=l*l,m=a*l-d,f=a*u-s*l,v=s*u-p,g=4*m*v-f*f;if(0>g){var _,y,C;d*h>=c*p?(_=a,y=m,C=-2*s*m+a*f):(_=u,y=v,C=-u*f+2*l*v);var E=0>C?-1:1,S=-E*Math.abs(_)*Math.sqrt(-g);o=-C+S;var w=o/2,T=0>w?-Math.pow(-w,1/3):Math.pow(w,1/3),x=o===S?-T:-y/T;return n=0>=y?T+x:-C/(T*T+x*x+y),d*h>=c*p?[(n-s)/a]:[-u/(n+l)]}var b=m,A=-2*s*m+a*f,P=v,I=-u*f+2*l*v,M=Math.sqrt(g),D=Math.sqrt(3)/2,R=Math.abs(Math.atan2(a*M,-A)/3);n=2*Math.sqrt(-b);var O=Math.cos(R);o=n*O;var N=n*(-O/2-D*Math.sin(R)),L=o+N>2*s?o-s:N-s,F=a,B=L/F;R=Math.abs(Math.atan2(u*M,-I)/3),n=2*Math.sqrt(-P),O=Math.cos(R),o=n*O,N=n*(-O/2-D*Math.sin(R));var V=-u,k=2*l>o+N?o+l:N+l,z=V/k,U=F*k,G=-L*k-F*V,W=L*V,H=(l*G-s*W)/(-s*G+l*U);return H>=B?z>=B?z>=H?[B,H,z]:[B,z,H]:[z,B,H]:z>=B?[H,B,z]:z>=H?[H,z,B]:[z,H,B]}var r={};return r.computeDiscriminant=function(e,t,i,r){var n=e*e,o=t*t,a=i*i,s=r*r,l=18*e*t*i*r+o*a-27*n*s-4*(e*a*i+o*t*r);return l},r.computeRealRoots=function(e,r,n,o){var a,s;if(0===e)return t.computeRealRoots(r,n,o);if(0===r){if(0===n){if(0===o)return[0,0,0];s=-o/e;var l=0>s?-Math.pow(-s,1/3):Math.pow(s,1/3);return[l,l,l]}return 0===o?(a=t.computeRealRoots(e,0,n),0===a.Length?[0]:[a[0],0,a[1]]):i(e,0,n,o)}return 0===n?0===o?(s=-r/e,0>s?[s,0,0]:[0,0,s]):i(e,r,0,o):0===o?(a=t.computeRealRoots(e,r,n),0===a.length?[0]:a[1]<=0?[a[0],a[1],0]:a[0]>=0?[0,a[0],a[1]]:[a[0],0,a[1]]):i(e,r,n,o)},r}),i("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,i,r){"use strict";function n(t,n,o,a){var s=t*t,l=n-3*s/8,u=o-n*t/2+s*t/8,c=a-o*t/4+n*s/16-3*s*s/256,h=e.computeRealRoots(1,2*l,l*l-4*c,-u*u);if(h.length>0){var d=-t/4,p=h[h.length-1];if(Math.abs(p)=0&&g>=0){var _=Math.sqrt(v),y=Math.sqrt(g);return[d-y,d-_,d+_,d+y]}if(v>=0&&0>g)return f=Math.sqrt(v),[d-f,d+f];if(0>v&&g>=0)return f=Math.sqrt(g),[d-f,d+f]}return[]}if(p>0){var C=Math.sqrt(p),E=(l+p-u/C)/2,S=(l+p+u/C)/2,w=r.computeRealRoots(1,C,E),T=r.computeRealRoots(1,-C,S);return 0!==w.length?(w[0]+=d,w[1]+=d,0!==T.length?(T[0]+=d,T[1]+=d,w[1]<=T[0]?[w[0],w[1],T[0],T[1]]:T[1]<=w[0]?[T[0],T[1],w[0],w[1]]:w[0]>=T[0]&&w[1]<=T[1]?[T[0],w[0],w[1],T[1]]:T[0]>=w[0]&&T[1]<=w[1]?[w[0],T[0],T[1],w[1]]:w[0]>T[0]&&w[0]0){var m,f,v=p[0],g=n-v,_=g*g,y=t/2,C=g/2,E=_-4*a,S=_+4*Math.abs(a),w=u-4*v,T=u+4*Math.abs(v);if(0>v||w*S>E*T){var x=Math.sqrt(w);m=x/2,f=0===x?0:(t*C-o)/x}else{var b=Math.sqrt(E);m=0===b?0:(t*C-o)/b,f=b/2}var A,P;0===y&&0===m?(A=0,P=0):i.sign(y)===i.sign(m)?(A=y+m,P=v/A):(P=y-m,A=v/P);var I,M;0===C&&0===f?(I=0,M=0):i.sign(C)===i.sign(f)?(I=C+f,M=a/I):(M=C-f,I=a/M);var D=r.computeRealRoots(1,A,I),R=r.computeRealRoots(1,P,M);if(0!==D.length)return 0!==R.length?D[1]<=R[0]?[D[0],D[1],R[0],R[1]]:R[1]<=D[0]?[R[0],R[1],D[0],D[1]]:D[0]>=R[0]&&D[1]<=R[1]?[R[0],D[0],D[1],R[1]]:R[0]>=D[0]&&R[1]<=D[1]?[D[0],R[0],R[1],D[1]]:D[0]>R[0]&&D[0]u?1:0;switch(p+=0>c?p+1:p,p+=0>h?p+1:p,p+=0>d?p+1:p){case 0:return n(u,c,h,d);case 1:return o(u,c,h,d);case 2:return o(u,c,h,d);case 3:return n(u,c,h,d);case 4:return n(u,c,h,d);case 5:return o(u,c,h,d);case 6:return n(u,c,h,d);case 7:return n(u,c,h,d);case 8:return o(u,c,h,d);case 9:return n(u,c,h,d);case 10:return n(u,c,h,d);case 11:return o(u,c,h,d);case 12:return n(u,c,h,d);case 13:return n(u,c,h,d);case 14:return n(u,c,h,d);case 15:return n(u,c,h,d);default:return}},a}),i("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r){"use strict";function n(i,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(i,e.ZERO)),this.direction=r}return n.getPoint=function(t,r,n){return i(n)||(n=new e),n=e.multiplyByScalar(t.direction,r,n),e.add(t.origin,n,n)},n}),i("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t,r,n,a,s){s=i(s,!1);var l,u,c,h,d,p=t.origin,m=t.direction,f=e.subtract(n,r,v),E=e.subtract(a,r,g),S=e.cross(m,E,_),w=e.dot(f,S);if(s){if(wc||c>w)return;if(u=e.cross(l,f,C),h=e.dot(m,u),0>h||c+h>w)return;d=e.dot(E,u)/w}else{if(Math.abs(w)c||c>1)return;if(u=e.cross(l,f,C),h=e.dot(m,u)*T,0>h||c+h>1)return;d=e.dot(E,u)*T}return d}function h(e,t,i,r){var n=t*t-4*e*i;if(!(0>n)){if(n>0){var o=1/(2*e),a=Math.sqrt(n),s=(-t+a)*o,l=(-t-a)*o;return l>s?(r.root0=s,r.root1=l):(r.root0=l,r.root1=s),r}var u=-t/(2*e);if(0!==u)return r.root0=r.root1=u,r}}function d(t,i,n){r(n)||(n={});var o=t.origin,a=t.direction,s=i.center,l=i.radius*i.radius,u=e.subtract(o,s,_),c=e.dot(a,a),d=2*e.dot(a,u),p=e.magnitudeSquared(u)-l,m=h(c,d,p,S);return r(m)?(n.start=m.root0,n.stop=m.root1,n):void 0}function p(e,t,i){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))N;++N){var L,F=c[N],B=F*F,V=Math.max(1-B,0),k=Math.sqrt(V);L=o.sign(m)===o.sign(v)?p(m*B+v,f*F,o.EPSILON12):o.sign(v)===o.sign(f*F)?p(m*B,f*F+v,o.EPSILON12):p(m*B+f*F,v,o.EPSILON12);var z=p(g*F,_,o.EPSILON15),U=L*z;0>U?y.push(new e(n,u*F,u*k)):U>0?y.push(new e(n,u*F,u*-k)):0!==k?(y.push(new e(n,u*F,u*-k)),y.push(new e(n,u*F,u*k)),++N):y.push(new e(n,u*F,u*k))}return y}var f={};f.rayPlane=function(t,i,n){r(n)||(n=new e);var a=t.origin,s=t.direction,l=i.normal,u=e.dot(l,s);if(!(Math.abs(u)c))return n=e.multiplyByScalar(s,c,n),e.add(a,n,n)}};var v=new e,g=new e,_=new e,y=new e,C=new e;f.rayTriangle=function(t,i,n,o,a,s){var l=c(t,i,n,o,a);if(r(l)&&!(0>l))return r(s)||(s=new e),e.multiplyByScalar(t.direction,l,s),e.add(t.origin,s,s)};var E=new u;f.lineSegmentTriangle=function(t,i,n,o,a,s,l){var u=E;e.clone(t,u.origin),e.subtract(i,t,u.direction),e.normalize(u.direction,u.direction);var h=c(u,n,o,a,s);return!r(h)||0>h||h>e.distance(t,i)?void 0:(r(l)||(l=new e),e.multiplyByScalar(u.direction,h,l),e.add(u.origin,l,l))};var S={root0:0,root1:0};f.raySphere=function(e,t,i){return i=d(e,t,i),!r(i)||i.stop<0?void 0:(i.start=Math.max(i.start,0),i)};var w=new u;f.lineSegmentSphere=function(t,i,n,o){var a=w,s=e.subtract(i,t,a.direction),l=e.magnitude(s);return e.normalize(s,s),o=d(a,n,o),!r(o)||o.stop<0||o.start>l?void 0:(o.start=Math.max(o.start,0),o.stop=Math.min(o.stop,l),o)};var T=new e,x=new e;f.rayEllipsoid=function(t,i){var r,n,o,a,s,l=i.oneOverRadii,u=e.multiplyComponents(l,t.origin,T),c=e.multiplyComponents(l,t.direction,x),h=e.magnitudeSquared(u),d=e.dot(u,c);if(h>1){if(d>=0)return;var p=d*d;if(r=h-1,n=e.magnitudeSquared(c),o=n*r,o>p)return;if(p>o){a=d*d-o,s=-d+Math.sqrt(a);var m=s/n,f=r/s;return f>m?{start:m,stop:f}:{start:f,stop:m}}var v=Math.sqrt(r/n);return{start:v,stop:v}}return 1>h?(r=h-1,n=e.magnitudeSquared(c),o=n*r,a=d*d-o,s=-d+Math.sqrt(a),{start:0,stop:s/n}):0>d?(n=e.magnitudeSquared(c),{start:0,stop:-d/n}):void 0};var b=new e,A=new e,P=new e,I=new e,M=new e,D=new a,R=new a,O=new a,N=new a,L=new a,F=new a,B=new a,V=new e,k=new e,z=new t;f.grazingAltitudeLocation=function(t,i){var n=t.origin,s=t.direction,l=i.geodeticSurfaceNormal(n,b);if(e.dot(s,l)>=0)return n;var u=r(this.rayEllipsoid(t,i)),c=i.transformPositionToScaledSpace(s,b),h=e.normalize(c,c),d=e.mostOrthogonalAxis(c,I),p=e.normalize(e.cross(d,h,A),A),f=e.normalize(e.cross(h,p,P),P),v=D;v[0]=h.x,v[1]=h.y,v[2]=h.z,v[3]=p.x,v[4]=p.y,v[5]=p.z,v[6]=f.x,v[7]=f.y,v[8]=f.z;var g=a.transpose(v,R),_=a.fromScale(i.radii,O),y=a.fromScale(i.oneOverRadii,N),C=L;C[0]=0,C[1]=-s.z,C[2]=s.y,C[3]=s.z,C[4]=0,C[5]=-s.x,C[6]=-s.y,C[7]=s.x,C[8]=0;var E,S,w=a.multiply(a.multiply(g,y,F),C,F),T=a.multiply(a.multiply(w,_,B),v,B),x=a.multiplyByVector(w,n,M),U=m(T,e.negate(x,b),0,0,1),G=U.length;if(G>0){for(var W=e.clone(e.ZERO,k),H=Number.NEGATIVE_INFINITY,q=0;G>q;++q){E=a.multiplyByVector(_,a.multiplyByVector(v,U[q],V),V);var j=e.normalize(e.subtract(E,n,I),I),Y=e.dot(j,s);Y>H&&(H=Y,W=e.clone(E,W))}var X=i.cartesianToCartographic(W,z);return H=o.clamp(H,0,1),S=e.magnitude(e.subtract(W,n,I))*Math.sqrt(1-H*H),S=u?-S:S,X.height=S,i.cartographicToCartesian(X,new e)}};var U=new e;return f.lineSegmentPlane=function(t,i,n,a){r(a)||(a=new e);var s=e.subtract(i,t,U),l=n.normal,u=e.dot(l,s);if(!(Math.abs(u)h||h>1))return e.multiplyByScalar(s,h,a),e.add(t,a,a),a}},f.trianglePlaneIntersection=function(t,i,r,n){var o=n.normal,a=n.distance,s=e.dot(o,t)+a<0,l=e.dot(o,i)+a<0,u=e.dot(o,r)+a<0,c=0;c+=s?1:0,c+=l?1:0,c+=u?1:0;var h,d;if((1===c||2===c)&&(h=new e,d=new e),1===c){if(s)return f.lineSegmentPlane(t,i,n,h),f.lineSegmentPlane(t,r,n,d),{positions:[t,i,r,h,d],indices:[0,3,4,1,2,4,1,4,3]};if(l)return f.lineSegmentPlane(i,r,n,h),f.lineSegmentPlane(i,t,n,d),{positions:[t,i,r,h,d],indices:[1,3,4,2,0,4,2,4,3]};if(u)return f.lineSegmentPlane(r,t,n,h),f.lineSegmentPlane(r,i,n,d),{positions:[t,i,r,h,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===c){if(!s)return f.lineSegmentPlane(i,t,n,h),f.lineSegmentPlane(r,t,n,d),{positions:[t,i,r,h,d],indices:[1,2,4,1,4,3,0,3,4]};if(!l)return f.lineSegmentPlane(r,i,n,h),f.lineSegmentPlane(t,i,n,d),{positions:[t,i,r,h,d],indices:[2,0,4,2,4,3,1,3,4]};if(!u)return f.lineSegmentPlane(t,r,n,h),f.lineSegmentPlane(i,r,n,d),{positions:[t,i,r,h,d],indices:[0,1,4,0,4,3,2,3,4]}}},f}),i("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function i(e,t,i){for(var r,n,o=0,a=e.length-1;a>=o;)if(r=~~((o+a)/2),n=i(e[r],t),0>n)o=r+1;else{if(!(n>0))return r;a=r-1}return~(a+1)}return i}),i("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,i,r,n){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=i,this.yPoleOffset=r,this.ut1MinusUtc=n}return e}),i("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,i=0,r=t[i++],n=function(e,t,i,r){i||(i=" ");var n=e.length>=t?"":Array(1+t-e.length>>>0).join(i);return r?e+n:n+e},o=function(e,t,i,r,o,a){var s=r-e.length;return s>0&&(e=i||!o?n(e,r,a,i):e.slice(0,t.length)+n("",s,"0",!0)+e.slice(t.length)),e},a=function(e,t,i,r,a,s,l){var u=e>>>0;return i=i&&u&&{2:"0b",8:"0",16:"0x"}[t]||"",e=i+n(u.toString(t),s||0,"0",!1),o(e,i,r,a,l)},s=function(e,t,i,r,n,a){return null!=r&&(e=e.slice(0,r)),o(e,"",t,i,n,a)},l=function(e,r,l,u,c,h,d){var p,m,f,v,g;if("%%"==e)return"%";for(var _=!1,y="",C=!1,E=!1,S=" ",w=l.length,T=0;l&&w>T;T++)switch(l.charAt(T)){case" ":y=" ";break;case"+":y="+";break;case"-":_=!0;break;case"'":S=l.charAt(T+1);break;case"0":C=!0;break;case"#":E=!0}if(u=u?"*"==u?+t[i++]:"*"==u.charAt(0)?+t[u.slice(1,-1)]:+u:0,0>u&&(u=-u,_=!0),!isFinite(u))throw new Error("sprintf: (minimum-)width must be finite");switch(h=h?"*"==h?+t[i++]:"*"==h.charAt(0)?+t[h.slice(1,-1)]:+h:"fFeE".indexOf(d)>-1?6:"d"==d?0:void 0,g=r?t[r.slice(0,-1)]:t[i++],d){case"s":return s(String(g),_,u,h,C,S);case"c":return s(String.fromCharCode(+g),_,u,h,C);case"b":return a(g,2,E,_,u,h,C);case"o":return a(g,8,E,_,u,h,C);case"x":return a(g,16,E,_,u,h,C);case"X":return a(g,16,E,_,u,h,C).toUpperCase();case"u":return a(g,10,E,_,u,h,C);case"i":case"d":return p=+g||0,p=Math.round(p-p%1),m=0>p?"-":y,g=m+n(String(Math.abs(p)),h,"0",!1),o(g,m,_,u,C);case"e":case"E":case"f":case"F":case"g":case"G":return p=+g,m=0>p?"-":y,f=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],v=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],g=m+Math.abs(p)[f](h),o(g,m,_,u,C)[v]();default:return e}};return r.replace(e,l)}return e}),i("Core/GregorianDate",[],function(){"use strict";function e(e,t,i,r,n,o,a,s){this.year=e,this.month=t,this.day=i,this.hour=r,this.minute=n,this.second=o,this.millisecond=a,this.isLeapSecond=s}return e}),i("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),i("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),i("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={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};return e(t)}),i("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),i("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,t){return f.compare(e.julianDate,t.julianDate)}function h(e){y.julianDate=e;var i=f.leapSeconds,r=t(i,y,c);0>r&&(r=~r),r>=i.length&&(r=i.length-1);var n=i[r].offset;if(r>0){var o=f.secondsDifference(i[r].julianDate,e);o>n&&(r--,n=i[r].offset)}f.addSeconds(e,n,e)}function d(e,i){y.julianDate=e;var r=f.leapSeconds,n=t(r,y,c);if(0>n&&(n=~n),0===n)return f.addSeconds(e,-r[0].offset,i);if(n>=r.length)return f.addSeconds(e,-r[n-1].offset,i);var o=f.secondsDifference(r[n].julianDate,e);return 0===o?f.addSeconds(e,-r[n].offset,i):1>=o?void 0:f.addSeconds(e,-r[--n].offset,i)}function p(e,t,i){var r=t/l.SECONDS_PER_DAY|0;return e+=r,t-=l.SECONDS_PER_DAY*r,0>t&&(e--,t+=l.SECONDS_PER_DAY),i.dayNumber=e,i.secondsOfDay=t,i}function m(e,t,i,r,n,o,a){var s=(t-14)/12|0,u=e+4800+s,c=(1461*u/4|0)+(367*(t-2-12*s)/12|0)-(3*((u+100)/100|0)/4|0)+i-32075;r-=12,0>r&&(r+=24);var h=o+(r*l.SECONDS_PER_HOUR+n*l.SECONDS_PER_MINUTE+a*l.SECONDS_PER_MILLISECOND);return h>=43200&&(c-=1),[c,h]}function f(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=i(e,0),t=i(t,0),r=i(r,u.UTC);var n=0|e;t+=(e-n)*l.SECONDS_PER_DAY,p(n,t,this),r===u.UTC&&h(this)}var v=new o,g=[31,28,31,30,31,30,31,31,30,31,30,31],_=29,y=new s,C=/^(\d{4})$/,E=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,w=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,T=/^(\d{4})-?(\d{2})-?(\d{2})$/,x=/([Z+\-])?(\d{2})?:?(\d{2})?$/,b=/^(\d{2})(\.\d+)?/.source+x.source,A=/^(\d{2}):?(\d{2})(\.\d+)?/.source+x.source,P=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+x.source,I="Invalid ISO 8601 date.";f.fromDate=function(e,t){var i=m(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(p(i[0],i[1],t),h(t),t):new f(i[0],i[1],u.UTC)},f.fromIso8601=function(e,t){e=e.replace(",",".");var i,o,s,l=e.split("T"),c=1,d=1,v=0,y=0,x=0,M=0,D=l[0],R=l[1];if(!r(D))throw new n(I);var O;if(l=D.match(T),null!==l){if(O=D.split("-").length-1,O>0&&2!==O)throw new n(I);i=+l[1],c=+l[2],d=+l[3]}else if(l=D.match(E),null!==l)i=+l[1],c=+l[2];else if(l=D.match(C),null!==l)i=+l[1];else{var N;if(l=D.match(S),null!==l){if(i=+l[1],N=+l[2],s=a(i),1>N||s&&N>366||!s&&N>365)throw new n(I)}else{if(l=D.match(w),null===l)throw new n(I);i=+l[1];var L=+l[2],F=+l[3]||0;if(O=D.split("-").length-1,O>0&&(!r(l[3])&&1!==O||r(l[3])&&2!==O))throw new n(I);var B=new Date(Date.UTC(i,0,4));N=7*L+F-B.getUTCDay()-3}o=new Date(Date.UTC(i,0,1)),o.setUTCDate(N),c=o.getUTCMonth()+1,d=o.getUTCDate()}if(s=a(i),1>c||c>12||1>d||(2!==c||!s)&&d>g[c-1]||s&&2===c&&d>_)throw new n(I);var V;if(r(R)){if(l=R.match(P),null!==l){if(O=R.split(":").length-1,O>0&&2!==O&&3!==O)throw new n(I);v=+l[1],y=+l[2],x=+l[3],M=1e3*+(l[4]||0),V=5}else if(l=R.match(A),null!==l){if(O=R.split(":").length-1,O>2)throw new n(I);v=+l[1],y=+l[2],x=60*+(l[3]||0),V=4}else{if(l=R.match(b),null===l)throw new n(I);v=+l[1],y=60*+(l[2]||0),V=3}if(y>=60||x>=61||v>24||24===v&&(y>0||x>0||M>0))throw new n(I);var k=l[V],z=+l[V+1],U=+(l[V+2]||0);switch(k){case"+":v-=z,y-=U;break;case"-":v+=z,y+=U;break;case"Z":break;default:y+=new Date(Date.UTC(i,c-1,d,v,y)).getTimezoneOffset()}}else y+=new Date(i,c-1,d).getTimezoneOffset();var G=60===x;for(G&&x--;y>=60;)y-=60,v++;for(;v>=24;)v-=24,d++;for(o=s&&2===c?_:g[c-1];d>o;)d-=o,c++,c>12&&(c-=12,i++),o=s&&2===c?_:g[c-1];for(;0>y;)y+=60,v--;for(;0>v;)v+=24,d--;for(;1>d;)c--,1>c&&(c+=12,i--),o=s&&2===c?_:g[c-1],d+=o;var W=m(i,c,d,v,y,x,M);return r(t)?(p(W[0],W[1],t),h(t)):t=new f(W[0],W[1],u.UTC),G&&f.addSeconds(t,1,t),t},f.now=function(e){return f.fromDate(new Date,e)};var M=new f(0,0,u.TAI);return f.toGregorianDate=function(e,t){var i=!1,n=d(e,M);r(n)||(f.addSeconds(e,-1,M),n=d(M,M),i=!0);var a=n.dayNumber,s=n.secondsOfDay;s>=43200&&(a+=1);var u=a+68569|0,c=4*u/146097|0;u=u-((146097*c+3)/4|0)|0;var h=4e3*(u+1)/1461001|0;u=u-(1461*h/4|0)+31|0;var p=80*u/2447|0,m=u-(2447*p/80|0)|0;u=p/11|0;var v=p+2-12*u|0,g=100*(c-49)+h+u|0,_=s/l.SECONDS_PER_HOUR|0,y=s-_*l.SECONDS_PER_HOUR,C=y/l.SECONDS_PER_MINUTE|0;y-=C*l.SECONDS_PER_MINUTE;var E=0|y,S=(y-E)/l.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),i&&(E+=1),r(t)?(t.year=g,t.month=v,t.day=m,t.hour=_,t.minute=C,t.second=E,t.millisecond=S,t.isLeapSecond=i,t):new o(g,v,m,_,C,E,S,i)},f.toDate=function(e){var t=f.toGregorianDate(e,v),i=t.second;return t.isLeapSecond&&(i-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,i,t.millisecond))},f.toIso8601=function(t,i){var n,o=f.toGregorianDate(t,o);return r(i)||0===o.millisecond?r(i)&&0!==i?(n=(.01*o.millisecond).toFixed(i).replace(".","").slice(0,i),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",o.year,o.month,o.day,o.hour,o.minute,o.second,n)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",o.year,o.month,o.day,o.hour,o.minute,o.second):(n=(.01*o.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",o.year,o.month,o.day,o.hour,o.minute,o.second,n))},f.clone=function(e,t){return r(e)?r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new f(e.dayNumber,e.secondsOfDay,u.TAI):void 0},f.compare=function(e,t){var i=e.dayNumber-t.dayNumber;return 0!==i?i:e.secondsOfDay-t.secondsOfDay},f.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},f.equalsEpsilon=function(e,t,i){return e===t||r(e)&&r(t)&&Math.abs(f.secondsDifference(e,t))<=i},f.totalDays=function(e){return e.dayNumber+e.secondsOfDay/l.SECONDS_PER_DAY},f.secondsDifference=function(e,t){var i=(e.dayNumber-t.dayNumber)*l.SECONDS_PER_DAY;return i+(e.secondsOfDay-t.secondsOfDay)},f.daysDifference=function(e,t){var i=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/l.SECONDS_PER_DAY;return i+r},f.computeTaiMinusUtc=function(e){y.julianDate=e;var i=f.leapSeconds,r=t(i,y,c);return 0>r&&(r=~r,--r,0>r&&(r=0)),i[r].offset},f.addSeconds=function(e,t,i){return p(e.dayNumber,e.secondsOfDay+t,i)},f.addMinutes=function(e,t,i){var r=e.secondsOfDay+t*l.SECONDS_PER_MINUTE;return p(e.dayNumber,r,i)},f.addHours=function(e,t,i){var r=e.secondsOfDay+t*l.SECONDS_PER_HOUR;return p(e.dayNumber,r,i)},f.addDays=function(e,t,i){var r=e.dayNumber+t;return p(r,e.secondsOfDay,i)},f.lessThan=function(e,t){return f.compare(e,t)<0},f.lessThanOrEquals=function(e,t){return f.compare(e,t)<=0},f.greaterThan=function(e,t){return f.compare(e,t)>0},f.greaterThanOrEquals=function(e,t){return f.compare(e,t)>=0},f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.equalsEpsilon=function(e,t){return f.equalsEpsilon(this,e,t)},f.prototype.toString=function(){return f.toIso8601(this)},f.leapSeconds=[new s(new f(2441317,43210,u.TAI),10),new s(new f(2441499,43211,u.TAI),11),new s(new f(2441683,43212,u.TAI),12),new s(new f(2442048,43213,u.TAI),13),new s(new f(2442413,43214,u.TAI),14),new s(new f(2442778,43215,u.TAI),15),new s(new f(2443144,43216,u.TAI),16),new s(new f(2443509,43217,u.TAI),17),new s(new f(2443874,43218,u.TAI),18),new s(new f(2444239,43219,u.TAI),19),new s(new f(2444786,43220,u.TAI),20),new s(new f(2445151,43221,u.TAI),21),new s(new f(2445516,43222,u.TAI),22),new s(new f(2446247,43223,u.TAI),23),new s(new f(2447161,43224,u.TAI),24),new s(new f(2447892,43225,u.TAI),25),new s(new f(2448257,43226,u.TAI),26),new s(new f(2448804,43227,u.TAI),27),new s(new f(2449169,43228,u.TAI),28),new s(new f(2449534,43229,u.TAI),29),new s(new f(2450083,43230,u.TAI),30),new s(new f(2450630,43231,u.TAI),31),new s(new f(2451179,43232,u.TAI),32),new s(new f(2453736,43233,u.TAI),33),new s(new f(2454832,43234,u.TAI),34),new s(new f(2456109,43235,u.TAI),35),new s(new f(2457204,43236,u.TAI),36)], -f}),i("Core/clone",["./defaultValue"],function(e){"use strict";function t(i,r){if(null===i||"object"!=typeof i)return i;r=e(r,!1);var n=new i.constructor;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];r&&(a=t(a,r)),n[o]=a}return n}return t}),i("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var i=e.split("\r\n"),r=0;r0){var a=n.substring(0,o),s=n.substring(o+2);t[a]=s}}return t}return e}),i("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function i(e,i,r){this.statusCode=e,this.response=i,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return i.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},i}),i("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError"],function(e,t,i,r,n,o){"use strict";function a(i){i=t(i,t.EMPTY_OBJECT);var r=i.responseType,n=t(i.method,"GET"),o=i.data,s=i.headers,l=i.overrideMimeType,u=i.withCredentials;return e(i.url,function(t){var i=e.defer();return a.load(t,r,n,o,s,i,l,u),i.promise})}function s(e,t){var i=decodeURIComponent(t);return e?atob(i):i}function l(e,t){for(var i=s(e,t),r=new ArrayBuffer(i.length),n=new Uint8Array(r),o=0;o=200&&m.status<300?i(m.response)?l.resolve(m.response):i(m.responseXML)&&m.responseXML.hasChildNodes()?l.resolve(m.responseXML):i(m.responseText)?l.resolve(m.responseText):l.reject(new o("unknown XMLHttpRequest response type.")):l.reject(new n(m.status,m.response,m.getAllResponseHeaders()))},m.onerror=function(e){l.reject(new n)},m.send(a)},a.defaultLoad=a.load,a}),i("Core/loadText",["./loadWithXhr","./defined"],function(e,t){"use strict";function i(i,r){return e({url:i,headers:t(r)?r.headers:void 0,overrideMimeType:t(r)?r.overrideMimeType:void 0,withCredentials:t(r)?r.withCredentials:void 0})}return i}),i("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,i,r){"use strict";function n(i,n){return t(n)||(n={}),t(n.headers)?t(n.headers.Accept)||(n.headers=e(n.headers),n.headers.Accept=o.Accept):n.headers=o,r(i,n).then(function(e){return JSON.parse(e)})}var o={Accept:"application/json,*/*;q=0.01"};return n}),i("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(t){if(t=i(t,i.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=i(t.addNewLeapSeconds,!0),r(t.data))m(this,t.data);else if(r(t.url)){var n=this;this._downloadPromise=e(l(t.url),function(e){m(n,e)},function(){n._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else m(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function p(e,t){return a.compare(e.julianDate,t)}function m(e,i){if(!r(i.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(i.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var n=i.columnNames.indexOf("modifiedJulianDateUtc"),o=i.columnNames.indexOf("xPoleWanderRadians"),l=i.columnNames.indexOf("yPoleWanderRadians"),u=i.columnNames.indexOf("ut1MinusUtcSeconds"),d=i.columnNames.indexOf("xCelestialPoleOffsetRadians"),m=i.columnNames.indexOf("yCelestialPoleOffsetRadians"),f=i.columnNames.indexOf("taiMinusUtcSeconds");if(0>n||0>o||0>l||0>u||0>d||0>m||0>f)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var v=e._samples=i.samples,g=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=l,e._ut1MinusUtcSecondsColumn=u,e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=m,e._taiMinusUtcSecondsColumn=f,e._columnCount=i.columnNames.length,e._lastIndex=void 0;for(var _,y=e._addNewLeapSeconds,C=0,E=v.length;E>C;C+=e._columnCount){var S=v[C+n],w=v[C+f],T=S+c.MODIFIED_JULIAN_DATE_DIFFERENCE,x=new a(T,w,h.TAI);if(g.push(x),y){if(w!==_&&r(_)){var b=a.leapSeconds,A=t(b,x,p);if(0>A){var P=new s(x,w);b.splice(~A,0,P)}}_=w}}}function f(e,t,i,r,n){var o=i*r;n.xPoleWander=t[o+e._xPoleWanderRadiansColumn],n.yPoleWander=t[o+e._yPoleWanderRadiansColumn],n.xPoleOffset=t[o+e._xCelestialPoleOffsetRadiansColumn],n.yPoleOffset=t[o+e._yCelestialPoleOffsetRadiansColumn],n.ut1MinusUtc=t[o+e._ut1MinusUtcSecondsColumn]}function v(e,t,i){return t+e*(i-t)}function g(e,t,i,r,n,o,s){var l=e._columnCount;if(o>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;var u=t[n],c=t[o];if(u.equals(c)||r.equals(u))return f(e,i,n,l,s),s;if(r.equals(c))return f(e,i,o,l,s),s;var h=a.secondsDifference(r,u)/a.secondsDifference(c,u),d=n*l,p=o*l,m=i[d+e._ut1MinusUtcSecondsColumn],g=i[p+e._ut1MinusUtcSecondsColumn],_=g-m;if(_>.5||-.5>_){var y=i[d+e._taiMinusUtcSecondsColumn],C=i[p+e._taiMinusUtcSecondsColumn];y!==C&&(c.equals(r)?m=g:g-=C-y)}return s.xPoleWander=v(h,i[d+e._xPoleWanderRadiansColumn],i[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=v(h,i[d+e._yPoleWanderRadiansColumn],i[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=v(h,i[d+e._xCelestialPoleOffsetRadiansColumn],i[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=v(h,i[d+e._yCelestialPoleOffsetRadiansColumn],i[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=v(h,m,g),s}return d.NONE=o({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new n(0,0,0,0,0),t}}),d.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},d.prototype.compute=function(e,i){if(r(this._samples)){if(r(i)||(i=new n(0,0,0,0,0)),0===this._samples.length)return i.xPoleWander=0,i.yPoleWander=0,i.xPoleOffset=0,i.yPoleOffset=0,i.ut1MinusUtc=0,i;var o=this._dates,s=this._lastIndex,l=0,c=0;if(r(s)){var h=o[s],d=o[s+1],p=a.lessThanOrEquals(h,e),m=!r(d),f=m||a.greaterThanOrEquals(d,e);if(p&&f)return l=s,!m&&d.equals(e)&&++l,c=l+1,g(this,o,this._samples,e,l,c,i),i}var v=t(o,e,a.compare,this._dateColumn);return v>=0?(vl&&(l=0)),this._lastIndex=l,g(this,o,this._samples,e,l,c,i),i}if(r(this._dataError))throw new u(this._dataError)},d}),i("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var i=r.exec(t);this.scheme=i[1],this.authority=i[2],this.path=i[3],this.query=i[4],this.fragment=i[5]}}function t(e){var t=unescape(e);return o.test(t)?t:e.toUpperCase()}function i(e,t,i,r){return(t||"")+i.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(a,i).replace(n,t)),this.path&&(this.path=this.path.replace(n,t)),this.query&&(this.query=this.query.replace(n,t)),this.fragment&&(this.fragment=this.fragment.replace(n,t))};var n=/%[0-9a-z]{2}/gi,o=/[a-zA-Z0-9\-\._~]/,a=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var i=new e;return this.scheme?(i.scheme=this.scheme,i.authority=this.authority,i.path=this.path,i.query=this.query):(i.scheme=t.scheme,this.authority?(i.authority=this.authority,i.path=this.path,i.query=this.query):(i.authority=t.authority,""==this.path?(i.path=t.path,i.query=this.query||t.query):("/"==this.path.charAt(0)?(i.path=this.path,i.removeDotSegments()):(t.authority&&""==t.path?i.path="/"+this.path:i.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,i.removeDotSegments()),i.query=this.query))),i.fragment=this.fragment,i},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),i=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?i.pop():"."!=e&&i.push(e);("."==e||".."==e)&&i.push(""),r&&i.unshift(""),this.path=i.join("/")},e.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},e}),i("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r){"use strict";function n(i,r){r=t(r,document.location.href);var n=new e(r),o=new e(i);return o.resolve(n).toString()}return n}),i("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","require"],function(e,t,i,r,n){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,i=e.length;i>t;++t){var r=e[t].getAttribute("src"),n=p.exec(r);if(null!==n)return n[1]}}function a(){if(t(c))return c;var n;if(n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),!t(n))throw new i("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return c=new e(r(n))}function s(e){return n.toUrl("../"+e)}function l(t){return new e(t).resolve(a()).toString()}function u(e){t(h)||(h=t(n.toUrl)?s:l),t(d)||(d=document.createElement("a"));var i=h(e);return d.href=i,d.href=d.href,d.href}var c,h,d,p=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return u._cesiumScriptRegex=p,u.setBaseUrl=function(t){c=new e(t).resolve(new e(document.location.href))},u}),i("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,i){this.x=e,this.y=t,this.s=i}return e}),i("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=i(e,i.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=i(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=i(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new o(this._sampleZeroJulianEphemerisDate,0,s.TAI),this._stepSizeDays=i(e.stepSizeDays,1),this._samplesPerXysFile=i(e.samplesPerXysFile,1e3),this._totalSamples=i(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),n=this._xTable=new Array(t+1),a=Math.pow(this._stepSizeDays,t),l=0;t>=l;++l){r[l]=a,n[l]=l*this._stepSizeDays;for(var u=0;t>=u;++u)u!==l&&(r[l]*=l-u);r[l]=1/r[l]}this._work=new Array(t+1),this._coef=new Array(t+1)}function u(e,t,i){var r=h;return r.dayNumber=t,r.secondsOfDay=i,o.daysDifference(r,e._sampleZeroDateTT)}function c(i,n){if(i._chunkDownloadsInProgress[n])return i._chunkDownloadsInProgress[n];var o=e.defer();i._chunkDownloadsInProgress[n]=o;var s,l=i._xysFileUrlTemplate;return s=r(l)?l.replace("{0}",n):t("Assets/IAU2006_XYS/IAU2006_XYS_"+n+".json"),e(a(s),function(e){i._chunkDownloadsInProgress[n]=!1;for(var t=i._samples,r=e.samples,a=n*i._samplesPerXysFile*3,s=0,l=r.length;l>s;++s)t[a+s]=r[s];o.resolve()}),o.promise}var h=new o(0,0,s.TAI);return l.prototype.preload=function(t,i,r,n){var o=u(this,t,i),a=u(this,r,n),s=o/this._stepSizeDays-this._interpolationOrder/2|0;0>s&&(s=0);var l=a/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;l>=this._totalSamples&&(l=this._totalSamples-1);for(var h=s/this._samplesPerXysFile|0,d=l/this._samplesPerXysFile|0,p=[],m=h;d>=m;++m)p.push(c(this,m));return e.all(p)},l.prototype.computeXysRadians=function(e,t,i){var o=u(this,e,t);if(!(0>o)){var a=o/this._stepSizeDays|0;if(!(a>=this._totalSamples)){var s=this._interpolationOrder,l=a-(s/2|0);0>l&&(l=0);var h=l+s;h>=this._totalSamples&&(h=this._totalSamples-1,l=h-s,0>l&&(l=0));var d=!1,p=this._samples;if(r(p[3*l])||(c(this,l/this._samplesPerXysFile|0),d=!0),r(p[3*h])||(c(this,h/this._samplesPerXysFile|0),d=!0),!d){r(i)?(i.x=0,i.y=0,i.s=0):i=new n(0,0,0);var m,f,v=o-l*this._stepSizeDays,g=this._work,_=this._denominators,y=this._coef,C=this._xTable;for(m=0;s>=m;++m)g[m]=v-C[m];for(m=0;s>=m;++m){for(y[m]=1,f=0;s>=f;++f)f!==m&&(y[m]*=g[f]);y[m]*=_[m];var E=3*(l+m);i.x+=y[m]*p[E++],i.y+=y[m]*p[E++],i.s+=y[m]*p[E]}return i}}}},l}),i("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var i,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},n={};return t(n,{element:{get:function(){return n.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return n.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return n.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return n.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return n.supportsFullscreen()?null!==n.element:void 0}}}),n.supportsFullscreen=function(){if(e(i))return i;i=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",i=!0;for(var n,o=["webkit","moz","o","ms","khtml"],a=0,s=o.length;s>a;++a){var l=o[a];n=l+"RequestFullscreen","function"==typeof t[n]?(r.requestFullscreen=n,i=!0):(n=l+"RequestFullScreen","function"==typeof t[n]&&(r.requestFullscreen=n,i=!0)),n=l+"ExitFullscreen","function"==typeof document[n]?r.exitFullscreen=n:(n=l+"CancelFullScreen","function"==typeof document[n]&&(r.exitFullscreen=n)),n=l+"FullscreenEnabled",e(document[n])?r.fullscreenEnabled=n:(n=l+"FullScreenEnabled",e(document[n])&&(r.fullscreenEnabled=n)),n=l+"FullscreenElement",e(document[n])?r.fullscreenElement=n:(n=l+"FullScreenElement",e(document[n])&&(r.fullscreenElement=n)),n=l+"fullscreenchange",e(document["on"+n])&&("ms"===l&&(n="MSFullscreenChange"),r.fullscreenchange=n),n=l+"fullscreenerror",e(document["on"+n])&&("ms"===l&&(n="MSFullscreenError"),r.fullscreenerror=n)}return i},n.requestFullscreen=function(e,t){n.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},n.exitFullscreen=function(){n.supportsFullscreen()&&document[r.exitFullscreen]()},n}),i("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,i){"use strict";function r(e){for(var t=e.split("."),i=0,r=t.length;r>i;++i)t[i]=parseInt(t[i],10);return t}function n(){if(!t(y)){y=!1;var e=/ Chrome\/([\.0-9]+)/.exec(_.userAgent);null!==e&&(y=!0,C=r(e[1]))}return y}function o(){return n()&&C}function a(){if(!t(E)&&(E=!1,!n()&&/ Safari\/[\.0-9]+/.test(_.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(_.userAgent);null!==e&&(E=!0,S=r(e[1]))}return E}function s(){return a()&&S}function l(){if(!t(w)){w=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(_.userAgent);null!==e&&(w=!0,T=r(e[1]),T.isNightly=!!e[2])}return w}function u(){return l()&&T}function c(){if(!t(x)){x=!1;var e;"Microsoft Internet Explorer"===_.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(_.userAgent),null!==e&&(x=!0,b=r(e[1]))):"Netscape"===_.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(_.userAgent),null!==e&&(x=!0,b=r(e[1])))}return x}function h(){return c()&&b}function d(){if(!t(A)){A=!1;var e=/Firefox\/([\.0-9]+)/.exec(_.userAgent);null!==e&&(A=!0,P=r(e[1]))}return A}function p(){return t(I)||(I=/Windows/i.test(_.appVersion)),I}function m(){return d()&&P}function f(){return t(M)||(M="undefined"!=typeof PointerEvent&&(!t(_.pointerEnabled)||_.pointerEnabled)),M}function v(){if(!t(R)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var i=e.style.imageRendering;R=t(i)&&""!==i,R&&(D=i)}return R}function g(){return v()?D:void 0}var _;_="undefined"!=typeof navigator?navigator:{};var y,C,E,S,w,T,x,b,A,P,I,M,D,R,O={isChrome:n,chromeVersion:o,isSafari:a,safariVersion:s,isWebkit:l,webkitVersion:u,isInternetExplorer:c,internetExplorerVersion:h,isFirefox:d,firefoxVersion:m,isWindows:p,hardwareConcurrency:e(_.hardwareConcurrency,3),supportsPointerEvents:f,supportsImageRenderingPixelated:v,imageRenderingValue:g};return O.supportsFullscreen=function(){return i.supportsFullscreen()},O.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},O.supportsWebWorkers=function(){return"undefined"!=typeof Worker},O}),i("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,i,r,n){this.x=t(e,0),this.y=t(i,0),this.z=t(r,0),this.w=t(n,0)}var u=new e;l.fromAxisAngle=function(t,r,n){var o=r/2,a=Math.sin(o);u=e.normalize(t,u);var s=u.x*a,c=u.y*a,h=u.z*a,d=Math.cos(o);return i(n)?(n.x=s,n.y=c,n.z=h,n.w=d,n):new l(s,c,h,d)};var c=[1,2,0],h=new Array(3);l.fromRotationMatrix=function(e,t){var r,n,o,a,u,d=e[s.COLUMN0ROW0],p=e[s.COLUMN1ROW1],m=e[s.COLUMN2ROW2],f=d+p+m;if(f>0)r=Math.sqrt(f+1),u=.5*r,r=.5/r,n=(e[s.COLUMN1ROW2]-e[s.COLUMN2ROW1])*r,o=(e[s.COLUMN2ROW0]-e[s.COLUMN0ROW2])*r,a=(e[s.COLUMN0ROW1]-e[s.COLUMN1ROW0])*r;else{var v=c,g=0;p>d&&(g=1),m>d&&m>p&&(g=2);var _=v[g],y=v[_];r=Math.sqrt(e[s.getElementIndex(g,g)]-e[s.getElementIndex(_,_)]-e[s.getElementIndex(y,y)]+1);var C=h;C[g]=.5*r,r=.5/r,u=(e[s.getElementIndex(y,_)]-e[s.getElementIndex(_,y)])*r,C[_]=(e[s.getElementIndex(_,g)]+e[s.getElementIndex(g,_)])*r,C[y]=(e[s.getElementIndex(y,g)]+e[s.getElementIndex(g,y)])*r,n=-C[0],o=-C[1],a=-C[2]}return i(t)?(t.x=n,t.y=o,t.z=a,t.w=u,t):new l(n,o,a,u)};var d=new l;l.fromHeadingPitchRoll=function(t,i,r,n){var o=l.fromAxisAngle(e.UNIT_X,r,d),a=l.fromAxisAngle(e.UNIT_Y,-i,n);n=l.multiply(a,o,a);var s=l.fromAxisAngle(e.UNIT_Z,-t,d);return l.multiply(s,n,n)};var p=new e,m=new e,f=new l,v=new l,g=new l;l.packedLength=4,l.pack=function(e,i,r){r=t(r,0),i[r++]=e.x,i[r++]=e.y,i[r++]=e.z,i[r]=e.w},l.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new l),n.x=e[r],n.y=e[r+1],n.z=e[r+2],n.w=e[r+3],n},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,i,r){l.unpack(e,4*i,g),l.conjugate(g,g);for(var n=0,o=i-t+1;o>n;n++){var a=3*n;l.unpack(e,4*(t+n),f),l.multiply(f,g,f),f.w<0&&l.negate(f,f),l.computeAxis(f,p);var s=l.computeAngle(f);r[a]=p.x*s,r[a+1]=p.y*s,r[a+2]=p.z*s}},l.unpackInterpolationResult=function(t,r,n,o,a){i(a)||(a=new l),e.fromArray(t,0,m);var s=e.magnitude(m);return l.unpack(r,4*o,v),0===s?l.clone(l.IDENTITY,f):l.fromAxisAngle(m,s,f),l.multiply(f,v,a)},l.clone=function(e,t){return i(e)?i(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w):void 0},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var i=1/l.magnitude(e),r=e.x*i,n=e.y*i,o=e.z*i,a=e.w*i;return t.x=r,t.y=n,t.z=o,t.w=a,t},l.inverse=function(e,t){var i=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/i,t)},l.add=function(e,t,i){return i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i.w=e.w+t.w,i},l.subtract=function(e,t,i){return i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i.w=e.w-t.w,i},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,i){var r=e.x,n=e.y,o=e.z,a=e.w,s=t.x,l=t.y,u=t.z,c=t.w,h=a*s+r*c+n*u-o*l,d=a*l-r*u+n*c+o*s,p=a*u+r*l-n*s+o*c,m=a*c-r*s-n*l-o*u;return i.x=h,i.y=d,i.z=p,i.w=m,i},l.multiplyByScalar=function(e,t,i){return i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i.w=e.w*t,i},l.divideByScalar=function(e,t,i){return i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i.w=e.w/t,i},l.computeAxis=function(e,t){var i=e.w;if(Math.abs(i-1)n&&(n=-n,o=y=l.negate(t,y)),1-nR;++R){var O=R+1,N=2*O+1;P[R]=1/(O*N),I[R]=O/N}return P[7]=A/136,I[7]=8*A/17,l.fastSlerp=function(e,t,i,r){var n,o=l.dot(e,t);o>=0?n=1:(n=-1,o=-o);for(var a=o-1,s=1-i,u=i*i,c=s*s,h=7;h>=0;--h)M[h]=(P[h]*u-I[h])*a,D[h]=(P[h]*c-I[h])*a;var d=n*i*(1+M[0]*(1+M[1]*(1+M[2]*(1+M[3]*(1+M[4]*(1+M[5]*(1+M[6]*(1+M[7])))))))),p=s*(1+D[0]*(1+D[1]*(1+D[2]*(1+D[3]*(1+D[4]*(1+D[5]*(1+D[6]*(1+D[7])))))))),m=l.multiplyByScalar(e,p,b);return l.multiplyByScalar(t,d,r),l.add(m,r,r)},l.fastSquad=function(e,t,i,r,n,o){var a=l.fastSlerp(e,t,n,T),s=l.fastSlerp(i,r,n,x);return l.fastSlerp(a,s,2*n*(1-n),o)},l.equals=function(e,t){return e===t||i(e)&&i(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e.x-t.x)<=r&&Math.abs(e.y-t.y)<=r&&Math.abs(e.z-t.z)<=r&&Math.abs(e.w-t.w)<=r},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),i("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g){"use strict";var _={},y=new i,C=new i,E=new i;_.eastNorthUpToFixedFrame=function(e,t,r){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return o(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-a,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new f(0,-a,0,e.x,1,0,0,e.y,0,0,a,e.z,0,0,0,1)}var s=y,l=C,c=E;return t=n(t,u.WGS84),t.geodeticSurfaceNormal(e,s),l.x=-e.y,l.y=e.x,l.z=0,i.normalize(l,l),i.cross(s,l,c),o(r)?(r[0]=l.x,r[1]=l.y,r[2]=l.z,r[3]=0,r[4]=c.x,r[5]=c.y,r[6]=c.z,r[7]=0,r[8]=s.x,r[9]=s.y,r[10]=s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new f(l.x,c.x,s.x,e.x,l.y,c.y,s.y,e.y,l.z,c.z,s.z,e.z,0,0,0,1)};var S=new i,w=new i,T=new i;_.northEastDownToFixedFrame=function(e,t,r){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return o(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new f(-a,0,0,e.x,0,1,0,e.y,0,0,-a,e.z,0,0,0,1)}var s=S,l=w,c=T;return t=n(t,u.WGS84),t.geodeticSurfaceNormal(e,s),l.x=-e.y,l.y=e.x,l.z=0,i.normalize(l,l),i.cross(s,l,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=l.x,r[5]=l.y,r[6]=l.z,r[7]=0,r[8]=-s.x,r[9]=-s.y,r[10]=-s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new f(c.x,l.x,-s.x,e.x,c.y,l.y,-s.y,e.y,c.z,l.z,-s.z,e.z,0,0,0,1)},_.northUpEastToFixedFrame=function(e,t,r){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return o(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=a,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new f(-a,0,0,e.x,0,0,1,e.y,0,a,0,e.z,0,0,0,1)}var s=y,l=C,c=E;return t=n(t,u.WGS84),t.geodeticSurfaceNormal(e,s),l.x=-e.y,l.y=e.x,l.z=0,i.normalize(l,l),i.cross(s,l,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=s.x,r[5]=s.y,r[6]=s.z,r[7]=0,r[8]=l.x,r[9]=l.y,r[10]=l.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new f(c.x,s.x,l.x,e.x,c.y,s.y,l.y,e.y,c.z,s.z,l.z,e.z,0,0,0,1)};var x=new v,b=new i(1,1,1),A=new f;_.headingPitchRollToFixedFrame=function(e,t,r,n,o,a){var s=v.fromHeadingPitchRoll(t,r,n,x),l=f.fromTranslationQuaternionRotationScale(i.ZERO,s,b,A);return a=_.eastNorthUpToFixedFrame(e,o,a),f.multiply(a,l,a)};var P=new f,I=new m;_.headingPitchRollQuaternion=function(e,t,i,r,n,o){var a=_.headingPitchRollToFixedFrame(e,t,i,r,n,P),s=f.getRotation(a,I);return v.fromRotationMatrix(s,o)};var M=24110.54841,D=8640184.812866,R=.093104,O=-62e-7,N=1.1772758384668e-19,L=72921158553e-15,F=p.TWO_PI/86400,B=new d;_.computeTemeToPseudoFixedMatrix=function(e,t){B=d.addSeconds(e,-d.computeTaiMinusUtc(e),B);var i,r=B.dayNumber,n=B.secondsOfDay,a=r-2451545;i=n>=43200?(a+.5)/g.DAYS_PER_JULIAN_CENTURY:(a-.5)/g.DAYS_PER_JULIAN_CENTURY;var s=M+i*(D+i*(R+i*O)),l=s*F%p.TWO_PI,u=L+N*(r-2451545.5),c=(n+.5*g.SECONDS_PER_DAY)%g.SECONDS_PER_DAY,h=l+u*c,f=Math.cos(h),v=Math.sin(h);return o(t)?(t[0]=f,t[1]=-v,t[2]=0,t[3]=v,t[4]=f,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new m(f,v,0,-v,f,0,0,0,1)},_.iau2006XysData=new c,_.earthOrientationParameters=s.NONE;var V=32.184,k=2451545;_.preloadIcrfFixed=function(t){var i=t.start.dayNumber,r=t.start.secondsOfDay+V,n=t.stop.dayNumber,o=t.stop.secondsOfDay+V,a=_.iau2006XysData.preload(i,r,n,o),s=_.earthOrientationParameters.getPromiseToLoad();return e.all([a,s])},_.computeIcrfToFixedMatrix=function(e,t){o(t)||(t=new m);var i=_.computeFixedToIcrfMatrix(e,t);if(o(i))return m.transpose(i,t)};var z=new h(0,0,0),U=new l(0,0,0,0,0,0),G=new m,W=new m;_.computeFixedToIcrfMatrix=function(e,t){o(t)||(t=new m);var i=_.earthOrientationParameters.compute(e,U);if(o(i)){var r=e.dayNumber,n=e.secondsOfDay+V,a=_.iau2006XysData.computeXysRadians(r,n,z);if(o(a)){var s=a.x+i.xPoleOffset,l=a.y+i.yPoleOffset,u=1/(1+Math.sqrt(1-s*s-l*l)),c=G;c[0]=1-u*s*s,c[3]=-u*s*l,c[6]=s,c[1]=-u*s*l,c[4]=1-u*l*l,c[7]=l,c[2]=-s,c[5]=-l,c[8]=1-u*(s*s+l*l);var h=m.fromRotationZ(-a.s,W),f=m.multiply(c,h,G),v=e.dayNumber,y=e.secondsOfDay-d.computeTaiMinusUtc(e)+i.ut1MinusUtc,C=v-2451545,E=y/g.SECONDS_PER_DAY,S=.779057273264+E+.00273781191135448*(C+E);S=S%1*p.TWO_PI;var w=m.fromRotationZ(S,W),T=m.multiply(f,w,G),x=Math.cos(i.xPoleWander),b=Math.cos(i.yPoleWander),A=Math.sin(i.xPoleWander),P=Math.sin(i.yPoleWander),I=r-k+n/g.SECONDS_PER_DAY;I/=36525;var M=-47e-6*I*p.RADIANS_PER_DEGREE/3600,D=Math.cos(M),R=Math.sin(M),O=W;return O[0]=x*D,O[1]=x*R,O[2]=A,O[3]=-b*R+P*A*D,O[4]=b*D+P*A*R,O[5]=-P*x,O[6]=-P*R-b*A*D,O[7]=P*D-b*A*R,O[8]=b*x,m.multiply(T,O,t)}}};var H=new r;_.pointToWindowCoordinates=function(e,t,i,r){return r=_.pointToGLWindowCoordinates(e,t,i,r),r.y=2*t[5]-r.y,r},_.pointToGLWindowCoordinates=function(e,i,n,a){o(a)||(a=new t);var s=H;return f.multiplyByVector(e,r.fromElements(n.x,n.y,n.z,1,s),s),r.multiplyByScalar(s,1/s.w,s),f.multiplyByVector(i,s,s),t.fromCartesian4(s,a)};var q=new i,j=new i,Y=new i;return _.rotationMatrixFromPositionVelocity=function(e,t,r,a){var s=n(r,u.WGS84).geodeticSurfaceNormal(e,q),l=i.cross(t,s,j);i.equalsEpsilon(l,i.ZERO,p.EPSILON6)&&(l=i.clone(i.UNIT_X,l));var c=i.cross(l,t,Y);return i.cross(t,c,l),i.negate(l,l),o(a)||(a=new m),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=l.x,a[4]=l.y,a[5]=l.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a},_}),i("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix3","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e,t){t=n(t,l.WGS84),e=t.scaleToGeodeticSurface(e);var r=m.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=i.fromCartesian4(h.getColumn(r,0,v)),this._yAxis=i.fromCartesian4(h.getColumn(r,1,v));var o=i.fromCartesian4(h.getColumn(r,2,v));this._plane=d.fromPointNormal(e,o)}var v=new r;a(f.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var g=new e;f.fromPoints=function(t,i){var r=e.fromPoints(t,g);return new f(r.center,i)};var _=new p,y=new i;f.prototype.projectPointOntoPlane=function(e,r){var n=_;n.origin=e,i.normalize(e,n.direction);var a=u.rayPlane(n,this._plane,y);if(o(a)||(i.negate(n.direction,n.direction),a=u.rayPlane(n,this._plane,y)),o(a)){var s=i.subtract(a,this._origin,a),l=i.dot(this._xAxis,s),c=i.dot(this._yAxis,s);return o(r)?(r.x=l,r.y=c,r):new t(l,c)}},f.prototype.projectPointsOntoPlane=function(e,t){o(t)||(t=[]);for(var i=0,r=e.length,n=0;r>n;n++){var a=this.projectPointOntoPlane(e[n],t[i]);o(a)&&(t[i]=a,i++)}return t.length=i,t},f.prototype.projectPointToNearestOnPlane=function(e,r){ -o(r)||(r=new t);var n=_;n.origin=e,i.clone(this._plane.normal,n.direction);var a=u.rayPlane(n,this._plane,y);o(a)||(i.negate(n.direction,n.direction),a=u.rayPlane(n,this._plane,y));var s=i.subtract(a,this._origin,a),l=i.dot(this._xAxis,s),c=i.dot(this._yAxis,s);return r.x=l,r.y=c,r},f.prototype.projectPointsToNearestOnPlane=function(e,t){o(t)||(t=[]);var i=e.length;t.length=i;for(var r=0;i>r;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var C=new i;return f.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;o(t)?t.length=r:t=new Array(r);for(var n=this._ellipsoid,a=this._origin,s=this._xAxis,l=this._yAxis,u=C,c=0;r>c;++c){var h=e[c];i.multiplyByScalar(s,h.x,u),o(t[c])||(t[c]=new i);var d=i.add(a,u,t[c]);i.multiplyByScalar(l,h.y,u),i.add(d,u,d),n.scaleToGeocentricSurface(d,d)}return t},f}),i("Core/OrientedBoundingBox",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Intersect","./Interval","./Math","./Matrix3","./Plane","./Rectangle"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e,t){this.center=i.clone(n(e,i.ZERO)),this.halfAxes=d.clone(n(t,d.ZERO))}function v(e,t,r,n,a,s,l,u){o(u)||(u=new f);var c=u.halfAxes;d.setColumn(c,0,e.xAxis,c),d.setColumn(c,1,e.yAxis,c),d.setColumn(c,2,e.zAxis,c);var h=T;h.x=(t+r)/2,h.y=(n+a)/2,h.z=(s+l)/2;var p=x;p.x=(r-t)/2,p.y=(a-n)/2,p.z=(l-s)/2;var m=u.center;return h=d.multiplyByVector(c,h,h),i.add(e.origin,h,m),d.multiplyByScale(c,p,c),u}var g=new i,_=new i,y=new i,C=new i,E=new i,S=new d,w={unitary:new d,diagonal:new d};f.fromPoints=function(e,t){if(o(t)||(t=new f),!o(e)||0===e.length)return t.halfAxes=d.ZERO,t.center=i.ZERO,t;var r,n=e.length,a=i.clone(e[0],g);for(r=1;n>r;r++)i.add(a,e[r],a);var s=1/n;i.multiplyByScalar(a,s,a);var l,u=0,c=0,h=0,p=0,m=0,v=0;for(r=0;n>r;r++)l=i.subtract(e[r],a,_),u+=l.x*l.x,c+=l.x*l.y,h+=l.x*l.z,p+=l.y*l.y,m+=l.y*l.z,v+=l.z*l.z;u*=s,c*=s,h*=s,p*=s,m*=s,v*=s;var T=S;T[0]=u,T[1]=c,T[2]=h,T[3]=c,T[4]=p,T[5]=m,T[6]=h,T[7]=m,T[8]=v;var x=d.computeEigenDecomposition(T,w),b=d.transpose(x.unitary,t.halfAxes);l=i.subtract(e[0],a,_);var A=d.multiplyByVector(b,l,y),P=i.clone(A,C),I=i.clone(A,E);for(r=1;n>r;r++)l=i.subtract(e[r],a,l),d.multiplyByVector(b,l,A),i.minimumByComponent(I,A,I),i.maximumByComponent(P,A,P);var M=i.add(I,P,y);i.multiplyByScalar(M,.5,M),d.multiplyByVector(b,M,M),i.add(a,M,t.center);var D=i.subtract(P,I,y);return i.multiplyByScalar(D,.5,D),d.multiplyByScale(t.halfAxes,D,t.halfAxes),t};var T=new i,x=new i,b=new r,A=new i,P=[new r,new r,new r,new r,new r,new r,new r,new r],I=[new i,new i,new i,new i,new i,new i,new i,new i],M=[new t,new t,new t,new t,new t,new t,new t,new t];f.fromRectangle=function(e,t,i,r,o){t=n(t,0),i=n(i,0),r=n(r,s.WGS84);var a=m.center(e,b),u=r.cartographicToCartesian(a,A),c=new l(u,r),h=c.plane,d=P[0],f=P[1],g=P[2],_=P[3],y=P[4],C=P[5],E=P[6],S=P[7],w=a.longitude,T=e.south<0&&e.north>0?0:a.latitude;E.latitude=C.latitude=y.latitude=e.south,S.latitude=_.latitude=T,d.latitude=f.latitude=g.latitude=e.north,E.longitude=S.longitude=d.longitude=e.west,C.longitude=f.longitude=w,y.longitude=_.longitude=g.longitude=e.east,g.height=f.height=d.height=S.height=E.height=C.height=y.height=_.height=i,r.cartographicArrayToCartesianArray(P,I),c.projectPointsToNearestOnPlane(I,M);var x=Math.min(M[6].x,M[7].x,M[0].x),D=Math.max(M[2].x,M[3].x,M[4].x),R=Math.min(M[4].y,M[5].y,M[6].y),O=Math.max(M[0].y,M[1].y,M[2].y);g.height=d.height=y.height=E.height=t,r.cartographicArrayToCartesianArray(P,I);var N=Math.min(p.getPointDistance(h,I[0]),p.getPointDistance(h,I[2]),p.getPointDistance(h,I[4]),p.getPointDistance(h,I[6])),L=i;return v(c,x,D,R,O,N,L,o)},f.clone=function(e,t){return o(e)?o(t)?(i.clone(e.center,t.center),d.clone(e.halfAxes,t.halfAxes),t):new f(e.center,e.halfAxes):void 0},f.intersectPlane=function(e,t){var r=e.center,n=t.normal,o=e.halfAxes,a=n.x,s=n.y,l=n.z,c=Math.abs(a*o[d.COLUMN0ROW0]+s*o[d.COLUMN0ROW1]+l*o[d.COLUMN0ROW2])+Math.abs(a*o[d.COLUMN1ROW0]+s*o[d.COLUMN1ROW1]+l*o[d.COLUMN1ROW2])+Math.abs(a*o[d.COLUMN2ROW0]+s*o[d.COLUMN2ROW1]+l*o[d.COLUMN2ROW2]),h=i.dot(n,r)+t.distance;return-c>=h?u.OUTSIDE:h>=c?u.INSIDE:u.INTERSECTING};var D=new i,R=new i,O=new i,N=new i;f.distanceSquaredTo=function(e,t){var r=i.subtract(t,e.center,T),n=e.halfAxes,o=d.getColumn(n,0,D),a=d.getColumn(n,1,R),s=d.getColumn(n,2,O),l=i.magnitude(o),u=i.magnitude(a),c=i.magnitude(s);i.normalize(o,o),i.normalize(a,a),i.normalize(s,s);var h=N;h.x=i.dot(r,o),h.y=i.dot(r,a),h.z=i.dot(r,s);var p,m=0;return h.x<-l?(p=h.x+l,m+=p*p):h.x>l&&(p=h.x-l,m+=p*p),h.y<-u?(p=h.y+u,m+=p*p):h.y>u&&(p=h.y-u,m+=p*p),h.z<-c?(p=h.z+c,m+=p*p):h.z>c&&(p=h.z-c,m+=p*p),m};var L=new i,F=new i;f.computePlaneDistances=function(e,t,r,n){o(n)||(n=new c);var a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,l=e.center,u=e.halfAxes,h=d.getColumn(u,0,D),p=d.getColumn(u,1,R),m=d.getColumn(u,2,O),f=i.add(h,p,L);i.add(f,m,f),i.add(f,l,f);var v=i.subtract(f,t,F),g=i.dot(r,v);return a=Math.min(g,a),s=Math.max(g,s),i.add(l,h,f),i.add(f,p,f),i.subtract(f,m,f),i.subtract(f,t,v),g=i.dot(r,v),a=Math.min(g,a),s=Math.max(g,s),i.add(l,h,f),i.subtract(f,p,f),i.add(f,m,f),i.subtract(f,t,v),g=i.dot(r,v),a=Math.min(g,a),s=Math.max(g,s),i.add(l,h,f),i.subtract(f,p,f),i.subtract(f,m,f),i.subtract(f,t,v),g=i.dot(r,v),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,h,f),i.add(f,p,f),i.add(f,m,f),i.subtract(f,t,v),g=i.dot(r,v),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,h,f),i.add(f,p,f),i.subtract(f,m,f),i.subtract(f,t,v),g=i.dot(r,v),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,h,f),i.subtract(f,p,f),i.add(f,m,f),i.subtract(f,t,v),g=i.dot(r,v),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,h,f),i.subtract(f,p,f),i.subtract(f,m,f),i.subtract(f,t,v),g=i.dot(r,v),a=Math.min(g,a),s=Math.max(g,s),n.start=a,n.stop=s,n};var B=new e;return f.isOccluded=function(t,i){var r=e.fromOrientedBoundingBox(t,B);return!i.isBoundingSphereVisible(r)},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,i){return f.computePlaneDistances(this,e,t,i)},f.prototype.isOccluded=function(e){return f.isOccluded(this,e)},f.equals=function(e,t){return e===t||o(e)&&o(t)&&i.equals(e.center,t.center)&&d.equals(e.halfAxes,t.halfAxes)},f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f}),i("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,i,r,n){"use strict";var o={};o.octEncode=function(e,t){if(t.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),t.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var i=t.x,r=t.y;t.x=(1-Math.abs(r))*n.signNotZero(i),t.y=(1-Math.abs(i))*n.signNotZero(r)}return t.x=n.toSNorm(t.x),t.y=n.toSNorm(t.y),t},o.octDecode=function(e,i,r){if(r.x=n.fromSNorm(e),r.y=n.fromSNorm(i),r.z=1-(Math.abs(r.x)+Math.abs(r.y)),r.z<0){var o=r.x;r.x=(1-Math.abs(r.y))*n.signNotZero(o),r.y=(1-Math.abs(o))*n.signNotZero(r.y)}return t.normalize(r,r)},o.octPackFloat=function(e){return 256*e.x+e.y};var a=new e;return o.octEncodeFloat=function(e){return o.octEncode(e,a),o.octPackFloat(a)},o.octDecodeFloat=function(e,t){var i=e/256,r=Math.floor(i),n=256*(i-r);return o.octDecode(r,n,t)},o.octPack=function(e,t,i,r){var n=o.octEncodeFloat(e),s=o.octEncodeFloat(t),l=o.octEncode(i,a);return r.x=65536*l.x+n,r.y=65536*l.y+s,r},o.octUnpack=function(e,t,i,r){var n=e.x/65536,a=Math.floor(n),s=65536*(n-a);n=e.y/65536;var l=Math.floor(n),u=65536*(n-l);o.octDecodeFloat(s,t),o.octDecodeFloat(u,i),o.octDecode(a,l,r)},o.compressTextureCoordinates=function(e){var t=1===e.x?4095:4096*e.x|0,i=1===e.y?4095:4096*e.y|0;return 4096*t+i},o.decompressTextureCoordinates=function(e,t){var i=e/4096;return t.x=Math.floor(i)/4096,t.y=i-Math.floor(i),t},o}),i("Renderer/WebGLConstants",["../Core/freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return e(t)}),i("Core/ComponentDatatype",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,i,r,n,o){"use strict";if(!n.supportsTypedArrays())return{};var a={BYTE:e.BYTE,UNSIGNED_BYTE:e.UNSIGNED_BYTE,SHORT:e.SHORT,UNSIGNED_SHORT:e.UNSIGNED_SHORT,FLOAT:e.FLOAT,DOUBLE:e.DOUBLE};return a.getSizeInBytes=function(e){switch(e){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},a.fromTypedArray=function(e){return e instanceof Int8Array?a.BYTE:e instanceof Uint8Array?a.UNSIGNED_BYTE:e instanceof Int16Array?a.SHORT:e instanceof Uint16Array?a.UNSIGNED_SHORT:e instanceof Float32Array?a.FLOAT:e instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(e){return i(e)&&(e===a.BYTE||e===a.UNSIGNED_BYTE||e===a.SHORT||e===a.UNSIGNED_SHORT||e===a.FLOAT||e===a.DOUBLE)},a.createTypedArray=function(e,t){switch(e){case a.BYTE:return new Int8Array(t);case a.UNSIGNED_BYTE:return new Uint8Array(t);case a.SHORT:return new Int16Array(t);case a.UNSIGNED_SHORT:return new Uint16Array(t);case a.FLOAT:return new Float32Array(t);case a.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},a.createArrayBufferView=function(e,i,n,o){switch(n=t(n,0),o=t(o,(i.byteLength-n)/a.getSizeInBytes(e)),e){case a.BYTE:return new Int8Array(i,n,o);case a.UNSIGNED_BYTE:return new Uint8Array(i,n,o);case a.SHORT:return new Int16Array(i,n,o);case a.UNSIGNED_SHORT:return new Uint16Array(i,n,o);case a.FLOAT:return new Float32Array(i,n,o);case a.DOUBLE:return new Float64Array(i,n,o);default:throw new r("componentDatatype is not a valid value.")}},o(a)}),i("Core/TerrainQuantization",["./freezeObject"],function(e){"use strict";var t={NONE:0,BITS12:1};return e(t)}),i("Core/TerrainEncoding",["./AttributeCompression","./Cartesian2","./Cartesian3","./ComponentDatatype","./defined","./Math","./Matrix3","./Matrix4","./TerrainQuantization"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e,t,r,o,a){var u,d,v,g;if(n(e)&&n(t)&&n(r)&&n(o)){var _=e.minimum,y=e.maximum,C=i.subtract(y,_,h),E=r-t,S=Math.max(i.maximumComponent(C),E);u=f-1>S?l.BITS12:l.NONE,d=e.center,v=s.inverseTransformation(o,new s);var w=i.negate(_,c);s.multiply(s.fromTranslation(w,p),v,v);var T=c;T.x=1/C.x,T.y=1/C.y,T.z=1/C.z,s.multiply(s.fromScale(T,p),v,v),g=s.clone(o),s.setTranslation(g,i.ZERO,g),o=s.clone(o,new s);var x=s.fromTranslation(_,p),b=s.fromScale(C,m),A=s.multiply(x,b,p);s.multiply(o,A,o),s.multiply(g,A,g)}this.quantization=u,this.minimumHeight=t,this.maximumHeight=r,this.center=d,this.toScaledENU=v,this.fromScaledENU=o,this.matrix=g,this.hasVertexNormals=a}var c=new i,h=new i,d=new t,p=new s,m=new s,f=Math.pow(2,12);u.prototype.encode=function(r,n,a,u,h,p){var m=u.x,f=u.y;if(this.quantization===l.BITS12){a=s.multiplyByPoint(this.toScaledENU,a,c),a.x=o.clamp(a.x,0,1),a.y=o.clamp(a.y,0,1),a.z=o.clamp(a.z,0,1);var v=this.maximumHeight-this.minimumHeight,g=o.clamp((h-this.minimumHeight)/v,0,1);t.fromElements(a.x,a.y,d);var _=e.compressTextureCoordinates(d);t.fromElements(a.z,g,d);var y=e.compressTextureCoordinates(d);t.fromElements(m,f,d);var C=e.compressTextureCoordinates(d);r[n++]=_,r[n++]=y,r[n++]=C}else i.subtract(a,this.center,c),r[n++]=c.x,r[n++]=c.y,r[n++]=c.z,r[n++]=h,r[n++]=m,r[n++]=f;return this.hasVertexNormals&&(r[n++]=e.octPackFloat(p)),n},u.prototype.decodePosition=function(t,r,o){if(n(o)||(o=new i),r*=this.getStride(),this.quantization===l.BITS12){var a=e.decompressTextureCoordinates(t[r],d);o.x=a.x,o.y=a.y;var u=e.decompressTextureCoordinates(t[r+1],d);return o.z=u.x,s.multiplyByPoint(this.fromScaledENU,o,o)}return o.x=t[r],o.y=t[r+1],o.z=t[r+2],i.add(o,this.center,o)},u.prototype.decodeTextureCoordinates=function(i,r,o){return n(o)||(o=new t),r*=this.getStride(),this.quantization===l.BITS12?e.decompressTextureCoordinates(i[r+2],o):t.fromElements(i[r+4],i[r+5],o)},u.prototype.decodeHeight=function(t,i){if(i*=this.getStride(),this.quantization===l.BITS12){var r=e.decompressTextureCoordinates(t[i+1],d);return r.y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight}return t[i+3]},u.prototype.getOctEncodedNormal=function(e,i,r){var n=this.getStride();i=(i+1)*n-1;var o=e[i]/256,a=Math.floor(o),s=256*(o-a);return t.fromElements(a,s,r)},u.prototype.getStride=function(){var e;switch(this.quantization){case l.BITS12:e=3;break;default:e=6}return this.hasVertexNormals&&++e,e};var v={position3DAndHeight:0,textureCoordAndEncodedNormals:1},g={compressed:0};return u.prototype.getAttributes=function(e){var t=r.FLOAT;if(this.quantization===l.NONE){var i=r.getSizeInBytes(t),n=4,o=this.hasVertexNormals?3:2,a=(this.hasVertexNormals?7:6)*i;return[{index:v.position3DAndHeight,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:n,offsetInBytes:0,strideInBytes:a},{index:v.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:o,offsetInBytes:n*i,strideInBytes:a}]}var s=3;return s+=this.hasVertexNormals?1:0,[{index:g.compressed,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:s}]},u.prototype.getAttributeLocations=function(){return this.quantization===l.NONE?v:g},u.clone=function(e,t){return n(t)||(t=new u),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=i.clone(e.center),t.toScaledENU=s.clone(e.toScaledENU),t.fromScaledENU=s.clone(e.fromScaledENU),t.matrix=s.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t},u}),i("Core/HeightmapTessellator",["./AxisAlignedBoundingBox","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidalOccluder","./freezeObject","./Math","./Matrix4","./OrientedBoundingBox","./Rectangle","./TerrainEncoding","./Transforms"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";var v={};v.DEFAULT_STRUCTURE=u({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var g=new r,_=new h,y=new r,C=new r;return v.computeVertices=function(a){var u,E,S,w,T=Math.cos,x=Math.sin,b=Math.sqrt,A=Math.atan,P=Math.exp,I=c.PI_OVER_TWO,M=c.toRadians,D=a.heightmap,R=a.width,O=a.height,N=a.skirtHeight,L=n(a.isGeographic,!0),F=n(a.ellipsoid,s.WGS84),B=1/F.maximumRadius,V=a.nativeRectangle,k=a.rectangle;o(k)?(u=k.west,E=k.south,S=k.east,w=k.north):L?(u=M(V.west),E=M(V.south),S=M(V.east),w=M(V.north)):(u=V.west*B,E=I-2*A(P(-V.south*B)),S=V.east*B,w=I-2*A(P(-V.north*B)));var z=n(a.relativeToCenter,r.ZERO),U=n(a.exaggeration,1),G=n(a.structure,v.DEFAULT_STRUCTURE),W=n(G.heightScale,v.DEFAULT_STRUCTURE.heightScale),H=n(G.heightOffset,v.DEFAULT_STRUCTURE.heightOffset),q=n(G.elementsPerHeight,v.DEFAULT_STRUCTURE.elementsPerHeight),j=n(G.stride,v.DEFAULT_STRUCTURE.stride),Y=n(G.elementMultiplier,v.DEFAULT_STRUCTURE.elementMultiplier),X=n(G.isBigEndian,v.DEFAULT_STRUCTURE.isBigEndian),Z=p.computeWidth(V)/(R-1),K=p.computeHeight(V)/(O-1),Q=F.radiiSquared,J=Q.x,$=Q.y,ee=Q.z,te=65536,ie=-65536,re=f.eastNorthUpToFixedFrame(z,F),ne=h.inverseTransformation(re,_),oe=y;oe.x=Number.POSITIVE_INFINITY,oe.y=Number.POSITIVE_INFINITY,oe.z=Number.POSITIVE_INFINITY;var ae=C;ae.x=Number.NEGATIVE_INFINITY,ae.y=Number.NEGATIVE_INFINITY,ae.z=Number.NEGATIVE_INFINITY;var se=Number.POSITIVE_INFINITY,le=R+(N>0?2:0),ue=O+(N>0?2:0),ce=le*ue,he=new Array(ce),de=new Array(ce),pe=new Array(ce),me=0,fe=O,ve=0,ge=R;N>0&&(--me,++fe,--ve,++ge);for(var _e=0,ye=me;fe>ye;++ye){var Ce=ye;0>Ce&&(Ce=0),Ce>=O&&(Ce=O-1);var Ee=V.north-K*Ce;Ee=L?M(Ee):I-2*A(P(-Ee*B));var Se=T(Ee),we=x(Ee),Te=ee*we,xe=(Ee-E)/(w-E);xe=c.clamp(xe,0,1);for(var be=ve;ge>be;++be){var Ae=be;0>Ae&&(Ae=0),Ae>=R&&(Ae=R-1);var Pe=V.west+Z*Ae;L?Pe=M(Pe):Pe*=B;var Ie,Me=Ce*(R*j)+Ae*j;if(1===q)Ie=D[Me];else{Ie=0;var De;if(X)for(De=0;q>De;++De)Ie=Ie*Y+D[Me+De];else for(De=q-1;De>=0;--De)Ie=Ie*Y+D[Me+De]}Ie=(Ie*W+H)*U,ie=Math.max(ie,Ie),te=Math.min(te,Ie),(be!==Ae||ye!==Ce)&&(Ie-=N);var Re=Se*T(Pe),Oe=Se*x(Pe),Ne=J*Re,Le=$*Oe,Fe=b(Ne*Re+Le*Oe+Te*we),Be=1/Fe,Ve=Ne*Be,ke=Le*Be,ze=Te*Be,Ue=new r;Ue.x=Ve+Re*Ie,Ue.y=ke+Oe*Ie,Ue.z=ze+we*Ie,he[_e]=Ue,de[_e]=Ie;var Ge=(Pe-u)/(S-u);Ge=c.clamp(Ge,0,1),pe[_e]=new i(Ge,xe),_e++,h.multiplyByPoint(ne,Ue,g),r.minimumByComponent(g,oe,oe),r.maximumByComponent(g,ae,ae),se=Math.min(se,Ie)}}var We,He=t.fromPoints(he);o(k)&&k.widthJe;++Je)Qe=Ze.encode(Ke,Qe,he[Je],pe[Je],de[Je]);return{vertices:Ke,maximumHeight:ie,minimumHeight:te,encoding:Ze,boundingSphere3D:He,orientedBoundingBox:We,occludeePointInScaledSpace:qe}},v}),i("Core/destroyObject",["./defaultValue","./DeveloperError"],function(e,t){"use strict";function i(){return!0}function r(r,n){function o(){throw new t(n)}n=e(n,"This object was destroyed, i.e., destroy() was called.");for(var a in r)"function"==typeof r[a]&&(r[a]=o);r.isDestroyed=i}return r}),i("Core/isCrossOriginUrl",["./defined"],function(e){"use strict";function t(t){e(i)||(i=document.createElement("a")),i.href=window.location.href;var r=i.host,n=i.protocol;return i.href=t,i.href=i.href,n!==i.protocol||r!==i.host}var i;return t}),i("Core/TaskProcessor",["../ThirdParty/Uri","../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./destroyObject","./DeveloperError","./getAbsoluteUri","./isCrossOriginUrl","./RuntimeError","require"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(){if(!n(v._canTransferArrayBuffer)){var e=new Worker(p("Workers/transferTypedArrayTest.js"));e.postMessage=r(e.webkitPostMessage,e.postMessage);var i=99,o=new Int8Array([i]);try{e.postMessage({array:o},[o.buffer])}catch(a){return v._canTransferArrayBuffer=!1,v._canTransferArrayBuffer}var s=t.defer();e.onmessage=function(t){var r=t.data.array,o=n(r)&&r[0]===i;s.resolve(o),e.terminate(),v._canTransferArrayBuffer=o},v._canTransferArrayBuffer=s.promise}return v._canTransferArrayBuffer}function d(e,t){--e._activeTasks;var i=t.id;if(n(i)){var r=e._deferreds,o=r[i];if(n(t.error)){var s=t.error;"RuntimeError"===s.name?(s=new u(t.error.message),s.stack=t.error.stack):"DeveloperError"===s.name&&(s=new a(t.error.message),s.stack=t.error.stack),o.reject(s)}else o.resolve(t.result);delete r[i]}}function p(e){var t=i(e);if(l(t)){var r,n='importScripts("'+t+'");';try{r=new Blob([n],{type:"application/javascript"})}catch(o){var a=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,s=new a;s.append(n),r=s.getBlob("application/javascript")}var u=window.URL||window.webkitURL;t=u.createObjectURL(r)}return t}function m(){ -return n(g)||(g=p("Workers/cesiumWorkerBootstrapper.js")),g}function f(e){var t=new Worker(m());t.postMessage=r(t.webkitPostMessage,t.postMessage);var o={loaderConfig:{},workerModule:v._workerModulePrefix+e._workerName};return n(v._loaderConfig)?o.loaderConfig=v._loaderConfig:n(c.toUrl)?o.loaderConfig.baseUrl=s("..",i("Workers/cesiumWorkerBootstrapper.js")):o.loaderConfig.paths={Workers:i("Workers")},t.postMessage(o),t.onmessage=function(t){d(e,t.data)},t}function v(e,t){this._workerName=e,this._maximumActiveTasks=r(t,5),this._activeTasks=0,this._deferreds={},this._nextID=0}var g,_=[];return v.prototype.scheduleTask=function(e,i){if(n(this._worker)||(this._worker=f(this)),!(this._activeTasks>=this._maximumActiveTasks)){++this._activeTasks;var r=this;return t(h(),function(o){n(i)?o||(i.length=0):i=_;var a=r._nextID++,s=t.defer();return r._deferreds[a]=s,r._worker.postMessage({id:a,parameters:e,canTransferArrayBuffer:o},i),s.promise})}},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){return n(this._worker)&&this._worker.terminate(),o(this)},v._defaultWorkerModulePrefix="Workers/",v._workerModulePrefix=v._defaultWorkerModulePrefix,v._loaderConfig=void 0,v._canTransferArrayBuffer=void 0,v}),i("Core/TerrainMesh",["../Core/defaultValue"],function(e){"use strict";function t(t,i,r,n,o,a,s,l,u,c){this.center=t,this.vertices=i,this.stride=e(l,6),this.indices=r,this.minimumHeight=n,this.maximumHeight=o,this.boundingSphere3D=a,this.occludeePointInScaledSpace=s,this.orientedBoundingBox=u,this.encoding=c}return t}),i("Core/TerrainProvider",["./defined","./defineProperties","./DeveloperError","./Math"],function(e,t,i,r){"use strict";function n(){i.throwInstantiationError()}t(n.prototype,{errorEvent:{get:i.throwInstantiationError},credit:{get:i.throwInstantiationError},tilingScheme:{get:i.throwInstantiationError},ready:{get:i.throwInstantiationError},readyPromise:{get:i.throwInstantiationError},hasWaterMask:{get:i.throwInstantiationError},hasVertexNormals:{get:i.throwInstantiationError}});var o=[];return n.getRegularGridIndices=function(t,i){var r=o[t];e(r)||(o[t]=r=[]);var n=r[i];if(!e(n)){n=r[i]=new Uint16Array((t-1)*(i-1)*6);for(var a=0,s=0,l=0;i-1>l;++l){for(var u=0;t-1>u;++u){var c=a,h=c+t,d=h+1,p=c+1;n[s++]=c,n[s++]=h,n[s++]=p,n[s++]=p,n[s++]=h,n[s++]=d,++a}++a}}return n},n.heightmapTerrainQuality=.25,n.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,i){return 2*e.maximumRadius*Math.PI*n.heightmapTerrainQuality/(t*i)},n.prototype.requestTileGeometry=i.throwInstantiationError,n.prototype.getLevelMaximumGeometricError=i.throwInstantiationError,n.prototype.getTileDataAvailable=i.throwInstantiationError,n}),i("Core/HeightmapTerrainData",["../ThirdParty/when","./defaultValue","./defined","./defineProperties","./DeveloperError","./GeographicTilingScheme","./HeightmapTessellator","./Math","./Rectangle","./TaskProcessor","./TerrainEncoding","./TerrainMesh","./TerrainProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=t(e.childTileMask,15);var r=a.DEFAULT_STRUCTURE,n=e.structure;i(n)?n!==r&&(n.heightScale=t(n.heightScale,r.heightScale),n.heightOffset=t(n.heightOffset,r.heightOffset),n.elementsPerHeight=t(n.elementsPerHeight,r.elementsPerHeight),n.stride=t(n.stride,r.stride),n.elementMultiplier=t(n.elementMultiplier,r.elementMultiplier),n.isBigEndian=t(n.isBigEndian,r.isBigEndian)):n=r,this._structure=n,this._createdByUpsampling=t(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0}function m(e,t,i,r,n,o,a,s,l,u){var c=(l-o.west)*(a-1)/(o.east-o.west),h=(u-o.south)*(s-1)/(o.north-o.south),d=0|c,p=d+1;p>=a&&(p=a-1,d=a-2);var m=0|h,f=m+1;f>=s&&(f=s-1,m=s-2);var _=c-d,y=h-m;m=s-1-m,f=s-1-f;var C=g(e,t,i,r,n,m*a+d),E=g(e,t,i,r,n,m*a+p),S=g(e,t,i,r,n,f*a+d),w=g(e,t,i,r,n,f*a+p);return v(_,y,C,E,S,w)}function f(e,t,i,r,n,o,a,s,l,u){var c=(l-o.west)*(a-1)/(o.east-o.west),h=(u-o.south)*(s-1)/(o.north-o.south);n>0&&(c+=1,h+=1,a+=2,s+=2);var d=n>0?a-1:a,p=0|c,m=p+1;m>=d&&(m=a-1,p=a-2);var f=n>0?s-1:s,g=0|h,_=g+1;_>=f&&(_=s-1,g=s-2);var y=c-p,C=h-g;g=s-1-g,_=s-1-_;var E=(t.decodeHeight(e,g*a+p)-i)/r,S=(t.decodeHeight(e,g*a+m)-i)/r,w=(t.decodeHeight(e,_*a+p)-i)/r,T=(t.decodeHeight(e,_*a+m)-i)/r;return v(y,C,E,S,w,T)}function v(e,t,i,r,n,o){return e>t?i+e*(r-i)+t*(o-r):i+e*(o-n)+t*(n-i)}function g(e,t,i,r,n,o){o*=r;var a,s=0;if(n)for(a=0;t>a;++a)s=s*i+e[o+a];else for(a=t-1;a>=0;--a)s=s*i+e[o+a];return s}function _(e,t,i,r,n,o,a,s){a*=n;var l;if(o)for(l=0;t>l;++l)e[a+l]=s/r,s-=e[a+l]*r,r/=i;else for(l=t-1;l>=0;--l)e[a+l]=s/r,s-=e[a+l]*r,r/=i}r(p.prototype,{waterMask:{get:function(){return this._waterMask}}});var y=new u("createVerticesFromHeightmap");return p.prototype.createMesh=function(r,n,a,s,u){var p=r.ellipsoid,m=r.tileXYToNativeRectangle(n,a,s),f=r.tileXYToRectangle(n,a,s);u=t(u,1);var v=p.cartographicToCartesian(l.center(f)),g=this._structure,_=d.getEstimatedLevelZeroGeometricErrorForAHeightmap(p,this._width,r.getNumberOfXTilesAtLevel(0)),C=_/(1<I;++I)for(var M=s.lerp(S.north,S.south,I/(c-1)),D=0;u>D;++D){var R=s.lerp(S.west,S.east,D/(u-1)),O=f(y,C,w,T,d,E,u,c,R,M);_(v,x,b,P,m,A,I*u+D,O)}return new p({buffer:v,width:u,height:c,childTileMask:0,structure:this._structure,createdByUpsampling:!0})}},p.prototype.isChildAvailable=function(e,t,i,r){var n=2;return i!==2*e&&++n,r!==2*t&&(n-=2),0!==(this._childTileMask&1<=n.maximumRequestsPerServer?void 0:(o[l]=u+1,t(a(e,s),function(e){return o[l]--,e}).otherwise(function(e){return o[l]--,t.reject(e)}))}var o={},a="undefined"!=typeof document?new e(document.location.href):new e;return n.maximumRequestsPerServer=6,n}),i("Core/ArcGisImageServerTerrainProvider",["../ThirdParty/when","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Event","./GeographicTilingScheme","./getImagePixels","./HeightmapTerrainData","./loadImage","./Math","./TerrainProvider","./throttleRequestByServer"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(n){this._url=n.url,this._token=n.token,this._tilingScheme=n.tilingScheme,r(this._tilingScheme)||(this._tilingScheme=new l({ellipsoid:i(n.ellipsoid,a.WGS84)})),this._heightmapWidth=65,this._levelZeroMaximumGeometricError=p.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,this._heightmapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._proxy=n.proxy,this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0},this._errorEvent=new s;var o=n.credit;"string"==typeof o&&(o=new t(o)),this._credit=o,this._readyPromise=e.resolve(!0)}return n(f.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),f.prototype.requestTileGeometry=function(t,i,n){var o=this._tilingScheme.tileXYToRectangle(t,i,n),a=(o.east-o.west)/(this._heightmapWidth-1),s=(o.north-o.south)/(this._heightmapWidth-1);o.west-=.5*a,o.east+=.5*a,o.south-=.5*s,o.north+=.5*s;var l=d.toDegrees(o.west)+"%2C"+d.toDegrees(o.south)+"%2C"+d.toDegrees(o.east)+"%2C"+d.toDegrees(o.north),p=this._url+"/exportImage?interpolation=RSP_BilinearInterpolation&format=tiff&f=image&size="+this._heightmapWidth+"%2C"+this._heightmapWidth+"&bboxSR=4326&imageSR=4326&bbox="+l;this._token&&(p+="&token="+this._token);var f=this._proxy;r(f)&&(p=f.getURL(p));var v=m(p,h);if(r(v)){var g=this;return e(v,function(e){return new c({buffer:u(e),width:g._heightmapWidth,height:g._heightmapWidth,childTileMask:15,structure:g._terrainDataStructure})})}},f.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<0&&(this._hash={},e.length=0)},r}),i("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,i,r){"use strict";function n(r,n,l,u,c){i(c)||(c=new t);var h,d,p,m,f,v,g,_;i(n.z)?(h=t.subtract(l,n,o),d=t.subtract(u,n,a),p=t.subtract(r,n,s),m=t.dot(h,h),f=t.dot(h,d),v=t.dot(h,p),g=t.dot(d,d),_=t.dot(d,p)):(h=e.subtract(l,n,o),d=e.subtract(u,n,a),p=e.subtract(r,n,s),m=e.dot(h,h),f=e.dot(h,d),v=e.dot(h,p),g=e.dot(d,d),_=e.dot(d,p));var y=1/(m*g-f*f);return c.y=(g*v-f*_)*y,c.z=(m*_-f*v)*y,c.x=1-c.y-c.z,c}var o=new t,a=new t,s=new t;return n}),i("Core/BingMapsApi",["./defined"],function(e){"use strict";var t={};t.defaultKey=void 0;var i=!1;return t.getKey=function(r){return e(r)?r:e(t.defaultKey)?t.defaultKey:(i||(console.log("This application is using Cesium's default Bing Maps key. Please create a new key for the application as soon as possible and prior to deployment by visiting https://www.bingmapsportal.com/, and provide your key to Cesium by setting the Cesium.BingMapsApi.defaultKey property before constructing the CesiumWidget or any other object that uses the Bing Maps API."),i=!0),"Aj1ony_-Typ-KjG9SJWiKSHY23U1KmK7yAmZa9lDmuF2osXWkcZ22VPsqmCt0TCt")},t}),i("Core/BoundingRectangle",["./Cartesian2","./Cartographic","./defaultValue","./defined","./DeveloperError","./GeographicProjection","./Intersect","./Rectangle"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t,r,n){this.x=i(e,0),this.y=i(t,0),this.width=i(r,0),this.height=i(n,0)}l.fromPoints=function(e,t){if(r(t)||(t=new l),!r(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;for(var i=e.length,n=e[0].x,o=e[0].y,a=e[0].x,s=e[0].y,u=1;i>u;u++){var c=e[u],h=c.x,d=c.y;n=Math.min(h,n),a=Math.max(h,a),o=Math.min(d,o),s=Math.max(d,s)}return t.x=n,t.y=o,t.width=a-n,t.height=s-o,t};var u=new o,c=new t,h=new t;return l.fromRectangle=function(t,n,o){if(r(o)||(o=new l),!r(t))return o.x=0,o.y=0,o.width=0,o.height=0,o;n=i(n,u);var a=n.project(s.southwest(t,c)),d=n.project(s.northeast(t,h));return e.subtract(d,a,d),o.x=a.x,o.y=a.y,o.width=d.x,o.height=d.y,o},l.clone=function(e,t){return r(e)?r(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new l(e.x,e.y,e.width,e.height):void 0},l.union=function(e,t,i){r(i)||(i=new l);var n=Math.min(e.x,t.x),o=Math.min(e.y,t.y),a=Math.max(e.x+e.width,t.x+t.width),s=Math.max(e.y+e.height,t.y+t.height);return i.x=n,i.y=o,i.width=a-n,i.height=s-o,i},l.expand=function(e,t,i){i=l.clone(e,i);var r=t.x-i.x,n=t.y-i.y;return r>i.width?i.width=r:0>r&&(i.width-=r,i.x=t.x),n>i.height?i.height=n:0>n&&(i.height-=n,i.y=t.y),i},l.intersect=function(e,t){var i=e.x,r=e.y,n=t.x,o=t.y;return i>n+t.width||i+e.widtho+t.height?a.OUTSIDE:a.INTERSECTING},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.intersect=function(e){return l.intersect(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l}),i("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),i("Core/PrimitiveType",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"use strict";var i={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(e){return e===i.POINTS||e===i.LINES||e===i.LINE_LOOP||e===i.LINE_STRIP||e===i.TRIANGLES||e===i.TRIANGLE_STRIP||e===i.TRIANGLE_FAN}};return t(i)}),i("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,i,r,n){"use strict";function o(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,n.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=void 0}return o.computeNumberOfVertices=function(e){var r=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var o=e.attributes[n],a=o.values.length/o.componentsPerAttribute;if(r!==a&&-1!==r)throw new i("All attribute lists must have the same number of attributes.");r=a}return r},o}),i("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),i("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color}return t}),i("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,i,r){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.binormal=e(t.binormal,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return n.POSITION_ONLY=r(new n({position:!0})),n.POSITION_AND_NORMAL=r(new n({position:!0,normal:!0})),n.POSITION_NORMAL_AND_ST=r(new n({position:!0,normal:!0,st:!0})),n.POSITION_AND_ST=r(new n({position:!0,st:!0})),n.POSITION_AND_COLOR=r(new n({position:!0,color:!0})),n.ALL=r(new n({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),n.DEFAULT=n.POSITION_NORMAL_AND_ST,n.packedLength=6,n.pack=function(t,i,r){r=e(r,0),i[r++]=t.position?1:0,i[r++]=t.normal?1:0,i[r++]=t.st?1:0,i[r++]=t.binormal?1:0,i[r++]=t.tangent?1:0,i[r++]=t.color?1:0},n.unpack=function(i,r,o){return r=e(r,0),t(o)||(o=new n),o.position=1===i[r++],o.normal=1===i[r++],o.st=1===i[r++],o.binormal=1===i[r++],o.tangent=1===i[r++],o.color=1===i[r++],o},n.clone=function(e,i){return t(e)?(t(i)||(i=new n),i.position=e.position,i.normal=e.normal,i.st=e.st,i.binormal=e.binormal,i.tangent=e.tangent,i.color=e.color,i):void 0},n}),i("Core/BoxGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e){e=r(e,r.EMPTY_OBJECT);var i=e.minimum,n=e.maximum,o=r(e.vertexFormat,c.DEFAULT);this._minimum=t.clone(i),this._maximum=t.clone(n),this._vertexFormat=o,this._workerName="createBoxGeometry"}var d=new t;h.fromDimensions=function(e){e=r(e,r.EMPTY_OBJECT);var i=e.dimensions,n=t.multiplyByScalar(i,.5,new t);return new h({minimum:t.negate(n,new t),maximum:n,vertexFormat:e.vertexFormat})},h.fromAxisAlignedBoundingBox=function(e){if(!n(e))throw new o("boundingBox is required.");return new h({minimum:e.minimum,maximum:e.maximum})},h.fromAxisAlignedBoundingBox=function(e){if(!n(e))throw new o("boundingBox is required.");return new h({minimum:e.minimum,maximum:e.maximum})},h.packedLength=2*t.packedLength+c.packedLength,h.pack=function(e,i,n){n=r(n,0),t.pack(e._minimum,i,n),t.pack(e._maximum,i,n+t.packedLength),c.pack(e._vertexFormat,i,n+2*t.packedLength)};var p=new t,m=new t,f=new c,v={minimum:p,maximum:m,vertexFormat:f};return h.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,p),s=t.unpack(e,i+t.packedLength,m),l=c.unpack(e,i+2*t.packedLength,f);return n(o)?(o._minimum=t.clone(a,o._minimum),o._maximum=t.clone(s,o._maximum),o._vertexFormat=c.clone(l,o._vertexFormat),o):new h(v)},h.createGeometry=function(r){var n,o,c=r._minimum,h=r._maximum,p=r._vertexFormat,m=new l;if(p.position&&(p.st||p.normal||p.binormal||p.tangent)){if(p.position&&(o=new Float64Array(72),o[0]=c.x,o[1]=c.y,o[2]=h.z,o[3]=h.x,o[4]=c.y,o[5]=h.z,o[6]=h.x,o[7]=h.y,o[8]=h.z,o[9]=c.x,o[10]=h.y,o[11]=h.z,o[12]=c.x,o[13]=c.y,o[14]=c.z,o[15]=h.x,o[16]=c.y,o[17]=c.z,o[18]=h.x,o[19]=h.y,o[20]=c.z,o[21]=c.x,o[22]=h.y,o[23]=c.z,o[24]=h.x,o[25]=c.y,o[26]=c.z,o[27]=h.x,o[28]=h.y,o[29]=c.z,o[30]=h.x,o[31]=h.y,o[32]=h.z,o[33]=h.x,o[34]=c.y,o[35]=h.z,o[36]=c.x,o[37]=c.y,o[38]=c.z,o[39]=c.x,o[40]=h.y,o[41]=c.z,o[42]=c.x,o[43]=h.y,o[44]=h.z,o[45]=c.x,o[46]=c.y,o[47]=h.z,o[48]=c.x,o[49]=h.y,o[50]=c.z,o[51]=h.x,o[52]=h.y,o[53]=c.z,o[54]=h.x,o[55]=h.y,o[56]=h.z,o[57]=c.x,o[58]=h.y,o[59]=h.z,o[60]=c.x,o[61]=c.y,o[62]=c.z,o[63]=h.x,o[64]=c.y,o[65]=c.z,o[66]=h.x,o[67]=c.y,o[68]=h.z,o[69]=c.x,o[70]=c.y,o[71]=h.z,m.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:o})),p.normal){var f=new Float32Array(72);f[0]=0,f[1]=0,f[2]=1,f[3]=0,f[4]=0,f[5]=1,f[6]=0,f[7]=0,f[8]=1,f[9]=0,f[10]=0,f[11]=1,f[12]=0,f[13]=0,f[14]=-1,f[15]=0,f[16]=0,f[17]=-1,f[18]=0,f[19]=0,f[20]=-1,f[21]=0,f[22]=0,f[23]=-1,f[24]=1,f[25]=0,f[26]=0,f[27]=1,f[28]=0,f[29]=0,f[30]=1,f[31]=0,f[32]=0,f[33]=1,f[34]=0,f[35]=0,f[36]=-1,f[37]=0,f[38]=0,f[39]=-1,f[40]=0,f[41]=0,f[42]=-1,f[43]=0,f[44]=0,f[45]=-1,f[46]=0,f[47]=0,f[48]=0,f[49]=1,f[50]=0,f[51]=0,f[52]=1,f[53]=0,f[54]=0,f[55]=1,f[56]=0,f[57]=0,f[58]=1,f[59]=0,f[60]=0,f[61]=-1,f[62]=0,f[63]=0,f[64]=-1,f[65]=0,f[66]=0,f[67]=-1,f[68]=0,f[69]=0,f[70]=-1,f[71]=0,m.normal=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:f})}if(p.st){var v=new Float32Array(48);v[0]=0,v[1]=0,v[2]=1,v[3]=0,v[4]=1,v[5]=1,v[6]=0,v[7]=1,v[8]=1,v[9]=0,v[10]=0,v[11]=0,v[12]=0,v[13]=1,v[14]=1,v[15]=1,v[16]=0,v[17]=0,v[18]=1,v[19]=0,v[20]=1,v[21]=1,v[22]=0,v[23]=1,v[24]=1,v[25]=0,v[26]=0,v[27]=0,v[28]=0,v[29]=1,v[30]=1,v[31]=1,v[32]=1,v[33]=0,v[34]=0,v[35]=0,v[36]=0,v[37]=1,v[38]=1,v[39]=1,v[40]=0,v[41]=0,v[42]=1,v[43]=0,v[44]=1,v[45]=1,v[46]=0,v[47]=1,m.st=new s({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:v})}if(p.tangent){var g=new Float32Array(72);g[0]=1,g[1]=0,g[2]=0,g[3]=1,g[4]=0,g[5]=0,g[6]=1,g[7]=0,g[8]=0,g[9]=1,g[10]=0,g[11]=0,g[12]=-1,g[13]=0,g[14]=0,g[15]=-1,g[16]=0,g[17]=0,g[18]=-1,g[19]=0,g[20]=0,g[21]=-1,g[22]=0,g[23]=0,g[24]=0,g[25]=1,g[26]=0,g[27]=0,g[28]=1,g[29]=0,g[30]=0,g[31]=1,g[32]=0,g[33]=0,g[34]=1,g[35]=0,g[36]=0,g[37]=-1,g[38]=0,g[39]=0,g[40]=-1,g[41]=0,g[42]=0,g[43]=-1,g[44]=0,g[45]=0,g[46]=-1,g[47]=0,g[48]=-1,g[49]=0,g[50]=0,g[51]=-1,g[52]=0,g[53]=0,g[54]=-1,g[55]=0,g[56]=0,g[57]=-1,g[58]=0,g[59]=0,g[60]=1,g[61]=0,g[62]=0,g[63]=1,g[64]=0,g[65]=0,g[66]=1,g[67]=0,g[68]=0,g[69]=1,g[70]=0,g[71]=0,m.tangent=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:g})}if(p.binormal){var _=new Float32Array(72);_[0]=0,_[1]=1,_[2]=0,_[3]=0,_[4]=1,_[5]=0,_[6]=0,_[7]=1,_[8]=0,_[9]=0,_[10]=1,_[11]=0,_[12]=0,_[13]=1,_[14]=0,_[15]=0,_[16]=1,_[17]=0,_[18]=0,_[19]=1,_[20]=0,_[21]=0,_[22]=1,_[23]=0,_[24]=0,_[25]=0,_[26]=1,_[27]=0,_[28]=0,_[29]=1,_[30]=0,_[31]=0,_[32]=1,_[33]=0,_[34]=0,_[35]=1,_[36]=0,_[37]=0,_[38]=1,_[39]=0,_[40]=0,_[41]=1,_[42]=0,_[43]=0,_[44]=1,_[45]=0,_[46]=0,_[47]=1,_[48]=0,_[49]=0,_[50]=1,_[51]=0,_[52]=0,_[53]=1,_[54]=0,_[55]=0,_[56]=1,_[57]=0,_[58]=0,_[59]=1,_[60]=0,_[61]=0,_[62]=1,_[63]=0,_[64]=0,_[65]=1,_[66]=0,_[67]=0,_[68]=1,_[69]=0,_[70]=0,_[71]=1,m.binormal=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:_})}n=new Uint16Array(36),n[0]=0,n[1]=1,n[2]=2,n[3]=0,n[4]=2,n[5]=3,n[6]=6,n[7]=5,n[8]=4,n[9]=7,n[10]=6,n[11]=4,n[12]=8,n[13]=9,n[14]=10,n[15]=8,n[16]=10,n[17]=11,n[18]=14,n[19]=13,n[20]=12,n[21]=15,n[22]=14,n[23]=12,n[24]=18,n[25]=17,n[26]=16,n[27]=19,n[28]=18,n[29]=16,n[30]=20,n[31]=21,n[32]=22,n[33]=20,n[34]=22,n[35]=23}else o=new Float64Array(24),o[0]=c.x,o[1]=c.y,o[2]=c.z,o[3]=h.x,o[4]=c.y,o[5]=c.z,o[6]=h.x,o[7]=h.y,o[8]=c.z,o[9]=c.x,o[10]=h.y,o[11]=c.z,o[12]=c.x,o[13]=c.y,o[14]=h.z,o[15]=h.x,o[16]=c.y,o[17]=h.z,o[18]=h.x,o[19]=h.y,o[20]=h.z,o[21]=c.x,o[22]=h.y,o[23]=h.z,m.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:o}),n=new Uint16Array(36),n[0]=4,n[1]=5,n[2]=6,n[3]=4,n[4]=6,n[5]=7,n[6]=1,n[7]=0,n[8]=3,n[9]=1,n[10]=3,n[11]=2,n[12]=1,n[13]=6,n[14]=5,n[15]=1,n[16]=2,n[17]=6,n[18]=2,n[19]=3,n[20]=7,n[21]=2,n[22]=7,n[23]=6,n[24]=3,n[25]=0,n[26]=4,n[27]=3,n[28]=4,n[29]=7,n[30]=0,n[31]=1,n[32]=5,n[33]=0,n[34]=5,n[35]=4;var y=t.subtract(h,c,d),C=.5*t.magnitude(y);return new a({attributes:m,indices:n,primitiveType:u.TRIANGLES,boundingSphere:new e(t.ZERO,C)})},h}),i("Core/BoxOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e){e=r(e,r.EMPTY_OBJECT);var i=e.minimum,n=e.maximum;this._min=t.clone(i),this._max=t.clone(n),this._workerName="createBoxOutlineGeometry"}var h=new t;c.fromDimensions=function(e){e=r(e,r.EMPTY_OBJECT);var i=e.dimensions,n=t.multiplyByScalar(i,.5,new t);return new c({minimum:t.negate(n,new t),maximum:n})},c.fromAxisAlignedBoundingBox=function(e){if(!n(e))throw new o("boundingBox is required.");return new c({minimum:e.minimum,maximum:e.maximum})},c.packedLength=2*t.packedLength,c.pack=function(e,i,n){n=r(n,0),t.pack(e._min,i,n),t.pack(e._max,i,n+t.packedLength)};var d=new t,p=new t,m={minimum:d,maximum:p};return c.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,d),s=t.unpack(e,i+t.packedLength,p);return n(o)?(o._min=t.clone(a,o._min),o._max=t.clone(s,o._max),o):new c(m)},c.createGeometry=function(r){var n=r._min,o=r._max,c=new l,d=new Uint16Array(24),p=new Float64Array(24);p[0]=n.x,p[1]=n.y,p[2]=n.z,p[3]=o.x,p[4]=n.y,p[5]=n.z,p[6]=o.x,p[7]=o.y,p[8]=n.z,p[9]=n.x,p[10]=o.y,p[11]=n.z,p[12]=n.x,p[13]=n.y,p[14]=o.z,p[15]=o.x,p[16]=n.y,p[17]=o.z,p[18]=o.x,p[19]=o.y,p[20]=o.z,p[21]=n.x,p[22]=o.y,p[23]=o.z,c.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:p}),d[0]=4,d[1]=5,d[2]=5,d[3]=6,d[4]=6,d[5]=7,d[6]=7,d[7]=4,d[8]=0,d[9]=1,d[10]=1,d[11]=2,d[12]=2,d[13]=3,d[14]=3,d[15]=0,d[16]=0,d[17]=4,d[18]=1,d[19]=5,d[20]=2,d[21]=6,d[22]=3,d[23]=7;var m=t.subtract(o,n,h),f=.5*t.magnitude(m);return new a({attributes:c,indices:d,primitiveType:u.LINES,boundingSphere:new e(t.ZERO,f)})},c}),i("Core/cancelAnimationFrame",["./defined"],function(e){"use strict";function t(e){i(e)}if("undefined"!=typeof window){var i=window.cancelAnimationFrame;return function(){if(!e(i))for(var t=["webkit","moz","ms","o"],r=0,n=t.length;n>r&&!e(i);)i=window[t[r]+"CancelAnimationFrame"],e(i)||(i=window[t[r]+"CancelRequestAnimationFrame"]),++r;e(i)||(i=clearTimeout)}(),t}}),i("Core/Spline",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(){this.times=void 0,this.points=void 0,i.throwInstantiationError()}return r.prototype.evaluate=i.throwInstantiationError,r.prototype.findTimeInterval=function(t,i){var r=this.times,n=r.length;if(i=e(i,0),t>=r[i]){if(n>i+1&&ti+2&&t=0&&t>=r[i-1])return i-1;var o;if(t>r[i])for(o=i;n-1>o&&!(t>=r[o]&&t=0&&!(t>=r[o]&&t=0;--o)l[o]=e.subtract(s[o],e.multiplyByScalar(l[o+1],a[o],l[o]),l[o]);return l},r}),i("Core/HermiteSpline",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./LinearSpline","./Matrix4","./Spline","./TridiagonalSystemSolver"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t,i,n){var o=p,a=f,s=m,l=v;o.length=a.length=t.length-1,s.length=l.length=t.length;var c;o[0]=s[0]=1,a[0]=0;var h=l[0];for(r(h)||(h=l[0]=new e),e.clone(i,h),c=1;c2&&(r(a)||(a=m,e.multiplyByScalar(n[1],2,a),e.subtract(a,n[2],a),e.subtract(a,n[0],a),e.multiplyByScalar(a,.5,a)),!r(s))){var l=n.length-1;s=f,e.multiplyByScalar(n[l-1],2,s),e.subtract(n[l],s,s),e.add(s,n[l-2],s),e.multiplyByScalar(s,.5,s)}this._times=o,this._points=n,this._firstTangent=e.clone(a),this._lastTangent=e.clone(s),this._evaluateFunction=u(this),this._lastTimeIndex=0}var h=new t,d=new e,p=new e,m=new e,f=new e;return n(c.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points; -}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}}),c.catmullRomCoefficientMatrix=new s(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0),c.prototype.findTimeInterval=l.prototype.findTimeInterval,c.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},c}),i("Core/IndexDatatype",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n){"use strict";var o={UNSIGNED_BYTE:e.UNSIGNED_BYTE,UNSIGNED_SHORT:e.UNSIGNED_SHORT,UNSIGNED_INT:e.UNSIGNED_INT};return o.getSizeInBytes=function(e){switch(e){case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},o.validate=function(e){return t(e)&&(e===o.UNSIGNED_BYTE||e===o.UNSIGNED_SHORT||e===o.UNSIGNED_INT)},o.createTypedArray=function(e,t){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},o.createTypedArrayFromArrayBuffer=function(e,t,i,r){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,i,r):new Uint16Array(t,i,r)},r(o)}),i("Core/definedNotNull",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),i("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./definedNotNull","./DeveloperError"],function(e,t,i,r,n){"use strict";function o(n,o,a){a=t(a,!0),n instanceof e||(n=new e(n)),o instanceof e||(o=new e(o)),r(o.authority)&&!r(o.scheme)&&("undefined"!=typeof document&&i(document.location)&&i(document.location.href)?o.scheme=new e(document.location.href).scheme:o.scheme=n.scheme);var s=n;o.isAbsolute()&&(s=o);var l="";r(s.scheme)&&(l+=s.scheme+":"),r(s.authority)&&(l+="//"+s.authority,""!==s.path&&(l=l.replace(/\/?$/,"/"),s.path=s.path.replace(/^\/?/g,""))),l+=s===n?a?n.path.replace(/\/?$/,"/")+o.path.replace(/^\/?/g,""):n.path+o.path:o.path;var u=r(n.query),c=r(o.query);u&&c?l+="?"+n.query+"&"+o.query:u&&!c?l+="?"+n.query:!u&&c&&(l+="?"+o.query);var h=r(o.fragment);return r(n.fragment)&&!h?l+="#"+n.fragment:h&&(l+="#"+o.fragment),l}return o}),i("Core/loadArrayBuffer",["./loadWithXhr","./defined"],function(e,t){"use strict";function i(i,r){return e({url:i,responseType:"arraybuffer",headers:t(r)?r.headers:void 0,overrideMimeType:t(r)?r.overrideMimeType:void 0,withCredentials:t(r)?r.withCredentials:void 0})}return i}),i("Core/Intersections2D",["./Cartesian3","./defined","./DeveloperError"],function(e,t,i){"use strict";var r={};return r.clipTriangleAtAxisAlignedThreshold=function(e,i,r,n,o,a){t(a)?a.length=0:a=[];var s,l,u;i?(s=e>r,l=e>n,u=e>o):(s=r>e,l=n>e,u=o>e);var c,h,d,p,m,f,v=s+l+u;return 1===v?s?(c=(e-r)/(n-r),h=(e-r)/(o-r),a.push(1),a.push(2),1!==h&&(a.push(-1),a.push(0),a.push(2),a.push(h)),1!==c&&(a.push(-1),a.push(0),a.push(1),a.push(c))):l?(d=(e-n)/(o-n),p=(e-n)/(r-n),a.push(2),a.push(0),1!==p&&(a.push(-1),a.push(1),a.push(0),a.push(p)),1!==d&&(a.push(-1),a.push(1),a.push(2),a.push(d))):u&&(m=(e-o)/(r-o),f=(e-o)/(n-o),a.push(0),a.push(1),1!==f&&(a.push(-1),a.push(2),a.push(1),a.push(f)),1!==m&&(a.push(-1),a.push(2),a.push(0),a.push(m))):2===v?s||r===e?l||n===e?u||o===e||(h=(e-r)/(o-r),d=(e-n)/(o-n),a.push(2),a.push(-1),a.push(0),a.push(2),a.push(h),a.push(-1),a.push(1),a.push(2),a.push(d)):(f=(e-o)/(n-o),c=(e-r)/(n-r),a.push(1),a.push(-1),a.push(2),a.push(1),a.push(f),a.push(-1),a.push(0),a.push(1),a.push(c)):(p=(e-n)/(r-n),m=(e-o)/(r-o),a.push(0),a.push(-1),a.push(1),a.push(0),a.push(p),a.push(-1),a.push(2),a.push(0),a.push(m)):3!==v&&(a.push(0),a.push(1),a.push(2)),a},r.computeBarycentricCoordinates=function(i,r,n,o,a,s,l,u,c){var h=n-l,d=l-a,p=s-u,m=o-u,f=1/(p*h+d*m),v=r-u,g=i-l,_=(p*g+d*v)*f,y=(-m*g+h*v)*f,C=1-_-y;return t(c)?(c.x=_,c.y=y,c.z=C,c):new e(_,y,C)},r}),i("Core/QuantizedMeshTerrainData",["../ThirdParty/when","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./IndexDatatype","./Intersections2D","./Math","./OrientedBoundingBox","./TaskProcessor","./TerrainEncoding","./TerrainMesh"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e){function t(e,t){return a[e]-a[t]}function i(e,t){return o[e]-o[t]}this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint;var r=this._quantizedVertices.length/3,o=this._uValues=this._quantizedVertices.subarray(0,r),a=this._vValues=this._quantizedVertices.subarray(r,2*r);this._heightValues=this._quantizedVertices.subarray(2*r,3*r),this._westIndices=v(e.westIndices,t,r),this._southIndices=v(e.southIndices,i,r),this._eastIndices=v(e.eastIndices,t,r),this._northIndices=v(e.northIndices,i,r),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=n(e.childTileMask,15),this._createdByUpsampling=n(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}function v(e,t,i){y.length=e.length;for(var r=!1,n=0,o=e.length;o>n;++n)y[n]=e[n],r=r||n>0&&t(e[n-1],e[n])>0;return r?(y.sort(t),l.createTypedArray(i,y)):e}function g(e,t,i){for(var r=e._mesh,n=r.vertices,o=r.encoding,a=r.indices,s=0,l=a.length;l>s;s+=3){var c=a[s],h=a[s+1],d=a[s+2],p=o.decodeTextureCoordinates(n,c,T),m=o.decodeTextureCoordinates(n,h,x),f=o.decodeTextureCoordinates(n,d,b),v=u.computeBarycentricCoordinates(t,i,p.x,p.y,m.x,m.y,f.x,f.y,w);if(v.x>=-1e-15&&v.y>=-1e-15&&v.z>=-1e-15){var g=o.decodeHeight(n,c),_=o.decodeHeight(n,h),y=o.decodeHeight(n,d);return v.x*g+v.y*_+v.z*y}}}function _(e,t,i){for(var r=e._uValues,n=e._vValues,o=e._heightValues,a=e._indices,s=0,l=a.length;l>s;s+=3){var h=a[s],d=a[s+1],p=a[s+2],m=r[h],f=r[d],v=r[p],g=n[h],_=n[d],y=n[p],C=u.computeBarycentricCoordinates(t,i,m,g,f,_,v,y,w);if(C.x>=-1e-15&&C.y>=-1e-15&&C.z>=-1e-15){var E=C.x*o[h]+C.y*o[d]+C.z*o[p];return c.lerp(e._minimumHeight,e._maximumHeight,E/S)}}}a(f.prototype,{waterMask:{get:function(){return this._waterMask}}});var y=[],C=new d("createVerticesFromQuantizedTerrainMesh");f.prototype.createMesh=function(t,i,r,a,s){var u=t.ellipsoid,c=t.tileXYToRectangle(i,r,a);s=n(s,1);var h=C.scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:c,relativeToCenter:this._boundingSphere.center,ellipsoid:u,exaggeration:s});if(o(h)){var d=this;return e(h,function(e){var t=d._quantizedVertices.length/3;t+=d._westIndices.length+d._southIndices.length+d._eastIndices.length+d._northIndices.length;var i=l.createTypedArray(t,e.indices),r=new Float32Array(e.vertices),o=e.center,a=e.minimumHeight,s=e.maximumHeight,u=n(e.boundingSphere,d._boundingSphere),c=n(e.orientedBoundingBox,d._orientedBoundingBox),h=n(e.occludeePointInScaledSpace,d._horizonOcclusionPoint),f=e.vertexStride,v=p.clone(e.encoding);return d._skirtIndex=e.skirtIndex,d._vertexCountWithoutSkirts=d._quantizedVertices.length/3,d._mesh=new m(o,r,i,a,s,u,h,f,c,v),d._quantizedVertices=void 0,d._encodedNormals=void 0,d._indices=void 0,d._uValues=void 0,d._vValues=void 0,d._heightValues=void 0,d._westIndices=void 0,d._southIndices=void 0,d._eastIndices=void 0,d._northIndices=void 0,d._mesh})}};var E=new d("upsampleQuantizedTerrainMesh");f.prototype.upsample=function(i,n,a,s,u,c,d){var p=this._mesh;if(o(this._mesh)){var m=2*n!==u,v=2*a===c,g=i.ellipsoid,_=i.tileXYToRectangle(u,c,d),y=E.scheduleTask({vertices:p.vertices,vertexCountWithoutSkirts:this._vertexCountWithoutSkirts,indices:p.indices,skirtIndex:this._skirtIndex,encoding:p.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:m,isNorthChild:v,childRectangle:_,ellipsoid:g});if(o(y)){var C=Math.min(this._westSkirtHeight,this._eastSkirtHeight);C=Math.min(C,this._southSkirtHeight),C=Math.min(C,this._northSkirtHeight);var S=m?.5*C:this._westSkirtHeight,w=v?.5*C:this._southSkirtHeight,T=m?this._eastSkirtHeight:.5*C,x=v?this._northSkirtHeight:.5*C;return e(y,function(e){var i,n=new Uint16Array(e.vertices),a=l.createTypedArray(n.length/3,e.indices);return o(e.encodedNormals)&&(i=new Uint8Array(e.encodedNormals)),new f({quantizedVertices:n,indices:a,encodedNormals:i,minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,boundingSphere:t.clone(e.boundingSphere),orientedBoundingBox:h.clone(e.orientedBoundingBox),horizonOcclusionPoint:r.clone(e.horizonOcclusionPoint),westIndices:e.westIndices,southIndices:e.southIndices,eastIndices:e.eastIndices,northIndices:e.northIndices,westSkirtHeight:S,southSkirtHeight:w,eastSkirtHeight:T,northSkirtHeight:x,childTileMask:0,createdByUpsampling:!0})})}}};var S=32767,w=new r;f.prototype.interpolateHeight=function(e,t,i){var r=c.clamp((t-e.west)/e.width,0,1);r*=S;var n=c.clamp((i-e.south)/e.height,0,1);return n*=S,o(this._mesh)?void g(this,r,n):_(this,r,n)};var T=new i,x=new i,b=new i;return f.prototype.isChildAvailable=function(e,t,i,r){var n=2;return i!==2*e&&++n,r!==2*t&&(n-=2),0!==(this._childTileMask&1<0?o.raiseEvent(d):console.log('An error occurred in "'+n.constructor.name+'": '+i(a)),d.retry&&t(c)&&c(),d},r.handleSuccess=function(e){t(e)&&(e.timesRetried=-1)},r}),i("Core/CesiumTerrainProvider",["../ThirdParty/Uri","../ThirdParty/when","./BoundingSphere","./Cartesian3","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./GeographicTilingScheme","./HeightmapTerrainData","./IndexDatatype","./joinUrls","./loadArrayBuffer","./loadJson","./Math","./Matrix3","./OrientedBoundingBox","./QuantizedMeshTerrainData","./RuntimeError","./TerrainProvider","./throttleRequestByServer","./TileProviderError"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w){"use strict";function T(i){function r(t){var i;if(!t.format)return i="The tile format is not specified in the layer.json file.",void(m=w.handleError(m,v,v._errorEvent,i,void 0,void 0,void 0,l));if(!t.tiles||0===t.tiles.length)return i="The layer.json file does not specify any tile URL templates.",void(m=w.handleError(m,v,v._errorEvent,i,void 0,void 0,void 0,l));if("heightmap-1.0"===t.format)v._heightmapStructure={heightScale:.2,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1},v._hasWaterMask=!0,v._requestWaterMask=!0;else if(0!==t.format.indexOf("quantized-mesh-1."))return i='The tile format "'+t.format+'" is invalid or not supported.',void(m=w.handleError(m,v,v._errorEvent,i,void 0,void 0,void 0,l));v._tileUrlTemplates=t.tiles;for(var r=0;r>1^-(1&e)}var u=0,c=3,h=c+1,p=Float64Array.BYTES_PER_ELEMENT*c,m=Float64Array.BYTES_PER_ELEMENT*h,f=3,g=Uint16Array.BYTES_PER_ELEMENT*f,C=3,E=Uint16Array.BYTES_PER_ELEMENT,S=E*C,w=new DataView(t),T=new r(w.getFloat64(u,!0),w.getFloat64(u+8,!0),w.getFloat64(u+16,!0));u+=p;var x=w.getFloat32(u,!0);u+=Float32Array.BYTES_PER_ELEMENT;var b=w.getFloat32(u,!0);u+=Float32Array.BYTES_PER_ELEMENT;var A=new i(new r(w.getFloat64(u,!0),w.getFloat64(u+8,!0),w.getFloat64(u+16,!0)),w.getFloat64(u+p,!0));u+=m;var I=new r(w.getFloat64(u,!0),w.getFloat64(u+8,!0),w.getFloat64(u+16,!0));u+=p;var D=w.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var R=new Uint16Array(t,u,3*D);u+=D*g,D>65536&&(E=Uint32Array.BYTES_PER_ELEMENT,S=E*C);var O,N=R.subarray(0,D),L=R.subarray(D,2*D),F=R.subarray(2*D,3*D),B=0,V=0,k=0;for(O=0;D>O;++O)B+=l(N[O]),V+=l(L[O]),k+=l(F[O]),N[O]=B,L[O]=V,F[O]=k;u%E!==0&&(u+=E-u%E);var z=w.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var U=d.createTypedArrayFromArrayBuffer(D,t,u,z*C);u+=z*S;var G=0;for(O=0;O=n.length)return 0;var a=n[o],s=0;return s|=I(a,2*i,2*r)?1:0,s|=I(a,2*i+1,2*r)?2:0,s|=I(a,2*i,2*r+1)?4:0,s|=I(a,2*i+1,2*r+1)?8:0}function I(e,t,i){for(var r=0,n=e.length;n>r;++r){var o=e[r];if(t>=o.startX&&t<=o.endX&&i>=o.startY&&i<=o.endY)return!0}return!1}var M={OCT_VERTEX_NORMALS:1,WATER_MASK:2};return T.prototype.requestTileGeometry=function(e,i,r,n){function s(e){return m(e,x(f))}var l=this._tileUrlTemplates;if(0!==l.length){var u=this._tilingScheme.getNumberOfYTilesAtLevel(r),c=u-i-1,h=l[(e+c+r)%l.length].replace("{z}",r).replace("{x}",e).replace("{y}",c),d=this._proxy;a(d)&&(h=d.getURL(h));var p,f=[];if(this._requestVertexNormals&&this._hasVertexNormals&&f.push(this._littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),this._requestWaterMask&&this._hasWaterMask&&f.push("watermask"),n=o(n,!0)){if(p=S(h,s),!a(p))return}else p=s(h);var v=this;return t(p,function(t){return a(v._heightmapStructure)?b(v,t,r,e,i,c):A(v,t,r,e,i,c)})}},s(T.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}}}),T.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<=r.length)return!1;var n=r[i],o=this._tilingScheme.getNumberOfYTilesAtLevel(i),a=o-t-1;return I(n,e,a)}},T}),i("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,i,r){"use strict";function n(t,n,o,c,h,d,p,m,f,v){var g=t+n;e.multiplyByScalar(c,Math.cos(g),a),e.multiplyByScalar(o,Math.sin(g),s),e.add(a,s,a);var _=Math.cos(t);_*=_;var y=Math.sin(t);y*=y;var C=d/Math.sqrt(p*_+h*y),E=C/m;return r.fromAxisAngle(a,E,l),i.fromQuaternion(l,u),i.multiplyByVector(u,f,v),e.normalize(v,v),e.multiplyByScalar(v,m,v),v}var o={},a=new e,s=new e,l=new r,u=new i,c=new e,h=new e,d=new e,p=new e;o.raisePositionsToHeight=function(t,i,r){for(var n=i.ellipsoid,o=i.height,a=i.extrudedHeight,s=r?t.length/3*2:t.length/3,l=new Float64Array(3*s),u=t.length,m=r?u:0,f=0;u>f;f+=3){var v=f+1,g=f+2,_=e.fromArray(t,f,c);n.scaleToGeodeticSurface(_,_);var y=e.clone(_,h),C=n.geodeticSurfaceNormal(_,p),E=e.multiplyByScalar(C,o,d);e.add(_,E,_),r&&(e.multiplyByScalar(C,a,E),e.add(y,E,y),l[f+m]=y.x,l[v+m]=y.y,l[g+m]=y.z),l[f]=_.x,l[v]=_.y,l[g]=_.z}return l};var m=new e,f=new e,v=new e;return o.computeEllipsePositions=function(i,r,o){var a=i.semiMinorAxis,s=i.semiMajorAxis,l=i.rotation,u=i.center,p=8*i.granularity,g=a*a,_=s*s,y=s*a,C=e.magnitude(u),E=e.normalize(u,m),S=e.cross(e.UNIT_Z,u,f);S=e.normalize(S,S);var w=e.cross(E,S,v),T=1+Math.ceil(t.PI_OVER_TWO/p),x=t.PI_OVER_TWO/(T-1),b=t.PI_OVER_TWO-T*x;0>b&&(T-=Math.ceil(Math.abs(b)/x));var A,P,I,M,D,R=2*(T*(T+2)),O=r?new Array(3*R):void 0,N=0,L=c,F=h,B=4*T*3,V=B-1,k=0,z=o?new Array(B):void 0;for(b=t.PI_OVER_TWO,L=n(b,l,w,S,g,y,_,C,E,L),r&&(O[N++]=L.x,O[N++]=L.y,O[N++]=L.z),o&&(z[V--]=L.z,z[V--]=L.y,z[V--]=L.x),b=t.PI_OVER_TWO-x,A=1;T+1>A;++A){if(L=n(b,l,w,S,g,y,_,C,E,L),F=n(Math.PI-b,l,w,S,g,y,_,C,E,F),r){for(O[N++]=L.x,O[N++]=L.y,O[N++]=L.z,I=2*A+2,P=1;I-1>P;++P)M=P/(I-1),D=e.lerp(L,F,M,d),O[N++]=D.x,O[N++]=D.y,O[N++]=D.z;O[N++]=F.x,O[N++]=F.y,O[N++]=F.z}o&&(z[V--]=L.z,z[V--]=L.y,z[V--]=L.x,z[k++]=F.x,z[k++]=F.y,z[k++]=F.z),b=t.PI_OVER_TWO-(A+1)*x}for(A=T;A>1;--A){if(b=t.PI_OVER_TWO-(A-1)*x,L=n(-b,l,w,S,g,y,_,C,E,L),F=n(b+Math.PI,l,w,S,g,y,_,C,E,F),r){for(O[N++]=L.x,O[N++]=L.y,O[N++]=L.z,I=2*(A-1)+2,P=1;I-1>P;++P)M=P/(I-1),D=e.lerp(L,F,M,d),O[N++]=D.x,O[N++]=D.y,O[N++]=D.z;O[N++]=F.x,O[N++]=F.y,O[N++]=F.z}o&&(z[V--]=L.z,z[V--]=L.y,z[V--]=L.x,z[k++]=F.x,z[k++]=F.y,z[k++]=F.z)}b=t.PI_OVER_TWO,L=n(-b,l,w,S,g,y,_,C,E,L);var U={};return r&&(O[N++]=L.x,O[N++]=L.y,O[N++]=L.z,U.positions=O,U.numPts=T),o&&(z[V--]=L.z,z[V--]=L.y,z[V--]=L.x,U.outerPositions=z),U},o}),i("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,i,r){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=r.clone(e(t.modelMatrix,r.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return n}),i("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}r.encode=function(e,i){t(i)||(i={high:0,low:0});var r;return e>=0?(r=65536*Math.floor(e/65536),i.high=r,i.low=e-r):(r=65536*Math.floor(-e/65536),i.high=-r,i.low=e+r),i};var n={high:0,low:0};r.fromCartesian=function(e,i){t(i)||(i=new r);var o=i.high,a=i.low;return r.encode(e.x,n),o.x=n.high,a.x=n.low,r.encode(e.y,n),o.y=n.high,a.y=n.low,r.encode(e.z,n),o.z=n.high,a.z=n.low,i};var o=new r;return r.writeElements=function(e,t,i){r.fromCartesian(e,o);var n=o.high,a=o.low;t[i]=n.x,t[i+1]=n.y,t[i+2]=n.z,t[i+3]=a.x,t[i+4]=a.y,t[i+5]=a.z},r}),i("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";var r={};return r.calculateACMR=function(i){i=e(i,e.EMPTY_OBJECT);var r=i.indices,n=i.maximumIndex,o=e(i.cacheSize,24),a=r.length;if(!t(n)){n=0;for(var s=0,l=r[s];a>s;)l>n&&(n=l),++s,l=r[s]}for(var u=[],c=0;n+1>c;c++)u[c]=0;for(var h=o+1,d=0;a>d;++d)h-u[r[d]]>o&&(u[r[d]]=h,++h);return(h-o+1)/(a/3)},r.tipsify=function(i){function r(e,t,i,r){for(;t.length>=1;){var n=t[t.length-1];if(t.splice(t.length-1,1),e[n].numLiveTriangles>0)return n}for(;r>o;){if(e[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function n(e,t,i,n,o,a,s){for(var l,u=-1,c=-1,h=0;hc||-1===c)&&(c=l,u=d)),++h}return-1===u?r(n,a,e,s):u}i=e(i,e.EMPTY_OBJECT);var o,a=i.indices,s=i.maximumIndex,l=e(i.cacheSize,24),u=a.length,c=0,h=0,d=a[h],p=u;if(t(s))c=s+1;else{for(;p>h;)d>c&&(c=d),++h,d=a[h];if(-1===c)return 0;++c}for(var m=[],f=0;c>f;f++)m[f]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};h=0;for(var v=0;p>h;)m[a[h]].vertexTriangles.push(v),++m[a[h]].numLiveTriangles,m[a[h+1]].vertexTriangles.push(v),++m[a[h+1]].numLiveTriangles,m[a[h+2]].vertexTriangles.push(v),++m[a[h+2]].numLiveTriangles,++v,h+=3;var g=0,_=l+1;o=1;var y,C,E=[],S=[],w=0,T=[],x=u/3,b=[];for(f=0;x>f;f++)b[f]=!1;for(var A,P;-1!==g;){E=[],C=m[g],P=C.vertexTriangles.length;for(var I=0;P>I;++I)if(v=C.vertexTriangles[I],!b[v]){b[v]=!0,h=v+v+v;for(var M=0;3>M;++M)A=a[h],E.push(A),S.push(A),T[w]=A,++w,y=m[A],--y.numLiveTriangles,_-y.timeStamp>l&&(y.timeStamp=_,++_),++h}g=n(a,l,E,m,_,S,c)}return T},r}),i("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryInstance","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x){"use strict";function b(e,t,i,r,n){e[t++]=i,e[t++]=r,e[t++]=r,e[t++]=n,e[t++]=n,e[t]=i}function A(e){for(var t=e.length,i=t/3*6,r=g.createTypedArray(t,i),n=0,o=0;t>o;o+=3,n+=6)b(r,n,e[o],e[o+1],e[o+2]);return r}function P(e){var t=e.length;if(t>=3){var i=6*(t-2),r=g.createTypedArray(t,i);b(r,0,e[0],e[1],e[2]);for(var n=6,o=3;t>o;++o,n+=6)b(r,n,e[o-1],e[o],e[o-2]);return r}return new Uint16Array}function I(e){if(e.length>0){for(var t=e.length-1,i=6*(t-1),r=g.createTypedArray(t,i),n=e[0],o=0,a=1;t>a;++a,o+=6)b(r,o,n,e[a],e[a+1]);return r}return new Uint16Array}function M(e){var t={};for(var i in e)if(e.hasOwnProperty(i)&&u(e[i])&&u(e[i].values)){var r=e[i];t[i]=new m({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return t}function D(e,t,i){for(var r in t)if(t.hasOwnProperty(r)&&u(t[r])&&u(t[r].values))for(var n=t[r],o=0;oo;o+=3)n.unpack(i,o,oe),S.multiplyByPoint(e,oe,oe),n.pack(oe,i,o)}function O(e,t){if(u(t))for(var i=t.values,r=i.length,o=0;r>o;o+=3)n.unpack(i,o,oe),E.multiplyByVector(e,oe,oe),oe=n.normalize(oe,oe),n.pack(oe,i,o)}function N(e,t){var i,r=e.length,n={},o=e[0][t].attributes;for(i in o)if(o.hasOwnProperty(i)&&u(o[i])&&u(o[i].values)){for(var a=o[i],l=a.values.length,c=!0,h=1;r>h;++h){var d=e[h][t].attributes[i];if(!u(d)||a.componentDatatype!==d.componentDatatype||a.componentsPerAttribute!==d.componentsPerAttribute||a.normalize!==d.normalize){c=!1;break}l+=d.values.length}c&&(n[i]=new m({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:s.createTypedArray(a.componentDatatype,l)}))}return n}function L(e,t){var r,o,a,s,l,c,h,d=e.length,m=(e[0].modelMatrix,u(e[0][t].indices)),f=e[0][t].primitiveType,v=N(e,t);for(r in v)if(v.hasOwnProperty(r))for(l=v[r].values,s=0,o=0;d>o;++o)for(c=e[o][t].attributes[r].values,h=c.length,a=0;h>a;++a)l[s++]=c[a];var _;if(m){var y=0;for(o=0;d>o;++o)y+=e[o][t].indices.length;var C=p.computeNumberOfVertices(new p({attributes:v,primitiveType:T.POINTS})),E=g.createTypedArray(C,y),S=0,w=0;for(o=0;d>o;++o){var x=e[o][t].indices,b=x.length;for(s=0;b>s;++s)E[S++]=w+x[s];w+=p.computeNumberOfVertices(e[o][t])}_=E}var A,P=new n,I=0;for(o=0;d>o;++o){if(A=e[o][t].boundingSphere,!u(A)){P=void 0;break}n.add(A.center,P,P)}if(u(P))for(n.divideByScalar(P,d,P),o=0;d>o;++o){A=e[o][t].boundingSphere;var M=n.magnitude(n.subtract(A.center,P,le))+A.radius;M>I&&(I=M)}return new p({attributes:v,indices:_,primitiveType:f,boundingSphere:u(P)?new i(P,I):void 0})}function F(e){if(u(e.indices))return e;for(var t=p.computeNumberOfVertices(e),i=g.createTypedArray(t,t),r=0;t>r;++r)i[r]=r;return e.indices=i,e}function B(e){var t=p.computeNumberOfVertices(e),i=g.createTypedArray(t,3*(t-2));i[0]=1,i[1]=0,i[2]=2;for(var r=3,n=3;t>n;++n)i[r++]=n-1,i[r++]=0,i[r++]=n;return e.indices=i,e.primitiveType=T.TRIANGLES,e}function V(e){var t=p.computeNumberOfVertices(e),i=g.createTypedArray(t,3*(t-2));i[0]=0,i[1]=1,i[2]=2,t>3&&(i[3]=0,i[4]=2,i[5]=3);for(var r=6,n=3;t-1>n;n+=2)i[r++]=n,i[r++]=n-1,i[r++]=n+1,t>n+2&&(i[r++]=n,i[r++]=n+1,i[r++]=n+2);return e.indices=i,e.primitiveType=T.TRIANGLES,e}function k(e){if(u(e.indices))return e;for(var t=p.computeNumberOfVertices(e),i=g.createTypedArray(t,t),r=0;t>r;++r)i[r]=r;return e.indices=i,e}function z(e){var t=p.computeNumberOfVertices(e),i=g.createTypedArray(t,2*(t-1));i[0]=0,i[1]=1;for(var r=2,n=2;t>n;++n)i[r++]=n-1,i[r++]=n;return e.indices=i,e.primitiveType=T.LINES,e}function U(e){var t=p.computeNumberOfVertices(e),i=g.createTypedArray(t,2*t);i[0]=0,i[1]=1;for(var r=2,n=2;t>n;++n)i[r++]=n-1,i[r++]=n;return i[r++]=t-1,i[r]=0,e.indices=i,e.primitiveType=T.LINES,e}function G(e){switch(e.primitiveType){case T.TRIANGLE_FAN:return B(e);case T.TRIANGLE_STRIP:return V(e);case T.TRIANGLES:return F(e);case T.LINE_STRIP:return z(e);case T.LINE_LOOP:return U(e);case T.LINES:return k(e)}return e}function W(e,t){Math.abs(e.y)o?n>a?C.sign(e.y):C.sign(i.y):o>a?C.sign(t.y):C.sign(i.y);var s=0>r;W(e,s),W(t,s),W(i,s)}function q(e,t,i,r){n.add(e,n.multiplyByScalar(n.subtract(t,e,Ce),e.y/(e.y-t.y),Ce),i),n.clone(i,r),W(i,!0),W(r,!1)}function j(e,t,i){if(!(e.x>=0||t.x>=0||i.x>=0)){H(e,t,i);var r=e.y<0,n=t.y<0,o=i.y<0,a=0;a+=r?1:0,a+=n?1:0,a+=o?1:0;var s=xe.indices;1===a?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,r?(q(e,t,Ee,we),q(e,i,Se,Te),s[0]=0,s[3]=1,s[4]=2,s[6]=1):n?(q(t,i,Ee,we),q(t,e,Se,Te),s[0]=1,s[3]=2,s[4]=0,s[6]=2):o&&(q(i,e,Ee,we),q(i,t,Se,Te),s[0]=2,s[3]=0,s[4]=1,s[6]=0)):2===a&&(s[2]=4,s[4]=4,s[5]=3,s[7]=5,s[8]=6,r?n?o||(q(i,e,Ee,we),q(i,t,Se,Te),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(q(t,i,Ee,we),q(t,e,Se,Te),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(q(e,t,Ee,we),q(e,i,Se,Te),s[0]=1,s[1]=2,s[3]=1,s[6]=0));var l=xe.positions;return l[0]=e,l[1]=t,l[2]=i,l.length=3,(1===a||2===a)&&(l[3]=Ee,l[4]=Se,l[5]=we,l[6]=Te,l.length=7),xe}}function Y(e,t){var r=e.attributes;if(0!==r.position.values.length){for(var n in r)if(r.hasOwnProperty(n)&&u(r[n])&&u(r[n].values)){var o=r[n];o.values=s.createTypedArray(o.componentDatatype,o.values)}var a=p.computeNumberOfVertices(e);return e.indices=g.createTypedArray(a,e.indices),t&&(e.boundingSphere=i.fromVertices(r.position.values)),e}}function X(e){var t=e.attributes,i={};for(var r in t)if(t.hasOwnProperty(r)&&u(t[r])&&u(t[r].values)){var n=t[r];i[r]=new m({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return new p({attributes:i,indices:[],primitiveType:e.primitiveType})}function Z(e,t,i){var r=u(e.geometry.boundingSphere);t=Y(t,r),i=Y(i,r),u(i)&&!u(t)?e.geometry=i:!u(i)&&u(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=i,e.geometry=void 0)}function K(e,i,o,a,s,l,c,h,d,p,m){if(u(l)||u(c)||u(h)||u(d)){var f=n.fromArray(s,3*e,be),v=n.fromArray(s,3*i,Ae),g=n.fromArray(s,3*o,Pe),_=t(a,f,v,g,Ie);if(u(l)){var y=n.fromArray(l,3*e,be),C=n.fromArray(l,3*i,Ae),E=n.fromArray(l,3*o,Pe);n.multiplyByScalar(y,_.x,y),n.multiplyByScalar(C,_.y,C),n.multiplyByScalar(E,_.z,E);var S=n.add(y,C,y);n.add(S,E,S),n.normalize(S,S),n.pack(S,p.normal.values,3*m)}if(u(c)){var w=n.fromArray(c,3*e,be),T=n.fromArray(c,3*i,Ae),x=n.fromArray(c,3*o,Pe);n.multiplyByScalar(w,_.x,w),n.multiplyByScalar(T,_.y,T),n.multiplyByScalar(x,_.z,x);var b=n.add(w,T,w);n.add(b,x,b),n.normalize(b,b),n.pack(b,p.binormal.values,3*m)}if(u(h)){var A=n.fromArray(h,3*e,be),P=n.fromArray(h,3*i,Ae),I=n.fromArray(h,3*o,Pe);n.multiplyByScalar(A,_.x,A),n.multiplyByScalar(P,_.y,P),n.multiplyByScalar(I,_.z,I);var M=n.add(A,P,A);n.add(M,I,M),n.normalize(M,M),n.pack(M,p.tangent.values,3*m)}if(u(d)){var D=r.fromArray(d,2*e,Me),R=r.fromArray(d,2*i,De),O=r.fromArray(d,2*o,Re);r.multiplyByScalar(D,_.x,D),r.multiplyByScalar(R,_.y,R),r.multiplyByScalar(O,_.z,O);var N=r.add(D,R,D);r.add(N,O,N),r.pack(N,p.st.values,2*m)}}}function Q(e,t,i,r,n,o){var a=e.position.values.length/3;if(-1!==n){var s=r[n],l=i[s];return-1===l?(i[s]=a,e.position.values.push(o.x,o.y,o.z),t.push(a),a):(t.push(l),l)}return e.position.values.push(o.x,o.y,o.z),t.push(a),a}function J(e){var t,i,r,o,a,s=e.geometry,l=s.attributes,c=l.position.values,h=u(l.normal)?l.normal.values:void 0,d=u(l.binormal)?l.binormal.values:void 0,p=u(l.tangent)?l.tangent.values:void 0,m=u(l.st)?l.st.values:void 0,f=s.indices,v=X(s),g=X(s),_=[];_.length=c.length/3;var y=[];for(y.length=c.length/3,a=0;a<_.length;++a)_[a]=-1,y[a]=-1;var C=f.length;for(a=0;C>a;a+=3){ -var E=f[a],S=f[a+1],w=f[a+2],T=n.fromArray(c,3*E),x=n.fromArray(c,3*S),b=n.fromArray(c,3*w),A=j(T,x,b);if(u(A)&&A.positions.length>3)for(var P=A.positions,I=A.indices,M=I.length,D=0;M>D;++D){var R=I[D],O=P[R];O.y<0?(t=g.attributes,i=g.indices,r=_):(t=v.attributes,i=v.indices,r=y),o=Q(t,i,r,f,3>R?a+R:-1,O),K(E,S,w,O,c,h,d,p,m,t,o)}else u(A)&&(T=A.positions[0],x=A.positions[1],b=A.positions[2]),T.y<0?(t=g.attributes,i=g.indices,r=_):(t=v.attributes,i=v.indices,r=y),o=Q(t,i,r,f,a,T),K(E,S,w,T,c,h,d,p,m,t,o),o=Q(t,i,r,f,a+1,x),K(E,S,w,x,c,h,d,p,m,t,o),o=Q(t,i,r,f,a+2,b),K(E,S,w,b,c,h,d,p,m,t,o)}Z(e,g,v)}function $(e){var t,i=e.geometry,r=i.attributes,o=r.position.values,a=i.indices,s=X(i),l=X(i),c=a.length,h=[];h.length=o.length/3;var d=[];for(d.length=o.length/3,t=0;tt;t+=2){var p=a[t],m=a[t+1],f=n.fromArray(o,3*p,be),v=n.fromArray(o,3*m,Ae);Math.abs(f.y)t;t+=4){var E=t,S=t+1,w=t+2,T=t+3,x=n.fromArray(c,3*E,Ve),b=n.fromArray(c,3*S,ke),A=n.fromArray(c,3*w,ze),P=n.fromArray(c,3*T,Ue);Math.abs(x.y)i;++i)I.prevPosition.values.push(h[i]);for(I.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),D.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),i=3*w;3*w+6>i;++i)D.prevPosition.values.push(h[i]);for(i=3*E;3*E+6>i;++i)I.nextPosition.values.push(d[i]);for(I.nextPosition.values.push(A.x,A.y,A.z,A.x,A.y,A.z),D.nextPosition.values.push(A.x,A.y,A.z,A.x,A.y,A.z),i=3*w;3*w+6>i;++i)D.nextPosition.values.push(d[i]);var F=r.fromArray(p,2*E,Fe),B=Math.abs(F.y);I.expandAndWidth.values.push(-1,B,1,B),I.expandAndWidth.values.push(-1,-B,1,-B),D.expandAndWidth.values.push(-1,B,1,B),D.expandAndWidth.values.push(-1,-B,1,-B);var V=n.magnitudeSquared(n.subtract(O,x,Ue));if(V/=n.magnitudeSquared(n.subtract(A,x,Ue)),u(f)){var k=o.fromArray(f,4*E,qe),z=o.fromArray(f,4*w,qe),U=C.lerp(k.x,z.x,V),G=C.lerp(k.y,z.y,V),W=C.lerp(k.z,z.z,V),H=C.lerp(k.w,z.w,V);for(i=4*E;4*E+8>i;++i)I.color.values.push(f[i]);for(I.color.values.push(U,G,W,H),I.color.values.push(U,G,W,H),D.color.values.push(U,G,W,H),D.color.values.push(U,G,W,H),i=4*w;4*w+8>i;++i)D.color.values.push(f[i])}if(u(m)){var q=r.fromArray(m,2*E,Fe),j=r.fromArray(m,2*(t+3),Be),Y=C.lerp(q.x,j.x,V);for(i=2*E;2*E+4>i;++i)I.st.values.push(m[i]);for(I.st.values.push(Y,q.y),I.st.values.push(Y,j.y),D.st.values.push(Y,q.y),D.st.values.push(Y,j.y),i=2*w;2*w+4>i;++i)D.st.values.push(m[i])}a=I.position.values.length/3-4,M.push(a,a+2,a+1),M.push(a+1,a+2,a+3),a=D.position.values.length/3-4,R.push(a,a+2,a+1),R.push(a+1,a+2,a+3)}else{var K,Q;for(x.y<0?(K=g.attributes,Q=g.indices):(K=v.attributes,Q=v.indices),K.position.values.push(x.x,x.y,x.z),K.position.values.push(b.x,b.y,b.z),K.position.values.push(A.x,A.y,A.z),K.position.values.push(P.x,P.y,P.z),i=3*t;3*t+12>i;++i)K.prevPosition.values.push(h[i]),K.nextPosition.values.push(d[i]);for(i=2*t;2*t+8>i;++i)K.expandAndWidth.values.push(p[i]),u(m)&&K.st.values.push(m[i]);if(u(f))for(i=4*t;4*t+16>i;++i)K.color.values.push(f[i]);a=K.position.values.length/3-4,Q.push(a,a+2,a+1),Q.push(a+1,a+2,a+3)}}Z(e,g,v)}var te={};te.toWireframe=function(e){var t=e.indices;if(u(t)){switch(e.primitiveType){case T.TRIANGLES:e.indices=A(t);break;case T.TRIANGLE_STRIP:e.indices=P(t);break;case T.TRIANGLE_FAN:e.indices=I(t);break;default:throw new c("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=T.LINES}return e},te.createLineSegmentsForVectors=function(e,t,r){t=l(t,"normal"),r=l(r,1e4);for(var n=e.attributes.position.values,o=e.attributes[t].values,a=n.length,c=new Float64Array(2*a),h=0,d=0;a>d;d+=3)c[h++]=n[d],c[h++]=n[d+1],c[h++]=n[d+2],c[h++]=n[d]+o[d]*r,c[h++]=n[d+1]+o[d+1]*r,c[h++]=n[d+2]+o[d+2]*r;var f,v=e.boundingSphere;return u(v)&&(f=new i(v.center,v.radius+r)),new p({attributes:{position:new m({componentDatatype:s.DOUBLE,componentsPerAttribute:3,values:c})},primitiveType:T.LINES,boundingSphere:f})},te.createAttributeLocations=function(e){var t,i=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","binormal","tangent","compressedAttributes"],r=e.attributes,n={},o=0,a=i.length;for(t=0;a>t;++t){var s=i[t];u(r[s])&&(n[s]=o++)}for(var l in r)r.hasOwnProperty(l)&&!u(n[l])&&(n[l]=o++);return n},te.reorderForPreVertexCache=function(e){var t=p.computeNumberOfVertices(e),i=e.indices;if(u(i)){for(var r=new Int32Array(t),n=0;t>n;n++)r[n]=-1;for(var o,a=i,l=a.length,c=g.createTypedArray(t,l),h=0,d=0,m=0;l>h;)o=r[a[h]],-1!==o?c[d]=o:(o=a[h],r[o]=m,c[d]=m,++m),++h,++d;e.indices=c;var f=e.attributes;for(var v in f)if(f.hasOwnProperty(v)&&u(f[v])&&u(f[v].values)){for(var _=f[v],y=_.values,C=0,E=_.componentsPerAttribute,S=s.createTypedArray(_.componentDatatype,m*E);t>C;){var w=r[C];if(-1!==w)for(n=0;E>n;n++)S[E*w+n]=y[E*C+n];++C}_.values=S}}return e},te.reorderForPostVertexCache=function(e,t){var i=e.indices;if(e.primitiveType===T.TRIANGLES&&u(i)){for(var r=i.length,n=0,o=0;r>o;o++)i[o]>n&&(n=i[o]);e.indices=x.tipsify({indices:i,maximumIndex:n,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],i=p.computeNumberOfVertices(e);if(u(e.indices)&&i>=C.SIXTY_FOUR_KILOBYTES){var r,n=[],o=[],a=0,s=M(e.attributes),l=e.indices,c=l.length;e.primitiveType===T.TRIANGLES?r=3:e.primitiveType===T.LINES?r=2:e.primitiveType===T.POINTS&&(r=1);for(var h=0;c>h;h+=r){for(var d=0;r>d;++d){var m=l[h+d],f=n[m];u(f)||(f=a++,n[m]=f,D(s,e.attributes,m)),o.push(f)}a+r>=C.SIXTY_FOUR_KILOBYTES&&(t.push(new p({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),n=[],o=[],a=0,s=M(e.attributes))}0!==o.length&&t.push(new p({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var ie=new n,re=new a;te.projectTo2D=function(e,t,i,r,o){var a=e.attributes[t];o=u(o)?o:new d;for(var l=o.ellipsoid,h=a.values,p=new Float64Array(h.length),f=0,v=0;vc;++c)h.encode(o[c],ne),l[c]=ne.high,u[c]=ne.low;var d=n.componentsPerAttribute;return e.attributes[i]=new m({componentDatatype:s.FLOAT,componentsPerAttribute:d,values:l}),e.attributes[r]=new m({componentDatatype:s.FLOAT,componentsPerAttribute:d,values:u}),delete e.attributes[t],e};var oe=new n,ae=new S,se=new E;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(S.equals(t,S.IDENTITY))return e;var r=e.geometry.attributes;R(t,r.position),R(t,r.prevPosition),R(t,r.nextPosition),(u(r.normal)||u(r.binormal)||u(r.tangent))&&(S.inverse(t,ae),S.transpose(ae,ae),S.getRotation(ae,se),O(se,r.normal),O(se,r.binormal),O(se,r.tangent));var n=e.geometry.boundingSphere;return u(n)&&(e.geometry.boundingSphere=i.transform(n,t,n)),e.modelMatrix=S.clone(S.IDENTITY),e};var le=new n;te.combineInstances=function(e){for(var t=[],i=[],r=e.length,n=0;r>n;++n){var o=e[n];u(o.geometry)?t.push(o):i.push(o)}var a=[];return t.length>0&&a.push(L(t,"geometry")),i.length>0&&(a.push(L(i,"westHemisphereGeometry")),a.push(L(i,"eastHemisphereGeometry"))),a};var ue=new n,ce=new n,he=new n,de=new n;te.computeNormal=function(e){for(var t=e.indices,i=e.attributes,r=i.position.values,o=i.position.values.length/3,a=t.length,l=new Array(o),u=new Array(a/3),c=new Array(a),h=0;o>h;h++)l[h]={indexOffset:0,count:0,currentCount:0};var d=0;for(h=0;a>h;h+=3){var p=t[h],f=t[h+1],v=t[h+2],g=3*p,_=3*f,y=3*v;ce.x=r[g],ce.y=r[g+1],ce.z=r[g+2],he.x=r[_],he.y=r[_+1],he.z=r[_+2],de.x=r[y],de.y=r[y+1],de.z=r[y+2],l[p].count++,l[f].count++,l[v].count++,n.subtract(he,ce,he),n.subtract(de,ce,de),u[d]=n.cross(he,de,new n),d++}var C=0;for(h=0;o>h;h++)l[h].indexOffset+=C,C+=l[h].count;d=0;var E;for(h=0;a>h;h+=3){E=l[t[h]];var S=E.indexOffset+E.currentCount;c[S]=d,E.currentCount++,E=l[t[h+1]],S=E.indexOffset+E.currentCount,c[S]=d,E.currentCount++,E=l[t[h+2]],S=E.indexOffset+E.currentCount,c[S]=d,E.currentCount++,d++}var w=new Float32Array(3*o);for(h=0;o>h;h++){var T=3*h;if(E=l[h],E.count>0){for(n.clone(n.ZERO,ue),d=0;dc;c+=3){var f=t[c],v=t[c+1],g=t[c+2];h=3*f,d=3*v,p=3*g;var _=2*f,y=2*v,C=2*g,E=i[h],S=i[h+1],w=i[h+2],T=o[_],x=o[_+1],b=o[y+1]-x,A=o[C+1]-x,P=1/((o[y]-T)*A-(o[C]-T)*b),I=(A*(i[d]-E)-b*(i[p]-E))*P,M=(A*(i[d+1]-S)-b*(i[p+1]-S))*P,D=(A*(i[d+2]-w)-b*(i[p+2]-w))*P;u[h]+=I,u[h+1]+=M,u[h+2]+=D,u[d]+=I,u[d+1]+=M,u[d+2]+=D,u[p]+=I,u[p+1]+=M,u[p+2]+=D}var R=new Float32Array(3*a),O=new Float32Array(3*a);for(c=0;a>c;c++){h=3*c,d=h+1,p=h+2;var N=n.fromArray(r,h,pe),L=n.fromArray(u,h,fe),F=n.dot(N,L);n.multiplyByScalar(N,F,me),n.normalize(n.subtract(L,me,L),L),O[h]=L.x,O[d]=L.y,O[p]=L.z,n.normalize(n.cross(N,L,L),L),R[h]=L.x,R[d]=L.y,R[p]=L.z}return e.attributes.tangent=new m({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:O}),e.attributes.binormal=new m({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:R}),e};var ve=new r,ge=new n,_e=new n,ye=new n;te.compressVertices=function(t){var i=t.attributes.normal,o=t.attributes.st;if(!u(i)&&!u(o))return t;var a,l,c,h,d=t.attributes.tangent,p=t.attributes.binormal;u(i)&&(a=i.values),u(o)&&(l=o.values),u(d)&&(c=d.values),p&&(h=p.values);var f=u(a)?a.length:l.length,v=u(a)?3:2,g=f/v,_=g,y=u(l)&&u(a)?2:1;y+=u(c)||u(h)?1:0,_*=y;for(var C=new Float32Array(_),E=0,S=0;g>S;++S){u(l)&&(r.fromArray(l,2*S,ve),C[E++]=e.compressTextureCoordinates(ve));var w=3*S;u(a)&&u(c)&&u(h)?(n.fromArray(a,w,ge),n.fromArray(c,w,_e),n.fromArray(h,w,ye),e.octPack(ge,_e,ye,ve),C[E++]=ve.x,C[E++]=ve.y):(u(a)&&(n.fromArray(a,w,ge),C[E++]=e.octEncodeFloat(ge)),u(c)&&(n.fromArray(c,w,ge),C[E++]=e.octEncodeFloat(ge)),u(h)&&(n.fromArray(h,w,ge),C[E++]=e.octEncodeFloat(ge)))}return t.attributes.compressedAttributes=new m({componentDatatype:s.FLOAT,componentsPerAttribute:y,values:C}),u(a)&&delete t.attributes.normal,u(l)&&delete t.attributes.st,u(c)&&delete t.attributes.tangent,u(h)&&delete t.attributes.binormal,t};var Ce=new n,Ee=new n,Se=new n,we=new n,Te=new n,xe={positions:new Array(7),indices:new Array(9)},be=new n,Ae=new n,Pe=new n,Ie=new n,Me=new r,De=new r,Re=new r,Oe=w.fromPointNormal(n.ZERO,n.UNIT_Y),Ne=new n,Le=new n,Fe=new r,Be=new r,Ve=new n,ke=new n,ze=new n,Ue=new n,Ge=new n,We=new n,He=new n,qe=new o;return te.splitLongitude=function(e){var t=e.geometry,r=t.boundingSphere;if(u(r)){var n=r.center.x-r.radius;if(n>0||i.intersectPlane(r,w.ORIGIN_ZX_PLANE)!==_.INTERSECTING)return e}if(t.geometryType!==v.NONE)switch(t.geometryType){case v.POLYLINES:ee(e);break;case v.TRIANGLES:J(e);break;case v.LINES:$(e)}else G(t),t.primitiveType===T.TRIANGLES?J(e):t.primitiveType===T.LINES&&$(e);return e},te}),i("Core/EllipseGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PrimitiveType","./Quaternion","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E){"use strict";function S(e,r,o){var a=r.vertexFormat,s=r.center,u=r.semiMajorAxis,h=r.semiMinorAxis,m=r.ellipsoid,f=r.stRotation,v=o?e.length/3*2:e.length/3,g=a.st?new Float32Array(2*v):void 0,y=a.normal?new Float32Array(3*v):void 0,E=a.tangent?new Float32Array(3*v):void 0,S=a.binormal?new Float32Array(3*v):void 0,w=0,T=F,x=B,b=V,A=new c(m),P=A.project(m.cartesianToCartographic(s,k),z),R=m.scaleToGeodeticSurface(s,I);m.geodeticSurfaceNormal(R,R);for(var W=C.fromAxisAngle(R,f,L),H=_.fromQuaternion(W,N),q=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,U),j=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,G),Y=e.length,X=o?Y:0,Z=X/3*2,K=0;Y>K;K+=3){var Q=K+1,J=K+2,$=i.fromArray(e,K,I);if(a.st){var ee=_.multiplyByVector(H,$,M),te=A.project(m.cartesianToCartographic(ee,k),D);i.subtract(te,P,te),O.x=(te.x+u)/(2*u),O.y=(te.y+h)/(2*h),q.x=Math.min(O.x,q.x),q.y=Math.min(O.y,q.y),j.x=Math.max(O.x,j.x),j.y=Math.max(O.y,j.y),o&&(g[w+Z]=O.x,g[w+1+Z]=O.y),g[w++]=O.x,g[w++]=O.y}T=m.geodeticSurfaceNormal($,T),(a.normal||a.tangent||a.binormal)&&((a.tangent||a.binormal)&&(x=i.normalize(i.cross(i.UNIT_Z,T,x),x),_.multiplyByVector(H,x,x)),a.normal&&(y[K]=T.x,y[Q]=T.y,y[J]=T.z,o&&(y[K+X]=-T.x,y[Q+X]=-T.y,y[J+X]=-T.z)),a.tangent&&(E[K]=x.x,E[Q]=x.y,E[J]=x.z,o&&(E[K+X]=-x.x,E[Q+X]=-x.y,E[J+X]=-x.z)),a.binormal&&(b=i.normalize(i.cross(T,x,b),b),S[K]=b.x,S[Q]=b.y,S[J]=b.z,o&&(S[K+X]=b.x,S[Q+X]=b.y,S[J+X]=b.z)))}if(a.st){Y=g.length;for(var ie=0;Y>ie;ie+=2)g[ie]=(g[ie]-q.x)/(j.x-q.x),g[ie+1]=(g[ie+1]-q.y)/(j.y-q.y)}var re=new p;if(a.position){var ne=l.raisePositionsToHeight(e,r,o);re.position=new d({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:ne})}return a.st&&(re.st=new d({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:g})),a.normal&&(re.normal=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:y})),a.tangent&&(re.tangent=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:E})),a.binormal&&(re.binormal=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:S})),re}function w(e){var t,i,r,n,o,a=new Array(12*(e*(e+1))-6),s=0;for(t=0,r=1,n=0;3>n;n++)a[s++]=r++,a[s++]=t,a[s++]=r;for(n=2;e+1>n;++n){for(r=n*(n+1)-1,t=(n-1)*n-1,a[s++]=r++,a[s++]=t,a[s++]=r,i=2*n,o=0;i-1>o;++o)a[s++]=r,a[s++]=t++,a[s++]=t,a[s++]=r++,a[s++]=t,a[s++]=r;a[s++]=r++,a[s++]=t,a[s++]=r}for(i=2*e,++r,++t,n=0;i-1>n;++n)a[s++]=r,a[s++]=t++,a[s++]=t,a[s++]=r++,a[s++]=t,a[s++]=r;for(a[s++]=r,a[s++]=t++,a[s++]=t,a[s++]=r++,a[s++]=t++,a[s++]=t,++t,n=e-1;n>1;--n){for(a[s++]=t++,a[s++]=t,a[s++]=r,i=2*n,o=0;i-1>o;++o)a[s++]=r,a[s++]=t++,a[s++]=t,a[s++]=r++,a[s++]=t,a[s++]=r;a[s++]=t++,a[s++]=t++,a[s++]=r++}for(n=0;3>n;n++)a[s++]=t++,a[s++]=t,a[s++]=r;return a}function T(t){var r=t.center;W=i.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(r,W),t.height,W),W=i.add(r,W,W);var n=new e(W,t.semiMajorAxis),o=l.computeEllipsePositions(t,!0,!1),a=o.positions,s=o.numPts,u=S(a,t,!1),c=w(s);return c=v.createTypedArray(a.length/3,c),{boundingSphere:n,attributes:u,indices:c}}function x(e,r){var o=r.vertexFormat,a=r.center,s=r.semiMajorAxis,l=r.semiMinorAxis,u=r.ellipsoid,h=r.height,m=r.extrudedHeight,f=r.stRotation,v=e.length/3*2,g=new Float64Array(3*v),y=o.st?new Float32Array(2*v):void 0,E=o.normal?new Float32Array(3*v):void 0,S=o.tangent?new Float32Array(3*v):void 0,w=o.binormal?new Float32Array(3*v):void 0,T=0,x=F,b=B,A=V,P=new c(u),W=P.project(u.cartesianToCartographic(a,k),z),H=u.scaleToGeodeticSurface(a,I);u.geodeticSurfaceNormal(H,H);for(var q=C.fromAxisAngle(H,f,L),j=_.fromQuaternion(q,N),Y=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,U),X=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,G),Z=e.length,K=Z/3*2,Q=0;Z>Q;Q+=3){var J,$=Q+1,ee=Q+2,te=i.fromArray(e,Q,I);if(o.st){var ie=_.multiplyByVector(j,te,M),re=P.project(u.cartesianToCartographic(ie,k),D);i.subtract(re,W,re),O.x=(re.x+s)/(2*s),O.y=(re.y+l)/(2*l),Y.x=Math.min(O.x,Y.x),Y.y=Math.min(O.y,Y.y),X.x=Math.max(O.x,X.x),X.y=Math.max(O.y,X.y),y[T+K]=O.x,y[T+1+K]=O.y,y[T++]=O.x,y[T++]=O.y}te=u.scaleToGeodeticSurface(te,te),J=i.clone(te,M),x=u.geodeticSurfaceNormal(te,x);var ne=i.multiplyByScalar(x,h,R);if(te=i.add(te,ne,te),ne=i.multiplyByScalar(x,m,ne),J=i.add(J,ne,J),o.position&&(g[Q+Z]=J.x,g[$+Z]=J.y,g[ee+Z]=J.z,g[Q]=te.x,g[$]=te.y,g[ee]=te.z),o.normal||o.tangent||o.binormal){A=i.clone(x,A);var oe=i.fromArray(e,(Q+3)%Z,R);i.subtract(oe,te,oe);var ae=i.subtract(J,te,D);x=i.normalize(i.cross(ae,oe,x),x),o.normal&&(E[Q]=x.x,E[$]=x.y,E[ee]=x.z,E[Q+Z]=x.x,E[$+Z]=x.y,E[ee+Z]=x.z),o.tangent&&(b=i.normalize(i.cross(A,x,b),b),S[Q]=b.x,S[$]=b.y,S[ee]=b.z,S[Q+Z]=b.x,S[Q+1+Z]=b.y,S[Q+2+Z]=b.z),o.binormal&&(w[Q]=A.x,w[$]=A.y,w[ee]=A.z,w[Q+Z]=A.x,w[$+Z]=A.y,w[ee+Z]=A.z)}}if(o.st){Z=y.length;for(var se=0;Z>se;se+=2)y[se]=(y[se]-Y.x)/(X.x-Y.x),y[se+1]=(y[se+1]-Y.y)/(X.y-Y.y)}var le=new p;return o.position&&(le.position=new d({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:g})),o.st&&(le.st=new d({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:y})),o.normal&&(le.normal=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:E})),o.tangent&&(le.tangent=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:S})),o.binormal&&(le.binormal=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:w})),le}function b(e){for(var t=e.length/3,i=v.createTypedArray(t,6*t),r=0,n=0;t>n;n++){var o=n,a=n+t,s=(o+1)%t,l=s+t;i[r++]=o,i[r++]=a,i[r++]=s,i[r++]=s,i[r++]=a,i[r++]=l}return i}function A(t){var r=t.center,n=t.ellipsoid,o=t.semiMajorAxis,a=i.multiplyByScalar(n.geodeticSurfaceNormal(r,I),t.height,I);H.center=i.add(r,a,H.center),H.radius=o,a=i.multiplyByScalar(n.geodeticSurfaceNormal(r,a),t.extrudedHeight,a),q.center=i.add(r,a,q.center),q.radius=o;var s=l.computeEllipsePositions(t,!0,!0),u=s.positions,c=s.numPts,d=s.outerPositions,p=e.union(H,q),g=S(u,t,!0),_=w(c),C=_.length;_.length=2*C;for(var E=u.length/3,T=0;C>T;T+=3)_[T+C]=_[T+2]+E,_[T+1+C]=_[T+1]+E,_[T+2+C]=_[T]+E;var A=v.createTypedArray(2*E/3,_),P=new h({attributes:g,indices:A,primitiveType:y.TRIANGLES}),M=x(d,t);_=b(d);var D=v.createTypedArray(2*d.length/3,_),R=new h({attributes:M,indices:D,primitiveType:y.TRIANGLES}),O=f.combineInstances([new m({geometry:P}),new m({geometry:R})]);return{boundingSphere:p,attributes:O[0].attributes,indices:O[0].indices}}function P(e){e=o(e,o.EMPTY_OBJECT);var t=e.center,r=o(e.ellipsoid,u.WGS84),n=e.semiMajorAxis,s=e.semiMinorAxis,l=o(e.granularity,g.RADIANS_PER_DEGREE),c=o(e.height,0),h=e.extrudedHeight,d=a(h)&&Math.abs(c-h)>1,p=o(e.vertexFormat,E.DEFAULT);this._center=i.clone(t),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=u.clone(r),this._rotation=o(e.rotation,0),this._stRotation=o(e.stRotation,0),this._height=c,this._granularity=l,this._vertexFormat=E.clone(p),this._extrudedHeight=o(h,c),this._extrude=d,this._workerName="createEllipseGeometry"}var I=new i,M=new i,D=new i,R=new i,O=new t,N=new _,L=new C,F=new i,B=new i,V=new i,k=new r,z=new i,U=new t,G=new t,W=new i,H=new e,q=new e;P.packedLength=i.packedLength+u.packedLength+E.packedLength+8,P.pack=function(e,t,r){r=o(r,0),i.pack(e._center,t,r),r+=i.packedLength,u.pack(e._ellipsoid,t,r),r+=u.packedLength,E.pack(e._vertexFormat,t,r),r+=E.packedLength,t[r++]=e._semiMajorAxis,t[r++]=e._semiMinorAxis,t[r++]=e._rotation,t[r++]=e._stRotation,t[r++]=e._height,t[r++]=e._granularity,t[r++]=e._extrudedHeight,t[r]=e._extrude?1:0};var j=new i,Y=new u,X=new E,Z={center:j,ellipsoid:Y,vertexFormat:X,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0};return P.unpack=function(e,t,r){t=o(t,0);var n=i.unpack(e,t,j);t+=i.packedLength;var s=u.unpack(e,t,Y);t+=u.packedLength;var l=E.unpack(e,t,X);t+=E.packedLength;var c=e[t++],h=e[t++],d=e[t++],p=e[t++],m=e[t++],f=e[t++],v=e[t++],g=1===e[t];return a(r)?(r._center=i.clone(n,r._center),r._ellipsoid=u.clone(s,r._ellipsoid),r._vertexFormat=E.clone(l,r._vertexFormat),r._semiMajorAxis=c,r._semiMinorAxis=h,r._rotation=d,r._stRotation=p,r._height=m,r._granularity=f,r._extrudedHeight=v,r._extrude=g,r):(Z.height=m,Z.extrudedHeight=v,Z.granularity=f,Z.stRotation=p,Z.rotation=d,Z.semiMajorAxis=c,Z.semiMinorAxis=h,new P(Z))},P.createGeometry=function(e){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,i={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation};return e._extrude?(i.extrudedHeight=Math.min(e._extrudedHeight,e._height),i.height=Math.max(e._extrudedHeight,e._height),t=A(i)):t=T(i),new h({attributes:t.attributes,indices:t.indices,primitiveType:y.TRIANGLES,boundingSphere:t.boundingSphere})},P.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new P({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:n,stRotation:e._stRotation,granularity:r,extrudedHeight:o,height:a,vertexFormat:E.POSITION_ONLY})},P}),i("Core/CircleGeometry",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./EllipseGeometry","./Ellipsoid","./Math","./VertexFormat"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=t(e,t.EMPTY_OBJECT);var i=e.radius,r={center:e.center,semiMajorAxis:i,semiMinorAxis:i,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation};this._ellipseGeometry=new n(r),this._workerName="createCircleGeometry"}l.packedLength=n.packedLength,l.pack=function(e,t,i){n.pack(e._ellipseGeometry,t,i)};var u=new n({center:new e,semiMajorAxis:1,semiMinorAxis:1}),c={center:new e,radius:void 0,ellipsoid:o.clone(o.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new s,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};return l.unpack=function(t,r,a){var h=n.unpack(t,r,u);return c.center=e.clone(h._center,c.center),c.ellipsoid=o.clone(h._ellipsoid,c.ellipsoid),c.height=h._height,c.extrudedHeight=h._extrudedHeight,c.granularity=h._granularity,c.vertexFormat=s.clone(h._vertexFormat,c.vertexFormat),c.stRotation=h._stRotation,i(a)?(c.semiMajorAxis=h._semiMajorAxis,c.semiMinorAxis=h._semiMinorAxis,a._ellipseGeometry=new n(c),a):(c.radius=h._semiMajorAxis,new l(c))},l.createGeometry=function(e){return n.createGeometry(e._ellipseGeometry)},l.createShadowVolume=function(e,t,i){var r=e._ellipseGeometry._granularity,n=e._ellipseGeometry._ellipsoid,o=t(r,n),a=i(r,n);return new l({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:n,stRotation:e._ellipseGeometry._stRotation,granularity:r,extrudedHeight:o,height:a,vertexFormat:s.POSITION_ONLY})},l}),i("Core/EllipseOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(r){var n=r.center;_=t.multiplyByScalar(r.ellipsoid.geodeticSurfaceNormal(n,_),r.height,_),_=t.add(n,_,_);for(var o=new e(_,r.semiMajorAxis),s=a.computeEllipsePositions(r,!1,!0).outerPositions,l=new c({position:new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:a.raisePositionsToHeight(s,r,!1)})}),d=s.length/3,p=h.createTypedArray(d,2*d),m=0,f=0;d>f;++f)p[m++]=f,p[m++]=(f+1)%d;return{boundingSphere:o,attributes:l,indices:p}}function f(n){var o=r(n.numberOfVerticalLines,16);o=Math.max(o,0);var s=n.center,l=n.ellipsoid,d=n.semiMajorAxis,p=t.multiplyByScalar(l.geodeticSurfaceNormal(s,g),n.height,g);y.center=t.add(s,p,y.center),y.radius=d,p=t.multiplyByScalar(l.geodeticSurfaceNormal(s,p),n.extrudedHeight,p),C.center=t.add(s,p,C.center),C.radius=d;var m=a.computeEllipsePositions(n,!1,!0).outerPositions,f=new c({position:new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:a.raisePositionsToHeight(m,n,!0)})});m=f.position.values;var v=e.union(y,C),_=m.length/3,E=h.createTypedArray(_,2*_+2*o);_/=2;var S,w=0;for(S=0;_>S;++S)E[w++]=S,E[w++]=(S+1)%_,E[w++]=S+_,E[w++]=(S+1)%_+_;var T;if(o>0){var x=Math.min(o,_);T=Math.round(_/x)}var b=Math.min(T*o,_);if(o>0)for(S=0;b>S;S+=T)E[w++]=S,E[w++]=S+_;return{boundingSphere:v,attributes:f,indices:E}}function v(e){e=r(e,r.EMPTY_OBJECT);var i=e.center,o=r(e.ellipsoid,s.WGS84),a=e.semiMajorAxis,l=e.semiMinorAxis,u=r(e.granularity,d.RADIANS_PER_DEGREE),c=r(e.height,0),h=e.extrudedHeight,p=n(h)&&Math.abs(c-h)>1;this._center=t.clone(i),this._semiMajorAxis=a,this._semiMinorAxis=l,this._ellipsoid=s.clone(o),this._rotation=r(e.rotation,0),this._height=c,this._granularity=u,this._extrudedHeight=h,this._extrude=p,this._numberOfVerticalLines=Math.max(r(e.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"}var g=new t,_=new t,y=new e,C=new e;v.packedLength=t.packedLength+s.packedLength+9,v.pack=function(e,i,o){o=r(o,0),t.pack(e._center,i,o),o+=t.packedLength,s.pack(e._ellipsoid,i,o),o+=s.packedLength,i[o++]=e._semiMajorAxis,i[o++]=e._semiMinorAxis,i[o++]=e._rotation,i[o++]=e._height,i[o++]=e._granularity,i[o++]=n(e._extrudedHeight)?1:0,i[o++]=r(e._extrudedHeight,0),i[o++]=e._extrude?1:0,i[o]=e._numberOfVerticalLines};var E=new t,S=new s,w={center:E,ellipsoid:S,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0};return v.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,E);i+=t.packedLength;var l=s.unpack(e,i,S);i+=s.packedLength;var u=e[i++],c=e[i++],h=e[i++],d=e[i++],p=e[i++],m=e[i++],f=e[i++],g=1===e[i++],_=e[i];return n(o)?(o._center=t.clone(a,o._center),o._ellipsoid=s.clone(l,o._ellipsoid),o._semiMajorAxis=u,o._semiMinorAxis=c,o._rotation=h,o._height=d,o._granularity=p,o._extrudedHeight=m?f:void 0,o._extrude=g,o._numberOfVerticalLines=_,o):(w.height=d,w.extrudedHeight=m?f:void 0,w.granularity=p,w.rotation=h,w.semiMajorAxis=u,w.semiMinorAxis=c,w.numberOfVerticalLines=_,new v(w))},v.createGeometry=function(e){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,i={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};return e._extrude?(i.extrudedHeight=Math.min(e._extrudedHeight,e._height),i.height=Math.max(e._extrudedHeight,e._height),t=f(i)):t=m(i),new l({attributes:t.attributes,indices:t.indices,primitiveType:p.LINES,boundingSphere:t.boundingSphere})},v}),i("Core/CircleOutlineGeometry",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./EllipseOutlineGeometry","./Ellipsoid"],function(e,t,i,r,n,o){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT);var i=e.radius,r={center:e.center,semiMajorAxis:i,semiMinorAxis:i,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new n(r),this._workerName="createCircleOutlineGeometry"}a.packedLength=n.packedLength,a.pack=function(e,t,i){n.pack(e._ellipseGeometry,t,i)};var s=new n({center:new e,semiMajorAxis:1,semiMinorAxis:1}),l={center:new e,radius:void 0,ellipsoid:o.clone(o.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};return a.unpack=function(t,r,u){var c=n.unpack(t,r,s);return l.center=e.clone(c._center,l.center),l.ellipsoid=o.clone(c._ellipsoid,l.ellipsoid),l.height=c._height,l.extrudedHeight=c._extrudedHeight,l.granularity=c._granularity,l.numberOfVerticalLines=c._numberOfVerticalLines,i(u)?(l.semiMajorAxis=c._semiMajorAxis,l.semiMinorAxis=c._semiMinorAxis,u._ellipseGeometry=new n(l),u):(l.radius=c._semiMajorAxis,new a(l))},a.createGeometry=function(e){return n.createGeometry(e._ellipseGeometry)},a}),i("Core/ClockRange",["./freezeObject"],function(e){"use strict";var t={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};return e(t)}),i("Core/ClockStep",["./freezeObject"],function(e){"use strict";var t={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};return e(t)}),i("Core/getTimestamp",["./defined"],function(e){"use strict";var t;return t="undefined"!=typeof performance&&e(performance.now)?function(){return performance.now()}:function(){return Date.now()}}),i("Core/Clock",["./ClockRange","./ClockStep","./defaultValue","./defined","./DeveloperError","./Event","./getTimestamp","./JulianDate"],function(e,t,i,r,n,o,a,s){"use strict";function l(n){n=i(n,i.EMPTY_OBJECT);var l=n.startTime,u=!r(l),c=n.stopTime,h=!r(c),d=n.currentTime,p=!r(d);u&&h&&p?(d=s.now(),l=s.clone(d),c=s.addDays(d,1,new s)):u&&h?(l=s.clone(d),c=s.addDays(d,1,new s)):u&&p?(l=s.addDays(c,-1,new s),d=s.clone(l)):p&&h?(d=s.clone(l),c=s.addDays(l,1,new s)):p?d=s.clone(l):h?c=s.addDays(d,1,new s):u&&(l=s.clone(d)),this.startTime=l,this.stopTime=c,this.currentTime=d,this.multiplier=i(n.multiplier,1),this.clockStep=i(n.clockStep,t.SYSTEM_CLOCK_MULTIPLIER),this.clockRange=i(n.clockRange,e.UNBOUNDED),this.canAnimate=i(n.canAnimate,!0),this.shouldAnimate=i(n.shouldAnimate,!0),this.onTick=new o,this._lastSystemTime=a()}return l.prototype.tick=function(){var i=a(),r=s.clone(this.currentTime),n=this.startTime,o=this.stopTime,l=this.multiplier;if(this.canAnimate&&this.shouldAnimate)if(this.clockStep===t.SYSTEM_CLOCK)r=s.now(r);else{if(this.clockStep===t.TICK_DEPENDENT)r=s.addSeconds(r,l,r);else{var u=i-this._lastSystemTime;r=s.addSeconds(r,l*(u/1e3),r)}if(this.clockRange===e.CLAMPED)s.lessThan(r,n)?r=s.clone(n,r):s.greaterThan(r,o)&&(r=s.clone(o,r));else if(this.clockRange===e.LOOP_STOP)for(s.lessThan(r,n)&&(r=s.clone(n,r));s.greaterThan(r,o);)r=s.addSeconds(n,s.secondsDifference(r,o),r)}return this.currentTime=r,this._lastSystemTime=i,this.onTick.raiseEvent(this),r},l}),i("Core/Color",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math"],function(e,t,i,r,n,o){"use strict";function a(e,t,i){return 0>i&&(i+=1),i>1&&(i-=1),1>6*i?e+6*(t-e)*i:1>2*i?t:2>3*i?e+(t-e)*(2/3-i)*6:e}function s(t,i,r,n){this.red=e(t,1),this.green=e(i,1),this.blue=e(r,1),this.alpha=e(n,1); -}s.fromCartesian4=function(e,i){return t(i)?(i.red=e.x,i.green=e.y,i.blue=e.z,i.alpha=e.w,i):new s(e.x,e.y,e.z,e.w)},s.fromBytes=function(i,r,n,o,a){return i=s.byteToFloat(e(i,255)),r=s.byteToFloat(e(r,255)),n=s.byteToFloat(e(n,255)),o=s.byteToFloat(e(o,255)),t(a)?(a.red=i,a.green=r,a.blue=n,a.alpha=o,a):new s(i,r,n,o)},s.fromAlpha=function(e,i,r){return t(r)?(r.red=e.red,r.green=e.green,r.blue=e.blue,r.alpha=i,r):new s(e.red,e.green,e.blue,i)};var l,u,c;r.supportsTypedArrays()&&(l=new ArrayBuffer(4),u=new Uint32Array(l),c=new Uint8Array(l)),s.fromRgba=function(e){return u[0]=e,s.fromBytes(c[0],c[1],c[2],c[3])},s.fromHsl=function(t,i,r,n){t=e(t,0)%1,i=e(i,0),r=e(r,0),n=e(n,1);var o=r,l=r,u=r;if(0!==i){var c;c=.5>r?r*(1+i):r+i-r*i;var h=2*r-c;o=a(h,c,t+1/3),l=a(h,c,t),u=a(h,c,t-1/3)}return new s(o,l,u,n)},s.fromRandom=function(i,r){i=e(i,e.EMPTY_OBJECT);var n=i.red;if(!t(n)){var a=e(i.minimumRed,0),l=e(i.maximumRed,1);n=a+o.nextRandomNumber()*(l-a)}var u=i.green;if(!t(u)){var c=e(i.minimumGreen,0),h=e(i.maximumGreen,1);u=c+o.nextRandomNumber()*(h-c)}var d=i.blue;if(!t(d)){var p=e(i.minimumBlue,0),m=e(i.maximumBlue,1);d=p+o.nextRandomNumber()*(m-p)}var f=i.alpha;if(!t(f)){var v=e(i.minimumAlpha,0),g=e(i.maximumAlpha,1);f=v+o.nextRandomNumber()*(g-v)}return t(r)?(r.red=n,r.green=u,r.blue=d,r.alpha=f,r):new s(n,u,d,f)};var h=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,d=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,p=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,m=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return s.fromCssColorString=function(i){var r=s[i.toUpperCase()];if(t(r))return s.clone(r);var n=h.exec(i);return null!==n?new s(parseInt(n[1],16)/15,parseInt(n[2],16)/15,parseInt(n[3],16)/15):(n=d.exec(i),null!==n?new s(parseInt(n[1],16)/255,parseInt(n[2],16)/255,parseInt(n[3],16)/255):(n=p.exec(i),null!==n?new s(parseFloat(n[1])/("%"===n[1].substr(-1)?100:255),parseFloat(n[2])/("%"===n[2].substr(-1)?100:255),parseFloat(n[3])/("%"===n[3].substr(-1)?100:255),parseFloat(e(n[4],"1.0"))):(n=m.exec(i),null!==n?s.fromHsl(parseFloat(n[1])/360,parseFloat(n[2])/100,parseFloat(n[3])/100,parseFloat(e(n[4],"1.0"))):void 0)))},s.packedLength=4,s.pack=function(t,i,r){r=e(r,0),i[r++]=t.red,i[r++]=t.green,i[r++]=t.blue,i[r]=t.alpha},s.unpack=function(i,r,n){return r=e(r,0),t(n)||(n=new s),n.red=i[r++],n.green=i[r++],n.blue=i[r++],n.alpha=i[r],n},s.byteToFloat=function(e){return e/255},s.floatToByte=function(e){return 1===e?255:256*e|0},s.clone=function(e,i){return t(e)?t(i)?(i.red=e.red,i.green=e.green,i.blue=e.blue,i.alpha=e.alpha,i):new s(e.red,e.green,e.blue,e.alpha):void 0},s.equals=function(e,i){return e===i||t(e)&&t(i)&&e.red===i.red&&e.green===i.green&&e.blue===i.blue&&e.alpha===i.alpha},s.equalsArray=function(e,t,i){return e.red===t[i]&&e.green===t[i+1]&&e.blue===t[i+2]&&e.alpha===t[i+3]},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.prototype.equalsEpsilon=function(e,i){return this===e||t(e)&&Math.abs(this.red-e.red)<=i&&Math.abs(this.green-e.green)<=i&&Math.abs(this.blue-e.blue)<=i&&Math.abs(this.alpha-e.alpha)<=i},s.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},s.prototype.toCssColorString=function(){var e=s.floatToByte(this.red),t=s.floatToByte(this.green),i=s.floatToByte(this.blue);return 1===this.alpha?"rgb("+e+","+t+","+i+")":"rgba("+e+","+t+","+i+","+this.alpha+")"},s.prototype.toBytes=function(e){var i=s.floatToByte(this.red),r=s.floatToByte(this.green),n=s.floatToByte(this.blue),o=s.floatToByte(this.alpha);return t(e)?(e[0]=i,e[1]=r,e[2]=n,e[3]=o,e):[i,r,n,o]},s.prototype.toRgba=function(){return c[0]=s.floatToByte(this.red),c[1]=s.floatToByte(this.green),c[2]=s.floatToByte(this.blue),c[3]=s.floatToByte(this.alpha),u[0]},s.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t},s.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t},s.prototype.withAlpha=function(e,t){return s.fromAlpha(this,e,t)},s.ALICEBLUE=n(s.fromCssColorString("#F0F8FF")),s.ANTIQUEWHITE=n(s.fromCssColorString("#FAEBD7")),s.AQUA=n(s.fromCssColorString("#00FFFF")),s.AQUAMARINE=n(s.fromCssColorString("#7FFFD4")),s.AZURE=n(s.fromCssColorString("#F0FFFF")),s.BEIGE=n(s.fromCssColorString("#F5F5DC")),s.BISQUE=n(s.fromCssColorString("#FFE4C4")),s.BLACK=n(s.fromCssColorString("#000000")),s.BLANCHEDALMOND=n(s.fromCssColorString("#FFEBCD")),s.BLUE=n(s.fromCssColorString("#0000FF")),s.BLUEVIOLET=n(s.fromCssColorString("#8A2BE2")),s.BROWN=n(s.fromCssColorString("#A52A2A")),s.BURLYWOOD=n(s.fromCssColorString("#DEB887")),s.CADETBLUE=n(s.fromCssColorString("#5F9EA0")),s.CHARTREUSE=n(s.fromCssColorString("#7FFF00")),s.CHOCOLATE=n(s.fromCssColorString("#D2691E")),s.CORAL=n(s.fromCssColorString("#FF7F50")),s.CORNFLOWERBLUE=n(s.fromCssColorString("#6495ED")),s.CORNSILK=n(s.fromCssColorString("#FFF8DC")),s.CRIMSON=n(s.fromCssColorString("#DC143C")),s.CYAN=n(s.fromCssColorString("#00FFFF")),s.DARKBLUE=n(s.fromCssColorString("#00008B")),s.DARKCYAN=n(s.fromCssColorString("#008B8B")),s.DARKGOLDENROD=n(s.fromCssColorString("#B8860B")),s.DARKGRAY=n(s.fromCssColorString("#A9A9A9")),s.DARKGREEN=n(s.fromCssColorString("#006400")),s.DARKGREY=s.DARKGRAY,s.DARKKHAKI=n(s.fromCssColorString("#BDB76B")),s.DARKMAGENTA=n(s.fromCssColorString("#8B008B")),s.DARKOLIVEGREEN=n(s.fromCssColorString("#556B2F")),s.DARKORANGE=n(s.fromCssColorString("#FF8C00")),s.DARKORCHID=n(s.fromCssColorString("#9932CC")),s.DARKRED=n(s.fromCssColorString("#8B0000")),s.DARKSALMON=n(s.fromCssColorString("#E9967A")),s.DARKSEAGREEN=n(s.fromCssColorString("#8FBC8F")),s.DARKSLATEBLUE=n(s.fromCssColorString("#483D8B")),s.DARKSLATEGRAY=n(s.fromCssColorString("#2F4F4F")),s.DARKSLATEGREY=s.DARKSLATEGRAY,s.DARKTURQUOISE=n(s.fromCssColorString("#00CED1")),s.DARKVIOLET=n(s.fromCssColorString("#9400D3")),s.DEEPPINK=n(s.fromCssColorString("#FF1493")),s.DEEPSKYBLUE=n(s.fromCssColorString("#00BFFF")),s.DIMGRAY=n(s.fromCssColorString("#696969")),s.DIMGREY=s.DIMGRAY,s.DODGERBLUE=n(s.fromCssColorString("#1E90FF")),s.FIREBRICK=n(s.fromCssColorString("#B22222")),s.FLORALWHITE=n(s.fromCssColorString("#FFFAF0")),s.FORESTGREEN=n(s.fromCssColorString("#228B22")),s.FUSCHIA=n(s.fromCssColorString("#FF00FF")),s.GAINSBORO=n(s.fromCssColorString("#DCDCDC")),s.GHOSTWHITE=n(s.fromCssColorString("#F8F8FF")),s.GOLD=n(s.fromCssColorString("#FFD700")),s.GOLDENROD=n(s.fromCssColorString("#DAA520")),s.GRAY=n(s.fromCssColorString("#808080")),s.GREEN=n(s.fromCssColorString("#008000")),s.GREENYELLOW=n(s.fromCssColorString("#ADFF2F")),s.GREY=s.GRAY,s.HONEYDEW=n(s.fromCssColorString("#F0FFF0")),s.HOTPINK=n(s.fromCssColorString("#FF69B4")),s.INDIANRED=n(s.fromCssColorString("#CD5C5C")),s.INDIGO=n(s.fromCssColorString("#4B0082")),s.IVORY=n(s.fromCssColorString("#FFFFF0")),s.KHAKI=n(s.fromCssColorString("#F0E68C")),s.LAVENDER=n(s.fromCssColorString("#E6E6FA")),s.LAVENDAR_BLUSH=n(s.fromCssColorString("#FFF0F5")),s.LAWNGREEN=n(s.fromCssColorString("#7CFC00")),s.LEMONCHIFFON=n(s.fromCssColorString("#FFFACD")),s.LIGHTBLUE=n(s.fromCssColorString("#ADD8E6")),s.LIGHTCORAL=n(s.fromCssColorString("#F08080")),s.LIGHTCYAN=n(s.fromCssColorString("#E0FFFF")),s.LIGHTGOLDENRODYELLOW=n(s.fromCssColorString("#FAFAD2")),s.LIGHTGRAY=n(s.fromCssColorString("#D3D3D3")),s.LIGHTGREEN=n(s.fromCssColorString("#90EE90")),s.LIGHTGREY=s.LIGHTGRAY,s.LIGHTPINK=n(s.fromCssColorString("#FFB6C1")),s.LIGHTSEAGREEN=n(s.fromCssColorString("#20B2AA")),s.LIGHTSKYBLUE=n(s.fromCssColorString("#87CEFA")),s.LIGHTSLATEGRAY=n(s.fromCssColorString("#778899")),s.LIGHTSLATEGREY=s.LIGHTSLATEGRAY,s.LIGHTSTEELBLUE=n(s.fromCssColorString("#B0C4DE")),s.LIGHTYELLOW=n(s.fromCssColorString("#FFFFE0")),s.LIME=n(s.fromCssColorString("#00FF00")),s.LIMEGREEN=n(s.fromCssColorString("#32CD32")),s.LINEN=n(s.fromCssColorString("#FAF0E6")),s.MAGENTA=n(s.fromCssColorString("#FF00FF")),s.MAROON=n(s.fromCssColorString("#800000")),s.MEDIUMAQUAMARINE=n(s.fromCssColorString("#66CDAA")),s.MEDIUMBLUE=n(s.fromCssColorString("#0000CD")),s.MEDIUMORCHID=n(s.fromCssColorString("#BA55D3")),s.MEDIUMPURPLE=n(s.fromCssColorString("#9370DB")),s.MEDIUMSEAGREEN=n(s.fromCssColorString("#3CB371")),s.MEDIUMSLATEBLUE=n(s.fromCssColorString("#7B68EE")),s.MEDIUMSPRINGGREEN=n(s.fromCssColorString("#00FA9A")),s.MEDIUMTURQUOISE=n(s.fromCssColorString("#48D1CC")),s.MEDIUMVIOLETRED=n(s.fromCssColorString("#C71585")),s.MIDNIGHTBLUE=n(s.fromCssColorString("#191970")),s.MINTCREAM=n(s.fromCssColorString("#F5FFFA")),s.MISTYROSE=n(s.fromCssColorString("#FFE4E1")),s.MOCCASIN=n(s.fromCssColorString("#FFE4B5")),s.NAVAJOWHITE=n(s.fromCssColorString("#FFDEAD")),s.NAVY=n(s.fromCssColorString("#000080")),s.OLDLACE=n(s.fromCssColorString("#FDF5E6")),s.OLIVE=n(s.fromCssColorString("#808000")),s.OLIVEDRAB=n(s.fromCssColorString("#6B8E23")),s.ORANGE=n(s.fromCssColorString("#FFA500")),s.ORANGERED=n(s.fromCssColorString("#FF4500")),s.ORCHID=n(s.fromCssColorString("#DA70D6")),s.PALEGOLDENROD=n(s.fromCssColorString("#EEE8AA")),s.PALEGREEN=n(s.fromCssColorString("#98FB98")),s.PALETURQUOISE=n(s.fromCssColorString("#AFEEEE")),s.PALEVIOLETRED=n(s.fromCssColorString("#DB7093")),s.PAPAYAWHIP=n(s.fromCssColorString("#FFEFD5")),s.PEACHPUFF=n(s.fromCssColorString("#FFDAB9")),s.PERU=n(s.fromCssColorString("#CD853F")),s.PINK=n(s.fromCssColorString("#FFC0CB")),s.PLUM=n(s.fromCssColorString("#DDA0DD")),s.POWDERBLUE=n(s.fromCssColorString("#B0E0E6")),s.PURPLE=n(s.fromCssColorString("#800080")),s.RED=n(s.fromCssColorString("#FF0000")),s.ROSYBROWN=n(s.fromCssColorString("#BC8F8F")),s.ROYALBLUE=n(s.fromCssColorString("#4169E1")),s.SADDLEBROWN=n(s.fromCssColorString("#8B4513")),s.SALMON=n(s.fromCssColorString("#FA8072")),s.SANDYBROWN=n(s.fromCssColorString("#F4A460")),s.SEAGREEN=n(s.fromCssColorString("#2E8B57")),s.SEASHELL=n(s.fromCssColorString("#FFF5EE")),s.SIENNA=n(s.fromCssColorString("#A0522D")),s.SILVER=n(s.fromCssColorString("#C0C0C0")),s.SKYBLUE=n(s.fromCssColorString("#87CEEB")),s.SLATEBLUE=n(s.fromCssColorString("#6A5ACD")),s.SLATEGRAY=n(s.fromCssColorString("#708090")),s.SLATEGREY=s.SLATEGRAY,s.SNOW=n(s.fromCssColorString("#FFFAFA")),s.SPRINGGREEN=n(s.fromCssColorString("#00FF7F")),s.STEELBLUE=n(s.fromCssColorString("#4682B4")),s.TAN=n(s.fromCssColorString("#D2B48C")),s.TEAL=n(s.fromCssColorString("#008080")),s.THISTLE=n(s.fromCssColorString("#D8BFD8")),s.TOMATO=n(s.fromCssColorString("#FF6347")),s.TURQUOISE=n(s.fromCssColorString("#40E0D0")),s.VIOLET=n(s.fromCssColorString("#EE82EE")),s.WHEAT=n(s.fromCssColorString("#F5DEB3")),s.WHITE=n(s.fromCssColorString("#FFFFFF")),s.WHITESMOKE=n(s.fromCssColorString("#F5F5F5")),s.YELLOW=n(s.fromCssColorString("#FFFF00")),s.YELLOWGREEN=n(s.fromCssColorString("#9ACD32")),s.TRANSPARENT=n(new s(0,0,0,0)),s}),i("Core/ColorGeometryInstanceAttribute",["./Color","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,i,r,n,o){"use strict";function a(t,r,n,o){t=i(t,1),r=i(r,1),n=i(n,1),o=i(o,1),this.value=new Uint8Array([e.floatToByte(t),e.floatToByte(r),e.floatToByte(n),e.floatToByte(o)])}return n(a.prototype,{componentDatatype:{get:function(){return t.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}}),a.fromColor=function(e){return new a(e.red,e.green,e.blue,e.alpha)},a.toValue=function(e,t){return r(t)?e.toBytes(t):new Uint8Array(e.toBytes())},a.equals=function(e,t){return e===t||r(e)&&r(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]},a}),i("Core/combine",["./defaultValue","./defined"],function(e,t){"use strict";function i(r,n,o){o=e(o,!1);var a,s,l,u={},c=t(r),h=t(n);if(c)for(a in r)r.hasOwnProperty(a)&&(s=r[a],h&&o&&"object"==typeof s&&n.hasOwnProperty(a)?(l=n[a],"object"==typeof l?u[a]=i(s,l,o):u[a]=s):u[a]=s);if(h)for(a in n)n.hasOwnProperty(a)&&!u.hasOwnProperty(a)&&(l=n[a],u[a]=l);return u}return i}),i("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(t)}),i("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),i("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){var t=e._uSquared,i=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,n=(i-r)/i,o=Math.cos(e._startHeading),a=Math.sin(e._startHeading),s=(1-n)*Math.tan(e._start.latitude),l=1/Math.sqrt(1+s*s),u=l*s,c=Math.atan2(s,o),h=l*a,d=h*h,p=1-d,m=Math.sqrt(p),f=t/4,v=f*f,g=v*f,_=v*v,y=1+f-3*v/4+5*g/4-175*_/64,C=1-f+15*v/8-35*g/8,E=1-3*f+35*v/4,S=1-5*f,w=y*c-C*Math.sin(2*c)*f/2-E*Math.sin(4*c)*v/16-S*Math.sin(6*c)*g/48-5*Math.sin(8*c)*_/512,T=e._constants;T.a=i,T.b=r,T.f=n,T.cosineHeading=o,T.sineHeading=a,T.tanU=s,T.cosineU=l,T.sineU=u,T.sigma=c,T.sineAlpha=h,T.sineSquaredAlpha=d,T.cosineSquaredAlpha=p,T.cosineAlpha=m,T.u2Over4=f,T.u4Over16=v,T.u6Over64=g,T.u8Over256=_,T.a0=y,T.a1=C,T.a2=E,T.a3=S,T.distanceRatio=w}function u(e,t){return e*t*(4+e*(4-3*t))/16}function c(e,t,i,r,n,o,a){var s=u(e,i);return(1-s)*e*t*(r+s*n*(a+s*o*(2*a*a-1)))}function h(e,t,i,r,n,o,a){var l,u,h,d,p,m=(t-i)/t,f=o-r,v=Math.atan((1-m)*Math.tan(n)),g=Math.atan((1-m)*Math.tan(a)),_=Math.cos(v),y=Math.sin(v),C=Math.cos(g),E=Math.sin(g),S=_*C,w=_*E,T=y*E,x=y*C,b=f,A=s.TWO_PI,P=Math.cos(b),I=Math.sin(b);do{P=Math.cos(b),I=Math.sin(b);var M=w-x*P;h=Math.sqrt(C*C*I*I+M*M),u=T+S*P,l=Math.atan2(h,u);var D;0===h?(D=0,d=1):(D=S*I/h,d=1-D*D),A=b,p=u-2*T/d,isNaN(p)&&(p=0),b=f+c(m,D,d,l,h,u,p)}while(Math.abs(b-A)>s.EPSILON12);var R=d*(t*t-i*i)/(i*i),O=1+R*(4096+R*(R*(320-175*R)-768))/16384,N=R*(256+R*(R*(74-47*R)-128))/1024,L=p*p,F=N*h*(p+N*(u*(2*L-1)-N*p*(4*h*h-3)*(4*L-3)/6)/4),B=i*O*(l-F),V=Math.atan2(C*I,w-x*P),k=Math.atan2(_*I,w*P-x);e._distance=B,e._startHeading=V,e._endHeading=k,e._uSquared=R}function d(i,r,n,o){e.normalize(o.cartographicToCartesian(r,f),m),e.normalize(o.cartographicToCartesian(n,f),f);h(i,o.maximumRadius,o.minimumRadius,r.longitude,r.latitude,n.longitude,n.latitude),i._start=t.clone(r,i._start),i._end=t.clone(n,i._end),i._start.height=0,i._end.height=0,l(i)}function p(e,n,o){var s=i(o,a.WGS84);this._ellipsoid=s,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(n)&&d(this,e,n,s)}var m=new e,f=new e;return n(p.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),p.prototype.setEndPoints=function(e,t){d(this,e,t,this._ellipsoid)},p.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},p.prototype.interpolateUsingSurfaceDistance=function(e,i){var n=this._constants,o=n.distanceRatio+e/n.b,a=Math.cos(2*o),s=Math.cos(4*o),l=Math.cos(6*o),u=Math.sin(2*o),h=Math.sin(4*o),d=Math.sin(6*o),p=Math.sin(8*o),m=o*o,f=o*m,v=n.u8Over256,g=n.u2Over4,_=n.u6Over64,y=n.u4Over16,C=2*f*v*a/3+o*(1-g+7*y/4-15*_/4+579*v/64-(y-15*_/4+187*v/16)*a-(5*_/4-115*v/16)*s-29*v*l/16)+(g/2-y+71*_/32-85*v/16)*u+(5*y/16-5*_/4+383*v/96)*h-m*((_-11*v/2)*u+5*v*h/2)+(29*_/96-29*v/16)*d+539*v*p/1536,E=Math.asin(Math.sin(C)*n.cosineAlpha),S=Math.atan(n.a/n.b*Math.tan(E));C-=n.sigma;var w=Math.cos(2*n.sigma+C),T=Math.sin(C),x=Math.cos(C),b=n.cosineU*x,A=n.sineU*T,P=Math.atan2(T*n.sineHeading,b-A*n.cosineHeading),I=P-c(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,T,x,w);return r(i)?(i.longitude=this._start.longitude+I,i.latitude=S,i.height=0,i):new t(this._start.longitude+I,S,0)},p}),i("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(e,t,i){var r=T;r.length=e;var n;if(t===i){for(n=0;e>n;n++)r[n]=t;return r}var o=i-t,a=o/e;for(n=0;e>n;n++){var s=t+n*a;r[n]=s}return r}function p(t,i,r,n,o,a,s,l){var u=n.scaleToGeodeticSurface(t,P),c=n.scaleToGeodeticSurface(i,I),h=m.numberOfPoints(t,i,r),p=n.cartesianToCartographic(u,x),f=n.cartesianToCartographic(c,b),v=d(h,o,a);M.setEndPoints(p,f);var g=M.surfaceDistance/h,_=l;p.height=o;var y=n.cartographicToCartesian(p,A);e.pack(y,s,_),_+=3;for(var C=1;h>C;C++){var E=M.interpolateUsingSurfaceDistance(C*g,b);E.height=v[C],y=n.cartographicToCartesian(E,A),e.pack(y,s,_),_+=3}return _}var m={};m.numberOfPoints=function(t,i,r){var n=e.distance(t,i);return Math.ceil(n/r)};var f=new t;m.extractHeights=function(e,t){for(var i=e.length,r=new Array(i),n=0;i>n;n++){var o=e[n];r[n]=t.cartesianToCartographic(o,f).height}return r};var v=new c,g=new e,_=new e,y=new h(e.ZERO,0),C=new e,E=new h(e.ZERO,0),S=new e,w=new e,T=[],x=new t,b=new t,A=new e,P=new e,I=new e,M=new a;m.wrapLongitude=function(t,n){var o=[],a=[];if(r(t)&&t.length>0){n=i(n,c.IDENTITY);var l=c.inverseTransformation(n,v),u=c.multiplyByPoint(l,e.ZERO,g),d=c.multiplyByPointAsVector(l,e.UNIT_Y,_),p=h.fromPointNormal(u,d,y),m=c.multiplyByPointAsVector(l,e.UNIT_X,C),f=h.fromPointNormal(u,m,E),T=1;o.push(e.clone(t[0]));for(var x=o[0],b=t.length,A=1;b>A;++A){var P=t[A];if(h.getPointDistance(f,x)<0||h.getPointDistance(f,P)<0){var I=s.lineSegmentPlane(x,P,p,S);if(r(I)){var M=e.multiplyByScalar(d,5e-9,w);h.getPointDistance(p,x)<0&&e.negate(M,M),o.push(e.add(I,M,new e)),a.push(T+1),e.negate(M,M),o.push(e.add(I,M,new e)),T=1}}o.push(e.clone(t[A])),T++,x=P}a.push(T)}return{positions:o,lengths:a}};var D=u.EPSILON10;return m.removeDuplicates=function(t){var i=t.length;if(2>i)return t;var r,n,o;for(r=1;i>r&&(n=t[r-1],o=t[r],!e.equalsEpsilon(n,o,D));++r);if(r===i)return t;for(var a=t.slice(0,r);i>r;++r)o=t[r],e.equalsEpsilon(n,o,D)||(a.push(e.clone(o)),n=o);return a},m.generateArc=function(t){r(t)||(t={});var n=t.positions,a=n.length,s=i(t.ellipsoid,o.WGS84),c=i(t.height,0);if(1>a)return[];if(1===a){var h=s.scaleToGeodeticSurface(n[0],P);if(0!==c){var d=s.geodeticSurfaceNormal(h,A);e.multiplyByScalar(d,c,d),e.add(h,d,h)}return[h.x,h.y,h.z]}var f=t.minDistance;if(!r(f)){var v=i(t.granularity,u.RADIANS_PER_DEGREE);f=u.chordLength(v,s.maximumRadius)}var g,_=0;for(g=0;a-1>g;g++)_+=m.numberOfPoints(n[g],n[g+1],f);var y=3*(_+1),C=new Array(y),E=0,S=l(c);for(g=0;a-1>g;g++){var w=n[g],b=n[g+1],I=S?c[g]:c,M=S?c[g+1]:c;E=p(w,b,f,s,I,M,C,E)}T.length=0;var D=n[a-1],R=s.cartesianToCartographic(D,x);R.height=S?c[a-1]:c;var O=s.cartographicToCartesian(R,A);return e.pack(O,C,y-3),C},m.generateCartesianArc=function(t){for(var i=m.generateArc(t),r=i.length/3,n=new Array(r),o=0;r>o;o++)n[o]=e.unpack(i,3*o);return n},m}),i("Core/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(e,t){for(var i=new Array(e.length),r=0;ro;o++)c[o]=i;return c.push(r),c}var h=r-i,d=h/u;for(o=1;u>o;o++){var p=i+o*d;c[o]=p}return c[0]=i,c.push(r),c}function m(i,r,n,a){var s=new o(n,a),l=s.projectPointOntoPlane(t.add(n,i,j),j),u=s.projectPointOntoPlane(t.add(n,r,Y),Y),c=e.angleBetween(l,u);return u.x*l.y-u.y*l.x>=0?-c:c}function f(e,i,r,n,o,a,u,c){var d=k,p=z;L=h.eastNorthUpToFixedFrame(e,o,L),d=l.multiplyByPointAsVector(L,N,d),d=t.normalize(d,d);var f=m(d,i,e,o);B=s.fromRotationZ(f,B),U.z=a,L=l.multiplyTransformation(L,l.fromRotationTranslation(B,U,F),L);var v=V;v[0]=u;for(var g=0;c>g;g++)for(var _=0;_l;l++){s=e[l];var u=s.x-o,c=s.y-a;r[n++]=u,r[n++]=0,r[n++]=c,r[n++]=u,r[n++]=0,r[n++]=c}return s=e[0],r[n++]=s.x-o,r[n++]=0,r[n++]=s.y-a,r}function _(e,t){for(var i=e.length,r=new Array(3*i),n=0,o=t.x+t.width/2,a=t.y+t.height/2,s=0;i>s;s++)r[n++]=e[s].x-o,r[n++]=0,r[n++]=e[s].y-a;return r}function y(e,i,r,o,l,u,h,d,p,m){var v,g=t.angleBetween(t.subtract(i,e,M),t.subtract(r,e,D)),_=o===n.BEVELED?0:Math.ceil(g/a.toRadians(5));v=l?s.fromQuaternion(c.fromAxisAngle(t.negate(e,M),g/(_+1),W),q):s.fromQuaternion(c.fromAxisAngle(e,g/(_+1),W),q);var y,C;if(i=t.clone(i,H),_>0)for(var E=m?2:1,S=0;_>S;S++)i=s.multiplyByVector(v,i,i),y=t.subtract(i,e,M),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(i,D),h=f(C,y,d,h,u,p,1,E);else y=t.subtract(i,e,M),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(i,D),h=f(C,y,d,h,u,p,1,1),r=t.clone(r,H),y=t.subtract(r,e,M),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(r,D),h=f(C,y,d,h,u,p,1,1);return h}var C=[new t,new t],E=new t,S=new t,w=new t,T=new t,x=new t,b=new t,A=new t,P=new t,I=new t,M=new t,D=new t,R={},O=new r,N=new t(-1,0,0),L=new l,F=new l,B=new s,V=s.IDENTITY.clone(),k=new t,z=new i,U=new t,G=new t,W=new c,H=new t,q=new s;R.removeDuplicatesFromShape=function(t){for(var i=t.length,r=[],n=i-1,o=0;i>o;n=o++){var a=t[n],s=t[o];e.equals(a,s)||r.push(s)}return r};var j=new t,Y=new t;R.angleIsGreaterThanPi=function(e,i,r,n){var a=new o(r,n),s=a.projectPointOntoPlane(t.add(r,e,j),j),l=a.projectPointOntoPlane(t.add(r,i,Y),Y);return l.x*s.y-l.y*s.x>=0};var X=new t,Z=new t;return R.computePositions=function(e,i,r,o,s){var l=o._ellipsoid,c=d(e,l),h=o._granularity,m=o._cornerType,D=s?g(i,r):_(i,r),O=s?_(i,r):void 0,N=r.height/2,L=r.width/2,F=e.length,B=[],V=s?[]:void 0,k=E,z=S,U=w,G=T,W=x,H=b,q=A,j=P,Y=I,K=e[0],Q=e[1];G=l.geodeticSurfaceNormal(K,G),k=t.subtract(Q,K,k),k=t.normalize(k,k),j=t.cross(G,k,j),j=t.normalize(j,j);var J=c[0],$=c[1];s&&(V=f(K,j,O,V,l,J+N,1,1)),Y=t.clone(K,Y),K=Q,z=t.negate(k,z);for(var ee,te,ie=1;F-1>ie;ie++){var re=s?2:1;Q=e[ie+1],k=t.subtract(Q,K,k),k=t.normalize(k,k),U=t.add(k,z,U),U=t.normalize(U,U),G=l.geodeticSurfaceNormal(K,G);var ne=t.multiplyByScalar(G,t.dot(k,G),X);t.subtract(k,ne,ne),t.normalize(ne,ne);var oe=t.multiplyByScalar(G,t.dot(z,G),Z);t.subtract(z,oe,oe),t.normalize(oe,oe);var ae=!a.equalsEpsilon(Math.abs(t.dot(ne,oe)),1,a.EPSILON7);if(ae){U=t.cross(U,G,U),U=t.cross(G,U,U),U=t.normalize(U,U);var se=1/Math.max(.25,t.magnitude(t.cross(U,z,M))),le=R.angleIsGreaterThanPi(k,z,K,l);le?(W=t.add(K,t.multiplyByScalar(U,se*L,U),W),H=t.add(W,t.multiplyByScalar(j,L,H),H),C[0]=t.clone(Y,C[0]),C[1]=t.clone(H,C[1]),ee=p(C,J+N,$+N,h),te=u.generateArc({positions:C,granularity:h,ellipsoid:l}),B=v(te,j,D,B,l,ee,1),j=t.cross(G,k,j),j=t.normalize(j,j),q=t.add(W,t.multiplyByScalar(j,L,q),q),m===n.ROUNDED||m===n.BEVELED?y(W,H,q,m,le,l,B,D,$+N,s):(U=t.negate(U,U),B=f(K,U,D,B,l,$+N,se,re)),Y=t.clone(q,Y)):(W=t.add(K,t.multiplyByScalar(U,se*L,U),W),H=t.add(W,t.multiplyByScalar(j,-L,H),H),C[0]=t.clone(Y,C[0]),C[1]=t.clone(H,C[1]),ee=p(C,J+N,$+N,h),te=u.generateArc({positions:C,granularity:h,ellipsoid:l}),B=v(te,j,D,B,l,ee,1),j=t.cross(G,k,j),j=t.normalize(j,j),q=t.add(W,t.multiplyByScalar(j,-L,q),q),m===n.ROUNDED||m===n.BEVELED?y(W,H,q,m,le,l,B,D,$+N,s):B=f(K,U,D,B,l,$+N,se,re),Y=t.clone(q,Y)),z=t.negate(k,z)}else B=f(Y,j,D,B,l,J+N,1,1),Y=K;J=$,$=c[ie+1],K=Q}C[0]=t.clone(Y,C[0]),C[1]=t.clone(K,C[1]),ee=p(C,J+N,$+N,h),te=u.generateArc({positions:C,granularity:h,ellipsoid:l}),B=v(te,j,D,B,l,ee,1),s&&(V=f(K,j,O,V,l,$+N,1,1)),F=B.length;var ue=s?F+V.length:F,ce=new Float64Array(ue);return ce.set(B),s&&ce.set(V,F),ce},R}),i("Core/CorridorGeometryLibrary",["./Cartesian3","./CornerType","./defined","./isArray","./Math","./Matrix3","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./Quaternion"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(i,r,a,s,u){var c=e.angleBetween(e.subtract(r,i,f),e.subtract(a,i,v)),h=s===t.BEVELED?1:Math.ceil(c/n.toRadians(5))+1,d=3*h,p=new Array(d);p[d-3]=a.x,p[d-2]=a.y,p[d-1]=a.z;var m;m=u?o.fromQuaternion(l.fromAxisAngle(e.negate(i,f),c/h,M),D):o.fromQuaternion(l.fromAxisAngle(i,c/h,M),D);var g=0;r=e.clone(r,f);for(var _=0;h>_;_++)r=o.multiplyByVector(m,r,r),p[g++]=r.x,p[g++]=r.y,p[g++]=r.z;return p}function c(i){var r=C,n=E,o=S,a=i[1];n=e.fromArray(i[1],a.length-3,n),o=e.fromArray(i[0],0,o),r=e.multiplyByScalar(e.add(n,o,r),.5,r);var s=u(r,n,o,t.ROUNDED,!1),l=i.length-1,c=i[l-1];a=i[l],n=e.fromArray(c,c.length-3,n),o=e.fromArray(a,0,o),r=e.multiplyByScalar(e.add(n,o,r),.5,r);var h=u(r,n,o,t.ROUNDED,!1);return[s,h]}function h(t,i,r,n){var o=f;return n?o=e.add(t,i,o):(i=e.negate(i,i),o=e.add(t,i,o)),[o.x,o.y,o.z,r.x,r.y,r.z]}function d(t,i,r,n){for(var o=new Array(t.length),a=new Array(t.length),s=e.multiplyByScalar(i,r,f),l=e.negate(s,v),u=0,c=t.length-1,h=0;hY;Y++){_=l.geodeticSurfaceNormal(H,_),q=o[Y+1],M=e.normalize(e.subtract(q,H,M),M),L=e.normalize(e.add(M,D,L),L);var K=e.multiplyByScalar(_,e.dot(M,_),R);e.subtract(M,K,K),e.normalize(K,K);var Q=e.multiplyByScalar(_,e.dot(D,_),O);e.subtract(D,Q,Q),e.normalize(Q,Q);var J=!n.equalsEpsilon(Math.abs(e.dot(K,Q)),1,n.EPSILON7);if(J){L=e.cross(L,_,L),L=e.cross(_,L,L),L=e.normalize(L,L);var $=m/Math.max(.25,e.magnitude(e.cross(L,D,f))),ee=s.angleIsGreaterThanPi(M,D,H,l);L=e.multiplyByScalar(L,$,L),ee?(V=e.add(H,L,V),z=e.add(V,e.multiplyByScalar(N,m,z),z),k=e.add(V,e.multiplyByScalar(N,2*m,k),k),y[0]=e.clone(B,y[0]),y[1]=e.clone(z,y[1]),j=a.generateArc({positions:y,granularity:r,ellipsoid:l}),U=d(j,N,m,U),g&&(G.push(N.x,N.y,N.z),W.push(_.x,_.y,_.z)),F=e.clone(k,F),N=e.normalize(e.cross(_,M,N),N),k=e.add(V,e.multiplyByScalar(N,2*m,k),k),B=e.add(V,e.multiplyByScalar(N,m,B),B),v===t.ROUNDED||v===t.BEVELED?X.push({leftPositions:u(V,F,k,v,ee)}):X.push({leftPositions:h(H,e.negate(L,L),k,ee)})):(k=e.add(H,L,k),z=e.add(k,e.negate(e.multiplyByScalar(N,m,z),z),z),V=e.add(k,e.negate(e.multiplyByScalar(N,2*m,V),V),V),y[0]=e.clone(B,y[0]),y[1]=e.clone(z,y[1]),j=a.generateArc({positions:y,granularity:r,ellipsoid:l}),U=d(j,N,m,U),g&&(G.push(N.x,N.y,N.z),W.push(_.x,_.y,_.z)),F=e.clone(V,F),N=e.normalize(e.cross(_,M,N),N),V=e.add(k,e.negate(e.multiplyByScalar(N,2*m,V),V),V),B=e.add(k,e.negate(e.multiplyByScalar(N,m,B),B),B),v===t.ROUNDED||v===t.BEVELED?X.push({rightPositions:u(k,F,V,v,ee)}):X.push({rightPositions:h(H,L,V,ee)})),D=e.negate(M,D)}H=q}_=l.geodeticSurfaceNormal(H,_),y[0]=e.clone(B,y[0]),y[1]=e.clone(H,y[1]),j=a.generateArc({positions:y,granularity:r,ellipsoid:l}),U=d(j,N,m,U),g&&(G.push(N.x,N.y,N.z),W.push(_.x,_.y,_.z));var te;return v===t.ROUNDED&&(te=c(U)),{positions:U,corners:X,lefts:G,normals:W,endPositions:te}};var N=new e,L=new e;return m.scaleToGeodeticHeight=function(t,i,n,o){var a=t.length,s=r(o)?o:new Array(t.length);s.length=t.length;for(var l=i,u=0;a>u;u+=3){var c=n.scaleToGeodeticSurface(e.fromArray(t,u,L),L),h=N;0!==i&&(h=n.geodeticSurfaceNormal(c,h),h=e.multiplyByScalar(h,l,h),c=e.add(c,h,c)),s[u]=c.x,s[u+1]=c.y,s[u+2]=c.z}return s},m}),i("Core/CorridorGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v){"use strict";function g(e,i,r,o,a,s){var l=e.normals,u=e.tangents,c=e.binormals,h=t.normalize(t.cross(r,i,I),I);s.normal&&n.addAttribute(l,i,o,a),s.binormal&&n.addAttribute(c,r,o,a),s.tangent&&n.addAttribute(u,h,o,a)}function _(e,r,o){var s,l,u,m=e.positions,f=e.corners,v=e.endPositions,_=e.lefts,y=e.normals,C=new h,E=0,S=0,A=0;for(l=0;ll;l++)k=t.fromArray($,3*(K-1-l),k),V=t.fromArray($,3*(K+l),V),n.addAttribute(U,V,j),n.addAttribute(U,k,void 0,Y),g(q,X,Z,j,Y,r),L=j/3,B=L+1,N=(Y-2)/3,F=N-1,Q[J++]=N,Q[J++]=L,Q[J++]=F,Q[J++]=F,Q[J++]=L,Q[J++]=B,j+=3,Y-=3}var ee=0,te=0,ie=m[ee++],re=m[ee++];U.set(ie,j),U.set(re,Y-re.length+1),Z=t.fromArray(_,te,Z);var ne,oe;for(u=re.length-3,l=0;u>l;l+=3)ne=o.geodeticSurfaceNormal(t.fromArray(ie,l,I),I),oe=o.geodeticSurfaceNormal(t.fromArray(re,u-l,M),M),X=t.normalize(t.add(ne,oe,X),X),g(q,X,Z,j,Y,r),L=j/3,B=L+1,N=(Y-2)/3,F=N-1,Q[J++]=N,Q[J++]=L,Q[J++]=F,Q[J++]=F,Q[J++]=L,Q[J++]=B,j+=3,Y-=3;for(ne=o.geodeticSurfaceNormal(t.fromArray(ie,u,I),I),oe=o.geodeticSurfaceNormal(t.fromArray(re,u,M),M),X=t.normalize(t.add(ne,oe,X),X),te+=3,l=0;ll;l++)k=t.fromArray(me,3*(R-l-1),k),V=t.fromArray(me,3*l,V),n.addAttribute(U,k,void 0,Y),n.addAttribute(U,V,j),g(q,X,Z,j,Y,r),B=j/3,L=B-1,F=(Y-2)/3,N=F+1,Q[J++]=N,Q[J++]=L,Q[J++]=F,Q[J++]=F,Q[J++]=L,Q[J++]=B,j+=3,Y-=3}if(C.position=new c({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:U}),r.st){var fe,ve,ge=new Float32Array(z/3*2),_e=0;if(O){E/=3,S/=3;var ye=Math.PI/(R+1);ve=1/(E-R+1),fe=1/(S-R+1);var Ce,Ee=R/2;for(l=Ee+1;R+1>l;l++)Ce=p.PI_OVER_TWO+ye*l,ge[_e++]=fe*(1+Math.cos(Ce)),ge[_e++]=.5*(1+Math.sin(Ce));for(l=1;S-R+1>l;l++)ge[_e++]=l*fe,ge[_e++]=0;for(l=R;l>Ee;l--)Ce=p.PI_OVER_TWO-l*ye,ge[_e++]=1-fe*(1+Math.cos(Ce)),ge[_e++]=.5*(1+Math.sin(Ce));for(l=Ee;l>0;l--)Ce=p.PI_OVER_TWO-ye*l,ge[_e++]=1-ve*(1+Math.cos(Ce)),ge[_e++]=.5*(1+Math.sin(Ce));for(l=E-R;l>0;l--)ge[_e++]=l*ve,ge[_e++]=1;for(l=1;Ee+1>l;l++)Ce=p.PI_OVER_TWO+ye*l,ge[_e++]=ve*(1+Math.cos(Ce)),ge[_e++]=.5*(1+Math.sin(Ce))}else{for(E/=3,S/=3,ve=1/(E-1),fe=1/(S-1),l=0;S>l;l++)ge[_e++]=l*fe,ge[_e++]=0;for(l=E;l>0;l--)ge[_e++]=(l-1)*ve,ge[_e++]=1}C.st=new c({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:ge})}return r.normal&&(C.normal=new c({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:q.normals})),r.tangent&&(C.tangent=new c({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:q.tangents})),r.binormal&&(C.binormal=new c({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:q.binormals})),{attributes:C,indices:Q}}function y(e,i){if(!(i.normal||i.binormal||i.tangent||i.st))return e;var r,o,a=e.position.values;(i.normal||i.binormal)&&(r=e.normal.values,o=e.binormal.values);var s,l=e.position.values.length/18,u=3*l,c=2*l,h=2*u;if(i.normal||i.binormal||i.tangent){var d=i.normal?new Float32Array(6*u):void 0,p=i.binormal?new Float32Array(6*u):void 0,m=i.tangent?new Float32Array(6*u):void 0,f=w,v=T,g=x,_=b,y=A,C=P,E=h;for(s=0;u>s;s+=3){var S=E+h;f=t.fromArray(a,s,f),v=t.fromArray(a,s+u,v),g=t.fromArray(a,(s+3)%u,g),v=t.subtract(v,f,v),g=t.subtract(g,f,g),_=t.normalize(t.cross(v,g,_),_),i.normal&&(n.addAttribute(d,_,S),n.addAttribute(d,_,S+3),n.addAttribute(d,_,E),n.addAttribute(d,_,E+3)),(i.tangent||i.binormal)&&(C=t.fromArray(r,s,C),i.binormal&&(n.addAttribute(p,C,S),n.addAttribute(p,C,S+3),n.addAttribute(p,C,E),n.addAttribute(p,C,E+3)),i.tangent&&(y=t.normalize(t.cross(C,_,y),y),n.addAttribute(m,y,S),n.addAttribute(m,y,S+3),n.addAttribute(m,y,E),n.addAttribute(m,y,E+3))),E+=6}if(i.normal){for(d.set(r),s=0;u>s;s+=3)d[s+u]=-r[s],d[s+u+1]=-r[s+1],d[s+u+2]=-r[s+2];e.normal.values=d}else e.normal=void 0;if(i.binormal?(p.set(o),p.set(o,u),e.binormal.values=p):e.binormal=void 0,i.tangent){var I=e.tangent.values;m.set(I),m.set(I,u),e.tangent.values=m}}if(i.st){var M=e.st.values,D=new Float32Array(6*c);D.set(M),D.set(M,c);for(var R=2*c,O=0;2>O;O++){for(D[R++]=M[0],D[R++]=M[1],s=2;c>s;s+=2){var N=M[s],L=M[s+1];D[R++]=N,D[R++]=L,D[R++]=N,D[R++]=L}D[R++]=M[0],D[R++]=M[1]}e.st.values=D}return e}function C(e,t,i){i[t++]=e[0],i[t++]=e[1],i[t++]=e[2];for(var r=3;rE;E+=3){var b=c[E],A=c[E+1],P=c[E+2];T[x++]=P+p,T[x++]=A+p,T[x++]=b+p}u=y(u,t);var I,M,D,R;for(E=0;w>E;E+=2)I=E+w,M=I+w,D=I+1,R=M+1,T[x++]=I,T[x++]=M,T[x++]=D,T[x++]=D,T[x++]=M,T[x++]=R;return{attributes:u,indices:T}}function S(e){e=o(e,o.EMPTY_OBJECT);var i=e.positions,n=e.width;this._positions=i,this._ellipsoid=l.clone(o(e.ellipsoid,l.WGS84)),this._vertexFormat=v.clone(o(e.vertexFormat,v.DEFAULT)),this._width=n,this._height=o(e.height,0),this._extrudedHeight=o(e.extrudedHeight,this._height),this._cornerType=o(e.cornerType,r.ROUNDED),this._granularity=o(e.granularity,p.RADIANS_PER_DEGREE),this._workerName="createCorridorGeometry",this.packedLength=1+i.length*t.packedLength+l.packedLength+v.packedLength+5}var w=new t,T=new t,x=new t,b=new t,A=new t,P=new t,I=new t,M=new t;S.pack=function(e,i,r){r=o(r,0);var n=e._positions,a=n.length;i[r++]=a;for(var s=0;a>s;++s,r+=t.packedLength)t.pack(n[s],i,r);l.pack(e._ellipsoid,i,r),r+=l.packedLength,v.pack(e._vertexFormat,i,r),r+=v.packedLength,i[r++]=e._width,i[r++]=e._height,i[r++]=e._extrudedHeight,i[r++]=e._cornerType,i[r]=e._granularity};var D=l.clone(l.UNIT_SPHERE),R=new v,O={positions:void 0,ellipsoid:D,vertexFormat:R,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0};return S.unpack=function(e,i,r){i=o(i,0);for(var n=e[i++],s=new Array(n),u=0;n>u;++u,i+=t.packedLength)s[u]=t.unpack(e,i);var c=l.unpack(e,i,D);i+=l.packedLength;var h=v.unpack(e,i,R);i+=v.packedLength;var d=e[i++],p=e[i++],m=e[i++],f=e[i++],g=e[i];return a(r)?(r._positions=s,r._ellipsoid=l.clone(c,r._ellipsoid),r._vertexFormat=v.clone(h,r._vertexFormat),r._width=d,r._height=p,r._extrudedHeight=m,r._cornerType=f,r._granularity=g,r):(O.positions=s,O.width=d,O.height=p,O.extrudedHeight=m,O.cornerType=f,O.granularity=g,new S(O))},S.createGeometry=function(t){var i=t._positions,r=t._height,o=t._extrudedHeight,a=r!==o,s=m.removeDuplicates(i);if(!(s.length<2)){var l,c=t._ellipsoid,h=t._vertexFormat,d={ellipsoid:c,positions:s,width:t._width,cornerType:t._cornerType,granularity:t._granularity,saveAttributes:!0};if(a){var p=Math.max(r,o);o=Math.min(r,o),r=p,d.height=r,d.extrudedHeight=o,l=E(d,h)}else{var v=n.computePositions(d);l=_(v,h,c),l.attributes.position.values=n.scaleToGeodeticHeight(l.attributes.position.values,r,c,l.attributes.position.values)}var g=l.attributes,y=e.fromVertices(g.position.values,void 0,3);return h.position||(l.attributes.position.values=void 0),new u({attributes:g,indices:l.indices,primitiveType:f.TRIANGLES,boundingSphere:y})}},S.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new S({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:n,granularity:r,extrudedHeight:o,height:a,vertexFormat:v.POSITION_ONLY})},S}),i("Core/CorridorOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function v(e,o){var s,l,u,p=[],m=e.positions,f=e.corners,v=e.endPositions,g=new h,_=0,S=0,w=0;for(l=0;ll;l++)R=t.fromArray(z,3*(B-1-l),R),D=t.fromArray(z,3*(B+l),D),n.addAttribute(N,D,L),n.addAttribute(N,R,void 0,F),P=L/3,M=P+1,A=(F-2)/3,I=A-1,V[k++]=A,V[k++]=I,V[k++]=P,V[k++]=M,L+=3,F-=3}var U=0,G=m[U++],W=m[U++];for(N.set(G,L),N.set(W,F-W.length+1),u=W.length-3,p.push(L/3,(F-2)/3),l=0;u>l;l+=3)P=L/3,M=P+1,A=(F-2)/3,I=A-1,V[k++]=A,V[k++]=I,V[k++]=P,V[k++]=M,L+=3,F-=3;for(l=0;ll;l++)R=t.fromArray(Z,3*(x-l-1),R),D=t.fromArray(Z,3*l,D),n.addAttribute(N,R,void 0,F),n.addAttribute(N,D,L),M=L/3,P=M-1,I=(F-2)/3,A=I+1,V[k++]=A,V[k++]=I,V[k++]=P,V[k++]=M,L+=3,F-=3;p.push(L/3)}else p.push(L/3,(F-2)/3);return V[k++]=L/3,V[k++]=(F-2)/3,g.position=new c({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:N}),{attributes:g,indices:V,wallIndices:p}}function g(e){var t=e.ellipsoid,i=n.computePositions(e),r=v(i,e.cornerType),o=r.wallIndices,a=e.height,s=e.extrudedHeight,l=r.attributes,u=r.indices,c=l.position.values,h=c.length,p=new Float64Array(h);p.set(c);var m=new Float64Array(2*h);c=n.scaleToGeodeticHeight(c,a,t,c),p=n.scaleToGeodeticHeight(p,s,t,p),m.set(c),m.set(p,h),l.position.values=m,h/=3;var f,g=u.length,_=d.createTypedArray(m.length/3,2*(g+o.length));_.set(u);var y=g;for(f=0;g>f;f+=2){var C=u[f],E=u[f+1];_[y++]=C+h,_[y++]=E+h}var S,w;for(f=0;fs;++s,r+=t.packedLength)t.pack(n[s],i,r);l.pack(e._ellipsoid,i,r),r+=l.packedLength,i[r++]=e._width,i[r++]=e._height,i[r++]=e._extrudedHeight,i[r++]=e._cornerType,i[r]=e._granularity};var S=l.clone(l.UNIT_SPHERE),w={positions:void 0,ellipsoid:S,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0};return _.unpack=function(e,i,r){i=o(i,0);for(var n=e[i++],s=new Array(n),u=0;n>u;++u,i+=t.packedLength)s[u]=t.unpack(e,i);var c=l.unpack(e,i,S);i+=l.packedLength;var h=e[i++],d=e[i++],p=e[i++],m=e[i++],f=e[i];return a(r)?(r._positions=s,r._ellipsoid=l.clone(c,r._ellipsoid),r._width=h,r._height=d,r._extrudedHeight=p,r._cornerType=m,r._granularity=f,r):(w.positions=s,w.width=h,w.height=d,w.extrudedHeight=p,w.cornerType=m,w.granularity=f,new _(w))},_.createGeometry=function(t){var i=t._positions,r=t._height,o=t._extrudedHeight,a=r!==o,s=m.removeDuplicates(i);if(!(s.length<2)){var l,c=t._ellipsoid,h={ellipsoid:c,positions:s,width:t._width,cornerType:t._cornerType,granularity:t._granularity,saveAttributes:!1};if(a){var d=Math.max(r,o);o=Math.min(r,o),r=d,h.height=r,h.extrudedHeight=o,l=g(h)}else{var p=n.computePositions(h);l=v(p,h.cornerType),l.attributes.position.values=n.scaleToGeodeticHeight(l.attributes.position.values,r,c,l.attributes.position.values)}var _=l.attributes,y=e.fromVertices(_.position.values,void 0,3);return new u({attributes:_,indices:l.indices,primitiveType:f.LINES,boundingSphere:y})}},_}),i("Core/createGuid",[],function(){"use strict";function e(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,i="x"===e?t:3&t|8;return i.toString(16)})}return e}),i("Core/CylinderGeometryLibrary",["./Math"],function(e){"use strict";var t={};return t.computePositions=function(t,i,r,n,o){var a,s=.5*t,l=-s,u=n+n,c=o?2*u:u,h=new Float64Array(3*c),d=0,p=0,m=o?3*u:0,f=o?3*(u+n):3*n;for(a=0;n>a;a++){var v=a/n*e.TWO_PI,g=Math.cos(v),_=Math.sin(v),y=g*r,C=_*r,E=g*i,S=_*i;h[p+m]=y,h[p+m+1]=C,h[p+m+2]=l,h[p+f]=E,h[p+f+1]=S,h[p+f+2]=s,p+=3,o&&(h[d++]=y,h[d++]=C,h[d++]=l,h[d++]=E,h[d++]=S,h[d++]=s)}return h},t}),i("Core/CylinderGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e){e=o(e,o.EMPTY_OBJECT);var t=e.length,i=e.topRadius,r=e.bottomRadius,n=o(e.vertexFormat,m.DEFAULT),a=o(e.slices,128);this._length=t,this._topRadius=i,this._bottomRadius=r,this._vertexFormat=m.clone(n),this._slices=a,this._workerName="createCylinderGeometry"}var v=new t,g=new i,_=new i,y=new i,C=new i;f.packedLength=m.packedLength+4,f.pack=function(e,t,i){i=o(i,0),m.pack(e._vertexFormat,t,i),i+=m.packedLength,t[i++]=e._length,t[i++]=e._topRadius,t[i++]=e._bottomRadius,t[i]=e._slices};var E=new m,S={vertexFormat:E,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0};return f.unpack=function(e,t,i){t=o(t,0);var r=m.unpack(e,t,E);t+=m.packedLength;var n=e[t++],s=e[t++],l=e[t++],u=e[t];return a(i)?(i._vertexFormat=m.clone(r,i._vertexFormat),i._length=n,i._topRadius=s,i._bottomRadius=l,i._slices=u,i):(S.length=n,S.topRadius=s,S.bottomRadius=l,S.slices=u,new f(S))},f.createGeometry=function(o){var a,s=o._length,m=o._topRadius,f=o._bottomRadius,E=o._vertexFormat,S=o._slices,w=S+S,T=S+w,x=w+w,b=n.computePositions(s,m,f,S,!0),A=E.st?new Float32Array(2*x):void 0,P=E.normal?new Float32Array(3*x):void 0,I=E.tangent?new Float32Array(3*x):void 0,M=E.binormal?new Float32Array(3*x):void 0,D=E.normal||E.tangent||E.binormal;if(D){var R=E.tangent||E.binormal,O=0,N=0,L=0,F=g;F.z=0;var B=y,V=_;for(a=0;S>a;a++){var k=a/S*d.TWO_PI,z=Math.cos(k),U=Math.sin(k);D&&(F.x=z,F.y=U,R&&(B=i.normalize(i.cross(i.UNIT_Z,F,B),B)),E.normal&&(P[O++]=z,P[O++]=U,P[O++]=0,P[O++]=z,P[O++]=U,P[O++]=0),E.tangent&&(I[N++]=B.x,I[N++]=B.y,I[N++]=B.z,I[N++]=B.x,I[N++]=B.y,I[N++]=B.z),E.binormal&&(V=i.normalize(i.cross(F,B,V),V),M[L++]=V.x,M[L++]=V.y,M[L++]=V.z,M[L++]=V.x,M[L++]=V.y,M[L++]=V.z))}for(a=0;S>a;a++)E.normal&&(P[O++]=0,P[O++]=0,P[O++]=-1),E.tangent&&(I[N++]=1,I[N++]=0,I[N++]=0),E.binormal&&(M[L++]=0,M[L++]=-1,M[L++]=0);for(a=0;S>a;a++)E.normal&&(P[O++]=0,P[O++]=0,P[O++]=1),E.tangent&&(I[N++]=1,I[N++]=0,I[N++]=0),E.binormal&&(M[L++]=0,M[L++]=1,M[L++]=0)}var G=12*S-12,W=h.createTypedArray(x,G),H=0,q=0;for(a=0;S-1>a;a++)W[H++]=q,W[H++]=q+2,W[H++]=q+3,W[H++]=q,W[H++]=q+3,W[H++]=q+1,q+=2;for(W[H++]=w-2,W[H++]=0,W[H++]=1,W[H++]=w-2,W[H++]=1,W[H++]=w-1,a=1;S-1>a;a++)W[H++]=w+a+1,W[H++]=w+a,W[H++]=w;for(a=1;S-1>a;a++)W[H++]=T,W[H++]=T+a,W[H++]=T+a+1;var j=0;if(E.st){var Y=Math.max(m,f);for(a=0;x>a;a++){var X=i.fromArray(b,3*a,C);A[j++]=(X.x+Y)/(2*Y),A[j++]=(X.y+Y)/(2*Y)}}var Z=new c;E.position&&(Z.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:b})),E.normal&&(Z.normal=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:P})),E.tangent&&(Z.tangent=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:I})),E.binormal&&(Z.binormal=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:M})),E.st&&(Z.st=new u({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:A})),v.x=.5*s,v.y=Math.max(f,m);var K=new e(i.ZERO,t.magnitude(v));return new l({attributes:Z,indices:W,primitiveType:p.TRIANGLES,boundingSphere:K})},f}),i("Core/CylinderOutlineGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(e){e=o(e,o.EMPTY_OBJECT);var t=e.length,i=e.topRadius,r=e.bottomRadius,n=o(e.slices,128),a=Math.max(o(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=i,this._bottomRadius=r,this._slices=n,this._numberOfVerticalLines=a,this._workerName="createCylinderOutlineGeometry"}var m=new t;p.packedLength=5,p.pack=function(e,t,i){i=o(i,0),t[i++]=e._length,t[i++]=e._topRadius,t[i++]=e._bottomRadius,t[i++]=e._slices,t[i]=e._numberOfVerticalLines};var f={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0};return p.unpack=function(e,t,i){t=o(t,0);var r=e[t++],n=e[t++],s=e[t++],l=e[t++],u=e[t];return a(i)?(i._length=r,i._topRadius=n,i._bottomRadius=s,i._slices=l,i._numberOfVerticalLines=u,i):(f.length=r,f.topRadius=n,f.bottomRadius=s,f.slices=l,f.numberOfVerticalLines=u,new p(f))},p.createGeometry=function(o){var a,s=o._length,p=o._topRadius,f=o._bottomRadius,v=o._slices,g=o._numberOfVerticalLines,_=2*v,y=n.computePositions(s,p,f,v,!1),C=2*v;if(g>0){var E=Math.min(g,v);a=Math.round(v/E),C+=E}for(var S=h.createTypedArray(_,2*C),w=0,T=0;v-1>T;T++)S[w++]=T,S[w++]=T+1,S[w++]=T+v,S[w++]=T+1+v;if(S[w++]=v-1,S[w++]=0,S[w++]=v+v-1,S[w++]=v,g>0)for(T=0;v>T;T+=a)S[w++]=T,S[w++]=T+v;var x=new c;x.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:y}),m.x=.5*s,m.y=Math.max(f,p);var b=new e(i.ZERO,t.magnitude(m));return new l({attributes:x,indices:S,primitiveType:d.LINES,boundingSphere:b})},p}),i("Core/DefaultProxy",[],function(){"use strict";function e(e){this.proxy=e}return e.prototype.getURL=function(e){return this.proxy+"?"+encodeURIComponent(e)},e}),i("Core/deprecationWarning",["./defined","./DeveloperError"],function(e,t){"use strict";function i(t,i){e(r[t])||(r[t]=!0,console.log(i))}var r={};return i}),i("ThirdParty/Tween",[],function(){void 0===Date.now&&(Date.now=function(){return(new Date).valueOf()});var e=e||function(){var e=[];return{REVISION:"13",getAll:function(){return e},removeAll:function(){e=[]},add:function(t){e.push(t)},remove:function(t){var i=e.indexOf(t);-1!==i&&e.splice(i,1)},update:function(t){if(0===e.length)return!1;var i=0;for(t=void 0!==t?t:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?window.performance.now():Date.now();ie;e++)f[e].stop()},this.delay=function(e){return h=e,this},this.repeat=function(e){return s=e,this},this.yoyo=function(e){return l=e,this},this.easing=function(e){return p=e,this},this.interpolation=function(e){return m=e,this},this.chain=function(){return f=arguments,this},this.onStart=function(e){return v=e,this},this.onUpdate=function(e){return _=e,this},this.onComplete=function(e){return y=e,this},this.onStop=function(e){return C=e,this},this.update=function(e){var t;if(d>e)return!0;g===!1&&(null!==v&&v.call(i),g=!0);var u=(e-d)/a;u=u>1?1:u;var C=p(u);for(t in n){var E=r[t]||0,S=n[t];S instanceof Array?i[t]=m(S,C):("string"==typeof S&&(S=E+parseFloat(S,10)),"number"==typeof S&&(i[t]=E+(S-E)*C))}if(null!==_&&_.call(i,C),1==u){if(s>0){isFinite(s)&&s--;for(t in o){if("string"==typeof n[t]&&(o[t]=o[t]+parseFloat(n[t],10)),l){var w=o[t];o[t]=n[t],n[t]=w}r[t]=o[t]}return l&&(c=!c),d=e+h,!0}null!==y&&y.call(i);for(var T=0,x=f.length;x>T;T++)f[T].start(e);return!1}return!0}},e.Easing={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){var t,i=.1,r=.4;return 0===e?0:1===e?1:(!i||1>i?(i=1,t=r/4):t=r*Math.asin(1/i)/(2*Math.PI),-(i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)))},Out:function(e){var t,i=.1,r=.4;return 0===e?0:1===e?1:(!i||1>i?(i=1,t=r/4):t=r*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/r)+1)},InOut:function(e){var t,i=.1,r=.4;return 0===e?0:1===e?1:(!i||1>i?(i=1,t=r/4):t=r*Math.asin(1/i)/(2*Math.PI),(e*=2)<1?-.5*(i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)):i*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)*.5+1)}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(t){return 1-e.Easing.Bounce.Out(1-t)},Out:function(e){return 1/2.75>e?7.5625*e*e:2/2.75>e?7.5625*(e-=1.5/2.75)*e+.75:2.5/2.75>e?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(t){return.5>t?.5*e.Easing.Bounce.In(2*t):.5*e.Easing.Bounce.Out(2*t-1)+.5}}},e.Interpolation={Linear:function(t,i){var r=t.length-1,n=r*i,o=Math.floor(n),a=e.Interpolation.Utils.Linear;return 0>i?a(t[0],t[1],n):i>1?a(t[r],t[r-1],r-n):a(t[o],t[o+1>r?r:o+1],n-o)},Bezier:function(t,i){var r,n=0,o=t.length-1,a=Math.pow,s=e.Interpolation.Utils.Bernstein;for(r=0;o>=r;r++)n+=a(1-i,o-r)*a(i,r)*t[r]*s(o,r);return n},CatmullRom:function(t,i){var r=t.length-1,n=r*i,o=Math.floor(n),a=e.Interpolation.Utils.CatmullRom;return t[0]===t[r]?(0>i&&(o=Math.floor(n=r*(1+i))),a(t[(o-1+r)%r],t[o],t[(o+1)%r],t[(o+2)%r],n-o)):0>i?t[0]-(a(t[0],t[0],t[1],t[1],-n)-t[0]):i>1?t[r]-(a(t[r],t[r],t[r-1],t[r-1],n-r)-t[r]):a(t[o?o-1:0],t[o],t[o+1>r?r:o+1],t[o+2>r?r:o+2],n-o)},Utils:{Linear:function(e,t,i){return(t-e)*i+e},Bernstein:function(t,i){var r=e.Interpolation.Utils.Factorial;return r(t)/r(i)/r(t-i)},Factorial:function(){var e=[1];return function(t){var i,r=1;if(e[t])return e[t];for(i=t;i>1;i--)r*=i;return e[t]=r}}(),CatmullRom:function(e,t,i,r,n){var o=.5*(i-e),a=.5*(r-t),s=n*n,l=n*s;return(2*t-2*i+o+a)*l+(-3*t+3*i-2*o-a)*s+o*n+t}}},e}),i("Core/EasingFunction",["../ThirdParty/Tween","./freezeObject"],function(e,t){"use strict";var i={LINEAR_NONE:e.Easing.Linear.None,QUADRACTIC_IN:e.Easing.Quadratic.In,QUADRACTIC_OUT:e.Easing.Quadratic.Out,QUADRACTIC_IN_OUT:e.Easing.Quadratic.InOut,CUBIC_IN:e.Easing.Cubic.In,CUBIC_OUT:e.Easing.Cubic.Out,CUBIC_IN_OUT:e.Easing.Cubic.InOut,QUARTIC_IN:e.Easing.Quartic.In,QUARTIC_OUT:e.Easing.Quartic.Out,QUARTIC_IN_OUT:e.Easing.Quartic.InOut,QUINTIC_IN:e.Easing.Quintic.In,QUINTIC_OUT:e.Easing.Quintic.Out,QUINTIC_IN_OUT:e.Easing.Quintic.InOut,SINUSOIDAL_IN:e.Easing.Sinusoidal.In,SINUSOIDAL_OUT:e.Easing.Sinusoidal.Out,SINUSOIDAL_IN_OUT:e.Easing.Sinusoidal.InOut,EXPONENTIAL_IN:e.Easing.Exponential.In,EXPONENTIAL_OUT:e.Easing.Exponential.Out,EXPONENTIAL_IN_OUT:e.Easing.Exponential.InOut,CIRCULAR_IN:e.Easing.Circular.In,CIRCULAR_OUT:e.Easing.Circular.Out,CIRCULAR_IN_OUT:e.Easing.Circular.InOut,ELASTIC_IN:e.Easing.Elastic.In,ELASTIC_OUT:e.Easing.Elastic.Out,ELASTIC_IN_OUT:e.Easing.Elastic.InOut,BACK_IN:e.Easing.Back.In,BACK_OUT:e.Easing.Back.Out,BACK_IN_OUT:e.Easing.Back.InOut,BOUNCE_IN:e.Easing.Bounce.In,BOUNCE_OUT:e.Easing.Bounce.Out,BOUNCE_IN_OUT:e.Easing.Bounce.InOut};return t(i)}),i("Core/EllipsoidGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e){e=n(e,n.EMPTY_OBJECT);var t=n(e.radii,E),r=n(e.stackPartitions,64),o=n(e.slicePartitions,64),a=n(e.vertexFormat,m.DEFAULT);this._radii=i.clone(t),this._stackPartitions=r,this._slicePartitions=o,this._vertexFormat=m.clone(a),this._workerName="createEllipsoidGeometry"}var v=new i,g=new i,_=new i,y=new i,C=new i,E=new i(1,1,1),S=Math.cos,w=Math.sin;f.packedLength=i.packedLength+m.packedLength+2,f.pack=function(e,t,r){r=n(r,0),i.pack(e._radii,t,r),r+=i.packedLength,m.pack(e._vertexFormat,t,r),r+=m.packedLength,t[r++]=e._stackPartitions,t[r]=e._slicePartitions};var T=new i,x=new m,b={radii:T,vertexFormat:x,stackPartitions:void 0,slicePartitions:void 0};return f.unpack=function(e,t,r){t=n(t,0);var a=i.unpack(e,t,T);t+=i.packedLength;var s=m.unpack(e,t,x);t+=m.packedLength;var l=e[t++],u=e[t];return o(r)?(r._radii=i.clone(a,r._radii),r._vertexFormat=m.clone(s,r._vertexFormat),r._stackPartitions=l,r._slicePartitions=u,r):(b.stackPartitions=l,b.slicePartitions=u,new f(b))},f.createGeometry=function(n){var o,a,m=n._radii,f=s.fromCartesian3(m),E=n._vertexFormat,T=n._slicePartitions+1,x=n._stackPartitions+1,b=x*T,A=new Float64Array(3*b),P=6*(T-1)*(x-1),I=h.createTypedArray(b,P),M=E.normal?new Float32Array(3*b):void 0,D=E.tangent?new Float32Array(3*b):void 0,R=E.binormal?new Float32Array(3*b):void 0,O=E.st?new Float32Array(2*b):void 0,N=new Array(T),L=new Array(T),F=0;for(o=0;T>o;o++){var B=d.TWO_PI*o/(T-1);N[o]=S(B),L[o]=w(B),A[F++]=0,A[F++]=0,A[F++]=m.z}for(o=1;x-1>o;o++){var V=Math.PI*o/(x-1),k=w(V),z=m.x*k,U=m.y*k,G=m.z*S(V);for(a=0;T>a;a++)A[F++]=N[a]*z,A[F++]=L[a]*U,A[F++]=G}for(o=0;T>o;o++)A[F++]=0,A[F++]=0,A[F++]=-m.z;var W=new c;E.position&&(W.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:A}));var H=0,q=0,j=0,Y=0;if(E.st||E.normal||E.tangent||E.binormal){for(o=0;b>o;o++){var X=i.fromArray(A,3*o,v),Z=f.geodeticSurfaceNormal(X,g);if(E.st){var K=t.negate(Z,C);t.magnitude(K)A.length&&(F=3*(o-T*Math.floor(.5*x))),i.fromArray(A,F,K),f.geodeticSurfaceNormal(K,K),t.negate(K,K)),O[H++]=Math.atan2(K.y,K.x)/d.TWO_PI+.5,O[H++]=Math.asin(Z.z)/Math.PI+.5}if(E.normal&&(M[q++]=Z.x,M[q++]=Z.y,M[q++]=Z.z),E.tangent||E.binormal){var Q=_;if(T>o||o>b-T-1?(i.cross(i.UNIT_X,Z,Q),i.normalize(Q,Q)):(i.cross(i.UNIT_Z,Z,Q),i.normalize(Q,Q)),E.tangent&&(D[j++]=Q.x,D[j++]=Q.y,D[j++]=Q.z),E.binormal){var J=i.cross(Z,Q,y);i.normalize(J,J),R[Y++]=J.x,R[Y++]=J.y,R[Y++]=J.z}}}E.st&&(W.st=new u({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:O})),E.normal&&(W.normal=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:M})),E.tangent&&(W.tangent=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:D})),E.binormal&&(W.binormal=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:R}))}for(F=0,o=0;x>o;o++){var $=o*T,ee=(o+1)*T;for(a=0;T-1>a;a++)I[F++]=ee+a,I[F++]=ee+a+1,I[F++]=$+a+1,I[F++]=ee+a,I[F++]=$+a+1,I[F++]=$+a}return new l({attributes:W,indices:I,primitiveType:p.TRIANGLES,boundingSphere:e.fromEllipsoid(f)})},f}),i("Core/EllipsoidOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(e){e=r(e,r.EMPTY_OBJECT);var i=r(e.radii,m),n=r(e.stackPartitions,10),o=r(e.slicePartitions,8),a=r(e.subdivisions,128);this._radii=t.clone(i),this._stackPartitions=n,this._slicePartitions=o,this._subdivisions=a,this._workerName="createEllipsoidOutlineGeometry"}var m=new t(1,1,1),f=Math.cos,v=Math.sin;p.packedLength=t.packedLength+3,p.pack=function(e,i,n){n=r(n,0),t.pack(e._radii,i,n),n+=t.packedLength,i[n++]=e._stackPartitions,i[n++]=e._slicePartitions,i[n]=e._subdivisions};var g=new t,_={radii:g,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return p.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,g);i+=t.packedLength;var s=e[i++],l=e[i++],u=e[i++];return n(o)?(o._radii=t.clone(a,o._radii),o._stackPartitions=s,o._slicePartitions=l,o._subdivisions=u,o):(_.stackPartitions=s,_.slicePartitions=l,_.subdivisions=u,new p(_))},p.createGeometry=function(t){var r,n,o,p,m,g,_=t._radii,y=a.fromCartesian3(_),C=t._stackPartitions,E=t._slicePartitions,S=t._subdivisions,w=S*(C+E-1),T=w-E+2,x=new Float64Array(3*T),b=c.createTypedArray(T,2*w),A=0,P=new Array(S),I=new Array(S);for(r=0;S>r;r++)o=h.TWO_PI*r/S,P[r]=f(o),I[r]=v(o);for(r=1;C>r;r++)for(p=Math.PI*r/C,m=f(p),g=v(p),n=0;S>n;n++)x[A++]=_.x*P[n]*g,x[A++]=_.y*I[n]*g,x[A++]=_.z*m;for(P.length=E,I.length=E,r=0;E>r;r++)o=h.TWO_PI*r/E,P[r]=f(o),I[r]=v(o);for(x[A++]=0,x[A++]=0,x[A++]=_.z,r=1;S>r;r++)for(p=Math.PI*r/S,m=f(p),g=v(p),n=0;E>n;n++)x[A++]=_.x*P[n]*g,x[A++]=_.y*I[n]*g,x[A++]=_.z*m;for(x[A++]=0,x[A++]=0,x[A++]=-_.z,A=0,r=0;C-1>r;++r){var M=r*S;for(n=0;S-1>n;++n)b[A++]=M+n,b[A++]=M+n+1;b[A++]=M+S-1,b[A++]=M}var D=S*(C-1);for(n=1;E+1>n;++n)b[A++]=D,b[A++]=D+n;for(r=0;S-2>r;++r){var R=r*E+1+D,O=(r+1)*E+1+D;for(n=0;E-1>n;++n)b[A++]=O+n,b[A++]=R+n;b[A++]=O+E-1,b[A++]=R+E-1}var N=x.length/3-1;for(n=N-1;n>N-E-1;--n)b[A++]=N,b[A++]=n;var L=new u({position:new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:x})});return new s({attributes:L,indices:b,primitiveType:d.LINES,boundingSphere:e.fromEllipsoid(y)})},p}),i("Core/EllipsoidTerrainProvider",["../ThirdParty/when","./defaultValue","./defined","./defineProperties","./Ellipsoid","./Event","./GeographicTilingScheme","./HeightmapTerrainData","./TerrainProvider"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(r){r=t(r,{}),this._tilingScheme=r.tilingScheme,i(this._tilingScheme)||(this._tilingScheme=new a({ellipsoid:t(r.ellipsoid,n.WGS84)})),this._levelZeroMaximumGeometricError=l.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new o,this._readyPromise=e.resolve(!0)}return r(u.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),u.prototype.requestTileGeometry=function(e,t,i,r){var n=16,o=16;return new s({buffer:new Uint8Array(n*o),width:n,height:o})},u.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<t;++t)e[t]();e.length=0},i}),i("Core/ExtrapolationType",["./freezeObject"],function(e){"use strict";var t={NONE:0,HOLD:1,EXTRAPOLATE:2};return e(t)}),i("Core/GeometryInstanceAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.value=t.value}return r}),i("Core/getBaseUri",["../ThirdParty/Uri","./definedNotNull","./DeveloperError"],function(e,t,i){"use strict";function r(i,r){var n="",o=i.lastIndexOf("/");return-1!==o&&(n=i.substring(0,o+1)),r?(i=new e(i),t(i.query)&&(n+="?"+i.query),t(i.fragment)&&(n+="#"+i.fragment),n):n}return r}),i("Core/getExtensionFromUri",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t){var i=new e(t);i.normalize();var r=i.path,n=r.lastIndexOf("/");return-1!==n&&(r=r.substr(n+1)),n=r.lastIndexOf("."),r=-1===n?"":r.substr(n+1)}return r}),i("Core/getFilenameFromUri",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t){var i=new e(t);i.normalize();var r=i.path,n=r.lastIndexOf("/");return-1!==n&&(r=r.substr(n+1)),r}return r}),i("Core/getStringFromTypedArray",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t,i,n){return i=e(i,0),n=e(n,t.byteLength-i),t=t.subarray(i,i+n),r.decode(t)}return r.decodeWithTextDecoder=function(e){var t=new TextDecoder("utf-8");return t.decode(e)},r.decodeWithFromCharCode=function(e){for(var t="",i=e.length,r=0;i>r;++r)t+=String.fromCharCode(e[r]);return t},"undefined"!=typeof TextDecoder?r.decode=r.decodeWithTextDecoder:r.decode=r.decodeWithFromCharCode,r}),i("Core/getMagic",["../Core/defaultValue","../Core/getStringFromTypedArray"],function(e,t){"use strict";function i(i,r){return r=e(r,0),t(i,r,Math.min(4,i.length))}return i}),i("Core/HeadingPitchRange",["./defaultValue","./defined"],function(e,t){"use strict";function i(t,i,r){this.heading=e(t,0),this.pitch=e(i,0),this.range=e(r,0)}return i.clone=function(e,r){return t(e)?(t(r)||(r=new i),r.heading=e.heading,r.pitch=e.pitch,r.range=e.range,r):void 0},i}),i("Core/HermitePolynomialApproximation",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,i,r){"use strict";function n(e,t,i,r,o,a){var s,l,u,c=0;if(r>0){for(l=0;o>l;l++){for(s=!1,u=0;ul;l++){for(s=!1,u=0;ud;d++){var p=Math.floor(d*h);for(s=0;c>s;s++)l=t[s]*o*(a+1)+d,e[p+s]=n[l];for(var m=1;c>m;m++){var f=0,v=Math.floor(m*(1-m)/2)+c*m,g=!1;for(s=0;c-m>s;s++){var _,y,C=i[t[s]],E=i[t[s+m]];if(0>=E-C)l=t[s]*o*(a+1)+o*m+d,_=n[l],y=_/r.factorial(m),e[p+v+f]=y,f++;else{var S=Math.floor((m-1)*(2-m)/2)+c*(m-1);_=e[p+S+s+1]-e[p+S+s],y=_/(E-C),e[p+v+f]=y,f++}g=g||0!==_}g&&(u=Math.max(u,m))}}return u}var a=r.factorial,s={type:"Hermite"};s.getRequiredDataPoints=function(t,i){return i=e(i,0),Math.max(Math.floor((t+1)/(i+1)),2)},s.interpolateOrderZero=function(e,i,r,o,s){t(s)||(s=new Array(o));var l,u,c,h,d,p,m=i.length,f=new Array(o);for(l=0;o>l;l++){s[l]=0;var v=new Array(m);for(f[l]=v,u=0;m>u;u++)v[u]=[]}var g=m,_=new Array(g);for(l=0;g>l;l++)_[l]=l;var y=m-1;for(h=0;o>h;h++){for(u=0;g>u;u++)p=_[u]*o+h,f[h][0].push(r[p]);for(l=1;g>l;l++){var C=!1;for(u=0;g-l>u;u++){var E,S=i[_[u]],w=i[_[u+l]];0>=w-S?(p=_[u]*o+o*l+h,E=r[p],f[h][l].push(E/a(l))):(E=f[h][l-1][u+1]-f[h][l-1][u],f[h][l].push(E/(w-S))),C=C||0!==E}C||(y=l-1)}}for(c=0,d=0;d>=c;c++)for(l=c;y>=l;l++){var T=n(e,_,i,c,l,[]);for(h=0;o>h;h++){var x=f[h][l][0];s[h+c*o]+=x*T}}return s};var l=[];return s.interpolate=function(e,i,r,a,s,u,c){var h=a*(u+1);t(c)||(c=new Array(h));for(var d=0;h>d;d++)c[d]=0;for(var p=i.length,m=new Array(p*(s+1)),f=0;p>f;f++)for(var v=0;s+1>v;v++)m[f*(s+1)+v]=f;for(var g=m.length,_=l,y=o(_,m,i,r,a,s),C=[],E=g*(g+1)/2,S=Math.min(y,u),w=0;S>=w;w++)for(f=w;y>=f;f++){C.length=0;for(var T=n(e,m,i,w,f,C),x=Math.floor(f*(1-f)/2)+g*f,b=0;a>b;b++){var A=Math.floor(b*E),P=_[A+x];c[b+w*a]+=P*T}}return c},s}),i("Core/IauOrientationParameters",[],function(){"use strict";function e(e,t,i,r){this.rightAscension=e,this.declination=t,this.rotation=i,this.rotationRate=r}return e}),i("Core/Iau2000Orientation",["./defined","./IauOrientationParameters","./JulianDate","./Math","./TimeConstants"],function(e,t,i,r,n){"use strict";var o={},a=32.184,s=2451545,l=-.0529921,u=-.1059842,c=13.0120009,h=13.3407154,d=.9856003,p=26.4057084,m=13.064993,f=.3287146,v=1.7484877,g=-.1589763,_=.0036096,y=.1643573,C=12.9590088,E=new i;return o.ComputeMoon=function(o,S){e(o)||(o=i.now()),E=i.addSeconds(o,a,E);var w=i.totalDays(E)-s,T=w/n.DAYS_PER_JULIAN_CENTURY,x=(125.045+l*w)*r.RADIANS_PER_DEGREE,b=(250.089+u*w)*r.RADIANS_PER_DEGREE,A=(260.008+c*w)*r.RADIANS_PER_DEGREE,P=(176.625+h*w)*r.RADIANS_PER_DEGREE,I=(357.529+d*w)*r.RADIANS_PER_DEGREE,M=(311.589+p*w)*r.RADIANS_PER_DEGREE,D=(134.963+m*w)*r.RADIANS_PER_DEGREE,R=(276.617+f*w)*r.RADIANS_PER_DEGREE,O=(34.226+v*w)*r.RADIANS_PER_DEGREE,N=(15.134+g*w)*r.RADIANS_PER_DEGREE,L=(119.743+_*w)*r.RADIANS_PER_DEGREE,F=(239.961+y*w)*r.RADIANS_PER_DEGREE,B=(25.053+C*w)*r.RADIANS_PER_DEGREE,V=Math.sin(x),k=Math.sin(b),z=Math.sin(A),U=Math.sin(P),G=Math.sin(I),W=Math.sin(M),H=Math.sin(D),q=Math.sin(R),j=Math.sin(O),Y=Math.sin(N),X=Math.sin(L),Z=Math.sin(F),K=Math.sin(B),Q=Math.cos(x),J=Math.cos(b),$=Math.cos(A),ee=Math.cos(P),te=Math.cos(I),ie=Math.cos(M),re=Math.cos(D),ne=Math.cos(R),oe=Math.cos(O),ae=Math.cos(N),se=Math.cos(L),le=Math.cos(F),ue=Math.cos(B),ce=(269.9949+.0031*T-3.8787*V-.1204*k+.07*z-.0172*U+.0072*W-.0052*Y+.0043*K)*r.RADIANS_PER_DEGREE,he=(66.5392+.013*T+1.5419*Q+.0239*J-.0278*$+.0068*ee-.0029*ie+9e-4*re+8e-4*ae-9e-4*ue)*r.RADIANS_PER_DEGREE,de=(38.3213+13.17635815*w-1.4e-12*w*w+3.561*V+.1208*k-.0642*z+.0158*U+.0252*G-.0066*W-.0047*H-.0046*q+.0028*j+.0052*Y+.004*X+.0019*Z-.0044*K)*r.RADIANS_PER_DEGREE,pe=(13.17635815-1.4e-12*(2*w)+3.561*Q*l+.1208*J*u-.0642*$*c+.0158*ee*h+.0252*te*d-.0066*ie*p-.0047*re*m-.0046*ne*f+.0028*oe*v+.0052*ae*g+.004*se*_+.0019*le*y-.0044*ue*C)/86400*r.RADIANS_PER_DEGREE;return e(S)||(S=new t),S.rightAscension=ce,S.declination=he,S.rotation=de,S.rotationRate=pe,S},o}),i("Core/IauOrientationAxes",["./Cartesian3","./defined","./Iau2000Orientation","./JulianDate","./Math","./Matrix3","./Quaternion"],function(e,t,i,r,n,o,a){"use strict";function s(e){t(e)&&"function"==typeof e||(e=i.ComputeMoon),this._computeFunction=e}function l(i,r,a){var s=u;s.x=Math.cos(i+n.PI_OVER_TWO),s.y=Math.sin(i+n.PI_OVER_TWO),s.z=0;var l=Math.cos(r),d=h;d.x=l*Math.cos(i),d.y=l*Math.sin(i),d.z=Math.sin(r);var p=e.cross(d,s,c);return t(a)||(a=new o),a[0]=s.x,a[1]=p.x,a[2]=d.x,a[3]=s.y,a[4]=p.y,a[5]=d.y,a[6]=s.z,a[7]=p.z,a[8]=d.z,a}var u=new e,c=new e,h=new e,d=new o,p=new a;return s.prototype.evaluate=function(i,s){t(i)||(i=r.now());var u=this._computeFunction(i),c=l(u.rightAscension,u.declination,s),h=n.zeroToTwoPi(u.rotation),m=a.fromAxisAngle(e.UNIT_Z,h,p),f=o.fromQuaternion(a.conjugate(m,m),d),v=o.multiply(f,c,c);return v},s}),i("Core/InterpolationAlgorithm",["./DeveloperError"],function(e){"use strict";var t={};return t.type=void 0,t.getRequiredDataPoints=e.throwInstantiationError,t.interpolateOrderZero=e.throwInstantiationError,t.interpolate=e.throwInstantiationError,t}),i("Core/TimeInterval",["./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./JulianDate"],function(e,t,i,r,n,o){"use strict";function a(i){i=e(i,e.EMPTY_OBJECT),this.start=t(i.start)?o.clone(i.start):new o,this.stop=t(i.stop)?o.clone(i.stop):new o,this.data=i.data,this.isStartIncluded=e(i.isStartIncluded,!0),this.isStopIncluded=e(i.isStopIncluded,!0)}i(a.prototype,{isEmpty:{get:function(){var e=o.compare(this.stop,this.start);return 0>e||0===e&&(!this.isStartIncluded||!this.isStopIncluded)}}});var s={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};return a.fromIso8601=function(i,r){var n=i.iso8601.split("/"),l=o.fromIso8601(n[0]),u=o.fromIso8601(n[1]),c=e(i.isStartIncluded,!0),h=e(i.isStopIncluded,!0),d=i.data;return t(r)?(r.start=l,r.stop=u,r.isStartIncluded=c,r.isStopIncluded=h,r.data=d,r):(s.start=l,s.stop=u,s.isStartIncluded=c,s.isStopIncluded=h,s.data=d,new a(s))},a.toIso8601=function(e,t){return o.toIso8601(e.start,t)+"/"+o.toIso8601(e.stop,t)},a.clone=function(e,i){return t(e)?t(i)?(i.start=e.start,i.stop=e.stop,i.isStartIncluded=e.isStartIncluded,i.isStopIncluded=e.isStopIncluded,i.data=e.data,i):new a(e):void 0},a.equals=function(e,i,r){return e===i||t(e)&&t(i)&&(e.isEmpty&&i.isEmpty||e.isStartIncluded===i.isStartIncluded&&e.isStopIncluded===i.isStopIncluded&&o.equals(e.start,i.start)&&o.equals(e.stop,i.stop)&&(e.data===i.data||t(r)&&r(e.data,i.data)))},a.equalsEpsilon=function(e,i,r,n){return e===i||t(e)&&t(i)&&(e.isEmpty&&i.isEmpty||e.isStartIncluded===i.isStartIncluded&&e.isStopIncluded===i.isStopIncluded&&o.equalsEpsilon(e.start,i.start,r)&&o.equalsEpsilon(e.stop,i.stop,r)&&(e.data===i.data||t(n)&&n(e.data,i.data)))},a.intersect=function(e,i,r,n){if(!t(i))return a.clone(a.EMPTY,r);var s=e.start,l=e.stop,u=i.start,c=i.stop,h=o.greaterThanOrEquals(u,s)&&o.greaterThanOrEquals(l,u),d=!h&&o.lessThanOrEquals(u,s)&&o.lessThanOrEquals(s,c);if(!h&&!d)return a.clone(a.EMPTY,r);var p=e.isStartIncluded,m=e.isStopIncluded,f=i.isStartIncluded,v=i.isStopIncluded,g=o.lessThan(l,c);return r.start=h?u:s,r.isStartIncluded=p&&f||!o.equals(u,s)&&(h&&f||d&&p),r.stop=g?l:c,r.isStopIncluded=g?m:m&&v||!o.equals(c,l)&&v,r.data=t(n)?n(e.data,i.data):e.data,r},a.contains=function(e,t){if(e.isEmpty)return!1;var i=o.compare(e.start,t);if(0===i)return e.isStartIncluded;var r=o.compare(t,e.stop);return 0===r?e.isStopIncluded:0>i&&0>r},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e,t){return a.equals(this,e,t)},a.prototype.equalsEpsilon=function(e,t,i){return a.equalsEpsilon(this,e,t,i)},a.prototype.toString=function(){return a.toIso8601(this)},a.EMPTY=n(new a({start:new o,stop:new o,isStartIncluded:!1,isStopIncluded:!1})),a}),i("Core/Iso8601",["./freezeObject","./JulianDate","./TimeInterval"],function(e,t,i){"use strict";var r=e(t.fromIso8601("0000-01-01T00:00:00Z")),n=e(t.fromIso8601("9999-12-31T24:00:00Z")),o=e(new i({start:r,stop:n})),a={MINIMUM_VALUE:r,MAXIMUM_VALUE:n,MAXIMUM_INTERVAL:o};return a}),i("Core/KeyboardEventModifier",["./freezeObject"],function(e){"use strict";var t={SHIFT:0,CTRL:1,ALT:2};return e(t)}),i("Core/LagrangePolynomialApproximation",["./defined"],function(e){"use strict";var t={type:"Lagrange"};return t.getRequiredDataPoints=function(e){return Math.max(e+1,2)},t.interpolateOrderZero=function(t,i,r,n,o){e(o)||(o=new Array(n));var a,s,l=i.length;for(a=0;n>a;a++)o[a]=0;for(a=0;l>a;a++){var u=1;for(s=0;l>s;s++)if(s!==a){var c=i[a]-i[s];u*=(t-i[s])/c}for(s=0;n>s;s++)o[s]+=u*r[a*n+s]}return o},t}),i("Core/LinearApproximation",["./defined","./DeveloperError"],function(e,t){"use strict";var i={type:"Linear"};return i.getRequiredDataPoints=function(e){return 2},i.interpolateOrderZero=function(t,i,r,n,o){e(o)||(o=new Array(n));var a,s,l,u=i[0],c=i[1];for(a=0;n>a;a++)s=r[a],l=r[a+n],o[a]=((l-s)*t+c*s-u*l)/(c-u);return o},i}),i("Core/loadBlob",["./loadWithXhr","./defined"],function(e,t){"use strict";function i(i,r){return e({url:i,responseType:"blob",headers:t(r)?r.headers:void 0,withCredentials:t(r)?r.withCredentials:void 0})}return i}),i("Core/loadImageFromTypedArray",["../ThirdParty/when","./defined","./DeveloperError","./loadImage"],function(e,t,i,r){"use strict";function n(t,i){var n=new Blob([t],{type:i}),o=window.URL.createObjectURL(n);return r(o,{allowCrossOrigin:!1}).then(function(e){return window.URL.revokeObjectURL(o),e},function(t){return window.URL.revokeObjectURL(o),e.reject(t)})}return n}),i("Core/loadImageViaBlob",["../ThirdParty/when","./loadBlob","./loadImage"],function(e,t,i){"use strict";function r(r,o){return n.test(r)?i(r):t(r,o).then(function(t){var r=window.URL.createObjectURL(t);return i(r,{allowCrossOrigin:!1}).then(function(e){return e.blob=t,window.URL.revokeObjectURL(r),e},function(t){return window.URL.revokeObjectURL(r),e.reject(t)})})}var n=/^data:/,o=function(){try{var e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob","blob"===e.responseType}catch(t){return!1}}();return o?r:i}),i("Core/objectToQuery",["./defined","./DeveloperError","./isArray"],function(e,t,i){"use strict";function r(e){var t="";for(var r in e)if(e.hasOwnProperty(r)){var n=e[r],o=encodeURIComponent(r)+"=";if(i(n))for(var a=0,s=n.length;s>a;++a)t+=o+encodeURIComponent(n[a])+"&";else t+=o+encodeURIComponent(n)+"&"}return t=t.slice(0,-1)}return r}),i("Core/queryToObject",["./defined","./DeveloperError","./isArray"],function(e,t,i){"use strict";function r(t){var r={};if(""===t)return r;for(var n=t.replace(/\+/g,"%20").split("&"),o=0,a=n.length;a>o;++o){var s=n[o].split("="),l=decodeURIComponent(s[0]),u=s[1];u=e(u)?decodeURIComponent(u):"";var c=r[l];"string"==typeof c?r[l]=[c,u]:i(c)?c.push(u):r[l]=u}return r}return r}),i("Core/loadJsonp",["../ThirdParty/Uri","../ThirdParty/when","./combine","./defaultValue","./defined","./DeveloperError","./objectToQuery","./queryToObject"],function(e,t,i,r,n,o,a,s){"use strict";function l(o,u){u=r(u,r.EMPTY_OBJECT);var c;do c="loadJsonp"+Math.random().toString().substring(2,8);while(n(window[c]));var h=t.defer();window[c]=function(e){h.resolve(e);try{delete window[c]}catch(t){window[c]=void 0}};var d=new e(o),p=s(r(d.query,""));n(u.parameters)&&(p=i(u.parameters,p));var m=r(u.callbackParameterName,"callback");p[m]=c,d.query=a(p),o=d.toString();var f=u.proxy;return n(f)&&(o=f.getURL(o)),l.loadAndExecuteScript(o,c,h),h.promise}return l.loadAndExecuteScript=function(e,t,i){var r=document.createElement("script");r.async=!0,r.src=e;var n=document.getElementsByTagName("head")[0];r.onload=function(){r.onload=void 0,n.removeChild(r)},r.onerror=function(e){i.reject(e)},n.appendChild(r)},l.defaultLoadAndExecuteScript=l.loadAndExecuteScript,l}),i("Core/loadXML",["./loadWithXhr","./defined"],function(e,t){"use strict";function i(i,r){return e({url:i,responseType:"document",headers:t(r)?r.headers:void 0,overrideMimeType:"text/xml",withCredentials:t(r)?r.withCredentials:void 0})}return i}),i("Core/MapboxApi",["./defined"],function(e){"use strict";var t={};t.defaultAccessToken=void 0;var i=!1;return t.getAccessToken=function(r){return e(r)?r:e(t.defaultAccessToken)?t.defaultAccessToken:(i||(console.log("This application is using Cesium's default Mapbox access token. Please create a new access token for the application as soon as possible and prior to deployment by visiting https://www.mapbox.com/account/apps/, and provide your token to Cesium by setting the Cesium.MapboxApi.defaultAccessToken property before constructing the CesiumWidget or any other object that uses the Mapbox API."),i=!0),"pk.eyJ1IjoiYW5hbHl0aWNhbGdyYXBoaWNzIiwiYSI6IjA2YzBjOTM3YzFlYzljYmQ5NDAxZWI1Y2ZjNzZlM2E1In0.vDZL2SPFEpi_f7ziAIP_yw")},t}),i("Core/MapProjection",["./defineProperties","./DeveloperError"],function(e,t){"use strict";function i(){t.throwInstantiationError()}return e(i.prototype,{ellipsoid:{get:t.throwInstantiationError}}),i.prototype.project=t.throwInstantiationError,i.prototype.unproject=t.throwInstantiationError,i}),i("Core/Matrix2",["./Cartesian2","./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,i,r,n){"use strict";function o(e,i,r,n){this[0]=t(e,0),this[1]=t(r,0),this[2]=t(i,0),this[3]=t(n,0)}o.packedLength=4,o.pack=function(e,i,r){r=t(r,0),i[r++]=e[0],i[r++]=e[1],i[r++]=e[2],i[r++]=e[3]},o.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new o),n[0]=e[r++],n[1]=e[r++],n[2]=e[r++],n[3]=e[r++],n},o.clone=function(e,t){return i(e)?i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new o(e[0],e[2],e[1],e[3]):void 0},o.fromArray=function(e,r,n){return r=t(r,0),i(n)||(n=new o),n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n},o.fromColumnMajorArray=function(e,t){return o.clone(e,t)},o.fromRowMajorArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new o(e[0],e[1],e[2],e[3])},o.fromScale=function(e,t){return i(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new o(e.x,0,0,e.y)},o.fromUniformScale=function(e,t){return i(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new o(e,0,0,e)},o.fromRotation=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t):new o(r,-n,n,r)},o.toArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]},o.getElementIndex=function(e,t){return 2*e+t},o.getColumn=function(e,t,i){var r=2*t,n=e[r],o=e[r+1];return i.x=n,i.y=o,i},o.setColumn=function(e,t,i,r){r=o.clone(e,r);var n=2*t;return r[n]=i.x,r[n+1]=i.y,r},o.getRow=function(e,t,i){var r=e[t],n=e[t+2];return i.x=r,i.y=n,i},o.setRow=function(e,t,i,r){return r=o.clone(e,r),r[t]=i.x,r[t+2]=i.y,r};var a=new e;o.getScale=function(t,i){return i.x=e.magnitude(e.fromElements(t[0],t[1],a)),i.y=e.magnitude(e.fromElements(t[2],t[3],a)),i};var s=new e;return o.getMaximumScale=function(t){return o.getScale(t,s),e.maximumComponent(s)},o.multiply=function(e,t,i){var r=e[0]*t[0]+e[2]*t[1],n=e[0]*t[2]+e[2]*t[3],o=e[1]*t[0]+e[3]*t[1],a=e[1]*t[2]+e[3]*t[3];return i[0]=r,i[1]=o,i[2]=n,i[3]=a,i},o.add=function(e,t,i){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i},o.subtract=function(e,t,i){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i},o.multiplyByVector=function(e,t,i){var r=e[0]*t.x+e[2]*t.y,n=e[1]*t.x+e[3]*t.y;return i.x=r,i.y=n,i},o.multiplyByScalar=function(e,t,i){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i},o.multiplyByScale=function(e,t,i){return i[0]=e[0]*t.x,i[1]=e[1]*t.x,i[2]=e[2]*t.y,i[3]=e[3]*t.y,i},o.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},o.transpose=function(e,t){var i=e[0],r=e[2],n=e[1],o=e[3];return t[0]=i,t[1]=r,t[2]=n,t[3]=o,t},o.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t},o.equals=function(e,t){return e===t||i(e)&&i(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},o.equalsArray=function(e,t,i){return e[0]===t[i]&&e[1]===t[i+1]&&e[2]===t[i+2]&&e[3]===t[i+3]},o.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r},o.IDENTITY=n(new o(1,0,0,1)),o.ZERO=n(new o(0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN1ROW0=2,o.COLUMN1ROW1=3,o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"},o}),i("Core/mergeSort",["./defined","./DeveloperError"],function(e,t){"use strict";function i(e,t,i,r,n,s){var l,u,c=n-r+1,h=s-n,d=o,p=a;for(l=0;c>l;++l)d[l]=e[r+l];for(u=0;h>u;++u)p[u]=e[n+u+1];l=0,u=0;for(var m=r;s>=m;++m){var f=d[l],v=p[u];c>l&&(u>=h||t(f,v,i)<=0)?(e[m]=f,++l):h>u&&(e[m]=v,++u)}}function r(e,t,n,o,a){if(!(o>=a)){var s=Math.floor(.5*(o+a));r(e,t,n,o,s),r(e,t,n,s+1,a),i(e,t,n,o,s,a)}}function n(e,t,i){var n=e.length,s=Math.ceil(.5*n);o.length=s,a.length=s,r(e,t,i,0,n-1),o.length=0,a.length=0}var o=[],a=[];return n}),i("Core/NearFarScalar",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t,i,r,n){this.near=e(t,0),this.nearValue=e(i,0),this.far=e(r,1),this.farValue=e(n,0)}return r.clone=function(e,i){return t(e)?t(i)?(i.near=e.near,i.nearValue=e.nearValue,i.far=e.far,i.farValue=e.farValue,i):new r(e.near,e.nearValue,e.far,e.farValue):void 0},r.packedLength=4,r.pack=function(t,i,r){r=e(r,0),i[r++]=t.near,i[r++]=t.nearValue,i[r++]=t.far,i[r]=t.farValue},r.unpack=function(i,n,o){return n=e(n,0),t(o)||(o=new r),o.near=i[n++],o.nearValue=i[n++],o.far=i[n++],o.farValue=i[n],o},r.equals=function(e,i){return e===i||t(e)&&t(i)&&e.near===i.near&&e.nearValue===i.nearValue&&e.far===i.far&&e.farValue===i.farValue},r.prototype.clone=function(e){return r.clone(this,e)},r.prototype.equals=function(e){return r.equals(this,e)},r}),i("Core/Visibility",["./freezeObject"],function(e){"use strict";var t={NONE:-1,PARTIAL:0,FULL:1};return e(t)}),i("Core/Occluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math","./Rectangle","./Visibility"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,i){this._occluderPosition=t.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=i}var h=new t;n(c.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=t.clone(e,this._cameraPosition);var i,r,n,o=t.subtract(this._occluderPosition,e,h),a=t.magnitudeSquared(o),s=this._occluderRadius*this._occluderRadius;if(a>s){i=Math.sqrt(a-s),a=1/Math.sqrt(a),r=t.multiplyByScalar(o,a,h);var l=i*i*a;n=t.add(e,t.multiplyByScalar(r,l,h),h)}else i=Number.MAX_VALUE;this._horizonDistance=i,this._horizonPlaneNormal=r,this._horizonPlanePosition=n,this._cameraPosition=e}}}),c.fromBoundingSphere=function(e,i,n){if(!r(e))throw new o("occluderBoundingSphere is required.");if(!r(i))throw new o("camera position is required.");return r(n)?(t.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=i,n):new c(e,i)};var d=new t;c.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){var i=t.subtract(e,this._occluderPosition,d),r=this._occluderRadius;if(r=t.magnitudeSquared(i)-r*r,r>0)return r=Math.sqrt(r)+this._horizonDistance,i=t.subtract(e,this._cameraPosition,i),r*r>t.magnitudeSquared(i)}return!1};var p=new t;c.prototype.isBoundingSphereVisible=function(e){var i=t.clone(e.center,p),r=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){var n=t.subtract(i,this._occluderPosition,d),o=this._occluderRadius-r;if(o=t.magnitudeSquared(n)-o*o,r0?(o=Math.sqrt(o)+this._horizonDistance,n=t.subtract(i,this._cameraPosition,n),o*o+r*r>t.magnitudeSquared(n)):!1;if(o>0){n=t.subtract(i,this._cameraPosition,n);var a=t.magnitudeSquared(n),s=this._occluderRadius*this._occluderRadius,l=r*r;return(this._horizonDistance*this._horizonDistance+s)*l>a*s?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+l>a)}return!0}return!1};var m=new t;c.prototype.computeVisibility=function(e){if(!r(e))throw new o("occludeeBS is required.");var i=t.clone(e.center),n=e.radius;if(n>this._occluderRadius)return u.FULL;if(this._horizonDistance!==Number.MAX_VALUE){var a=t.subtract(i,this._occluderPosition,m),s=this._occluderRadius-n,l=t.magnitudeSquared(a);if(s=l-s*s,s>0){s=Math.sqrt(s)+this._horizonDistance,a=t.subtract(i,this._cameraPosition,a);var c=t.magnitudeSquared(a);return c>s*s+n*n?u.NONE:(s=this._occluderRadius+n,s=l-s*s,s>0?(s=Math.sqrt(s)+this._horizonDistance,s*s+n*n>c?u.FULL:u.PARTIAL):(a=t.subtract(i,this._horizonPlanePosition,a),t.dot(a,this._horizonPlaneNormal)>-n?u.PARTIAL:u.FULL))}}return u.NONE};var f=new t;c.computeOccludeePoint=function(e,i,r){var n=t.clone(i),a=t.clone(e.center),s=e.radius,l=r.length;if(t.equals(a,i))throw new o("occludeePosition must be different than occluderBoundingSphere.center");var u=t.normalize(t.subtract(n,a,f),f),h=-t.dot(u,a),d=c._anyRotationVector(a,u,h),p=c._horizonToPlaneNormalDotProduct(e,u,h,d,r[0]);if(p){for(var m,v=1;l>v;++v){if(m=c._horizonToPlaneNormalDotProduct(e,u,h,d,r[v]),!m)return;p>m&&(p=m)}if(!(.0017453283658983088>p)){var g=s/p;return t.add(a,t.multiplyByScalar(u,g,f),f)}}};var v=[];c.computeOccludeePointFromRectangle=function(r,n){n=i(n,a.WGS84);var o=l.subsample(r,n,0,v),s=e.fromPoints(o),u=t.ZERO;return t.equals(u,s.center)?void 0:c.computeOccludeePoint(new e(u,n.minimumRadius),s.center,o)};var g=new t;c._anyRotationVector=function(e,i,r){var n=t.abs(i,g),o=n.x>n.y?0:1;(0===o&&n.z>n.x||1===o&&n.z>n.y)&&(o=2);var a,s=new t;0===o?(n.x=e.x,n.y=e.y+1,n.z=e.z+1,a=t.UNIT_X):1===o?(n.x=e.x+1,n.y=e.y,n.z=e.z+1,a=t.UNIT_Y):(n.x=e.x+1,n.y=e.y+1,n.z=e.z,a=t.UNIT_Z);var l=(t.dot(i,n)+r)/-t.dot(i,a);return t.normalize(t.subtract(t.add(n,t.multiplyByScalar(a,l,s),n),e,n),n)};var _=new t;c._rotationVector=function(e,i,r,n,o){var a=t.subtract(n,e,_);if(a=t.normalize(a,a),t.dot(i,a)<.9999999847691291){var l=t.cross(i,a,a),u=t.magnitude(l);if(u>s.EPSILON13)return t.normalize(l,new t)}return o};var y=new t,C=new t,E=new t,S=new t;return c._horizonToPlaneNormalDotProduct=function(e,i,r,n,o){var a=t.clone(o,y),s=t.clone(e.center,C),l=e.radius,u=t.subtract(s,a,E),c=t.magnitudeSquared(u),h=l*l;if(h>c)return!1;var d=c-h,p=Math.sqrt(d),m=Math.sqrt(c),f=1/m,v=p*f,g=v*p;u=t.normalize(u,u);var _=t.add(a,t.multiplyByScalar(u,g,S),S),w=Math.sqrt(d-g*g),T=this._rotationVector(s,i,r,a,n),x=t.fromElements(T.x*T.x*u.x+(T.x*T.y-T.z)*u.y+(T.x*T.z+T.y)*u.z,(T.x*T.y+T.z)*u.x+T.y*T.y*u.y+(T.y*T.z-T.x)*u.z,(T.x*T.z-T.y)*u.x+(T.y*T.z+T.x)*u.y+T.z*T.z*u.z,y);x=t.normalize(x,x);var b=t.multiplyByScalar(x,w,y);T=t.normalize(t.subtract(t.add(_,b,E),s,E),E);var A=t.dot(i,T);T=t.normalize(t.subtract(t.subtract(_,b,T),s,T),T);var P=t.dot(i,T);return P>A?A:P},c}),i("Core/Packable",["./DeveloperError"],function(e){"use strict";var t={packedLength:void 0,pack:e.throwInstantiationError,unpack:e.throwInstantiationError};return t}),i("Core/PackableForInterpolation",["./DeveloperError"],function(e){"use strict";var t={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:e.throwInstantiationError,unpackInterpolationResult:e.throwInstantiationError};return t}),i("ThirdParty/measureText",[],function(){var e=function(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)},t=function(t,i,r,n){var o=t.measureText(i),a=e(t.canvas,"font-family"),s=e(t.canvas,"font-size").replace("px",""),l=!/\S/.test(i);o.fontsize=s;var u=document.createElement("div");u.style.position="absolute",u.style.opacity=0,u.style.font=s+"px "+a,u.innerHTML=i+"
"+i,document.body.appendChild(u),o.leading=1.2*s;var c=e(u,"height");if(c=c.replace("px",""),c>=2*s&&(o.leading=c/2|0),document.body.removeChild(u),l)o.ascent=0,o.descent=0,o.bounds={minx:0,maxx:o.width,miny:0,maxy:0},o.height=0;else{var h=document.createElement("canvas"),d=100;h.width=o.width+d,h.height=3*s,h.style.opacity=1,h.style.fontFamily=a,h.style.fontSize=s;var p=h.getContext("2d");p.font=s+"px "+a;var m=h.width,f=h.height,v=f/2;p.fillStyle="white",p.fillRect(-1,-1,m+2,f+2),r&&(p.strokeStyle="black",p.lineWidth=t.lineWidth,p.strokeText(i,d/2,v)),n&&(p.fillStyle="black",p.fillText(i,d/2,v));for(var g=p.getImageData(0,0,m,f).data,_=0,y=4*m,C=g.length;++_0&&255===g[_];);var S=_/y|0;for(_=0;C>_&&255===g[_];)_+=y,_>=C&&(_=_-C+4);var w=_%y/4|0,T=1;for(_=C-3;_>=0&&255===g[_];)_-=y,0>_&&(_=C-3-4*T++);var x=_%y/4+1|0;o.ascent=v-E,o.descent=S-v,o.bounds={minx:w-d/2,maxx:x-d/2,miny:0,maxy:S-E},o.height=1+(S-E)}return o};return t}),i("Core/writeTextToCanvas",["../ThirdParty/measureText","./Color","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r,n){"use strict";function o(n,o){if(""!==n){o=i(o,i.EMPTY_OBJECT);var s=i(o.font,"10px sans-serif"),l=i(o.stroke,!1),u=i(o.fill,!0),c=i(o.strokeWidth,1),h=document.createElement("canvas");h.width=1,h.height=1,h.style.font=s;var d=h.getContext("2d");r(a)||(r(d.imageSmoothingEnabled)?a="imageSmoothingEnabled":r(d.mozImageSmoothingEnabled)?a="mozImageSmoothingEnabled":r(d.webkitImageSmoothingEnabled)?a="webkitImageSmoothingEnabled":r(d.msImageSmoothingEnabled)&&(a="msImageSmoothingEnabled")),d.font=s,d.lineJoin="round",d.lineWidth=c,d[a]=!1,d.textBaseline=i(o.textBaseline,"bottom"),h.style.visibility="hidden",document.body.appendChild(h);var p=e(d,n,l,u);p.computedWidth=Math.max(p.width,p.bounds.maxx-p.bounds.minx),h.dimensions=p,document.body.removeChild(h),h.style.visibility="";var m=p.height-p.ascent;h.width=p.computedWidth,h.height=p.height;var f=h.height-m;if(d.font=s,d.lineJoin="round",d.lineWidth=c,d[a]=!1,l){var v=i(o.strokeColor,t.BLACK);d.strokeStyle=v.toCssColorString(),d.strokeText(n,0,f)}if(u){var g=i(o.fillColor,t.WHITE);d.fillStyle=g.toCssColorString(),d.fillText(n,0,f)}return h}}var a;return o}),i("Core/PinBuilder",["./buildModuleUrl","./Color","./defined","./DeveloperError","./loadImage","./writeTextToCanvas"],function(e,t,i,r,n,o){"use strict";function a(){this._cache={}}function s(e,t,i){e.save(),e.scale(i/24,i/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,c).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function l(e,i,r){var n=r/2.5,o=n,a=n;i.width>i.height?a=n*(i.height/i.width):i.width0&&r.y>0&&r.z>0}var r=new t;return i}),i("Core/Queue",["../Core/defineProperties"],function(e){"use strict";function t(){this._array=[],this._offset=0,this._length=0}return e(t.prototype,{length:{get:function(){return this._length}}}),t.prototype.enqueue=function(e){this._array.push(e),this._length++},t.prototype.dequeue=function(){if(0!==this._length){var e=this._array,t=this._offset,i=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,i}},t.prototype.peek=function(){return 0!==this._length?this._array[this._offset]:void 0},t.prototype.contains=function(e){return-1!==this._array.indexOf(e)},t.prototype.clear=function(){this._array.length=this._offset=this._length=0},t.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},t}),i("Core/WindingOrder",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"use strict";var i={CLOCKWISE:e.CW,COUNTER_CLOCKWISE:e.CCW,validate:function(e){return e===i.CLOCKWISE||e===i.COUNTER_CLOCKWISE}};return t(i)}),i("Core/PolygonPipeline",["./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./Math","./pointInsideTriangle","./PolylinePipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function v(t,i,r){var n=e.subtract(i,t,F),o=e.subtract(r,i,B);return n.x*o.y-n.y*o.x>=0}function g(e){for(var t=e[0].x,i=0,r=0;rt&&(t=e[r].x,i=r);return i}function _(e){for(var t=e[0][0].x,i=0,r=0;rt&&(t=n,i=r)}return i}function y(e){for(var t=[],i=0;ic&&(c=n[h].x);c+=c-u;var d=new t(c,i.y,0);for(h=0;h=i.x||m.x>=i.x)&&(p.y>=i.y&&m.y<=i.y||p.y<=i.y&&m.y>=i.y)){var f=(m.y-p.y)*(d.x-i.x)-(m.x-p.x)*(d.y-i.y);if(0!==f){f=1/f;var v=((m.x-p.x)*(i.y-p.y)-(m.y-p.y)*(i.x-p.x))*f,_=((d.x-i.x)*(i.y-p.y)-(d.y-i.y)*(i.x-p.x))*f;if(v>=0&&1>=v&&_>=0&&1>=_){var y=new e(i.x+v*(d.x-i.x),i.y+v*(d.y-i.y)),C=e.subtract(y,i,V);f=e.magnitudeSquared(C),a>f&&(l=y,a=f,o[0]=h,o[1]=(h+1)%n.length)}}}}return l}function S(t,i){var r=_(i),n=i[r],o=g(n),a=n[o],s=[],l=E(a,t,s),u=C(t,l);if(-1!==u)return u;var d=e.magnitudeSquared(e.subtract(t[s[0]],a,k)),p=e.magnitudeSquared(e.subtract(t[s[1]],a,k)),m=p>d?t[s[0]]:t[s[1]],f=y(t),v=f.indexOf(m);-1!==v&&f.splice(v,1);for(var S=[],w=0;w0){var b=e.fromElements(1,0,k);for(w=0;wI&&(x=I,m=S[w])}}}return t.indexOf(m)}function w(e,i,r){for(var n=ee.computeWindingOrder2D(e),o=0;of?0>p&&m>0?U:G:f>0?p>0&&0>m?G:U:void 0}function M(e,t,i){return(e>t||e>i)&&(t>e||i>e)||t===i&&t===e}function D(t,i,r,n){var o=e.subtract(r,t,Y),a=i.x*n.y-i.y*n.x,s=a*a,l=e.magnitudeSquared(i),u=e.magnitudeSquared(n);if(s>j*l*u){var c=(o.x*n.y-o.y*n.x)/a;return e.add(t,e.multiplyByScalar(i,c,Y),Y)}}function R(t,i,r){for(var o=e.subtract(i,t,X),a=r.length,s=0;a>s;s++){var l=r[s].position,u=r[c.mod(s+1,a)].position;if(!(e.equals(t,l)||e.equals(i,u)||e.equals(t,u)||e.equals(i,l))){var h=e.subtract(u,l,Z),d=D(t,o,l,h);if(n(d)&&!(e.equals(d,t)||e.equals(d,i)||e.equals(d,l)||e.equals(d,u))){var p=d.x,m=d.y,f=M(p,t.x,i.x)&&M(m,t.y,i.y)&&M(p,l.x,u.x)&&M(m,l.y,u.y);if(f)return!0}}}return!1}function O(t,i,r){var n=I(t,i,r);if(n>=0)return n;var o=I(i,t,r);return o>=0?o:n!==U||o!==U||R(r[t].position,r[i].position,r)||e.equals(r[t].position,r[i].position)?Q:K}function N(e){return 0===x(1,2,0,e)}function L(e){var t=e.length;if(3===t)return N(e)?[]:[e[0].index,e[1].index,e[2].index];if(e.length<3)throw new o("Invalid polygon: must have at least three vertices.");for(var i,r,n=0,a=10*e.length,s=Q;K>s&&n++e.length-2;)r=T(e.length);if(i>r){var l=i;i=r,r=l}s=O(i,r,e)}if(s===K){var u=e.splice(i,r-i+1,e[i],e[r]);return L(e).concat(L(u))}return s>=0?(e.splice(s,1),L(e)):[]}var F=new e,B=new e,V=new e,k=new e(1,0),z=new e,U=-1,G=-2,W=new t,H=new t,q=new t,j=c.EPSILON14,Y=new e,X=new e,Z=new e,K=-1,Q=-2,J=new t,$=new t,ee={};ee.removeDuplicates=function(e){var i=d.removeDuplicates(e);return t.equals(i[0],i[i.length-1])?i.slice(1):i},ee.computeArea2D=function(e){for(var t=e.length,i=0,r=t-1,n=0;t>n;r=n++){var o=e[r],a=e[n];i+=o.x*a.y-a.x*o.y}return.5*i},ee.computeWindingOrder2D=function(e){var t=ee.computeArea2D(e);return t>0?f.COUNTER_CLOCKWISE:f.CLOCKWISE},ee.triangulate=function(e){for(var t=e.length,i=[],r=0;t>r;++r)i[r]={position:e[r],index:r};return L(i)};var te=new t,ie=new t,re=new t,ne=new t,oe=new t,ae=new t,se=new t;return ee.computeSubdivision=function(e,o,a,s){s=r(s,c.RADIANS_PER_DEGREE);var h,d=a.slice(0),m=o.length,f=new Array(3*m),v=0;for(h=0;m>h;h++){var g=o[h];f[v++]=g.x,f[v++]=g.y,f[v++]=g.z}for(var _=[],y={},C=e.maximumRadius,E=c.chordLength(s,C),S=E*E;d.length>0;){var w,T,x=d.pop(),b=d.pop(),A=d.pop(),P=t.fromArray(f,3*A,te),I=t.fromArray(f,3*b,ie),M=t.fromArray(f,3*x,re),D=t.multiplyByScalar(t.normalize(P,ne),C,ne),R=t.multiplyByScalar(t.normalize(I,oe),C,oe),O=t.multiplyByScalar(t.normalize(M,ae),C,ae),N=t.magnitudeSquared(t.subtract(D,R,se)),L=t.magnitudeSquared(t.subtract(R,O,se)),F=t.magnitudeSquared(t.subtract(O,D,se)),B=Math.max(N,L,F);B>S?N===B?(w=Math.min(A,b)+" "+Math.max(A,b),h=y[w],n(h)||(T=t.add(P,I,se),t.multiplyByScalar(T,.5,T),f.push(T.x,T.y,T.z),h=f.length/3-1,y[w]=h),d.push(A,h,x),d.push(h,b,x)):L===B?(w=Math.min(b,x)+" "+Math.max(b,x),h=y[w],n(h)||(T=t.add(I,M,se),t.multiplyByScalar(T,.5,T),f.push(T.x,T.y,T.z),h=f.length/3-1,y[w]=h),d.push(b,h,A),d.push(h,x,A)):F===B&&(w=Math.min(x,A)+" "+Math.max(x,A),h=y[w],n(h)||(T=t.add(M,P,se),t.multiplyByScalar(T,.5,T),f.push(T.x,T.y,T.z),h=f.length/3-1,y[w]=h),d.push(x,h,b),d.push(h,A,b)):(_.push(A),_.push(b),_.push(x))}return new l({attributes:{position:new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:f})},indices:_,primitiveType:p.TRIANGLES})},ee.scaleToGeodeticHeight=function(e,i,o,s){o=r(o,a.WGS84);var l=J,u=$;if(i=r(i,0),s=r(s,!0),n(e)&&n(e.attributes)&&n(e.attributes.position))for(var c=e.attributes.position.values,h=c.length,d=0;h>d;d+=3)t.fromArray(c,d,u),s&&(u=o.scaleToGeodeticSurface(u,u)),0!==i&&(l=o.geodeticSurfaceNormal(u,l),t.multiplyByScalar(l,i,l),t.add(u,l,u)),c[d]=u.x,c[d+1]=u.y,c[d+2]=u.z;return e},ee.eliminateHoles=function(e,i,n){n=r(n,a.WGS84);for(var o=[],s=0;s0;)c=w(c,o,n);return c},ee}),i("Core/PolygonGeometryLibrary",["./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(t,i,r,n){return e.subtract(i,t,g),e.multiplyByScalar(g,r/n,g),e.add(t,g,g),[g.x,g.y,g.z]}var v={};v.computeHierarchyPackedLength=function(t){for(var i=0,n=[t];n.length>0;){var o=n.pop();if(r(o)){i+=2;var a=o.positions,s=o.holes;if(r(a)&&(i+=a.length*e.packedLength),r(s))for(var l=s.length,u=0;l>u;++u)n.push(s[u])}}return i},v.packPolygonHierarchy=function(t,i,n){for(var o=[t];o.length>0;){var a=o.pop();if(r(a)){var s=a.positions,l=a.holes;if(i[n++]=r(s)?s.length:0,i[n++]=r(l)?l.length:0,r(s))for(var u=s.length,c=0;u>c;++c,n+=3)e.pack(s[c],i,n);if(r(l))for(var h=l.length,d=0;h>d;++d)o.push(l[d])}}return n},v.unpackPolygonHierarchy=function(t,i){for(var r=t[i++],n=t[i++],o=new Array(r),a=n>0?new Array(n):void 0,s=0;r>s;++s,i+=e.packedLength)o[s]=e.unpack(t,i);for(var l=0;n>l;++l)a[l]=v.unpackPolygonHierarchy(t,i),i=a[l].startingIndex,delete a[l].startingIndex;return{positions:o,holes:a,startingIndex:i}};var g=new e;v.subdivideLineCount=function(t,i,r){var n=e.distance(t,i),o=n/r,a=Math.max(0,Math.ceil(Math.log(o)/Math.log(2)));return Math.pow(2,a)},v.subdivideLine=function(t,i,n,o){var a=v.subdivideLineCount(t,i,n),s=e.distance(t,i),l=s/a;r(o)||(o=[]);var u=o;u.length=3*a;for(var c=0,h=0;a>h;h++){var d=f(t,i,h*l,s);u[c++]=d[0],u[c++]=d[1],u[c++]=d[2]}return u};var _=new e,y=new e,C=new e,E=new e;v.scaleToGeodeticHeightExtruded=function(t,o,a,s,l){s=i(s,n.WGS84);var u=_,c=y,h=C,d=E;if(r(t)&&r(t.attributes)&&r(t.attributes.position))for(var p=t.attributes.position.values,m=p.length/2,f=0;m>f;f+=3)e.fromArray(p,f,h),s.geodeticSurfaceNormal(h,u),d=s.scaleToGeodeticSurface(h,d),c=e.multiplyByScalar(u,a,c),c=e.add(d,c,c),p[f+m]=c.x,p[f+1+m]=c.y,p[f+2+m]=c.z,l&&(d=e.clone(h,d)),c=e.multiplyByScalar(u,o,c),c=e.add(d,c,c),p[f]=c.x,p[f+1]=c.y,p[f+2]=c.z;return t},v.polygonsFromHierarchy=function(e){var t=[],i=[],n=new p;for(n.enqueue(e);0!==n.length;){var o=n.dequeue(),a=o.positions,s=o.holes;if(a=h.removeDuplicates(a),!(a.length<3)){for(var l=r(s)?s.length:0,u=[],c=0;l>c;c++){var d=s[c];if(d.positions=h.removeDuplicates(d.positions),!(d.positions.length<3)){u.push(d.positions);var m=0;r(d.holes)&&(m=d.holes.length);for(var f=0;m>f;f++)n.enqueue(d.holes[f])}}i.push({outerRing:a,holes:u});var v=u.length>0?h.eliminateHoles(a,u):a;t.push(v)}}return{hierarchy:i,polygons:t}};var S=[];v.createGeometryFromPositions=function(e,i,r,n){var l=o.fromPoints(i,e),u=l.projectPointsOntoPlane(i,S),c=h.computeWindingOrder2D(u);c===m.CLOCKWISE&&(u.reverse(),i=i.slice().reverse());var p=h.triangulate(u);if(p.length<3&&(p=[0,1,2]),n){for(var f=i.length,v=new Array(3*f),g=0,_=0;f>_;_++){var y=i[_];v[g++]=y.x,v[g++]=y.y,v[g++]=y.z}return new a({attributes:{position:new s({componentDatatype:t.DOUBLE,componentsPerAttribute:3,values:v})},indices:p,primitiveType:d.TRIANGLES})}return h.computeSubdivision(e,i,p,r)};var w=[],T=new e,x=new e;return v.computeWallGeometry=function(i,r,n,o){var h,p,m,f,g,_=i.length,y=0;if(o)for(p=3*_*2,h=new Array(2*p),m=0;_>m;m++)f=i[m],g=i[(m+1)%_],h[y]=h[y+p]=f.x,++y,h[y]=h[y+p]=f.y,++y,h[y]=h[y+p]=f.z,++y,h[y]=h[y+p]=g.x,++y,h[y]=h[y+p]=g.y,++y,h[y]=h[y+p]=g.z,++y;else{var C=c.chordLength(n,r.maximumRadius),E=0;for(m=0;_>m;m++)E+=v.subdivideLineCount(i[m],i[(m+1)%_],C);for(p=3*(E+_),h=new Array(2*p),m=0;_>m;m++){f=i[m],g=i[(m+1)%_];for(var S=v.subdivideLine(f,g,C,w),b=S.length,A=0;b>A;++A,++y)h[y]=S[A],h[y+p]=S[A];h[y]=g.x,h[y+p]=g.x,++y,h[y]=g.y,h[y+p]=g.y,++y,h[y]=g.z,h[y+p]=g.z,++y}}_=h.length;var P=u.createTypedArray(_/3,_-6*i.length),I=0;for(_/=6,m=0;_>m;m++){var M=m,D=M+1,R=M+_,O=R+1;f=e.fromArray(h,3*M,T),g=e.fromArray(h,3*D,x),e.equalsEpsilon(f,g,c.EPSILON14)||(P[I++]=M,P[I++]=R,P[I++]=D,P[I++]=D,P[I++]=R,P[I++]=O)}return new a({attributes:new l({position:new s({componentDatatype:t.DOUBLE,componentsPerAttribute:3,values:h})}),indices:P,primitiveType:d.TRIANGLES})},v}),i("Core/PolygonGeometry",["./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PolygonGeometryLibrary","./PolygonPipeline","./Quaternion","./VertexFormat","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S){"use strict";function w(e,t,i,n){for(var o=C.fromAxisAngle(e._plane.normal,i,I),s=g.fromQuaternion(o,M),l=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,c=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,d=t.length,p=0;d>p;++p){var m=r.clone(t[p],P);g.multiplyByVector(s,m,m);var f=e.projectPointOntoPlane(m,A);a(f)&&(l=Math.min(l,f.x),u=Math.max(u,f.x),c=Math.min(c,f.y),h=Math.max(h,f.y))}return n.x=l,n.y=c,n.width=u-l,n.height=h-c,n}function T(e,t,o,a,s,l,c){if(e.st||e.normal||e.tangent||e.binormal){var d=u.fromPoints(o,a),p=w(d,o,s,D),m=V;m.x=p.x,m.y=p.y;var f=t.attributes.position.values,_=f.length,y=e.st?new Float32Array(2*(_/3)):void 0,E=e.normal?new Float32Array(_):void 0,S=e.tangent?new Float32Array(_):void 0,T=e.binormal?new Float32Array(_):void 0,x=0,b=0,A=O,P=N,I=L,M=!0,W=C.fromAxisAngle(d._plane.normal,s,U),H=g.fromQuaternion(W,G),q=_/2,j=_/3;l&&(_/=2);for(var Y=0;_>Y;Y+=3){var X=r.fromArray(f,Y,z);if(e.st){var Z=g.multiplyByVector(H,X,R);Z=a.scaleToGeodeticSurface(Z,Z);var K=d.projectPointOntoPlane(Z,k);i.subtract(K,m,K),l&&(y[x+j]=K.x/p.width,y[x+1+j]=K.y/p.height),y[x]=K.x/p.width,y[x+1]=K.y/p.height,x+=2}if(e.normal||e.tangent||e.binormal){var Q=b+1,J=b+2;if(c){if(_>Y+3){var $=r.fromArray(f,Y+3,F);if(M){var ee=r.fromArray(f,Y+_,B);r.subtract($,X,$),r.subtract(ee,X,ee),A=r.normalize(r.cross(ee,$,A),A),M=!1}r.equalsEpsilon($,X,v.EPSILON10)&&(M=!0)}(e.tangent||e.binormal)&&(I=a.geodeticSurfaceNormal(X,I),e.tangent&&(P=r.normalize(r.cross(I,A,P),P)))}else A=a.geodeticSurfaceNormal(X,A),(e.tangent||e.binormal)&&(P=r.cross(r.UNIT_Z,A,P),P=r.normalize(g.multiplyByVector(H,P,P),P),e.binormal&&(I=r.normalize(r.cross(A,P,I),I)));e.normal&&(l&&!c?(E[b+q]=-A.x,E[Q+q]=-A.y,E[J+q]=-A.z):(E[b+q]=A.x,E[Q+q]=A.y,E[J+q]=A.z),E[b]=A.x,E[Q]=A.y,E[J]=A.z),e.tangent&&(l&&!c?(S[b+q]=-P.x,S[Q+q]=-P.y,S[J+q]=-P.z):(S[b+q]=P.x,S[Q+q]=P.y,S[J+q]=P.z),S[b]=P.x,S[Q]=P.y,S[J]=P.z),e.binormal&&(l&&(T[b+q]=I.x,T[Q+q]=I.y,T[J+q]=I.z),T[b]=I.x,T[Q]=I.y,T[J]=I.z),b+=3}}e.st&&(t.attributes.st=new h({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:y})),e.normal&&(t.attributes.normal=new h({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:E})),e.tangent&&(t.attributes.tangent=new h({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:S})),e.binormal&&(t.attributes.binormal=new h({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:T}))}return t}function x(e,t,i,r,o){var a=_.createGeometryFromPositions(e,t,i,o),s=a.attributes.position.values,l=a.indices,m=s.concat(s),v=m.length/3,g=f.createTypedArray(v,2*l.length);g.set(l);var C,E=l.length,w=v/2;for(C=0;E>C;C+=3){var T=g[C]+w,x=g[C+1]+w,b=g[C+2]+w;g[C+E]=b,g[C+1+E]=x,g[C+2+E]=T}var A=new c({attributes:new d({position:new h({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:m})}),indices:g,primitiveType:a.primitiveType}),P={topAndBottom:new p({geometry:A}),walls:[]},I=r.outerRing,M=u.fromPoints(I,e),D=M.projectPointsOntoPlane(I,W),R=y.computeWindingOrder2D(D);R===S.CLOCKWISE&&(I=I.slice().reverse());var O=_.computeWallGeometry(I,e,i,o);P.walls.push(new p({geometry:O}));var N=r.holes;for(C=0;Cy;y++){var T=i[y],x=i[(y+1)%C];g[E++]=T.x,g[E++]=T.y,g[E++]=T.z,g[E++]=x.x,g[E++]=x.y,g[E++]=x.z}else{var b=0;for(y=0;C>y;y++)b+=m.subdivideLineCount(i[y],i[(y+1)%C],r);for(g=new Float64Array(3*b),y=0;C>y;y++)for(var A=m.subdivideLine(i[y],i[(y+1)%C],r,w),P=A.length,I=0;P>I;++I)g[E++]=A[I]}C=g.length/3;var M=2*C,D=d.createTypedArray(C,M);for(E=0,y=0;C-1>y;y++)D[E++]=y,D[E++]=y+1;return D[E++]=C-1,D[E++]=0,new c({geometry:new s({attributes:new u({position:new l({componentDatatype:t.DOUBLE,componentsPerAttribute:3,values:g})}),indices:D,primitiveType:v.LINES})})}function C(e,i,r,n){var o=a.fromPoints(i,e),h=o.projectPointsOntoPlane(i,S),p=f.computeWindingOrder2D(h);p===_.CLOCKWISE&&(h.reverse(),i=i.slice().reverse());var g,y,C=i.length,E=new Array(C),T=0;if(n)for(g=new Float64Array(2*C*3*2),y=0;C>y;++y){E[y]=T/3;var x=i[y],b=i[(y+1)%C];g[T++]=x.x,g[T++]=x.y,g[T++]=x.z,g[T++]=b.x,g[T++]=b.y,g[T++]=b.z}else{var A=0;for(y=0;C>y;y++)A+=m.subdivideLineCount(i[y],i[(y+1)%C],r);for(g=new Float64Array(3*A*2),y=0;C>y;++y){E[y]=T/3;for(var P=m.subdivideLine(i[y],i[(y+1)%C],r,w),I=P.length,M=0;I>M;++M)g[T++]=P[M]}}C=g.length/6;var D=E.length,R=2*(2*C+D),O=d.createTypedArray(C,R);for(T=0,y=0;C>y;++y)O[T++]=y,O[T++]=(y+1)%C,O[T++]=y+C,O[T++]=(y+1)%C+C;for(y=0;D>y;y++){var N=E[y];O[T++]=N,O[T++]=N+C}return new c({geometry:new s({attributes:new u({position:new l({componentDatatype:t.DOUBLE,componentsPerAttribute:3,values:g})}),indices:O,primitiveType:v.LINES})})}function E(e){var t=e.polygonHierarchy,n=i(e.ellipsoid,o.WGS84),a=i(e.granularity,p.RADIANS_PER_DEGREE),s=i(e.height,0),l=i(e.perPositionHeight,!1),u=e.extrudedHeight,c=r(u);if(c&&!l){var h=u;u=Math.min(h,s),s=Math.max(h,s)}this._ellipsoid=o.clone(n),this._granularity=a,this._height=s,this._extrudedHeight=i(u,0),this._extrude=c,this._polygonHierarchy=t,this._perPositionHeight=l,this._workerName="createPolygonOutlineGeometry",this.packedLength=m.computeHierarchyPackedLength(t)+o.packedLength+6}var S=[],w=[];E.pack=function(e,t,r){r=i(r,0),r=m.packPolygonHierarchy(e._polygonHierarchy,t,r),o.pack(e._ellipsoid,t,r),r+=o.packedLength,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._granularity,t[r++]=e._extrude?1:0,t[r++]=e._perPositionHeight?1:0,t[r++]=e.packedLength};var T=o.clone(o.UNIT_SPHERE),x={polygonHierarchy:{}};return E.unpack=function(e,t,n){t=i(t,0);var a=m.unpackPolygonHierarchy(e,t);t=a.startingIndex,delete a.startingIndex;var s=o.unpack(e,t,T);t+=o.packedLength;var l=e[t++],u=e[t++],c=e[t++],h=1===e[t++],d=1===e[t++],p=e[t++];return r(n)||(n=new E(x)),n._polygonHierarchy=a,n._ellipsoid=o.clone(s,n._ellipsoid),n._height=l,n._extrudedHeight=u,n._granularity=c,n._extrude=h,n._perPositionHeight=d,n.packedLength=p,n},E.fromPositions=function(e){e=i(e,i.EMPTY_OBJECT);var t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight};return new E(t)},E.createGeometry=function(t){var i=t._ellipsoid,n=t._granularity,o=t._height,a=t._extrudedHeight,l=t._extrude,u=t._polygonHierarchy,c=t._perPositionHeight,d=[],v=new g;v.enqueue(u);for(var _;0!==v.length;){var E=v.dequeue(),S=E.positions;if(S=f.removeDuplicates(S),!(S.length<3)){var w=E.holes?E.holes.length:0;for(_=0;w>_;_++){var T=E.holes[_];if(T.positions=f.removeDuplicates(T.positions),!(T.positions.length<3)){d.push(T.positions);var x=0;r(T.holes)&&(x=T.holes.length);for(var b=0;x>b;b++)v.enqueue(T.holes[b])}}d.push(S)}}if(0!==d.length){var A,P=[],I=p.chordLength(n,i.maximumRadius);if(l)for(_=0;_s;s++)a[s]=i.clone(r);return a}var v=(d-l)/o,g=(p-u)/o,_=(m-c)/o,C=(f-h)/o;for(s=0;o>s;s++)a[s]=new i(l+s*v,u+s*g,c+s*_,h+s*C);return a}function _(e){e=n(e,n.EMPTY_OBJECT);var r=e.positions,a=e.colors,l=n(e.width,1),u=n(e.colorsPerVertex,!1);this._positions=r,this._colors=a,this._width=l,this._colorsPerVertex=u,this._vertexFormat=v.clone(n(e.vertexFormat,v.DEFAULT)),this._followSurface=n(e.followSurface,!0),this._granularity=n(e.granularity,p.RADIANS_PER_DEGREE),this._ellipsoid=s.clone(n(e.ellipsoid,s.WGS84)),this._workerName="createPolylineGeometry";var c=1+r.length*t.packedLength;c+=o(a)?1+a.length*i.packedLength:1,this.packedLength=c+s.packedLength+v.packedLength+4}var y=[];_.pack=function(e,r,a){a=n(a,0);var l,u=e._positions,c=u.length;for(r[a++]=c,l=0;c>l;++l,a+=t.packedLength)t.pack(u[l],r,a);var h=e._colors;for(c=o(h)?h.length:0,r[a++]=c,l=0;c>l;++l,a+=i.packedLength)i.pack(h[l],r,a);s.pack(e._ellipsoid,r,a),a+=s.packedLength,v.pack(e._vertexFormat,r,a),a+=v.packedLength,r[a++]=e._width,r[a++]=e._colorsPerVertex?1:0,r[a++]=e._followSurface?1:0,r[a]=e._granularity};var C=s.clone(s.UNIT_SPHERE),E=new v,S={positions:void 0,colors:void 0,ellipsoid:C,vertexFormat:E,width:void 0,colorsPerVertex:void 0,followSurface:void 0,granularity:void 0};_.unpack=function(e,r,a){r=n(r,0);var l,u=e[r++],c=new Array(u);for(l=0;u>l;++l,r+=t.packedLength)c[l]=t.unpack(e,r);u=e[r++];var h=u>0?new Array(u):void 0;for(l=0;u>l;++l,r+=i.packedLength)h[l]=i.unpack(e,r);var d=s.unpack(e,r,C);r+=s.packedLength;var p=v.unpack(e,r,E);r+=v.packedLength;var m=e[r++],f=1===e[r++],g=1===e[r++],y=e[r];return o(a)?(a._positions=c,a._colors=h,a._ellipsoid=s.clone(d,a._ellipsoid),a._vertexFormat=v.clone(p,a._vertexFormat),a._width=m,a._colorsPerVertex=f,a._followSurface=g,a._granularity=y,a):(S.positions=c,S.colors=h,S.width=m,S.colorsPerVertex=f,S.followSurface=g,S.granularity=y,new _(S))};var w=new t,T=new t,x=new t,b=new t;return _.createGeometry=function(n){var a,s,v,_=n._width,C=n._vertexFormat,E=n._colors,S=n._colorsPerVertex,A=n._followSurface,P=n._granularity,I=n._ellipsoid,M=p.chordLength(P,I.maximumRadius),D=m.removeDuplicates(n._positions),R=D.length;if(!(2>R)){if(A){var O=m.extractHeights(D,I);if(o(E)){var N=1;for(a=0;R-1>a;++a)N+=m.numberOfPoints(D[a],D[a+1],M);var L=new Array(N),F=0;for(a=0;R-1>a;++a){var B=D[a],V=D[a+1],k=E[a],z=m.numberOfPoints(B,V,M);if(S&&N>a){var U=E[a+1],G=g(B,V,k,U,z),W=G.length;for(s=0;W>s;++s)L[F++]=G[s]}else for(s=0;z>s;++s)L[F++]=i.clone(k)}L[F]=i.clone(E[E.length-1]),E=L,y.length=0}D=m.generateCartesianArc({positions:D,minDistance:M,ellipsoid:I,height:O})}R=D.length;var H,q=4*R-4,j=new Float64Array(3*q),Y=new Float64Array(3*q),X=new Float64Array(3*q),Z=new Float32Array(2*q),K=C.st?new Float32Array(2*q):void 0,Q=o(E)?new Uint8Array(4*q):void 0,J=0,$=0,ee=0,te=0;for(s=0;R>s;++s){0===s?(H=w,t.subtract(D[0],D[1],H),t.add(D[0],H,H)):H=D[s-1],t.clone(H,x),t.clone(D[s],T),s===R-1?(H=w,t.subtract(D[R-1],D[R-2],H),t.add(D[R-1],H,H)):H=D[s+1],t.clone(H,b);var ie,re;o(Q)&&(ie=0===s||S?E[s]:E[s-1],s!==R-1&&(re=E[s]));var ne=0===s?2:0,oe=s===R-1?2:4;for(v=ne;oe>v;++v){t.pack(T,j,J),t.pack(x,Y,J),t.pack(b,X,J),J+=3;var ae=0>v-2?-1:1;if(Z[$++]=2*(v%2)-1,Z[$++]=ae*_,C.st&&(K[ee++]=s/(R-1),K[ee++]=Math.max(Z[$-2],0)),o(Q)){var se=2>v?ie:re;Q[te++]=i.floatToByte(se.red),Q[te++]=i.floatToByte(se.green),Q[te++]=i.floatToByte(se.blue),Q[te++]=i.floatToByte(se.alpha)}}}var le=new c;le.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:j}),le.prevPosition=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:Y}),le.nextPosition=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:X}),le.expandAndWidth=new u({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:Z}),C.st&&(le.st=new u({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:K})),o(Q)&&(le.color=new u({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:4,values:Q,normalize:!0}));var ue=d.createTypedArray(q,6*R-6),ce=0,he=0,de=R-1;for(s=0;de>s;++s)ue[he++]=ce,ue[he++]=ce+2,ue[he++]=ce+1,ue[he++]=ce+1,ue[he++]=ce+2,ue[he++]=ce+3,ce+=4;return new l({attributes:le,indices:ue,primitiveType:f.TRIANGLES,boundingSphere:e.fromPoints(D),geometryType:h.POLYLINES})}},_}),i("Core/PolylineVolumeGeometry",["./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./PolygonPipeline","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./VertexFormat","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E){"use strict";function S(e,i,r,o){var a=new d;o.position&&(a.position=new h({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:e}));var s,l,u,f,g,_,C=i.length,E=e.length/3,S=(E-2*C)/(2*C),w=v.triangulate(i),T=(S-1)*C*6+2*w.length,x=m.createTypedArray(E,T),b=2*C,A=0;for(s=0;S-1>s;s++){for(l=0;C-1>l;l++)u=2*l+s*C*2,_=u+b,f=u+1,g=f+b,x[A++]=f,x[A++]=u,x[A++]=g,x[A++]=g,x[A++]=u,x[A++]=_;u=2*C-2+s*C*2,f=u+1,g=f+b,_=u+b,x[A++]=f,x[A++]=u,x[A++]=g,x[A++]=g,x[A++]=u,x[A++]=_}if(o.st||o.tangent||o.binormal){var P,I,M=new Float32Array(2*E),D=1/(S-1),R=1/r.height,O=r.height/2,N=0;for(s=0;S>s;s++){for(P=s*D,I=R*(i[0].y+O),M[N++]=P,M[N++]=I,l=1;C>l;l++)I=R*(i[l].y+O),M[N++]=P,M[N++]=I,M[N++]=P,M[N++]=I;I=R*(i[0].y+O),M[N++]=P,M[N++]=I}for(l=0;C>l;l++)P=0,I=R*(i[l].y+O),M[N++]=P,M[N++]=I;for(l=0;C>l;l++)P=(S-1)*D,I=R*(i[l].y+O),M[N++]=P,M[N++]=I;a.st=new h({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:new Float32Array(M)})}var L=E-2*C;for(s=0;so;++o,n+=r.packedLength)r.pack(s[o],t,n);var c=e._shape;for(l=c.length,t[n++]=l,o=0;l>o;++o,n+=i.packedLength)i.pack(c[o],t,n);u.pack(e._ellipsoid,t,n),n+=u.packedLength,C.pack(e._vertexFormat,t,n),n+=C.packedLength,t[n++]=e._cornerType,t[n]=e._granularity};var T=u.clone(u.UNIT_SPHERE),x=new C,b={polylinePositions:void 0,shapePositions:void 0,ellipsoid:T,vertexFormat:x,cornerType:void 0,granularity:void 0};w.unpack=function(e,t,n){t=a(t,0);var o,l=e[t++],c=new Array(l);for(o=0;l>o;++o,t+=r.packedLength)c[o]=r.unpack(e,t);l=e[t++];var h=new Array(l);for(o=0;l>o;++o,t+=i.packedLength)h[o]=i.unpack(e,t);var d=u.unpack(e,t,T);t+=u.packedLength;var p=C.unpack(e,t,x);t+=C.packedLength;var m=e[t++],f=e[t];return s(n)?(n._positions=c,n._shape=h,n._ellipsoid=u.clone(d,n._ellipsoid),n._vertexFormat=C.clone(p,n._vertexFormat),n._cornerType=m,n._granularity=f,n):(b.polylinePositions=c,b.shapePositions=h,b.cornerType=m,b.granularity=f,new w(b))};var A=new e;return w.createGeometry=function(t){var i=t._positions,r=g.removeDuplicates(i),n=t._shape;if(n=_.removeDuplicatesFromShape(n),!(r.length<2||n.length<3)){v.computeWindingOrder2D(n)===E.CLOCKWISE&&n.reverse();var o=e.fromPoints(n,A),a=_.computePositions(r,n,o,t,!0);return S(a,n,o,t._vertexFormat)}},w}),i("Core/PolylineVolumeOutlineGeometry",["./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y){"use strict";function C(e,i){var r=new d;r.position=new h({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:e});var o,a,s=i.length,l=r.position.values.length/3,u=e.length/3,m=u/s,f=p.createTypedArray(l,2*s*(m+1)),v=0;o=0;var g=o*s;for(a=0;s-1>a;a++)f[v++]=a+g,f[v++]=a+g+1;for(f[v++]=s-1+g,f[v++]=g,o=m-1,g=o*s,a=0;s-1>a;a++)f[v++]=a+g,f[v++]=a+g+1;for(f[v++]=s-1+g,f[v++]=g,o=0;m-1>o;o++){var y=s*o,C=y+s;for(a=0;s>a;a++)f[v++]=a+y,f[v++]=a+C}var E=new c({attributes:r,indices:p.createTypedArray(l,f),boundingSphere:t.fromVertices(e),primitiveType:_.LINES});return E}function E(e){e=a(e,a.EMPTY_OBJECT);var t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=u.clone(a(e.ellipsoid,u.WGS84)),this._cornerType=a(e.cornerType,o.ROUNDED),this._granularity=a(e.granularity,m.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";var s=1+t.length*r.packedLength;s+=1+n.length*i.packedLength,this.packedLength=s+u.packedLength+2}E.pack=function(e,t,n){n=a(n,0);var o,s=e._positions,l=s.length;for(t[n++]=l,o=0;l>o;++o,n+=r.packedLength)r.pack(s[o],t,n);var c=e._shape;for(l=c.length,t[n++]=l,o=0;l>o;++o,n+=i.packedLength)i.pack(c[o],t,n);u.pack(e._ellipsoid,t,n),n+=u.packedLength,t[n++]=e._cornerType,t[n]=e._granularity};var S=u.clone(u.UNIT_SPHERE),w={polylinePositions:void 0,shapePositions:void 0,ellipsoid:S,height:void 0,cornerType:void 0,granularity:void 0};E.unpack=function(e,t,n){t=a(t,0);var o,l=e[t++],c=new Array(l);for(o=0;l>o;++o,t+=r.packedLength)c[o]=r.unpack(e,t);l=e[t++];var h=new Array(l);for(o=0;l>o;++o,t+=i.packedLength)h[o]=i.unpack(e,t);var d=u.unpack(e,t,S);t+=u.packedLength;var p=e[t++],m=e[t];return s(n)?(n._positions=c,n._shape=h,n._ellipsoid=u.clone(d,n._ellipsoid),n._cornerType=p,n._granularity=m,n):(w.polylinePositions=c,w.shapePositions=h,w.cornerType=p,w.granularity=m,new E(w))};var T=new e;return E.createGeometry=function(t){var i=t._positions,r=v.removeDuplicates(i),n=t._shape;if(n=g.removeDuplicatesFromShape(n),!(r.length<2||n.length<3)){f.computeWindingOrder2D(n)===y.CLOCKWISE&&n.reverse();var o=e.fromPoints(n,T),a=g.computePositions(r,n,o,t,!1);return C(a,n)}},E}),i("Core/QuaternionSpline",["./defaultValue","./defined","./defineProperties","./DeveloperError","./Quaternion","./Spline"],function(e,t,i,r,n,o){"use strict";function a(e,i,r){var o=e.length,a=new Array(o);a[0]=t(i)?i:e[0],a[o-1]=t(r)?r:e[o-1];for(var s=1;o-1>s;++s)a[s]=n.computeInnerQuadrangle(e[s-1],e[s],e[s+1],new n);return a}function s(e){var i=e.points,r=e.innerQuadrangles,o=e.times;if(i.length<3){var a=o[0],s=1/(o[1]-a),l=i[0],u=i[1];return function(e,i){t(i)||(i=new n);var r=(e-a)*s;return n.fastSlerp(l,u,r,i)}}return function(a,s){t(s)||(s=new n);var l=e._lastTimeIndex=e.findTimeInterval(a,e._lastTimeIndex),u=(a-o[l])/(o[l+1]-o[l]),c=i[l],h=i[l+1],d=r[l],p=r[l+1];return n.fastSquad(c,h,d,p,u,s)}}function l(t){t=e(t,e.EMPTY_OBJECT);var i=t.points,r=t.times,n=t.firstInnerQuadrangle,o=t.lastInnerQuadrangle,l=a(i,n,o);this._times=r,this._points=i,this._innerQuadrangles=l,this._evaluateFunction=s(this),this._lastTimeIndex=0}return i(l.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},innerQuadrangles:{get:function(){return this._innerQuadrangles}}}),l.prototype.findTimeInterval=o.prototype.findTimeInterval,l.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},l}),i("Core/RectangleGeometryLibrary",["./Cartesian3","./Cartographic","./defined","./DeveloperError","./GeographicProjection","./Math","./Matrix2","./Rectangle"],function(e,t,i,r,n,o,a,s){"use strict";var l=Math.cos,u=Math.sin,c=Math.sqrt,h={};h.computePosition=function(e,t,r,n,o){var s=e.ellipsoid.radiiSquared,h=e.nwCorner,d=e.rectangle,p=h.latitude-e.granYCos*t+r*e.granXSin,m=l(p),f=u(p),v=s.z*f,g=h.longitude+t*e.granYSin+r*e.granXCos,_=m*l(g),y=m*u(g),C=s.x*_,E=s.y*y,S=c(C*_+E*y+v*f);n.x=C/S,n.y=E/S,n.z=v/S,i(e.vertexFormat)&&e.vertexFormat.st&&(o.x=(g-d.west)*e.lonScalar-.5,o.y=(p-d.south)*e.latScalar-.5,a.multiplyByVector(e.textureMatrix,o,o),o.x+=.5,o.y+=.5)};var d=new a,p=new e,m=new t,f=new e,v=new n;return h.computeOptions=function(t,n,l){var u,c,h,g,_,y=t._granularity,C=t._ellipsoid,E=t._surfaceHeight,S=t._rotation,w=t._extrudedHeight,T=n.east,x=n.west,b=n.north,A=n.south,P=b-A;x>T?(_=o.TWO_PI-x+T,u=Math.ceil(_/y)+1,c=Math.ceil(P/y)+1,h=_/(u-1),g=P/(c-1)):(_=T-x,u=Math.ceil(_/y)+1,c=Math.ceil(P/y)+1,h=_/(u-1),g=P/(c-1)),l=s.northwest(n,l);var I=s.center(n,m),M=g,D=h,R=0,O=0;if(i(S)){var N=Math.cos(S);M*=N,D*=N;var L=Math.sin(S);R=g*L,O=h*L,p=v.project(l,p),f=v.project(I,f),p=e.subtract(p,f,p);var F=a.fromRotation(S,d);p=a.multiplyByVector(F,p,p),p=e.add(p,f,p),l=v.unproject(p,l);var B=l.latitude,V=B+(u-1)*O,k=B-M*(c-1),z=B-M*(c-1)+(u-1)*O;b=Math.max(B,V,k,z),A=Math.min(B,V,k,z);var U=l.longitude,G=U+(u-1)*D,W=U+(c-1)*R,H=U+(c-1)*R+(u-1)*D;if(T=Math.max(U,G,W,H),x=Math.min(U,G,W,H),b<-o.PI_OVER_TWO||b>o.PI_OVER_TWO||A<-o.PI_OVER_TWO||A>o.PI_OVER_TWO)throw new r("Rotated rectangle is invalid. It crosses over either the north or south pole.");n.north=b,n.south=A,n.east=T,n.west=x}return{granYCos:M,granYSin:R,granXCos:D,granXSin:O,ellipsoid:C,width:u,height:c,surfaceHeight:E,extrudedHeight:w,nwCorner:l,rectangle:n}},h}),i("Core/RectangleGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix2","./Matrix3","./PolygonPipeline","./PrimitiveType","./Quaternion","./Rectangle","./RectangleGeometryLibrary","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w){"use strict";function T(e,t){var i=new u({attributes:new h,primitiveType:y.TRIANGLES});return i.attributes.position=new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(i.attributes.normal=new c({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(i.attributes.tangent=new c({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.binormal&&(i.attributes.binormal=new c({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:t.binormals})),i}function x(e,t,r,n){for(var o=e.length,a=t.normal?new Float32Array(o):void 0,s=t.tangent?new Float32Array(o):void 0,l=t.binormal?new Float32Array(o):void 0,u=0,c=L,h=N,d=O,p=0;o>p;p+=3){var m=i.fromArray(e,p,R),f=u+1,v=u+2;(t.normal||t.tangent||t.binormal)&&(d=r.geodeticSurfaceNormal(m,d),(t.tangent||t.binormal)&&(i.cross(i.UNIT_Z,d,h),g.multiplyByVector(n,h,h),i.normalize(h,h),t.binormal&&i.normalize(i.cross(d,h,c),c)),t.normal&&(a[u]=d.x,a[f]=d.y,a[v]=d.z),t.tangent&&(s[u]=h.x,s[f]=h.y,s[v]=h.z),t.binormal&&(l[u]=c.x,l[f]=c.y,l[v]=c.z)),u+=3}return T(t,{positions:e,normals:a,tangents:s,binormals:l})}function b(e,t,r){for(var n=e.length,o=t.normal?new Float32Array(n):void 0,a=t.tangent?new Float32Array(n):void 0,s=t.binormal?new Float32Array(n):void 0,l=0,u=0,c=0,h=!0,d=L,p=N,m=O,v=0;n>v;v+=6){var g=i.fromArray(e,v,R);if(t.normal||t.tangent||t.binormal){var _=i.fromArray(e,(v+6)%n,z);if(h){var y=i.fromArray(e,(v+3)%n,U);i.subtract(_,g,_),i.subtract(y,g,y),m=i.normalize(i.cross(y,_,m),m),h=!1}i.equalsEpsilon(_,g,f.EPSILON10)&&(h=!0),(t.tangent||t.binormal)&&(d=r.geodeticSurfaceNormal(g,d),t.tangent&&(p=i.normalize(i.cross(d,m,p),p))),t.normal&&(o[l++]=m.x,o[l++]=m.y,o[l++]=m.z,o[l++]=m.x,o[l++]=m.y,o[l++]=m.z),t.tangent&&(a[u++]=p.x,a[u++]=p.y,a[u++]=p.z,a[u++]=p.x,a[u++]=p.y,a[u++]=p.z),t.binormal&&(s[c++]=d.x,s[c++]=d.y,s[c++]=d.z,s[c++]=d.x,s[c++]=d.y,s[c++]=d.z)}}return T(t,{positions:e,normals:o,tangents:a,binormals:s})}function A(e){for(var t=e.vertexFormat,i=e.ellipsoid,r=e.size,o=e.height,a=e.width,s=t.position?new Float64Array(3*r):void 0,l=t.st?new Float32Array(2*r):void 0,u=0,h=0,d=R,p=B,f=Number.MAX_VALUE,v=Number.MAX_VALUE,g=Number.MIN_VALUE,_=Number.MIN_VALUE,y=0;o>y;++y)for(var C=0;a>C;++C)S.computePosition(e,y,C,d,p),s[u++]=d.x,s[u++]=d.y,s[u++]=d.z,t.st&&(l[h++]=p.x,l[h++]=p.y,f=Math.min(f,p.x),v=Math.min(v,p.y),g=Math.max(g,p.x),_=Math.max(_,p.y));if(t.st&&(0>f||0>v||g>1||_>1))for(var E=0;EI;++I){for(var M=0;a-1>M;++M){var D=A,O=D+a,N=O+1,L=D+1;b[P++]=D,b[P++]=O,b[P++]=L,b[P++]=L,b[P++]=O,b[P++]=N,++A}++A}return w.indices=b,t.st&&(w.attributes.st=new c({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:l})),w}function P(e,t,i,r,n){return e[t++]=r[i],e[t++]=r[i+1],e[t++]=r[i+2],e[t++]=n[i],e[t++]=n[i+1],e[t++]=n[i+2],e}function I(e,t,i,r){return e[t++]=r[i],e[t++]=r[i+1],e[t++]=r[i],e[t++]=r[i+1],e}function M(e){var t,r=e.vertexFormat,o=e.surfaceHeight,a=e.extrudedHeight,s=Math.min(a,o),l=Math.max(a,o),u=e.height,h=e.width,v=e.ellipsoid,g=A(e);if(f.equalsEpsilon(s,l,f.EPSILON10))return g;g=_.scaleToGeodeticHeight(g,l,v,!1);var y=new Float64Array(g.attributes.position.values),C=y.length,E=2*C,S=new Float64Array(E);S.set(y),g=_.scaleToGeodeticHeight(g,s,v);var w=g.attributes.position.values;S.set(w,C),g.attributes.position.values=S;var T,x=r.normal?new Float32Array(E):void 0,M=r.tangent?new Float32Array(E):void 0,D=r.binormal?new Float32Array(E):void 0,R=r.st?new Float32Array(E/3*2):void 0;if(r.normal){var O=g.attributes.normal.values;for(x.set(O),t=0;C>t;t++)O[t]=-O[t];x.set(O,C),g.attributes.normal.values=x}if(r.tangent){var N=g.attributes.tangent.values;for(M.set(N),t=0;C>t;t++)N[t]=-N[t];M.set(N,C),g.attributes.tangent.values=M}if(r.binormal){var L=g.attributes.binormal.values;D.set(L),D.set(L,C),g.attributes.binormal.values=D}r.st&&(T=g.attributes.st.values,R.set(T),R.set(T,C/3*2),g.attributes.st.values=R);var F=g.indices,B=F.length,V=C/3,k=m.createTypedArray(E/3,2*B);for(k.set(F),t=0;B>t;t+=3)k[t+B]=F[t+2]+V,k[t+1+B]=F[t+1]+V,k[t+2+B]=F[t]+V;g.indices=k;var G=2*h+2*u-4,W=2*(G+4),H=new Float64Array(3*W),q=r.st?new Float32Array(2*W):void 0,j=0,Y=0,X=h*u;for(t=0;X>t;t+=h)H=P(H,j,3*t,y,w),j+=6,r.st&&(q=I(q,Y,2*t,T),Y+=4);for(t=X-h;X>t;t++)H=P(H,j,3*t,y,w),j+=6,r.st&&(q=I(q,Y,2*t,T),Y+=4);for(t=X-1;t>0;t-=h)H=P(H,j,3*t,y,w),j+=6,r.st&&(q=I(q,Y,2*t,T),Y+=4);for(t=h-1;t>=0;t--)H=P(H,j,3*t,y,w),j+=6,r.st&&(q=I(q,Y,2*t,T),Y+=4);var Z=b(H,r,v);r.st&&(Z.attributes.st=new c({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:q}));var K,Q,J,$,ee=m.createTypedArray(W,6*G);C=H.length/3;var te=0;for(t=0;C-1>t;t+=2){K=t,$=(K+2)%C;var ie=i.fromArray(H,3*K,z),re=i.fromArray(H,3*$,U);i.equalsEpsilon(ie,re,f.EPSILON10)||(Q=(K+1)%C,J=(Q+2)%C,ee[te++]=K,ee[te++]=Q,ee[te++]=$,ee[te++]=$,ee[te++]=Q,ee[te++]=J)}return Z.indices=ee,Z=p.combineInstances([new d({geometry:g}),new d({geometry:Z})]),Z[0]}function D(e){e=o(e,o.EMPTY_OBJECT);var t=e.rectangle,i=o(e.granularity,f.RADIANS_PER_DEGREE),r=o(e.ellipsoid,l.WGS84),n=o(e.height,0),s=o(e.rotation,0),u=o(e.stRotation,0),c=o(e.vertexFormat,w.DEFAULT),h=e.extrudedHeight,d=a(h),p=o(e.closeTop,!0),m=o(e.closeBottom,!0);this._rectangle=t,this._granularity=i,this._ellipsoid=l.clone(r),this._surfaceHeight=n,this._rotation=s,this._stRotation=u,this._vertexFormat=w.clone(c),this._extrudedHeight=o(h,0),this._extrude=d,this._closeTop=p,this._closeBottom=m,this._workerName="createRectangleGeometry"}var R=new i,O=new i,N=new i,L=new i,F=new E,B=new t,V=new e,k=new e,z=new i,U=new i;D.packedLength=E.packedLength+l.packedLength+w.packedLength+8,D.pack=function(e,t,i){i=o(i,0),E.pack(e._rectangle,t,i),i+=E.packedLength,l.pack(e._ellipsoid,t,i),i+=l.packedLength,w.pack(e._vertexFormat,t,i),i+=w.packedLength,t[i++]=e._granularity,t[i++]=e._surfaceHeight,t[i++]=e._rotation,t[i++]=e._stRotation,t[i++]=e._extrudedHeight,t[i++]=e._extrude?1:0,t[i++]=e._closeTop?1:0,t[i]=e._closeBottom?1:0};var G=new E,W=l.clone(l.UNIT_SPHERE),H=new w,q={rectangle:G,ellipsoid:W,vertexFormat:H,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,closeTop:void 0,closeBottom:void 0};D.unpack=function(e,t,i){t=o(t,0);var r=E.unpack(e,t,G);t+=E.packedLength;var n=l.unpack(e,t,W);t+=l.packedLength;var s=w.unpack(e,t,H);t+=w.packedLength;var u=e[t++],c=e[t++],h=e[t++],d=e[t++],p=e[t++],m=1===e[t++],f=1===e[t++],v=1===e[t];return a(i)?(i._rectangle=E.clone(r,i._rectangle),i._ellipsoid=l.clone(n,i._ellipsoid),i._vertexFormat=w.clone(s,i._vertexFormat),i._granularity=u,i._surfaceHeight=c,i._rotation=h,i._stRotation=d,i._extrudedHeight=m?p:void 0,i._extrude=m,i._closeTop=f,i._closeBottom=v,i):(q.granularity=u,q.height=c,q.rotation=h,q.stRotation=d,q.extrudedHeight=m?p:void 0,q.closeTop=f,q.closeBottom=v,new D(q))};var j=new v,Y=new g,X=new r,Z=new C,K=new r;return D.createGeometry=function(t){var r=E.clone(t._rectangle,F),n=t._ellipsoid,o=t._surfaceHeight,s=t._extrude,l=t._extrudedHeight,c=t._stRotation,d=t._vertexFormat,p=S.computeOptions(t,r,X),m=j,f=Y;if(a(c)){v.fromRotation(-c,m);var y=E.center(r,K),w=n.cartographicToCartesian(y,z);i.normalize(w,w),C.fromAxisAngle(w,-c,Z),g.fromQuaternion(Z,f)}else v.clone(v.IDENTITY,m),g.clone(g.IDENTITY,f);p.lonScalar=1/r.width,p.latScalar=1/r.height,p.vertexFormat=d,p.textureMatrix=m,p.tangentRotationMatrix=f,p.size=p.width*p.height;var T,x;if(r=t._rectangle,s){T=M(p);var b=e.fromRectangle3D(r,n,o,k),P=e.fromRectangle3D(r,n,l,V);x=e.union(b,P)}else T=A(p),T=_.scaleToGeodeticHeight(T,o,n,!1),x=e.fromRectangle3D(r,n,o);return d.position||delete T.attributes.position,new u({attributes:new h(T.attributes),indices:T.indices,primitiveType:T.primitiveType,boundingSphere:x})},D.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new D({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:n,stRotation:e._stRotation,granularity:r,extrudedHeight:a,height:o,closeTop:!0,closeBottom:!0,vertexFormat:w.POSITION_ONLY})},D}),i("Core/RectangleOutlineGeometry",["./BoundingSphere","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Rectangle","./RectangleGeometryLibrary"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v){"use strict";function g(e){var t,i=e.size,n=e.height,o=e.width,a=new Float64Array(3*i),s=0,d=0,p=S;for(t=0;o>t;t++)v.computePosition(e,d,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(t=o-1,d=1;n>d;d++)v.computePosition(e,d,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(d=n-1,t=o-2;t>=0;t--)v.computePosition(e,d,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(t=0,d=n-2;d>0;d--)v.computePosition(e,d,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(var f=a.length/3*2,g=h.createTypedArray(a.length/3,f),_=0,y=0;yC;C++)_[y++]=C,_[y++]=C+1,_[y++]=C+c,_[y++]=C+c+1;return _[y++]=c-1,_[y++]=0,_[y++]=c+c-1,_[y++]=c,_[y++]=0,_[y++]=c,_[y++]=l-1,_[y++]=c+l-1,_[y++]=l+s-2,_[y++]=l+s-2+c,_[y++]=2*l+s-3,_[y++]=2*l+s-3+c,a.indices=_,a}function y(e){e=n(e,n.EMPTY_OBJECT);var t=e.rectangle,i=n(e.granularity,d.RADIANS_PER_DEGREE),r=n(e.ellipsoid,s.WGS84),o=n(e.height,0),a=n(e.rotation,0),l=e.extrudedHeight;this._rectangle=t,this._granularity=i,this._ellipsoid=r,this._surfaceHeight=o,this._rotation=a,this._extrudedHeight=l,this._workerName="createRectangleOutlineGeometry"}var C=new e,E=new e,S=new t,w=new f;y.packedLength=f.packedLength+s.packedLength+5,y.pack=function(e,t,i){i=n(i,0),f.pack(e._rectangle,t,i),i+=f.packedLength,s.pack(e._ellipsoid,t,i),i+=s.packedLength,t[i++]=e._granularity,t[i++]=e._surfaceHeight,t[i++]=e._rotation,t[i++]=o(e._extrudedHeight)?1:0,t[i]=n(e._extrudedHeight,0)};var T=new f,x=s.clone(s.UNIT_SPHERE),b={rectangle:T,ellipsoid:x,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0};y.unpack=function(e,t,i){t=n(t,0);var r=f.unpack(e,t,T);t+=f.packedLength;var a=s.unpack(e,t,x);t+=s.packedLength;var l=e[t++],u=e[t++],c=e[t++],h=e[t++],d=e[t];return o(i)?(i._rectangle=f.clone(r,i._rectangle),i._ellipsoid=s.clone(a,i._ellipsoid),i._surfaceHeight=u,i._rotation=c,i._extrudedHeight=h?d:void 0,i):(b.granularity=l,b.height=u,b.rotation=c,b.extrudedHeight=h?d:void 0,new y(b))};var A=new i;return y.createGeometry=function(t){var i=f.clone(t._rectangle,w),r=t._ellipsoid,n=t._surfaceHeight,a=t._extrudedHeight,s=v.computeOptions(t,i,A);s.size=2*s.width+2*s.height-4;var u,c;if(i=t._rectangle,o(a)){u=_(s);var h=e.fromRectangle3D(i,r,n,E),d=e.fromRectangle3D(i,r,a,C);c=e.union(h,d)}else u=g(s),u=p.scaleToGeodeticHeight(u,n,r,!1),c=e.fromRectangle3D(i,r,n);return new l({attributes:u.attributes,indices:u.indices,primitiveType:m.LINES,boundingSphere:c})},y}),i("Core/ReferenceFrame",["./freezeObject"],function(e){"use strict";var t={FIXED:0,INERTIAL:1};return e(t)}),i("Core/requestAnimationFrame",["./defined","./getTimestamp"],function(e,t){"use strict";function i(e){return r(e)}if("undefined"!=typeof window){var r=window.requestAnimationFrame;return function(){if(!e(r))for(var i=["webkit","moz","ms","o"],n=0,o=i.length;o>n&&!e(r);)r=window[i[n]+"RequestAnimationFrame"],++n;if(!e(r)){var a=1e3/60,s=0;r=function(e){var i=t(),r=Math.max(a-(i-s),0);return s=i+r,setTimeout(function(){e(s)},r)}}}(),i}}),i("Core/sampleTerrain",["../ThirdParty/when","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t,i,r){function o(){t.ready?e(n(t,i,r),function(e){a.resolve(e)}):setTimeout(o,10)}var a=e.defer();return o(),a.promise}function n(t,i,r){var n,s=t.tilingScheme,l=[],u={};for(n=0;n0?-120*t.detail:t.wheelDelta;if(r(i)){var o=h(t),a=e.getInputAction(l.WHEEL,o);r(a)&&(a(i),t.preventDefault())}}function C(e,i){e._seenAnyTouchEvents=!0;var r,n,o,a=i.changedTouches,s=a.length,l=e._positions;for(r=0;s>r;++r)n=a[r],o=n.identifier,l.set(o,u(e,n,new t));S(e,i);var c=e._previousPositions;for(r=0;s>r;++r)n=a[r],o=n.identifier,c.set(o,t.clone(l.get(o)))}function E(e,t){e._seenAnyTouchEvents=!0;var i,r,n,o=t.changedTouches,a=o.length,s=e._positions;for(i=0;a>i;++i)r=o[i],n=r.identifier,s.remove(n);S(e,t);var l=e._previousPositions;for(i=0;a>i;++i)r=o[i],n=r.identifier,l.remove(n)}function S(e,i){var n,o,a=h(i),s=e._positions,u=e._previousPositions,c=s.length;if(1!==c&&e._buttonDown===I.LEFT&&(e._buttonDown=void 0,n=e.getInputAction(l.LEFT_UP,a),r(n)&&(t.clone(e._primaryPosition,B.position),n(B)),0===c&&(o=e.getInputAction(l.LEFT_CLICK,a),r(o)))){var d=e._primaryStartPosition,p=u.values[0],m=d.x-p.x,f=d.y-p.y,v=Math.sqrt(m*m+f*f);vn;++n){o=s[n],a=o.identifier;var h=c.get(a);r(h)&&u(e,o,h)}T(e,i);var d=e._previousPositions;for(n=0;l>n;++n)o=s[n],a=o.identifier,t.clone(c.get(a),d.get(a))}function T(e,i){var n,o=h(i),a=e._positions,s=e._previousPositions,u=a.length;if(1===u&&e._buttonDown===I.LEFT){var c=a.values[0];t.clone(c,e._primaryPosition);var d=e._primaryPreviousPosition;n=e.getInputAction(l.MOUSE_MOVE,o),r(n)&&(t.clone(d,k.startPosition),t.clone(c,k.endPosition),n(k)),t.clone(c,d),i.preventDefault()}else if(2===u&&e._isPinching&&(n=e.getInputAction(l.PINCH_MOVE,o),r(n))){var p=a.values[0],m=a.values[1],f=s.values[0],v=s.values[1],g=m.x-p.x,_=m.y-p.y,y=.25*Math.sqrt(g*g+_*_),C=v.x-f.x,E=v.y-f.y,S=.25*Math.sqrt(C*C+E*E),w=.125*(m.y+p.y),T=.125*(v.y+f.y),x=Math.atan2(_,g),b=Math.atan2(E,C);t.fromElements(0,S,z.distance.startPosition),t.fromElements(0,y,z.distance.endPosition),t.fromElements(b,T,z.angleAndHeight.startPosition),t.fromElements(x,w,z.angleAndHeight.endPosition),n(z)}}function x(e,i){if(i.target.setPointerCapture(i.pointerId),"touch"===i.pointerType){var r=e._positions,n=i.pointerId;r.set(n,u(e,i,new t)),S(e,i);var o=e._previousPositions;o.set(n,t.clone(r.get(n)))}else f(e,i)}function b(e,t){if("touch"===t.pointerType){var i=e._positions,r=t.pointerId;i.remove(r),S(e,t);var n=e._previousPositions;n.remove(r)}else v(e,t)}function A(e,i){if("touch"===i.pointerType){var r=e._positions,n=i.pointerId;u(e,i,r.get(n)),T(e,i);var o=e._previousPositions;t.clone(r.get(n),o.get(n))}else g(e,i)}function P(r){this._inputEvents={},this._buttonDown=void 0,this._isPinching=!1,this._seenAnyTouchEvents=!1,this._primaryStartPosition=new t,this._primaryPosition=new t,this._primaryPreviousPosition=new t,this._positions=new e,this._previousPositions=new e,this._removalFunctions=[],this._clickPixelTolerance=5,this._element=i(r,document),p(this)}var I={LEFT:0,MIDDLE:1,RIGHT:2},M={position:new t},D={position:new t},R={position:new t},O={startPosition:new t,endPosition:new t},N={position:new t},L={position:new t},F={position1:new t,position2:new t},B={position:new t},V={position:new t},k={startPosition:new t,endPosition:new t},z={distance:{startPosition:new t,endPosition:new t},angleAndHeight:{startPosition:new t,endPosition:new t}};return P.prototype.setInputAction=function(e,t,i){var r=c(t,i);this._inputEvents[r]=e},P.prototype.getInputAction=function(e,t){var i=c(e,t);return this._inputEvents[i]},P.prototype.removeInputAction=function(e,t){var i=c(e,t);delete this._inputEvents[i]},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){return m(this),n(this)},P}),i("Core/ShowGeometryInstanceAttribute",["./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,i,r,n){"use strict";function o(e){e=t(e,!0),this.value=o.toValue(e)}return r(o.prototype,{componentDatatype:{get:function(){return e.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}}),o.toValue=function(e,t){return i(t)?(t[0]=e,t):new Uint8Array([e])},o}),i("Core/Simon1994PlanetaryPositions",["./Cartesian3","./defined","./DeveloperError","./JulianDate","./Math","./Matrix3","./TimeConstants","./TimeStandard"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){var t=6.239996+.0172019696544*e;return.001657*Math.sin(t+.01671*Math.sin(t))}function u(e,t){t=r.addSeconds(e,C,t);var i=r.totalDays(t)-E;return t=r.addSeconds(t,l(i),t)}function c(r,a,s,l,u,c,p,m){if(0>s&&(s=-s,u+=n.PI),0>s||s>n.PI)throw new i("The inclination is out of range. Inclination must be greater than or equal to zero and less than or equal to Pi radians.");var v=r*(1-a),g=l-u,_=u,y=d(c-l,a),C=h(a,0);if("Hyperbolic"===C&&Math.abs(n.negativePiToPi(y))>=Math.acos(-1/a))throw new i("The true anomaly of the hyperbolic orbit lies outside of the bounds of the hyperbola.");f(g,s,_,I);var E=v*(1+a),S=Math.cos(y),w=Math.sin(y),T=1+a*S;if(T<=n.Epsilon10)throw new i("elements cannot be converted to cartesian");var x=E/T;return t(m)?(m.x=x*S,m.y=x*w,m.z=0):m=new e(x*S,x*w,0),o.multiplyByVector(I,m,m)}function h(e,t){if(0>e)throw new i("eccentricity cannot be negative.");return t>=e?"Circular":1-t>e?"Elliptical":1+t>=e?"Parabolic":"Hyperbolic"}function d(e,t){if(0>t||t>=1)throw new i("eccentricity out of range.");var r=p(e,t);return m(r,t)}function p(e,t){if(0>t||t>=1)throw new i("eccentricity out of range.");var r=Math.floor(e/n.TWO_PI);e-=r*n.TWO_PI;var o,a=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),s=Number.MAX_VALUE;for(o=0;M>o&&Math.abs(s-a)>D;++o){s=a;var l=s-t*Math.sin(s)-e,u=1-t*Math.cos(s);a=s-l/u}if(o>=M)throw new i("Kepler equation did not converge");return s=a+r*n.TWO_PI}function m(e,t){if(0>t||t>=1)throw new i("eccentricity out of range.");var r=Math.floor(e/n.TWO_PI);e-=r*n.TWO_PI;var o=Math.cos(e)-t,a=Math.sin(e)*Math.sqrt(1-t*t),s=Math.atan2(a,o);return s=n.zeroToTwoPi(s),0>e&&(s-=n.TWO_PI),s+=r*n.TWO_PI}function f(e,r,a,s){if(0>r||r>n.PI)throw new i("inclination out of range");var l=Math.cos(e),u=Math.sin(e),c=Math.cos(r),h=Math.sin(r),d=Math.cos(a),p=Math.sin(a);return t(s)?(s[0]=d*l-p*u*c,s[1]=p*l+d*u*c,s[2]=u*h,s[3]=-d*u-p*l*c,s[4]=-p*u+d*l*c,s[5]=l*h,s[6]=p*h,s[7]=-d*h,s[8]=c):s=new o(d*l-p*u*c,-d*u-p*l*c,p*h,p*l+d*u*c,-p*u+d*l*c,-d*h,u*h,l*h,c),s}function v(e,t){u(e,Ie);var i=Ie.dayNumber-S.dayNumber+(Ie.secondsOfDay-S.secondsOfDay)/a.SECONDS_PER_DAY,r=i/(10*a.DAYS_PER_JULIAN_CENTURY),n=.3595362*r,o=R+W*Math.cos(L*n)+Q*Math.sin(L*n)+H*Math.cos(F*n)+J*Math.sin(F*n)+q*Math.cos(B*n)+$*Math.sin(B*n)+j*Math.cos(V*n)+ee*Math.sin(V*n)+Y*Math.cos(k*n)+te*Math.sin(k*n)+X*Math.cos(z*n)+ie*Math.sin(z*n)+Z*Math.cos(U*n)+re*Math.sin(U*n)+K*Math.cos(G*n)+ne*Math.sin(G*n),s=O+N*r+pe*Math.cos(oe*n)+Ee*Math.sin(oe*n)+me*Math.cos(ae*n)+Se*Math.sin(ae*n)+fe*Math.cos(se*n)+we*Math.sin(se*n)+ve*Math.cos(le*n)+Te*Math.sin(le*n)+ge*Math.cos(ue*n)+xe*Math.sin(ue*n)+_e*Math.cos(ce*n)+be*Math.sin(ce*n)+ye*Math.cos(he*n)+Ae*Math.sin(he*n)+Ce*Math.cos(de*n)+Pe*Math.sin(de*n),l=.0167086342-.0004203654*r,h=102.93734808*b+11612.3529*A*r,d=469.97289*A*r,p=174.87317577*b-8679.27034*A*r;return c(o,l,d,h,p,s,T,t)}function g(e,t){u(e,Ie);var i=Ie.dayNumber-S.dayNumber+(Ie.secondsOfDay-S.secondsOfDay)/a.SECONDS_PER_DAY,r=i/a.DAYS_PER_JULIAN_CENTURY,n=r*r,o=n*r,s=o*r,l=383397.7725+.004*r,h=.055545526-1.6e-8*r,d=5.15668983*b,p=-8e-5*r+.02966*n-42e-6*o-1.3e-7*s,m=83.35324312*b,f=14643420.2669*r-38.2702*n-.045047*o+21301e-8*s,v=125.04455501*b,g=-6967919.3631*r+6.3602*n+.007625*o-3586e-8*s,_=218.31664563*b,y=1732559343.4847*r-6.391*n+.006588*o-3169e-8*s,C=297.85019547*b+A*(1602961601.209*r-6.3706*n+.006593*o-3169e-8*s),E=93.27209062*b+A*(1739527262.8478*r-12.7512*n-.001037*o+417e-8*s),T=134.96340251*b+A*(1717915923.2178*r+31.8792*n+.051635*o-2447e-7*s),P=357.52910918*b+A*(129596581.0481*r-.5532*n+136e-6*o-1149e-8*s),I=310.17137918*b-A*(6967051.436*r+6.2068*n+.007618*o-3219e-8*s),M=2*C,D=4*C,R=6*C,O=2*T,N=3*T,L=4*T,F=2*E; -l+=3400.4*Math.cos(M)-635.6*Math.cos(M-T)-235.6*Math.cos(T)+218.1*Math.cos(M-P)+181*Math.cos(M+T),h+=.014216*Math.cos(M-T)+.008551*Math.cos(M-O)-.001383*Math.cos(T)+.001356*Math.cos(M+T)-.001147*Math.cos(D-N)-914e-6*Math.cos(D-O)+869e-6*Math.cos(M-P-T)-627e-6*Math.cos(M)-394e-6*Math.cos(D-L)+282e-6*Math.cos(M-P-O)-279e-6*Math.cos(C-T)-236e-6*Math.cos(O)+231e-6*Math.cos(D)+229e-6*Math.cos(R-L)-201e-6*Math.cos(O-F),p+=486.26*Math.cos(M-F)-40.13*Math.cos(M)+37.51*Math.cos(F)+25.73*Math.cos(O-F)+19.97*Math.cos(M-P-F),f+=-55609*Math.sin(M-T)-34711*Math.sin(M-O)-9792*Math.sin(T)+9385*Math.sin(D-N)+7505*Math.sin(D-O)+5318*Math.sin(M+T)+3484*Math.sin(D-L)-3417*Math.sin(M-P-T)-2530*Math.sin(R-L)-2376*Math.sin(M)-2075*Math.sin(M-N)-1883*Math.sin(O)-1736*Math.sin(R-5*T)+1626*Math.sin(P)-1370*Math.sin(R-N),g+=-5392*Math.sin(M-F)-540*Math.sin(P)-441*Math.sin(M)+423*Math.sin(F)-288*Math.sin(O-F),y+=-3332.9*Math.sin(M)+1197.4*Math.sin(M-T)-662.5*Math.sin(P)+396.3*Math.sin(T)-218*Math.sin(M-P);var B=2*I,V=3*I;p+=46.997*Math.cos(I)*r-.614*Math.cos(M-F+I)*r+.614*Math.cos(M-F-I)*r-.0297*Math.cos(B)*n-.0335*Math.cos(I)*n+.0012*Math.cos(M-F+B)*n-16e-5*Math.cos(I)*o+4e-5*Math.cos(V)*o+4e-5*Math.cos(B)*o;var k=2.116*Math.sin(I)*r-.111*Math.sin(M-F-I)*r-.0015*Math.sin(I)*n;f+=k,y+=k,g+=-520.77*Math.sin(I)*r+13.66*Math.sin(M-F+I)*r+1.12*Math.sin(M-I)*r-1.06*Math.sin(F-I)*r+.66*Math.sin(B)*n+.371*Math.sin(I)*n-.035*Math.sin(M-F+B)*n-.015*Math.sin(M-F+I)*n+.0014*Math.sin(I)*o-.0011*Math.sin(V)*o-9e-4*Math.sin(B)*o,l*=x;var z=d+p*A,U=m+f*A,G=_+y*A,W=v+g*A;return c(l,h,z,U,W,G,w,t)}function _(t,i){return i=g(t,i),e.multiplyByScalar(i,De,i)}var y={},C=32.184,E=2451545,S=new r(2451545,0,s.TAI),w=398600435e6,T=1.012300034*w*328900.56,x=1e3,b=n.RADIANS_PER_DEGREE,A=n.RADIANS_PER_ARCSECOND,P=14959787e4,I=new o,M=50,D=n.EPSILON8,R=1.0000010178*P,O=100.46645683*b,N=1295977422.83429*A,L=16002,F=21863,B=32004,V=10931,k=14529,z=16368,U=15318,G=32794,W=64e-7*P,H=-152*1e-7*P,q=62e-7*P,j=-8e-7*P,Y=32e-7*P,X=-41*1e-7*P,Z=19e-7*P,K=-11*1e-7*P,Q=-150*1e-7*P,J=-46*1e-7*P,$=68*1e-7*P,ee=54e-7*P,te=14e-7*P,ie=24e-7*P,re=-28*1e-7*P,ne=22e-7*P,oe=10,ae=16002,se=21863,le=10931,ue=1473,ce=32004,he=4387,de=73,pe=-325*1e-7,me=-322*1e-7,fe=-79*1e-7,ve=232*1e-7,ge=-52*1e-7,_e=97e-7,ye=55e-7,Ce=-41*1e-7,Ee=-105*1e-7,Se=-137*1e-7,we=258e-7,Te=35e-7,xe=-116*1e-7,be=-88*1e-7,Ae=-112*1e-7,Pe=-80*1e-7,Ie=new r(0,0,s.TAI),Me=.012300034,De=Me/(Me+1)*-1,Re=new o(1.0000000000000002,5.619723173785822e-16,4.690511510146299e-19,-5.154129427414611e-16,.9174820620691819,-.39777715593191376,-2.23970096136568e-16,.39777715593191376,.9174820620691819),Oe=new e;return y.computeSunPositionInEarthInertialFrame=function(i,n){return t(i)||(i=r.now()),t(n)||(n=new e),Oe=v(i,Oe),n=e.negate(Oe,n),_(i,Oe),e.subtract(n,Oe,n),o.multiplyByVector(Re,n,n),n},y.computeMoonPositionInEarthInertialFrame=function(e,i){return t(e)||(e=r.now()),i=g(e,i),o.multiplyByVector(Re,i,i),i},y}),i("Core/SimplePolylineGeometry",["./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e,t,r,n,o,a,s){var l,u=p.numberOfPoints(e,t,o),c=r.red,h=r.green,d=r.blue,m=r.alpha,f=n.red,v=n.green,g=n.blue,_=n.alpha;if(i.equals(r,n)){for(l=0;u>l;l++)a[s++]=i.floatToByte(c),a[s++]=i.floatToByte(h),a[s++]=i.floatToByte(d),a[s++]=i.floatToByte(m);return s}var y=(f-c)/u,C=(v-h)/u,E=(g-d)/u,S=(_-m)/u,w=s;for(l=0;u>l;l++)a[w++]=i.floatToByte(c+l*y),a[w++]=i.floatToByte(h+l*C),a[w++]=i.floatToByte(d+l*E),a[w++]=i.floatToByte(m+l*S);return w}function v(e){e=n(e,n.EMPTY_OBJECT);var r=e.positions,a=e.colors,l=n(e.colorsPerVertex,!1);this._positions=r,this._colors=a,this._colorsPerVertex=l,this._followSurface=n(e.followSurface,!0),this._granularity=n(e.granularity,d.RADIANS_PER_DEGREE),this._ellipsoid=n(e.ellipsoid,s.WGS84),this._workerName="createSimplePolylineGeometry";var u=1+r.length*t.packedLength;u+=o(a)?1+a.length*i.packedLength:1,this.packedLength=u+s.packedLength+3}v.pack=function(e,r,a){a=n(a,0);var l,u=e._positions,c=u.length;for(r[a++]=c,l=0;c>l;++l,a+=t.packedLength)t.pack(u[l],r,a);var h=e._colors;for(c=o(h)?h.length:0,r[a++]=c,l=0;c>l;++l,a+=i.packedLength)i.pack(h[l],r,a);s.pack(e._ellipsoid,r,a),a+=s.packedLength,r[a++]=e._colorsPerVertex?1:0,r[a++]=e._followSurface?1:0,r[a]=e._granularity},v.unpack=function(e,r,a){r=n(r,0);var l,u=e[r++],c=new Array(u);for(l=0;u>l;++l,r+=t.packedLength)c[l]=t.unpack(e,r);u=e[r++];var h=u>0?new Array(u):void 0;for(l=0;u>l;++l,r+=i.packedLength)h[l]=i.unpack(e,r);var d=s.unpack(e,r);r+=s.packedLength;var p=1===e[r++],m=1===e[r++],f=e[r];return o(a)?(a._positions=c,a._colors=h,a._ellipsoid=d,a._colorsPerVertex=p,a._followSurface=m,a._granularity=f,a):new v({positions:c,colors:h,ellipsoid:d,colorsPerVertex:p,followSurface:m,granularity:f})};var g=new Array(2),_=new Array(2),y={positions:g,height:_,ellipsoid:void 0,minDistance:void 0};return v.createGeometry=function(n){var a,s,v,C,E,S=n._positions,w=n._colors,T=n._colorsPerVertex,x=n._followSurface,b=n._granularity,A=n._ellipsoid,P=d.chordLength(b,A.maximumRadius),I=o(w)&&!T,M=S.length,D=0;if(x){var R=p.extractHeights(S,A),O=y;if(O.minDistance=P,O.ellipsoid=A,I){var N=0;for(a=0;M-1>a;a++)N+=p.numberOfPoints(S[a],S[a+1],P)+1;s=new Float64Array(3*N),C=new Uint8Array(4*N),O.positions=g,O.height=_;var L=0;for(a=0;M-1>a;++a){g[0]=S[a],g[1]=S[a+1],_[0]=R[a],_[1]=R[a+1];var F=p.generateArc(O);if(o(w)){var B=F.length/3;E=w[a];for(var V=0;B>V;++V)C[L++]=i.floatToByte(E.red),C[L++]=i.floatToByte(E.green),C[L++]=i.floatToByte(E.blue),C[L++]=i.floatToByte(E.alpha)}s.set(F,D),D+=F.length}}else if(O.positions=S,O.height=R,s=new Float64Array(p.generateArc(O)),o(w)){for(C=new Uint8Array(s.length/3*4),a=0;M-1>a;++a){var k=S[a],z=S[a+1],U=w[a],G=w[a+1];D=f(k,z,U,G,P,C,D)}var W=w[M-1];C[D++]=i.floatToByte(W.red),C[D++]=i.floatToByte(W.green),C[D++]=i.floatToByte(W.blue),C[D++]=i.floatToByte(W.alpha)}}else{v=I?2*M-2:M,s=new Float64Array(3*v),C=o(w)?new Uint8Array(4*v):void 0;var H=0,q=0;for(a=0;M>a;++a){var j=S[a];if(I&&a>0&&(t.pack(j,s,H),H+=3,E=w[a-1],C[q++]=i.floatToByte(E.red),C[q++]=i.floatToByte(E.green),C[q++]=i.floatToByte(E.blue),C[q++]=i.floatToByte(E.alpha)),I&&a===M-1)break;t.pack(j,s,H),H+=3,o(w)&&(E=w[a],C[q++]=i.floatToByte(E.red),C[q++]=i.floatToByte(E.green),C[q++]=i.floatToByte(E.blue),C[q++]=i.floatToByte(E.alpha))}}var Y=new c;Y.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:s}),o(w)&&(Y.color=new u({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:4,values:C,normalize:!0})),v=s.length/3;var X=2*(v-1),Z=h.createTypedArray(v,X),K=0;for(a=0;v-1>a;++a)Z[K++]=a,Z[K++]=a+1;return new l({attributes:Y,indices:Z,primitiveType:m.LINES,boundingSphere:e.fromPoints(S)})},v}),i("Core/SphereGeometry",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./EllipsoidGeometry","./VertexFormat"],function(e,t,i,r,n,o){"use strict";function a(i){var r=t(i.radius,1),o=new e(r,r,r),a={radii:o,stackPartitions:i.stackPartitions,slicePartitions:i.slicePartitions,vertexFormat:i.vertexFormat};this._ellipsoidGeometry=new n(a),this._workerName="createSphereGeometry"}a.packedLength=n.packedLength,a.pack=function(e,t,i){n.pack(e._ellipsoidGeometry,t,i)};var s=new n,l={radius:void 0,radii:new e,vertexFormat:new o,stackPartitions:void 0,slicePartitions:void 0};return a.unpack=function(t,r,u){var c=n.unpack(t,r,s);return l.vertexFormat=o.clone(c._vertexFormat,l.vertexFormat),l.stackPartitions=c._stackPartitions,l.slicePartitions=c._slicePartitions,i(u)?(e.clone(c._radii,l.radii),u._ellipsoidGeometry=new n(l),u):(l.radius=c._radii.x,new a(l))},a.createGeometry=function(e){return n.createGeometry(e._ellipsoidGeometry)},a}),i("Core/SphereOutlineGeometry",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./EllipsoidOutlineGeometry"],function(e,t,i,r,n){"use strict";function o(i){var r=t(i.radius,1),o=new e(r,r,r),a={radii:o,stackPartitions:i.stackPartitions,slicePartitions:i.slicePartitions,subdivisions:i.subdivisions};this._ellipsoidGeometry=new n(a),this._workerName="createSphereOutlineGeometry"}o.packedLength=n.packedLength,o.pack=function(e,t,i){n.pack(e._ellipsoidGeometry,t,i)};var a=new n,s={radius:void 0,radii:new e,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return o.unpack=function(t,r,l){var u=n.unpack(t,r,a);return s.stackPartitions=u._stackPartitions,s.slicePartitions=u._slicePartitions,s.subdivisions=u._subdivisions,i(l)?(e.clone(u._radii,s.radii),l._ellipsoidGeometry=new n(s),l):(s.radius=u._radii.x,new o(s))},o.createGeometry=function(e){return n.createGeometry(e._ellipsoidGeometry)},o}),i("Core/Spherical",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t,i,r){this.clock=e(t,0),this.cone=e(i,0),this.magnitude=e(r,1)}return r.fromCartesian3=function(e,i){var n=e.x,o=e.y,a=e.z,s=n*n+o*o;return t(i)||(i=new r),i.clock=Math.atan2(o,n),i.cone=Math.atan2(Math.sqrt(s),a),i.magnitude=Math.sqrt(s+a*a),i},r.clone=function(e,i){return t(e)?t(i)?(i.clock=e.clock,i.cone=e.cone,i.magnitude=e.magnitude,i):new r(e.clock,e.cone,e.magnitude):void 0},r.normalize=function(e,i){return t(i)?(i.clock=e.clock,i.cone=e.cone,i.magnitude=1,i):new r(e.clock,e.cone,1)},r.equals=function(e,i){return e===i||t(e)&&t(i)&&e.clock===i.clock&&e.cone===i.cone&&e.magnitude===i.magnitude},r.equalsEpsilon=function(i,r,n){return n=e(n,0),i===r||t(i)&&t(r)&&Math.abs(i.clock-r.clock)<=n&&Math.abs(i.cone-r.cone)<=n&&Math.abs(i.magnitude-r.magnitude)<=n},r.prototype.equals=function(e){return r.equals(this,e)},r.prototype.clone=function(e){return r.clone(this,e)},r.prototype.equalsEpsilon=function(e,t){return r.equalsEpsilon(this,e,t)},r.prototype.toString=function(){return"("+this.clock+", "+this.cone+", "+this.magnitude+")"},r}),i("Core/subdivideArray",["./defined","./DeveloperError"],function(e,t){"use strict";function i(e,t){for(var i=[],r=e.length,n=0;r>n;){var o=Math.ceil((r-n)/t--);i.push(e.slice(n,n+o)),n+=o}return i}return i}),i("Core/TerrainData",["./defineProperties","./DeveloperError"],function(e,t){"use strict";function i(){t.throwInstantiationError()}return e(i.prototype,{waterMask:{get:t.throwInstantiationError}}),i.prototype.interpolateHeight=t.throwInstantiationError,i.prototype.isChildAvailable=t.throwInstantiationError,i.prototype.createMesh=t.throwInstantiationError,i.prototype.upsample=t.throwInstantiationError,i.prototype.wasCreatedByUpsampling=t.throwInstantiationError,i}),i("Core/TilingScheme",["./defineProperties","./DeveloperError"],function(e,t){"use strict";function i(e){throw new t("This type should not be instantiated directly. Instead, use WebMercatorTilingScheme or GeographicTilingScheme.")}return e(i.prototype,{ellipsoid:{get:t.throwInstantiationError},rectangle:{get:t.throwInstantiationError},projection:{get:t.throwInstantiationError}}),i.prototype.getNumberOfXTilesAtLevel=t.throwInstantiationError,i.prototype.getNumberOfYTilesAtLevel=t.throwInstantiationError,i.prototype.rectangleToNativeRectangle=t.throwInstantiationError,i.prototype.tileXYToNativeRectangle=t.throwInstantiationError,i.prototype.tileXYToRectangle=t.throwInstantiationError,i.prototype.positionToTileXY=t.throwInstantiationError,i}),i("Core/TimeIntervalCollection",["./binarySearch","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./JulianDate","./TimeInterval"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t){return a.compare(e.start,t.start)}function u(e){if(this._intervals=[],this._changedEvent=new o,i(e))for(var t=e.length,r=0;t>r;r++)this.addInterval(e[r])}r(u.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){var e=this._intervals;return 0===e.length?void 0:e[0].start}},isStartIncluded:{get:function(){var e=this._intervals;return 0===e.length?!1:e[0].isStartIncluded}},stop:{get:function(){var e=this._intervals,t=e.length;return 0===t?void 0:e[t-1].stop}},isStopIncluded:{get:function(){var e=this._intervals,t=e.length;return 0===t?!1:e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return 0===this._intervals.length}}}),u.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof u))return!1;var i=this._intervals,r=e._intervals,n=i.length;if(n!==r.length)return!1;for(var o=0;n>o;o++)if(!s.equals(i[o],r[o],t))return!1;return!0},u.prototype.get=function(e){return this._intervals[e]},u.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))},u.prototype.findIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t]:void 0},u.prototype.findDataForIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0},u.prototype.contains=function(e){return this.indexOf(e)>=0};var c=new s;return u.prototype.indexOf=function(t){var i=this._intervals;c.start=t,c.stop=t;var r=e(i,c,l);return r>=0?i[r].isStartIncluded?r:r>0&&i[r-1].stop.equals(t)&&i[r-1].isStopIncluded?r-1:~r:(r=~r,r>0&&r-1l;l++){var c=s[l];if((!i(r)||c.start.equals(r))&&(!i(n)||c.stop.equals(n))&&(!i(o)||c.isStartIncluded===o)&&(!i(a)||c.isStopIncluded===a))return s[l]}},u.prototype.addInterval=function(t,r){if(!t.isEmpty){var n,o,u=this._intervals;if(0===u.length||a.greaterThan(t.start,u[u.length-1].stop))return u.push(t),void this._changedEvent.raiseEvent(this);for(o=e(u,t,l),0>o?o=~o:o>0&&t.isStartIncluded&&u[o-1].isStartIncluded&&u[o-1].start.equals(t.start)?--o:o0&&(n=a.compare(u[o-1].stop,t.start),(n>0||0===n&&(u[o-1].isStopIncluded||t.isStartIncluded))&&((i(r)?r(u[o-1].data,t.data):u[o-1].data===t.data)?(t=new s(a.greaterThan(t.stop,u[o-1].stop)?{start:u[o-1].start,stop:t.stop,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:t.isStopIncluded,data:t.data}:{start:u[o-1].start,stop:u[o-1].stop,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:u[o-1].isStopIncluded||t.stop.equals(u[o-1].stop)&&t.isStopIncluded,data:t.data}),u.splice(o-1,1),--o):(n=a.compare(u[o-1].stop,t.stop),n>0||0===n&&u[o-1].isStopIncluded&&!t.isStopIncluded?u.splice(o-1,1,new s({start:u[o-1].start,stop:t.start,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:!t.isStartIncluded,data:u[o-1].data}),new s({start:t.stop,stop:u[o-1].stop,isStartIncluded:!t.isStopIncluded,isStopIncluded:u[o-1].isStopIncluded,data:u[o-1].data})):u[o-1]=new s({start:u[o-1].start,stop:t.start,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:!t.isStartIncluded,data:u[o-1].data}))));o0||0===n&&(t.isStopIncluded||u[o].isStartIncluded));)if(i(r)?r(u[o].data,t.data):u[o].data===t.data)t=new s({start:t.start,stop:a.greaterThan(u[o].stop,t.stop)?u[o].stop:t.stop,isStartIncluded:t.isStartIncluded,isStopIncluded:a.greaterThan(u[o].stop,t.stop)?u[o].isStopIncluded:t.isStopIncluded,data:t.data}),u.splice(o,1);else{if(u[o]=new s({start:t.stop,stop:u[o].stop,isStartIncluded:!t.isStopIncluded,isStopIncluded:u[o].isStopIncluded,data:u[o].data}),!u[o].isEmpty)break;u.splice(o,1)}u.splice(o,0,t),this._changedEvent.raiseEvent(this)}},u.prototype.removeInterval=function(t){if(t.isEmpty)return!1;var i=!1,r=this._intervals,n=e(r,t,l);0>n&&(n=~n);var o=t.start,u=t.stop,c=t.isStartIncluded,h=t.isStopIncluded;if(n>0){var d=r[n-1],p=d.stop;(a.greaterThan(p,o)||s.equals(p,o)&&d.isStopIncluded&&c)&&(i=!0,(a.greaterThan(p,u)||d.isStopIncluded&&!h&&s.equals(p,u))&&r.splice(n,0,new s({start:u,stop:p,isStartIncluded:!h,isStopIncluded:d.isStopIncluded,data:d.data})),r[n-1]=new s({start:d.start,stop:o,isStartIncluded:d.isStartIncluded,isStopIncluded:!c,data:d.data}))}var m=r[n];for(nh&&(h=d-h),l=h):l=h>d?d:0>h?0:h;var m=o?e(this.tolerance,1):.001;Math.abs(l-p)>m&&(this._seeking=!0,r.currentTime=l)}},l}),i("Core/VRTheWorldTerrainProvider",["../ThirdParty/when","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Event","./GeographicTilingScheme","./getImagePixels","./HeightmapTerrainData","./loadImage","./loadXML","./Math","./Rectangle","./TerrainProvider","./throttleRequestByServer","./TileProviderError"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g){"use strict";function _(e,t){this.rectangle=e,this.maxLevel=t}function y(n){function u(e){var t=e.getElementsByTagName("SRS")[0].textContent;if("EPSG:4326"!==t)return void c("SRS "+t+" is not supported.");C._tilingScheme=new l({ellipsoid:E});var i=e.getElementsByTagName("TileFormat")[0];C._heightmapWidth=parseInt(i.getAttribute("width"),10),C._heightmapHeight=parseInt(i.getAttribute("height"),10),C._levelZeroMaximumGeometricError=f.getEstimatedLevelZeroGeometricErrorForAHeightmap(E,Math.min(C._heightmapWidth,C._heightmapHeight),C._tilingScheme.getNumberOfXTilesAtLevel(0));for(var r=e.getElementsByTagName("DataExtent"),n=0;n0&&"/"!==this._url[this._url.length-1]&&(this._url+="/"),this._errorEvent=new s,this._ready=!1,this._readyPromise=e.defer(),this._proxy=n.proxy,this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0};var v=n.credit;"string"==typeof v&&(v=new t(v)),this._credit=v,this._tilingScheme=void 0,this._rectangles=[];var y,C=this,E=i(n.ellipsoid,a.WGS84);h()}function C(e,t,i,n){for(var o=e._tilingScheme,a=e._rectangles,s=o.tileXYToRectangle(t,i,n),l=0,u=0;ua)return{positions:r};var s=t(o),u=t(n),c=new Array(a),p=new Array(a),m=new Array(a),f=r[0];c[0]=f;var v=i.cartesianToCartographic(f,h);u&&(v.height=n[0]),p[0]=v.height,s?m[0]=o[0]:m[0]=0;for(var g=1,_=1;a>_;++_){var y=r[_],C=i.cartesianToCartographic(y,d);u&&(C.height=n[_]),l(v,C)?v.height=3){var v=r.fromPoints(t,e),g=v.projectPointsOntoPlane(t);o.computeWindingOrder2D(g)===s.CLOCKWISE&&(t.reverse(),i.reverse(),l.reverse())}var _,y,C=t.length,E=n.chordLength(c,e.maximumRadius),S=f;if(S.minDistance=E,S.ellipsoid=e,h){var w,T=0;for(w=0;C-1>w;w++)T+=a.numberOfPoints(t[w],t[w+1],E)+1;_=new Float64Array(3*T),y=new Float64Array(3*T);var x=p,b=m;S.positions=x,S.height=b;var A=0;for(w=0;C-1>w;w++){x[0]=t[w],x[1]=t[w+1],b[0]=i[w],b[1]=i[w+1];var P=a.generateArc(S);_.set(P,A),b[0]=l[w],b[1]=l[w+1],y.set(a.generateArc(S),A),A+=P.length}}else S.positions=t,S.height=i,_=new Float64Array(a.generateArc(S)),S.height=l,y=new Float64Array(a.generateArc(S));return{bottomPositions:y,topPositions:_}}},c}),i("Core/WallGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat","./WallGeometryLibrary"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e){e=r(e,r.EMPTY_OBJECT);var i=e.positions,o=e.maximumHeights,s=e.minimumHeights,l=r(e.vertexFormat,p.DEFAULT),u=r(e.granularity,h.RADIANS_PER_DEGREE),c=r(e.ellipsoid,a.WGS84);this._positions=i,this._minimumHeights=s,this._maximumHeights=o,this._vertexFormat=p.clone(l),this._granularity=u,this._ellipsoid=a.clone(c),this._workerName="createWallGeometry";var d=1+i.length*t.packedLength+2;n(s)&&(d+=s.length),n(o)&&(d+=o.length),this.packedLength=d+a.packedLength+p.packedLength+1}var v=new t,g=new t,_=new t,y=new t,C=new t,E=new t,S=new t,w=new t;f.pack=function(e,i,o){o=r(o,0);var s,l=e._positions,u=l.length;for(i[o++]=u,s=0;u>s;++s,o+=t.packedLength)t.pack(l[s],i,o);var c=e._minimumHeights;if(u=n(c)?c.length:0,i[o++]=u,n(c))for(s=0;u>s;++s)i[o++]=c[s];var h=e._maximumHeights;if(u=n(h)?h.length:0,i[o++]=u,n(h))for(s=0;u>s;++s)i[o++]=h[s];a.pack(e._ellipsoid,i,o),o+=a.packedLength,p.pack(e._vertexFormat,i,o),o+=p.packedLength,i[o]=e._granularity};var T=a.clone(a.UNIT_SPHERE),x=new p,b={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:T,vertexFormat:x,granularity:void 0};return f.unpack=function(e,i,o){i=r(i,0);var s,l=e[i++],u=new Array(l);for(s=0;l>s;++s,i+=t.packedLength)u[s]=t.unpack(e,i);l=e[i++];var c;if(l>0)for(c=new Array(l),s=0;l>s;++s)c[s]=e[i++];l=e[i++];var h;if(l>0)for(h=new Array(l),s=0;l>s;++s)h[s]=e[i++];var d=a.unpack(e,i,T);i+=a.packedLength;var m=p.unpack(e,i,x);i+=p.packedLength;var v=e[i];return n(o)?(o._positions=u,o._minimumHeights=c,o._maximumHeights=h,o._ellipsoid=a.clone(d,o._ellipsoid),o._vertexFormat=p.clone(m,o._vertexFormat),o._granularity=v,o):(b.positions=u,b.minimumHeights=c,b.maximumHeights=h,b.granularity=v,new f(b))},f.fromConstantHeights=function(e){e=r(e,r.EMPTY_OBJECT);var t,i,o=e.positions,a=e.minimumHeight,s=e.maximumHeight,l=n(a),u=n(s);if(l||u){var c=o.length;t=l?new Array(c):void 0,i=u?new Array(c):void 0;for(var h=0;c>h;++h)l&&(t[h]=a),u&&(i[h]=s)}var d={positions:o,maximumHeights:i,minimumHeights:t,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new f(d)},f.createGeometry=function(r){var o=r._positions,a=r._minimumHeights,p=r._maximumHeights,f=r._vertexFormat,T=r._granularity,x=r._ellipsoid,b=m.computePositions(x,o,p,a,T,!0);if(n(b)){var A=b.bottomPositions,P=b.topPositions,I=P.length,M=2*I,D=f.position?new Float64Array(M):void 0,R=f.normal?new Float32Array(M):void 0,O=f.tangent?new Float32Array(M):void 0,N=f.binormal?new Float32Array(M):void 0,L=f.st?new Float32Array(M/3*2):void 0,F=0,B=0,V=0,k=0,z=0,U=w,G=S,W=E,H=!0;I/=3;var q,j=0,Y=1/(I-o.length+1);for(q=0;I>q;++q){var X=3*q,Z=t.fromArray(P,X,v),K=t.fromArray(A,X,g);if(f.position&&(D[F++]=K.x,D[F++]=K.y,D[F++]=K.z,D[F++]=Z.x,D[F++]=Z.y,D[F++]=Z.z),f.st&&(L[z++]=j,L[z++]=0,L[z++]=j,L[z++]=1),f.normal||f.tangent||f.binormal){var Q,J=t.clone(t.ZERO,C),$=x.scaleToGeodeticSurface(t.fromArray(P,X,g),g);if(I>q+1&&(Q=x.scaleToGeodeticSurface(t.fromArray(P,X+3,_),_),J=t.fromArray(P,X+3,C)),H){var ee=t.subtract(J,Z,y),te=t.subtract($,Z,v);U=t.normalize(t.cross(te,ee,U),U),H=!1}t.equalsEpsilon(Q,$,h.EPSILON10)?H=!0:(j+=Y,f.tangent&&(G=t.normalize(t.subtract(Q,$,G),G)),f.binormal&&(W=t.normalize(t.cross(U,G,W),W))),f.normal&&(R[B++]=U.x,R[B++]=U.y,R[B++]=U.z,R[B++]=U.x,R[B++]=U.y,R[B++]=U.z),f.tangent&&(O[k++]=G.x,O[k++]=G.y,O[k++]=G.z,O[k++]=G.x,O[k++]=G.y,O[k++]=G.z),f.binormal&&(N[V++]=W.x,N[V++]=W.y,N[V++]=W.z,N[V++]=W.x,N[V++]=W.y,N[V++]=W.z)}}var ie=new u;f.position&&(ie.position=new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:D})),f.normal&&(ie.normal=new l({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:R})),f.tangent&&(ie.tangent=new l({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:O})),f.binormal&&(ie.binormal=new l({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:N})),f.st&&(ie.st=new l({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:L}));var re=M/3;M-=6;var ne=c.createTypedArray(re,M),oe=0;for(q=0;re-2>q;q+=2){var ae=q,se=q+2,le=t.fromArray(D,3*ae,v),ue=t.fromArray(D,3*se,g);if(!t.equalsEpsilon(le,ue,h.EPSILON10)){var ce=q+1,he=q+3;ne[oe++]=ce,ne[oe++]=ae,ne[oe++]=he,ne[oe++]=he,ne[oe++]=ae,ne[oe++]=se}}return new s({attributes:ie,indices:ne,primitiveType:d.TRIANGLES,boundingSphere:new e.fromVertices(D)})}},f}),i("Core/WallOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./WallGeometryLibrary"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(e){e=r(e,r.EMPTY_OBJECT);var i=e.positions,o=e.maximumHeights,s=e.minimumHeights,l=r(e.granularity,h.RADIANS_PER_DEGREE),u=r(e.ellipsoid,a.WGS84);this._positions=i,this._minimumHeights=s,this._maximumHeights=o,this._granularity=l,this._ellipsoid=a.clone(u),this._workerName="createWallOutlineGeometry";var c=1+i.length*t.packedLength+2;n(s)&&(c+=s.length),n(o)&&(c+=o.length),this.packedLength=c+a.packedLength+1}var f=new t,v=new t;m.pack=function(e,i,o){o=r(o,0);var s,l=e._positions,u=l.length;for(i[o++]=u,s=0;u>s;++s,o+=t.packedLength)t.pack(l[s],i,o);var c=e._minimumHeights;if(u=n(c)?c.length:0,i[o++]=u,n(c))for(s=0;u>s;++s)i[o++]=c[s];var h=e._maximumHeights;if(u=n(h)?h.length:0,i[o++]=u,n(h))for(s=0;u>s;++s)i[o++]=h[s];a.pack(e._ellipsoid,i,o),o+=a.packedLength,i[o]=e._granularity};var g=a.clone(a.UNIT_SPHERE),_={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:g,granularity:void 0};return m.unpack=function(e,i,o){i=r(i,0);var s,l=e[i++],u=new Array(l);for(s=0;l>s;++s,i+=t.packedLength)u[s]=t.unpack(e,i);l=e[i++];var c;if(l>0)for(c=new Array(l),s=0;l>s;++s)c[s]=e[i++];l=e[i++];var h;if(l>0)for(h=new Array(l),s=0;l>s;++s)h[s]=e[i++];var d=a.unpack(e,i,g);i+=a.packedLength;var p=e[i];return n(o)?(o._positions=u,o._minimumHeights=c,o._maximumHeights=h,o._ellipsoid=a.clone(d,o._ellipsoid),o._granularity=p,o):(_.positions=u,_.minimumHeights=c,_.maximumHeights=h,_.granularity=p,new m(_))},m.fromConstantHeights=function(e){e=r(e,r.EMPTY_OBJECT);var t,i,o=e.positions,a=e.minimumHeight,s=e.maximumHeight,l=n(a),u=n(s);if(l||u){var c=o.length;t=l?new Array(c):void 0,i=u?new Array(c):void 0;for(var h=0;c>h;++h)l&&(t[h]=a),u&&(i[h]=s)}var d={positions:o,maximumHeights:i,minimumHeights:t,ellipsoid:e.ellipsoid};return new m(d)},m.createGeometry=function(r){var o=r._positions,a=r._minimumHeights,m=r._maximumHeights,g=r._granularity,_=r._ellipsoid,y=p.computePositions(_,o,m,a,g,!1); -if(n(y)){var C=y.bottomPositions,E=y.topPositions,S=E.length,w=2*S,T=new Float64Array(w),x=0;S/=3;var b;for(b=0;S>b;++b){var A=3*b,P=t.fromArray(E,A,f),I=t.fromArray(C,A,v);T[x++]=I.x,T[x++]=I.y,T[x++]=I.z,T[x++]=P.x,T[x++]=P.y,T[x++]=P.z}var M=new u({position:new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:T})}),D=w/3;w=2*D-4+D;var R=c.createTypedArray(D,w),O=0;for(b=0;D-2>b;b+=2){var N=b,L=b+2,F=t.fromArray(T,3*N,f),B=t.fromArray(T,3*L,v);if(!t.equalsEpsilon(F,B,h.EPSILON10)){var V=b+1,k=b+3;R[O++]=V,R[O++]=N,R[O++]=V,R[O++]=k,R[O++]=N,R[O++]=L}}return R[O++]=D-2,R[O++]=D-1,new s({attributes:M,indices:R,primitiveType:d.LINES,boundingSphere:new e.fromVertices(T)})}},m}),i("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){this._ellipsoid=i(e,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return n(l.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),l.mercatorAngleToGeodeticLatitude=function(e){return s.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},l.geodeticLatitudeToMercatorAngle=function(e){e>l.MaximumLatitude?e=l.MaximumLatitude:e<-l.MaximumLatitude&&(e=-l.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},l.MaximumLatitude=l.mercatorAngleToGeodeticLatitude(Math.PI),l.prototype.project=function(t,i){var n=this._semimajorAxis,o=t.longitude*n,a=l.geodeticLatitudeToMercatorAngle(t.latitude)*n,s=t.height;return r(i)?(i.x=o,i.y=a,i.z=s,i):new e(o,a,s)},l.prototype.unproject=function(e,i){var n=this._oneOverSemimajorAxis,o=e.x*n,a=l.mercatorAngleToGeodeticLatitude(e.y*n),s=e.z;return r(i)?(i.longitude=o,i.latitude=a,i.height=s,i):new t(o,a,s)},l}),i("Core/WebMercatorTilingScheme",["./Cartesian2","./defaultValue","./defined","./defineProperties","./Ellipsoid","./Rectangle","./WebMercatorProjection"],function(e,t,i,r,n,o,a){"use strict";function s(r){if(r=t(r,{}),this._ellipsoid=t(r.ellipsoid,n.WGS84),this._numberOfLevelZeroTilesX=t(r.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=t(r.numberOfLevelZeroTilesY,1),this._projection=new a(this._ellipsoid),i(r.rectangleSouthwestInMeters)&&i(r.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=r.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=r.rectangleNortheastInMeters;else{var s=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new e(-s,-s),this._rectangleNortheastInMeters=new e(s,s)}var l=this._projection.unproject(this._rectangleSouthwestInMeters),u=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new o(l.longitude,l.latitude,u.longitude,u.latitude)}return r(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),s.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<=s&&(g=s-1);var _=v/d|0;return _>=l&&(_=l-1),i(n)?(n.x=g,n.y=_,n):new e(g,_)}},s}),i("Core/wrapFunction",["./DeveloperError"],function(e){"use strict";function t(e,t,i){return function(){i.apply(e,arguments),t.apply(e,arguments)}}return t}),i("DataSources/ConstantProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event"],function(e,t,i,r,n){"use strict";function o(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new n,this.setValue(e)}return i(o.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}}),o.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value},o.prototype.setValue=function(e){var i=this._value;if(i!==e){var r=t(e),n=r&&"function"==typeof e.clone,o=r&&"function"==typeof e.equals;this._hasClone=n,this._hasEquals=o;var a=!o||!e.equals(i);a&&(this._value=n?e.clone():e,this._definitionChanged.raiseEvent(this))}},o.prototype.equals=function(e){return this===e||e instanceof o&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))},o}),i("DataSources/createPropertyDescriptor",["../Core/defaultValue","../Core/defined","./ConstantProperty"],function(e,t,i){"use strict";function r(e,i,r,n,o){return{configurable:n,get:function(){return this[i]},set:function(n){var a=this[i],s=this[r];t(s)&&(s(),this[r]=void 0);var l=t(n);l&&!t(n.getValue)&&t(o)&&(n=o(n)),a!==n&&(this[i]=n,this._definitionChanged.raiseEvent(this,e,n,a)),t(n)&&t(n.definitionChanged)&&(this[r]=n.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,n,n)},this))}}}function n(e){return new i(e)}function o(t,i,o){return r(t,"_"+t.toString(),"_"+t.toString()+"Subscription",e(i,!1),e(o,n))}return o}),i("DataSources/BillboardGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,i,r,n,o){"use strict";function a(t){this._image=void 0,this._imageSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},image:o("image"),imageSubRegion:o("imageSubRegion"),scale:o("scale"),rotation:o("rotation"),alignedAxis:o("alignedAxis"),horizontalOrigin:o("horizontalOrigin"),verticalOrigin:o("verticalOrigin"),color:o("color"),eyeOffset:o("eyeOffset"),pixelOffset:o("pixelOffset"),show:o("show"),width:o("width"),height:o("height"),scaleByDistance:o("scaleByDistance"),translucencyByDistance:o("translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance"),sizeInMeters:o("sizeInMeters")}),a.prototype.clone=function(e){return t(e)?(e.color=this._color,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.image=this._image,e.imageSubRegion=this._imageSubRegion,e.pixelOffset=this._pixelOffset,e.scale=this._scale,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.show=this._show,e.verticalOrigin=this._verticalOrigin,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.sizeInMeters=this._sizeInMeters,e):new a(this)},a.prototype.merge=function(t){this.color=e(this._color,t.color),this.eyeOffset=e(this._eyeOffset,t.eyeOffset),this.horizontalOrigin=e(this._horizontalOrigin,t.horizontalOrigin),this.image=e(this._image,t.image),this.imageSubRegion=e(this._imageSubRegion,t.imageSubRegion),this.pixelOffset=e(this._pixelOffset,t.pixelOffset),this.scale=e(this._scale,t.scale),this.rotation=e(this._rotation,t.rotation),this.alignedAxis=e(this._alignedAxis,t.alignedAxis),this.show=e(this._show,t.show),this.verticalOrigin=e(this._verticalOrigin,t.verticalOrigin),this.width=e(this._width,t.width),this.height=e(this._height,t.height),this.scaleByDistance=e(this._scaleByDistance,t.scaleByDistance),this.translucencyByDistance=e(this._translucencyByDistance,t.translucencyByDistance),this.pixelOffsetScaleByDistance=e(this._pixelOffsetScaleByDistance,t.pixelOffsetScaleByDistance),this.sizeInMeters=e(this._sizeInMeters,t.sizeInMeters)},a}),i("Renderer/BufferUsage",["../Core/freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={STREAM_DRAW:t.STREAM_DRAW,STATIC_DRAW:t.STATIC_DRAW,DYNAMIC_DRAW:t.DYNAMIC_DRAW,validate:function(e){return e===i.STREAM_DRAW||e===i.STATIC_DRAW||e===i.DYNAMIC_DRAW}};return e(i)}),i("Renderer/Buffer",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/IndexDatatype","./BufferUsage","./WebGLConstants"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){i=e(i,e.EMPTY_OBJECT);var r=i.context._gl,n=i.bufferTarget,o=i.typedArray,a=i.sizeInBytes,s=i.usage,l=t(o);l&&(a=o.byteLength);var u=r.createBuffer();r.bindBuffer(n,u),r.bufferData(n,l?o:a,s),r.bindBuffer(n,null),this._gl=r,this._bufferTarget=n,this._sizeInBytes=a,this._usage=s,this._buffer=u,this.vertexArrayDestroyable=!0}return l.createVertexBuffer=function(e){return new l({context:e.context,bufferTarget:s.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})},l.createIndexBuffer=function(e){var t=e.context,r=e.indexDatatype,n=o.getSizeInBytes(r),a=new l({context:t,bufferTarget:s.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),u=a.sizeInBytes/n;return i(a,{indexDatatype:{get:function(){return r}},bytesPerIndex:{get:function(){return n}},numberOfIndices:{get:function(){return u}}}),a},i(l.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}}),l.prototype._getBuffer=function(){return this._buffer},l.prototype.copyFromArrayView=function(t,i){i=e(i,0);var r=this._gl,n=this._bufferTarget;r.bindBuffer(n,this._buffer),r.bufferSubData(n,i,t),r.bindBuffer(n,null)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),r(this)},l}),i("Renderer/DrawCommand",["../Core/defaultValue","../Core/PrimitiveType"],function(e,t){"use strict";function i(i){i=e(i,e.EMPTY_OBJECT),this.boundingVolume=i.boundingVolume,this.orientedBoundingBox=i.orientedBoundingBox,this.cull=e(i.cull,!0),this.modelMatrix=i.modelMatrix,this.primitiveType=e(i.primitiveType,t.TRIANGLES),this.vertexArray=i.vertexArray,this.count=i.count,this.offset=e(i.offset,0),this.instanceCount=e(i.instanceCount,0),this.shaderProgram=i.shaderProgram,this.uniformMap=i.uniformMap,this.renderState=i.renderState,this.framebuffer=i.framebuffer,this.pass=i.pass,this.executeInClosestFrustum=e(i.executeInClosestFrustum,!1),this.owner=i.owner,this.debugShowBoundingVolume=e(i.debugShowBoundingVolume,!1),this.debugOverlappingFrustums=0,this.oit=void 0}return i.prototype.execute=function(e,t,i,r){e.draw(this,t,i,r)},i}),i("Renderer/ContextLimits",["../Core/defineProperties"],function(e){"use strict";var t={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_highpFloatSupported:!1,_highpIntSupported:!1};return e(t,{maximumCombinedTextureImageUnits:{get:function(){return t._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return t._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return t._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return t._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return t._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return t._maximumTextureSize}},maximumVaryingVectors:{get:function(){return t._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return t._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return t._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return t._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return t._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return t._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return t._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return t._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return t._maximumViewportWidth}},maximumViewportHeight:{get:function(){return t._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return t._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return t._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return t._maximumColorAttachments}},highpFloatSupported:{get:function(){return t._highpFloatSupported}},highpIntSupported:{get:function(){return t._highpIntSupported}}}),t}),i("Renderer/RenderState",["../Core/BoundingRectangle","../Core/Color","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/RuntimeError","../Core/WindingOrder","./ContextLimits","./WebGLConstants"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(n){var o=i(n,{}),s=i(o.cull,{}),u=i(o.polygonOffset,{}),c=i(o.scissorTest,{}),h=i(c.rectangle,{}),d=i(o.depthRange,{}),p=i(o.depthTest,{}),m=i(o.colorMask,{}),f=i(o.blending,{}),v=i(f.color,{}),g=i(o.stencilTest,{}),_=i(g.frontOperation,{}),y=i(g.backOperation,{}),C=i(o.sampleCoverage,{}),E=o.viewport;this.frontFace=i(o.frontFace,a.COUNTER_CLOCKWISE),this.cull={enabled:i(s.enabled,!1),face:i(s.face,l.BACK)},this.lineWidth=i(o.lineWidth,1),this.polygonOffset={enabled:i(u.enabled,!1),factor:i(u.factor,0),units:i(u.units,0)},this.scissorTest={enabled:i(c.enabled,!1),rectangle:e.clone(h)},this.depthRange={near:i(d.near,0),far:i(d.far,1)},this.depthTest={enabled:i(p.enabled,!1),func:i(p.func,l.LESS)},this.colorMask={red:i(m.red,!0),green:i(m.green,!0),blue:i(m.blue,!0),alpha:i(m.alpha,!0)},this.depthMask=i(o.depthMask,!0),this.stencilMask=i(o.stencilMask,-1),this.blending={enabled:i(f.enabled,!1),color:new t(i(v.red,0),i(v.green,0),i(v.blue,0),i(v.alpha,0)),equationRgb:i(f.equationRgb,l.FUNC_ADD),equationAlpha:i(f.equationAlpha,l.FUNC_ADD),functionSourceRgb:i(f.functionSourceRgb,l.ONE),functionSourceAlpha:i(f.functionSourceAlpha,l.ONE),functionDestinationRgb:i(f.functionDestinationRgb,l.ZERO),functionDestinationAlpha:i(f.functionDestinationAlpha,l.ZERO)},this.stencilTest={enabled:i(g.enabled,!1),frontFunction:i(g.frontFunction,l.ALWAYS),backFunction:i(g.backFunction,l.ALWAYS),reference:i(g.reference,0),mask:i(g.mask,-1),frontOperation:{fail:i(_.fail,l.KEEP),zFail:i(_.zFail,l.KEEP),zPass:i(_.zPass,l.KEEP)},backOperation:{fail:i(y.fail,l.KEEP),zFail:i(y.zFail,l.KEEP),zPass:i(y.zPass,l.KEEP)}},this.sampleCoverage={enabled:i(C.enabled,!1),value:i(C.value,1),invert:i(C.invert,!1)},this.viewport=r(E)?new e(E.x,E.y,E.width,E.height):void 0,this.id=0,this._applyFunctions=[]}function c(e,t,i){i?e.enable(t):e.disable(t)}function h(e,t){e.frontFace(t.frontFace)}function d(e,t){var i=t.cull,r=i.enabled;c(e,e.CULL_FACE,r),r&&e.cullFace(i.face)}function p(e,t){e.lineWidth(t.lineWidth)}function m(e,t){var i=t.polygonOffset,r=i.enabled;c(e,e.POLYGON_OFFSET_FILL,r),r&&e.polygonOffset(i.factor,i.units)}function f(e,t,i){var n=t.scissorTest,o=r(i.scissorTest)?i.scissorTest.enabled:n.enabled;if(c(e,e.SCISSOR_TEST,o),o){var a=r(i.scissorTest)?i.scissorTest.rectangle:n.rectangle;e.scissor(a.x,a.y,a.width,a.height)}}function v(e,t){var i=t.depthRange;e.depthRange(i.near,i.far)}function g(e,t){var i=t.depthTest,r=i.enabled;c(e,e.DEPTH_TEST,r),r&&e.depthFunc(i.func)}function _(e,t){var i=t.colorMask;e.colorMask(i.red,i.green,i.blue,i.alpha)}function y(e,t){e.depthMask(t.depthMask)}function C(e,t){e.stencilMask(t.stencilMask)}function E(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function S(e,t,i){var n=t.blending,o=r(i.blendingEnabled)?i.blendingEnabled:n.enabled;c(e,e.BLEND,o),o&&(E(e,n.color),e.blendEquationSeparate(n.equationRgb,n.equationAlpha),e.blendFuncSeparate(n.functionSourceRgb,n.functionDestinationRgb,n.functionSourceAlpha,n.functionDestinationAlpha))}function w(e,t){var i=t.stencilTest,r=i.enabled;if(c(e,e.STENCIL_TEST,r),r){var n=i.frontFunction,o=i.backFunction,a=i.reference,s=i.mask;e.stencilFunc(i.frontFunction,i.reference,i.mask),e.stencilFuncSeparate(e.BACK,o,a,s),e.stencilFuncSeparate(e.FRONT,n,a,s);var l=i.frontOperation,u=l.fail,h=l.zFail,d=l.zPass;e.stencilOpSeparate(e.FRONT,u,h,d);var p=i.backOperation,m=p.fail,f=p.zFail,v=p.zPass;e.stencilOpSeparate(e.BACK,m,f,v)}}function T(e,t){var i=t.sampleCoverage,r=i.enabled;c(e,e.SAMPLE_COVERAGE,r),r&&e.sampleCoverage(i.value,i.invert)}function x(e,t,n){var o=i(t.viewport,n.viewport);r(o)||(o=I,o.width=n.context.drawingBufferWidth,o.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=o,e.viewport(o.x,o.y,o.width,o.height)}function b(e,t){var i=[];return e.frontFace!==t.frontFace&&i.push(h),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&i.push(d),e.lineWidth!==t.lineWidth&&i.push(p),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&i.push(m),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&i.push(v),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&i.push(g),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&i.push(_),e.depthMask!==t.depthMask&&i.push(y),e.stencilMask!==t.stencilMask&&i.push(C),(e.stencilTest.enabled!==t.stencilTest.enabled||e.stencilTest.frontFunction!==t.stencilTest.frontFunction||e.stencilTest.backFunction!==t.stencilTest.backFunction||e.stencilTest.reference!==t.stencilTest.reference||e.stencilTest.mask!==t.stencilTest.mask||e.stencilTest.frontOperation.fail!==t.stencilTest.frontOperation.fail||e.stencilTest.frontOperation.zFail!==t.stencilTest.frontOperation.zFail||e.stencilTest.backOperation.fail!==t.stencilTest.backOperation.fail||e.stencilTest.backOperation.zFail!==t.stencilTest.backOperation.zFail||e.stencilTest.backOperation.zPass!==t.stencilTest.backOperation.zPass)&&i.push(w),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&i.push(T),i}var A=0,P={};u.fromCache=function(e){var t=JSON.stringify(e),i=P[t];if(r(i))return++i.referenceCount,i.state;var n=new u(e),o=JSON.stringify(n);return i=P[o],r(i)||(n.id=A++,i={referenceCount:0,state:n},P[o]=i),++i.referenceCount,P[t]={referenceCount:1,state:i.state},i.state},u.removeFromCache=function(e){var t=new u(e),i=JSON.stringify(t),n=P[i],o=JSON.stringify(e),a=P[o];r(a)&&(--a.referenceCount,0===a.referenceCount&&(delete P[o],r(n)&&--n.referenceCount)),r(n)&&0===n.referenceCount&&delete P[i]},u.getCache=function(){return P},u.clearCache=function(){P={}};var I=new e;return u.apply=function(e,t,i){h(e,t),d(e,t),p(e,t),m(e,t),v(e,t),g(e,t),_(e,t),y(e,t),C(e,t),w(e,t),T(e,t),f(e,t,i),S(e,t,i),x(e,t,i)},u.partialApply=function(e,t,i,n,o,a){if(t!==i){var s=i._applyFunctions[t.id];r(s)||(s=b(t,i),i._applyFunctions[t.id]=s);for(var l=s.length,u=0;l>u;++u)s[u](e,i)}var c=r(n.scissorTest)?n.scissorTest:t.scissorTest,h=r(o.scissorTest)?o.scissorTest:i.scissorTest;(c!==h||a)&&f(e,i,o);var d=r(n.blendingEnabled)?n.blendingEnabled:t.blending.enabled,p=r(o.blendingEnabled)?o.blendingEnabled:i.blending.enabled;(d!==p||p&&t.blending!==i.blending)&&S(e,i,o),(t!==i||n.context!==o.context)&&x(e,i,o)},u.getState=function(i){return{frontFace:i.frontFace,cull:{enabled:i.cull.enabled,face:i.cull.face},lineWidth:i.lineWidth,polygonOffset:{enabled:i.polygonOffset.enabled,factor:i.polygonOffset.factor,units:i.polygonOffset.units},scissorTest:{enabled:i.scissorTest.enabled,rectangle:e.clone(i.scissorTest.rectangle)},depthRange:{near:i.depthRange.near,far:i.depthRange.far},depthTest:{enabled:i.depthTest.enabled,func:i.depthTest.func},colorMask:{red:i.colorMask.red,green:i.colorMask.green,blue:i.colorMask.blue,alpha:i.colorMask.alpha},depthMask:i.depthMask,stencilMask:i.stencilMask,blending:{enabled:i.blending.enabled,color:t.clone(i.blending.color),equationRgb:i.blending.equationRgb,equationAlpha:i.blending.equationAlpha,functionSourceRgb:i.blending.functionSourceRgb,functionSourceAlpha:i.blending.functionSourceAlpha,functionDestinationRgb:i.blending.functionDestinationRgb,functionDestinationAlpha:i.blending.functionDestinationAlpha},stencilTest:{enabled:i.stencilTest.enabled,frontFunction:i.stencilTest.frontFunction,backFunction:i.stencilTest.backFunction,reference:i.stencilTest.reference,mask:i.stencilTest.mask,frontOperation:{fail:i.stencilTest.frontOperation.fail,zFail:i.stencilTest.frontOperation.zFail,zPass:i.stencilTest.frontOperation.zPass},backOperation:{fail:i.stencilTest.backOperation.fail,zFail:i.stencilTest.backOperation.zFail,zPass:i.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:i.sampleCoverage.enabled,value:i.sampleCoverage.value,invert:i.sampleCoverage.invert},viewport:r(i.viewport)?e.clone(i.viewport):void 0}},u}),i("Renderer/AutomaticUniforms",["../Core/Cartesian3","../Core/Matrix4","./WebGLConstants"],function(e,t,i){"use strict";function r(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var n=new e;if("undefined"==typeof WebGLRenderingContext)return{};var o={};o[i.FLOAT]="float",o[i.FLOAT_VEC2]="vec2",o[i.FLOAT_VEC3]="vec3",o[i.FLOAT_VEC4]="vec4",o[i.INT]="int",o[i.INT_VEC2]="ivec2",o[i.INT_VEC3]="ivec3",o[i.INT_VEC4]="ivec4",o[i.BOOL]="bool",o[i.BOOL_VEC2]="bvec2",o[i.BOOL_VEC3]="bvec3",o[i.BOOL_VEC4]="bvec4",o[i.FLOAT_MAT2]="mat2",o[i.FLOAT_MAT3]="mat3",o[i.FLOAT_MAT4]="mat4",o[i.SAMPLER_2D]="sampler2D",o[i.SAMPLER_CUBE]="samplerCube",r.prototype.getDeclaration=function(e){var t="uniform "+o[this._datatype]+" "+e,i=this._size;return t+=1===i?";":"["+i.toString()+"];"};var a={czm_viewport:new r({size:1,datatype:i.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new r({size:1,datatype:i.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_inverseProjectionOIT:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseProjectionOIT}}),czm_infiniteProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_normal:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight2D:new r({size:1,datatype:i.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_entireFrustum:new r({size:1,datatype:i.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new r({size:1,datatype:i.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new r({size:1,datatype:i.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_sunPositionWC:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_encodedCameraPositionMCHigh:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return t.getTranslation(e.inverseView,n)}}),czm_frameNumber:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_temeToPseudoFixed:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_resolutionScale:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.resolutionScale}}),czm_fogDensity:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.fogDensity}})};return a}),i("Renderer/createUniform",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/defined","../Core/DeveloperError","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/RuntimeError"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,t,i,r){switch(t.type){case e.FLOAT:return new h(e,t,i,r);case e.FLOAT_VEC2:return new d(e,t,i,r);case e.FLOAT_VEC3:return new p(e,t,i,r);case e.FLOAT_VEC4:return new m(e,t,i,r);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new f(e,t,i,r);case e.INT:case e.BOOL:return new v(e,t,i,r);case e.INT_VEC2:case e.BOOL_VEC2:return new g(e,t,i,r);case e.INT_VEC3:case e.BOOL_VEC3:return new _(e,t,i,r);case e.INT_VEC4:case e.BOOL_VEC4:return new y(e,t,i,r);case e.FLOAT_MAT2:return new C(e,t,i,r);case e.FLOAT_MAT3:return new E(e,t,i,r);case e.FLOAT_MAT4:return new S(e,t,i,r);default:throw new u("Unrecognized uniform type: "+t.type+' for uniform "'+i+'".')}}function h(e,t,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=e,this._location=r}function d(t,i,r,n){this.name=r,this.value=void 0,this._value=new e,this._gl=t,this._location=n}function p(e,t,i,r){this.name=i,this.value=void 0,this._value=void 0,this._gl=e,this._location=r}function m(e,t,i,r){this.name=i,this.value=void 0,this._value=void 0,this._gl=e,this._location=r}function f(e,t,i,r){this.name=i,this.value=void 0,this._gl=e,this._location=r,this.textureUnitIndex=void 0}function v(e,t,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=e,this._location=r}function g(t,i,r,n){this.name=r,this.value=void 0,this._value=new e,this._gl=t,this._location=n}function _(e,i,r,n){this.name=r,this.value=void 0,this._value=new t,this._gl=e,this._location=n}function y(e,t,r,n){this.name=r,this.value=void 0,this._value=new i,this._gl=e,this._location=n}function C(e,t,i,r){this.name=i,this.value=void 0,this._value=new Float32Array(4),this._gl=e,this._location=r}function E(e,t,i,r){this.name=i,this.value=void 0,this._value=new Float32Array(9),this._gl=e,this._location=r}function S(e,t,i,r){this.name=i,this.value=void 0,this._value=new Float32Array(16),this._gl=e,this._location=r}return h.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))},d.prototype.set=function(){var t=this.value;e.equals(t,this._value)||(e.clone(t,this._value),this._gl.uniform2f(this._location,t.x,t.y))},p.prototype.set=function(){var e=this.value;if(n(e.red))r.equals(e,this._value)||(this._value=r.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue));else{ -if(!n(e.x))throw new o('Invalid vec3 value for uniform "'+this._activethis.name+'".');t.equals(e,this._value)||(this._value=t.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z))}},m.prototype.set=function(){var e=this.value;if(n(e.red))r.equals(e,this._value)||(this._value=r.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha));else{if(!n(e.x))throw new o('Invalid vec4 value for uniform "'+this._activethis.name+'".');i.equals(e,this._value)||(this._value=i.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w))}},f.prototype.set=function(){var e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);var t=this.value;e.bindTexture(t._target,t._texture)},f.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1},v.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))},g.prototype.set=function(){var t=this.value;e.equals(t,this._value)||(e.clone(t,this._value),this._gl.uniform2i(this._location,t.x,t.y))},_.prototype.set=function(){var e=this.value;t.equals(e,this._value)||(t.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))},y.prototype.set=function(){var e=this.value;i.equals(e,this._value)||(i.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))},C.prototype.set=function(){a.equalsArray(this.value,this._value,0)||(a.toArray(this.value,this._value),this._gl.uniformMatrix2fv(this._location,!1,this._value))},E.prototype.set=function(){s.equalsArray(this.value,this._value,0)||(s.toArray(this.value,this._value),this._gl.uniformMatrix3fv(this._location,!1,this._value))},S.prototype.set=function(){l.equalsArray(this.value,this._value,0)||(l.toArray(this.value,this._value),this._gl.uniformMatrix4fv(this._location,!1,this._value))},c}),i("Renderer/createUniformArray",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/RuntimeError"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e,t,i,r){switch(t.type){case e.FLOAT:return new d(e,t,i,r);case e.FLOAT_VEC2:return new p(e,t,i,r);case e.FLOAT_VEC3:return new m(e,t,i,r);case e.FLOAT_VEC4:return new f(e,t,i,r);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new v(e,t,i,r);case e.INT:case e.BOOL:return new g(e,t,i,r);case e.INT_VEC2:case e.BOOL_VEC2:return new _(e,t,i,r);case e.INT_VEC3:case e.BOOL_VEC3:return new y(e,t,i,r);case e.INT_VEC4:case e.BOOL_VEC4:return new C(e,t,i,r);case e.FLOAT_MAT2:return new E(e,t,i,r);case e.FLOAT_MAT3:return new S(e,t,i,r);case e.FLOAT_MAT4:return new w(e,t,i,r);default:throw new c("Unrecognized uniform type: "+t.type+' for uniform "'+i+'".')}}function d(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(n),this._gl=e,this._location=r[0]}function p(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(2*n),this._gl=e,this._location=r[0]}function m(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(3*n),this._gl=e,this._location=r[0]}function f(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(4*n),this._gl=e,this._location=r[0]}function v(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(n),this._gl=e,this._locations=r,this.textureUnitIndex=void 0}function g(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Int32Array(n),this._gl=e,this._location=r[0]}function _(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Int32Array(2*n),this._gl=e,this._location=r[0]}function y(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Int32Array(3*n),this._gl=e,this._location=r[0]}function C(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Int32Array(4*n),this._gl=e,this._location=r[0]}function E(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(4*n),this._gl=e,this._location=r[0]}function S(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(9*n),this._gl=e,this._location=r[0]}function w(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(16*n),this._gl=e,this._location=r[0]}return d.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0;t>n;++n){var o=e[n];o!==i[n]&&(i[n]=o,r=!0)}r&&this._gl.uniform1fv(this._location,i)},p.prototype.set=function(){for(var t=this.value,i=t.length,r=this._value,n=!1,o=0,a=0;i>a;++a){var s=t[a];e.equalsArray(s,r,o)||(e.pack(s,r,o),n=!0),o+=2}n&&this._gl.uniform2fv(this._location,r)},m.prototype.set=function(){for(var e=this.value,i=e.length,r=this._value,o=!1,s=0,l=0;i>l;++l){var u=e[l];if(n(u.red))(u.red!==r[s]||u.green!==r[s+1]||u.blue!==r[s+2])&&(r[s]=u.red,r[s+1]=u.green,r[s+2]=u.blue,o=!0);else{if(!n(u.x))throw new a("Invalid vec3 value.");t.equalsArray(u,r,s)||(t.pack(u,r,s),o=!0)}s+=3}o&&this._gl.uniform3fv(this._location,r)},f.prototype.set=function(){for(var e=this.value,t=e.length,o=this._value,s=!1,l=0,u=0;t>u;++u){var c=e[u];if(n(c.red))r.equalsArray(c,o,l)||(r.pack(c,o,l),s=!0);else{if(!n(c.x))throw new a("Invalid vec4 value.");i.equalsArray(c,o,l)||(i.pack(c,o,l),s=!0)}l+=4}s&&this._gl.uniform4fv(this._location,o)},v.prototype.set=function(){for(var e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,i=this.value,r=i.length,n=0;r>n;++n){var o=i[n];e.activeTexture(t+n),e.bindTexture(o._target,o._texture)}},v.prototype._setSampler=function(e){this.textureUnitIndex=e;for(var t=this._locations,i=t.length,r=0;i>r;++r){var n=e+r;this._gl.uniform1i(t[r],n)}return e+i},g.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0;t>n;++n){var o=e[n];o!==i[n]&&(i[n]=o,r=!0)}r&&this._gl.uniform1iv(this._location,i)},_.prototype.set=function(){for(var t=this.value,i=t.length,r=this._value,n=!1,o=0,a=0;i>a;++a){var s=t[a];e.equalsArray(s,r,o)||(e.pack(s,r,o),n=!0),o+=2}n&&this._gl.uniform2iv(this._location,r)},y.prototype.set=function(){for(var e=this.value,i=e.length,r=this._value,n=!1,o=0,a=0;i>a;++a){var s=e[a];t.equalsArray(s,r,o)||(t.pack(s,r,o),n=!0),o+=3}n&&this._gl.uniform3iv(this._location,r)},C.prototype.set=function(){for(var e=this.value,t=e.length,r=this._value,n=!1,o=0,a=0;t>a;++a){var s=e[a];i.equalsArray(s,r,o)||(i.pack(s,r,o),n=!0),o+=4}n&&this._gl.uniform4iv(this._location,r)},E.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,o=0;t>o;++o){var a=e[o];s.equalsArray(a,i,n)||(s.pack(a,i,n),r=!0),n+=4}r&&this._gl.uniformMatrix2fv(this._location,!1,i)},S.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,o=0;t>o;++o){var a=e[o];l.equalsArray(a,i,n)||(l.pack(a,i,n),r=!0),n+=9}r&&this._gl.uniformMatrix3fv(this._location,!1,i)},w.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,o=0;t>o;++o){var a=e[o];u.equalsArray(a,i,n)||(u.pack(a,i,n),r=!0),n+=16}r&&this._gl.uniformMatrix4fv(this._location,!1,i)},h}),i("Renderer/ShaderProgram",["../Core/defaultValue","../Core/defined","../Core/definedNotNull","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/RuntimeError","./AutomaticUniforms","./ContextLimits","./createUniform","./createUniformArray"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e){var t=p(e.vertexShaderText,e.fragmentShaderText);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=t.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=t.fragmentShaderText,this.id=C++}function d(e){var t=[],r=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(i(r))for(var n=r.length,o=0;n>o;o++){var a=r[o].trim(),s=a.slice(a.lastIndexOf(" ")+1);t.push(s)}return t}function p(e,t){var i={};if(!l.highpFloatSupported||!l.highpIntSupported){var r,n,o,a,s=d(e),u=d(t),c=s.length,h=u.length;for(r=0;c>r;r++)for(n=0;h>n;n++)if(s[r]===u[n]){o=s[r],a="czm_mediump_"+o;var p=new RegExp(o+"\\b","g");t=t.replace(p,a),i[a]=o}}return{fragmentShaderText:t,duplicateUniformNames:i}}function m(e,i){var r=i._vertexShaderText,n=i._fragmentShaderText,o=e.createShader(e.VERTEX_SHADER);e.shaderSource(o,r),e.compileShader(o);var s=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(s,n),e.compileShader(s);var l=e.createProgram();e.attachShader(l,o),e.attachShader(l,s),e.deleteShader(o),e.deleteShader(s);var u=i._attributeLocations;if(t(u))for(var c in u)u.hasOwnProperty(c)&&e.bindAttribLocation(l,u[c],c);e.linkProgram(l);var h;if(!e.getProgramParameter(l,e.LINK_STATUS)){var d=i._debugShaders;if(!e.getShaderParameter(s,e.COMPILE_STATUS)){if(h=e.getShaderInfoLog(s),console.error(E+"Fragment shader compile log: "+h),t(d)){var p=d.getTranslatedShaderSource(s);""!==p?console.error(E+"Translated fragment shader source:\n"+p):console.error(E+"Fragment shader translation failed.")}throw e.deleteProgram(l),new a("Fragment shader failed to compile. Compile log: "+h)}if(!e.getShaderParameter(o,e.COMPILE_STATUS)){if(h=e.getShaderInfoLog(o),console.error(E+"Vertex shader compile log: "+h),t(d)){var m=d.getTranslatedShaderSource(o);""!==m?console.error(E+"Translated vertex shader source:\n"+m):console.error(E+"Vertex shader translation failed.")}throw e.deleteProgram(l),new a("Vertex shader failed to compile. Compile log: "+h)}throw h=e.getProgramInfoLog(l),console.error(E+"Shader program link log: "+h),t(d)&&(console.error(E+"Translated vertex shader source:\n"+d.getTranslatedShaderSource(o)),console.error(E+"Translated fragment shader source:\n"+d.getTranslatedShaderSource(s))),e.deleteProgram(l),new a("Program failed to link. Link log: "+h)}var f=i._logShaderCompilation;return f&&(h=e.getShaderInfoLog(o),t(h)&&h.length>0&&console.log(E+"Vertex shader compile log: "+h)),f&&(h=e.getShaderInfoLog(s),t(h)&&h.length>0&&console.log(E+"Fragment shader compile log: "+h)),f&&(h=e.getProgramInfoLog(l),t(h)&&h.length>0&&console.log(E+"Shader program link log: "+h)),l}function f(e,t,i){for(var r={},n=0;i>n;++n){var o=e.getActiveAttrib(t,n),a=e.getAttribLocation(t,o.name);r[o.name]={name:o.name,type:o.type,index:a}}return r}function v(e,i){for(var r={},n=[],o=[],a=e.getProgramParameter(i,e.ACTIVE_UNIFORMS),s=0;a>s;++s){var l=e.getActiveUniform(i,s),h="[0]",d=-1!==l.name.indexOf(h,l.name.length-h.length)?l.name.slice(0,l.name.length-3):l.name;if(0!==d.indexOf("gl_"))if(l.name.indexOf("[")<0){var p=e.getUniformLocation(i,d);if(null!==p){var m=u(e,l,d,p);r[d]=m,n.push(m),m._setSampler&&o.push(m)}}else{var f,v,g,_,y=d.indexOf("[");if(y>=0){if(f=r[d.slice(0,y)],!t(f))continue;v=f._locations,v.length<=1&&(g=f.value,_=e.getUniformLocation(i,d),null!==_&&(v.push(_),g.push(e.getUniform(i,_))))}else{v=[];for(var C=0;Co;++o)r=i[o]._setSampler(r);return e.useProgram(null),r}function y(e){if(!t(e._program)){var i=e._gl,r=m(i,e,e._debugShaders),n=i.getProgramParameter(r,i.ACTIVE_ATTRIBUTES),o=v(i,r),a=g(e,o.uniformsByName);e._program=r,e._numberOfVertexAttributes=n,e._vertexAttributes=f(i,r,n),e._uniformsByName=o.uniformsByName,e._uniforms=o.uniforms,e._automaticUniforms=a.automaticUniforms,e._manualUniforms=a.manualUniforms,e.maximumTextureUnitIndex=_(i,r,o.samplerUniforms)}}var C=0;h.fromCache=function(t){return t=e(t,e.EMPTY_OBJECT),t.context.shaderCache.getShaderProgram(t)},h.replaceCache=function(t){return t=e(t,e.EMPTY_OBJECT),t.context.shaderCache.replaceShaderProgram(t)},r(h.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return y(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return y(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return y(this),this._uniformsByName}}});var E="[Cesium WebGL] ";return h.prototype._bind=function(){y(this),this._gl.useProgram(this._program)},h.prototype._setUniforms=function(e,i,r){var n,a;if(t(e)){var s=this._manualUniforms;for(n=s.length,a=0;n>a;++a){var l=s[a];l.value=e[l.name]()}}var u=this._automaticUniforms;for(n=u.length,a=0;n>a;++a){var c=u[a];c.uniform.value=c.automaticUniform.getValue(i)}var h=this._uniforms;for(n=h.length,a=0;n>a;++a)h[a].set();if(r){var d=this._gl,p=this._program;if(d.validateProgram(p),!d.getProgramParameter(p,d.VALIDATE_STATUS))throw new o("Program validation failed. Program info log: "+d.getProgramInfoLog(p))}},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)},h.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),n(this)},h}),i("Shaders/Builtin/Constants/degreesPerRadian",[],function(){"use strict";return"const float czm_degreesPerRadian = 57.29577951308232;\n"}),i("Shaders/Builtin/Constants/depthRange",[],function(){"use strict";return"const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);\n"}),i("Shaders/Builtin/Constants/epsilon1",[],function(){"use strict";return"const float czm_epsilon1 = 0.1;\n"}),i("Shaders/Builtin/Constants/epsilon2",[],function(){"use strict";return"const float czm_epsilon2 = 0.01;\n"}),i("Shaders/Builtin/Constants/epsilon3",[],function(){"use strict";return"const float czm_epsilon3 = 0.001;\n"}),i("Shaders/Builtin/Constants/epsilon4",[],function(){"use strict";return"const float czm_epsilon4 = 0.0001;\n"}),i("Shaders/Builtin/Constants/epsilon5",[],function(){"use strict";return"const float czm_epsilon5 = 0.00001;\n"}),i("Shaders/Builtin/Constants/epsilon6",[],function(){"use strict";return"const float czm_epsilon6 = 0.000001;\n"}),i("Shaders/Builtin/Constants/epsilon7",[],function(){"use strict";return"const float czm_epsilon7 = 0.0000001;\n"}),i("Shaders/Builtin/Constants/infinity",[],function(){"use strict";return"const float czm_infinity = 5906376272000.0;\n"}),i("Shaders/Builtin/Constants/oneOverPi",[],function(){"use strict";return"const float czm_oneOverPi = 0.3183098861837907;\n"}),i("Shaders/Builtin/Constants/oneOverTwoPi",[],function(){"use strict";return"const float czm_oneOverTwoPi = 0.15915494309189535;\n"}),i("Shaders/Builtin/Constants/pi",[],function(){"use strict";return"const float czm_pi = 3.141592653589793;\n"}),i("Shaders/Builtin/Constants/piOverFour",[],function(){"use strict";return"const float czm_piOverFour = 0.7853981633974483;\n"}),i("Shaders/Builtin/Constants/piOverSix",[],function(){"use strict";return"const float czm_piOverSix = 0.5235987755982988;\n"}),i("Shaders/Builtin/Constants/piOverThree",[],function(){"use strict";return"const float czm_piOverThree = 1.0471975511965976;\n"}),i("Shaders/Builtin/Constants/piOverTwo",[],function(){"use strict";return"const float czm_piOverTwo = 1.5707963267948966;\n"}),i("Shaders/Builtin/Constants/radiansPerDegree",[],function(){"use strict";return"const float czm_radiansPerDegree = 0.017453292519943295;\n"}),i("Shaders/Builtin/Constants/sceneMode2D",[],function(){"use strict";return"const float czm_sceneMode2D = 2.0;\n"}),i("Shaders/Builtin/Constants/sceneMode3D",[],function(){"use strict";return"const float czm_sceneMode3D = 3.0;\n"}),i("Shaders/Builtin/Constants/sceneModeColumbusView",[],function(){"use strict";return"const float czm_sceneModeColumbusView = 1.0;\n"}),i("Shaders/Builtin/Constants/sceneModeMorphing",[],function(){"use strict";return"const float czm_sceneModeMorphing = 0.0;\n"}),i("Shaders/Builtin/Constants/solarRadius",[],function(){"use strict";return"const float czm_solarRadius = 695500000.0;\n"}),i("Shaders/Builtin/Constants/threePiOver2",[],function(){"use strict";return"const float czm_threePiOver2 = 4.71238898038469;\n"}),i("Shaders/Builtin/Constants/twoPi",[],function(){"use strict";return"const float czm_twoPi = 6.283185307179586;\n"}),i("Shaders/Builtin/Constants/webMercatorMaxLatitude",[],function(){"use strict";return"const float czm_webMercatorMaxLatitude = 1.4844222297453324;\n"}),i("Shaders/Builtin/Structs/depthRangeStruct",[],function(){"use strict";return"struct czm_depthRangeStruct\n{\nfloat near;\nfloat far;\n};\n"}),i("Shaders/Builtin/Structs/ellipsoid",[],function(){"use strict";return"struct czm_ellipsoid\n{\nvec3 center;\nvec3 radii;\nvec3 inverseRadii;\nvec3 inverseRadiiSquared;\n};\n"}),i("Shaders/Builtin/Structs/material",[],function(){"use strict";return"struct czm_material\n{\nvec3 diffuse;\nfloat specular;\nfloat shininess;\nvec3 normal;\nvec3 emission;\nfloat alpha;\n};\n"}),i("Shaders/Builtin/Structs/materialInput",[],function(){"use strict";return"struct czm_materialInput\n{\nfloat s;\nvec2 st;\nvec3 str;\nvec3 normalEC;\nmat3 tangentToEyeMatrix;\nvec3 positionToEyeEC;\n};\n"}),i("Shaders/Builtin/Structs/ray",[],function(){"use strict";return"struct czm_ray\n{\nvec3 origin;\nvec3 direction;\n};\n"}),i("Shaders/Builtin/Structs/raySegment",[],function(){"use strict";return"struct czm_raySegment\n{\nfloat start;\nfloat stop;\n};\nconst czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity);\nconst czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity);\n"}),i("Shaders/Builtin/Functions/alphaWeight",[],function(){"use strict";return"float czm_alphaWeight(float a)\n{\nfloat z;\nif (czm_sceneMode != czm_sceneMode2D)\n{\nfloat x = 2.0 * (gl_FragCoord.x - czm_viewport.x) / czm_viewport.z - 1.0;\nfloat y = 2.0 * (gl_FragCoord.y - czm_viewport.y) / czm_viewport.w - 1.0;\nz = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\nvec4 q = vec4(x, y, z, 0.0);\nq /= gl_FragCoord.w;\nz = (czm_inverseProjectionOIT * q).z;\n}\nelse\n{\nz = gl_FragCoord.z * (czm_currentFrustum.y - czm_currentFrustum.x) + czm_currentFrustum.x;\n}\nreturn pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 100.0 / (1e-5 + pow(abs(z) / 10.0, 3.0) + pow(abs(z) / 200.0, 6.0))));\n}\n"}),i("Shaders/Builtin/Functions/antialias",[],function(){"use strict";return"vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor)\n{\nfloat val1 = clamp(dist / fuzzFactor, 0.0, 1.0);\nfloat val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0);\nval1 = val1 * (1.0 - val2);\nval1 = val1 * val1 * (3.0 - (2.0 * val1));\nval1 = pow(val1, 0.5);\nvec4 midColor = (color1 + color2) * 0.5;\nreturn mix(midColor, currentColor, val1);\n}\nvec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist)\n{\nreturn czm_antialias(color1, color2, currentColor, dist, 0.1);\n}\n"}),i("Shaders/Builtin/Functions/columbusViewMorph",[],function(){"use strict";return"vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)\n{\nvec3 p = mix(position2D.xyz, position3D.xyz, time);\nreturn vec4(p, 1.0);\n}\n"}),i("Shaders/Builtin/Functions/computePosition",[],function(){"use strict";return"vec4 czm_computePosition();\n"}),i("Shaders/Builtin/Functions/cosineAndSine",[],function(){"use strict";return"vec2 cordic(float angle)\n{\nvec2 vector = vec2(6.0725293500888267e-1, 0.0);\nfloat sense = (angle < 0.0) ? -1.0 : 1.0;\nmat2 rotation = mat2(1.0, sense, -sense, 1.0);\nvector = rotation * vector;\nangle -= sense * 7.8539816339744828e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfloat factor = sense * 5.0e-1;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 4.6364760900080609e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 2.5e-1;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 2.4497866312686414e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.25e-1;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.2435499454676144e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 6.25e-2;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 6.2418809995957350e-2;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.125e-2;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.1239833430268277e-2;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.5625e-2;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.5623728620476831e-2;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 7.8125e-3;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 7.8123410601011111e-3;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.90625e-3;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.9062301319669718e-3;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.953125e-3;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.9531225164788188e-3;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 9.765625e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 9.7656218955931946e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 4.8828125e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 4.8828121119489829e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 2.44140625e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 2.4414062014936177e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.220703125e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.2207031189367021e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 6.103515625e-5;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 6.1035156174208773e-5;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.0517578125e-5;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.0517578115526096e-5;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.52587890625e-5;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.5258789061315762e-5;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 7.62939453125e-6;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 7.6293945311019700e-6;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.814697265625e-6;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.8146972656064961e-6;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.9073486328125e-6;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.9073486328101870e-6;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 9.5367431640625e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 9.5367431640596084e-7;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 4.76837158203125e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 4.7683715820308884e-7;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 2.384185791015625e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 2.3841857910155797e-7;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.1920928955078125e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nreturn vector;\n}\nvec2 czm_cosineAndSine(float angle)\n{\nif (angle < -czm_piOverTwo || angle > czm_piOverTwo)\n{\nif (angle < 0.0)\n{\nreturn -cordic(angle + czm_pi);\n}\nelse\n{\nreturn -cordic(angle - czm_pi);\n}\n}\nelse\n{\nreturn cordic(angle);\n}\n}\n"}),i("Shaders/Builtin/Functions/decompressTextureCoordinates",[],function(){"use strict";return"vec2 czm_decompressTextureCoordinates(float encoded)\n{\nfloat temp = encoded / 4096.0;\nfloat stx = floor(temp) / 4096.0;\nfloat sty = temp - floor(temp);\nreturn vec2(stx, sty);\n}\n"}),i("Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates",[],function(){"use strict";return"mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)\n{\nvec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0));\nvec3 tangentEC = normalize(czm_normal3D * tangentMC);\nvec3 bitangentEC = normalize(cross(normalEC, tangentEC));\nreturn mat3(\ntangentEC.x, tangentEC.y, tangentEC.z,\nbitangentEC.x, bitangentEC.y, bitangentEC.z,\nnormalEC.x, normalEC.y, normalEC.z);\n}\n"}),i("Shaders/Builtin/Functions/ellipsoidContainsPoint",[],function(){"use strict";return"bool czm_ellipsoidContainsPoint(czm_ellipsoid ellipsoid, vec3 point)\n{\nvec3 scaled = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;\nreturn (dot(scaled, scaled) <= 1.0);\n}\n"}),i("Shaders/Builtin/Functions/ellipsoidNew",[],function(){"use strict";return"czm_ellipsoid czm_ellipsoidNew(vec3 center, vec3 radii)\n{\nvec3 inverseRadii = vec3(1.0 / radii.x, 1.0 / radii.y, 1.0 / radii.z);\nvec3 inverseRadiiSquared = inverseRadii * inverseRadii;\nczm_ellipsoid temp = czm_ellipsoid(center, radii, inverseRadii, inverseRadiiSquared);\nreturn temp;\n}\n"}),i("Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates",[],function(){"use strict";return"vec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal)\n{\nreturn vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);\n}\n"}),i("Shaders/Builtin/Functions/equalsEpsilon",[],function(){"use strict";return"bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec4(epsilon)));\n}\nbool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec3(epsilon)));\n}\nbool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec2(epsilon)));\n}\nbool czm_equalsEpsilon(float left, float right, float epsilon) {\nreturn (abs(left - right) <= epsilon);\n}\n"}),i("Shaders/Builtin/Functions/eyeOffset",[],function(){"use strict";return"vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)\n{\nvec4 p = positionEC;\nvec4 zEyeOffset = normalize(p) * eyeOffset.z;\np.xy += eyeOffset.xy + zEyeOffset.xy;\np.z += zEyeOffset.z;\nreturn p;\n}\n"}),i("Shaders/Builtin/Functions/eyeToWindowCoordinates",[],function(){"use strict";return"vec4 czm_eyeToWindowCoordinates(vec4 positionEC)\n{\nvec4 q = czm_projection * positionEC;\nq.xyz /= q.w;\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\nreturn q;\n}\n"}),i("Shaders/Builtin/Functions/fog",[],function(){"use strict";return"vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor)\n{\nfloat scalar = distanceToCamera * czm_fogDensity;\nfloat fog = 1.0 - exp(-(scalar * scalar));\nreturn mix(color, fogColor, fog);\n}\n"}),i("Shaders/Builtin/Functions/geodeticSurfaceNormal",[],function(){"use strict";return"vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)\n{\nreturn normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);\n}\n"}),i("Shaders/Builtin/Functions/getDefaultMaterial",[],function(){"use strict";return"czm_material czm_getDefaultMaterial(czm_materialInput materialInput)\n{\nczm_material material;\nmaterial.diffuse = vec3(0.0);\nmaterial.specular = 0.0;\nmaterial.shininess = 1.0;\nmaterial.normal = materialInput.normalEC;\nmaterial.emission = vec3(0.0);\nmaterial.alpha = 1.0;\nreturn material;\n}\n"}),i("Shaders/Builtin/Functions/getLambertDiffuse",[],function(){"use strict";return"float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)\n{\nreturn max(dot(lightDirectionEC, normalEC), 0.0);\n}\n"}),i("Shaders/Builtin/Functions/getSpecular",[],function(){"use strict";return"float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)\n{\nvec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);\nfloat specular = max(dot(toReflectedLight, toEyeEC), 0.0);\nreturn pow(specular, shininess);\n}\n"}),i("Shaders/Builtin/Functions/getWaterNoise",[],function(){"use strict";return"vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)\n{\nfloat cosAngle = cos(angleInRadians);\nfloat sinAngle = sin(angleInRadians);\nvec2 s0 = vec2(1.0/17.0, 0.0);\nvec2 s1 = vec2(-1.0/29.0, 0.0);\nvec2 s2 = vec2(1.0/101.0, 1.0/59.0);\nvec2 s3 = vec2(-1.0/109.0, -1.0/57.0);\ns0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));\ns1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));\ns2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));\ns3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));\nvec2 uv0 = (uv/103.0) + (time * s0);\nvec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);\nvec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);\nvec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);\nuv0 = fract(uv0);\nuv1 = fract(uv1);\nuv2 = fract(uv2);\nuv3 = fract(uv3);\nvec4 noise = (texture2D(normalMap, uv0)) +\n(texture2D(normalMap, uv1)) +\n(texture2D(normalMap, uv2)) +\n(texture2D(normalMap, uv3));\nreturn ((noise / 4.0) - 0.5) * 2.0;\n}\n"}),i("Shaders/Builtin/Functions/getWgs84EllipsoidEC",[],function(){"use strict";return"czm_ellipsoid czm_getWgs84EllipsoidEC()\n{\nvec3 radii = vec3(6378137.0, 6378137.0, 6356752.314245);\nvec3 inverseRadii = vec3(1.0 / radii.x, 1.0 / radii.y, 1.0 / radii.z);\nvec3 inverseRadiiSquared = inverseRadii * inverseRadii;\nczm_ellipsoid temp = czm_ellipsoid(czm_view[3].xyz, radii, inverseRadii, inverseRadiiSquared);\nreturn temp;\n}\n"}),i("Shaders/Builtin/Functions/hue",[],function(){"use strict";return"vec3 czm_hue(vec3 rgb, float adjustment)\n{\nconst mat3 toYIQ = mat3(0.299, 0.587, 0.114,\n0.595716, -0.274453, -0.321263,\n0.211456, -0.522591, 0.311135);\nconst mat3 toRGB = mat3(1.0, 0.9563, 0.6210,\n1.0, -0.2721, -0.6474,\n1.0, -1.107, 1.7046);\nvec3 yiq = toYIQ * rgb;\nfloat hue = atan(yiq.z, yiq.y) + adjustment;\nfloat chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);\nvec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));\nreturn toRGB * color;\n}\n"}),i("Shaders/Builtin/Functions/isEmpty",[],function(){"use strict";return"bool czm_isEmpty(czm_raySegment interval)\n{\nreturn (interval.stop < 0.0);\n}\n"}),i("Shaders/Builtin/Functions/isFull",[],function(){"use strict";return"bool czm_isFull(czm_raySegment interval)\n{\nreturn (interval.start == 0.0 && interval.stop == czm_infinity);\n}\n"}),i("Shaders/Builtin/Functions/latitudeToWebMercatorFraction",[],function(){"use strict";return"float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight)\n{\nfloat sinLatitude = sin(latitude);\nfloat mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));\nreturn (mercatorY - southMercatorY) * oneOverMercatorHeight;\n}\n"; -}),i("Shaders/Builtin/Functions/luminance",[],function(){"use strict";return"float czm_luminance(vec3 rgb)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nreturn dot(rgb, W);\n}\n"}),i("Shaders/Builtin/Functions/metersPerPixel",[],function(){"use strict";return"float czm_metersPerPixel(vec4 positionEC)\n{\nfloat width = czm_viewport.z;\nfloat height = czm_viewport.w;\nfloat pixelWidth;\nfloat pixelHeight;\nfloat top = czm_frustumPlanes.x;\nfloat bottom = czm_frustumPlanes.y;\nfloat left = czm_frustumPlanes.z;\nfloat right = czm_frustumPlanes.w;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nfloat frustumWidth = right - left;\nfloat frustumHeight = top - bottom;\npixelWidth = frustumWidth / width;\npixelHeight = frustumHeight / height;\n}\nelse\n{\nfloat distanceToPixel = -positionEC.z;\nfloat inverseNear = 1.0 / czm_currentFrustum.x;\nfloat tanTheta = top * inverseNear;\npixelHeight = 2.0 * distanceToPixel * tanTheta / height;\ntanTheta = right * inverseNear;\npixelWidth = 2.0 * distanceToPixel * tanTheta / width;\n}\nreturn max(pixelWidth, pixelHeight);\n}\n"}),i("Shaders/Builtin/Functions/modelToWindowCoordinates",[],function(){"use strict";return"vec4 czm_modelToWindowCoordinates(vec4 position)\n{\nvec4 q = czm_modelViewProjection * position;\nq.xyz /= q.w;\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\nreturn q;\n}\n"}),i("Shaders/Builtin/Functions/multiplyWithColorBalance",[],function(){"use strict";return"vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvec3 target = left * right;\nfloat leftLuminance = dot(left, W);\nfloat rightLuminance = dot(right, W);\nfloat targetLuminance = dot(target, W);\nreturn ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;\n}\n"}),i("Shaders/Builtin/Functions/nearFarScalar",[],function(){"use strict";return"float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq)\n{\nfloat valueAtMin = nearFarScalar.y;\nfloat valueAtMax = nearFarScalar.w;\nfloat nearDistanceSq = nearFarScalar.x * nearFarScalar.x;\nfloat farDistanceSq = nearFarScalar.z * nearFarScalar.z;\nfloat t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);\nt = pow(clamp(t, 0.0, 1.0), 0.2);\nreturn mix(valueAtMin, valueAtMax, t);\n}\n"}),i("Shaders/Builtin/Functions/octDecode",[],function(){"use strict";return"vec3 czm_octDecode(vec2 encoded)\n{\nencoded = encoded / 255.0 * 2.0 - 1.0;\nvec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y));\nif (v.z < 0.0)\n{\nv.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy);\n}\nreturn normalize(v);\n}\nvec3 czm_octDecode(float encoded)\n{\nfloat temp = encoded / 256.0;\nfloat x = floor(temp);\nfloat y = (temp - x) * 256.0;\nreturn czm_octDecode(vec2(x, y));\n}\nvoid czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3)\n{\nfloat temp = encoded.x / 65536.0;\nfloat x = floor(temp);\nfloat encodedFloat1 = (temp - x) * 65536.0;\ntemp = encoded.y / 65536.0;\nfloat y = floor(temp);\nfloat encodedFloat2 = (temp - y) * 65536.0;\nvector1 = czm_octDecode(encodedFloat1);\nvector2 = czm_octDecode(encodedFloat2);\nvector3 = czm_octDecode(vec2(x, y));\n}\n"}),i("Shaders/Builtin/Functions/packDepth",[],function(){"use strict";return"vec4 czm_packDepth(float depth)\n{\nvec4 enc = vec4(1.0, 255.0, 65025.0, 160581375.0) * depth;\nenc = fract(enc);\nenc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\nreturn enc;\n}\n"}),i("Shaders/Builtin/Functions/phong",[],function(){"use strict";return"float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)\n{\nreturn czm_getLambertDiffuse(lightDirectionEC, material.normal);\n}\nfloat czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)\n{\nreturn czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);\n}\nvec4 czm_phong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);\nif (czm_sceneMode == czm_sceneMode3D) {\ndiffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\n}\nfloat specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material) + czm_private_getSpecularOfMaterial(czm_moonDirectionEC, toEye, material);\nvec3 materialDiffuse = material.diffuse * 0.5;\nvec3 ambient = materialDiffuse;\nvec3 color = ambient + material.emission;\ncolor += materialDiffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\nvec4 czm_private_phong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(czm_sunDirectionEC, material);\nfloat specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material);\nvec3 ambient = vec3(0.0);\nvec3 color = ambient + material.emission;\ncolor += material.diffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\n"}),i("Shaders/Builtin/Functions/pointAlongRay",[],function(){"use strict";return"vec3 czm_pointAlongRay(czm_ray ray, float time)\n{\nreturn ray.origin + (time * ray.direction);\n}\n"}),i("Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval",[],function(){"use strict";return"czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, czm_ellipsoid ellipsoid)\n{\nvec3 q = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;\nvec3 w = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;\nq = q - ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ellipsoid.center, 1.0)).xyz;\nfloat q2 = dot(q, q);\nfloat qw = dot(q, w);\nif (q2 > 1.0)\n{\nif (qw >= 0.0)\n{\nreturn czm_emptyRaySegment;\n}\nelse\n{\nfloat qw2 = qw * qw;\nfloat difference = q2 - 1.0;\nfloat w2 = dot(w, w);\nfloat product = w2 * difference;\nif (qw2 < product)\n{\nreturn czm_emptyRaySegment;\n}\nelse if (qw2 > product)\n{\nfloat discriminant = qw * qw - product;\nfloat temp = -qw + sqrt(discriminant);\nfloat root0 = temp / w2;\nfloat root1 = difference / temp;\nif (root0 < root1)\n{\nczm_raySegment i = czm_raySegment(root0, root1);\nreturn i;\n}\nelse\n{\nczm_raySegment i = czm_raySegment(root1, root0);\nreturn i;\n}\n}\nelse\n{\nfloat root = sqrt(difference / w2);\nczm_raySegment i = czm_raySegment(root, root);\nreturn i;\n}\n}\n}\nelse if (q2 < 1.0)\n{\nfloat difference = q2 - 1.0;\nfloat w2 = dot(w, w);\nfloat product = w2 * difference;\nfloat discriminant = qw * qw - product;\nfloat temp = -qw + sqrt(discriminant);\nczm_raySegment i = czm_raySegment(0.0, temp / w2);\nreturn i;\n}\nelse\n{\nif (qw < 0.0)\n{\nfloat w2 = dot(w, w);\nczm_raySegment i = czm_raySegment(0.0, -qw / w2);\nreturn i;\n}\nelse\n{\nreturn czm_emptyRaySegment;\n}\n}\n}\n"}),i("Shaders/Builtin/Functions/RGBToXYZ",[],function(){"use strict";return"vec3 czm_RGBToXYZ(vec3 rgb)\n{\nconst mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,\n0.3576, 0.7152, 0.1192,\n0.1805, 0.0722, 0.9505);\nvec3 xyz = RGB2XYZ * rgb;\nvec3 Yxy;\nYxy.r = xyz.g;\nfloat temp = dot(vec3(1.0), xyz);\nYxy.gb = xyz.rg / temp;\nreturn Yxy;\n}\n"}),i("Shaders/Builtin/Functions/saturation",[],function(){"use strict";return"vec3 czm_saturation(vec3 rgb, float adjustment)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvec3 intensity = vec3(dot(rgb, W));\nreturn mix(intensity, rgb, adjustment);\n}\n"}),i("Shaders/Builtin/Functions/signNotZero",[],function(){"use strict";return"float czm_signNotZero(float value)\n{\nreturn value >= 0.0 ? 1.0 : -1.0;\n}\nvec2 czm_signNotZero(vec2 value)\n{\nreturn vec2(czm_signNotZero(value.x), czm_signNotZero(value.y));\n}\nvec3 czm_signNotZero(vec3 value)\n{\nreturn vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z));\n}\nvec4 czm_signNotZero(vec4 value)\n{\nreturn vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w));\n}\n"}),i("Shaders/Builtin/Functions/tangentToEyeSpaceMatrix",[],function(){"use strict";return"mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 binormalEC)\n{\nvec3 normal = normalize(normalEC);\nvec3 tangent = normalize(tangentEC);\nvec3 binormal = normalize(binormalEC);\nreturn mat3(tangent.x, tangent.y, tangent.z,\nbinormal.x, binormal.y, binormal.z,\nnormal.x, normal.y, normal.z);\n}\n"}),i("Shaders/Builtin/Functions/translateRelativeToEye",[],function(){"use strict";return"vec4 czm_translateRelativeToEye(vec3 high, vec3 low)\n{\nvec3 highDifference = high - czm_encodedCameraPositionMCHigh;\nvec3 lowDifference = low - czm_encodedCameraPositionMCLow;\nreturn vec4(highDifference + lowDifference, 1.0);\n}\n"}),i("Shaders/Builtin/Functions/translucentPhong",[],function(){"use strict";return"vec4 czm_translucentPhong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);\nif (czm_sceneMode == czm_sceneMode3D) {\ndiffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);\n}\ndiffuse = clamp(diffuse, 0.0, 1.0);\nfloat specular = czm_getSpecular(czm_sunDirectionEC, toEye, material.normal, material.shininess);\nspecular += czm_getSpecular(czm_moonDirectionEC, toEye, material.normal, material.shininess);\nvec3 materialDiffuse = material.diffuse * 0.5;\nvec3 ambient = materialDiffuse;\nvec3 color = ambient + material.emission;\ncolor += materialDiffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\n"}),i("Shaders/Builtin/Functions/transpose",[],function(){"use strict";return"mat2 czm_transpose(mat2 matrix)\n{\nreturn mat2(\nmatrix[0][0], matrix[1][0],\nmatrix[0][1], matrix[1][1]);\n}\nmat3 czm_transpose(mat3 matrix)\n{\nreturn mat3(\nmatrix[0][0], matrix[1][0], matrix[2][0],\nmatrix[0][1], matrix[1][1], matrix[2][1],\nmatrix[0][2], matrix[1][2], matrix[2][2]);\n}\nmat4 czm_transpose(mat4 matrix)\n{\nreturn mat4(\nmatrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],\nmatrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],\nmatrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],\nmatrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);\n}\n"}),i("Shaders/Builtin/Functions/unpackDepth",[],function(){"use strict";return"float czm_unpackDepth(vec4 packedDepth)\n{\nreturn dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 160581375.0));\n}\n"}),i("Shaders/Builtin/Functions/windowToEyeCoordinates",[],function(){"use strict";return"vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)\n{\nfloat x = 2.0 * (fragmentCoordinate.x - czm_viewport.x) / czm_viewport.z - 1.0;\nfloat y = 2.0 * (fragmentCoordinate.y - czm_viewport.y) / czm_viewport.w - 1.0;\nfloat z = (fragmentCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\nvec4 q = vec4(x, y, z, 1.0);\nq /= fragmentCoordinate.w;\nq = czm_inverseProjection * q;\nreturn q;\n}\n"}),i("Shaders/Builtin/Functions/XYZToRGB",[],function(){"use strict";return"vec3 czm_XYZToRGB(vec3 Yxy)\n{\nconst mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556,\n-1.5371, 1.8760, -0.2040,\n-0.4985, 0.0416, 1.0572);\nvec3 xyz;\nxyz.r = Yxy.r * Yxy.g / Yxy.b;\nxyz.g = Yxy.r;\nxyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;\nreturn XYZ2RGB * xyz;\n}\n"}),i("Shaders/Builtin/CzmBuiltins",["./Constants/degreesPerRadian","./Constants/depthRange","./Constants/epsilon1","./Constants/epsilon2","./Constants/epsilon3","./Constants/epsilon4","./Constants/epsilon5","./Constants/epsilon6","./Constants/epsilon7","./Constants/infinity","./Constants/oneOverPi","./Constants/oneOverTwoPi","./Constants/pi","./Constants/piOverFour","./Constants/piOverSix","./Constants/piOverThree","./Constants/piOverTwo","./Constants/radiansPerDegree","./Constants/sceneMode2D","./Constants/sceneMode3D","./Constants/sceneModeColumbusView","./Constants/sceneModeMorphing","./Constants/solarRadius","./Constants/threePiOver2","./Constants/twoPi","./Constants/webMercatorMaxLatitude","./Structs/depthRangeStruct","./Structs/ellipsoid","./Structs/material","./Structs/materialInput","./Structs/ray","./Structs/raySegment","./Functions/alphaWeight","./Functions/antialias","./Functions/columbusViewMorph","./Functions/computePosition","./Functions/cosineAndSine","./Functions/decompressTextureCoordinates","./Functions/eastNorthUpToEyeCoordinates","./Functions/ellipsoidContainsPoint","./Functions/ellipsoidNew","./Functions/ellipsoidWgs84TextureCoordinates","./Functions/equalsEpsilon","./Functions/eyeOffset","./Functions/eyeToWindowCoordinates","./Functions/fog","./Functions/geodeticSurfaceNormal","./Functions/getDefaultMaterial","./Functions/getLambertDiffuse","./Functions/getSpecular","./Functions/getWaterNoise","./Functions/getWgs84EllipsoidEC","./Functions/hue","./Functions/isEmpty","./Functions/isFull","./Functions/latitudeToWebMercatorFraction","./Functions/luminance","./Functions/metersPerPixel","./Functions/modelToWindowCoordinates","./Functions/multiplyWithColorBalance","./Functions/nearFarScalar","./Functions/octDecode","./Functions/packDepth","./Functions/phong","./Functions/pointAlongRay","./Functions/rayEllipsoidIntersectionInterval","./Functions/RGBToXYZ","./Functions/saturation","./Functions/signNotZero","./Functions/tangentToEyeSpaceMatrix","./Functions/translateRelativeToEye","./Functions/translucentPhong","./Functions/transpose","./Functions/unpackDepth","./Functions/windowToEyeCoordinates","./Functions/XYZToRGB"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O,N,L,F,B,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,he,de,pe,me,fe,ve,ge,_e,ye,Ce,Ee){"use strict";return{czm_degreesPerRadian:e,czm_depthRange:t,czm_epsilon1:i,czm_epsilon2:r,czm_epsilon3:n,czm_epsilon4:o,czm_epsilon5:a,czm_epsilon6:s,czm_epsilon7:l,czm_infinity:u,czm_oneOverPi:c,czm_oneOverTwoPi:h,czm_pi:d,czm_piOverFour:p,czm_piOverSix:m,czm_piOverThree:f,czm_piOverTwo:v,czm_radiansPerDegree:g,czm_sceneMode2D:_,czm_sceneMode3D:y,czm_sceneModeColumbusView:C,czm_sceneModeMorphing:E,czm_solarRadius:S,czm_threePiOver2:w,czm_twoPi:T,czm_webMercatorMaxLatitude:x,czm_depthRangeStruct:b,czm_ellipsoid:A,czm_material:P,czm_materialInput:I,czm_ray:M,czm_raySegment:D,czm_alphaWeight:R,czm_antialias:O,czm_columbusViewMorph:N,czm_computePosition:L,czm_cosineAndSine:F,czm_decompressTextureCoordinates:B,czm_eastNorthUpToEyeCoordinates:V,czm_ellipsoidContainsPoint:k,czm_ellipsoidNew:z,czm_ellipsoidWgs84TextureCoordinates:U,czm_equalsEpsilon:G,czm_eyeOffset:W,czm_eyeToWindowCoordinates:H,czm_fog:q,czm_geodeticSurfaceNormal:j,czm_getDefaultMaterial:Y,czm_getLambertDiffuse:X,czm_getSpecular:Z,czm_getWaterNoise:K,czm_getWgs84EllipsoidEC:Q,czm_hue:J,czm_isEmpty:$,czm_isFull:ee,czm_latitudeToWebMercatorFraction:te,czm_luminance:ie,czm_metersPerPixel:re,czm_modelToWindowCoordinates:ne,czm_multiplyWithColorBalance:oe,czm_nearFarScalar:ae,czm_octDecode:se,czm_packDepth:le,czm_phong:ue,czm_pointAlongRay:ce,czm_rayEllipsoidIntersectionInterval:he,czm_RGBToXYZ:de,czm_saturation:pe,czm_signNotZero:me,czm_tangentToEyeSpaceMatrix:fe,czm_translateRelativeToEye:ve,czm_translucentPhong:ge,czm_transpose:_e,czm_unpackDepth:ye,czm_windowToEyeCoordinates:Ce,czm_XYZToRGB:Ee}}),i("Renderer/ShaderSource",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Shaders/Builtin/CzmBuiltins","./AutomaticUniforms"],function(e,t,i,r,n){"use strict";function o(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(e){for(var t=e.match(/\n/gm).length,i="",r=0;t>r;++r)i+="\n";return i})}function a(e,i,r){for(var n,a=0;a0;){var n=e.pop();r.push(n),0===n.requiredBy.length&&t.push(n)}for(;t.length>0;){var o=t.shift();e.push(o);for(var a=0;a=0;--n)r=r+t[n].glslSource+"\n";return r.replace(i.glslSource,"")}function c(e,r){var n,a,s="",l=e.sources;if(t(l))for(n=0,a=l.length;a>n;++n)s+="\n#line 0\n"+l[n];s=o(s);var c;s=s.replace(/#version\s+(.*?)\n/gm,function(e,r){if(t(c)&&c!==r)throw new i("inconsistent versions found: "+c+" and "+r);return c=r,"\n"}),s=s.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");var d=e.pickColorQualifier;t(d)&&(s=h.createPickFragmentShaderSource(s,d));var p="";t(c)&&(p="#version "+c),r&&(p+="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n\n");var m=e.defines;if(t(m))for(n=0,a=m.length;a>n;++n){var f=m[n];0!==f.length&&(p+="#define "+f+"\n")}return e.includeBuiltIns&&(p+=u(s)),p+="\n#line 0\n",p+=s}function h(i){i=e(i,e.EMPTY_OBJECT);var r=i.pickColorQualifier;this.defines=t(i.defines)?i.defines.slice(0):[],this.sources=t(i.sources)?i.sources.slice(0):[],this.pickColorQualifier=r,this.includeBuiltIns=e(i.includeBuiltIns,!0)}h.prototype.clone=function(){return new h({sources:this.sources,defines:this.defines,pickColorQuantifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})},h.replaceMain=function(e,t){return t="void "+t+"()",e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)},h.prototype.createCombinedVertexShader=function(){return c(this,!1)},h.prototype.createCombinedFragmentShader=function(){return c(this,!0)},h._czmBuiltinsAndUniforms={};for(var d in r)r.hasOwnProperty(d)&&(h._czmBuiltinsAndUniforms[d]=r[d]);for(var p in n)if(n.hasOwnProperty(p)){var m=n[p];"function"==typeof m.getDeclaration&&(h._czmBuiltinsAndUniforms[p]=m.getDeclaration(p))}return h.createPickVertexShaderSource=function(e){var t=h.replaceMain(e,"czm_old_main"),i="attribute vec4 pickColor; \nvarying vec4 czm_pickColor; \nvoid main() \n{ \n czm_old_main(); \n czm_pickColor = pickColor; \n}";return t+"\n"+i},h.createPickFragmentShaderSource=function(e,t){var i=h.replaceMain(e,"czm_old_main"),r=t+" vec4 czm_pickColor; \nvoid main() \n{ \n czm_old_main(); \n if (gl_FragColor.a == 0.0) { \n discard; \n } \n gl_FragColor = czm_pickColor; \n}";return i+"\n"+r},h}),i("Renderer/VertexArray",["../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Geometry","../Core/IndexDatatype","../Core/Math","../Core/RuntimeError","./Buffer","./BufferUsage","./ContextLimits"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(r,n,o,a){var s=i(n.vertexBuffer),l=i(n.value),u=n.value?n.value.length:n.componentsPerAttribute,c={index:t(n.index,o),enabled:t(n.enabled,!0),vertexBuffer:n.vertexBuffer,value:l?n.value.slice(0):void 0,componentsPerAttribute:u,componentDatatype:t(n.componentDatatype,e.FLOAT),normalize:t(n.normalize,!1),offsetInBytes:t(n.offsetInBytes,0),strideInBytes:t(n.strideInBytes,0),instanceDivisor:t(n.instanceDivisor,0)};if(s)c.vertexAttrib=function(e){var t=this.index;e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),e.vertexAttribPointer(t,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),e.enableVertexAttribArray(t),this.instanceDivisor>0&&(a.glVertexAttribDivisor(t,this.instanceDivisor),a._vertexAttribDivisors[t]=this.instanceDivisor,a._previousDrawInstanced=!0)},c.disableVertexAttribArray=function(e){e.disableVertexAttribArray(this.index),this.instanceDivisor>0&&a.glVertexAttribDivisor(o,0)};else{switch(c.componentsPerAttribute){case 1:c.vertexAttrib=function(e){e.vertexAttrib1fv(this.index,this.value)};break;case 2:c.vertexAttrib=function(e){e.vertexAttrib2fv(this.index,this.value)};break;case 3:c.vertexAttrib=function(e){e.vertexAttrib3fv(this.index,this.value)};break;case 4:c.vertexAttrib=function(e){e.vertexAttrib4fv(this.index,this.value)}}c.disableVertexAttribArray=function(e){}}r.push(c)}function m(e,t,r){for(var n=0;nn;++n)p(u,s[n],n,o);for(d=u.length,n=0;d>n;++n){var f=u[n];if(i(f.vertexBuffer)&&0===f.instanceDivisor){var v=f.strideInBytes||f.componentsPerAttribute*e.getSizeInBytes(f.componentDatatype);c=f.vertexBuffer.sizeInBytes/v;break}}for(n=0;d>n;++n)if(u[n].instanceDivisor>0){h=!0;break}var g;o.vertexArrayObject&&(g=o.glCreateVertexArray(),o.glBindVertexArray(g),m(a,u,l),o.glBindVertexArray(null)),this._numberOfVertices=c,this._hasInstancedAttributes=h,this._context=o,this._gl=a,this._vao=g,this._attributes=u,this._indexBuffer=l}function v(e){return e.values.length/e.componentsPerAttribute}function g(t){return e.getSizeInBytes(t.componentDatatype)*t.componentsPerAttribute}function _(t){var r,n,o,a=[];for(n in t)t.hasOwnProperty(n)&&i(t[n])&&i(t[n].values)&&(a.push(n),t[n].componentDatatype===e.DOUBLE&&(t[n].componentDatatype=e.FLOAT,t[n].values=e.createTypedArray(e.FLOAT,t[n].values)));var s,l=a.length;if(l>0)for(s=v(t[a[0]]),r=1;l>r;++r){var c=v(t[a[r]]);if(c!==s)throw new u("Each attribute list must have the same number of vertices. Attribute "+a[r]+" has a different number of vertices ("+c.toString()+") than attribute "+a[0]+" ("+s.toString()+").")}a.sort(function(i,r){return e.getSizeInBytes(t[r].componentDatatype)-e.getSizeInBytes(t[i].componentDatatype)});var h=0,d={};for(r=0;l>r;++r)n=a[r],o=t[n],d[n]=h,h+=g(o);if(h>0){var p=e.getSizeInBytes(t[a[0]].componentDatatype),m=h%p;0!==m&&(h+=p-m);var f=s*h,_=new ArrayBuffer(f),y={};for(r=0;l>r;++r){n=a[r];var C=e.getSizeInBytes(t[n].componentDatatype);y[n]={pointer:e.createTypedArray(t[n].componentDatatype,_),index:d[n]/C,strideInComponentType:h/C}}for(r=0;s>r;++r)for(var E=0;l>E;++E){n=a[E],o=t[n];for(var S=o.values,w=y[n],T=w.pointer,x=o.componentsPerAttribute,b=0;x>b;++b)T[w.index+b]=S[r*x+b];w.index+=w.strideInComponentType}return{buffer:_,offsetsInBytes:d,vertexSizeInBytes:h}}}function y(e){var t=e._context,i=e._hasInstancedAttributes;if(i||t._previousDrawInstanced){t._previousDrawInstanced=i;var r,n=t._vertexAttribDivisors,o=e._attributes,a=d.maximumVertexAttributes;if(i){var s=o.length;for(r=0;s>r;++r){var l=o[r];if(l.enabled){var u=l.instanceDivisor,c=l.index;u!==n[c]&&(t.glVertexAttribDivisor(c,u),n[c]=u)}}}else for(r=0;a>r;++r)n[r]>0&&(t.glVertexAttribDivisor(r,0),n[r]=0)}}return f.fromGeometry=function(r){r=t(r,t.EMPTY_OBJECT);var n,o,u,d=r.context,p=t(r.geometry,t.EMPTY_OBJECT),m=t(r.bufferUsage,h.DYNAMIC_DRAW),v=t(r.attributeLocations,t.EMPTY_OBJECT),g=t(r.interleave,!1),y=r.vertexArrayAttributes,C=i(y)?y:[],E=p.attributes;if(g){var S=_(E);if(i(S)){u=c.createVertexBuffer({context:d,typedArray:S.buffer,usage:m});var w=S.offsetsInBytes,T=S.vertexSizeInBytes;for(n in E)E.hasOwnProperty(n)&&i(E[n])&&(o=E[n],i(o.values)?C.push({index:v[n],vertexBuffer:u,componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,offsetInBytes:w[n],strideInBytes:T}):C.push({index:v[n],value:o.value,componentDatatype:o.componentDatatype,normalize:o.normalize}))}}else for(n in E)if(E.hasOwnProperty(n)&&i(E[n])){o=E[n];var x=o.componentDatatype;x===e.DOUBLE&&(x=e.FLOAT),u=void 0,i(o.values)&&(u=c.createVertexBuffer({context:d,typedArray:e.createTypedArray(x,o.values),usage:m})),C.push({index:v[n],vertexBuffer:u,value:o.value,componentDatatype:x,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize})}var b,A=p.indices;return i(A)&&(b=a.computeNumberOfVertices(p)>=l.SIXTY_FOUR_KILOBYTES&&d.elementIndexUint?c.createIndexBuffer({context:d,typedArray:new Uint32Array(A),usage:m,indexDatatype:s.UNSIGNED_INT}):c.createIndexBuffer({context:d,typedArray:new Uint16Array(A),usage:m,indexDatatype:s.UNSIGNED_SHORT})),new f({context:d,attributes:C,indexBuffer:b})},r(f.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}}),f.prototype.getAttribute=function(e){return this._attributes[e]},f.prototype._bind=function(){i(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&y(this)):m(this._gl,this._attributes,this._indexBuffer)},f.prototype._unBind=function(){if(i(this._vao))this._context.glBindVertexArray(null);else{for(var e=this._attributes,t=this._gl,r=0;rf;++f){var v=l[f];v.vertexBuffer?d.push(v):(h=v.usage,c=p[h],i(c)||(c=p[h]=[]),c.push(v))}this._allBuffers=[];for(h in p)if(p.hasOwnProperty(h)){c=p[h],c.sort(s);var g=u._vertexSizeInBytes(c),_=c[0].usage,y={vertexSizeInBytes:g,vertexBuffer:void 0,usage:_,needsCommit:!1,arrayBuffer:void 0,arrayViews:u._createArrayViews(c,g)};this._allBuffers.push(y)}this._size=0,this._instanced=t(a,!1),this._precreated=d,this._context=r,this.writers=void 0,this.va=void 0,this.resize(o)}function c(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;var r=t.vertexBuffer,n=e._size*t.vertexSizeInBytes,o=i(r);if(!o||r.sizeInBytes0){var r=e.vertexSizeInBytes*t,n=e.vertexSizeInBytes*i;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,r,n),r)}}function d(e){var t=e.va;if(i(t)){for(var r=t.length,n=0;r>n;++n)t[n].va.destroy();e.va=void 0}}u._verifyAttributes=function(i){for(var r=[],o=0;on;++n){var o=t[n];i+=o.componentsPerAttribute*e.getSizeInBytes(o.componentDatatype)}var a=r>0?e.getSizeInBytes(t[0].componentDatatype):0,s=a>0?i%a:0,l=0===s?0:a-s;return i+=l},u._createArrayViews=function(t,i){for(var r=[],n=0,o=t.length,a=0;o>a;++a){var s=t[a],l=s.componentDatatype;r.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:l,normalize:s.normalize,offsetInBytes:n,vertexSizeInComponentType:i/e.getSizeInBytes(l),view:void 0}),n+=s.componentsPerAttribute*e.getSizeInBytes(l)}return r},u.prototype.resize=function(e){this._size=e;var t=this._allBuffers;this.writers=[];for(var i=0,r=t.length;r>i;++i){var n=t[i];u._resize(n,this._size),u._appendWriters(this.writers,n)}d(this)},u._resize=function(t,r){if(t.vertexSizeInBytes>0){var n=new ArrayBuffer(r*t.vertexSizeInBytes);if(i(t.arrayBuffer))for(var o=new Uint8Array(n),a=new Uint8Array(t.arrayBuffer),s=a.length,l=0;s>l;++l)o[l]=a[l];for(var u=t.arrayViews,c=u.length,h=0;c>h;++h){var d=u[h];d.view=e.createArrayBufferView(d.componentDatatype,n,d.offsetInBytes)}t.arrayBuffer=n}};var p=[function(e,t,i){return function(r,n){t[r*i]=n,e.needsCommit=!0}},function(e,t,i){return function(r,n,o){var a=r*i;t[a]=n,t[a+1]=o,e.needsCommit=!0}},function(e,t,i){return function(r,n,o,a){var s=r*i;t[s]=n,t[s+1]=o,t[s+2]=a,e.needsCommit=!0}},function(e,t,i){return function(r,n,o,a,s){var l=r*i;t[l]=n,t[l+1]=o,t[l+2]=a,t[l+3]=s,e.needsCommit=!0}}];return u._appendWriters=function(e,t){for(var i=t.arrayViews,r=i.length,n=0;r>n;++n){var o=i[n];e[o.index]=p[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}},u.prototype.commit=function(e){var t,r,n,a=!1,s=this._allBuffers;for(r=0,n=s.length;n>r;++r)t=s[r],a=c(this,t)||a;if(a||!i(this.va)){d(this);for(var h=this.va=[],p=i(e)?Math.ceil(this._size/(o.SIXTY_FOUR_KILOBYTES-1)):1,m=0;p>m;++m){var f=[];for(r=0,n=s.length;n>r;++r){t=s[r];var v=m*(t.vertexSizeInBytes*(o.SIXTY_FOUR_KILOBYTES-1));u._appendAttributes(f,t,v,this._instanced)}f=f.concat(this._precreated),h.push({va:new l({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(m!==p-1?o.SIXTY_FOUR_KILOBYTES-1:this._size%(o.SIXTY_FOUR_KILOBYTES-1))})}}},u._appendAttributes=function(e,t,i,r){for(var n=t.arrayViews,o=n.length,a=0;o>a;++a){var s=n[a];e.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:s.componentDatatype,normalize:s.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:i+s.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:r?1:0})}},u.prototype.subCommit=function(e,t){for(var i=this._allBuffers,r=0,n=i.length;n>r;++r)h(i[r],e,t)},u.prototype.endSubCommits=function(){for(var e=this._allBuffers,t=0,i=e.length;i>t;++t)e[t].needsCommit=!1},u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){for(var e=this._allBuffers,t=0,i=e.length;i>t;++t){var n=e[t];n.vertexBuffer=n.vertexBuffer&&n.vertexBuffer.destroy()}return d(this),r(this)},u}),i("Shaders/BillboardCollectionFS",[],function(){"use strict";return"uniform sampler2D u_atlas;\nvarying vec2 v_textureCoordinates;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#else\nvarying vec4 v_color;\n#endif\nvoid main()\n{\n#ifdef RENDER_FOR_PICK\nvec4 vertexColor = vec4(1.0, 1.0, 1.0, 1.0);\n#else\nvec4 vertexColor = v_color;\n#endif\nvec4 color = texture2D(u_atlas, v_textureCoordinates) * vertexColor;\nif (color.a == 0.0)\n{\ndiscard;\n}\n#ifdef RENDER_FOR_PICK\ngl_FragColor = v_pickColor;\n#else\ngl_FragColor = color;\n#endif\n}\n"}),i("Shaders/BillboardCollectionVS",[],function(){"use strict";return"#ifdef INSTANCED\nattribute vec2 direction;\n#endif\nattribute vec4 positionHighAndScale;\nattribute vec4 positionLowAndRotation;\nattribute vec4 compressedAttribute0;\nattribute vec4 compressedAttribute1;\nattribute vec4 compressedAttribute2;\nattribute vec4 eyeOffset;\nattribute vec4 scaleByDistance;\nattribute vec4 pixelOffsetScaleByDistance;\nvarying vec2 v_textureCoordinates;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#else\nvarying vec4 v_color;\n#endif\nconst float UPPER_BOUND = 32768.0;\nconst float SHIFT_LEFT16 = 65536.0;\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_LEFT7 = 128.0;\nconst float SHIFT_LEFT5 = 32.0;\nconst float SHIFT_LEFT3 = 8.0;\nconst float SHIFT_LEFT2 = 4.0;\nconst float SHIFT_LEFT1 = 2.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nconst float SHIFT_RIGHT7 = 1.0 / 128.0;\nconst float SHIFT_RIGHT5 = 1.0 / 32.0;\nconst float SHIFT_RIGHT3 = 1.0 / 8.0;\nconst float SHIFT_RIGHT2 = 1.0 / 4.0;\nconst float SHIFT_RIGHT1 = 1.0 / 2.0;\nvec4 computePositionWindowCoordinates(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, float rotation, bool sizeInMeters)\n{\nvec2 halfSize = imageSize * scale * czm_resolutionScale;\nhalfSize *= ((direction * 2.0) - 1.0);\nif (sizeInMeters)\n{\npositionEC.xy += halfSize;\n}\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nif (sizeInMeters)\n{\npositionWC.xy += (origin * abs(halfSize)) / czm_metersPerPixel(positionEC);\n}\nelse\n{\npositionWC.xy += (origin * abs(halfSize));\n}\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\nif (!all(equal(alignedAxis, vec3(0.0))) || rotation != 0.0)\n{\nfloat angle = rotation;\nif (!all(equal(alignedAxis, vec3(0.0))))\n{\nvec3 pos = positionEC.xyz + czm_encodedCameraPositionMCHigh + czm_encodedCameraPositionMCLow;\nvec3 normal = normalize(cross(alignedAxis, pos));\nvec4 tangent = vec4(normalize(cross(pos, normal)), 0.0);\ntangent = czm_modelViewProjection * tangent;\nangle += sign(-tangent.x) * acos(tangent.y / length(tangent.xy));\n}\nfloat cosTheta = cos(angle);\nfloat sinTheta = sin(angle);\nmat2 rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);\nhalfSize = rotationMatrix * halfSize;\n}\n#endif\nif (!sizeInMeters)\n{\npositionWC.xy += halfSize;\n}\npositionWC.xy += translate;\npositionWC.xy += (pixelOffset * czm_resolutionScale);\nreturn positionWC;\n}\nvoid main()\n{\nvec3 positionHigh = positionHighAndScale.xyz;\nvec3 positionLow = positionLowAndRotation.xyz;\nfloat scale = positionHighAndScale.w;\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\nfloat rotation = positionLowAndRotation.w;\n#else\nfloat rotation = 0.0;\n#endif\nfloat compressed = compressedAttribute0.x;\nvec2 pixelOffset;\npixelOffset.x = floor(compressed * SHIFT_RIGHT7);\ncompressed -= pixelOffset.x * SHIFT_LEFT7;\npixelOffset.x -= UPPER_BOUND;\nvec2 origin;\norigin.x = floor(compressed * SHIFT_RIGHT5);\ncompressed -= origin.x * SHIFT_LEFT5;\norigin.y = floor(compressed * SHIFT_RIGHT3);\ncompressed -= origin.y * SHIFT_LEFT3;\norigin -= vec2(1.0);\nfloat show = floor(compressed * SHIFT_RIGHT2);\ncompressed -= show * SHIFT_LEFT2;\n#ifdef INSTANCED\nvec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w);\nvec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w);\nvec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;\n#else\nvec2 direction;\ndirection.x = floor(compressed * SHIFT_RIGHT1);\ndirection.y = compressed - direction.x * SHIFT_LEFT1;\nvec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w);\n#endif\nfloat temp = compressedAttribute0.y * SHIFT_RIGHT8;\npixelOffset.y = -(floor(temp) - UPPER_BOUND);\nvec2 translate;\ntranslate.y = (temp - floor(temp)) * SHIFT_LEFT16;\ntemp = compressedAttribute0.z * SHIFT_RIGHT8;\ntranslate.x = floor(temp) - UPPER_BOUND;\ntranslate.y += (temp - floor(temp)) * SHIFT_LEFT8;\ntranslate.y -= UPPER_BOUND;\ntemp = compressedAttribute1.x * SHIFT_RIGHT8;\nvec2 imageSize = vec2(floor(temp), compressedAttribute2.w);\n#ifdef EYE_DISTANCE_TRANSLUCENCY\nvec4 translucencyByDistance;\ntranslucencyByDistance.x = compressedAttribute1.z;\ntranslucencyByDistance.z = compressedAttribute1.w;\ntranslucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\ntemp = compressedAttribute1.y * SHIFT_RIGHT8;\ntranslucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n#endif\n#ifdef ALIGNED_AXIS\nvec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8));\n#else\nvec3 alignedAxis = vec3(0.0);\n#endif\n#ifdef RENDER_FOR_PICK\ntemp = compressedAttribute2.y;\n#else\ntemp = compressedAttribute2.x;\n#endif\nvec4 color;\ntemp = temp * SHIFT_RIGHT8;\ncolor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\ncolor.g = (temp - floor(temp)) * SHIFT_LEFT8;\ncolor.r = floor(temp);\ntemp = compressedAttribute2.z * SHIFT_RIGHT8;\nbool sizeInMeters = (temp - floor(temp)) * SHIFT_LEFT8 > 0.0;\ntemp = floor(temp) * SHIFT_RIGHT8;\n#ifdef RENDER_FOR_PICK\ncolor.a = (temp - floor(temp)) * SHIFT_LEFT8;\nvec4 pickColor = color / 255.0;\n#else\ncolor.a = floor(temp);\ncolor /= 255.0;\n#endif\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\npositionEC = czm_eyeOffset(positionEC, eyeOffset.xyz);\npositionEC.xyz *= show;\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET)\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\n}\n#endif\n#ifdef EYE_DISTANCE_SCALING\nscale *= czm_nearFarScalar(scaleByDistance, lengthSq);\nif (scale == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nfloat translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\ntranslucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\nif (translucency == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\n#ifdef EYE_DISTANCE_PIXEL_OFFSET\nfloat pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq);\npixelOffset *= pixelOffsetScale;\n#endif\n#ifdef CLAMPED_TO_GROUND\npositionEC.z *= 0.995;\norigin.y = 1.0;\n#endif\nvec4 positionWC = computePositionWindowCoordinates(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, rotation, sizeInMeters);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\nv_textureCoordinates = textureCoordinates;\n#ifdef RENDER_FOR_PICK\nv_pickColor = pickColor;\n#else\nv_color = color;\nv_color.a *= translucency;\n#endif\n}\n"; -}),i("Scene/HeightReference",["../Core/freezeObject"],function(e){"use strict";var t={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2};return e(t)}),i("Scene/HorizontalOrigin",["../Core/freezeObject"],function(e){"use strict";var t={CENTER:0,LEFT:1,RIGHT:-1};return e(t)}),i("Scene/SceneMode",["../Core/freezeObject"],function(e){"use strict";var t={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};return t.getMorphTime=function(e){if(e===t.SCENE3D)return 1;if(e!==t.MORPHING)return 0},e(t)}),i("Scene/SceneTransforms",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defined","../Core/DeveloperError","../Core/Math","../Core/Matrix4","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u){"use strict";var c={},h=new r(0,0,0,1),d=new r,p=new l;c.wgs84ToWindowCoordinates=function(e,t,i){var n=c.computeActualWgs84Position(e.frameState,t,h);if(o(n)){var a=e.camera,s=l.multiply(a.frustum.projectionMatrix,a.viewMatrix,p);if(l.multiplyByVector(s,r.fromElements(n.x,n.y,n.z,1,d),d),!(d.z<0&&e.mode!==u.SCENE2D))return i=c.clipToGLWindowCoordinates(e,d,i),i.y=e.canvas.clientHeight-i.y,i}},c.wgs84ToDrawingBufferCoordinates=function(e,t,i){var n=c.computeActualWgs84Position(e.frameState,t,h);if(o(n)){var a=e.camera,s=l.multiply(a.frustum.projectionMatrix,a.viewMatrix,p);if(l.multiplyByVector(s,r.fromElements(n.x,n.y,n.z,1,d),d),!(d.z<0&&e.mode!==u.SCENE2D))return c.clipToDrawingBufferCoordinates(e,d,i)}};var m=new i,f=new n;c.computeActualWgs84Position=function(e,t,r){var n=e.mode;if(n===u.SCENE3D)return i.clone(t,r);var a=e.mapProjection,l=a.ellipsoid.cartesianToCartographic(t,f);if(o(l)){if(a.project(l,m),n===u.COLUMBUS_VIEW)return i.fromElements(m.z,m.x,m.y,r);if(n===u.SCENE2D)return i.fromElements(0,m.x,m.y,r);var c=e.morphTime;return i.fromElements(s.lerp(m.z,t.x,c),s.lerp(m.x,t.y,c),s.lerp(m.y,t.z,c),r)}};var v=new i,g=new i,_=new e,y=new l;c.clipToGLWindowCoordinates=function(e,r,n){var o=e.canvas;return i.divideByScalar(r,r.w,v),_.width=o.clientWidth,_.height=o.clientHeight,l.computeViewportTransformation(_,0,1,y),l.multiplyByPoint(y,v,g),t.fromCartesian3(g,n)},c.clipToDrawingBufferCoordinates=function(r,n,o){return i.divideByScalar(n,n.w,v),e.clone(r._passState.viewport,_),l.computeViewportTransformation(_,0,1,y),l.multiplyByPoint(y,v,g),t.fromCartesian3(g,o)},c.transformWindowToDrawingBuffer=function(e,i,r){var n=e.canvas,o=e.drawingBufferWidth/n.clientWidth,a=e.drawingBufferHeight/n.clientHeight;return t.fromElements(i.x*o,i.y*a,r)};var C=new r,E=new r;return c.drawingBufferToWgs84Coordinates=function(e,t,n,o){var a=e.context,s=a.uniformState,u=e._passState.viewport,c=r.clone(r.UNIT_W,C);c.x=(t.x-u.x)/u.width*2-1,c.y=(t.y-u.y)/u.height*2-1,c.z=2*n-1,c.w=1;var h=l.multiplyByVector(s.inverseViewProjection,c,E),d=1/h.w;return i.multiplyByScalar(h,d,h),i.fromCartesian4(h,o)},c}),i("Scene/VerticalOrigin",["../Core/freezeObject"],function(e){"use strict";var t={CENTER:0,BOTTOM:1,TOP:-1};return e(t)}),i("Scene/Billboard",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","../Core/NearFarScalar","./HeightReference","./HorizontalOrigin","./SceneMode","./SceneTransforms","./VerticalOrigin"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g){"use strict";function _(e,r){e=s(e,s.EMPTY_OBJECT),this._show=s(e.show,!0),this._position=i.clone(s(e.position,i.ZERO)),this._actualPosition=i.clone(this._position),this._pixelOffset=t.clone(s(e.pixelOffset,t.ZERO)),this._translate=new t(0,0),this._eyeOffset=i.clone(s(e.eyeOffset,i.ZERO)),this._verticalOrigin=s(e.verticalOrigin,g.CENTER),this._horizontalOrigin=s(e.horizontalOrigin,m.CENTER),this._scale=s(e.scale,1),this._color=o.clone(s(e.color,o.WHITE)),this._rotation=s(e.rotation,0),this._alignedAxis=i.clone(s(e.alignedAxis,i.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=e.scaleByDistance,this._translucencyByDistance=e.translucencyByDistance,this._pixelOffsetScaleByDistance=e.pixelOffsetScaleByDistance,this._heightReference=s(e.heightReference,p.NONE),this._sizeInMeters=s(e.sizeInMeters,!1),this._id=e.id,this._collection=s(e.collection,r),this._pickId=void 0,this._pickPrimitive=s(e._pickPrimitive,this),this._billboardCollection=r,this._dirty=!1,this._index=-1,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0;var n=e.image,u=e.imageId;l(n)&&(l(u)||(u="string"==typeof n?n:l(n.src)?n.src:a()),this._imageId=u,this._image=n),l(e.imageSubRegion)&&(this._imageId=u,this._imageSubRegion=e.imageSubRegion),l(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=f.SCENE3D,this._updateClamping()}function y(e,t){var i=e._billboardCollection;l(i)&&(i._updateBillboard(e,t),e._dirty=!0)}var C=_.SHOW_INDEX=0,E=_.POSITION_INDEX=1,S=_.PIXEL_OFFSET_INDEX=2,w=_.EYE_OFFSET_INDEX=3,T=_.HORIZONTAL_ORIGIN_INDEX=4,x=_.VERTICAL_ORIGIN_INDEX=5,b=_.SCALE_INDEX=6,A=_.IMAGE_INDEX_INDEX=7,P=_.COLOR_INDEX=8,I=_.ROTATION_INDEX=9,M=_.ALIGNED_AXIS_INDEX=10,D=_.SCALE_BY_DISTANCE_INDEX=11,R=_.TRANSLUCENCY_BY_DISTANCE_INDEX=12,O=_.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13;_.NUMBER_OF_PROPERTIES=14,u(_.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,y(this,C))}},position:{get:function(){return this._position},set:function(e){var t=this._position;i.equals(t,e)||(i.clone(e,t),i.clone(e,this._actualPosition),this._updateClamping(),y(this,E))}},heightReference:{get:function(){return this._heightReference},set:function(e){var t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),y(this,E))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){var i=this._pixelOffset;t.equals(i,e)||(t.clone(e,i),y(this,S))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;d.equals(t,e)||(this._scaleByDistance=d.clone(e,t),y(this,D))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;d.equals(t,e)||(this._translucencyByDistance=d.clone(e,t),y(this,R))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){var t=this._pixelOffsetScaleByDistance;d.equals(t,e)||(this._pixelOffsetScaleByDistance=d.clone(e,t),y(this,O))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){var t=this._eyeOffset;i.equals(t,e)||(i.clone(e,t),y(this,w))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,y(this,T))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,y(this,x))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,y(this,b))}},color:{get:function(){return this._color},set:function(e){var t=this._color;o.equals(t,e)||(o.clone(e,t),y(this,P))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,y(this,I))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){var t=this._alignedAxis;i.equals(t,e)||(i.clone(e,t),y(this,M))}},width:{get:function(){return s(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,y(this,A))}},height:{get:function(){return s(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,y(this,A))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,y(this,P))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},image:{get:function(){return this._imageId},set:function(e){l(e)?"string"==typeof e?this.setImage(e,e):l(e.src)?this.setImage(e.src,e):this.setImage(a(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,y(this,A))}},ready:{get:function(){return-1!==this._imageIndex}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=i.clone(e,this._actualClampedPosition),y(this,E)}}}),_.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId},_.prototype._updateClamping=function(){_._updateClamping(this._billboardCollection,this)};var N=new n,L=new i;_._updateClamping=function(e,t){function r(e){if(t._heightReference===p.RELATIVE_TO_GROUND)if(t._mode===f.SCENE3D){var r=s.cartesianToCartographic(e,N);r.height+=v.height,s.cartographicToCartesian(r,e)}else e.x+=v.height;t._clampedPosition=i.clone(e,t._clampedPosition)}var o=e._scene;if(l(o)){var a=o.globe,s=a.ellipsoid,u=a._surface,h=o.frameState.mode,d=o.frameState.mapProjection,m=h!==t._mode;if(t._mode=h,(t._heightReference===p.NONE||m)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference!==p.NONE&&l(t._position)){var v=s.cartesianToCartographic(t._position);if(l(v)){l(t._removeCallbackFunc)&&t._removeCallbackFunc(),t._removeCallbackFunc=u.updateHeight(v,r);var g=a.getHeight(v);l(g)&&(n.clone(v,N),N.height=g,t._mode===f.SCENE3D?s.cartographicToCartesian(N,L):(d.project(N,L),i.fromElements(L.z,L.x,L.y,L)),r(L))}}}else if(t._heightReference!==p.NONE)throw new c("Height reference is not supported.")},_.prototype._loadImage=function(){var t,i=this._billboardCollection._textureAtlas,r=this._imageId,n=this._image,o=this._imageSubRegion;if(l(n)&&(t=i.addImage(r,n)),l(o)&&(t=i.addSubRegion(r,o)),this._imageIndexPromise=t,l(t)){var a=this;t.then(function(t){if(a._imageId===r&&a._image===n&&e.equals(a._imageSubRegion,o)){var s=i.textureCoordinates[t];a._imageWidth=i.texture.width*s.width,a._imageHeight=i.texture.height*s.height,a._imageIndex=t,a._ready=!0,a._image=void 0,a._imageIndexPromise=void 0,y(a,A)}}).otherwise(function(e){console.error("Error loading image for billboard: "+e),a._imageIndexPromise=void 0})}},_.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,l(this._billboardCollection._textureAtlas)&&this._loadImage())},_.prototype.setImageSubRegion=function(t,i){this._imageId===t&&e.equals(this._imageSubRegion,i)||(this._imageIndex=-1,this._imageId=t,this._imageSubRegion=e.clone(i),l(this._billboardCollection._textureAtlas)&&this._loadImage())},_.prototype._setTranslate=function(e){var i=this._translate;t.equals(i,e)||(t.clone(e,i),y(this,S))},_.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition},_.prototype._setActualPosition=function(e){l(this._clampedPosition)||i.clone(e,this._actualPosition),y(this,E)};var F=new r;_._computeActualPosition=function(e,t,i,r){return l(e._clampedPosition)?(i.mode!==e._mode&&e._updateClamping(),e._clampedPosition):i.mode===f.SCENE3D?t:(h.multiplyByPoint(r,t,F),v.computeActualWgs84Position(i,F))};var B=new h,V=new r,k=new i,z=new t,U=new t;_._computeScreenSpacePosition=function(e,n,o,a,s,l){var u=s.camera,c=u.viewMatrix,d=u.frustum.projectionMatrix,p=h.multiplyTransformation(c,e,B),m=h.multiplyByVector(p,r.fromElements(n.x,n.y,n.z,1,V),V),f=i.multiplyComponents(o,i.normalize(m,k),k);m.x+=o.x+f.x,m.y+=o.y+f.y,m.z+=f.z;var g=h.multiplyByVector(d,m,V),_=v.clipToGLWindowCoordinates(s,g,l);a=t.clone(a,U),a.y=-a.y;var y=t.multiplyByScalar(a,s.context.uniformState.resolutionScale,z);return _.x+=y.x,_.y+=y.y,_};var G=new t(0,0);return _.prototype.computeScreenSpacePosition=function(e,i){var r=this._billboardCollection;l(i)||(i=new t),t.clone(this._pixelOffset,G),t.add(G,this._translate,G);var n=r.modelMatrix,o=this._getActualPosition(),a=_._computeScreenSpacePosition(n,o,this._eyeOffset,G,e,i);return a.y=e.canvas.clientHeight-a.y,a},_.prototype.equals=function(r){return this===r||l(r)&&this._id===r._id&&i.equals(this._position,r._position)&&this._imageId===r._imageId&&this._show===r._show&&this._scale===r._scale&&this._verticalOrigin===r._verticalOrigin&&this._horizontalOrigin===r._horizontalOrigin&&e.equals(this._imageSubRegion,r._imageSubRegion)&&o.equals(this._color,r._color)&&t.equals(this._pixelOffset,r._pixelOffset)&&t.equals(this._translate,r._translate)&&i.equals(this._eyeOffset,r._eyeOffset)&&d.equals(this._scaleByDistance,r._scaleByDistance)&&d.equals(this._translucencyByDistance,r._translucencyByDistance)&&d.equals(this._pixelOffsetScaleByDistance,r._pixelOffsetScaleByDistance)},_.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0},_}),i("Scene/BlendEquation",["../Core/freezeObject","../Renderer/WebGLConstants"],function(e,t){"use strict";var i={ADD:t.FUNC_ADD,SUBTRACT:t.FUNC_SUBTRACT,REVERSE_SUBTRACT:t.FUNC_REVERSE_SUBTRACT};return e(i)}),i("Scene/BlendFunction",["../Core/freezeObject","../Renderer/WebGLConstants"],function(e,t){"use strict";var i={ZERO:t.ZERO,ONE:t.ONE,SOURCE_COLOR:t.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:t.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:t.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:t.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:t.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:t.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:t.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:t.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:t.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:t.ONE_MINUS_CONSTANT_ALPHA,CONSTANT_ALPHA:t.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:t.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:t.SRC_ALPHA_SATURATE};return e(i)}),i("Scene/BlendingState",["../Core/freezeObject","./BlendEquation","./BlendFunction"],function(e,t,i){"use strict";var r={DISABLED:e({enabled:!1}),ALPHA_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:i.SOURCE_ALPHA,functionSourceAlpha:i.SOURCE_ALPHA,functionDestinationRgb:i.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:i.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:i.ONE,functionSourceAlpha:i.ONE,functionDestinationRgb:i.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:i.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:i.SOURCE_ALPHA,functionSourceAlpha:i.SOURCE_ALPHA,functionDestinationRgb:i.ONE,functionDestinationAlpha:i.ONE})};return e(r)}),i("Scene/Pass",["../Core/freezeObject"],function(e){"use strict";var t={COMPUTE:0,GLOBE:1,GROUND:2,OPAQUE:3,TRANSLUCENT:4,OVERLAY:5,NUMBER_OF_PASSES:6};return e(t)}),i("Renderer/Framebuffer",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/PixelFormat","./ContextLimits"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,i){var r=e._gl;r.framebufferTexture2D(r.FRAMEBUFFER,t,i._target,i._texture,0)}function l(e,t,i){var r=e._gl;r.framebufferRenderbuffer(r.FRAMEBUFFER,t,r.RENDERBUFFER,i._getRenderbuffer())}function u(i){i=e(i,e.EMPTY_OBJECT);var r=i.context._gl;a.maximumColorAttachments;this._gl=r,this._framebuffer=r.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=e(i.destroyAttachments,!0);t(i.depthTexture)||t(i.depthRenderbuffer),t(i.depthStencilTexture)||t(i.depthStencilRenderbuffer);this._bind();var n,o,u,c,h;if(t(i.colorTextures)){var d=i.colorTextures;for(c=this._colorTextures.length=this._activeColorAttachments.length=d.length,u=0;c>u;++u)n=d[u],h=this._gl.COLOR_ATTACHMENT0+u,s(this,h,n),this._activeColorAttachments[u]=h,this._colorTextures[u]=n}if(t(i.colorRenderbuffers)){var p=i.colorRenderbuffers;for(c=this._colorRenderbuffers.length=this._activeColorAttachments.length=p.length,u=0;c>u;++u)o=p[u],h=this._gl.COLOR_ATTACHMENT0+u,l(this,h,o),this._activeColorAttachments[u]=h,this._colorRenderbuffers[u]=o}t(i.depthTexture)&&(n=i.depthTexture,s(this,this._gl.DEPTH_ATTACHMENT,n),this._depthTexture=n),t(i.depthRenderbuffer)&&(o=i.depthRenderbuffer,l(this,this._gl.DEPTH_ATTACHMENT,o),this._depthRenderbuffer=o),t(i.stencilRenderbuffer)&&(o=i.stencilRenderbuffer,l(this,this._gl.STENCIL_ATTACHMENT,o),this._stencilRenderbuffer=o),t(i.depthStencilTexture)&&(n=i.depthStencilTexture,s(this,this._gl.DEPTH_STENCIL_ATTACHMENT,n),this._depthStencilTexture=n),t(i.depthStencilRenderbuffer)&&(o=i.depthStencilRenderbuffer,l(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilRenderbuffer=o),this._unBind()}return i(u.prototype,{status:{get:function(){this._bind();var e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}}),u.prototype._bind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)},u.prototype._unBind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)},u.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments},u.prototype.getColorTexture=function(e){return this._colorTextures[e]},u.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]},u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){if(this.destroyAttachments){for(var e=0,i=this._colorTextures,n=i.length;n>e;++e){var o=i[e];t(o)&&o.destroy()}var a=this._colorRenderbuffers;for(n=a.length,e=0;n>e;++e){var s=a[e];t(s)&&s.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),r(this)},u}),i("Renderer/MipmapHint",["../Core/freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={DONT_CARE:t.DONT_CARE,FASTEST:t.FASTEST,NICEST:t.NICEST,validate:function(e){return e===i.DONT_CARE||e===i.FASTEST||e===i.NICEST}};return e(i)}),i("Renderer/PixelDatatype",["../Core/freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={UNSIGNED_BYTE:t.UNSIGNED_BYTE,UNSIGNED_SHORT:t.UNSIGNED_SHORT,UNSIGNED_INT:t.UNSIGNED_INT,FLOAT:t.FLOAT,UNSIGNED_INT_24_8:t.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:t.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:t.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:t.UNSIGNED_SHORT_5_6_5,validate:function(e){return e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT||e===i.FLOAT||e===i.UNSIGNED_INT_24_8||e===i.UNSIGNED_SHORT_4_4_4_4||e===i.UNSIGNED_SHORT_5_5_5_1||e===i.UNSIGNED_SHORT_5_6_5}};return e(i)}),i("Renderer/TextureMagnificationFilter",["../Core/freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={NEAREST:t.NEAREST,LINEAR:t.LINEAR,validate:function(e){return e===i.NEAREST||e===i.LINEAR}};return e(i)}),i("Renderer/TextureMinificationFilter",["../Core/freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={NEAREST:t.NEAREST,LINEAR:t.LINEAR,NEAREST_MIPMAP_NEAREST:t.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:t.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:t.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:t.LINEAR_MIPMAP_LINEAR,validate:function(e){return e===i.NEAREST||e===i.LINEAR||e===i.NEAREST_MIPMAP_NEAREST||e===i.LINEAR_MIPMAP_NEAREST||e===i.NEAREST_MIPMAP_LINEAR||e===i.LINEAR_MIPMAP_LINEAR}};return e(i)}),i("Renderer/TextureWrap",["../Core/freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={CLAMP_TO_EDGE:t.CLAMP_TO_EDGE,REPEAT:t.REPEAT,MIRRORED_REPEAT:t.MIRRORED_REPEAT,validate:function(e){return e===i.CLAMP_TO_EDGE||e===i.REPEAT||e===i.MIRRORED_REPEAT}};return e(i)}),i("Renderer/Sampler",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap"],function(e,t,i,r,n,o,a){"use strict";function s(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.wrapS,a.CLAMP_TO_EDGE),s=e(i.wrapT,a.CLAMP_TO_EDGE),l=e(i.minificationFilter,o.LINEAR),u=e(i.magnificationFilter,n.LINEAR),c=t(i.maximumAnisotropy)?i.maximumAnisotropy:1;this._wrapS=r,this._wrapT=s,this._minificationFilter=l,this._magnificationFilter=u,this._maximumAnisotropy=c}return i(s.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}}),s}),i("Renderer/Texture",["../Core/Cartesian2","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","./ContextLimits","./MipmapHint","./PixelDatatype","./Sampler","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap","./WebGLConstants"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function v(r){r=t(r,t.EMPTY_OBJECT);var n=r.context,a=r.width,l=r.height,u=r.source;i(u)&&(i(a)||(a=t(u.videoWidth,u.width)),i(l)||(l=t(u.videoHeight,u.height)));var d=t(r.pixelFormat,s.RGBA),p=t(r.pixelDatatype,c.UNSIGNED_BYTE),m=d;if(n.webgl2&&(d===s.DEPTH_STENCIL?m=f.DEPTH24_STENCIL8:d===s.DEPTH_COMPONENT&&(p===c.UNSIGNED_SHORT?m=f.DEPTH_COMPONENT16:p===c.UNSIGNED_INT&&(m=f.DEPTH_COMPONENT24))),p===c.FLOAT&&!n.floatingPointTexture)throw new o("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension. Check context.floatingPointTexture.");if(s.isDepthFormat(d)&&!n.depthTexture)throw new o("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, this WebGL implementation must support WEBGL_depth_texture. Check context.depthTexture.");var v=r.preMultiplyAlpha||d===s.RGB||d===s.LUMINANCE,g=t(r.flipY,!0),_=n._gl,y=_.TEXTURE_2D,C=_.createTexture();_.activeTexture(_.TEXTURE0),_.bindTexture(y,C),i(u)?(_.pixelStorei(_.UNPACK_PREMULTIPLY_ALPHA_WEBGL,v),_.pixelStorei(_.UNPACK_FLIP_Y_WEBGL,g),i(u.arrayBufferView)?_.texImage2D(y,0,m,a,l,0,d,p,u.arrayBufferView):i(u.framebuffer)?(u.framebuffer!==n.defaultFramebuffer&&u.framebuffer._bind(),_.copyTexImage2D(y,0,m,u.xOffset,u.yOffset,a,l,0),u.framebuffer!==n.defaultFramebuffer&&u.framebuffer._unBind()):_.texImage2D(y,0,m,d,p,u)):_.texImage2D(y,0,m,a,l,0,d,p,null),_.bindTexture(y,null),this._context=n,this._textureFilterAnisotropic=n._textureFilterAnisotropic,this._textureTarget=y,this._texture=C,this._pixelFormat=d,this._pixelDatatype=p,this._width=a,this._height=l,this._dimensions=new e(a,l),this._preMultiplyAlpha=v,this._flipY=g,this._sampler=void 0,this.sampler=i(r.sampler)?r.sampler:new h}return v.fromFramebuffer=function(e){e=t(e,t.EMPTY_OBJECT);var r=e.context,n=r._gl,o=t(e.pixelFormat,s.RGB),a=t(e.framebufferXOffset,0),l=t(e.framebufferYOffset,0),u=t(e.width,n.drawingBufferWidth),c=t(e.height,n.drawingBufferHeight),h=e.framebuffer,d=new v({context:r,width:u,height:c,pixelFormat:o,source:{framebuffer:i(h)?h:r.defaultFramebuffer,xOffset:a,yOffset:l,width:u,height:c}});return d},r(v.prototype,{sampler:{get:function(){return this._sampler},set:function(e){var t=e.minificationFilter,r=e.magnificationFilter,n=t===p.NEAREST_MIPMAP_NEAREST||t===p.NEAREST_MIPMAP_LINEAR||t===p.LINEAR_MIPMAP_NEAREST||t===p.LINEAR_MIPMAP_LINEAR;this._pixelDatatype===c.FLOAT&&(t=n?p.NEAREST_MIPMAP_NEAREST:p.NEAREST,r=d.NEAREST);var o=this._context._gl,a=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(a,this._texture),o.texParameteri(a,o.TEXTURE_MIN_FILTER,t),o.texParameteri(a,o.TEXTURE_MAG_FILTER,r),o.texParameteri(a,o.TEXTURE_WRAP_S,e.wrapS),o.texParameteri(a,o.TEXTURE_WRAP_T,e.wrapT),i(this._textureFilterAnisotropic)&&o.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),o.bindTexture(a,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},_target:{get:function(){return this._textureTarget}}}),v.prototype.copyFrom=function(e,i,r){i=t(i,0),r=t(r,0);var n=this._context._gl,o=this._textureTarget;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._preMultiplyAlpha),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,this._flipY),n.activeTexture(n.TEXTURE0),n.bindTexture(o,this._texture),e.arrayBufferView?n.texSubImage2D(o,0,i,r,e.width,e.height,this._pixelFormat,this._pixelDatatype,e.arrayBufferView):n.texSubImage2D(o,0,i,r,this._pixelFormat,this._pixelDatatype,e),n.bindTexture(o,null)},v.prototype.copyFromFramebuffer=function(e,i,r,n,o,a){e=t(e,0),i=t(i,0),r=t(r,0),n=t(n,0),o=t(o,this._width),a=t(a,this._height);var s=this._context._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.copyTexSubImage2D(l,0,e,i,r,n,o,a),s.bindTexture(l,null)},v.prototype.generateMipmap=function(e){e=t(e,u.DONT_CARE);var i=this._context._gl,r=this._textureTarget;i.hint(i.GENERATE_MIPMAP_HINT,e),i.activeTexture(i.TEXTURE0),i.bindTexture(r,this._texture),i.generateMipmap(r),i.bindTexture(r,null)},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),n(this)},v}),i("Scene/TextureAtlas",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/loadImage","../Core/PixelFormat","../Core/RuntimeError","../Renderer/Framebuffer","../Renderer/RenderState","../Renderer/Texture","../ThirdParty/when"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e,i,n,o,a){this.bottomLeft=r(e,t.ZERO),this.topRight=r(i,t.ZERO),this.childNode1=n,this.childNode2=o,this.imageIndex=a}function v(e){e=r(e,r.EMPTY_OBJECT);var n=r(e.borderWidthInPixels,1),o=r(e.initialSize,C);this._context=e.context,this._pixelFormat=r(e.pixelFormat,u.RGBA),this._borderWidthInPixels=n,this._textureCoordinates=[],this._guid=i(),this._idHash={},this._texture=new p({context:this._context,width:o.x,height:o.y,pixelFormat:this._pixelFormat}),this._root=new f(new t,new t(o.x,o.y));var a=this,s={u_texture:function(){return a._texture}},l="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n gl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n";this._copyCommand=this._context.createViewportQuadCommand(l,{uniformMap:s})}function g(i,r){var o=i._context,a=i.numberOfImages,s=2;if(a>0){var l=i._texture.width,u=i._texture.height,c=s*(l+r.width+i._borderWidthInPixels),m=s*(u+r.height+i._borderWidthInPixels),v=l/c,g=u/m,_=new f(new t(l+i._borderWidthInPixels,0),new t(c,u)),y=new f(new t,new t(c,u),i._root,_),C=new f(new t(0,u+i._borderWidthInPixels),new t(c,m)),E=new f(new t,new t(c,m),y,C);i._root=E;for(var S=0;Ss||0>l)return;if(0===s&&0===l)return i;if(s>l){i.childNode1=new f(new t(i.bottomLeft.x,i.bottomLeft.y),new t(i.bottomLeft.x+r.width,i.topRight.y));var u=i.bottomLeft.x+r.width+e._borderWidthInPixels;ui;++i)e[i]&&e[i]._destroy()}function R(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;for(var t=[],i=e._billboards,r=i.length,n=0,o=0;r>n;++n){var a=i[n];a&&(a._index=o++,t.push(a))}e._billboards=t}}function O(e){var t=16384,i=e.cache.billboardCollection_indexBufferBatched;if(s(i))return i;for(var r=6*t-6,n=new Uint16Array(r),o=0,a=0;r>o;o+=6,a+=4)n[o]=a,n[o+1]=a+1,n[o+2]=a+2,n[o+3]=a+0,n[o+4]=a+2,n[o+5]=a+3;return i=f.createIndexBuffer({context:e,typedArray:n,usage:v.STATIC_DRAW,indexDatatype:d.UNSIGNED_SHORT}),i.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=i,i}function N(e){var t=e.cache.billboardCollection_indexBufferInstanced;return s(t)?t:(t=f.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:v.STATIC_DRAW,indexDatatype:d.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t,t)}function L(e){var t=e.cache.billboardCollection_vertexBufferInstanced;return s(t)?t:(t=f.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:v.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t,t)}function F(e,t,i,r){var n=[{index:X.positionHighAndScale,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[K]},{index:X.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[K]},{index:X.compressedAttribute0,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[Q]},{index:X.compressedAttribute1,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[se]},{index:X.compressedAttribute2,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[re]},{index:X.eyeOffset,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[J]},{index:X.scaleByDistance,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[ae]},{index:X.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[le]}];r&&n.push({index:X.direction,componentsPerAttribute:2,componentDatatype:o.FLOAT,vertexBuffer:L(e)});var a=r?t:4*t;return new E(e,n,a,r)}function B(e,i,r,n,o){var a,s=n[X.positionHighAndScale],l=n[X.positionLowAndRotation],u=o._getActualPosition();e._mode===P.SCENE3D&&(t.expand(e._baseVolume,u,e._baseVolume),e._boundingVolumeDirty=!0),h.fromCartesian(u,pe);var c=o.scale,d=o.rotation;0!==d&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,c);var p=pe.high,m=pe.low;e._instanced?(a=o._index,s(a,p.x,p.y,p.z,c),l(a,m.x,m.y,m.z,d)):(a=4*o._index,s(a+0,p.x,p.y,p.z,c),s(a+1,p.x,p.y,p.z,c),s(a+2,p.x,p.y,p.z,c),s(a+3,p.x,p.y,p.z,c),l(a+0,m.x,m.y,m.z,d),l(a+1,m.x,m.y,m.z,d),l(a+2,m.x,m.y,m.z,d),l(a+3,m.x,m.y,m.z,d))}function V(t,i,r,n,o){var a,s=n[X.compressedAttribute0],l=o.pixelOffset,u=l.x,c=l.y,h=o._translate,d=h.x,m=h.y;t._maxPixelOffset=Math.max(t._maxPixelOffset,Math.abs(u+d),Math.abs(-c+m));var f=o.horizontalOrigin,v=o.verticalOrigin,g=o.show;0===o.color.alpha&&(g=!1),t._allHorizontalCenter=t._allHorizontalCenter&&f===b.CENTER,t._allVerticalCenter=t._allVerticalCenter&&v===b.CENTER;var _=0,y=0,C=0,E=0,S=o._imageIndex;if(-1!==S){var w=r[S];_=w.x,y=w.y,C=w.width,E=w.height}var T=_+C,x=y+E,A=Math.floor(p.clamp(u,-fe,fe)+fe)*_e;A+=(f+1)*ye,A+=(v+1)*Ce,A+=(g?1:0)*Ee;var P=Math.floor(p.clamp(c,-fe,fe)+fe)*ge,I=Math.floor(p.clamp(d,-fe,fe)+fe)*ge,M=(p.clamp(m,-fe,fe)+fe)*Se,D=Math.floor(M),R=Math.floor((M-D)*ge);P+=D,I+=R,me.x=_,me.y=y;var O=e.compressTextureCoordinates(me);me.x=T;var N=e.compressTextureCoordinates(me);me.y=x;var L=e.compressTextureCoordinates(me);me.x=_;var F=e.compressTextureCoordinates(me);t._instanced?(a=o._index,s(a,A,P,I,O)):(a=4*o._index,s(a+0,A+we,P,I,O),s(a+1,A+Te,P,I,N),s(a+2,A+xe,P,I,L),s(a+3,A+be,P,I,F))}function k(t,i,n,o,l){var u,c=o[X.compressedAttribute1],h=l.alignedAxis;r.equals(h,r.ZERO)||(t._shaderAlignedAxis=!0);var d=0,m=1,f=1,v=1,g=l.translucencyByDistance;s(g)&&(d=g.near,m=g.nearValue,f=g.far,v=g.farValue,(1!==m||1!==v)&&(t._shaderTranslucencyByDistance=!0));var _=0,y=l._imageIndex;if(-1!==y){var C=n[y];_=C.width}var E=t._textureAtlas.texture.width,S=Math.ceil(.5*a(l.width,E*_));t._maxSize=Math.max(t._maxSize,S);var w=p.clamp(S,0,ve),T=0;Math.abs(r.magnitudeSquared(h)-1)c;++c){var h=i[c],d=h.position,p=T._computeActualPosition(h,d,n,o);s(p)&&(h._setActualPosition(p),a?u.push(p):t.expand(l,p,l))}a&&t.fromPoints(u,l)}function j(e,t){var i=t.mode,r=e._billboards,n=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==i||i!==P.SCENE3D&&!m.equals(o,e.modelMatrix)?(e._mode=i,m.clone(e.modelMatrix,o),e._createVertexArray=!0,(i===P.SCENE3D||i===P.SCENE2D||i===P.COLUMBUS_VIEW)&&q(e,r,r.length,t,o,!0)):i===P.MORPHING?q(e,r,r.length,t,o,!0):(i===P.SCENE2D||i===P.COLUMBUS_VIEW)&&q(e,n,e._billboardsToUpdateIndex,t,o,!1)}function Y(e,t,i){var r=1;e._allSizedInMeters&&0===e._maxPixelOffset||(r=t.camera.getPixelSize(i,t.context.drawingBufferWidth,t.context.drawingBufferHeight));var n=r*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(n*=.5);var o=r*e._maxPixelOffset+e._maxEyeOffset;i.radius+=n+o}var X,Z=T.SHOW_INDEX,K=T.POSITION_INDEX,Q=T.PIXEL_OFFSET_INDEX,J=T.EYE_OFFSET_INDEX,$=T.HORIZONTAL_ORIGIN_INDEX,ee=T.VERTICAL_ORIGIN_INDEX,te=T.SCALE_INDEX,ie=T.IMAGE_INDEX_INDEX,re=T.COLOR_INDEX,ne=T.ROTATION_INDEX,oe=T.ALIGNED_AXIS_INDEX,ae=T.SCALE_BY_DISTANCE_INDEX,se=T.TRANSLUCENCY_BY_DISTANCE_INDEX,le=T.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,ue=T.NUMBER_OF_PROPERTIES,ce={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7},he={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8};l(M.prototype,{length:{get:function(){return R(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e,this._createVertexArray=!0)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}}}),M.prototype.add=function(e){var t=new T(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t},M.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=null,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1},M.prototype.removeAll=function(){D(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0},M.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]},M.prototype.contains=function(e){return s(e)&&e._billboardCollection===this},M.prototype.get=function(e){return R(this),this._billboards[e]};var de;M.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,i=this._propertiesChanged,r=0;ue>r;++r){var n=0===i[r]?v.STATIC_DRAW:v.STREAM_DRAW;t=t||e[r]!==n,e[r]=n}return t};var pe=new h,me=new i,fe=32768,ve=65536,ge=256,_e=128,ye=32,Ce=8,Ee=4,Se=1/256,we=0,Te=2,xe=3,be=1,Ae=[];return M.prototype.update=function(e){R(this);var i=this._billboards,r=i.length,n=e.context;this._instanced=n.instancedArrays,X=this._instanced?he:ce,de=this._instanced?N:O;var o=this._textureAtlas;if(!s(o)){o=this._textureAtlas=new I({context:n});for(var a=0;r>a;++a)i[a]._loadImage()}var l=o.textureCoordinates;if(0!==l.length){j(this,e),i=this._billboards,r=i.length;var u=this._billboardsToUpdate,c=this._billboardsToUpdateIndex,h=this._propertiesChanged,d=o.guid,p=this._createVertexArray||this._textureAtlasGUID!==d;this._textureAtlasGUID=d;var f,v=e.passes,E=v.pick;if(p||!E&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var T=0;ue>T;++T)h[T]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),r>0){this._vaf=F(n,r,this._buffersUsage,this._instanced),f=this._vaf.writers;for(var b=0;r>b;++b){var M=this._billboards[b];M._dirty=!1,H(this,n,l,f,M)}this._vaf.commit(de(n))}this._billboardsToUpdateIndex=0}else if(c>0){var D=Ae;D.length=0,(h[K]||h[ne]||h[te])&&D.push(B),(h[ie]||h[Q]||h[$]||h[ee]||h[Z])&&(D.push(V),this._instanced&&D.push(U)),(h[ie]||h[oe]||h[se])&&D.push(k),(h[ie]||h[re])&&D.push(z),h[J]&&D.push(U),h[ae]&&D.push(G),h[le]&&D.push(W);var L=D.length;if(f=this._vaf.writers,c/r>.1){for(var q=0;c>q;++q){var pe=u[q];pe._dirty=!1;for(var me=0;L>me;++me)D[me](this,n,l,f,pe)}this._vaf.commit(de(n))}else{for(var fe=0;c>fe;++fe){var ve=u[fe];ve._dirty=!1;for(var ge=0;L>ge;++ge)D[ge](this,n,l,f,ve);this._instanced?this._vaf.subCommit(ve._index,1):this._vaf.subCommit(4*ve._index,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(c>1.5*r&&(u.length=r),s(this._vaf)&&s(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,t.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var _e,ye=m.IDENTITY;e.mode===P.SCENE3D?(ye=this.modelMatrix,_e=t.clone(this._baseVolumeWC,this._boundingVolume)):_e=t.clone(this._baseVolume2D,this._boundingVolume),Y(this,e,_e);var Ce,Ee,Se,we,Te,xe,be=e.commandList;if(v.render){var Pe=this._colorCommands;for(s(this._rs)||(this._rs=_.fromCache({depthTest:{enabled:!0},blending:x.ALPHA_BLEND})),s(this._sp)&&this._shaderRotation===this._compiledShaderRotation&&this._shaderAlignedAxis===this._compiledShaderAlignedAxis&&this._shaderScaleByDistance===this._compiledShaderScaleByDistance&&this._shaderTranslucencyByDistance===this._compiledShaderTranslucencyByDistance&&this._shaderPixelOffsetScaleByDistance===this._compiledShaderPixelOffsetScaleByDistance||(we=new C({sources:[w]}),this._instanced&&we.defines.push("INSTANCED"),this._shaderRotation&&we.defines.push("ROTATION"),this._shaderAlignedAxis&&we.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&we.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&we.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&we.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),s(this._scene)&&we.defines.push("CLAMPED_TO_GROUND"),this._sp=y.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:we,fragmentShaderSource:S,attributeLocations:X}),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance),Ce=this._vaf.va,Ee=Ce.length,Pe.length=Ee,xe=0;Ee>xe;++xe)Se=Pe[xe],s(Se)||(Se=Pe[xe]=new g({pass:A.OPAQUE,owner:this})),Se.boundingVolume=_e,Se.modelMatrix=ye,Se.count=Ce[xe].indicesCount,Se.shaderProgram=this._sp,Se.uniformMap=this._uniforms,Se.vertexArray=Ce[xe].va,Se.renderState=this._rs,Se.debugShowBoundingVolume=this.debugShowBoundingVolume,this._instanced&&(Se.count=6,Se.instanceCount=r),be.push(Se)}if(E){var Ie=this._pickCommands;for(s(this._spPick)&&this._shaderRotation===this._compiledShaderRotationPick&&this._shaderAlignedAxis===this._compiledShaderAlignedAxisPick&&this._shaderScaleByDistance===this._compiledShaderScaleByDistancePick&&this._shaderTranslucencyByDistance===this._compiledShaderTranslucencyByDistancePick&&this._shaderPixelOffsetScaleByDistance===this._compiledShaderPixelOffsetScaleByDistancePick||(we=new C({defines:["RENDER_FOR_PICK"],sources:[w]}),this._instanced&&we.defines.push("INSTANCED"),this._shaderRotation&&we.defines.push("ROTATION"),this._shaderAlignedAxis&&we.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&we.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&we.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&we.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),s(this._scene)&&we.defines.push("CLAMPED_TO_GROUND"),Te=new C({defines:["RENDER_FOR_PICK"],sources:[S]}),this._spPick=y.replaceCache({context:n,shaderProgram:this._spPick,vertexShaderSource:we,fragmentShaderSource:Te,attributeLocations:X}),this._compiledShaderRotationPick=this._shaderRotation,this._compiledShaderAlignedAxisPick=this._shaderAlignedAxis,this._compiledShaderScaleByDistancePick=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistancePick=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistancePick=this._shaderPixelOffsetScaleByDistance),Ce=this._vaf.va,Ee=Ce.length,Ie.length=Ee,xe=0;Ee>xe;++xe)Se=Ie[xe],s(Se)||(Se=Ie[xe]=new g({pass:A.OPAQUE,owner:this})),Se.boundingVolume=_e,Se.modelMatrix=ye,Se.count=Ce[xe].indicesCount,Se.shaderProgram=this._spPick,Se.uniformMap=this._uniforms,Se.vertexArray=Ce[xe].va,Se.renderState=this._rs,this._instanced&&(Se.count=6,Se.instanceCount=r),be.push(Se)}}}},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){return this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),D(this._billboards),u(this)},M}),i("DataSources/BoundingSphereState",["../Core/freezeObject"],function(e){"use strict";var t={DONE:0,PENDING:1,FAILED:2};return e(t)}),i("DataSources/Property",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Iso8601"],function(e,t,i,r,n){"use strict";function o(){r.throwInstantiationError()}return i(o.prototype,{isConstant:{get:r.throwInstantiationError},definitionChanged:{get:r.throwInstantiationError}}),o.prototype.getValue=r.throwInstantiationError,o.prototype.equals=r.throwInstantiationError,o.equals=function(e,i){return e===i||t(e)&&e.equals(i)},o.arrayEquals=function(e,i){if(e===i)return!0;if(!t(e)||!t(i)||e.length!==i.length)return!1;for(var r=e.length,n=0;r>n;n++)if(!o.equals(e[n],i[n]))return!1;return!0},o.isConstant=function(e){return!t(e)||e.isConstant},o.getValueOrUndefined=function(e,i,r){return t(e)?e.getValue(i,r):void 0},o.getValueOrDefault=function(i,r,n,o){return t(i)?e(i.getValue(r,o),n):n},o.getValueOrClonedDefault=function(e,i,r,n){var o;return t(e)&&(o=e.getValue(i,n)),t(o)||(o=r.clone(o)),o},o}),i("DataSources/BillboardVisualizer",["../Core/AssociativeArray","../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/NearFarScalar","../Scene/BillboardCollection","../Scene/HorizontalOrigin","../Scene/VerticalOrigin","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function f(t,i){i.collectionChanged.addEventListener(f.prototype._onCollectionChanged,this),this._scene=t,this._unusedIndexes=[],this._billboardCollection=void 0,this._entityCollection=i,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}function v(e,t){if(o(e)){var i=e.billboard;o(i)&&(e.textureValue=void 0,e.billboard=void 0,i.show=!1,i.image=void 0,t.push(i._index))}}var g=n.WHITE,_=r.ZERO,y=i.ZERO,C=1,E=0,S=r.ZERO,w=c.CENTER,T=h.CENTER,x=!1,b=new r,A=new n,P=new r,I=new i,M=new l,D=new l,R=new l,O=new t;return f.prototype.update=function(e){for(var t=this._items.values,i=this._unusedIndexes,r=0,n=t.length;n>r;r++){var a,s=t[r],l=s.entity,c=l._billboard,h=s.billboard,d=l.isShowing&&l.isAvailable(e)&&p.getValueOrDefault(c._show,e,!0);if(d&&(b=p.getValueOrUndefined(l._position,e,b),a=p.getValueOrUndefined(c._image,e),d=o(b)&&o(a)),d){if(!o(h)){var m=this._billboardCollection;o(m)||(m=new u,this._billboardCollection=m,this._scene.primitives.add(m));var f=i.length;h=f>0?m.get(i.pop()):m.add(),h.id=l,h.image=void 0,s.billboard=h}h.show=d,s.textureValue!==a&&(h.image=a,s.textureValue=a),h.position=b,h.color=p.getValueOrDefault(c._color,e,g,A),h.eyeOffset=p.getValueOrDefault(c._eyeOffset,e,_,P),h.pixelOffset=p.getValueOrDefault(c._pixelOffset,e,y,I),h.scale=p.getValueOrDefault(c._scale,e,C),h.rotation=p.getValueOrDefault(c._rotation,e,E),h.alignedAxis=p.getValueOrDefault(c._alignedAxis,e,S),h.horizontalOrigin=p.getValueOrDefault(c._horizontalOrigin,e,w),h.verticalOrigin=p.getValueOrDefault(c._verticalOrigin,e,T),h.width=p.getValueOrUndefined(c._width,e),h.height=p.getValueOrUndefined(c._height,e),h.scaleByDistance=p.getValueOrUndefined(c._scaleByDistance,e,M),h.translucencyByDistance=p.getValueOrUndefined(c._translucencyByDistance,e,D),h.pixelOffsetScaleByDistance=p.getValueOrUndefined(c._pixelOffsetScaleByDistance,e,R),h.sizeInMeters=p.getValueOrDefault(c._sizeInMeters,x);var N=p.getValueOrUndefined(c._imageSubRegion,e,O);o(N)&&h.setImageSubRegion(h._imageId,N)}else v(s,i)}return!0},f.prototype.getBoundingSphere=function(e,t){var i=this._items.get(e.id);return o(i)&&o(i.billboard)?(t.center=r.clone(i.billboard.position,t.center),t.radius=0,d.DONE):d.FAILED},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._entityCollection.collectionChanged.removeEventListener(f.prototype._onCollectionChanged,this),o(this._billboardCollection)&&this._scene.primitives.remove(this._billboardCollection),a(this)},f.prototype._onCollectionChanged=function(e,t,i,r){var n,a,s=this._unusedIndexes,l=this._items;for(n=t.length-1;n>-1;n--)a=t[n],o(a._billboard)&&o(a._position)&&l.set(a.id,new m(a));for(n=r.length-1;n>-1;n--)a=r[n],o(a._billboard)&&o(a._position)?l.contains(a.id)||l.set(a.id,new m(a)):(v(l.get(a.id),s),l.remove(a.id));for(n=i.length-1;n>-1;n--)a=i[n],v(l.get(a.id),s),l.remove(a.id)},f}),i("Shaders/Appearances/AllMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_binormalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nmat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_binormalEC);\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = tangentToEyeMatrix;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),i("Shaders/Appearances/AllMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec3 tangent;\nattribute vec3 binormal;\nattribute vec2 st;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_binormalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_tangentEC = czm_normal * tangent;\nv_binormalEC = czm_normal * binormal;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Shaders/Appearances/BasicMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),i("Shaders/Appearances/BasicMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Shaders/Appearances/TexturedMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);;\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),i("Shaders/Appearances/TexturedMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec2 st;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Scene/CullFace",["../Core/freezeObject","../Renderer/WebGLConstants"],function(e,t){"use strict";var i={FRONT:t.FRONT,BACK:t.BACK,FRONT_AND_BACK:t.FRONT_AND_BACK};return e(i)}),i("Scene/Appearance",["../Core/clone","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","./BlendingState","./CullFace"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=i(e,i.EMPTY_OBJECT),this.material=e.material,this.translucent=i(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=i(e.closed,!1)}return n(s.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}}),s.prototype.getFragmentShaderSource=function(){var e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),r(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join("\n")},s.prototype.isTranslucent=function(){return r(this.material)&&this.material.isTranslucent()||!r(this.material)&&this.translucent},s.prototype.getRenderState=function(){var t=this.isTranslucent(),i=e(this.renderState,!1);return t?(i.depthMask=!1,i.blending=o.ALPHA_BLEND):i.depthMask=!0,i},s.getDefaultRenderState=function(e,i,n){var s={depthTest:{enabled:!0}};return e&&(s.depthMask=!1,s.blending=o.ALPHA_BLEND),i&&(s.cull={enabled:!0,face:a.BACK}),r(n)&&(s=t(n,s,!0)),s},s}),i("Renderer/CubeMapFace",["../Core/defaultValue","../Core/defineProperties","../Core/DeveloperError","./PixelDatatype"],function(e,t,i,r){"use strict";function n(e,t,i,r,n,o,a,s,l){this._gl=e,this._texture=t,this._textureTarget=i,this._targetFace=r,this._pixelFormat=n,this._pixelDatatype=o,this._size=a,this._preMultiplyAlpha=s,this._flipY=l}return t(n.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}}),n.prototype.copyFrom=function(t,i,r){i=e(i,0),r=e(r,0);var n=this._gl,o=this._textureTarget;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._preMultiplyAlpha),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,this._flipY),n.activeTexture(n.TEXTURE0),n.bindTexture(o,this._texture),t.arrayBufferView?n.texSubImage2D(this._targetFace,0,i,r,t.width,t.height,this._pixelFormat,this._pixelDatatype,t.arrayBufferView):n.texSubImage2D(this._targetFace,0,i,r,this._pixelFormat,this._pixelDatatype,t),n.bindTexture(o,null)},n.prototype.copyFromFramebuffer=function(t,i,r,n,o,a){t=e(t,0),i=e(i,0),r=e(r,0),n=e(n,0),o=e(o,this._size),a=e(a,this._size);var s=this._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.copyTexSubImage2D(this._targetFace,0,t,i,r,n,o,a),s.bindTexture(l,null)},n}),i("Renderer/CubeMap",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","./ContextLimits","./CubeMapFace","./MipmapHint","./PixelDatatype","./Sampler","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(i){function r(e,t){t.arrayBufferView?_.texImage2D(e,0,m,p,p,0,m,f,t.arrayBufferView):_.texImage2D(e,0,m,m,f,t)}i=e(i,e.EMPTY_OBJECT);var n,o,s=i.context,u=i.source;if(t(u)){var d=[u.positiveX,u.negativeX,u.positiveY,u.negativeY,u.positiveZ,u.negativeZ];n=d[0].width,o=d[0].height}else n=i.width,o=i.height;var p=n,m=e(i.pixelFormat,a.RGBA),f=e(i.pixelDatatype,c.UNSIGNED_BYTE),v=i.preMultiplyAlpha||m===a.RGB||m===a.LUMINANCE,g=e(i.flipY,!0),_=s._gl,y=_.TEXTURE_CUBE_MAP,C=_.createTexture();_.activeTexture(_.TEXTURE0),_.bindTexture(y,C),t(u)?(_.pixelStorei(_.UNPACK_PREMULTIPLY_ALPHA_WEBGL,v),_.pixelStorei(_.UNPACK_FLIP_Y_WEBGL,g),r(_.TEXTURE_CUBE_MAP_POSITIVE_X,u.positiveX),r(_.TEXTURE_CUBE_MAP_NEGATIVE_X,u.negativeX),r(_.TEXTURE_CUBE_MAP_POSITIVE_Y,u.positiveY),r(_.TEXTURE_CUBE_MAP_NEGATIVE_Y,u.negativeY),r(_.TEXTURE_CUBE_MAP_POSITIVE_Z,u.positiveZ),r(_.TEXTURE_CUBE_MAP_NEGATIVE_Z,u.negativeZ)):(_.texImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_X,0,m,p,p,0,m,f,null),_.texImage2D(_.TEXTURE_CUBE_MAP_NEGATIVE_X,0,m,p,p,0,m,f,null),_.texImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_Y,0,m,p,p,0,m,f,null),_.texImage2D(_.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,m,p,p,0,m,f,null),_.texImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_Z,0,m,p,p,0,m,f,null),_.texImage2D(_.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,m,p,p,0,m,f,null)),_.bindTexture(y,null),this._gl=_,this._textureFilterAnisotropic=s._textureFilterAnisotropic,this._textureTarget=y,this._texture=C,this._pixelFormat=m,this._pixelDatatype=f,this._size=p,this._preMultiplyAlpha=v,this._flipY=g,this._sampler=void 0,this._positiveX=new l(_,C,y,_.TEXTURE_CUBE_MAP_POSITIVE_X,m,f,p,v,g),this._negativeX=new l(_,C,y,_.TEXTURE_CUBE_MAP_NEGATIVE_X,m,f,p,v,g),this._positiveY=new l(_,C,y,_.TEXTURE_CUBE_MAP_POSITIVE_Y,m,f,p,v,g),this._negativeY=new l(_,C,y,_.TEXTURE_CUBE_MAP_NEGATIVE_Y,m,f,p,v,g),this._positiveZ=new l(_,C,y,_.TEXTURE_CUBE_MAP_POSITIVE_Z,m,f,p,v,g),this._negativeZ=new l(_,C,y,_.TEXTURE_CUBE_MAP_NEGATIVE_Z,m,f,p,v,g),this.sampler=new h}return i(f.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){var i=e.minificationFilter,r=e.magnificationFilter,n=i===p.NEAREST_MIPMAP_NEAREST||i===p.NEAREST_MIPMAP_LINEAR||i===p.LINEAR_MIPMAP_NEAREST||i===p.LINEAR_MIPMAP_LINEAR;this._pixelDatatype===c.FLOAT&&(i=n?p.NEAREST_MIPMAP_NEAREST:p.NEAREST,r=d.NEAREST);var o=this._gl,a=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(a,this._texture),o.texParameteri(a,o.TEXTURE_MIN_FILTER,i),o.texParameteri(a,o.TEXTURE_MAG_FILTER,r),o.texParameteri(a,o.TEXTURE_WRAP_S,e.wrapS),o.texParameteri(a,o.TEXTURE_WRAP_T,e.wrapT),t(this._textureFilterAnisotropic)&&o.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy), -o.bindTexture(a,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}}),f.prototype.generateMipmap=function(t){t=e(t,u.DONT_CARE);var i=this._gl,r=this._textureTarget;i.hint(i.GENERATE_MIPMAP_HINT,t),i.activeTexture(i.TEXTURE0),i.bindTexture(r,this._texture),i.generateMipmap(r),i.bindTexture(r,null)},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._gl.deleteTexture(this._texture),this._positiveX=r(this._positiveX),this._negativeX=r(this._negativeX),this._positiveY=r(this._positiveY),this._negativeY=r(this._negativeY),this._positiveZ=r(this._positiveZ),this._negativeZ=r(this._negativeZ),r(this)},f}),i("Shaders/Materials/BumpMapMaterial",[],function(){"use strict";return"uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nvec2 centerPixel = fract(repeat * st);\nfloat centerBump = texture2D(image, centerPixel).channel;\nfloat imageWidth = float(imageDimensions.x);\nvec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));\nfloat rightBump = texture2D(image, rightPixel).channel;\nfloat imageHeight = float(imageDimensions.y);\nvec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));\nfloat topBump = texture2D(image, leftPixel).channel;\nvec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nmaterial.diffuse = vec3(0.01);\nreturn material;\n}\n"}),i("Shaders/Materials/CheckerboardMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0);\nfloat scaledWidth = fract(repeat.s * st.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(repeat.t * st.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value = min(scaledWidth, scaledHeight);\nvec4 currentColor = mix(lightColor, darkColor, b);\nvec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/DotMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5));\nvec4 color = mix(lightColor, darkColor, b);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/FadeMaterial",[],function(){"use strict";return"uniform vec4 fadeInColor;\nuniform vec4 fadeOutColor;\nuniform float maximumDistance;\nuniform bool repeat;\nuniform vec2 fadeDirection;\nuniform vec2 time;\nfloat getTime(float t, float coord)\n{\nfloat scalar = 1.0 / maximumDistance;\nfloat q = distance(t, coord) * scalar;\nif (repeat)\n{\nfloat r = distance(t, coord + 1.0) * scalar;\nfloat s = distance(t, coord - 1.0) * scalar;\nq = min(min(r, s), q);\n}\nreturn clamp(q, 0.0, 1.0);\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat s = getTime(time.x, st.s) * fadeDirection.s;\nfloat t = getTime(time.y, st.t) * fadeDirection.t;\nfloat u = length(vec2(s, t));\nvec4 color = mix(fadeInColor, fadeOutColor, u);\nmaterial.emission = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/GridMaterial",[],function(){"use strict";return"#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform vec4 color;\nuniform float cellAlpha;\nuniform vec2 lineCount;\nuniform vec2 lineThickness;\nuniform vec2 lineOffset;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat scaledWidth = fract(lineCount.s * st.s - lineOffset.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(lineCount.t * st.t - lineOffset.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value;\n#ifdef GL_OES_standard_derivatives\nconst float fuzz = 1.2;\nvec2 thickness = (lineThickness * czm_resolutionScale) - 1.0;\nvec2 dx = abs(dFdx(st));\nvec2 dy = abs(dFdy(st));\nvec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;\nvalue = min(\nsmoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),\nsmoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));\n#else\nconst float fuzz = 0.05;\nvec2 range = 0.5 - (lineThickness * 0.05);\nvalue = min(\n1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),\n1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));\n#endif\nfloat dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)));\nfloat sRim = smoothstep(0.8, 1.0, dRim);\nvalue *= (1.0 - sRim);\nvec3 halfColor = color.rgb * 0.5;\nmaterial.diffuse = halfColor;\nmaterial.emission = halfColor;\nmaterial.alpha = color.a * (1.0 - ((1.0 - cellAlpha) * value));\nreturn material;\n}\n"}),i("Shaders/Materials/NormalMapMaterial",[],function(){"use strict";return"uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec4 textureValue = texture2D(image, fract(repeat * materialInput.st));\nvec3 normalTangentSpace = textureValue.channels;\nnormalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;\nnormalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);\nnormalTangentSpace = normalize(normalTangentSpace);\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nreturn material;\n}\n"}),i("Shaders/Materials/PolylineArrowMaterial",[],function(){"use strict";return"#extension GL_OES_standard_derivatives : enable\nuniform vec4 color;\nvarying float v_width;\nfloat getPointOnLine(vec2 p0, vec2 p1, float x)\n{\nfloat slope = (p0.y - p1.y) / (p0.x - p1.x);\nreturn slope * (x - p0.x) + p0.y;\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat base = 1.0 - abs(fwidth(st.s)) * 10.0;\nvec2 center = vec2(1.0, 0.5);\nfloat ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);\nfloat ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);\nfloat halfWidth = 0.15;\nfloat s = step(0.5 - halfWidth, st.t);\ns *= 1.0 - step(0.5 + halfWidth, st.t);\ns *= 1.0 - step(base, st.s);\nfloat t = step(base, materialInput.st.s);\nt *= 1.0 - step(ptOnUpperLine, st.t);\nt *= step(ptOnLowerLine, st.t);\nfloat dist;\nif (st.s < base)\n{\nfloat d1 = abs(st.t - (0.5 - halfWidth));\nfloat d2 = abs(st.t - (0.5 + halfWidth));\ndist = min(d1, d2);\n}\nelse\n{\nfloat d1 = czm_infinity;\nif (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)\n{\nd1 = abs(st.s - base);\n}\nfloat d2 = abs(st.t - ptOnUpperLine);\nfloat d3 = abs(st.t - ptOnLowerLine);\ndist = min(min(d1, d2), d3);\n}\nvec4 outsideColor = vec4(0.0);\nvec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));\nvec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n"}),i("Shaders/Materials/PolylineGlowMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform float glowPower;\nvarying float v_width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5);\nmaterial.emission = max(vec3(glow - 1.0 + color.rgb), color.rgb);\nmaterial.alpha = clamp(0.0, 1.0, glow) * color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/PolylineOutlineMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform vec4 outlineColor;\nuniform float outlineWidth;\nvarying float v_width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width;\nfloat b = step(0.5 - halfInteriorWidth, st.t);\nb *= 1.0 - step(0.5 + halfInteriorWidth, st.t);\nfloat d1 = abs(st.t - (0.5 - halfInteriorWidth));\nfloat d2 = abs(st.t - (0.5 + halfInteriorWidth));\nfloat dist = min(d1, d2);\nvec4 currentColor = mix(outlineColor, color, b);\nvec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n"}),i("Shaders/Materials/RimLightingMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform vec4 rimColor;\nuniform float width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));\nfloat s = smoothstep(1.0 - width, 1.0, d);\nmaterial.diffuse = color.rgb;\nmaterial.emission = rimColor.rgb * s;\nmaterial.alpha = mix(color.a, rimColor.a, s);\nreturn material;\n}\n"}),i("Shaders/Materials/StripeMaterial",[],function(){"use strict";return"uniform vec4 evenColor;\nuniform vec4 oddColor;\nuniform float offset;\nuniform float repeat;\nuniform bool horizontal;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));\nfloat value = fract((coord - offset) * (repeat * 0.5));\nfloat dist = min(value, min(abs(value - 0.5), 1.0 - value));\nvec4 currentColor = mix(evenColor, oddColor, step(0.5, value));\nvec4 color = czm_antialias(evenColor, oddColor, currentColor, dist);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/Water",[],function(){"use strict";return"uniform sampler2D specularMap;\nuniform sampler2D normalMap;\nuniform vec4 baseWaterColor;\nuniform vec4 blendColor;\nuniform float frequency;\nuniform float animationSpeed;\nuniform float amplitude;\nuniform float specularIntensity;\nuniform float fadeFactor;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat time = czm_frameNumber * animationSpeed;\nfloat fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);\nfloat specularMapValue = texture2D(specularMap, materialInput.st).r;\nvec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);\nvec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));\nnormalTangentSpace.xy /= fade;\nnormalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);\nnormalTangentSpace = normalize(normalTangentSpace);\nfloat tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);\nmaterial.alpha = specularMapValue;\nmaterial.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);\nmaterial.diffuse += (0.1 * tsPerturbationRatio);\nmaterial.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);\nmaterial.specular = specularIntensity;\nmaterial.shininess = 10.0;\nreturn material;\n}\n"}),i("Scene/Material",["../Core/Cartesian2","../Core/clone","../Core/Color","../Core/combine","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/isArray","../Core/loadImage","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Renderer/CubeMap","../Renderer/Texture","../Shaders/Materials/BumpMapMaterial","../Shaders/Materials/CheckerboardMaterial","../Shaders/Materials/DotMaterial","../Shaders/Materials/FadeMaterial","../Shaders/Materials/GridMaterial","../Shaders/Materials/NormalMapMaterial","../Shaders/Materials/PolylineArrowMaterial","../Shaders/Materials/PolylineGlowMaterial","../Shaders/Materials/PolylineOutlineMaterial","../Shaders/Materials/RimLightingMaterial","../Shaders/Materials/StripeMaterial","../Shaders/Materials/Water","../ThirdParty/when"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I){"use strict";function M(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,D(e,this),s(this,{type:{value:this.type,writable:!1}}),a(M._uniformList[this.type])||(M._uniformList[this.type]=Object.keys(this._uniforms))}function D(e,i){e=o(e,o.EMPTY_OBJECT),i._strict=o(e.strict,!1),i._count=o(e.count,0),i._template=t(o(e.fabric,o.EMPTY_OBJECT)),i._template.uniforms=t(o(i._template.uniforms,o.EMPTY_OBJECT)),i._template.materials=t(o(i._template.materials,o.EMPTY_OBJECT)),i.type=a(i._template.type)?i._template.type:n(),i.shaderSource="",i.materials={},i.uniforms={},i._uniforms={},i._translucentFunctions=[];var s,l=M._materialCache.getMaterial(i.type);if(a(l)){var u=t(l.fabric,!0);i._template=r(i._template,u,!0),s=l.translucent}L(i),a(l)||M._materialCache.addMaterial(i.type,i),F(i),k(i),G(i);var c=0===i._translucentFunctions.length?!0:void 0;if(s=o(s,c),s=o(e.translucent,s),a(s))if("function"==typeof s){var h=function(){return s(i)};i._translucentFunctions.push(h)}else i._translucentFunctions.push(s)}function R(e,t,i,r){if(a(e))for(var n in e)if(e.hasOwnProperty(n)){var o=-1!==t.indexOf(n);(r&&!o||!r&&o)&&i(n,t)}}function O(e,t){for(var i="fabric: property name '"+e+"' is not valid. It should be ",r=0;r=2){if(s&&a(c)&&(c!==r.defaultTexture&&c.destroy(),c=void 0),!a(c)||c===r.defaultTexture)return c=new v({context:r,source:o}),void(i._textures[e]=c);c.copyFrom(o)}else a(c)||(i._textures[e]=r.defaultTexture);else{if(o instanceof v&&o!==c){i._texturePaths[e]=void 0;var d=i._textures[e];return d!==i._defaultTexture&&d.destroy(),i._textures[e]=o,l=e+"Dimensions",void(n.hasOwnProperty(l)&&(u=n[l],u.x=o._width,u.y=o._height))}a(c)||(i._texturePaths[e]=void 0,a(i._defaultTexture)||(i._defaultTexture=r.defaultTexture),c=i._textures[e]=i._defaultTexture,l=e+"Dimensions",n.hasOwnProperty(l)&&(u=n[l],u.x=c._width,u.y=c._height)),o!==M.DefaultImageId&&o!==i._texturePaths[e]&&("string"==typeof o?I(h(o),function(t){i._loadedImages.push({id:e,image:t})}):o instanceof HTMLCanvasElement&&i._loadedImages.push({id:e,image:o}),i._texturePaths[e]=o)}}}function V(e){return function(t,i){var r=t.uniforms[e];if(r instanceof f){var n=t._textures[e];return n!==t._defaultTexture&&n.destroy(),t._texturePaths[e]=void 0,void(t._textures[e]=r)}if(a(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=i.defaultCubeMap),r!==M.DefaultCubeMapId){var o=r.positiveX+r.negativeX+r.positiveY+r.negativeY+r.positiveZ+r.negativeZ;if(o!==t._texturePaths[e]){var s=[h(r.positiveX),h(r.negativeX),h(r.positiveY),h(r.negativeY),h(r.positiveZ),h(r.negativeZ)];I.all(s).then(function(i){t._loadedCubeMaps.push({id:e,images:i})}),t._texturePaths[e]=o}}}}function k(e){var t=e._template.uniforms;for(var i in t)t.hasOwnProperty(i)&&z(e,i)}function z(e,t){var i=e._strict,r=e._template.uniforms,n=r[t],o=U(n);if(!a(o))throw new u("fabric: uniform '"+t+"' has invalid type.");if("channels"===o){if(0===W(e,t,n,!1)&&i)throw new u("strict: shader source does not use channels '"+t+"'.")}else{if("sampler2D"===o){var s=t+"Dimensions";H(e,s)>0&&(r[s]={type:"ivec3",x:1,y:1},z(e,s))}var l=new RegExp("uniform\\s+"+o+"\\s+"+t+"\\s*;");if(!l.test(e.shaderSource)){var c="uniform "+o+" "+t+";";e.shaderSource=c+e.shaderSource}var h=t+"_"+e._count++;if(1===W(e,t,h)&&i)throw new u("strict: shader source does not use uniform '"+t+"'.");if(e.uniforms[t]=n,"sampler2D"===o)e._uniforms[h]=function(){return e._textures[t]},e._updateFunctions.push(B(t));else if("samplerCube"===o)e._uniforms[h]=function(){return e._textures[t]},e._updateFunctions.push(V(t));else if(-1!==o.indexOf("mat")){var d=new Y[o];e._uniforms[h]=function(){return Y[o].fromColumnMajorArray(e.uniforms[t],d)}}else e._uniforms[h]=function(){return e.uniforms[t]}}}function U(e){var t=e.type;if(!a(t)){var i=typeof e;if("number"===i)t="float";else if("boolean"===i)t="bool";else if("string"===i||e instanceof HTMLCanvasElement)t=/^([rgba]){1,4}$/i.test(e)?"channels":e===M.DefaultCubeMapId?"samplerCube":"sampler2D";else if("object"===i)if(c(e))(4===e.length||9===e.length||16===e.length)&&(t="mat"+Math.sqrt(e.length));else{var r=0;for(var n in e)e.hasOwnProperty(n)&&(r+=1);r>=2&&4>=r?t="vec"+r:6===r&&(t="samplerCube")}}return t}function G(e){var t=e._strict,i=e._template.materials;for(var n in i)if(i.hasOwnProperty(n)){var o=new M({strict:t,fabric:i[n],count:e._count});e._count=o._count,e._uniforms=r(e._uniforms,o._uniforms,!0),e.materials[n]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);var a="czm_getMaterial",s=a+"_"+e._count++;W(o,a,s),e.shaderSource=o.shaderSource+e.shaderSource;var l=s+"(materialInput)";if(0===W(e,n,l)&&t)throw new u("strict: shader source does not use material '"+n+"'.")}}function W(e,t,i,r){r=o(r,!0);var n=0,a="([\\w])?",s="([\\w"+(r?".":"")+"])?",l=new RegExp(s+t+a,"g");return e.shaderSource=e.shaderSource.replace(l,function(e,t,r){return t||r?e:(n+=1,i)}),n}function H(e,t,i){return W(e,t,t,i)}M._uniformList={},M.fromType=function(e,t){var i=new M({fabric:{type:e}});if(a(t))for(var r in t)t.hasOwnProperty(r)&&(i.uniforms[r]=t[r]);return i},M.prototype.isTranslucent=function(){if(a(this.translucent))return"function"==typeof this.translucent?this.translucent():this.translucent;for(var e=!0,t=this._translucentFunctions,i=t.length,r=0;i>r;++r){var n=t[r];if(e="function"==typeof n?e&&n():e&&n,!e)break}return e},M.prototype.update=function(e){var t,i,r=this._loadedImages,n=r.length;for(t=0;n>t;++t){var o=r[t];i=o.id;var a=o.image,s=new v({context:e,source:a});this._textures[i]=s;var l=i+"Dimensions";if(this.uniforms.hasOwnProperty(l)){var u=this.uniforms[l];u.x=s._width,u.y=s._height}}r.length=0;var c=this._loadedCubeMaps;for(n=c.length,t=0;n>t;++t){var h=c[t];i=h.id;var d=h.images,p=new f({context:e,source:{positiveX:d[0],negativeX:d[1],positiveY:d[2],negativeY:d[3],positiveZ:d[4],negativeZ:d[5]}});this._textures[i]=p}c.length=0;var m=this._updateFunctions;for(n=m.length,t=0;n>t;++t)m[t](this,e);var g=this.materials;for(var _ in g)g.hasOwnProperty(_)&&g[_].update(e)},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){var e=this._textures;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];i!==this._defaultTexture&&i.destroy()}var r=this.materials;for(var n in r)r.hasOwnProperty(n)&&r[n].destroy();return l(this)};var q=["type","materials","uniforms","components","source"],j=["diffuse","specular","shininess","normal","emission","alpha"],Y={mat2:d,mat3:p,mat4:m};return M._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}},M.DefaultImageId="czm_defaultImage",M.DefaultCubeMapId="czm_defaultCubeMap",M.ColorType="Color",M._materialCache.addMaterial(M.ColorType,{fabric:{type:M.ColorType,uniforms:{color:new i(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),M.ImageType="Image",M._materialCache.addMaterial(M.ImageType,{fabric:{type:M.ImageType,uniforms:{image:M.DefaultImageId,repeat:new e(1,1),alpha:1},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).rgb",alpha:"texture2D(image, fract(repeat * materialInput.st)).a * alpha"}},translucent:function(e){return e.uniforms.alpha<1}}),M.DiffuseMapType="DiffuseMap",M._materialCache.addMaterial(M.DiffuseMapType,{fabric:{type:M.DiffuseMapType,uniforms:{image:M.DefaultImageId,channels:"rgb",repeat:new e(1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),M.AlphaMapType="AlphaMap",M._materialCache.addMaterial(M.AlphaMapType,{fabric:{type:M.AlphaMapType,uniforms:{image:M.DefaultImageId,channel:"a",repeat:new e(1,1)},components:{alpha:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!0}),M.SpecularMapType="SpecularMap",M._materialCache.addMaterial(M.SpecularMapType,{fabric:{type:M.SpecularMapType,uniforms:{image:M.DefaultImageId,channel:"r",repeat:new e(1,1)},components:{specular:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!1}),M.EmissionMapType="EmissionMap",M._materialCache.addMaterial(M.EmissionMapType,{fabric:{type:M.EmissionMapType,uniforms:{image:M.DefaultImageId,channels:"rgb",repeat:new e(1,1)},components:{emission:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),M.BumpMapType="BumpMap",M._materialCache.addMaterial(M.BumpMapType,{fabric:{type:M.BumpMapType,uniforms:{image:M.DefaultImageId,channel:"r",strength:.8,repeat:new e(1,1)},source:g},translucent:!1}),M.NormalMapType="NormalMap",M._materialCache.addMaterial(M.NormalMapType,{fabric:{type:M.NormalMapType,uniforms:{image:M.DefaultImageId,channels:"rgb",strength:.8,repeat:new e(1,1)},source:S},translucent:!1}),M.GridType="Grid",M._materialCache.addMaterial(M.GridType,{fabric:{type:M.GridType,uniforms:{color:new i(0,1,0,1),cellAlpha:.1,lineCount:new e(8,8),lineThickness:new e(1,1),lineOffset:new e(0,0)},source:E},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}}),M.StripeType="Stripe",M._materialCache.addMaterial(M.StripeType,{fabric:{type:M.StripeType,uniforms:{horizontal:!0,evenColor:new i(1,1,1,.5),oddColor:new i(0,0,1,.5),offset:0,repeat:5},source:A},translucent:function(e){var t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<0}}),M.CheckerboardType="Checkerboard",M._materialCache.addMaterial(M.CheckerboardType,{fabric:{type:M.CheckerboardType,uniforms:{lightColor:new i(1,1,1,.5),darkColor:new i(0,0,0,.5),repeat:new e(5,5)},source:_},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<0}}),M.DotType="Dot",M._materialCache.addMaterial(M.DotType,{fabric:{type:M.DotType,uniforms:{lightColor:new i(1,1,0,.75),darkColor:new i(0,1,1,.75),repeat:new e(5,5)},source:y},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<0}}),M.WaterType="Water",M._materialCache.addMaterial(M.WaterType,{fabric:{type:M.WaterType,uniforms:{baseWaterColor:new i(.2,.3,.6,1),blendColor:new i(0,1,.699,1),specularMap:M.DefaultImageId,normalMap:M.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:P},translucent:function(e){var t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<0}}),M.RimLightingType="RimLighting",M._materialCache.addMaterial(M.RimLightingType,{fabric:{type:M.RimLightingType,uniforms:{color:new i(1,0,0,.7),rimColor:new i(1,1,1,.4),width:.3},source:b},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<0}}),M.FadeType="Fade",M._materialCache.addMaterial(M.FadeType,{fabric:{type:M.FadeType,uniforms:{fadeInColor:new i(1,0,0,1),fadeOutColor:new i(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new e(.5,.5)},source:C},translucent:function(e){var t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<0}}),M.PolylineArrowType="PolylineArrow",M._materialCache.addMaterial(M.PolylineArrowType,{fabric:{type:M.PolylineArrowType,uniforms:{color:new i(1,1,1,1)},source:w},translucent:!0}),M.PolylineGlowType="PolylineGlow",M._materialCache.addMaterial(M.PolylineGlowType,{fabric:{type:M.PolylineGlowType,uniforms:{color:new i(0,.5,1,1),glowPower:.25},source:T},translucent:!0}),M.PolylineOutlineType="PolylineOutline",M._materialCache.addMaterial(M.PolylineOutlineType,{fabric:{type:M.PolylineOutlineType,uniforms:{color:new i(1,1,1,1),outlineColor:new i(1,0,0,1),outlineWidth:1},source:x},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}}),M}),i("Scene/MaterialAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/freezeObject","../Core/VertexFormat","../Shaders/Appearances/AllMaterialAppearanceFS","../Shaders/Appearances/AllMaterialAppearanceVS","../Shaders/Appearances/BasicMaterialAppearanceFS","../Shaders/Appearances/BasicMaterialAppearanceVS","../Shaders/Appearances/TexturedMaterialAppearanceFS","../Shaders/Appearances/TexturedMaterialAppearanceVS","./Appearance","./Material"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.translucent,!0),n=e(i.closed,!1),o=e(i.materialSupport,p.MaterialSupport.TEXTURED);this.material=t(i.material)?i.material:d.fromType(d.ColorType),this.translucent=r,this._vertexShaderSource=e(i.vertexShaderSource,o.vertexShaderSource),this._fragmentShaderSource=e(i.fragmentShaderSource,o.fragmentShaderSource),this._renderState=h.getDefaultRenderState(r,n,i.renderState),this._closed=n,this._materialSupport=o,this._vertexFormat=o.vertexFormat,this._flat=e(i.flat,!1),this._faceForward=e(i.faceForward,!n)}return i(p.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}}),p.prototype.getFragmentShaderSource=h.prototype.getFragmentShaderSource,p.prototype.isTranslucent=h.prototype.isTranslucent,p.prototype.getRenderState=h.prototype.getRenderState,p.MaterialSupport={BASIC:r({vertexFormat:n.POSITION_AND_NORMAL,vertexShaderSource:l,fragmentShaderSource:s}),TEXTURED:r({vertexFormat:n.POSITION_NORMAL_AND_ST,vertexShaderSource:c,fragmentShaderSource:u}),ALL:r({vertexFormat:n.ALL,vertexShaderSource:a,fragmentShaderSource:o})},p}),i("Shaders/Appearances/PerInstanceColorAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getDefaultMaterial(materialInput);\nmaterial.diffuse = v_color.rgb;\nmaterial.alpha = v_color.a;\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n}\n"}),i("Shaders/Appearances/PerInstanceColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec4 color;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Shaders/Appearances/PerInstanceFlatColorAppearanceFS",[],function(){"use strict";return"varying vec4 v_color;\nvoid main()\n{\ngl_FragColor = v_color;\n}\n"}),i("Shaders/Appearances/PerInstanceFlatColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec4 color;\nvarying vec4 v_color;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Scene/PerInstanceColorAppearance",["../Core/defaultValue","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PerInstanceColorAppearanceFS","../Shaders/Appearances/PerInstanceColorAppearanceVS","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS","../Shaders/Appearances/PerInstanceFlatColorAppearanceVS","./Appearance"],function(e,t,i,r,n,o,a,s){"use strict";function l(t){t=e(t,e.EMPTY_OBJECT);var i=e(t.translucent,!0),u=e(t.closed,!1),c=e(t.flat,!1),h=c?a:n,d=c?o:r,p=c?l.FLAT_VERTEX_FORMAT:l.VERTEX_FORMAT;this.material=void 0,this.translucent=i,this._vertexShaderSource=e(t.vertexShaderSource,h),this._fragmentShaderSource=e(t.fragmentShaderSource,d),this._renderState=s.getDefaultRenderState(i,u,t.renderState),this._closed=u,this._vertexFormat=p,this._flat=c,this._faceForward=e(t.faceForward,!u)}return t(l.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}}),l.VERTEX_FORMAT=i.POSITION_AND_NORMAL,l.FLAT_VERTEX_FORMAT=i.POSITION_ONLY,l.prototype.getFragmentShaderSource=s.prototype.getFragmentShaderSource,l.prototype.isTranslucent=s.prototype.isTranslucent,l.prototype.getRenderState=s.prototype.getRenderState,l}),i("Scene/PrimitivePipeline",["../Core/BoundingSphere","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Matrix4","../Core/WebMercatorProjection"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function v(e,t,i){var r,n=!i,o=e.length;if(!n&&o>1){var a=e[0].modelMatrix;for(r=1;o>r;++r)if(!m.equals(a,e[r].modelMatrix)){n=!0;break}}if(n)for(r=0;o>r;++r)d.transformToWorldCoordinates(e[r]);else m.multiplyTransformation(t,e[0].modelMatrix,t); -}function g(e,r){var n=e.attributes,o=n.position,a=4*(o.values.length/o.componentsPerAttribute);n.pickColor=new c({componentDatatype:i.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0,values:new Uint8Array(a)});for(var s=t.floatToByte(r.red),l=t.floatToByte(r.green),u=t.floatToByte(r.blue),h=t.floatToByte(r.alpha),d=n.pickColor.values,p=0;a>p;p+=4)d[p]=s,d[p+1]=l,d[p+2]=u,d[p+3]=h}function _(e,t){for(var i=e.length,r=0;i>r;++r){var o=e[r],a=t[r];n(o.geometry)?g(o.geometry,a):(g(o.westHemisphereGeometry,a),g(o.eastHemisphereGeometry,a))}}function y(e){var t,i=e.length,r=[],o=e[0].attributes;for(t in o)if(o.hasOwnProperty(t)){for(var a=o[t],s=!0,l=1;i>l;++l){var u=e[l].attributes[t];if(!n(u)||a.componentDatatype!==u.componentDatatype||a.componentsPerAttribute!==u.componentsPerAttribute||a.normalize!==u.normalize){s=!1;break}}s&&r.push(t)}return r}function C(e,t,r){for(var n=u.computeNumberOfVertices(t),o=r.length,a=0;o>a;++a){for(var s=r[a],l=e[s],h=l.componentDatatype,d=l.value,p=d.length,m=i.createTypedArray(h,n*p),f=0;n>f;++f)m.set(d,f*p);t.attributes[s]=new c({componentDatatype:h,componentsPerAttribute:p,normalize:l.normalize,values:m})}}function E(e,t){for(var i=e.length,r=0;i>r;++r){var o=e[r],a=o.attributes;n(o.geometry)?C(a,o.geometry,t):(C(a,o.westHemisphereGeometry,t),C(a,o.eastHemisphereGeometry,t))}}function S(t){var r,o,a=t.instances,s=t.pickIds,l=t.projection,u=t.elementIndexUintSupported,c=t.scene3DOnly,h=t.allowPicking,p=t.vertexCacheOptimize,m=t.compressVertices,f=t.modelMatrix,g=a.length;a[0].geometry.primitiveType;if(v(a,f,c),!c)for(r=0;g>r;++r)d.splitLongitude(a[r]);h&&_(a,s);var C=y(a);if(E(a,C),p)for(r=0;g>r;++r){var S=a[r];n(S.geometry)?(d.reorderForPostVertexCache(S.geometry),d.reorderForPreVertexCache(S.geometry)):(d.reorderForPostVertexCache(S.westHemisphereGeometry),d.reorderForPreVertexCache(S.westHemisphereGeometry),d.reorderForPostVertexCache(S.eastHemisphereGeometry),d.reorderForPreVertexCache(S.eastHemisphereGeometry))}var w=d.combineInstances(a);for(g=w.length,r=0;g>r;++r){o=w[r];var T,x=o.attributes;if(c)for(T in x)x.hasOwnProperty(T)&&x[T].componentDatatype===i.DOUBLE&&d.encodeAttribute(o,T,T+"3DHigh",T+"3DLow");else for(T in x)if(x.hasOwnProperty(T)&&x[T].componentDatatype===i.DOUBLE){var b=T+"3D",A=T+"2D";d.projectTo2D(o,T,b,A,l),n(o.boundingSphere)&&"position"===T&&(o.boundingSphereCV=e.fromVertices(o.attributes.position2D.values)),d.encodeAttribute(o,b,b+"High",b+"Low"),d.encodeAttribute(o,A,A+"High",A+"Low")}m&&d.compressVertices(o)}if(!u){var P=[];for(g=w.length,r=0;g>r;++r)o=w[r],P=P.concat(d.fitToUnsignedShortIndices(o));w=P}return w}function w(e,t,r){for(var n=[],o=e.attributes,a=r.length,s=0;a>s;++s){var l=r[s],u=o[l],c=u.componentDatatype;c===i.DOUBLE&&(c=i.FLOAT);var h=i.createTypedArray(c,u.values);n.push({index:t[l],componentDatatype:c,componentsPerAttribute:u.componentsPerAttribute,normalize:u.normalize,values:h}),delete o[l]}return n}function T(e,t,i,o,a,s,l,c,h){var d=u.computeNumberOfVertices(t);n(l[e])||(l[e]={boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV});for(var p=o.length,m=0;p>m;++m)for(var f=o[m],v=a[f],g=d;g>0;){for(var _,y=r(h[f],0),C=s[y],E=C.length,S=0;E>S&&(_=C[S],_.index!==v);++S);n(l[e][f])||(l[e][f]={dirty:!1,valid:!0,value:i[f].value,indices:[]});var w,T=_.values.length/_.componentsPerAttribute,x=r(c[f],0);T>x+g?(w=g,l[e][f].indices.push({attribute:_,offset:x,count:w}),c[f]=x+g):(w=T-x,l[e][f].indices.push({attribute:_,offset:x,count:w}),c[f]=0,h[f]=y+1),g-=w}}function x(e,t,i,r,o){var a,s,l,u=[],c=e.length,h={},d={};for(a=0;c>a;++a)s=e[a],l=s.attributes,n(s.geometry)&&T(a,s.geometry,l,o,r,i,u,h,d);for(a=0;c>a;++a)s=e[a],l=s.attributes,n(s.westHemisphereGeometry)&&T(a,s.westHemisphereGeometry,l,o,r,i,u,h,d);for(a=0;c>a;++a)s=e[a],l=s.attributes,n(s.eastHemisphereGeometry)&&T(a,s.eastHemisphereGeometry,l,o,r,i,u,h,d);for(c=t.length,a=0;c>a;++a){s=t[a],l=s.attributes;var p={};u.push(p);for(var m=o.length,f=0;m>f;++f){var v=o[f];p[v]={dirty:!1,valid:!1,value:l[v].value,indices:[]}}}return u}function b(e,t,i,r){var o,a,s,l=r.length-1;if(l>=0){var u=r[l];o=u.offset+u.count,s=u.index,a=i[s].indices.length}else o=0,s=0,a=i[s].indices.length;for(var c=e.length,h=0;c>h;++h){var d=e[h],p=d[t];if(n(p)){var m=p.indices.length;o+m>a&&(o=0,a=i[++s].indices.length),r.push({index:s,offset:o,count:m}),o+=m}}}function A(e,t){var i=[];return b(e,"geometry",t,i),b(e,"westHemisphereGeometry",t,i),b(e,"eastHemisphereGeometry",t,i),i}function P(e,t){var i=e.attributes;for(var r in i)if(i.hasOwnProperty(r)){var o=i[r];n(o)&&n(o.values)&&t.push(o.values.buffer)}n(e.indices)&&t.push(e.indices.buffer)}function I(e,t){for(var i=e.length,r=0;i>r;++r)P(e[r],t)}function M(e,t){for(var i=e.length,r=0;i>r;++r)for(var n=e[r],o=n.length,a=0;o>a;++a)t.push(n[a].values.buffer)}function D(t){for(var i=1,r=t.length,o=0;r>o;o++){var a=t[o];if(++i,n(a)){var s=a.attributes;i+=6+2*e.packedLength+(n(a.indices)?a.indices.length:0);for(var l in s)if(s.hasOwnProperty(l)&&n(s[l])){var u=s[l];i+=5+u.values.length}}}return i}function R(e,t){for(var i=e.length,r=new Uint32Array(e.length),n=0;i>n;++n)r[n]=e[n].toRgba();return t.push(r.buffer),r}function O(e){for(var i=e.length,r=new Array(i),n=0;i>n;n++)r[n]=t.fromRgba(e[n]);return r}function N(e){for(var t=e.length,i=1+17*t,r=0;t>r;r++){var o=e[r].attributes;for(var a in o)if(o.hasOwnProperty(a)&&n(o[a])){var s=o[a];i+=5+s.value.length}}return i}function L(e,t){var i=new Float64Array(N(e)),r={},o=[],a=e.length,s=0;i[s++]=a;for(var l=0;a>l;l++){var u=e[l];m.pack(u.modelMatrix,i,s),s+=m.packedLength;var c=u.attributes,h=[];for(var d in c)c.hasOwnProperty(d)&&n(c[d])&&(h.push(d),n(r[d])||(r[d]=o.length,o.push(d)));i[s++]=h.length;for(var p=0;pc;c++){for(var h=r[t[a++]],d=t[a++],p=t[a++],f=0!==t[a++],v=t[a++],g=i.createTypedArray(d,v),_=0;v>_;_++)g[_]=t[a++];l[h]={componentDatatype:d,componentsPerAttribute:p,normalize:f,value:g}}n[o++]={attributes:l,modelMatrix:s}}return n}function B(t){for(var i=t.length,r=1+i,o=0;i>o;o++){var a=t[o];r+=2,r+=n(a.boundingSphere)?e.packedLength:0,r+=n(a.boundingSphereCV)?e.packedLength:0;for(var s in a)if(a.hasOwnProperty(s)&&n(a[s])&&"boundingSphere"!==s&&"boundingSphereCV"!==s){var l=a[s];r+=4+3*l.indices.length+l.value.length}}return r}function V(t,i){var r=new Float64Array(B(t)),o=[],a=[],s={},l=t.length,u=0;r[u++]=l;for(var c=0;l>c;c++){var h=t[c],d=h.boundingSphere,p=n(d);r[u++]=p?1:0,p&&(e.pack(d,r,u),u+=e.packedLength),d=h.boundingSphereCV,p=n(d),r[u++]=p?1:0,p&&(e.pack(d,r,u),u+=e.packedLength);var m=[];for(var f in h)h.hasOwnProperty(f)&&n(h[f])&&"boundingSphere"!==f&&"boundingSphereCV"!==f&&(m.push(f),n(s[f])||(s[f]=o.length,o.push(f)));r[u++]=m.length;for(var v=0;vE;E++){var S=y[E];r[u++]=S.count,r[u++]=S.offset;var w=a.indexOf(S.attribute);-1===w&&(w=a.length,a.push(S.attribute)),r[u++]=w}r[u++]=_.value.length,r.set(_.value,u),u+=_.value.length}}return i.push(r.buffer),{stringTable:o,packedData:r,attributeTable:a}}function k(t,r){for(var n=t.stringTable,o=t.attributeTable,a=t.packedData,s=new Array(a[0]),l=0,u=1,c=a.length;c>u;){var h={},d=1===a[u++];d&&(h.boundingSphere=e.unpack(a,u),u+=e.packedLength),d=1===a[u++],d&&(h.boundingSphereCV=e.unpack(a,u),u+=e.packedLength);for(var p=a[u++],m=0;p>m;m++){for(var f=n[a[u++]],v=1===a[u++],g=a[u++],_=g>0?new Array(g):void 0,y=0;g>y;y++){var C={};C.count=a[u++],C.offset=a[u++],C.attribute=o[a[u++]],_[y]=C}for(var E=a[u++],S=v?i.createTypedArray(_[0].attribute.componentDatatype,E):new Array(E),w=0;E>w;w++)S[w]=a[u++];h[f]={dirty:!1,valid:v,indices:_,value:S}}s[l++]=h}return s}if(!s.supportsTypedArrays())return{};var z={};return z.combineGeometry=function(e){var t,i,r,o,a,s=e.instances,l=e.invalidInstances;if(s.length>0){t=S(e),i=d.createAttributeLocations(t[0]),o=y(s),r=[],a=t.length;for(var u=0;a>u;++u){var c=t[u];r.push(w(c,i,o))}}o=n(o)?o:y(l);var h,p=x(s,l,r,i,o);return e.createPickOffsets&&n(t)&&(h=A(s,t)),{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:i,vaAttributes:r,vaAttributeLocations:p,validInstancesIndices:e.validInstancesIndices,invalidInstancesIndices:e.invalidInstancesIndices,pickOffsets:h}},z.packCreateGeometryResults=function(t,i){var r=new Float64Array(D(t)),o=[],a={},s=t.length,l=0;r[l++]=s;for(var u=0;s>u;u++){var c=t[u],h=n(c);if(r[l++]=h?1:0,h){r[l++]=c.primitiveType,r[l++]=c.geometryType;var d=n(c.boundingSphere)?1:0;r[l++]=d,d&&e.pack(c.boundingSphere,r,l),l+=e.packedLength;var p=n(c.boundingSphereCV)?1:0;r[l++]=p,p&&e.pack(c.boundingSphereCV,r,l),l+=e.packedLength;var m=c.attributes,f=[];for(var v in m)m.hasOwnProperty(v)&&n(m[v])&&(f.push(v),n(a[v])||(a[v]=o.length,o.push(v)));r[l++]=f.length;for(var g=0;g0&&(r.set(c.indices,l),l+=C)}}return i.push(r.buffer),{stringTable:o,packedData:r}},z.unpackCreateGeometryResults=function(t){for(var r,n=t.stringTable,o=t.packedData,a=new Array(o[0]),s=0,l=1;lr;r++){var x=n[o[l++]],b=o[l++];S=o[l++];var A=0!==o[l++];C=o[l++],E=i.createTypedArray(b,C);for(var P=0;C>P;P++)E[P]=o[l++];w[x]=new c({componentDatatype:b,componentsPerAttribute:S,normalize:A,values:E})}var I;if(C=o[l++],C>0){var M=E.length/S;for(I=p.createTypedArray(M,C),r=0;C>r;r++)I[r]=o[l++]}a[s++]=new u({primitiveType:v,geometryType:g,boundingSphere:m,indices:I,attributes:w})}else a[s++]=void 0}return a},z.packCombineGeometryParameters=function(e,t){for(var i=e.createGeometryResults,r=i.length,n=0;r>n;n++)t.push(i[n].packedData.buffer);var o;return e.allowPicking&&(o=R(e.pickIds,t)),{createGeometryResults:e.createGeometryResults,packedInstances:L(e.instances,t),packedPickIds:o,ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof l,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,allowPicking:e.allowPicking,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},z.unpackCombineGeometryParameters=function(e){for(var t=F(e.packedInstances),i=e.allowPicking,r=i?O(e.packedPickIds):void 0,o=e.createGeometryResults,s=o.length,u=0,c=[],h=[],d=[],p=[],v=[],g=0;s>g;g++)for(var _=z.unpackCreateGeometryResults(o[g]),y=_.length,C=0;y>C;C++){var E=_[C],S=t[u];n(E)?(S.geometry=E,c.push(S),d.push(u),i&&v.push(r[u])):(h.push(S),p.push(u)),++u}var w=a.clone(e.ellipsoid),T=e.isGeographic?new l(w):new f(w);return{instances:c,invalidInstances:h,validInstancesIndices:d,invalidInstancesIndices:p,pickIds:v,ellipsoid:w,projection:T,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,allowPicking:e.allowPicking,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:m.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},z.packCombineGeometryResults=function(e,t){return n(e.geometries)&&(I(e.geometries,t),M(e.vaAttributes,t)),{geometries:e.geometries,attributeLocations:e.attributeLocations,vaAttributes:e.vaAttributes,packedVaAttributeLocations:V(e.vaAttributeLocations,t),modelMatrix:e.modelMatrix,validInstancesIndices:e.validInstancesIndices,invalidInstancesIndices:e.invalidInstancesIndices,pickOffsets:e.pickOffsets}},z.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,vaAttributes:e.vaAttributes,perInstanceAttributeLocations:k(e.packedVaAttributeLocations,e.vaAttributes),modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets}},z}),i("Scene/PrimitiveState",["../Core/freezeObject"],function(e){"use strict";var t={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6};return e(t)}),i("Scene/Primitive",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/clone","../Core/combine","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryInstance","../Core/GeometryInstanceAttribute","../Core/isArray","../Core/Matrix4","../Core/subdivideArray","../Core/TaskProcessor","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../ThirdParty/when","./CullFace","./Pass","./PrimitivePipeline","./PrimitiveState","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O){"use strict";function N(e){e=a(e,a.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.modelMatrix=_.clone(a(e.modelMatrix,_.IDENTITY)),this._modelMatrix=new _,this.show=a(e.show,!0),this._vertexCacheOptimize=a(e.vertexCacheOptimize,!1),this._interleave=a(e.interleave,!1),this._releaseGeometryInstances=a(e.releaseGeometryInstances,!0),this._allowPicking=a(e.allowPicking,!0),this._asynchronous=a(e.asynchronous,!0),this._compressVertices=a(e.compressVertices,!0),this.cull=a(e.cull,!0),this.debugShowBoundingVolume=a(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,this._modifiedModelView=new _,this._translucent=void 0,this._state=R.READY,this._geometries=[],this._vaAttributes=void 0,this._error=void 0,this._numberOfInstances=0,this._validModelMatrix=!1,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeLocations=void 0,this._perInstanceAttributeCache=[],this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._dirtyAttributes=[],this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._pickRS=void 0,this._pickSP=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._readOnlyInstanceAttributes=e._readOnlyInstanceAttributes,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1,this._readyPromise=P.defer()}function L(e){return new p({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:new e.values.constructor(e.values)})}function F(t){var i=t.attributes,r=new m;for(var n in i)i.hasOwnProperty(n)&&s(i[n])&&(r[n]=L(i[n]));var o;if(s(t.indices)){var a=t.indices;o=new a.constructor(a)}return new d({attributes:r,indices:o,primitiveType:t.primitiveType,boundingSphere:e.clone(t.boundingSphere)})}function B(e){return new v({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,value:new e.value.constructor(e.value)})}function V(e,t){var i=e.attributes,r={};for(var n in i)i.hasOwnProperty(n)&&(r[n]=B(i[n]));return new f({geometry:t,modelMatrix:_.clone(e.modelMatrix),attributes:r,pickPrimitive:e.pickPrimitive,id:e.id})}function k(e,t){if(!e.compressVertices)return t;var i=-1!==t.search(/attribute\s+vec3\s+normal;/g),r=-1!==t.search(/attribute\s+vec2\s+st;/g);if(!i&&!r)return t;var n=-1!==t.search(/attribute\s+vec3\s+tangent;/g),o=-1!==t.search(/attribute\s+vec3\s+binormal;/g),a=r&&i?2:1;a+=n||o?1:0;var s=a>1?"vec"+a:"float",l="compressedAttributes",u="attribute "+s+" "+l+";",c="",h="";if(r){c+="vec2 st;\n";var d=a>1?l+".x":l;h+=" st = czm_decompressTextureCoordinates("+d+");\n"}i&&n&&o?(c+="vec3 normal;\nvec3 tangent;\nvec3 binormal;\n",h+=" czm_octDecode("+l+"."+(r?"yz":"xy")+", normal, tangent, binormal);\n"):(i&&(c+="vec3 normal;\n",h+=" normal = czm_octDecode("+l+(a>1?"."+(r?"y":"x"):"")+");\n"),n&&(c+="vec3 tangent;\n",h+=" tangent = czm_octDecode("+l+"."+(r&&i?"z":"y")+");\n"),o&&(c+="vec3 binormal;\n",h+=" binormal = czm_octDecode("+l+"."+(r&&i?"z":"y")+");\n"));var p=t;p=p.replace(/attribute\s+vec3\s+normal;/g,""),p=p.replace(/attribute\s+vec2\s+st;/g,""),p=p.replace(/attribute\s+vec3\s+tangent;/g,""),p=p.replace(/attribute\s+vec3\s+binormal;/g,""),p=b.replaceMain(p,"czm_non_compressed_main");var m="void main() \n{ \n"+h+" czm_non_compressed_main(); \n}";return[u,c,p,m].join("\n")}function z(e,t){e.vertexAttributes}function U(e,t,i){for(var r=[],n=i.length,o=0;n>o;++o){var l={primitive:a(i[o].pickPrimitive,t)};s(i[o].id)&&(l.id=i[o].id);var u=e.createPickId(l);t._pickIds.push(u),r.push(u.color)}return r}function G(e,t){return function(){return e[t]}}function W(e,t){var i,r,n,o,l=e._instanceIds;if(e._state===R.READY){i=g(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];var u=e._numberOfInstances=i.length,c=[],h=[];for(n=0;u>n;++n)r=i[n].geometry,l.push(i[n].id),h.push({moduleName:r._workerName,geometry:r});if(!s(ie))for(ie=new Array(re),n=0;re>n;n++)ie[n]=new C("createGeometry",Number.POSITIVE_INFINITY);var d;for(h=y(h,re),n=0;no;++o)d=m[o],r=d.geometry,s(r.constructor.pack)&&(d.offset=p,p+=a(r.constructor.packedLength,r.packedLength));var v;if(p>0){var E=new Float64Array(p);for(v=[E.buffer],o=0;f>o;++o)d=m[o],r=d.geometry,s(r.constructor.pack)&&(r.constructor.pack(r,E,d.offset),d.geometry=E)}c.push(ie[n].scheduleTask({subTasks:h[n]},v))}e._state=R.CREATING,P.all(c,function(t){e._createGeometryResults=t,e._state=R.CREATED}).otherwise(function(i){ee(e,t,R.FAILED,i)})}else if(e._state===R.CREATED){var S=[];i=g(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];var w=e.allowPicking,T=t.scene3DOnly,x=t.mapProjection,b=ne.scheduleTask(D.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:i,pickIds:w?U(t.context,e,i):void 0,ellipsoid:x.ellipsoid,projection:x,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:T,allowPicking:w,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},S),S);e._createGeometryResults=void 0,e._state=R.COMBINING,P(b,function(i){var r=D.unpackCombineGeometryResults(i);e._geometries=r.geometries,e._attributeLocations=r.attributeLocations,e._vaAttributes=r.vaAttributes,e._perInstanceAttributeLocations=r.perInstanceAttributeLocations,e.modelMatrix=_.clone(r.modelMatrix,e.modelMatrix),e._validModelMatrix=!_.equals(e.modelMatrix,_.IDENTITY),e._pickOffsets=r.pickOffsets;for(var n=i.validInstancesIndices,o=i.invalidInstancesIndices,a=e._instanceIds,l=new Array(a.length),u=n.length,c=0;u>c;++c)l[c]=a[n[c]];for(var h=o.length,d=0;h>d;++d)l[u+d]=a[o[d]];e._instanceIds=l,s(e._geometries)?e._state=R.COMBINED:ee(e,t,R.FAILED,void 0)}).otherwise(function(i){ee(e,t,R.FAILED,i)})}}function H(e,t){var i,r,n=g(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],o=e._numberOfInstances=n.length,a=new Array(o),l=new Array(o),u=[],c=e._instanceIds,h=0;for(r=0;o>r;r++){i=n[r];var d,p=i.geometry;d=s(p.attributes)&&s(p.primitiveType)?F(p):p.constructor.createGeometry(p),s(d)?(a[h]=d,l[h++]=V(i,d),c.push(i.id)):u.push(i)}a.length=h,l.length=h;var m=e.allowPicking,f=t.scene3DOnly,v=t.mapProjection,y=D.combineGeometry({instances:l,invalidInstances:u,pickIds:m?U(t.context,e,l):void 0,ellipsoid:v.ellipsoid,projection:v,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:f,allowPicking:m,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});for(e._geometries=y.geometries,e._attributeLocations=y.attributeLocations,e._vaAttributes=y.vaAttributes,e._perInstanceAttributeLocations=y.vaAttributeLocations,e.modelMatrix=_.clone(y.modelMatrix,e.modelMatrix),e._validModelMatrix=!_.equals(e.modelMatrix,_.IDENTITY),e._pickOffsets=y.pickOffsets,r=0;rh;++h){for(var d=n[h],p=o[h],m=p.length,f=0;m>f;++f){var v=p[f];v.vertexBuffer=E.createVertexBuffer({context:l,typedArray:v.values,usage:S.DYNAMIC_DRAW}),delete v.values}if(u.push(A.fromGeometry({context:l,geometry:d,attributeLocations:r,bufferUsage:S.STATIC_DRAW,interleave:t._interleave,vertexArrayAttributes:p})),s(t._createBoundingVolumeFunction))t._createBoundingVolumeFunction(i,d);else if(t._boundingSpheres.push(e.clone(d.boundingSphere)),t._boundingSphereWC.push(new e),!a){var g=d.boundingSphereCV.center,_=g.x,y=g.y,C=g.z;g.x=C,g.y=_,g.z=y,t._boundingSphereCV.push(e.clone(d.boundingSphereCV)),t._boundingSphere2D.push(new e),t._boundingSphereMorph.push(new e)}}t._va=u,t._primitiveType=n[0].primitiveType,t.releaseGeometryInstances&&(t.geometryInstances=void 0),t._geometries=void 0,ee(t,i,R.COMPLETE,void 0)}function j(e,t,i,n){var o,a=i.getRenderState();n?(o=r(a,!1),o.cull={enabled:!0,face:I.BACK},e._frontFaceRS=T.fromCache(o),o.cull.face=I.FRONT,e._backFaceRS=T.fromCache(o)):(e._frontFaceRS=T.fromCache(a),e._backFaceRS=e._frontFaceRS),e.allowPicking?n?(o=r(a,!1),o.cull={enabled:!1},e._pickRS=T.fromCache(o)):e._pickRS=e._frontFaceRS:(o=r(a,!1),o.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n?(o.cull={enabled:!1},e._pickRS=T.fromCache(o)):e._pickRS=T.fromCache(o))}function Y(e,t,i){var r=t.context,n=N._modifyShaderPosition(e,i.vertexShaderSource,t.scene3DOnly);n=N._appendShowToShader(e,n),n=k(e,n);var o=i.getFragmentShaderSource(),a=e._attributeLocations;if(e._sp=x.replaceCache({context:r,shaderProgram:e._sp,vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:a}),z(e._sp,a),e.allowPicking){var s=new b({sources:[o],pickColorQualifier:"varying"});e._pickSP=x.replaceCache({context:r,shaderProgram:e._pickSP,vertexShaderSource:b.createPickVertexShaderSource(n),fragmentShaderSource:s,attributeLocations:a})}else e._pickSP=x.fromCache({context:r,vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:a});z(e._pickSP,a)}function X(e,t,i,r,o,a,l){var u=s(i)?i._uniforms:void 0,h={},d=t.uniforms;if(s(d))for(var p in d)if(d.hasOwnProperty(p)){if(s(u)&&s(u[p]))throw new c("Appearance and material have a uniform with the same name: "+p);h[p]=G(d,p)}var m=n(h,u);s(e.rtcCenter)&&(m.u_modifiedModelView=function(){return e._modifiedModelView});var f=r?M.TRANSLUCENT:M.OPAQUE;a.length=e._va.length*(o?2:1),l.length=e._va.length;for(var v=a.length,g=0,_=0,y=0;v>y;++y){var C;o&&(C=a[y],s(C)||(C=a[y]=new w({owner:e,primitiveType:e._primitiveType})),C.vertexArray=e._va[_],C.renderState=e._backFaceRS,C.shaderProgram=e._sp,C.uniformMap=m,C.pass=f,++y),C=a[y],s(C)||(C=a[y]=new w({owner:e,primitiveType:e._primitiveType})),C.vertexArray=e._va[_],C.renderState=e._frontFaceRS,C.shaderProgram=e._sp,C.uniformMap=m,C.pass=f;var E=l[g];s(E)||(E=l[g]=new w({owner:e,primitiveType:e._primitiveType})),E.vertexArray=e._va[_],E.renderState=e._pickRS,E.shaderProgram=e._pickSP,E.uniformMap=m,E.pass=f,++g,++_}}function Z(e){if(0!==e._dirtyAttributes.length){for(var t=e._dirtyAttributes,i=t.length,r=0;i>r;++r){for(var n=t[r],a=n.value,s=n.indices,l=s.length,u=0;l>u;++u){for(var c=s[u],h=c.offset,d=c.count,p=c.attribute,m=p.componentDatatype,f=p.componentsPerAttribute,v=o.createTypedArray(m,d*f),g=0;d>g;++g)v.set(a,g*f);var _=h*f*o.getSizeInBytes(m);p.vertexBuffer.copyFromArrayView(v,_)}n.dirty=!1}t.length=0}}function K(e,t){var i=e.appearance.pixelSize;if(s(i))for(var r=e._boundingSpheres.length,n=0;r>n;++n){var o=e._boundingSpheres[n],a=e._boundingSphereWC[n],l=t.camera.getPixelSize(o,t.context.drawingBufferWidth,t.context.drawingBufferHeight),u=l*i;a.radius=o.radius+u}}function Q(t,i,r,n,o,a,l,u){if(K(t,i),!_.equals(o,t._modelMatrix)){_.clone(o,t._modelMatrix);for(var c=t._boundingSpheres.length,h=0;c>h;++h){var d=t._boundingSpheres[h];s(d)&&(t._boundingSphereWC[h]=e.transform(d,o,t._boundingSphereWC[h]),i.scene3DOnly||(t._boundingSphere2D[h]=e.clone(t._boundingSphereCV[h],t._boundingSphere2D[h]),t._boundingSphere2D[h].center.x=0,t._boundingSphereMorph[h]=e.union(t._boundingSphereWC[h],t._boundingSphereCV[h])))}}if(s(t.rtcCenter)){var p=i.camera.viewMatrix;_.multiply(p,t._modelMatrix,t._modifiedModelView),_.multiplyByPoint(t._modifiedModelView,t.rtcCenter,oe),_.setTranslation(t._modifiedModelView,oe,t._modifiedModelView)}var m;i.mode===O.SCENE3D?m=t._boundingSphereWC:i.mode===O.COLUMBUS_VIEW?m=t._boundingSphereCV:i.mode===O.SCENE2D&&s(t._boundingSphere2D)?m=t._boundingSphere2D:s(t._boundingSphereMorph)&&(m=t._boundingSphereMorph);var f=i.commandList,v=i.passes;if(v.render)for(var g=r.length,y=0;g>y;++y){var C=u?Math.floor(y/2):y;r[y].modelMatrix=o,r[y].boundingVolume=m[C],r[y].cull=a,r[y].debugShowBoundingVolume=l,f.push(r[y])}if(v.pick)for(var E=n.length,S=0;E>S;++S)n[S].modelMatrix=o,n[S].boundingVolume=m[S],n[S].cull=a,f.push(n[S])}function J(e,t){var i=t[e];return function(){return s(i)&&s(i.value)?t[e].value:i}}function $(e,t,i){return function(r){var n=t[e];n.value=r,!n.dirty&&n.valid&&(i.push(n),n.dirty=!0)}}function ee(e,t,i,r){e._error=r,e._state=i,t.afterRender.push(function(){e._ready=e._state===R.COMPLETE||e._state===R.FAILED,s(r)?e._readyPromise.reject(r):e._readyPromise.resolve(e)})}l(N.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}}});var te=/attribute\s+vec(?:3|4)\s+(.*)3DHigh;/g;N._modifyShaderPosition=function(e,t,i){for(var r,n="",o="",a="";null!==(r=te.exec(t));){var l=r[1],u="vec4 czm_compute"+l[0].toUpperCase()+l.substr(1)+"()";"vec4 czm_computePosition()"!==u&&(n+=u+";\n"),s(e.rtcCenter)?(t=t.replace(/attribute\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/attribute\s+vec(?:3|4)\s+position3DLow;/g,""),n+="uniform mat4 u_modifiedModelView;\n",o+="attribute vec4 position;\n",a+=u+"\n{\n return u_modifiedModelView * position;\n}\n\n",t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):i?a+=u+"\n{\n return czm_translateRelativeToEye("+l+"3DHigh, "+l+"3DLow);\n}\n\n":(o+="attribute vec3 "+l+"2DHigh;\nattribute vec3 "+l+"2DLow;\n",a+=u+"\n{\n vec4 p;\n if (czm_morphTime == 1.0)\n {\n p = czm_translateRelativeToEye("+l+"3DHigh, "+l+"3DLow);\n }\n else if (czm_morphTime == 0.0)\n {\n p = czm_translateRelativeToEye("+l+"2DHigh.zxy, "+l+"2DLow.zxy);\n }\n else\n {\n p = czm_columbusViewMorph(\n czm_translateRelativeToEye("+l+"2DHigh.zxy, "+l+"2DLow.zxy),\n czm_translateRelativeToEye("+l+"3DHigh, "+l+"3DLow),\n czm_morphTime);\n }\n return p;\n}\n\n")}return[n,o,t,a].join("\n")},N._appendShowToShader=function(e,t){if(!s(e._attributeLocations.show))return t;var i=b.replaceMain(t,"czm_non_show_main"),r="attribute float show;\nvoid main() \n{ \n czm_non_show_main(); \n gl_Position *= show; \n}";return i+"\n"+r};var ie,re=Math.max(h.hardwareConcurrency-1,1),ne=new C("combineGeometry",Number.POSITIVE_INFINITY),oe=new i;N.prototype.update=function(e){if(!(!s(this.geometryInstances)&&0===this._va.length||s(this.geometryInstances)&&g(this.geometryInstances)&&0===this.geometryInstances.length||!s(this.appearance)||e.mode!==O.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)){if(s(this._error))throw this._error;if(s(this.rtcCenter)&&!e.scene3DOnly)throw new c("RTC rendering is only available for 3D only scenes.");if(this._state!==R.FAILED&&(this._state!==R.COMPLETE&&this._state!==R.COMBINED&&(this.asynchronous?W(this,e):H(this,e)),this._state===R.COMBINED&&q(this,e),this.show&&this._state===R.COMPLETE)){var t=this.appearance,i=t.material,r=!1,n=!1;this._appearance!==t?(this._appearance=t,this._material=i,r=!0,n=!0):this._material!==i&&(this._material=i,n=!0);var o=this._appearance.isTranslucent();this._translucent!==o&&(this._translucent=o,r=!0);var l=e.context;s(this._material)&&this._material.update(l);var u=t.closed&&o;if(r){var h=a(this._createRenderStatesFunction,j);h(this,l,t,u)}if(n){var d=a(this._createShaderProgramFunction,Y);d(this,e,t)}if(r||n){var p=a(this._createCommandsFunction,X);p(this,t,i,o,u,this._colorCommands,this._pickCommands)}Z(this);var m=a(this._updateAndQueueCommandsFunction,Q);m(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)}}};var ae=["boundingSphere","boundingSphereCV"];return N.prototype.getGeometryInstanceAttributes=function(e){for(var t=-1,i=this._lastPerInstanceAttributeIndex,r=this._instanceIds,n=r.length,o=0;n>o;++o){var a=(i+o)%n;if(e===r[a]){t=a;break}}if(-1!==t){var u=this._perInstanceAttributeCache[t];if(s(u))return u;var c=this._perInstanceAttributeLocations[t];u={};var h={},d=!1;for(var p in c)if(c.hasOwnProperty(p)){d=!0,h[p]={get:J(p,c)};var m=!0,f=ae;n=f.length;for(var v=0;n>v;++v)if(p===ae[v]){m=!1;break}if(f=this._readOnlyInstanceAttributes,m&&s(f)){n=f.length;for(var g=0;n>g;++g)if(p===f[g]){m=!1;break}}m&&(h[p].set=$(p,c,this._dirtyAttributes))}return d&&l(u,h),this._lastPerInstanceAttributeIndex=t,this._perInstanceAttributeCache[t]=u,u}},N.prototype.isDestroyed=function(){return!1},N.prototype.destroy=function(){var e,t;this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy();var i=this._va;for(e=i.length,t=0;e>t;++t)i[t].destroy();this._va=void 0;var r=this._pickIds;for(e=r.length,t=0;e>t;++t)r[t].destroy();return this._pickIds=void 0,this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._perInstanceAttributeLocations=void 0,this._attributeLocations=void 0,this._dirtyAttributes=void 0,u(this)},N}),i("DataSources/ColorMaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./ConstantProperty","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this.color=e}return i(l.prototype,{isConstant:{get:function(){return s.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:a("color")}),l.prototype.getType=function(e){return"Color"},l.prototype.getValue=function(i,r){return t(r)||(r={}),r.color=s.getValueOrClonedDefault(this._color,i,e.WHITE,r.color),r},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._color,e._color)},l}),i("DataSources/dynamicGeometryGetBoundingSphere",["../Core/BoundingSphere","../Core/defined","../Core/DeveloperError","./BoundingSphereState"],function(e,t,i,r){ -"use strict";function n(i,n,o,a){var s;return t(n)&&n.show&&n.ready&&(s=n.getGeometryInstanceAttributes(i),t(s)&&t(s.boundingSphere))?(e.transform(s.boundingSphere,n.modelMatrix,a),r.DONE):t(o)&&o.show&&o.ready&&(s=o.getGeometryInstanceAttributes(i),t(s)&&t(s.boundingSphere))?(e.transform(s.boundingSphere,o.modelMatrix,a),r.DONE):t(n)&&!n.ready||t(o)&&!o.ready?r.PENDING:r.FAILED}return n}),i("DataSources/MaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Scene/Material"],function(e,t,i,r,n){"use strict";function o(){r.throwInstantiationError()}return i(o.prototype,{isConstant:{get:r.throwInstantiationError},definitionChanged:{get:r.throwInstantiationError}}),o.prototype.getType=r.throwInstantiationError,o.prototype.getValue=r.throwInstantiationError,o.prototype.equals=r.throwInstantiationError,o.getValue=function(i,r,o){var a;return t(r)&&(a=r.getType(i),t(a))?(t(o)&&o.type===a||(o=n.fromType(a)),r.getValue(i,o.uniforms),o):(t(o)&&o.type===n.ColorType||(o=n.fromType(n.ColorType)),e.clone(e.WHITE,o.uniforms.color),o)},o}),i("DataSources/BoxGeometryUpdater",["../Core/BoxGeometry","../Core/BoxOutlineGeometry","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C){"use strict";function E(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0}function S(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(S.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new E(e),this._onEntityPropertyChanged(e,"box",e.box,void 0)}function w(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new E(t._entity)}var T=new v(i.WHITE),x=new g(!0),b=new g(!0),A=new g(!1),P=new g(i.BLACK),I=new i;return a(S,{perInstanceColorAppearanceType:{value:m},materialAppearanceType:{value:p}}),a(S.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!o(this._entity.availability)&&C.isConstant(this._showProperty)&&C.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!o(this._entity.availability)&&C.isConstant(this._showProperty)&&C.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),S.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},S.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},S.prototype.createFillGeometryInstance=function(t){var n,a,s=this._entity,l=s.isAvailable(t),u=new d(l&&s.isShowing&&this._showProperty.getValue(t)&&this._fillProperty.getValue(t));if(this._materialProperty instanceof v){var p=i.WHITE;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(p=this._materialProperty.color.getValue(t)),a=r.fromColor(p),n={show:u,color:a}}else n={show:u};return new c({id:s,geometry:e.fromDimensions(this._options),modelMatrix:s._getModelMatrix(h.MINIMUM_VALUE),attributes:n})},S.prototype.createOutlineGeometryInstance=function(e){var n=this._entity,o=n.isAvailable(e),a=C.getValueOrDefault(this._outlineColorProperty,e,i.BLACK);return new c({id:n,geometry:t.fromDimensions(this._options),modelMatrix:n._getModelMatrix(h.MINIMUM_VALUE),attributes:{show:new d(o&&n.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:r.fromColor(a)}})},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){this._entitySubscription(),s(this)},S.prototype._onEntityPropertyChanged=function(e,t,i,r){if("availability"===t||"position"===t||"orientation"===t||"box"===t){var a=this._entity.box;if(!o(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=o(s)&&s.isConstant?s.getValue(h.MINIMUM_VALUE):!0,u=a.outline,c=o(u);if(c&&u.isConstant&&(c=u.getValue(h.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=a.dimensions,f=e.position,g=a.show;if(!o(d)||!o(f)||o(g)&&g.isConstant&&!g.getValue(h.MINIMUM_VALUE))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var _=n(a.material,T),y=_ instanceof v;this._materialProperty=_,this._fillProperty=n(s,b),this._showProperty=n(g,x),this._showOutlineProperty=n(a.outline,A),this._outlineColorProperty=c?n(a.outlineColor,P):void 0;var E=a.outlineWidth;if(this._fillEnabled=l,this._outlineEnabled=c,f.isConstant&&C.isConstant(e.orientation)&&d.isConstant&&C.isConstant(E)){var S=this._options;S.vertexFormat=y?m.VERTEX_FORMAT:p.MaterialSupport.TEXTURED.vertexFormat,S.dimensions=d.getValue(h.MINIMUM_VALUE,S.dimensions),this._outlineWidth=o(E)?E.getValue(h.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},S.prototype.createDynamicUpdater=function(e){return new w(e,this)},w.prototype.update=function(n){var a=this._primitives;a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var s=this._geometryUpdater,l=s._entity,u=l.box;if(l.isShowing&&l.isAvailable(n)&&C.getValueOrDefault(u.show,n,!0)){var h=this._options,d=l._getModelMatrix(n),v=C.getValueOrUndefined(u.dimensions,n,h.dimensions);if(o(d)&&o(v)){if(h.dimensions=v,C.getValueOrDefault(u.fill,n,!0)){var g=y.getValue(n,s.fillMaterialProperty,this._material);this._material=g;var _=new p({material:g,translucent:g.isTranslucent(),closed:!0});h.vertexFormat=_.vertexFormat,this._primitive=a.add(new f({geometryInstances:new c({id:l,geometry:e.fromDimensions(h),modelMatrix:d}),appearance:_,asynchronous:!1}))}if(C.getValueOrDefault(u.outline,n,!1)){h.vertexFormat=m.VERTEX_FORMAT;var E=C.getValueOrClonedDefault(u.outlineColor,n,i.BLACK,I),S=C.getValueOrDefault(u.outlineWidth,n,1),w=1!==E.alpha;this._outlinePrimitive=a.add(new f({geometryInstances:new c({id:l,geometry:t.fromDimensions(h),modelMatrix:d,attributes:{color:r.fromColor(E)}}),appearance:new m({flat:!0,translucent:w,renderState:{lineWidth:s._scene.clampLineWidth(S)}}),asynchronous:!1}))}}}},w.prototype.getBoundingSphere=function(e,t){return _(e,this._primitive,this._outlinePrimitive,t)},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),s(this)},S}),i("DataSources/ImageMaterialProperty",["../Core/Cartesian2","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._alpha=void 0,this._alphaSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.alpha=e.alpha}var l=new e(1,1),u=1;return r(s.prototype,{isConstant:{get:function(){return a.isConstant(this._image)&&a.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:o("image"),repeat:o("repeat"),alpha:o("alpha")}),s.prototype.getType=function(e){return"Image"},s.prototype.getValue=function(e,t){return i(t)||(t={}),t.image=a.getValueOrUndefined(this._image,e),t.repeat=a.getValueOrClonedDefault(this._repeat,e,l,t.repeat),t.alpha=a.getValueOrDefault(this._alpha,e,u),t},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._image,e._image)&&a.equals(this._alpha,e._alpha)&&a.equals(this._repeat,e._repeat)},s}),i("DataSources/createMaterialPropertyDescriptor",["../Core/Color","../Core/DeveloperError","./ColorMaterialProperty","./createPropertyDescriptor","./ImageMaterialProperty"],function(e,t,i,r,n){"use strict";function o(t){if(t instanceof e)return new i(t);if("string"==typeof t||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement){var r=new n;return r.image=t,r}}function a(e,t){return r(e,t,o)}return a}),i("DataSources/BoxGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._dimensions=void 0,this._dimensionsSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),dimensions:a("dimensions"),material:o("material"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth")}),s.prototype.clone=function(e){return t(e)?(e.dimensions=this.dimensions,e.show=this.show,e.material=this.material,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e):new s(this)},s.prototype.merge=function(t){this.dimensions=e(this.dimensions,t.dimensions),this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth)},s}),i("DataSources/CallbackProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event"],function(e,t,i,r){"use strict";function n(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new r,this.setCallback(e,t)}return t(n.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}}),n.prototype.getValue=function(e,t){return this._callback(e,t)},n.prototype.setCallback=function(e,t){var i=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,i&&this._definitionChanged.raiseEvent(this)},n.prototype.equals=function(e){return this===e||e instanceof n&&this._callback===e._callback&&this._isConstant===e._isConstant},n}),i("DataSources/CheckerboardMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=i(e,i.EMPTY_OBJECT),this._definitionChanged=new o,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}var u=t.WHITE,c=t.BLACK,h=new e(2,2);return n(l.prototype,{isConstant:{get:function(){return s.isConstant(this._evenColor)&&s.isConstant(this._oddColor)&&s.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:a("evenColor"),oddColor:a("oddColor"),repeat:a("repeat")}),l.prototype.getType=function(e){return"Checkerboard"},l.prototype.getValue=function(e,t){return r(t)||(t={}),t.lightColor=s.getValueOrClonedDefault(this._evenColor,e,u,t.lightColor),t.darkColor=s.getValueOrClonedDefault(this._oddColor,e,c,t.darkColor),t.repeat=s.getValueOrDefault(this._repeat,e,h),t},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._evenColor,e._evenColor)&&s.equals(this._oddColor,e._oddColor)&&s.equals(this._repeat,e._repeat)},l}),i("DataSources/PositionProperty",["../Core/Cartesian3","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix3","../Core/ReferenceFrame","../Core/Transforms"],function(e,t,i,r,n,o,a){"use strict";function s(){r.throwInstantiationError()}i(s.prototype,{isConstant:{get:r.throwInstantiationError},definitionChanged:{get:r.throwInstantiationError},referenceFrame:{get:r.throwInstantiationError}}),s.prototype.getValue=r.throwInstantiationError,s.prototype.getValueInReferenceFrame=r.throwInstantiationError,s.prototype.equals=r.throwInstantiationError;var l=new n;return s.convertToReferenceFrame=function(i,r,s,u,c){if(!t(r))return r;if(t(c)||(c=new e),s===u)return e.clone(r,c);var h=a.computeIcrfToFixedMatrix(i,l);return t(h)||(h=a.computeTemeToPseudoFixedMatrix(i,l)),s===o.INERTIAL?n.multiplyByVector(h,r,c):s===o.FIXED?n.multiplyByVector(n.transpose(h,l),r,c):void 0},s}),i("DataSources/ConstantPositionProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./PositionProperty"],function(e,t,i,r,n,o,a,s){"use strict";function l(i,r){this._definitionChanged=new o,this._value=e.clone(i),this._referenceFrame=t(r,a.FIXED)}return r(l.prototype,{isConstant:{get:function(){return!i(this._value)||this._referenceFrame===a.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),l.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,a.FIXED,t)},l.prototype.setValue=function(t,r){var n=!1;e.equals(this._value,t)||(n=!0,this._value=e.clone(t)),i(r)&&this._referenceFrame!==r&&(n=!0,this._referenceFrame=r),n&&this._definitionChanged.raiseEvent(this)},l.prototype.getValueInReferenceFrame=function(e,t,i){return s.convertToReferenceFrame(e,this._value,this._referenceFrame,t,i)},l.prototype.equals=function(t){return this===t||t instanceof l&&e.equals(this._value,t._value)&&this._referenceFrame===t._referenceFrame},l}),i("DataSources/CorridorGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),positions:a("positions"),height:a("height"),extrudedHeight:a("extrudedHeight"),granularity:a("granularity"),width:a("width"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),cornerType:a("cornerType")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.positions=this.positions,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.width=this.width,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.cornerType=this.cornerType,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.positions=e(this.positions,t.positions),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.width=e(this.width,t.width),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.cornerType=e(this.cornerType,t.cornerType)},s}),i("DataSources/createRawPropertyDescriptor",["./createPropertyDescriptor"],function(e){"use strict";function t(e){return e}function i(i,r){return e(i,r,t)}return i}),i("DataSources/CylinderGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},length:a("length"),topRadius:a("topRadius"),bottomRadius:a("bottomRadius"),numberOfVerticalLines:a("numberOfVerticalLines"),slices:a("slices"),show:a("show"),material:o("material"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth")}),s.prototype.clone=function(e){return t(e)?(e.bottomRadius=this.bottomRadius,e.length=this.length,e.topRadius=this.topRadius,e.show=this.show,e.material=this.material,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e):new s(this)},s.prototype.merge=function(t){this.bottomRadius=e(this.bottomRadius,t.bottomRadius),this.length=e(this.length,t.length),this.topRadius=e(this.topRadius,t.topRadius),this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.numberOfVerticalLines=e(this.numberOfVerticalLines,t.numberOfVerticalLines),this.slices=e(this.slices,t.slices),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth)},s}),i("DataSources/EllipseGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},semiMajorAxis:a("semiMajorAxis"),semiMinorAxis:a("semiMinorAxis"),rotation:a("rotation"),show:a("show"),material:o("material"),height:a("height"),extrudedHeight:a("extrudedHeight"),granularity:a("granularity"),stRotation:a("stRotation"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),numberOfVerticalLines:a("numberOfVerticalLines")}),s.prototype.clone=function(e){return t(e)?(e.rotation=this.rotation,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.show=this.show,e.material=this.material,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.stRotation=this.stRotation,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e):new s(this)},s.prototype.merge=function(t){this.rotation=e(this.rotation,t.rotation),this.semiMajorAxis=e(this.semiMajorAxis,t.semiMajorAxis),this.semiMinorAxis=e(this.semiMinorAxis,t.semiMinorAxis),this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.stRotation=e(this.stRotation,t.stRotation),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.numberOfVerticalLines=e(this.numberOfVerticalLines,t.numberOfVerticalLines)},s}),i("DataSources/EllipsoidGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),radii:a("radii"),material:o("material"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),stackPartitions:a("stackPartitions"),slicePartitions:a("slicePartitions"),subdivisions:a("subdivisions")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.radii=this.radii,e.material=this.material,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.radii=e(this.radii,t.radii),this.material=e(this.material,t.material),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.stackPartitions=e(this.stackPartitions,t.stackPartitions),this.slicePartitions=e(this.slicePartitions,t.slicePartitions),this.subdivisions=e(this.subdivisions,t.subdivisions)},s}),i("DataSources/LabelGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,i,r,n,o){"use strict";function a(t){this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},text:o("text"),font:o("font"),style:o("style"),fillColor:o("fillColor"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth"),horizontalOrigin:o("horizontalOrigin"),verticalOrigin:o("verticalOrigin"),eyeOffset:o("eyeOffset"),pixelOffset:o("pixelOffset"),scale:o("scale"),show:o("show"),translucencyByDistance:o("translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance")}),a.prototype.clone=function(e){return t(e)?(e.text=this.text,e.font=this.font,e.show=this.show,e.style=this.style,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scale=this.scale,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.eyeOffset=this.eyeOffset,e.pixelOffset=this.pixelOffset,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e):new a(this)},a.prototype.merge=function(t){this.text=e(this.text,t.text),this.font=e(this.font,t.font),this.show=e(this.show,t.show),this.style=e(this.style,t.style),this.fillColor=e(this.fillColor,t.fillColor),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.scale=e(this.scale,t.scale),this.horizontalOrigin=e(this.horizontalOrigin,t.horizontalOrigin),this.verticalOrigin=e(this.verticalOrigin,t.verticalOrigin),this.eyeOffset=e(this.eyeOffset,t.eyeOffset),this.pixelOffset=e(this.pixelOffset,t.pixelOffset),this.translucencyByDistance=e(this._translucencyByDistance,t.translucencyByDistance),this.pixelOffsetScaleByDistance=e(this._pixelOffsetScaleByDistance,t.pixelOffsetScaleByDistance)},a}),i("DataSources/NodeTransformationProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/TranslationRotationScale","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a){"use strict";var s=new n,l=function(t){t=e(t,e.EMPTY_OBJECT),this._definitionChanged=new r,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=t.translation,this.rotation=t.rotation,this.scale=t.scale};return i(l.prototype,{isConstant:{get:function(){return a.isConstant(this._translation)&&a.isConstant(this._rotation)&&a.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:o("translation"),rotation:o("rotation"),scale:o("scale")}),l.prototype.getValue=function(e,i){return t(i)||(i=new n),i.translation=a.getValueOrClonedDefault(this._translation,e,s.translation,i.translation),i.rotation=a.getValueOrClonedDefault(this._rotation,e,s.rotation,i.rotation),i.scale=a.getValueOrClonedDefault(this._scale,e,s.scale,i.scale),i},l.prototype.equals=function(e){return this===e||e instanceof l&&a.equals(this._translation,e._translation)&&a.equals(this._rotation,e._rotation)&&a.equals(this._scale,e._scale)},l}),i("DataSources/PropertyBag",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./ConstantProperty","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){return new o(e)}function u(e,t){var i=e._propertyNames,r=t._propertyNames,n=i.length;if(n!==r.length)return!1;for(var o=0;n>o;++o){var a=i[o],l=r.indexOf(a);if(-1===l)return!1;if(!s.equals(e[a],t[a]))return!1}return!0}var c=function(e,i){this._propertyNames=[],this._definitionChanged=new n,t(e)&&this.merge(e,i)};return i(c.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){for(var e=this._propertyNames,t=0,i=e.length;i>t;t++)if(!s.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),c.prototype.hasProperty=function(e){return-1!==this._propertyNames.indexOf(e)},c.prototype.addProperty=function(i,r,n){var o=this._propertyNames;o.push(i),Object.defineProperty(this,i,a(i,!0,e(n,l))),t(r)&&(this[i]=r),this._definitionChanged.raiseEvent(this)},c.prototype.removeProperty=function(e){var t=this._propertyNames,i=t.indexOf(e);this._propertyNames.splice(i,1),delete this[e],this._definitionChanged.raiseEvent(this)},c.prototype.getValue=function(e,i){t(i)||(i={});for(var r=this._propertyNames,n=0,o=r.length;o>n;n++){var a=r[n];i[a]=s.getValueOrUndefined(this[a],e,i[a])}return i},c.prototype.merge=function(e,i){for(var r=this._propertyNames,n=t(e._propertyNames)?e._propertyNames:Object.keys(e),o=0,a=n.length;a>o;o++){var s=n[o],l=this[s],u=e[s];t(l)||-1!==r.indexOf(s)||this.addProperty(s,void 0,i),t(u)&&(t(l)?t(l.merge)&&l.merge(u):t(u.merge)&&t(u.clone)?this[s]=u.clone():this[s]=u)}},c.prototype.equals=function(e){return this===e||e instanceof c&&u(this,e)},c}),i("DataSources/ModelGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor","./NodeTransformationProperty","./PropertyBag"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){return new a(e)}function u(e){return new s(e,l)}function c(t){this._show=void 0,this._showSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(c.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),scale:o("scale"),minimumPixelSize:o("minimumPixelSize"),maximumScale:o("maximumScale"), -incrementallyLoadTextures:o("incrementallyLoadTextures"),uri:o("uri"),runAnimations:o("runAnimations"),nodeTransformations:o("nodeTransformations",void 0,u)}),c.prototype.clone=function(e){return t(e)?(e.show=this.show,e.scale=this.scale,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.uri=this.uri,e.runAnimations=this.runAnimations,e.nodeTransformations=this.nodeTransformations,e):new c(this)},c.prototype.merge=function(i){this.show=e(this.show,i.show),this.scale=e(this.scale,i.scale),this.minimumPixelSize=e(this.minimumPixelSize,i.minimumPixelSize),this.maximumScale=e(this.maximumScale,i.maximumScale),this.incrementallyLoadTextures=e(this.incrementallyLoadTextures,i.incrementallyLoadTextures),this.uri=e(this.uri,i.uri),this.runAnimations=e(this.runAnimations,i.runAnimations);var r=i.nodeTransformations;if(t(r)){var n=this.nodeTransformations;t(n)?n.merge(r):this.nodeTransformations=new s(r,l)}},c}),i("DataSources/PathGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._material=void 0,this._materialSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),width:a("width"),resolution:a("resolution"),leadTime:a("leadTime"),trailTime:a("trailTime")}),s.prototype.clone=function(e){return t(e)?(e.material=this.material,e.width=this.width,e.resolution=this.resolution,e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e):new s(this)},s.prototype.merge=function(t){this.material=e(this.material,t.material),this.width=e(this.width,t.width),this.resolution=e(this.resolution,t.resolution),this.show=e(this.show,t.show),this.leadTime=e(this.leadTime,t.leadTime),this.trailTime=e(this.trailTime,t.trailTime)},s}),i("DataSources/PointGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,i,r,n,o){"use strict";function a(t){this._color=void 0,this._colorSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),pixelSize:o("pixelSize"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth"),show:o("show"),scaleByDistance:o("scaleByDistance"),translucencyByDistance:o("translucencyByDistance")}),a.prototype.clone=function(e){return t(e)?(e.color=this.color,e.pixelSize=this.pixelSize,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.show=this.show,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e):new a(this)},a.prototype.merge=function(t){this.color=e(this.color,t.color),this.pixelSize=e(this.pixelSize,t.pixelSize),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.show=e(this.show,t.show),this.scaleByDistance=e(this.scaleByDistance,t.scaleByDistance),this.translucencyByDistance=e(this._translucencyByDistance,t.translucencyByDistance)},a}),i("DataSources/PolygonGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._definitionChanged=new n,this._fill=void 0,this._fillSubscription=void 0,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),hierarchy:a("hierarchy"),height:a("height"),extrudedHeight:a("extrudedHeight"),granularity:a("granularity"),stRotation:a("stRotation"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),perPositionHeight:a("perPositionHeight")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.hierarchy=this.hierarchy,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.stRotation=this.stRotation,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.hierarchy=e(this.hierarchy,t.hierarchy),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.stRotation=e(this.stRotation,t.stRotation),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.perPositionHeight=e(this.perPositionHeight,t.perPositionHeight)},s}),i("DataSources/PolylineGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._followSurface=void 0,this._followSurfaceSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._widthSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),positions:a("positions"),width:a("width"),followSurface:a("followSurface"),granularity:a("granularity")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.positions=this.positions,e.width=this.width,e.followSurface=this.followSurface,e.granularity=this.granularity,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.positions=e(this.positions,t.positions),this.width=e(this.width,t.width),this.followSurface=e(this.followSurface,t.followSurface),this.granularity=e(this.granularity,t.granularity)},s}),i("DataSources/PolylineVolumeGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),positions:a("positions"),shape:a("shape"),granularity:a("granularity"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),cornerType:a("cornerType")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.positions=this.positions,e.shape=this.shape,e.granularity=this.granularity,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.cornerType=this.cornerType,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.positions=e(this.positions,t.positions),this.shape=e(this.shape,t.shape),this.granularity=e(this.granularity,t.granularity),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.cornerType=e(this.cornerType,t.cornerType)},s}),i("DataSources/RectangleGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),coordinates:a("coordinates"),material:o("material"),height:a("height"),extrudedHeight:a("extrudedHeight"),granularity:a("granularity"),stRotation:a("stRotation"),rotation:a("rotation"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),closeTop:a("closeTop"),closeBottom:a("closeBottom")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.coordinates=this.coordinates,e.material=this.material,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.stRotation=this.stRotation,e.rotation=this.rotation,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.coordinates=e(this.coordinates,t.coordinates),this.material=e(this.material,t.material),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.stRotation=e(this.stRotation,t.stRotation),this.rotation=e(this.rotation,t.rotation),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.closeTop=e(this.closeTop,t.closeTop),this.closeBottom=e(this.closeBottom,t.closeBottom)},s}),i("DataSources/WallGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),positions:a("positions"),minimumHeights:a("minimumHeights"),maximumHeights:a("maximumHeights"),granularity:a("granularity"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.positions=e(this.positions,t.positions),this.minimumHeights=e(this.minimumHeights,t.minimumHeights),this.maximumHeights=e(this.maximumHeights,t.maximumHeights),this.granularity=e(this.granularity,t.granularity),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth)},s}),i("DataSources/Entity",["../Core/Cartesian3","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/Transforms","./BillboardGraphics","./BoxGraphics","./ConstantPositionProperty","./CorridorGraphics","./createPropertyDescriptor","./createRawPropertyDescriptor","./CylinderGraphics","./EllipseGraphics","./EllipsoidGraphics","./LabelGraphics","./ModelGraphics","./PathGraphics","./PointGraphics","./PolygonGraphics","./PolylineGraphics","./PolylineVolumeGraphics","./Property","./RectangleGraphics","./WallGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I){"use strict";function M(e){return new p(e)}function D(e){return f(e,void 0,M)}function R(e,t){return f(e,void 0,function(e){return e instanceof t?e:new t(e)})}function O(e){e=i(e,i.EMPTY_OBJECT);var n=e.id;r(n)||(n=t()),this._availability=void 0,this._id=n,this._definitionChanged=new a,this._name=e.name,this._show=i(e.show,!0),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","orientation","path","point","polygon","polyline","polylineVolume","position","rectangle","viewFrom","wall"],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function N(e,t,i){for(var r=t.length,n=0;r>n;n++){var o=t[n],a=o._show,s=!i&&a,l=i&&a;s!==l&&N(o,o._children,i)}e._definitionChanged.raiseEvent(e,"isShowing",i,!i)}n(O.prototype,{availability:v("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:v("name"),show:{get:function(){return this._show},set:function(e){if(e!==this._show){var t=this.isShowing;this._show=e;var i=this.isShowing;t!==i&&N(this,this._children,i),this._definitionChanged.raiseEvent(this,"show",e,!e)}}},isShowing:{get:function(){return this._show&&(!r(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){var t=this._parent;if(t!==e){var i=this.isShowing;if(r(t)){var n=t._children.indexOf(this);t._children.splice(n,1)}this._parent=e,r(e)&&e._children.push(this);var o=this.isShowing;i!==o&&N(this,this._children,o),this._definitionChanged.raiseEvent(this,"parent",e,t)}}},propertyNames:{get:function(){return this._propertyNames}},billboard:R("billboard",h),box:R("box",d),corridor:R("corridor",m),cylinder:R("cylinder",g),description:f("description"),ellipse:R("ellipse",_),ellipsoid:R("ellipsoid",y),label:R("label",C),model:R("model",E),orientation:f("orientation"),path:R("path",S),point:R("point",w),polygon:R("polygon",T),polyline:R("polyline",x),polylineVolume:R("polylineVolume",b),position:D("position"),rectangle:R("rectangle",P),viewFrom:f("viewFrom"),wall:R("wall",I)}),O.prototype.isAvailable=function(e){var t=this._availability;return!r(t)||t.contains(e)},O.prototype.addProperty=function(e){var t=this._propertyNames;t.push(e),Object.defineProperty(this,e,v(e,!0))},O.prototype.removeProperty=function(e){var t=this._propertyNames,i=t.indexOf(e);this._propertyNames.splice(i,1),delete this[e]},O.prototype.merge=function(e){this.name=i(this.name,e.name),this.availability=i(e.availability,this.availability);for(var t=this._propertyNames,n=r(e._propertyNames)?e._propertyNames:Object.keys(e),o=n.length,a=0;o>a;a++){var s=n[a];if("parent"!==s){var l=this[s],u=e[s];r(l)||-1!==t.indexOf(s)||this.addProperty(s),r(u)&&(r(l)?r(l.merge)&&l.merge(u):r(u.merge)&&r(u.clone)?this[s]=u.clone():this[s]=u)}}};var L=new s,F=new e,B=new u;return O.prototype._getModelMatrix=function(e,t){var i=A.getValueOrUndefined(this._position,e,F);if(r(i)){var n=A.getValueOrUndefined(this._orientation,e,B);return t=r(n)?l.fromRotationTranslation(s.fromQuaternion(n,L),i,t):c.eastNorthUpToFixedFrame(i,void 0,t)}},O}),i("DataSources/EntityCollection",["../Core/AssociativeArray","../Core/createGuid","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/Iso8601","../Core/JulianDate","../Core/RuntimeError","../Core/TimeInterval","./Entity"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e){if(0===e._suspendCount){var t=e._addedEntities,i=e._removedEntities,r=e._changedEntities;(0!==r.length||0!==t.length||0!==i.length)&&(e._collectionChanged.raiseEvent(e,t.values,i.values,r.values),t.removeAll(),i.removeAll(),r.removeAll())}}function d(i){this._owner=i,this._entities=new e,this._addedEntities=new e,this._removedEntities=new e,this._changedEntities=new e,this._suspendCount=0,this._collectionChanged=new o,this._id=t()}var p={id:void 0};return d.prototype.suspendEvents=function(){this._suspendCount++},d.prototype.resumeEvents=function(){this._suspendCount--,h(this)},d.collectionChangedEventCallback=void 0,r(d.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},owner:{get:function(){return this._owner}}}),d.prototype.computeAvailability=function(){for(var e=a.MAXIMUM_VALUE,t=a.MINIMUM_VALUE,r=this._entities.values,n=0,o=r.length;o>n;n++){var l=r[n],c=l.availability;if(i(c)){var h=c.start,d=c.stop;s.lessThan(h,e)&&!h.equals(a.MINIMUM_VALUE)&&(e=h),s.greaterThan(d,t)&&!d.equals(a.MAXIMUM_VALUE)&&(t=d)}}return a.MAXIMUM_VALUE.equals(e)&&(e=a.MINIMUM_VALUE),a.MINIMUM_VALUE.equals(t)&&(t=a.MAXIMUM_VALUE),new u({start:e,stop:t})},d.prototype.add=function(e){e instanceof c||(e=new c(e));var t=e.id,i=this._entities;if(i.contains(t))throw new l("An entity with id "+t+" already exists in this collection.");return e.entityCollection=this,i.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(d.prototype._onEntityDefinitionChanged,this),h(this),e},d.prototype.remove=function(e){return i(e)?this.removeById(e.id):!1},d.prototype.contains=function(e){return this._entities.get(e.id)===e},d.prototype.removeById=function(e){if(!i(e))return!1;var t=this._entities,r=t.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,r),this._changedEntities.remove(e)),this._entities.remove(e),r.definitionChanged.removeEventListener(d.prototype._onEntityDefinitionChanged,this),h(this),!0):!1},d.prototype.removeAll=function(){for(var e=this._entities,t=e.length,r=e.values,n=this._addedEntities,o=this._removedEntities,a=0;t>a;a++){var s=r[a],l=s.id,u=n.get(l);i(u)||(s.definitionChanged.removeEventListener(d.prototype._onEntityDefinitionChanged,this),o.set(l,s))}e.removeAll(),n.removeAll(),this._changedEntities.removeAll(),h(this)},d.prototype.getById=function(e){return this._entities.get(e)},d.prototype.getOrCreateEntity=function(e){var t=this._entities.get(e);return i(t)||(p.id=e,t=new c(p),this.add(t)),t},d.prototype._onEntityDefinitionChanged=function(e){var t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),h(this)},d}),i("DataSources/CompositeEntityCollection",["../Core/createGuid","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Math","./Entity","./EntityCollection"],function(e,t,i,r,n,o,a){"use strict";function s(e){for(var t=e.propertyNames,i=t.length,r=0;i>r;r++)e[t[r]]=void 0}function l(e,t,i,r){f[0]=i,f[1]=r.id,t[JSON.stringify(f)]=r.definitionChanged.addEventListener(h.prototype._onDefinitionChanged,e)}function u(e,t,i,r){f[0]=i,f[1]=r.id;var n=JSON.stringify(f);t[n](),t[n]=void 0}function c(e){if(e._shouldRecomposite=!0,0===e._suspendCount){var i,r,n,c,d,p,f=e._collections,v=f.length,g=e._collectionsCopy,_=g.length,y=e._composite,C=new a(e),E=e._eventHash;for(i=0;_>i;i++)for(d=g[i],d.collectionChanged.removeEventListener(h.prototype._onCollectionChanged,e),n=d.values,p=d.id,c=n.length-1;c>-1;c--)r=n[c],u(e,E,p,r);for(i=v-1;i>=0;i--)for(d=f[i],d.collectionChanged.addEventListener(h.prototype._onCollectionChanged,e),n=d.values,p=d.id,c=n.length-1;c>-1;c--){r=n[c],l(e,E,p,r);var S=C.getById(r.id);t(S)||(S=y.getById(r.id),t(S)?s(S):(m.id=r.id,S=new o(m)),C.add(S)),S.merge(r)}e._collectionsCopy=f.slice(0),y.suspendEvents(),y.removeAll();var w=C.values;for(i=0;ih;h++){var y=r[h];u(this,g,_,y);var C=y.id;for(d=a-1;d>=0;d--)p=n[d].getById(C),t(p)&&(t(f)||(f=c.getById(C),s(f)),f.merge(p));t(f)||c.removeById(C),f=void 0}var E=i.length;for(h=0;E>h;h++){var S=i[h];l(this,g,_,S);var w=S.id;for(d=a-1;d>=0;d--)p=n[d].getById(w),t(p)&&(t(f)||(f=c.getById(w),t(f)?s(f):(m.id=w,f=new o(m),c.add(f))),f.merge(p));f=void 0}c.resumeEvents()},h.prototype._onDefinitionChanged=function(e,i,r,n){for(var o=this._collections,a=this._composite,s=o.length,l=e.id,u=a.getById(l),c=u[i],h=!t(c),d=!0,p=s-1;p>=0;p--){var m=o[p].getById(e.id);if(t(m)){var f=m[i];if(t(f)){if(d){if(d=!1,!t(f.merge)||!t(f.clone)){c=f;break}c=f.clone(c)}c.merge(f)}}}h&&-1===u.propertyNames.indexOf(i)&&u.addProperty(i),u[i]=c},h}),i("DataSources/CompositeProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/TimeIntervalCollection","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(t,i,r,n){function o(){r.raiseEvent(t)}var a=[];i.removeAll();for(var s=n.length,l=0;s>l;l++){var u=n.get(l);e(u.data)&&-1===a.indexOf(u.data)&&i.add(u.data.definitionChanged,o)}}function l(){this._eventHelper=new n,this._definitionChanged=new r,this._intervals=new o,this._intervals.changedEvent.addEventListener(l.prototype._intervalsChanged,this)}return t(l.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),l.prototype.getValue=function(t,i){var r=this._intervals.findDataForIntervalContainingDate(t);return e(r)?r.getValue(t,i):void 0},l.prototype.equals=function(e){return this===e||e instanceof l&&this._intervals.equals(e._intervals,a.equals)},l.prototype._intervalsChanged=function(){s(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)},l}),i("DataSources/CompositeMaterialProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./CompositeProperty","./Property"],function(e,t,i,r,n,o){"use strict";function a(){this._definitionChanged=new r,this._composite=new n,this._composite.definitionChanged.addEventListener(a.prototype._raiseDefinitionChanged,this)}return t(a.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}}),a.prototype.getType=function(t){var i=this._composite._intervals.findDataForIntervalContainingDate(t);return e(i)?i.getType(t):void 0},a.prototype.getValue=function(t,i){var r=this._composite._intervals.findDataForIntervalContainingDate(t);return e(r)?r.getValue(t,i):void 0},a.prototype.equals=function(e){return this===e||e instanceof a&&this._composite.equals(e._composite,o.equals)},a.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},a}),i("DataSources/CompositePositionProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./CompositeProperty","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(t){this._referenceFrame=e(t,o.FIXED),this._definitionChanged=new n,this._composite=new a,this._composite.definitionChanged.addEventListener(l.prototype._raiseDefinitionChanged,this)}return i(l.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}}),l.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,o.FIXED,t)},l.prototype.getValueInReferenceFrame=function(e,i,r){var n=this._composite._intervals.findDataForIntervalContainingDate(e);return t(n)?n.getValueInReferenceFrame(e,i,r):void 0},l.prototype.equals=function(e){return this===e||e instanceof l&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,s.equals)},l.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},l}),i("DataSources/CorridorGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/CorridorGeometry","../Core/CorridorOutlineGeometry","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C){"use strict";function E(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0}function S(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(S.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new E(e),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}function w(e,t){this._primitives=e, -this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new E(t._entity)}var T=new v(e.WHITE),x=new g(!0),b=new g(!0),A=new g(!1),P=new g(e.BLACK),I=new e;return a(S,{perInstanceColorAppearanceType:{value:m},materialAppearanceType:{value:p}}),a(S.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!o(this._entity.availability)&&C.isConstant(this._showProperty)&&C.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!o(this._entity.availability)&&C.isConstant(this._showProperty)&&C.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},geometryChanged:{get:function(){return this._geometryChanged}}}),S.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},S.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},S.prototype.createFillGeometryInstance=function(r){var n,a,s=this._entity,l=s.isAvailable(r),u=new d(l&&s.isShowing&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r));if(this._materialProperty instanceof v){var h=e.WHITE;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(h=this._materialProperty.color.getValue(r)),a=t.fromColor(h),n={show:u,color:a}}else n={show:u};return new c({id:s,geometry:new i(this._options),attributes:n})},S.prototype.createOutlineGeometryInstance=function(i){var n=this._entity,o=n.isAvailable(i),a=C.getValueOrDefault(this._outlineColorProperty,i,e.BLACK);return new c({id:n,geometry:new r(this._options),attributes:{show:new d(o&&n.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(a)}})},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){this._entitySubscription(),s(this)},S.prototype._onEntityPropertyChanged=function(e,t,i,r){if("availability"===t||"corridor"===t){var a=this._entity.corridor;if(!o(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=o(s)&&s.isConstant?s.getValue(h.MINIMUM_VALUE):!0,u=a.outline,c=o(u);if(c&&u.isConstant&&(c=u.getValue(h.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=a.positions,f=a.show;if(o(f)&&f.isConstant&&!f.getValue(h.MINIMUM_VALUE)||!o(d))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var g=n(a.material,T),_=g instanceof v;this._materialProperty=g,this._fillProperty=n(s,b),this._showProperty=n(f,x),this._showOutlineProperty=n(a.outline,A),this._outlineColorProperty=c?n(a.outlineColor,P):void 0;var y=a.height,E=a.extrudedHeight,S=a.granularity,w=a.width,I=a.outlineWidth,M=a.cornerType;if(this._isClosed=o(E),this._fillEnabled=l,this._outlineEnabled=c,d.isConstant&&C.isConstant(y)&&C.isConstant(E)&&C.isConstant(S)&&C.isConstant(w)&&C.isConstant(I)&&C.isConstant(M)){var D=this._options;D.vertexFormat=_?m.VERTEX_FORMAT:p.MaterialSupport.TEXTURED.vertexFormat,D.positions=d.getValue(h.MINIMUM_VALUE,D.positions),D.height=o(y)?y.getValue(h.MINIMUM_VALUE):void 0,D.extrudedHeight=o(E)?E.getValue(h.MINIMUM_VALUE):void 0,D.granularity=o(S)?S.getValue(h.MINIMUM_VALUE):void 0,D.width=o(w)?w.getValue(h.MINIMUM_VALUE):void 0,D.cornerType=o(M)?M.getValue(h.MINIMUM_VALUE):void 0,this._outlineWidth=o(I)?I.getValue(h.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},S.prototype.createDynamicUpdater=function(e){return new w(e,this)},w.prototype.update=function(n){var a=this._primitives;a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var s=this._geometryUpdater,l=s._entity,u=l.corridor;if(l.isShowing&&l.isAvailable(n)&&C.getValueOrDefault(u.show,n,!0)){var h=this._options,d=C.getValueOrUndefined(u.positions,n,h.positions),v=C.getValueOrUndefined(u.width,n);if(o(d)&&o(v)){if(h.positions=d,h.width=v,h.height=C.getValueOrUndefined(u.height,n),h.extrudedHeight=C.getValueOrUndefined(u.extrudedHeight,n),h.granularity=C.getValueOrUndefined(u.granularity,n),h.cornerType=C.getValueOrUndefined(u.cornerType,n),!o(u.fill)||u.fill.getValue(n)){var g=y.getValue(n,s.fillMaterialProperty,this._material);this._material=g;var _=new p({material:g,translucent:g.isTranslucent(),closed:o(h.extrudedHeight)});h.vertexFormat=_.vertexFormat,this._primitive=a.add(new f({geometryInstances:new c({id:l,geometry:new i(h)}),appearance:_,asynchronous:!1}))}if(o(u.outline)&&u.outline.getValue(n)){h.vertexFormat=m.VERTEX_FORMAT;var E=C.getValueOrClonedDefault(u.outlineColor,n,e.BLACK,I),S=C.getValueOrDefault(u.outlineWidth,n,1),w=1!==E.alpha;this._outlinePrimitive=a.add(new f({geometryInstances:new c({id:l,geometry:new r(h),attributes:{color:t.fromColor(E)}}),appearance:new m({flat:!0,translucent:w,renderState:{lineWidth:s._scene.clampLineWidth(S)}}),asynchronous:!1}))}}}},w.prototype.getBoundingSphere=function(e,t){return _(e,this._primitive,this._outlinePrimitive,t)},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),s(this)},S}),i("DataSources/DataSource",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function i(){t.throwInstantiationError()}return e(i.prototype,{name:{get:t.throwInstantiationError},clock:{get:t.throwInstantiationError},entities:{get:t.throwInstantiationError},isLoading:{get:t.throwInstantiationError},changedEvent:{get:t.throwInstantiationError},errorEvent:{get:t.throwInstantiationError},loadingEvent:{get:t.throwInstantiationError}}),i.prototype.update=t.throwInstantiationError,i.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))},i}),i("DataSources/CustomDataSource",["../Core/defineProperties","../Core/Event","./DataSource","./EntityCollection"],function(e,t,i,r){"use strict";function n(e){this._name=e,this._clock=void 0,this._changed=new t,this._error=new t,this._isLoading=!1,this._loading=new t,this._entityCollection=new r(this)}return e(n.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){i.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}}}),n}),i("DataSources/CylinderGeometryUpdater",["../Core/Cartesian3","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/CylinderGeometry","../Core/CylinderOutlineGeometry","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E){"use strict";function S(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0}function w(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(w.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new c,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new S(e),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}function T(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new S(t._entity)}var x=new g(t.WHITE),b=new _(!0),A=new _(!0),P=new _(!1),I=new _(t.BLACK),M=new t;return s(w,{perInstanceColorAppearanceType:{value:f},materialAppearanceType:{value:m}}),s(w.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!a(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!a(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),w.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},w.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},w.prototype.createFillGeometryInstance=function(e){var n,o,s=this._entity,l=s.isAvailable(e),u=new p(l&&s.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e));if(this._materialProperty instanceof g){var c=t.WHITE;a(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(c=this._materialProperty.color.getValue(e)),o=i.fromColor(c),n={show:u,color:o}}else n={show:u};return new h({id:s,geometry:new r(this._options),modelMatrix:s._getModelMatrix(d.MINIMUM_VALUE),attributes:n})},w.prototype.createOutlineGeometryInstance=function(e){var r=this._entity,o=r.isAvailable(e),a=E.getValueOrDefault(this._outlineColorProperty,e,t.BLACK);return new h({id:r,geometry:new n(this._options),modelMatrix:r._getModelMatrix(d.MINIMUM_VALUE),attributes:{show:new p(o&&r.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:i.fromColor(a)}})},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){this._entitySubscription(),l(this)},w.prototype._onEntityPropertyChanged=function(e,t,i,r){if("availability"===t||"position"===t||"orientation"===t||"cylinder"===t){var n=e.cylinder;if(!a(n))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=n.fill,l=a(s)&&s.isConstant?s.getValue(d.MINIMUM_VALUE):!0,u=n.outline,c=a(u);if(c&&u.isConstant&&(c=u.getValue(d.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var h=e.position,p=n.length,v=n.topRadius,_=n.bottomRadius,y=n.show;if(a(y)&&y.isConstant&&!y.getValue(d.MINIMUM_VALUE)||!a(h)||!a(p)||!a(v)||!a(_))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var C=o(n.material,x),S=C instanceof g;this._materialProperty=C,this._fillProperty=o(s,A),this._showProperty=o(y,b),this._showOutlineProperty=o(n.outline,P),this._outlineColorProperty=c?o(n.outlineColor,I):void 0;var w=n.slices,T=n.outlineWidth,M=n.numberOfVerticalLines;if(this._fillEnabled=l,this._outlineEnabled=c,h.isConstant&&E.isConstant(e.orientation)&&p.isConstant&&v.isConstant&&_.isConstant&&E.isConstant(w)&&E.isConstant(T)&&E.isConstant(M)){var D=this._options;D.vertexFormat=S?f.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,D.length=p.getValue(d.MINIMUM_VALUE),D.topRadius=v.getValue(d.MINIMUM_VALUE),D.bottomRadius=_.getValue(d.MINIMUM_VALUE),D.slices=a(w)?w.getValue(d.MINIMUM_VALUE):void 0,D.numberOfVerticalLines=a(M)?M.getValue(d.MINIMUM_VALUE):void 0,this._outlineWidth=a(T)?T.getValue(d.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},w.prototype.createDynamicUpdater=function(e){return new T(e,this)},T.prototype.update=function(e){var o=this._primitives;o.removeAndDestroy(this._primitive),o.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var s=this._geometryUpdater,l=s._entity,u=l.cylinder;if(l.isShowing&&l.isAvailable(e)&&E.getValueOrDefault(u.show,e,!0)){var c=this._options,d=l._getModelMatrix(e),p=E.getValueOrUndefined(u.length,e),g=E.getValueOrUndefined(u.topRadius,e),_=E.getValueOrUndefined(u.bottomRadius,e);if(a(d)&&a(p)&&a(g)&&a(_)){if(c.length=p,c.topRadius=g,c.bottomRadius=_,c.slices=E.getValueOrUndefined(u.slices,e),c.numberOfVerticalLines=E.getValueOrUndefined(u.numberOfVerticalLines,e),E.getValueOrDefault(u.fill,e,!0)){var y=C.getValue(e,s.fillMaterialProperty,this._material);this._material=y;var S=new m({material:y,translucent:y.isTranslucent(),closed:!0});c.vertexFormat=S.vertexFormat,this._primitive=o.add(new v({geometryInstances:new h({id:l,geometry:new r(c),modelMatrix:d}),appearance:S,asynchronous:!1}))}if(E.getValueOrDefault(u.outline,e,!1)){c.vertexFormat=f.VERTEX_FORMAT;var w=E.getValueOrClonedDefault(u.outlineColor,e,t.BLACK,M),T=E.getValueOrDefault(u.outlineWidth,e,1),x=1!==w.alpha;this._outlinePrimitive=o.add(new v({geometryInstances:new h({id:l,geometry:new n(c),modelMatrix:d,attributes:{color:i.fromColor(w)}}),appearance:new f({flat:!0,translucent:x,renderState:{lineWidth:s._scene.clampLineWidth(T)}}),asynchronous:!1}))}}}},T.prototype.getBoundingSphere=function(e,t){return y(e,this._primitive,this._outlinePrimitive,t)},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),l(this)},w}),i("Scene/LabelStyle",["../Core/freezeObject"],function(e){"use strict";var t={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2};return e(t)}),i("DataSources/DataSourceClock",["../Core/Clock","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","./createRawPropertyDescriptor"],function(e,t,i,r,n,o,a,s){"use strict";function l(){this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0,this._definitionChanged=new o}return r(l.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:s("startTime"),stopTime:s("stopTime"),currentTime:s("currentTime"),clockRange:s("clockRange"),clockStep:s("clockStep"),multiplier:s("multiplier")}),l.prototype.clone=function(e){return i(e)||(e=new l),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e},l.prototype.equals=function(e){return this===e||i(e)&&a.equals(this.startTime,e.startTime)&&a.equals(this.stopTime,e.stopTime)&&a.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier},l.prototype.merge=function(e){this.startTime=t(this.startTime,e.startTime),this.stopTime=t(this.stopTime,e.stopTime),this.currentTime=t(this.currentTime,e.currentTime),this.clockRange=t(this.clockRange,e.clockRange),this.clockStep=t(this.clockStep,e.clockStep),this.multiplier=t(this.multiplier,e.multiplier)},l.prototype.getValue=function(t){return i(t)||(t=new e),t.startTime=this.startTime,t.stopTime=this.stopTime,t.clockRange=this.clockRange,t.clockStep=this.clockStep,t.multiplier=this.multiplier,t.currentTime=this.currentTime,t},l}),i("DataSources/GridMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=i(e,i.EMPTY_OBJECT),this._definitionChanged=new o,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}var u=t.WHITE,c=.1,h=new e(8,8),d=new e(0,0),p=new e(1,1);return n(l.prototype,{isConstant:{get:function(){return s.isConstant(this._color)&&s.isConstant(this._cellAlpha)&&s.isConstant(this._lineCount)&&s.isConstant(this._lineThickness)&&s.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:a("color"),cellAlpha:a("cellAlpha"),lineCount:a("lineCount"),lineThickness:a("lineThickness"),lineOffset:a("lineOffset")}),l.prototype.getType=function(e){return"Grid"},l.prototype.getValue=function(e,t){return r(t)||(t={}),t.color=s.getValueOrClonedDefault(this._color,e,u,t.color),t.cellAlpha=s.getValueOrDefault(this._cellAlpha,e,c),t.lineCount=s.getValueOrClonedDefault(this._lineCount,e,h,t.lineCount),t.lineThickness=s.getValueOrClonedDefault(this._lineThickness,e,p,t.lineThickness),t.lineOffset=s.getValueOrClonedDefault(this._lineOffset,e,d,t.lineOffset),t},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._color,e._color)&&s.equals(this._cellAlpha,e._cellAlpha)&&s.equals(this._lineCount,e._lineCount)&&s.equals(this._lineThickness,e._lineThickness)&&s.equals(this._lineOffset,e._lineOffset)},l}),i("DataSources/PolylineGlowMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower}var l=e.WHITE,u=.25;return r(s.prototype,{isConstant:{get:function(){return a.isConstant(this._color)&&a.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),glowPower:o("glowPower")}),s.prototype.getType=function(e){return"PolylineGlow"},s.prototype.getValue=function(e,t){return i(t)||(t={}),t.color=a.getValueOrClonedDefault(this._color,e,l,t.color),t.glowPower=a.getValueOrDefault(this._glowPower,e,u,t.glowPower),t},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._color,e._color)&&a.equals(this._glowPower,e._glowPower)},s}),i("DataSources/PolylineOutlineMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}var l=e.WHITE,u=e.BLACK,c=1;return r(s.prototype,{isConstant:{get:function(){return a.isConstant(this._color)&&a.isConstant(this._outlineColor)&&a.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth")}),s.prototype.getType=function(e){return"PolylineOutline"},s.prototype.getValue=function(e,t){return i(t)||(t={}),t.color=a.getValueOrClonedDefault(this._color,e,l,t.color),t.outlineColor=a.getValueOrClonedDefault(this._outlineColor,e,u,t.outlineColor),t.outlineWidth=a.getValueOrDefault(this._outlineWidth,e,c),t},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._color,e._color)&&a.equals(this._outlineColor,e._outlineColor)&&a.equals(this._outlineWidth,e._outlineWidth)},s}),i("DataSources/PositionPropertyArray",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/ReferenceFrame","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(t,i){this._value=void 0,this._definitionChanged=new n,this._eventHelper=new o,this._referenceFrame=e(i,a.FIXED),this.setValue(t)}return i(l.prototype,{isConstant:{get:function(){var e=this._value;if(!t(e))return!0;for(var i=e.length,r=0;i>r;r++)if(!s.isConstant(e[r]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),l.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,a.FIXED,t)},l.prototype.getValueInReferenceFrame=function(e,i,r){var n=this._value;if(t(n)){var o=n.length;t(r)||(r=new Array(o));for(var a=0,s=0;o>a;){var l=n[a],u=l.getValueInReferenceFrame(e,i,r[a]);t(u)&&(r[s]=u,s++),a++}return r.length=s,r}},l.prototype.setValue=function(e){var i=this._eventHelper;if(i.removeAll(),t(e)){this._value=e.slice();for(var r=e.length,n=0;r>n;n++){var o=e[n];t(o)&&i.add(o.definitionChanged,l.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)},l.prototype.equals=function(e){return this===e||e instanceof l&&this._referenceFrame===e._referenceFrame&&s.arrayEquals(this._value,e._value)},l.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},l}),i("DataSources/ReferenceProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/RuntimeError","./Property"],function(e,t,i,r,n,o){"use strict";function a(t){var i=!0;if(t._resolveEntity){var r=t._targetCollection.getById(t._targetId);if(e(r)?(r.definitionChanged.addEventListener(l.prototype._onTargetEntityDefinitionChanged,t),t._targetEntity=r,t._resolveEntity=!1):(r=t._targetEntity,i=!1),!e(r))throw new n('target entity "'+t._targetId+'" could not be resolved.')}return i}function s(t){var i=t._targetProperty;if(t._resolveProperty){var r=a(t),o=t._targetPropertyNames;i=t._targetEntity;for(var s=o.length,l=0;s>l&&e(i);l++)i=i[o[l]];if(e(i))t._targetProperty=i,t._resolveProperty=!r;else if(!e(t._targetProperty))throw new n('targetProperty "'+t._targetId+"."+o.join(".")+'" could not be resolved.')}return i}function l(e,t,i){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=i,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new r,this._resolveEntity=!0,this._resolveProperty=!0,e.collectionChanged.addEventListener(l.prototype._onCollectionChanged,this)}return t(l.prototype,{isConstant:{get:function(){return o.isConstant(s(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return s(this).referenceFrame}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return s(this)}}}),l.fromString=function(e,t){for(var i,r=[],n=!0,o=!1,a="",s=0;sn;n++)if(t[n]!==i[n])return!1;return!0},l.prototype._onTargetEntityDefinitionChanged=function(e,t,i,r){this._targetPropertyNames[0]===t&&(this._resolveProperty=!0,this._definitionChanged.raiseEvent(this))},l.prototype._onCollectionChanged=function(t,i,r){var n=this._targetEntity;e(n)&&(-1!==r.indexOf(n)?(n.definitionChanged.removeEventListener(l.prototype._onTargetEntityDefinitionChanged,this),this._resolveEntity=!0,this._resolveProperty=!0):this._resolveEntity&&(s(this),this._resolveEntity||this._definitionChanged.raiseEvent(this)))},l}),i("DataSources/Rotation",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Math"],function(e,t,i,r){"use strict";var n={packedLength:1,pack:function(t,i,r){r=e(r,0),i[r]=t},unpack:function(t,i,r){return i=e(i,0),t[i]},convertPackedArrayForInterpolation:function(t,i,n,o){i=e(i,0),n=e(n,t.length);for(var a,s=0,l=n-i+1;l>s;s++){var u=t[i+s];0===s||Math.abs(a-u)o?o+r.TWO_PI:o}};return n}),i("DataSources/SampledProperty",["../Core/binarySearch","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ExtrapolationType","../Core/JulianDate","../Core/LinearApproximation"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e,t,i){var r,n=e.length,o=i.length,a=n+o;if(e.length=a,n!==t){var s=n-1;for(r=a-1;r>=t;r--)e[r]=e[s--]}for(r=0;o>r;r++)e[t++]=i[r]}function c(e,t){return e instanceof s?e:"string"==typeof e?s.fromIso8601(e):s.addSeconds(t,e,new s)}function h(t,r,n,o,a){for(var l,h,d,p,v,g,_=0;_d){for(d=~d,p=d*a,h=void 0,g=r[d];_=0||i(g)&&s.compare(v,g)>=0));){for(m[y++]=v,_+=1,l=0;a>l;l++)f[C++]=o[_],_+=1;h=v}y>0&&(f.length=C,u(n,p,f),m.length=y,u(r,d,m))}else{for(l=0;a>l;l++)_++,n[d*a+l]=o[_];_++}}}function d(e,r){var n=e;n===Number&&(n=p);var s,u=n.packedLength,c=t(n.packedInterpolationLength,u),h=0;if(i(r)){var d=r.length;s=new Array(d);for(var m=0;d>m;m++){var f=r[m];f===Number&&(f=p);var v=f.packedLength;u+=v,c+=t(f.packedInterpolationLength,v),s[m]=f}h=d}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=l,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=u,this._packedInterpolationLength=c,this._updateTableLength=!0,this._interpolationResult=new Array(c),this._definitionChanged=new o,this._derivativeTypes=r,this._innerDerivativeTypes=s,this._inputOrder=h,this._forwardExtrapolationType=a.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=a.NONE,this._backwardExtrapolationDuration=0}var p={packedLength:1,pack:function(e,i,r){r=t(r,0),i[r]=e},unpack:function(e,i,r){return i=t(i,0),e[i]}},m=[],f=[];return r(d.prototype,{isConstant:{get:function(){return 0===this._values.length}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}}),d.prototype.getValue=function(t,r){var n=this._times,o=n.length;if(0!==o){var l,u=this._innerType,c=this._values,h=e(n,t,s.compare);if(0>h){if(h=~h,0===h){var d=n[h];if(l=this._backwardExtrapolationDuration,this._backwardExtrapolationType===a.NONE||0!==l&&s.secondsDifference(d,t)>l)return;if(this._backwardExtrapolationType===a.HOLD)return u.unpack(c,0,r)}if(h>=o){h=o-1;var p=n[h];if(l=this._forwardExtrapolationDuration,this._forwardExtrapolationType===a.NONE||0!==l&&s.secondsDifference(t,p)>l)return;if(this._forwardExtrapolationType===a.HOLD)return h=o-1,u.unpack(c,h*u.packedLength,r)}var m=this._xTable,f=this._yTable,v=this._interpolationAlgorithm,g=this._packedInterpolationLength,_=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;var y=Math.min(v.getRequiredDataPoints(this._interpolationDegree,_),o);y!==this._numberOfPoints&&(this._numberOfPoints=y,m.length=y,f.length=y*g)}var C=this._numberOfPoints-1;if(1>C)return;var E=0,S=o-1,w=S-E+1;if(w>=C+1){var T=h-(C/2|0)-1;E>T&&(T=E);var x=T+C;x>S&&(x=S,T=x-C,E>T&&(T=E)),E=T,S=x}for(var b=S-E+1,A=0;b>A;++A)m[A]=s.secondsDifference(n[E+A],n[S]);if(i(u.convertPackedArrayForInterpolation))u.convertPackedArrayForInterpolation(c,E,S,f);else for(var P=0,I=this._packedLength,M=E*I,D=(S+1)*I;D>M;)f[P]=c[M],M++,P++;var R,O=s.secondsDifference(t,n[S]);if(0!==_&&i(v.interpolate)){var N=Math.floor(g/(_+1));R=v.interpolate(O,m,f,N,_,_,this._interpolationResult)}else R=v.interpolateOrderZero(O,m,f,g,this._interpolationResult);return i(u.unpackInterpolationResult)?u.unpackInterpolationResult(R,c,E,S,r):u.unpack(R,0,r)}return u.unpack(c,h*this._packedLength,r)}},d.prototype.setInterpolationOptions=function(e){var t=!1,i=e.interpolationAlgorithm,r=e.interpolationDegree;this._interpolationAlgorithm!==i&&(this._interpolationAlgorithm=i,t=!0),this._interpolationDegree!==r&&(this._interpolationDegree=r,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))},d.prototype.addSample=function(e,t,r){var n=this._innerDerivativeTypes,o=i(n),a=this._innerType,s=[];if(s.push(e),a.pack(t,s,s.length),o)for(var l=n.length,u=0;l>u;u++)n[u].pack(r[u],s,s.length);h(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},d.prototype.addSamples=function(e,t,r){for(var n=this._innerDerivativeTypes,o=i(n),a=this._innerType,s=e.length,l=[],u=0;s>u;u++)if(l.push(e[u]),a.pack(t[u],l,l.length),o)for(var c=r[u],d=n.length,p=0;d>p;p++)n[p].pack(c[p],l,l.length);h(void 0,this._times,this._values,l,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},d.prototype.addSamplesPackedArray=function(e,t){h(t,this._times,this._values,e,this._packedLength), -this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},d.prototype.equals=function(e){if(this===e)return!0;if(!i(e))return!1;if(this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;var t=this._derivativeTypes,r=i(t),n=e._derivativeTypes,o=i(n);if(r!==o)return!1;var a,l;if(r){if(l=t.length,l!==n.length)return!1;for(a=0;l>a;a++)if(t[a]!==n[a])return!1}var u=this._times,c=e._times;if(l=u.length,l!==c.length)return!1;for(a=0;l>a;a++)if(!s.equals(u[a],c[a]))return!1;var h=this._values,d=e._values;for(a=0;l>a;a++)if(h[a]!==d[a])return!1;return!0},d._mergeNewSamples=h,d}),i("DataSources/SampledPositionProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./PositionProperty","./Property","./SampledProperty"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(i,r){r=t(r,0);var n;if(r>0){n=new Array(r);for(var s=0;r>s;s++)n[s]=e}this._numberOfDerivatives=r,this._property=new u(e,n),this._definitionChanged=new o,this._referenceFrame=t(i,a.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}return r(c.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}}),c.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,a.FIXED,t)},c.prototype.getValueInReferenceFrame=function(e,t,r){return r=this._property.getValue(e,r),i(r)?s.convertToReferenceFrame(e,r,this._referenceFrame,t,r):void 0},c.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)},c.prototype.addSample=function(e,t,i){this._numberOfDerivatives;this._property.addSample(e,t,i)},c.prototype.addSamples=function(e,t,i){this._property.addSamples(e,t,i)},c.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)},c.prototype.equals=function(e){return this===e||e instanceof c&&l.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame},c}),i("DataSources/StripeOrientation",["../Core/freezeObject"],function(e){"use strict";var t={HORIZONTAL:0,VERTICAL:1};return e(t)}),i("DataSources/StripeMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property","./StripeOrientation"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}var u=s.HORIZONTAL,c=e.WHITE,h=e.BLACK,d=0,p=1;return r(l.prototype,{isConstant:{get:function(){return a.isConstant(this._orientation)&&a.isConstant(this._evenColor)&&a.isConstant(this._oddColor)&&a.isConstant(this._offset)&&a.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:o("orientation"),evenColor:o("evenColor"),oddColor:o("oddColor"),offset:o("offset"),repeat:o("repeat")}),l.prototype.getType=function(e){return"Stripe"},l.prototype.getValue=function(e,t){return i(t)||(t={}),t.horizontal=a.getValueOrDefault(this._orientation,e,u)===s.HORIZONTAL,t.evenColor=a.getValueOrClonedDefault(this._evenColor,e,c,t.evenColor),t.oddColor=a.getValueOrClonedDefault(this._oddColor,e,h,t.oddColor),t.offset=a.getValueOrDefault(this._offset,e,d),t.repeat=a.getValueOrDefault(this._repeat,e,p),t},l.prototype.equals=function(e){return this===e||e instanceof l&&a.equals(this._orientation,e._orientation)&&a.equals(this._evenColor,e._evenColor)&&a.equals(this._oddColor,e._oddColor)&&a.equals(this._offset,e._offset)&&a.equals(this._repeat,e._repeat)},l}),i("DataSources/TimeIntervalCollectionPositionProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","../Core/TimeIntervalCollection","./PositionProperty","./Property"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t){this._definitionChanged=new n,this._intervals=new a,this._intervals.changedEvent.addEventListener(u.prototype._intervalsChanged,this),this._referenceFrame=e(t,o.FIXED)}return i(u.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}}),u.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,o.FIXED,t)},u.prototype.getValueInReferenceFrame=function(e,i,r){var n=this._intervals.findDataForIntervalContainingDate(e);return t(n)?s.convertToReferenceFrame(e,n,this._referenceFrame,i,r):void 0},u.prototype.equals=function(e){return this===e||e instanceof u&&this._intervals.equals(e._intervals,l.equals)&&this._referenceFrame===e._referenceFrame},u.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)},u}),i("DataSources/TimeIntervalCollectionProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/TimeIntervalCollection","./Property"],function(e,t,i,r,n,o){"use strict";function a(){this._definitionChanged=new r,this._intervals=new n,this._intervals.changedEvent.addEventListener(a.prototype._intervalsChanged,this)}return t(a.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),a.prototype.getValue=function(t,i){var r=this._intervals.findDataForIntervalContainingDate(t);return e(r)&&"function"==typeof r.clone?r.clone(i):r},a.prototype.equals=function(e){return this===e||e instanceof a&&this._intervals.equals(e._intervals,o.equals)},a.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)},a}),i("DataSources/CzmlDataSource",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/ClockRange","../Core/ClockStep","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/ExtrapolationType","../Core/getAbsoluteUri","../Core/getFilenameFromUri","../Core/HermitePolynomialApproximation","../Core/isArray","../Core/Iso8601","../Core/JulianDate","../Core/LagrangePolynomialApproximation","../Core/LinearApproximation","../Core/loadJson","../Core/Math","../Core/Quaternion","../Core/Rectangle","../Core/ReferenceFrame","../Core/RuntimeError","../Core/Spherical","../Core/TimeInterval","../Core/TimeIntervalCollection","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/VerticalOrigin","../ThirdParty/Uri","../ThirdParty/when","./BillboardGraphics","./ColorMaterialProperty","./CompositeMaterialProperty","./CompositePositionProperty","./CompositeProperty","./ConstantPositionProperty","./ConstantProperty","./DataSource","./DataSourceClock","./EllipseGraphics","./EllipsoidGraphics","./EntityCollection","./GridMaterialProperty","./ImageMaterialProperty","./LabelGraphics","./ModelGraphics","./NodeTransformationProperty","./PathGraphics","./PointGraphics","./PolygonGraphics","./PolylineGlowMaterialProperty","./PolylineGraphics","./PolylineOutlineMaterialProperty","./PositionPropertyArray","./PropertyBag","./RectangleGraphics","./ReferenceProperty","./Rotation","./SampledPositionProperty","./SampledProperty","./StripeMaterialProperty","./StripeOrientation","./TimeIntervalCollectionPositionProperty","./TimeIntervalCollectionProperty","./WallGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O,N,L,F,B,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,he,de,pe,me,fe,ve){"use strict";function ge(e,t){return"#"===t[0]&&(t=ot+t),le.fromString(e,t)}function _e(e){var t=e.rgbaf;if(l(t))return t;var i=e.rgba;if(l(i)){if(i.length===o.length)return[o.byteToFloat(i[0]),o.byteToFloat(i[1]),o.byteToFloat(i[2]),o.byteToFloat(i[3])];var r=i.length;t=new Array(r);for(var n=0;r>n;n+=5)t[n]=i[n],t[n+1]=o.byteToFloat(i[n+1]),t[n+2]=o.byteToFloat(i[n+2]),t[n+3]=o.byteToFloat(i[n+3]),t[n+4]=o.byteToFloat(i[n+4]);return t}}function ye(e,t){var i=s(e.uri,e);return l(t)&&(i=m(i,m(t))),i}function Ce(e){var t=e.wsenDegrees;if(l(t)){for(var i=t.length,r=0;i>r;r++)t[r]=w.toRadians(t[r]);return t}return e.wsen}function Ee(e){if(l(e.cartesian))return e.cartesian;if(l(e.cartesianVelocity))return e.cartesianVelocity;if(l(e.unitCartesian))return e.unitCartesian;var i,r,n,o=e.unitSpherical;if(l(o)){if(r=o.length,2===r)st.clock=o[0],st.cone=o[1],t.fromSpherical(st,at),n=[at.x,at.y,at.z];else{var a=0;for(n=new Array(r/3*4),i=0;r>i;i+=4)n[i]=o[a++],st.clock=o[a++],st.cone=o[a++],t.fromSpherical(st,at),n[i+1]=at.x,n[i+2]=at.y,n[i+3]=at.z}return n}var s=e.cartographicRadians;if(l(s)){if(3===s.length)lt.longitude=s[0],lt.latitude=s[1],lt.height=s[2],h.WGS84.cartographicToCartesian(lt,at),n=[at.x,at.y,at.z];else for(r=s.length,n=new Array(r),i=0;r>i;i+=4)lt.longitude=s[i+1],lt.latitude=s[i+2],lt.height=s[i+3],h.WGS84.cartographicToCartesian(lt,at),n[i]=s[i],n[i+1]=at.x,n[i+2]=at.y,n[i+3]=at.z;return n}var u=e.cartographicDegrees;if(!l(u))throw new A(JSON.stringify(e)+" is not a valid CZML interval.");if(3===u.length)lt.longitude=w.toRadians(u[0]),lt.latitude=w.toRadians(u[1]),lt.height=u[2],h.WGS84.cartographicToCartesian(lt,at),n=[at.x,at.y,at.z];else for(r=u.length,n=new Array(r),i=0;r>i;i+=4)lt.longitude=w.toRadians(u[i+1]),lt.latitude=w.toRadians(u[i+2]),lt.height=u[i+3],h.WGS84.cartographicToCartesian(lt,at),n[i]=u[i],n[i+1]=at.x,n[i+2]=at.y,n[i+3]=at.z;return n}function Se(e,t){var i=e[t],r=e[t+1],n=e[t+2],o=e[t+3],a=1/Math.sqrt(i*i+r*r+n*n+o*o);e[t]=i*a,e[t+1]=r*a,e[t+2]=n*a,e[t+3]=o*a}function we(e){var t=e.unitQuaternion;if(l(t)){if(4===t.length)return Se(t,0),t;for(var i=1;ih);var g="function"==typeof e.unpack&&e!==ue;if(!d&&!v)return void(f?t[i]=ge(a,r.reference):g?t[i]=new G(e.unpack(p,0)):t[i]=new G(p));var C,E=t[i],S=r.epoch;if(l(S)&&(C=y.fromIso8601(S)),d&&!v)return E instanceof he||(E=new he(e),t[i]=E),E.addSamplesPackedArray(p,C),void xe(r,E);var w;if(!d&&v)return u=u.clone(),f?u.data=ge(a,r.reference):g?u.data=e.unpack(p,0):u.data=p,l(E)||(E=f?new z:new fe,t[i]=E),void(!f&&E instanceof fe?E.intervals.addInterval(u):E instanceof z?(u.data=f?u.data:new G(u.data),E.intervals.addInterval(u)):(w=_.MAXIMUM_INTERVAL.clone(),w.data=E,E=new z,t[i]=E,E.intervals.addInterval(w),u.data=f?u.data:new G(u.data),E.intervals.addInterval(u)));l(E)||(E=new z,t[i]=E),E instanceof z||(w=_.MAXIMUM_INTERVAL.clone(),w.data=E,E=new z,t[i]=E,E.intervals.addInterval(w));var T=E.intervals;w=T.findInterval(u),l(w)&&w.data instanceof he||(w=u.clone(),w.data=new he(e),T.addInterval(w)),w.data.addSamplesPackedArray(p,C),xe(r,w.data)}function Ae(e,t,i,r,n,o,a){if(l(r))if(g(r))for(var s=0,u=r.length;u>s;s++)be(e,t,i,r[s],n,o,a);else be(e,t,i,r,n,o,a)}function Pe(e,i,r,n,o,a){var u,c=r.interval;l(c)?(ht.iso8601=c,u=I.fromIso8601(ht),l(n)&&(u=I.intersect(u,n,ut))):l(n)&&(u=n);var h,d,p,m=!1,f=l(r.cartesianVelocity)?1:0,v=t.packedLength*(f+1),g=l(r.reference),C=l(u)&&!u.equals(_.MAXIMUM_INTERVAL);if(g||(l(r.referenceFrame)&&(h=b[r.referenceFrame]),h=s(h,b.FIXED),d=Ee(r),p=s(d.length,1),m=p>v),!m&&!C)return void(g?e[i]=ge(a,r.reference):e[i]=new U(t.unpack(d),h));var E,S=e[i],w=r.epoch;if(l(w)&&(E=y.fromIso8601(w)),m&&!C)return(!(S instanceof ce)||l(h)&&S.referenceFrame!==h)&&(S=new ce(h,f),e[i]=S),S.addSamplesPackedArray(d,E),void xe(r,S);var T;if(!m&&C)return u=u.clone(),g?u.data=ge(a,r.reference):u.data=t.unpack(d),l(S)||(S=g?new k(h):new me(h),e[i]=S),void(!g&&S instanceof me&&l(h)&&S.referenceFrame===h?S.intervals.addInterval(u):S instanceof k?(u.data=g?u.data:new U(u.data,h),S.intervals.addInterval(u)):(T=_.MAXIMUM_INTERVAL.clone(),T.data=S,S=new k(S.referenceFrame),e[i]=S,S.intervals.addInterval(T),u.data=g?u.data:new U(u.data,h),S.intervals.addInterval(u)));l(S)?S instanceof k||(T=_.MAXIMUM_INTERVAL.clone(),T.data=S,S=new k(S.referenceFrame),e[i]=S,S.intervals.addInterval(T)):(S=new k(h),e[i]=S);var x=S.intervals;T=x.findInterval(u),l(T)&&T.data instanceof ce&&(!l(h)||T.data.referenceFrame===h)||(T=u.clone(),T.data=new ce(h,f),x.addInterval(T)),T.data.addSamplesPackedArray(d,E),xe(r,T.data)}function Ie(e,t,i,r,n,o){if(l(i))if(g(i))for(var a=0,s=i.length;s>a;a++)Pe(e,t,i[a],r,n,o);else Pe(e,t,i,r,n,o)}function Me(t,i,r,n,a,s){var u,c=r.interval;l(c)?(ht.iso8601=c,u=I.fromIso8601(ht),l(n)&&(u=I.intersect(u,n,ut))):l(n)&&(u=n);var h,d,p=t[i];if(l(u)){p instanceof V||(p=new V,t[i]=p);var m=p.intervals;d=m.findInterval({start:u.start,stop:u.stop}),l(d)?h=d.data:(d=u.clone(),m.addInterval(d))}else h=p;var f;l(r.solidColor)?(h instanceof B||(h=new B),f=r.solidColor,Ae(o,h,"color",f.color,void 0,void 0,s)):l(r.grid)?(h instanceof X||(h=new X),f=r.grid,Ae(o,h,"color",f.color,void 0,a,s),Ae(Number,h,"cellAlpha",f.cellAlpha,void 0,a,s),Ae(e,h,"lineThickness",f.lineThickness,void 0,a,s),Ae(e,h,"lineOffset",f.lineOffset,void 0,a,s),Ae(e,h,"lineCount",f.lineCount,void 0,a,s)):l(r.image)?(h instanceof Z||(h=new Z),f=r.image,Ae(Image,h,"image",f.image,void 0,a,s),Ae(e,h,"repeat",f.repeat,void 0,a,s),Ae(Number,h,"alpha",f.alpha,void 0,a,s)):l(r.stripe)?(h instanceof de||(h=new de),f=r.stripe,Ae(pe,h,"orientation",f.orientation,void 0,a,s),Ae(o,h,"evenColor",f.evenColor,void 0,a,s),Ae(o,h,"oddColor",f.oddColor,void 0,a,s),Ae(Number,h,"offset",f.offset,void 0,a,s),Ae(Number,h,"repeat",f.repeat,void 0,a,s)):l(r.polylineOutline)?(h instanceof ne||(h=new ne),f=r.polylineOutline,Ae(o,h,"color",f.color,void 0,a,s),Ae(o,h,"outlineColor",f.outlineColor,void 0,a,s),Ae(Number,h,"outlineWidth",f.outlineWidth,void 0,a,s)):l(r.polylineGlow)&&(h instanceof ie||(h=new ie),f=r.polylineGlow,Ae(o,h,"color",f.color,void 0,a,s),Ae(Number,h,"glowPower",f.glowPower,void 0,a,s)),l(d)?d.data=h:t[i]=h}function De(e,t,i,r,n,o){if(l(i))if(g(i))for(var a=0,s=i.length;s>a;a++)Me(e,t,i[a],r,n,o);else Me(e,t,i,r,n,o)}function Re(e,t,i,r){e.name=s(t.name,e.name)}function Oe(e,t,i,r){var n=t.description;l(n)&&Ae(String,e,"description",n,void 0,r,i)}function Ne(e,t,i,r){var n=t.position;l(n)&&Ie(e,"position",n,void 0,r,i)}function Le(e,i,r,n){var o=i.viewFrom;l(o)&&Ae(t,e,"viewFrom",o,void 0,n,r)}function Fe(e,t,i,r){var n=t.orientation;l(n)&&Ae(T,e,"orientation",n,void 0,r,i)}function Be(e,i,r,n){var o,a,s=r.references;if(l(s)){var u=[];for(o=0,a=s.length;a>o;o++)u.push(ge(n,s[o]));var c=r.interval;if(l(c)){if(c=I.fromIso8601(c),!(e[i]instanceof k)){c.data=new oe(u);var d=new k;d.intervals.addInterval(c),e[i]=d}}else e[i]=new oe(u)}else{var p=[],m=r.cartesian;if(l(m)){for(o=0,a=m.length;a>o;o+=3)p.push(new t(m[o],m[o+1],m[o+2]));r.array=p}else if(m=r.cartographicRadians,l(m)){for(o=0,a=m.length;a>o;o+=3)lt.longitude=m[o],lt.latitude=m[o+1],lt.height=m[o+2],p.push(h.WGS84.cartographicToCartesian(lt));r.array=p}else if(m=r.cartographicDegrees,l(m)){for(o=0,a=m.length;a>o;o+=3)p.push(t.fromDegrees(m[o],m[o+1],m[o+2]));r.array=p}l(r.array)&&Ae(Array,e,i,r,void 0,void 0,n)}}function Ve(e,t,i,r){if(l(i))if(g(i))for(var n=i.length,o=0;n>o;o++)Be(e,t,i[o],r);else Be(e,t,i,r)}function ke(e,t,i,r){var n,o=t.availability;if(l(o)){var a;if(g(o))for(var s=o.length,u=0;s>u;u++)l(a)||(a=new M),ht.iso8601=o[u],n=I.fromIso8601(ht),a.addInterval(n);else ht.iso8601=o,n=I.fromIso8601(ht),a=new M,a.addInterval(n);e.availability=a}}function ze(i,r,n,a){var s=r.billboard;if(l(s)){var u,c=s.interval;l(c)&&(ht.iso8601=c,u=I.fromIso8601(ht));var h=i.billboard;l(h)||(i.billboard=h=new F),Ae(o,h,"color",s.color,u,a,n),Ae(t,h,"eyeOffset",s.eyeOffset,u,a,n),Ae(D,h,"horizontalOrigin",s.horizontalOrigin,u,a,n),Ae(Image,h,"image",s.image,u,a,n),Ae(e,h,"pixelOffset",s.pixelOffset,u,a,n),Ae(Number,h,"scale",s.scale,u,a,n),Ae(ue,h,"rotation",s.rotation,u,a,n),Ae(t,h,"alignedAxis",s.alignedAxis,u,a,n),Ae(Boolean,h,"show",s.show,u,a,n),Ae(O,h,"verticalOrigin",s.verticalOrigin,u,a,n),Ae(Boolean,h,"sizeInMeters",s.sizeInMeters,u,a,n)}}function Ue(e,t){var i=e.version;if(l(i)&&"string"==typeof i){var r=i.split(".");if(2===r.length){if("1"!==r[0])throw new A("Cesium only supports CZML version 1.");t._version=i}}if(!l(t._version))throw new A("CZML version information invalid. It is expected to be a property on the document object in the . version format.");var n=t._documentPacket;l(e.name)&&(n.name=e.name);var o=e.clock;if(l(o)){var a=n.clock;l(a)?(a.interval=s(o.interval,a.interval),a.currentTime=s(o.currentTime,a.currentTime),a.range=s(o.range,a.range),a.step=s(o.step,a.step),a.multiplier=s(o.multiplier,a.multiplier)):n.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function Ge(e,t,i,r){var n=t.ellipse;if(l(n)){var a,s=n.interval;l(s)&&(ht.iso8601=s,a=I.fromIso8601(ht));var u=e.ellipse;l(u)||(e.ellipse=u=new q),Ae(Boolean,u,"show",n.show,a,r,i),Ae(ue,u,"rotation",n.rotation,a,r,i),Ae(Number,u,"semiMajorAxis",n.semiMajorAxis,a,r,i),Ae(Number,u,"semiMinorAxis",n.semiMinorAxis,a,r,i),Ae(Number,u,"height",n.height,a,r,i),Ae(Number,u,"extrudedHeight",n.extrudedHeight,a,r,i),Ae(Number,u,"granularity",n.granularity,a,r,i),Ae(ue,u,"stRotation",n.stRotation,a,r,i),De(u,"material",n.material,a,r,i),Ae(Boolean,u,"fill",n.fill,a,r,i),Ae(Boolean,u,"outline",n.outline,a,r,i),Ae(o,u,"outlineColor",n.outlineColor,a,r,i),Ae(Number,u,"outlineWidth",n.outlineWidth,a,r,i),Ae(Number,u,"numberOfVerticalLines",n.numberOfVerticalLines,a,r,i)}}function We(e,i,r,n){var a=i.ellipsoid;if(l(a)){var s,u=a.interval;l(u)&&(ht.iso8601=u,s=I.fromIso8601(ht));var c=e.ellipsoid;l(c)||(e.ellipsoid=c=new j),Ae(Boolean,c,"show",a.show,s,n,r),Ae(t,c,"radii",a.radii,s,n,r),De(c,"material",a.material,s,n,r),Ae(Boolean,c,"fill",a.fill,s,n,r),Ae(Boolean,c,"outline",a.outline,s,n,r),Ae(o,c,"outlineColor",a.outlineColor,s,n,r),Ae(Number,c,"outlineWidth",a.outlineWidth,s,n,r)}}function He(i,r,n,a){var s=r.label;if(l(s)){var u,c=s.interval;l(c)&&(ht.iso8601=c,u=I.fromIso8601(ht));var h=i.label;l(h)||(i.label=h=new K),Ae(o,h,"fillColor",s.fillColor,u,a,n),Ae(o,h,"outlineColor",s.outlineColor,u,a,n),Ae(Number,h,"outlineWidth",s.outlineWidth,u,a,n),Ae(t,h,"eyeOffset",s.eyeOffset,u,a,n),Ae(D,h,"horizontalOrigin",s.horizontalOrigin,u,a,n),Ae(String,h,"text",s.text,u,a,n),Ae(e,h,"pixelOffset",s.pixelOffset,u,a,n),Ae(Number,h,"scale",s.scale,u,a,n),Ae(Boolean,h,"show",s.show,u,a,n),Ae(O,h,"verticalOrigin",s.verticalOrigin,u,a,n),Ae(String,h,"font",s.font,u,a,n),Ae(R,h,"style",s.style,u,a,n)}}function qe(e,t,i,r){var n=t.model;if(l(n)){var o,a=n.interval;l(a)&&(ht.iso8601=a,o=I.fromIso8601(ht));var s=e.model;l(s)||(e.model=s=new Q),Ae(Boolean,s,"show",n.show,o,r,i),Ae(Number,s,"scale",n.scale,o,r,i),Ae(Number,s,"minimumPixelSize",n.minimumPixelSize,o,r,i),Ae(Boolean,s,"incrementallyLoadTextures",n.incrementallyLoadTextures,o,r,i),Ae(N,s,"uri",n.gltf,o,r,i),Ae(Boolean,s,"runAnimations",n.runAnimations,o,r,i);var u=n.nodeTransformations;if(l(u))if(g(u))for(var c=0,h=u.length;h>c;c++)je(s,u[c],o,r,i);else je(s,u,o,r,i)}}function je(e,i,r,n,o){var a,s=i.interval;l(s)?(ht.iso8601=s,a=I.fromIso8601(ht),l(r)&&(a=I.intersect(a,r,ut))):l(r)&&(a=r);for(var u=e.nodeTransformations,c=Object.keys(i),h=0,d=c.length;d>h;++h){var p=c[h];if("interval"!==p){var m=i[p];if(l(m)){l(u)||(e.nodeTransformations=u=new ae),u.hasProperty(p)||u.addProperty(p);var f=u[p];l(f)||(u[p]=f=new J),Ae(t,f,"translation",m.translation,a,n,o),Ae(T,f,"rotation",m.rotation,a,n,o),Ae(t,f,"scale",m.scale,a,n,o)}}}}function Ye(e,t,i,r){var n=t.path;if(l(n)){var o,a=n.interval;l(a)&&(ht.iso8601=a,o=I.fromIso8601(ht));var s=e.path;l(s)||(e.path=s=new $),Ae(Boolean,s,"show",n.show,o,r,i),Ae(Number,s,"width",n.width,o,r,i),Ae(Number,s,"resolution",n.resolution,o,r,i),Ae(Number,s,"leadTime",n.leadTime,o,r,i),Ae(Number,s,"trailTime",n.trailTime,o,r,i),De(s,"material",n.material,o,r,i)}}function Xe(e,t,i,r){var n=t.point;if(l(n)){var a,s=n.interval;l(s)&&(ht.iso8601=s,a=I.fromIso8601(ht));var u=e.point;l(u)||(e.point=u=new ee),Ae(o,u,"color",n.color,a,r,i),Ae(Number,u,"pixelSize",n.pixelSize,a,r,i),Ae(o,u,"outlineColor",n.outlineColor,a,r,i),Ae(Number,u,"outlineWidth",n.outlineWidth,a,r,i),Ae(Boolean,u,"show",n.show,a,r,i)}}function Ze(e,t,i,r){var n=t.polygon;if(l(n)){var a,s=n.interval;l(s)&&(ht.iso8601=s,a=I.fromIso8601(ht));var u=e.polygon;l(u)||(e.polygon=u=new te),Ae(Boolean,u,"show",n.show,a,r,i),De(u,"material",n.material,a,r,i),Ae(Number,u,"height",n.height,a,r,i),Ae(Number,u,"extrudedHeight",n.extrudedHeight,a,r,i),Ae(Number,u,"granularity",n.granularity,a,r,i),Ae(ue,u,"stRotation",n.stRotation,a,r,i),Ae(Boolean,u,"fill",n.fill,a,r,i),Ae(Boolean,u,"outline",n.outline,a,r,i),Ae(o,u,"outlineColor",n.outlineColor,a,r,i),Ae(Number,u,"outlineWidth",n.outlineWidth,a,r,i),Ae(Boolean,u,"perPositionHeight",n.perPositionHeight,a,r,i),Ve(u,"hierarchy",n.positions,i)}}function Ke(e,t,i,r){var n=t.rectangle;if(l(n)){var a,s=n.interval;l(s)&&(ht.iso8601=s,a=I.fromIso8601(ht));var u=e.rectangle;l(u)||(e.rectangle=u=new se),Ae(Boolean,u,"show",n.show,a,r,i),Ae(x,u,"coordinates",n.coordinates,a,r,i),De(u,"material",n.material,a,r,i),Ae(Number,u,"height",n.height,a,r,i),Ae(Number,u,"extrudedHeight",n.extrudedHeight,a,r,i),Ae(Number,u,"granularity",n.granularity,a,r,i),Ae(ue,u,"rotation",n.rotation,a,r,i),Ae(ue,u,"stRotation",n.stRotation,a,r,i),Ae(Boolean,u,"fill",n.fill,a,r,i),Ae(Boolean,u,"outline",n.outline,a,r,i),Ae(o,u,"outlineColor",n.outlineColor,a,r,i),Ae(Number,u,"outlineWidth",n.outlineWidth,a,r,i),Ae(Boolean,u,"closeBottom",n.closeBottom,a,r,i),Ae(Boolean,u,"closeTop",n.closeTop,a,r,i)}}function Qe(e,t,i,r){var n=t.wall;if(l(n)){var a,s=n.interval;l(s)&&(ht.iso8601=s,a=I.fromIso8601(ht));var u=e.wall;l(u)||(e.wall=u=new ve),Ae(Boolean,u,"show",n.show,a,r,i),De(u,"material",n.material,a,r,i),Ae(Array,u,"minimumHeights",n.minimumHeights,a,r,i),Ae(Array,u,"maximumHeights",n.maximumHeights,a,r,i),Ae(Number,u,"granularity",n.granularity,a,r,i),Ae(Boolean,u,"fill",n.fill,a,r,i),Ae(Boolean,u,"outline",n.outline,a,r,i),Ae(o,u,"outlineColor",n.outlineColor,a,r,i),Ae(Number,u,"outlineWidth",n.outlineWidth,a,r,i),Ve(u,"positions",n.positions,i)}}function Je(e,t,i,r){var n=t.polyline;if(l(n)){var o,a=n.interval;l(a)&&(ht.iso8601=a,o=I.fromIso8601(ht));var s=e.polyline;l(s)||(e.polyline=s=new re),Ae(Boolean,s,"show",n.show,o,r,i),Ae(Number,s,"width",n.width,o,r,i),De(s,"material",n.material,o,r,i),Ae(Boolean,s,"followSurface",n.followSurface,o,r,i),Ae(Number,s,"granularity",n.granularity,o,r,i),Ve(s,"positions",n.positions,i)}}function $e(e,t,i,r,n){var o=e.id;if(l(o)||(o=a()),ot=o,!l(n._version)&&"document"!==o)throw new A("The first CZML packet is required to be the document object.");if(e["delete"]===!0)t.removeById(o);else if("document"===o)Ue(e,n);else{var s=t.getOrCreateEntity(o),u=e.parent;l(u)&&(s.parent=t.getOrCreateEntity(u));for(var c=i.length-1;c>-1;c--)i[c](s,e,t,r)}ot=void 0}function et(e){var t,i=e._documentPacket.clock;if(!l(i)){if(!l(e._clock)){var o=e._entityCollection.computeAvailability();if(!o.start.equals(_.MINIMUM_VALUE)){var a=o.start,u=o.stop,c=y.secondsDifference(u,a),h=Math.round(c/120);return t=new H,t.startTime=y.clone(a),t.stopTime=y.clone(u),t.clockRange=r.LOOP_STOP,t.multiplier=h,t.currentTime=y.clone(a),t.clockStep=n.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}if(l(e._clock)?t=e._clock.clone():(t=new H,t.startTime=_.MINIMUM_VALUE.clone(),t.stopTime=_.MAXIMUM_VALUE.clone(),t.currentTime=_.MINIMUM_VALUE.clone(),t.clockRange=r.LOOP_STOP,t.clockStep=n.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1),l(i.interval)){ht.iso8601=i.interval;var d=I.fromIso8601(ht);t.startTime=d.start,t.stopTime=d.stop}return l(i.currentTime)&&(t.currentTime=y.fromIso8601(i.currentTime)),l(i.range)&&(t.clockRange=s(r[i.range],r.LOOP_STOP)),l(i.step)&&(t.clockStep=s(n[i.step],n.SYSTEM_CLOCK_MULTIPLIER)),l(i.multiplier)&&(t.multiplier=i.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function tt(e,t,i,r){i=s(i,s.EMPTY_OBJECT);var n=t,o=i.sourceUri;return"string"==typeof t&&(n=S(t),o=s(o,t)),W.setLoading(e,!0),L(n,function(t){return it(e,t,o,r)}).otherwise(function(t){return W.setLoading(e,!1),e._error.raiseEvent(e,t),console.log(t),L.reject(t)})}function it(e,t,i,r){W.setLoading(e,!0);var n=e._entityCollection;r&&(e._version=void 0,e._documentPacket=new rt,n.removeAll()),nt._processCzml(t,n,i,void 0,e);var o=et(e),a=e._documentPacket;return l(a.name)&&e._name!==a.name?(e._name=a.name,o=!0):!l(e._name)&&l(i)&&(e._name=f(i),o=!0),W.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function rt(){this.name=void 0,this.clock=void 0}function nt(e){this._name=e,this._changed=new d,this._error=new d,this._isLoading=!1,this._loading=new d,this._clock=void 0,this._documentPacket=new rt,this._version=void 0,this._entityCollection=new Y(this)}var ot,at=new t,st=new P,lt=new i,ut=new I,ct={HERMITE:v,LAGRANGE:C,LINEAR:E},ht={iso8601:void 0};return nt.load=function(e,t){return(new nt).load(e,t)},u(nt.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}}}),nt.updaters=[ze,Ge,We,He,qe,Re,Oe,Ye,Xe,Ze,Je,Ke,Ne,Le,Qe,Fe,ke],nt.prototype.process=function(e,t){return tt(this,e,t,!1)},nt.prototype.load=function(e,t){return tt(this,e,t,!0)},nt.processPacketData=Ae,nt.processPositionPacketData=Ie,nt.processMaterialPacketData=De,nt._processCzml=function(e,t,i,r,n){if(r=l(r)?r:nt.updaters,g(e))for(var o=0,a=e.length;a>o;o++)$e(e[o],t,r,i,n);else $e(e,t,r,i,n)},nt}),i("DataSources/DataSourceCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../ThirdParty/when"],function(e,t,i,r,n,o,a){"use strict";function s(){this._dataSources=[],this._dataSourceAdded=new o,this._dataSourceRemoved=new o}return i(s.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}}}),s.prototype.add=function(e){var t=this,i=this._dataSources;return a(e,function(e){return i===t._dataSources&&(t._dataSources.push(e),t._dataSourceAdded.raiseEvent(t,e)),e})},s.prototype.remove=function(t,i){i=e(i,!1);var r=this._dataSources.indexOf(t);return-1!==r?(this._dataSources.splice(r,1),this._dataSourceRemoved.raiseEvent(this,t),i&&"function"==typeof t.destroy&&t.destroy(),!0):!1},s.prototype.removeAll=function(t){t=e(t,!1);for(var i=this._dataSources,r=0,n=i.length;n>r;++r){var o=i[r];this._dataSourceRemoved.raiseEvent(this,o),t&&"function"==typeof o.destroy&&o.destroy()}this._dataSources=[]},s.prototype.contains=function(e){return-1!==this.indexOf(e)},s.prototype.indexOf=function(e){return this._dataSources.indexOf(e)},s.prototype.get=function(e){return this._dataSources[e]},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this.removeAll(!0),r(this)},s}),i("DataSources/EllipseGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EllipseGeometry","../Core/EllipseOutlineGeometry","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C){"use strict";function E(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0}function S(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(S.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new E(e),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}function w(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new E(t._entity)}var T=new v(e.WHITE),x=new g(!0),b=new g(!0),A=new g(!1),P=new g(e.BLACK),I=new e;return n(S,{perInstanceColorAppearanceType:{value:m},materialAppearanceType:{value:p}}),n(S.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&C.isConstant(this._showProperty)&&C.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){ -return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&C.isConstant(this._showProperty)&&C.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},geometryChanged:{get:function(){return this._geometryChanged}}}),S.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},S.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},S.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,l=a.isAvailable(i),u=new d(l&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i));if(this._materialProperty instanceof v){var h=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(h=this._materialProperty.color.getValue(i)),o=t.fromColor(h),n={show:u,color:o}}else n={show:u};return new c({id:a,geometry:new s(this._options),attributes:n})},S.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=C.getValueOrDefault(this._outlineColorProperty,i,e.BLACK);return new c({id:r,geometry:new l(this._options),attributes:{show:new d(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o)}})},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){this._entitySubscription(),o(this)},S.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"position"===t||"ellipse"===t){var a=this._entity.ellipse;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=r(s)&&s.isConstant?s.getValue(h.MINIMUM_VALUE):!0,u=a.outline,c=r(u);if(c&&u.isConstant&&(c=u.getValue(h.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=this._entity.position,f=a.semiMajorAxis,g=a.semiMinorAxis,_=a.show;if(r(_)&&_.isConstant&&!_.getValue(h.MINIMUM_VALUE)||!r(d)||!r(f)||!r(g))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var y=i(a.material,T),E=y instanceof v;this._materialProperty=y,this._fillProperty=i(s,b),this._showProperty=i(_,x),this._showOutlineProperty=i(a.outline,A),this._outlineColorProperty=c?i(a.outlineColor,P):void 0;var S=a.rotation,w=a.height,I=a.extrudedHeight,M=a.granularity,D=a.stRotation,R=a.outlineWidth,O=a.numberOfVerticalLines;if(this._isClosed=r(I),this._fillEnabled=l,this._outlineEnabled=c,d.isConstant&&f.isConstant&&g.isConstant&&C.isConstant(S)&&C.isConstant(w)&&C.isConstant(I)&&C.isConstant(M)&&C.isConstant(D)&&C.isConstant(R)&&C.isConstant(O)){var N=this._options;N.vertexFormat=E?m.VERTEX_FORMAT:p.MaterialSupport.TEXTURED.vertexFormat,N.center=d.getValue(h.MINIMUM_VALUE,N.center),N.semiMajorAxis=f.getValue(h.MINIMUM_VALUE,N.semiMajorAxis),N.semiMinorAxis=g.getValue(h.MINIMUM_VALUE,N.semiMinorAxis),N.rotation=r(S)?S.getValue(h.MINIMUM_VALUE):void 0,N.height=r(w)?w.getValue(h.MINIMUM_VALUE):void 0,N.extrudedHeight=r(I)?I.getValue(h.MINIMUM_VALUE):void 0,N.granularity=r(M)?M.getValue(h.MINIMUM_VALUE):void 0,N.stRotation=r(D)?D.getValue(h.MINIMUM_VALUE):void 0,N.numberOfVerticalLines=r(O)?O.getValue(h.MINIMUM_VALUE):void 0,this._outlineWidth=r(R)?R.getValue(h.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},S.prototype.createDynamicUpdater=function(e){return new w(e,this)},w.prototype.update=function(i){var n=this._primitives;n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var o=this._geometryUpdater,a=o._entity,u=a.ellipse;if(a.isShowing&&a.isAvailable(i)&&C.getValueOrDefault(u.show,i,!0)){var h=this._options,d=C.getValueOrUndefined(a.position,i,h.center),v=C.getValueOrUndefined(u.semiMajorAxis,i),g=C.getValueOrUndefined(u.semiMinorAxis,i);if(r(d)&&r(v)&&r(g)){if(h.center=d,h.semiMajorAxis=v,h.semiMinorAxis=g,h.rotation=C.getValueOrUndefined(u.rotation,i),h.height=C.getValueOrUndefined(u.height,i),h.extrudedHeight=C.getValueOrUndefined(u.extrudedHeight,i),h.granularity=C.getValueOrUndefined(u.granularity,i),h.stRotation=C.getValueOrUndefined(u.stRotation,i),h.numberOfVerticalLines=C.getValueOrUndefined(u.numberOfVerticalLines,i),C.getValueOrDefault(u.fill,i,!0)){var _=y.getValue(i,o.fillMaterialProperty,this._material);this._material=_;var E=new p({material:_,translucent:_.isTranslucent(),closed:r(h.extrudedHeight)});h.vertexFormat=E.vertexFormat,this._primitive=n.add(new f({geometryInstances:new c({id:a,geometry:new s(h)}),appearance:E,asynchronous:!1}))}if(C.getValueOrDefault(u.outline,i,!1)){h.vertexFormat=m.VERTEX_FORMAT;var S=C.getValueOrClonedDefault(u.outlineColor,i,e.BLACK,I),w=C.getValueOrDefault(u.outlineWidth,i,1),T=1!==S.alpha;this._outlinePrimitive=n.add(new f({geometryInstances:new c({id:a,geometry:new l(h),attributes:{color:t.fromColor(S)}}),appearance:new m({flat:!0,translucent:T,renderState:{lineWidth:o._scene.clampLineWidth(w)}}),asynchronous:!1}))}}}},w.prototype.getBoundingSphere=function(e,t){return _(e,this._primitive,this._outlinePrimitive,t)},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},S}),i("DataSources/EllipsoidGeometryUpdater",["../Core/Cartesian3","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EllipsoidGeometry","../Core/EllipsoidOutlineGeometry","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/Matrix4","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/SceneMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w){"use strict";function T(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0}function x(e,t){this._scene=t,this._entity=e,this._entitySubscription=e.definitionChanged.addEventListener(x.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new c,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new T(e),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}function b(e,t){this._entity=t._entity,this._scene=t._scene,this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new T(t._entity),this._modelMatrix=new p,this._material=void 0,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0}var A=new y(t.WHITE),P=new C(!0),I=new C(!0),M=new C(!1),D=new C(t.BLACK),R=new e,O=new t,N=new e(1,1,1);return o(x,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:f}}),o(x.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!n(this._entity.availability)&&w.isConstant(this._showProperty)&&w.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!n(this._entity.availability)&&w.isConstant(this._showProperty)&&w.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),x.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},x.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},x.prototype.createFillGeometryInstance=function(e){var r,o,a=this._entity,s=a.isAvailable(e),u=new m(s&&a.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e));if(this._materialProperty instanceof y){var c=t.WHITE;n(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(c=this._materialProperty.color.getValue(e)),o=i.fromColor(c),r={show:u,color:o}}else r={show:u};return new h({id:a,geometry:new l(this._options),modelMatrix:a._getModelMatrix(d.MINIMUM_VALUE),attributes:r})},x.prototype.createOutlineGeometryInstance=function(e){var r=this._entity,n=r.isAvailable(e),o=w.getValueOrDefault(this._outlineColorProperty,e,t.BLACK);return new h({id:r,geometry:new u(this._options),modelMatrix:r._getModelMatrix(d.MINIMUM_VALUE),attributes:{show:new m(n&&r.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:i.fromColor(o)}})},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){this._entitySubscription(),a(this)},x.prototype._onEntityPropertyChanged=function(e,t,i,o){if("availability"===t||"position"===t||"orientation"===t||"ellipsoid"===t){var a=e.ellipsoid;if(!n(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=n(s)&&s.isConstant?s.getValue(d.MINIMUM_VALUE):!0,u=a.outline,c=n(u);if(c&&u.isConstant&&(c=u.getValue(d.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var h=e.position,p=a.radii,m=a.show;if(n(m)&&m.isConstant&&!m.getValue(d.MINIMUM_VALUE)||!n(h)||!n(p))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var g=r(a.material,A),_=g instanceof y;this._materialProperty=g,this._fillProperty=r(s,I),this._showProperty=r(m,P),this._showOutlineProperty=r(a.outline,M),this._outlineColorProperty=c?r(a.outlineColor,D):void 0,this._fillEnabled=l,this._outlineEnabled=c;var C=a.stackPartitions,E=a.slicePartitions,S=a.outlineWidth,T=a.subdivisions;if(h.isConstant&&w.isConstant(e.orientation)&&p.isConstant&&w.isConstant(C)&&w.isConstant(E)&&w.isConstant(S)&&w.isConstant(T)){var x=this._options;x.vertexFormat=_?v.VERTEX_FORMAT:f.MaterialSupport.TEXTURED.vertexFormat,x.radii=p.getValue(d.MINIMUM_VALUE,x.radii),x.stackPartitions=n(C)?C.getValue(d.MINIMUM_VALUE):void 0,x.slicePartitions=n(E)?E.getValue(d.MINIMUM_VALUE):void 0,x.subdivisions=n(T)?T.getValue(d.MINIMUM_VALUE):void 0,this._outlineWidth=n(S)?S.getValue(d.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},x.prototype.createDynamicUpdater=function(e){return new b(e,this)},b.prototype.update=function(e){var o=this._entity,a=o.ellipsoid;if(!o.isShowing||!o.isAvailable(e)||!w.getValueOrDefault(a.show,e,!0))return n(this._primitive)&&(this._primitive.show=!1),void(n(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1));var s=w.getValueOrUndefined(a.radii,e,R),c=o._getModelMatrix(e,this._modelMatrix);if(!n(c)||!n(s))return n(this._primitive)&&(this._primitive.show=!1),void(n(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1));var d,y=w.getValueOrDefault(a.fill,e,!0),C=w.getValueOrDefault(a.outline,e,!1),E=w.getValueOrClonedDefault(a.outlineColor,e,t.BLACK,O),T=S.getValue(e,r(a.material,A),this._material);this._material=T;var x=w.getValueOrUndefined(a.stackPartitions,e),b=w.getValueOrUndefined(a.slicePartitions,e),P=w.getValueOrUndefined(a.subdivisions,e),I=w.getValueOrDefault(a.outlineWidth,e,1),M=this._scene.mode,D=M===_.SCENE3D,L=this._options,F=!D||this._lastSceneMode!==M||!n(this._primitive)||L.stackPartitions!==x||L.slicePartitions!==b||L.subdivisions!==P||this._lastOutlineWidth!==I;if(F){var B=this._primitives;B.removeAndDestroy(this._primitive),B.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=M,this._lastOutlineWidth=I,L.stackPartitions=x,L.slicePartitions=b,L.subdivisions=P,L.radii=D?N:s,d=new f({material:T,translucent:T.isTranslucent(),closed:!0}),L.vertexFormat=d.vertexFormat,this._primitive=B.add(new g({geometryInstances:new h({id:o,geometry:new l(L),modelMatrix:D?void 0:c,attributes:{show:new m(y)}}),appearance:d,asynchronous:!1})),L.vertexFormat=v.VERTEX_FORMAT,this._outlinePrimitive=B.add(new g({geometryInstances:new h({id:o,geometry:new u(L),modelMatrix:D?void 0:c,attributes:{show:new m(C),color:i.fromColor(E)}}),appearance:new v({flat:!0,translucent:1!==E.alpha,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(I)}}),asynchronous:!1})),this._lastShow=y,this._lastOutlineShow=C,this._lastOutlineColor=t.clone(E,this._lastOutlineColor)}else if(this._primitive.ready){var V=this._primitive,k=this._outlinePrimitive;V.show=!0,k.show=!0,d=V.appearance,d.material=T;var z=this._attributes;n(z)||(z=V.getGeometryInstanceAttributes(o),this._attributes=z),y!==this._lastShow&&(z.show=m.toValue(y,z.show),this._lastShow=y);var U=this._outlineAttributes;n(U)||(U=k.getGeometryInstanceAttributes(o),this._outlineAttributes=U),C!==this._lastOutlineShow&&(U.show=m.toValue(C,U.show),this._lastOutlineShow=C),t.equals(E,this._lastOutlineColor)||(U.color=i.toValue(E,U.color),t.clone(E,this._lastOutlineColor))}D&&(s.x=Math.max(s.x,.001),s.y=Math.max(s.y,.001),s.z=Math.max(s.z,.001),c=p.multiplyByScale(c,s,c),this._primitive.modelMatrix=c,this._outlinePrimitive.modelMatrix=c)},b.prototype.getBoundingSphere=function(e,t){return E(e,this._primitive,this._outlinePrimitive,t)},b.prototype.isDestroyed=function(){return!1},b.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),a(this)},x}),i("DataSources/StaticGeometryColorBatch",["../Core/AssociativeArray","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","./BoundingSphereState"],function(e,t,i,r,n,o,a){"use strict";function s(t,i,r,n){this.translucent=i,this.appearanceType=r,this.closed=n,this.primitives=t,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.updaters=new e,this.updatersWithAttributes=new e,this.attributes=new e,this.subscriptions=new e,this.showsUpdated=new e,this.itemsToRemove=[]}function l(e,t,i){this._solidBatch=new s(e,!1,t,i),this._translucentBatch=new s(e,!0,t,i)}var u=new t;return s.prototype.add=function(e,t){var i=e.entity.id;if(this.createPrimitive=!0,this.geometry.set(i,t),this.updaters.set(i,e),e.hasConstantFill&&e.fillMaterialProperty.isConstant){var r=this;this.subscriptions.set(i,e.entity.definitionChanged.addEventListener(function(t,i,n,o){"isShowing"===i&&r.showsUpdated.set(t.id,e)}))}else this.updatersWithAttributes.set(i,e)},s.prototype.remove=function(e){var t=e.entity.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var i=this.subscriptions.get(t);r(i)&&(i(),this.subscriptions.remove(t))}},s.prototype.update=function(e){var a,s,l=!0,c=0,h=this.primitive,d=this.primitives;if(this.createPrimitive){var p=this.geometry.values,m=p.length;if(m>0){for(r(h)&&(r(this.oldPrimitive)?d.remove(h):this.oldPrimitive=h),s=0;m>s;s++){var f=p[s],v=f.attributes;a=this.attributes.get(f.id.id),r(a)&&(r(v.show)&&(v.show.value=a.show),r(v.color)&&(v.color.value=a.color))}h=new o({asynchronous:!0,geometryInstances:p,appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed})}),d.add(h),l=!1}else{r(h)&&(d.remove(h),h=void 0);var g=this.oldPrimitive;r(g)&&(d.remove(g),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=h,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(r(h)&&h.ready){r(this.oldPrimitive)&&(d.remove(this.oldPrimitive),this.oldPrimitive=void 0);var _=this.updatersWithAttributes.values,y=_.length,C=this.waitingOnCreate;for(s=0;y>s;s++){var E=_[s],S=this.geometry.get(E.entity.id);if(a=this.attributes.get(S.id.id),r(a)||(a=h.getGeometryInstanceAttributes(S.id),this.attributes.set(S.id.id,a)),!E.fillMaterialProperty.isConstant||C){var w=E.fillMaterialProperty.color;w.getValue(e,u),t.equals(a._lastColor,u)||(a._lastColor=t.clone(u,a._lastColor),a.color=i.toValue(u,a.color),(this.translucent&&255===a.color[3]||!this.translucent&&255!==a.color[3])&&(this.itemsToRemove[c++]=E))}var T=E.entity.isShowing&&(E.hasConstantFill||E.isFilled(e)),x=1===a.show[0];T!==x&&(a.show=n.toValue(T,a.show))}this.updateShows(h),this.waitingOnCreate=!1}else r(h)&&!h.ready&&(l=!1);return this.itemsToRemove.length=c,l},s.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,o=0;i>o;o++){var a=t[o],s=this.geometry.get(a.entity.id),l=this.attributes.get(s.id.id);r(l)||(l=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,l));var u=a.entity.isShowing,c=1===l.show[0];u!==c&&(l.show=n.toValue(u,l.show))}this.showsUpdated.removeAll()},s.prototype.contains=function(e){return this.updaters.contains(e.id)},s.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return a.PENDING;var n=i.getGeometryInstanceAttributes(e);return!r(n)||!r(n.boundingSphere)||r(n.show)&&0===n.show[0]?a.FAILED:(n.boundingSphere.clone(t),a.DONE)},s.prototype.removeAllPrimitives=function(){var e=this.primitives,t=this.primitive;r(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());var i=this.oldPrimitive;r(i)&&(e.remove(i),this.oldPrimitive=void 0)},l.prototype.add=function(e,t){var i=t.createFillGeometryInstance(e);255===i.attributes.color.value[3]?this._solidBatch.add(t,i):this._translucentBatch.add(t,i)},l.prototype.remove=function(e){this._solidBatch.remove(e)||this._translucentBatch.remove(e)},l.prototype.update=function(e){var t,i,r=this._solidBatch.update(e);r=this._translucentBatch.update(e)&&r;var n=this._solidBatch.itemsToRemove,o=n.length;if(o>0)for(t=0;o>t;t++)i=n[t],this._solidBatch.remove(i),this._translucentBatch.add(i,i.createFillGeometryInstance(e));n=this._translucentBatch.itemsToRemove;var a=n.length;if(a>0)for(t=0;a>t;t++)i=n[t],this._translucentBatch.remove(i),this._solidBatch.add(i,i.createFillGeometryInstance(e));return(o>0||a>0)&&(r=this._solidBatch.update(e)&&r,r=this._translucentBatch.update(e)&&r),r},l.prototype.getBoundingSphere=function(e,t){return this._solidBatch.contains(e)?this._solidBatch.getBoundingSphere(e,t):this._translucentBatch.contains(e)?this._translucentBatch.getBoundingSphere(e,t):a.FAILED},l.prototype.removeAllPrimitives=function(){this._solidBatch.removeAllPrimitives(),this._translucentBatch.removeAllPrimitives()},l}),i("DataSources/StaticGeometryPerMaterialBatch",["../Core/AssociativeArray","../Core/defined","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","./BoundingSphereState","./MaterialProperty"],function(e,t,i,r,n,o){"use strict";function a(t,i,r,n){this.primitives=t,this.appearanceType=i,this.materialProperty=r,this.closed=n,this.updaters=new e,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.material=void 0,this.updatersWithAttributes=new e,this.attributes=new e,this.invalidated=!1,this.removeMaterialSubscription=r.definitionChanged.addEventListener(a.prototype.onMaterialChanged,this),this.subscriptions=new e,this.showsUpdated=new e}function s(e,t,i){this._items=[],this._primitives=e,this._appearanceType=t,this._closed=i}return a.prototype.onMaterialChanged=function(){this.invalidated=!0},a.prototype.isMaterial=function(e){var i=this.materialProperty,r=e.fillMaterialProperty;return r===i?!0:t(i)?i.equals(r):!1},a.prototype.add=function(e,t){var i=t.entity.id;if(this.updaters.set(i,t),this.geometry.set(i,t.createFillGeometryInstance(e)),t.hasConstantFill&&t.fillMaterialProperty.isConstant){var r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(e,i,n,o){"isShowing"===i&&r.showsUpdated.set(e.id,t)}))}else this.updatersWithAttributes.set(i,t);this.createPrimitive=!0},a.prototype.remove=function(e){var i=e.entity.id,r=this.updaters.remove(i);if(r){this.geometry.remove(i),this.updatersWithAttributes.remove(i);var n=this.subscriptions.get(i);t(n)&&(n(),this.subscriptions.remove(i))}return this.createPrimitive=r,r},a.prototype.update=function(e){var n,a,s=!0,l=this.primitive,u=this.primitives,c=this.geometry.values;if(this.createPrimitive){var h=c.length;if(h>0){for(t(l)&&(t(this.oldPrimitive)?u.remove(l):this.oldPrimitive=l),a=0;h>a;a++){var d=c[a],p=d.attributes;n=this.attributes.get(d.id.id),t(n)&&(t(p.show)&&(p.show.value=n.show),t(p.color)&&(p.color.value=n.color))}this.material=o.getValue(e,this.materialProperty,this.material),l=new r({asynchronous:!0,geometryInstances:c,appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed})}),u.add(l),s=!1}else{t(l)&&(u.remove(l),l=void 0);var m=this.oldPrimitive;t(m)&&(u.remove(m),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=l,this.createPrimitive=!1}else if(t(l)&&l.ready){t(this.oldPrimitive)&&(u.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=o.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;var f=this.updatersWithAttributes.values,v=f.length;for(a=0;v>a;a++){var g=f[a],_=g.entity,y=this.geometry.get(_.id);n=this.attributes.get(y.id.id),t(n)||(n=l.getGeometryInstanceAttributes(y.id),this.attributes.set(y.id.id,n));var C=_.isShowing&&(g.hasConstantFill||g.isFilled(e)),E=1===n.show[0];C!==E&&(n.show=i.toValue(C,n.show))}this.updateShows(l)}else t(l)&&!l.ready&&(s=!1);return s},a.prototype.updateShows=function(e){for(var r=this.showsUpdated.values,n=r.length,o=0;n>o;o++){var a=r[o],s=a.entity,l=this.geometry.get(s.id),u=this.attributes.get(l.id.id);t(u)||(u=e.getGeometryInstanceAttributes(l.id),this.attributes.set(l.id.id,u));var c=s.isShowing,h=1===u.show[0];c!==h&&(u.show=i.toValue(c,u.show))}this.showsUpdated.removeAll()},a.prototype.contains=function(e){return this.updaters.contains(e.id)},a.prototype.getBoundingSphere=function(e,i){var r=this.primitive;if(!r.ready)return n.PENDING;var o=r.getGeometryInstanceAttributes(e);return!t(o)||!t(o.boundingSphere)||t(o.show)&&0===o.show[0]?n.FAILED:(o.boundingSphere.clone(i),n.DONE)},a.prototype.destroy=function(e){var i=this.primitive,r=this.primitives;t(i)&&r.remove(i);var n=this.oldPrimitive;t(n)&&r.remove(n),this.removeMaterialSubscription()},s.prototype.add=function(e,t){for(var i=this._items,r=i.length,n=0;r>n;n++){var o=i[n];if(o.isMaterial(t))return void o.add(e,t)}var s=new a(this._primitives,this._appearanceType,t.fillMaterialProperty,this._closed);s.add(e,t),i.push(s)},s.prototype.remove=function(e){for(var t=this._items,i=t.length,r=i-1;r>=0;r--){var n=t[r];if(n.remove(e)){0===n.updaters.length&&(t.splice(r,1),n.destroy());break}}},s.prototype.update=function(e){var t,i=this._items,r=i.length;for(t=r-1;t>=0;t--){var n=i[t];if(n.invalidated){i.splice(t,1);for(var o=n.updaters.values,a=o.length,s=0;a>s;s++)this.add(e,o[s]);n.destroy()}}var l=!0;for(t=0;r>t;t++)l=i[t].update(e)&&l;return l},s.prototype.getBoundingSphere=function(e,t){for(var i=this._items,r=i.length,o=0;r>o;o++){var a=i[o];if(a.contains(e))return a.getBoundingSphere(e,t)}return n.FAILED},s.prototype.removeAllPrimitives=function(){for(var e=this._items,t=e.length,i=0;t>i;i++)e[i].destroy();this._items.length=0},s}),i("DataSources/StaticOutlineGeometryBatch",["../Core/AssociativeArray","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/ShowGeometryInstanceAttribute","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./BoundingSphereState"],function(e,t,i,r,n,o,a,s){"use strict";function l(t,i,r){this.translucent=i,this.primitives=t,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.updaters=new e,this.updatersWithAttributes=new e,this.attributes=new e,this.itemsToRemove=[],this.width=r,this.subscriptions=new e,this.showsUpdated=new e}function u(t,i){this._primitives=t,this._scene=i,this._solidBatches=new e,this._translucentBatches=new e}l.prototype.add=function(e,t){var i=e.entity.id;if(this.createPrimitive=!0,this.geometry.set(i,t),this.updaters.set(i,e),e.hasConstantOutline&&e.outlineColorProperty.isConstant){var r=this;this.subscriptions.set(i,e.entity.definitionChanged.addEventListener(function(t,i,n,o){"isShowing"===i&&r.showsUpdated.set(t.id,e)}))}else this.updatersWithAttributes.set(i,e)},l.prototype.remove=function(e){var t=e.entity.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var i=this.subscriptions.get(t);r(i)&&(i(),this.subscriptions.remove(t))}};var c=new t;return l.prototype.update=function(e){var s,l,u=!0,h=0,d=this.primitive,p=this.primitives;if(this.createPrimitive){var m=this.geometry.values,f=m.length;if(f>0){for(r(d)&&(r(this.oldPrimitive)?p.remove(d):this.oldPrimitive=d),l=0;f>l;l++){var v=m[l],g=v.attributes;s=this.attributes.get(v.id.id),r(s)&&(r(g.show)&&(g.show.value=s.show),r(g.color)&&(g.color.value=s.color))}d=new a({asynchronous:!0,geometryInstances:m,appearance:new o({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}})}),p.add(d),u=!1}else{r(d)&&(p.remove(d),d=void 0);var _=this.oldPrimitive;r(_)&&(p.remove(_),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=d,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(r(d)&&d.ready){r(this.oldPrimitive)&&(p.remove(this.oldPrimitive),this.oldPrimitive=void 0);var y=this.updatersWithAttributes.values,C=y.length,E=this.waitingOnCreate;for(l=0;C>l;l++){var S=y[l],w=this.geometry.get(S.entity.id);if(s=this.attributes.get(w.id.id),r(s)||(s=d.getGeometryInstanceAttributes(w.id),this.attributes.set(w.id.id,s)),!S.outlineColorProperty.isConstant||E){var T=S.outlineColorProperty;T.getValue(e,c),t.equals(s._lastColor,c)||(s._lastColor=t.clone(c,s._lastColor),s.color=i.toValue(c,s.color),(this.translucent&&255===s.color[3]||!this.translucent&&255!==s.color[3])&&(this.itemsToRemove[h++]=S))}var x=S.entity.isShowing&&(S.hasConstantOutline||S.isOutlineVisible(e)),b=1===s.show[0];x!==b&&(s.show=n.toValue(x,s.show))}this.updateShows(d),this.waitingOnCreate=!1}else r(d)&&!d.ready&&(u=!1);return this.itemsToRemove.length=h,u},l.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,o=0;i>o;o++){var a=t[o],s=this.geometry.get(a.entity.id),l=this.attributes.get(s.id.id);r(l)||(l=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,l));var u=a.entity.isShowing,c=1===l.show[0];u!==c&&(l.show=n.toValue(u,l.show))}this.showsUpdated.removeAll()},l.prototype.contains=function(e){return this.updaters.contains(e.id)},l.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return s.PENDING;var n=i.getGeometryInstanceAttributes(e);return!r(n)||!r(n.boundingSphere)||r(n.show)&&0===n.show[0]?s.FAILED:(n.boundingSphere.clone(t),s.DONE)},l.prototype.removeAllPrimitives=function(){var e=this.primitives,t=this.primitive;r(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());var i=this.oldPrimitive;r(i)&&(e.remove(i),this.oldPrimitive=void 0)},u.prototype.add=function(e,t){var i,n,o=t.createOutlineGeometryInstance(e),a=this._scene.clampLineWidth(t.outlineWidth);255===o.attributes.color.value[3]?(i=this._solidBatches,n=i.get(a),r(n)||(n=new l(this._primitives,!1,a),i.set(a,n)),n.add(t,o)):(i=this._translucentBatches,n=i.get(a),r(n)||(n=new l(this._primitives,!0,a),i.set(a,n)),n.add(t,o))},u.prototype.remove=function(e){var t,i=this._solidBatches.values,r=i.length;for(t=0;r>t;t++)if(i[t].remove(e))return;var n=this._translucentBatches.values,o=n.length;for(t=0;o>t;t++)if(n[t].remove(e))return},u.prototype.update=function(e){var t,i,r,n,o,a=this._solidBatches.values,s=a.length,l=this._translucentBatches.values,u=l.length,c=!0,h=!1;do{for(h=!1,i=0;s>i;i++){n=a[i],c=n.update(e),o=n.itemsToRemove;var d=o.length;if(d>0)for(h=!0,t=0;d>t;t++)r=o[t],n.remove(r),this.add(e,r)}for(i=0;u>i;i++){n=l[i],c=n.update(e),o=n.itemsToRemove;var p=o.length;if(p>0)for(h=!0,t=0;p>t;t++)r=o[t],n.remove(r),this.add(e,r)}}while(h);return c},u.prototype.getBoundingSphere=function(e,t){var i,r=this._solidBatches.values,n=r.length;for(i=0;n>i;i++){var o=r[i];if(o.contains(e))return o.getBoundingSphere(e,t)}var a=this._translucentBatches.values,l=a.length;for(i=0;l>i;i++){var u=a[i];if(u.contains(e))return u.getBoundingSphere(e,t)}return s.FAILED},u.prototype.removeAllPrimitives=function(){var e,t=this._solidBatches.values,i=t.length;for(e=0;i>e;e++)t[e].removeAllPrimitives();var r=this._translucentBatches.values,n=r.length;for(e=0;n>e;e++)r[e].removeAllPrimitives()},u}),i("DataSources/GeometryVisualizer",["../Core/AssociativeArray","../Core/BoundingSphere","../Core/defined","../Core/destroyObject","../Core/DeveloperError","./BoundingSphereState","./ColorMaterialProperty","./StaticGeometryColorBatch","./StaticGeometryPerMaterialBatch","./StaticOutlineGeometryBatch"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t){this._primitives=t,this._dynamicUpdaters=new e}function h(e,t){for(var i=e._batches,r=i.length,n=0;r>n;n++)i[n].remove(t)}function d(e,t,i){return i.isDynamic?void e._dynamicBatch.add(t,i):(i.outlineEnabled&&e._outlineBatch.add(t,i),void(i.fillEnabled&&(i.isClosed?i.fillMaterialProperty instanceof a?e._closedColorBatch.add(t,i):e._closedMaterialBatch.add(t,i):i.fillMaterialProperty instanceof a?e._openColorBatch.add(t,i):e._openMaterialBatch.add(t,i))))}function p(t,i,r){this._type=t;var n=i.primitives;this._scene=i,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new e,this._removedObjects=new e,this._changedObjects=new e,this._outlineBatch=new u(n,i),this._closedColorBatch=new s(n,t.perInstanceColorAppearanceType,!0),this._closedMaterialBatch=new l(n,t.materialAppearanceType,!0),this._openColorBatch=new s(n,t.perInstanceColorAppearanceType,!1),this._openMaterialBatch=new l(n,t.materialAppearanceType,!1),this._dynamicBatch=new c(n),this._batches=[this._closedColorBatch,this._closedMaterialBatch,this._openColorBatch,this._openMaterialBatch,this._dynamicBatch,this._outlineBatch],this._subscriptions=new e,this._updaters=new e,this._entityCollection=r,r.collectionChanged.addEventListener(p.prototype._onCollectionChanged,this),this._onCollectionChanged(r,r.values,m)}var m=[];c.prototype.add=function(e,t){this._dynamicUpdaters.set(t.entity.id,t.createDynamicUpdater(this._primitives))},c.prototype.remove=function(e){ -var t=e.entity.id,r=this._dynamicUpdaters.get(t);i(r)&&(this._dynamicUpdaters.remove(t),r.destroy())},c.prototype.update=function(e){for(var t=this._dynamicUpdaters.values,i=0,r=t.length;r>i;i++)t[i].update(e);return!0},c.prototype.removeAllPrimitives=function(){for(var e=this._dynamicUpdaters.values,t=0,i=e.length;i>t;t++)e[t].destroy();this._dynamicUpdaters.removeAll()},c.prototype.getBoundingSphere=function(e,t){var r=this._dynamicUpdaters.get(e.id);return i(r)&&i(r.getBoundingSphere)?r.getBoundingSphere(e,t):o.FAILED},p.prototype.update=function(e){var t,i,r,n,o=this._addedObjects,a=o.values,s=this._removedObjects,l=s.values,u=this._changedObjects,c=u.values;for(t=c.length-1;t>-1;t--)i=c[t],r=i.id,n=this._updaters.get(r),n.entity===i?(h(this,n),d(this,e,n)):(l.push(i),a.push(i));for(t=l.length-1;t>-1;t--)i=l[t],r=i.id,n=this._updaters.get(r),h(this,n),n.destroy(),this._updaters.remove(r),this._subscriptions.get(r)(),this._subscriptions.remove(r);for(t=a.length-1;t>-1;t--)i=a[t],r=i.id,n=new this._type(i,this._scene),this._updaters.set(r,n),d(this,e,n),this._subscriptions.set(r,n.geometryChanged.addEventListener(p._onGeometryChanged,this));o.removeAll(),s.removeAll(),u.removeAll();var m=!0,f=this._batches,v=f.length;for(t=0;v>t;t++)m=f[t].update(e)&&m;return m};var f=[],v=new t;return p.prototype.getBoundingSphere=function(e,i){for(var r=f,n=v,a=0,s=o.DONE,l=this._batches,u=l.length,c=0;u>c;c++){if(s=l[c].getBoundingSphere(e,n),s===o.PENDING)return o.PENDING;s===o.DONE&&(r[a]=t.clone(n,r[a]),a++)}return 0===a?o.FAILED:(r.length=a,t.fromBoundingSpheres(r,i),o.DONE)},p.prototype.isDestroyed=function(){return!1},p.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(p.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();var e,t=this._batches,i=t.length;for(e=0;i>e;e++)t[e].removeAllPrimitives();var n=this._subscriptions.values;for(i=n.length,e=0;i>e;e++)n[e]();return this._subscriptions.removeAll(),r(this)},p._onGeometryChanged=function(e){var t=this._removedObjects,r=this._changedObjects,n=e.entity,o=n.id;i(t.get(o))||i(r.get(o))||r.set(o,n)},p.prototype._onCollectionChanged=function(e,t,i){var r,n,o,a=this._addedObjects,s=this._removedObjects,l=this._changedObjects;for(r=i.length-1;r>-1;r--)o=i[r],n=o.id,a.remove(n)||(s.set(n,o),l.remove(n));for(r=t.length-1;r>-1;r--)o=t[r],n=o.id,s.remove(n)?l.set(n,o):a.set(n,o)},p}),i("Scene/Label",["../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/NearFarScalar","./Billboard","./HeightReference","./HorizontalOrigin","./LabelStyle","./VerticalOrigin"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function m(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function f(n,o){n=r(n,r.EMPTY_OBJECT),this._text=r(n.text,""),this._show=r(n.show,!0),this._font=r(n.font,"30px sans-serif"),this._fillColor=i.clone(r(n.fillColor,i.WHITE)),this._outlineColor=i.clone(r(n.outlineColor,i.BLACK)),this._outlineWidth=r(n.outlineWidth,1),this._style=r(n.style,h.FILL),this._verticalOrigin=r(n.verticalOrigin,d.BOTTOM),this._horizontalOrigin=r(n.horizontalOrigin,c.LEFT),this._pixelOffset=e.clone(r(n.pixelOffset,e.ZERO)),this._eyeOffset=t.clone(r(n.eyeOffset,t.ZERO)),this._position=t.clone(r(n.position,t.ZERO)),this._scale=r(n.scale,1),this._id=n.id,this._translucencyByDistance=n.translucencyByDistance,this._pixelOffsetScaleByDistance=n.pixelOffsetScaleByDistance,this._heightReference=r(n.heightReference,u.NONE),this._labelCollection=o,this._glyphs=[],this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._updateClamping()}return o(f.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(var t=this._glyphs,i=0,r=t.length;r>i;i++){var o=t[i];n(o.billboard)&&(o.billboard.show=e)}}}},position:{get:function(){return this._position},set:function(e){var i=this._position;if(!t.equals(i,e))if(t.clone(e,i),this._heightReference===u.NONE)for(var r=this._glyphs,o=0,a=r.length;a>o;o++){var s=r[o];n(s.billboard)&&(s.billboard.position=e)}else this._updateClamping()}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightReference=e,this._updateClamping())}},text:{get:function(){return this._text},set:function(e){this._text!==e&&(this._text=e,p(this))}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,p(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){var t=this._fillColor;i.equals(t,e)||(i.clone(e,t),p(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){var t=this._outlineColor;i.equals(t,e)||(i.clone(e,t),p(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,p(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,p(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(t){var i=this._pixelOffset;if(!e.equals(i,t)){e.clone(t,i);for(var r=this._glyphs,o=0,a=r.length;a>o;o++){var s=r[o];n(s.billboard)&&(s.billboard.pixelOffset=t)}}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;if(!s.equals(t,e)){this._translucencyByDistance=s.clone(e,t);for(var i=this._glyphs,r=0,o=i.length;o>r;r++){var a=i[r];n(a.billboard)&&(a.billboard.translucencyByDistance=e)}}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){var t=this._pixelOffsetScaleByDistance;if(!s.equals(t,e)){this._pixelOffsetScaleByDistance=s.clone(e,t);for(var i=this._glyphs,r=0,o=i.length;o>r;r++){var a=i[r];n(a.billboard)&&(a.billboard.pixelOffsetScaleByDistance=e)}}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){var i=this._eyeOffset;if(!t.equals(i,e)){t.clone(e,i);for(var r=this._glyphs,o=0,a=r.length;a>o;o++){var s=r[o];n(s.billboard)&&(s.billboard.eyeOffset=e)}}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,m(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;for(var t=this._glyphs,i=0,r=t.length;r>i;i++){var o=t[i];n(o.billboard)&&(o.billboard.verticalOrigin=e)}m(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;for(var t=this._glyphs,i=0,r=t.length;r>i;i++){var o=t[i];n(o.billboard)&&(o.billboard.scale=e)}m(this)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;for(var t=this._glyphs,i=0,r=t.length;r>i;i++){var o=t[i];n(o.billboard)&&(o.billboard.id=e)}}}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=t.clone(e,this._actualClampedPosition);for(var i=this._glyphs,r=0,o=i.length;o>r;r++){var a=i[r];n(a.billboard)&&(a.billboard.position=e)}}}}),f.prototype._updateClamping=function(){l._updateClamping(this._labelCollection,this)},f.prototype.computeScreenSpacePosition=function(t,i){n(i)||(i=new e);var r=this._labelCollection,o=r.modelMatrix,a=l._computeActualPosition(this,this._position,t.frameState,o),s=l._computeScreenSpacePosition(o,a,this._eyeOffset,this._pixelOffset,t,i);return s.y=t.canvas.clientHeight-s.y,s},f.prototype.equals=function(r){return this===r||n(r)&&this._show===r._show&&this._scale===r._scale&&this._style===r._style&&this._verticalOrigin===r._verticalOrigin&&this._horizontalOrigin===r._horizontalOrigin&&this._text===r._text&&this._font===r._font&&t.equals(this._position,r._position)&&i.equals(this._fillColor,r._fillColor)&&i.equals(this._outlineColor,r._outlineColor)&&e.equals(this._pixelOffset,r._pixelOffset)&&t.equals(this._eyeOffset,r._eyeOffset)&&s.equals(this._translucencyByDistance,r._translucencyByDistance)&&s.equals(this._pixelOffsetScaleByDistance,r._pixelOffsetScaleByDistance)&&this._id===r._id},f.prototype.isDestroyed=function(){return!1},f}),i("Scene/LabelCollection",["../Core/Cartesian2","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/writeTextToCanvas","./BillboardCollection","./HorizontalOrigin","./Label","./LabelStyle","./TextureAtlas","./VerticalOrigin"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function f(e,t,i){this.labelCollection=e,this.index=t,this.dimensions=i}function v(e,t,i,r,n,o,a){return w.font=t,w.fillColor=i,w.strokeColor=r,w.strokeWidth=n,a===p.BOTTOM?w.textBaseline="bottom":a===p.TOP?w.textBaseline="top":w.textBaseline="middle",w.fill=o===h.FILL||o===h.FILL_AND_OUTLINE,w.stroke=o===h.OUTLINE||o===h.FILL_AND_OUTLINE,s(e,w)}function g(e,t){t.textureInfo=void 0,t.dimensions=void 0;var r=t.billboard;i(r)&&(r.show=!1,r.image=void 0,e._spareBillboards.push(r),t.billboard=void 0)}function _(e,t,i,r){e.addImage(t,i).then(function(e,t){r.index=e})}function y(e,t){var r,n,o,a=t._text,s=a.length,l=t._glyphs,c=l.length;if(c>s)for(n=s;c>n;++n)g(e,l[n]);l.length=s;var h=e._glyphTextureCache;for(o=0;s>o;++o){var d=a.charAt(o),p=t._font,y=t._fillColor,C=t._outlineColor,E=t._outlineWidth,S=t._style,w=t._verticalOrigin,T=JSON.stringify([d,p,y.toRgba(),C.toRgba(),E,+S,+w]),x=h[T];if(!i(x)){var b=v(d,p,y,C,E,S,w);x=new f(e,-1,b.dimensions),h[T]=x,b.width>0&&b.height>0&&_(e._textureAtlas,T,b,x)}if(r=l[o],i(r)?-1===x.index?g(e,r):i(r.textureInfo)&&(r.textureInfo=void 0):(r=new m,l[o]=r),r.textureInfo=x,r.dimensions=x.dimensions,-1!==x.index){var A=r.billboard;i(A)||(A=e._spareBillboards.length>0?e._spareBillboards.pop():e._billboardCollection.add({collection:e}),r.billboard=A),A.show=t._show,A.position=t._position,A.eyeOffset=t._eyeOffset,A.pixelOffset=t._pixelOffset,A.horizontalOrigin=u.LEFT,A.verticalOrigin=t._verticalOrigin,A.scale=t._scale,A.pickPrimitive=t,A.id=t._id,A.image=T,A.translucencyByDistance=t._translucencyByDistance,A.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance}}t._repositionAllGlyphs=!0}function C(e,t){var r,n,o=e._glyphs,a=0,s=0,l=0,c=o.length;for(l=0;c>l;++l)r=o[l],n=r.dimensions,a+=n.computedWidth,s=Math.max(s,n.height);var h=e._scale,d=e._horizontalOrigin,m=0;d===u.CENTER?m-=a/2*h:d===u.RIGHT&&(m-=a*h),T.x=m*t,T.y=0;var f=e._verticalOrigin;for(l=0;c>l;++l)r=o[l],n=r.dimensions,f===p.BOTTOM||n.height===s?T.y=-n.descent*h:f===p.TOP?T.y=-(s-n.height)*h-n.descent*h:f===p.CENTER&&(T.y=-(s-n.height)/2*h-n.descent*h),T.y*=t,i(r.billboard)&&r.billboard._setTranslate(T),T.x+=n.computedWidth*h*t}function E(e,t){for(var r=t._glyphs,o=0,a=r.length;a>o;++o)g(e,r[o]);t._labelCollection=void 0,i(t._removeCallbackFunc)&&t._removeCallbackFunc(),n(t)}function S(e){e=t(e,t.EMPTY_OBJECT),this._scene=e.scene,this._textureAtlas=void 0,this._billboardCollection=new l({scene:this._scene}),this._billboardCollection.destroyTextureAtlas=!1,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._resolutionScale=void 0,this.modelMatrix=a.clone(t(e.modelMatrix,a.IDENTITY)),this.debugShowBoundingVolume=t(e.debugShowBoundingVolume,!1)}var w={},T=new e;return r(S.prototype,{length:{get:function(){return this._labels.length}}}),S.prototype.add=function(e){var t=new c(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t},S.prototype.remove=function(e){if(i(e)&&e._labelCollection===this){var t=this._labels.indexOf(e);if(-1!==t)return this._labels.splice(t,1),E(this,e),!0}return!1},S.prototype.removeAll=function(){for(var e=this._labels,t=0,i=e.length;i>t;++t)E(this,e[t]);e.length=0},S.prototype.contains=function(e){return i(e)&&e._labelCollection===this},S.prototype.get=function(e){return this._labels[e]},S.prototype.update=function(e){var t=this._billboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume;var r=e.context;i(this._textureAtlas)||(this._textureAtlas=new d({context:r}),t.textureAtlas=this._textureAtlas);var n=r.uniformState,o=n.resolutionScale,a=this._resolutionScale!==o;this._resolutionScale=o;var s;s=a?this._labels:this._labelsToUpdate;for(var l=s.length,u=0;l>u;++u){var c=s[u];if(!c.isDestroyed()){var h=c._glyphs.length;c._rebindAllGlyphs&&(y(this,c),c._rebindAllGlyphs=!1),(a||c._repositionAllGlyphs)&&(C(c,o),c._repositionAllGlyphs=!1);var p=c._glyphs.length-h;this._totalGlyphCount+=p}}this._labelsToUpdate.length=0,t.update(e)},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),n(this)},S}),i("DataSources/LabelVisualizer",["../Core/AssociativeArray","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/NearFarScalar","../Scene/HorizontalOrigin","../Scene/LabelCollection","../Scene/LabelStyle","../Scene/VerticalOrigin","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(e){this.entity=e,this.label=void 0,this.index=void 0}function f(t,i){i.collectionChanged.addEventListener(f.prototype._onCollectionChanged,this),this._scene=t,this._unusedIndexes=[],this._labelCollection=void 0,this._entityCollection=i,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}function v(e,t){if(n(e)){var i=e.label;n(i)&&(t.push(e.index),i.show=!1,e.label=void 0,e.index=-1)}}var g=1,_="30px sans-serif",y=c.FILL,C=r.WHITE,E=r.BLACK,S=1,w=t.ZERO,T=i.ZERO,x=l.CENTER,b=h.CENTER,A=new i,P=new r,I=new r,M=new i,D=new t,R=new s,O=new s;return f.prototype.update=function(e){for(var t=this._items.values,i=this._unusedIndexes,r=0,o=t.length;o>r;r++){var a,s=t[r],l=s.entity,c=l._label,h=s.label,d=l.isShowing&&l.isAvailable(e)&&p.getValueOrDefault(c._show,e,!0);if(d&&(A=p.getValueOrUndefined(l._position,e,A),a=p.getValueOrUndefined(c._text,e),d=n(A)&&n(a)),d){if(!n(h)){var m=this._labelCollection;n(m)||(m=new u,this._labelCollection=m,this._scene.primitives.add(m));var f=i.length;if(f>0){var N=i.pop();s.index=N,h=m.get(N)}else h=m.add(),s.index=m.length-1;h.id=l,s.label=h}h.show=!0,h.position=A,h.text=a,h.scale=p.getValueOrDefault(c._scale,e,g),h.font=p.getValueOrDefault(c._font,e,_),h.style=p.getValueOrDefault(c._style,e,y),h.fillColor=p.getValueOrDefault(c._fillColor,e,C,P),h.outlineColor=p.getValueOrDefault(c._outlineColor,e,E,I),h.outlineWidth=p.getValueOrDefault(c._outlineWidth,e,S),h.pixelOffset=p.getValueOrDefault(c._pixelOffset,e,w,D),h.eyeOffset=p.getValueOrDefault(c._eyeOffset,e,T,M),h.horizontalOrigin=p.getValueOrDefault(c._horizontalOrigin,e,x),h.verticalOrigin=p.getValueOrDefault(c._verticalOrigin,e,b),h.translucencyByDistance=p.getValueOrUndefined(c._translucencyByDistance,e,R),h.pixelOffsetScaleByDistance=p.getValueOrUndefined(c._pixelOffsetScaleByDistance,e,O)}else v(s,i)}return!0},f.prototype.getBoundingSphere=function(e,t){var r=this._items.get(e.id);return n(r)&&n(r.label)?(t.center=i.clone(r.label.position,t.center),t.radius=0,d.DONE):d.FAILED},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._entityCollection.collectionChanged.removeEventListener(f.prototype._onCollectionChanged,this),n(this._labelCollection)&&this._scene.primitives.remove(this._labelCollection),o(this)},f.prototype._onCollectionChanged=function(e,t,i,r){var o,a,s=this._unusedIndexes,l=this._items;for(o=t.length-1;o>-1;o--)a=t[o],n(a._label)&&n(a._position)&&l.set(a.id,new m(a));for(o=r.length-1;o>-1;o--)a=r[o],n(a._label)&&n(a._position)?l.contains(a.id)||l.set(a.id,new m(a)):(v(l.get(a.id),s),l.remove(a.id));for(o=i.length-1;o>-1;o--)a=i[o],v(l.get(a.id),s),l.remove(a.id)},f}),i("ThirdParty/gltfDefaults",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/Quaternion","../Renderer/WebGLConstants"],function(e,t,i,r,n){"use strict";function o(e){i(e.accessors)||(e.accessors={});var r=e.accessors;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];o.byteStride=t(o.byteStride,0)}}function a(e){i(e.animations)||(e.animations={});var r=e.animations;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];i(o.channels)||(o.channels=[]),i(o.parameters)||(o.parameters={}),i(o.samplers)||(o.samplers={});var a=r.samplers;for(var s in a)if(a.hasOwnProperty(s)){var l=a[s];l.interpolation=t(l.interpolation,"LINEAR")}}}function s(e){i(e.asset)||(e.asset={});var r=e.asset;i(r.profile)&&"string"!=typeof r.profile||(r.profile={});var n=r.profile;r.premultipliedAlpha=t(r.premultipliedAlpha,!1),n.api=t(n.api,"WebGL"),n.version=t(n.version,"1.0.2"),i(e.version)&&(r.version=t(r.version,e.version),delete e.version),"number"==typeof r.version&&(r.version=r.version.toFixed(1).toString())}function l(e){i(e.buffers)||(e.buffers={});var r=e.buffers;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];o.type=t(o.type,"arraybuffer")}}function u(e){i(e.bufferViews)||(e.bufferViews={})}function c(e){i(e.cameras)||(e.cameras={})}function h(e){i(e.images)||(e.images={})}function d(e){i(e.extensions)||(e.extensions={});var r=e.extensions;i(r.KHR_materials_common)||(r.KHR_materials_common={});var n=r.KHR_materials_common;i(e.lights)?(n.lights=e.lights,delete e.lights):i(n.lights)||(n.lights={});var o=n.lights;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];if("ambient"===s.type){i(s.ambient)||(s.ambient={});var l=s.ambient;i(l.color)||(l.color=[1,1,1])}else if("directional"===s.type){i(s.directional)||(s.directional={});var u=s.directional;i(u.color)||(u.color=[1,1,1])}else if("point"===s.type){i(s.point)||(s.point={});var c=s.point;i(c.color)||(c.color=[1,1,1]),c.constantAttenuation=t(c.constantAttenuation,1),c.linearAttenuation=t(c.linearAttenuation,0),c.quadraticAttenuation=t(c.quadraticAttenuation,0)}else if("spot"===s.type){i(s.spot)||(s.spot={});var h=s.spot;i(h.color)||(h.color=[1,1,1]),h.constantAttenuation=t(h.constantAttenuation,1),h.fallOffAngle=t(h.fallOffAngle,3.14159265),h.fallOffExponent=t(h.fallOffExponent,0),h.linearAttenuation=t(h.linearAttenuation,0),h.quadraticAttenuation=t(h.quadraticAttenuation,0)}}}function p(e){i(e.materials)||(e.materials={});var t=e.materials;for(var r in t)if(t.hasOwnProperty(r)){var o=t[r],a=o.instanceTechnique;if(i(a)&&(o.technique=a.technique,o.values=a.values,delete o.instanceTechnique),!i(o.extensions))if(i(o.technique))i(o.values)||(o.values={});else{delete o.values,o.extensions={KHR_materials_common:{technique:"CONSTANT",transparent:!1,values:{emission:{type:n.FLOAT_VEC4,value:[.5,.5,.5,1]}}}},i(e.extensionsUsed)||(e.extensionsUsed=[]);var s=e.extensionsUsed;-1===s.indexOf("KHR_materials_common")&&s.push("KHR_materials_common")}}}function m(e){i(e.meshes)||(e.meshes={});var r=e.meshes;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];i(a.primitives)||(a.primitives=[]);for(var s=a.primitives.length,l=s.length,u=0;l>u;++u){var c=s[u];i(c.attributes)||(c.attributes={});var h=t(c.primitive,n.TRIANGLES);c.mode=t(c.mode,h)}}}function f(t){i(t.nodes)||(t.nodes={});var n=t.nodes,o=parseFloat(t.asset.version)<1,a=new e,s=new r;for(var l in n)if(n.hasOwnProperty(l)){var u=n[l];if(i(u.children)||(u.children=[]),o&&i(u.rotation)){var c=u.rotation;e.fromArray(c,0,a),r.fromAxisAngle(a,c[3],s),u.rotation=[s.x,s.y,s.z,s.w]}i(u.matrix)||(i(u.translation)||i(u.rotation)||i(u.scale)?(i(u.translation)||(u.translation=[0,0,0]),i(u.rotation)||(u.rotation=[0,0,0,1]),i(u.scale)||(u.scale=[1,1,1])):u.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);var h=u.instanceSkin;i(h)&&(u.skeletons=h.skeletons,u.skin=h.skin,u.meshes=h.meshes,delete u.instanceSkin)}}function v(e){i(e.programs)||(e.programs={});var t=e.programs;for(var r in t)if(t.hasOwnProperty(r)){var n=t[r];i(n.attributes)||(n.attributes=[])}}function g(e){i(e.samplers)||(e.samplers={});var r=e.samplers;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];a.magFilter=t(a.magFilter,n.LINEAR),a.minFilter=t(a.minFilter,n.NEAREST_MIPMAP_LINEAR),a.wrapS=t(a.wrapS,n.REPEAT),a.wrapT=t(a.wrapT,n.REPEAT)}}function _(e){i(e.scenes)||(e.scenes={});var t=e.scenes;for(var r in t)if(t.hasOwnProperty(r)){var n=t[r];i(n.node)||(n.node=[])}}function y(e){i(e.shaders)||(e.shaders={})}function C(e){i(e.skins)||(e.skins={});var t=e.skins;for(var r in t)if(t.hasOwnProperty(r)){var n=t[r];i(n.bindShapeMatrix)&&(n.bindShapeMatrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}}function E(e){i(e.enable)||(e.enable=[]),i(e.disable)||(e.disable=[])}function S(e){i(e.techniques)||(e.techniques={});var r=e.techniques;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];i(o.parameters)||(o.parameters={});var a=o.parameters;for(var s in a){var l=a[s];l.node=t(l.node,l.source),l.source=void 0}var u=o.passes;if(i(u)){var c=t(o.pass,"defaultPass");if(u.hasOwnProperty(c)){var h=u[c],d=h.instanceProgram;o.attributes=t(o.attributes,d.attributes),o.program=t(o.program,d.program),o.uniforms=t(o.uniforms,d.uniforms),o.states=t(o.states,h.states)}o.passes=void 0,o.pass=void 0}i(o.attributes)||(o.attributes={}),i(o.uniforms)||(o.uniforms={}),i(o.states)||(o.states={}),E(o.states)}}function w(e){i(e.textures)||(e.textures={});var r=e.textures;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];a.format=t(a.format,n.RGBA),a.internalFormat=t(a.internalFormat,a.format),a.target=t(a.target,n.TEXTURE_2D),a.type=t(a.type,n.UNSIGNED_BYTE)}}var T=function(e){return i(e)?(i(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,e.allExtensions=void 0),e.extensionsUsed=t(e.extensionsUsed,[]),o(e),a(e),s(e),l(e),u(e),c(e),h(e),d(e),p(e),m(e),f(e),v(e),g(e),_(e),y(e),C(e),S(e),w(e),e):void 0};return T}),i("Scene/getModelAccessor",["../Core/ComponentDatatype"],function(e){"use strict";function t(t){var r=t.componentType,n=i[t.type];return{componentsPerAttribute:n,createArrayBufferView:function(t,i,o){return e.createArrayBufferView(r,t,i,n*o)}}}var i={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16};return t}),i("Scene/ModelAnimationCache",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/LinearSpline","../Core/Matrix4","../Core/Quaternion","../Core/QuaternionSpline","../Renderer/WebGLConstants","./getModelAccessor"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(){}function c(e,i){var r=e.gltf,n=r.buffers,o=r.bufferViews,a=o[i.bufferView],s=n[a.buffer],u=a.byteOffset+i.byteOffset,c=i.count*l(i).componentsPerAttribute;return e.cacheKey+"//"+t(s.path,"")+"/"+u+"/"+c}function h(e,t,i){return e.cacheKey+"//"+t+"/"+i}function d(e){this._value=e}var p={},m=new e;u.getAnimationParameterValues=function(t,r){var n=c(t,r),a=p[n];if(!i(a)){var u,h=t._loadResources,d=t.gltf,f=parseFloat(d.asset.version)<1,v=d.bufferViews,g=v[r.bufferView],_=r.componentType,y=r.type,C=r.count,E=h.getBuffer(g),S=l(r).createArrayBufferView(E.buffer,E.byteOffset+r.byteOffset,C);if(_===s.FLOAT&&"SCALAR"===y)a=S;else if(_===s.FLOAT&&"VEC3"===y)for(a=new Array(C),u=0;C>u;++u)a[u]=e.fromArray(S,3*u);else if(_===s.FLOAT&&"VEC4"===y)for(a=new Array(C),u=0;C>u;++u){var w=4*u;f?a[u]=o.fromAxisAngle(e.fromArray(S,w,m),S[w+3]):a[u]=o.unpack(S,w)}i(t.cacheKey)&&(p[n]=a)}return a};var f={};d.prototype.evaluate=function(e,t){return this._value},u.getAnimationSpline=function(e,t,n,o,l,u){var c=h(e,t,o),p=f[c];if(!i(p)){var m=u[l.input],v=e.gltf.accessors[n.parameters[l.output]],g=u[l.output];if(1===m.length&&1===g.length)p=new d(g[0]);else{var _=v.componentType,y=v.type;"LINEAR"===l.interpolation&&(_===s.FLOAT&&"VEC3"===y?p=new r({times:m,points:g}):_===s.FLOAT&&"VEC4"===y&&(p=new a({times:m,points:g})))}i(e.cacheKey)&&(f[c]=p)}return p};var v={};return u.getSkinInverseBindMatrices=function(e,t){var r=c(e,t),o=v[r];if(!i(o)){var a=e._loadResources,u=e.gltf,h=u.bufferViews,d=h[t.bufferView],p=t.componentType,m=t.type,f=t.count,g=a.getBuffer(d),_=l(t).createArrayBufferView(g.buffer,g.byteOffset+t.byteOffset,f);if(o=new Array(f),p===s.FLOAT&&"MAT4"===m)for(var y=0;f>y;++y)o[y]=n.fromArray(_,16*y);v[r]=o}return o},u}),i("Scene/ModelAnimationLoop",["../Core/freezeObject"],function(e){"use strict";var t={NONE:0,REPEAT:1,MIRRORED_REPEAT:2};return e(t)}),i("Scene/ModelAnimationState",["../Core/freezeObject"],function(e){"use strict";return e({STOPPED:0,ANIMATING:1})}),i("Scene/ModelAnimation",["../Core/defaultValue","../Core/defineProperties","../Core/Event","../Core/JulianDate","./ModelAnimationLoop","./ModelAnimationState"],function(e,t,i,r,n,o){"use strict";function a(t,a,s){this._name=t.name,this._startTime=r.clone(t.startTime),this._delay=e(t.delay,0),this._stopTime=t.stopTime,this.removeOnStop=e(t.removeOnStop,!1),this._speedup=e(t.speedup,1),this._reverse=e(t.reverse,!1),this._loop=e(t.loop,n.NONE),this.start=new i,this.update=new i,this.stop=new i,this._state=o.STOPPED,this._runtimeAnimation=s,this._computedStartTime=void 0,this._duration=void 0;var l=this;this._raiseStartEvent=function(){l.start.raiseEvent(a,l)},this._updateEventTime=0,this._raiseUpdateEvent=function(){l.update.raiseEvent(a,l,l._updateEventTime)},this._raiseStopEvent=function(){l.stop.raiseEvent(a,l)}}return t(a.prototype,{name:{get:function(){return this._name}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},speedup:{get:function(){return this._speedup}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}}}),a}),i("Scene/ModelAnimationCollection",["../Core/clone","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","../Core/Math","./ModelAnimation","./ModelAnimationLoop","./ModelAnimationState"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e){this.animationAdded=new o,this.animationRemoved=new o,this._model=e,this._scheduledAnimations=[],this._previousTime=void 0}function d(e,t){for(var i=e.channelEvaluators,r=i.length,n=0;r>n;++n)i[n](t)}function p(e,t,i){return function(){e.animationRemoved.raiseEvent(t,i)}}r(h.prototype,{length:{get:function(){return this._scheduledAnimations.length}}}),h.prototype.add=function(e){e=t(e,t.EMPTY_OBJECT);var i=this._model,r=i._runtime.animations,n=r[e.name],o=new l(e,i,n);return this._scheduledAnimations.push(o),this.animationAdded.raiseEvent(i,o),o},h.prototype.addAll=function(i){i=t(i,t.EMPTY_OBJECT),i=e(i);for(var r=[],n=this._model._animationIds,o=n.length,a=0;o>a;++a)i.name=n[a],r.push(this.add(i));return r},h.prototype.remove=function(e){if(i(e)){var t=this._scheduledAnimations,r=t.indexOf(e);if(-1!==r)return t.splice(r,1),this.animationRemoved.raiseEvent(this._model,e),!0}return!1},h.prototype.removeAll=function(){var e=this._model,t=this._scheduledAnimations,i=t.length;this._scheduledAnimations=[];for(var r=0;i>r;++r)this.animationRemoved.raiseEvent(e,t[r])},h.prototype.contains=function(e){return i(e)?-1!==this._scheduledAnimations.indexOf(e):!1},h.prototype.get=function(e){return this._scheduledAnimations[e]};var m=[];return h.prototype.update=function(e){var r=this._scheduledAnimations,n=r.length;if(0===n)return this._previousTime=void 0,!1;if(a.equals(e.time,this._previousTime))return!1;this._previousTime=a.clone(e.time,this._previousTime);for(var o=!1,l=e.time,h=this._model,f=0;n>f;++f){var v=r[f],g=v._runtimeAnimation;i(v._computedStartTime)||(v._computedStartTime=a.addSeconds(t(v.startTime,l),v.delay,new a)),i(v._duration)||(v._duration=g.stopTime*(1/v.speedup));var _=v._computedStartTime,y=v._duration,C=v.stopTime,E=0!==y?a.secondsDifference(l,_)/y:0,S=E>=0,w=S&&(1>=E||v.loop===u.REPEAT||v.loop===u.MIRRORED_REPEAT)&&(!i(C)||a.lessThanOrEquals(l,C));if(w){if(v._state===c.STOPPED&&(v._state=c.ANIMATING,v.start.numberOfListeners>0&&e.afterRender.push(v._raiseStartEvent)),v.loop===u.REPEAT)E-=Math.floor(E);else if(v.loop===u.MIRRORED_REPEAT){var T=Math.floor(E),x=E-T;E=T%2===1?1-x:x}v.reverse&&(E=1-E);var b=E*y*v.speedup;b=s.clamp(b,g.startTime,g.stopTime),d(g,b),v.update.numberOfListeners>0&&(v._updateEventTime=b,e.afterRender.push(v._raiseUpdateEvent)),o=!0}else S&&v._state===c.ANIMATING&&(v._state=c.STOPPED,v.stop.numberOfListeners>0&&e.afterRender.push(v._raiseStopEvent),v.removeOnStop&&m.push(v))}n=m.length;for(var A=0;n>A;++A){var P=m[A];r.splice(r.indexOf(P),1),e.afterRender.push(p(this,h,P))}return m.length=0,o},h}),i("Scene/ModelMaterial",["../Core/defined","../Core/defineProperties","../Core/DeveloperError"],function(e,t,i){"use strict";function r(e,t,i){this._name=t.name,this._id=i,this._uniformMap=e._uniformMaps[i]}return t(r.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}}}),r.prototype.setValue=function(e,t){var i=this._uniformMap.values[e];i.value=i.clone(t,i.value)},r.prototype.getValue=function(t){var i=this._uniformMap.values[t];if(e(i))return i.value},r}),i("Scene/modelMaterialsCommon",["../Core/defaultValue","../Core/defined","../Renderer/WebGLConstants"],function(e,t,i){"use strict";function r(e){switch(e){case i.FLOAT:return"float";case i.FLOAT_VEC2:return"vec2";case i.FLOAT_VEC3:return"vec3";case i.FLOAT_VEC4:return"vec4";case i.FLOAT_MAT2:return"mat2";case i.FLOAT_MAT3:return"mat3";case i.FLOAT_MAT4:return"mat4";case i.SAMPLER_2D:return"sampler2D"}}function n(e){var r,n={};if(t(e.extensions)&&t(e.extensions.KHR_materials_common)&&(r=e.extensions.KHR_materials_common.lights),t(r)){var o=e.nodes;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];if(t(s.extensions)&&t(s.extensions.KHR_materials_common)){var l=s.extensions.KHR_materials_common.light;t(l)&&t(r[l])&&(r[l].node=a),delete s.extensions.KHR_materials_common}}var u=0;for(var c in r)if(r.hasOwnProperty(c)){var h=r[c],d=h.type;if("ambient"!==d&&!t(h.node)){delete r[c];continue}var p="light"+u.toString();switch(h.baseName=p,d){case"ambient":var m=h.ambient;n[p+"Color"]={type:i.FLOAT_VEC3,value:m.color};break;case"directional":var f=h.directional;n[p+"Color"]={type:i.FLOAT_VEC3,value:f.color},t(h.node)&&(n[p+"Transform"]={node:h.node,semantic:"MODELVIEW",type:i.FLOAT_MAT4});break;case"point":var v=h.point;n[p+"Color"]={type:i.FLOAT_VEC3,value:v.color},t(h.node)&&(n[p+"Transform"]={node:h.node,semantic:"MODELVIEW",type:i.FLOAT_MAT4}),n[p+"Attenuation"]={type:i.FLOAT_VEC3,value:[v.constantAttenuation,v.linearAttenuation,v.quadraticAttenuation]};break;case"spot":var g=h.spot;n[p+"Color"]={type:i.FLOAT_VEC3,value:g.color},t(h.node)&&(n[p+"Transform"]={node:h.node,semantic:"MODELVIEW",type:i.FLOAT_MAT4},n[p+"InverseTransform"]={node:h.node,semantic:"MODELVIEWINVERSE",type:i.FLOAT_MAT4,useInFragment:!0}),n[p+"Attenuation"]={type:i.FLOAT_VEC3,value:[g.constantAttenuation,g.linearAttenuation,g.quadraticAttenuation]},n[p+"FallOff"]={type:i.FLOAT_VEC2,value:[g.fallOffAngle,g.fallOffExponent]}}++u}}return n}function o(i,r,n){var o,a=e(n,0);do o=r+(a++).toString();while(t(i[o]));return o}function a(n,a,l){var u,m=n.techniques,f=n.shaders,v=n.programs,g=a.technique.toUpperCase();t(n.extensions)&&t(n.extensions.KHR_materials_common)&&(u=n.extensions.KHR_materials_common.lights);var _=e(a.jointCount,0),y=_>0,C=a.values,E="precision highp float;\n",S="precision highp float;\n",w=o(m,"technique",c),T=o(f,"vertexShader",h),x=o(f,"fragmentShader",d),b=o(v,"program",p),A="CONSTANT"!==g,P={modelViewMatrix:{semantic:"MODELVIEW",type:i.FLOAT_MAT4},projectionMatrix:{semantic:"PROJECTION",type:i.FLOAT_MAT4}};A&&(P.normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:i.FLOAT_MAT3}),y&&(P.jointMatrix={count:_,semantic:"JOINTMATRIX",type:i.FLOAT_MAT4});var I,M=!1;for(var D in C)if(C.hasOwnProperty(D)&&"transparent"!==D&&"doubleSided"!==D){ -var R=s(D,C[D]);I=D.toLowerCase(),M||R!==i.SAMPLER_2D||(M=!0),P[I]={type:R}}if(t(l))for(var O in l)l.hasOwnProperty(O)&&(P[O]=l[O]);var N={};for(var L in P)if(P.hasOwnProperty(L)){var F=P[L];N["u_"+L]=L;var B=t(F.count)?"["+F.count+"]":"";F.type!==i.FLOAT_MAT3&&F.type!==i.FLOAT_MAT4||F.useInFragment?(S+="uniform "+r(F.type)+" u_"+L+B+";\n",delete F.useInFragment):E+="uniform "+r(F.type)+" u_"+L+B+";\n"}var V="";y&&(V+=" mat4 skinMat = a_weight.x * u_jointMatrix[int(a_joint.x)];\n",V+=" skinMat += a_weight.y * u_jointMatrix[int(a_joint.y)];\n",V+=" skinMat += a_weight.z * u_jointMatrix[int(a_joint.z)];\n",V+=" skinMat += a_weight.w * u_jointMatrix[int(a_joint.w)];\n");var k={a_position:"position"};P.position={semantic:"POSITION",type:i.FLOAT_VEC3},E+="attribute vec3 a_position;\n",E+="varying vec3 v_positionEC;\n",V+=y?" vec4 pos = u_modelViewMatrix * skinMat * vec4(a_position,1.0);\n":" vec4 pos = u_modelViewMatrix * vec4(a_position,1.0);\n",V+=" v_positionEC = pos.xyz;\n",V+=" gl_Position = u_projectionMatrix * pos;\n",S+="varying vec3 v_positionEC;\n",A&&(k.a_normal="normal",P.normal={semantic:"NORMAL",type:i.FLOAT_VEC3},E+="attribute vec3 a_normal;\n",E+="varying vec3 v_normal;\n",V+=y?" v_normal = u_normalMatrix * mat3(skinMat) * a_normal;\n":" v_normal = u_normalMatrix * a_normal;\n",S+="varying vec3 v_normal;\n");var z;M&&(k.a_texcoord_0="texcoord_0",P.texcoord_0={semantic:"TEXCOORD_0",type:i.FLOAT_VEC2},z="v_texcoord_0",E+="attribute vec2 a_texcoord_0;\n",E+="varying vec2 "+z+";\n",V+=" "+z+" = a_texcoord_0;\n",S+="varying vec2 "+z+";\n"),y&&(k.a_joint="joint",P.joint={semantic:"JOINT",type:i.FLOAT_VEC4},k.a_weight="weight",P.weight={semantic:"WEIGHT",type:i.FLOAT_VEC4},E+="attribute vec4 a_joint;\n",E+="attribute vec4 a_weight;\n");var U=A&&("BLINN"===g||"PHONG"===g)&&t(P.specular)&&t(P.shininess),G=!1,W=!1,H="";for(var q in u)if(u.hasOwnProperty(q)){var j=u[q],Y=j.type.toLowerCase(),X=j.baseName;H+=" {\n";var Z,K,Q="u_"+X+"Color";"ambient"===Y?(W=!0,H+=" ambientLight += "+Q+";\n"):A&&(G=!0,Z="v_"+X+"Direction",K="v_"+X+"Position","point"!==Y&&(E+="varying vec3 "+Z+";\n",S+="varying vec3 "+Z+";\n",V+=" "+Z+" = mat3(u_"+X+"Transform) * vec3(0.,0.,1.);\n","directional"===Y&&(H+=" vec3 l = normalize("+Z+");\n")),"directional"!==Y?(E+="varying vec3 "+K+";\n",S+="varying vec3 "+K+";\n",V+=" "+K+" = u_"+X+"Transform[3].xyz;\n",H+=" vec3 VP = "+K+" - v_positionEC;\n",H+=" vec3 l = normalize(VP);\n",H+=" float range = length(VP);\n",H+=" float attenuation = 1.0 / (u_"+X+"Attenuation.x + ",H+="(u_"+X+"Attenuation.y * range) + ",H+="(u_"+X+"Attenuation.z * range * range));\n"):H+=" float attenuation = 1.0;\n","spot"===Y&&(H+=" float spotDot = dot(l, normalize("+Z+"));\n",H+=" if (spotDot < cos(u_"+X+"FallOff.x * 0.5))\n",H+=" {\n",H+=" attenuation = 0.0;\n",H+=" }\n",H+=" else\n",H+=" {\n",H+=" attenuation *= max(0.0, pow(spotDot, u_"+X+"FallOff.y));\n",H+=" }\n"),H+=" diffuseLight += "+Q+"* max(dot(normal,l), 0.) * attenuation;\n",U&&("BLINN"===g?(H+=" vec3 h = normalize(l + viewDir);\n",H+=" float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess)) * attenuation;\n"):(H+=" vec3 reflectDir = reflect(-l, normal);\n",H+=" float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess)) * attenuation;\n"),H+=" specularLight += "+Q+" * specularIntensity;\n")),H+=" }\n"}W||(H+=" ambientLight += vec3(0.2, 0.2, 0.2);\n"),G||"CONSTANT"===g||(H+=" vec3 l = normalize(czm_sunDirectionEC);\n",H+=" diffuseLight += vec3(1.0, 1.0, 1.0) * max(dot(normal,l), 0.);\n",U&&("BLINN"===g?(H+=" vec3 h = normalize(l + viewDir);\n",H+=" float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess));\n"):(H+=" vec3 reflectDir = reflect(-l, normal);\n",H+=" float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess));\n"),H+=" specularLight += vec3(1.0, 1.0, 1.0) * specularIntensity;\n")),E+="void main(void) {\n",E+=V,E+="}\n",S+="void main(void) {\n";var J=" vec3 color = vec3(0.0, 0.0, 0.0);\n";A&&(S+=" vec3 normal = normalize(v_normal);\n",a.doubleSided&&(S+=" if (gl_FrontFacing == false)\n",S+=" {\n",S+=" normal = -normal;\n",S+=" }\n"));var $;"CONSTANT"!==g?(t(P.diffuse)&&(S+=P.diffuse.type===i.SAMPLER_2D?" vec4 diffuse = texture2D(u_diffuse, "+z+");\n":" vec4 diffuse = u_diffuse;\n",S+=" vec3 diffuseLight = vec3(0.0, 0.0, 0.0);\n",J+=" color += diffuse.rgb * diffuseLight;\n"),U&&(S+=P.specular.type===i.SAMPLER_2D?" vec3 specular = texture2D(u_specular, "+z+").rgb;\n":" vec3 specular = u_specular.rgb;\n",S+=" vec3 specularLight = vec3(0.0, 0.0, 0.0);\n",J+=" color += specular * specularLight;\n"),$=t(P.transparency)?" gl_FragColor = vec4(color * diffuse.a, diffuse.a * u_transparency);\n":" gl_FragColor = vec4(color * diffuse.a, diffuse.a);\n"):$=t(P.transparency)?" gl_FragColor = vec4(color, u_transparency);\n":" gl_FragColor = vec4(color, 1.0);\n",t(P.emission)&&(S+=P.emission.type===i.SAMPLER_2D?" vec3 emission = texture2D(u_emission, "+z+").rgb;\n":" vec3 emission = u_emission.rgb;\n",J+=" color += emission;\n"),(t(P.ambient)||"CONSTANT"!==g)&&(S+=t(P.ambient)?P.ambient.type===i.SAMPLER_2D?" vec3 ambient = texture2D(u_ambient, "+z+").rgb;\n":" vec3 ambient = u_ambient.rgb;\n":" vec3 ambient = diffuse.rgb;\n",J+=" color += ambient * ambientLight;\n"),S+=" vec3 viewDir = -normalize(v_positionEC);\n",S+=" vec3 ambientLight = vec3(0.0, 0.0, 0.0);\n",S+=H,S+=J,S+=$,S+="}\n";var ee;ee=a.transparent?{enable:[i.DEPTH_TEST,i.BLEND],depthMask:!1,functions:{blendEquationSeparate:[i.FUNC_ADD,i.FUNC_ADD],blendFuncSeparate:[i.ONE,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA]}}:a.doubleSided?{enable:[i.DEPTH_TEST]}:{enable:[i.CULL_FACE,i.DEPTH_TEST]},m[w]={attributes:k,parameters:P,program:b,states:ee,uniforms:N},f[T]={type:i.VERTEX_SHADER,uri:"",extras:{source:E}},f[x]={type:i.FRAGMENT_SHADER,uri:"",extras:{source:S}};var te=Object.keys(k);return v[b]={attributes:te,fragmentShader:x,vertexShader:T},w}function s(e,r){var n;switch(n=t(r.value)?r.value:r,e){case"ambient":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"diffuse":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"emission":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"specular":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"shininess":return i.FLOAT;case"transparency":return i.FLOAT;case"transparent":return i.BOOL;case"doubleSided":return i.BOOL}}function l(t){var i="";i+="technique:"+t.technique+";";for(var r=t.values,n=Object.keys(r).sort(),o=n.length,a=0;o>a;++a){var l=n[a];r.hasOwnProperty(l)&&"transparent"!==l&&"doubleSided"!==l&&(i+=l+":"+s(l,r[l]),i+=";")}var u=e(t.doubleSided,!1);i+=u.toString()+";";var c=e(t.transparent,!1);i+=c.toString()+";";var h=e(t.jointCount,0);return i+=h.toString()+";"}function u(e){if(t(e)){var i=!1,r=e.extensionsUsed;if(t(r))for(var o=r.length,s=0;o>s;++s)if("KHR_materials_common"===r[s]){i=!0,r.splice(s,1);break}if(i){t(e.programs)||(e.programs={}),t(e.shaders)||(e.shaders={}),t(e.techniques)||(e.techniques={});var u=n(e),c={},h=e.materials;for(var d in h)if(h.hasOwnProperty(d)){var p=h[d];if(t(p.extensions)&&t(p.extensions.KHR_materials_common)){var m=p.extensions.KHR_materials_common,f=l(m),v=c[f];t(v)||(v=a(e,m,u),c[f]=v),p.values={};var g=m.values;for(var _ in g)if(g.hasOwnProperty(_)){var y=g[_];t(y.value)?p.values[_]=y.value:p.values[_]=y}p.technique=v,delete p.extensions.KHR_materials_common}}t(e.extensions)&&delete e.extensions.KHR_materials_common}return e}}var c=0,h=0,d=0,p=0;return u}),i("Scene/ModelMesh",["../Core/defineProperties"],function(e){"use strict";function t(e,t,i){for(var r=[],n=e.primitives,o=n.length,a=0;o>a;++a){var s=n[a];r[a]=t[s.material]}this._name=e.name,this._materials=r,this._id=i}return e(t.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},materials:{get:function(){return this._materials}}}),t}),i("Scene/ModelNode",["../Core/defaultValue","../Core/defineProperties","../Core/Matrix4"],function(e,t,i){"use strict";function r(e,t,r,n,o){this._model=e,this._runtimeNode=r,this._name=t.name,this._id=n,this.useMatrix=!1,this._show=!0,this._matrix=i.clone(o)}return t(r.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,this._model._perNodeShowDirty=!0)}},matrix:{get:function(){return this._matrix},set:function(e){this._matrix=i.clone(e,this._matrix),this.useMatrix=!0;var t=this._model;t._cesiumAnimationsDirty=!0,this._runtimeNode.dirtyNumber=t._maxDirtyNumber}}}),r.prototype.setMatrix=function(e){i.clone(e,this._matrix)},r}),i("Scene/Model",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/clone","../Core/combine","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/getAbsoluteUri","../Core/getBaseUri","../Core/getMagic","../Core/getStringFromTypedArray","../Core/IndexDatatype","../Core/loadArrayBuffer","../Core/loadImage","../Core/loadImageFromTypedArray","../Core/loadText","../Core/Math","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/PrimitiveType","../Core/Quaternion","../Core/Queue","../Core/RuntimeError","../Core/throttleRequestByServer","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/Sampler","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Renderer/VertexArray","../Renderer/WebGLConstants","../ThirdParty/gltfDefaults","../ThirdParty/Uri","../ThirdParty/when","./getModelAccessor","./ModelAnimationCache","./ModelAnimationCollection","./ModelMaterial","./modelMaterialsCommon","./ModelMesh","./ModelNode","./Pass","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O,N,L,F,B,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee){"use strict";function te(){this.buffersToCreate=new P,this.buffers={},this.pendingBufferLoads=0,this.programsToCreate=new P,this.shaders={},this.pendingShaderLoads=0,this.texturesToCreate=new P,this.pendingTextureLoads=0,this.texturesToCreateFromBufferView=new P,this.pendingBufferViewToImage=0,this.createSamplers=!0,this.createSkins=!0,this.createRuntimeAnimations=!0,this.createVertexArrays=!0,this.createRenderStates=!0,this.createUniformMaps=!0,this.createRuntimeNodes=!0,this.createElementBuffers=!0,this.skinnedNodesIds=[]}function ie(e,t){e._cachedGltf=t,e._animationIds=ne(t)}function re(e){this._gltf=K(W(e.gltf)),this._bgltf=e.bgltf,this.ready=e.ready,this.modelsToLoad=[],this.count=0}function ne(e){var t=[];if(l(e)&&l(e.gltf)){var i=e.gltf.animations;for(var r in i)i.hasOwnProperty(r)&&t.push(r)}return t}function oe(t){t=s(t,s.EMPTY_OBJECT);var i=t.cacheKey;this._cacheKey=i,this._cachedGltf=void 0,this._releaseGltfJson=s(t.releaseGltfJson,!1),this._animationIds=void 0;var r;if(l(i)&&l(It[i])&&It[i].ready)r=It[i],++r.count;else{var n=t.gltf;if(l(n)){if(n instanceof ArrayBuffer&&(n=new Uint8Array(n)),n instanceof Uint8Array){var o=le(n);0!==o.binaryOffset&&(n=n.subarray(o.binaryOffset)),r=new re({gltf:o.glTF,bgltf:n,ready:!0})}else r=new re({gltf:t.gltf,ready:!0});r.count=1,l(i)&&(It[i]=r)}}ie(this,r),this._shaderOverride=t.shaderOverride,this._basePath=s(t.basePath,"");var a=new H(document.location.href),u=new H(this._basePath);this._baseUri=u.resolve(a),this.show=s(t.show,!0),this.modelMatrix=x.clone(s(t.modelMatrix,x.IDENTITY)),this._modelMatrix=x.clone(this.modelMatrix),this.scale=s(t.scale,1),this._scale=this.scale,this.minimumPixelSize=s(t.minimumPixelSize,0),this._minimumPixelSize=this.minimumPixelSize,this.maximumScale=t.maximumScale,this._maximumScale=this.maximumScale,this.id=t.id,this._id=t.id,this.pickPrimitive=t.pickPrimitive,this._allowPicking=s(t.allowPicking,!0),this._ready=!1,this._readyPromise=q.defer(),this.activeAnimations=new X(this),this._defaultTexture=void 0,this._incrementallyLoadTextures=s(t.incrementallyLoadTextures,!0),this._asynchronous=s(t.asynchronous,!0),this.debugShowBoundingVolume=s(t.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=s(t.debugWireframe,!1),this._debugWireframe=!1,this._precreatedAttributes=t.precreatedAttributes,this._vertexShaderLoaded=t.vertexShaderLoaded,this._fragmentShaderLoaded=t.fragmentShaderLoaded,this._uniformMapLoaded=t.uniformMapLoaded,this._pickVertexShaderLoaded=t.pickVertexShaderLoaded,this._pickFragmentShaderLoaded=t.pickFragmentShaderLoaded,this._pickUniformMapLoaded=t.pickUniformMapLoaded,this._ignoreCommands=s(t.ignoreCommands,!1),this.cull=s(t.cull,!0),this._computedModelMatrix=new x,this._initialRadius=void 0,this._boundingSphere=void 0,this._scaledBoundingSphere=new e,this._state=xt.NEEDS_LOAD,this._loadResources=void 0,this._perNodeShowDirty=!1,this._cesiumAnimationsDirty=!1,this._dirty=!1,this._maxDirtyNumber=0,this._runtime={animations:void 0,rootNodes:void 0,nodes:void 0,nodesByName:void 0,skinnedNodes:void 0,meshesByName:void 0,materialsByName:void 0,materialsById:void 0},this._uniformMaps={},this._rendererResources={buffers:{},vertexArrays:{},programs:{},pickPrograms:{},textures:{},samplers:{},renderStates:{}},this._cachedRendererResources=void 0,this._loadRendererResourcesFromCache=!1,this._nodeCommands=[],this._pickIds=[],this._rtcCenter=void 0,this._rtcCenterEye=void 0,this._loadOptions=t.loadOptions}function ae(e,t,i){return e.subarray(t,t+i)}function se(e){var t=f(e);return"glTF"===t}function le(e){if(!se(e))throw new h("bgltf is not a valid Binary glTF file.");var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=0;i+=Mt,i+=Mt,i+=Mt;var r=t.getUint32(i,!0);i+=Mt+Mt;var n=i,o=n+r,a=v(e,n,r);return{glTF:JSON.parse(a),binaryOffset:o}}function ue(e,t,i){return e._runtime[t][i]}function ce(t){for(var r=t.nodes,n=t.meshes,o=t.accessors,a=t.scenes[t.scene].nodes,s=a.length,u=[],c=new i(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),h=new i(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),d=0;s>d;++d){var p=r[a[d]];for(p._transformToRoot=Ce(p),u.push(p);u.length>0;){p=u.pop();var m=p._transformToRoot,f=p.meshes;if(l(f))for(var v=f.length,g=0;v>g;++g)for(var _=n[f[g]].primitives,y=_.length,C=0;y>C;++C){var E=_[C].attributes.POSITION;if(l(E)){var S=o[E],w=i.fromArray(S.min,0,Dt),T=i.fromArray(S.max,0,Rt);l(c)&&l(h)&&(x.multiplyByPoint(m,w,w),x.multiplyByPoint(m,T,T),i.minimumByComponent(c,w,c),i.maximumByComponent(h,T,h))}}for(var b=p.children,A=b.length,P=0;A>P;++P){var I=r[b[P]];I._transformToRoot=Ce(I),x.multiplyTransformation(m,I._transformToRoot,I._transformToRoot),u.push(I)}delete p._transformToRoot}}var M=e.fromCornerPoints(c,h);return e.transformWithoutScale(M,wt,M)}function he(e,t,i){return function(){e._state=xt.FAILED,e._readyPromise.reject(new I("Failed to load "+t+": "+i))}}function de(e,t){return function(i){var r=e._loadResources;r.buffers[t]=new Uint8Array(i),--r.pendingBufferLoads}}function pe(e){var t=e.gltf.buffers;for(var i in t)if(t.hasOwnProperty(i)){var r=t[i];if("binary_glTF"===i||"KHR_binary_glTF"===i){var n=e._loadResources;n.buffers[i]=e._cachedGltf.bgltf}else if("arraybuffer"===r.type){++e._loadResources.pendingBufferLoads;var o=new H(r.uri),a=o.resolve(e._baseUri).toString();_(a).then(de(e,i)).otherwise(he(e,"buffer",a))}}}function me(e){var t=e.gltf.bufferViews;for(var i in t)t.hasOwnProperty(i)&&t[i].target===G.ARRAY_BUFFER&&e._loadResources.buffersToCreate.enqueue(i)}function fe(e,t){return function(i){var r=e._loadResources;r.shaders[t]={source:i,bufferView:void 0},--r.pendingShaderLoads}}function ve(e){var t=e.gltf.shaders;if(!l(e._shaderParser)||!e._shaderParser(t))for(var i in t)if(t.hasOwnProperty(i)){var r=t[i];if(l(r.extras)&&l(r.extras.source))e._loadResources.shaders[i]={source:r.extras.source,bufferView:void 0};else if(l(r.extensions)&&l(r.extensions.KHR_binary_glTF)){var n=r.extensions.KHR_binary_glTF;e._loadResources.shaders[i]={source:void 0,bufferView:n.bufferView}}else{var o;if(e._shaderOverride&&(o=e._shaderOverride(r,i,e.gltf)))++e._loadResources.pendingShaderLoads,fe(e,i)(o);else{++e._loadResources.pendingShaderLoads;var a=new H(r.uri),s=a.resolve(e._baseUri).toString();E(s,e._loadOptions).then(fe(e,i)).otherwise(he(e,"shader",s))}}}}function ge(e){var t=e.gltf.programs;for(var i in t)t.hasOwnProperty(i)&&e._loadResources.programsToCreate.enqueue(i)}function _e(e,t){return function(i){var r=e._loadResources;--r.pendingTextureLoads,r.texturesToCreate.enqueue({id:t,image:i,bufferView:void 0})}}function ye(e){var t=e.gltf.images,i=e.gltf.textures;for(var r in i)if(i.hasOwnProperty(r)){var n=t[i[r].source];if(l(n.extensions)&&l(n.extensions.KHR_binary_glTF)){var o=n.extensions.KHR_binary_glTF;e._loadResources.texturesToCreateFromBufferView.enqueue({id:r,image:void 0,bufferView:o.bufferView,mimeType:o.mimeType})}else{var a=new H(n.uri),s=a.resolve(e._baseUri).toString(),u=At.textures.get(s);if(u)u.ref(),e._rendererResources.textures[r]=u;else{var c=At.images.get(s);++e._loadResources.pendingTextureLoads,l(c)?(c.ref(),c.then(function(e,t){_e(this,e)(t),c=void 0}.bind(e,r))):c=At.images.set(s,y(s).then(function(e,t){return _e(this,e)(t),c=void 0,t}.bind(e,r)).otherwise(he(e,"image",s)))}}}}function Ce(e){return l(e.matrix)?x.fromArray(e.matrix):x.fromTranslationQuaternionRotationScale(i.fromArray(e.translation,0,Ot),A.unpack(e.rotation,0,Nt),i.fromArray(e.scale,0,Lt))}function Ee(e){var t={},i={},r=[],n=e._loadResources.skinnedNodesIds,o=e.gltf.nodes;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a],u={matrix:void 0,translation:void 0,rotation:void 0,scale:void 0,computedShow:!0,transformToRoot:new x,computedMatrix:new x,dirtyNumber:0,commands:[],inverseBindMatrices:void 0,bindShapeMatrix:void 0,joints:[],computedJointMatrices:[],jointName:s.jointName,children:[],parents:[],publicNode:void 0};u.publicNode=new J(e,s,u,a,Ce(s)),t[a]=u,i[s.name]=u,l(s.skin)&&(n.push(a),r.push(u))}e._runtime.nodes=t,e._runtime.nodesByName=i,e._runtime.skinnedNodes=r}function Se(e){var t={},i={},r=e.gltf.materials,n=e._uniformMaps;for(var o in r)if(r.hasOwnProperty(o)){n[o]={uniformMap:void 0,values:void 0,jointMatrixUniformName:void 0};var a=r[o],s=new Z(e,a,o);t[a.name]=s,i[o]=s}e._runtime.materialsByName=t,e._runtime.materialsById=i}function we(e){var t={},i=e._runtime.materialsById,r=e.gltf.meshes;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];t[o.name]=new Q(o,i,n)}e._runtime.meshesByName=t}function Te(e){e._loadRendererResourcesFromCache||(pe(e),me(e),ve(e),ge(e),ye(e)),Se(e),we(e),Ee(e)}function xe(e,t){var i=e._loadResources;if(0===i.pendingBufferLoads){for(var r,n=e.gltf.bufferViews,o=e._rendererResources.buffers;i.buffersToCreate.length>0;){var a=i.buffersToCreate.dequeue();r=n[a];var s=D.createVertexBuffer({context:t,typedArray:i.getBuffer(r),usage:R.STATIC_DRAW});s.vertexArrayDestroyable=!1,o[a]=s}if(i.createElementBuffers){var u=e.gltf.accessors;for(var c in u)if(u.hasOwnProperty(c)){var h=u[c];if(r=n[h.bufferView],r.target===G.ELEMENT_ARRAY_BUFFER&&!l(o[h.bufferView])){var d=D.createIndexBuffer({context:t,typedArray:i.getBuffer(r),usage:R.STATIC_DRAW,indexDatatype:h.componentType});d.vertexArrayDestroyable=!1,o[h.bufferView]=d}}i.createElementBuffers=!1}}}function be(e){for(var t={},i=e.length,r=0;i>r;++r)t[e[r]]=r;return t}function Ae(e,t){if(l(t.source))return t.source;var i=e._loadResources,r=e.gltf,n=r.bufferViews[t.bufferView];return v(i.getBuffer(n))}function Pe(e,t,i){return l(i)&&(e=i(e,t)),e}function Ie(e,t,i){var r=t.gltf.programs,n=t._loadResources.shaders,o=r[e],a=be(o.attributes),s=Ae(t,n[o.vertexShader]),u=Ae(t,n[o.fragmentShader]),c=Pe(s,e,t._vertexShaderLoaded),h=Pe(u,e,t._fragmentShaderLoaded),d=o.attributes.length,p=t._precreatedAttributes;if(l(p))for(var m in p)p.hasOwnProperty(m)&&(a[m]=d++);if(t._rendererResources.programs[e]=F.fromCache({context:i,vertexShaderSource:c,fragmentShaderSource:h,attributeLocations:a}),t.allowPicking){var f=Pe(s,e,t._pickVertexShaderLoaded),v=Pe(u,e,t._pickFragmentShaderLoaded);t._pickFragmentShaderLoaded||(v=B.createPickFragmentShaderSource(u,"uniform")),t._rendererResources.pickPrograms[e]=F.fromCache({context:i,vertexShaderSource:f,fragmentShaderSource:v,attributeLocations:a})}}function Me(e,t){var i,r=e._loadResources;if(0===r.pendingShaderLoads&&0===r.pendingBufferLoads)if(e.asynchronous)r.programsToCreate.length>0&&(i=r.programsToCreate.dequeue(),Ie(i,e,t));else for(;r.programsToCreate.length>0;)i=r.programsToCreate.dequeue(),Ie(i,e,t)}function De(e,t){return function(i){e.texturesToCreate.enqueue({id:t.id,image:i,bufferView:void 0}),--e.pendingBufferViewToImage}}function Re(e){var t=e._loadResources;if(0===t.pendingBufferLoads)for(;t.texturesToCreateFromBufferView.length>0;){var i=t.texturesToCreateFromBufferView.dequeue(),r=e.gltf,n=r.bufferViews[i.bufferView],o=De(t,i),a=he(e,"image","id: "+i.id+", bufferView: "+i.bufferView);C(t.getBuffer(n),i.mimeType).then(o).otherwise(a),++t.pendingBufferViewToImage}}function Oe(e,t){var i=e._loadResources;if(i.createSamplers){i.createSamplers=!1;var r=e._rendererResources.samplers,n=e.gltf.samplers;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];r[o]=new L({wrapS:a.wrapS,wrapT:a.wrapT,minificationFilter:a.minFilter,magnificationFilter:a.magFilter})}}}function Ne(e,t,i){var r=e.image.src,n=At.textures.get(r);if(n)return t._rendererResources.textures[e.id]=n,n.ref(),void At.images.get(r).unref();var o=t.gltf.textures,n=o[e.id],a=t._rendererResources.samplers,s=a[n.sampler],l=s.minificationFilter===k.NEAREST_MIPMAP_NEAREST||s.minificationFilter===k.NEAREST_MIPMAP_LINEAR||s.minificationFilter===k.LINEAR_MIPMAP_NEAREST||s.minificationFilter===k.LINEAR_MIPMAP_LINEAR,u=l||s.wrapS===z.REPEAT||s.wrapS===z.MIRRORED_REPEAT||s.wrapT===z.REPEAT||s.wrapT===z.MIRRORED_REPEAT,c=e.image,h=!S.isPowerOfTwo(c.width)||!S.isPowerOfTwo(c.height);if(u&&h){var d=document.createElement("canvas");d.width=S.nextPowerOfTwo(c.width),d.height=S.nextPowerOfTwo(c.height);var p=d.getContext("2d");p.drawImage(c,0,0,c.width,c.height,0,0,d.width,d.height),c=d}var m;n.target===G.TEXTURE_2D&&(m=new V({context:i,source:c,pixelFormat:n.internalFormat,pixelDatatype:n.type,sampler:s,flipY:!1})),l&&m.generateMipmap(),t._rendererResources.textures[e.id]=m,At.textures.set(r,m),At.images.get(r).unref()}function Le(e,t){var i,r=e._loadResources;if(e.asynchronous)r.texturesToCreate.length>0&&(i=r.texturesToCreate.dequeue(),Ne(i,e,t));else for(;r.texturesToCreate.length>0;)i=r.texturesToCreate.dequeue(),Ne(i,e,t)}function Fe(e,t){var i=e.gltf,r=i.techniques,n=i.materials,o={},a=r[n[t.material].technique],s=a.parameters,u=a.attributes,c=e._rendererResources.programs[a.program].vertexAttributes;for(var h in c)if(c.hasOwnProperty(h)){var d=u[h],p=c[h].index;if(l(d)){var m=s[d];o[m.semantic]=p}else o[h]=p}return o}function Be(e,t,i){for(var r=e.length,n=0;r>n;++n)for(var o=[e[n]];o.length>0;){var a=o.pop(),s=i[a];if(s.jointName===t)return a;for(var l=s.children,u=l.length,c=0;u>c;++c)o.push(l[c])}}function Ve(e,t){for(var i=e.gltf,r=i.skins,n=i.nodes,o=e._runtime.nodes,a=e._loadResources.skinnedNodesIds,s=a.length,l=0;s>l;++l){var u=a[l],c=o[u],h=n[u],d=t[h.skin];c.inverseBindMatrices=d.inverseBindMatrices,c.bindShapeMatrix=d.bindShapeMatrix;for(var p=[],m=h.skeletons,f=m.length,v=0;f>v;++v)p.push(m[v]);for(var g=r[h.skin].jointNames,_=g.length,y=0;_>y;++y){var C=g[y],E=o[Be(p,C,n)];c.joints.push(E)}}}function ke(e){var t=e._loadResources;if(0===t.pendingBufferLoads&&t.createSkins){t.createSkins=!1;var i=e.gltf,r=i.accessors,n=i.skins,o={};for(var a in n)if(n.hasOwnProperty(a)){var s,l=n[a],u=r[l.inverseBindMatrices];x.equals(l.bindShapeMatrix,x.IDENTITY)||(s=x.clone(l.bindShapeMatrix)),o[a]={inverseBindMatrices:Y.getSkinInverseBindMatrices(e,u),bindShapeMatrix:s}}Ve(e,o)}}function ze(e,t,i,r){return function(n){t[i]=r.evaluate(n,t[i]),t.dirtyNumber=e._maxDirtyNumber}}function Ue(e){var t=e._loadResources;if(t.finishedPendingBufferLoads()&&t.createRuntimeAnimations){t.createRuntimeAnimations=!1,e._runtime.animations={};var i=e._runtime.nodes,r=e.gltf.animations,n=e.gltf.accessors;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o],s=a.channels,l=a.parameters,u=a.samplers,c={};for(var h in l)l.hasOwnProperty(h)&&(c[h]=Y.getAnimationParameterValues(e,n[l[h]]));for(var d=Number.MAX_VALUE,p=-Number.MAX_VALUE,m=s.length,f=new Array(m),v=0;m>v;++v){var g=s[v],_=g.target,y=u[g.sampler],C=c[y.input];d=Math.min(d,C[0]),p=Math.max(p,C[C.length-1]);var E=Y.getAnimationSpline(e,o,a,g.sampler,y,c);f[v]=ze(e,i[_.id],_.path,E)}e._runtime.animations[o]={startTime:d,stopTime:p,channelEvaluators:f}}}}function Ge(e,t){var i=e._loadResources;if(i.finishedBuffersCreation()&&i.finishedProgramCreation()&&i.createVertexArrays){i.createVertexArrays=!1;var r=e._rendererResources.buffers,n=e._rendererResources.vertexArrays,o=e.gltf,a=o.accessors,s=o.meshes;for(var u in s)if(s.hasOwnProperty(u))for(var c=s[u].primitives,h=c.length,d=0;h>d;++d){var p,m,f,v=c[d],g=Fe(e,v),_=[],y=v.attributes;for(p in y)if(y.hasOwnProperty(p)&&(m=g[p],l(m))){var C=a[y[p]];_.push({index:m,vertexBuffer:r[C.bufferView],componentsPerAttribute:j(C).componentsPerAttribute,componentDatatype:C.componentType,normalize:!1,offsetInBytes:C.byteOffset,strideInBytes:C.byteStride})}var E=e._precreatedAttributes;if(l(E))for(p in E)E.hasOwnProperty(p)&&(m=g[p],l(m)&&(f=E[p],f.index=m,_.push(f)));var S;if(l(v.indices)){var w=a[v.indices];S=r[w.bufferView]}n[u+".primitive."+d]=new U({context:t,attributes:_,indexBuffer:S})}}}function We(e){var t={};t[G.BLEND]=!1,t[G.CULL_FACE]=!1,t[G.DEPTH_TEST]=!1,t[G.POLYGON_OFFSET_FILL]=!1,t[G.SCISSOR_TEST]=!1;var i,r=e.enable,n=r.length;for(i=0;n>i;++i)t[r[i]]=!0;return t}function He(e,t){var i=e._loadResources;if(i.createRenderStates){i.createRenderStates=!1;var r=e._rendererResources.renderStates,n=e.gltf.techniques;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o],u=a.states,c=We(u),h=s(u.functions,s.EMPTY_OBJECT),d=s(h.blendColor,[0,0,0,0]),p=s(h.blendEquationSeparate,[G.FUNC_ADD,G.FUNC_ADD]),m=s(h.blendFuncSeparate,[G.ONE,G.ONE,G.ZERO,G.ZERO]),f=s(h.colorMask,[!0,!0,!0,!0]),v=s(h.depthRange,[0,1]),g=s(h.polygonOffset,[0,0]),_=s(h.scissor,[0,0,0,0]);r[o]=N.fromCache({frontFace:l(h.frontFace)?h.frontFace[0]:G.CCW,cull:{enabled:c[G.CULL_FACE],face:l(h.cullFace)?h.cullFace[0]:G.BACK},lineWidth:l(h.lineWidth)?h.lineWidth[0]:1,polygonOffset:{enabled:c[G.POLYGON_OFFSET_FILL],factor:g[0],units:g[1]},scissorTest:{enabled:c[G.SCISSOR_TEST],rectangle:{x:_[0],y:_[1],width:_[2],height:_[3]}},depthRange:{near:v[0],far:v[1]},depthTest:{enabled:c[G.DEPTH_TEST],func:l(h.depthFunc)?h.depthFunc[0]:G.LESS},colorMask:{red:f[0],green:f[1],blue:f[2],alpha:f[3]},depthMask:l(h.depthMask)?h.depthMask[0]:!0,blending:{enabled:c[G.BLEND],color:{red:d[0],green:d[1],blue:d[2],alpha:d[3]},equationRgb:p[0],equationAlpha:p[1],functionSourceRgb:m[0],functionSourceAlpha:m[1],functionDestinationRgb:m[2],functionDestinationAlpha:m[3]}})}}}function qe(e,t){var i={value:e,clone:function(e,t){return e},func:function(){return i.value}};return i}function je(e,i){var r={value:t.fromArray(e),clone:t.clone,func:function(){return r.value}};return r}function Ye(e,t){var r={value:i.fromArray(e),clone:i.clone,func:function(){return r.value}};return r}function Xe(e,t){var i={value:r.fromArray(e),clone:r.clone,func:function(){return i.value}};return i}function Ze(e,t){var i={value:w.fromColumnMajorArray(e),clone:w.clone,func:function(){return i.value}};return i}function Ke(e,t){var i={value:T.fromColumnMajorArray(e),clone:T.clone,func:function(){return i.value}};return i}function Qe(e,t){var i={value:x.fromColumnMajorArray(e),clone:x.clone,func:function(){return i.value}};return i}function Je(e,t){this._value=void 0,this._textureId=e,this._model=t}function $e(e,t){var i=new Je(e,t);return i.func=function(){return i.value},i}function et(e,t,i,r){var n=t._runtime.nodes[e];return kt[i](r,t,n)}function tt(e,t){var i=e._loadResources;if(i.finishedProgramCreation()&&i.createUniformMaps){i.createUniformMaps=!1;var r=e.gltf,n=r.materials,o=r.techniques,a=e._uniformMaps;for(var s in n)if(n.hasOwnProperty(s)){var u,c=n[s],h=c.values,d=o[c.technique],p=d.parameters,m=d.uniforms,f={},v={};for(var g in m)if(m.hasOwnProperty(g)){var _=m[g],y=p[_];if(l(h[_])){var C=Vt[y.type](h[_],e);f[g]=C.func,v[_]=C}else if(l(y.node))f[g]=et(y.node,e,y.semantic,t.uniformState);else if(l(y.semantic))"JOINTMATRIX"!==y.semantic?f[g]=Bt[y.semantic](t.uniformState,e):u=g;else if(l(y.value)){var E=Vt[y.type](y.value,e);f[g]=E.func,v[_]=E}}var S=a[s];S.uniformMap=f,S.values=v,S.jointMatrixUniformName=u}}}function it(e){return function(){return e}}function rt(e){return function(){return e.computedJointMatrices}}function nt(t,r,n,u){for(var c=t._nodeCommands,h=t._pickIds,d=t.allowPicking,p=t._runtime.meshesByName,m=t._rendererResources,f=m.vertexArrays,v=m.programs,_=m.pickPrograms,y=m.renderStates,C=t._uniformMaps,E=t.gltf,S=E.accessors,w=E.meshes,T=E.techniques,b=E.materials,A=r.meshes,P=A.length,I=0;P>I;++I)for(var M=A[I],D=w[M],R=D.primitives,N=R.length,L=0;N>L;++L){var F,B=R[L],V=S[B.indices],k=b[B.material],z=T[k.technique],U=z.program,G=B.attributes.POSITION;if(l(G)){var W=S[G];F=e.fromCornerPoints(i.fromArray(W.min),i.fromArray(W.max))}var H,q,Y=f[M+".primitive."+L];if(l(V))q=V.count,H=V.byteOffset/g.getSizeInBytes(V.componentType);else{var X=S[B.attributes.POSITION];q=X.count;var Z=j(X);H=X.byteOffset/(Z.componentsPerAttribute*a.getSizeInBytes(X.componentType))}var K=C[B.material],Q=K.uniformMap;if(l(K.jointMatrixUniformName)){var J={};J[K.jointMatrixUniformName]=rt(n),Q=o(Q,J)}l(t._uniformMapLoaded)&&(Q=t._uniformMapLoaded(Q,U,n));var ee,te=y[k.technique],ie=te.blending.enabled,re={primitive:s(t.pickPrimitive,t),id:t.id,node:n.publicNode,mesh:p[D.name]},ne=new O({boundingVolume:new e,cull:t.cull,modelMatrix:new x,primitiveType:B.mode,vertexArray:Y,count:q,offset:H,shaderProgram:v[z.program],uniformMap:Q,renderState:te,owner:re,pass:ie?$.TRANSLUCENT:$.OPAQUE});if(d){var oe;if(l(t._pickFragmentShaderLoaded))oe=l(t._pickUniformMapLoaded)?t._pickUniformMapLoaded(Q):o(Q);else{var ae=u.createPickId(re);h.push(ae);var se={czm_pickColor:it(ae.color)};oe=o(Q,se)}ee=new O({boundingVolume:new e,cull:t.cull,modelMatrix:new x,primitiveType:B.mode,vertexArray:Y,count:q,offset:H,shaderProgram:_[z.program],uniformMap:oe,renderState:te,owner:re,pass:ie?$.TRANSLUCENT:$.OPAQUE})}var le={show:!0,boundingSphere:F,command:ne,pickCommand:ee};n.commands.push(le),c.push(le)}}function ot(e,t){var r=e._loadResources;if(r.finishedEverythingButTextureCreation()&&r.createRuntimeNodes){r.createRuntimeNodes=!1;for(var n=[],o=e._runtime.nodes,a=e.gltf,s=a.nodes,u=a.scenes[a.scene],c=u.nodes,h=c.length,d=[],p=0;h>p;++p)for(d.push({parentRuntimeNode:void 0,gltfNode:s[c[p]],id:c[p]});d.length>0;){var m=d.pop(),f=m.parentRuntimeNode,v=m.gltfNode,g=o[m.id];if(0===g.parents.length)if(l(v.matrix))g.matrix=x.fromColumnMajorArray(v.matrix);else{var _=v.rotation;g.translation=i.fromArray(v.translation),g.rotation=A.unpack(_),g.scale=i.fromArray(v.scale)}l(f)?(f.children.push(g),g.parents.push(f)):n.push(g),l(v.meshes)&&nt(e,v,g,t);for(var y=v.children,C=y.length,E=0;C>E;++E)d.push({parentRuntimeNode:g,gltfNode:s[y[E]],id:y[E]})}e._runtime.rootNodes=n,e._runtime.nodes=o}}function at(e,t){var i=t.context;if(e._loadRendererResourcesFromCache){var r=e._rendererResources,n=e._cachedRendererResources;n.assign(r),l(e._precreatedAttributes)&&Ge(e,i)}else xe(e,i),Me(e,i),Oe(e,i),Re(e),Le(e,i);ke(e),Ue(e),e._loadRendererResourcesFromCache||(Ge(e,i),He(e,i)),tt(e,i),ot(e,i)}function st(e,t){var i=e.publicNode,r=i.matrix;i.useMatrix&&l(r)?x.clone(r,t):l(e.matrix)?x.clone(e.matrix,t):(x.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t), -i.setMatrix(t))}function lt(t,r,n){for(var o=t._maxDirtyNumber,a=t.allowPicking,s=t._runtime.rootNodes,u=s.length,c=zt,h=t._computedModelMatrix,d=0;u>d;++d){var p=s[d];for(st(p,p.transformToRoot),c.push(p);c.length>0;){p=c.pop();var m=p.transformToRoot,f=p.commands;if(p.dirtyNumber===o||r||n){var v=x.multiplyTransformation(h,m,p.computedMatrix),g=f.length;if(g>0)for(var _=0;g>_;++_){var y=f[_],C=y.command;if(x.clone(v,C.modelMatrix),e.transform(y.boundingSphere,C.modelMatrix,C.boundingVolume),l(t._rtcCenter)&&i.add(t._rtcCenter,C.boundingVolume.center,C.boundingVolume.center),a){var E=y.pickCommand;x.clone(C.modelMatrix,E.modelMatrix),e.clone(C.boundingVolume,E.boundingVolume)}}}for(var S=p.children,w=S.length,T=0;w>T;++T){var b=S[T];b.dirtyNumber=Math.max(b.dirtyNumber,p.dirtyNumber),(b.dirtyNumber===o||n)&&(st(b,b.transformToRoot),x.multiplyTransformation(m,b.transformToRoot,b.transformToRoot)),c.push(b)}}}++t._maxDirtyNumber}function ut(e){for(var t=e._runtime.skinnedNodes,i=t.length,r=0;i>r;++r){var n=t[r];Ut=x.inverseTransformation(n.transformToRoot,Ut);for(var o=n.computedJointMatrices,a=n.joints,s=n.bindShapeMatrix,u=n.inverseBindMatrices,c=u.length,h=0;c>h;++h)l(o[h])||(o[h]=new x),o[h]=x.multiplyTransformation(Ut,a[h].transformToRoot,o[h]),o[h]=x.multiplyTransformation(o[h],u[h],o[h]),l(s)&&(o[h]=x.multiplyTransformation(o[h],s,o[h]))}}function ct(e){for(var t=e._runtime.rootNodes,i=t.length,r=zt,n=0;i>n;++n){var o=t[n];for(o.computedShow=o.publicNode.show,r.push(o);r.length>0;){o=r.pop();for(var a=o.computedShow,s=o.commands,l=s.length,u=0;l>u;++u)s[u].show=a;for(var c=o.children,h=c.length,d=0;h>d;++d){var p=c[d];p.computedShow=a&&p.publicNode.show,r.push(p)}}}}function ht(e,t){var i=e.id;if(e._id!==i){e._id=i;for(var r=e._pickIds,n=r.length,o=0;n>o;++o)r[o].object.id=i}}function dt(e){if(e._debugWireframe!==e.debugWireframe){e._debugWireframe=e.debugWireframe;for(var t=e.debugWireframe?b.LINES:b.TRIANGLES,i=e._nodeCommands,r=i.length,n=0;r>n;++n)i[n].command.primitiveType=t}}function pt(e){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume){e._debugShowBoundingVolume=e.debugShowBoundingVolume;for(var t=e.debugShowBoundingVolume,i=e._nodeCommands,r=i.length,n=0;r>n;n++)i[n].command.debugShowBoundingVolume=t}}function mt(e,t,i){return Gt.center=e,Gt.radius=t,i.camera.getPixelSize(Gt,i.context.drawingBufferWidth,i.context.drawingBufferHeight)}function ft(e,t){var r=e.scale;if(0!==e.minimumPixelSize){var n=t.context,o=Math.max(n.drawingBufferWidth,n.drawingBufferHeight),a=e.modelMatrix;Wt.x=a[12],Wt.y=a[13],Wt.z=a[14],l(e._rtcCenter)&&i.add(e._rtcCenter,Wt,Wt);var s=e.boundingSphere.radius,u=mt(Wt,s,t),c=1/u,h=Math.min(c*(2*s),o);hr;++r){var n=t[r];if("CESIUM_RTC"!==n&&"KHR_binary_glTF"!==n&&"KHR_materials_common"!==n)throw new I("Unsupported glTF Extension: "+n)}}function _t(e,t){this.buffers=void 0,this.vertexArrays=void 0,this.programs=void 0,this.pickPrograms=void 0,this.textures=void 0,this.samplers=void 0,this.renderStates=void 0,this.ready=!1,this.context=e,this.cacheKey=t,this.count=0}function yt(e){for(var t in e)e.hasOwnProperty(t)&&(l(e[t].unref)?e[t].unref():e[t].destroy())}function Ct(e){yt(e.buffers),yt(e.vertexArrays),yt(e.programs),yt(e.pickPrograms),yt(e.textures)}function Et(e){for(var t in e)e.hasOwnProperty(t)&&e[t].ref&&e[t].ref()}function St(e){for(var t in e)e.hasOwnProperty(t)&&e[t].unref&&e[t].unref()}if(!d.supportsTypedArrays())return{};var wt=x.fromRotationTranslation(T.fromRotationX(S.PI_OVER_TWO)),Tt=new i,xt={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3},bt=function(e){this.map={},this.name=e};bt.prototype.get=function(e){return this.map[e]},bt.prototype.clear=function(){return this.map={},this},bt.prototype.size=function(){var e=0;for(var t in this.map)this.map.hasOwnProperty(t)&&e++;return e},bt.prototype.set=function(e,t){this.map[e]=t;var i=this;return t._cacheRefCount=1,t.ref=function(){t._cacheRefCount++},t.unref=function(){t._cacheRefCount--,0===t._cacheRefCount&&(delete i.map[e],t.destroy&&t.destroy())},t};var At={textures:new bt("texture"),images:new bt("image")},Pt="model/vnd.gltf.binary,model/vnd.gltf+json,model/gltf.binary,model/gltf+json;q=0.8,application/json;q=0.2,*/*;q=0.01";te.prototype.getBuffer=function(e){return ae(this.buffers[e.buffer],e.byteOffset,e.byteLength)},te.prototype.finishedPendingBufferLoads=function(){return 0===this.pendingBufferLoads},te.prototype.finishedBuffersCreation=function(){return 0===this.pendingBufferLoads&&0===this.buffersToCreate.length},te.prototype.finishedProgramCreation=function(){return 0===this.pendingShaderLoads&&0===this.programsToCreate.length},te.prototype.finishedTextureCreation=function(){var e=0===this.pendingTextureLoads,t=0===this.texturesToCreate.length&&0===this.texturesToCreateFromBufferView.length;return e&&t},te.prototype.finishedEverythingButTextureCreation=function(){var e=0===this.pendingBufferLoads&&0===this.pendingShaderLoads,t=0===this.buffersToCreate.length&&0===this.programsToCreate.length&&0===this.pendingBufferViewToImage;return e&&t},te.prototype.finished=function(){return this.finishedTextureCreation()&&this.finishedEverythingButTextureCreation()},u(re.prototype,{gltf:{set:function(e){this._gltf=K(W(e))},get:function(){return this._gltf}},bgltf:{get:function(){return this._bgltf}}}),re.prototype.makeReady=function(e,t){this.gltf=e,this._bgltf=t;for(var i=this.modelsToLoad,r=i.length,n=0;r>n;++n){var o=i[n];o.isDestroyed()||ie(o,this)}this.modelsToLoad=void 0,this.ready=!0};var It={};u(oe.prototype,{gltf:{get:function(){return l(this._cachedGltf)?this._cachedGltf.gltf:void 0}},releaseGltfJson:{get:function(){return this._releaseGltfJson}},cacheKey:{get:function(){return this._cacheKey}},basePath:{get:function(){return this._basePath}},boundingSphere:{get:function(){var e=x.getScale(this.modelMatrix,Tt),t=l(this.maximumScale)?Math.min(this.maximumScale,this.scale):this.scale;i.multiplyByScalar(e,t,e);var r=this._scaledBoundingSphere;return r.center=i.multiplyComponents(this._boundingSphere.center,e,r.center),r.radius=i.maximumComponent(e)*this._initialRadius,l(this._rtcCenter)&&i.add(this._rtcCenter,r.center,r.center),r}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},asynchronous:{get:function(){return this._asynchronous}},allowPicking:{get:function(){return this._allowPicking}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},pendingTextureLoads:{get:function(){return l(this._loadResources)?this._loadResources.pendingTextureLoads:0}},dirty:{get:function(){return this._dirty}}});var Mt=Uint32Array.BYTES_PER_ELEMENT;oe.fromGltf=function(e){var t=e.url,i=new oe(e);return i.loadGltf(t,e),i},oe.prototype.loadGltf=function(e){var t=e.url,i=s(e.cacheKey,p(t));e=n(e),e.basePath=m(t),e.cacheKey=i,this._basePath=e.basePath,this._cacheKey=e.cacheKey;var r=new H(document.location.href),o=new H(this._basePath);this._baseUri=o.resolve(r),e.headers=l(e.headers)?n(e.headers):{},l(e.headers.Accept)||(e.headers.Accept=Pt);var a=It[i];return l(a)?a.ready||(++a.count,a.modelsToLoad.push(this)):(a=new re({ready:!1}),a.count=1,a.modelsToLoad.push(this),ie(this,a),It[i]=a,_(t,e.headers).then(function(t){var i=new Uint8Array(t);if(se(i)){var r=le(i);0!==r.binaryOffset&&(i=i.subarray(r.binaryOffset)),a.makeReady(r.glTF,i)}else{var n=v(i),o=JSON.parse(n);e.gltfModifier&&(o=e.gltfModifier(o)),a.makeReady(o)}}).otherwise(he(this,"model",t))),this._readyPromise},oe._gltfCache=It,oe.prototype.getNode=function(e){var t=ue(this,"nodesByName",e);return l(t)?t.publicNode:void 0},oe.prototype.getMesh=function(e){return ue(this,"meshesByName",e)},oe.prototype.getMaterial=function(e){return ue(this,"materialsByName",e)},oe.cacheSize=function(){return{textures:At.textures.size(),images:At.images.size()}};var Dt=new i,Rt=new i,Ot=new i,Nt=new A,Lt=new i,Ft=new i,Bt={MODEL:function(e,t){return function(){return e.model}},VIEW:function(e,t){return function(){return e.view}},PROJECTION:function(e,t){return function(){return e.projection}},MODELVIEW:function(e,t){return function(){return e.modelView}},CESIUM_RTC_MODELVIEW:function(e,t){var r=new x;return function(){return x.getTranslation(e.model,Ft),i.add(Ft,t._rtcCenter,Ft),x.multiplyByPoint(e.view,Ft,Ft),x.setTranslation(e.modelView,Ft,r)}},MODELVIEWPROJECTION:function(e,t){return function(){return e.modelViewProjection}},MODELINVERSE:function(e,t){return function(){return e.inverseModel}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t){return function(){return e.inverseModelView}},MODELVIEWPROJECTIONINVERSE:function(e,t){return function(){return e.inverseModelViewProjection}},MODELINVERSETRANSPOSE:function(e,t){return function(){return e.inverseTranposeModel}},MODELVIEWINVERSETRANSPOSE:function(e,t){return function(){return e.normal}},VIEWPORT:function(e,t){return function(){return e.viewportCartesian4}}};u(Je.prototype,{value:{get:function(){if(!l(this._value)){var e=this._model._rendererResources.textures[this._textureId];if(!l(e))return this._model._defaultTexture;this._value=e}return this._value},set:function(e){this._value=e}}}),Je.prototype.clone=function(e,t){return e},Je.prototype.func=void 0;var Vt={};Vt[G.FLOAT]=qe,Vt[G.FLOAT_VEC2]=je,Vt[G.FLOAT_VEC3]=Ye,Vt[G.FLOAT_VEC4]=Xe,Vt[G.INT]=qe,Vt[G.INT_VEC2]=je,Vt[G.INT_VEC3]=Ye,Vt[G.INT_VEC4]=Xe,Vt[G.BOOL]=qe,Vt[G.BOOL_VEC2]=je,Vt[G.BOOL_VEC3]=Ye,Vt[G.BOOL_VEC4]=Xe,Vt[G.FLOAT_MAT2]=Ze,Vt[G.FLOAT_MAT3]=Ke,Vt[G.FLOAT_MAT4]=Qe,Vt[G.SAMPLER_2D]=$e;var kt={MODEL:function(e,t,i){return function(){return i.computedMatrix}},VIEW:function(e,t,i){return function(){return e.view}},PROJECTION:function(e,t,i){return function(){return e.projection}},MODELVIEW:function(e,t,i){var r=new x;return function(){return x.multiplyTransformation(e.view,i.computedMatrix,r)}},CESIUM_RTC_MODELVIEW:function(e,t,i){var r=new x;return function(){return x.multiplyTransformation(e.view,i.computedMatrix,r),x.setTranslation(r,t._rtcCenterEye,r)}},MODELVIEWPROJECTION:function(e,t,i){var r=new x;return function(){return x.multiplyTransformation(e.view,i.computedMatrix,r),x.multiply(e._projection,r,r)}},MODELINVERSE:function(e,t,i){var r=new x;return function(){return x.inverse(i.computedMatrix,r)}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t,i){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t,i){var r=new x,n=new x;return function(){return x.multiplyTransformation(e.view,i.computedMatrix,r),x.inverse(r,n)}},MODELVIEWPROJECTIONINVERSE:function(e,t,i){var r=new x,n=new x;return function(){return x.multiplyTransformation(e.view,i.computedMatrix,r),x.multiply(e._projection,r,r),x.inverse(r,n)}},MODELINVERSETRANSPOSE:function(e,t,i){var r=new x,n=new T;return function(){return x.inverse(i.computedMatrix,r),x.getRotation(r,n),T.transpose(n,n)}},MODELVIEWINVERSETRANSPOSE:function(e,t,i){var r=new x,n=new x,o=new T;return function(){return x.multiplyTransformation(e.view,i.computedMatrix,r),x.inverse(r,n),x.getRotation(n,o),T.transpose(o,o)}},VIEWPORT:function(e,t,i){return function(){return e.viewportCartesian4}}},zt=[],Ut=new x,Gt=new e,Wt=new i;return _t.prototype.release=function(){return 0===--this.count?(l(this.cacheKey)&&delete this.context.cache.modelRendererResourceCache[this.cacheKey],Ct(this),c(this)):void 0},_t.prototype.init=function(e){this.buffers=e.buffers,Et(this.buffers),this.vertexArrays=e.vertexArrays,Et(this.vertexArrays),this.programs=e.programs,Et(this.programs),this.pickPrograms=e.pickPrograms,Et(this.pickPrograms),this.textures=e.textures,Et(this.textures),this.samplers=e.samplers,Et(this.samplers),this.renderStates=e.renderStates,Et(this.renderStates)},_t.prototype.assign=function(e){e.buffers=this.buffers,refRessource(this.buffers),e.vertexArrays=this.vertexArrays,refRessource(this.vertexArrays),e.programs=this.programs,refRessource(this.programs),e.pickPrograms=this.pickPrograms,refRessource(this.pickPrograms),e.textures=this.textures,refRessource(this.textures),e.samplers=this.samplers,refRessource(this.samplers),e.renderStates=this.renderStates,refRessource(this.renderStates)},oe.prototype.update=function(e){if(e.mode===ee.SCENE3D){var t=e.context;if(this._defaultTexture=t.defaultTexture,this._state===xt.NEEDS_LOAD&&l(this.gltf)){var r,n=this.cacheKey;if(l(n)){t.cache.modelRendererResourceCache=s(t.cache.modelRendererResourceCache,{});var o=t.cache.modelRendererResourceCache;if(r=o[this.cacheKey],l(r)){if(!r.ready)return;++r.count,this._loadRendererResourcesFromCache=!0}else r=new _t(t,n),r.count=1,o[this.cacheKey]=r;this._cachedRendererResources=r}else r=new _t(t),r.count=1,this._cachedRendererResources=r;if(this._state=xt.LOADING,this._boundingSphere=ce(this.gltf),this._initialRadius=this._boundingSphere.radius,gt(this),this._state!==xt.FAILED){var a=this.gltf.extensions;l(a)&&l(a.CESIUM_RTC)&&(this._rtcCenter=i.fromArray(a.CESIUM_RTC.center),this._rtcCenterEye=new i),this._loadResources=new te,Te(this)}}var u=this._loadResources,c=this._incrementallyLoadTextures,h=!1;if(this._state===xt.LOADING&&(at(this,e),(u.finished()||c&&u.finishedEverythingButTextureCreation())&&(this._state=xt.LOADED,h=!0)),l(u)&&this._state===xt.LOADED&&(c&&!h&&at(this,e),u.finished())){this._loadResources=void 0;var d=this._rendererResources,p=this._cachedRendererResources;p.init(d),p.ready=!0,l(this._precreatedAttributes)&&(p.vertexArrays={}),this.releaseGltfJson&&vt(this)}var m=this.show&&0!==this.scale;if(m&&this._state===xt.LOADED||h){var f=this.activeAnimations.update(e)||this._cesiumAnimationsDirty;this._cesiumAnimationsDirty=!1,this._dirty=!1;var v=!x.equals(this._modelMatrix,this.modelMatrix)||this._scale!==this.scale||this._minimumPixelSize!==this.minimumPixelSize||0!==this.minimumPixelSize||this._maximumScale!==this.maximumScale;if(v||h){x.clone(this.modelMatrix,this._modelMatrix),this._scale=this.scale,this._minimumPixelSize=this.minimumPixelSize,this._maximumScale=this.maximumScale;var g=ft(this,e),_=this._computedModelMatrix;x.multiplyByUniformScale(this.modelMatrix,g,_),x.multiplyTransformation(_,wt,_)}(f||v||h)&&(lt(this,v,h),this._dirty=!0,(f||h)&&ut(this)),this._perNodeShowDirty&&(this._perNodeShowDirty=!1,ct(this)),ht(this,t),dt(this),pt(this)}if(h){var y=this;return void e.afterRender.push(function(){y._ready=!0,y._readyPromise.resolve(y)})}if(m&&!this._ignoreCommands){var C,E,S=e.commandList,w=e.passes,T=this._nodeCommands,b=T.length;if(w.render)for(C=0;b>C;++C)E=T[C],E.show&&S.push(E.command);if(w.pick&&this.allowPicking)for(C=0;b>C;++C)E=T[C],E.show&&S.push(E.pickCommand)}}},oe.prototype.isDestroyed=function(){return!1},oe.prototype.destroy=function(){l(this._precreatedAttributes)&&yt(this._rendererResources.vertexArrays);var e=this._rendererResources;St(e.buffers),St(e.vertexArrays),St(e.programs),St(e.pickPrograms),St(e.textures),St(e.samplers),St(e.renderStates);var t;if(this._loadResources)for(var i=this._loadResources.texturesToCreate;i.length;){t=i.dequeue();var r=t.image.src;At.images.get(r).unref()}this._rendererResources=void 0,this._cachedRendererResources=this._cachedRendererResources&&this._cachedRendererResources.release();for(var n=this._pickIds,o=n.length,a=0;o>a;++a)n[a].destroy();return vt(this),c(this)},oe}),i("DataSources/ModelVisualizer",["../Core/AssociativeArray","../Core/BoundingSphere","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Scene/Model","../Scene/ModelAnimationLoop","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t,i){i.collectionChanged.addEventListener(c.prototype._onCollectionChanged,this),this._scene=t,this._primitives=t.primitives,this._entityCollection=i,this._modelHash={},this._entitiesToVisualize=new e,this._onCollectionChanged(i,i.values,[],[])}function h(e,t,r,n){var o=r[t.id];i(o)&&(n.removeAndDestroy(o.modelPrimitive),delete r[t.id])}function d(e,t){var r=t[e.id];i(r)&&(r.nodeTransformationsScratch={})}function p(e){console.error(e)}var m=1,f=0,v=!0,g=new o,_=new o;return c.prototype.update=function(e){for(var t=this._entitiesToVisualize.values,r=this._modelHash,n=this._primitives,l=0,c=t.length;c>l;l++){var h,d,y=t[l],C=y._model,E=r[y.id],S=y.isShowing&&y.isAvailable(e)&&u.getValueOrDefault(C._show,e,!0);if(S&&(d=y._getModelMatrix(e,g),h=u.getValueOrUndefined(C._uri,e),S=i(d)&&i(h)),S){var w=i(E)?E.modelPrimitive:void 0;if(i(w)&&h===E.uri||(i(w)&&(n.removeAndDestroy(w),delete r[y.id]),w=a.fromGltf({url:h,incrementallyLoadTextures:u.getValueOrDefault(C._incrementallyLoadTextures,e,v)}),w.readyPromise.otherwise(p),w.id=y,n.add(w),E={modelPrimitive:w,uri:h,animationsRunning:!1,nodeTransformationsScratch:{},originalNodeMatrixHash:{}},r[y.id]=E),w.show=!0,w.scale=u.getValueOrDefault(C._scale,e,m),w.minimumPixelSize=u.getValueOrDefault(C._minimumPixelSize,e,f),w.maximumScale=u.getValueOrUndefined(C._maximumScale,e),w.modelMatrix=o.clone(d,w.modelMatrix),w.ready){var T=u.getValueOrDefault(C._runAnimations,e,!0);E.animationsRunning!==T&&(T?w.activeAnimations.addAll({loop:s.REPEAT}):w.activeAnimations.removeAll(),E.animationsRunning=T);var x=u.getValueOrUndefined(C._nodeTransformations,e,E.nodeTransformationsScratch);if(i(x))for(var b=E.originalNodeMatrixHash,A=Object.keys(x),P=0,I=A.length;I>P;++P){var M=A[P],D=x[M];if(i(D)){var R=w.getNode(M);if(i(R)){var O=b[M];i(O)||(O=R.matrix.clone(),b[M]=O);var N=o.fromTranslationRotationScale(D,_);R.matrix=o.multiply(O,N,N)}}}}}else i(E)&&(E.modelPrimitive.show=!1)}return!0},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(c.prototype._onCollectionChanged,this);for(var e=this._entitiesToVisualize.values,t=this._modelHash,i=this._primitives,n=e.length-1;n>-1;n--)h(this,e[n],t,i);return r(this)},c.prototype.getBoundingSphere=function(e,r){var n=this._modelHash[e.id];if(!i(n))return l.FAILED;var o=n.modelPrimitive;return i(o)&&o.show?o.ready?(t.transform(o.boundingSphere,o.modelMatrix,r),l.DONE):l.PENDING:l.FAILED},c.prototype._onCollectionChanged=function(e,t,r,n){var o,a,s=this._entitiesToVisualize,l=this._modelHash,u=this._primitives;for(o=t.length-1;o>-1;o--)a=t[o],i(a._model)&&i(a._position)&&s.set(a.id,a);for(o=n.length-1;o>-1;o--)a=n[o],i(a._model)&&i(a._position)?(d(a,l),s.set(a.id,a)):(h(this,a,l,u),s.remove(a.id));for(o=r.length-1;o>-1;o--)a=r[o],h(this,a,l,u),s.remove(a.id)},c}),i("Shaders/PolylineCommon",[],function(){"use strict";return"void clipLineSegmentToNearPlane(\nvec3 p0,\nvec3 p1,\nout vec4 positionWC,\nout bool clipped,\nout bool culledByNearPlane)\n{\nculledByNearPlane = false;\nclipped = false;\nvec3 p1ToP0 = p1 - p0;\nfloat magnitude = length(p1ToP0);\nvec3 direction = normalize(p1ToP0);\nfloat endPoint0Distance = -(czm_currentFrustum.x + p0.z);\nfloat denominator = -direction.z;\nif (endPoint0Distance < 0.0 && abs(denominator) < czm_epsilon7)\n{\nculledByNearPlane = true;\n}\nelse if (endPoint0Distance < 0.0 && abs(denominator) > czm_epsilon7)\n{\nfloat t = (czm_currentFrustum.x + p0.z) / denominator;\nif (t < 0.0 || t > magnitude)\n{\nculledByNearPlane = true;\n}\nelse\n{\np0 = p0 + t * direction;\nclipped = true;\n}\n}\npositionWC = czm_eyeToWindowCoordinates(vec4(p0, 1.0));\n}\nvec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious) {\nvec4 endPointWC, p0, p1;\nbool culledByNearPlane, clipped;\nvec4 positionEC = czm_modelViewRelativeToEye * position;\nvec4 prevEC = czm_modelViewRelativeToEye * previous;\nvec4 nextEC = czm_modelViewRelativeToEye * next;\nclipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, p0, clipped, culledByNearPlane);\nclipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, p1, clipped, culledByNearPlane);\nclipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, endPointWC, clipped, culledByNearPlane);\nif (culledByNearPlane)\n{\nreturn vec4(0.0, 0.0, 0.0, 1.0);\n}\nvec2 prevWC = normalize(p0.xy - endPointWC.xy);\nvec2 nextWC = normalize(p1.xy - endPointWC.xy);\nfloat expandWidth = width * 0.5;\nvec2 direction;\nif (czm_equalsEpsilon(normalize(previous.xyz - position.xyz), vec3(0.0), czm_epsilon1) || czm_equalsEpsilon(prevWC, -nextWC, czm_epsilon1))\n{\ndirection = vec2(-nextWC.y, nextWC.x);\n}\nelse if (czm_equalsEpsilon(normalize(next.xyz - position.xyz), vec3(0.0), czm_epsilon1) || clipped)\n{\ndirection = vec2(prevWC.y, -prevWC.x);\n}\nelse\n{\nvec2 normal = vec2(-nextWC.y, nextWC.x);\ndirection = normalize((nextWC + prevWC) * 0.5);\nif (dot(direction, normal) < 0.0)\n{\ndirection = -direction;\n}\nfloat sinAngle = abs(direction.x * nextWC.y - direction.y * nextWC.x);\nexpandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);\n}\nvec2 offset = direction * expandDirection * expandWidth * czm_resolutionScale;\nreturn vec4(endPointWC.xy + offset, -endPointWC.z, 1.0);\n}\n"}),i("Shaders/PolylineFS",[],function(){"use strict";return"varying vec2 v_st;\nvoid main()\n{\nczm_materialInput materialInput;\nmaterialInput.s = v_st.s;\nmaterialInput.st = v_st;\nmaterialInput.str = vec3(v_st, 0.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n}\n"}),i("Shaders/PolylineVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 position2DHigh;\nattribute vec3 position2DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 prevPosition2DHigh;\nattribute vec3 prevPosition2DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec3 nextPosition2DHigh;\nattribute vec3 nextPosition2DLow;\nattribute vec4 texCoordExpandWidthAndShow;\nattribute vec4 pickColor;\nvarying vec2 v_st;\nvarying float v_width;\nvarying vec4 czm_pickColor;\nvoid main()\n{\nfloat texCoord = texCoordExpandWidthAndShow.x;\nfloat expandDir = texCoordExpandWidthAndShow.y;\nfloat width = abs(texCoordExpandWidthAndShow.z) + 0.5;\nbool usePrev = texCoordExpandWidthAndShow.z < 0.0;\nfloat show = texCoordExpandWidthAndShow.w;\nvec4 p, prev, next;\nif (czm_morphTime == 1.0)\n{\np = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz);\nprev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz);\nnext = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz);\n}\nelse if (czm_morphTime == 0.0)\n{\np = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);\nprev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy);\nnext = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy);\n}\nelse\n{\np = czm_columbusViewMorph(\nczm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),\nczm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz),\nczm_morphTime);\nprev = czm_columbusViewMorph(\nczm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy),\nczm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz),\nczm_morphTime);\nnext = czm_columbusViewMorph(\nczm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),\nczm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),\nczm_morphTime);\n}\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC * show;\nv_st = vec2(texCoord, clamp(expandDir, 0.0, 1.0));\nv_width = width;\nczm_pickColor = pickColor;\n}\n"}),i("Scene/Polyline",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","../Core/PolylinePipeline","./Material"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(o,a){o=r(o,r.EMPTY_OBJECT),this._show=r(o.show,!0),this._width=r(o.width,1),this._loop=r(o.loop,!1),this._material=o.material,n(this._material)||(this._material=u.fromType(u.ColorType,{color:new i(1,1,1,1)}));var c=o.positions;n(c)||(c=[]),this._positions=c,this._actualPositions=l.removeDuplicates(c),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=c.slice()),this._actualPositions.push(t.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=o.id;var h;n(a)&&(h=s.clone(a.modelMatrix)),this._modelMatrix=h,this._segments=l.wrapLongitude(this._actualPositions,h),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(g),this._polylineCollection=a,this._dirty=!1,this._pickId=void 0,this._boundingVolume=e.fromPoints(this._actualPositions),this._boundingVolumeWC=e.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new e}function h(e,t){++e._propertiesChanged[t];var i=e._polylineCollection;n(i)&&(i._updatePolyline(e,t),e._dirty=!0)}var d=c.SHOW_INDEX=0,p=c.WIDTH_INDEX=1,m=c.POSITION_INDEX=2,f=c.MATERIAL_INDEX=3,v=c.POSITION_SIZE_INDEX=4,g=c.NUMBER_OF_PROPERTIES=5;return o(c.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,h(this,d))}},positions:{get:function(){return this._positions},set:function(i){var r=l.removeDuplicates(i);this._loop&&r.length>2&&(r===i&&(r=i.slice()),r.push(t.clone(r[0]))),(this._actualPositions.length!==r.length||this._actualPositions.length!==this._length)&&h(this,v),this._positions=i,this._actualPositions=r,this._length=r.length,this._boundingVolume=e.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=e.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),h(this,m),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,h(this,f))}},width:{get:function(){return this._width},set:function(e){var t=this._width;e!==t&&(this._width=e,h(this,p))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){var i=this._actualPositions;e?i.length>2&&!t.equals(i[0],i[i.length-1])&&(i.length===this._positions.length&&(this._actualPositions=i=this._positions.slice()),i.push(t.clone(i[0]))):i.length>2&&t.equals(i[0],i[i.length-1])&&(i.length-1===this._positions.length?this._actualPositions=this._positions:i.pop()),this._loop=e,h(this,v)}}},id:{get:function(){return this._id},set:function(e){this._id=e,n(this._pickId)&&(this._pickId.object.id=e)}}}),c.prototype.update=function(){var t=s.IDENTITY;n(this._polylineCollection)&&(t=this._polylineCollection.modelMatrix);var i=this._segments.positions.length,r=this._segments.lengths,o=this._propertiesChanged[m]>0||this._propertiesChanged[v]>0;if((!s.equals(t,this._modelMatrix)||o)&&(this._segments=l.wrapLongitude(this._actualPositions,t),this._boundingVolumeWC=e.transform(this._boundingVolume,t,this._boundingVolumeWC)),this._modelMatrix=t,this._segments.positions.length!==i)h(this,v);else for(var a=r.length,u=0;a>u;++u)if(r[u]!==this._segments.lengths[u]){h(this,v);break}},c.prototype.getPickId=function(e){return n(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId},c.prototype._clean=function(){this._dirty=!1;for(var e=this._propertiesChanged,t=0;g-1>t;++t)e[t]=0},c.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0},c}),i("Scene/PolylineCollection",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/IndexDatatype","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/Plane","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/PolylineCommon","../Shaders/PolylineFS","../Shaders/PolylineVS","./BlendingState","./Material","./Pass","./Polyline","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D){"use strict";function R(e){e=a(e,a.EMPTY_OBJECT),this.modelMatrix=f.clone(a(e.modelMatrix,f.IDENTITY)),this._modelMatrix=f.clone(f.IDENTITY),this.debugShowBoundingVolume=a(e.debugShowBoundingVolume,!1),this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._pickCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(Q),this._polylines=[],this._polylineBuckets={},this._buffersUsage=[{bufferUsage:_.STATIC_DRAW,frameCount:0},{bufferUsage:_.STATIC_DRAW,frameCount:0},{bufferUsage:_.STATIC_DRAW,frameCount:0}],this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._pickColorBuffer=void 0,this._texCoordExpandWidthAndShowBuffer=void 0}function O(t,i,r,n,o){for(var a=i.context,l=i.commandList,u=r.length,c=0,h=!0,d=t._vertexArrays,p=t.debugShowBoundingVolume,m=d.length,f=0;m>f;++f)for(var v=d[f],g=v.buckets,_=g.length,C=0;_>C;++C){for(var E,S,w,T=g[C],x=T.offset,b=o?T.bucket.shaderProgram:T.bucket.pickShaderProgram,A=T.bucket.polylines,P=A.length,M=0,R=0;P>R;++R){var O=A[R],N=F(O._material);if(N!==E){if(s(E)&&M>0){var L=S.isTranslucent();c>=u?(w=new y({owner:t}),r.push(w)):w=r[c],++c,w.boundingVolume=e.clone($,w.boundingVolume),w.modelMatrix=n,w.shaderProgram=b,w.vertexArray=v.va,w.renderState=L?t._translucentRS:t._opaqueRS,w.pass=L?I.TRANSLUCENT:I.OPAQUE,w.debugShowBoundingVolume=o?p:!1,w.uniformMap=S._uniforms,w.count=M,w.offset=x,x+=M,M=0,h=!0,l.push(w)}S=O._material,S.update(a),E=N}for(var B=O._locatorBuckets,V=B.length,k=0;V>k;++k){var z=B[k];z.locator===T&&(M+=z.count)}var U;i.mode===D.SCENE3D?U=O._boundingVolumeWC:i.mode===D.COLUMBUS_VIEW?U=O._boundingVolume2D:i.mode===D.SCENE2D?s(O._boundingVolume2D)&&(U=e.clone(O._boundingVolume2D,ee),U.center.x=0):s(O._boundingVolumeWC)&&s(O._boundingVolume2D)&&(U=e.union(O._boundingVolumeWC,O._boundingVolume2D,ee)),h?(h=!1,e.clone(U,$)):e.union(U,$,$)}s(E)&&M>0&&(c>=u?(w=new y({owner:t}),r.push(w)):w=r[c],++c,w.boundingVolume=e.clone($,w.boundingVolume),w.modelMatrix=n,w.shaderProgram=b,w.vertexArray=v.va,w.renderState=S.isTranslucent()?t._translucentRS:t._opaqueRS,w.pass=S.isTranslucent()?I.TRANSLUCENT:I.OPAQUE,w.debugShowBoundingVolume=o?p:!1,w.uniformMap=S._uniforms,w.count=M,w.offset=x,h=!0,l.push(w)),E=void 0}r.length=c}function N(e){for(var t=e._buffersUsage,i=!1,r=e._propertiesChanged,n=0;Q-2>n;++n){var o=t[n];r[n]?o.bufferUsage!==_.STREAM_DRAW?(i=!0,o.bufferUsage=_.STREAM_DRAW,o.frameCount=100):o.frameCount=100:o.bufferUsage!==_.STATIC_DRAW&&(0===o.frameCount?(i=!0,o.bufferUsage=_.STATIC_DRAW):o.frameCount--)}return i}function L(e,t,i){e._createVertexArray=!1,z(e),U(e),B(e);var r,n,a=[[]],l=a[0],u=[0],c=0,h=[[]],p=0,f=e._polylineBuckets;for(r in f)f.hasOwnProperty(r)&&(n=f[r],n.updateShader(t),p+=n.lengthOfPositions);if(p>0){var v,y=e._mode,C=new Float32Array(6*p*3),E=new Uint8Array(4*p),S=new Float32Array(4*p),T=0,x=0,b=0;for(r in f)if(f.hasOwnProperty(r)){n=f[r],n.write(C,E,S,T,x,b,t,i),y===D.MORPHING&&(s(v)||(v=new Float32Array(6*p*3)),n.writeForMorph(v,T));var A=n.lengthOfPositions;T+=6*A*3,x+=4*A,b+=4*A,c=n.updateIndices(a,u,h,c)}var P=e._buffersUsage[X].bufferUsage,I=e._buffersUsage[j].bufferUsage,M=e._buffersUsage[Y].bufferUsage,R=I===_.STREAM_DRAW||M===_.STREAM_DRAW?_.STREAM_DRAW:_.STATIC_DRAW; -e._positionBuffer=g.createVertexBuffer({context:t,typedArray:C,usage:P});var O;s(v)&&(O=g.createVertexBuffer({context:t,typedArray:v,usage:P})),e._pickColorBuffer=g.createVertexBuffer({context:t,typedArray:E,usage:_.STATIC_DRAW}),e._texCoordExpandWidthAndShowBuffer=g.createVertexBuffer({context:t,typedArray:S,usage:R});for(var N=4*Uint8Array.BYTES_PER_ELEMENT,L=3*Float32Array.BYTES_PER_ELEMENT,F=4*Float32Array.BYTES_PER_ELEMENT,V=0,k=a.length,G=0;k>G;++G)if(l=a[G],l.length>0){var W=new Uint16Array(l),H=g.createIndexBuffer({context:t,typedArray:W,usage:_.STATIC_DRAW,indexDatatype:d.UNSIGNED_SHORT});V+=u[G];var q,Z,K,Q,$=6*(G*(L*m.SIXTY_FOUR_KILOBYTES)-V*L),ee=L+$,ie=L+ee,re=L+ie,ne=L+re,oe=L+ne,ae=G*(N*m.SIXTY_FOUR_KILOBYTES)-V*N,se=G*(F*m.SIXTY_FOUR_KILOBYTES)-V*F,le=[{index:J.position3DHigh,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:$,strideInBytes:6*L},{index:J.position3DLow,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:ee,strideInBytes:6*L},{index:J.position2DHigh,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:$,strideInBytes:6*L},{index:J.position2DLow,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:ee,strideInBytes:6*L},{index:J.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:ie,strideInBytes:6*L},{index:J.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:re,strideInBytes:6*L},{index:J.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:ie,strideInBytes:6*L},{index:J.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:re,strideInBytes:6*L},{index:J.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:ne,strideInBytes:6*L},{index:J.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:oe,strideInBytes:6*L},{index:J.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:ne,strideInBytes:6*L},{index:J.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:oe,strideInBytes:6*L},{index:J.texCoordExpandWidthAndShow,componentsPerAttribute:4,componentDatatype:o.FLOAT,vertexBuffer:e._texCoordExpandWidthAndShowBuffer,offsetInBytes:se},{index:J.pickColor,componentsPerAttribute:4,componentDatatype:o.UNSIGNED_BYTE,vertexBuffer:e._pickColorBuffer,offsetInBytes:ae,normalize:!0}];y===D.SCENE3D?(q=e._positionBuffer,Z="vertexBuffer",K=te,Q="value"):y===D.SCENE2D||y===D.COLUMBUS_VIEW?(q=te,Z="value",K=e._positionBuffer,Q="vertexBuffer"):(q=O,Z="vertexBuffer",K=e._positionBuffer,Q="vertexBuffer"),le[0][Z]=q,le[1][Z]=q,le[2][Q]=K,le[3][Q]=K,le[4][Z]=q,le[5][Z]=q,le[6][Q]=K,le[7][Q]=K,le[8][Z]=q,le[9][Z]=q,le[10][Q]=K,le[11][Q]=K;var ue=new w({context:t,attributes:le,indexBuffer:H});e._vertexArrays.push({va:ue,buckets:h[G]})}}}function F(e){var t=P._uniformList[e.type],i=t.length;ie.length=2*i;for(var r=0,n=0;i>n;++n){var o=t[n];ie[r]=o,ie[r+1]=e._uniforms[o](),r+=2}return e.type+":"+JSON.stringify(ie)}function B(e){for(var t=e._mode,i=e._modelMatrix,r=e._polylineBuckets={},n=e._polylines,o=n.length,a=0;o>a;++a){var l=n[a];if(l._actualPositions.length>1){l.update();var u=l.material,c=r[u.type];s(c)||(c=r[u.type]=new H(u,t,i)),c.addPolyline(l)}}}function V(e,t){var i=t.mode;e._mode===i&&f.equals(e._modelMatrix,e.modelMatrix)||(e._mode=i,e._modelMatrix=f.clone(e.modelMatrix),e._createVertexArray=!0)}function k(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;for(var t=[],i=e._polylines.length,r=0,n=0;i>r;++r){var o=e._polylines[r];s(o)&&(o._index=n++,t.push(o))}e._polylines=t}}function z(e){for(var t=e._polylines,i=t.length,r=0;i>r;++r)if(s(t[r])){var n=t[r]._bucket;s(n)&&(n.shaderProgram=n.shaderProgram&&n.shaderProgram.destroy())}}function U(e){for(var t=e._vertexArrays.length,i=0;t>i;++i)e._vertexArrays[i].va.destroy();e._vertexArrays.length=0}function G(e){for(var t=e._polylines,i=t.length,r=0;i>r;++r)s(t[r])&&t[r]._destroy()}function W(e,t,i){this.count=e,this.offset=t,this.bucket=i}function H(e,t,i){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.pickShaderProgram=void 0,this.mode=t,this.modelMatrix=i}function q(e){return t.dot(t.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(v.ORIGIN_ZX_PLANE)===p.INTERSECTING}var j=M.SHOW_INDEX,Y=M.WIDTH_INDEX,X=M.POSITION_INDEX,Z=M.MATERIAL_INDEX,K=M.POSITION_SIZE_INDEX,Q=M.NUMBER_OF_PROPERTIES,J={texCoordExpandWidthAndShow:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12,pickColor:13};l(R.prototype,{length:{get:function(){return k(this),this._polylines.length}}}),R.prototype.add=function(e){var t=new M(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,t},R.prototype.remove=function(e){if(this.contains(e)){if(this._polylines[e._index]=void 0,this._polylinesRemoved=!0,this._createVertexArray=!0,s(e._bucket)){var t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy(),t.pickShaderProgram=t.pickShaderProgram&&t.pickShaderProgram.destroy()}return e._destroy(),!0}return!1},R.prototype.removeAll=function(){z(this),G(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0},R.prototype.contains=function(e){return s(e)&&e._polylineCollection===this},R.prototype.get=function(e){return k(this),this._polylines[e]},R.prototype.update=function(e,t){if(k(this),0!==this._polylines.length){V(this,e);var i,r=e.context,n=e.mapProjection,o=this._propertiesChanged;if(this._createVertexArray||N(this))L(this,r,n);else if(this._polylinesUpdated){var a=this._polylinesToUpdate;if(this._mode!==D.SCENE3D)for(var l=a.length,u=0;l>u;++u)i=a[u],i.update();if(o[K]||o[Z])L(this,r,n);else for(var c=a.length,h=this._polylineBuckets,d=0;c>d;++d){i=a[d],o=i._propertiesChanged;var p=i._bucket,m=0;for(var v in h)if(h.hasOwnProperty(v)){if(h[v]===p){(o[X]||o[j]||o[Y])&&p.writeUpdate(m,i,this._positionBuffer,this._texCoordExpandWidthAndShowBuffer,n);break}m+=h[v].lengthOfPositions}i._clean()}a.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(var g=0;Q>g;++g)o[g]=0;var _=f.IDENTITY;e.mode===D.SCENE3D&&(_=this.modelMatrix);var y=e.passes,E=0!==e.morphTime;if(s(this._opaqueRS)&&this._opaqueRS.depthTest.enabled===E||(this._opaqueRS=C.fromCache({depthMask:E,depthTest:{enabled:E}})),s(this._translucentRS)&&this._translucentRS.depthTest.enabled===E||(this._translucentRS=C.fromCache({blending:A.ALPHA_BLEND,depthMask:!E,depthTest:{enabled:E}})),y.render){var S=this._colorCommands;O(this,e,S,_,!0)}if(y.pick){var w=this._pickCommands;O(this,e,w,_,!1)}}};var $=new e,ee=new e;R.prototype.isDestroyed=function(){return!1},R.prototype.destroy=function(){return U(this),z(this),G(this),u(this)};var te=[0,0,0],ie=[];R.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,this._polylinesToUpdate.push(e),++this._propertiesChanged[t]},H.prototype.addPolyline=function(e){var t=this.polylines;t.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this},H.prototype.updateShader=function(e){if(!s(this.shaderProgram)){var t=new S({sources:[T,b]}),i=new S({sources:[this.material.shaderSource,x]}),r=new S({sources:i.sources,pickColorQualifier:"varying"});this.shaderProgram=E.fromCache({context:e,vertexShaderSource:t,fragmentShaderSource:i,attributeLocations:J}),this.pickShaderProgram=E.fromCache({context:e,vertexShaderSource:t,fragmentShaderSource:r,attributeLocations:J})}},H.prototype.getPolylinePositionsLength=function(e){var t;if(this.mode===D.SCENE3D||!q(e))return t=e._actualPositions.length,4*t-4;var i=0,r=e._segments.lengths;t=r.length;for(var n=0;t>n;++n)i+=4*r[n]-4;return i};var re=new t,ne=new t,oe=new t,ae=new t;H.prototype.write=function(e,i,r,o,a,s,l,u){for(var c=this.mode,d=this.polylines,p=d.length,m=0;p>m;++m)for(var f,v=d[m],g=v.width,_=v.show&&g>0,y=this.getSegments(v,u),C=y.positions,E=y.lengths,S=C.length,w=v.getPickId(l).color,T=0,x=0,b=0;S>b;++b){0===b?v._loop?f=C[S-2]:(f=ae,t.subtract(C[0],C[1],f),t.add(C[0],f,f)):f=C[b-1],ne.x=f.x,ne.y=f.y,ne.z=c!==D.SCENE2D?f.z:0,f=C[b],re.x=f.x,re.y=f.y,re.z=c!==D.SCENE2D?f.z:0,b===S-1?v._loop?f=C[1]:(f=ae,t.subtract(C[S-1],C[S-2],f),t.add(C[S-1],f,f)):f=C[b+1],oe.x=f.x,oe.y=f.y,oe.z=c!==D.SCENE2D?f.z:0;var A=E[T];b===x+A&&(x+=A,++T);for(var P=b-x===0,I=b===x+E[T]-1,M=P?2:0,R=I?2:4,O=M;R>O;++O){h.writeElements(re,e,o),h.writeElements(ne,e,o+6),h.writeElements(oe,e,o+12),i[a]=n.floatToByte(w.red),i[a+1]=n.floatToByte(w.green),i[a+2]=n.floatToByte(w.blue),i[a+3]=n.floatToByte(w.alpha);var N=0>O-2?-1:1;r[s]=b/(S-1),r[s+1]=2*(O%2)-1,r[s+2]=N*g,r[s+3]=_,o+=18,a+=4,s+=4}}};var se=new t,le=new t,ue=new t,ce=new t;H.prototype.writeForMorph=function(e,i){for(var r=this.modelMatrix,n=this.polylines,o=n.length,a=0;o>a;++a)for(var s=n[a],l=s._segments.positions,u=s._segments.lengths,c=l.length,d=0,p=0,m=0;c>m;++m){var v;0===m?s._loop?v=l[c-2]:(v=ce,t.subtract(l[0],l[1],v),t.add(l[0],v,v)):v=l[m-1],v=f.multiplyByPoint(r,v,le);var g,_=f.multiplyByPoint(r,l[m],se);m===c-1?s._loop?g=l[1]:(g=ce,t.subtract(l[c-1],l[c-2],g),t.add(l[c-1],g,g)):g=l[m+1],g=f.multiplyByPoint(r,g,ue);var y=u[d];m===p+y&&(p+=y,++d);for(var C=m-p===0,E=m===p+u[d]-1,S=C?2:0,w=E?2:4,T=S;w>T;++T)h.writeElements(_,e,i),h.writeElements(v,e,i+6),h.writeElements(g,e,i+12),i+=18}};var he=new Array(1);H.prototype.updateIndices=function(e,t,i,r){var n=i.length-1,o=new W(0,r,this);i[n].push(o);var a=0,s=e[e.length-1],l=0;s.length>0&&(l=s[s.length-1]+1);for(var u=this.polylines,c=u.length,h=0;c>h;++h){var d=u[h];d._locatorBuckets=[];var p;if(this.mode===D.SCENE3D){p=he;var f=d._actualPositions.length;if(!(f>0))continue;p[0]=f}else p=d._segments.lengths;var v=p.length;if(v>0){for(var g=0,_=0;v>_;++_)for(var y=p[_]-1,C=0;y>C;++C)l+4>=m.SIXTY_FOUR_KILOBYTES-2&&(d._locatorBuckets.push({locator:o,count:g}),g=0,t.push(4),s=[],e.push(s),l=0,o.count=a,a=0,r=0,o=new W(0,0,this),i[++n]=[o]),s.push(l,l+2,l+1),s.push(l+1,l+2,l+3),g+=6,a+=6,r+=6,l+=4;d._locatorBuckets.push({locator:o,count:g}),l+4>=m.SIXTY_FOUR_KILOBYTES-2&&(t.push(0),s=[],e.push(s),l=0,o.count=a,r=0,a=0,o=new W(0,0,this),i[++n]=[o])}d._clean()}return o.count=a,r},H.prototype.getPolylineStartIndex=function(e){for(var t=this.polylines,i=0,r=t.length,n=0;r>n;++n){var o=t[n];if(o===e)break;i+=o._actualLength}return i};var de={positions:void 0,lengths:void 0},pe=new Array(1),me=new t,fe=new r;H.prototype.getSegments=function(i,r){var n=i._actualPositions;if(this.mode===D.SCENE3D)return pe[0]=n.length,de.positions=n,de.lengths=pe,de;q(i)&&(n=i._segments.positions);for(var o,a=r.ellipsoid,s=[],l=this.modelMatrix,u=n.length,c=me,h=0;u>h;++h)o=n[h],c=f.multiplyByPoint(l,o,c),s.push(r.project(a.cartesianToCartographic(c,fe)));if(s.length>0){i._boundingVolume2D=e.fromPoints(s,i._boundingVolume2D);var d=i._boundingVolume2D.center;i._boundingVolume2D.center=new t(d.z,d.x,d.y)}return de.positions=s,de.lengths=i._segments.lengths,de};var ve,ge;return H.prototype.writeUpdate=function(e,i,r,n,o){var a=this.mode,l=i._actualLength;if(l){e+=this.getPolylineStartIndex(i);var u=ve,c=ge,d=6*l*3;!s(u)||u.lengthd&&(u=new Float32Array(u.buffer,0,d),c=new Float32Array(c.buffer,0,4*l));var p,m=0,f=0,v=this.getSegments(i,o),g=v.positions,_=v.lengths,y=0,C=0,E=i.width,S=i.show&&E>0;l=g.length;for(var w=0;l>w;++w){0===w?i._loop?p=g[l-2]:(p=ae,t.subtract(g[0],g[1],p),t.add(g[0],p,p)):p=g[w-1],ne.x=p.x,ne.y=p.y,ne.z=a!==D.SCENE2D?p.z:0,p=g[w],re.x=p.x,re.y=p.y,re.z=a!==D.SCENE2D?p.z:0,w===l-1?i._loop?p=g[1]:(p=ae,t.subtract(g[l-1],g[l-2],p),t.add(g[l-1],p,p)):p=g[w+1],oe.x=p.x,oe.y=p.y,oe.z=a!==D.SCENE2D?p.z:0;var T=_[y];w===C+T&&(C+=T,++y);for(var x=w-C===0,b=w===C+_[y]-1,A=x?2:0,P=b?2:4,I=A;P>I;++I){h.writeElements(re,u,m),h.writeElements(ne,u,m+6),h.writeElements(oe,u,m+12);var M=0>I-2?-1:1;c[f]=w/(l-1),c[f+1]=2*(I%2)-1,c[f+2]=M*E,c[f+3]=S,m+=18,f+=4}}r.copyFromArrayView(u,18*Float32Array.BYTES_PER_ELEMENT*e),n.copyFromArrayView(c,4*Float32Array.BYTES_PER_ELEMENT*e)}},R}),i("DataSources/ScaledPositionProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/ReferenceFrame","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(e){this._definitionChanged=new n,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}return t(s.prototype,{isConstant:{get:function(){return a.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return e(this._value)?this._value.referenceFrame:o.FIXED}}}),s.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,o.FIXED,t)},s.prototype.setValue=function(t){this._value!==t&&(this._value=t,e(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),e(t)&&(this._removeSubscription=t.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))},s.prototype.getValueInReferenceFrame=function(t,i,n){return e(this._value)?(n=this._value.getValueInReferenceFrame(t,i,n),e(n)?r.WGS84.scaleToGeodeticSurface(n,n):void 0):void 0},s.prototype.equals=function(e){return this===e||e instanceof s&&this._value===e._value},s.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},s}),i("DataSources/PathVisualizer",["../Core/AssociativeArray","../Core/Cartesian3","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/JulianDate","../Core/Matrix3","../Core/Matrix4","../Core/ReferenceFrame","../Core/TimeInterval","../Core/Transforms","../Scene/PolylineCollection","../Scene/SceneMode","./CompositePositionProperty","./ConstantPositionProperty","./MaterialProperty","./Property","./ReferenceProperty","./SampledPositionProperty","./ScaledPositionProperty","./TimeIntervalCollectionPositionProperty"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C){"use strict";function E(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function S(e,t,r,n,a,s,l,u,c){var h,d=u;h=e.getValueInReferenceFrame(t,s,c[d]),i(h)&&(c[d++]=h);for(var p,m,f,v=!i(a)||o.lessThanOrEquals(a,t)||o.greaterThanOrEquals(a,r),g=0,_=n.length,y=n[g],C=r,E=!1;_>g;){if(!v&&o.greaterThanOrEquals(y,a)&&(h=e.getValueInReferenceFrame(a,s,c[d]),i(h)&&(c[d++]=h),v=!0),o.greaterThan(y,t)&&o.lessThan(y,C)&&!y.equals(a)&&(h=e.getValueInReferenceFrame(y,s,c[d]),i(h)&&(c[d++]=h)),_-1>g){if(l>0&&!E){var S=n[g+1],w=o.secondsDifference(S,y);E=w>l,E&&(p=Math.ceil(w/l),m=0,f=w/Math.max(p,2),p=Math.max(p-1,1))}if(E&&p>m){y=o.addSeconds(y,f,new o),m++;continue}}E=!1,g++,y=n[g]}return h=e.getValueInReferenceFrame(r,s,c[d]),i(h)&&(c[d++]=h),d}function w(e,t,r,n,a,s,l,u){for(var c,h=0,d=l,p=t,m=Math.max(s,60),f=!i(n)||o.lessThanOrEquals(n,t)||o.greaterThanOrEquals(n,r);o.lessThan(p,r);)!f&&o.greaterThanOrEquals(p,n)&&(f=!0,c=e.getValueInReferenceFrame(n,a,u[d]),i(c)&&(u[d]=c,d++)),c=e.getValueInReferenceFrame(p,a,u[d]),i(c)&&(u[d]=c,d++),h++,p=o.addSeconds(t,m*h,new o);return c=e.getValueInReferenceFrame(r,a,u[d]),i(c)&&(u[d]=c,d++),d}function T(e,t,r,n,a,s,l,c){L.start=t,L.stop=r;for(var h=l,d=e.intervals,p=0;p0){var T=S.pop();c=this._polylineCollection.get(T),t.index=T}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=a,t.polyline=c}var x=v.getValueOrDefault(s._resolution,e,D);c.show=!0,c.positions=P(l,r,n,e,this._referenceFrame,x,c.positions.slice()),c.material=f.getValue(e,s._material,c.material),c.width=v.getValueOrDefault(s._width,e,R)},I.prototype.removeObject=function(e){var t=e.polyline;i(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,e.index=void 0)},I.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),r(this)},M.prototype.update=function(e){var t=this._updaters;for(var r in t)t.hasOwnProperty(r)&&t[r].update(e);for(var n=this._items.values,o=0,a=n.length;a>o;o++){var s=n[o],u=s.entity,c=u._position,h=s.updater,p=l.FIXED;this._scene.mode===d.SCENE3D&&(p=c.referenceFrame);var m=this._updaters[p];h===m&&i(m)?m.updateObject(e,s):(i(h)&&h.removeObject(s),i(m)||(m=new I(this._scene,p),m.update(e),this._updaters[p]=m),s.updater=m,i(m)&&m.updateObject(e,s))}return!0},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(M.prototype._onCollectionChanged,this);var e=this._updaters;for(var t in e)e.hasOwnProperty(t)&&e[t].destroy();return r(this)},M.prototype._onCollectionChanged=function(e,t,r,n){var o,a,s,l=this._items;for(o=t.length-1;o>-1;o--)a=t[o],i(a._path)&&i(a._position)&&l.set(a.id,new E(a));for(o=n.length-1;o>-1;o--)a=n[o],i(a._path)&&i(a._position)?l.contains(a.id)||l.set(a.id,new E(a)):(s=l.get(a.id),i(s)&&(s.updater.removeObject(s),l.remove(a.id)));for(o=r.length-1;o>-1;o--)a=r[o],s=l.get(a.id),i(s)&&(s.updater.removeObject(s),l.remove(a.id))},M._subSample=P,M}),i("Shaders/PointPrimitiveCollectionFS",[],function(){"use strict";return"varying vec4 v_color;\nvarying vec4 v_outlineColor;\nvarying float v_innerPercent;\nvarying float v_pixelDistance;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#endif\nvoid main()\n{\nfloat distanceToCenter = length(gl_PointCoord - vec2(0.5));\nfloat maxDistance = max(0.0, 0.5 - v_pixelDistance);\nfloat wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);\nfloat innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter);\nvec4 color = mix(v_outlineColor, v_color, innerAlpha);\ncolor.a *= wholeAlpha;\nif (color.a < 0.005)\n{\ndiscard;\n}\n#ifdef RENDER_FOR_PICK\ngl_FragColor = v_pickColor;\n#else\ngl_FragColor = color;\n#endif\n}\n"}),i("Shaders/PointPrimitiveCollectionVS",[],function(){"use strict";return"uniform float u_maxTotalPointSize;\nattribute vec4 positionHighAndSize;\nattribute vec4 positionLowAndOutline;\nattribute vec4 compressedAttribute0;\nattribute vec4 compressedAttribute1;\nattribute vec4 scaleByDistance;\nvarying vec4 v_color;\nvarying vec4 v_outlineColor;\nvarying float v_innerPercent;\nvarying float v_pixelDistance;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#endif\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nvoid main()\n{\nvec3 positionHigh = positionHighAndSize.xyz;\nvec3 positionLow = positionLowAndOutline.xyz;\nfloat outlineWidthBothSides = 2.0 * positionLowAndOutline.w;\nfloat totalSize = positionHighAndSize.w + outlineWidthBothSides;\nfloat outlinePercent = outlineWidthBothSides / totalSize;\ntotalSize *= czm_resolutionScale;\ntotalSize += 3.0;\nfloat temp = compressedAttribute1.x * SHIFT_RIGHT8;\nfloat show = floor(temp);\n#ifdef EYE_DISTANCE_TRANSLUCENCY\nvec4 translucencyByDistance;\ntranslucencyByDistance.x = compressedAttribute1.z;\ntranslucencyByDistance.z = compressedAttribute1.w;\ntranslucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\ntemp = compressedAttribute1.y * SHIFT_RIGHT8;\ntranslucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n#endif\nvec4 color;\nvec4 outlineColor;\n#ifdef RENDER_FOR_PICK\ncolor = vec4(0.0);\noutlineColor = vec4(0.0);\nvec4 pickColor;\ntemp = compressedAttribute0.z * SHIFT_RIGHT8;\npickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\npickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\npickColor.r = floor(temp);\n#else\ntemp = compressedAttribute0.x * SHIFT_RIGHT8;\ncolor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\ncolor.g = (temp - floor(temp)) * SHIFT_LEFT8;\ncolor.r = floor(temp);\ntemp = compressedAttribute0.y * SHIFT_RIGHT8;\noutlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\noutlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\noutlineColor.r = floor(temp);\n#endif\ntemp = compressedAttribute0.w * SHIFT_RIGHT8;\n#ifdef RENDER_FOR_PICK\npickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\npickColor = pickColor / 255.0;\n#endif\ntemp = floor(temp) * SHIFT_RIGHT8;\noutlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\noutlineColor /= 255.0;\ncolor.a = floor(temp);\ncolor /= 255.0;\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\npositionEC.xyz *= show;\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY)\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\n}\n#endif\n#ifdef EYE_DISTANCE_SCALING\ntotalSize *= czm_nearFarScalar(scaleByDistance, lengthSq);\n#endif\ntotalSize = min(totalSize, u_maxTotalPointSize);\nif (totalSize < 1.0)\n{\npositionEC.xyz = vec3(0.0);\ntotalSize = 1.0;\n}\nfloat translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\ntranslucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\nif (translucency < 0.004)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\nv_color = color;\nv_color.a *= translucency;\nv_outlineColor = outlineColor;\nv_outlineColor.a *= translucency;\nv_innerPercent = 1.0 - outlinePercent;\nv_pixelDistance = 2.0 / totalSize;\ngl_PointSize = totalSize;\n#ifdef RENDER_FOR_PICK\nv_pickColor = pickColor;\n#endif\n}\n"}),i("Scene/PointPrimitive",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","../Core/NearFarScalar","./SceneMode","./SceneTransforms"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(e,i){e=n(e,n.EMPTY_OBJECT),this._show=n(e.show,!0),this._position=t.clone(n(e.position,t.ZERO)),this._actualPosition=t.clone(this._position),this._color=r.clone(n(e.color,r.WHITE)),this._outlineColor=r.clone(n(e.outlineColor,r.TRANSPARENT)),this._outlineWidth=n(e.outlineWidth,0),this._pixelSize=n(e.pixelSize,10),this._scaleByDistance=e.scaleByDistance,this._translucencyByDistance=e.translucencyByDistance,this._id=e.id,this._collection=n(e.collection,i),this._pickId=void 0,this._pointPrimitiveCollection=i,this._dirty=!1,this._index=-1}function p(e,t){var i=e._pointPrimitiveCollection;o(i)&&(i._updatePointPrimitive(e,t),e._dirty=!0)}var m=d.SHOW_INDEX=0,f=d.POSITION_INDEX=1,v=d.COLOR_INDEX=2,g=d.OUTLINE_COLOR_INDEX=3,_=d.OUTLINE_WIDTH_INDEX=4,y=d.PIXEL_SIZE_INDEX=5,C=d.SCALE_BY_DISTANCE_INDEX=6,E=d.TRANSLUCENCY_BY_DISTANCE_INDEX=7;d.NUMBER_OF_PROPERTIES=8,a(d.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,p(this,m))}},position:{get:function(){return this._position},set:function(e){var i=this._position;t.equals(i,e)||(t.clone(e,i),t.clone(e,this._actualPosition),p(this,f))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;u.equals(t,e)||(this._scaleByDistance=u.clone(e,t),p(this,C))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;u.equals(t,e)||(this._translucencyByDistance=u.clone(e,t),p(this,E))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,p(this,y))}},color:{get:function(){return this._color},set:function(e){var t=this._color;r.equals(t,e)||(r.clone(e,t),p(this,v))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){var t=this._outlineColor;r.equals(t,e)||(r.clone(e,t),p(this,g))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,p(this,_))}},id:{get:function(){return this._id},set:function(e){this._id=e,o(this._pickId)&&(this._pickId.object.id=e)}}}),d.prototype.getPickId=function(e){return o(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId},d.prototype._getActualPosition=function(){return this._actualPosition},d.prototype._setActualPosition=function(e){t.clone(e,this._actualPosition),p(this,f)};var S=new i;d._computeActualPosition=function(e,t,i){return t.mode===c.SCENE3D?e:(l.multiplyByPoint(i,e,S),h.computeActualWgs84Position(t,S))};var w=new l,T=new i;return d._computeScreenSpacePosition=function(e,t,r,n){var o=r.camera,a=o.viewMatrix,s=o.frustum.projectionMatrix,u=l.multiplyTransformation(a,e,w),c=l.multiplyByVector(u,i.fromElements(t.x,t.y,t.z,1,T),T),d=l.multiplyByVector(s,c,T),p=h.clipToGLWindowCoordinates(r,d,n);return p},d.prototype.computeScreenSpacePosition=function(t,i){var r=this._pointPrimitiveCollection;o(i)||(i=new e);var n=r.modelMatrix,a=d._computeScreenSpacePosition(n,this._actualPosition,t,i);return a.y=t.canvas.clientHeight-a.y,a},d.prototype.equals=function(e){return this===e||o(e)&&this._id===e._id&&t.equals(this._position,e._position)&&r.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&r.equals(this._outlineColor,e._outlineColor)&&u.equals(this._scaleByDistance,e._scaleByDistance)&&u.equals(this._translucencyByDistance,e._translucencyByDistance)},d.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0},d}),i("Scene/PointPrimitiveCollection",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/Math","../Core/Matrix4","../Core/PrimitiveType","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArrayFacade","../Shaders/PointPrimitiveCollectionFS","../Shaders/PointPrimitiveCollectionVS","./BlendingState","./Pass","./PointPrimitive","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x,b){"use strict";function A(t){t=o(t,o.EMPTY_OBJECT),this._sp=void 0,this._rs=void 0,this._vaf=void 0,this._spPick=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._compiledShaderScaleByDistancePick=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistancePick=!1,this._propertiesChanged=new Uint32Array(Y),this._maxPixelSize=1,this._baseVolume=new e,this._baseVolumeWC=new e,this._baseVolume2D=new e,this._boundingVolume=new e,this._boundingVolumeDirty=!1,this._colorCommands=[],this._pickCommands=[],this.modelMatrix=d.clone(o(t.modelMatrix,d.IDENTITY)),this._modelMatrix=d.clone(d.IDENTITY),this.debugShowBoundingVolume=o(t.debugShowBoundingVolume,!1),this._mode=b.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[m.STATIC_DRAW,m.STATIC_DRAW,m.STATIC_DRAW,m.STATIC_DRAW,m.STATIC_DRAW,m.STATIC_DRAW,m.STATIC_DRAW,m.STATIC_DRAW];var i=this;this._uniforms={u_maxTotalPointSize:function(){return i._maxTotalPointSize}}}function P(e){for(var t=e.length,i=0;t>i;++i)e[i]&&e[i]._destroy()}function I(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;for(var t=[],i=e._pointPrimitives,r=i.length,n=0,o=0;r>n;++n){var a=i[n];a&&(a._index=o++,t.push(a))}e._pointPrimitives=t}}function M(e,t,i){return new C(e,[{index:X.positionHighAndSize,componentsPerAttribute:4,componentDatatype:n.FLOAT,usage:i[z]},{index:X.positionLowAndShow,componentsPerAttribute:4,componentDatatype:n.FLOAT,usage:i[z]},{index:X.compressedAttribute0,componentsPerAttribute:4,componentDatatype:n.FLOAT,usage:i[U]},{index:X.compressedAttribute1,componentsPerAttribute:4,componentDatatype:n.FLOAT,usage:i[j]},{index:X.scaleByDistance,componentsPerAttribute:4,componentDatatype:n.FLOAT,usage:i[q]}],t)}function D(t,i,r,n){var o=n._index,a=n._getActualPosition();t._mode===b.SCENE3D&&(e.expand(t._baseVolume,a,t._baseVolume),t._boundingVolumeDirty=!0),c.fromCartesian(a,Z);var s=n.pixelSize,l=n.outlineWidth;t._maxPixelSize=Math.max(t._maxPixelSize,s+l);var u=r[X.positionHighAndSize],h=Z.high;u(o,h.x,h.y,h.z,s);var d=r[X.positionLowAndOutline],p=Z.low;d(o,p.x,p.y,p.z,l)}function R(e,t,i,n){var o=n._index,a=n.color,s=n.getPickId(t).color,l=n.outlineColor,u=r.floatToByte(a.red),c=r.floatToByte(a.green),h=r.floatToByte(a.blue),d=u*K+c*Q+h;u=r.floatToByte(l.red),c=r.floatToByte(l.green),h=r.floatToByte(l.blue);var p=u*K+c*Q+h;u=r.floatToByte(s.red),c=r.floatToByte(s.green),h=r.floatToByte(s.blue);var m=u*K+c*Q+h,f=r.floatToByte(a.alpha)*K+r.floatToByte(l.alpha)*Q+r.floatToByte(s.alpha),v=i[X.compressedAttribute0];v(o,d,p,m,f)}function O(e,t,i,r){var n=r._index,o=0,s=1,l=1,u=1,c=r.translucencyByDistance;a(c)&&(o=c.near,s=c.nearValue,l=c.far,u=c.farValue,(1!==s||1!==u)&&(e._shaderTranslucencyByDistance=!0));var d=r.show;0===r.color.alpha&&0===r.outlineColor.alpha&&(d=!1),s=h.clamp(s,0,1),s=1===s?255:255*s|0;var p=(d?1:0)*Q+s;u=h.clamp(u,0,1),u=1===u?255:255*u|0;var m=u,f=i[X.compressedAttribute1];f(n,p,m,o,l)}function N(e,t,i,r){var n=r._index,o=i[X.scaleByDistance],s=0,l=1,u=1,c=1,h=r.scaleByDistance;a(h)&&(s=h.near, -l=h.nearValue,u=h.far,c=h.farValue,(1!==l||1!==c)&&(e._shaderScaleByDistance=!0)),o(n,s,l,u,c)}function L(e,t,i,r){D(e,t,i,r),R(e,t,i,r),O(e,t,i,r),N(e,t,i,r)}function F(t,i,r,n,o,s){var l;n.mode===b.SCENE3D?(l=t._baseVolume,t._boundingVolumeDirty=!0):l=t._baseVolume2D;for(var u=[],c=0;r>c;++c){var h=i[c],d=h.position,p=x._computeActualPosition(d,n,o);a(p)&&(h._setActualPosition(p),s?u.push(p):e.expand(l,p,l))}s&&e.fromPoints(u,l)}function B(e,t){var i=t.mode,r=e._pointPrimitives,n=e._pointPrimitivesToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==i||i!==b.SCENE3D&&!d.equals(o,e.modelMatrix)?(e._mode=i,d.clone(e.modelMatrix,o),e._createVertexArray=!0,(i===b.SCENE3D||i===b.SCENE2D||i===b.COLUMBUS_VIEW)&&F(e,r,r.length,t,o,!0)):i===b.MORPHING?F(e,r,r.length,t,o,!0):(i===b.SCENE2D||i===b.COLUMBUS_VIEW)&&F(e,n,e._pointPrimitivesToUpdateIndex,t,o,!1)}function V(e,t,i){var r=t.camera.getPixelSize(i,t.context.drawingBufferWidth,t.context.drawingBufferHeight),n=r*e._maxPixelSize;i.radius+=n}var k=x.SHOW_INDEX,z=x.POSITION_INDEX,U=x.COLOR_INDEX,G=x.OUTLINE_COLOR_INDEX,W=x.OUTLINE_WIDTH_INDEX,H=x.PIXEL_SIZE_INDEX,q=x.SCALE_BY_DISTANCE_INDEX,j=x.TRANSLUCENCY_BY_DISTANCE_INDEX,Y=x.NUMBER_OF_PROPERTIES,X={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4};s(A.prototype,{length:{get:function(){return I(this),this._pointPrimitives.length}}}),A.prototype.add=function(e){var t=new x(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t},A.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1},A.prototype.removeAll=function(){P(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0},A.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]},A.prototype.contains=function(e){return a(e)&&e._pointPrimitiveCollection===this},A.prototype.get=function(e){return I(this),this._pointPrimitives[e]},A.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,i=this._propertiesChanged,r=0;Y>r;++r){var n=0===i[r]?m.STATIC_DRAW:m.STREAM_DRAW;t=t||e[r]!==n,e[r]=n}return t};var Z=new c,K=65536,Q=256,J=[];return A.prototype.update=function(t){I(this),this._maxTotalPointSize=f.maximumAliasedPointSize,B(this,t);var i,r=this._pointPrimitives,n=r.length,o=this._pointPrimitivesToUpdate,s=this._pointPrimitivesToUpdateIndex,l=this._propertiesChanged,u=this._createVertexArray,c=t.context,h=t.passes,m=h.pick;if(u||!m&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var C=0;Y>C;++C)l[C]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=M(c,n,this._buffersUsage),i=this._vaf.writers;for(var x=0;n>x;++x){var A=this._pointPrimitives[x];A._dirty=!1,L(this,c,i,A)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(s>0){var P=J;P.length=0,(l[z]||l[W]||l[H])&&P.push(D),(l[U]||l[G])&&P.push(R),(l[k]||l[j])&&P.push(O),l[q]&&P.push(N);var F=P.length;if(i=this._vaf.writers,s/n>.1){for(var Z=0;s>Z;++Z){var K=o[Z];K._dirty=!1;for(var Q=0;F>Q;++Q)P[Q](this,c,i,K)}this._vaf.commit()}else{for(var $=0;s>$;++$){var ee=o[$];ee._dirty=!1;for(var te=0;F>te;++te)P[te](this,c,i,ee);this._vaf.subCommit(ee._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(s>1.5*n&&(o.length=n),a(this._vaf)&&a(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,e.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var ie,re=d.IDENTITY;t.mode===b.SCENE3D?(re=this.modelMatrix,ie=e.clone(this._baseVolumeWC,this._boundingVolume)):ie=e.clone(this._baseVolume2D,this._boundingVolume),V(this,t,ie);var ne,oe,ae,se,le,ue,ce=t.commandList;if(h.render){var he=this._colorCommands;for(a(this._rs)||(this._rs=g.fromCache({depthTest:{enabled:!0},blending:w.ALPHA_BLEND})),(!a(this._sp)||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance)&&(le=new y({sources:[S]}),this._shaderScaleByDistance&&le.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&le.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._sp=_.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:le,fragmentShaderSource:E,attributeLocations:X}),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance),ne=this._vaf.va,oe=ne.length,he.length=oe,se=0;oe>se;++se)ae=he[se],a(ae)||(ae=he[se]=new v({primitiveType:p.POINTS,pass:T.OPAQUE,owner:this})),ae.boundingVolume=ie,ae.modelMatrix=re,ae.shaderProgram=this._sp,ae.uniformMap=this._uniforms,ae.vertexArray=ne[se].va,ae.renderState=this._rs,ae.debugShowBoundingVolume=this.debugShowBoundingVolume,ce.push(ae)}if(m){var de=this._pickCommands;for((!a(this._spPick)||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistancePick||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistancePick)&&(le=new y({defines:["RENDER_FOR_PICK"],sources:[S]}),this._shaderScaleByDistance&&le.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&le.defines.push("EYE_DISTANCE_TRANSLUCENCY"),ue=new y({defines:["RENDER_FOR_PICK"],sources:[E]}),this._spPick=_.replaceCache({context:c,shaderProgram:this._spPick,vertexShaderSource:le,fragmentShaderSource:ue,attributeLocations:X}),this._compiledShaderScaleByDistancePick=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistancePick=this._shaderTranslucencyByDistance),ne=this._vaf.va,oe=ne.length,de.length=oe,se=0;oe>se;++se)ae=de[se],a(ae)||(ae=de[se]=new v({primitiveType:p.POINTS,pass:T.OPAQUE,owner:this})),ae.boundingVolume=ie,ae.modelMatrix=re,ae.shaderProgram=this._spPick,ae.uniformMap=this._uniforms,ae.vertexArray=ne[se].va,ae.renderState=this._rs,ce.push(ae)}}},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),P(this._pointPrimitives),l(this)},A}),i("DataSources/PointVisualizer",["../Core/AssociativeArray","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/NearFarScalar","../Scene/PointPrimitiveCollection","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e){this.entity=e,this.pointPrimitive=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function h(t,i){i.collectionChanged.addEventListener(h.prototype._onCollectionChanged,this),this._scene=t,this._unusedIndexes=[],this._entityCollection=i,this._pointPrimitiveCollection=void 0,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}function d(e,t){if(r(e)){var i=e.pointPrimitive;r(i)&&(e.pointPrimitive=void 0,i.show=!1,t.push(i._index))}}var p=i.WHITE,m=i.BLACK,f=0,v=1,g=new i,_=new t,y=new i,C=new a,E=new a;return h.prototype.update=function(e){for(var t=this._items.values,i=this._unusedIndexes,n=0,o=t.length;o>n;n++){var a=t[n],l=a.entity,c=l._point,h=a.pointPrimitive,S=l.isShowing&&l.isAvailable(e)&&u.getValueOrDefault(c._show,e,!0);if(S&&(_=u.getValueOrUndefined(l._position,e,_),S=r(_)),S){if(!r(h)){var w=this._pointPrimitiveCollection;r(w)||(w=new s,this._pointPrimitiveCollection=w,this._scene.primitives.add(w));var T=i.length;h=T>0?w.get(i.pop()):w.add(),h.id=l,a.pointPrimitive=h}h.show=!0,h.position=_,h.scaleByDistance=u.getValueOrUndefined(c._scaleByDistance,e,C),h.translucencyByDistance=u.getValueOrUndefined(c._translucencyByDistance,e,E),h.color=u.getValueOrDefault(c._color,e,p,g),h.outlineColor=u.getValueOrDefault(c._outlineColor,e,m,y),h.outlineWidth=u.getValueOrDefault(c._outlineWidth,e,f),h.pixelSize=u.getValueOrDefault(c._pixelSize,e,v)}else d(a,i)}return!0},h.prototype.getBoundingSphere=function(e,i){var n=this._items.get(e.id);return r(n)&&r(n.pointPrimitive)?(i.center=t.clone(n.pointPrimitive.position,i.center),i.radius=0,l.DONE):l.FAILED},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){return this._entityCollection.collectionChanged.removeEventListener(h.prototype._onCollectionChanged,this),r(this._pointPrimitiveCollection)&&this._scene.primitives.remove(this._pointPrimitiveCollection),n(this)},h.prototype._onCollectionChanged=function(e,t,i,n){var o,a,s=this._unusedIndexes,l=this._items;for(o=t.length-1;o>-1;o--)a=t[o],r(a._point)&&r(a._position)&&l.set(a.id,new c(a));for(o=n.length-1;o>-1;o--)a=n[o],r(a._point)&&r(a._position)?l.contains(a.id)||l.set(a.id,new c(a)):(d(l.get(a.id),s),l.remove(a.id));for(o=i.length-1;o>-1;o--)a=i[o],d(l.get(a.id),s),l.remove(a.id)},h}),i("DataSources/PolygonGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/isArray","../Core/Iso8601","../Core/PolygonGeometry","../Core/PolygonHierarchy","../Core/PolygonOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S){"use strict";function w(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0}function T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new s,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new w(e),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new w(t._entity)}var b=new _(e.WHITE),A=new y(!0),P=new y(!0),I=new y(!1),M=new y(e.BLACK),D=new e;return n(T,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:f}}),n(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&S.isConstant(this._showProperty)&&S.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&S.isConstant(this._showProperty)&&S.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new m(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i));if(this._materialProperty instanceof _){var c=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(c=this._materialProperty.color.getValue(i)),o=t.fromColor(c),n={show:u,color:o}}else n={show:u};return new l({id:a,geometry:new h(this._options),attributes:n})},T.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=S.getValueOrDefault(this._outlineColorProperty,i,e.BLACK);return new l({id:r,geometry:new p(this._options),attributes:{show:new m(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),o(this)},T.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"polygon"===t){var a=this._entity.polygon;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=r(s)&&s.isConstant?s.getValue(c.MINIMUM_VALUE):!0,h=a.outline,p=r(h);if(p&&h.isConstant&&(p=h.getValue(c.MINIMUM_VALUE)),!l&&!p)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var m=a.hierarchy,g=a.show;if(r(g)&&g.isConstant&&!g.getValue(c.MINIMUM_VALUE)||!r(m))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var y=i(a.material,b),C=y instanceof _;this._materialProperty=y,this._fillProperty=i(s,P),this._showProperty=i(g,A),this._showOutlineProperty=i(a.outline,I),this._outlineColorProperty=p?i(a.outlineColor,M):void 0;var E=a.height,w=a.extrudedHeight,T=a.granularity,x=a.stRotation,D=a.outlineWidth,R=a.perPositionHeight;if(this._fillEnabled=l,this._outlineEnabled=p,m.isConstant&&S.isConstant(E)&&S.isConstant(w)&&S.isConstant(T)&&S.isConstant(x)&&S.isConstant(D)&&S.isConstant(R)){var O=this._options;O.vertexFormat=C?v.VERTEX_FORMAT:f.MaterialSupport.TEXTURED.vertexFormat;var N=m.getValue(c.MINIMUM_VALUE);u(N)&&(N=new d(N));var L=r(E)?E.getValue(c.MINIMUM_VALUE):void 0,F=r(w)?w.getValue(c.MINIMUM_VALUE):void 0;O.polygonHierarchy=N,O.height=L,O.extrudedHeight=F,O.granularity=r(T)?T.getValue(c.MINIMUM_VALUE):void 0,O.stRotation=r(x)?x.getValue(c.MINIMUM_VALUE):void 0,O.perPositionHeight=r(R)?R.getValue(c.MINIMUM_VALUE):void 0,this._outlineWidth=r(D)?D.getValue(c.MINIMUM_VALUE):1,this._isClosed=r(F)&&F!==L,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(i){var n=this._primitives;n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var o=this._geometryUpdater,a=o._entity,s=a.polygon;if(a.isShowing&&a.isAvailable(i)&&S.getValueOrDefault(s.show,i,!0)){var c=this._options,m=S.getValueOrUndefined(s.hierarchy,i);if(r(m)){if(u(m)?c.polygonHierarchy=new d(m):c.polygonHierarchy=m,c.height=S.getValueOrUndefined(s.height,i),c.extrudedHeight=S.getValueOrUndefined(s.extrudedHeight,i),c.granularity=S.getValueOrUndefined(s.granularity,i),c.stRotation=S.getValueOrUndefined(s.stRotation,i),c.perPositionHeight=S.getValueOrUndefined(s.perPositionHeight,i),S.getValueOrDefault(s.fill,i,!0)){var _=E.getValue(i,o.fillMaterialProperty,this._material);this._material=_;var y=new f({material:_,translucent:_.isTranslucent(),closed:r(c.extrudedHeight)&&c.extrudedHeight!==c.height});c.vertexFormat=y.vertexFormat,this._primitive=n.add(new g({geometryInstances:new l({id:a,geometry:new h(c)}),appearance:y,asynchronous:!1}))}if(S.getValueOrDefault(s.outline,i,!1)){c.vertexFormat=v.VERTEX_FORMAT;var C=S.getValueOrClonedDefault(s.outlineColor,i,e.BLACK,D),w=S.getValueOrDefault(s.outlineWidth,i,1),T=1!==C.alpha;this._outlinePrimitive=n.add(new g({geometryInstances:new l({id:a,geometry:new p(c),attributes:{color:t.fromColor(C)}}),appearance:new v({flat:!0,translucent:T,renderState:{lineWidth:o._scene.clampLineWidth(w)}}),asynchronous:!1}))}}}},x.prototype.getBoundingSphere=function(e,t){return C(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},T}),i("Shaders/Appearances/PolylineColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec4 color;\nvarying vec4 v_color;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nv_color = color;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n"}),i("Scene/PolylineColorAppearance",["../Core/defaultValue","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS","../Shaders/Appearances/PolylineColorAppearanceVS","../Shaders/PolylineCommon","./Appearance"],function(e,t,i,r,n,o,a){"use strict";function s(t){t=e(t,e.EMPTY_OBJECT);var i=e(t.translucent,!0),r=!1,n=s.VERTEX_FORMAT;this.material=void 0,this.translucent=i,this._vertexShaderSource=e(t.vertexShaderSource,l),this._fragmentShaderSource=e(t.fragmentShaderSource,u),this._renderState=a.getDefaultRenderState(i,r,t.renderState),this._closed=r,this._vertexFormat=n}var l=o+"\n"+n,u=r;return t(s.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),s.VERTEX_FORMAT=i.POSITION_ONLY,s.prototype.getFragmentShaderSource=a.prototype.getFragmentShaderSource,s.prototype.isTranslucent=a.prototype.isTranslucent,s.prototype.getRenderState=a.prototype.getRenderState,s}),i("Shaders/Appearances/PolylineMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec2 st;\nvarying float v_width;\nvarying vec2 v_st;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nv_width = width;\nv_st = st;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n"}),i("Scene/PolylineMaterialAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PolylineMaterialAppearanceVS","../Shaders/PolylineCommon","../Shaders/PolylineFS","./Appearance","./Material"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.translucent,!0),n=!1,o=u.VERTEX_FORMAT;this.material=t(i.material)?i.material:l.fromType(l.ColorType),this.translucent=r,this._vertexShaderSource=e(i.vertexShaderSource,c),this._fragmentShaderSource=e(i.fragmentShaderSource,h),this._renderState=s.getDefaultRenderState(r,n,i.renderState),this._closed=n,this._vertexFormat=o}var c=o+"\n"+n,h=a;return i(u.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),u.VERTEX_FORMAT=r.POSITION_AND_ST,u.prototype.getFragmentShaderSource=s.prototype.getFragmentShaderSource,u.prototype.isTranslucent=s.prototype.isTranslucent,u.prototype.getRenderState=s.prototype.getRenderState,u}),i("DataSources/PolylineGeometryUpdater",["../Core/BoundingSphere","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/PolylineGeometry","../Core/PolylinePipeline","../Core/ShowGeometryInstanceAttribute","../Scene/PolylineCollection","../Scene/PolylineColorAppearance","../Scene/PolylineMaterialAppearance","./BoundingSphereState","./ColorMaterialProperty","./ConstantProperty","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S){"use strict";function w(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.followSurface=void 0,this.granularity=void 0}function T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._options=new w(e),this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}function x(e,t){var i=t._scene.id,r=b[i];!n(r)||r.isDestroyed()?(r=new f,b[i]=r,e.add(r)):e.contains(r)||e.add(r);var o=r.add();o.id=t._entity,this._line=o,this._primitives=e,this._geometryUpdater=t,this._positions=[],I.ellipsoid=t._scene.globe.ellipsoid}var b={},A=new y(t.WHITE),P=new C(!0);o(T,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:g}}),o(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!n(this._entity.availability)&&S.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){return!1},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(e){var r,o,a=this._entity,s=a.isAvailable(e),l=new m(s&&a.isShowing&&this._showProperty.getValue(e));if(this._materialProperty instanceof y){var u=t.WHITE;n(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(u=this._materialProperty.color.getValue(e)),r=i.fromColor(u),o={show:l,color:r}}else o={show:l};return new c({id:a,geometry:new d(this._options),attributes:o})},T.prototype.createOutlineGeometryInstance=function(e){},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),a(this)},T.prototype._onEntityPropertyChanged=function(e,t,i,o){if("availability"===t||"polyline"===t){var a=this._entity.polyline;if(!n(a))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.positions,l=a.show;if(n(l)&&l.isConstant&&!l.getValue(h.MINIMUM_VALUE)||!n(s))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var u=r(a.material,A),c=u instanceof y;this._materialProperty=u,this._showProperty=r(l,P),this._fillEnabled=!0;var d=a.width,p=a.followSurface,m=a.granularity;if(s.isConstant&&S.isConstant(d)&&S.isConstant(p)&&S.isConstant(m)){var f=this._options,_=s.getValue(h.MINIMUM_VALUE,f.positions);if(!n(_)||_.length<2)return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));f.vertexFormat=c?v.VERTEX_FORMAT:g.VERTEX_FORMAT,f.positions=_,f.width=n(d)?d.getValue(h.MINIMUM_VALUE):void 0,f.followSurface=n(p)?p.getValue(h.MINIMUM_VALUE):void 0,f.granularity=n(m)?m.getValue(h.MINIMUM_VALUE):void 0,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)};var I={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};return x.prototype.update=function(e){var t=this._geometryUpdater,i=t._entity,r=i.polyline,o=this._line;if(!i.isShowing||!i.isAvailable(e)||!S.getValueOrDefault(r._show,e,!0))return void(o.show=!1);var a=r.positions,s=S.getValueOrUndefined(a,e,this._positions);if(!n(s)||s.length<2)return void(o.show=!1);var l=S.getValueOrDefault(r._followSurface,e,!0);l&&(I.positions=s,I.granularity=S.getValueOrUndefined(r._granularity,e),I.height=p.extractHeights(s,this._geometryUpdater._scene.globe.ellipsoid),s=p.generateCartesianArc(I)),o.show=!0,o.positions=s.slice(),o.material=E.getValue(e,t.fillMaterialProperty,o.material),o.width=S.getValueOrDefault(r._width,e,1)},x.prototype.getBoundingSphere=function(t,i){var r=this._line;return r.show&&r.positions.length>0?(e.fromPoints(r.positions,i),_.DONE):_.FAILED},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._geometryUpdater,t=e._scene.id,i=b[t];i.remove(this._line),0===i.length&&(this._primitives.removeAndDestroy(i),delete b[t]),a(this)},T}),i("DataSources/PolylineVolumeGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/PolylineVolumeGeometry","../Core/PolylineVolumeOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C){"use strict";function E(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function S(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(S.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new s,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new E(e),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}function w(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new E(t._entity)}var T=new v(e.WHITE),x=new g(!0),b=new g(!0),A=new g(!1),P=new g(e.BLACK),I=new e;return n(S,{perInstanceColorAppearanceType:{value:m},materialAppearanceType:{value:p}}),n(S.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&C.isConstant(this._showProperty)&&C.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&C.isConstant(this._showProperty)&&C.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),S.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},S.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},S.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new d(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i));if(this._materialProperty instanceof v){var h=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(h=this._materialProperty.color.getValue(i)),o=t.fromColor(h),n={show:u,color:o}}else n={show:u};return new l({id:a,geometry:new c(this._options),attributes:n})},S.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=C.getValueOrDefault(this._outlineColorProperty,i,e.BLACK);return new l({id:r,geometry:new h(this._options),attributes:{show:new d(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o)}})},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){this._entitySubscription(),o(this)},S.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"polylineVolume"===t){var a=this._entity.polylineVolume;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=r(s)&&s.isConstant?s.getValue(u.MINIMUM_VALUE):!0,c=a.outline,h=r(c);if(h&&c.isConstant&&(h=c.getValue(u.MINIMUM_VALUE)),!l&&!h)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=a.positions,f=a.shape,g=a.show;if(!r(d)||!r(f)||r(g)&&g.isConstant&&!g.getValue(u.MINIMUM_VALUE))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var _=i(a.material,T),y=_ instanceof v;this._materialProperty=_,this._fillProperty=i(s,b),this._showProperty=i(g,x),this._showOutlineProperty=i(a.outline,A),this._outlineColorProperty=h?i(a.outlineColor,P):void 0;var E=a.granularity,S=a.outlineWidth,w=a.cornerType;if(this._fillEnabled=l,this._outlineEnabled=h,d.isConstant&&f.isConstant&&C.isConstant(E)&&C.isConstant(S)&&C.isConstant(w)){var I=this._options;I.vertexFormat=y?m.VERTEX_FORMAT:p.MaterialSupport.TEXTURED.vertexFormat,I.polylinePositions=d.getValue(u.MINIMUM_VALUE,I.polylinePositions),I.shapePositions=f.getValue(u.MINIMUM_VALUE,I.shape),I.granularity=r(E)?E.getValue(u.MINIMUM_VALUE):void 0,I.cornerType=r(w)?w.getValue(u.MINIMUM_VALUE):void 0,this._outlineWidth=r(S)?S.getValue(u.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},S.prototype.createDynamicUpdater=function(e){return new w(e,this)},w.prototype.update=function(i){var n=this._primitives;n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var o=this._geometryUpdater,a=o._entity,s=a.polylineVolume;if(a.isShowing&&a.isAvailable(i)&&C.getValueOrDefault(s.show,i,!0)){var u=this._options,d=C.getValueOrUndefined(s.positions,i,u.polylinePositions),v=C.getValueOrUndefined(s.shape,i);if(r(d)&&r(v)){if(u.polylinePositions=d,u.shapePositions=v,u.granularity=C.getValueOrUndefined(s.granularity,i),u.cornerType=C.getValueOrUndefined(s.cornerType,i), -!r(s.fill)||s.fill.getValue(i)){var g=y.getValue(i,o.fillMaterialProperty,this._material);this._material=g;var _=new p({material:g,translucent:g.isTranslucent(),closed:!0});u.vertexFormat=_.vertexFormat,this._primitive=n.add(new f({geometryInstances:new l({id:a,geometry:new c(u)}),appearance:_,asynchronous:!1}))}if(r(s.outline)&&s.outline.getValue(i)){u.vertexFormat=m.VERTEX_FORMAT;var E=C.getValueOrClonedDefault(s.outlineColor,i,e.BLACK,I),S=C.getValueOrDefault(s.outlineWidth,i,1),w=1!==E.alpha;this._outlinePrimitive=n.add(new f({geometryInstances:new l({id:a,geometry:new h(u),attributes:{color:t.fromColor(E)}}),appearance:new m({flat:!0,translucent:w,renderState:{lineWidth:o._scene.clampLineWidth(S)}}),asynchronous:!1}))}}}},w.prototype.getBoundingSphere=function(e,t){return _(e,this._primitive,this._outlinePrimitive,t)},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},S}),i("DataSources/RectangleGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/RectangleGeometry","../Core/RectangleOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C){"use strict";function E(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.closeBottom=void 0,this.closeTop=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0}function S(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(S.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new s,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new E(e),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}function w(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new E(t._entity)}var T=new v(e.WHITE),x=new g(!0),b=new g(!0),A=new g(!1),P=new g(e.BLACK),I=new e;return n(S,{perInstanceColorAppearanceType:{value:m},materialAppearanceType:{value:p}}),n(S.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&C.isConstant(this._showProperty)&&C.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&C.isConstant(this._showProperty)&&C.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},geometryChanged:{get:function(){return this._geometryChanged}}}),S.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},S.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},S.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new d(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i));if(this._materialProperty instanceof v){var h=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(h=this._materialProperty.color.getValue(i)),o=t.fromColor(h),n={show:u,color:o}}else n={show:u};return new l({id:a,geometry:new c(this._options),attributes:n})},S.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=C.getValueOrDefault(this._outlineColorProperty,i,e.BLACK);return new l({id:r,geometry:new h(this._options),attributes:{show:new d(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o)}})},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){this._entitySubscription(),o(this)},S.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"rectangle"===t){var a=this._entity.rectangle;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=r(s)&&s.isConstant?s.getValue(u.MINIMUM_VALUE):!0,c=a.outline,h=r(c);if(h&&c.isConstant&&(h=c.getValue(u.MINIMUM_VALUE)),!l&&!h)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=a.coordinates,f=a.show;if(r(f)&&f.isConstant&&!f.getValue(u.MINIMUM_VALUE)||!r(d))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var g=i(a.material,T),_=g instanceof v;this._materialProperty=g,this._fillProperty=i(s,b),this._showProperty=i(f,x),this._showOutlineProperty=i(a.outline,A),this._outlineColorProperty=h?i(a.outlineColor,P):void 0;var y=a.height,E=a.extrudedHeight,S=a.granularity,w=a.stRotation,I=a.rotation,M=a.outlineWidth,D=a.closeBottom,R=a.closeTop;if(this._fillEnabled=l,this._outlineEnabled=h,d.isConstant&&C.isConstant(y)&&C.isConstant(E)&&C.isConstant(S)&&C.isConstant(w)&&C.isConstant(I)&&C.isConstant(M)&&C.isConstant(D)&&C.isConstant(R)){var O=this._options;O.vertexFormat=_?m.VERTEX_FORMAT:p.MaterialSupport.TEXTURED.vertexFormat,O.rectangle=d.getValue(u.MINIMUM_VALUE,O.rectangle),O.height=r(y)?y.getValue(u.MINIMUM_VALUE):void 0,O.extrudedHeight=r(E)?E.getValue(u.MINIMUM_VALUE):void 0,O.granularity=r(S)?S.getValue(u.MINIMUM_VALUE):void 0,O.stRotation=r(w)?w.getValue(u.MINIMUM_VALUE):void 0,O.rotation=r(I)?I.getValue(u.MINIMUM_VALUE):void 0,O.closeBottom=r(D)?D.getValue(u.MINIMUM_VALUE):void 0,O.closeTop=r(R)?R.getValue(u.MINIMUM_VALUE):void 0,this._isClosed=r(E)&&r(O.closeTop)&&r(O.closeBottom)&&O.closeTop&&O.closeBottom,this._outlineWidth=r(M)?M.getValue(u.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},S.prototype.createDynamicUpdater=function(e){return new w(e,this)},w.prototype.update=function(i){var n=this._primitives;n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var o=this._geometryUpdater,a=o._entity,s=a.rectangle;if(a.isShowing&&a.isAvailable(i)&&C.getValueOrDefault(s.show,i,!0)){var u=this._options,d=C.getValueOrUndefined(s.coordinates,i,u.rectangle);if(r(d)){if(u.rectangle=d,u.height=C.getValueOrUndefined(s.height,i),u.extrudedHeight=C.getValueOrUndefined(s.extrudedHeight,i),u.granularity=C.getValueOrUndefined(s.granularity,i),u.stRotation=C.getValueOrUndefined(s.stRotation,i),u.rotation=C.getValueOrUndefined(s.rotation,i),u.closeBottom=C.getValueOrUndefined(s.closeBottom,i),u.closeTop=C.getValueOrUndefined(s.closeTop,i),C.getValueOrDefault(s.fill,i,!0)){var v=y.getValue(i,o.fillMaterialProperty,this._material);this._material=v;var g=new p({material:v,translucent:v.isTranslucent(),closed:r(u.extrudedHeight)});u.vertexFormat=g.vertexFormat,this._primitive=n.add(new f({geometryInstances:new l({id:a,geometry:new c(u)}),appearance:g,asynchronous:!1}))}if(C.getValueOrDefault(s.outline,i,!1)){u.vertexFormat=m.VERTEX_FORMAT;var _=C.getValueOrClonedDefault(s.outlineColor,i,e.BLACK,I),E=C.getValueOrDefault(s.outlineWidth,i,1),S=1!==_.alpha;this._outlinePrimitive=n.add(new f({geometryInstances:new l({id:a,geometry:new h(u),attributes:{color:t.fromColor(_)}}),appearance:new m({flat:!0,translucent:S,renderState:{lineWidth:o._scene.clampLineWidth(E)}}),asynchronous:!1}))}}}},w.prototype.getBoundingSphere=function(e,t){return _(e,this._primitive,this._outlinePrimitive,t)},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},S}),i("DataSources/WallGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Core/WallGeometry","../Core/WallOutlineGeometry","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C){"use strict";function E(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function S(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(S.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new s,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new E(e),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}function w(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new E(t._entity)}var T=new v(e.WHITE),x=new g(!0),b=new g(!0),A=new g(!1),P=new g(e.BLACK),I=new e;return n(S,{perInstanceColorAppearanceType:{value:m},materialAppearanceType:{value:p}}),n(S.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&C.isConstant(this._showProperty)&&C.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&C.isConstant(this._showProperty)&&C.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return!1}},geometryChanged:{get:function(){return this._geometryChanged}}}),S.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},S.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},S.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new c(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i));if(this._materialProperty instanceof v){var d=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(d=this._materialProperty.color.getValue(i)),o=t.fromColor(d),n={show:u,color:o}}else n={show:u};return new l({id:a,geometry:new h(this._options),attributes:n})},S.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=C.getValueOrDefault(this._outlineColorProperty,i,e.BLACK);return new l({id:r,geometry:new d(this._options),attributes:{show:new c(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o)}})},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){this._entitySubscription(),o(this)},S.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"wall"===t){var a=this._entity.wall;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=r(s)&&s.isConstant?s.getValue(u.MINIMUM_VALUE):!0,c=a.outline,h=r(c);if(h&&c.isConstant&&(h=c.getValue(u.MINIMUM_VALUE)),!l&&!h)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=a.positions,f=a.show;if(r(f)&&f.isConstant&&!f.getValue(u.MINIMUM_VALUE)||!r(d))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var g=i(a.material,T),_=g instanceof v;this._materialProperty=g,this._fillProperty=i(s,b),this._showProperty=i(f,x),this._showOutlineProperty=i(a.outline,A),this._outlineColorProperty=h?i(a.outlineColor,P):void 0;var y=a.minimumHeights,E=a.maximumHeights,S=a.outlineWidth,w=a.granularity;if(this._fillEnabled=l,this._outlineEnabled=h,d.isConstant&&C.isConstant(y)&&C.isConstant(E)&&C.isConstant(S)&&C.isConstant(w)){var I=this._options;I.vertexFormat=_?m.VERTEX_FORMAT:p.MaterialSupport.TEXTURED.vertexFormat,I.positions=d.getValue(u.MINIMUM_VALUE,I.positions),I.minimumHeights=r(y)?y.getValue(u.MINIMUM_VALUE,I.minimumHeights):void 0,I.maximumHeights=r(E)?E.getValue(u.MINIMUM_VALUE,I.maximumHeights):void 0,I.granularity=r(w)?w.getValue(u.MINIMUM_VALUE):void 0,this._outlineWidth=r(S)?S.getValue(u.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},S.prototype.createDynamicUpdater=function(e){return new w(e,this)},w.prototype.update=function(i){var n=this._primitives;n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var o=this._geometryUpdater,a=o._entity,s=a.wall;if(a.isShowing&&a.isAvailable(i)&&C.getValueOrDefault(s.show,i,!0)){var u=this._options,c=C.getValueOrUndefined(s.positions,i,u.positions);if(r(c)){if(u.positions=c,u.minimumHeights=C.getValueOrUndefined(s.minimumHeights,i,u.minimumHeights),u.maximumHeights=C.getValueOrUndefined(s.maximumHeights,i,u.maximumHeights),u.granularity=C.getValueOrUndefined(s.granularity,i),C.getValueOrDefault(s.fill,i,!0)){var v=y.getValue(i,o.fillMaterialProperty,this._material);this._material=v;var g=new p({material:v,translucent:v.isTranslucent(),closed:r(u.extrudedHeight)});u.vertexFormat=g.vertexFormat,this._primitive=n.add(new f({geometryInstances:new l({id:a,geometry:new h(u)}),appearance:g,asynchronous:!1}))}if(C.getValueOrDefault(s.outline,i,!1)){u.vertexFormat=m.VERTEX_FORMAT;var _=C.getValueOrClonedDefault(s.outlineColor,i,e.BLACK,I),E=C.getValueOrDefault(s.outlineWidth,i,1),S=1!==_.alpha;this._outlinePrimitive=n.add(new f({geometryInstances:new l({id:a,geometry:new d(u),attributes:{color:t.fromColor(_)}}),appearance:new m({flat:!0,translucent:S,renderState:{lineWidth:o._scene.clampLineWidth(E)}}),asynchronous:!1}))}}}},w.prototype.getBoundingSphere=function(e,t){return _(e,this._primitive,this._outlinePrimitive,t)},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},S}),i("DataSources/DataSourceDisplay",["../Core/BoundingSphere","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EventHelper","./BillboardVisualizer","./BoundingSphereState","./BoxGeometryUpdater","./CorridorGeometryUpdater","./CustomDataSource","./CylinderGeometryUpdater","./EllipseGeometryUpdater","./EllipsoidGeometryUpdater","./GeometryVisualizer","./LabelVisualizer","./ModelVisualizer","./PathVisualizer","./PointVisualizer","./PolygonGeometryUpdater","./PolylineGeometryUpdater","./PolylineVolumeGeometryUpdater","./RectangleGeometryUpdater","./WallGeometryUpdater"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T){"use strict";function x(e){var i=e.scene,r=e.dataSourceCollection;this._eventHelper=new a,this._eventHelper.add(r.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(r.dataSourceRemoved,this._onDataSourceRemoved,this),this._dataSourceCollection=r,this._scene=i,this._visualizersCallback=t(e.visualizersCallback,x.defaultVisualizersCallback);for(var n=0,o=r.length;o>n;n++)this._onDataSourceAdded(r,r.get(n));var s=new h;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s}x.defaultVisualizersCallback=function(e,t){var i=t.entities;return[new s(e,i),new f(u,e,i),new f(d,e,i),new f(c,e,i),new f(p,e,i),new f(m,e,i),new f(C,e,i),new f(E,e,i),new f(S,e,i),new f(w,e,i),new f(T,e,i),new v(e,i),new g(e,i),new y(e,i),new _(e,i)]},r(x.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}}}),x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){this._eventHelper.removeAll();for(var e=this._dataSourceCollection,t=0,i=e.length;i>t;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),n(this)},x.prototype.update=function(e){var t,r,n,o,a=!0,s=this._dataSourceCollection,l=s.length;for(t=0;l>t;t++){var u=s.get(t);for(i(u.update)&&(a=u.update(e)&&a),n=u._visualizers,o=n.length,r=0;o>r;r++)a=n[r].update(e)&&a}for(n=this._defaultDataSource._visualizers,o=n.length,r=0;o>r;r++)a=n[r].update(e)&&a;return a};var b=[],A=new e;return x.prototype.getBoundingSphere=function(t,r,n){var o,a,s=this._defaultDataSource;if(!s.entities.contains(t)){s=void 0;var u=this._dataSourceCollection;for(a=u.length,o=0;a>o;o++){var c=u.get(o);if(c.entities.contains(t)){s=c;break}}}if(!i(s))return l.FAILED;var h=b,d=A,p=0,m=l.DONE,f=s._visualizers,v=f.length;for(o=0;v>o;o++){var g=f[o];if(i(g.getBoundingSphere)){if(m=f[o].getBoundingSphere(t,d),!r&&m===l.PENDING)return l.PENDING;m===l.DONE&&(h[p]=e.clone(d,h[p]),p++)}}return 0===p?l.FAILED:(h.length=p,e.fromBoundingSpheres(h,n),l.DONE)},x.prototype._onDataSourceAdded=function(e,t){var i=this._visualizersCallback(this._scene,t);t._visualizers=i},x.prototype._onDataSourceRemoved=function(e,t){for(var i=t._visualizers,r=i.length,n=0;r>n;n++)i[n].destroy(),t._visualizers=void 0},x}),i("DataSources/DynamicGeometryUpdater",["../Core/DeveloperError"],function(e){"use strict";function t(){e.throwInstantiationError()}return t.prototype.update=e.throwInstantiationError,t.prototype.getBoundingSphere=e.throwInstantiationError,t.prototype.isDestroyed=e.throwInstantiationError,t.prototype.destroy=e.throwInstantiationError,t}),i("DataSources/EntityView",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/HeadingPitchRange","../Core/JulianDate","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Transforms","../Scene/SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e,i,r,o,a,s,l){var d=e.scene.mode,f=a.getValue(s,e._lastCartesian);if(n(f)){var v,I,M,D=!1;if(d===m.SCENE3D){A=u.addSeconds(s,.001,A);var R=a.getValue(A,E);if(n(R)){var O,N=p.computeFixedToIcrfMatrix(s,g),L=p.computeFixedToIcrfMatrix(A,_);n(N)&&n(L)?O=h.transpose(N,y):(O=p.computeTemeToPseudoFixedMatrix(s,y),N=h.transpose(O,g),L=p.computeTemeToPseudoFixedMatrix(A,_),h.transpose(L,L));var F=h.multiplyByVector(N,f,x),B=h.multiplyByVector(L,R,b);t.subtract(F,B,T);var V=1e3*t.magnitude(T),k=3986004418e5,z=-k/(V*V-2*k/t.magnitude(F));0>z||z>P*l.maximumRadius?(v=S,t.normalize(f,v),t.negate(v,v),M=t.clone(t.UNIT_Z,w),I=t.cross(M,v,E),t.magnitude(I)>c.EPSILON7&&(t.normalize(v,v),t.normalize(I,I),M=t.cross(v,I,w),t.normalize(M,M),D=!0)):t.equalsEpsilon(f,R,c.EPSILON7)||(M=S,t.normalize(F,M),t.normalize(B,B),I=t.cross(M,B,w),t.equalsEpsilon(I,t.ZERO,c.EPSILON7)||(v=t.cross(I,M,E),h.multiplyByVector(O,v,v),h.multiplyByVector(O,I,I),h.multiplyByVector(O,M,M),t.normalize(v,v),t.normalize(I,I),t.normalize(M,M),D=!0))}}n(e._boundingSphereOffset)&&t.add(e._boundingSphereOffset,f,f);var U,G,W;o&&(U=t.clone(i.position,T),G=t.clone(i.direction,x),W=t.clone(i.up,b));var H=C;D?(H[0]=v.x,H[1]=v.y,H[2]=v.z,H[3]=0,H[4]=I.x,H[5]=I.y,H[6]=I.z,H[7]=0,H[8]=M.x,H[9]=M.y,H[10]=M.z,H[11]=0,H[12]=f.x,H[13]=f.y,H[14]=f.z,H[15]=0):p.eastNorthUpToFixedFrame(f,l,H),i._setTransform(H),o&&(t.clone(U,i.position),t.clone(G,i.direction),t.clone(W,i.up),t.cross(G,W,i.right))}if(r){var q=d===m.SCENE2D||t.equals(e._offset3D,t.ZERO)?void 0:e._offset3D;i.lookAtTransform(i.transform,q)}}function v(i,n,o,a){this.entity=i,this.scene=n,this.ellipsoid=r(o,s.WGS84),this.boundingSphere=e.clone(a),this._boundingSphereOffset=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new t,this._defaultOffset3D=void 0,this._offset3D=new t}var g=new h,_=new h,y=new h,C=new d,E=new t,S=new t,w=new t,T=new t,x=new t,b=new t,A=new u,P=1.25;o(v,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=t.clone(e,new t)}}}),v.defaultOffset3D=new t(-14e3,3500,3500);var I=new l,M=new t;return v.prototype.update=function(e){var i=this.scene,r=this.entity,o=this.ellipsoid,a=i.mode;if(a!==m.MORPHING){var s=r.position,l=r!==this._lastEntity,u=a!==this._mode,h=this._offset3D,d=i.camera,p=l||u,g=!0;if(l){var _=r.viewFrom,y=n(_),C=this.boundingSphere;if(this._boundingSphereOffset=void 0,!y&&n(C)){var E=i.screenSpaceCameraController;E.minimumZoomDistance=Math.min(E.minimumZoomDistance,.5*C.radius),I.pitch=-c.PI_OVER_FOUR,I.range=0;var S=s.getValue(e,M);if(n(S)){var w=2-1/Math.max(1,t.magnitude(S)/o.maximumRadius);I.pitch*=w}d.viewBoundingSphere(C,I),this._boundingSphereOffset=t.subtract(C.center,r.position.getValue(e),new t),p=!1,g=!1}else y&&n(_.getValue(e,h))||t.clone(v._defaultOffset3D,h)}else u||i.mode===m.MORPHING||this._mode===m.SCENE2D||t.clone(d.position,h);this._lastEntity=r,this._mode=i.mode!==m.MORPHING?i.mode:this._mode,i.mode!==m.MORPHING&&f(this,d,p,g,s,e,o)}},v}),!function(){function e(e,t){function i(t){var i,r=e.arcs[0>t?~t:t],n=r[0];return e.transform?(i=[0,0],r.forEach(function(e){i[0]+=e[0],i[1]+=e[1]})):i=r[r.length-1],0>t?[i,n]:[n,i]}function r(e,t){for(var i in e){var r=e[i];delete t[r.start],delete r.start,delete r.end,r.forEach(function(e){n[0>e?~e:e]=1}),s.push(r)}}var n={},o={},a={},s=[],l=-1;return t.forEach(function(i,r){var n,o=e.arcs[0>i?~i:i];o.length<3&&!o[1][0]&&!o[1][1]&&(n=t[++l],t[l]=i,t[r]=n)}),t.forEach(function(e){var t,r,n=i(e),s=n[0],l=n[1];if(t=a[s])if(delete a[t.end],t.push(e),t.end=l,r=o[l]){delete o[r.start];var u=r===t?t:t.concat(r);o[u.start=t.start]=a[u.end=r.end]=u}else o[t.start]=a[t.end]=t;else if(t=o[l])if(delete o[t.start],t.unshift(e),t.start=s,r=a[s]){delete a[r.end];var c=r===t?t:r.concat(t);o[c.start=r.start]=a[c.end=t.end]=c}else o[t.start]=a[t.end]=t;else t=[e],o[t.start=s]=a[t.end=l]=t}),r(a,o),r(o,a),t.forEach(function(e){n[0>e?~e:e]||s.push([e])}),s}function t(t,i,r){function n(e){var t=0>e?~e:e;(c[t]||(c[t]=[])).push({i:e,g:u})}function o(e){e.forEach(n)}function a(e){e.forEach(o)}function s(e){"GeometryCollection"===e.type?e.geometries.forEach(s):e.type in h&&(u=e,h[e.type](e.arcs))}var l=[];if(arguments.length>1){var u,c=[],h={LineString:o,MultiLineString:a,Polygon:a,MultiPolygon:function(e){e.forEach(a)}};s(i),c.forEach(arguments.length<3?function(e){l.push(e[0].i)}:function(e){r(e[0].g,e[e.length-1].g)&&l.push(e[0].i)})}else for(var d=0,p=t.arcs.length;p>d;++d)l.push(d);return{type:"MultiLineString",arcs:e(t,l)}}function r(t,i){function r(e){e.forEach(function(t){t.forEach(function(t){(a[t=0>t?~t:t]||(a[t]=[])).push(e)})}),l.push(e)}function o(e){return d(s(t,{type:"Polygon",arcs:[e]}).coordinates[0])>0}var a={},l=[],u=[];return i.forEach(function(e){"Polygon"===e.type?r(e.arcs):"MultiPolygon"===e.type&&e.arcs.forEach(r)}),l.forEach(function(e){if(!e._){var t=[],i=[e];for(e._=1,u.push(t);e=i.pop();)t.push(e),e.forEach(function(e){e.forEach(function(e){a[0>e?~e:e].forEach(function(e){e._||(e._=1,i.push(e))})})})}}),l.forEach(function(e){delete e._}),{type:"MultiPolygon",arcs:u.map(function(i){var r=[];if(i.forEach(function(e){e.forEach(function(e){e.forEach(function(e){a[0>e?~e:e].length<2&&r.push(e)})})}),r=e(t,r),(n=r.length)>1)for(var s,l=o(i[0][0]),u=0;ue?~e:e],n=0,o=r.length;o>n;++n)t.push(i=r[n].slice()),u(i,n);0>e&&l(t,o)}function r(e){return e=e.slice(),u(e,0),e}function n(e){for(var t=[],r=0,n=e.length;n>r;++r)i(e[r],t);return t.length<2&&t.push(t[0].slice()),t}function o(e){for(var t=n(e);t.length<4;)t.push(t[0].slice());return t}function a(e){return e.map(o)}function s(e){var t=e.type;return"GeometryCollection"===t?{type:t,geometries:e.geometries.map(s)}:t in h?{type:t,coordinates:h[t](e)}:null}var u=v(e.transform),c=e.arcs,h={Point:function(e){return r(e.coordinates)},MultiPoint:function(e){return e.coordinates.map(r)},LineString:function(e){return n(e.arcs)},MultiLineString:function(e){return e.arcs.map(n)},Polygon:function(e){return a(e.arcs)},MultiPolygon:function(e){return e.arcs.map(a)}};return s(t)}function l(e,t){for(var i,r=e.length,n=r-t;n<--r;)i=e[n],e[n++]=e[r],e[r]=i}function u(e,t){for(var i=0,r=e.length;r>i;){var n=i+r>>>1;e[n]e&&(e=~e);var i=n[e];i?i.push(t):n[e]=[t]})}function i(e,i){e.forEach(function(e){t(e,i)})}function r(e,t){"GeometryCollection"===e.type?e.geometries.forEach(function(e){r(e,t)}):e.type in a&&a[e.type](e.arcs,t)}var n={},o=e.map(function(){return[]}),a={LineString:t,MultiLineString:i,Polygon:i,MultiPolygon:function(e,t){e.forEach(function(e){i(e,t)})}};e.forEach(r);for(var s in n)for(var l=n[s],c=l.length,h=0;c>h;++h)for(var d=h+1;c>d;++d){var p,m=l[h],f=l[d];(p=o[m])[s=u(p,f)]!==f&&p.splice(s,0,f),(p=o[f])[s=u(p,m)]!==m&&p.splice(s,0,m)}return o}function h(e,t){function i(e){o.remove(e),e[1][2]=t(e),o.push(e)}var r=v(e.transform),n=g(e.transform),o=f();return t||(t=p),e.arcs.forEach(function(e){for(var a,s,l=[],u=0,c=0,h=e.length;h>c;++c)s=e[c],r(e[c]=[s[0],s[1],1/0],c);for(var c=1,h=e.length-1;h>c;++c)a=e.slice(c-1,c+2),a[1][2]=t(a),l.push(a),o.push(a);for(var c=0,h=l.length;h>c;++c)a=l[c],a.previous=l[c-1],a.next=l[c+1];for(;a=o.pop();){var d=a.previous,p=a.next;a[1][2]0;){var i=(t+1>>1)-1,n=r[i];if(m(e,n)>=0)break;r[n._=t]=n,r[e._=t=i]=e}}function t(e,t){for(;;){var i=t+1<<1,o=i-1,a=t,s=r[a];if(n>o&&m(r[o],s)<0&&(s=r[a=o]),n>i&&m(r[i],s)<0&&(s=r[a=i]),a===t)break;r[s._=t]=s,r[e._=t=a]=e}}var i={},r=[],n=0;return i.push=function(t){return e(r[t._=n]=t,n++),n},i.pop=function(){if(!(0>=n)){var e,i=r[0];return--n>0&&(e=r[n],t(r[e._=0]=e,0)),i}},i.remove=function(i){var o,a=i._;if(r[a]===i)return a!==--n&&(o=r[n],(m(o,i)<0?e:t)(r[o._=a]=o,a)),a},i}function v(e){if(!e)return _;var t,i,r=e.scale[0],n=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=i=0),e[0]=(t+=e[0])*r+o,e[1]=(i+=e[1])*n+a}}function g(e){if(!e)return _;var t,i,r=e.scale[0],n=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=i=0);var l=(e[0]-o)/r|0,u=(e[1]-a)/n|0;e[0]=l-t,e[1]=u-i,t=l,i=u}}function _(){}var y={version:"1.6.18",mesh:function(e){return s(e,t.apply(this,arguments))},meshArcs:t,merge:function(e){return s(e,r.apply(this,arguments))},mergeArcs:r,feature:o,neighbors:c,presimplify:h};"function"==typeof i&&i.amd?i("ThirdParty/topojson",y):"object"==typeof module&&module.exports?module.exports=y:this.topojson=y}(),i("DataSources/GeoJsonDataSource",["../Core/Cartesian3","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/definedNotNull","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/getFilenameFromUri","../Core/loadJson","../Core/PinBuilder","../Core/PolygonHierarchy","../Core/RuntimeError","../Scene/VerticalOrigin","../ThirdParty/topojson","../ThirdParty/when","./BillboardGraphics","./CallbackProperty","./ColorMaterialProperty","./ConstantPositionProperty","./ConstantProperty","./DataSource","./EntityCollection","./PolygonGraphics","./PolylineGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x){"use strict";function b(t){return e.fromDegrees(t[0],t[1],t[2])}function A(e,t){var i="";for(var r in e)if(e.hasOwnProperty(r)){if(r===t||-1!==ae.indexOf(r))continue;var n=e[r];o(n)&&(i+="object"==typeof n?""+r+""+A(n)+"":""+r+""+n+"")}return i.length>0&&(i=''+i+"
"),i}function P(e,t,i){var r;return function(o,a){return n(r)||(r=e(t,i)),r}}function I(e,t){return new _(P(A,e,t),!0)}function M(e,t,r){var a=e.id;if(o(a)&&"Feature"===e.type){for(var s=2,l=a;n(t.getById(l));)l=a+"_"+s,s++;a=l}else a=i();var u=t.getOrCreateEntity(a),c=e.properties;if(o(c)){u.addProperty("properties"),u.properties=c;var h,d=c.title;if(o(d))u.name=d,h="title";else{var p=Number.MAX_VALUE;for(var m in c)if(c.hasOwnProperty(m)&&c[m]){var f=m.toLowerCase();if(p>1&&"title"===f){p=1,h=m;break}p>2&&"name"===f?(p=2,h=m):p>3&&/title/i.test(m)?(p=3,h=m):p>4&&/name/i.test(m)&&(p=4,h=m)}o(h)&&(u.name=c[h])}var v=c.description;n(v)?null!==v&&(u.description=new E(v)):u.description=r(c,h)}return u}function D(e,t){for(var i=new Array(e.length),r=0;ra;a++)R(e,o[a],void 0,r,n)}function N(e,t,i,r,n){for(var a=i.geometries,s=0,l=a.length;l>s;s++){var u=a[s],c=u.type,h=le[c];if(!o(h))throw new p("Unknown geometry type: "+c);h(e,t,u,r,n)}}function L(e,i,a,s,l){var u=l.markerSymbol,c=l.markerColor,h=l.markerSize,d=i.properties;if(o(d)){var p=d["marker-color"];o(p)&&(c=t.fromCssColorString(p)),h=r(oe[d["marker-size"]],h);var f=d["marker-symbol"];o(f)&&(u=f)}var _;_=n(u)?1===u.length?e._pinBuilder.fromText(u.toUpperCase(),c,h):e._pinBuilder.fromMakiIconId(u,c,h):e._pinBuilder.fromColor(c,h),e._promises.push(v(_,function(t){var r=new g;r.verticalOrigin=new E(m.BOTTOM),r.image=new E(t);var n=M(i,e._entityCollection,l.describe);n.billboard=r,n.position=new C(a(s))}))}function F(e,t,i,r,n){L(e,t,r,i.coordinates,n); -}function B(e,t,i,r,n){for(var o=i.coordinates,a=0;aw;w++)S.push(new d(D(a[w],r)));var b=a[0];C.hierarchy=new E(new d(D(b,r),S)),b[0].length>2&&(C.perPositionHeight=new E(!0));var A=M(i,e._entityCollection,s.describe);A.polygon=C}}function G(e,t,i,r,n){U(e,t,r,i.coordinates,n)}function W(e,t,i,r,n){for(var o=i.coordinates,a=0;ao;o++){var s=i[o],l=s.getType(),u=s.getText();if("element"===l)"a"===s.getTagName()&&(s.isClosing()?r=Math.max(r-1,0):r++),n.push(u);else if("entity"===l||"comment"===l)n.push(u);else if(0===r){var c=this.linkifyStr(u);n.push(c)}else n.push(u)}return n.join("")},linkifyStr:function(e){return this.getMatchParser().replace(e,this.createMatchReturnVal,this)},createMatchReturnVal:function(t){var i;if(this.replaceFn&&(i=this.replaceFn.call(this,this,t)),"string"==typeof i)return i;if(i===!1)return t.getMatchedText();if(i instanceof e.HtmlTag)return i.toAnchorString();var r=this.getTagBuilder(),n=r.build(t);return n.toAnchorString()},getHtmlParser:function(){var t=this.htmlParser;return t||(t=this.htmlParser=new e.htmlParser.HtmlParser),t},getMatchParser:function(){var t=this.matchParser;return t||(t=this.matchParser=new e.matchParser.MatchParser({urls:this.urls,email:this.email,twitter:this.twitter,phone:this.phone,hashtag:this.hashtag,stripPrefix:this.stripPrefix})),t},getTagBuilder:function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new e.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t}},e.link=function(t,i){var r=new e(i);return r.link(t)},e.match={},e.htmlParser={},e.matchParser={},e.Util={abstractMethod:function(){throw"abstract"},trimRegex:/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,assign:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},extend:function(t,i){var r=t.prototype,n=function(){};n.prototype=r;var o;o=i.hasOwnProperty("constructor")?i.constructor:function(){r.constructor.apply(this,arguments)};var a=o.prototype=new n;return a.constructor=o,a.superclass=r,delete i.constructor,e.Util.assign(a,i),o},ellipsis:function(e,t,i){return e.length>t&&(i=null==i?"..":i,e=e.substring(0,t-i.length)+i),e},indexOf:function(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var i=0,r=e.length;r>i;i++)if(e[i]===t)return i;return-1},splitAndCapture:function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var i,r=[],n=0;i=t.exec(e);)r.push(e.substring(n,i.index)),r.push(i[0]),n=i.index+i[0].length;return r.push(e.substring(n)),r},trim:function(e){return e.replace(this.trimRegex,"")}},e.HtmlTag=e.Util.extend(Object,{whitespaceRegex:/\s+/,constructor:function(t){e.Util.assign(this,t),this.innerHtml=this.innerHtml||this.innerHTML},setTagName:function(e){return this.tagName=e,this},getTagName:function(){return this.tagName||""},setAttr:function(e,t){var i=this.getAttrs();return i[e]=t,this},getAttr:function(e){return this.getAttrs()[e]},setAttrs:function(t){var i=this.getAttrs();return e.Util.assign(i,t),this},getAttrs:function(){return this.attrs||(this.attrs={})},setClass:function(e){return this.setAttr("class",e)},addClass:function(t){for(var i,r=this.getClass(),n=this.whitespaceRegex,o=e.Util.indexOf,a=r?r.split(n):[],s=t.split(n);i=s.shift();)-1===o(a,i)&&a.push(i);return this.getAttrs()["class"]=a.join(" "),this},removeClass:function(t){for(var i,r=this.getClass(),n=this.whitespaceRegex,o=e.Util.indexOf,a=r?r.split(n):[],s=t.split(n);a.length&&(i=s.shift());){var l=o(a,i);-1!==l&&a.splice(l,1)}return this.getAttrs()["class"]=a.join(" "),this},getClass:function(){return this.getAttrs()["class"]||""},hasClass:function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},setInnerHtml:function(e){return this.innerHtml=e,this},getInnerHtml:function(){return this.innerHtml||""},toAnchorString:function(){var e=this.getTagName(),t=this.buildAttrsStr();return t=t?" "+t:"",["<",e,t,">",this.getInnerHtml(),""].join("")},buildAttrsStr:function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var i in e)e.hasOwnProperty(i)&&t.push(i+'="'+e[i]+'"');return t.join(" ")}}),e.AnchorTagBuilder=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},build:function(t){var i=new e.HtmlTag({tagName:"a",attrs:this.createAttrs(t.getType(),t.getAnchorHref()),innerHtml:this.processAnchorText(t.getAnchorText())});return i},createAttrs:function(e,t){var i={href:t},r=this.createCssClass(e);return r&&(i["class"]=r),this.newWindow&&(i.target="_blank"),i},createCssClass:function(e){var t=this.className;return t?t+" "+t+"-"+e:""},processAnchorText:function(e){return e=this.doTruncate(e)},doTruncate:function(t){return e.Util.ellipsis(t,this.truncate||Number.POSITIVE_INFINITY)}}),e.htmlParser.HtmlParser=e.Util.extend(Object,{htmlRegex:function(){var e=/!--([\s\S]+?)--/,t=/[0-9a-zA-Z][0-9a-zA-Z:]*/,i=/[^\s\0"'>\/=\x01-\x1F\x7F]+/,r=/(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/,n=i.source+"(?:\\s*=\\s*"+r.source+")?";return new RegExp(["(?:","<(!DOCTYPE)","(?:","\\s+","(?:",n,"|",r.source+")",")*",">",")","|","(?:","<(/)?","(?:",e.source,"|","(?:","("+t.source+")","(?:","\\s+",n,")*","\\s*/?",")",")",">",")"].join(""),"gi")}(),htmlCharacterEntitiesRegex:/( | |<|<|>|>|"|"|')/gi,parse:function(e){for(var t,i,r=this.htmlRegex,n=0,o=[];null!==(t=r.exec(e));){var a=t[0],s=t[3],l=t[1]||t[4],u=!!t[2],c=e.substring(n,t.index);c&&(i=this.parseTextAndEntityNodes(c),o.push.apply(o,i)),s?o.push(this.createCommentNode(a,s)):o.push(this.createElementNode(a,l,u)),n=t.index+a.length}if(nn;n+=2){var a=r[n],s=r[n+1];a&&i.push(this.createTextNode(a)),s&&i.push(this.createEntityNode(s))}return i},createCommentNode:function(t,i){return new e.htmlParser.CommentNode({text:t,comment:e.Util.trim(i)})},createElementNode:function(t,i,r){return new e.htmlParser.ElementNode({text:t,tagName:i.toLowerCase(),closing:r})},createEntityNode:function(t){return new e.htmlParser.EntityNode({text:t})},createTextNode:function(t){return new e.htmlParser.TextNode({text:t})}}),e.htmlParser.HtmlNode=e.Util.extend(Object,{text:"",constructor:function(t){e.Util.assign(this,t)},getType:e.Util.abstractMethod,getText:function(){return this.text}}),e.htmlParser.CommentNode=e.Util.extend(e.htmlParser.HtmlNode,{comment:"",getType:function(){return"comment"},getComment:function(){return this.comment}}),e.htmlParser.ElementNode=e.Util.extend(e.htmlParser.HtmlNode,{tagName:"",closing:!1,getType:function(){return"element"},getTagName:function(){return this.tagName},isClosing:function(){return this.closing}}),e.htmlParser.EntityNode=e.Util.extend(e.htmlParser.HtmlNode,{getType:function(){return"entity"}}),e.htmlParser.TextNode=e.Util.extend(e.htmlParser.HtmlNode,{getType:function(){return"text"}}),e.matchParser.MatchParser=e.Util.extend(Object,{urls:!0,email:!0,twitter:!0,phone:!0,hashtag:!1,stripPrefix:!0,matcherRegex:function(){var e=/(^|[^\w])@(\w{1,15})/,t=/(^|[^\w])#(\w{1,15})/,i=/(?:[\-;:&=\+\$,\w\.]+@)/,r=/(?:\+?\d{1,3}[-\s.])?\(?\d{3}\)?[-\s.]?\d{3}[-\s.]\d{4}/,n=/(?:[A-Za-z][-.+A-Za-z0-9]+:(?![A-Za-z][-.+A-Za-z0-9]+:\/\/)(?!\d+\/?)(?:\/\/)?)/,o=/(?:www\.)/,a=/[A-Za-z0-9\.\-]*[A-Za-z0-9\-]/,s=/\.(?:international|construction|contractors|enterprises|photography|productions|foundation|immobilien|industries|management|properties|technology|christmas|community|directory|education|equipment|institute|marketing|solutions|vacations|bargains|boutique|builders|catering|cleaning|clothing|computer|democrat|diamonds|graphics|holdings|lighting|partners|plumbing|supplies|training|ventures|academy|careers|company|cruises|domains|exposed|flights|florist|gallery|guitars|holiday|kitchen|neustar|okinawa|recipes|rentals|reviews|shiksha|singles|support|systems|agency|berlin|camera|center|coffee|condos|dating|estate|events|expert|futbol|kaufen|luxury|maison|monash|museum|nagoya|photos|repair|report|social|supply|tattoo|tienda|travel|viajes|villas|vision|voting|voyage|actor|build|cards|cheap|codes|dance|email|glass|house|mango|ninja|parts|photo|shoes|solar|today|tokyo|tools|watch|works|aero|arpa|asia|best|bike|blue|buzz|camp|club|cool|coop|farm|fish|gift|guru|info|jobs|kiwi|kred|land|limo|link|menu|mobi|moda|name|pics|pink|post|qpon|rich|ruhr|sexy|tips|vote|voto|wang|wien|wiki|zone|bar|bid|biz|cab|cat|ceo|com|edu|gov|int|kim|mil|net|onl|org|pro|pub|red|tel|uno|wed|xxx|xyz|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw)\b/,l=/[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]?!:,.;]*[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]]/;return new RegExp(["(",e.source,")","|","(",i.source,a.source,s.source,")","|","(","(?:","(",n.source,a.source,")","|","(?:","(.?//)?",o.source,a.source,")","|","(?:","(.?//)?",a.source,s.source,")",")","(?:"+l.source+")?",")","|","(",r.source,")","|","(",t.source,")"].join(""),"gi")}(),charBeforeProtocolRelMatchRegex:/^(.)?\/\//,constructor:function(t){e.Util.assign(this,t),this.matchValidator=new e.MatchValidator},replace:function(e,t,i){var r=this;return e.replace(this.matcherRegex,function(e,n,o,a,s,l,u,c,h,d,p,m,f){var v=r.processCandidateMatch(e,n,o,a,s,l,u,c,h,d,p,m,f);if(v){var g=t.call(i,v.match);return v.prefixStr+g+v.suffixStr}return e})},processCandidateMatch:function(t,i,r,n,o,a,s,l,u,c,h,d,p){var m,f=l||u,v="",g="";if(a&&!this.urls||o&&!this.email||c&&!this.phone||i&&!this.twitter||h&&!this.hashtag||!this.matchValidator.isValidMatch(a,s,f))return null;if(this.matchHasUnbalancedClosingParen(t)&&(t=t.substr(0,t.length-1),g=")"),o)m=new e.match.Email({matchedText:t,email:o});else if(i)r&&(v=r,t=t.slice(1)),m=new e.match.Twitter({matchedText:t,twitterHandle:n});else if(c){var _=t.replace(/\D/g,"");m=new e.match.Phone({matchedText:t,number:_})}else if(h)d&&(v=d,t=t.slice(1)),m=new e.match.Hashtag({matchedText:t,serviceName:this.hashtag,hashtag:p});else{if(f){var y=f.match(this.charBeforeProtocolRelMatchRegex)[1]||"";y&&(v=y,t=t.slice(1))}m=new e.match.Url({matchedText:t,url:t,protocolUrlMatch:!!s,protocolRelativeMatch:!!f,stripPrefix:this.stripPrefix})}return{prefixStr:v,suffixStr:g,match:m}},matchHasUnbalancedClosingParen:function(e){var t=e.charAt(e.length-1);if(")"===t){var i=e.match(/\(/g),r=e.match(/\)/g),n=i&&i.length||0,o=r&&r.length||0;if(o>n)return!0}return!1}}),e.MatchValidator=e.Util.extend(Object,{invalidProtocolRelMatchRegex:/^[\w]\/\//,hasFullProtocolRegex:/^[A-Za-z][-.+A-Za-z0-9]+:\/\//,uriSchemeRegex:/^[A-Za-z][-.+A-Za-z0-9]+:/,hasWordCharAfterProtocolRegex:/:[^\s]*?[A-Za-z]/,isValidMatch:function(e,t,i){return t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)||this.isInvalidProtocolRelativeMatch(i)?!1:!0},isValidUriScheme:function(e){var t=e.match(this.uriSchemeRegex)[0].toLowerCase();return"javascript:"!==t&&"vbscript:"!==t},urlMatchDoesNotHaveProtocolOrDot:function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||-1!==e.indexOf("."))},urlMatchDoesNotHaveAtLeastOneWordChar:function(e,t){return e&&t?!this.hasWordCharAfterProtocolRegex.test(e):!1},isInvalidProtocolRelativeMatch:function(e){return!!e&&this.invalidProtocolRelMatchRegex.test(e)}}),e.match.Match=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},getType:e.Util.abstractMethod,getMatchedText:function(){return this.matchedText},getAnchorHref:e.Util.abstractMethod,getAnchorText:e.Util.abstractMethod}),e.match.Email=e.Util.extend(e.match.Match,{getType:function(){return"email"},getEmail:function(){return this.email},getAnchorHref:function(){return"mailto:"+this.email},getAnchorText:function(){return this.email}}),e.match.Hashtag=e.Util.extend(e.match.Match,{getType:function(){return"hashtag"},getHashtag:function(){return this.hashtag},getAnchorHref:function(){var e=this.serviceName,t=this.hashtag;switch(e){case"twitter":return"https://twitter.com/hashtag/"+t;case"facebook":return"https://www.facebook.com/hashtag/"+t;default:throw new Error("Unknown service name to point hashtag to: ",e)}},getAnchorText:function(){return"#"+this.hashtag}}),e.match.Phone=e.Util.extend(e.match.Match,{getType:function(){return"phone"},getNumber:function(){return this.number},getAnchorHref:function(){return"tel:"+this.number},getAnchorText:function(){return this.matchedText}}),e.match.Twitter=e.Util.extend(e.match.Match,{getType:function(){return"twitter"},getTwitterHandle:function(){return this.twitterHandle},getAnchorHref:function(){return"https://twitter.com/"+this.twitterHandle},getAnchorText:function(){return"@"+this.twitterHandle}}),e.match.Url=e.Util.extend(e.match.Match,{urlPrefixRegex:/^(https?:\/\/)?(www\.)?/i,protocolRelativeRegex:/^\/\//,protocolPrepended:!1,getType:function(){return"url"},getUrl:function(){var e=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(e=this.url="http://"+e,this.protocolPrepended=!0),e},getAnchorHref:function(){var e=this.getUrl();return e.replace(/&/g,"&")},getAnchorText:function(){var e=this.getUrl();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix&&(e=this.stripUrlPrefix(e)),e=this.removeTrailingSlash(e)},stripUrlPrefix:function(e){return e.replace(this.urlPrefixRegex,"")},stripProtocolRelativePrefix:function(e){return e.replace(this.protocolRelativeRegex,"")},removeTrailingSlash:function(e){return"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e}}),e}),i("ThirdParty/zip",["../Core/buildModuleUrl","../Core/defineProperties"],function(e,t){var i={};return function(i){function r(){var e=-1,t=this;t.append=function(i){var r,n=t.table;for(r=0;r>>8^n[255&(e^i[r])]},t.get=function(){return~e}}function n(e,t,i){return e.slice?e.slice(t,t+i):e.webkitSlice?e.webkitSlice(t,t+i):e.mozSlice?e.mozSlice(t,t+i):e.msSlice?e.msSlice(t,t+i):void 0}function o(e,t){var i,r;return i=new ArrayBuffer(e),r=new Uint8Array(i),t&&r.set(t,0),{buffer:i,array:r,view:new DataView(i)}}function a(){}function s(e){function t(t,i){var o=new Blob([e],{type:z});r=new u(o),r.init(function(){n.size=r.size,t()},i)}function i(e,t,i,n){r.readUint8Array(e,t,i,n)}var r,n=this;n.size=0,n.init=t,n.readUint8Array=i}function l(e){function t(t){for(var i=e.length;"="==e.charAt(i-1);)i--;r=e.indexOf(",")+1,n.size=Math.floor(.75*(i-r)),t()}function i(t,i,n){var a,s=o(i),l=4*Math.floor(t/3),u=4*Math.ceil((t+i)/3),c=window.atob(e.substring(l+r,u+r)),h=t-3*Math.floor(l/4);for(a=h;h+i>a;a++)s.array[a-h]=c.charCodeAt(a);n(s.array)}var r,n=this;n.size=0,n.init=t,n.readUint8Array=i}function u(e){function t(t){this.size=e.size,t()}function i(t,i,r,o){var a=new FileReader;a.onload=function(e){r(new Uint8Array(e.target.result))},a.onerror=o,a.readAsArrayBuffer(n(e,t,i))}var r=this;r.size=0,r.init=t,r.readUint8Array=i}function c(){}function h(e){function t(e){n=new Blob([],{type:z}),e()}function i(e,t){n=new Blob([n,P?e:e.buffer],{type:z}),t()}function r(t,i){var r=new FileReader;r.onload=function(e){t(e.target.result)},r.onerror=i,r.readAsText(n,e)}var n,o=this;o.init=t,o.writeUint8Array=i,o.getData=r}function d(e){function t(t){o+="data:"+(e||"")+";base64,",t()}function i(e,t){var i,r=a.length,n=a;for(a="",i=0;i<3*Math.floor((r+e.length)/3)-r;i++)n+=String.fromCharCode(e[i]);for(;i2?o+=window.btoa(n):a=n,t()}function r(e){e(o+window.btoa(a))}var n=this,o="",a="";n.init=t,n.writeUint8Array=i,n.getData=r}function p(e){function t(t){n=new Blob([],{type:e}),t()}function i(t,i){n=new Blob([n,P?t:t.buffer],{type:e}),i()}function r(e){e(n)}var n,o=this;o.init=t,o.writeUint8Array=i,o.getData=r}function m(e,t,i,r,n,o,a,s,l,u){function c(){e.removeEventListener(U,h,!1),s(m)}function h(e){var t=e.data,r=t.data;t.onappend&&(m+=r.length,i.writeUint8Array(r,function(){o(!1,r),d()},u)),t.onflush&&(r?(m+=r.length,i.writeUint8Array(r,function(){o(!1,r),c()},u)):c()),t.progress&&a&&a(p+t.current,n)}function d(){p=f*B,n>p?t.readUint8Array(r+p,Math.min(B,n-p),function(t){e.postMessage({append:!0,data:t}),f++,a&&a(p,n),o(!0,t)},l):e.postMessage({flush:!0})}var p,m,f=0;m=0,e.addEventListener(U,h,!1),d()}function f(e,t,i,r,n,o,a,s,l,u){function c(){var m;h=d*B,n>h?t.readUint8Array(r+h,Math.min(B,n-h),function(t){var s=e.append(t,function(){a&&a(r+h,n)});p+=s.length,o(!0,t),i.writeUint8Array(s,function(){o(!1,s),d++,setTimeout(c,1)},u),a&&a(h,n)},l):(m=e.flush(),m?(p+=m.length,i.writeUint8Array(m,function(){o(!1,m),s(p)},u)):s(p))}var h,d=0,p=0;c()}function v(e,t,n,o,a,s,l,u,c){function h(e,t){a&&!e&&v.append(t)}function d(e){s(e,v.get())}var p,v=new r;return i.zip.useWebWorkers?(p=new Worker(i.zip.workerScriptsPath+V),m(p,e,t,n,o,h,l,d,u,c)):f(new i.zip.Inflater,e,t,n,o,h,l,d,u,c),p}function g(e,t,n,o,a,s,l){function u(e,t){e&&p.append(t)}function c(e){o(e,p.get())}function h(){d.removeEventListener(U,h,!1),m(d,e,t,0,e.size,u,a,c,s,l)}var d,p=new r;return i.zip.useWebWorkers?(d=new Worker(i.zip.workerScriptsPath+k),d.addEventListener(U,h,!1),d.postMessage({init:!0,level:n})):f(new i.zip.Deflater,e,t,0,e.size,u,a,c,s,l),d}function _(e,t,i,n,o,a,s,l,u){function c(){var r=h*B;n>r?e.readUint8Array(i+r,Math.min(B,n-r),function(e){o&&d.append(e),s&&s(r,n,e),t.writeUint8Array(e,function(){h++,c()},u)},l):a(n,d.get())}var h=0,d=new r;c()}function y(e){var t,i,r="",n=["Ç","ü","é","â","ä","à","å","ç","ê","ë","è","ï","î","ì","Ä","Å","É","æ","Æ","ô","ö","ò","û","ù","ÿ","Ö","Ü","ø","£","Ø","×","ƒ","á","í","ó","ú","ñ","Ñ","ª","º","¿","®","¬","½","¼","¡","«","»","_","_","_","¦","¦","Á","Â","À","©","¦","¦","+","+","¢","¥","+","+","-","-","+","-","+","ã","Ã","+","+","-","-","¦","-","+","¤","ð","Ð","Ê","Ë","È","i","Í","Î","Ï","+","+","_","_","¦","Ì","_","Ó","ß","Ô","Ò","õ","Õ","µ","þ","Þ","Ú","Û","Ù","ý","Ý","¯","´","­","±","_","¾","¶","§","÷","¸","°","¨","·","¹","³","²","_"," "];for(t=0;t127?n[i-128]:String.fromCharCode(i);return r}function C(e){return decodeURIComponent(escape(e))}function E(e){var t,i="";for(t=0;t>16,i=65535&e;try{return new Date(1980+((65024&t)>>9),((480&t)>>5)-1,31&t,(63488&i)>>11,(2016&i)>>5,2*(31&i),0)}catch(r){}}function w(e,t,i,r,n){return e.version=t.view.getUint16(i,!0),e.bitFlag=t.view.getUint16(i+2,!0),e.compressionMethod=t.view.getUint16(i+4,!0),e.lastModDateRaw=t.view.getUint32(i+6,!0),e.lastModDate=S(e.lastModDateRaw),1===(1&e.bitFlag)?void n(M):((r||8!=(8&e.bitFlag))&&(e.crc32=t.view.getUint32(i+10,!0),e.compressedSize=t.view.getUint32(i+14,!0),e.uncompressedSize=t.view.getUint32(i+18,!0)),4294967295===e.compressedSize||4294967295===e.uncompressedSize?void n(D):(e.filenameLength=t.view.getUint16(i+22,!0),void(e.extraFieldLength=t.view.getUint16(i+24,!0))))}function T(e,t){function i(){}function r(i,n){e.readUint8Array(e.size-i,i,function(e){var t=o(e.length,e).view;1347093766!=t.getUint32(0)?r(i+1,n):n(t)},function(){t(R)})}return i.prototype.getData=function(i,r,n,a){function s(e,t){d&&d.terminate(),d=null,e&&e(t)}function l(e){var t=o(4);return t.view.setUint32(0,e),p.crc32==t.view.getUint32(0)}function u(e,t){a&&!l(t)?c():i.getData(function(e){s(r,e)})}function c(){s(t,L)}function h(){s(t,N)}var d,p=this;e.readUint8Array(p.offset,30,function(r){var s,l=o(r.length,r);return 1347093252!=l.view.getUint32(0)?void t(I):(w(p,l,4,!1,t),s=p.offset+30+p.filenameLength+p.extraFieldLength,void i.init(function(){0===p.compressionMethod?_(e,i,s,p.compressedSize,a,u,n,c,h):d=v(e,i,s,p.compressedSize,a,u,n,c,h)},h))},c)},{getEntries:function(n){return e.size<22?void t(I):void r(22,function(r){var a,s;a=r.getUint32(16,!0),s=r.getUint16(8,!0),e.readUint8Array(a,e.size-a,function(e){var r,a,l,u,c=0,h=[],d=o(e.length,e);for(r=0;s>r;r++){if(a=new i,1347092738!=d.view.getUint32(c))return void t(I);w(a,d,c+6,!0,t),a.commentLength=d.view.getUint16(c+32,!0),a.directory=16==(16&d.view.getUint8(c+38)),a.offset=d.view.getUint32(c+42,!0),l=E(d.array.subarray(c+46,c+46+a.filenameLength)),a.filename=2048===(2048&a.bitFlag)?C(l):y(l),a.directory||"/"!=a.filename.charAt(a.filename.length-1)||(a.directory=!0),u=E(d.array.subarray(c+46+a.filenameLength+a.extraFieldLength,c+46+a.filenameLength+a.extraFieldLength+a.commentLength)),a.comment=2048===(2048&a.bitFlag)?C(u):y(u),h.push(a),c+=46+a.filenameLength+a.extraFieldLength+a.commentLength}n(h)},function(){t(R)})})},close:function(e){e&&e()}}}function x(e){return unescape(encodeURIComponent(e))}function b(e){var t,i=[];for(t=0;te;e++){for(i=e,t=0;8>t;t++)1&i?i=i>>>1^3988292384:i>>>=1;r[e]=i}return r}(),s.prototype=new a,s.prototype.constructor=s,l.prototype=new a,l.prototype.constructor=l,u.prototype=new a,u.prototype.constructor=u,c.prototype.getData=function(e){e(this.data)},h.prototype=new c,h.prototype.constructor=h,d.prototype=new c,d.prototype.constructor=d,p.prototype=new c,p.prototype.constructor=p,i.zip={Reader:a,Writer:c,BlobReader:u,Data64URIReader:l,TextReader:s,BlobWriter:p,Data64URIWriter:d,TextWriter:h,createReader:function(e,t,i){e.init(function(){t(T(e,i))},i)},createWriter:function(e,t,i,r){e.init(function(){t(A(e,i,r))},i)},useWebWorkers:!0};var W;t(i.zip,{workerScriptsPath:{get:function(){return"undefined"==typeof W&&(W=e("ThirdParty/Workers/")),W}}})}(i),i.zip}),i("DataSources/KmlDataSource",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/ClockRange","../Core/ClockStep","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/definedNotNull","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/getAbsoluteUri","../Core/getExtensionFromUri","../Core/getFilenameFromUri","../Core/Iso8601","../Core/JulianDate","../Core/loadBlob","../Core/loadXML","../Core/Math","../Core/NearFarScalar","../Core/PinBuilder","../Core/PolygonHierarchy","../Core/Rectangle","../Core/RuntimeError","../Core/TimeInterval","../Core/TimeIntervalCollection","../Scene/HorizontalOrigin","../Scene/LabelStyle","../ThirdParty/Autolinker","../ThirdParty/Uri","../ThirdParty/when","../ThirdParty/zip","./BillboardGraphics","./CompositePositionProperty","./ConstantPositionProperty","./DataSource","./DataSourceClock","./Entity","./EntityCollection","./LabelGraphics","./PathGraphics","./PolygonGraphics","./PolylineGraphics","./PositionPropertyArray","./RectangleGraphics","./ReferenceProperty","./SampledPositionProperty","./ScaledPositionProperty","./TimeIntervalCollectionProperty","./WallGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O,N,L,F,B,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J){ -"use strict";function $(e){var t=e.slice(0,Math.min(4,e.size)),i=O.defer(),r=new FileReader;return r.addEventListener("load",function(){i.resolve(1347093252===new DataView(r.result).getUint32(0,!1))}),r.addEventListener("error",function(){i.reject(r.error)}),r.readAsArrayBuffer(t),i.promise}function ee(e){var t=O.defer(),i=new FileReader;return i.addEventListener("load",function(){t.resolve(i.result)}),i.addEventListener("error",function(){t.reject(i.error)}),i.readAsText(e),t.promise}function te(e,t,i,r){t.getData(new N.TextWriter,function(e){i.kml=rt.parseFromString(e,"application/xml"),r.resolve()})}function ie(e,t,i,r){var n=s(it.detectFromFilename(t.filename),"application/octet-stream");t.getData(new N.Data64URIWriter(n),function(e){i[t.filename]=e,r.resolve()})}function re(e,t,i,r){for(var n=r.keys,o=new R("."),a=e.querySelectorAll(t),s=0;so;o++)r[n++]=se(t[o]);return r}}}function ue(e,t){if(l(e)){var i=e.getAttribute(t);if(null!==i){var r=parseFloat(i);return isNaN(r)?void 0:r}}}function ce(e,t){if(l(e)){var i=e.getAttribute(t);return null!==i?i:void 0}}function he(e,t,i){if(l(e))for(var r=e.childNodes,n=r.length,o=0;n>o;o++){var a=r[o];if(a.localName===t&&-1!==i.indexOf(a.namespaceURI))return a}}function de(e,t,i){if(l(e)){for(var r=[],n=e.getElementsByTagName(t),o=n.length,a=0;o>a;a++){var s=n[a];s.localName===t&&-1!==i.indexOf(s.namespaceURI)&&r.push(s)}return r}}function pe(e,t,i){if(!l(e))return[];for(var r=[],n=e.childNodes,o=n.length,a=0;o>a;a++){var s=n[a];s.localName===t&&-1!==i.indexOf(s.namespaceURI)&&r.push(s)}return r}function me(e,t,i){var r=he(e,t,i);if(l(r)){var n=parseFloat(r.textContent);return isNaN(n)?void 0:n}}function fe(e,t,i){var r=he(e,t,i);return l(r)?r.textContent.trim():void 0}function ve(e,t,i){var r=he(e,t,i);if(l(r)){var n=r.textContent.trim();return"1"===n||/^true$/i.test(n)}}function ge(e,t,i,r){if(l(e)){var n=!1;if(l(r)){var o=r[e];l(o)&&(n=!0,e=o)}return!n&&l(i)&&(e=m(e,m(i)),e=ne(e,t)),e}}function _e(e,t){if(l(e)){"#"===e[0]&&(e=e.substring(1));var i=parseInt(e.substring(0,2),16)/255,r=parseInt(e.substring(2,4),16)/255,n=parseInt(e.substring(4,6),16)/255,a=parseInt(e.substring(6,8),16)/255;return t?(a>0?ct.maximumRed=a:ct.red=0,n>0?ct.maximumGreen=n:ct.green=0,r>0?ct.maximumBlue=r:ct.blue=0,ct.alpha=i,o.fromRandom(ct)):new o(a,n,r,i)}}function ye(e,t,i){var r=fe(e,t,i);if(l(r))return _e(r,"random"===fe(e,"colorMode",i))}function Ce(e){var t=he(e,"TimeStamp",ut.kmlgx),i=fe(t,"when",ut.kmlgx);if(l(t)&&l(i)&&0!==i.length){var r=_.fromIso8601(i),n=new P;return n.addInterval(new A({start:r,stop:g.MAXIMUM_VALUE})),n}}function Ee(e){var t=he(e,"TimeSpan",ut.kmlgx);if(l(t)){var i,r=he(t,"begin",ut.kmlgx),n=l(r)?_.fromIso8601(r.textContent):void 0,o=he(t,"end",ut.kmlgx),a=l(o)?_.fromIso8601(o.textContent):void 0;if(l(n)&&l(a)){if(_.lessThan(a,n)){var s=n;n=a,a=s}i=new P,i.addInterval(new A({start:n,stop:a}))}else l(n)?(i=new P,i.addInterval(new A({start:n,stop:g.MAXIMUM_VALUE}))):l(a)&&(i=new P,i.addInterval(new A({start:g.MINIMUM_VALUE,stop:a})));return i}}function Se(){var e=new L;return e.width=ot,e.height=ot,e.scaleByDistance=new S(2414016,1,16093e3,.1),e}function we(){var e=new H;return e.outline=!0,e.outlineColor=o.WHITE,e}function Te(){var e=new G;return e.translucencyByDistance=new S(3e6,1,5e6,0),e.pixelOffset=new t(17,0),e.horizontalOrigin=I.LEFT,e.font="16px sans-serif",e.style=M.FILL_AND_OUTLINE,e}function xe(r,n,o,a,u){var c=me(n,"scale",ut.kml),h=me(n,"heading",ut.kml),d=ye(n,"color",ut.kml),p=he(n,"Icon",ut.kml),m=fe(p,"href",ut.kml),f=ge(m,r._proxy,a,u),v=me(p,"x",ut.gx),g=me(p,"y",ut.gx),_=me(p,"w",ut.gx),y=me(p,"h",ut.gx),C=he(n,"hotSpot",ut.kml),S=ue(C,"x"),w=ue(C,"y"),T=ce(C,"xunits"),x=ce(C,"yunits"),b=o.billboard;l(b)||(b=Se(r),o.billboard=b),b.image=f,b.scale=c,b.color=d,(l(v)||l(g)||l(_)||l(y))&&(b.imageSubRegion=new e(v,g,_,y)),l(h)&&0!==h&&(b.rotation=E.toRadians(-h),b.alignedAxis=i.UNIT_Z),c=s(c,1);var A,P;l(S)&&("pixels"===T?A=-S*c:"insetPixels"===T?A=(S-ot)*c:"fraction"===T&&(A=-ot*c*S),A+=.5*ot*c),l(w)&&("pixels"===x?P=w:"insetPixels"===x?P=-w:"fraction"===x&&(P=w*ot),P-=.5*ot*c),(l(A)||l(P))&&(b.pixelOffset=new t(A,P))}function be(e,t,i,r,n){for(var a=0,u=t.childNodes.length;u>a;a++){var c=t.childNodes.item(a);if("IconStyle"===c.localName)xe(e,c,i,r,n);else if("LabelStyle"===c.localName){var h=i.label;l(h)||(h=Te(),i.label=h),h.scale=s(me(c,"scale",ut.kml),h.scale),h.fillColor=s(ye(c,"color",ut.kml),h.fillColor),h.text=i.name}else if("LineStyle"===c.localName){var d=i.polyline;l(d)||(d=new q,i.polyline=d),d.width=me(c,"width",ut.kml),d.material=ye(c,"color",ut.kml)}else if("PolyStyle"===c.localName){var p=i.polygon;l(p)||(p=we(),i.polygon=p),p.material=s(ye(c,"color",ut.kml),p.material),p.fill=s(ve(c,"fill",ut.kml),p.fill),p.outline=s(ve(c,"outline",ut.kml),p.outline)}else if("BalloonStyle"===c.localName){var m=s(_e(fe(c,"bgColor",ut.kml)),o.WHITE),f=s(_e(fe(c,"textColor",ut.kml)),o.BLACK),v=fe(c,"text",ut.kml);i.addProperty("balloonStyle"),i.balloonStyle={bgColor:m,textColor:f,text:v}}}}function Ae(e,t,i,r,n,o){var a=new z,s=pe(i,"Style",ut.kml),u=s.length;u>0&&be(t,s[u-1],a,n,o);var c=fe(i,"styleUrl",ut.kml);if(l(c)){var h=c,d=r.getById(h);l(d)||(d=r.getById("#"+h)),l(d)&&a.merge(d)}return a}function Pe(e,t,i){return O(C(ne(t,e._proxy)),function(r){return Ie(e,r,i,t,!0)})}function Ie(e,t,i,r,n,o){var a,s,u,c,h=de(t,"Style",ut.kml);if(l(h)){var d=h.length;for(a=0;d>a;a++)c=h[a],s=ce(c,"id"),l(s)&&(s="#"+s,n&&l(r)&&(s=r+s),l(i.getById(s))||(u=new z({id:s}),i.add(u),be(e,c,u,r,o)))}var p=de(t,"StyleMap",ut.kml);if(l(p)){var f=p.length;for(a=0;f>a;a++){var v=p[a];if(s=ce(v,"id"),l(s))for(var g=pe(v,"Pair",ut.kml),_=0;_a;a++){var b=T[a].textContent;if("#"!==b[0]){var A=b.split("#");if(2===A.length){var P=A[0];l(S[P])||(l(r)&&(P=m(P,m(r))),w.push(Pe(e,P,i,r)))}}}return w}function Me(e,t,i){var r=new X(e._entityCollection,t.id,["position"]),n=new K(t.position);t.polyline=l(i.polyline)?i.polyline.clone():new q,t.polyline.positions=new j([r,n])}function De(e,t,i){return"relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t?e:((l(t)&&"clampToGround"!==t||l(i)&&"clampToSeaFloor"!==i)&&console.log("KML - Unknown altitudeMode: "+s(t,i)),new K(e))}function Re(e,t,i){if(l(e)){if("relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t)return e;(l(t)&&"clampToGround"!==t||l(i)&&"clampToSeaFloor"!==i)&&console.log("KML - Unknown altitudeMode: "+s(t,i));for(var r=e.length,n=0;r>n;n++){var o=e[n];d.WGS84.scaleToGeodeticSurface(o,o)}return e}}function Oe(e,i,r){var n=i.label;l(n)||(n=l(r.label)?r.label.clone():Te(),i.label=n),n.text=i.name;var a=i.billboard;if(l(a)||(a=l(r.billboard)?r.billboard.clone():Se(),i.billboard=a),l(a.image)||(a.image=e._pinBuilder.fromColor(o.YELLOW,64)),l(a.scale)){var s=a.scale.getValue();0!==s?n.pixelOffset=new t(16*s+1,0):(n.pixelOffset=void 0,n.horizontalOrigin=void 0)}}function Ne(e,t,i){var r=t.path;l(r)||(r=new W,r.leadTime=0,t.path=r);var n=i.polyline;l(n)&&(r.material=n.material,r.width=n.width)}function Le(e,t,i,r){var n=fe(t,"coordinates",ut.kml),o=fe(t,"altitudeMode",ut.kml),a=fe(t,"altitudeMode",ut.gx),s=ve(t,"extrude",ut.kml),l=se(n);i.position=De(new B(l),o,a),Oe(e,i,r),s&&ae(o,a)&&Me(e,i,r)}function Fe(e,t,i,r){var n=he(t,"coordinates",ut.kml),a=fe(t,"altitudeMode",ut.kml),s=fe(t,"altitudeMode",ut.gx),u=ve(t,"extrude",ut.kml),c=ve(t,"tessellate",ut.kml),h=ae(a,s),d=le(n),p=r.polyline;if(h&&u){var m=new J;i.wall=m,m.positions=d;var f=r.polygon;l(f)&&(m.fill=f.fill,m.outline=f.outline,m.material=f.material),l(p)&&(m.outlineColor=l(p.material)?p.material.color:o.WHITE,m.outlineWidth=p.width)}else p=l(p)?p.clone():new q,i.polyline=p,p.positions=Re(d,a,s),(!c||h)&&(p.followSurface=!1)}function Be(e,t,i,r){var n=he(t,"outerBoundaryIs",ut.kml),a=he(n,"LinearRing",ut.kml),s=he(a,"coordinates",ut.kml),u=le(s),c=ve(t,"extrude",ut.kml),h=fe(t,"altitudeMode",ut.kml),d=fe(t,"altitudeMode",ut.gx),p=ae(h,d),m=l(r.polygon)?r.polygon.clone():we(),f=r.polyline;if(l(f)&&(m.outlineColor=l(f.material)?f.material.color:o.WHITE,m.outlineWidth=f.width),i.polygon=m,p&&(m.perPositionHeight=!0,m.extrudedHeight=c?0:void 0),l(u)){for(var v=new T(u),g=pe(t,"innerBoundaryIs",ut.kml),_=0;_p;p++){var m=se(a[p].textContent);h.push(m),d.push(_.fromIso8601(s[p].textContent))}var f=new Z;f.addSamples(d,h),i.position=De(f,n,o),Oe(e,i,r),Ne(e,i,r),i.availability=new P,s.length>0&&i.availability.addInterval(new A({start:d[0],stop:d[d.length-1]})),u&&l&&Me(e,i,r)}function ke(e,t,i,r,n,o,a,s,l){var u=e[0],c=e[e.length-1],h=new Z;h.addSamples(e,t),i.intervals.addInterval(new A({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:De(h,a,s)})),r.addInterval(new A({start:u,stop:c,isStartIncluded:l,isStopIncluded:l})),n.intervals.addInterval(new A({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:o}))}function ze(e,t,i,r){for(var n,o,a,s=ve(t,"interpolate",ut.gx),u=pe(t,"Track",ut.gx),c=!1,h=new Q,d=new P,p=new F,m=0,f=u.length;f>m;m++){var v=u[m],g=pe(v,"when",ut.kml),y=pe(v,"coord",ut.gx),C=fe(v,"altitudeMode",ut.kml),E=fe(v,"altitudeMode",ut.gx),S=ae(C,E),w=ve(v,"extrude",ut.kml),T=Math.min(y.length,g.length),x=[];n=[];for(var b=0;T>b;b++){var A=se(y[b].textContent);x.push(A),n.push(_.fromIso8601(g[b].textContent))}s&&(l(o)&&ke([o,n[0]],[a,x[0]],p,d,h,!1,"absolute",void 0,!1),o=n[T-1],a=x[x.length-1]),ke(n,x,p,d,h,S&&w,C,E,!0),c=c||S&&w}i.availability=d,i.position=p,Oe(e,i,r),Ne(e,i,r),c&&(Me(e,i,r),i.polyline.show=h)}function Ue(e,t,i,r){for(var n=t.childNodes,o=0,a=n.length;a>o;o++){var s=n.item(o),u=dt[s.localName];if(l(u)){var c=oe(s,e._entityCollection);c.parent=i,c.name=i.name,c.availability=i.availability,c.description=i.description,c.kml=i.kml,u(e,s,c,r)}}}function Ge(e,t){var i=he(e,"ExtendedData",ut.kml);if(l(i)){var r={},n=pe(i,"Data",ut.kml);if(l(n))for(var o=n.length,a=0;o>a;a++){var s=n[a],u=ce(s,"name");l(u)&&(r[u]={displayName:fe(s,"displayName",ut.kml),value:fe(s,"value",ut.kml)})}t.kml.extendedData=r}}function We(e,t,i,r){var n,a,u,c=t.kml,h=c.extendedData,d=fe(e,"description",ut.kml),p=s(t.balloonStyle,i.balloonStyle),m=o.WHITE,f=o.BLACK,v=d;l(p)&&(m=s(p.bgColor,o.WHITE),f=s(p.textColor,o.BLACK),v=s(p.text,d));var g;if(l(v)){if(v=v.replace("$[name]",s(t.name,"")),v=v.replace("$[description]",s(d,"")),v=v.replace("$[address]",s(c.address,"")),v=v.replace("$[Snippet]",s(c.snippet,"")),v=v.replace("$[id]",t.id),v=v.replace("$[geDirections]",""),l(h)){var _=v.match(/\$\[.+?\]/g);if(null!==_)for(n=0;n<_.length;n++){var y=_[n],C=y.substr(2,y.length-3),E=/\/displayName$/.test(C);C=C.replace(/\/displayName$/,""),g=h[C],l(g)&&(g=E?g.displayName:g.value),l(g)&&(v=v.replace(y,s(g,"")))}}}else if(l(h)&&(u=Object.keys(h),u.length>0)){for(v='',n=0;n";v+="
"+s(g.displayName,a)+""+s(g.value,"")+"
"}if(l(v)){v=nt.link(v),ht.innerHTML=v;var S=ht.querySelectorAll("a");for(n=0;n1&&(re(ht,"a","href",r),re(ht,"img","src",r));var w='
",ht.innerHTML="",t.description=w}}function He(e,t,i,r,n,o,a){var u=oe(i,r),c=u.kml,h=Ae(u,e,i,n,o,a),d=fe(i,"name",ut.kml);u.name=d,u.parent=t;var p=Ee(i);l(p)||(p=Ce(i)),u.availability=p;var m=ve(i,"visibility",ut.kml);u.show=s(m,!0);var f=he(i,"author",ut.atom),v=c.author;v.name=fe(f,"name",ut.atom),v.uri=fe(f,"uri",ut.atom),v.email=fe(f,"email",ut.atom);var g=he(i,"link",ut.atom),_=c.link;return _.href=ce(g,"href"),_.hreflang=ce(g,"hreflang"),_.rel=ce(g,"rel"),_.type=ce(g,"type"),_.title=ce(g,"title"),_.length=ce(g,"length"),c.address=fe(i,"address",ut.kml),c.phoneNumber=fe(i,"phoneNumber",ut.kml),c.snippet=fe(i,"Snippet",ut.kml),Ge(i,u),We(i,u,h,a),{entity:u,styleEntity:h}}function qe(e,t,i,r,n,o,a){for(var s=Object.keys(pt),l=s.length,u=0;l>u;u++)for(var c=s[u],h=pt[c],d=i.childNodes,p=d.length,m=0;p>m;m++){var f=d[m];f.localName===c&&-1!==ut.kml.indexOf(f.namespaceURI)&&h(e,t,f,r,n,o,a)}}function je(e,t,i,r,n,o,a){var s=He(e,t,i,r,n,o,a);qe(e,s.entity,i,r,n,o,a)}function Ye(e,t,i,r,n,o,a){for(var s=He(e,t,i,r,n,o,a),u=s.entity,c=s.styleEntity,h=!1,d=i.childNodes,p=0,m=d.length;m>p&&!h;p++){var f=d.item(p),v=dt[f.localName];l(v)&&(v(e,f,u,c),h=!0)}h||(u.merge(c),Oe(e,u,c))}function Xe(e,t,i,r,n,o,a){var s,u=He(e,t,i,r,n,o,a),c=u.entity,h=!1,d=le(he(i,"LatLonQuad",ut.gx));if(l(d))s=we(),s.hierarchy=new T(d),c.polygon=s,h=!0;else{s=new Y,c.rectangle=s;var p=he(i,"LatLonBox",ut.kml);if(l(p)){var m=me(p,"west",ut.kml),f=me(p,"south",ut.kml),v=me(p,"east",ut.kml),g=me(p,"north",ut.kml);l(m)&&(m=E.negativePiToPi(E.toRadians(m))),l(f)&&(f=E.negativePiToPi(E.toRadians(f))),l(v)&&(v=E.negativePiToPi(E.toRadians(v))),l(g)&&(g=E.negativePiToPi(E.toRadians(g))),s.coordinates=new x(m,f,v,g);var _=me(p,"rotation",ut.kml);l(_)&&(s.rotation=E.toRadians(_))}}var y=he(i,"Icon",ut.kml),C=fe(y,"href",ut.kml);l(C)?(h&&console.log("KML - gx:LatLonQuad Icon does not support texture projection."),s.material=ge(C,e._proxy,o,a)):s.material=ye(i,"color",ut.kml);var S=fe(i,"altitudeMode",ut.kml);l(S)?"absolute"===S?s.height=me(i,"altitude",ut.kml):"clampToGround"!==S&&console.log("KML - Unknown altitudeMode: "+S):(S=fe(i,"altitudeMode",ut.gx),"relativeToSeaFloor"===S?(console.log("KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=me(i,"altitude",ut.kml)):"clampToSeaFloor"===S?console.log("KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(S)&&console.log("KML - Unknown altitudeMode: "+S))}function Ze(e,t,i,r,n,o,a){console.log("KML - Unsupported feature: "+i.localName)}function Ke(e,t,i,r,n,o,a){var s=He(e,t,i,r,n,o,a),u=s.entity,c=he(i,"Link",ut.kml);if(l(c)){var h=fe(c,"href",ut.kml);if(l(h)){h=ge(h,void 0,o,a);var d=new et(e._proxy),p=O(d.load(h),function(){for(var t=d.entities.values,i=0;ir;r++)if(!o.isConstant(t[r]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),a.prototype.getValue=function(t,i){var r=this._value;if(e(r)){var n=r.length;e(i)||(i=new Array(n));for(var o=0,a=0;n>o;){var s=this._value[o],l=s.getValue(t,i[o]);e(l)&&(i[a]=l,a++),o++}return i.length=a,i}},a.prototype.setValue=function(t){var i=this._eventHelper;if(i.removeAll(),e(t)){this._value=t.slice();for(var r=t.length,n=0;r>n;n++){var o=t[n];e(o)&&i.add(o.definitionChanged,a.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)},a.prototype.equals=function(e){return this===e||e instanceof a&&o.arrayEquals(this._value,e._value)},a.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},a}),i("DataSources/VelocityOrientationProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/JulianDate","../Core/Matrix3","../Core/Quaternion","../Core/Transforms","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(e,i){this._position=void 0,this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new a,this.position=e,this.ellipsoid=t(i,o.WGS84)}r(d.prototype,{isConstant:{get:function(){return h.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){var t=this._position;t!==e&&(i(t)&&this._subscription(),this._position=e,i(e)&&(this._subscription=e._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)),this._definitionChanged.raiseEvent(this))}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){var t=this._ellipsoid;t!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var p=new e,m=new e,f=new e,v=new s,g=new l,_=1/60;return d.prototype.getValue=function(t,r){var n=this._position;if(!h.isConstant(n)){var o=n.getValue(t,p),a=n.getValue(s.addSeconds(t,_,v),m);if(i(o)&&(i(a)||(a=o,o=n.getValue(s.addSeconds(t,-_,v),m),i(o)))&&!e.equals(o,a)){var l=e.subtract(a,o,f);return e.normalize(l,l),c.rotationMatrixFromPositionVelocity(o,l,this._ellipsoid,g),u.fromRotationMatrix(g,r)}}},d.prototype.equals=function(e){return this===e||e instanceof d&&h.equals(this._position,e._position)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))},d}),i("DataSources/Visualizer",["../Core/DeveloperError"],function(e){"use strict";function t(){e.throwInstantiationError()}return t.prototype.update=e.throwInstantiationError,t.prototype.getBoundingSphere=e.throwInstantiationError,t.prototype.isDestroyed=e.throwInstantiationError,t.prototype.destroy=e.throwInstantiationError,t}),i("Renderer/ClearCommand",["../Core/Color","../Core/defaultValue","../Core/freezeObject"],function(e,t,i){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner}return r.ALL=i(new r({color:new e(0,0,0,0),depth:1,stencil:0})),r.prototype.execute=function(e,t){e.clear(this,t)},r}),i("Renderer/ComputeCommand",["../Core/defaultValue","../Core/PrimitiveType","../Scene/Pass"],function(e,t,i){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.vertexArray=t.vertexArray,this.fragmentShaderSource=t.fragmentShaderSource,this.shaderProgram=t.shaderProgram,this.uniformMap=t.uniformMap,this.outputTexture=t.outputTexture,this.preExecute=t.preExecute,this.postExecute=t.postExecute,this.persists=e(t.persists,!1),this.pass=i.COMPUTE,this.owner=t.owner}return r.prototype.execute=function(e){e.execute(this)},r}),i("Shaders/ViewportQuadVS",[],function(){"use strict";return"attribute vec4 position;\nattribute vec2 textureCoordinates;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_Position = position;\nv_textureCoordinates = textureCoordinates;\n}\n"}),i("Renderer/ComputeEngine",["../Core/BoundingRectangle","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Geometry","../Core/GeometryAttribute","../Core/PrimitiveType","../Shaders/ViewportQuadVS","./BufferUsage","./ClearCommand","./DrawCommand","./Framebuffer","./RenderState","./ShaderProgram"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g){"use strict";function _(e){this._context=e}function y(e,t){return new f({context:e,colorTextures:[t],destroyAttachments:!1})}function C(e,t){return g.fromCache({context:e,vertexShaderSource:h,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function E(t,i){return n(S)&&S.viewport.width===t&&S.viewport.height===i||(S=v.fromCache({viewport:new e(0,0,t,i)})),S}var S,w=new m({primitiveType:c.TRIANGLES}),T=new p({color:new t(0,0,0,0)});return _.prototype.execute=function(e){n(e.preExecute)&&e.preExecute(e);var t=e.outputTexture,i=t.width,r=t.height,o=this._context,a=n(e.vertexArray)?e.vertexArray:o.getViewportQuadVertexArray(),s=n(e.shaderProgram)?e.shaderProgram:C(o,e.fragmentShaderSource),l=y(o,t),u=E(i,r),c=e.uniformMap,h=T;h.framebuffer=l,h.renderState=u,h.execute(o);var d=w;d.vertexArray=a,d.renderState=u,d.shaderProgram=s,d.uniformMap=c,d.framebuffer=l,d.execute(o),l.destroy(),e.persists||(s.destroy(),n(e.vertexArray)&&a.destroy()),n(e.postExecute)&&e.postExecute(t)},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){return a(this)},_}),i("Renderer/PassState",["../Core/BoundingRectangle"],function(e){"use strict";function t(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}return t}),i("Renderer/RenderbufferFormat",["../Core/freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={RGBA4:t.RGBA4,RGB5_A1:t.RGB5_A1,RGB565:t.RGB565,DEPTH_COMPONENT16:t.DEPTH_COMPONENT16,STENCIL_INDEX8:t.STENCIL_INDEX8,DEPTH_STENCIL:t.DEPTH_STENCIL,validate:function(e){return e===i.RGBA4||e===i.RGB5_A1||e===i.RGB565||e===i.DEPTH_COMPONENT16||e===i.STENCIL_INDEX8||e===i.DEPTH_STENCIL}};return e(i)}),i("Renderer/Renderbuffer",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","./ContextLimits","./RenderbufferFormat"],function(e,t,i,r,n,o,a){"use strict";function s(i){i=e(i,e.EMPTY_OBJECT);var r=i.context,n=r._gl,s=(o.maximumRenderbufferSize,e(i.format,a.RGBA4)),l=t(i.width)?i.width:n.drawingBufferWidth,u=t(i.height)?i.height:n.drawingBufferHeight;this._gl=n,this._format=s,this._width=l,this._height=u,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),n.renderbufferStorage(n.RENDERBUFFER,s,l,u),n.bindRenderbuffer(n.RENDERBUFFER,null)}return i(s.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}}),s.prototype._getRenderbuffer=function(){return this._renderbuffer},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),r(this)},s}),i("Renderer/PickFramebuffer",["../Core/BoundingRectangle","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","./Framebuffer","./PassState","./Renderbuffer","./RenderbufferFormat","./Texture"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t){var i=new a(t);i.blendingEnabled=!1,i.scissorTest={enabled:!0,rectangle:new e},i.viewport=new e,this._context=t,this._fb=void 0,this._passState=i,this._width=0,this._height=0}c.prototype.begin=function(t){var i=this._context,n=i.drawingBufferWidth,a=i.drawingBufferHeight;return e.clone(t,this._passState.scissorTest.rectangle),r(this._fb)&&this._width===n&&this._height===a||(this._width=n,this._height=a,this._fb=this._fb&&this._fb.destroy(),this._fb=new o({context:i,colorTextures:[new u({context:i,width:n,height:a})],depthStencilRenderbuffer:new s({context:i,format:l.DEPTH_STENCIL})}),this._passState.framebuffer=this._fb),this._passState.viewport.width=n,this._passState.viewport.height=a,this._passState};var h=new t;return c.prototype.end=function(e){for(var n=i(e.width,1),o=i(e.height,1),a=this._context,s=a.readPixels({x:e.x,y:e.y,width:n,height:o,framebuffer:this._fb}),l=Math.max(n,o),u=l*l,c=Math.floor(.5*n),d=Math.floor(.5*o),p=0,m=0,f=0,v=-1,g=0;u>g;++g){if(p>=-c&&c>=p&&m>=-d&&d>=m){var _=4*((d-m)*n+p+c);h.red=t.byteToFloat(s[_]),h.green=t.byteToFloat(s[_+1]),h.blue=t.byteToFloat(s[_+2]),h.alpha=t.byteToFloat(s[_+3]);var y=a.getObjectByPickColor(h);if(r(y))return y}if(p===m||0>p&&-p===m||p>0&&p===1-m){var C=f;f=-v,v=C}p+=f,m+=v}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this._fb=this._fb&&this._fb.destroy(),n(this)},c}),i("Renderer/ShaderCache",["../Core/defined","../Core/defineProperties","../Core/destroyObject","./ShaderProgram","./ShaderSource"],function(e,t,i,r,n){"use strict";function o(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}return t(o.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}}),o.prototype.replaceShaderProgram=function(t){return e(t.shaderProgram)&&t.shaderProgram.destroy(),this.getShaderProgram(t)},o.prototype.getShaderProgram=function(e){var t=e.vertexShaderSource,i=e.fragmentShaderSource,o=e.attributeLocations;"string"==typeof t&&(t=new n({sources:[t]})),"string"==typeof i&&(i=new n({sources:[i]}));var a,s=t.createCombinedVertexShader(),l=i.createCombinedFragmentShader(),u=s+l+JSON.stringify(o); -if(this._shaders[u])a=this._shaders[u],delete this._shadersToRelease[u];else{var c=this._context,h=new r({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:t,vertexShaderText:s,fragmentShaderSource:i,fragmentShaderText:l,attributeLocations:o});a={cache:this,shaderProgram:h,keyword:u,count:0},h._cachedShader=a,this._shaders[u]=a,++this._numberOfShaders}return++a.count,a.shaderProgram},o.prototype.destroyReleasedShaderPrograms=function(){var e=this._shadersToRelease;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];delete this._shaders[i.keyword],i.shaderProgram.finalDestroy(),--this._numberOfShaders}this._shadersToRelease={}},o.prototype.releaseShaderProgram=function(t){if(e(t)){var i=t._cachedShader;i&&0===--i.count&&(this._shadersToRelease[i.keyword]=i)}},o.prototype.isDestroyed=function(){return!1},o.prototype.destroy=function(){var e=this._shaders;for(var t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return i(this)},o}),i("Renderer/UniformState",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defined","../Core/defineProperties","../Core/EncodedCartesian3","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Simon1994PlanetaryPositions","../Core/Transforms","../Scene/SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(){this.globeDepthTexture=void 0,this._viewport=new e,this._viewportCartesian4=new r,this._viewportDirty=!1,this._viewportOrthographicMatrix=c.clone(c.IDENTITY),this._viewportTransformation=c.clone(c.IDENTITY),this._model=c.clone(c.IDENTITY),this._view=c.clone(c.IDENTITY),this._inverseView=c.clone(c.IDENTITY),this._projection=c.clone(c.IDENTITY),this._infiniteProjection=c.clone(c.IDENTITY),this._entireFrustum=new t,this._currentFrustum=new t,this._frustumPlanes=new r,this._frameState=void 0,this._temeToPseudoFixed=u.clone(c.IDENTITY),this._view3DDirty=!0,this._view3D=new c,this._inverseView3DDirty=!0,this._inverseView3D=new c,this._inverseModelDirty=!0,this._inverseModel=new c,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new u,this._viewRotation=new u,this._inverseViewRotation=new u,this._viewRotation3D=new u,this._inverseViewRotation3D=new u,this._inverseProjectionDirty=!0,this._inverseProjection=new c,this._inverseProjectionOITDirty=!0,this._inverseProjectionOIT=new c,this._modelViewDirty=!0,this._modelView=new c,this._modelView3DDirty=!0,this._modelView3D=new c,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new c,this._inverseModelViewDirty=!0,this._inverseModelView=new c,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new c,this._viewProjectionDirty=!0,this._viewProjection=new c,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new c,this._modelViewProjectionDirty=!0,this._modelViewProjection=new c,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new c,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new c,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new c,this._normalDirty=!0,this._normal=new u,this._normal3DDirty=!0,this._normal3D=new u,this._inverseNormalDirty=!0,this._inverseNormal=new u,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new u,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new s,this._cameraPosition=new i,this._sunPositionWC=new i,this._sunPositionColumbusView=new i,this._sunDirectionWC=new i,this._sunDirectionEC=new i,this._moonDirectionEC=new i,this._mode=void 0,this._mapProjection=void 0,this._cameraDirection=new i,this._cameraRight=new i,this._cameraUp=new i,this._frustum2DWidth=0,this._eyeHeight2D=new t,this._resolutionScale=1,this._fogDensity=void 0}function f(e,t){c.clone(t,e._view),c.getRotation(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function v(e,t){c.clone(t,e._inverseView),c.getRotation(t,e._inverseViewRotation)}function g(e,t){c.clone(t,e._projection),e._inverseProjectionDirty=!0,e._inverseProjectionOITDirty=!0,e._viewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function _(e,t){c.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}function y(e,t){i.clone(t.positionWC,e._cameraPosition),i.clone(t.directionWC,e._cameraDirection),i.clone(t.rightWC,e._cameraRight),i.clone(t.upWC,e._cameraUp),e._encodedCameraPositionMCDirty=!0}function C(e,t){o(d.computeIcrfToFixedMatrix(t.time,W))||(W=d.computeTemeToPseudoFixedMatrix(t.time,W));var r=h.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);u.multiplyByVector(W,r,r),i.normalize(r,e._sunDirectionWC),r=u.multiplyByVector(e.viewRotation3D,r,e._sunDirectionEC),i.normalize(r,r),r=h.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),u.multiplyByVector(W,r,r),u.multiplyByVector(e.viewRotation3D,r,r),i.normalize(r,r);var n=t.mapProjection,a=n.ellipsoid,s=a.cartesianToCartographic(e._sunPositionWC,H);n.project(s,e._sunPositionColumbusView)}function E(e){if(e._viewportDirty){var t=e._viewport;c.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),c.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function S(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,c.inverse(e._projection,e._inverseProjection))}function w(e){e._inverseProjectionOITDirty&&(e._inverseProjectionOITDirty=!1,e._mode!==p.SCENE2D&&e._mode!==p.MORPHING?c.inverse(e._projection,e._inverseProjectionOIT):c.clone(c.IDENTITY,e._inverseProjectionOIT))}function T(e){e._modelViewDirty&&(e._modelViewDirty=!1,c.multiplyTransformation(e._view,e._model,e._modelView))}function x(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,c.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function b(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,c.inverse(e.modelView,e._inverseModelView))}function A(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,c.inverse(e.modelView3D,e._inverseModelView3D))}function P(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,c.multiply(e._projection,e._view,e._viewProjection))}function I(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,c.inverse(e.viewProjection,e._inverseViewProjection))}function M(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,c.multiply(e._projection,e.modelView,e._modelViewProjection))}function D(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;var t=e.modelView,i=e._modelViewRelativeToEye;i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=0,i[13]=0,i[14]=0,i[15]=t[15]}}function R(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,c.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function O(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,c.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function N(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,c.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function L(e){if(e._normalDirty){e._normalDirty=!1;var t=e._normal;c.getRotation(e.inverseModelView,t),u.transpose(t,t)}}function F(e){if(e._normal3DDirty){e._normal3DDirty=!1;var t=e._normal3D;c.getRotation(e.inverseModelView3D,t),u.transpose(t,t)}}function B(e){e._inverseNormalDirty&&(e._inverseNormalDirty=!1,c.getRotation(e.inverseModelView,e._inverseNormal))}function V(e){e._inverseNormal3DDirty&&(e._inverseNormal3DDirty=!1,c.getRotation(e.inverseModelView3D,e._inverseNormal3D))}function k(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,c.multiplyByPoint(e.inverseModel,e._cameraPosition,q),s.fromCartesian(q,e._encodedCameraPositionMC))}function z(e,t,r,n,a,s,u,h){var m=j;m.x=e.y,m.y=e.z,m.z=e.x;var f=Y;f.x=r.y,f.y=r.z,f.z=r.x;var v=X;v.x=n.y,v.y=n.z,v.z=n.x;var g=Z;g.x=t.y,g.y=t.z,g.z=t.x,s===p.SCENE2D&&(m.z=.5*a);var _=u.unproject(m,K);_.longitude=l.clamp(_.longitude,-Math.PI,Math.PI),_.latitude=l.clamp(_.latitude,-l.PI_OVER_TWO,l.PI_OVER_TWO);var y=u.ellipsoid,C=y.cartographicToCartesian(_,Q),E=d.eastNorthUpToFixedFrame(C,y,J);return c.multiplyByPointAsVector(E,f,f),c.multiplyByPointAsVector(E,v,v),c.multiplyByPointAsVector(E,g,g),o(h)||(h=new c),h[0]=f.x,h[1]=v.x,h[2]=-g.x,h[3]=0,h[4]=f.y,h[5]=v.y,h[6]=-g.y,h[7]=0,h[8]=f.z,h[9]=v.z,h[10]=-g.z,h[11]=0,h[12]=-i.dot(f,C),h[13]=-i.dot(v,C),h[14]=i.dot(g,C),h[15]=1,h}function U(e){e._view3DDirty&&(e._mode===p.SCENE3D?c.clone(e._view,e._view3D):z(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),c.getRotation(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function G(e){e._inverseView3DDirty&&(c.inverseTransformation(e.view3D,e._inverseView3D),c.getRotation(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}a(m.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(t){if(!e.equals(t,this._viewport)){e.clone(t,this._viewport);var i=this._viewport,r=this._viewportCartesian4;r.x=i.x,r.y=i.y,r.z=i.width,r.w=i.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return E(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return E(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){c.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._viewProjectionDirty=!0,this._inverseViewProjectionDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,c.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTranposeModel:{get:function(){var e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,c.getRotation(this.inverseModel,e),u.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return U(this),this._view3D}},viewRotation:{get:function(){return U(this),this._viewRotation}},viewRotation3D:{get:function(){return U(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return G(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return G(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return S(this),this._inverseProjection}},inverseProjectionOIT:{get:function(){return w(this),this._inverseProjectionOIT}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return T(this),this._modelView}},modelView3D:{get:function(){return x(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return D(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return b(this),this._inverseModelView}},inverseModelView3D:{get:function(){return A(this),this._inverseModelView3D}},viewProjection:{get:function(){return P(this),this._viewProjection}},inverseViewProjection:{get:function(){return I(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return M(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return R(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return O(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return N(this),this._modelViewInfiniteProjection}},normal:{get:function(){return L(this),this._normal}},normal3D:{get:function(){return F(this),this._normal3D}},inverseNormal:{get:function(){return B(this),this._inverseNormal}},inverseNormal3D:{get:function(){return V(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},encodedCameraPositionMCHigh:{get:function(){return k(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return k(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},resolutionScale:{get:function(){return this._resolutionScale}},fogDensity:{get:function(){return this._fogDensity}}});var W=new u,H=new n;m.prototype.updateFrustum=function(e){g(this,e.projectionMatrix),o(e.infiniteProjectionMatrix)&&_(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,o(e.top)||(e=e._offCenterFrustum),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right},m.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection;var t=e.context._canvas;this._resolutionScale=t.width/t.clientWidth;var i=e.camera;f(this,i.viewMatrix),v(this,i.inverseViewMatrix),y(this,i),e.mode===p.SCENE2D?(this._frustum2DWidth=i.frustum.right-i.frustum.left,this._eyeHeight2D.x=.5*this._frustum2DWidth,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),C(this,e),this._entireFrustum.x=i.frustum.near,this._entireFrustum.y=i.frustum.far,this.updateFrustum(i.frustum),this._fogDensity=e.fog.density,this._frameState=e,this._temeToPseudoFixed=d.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed)};var q=new i,j=new i,Y=new i,X=new i,Z=new i,K=new n,Q=new i,J=new c;return m}),i("Renderer/Context",["../Core/clone","../Core/Color","../Core/ComponentDatatype","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/Geometry","../Core/GeometryAttribute","../Core/Math","../Core/Matrix4","../Core/PrimitiveType","../Core/RuntimeError","../Shaders/ViewportQuadVS","./BufferUsage","./ClearCommand","./ContextLimits","./CubeMap","./DrawCommand","./PassState","./PickFramebuffer","./PixelDatatype","./RenderbufferFormat","./RenderState","./ShaderCache","./ShaderProgram","./Texture","./UniformState","./VertexArray","./WebGLConstants"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R){"use strict";function O(e,t){var i="WebGL Error: ";switch(t){case e.INVALID_ENUM:i+="INVALID_ENUM";break;case e.INVALID_VALUE:i+="INVALID_VALUE";break;case e.INVALID_OPERATION:i+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:i+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:i+="CONTEXT_LOST_WEBGL lost";break;default:i+="Unknown ("+t+")"}return i}function N(e,t,i,r){for(var n=O(e,r)+": "+t.name+"(",o=0;or;++r){var n=e.getExtension(t[r]);if(n)return n}}function k(i,a){if("undefined"==typeof WebGLRenderingContext)throw new f("The browser does not support WebGL. Visit http://get.webgl.org.");this._canvas=i,a=e(a,!0),a=n(a,{}),a.allowTextureFilterAnisotropic=n(a.allowTextureFilterAnisotropic,!0);var s=n(a.webgl,{});s.alpha=n(s.alpha,!1);var l,u=!1,c="undefined"!=typeof WebGL2RenderingContext,h=!1;if(u&&c&&(l=i.getContext("webgl2",s)||i.getContext("experimental-webgl2",s)||void 0,o(l)&&(h=!0)),o(l)||(l=i.getContext("webgl",s)||i.getContext("experimental-webgl",s)||void 0),!o(l))throw new f("The browser supports WebGL, but initialization failed.");this._originalGLContext=l,this._webgl2=h,this._id=r(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new A(this);var d=this._gl=this._originalGLContext;this._redBits=d.getParameter(d.RED_BITS),this._greenBits=d.getParameter(d.GREEN_BITS),this._blueBits=d.getParameter(d.BLUE_BITS),this._alphaBits=d.getParameter(d.ALPHA_BITS),this._depthBits=d.getParameter(d.DEPTH_BITS),this._stencilBits=d.getParameter(d.STENCIL_BITS),y._maximumCombinedTextureImageUnits=d.getParameter(d.MAX_COMBINED_TEXTURE_IMAGE_UNITS),y._maximumCubeMapSize=d.getParameter(d.MAX_CUBE_MAP_TEXTURE_SIZE),y._maximumFragmentUniformVectors=d.getParameter(d.MAX_FRAGMENT_UNIFORM_VECTORS),y._maximumTextureImageUnits=d.getParameter(d.MAX_TEXTURE_IMAGE_UNITS),y._maximumRenderbufferSize=d.getParameter(d.MAX_RENDERBUFFER_SIZE),y._maximumTextureSize=d.getParameter(d.MAX_TEXTURE_SIZE),y._maximumVaryingVectors=d.getParameter(d.MAX_VARYING_VECTORS),y._maximumVertexAttributes=d.getParameter(d.MAX_VERTEX_ATTRIBS),y._maximumVertexTextureImageUnits=d.getParameter(d.MAX_VERTEX_TEXTURE_IMAGE_UNITS),y._maximumVertexUniformVectors=d.getParameter(d.MAX_VERTEX_UNIFORM_VECTORS);var p=d.getParameter(d.ALIASED_LINE_WIDTH_RANGE);y._minimumAliasedLineWidth=p[0],y._maximumAliasedLineWidth=p[1];var m=d.getParameter(d.ALIASED_POINT_SIZE_RANGE);y._minimumAliasedPointSize=m[0],y._maximumAliasedPointSize=m[1];var v=d.getParameter(d.MAX_VIEWPORT_DIMS);y._maximumViewportWidth=v[0],y._maximumViewportHeight=v[1];var g=d.getShaderPrecisionFormat(d.FRAGMENT_SHADER,d.HIGH_FLOAT);y._highpFloatSupported=0!==g.precision;var _=d.getShaderPrecisionFormat(d.FRAGMENT_SHADER,d.HIGH_INT);y._highpIntSupported=0!==_.rangeMax,this._antialias=d.getContextAttributes().antialias,this._standardDerivatives=!!V(d,["OES_standard_derivatives"]),this._elementIndexUint=!!V(d,["OES_element_index_uint"]),this._depthTexture=!!V(d,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._textureFloat=!!V(d,["OES_texture_float"]),this._fragDepth=!!V(d,["EXT_frag_depth"]),this._debugShaders=V(d,["WEBGL_debug_shaders"]);var C=a.allowTextureFilterAnisotropic?V(d,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=C,y._maximumTextureFilterAnisotropy=o(C)?d.getParameter(C.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;var E,w,T,x,P,I,D,O,N,L;if(h){var F=this;E=function(){return F._gl.createVertexArray()},w=function(e){F._gl.bindVertexArray(e)},T=function(e){F._gl.deleteVertexArray(e)},x=function(e,t,i,r,n){d.drawElementsInstanced(e,t,i,r,n)},P=function(e,t,i,r){d.drawArraysInstanced(e,t,i,r)},I=function(e,t){d.vertexAttribDivisor(e,t)},D=function(e){d.drawBuffers(e)}}else O=V(d,["OES_vertex_array_object"]),o(O)&&(E=function(){return O.createVertexArrayOES()},w=function(e){O.bindVertexArrayOES(e)},T=function(e){O.deleteVertexArrayOES(e)}),N=V(d,["ANGLE_instanced_arrays"]),o(N)&&(x=function(e,t,i,r,n){N.drawElementsInstancedANGLE(e,t,i,r,n)},P=function(e,t,i,r){N.drawArraysInstancedANGLE(e,t,i,r)},I=function(e,t){N.vertexAttribDivisorANGLE(e,t)}),L=V(d,["WEBGL_draw_buffers"]),o(L)&&(D=function(e){L.drawBuffersWEBGL(e)});this.glCreateVertexArray=E,this.glBindVertexArray=w,this.glDeleteVertexArray=T,this.glDrawElementsInstanced=x,this.glDrawArraysInstanced=P,this.glVertexAttribDivisor=I,this.glDrawBuffers=D,this._vertexArrayObject=!!O,this._instancedArrays=!!N,this._drawBuffers=!!L,y._maximumDrawBuffers=this.drawBuffers?d.getParameter(R.MAX_DRAW_BUFFERS):1,y._maximumColorAttachments=this.drawBuffers?d.getParameter(R.MAX_COLOR_ATTACHMENTS):1;var B=d.getParameter(d.COLOR_CLEAR_VALUE);this._clearColor=new t(B[0],B[1],B[2],B[3]),this._clearDepth=d.getParameter(d.DEPTH_CLEAR_VALUE),this._clearStencil=d.getParameter(d.STENCIL_CLEAR_VALUE);var k=new M,z=new S(this),U=b.fromCache();this._defaultPassState=z,this._defaultRenderState=U,this._defaultTexture=void 0,this._defaultCubeMap=void 0,this._us=k,this._currentRenderState=U,this._currentPassState=z,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(var G=0;Gr;++r)e.activeTexture(e.TEXTURE0+r),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)},k.prototype.readPixels=function(e){var t=this._gl;e=e||{};var i=Math.max(e.x||0,0),r=Math.max(e.y||0,0),n=e.width||t.drawingBufferWidth,o=e.height||t.drawingBufferHeight,a=e.framebuffer,s=new Uint8Array(4*n*o);return G(this,a),t.readPixels(i,r,n,o,t.RGBA,t.UNSIGNED_BYTE,s),s};var Z={position:0,textureCoordinates:1};return k.prototype.getViewportQuadVertexArray=function(){var e=this.cache.viewportQuad_vertexArray;if(!o(e)){var t=new c({attributes:{position:new h({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new h({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:m.TRIANGLES});e=D.fromGeometry({context:this,geometry:t,attributeLocations:Z,bufferUsage:g.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e},k.prototype.createViewportQuadCommand=function(e,t){return t=n(t,n.EMPTY_OBJECT),new E({vertexArray:this.getViewportQuadVertexArray(),primitiveType:m.TRIANGLES,renderState:t.renderState,shaderProgram:P.fromCache({context:this,vertexShaderSource:v,fragmentShaderSource:e,attributeLocations:Z}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer})},k.prototype.createPickFramebuffer=function(){return new w(this)},k.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]},a(q.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}}),q.prototype.destroy=function(){delete this._pickObjects[this.key]},k.prototype.createPickId=function(e){++this._nextPickColor[0];var i=this._nextPickColor[0];if(0===i)throw new f("Out of unique Pick IDs.");return this._pickObjects[i]=e,new q(this._pickObjects,i,t.fromRgba(i))},k.prototype.isDestroyed=function(){return!1},k.prototype.destroy=function(){var e=this.cache;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];o(i.destroy)&&i.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),s(this)},k}),i("Renderer/loadCubeMap",["../Core/defined","../Core/DeveloperError","../Core/loadImage","../ThirdParty/when","./CubeMap"],function(e,t,i,r,n){"use strict";function o(e,t,o){var a=[i(t.positiveX,o),i(t.negativeX,o),i(t.positiveY,o),i(t.negativeY,o),i(t.positiveZ,o),i(t.negativeZ,o)];return r.all(a,function(t){return new n({context:e,source:{positiveX:t[0],negativeX:t[1],positiveY:t[2],negativeY:t[3],positiveZ:t[4],negativeZ:t[5]}})})}return o}),i("Scene/DiscardMissingTileImagePolicy",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/getImagePixels","../Core/loadImageViaBlob","../ThirdParty/when"],function(e,t,i,r,n,o){"use strict";function a(a){function s(e){t(e.blob)&&(u._missingImageByteLength=e.blob.size);var i=r(e);if(a.disableCheckIfAllPixelsAreTransparent){for(var n=!0,o=e.width,s=a.pixelsToCheck,l=0,c=s.length;n&&c>l;++l){var h=s[l],d=4*h.x+h.y*o,p=i[d+3];p>0&&(n=!1)}n&&(i=void 0)}u._missingImagePixels=i,u._isReady=!0}function l(){u._missingImagePixels=void 0,u._isReady=!0}if(a=e(a,e.EMPTY_OBJECT),!t(a.missingImageUrl))throw new i("options.missingImageUrl is required.");if(!t(a.pixelsToCheck))throw new i("options.pixelsToCheck is required.");this._pixelsToCheck=a.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;var u=this;o(n(a.missingImageUrl),s,l)}return a.prototype.isReady=function(){return this._isReady},a.prototype.shouldDiscardImage=function(e){if(!this._isReady)throw new i("shouldDiscardImage must not be called before the discard policy is ready.");var n=this._pixelsToCheck,o=this._missingImagePixels;if(!t(o))return!1;if(t(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;for(var a=r(e),s=e.width,l=0,u=n.length;u>l;++l)for(var c=n[l],h=4*c.x+c.y*s,d=0;4>d;++d){var p=h+d;if(a[p]!==o[p])return!1}return!0},a}),i("Scene/ImageryLayerFeatureInfo",["../Core/defined"],function(e){"use strict";function t(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}return t.prototype.configureNameFromProperties=function(t){var i,r=10;for(var n in t)if(t.hasOwnProperty(n)&&t[n]){var o=n.toLowerCase();r>1&&"name"===o?(r=1,i=n):r>2&&"title"===o?(r=2,i=n):r>3&&/name/i.test(n)?(r=3,i=n):r>4&&/title/i.test(n)&&(r=4, -i=n)}e(i)&&(this.name=t[i])},t.prototype.configureDescriptionFromProperties=function(t){function i(t){var r='';for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];e(o)&&(r+="object"==typeof o?"":"")}return r+="
"+n+""+i(o)+"
"+n+""+o+"
"}this.description=i(t)},t}),i("Scene/ImageryProvider",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/loadImage","../Core/loadImageViaBlob","../Core/throttleRequestByServer"],function(e,t,i,r,n,o){"use strict";function a(){this.defaultAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,i.throwInstantiationError()}return t(a.prototype,{ready:{get:i.throwInstantiationError},readyPromise:{get:i.throwInstantiationError},rectangle:{get:i.throwInstantiationError},tileWidth:{get:i.throwInstantiationError},tileHeight:{get:i.throwInstantiationError},maximumLevel:{get:i.throwInstantiationError},minimumLevel:{get:i.throwInstantiationError},tilingScheme:{get:i.throwInstantiationError},tileDiscardPolicy:{get:i.throwInstantiationError},errorEvent:{get:i.throwInstantiationError},credit:{get:i.throwInstantiationError},proxy:{get:i.throwInstantiationError},hasAlphaChannel:{get:i.throwInstantiationError}}),a.prototype.getTileCredits=i.throwInstantiationError,a.prototype.requestImage=i.throwInstantiationError,a.prototype.pickFeatures=i.throwInstantiationError,a.loadImage=function(t,i){return e(t.tileDiscardPolicy)?o(i,n,{headers:t.headers,withCredentials:t.withCredentials}):o(i,r,{headers:t.headers,withCredentials:t.withCredentials})},a}),i("Scene/ArcGisMapServerImageryProvider",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicProjection","../Core/GeographicTilingScheme","../Core/loadJson","../Core/loadJsonp","../Core/Math","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorProjection","../Core/WebMercatorTilingScheme","../ThirdParty/when","./DiscardMissingTileImagePolicy","./ImageryLayerFeatureInfo","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S){"use strict";function w(t){function i(i){var n=i.tileInfo;if(o(n)){if(h._tileWidth=n.rows,h._tileHeight=n.cols,102100===n.spatialReference.wkid||102113===n.spatialReference.wkid)h._tilingScheme=new _({ellipsoid:t.ellipsoid});else{if(4326!==i.tileInfo.spatialReference.wkid){var a="Tile spatial reference WKID "+i.tileInfo.spatialReference.wkid+" is not supported.";return void(u=v.handleError(u,h,h._errorEvent,a,void 0,void 0,void 0,s))}h._tilingScheme=new c({ellipsoid:t.ellipsoid})}if(h._maximumLevel=i.tileInfo.lods.length-1,o(i.fullExtent)){if(o(i.fullExtent.spatialReference)&&o(i.fullExtent.spatialReference.wkid))if(102100===i.fullExtent.spatialReference.wkid||102113===i.fullExtent.spatialReference.wkid){var l=new g,d=l.unproject(new e(i.fullExtent.xmin,i.fullExtent.ymin)),p=l.unproject(new e(i.fullExtent.xmax,i.fullExtent.ymax));h._rectangle=new m(d.longitude,d.latitude,p.longitude,p.latitude)}else{if(4326!==i.fullExtent.spatialReference.wkid){var f="fullExtent.spatialReference WKID "+i.fullExtent.spatialReference.wkid+" is not supported.";return void(u=v.handleError(u,h,h._errorEvent,f,void 0,void 0,void 0,s))}h._rectangle=m.fromDegrees(i.fullExtent.xmin,i.fullExtent.ymin,i.fullExtent.xmax,i.fullExtent.ymax)}}else h._rectangle=h._tilingScheme.rectangle;o(h._tileDiscardPolicy)||(h._tileDiscardPolicy=new C({missingImageUrl:T(h,0,0,h._maximumLevel),pixelsToCheck:[new e(0,0),new e(200,20),new e(20,200),new e(80,110),new e(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),h._useTiles=!0}else h._useTiles=!1;o(i.copyrightText)&&i.copyrightText.length>0&&(h._credit=new r(i.copyrightText)),h._ready=!0,h._readyPromise.resolve(!0),v.handleSuccess(u)}function a(e){var t="An error occurred while accessing "+h._url+".";u=v.handleError(u,h,h._errorEvent,t,void 0,void 0,void 0,s),h._readyPromise.reject(new f(t))}function s(){var e={f:"json"};o(h._token)&&(e.token=h._token);var t=d(h._url,{parameters:e,proxy:h._proxy});y(t,i,a)}t=n(t,{}),this._url=t.url,this._token=t.token,this._tileDiscardPolicy=t.tileDiscardPolicy,this._proxy=t.proxy,this._tileWidth=n(t.tileWidth,256),this._tileHeight=n(t.tileHeight,256),this._maximumLevel=t.maximumLevel,this._tilingScheme=n(t.tilingScheme,new c({ellipsoid:t.ellipsoid})),this._credit=void 0,this._useTiles=n(t.usePreCachedTilesIfAvailable,!0),this._rectangle=n(t.rectangle,this._tilingScheme.rectangle),this._layers=t.layers,this.enablePickFeatures=n(t.enablePickFeatures,!0),this._errorEvent=new l,this._ready=!1,this._readyPromise=y.defer();var u,h=this;this._useTiles?s():(this._ready=!0,this._readyPromise.resolve(!0))}function T(e,t,i,r){var n;if(e._useTiles)n=e._url+"/tile/"+r+"/"+i+"/"+t;else{var a=e._tilingScheme.tileXYToNativeRectangle(t,i,r),s=a.west+"%2C"+a.south+"%2C"+a.east+"%2C"+a.north;n=e._url+"/export?",n+="bbox="+s,n+=e._tilingScheme instanceof c?"&bboxSR=4326&imageSR=4326":"&bboxSR=3857&imageSR=3857",n+="&size="+e._tileWidth+"%2C"+e._tileHeight,n+="&format=png&transparent=true&f=image",e.layers&&(n+="&layers=show:"+e.layers)}var l=e._token;o(l)&&(-1===n.indexOf("?")&&(n+="?"),"?"!==n[n.length-1]&&(n+="&"),n+="token="+l);var u=e._proxy;return o(u)&&(n=u.getURL(n)),n}return a(w.prototype,{url:{get:function(){return this._url}},token:{get:function(){return this._token}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}}),w.prototype.getTileCredits=function(e,t,i){},w.prototype.requestImage=function(e,t,i){var r=T(this,e,t,i);return S.loadImage(this,r)},w.prototype.pickFeatures=function(e,r,n,a,s){if(this.enablePickFeatures){var l,u,d,m=this._tilingScheme.tileXYToNativeRectangle(e,r,n);if(this._tilingScheme instanceof c)l=p.toDegrees(a),u=p.toDegrees(s),d="4326";else{var f=this._tilingScheme.projection.project(new i(a,s,0));l=f.x,u=f.y,d="3857"}var v=this._url+"/identify?f=json&tolerance=2&geometryType=esriGeometryPoint";return v+="&geometry="+l+","+u,v+="&mapExtent="+m.west+","+m.south+","+m.east+","+m.north,v+="&imageDisplay="+this._tileWidth+","+this._tileHeight+",96",v+="&sr="+d,v+="&layers=visible",o(this._layers)&&(v+=":"+this._layers),o(this._token)&&(v+="&token="+this._token),o(this._proxy)&&(v=this._proxy.getURL(v)),h(v).then(function(e){var r=[],n=e.results;if(!o(n))return r;for(var a=0;al;++l){var p=s[l];p.credit=new i(p.attribution);for(var m=p.coverageAreas,f=0,g=p.coverageAreas.length;g>f;++f){var _=m[f],C=_.bbox;_.bbox=new c(u.toRadians(C[1]),u.toRadians(C[0]),u.toRadians(C[3]),u.toRadians(C[2]))}}w._ready=!0,w._readyPromise.resolve(!0),d.handleSuccess(E)}function g(e){var t="An error occurred while accessing "+S+".";E=d.handleError(E,w,w._errorEvent,t,void 0,void 0,void 0,C),w._readyPromise.reject(new h(t))}function C(){var e=l(S,{callbackParameterName:"jsonp",proxy:w._proxy});m(e,a,g)}o=r(o,{}),this._key=e.getKey(o.key),this._url=o.url,this._tileProtocol=o.tileProtocol,this._mapStyle=r(o.mapStyle,f.AERIAL),this._culture=r(o.culture,""),this._tileDiscardPolicy=o.tileDiscardPolicy,this._proxy=o.proxy,this._credit=new i("Bing Imagery",_._logoData,"http://www.bing.com"),this.defaultGamma=1,(this._mapStyle===f.AERIAL||this._mapStyle===f.AERIAL_WITH_LABELS)&&(this.defaultGamma=1.3),this._tilingScheme=new p({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:o.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._errorEvent=new s,this._ready=!1,this._readyPromise=m.defer();var E,S=this._url+"/REST/v1/Imagery/Metadata/"+this._mapStyle+"?incl=ImageryProviders&key="+this._key,w=this;C()}function y(e,t,i,r){var o=e._imageUrlTemplate,a=_.tileXYToQuadKey(t,i,r);o=o.replace("{quadkey}",a);var s=e._imageUrlSubdomains,l=(t+i+r)%s.length;o=o.replace("{subdomain}",s[l]);var u=e._proxy;return n(u)&&(o=u.getURL(o)),o}function C(e,t,i){++t;for(var r=[],o=0,a=e.length;a>o;++o){for(var s=e[o],l=s.coverageAreas,u=!1,h=0,d=s.coverageAreas.length;!u&&d>h;++h){var p=l[h];if(t>=p.zoomMin&&t<=p.zoomMax){var m=c.intersection(i,p.bbox,S);n(m)&&(u=!0)}}u&&r.push(s.credit)}return r}o(_.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});var E=new c;_.prototype.getTileCredits=function(e,t,i){if(!this._ready)throw new a("getTileCredits must not be called before the imagery provider is ready.");var r=this._tilingScheme.tileXYToRectangle(e,t,i,E);return C(this._attributionList,i,r)},_.prototype.requestImage=function(e,t,i){var r=y(this,e,t,i);return g.loadImage(this,r)},_.prototype.pickFeatures=function(){},_._logoData="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD0AAAAaCAYAAAAEy1RnAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH3gIDEgcPTMnXOQAAClZJREFUWMPdWGtsFNcV/u689uH1+sXaONhlWQzBENtxiUFBpBSLd60IpXHSNig4URtSYQUkRJNSi0igViVVVBJBaBsiAgKRQJSG8AgEHCCWU4iBCprY2MSgXfOI16y9D3s9Mzsztz9yB12WNU2i9Ecy0tHOzN4793zn3POdcy7BnRfJ8I7iB3SRDPeEExswLz8Y0DZIAYDIRGAgLQAm+7Xle31J3L3Anp1MZPY+BUBjorN332vgYhpgV1FRUd6TTz45ubq6OtDV1SXpuu5g//Oept9wNwlMyAi8IXDjyF245TsDTdivDMATCATGNDU1/WbhwoWPTZs2bWx1dXWhx+Oxrl+/PqTrus5t9W8KWEzjinTAYhro/xuBStwiIgBnJBLxKIoy1u/3V/r9/krDMMz3339/Z3t7e38ikUgCMDLEt8W+Q0cAI3McYTDDmZxh7DESG5Ni43jg9Gsa+X+OsxWxPSJTSj3JZFK5ZRVJErOzs8e6XC4fgGwALhbzDgAKU1hK28KEA6PMmTMn56233qpevnz5PQDcbJ7EzVUAuMrLy3MBeABkcWOEDELSyFe4y7iMoHkriZZlKYZh8ASHZDKpJJPJHAC5APIA5APIAeBlCjo5TwlpXnbOmTPHP3fu3KZVq1atZKBcDJQ9x7V48WJfc3Pzhp6enj+tXLnyR8w4MjdG4gyVDk7KICMClzKlLUrpbQMNw5AkScppbGz8cWdn57WjR4/2caw+DEBlYjO8wX1foZQWuN3uKZIklQD4G+fhlG0Yl8uVm5WVVW6app6dne0D0G8vnxbjJntHubCUOK/badZICyWanrJuAaeUknTQpmlKkUhEWbx48U8LCwtHhUKha+fPn+85fPhwV0tLyzUACSZx9jvMFhIByNFoVDEMw/qKB5HPvJfkUqBr9+7deklJyZ/j8bi5ffv2OAslieMLsG+m2DybT2QuzEQOsF5SUqJfvXo1yc2l6Xn6rgSRSCSEc+fOhVeuXLmwoqJixvTp0wcWLFgQ7unpudHR0dF97ty5z/fu3XseQJh5adjeerquy5ZlCalUivh8Pt8HH3ywzOPxyD09PZ81NjZ+2NnZaQEQx40b54vFYqaqquEVK1b4a2tr/WvWrDn18ssv144fP36SqqoD69ev371nz57rDLwAwHHkyJGfjRs3rtowDOv06dOnu7q6rs6bN2/s7Nmz9zIjDKenWoFZKg/AlMLCwl82Nzf/m3LX22+/fXb06NF/ALC8u7u7m6ZdkUhksL29/UpLS0vzunXrVgAoBzAaQBGAiY2NjUui0ei1RCLRFwwG/9PX19cVi8WCqqoOdHd3HysrK6sDMCccDl8IBoOtiqIsOnbs2D+i0eiV3t7ez8Ph8GeRSKRT07TB/v7+i1OnTp0HYBqABzs7O/+paVo0Fot1RyKRi/F4/Gp/f39XIpHoZnoUMn6wU+ZtRDaymwmxZFk2AWjvvvvuJ/F4PMn/n5+fn1VeXu6fOXNmbU1NzUOM4Bz8QqIoyg6HwxuLxfq3bdu2a+vWrW/09/dfKy0tffDVV199BEC20+n0ud3uQgBup9Pp83g8JYqieE+ePPnxxo0bt33xxRen8/Ly7n3hhRcWASh47bXX5pWVldWFw+GuXbt27XjzzTd3BoPBDq/XG1AUZRRHmAKPVfqaoKkgCCkA+oYNG84Eg0FHTU1N5ezZs8eWlJQ4CSF8/LvZYhJPQoQQpFKpwcrKyo1su9HBwUF99erVv588eXINgOOmacIwDEopdaZSKUIpxYkTJz6sr68/BMBav379RcMwZk2aNOl+AP+qq6t7xDTNVEVFxR+j0WgSAJk4ceKlTz/9tNzpdHpZvIvpjVW6pykhhBJCbkvwgiAQQogEQL558ybdtGlTsLm5OWJZdxZmlmWll5OUEEJN0zSGhob6GcOrALSzZ8/2apqWcLlc2axGACNRkRAimqaph0Kh68xIwwB0y7IMSZKcABz5+fkl8Xj8y2g0apOb5na7rYGBgS/JV54Q0qpAAoBKaS0jBWClg1ZVFeFw2AlgVF1dXeDpp5+eWVFRUVpcXOzgvQwAbrcbDJhdudlGpKZpGtx6JCcnRxIEQbQsS2PjbjM+AMvlchnMSBaXkr7ymCCIhmEYfMoVRVESBEHI0CaTTNubssUsQRBuubCtra33pZdeCk6YMCGwZs2aipqaGn9paWmuJEl3JP0bN258eeTIkRMABrm0YomiaImiKGVlZeWxLecAgBkzZvgdDkfWjRs3ggA0bpfpoiiahBCqKEqKAy2yULMA6MlkMp6Xl3cP1x2SWCwmFhQU+CmlFhfHNFOevpX4LcvSJUkyAeDQoUOh119//fpTTz01Zf78+UWBQCBHUZQ7yE/TNGPfvn0n33vvvSP79+//BECMeZsCMGRZNgRBgNPpHHXx4sVVDQ0Nf1+wYMGYJ554YikAevDgwUMA4oIgQJZlSggZdDqdBiGEZGdn6ww0tQlJURTT4/EMHz9+/MCjjz7622AwuHbZsmVbiouLvWvXrm1wOp3ZqVRqaKQTIInf1gAMl8ulU0q1CxcuBGOxmL5u3bryQCDgycrKEjORXGtra8eOHTsOHz169OyVK1cuA+hlRYrGlNRkWR7UNO2mYRiaz+cb3dLS8gYhhOi6Hj116tSOVatWHQNALcsaME0zLghClBDSZ9+zQsZ2SoJS2udwOKLPPffcvsrKyrJAIPDQ/v37txiGofX19V3r7e29UlBQMHqEVpjwnrYA6PF4PK6q6s2qqqqpZWVlitvtljOB7enpiWzbtu3wgQMHTre1tV0E0MeKkkGuIhMAqHv37u30er3Px+NxlyiKygMPPOAnhFiXLl0Kbd68uYPNsXbu3Lk6mUwaqqr2btmyZUdtbe3hd955pwvAEFNcO3jw4K/b2tqiqqpGIpGI4/HHH/9rQ0PDCa/XOyoSidDLly8PNTU1PcZ4QuNK1ju6NYHFRAGASXPnzv1Fa2vrxzTDpapqateuXR/Nnz+/SVGUhwFMBzCBFSLZLF75DsrJGpXRAH4EIABgPIBxAEoBFAPwARjFif1sNzZ25+VlOhaxufcCqAFQC+BhAPVLliz5XSqVUkOhUAuAKWnFyR3dlsw+fg+A+8eMGfPzTZs2bY9GozEb8JkzZ9qXLl36l+Li4l8B+AmAyQDGsGrOzfXNPGPawG2l85jksmcPm+vihH+2W1iF3bvZPN+sWbPuGx4eDrW3t+85fvz41o6OjmZN04Y0TYvV19cvYIbN5QqUjG2mwj5YAqDK4XDMe+aZZ55vbW09+sorr2yuqqpqYFatAuBn3uB7XzJCY297XeaUd2RoGzOJmHb6IjFj5D777LP3DQwMfDw8PBxSVbUvkUj0hEKhj1588cXH2O7zMSPdplumoxveMx5Zlj3jx4/39vb26gMDA4MsvgYZo+p8Pr7LqQX5Ds/U7d0jFxUVZS1atKg4Nzc317Isp67rZldXV6y5ufkmI78hFtcmrx8ZweMit6XsUs4+6kmlgbW+peLf9gyMZNCR374G0y/FxEzX8b/8+bkXEBxKFwAAAABJRU5ErkJggg==",_.tileXYToQuadKey=function(e,t,i){for(var r="",n=i;n>=0;--n){var o=1<=0;--n){var o=1<r;++r){var l=e.intersectPlane(o.fromCartesian4(t[r],s));if(l===n.OUTSIDE)return n.OUTSIDE;l===n.INTERSECTING&&(i=!0)}return i?n.INTERSECTING:n.INSIDE},a.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===a.MASK_OUTSIDE||t===a.MASK_INSIDE)return t;for(var i=a.MASK_INSIDE,r=this.planes,l=0,u=r.length;u>l;++l){var c=31>l?1<l&&0===(t&c))){var h=e.intersectPlane(o.fromCartesian4(r[l],s));if(h===n.OUTSIDE)return a.MASK_OUTSIDE;h===n.INTERSECTING&&(i|=c)}}return i},a.MASK_OUTSIDE=4294967295,a.MASK_INSIDE=0,a.MASK_INDETERMINATE=2147483647,a}),i("Scene/PerspectiveOffCenterFrustum",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","./CullingVolume"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(){this.left=void 0,this._left=void 0,this.right=void 0,this._right=void 0,this.top=void 0,this._top=void 0,this.bottom=void 0,this._bottom=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far,this._cullingVolume=new l,this._perspectiveMatrix=new s,this._infinitePerspective=new s}function c(e){var t=e.top,i=e.bottom,r=e.right,n=e.left,o=e.near,a=e.far;(t!==e._top||i!==e._bottom||n!==e._left||r!==e._right||o!==e._near||a!==e._far)&&(e._left=n,e._right=r,e._top=t,e._bottom=i,e._near=o,e._far=a,e._perspectiveMatrix=s.computePerspectiveOffCenter(n,r,i,t,o,a,e._perspectiveMatrix),e._infinitePerspective=s.computeInfinitePerspectiveOffCenter(n,r,i,t,o,e._infinitePerspective))}o(u.prototype,{projectionMatrix:{get:function(){return c(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return c(this),this._infinitePerspective}}});var h=new t,d=new t,p=new t,m=new t;return u.prototype.computeCullingVolume=function(e,r,o){var a=this._cullingVolume.planes,s=this.top,l=this.bottom,u=this.right,c=this.left,f=this.near,v=this.far,g=t.cross(r,o,h),_=d;t.multiplyByScalar(r,f,_),t.add(e,_,_);var y=p;t.multiplyByScalar(r,v,y),t.add(e,y,y);var C=m;t.multiplyByScalar(g,c,C),t.add(_,C,C),t.subtract(C,e,C),t.normalize(C,C),t.cross(C,o,C);var E=a[0];return n(E)||(E=a[0]=new i),E.x=C.x,E.y=C.y,E.z=C.z,E.w=-t.dot(C,e),t.multiplyByScalar(g,u,C),t.add(_,C,C),t.subtract(C,e,C),t.normalize(C,C),t.cross(o,C,C),E=a[1],n(E)||(E=a[1]=new i),E.x=C.x,E.y=C.y,E.z=C.z,E.w=-t.dot(C,e),t.multiplyByScalar(o,l,C),t.add(_,C,C),t.subtract(C,e,C),t.normalize(C,C),t.cross(g,C,C),E=a[2],n(E)||(E=a[2]=new i),E.x=C.x,E.y=C.y,E.z=C.z,E.w=-t.dot(C,e),t.multiplyByScalar(o,s,C),t.add(_,C,C),t.subtract(C,e,C),t.normalize(C,C),t.cross(C,g,C),E=a[3],n(E)||(E=a[3]=new i),E.x=C.x,E.y=C.y,E.z=C.z,E.w=-t.dot(C,e),E=a[4],n(E)||(E=a[4]=new i),E.x=r.x,E.y=r.y,E.z=r.z,E.w=-t.dot(r,_),t.negate(r,C),E=a[5],n(E)||(E=a[5]=new i),E.x=C.x,E.y=C.y,E.z=C.z,E.w=-t.dot(C,y),this._cullingVolume},u.prototype.getPixelDimensions=function(e,t,i,r){c(this);var n=1/this.near,o=this.top*n,a=2*i*o/t;o=this.right*n;var s=2*i*o/e;return r.x=s,r.y=a,r},u.prototype.clone=function(e){return n(e)||(e=new u),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e},u.prototype.equals=function(e){return n(e)&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},u}),i("Scene/PerspectiveFrustum",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","./PerspectiveOffCenterFrustum"],function(e,t,i,r){"use strict";function n(){this._offCenterFrustum=new r,this.fov=void 0,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=void 0,this._aspectRatio=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far,this.xOffset=0,this._xOffset=this.xOffset,this.yOffset=0,this._yOffset=this.yOffset}function o(e){var t=e._offCenterFrustum;(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset)&&(e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:2*Math.atan(Math.tan(.5*e.fov)/e.aspectRatio),e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset,t.top=e.near*Math.tan(.5*e._fovy),t.bottom=-t.top,t.right=e.aspectRatio*t.top,t.left=-t.right,t.near=e.near,t.far=e.far,t.right+=e.xOffset,t.left+=e.xOffset,t.top+=e.yOffset,t.bottom+=e.yOffset)}return t(n.prototype,{projectionMatrix:{get:function(){return o(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return o(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return o(this),this._fovy}},sseDenominator:{get:function(){return o(this),this._sseDenominator}}}),n.prototype.computeCullingVolume=function(e,t,i){return o(this),this._offCenterFrustum.computeCullingVolume(e,t,i)},n.prototype.getPixelDimensions=function(e,t,i,r){return o(this),this._offCenterFrustum.getPixelDimensions(e,t,i,r)},n.prototype.clone=function(t){return e(t)||(t=new n),t.aspectRatio=this.aspectRatio,t.fov=this.fov,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._fov=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},n.prototype.equals=function(t){return e(t)?(o(this),o(t),this.fov===t.fov&&this.aspectRatio===t.aspectRatio&&this.near===t.near&&this.far===t.far&&this._offCenterFrustum.equals(t._offCenterFrustum)):!1},n}),i("Scene/CameraFlightPath",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/EasingFunction","../Core/Math","./PerspectiveFrustum","./PerspectiveOffCenterFrustum","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e,t,i){var r,n,o;if(e instanceof l){var a=Math.tan(.5*e.fovy);return r=e.near,n=e.near*a,o=e.aspectRatio*n,Math.max(t*r/o,i*r/n)}return e instanceof u?(r=e.near,n=e.top,o=e.right,Math.max(t*r/o,i*r/n)):Math.max(t,i)}function d(e,i,r,o,a){var l,u=a;if(!n(a)){var c=e.position,d=i,p=e.up,m=e.right,f=e.frustum,v=t.subtract(c,d,C),g=t.magnitude(t.multiplyByScalar(p,t.dot(v,p),E)),_=t.magnitude(t.multiplyByScalar(m,t.dot(v,m),E));l=Math.max(r,o),u=Math.min(.2*h(f,g,_),1e9)}if(n(a)&&u>a||u>l){var y=8,S=1e6,w=-Math.pow((u-r)*S,1/y),T=Math.pow((u-o)*S,1/y);return function(e){var t=e*(T-w)+w;return-Math.pow(t,y)/S+u}}return function(e){return s.lerp(r,o,e)}}function p(e,t){return s.equalsEpsilon(e,s.TWO_PI,s.EPSILON11)&&(e=0),t>e+Math.PI?e+=s.TWO_PI:ts.PI&&(C.longitude+=s.TWO_PI);var S=d(h,n,v.height,C.height,u);return c}function v(i,r,n,o,a,l,u){function c(t){var i=t.time/r;h.setView({orientation:{heading:s.lerp(f,o,i)}}),e.lerp(m,n,i,h.position);var a=g(i),l=h.frustum,u=l.top/l.right,c=.5*(a-(l.right-l.left));l.right+=c,l.left-=c,l.top=u*l.right,l.bottom=-l.top}var h=i.camera,m=t.clone(h.position,S),f=p(h.heading,o),v=h.frustum.right-h.frustum.left,g=d(h,n,v,n.z,u);return c}function g(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function _(e,t){function i(){"function"==typeof t&&t(),e.enableInputs=!0}return i}var y={},C=new t,E=new t,S=new t,w=new i,T=new i,x=new i,b=new t;return y.createTween=function(i,o){o=r(o,r.EMPTY_OBJECT);var l=o.destination,u=i.mode;if(u===c.MORPHING)return g();var h=r(o.convert,!0),d=i.mapProjection,p=d.ellipsoid,y=o.maximumHeight,C=o.easingFunction;h&&u!==c.SCENE3D&&(p.cartesianToCartographic(l,x),l=d.project(x,b));var E=i.camera,S=o.endTransform;n(S)&&E._setTransform(S);var w=o.duration;n(w)||(w=Math.ceil(t.distance(E.position,l)/1e6)+2,w=Math.min(w,3));var T=r(o.heading,0),A=r(o.pitch,-s.PI_OVER_TWO),P=r(o.roll,0),I=i.screenSpaceCameraController;I.enableInputs=!1;var M=_(I,o.complete),D=_(I,o.cancel),R=E.frustum,O=i.mode===c.SCENE2D;if(O=O&&e.equalsEpsilon(E.position,l,s.EPSILON6),O=O&&s.equalsEpsilon(Math.max(R.right-R.left,R.top-R.bottom),l.z,s.EPSILON6),O=O||i.mode!==c.SCENE2D&&t.equalsEpsilon(l,E.position,s.EPSILON10),O=O&&s.equalsEpsilon(s.negativePiToPi(T),s.negativePiToPi(E.heading),s.EPSILON10)&&s.equalsEpsilon(s.negativePiToPi(A),s.negativePiToPi(E.pitch),s.EPSILON10)&&s.equalsEpsilon(s.negativePiToPi(P),s.negativePiToPi(E.roll),s.EPSILON10))return g(M,D);var N=new Array(4);if(N[c.SCENE2D]=v,N[c.SCENE3D]=f,N[c.COLUMBUS_VIEW]=m,0>=w){var L=function(){var e=N[u](i,1,l,T,A,P,y);e({time:1}),"function"==typeof M&&M()};return g(L,D)}var F=N[u](i,w,l,T,A,P,y);if(!n(C)){var B=E.positionCartographic.height,V=u===c.SCENE3D?p.cartesianToCartographic(l).height:l.z;C=B>V&&B>11500?a.CUBIC_OUT:a.QUINTIC_IN_OUT}return{duration:w,easingFunction:C,startObject:{time:0},stopObject:{time:w},update:F,complete:M,cancel:D}},y}),i("Scene/Camera",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/EasingFunction","../Core/Ellipsoid","../Core/EllipsoidGeodesic","../Core/Event","../Core/HeadingPitchRange","../Core/IntersectionTests","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/Ray","../Core/Rectangle","../Core/Transforms","./CameraFlightPath","./PerspectiveFrustum","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w){"use strict";function T(e){this._scene=e,this._transform=v.clone(v.IDENTITY),this._invTransform=v.clone(v.IDENTITY),this._actualTransform=v.clone(v.IDENTITY),this._actualInvTransform=v.clone(v.IDENTITY),this._transformChanged=!1,this.position=new t,this._position=new t,this._positionWC=new t,this._positionCartographic=new r,this.direction=new t,this._direction=new t,this._directionWC=new t,this.up=new t,this._up=new t,this._upWC=new t,this.right=new t,this._right=new t,this._rightWC=new t,this.frustum=new S,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=m.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumTranslateFactor=1.5,this.maximumZoomFactor=2.5,this._moveStart=new h,this._moveEnd=new h,this._viewMatrix=new v,this._invViewMatrix=new v,x(this),this._mode=w.SCENE3D,this._modeChanged=!0;var i=e.mapProjection;this._projection=i,this._maxCoord=i.project(new r(Math.PI,m.PI_OVER_TWO)),this._max2Dfrustum=void 0,W(this,T.DEFAULT_VIEW_RECTANGLE,this.position,!0);var n=t.magnitude(this.position);n+=n*T.DEFAULT_VIEW_FACTOR,t.normalize(this.position,this.position),t.multiplyByScalar(this.position,n,this.position)}function x(e){var i=e._right,r=e._up,n=e._direction,o=e._position,a=e._viewMatrix;a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-t.dot(i,o),a[13]=-t.dot(r,o),a[14]=t.dot(n,o),a[15]=1,v.multiply(a,e._actualInvTransform,e._viewMatrix),v.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function b(e){var r=e._projection,n=r.ellipsoid,o=v.getColumn(e._transform,3,ae),a=n.cartesianToCartographic(o,re),s=r.project(a,ne),l=se;l.x=s.z,l.y=s.x,l.z=s.y,l.w=1;var u=i.add(v.getColumn(e._transform,0,oe),o,oe);n.cartesianToCartographic(u,a),r.project(a,s);var c=le;c.x=s.z,c.y=s.x,c.z=s.y,c.w=0,t.subtract(c,l,c);var h=i.add(v.getColumn(e._transform,1,oe),o,oe);n.cartesianToCartographic(h,a),r.project(a,s);var d=ue;d.x=s.z,d.y=s.x,d.z=s.y,d.w=0,t.subtract(d,l,d);var p=ce;t.cross(c,d,p),t.normalize(p,p),t.cross(d,p,c),t.normalize(c,c),t.cross(p,c,d),t.normalize(d,d),v.setColumn(e._actualTransform,0,c,e._actualTransform),v.setColumn(e._actualTransform,1,d,e._actualTransform),v.setColumn(e._actualTransform,2,p,e._actualTransform),v.setColumn(e._actualTransform,3,l,e._actualTransform)}function A(e){var r=e._projection,n=r.ellipsoid,o=v.getColumn(e._transform,3,ae),a=n.cartesianToCartographic(o,re),s=r.project(a,ne),l=se;l.x=s.z,l.y=s.x,l.z=s.y,l.w=1;var u=i.clone(i.UNIT_X,ce),c=i.add(v.getColumn(e._transform,0,oe),o,oe);n.cartesianToCartographic(c,a),r.project(a,s);var h=le;h.x=s.z,h.y=s.x,h.z=s.y,h.w=0,t.subtract(h,l,h),h.x=0;var d=ue;if(t.magnitudeSquared(h)>m.EPSILON10)t.cross(u,h,d);else{var p=i.add(v.getColumn(e._transform,1,oe),o,oe);n.cartesianToCartographic(p,a),r.project(a,s),d.x=s.z,d.y=s.x,d.z=s.y,d.w=0,t.subtract(d,l,d),d.x=0,t.magnitudeSquared(d)m.EPSILON2){s=t.normalize(s,e._direction),t.clone(s,e.direction);var y=1/t.magnitudeSquared(u),C=t.dot(u,s)*y,E=t.multiplyByScalar(s,C,he);u=t.normalize(t.subtract(u,E,e._up),e._up),t.clone(u,e.up),h=t.cross(s,u,e._right),t.clone(h,e.right)}}(l||p)&&(e._directionWC=v.multiplyByPointAsVector(f,s,e._directionWC)),(c||p)&&(e._upWC=v.multiplyByPointAsVector(f,u,e._upWC)),(d||p)&&(e._rightWC=v.multiplyByPointAsVector(f,h,e._rightWC)),(a||l||c||d||p)&&x(e)}function I(e,t){ -var i;return i=m.equalsEpsilon(Math.abs(e.z),1,m.EPSILON3)?Math.atan2(t.y,t.x)-m.PI_OVER_TWO:Math.atan2(e.y,e.x)-m.PI_OVER_TWO,m.TWO_PI-m.zeroToTwoPi(i)}function M(e){return m.PI_OVER_TWO-m.acosClamped(e.z)}function D(e,t,i){var r=0;return m.equalsEpsilon(Math.abs(e.z),1,m.EPSILON3)||(r=Math.atan2(-i.z,t.z),r=m.zeroToTwoPi(r+m.TWO_PI)),r}function R(e,i,r,n,o){var a=v.clone(e.transform,_e),s=C.eastNorthUpToFixedFrame(i,e._projection.ellipsoid,ye);e._setTransform(s),t.clone(t.ZERO,e.position);var l=g.fromHeadingPitchRoll(r-m.PI_OVER_TWO,n,o,Ce),u=f.fromQuaternion(l,Ee);f.getColumn(u,0,e.direction),f.getColumn(u,2,e.up),t.cross(e.direction,e.up,e.right),e._setTransform(a)}function O(e,i,r,n,o,a){var s=v.clone(e.transform,_e);if(e._setTransform(v.IDENTITY),!t.equals(i,e.positionWC)){if(a){var l=e._projection,u=l.ellipsoid.cartesianToCartographic(i,Se);i=l.project(u,ge)}t.clone(i,e.position)}var c=g.fromHeadingPitchRoll(r-m.PI_OVER_TWO,n,o,Ce),h=f.fromQuaternion(c,Ee);f.getColumn(h,0,e.direction),f.getColumn(h,2,e.up),t.cross(e.direction,e.up,e.right),e._setTransform(s)}function N(i,r,n,o){var a=-m.PI_OVER_TWO,s=0,l=v.clone(i.transform,_e);if(i._setTransform(v.IDENTITY),!t.equals(r,i.positionWC)){if(o){var u=i._projection,c=u.ellipsoid.cartesianToCartographic(r,Se);r=u.project(c,ge)}e.clone(r,i.position);var h=.5*-r.z,d=-h,p=i.frustum;if(d>h){var _=p.top/p.right;p.right=d,p.left=h,p.top=p.right*_,p.bottom=-p.top}}var y=g.fromHeadingPitchRoll(n-m.PI_OVER_TWO,a,s,Ce),C=f.fromQuaternion(y,Ee);f.getColumn(C,2,i.up),t.cross(i.direction,i.up,i.right),i._setTransform(l)}function L(e,i,r,n){var o=t.clone(r.direction,we),a=t.clone(r.up,Te);if(e._scene.mode===w.SCENE3D){var s=e._projection.ellipsoid,l=C.eastNorthUpToFixedFrame(i,s,de),u=v.inverseTransformation(l,pe);v.multiplyByPointAsVector(u,o,o),v.multiplyByPointAsVector(u,a,a)}var c=t.cross(o,a,xe);return n.heading=I(o,a),n.pitch=M(o),n.roll=D(o,a,c),n}function F(e,t){var i=e._maxCoord.x*e.maximumTranslateFactor;t.x>i&&(t.x=i),t.x<-i&&(t.x=-i);var r=e._maxCoord.y*e.maximumTranslateFactor;t.y>r&&(t.y=r),t.y<-r&&(t.y=-r)}function B(e,i){var r=e.position,n=t.normalize(r,Re);if(o(e.constrainedAxis)){var a=t.equalsEpsilon(n,e.constrainedAxis,m.EPSILON2),s=t.equalsEpsilon(n,t.negate(e.constrainedAxis,Le),m.EPSILON2);if(a||s)(a&&0>i||s&&i>0)&&e.rotate(e.right,i);else{var l=t.normalize(e.constrainedAxis,Oe),u=t.dot(n,l),c=m.acosClamped(u);i>0&&i>c&&(i=c-m.EPSILON4),u=t.dot(n,t.negate(l,Le)),c=m.acosClamped(u),0>i&&-i>c&&(i=-c+m.EPSILON4);var h=t.cross(l,n,Ne);e.rotate(h,i)}}else e.rotate(e.right,i)}function V(e,t){o(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function k(e,t){var i=e.frustum;t=.5*t;var r=i.right-t,n=i.left+t,o=e._maxCoord.x*e.maximumZoomFactor;r>o&&(r=o,n=-o),n>=r&&(r=1,n=-1);var a=i.top/i.right;i.right=r,i.left=n,i.top=i.right*a,i.bottom=-i.top}function z(e,t){e.move(e.direction,t)}function U(e,i,r){i=m.clamp(i,-m.PI_OVER_TWO,m.PI_OVER_TWO),e=m.zeroToTwoPi(e)-m.PI_OVER_TWO;var n=g.fromAxisAngle(t.UNIT_Y,-i,Ve),o=g.fromAxisAngle(t.UNIT_Z,-e,ke),a=g.multiply(o,n,o),s=f.fromQuaternion(a,ze),l=t.clone(t.UNIT_X,Be);return f.multiplyByVector(s,l,l),t.negate(l,l),t.multiplyByScalar(l,r,l),l}function G(e,i,r,n){var o=Math.abs(t.dot(i,r));return o/n-t.dot(e,r)}function W(e,i,r,n){var a=e._projection.ellipsoid,s=n?e:Je,l=i.north,u=i.south,h=i.east,d=i.west;d>h&&(h+=m.TWO_PI);var p,f=.5*(d+h);if(u<-m.PI_OVER_TWO+m.RADIANS_PER_DEGREE&&l>m.PI_OVER_TWO-m.RADIANS_PER_DEGREE)p=0;else{var v=Ge;v.longitude=f,v.latitude=l,v.height=0;var g=We;g.longitude=f,g.latitude=u,g.height=0;var _=Ue;o(_)&&_.ellipsoid===a||(Ue=_=new c(void 0,void 0,a)),_.setEndPoints(v,g),p=_.interpolateUsingFraction(.5,Ge).latitude}var y=Ge;y.longitude=f,y.latitude=p,y.height=0;var C=a.cartographicToCartesian(y,Ke),E=Ge;E.longitude=h,E.latitude=l;var S=a.cartographicToCartesian(E,He);E.longitude=d;var w=a.cartographicToCartesian(E,je);E.longitude=f;var T=a.cartographicToCartesian(E,Xe);E.latitude=u;var x=a.cartographicToCartesian(E,Ze);E.longitude=h;var b=a.cartographicToCartesian(E,Ye);E.longitude=d;var A=a.cartographicToCartesian(E,qe);t.subtract(w,C,w),t.subtract(b,C,b),t.subtract(S,C,S),t.subtract(A,C,A),t.subtract(T,C,T),t.subtract(x,C,x);var P=a.geodeticSurfaceNormal(C,s.direction);t.negate(P,P);var I=t.cross(P,t.UNIT_Z,s.right);t.normalize(I,I);var M=t.cross(I,P,s.up),D=Math.tan(.5*e.frustum.fovy),R=e.frustum.aspectRatio*D,O=Math.max(G(P,M,w,D),G(P,M,b,D),G(P,M,S,D),G(P,M,A,D),G(P,M,T,D),G(P,M,x,D),G(P,I,w,R),G(P,I,b,R),G(P,I,S,R),G(P,I,A,R),G(P,I,T,R),G(P,I,x,R));if(0>u&&l>0){var N=Ge;N.longitude=d,N.latitude=0,N.height=0;var L=a.cartographicToCartesian(N,Qe);t.subtract(L,C,L),O=Math.max(O,G(P,M,L,D),G(P,I,L,R)),N.longitude=h,L=a.cartographicToCartesian(N,Qe),t.subtract(L,C,L),O=Math.max(O,G(P,M,L,D),G(P,I,L,R))}return t.add(C,t.multiplyByScalar(P,-O,Qe),r)}function H(e,t,i){var r=e._projection;t.west>t.east&&(t=y.MAX_VALUE);var n=e._actualTransform,o=e._actualInvTransform,a=$e;a.longitude=t.east,a.latitude=t.north;var s=r.project(a,et);v.multiplyByPoint(n,s,s),v.multiplyByPoint(o,s,s),a.longitude=t.west,a.latitude=t.south;var l=r.project(a,tt);v.multiplyByPoint(n,l,l),v.multiplyByPoint(o,l,l);var u=Math.tan(.5*e.frustum.fovy),c=e.frustum.aspectRatio*u;return i.x=.5*(s.x-l.x)+l.x,i.y=.5*(s.y-l.y)+l.y,i.z=.5*Math.max((s.x-l.x)/c,(s.y-l.y)/u),i}function q(e,t,i){var r=e._projection;t.west>t.east&&(t=y.MAX_VALUE);var n=it;n.longitude=t.east,n.latitude=t.north;var o=r.project(n,rt);n.longitude=t.west,n.latitude=t.south;var a,s,l=r.project(n,nt),u=.5*Math.abs(o.x-l.x),c=.5*Math.abs(o.y-l.y),h=e.frustum.right/e.frustum.top,d=c*h;return u>d?(a=u,s=a/h):(s=c,a=d),c=Math.max(2*a,2*s),i.x=.5*(o.x-l.x)+l.x,i.y=.5*(o.y-l.y)+l.y,n=r.unproject(i,n),n.height=c,i=r.project(n,i)}function j(e,t,i,r){i=n(i,u.WGS84);var o=e.getPickRay(t,ot),a=p.rayEllipsoid(o,i);if(a){var s=a.start>0?a.start:a.stop;return _.getPoint(o,s,r)}}function Y(e,t,i,r){var n=e.getPickRay(t,at),o=n.origin;o.z=0;var a=i.unproject(o);return a.latitude<-m.PI_OVER_TWO||a.latitude>m.PI_OVER_TWO||a.longitude<-Math.PI||a.longitude>Math.PI?void 0:i.ellipsoid.cartographicToCartesian(a,r)}function X(e,i,r,n){var o=e.getPickRay(i,st),a=-o.origin.x/o.direction.x;_.getPoint(o,a,n);var s=r.unproject(new t(n.y,n.z,0));return s.latitude<-m.PI_OVER_TWO||s.latitude>m.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI?void 0:r.ellipsoid.cartographicToCartesian(s,n)}function Z(e,i,r){var n=e._scene.canvas,o=n.clientWidth,a=n.clientHeight,s=Math.tan(.5*e.frustum.fovy),l=e.frustum.aspectRatio*s,u=e.frustum.near,c=2/o*i.x-1,h=2/a*(a-i.y)-1,d=e.positionWC;t.clone(d,r.origin);var p=t.multiplyByScalar(e.directionWC,u,lt);t.add(d,p,p);var m=t.multiplyByScalar(e.rightWC,c*u*l,ut),f=t.multiplyByScalar(e.upWC,h*u*s,ct),v=t.add(p,m,r.direction);return t.add(v,f,v),t.subtract(v,d,v),t.normalize(v,v),r}function K(e,i,r){var n=e._scene.canvas,o=n.clientWidth,a=n.clientHeight,s=2/o*i.x-1;s*=.5*(e.frustum.right-e.frustum.left);var l=2/a*(a-i.y)-1;l*=.5*(e.frustum.top-e.frustum.bottom);var u=r.origin;return t.clone(e.position,u),t.multiplyByScalar(e.right,s,ht),t.add(ht,u,u),t.multiplyByScalar(e.up,l,ht),t.add(ht,u,u),t.clone(e.directionWC,r.direction),r}function Q(e,i){var r=e.position,n=r.x<-e._maxCoord.x||r.x>e._maxCoord.x,o=r.y<-e._maxCoord.y||r.y>e._maxCoord.y,a=n||o,s=e.frustum,u=s.top,c=s.bottom,h=s.right,d=s.left,p=e._max2Dfrustum,f=h>e._max2Dfrustum.right;if(a||f){var v=t.clone(r);v.x>e._maxCoord.x?v.x=e._maxCoord.x:v.x<-e._maxCoord.x&&(v.x=-e._maxCoord.x),v.y>e._maxCoord.y?v.y=e._maxCoord.y:v.y<-e._maxCoord.y&&(v.y=-e._maxCoord.y);var g=function(i){a&&(e.position=t.lerp(r,v,i.time,e.position)),f&&(e.frustum.top=m.lerp(u,p.top,i.time),e.frustum.bottom=m.lerp(c,p.bottom,i.time),e.frustum.right=m.lerp(h,p.right,i.time),e.frustum.left=m.lerp(d,p.left,i.time))};return{easingFunction:l.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:i,update:g}}}function J(e,i,r,n,o,a){function s(r){var n=t.lerp(i,u,r.time,new t);e.worldToCameraCoordinatesPoint(n,e.position)}var u=t.clone(i);return r.y>n?u.y-=r.y-n:r.y<-n&&(u.y+=-n-r.y),r.z>o?u.z-=r.z-o:r.z<-o&&(u.z+=-o-r.z),{easingFunction:l.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:a,update:s}}function $(e,i){var r=e.position,n=e.direction,o=e.worldToCameraCoordinatesVector(t.UNIT_X,ft),a=-t.dot(o,r)/t.dot(o,n),s=t.add(r,t.multiplyByScalar(n,a,vt),vt);e.cameraToWorldCoordinatesPoint(s,s),r=e.cameraToWorldCoordinatesPoint(e.position,gt);var l=Math.tan(.5*e.frustum.fovy),u=e.frustum.aspectRatio*l,c=t.magnitude(t.subtract(r,s,_t)),h=u*c,d=l*c,p=e._maxCoord.x,m=e._maxCoord.y,f=Math.max(h-p,p),v=Math.max(d-m,m);if(r.z<-f||r.z>f||r.y<-v||r.y>v){var g=s.y<-f||s.y>f,_=s.z<-v||s.z>v;if(g||_)return J(e,r,s,f,v,i)}}function ee(e,t){var i=e.frustum,r=Math.tan(.5*i.fovy),n=i.aspectRatio*r;return Math.max(t/n,t/r)}function te(e,t){var i,r,n=e.frustum,o=n.right/n.top,a=t*o;return t>a?(i=t,r=i/o):(r=t,i=a),1.5*Math.max(i,r)}function ie(e,t,i){o(i)||(i=d.clone(Et));var r=i.range;if(!o(r)||0===r){var n=t.radius;0===n?i.range=St:i.range=e._mode===w.SCENE2D?te(e,n):ee(e,n)}return i}T.TRANSFORM_2D=new v(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),T.TRANSFORM_2D_INVERSE=v.inverseTransformation(T.TRANSFORM_2D,new v),T.DEFAULT_VIEW_RECTANGLE=y.fromDegrees(-95,-20,-70,90),T.DEFAULT_VIEW_FACTOR=.5;var re=new r,ne=new t,oe=new t,ae=new i,se=new i,le=new i,ue=new i,ce=new i,he=new t,de=new v,pe=new v;a(T.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return P(this),this._invTransform}},viewMatrix:{get:function(){return P(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return P(this),this._invViewMatrix}},positionCartographic:{get:function(){return P(this),this._positionCartographic}},positionWC:{get:function(){return P(this),this._positionWC}},directionWC:{get:function(){return P(this),this._directionWC}},upWC:{get:function(){return P(this),this._upWC}},rightWC:{get:function(){return P(this),this._rightWC}},heading:{get:function(){if(this._mode!==w.MORPHING){var e=this._projection.ellipsoid,t=v.clone(this._transform,de),i=C.eastNorthUpToFixedFrame(this.positionWC,e,pe);this._setTransform(i);var r=I(this.direction,this.up);return this._setTransform(t),r}}},pitch:{get:function(){if(this._mode!==w.MORPHING){var e=this._projection.ellipsoid,t=v.clone(this._transform,de),i=C.eastNorthUpToFixedFrame(this.positionWC,e,pe);this._setTransform(i);var r=M(this.direction);return this._setTransform(t),r}}},roll:{get:function(){if(this._mode!==w.MORPHING){var e=this._projection.ellipsoid,t=v.clone(this._transform,de),i=C.eastNorthUpToFixedFrame(this.positionWC,e,pe);this._setTransform(i);var r=D(this.direction,this.up,this.right);return this._setTransform(t),r}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}}}),T.prototype.update=function(e){var t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==w.MORPHING,t=this._mode===w.SCENE2D),t){var i=this._max2Dfrustum=this.frustum.clone(),r=2,n=i.top/i.right;i.right=this._maxCoord.x*r,i.left=-i.right,i.top=n*i.right,i.bottom=-i.top}};var me=new t,fe=new t,ve=new t;T.prototype._setTransform=function(e){var i=t.clone(this.positionWC,me),r=t.clone(this.upWC,fe),n=t.clone(this.directionWC,ve);v.clone(e,this._transform),this._transformChanged=!0,P(this);var o=this._actualInvTransform;v.multiplyByPoint(o,i,this.position),v.multiplyByPointAsVector(o,n,this.direction),v.multiplyByPointAsVector(o,r,this.up),t.cross(this.direction,this.up,this.right),P(this)};var ge=new t,_e=new v,ye=new v,Ce=new g,Ee=new f,Se=new r,we=new t,Te=new t,xe=new t,be={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},endTransform:void 0};T.prototype.setView=function(e){e=n(e,n.EMPTY_OBJECT);var i=n(e.orientation,n.EMPTY_OBJECT),r=this._mode;if(r!==w.MORPHING){o(e.endTransform)&&this._setTransform(e.endTransform);var a=!0,s=n(e.destination,t.clone(this.positionWC,ge));o(s)&&o(s.west)&&(s=this.getRectangleCameraCoordinates(s,ge),a=!1),o(i.direction)&&(i=L(this,s,i,be.orientation));var l=n(i.heading,0),u=n(i.pitch,-m.PI_OVER_TWO),c=n(i.roll,0);r===w.SCENE3D?R(this,s,l,u,c):r===w.SCENE2D?N(this,s,l,a):O(this,s,l,u,c,a)}},T.prototype.worldToCameraCoordinates=function(e,t){return o(t)||(t=new i),P(this),v.multiplyByVector(this._actualInvTransform,e,t)},T.prototype.worldToCameraCoordinatesPoint=function(e,i){return o(i)||(i=new t),P(this),v.multiplyByPoint(this._actualInvTransform,e,i)},T.prototype.worldToCameraCoordinatesVector=function(e,i){return o(i)||(i=new t),P(this),v.multiplyByPointAsVector(this._actualInvTransform,e,i)},T.prototype.cameraToWorldCoordinates=function(e,t){return o(t)||(t=new i),P(this),v.multiplyByVector(this._actualTransform,e,t)},T.prototype.cameraToWorldCoordinatesPoint=function(e,i){return o(i)||(i=new t),P(this),v.multiplyByPoint(this._actualTransform,e,i)},T.prototype.cameraToWorldCoordinatesVector=function(e,i){return o(i)||(i=new t),P(this),v.multiplyByPointAsVector(this._actualTransform,e,i)};var Ae=new t;T.prototype.move=function(e,i){var r=this.position;t.multiplyByScalar(e,i,Ae),t.add(r,Ae,r),this._mode===w.SCENE2D&&F(this,r)},T.prototype.moveForward=function(e){e=n(e,this.defaultMoveAmount),this.move(this.direction,e)},T.prototype.moveBackward=function(e){e=n(e,this.defaultMoveAmount),this.move(this.direction,-e)},T.prototype.moveUp=function(e){e=n(e,this.defaultMoveAmount),this.move(this.up,e)},T.prototype.moveDown=function(e){e=n(e,this.defaultMoveAmount),this.move(this.up,-e)},T.prototype.moveRight=function(e){e=n(e,this.defaultMoveAmount),this.move(this.right,e)},T.prototype.moveLeft=function(e){e=n(e,this.defaultMoveAmount),this.move(this.right,-e)},T.prototype.lookLeft=function(e){e=n(e,this.defaultLookAmount),this.look(this.up,-e)},T.prototype.lookRight=function(e){e=n(e,this.defaultLookAmount),this.look(this.up,e)},T.prototype.lookUp=function(e){e=n(e,this.defaultLookAmount),this.look(this.right,-e)},T.prototype.lookDown=function(e){e=n(e,this.defaultLookAmount),this.look(this.right,e)};var Pe=new g,Ie=new f;T.prototype.look=function(e,t){var i=n(t,this.defaultLookAmount),r=g.fromAxisAngle(e,-i,Pe),o=f.fromQuaternion(r,Ie),a=this.direction,s=this.up,l=this.right;f.multiplyByVector(o,a,a),f.multiplyByVector(o,s,s),f.multiplyByVector(o,l,l)},T.prototype.twistLeft=function(e){e=n(e,this.defaultLookAmount),this.look(this.direction,e)},T.prototype.twistRight=function(e){e=n(e,this.defaultLookAmount),this.look(this.direction,-e)};var Me=new g,De=new f;T.prototype.rotate=function(e,i){var r=n(i,this.defaultRotateAmount),o=g.fromAxisAngle(e,-r,Me),a=f.fromQuaternion(o,De);f.multiplyByVector(a,this.position,this.position),f.multiplyByVector(a,this.direction,this.direction),f.multiplyByVector(a,this.up,this.up),t.cross(this.direction,this.up,this.right),t.cross(this.right,this.direction,this.up)},T.prototype.rotateDown=function(e){e=n(e,this.defaultRotateAmount),B(this,e)},T.prototype.rotateUp=function(e){e=n(e,this.defaultRotateAmount),B(this,-e)};var Re=new t,Oe=new t,Ne=new t,Le=new t;T.prototype.rotateRight=function(e){e=n(e,this.defaultRotateAmount),V(this,-e)},T.prototype.rotateLeft=function(e){e=n(e,this.defaultRotateAmount),V(this,e)},T.prototype.zoomIn=function(e){e=n(e,this.defaultZoomAmount),this._mode===w.SCENE2D?k(this,e):z(this,e)},T.prototype.zoomOut=function(e){e=n(e,this.defaultZoomAmount),this._mode===w.SCENE2D?k(this,-e):z(this,-e)},T.prototype.getMagnitude=function(){return this._mode===w.SCENE3D?t.magnitude(this.position):this._mode===w.COLUMBUS_VIEW?Math.abs(this.position.z):this._mode===w.SCENE2D?Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom):void 0};var Fe=new v;T.prototype.lookAt=function(e,t){var i=C.eastNorthUpToFixedFrame(e,u.WGS84,Fe);this.lookAtTransform(i,t)};var Be=new t,Ve=new g,ke=new g,ze=new f;T.prototype.lookAtTransform=function(i,r){if(this._setTransform(i),o(r)){var n;if(n=o(r.heading)?U(r.heading,r.pitch,r.range):r,this._mode===w.SCENE2D){e.clone(e.ZERO,this.position),t.negate(n,this.up),this.up.z=0,t.magnitudeSquared(this.up)0&&n.clientHeight>0){a[o]?(h(t,f),a[o]=!1,f.prevAngle=f.angleAndHeight.startPosition.x):(e.clone(t.distance.endPosition,f.distance.endPosition),e.clone(t.angleAndHeight.endPosition,f.angleAndHeight.endPosition));for(var i=f.angleAndHeight.endPosition.x,r=f.prevAngle,l=2*Math.PI;i>=r+Math.PI;)i-=l;for(;i0||e}}}),g.prototype.isMoving=function(e,t){var i=c(e,t);return!this._update[i]},g.prototype.getMovement=function(e,t){var i=c(e,t),r=this._movement[i];return r},g.prototype.getLastMovement=function(e,t){var i=c(e,t),r=this._lastMovement[i];return r.valid?r:void 0},g.prototype.isButtonDown=function(e,t){var i=c(e,t);return this._isDown[i]},g.prototype.getStartMousePosition=function(e,t){if(e===u.WHEEL||e===u.PINCH)return this._currentMousePosition;var i=c(e,t);return this._eventStartPosition[i]},g.prototype.getButtonPressTime=function(e,t){var i=c(e,t);return this._pressTime[i]},g.prototype.getButtonReleaseTime=function(e,t){var i=c(e,t);return this._releaseTime[i]},g.prototype.reset=function(){for(var e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),r(this)},g}),i("Scene/UrlTemplateImageryProvider",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/combine","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/freezeObject","../Core/GeographicTilingScheme","../Core/loadJson","../Core/loadText","../Core/loadWithXhr","../Core/loadXML","../Core/Math","../Core/Rectangle","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E){"use strict";function S(e){this._errorEvent=new u,this._url=void 0,this._pickFeaturesUrl=void 0,this._proxy=void 0,this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._minimumLevel=void 0,this._tilingScheme=void 0,this._rectangle=void 0,this._tileDiscardPolicy=void 0,this._credit=void 0,this._hasAlphaChannel=void 0,this._readyPromise=void 0,this._withCredentials=o(e.withCredentials,void 0),this._headers=o(e.headers,void 0),this.enablePickFeatures=!0,this.reinitialize(e)}function w(e,t,i,r){return re=!1,oe=!1,x(e,e._urlParts,function(n){return n(e,t,i,r)})}function T(e,t,i,r,n,o,a){return re=!1,oe=!1,se=!1,ce=!1,x(e,e._pickFeaturesUrlParts,function(s){return s(e,t,i,r,n,o,a)})}function x(e,t,i){for(var r="",n=0;n=0&&i>u&&(i=u,r=s[l])}a(r)?(i>o&&n.push(e.substring(o,i)),n.push(t[r]),o=i+r.length):(n.push(e.substring(o)),o=e.length)}return n}}function A(e,t,i,r){return t}function P(e,t,i,r){return e.tilingScheme.getNumberOfXTilesAtLevel(r)-t-1}function I(e,t,i,r){return i}function M(e,t,i,r){return e.tilingScheme.getNumberOfYTilesAtLevel(r)-i-1}function D(e,t,i,r){var n=e.maximumLevel;return a(n)&&n>r?n-r-1:r}function R(e,t,i,r){return r}function O(e,t,i,r){var n=(t+i+r)%e._subdomains.length;return e._subdomains[n]}function N(e,t,i,r){re||(e.tilingScheme.tileXYToRectangle(t,i,r,ne),ne.west=v.toDegrees(ne.west),ne.south=v.toDegrees(ne.south),ne.east=v.toDegrees(ne.east),ne.north=v.toDegrees(ne.north),re=!0)}function L(e,t,i,r){return N(e,t,i,r),ne.west}function F(e,t,i,r){return N(e,t,i,r),ne.south}function B(e,t,i,r){return N(e,t,i,r),ne.east}function V(e,t,i,r){return N(e,t,i,r),ne.north}function k(e,t,i,r){oe||(e.tilingScheme.tileXYToNativeRectangle(t,i,r,ae),oe=!0)}function z(e,t,i,r){return k(e,t,i,r),ae.west}function U(e,t,i,r){return k(e,t,i,r),ae.south}function G(e,t,i,r){return k(e,t,i,r),ae.east}function W(e,t,i,r){return k(e,t,i,r),ae.north}function H(e,t,i,r){return e.tileWidth}function q(e,t,i,r){return e.tileHeight}function j(e,t,i,r,n,o,a){return K(e,t,i,r,n,o),le.x}function Y(e,t,i,r,n,o,a){return K(e,t,i,r,n,o),le.y}function X(e,t,i,r,n,o,a){return K(e,t,i,r,n,o),e.tileWidth-le.x-1}function Z(e,t,i,r,n,o,a){return K(e,t,i,r,n,o),e.tileHeight-le.y-1}function K(e,t,i,r,n,o,a){if(!se){te(e,t,i,r,n,o);var s=he,l=e.tilingScheme.tileXYToNativeRectangle(t,i,r,ue);le.x=e.tileWidth*(s.x-l.west)/l.width|0,le.y=e.tileHeight*(l.north-s.y)/l.height|0,se=!0}}function Q(e,t,i,r,n,o,a){return v.toDegrees(n)}function J(e,t,i,r,n,o,a){return v.toDegrees(o)}function $(e,t,i,r,n,o,a){return te(e,t,i,r,n,o),he.x}function ee(e,t,i,r,n,o,a){return te(e,t,i,r,n,o),he.y}function te(e,t,i,r,n,o,a){if(!ce){var s;if(e.tilingScheme instanceof h)he.x=v.toDegrees(n),he.y=v.toDegrees(o);else{var l=de;l.longitude=n,l.latitude=o,s=e.tilingScheme.projection.project(l,he)}ce=!0}}function ie(e,t,i,r,n,o,a){return a}s(S.prototype,{url:{get:function(){return this._url}},pickFeaturesUrl:{get:function(){return this._pickFeaturesUrl}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return a(this._urlParts)}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}},headers:{get:function(){return this._headers}},withCredentials:{get:function(){return this._withCredentials}}}),S.prototype.reinitialize=function(e){var t=this;t._readyPromise=C(e).then(function(e){t.enablePickFeatures=o(e.enablePickFeatures,t.enablePickFeatures),t._url=e.url,t._pickFeaturesUrl=e.pickFeaturesUrl,t._proxy=e.proxy,t._tileDiscardPolicy=e.tileDiscardPolicy,t._getFeatureInfoFormats=e.getFeatureInfoFormats,t._subdomains=e.subdomains,Array.isArray(t._subdomains)?t._subdomains=t._subdomains.slice():a(t._subdomains)&&t._subdomains.length>0?t._subdomains=t._subdomains.split(""):t._subdomains=["a","b","c"],t._tileWidth=o(e.tileWidth,256),t._tileHeight=o(e.tileHeight,256),t._minimumLevel=o(e.minimumLevel,0),t._maximumLevel=e.maximumLevel,t._tilingScheme=o(e.tilingScheme,new y({ellipsoid:e.ellipsoid})),t._rectangle=o(e.rectangle,t._tilingScheme.rectangle),t._rectangle=g.intersection(t._rectangle,t._tilingScheme.rectangle),t._hasAlphaChannel=o(e.hasAlphaChannel,!0),t._withCredentials=o(e.withCredentials,void 0),t._headers=o(e.headers,void 0);var i=e.credit;return"string"==typeof i&&(i=new n(i)),t._credit=i,t._urlParts=b(t._url,pe),t._pickFeaturesUrlParts=b(t._pickFeaturesUrl,me),!0})},S.prototype.getTileCredits=function(e,t,i){},S.prototype.requestImage=function(e,t,i){var r=w(this,e,t,i);return E.loadImage(this,r)},S.prototype.pickFeatures=function(e,t,i,r,n){function o(e,t){return e.callback(t)}function s(){if(l>=u._getFeatureInfoFormats.length)return C([]);var a=u._getFeatureInfoFormats[l],c=T(u,e,t,i,r,n,a.format),h={ -headers:u.headers,withCredentials:u.withCredentials};return++l,"json"===a.type?d(c,h).then(a.callback).otherwise(s):"xml"===a.type?f(c,h).then(a.callback).otherwise(s):"text"===a.type||"html"===a.type?p(c,h).then(a.callback).otherwise(s):m({url:c,headers:u.headers,withCredentials:u.withCredentials,responseType:a.format}).then(o.bind(void 0,a)).otherwise(s)}if(this.enablePickFeatures&&a(this._pickFeaturesUrl)&&0!==this._getFeatureInfoFormats.length){var l=0,u=this;return s()}};var re=!1,ne=new g,oe=!1,ae=new g,se=!1,le=new e,ue=new g,ce=!1,he=new t,de=new i,pe={"{x}":A,"{y}":I,"{z}":R,"{s}":O,"{reverseX}":P,"{-x}":P,"{reverseY}":M,"{-y}":M,"{reverseZ}":D,"{-z}":D,"{westDegrees}":L,"{southDegrees}":F,"{eastDegrees}":B,"{northDegrees}":V,"{westProjected}":z,"{southProjected}":U,"{eastProjected}":G,"{northProjected}":W,"{width}":H,"{height}":q},me=r(pe,{"{i}":j,"{j}":Y,"{reverseI}":X,"{reverseJ}":Z,"{-i}":X,"{-j}":Z,"{longitudeDegrees}":Q,"{latitudeDegrees}":J,"{longitudeProjected}":$,"{latitudeProjected}":ee,"{format}":ie});return S}),i("Scene/createOpenStreetMapImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/DeveloperError","../Core/Rectangle","../Core/WebMercatorTilingScheme","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o){"use strict";function a(a){a=t(a,{});var u=t(a.url,"//a.tile.openstreetmap.org/");s.test(u)||(u+="/");var c=t(a.fileExtension,"png"),h=new n({ellipsoid:a.ellipsoid}),d=256,p=256,m=t(a.minimumLevel,0),f=a.maximumLevel,v=t(a.rectangle,h.rectangle),g=h.positionToTileXY(r.southwest(v),m),_=h.positionToTileXY(r.northeast(v),m),y=(Math.abs(_.x-g.x)+1)*(Math.abs(_.y-g.y)+1);if(y>4)throw new i("The rectangle and minimumLevel indicate that there are "+y+" tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.");var C=t(a.credit,l);"string"==typeof C&&(C=new e(C));var E=u+"{z}/{x}/{y}."+c;return new o({url:E,proxy:a.proxy,credit:C,tilingScheme:h,tileWidth:d,tileHeight:p,minimumLevel:m,maximumLevel:f,rectangle:v})}var s=/\/$/,l=new e("MapQuest, Open Street Map and contributors, CC-BY-SA");return a}),i("Scene/createTangentSpaceDebugPrimitive",["../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/Matrix4","./PerInstanceColorAppearance","./Primitive"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(r){r=t(r,t.EMPTY_OBJECT);var u=[],c=r.geometry;i(c.attributes)&&i(c.primitiveType)||(c=c.constructor.createGeometry(c));var h=c.attributes,d=a.clone(t(r.modelMatrix,a.IDENTITY)),p=t(r.length,1e4);return i(h.normal)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"normal",p),attributes:{color:new e(1,0,0,1)},modelMatrix:d})),i(h.binormal)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"binormal",p),attributes:{color:new e(0,1,0,1)},modelMatrix:d})),i(h.tangent)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"tangent",p),attributes:{color:new e(0,0,1,1)},modelMatrix:d})),u.length>0?new l({asynchronous:!1,geometryInstances:u,appearance:new s({flat:!0,translucent:!1})}):void 0}return u}),i("Scene/createTileMapServiceImageryProvider",["../Core/Cartesian2","../Core/Cartographic","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/joinUrls","../Core/loadXML","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v){"use strict";function g(i){function o(o){for(var a,c,f,v,E=/tileformat/i,S=/tileset/i,w=/tilesets/i,T=/boundingbox/i,x=/srs/i,b=[],A=o.childNodes[0].childNodes,P=0;Pk.rectangle.east&&(U.east=k.rectangle.east),U.southk.rectangle.north&&(U.north=k.rectangle.north);var Y=k.positionToTileXY(h.southwest(U),L),X=k.positionToTileXY(h.northeast(U),L),Z=(Math.abs(X.x-Y.x)+1)*(Math.abs(X.y-Y.y)+1);Z>4&&(L=0);var K=u(_,R);D.length&&(K=u(K,"."+D)),y.resolve({url:K,tilingScheme:k,rectangle:U,tileWidth:O,tileHeight:N,minimumLevel:L,maximumLevel:F,proxy:i.proxy,tileDiscardPolicy:i.tileDiscardPolicy,credit:i.credit,pickFeaturesUrl:i.pickFeaturesUrl,withCredentials:i.withCredentials,getFeatureInfoFormats:i.getFeatureInfoFormats})}function a(e){var t=r(i.fileExtension,"png"),o=r(i.tileSchema,"{z}/{x}/{reverseY}"),a=r(i.tileWidth,256),s=r(i.tileHeight,256),l=r(i.minimumLevel,0),c=i.maximumLevel,h=n(i.tilingScheme)?i.tilingScheme:new m({ellipsoid:i.ellipsoid}),d=r(i.rectangle,h.rectangle),p=u(_,o);t.length&&(p=u(p,"."+t)),y.resolve({url:p,tilingScheme:h,rectangle:d,tileWidth:a,tileHeight:s,minimumLevel:l,maximumLevel:c,proxy:i.proxy,tileDiscardPolicy:i.tileDiscardPolicy,credit:i.credit,withCredentials:i.withCredentials,pickFeaturesUrl:i.pickFeaturesUrl,getFeatureInfoFormats:i.getFeatureInfoFormats})}function s(){var e=u(_,"tilemapresource.xml"),t=i.proxy;n(t)&&(e=t.getURL(e)),f(c(e),o,a)}i=r(i,{});var g,_=i.url,y=f.defer(),C=new v(y.promise);return s(),C}return g}),i("Scene/CreditDisplay",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError"],function(e,t,i,r,n){"use strict";function o(e,t,r){if(!i(e.element)){var n=e.text,o=e.link,a=document.createElement("span");if(e.hasLink()){var s=document.createElement("a");s.textContent=n,s.href=o,s.target="_blank",a.appendChild(s)}else a.textContent=n;a.className="cesium-credit-text",e.element=a}if(t.hasChildNodes()){var l=document.createElement("span");l.textContent=r,l.className="cesium-credit-delimiter",t.appendChild(l)}t.appendChild(e.element)}function a(e,t){if(!i(e.element)){var r=e.text,n=e.link,o=document.createElement("span"),a=document.createElement("img");if(a.src=e.imageUrl,a.style["vertical-align"]="bottom",i(r)&&(a.alt=r,a.title=r),e.hasLink()){var s=document.createElement("a");s.appendChild(a),s.href=n,s.target="_blank",o.appendChild(s)}else o.appendChild(a);o.className="cesium-credit-image",e.element=o}t.appendChild(e.element)}function s(t,i){for(var r=t.length,n=0;r>n;n++){var o=t[n];if(e.equals(o,i))return!0}return!1}function l(e){var t=e.element;if(i(t)){var r=t.parentNode;if(!e.hasImage()){var n=t.previousSibling;null===n&&(n=t.nextSibling),null!==n&&r.removeChild(n)}r.removeChild(t)}}function u(e,t){var r,n,a,s=e._displayedCredits.textCredits;for(r=0;r= 0.0) {\nt1 = (-b - sqrt(discriminant)) * 0.5;\nt2 = (-b + sqrt(discriminant)) * 0.5;\n}\nif (t1 < 0.0 && t2 < 0.0) {\ndiscard;\n}\nfloat t = min(t1, t2);\nif (t < 0.0) {\nt = 0.0;\n}\nczm_ellipsoid ellipsoid = czm_ellipsoidNew(ellipsoidCenter, u_radii);\nczm_ray ray = czm_ray(t * direction, direction);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\nif (czm_isEmpty(intersection))\n{\ndiscard;\n}\nvec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);\nvec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0);\ngl_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a);\ngl_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a);\n#ifdef WRITE_DEPTH\n#ifdef GL_EXT_frag_depth\nt = (intersection.start != 0.0) ? intersection.start : intersection.stop;\nvec3 positionEC = czm_pointAlongRay(ray, t);\nvec4 positionCC = czm_projection * vec4(positionEC, 1.0);\nfloat z = positionCC.z / positionCC.w;\nfloat n = czm_depthRange.near;\nfloat f = czm_depthRange.far;\ngl_FragDepthEXT = (z * (f - n) + f + n) * 0.5;\n#endif\n#endif\n}\n"}),i("Shaders/EllipsoidVS",[],function(){"use strict";return"attribute vec3 position;\nuniform vec3 u_radii;\nvarying vec3 v_positionEC;\nvoid main()\n{\nvec4 p = vec4(u_radii * position, 1.0);\nv_positionEC = (czm_modelView * p).xyz;\ngl_Position = czm_modelViewProjection * p;\ngl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far);\n}\n"}),i("Scene/EllipsoidPrimitive",["../Core/BoundingSphere","../Core/BoxGeometry","../Core/Cartesian3","../Core/combine","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/EllipsoidFS","../Shaders/EllipsoidVS","./BlendingState","./CullFace","./Material","./Pass","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S){"use strict";function w(t){t=n(t,n.EMPTY_OBJECT),this.center=i.clone(n(t.center,i.ZERO)),this._center=new i,this.radii=i.clone(t.radii),this._radii=new i,this._oneOverEllipsoidRadiiSquared=new i,this._boundingSphere=new e,this.modelMatrix=l.clone(n(t.modelMatrix,l.IDENTITY)),this._modelMatrix=new l,this._computedModelMatrix=new l,this.show=n(t.show,!0),this.material=n(t.material,C.fromType(C.ColorType)),this._material=void 0,this._translucent=void 0,this.id=t.id,this._id=void 0,this.debugShowBoundingVolume=n(t.debugShowBoundingVolume,!1),this.onlySunLighting=n(t.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=n(t.depthTestEnabled,!0),this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new h({owner:n(t._owner,this)}),this._pickCommand=new h({owner:n(t._owner,this)});var r=this;this._uniforms={u_radii:function(){return r.radii},u_oneOverEllipsoidRadiiSquared:function(){return r._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return r._pickId.color}}}function T(e){var r=e.cache.ellipsoidPrimitive_vertexArray;if(o(r))return r;var n=t.createGeometry(t.fromDimensions({dimensions:new i(2,2,2),vertexFormat:u.POSITION_ONLY}));return r=f.fromGeometry({context:e,geometry:n,attributeLocations:x,bufferUsage:c.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=r,r}var x={position:0};return w.prototype.update=function(t){if(this.show&&t.mode===S.SCENE3D&&o(this.center)&&o(this.radii)){var n=t.context,a=this.material.isTranslucent(),s=this._translucent!==a;(!o(this._rs)||s)&&(this._translucent=a,this._rs=d.fromCache({cull:{enabled:!0,face:y.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!a&&n.fragmentDepth,blending:a?_.ALPHA_BLEND:void 0})),o(this._va)||(this._va=T(n));var u=!1,c=this.radii;if(!i.equals(this._radii,c)){i.clone(c,this._radii);var h=this._oneOverEllipsoidRadiiSquared;h.x=1/(c.x*c.x),h.y=1/(c.y*c.y),h.z=1/(c.z*c.z),u=!0}l.equals(this.modelMatrix,this._modelMatrix)&&i.equals(this.center,this._center)||(l.clone(this.modelMatrix,this._modelMatrix),i.clone(this.center,this._center),l.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),u=!0),u&&(i.clone(i.ZERO,this._boundingSphere.center),this._boundingSphere.radius=i.maximumComponent(c),e.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));var f=this._material!==this.material;this._material=this.material,this._material.update(n);var C=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;var w,b=this._colorCommand;(f||C||s)&&(w=new m({sources:[this.material.shaderSource,v]}),this.onlySunLighting&&w.defines.push("ONLY_SUN_LIGHTING"),!a&&n.fragmentDepth&&w.defines.push("WRITE_DEPTH"),this._sp=p.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:g,fragmentShaderSource:w,attributeLocations:x}),b.vertexArray=this._va,b.renderState=this._rs,b.shaderProgram=this._sp,b.uniformMap=r(this._uniforms,this.material._uniforms),b.executeInClosestFrustum=a);var A=t.commandList,P=t.passes;if(P.render&&(b.boundingVolume=this._boundingSphere,b.debugShowBoundingVolume=this.debugShowBoundingVolume,b.modelMatrix=this._computedModelMatrix,b.pass=a?E.TRANSLUCENT:E.OPAQUE,A.push(b)),P.pick){var I=this._pickCommand;o(this._pickId)&&this._id===this.id||(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=n.createPickId({primitive:this,id:this.id})),(f||C||!o(this._pickSP))&&(w=new m({sources:[this.material.shaderSource,v],pickColorQualifier:"uniform"}),this.onlySunLighting&&w.defines.push("ONLY_SUN_LIGHTING"),!a&&n.fragmentDepth&&w.defines.push("WRITE_DEPTH"),this._pickSP=p.replaceCache({context:n,shaderProgram:this._pickSP,vertexShaderSource:g,fragmentShaderSource:w,attributeLocations:x}),I.vertexArray=this._va,I.renderState=this._rs,I.shaderProgram=this._pickSP,I.uniformMap=r(r(this._uniforms,this._pickUniforms),this.material._uniforms),I.executeInClosestFrustum=a),I.boundingVolume=this._boundingSphere,I.modelMatrix=this._computedModelMatrix,I.pass=a?E.TRANSLUCENT:E.OPAQUE,A.push(I)}}},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),a(this)},w}),i("Shaders/Appearances/EllipsoidSurfaceAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\nvoid main()\n{\nczm_materialInput materialInput;\nvec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nmaterialInput.s = v_st.s;\nmaterialInput.st = v_st;\nmaterialInput.str = vec3(v_st, 0.0);\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\nvec3 positionToEyeEC = -v_positionEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),i("Shaders/Appearances/EllipsoidSurfaceAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec2 st;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionMC = position3DHigh + position3DLow;\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Scene/EllipsoidSurfaceAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/EllipsoidSurfaceAppearanceFS","../Shaders/Appearances/EllipsoidSurfaceAppearanceVS","./Appearance","./Material"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.translucent,!0),l=e(i.aboveGround,!1);this.material=t(i.material)?i.material:s.fromType(s.ColorType),this.translucent=e(i.translucent,!0),this._vertexShaderSource=e(i.vertexShaderSource,o),this._fragmentShaderSource=e(i.fragmentShaderSource,n),this._renderState=a.getDefaultRenderState(r,!l,i.renderState),this._closed=!1,this._flat=e(i.flat,!1),this._faceForward=e(i.faceForward,l),this._aboveGround=l}return i(l.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return l.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}}),l.VERTEX_FORMAT=r.POSITION_AND_ST,l.prototype.getFragmentShaderSource=a.prototype.getFragmentShaderSource,l.prototype.isTranslucent=a.prototype.isTranslucent,l.prototype.getRenderState=a.prototype.getRenderState,l}),i("Scene/Fog",["../Core/Cartesian3","../Core/defined","../Core/Math","./SceneMode"],function(e,t,i,r){"use strict";function n(){this.enabled=!0,this.density=2e-4,this.screenSpaceErrorFactor=2}function o(e){var t=a,i=t.length;if(et[i-1])return d=i-2;if(e>=t[d]){if(i>d+1&&ed+2&&e=0&&e>=t[d-1])return--d,d;var r;for(r=0;i-2>r&&!(e>=t[r]&&e8e5||n.mode!==r.SCENE3D)return void(n.fog.enabled=!1);var m=d.height,f=o(m),v=i.clamp((m-a[f])/(a[f+1]-a[f]),0,1),g=i.lerp(s[f],s[f+1],v),_=1e6*this.density,y=_/u*c;g=g*(_-y)*1e-6;var C=e.normalize(h.positionWC,p),E=i.clamp(e.dot(h.directionWC,C),0,1);g*=1-E,n.fog.density=g,n.fog.sse=this.screenSpaceErrorFactor}},n}),i("Scene/FrameRateMonitor",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/getTimestamp","../Core/TimeConstants"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){function r(){ -c(n)}this._scene=i.scene,this.samplingWindow=e(i.samplingWindow,l.defaultSettings.samplingWindow),this.quietPeriod=e(i.quietPeriod,l.defaultSettings.quietPeriod),this.warmupPeriod=e(i.warmupPeriod,l.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=e(i.minimumFrameRateDuringWarmup,l.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=e(i.minimumFrameRateAfterWarmup,l.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new o,this._nominalFrameRate=new o,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;var n=this;this._preRenderRemoveListener=this._scene.preRender.addEventListener(function(e,t){u(n,t)}),this._hiddenPropertyName=t(document.hidden)?"hidden":t(document.mozHidden)?"mozHidden":t(document.msHidden)?"msHidden":t(document.webkitHidden)?"webkitHidden":void 0;var a=t(document.hidden)?"visibilitychange":t(document.mozHidden)?"mozvisibilitychange":t(document.msHidden)?"msvisibilitychange":t(document.webkitHidden)?"webkitvisibilitychange":void 0;this._visibilityChangeRemoveListener=void 0,t(a)&&(document.addEventListener(a,r,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(a,r,!1)})}function u(e,t){if(!(e._pauseCount>0)){var i=a();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=i+e.quietPeriod/s.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/s.SECONDS_PER_MILLISECOND;else if(i>=e._quietPeriodEndTime){e._frameTimes.push(i);var r=i-e.samplingWindow/s.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=r){for(;e._frameTimes.length>=2&&e._frameTimes[1]e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);n>o?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}}function c(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}return l.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8},l.fromScene=function(e){return(!t(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new l({scene:e})),e._frameRateMonitor},i(l.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}}),l.prototype.pause=function(){++this._pauseCount,1===this._pauseCount&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)},l.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._preRenderRemoveListener(),t(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),r(this)},l}),i("Scene/FrameState",["./SceneMode"],function(e){"use strict";function t(t,i){this.context=t,this.commandList=[],this.mode=e.SCENE3D,this.morphTime=e.getMorphTime(e.SCENE3D),this.frameNumber=0,this.time=void 0,this.mapProjection=void 0,this.camera=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.passes={render:!1,pick:!1},this.creditDisplay=i,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,density:void 0,sse:void 0},this.terrainExaggeration=1}return t}),i("Scene/FrustumCommands",["../Core/defaultValue","./Pass"],function(e,t){"use strict";function i(i,r){this.near=e(i,0),this.far=e(r,0);for(var n=t.NUMBER_OF_PASSES,o=new Array(n),a=new Array(n),s=0;n>s;++s)o[s]=[],a[s]=0;this.commands=o,this.indices=a}return i}),i("Shaders/PostProcessFilters/FXAA",[],function(){"use strict";return"#ifndef FXAA_PRESET\n#define FXAA_PRESET 3\n#endif\n#if (FXAA_PRESET == 3)\n#define FXAA_EDGE_THRESHOLD (1.0/8.0)\n#define FXAA_EDGE_THRESHOLD_MIN (1.0/24.0)\n#define FXAA_SEARCH_STEPS 16\n#define FXAA_SEARCH_THRESHOLD (1.0/4.0)\n#define FXAA_SUBPIX_CAP (3.0/4.0)\n#define FXAA_SUBPIX_TRIM (1.0/4.0)\n#endif\n#if (FXAA_PRESET == 4)\n#define FXAA_EDGE_THRESHOLD (1.0/8.0)\n#define FXAA_EDGE_THRESHOLD_MIN (1.0/24.0)\n#define FXAA_SEARCH_STEPS 24\n#define FXAA_SEARCH_THRESHOLD (1.0/4.0)\n#define FXAA_SUBPIX_CAP (3.0/4.0)\n#define FXAA_SUBPIX_TRIM (1.0/4.0)\n#endif\n#if (FXAA_PRESET == 5)\n#define FXAA_EDGE_THRESHOLD (1.0/8.0)\n#define FXAA_EDGE_THRESHOLD_MIN (1.0/24.0)\n#define FXAA_SEARCH_STEPS 32\n#define FXAA_SEARCH_THRESHOLD (1.0/4.0)\n#define FXAA_SUBPIX_CAP (3.0/4.0)\n#define FXAA_SUBPIX_TRIM (1.0/4.0)\n#endif\n#define FXAA_SUBPIX_TRIM_SCALE (1.0/(1.0 - FXAA_SUBPIX_TRIM))\nfloat FxaaLuma(vec3 rgb) {\nreturn rgb.y * (0.587/0.299) + rgb.x;\n}\nvec3 FxaaLerp3(vec3 a, vec3 b, float amountOfA) {\nreturn (vec3(-amountOfA) * b) + ((a * vec3(amountOfA)) + b);\n}\nvec4 FxaaTexOff(sampler2D tex, vec2 pos, ivec2 off, vec2 rcpFrame) {\nfloat x = pos.x + float(off.x) * rcpFrame.x;\nfloat y = pos.y + float(off.y) * rcpFrame.y;\nreturn texture2D(tex, vec2(x, y));\n}\nvec3 FxaaPixelShader(vec2 pos, sampler2D tex, vec2 rcpFrame)\n{\nvec3 rgbN = FxaaTexOff(tex, pos.xy, ivec2( 0,-1), rcpFrame).xyz;\nvec3 rgbW = FxaaTexOff(tex, pos.xy, ivec2(-1, 0), rcpFrame).xyz;\nvec3 rgbM = FxaaTexOff(tex, pos.xy, ivec2( 0, 0), rcpFrame).xyz;\nvec3 rgbE = FxaaTexOff(tex, pos.xy, ivec2( 1, 0), rcpFrame).xyz;\nvec3 rgbS = FxaaTexOff(tex, pos.xy, ivec2( 0, 1), rcpFrame).xyz;\nfloat lumaN = FxaaLuma(rgbN);\nfloat lumaW = FxaaLuma(rgbW);\nfloat lumaM = FxaaLuma(rgbM);\nfloat lumaE = FxaaLuma(rgbE);\nfloat lumaS = FxaaLuma(rgbS);\nfloat rangeMin = min(lumaM, min(min(lumaN, lumaW), min(lumaS, lumaE)));\nfloat rangeMax = max(lumaM, max(max(lumaN, lumaW), max(lumaS, lumaE)));\nfloat range = rangeMax - rangeMin;\nif(range < max(FXAA_EDGE_THRESHOLD_MIN, rangeMax * FXAA_EDGE_THRESHOLD))\n{\nreturn rgbM;\n}\nvec3 rgbL = rgbN + rgbW + rgbM + rgbE + rgbS;\nfloat lumaL = (lumaN + lumaW + lumaE + lumaS) * 0.25;\nfloat rangeL = abs(lumaL - lumaM);\nfloat blendL = max(0.0, (rangeL / range) - FXAA_SUBPIX_TRIM) * FXAA_SUBPIX_TRIM_SCALE;\nblendL = min(FXAA_SUBPIX_CAP, blendL);\nvec3 rgbNW = FxaaTexOff(tex, pos.xy, ivec2(-1,-1), rcpFrame).xyz;\nvec3 rgbNE = FxaaTexOff(tex, pos.xy, ivec2( 1,-1), rcpFrame).xyz;\nvec3 rgbSW = FxaaTexOff(tex, pos.xy, ivec2(-1, 1), rcpFrame).xyz;\nvec3 rgbSE = FxaaTexOff(tex, pos.xy, ivec2( 1, 1), rcpFrame).xyz;\nrgbL += (rgbNW + rgbNE + rgbSW + rgbSE);\nrgbL *= vec3(1.0/9.0);\nfloat lumaNW = FxaaLuma(rgbNW);\nfloat lumaNE = FxaaLuma(rgbNE);\nfloat lumaSW = FxaaLuma(rgbSW);\nfloat lumaSE = FxaaLuma(rgbSE);\nfloat edgeVert =\nabs((0.25 * lumaNW) + (-0.5 * lumaN) + (0.25 * lumaNE)) +\nabs((0.50 * lumaW ) + (-1.0 * lumaM) + (0.50 * lumaE )) +\nabs((0.25 * lumaSW) + (-0.5 * lumaS) + (0.25 * lumaSE));\nfloat edgeHorz =\nabs((0.25 * lumaNW) + (-0.5 * lumaW) + (0.25 * lumaSW)) +\nabs((0.50 * lumaN ) + (-1.0 * lumaM) + (0.50 * lumaS )) +\nabs((0.25 * lumaNE) + (-0.5 * lumaE) + (0.25 * lumaSE));\nbool horzSpan = edgeHorz >= edgeVert;\nfloat lengthSign = horzSpan ? -rcpFrame.y : -rcpFrame.x;\nif(!horzSpan)\n{\nlumaN = lumaW;\nlumaS = lumaE;\n}\nfloat gradientN = abs(lumaN - lumaM);\nfloat gradientS = abs(lumaS - lumaM);\nlumaN = (lumaN + lumaM) * 0.5;\nlumaS = (lumaS + lumaM) * 0.5;\nif (gradientN < gradientS)\n{\nlumaN = lumaS;\nlumaN = lumaS;\ngradientN = gradientS;\nlengthSign *= -1.0;\n}\nvec2 posN;\nposN.x = pos.x + (horzSpan ? 0.0 : lengthSign * 0.5);\nposN.y = pos.y + (horzSpan ? lengthSign * 0.5 : 0.0);\ngradientN *= FXAA_SEARCH_THRESHOLD;\nvec2 posP = posN;\nvec2 offNP = horzSpan ? vec2(rcpFrame.x, 0.0) : vec2(0.0, rcpFrame.y);\nfloat lumaEndN = lumaN;\nfloat lumaEndP = lumaN;\nbool doneN = false;\nbool doneP = false;\nposN += offNP * vec2(-1.0, -1.0);\nposP += offNP * vec2( 1.0, 1.0);\nfor(int i = 0; i < FXAA_SEARCH_STEPS; i++) {\nif(!doneN)\n{\nlumaEndN = FxaaLuma(texture2D(tex, posN.xy).xyz);\n}\nif(!doneP)\n{\nlumaEndP = FxaaLuma(texture2D(tex, posP.xy).xyz);\n}\ndoneN = doneN || (abs(lumaEndN - lumaN) >= gradientN);\ndoneP = doneP || (abs(lumaEndP - lumaN) >= gradientN);\nif(doneN && doneP)\n{\nbreak;\n}\nif(!doneN)\n{\nposN -= offNP;\n}\nif(!doneP)\n{\nposP += offNP;\n}\n}\nfloat dstN = horzSpan ? pos.x - posN.x : pos.y - posN.y;\nfloat dstP = horzSpan ? posP.x - pos.x : posP.y - pos.y;\nbool directionN = dstN < dstP;\nlumaEndN = directionN ? lumaEndN : lumaEndP;\nif(((lumaM - lumaN) < 0.0) == ((lumaEndN - lumaN) < 0.0))\n{\nlengthSign = 0.0;\n}\nfloat spanLength = (dstP + dstN);\ndstN = directionN ? dstN : dstP;\nfloat subPixelOffset = (0.5 + (dstN * (-1.0/spanLength))) * lengthSign;\nvec3 rgbF = texture2D(tex, vec2(\npos.x + (horzSpan ? 0.0 : subPixelOffset),\npos.y + (horzSpan ? subPixelOffset : 0.0))).xyz;\nreturn FxaaLerp3(rgbL, rgbF, blendL);\n}\nuniform sampler2D u_texture;\nuniform vec2 u_step;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = vec4(FxaaPixelShader(v_textureCoordinates, u_texture, u_step), 1.0);\n}\n"}),i("Scene/FXAA",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/FXAA"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(t){this._texture=void 0,this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._fbo=void 0,this._command=void 0,this._viewport=new e,this._rs=void 0;var r=new a({color:new i(0,0,0,0),depth:1,owner:this});this._clearCommand=r}function f(e){e._fbo=e._fbo&&e._fbo.destroy(),e._texture=e._texture&&e._texture.destroy(),e._depthTexture=e._depthTexture&&e._depthTexture.destroy(),e._depthRenderbuffer=e._depthRenderbuffer&&e._depthRenderbuffer.destroy(),e._fbo=void 0,e._texture=void 0,e._depthTexture=void 0,e._depthRenderbuffer=void 0,r(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0)}return m.prototype.update=function(i){var n=i.drawingBufferWidth,a=i.drawingBufferHeight,m=this._texture,f=!r(m)||m.width!==n||m.height!==a;if(f&&(this._texture=this._texture&&this._texture.destroy(),this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._texture=new d({context:i,width:n,height:a,pixelFormat:o.RGBA,pixelDatatype:l.UNSIGNED_BYTE}),i.depthTexture?this._depthTexture=new d({context:i,width:n,height:a,pixelFormat:o.DEPTH_COMPONENT,pixelDatatype:l.UNSIGNED_SHORT}):this._depthRenderbuffer=new u({context:i,width:n,height:a,format:c.DEPTH_COMPONENT16})),(!r(this._fbo)||f)&&(this._fbo=this._fbo&&this._fbo.destroy(),this._fbo=new s({context:i,colorTextures:[this._texture],depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,destroyAttachments:!1})),r(this._command)||(this._command=i.createViewportQuadCommand(p,{owner:this})),this._viewport.width=n,this._viewport.height=a,r(this._rs)&&e.equals(this._rs.viewport,this._viewport)||(this._rs=h.fromCache({viewport:this._viewport})),this._command.renderState=this._rs,f){var v=this,g=new t(1/this._texture.width,1/this._texture.height);this._command.uniformMap={u_texture:function(){return v._texture},u_step:function(){return g}}}},m.prototype.execute=function(e,t){this._command.execute(e,t)},m.prototype.clear=function(e,t,r){var n=t.framebuffer;t.framebuffer=this._fbo,i.clone(r,this._clearCommand.color),this._clearCommand.execute(e,t),t.framebuffer=n},m.prototype.getColorFramebuffer=function(){return this._fbo},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return f(this),n(this)},m}),i("Scene/GetFeatureInfoFormat",["../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/definedNotNull","../Core/DeveloperError","../Core/RuntimeError","./ImageryLayerFeatureInfo"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,r){this.type=e,i(t)||("json"===e?t="application/json":"xml"===e?t="text/xml":"html"===e?t="text/html":"text"===e&&(t="text/plain")),this.format=t,i(r)||("json"===e?r=l:"xml"===e?r=u:"html"===e?r=g:"text"===e&&(r=g)),this.callback=r}function l(t){for(var i=[],n=t.features,o=0;o0)for(var o=0;o1&&(t=i[1]);var r=new a;return r.name=t,r.description=e,r.data=e,[r]}}var _="http://www.mapinfo.com/mxp",y="http://www.esri.com/wms",C="http://www.opengis.net/wfs",E="http://www.opengis.net/gml",S=/\s*<\/body>/im,w=//im,T=/([\s\S]*)<\/title>/im;return s}),i("Shaders/GlobeFS",[],function(){"use strict";return"uniform vec4 u_initialColor;\n#if TEXTURE_UNITS > 0\nuniform sampler2D u_dayTextures[TEXTURE_UNITS];\nuniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];\n#ifdef APPLY_ALPHA\nuniform float u_dayTextureAlpha[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_BRIGHTNESS\nuniform float u_dayTextureBrightness[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_CONTRAST\nuniform float u_dayTextureContrast[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_HUE\nuniform float u_dayTextureHue[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_SATURATION\nuniform float u_dayTextureSaturation[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_GAMMA\nuniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];\n#endif\nuniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS];\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nuniform sampler2D u_waterMask;\nuniform vec4 u_waterMaskTranslationAndScale;\nuniform float u_zoomedOutOceanSpecularIntensity;\n#endif\n#ifdef SHOW_OCEAN_WAVES\nuniform sampler2D u_oceanNormalMap;\n#endif\n#ifdef ENABLE_DAYNIGHT_SHADING\nuniform vec2 u_lightingFadeDistance;\n#endif\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef FOG\nvarying float v_distance;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\n#endif\nvec4 sampleAndBlend(\nvec4 previousColor,\nsampler2D texture,\nvec2 tileTextureCoordinates,\nvec4 textureCoordinateRectangle,\nvec4 textureCoordinateTranslationAndScale,\nfloat textureAlpha,\nfloat textureBrightness,\nfloat textureContrast,\nfloat textureHue,\nfloat textureSaturation,\nfloat textureOneOverGamma)\n{\nvec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nalphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nvec2 translation = textureCoordinateTranslationAndScale.xy;\nvec2 scale = textureCoordinateTranslationAndScale.zw;\nvec2 textureCoordinates = tileTextureCoordinates * scale + translation;\nvec4 value = texture2D(texture, textureCoordinates);\nvec3 color = value.rgb;\nfloat alpha = value.a;\n#ifdef APPLY_BRIGHTNESS\ncolor = mix(vec3(0.0), color, textureBrightness);\n#endif\n#ifdef APPLY_CONTRAST\ncolor = mix(vec3(0.5), color, textureContrast);\n#endif\n#ifdef APPLY_HUE\ncolor = czm_hue(color, textureHue);\n#endif\n#ifdef APPLY_SATURATION\ncolor = czm_saturation(color, textureSaturation);\n#endif\n#ifdef APPLY_GAMMA\ncolor = pow(color, vec3(textureOneOverGamma));\n#endif\nfloat sourceAlpha = alpha * textureAlpha;\nfloat outAlpha = mix(previousColor.a, 1.0, sourceAlpha);\nvec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;\nreturn vec4(outColor, outAlpha);\n}\nvec4 computeDayColor(vec4 initialColor, vec2 textureCoordinates);\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue);\nvoid main()\n{\nvec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0));\n#ifdef SHOW_TILE_BOUNDARIES\nif (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||\nv_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))\n{\ncolor = vec4(1.0, 0.0, 0.0, 1.0);\n}\n#endif\n#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING)\nvec3 normalMC = normalize(czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\nvec3 normalEC = normalize(czm_normal3D * normalMC);\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nvec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;\nvec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;\nvec2 waterMaskTextureCoordinates = v_textureCoordinates * waterMaskScale + waterMaskTranslation;\nfloat mask = texture2D(u_waterMask, waterMaskTextureCoordinates).r;\nif (mask > 0.0)\n{\nmat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);\nvec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC);\nvec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx);\nvec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z));\ncolor = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask);\n}\n#endif\n#ifdef ENABLE_VERTEX_LIGHTING\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_sunDirectionEC, normalize(v_normalEC)) * 0.9 + 0.3, 0.0, 1.0);\nvec4 finalColor = vec4(color.rgb * diffuseIntensity, color.a);\n#elif defined(ENABLE_DAYNIGHT_SHADING)\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_sunDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);\nfloat cameraDist = length(czm_view[3]);\nfloat fadeOutDist = u_lightingFadeDistance.x;\nfloat fadeInDist = u_lightingFadeDistance.y;\nfloat t = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);\ndiffuseIntensity = mix(1.0, diffuseIntensity, t);\nvec4 finalColor = vec4(color.rgb * diffuseIntensity, color.a);\n#else\nvec4 finalColor = color;\n#endif\n#ifdef FOG\nconst float fExposure = 2.0;\nvec3 fogColor = v_mieColor + finalColor.rgb * v_rayleighColor;\nfogColor = vec3(1.0) - exp(-fExposure * fogColor);\ngl_FragColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor), finalColor.a);\n#else\ngl_FragColor = finalColor;\n#endif\n}\n#ifdef SHOW_REFLECTIVE_OCEAN\nfloat waveFade(float edge0, float edge1, float x)\n{\nfloat y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\nreturn pow(1.0 - y, 5.0);\n}\nfloat linearFade(float edge0, float edge1, float x)\n{\nreturn clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n}\nconst float oceanFrequencyLowAltitude = 825000.0;\nconst float oceanAnimationSpeedLowAltitude = 0.004;\nconst float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;\nconst float oceanSpecularIntensity = 0.5;\nconst float oceanFrequencyHighAltitude = 125000.0;\nconst float oceanAnimationSpeedHighAltitude = 0.008;\nconst float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0;\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue)\n{\nvec3 positionToEyeEC = -positionEyeCoordinates;\nfloat positionToEyeECLength = length(positionToEyeEC);\nvec3 normalizedpositionToEyeEC = normalize(normalize(positionToEyeEC));\nfloat waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);\n#ifdef SHOW_OCEAN_WAVES\nfloat time = czm_frameNumber * oceanAnimationSpeedHighAltitude;\nvec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0);\nvec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude);\ntime = czm_frameNumber * oceanAnimationSpeedLowAltitude;\nnoise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0);\nvec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude);\nfloat highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength);\nfloat lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength);\nvec3 normalTangentSpace =\n(highAltitudeFade * normalTangentSpaceHighAltitude) +\n(lowAltitudeFade * normalTangentSpaceLowAltitude);\nnormalTangentSpace = normalize(normalTangentSpace);\nnormalTangentSpace.xy *= waveIntensity;\nnormalTangentSpace = normalize(normalTangentSpace);\n#else\nvec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);\n#endif\nvec3 normalEC = enuToEye * normalTangentSpace;\nconst vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);\nfloat diffuseIntensity = czm_getLambertDiffuse(czm_sunDirectionEC, normalEC) * maskValue;\nvec3 diffuseHighlight = waveHighlightColor * diffuseIntensity;\n#ifdef SHOW_OCEAN_WAVES\nfloat tsPerturbationRatio = normalTangentSpace.z;\nvec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);\n#else\nvec3 nonDiffuseHighlight = vec3(0.0);\n#endif\nfloat specularIntensity = czm_getSpecular(czm_sunDirectionEC, normalizedpositionToEyeEC, normalEC, 10.0) + 0.25 * czm_getSpecular(czm_moonDirectionEC, normalizedpositionToEyeEC, normalEC, 10.0);\nfloat surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);\nfloat specular = specularIntensity * surfaceReflectance;\nreturn vec4(imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular, imageryColor.a);\n}\n#endif\n"}),i("Shaders/GlobeVS",[],function(){"use strict";return"#ifdef QUANTIZATION_BITS12\nattribute vec4 compressed;\n#else\nattribute vec4 position3DAndHeight;\nattribute vec3 textureCoordAndEncodedNormals;\n#endif\nuniform vec3 u_center3D;\nuniform mat4 u_modifiedModelView;\nuniform vec4 u_tileRectangle;\nuniform vec2 u_southAndNorthLatitude;\nuniform vec2 u_southMercatorYAndOneOverHeight;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef FOG\nvarying float v_distance;\nvarying vec3 v_mieColor;\nvarying vec3 v_rayleighColor;\n#endif\nvec4 getPosition(vec3 position, float height, vec2 textureCoordinates);\nfloat get2DYPositionFraction(vec2 textureCoordinates);\nvec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn czm_projection * (u_modifiedModelView * vec4(position, 1.0));\n}\nfloat get2DMercatorYPositionFraction(vec2 textureCoordinates)\n{\nconst float maxTileWidth = 0.003068;\nfloat positionFraction = textureCoordinates.y;\nfloat southLatitude = u_southAndNorthLatitude.x;\nfloat northLatitude = u_southAndNorthLatitude.y;\nif (northLatitude - southLatitude > maxTileWidth)\n{\nfloat southMercatorY = u_southMercatorYAndOneOverHeight.x;\nfloat oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y;\nfloat currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y);\ncurrentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);\npositionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight);\n}\nreturn positionFraction;\n}\nfloat get2DGeographicYPositionFraction(vec2 textureCoordinates)\n{\nreturn textureCoordinates.y;\n}\nvec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates)\n{\nfloat yPositionFraction = get2DYPositionFraction(textureCoordinates);\nvec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nreturn czm_projection * (u_modifiedModelView * rtcPosition2D);\n}\nvec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn getPositionPlanarEarth(position, 0.0, textureCoordinates);\n}\nvec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn getPositionPlanarEarth(position, height, textureCoordinates);\n}\nvec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates)\n{\nvec3 position3DWC = position + u_center3D;\nfloat yPositionFraction = get2DYPositionFraction(textureCoordinates);\nvec4 position2DWC = vec4(0.0, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nvec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);\nreturn czm_modelViewProjection * morphPosition;\n}\n#ifdef QUANTIZATION_BITS12\nuniform vec2 u_minMaxHeight;\nuniform mat4 u_scaleAndBias;\n#endif\nvoid main()\n{\n#ifdef QUANTIZATION_BITS12\nvec2 xy = czm_decompressTextureCoordinates(compressed.x);\nvec2 zh = czm_decompressTextureCoordinates(compressed.y);\nvec3 position = vec3(xy, zh.x);\nfloat height = zh.y;\nvec2 textureCoordinates = czm_decompressTextureCoordinates(compressed.z);\nfloat encodedNormal = compressed.w;\nheight = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x;\nposition = (u_scaleAndBias * vec4(position, 1.0)).xyz;\n#else\nvec3 position = position3DAndHeight.xyz;\nfloat height = position3DAndHeight.w;\nvec2 textureCoordinates = textureCoordAndEncodedNormals.xy;\nfloat encodedNormal = textureCoordAndEncodedNormals.z;\n#endif\nvec3 position3DWC = position + u_center3D;\ngl_Position = getPosition(position, height, textureCoordinates);\nv_textureCoordinates = textureCoordinates;\n#if defined(ENABLE_VERTEX_LIGHTING)\nv_positionEC = (czm_modelView3D * vec4(position3DWC, 1.0)).xyz;\nv_positionMC = position3DWC;\nv_normalMC = czm_octDecode(encodedNormal);\nv_normalEC = czm_normal3D * v_normalMC;\n#elif defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING)\nv_positionEC = (czm_modelView3D * vec4(position3DWC, 1.0)).xyz;\nv_positionMC = position3DWC;\n#endif\n#ifdef FOG\nAtmosphereColor atmosColor = computeGroundAtmosphereFromSpace(position3DWC);\nv_mieColor = atmosColor.mie;\nv_rayleighColor = atmosColor.rayleigh;\nv_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);\n#endif\n}\n"}),i("Shaders/GroundAtmosphere",[],function(){"use strict";return"const float fInnerRadius = 6378137.0;\nconst float fOuterRadius = 6378137.0 * 1.025;\nconst float fOuterRadius2 = fOuterRadius * fOuterRadius;\nconst float Kr = 0.0025;\nconst float Km = 0.0015;\nconst float ESun = 15.0;\nconst float fKrESun = Kr * ESun;\nconst float fKmESun = Km * ESun;\nconst float fKr4PI = Kr * 4.0 * czm_pi;\nconst float fKm4PI = Km * 4.0 * czm_pi;\nconst float fScale = 1.0 / (fOuterRadius - fInnerRadius);\nconst float fScaleDepth = 0.25;\nconst float fScaleOverScaleDepth = fScale / fScaleDepth;\nstruct AtmosphereColor\n{\nvec3 mie;\nvec3 rayleigh;\n};\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nfloat scale(float fCos)\n{\nfloat x = 1.0 - fCos;\nreturn fScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nAtmosphereColor computeGroundAtmosphereFromSpace(vec3 v3Pos)\n{\nvec3 v3InvWavelength = vec3(1.0 / pow(0.650, 4.0), 1.0 / pow(0.570, 4.0), 1.0 / pow(0.475, 4.0));\nvec3 v3Ray = v3Pos - czm_viewerPositionWC;\nfloat fFar = length(v3Ray);\nv3Ray /= fFar;\nfloat fCameraHeight = length(czm_viewerPositionWC);\nfloat fCameraHeight2 = fCameraHeight * fCameraHeight;\nfloat B = 2.0 * length(czm_viewerPositionWC) * dot(normalize(czm_viewerPositionWC), v3Ray);\nfloat C = fCameraHeight2 - fOuterRadius2;\nfloat fDet = max(0.0, B*B - 4.0 * C);\nfloat fNear = 0.5 * (-B - sqrt(fDet));\nvec3 v3Start = czm_viewerPositionWC + v3Ray * fNear;\nfFar -= fNear;\nfloat fDepth = exp((fInnerRadius - fOuterRadius) / fScaleDepth);\nfloat fLightAngle = 1.0;\nfloat fCameraAngle = dot(-v3Ray, v3Pos) / length(v3Pos);\nfloat fCameraScale = scale(fCameraAngle);\nfloat fLightScale = scale(fLightAngle);\nfloat fCameraOffset = fDepth*fCameraScale;\nfloat fTemp = (fLightScale + fCameraScale);\nfloat fSampleLength = fFar / fSamples;\nfloat fScaledLength = fSampleLength * fScale;\nvec3 v3SampleRay = v3Ray * fSampleLength;\nvec3 v3SamplePoint = v3Start + v3SampleRay * 0.5;\nvec3 v3FrontColor = vec3(0.0);\nvec3 v3Attenuate = vec3(0.0);\nfor(int i=0; i<nSamples; i++)\n{\nfloat fHeight = length(v3SamplePoint);\nfloat fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fHeight));\nfloat fScatter = fDepth*fTemp - fCameraOffset;\nv3Attenuate = exp(-fScatter * (v3InvWavelength * fKr4PI + fKm4PI));\nv3FrontColor += v3Attenuate * (fDepth * fScaledLength);\nv3SamplePoint += v3SampleRay;\n}\nAtmosphereColor color;\ncolor.mie = v3FrontColor * (v3InvWavelength * fKrESun + fKmESun);\ncolor.rayleigh = v3Attenuate;\nreturn color;\n}\n"}),i("Scene/GlobeSurfaceShaderSet",["../Core/defined","../Core/destroyObject","../Core/TerrainQuantization","../Renderer/ShaderProgram","../Scene/SceneMode"],function(e,t,i,r,n){"use strict";function o(e,t,i){this.numberOfDayTextures=e,this.flags=t,this.shaderProgram=i}function a(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this._pickShaderPrograms=[]}function s(e){var t,i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",r="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition2DMode(position, height, textureCoordinates); }",o="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",a="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }"; -switch(e){case n.SCENE3D:t=i;break;case n.SCENE2D:t=r;break;case n.COLUMBUS_VIEW:t=o;break;case n.MORPHING:t=a}return t}function l(e){var t="float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }",i="float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }";return e?i:t}return a.prototype.getShaderProgram=function(t,n,a,u,c,h,d,p,m,f,v,g,_,y,C){var E=0,S="",w=n.pickTerrain.mesh.encoding,T=w.quantization;T===i.BITS12&&(E=1,S="QUANTIZATION_BITS12");var x=t.mode,b=x|u<<2|c<<3|h<<4|d<<5|p<<6|m<<7|f<<8|v<<9|g<<10|_<<11|y<<12|C<<13|E<<14,A=n.surfaceShader;if(e(A)&&A.numberOfDayTextures===a&&A.flags===b)return A.shaderProgram;var P=this._shadersByTexturesFlags[a];if(e(P)||(P=this._shadersByTexturesFlags[a]=[]),A=P[b],!e(A)){var I=this.baseVertexShaderSource.clone(),M=this.baseFragmentShaderSource.clone();I.defines.push(S),M.defines.push("TEXTURE_UNITS "+a),u&&M.defines.push("APPLY_BRIGHTNESS"),c&&M.defines.push("APPLY_CONTRAST"),h&&M.defines.push("APPLY_HUE"),d&&M.defines.push("APPLY_SATURATION"),p&&M.defines.push("APPLY_GAMMA"),m&&M.defines.push("APPLY_ALPHA"),f&&(M.defines.push("SHOW_REFLECTIVE_OCEAN"),I.defines.push("SHOW_REFLECTIVE_OCEAN")),v&&M.defines.push("SHOW_OCEAN_WAVES"),g&&(_?(I.defines.push("ENABLE_VERTEX_LIGHTING"),M.defines.push("ENABLE_VERTEX_LIGHTING")):(I.defines.push("ENABLE_DAYNIGHT_SHADING"),M.defines.push("ENABLE_DAYNIGHT_SHADING"))),C&&(I.defines.push("FOG"),M.defines.push("FOG"));for(var D=" vec4 computeDayColor(vec4 initialColor, vec2 textureCoordinates)\n {\n vec4 color = initialColor;\n",R=0;a>R;++R)D+=" color = sampleAndBlend(\n color,\n u_dayTextures["+R+"],\n textureCoordinates,\n u_dayTextureTexCoordsRectangle["+R+"],\n u_dayTextureTranslationAndScale["+R+"],\n "+(m?"u_dayTextureAlpha["+R+"]":"1.0")+",\n "+(u?"u_dayTextureBrightness["+R+"]":"0.0")+",\n "+(c?"u_dayTextureContrast["+R+"]":"0.0")+",\n "+(h?"u_dayTextureHue["+R+"]":"0.0")+",\n "+(d?"u_dayTextureSaturation["+R+"]":"0.0")+",\n "+(p?"u_dayTextureOneOverGamma["+R+"]":"0.0")+"\n );\n";D+=" return color;\n }",M.sources.push(D),I.sources.push(s(x)),I.sources.push(l(y));var O=r.fromCache({context:t.context,vertexShaderSource:I,fragmentShaderSource:M,attributeLocations:w.getAttributeLocations()});A=P[b]=new o(a,b,O)}return n.surfaceShader=A,A.shaderProgram},a.prototype.getPickShaderProgram=function(t,n,o){var a=0,u="",c=n.pickTerrain.mesh.encoding,h=c.quantization;h===i.BITS12&&(a=1,u="QUANTIZATION_BITS12");var d=t.mode,p=d|o<<2|a<<3,m=this._pickShaderPrograms[p];if(!e(m)){var f=this.baseVertexShaderSource.clone();f.defines.push(u),f.sources.push(s(d)),f.sources.push(l(o));var v="void main()\n{\n gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n}\n";m=this._pickShaderPrograms[p]=r.fromCache({context:t.context,vertexShaderSource:f,fragmentShaderSource:v,attributeLocations:c.getAttributeLocations()})}return m},a.prototype.destroy=function(){var i=this._shadersByTexturesFlags;for(var r in i)if(i.hasOwnProperty(r)){var n=i[r];if(!e(n))continue;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];e(a)&&a.shaderProgram.destroy()}}return t(this)},a}),i("Scene/ImageryState",["../Core/freezeObject"],function(e){"use strict";var t={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7};return e(t)}),i("Scene/QuadtreeTileLoadState",["../Core/freezeObject"],function(e){"use strict";var t={START:0,LOADING:1,DONE:2,FAILED:3};return e(t)}),i("Scene/TerrainState",["../Core/freezeObject"],function(e){"use strict";var t={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6};return e(t)}),i("Scene/TileBoundingBox",["../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/Rectangle","./SceneMode"],function(e,t,i,r,n,o,a,s){"use strict";function l(t,i,r){r.cartographicToCartesian(a.southwest(i),t.southwestCornerCartesian),r.cartographicToCartesian(a.northeast(i),t.northeastCornerCartesian),m.longitude=i.west,m.latitude=.5*(i.south+i.north),m.height=0;var n=r.cartographicToCartesian(m,d),o=e.cross(n,e.UNIT_Z,c);e.normalize(o,t.westNormal),m.longitude=i.east;var s=r.cartographicToCartesian(m,p),l=e.cross(e.UNIT_Z,s,c);e.normalize(l,t.eastNormal);var u=r.geodeticSurfaceNormalCartographic(a.southeast(i),h),f=e.subtract(n,s,c),v=e.cross(u,f,h);e.normalize(v,t.southNormal);var g=r.geodeticSurfaceNormalCartographic(a.northwest(i),h),_=e.cross(f,g,h);e.normalize(_,t.northNormal)}var u=function(t){t=i(t,i.EMPTY_OBJECT),this.rectangle=a.clone(t.rectangle),this.minimumHeight=i(t.minimumHeight,0),this.maximumHeight=i(t.maximumHeight,0),this.southwestCornerCartesian=new e,this.northeastCornerCartesian=new e,this.westNormal=new e,this.southNormal=new e,this.eastNormal=new e,this.northNormal=new e;var r=i(t.ellipsoid,o.WGS84);l(this,t.rectangle,r)},c=new e,h=new e,d=new e,p=new e,m=new t,f=new e,v=new e,g=new e(0,-1,0),_=new e(0,0,-1),y=new e;return u.prototype.distanceToCamera=function(t){var i=t.camera,r=i.positionWC,n=i.positionCartographic,o=0;if(!a.contains(this.rectangle,n)){var l=this.southwestCornerCartesian,u=this.northeastCornerCartesian,c=this.westNormal,h=this.southNormal,d=this.eastNormal,p=this.northNormal;t.mode!==s.SCENE3D&&(l=t.mapProjection.project(a.southwest(this.rectangle),f),l.z=l.y,l.y=l.x,l.x=0,u=t.mapProjection.project(a.northeast(this.rectangle),v),u.z=u.y,u.y=u.x,u.x=0,c=g,d=e.UNIT_Y,h=_,p=e.UNIT_Z);var m=e.subtract(r,l,y),C=e.dot(m,c),E=e.dot(m,h),S=e.subtract(r,u,y),w=e.dot(S,d),T=e.dot(S,p);C>0?o+=C*C:w>0&&(o+=w*w),E>0?o+=E*E:T>0&&(o+=T*T)}var x;x=t.mode===s.SCENE3D?n.height:r.x;var b=t.mode===s.SCENE3D?this.maximumHeight:0,A=x-b;return A>0&&(o+=A*A),Math.sqrt(o)},u}),i("Scene/TileTerrain",["../Core/BoundingSphere","../Core/Cartesian3","../Core/ComponentDatatype","../Core/defined","../Core/DeveloperError","../Core/IndexDatatype","../Core/OrientedBoundingBox","../Core/TileProviderError","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/VertexArray","../ThirdParty/when","./TerrainState","./TileBoundingBox"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(e){this.state=d.UNLOADED,this.data=void 0,this.mesh=void 0,this.vertexArray=void 0,this.upsampleDetails=e}function f(e,t,i,n,o){function a(t){e.data=t,e.state=d.RECEIVED}function l(){e.state=d.FAILED;var r="Failed to obtain terrain tile X: "+i+" Y: "+n+" Level: "+o+".";t._requestError=s.handleError(t._requestError,t,t.errorEvent,r,i,n,o,u)}function u(){e.data=t.requestTileGeometry(i,n,o),r(e.data)?(e.state=d.RECEIVING,h(e.data,a,l)):e.state=d.UNLOADED}u()}function v(e,t,i,n,o,a){var s=i.tilingScheme,l=e.data,u=l.createMesh(s,n,o,a,t.terrainExaggeration);r(u)&&(e.state=d.TRANSFORMING,h(u,function(t){e.mesh=t,e.state=d.TRANSFORMED},function(){e.state=d.FAILED}))}function g(e,t,i,n,a,s){var h=e.mesh.vertices,p=l.createVertexBuffer({context:t,typedArray:h,usage:u.STATIC_DRAW}),m=e.mesh.encoding.getAttributes(p),f=e.mesh.indices.indexBuffers||{},v=f[t.id];if(!r(v)||v.isDestroyed()){var g=e.mesh.indices,_=2===g.BYTES_PER_ELEMENT?o.UNSIGNED_SHORT:o.UNSIGNED_INT;v=l.createIndexBuffer({context:t,typedArray:g,usage:u.STATIC_DRAW,indexDatatype:_}),v.vertexArrayDestroyable=!1,v.referenceCount=1,f[t.id]=v,e.mesh.indices.indexBuffers=f}else++v.referenceCount;e.vertexArray=new c({context:t,attributes:m,indexBuffer:v}),e.state=d.READY}return m.prototype.freeResources=function(){if(this.state=d.UNLOADED,this.data=void 0,this.mesh=void 0,r(this.vertexArray)){var e=this.vertexArray.indexBuffer;this.vertexArray.destroy(),this.vertexArray=void 0,!e.isDestroyed()&&r(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy())}},m.prototype.publishToTile=function(i){var r=i.data,n=this.mesh;t.clone(n.center,r.center),r.minimumHeight=n.minimumHeight,r.maximumHeight=n.maximumHeight,r.boundingSphere3D=e.clone(n.boundingSphere3D,r.boundingSphere3D),r.orientedBoundingBox=a.clone(n.orientedBoundingBox,r.orientedBoundingBox),r.tileBoundingBox=new p({rectangle:i.rectangle,minimumHeight:n.minimumHeight,maximumHeight:n.maximumHeight,ellipsoid:i.tilingScheme.ellipsoid}),i.data.occludeePointInScaledSpace=t.clone(n.occludeePointInScaledSpace,r.occludeePointInScaledSpace),r.freeVertexArray(),r.vertexArray=this.vertexArray,this.vertexArray=void 0},m.prototype.processLoadStateMachine=function(e,t,i,r,n){this.state===d.UNLOADED&&f(this,t,i,r,n),this.state===d.RECEIVED&&v(this,e,t,i,r,n),this.state===d.TRANSFORMED&&g(this,e.context,t,i,r,n)},m.prototype.processUpsampleStateMachine=function(e,t,i,n,o){if(this.state===d.UNLOADED){var a=this.upsampleDetails,s=a.data,l=a.x,u=a.y,c=a.level;if(this.data=s.upsample(t.tilingScheme,l,u,c,i,n,o),!r(this.data))return;this.state=d.RECEIVING;var p=this;h(this.data,function(e){p.data=e,p.state=d.RECEIVED},function(){p.state=d.FAILED})}this.state===d.RECEIVED&&v(this,e,t,i,n,o),this.state===d.TRANSFORMED&&g(this,e.context,t,i,n,o)},m}),i("Scene/GlobeSurfaceTile",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/IntersectionTests","../Core/PixelFormat","../Core/Rectangle","../Renderer/PixelDatatype","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","./ImageryState","./QuadtreeTileLoadState","./SceneMode","./TerrainState","./TileBoundingBox","./TileTerrain"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E){"use strict";function S(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new i(0,0,1,1),this.terrainData=void 0,this.center=new t,this.vertexArray=void 0,this.minimumHeight=0,this.maximumHeight=0,this.boundingSphere3D=new e,this.boundingSphere2D=new e,this.orientedBoundingBox=void 0,this.tileBoundingBox=void 0,this.occludeePointInScaledSpace=new t,this.loadedTerrain=void 0,this.upsampledTerrain=void 0,this.pickBoundingSphere=new e,this.pickTerrain=void 0,this.surfaceShader=void 0}function w(e,i,r,n,a,s){if(e.decodePosition(n,a,s),o(i)&&i!==_.SCENE3D){var l=r.ellipsoid,u=l.cartesianToCartographic(s);r.project(u,s),t.fromElements(s.z,s.x,s.y,s)}return s}function T(e,t,i){var r=e.data,n=b(e);o(n)&&(r.upsampledTerrain=new E(n)),I(e,t)&&(r.loadedTerrain=new E);for(var a=0,s=i.length;s>a;++a){var l=i.get(a);l.show&&l._createTileImagerySkeletons(e,t)}}function x(e,t,i){var r=e.data,a=r.loadedTerrain,s=r.upsampledTerrain,l=!1;o(a)&&(a.processLoadStateMachine(t,i,e.x,e.y,e.level),a.state>=y.RECEIVED&&(r.terrainData!==a.data&&(r.terrainData=a.data,D(t.context,r),P(e)),l=!0),a.state===y.READY?(a.publishToTile(e),r.pickTerrain=n(r.loadedTerrain,r.upsampledTerrain),r.loadedTerrain=void 0,r.upsampledTerrain=void 0):a.state===y.FAILED&&(r.loadedTerrain=void 0)),!l&&o(s)&&(s.processUpsampleStateMachine(t,i,e.x,e.y,e.level),s.state>=y.RECEIVED&&r.terrainData!==s.data&&(r.terrainData=s.data,i.hasWaterMask&&R(e),A(e)),s.state===y.READY?(s.publishToTile(e),r.pickTerrain=r.upsampledTerrain,r.upsampledTerrain=void 0):s.state===y.FAILED&&(r.upsampledTerrain=void 0))}function b(e){for(var t=e.parent;o(t)&&o(t.data)&&!o(t.data.terrainData);)t=t.parent;return o(t)&&o(t.data)?{data:t.data.terrainData,x:t.x,y:t.y,level:t.level}:void 0}function A(e){var t=e.data;if(o(e._children))for(var i=0;4>i;++i){var r=e._children[i];if(r.state!==g.START){var n=r.data;if(o(n.terrainData)&&!n.terrainData.wasCreatedByUpsampling())continue;o(n.upsampledTerrain)&&n.upsampledTerrain.freeResources(),n.upsampledTerrain=new E({data:t.terrainData,x:e.x,y:e.y,level:e.level}),r.state=g.LOADING}}}function P(e){var t=e.data;if(o(e.children))for(var i=0;4>i;++i){var r=e.children[i];if(r.state!==g.START){var n=r.data;if(o(n.terrainData)&&!n.terrainData.wasCreatedByUpsampling())continue;o(n.upsampledTerrain)&&n.upsampledTerrain.freeResources(),n.upsampledTerrain=new E({data:t.terrainData,x:e.x,y:e.y,level:e.level}),t.terrainData.isChildAvailable(e.x,e.y,r.x,r.y)&&(o(n.loadedTerrain)||(n.loadedTerrain=new E)),r.state=g.LOADING}}}function I(e,t){var i=t.getTileDataAvailable(e.x,e.y,e.level);if(o(i))return i;var r=e.parent;return o(r)?o(r.data)&&o(r.data.terrainData)?r.data.terrainData.isChildAvailable(r.x,r.y,e.x,e.y):!1:!0}function M(e){var t=e.cache.tile_waterMaskData;if(!o(t)){var i=new d({context:e,pixelFormat:l.LUMINANCE,pixelDatatype:c.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});i.referenceCount=1;var r=new h({wrapS:f.CLAMP_TO_EDGE,wrapT:f.CLAMP_TO_EDGE,minificationFilter:m.LINEAR,magnificationFilter:p.LINEAR});t={allWaterTexture:i,sampler:r,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function D(e,t){var r=t.waterMaskTexture;o(r)&&(--r.referenceCount,0===r.referenceCount&&r.destroy(),t.waterMaskTexture=void 0);var n=t.terrainData.waterMask;if(o(n)){var a,s=M(e),u=n.length;if(1===u){if(0===n[0])return;a=s.allWaterTexture}else{var h=Math.sqrt(u);a=new d({context:e,pixelFormat:l.LUMINANCE,pixelDatatype:c.UNSIGNED_BYTE,source:{width:h,height:h,arrayBufferView:n},sampler:s.sampler}),a.referenceCount=0}++a.referenceCount,t.waterMaskTexture=a,i.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}}function R(e){for(var t=e.data,i=e.parent;o(i)&&!o(i.data.terrainData)||i.data.terrainData.wasCreatedByUpsampling();)i=i.parent;if(o(i)&&o(i.data.waterMaskTexture)){t.waterMaskTexture=i.data.waterMaskTexture,++t.waterMaskTexture.referenceCount;var r=i.rectangle,n=e.rectangle,a=n.width,s=n.height,l=a/r.width,u=s/r.height;t.waterMaskTranslationAndScale.x=l*(n.west-r.west)/a,t.waterMaskTranslationAndScale.y=u*(n.south-r.south)/s,t.waterMaskTranslationAndScale.z=l,t.waterMaskTranslationAndScale.w=u}}a(S.prototype,{eligibleForUnloading:{get:function(){for(var e=this.loadedTerrain,t=o(e)&&(e.state===y.RECEIVING||e.state===y.TRANSFORMING),i=this.upsampledTerrain,r=o(i)&&(i.state===y.RECEIVING||i.state===y.TRANSFORMING),n=!t&&!r,a=this.imagery,s=0,l=a.length;n&&l>s;++s){var u=a[s];n=!o(u.loadingImagery)||u.loadingImagery.state!==v.TRANSITIONING}return n}}});var O=new t,N=new t,L=new t,F=new t;return S.prototype.pick=function(e,i,r,n,a){var l=this.pickTerrain;if(o(l)){var u=l.mesh;if(o(u))for(var c=u.vertices,h=u.indices,d=u.encoding,p=h.length,m=0;p>m;m+=3){var f=h[m],v=h[m+1],g=h[m+2],_=w(d,i,r,c,f,O),y=w(d,i,r,c,v,N),C=w(d,i,r,c,g,L),E=s.rayTriangle(e,_,y,C,n,F);if(o(E))return t.clone(E,a)}}},S.prototype.freeResources=function(){o(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,o(this.loadedTerrain)&&(this.loadedTerrain.freeResources(),this.loadedTerrain=void 0),o(this.upsampledTerrain)&&(this.upsampledTerrain.freeResources(),this.upsampledTerrain=void 0),o(this.pickTerrain)&&(this.pickTerrain.freeResources(),this.pickTerrain=void 0);var e,t,i=this.imagery;for(e=0,t=i.length;t>e;++e)i[e].freeResources();this.imagery.length=0,this.freeVertexArray()},S.prototype.freeVertexArray=function(){var e;o(this.vertexArray)&&(e=this.vertexArray.indexBuffer,this.vertexArray=this.vertexArray.destroy(),!e.isDestroyed()&&o(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy())),o(this.wireframeVertexArray)&&(e=this.wireframeVertexArray.indexBuffer,this.wireframeVertexArray=this.wireframeVertexArray.destroy(),!e.isDestroyed()&&o(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy()))},S.processStateMachine=function(e,t,i,r){var n=e.data;o(n)||(n=e.data=new S),e.state===g.START&&(T(e,i,r),e.state=g.LOADING),e.state===g.LOADING&&x(e,t,i);for(var a=o(n.vertexArray),s=!o(n.loadedTerrain)&&!o(n.upsampledTerrain),l=o(n.terrainData)&&n.terrainData.wasCreatedByUpsampling(),u=n.imagery,c=0,h=u.length;h>c;++c){var d=u[c];if(o(d.loadingImagery)){if(d.loadingImagery.state===v.PLACEHOLDER){var p=d.loadingImagery.imageryLayer;if(p.imageryProvider.ready){d.freeResources(),u.splice(c,1),p._createTileImagerySkeletons(e,i,c),--c,h=u.length;continue}l=!1}var m=d.processStateMachine(e,t);s=s&&m,a=a&&(m||o(d.readyImagery)),l=l&&o(d.loadingImagery)&&(d.loadingImagery.state===v.FAILED||d.loadingImagery.state===v.INVALID)}else l=!1}e.upsampledFromParent=l,c===h&&(a&&(e.renderable=!0),s&&(e.state=g.DONE))},S}),i("Shaders/ReprojectWebMercatorFS",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),i("Shaders/ReprojectWebMercatorVS",[],function(){"use strict";return"attribute vec4 position;\nattribute float webMercatorT;\nuniform vec2 u_textureDimensions;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nv_textureCoordinates = vec2(position.x, webMercatorT);\ngl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0));\n}\n"}),i("Scene/Imagery",["../Core/defined","../Core/destroyObject","./ImageryState"],function(e,t,i){"use strict";function r(t,r,n,o,a){if(this.imageryLayer=t,this.x=r,this.y=n,this.level=o,0!==o){var s=r/2|0,l=n/2|0,u=o-1;this.parent=t.getImageryFromCache(s,l,u)}if(this.state=i.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.credits=void 0,this.referenceCount=0,!e(a)&&t.imageryProvider.ready){var c=t.imageryProvider.tilingScheme;a=c.tileXYToRectangle(r,n,o)}this.rectangle=a}return r.createPlaceholder=function(e){var t=new r(e,0,0,0);return t.addReference(),t.state=i.PLACEHOLDER,t},r.prototype.addReference=function(){++this.referenceCount},r.prototype.releaseReference=function(){return--this.referenceCount,0===this.referenceCount?(this.imageryLayer.removeImageryFromCache(this),e(this.parent)&&this.parent.releaseReference(),e(this.image)&&e(this.image.destroy)&&this.image.destroy(),e(this.texture)&&this.texture.destroy(),t(this),0):this.referenceCount},r.prototype.processStateMachine=function(e){this.state===i.UNLOADED&&(this.state=i.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===i.RECEIVED&&(this.state=i.TRANSITIONING,this.imageryLayer._createTexture(e.context,this)),this.state===i.TEXTURE_LOADED&&(this.state=i.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this))},r}),i("Scene/TileImagery",["../Core/defined","./ImageryState"],function(e,t){"use strict";function i(e,t){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0}return i.prototype.freeResources=function(){e(this.readyImagery)&&this.readyImagery.releaseReference(),e(this.loadingImagery)&&this.loadingImagery.releaseReference()},i.prototype.processStateMachine=function(i,r){var n=this.loadingImagery,o=n.imageryLayer;if(n.processStateMachine(r),n.state===t.READY)return e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(i,this),!0;for(var a,s=n.parent;e(s)&&s.state!==t.READY;)s.state!==t.FAILED&&s.state!==t.INVALID&&(a=a||s),s=s.parent;return this.readyImagery!==s&&(e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=s,e(s)&&(s.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(i,this))),n.state===t.FAILED||n.state===t.INVALID?e(a)?(a.processStateMachine(r),!1):!0:!1},i}),i("Scene/ImageryLayer",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian4","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/FeatureDetection","../Core/GeographicTilingScheme","../Core/IndexDatatype","../Core/Math","../Core/PixelFormat","../Core/PrimitiveType","../Core/Rectangle","../Core/TerrainProvider","../Core/TileProviderError","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ClearCommand","../Renderer/ComputeCommand","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/MipmapHint","../Renderer/RenderState","../Renderer/Sampler","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Renderer/VertexArray","../Shaders/ReprojectWebMercatorFS","../Shaders/ReprojectWebMercatorVS","../ThirdParty/when","./Imagery","./ImageryState","./TileImagery"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O,N,L,F,B,V,k,z){"use strict";function U(e,t){this._imageryProvider=e,t=o(t,{}),this.alpha=o(t.alpha,o(e.defaultAlpha,1)),this.brightness=o(t.brightness,o(e.defaultBrightness,U.DEFAULT_BRIGHTNESS)),this.contrast=o(t.contrast,o(e.defaultContrast,U.DEFAULT_CONTRAST)),this.hue=o(t.hue,o(e.defaultHue,U.DEFAULT_HUE)),this.saturation=o(t.saturation,o(e.defaultSaturation,U.DEFAULT_SATURATION)),this.gamma=o(t.gamma,o(e.defaultGamma,U.DEFAULT_GAMMA)),this.show=o(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=o(t.rectangle,f.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new z(V.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0}function G(e,t,i,r){if(d.isPowerOfTwo(r.width)&&d.isPowerOfTwo(r.height)){var n=t.cache.imageryLayer_mipmapSampler;if(!a(n)){var s=S.maximumTextureFilterAnisotropy;n=t.cache.imageryLayer_mipmapSampler=new A({wrapS:O.CLAMP_TO_EDGE,wrapT:O.CLAMP_TO_EDGE,minificationFilter:R.LINEAR_MIPMAP_LINEAR,magnificationFilter:D.LINEAR,maximumAnisotropy:Math.min(s,o(e._maximumAnisotropy,s))})}r.generateMipmap(x.NICEST),r.sampler=n}else{var l=t.cache.imageryLayer_nonMipmapSampler;a(l)||(l=t.cache.imageryLayer_nonMipmapSampler=new A({wrapS:O.CLAMP_TO_EDGE,wrapT:O.CLAMP_TO_EDGE,minificationFilter:R.LINEAR,magnificationFilter:D.LINEAR})),r.sampler=l}i.state=k.READY}function W(e,t,i){return JSON.stringify([e,t,i])}function H(e,t,i,r){var n=t.cache.imageryLayer_reproject;if(!a(n)){n=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){a(this.framebuffer)&&this.framebuffer.destroy(),a(this.vertexArray)&&this.vertexArray.destroy(),a(this.shaderProgram)&&this.shaderProgram.destroy()}};for(var o=new Float32Array(256),s=0,l=0;64>l;++l){var u=l/63;o[s++]=0,o[s++]=u,o[s++]=1,o[s++]=u}var c={position:0,webMercatorT:1},p=v.getRegularGridIndices(2,64),m=_.createIndexBuffer({context:t,typedArray:p,usage:y.STATIC_DRAW,indexDatatype:h.UNSIGNED_SHORT});n.vertexArray=new N({context:t,attributes:[{index:c.position,vertexBuffer:_.createVertexBuffer({context:t,typedArray:o,usage:y.STATIC_DRAW}),componentsPerAttribute:2},{index:c.webMercatorT,vertexBuffer:_.createVertexBuffer({context:t,sizeInBytes:512,usage:y.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:m});var f=new I({sources:[F]});n.shaderProgram=P.fromCache({context:t,vertexShaderSource:f,fragmentShaderSource:L,attributeLocations:c}),n.sampler=new A({wrapS:O.CLAMP_TO_EDGE,wrapT:O.CLAMP_TO_EDGE,minificationFilter:R.LINEAR,magnificationFilter:D.LINEAR})}i.sampler=n.sampler;var g=i.width,C=i.height;Z.textureDimensions.x=g,Z.textureDimensions.y=C,Z.texture=i;var E=Math.sin(r.south),S=.5*Math.log((1+E)/(1-E));E=Math.sin(r.north);var w=.5*Math.log((1+E)/(1-E)),T=1/(w-S),b=new M({context:t,width:g,height:C,pixelFormat:i.pixelFormat,pixelDatatype:i.pixelDatatype,preMultiplyAlpha:i.preMultiplyAlpha});d.isPowerOfTwo(g)&&d.isPowerOfTwo(C)&&b.generateMipmap(x.NICEST);for(var B=r.south,V=r.north,k=K,z=0,U=0;64>U;++U){var G=U/63,W=d.lerp(B,V,G);E=Math.sin(W);var H=.5*Math.log((1+E)/(1-E)),q=(H-S)*T;k[z++]=q,k[z++]=q}n.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(k),e.shaderProgram=n.shaderProgram,e.outputTexture=b,e.uniformMap=Z,e.vertexArray=n.vertexArray}function q(e,t,i){var r=e._imageryProvider,n=r.tilingScheme,o=n.ellipsoid,a=e._imageryProvider.tilingScheme instanceof c?1:Math.cos(i),s=n.rectangle,l=o.maximumRadius*s.width*a/(r.tileWidth*n.getNumberOfXTilesAtLevel(0)),u=l/t,h=Math.log(u)/Math.log(2),d=Math.round(h);return 0|d}s(U.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},rectangle:{get:function(){return this._rectangle}}}),U.DEFAULT_BRIGHTNESS=1,U.DEFAULT_CONTRAST=1,U.DEFAULT_HUE=0,U.DEFAULT_SATURATION=1,U.DEFAULT_GAMMA=1,U.prototype.isBaseLayer=function(){return this._isBaseLayer},U.prototype.isDestroyed=function(){return!1},U.prototype.destroy=function(){return l(this)};var j=new f,Y=new f,X=new f;U.prototype.getViewableRectangle=function(){var e=this._imageryProvider,t=this._rectangle;return e.readyPromise.then(function(){return f.intersection(e.rectangle,t)})},U.prototype._createTileImagerySkeletons=function(e,t,r){var n=e.data;if(a(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel)return!1;if(a(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;var o=this._imageryProvider;if(a(r)||(r=n.imagery.length),!o.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),n.imagery.splice(r,0,this._skeletonPlaceholder),!0;var s=f.intersection(o.rectangle,this._rectangle,j),l=f.intersection(e.rectangle,s,Y);if(!a(l)){if(!this.isBaseLayer())return!1;var u=s,c=e.rectangle;l=Y,c.south>=u.north?l.north=l.south=u.north:c.north<=u.south?l.north=l.south=u.south:(l.south=Math.max(c.south,u.south),l.north=Math.min(c.north,u.north)),c.west>=u.east?l.west=l.east=u.east:c.east<=u.west?l.west=l.east=u.west:(l.west=Math.max(c.west,u.west),l.east=Math.min(c.east,u.east))}var h=0;l.south>0?h=l.south:l.north<0&&(h=l.north);var d=1,p=d*t.getLevelMaximumGeometricError(e.level),m=q(this,p,h);m=Math.max(0,m);var v=o.maximumLevel;if(m>v&&(m=v),a(o.minimumLevel)){var g=o.minimumLevel;g>m&&(m=g)}var _=o.tilingScheme,y=_.positionToTileXY(f.northwest(l),m),C=_.positionToTileXY(f.southeast(l),m),E=e.rectangle.height/512,S=e.rectangle.width/512,w=_.tileXYToRectangle(y.x,y.y,m);Math.abs(w.south-e.rectangle.north)<S&&y.y<C.y&&++y.y,Math.abs(w.east-e.rectangle.west)<E&&y.x<C.x&&++y.x;var T=_.tileXYToRectangle(C.x,C.y,m);Math.abs(T.north-e.rectangle.south)<S&&C.y>y.y&&--C.y,Math.abs(T.west-e.rectangle.east)<E&&C.x>y.x&&--C.x;var x,b,A=e.rectangle,P=_.tileXYToRectangle(y.x,y.y,m),I=f.intersection(P,s,X),M=0,D=1;!this.isBaseLayer()&&Math.abs(I.west-e.rectangle.west)>=E&&(M=Math.min(1,(I.west-A.west)/A.width)),!this.isBaseLayer()&&Math.abs(I.north-e.rectangle.north)>=S&&(D=Math.max(0,(I.north-A.south)/A.height));for(var R=D,O=y.x;O<=C.x;O++){x=M,P=_.tileXYToRectangle(O,y.y,m),I=f.intersection(P,s,X),M=Math.min(1,(I.east-A.west)/A.width),O===C.x&&(this.isBaseLayer()||Math.abs(I.east-e.rectangle.east)<E)&&(M=1),D=R;for(var N=y.y;N<=C.y;N++){b=D,P=_.tileXYToRectangle(O,N,m),I=f.intersection(P,s,X),D=Math.max(0,(I.south-A.south)/A.height),N===C.y&&(this.isBaseLayer()||Math.abs(I.south-e.rectangle.south)<S)&&(D=0);var L=new i(x,D,M,b),F=this.getImageryFromCache(O,N,m,P);n.imagery.splice(r,0,new z(F,L)),++r}}return!0},U.prototype._calculateTextureTranslationAndScale=function(e,t){var r=t.readyImagery.rectangle,n=e.rectangle,o=n.width,a=n.height,s=o/r.width,l=a/r.height;return new i(s*(n.west-r.west)/o,l*(n.south-r.south)/a,s,l)},U.prototype._requestImagery=function(e){function t(t){return a(t)?(e.image=t,e.state=k.RECEIVED,void g.handleSuccess(o._requestImageError)):i()}function i(t){e.state=k.FAILED;var i="Failed to obtain image tile X: "+e.x+" Y: "+e.y+" Level: "+e.level+".";o._requestImageError=g.handleError(o._requestImageError,n,n.errorEvent,i,e.x,e.y,e.level,r,t)}function r(){e.state=k.TRANSITIONING;var r=n.requestImage(e.x,e.y,e.level);return a(r)?(a(n.getTileCredits)&&(e.credits=n.getTileCredits(e.x,e.y,e.level)),void B(r,t,i)):void(e.state=k.UNLOADED)}var n=this._imageryProvider,o=this;r()},U.prototype._createTexture=function(e,t){var i=this._imageryProvider;if(a(i.tileDiscardPolicy)){var r=i.tileDiscardPolicy;if(a(r)){if(!r.isReady())return void(t.state=k.RECEIVED);if(r.shouldDiscardImage(t.image))return void(t.state=k.INVALID)}}var n=new M({context:e,source:t.image,pixelFormat:i.hasAlphaChannel?p.RGBA:p.RGB});t.texture=n,t.image=void 0,t.state=k.TEXTURE_LOADED},U.prototype._reprojectTexture=function(e,t){var i=t.texture,r=t.rectangle,n=e.context;if(!(this._imageryProvider.tilingScheme instanceof c)&&r.width/i.width>1e-5){var o=this,a=new E({persists:!0,owner:this,preExecute:function(e){H(e,n,i,t.rectangle)},postExecute:function(e){i.destroy(),t.texture=e,G(o,n,t,e)}});e.commandList.push(a)}else G(this,n,t,i)},U.prototype.getImageryFromCache=function(e,t,i,r){var n=W(e,t,i),o=this._imageryCache[n];return a(o)||(o=new V(this,e,t,i,r),this._imageryCache[n]=o),o.addReference(),o},U.prototype.removeImageryFromCache=function(e){var t=W(e.x,e.y,e.level);delete this._imageryCache[t]};var Z={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new t,texture:void 0},K=u.supportsTypedArrays()?new Float32Array(128):void 0;return U}),i("Scene/GlobeSurfaceTileProvider",["../Core/BoundingSphere","../Core/BoxOutlineGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/FeatureDetection","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/OrientedBoundingBox","../Core/PrimitiveType","../Core/Rectangle","../Core/SphereOutlineGeometry","../Core/TerrainQuantization","../Core/Visibility","../Core/WebMercatorProjection","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/VertexArray","../Scene/BlendingState","../Scene/DepthFunction","../Scene/Pass","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../ThirdParty/when","./GlobeSurfaceTile","./ImageryLayer","./ImageryState","./QuadtreeTileLoadState","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O,N,L,F,B,V,k,z,U,G,W){"use strict";function H(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._pickRenderState=void 0,this._errorEvent=new d,this._imageryLayers.layerAdded.addEventListener(H.prototype._onLayerAdded,this),this._imageryLayers.layerRemoved.addEventListener(H.prototype._onLayerRemoved,this),this._imageryLayers.layerMoved.addEventListener(H.prototype._onLayerMoved,this),this._imageryLayers.layerShownOrHidden.addEventListener(H.prototype._onLayerShownOrHidden,this),this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._pickCommands=[],this._usedDrawCommands=0,this._usedPickCommands=0,this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new o(0,0,.5,1)}function q(e,t){var i=e.loadingImagery;l(i)||(i=e.readyImagery);var r=t.loadingImagery;return l(r)||(r=t.readyImagery),i.imageryLayer._layerIndex-r.imageryLayer._layerIndex}function j(){var e={u_initialColor:function(){return this.initialColor},u_zoomedOutOceanSpecularIntensity:function(){return this.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.oceanNormalMap},u_lightingFadeDistance:function(){ -return this.lightingFadeDistance},u_center3D:function(){return this.center3D},u_tileRectangle:function(){return this.tileRectangle},u_modifiedModelView:function(){return this.modifiedModelView},u_dayTextures:function(){return this.dayTextures},u_dayTextureTranslationAndScale:function(){return this.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.dayTextureTexCoordsRectangle},u_dayTextureAlpha:function(){return this.dayTextureAlpha},u_dayTextureBrightness:function(){return this.dayTextureBrightness},u_dayTextureContrast:function(){return this.dayTextureContrast},u_dayTextureHue:function(){return this.dayTextureHue},u_dayTextureSaturation:function(){return this.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.dayTextureOneOverGamma},u_dayIntensity:function(){return this.dayIntensity},u_southAndNorthLatitude:function(){return this.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.waterMask},u_waterMaskTranslationAndScale:function(){return this.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.minMaxHeight},u_scaleAndBias:function(){return this.scaleAndBias},initialColor:new n(0,0,.5,1),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new i(65e5,9e6),center3D:void 0,modifiedModelView:new y,tileRectangle:new n,dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayIntensity:0,southAndNorthLatitude:new i,southMercatorYAndOneOverHeight:new i,waterMask:void 0,waterMaskTranslationAndScale:new n,minMaxHeight:new i,scaleAndBias:new y};return e}function Y(e,t,i){var r=i.data;l(r.wireframeVertexArray)||l(r.terrainData)&&l(r.terrainData._mesh)&&(r.wireframeVertexArray=X(e,r.vertexArray,r.terrainData._mesh))}function X(e,t,i){var r={indices:i.indices,primitiveType:E.TRIANGLES};f.toWireframe(r);var n=r.indices,o=A.createIndexBuffer({context:e,typedArray:n,usage:P.STATIC_DRAW,indexDatatype:v.UNSIGNED_SHORT});return new R({context:e,attributes:t._attributes,indexBuffer:o})}function Z(t,i,a){var s=i.data,u=a.camera.viewMatrix,c=I.maximumTextureImageUnits,h=s.waterMaskTexture,d=t.hasWaterMask&&l(h),p=t.oceanNormalMap,m=d&&l(p),f=t.terrainProvider.ready&&t.terrainProvider.hasVertexNormals,v=a.fog.enabled;d&&--c,m&&--c;var g=s.center,w=s.pickTerrain.mesh.encoding,x=$,A=0,P=0,D=0,R=0,O=!1;if(a.mode!==W.SCENE3D){var N=a.mapProjection,F=N.project(S.southwest(i.rectangle),ie),B=N.project(S.northeast(i.rectangle),re);if(x.x=F.x,x.y=F.y,x.z=B.x,x.w=B.y,a.mode!==W.MORPHING&&(g=ee,g.x=0,g.y=.5*(x.z+x.x),g.z=.5*(x.w+x.y),x.x-=g.y,x.y-=g.z,x.z-=g.y,x.w-=g.z),a.mode===W.SCENE2D&&w.quantization===T.BITS12){var V=1/(Math.pow(2,12)-1)*.5,k=(x.z-x.x)*V,G=(x.w-x.y)*V;x.x-=k,x.y-=G,x.z+=k,x.w+=G}N instanceof b&&(A=i.rectangle.south,P=i.rectangle.north,D=b.geodeticLatitudeToMercatorAngle(A),R=1/(b.geodeticLatitudeToMercatorAngle(P)-D),O=!0)}var H=y.multiplyByPoint(u,g,te);y.setTranslation(u,H,J);var q=s.imagery,X=0,Z=q.length,K=t._renderState,Q=t._blendRenderState,le=K,ue=t._firstPassInitialColor,ce=a.context;l(t._debug.boundingSphereTile)||ae();do{var he,de,pe=0;t._drawCommands.length<=t._usedDrawCommands?(he=new M,he.owner=i,he.cull=!1,he.boundingVolume=new e,he.orientedBoundingBox=void 0,de=j(),t._drawCommands.push(he),t._uniformMaps.push(de)):(he=t._drawCommands[t._usedDrawCommands],de=t._uniformMaps[t._usedDrawCommands]),he.owner=i,++t._usedDrawCommands,i===t._debug.boundingSphereTile&&(l(s.orientedBoundingBox)?ne(s.orientedBoundingBox,o.RED).update(a):l(s.boundingSphere3D)&&oe(s.boundingSphere3D,o.RED).update(a)),n.clone(ue,de.initialColor),de.oceanNormalMap=p,de.lightingFadeDistance.x=t.lightingFadeOutDistance,de.lightingFadeDistance.y=t.lightingFadeInDistance,de.zoomedOutOceanSpecularIntensity=t.zoomedOutOceanSpecularIntensity,de.center3D=s.center,n.clone(x,de.tileRectangle),de.southAndNorthLatitude.x=A,de.southAndNorthLatitude.y=P,de.southMercatorYAndOneOverHeight.x=D,de.southMercatorYAndOneOverHeight.y=R,y.clone(J,de.modifiedModelView);for(var me=v&&_.fog(i._distance,a.fog.density)>_.EPSILON3,fe=!1,ve=!1,ge=!1,_e=!1,ye=!1,Ce=!1;c>pe&&Z>X;){var Ee=q[X],Se=Ee.readyImagery;if(++X,l(Se)&&Se.state===U.READY&&0!==Se.imageryLayer.alpha){var we=Se.imageryLayer;if(l(Ee.textureTranslationAndScale)||(Ee.textureTranslationAndScale=we._calculateTextureTranslationAndScale(i,Ee)),de.dayTextures[pe]=Se.texture,de.dayTextureTranslationAndScale[pe]=Ee.textureTranslationAndScale,de.dayTextureTexCoordsRectangle[pe]=Ee.textureCoordinateRectangle,de.dayTextureAlpha[pe]=we.alpha,Ce=Ce||1!==de.dayTextureAlpha[pe],de.dayTextureBrightness[pe]=we.brightness,fe=fe||de.dayTextureBrightness[pe]!==z.DEFAULT_BRIGHTNESS,de.dayTextureContrast[pe]=we.contrast,ve=ve||de.dayTextureContrast[pe]!==z.DEFAULT_CONTRAST,de.dayTextureHue[pe]=we.hue,ge=ge||de.dayTextureHue[pe]!==z.DEFAULT_HUE,de.dayTextureSaturation[pe]=we.saturation,_e=_e||de.dayTextureSaturation[pe]!==z.DEFAULT_SATURATION,de.dayTextureOneOverGamma[pe]=1/we.gamma,ye=ye||de.dayTextureOneOverGamma[pe]!==1/z.DEFAULT_GAMMA,l(Se.credits))for(var Te=a.creditDisplay,xe=Se.credits,be=0,Ae=xe.length;Ae>be;++be)Te.addCredit(xe[be]);++pe}}de.dayTextures.length=pe,de.waterMask=h,n.clone(s.waterMaskTranslationAndScale,de.waterMaskTranslationAndScale),de.minMaxHeight.x=w.minimumHeight,de.minMaxHeight.y=w.maximumHeight,y.clone(w.matrix,de.scaleAndBias),he.shaderProgram=t._surfaceShaderSet.getShaderProgram(a,s,pe,fe,ve,ge,_e,ye,Ce,d,m,t.enableLighting,f,O,me),he.renderState=le,he.primitiveType=E.TRIANGLES,he.vertexArray=s.vertexArray,he.uniformMap=de,he.pass=L.GLOBE,t._debug.wireframe&&(Y(ce,t,i),l(s.wireframeVertexArray)&&(he.vertexArray=s.wireframeVertexArray,he.primitiveType=E.LINES));var Pe=he.boundingVolume,Ie=he.orientedBoundingBox;a.mode!==W.SCENE3D?(e.fromRectangleWithHeights2D(i.rectangle,a.mapProjection,s.minimumHeight,s.maximumHeight,Pe),r.fromElements(Pe.center.z,Pe.center.x,Pe.center.y,Pe.center),a.mode===W.MORPHING&&(Pe=e.union(s.boundingSphere3D,Pe,Pe))):(he.boundingVolume=e.clone(s.boundingSphere3D,Pe),he.orientedBoundingBox=C.clone(s.orientedBoundingBox,Ie)),a.commandList.push(he),le=Q,ue=se}while(Z>X)}function K(e,t,i){var r;e._pickCommands.length<=e._usedPickCommands?(r=new M,r.cull=!1,e._pickCommands.push(r)):r=e._pickCommands[e._usedPickCommands],++e._usedPickCommands;var n=t.owner.data,o=i.projection instanceof b;r.shaderProgram=e._surfaceShaderSet.getPickShaderProgram(i,n,o),r.renderState=e._pickRenderState,r.owner=t.owner,r.primitiveType=t.primitiveType,r.vertexArray=t.vertexArray,r.uniformMap=t.uniformMap,r.boundingVolume=t.boundingVolume,r.orientedBoundingBox=r.orientedBoundingBox,r.pass=t.pass,i.commandList.push(r)}u(H.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=n.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return this._terrainProvider.ready&&(0===this._imageryLayers.length||this._imageryLayers.get(0).imageryProvider.ready)}},tilingScheme:{get:function(){return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}}}),H.prototype.beginUpdate=function(e){this._imageryLayers._update(),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(e){e.data.imagery.sort(q)}));var t,i,r=this._tilesToRenderByTextureCount;for(t=0,i=r.length;i>t;++t){var n=r[t];l(n)&&(n.length=0)}this._usedDrawCommands=0;var o=e.creditDisplay;this._terrainProvider.ready&&l(this._terrainProvider.credit)&&o.addCredit(this._terrainProvider.credit);var a=this._imageryLayers;for(t=0,i=a.length;i>t;++t){var s=a.get(t).imageryProvider;s.ready&&l(s.credit)&&o.addCredit(s.credit)}},H.prototype.endUpdate=function(e){l(this._renderState)||(this._renderState=D.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:N.LESS}}),this._blendRenderState=D.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:N.LESS_OR_EQUAL},blending:O.ALPHA_BLEND}));for(var t=this._tilesToRenderByTextureCount,i=0,r=t.length;r>i;++i){var n=t[i];if(l(n))for(var o=0,a=n.length;a>o;++o)Z(this,n[o],e)}},H.prototype.updateForPick=function(e){l(this._pickRenderState)||(this._pickRenderState=D.fromCache({colorMask:{red:!1,green:!1,blue:!1,alpha:!1},depthTest:{enabled:!0}})),this._usedPickCommands=0;for(var t=this._drawCommands,i=0,r=this._usedDrawCommands;r>i;++i)K(this,t[i],e)},H.prototype.getLevelMaximumGeometricError=function(e){return this._terrainProvider.getLevelMaximumGeometricError(e)},H.prototype.loadTile=function(e,t){k.processStateMachine(t,e,this._terrainProvider,this._imageryLayers)};var Q=new e;H.prototype.computeTileVisibility=function(t,i,n){var o=this.computeDistanceToTile(t,i);if(t._distance=o,i.fog.enabled&&_.fog(o,i.fog.density)>=1)return x.NONE;var a=t.data,u=i.cullingVolume,c=s(a.orientedBoundingBox,a.boundingSphere3D);i.mode!==W.SCENE3D&&(c=Q,e.fromRectangleWithHeights2D(t.rectangle,i.mapProjection,a.minimumHeight,a.maximumHeight,c),r.fromElements(c.center.z,c.center.x,c.center.y,c.center),i.mode===W.MORPHING&&(c=e.union(a.boundingSphere3D,c,c)));var h=u.computeVisibility(c);if(h===g.OUTSIDE)return x.NONE;if(i.mode===W.SCENE3D){var d=a.occludeePointInScaledSpace;return l(d)?n.ellipsoid.isScaledSpacePointVisible(d)?h:x.NONE:h}return h};var J=new y,$=new n,ee=new r,te=new r,ie=new r,re=new r;H.prototype.showTileThisFrame=function(e,t){for(var i=0,r=e.data.imagery,n=0,o=r.length;o>n;++n){var a=r[n];l(a.readyImagery)&&0!==a.readyImagery.imageryLayer.alpha&&++i}var s=this._tilesToRenderByTextureCount[i];l(s)||(s=[],this._tilesToRenderByTextureCount[i]=s),s.push(e);var u=this._debug;++u.tilesRendered,u.texturesRendered+=i},H.prototype.computeDistanceToTile=function(e,t){var i=e.data,r=i.tileBoundingBox;return r.distanceToCamera(t)},H.prototype.isDestroyed=function(){return!1},H.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),c(this)},H.prototype._onLayerAdded=function(e,t){if(e.show){var i=this._terrainProvider;this._quadtree.forEachLoadedTile(function(t){e._createTileImagerySkeletons(t,i)&&(t.state=G.LOADING)}),this._layerOrderChanged=!0}},H.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(t){for(var i=t.data.imagery,r=-1,n=0,o=0,a=i.length;a>o;++o){var s=i[o],u=s.loadingImagery;if(l(u)||(u=s.readyImagery),u.imageryLayer===e)-1===r&&(r=o),s.freeResources(),++n;else if(-1!==r)break}-1!==r&&i.splice(r,n)})},H.prototype._onLayerMoved=function(e,t,i){this._layerOrderChanged=!0},H.prototype._onLayerShownOrHidden=function(e,t,i){i?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var ne,oe,ae;!function(){function e(e){return new B({geometryInstances:e,appearance:new F({translucent:!1,flat:!0}),asynchronous:!1})}var i,n,o=new m({geometry:t.fromDimensions({dimensions:new r(2,2,2)})}),s=new m({geometry:new w({radius:1})}),u=new y;ne=function(t,r){return t===i?n:(ae(),i=t,u=y.fromRotationTranslation(t.halfAxes,t.center,u),o.modelMatrix=u,o.attributes.color=a.fromColor(r),n=e(o))},oe=function(t,r){return t===i?n:(ae(),i=t,u=y.fromTranslation(t.center,u),u=y.multiplyByUniformScale(u,t.radius,u),s.modelMatrix=u,s.attributes.color=a.fromColor(r),n=e(s))},ae=function(){l(n)&&(n.destroy(),n=void 0,i=void 0)}}();var se=new n(0,0,0,0);return H}),i("Scene/ImageryLayerCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/Math","../Core/Rectangle","../ThirdParty/when","./ImageryLayer"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(){this._layers=[],this.layerAdded=new o,this.layerRemoved=new o,this.layerMoved=new o,this.layerShownOrHidden=new o}function h(e,t){var i=e.indexOf(t);return i}function d(e,t,i){var r=e._layers;if(t=a.clamp(t,0,r.length-1),i=a.clamp(i,0,r.length-1),t!==i){var n=r[t];r[t]=r[i],r[i]=n,e._update(),e.layerMoved.raiseEvent(n,i,t)}}i(c.prototype,{length:{get:function(){return this._layers.length}}}),c.prototype.add=function(e,i){var r=t(i);r?this._layers.splice(i,0,e):(i=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,i)},c.prototype.addImageryProvider=function(e,t){var i=new u(e);return this.add(i,t),i},c.prototype.remove=function(t,i){i=e(i,!0);var r=this._layers.indexOf(t);return-1!==r?(this._layers.splice(r,1),this._update(),this.layerRemoved.raiseEvent(t,r),i&&t.destroy(),!0):!1},c.prototype.removeAll=function(t){t=e(t,!0);for(var i=this._layers,r=0,n=i.length;n>r;r++){var o=i[r];this.layerRemoved.raiseEvent(o,r),t&&o.destroy()}this._layers=[]},c.prototype.contains=function(e){return-1!==this.indexOf(e)},c.prototype.indexOf=function(e){return this._layers.indexOf(e)},c.prototype.get=function(e){return this._layers[e]},c.prototype.raise=function(e){var t=h(this._layers,e);d(this,t,t+1)},c.prototype.lower=function(e){var t=h(this._layers,e);d(this,t,t-1)},c.prototype.raiseToTop=function(e){var t=h(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))},c.prototype.lowerToBottom=function(e){var t=h(this._layers,e);0!==t&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var p=new s;return c.prototype.pickImageryLayerFeatures=function(e,i){var r=i.globe.pick(e,i);if(t(r)){for(var n,o=i.globe.ellipsoid.cartesianToCartographic(r),u=i.globe._surface._tilesToRender,c=0;!t(n)&&c<u.length;++c){var h=u[c];s.contains(h.rectangle,o)&&(n=h)}if(t(n)){for(var d=n.data.imagery,m=[],f=[],v=d.length-1;v>=0;--v){var g=d[v],_=g.readyImagery;if(t(_)){var y=_.imageryLayer.imageryProvider;if(t(y.pickFeatures)&&s.contains(_.rectangle,o)){var C=p,E=1/1024;if(C.west=a.lerp(n.rectangle.west,n.rectangle.east,g.textureCoordinateRectangle.x-E),C.east=a.lerp(n.rectangle.west,n.rectangle.east,g.textureCoordinateRectangle.z+E),C.south=a.lerp(n.rectangle.south,n.rectangle.north,g.textureCoordinateRectangle.y-E),C.north=a.lerp(n.rectangle.south,n.rectangle.north,g.textureCoordinateRectangle.w+E),s.contains(C,o)){var S=y.pickFeatures(_.x,_.y,_.level,o.longitude,o.latitude);t(S)&&(m.push(S),f.push(_.imageryLayer))}}}}if(0!==m.length)return l.all(m,function(e){for(var i=[],r=0;r<e.length;++r){var n=e[r],a=f[r];if(t(n)&&n.length>0)for(var s=0;s<n.length;++s){var l=n[s];l.imageryLayer=a,t(l.position)||(l.position=o),i.push(l)}}return i})}}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this.removeAll(!0),r(this)},c.prototype._update=function(){for(var e,i,r=!0,n=this._layers,o=0,a=n.length;a>o;++o)i=n[o],i._layerIndex=o,i.show?(i._isBaseLayer=r,r=!1):i._isBaseLayer=!1,i.show!==i._show&&(t(i._show)&&(t(e)||(e=[]),e.push(i)),i._show=i.show);if(t(e))for(o=0,a=e.length;a>o;++o)i=e[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)},c}),i("Scene/QuadtreeOccluders",["../Core/Cartesian3","../Core/defineProperties","../Core/EllipsoidalOccluder"],function(e,t,i){"use strict";function r(t){this._ellipsoid=new i(t.ellipsoid,e.ZERO)}return t(r.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),r}),i("Scene/QuadtreeTile",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Rectangle","./QuadtreeTileLoadState"],function(e,t,i,r,n){"use strict";function o(e){this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._children=void 0,this._replacementPrevious=void 0,this._replacementNext=void 0,this._distance=0,this._customData=[],this._frameUpdated=void 0,this._frameRendered=void 0,this.state=n.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}return o.createLevelZeroTiles=function(t){if(!e(t))throw new i("tilingScheme is required.");for(var r=t.getNumberOfXTilesAtLevel(0),n=t.getNumberOfYTilesAtLevel(0),a=new Array(r*n),s=0,l=0;n>l;++l)for(var u=0;r>u;++u)a[s++]=new o({tilingScheme:t,x:u,y:l,level:0});return a},o.prototype._updateCustomData=function(t,i,n){var o,a,s,l=this.customData;if(e(i)&&e(n)){for(o=0;o<n.length;++o){a=n[o];for(var u=0;u<l.length;++u)if(l[u]===a){l.splice(u,1);break}}for(s=this._rectangle,o=0;o<i.length;++o)a=i[o],r.contains(s,a.positionCartographic)&&l.push(a);this._frameUpdated=t}else{var c=this._parent;if(e(c)&&this._frameUpdated!==c._frameUpdated){l.length=0,s=this._rectangle;var h=c.customData;for(o=0;o<h.length;++o)a=h[o],r.contains(s,a.positionCartographic)&&l.push(a);this._frameUpdated=c._frameUpdated}}},t(o.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){if(!e(this._children)){var t=this.tilingScheme,i=this.level+1,r=2*this.x,n=2*this.y;this._children=[new o({tilingScheme:t,x:r,y:n,level:i,parent:this}),new o({tilingScheme:t,x:r+1,y:n,level:i,parent:this}),new o({tilingScheme:t,x:r,y:n+1,level:i,parent:this}),new o({tilingScheme:t,x:r+1,y:n+1,level:i,parent:this})]}return this._children}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<n.DONE}},eligibleForUnloading:{get:function(){var t=!0;return e(this.data)&&(t=this.data.eligibleForUnloading,e(t)||(t=!0)),t}}}),o.prototype.freeResources=function(){if(this.state=n.START,this.renderable=!1,this.upsampledFromParent=!1,e(this.data)&&e(this.data.freeResources)&&(this.data.freeResources(),this.data=void 0),e(this._children)){for(var t=0,i=this._children.length;i>t;++t)this._children[t].freeResources();this._children=void 0}},o}),i("Scene/TileReplacementQueue",["../Core/defined"],function(e){"use strict";function t(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}function i(e,t){var i=t.replacementPrevious,r=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=r),t===e.head?e.head=r:i.replacementNext=r,t===e.tail?e.tail=i:r.replacementPrevious=i,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}return t.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head},t.prototype.trimTiles=function(t){for(var r=this.tail,n=!0;n&&e(this._lastBeforeStartOfFrame)&&this.count>t&&e(r);){n=r!==this._lastBeforeStartOfFrame;var o=r.replacementPrevious;r.eligibleForUnloading&&(r.freeResources(),i(this,r)),r=o}},t.prototype.markTileRendered=function(t){var r=this.head;return r===t?void(t===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=t.replacementNext)):(++this.count,e(r)?((e(t.replacementPrevious)||e(t.replacementNext))&&i(this,t),t.replacementPrevious=void 0,t.replacementNext=r,r.replacementPrevious=t,void(this.head=t)):(t.replacementPrevious=void 0,t.replacementNext=void 0,this.head=t,void(this.tail=t)))},t}),i("Scene/QuadtreePrimitive",["../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/getTimestamp","../Core/Math","../Core/Queue","../Core/Ray","../Core/Rectangle","../Core/Visibility","./QuadtreeOccluders","./QuadtreeTile","./QuadtreeTileLoadState","./SceneMode","./TileReplacementQueue"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g){"use strict";function _(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};var t=this._tileProvider.tilingScheme,r=t.ellipsoid;this._tilesToRender=[],this._tileTraversalQueue=new u,this._tileLoadQueue=[],this._tileReplacementQueue=new g,this._levelZeroTiles=void 0,this._levelZeroTilesReady=!1,this._loadQueueTimeSlice=5,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this.maximumScreenSpaceError=i(e.maximumScreenSpaceError,2),this.tileCacheSize=i(e.tileCacheSize,100),this._occluders=new p({ellipsoid:r}),this._tileLoadProgressEvent=new a,this._lastTileLoadQueueLength=0}function y(e,t){var i=e._debug;if(!i.suspendLodUpdate){var n,o,a=e._tilesToRender;a.length=0;var s=e._tileTraversalQueue;if(s.clear(),i.maxDepth=0,i.tilesVisited=0,i.tilesCulled=0,i.tilesRendered=0,i.tilesWaitingForChildren=0,e._tileLoadQueue.length=0,e._tileReplacementQueue.markStartOfRenderFrame(),!r(e._levelZeroTiles)){if(!e._tileProvider.ready)return;var l=e._tileProvider.tilingScheme;e._levelZeroTiles=m.createLevelZeroTiles(l)}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;var u,c=e._tileProvider,h=e._occluders,p=e._levelZeroTiles,f=e._addHeightCallbacks,v=e._removeHeightCallbacks,g=t.frameNumber;if(f.length>0||v.length>0){for(n=0,o=p.length;o>n;++n)u=p[n],u._updateCustomData(g,f,v);f.length=0,v.length=0}for(n=0,o=p.length;o>n;++n)u=p[n],e._tileReplacementQueue.markTileRendered(u),u.needsLoading&&x(e,u),u.renderable&&c.computeTileVisibility(u,t,h)!==d.NONE?s.enqueue(u):(++i.tilesCulled,u.renderable||++i.tilesWaitingForChildren);for(;r(u=s.dequeue());)if(++i.tilesVisited,e._tileReplacementQueue.markTileRendered(u),u._updateCustomData(g),u.level>i.maxDepth&&(i.maxDepth=u.level),E(e,t,u)<e.maximumScreenSpaceError)w(e,u);else if(T(e,u)){var _=u.children;for(n=0,o=_.length;o>n;++n)c.computeTileVisibility(_[n],t,h)!==d.NONE?s.enqueue(_[n]):++i.tilesCulled}else w(e,u);C(e),i.enableDebugOutput&&(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren)&&(console.log("Visited "+i.tilesVisited+", Rendered: "+i.tilesRendered+", Culled: "+i.tilesCulled+", Max Depth: "+i.maxDepth+", Waiting for children: "+i.tilesWaitingForChildren),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren)}}function C(e){var t=e._tileLoadQueue.length;t!==e._lastTileLoadQueueLength&&(e._tileLoadProgressEvent.raiseEvent(t),e._lastTileLoadQueueLength=t)}function E(e,t,i){if(t.mode===v.SCENE2D)return S(e,t,i);var r=e._tileProvider.getLevelMaximumGeometricError(i.level),n=i._distance,o=t.context.drawingBufferHeight,a=t.camera.frustum.sseDenominator,s=r*o/(n*a);return t.fog.enabled&&(s-=l.fog(n,t.fog.density)*t.fog.sse),s}function S(e,t,i){var r=t.camera,n=r.frustum,o=t.context,a=o.drawingBufferWidth,s=o.drawingBufferHeight,l=e._tileProvider.getLevelMaximumGeometricError(i.level),u=Math.max(n.top-n.bottom,n.right-n.left)/Math.max(a,s);return l/u}function w(e,t){e._tilesToRender.push(t),++e._debug.tilesRendered}function T(e,t){for(var i=!0,r=!0,n=t.children,o=0,a=n.length;a>o;++o){var s=n[o];e._tileReplacementQueue.markTileRendered(s),r=r&&s.upsampledFromParent,i=i&&s.renderable,s.needsLoading&&x(e,s)}return i||++e._debug.tilesWaitingForChildren,i&&!r}function x(e,t){e._tileLoadQueue.push(t)}function b(e,t){var i=e._tileLoadQueue,r=e._tileProvider;if(0!==i.length){e._tileReplacementQueue.trimTiles(e.tileCacheSize);for(var n=s(),o=e._loadQueueTimeSlice,a=n+o,l=i.length-1;l>=0;--l){var u=i[l];if(e._tileReplacementQueue.markTileRendered(u),r.loadTile(t,u),s()>=a)break}}}function A(i,n){for(var o=i._tileToUpdateHeights,a=i._tileProvider.terrainProvider,l=s(),u=i._updateHeightsTimeSlice,c=l+u,d=n.mode,p=n.mapProjection,m=p.ellipsoid;o.length>0;){var f=o[o.length-1];f!==i._lastTileUpdated&&(i._lastTileIndex=0);for(var g=f.customData,_=g.length,y=!1,C=i._lastTileIndex;_>C;++C){var E=g[C];if(f.level>E.level){r(E.position)||(E.position=m.cartographicToCartesian(E.positionCartographic)),d===v.SCENE3D?(e.clone(e.ZERO,M.origin),e.normalize(E.position,M.direction)):(t.clone(E.positionCartographic,D),D.height=-11500,p.project(D,R),e.fromElements(R.z,R.x,R.y,R),e.clone(R,M.origin),e.clone(e.UNIT_X,M.direction));var S=f.data.pick(M,d,p,!1,R);r(S)&&E.callback(S),E.level=f.level}else if(f.level===E.level){for(var w,T=f.children,x=T.length,b=0;x>b&&(w=T[b],!h.contains(w.rectangle,E.positionCartographic));++b);var A=a.getTileDataAvailable(w.x,w.y,w.level);(r(A)&&!A||r(parent)&&r(parent.data)&&r(parent.data.terrainData)&&!parent.data.terrainData.isChildAvailable(parent.x,parent.y,w.x,w.y))&&E.removeFunc()}if(s()>=c){y=!0;break}}if(y){i._lastTileUpdated=f,i._lastTileIndex=C;break}o.pop()}}function P(e,t){return e._distance-t._distance}function I(e,t){var i=e._tileProvider,r=e._tilesToRender,n=e._tileToUpdateHeights;r.sort(P);for(var o=0,a=r.length;a>o;++o){var s=r[o];i.showTileThisFrame(s,t),s._frameRendered!==t.frameNumber-1&&n.push(s),s._frameRendered=t.frameNumber}A(e,t)}n(_.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}}}),_.prototype.invalidateAllTiles=function(){var e=this._tileReplacementQueue;e.head=void 0,e.tail=void 0,e.count=0;var t=this._levelZeroTiles;if(r(t))for(var i=0;i<t.length;++i){for(var n=t[i],o=n.customData,a=o.length,s=0;a>s;++s){var l=o[s];l.level=0,this._addHeightCallbacks.push(l)}t[i].freeResources()}this._levelZeroTiles=void 0},_.prototype.forEachLoadedTile=function(e){for(var t=this._tileReplacementQueue.head;r(t);)t.state!==f.START&&e(t),t=t.replacementNext},_.prototype.forEachRenderedTile=function(e){for(var t=this._tilesToRender,i=0,r=t.length;r>i;++i)e(t[i])},_.prototype.updateHeight=function(e,t){var i=this,r={position:void 0,positionCartographic:e,level:-1,callback:t};return r.removeFunc=function(){i._removeHeightCallbacks.push(r)},i._addHeightCallbacks.push(r),r.removeFunc},_.prototype.update=function(e){var t=e.passes;t.render&&(this._tileProvider.beginUpdate(e),y(this,e),b(this,e),I(this,e),this._tileProvider.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&this._tileProvider.updateForPick(e)},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var M=new c,D=new t,R=new e;return _}),i("Scene/Globe",["../Core/BoundingSphere","../Core/buildModuleUrl","../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/EllipsoidTerrainProvider","../Core/GeographicProjection","../Core/IntersectionTests","../Core/loadImage","../Core/Ray","../Core/Rectangle","../Renderer/ShaderSource","../Renderer/Texture","../Shaders/GlobeFS","../Shaders/GlobeVS","../Shaders/GroundAtmosphere","../ThirdParty/when","./GlobeSurfaceShaderSet","./GlobeSurfaceTileProvider","./ImageryLayerCollection","./QuadtreePrimitive","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x,b){"use strict";function A(e){e=n(e,u.WGS84);var i=new c({ellipsoid:e}),r=new T;this._ellipsoid=e,this._imageryLayerCollection=r,this._surfaceShaderSet=new S,this._surfaceShaderSet.baseVertexShaderSource=new v({sources:[C,y]}),this._surfaceShaderSet.baseFragmentShaderSource=new v({sources:[_]}),this._surface=new x({tileProvider:new w({terrainProvider:i,imageryLayers:r,surfaceShaderSet:this._surfaceShaderSet})}),this.terrainProvider=i,this.show=!0,this.oceanNormalMapUrl=t("Assets/Textures/waterNormalsSmall.jpg"),this._oceanNormalMapUrl=void 0,this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.enableLighting=!1,this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=.5}function P(t){return function(i,r){var n=e.distanceSquaredTo(i.pickBoundingSphere,t),o=e.distanceSquaredTo(r.pickBoundingSphere,t);return n-o}}a(A.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}}});var I=[],M={start:0,stop:0};A.prototype.pick=function(t,r,n){var a=r.mode,s=r.mapProjection,l=I;l.length=0;var u,c,h=this._surface._tilesToRender,p=h.length;for(c=0;p>c;++c){u=h[c];var m=u.data;if(o(m)){var f=m.pickBoundingSphere;a!==b.SCENE3D?(e.fromRectangleWithHeights2D(u.rectangle,s,m.minimumHeight,m.maximumHeight,f),i.fromElements(f.center.z,f.center.x,f.center.y,f.center)):e.clone(m.boundingSphere3D,f);var v=d.raySphere(t,f,M);o(v)&&l.push(m)}}l.sort(P(t.origin));var g;for(p=l.length,c=0;p>c&&(g=l[c].pick(t,r.mode,r.mapProjection,!0,n),!o(g));++c);return g};var D=new i,R=new i,O=new r,N=new m;return A.prototype.getHeight=function(e){var t=this._surface._levelZeroTiles;if(o(t)){var r,n,a=t.length;for(n=0;a>n&&(r=t[n],!f.contains(r.rectangle,e));++n);if(o(r)&&f.contains(r.rectangle,e)){for(;r.renderable;){var s=r.children;for(a=s.length,n=0;a>n&&(r=s[n],!f.contains(r.rectangle,e));++n);}for(;o(r)&&(!o(r.data)||!o(r.data.pickTerrain));)r=r.parent;if(o(r)){var l=this._surface._tileProvider.tilingScheme.ellipsoid,u=l.cartographicToCartesian(e,D),c=N;i.normalize(u,c.direction);var h=r.data.pick(c,void 0,void 0,!1,R);if(o(h))return l.cartesianToCartographic(h,O).height}}}},A.prototype.update=function(e){if(this.show){var t=e.context,i=t.drawingBufferWidth,r=t.drawingBufferHeight;if(0!==i&&0!==r){var n=this._surface,a=n.tileProvider,s=this.terrainProvider,l=this.showWaterEffect&&s.ready&&s.hasWaterMask;if(l&&this.oceanNormalMapUrl!==this._oceanNormalMapUrl){var u=this.oceanNormalMapUrl;if(this._oceanNormalMapUrl=u,o(u)){var c=this;E(p(u),function(e){u===c.oceanNormalMapUrl&&(c._oceanNormalMap=c._oceanNormalMap&&c._oceanNormalMap.destroy(),c._oceanNormalMap=new g({context:t,source:e}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}var h=e.mode,d=e.passes;d.render&&(h===b.SCENE3D?this._zoomedOutOceanSpecularIntensity=.5:this._zoomedOutOceanSpecularIntensity=0,n.maximumScreenSpaceError=this.maximumScreenSpaceError,n.tileCacheSize=this.tileCacheSize,a.terrainProvider=this.terrainProvider,a.lightingFadeOutDistance=this.lightingFadeOutDistance,a.lightingFadeInDistance=this.lightingFadeInDistance,a.zoomedOutOceanSpecularIntensity=this._zoomedOutOceanSpecularIntensity,a.hasWaterMask=l,a.oceanNormalMap=this._oceanNormalMap,a.enableLighting=this.enableLighting,n.update(e)),d.pick&&n.update(e)}}},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),s(this)},A}),i("Shaders/PostProcessFilters/PassThrough",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),i("Scene/GlobeDepth",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/PassThrough"],function(e,t,i,r,n,o,a,s,l,u,c,h){ -"use strict";function d(){this._colorTexture=void 0,this._depthStencilTexture=void 0,this._globeDepthTexture=void 0,this.framebuffer=void 0,this._copyDepthFramebuffer=void 0,this._clearColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._viewport=new e,this._rs=void 0,this._debugGlobeDepthViewportCommand=void 0}function p(e,t,r){if(!i(e._debugGlobeDepthViewportCommand)){var n="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n float z_window = czm_unpackDepth(texture2D(u_texture, v_textureCoordinates));\n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n float scale = pow(z_ndc * 0.5 + 0.5, 8.0);\n gl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n}\n";e._debugGlobeDepthViewportCommand=t.createViewportQuadCommand(n,{uniformMap:{u_texture:function(){return e._globeDepthTexture}},owner:e})}e._debugGlobeDepthViewportCommand.execute(t,r)}function m(e){e._colorTexture=e._colorTexture&&!e._colorTexture.isDestroyed()&&e._colorTexture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&!e._depthStencilTexture.isDestroyed()&&e._depthStencilTexture.destroy(),e._globeDepthTexture=e._globeDepthTexture&&!e._globeDepthTexture.isDestroyed()&&e._globeDepthTexture.destroy()}function f(e){e.framebuffer=e.framebuffer&&!e.framebuffer.isDestroyed()&&e.framebuffer.destroy(),e._copyDepthFramebuffer=e._copyDepthFramebuffer&&!e._copyDepthFramebuffer.isDestroyed()&&e._copyDepthFramebuffer.destroy()}function v(e,t,i,r){e._colorTexture=new c({context:t,width:i,height:r,pixelFormat:o.RGBA,pixelDatatype:l.UNSIGNED_BYTE}),e._depthStencilTexture=new c({context:t,width:i,height:r,pixelFormat:o.DEPTH_STENCIL,pixelDatatype:l.UNSIGNED_INT_24_8}),e._globeDepthTexture=new c({context:t,width:i,height:r,pixelFormat:o.RGBA,pixelDatatype:l.UNSIGNED_BYTE})}function g(e,t,i,r){m(e),f(e),v(e,t,i,r),e.framebuffer=new s({context:t,colorTextures:[e._colorTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._copyDepthFramebuffer=new s({context:t,colorTextures:[e._globeDepthTexture],destroyAttachments:!1})}function _(e,t,r,n){var o=e._colorTexture,a=!i(o)||o.width!==r||o.height!==n;(!i(e.framebuffer)||a)&&g(e,t,r,n)}function y(r,n,o,s){if(r._viewport.width=o,r._viewport.height=s,i(r._rs)&&e.equals(r._viewport,r._rs.viewport)||(r._rs=u.fromCache({viewport:r._viewport})),!i(r._copyDepthCommand)){var l="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n";r._copyDepthCommand=n.createViewportQuadCommand(l,{uniformMap:{u_texture:function(){return r._depthStencilTexture}},owner:r})}r._copyDepthCommand.framebuffer=r._copyDepthFramebuffer,i(r._copyColorCommand)||(r._copyColorCommand=n.createViewportQuadCommand(h,{uniformMap:{u_texture:function(){return r._colorTexture}},owner:r})),r._copyDepthCommand.renderState=r._rs,r._copyColorCommand.renderState=r._rs,i(r._clearColorCommand)||(r._clearColorCommand=new a({color:new t(0,0,0,0),stencil:0,owner:r})),r._clearColorCommand.framebuffer=r.framebuffer}return d.prototype.executeDebugGlobeDepth=function(e,t){p(this,e,t)},d.prototype.update=function(e){var t=e.drawingBufferWidth,i=e.drawingBufferHeight;_(this,e,t,i),y(this,e,t,i),e.uniformState.globeDepthTexture=void 0},d.prototype.executeCopyDepth=function(e,t){i(this._copyDepthCommand)&&(this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._globeDepthTexture)},d.prototype.executeCopyColor=function(e,t){i(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)},d.prototype.clear=function(e,r,n){var o=this._clearColorCommand;i(o)&&(t.clone(n,o.color),o.execute(e,r))},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){m(this),f(this),i(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),i(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy());var e=this._debugGlobeDepthViewportCommand;return i(e)&&(e.shaderProgram=e.shaderProgram.destroy()),n(this)},d}),i("Scene/GoogleEarthImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadText","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(r){function n(e){var t;try{t=JSON.parse(e)}catch(n){t=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}for(var o,s=0;s<t.layers.length;s++)if(t.layers[s].id===_._channel){o=t.layers[s];break}var d;if(!i(o))throw d="Could not find layer with channel (id) of "+_._channel+".",v=c.handleError(v,_,_._errorEvent,d,void 0,void 0,void 0,f),new u(d);if(!i(o.version))throw d="Could not find a version in channel (id) "+_._channel+".",v=c.handleError(v,_,_._errorEvent,d,void 0,void 0,void 0,f),new u(d);if(_._version=o.version,i(t.projection)&&"flat"===t.projection)_._tilingScheme=new a({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new l(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:r.ellipsoid});else{if(i(t.projection)&&"mercator"!==t.projection)throw d="Unsupported projection "+t.projection+".",v=c.handleError(v,_,_._errorEvent,d,void 0,void 0,void 0,f),new u(d);_._tilingScheme=new h({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:r.ellipsoid})}_._imageUrlTemplate=_._imageUrlTemplate.replace("{request}",_._requestType).replace("{channel}",_._channel).replace("{version}",_._version),_._ready=!0,_._readyPromise.resolve(!0),c.handleSuccess(v)}function p(e){var t="An error occurred while accessing "+g+".";v=c.handleError(v,_,_._errorEvent,t,void 0,void 0,void 0,f),_._readyPromise.reject(new u(t))}function f(){var e=i(_._proxy)?_._proxy.getURL(g):g,t=s(e);d(t,n,p)}r=t(r,{}),this._url=r.url,this._path=t(r.path,"/default_map"),this._tileDiscardPolicy=r.tileDiscardPolicy,this._proxy=r.proxy,this._channel=r.channel,this._requestType="ImageryMaps",this._credit=new e("Google Imagery",m._logoData,"http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"),this.defaultGamma=1.9,this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=r.maximumLevel,this._imageUrlTemplate=this._url+this._path+"/query?request={request}&channel={channel}&version={version}&x={x}&y={y}&z={zoom}",this._errorEvent=new o,this._ready=!1,this._readyPromise=d.defer();var v,g=this._url+this._path+"/query?request=Json&vars=geeServerDefs&is2d=t",_=this;f()}function f(e,t,r,n){var o=e._imageUrlTemplate;o=o.replace("{x}",t),o=o.replace("{y}",r),o=o.replace("{zoom}",n+1);var a=e._proxy;return i(a)&&(o=a.getURL(o)),o}return r(m.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),m.prototype.getTileCredits=function(e,t,i){},m.prototype.requestImage=function(e,t,i){var r=f(this,e,t,i);return p.loadImage(this,r)},m.prototype.pickFeatures=function(){},m._logoData="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAAnCAYAAACmP2LfAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAHdElNRQfcDB4TJDr1mp5kAAAAGnRFWHRTb2Z0d2FyZQBQYWludC5ORVQgdjMuNS4xMDD0cqEAAB1zSURBVHhe7ZwHeFTFFsf/u+l9N70npOxuSAKEFFIhCSH0qhEQUHkgKCgWUFGBB6IoCAoo0ntooaRvEkIIBBBpoYSa3nvvfd+5u4sQUigPfMX8v2/Y3Tkzs3fv/d0z58zcgF69Ql1SY+MM1wQJem44ZeiJk8beEOqPwG6uC7ZqyElb9eo/JZEIkH2nRQkBIlNMauuPCS3uGN/kjkmNDghoskBAgzrZ2NLmf1+JwIKQpYsoxdmIV9+N07onCegzBPM9bOdmYKnazF6g/1N6UySPqSJzvCaaiLHtP8G/Phq+FRfgU5ogKWUXMLT6Mvzqr2BE40mMadqO8c3zMabBC6PqDDC8SlY60t9HByCLVTKu+ERmHr5TWI9wjVxEaOZivWo1pil8D1tZeWnLXv1l8iZ3PF2kjymiWRgvCoJv5U243IyAXcQq8A9Mg9W+4bDe6wv+kVGwCZkL+4Sf4ZR+BZ5VGQR3EkbWn8Hopm3wq54Lz2JD6ah/P21XGopQ9Qoc16jGSqVyTJWbQbUsibFXf42mihTwZpsvAtp3k0dOhFOSEH1+ngaDefrgjFCgFkxY8fCisCBvKgODzxRh9qslBFGfYmDGLbiV5mBwRRo8KtPhVBgPu8teMP7u73chD6kMRYRGBY5xqrFKqQwz5SdTbS/Qf5mmUYw8rf01CjHC4VP7AHZxO6E3qy9ZZCQNnio2rE/4o9/tkxiQUYp+KRXgx8XC5FsXcLz/hkCrDUU4pxLHuDVYpdwL9F+qqSJZKlPwenskfOoI5tN7YPCJGVme7wKYr5EBXzgYfW+mwTI0Gjrznaj2WW+I/y8dVPdDGLcKRzXrsEqlHO8oTKHaXqAZWe9hQXCi63NhHWYI3ilfWIW/YLjqL2JRiOFBJRz+LffhcPs09D+0J8vzn3zXdBnYnp8Mi6NboTWzH9X8fVc+DhDQodxqAroe36lU9AJNWr4cEAjNwI8OAC9cT1rbUfzwGeCfKiL7dGnNc+q1NiO80b4BY1oT4V6WDcsdc6j2xbyq4wMWrA9rQmeWFn36ey/jBaoPQ4hmLYI0G/AtAf22fC/QDols8ITrIYi/Bl6knbS2o3gRbxHQxQQ0k0S/gCa2v4OJovPwacqAQ1ICjL40klr+UrWoQbFBETo18jCpZsOoFODkvuCNJYoHW3QKXFEM7ETRcKfiQe8d6NVIFImXvg4skhY40mxnQYVRIIeA1qrHEc1GrFSpxFtP99AiFbDbNKDZpAzzGkVYVcvBuBJQEo/9/6C+dyjPitwLwak74D8V6Bfw0P5VShjXFoTR7TfhUZkL29M/wfATJan1lauWC3aDOgyaVDCuTgbf1bFkfmtkye1ogsK2asivLYfCglIoD8qCknI2NHuG4QSVGMgQyMbt0fioRYh9VYcRU7QX55uDcaHtFOJEsThMtmWtQgxsDodsWaC0c3ea3MzGBJEqxrfbYmzr6xjfPAeTmt5HQPO7eK1xDibUz8eY+k8xtHYJPCtXwvHOu7AXMrMTsF/TH8HajTis1YwVqpWY0TXQDKy1OpBr5EJA52Fukxx+bmKxtjWx2DuaWawNlZD5qhzyo9KhpHAbKpJO/6t65UCPbPHA2PYrGNacgkElabCJJDev/MpDhUKKnuq44LRoYEK1IiswkS1zYCfk5y+F0qjvoTwqBOof34dGeAnUL1ZCLboEnJ9zoe0QD/Nuj00UBVXRabzVLETM3S0ICfwA8yc7Y6C3ANYbZsA7aQ1W1xzEfZEQ6dT2BkG9pP4ouo7jGE1u42JS20QMrzkCr4xwuN4+AM+cYII3EaNar2J86zmMrP8DHulCON4NhU3YWuhOYy6SZENpH9cfx7WacFC7BSvUqjBDsRPQIiugURvazeqYVaqAw6dYrJ9WQy7gayj4nYDy3HtQOVQGpYRqKEWXQf2HdGha/AFdae9Xr4czz0ubISRA75ECbSut7agegO75OLxpahze8j5GtifBpzEDLiV30Dd2mNT6StWiCbVmLt5rUkBQCEt2zWzIMSA8HgrIBkLD+Sp0jhHISYXQ/KMYukfvQ3fQxq68XCTBHId/tMTg7LV1CFs4BszJ6hBarBgHlcRv8H7tbuSKQpFPYGe0BmND+nZ0npECaPKf0r4UIxsuoF/IMpitsAVnrA4s15uh3x8fwLXkLobUZGJIXTqcUzbDaJE5FAVq0t4S7dEcjqMEc6B2K5arVWN6Z6AbdOmm5mJelQKOHWSxF44Cy4CqxW0s6RwchCovFRohdGNfLgX3WiZ0N4aD++y7jfwYJUrAPCle/ZjKV+BFTSegrGAZIm3QjXhBytTWB3zhByzryMUU986jz16wD+96ijCNUIAgmkc3tS6G7GERjCbgR82B4OTbEESqIiCIcqsIYzoGGyrBEMSmgh8xBoIIAR2fAHZhj8Z9DOhl9FHeKkSDvn809fuc+iyCddRYaiOZBTvIt1YJfs0b4N+WDO+GHPLQN2Ab7S61vjJV60C9SRPvNSqzTpxlyQfS1dGUmjppK7gW16B/LhN6abnQu5cDwzO3YNhhqqK4WJY887sEdGzWFpxfOxmDpKZOOvgWFB8sx9L6nShvP4FyUQjKGg5gScpGKEqbUE7RxiGYv6QQ4zIG/r4D2m88sjEy/EIW/a6+TQ4gHe5VhXCvy4JL7gLYnesI2i6t4Tii04r92u1YKt767gB0ozrkGzmY26zEOh7Hkt+kAKhLTX9qOVVdg9aoNOjcToR+wUVKLYKgN0Zq7l7884wn9CKgr4AfWw/B6SwqKQRKOdXVghe9CpbherASSjtIpGpxRIHFjwygNreoXy0lb+lU7lHJBP9kPcGXQnBNghUB/Lh44fbUp5JA+5Hs71LbPPLCVRDEJZDNGIJgeQI6mG6KegKzldq1U7tGKjQmHR8vwl86kgRoAQN0xBw6ztn0nQ/ocxEdQ7L4d/BjG6g+m8aZTL/xsXPuW82Fb8t+DG1Ox5D6XAwqvQ67OA+p9ZWoUQPsei78mjSwNU9GLmEzVGZJTd3qFPTn3YZhXgYMMjNhlHsDxms/hNWfoUdrNPgEc2h7BG5d/Bo7Blt0BuNxXf4MVmXrkdRyEHWiY6hr2oc7mevRX2wc18gioEeI1+N9a+/CNnImVAZ0mhEoNOPAJT8MHjUF8KTiWhqHgbfMpVaJdhLQh3XasU9bJAZ6ekeg6zQwgEKuLSWysmd3QGmatLqD8qDNug3dCX/AIPk4jGr2wDB/JXTmkan70IvmZTY/rB9BdZlKLkG0lG0d5klAObKsw1+jzyFiWPnRawiaDrMYwTyMwMwh220WP2IWFVfqN4CKO8E3n0C6R/ZUej9Y2kUiMdDRFTRePH3nA3q/m7xpAEtAXl0QrkTwscnmS/3eptdzNEYevZLnZ5booqk8tuYs9tAny+n1LL1mghezlcULH0VtHamOZhvhIvoNOXQsd2EZIbluYnlWaMO75TCFG9kYXJ8H14o76H/10Z3yClSrCm6jGtbWK7LC7kIlYRfUmY2XHnUa+mbXYRSfCuNCptyE6b1jMBD/EPKwchQPLxGdxOWWI8iKXYBPqLozgI8pfA5YBWvxbfMeNLUfRmPTLjRnr8YKsdGvRQ5j2zZTSSRQ78H+7GhxfScFAINypsG9ukDspZ0LKKE+O0pqlGi71ggcIqD3dga6RhFKjSqYT+VEFkvu/E9Q+HNWKaE2VVDgVkPFqwAaay5CN3En9M59BM2vfKDs7AvljjPGE5LlharQdL+LoCmhOHU0rIUyD+NgVTOa+q2iVQiIcAKpHtbhXuJOjPqeVCRYThNE6VTvKNs3hM3cHGIxntxKyCbP7Erj1lHZJbVIJAG6iiCroZCAPGukvOyASJbvCgoaAoKoAQ1kHcGC7nmZDkmhBR2PfSQLtkcl4zCSAE2eO6qExYuYxrE4KqdvelBiM4+ncYQy1IY8d0wbhUSLJAZGbsUceNYdwJCGPAyuy4NbZToG3JoO1Qk9AvHvqF4ejo0KCKlisyl04Jw+AE1ma71HRUJP+QqM1t2HcVEyTEoSYVYQCuN3HenCt4XDhGA+KorAnYZ9KIj5ELOl3XpU/k/wrt+OmraDaG7cjpacbxFvYAAZDG5Vw/DWCxjRdp+ATsWAS6+D69H1+XDNsoVb1T06b0VwzCmBIOYdqUWibTojcFBH1CXQctBtUcA6Oh/RmVC4sBmKA5j6erC1qqE4sRpqG25A43QIOHuXgvOmP5R4ZH6m5UY2L9SSLjZ5sKjjsI/o8olH8ngjCZoSgmw9DMIl3t42Up0g+pq89/sEjLK47knZhSkSuDepJP4JOyNJyEFAR8VQKMOR1nbWM69yxNJYwh+VLE90ffPyxLE3EwL9Jq0huWQqwL1iA7zq8+FVl0+epgBO6T+gb2TH+OglqgastxtZrNNlkLt8E5oJx6HZdab7mFZBk3UZRjMewCT7HkzLfodZxREYr5sBjiIBPYiAPt8ehvSGPSg5vwjzpd16VNkmmDTswp22QDTXbkJrxhJkzHGDFoUQmvBpvo2hrZl0TnLhlLIYfUO7nt7dSg3hURcP1/JiDEgphuXBqVKLRFsfA3oJAf3mI6Cr2OjTwGYdqWGzzmZD6WoYVCfehdqsZKjuuwS1oB1Q+5piHac3oaxBzZ9vLZ4nHEeesoXg6niDPSYWP9yUgD5PHu48eKE64krHcErchHIEuRysTpAXjObQWIYEHiV4EQYEojp5aEoyY+IIpOQugKYYOnIdJXrdJ63PtWwXMQM6m6SVT4gfZkbHV0XHsVtaQ3K8yoJr0YfwoHDDq5ZiQSqDik/B4Q9taYtn18gyNia1qGJsmTrGlUjK2FJ1jCjRwOASDnkxDvN95ZD/og5yl0qgfCMJ2leDoeksHaFHXYOJVyrMkm/DrPwMzGr2wmjnLGipthyHL0W7t9pDkduwF2U3lmGFtvbTdyirt0OreT+iWwPRUrUBbSkLkT/fCUZwKVYikBMwpDlPXNzLwuAQ2rWX8KzUh2dDDJyLSmB7/S5Mf3WRWiR6CPSezkCXQs6qBnLCKsheyoXqnTCoL9oOFd9/Qtl9KJT6UJMX3/zhCz8iuCjhiviSYtMx3ZTJBN8lCE7eIRgF0p6krRRaRBDskTTGySBKws5SuUjJHYUiMQdpzCUE0Q3y5MnSDhJJQg5JUvjSgO5hHZofaioGmvc40IycMgbRtJktjgOZ5Ma9irzSg46xYHcaVEZevkgBHqUWGFK+FENKQ+BdGAq/wiMYWbwHI6h4FwTDOes0BMKFMHxPNg9qn1dANakYanfuQSs5FJoTpaP1qBswsSGgb9+EeUU0Af0LDH4dBhXlmv3wajuOpPYQFDcEojxtNQ6sn9ZzUsiofjfUWg/iYOt+tJatRtvN95DqZgxNuKTKwLV4Jdyqc8Wz1uCGTLjmDIVDQqewQ8anwpJi6GsYkF4Ey2O/QvsfXKlJIgboAwT07s5AZ0G1TylUIsuhdKMI6vcuQ3PVAqg+9UZ8JvGEywiuNoIwD4IzaV2X+HSa1otgE3+NwJImVkycG0kx8snfyUZJW+QFApeSu+hN9BpIn6n+ZBp9bqDv+C8Fum+8IpzzJNOmR3UhTaGFcC07iAHXmamuZw28C/S/aIt+CcthF7+ToN0EQdhqOFzcBu/Sm/ApvAGX3DzYXIiF9jtWTJf74L6ZC83UfGg8SId2xnloSZKxp+gWjC0J6KSrMK8KhmnlSugtInpkCzaBV78Hl5oPoaLpECrLt+Bi4jfgS7t1q+YDUGsPwj5KDFsLlqD97JuIpmpZmP+TftM1ezjlxsOllM4H3eReDWHwKrOBW84jqMeK5OBTv4Bu6HxxgqU1s/N3MkAHSoH+ioCe+gjoJHB0s8ENLID6/UJo3E+GVlwoNEwY278tXhR50RhmeexzgmM8JXjdF36MHwEoiXn70Csv6gxBm8PiRc6gJFD1HDzFpq1cP0omo5QJZAfqQzH0f6uHZjQgeR4cC/IJZCnUtSkYVPAWBiX2/CdU/S7Ql+9TgtFCTaiP0qAEXA2yRsqwuzECziWZcM4tgv2DSljF7ID+l+JNh9+hY38HuvcYmLOhk5EEnVPfQOmpW+33YGaXhj53E2BWuxvGebOh5cPUX/sWSgXrsa9mB2qaDqCK4C7I2IA3jn8u7tat2g6D034MIbWb0fZgHlr2DscXUhNNuYdkYRPrg/7JiXDMLYBrZS6GNEZgVJM/JjWY4I16G4xr/BCDq2nKjjoAvY+Zpwo7eXBskQK9Swr0lEdAn4a2wk3o/DMNWmn54KYUQIuZsebGQuXFQ42H4kfNk4QckSOkNZ1lGkGAUoInOKkAm2jJsVtH+om9Nj9ytZxNcNdhljXByo+JJXj/i4G2u2xM02YInPJLxFB7VudTPH0ZHkWu0hbPpwHpfnAszoFDVgVsb1fDMmoL9L8S7wTFQE/1AvR33oB+QSp0czKgl34B2iO9uwJCKib5SGaZjbqLPlkhMG1YDr1gQyioSs24vQTDitagsnIL6loCUVu9C2EJK9FjYtsWBNP2Q7hb9A155zdwY5mTeGexo0w32hEcy2F7JQaOqZfgk38KY6rDMKFBiGHNt+iGPgCNYd0/s/sbAb2fgN5JQC9Wq8bkR0AzioOOx3Xo30mGbnY+tNMKoJOQCm03qfnFxRf6E1yUFAqZJcyuZRWuQmB+TWHJcgJfkjPxImcSSIUsXviMx/O9DvqfALrPDjb6nhuBAWkZ5JFKKTYuIqhz4FUdAo9CGwzO7Ra2LjUg0w9OxdlwyKxAXzHQm8lDi4HeAT1WMPSHnYXR7aswKE6Gfl4K9PdfgZ6+uG8XSmMbKyXD/LsEmFduglH2NHA7rA3Hvg+Ve1/gYO4KNFRvQUPLQVRU7MG4yn1dJ4eiULAo3JhW9xsa77+Hml8GY8FQ425uAM5wRRivNoPlTjs4XhoH35oLGFZ/S/wglyDkbWmrrsUAvY+A3kHlSwJ6ihKzCvLnuQyElmIs9LdfhmHxA+jn5kI3jcrRFOjxU6DTbTx9DybsOBh0f034EeYEVyaFD0IYhnQ9y1pTIsiPvU5AnKYkUBL78yKmQhDLgDRPSWtPp/HFkFtHqFCfRBr73wX67qsD+qFsEubCnqKBAZllcCkkT12RjSHVMfApH0bJXfcH+aQGZg6FU1EWeeoK2NwgoMM3Q++zP/fq/Smf2g392ZEwzk2Acfl9GBHURmuSYPyn132oHBizH8B8wjX0SadQI2cWtOZZQbHTdEgRn8XN93EiczFayn5GU3Mg7lJMPab5SEeoCWZZ0TF4Ne/A/ZSPUbXdDz9Qdddrrk/KtcwR7jX34VXDzGCFGFT0GzyLu922x069kdiv145tOu34jlOHBWoz4arUAZQt0LYOhmFcHJ2H6zAsYnZDc2FwKhv60+m9UQrLUJ4hSYQAVhpM1O6jj30EDD33Q6frZyoY8cMVaWZZR560kuB5V9H6iVUas+Py5L1/IHsT2ZldR4nEkMdkUd8Y8tYd43mLIMhYhenDWvgjQSQiGFOkiEv0rEAzK2u8yG10M2WwBWFdb6q9NKDNd6rCOuYD9L2VI/57QMfcEniU5cCnJgG+lR9haAnz4MzT5ZjmA4e8HBqnGtYXamF+nK7bpx0uwHxoqGyE3sKD5HHjYVJ1C6Z5qTD5Ph2G1hnQEV/0LBhxU2E+4yYsbgTCJGsuNBfYQrnjA0CPxDo2CRYJ0xGesgD1ZWvQ3LQbKeSJ54uC0UcUDVVRGExFR/FB2y7cSf4C+Zv9sXSUeQ9P2z2pQdnmBHQsPKqKqFCyWJsM75o1GMw8O/iEhFZs/KK9CD9wRfhCTYTP1dqwnBOHrQYz8IuuH5ZxxI/MLQZH5kfoeu6D4cVQGNecgXHFbRgXZsD4Xg5MjqfDeE0KTBbRDLXsLiwOR8HkxCJoOs+Eavdr08ZBBGdYP7rYzAZILsH3LYUYtgSsAXlYRwLqW0r8Ksl2id4/Onaz47IE+kayUfwddYhsgwkqXRrLgOpHEuyhVF9B7ytoTAL//qNjeFagGfGEi5nvYPEifqOx/ek4p1J/8aKBWC8N6Icy2+oL6zOhECTmw46SuoHZpXBn/pK7/DK8K1bCp3Q0vAv7wqfIBD55OuS9teFVYASPfAFccseThw+E4Ho5LOMqYB6ZCeOdK6H1bleJH2sOOPZradqlC3otDqY5F2GafQmmCZdgFnMBZteEML2yCnprh0CZWVp66gbDuD5Q2uSLUacm43jSB0gq+h55JeuRX7wRqUUbkJL8DS4GTcPqCdZgduZ6XiZjgvcp9fIY3aAH/yY+3KvcMDBjLSXQBXDML4VbaQG8a9PgUxcOzyIneKY/Or6FHDO8q7INY+RiMFJaJijE4i2VeEylej/FDs99TAPH8Dvofv8bDK/vhVHxMRhX0W+vOgXTijiY5UXANGkNnYeRUGN2VrsPNx6XVaQNgRNM03sBgUjeOKJJ/Cr+LNzFsg61YB5/elyKtic0qM031CaZAG0gqJnVEuYBIoI49gy9D6DXrQR3GoU2j3YE+WE2FI9TGBG1FLywnhNbPt1Y/OhY+o5iGqsGNmdLaVxfqZUB+g0Iztwi2AOkNZ3FCzOm30bHeHK9tKYHKfPZMFhlAtM9c2EpjALv93zY3qlE/8xyOOUVUTiSBrfy83CvDIdbRZC4uJSGwzHzd0qgkmEVfRnGW/dC79vPobtkFLRmm0HDpVt43MnrzoOm/dfQeeOf0P3wB+guJogXrIDuhHfAsdOFbKdQ5GkaYQbNNYNht2c8/AOnYNKB6Ri//Q14zRwIuohdPC76pCbWKGFCkx9GNC7B0NZD8CiJh8Odi7A59zud7EuwvU4hVUYZBhUXwqsqA56V0RiUM1Dam36UoiyFuprQhc6fRZuKKhV5+rcLKD2hrPQ+NPsvgNb0j6C9eCG0v/kU2l9/BK0ZM8EdRJQ833noG8Qib6lDkA0lYD6i8GIJlffZ/IhhbJtQjW4TP164EiWWztTnH9T+a4L/MxpjAn02hWWYDAQnefSZzm7Io7zDOpiSzGh3grwPwd3zDccPZdH4phBEkXcWBrD4wlE07qObw5pmBUGsK43T/YPfgmAFWEe5U2EeCXhGcV5nQ3u2KrTf6w+jdTNhtud7mB/ZC4vg43QAwbAMDYLF0e3os+8HGP80D7oLx0F9dD+oj9AGZ4Y85K0Yj/Vs3kQiFgeybFPIySiDzdwAz9O3JzHjPNtYk8gjv948FOOatlGodR0Dk07Bau9n0F8wFBp+luBO1CXeuDD51Q3830PRP7UIzgUlcC0vhHPRSdic6eI53ecT3W0sKyjI2EFRxhzyz3sOO8voBkEUTclYhAyshCwr642PR79diwlbBOEs8vLMFjgbbuelhpeoz5rEDxsNNl/+9ON5RWJOLsXCysQdh5IhWWbzhUmoel6v/l/RxGpZTKgbh3EtEZQMp5AX2ASd2f3AVu7695ky/7nOuc2U/BZSCFIGp+I82F/rfprsVa/+Mk0sZ2F0tTvGNZ+gRO8B7C/HQ92beWine+/IDWDBbJUmbBN/hUNOGRyyStH34vfQeP3ZV4R61atXIu9Kefg1rIB/XRJciwso9nymLXmxbP+wxcCsVAxIKwfv1AZoDH96jN6rXr1SuVeowKsuFINrs+BSXATbc59JLU/XwCwdDMw7B/vUEpgHfQYZ7v9HCNar/2E55ynDpSwYrhXF4uKUeQiY0/Oy3kM555nCITcJgmvp0F30Yo8L9KpXL1X9E2XhkPoVBuYWwbmolKDOhmv+WHiXyGNkgbTRE1pOublXkRycCz+AfUoRzPdsgKJN1w/19KpXf7n6xlnCPikE/SkWdswrozDkNoZUfIWhFTYYWaPy4a6NkgSR2XAZXSOLIWUWcCv7FP1T7sH8wFZwp7ycxz971auXIm4AG+b77MFLEKLv7ULJMy0FefCsPAOv0t0YUrIMg0s+gVfxYrgVbIJLUSzsrl2F2ZZl4L7J/Pdp/956ca969UrEna0O41/HwSJ4F3in42Fz5Trsbt5Bv3u30e9uImyvnoV15GGY/LIA6kOZP1966pZ8r3r1n5eqhwZ0F/aB4ToHGK9zh/FPHjD60RE6H1tDaaA2cdy7mvFfI+BffksPNrEksu0AAAAASUVORK5CYII=",m}),i("Scene/GridImageryProvider",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/GeographicTilingScheme","../ThirdParty/when"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._tilingScheme=i(e.tilingScheme)?e.tilingScheme:new o({ellipsoid:e.ellipsoid}),this._cells=t(e.cells,8),this._color=t(e.color,l),this._glowColor=t(e.glowColor,u),this._glowWidth=t(e.glowWidth,6),this._backgroundColor=t(e.backgroundColor,c),this._errorEvent=new n,this._tileWidth=t(e.tileWidth,256),this._tileHeight=t(e.tileHeight,256),this._canvasSize=t(e.canvasSize,256),this._canvas=this._createGridCanvas(),this._readyPromise=a.resolve(!0)}var l=new e(1,1,1,.4),u=new e(0,1,0,.05),c=new e(0,.5,0,.2);return r(s.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}}),s.prototype._drawGrid=function(e){for(var t=0,i=this._canvasSize,r=0;r<=this._cells;++r){var n=r/this._cells,o=1+n*(i-1);e.moveTo(o,t),e.lineTo(o,i),e.moveTo(t,o),e.lineTo(i,o)}e.stroke()},s.prototype._createGridCanvas=function(){var e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;var t=0,i=this._canvasSize,r=e.getContext("2d"),n=this._backgroundColor.toCssColorString();r.fillStyle=n,r.fillRect(t,t,i,i);var o=this._glowColor.toCssColorString();r.strokeStyle=o,r.lineWidth=this._glowWidth,r.strokeRect(t,t,i,i),this._drawGrid(r),r.lineWidth=.5*this._glowWidth,r.strokeRect(t,t,i,i),this._drawGrid(r);var a=this._color.toCssColorString();return r.strokeStyle=a,r.lineWidth=2,r.strokeRect(t,t,i,i),r.lineWidth=1,this._drawGrid(r),e},s.prototype.getTileCredits=function(e,t,i){},s.prototype.requestImage=function(e,t,i){return this._canvas},s.prototype.pickFeatures=function(){},s}),i("Shaders/ShadowVolumeFS",[],function(){"use strict";return"#extension GL_EXT_frag_depth : enable\nvarying float v_WindowZ;\nvarying vec4 v_color;\nvoid writeDepthClampedToFarPlane()\n{\ngl_FragDepthEXT = min(v_WindowZ * gl_FragCoord.w, 1.0);\n}\nvoid main(void)\n{\ngl_FragColor = v_color;\nwriteDepthClampedToFarPlane();\n}\n"}),i("Shaders/ShadowVolumeVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec4 color;\nvarying float v_WindowZ;\nvarying vec4 v_color;\nvec4 depthClampFarPlane(vec4 vertexInClipCoordinates)\n{\nv_WindowZ = (0.5 * (vertexInClipCoordinates.z / vertexInClipCoordinates.w) + 0.5) * vertexInClipCoordinates.w;\nvertexInClipCoordinates.z = min(vertexInClipCoordinates.z, vertexInClipCoordinates.w);\nreturn vertexInClipCoordinates;\n}\nvoid main()\n{\nv_color = color;\nvec4 position = czm_computePosition();\ngl_Position = depthClampFarPlane(czm_modelViewProjectionRelativeToEye * position);\n}\n"}),i("Scene/StencilFunction",["../Core/freezeObject","../Renderer/WebGLConstants"],function(e,t){"use strict";var i={NEVER:t.NEVER,LESS:t.LESS,EQUAL:t.EQUAL,LESS_OR_EQUAL:t.LEQUAL,GREATER:t.GREATER,NOT_EQUAL:t.NOTEQUAL,GREATER_OR_EQUAL:t.GEQUAL,ALWAYS:t.ALWAYS};return e(i)}),i("Scene/StencilOperation",["../Core/freezeObject","../Renderer/WebGLConstants"],function(e,t){"use strict";var i={ZERO:t.ZERO,KEEP:t.KEEP,REPLACE:t.REPLACE,INCREMENT:t.INCR,DECREMENT:t.DECR,INVERT:t.INVERT,INCREMENT_WRAP:t.INCR_WRAP,DECREMENT_WRAP:t.DECR_WRAP};return e(i)}),i("Scene/GroundPrimitive",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartographic","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/destroyObject","../Core/DeveloperError","../Core/GeometryInstance","../Core/isArray","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/OrientedBoundingBox","../Core/Rectangle","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Shaders/ShadowVolumeFS","../Shaders/ShadowVolumeVS","../ThirdParty/when","./BlendingState","./DepthFunction","./Pass","./PerInstanceColorAppearance","./Primitive","./SceneMode","./StencilFunction","./StencilOperation"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D){"use strict";function R(e){e=n(e,n.EMPTY_OBJECT),o(e.geometryInstance)&&s("GroundPrimitive.geometryInstance","GroundPrimitive.geometryInstance is deprecated in version 1.18 and will be removed in version 1.20. Please use GroundPrimitive.geometryInstances."),this.geometryInstance=e.geometryInstance,this.geometryInstances=e.geometryInstances,this.show=n(e.show,!0),this.debugShowBoundingVolume=n(e.debugShowBoundingVolume,!1),this._sp=void 0,this._spPick=void 0,this._rsStencilPreloadPass=void 0,this._rsStencilDepthPass=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._uniformMap={},this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._readyPromise=w.defer(),this._primitive=void 0;var t,i=new A({flat:!0});o(this.geometryInstances)&&h(this.geometryInstances)&&this.geometryInstances.length>1&&(t=G),this._primitiveOptions={geometryInstances:void 0,appearance:i,vertexCacheOptimize:n(e.vertexCacheOptimize,!1),interleave:n(e.interleave,!1),releaseGeometryInstances:n(e.releaseGeometryInstances,!0),allowPicking:n(e.allowPicking,!0),asynchronous:n(e.asynchronous,!0),compressVertices:n(e.compressVertices,!0),_readOnlyInstanceAttributes:t,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_createPickOffsets:!0}}function O(e,t){var i=t.maximumRadius,r=i/Math.cos(.5*e)-i;return R._maxHeight+r}function N(e,t){return R._minHeight}function L(i,r,n){for(var o=n.attributes.position3DHigh.values,a=n.attributes.position3DLow.values,s=o.length,l=r.mapProjection.ellipsoid,u=Number.POSITIVE_INFINITY,c=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,p=Number.NEGATIVE_INFINITY,m=0;s>m;m+=3){var v=t.unpack(o,m,Y),g=t.unpack(a,m,X),_=t.add(v,g,Z),y=l.cartesianToCartographic(_,K),C=y.latitude,E=y.longitude;u=Math.min(u,C),c=Math.min(c,E),h=Math.max(h,C),p=Math.max(p,E)}var S=Q;if(S.north=h,S.south=u,S.east=p,S.west=c,S.width<d.PI){var w=f.fromRectangle(S,R._maxHeight,R._minOBBHeight,l);i._boundingVolumes.push(w)}else i._boundingVolumes.push(e.fromEncodedCartesianVertices(o,a));if(!r.scene3DOnly){var T=r.mapProjection,x=e.fromRectangleWithHeights2D(S,T,R._maxHeight,R._minOBBHeight);t.fromElements(x.center.z,x.center.x,x.center.y,x.center),i._boundingVolumes2D.push(x)}}function F(e,t,i,r){o(e._rsStencilPreloadPass)||(e._rsStencilPreloadPass=_.fromCache(W),e._rsStencilDepthPass=_.fromCache(H),e._rsColorPass=_.fromCache(q),e._rsPickPass=_.fromCache(j))}function B(e,t,i){if(!o(e._sp)){var r=t.context,n=S;n=P._modifyShaderPosition(e,n,t.scene3DOnly),n=P._appendShowToShader(e._primitive,n);var a=E,s=e._primitive._attributeLocations;if(e._sp=y.replaceCache({context:r,shaderProgram:e._sp,vertexShaderSource:n,fragmentShaderSource:a,attributeLocations:s}),e._primitive.allowPicking){var l=new C({sources:[a],pickColorQualifier:"varying"});e._spPick=y.replaceCache({context:r,shaderProgram:e._spPick,vertexShaderSource:C.createPickVertexShaderSource(n),fragmentShaderSource:l,attributeLocations:s})}else e._spPick=y.fromCache({context:r,vertexShaderSource:n,fragmentShaderSource:a,attributeLocations:s})}}function V(e,t){var i=e._primitive,r=3*i._va.length;t.length=r;for(var n=0,a=0;r>a;a+=3){var s=i._va[n++],l=t[a];o(l)||(l=t[a]=new g({owner:e,primitiveType:i._primitiveType})),l.vertexArray=s,l.renderState=e._rsStencilPreloadPass,l.shaderProgram=e._sp,l.uniformMap=e._uniformMap,l.pass=b.GROUND,l=t[a+1],o(l)||(l=t[a+1]=new g({owner:e,primitiveType:i._primitiveType})),l.vertexArray=s,l.renderState=e._rsStencilDepthPass,l.shaderProgram=e._sp,l.uniformMap=e._uniformMap,l.pass=b.GROUND,l=t[a+2],o(l)||(l=t[a+2]=new g({owner:e,primitiveType:i._primitiveType})),l.vertexArray=s,l.renderState=e._rsColorPass,l.shaderProgram=e._sp,l.uniformMap=e._uniformMap,l.pass=b.GROUND}}function k(e,t){var i=e._primitive,r=i._pickOffsets,n=3*r.length;t.length=n;for(var a=0,s=0;n>s;s+=3){var l=r[a++],u=l.offset,c=l.count,h=i._va[l.index],d=t[s];o(d)||(d=t[s]=new g({owner:e,primitiveType:i._primitiveType})),d.vertexArray=h,d.offset=u,d.count=c,d.renderState=e._rsStencilPreloadPass,d.shaderProgram=e._sp,d.uniformMap=e._uniformMap,d.pass=b.GROUND,d=t[s+1],o(d)||(d=t[s+1]=new g({owner:e,primitiveType:i._primitiveType})),d.vertexArray=h,d.offset=u,d.count=c,d.renderState=e._rsStencilDepthPass,d.shaderProgram=e._sp,d.uniformMap=e._uniformMap,d.pass=b.GROUND,d=t[s+2],o(d)||(d=t[s+2]=new g({owner:e,primitiveType:i._primitiveType})),d.vertexArray=h,d.offset=u,d.count=c,d.renderState=e._rsPickPass,d.shaderProgram=e._spPick,d.uniformMap=e._uniformMap,d.pass=b.GROUND}}function z(e,t,i,r,n,o,a){V(e,o),k(e,a)}function U(e,t,i,r,n,a,s,l){var u;t.mode===I.SCENE3D?u=e._boundingVolumes:t.mode!==I.SCENE3D&&o(e._boundingVolumes2D)&&(u=e._boundingVolumes2D);var c=t.commandList,h=t.passes;if(h.render)for(var d=i.length,p=0;d>p;++p)i[p].modelMatrix=n,i[p].boundingVolume=u[Math.floor(p/3)],i[p].cull=a,i[p].debugShowBoundingVolume=s,c.push(i[p]);if(h.pick){var m=e._primitive,f=m._pickOffsets,v=3*f.length;r.length=v;for(var g=0,_=0;v>_;_+=3){var y=f[g++],C=u[y.index];r[_].modelMatrix=n,r[_].boundingVolume=C,r[_].cull=a,r[_+1].modelMatrix=n,r[_+1].boundingVolume=C,r[_+1].cull=a,r[_+2].modelMatrix=n,r[_+2].boundingVolume=C,r[_+2].cull=a,c.push(r[_],r[_+1],r[_+2])}}}var G=["color"];a(R.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}}}),R.isSupported=function(e){return e.context.fragmentDepth},R._maxHeight=void 0,R._minHeight=void 0,R._minOBBHeight=void 0,R._maxTerrainHeight=9e3,R._minTerrainHeight=-1e5,R._minOBBTerrainHeight=-11500;var W={colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:M.ALWAYS,frontOperation:{fail:D.KEEP,zFail:D.DECREMENT_WRAP,zPass:D.DECREMENT_WRAP},backFunction:M.ALWAYS,backOperation:{fail:D.KEEP,zFail:D.INCREMENT_WRAP,zPass:D.INCREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!1},depthMask:!1},H={colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:M.ALWAYS,frontOperation:{fail:D.KEEP,zFail:D.KEEP,zPass:D.INCREMENT_WRAP},backFunction:M.ALWAYS,backOperation:{fail:D.KEEP,zFail:D.KEEP,zPass:D.DECREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!0,func:x.LESS_OR_EQUAL},depthMask:!1},q={stencilTest:{enabled:!0,frontFunction:M.NOT_EQUAL,frontOperation:{fail:D.KEEP,zFail:D.KEEP,zPass:D.DECREMENT_WRAP},backFunction:M.NOT_EQUAL,backOperation:{fail:D.KEEP,zFail:D.KEEP,zPass:D.DECREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!1},depthMask:!1,blending:T.ALPHA_BLEND},j={stencilTest:{enabled:!0,frontFunction:M.NOT_EQUAL,frontOperation:{fail:D.KEEP,zFail:D.KEEP,zPass:D.DECREMENT_WRAP},backFunction:M.NOT_EQUAL,backOperation:{fail:D.KEEP,zFail:D.KEEP,zPass:D.DECREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!1},depthMask:!1},Y=new t,X=new t,Z=new t,K=new i,Q=new v;return R.prototype.update=function(e){var t=e.context;if(t.fragmentDepth&&this.show&&(o(this._primitive)||o(this.geometryInstance)||o(this.geometryInstances))){if(!o(R._maxHeight)){var i=e.terrainExaggeration;R._maxHeight=R._maxTerrainHeight*i,R._minHeight=R._minTerrainHeight*i,R._minOBBHeight=R._minOBBTerrainHeight*i}if(!o(this._primitive)){var r,n,a,s=this._primitiveOptions;if(o(this.geometryInstance))r=this.geometryInstance,n=r.geometry,a=n.constructor,o(a)&&o(a.createShadowVolume)&&(r=new c({geometry:a.createShadowVolume(n,N,O),attributes:r.attributes,id:r.id,pickPrimitive:this})),s.geometryInstances=r;else{for(var l=h(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],u=l.length,d=new Array(u),p=0;u>p;++p)if(r=l[p],n=r.geometry,a=n.constructor,o(a)&&o(a.createShadowVolume)){var m=r.attributes;d[p]=new c({geometry:a.createShadowVolume(n,N,O),attributes:m,id:r.id,pickPrimitive:this})}s.geometryInstances=d}var f=this;s._createBoundingVolumeFunction=function(e,t){L(f,e,t)},s._createRenderStatesFunction=function(e,t,i,r){F(f,t)},s._createShaderProgramFunction=function(e,t,i){B(f,t)},s._createCommandsFunction=function(e,t,i,r,n,o,a){z(f,void 0,void 0,!0,!1,o,a)},s._updateAndQueueCommandsFunction=function(e,t,i,r,n,o,a,s){U(f,t,i,r,n,o,a,s)},this._primitive=new P(s),this._primitive.readyPromise.then(function(e){f._ready=!0,f.releaseGeometryInstances&&(f.geometryInstance=void 0,f.geometryInstances=void 0);var t=e._error;o(t)?f._readyPromise.reject(t):f._readyPromise.resolve(f)})}this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e); -}},R.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)},R.prototype.isDestroyed=function(){return!1},R.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),l(this)},R}),i("Scene/MapboxImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/MapboxApi","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o,a){"use strict";function s(r){r=t(r,t.EMPTY_OBJECT);var n=r.mapId,s=t(r.url,"//api.mapbox.com/v4/");this._url=s,this._mapId=n,this._accessToken=o.getAccessToken(r.accessToken);var h=t(r.format,"png");this._format=h.replace(".","");var d=s;if(l.test(s)||(d+="/"),d+=n+"/{z}/{x}/{y}."+this._format,i(this._accessToken)&&(d+="?access_token="+this._accessToken),i(r.credit)){var p=r.credit;"string"==typeof p&&(p=new e(p)),u=p,c.length=0}this._imageryProvider=new a({url:d,proxy:r.proxy,credit:u,ellipsoid:r.ellipsoid,minimumLevel:r.minimumLevel,maximumLevel:r.maximumLevel,rectangle:r.rectangle})}var l=/\/$/,u=new e("© Mapbox © OpenStreetMap",void 0,"https://www.mapbox.com/about/maps/"),c=[new e("Improve this map",void 0,"https://www.mapbox.com/map-feedback/")];return r(s.prototype,{url:{get:function(){return this._url}},ready:{get:function(){return this._imageryProvider.ready}},readyPromise:{get:function(){return this._imageryProvider.readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}}),s.prototype.getTileCredits=function(e,t,i){return c},s.prototype.requestImage=function(e,t,i){return this._imageryProvider.requestImage(e,t,i)},s.prototype.pickFeatures=function(e,t,i,r,n){return this._imageryProvider.pickFeatures(e,t,i,r,n)},s}),i("Scene/Moon",["../Core/buildModuleUrl","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Ellipsoid","../Core/IauOrientationAxes","../Core/Matrix3","../Core/Matrix4","../Core/Simon1994PlanetaryPositions","../Core/Transforms","./EllipsoidPrimitive","./Material"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(t){t=i(t,i.EMPTY_OBJECT);var n=t.textureUrl;r(n)||(n=e("Assets/Textures/moonSmall.jpg")),this.show=i(t.show,!0),this.textureUrl=n,this._ellipsoid=i(t.ellipsoid,a.MOON),this.onlySunLighting=i(t.onlySunLighting,!0),this._ellipsoidPrimitive=new d({radii:this.ellipsoid.radii,material:p.fromType(p.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new s}n(m.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var f=new l,v=new l,g=new t,_=[];return m.prototype.update=function(e){if(this.show){var t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;var i=e.time;r(h.computeIcrfToFixedMatrix(i,f))||h.computeTemeToPseudoFixedMatrix(i,f);var n=this._axes.evaluate(i,v);l.transpose(n,n),l.multiply(f,n,n);var o=c.computeMoonPositionInEarthInertialFrame(i,g);l.multiplyByVector(f,o,o),u.fromRotationTranslation(n,o,t.modelMatrix);var a=e.commandList;return e.commandList=_,_.length=0,t.update(e),e.commandList=a,1===_.length?_[0]:void 0}},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),o(this)},m}),i("Scene/NeverTileDiscardPolicy",[],function(){"use strict";function e(e){}return e.prototype.isReady=function(){return!0},e.prototype.shouldDiscardImage=function(e){return!1},e}),i("Shaders/AdjustTranslucentFS",[],function(){"use strict";return"#ifdef MRT\n#extension GL_EXT_draw_buffers : enable\n#endif\nuniform vec4 u_bgColor;\nuniform sampler2D u_depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nif (texture2D(u_depthTexture, v_textureCoordinates).r < 1.0)\n{\n#ifdef MRT\ngl_FragData[0] = u_bgColor;\ngl_FragData[1] = vec4(u_bgColor.a);\n#else\ngl_FragColor = u_bgColor;\n#endif\nreturn;\n}\ndiscard;\n}\n"}),i("Shaders/CompositeOITFS",[],function(){"use strict";return"uniform sampler2D u_opaque;\nuniform sampler2D u_accumulation;\nuniform sampler2D u_revealage;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 opaque = texture2D(u_opaque, v_textureCoordinates);\nvec4 accum = texture2D(u_accumulation, v_textureCoordinates);\nfloat r = texture2D(u_revealage, v_textureCoordinates).r;\n#ifdef MRT\nvec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a);\n#else\nvec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r);\n#endif\ngl_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque;\n}\n"}),i("Scene/OIT",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/WebGLConstants","../Shaders/AdjustTranslucentFS","../Shaders/CompositeOITFS","./BlendEquation","./BlendFunction"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v){"use strict";function g(i){this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;var r=i.floatingPointTexture&&i.depthTexture;this._translucentMRTSupport=i.drawBuffers&&r,this._translucentMultipassSupport=!this._translucentMRTSupport&&r,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=void 0,this._alphaFBO=void 0,this._adjustTranslucentFBO=void 0,this._adjustAlphaFBO=void 0,this._opaqueClearCommand=new o({color:new t(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new o({color:new t(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new o({color:new t(0,0,0,0),owner:this}),this._alphaClearCommand=new o({color:new t(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._translucentShaderCache={},this._alphaShaderCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new e,this._rs=void 0}function _(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function y(e){e._translucentFBO=e._translucentFBO&&!e._translucentFBO.isDestroyed()&&e._translucentFBO.destroy(),e._alphaFBO=e._alphaFBO&&!e._alphaFBO.isDestroyed()&&e._alphaFBO.destroy(),e._adjustTranslucentFBO=e._adjustTranslucentFBO&&!e._adjustTranslucentFBO.isDestroyed()&&e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO=e._adjustAlphaFBO&&!e._adjustAlphaFBO.isDestroyed()&&e._adjustAlphaFBO.destroy()}function C(e){_(e),y(e)}function E(e,t,i,r){_(e),e._accumulationTexture=new h({context:t,width:i,height:r,pixelFormat:n.RGBA,pixelDatatype:s.FLOAT}),e._revealageTexture=new h({context:t,width:i,height:r,pixelFormat:n.RGBA,pixelDatatype:s.FLOAT})}function S(e,t){y(e);var i=d.FRAMEBUFFER_COMPLETE,r=!0;if(e._translucentMRTSupport&&(e._translucentFBO=new a({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new a({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],destroyAttachments:!1}),(e._translucentFBO.status!==i||e._adjustTranslucentFBO.status!==i)&&(y(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO=new a({context:t,colorTextures:[e._accumulationTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._alphaFBO=new a({context:t,colorTextures:[e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new a({context:t,colorTextures:[e._accumulationTexture],destroyAttachments:!1}),e._adjustAlphaFBO=new a({context:t,colorTextures:[e._revealageTexture],destroyAttachments:!1});var n=e._translucentFBO.status===i,o=e._alphaFBO.status===i,s=e._adjustTranslucentFBO.status===i,l=e._adjustAlphaFBO.status===i;n&&o&&s&&l||(C(e),e._translucentMultipassSupport=!1,r=!1)}return r}function w(e,t,r,n){var o=r[n.id];if(!i(o)){var a=l.getState(n);a.depthMask=!1,a.blending=t,o=l.fromCache(a),r[n.id]=o}return o}function T(e,t,i){return w(t,O,e._translucentRenderStateCache,i)}function x(e,t,i){return w(t,N,e._translucentRenderStateCache,i)}function b(e,t,i){return w(t,L,e._alphaRenderStateCache,i)}function A(e,t,r,n){var o=t.id,a=r[o];if(!i(a)){var s=t._attributeLocations,l=t.fragmentShaderSource.clone();l.sources=l.sources.map(function(e){return e=c.replaceMain(e,"czm_translucent_main"),e=e.replace(/gl_FragColor/g,"czm_gl_FragColor"),e=e.replace(/\bdiscard\b/g,"czm_discard = true"),e=e.replace(/czm_phong/g,"czm_translucentPhong")}),l.sources.splice(0,0,(-1!==n.indexOf("gl_FragData")?"#extension GL_EXT_draw_buffers : enable \n":"")+"vec4 czm_gl_FragColor;\nbool czm_discard = false;\n"),l.sources.push("void main()\n{\n czm_translucent_main();\n if (czm_discard)\n {\n discard;\n }\n"+n+"}\n"),a=u.fromCache({context:e,vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:l,attributeLocations:s}),r[o]=a}return a}function P(e,t,i){return A(t,i,e._translucentShaderCache,F)}function I(e,t,i){return A(t,i,e._translucentShaderCache,B)}function M(e,t,i){return A(t,i,e._alphaShaderCache,V)}function D(e,t,r,n,o){var a,s,l,u,c=t.context,h=n.framebuffer,d=o.length;n.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(c,n),n.framebuffer=e._adjustAlphaFBO,e._adjustAlphaCommand.execute(c,n);var p=e._opaqueFBO;for(n.framebuffer=e._translucentFBO,u=0;d>u;++u)a=o[u],i(a.oit)&&a.shaderProgram.id===a.oit.shaderProgramId||(a.oit={colorRenderState:x(e,c,a.renderState),alphaRenderState:b(e,c,a.renderState),colorShaderProgram:I(e,c,a.shaderProgram),alphaShaderProgram:M(e,c,a.shaderProgram),shaderProgramId:a.shaderProgram.id}),s=a.oit.colorRenderState,l=a.oit.colorShaderProgram,r(a,t,c,n,s,l,p);for(n.framebuffer=e._alphaFBO,u=0;d>u;++u)a=o[u],s=a.oit.alphaRenderState,l=a.oit.alphaShaderProgram,r(a,t,c,n,s,l,p);n.framebuffer=h}function R(e,t,r,n,o){var a=t.context,s=n.framebuffer,l=o.length;n.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(a,n);var u=e._opaqueFBO;n.framebuffer=e._translucentFBO;for(var c=0;l>c;++c){var h=o[c];i(h.oit)&&h.shaderProgram.id===h.oit.shaderProgramId||(h.oit={translucentRenderState:T(e,a,h.renderState),translucentShaderProgram:P(e,a,h.shaderProgram),shaderProgramId:h.shaderProgram.id});var d=h.oit.translucentRenderState,p=h.oit.translucentShaderProgram;r(h,t,a,n,d,p,u)}n.framebuffer=s}g.prototype.update=function(t,r){if(this.isSupported()){this._opaqueFBO=r,this._opaqueTexture=r.getColorTexture(0),this._depthStencilTexture=r.depthStencilTexture;var n=this._opaqueTexture.width,o=this._opaqueTexture.height,a=this._accumulationTexture,s=!i(a)||a.width!==n||a.height!==o;if(s&&E(this,t,n,o),i(this._translucentFBO)&&!s||S(this,t)){var u,h,d=this;i(this._compositeCommand)||(u=new c({sources:[m]}),this._translucentMRTSupport&&u.defines.push("MRT"),h={u_opaque:function(){return d._opaqueTexture},u_accumulation:function(){return d._accumulationTexture},u_revealage:function(){return d._revealageTexture}},this._compositeCommand=t.createViewportQuadCommand(u,{uniformMap:h,owner:this})),i(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(u=new c({defines:["MRT"],sources:[p]}),h={u_bgColor:function(){return d._translucentMRTClearCommand.color},u_depthTexture:function(){return d._depthStencilTexture}},this._adjustTranslucentCommand=t.createViewportQuadCommand(u,{uniformMap:h,owner:this})):this._translucentMultipassSupport&&(u=new c({sources:[p]}),h={u_bgColor:function(){return d._translucentMultipassClearCommand.color},u_depthTexture:function(){return d._depthStencilTexture}},this._adjustTranslucentCommand=t.createViewportQuadCommand(u,{uniformMap:h,owner:this}),h={u_bgColor:function(){return d._alphaClearCommand.color},u_depthTexture:function(){return d._depthStencilTexture}},this._adjustAlphaCommand=t.createViewportQuadCommand(u,{uniformMap:h,owner:this}))),this._viewport.width=n,this._viewport.height=o,i(this._rs)&&e.equals(this._viewport,this._rs.viewport)||(this._rs=l.fromCache({viewport:this._viewport})),i(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderstate=this._rs),i(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)}}};var O={enabled:!0,color:new t(0,0,0,0),equationRgb:f.ADD,equationAlpha:f.ADD,functionSourceRgb:v.ONE,functionDestinationRgb:v.ONE,functionSourceAlpha:v.ZERO,functionDestinationAlpha:v.ONE_MINUS_SOURCE_ALPHA},N={enabled:!0,color:new t(0,0,0,0),equationRgb:f.ADD,equationAlpha:f.ADD,functionSourceRgb:v.ONE,functionDestinationRgb:v.ONE,functionSourceAlpha:v.ONE,functionDestinationAlpha:v.ONE},L={enabled:!0,color:new t(0,0,0,0),equationRgb:f.ADD,equationAlpha:f.ADD,functionSourceRgb:v.ZERO,functionDestinationRgb:v.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:v.ZERO,functionDestinationAlpha:v.ONE_MINUS_SOURCE_ALPHA},F=" vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n float ai = czm_gl_FragColor.a;\n float wzi = czm_alphaWeight(ai);\n gl_FragData[0] = vec4(Ci * wzi, ai);\n gl_FragData[1] = vec4(ai * wzi);\n",B=" vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n float ai = czm_gl_FragColor.a;\n float wzi = czm_alphaWeight(ai);\n gl_FragColor = vec4(Ci, ai) * wzi;\n",V=" float ai = czm_gl_FragColor.a;\n gl_FragColor = vec4(ai);\n";return g.prototype.executeCommands=function(e,t,i,r){return this._translucentMRTSupport?void R(this,e,t,i,r):void D(this,e,t,i,r)},g.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)},g.prototype.clear=function(e,i,r){var n=i.framebuffer;i.framebuffer=this._opaqueFBO,t.clone(r,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,i),i.framebuffer=this._translucentFBO;var o=this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand;o.execute(e,i),this._translucentMultipassSupport&&(i.framebuffer=this._alphaFBO,this._alphaClearCommand.execute(e,i)),i.framebuffer=n},g.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){C(this),i(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),i(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),i(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy());var e,t=this._translucentShaderCache;for(e in t)t.hasOwnProperty(e)&&i(t[e])&&t[e].destroy();this._translucentShaderCache={},t=this._alphaShaderCache;for(e in t)t.hasOwnProperty(e)&&i(t[e])&&t[e].destroy();return this._alphaShaderCache={},r(this)},g}),i("Scene/OpenStreetMapImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/DeveloperError","../Core/Event","../Core/Rectangle","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(i){n("OpenStreetMapImageryProvider","OpenStreetMapImageryProvider is deprecated. It will be removed in Cesium 1.18. Use createOpenStreetMapImageryProvider instead."),i=t(i,{});var r=t(i.url,"//a.tile.openstreetmap.org/");p.test(r)||(r+="/"),this._url=r,this._fileExtension=t(i.fileExtension,"png"),this._proxy=i.proxy,this._tileDiscardPolicy=i.tileDiscardPolicy,this._tilingScheme=new l({ellipsoid:i.ellipsoid}),this._tileWidth=256,this._tileHeight=256,this._minimumLevel=t(i.minimumLevel,0),this._maximumLevel=i.maximumLevel,this._rectangle=t(i.rectangle,this._tilingScheme.rectangle);var c=this._tilingScheme.positionToTileXY(s.southwest(this._rectangle),this._minimumLevel),h=this._tilingScheme.positionToTileXY(s.northeast(this._rectangle),this._minimumLevel),d=(Math.abs(h.x-c.x)+1)*(Math.abs(h.y-c.y)+1);if(d>4)throw new o("The imagery provider's rectangle and minimumLevel indicate that there are "+d+" tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.");this._errorEvent=new a,this._ready=!0,this._readyPromise=u.resolve(!0);var f=t(i.credit,m);"string"==typeof f&&(f=new e(f)),this._credit=f}function d(e,t,r,n){var o=e._url+n+"/"+t+"/"+r+"."+e._fileExtension,a=e._proxy;return i(a)&&(o=a.getURL(o)),o}var p=/\/$/,m=new e("MapQuest, Open Street Map and contributors, CC-BY-SA");return r(h.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),h.prototype.getTileCredits=function(e,t,i){},h.prototype.requestImage=function(e,t,i){var r=d(this,e,t,i);return c.loadImage(this,r)},h.prototype.pickFeatures=function(){},h}),i("Scene/OrthographicFrustum",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","./CullingVolume"],function(e,t,i,r,n,o,a,s){"use strict";function l(){this.left=void 0,this._left=void 0,this.right=void 0,this._right=void 0,this.top=void 0,this._top=void 0,this.bottom=void 0,this._bottom=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far,this._cullingVolume=new s,this._orthographicMatrix=new a}function u(e){(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far)&&(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=a.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}n(l.prototype,{projectionMatrix:{get:function(){return u(this),this._orthographicMatrix}}});var c=new t,h=new t,d=new t,p=new t;return l.prototype.computeCullingVolume=function(e,n,o){var a=this._cullingVolume.planes,s=this.top,l=this.bottom,u=this.right,m=this.left,f=this.near,v=this.far,g=t.cross(n,o,c),_=h;t.multiplyByScalar(n,f,_),t.add(e,_,_);var y=d;t.multiplyByScalar(g,m,y),t.add(_,y,y);var C=a[0];return r(C)||(C=a[0]=new i),C.x=g.x,C.y=g.y,C.z=g.z,C.w=-t.dot(g,y),t.multiplyByScalar(g,u,y),t.add(_,y,y),C=a[1],r(C)||(C=a[1]=new i),C.x=-g.x,C.y=-g.y,C.z=-g.z,C.w=-t.dot(t.negate(g,p),y),t.multiplyByScalar(o,l,y),t.add(_,y,y),C=a[2],r(C)||(C=a[2]=new i),C.x=o.x,C.y=o.y,C.z=o.z,C.w=-t.dot(o,y),t.multiplyByScalar(o,s,y),t.add(_,y,y),C=a[3],r(C)||(C=a[3]=new i),C.x=-o.x,C.y=-o.y,C.z=-o.z,C.w=-t.dot(t.negate(o,p),y),C=a[4],r(C)||(C=a[4]=new i),C.x=n.x,C.y=n.y,C.z=n.z,C.w=-t.dot(n,_),t.multiplyByScalar(n,v,y),t.add(e,y,y),C=a[5],r(C)||(C=a[5]=new i),C.x=-n.x,C.y=-n.y,C.z=-n.z,C.w=-t.dot(t.negate(n,p),y),this._cullingVolume},l.prototype.getPixelDimensions=function(e,t,i,r){u(this);var n=this.right-this.left,o=this.top-this.bottom,a=n/e,s=o/t;return r.x=a,r.y=s,r},l.prototype.clone=function(e){return r(e)||(e=new l),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e},l.prototype.equals=function(e){return r(e)&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},l}),i("Widgets/getElement",["../Core/DeveloperError"],function(e){"use strict";function t(e){if("string"==typeof e){var t=document.getElementById(e);e=t}return e}return t}),i("Scene/PerformanceDisplay",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/getTimestamp","../Widgets/getElement"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT);var r=a(e.container);if(!i(r))throw new n("container is required");this._container=r;var o=document.createElement("div");o.className="cesium-performanceDisplay";var s=document.createElement("div");s.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),s.appendChild(this._fpsText);var l=document.createElement("div");l.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),l.appendChild(this._msText),o.appendChild(l),o.appendChild(s),this._container.appendChild(o),this._lastFpsSampleTime=void 0,this._frameCount=0,this._time=void 0,this._fps=0,this._frameTime=0}return s.prototype.update=function(){if(!i(this._time))return this._lastFpsSampleTime=o(),void(this._time=o());var e=this._time,t=o();this._time=t;var r=t-e;this._frameCount++;var n=this._fps,a=t-this._lastFpsSampleTime;a>1e3&&(n=1e3*this._frameCount/a|0,this._lastFpsSampleTime=t,this._frameCount=0),n!==this._fps&&(this._fpsText.nodeValue=n+" FPS",this._fps=n),r!==this._frameTime&&(this._msText.nodeValue=r.toFixed(2)+" MS",this._frameTime=r)},s.prototype.destroy=function(){return r(this)},s}),i("Scene/PickDepth",["../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/PixelFormat","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/PassThrough"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(){this.framebuffer=void 0,this._depthTexture=void 0,this._textureToCopy=void 0,this._copyDepthCommand=void 0,this._debugPickDepthViewportCommand=void 0}function c(t,i,r){if(!e(t._debugPickDepthViewportCommand)){var n="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n float z_window = czm_unpackDepth(texture2D(u_texture, v_textureCoordinates));\n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n float scale = pow(z_ndc * 0.5 + 0.5, 8.0);\n gl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n}\n";t._debugPickDepthViewportCommand=i.createViewportQuadCommand(n,{uniformMap:{u_texture:function(){return t._depthTexture}},owner:t})}t._debugPickDepthViewportCommand.execute(i,r)}function h(e){e._depthTexture=e._depthTexture&&!e._depthTexture.isDestroyed()&&e._depthTexture.destroy()}function d(e){e.framebuffer=e.framebuffer&&!e.framebuffer.isDestroyed()&&e.framebuffer.destroy()}function p(e,t,i,n){e._depthTexture=new s({context:t,width:i,height:n,pixelFormat:r.RGBA,pixelDatatype:o.UNSIGNED_BYTE})}function m(e,t,i,r){h(e),d(e),p(e,t,i,r),e.framebuffer=new n({context:t,colorTextures:[e._depthTexture],destroyAttachments:!1})}function f(t,i,r){var n=r.width,o=r.height,a=t._depthTexture,s=!e(a)||a.width!==n||a.height!==o;(!e(t.framebuffer)||s)&&m(t,i,n,o)}function v(t,i,r){if(!e(t._copyDepthCommand)){var n="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n";t._copyDepthCommand=i.createViewportQuadCommand(n,{renderState:a.fromCache(),uniformMap:{u_texture:function(){return t._textureToCopy}},owner:t})}t._textureToCopy=r,t._copyDepthCommand.framebuffer=t.framebuffer}return u.prototype.executeDebugPickDepth=function(e,t){c(this,e,t)},u.prototype.update=function(e,t){f(this,e,t),v(this,e,t)},u.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)},u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){return h(this),d(this),this._copyDepthCommand.shaderProgram=e(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy(),i(this)},u}),i("Shaders/Appearances/PointAppearanceFS",[],function(){"use strict";return"uniform vec4 highlightColor;\nvarying vec3 v_color;\nvoid main()\n{\ngl_FragColor = vec4(v_color * highlightColor.rgb, highlightColor.a);\n}\n"}),i("Shaders/Appearances/PointAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 color;\nuniform float pointSize;\nvarying vec3 v_positionEC;\nvarying vec3 v_color;\nvoid main()\n{\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * czm_computePosition();\ngl_PointSize = pointSize;\n}\n"}),i("Scene/PointAppearance",["../Core/clone","../Core/Color","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PointAppearanceFS","../Shaders/Appearances/PointAppearanceVS","./Appearance"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e){e=r(e,r.EMPTY_OBJECT),this._vertexShaderSource=r(e.vertexShaderSource,l),this._fragmentShaderSource=r(e.fragmentShaderSource,s),this._renderState=u.getDefaultRenderState(!1,!1,e.renderState),this._pointSize=r(e.pointSize,2),this._highlightColor=n(e.highlightColor)?e.highlightColor:new t,this.material=void 0,this.translucent=r(e.translucent,!1),this.uniforms={highlightColor:this._highlightColor,pointSize:this._pointSize};var o=e.uniforms;this.uniforms=i(this.uniforms,o,!0)}return o(c.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return!1}},vertexFormat:{get:function(){return c.VERTEX_FORMAT}},pixelSize:{get:function(){return this._pointSize}}}),c.VERTEX_FORMAT=a.POSITION_AND_COLOR,c.prototype.getFragmentShaderSource=u.prototype.getFragmentShaderSource,c.prototype.isTranslucent=u.prototype.isTranslucent,c.prototype.getRenderState=u.prototype.getRenderState,c}),i("Scene/PrimitiveCollection",["../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError"],function(e,t,i,r,n,o){"use strict";function a(i){i=t(i,t.EMPTY_OBJECT),this._primitives=[],this._guid=e(),this.show=t(i.show,!0),this.destroyPrimitives=t(i.destroyPrimitives,!0)}function s(e,t){return e._primitives.indexOf(t)}return r(a.prototype,{length:{get:function(){return this._primitives.length}}}),a.prototype.add=function(e){var t=e._external=e._external||{},i=t._composites=t._composites||{};return i[this._guid]={collection:this},this._primitives.push(e),e},a.prototype.remove=function(e){if(this.contains(e)){var t=this._primitives.indexOf(e);if(-1!==t)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),!0}return!1},a.prototype.removeAndDestroy=function(e){var t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t},a.prototype.removeAll=function(){if(this.destroyPrimitives)for(var e=this._primitives,t=e.length,i=0;t>i;++i)e[i].destroy();this._primitives=[]},a.prototype.contains=function(e){return!!(i(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])},a.prototype.raise=function(e){if(i(e)){var t=s(this,e),r=this._primitives;if(t!==r.length-1){var n=r[t];r[t]=r[t+1],r[t+1]=n}}},a.prototype.raiseToTop=function(e){if(i(e)){var t=s(this,e),r=this._primitives;t!==r.length-1&&(r.splice(t,1),r.push(e))}},a.prototype.lower=function(e){if(i(e)){var t=s(this,e),r=this._primitives;if(0!==t){var n=r[t];r[t]=r[t-1],r[t-1]=n}}},a.prototype.lowerToBottom=function(e){if(i(e)){var t=s(this,e),r=this._primitives;0!==t&&(r.splice(t,1),r.unshift(e))}},a.prototype.get=function(e){return this._primitives[e]},a.prototype.update=function(e){if(this.show)for(var t=this._primitives,i=0;i<t.length;++i)t[i].update(e)},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this.removeAll(),n(this)},a}),i("Scene/QuadtreeTileProvider",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function i(){t.throwInstantiationError()}return i.computeDefaultLevelZeroMaximumGeometricError=function(e){return 2*e.ellipsoid.maximumRadius*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))},e(i.prototype,{quadtree:{get:t.throwInstantiationError,set:t.throwInstantiationError},ready:{get:t.throwInstantiationError},tilingScheme:{get:t.throwInstantiationError},errorEvent:{get:t.throwInstantiationError}}),i.prototype.beginUpdate=t.throwInstantiationError,i.prototype.endUpdate=t.throwInstantiationError,i.prototype.getLevelMaximumGeometricError=t.throwInstantiationError,i.prototype.loadTile=t.throwInstantiationError,i.prototype.computeTileVisibility=t.throwInstantiationError,i.prototype.showTileThisFrame=t.throwInstantiationError,i.prototype.computeDistanceToTile=t.throwInstantiationError,i.prototype.isDestroyed=t.throwInstantiationError,i.prototype.destroy=t.throwInstantiationError,i}),i("Scene/SceneTransitioner",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/EasingFunction","../Core/Ellipsoid","../Core/Math","../Core/Matrix4","../Core/ScreenSpaceEventHandler","../Core/ScreenSpaceEventType","./Camera","./OrthographicFrustum","./PerspectiveFrustum","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(i,r){this._scene=i,r=t(r,a.WGS84);var n=r.maximumRadius,o=new e(0,0,2*n),u=new e;u=e.normalize(e.negate(o,u),u);var c=e.clone(e.UNIT_Y),m=l.multiplyByPoint(h.TRANSFORM_2D,o,new e),f=l.multiplyByPointAsVector(h.TRANSFORM_2D,u,new e),v=l.multiplyByPointAsVector(h.TRANSFORM_2D,c,new e),g=new d;g.right=n*Math.PI,g.left=-g.right,g.top=g.right*(i.drawingBufferHeight/i.drawingBufferWidth),g.bottom=-g.top,this._camera2D={position:o,direction:u,up:c,position2D:m,direction2D:f,up2D:v,frustum:g},o=new e(0,-1,1),o=e.multiplyByScalar(e.normalize(o,o),5*n,o),u=new e,u=e.normalize(e.subtract(e.ZERO,o,u),u);var _=new e;_=e.normalize(e.cross(u,e.UNIT_Z,_),_),c=new e,c=e.normalize(e.cross(_,u,c),c),m=l.multiplyByPoint(h.TRANSFORM_2D,o,new e),f=l.multiplyByPointAsVector(h.TRANSFORM_2D,u,new e);var y=l.multiplyByPointAsVector(h.TRANSFORM_2D,_,new e);v=new e,v=e.normalize(e.cross(y,f,v),v),g=new p,g.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,g.fov=s.toRadians(60),this._cameraCV={position:o,direction:u,up:c,position2D:m,direction2D:f,up2D:v,frustum:g},o=new e,o=e.multiplyByScalar(e.normalize(new e(0,-2,1),o),2*n,o),u=new e,u=e.normalize(e.subtract(e.ZERO,o,u),u),_=new e,_=e.normalize(e.cross(u,e.UNIT_Z,_),_),c=new e,c=e.normalize(e.cross(_,u,c),c),this._camera3D={ -position:o,direction:u,up:c,frustum:g},this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0}function v(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new u(e._scene.canvas,!1);var i=function(){e._morphCancelled=!0,t(e)};e._completeMorph=i,e._morphHandler.setInputAction(i,c.LEFT_DOWN),e._morphHandler.setInputAction(i,c.MIDDLE_DOWN),e._morphHandler.setInputAction(i,c.RIGHT_DOWN),e._morphHandler.setInputAction(i,c.WHEEL)}}function g(e){for(var t=e._currentTweens,i=0;i<t.length;++i)t[i].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}function _(t,i,r,n){function a(t){u.position=C(c,p,t.time),u.direction=C(h,m,t.time),u.up=C(d,f,t.time),u.right=e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right)}var s=t._scene,u=s.camera;u._setTransform(l.IDENTITY);var c=u.position,h=u.direction,d=u.up,p=e.clone(t._camera2D.position),m=e.clone(t._camera2D.direction),f=e.clone(t._camera2D.up),v=s.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a});t._currentTweens.push(v),A(t,s,0,1,i,n)}function y(e,t,i,r){t*=.5;var n=e._scene.camera;n._setTransform(l.IDENTITY),T(e,t,i,function(){n.frustum=e._cameraCV.frustum.clone(),_(e,t,i,r)})}function C(t,i,r){return e.lerp(t,i,r,new e)}function E(t,i,r){function n(t){l.frustum.fov=s.lerp(c,h,t.time);var i=d/Math.tan(.5*l.frustum.fov),r=new e;l.position=e.multiplyByScalar(e.normalize(l.position,r),i,r)}var a=t._scene,l=a.camera,u=l.position,c=l.frustum.fov,h=.5*s.RADIANS_PER_DEGREE,d=e.magnitude(u)*Math.tan(.5*c);l.frustum.far=d/Math.tan(.5*h)+1e7;var p=a.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){l.frustum=t._camera2D.frustum.clone(),r(t)}});t._currentTweens.push(p)}function S(t,i,r,n){function a(t){u.position=C(h,g,t.time),u.direction=C(d,_,t.time),u.up=C(p,y,t.time),u.right=e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right)}var s=t._scene,u=s.camera;u._setTransform(l.IDENTITY);var c=r.maximumRadius,h=e.clone(u.position),d=e.clone(u.direction),p=e.clone(u.up),m=Math.tan(.5*t._cameraCV.frustum.fovy),f=t._cameraCV.frustum.aspectRatio*m,v=c*Math.PI/f,g=new e;g=e.multiplyByScalar(e.normalize(t._camera2D.position,g),v,g);var _=e.clone(t._camera2D.direction),y=e.clone(t._camera2D.up);i*=.5;var S=s.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a,complete:function(){E(t,i,n)}});t._currentTweens.push(S)}function w(t,i,r,n){function o(){E(t,i,n)}i*=.5;var a=r.maximumRadius,s=Math.tan(.5*t._camera3D.frustum.fovy),l=t._camera3D.frustum.aspectRatio*s,u=a*Math.PI/l,c={},h=new e;c.position2D=e.multiplyByScalar(e.normalize(t._camera2D.position2D,h),u,h),c.direction2D=e.clone(t._camera2D.direction2D),c.up2D=e.clone(t._camera2D.up2D),b(t,i,c,o)}function T(t,i,r,n){function a(e){u.position=C(S,m,e.time),u.frustum.top=s.lerp(f,y.top,e.time),u.frustum.bottom=s.lerp(v,y.bottom,e.time),u.frustum.right=s.lerp(g,y.right,e.time),u.frustum.left=s.lerp(_,y.left,e.time)}var l=t._scene,u=l.camera,c=r.maximumRadius,h=Math.tan(.5*t._cameraCV.frustum.fovy),d=t._cameraCV.frustum.aspectRatio*h,p=c*Math.PI/d,m=new e;m=e.multiplyByScalar(e.normalize(t._camera2D.position,m),p,m);var f=u.frustum.top,v=u.frustum.bottom,g=u.frustum.right,_=u.frustum.left,y=t._camera2D.frustum,E=t._cameraCV.frustum,S=e.clone(u.position),w=(g-_)/(2*c*Math.PI),T=1;w>T&&(w=0);var x=(T-w)*i;if(x<s.EPSILON6){if(e.equalsEpsilon(S,m,s.EPSILON6))return u.position=m,u.frustum=E.clone(),void n(t);x=i,w=0,T=1}var b=l.tweens.add({easingFunction:o.QUARTIC_OUT,duration:x,startObject:{time:w},stopObject:{time:T},update:a,complete:function(){u.frustum=E.clone(),n(t)}});t._currentTweens.push(b)}function x(t,i,r,n){function a(){function r(t){u.position=C(a,h,t.time),u.direction=C(l,d,t.time),u.up=C(c,p,t.time),u.right=e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right)}var a=e.clone(u.position),l=e.clone(u.direction),c=e.clone(u.up),h=e.clone(t._cameraCV.position),d=e.clone(t._cameraCV.direction),p=e.clone(t._cameraCV.up),m=s.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:r,complete:function(){n(t)}});t._currentTweens.push(m)}var s=t._scene,u=s.camera;u._setTransform(l.IDENTITY),i*=.5,T(t,i,r,a)}function b(t,i,r,n){function a(t){u.position=C(c,p,t.time),u.direction=C(h,m,t.time),u.up=C(d,f,t.time),u.right=e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right)}var s=t._scene,u=s.camera;u._setTransform(l.IDENTITY);var c=e.clone(u.position),h=e.clone(u.direction),d=e.clone(u.up),p=e.clone(r.position2D),m=e.clone(r.direction2D),f=e.clone(r.up2D),v=s.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a,complete:function(){u.position=p,u.direction=m,u.up=f,u.right=e.cross(m,f,u.right),e.normalize(u.right,u.right)}});t._currentTweens.push(v),A(t,s,1,0,i,n)}function A(e,t,r,n,a,s){var l={object:t,property:"morphTime",startValue:r,stopValue:n,duration:a,easingFunction:o.QUARTIC_OUT};i(s)&&(l.complete=function(){s(e)});var u=t.tweens.addProperty(l);e._currentTweens.push(u)}function P(e){var t=e._scene,i=t.drawingBufferHeight/t.drawingBufferWidth,r=e._camera2D.frustum;r.top=r.right*i,r.bottom=-r.top,i=1/i,r=e._cameraCV.frustum,r.aspectRatio=i,r=e._camera3D.frustum,r.aspectRatio=i;var n=t.camera;switch(t.mode){case m.SCENE3D:n.frustum=e._camera3D.frustum.clone();break;case m.COLUMBUS_VIEW:n.frustum=e._cameraCV.frustum.clone();break;case m.SCENE2D:n.frustum=e._camera2D.frustum.clone()}}function I(t){var r=t._scene;if(r._mode=m.SCENE3D,r.morphTime=m.getMorphTime(m.SCENE3D),g(t),P(t),t._previousMode!==m.MORPHING||t._morphCancelled){t._morphCancelled=!1;var n=r.camera;n.position=e.clone(t._camera3D.position),n.direction=e.clone(t._camera3D.direction),n.up=e.clone(t._camera3D.up),n.right=e.cross(n.direction,n.up,n.right),e.normalize(n.right,n.right)}var o=i(t._completeMorph);t._completeMorph=void 0,r.camera.update(r.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,m.SCENE3D,o)}function M(t){var r=t._scene;r._mode=m.SCENE2D,r.morphTime=m.getMorphTime(m.SCENE2D),g(t),P(t);var n=r.camera;e.clone(t._camera2D.position,n.position),e.clone(t._camera2D.direction,n.direction),e.clone(t._camera2D.up,n.up),e.cross(n.direction,n.up,n.right),e.normalize(n.right,n.right);var o=i(t._completeMorph);t._completeMorph=void 0,r.camera.update(r.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,m.SCENE2D,o)}function D(t){var r=t._scene;if(r._mode=m.COLUMBUS_VIEW,r.morphTime=m.getMorphTime(m.COLUMBUS_VIEW),g(t),P(t),t._previousModeMode!==m.MORPHING||t._morphCancelled){t._morphCancelled=!1;var n=r.camera;e.clone(t._cameraCV.position,n.position),e.clone(t._cameraCV.direction,n.direction),e.clone(t._cameraCV.up,n.up),e.cross(n.direction,n.up,n.right),e.normalize(n.right,n.right)}var o=i(t._completeMorph);t._completeMorph=void 0,r.camera.update(r.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,m.COLUMBUS_VIEW,o)}return f.prototype.completeMorph=function(){i(this._completeMorph)&&this._completeMorph()},f.prototype.morphTo2D=function(e,t){i(this._completeMorph)&&this._completeMorph();var r=this._scene;this._previousMode=r.mode,this._previousMode!==m.SCENE2D&&this._previousMode!==m.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,m.SCENE2D,!0),P(this),r._mode=m.MORPHING,v(this,M),this._previousMode===m.COLUMBUS_VIEW?S(this,e,t,M):w(this,e,t,M),0===e&&i(this._completeMorph)&&this._completeMorph())},f.prototype.morphToColumbusView=function(e,t){i(this._completeMorph)&&this._completeMorph();var r=this._scene;this._previousMode=r.mode,this._previousMode!==m.COLUMBUS_VIEW&&this._previousMode!==m.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,m.COLUMBUS_VIEW,!0),P(this),r._mode=m.MORPHING,v(this,D),this._previousMode===m.SCENE2D?x(this,e,t,D):b(this,e,this._cameraCV,D),0===e&&i(this._completeMorph)&&this._completeMorph())},f.prototype.morphTo3D=function(e,t){i(this._completeMorph)&&this._completeMorph();var r=this._scene;this._previousMode=r.mode,this._previousMode!==m.SCENE3D&&this._previousMode!==m.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,m.SCENE3D,!0),P(this),r._mode=m.MORPHING,v(this,I),this._previousMode===m.SCENE2D?y(this,e,t,I):_(this,e,t,I),0===e&&i(this._completeMorph)&&this._completeMorph())},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return g(this),r(this)},f}),i("Scene/TweenCollection",["../Core/clone","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/EasingFunction","../Core/getTimestamp","../Core/TimeConstants","../ThirdParty/Tween"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,i,r,n,o,a,s,l,u,c){this._tweens=t,this._tweenjs=i,this._startObject=e(r),this._stopObject=e(n),this._duration=o,this._delay=a,this._easingFunction=s,this._update=l,this._complete=u,this.cancel=c,this.needsStart=!0}function c(){this._tweens=[]}return r(u.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}}),u.prototype.cancelTween=function(){this._tweens.remove(this)},r(c.prototype,{length:{get:function(){return this._tweens.length}}}),c.prototype.add=function(r){if(r=t(r,t.EMPTY_OBJECT),0===r.duration)return i(r.complete)&&r.complete(),new u(this);var n=r.duration/s.SECONDS_PER_MILLISECOND,a=t(r.delay,0),c=a/s.SECONDS_PER_MILLISECOND,h=t(r.easingFunction,o.LINEAR_NONE),d=r.startObject,p=new l.Tween(d);p.to(e(r.stopObject),n),p.delay(c),p.easing(h),i(r.update)&&p.onUpdate(function(){r.update(d)}),p.onComplete(t(r.complete,null)),p.repeat(t(r._repeat,0));var m=new u(this,p,r.startObject,r.stopObject,r.duration,a,h,r.update,r.complete,r.cancel);return this._tweens.push(m),m},c.prototype.addProperty=function(e){function i(e){r[n]=e.value}e=t(e,t.EMPTY_OBJECT);var r=e.object,n=e.property,o=e.startValue,a=e.stopValue;return this.add({startObject:{value:o},stopObject:{value:a},duration:t(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})},c.prototype.addAlpha=function(e){function r(e){for(var t=o.length,i=0;t>i;++i)n.uniforms[o[i]].alpha=e.alpha}e=t(e,t.EMPTY_OBJECT);var n=e.material,o=[];for(var a in n.uniforms)n.uniforms.hasOwnProperty(a)&&i(n.uniforms[a])&&i(n.uniforms[a].alpha)&&o.push(a);return this.add({startObject:{alpha:t(e.startValue,0)},stopObject:{alpha:t(e.stopValue,1)},duration:t(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel})},c.prototype.addOffsetIncrement=function(e){e=t(e,t.EMPTY_OBJECT);var i=e.material,r=i.uniforms;return this.addProperty({object:r,property:"offset",startValue:r.offset,stopValue:r.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})},c.prototype.remove=function(e){if(!i(e))return!1;var t=this._tweens.indexOf(e);return-1!==t?(e.tweenjs.stop(),i(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1},c.prototype.removeAll=function(){for(var e=this._tweens,t=0;t<e.length;++t){var r=e[t];r.tweenjs.stop(),i(r.cancel)&&r.cancel()}e.length=0},c.prototype.contains=function(e){return i(e)&&-1!==this._tweens.indexOf(e)},c.prototype.get=function(e){return this._tweens[e]},c.prototype.update=function(e){var t=this._tweens,r=0;for(e=i(e)?e/s.SECONDS_PER_MILLISECOND:a();r<t.length;){var n=t[r],o=n.tweenjs;n.needsStart?(n.needsStart=!1,o.start(e)):o.update(e)?r++:(o.stop(),t.splice(r,1))}},c}),i("Scene/ScreenSpaceCameraController",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/IntersectionTests","../Core/isArray","../Core/KeyboardEventModifier","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Plane","../Core/Quaternion","../Core/Ray","../Core/Transforms","./CameraEventAggregator","./CameraEventType","./SceneMode","./SceneTransforms","./TweenCollection"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w){"use strict";function T(i){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.translateEventTypes=C.LEFT_DRAG,this.zoomEventTypes=[C.RIGHT_DRAG,C.WHEEL,C.PINCH],this.rotateEventTypes=C.LEFT_DRAG,this.tiltEventTypes=[C.MIDDLE_DRAG,C.PINCH,{eventType:C.LEFT_DRAG,modifier:h.CTRL},{eventType:C.RIGHT_DRAG,modifier:h.CTRL}],this.lookEventTypes={eventType:C.LEFT_DRAG,modifier:h.SHIFT},this.minimumPickingTerrainHeight=15e4,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumCollisionTerrainHeight=15e3,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=75e5,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this._scene=i,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new y(i.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._tweens=new w,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new e(-1,-1),this._tiltCenter=new t,this._rotateMousePosition=new e(-1,-1),this._rotateStartPosition=new t,this._strafeStartPosition=new t,this._zoomMouseStart=new e,this._zoomWorldPosition=new t,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._rotatingZoom=!1;var n=i.mapProjection;this._maxCoord=n.project(new r(Math.PI,d.PI_OVER_TWO)),this._zoomFactor=5,this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=2e-4,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3}function x(e,t){if(0>e)return 0;var i=25*(1-t);return Math.exp(-i*e)}function b(t){return e.equalsEpsilon(t.startPosition,t.endPosition,d.EPSILON14)}function A(t,i,r,n,a,s,l){var u=s[l];o(u)||(u=s[l]={startPosition:new e,endPosition:new e,motion:new e,active:!1});var c=t.getButtonPressTime(i,r),h=t.getButtonReleaseTime(i,r),d=c&&h&&(h.getTime()-c.getTime())/1e3,p=new Date,m=h&&(p.getTime()-h.getTime())/1e3;if(c&&h&&$>d){var f=x(m,n);if(u.active)u.startPosition=e.clone(u.endPosition,u.startPosition),u.endPosition=e.multiplyByScalar(u.motion,f,u.endPosition),u.endPosition=e.add(u.startPosition,u.endPosition,u.endPosition),u.motion=e.clone(e.ZERO,u.motion);else{var v=t.getLastMovement(i,r);if(!o(v)||b(v))return;u.motion.x=.5*(v.endPosition.x-v.startPosition.x),u.motion.y=.5*(v.endPosition.y-v.startPosition.y),u.startPosition=e.clone(v.startPosition,u.startPosition),u.endPosition=e.multiplyByScalar(u.motion,f,u.endPosition),u.endPosition=e.add(u.startPosition,u.endPosition,u.endPosition),u.active=!0}if(isNaN(u.endPosition.x)||isNaN(u.endPosition.y)||e.distance(u.startPosition,u.endPosition)<.5)return void(u.active=!1);if(!t.isButtonDown(i,r)){var g=t.getStartMousePosition(i,r);a(s,g,u)}}else u.active=!1}function P(e,t,i,r,n,a){if(o(i)){var s=e._aggregator;c(i)||(ee[0]=i,i=ee);for(var l=i.length,u=0;l>u;++u){var h=i[u],d=o(h.eventType)?h.eventType:h,p=h.modifier,m=s.isMoving(d,p)&&s.getMovement(d,p),f=s.getStartMousePosition(d,p);e.enableInputs&&t&&(m?r(e,f,m):1>n&&A(s,d,p,n,r,e,a))}}}function I(i,r,n,a,s,l){var u=1;o(l)&&(u=d.clamp(Math.abs(l),.25,1));var c=i.minimumZoomDistance*u,h=i.maximumZoomDistance,p=s-c,m=a*p;m=d.clamp(m,i._minimumZoomRate,i._maximumZoomRate);var f=n.endPosition.y-n.startPosition.y,v=f/i._scene.canvas.clientHeight;v=Math.min(v,i.maximumMovementRatio);var g=m*v;if(!(g>0&&Math.abs(s-c)<1||0>g&&Math.abs(s-h)<1)){c>s-g?g=s-c-1:s-g>h&&(g=s-h);var _,y=i._scene,C=y.camera,w=y.mode;if(o(i._globe)&&(_=w!==E.SCENE2D?L(i,r,ie):C.getPickRay(r,te).origin),!o(_))return void C.zoomIn(g);var T=e.equals(r,i._zoomMouseStart),x=i._zoomingOnVector,b=i._rotatingZoom;T||(i._zoomMouseStart=e.clone(r,i._zoomMouseStart),i._zoomWorldPosition=t.clone(_,i._zoomWorldPosition),x=i._zoomingOnVector=!1,b=i._rotatingZoom=!1);var A=w===E.COLUMBUS_VIEW;if(!T||b){if(w===E.SCENE2D){var P=i._zoomWorldPosition,I=C.position;if(!t.equals(P,I)){var M=t.subtract(P,I,ne);t.normalize(M,M);var D=t.distance(P,I)*g/(.5*C.getMagnitude());C.move(M,.5*D)}}else if(w===E.SCENE3D){var R=t.normalize(C.position,ce);if(C.positionCartographic.height<3e3&&Math.abs(t.dot(C.direction,R))<.6)A=!0;else{var O=y.canvas,N=oe;N.x=O.clientWidth/2,N.y=O.clientHeight/2;var F=L(i,N,ae);if(o(F)){var B=t.normalize(F,se),V=t.normalize(i._zoomWorldPosition,le),k=t.dot(V,B);if(k>0){var z=d.acosClamped(k),U=t.cross(V,B,ue),G=Math.abs(z)>d.toRadians(20)?.75*C.positionCartographic.height:C.positionCartographic.height-g,W=g/G;C.rotate(U,z*W)}}else A=!0}}i._rotatingZoom=!A}if(!T&&A||x){var H,q=S.wgs84ToWindowCoordinates(y,i._zoomWorldPosition,re);H=w!==E.COLUMBUS_VIEW&&e.equals(r,i._zoomMouseStart)&&o(q)?C.getPickRay(q,te):C.getPickRay(r,te);var j=H.direction;w===E.COLUMBUS_VIEW&&t.fromElements(j.y,j.z,j.x,j),C.move(j,g),i._zoomingOnVector=!0}else C.zoomIn(g)}}function M(e,i,r){var n=e._scene,o=n.camera,a=o.getPickRay(r.startPosition,he).origin,s=o.getPickRay(r.endPosition,de).origin,l=t.subtract(a,s,pe),u=t.magnitude(l);u>0&&(t.normalize(l,l),o.move(l,u))}function D(e,t,i){o(i.distance)&&(i=i.distance);var r=e._scene,n=r.camera;I(e,t,i,e._zoomFactor,n.getMagnitude())}function R(t,i,r){if(o(r.angleAndHeight))return void O(t,i,r.angleAndHeight);var n=t._scene,a=n.camera,s=n.canvas,l=s.clientWidth,u=s.clientHeight,c=me;c.x=2/l*r.startPosition.x-1,c.y=2/u*(u-r.startPosition.y)-1,c=e.normalize(c,c);var h=fe;h.x=2/l*r.endPosition.x-1,h.y=2/u*(u-r.endPosition.y)-1,h=e.normalize(h,h);var p=d.acosClamped(c.x);c.y<0&&(p=d.TWO_PI-p);var m=d.acosClamped(h.x);h.y<0&&(m=d.TWO_PI-m);var f=m-p;a.twistRight(f)}function O(e,t,i){var r=e._rotateFactor*e._rotateRateRangeAdjustment;r>e._maximumRotateRate&&(r=e._maximumRotateRate),r<e._minimumRotateRate&&(r=e._minimumRotateRate);var n=e._scene,o=n.camera,a=n.canvas,s=(i.endPosition.x-i.startPosition.x)/a.clientWidth;s=Math.min(s,e.maximumMovementRatio);var l=r*s*Math.PI*4;o.twistRight(l)}function N(e){var t=e._tweens;e._aggregator.anyButtonDown&&t.removeAll();var i=e._scene,r=i.camera;if(t.contains(e._tween)||(m.equals(m.IDENTITY,r.transform)?(P(e,e.enableTranslate,e.translateEventTypes,M,e.inertiaTranslate,"_lastInertiaTranslateMovement"),P(e,e.enableZoom,e.zoomEventTypes,D,e.inertiaZoom,"_lastInertiaZoomMovement"),P(e,e.enableRotate,e.tiltEventTypes,R,e.inertiaSpin,"_lastInertiaTiltMovement")):(P(e,e.enableRotate,e.translateEventTypes,R,e.inertiaSpin,"_lastInertiaSpinMovement"),P(e,e.enableZoom,e.zoomEventTypes,D,e.inertiaZoom,"_lastInertiaZoomMovement"))),!(e._aggregator.anyButtonDown||o(e._lastInertiaZoomMovement)&&e._lastInertiaZoomMovement.active||o(e._lastInertiaTranslateMovement)&&e._lastInertiaTranslateMovement.active||t.contains(e._tween))){var n=r.createCorrectPositionTween(e.bounceAnimationTime);o(n)&&(e._tween=t.add(n))}t.update()}function L(e,i,r){var n=e._scene,a=e._globe,s=n.camera;if(o(a)){var l;n.pickPositionSupported&&(l=n.pickPosition(i,ge));var u=s.getPickRay(i,ve),c=a.pick(u,n,_e),h=o(l)?t.distance(l,s.positionWC):Number.POSITIVE_INFINITY,d=o(c)?t.distance(c,s.positionWC):Number.POSITIVE_INFINITY;return d>h?t.clone(l,r):t.clone(c,r)}}function F(i,r,n){if(t.equals(r,i._translateMousePosition)||(i._looking=!1),t.equals(r,i._strafeMousePosition)||(i._strafing=!1),i._looking)return void K(i,r,n);if(i._strafing)return void G(i,r,n);var a,s=i._scene,l=s.camera,c=e.clone(n.startPosition,be),h=e.clone(n.endPosition,Ae),p=l.getPickRay(c,ye),m=t.clone(t.ZERO,Te),v=t.UNIT_X;if(l.position.z<i._minimumPickingTerrainHeight&&(a=L(i,c,Ee),o(a)&&(m.x=a.x)),m.x>l.position.z&&o(a))return t.clone(a,i._strafeStartPosition),i._strafing=!0,G(i,r,n),void(i._strafeMousePosition=e.clone(r,i._strafeMousePosition));var g=f.fromPointNormal(m,v,xe);p=l.getPickRay(c,ye);var _=u.rayPlane(p,g,Ee),y=l.getPickRay(h,Ce),C=u.rayPlane(y,g,Se);if(!o(_)||!o(C))return i._looking=!0,K(i,r,n),void e.clone(r,i._translateMousePosition);var E=t.subtract(_,C,we),S=E.x;E.x=E.y,E.y=E.z,E.z=S;var w=t.magnitude(E);w>d.EPSILON6&&(t.normalize(E,E),l.move(E,w))}function B(t,i,r){if(o(r.angleAndHeight)&&(r=r.angleAndHeight),e.equals(i,t._tiltCenterMousePosition)||(t._tiltCVOffMap=!1,t._looking=!1),t._looking)return void K(t,i,r);var n=t._scene,a=n.camera,s=t._maxCoord,l=Math.abs(a.position.x)-s.x<0&&Math.abs(a.position.y)-s.y<0;t._tiltCVOffMap||!l||a.position.z>t._minimumPickingTerrainHeight?(t._tiltCVOffMap=!0,V(t,i,r)):k(t,i,r)}function V(i,r,n){var a=i._scene,s=a.camera,u=a.canvas,c=Pe;c.x=u.clientWidth/2,c.y=u.clientHeight/2;var h,p=s.getPickRay(c,Ie),f=t.UNIT_X,v=p.origin,g=p.direction,y=t.dot(f,g);if(Math.abs(y)>d.EPSILON6&&(h=-t.dot(f,v)/y),!o(h)||0>=h)return i._looking=!0,K(i,r,n),void e.clone(r,i._tiltCenterMousePosition);var C=t.multiplyByScalar(g,h,Me);t.add(v,C,C);var E=a.mapProjection,S=E.ellipsoid;t.fromElements(C.y,C.z,C.x,C);var w=E.unproject(C,Be);S.cartographicToCartesian(w,C);var T=_.eastNorthUpToFixedFrame(C,S,Re),x=i._globe,b=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var A=m.clone(s.transform,Ve);s._setTransform(T),H(i,r,n,t.UNIT_Z),s._setTransform(A),i._globe=x,i._ellipsoid=b;var P=b.maximumRadius;i._rotateFactor=1/P,i._rotateRateRangeAdjustment=P}function k(i,r,n){var a,s,c=i._ellipsoid,h=i._scene,g=h.camera,y=t.UNIT_X;if(e.equals(r,i._tiltCenterMousePosition))a=t.clone(i._tiltCenter,Me);else{if(g.position.z<i._minimumPickingTerrainHeight&&(a=L(i,r,Me)),!o(a)){s=g.getPickRay(r,Ie);var C,E=s.origin,S=s.direction,w=t.dot(y,S);if(Math.abs(w)>d.EPSILON6&&(C=-t.dot(y,E)/w),!o(C)||0>=C)return i._looking=!0,K(i,r,n),void e.clone(r,i._tiltCenterMousePosition);a=t.multiplyByScalar(S,C,Me),t.add(E,a,a)}e.clone(r,i._tiltCenterMousePosition),t.clone(a,i._tiltCenter)}var T=h.canvas,x=Pe;x.x=T.clientWidth/2,x.y=i._tiltCenterMousePosition.y,s=g.getPickRay(x,Ie);var b=t.clone(t.ZERO,Ne);b.x=a.x;var A=f.fromPointNormal(b,y,Le),P=u.rayPlane(s,A,De),I=g._projection;c=I.ellipsoid,t.fromElements(a.y,a.z,a.x,a);var M=I.unproject(a,Be);c.cartographicToCartesian(M,a);var D,R=_.eastNorthUpToFixedFrame(a,c,Re);o(P)?(t.fromElements(P.y,P.z,P.x,P),M=I.unproject(P,Be),c.cartographicToCartesian(M,P),D=_.eastNorthUpToFixedFrame(P,c,Oe)):D=R;var O=i._globe,N=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var F=t.UNIT_Z,B=m.clone(g.transform,Ve);g._setTransform(R);var V=t.cross(t.UNIT_Z,t.normalize(g.position,Fe),Fe),k=t.dot(g.right,V);if(H(i,r,n,F,!1,!0),g._setTransform(D),0>k){n.startPosition.y>n.endPosition.y&&(F=void 0);var z=g.constrainedAxis;g.constrainedAxis=void 0,H(i,r,n,F,!0,!1),g.constrainedAxis=z}else H(i,r,n,F,!0,!1);if(o(g.constrainedAxis)){var U=t.cross(g.direction,g.constrainedAxis,vt);t.equalsEpsilon(U,t.ZERO,d.EPSILON6)||(t.dot(U,g.right)<0&&t.negate(U,U),t.cross(U,g.direction,g.up),t.cross(g.direction,g.up,g.right),t.normalize(g.up,g.up),t.normalize(g.right,g.right))}g._setTransform(B),i._globe=O,i._ellipsoid=N;var G=N.maximumRadius;i._rotateFactor=1/G,i._rotateRateRangeAdjustment=G;var W=t.clone(g.positionWC,Fe);if(J(i),!t.equals(g.positionWC,W)){g._setTransform(D),g.worldToCameraCoordinatesPoint(W,W);var q=t.magnitudeSquared(W);t.magnitudeSquared(g.position)>q&&(t.normalize(g.position,g.position),t.multiplyByScalar(g.position,Math.sqrt(q),g.position));var j=t.angleBetween(W,g.position),Y=t.cross(W,g.position,W);t.normalize(Y,Y);var X=v.fromAxisAngle(Y,j,ke),Z=p.fromQuaternion(X,ze);p.multiplyByVector(Z,g.direction,g.direction),p.multiplyByVector(Z,g.up,g.up),t.cross(g.direction,g.up,g.right),t.cross(g.right,g.direction,g.up),g._setTransform(B)}}function z(e,i,r){o(r.distance)&&(r=r.distance);var n=e._scene,a=n.camera,s=n.canvas,l=Ue;l.x=s.clientWidth/2,l.y=s.clientHeight/2;var u,c=a.getPickRay(l,Ge);a.position.z<e._minimumPickingTerrainHeight&&(u=L(e,l,We));var h;if(o(u))h=t.distance(c.origin,u);else{var d=t.UNIT_X,p=c.origin,m=c.direction;h=-t.dot(d,p)/t.dot(d,m)}I(e,i,r,e._zoomFactor,h)}function U(e){var t=e._scene,i=t.camera;if(m.equals(m.IDENTITY,i.transform)){var r=e._tweens;if(e._aggregator.anyButtonDown&&r.removeAll(),P(e,e.enableTilt,e.tiltEventTypes,B,e.inertiaSpin,"_lastInertiaTiltMovement"),P(e,e.enableTranslate,e.translateEventTypes,F,e.inertiaTranslate,"_lastInertiaTranslateMovement"),P(e,e.enableZoom,e.zoomEventTypes,z,e.inertiaZoom,"_lastInertiaZoomMovement"),P(e,e.enableLook,e.lookEventTypes,K),!(e._aggregator.anyButtonDown||o(e._lastInertiaZoomMovement)&&e._lastInertiaZoomMovement.active||o(e._lastInertiaTranslateMovement)&&e._lastInertiaTranslateMovement.active||r.contains(e._tween))){var n=i.createCorrectPositionTween(e.bounceAnimationTime);o(n)&&(e._tween=r.add(n))}r.update()}else P(e,e.enableRotate,e.rotateEventTypes,H,e.inertiaSpin,"_lastInertiaSpinMovement"),P(e,e.enableZoom,e.zoomEventTypes,j,e.inertiaZoom,"_lastInertiaZoomMovement")}function G(e,i,r){var n=e._scene,a=n.camera,s=L(e,r.startPosition,Ke);if(o(s)){var l=r.endPosition,c=a.getPickRay(l,He),h=t.clone(a.direction,Ye);n.mode===E.COLUMBUS_VIEW&&t.fromElements(h.z,h.x,h.y,h);var d=f.fromPointNormal(s,h,qe),p=u.rayPlane(c,d,je);o(p)&&(h=t.subtract(s,p,h),n.mode===E.COLUMBUS_VIEW&&t.fromElements(h.y,h.z,h.x,h),t.add(a.position,h,a.position))}}function W(i,r,n){var a=i._scene,s=a.camera;if(!m.equals(s.transform,m.IDENTITY))return void H(i,r,n);var u,c,h,d,p=i._ellipsoid.geodeticSurfaceNormal(s.position,$e),f=i._ellipsoid.cartesianToCartographic(s.positionWC,Ze).height,v=i._globe,g=!1;if(o(v)&&f<i._minimumPickingTerrainHeight&&(d=L(i,n.startPosition,Ke),o(d))){var _=s.getPickRay(n.startPosition,ve),y=i._ellipsoid.geodeticSurfaceNormal(d);g=Math.abs(t.dot(_.direction,y))<.05,g&&!i._looking&&(i._rotating=!1,i._strafing=!0)}return e.equals(r,i._rotateMousePosition)?void(i._looking?K(i,r,n,p):i._rotating?H(i,r,n):i._strafing?(t.clone(d,i._strafeStartPosition),G(i,r,n)):(u=t.magnitude(i._rotateStartPosition),c=Qe,c.x=c.y=c.z=u,h=l.fromCartesian3(c,Je),q(i,r,n,h))):(i._looking=!1,i._rotating=!1,i._strafing=!1,o(v)&&f<i._minimumPickingTerrainHeight?o(d)?t.magnitude(s.position)<t.magnitude(d)?(t.clone(d,i._strafeStartPosition),i._strafing=!0,G(i,r,n)):(u=t.magnitude(d),c=Qe,c.x=c.y=c.z=u,h=l.fromCartesian3(c,Je),q(i,r,n,h),t.clone(d,i._rotateStartPosition)):(i._looking=!0,K(i,r,n,p)):o(s.pickEllipsoid(n.startPosition,i._ellipsoid,Xe))?(q(i,r,n,i._ellipsoid),t.clone(Xe,i._rotateStartPosition)):f>i._minimumTrackBallHeight?(i._rotating=!0,H(i,r,n)):(i._looking=!0,K(i,r,n,p)),void e.clone(r,i._rotateMousePosition))}function H(e,i,r,a,s,l){s=n(s,!1),l=n(l,!1);var u=e._scene,c=u.camera,h=u.canvas,d=c.constrainedAxis;o(a)&&(c.constrainedAxis=a);var p=t.magnitude(c.position),m=e._rotateFactor*(p-e._rotateRateRangeAdjustment);m>e._maximumRotateRate&&(m=e._maximumRotateRate),m<e._minimumRotateRate&&(m=e._minimumRotateRate);var f=(r.startPosition.x-r.endPosition.x)/h.clientWidth,v=(r.startPosition.y-r.endPosition.y)/h.clientHeight;f=Math.min(f,e.maximumMovementRatio),v=Math.min(v,e.maximumMovementRatio);var g=m*f*Math.PI*2,_=m*v*Math.PI;s||c.rotateRight(g),l||c.rotateUp(_),c.constrainedAxis=d}function q(i,r,n,a){var s=i._scene,l=s.camera,u=e.clone(n.startPosition,at),c=e.clone(n.endPosition,st),h=l.pickEllipsoid(u,a,et),p=l.pickEllipsoid(c,a,tt);if(!o(h)||!o(p))return i._rotating=!0,void H(i,r,n);if(h=l.worldToCameraCoordinates(h,h),p=l.worldToCameraCoordinates(p,p),o(l.constrainedAxis)){var m=l.constrainedAxis,f=t.mostOrthogonalAxis(m,it);t.cross(f,m,f),t.normalize(f,f);var v=t.cross(m,f,rt),g=t.magnitude(h),_=t.dot(m,h),y=Math.acos(_/g),C=t.multiplyByScalar(m,_,nt);t.subtract(h,C,C),t.normalize(C,C);var E=t.magnitude(p),S=t.dot(m,p),w=Math.acos(S/E),T=t.multiplyByScalar(m,S,ot);t.subtract(p,T,T),t.normalize(T,T);var x=Math.acos(t.dot(C,f));t.dot(C,v)<0&&(x=d.TWO_PI-x);var b=Math.acos(t.dot(T,f));t.dot(T,v)<0&&(b=d.TWO_PI-b);var A,P=x-b;A=t.equalsEpsilon(m,l.position,d.EPSILON2)?l.right:t.cross(m,l.position,it);var I,M=t.cross(m,A,it),D=t.dot(M,t.subtract(h,m,rt)),R=t.dot(M,t.subtract(p,m,rt));I=D>0&&R>0?w-y:D>0&&0>=R?t.dot(l.position,m)>0?-y-w:y+w:y-w,l.rotateRight(P),l.rotateUp(I)}else{t.normalize(h,h),t.normalize(p,p);var O=t.dot(h,p),N=t.cross(h,p,it);if(1>O&&!t.equalsEpsilon(N,t.ZERO,d.EPSILON14)){var L=Math.acos(O);l.rotate(N,L)}}}function j(e,i,r){o(r.distance)&&(r=r.distance);var n=e._ellipsoid,a=e._scene,s=a.camera,l=a.canvas,u=Ue;u.x=l.clientWidth/2,u.y=l.clientHeight/2;var c,h=s.getPickRay(u,Ge),d=n.cartesianToCartographic(s.position,ut).height;d<e._minimumPickingTerrainHeight&&(c=L(e,u,We));var p;p=o(c)?t.distance(h.origin,c):d;var m=t.normalize(s.position,lt);I(e,i,r,e._zoomFactor,p,t.dot(m,s.direction))}function Y(t,i,r){var n=t._scene,a=n.camera;if(m.equals(a.transform,m.IDENTITY)){if(o(r.angleAndHeight)&&(r=r.angleAndHeight),e.equals(i,t._tiltCenterMousePosition)||(t._tiltOnEllipsoid=!1,t._looking=!1),t._looking){var s=t._ellipsoid.geodeticSurfaceNormal(a.position,Et);return void K(t,i,r,s)}var l=t._ellipsoid,u=l.cartesianToCartographic(a.position,Ct);t._tiltOnEllipsoid||u.height>t._minimumCollisionTerrainHeight?(t._tiltOnEllipsoid=!0,X(t,i,r)):Z(t,i,r)}}function X(i,r,n){var a=i._ellipsoid,s=i._scene,c=s.camera,h=.25*i.minimumZoomDistance,p=a.cartesianToCartographic(c.positionWC,St).height;if(!(p-h-1<d.EPSILON3&&n.endPosition.y-n.startPosition.y<0)){var f=s.canvas,v=ct;v.x=f.clientWidth/2,v.y=f.clientHeight/2;var y,C=c.getPickRay(v,ht),E=u.rayEllipsoid(C,a);if(o(E))y=g.getPoint(C,E.start,dt);else{if(!(p>i._minimumTrackBallHeight)){i._looking=!0;var S=i._ellipsoid.geodeticSurfaceNormal(c.position,Et);return K(i,r,n,S),void e.clone(r,i._tiltCenterMousePosition)}var w=u.grazingAltitudeLocation(C,a);if(!o(w))return;var T=a.cartesianToCartographic(w,Ct);T.height=0,y=a.cartographicToCartesian(T,dt)}var x=_.eastNorthUpToFixedFrame(y,a,mt),b=i._globe,A=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var P=m.clone(c.transform,gt);c._setTransform(x),H(i,r,n,t.UNIT_Z),c._setTransform(P),i._globe=b,i._ellipsoid=A;var I=A.maximumRadius;i._rotateFactor=1/I,i._rotateRateRangeAdjustment=I}}function Z(i,r,n){var a,s,c,h=i._ellipsoid,f=i._scene,y=f.camera;if(e.equals(r,i._tiltCenterMousePosition))a=t.clone(i._tiltCenter,dt);else{if(a=L(i,r,dt),!o(a)){if(s=y.getPickRay(r,ht),c=u.rayEllipsoid(s,h),!o(c)){var C=h.cartesianToCartographic(y.position,Ct);if(C.height<=i._minimumTrackBallHeight){i._looking=!0;var E=i._ellipsoid.geodeticSurfaceNormal(y.position,Et);K(i,r,n,E),e.clone(r,i._tiltCenterMousePosition)}return}a=g.getPoint(s,c.start,dt)}e.clone(r,i._tiltCenterMousePosition),t.clone(a,i._tiltCenter)}var S=f.canvas,w=ct;w.x=S.clientWidth/2,w.y=i._tiltCenterMousePosition.y,s=y.getPickRay(w,ht);var T=t.magnitude(a),x=t.fromElements(T,T,T,Qe),b=l.fromCartesian3(x,Je);if(c=u.rayEllipsoid(s,b),o(c)){var A=t.magnitude(s.origin)>T?c.start:c.stop,P=g.getPoint(s,A,pt),I=_.eastNorthUpToFixedFrame(a,h,mt),M=_.eastNorthUpToFixedFrame(P,b,ft),D=i._globe,R=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var O=t.UNIT_Z,N=m.clone(y.transform,gt); -y._setTransform(I);var F=t.cross(P,y.positionWC,vt),B=t.dot(y.rightWC,F);if(H(i,r,n,O,!1,!0),y._setTransform(M),0>B){n.startPosition.y>n.endPosition.y&&(O=void 0);var V=y.constrainedAxis;y.constrainedAxis=void 0,H(i,r,n,O,!0,!1),y.constrainedAxis=V}else H(i,r,n,O,!0,!1);if(o(y.constrainedAxis)){var k=t.cross(y.direction,y.constrainedAxis,vt);t.equalsEpsilon(k,t.ZERO,d.EPSILON6)||(t.dot(k,y.right)<0&&t.negate(k,k),t.cross(k,y.direction,y.up),t.cross(y.direction,y.up,y.right),t.normalize(y.up,y.up),t.normalize(y.right,y.right))}y._setTransform(N),i._globe=D,i._ellipsoid=R;var z=R.maximumRadius;i._rotateFactor=1/z,i._rotateRateRangeAdjustment=z;var U=t.clone(y.positionWC,vt);if(J(i),!t.equals(y.positionWC,U)){y._setTransform(M),y.worldToCameraCoordinatesPoint(U,U);var G=t.magnitudeSquared(U);t.magnitudeSquared(y.position)>G&&(t.normalize(y.position,y.position),t.multiplyByScalar(y.position,Math.sqrt(G),y.position));var W=t.angleBetween(U,y.position),q=t.cross(U,y.position,U);t.normalize(q,q);var j=v.fromAxisAngle(q,W,_t),Y=p.fromQuaternion(j,yt);p.multiplyByVector(Y,y.direction,y.direction),p.multiplyByVector(Y,y.up,y.up),t.cross(y.direction,y.up,y.right),t.cross(y.right,y.direction,y.up),y._setTransform(N)}}}function K(e,i,r,a){var s=e._scene,l=s.camera,u=wt;u.x=r.startPosition.x,u.y=0;var c=Tt;c.x=r.endPosition.x,c.y=0;var h=l.getPickRay(u,xt).direction,p=l.getPickRay(c,bt).direction,m=0,f=t.dot(h,p);1>f&&(m=Math.acos(f)),m=r.startPosition.x>r.endPosition.x?-m:m;var v=e._horizontalRotationAxis;if(o(a)?l.look(a,-m):o(v)?l.look(v,-m):l.lookLeft(m),u.x=0,u.y=r.startPosition.y,c.x=0,c.y=r.endPosition.y,h=l.getPickRay(u,xt).direction,p=l.getPickRay(c,bt).direction,m=0,f=t.dot(h,p),1>f&&(m=Math.acos(f)),m=r.startPosition.y>r.endPosition.y?-m:m,a=n(a,v),o(a)){var g=l.direction,_=t.negate(a,At),y=t.equalsEpsilon(g,a,d.EPSILON2),C=t.equalsEpsilon(g,_,d.EPSILON2);if(y||C)(y&&0>m||C&&m>0)&&l.look(l.right,-m);else{f=t.dot(g,a);var E=d.acosClamped(f);m>0&&m>E&&(m=E-d.EPSILON4),f=t.dot(g,_),E=d.acosClamped(f),0>m&&-m>E&&(m=-E+d.EPSILON4);var S=t.cross(a,g,Pt);l.look(S,m)}}else l.lookUp(m)}function Q(e){P(e,e.enableRotate,e.rotateEventTypes,W,e.inertiaSpin,"_lastInertiaSpinMovement"),P(e,e.enableZoom,e.zoomEventTypes,j,e.inertiaZoom,"_lastInertiaZoomMovement"),P(e,e.enableTilt,e.tiltEventTypes,Y,e.inertiaSpin,"_lastInertiaTiltMovement"),P(e,e.enableLook,e.lookEventTypes,K)}function J(e){if(e.enableCollisionDetection){var i=e._scene,r=i.mode,n=i.globe;if(o(n)&&r!==E.SCENE2D&&r!==E.MORPHING){var a,s,l=i.camera,u=n.ellipsoid,c=i.mapProjection;m.equals(l.transform,m.IDENTITY)||(a=m.clone(l.transform),s=t.magnitude(l.position),l._setTransform(m.IDENTITY));var h=It;r===E.SCENE3D?u.cartesianToCartographic(l.position,h):c.unproject(l.position,h);var d=!1;if(h.height<e._minimumCollisionTerrainHeight){var p=n.getHeight(h);o(p)&&(p+=e.minimumZoomDistance,h.height<p&&(h.height=p,r===E.SCENE3D?u.cartographicToCartesian(h,l.position):c.project(h,l.position),d=!0))}o(a)&&(l._setTransform(a),d&&(t.normalize(l.position,l.position),t.negate(l.position,l.direction),t.multiplyByScalar(l.position,Math.max(s,e.minimumZoomDistance),l.position),t.normalize(l.direction,l.direction),t.cross(l.direction,l.up,l.right),t.cross(l.right,l.direction,l.up)))}}}var $=.4,ee=[],te=new g,ie=new t,re=new e,ne=new t,oe=new e,ae=new t,se=new t,le=new t,ue=new t,ce=new t,he=new g,de=new g,pe=new t,me=new e,fe=new e,ve=new g,ge=new t,_e=new t,ye=new g,Ce=new g,Ee=new t,Se=new t,we=new t,Te=new t,xe=new f(t.ZERO,0),be=new e,Ae=new e,Pe=new e,Ie=new g,Me=new t,De=new t,Re=new m,Oe=new m,Ne=new t,Le=new f(t.ZERO,0),Fe=new t,Be=new r,Ve=new m,ke=new v,ze=new p,Ue=new e,Ge=new g,We=new t,He=new g,qe=new f(t.ZERO,0),je=new t,Ye=new t,Xe=new t,Ze=new r,Ke=new t,Qe=new t,Je=new l,$e=new t,et=i.clone(i.UNIT_W),tt=i.clone(i.UNIT_W),it=new t,rt=new t,nt=new t,ot=new t,at=new e,st=new e,lt=new t,ut=new r,ct=new e,ht=new g,dt=new t,pt=new t,mt=new m,ft=new m,vt=new t,gt=new m,_t=new v,yt=new p,Ct=new r,Et=new t,St=new r,wt=new e,Tt=new e,xt=new g,bt=new g,At=new t,Pt=new t,It=new r;return T.prototype.update=function(){m.equals(this._scene.camera.transform,m.IDENTITY)?(this._globe=this._scene.globe,this._ellipsoid=o(this._globe)?this._globe.ellipsoid:this._scene.mapProjection.ellipsoid):(this._globe=void 0,this._ellipsoid=l.UNIT_SPHERE),this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight*this._scene.terrainExaggeration,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight*this._scene.terrainExaggeration,this._minimumTrackBallHeight=this.minimumTrackBallHeight*this._scene.terrainExaggeration;var e=this._ellipsoid.maximumRadius;this._rotateFactor=1/e,this._rotateRateRangeAdjustment=e;var i=this._scene,r=i.mode;r===E.SCENE2D?N(this):r===E.COLUMBUS_VIEW?(this._horizontalRotationAxis=t.UNIT_Z,U(this)):r===E.SCENE3D&&(this._horizontalRotationAxis=void 0,Q(this)),J(this),this._aggregator.reset()},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),a(this)},T}),i("Shaders/PostProcessFilters/AdditiveBlend",[],function(){"use strict";return"uniform sampler2D u_texture0;\nuniform sampler2D u_texture1;\nuniform vec2 u_center;\nuniform float u_radius;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 color0 = texture2D(u_texture0, v_textureCoordinates);\nvec4 color1 = texture2D(u_texture1, v_textureCoordinates);\nfloat x = length(gl_FragCoord.xy - u_center) / u_radius;\nfloat t = smoothstep(0.5, 0.8, x);\ngl_FragColor = mix(color0 + color1, color0, t);\n}\n"}),i("Shaders/PostProcessFilters/BrightPass",[],function(){"use strict";return"uniform sampler2D u_texture;\nuniform float u_avgLuminance;\nuniform float u_threshold;\nuniform float u_offset;\nvarying vec2 v_textureCoordinates;\nfloat key(float avg)\n{\nfloat guess = 1.5 - (1.5 / (avg * 0.1 + 1.0));\nreturn max(0.0, guess) + 0.1;\n}\nvoid main()\n{\nvec4 color = texture2D(u_texture, v_textureCoordinates);\nvec3 xyz = czm_RGBToXYZ(color.rgb);\nfloat luminance = xyz.r;\nfloat scaledLum = key(u_avgLuminance) * luminance / u_avgLuminance;\nfloat brightLum = max(scaledLum - u_threshold, 0.0);\nfloat brightness = brightLum / (u_offset + brightLum);\nxyz.r = brightness;\ngl_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);\n}\n"}),i("Shaders/PostProcessFilters/GaussianBlur1D",[],function(){"use strict";return"#define SAMPLES 8\nuniform float delta;\nuniform float sigma;\nuniform float direction;\nuniform sampler2D u_texture;\nuniform vec2 u_step;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec2 st = v_textureCoordinates;\nvec2 dir = vec2(1.0 - direction, direction);\nvec3 g;\ng.x = 1.0 / (sqrt(czm_twoPi) * sigma);\ng.y = exp((-0.5 * delta * delta) / (sigma * sigma));\ng.z = g.y * g.y;\nvec4 result = texture2D(u_texture, st) * g.x;\nfor (int i = 1; i < SAMPLES; ++i)\n{\ng.xy *= g.yz;\nvec2 offset = float(i) * dir * u_step;\nresult += texture2D(u_texture, st - offset) * g.x;\nresult += texture2D(u_texture, st + offset) * g.x;\n}\ngl_FragColor = result;\n}\n"}),i("Scene/SunPostProcess",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian4","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/Transforms","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PassState","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/AdditiveBlend","../Shaders/PostProcessFilters/BrightPass","../Shaders/PostProcessFilters/GaussianBlur1D","../Shaders/PostProcessFilters/PassThrough"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S){"use strict";function w(){this._fbo=void 0,this._downSampleFBO1=void 0,this._downSampleFBO2=void 0,this._clearFBO1Command=void 0,this._clearFBO2Command=void 0,this._downSampleCommand=void 0,this._brightPassCommand=void 0,this._blurXCommand=void 0,this._blurYCommand=void 0,this._blendCommand=void 0,this._fullScreenCommand=void 0,this._downSamplePassState=new p,this._downSamplePassState.scissorTest={enable:!0,rectangle:new e},this._upSamplePassState=new p,this._upSamplePassState.scissorTest={enabled:!0,rectangle:new e},this._uCenter=new t,this._uRadius=void 0,this._blurStep=new t}w.prototype.clear=function(e,t){var i=this._clearFBO1Command;r.clone(n(t,r.BLACK),i.color),i.execute(e),i=this._clearFBO2Command,r.clone(n(t,r.BLACK),i.color),i.execute(e)},w.prototype.execute=function(e,t){this._downSampleCommand.execute(e,this._downSamplePassState),this._brightPassCommand.execute(e,this._downSamplePassState),this._blurXCommand.execute(e,this._downSamplePassState),this._blurYCommand.execute(e,this._downSamplePassState),this._fullScreenCommand.framebuffer=t,this._blendCommand.framebuffer=t,this._fullScreenCommand.execute(e),this._blendCommand.execute(e,this._upSamplePassState)};var T=new e,x=new e,b=new i,A=new t,P=new t,I=new l;return w.prototype.update=function(e){var i=e.context,n=e.viewport,a=i.drawingBufferWidth,p=i.drawingBufferHeight,w=this;if(!o(this._downSampleCommand)){this._clearFBO1Command=new h({color:new r}),this._clearFBO2Command=new h({color:new r});var M={};this._downSampleCommand=i.createViewportQuadCommand(S,{uniformMap:M,owner:this}),M={u_avgLuminance:function(){return.5},u_threshold:function(){return.25},u_offset:function(){return.1}},this._brightPassCommand=i.createViewportQuadCommand(C,{uniformMap:M,owner:this});var D=1,R=2;M={delta:function(){return D},sigma:function(){return R},direction:function(){return 0}},this._blurXCommand=i.createViewportQuadCommand(E,{uniformMap:M,owner:this}),M={delta:function(){return D},sigma:function(){return R},direction:function(){return 1}},this._blurYCommand=i.createViewportQuadCommand(E,{uniformMap:M,owner:this}),M={u_center:function(){return w._uCenter},u_radius:function(){return w._uRadius}},this._blendCommand=i.createViewportQuadCommand(y,{uniformMap:M,owner:this}),M={},this._fullScreenCommand=i.createViewportQuadCommand(S,{uniformMap:M,owner:this})}var O=Math.pow(2,Math.ceil(Math.log(a)/Math.log(2))-2),N=Math.pow(2,Math.ceil(Math.log(p)/Math.log(2))-2),L=Math.max(O,N),F=x;F.width=L,F.height=L;var B=this._fbo,V=o(B)&&B.getColorTexture(0)||void 0;if(!o(V)||V.width!==a||V.height!==p){B=B&&B.destroy(),this._downSampleFBO1=this._downSampleFBO1&&this._downSampleFBO1.destroy(),this._downSampleFBO2=this._downSampleFBO2&&this._downSampleFBO2.destroy(),this._blurStep.x=this._blurStep.y=1/L;var k=[new _({context:i,width:a,height:p})];B=i.depthTexture?this._fbo=new d({context:i,colorTextures:k,depthTexture:new _({context:i,width:a,height:p,pixelFormat:u.DEPTH_COMPONENT,pixelDatatype:m.UNSIGNED_SHORT})}):this._fbo=new d({context:i,colorTextures:k,depthRenderbuffer:new f({context:i,format:v.DEPTH_COMPONENT16})}),this._downSampleFBO1=new d({context:i,colorTextures:[new _({context:i,width:L,height:L})]}),this._downSampleFBO2=new d({context:i,colorTextures:[new _({context:i,width:L,height:L})]}),this._clearFBO1Command.framebuffer=this._downSampleFBO1,this._clearFBO2Command.framebuffer=this._downSampleFBO2,this._downSampleCommand.framebuffer=this._downSampleFBO1,this._brightPassCommand.framebuffer=this._downSampleFBO2,this._blurXCommand.framebuffer=this._downSampleFBO1,this._blurYCommand.framebuffer=this._downSampleFBO2;var z=g.fromCache({viewport:F});this._downSampleCommand.uniformMap.u_texture=function(){return B.getColorTexture(0)},this._downSampleCommand.renderState=z,this._brightPassCommand.uniformMap.u_texture=function(){return w._downSampleFBO1.getColorTexture(0)},this._brightPassCommand.renderState=z,this._blurXCommand.uniformMap.u_texture=function(){return w._downSampleFBO2.getColorTexture(0)},this._blurXCommand.uniformMap.u_step=function(){return w._blurStep},this._blurXCommand.renderState=z,this._blurYCommand.uniformMap.u_texture=function(){return w._downSampleFBO1.getColorTexture(0)},this._blurYCommand.uniformMap.u_step=function(){return w._blurStep},this._blurYCommand.renderState=z;var U=T;U.width=a,U.height=p;var G=g.fromCache({viewport:U});this._blendCommand.uniformMap.u_texture0=function(){return B.getColorTexture(0)},this._blendCommand.uniformMap.u_texture1=function(){return w._downSampleFBO2.getColorTexture(0)},this._blendCommand.renderState=G,this._fullScreenCommand.uniformMap.u_texture=function(){return B.getColorTexture(0)},this._fullScreenCommand.renderState=G}var W=i.uniformState,H=W.sunPositionWC,q=W.view,j=W.viewProjection,Y=W.projection,X=l.computeViewportTransformation(n,0,1,I),Z=l.multiplyByPoint(q,H,b),K=c.pointToGLWindowCoordinates(j,X,H,A);Z.x+=s.SOLAR_RADIUS;var Q=c.pointToGLWindowCoordinates(Y,X,Z,Z),J=30*t.magnitude(t.subtract(Q,K,Q))*2,$=P;$.x=J,$.y=J;var ee=this._upSamplePassState.scissorTest.rectangle;return ee.x=Math.max(K.x-.5*$.x,0),ee.y=Math.max(K.y-.5*$.y,0),ee.width=Math.min($.x,a),ee.height=Math.min($.y,p),this._uCenter=t.clone(K,this._uCenter),this._uRadius=.5*Math.max($.x,$.y),X=l.computeViewportTransformation(F,0,1,I),K=c.pointToGLWindowCoordinates(j,X,H,A),$.x*=O/a,$.y*=N/p,ee=this._downSamplePassState.scissorTest.rectangle,ee.x=Math.max(K.x-.5*$.x,0),ee.y=Math.max(K.y-.5*$.y,0),ee.width=Math.min($.x,a),ee.height=Math.min($.y,p),this._downSamplePassState.context=i,this._upSamplePassState.context=i,this._fbo},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){return this._fbo=this._fbo&&this._fbo.destroy(),this._downSampleFBO1=this._downSampleFBO1&&this._downSampleFBO1.destroy(),this._downSampleFBO2=this._downSampleFBO2&&this._downSampleFBO2.destroy(),this._downSampleCommand=this._downSampleCommand&&this._downSampleCommand.shaderProgram&&this._downSampleCommand.shaderProgram.destroy(),this._brightPassCommand=this._brightPassCommand&&this._brightPassCommand.shaderProgram&&this._brightPassCommand.shaderProgram.destroy(),this._blurXCommand=this._blurXCommand&&this._blurXCommand.shaderProgram&&this._blurXCommand.shaderProgram.destroy(),this._blurYCommand=this._blurYCommand&&this._blurYCommand.shaderProgram&&this._blurYCommand.shaderProgram.destroy(),this._blendCommand=this._blendCommand&&this._blendCommand.shaderProgram&&this._blendCommand.shaderProgram.destroy(),this._fullScreenCommand=this._fullScreenCommand&&this._fullScreenCommand.shaderProgram&&this._fullScreenCommand.shaderProgram.destroy(),a(this)},w}),i("Scene/Scene",["../Core/BoundingRectangle","../Core/BoundingSphere","../Core/BoxGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EllipsoidGeometry","../Core/Event","../Core/GeographicProjection","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/getTimestamp","../Core/Intersect","../Core/Interval","../Core/JulianDate","../Core/Math","../Core/Matrix4","../Core/mergeSort","../Core/Occluder","../Core/ShowGeometryInstanceAttribute","../Renderer/ClearCommand","../Renderer/ComputeEngine","../Renderer/Context","../Renderer/ContextLimits","../Renderer/PassState","../Renderer/ShaderProgram","../Renderer/ShaderSource","./Camera","./CreditDisplay","./CullingVolume","./DepthPlane","./DeviceOrientationCameraController","./Fog","./FrameState","./FrustumCommands","./FXAA","./GlobeDepth","./OIT","./OrthographicFrustum","./Pass","./PerformanceDisplay","./PerInstanceColorAppearance","./PerspectiveFrustum","./PerspectiveOffCenterFrustum","./PickDepth","./Primitive","./PrimitiveCollection","./SceneMode","./SceneTransforms","./SceneTransitioner","./ScreenSpaceCameraController","./SunPostProcess","./TweenCollection"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O,N,L,F,B,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae){"use strict";function se(t){t=u(t,u.EMPTY_OBJECT);var i=t.canvas,r=t.contextOptions,n=t.creditContainer,o=new M(i,r);c(n)||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0px 0px 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",i.parentNode.appendChild(n)),this._id=l(),this._frameState=new U(o,new F(n)),this._frameState.scene3DOnly=u(t.scene3DOnly,!1);var s=new R(o);s.viewport=new e,s.viewport.x=0,s.viewport.y=0,s.viewport.width=o.drawingBufferWidth,s.viewport.height=o.drawingBufferHeight,this._passState=s,this._canvas=i,this._context=o,this._computeEngine=new I(o),this._globe=void 0,this._primitives=new ee,this._groundPrimitives=new ee,this._tweens=new ae,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._frustumCommandsList=[],this._overlayCommandList=[],this._pickFramebuffer=void 0,this._useOIT=u(t.orderIndependentTranslucency,!0),this._executeOITFunction=void 0;var h;o.depthTexture&&(h=new H);var d;this._useOIT&&c(h)&&(d=new q(o)),this._globeDepth=h,this._depthPlane=new V,this._oit=d,this._fxaa=new W,this._clearColorCommand=new P({color:new a,stencil:0,owner:this}),this._depthClearCommand=new P({depth:1,owner:this}),this._pickDepths=[],this._debugGlobeDepths=[],this._transitioner=new re(this),this._renderError=new f,this._preRender=new f,this._postRender=new f,this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new f,this.morphComplete=new f,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=a.clone(a.BLACK),this._mode=te.SCENE3D,this._mapProjection=c(t.mapProjection)?t.mapProjection:new v,this._transitioner=new re(this,this._mapProjection.ellipsoid),this.morphTime=1,this.farToNearRatio=1e3,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this._debugFrustumStatistics=void 0,this.debugShowFramesPerSecond=!1,this.debugShowGlobeDepth=!1,this.debugShowDepthFrustum=1,this.fxaa=!0,this.useDepthPicking=!0,this.cameraEventWaitTime=500,this.copyGlobeDepth=!1,this.fog=new z,this._terrainExaggeration=u(t.terrainExaggeration,1),this._performanceDisplay=void 0,this._debugVolume=void 0;var p=new L(this);this._camera=p,this._cameraClone=L.clone(p),this._screenSpaceCameraController=new ne(this),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useFXAA:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0;var m=p.frustum.near,g=p.frustum.far,_=Math.ceil(Math.log(g/m)/Math.log(this.farToNearRatio));pe(m,g,this.farToNearRatio,_,this._frustumCommandsList),de(this,0,S.now()),this.initializeFrame()}function le(e,t){var i=Math.max(Math.abs(e.x),Math.abs(t.x)),r=Math.max(Math.abs(e.y),Math.abs(t.y)),n=Math.max(Math.abs(e.z),Math.abs(t.z));return Math.max(Math.max(i,r),n)}function ue(e,t,i){var r=1/Math.max(1,le(e.position,t.position));return n.multiplyByScalar(e.position,r,ze),n.multiplyByScalar(t.position,r,Ue),n.equalsEpsilon(ze,Ue,i)&&n.equalsEpsilon(e.direction,t.direction,i)&&n.equalsEpsilon(e.up,t.up,i)&&n.equalsEpsilon(e.right,t.right,i)&&T.equalsEpsilon(e.transform,t.transform,i)}function ce(e){var t=e.globe;if(e._mode===te.SCENE3D&&c(t)){var i=t.ellipsoid;return Ge.radius=i.minimumRadius,ke=b.fromBoundingSphere(Ge,e._camera.positionWC,ke)}}function he(e){e.render=!1,e.pick=!1}function de(e,t,i){var r=e._camera,n=e._frameState;n.commandList.length=0,n.mode=e._mode,n.morphTime=e.morphTime,n.mapProjection=e.mapProjection,n.frameNumber=t,n.time=S.clone(i,n.time),n.camera=r,n.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.occluder=ce(e),n.terrainExaggeration=e._terrainExaggeration,he(n.passes)}function pe(e,t,i,r,n){n.length=r;for(var o=0;r>o;++o){var a=Math.max(e,Math.pow(i,o)*e),s=Math.min(t,i*a),l=n[o];c(l)?(l.near=a,l.far=s):l=n[o]=new G(a,s)}}function me(e,t,i){e.debugShowFrustums&&(t.debugOverlappingFrustums=0);for(var r=e._frustumCommandsList,n=r.length,o=0;n>o;++o){var a=r[o],s=a.near,l=a.far;if(!(i.start>l)){if(i.stop<s)break;var u=t instanceof P?Y.OPAQUE:t.pass,h=a.indices[u]++;if(a.commands[u][h]=t,e.debugShowFrustums&&(t.debugOverlappingFrustums|=1<<o),t.executeInClosestFrustum)break}}if(e.debugShowFrustums){var d=e._debugFrustumStatistics.commandsInFrustums;d[t.debugOverlappingFrustums]=c(d[t.debugOverlappingFrustums])?d[t.debugOverlappingFrustums]+1:1,++e._debugFrustumStatistics.totalCommands}}function fe(e,t,i){return c(e)&&(!c(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==C.OUTSIDE&&(!c(i)||!e.boundingVolume.isOccluded(i)))}function ve(e){var t=e._frameState,i=t.camera,r=i.directionWC,n=i.positionWC,o=e._computeCommandList,a=e._overlayCommandList,s=t.commandList;e.debugShowFrustums&&(e._debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});for(var l=e._frustumCommandsList,u=l.length,h=Y.NUMBER_OF_PASSES,d=0;u>d;++d)for(var p=0;h>p;++p)l[d].indices[p]=0;o.length=0,a.length=0;for(var m=Number.MAX_VALUE,f=Number.MIN_VALUE,v=!1,g=t.mode===te.SCENE3D?t.occluder:void 0,_=t.cullingVolume,y=We.planes,C=0;5>C;++C)y[C]=_.planes[C];_=We;var E=e._environmentState;E.isSkyAtmosphereVisible=c(E.skyAtmosphereCommand)&&c(e.globe)&&e.globe._surface._tilesToRender.length>0,E.isSunVisible=fe(E.sunDrawCommand,_,g),E.isMoonVisible=fe(E.moonCommand,_,g);for(var S=s.length,w=0;S>w;++w){var T=s[w],x=T.pass;if(x===Y.COMPUTE)o.push(T);else if(x===Y.OVERLAY)a.push(T);else{var b=T.boundingVolume;if(c(b)){if(!fe(T,_,g))continue;He=b.computePlaneDistances(n,r,He),m=Math.min(m,He.start),f=Math.max(f,He.stop)}else He.start=i.frustum.near,He.stop=i.frustum.far,v=!(T instanceof P);me(e,T,He)}}v?(m=i.frustum.near,f=i.frustum.far):(m=Math.min(Math.max(m,i.frustum.near),i.frustum.far),f=Math.max(Math.min(f,i.frustum.far),m));var A=e.farToNearRatio,I=Math.ceil(Math.log(f/m)/Math.log(A));m!==Number.MAX_VALUE&&(I!==u||0!==l.length&&(m<l[0].near||f>l[u-1].far))&&(pe(m,f,A,I,l),ve(e))}function ge(e){var t={},i=e.vertexAttributes;for(var r in i)i.hasOwnProperty(r)&&(t[r]=i[r].index);return t}function _e(e,t,i){var r=t.context,n=u(i,e.shaderProgram),o=n.fragmentShaderSource.clone();o.sources=o.sources.map(function(e){return e=N.replaceMain(e,"czm_Debug_main")});var s="void main() \n{ \n czm_Debug_main(); \n";if(t.debugShowCommands){c(e._debugColor)||(e._debugColor=a.fromRandom());var l=e._debugColor;s+=" gl_FragColor.rgb *= vec3("+l.red+", "+l.green+", "+l.blue+"); \n"}if(t.debugShowFrustums){var h=1&e.debugOverlappingFrustums?"1.0":"0.0",d=2&e.debugOverlappingFrustums?"1.0":"0.0",p=4&e.debugOverlappingFrustums?"1.0":"0.0";s+=" gl_FragColor.rgb *= vec3("+h+", "+d+", "+p+"); \n"}s+="}",o.sources.push(s);var m=ge(n);return O.fromCache({context:r,vertexShaderSource:n.vertexShaderSource,fragmentShaderSource:o,attributeLocations:m})}function ye(e,t,i,r,n){if(c(e.shaderProgram)||c(n)){var o=_e(e,t,n);e.execute(t.context,i,r,o),o.destroy()}}function Ce(e,t,r,o,a,l,u){if((!c(t.debugCommandFilter)||t.debugCommandFilter(e))&&(t.debugShowCommands||t.debugShowFrustums?ye(e,t,o,a,l):e.execute(r,o,a,l),e.debugShowBoundingVolume&&c(e.boundingVolume))){var h=t._frameState,d=e.boundingVolume;c(t._debugVolume)&&t._debugVolume.destroy();var p,f=n.clone(d.center);if(h.mode!==te.SCENE3D){f=T.multiplyByPoint(qe,f,f);var v=h.mapProjection,y=v.unproject(f);f=v.ellipsoid.cartographicToCartesian(y)}if(c(d.radius)){var C=d.radius;p=_.toWireframe(m.createGeometry(new m({radii:new n(C,C,C),vertexFormat:Z.FLAT_VERTEX_FORMAT}))),t._debugVolume=new $({geometryInstances:new g({geometry:p,modelMatrix:T.multiplyByTranslation(T.IDENTITY,f,new T),attributes:{color:new s(1,0,0,1)}}),appearance:new Z({flat:!0,translucent:!1}),asynchronous:!1})}else{var E=d.halfAxes;p=_.toWireframe(i.createGeometry(i.fromDimensions({dimensions:new n(2,2,2),vertexFormat:Z.FLAT_VERTEX_FORMAT}))),t._debugVolume=new $({geometryInstances:new g({geometry:p,modelMatrix:T.fromRotationTranslation(E,f,new T),attributes:{color:new s(1,0,0,1)}}),appearance:new Z({flat:!0,translucent:!1}),asynchronous:!1})}var S=h.commandList,w=h.commandList=[];t._debugVolume.update(h);var x;c(u)&&(x=o.framebuffer,o.framebuffer=u),w[0].execute(r,o),c(x)&&(o.framebuffer=x),h.commandList=S}}function Ee(e,t,i){return t.boundingVolume.distanceSquaredTo(i)-e.boundingVolume.distanceSquaredTo(i)}function Se(e,t,i,r){var n=e.context;x(r,Ee,e._camera.positionWC);for(var o=r.length,a=0;o>a;++a)t(r[a],e,n,i)}function we(e,t){var i=e._debugGlobeDepths[t];return!c(i)&&e.context.depthTexture&&(i=new H,e._debugGlobeDepths[t]=i),i}function Te(e,t){var i=e._pickDepths[t];return c(i)||(i=new J,e._pickDepths[t]=i),i}function xe(e,t){var i,r=e._camera,n=e.context,o=n.uniformState;i=c(r.frustum.fov)?r.frustum.clone(je):c(r.frustum.infiniteProjectionMatrix)?r.frustum.clone(Ye):r.frustum.clone(Xe),i.near=r.frustum.near,i.far=r.frustum.far,o.updateFrustum(i);var a=e._environmentState,s=a.skyBoxCommand;if(c(s)&&Ce(s,e,n,t),a.isSkyAtmosphereVisible&&Ce(a.skyAtmosphereCommand,e,n,t),a.isSunVisible&&(a.sunDrawCommand.execute(n,t),e.sunBloom&&!e._useWebVR)){var l;l=a.useGlobeDepthFramebuffer?e._globeDepth.framebuffer:a.useFXAA?e._fxaa.getColorFramebuffer():a.originalFramebuffer,e._sunPostProcess.execute(n,l),t.framebuffer=l}a.isMoonVisible&&a.moonCommand.execute(n,t);var u;a.useOIT?(c(e._executeOITFunction)||(e._executeOITFunction=function(e,t,i,r){e._oit.executeCommands(e,t,i,r)}),u=e._executeOITFunction):u=Se;for(var h,d=a.clearGlobeDepth,p=a.clearGlobeDepth,m=e._depthClearCommand,f=e._depthPlane,v=e._frustumCommandsList,g=v.length,_=0;g>_;++_){var y=g-_-1,C=v[y];i.near=0!==y?C.near*Ve:C.near,i.far=C.far;var E,S=e.debugShowGlobeDepth?we(e,y):e._globeDepth;e.debugShowGlobeDepth&&c(S)&&a.useGlobeDepthFramebuffer&&(E=t.framebuffer,t.framebuffer=S.framebuffer),o.updateFrustum(i),m.execute(n,t);var w=C.commands[Y.GLOBE],T=C.indices[Y.GLOBE];for(h=0;T>h;++h)Ce(w[h],e,n,t);for(c(S)&&a.useGlobeDepthFramebuffer&&(e.copyGlobeDepth||e.debugShowGlobeDepth)&&(S.update(n),S.executeCopyDepth(n,t)),e.debugShowGlobeDepth&&c(S)&&a.useGlobeDepthFramebuffer&&(t.framebuffer=E),w=C.commands[Y.GROUND],T=C.indices[Y.GROUND],h=0;T>h;++h)Ce(w[h],e,n,t);d&&(m.execute(n,t),p&&f.execute(n,t));for(var x=Y.GROUND+1,b=Y.TRANSLUCENT,A=x;b>A;++A)for(w=C.commands[A],T=C.indices[A],h=0;T>h;++h)Ce(w[h],e,n,t);if(0!==y&&(i.near=C.near,o.updateFrustum(i)),w=C.commands[Y.TRANSLUCENT],w.length=C.indices[Y.TRANSLUCENT],u(e,Ce,t,w),c(S)&&a.useGlobeDepthFramebuffer&&e.useDepthPicking){var P=Te(e,y);P.update(n,S.framebuffer.depthStencilTexture),P.executeCopyDepth(n,t)}}}function be(e){var t=e._environmentState.sunComputeCommand;c(t)&&t.execute(e._computeEngine);for(var i=e._computeCommandList,r=i.length,n=0;r>n;++n)i[n].execute(e._computeEngine)}function Ae(e,t){for(var i=e.context,r=e._overlayCommandList,n=r.length,o=0;n>o;++o)r[o].execute(i,t)}function Pe(e,t){var i=e._context,r=t.viewport,o=e._frameState,a=o.camera;if(e._useWebVR)if(o.mode!==te.SCENE2D){r.x=0,r.y=0,r.width=.5*i.drawingBufferWidth,r.height=i.drawingBufferHeight;var s=L.clone(a,e._cameraVR),l=a.frustum.near,u=5*l,c=u/30,h=n.multiplyByScalar(s.right,.5*c,Ze);a.frustum.aspectRatio=r.width/r.height;var d=.5*c*l/u;n.add(s.position,h,a.position),a.frustum.xOffset=d,xe(e,t),r.x=t.viewport.width,n.subtract(s.position,h,a.position),a.frustum.xOffset=-d,xe(e,t),L.clone(s,a)}else{r.x=0,r.y=0,r.width=.5*i.drawingBufferWidth,r.height=i.drawingBufferHeight;var p=a.frustum.top;a.frustum.top=a.frustum.right*(r.height/r.width),a.frustum.bottom=-a.frustum.top,xe(e,t),r.x=t.viewport.width,xe(e,t),a.frustum.top=p,a.frustum.bottom=-p}else r.x=0,r.y=0,r.width=i.drawingBufferWidth,r.height=i.drawingBufferHeight,xe(e,t)}function Ie(e){var t=e._frameState,i=e._environmentState,r=t.passes.render;i.skyBoxCommand=r&&c(e.skyBox)?e.skyBox.update(t):void 0,i.skyAtmosphereCommand=r&&c(e.skyAtmosphere)?e.skyAtmosphere.update(t):void 0;var n=r&&c(e.sun)?e.sun.update(e):void 0;i.sunDrawCommand=c(n)?n.drawCommand:void 0,i.sunComputeCommand=c(n)?n.computeCommand:void 0,i.moonCommand=r&&c(e.moon)?e.moon.update(t):void 0;var o=i.clearGlobeDepth=c(e.globe)&&(!e.globe.depthTestAgainstTerrain||e.mode===te.SCENE2D),a=i.useDepthPlane=o&&e.mode===te.SCENE3D;a&&e._depthPlane.update(t)}function Me(e){var t=e._frameState;e._globe&&e._globe.update(t),e._groundPrimitives.update(t),e._primitives.update(t)}function De(e,t,i,r){var n=e._context,o=e._environmentState;o.originalFramebuffer=t.framebuffer,c(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!e._useWebVR?e._sunPostProcess=new oe:c(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!c(e.sun)&&c(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);var s=e._clearColorCommand;a.clone(i,s.color),s.execute(n,t);var l=o.useGlobeDepthFramebuffer=!r&&c(e._globeDepth);l&&(e._globeDepth.update(n),e._globeDepth.clear(n,t,i));for(var u=!1,h=e._frustumCommandsList,d=h.length,p=0;d>p;++p)if(h[p].indices[Y.TRANSLUCENT]>0){u=!0;break}var m=o.useOIT=!r&&u&&c(e._oit)&&e._oit.isSupported();m&&(e._oit.update(n,e._globeDepth.framebuffer),e._oit.clear(n,t,i),o.useOIT=e._oit.isSupported());var f=o.useFXAA=!r&&e.fxaa;f&&(e._fxaa.update(n),e._fxaa.clear(n,t,i)),o.isSunVisible&&e.sunBloom&&!e._useWebVR?t.framebuffer=e._sunPostProcess.update(t):l?t.framebuffer=e._globeDepth.framebuffer:f&&(t.framebuffer=e._fxaa.getColorFramebuffer()),c(t.framebuffer)&&s.execute(n,t)}function Re(e,t){var i=e._context,r=e._environmentState,n=r.useGlobeDepthFramebuffer;if(e.debugShowGlobeDepth&&n){var o=we(e,e.debugShowDepthFrustum-1);o.executeDebugGlobeDepth(i,t)}if(e.debugShowPickDepth&&n){var a=Te(e,e.debugShowDepthFrustum-1);a.executeDebugPickDepth(i,t)}var s=r.useOIT,l=r.useFXAA;s&&(t.framebuffer=l?e._fxaa.getColorFramebuffer():void 0,e._oit.execute(i,t)),l&&(!s&&n&&(t.framebuffer=e._fxaa.getColorFramebuffer(),e._globeDepth.executeCopyColor(i,t)),t.framebuffer=r.originalFramebuffer,e._fxaa.execute(i,t)),s||l||!n||(t.framebuffer=r.originalFramebuffer,e._globeDepth.executeCopyColor(i,t))}function Oe(e){for(var t=e.afterRender,i=0,r=t.length;r>i;++i)t[i]();t.length=0}function Ne(e,t){c(t)||(t=S.now());var i=e._camera;ue(i,e._cameraClone,w.EPSILON6)?e._cameraStartFired&&y()-e._cameraMovedTime>e.cameraEventWaitTime&&(i.moveEnd.raiseEvent(),e._cameraStartFired=!1):(e._cameraStartFired||(i.moveStart.raiseEvent(),e._cameraStartFired=!0),e._cameraMovedTime=y(),L.clone(i,e._cameraClone)),e._preRender.raiseEvent(e,t);var r=e.context,n=r.uniformState,o=e._frameState,s=w.incrementWrap(o.frameNumber,15e6,1);de(e,s,t),o.passes.render=!0,o.creditDisplay.beginFrame(),e.fog.update(o),n.update(o),e._computeCommandList.length=0,e._overlayCommandList.length=0;var l=e._passState;l.framebuffer=void 0,l.blendingEnabled=void 0,l.scissorTest=void 0;var h=l.viewport;if(h.x=0,h.y=0,h.width=r.drawingBufferWidth,h.height=r.drawingBufferHeight,Ie(e),Me(e),ve(e),De(e,l,u(e.backgroundColor,a.BLACK)),be(e),Pe(e,l),Re(e,l),Ae(e,l),o.creditDisplay.endFrame(),e.debugShowFramesPerSecond){if(!c(e._performanceDisplay)){var d=document.createElement("div");d.className="cesium-performanceDisplay-defaultContainer";var p=e._canvas.parentNode;p.appendChild(d);var m=new X({container:d});e._performanceDisplay=m,e._performanceContainer=d}e._performanceDisplay.update()}else c(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer));r.endFrame(),Oe(o),e._postRender.raiseEvent(e,t)}function Le(e,t,i,r){var o=e._camera,a=o.frustum,s=e._passState.viewport,l=2*(t.x-s.x)/s.width-1;l*=.5*(a.right-a.left);var u=2*(s.height-t.y-s.y)/s.height-1; -u*=.5*(a.top-a.bottom);var c=T.clone(o.transform,et);o._setTransform(T.IDENTITY);var h=n.clone(o.position,Qe);n.multiplyByScalar(o.right,l,Je),n.add(Je,h,h),n.multiplyByScalar(o.up,u,Je),n.add(Je,h,h),o._setTransform(c),n.fromElements(h.z,h.x,h.y,h);var d=a.getPixelDimensions(s.width,s.height,1,$e),p=Ke;return p.right=.5*d.x,p.left=-p.right,p.top=.5*d.y,p.bottom=-p.top,p.near=a.near,p.far=a.far,p.computeCullingVolume(h,o.directionWC,o.upWC)}function Fe(e,t,i,r){var n=e._camera,o=n.frustum,a=o.near,s=Math.tan(.5*o.fovy),l=o.aspectRatio*s,u=e._passState.viewport,c=2*(t.x-u.x)/u.width-1,h=2*(u.height-t.y-u.y)/u.height-1,d=c*a*l,p=h*a*s,m=o.getPixelDimensions(u.width,u.height,1,$e),f=m.x*i*.5,v=m.y*r*.5,g=tt;return g.top=p+v,g.bottom=p-v,g.right=d+f,g.left=d-f,g.near=a,g.far=o.far,g.computeCullingVolume(n.positionWC,n.directionWC,n.upWC)}function Be(e,t,i,r){return e._mode===te.SCENE2D?Le(e,t,i,r):Fe(e,t,i,r)}var Ve=.99;h(se.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return D.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return D.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._camera}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},frameState:{get:function(){return this._frameState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){return this.globe.imageryLayers}},terrainProvider:{get:function(){return this.globe.terrainProvider},set:function(e){this.globe.terrainProvider=e}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return c(this._oit)}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===te.SCENE2D?this.morphTo2D(0):e===te.SCENE3D?this.morphTo3D(0):e===te.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},numberOfFrustums:{get:function(){return this._frustumCommandsList.length}},terrainExaggeration:{get:function(){return this._terrainExaggeration}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new L(this),c(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new k(this)),this._aspectRatioVR=this._camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._camera.frustum.aspectRatio=this._aspectRatioVR,this._camera.frustum.xOffset=0)}}});var ke,ze=new n,Ue=new n,Ge=new t,We=new B,He=new E,qe=new T(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);qe=T.inverseTransformation(qe,qe);var je=new K,Ye=new Q,Xe=new j;se.prototype.initializeFrame=function(){120===this._shaderFrameCount++&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms()),this._tweens.update(),this._camera.update(this._mode),this._screenSpaceCameraController.update(),c(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update()};var Ze=new n;se.prototype.render=function(e){try{Ne(this,e)}catch(t){if(this._renderError.raiseEvent(this,t),this.rethrowRenderErrors)throw t}},se.prototype.clampLineWidth=function(e){return Math.max(D.minimumAliasedLineWidth,Math.min(e,D.maximumAliasedLineWidth))};var Ke=new j,Qe=new n,Je=new n,$e=new r,et=new T,tt=new Q,it=3,rt=3,nt=new e(0,0,it,rt),ot=new a(0,0,0,0),at=new r;se.prototype.pick=function(e){var t=this._context,i=t.uniformState,r=this._frameState,n=ie.transformWindowToDrawingBuffer(this,e,at);c(this._pickFramebuffer)||(this._pickFramebuffer=t.createPickFramebuffer()),de(this,r.frameNumber,r.time),r.cullingVolume=Be(this,n,it,rt),r.passes.pick=!0,i.update(r),nt.x=n.x-.5*(it-1),nt.y=this.drawingBufferHeight-n.y-.5*(rt-1);var o=this._pickFramebuffer.begin(nt);Me(this),ve(this),De(this,o,ot,!0),xe(this,o),Re(this,o);var a=this._pickFramebuffer.end(nt);return t.endFrame(),Oe(r),a};var st=new o,lt=new o(1,1/255,1/65025,1/160581375);return se.prototype.pickPosition=function(e,t){if(this.useDepthPicking){var i=this._context,r=i.uniformState,n=ie.transformWindowToDrawingBuffer(this,e,at);n.y=this.drawingBufferHeight-n.y;var a,s=this._camera;c(s.frustum.fov)?a=s.frustum.clone(je):c(s.frustum.infiniteProjectionMatrix)&&(a=s.frustum.clone(Ye));for(var l=this.numberOfFrustums,u=0;l>u;++u){var h=Te(this,u),d=i.readPixels({x:n.x,y:n.y,width:1,height:1,framebuffer:h.framebuffer}),p=o.unpack(d,0,st);o.divideByScalar(p,255,p);var m=o.dot(p,lt);if(m>0&&1>m){var f=this._frustumCommandsList[u];return a.near=f.near*(0!==u?Ve:1),a.far=f.far,r.updateFrustum(a),ie.drawingBufferToWgs84Coordinates(this,n,m,t)}}}},se.prototype.drillPick=function(e,t){var i,r,n=[],o=[],a=[];c(t)||(t=Number.MAX_VALUE);for(var s=this.pick(e);c(s)&&c(s.primitive)&&(n.push(s),!(0>=--t));){var l=s.primitive,u=!1;"function"==typeof l.getGeometryInstanceAttributes&&c(s.id)&&(r=l.getGeometryInstanceAttributes(s.id),c(r)&&c(r.show)&&(u=!0,r.show=A.toValue(!1,r.show),a.push(r))),u||(l.show=!1,o.push(l)),s=this.pick(e)}for(i=0;i<o.length;++i)o[i].show=!0;for(i=0;i<a.length;++i)r=a[i],r.show=A.toValue(!0,r.show);return n},se.prototype.completeMorph=function(){this._transitioner.completeMorph()},se.prototype.morphTo2D=function(e){var t,i=this.globe;t=c(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=u(e,2),this._transitioner.morphTo2D(e,t)},se.prototype.morphToColumbusView=function(e){var t,i=this.globe;t=c(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=u(e,2),this._transitioner.morphToColumbusView(e,t)},se.prototype.morphTo3D=function(e){var t,i=this.globe;t=c(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=u(e,2),this._transitioner.morphTo3D(e,t)},se.prototype.isDestroyed=function(){return!1},se.prototype.destroy=function(){return this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._pickFramebuffer=this._pickFramebuffer&&this._pickFramebuffer.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner.destroy(),c(this._globeDepth)&&this._globeDepth.destroy(),c(this._oit)&&this._oit.destroy(),this._fxaa.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay.destroy(),c(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),d(this)},se}),i("Scene/SingleTileImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadImage","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../ThirdParty/when"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(r){function n(e){E._image=e,E._tileWidth=e.width,E._tileHeight=e.height,E._ready=!0,E._readyPromise.resolve(!0),c.handleSuccess(E._errorEvent)}function d(e){var t="Failed to load image "+_+".";C=c.handleError(C,E,E._errorEvent,t,0,0,0,p,e),E._readyPromise.reject(new u(t))}function p(){h(s(_),n,d)}r=t(r,{});var m=r.url;this._url=m;var f=r.proxy;this._proxy=f;var v=t(r.rectangle,l.MAX_VALUE),g=new a({rectangle:v,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:r.ellipsoid});this._tilingScheme=g,this._image=void 0,this._texture=void 0,this._tileWidth=0,this._tileHeight=0,this._errorEvent=new o,this._ready=!1,this._readyPromise=h.defer();var _=m;i(f)&&(_=f.getURL(_));var y=r.credit;"string"==typeof y&&(y=new e(y)),this._credit=y;var C,E=this;p()}return r(d.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),d.prototype.getTileCredits=function(e,t,i){},d.prototype.requestImage=function(e,t,i){return this._image},d.prototype.pickFeatures=function(){},d}),i("Shaders/SkyAtmosphereFS",[],function(){"use strict";return"const float g = -0.95;\nconst float g2 = g * g;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\nvarying vec3 v_toCamera;\nvarying vec3 v_positionEC;\nvoid main (void)\n{\nfloat fCos = dot(czm_sunDirectionWC, normalize(v_toCamera)) / length(v_toCamera);\nfloat fRayleighPhase = 0.75 * (1.0 + fCos * fCos);\nfloat fMiePhase = 1.5 * ((1.0 - g2) / (2.0 + g2)) * (1.0 + fCos * fCos) / pow(1.0 + g2 - 2.0 * g * fCos, 1.5);\nconst float fExposure = 2.0;\nvec3 rgb = fRayleighPhase * v_rayleighColor + fMiePhase * v_mieColor;\nrgb = vec3(1.0) - exp(-fExposure * rgb);\nfloat l = czm_luminance(rgb);\ngl_FragColor = vec4(rgb, min(smoothstep(0.0, 0.1, l), 1.0) * smoothstep(0.0, 1.0, czm_morphTime));\n}\n"}),i("Shaders/SkyAtmosphereVS",[],function(){"use strict";return"attribute vec4 position;\nuniform float fCameraHeight;\nuniform float fCameraHeight2;\nuniform float fOuterRadius;\nuniform float fOuterRadius2;\nuniform float fInnerRadius;\nuniform float fScale;\nuniform float fScaleDepth;\nuniform float fScaleOverScaleDepth;\nconst float Kr = 0.0025;\nconst float fKr4PI = Kr * 4.0 * czm_pi;\nconst float Km = 0.0015;\nconst float fKm4PI = Km * 4.0 * czm_pi;\nconst float ESun = 15.0;\nconst float fKmESun = Km * ESun;\nconst float fKrESun = Kr * ESun;\nconst vec3 v3InvWavelength = vec3(\n5.60204474633241,\n9.473284437923038,\n19.643802610477206);\nconst float rayleighScaleDepth = 0.25;\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\nvarying vec3 v_toCamera;\nfloat scale(float fCos)\n{\nfloat x = 1.0 - fCos;\nreturn fScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nvoid main(void)\n{\nvec3 v3Pos = position.xyz;\nvec3 v3Ray = v3Pos - czm_viewerPositionWC;\nfloat fFar = length(v3Ray);\nv3Ray /= fFar;\n#ifdef SKY_FROM_SPACE\nfloat B = 2.0 * dot(czm_viewerPositionWC, v3Ray);\nfloat C = fCameraHeight2 - fOuterRadius2;\nfloat fDet = max(0.0, B*B - 4.0 * C);\nfloat fNear = 0.5 * (-B - sqrt(fDet));\nvec3 v3Start = czm_viewerPositionWC + v3Ray * fNear;\nfFar -= fNear;\nfloat fStartAngle = dot(v3Ray, v3Start) / fOuterRadius;\nfloat fStartDepth = exp(-1.0 / fScaleDepth);\nfloat fStartOffset = fStartDepth*scale(fStartAngle);\n#else\nvec3 v3Start = czm_viewerPositionWC;\nfloat fHeight = length(v3Start);\nfloat fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fCameraHeight));\nfloat fStartAngle = dot(v3Ray, v3Start) / fHeight;\nfloat fStartOffset = fDepth*scale(fStartAngle);\n#endif\nfloat fSampleLength = fFar / fSamples;\nfloat fScaledLength = fSampleLength * fScale;\nvec3 v3SampleRay = v3Ray * fSampleLength;\nvec3 v3SamplePoint = v3Start + v3SampleRay * 0.5;\nvec3 v3FrontColor = vec3(0.0, 0.0, 0.0);\nfor(int i=0; i<nSamples; i++)\n{\nfloat fHeight = length(v3SamplePoint);\nfloat fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fHeight));\nvec3 lightPosition = normalize(czm_viewerPositionWC);\nfloat fLightAngle = dot(lightPosition, v3SamplePoint) / fHeight;\nfloat fCameraAngle = dot(v3Ray, v3SamplePoint) / fHeight;\nfloat fScatter = (fStartOffset + fDepth*(scale(fLightAngle) - scale(fCameraAngle)));\nvec3 v3Attenuate = exp(-fScatter * (v3InvWavelength * fKr4PI + fKm4PI));\nv3FrontColor += v3Attenuate * (fDepth * fScaledLength);\nv3SamplePoint += v3SampleRay;\n}\nv_mieColor = v3FrontColor * fKmESun;\nv_rayleighColor = v3FrontColor * (v3InvWavelength * fKrESun);\nv_toCamera = czm_viewerPositionWC - v3Pos;\ngl_Position = czm_modelViewProjection * position;\n}\n"}),i("Scene/SkyAtmosphere",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Ellipsoid","../Core/EllipsoidGeometry","../Core/GeometryPipeline","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/SkyAtmosphereFS","../Shaders/SkyAtmosphereVS","./BlendingState","./CullFace","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y){"use strict";function C(i){i=t(i,o.WGS84),this.show=!0,this._ellipsoid=i,this._command=new c({owner:this}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._fCameraHeight=void 0,this._fCameraHeight2=void 0,this._outerRadius=e.maximumComponent(e.multiplyByScalar(i.radii,1.025,new e));var r=i.maximumRadius,n=.25,a=this;this._command.uniformMap={fCameraHeight:function(){return a._fCameraHeight},fCameraHeight2:function(){return a._fCameraHeight2},fOuterRadius:function(){return a._outerRadius},fOuterRadius2:function(){return a._outerRadius*a._outerRadius},fInnerRadius:function(){return r},fScale:function(){return 1/(a._outerRadius-r)},fScaleDepth:function(){return n},fScaleOverScaleDepth:function(){return 1/(a._outerRadius-r)/n}}}return r(C.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),C.prototype.update=function(t){if(this.show&&(t.mode===y.SCENE3D||t.mode===y.MORPHING)&&t.passes.render){var r=this._command;if(!i(r.vertexArray)){var n=t.context,o=a.createGeometry(new a({radii:e.multiplyByScalar(this._ellipsoid.radii,1.025,new e),slicePartitions:256,stackPartitions:256,vertexFormat:l.POSITION_ONLY}));r.vertexArray=m.fromGeometry({context:n,geometry:o,attributeLocations:s.createAttributeLocations(o),bufferUsage:u.STATIC_DRAW}),r.renderState=h.fromCache({cull:{enabled:!0,face:_.FRONT},blending:g.ALPHA_BLEND});var c=new p({defines:["SKY_FROM_SPACE"],sources:[v]});this._spSkyFromSpace=d.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:f}),c=new p({defines:["SKY_FROM_ATMOSPHERE"],sources:[v]}),this._spSkyFromAtmosphere=d.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:f})}var C=t.camera.positionWC;return this._fCameraHeight2=e.magnitudeSquared(C),this._fCameraHeight=Math.sqrt(this._fCameraHeight2),this._fCameraHeight>this._outerRadius?r.shaderProgram=this._spSkyFromSpace:r.shaderProgram=this._spSkyFromAtmosphere,r}},C.prototype.isDestroyed=function(){return!1},C.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyFromSpace=this._spSkyFromSpace&&this._spSkyFromSpace.destroy(),this._spSkyFromAtmosphere=this._spSkyFromAtmosphere&&this._spSkyFromAtmosphere.destroy(),n(this)},C}),i("Shaders/SkyBoxFS",[],function(){"use strict";return"uniform samplerCube u_cubeMap;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 rgb = textureCube(u_cubeMap, normalize(v_texCoord)).rgb;\ngl_FragColor = vec4(rgb, czm_morphTime);\n}\n"}),i("Shaders/SkyBoxVS",[],function(){"use strict";return"attribute vec3 position;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\ngl_Position = czm_projection * vec4(p, 1.0);\nv_texCoord = position.xyz;\n}\n"}),i("Scene/SkyBox",["../Core/BoxGeometry","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/GeometryPipeline","../Core/Matrix4","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/CubeMap","../Renderer/DrawCommand","../Renderer/loadCubeMap","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/VertexArray","../Shaders/SkyBoxFS","../Shaders/SkyBoxVS","./BlendingState","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y){"use strict";function C(e){this.sources=e.sources,this._sources=void 0,this.show=i(e.show,!0),this._command=new h({modelMatrix:s.clone(s.IDENTITY),owner:this}),this._cubeMap=void 0}return C.prototype.update=function(i){if(this.show&&(i.mode===y.SCENE3D||i.mode===y.MORPHING)&&i.passes.render){var n=i.context;if(this._sources!==this.sources){this._sources=this.sources;var o=this.sources;"string"==typeof o.positiveX?d(n,this._sources).then(function(e){h._cubeMap=h._cubeMap&&h._cubeMap.destroy(),h._cubeMap=e}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new c({context:n,source:o}))}var s=this._command;if(!r(s.vertexArray)){var h=this;s.uniformMap={u_cubeMap:function(){return h._cubeMap}};var C=e.createGeometry(e.fromDimensions({dimensions:new t(2,2,2),vertexFormat:l.POSITION_ONLY})),E=a.createAttributeLocations(C);s.vertexArray=f.fromGeometry({context:n,geometry:C,attributeLocations:E,bufferUsage:u.STATIC_DRAW}),s.shaderProgram=m.fromCache({context:n,vertexShaderSource:g,fragmentShaderSource:v,attributeLocations:E}),s.renderState=p.fromCache({blending:_.ALPHA_BLEND})}if(r(this._cubeMap))return s}},C.prototype.isDestroyed=function(){return!1},C.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),n(this)},C}),i("Shaders/SunFS",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),i("Shaders/SunTextureFS",[],function(){"use strict";return"uniform float u_glowLengthTS;\nuniform float u_radiusTS;\nvarying vec2 v_textureCoordinates;\nvec2 rotate(vec2 p, vec2 direction)\n{\nreturn vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x);\n}\nvec4 addBurst(vec2 position, vec2 direction)\n{\nvec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);\nfloat radius = length(rotatedPosition);\nfloat burst = 1.0 - smoothstep(0.0, 0.55, radius);\nreturn vec4(burst);\n}\nvoid main()\n{\nvec2 position = v_textureCoordinates - vec2(0.5);\nfloat radius = length(position);\nfloat surface = step(radius, u_radiusTS);\nvec4 color = vec4(1.0, 1.0, surface + 0.2, surface);\nfloat glow = 1.0 - smoothstep(0.0, 0.55, radius);\ncolor.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75;\nvec4 burst = vec4(0.0);\nburst += 0.4 * addBurst(position, vec2(0.38942, 0.92106));\nburst += 0.4 * addBurst(position, vec2(0.99235, 0.12348));\nburst += 0.4 * addBurst(position, vec2(0.60327, -0.79754));\nburst += 0.3 * addBurst(position, vec2(0.31457, 0.94924));\nburst += 0.3 * addBurst(position, vec2(0.97931, 0.20239));\nburst += 0.3 * addBurst(position, vec2(0.66507, -0.74678));\ncolor += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;\ngl_FragColor = clamp(color, vec4(0.0), vec4(1.0));\n}\n"}),i("Shaders/SunVS",[],function(){"use strict";return"attribute vec2 direction;\nuniform float u_size;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 position;\nif (czm_morphTime == 1.0)\n{\nposition = vec4(czm_sunPositionWC, 1.0);\n}\nelse\n{\nposition = vec4(czm_sunPositionColumbusView.zxy, 1.0);\n}\nvec4 positionEC = czm_view * position;\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nvec2 halfSize = vec2(u_size * 0.5);\nhalfSize *= ((direction * 2.0) - 1.0);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);\nv_textureCoordinates = direction;\n}\n"}),i("Scene/Sun",["../Core/BoundingRectangle","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/ComponentDatatype","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/IndexDatatype","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/PrimitiveType","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ClearCommand","../Renderer/ComputeCommand","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/Texture","../Renderer/VertexArray","../Shaders/SunFS","../Shaders/SunTextureFS","../Shaders/SunVS","./BlendingState","./SceneMode","./SceneTransforms"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M){"use strict";function D(){this.show=!0,this._drawCommand=new y({primitiveType:m.TRIANGLES,boundingVolume:new t,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new t,this._boundingVolume2D=new t,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1;var e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}l(D.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var R=new i,O=new i,N=new n,L=new n;return D.prototype.update=function(e){var n=e._passState,o=e.frameState,l=e.context;if(this.show){var u=o.mode;if(u!==I.SCENE2D&&u!==I.MORPHING&&o.passes.render){var m=n.viewport.width,g=n.viewport.height;if(!s(this._texture)||m!==this._drawingBufferWidth||g!==this._drawingBufferHeight||this._glowFactorDirty){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=m,this._drawingBufferHeight=g,this._glowFactorDirty=!1;var y=Math.max(m,g);y=Math.pow(2,Math.ceil(Math.log(y)/Math.log(2))-2),this._texture=new w({context:l,width:y,height:y,pixelFormat:p.RGBA}),this._glowLengthTS=5*this._glowFactor,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;var C=this,D={u_glowLengthTS:function(){return C._glowLengthTS},u_radiusTS:function(){return C._radiusTS}};this._commands.computeCommand=new _({fragmentShaderSource:b,outputTexture:this._texture,uniformMap:D,persists:!1,owner:this,postExecute:function(){C._commands.computeCommand=void 0}})}var F=this._drawCommand;if(!s(F.vertexArray)){var B={direction:0},V=new Uint8Array(8);V[0]=0,V[1]=0,V[2]=255,V[3]=0,V[4]=255,V[5]=255,V[6]=0,V[7]=255;var k=f.createVertexBuffer({context:l,typedArray:V,usage:v.STATIC_DRAW}),z=[{index:B.direction,vertexBuffer:k,componentsPerAttribute:2,normalize:!0,componentDatatype:a.UNSIGNED_BYTE}],U=f.createIndexBuffer({context:l,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:v.STATIC_DRAW,indexDatatype:c.UNSIGNED_SHORT});F.vertexArray=new T({context:l,attributes:z,indexBuffer:U}),F.shaderProgram=S.fromCache({context:l,vertexShaderSource:A,fragmentShaderSource:x,attributeLocations:B}),F.renderState=E.fromCache({blending:P.ALPHA_BLEND}),F.uniformMap=this._uniformMap}var G=l.uniformState.sunPositionWC,W=l.uniformState.sunPositionColumbusView,H=this._boundingVolume,q=this._boundingVolume2D;r.clone(G,H.center),q.center.x=W.z,q.center.y=W.x,q.center.z=W.y,H.radius=h.SOLAR_RADIUS+h.SOLAR_RADIUS*this._glowLengthTS,q.radius=H.radius,u===I.SCENE3D?t.clone(H,F.boundingVolume):u===I.COLUMBUS_VIEW&&t.clone(q,F.boundingVolume);var j=M.computeActualWgs84Position(o,G,L),Y=r.magnitude(r.subtract(j,e.camera.position,L)),X=l.uniformState.projection,Z=N;Z.x=0,Z.y=0,Z.z=-Y,Z.w=1;var K=d.multiplyByVector(X,Z,L),Q=M.clipToDrawingBufferCoordinates(e,K,R);Z.x=h.SOLAR_RADIUS;var J=d.multiplyByVector(X,Z,L),$=M.clipToDrawingBufferCoordinates(e,J,O);return this._size=Math.ceil(i.magnitude(i.subtract($,Q,L))),this._size=2*this._size*(1+2*this._glowLengthTS),this._commands}}},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){var e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),u(this)},D}),i("Scene/TileCoordinatesImageryProvider",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/GeographicTilingScheme","../ThirdParty/when"],function(e,t,i,r,n,o,a){"use strict";function s(r){r=t(r,t.EMPTY_OBJECT),this._tilingScheme=i(r.tilingScheme)?r.tilingScheme:new o({ellipsoid:r.ellipsoid}),this._color=t(r.color,e.YELLOW),this._errorEvent=new n,this._tileWidth=t(r.tileWidth,256),this._tileHeight=t(r.tileHeight,256),this._readyPromise=a.resolve(!0)}return r(s.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}}),s.prototype.getTileCredits=function(e,t,i){},s.prototype.requestImage=function(e,t,i){var r=document.createElement("canvas");r.width=256,r.height=256;var n=r.getContext("2d"),o=this._color.toCssColorString();n.strokeStyle=o,n.lineWidth=2,n.strokeRect(1,1,255,255);var a="L"+i+"X"+e+"Y"+t;return n.font="bold 25px Arial",n.textAlign="center",n.fillStyle="black",n.fillText(a,127,127),n.fillStyle=o,n.fillText(a,124,124),r},s.prototype.pickFeatures=function(){},s}),i("Scene/TileDiscardPolicy",["../Core/DeveloperError"],function(e){"use strict";function t(t){e.throwInstantiationError()}return t.prototype.isReady=e.throwInstantiationError,t.prototype.shouldDiscardImage=e.throwInstantiationError,t}),i("Scene/TileMapServiceImageryProvider",["../Core/Cartesian2","../Core/Cartographic","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/joinUrls","../Core/loadXML","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g){"use strict";function _(o){function s(i){for(var a,s,l,h,v=/tileformat/i,g=/tileset/i,C=/tilesets/i,w=/boundingbox/i,T=/srs/i,x=[],b=i.childNodes[0].childNodes,A=0;A<b.length;A++)if(v.test(b.item(A).nodeName))a=b.item(A);else if(C.test(b.item(A).nodeName)){l=b.item(A);for(var P=b.item(A).childNodes,I=0;I<P.length;I++)g.test(P.item(I).nodeName)&&x.push(P.item(I))}else w.test(b.item(A).nodeName)?s=b.item(A):T.test(b.item(A).nodeName)&&(h=b.item(A).textContent);S._fileExtension=r(S._fileExtension,a.getAttribute("extension")),S._tileWidth=r(S._tileWidth,parseInt(a.getAttribute("width"),10)),S._tileHeight=r(S._tileHeight,parseInt(a.getAttribute("height"),10)),S._minimumLevel=r(S._minimumLevel,parseInt(x[0].getAttribute("order"),10)),S._maximumLevel=r(S._maximumLevel,parseInt(x[x.length-1].getAttribute("order"),10));var M=l.getAttribute("profile"),D=!1;if(("geodetic"===M||"mercator"===M)&&(D=!0),!n(S._tilingScheme))if("geodetic"===M||"global-geodetic"===M)S._tilingScheme=new u({ellipsoid:o.ellipsoid});else{if("mercator"!==M&&"global-mercator"!==M){var R=c(y,"tilemapresource.xml")+"specifies an unsupported profile attribute, "+M+".";return E=m.handleError(E,S,S._errorEvent,R,void 0,void 0,void 0,_),void S._readyPromise.reject(new p(R))}S._tilingScheme=new f({ellipsoid:o.ellipsoid})}var O=S._tilingScheme;if(!n(S._rectangle)){var N,L,F,B;if(D)N=new e(parseFloat(s.getAttribute("miny")),parseFloat(s.getAttribute("minx"))),L=new e(parseFloat(s.getAttribute("maxy")),parseFloat(s.getAttribute("maxx"))),F=t.fromDegrees(N.x,N.y),B=t.fromDegrees(L.x,L.y);else if(N=new e(parseFloat(s.getAttribute("minx")),parseFloat(s.getAttribute("miny"))),L=new e(parseFloat(s.getAttribute("maxx")),parseFloat(s.getAttribute("maxy"))),S._tilingScheme instanceof u)F=t.fromDegrees(N.x,N.y),B=t.fromDegrees(L.x,L.y);else{var V=S._tilingScheme.projection;F=V.unproject(N),B=V.unproject(L)}S._rectangle=new d(F.longitude,F.latitude,B.longitude,B.latitude)}S._rectangle.west<O.rectangle.west&&(S._rectangle.west=O.rectangle.west),S._rectangle.east>O.rectangle.east&&(S._rectangle.east=O.rectangle.east),S._rectangle.south<O.rectangle.south&&(S._rectangle.south=O.rectangle.south),S._rectangle.north>O.rectangle.north&&(S._rectangle.north=O.rectangle.north);var k=O.positionToTileXY(d.southwest(S._rectangle),S._minimumLevel),z=O.positionToTileXY(d.northeast(S._rectangle),S._minimumLevel),U=(Math.abs(z.x-k.x)+1)*(Math.abs(z.y-k.y)+1);U>4&&(S._minimumLevel=0),S._tilingScheme=O,S._ready=!0,S._readyPromise.resolve(!0)}function g(e){S._fileExtension=r(o.fileExtension,"png"),S._tileWidth=r(o.tileWidth,256),S._tileHeight=r(o.tileHeight,256),S._minimumLevel=r(o.minimumLevel,0),S._maximumLevel=o.maximumLevel,S._tilingScheme=n(o.tilingScheme)?o.tilingScheme:new f({ellipsoid:o.ellipsoid}),S._rectangle=r(o.rectangle,S._tilingScheme.rectangle),S._ready=!0,S._readyPromise.resolve(!0)}function _(){var e=c(y,"tilemapresource.xml"),t=S._proxy;n(t)&&(e=t.getURL(e)),v(h(e),s,g)}a("TileMapServiceImageryProvider","Scene/TileMapServiceImageryProvider is deprecated. Use Scene/createTileMapServiceImageryProvider instead."),o=r(o,{});var y=o.url;this._url=y,this._ready=!1,this._readyPromise=v.defer(),this._proxy=o.proxy,this._tileDiscardPolicy=o.tileDiscardPolicy,this._errorEvent=new l,this._fileExtension=o.fileExtension,this._tileWidth=o.tileWidth,this._tileHeight=o.tileHeight,this._minimumLevel=o.minimumLevel,this._maximumLevel=o.maximumLevel,this._rectangle=d.clone(o.rectangle),this._tilingScheme=o.tilingScheme;var C=o.credit;"string"==typeof C&&(C=new i(C)),this._credit=C;var E,S=this;_()}function y(e,t,i,r){var o=e._tilingScheme.getNumberOfYTilesAtLevel(r),a=c(e._url,r+"/"+t+"/"+(o-i-1)+"."+e._fileExtension),s=e._proxy;return n(s)&&(a=s.getURL(a)),a}return o(_.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy; -}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),_.prototype.getTileCredits=function(e,t,i){},_.prototype.requestImage=function(e,t,i){var r=y(this,e,t,i);return g.loadImage(this,r)},_.prototype.pickFeatures=function(){},_}),i("Scene/TileState",["../Core/freezeObject"],function(e){"use strict";var t={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};return e(t)}),i("Shaders/ViewportQuadFS",[],function(){"use strict";return"varying vec2 v_textureCoordinates;\nvoid main()\n{\nczm_materialInput materialInput;\nmaterialInput.s = v_textureCoordinates.s;\nmaterialInput.st = v_textureCoordinates;\nmaterialInput.str = vec3(v_textureCoordinates, 0.0);\nmaterialInput.normalEC = vec3(0.0, 0.0, -1.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n}\n"}),i("Scene/ViewportQuad",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Renderer/RenderState","../Renderer/ShaderSource","../Shaders/ViewportQuadFS","./BlendingState","./Material","./Pass"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(r,n){this.show=!0,i(r)||(r=new e),this.rectangle=e.clone(r),i(n)||(n=u.fromType(u.ColorType,{color:new t(1,1,1,1)})),this.material=n,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}return h.prototype.update=function(t){if(this.show){var r=this._rs;i(r)&&e.equals(r.viewport,this.rectangle)||(this._rs=o.fromCache({blending:l.ALPHA_BLEND,viewport:this.rectangle}));var n=t.passes;if(n.render){var u=t.context;if(this._material!==this.material||!i(this._overlayCommand)){this._material=this.material,i(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();var h=new a({sources:[this._material.shaderSource,s]});this._overlayCommand=u.createViewportQuadCommand(h,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=c.OVERLAY}this._material.update(u),this._overlayCommand.uniformMap=this._material._uniforms,t.commandList.push(this._overlayCommand)}}},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){return i(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),r(this)},h}),i("Scene/WebMapServiceImageryProvider",["../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/freezeObject","../Core/GeographicTilingScheme","../Core/objectToQuery","../Core/queryToObject","../Core/WebMercatorTilingScheme","../ThirdParty/Uri","./GetFeatureInfoFormat","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(r){function n(e,t){i(f[e])||(f[e]=t),i(_)&&!i(_[e])&&(_[e]=t)}r=t(r,t.EMPTY_OBJECT),this._url=r.url,this._layers=r.layers;var o=t(r.getFeatureInfoFormats,p.DefaultGetFeatureInfoFormats),h=new c(r.url),f=l(t(h.query,"")),v=e(m(t(r.parameters,t.EMPTY_OBJECT)),p.DefaultParameters);f=e(v,f);var g,_;g=new c(r.url),_=l(t(g.query,""));var y=e(m(t(r.getFeatureInfoParameters,t.EMPTY_OBJECT)),p.GetFeatureInfoDefaultParameters);_=e(y,_),n("layers",r.layers),n("srs",r.tilingScheme instanceof u?"EPSG:3857":"EPSG:4326"),n("bbox","{westProjected},{southProjected},{eastProjected},{northProjected}"),n("width","{width}"),n("height","{height}"),h.query=s(f);var C,E=h.toString().replace(/%7B/g,"{").replace(/%7D/g,"}");i(_)&&(i(_.query_layers)||(_.query_layers=r.layers),i(_.x)||(_.x="{i}"),i(_.y)||(_.y="{j}"),i(_.info_format)||(_.info_format="{format}"),g.query=s(_),C=g.toString().replace(/%7B/g,"{").replace(/%7D/g,"}")),this._tileProvider=new d({url:E,pickFeaturesUrl:C,tilingScheme:t(r.tilingScheme,new a({ellipsoid:r.ellipsoid})),rectangle:r.rectangle,tileWidth:r.tileWidth,tileHeight:r.tileHeight,minimumLevel:r.minimumLevel,maximumLevel:r.maximumLevel,proxy:r.proxy,subdomains:r.subdomains,tileDiscardPolicy:r.tileDiscardPolicy,credit:r.credit,getFeatureInfoFormats:o,enablePickFeatures:r.enablePickFeatures,withCredentials:r.withCredentials,headers:r.headers})}function m(e){var t={};for(var i in e)e.hasOwnProperty(i)&&(t[i.toLowerCase()]=e[i]);return t}return r(p.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._tileProvider.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},ready:{get:function(){return this._tileProvider.ready}},readyPromise:{get:function(){return this._tileProvider.readyPromise}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}}}),p.prototype.getTileCredits=function(e,t,i){return this._tileProvider.getTileCredits(e,t,i)},p.prototype.requestImage=function(e,t,i){return this._tileProvider.requestImage(e,t,i)},p.prototype.pickFeatures=function(e,t,i,r,n){return this._tileProvider.pickFeatures(e,t,i,r,n)},p.DefaultParameters=o({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"}),p.GetFeatureInfoDefaultParameters=o({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"}),p.DefaultGetFeatureInfoFormats=o([o(new h("json","application/json")),o(new h("xml","text/xml")),o(new h("text","text/html"))]),p}),i("Scene/WebMapTileServiceImageryProvider",["../Core/combine","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/freezeObject","../Core/objectToQuery","../Core/queryToObject","../Core/Rectangle","../Core/WebMercatorTilingScheme","../ThirdParty/Uri","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e){if(e=i(e,i.EMPTY_OBJECT),!r(e.url))throw new o("options.url is required.");if(!r(e.layer))throw new o("options.layer is required.");if(!r(e.style))throw new o("options.style is required.");if(!r(e.tileMatrixSetID))throw new o("options.tileMatrixSetID is required.");this._url=e.url,this._layer=e.layer,this._style=e.style,this._tileMatrixSetID=e.tileMatrixSetID,this._tileMatrixLabels=e.tileMatrixLabels,this._format=i(e.format,"image/jpeg"),this._proxy=e.proxy,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=r(e.tilingScheme)?e.tilingScheme:new h({ellipsoid:e.ellipsoid}),this._tileWidth=i(e.tileWidth,256),this._tileHeight=i(e.tileHeight,256),this._minimumLevel=i(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=i(e.rectangle,this._tilingScheme.rectangle),this._readyPromise=p.resolve(!0),this._headers=i(e.headers,void 0),this._withCredentials=i(e.withCredentials,void 0);var n=this._tilingScheme.positionToTileXY(c.southwest(this._rectangle),this._minimumLevel),s=this._tilingScheme.positionToTileXY(c.northeast(this._rectangle),this._minimumLevel),l=(Math.abs(s.x-n.x)+1)*(Math.abs(s.y-n.y)+1);if(l>4)throw new o("The imagery provider's rectangle and minimumLevel indicate that there are "+l+" tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.");this._errorEvent=new a;var u=e.credit;this._credit="string"==typeof u?new t(u):u,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():r(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function v(t,n,o,a){var s,c=t._tileMatrixLabels,h=r(c)?c[a]:a.toString(),p=t._subdomains;if(t._url.indexOf("{")>=0)s=t._url.replace("{style}",t._style).replace("{Style}",t._style).replace("{TileMatrixSet}",t._tileMatrixSetID).replace("{TileMatrix}",h).replace("{TileRow}",o.toString()).replace("{TileCol}",n.toString()).replace("{s}",p[(n+o+a)%p.length]);else{var m=new d(t._url),f=u(i(m.query,""));f=e(g,f),f.tilematrix=h,f.layer=t._layer,f.style=t._style,f.tilerow=o,f.tilecol=n,f.tilematrixset=t._tileMatrixSetID,f.format=t._format,m.query=l(f),s=m.toString()}var v=t._proxy;return r(v)&&(s=v.getURL(s)),s}var g=s({service:"WMTS",version:"1.0.0",request:"GetTile"});return n(f.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},ready:{value:!0},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},headers:{get:function(){return this._headers}},withCredentials:{get:function(){return this._withCredentials}}}),f.prototype.getTileCredits=function(e,t,i){},f.prototype.requestImage=function(e,t,i){var r=v(this,e,t,i);return m.loadImage(this,r)},f.prototype.pickFeatures=function(){},f}),function(){!function(e){var r=this||(0,eval)("this"),n=r.document,o=r.navigator,a=r.jQuery,s=r.JSON;!function(e){"function"==typeof t&&"object"==typeof exports&&"object"==typeof module?e(module.exports||exports,t):"function"==typeof i&&i.amd?i("ThirdParty/knockout-3.2.0",["exports","require"],e):e(r.ko={})}(function(t,i){function l(e,t){return null===e||typeof e in p?e===t:!1}function u(t,i){var r;return function(){r||(r=setTimeout(function(){r=e,t()},i))}}function c(e,t){var i;return function(){clearTimeout(i),i=setTimeout(e,t)}}function h(e,t,i,r){d.d[e]={init:function(e,n,o,a,s){var l,u;return d.s(function(){var o=d.a.c(n()),a=!i!=!o,c=!u;(c||t||a!==l)&&(c&&d.Y.la()&&(u=d.a.ia(d.f.childNodes(e),!0)),a?(c||d.f.T(e,d.a.ia(u)),d.Ca(r?r(s,o):s,e)):d.f.ja(e),l=a)},null,{o:e}),{controlsDescendantBindings:!0}}},d.h.ha[e]=!1,d.f.Q[e]=!0}var d="undefined"!=typeof t?t:{};d.b=function(e,t){for(var i=e.split("."),r=d,n=0;n<i.length-1;n++)r=r[i[n]];r[i[i.length-1]]=t},d.A=function(e,t,i){e[t]=i},d.version="3.2.0",d.b("version",d.version),d.a=function(){function t(e,t){for(var i in e)e.hasOwnProperty(i)&&t(i,e[i])}function i(e,t){if(t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function l(e,t){return e.__proto__=t,e}var u={__proto__:[]}instanceof Array,c={},h={};c[o&&/Firefox\/2/i.test(o.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],c.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),t(c,function(e,t){if(t.length)for(var i=0,r=t.length;r>i;i++)h[t[i]]=e});var p={propertychange:!0},m=n&&function(){for(var t=3,i=n.createElement("div"),r=i.getElementsByTagName("i");i.innerHTML="<!--[if gt IE "+ ++t+"]><i></i><![endif]-->",r[0];);return t>4?t:e}();return{vb:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],u:function(e,t){for(var i=0,r=e.length;r>i;i++)t(e[i],i)},m:function(e,t){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(e,t);for(var i=0,r=e.length;r>i;i++)if(e[i]===t)return i;return-1},qb:function(e,t,i){for(var r=0,n=e.length;n>r;r++)if(t.call(i,e[r],r))return e[r];return null},ua:function(e,t){var i=d.a.m(e,t);i>0?e.splice(i,1):0===i&&e.shift()},rb:function(e){e=e||[];for(var t=[],i=0,r=e.length;r>i;i++)0>d.a.m(t,e[i])&&t.push(e[i]);return t},Da:function(e,t){e=e||[];for(var i=[],r=0,n=e.length;n>r;r++)i.push(t(e[r],r));return i},ta:function(e,t){e=e||[];for(var i=[],r=0,n=e.length;n>r;r++)t(e[r],r)&&i.push(e[r]);return i},ga:function(e,t){if(t instanceof Array)e.push.apply(e,t);else for(var i=0,r=t.length;r>i;i++)e.push(t[i]);return e},ea:function(e,t,i){var r=d.a.m(d.a.Xa(e),t);0>r?i&&e.push(t):i||e.splice(r,1)},xa:u,extend:i,za:l,Aa:u?l:i,G:t,na:function(e,t){if(!e)return e;var i,r={};for(i in e)e.hasOwnProperty(i)&&(r[i]=t(e[i],i,e));return r},Ka:function(e){for(;e.firstChild;)d.removeNode(e.firstChild)},oc:function(e){e=d.a.S(e);for(var t=n.createElement("div"),i=0,r=e.length;r>i;i++)t.appendChild(d.R(e[i]));return t},ia:function(e,t){for(var i=0,r=e.length,n=[];r>i;i++){var o=e[i].cloneNode(!0);n.push(t?d.R(o):o)}return n},T:function(e,t){if(d.a.Ka(e),t)for(var i=0,r=t.length;r>i;i++)e.appendChild(t[i])},Lb:function(e,t){var i=e.nodeType?[e]:e;if(0<i.length){for(var r=i[0],n=r.parentNode,o=0,a=t.length;a>o;o++)n.insertBefore(t[o],r);for(o=0,a=i.length;a>o;o++)d.removeNode(i[o])}},ka:function(e,t){if(e.length){for(t=8===t.nodeType&&t.parentNode||t;e.length&&e[0].parentNode!==t;)e.shift();if(1<e.length){var i=e[0],r=e[e.length-1];for(e.length=0;i!==r;)if(e.push(i),i=i.nextSibling,!i)return;e.push(r)}}return e},Nb:function(e,t){7>m?e.setAttribute("selected",t):e.selected=t},cb:function(t){return null===t||t===e?"":t.trim?t.trim():t.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},vc:function(e,t){return e=e||"",t.length>e.length?!1:e.substring(0,t.length)===t},cc:function(e,t){if(e===t)return!0;if(11===e.nodeType)return!1;if(t.contains)return t.contains(3===e.nodeType?e.parentNode:e);if(t.compareDocumentPosition)return 16==(16&t.compareDocumentPosition(e));for(;e&&e!=t;)e=e.parentNode;return!!e},Ja:function(e){return d.a.cc(e,e.ownerDocument.documentElement)},ob:function(e){return!!d.a.qb(e,d.a.Ja)},t:function(e){return e&&e.tagName&&e.tagName.toLowerCase()},n:function(e,t,i){var r=m&&p[t];if(!r&&a)a(e).bind(t,i);else if(r||"function"!=typeof e.addEventListener){if("undefined"==typeof e.attachEvent)throw Error("Browser doesn't support addEventListener or attachEvent");var n=function(t){i.call(e,t)},o="on"+t;e.attachEvent(o,n),d.a.w.da(e,function(){e.detachEvent(o,n)})}else e.addEventListener(t,i,!1)},oa:function(e,t){if(!e||!e.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var i;if("input"===d.a.t(e)&&e.type&&"click"==t.toLowerCase()?(i=e.type,i="checkbox"==i||"radio"==i):i=!1,a&&!i)a(e).trigger(t);else if("function"==typeof n.createEvent){if("function"!=typeof e.dispatchEvent)throw Error("The supplied element doesn't support dispatchEvent");i=n.createEvent(h[t]||"HTMLEvents"),i.initEvent(t,!0,!0,r,0,0,0,0,0,!1,!1,!1,!1,0,e),e.dispatchEvent(i)}else if(i&&e.click)e.click();else{if("undefined"==typeof e.fireEvent)throw Error("Browser doesn't support triggering events");e.fireEvent("on"+t)}},c:function(e){return d.C(e)?e():e},Xa:function(e){return d.C(e)?e.v():e},Ba:function(e,t,i){if(t){var r=/\S+/g,n=e.className.match(r)||[];d.a.u(t.match(r),function(e){d.a.ea(n,e,i)}),e.className=n.join(" ")}},bb:function(t,i){var r=d.a.c(i);(null===r||r===e)&&(r="");var n=d.f.firstChild(t);!n||3!=n.nodeType||d.f.nextSibling(n)?d.f.T(t,[t.ownerDocument.createTextNode(r)]):n.data=r,d.a.fc(t)},Mb:function(e,t){if(e.name=t,7>=m)try{e.mergeAttributes(n.createElement("<input name='"+e.name+"'/>"),!1)}catch(i){}},fc:function(e){m>=9&&(e=1==e.nodeType?e:e.parentNode,e.style&&(e.style.zoom=e.style.zoom))},dc:function(e){if(m){var t=e.style.width;e.style.width=0,e.style.width=t}},sc:function(e,t){e=d.a.c(e),t=d.a.c(t);for(var i=[],r=e;t>=r;r++)i.push(r);return i},S:function(e){for(var t=[],i=0,r=e.length;r>i;i++)t.push(e[i]);return t},yc:6===m,zc:7===m,L:m,xb:function(e,t){for(var i=d.a.S(e.getElementsByTagName("input")).concat(d.a.S(e.getElementsByTagName("textarea"))),r="string"==typeof t?function(e){return e.name===t}:function(e){return t.test(e.name)},n=[],o=i.length-1;o>=0;o--)r(i[o])&&n.push(i[o]);return n},pc:function(e){return"string"==typeof e&&(e=d.a.cb(e))?s&&s.parse?s.parse(e):new Function("return "+e)():null},eb:function(e,t,i){if(!s||!s.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return s.stringify(d.a.c(e),t,i)},qc:function(e,i,r){r=r||{};var o=r.params||{},a=r.includeFields||this.vb,s=e;if("object"==typeof e&&"form"===d.a.t(e))for(var s=e.action,l=a.length-1;l>=0;l--)for(var u=d.a.xb(e,a[l]),c=u.length-1;c>=0;c--)o[u[c].name]=u[c].value;i=d.a.c(i);var h=n.createElement("form");h.style.display="none",h.action=s,h.method="post";for(var p in i)e=n.createElement("input"),e.type="hidden",e.name=p,e.value=d.a.eb(d.a.c(i[p])),h.appendChild(e);t(o,function(e,t){var i=n.createElement("input");i.type="hidden",i.name=e,i.value=t,h.appendChild(i)}),n.body.appendChild(h),r.submitter?r.submitter(h):h.submit(),setTimeout(function(){h.parentNode.removeChild(h)},0)}}}(),d.b("utils",d.a),d.b("utils.arrayForEach",d.a.u),d.b("utils.arrayFirst",d.a.qb),d.b("utils.arrayFilter",d.a.ta),d.b("utils.arrayGetDistinctValues",d.a.rb),d.b("utils.arrayIndexOf",d.a.m),d.b("utils.arrayMap",d.a.Da),d.b("utils.arrayPushAll",d.a.ga),d.b("utils.arrayRemoveItem",d.a.ua),d.b("utils.extend",d.a.extend),d.b("utils.fieldsIncludedWithJsonPost",d.a.vb),d.b("utils.getFormFields",d.a.xb),d.b("utils.peekObservable",d.a.Xa),d.b("utils.postJson",d.a.qc),d.b("utils.parseJson",d.a.pc),d.b("utils.registerEventHandler",d.a.n),d.b("utils.stringifyJson",d.a.eb),d.b("utils.range",d.a.sc),d.b("utils.toggleDomNodeCssClass",d.a.Ba),d.b("utils.triggerEvent",d.a.oa),d.b("utils.unwrapObservable",d.a.c),d.b("utils.objectForEach",d.a.G),d.b("utils.addOrRemoveItem",d.a.ea),d.b("unwrap",d.a.c),Function.prototype.bind||(Function.prototype.bind=function(e){var t=this,i=Array.prototype.slice.call(arguments);return e=i.shift(),function(){return t.apply(e,i.concat(Array.prototype.slice.call(arguments)))}}),d.a.e=new function(){function t(t,o){var a=t[r];if(!a||"null"===a||!n[a]){if(!o)return e;a=t[r]="ko"+i++,n[a]={}}return n[a]}var i=0,r="__ko__"+(new Date).getTime(),n={};return{get:function(i,r){var n=t(i,!1);return n===e?e:n[r]},set:function(i,r,n){(n!==e||t(i,!1)!==e)&&(t(i,!0)[r]=n)},clear:function(e){var t=e[r];return t?(delete n[t],e[r]=null,!0):!1},F:function(){return i++ +r}}},d.b("utils.domData",d.a.e),d.b("utils.domData.clear",d.a.e.clear),d.a.w=new function(){function t(t,i){var n=d.a.e.get(t,r);return n===e&&i&&(n=[],d.a.e.set(t,r,n)),n}function i(e){var r=t(e,!1);if(r)for(var r=r.slice(0),n=0;n<r.length;n++)r[n](e);if(d.a.e.clear(e),d.a.w.cleanExternalData(e),o[e.nodeType])for(r=e.firstChild;e=r;)r=e.nextSibling,8===e.nodeType&&i(e)}var r=d.a.e.F(),n={1:!0,8:!0,9:!0},o={1:!0,9:!0};return{da:function(e,i){if("function"!=typeof i)throw Error("Callback must be a function");t(e,!0).push(i)},Kb:function(i,n){var o=t(i,!1);o&&(d.a.ua(o,n),0==o.length&&d.a.e.set(i,r,e))},R:function(e){if(n[e.nodeType]&&(i(e),o[e.nodeType])){var t=[];d.a.ga(t,e.getElementsByTagName("*"));for(var r=0,a=t.length;a>r;r++)i(t[r])}return e},removeNode:function(e){d.R(e),e.parentNode&&e.parentNode.removeChild(e)},cleanExternalData:function(e){a&&"function"==typeof a.cleanData&&a.cleanData([e])}}},d.R=d.a.w.R,d.removeNode=d.a.w.removeNode,d.b("cleanNode",d.R),d.b("removeNode",d.removeNode),d.b("utils.domNodeDisposal",d.a.w),d.b("utils.domNodeDisposal.addDisposeCallback",d.a.w.da),d.b("utils.domNodeDisposal.removeDisposeCallback",d.a.w.Kb),function(){d.a.ba=function(e){var t;if(a){if(a.parseHTML)t=a.parseHTML(e)||[];else if((t=a.clean([e]))&&t[0]){for(e=t[0];e.parentNode&&11!==e.parentNode.nodeType;)e=e.parentNode;e.parentNode&&e.parentNode.removeChild(e)}}else{var i=d.a.cb(e).toLowerCase();for(t=n.createElement("div"),i=i.match(/^<(thead|tbody|tfoot)/)&&[1,"<table>","</table>"]||!i.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!i.indexOf("<td")||!i.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||[0,"",""],e="ignored<div>"+i[1]+e+i[2]+"</div>","function"==typeof r.innerShiv?t.appendChild(r.innerShiv(e)):t.innerHTML=e;i[0]--;)t=t.lastChild;t=d.a.S(t.lastChild.childNodes)}return t},d.a.$a=function(t,i){if(d.a.Ka(t),i=d.a.c(i),null!==i&&i!==e)if("string"!=typeof i&&(i=i.toString()),a)a(t).html(i);else for(var r=d.a.ba(i),n=0;n<r.length;n++)t.appendChild(r[n])}}(),d.b("utils.parseHtmlFragment",d.a.ba),d.b("utils.setHtml",d.a.$a),d.D=function(){function t(e,i){if(e)if(8==e.nodeType){var r=d.D.Gb(e.nodeValue);null!=r&&i.push({bc:e,mc:r})}else if(1==e.nodeType)for(var r=0,n=e.childNodes,o=n.length;o>r;r++)t(n[r],i)}var i={};return{Ua:function(e){if("function"!=typeof e)throw Error("You can only pass a function to ko.memoization.memoize()");var t=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return i[t]=e,"<!--[ko_memo:"+t+"]-->"},Rb:function(t,r){var n=i[t];if(n===e)throw Error("Couldn't find any memo with ID "+t+". Perhaps it's already been unmemoized.");try{return n.apply(null,r||[]),!0}finally{delete i[t]}},Sb:function(e,i){var r=[];t(e,r);for(var n=0,o=r.length;o>n;n++){var a=r[n].bc,s=[a];i&&d.a.ga(s,i),d.D.Rb(r[n].mc,s),a.nodeValue="",a.parentNode&&a.parentNode.removeChild(a)}},Gb:function(e){return(e=e.match(/^\[ko_memo\:(.*?)\]$/))?e[1]:null}}}(),d.b("memoization",d.D),d.b("memoization.memoize",d.D.Ua),d.b("memoization.unmemoize",d.D.Rb),d.b("memoization.parseMemoText",d.D.Gb),d.b("memoization.unmemoizeDomNodeAndDescendants",d.D.Sb),d.La={throttle:function(e,t){e.throttleEvaluation=t;var i=null;return d.j({read:e,write:function(r){clearTimeout(i),i=setTimeout(function(){e(r)},t)}})},rateLimit:function(e,t){var i,r,n;"number"==typeof t?i=t:(i=t.timeout,r=t.method),n="notifyWhenChangesStop"==r?c:u,e.Ta(function(e){return n(e,i)})},notify:function(e,t){e.equalityComparer="always"==t?null:l}};var p={undefined:1,"boolean":1,number:1,string:1};d.b("extenders",d.La),d.Pb=function(e,t,i){this.target=e,this.wa=t,this.ac=i,this.Cb=!1,d.A(this,"dispose",this.K)},d.Pb.prototype.K=function(){this.Cb=!0,this.ac()},d.P=function(){d.a.Aa(this,d.P.fn),this.M={}};var m="change",f={U:function(e,t,i){var r=this;i=i||m;var n=new d.Pb(r,t?e.bind(t):e,function(){d.a.ua(r.M[i],n),r.nb&&r.nb()});return r.va&&r.va(i),r.M[i]||(r.M[i]=[]),r.M[i].push(n),n},notifySubscribers:function(e,t){if(t=t||m,this.Ab(t))try{d.k.Ea();for(var i,r=this.M[t].slice(0),n=0;i=r[n];++n)i.Cb||i.wa(e)}finally{d.k.end()}},Ta:function(e){var t,i,r,n=this,o=d.C(n);n.qa||(n.qa=n.notifySubscribers,n.notifySubscribers=function(e,t){t&&t!==m?"beforeChange"===t?n.kb(e):n.qa(e,t):n.lb(e)});var a=e(function(){o&&r===n&&(r=n()),t=!1,n.Pa(i,r)&&n.qa(i=r)});n.lb=function(e){t=!0,r=e,a()},n.kb=function(e){t||(i=e,n.qa(e,"beforeChange"))}},Ab:function(e){return this.M[e]&&this.M[e].length},yb:function(){var e=0;return d.a.G(this.M,function(t,i){e+=i.length}),e},Pa:function(e,t){return!this.equalityComparer||!this.equalityComparer(e,t)},extend:function(e){var t=this;return e&&d.a.G(e,function(e,i){var r=d.La[e];"function"==typeof r&&(t=r(t,i)||t)}),t}};d.A(f,"subscribe",f.U),d.A(f,"extend",f.extend),d.A(f,"getSubscriptionsCount",f.yb),d.a.xa&&d.a.za(f,Function.prototype),d.P.fn=f,d.Db=function(e){return null!=e&&"function"==typeof e.U&&"function"==typeof e.notifySubscribers},d.b("subscribable",d.P),d.b("isSubscribable",d.Db),d.Y=d.k=function(){function e(e){r.push(i),i=e}function t(){i=r.pop()}var i,r=[],n=0;return{Ea:e,end:t,Jb:function(e){if(i){if(!d.Db(e))throw Error("Only subscribable things can act as dependencies");i.wa(e,e.Vb||(e.Vb=++n))}},B:function(i,r,n){try{return e(),i.apply(r,n||[])}finally{t()}},la:function(){return i?i.s.la():void 0},ma:function(){return i?i.ma:void 0}}}(),d.b("computedContext",d.Y),d.b("computedContext.getDependenciesCount",d.Y.la),d.b("computedContext.isInitial",d.Y.ma),d.b("computedContext.isSleeping",d.Y.Ac),d.p=function(e){function t(){return 0<arguments.length?(t.Pa(i,arguments[0])&&(t.X(),i=arguments[0],t.W()),this):(d.k.Jb(t),i)}var i=e;return d.P.call(t),d.a.Aa(t,d.p.fn),t.v=function(){return i},t.W=function(){t.notifySubscribers(i)},t.X=function(){t.notifySubscribers(i,"beforeChange")},d.A(t,"peek",t.v),d.A(t,"valueHasMutated",t.W),d.A(t,"valueWillMutate",t.X),t},d.p.fn={equalityComparer:l};var v=d.p.rc="__ko_proto__";d.p.fn[v]=d.p,d.a.xa&&d.a.za(d.p.fn,d.P.fn),d.Ma=function(t,i){return null===t||t===e||t[v]===e?!1:t[v]===i?!0:d.Ma(t[v],i)},d.C=function(e){return d.Ma(e,d.p)},d.Ra=function(e){return"function"==typeof e&&e[v]===d.p||"function"==typeof e&&e[v]===d.j&&e.hc?!0:!1},d.b("observable",d.p),d.b("isObservable",d.C),d.b("isWriteableObservable",d.Ra),d.b("isWritableObservable",d.Ra),d.aa=function(e){if(e=e||[],"object"!=typeof e||!("length"in e))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return e=d.p(e),d.a.Aa(e,d.aa.fn),e.extend({trackArrayChanges:!0})},d.aa.fn={remove:function(e){for(var t=this.v(),i=[],r="function"!=typeof e||d.C(e)?function(t){return t===e}:e,n=0;n<t.length;n++){var o=t[n];r(o)&&(0===i.length&&this.X(),i.push(o),t.splice(n,1),n--)}return i.length&&this.W(),i},removeAll:function(t){if(t===e){var i=this.v(),r=i.slice(0);return this.X(),i.splice(0,i.length),this.W(),r}return t?this.remove(function(e){return 0<=d.a.m(t,e)}):[]},destroy:function(e){var t=this.v(),i="function"!=typeof e||d.C(e)?function(t){return t===e}:e;this.X();for(var r=t.length-1;r>=0;r--)i(t[r])&&(t[r]._destroy=!0);this.W()},destroyAll:function(t){return t===e?this.destroy(function(){return!0}):t?this.destroy(function(e){return 0<=d.a.m(t,e)}):[]},indexOf:function(e){var t=this();return d.a.m(t,e)},replace:function(e,t){var i=this.indexOf(e);i>=0&&(this.X(),this.v()[i]=t,this.W())}},d.a.u("pop push reverse shift sort splice unshift".split(" "),function(e){d.aa.fn[e]=function(){var t=this.v();return this.X(),this.sb(t,e,arguments),t=t[e].apply(t,arguments),this.W(),t}}),d.a.u(["slice"],function(e){d.aa.fn[e]=function(){var t=this();return t[e].apply(t,arguments)}}),d.a.xa&&d.a.za(d.aa.fn,d.p.fn),d.b("observableArray",d.aa);var g="arrayChange";d.La.trackArrayChanges=function(e){function t(){if(!i){i=!0;var t=e.notifySubscribers;e.notifySubscribers=function(e,i){return i&&i!==m||++n,t.apply(this,arguments)};var o=[].concat(e.v()||[]);r=null,e.U(function(t){if(t=[].concat(t||[]),e.Ab(g)){var i;(!r||n>1)&&(r=d.a.Fa(o,t,{sparse:!0})),i=r,i.length&&e.notifySubscribers(i,g)}o=t,r=null,n=0})}}if(!e.sb){var i=!1,r=null,n=0,o=e.U;e.U=e.subscribe=function(e,i,r){return r===g&&t(),o.apply(this,arguments)},e.sb=function(e,t,o){function a(e,t,i){return s[s.length]={status:e,value:t,index:i}}if(i&&!n){var s=[],l=e.length,u=o.length,c=0;switch(t){case"push":c=l;case"unshift":for(t=0;u>t;t++)a("added",o[t],c+t);break;case"pop":c=l-1;case"shift":l&&a("deleted",e[c],c);break;case"splice":t=Math.min(Math.max(0,0>o[0]?l+o[0]:o[0]),l);for(var l=1===u?l:Math.min(t+(o[1]||0),l),u=t+u-2,c=Math.max(l,u),h=[],p=[],m=2;c>t;++t,++m)l>t&&p.push(a("deleted",e[t],t)),u>t&&h.push(a("added",o[m],t));d.a.wb(p,h);break;default:return}r=s}}}},d.s=d.j=function(t,i,r){function n(){d.a.G(x,function(e,t){t.K()}),x={}}function o(){n(),b=0,v=!0,p=!1}function a(){var e=l.throttleEvaluation;e&&e>=0?(clearTimeout(A),A=setTimeout(s,e)):l.ib?l.ib():s()}function s(t){if(m){if(_)throw Error("A 'pure' computed must not be called recursively")}else if(!v){if(w&&w()){if(!f)return void T()}else f=!1;if(m=!0,y)try{var r={};d.k.Ea({wa:function(e,t){r[t]||(r[t]=1,++b)},s:l,ma:e}),b=0,h=g.call(i)}finally{d.k.end(),m=!1}else try{var n=x,o=b;d.k.Ea({wa:function(e,t){v||(o&&n[t]?(x[t]=n[t],++b,delete n[t],--o):x[t]||(x[t]=e.U(a),++b))},s:l,ma:_?e:!b}),x={},b=0;try{var s=i?g.call(i):g()}finally{d.k.end(),o&&d.a.G(n,function(e,t){t.K()}),p=!1}l.Pa(h,s)&&(l.notifySubscribers(h,"beforeChange"),h=s,!0!==t&&l.notifySubscribers(h))}finally{m=!1}b||T()}}function l(){if(0<arguments.length){if("function"!=typeof C)throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return C.apply(i,arguments),this}return d.k.Jb(l),p&&s(!0),h}function u(){return p&&!b&&s(!0),h}function c(){return p||b>0}var h,p=!0,m=!1,f=!1,v=!1,g=t,_=!1,y=!1;if(g&&"object"==typeof g?(r=g,g=r.read):(r=r||{},g||(g=r.read)),"function"!=typeof g)throw Error("Pass a function that returns the value of the ko.computed");var C=r.write,E=r.disposeWhenNodeIsRemoved||r.o||null,S=r.disposeWhen||r.Ia,w=S,T=o,x={},b=0,A=null;i||(i=r.owner),d.P.call(l),d.a.Aa(l,d.j.fn),l.v=u,l.la=function(){return b},l.hc="function"==typeof r.write,l.K=function(){T()},l.Z=c;var P=l.Ta;return l.Ta=function(e){P.call(l,e),l.ib=function(){l.kb(h),p=!0,l.lb(l)}},r.pure?(y=_=!0,l.va=function(){y&&(y=!1,s(!0))},l.nb=function(){l.yb()||(n(),y=p=!0)}):r.deferEvaluation&&(l.va=function(){u(),delete l.va}),d.A(l,"peek",l.v),d.A(l,"dispose",l.K),d.A(l,"isActive",l.Z),d.A(l,"getDependenciesCount",l.la),E&&(f=!0,E.nodeType&&(w=function(){return!d.a.Ja(E)||S&&S()})),y||r.deferEvaluation||s(),E&&c()&&E.nodeType&&(T=function(){d.a.w.Kb(E,T),o()},d.a.w.da(E,T)),l},d.jc=function(e){return d.Ma(e,d.j)},f=d.p.rc,d.j[f]=d.p,d.j.fn={equalityComparer:l},d.j.fn[f]=d.j,d.a.xa&&d.a.za(d.j.fn,d.P.fn),d.b("dependentObservable",d.j),d.b("computed",d.j),d.b("isComputed",d.jc),d.Ib=function(e,t){return"function"==typeof e?d.s(e,t,{pure:!0}):(e=d.a.extend({},e),e.pure=!0,d.s(e,t))},d.b("pureComputed",d.Ib),function(){function t(n,o,a){if(a=a||new r,n=o(n),"object"!=typeof n||null===n||n===e||n instanceof Date||n instanceof String||n instanceof Number||n instanceof Boolean)return n;var s=n instanceof Array?[]:{};return a.save(n,s),i(n,function(i){var r=o(n[i]);switch(typeof r){case"boolean":case"number":case"string":case"function":s[i]=r;break;case"object":case"undefined":var l=a.get(r);s[i]=l!==e?l:t(r,o,a)}}),s}function i(e,t){if(e instanceof Array){for(var i=0;i<e.length;i++)t(i);"function"==typeof e.toJSON&&t("toJSON")}else for(i in e)t(i)}function r(){this.keys=[],this.hb=[]}d.Qb=function(e){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return t(e,function(e){for(var t=0;d.C(e)&&10>t;t++)e=e();return e})},d.toJSON=function(e,t,i){return e=d.Qb(e),d.a.eb(e,t,i)},r.prototype={save:function(e,t){var i=d.a.m(this.keys,e);i>=0?this.hb[i]=t:(this.keys.push(e),this.hb.push(t))},get:function(t){return t=d.a.m(this.keys,t),t>=0?this.hb[t]:e}}}(),d.b("toJS",d.Qb),d.b("toJSON",d.toJSON),function(){d.i={q:function(t){switch(d.a.t(t)){case"option":return!0===t.__ko__hasDomDataOptionValue__?d.a.e.get(t,d.d.options.Va):7>=d.a.L?t.getAttributeNode("value")&&t.getAttributeNode("value").specified?t.value:t.text:t.value;case"select":return 0<=t.selectedIndex?d.i.q(t.options[t.selectedIndex]):e;default:return t.value}},ca:function(t,i,r){switch(d.a.t(t)){case"option":switch(typeof i){case"string":d.a.e.set(t,d.d.options.Va,e),"__ko__hasDomDataOptionValue__"in t&&delete t.__ko__hasDomDataOptionValue__,t.value=i;break;default:d.a.e.set(t,d.d.options.Va,i),t.__ko__hasDomDataOptionValue__=!0,t.value="number"==typeof i?i:""}break;case"select":(""===i||null===i)&&(i=e);for(var n,o=-1,a=0,s=t.options.length;s>a;++a)if(n=d.i.q(t.options[a]),n==i||""==n&&i===e){o=a;break}(r||o>=0||i===e&&1<t.size)&&(t.selectedIndex=o);break;default:(null===i||i===e)&&(i=""),t.value=i}}}}(),d.b("selectExtensions",d.i),d.b("selectExtensions.readValue",d.i.q),d.b("selectExtensions.writeValue",d.i.ca),d.h=function(){function e(e){ -e=d.a.cb(e),123===e.charCodeAt(0)&&(e=e.slice(1,-1));var t,i,a=[],s=e.match(r),l=0;if(s){s.push(",");for(var u,c=0;u=s[c];++c){var h=u.charCodeAt(0);if(44===h){if(0>=l){t&&a.push(i?{key:t,value:i.join("")}:{unknown:t}),t=i=l=0;continue}}else if(58===h){if(!i)continue}else if(47===h&&c&&1<u.length)(h=s[c-1].match(n))&&!o[h[0]]&&(e=e.substr(e.indexOf(u)+1),s=e.match(r),s.push(","),c=-1,u="/");else if(40===h||123===h||91===h)++l;else if(41===h||125===h||93===h)--l;else if(!t&&!i){t=34===h||39===h?u.slice(1,-1):u;continue}i?i.push(u):i=[u]}}return a}var t=["true","false","null","undefined"],i=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,r=RegExp("\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|/(?:[^/\\\\]|\\\\.)*/w*|[^\\s:,/][^,\"'{}()/:[\\]]*[^\\s,\"'{}()/:[\\]]|[^\\s]","g"),n=/[\])"'A-Za-z0-9_$]+$/,o={"in":1,"return":1,"typeof":1},a={};return{ha:[],V:a,Wa:e,ya:function(r,n){function o(e,r){var n;if(!c){var h=d.getBindingHandler(e);if(h&&h.preprocess&&!(r=h.preprocess(r,e,o)))return;(h=a[e])&&(n=r,0<=d.a.m(t,n)?n=!1:(h=n.match(i),n=null===h?!1:h[1]?"Object("+h[1]+")"+h[2]:n),h=n),h&&l.push("'"+e+"':function(_z){"+n+"=_z}")}u&&(r="function(){return "+r+" }"),s.push("'"+e+"':"+r)}n=n||{};var s=[],l=[],u=n.valueAccessors,c=n.bindingParams,h="string"==typeof r?e(r):r;return d.a.u(h,function(e){o(e.key||e.unknown,e.value)}),l.length&&o("_ko_property_writers","{"+l.join(",")+" }"),s.join(",")},lc:function(e,t){for(var i=0;i<e.length;i++)if(e[i].key==t)return!0;return!1},pa:function(e,t,i,r,n){e&&d.C(e)?!d.Ra(e)||n&&e.v()===r||e(r):(e=t.get("_ko_property_writers"))&&e[i]&&e[i](r)}}}(),d.b("expressionRewriting",d.h),d.b("expressionRewriting.bindingRewriteValidators",d.h.ha),d.b("expressionRewriting.parseObjectLiteral",d.h.Wa),d.b("expressionRewriting.preProcessBindings",d.h.ya),d.b("expressionRewriting._twoWayBindings",d.h.V),d.b("jsonExpressionRewriting",d.h),d.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",d.h.ya),function(){function e(e){return 8==e.nodeType&&a.test(o?e.text:e.nodeValue)}function t(e){return 8==e.nodeType&&s.test(o?e.text:e.nodeValue)}function i(i,r){for(var n=i,o=1,a=[];n=n.nextSibling;){if(t(n)&&(o--,0===o))return a;a.push(n),e(n)&&o++}if(!r)throw Error("Cannot find closing comment tag to match: "+i.nodeValue);return null}function r(e,t){var r=i(e,t);return r?0<r.length?r[r.length-1].nextSibling:e.nextSibling:null}var o=n&&"<!--test-->"===n.createComment("test").text,a=o?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,s=o?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,l={ul:!0,ol:!0};d.f={Q:{},childNodes:function(t){return e(t)?i(t):t.childNodes},ja:function(t){if(e(t)){t=d.f.childNodes(t);for(var i=0,r=t.length;r>i;i++)d.removeNode(t[i])}else d.a.Ka(t)},T:function(t,i){if(e(t)){d.f.ja(t);for(var r=t.nextSibling,n=0,o=i.length;o>n;n++)r.parentNode.insertBefore(i[n],r)}else d.a.T(t,i)},Hb:function(t,i){e(t)?t.parentNode.insertBefore(i,t.nextSibling):t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i)},Bb:function(t,i,r){r?e(t)?t.parentNode.insertBefore(i,r.nextSibling):r.nextSibling?t.insertBefore(i,r.nextSibling):t.appendChild(i):d.f.Hb(t,i)},firstChild:function(i){return e(i)?!i.nextSibling||t(i.nextSibling)?null:i.nextSibling:i.firstChild},nextSibling:function(i){return e(i)&&(i=r(i)),i.nextSibling&&t(i.nextSibling)?null:i.nextSibling},gc:e,xc:function(e){return(e=(o?e.text:e.nodeValue).match(a))?e[1]:null},Fb:function(i){if(l[d.a.t(i)]){var n=i.firstChild;if(n)do if(1===n.nodeType){var o;o=n.firstChild;var a=null;if(o)do if(a)a.push(o);else if(e(o)){var s=r(o,!0);s?o=s:a=[o]}else t(o)&&(a=[o]);while(o=o.nextSibling);if(o=a)for(a=n.nextSibling,s=0;s<o.length;s++)a?i.insertBefore(o[s],a):i.appendChild(o[s])}while(n=n.nextSibling)}}}}(),d.b("virtualElements",d.f),d.b("virtualElements.allowedBindings",d.f.Q),d.b("virtualElements.emptyNode",d.f.ja),d.b("virtualElements.insertAfter",d.f.Bb),d.b("virtualElements.prepend",d.f.Hb),d.b("virtualElements.setDomNodeChildren",d.f.T),function(){d.J=function(){this.Yb={}},d.a.extend(d.J.prototype,{nodeHasBindings:function(e){switch(e.nodeType){case 1:return null!=e.getAttribute("data-bind")||d.g.getComponentNameForNode(e);case 8:return d.f.gc(e);default:return!1}},getBindings:function(e,t){var i=this.getBindingsString(e,t),i=i?this.parseBindingsString(i,t,e):null;return d.g.mb(i,e,t,!1)},getBindingAccessors:function(e,t){var i=this.getBindingsString(e,t),i=i?this.parseBindingsString(i,t,e,{valueAccessors:!0}):null;return d.g.mb(i,e,t,!0)},getBindingsString:function(e){switch(e.nodeType){case 1:return e.getAttribute("data-bind");case 8:return d.f.xc(e);default:return null}},parseBindingsString:function(e,t,i,r){try{var n,o=this.Yb,a=e+(r&&r.valueAccessors||"");if(!(n=o[a])){var s,l="with($context){with($data||{}){return{"+d.h.ya(e,r)+"}}}";s=new Function("$context","$element",l),n=o[a]=s}return n(t,i)}catch(u){throw u.message="Unable to parse bindings.\nBindings value: "+e+"\nMessage: "+u.message,u}}}),d.J.instance=new d.J}(),d.b("bindingProvider",d.J),function(){function t(e){return function(){return e}}function i(e){return e()}function n(e){return d.a.na(d.k.B(e),function(t,i){return function(){return e()[i]}})}function o(e,t){return n(this.getBindings.bind(this,e,t))}function s(e,t,i){var r,n=d.f.firstChild(t),o=d.J.instance,a=o.preprocessNode;if(a){for(;r=n;)n=d.f.nextSibling(r),a.call(o,r);n=d.f.firstChild(t)}for(;r=n;)n=d.f.nextSibling(r),l(e,r,i)}function l(e,t,i){var r=!0,n=1===t.nodeType;n&&d.f.Fb(t),(n&&i||d.J.instance.nodeHasBindings(t))&&(r=c(t,null,e,i).shouldBindDescendants),r&&!p[d.a.t(t)]&&s(e,t,!n)}function u(e){var t=[],i={},r=[];return d.a.G(e,function n(o){if(!i[o]){var a=d.getBindingHandler(o);a&&(a.after&&(r.push(o),d.a.u(a.after,function(t){if(e[t]){if(-1!==d.a.m(r,t))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+r.join(", "));n(t)}}),r.length--),t.push({key:o,zb:a})),i[o]=!0}}),t}function c(t,r,n,a){var s=d.a.e.get(t,m);if(!r){if(s)throw Error("You cannot apply bindings multiple times to the same element.");d.a.e.set(t,m,!0)}!s&&a&&d.Ob(t,n);var l;if(r&&"function"!=typeof r)l=r;else{var c=d.J.instance,h=c.getBindingAccessors||o,p=d.j(function(){return(l=r?r(n,t):h.call(c,t,n))&&n.I&&n.I(),l},null,{o:t});l&&p.Z()||(p=null)}var f;if(l){var v=p?function(e){return function(){return i(p()[e])}}:function(e){return l[e]},g=function(){return d.a.na(p?p():l,i)};g.get=function(e){return l[e]&&i(v(e))},g.has=function(e){return e in l},a=u(l),d.a.u(a,function(i){var r=i.zb.init,o=i.zb.update,a=i.key;if(8===t.nodeType&&!d.f.Q[a])throw Error("The binding '"+a+"' cannot be used with virtual elements");try{"function"==typeof r&&d.k.B(function(){var i=r(t,v(a),g,n.$data,n);if(i&&i.controlsDescendantBindings){if(f!==e)throw Error("Multiple bindings ("+f+" and "+a+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");f=a}}),"function"==typeof o&&d.j(function(){o(t,v(a),g,n.$data,n)},null,{o:t})}catch(s){throw s.message='Unable to process binding "'+a+": "+l[a]+'"\nMessage: '+s.message,s}})}return{shouldBindDescendants:f===e}}function h(e){return e&&e instanceof d.N?e:new d.N(e)}d.d={};var p={script:!0};d.getBindingHandler=function(e){return d.d[e]},d.N=function(t,i,r,n){var o,a=this,s="function"==typeof t&&!d.C(t),l=d.j(function(){var e=s?t():t,o=d.a.c(e);return i?(i.I&&i.I(),d.a.extend(a,i),l&&(a.I=l)):(a.$parents=[],a.$root=o,a.ko=d),a.$rawData=e,a.$data=o,r&&(a[r]=o),n&&n(a,i,o),a.$data},null,{Ia:function(){return o&&!d.a.ob(o)},o:!0});l.Z()&&(a.I=l,l.equalityComparer=null,o=[],l.Tb=function(t){o.push(t),d.a.w.da(t,function(t){d.a.ua(o,t),o.length||(l.K(),a.I=l=e)})})},d.N.prototype.createChildContext=function(e,t,i){return new d.N(e,this,t,function(e,t){e.$parentContext=t,e.$parent=t.$data,e.$parents=(t.$parents||[]).slice(0),e.$parents.unshift(e.$parent),i&&i(e)})},d.N.prototype.extend=function(e){return new d.N(this.I||this.$data,this,null,function(t,i){t.$rawData=i.$rawData,d.a.extend(t,"function"==typeof e?e():e)})};var m=d.a.e.F(),f=d.a.e.F();d.Ob=function(e,t){return 2!=arguments.length?d.a.e.get(e,f):(d.a.e.set(e,f,t),void(t.I&&t.I.Tb(e)))},d.ra=function(e,t,i){return 1===e.nodeType&&d.f.Fb(e),c(e,t,h(i),!0)},d.Wb=function(e,i,r){return r=h(r),d.ra(e,"function"==typeof i?n(i.bind(null,r,e)):d.a.na(i,t),r)},d.Ca=function(e,t){1!==t.nodeType&&8!==t.nodeType||s(h(e),t,!0)},d.pb=function(e,t){if(!a&&r.jQuery&&(a=r.jQuery),t&&1!==t.nodeType&&8!==t.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");t=t||r.document.body,l(h(e),t,!0)},d.Ha=function(t){switch(t.nodeType){case 1:case 8:var i=d.Ob(t);if(i)return i;if(t.parentNode)return d.Ha(t.parentNode)}return e},d.$b=function(t){return(t=d.Ha(t))?t.$data:e},d.b("bindingHandlers",d.d),d.b("applyBindings",d.pb),d.b("applyBindingsToDescendants",d.Ca),d.b("applyBindingAccessorsToNode",d.ra),d.b("applyBindingsToNode",d.Wb),d.b("contextFor",d.Ha),d.b("dataFor",d.$b)}(),function(e){function t(t,r){var a,s=n.hasOwnProperty(t)?n[t]:e;s||(s=n[t]=new d.P,i(t,function(e){o[t]=e,delete n[t],a?s.notifySubscribers(e):setTimeout(function(){s.notifySubscribers(e)},0)}),a=!0),s.U(r)}function i(e,t){r("getConfig",[e],function(i){i?r("loadComponent",[e,i],function(e){t(e)}):t(null)})}function r(t,i,n,o){o||(o=d.g.loaders.slice(0));var a=o.shift();if(a){var s=a[t];if(s){var l=!1;if(s.apply(a,i.concat(function(e){l?n(null):null!==e?n(e):r(t,i,n,o)}))!==e&&(l=!0,!a.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else r(t,i,n,o)}else n(null)}var n={},o={};d.g={get:function(i,r){var n=o.hasOwnProperty(i)?o[i]:e;n?setTimeout(function(){r(n)},0):t(i,r)},tb:function(e){delete o[e]},jb:r},d.g.loaders=[],d.b("components",d.g),d.b("components.get",d.g.get),d.b("components.clearCachedDefinition",d.g.tb)}(),function(){function e(e,t,i,r){function n(){0===--a&&r(o)}var o={},a=2,l=i.template;i=i.viewModel,l?s(t,l,function(t){d.g.jb("loadTemplate",[e,t],function(e){o.template=e,n()})}):n(),i?s(t,i,function(t){d.g.jb("loadViewModel",[e,t],function(e){o[c]=e,n()})}):n()}function t(e,i,r){if("function"==typeof i)r(function(e){return new i(e)});else if("function"==typeof i[c])r(i[c]);else if("instance"in i){var n=i.instance;r(function(){return n})}else"viewModel"in i?t(e,i.viewModel,r):e("Unknown viewModel value: "+i)}function o(e){switch(d.a.t(e)){case"script":return d.a.ba(e.text);case"textarea":return d.a.ba(e.value);case"template":if(a(e.content))return d.a.ia(e.content.childNodes)}return d.a.ia(e.childNodes)}function a(e){return r.DocumentFragment?e instanceof DocumentFragment:e&&11===e.nodeType}function s(e,t,n){"string"==typeof t.require?i||r.require?(i||r.require)([t.require],n):e("Uses require, but no AMD loader is present"):n(t)}function l(e){return function(t){throw Error("Component '"+e+"': "+t)}}var u={};d.g.tc=function(e,t){if(!t)throw Error("Invalid configuration for "+e);if(d.g.Qa(e))throw Error("Component "+e+" is already registered");u[e]=t},d.g.Qa=function(e){return e in u},d.g.wc=function(e){delete u[e],d.g.tb(e)},d.g.ub={getConfig:function(e,t){t(u.hasOwnProperty(e)?u[e]:null)},loadComponent:function(t,i,r){var n=l(t);s(n,i,function(i){e(t,n,i,r)})},loadTemplate:function(e,t,i){if(e=l(e),"string"==typeof t)i(d.a.ba(t));else if(t instanceof Array)i(t);else if(a(t))i(d.a.S(t.childNodes));else if(t.element)if(t=t.element,r.HTMLElement?t instanceof HTMLElement:t&&t.tagName&&1===t.nodeType)i(o(t));else if("string"==typeof t){var s=n.getElementById(t);s?i(o(s)):e("Cannot find element with ID "+t)}else e("Unknown element type: "+t);else e("Unknown template value: "+t)},loadViewModel:function(e,i,r){t(l(e),i,r)}};var c="createViewModel";d.b("components.register",d.g.tc),d.b("components.isRegistered",d.g.Qa),d.b("components.unregister",d.g.wc),d.b("components.defaultLoader",d.g.ub),d.g.loaders.push(d.g.ub),d.g.Ub=u}(),function(){function e(e,i){var r=e.getAttribute("params");if(r){var r=t.parseBindingsString(r,i,e,{valueAccessors:!0,bindingParams:!0}),r=d.a.na(r,function(t){return d.s(t,null,{o:e})}),n=d.a.na(r,function(t){return t.Z()?d.s(function(){return d.a.c(t())},null,{o:e}):t.v()});return n.hasOwnProperty("$raw")||(n.$raw=r),n}return{$raw:{}}}d.g.getComponentNameForNode=function(e){return e=d.a.t(e),d.g.Qa(e)&&e},d.g.mb=function(t,i,r,n){if(1===i.nodeType){var o=d.g.getComponentNameForNode(i);if(o){if(t=t||{},t.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var a={name:o,params:e(i,r)};t.component=n?function(){return a}:a}}return t};var t=new d.J;9>d.a.L&&(d.g.register=function(e){return function(t){return n.createElement(t),e.apply(this,arguments)}}(d.g.register),n.createDocumentFragment=function(e){return function(){var t,i=e(),r=d.g.Ub;for(t in r)r.hasOwnProperty(t)&&i.createElement(t);return i}}(n.createDocumentFragment))}(),function(){var e=0;d.d.component={init:function(t,i,r,n,o){function a(){var e=s&&s.dispose;"function"==typeof e&&e.call(s),l=null}var s,l;return d.a.w.da(t,a),d.s(function(){var r,n,u=d.a.c(i());if("string"==typeof u?r=u:(r=d.a.c(u.name),n=d.a.c(u.params)),!r)throw Error("No component name specified");var c=l=++e;d.g.get(r,function(e){if(l===c){if(a(),!e)throw Error("Unknown component '"+r+"'");var i=e.template;if(!i)throw Error("Component '"+r+"' has no template");i=d.a.ia(i),d.f.T(t,i);var i=n,u=e.createViewModel;e=u?u.call(e,i,{element:t}):i,i=o.createChildContext(e),s=e,d.Ca(i,t)}})},null,{o:t}),{controlsDescendantBindings:!0}}},d.f.Q.component=!0}();var _={"class":"className","for":"htmlFor"};d.d.attr={update:function(t,i){var r=d.a.c(i())||{};d.a.G(r,function(i,r){r=d.a.c(r);var n=!1===r||null===r||r===e;n&&t.removeAttribute(i),8>=d.a.L&&i in _?(i=_[i],n?t.removeAttribute(i):t[i]=r):n||t.setAttribute(i,r.toString()),"name"===i&&d.a.Mb(t,n?"":r.toString())})}},function(){d.d.checked={after:["value","attr"],init:function(t,i,r){function n(){var e=t.checked,n=h?a():e;if(!d.Y.ma()&&(!l||e)){var o=d.k.B(i);u?c!==n?(e&&(d.a.ea(o,n,!0),d.a.ea(o,c,!1)),c=n):d.a.ea(o,n,e):d.h.pa(o,r,"checked",n,!0)}}function o(){var e=d.a.c(i());t.checked=u?0<=d.a.m(e,a()):s?e:a()===e}var a=d.Ib(function(){return r.has("checkedValue")?d.a.c(r.get("checkedValue")):r.has("value")?d.a.c(r.get("value")):t.value}),s="checkbox"==t.type,l="radio"==t.type;if(s||l){var u=s&&d.a.c(i())instanceof Array,c=u?a():e,h=l||u;l&&!t.name&&d.d.uniqueName.init(t,function(){return!0}),d.s(n,null,{o:t}),d.a.n(t,"click",n),d.s(o,null,{o:t})}}},d.h.V.checked=!0,d.d.checkedValue={update:function(e,t){e.value=d.a.c(t())}}}(),d.d.css={update:function(e,t){var i=d.a.c(t());"object"==typeof i?d.a.G(i,function(t,i){i=d.a.c(i),d.a.Ba(e,t,i)}):(i=String(i||""),d.a.Ba(e,e.__ko__cssValue,!1),e.__ko__cssValue=i,d.a.Ba(e,i,!0))}},d.d.enable={update:function(e,t){var i=d.a.c(t());i&&e.disabled?e.removeAttribute("disabled"):i||e.disabled||(e.disabled=!0)}},d.d.disable={update:function(e,t){d.d.enable.update(e,function(){return!d.a.c(t())})}},d.d.event={init:function(e,t,i,r,n){var o=t()||{};d.a.G(o,function(o){"string"==typeof o&&d.a.n(e,o,function(e){var a,s=t()[o];if(s){try{var l=d.a.S(arguments);r=n.$data,l.unshift(r),a=s.apply(r,l)}finally{!0!==a&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}!1===i.get(o+"Bubble")&&(e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation())}})})}},d.d.foreach={Eb:function(e){return function(){var t=e(),i=d.a.Xa(t);return i&&"number"!=typeof i.length?(d.a.c(t),{foreach:i.data,as:i.as,includeDestroyed:i.includeDestroyed,afterAdd:i.afterAdd,beforeRemove:i.beforeRemove,afterRender:i.afterRender,beforeMove:i.beforeMove,afterMove:i.afterMove,templateEngine:d.O.Oa}):{foreach:t,templateEngine:d.O.Oa}}},init:function(e,t){return d.d.template.init(e,d.d.foreach.Eb(t))},update:function(e,t,i,r,n){return d.d.template.update(e,d.d.foreach.Eb(t),i,r,n)}},d.h.ha.foreach=!1,d.f.Q.foreach=!0,d.d.hasfocus={init:function(e,t,i){function r(r){e.__ko_hasfocusUpdating=!0;var n=e.ownerDocument;if("activeElement"in n){var o;try{o=n.activeElement}catch(a){o=n.body}r=o===e}n=t(),d.h.pa(n,i,"hasfocus",r,!0),e.__ko_hasfocusLastValue=r,e.__ko_hasfocusUpdating=!1}var n=r.bind(null,!0),o=r.bind(null,!1);d.a.n(e,"focus",n),d.a.n(e,"focusin",n),d.a.n(e,"blur",o),d.a.n(e,"focusout",o)},update:function(e,t){var i=!!d.a.c(t());e.__ko_hasfocusUpdating||e.__ko_hasfocusLastValue===i||(i?e.focus():e.blur(),d.k.B(d.a.oa,null,[e,i?"focusin":"focusout"]))}},d.h.V.hasfocus=!0,d.d.hasFocus=d.d.hasfocus,d.h.V.hasFocus=!0,d.d.html={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){d.a.$a(e,t())}},h("if"),h("ifnot",!1,!0),h("with",!0,!1,function(e,t){return e.createChildContext(t)});var y={};d.d.options={init:function(e){if("select"!==d.a.t(e))throw Error("options binding applies only to SELECT elements");for(;0<e.length;)e.remove(0);return{controlsDescendantBindings:!0}},update:function(t,i,r){function n(){return d.a.ta(t.options,function(e){return e.selected})}function o(e,t,i){var r=typeof t;return"function"==r?t(e):"string"==r?e[t]:i}function a(e,i){if(h.length){var r=0<=d.a.m(h,d.i.q(i[0]));d.a.Nb(i[0],r),p&&!r&&d.k.B(d.a.oa,null,[t,"change"])}}var s=0!=t.length&&t.multiple?t.scrollTop:null,l=d.a.c(i()),u=r.get("optionsIncludeDestroyed");i={};var c,h;h=t.multiple?d.a.Da(n(),d.i.q):0<=t.selectedIndex?[d.i.q(t.options[t.selectedIndex])]:[],l&&("undefined"==typeof l.length&&(l=[l]),c=d.a.ta(l,function(t){return u||t===e||null===t||!d.a.c(t._destroy)}),r.has("optionsCaption")&&(l=d.a.c(r.get("optionsCaption")),null!==l&&l!==e&&c.unshift(y)));var p=!1;i.beforeRemove=function(e){t.removeChild(e)},l=a,r.has("optionsAfterRender")&&(l=function(t,i){a(0,i),d.k.B(r.get("optionsAfterRender"),null,[i[0],t!==y?t:e])}),d.a.Za(t,c,function(i,n,a){return a.length&&(h=a[0].selected?[d.i.q(a[0])]:[],p=!0),n=t.ownerDocument.createElement("option"),i===y?(d.a.bb(n,r.get("optionsCaption")),d.i.ca(n,e)):(a=o(i,r.get("optionsValue"),i),d.i.ca(n,d.a.c(a)),i=o(i,r.get("optionsText"),a),d.a.bb(n,i)),[n]},i,l),d.k.B(function(){r.get("valueAllowUnset")&&r.has("value")?d.i.ca(t,d.a.c(r.get("value")),!0):(t.multiple?h.length&&n().length<h.length:h.length&&0<=t.selectedIndex?d.i.q(t.options[t.selectedIndex])!==h[0]:h.length||0<=t.selectedIndex)&&d.a.oa(t,"change")}),d.a.dc(t),s&&20<Math.abs(s-t.scrollTop)&&(t.scrollTop=s)}},d.d.options.Va=d.a.e.F(),d.d.selectedOptions={after:["options","foreach"],init:function(e,t,i){d.a.n(e,"change",function(){var r=t(),n=[];d.a.u(e.getElementsByTagName("option"),function(e){e.selected&&n.push(d.i.q(e))}),d.h.pa(r,i,"selectedOptions",n)})},update:function(e,t){if("select"!=d.a.t(e))throw Error("values binding applies only to SELECT elements");var i=d.a.c(t());i&&"number"==typeof i.length&&d.a.u(e.getElementsByTagName("option"),function(e){var t=0<=d.a.m(i,d.i.q(e));d.a.Nb(e,t)})}},d.h.V.selectedOptions=!0,d.d.style={update:function(t,i){var r=d.a.c(i()||{});d.a.G(r,function(i,r){r=d.a.c(r),(null===r||r===e||!1===r)&&(r=""),t.style[i]=r})}},d.d.submit={init:function(e,t,i,r,n){if("function"!=typeof t())throw Error("The value for a submit binding must be a function");d.a.n(e,"submit",function(i){var r,o=t();try{r=o.call(n.$data,e)}finally{!0!==r&&(i.preventDefault?i.preventDefault():i.returnValue=!1)}})}},d.d.text={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){d.a.bb(e,t())}},d.f.Q.text=!0,function(){if(r&&r.navigator)var t=function(e){return e?parseFloat(e[1]):void 0},i=r.opera&&r.opera.version&&parseInt(r.opera.version()),n=r.navigator.userAgent,o=t(n.match(/^(?:(?!chrome).)*version\/([^ ]*) safari/i)),a=t(n.match(/Firefox\/([^ ]*)/));if(10>d.a.L)var s=d.a.e.F(),l=d.a.e.F(),u=function(e){var t=this.activeElement;(t=t&&d.a.e.get(t,l))&&t(e)},c=function(e,t){var i=e.ownerDocument;d.a.e.get(i,s)||(d.a.e.set(i,s,!0),d.a.n(i,"selectionchange",u)),d.a.e.set(e,l,t)};d.d.textInput={init:function(t,r,n){function s(e,i){d.a.n(t,e,i)}function l(){var i=d.a.c(r());(null===i||i===e)&&(i=""),m!==e&&i===m?setTimeout(l,4):t.value!==i&&(f=i,t.value=i)}function u(){p||(m=t.value,p=setTimeout(h,4))}function h(){clearTimeout(p),m=p=e;var i=t.value;f!==i&&(f=i,d.h.pa(r(),n,"textInput",i))}var p,m,f=t.value;10>d.a.L?(s("propertychange",function(e){"value"===e.propertyName&&h()}),8==d.a.L&&(s("keyup",h),s("keydown",h)),8<=d.a.L&&(c(t,h),s("dragend",u))):(s("input",h),5>o&&"textarea"===d.a.t(t)?(s("keydown",u),s("paste",u),s("cut",u)):11>i?s("keydown",u):4>a&&(s("DOMAutoComplete",h),s("dragdrop",h),s("drop",h))),s("change",h),d.s(l,null,{o:t})}},d.h.V.textInput=!0,d.d.textinput={preprocess:function(e,t,i){i("textInput",e)}}}(),d.d.uniqueName={init:function(e,t){if(t()){var i="ko_unique_"+ ++d.d.uniqueName.Zb;d.a.Mb(e,i)}}},d.d.uniqueName.Zb=0,d.d.value={after:["options","foreach"],init:function(e,t,i){if("input"!=e.tagName.toLowerCase()||"checkbox"!=e.type&&"radio"!=e.type){var r=["change"],n=i.get("valueUpdate"),o=!1,a=null;n&&("string"==typeof n&&(n=[n]),d.a.ga(r,n),r=d.a.rb(r));var s=function(){a=null,o=!1;var r=t(),n=d.i.q(e);d.h.pa(r,i,"value",n)};!d.a.L||"input"!=e.tagName.toLowerCase()||"text"!=e.type||"off"==e.autocomplete||e.form&&"off"==e.form.autocomplete||-1!=d.a.m(r,"propertychange")||(d.a.n(e,"propertychange",function(){o=!0}),d.a.n(e,"focus",function(){o=!1}),d.a.n(e,"blur",function(){o&&s()})),d.a.u(r,function(t){var i=s;d.a.vc(t,"after")&&(i=function(){a=d.i.q(e),setTimeout(s,0)},t=t.substring(5)),d.a.n(e,t,i)});var l=function(){var r=d.a.c(t()),n=d.i.q(e);if(null!==a&&r===a)setTimeout(l,0);else if(r!==n)if("select"===d.a.t(e)){var o=i.get("valueAllowUnset"),n=function(){d.i.ca(e,r,o)};n(),o||r===d.i.q(e)?setTimeout(n,0):d.k.B(d.a.oa,null,[e,"change"])}else d.i.ca(e,r)};d.s(l,null,{o:e})}else d.ra(e,{checkedValue:t})},update:function(){}},d.h.V.value=!0,d.d.visible={update:function(e,t){var i=d.a.c(t()),r="none"!=e.style.display;i&&!r?e.style.display="":!i&&r&&(e.style.display="none")}},function(e){d.d[e]={init:function(t,i,r,n,o){return d.d.event.init.call(this,t,function(){var t={};return t[e]=i(),t},r,n,o)}}}("click"),d.H=function(){},d.H.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},d.H.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},d.H.prototype.makeTemplateSource=function(e,t){if("string"==typeof e){t=t||n;var i=t.getElementById(e);if(!i)throw Error("Cannot find template with ID "+e);return new d.r.l(i)}if(1==e.nodeType||8==e.nodeType)return new d.r.fa(e);throw Error("Unknown template type: "+e)},d.H.prototype.renderTemplate=function(e,t,i,r){return e=this.makeTemplateSource(e,r),this.renderTemplateSource(e,t,i)},d.H.prototype.isTemplateRewritten=function(e,t){return!1===this.allowTemplateRewriting?!0:this.makeTemplateSource(e,t).data("isRewritten")},d.H.prototype.rewriteTemplate=function(e,t,i){e=this.makeTemplateSource(e,i),t=t(e.text()),e.text(t),e.data("isRewritten",!0)},d.b("templateEngine",d.H),d.fb=function(){function e(e,t,i,r){e=d.h.Wa(e);for(var n=d.h.ha,o=0;o<e.length;o++){var a=e[o].key;if(n.hasOwnProperty(a)){var s=n[a];if("function"==typeof s){if(a=s(e[o].value))throw Error(a)}else if(!s)throw Error("This template engine does not support the '"+a+"' binding within its templates")}}return i="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+d.h.ya(e,{valueAccessors:!0})+" } })()},'"+i.toLowerCase()+"')",r.createJavaScriptEvaluatorBlock(i)+t}var t=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,i=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{ec:function(e,t,i){t.isTemplateRewritten(e,i)||t.rewriteTemplate(e,function(e){return d.fb.nc(e,t)},i)},nc:function(r,n){return r.replace(t,function(t,i,r,o,a){return e(a,i,r,n)}).replace(i,function(t,i){return e(i,"<!-- ko -->","#comment",n)})},Xb:function(e,t){return d.D.Ua(function(i,r){var n=i.nextSibling;n&&n.nodeName.toLowerCase()===t&&d.ra(n,e,r)})}}}(),d.b("__tr_ambtns",d.fb.Xb),function(){d.r={},d.r.l=function(e){this.l=e},d.r.l.prototype.text=function(){var e=d.a.t(this.l),e="script"===e?"text":"textarea"===e?"value":"innerHTML";if(0==arguments.length)return this.l[e];var t=arguments[0];"innerHTML"===e?d.a.$a(this.l,t):this.l[e]=t};var t=d.a.e.F()+"_";d.r.l.prototype.data=function(e){return 1===arguments.length?d.a.e.get(this.l,t+e):void d.a.e.set(this.l,t+e,arguments[1])};var i=d.a.e.F();d.r.fa=function(e){this.l=e},d.r.fa.prototype=new d.r.l,d.r.fa.prototype.text=function(){if(0==arguments.length){var t=d.a.e.get(this.l,i)||{};return t.gb===e&&t.Ga&&(t.gb=t.Ga.innerHTML),t.gb}d.a.e.set(this.l,i,{gb:arguments[0]})},d.r.l.prototype.nodes=function(){return 0==arguments.length?(d.a.e.get(this.l,i)||{}).Ga:void d.a.e.set(this.l,i,{Ga:arguments[0]})},d.b("templateSources",d.r),d.b("templateSources.domElement",d.r.l),d.b("templateSources.anonymousTemplate",d.r.fa)}(),function(){function t(e,t,i){var r;for(t=d.f.nextSibling(t);e&&(r=e)!==t;)e=d.f.nextSibling(r),i(r,e)}function i(e,i){if(e.length){var r=e[0],n=e[e.length-1],o=r.parentNode,a=d.J.instance,s=a.preprocessNode;if(s){if(t(r,n,function(e,t){var i=e.previousSibling,o=s.call(a,e);o&&(e===r&&(r=o[0]||t),e===n&&(n=o[o.length-1]||i))}),e.length=0,!r)return;r===n?e.push(r):(e.push(r,n),d.a.ka(e,o))}t(r,n,function(e){1!==e.nodeType&&8!==e.nodeType||d.pb(i,e)}),t(r,n,function(e){1!==e.nodeType&&8!==e.nodeType||d.D.Sb(e,[i])}),d.a.ka(e,o)}}function r(e){return e.nodeType?e:0<e.length?e[0]:null}function n(e,t,n,a,s){s=s||{};var l=e&&r(e),l=l&&l.ownerDocument,u=s.templateEngine||o;if(d.fb.ec(n,u,l),n=u.renderTemplate(n,a,s,l),"number"!=typeof n.length||0<n.length&&"number"!=typeof n[0].nodeType)throw Error("Template engine must return an array of DOM nodes");switch(l=!1,t){case"replaceChildren":d.f.T(e,n),l=!0;break;case"replaceNode":d.a.Lb(e,n),l=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+t)}return l&&(i(n,a),s.afterRender&&d.k.B(s.afterRender,null,[n,a.$data])),n}var o;d.ab=function(t){if(t!=e&&!(t instanceof d.H))throw Error("templateEngine must inherit from ko.templateEngine");o=t},d.Ya=function(t,i,a,s,l){if(a=a||{},(a.templateEngine||o)==e)throw Error("Set a template engine before calling renderTemplate");if(l=l||"replaceChildren",s){var u=r(s);return d.j(function(){var e=i&&i instanceof d.N?i:new d.N(d.a.c(i)),o=d.C(t)?t():"function"==typeof t?t(e.$data,e):t,e=n(s,l,o,e,a);"replaceNode"==l&&(s=e,u=r(s))},null,{Ia:function(){return!u||!d.a.Ja(u)},o:u&&"replaceNode"==l?u.parentNode:u})}return d.D.Ua(function(e){d.Ya(t,i,a,e,"replaceNode")})},d.uc=function(t,r,o,a,s){function l(e,t){i(t,c),o.afterRender&&o.afterRender(t,e)}function u(e,i){c=s.createChildContext(e,o.as,function(e){e.$index=i});var r=d.C(t)?t():"function"==typeof t?t(e,c):t;return n(null,"ignoreTargetNode",r,c,o)}var c;return d.j(function(){var t=d.a.c(r)||[];"undefined"==typeof t.length&&(t=[t]),t=d.a.ta(t,function(t){return o.includeDestroyed||t===e||null===t||!d.a.c(t._destroy)}),d.k.B(d.a.Za,null,[a,t,u,o,l])},null,{o:a})};var a=d.a.e.F();d.d.template={init:function(e,t){var i=d.a.c(t());return"string"==typeof i||i.name?d.f.ja(e):(i=d.f.childNodes(e),i=d.a.oc(i),new d.r.fa(e).nodes(i)),{controlsDescendantBindings:!0}},update:function(t,i,r,n,o){var s,l=i();i=d.a.c(l),r=!0,n=null,"string"==typeof i?i={}:(l=i.name,"if"in i&&(r=d.a.c(i["if"])),r&&"ifnot"in i&&(r=!d.a.c(i.ifnot)),s=d.a.c(i.data)),"foreach"in i?n=d.uc(l||t,r&&i.foreach||[],i,t,o):r?(o="data"in i?o.createChildContext(s,i.as):o,n=d.Ya(l||t,o,i,t)):d.f.ja(t),o=n,(s=d.a.e.get(t,a))&&"function"==typeof s.K&&s.K(),d.a.e.set(t,a,o&&o.Z()?o:e)}},d.h.ha.template=function(e){return e=d.h.Wa(e),1==e.length&&e[0].unknown||d.h.lc(e,"name")?null:"This template engine does not support anonymous templates nested within its templates"},d.f.Q.template=!0}(),d.b("setTemplateEngine",d.ab),d.b("renderTemplate",d.Ya),d.a.wb=function(e,t,i){if(e.length&&t.length){var r,n,o,a,s;for(r=n=0;(!i||i>r)&&(a=e[n]);++n){for(o=0;s=t[o];++o)if(a.value===s.value){a.moved=s.index,s.moved=a.index,t.splice(o,1),r=o=0;break}r+=o}}},d.a.Fa=function(){function e(e,t,i,r,n){var o,a,s,l,u,c=Math.min,h=Math.max,p=[],m=e.length,f=t.length,v=f-m||1,g=m+f+1;for(o=0;m>=o;o++)for(l=s,p.push(s=[]),u=c(f,o+v),a=h(0,o-1);u>=a;a++)s[a]=a?o?e[o-1]===t[a-1]?l[a-1]:c(l[a]||g,s[a-1]||g)+1:a+1:o+1;for(c=[],h=[],v=[],o=m,a=f;o||a;)f=p[o][a]-1,a&&f===p[o][a-1]?h.push(c[c.length]={status:i,value:t[--a],index:a}):o&&f===p[o-1][a]?v.push(c[c.length]={status:r,value:e[--o],index:o}):(--a,--o,n.sparse||c.push({status:"retained",value:t[a]}));return d.a.wb(h,v,10*m),c.reverse()}return function(t,i,r){return r="boolean"==typeof r?{dontLimitMoves:r}:r||{},t=t||[],i=i||[],t.length<=i.length?e(t,i,"added","deleted",r):e(i,t,"deleted","added",r)}}(),d.b("utils.compareArrays",d.a.Fa),function(){function t(t,i,r,n,o){var a=[],s=d.j(function(){var e=i(r,o,d.a.ka(a,t))||[];0<a.length&&(d.a.Lb(a,e),n&&d.k.B(n,null,[r,e,o])),a.length=0,d.a.ga(a,e)},null,{o:t,Ia:function(){return!d.a.ob(a)}});return{$:a,j:s.Z()?s:e}}var i=d.a.e.F();d.a.Za=function(r,n,o,a,s){function l(e,t){C=h[t],g!==t&&(w[e]=C),C.Na(g++),d.a.ka(C.$,r),f.push(C),y.push(C)}function u(e,t){if(e)for(var i=0,r=t.length;r>i;i++)t[i]&&d.a.u(t[i].$,function(r){e(r,i,t[i].sa)})}n=n||[],a=a||{};var c=d.a.e.get(r,i)===e,h=d.a.e.get(r,i)||[],p=d.a.Da(h,function(e){return e.sa}),m=d.a.Fa(p,n,a.dontLimitMoves),f=[],v=0,g=0,_=[],y=[];n=[];for(var C,E,S,w=[],p=[],T=0;E=m[T];T++)switch(S=E.moved,E.status){case"deleted":S===e&&(C=h[v],C.j&&C.j.K(),_.push.apply(_,d.a.ka(C.$,r)),a.beforeRemove&&(n[T]=C,y.push(C))),v++;break;case"retained":l(T,v++);break;case"added":S!==e?l(T,S):(C={sa:E.value,Na:d.p(g++)},f.push(C),y.push(C),c||(p[T]=C))}u(a.beforeMove,w),d.a.u(_,a.beforeRemove?d.R:d.removeNode);for(var x,T=0,c=d.f.firstChild(r);C=y[T];T++){for(C.$||d.a.extend(C,t(r,o,C.sa,s,C.Na)),v=0;m=C.$[v];c=m.nextSibling,x=m,v++)m!==c&&d.f.Bb(r,m,x);!C.ic&&s&&(s(C.sa,C.$,C.Na),C.ic=!0)}u(a.beforeRemove,n),u(a.afterMove,w),u(a.afterAdd,p),d.a.e.set(r,i,f)}}(),d.b("utils.setDomNodeChildrenFromArrayMapping",d.a.Za),d.O=function(){this.allowTemplateRewriting=!1},d.O.prototype=new d.H,d.O.prototype.renderTemplateSource=function(e){var t=(9>d.a.L?0:e.nodes)?e.nodes():null;return t?d.a.S(t.cloneNode(!0).childNodes):(e=e.text(),d.a.ba(e))},d.O.Oa=new d.O,d.ab(d.O.Oa),d.b("nativeTemplateEngine",d.O),function(){d.Sa=function(){var e=this.kc=function(){if(!a||!a.tmpl)return 0;try{if(0<=a.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(e){}return 1}();this.renderTemplateSource=function(t,i,r){if(r=r||{},2>e)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var o=t.data("precompiled");return o||(o=t.text()||"",o=a.template(null,"{{ko_with $item.koBindingContext}}"+o+"{{/ko_with}}"),t.data("precompiled",o)),t=[i.$data],i=a.extend({koBindingContext:i},r.templateOptions),i=a.tmpl(o,t,i),i.appendTo(n.createElement("div")),a.fragments={},i},this.createJavaScriptEvaluatorBlock=function(e){return"{{ko_code ((function() { return "+e+" })()) }}"},this.addTemplate=function(e,t){n.write("<script type='text/html' id='"+e+"'>"+t+"</script>")},e>0&&(a.tmpl.tag.ko_code={open:"__.push($1 || '');"},a.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},d.Sa.prototype=new d.H;var e=new d.Sa;0<e.kc&&d.ab(e),d.b("jqueryTmplTemplateEngine",d.Sa)}()})}()}(),i("ThirdParty/knockout-es5",[],function(){"use strict";function e(e,i){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,o=t(e,!0);return i=i||Object.getOwnPropertyNames(e),i.forEach(function(t){if(t!==h&&t!==d&&!(t in o)){var i=e[t],a=i instanceof Array,s=n.isObservable(i)?i:a?n.observableArray(i):n.observable(i); -Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:s,set:n.isWriteableObservable(s)?s:void 0}),o[t]=s,a&&r(n,s)}}),e}function t(e,t){var i=e[h];return!i&&t&&(i={},Object.defineProperty(e,h,{value:i})),i}function i(t,i,r){var n=this,o={owner:t,deferEvaluation:!0};if("function"==typeof r)o.read=r;else{if("value"in r)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if("function"!=typeof r.get)throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');o.read=r.get,o.write=r.set}return t[i]=n.computed(o),e.call(n,t,[i]),t}function r(e,t){var i=null;e.computed(function(){i&&(i.dispose(),i=null);var r=t();r instanceof Array&&(i=n(e,t,r))})}function n(e,t,i){var r=o(e,i);return r.subscribe(t)}function o(e,t){var i=t[d];if(!i){i=new e.subscribable,Object.defineProperty(t,d,{value:i});var r={};a(t,i,r),s(e,t,i,r)}return i}function a(e,t,i){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(r){var n=e[r];e[r]=function(){var e=n.apply(this,arguments);return i.pause!==!0&&t.notifySubscribers(this),e}})}function s(e,t,i,r){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(n){Object.defineProperty(t,n,{enumerable:!1,value:function(){var o;r.pause=!0;try{o=e.observableArray.fn[n].apply(e.observableArray(t),arguments)}finally{r.pause=!1}return i.notifySubscribers(t),o}})})}function l(e,i){if(!e)return null;var r=t(e,!1);return r&&r[i]||null}function u(e,t){var i=l(e,t);i&&i.valueHasMutated()}function c(t){t.track=e,t.getObservable=l,t.valueHasMutated=u,t.defineProperty=i}var h="__knockoutObservables",d="__knockoutSubscribable";return{attachToKo:c}}),i("Widgets/SvgPathBindingHandler",[],function(){"use strict";var e="http://www.w3.org/2000/svg",t="cesium-svgPath-svg",i={register:function(i){i.bindingHandlers.cesiumSvgPath={init:function(r,n){var o=document.createElementNS(e,"svg:svg");o.setAttribute("class",t);var a=document.createElementNS(e,"path");return o.appendChild(a),i.virtualElements.setDomNodeChildren(r,[o]),i.computed({read:function(){var e=i.unwrap(n());a.setAttribute("d",i.unwrap(e.path));var r=i.unwrap(e.width),s=i.unwrap(e.height);o.setAttribute("width",r),o.setAttribute("height",s),o.setAttribute("viewBox","0 0 "+r+" "+s),e.css&&o.setAttribute("class",t+" "+i.unwrap(e.css))},disposeWhenNodeIsRemoved:r}),{controlsDescendantBindings:!0}}},i.virtualElements.allowedBindings.cesiumSvgPath=!0}};return i}),i("ThirdParty/knockout",["./knockout-3.2.0","./knockout-es5","../Widgets/SvgPathBindingHandler"],function(e,t,i){"use strict";return t.attachToKo(e),i.register(e),e}),i("ThirdParty/NoSleep",[],function(){"use strict";function e(e,t,i){var r=document.createElement("source");r.src=i,r.type="video/"+t,e.appendChild(r)}var t={Android:/Android/gi.test(navigator.userAgent),iOS:/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent)},i={WebM:"data:video/webm;base64,GkXfo0AgQoaBAUL3gQFC8oEEQvOBCEKCQAR3ZWJtQoeBAkKFgQIYU4BnQI0VSalmQCgq17FAAw9CQE2AQAZ3aGFtbXlXQUAGd2hhbW15RIlACECPQAAAAAAAFlSua0AxrkAu14EBY8WBAZyBACK1nEADdW5khkAFVl9WUDglhohAA1ZQOIOBAeBABrCBCLqBCB9DtnVAIueBAKNAHIEAAIAwAQCdASoIAAgAAUAmJaQAA3AA/vz0AAA=",MP4:"data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAAAhmcmVlAAAAG21kYXQAAAGzABAHAAABthADAowdbb9/AAAC6W1vb3YAAABsbXZoZAAAAAB8JbCAfCWwgAAAA+gAAAAAAAEAAAEAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIVdHJhawAAAFx0a2hkAAAAD3wlsIB8JbCAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAIAAAACAAAAAABsW1kaWEAAAAgbWRoZAAAAAB8JbCAfCWwgAAAA+gAAAAAVcQAAAAAAC1oZGxyAAAAAAAAAAB2aWRlAAAAAAAAAAAAAAAAVmlkZW9IYW5kbGVyAAAAAVxtaW5mAAAAFHZtaGQAAAABAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAEcc3RibAAAALhzdHNkAAAAAAAAAAEAAACobXA0dgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAIAAgASAAAAEgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABj//wAAAFJlc2RzAAAAAANEAAEABDwgEQAAAAADDUAAAAAABS0AAAGwAQAAAbWJEwAAAQAAAAEgAMSNiB9FAEQBFGMAAAGyTGF2YzUyLjg3LjQGAQIAAAAYc3R0cwAAAAAAAAABAAAAAQAAAAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAAFHN0c3oAAAAAAAAAEwAAAAEAAAAUc3RjbwAAAAAAAAABAAAALAAAAGB1ZHRhAAAAWG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAK2lsc3QAAAAjqXRvbwAAABtkYXRhAAAAAQAAAABMYXZmNTIuNzguMw=="},r=function(){return t.iOS?this.noSleepTimer=null:t.Android&&(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("loop",""),e(this.noSleepVideo,"webm",i.WebM),e(this.noSleepVideo,"mp4",i.MP4)),this};return r.prototype.enable=function(e){t.iOS?(this.disable(),this.noSleepTimer=window.setInterval(function(){window.location=window.location,window.setTimeout(window.stop,0)},e||15e3)):t.Android&&this.noSleepVideo.play()},r.prototype.disable=function(){t.iOS?this.noSleepTimer&&(window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):t.Android&&this.noSleepVideo.pause()},r}),i("Widgets/subscribeAndEvaluate",["../ThirdParty/knockout"],function(e){"use strict";function t(t,i,r,n,o){return r.call(n,t[i]),e.getObservable(t,i).subscribe(r,n,o)}return t}),i("Widgets/Animation/Animation",["../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../getElement","../subscribeAndEvaluate"],function(e,t,i,r,n,o,a){"use strict";function s(t){return e.fromCssColorString(window.getComputedStyle(t).getPropertyValue("color"))}function l(e){var t=document.createElementNS(_,e.tagName);for(var i in e)if(e.hasOwnProperty(i)&&"tagName"!==i)if("children"===i){var r,n=e.children.length;for(r=0;n>r;++r)t.appendChild(l(e.children[r]))}else 0===i.indexOf("xlink:")?t.setAttributeNS(y,i.substring(6),e[i]):"textContent"===i?t.textContent=e[i]:t.setAttribute(i,e[i]);return t}function u(e,t,i){var r=document.createElementNS(_,"text");r.setAttribute("x",e),r.setAttribute("y",t),r.setAttribute("class","cesium-animation-svgText");var n=document.createElementNS(_,"tspan");return n.textContent=i,r.appendChild(n),r}function c(e,t,i){e.setAttribute("transform","translate(100,100) rotate("+i+")"),t.setAttribute("transform","rotate("+i+")")}function h(e,t){var i=t.alpha,r=1-i;return P.red=e.red*r+t.red*i,P.green=e.green*r+t.green*i,P.blue=e.blue*r+t.blue*i,P.toCssColorString()}function d(e,t,i){var r={tagName:"g","class":"cesium-animation-rectButton",transform:"translate("+e+","+t+")",children:[{tagName:"rect","class":"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect","class":"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{tagName:"use","class":"cesium-animation-buttonPath","xlink:href":i},{tagName:"title",textContent:""}]};return l(r)}function p(e,t,i){var r={tagName:"g","class":"cesium-animation-rectButton",transform:"translate("+e+","+t+")",children:[{tagName:"use","class":"cesium-animation-buttonGlow","xlink:href":"#animation_pathWingButton"},{tagName:"use","class":"cesium-animation-buttonMain","xlink:href":"#animation_pathWingButton"},{tagName:"use","class":"cesium-animation-buttonPath","xlink:href":i},{tagName:"title",textContent:""}]};return l(r)}function m(e,t){var i=e._viewModel,r=i.shuttleRingDragging;if(!r||g===e)if("mousedown"===t.type||r&&"mousemove"===t.type||"touchstart"===t.type&&1===t.touches.length||r&&"touchmove"===t.type&&1===t.touches.length){var n,o,a=e._centerX,s=e._centerY,l=e._svgNode,u=l.getBoundingClientRect();if("touchstart"===t.type||"touchmove"===t.type?(n=t.touches[0].clientX,o=t.touches[0].clientY):(n=t.clientX,o=t.clientY),!r&&(n>u.right||n<u.left||o<u.top||o>u.bottom))return;var c=e._shuttleRingPointer.getBoundingClientRect(),h=n-a-u.left,d=o-s-u.top,p=180*Math.atan2(d,h)/Math.PI+90;p>180&&(p-=360);var m=i.shuttleRingAngle;r||n<c.right&&n>c.left&&o>c.top&&o<c.bottom?(g=e,i.shuttleRingDragging=!0,i.shuttleRingAngle=p):m>p?i.slower():p>m&&i.faster(),t.preventDefault()}else e===g&&(g=void 0),i.shuttleRingDragging=!1}function f(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;var i=this;this._clickFunction=function(){var e=i._viewModel.command;e.canExecute&&e()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[a(t,"toggled",this.setToggled,this),a(t,"tooltip",this.setTooltip,this),a(t.command,"canExecute",this.setEnabled,this)]}function v(e,t){function i(e){m(b,e)}e=o(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;var r=document.createElement("style");r.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",document.head.insertBefore(r,document.head.childNodes[0]);var n=document.createElement("div");n.className="cesium-animation-theme",n.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=n,this._themeNormal=n.childNodes[0],this._themeHover=n.childNodes[1],this._themeSelect=n.childNodes[2],this._themeDisabled=n.childNodes[3],this._themeKnob=n.childNodes[4],this._themePointer=n.childNodes[5],this._themeSwoosh=n.childNodes[6],this._themeSwooshHover=n.childNodes[7];var s=document.createElementNS(_,"svg:svg");this._svgNode=s,s.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",y);var h=document.createElementNS(_,"g");this._topG=h,this._realtimeSVG=new f(p(3,4,"#animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new f(d(44,99,"#animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new f(d(124,99,"#animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new f(d(84,99,"#animation_pathPause"),t.pauseViewModel);var v=document.createElementNS(_,"g");v.appendChild(this._realtimeSVG.svgElement),v.appendChild(this._playReverseSVG.svgElement),v.appendChild(this._playForwardSVG.svgElement),v.appendChild(this._pauseSVG.svgElement);var g=l({tagName:"circle","class":"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=g;var C=l({tagName:"g","class":"cesium-animation-shuttleRingSwoosh",children:[{tagName:"use",transform:"translate(100,97) scale(-1,1)","xlink:href":"#animation_pathSwooshFX"},{tagName:"use",transform:"translate(100,97)","xlink:href":"#animation_pathSwooshFX"},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=C,this._shuttleRingPointer=l({tagName:"use","class":"cesium-animation-shuttleRingPointer","xlink:href":"#animation_pathPointer"});var E=l({tagName:"g",transform:"translate(100,100)"});this._knobOuter=l({tagName:"circle","class":"cesium-animation-knobOuter",cx:0,cy:0,r:71});var S=61,w=l({tagName:"circle","class":"cesium-animation-knobInner",cx:0,cy:0,r:S});this._knobDate=u(0,-24,""),this._knobTime=u(0,-7,""),this._knobStatus=u(0,-41,"");var T=l({tagName:"circle","class":"cesium-animation-blank",cx:0,cy:0,r:S}),x=document.createElementNS(_,"g");x.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(n),h.appendChild(x),h.appendChild(E),h.appendChild(v),x.appendChild(g),x.appendChild(C),x.appendChild(this._shuttleRingPointer),E.appendChild(this._knobOuter),E.appendChild(w),E.appendChild(this._knobDate),E.appendChild(this._knobTime),E.appendChild(this._knobStatus),E.appendChild(T),s.appendChild(h),e.appendChild(s);var b=this;this._mouseCallback=i,g.addEventListener("mousedown",i,!0),g.addEventListener("touchstart",i,!0),C.addEventListener("mousedown",i,!0),C.addEventListener("touchstart",i,!0),document.addEventListener("mousemove",i,!0),document.addEventListener("touchmove",i,!0),document.addEventListener("mouseup",i,!0),document.addEventListener("touchend",i,!0),this._shuttleRingPointer.addEventListener("mousedown",i,!0),this._shuttleRingPointer.addEventListener("touchstart",i,!0),this._knobOuter.addEventListener("mousedown",i,!0),this._knobOuter.addEventListener("touchstart",i,!0);var A,P=this._knobTime.childNodes[0],I=this._knobDate.childNodes[0],M=this._knobStatus.childNodes[0];this._subscriptions=[a(t.pauseViewModel,"toggled",function(e){A!==e&&(A=e,A?b._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):b._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),a(t,"shuttleRingAngle",function(e){c(b._shuttleRingPointer,b._knobOuter,e)}),a(t,"dateLabel",function(e){I.textContent!==e&&(I.textContent=e)}),a(t,"timeLabel",function(e){P.textContent!==e&&(P.textContent=e)}),a(t,"multiplierLabel",function(e){M.textContent!==e&&(M.textContent=e)})],this.applyThemeChanges(),this.resize()}var g,_="http://www.w3.org/2000/svg",y="http://www.w3.org/1999/xlink",C=e.fromCssColorString("rgba(247,250,255,0.384)"),E=e.fromCssColorString("rgba(143,191,255,0.216)"),S=e.fromCssColorString("rgba(153,197,255,0.098)"),w=e.fromCssColorString("rgba(255,255,255,0.086)"),T=e.fromCssColorString("rgba(255,255,255,0.267)"),x=e.fromCssColorString("rgba(255,255,255,0)"),b=e.fromCssColorString("rgba(66,67,68,0.3)"),A=e.fromCssColorString("rgba(0,0,0,0.5)"),P=new e;return f.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);for(var e=this._subscriptions,t=0,i=e.length;i>t;t++)e[t].dispose();r(this)},f.prototype.isDestroyed=function(){return!1},f.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e)return void this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");if(this._toggled)return void this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");this.svgElement.setAttribute("class","cesium-animation-rectButton")}},f.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))},f.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e},i(v.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){var e=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",e,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",e,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",e,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",e,!0),document.removeEventListener("mousemove",e,!0),document.removeEventListener("touchmove",e,!0),document.removeEventListener("mouseup",e,!0),document.removeEventListener("touchend",e,!0),this._shuttleRingPointer.removeEventListener("mousedown",e,!0),this._shuttleRingPointer.removeEventListener("touchstart",e,!0),this._knobOuter.removeEventListener("mousedown",e,!0),this._knobOuter.removeEventListener("touchstart",e,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();for(var t=this._subscriptions,i=0,n=t.length;n>i;i++)t[i].dispose();return r(this)},v.prototype.resize=function(){var e=this._container.clientWidth,t=this._container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){var i=this._svgNode,r=200,n=132,o=e,a=t;0===e&&0===t?(o=r,a=n):0===e?(a=t,o=r*(t/n)):0===t&&(o=e,a=n*(e/r));var s=o/r,l=a/n;i.style.cssText="width: "+o+"px; height: "+a+"px; position: absolute; bottom: 0; left: 0; overflow: hidden;",i.setAttribute("width",o),i.setAttribute("height",a),i.setAttribute("viewBox","0 0 "+o+" "+a),this._topG.setAttribute("transform","scale("+s+","+l+")"),this._centerX=Math.max(1,100*s),this._centerY=Math.max(1,100*l),this._lastHeight=e,this._lastWidth=t}},v.prototype.applyThemeChanges=function(){var e=s(this._themeNormal),i=s(this._themeHover),r=s(this._themeSelect),n=s(this._themeDisabled),o=s(this._themeKnob),a=s(this._themePointer),u=s(this._themeSwoosh),c=s(this._themeSwooshHover),d=l({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(e,C)},{tagName:"stop",offset:"12%","stop-color":h(e,E)},{tagName:"stop",offset:"46%","stop-color":h(e,S)},{tagName:"stop",offset:"81%","stop-color":h(e,w)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(i,C)},{tagName:"stop",offset:"12%","stop-color":h(i,E)},{tagName:"stop",offset:"46%","stop-color":h(i,S)},{tagName:"stop",offset:"81%","stop-color":h(i,w)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(r,C)},{tagName:"stop",offset:"12%","stop-color":h(r,E)},{tagName:"stop",offset:"46%","stop-color":h(r,S)},{tagName:"stop",offset:"81%","stop-color":h(r,w)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(n,T)},{tagName:"stop",offset:"75%","stop-color":h(n,x)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,"in":"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":u.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":u.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":u.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":h(a,A)},{tagName:"stop",offset:"100%","stop-color":h(a,A)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":h(o,C)},{tagName:"stop",offset:"60%","stop-color":h(o,b)},{tagName:"stop",offset:"85%","stop-color":h(o,E)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":h(o,b)},{tagName:"stop",offset:"60%","stop-color":h(o,C)},{tagName:"stop",offset:"85%","stop-color":h(o,w)}]},{id:"animation_pathReset",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},{id:"animation_pathPause",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},{id:"animation_pathPlay",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},{id:"animation_pathPlayReverse",tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},{id:"animation_pathLoop",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},{id:"animation_pathClock",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},{id:"animation_pathWingButton",tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},{id:"animation_pathPointer",tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},{id:"animation_pathSwooshFX",tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}]});t(this._defsElement)?this._svgNode.replaceChild(d,this._defsElement):this._svgNode.appendChild(d),this._defsElement=d},v}),i("Widgets/createCommand",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../ThirdParty/knockout"],function(e,t,i,r,n,o){"use strict";function a(t,r){function a(){var e,i={args:arguments,cancel:!1};return s.raiseEvent(i),i.cancel||(e=t.apply(null,arguments),l.raiseEvent(e)),e}r=e(r,!0);var s=new n,l=new n;return a.canExecute=r,o.track(a,["canExecute"]),i(a,{beforeExecute:{value:s},afterExecute:{value:l}}),a}return a}),i("Widgets/ToggleButtonViewModel",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../ThirdParty/knockout"],function(e,t,i,r,n){"use strict";function o(t,i){this._command=t,i=e(i,e.EMPTY_OBJECT),this.toggled=e(i.toggled,!1),this.tooltip=e(i.tooltip,""),n.track(this,["toggled","tooltip"])}return i(o.prototype,{command:{get:function(){return this._command}}}),o}),i("Widgets/Animation/AnimationViewModel",["../../Core/binarySearch","../../Core/ClockRange","../../Core/ClockStep","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/JulianDate","../../ThirdParty/knockout","../../ThirdParty/sprintf","../createCommand","../ToggleButtonViewModel"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e){e.clockStep===i.SYSTEM_CLOCK&&(e.clockStep=i.SYSTEM_CLOCK_MULTIPLIER,e.multiplier=1)}function d(e){h(e),e.shouldAnimate=!0}function p(e,t){return e-t}function m(t,i){var r=e(i,t,p);return 0>r?~r:r}function f(e,t){if(Math.abs(e)<=y)return e/y;var i,r,n=y,o=C,a=0;return e>0?(i=Math.log(t[t.length-1]),r=(i-a)/(o-n),Math.exp(a+r*(e-n))):(i=Math.log(-t[0]),r=(i-a)/(o-n),-Math.exp(a+r*(Math.abs(e)-n)))}function v(e,t,r){if(r.clockStep===i.SYSTEM_CLOCK)return y;if(Math.abs(e)<=1)return e*y;var n=t[t.length-1];e>n?e=n:-n>e&&(e=-n);var o,a,s=y,l=C,u=0;return e>0?(o=Math.log(n),a=(o-u)/(l-s),(Math.log(e)-u)/a+s):(o=Math.log(-t[0]),a=(o-u)/(l-s),-((Math.log(Math.abs(e))-u)/a+s))}function g(e){var r=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=g.defaultDateFormatter,this._timeFormatter=g.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,s.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(g.defaultTicks),this.timeLabel=void 0,s.defineProperty(this,"timeLabel",function(){return r._timeFormatter(r._clockViewModel.currentTime,r)}),this.dateLabel=void 0,s.defineProperty(this,"dateLabel",function(){return r._dateFormatter(r._clockViewModel.currentTime,r)}),this.multiplierLabel=void 0,s.defineProperty(this,"multiplierLabel",function(){var e=r._clockViewModel;if(e.clockStep===i.SYSTEM_CLOCK)return"Today";var t=e.multiplier;return t%1===0?t.toFixed(0)+"x":t.toFixed(3).replace(/0{0,3}$/,"")+"x"}),this.shuttleRingAngle=void 0,s.defineProperty(this,"shuttleRingAngle",{get:function(){return v(e.multiplier,r._allShuttleRingTicks,e)},set:function(e){e=Math.max(Math.min(e,C),-C);var t=r._allShuttleRingTicks,n=r._clockViewModel;if(n.clockStep=i.SYSTEM_CLOCK_MULTIPLIER,Math.abs(e)===C)return void(n.multiplier=e>0?t[t.length-1]:t[0]);var o=f(e,t);if(r.snapToTicks)o=t[m(o,t)];else if(0!==o){var a=Math.abs(o);if(a>100){var s=a.toFixed(0).length-2,l=Math.pow(10,s);o=Math.round(o/l)*l|0}else a>y?o=Math.round(o):a>1?o=+o.toFixed(1):a>0&&(o=+o.toFixed(2))}n.multiplier=o}}),this._canAnimate=void 0,s.defineProperty(this,"_canAnimate",function(){var e=r._clockViewModel,i=e.clockRange;if(r.shuttleRingDragging||i===t.UNBOUNDED)return!0;var n=e.multiplier,o=e.currentTime,s=e.startTime,l=!1;if(i===t.LOOP_STOP)l=a.greaterThan(o,s)||o.equals(s)&&n>0;else{var u=e.stopTime;l=a.greaterThan(o,s)&&a.lessThan(o,u)||o.equals(s)&&n>0||o.equals(u)&&0>n}return l||(e.shouldAnimate=!1),l}),this._isSystemTimeAvailable=void 0,s.defineProperty(this,"_isSystemTimeAvailable",function(){var e=r._clockViewModel,i=e.clockRange;if(i===t.UNBOUNDED)return!0;var n=e.systemTime;return a.greaterThanOrEquals(n,e.startTime)&&a.lessThanOrEquals(n,e.stopTime)}),this._isAnimating=void 0,s.defineProperty(this,"_isAnimating",function(){return r._clockViewModel.shouldAnimate&&(r._canAnimate||r.shuttleRingDragging)});var n=u(function(){var e=r._clockViewModel;e.shouldAnimate?(h(e),e.shouldAnimate=!1):r._canAnimate&&d(e)});this._pauseViewModel=new c(n,{toggled:s.computed(function(){return!r._isAnimating}),tooltip:"Pause"});var o=u(function(){var e=r._clockViewModel;h(e);var t=e.multiplier;t>0&&(e.multiplier=-t),e.shouldAnimate=!0});this._playReverseViewModel=new c(o,{toggled:s.computed(function(){return r._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});var l=u(function(){var e=r._clockViewModel;h(e);var t=e.multiplier;0>t&&(e.multiplier=-t),e.shouldAnimate=!0});this._playForwardViewModel=new c(l,{toggled:s.computed(function(){return r._isAnimating&&e.multiplier>0&&e.clockStep!==i.SYSTEM_CLOCK}),tooltip:"Play Forward"});var p=u(function(){var e=r._clockViewModel;e.clockStep=i.SYSTEM_CLOCK,e.multiplier=1,e.shouldAnimate=!0},s.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new c(p,{toggled:s.computed(function(){return e.shouldAnimate&&e.clockStep===i.SYSTEM_CLOCK}),tooltip:s.computed(function(){return r._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=u(function(){var e=r._clockViewModel;h(e);var t=r._allShuttleRingTicks,i=e.multiplier,n=m(i,t)-1;n>=0&&(e.multiplier=t[n])}),this._faster=u(function(){var e=r._clockViewModel;h(e);var t=r._allShuttleRingTicks,i=e.multiplier,n=m(i,t)+1;n<t.length&&(e.multiplier=t[n])})}var _=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],y=15,C=105;return g.defaultDateFormatter=function(e,t){var i=a.toGregorianDate(e);return _[i.month-1]+" "+i.day+" "+i.year},g.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800],g.defaultTimeFormatter=function(e,t){var i=a.toGregorianDate(e),r=Math.round(i.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?l("%02d:%02d:%02d.%03d",i.hour,i.minute,i.second,r):l("%02d:%02d:%02d UTC",i.hour,i.minute,i.second)},g.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)},g.prototype.setShuttleRingTicks=function(e){var t,i,r,n={},o=this._sortedFilteredPositiveTicks;for(o.length=0,t=0,i=e.length;i>t;++t)r=e[t],n.hasOwnProperty(r)||(n[r]=!0,o.push(r));o.sort(p);var a=[];for(i=o.length,t=i-1;t>=0;--t)r=o[t],0!==r&&a.push(-r);Array.prototype.push.apply(a,o),this._allShuttleRingTicks=a},n(g.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{ -get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}}),g._maxShuttleRingAngle=C,g._realtimeShuttleRingAngle=y,g}),i("Widgets/BaseLayerPicker/BaseLayerPickerViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/EllipsoidTerrainProvider","../../Core/isArray","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){i=e(i,e.EMPTY_OBJECT);var r=i.globe,l=e(i.imageryProviderViewModels,[]),u=e(i.terrainProviderViewModels,[]);this._globe=r,this.imageryProviderViewModels=l.slice(0),this.terrainProviderViewModels=u.slice(0),this.dropDownVisible=!1,a.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]),this.buttonTooltip=void 0,a.defineProperty(this,"buttonTooltip",function(){var e=this.selectedImagery,i=this.selectedTerrain,r=t(e)?e.name:void 0,n=t(i)?i.name:void 0;return t(r)&&t(n)?r+"\n"+n:t(r)?r:n}),this.buttonImageUrl=void 0,a.defineProperty(this,"buttonImageUrl",function(){var e=this.selectedImagery;return t(e)?e.iconUrl:void 0}),this.selectedImagery=void 0;var c=a.observable();this._currentImageryProviders=[],a.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(e){if(c()===e)return void(this.dropDownVisible=!1);var i,r=this._currentImageryProviders,n=r.length,a=this._globe.imageryLayers;for(i=0;n>i;i++)for(var s=a.length,l=0;s>l;l++){var u=a.get(l);if(u.imageryProvider===r[i]){a.remove(u);break}}if(t(e)){var h=e.creationCommand();if(o(h)){var d=h.length;for(i=d-1;i>=0;i--)a.addImageryProvider(h[i],0);this._currentImageryProviders=h.slice(0)}else this._currentImageryProviders=[h],a.addImageryProvider(h,0)}c(e),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;var h=a.observable();a.defineProperty(this,"selectedTerrain",{get:function(){return h()},set:function(e){if(h()===e)return void(this.dropDownVisible=!1);var i;t(e)&&(i=e.creationCommand()),this._globe.depthTestAgainstTerrain=!(i instanceof n),this._globe.terrainProvider=i,h(e),this.dropDownVisible=!1}});var d=this;this._toggleDropDown=s(function(){d.dropDownVisible=!d.dropDownVisible}),this.selectedImagery=e(i.selectedImageryProviderViewModel,l[0]),this.selectedTerrain=e(i.selectedTerrainProviderViewModel,u[0])}return i(l.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}}),l}),i("Widgets/BaseLayerPicker/BaseLayerPicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./BaseLayerPickerViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t){e=a(e);var i=new s(t),r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(r);var l=document.createElement("img");l.setAttribute("draggable","false"),l.className="cesium-baseLayerPicker-selected",l.setAttribute("data-bind","attr: { src: buttonImageUrl }"),r.appendChild(l);var u=document.createElement("div");u.className="cesium-baseLayerPicker-dropDown",u.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(u);var c=document.createElement("div");c.className="cesium-baseLayerPicker-sectionTitle",c.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),c.innerHTML="Imagery",u.appendChild(c);var h=document.createElement("div");h.className="cesium-baseLayerPicker-choices",h.setAttribute("data-bind","foreach: imageryProviderViewModels"),u.appendChild(h);var d=document.createElement("div");d.className="cesium-baseLayerPicker-item",d.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parent.selectedImagery = $data; }'),h.appendChild(d);var p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),d.appendChild(p);var m=document.createElement("div");m.className="cesium-baseLayerPicker-itemLabel",m.setAttribute("data-bind","text: name"),d.appendChild(m);var f=document.createElement("div");f.className="cesium-baseLayerPicker-sectionTitle",f.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),f.innerHTML="Terrain",u.appendChild(f);var v=document.createElement("div");v.className="cesium-baseLayerPicker-choices",v.setAttribute("data-bind","foreach: terrainProviderViewModels"),u.appendChild(v);var g=document.createElement("div");g.className="cesium-baseLayerPicker-item",g.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parent.selectedTerrain = $data; }'),v.appendChild(g);var _=document.createElement("img");_.className="cesium-baseLayerPicker-itemIcon",_.setAttribute("data-bind","attr: { src: iconUrl }"),_.setAttribute("draggable","false"),g.appendChild(_);var y=document.createElement("div");y.className="cesium-baseLayerPicker-itemLabel",y.setAttribute("data-bind","text: name"),g.appendChild(y),o.applyBindings(i,r),o.applyBindings(i,u),this._viewModel=i,this._container=e,this._element=r,this._dropPanel=u,this._closeDropDown=function(e){r.contains(e.target)||u.contains(e.target)||(i.dropDownVisible=!1)},n.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}return t(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return n.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),o.cleanNode(this._element),o.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),i(this)},l}),i("Widgets/BaseLayerPicker/ProviderViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n){"use strict";function o(t){var i=t.creationFunction;e(i.canExecute)||(i=n(i)),this._creationCommand=i,this.name=t.name,this.tooltip=t.tooltip,this.iconUrl=t.iconUrl,r.track(this,["name","tooltip","iconUrl"])}return t(o.prototype,{creationCommand:{get:function(){return this._creationCommand}}}),o}),i("Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels",["../../Core/buildModuleUrl","../../Scene/ArcGisMapServerImageryProvider","../../Scene/BingMapsImageryProvider","../../Scene/BingMapsStyle","../../Scene/createOpenStreetMapImageryProvider","../../Scene/createTileMapServiceImageryProvider","../../Scene/MapboxImageryProvider","../BaseLayerPicker/ProviderViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(){var l=[];return l.push(new s({name:"Bing Maps Aerial",iconUrl:e("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery \nhttp://www.bing.com/maps",creationFunction:function(){return new i({url:"//dev.virtualearth.net",mapStyle:r.AERIAL})}})),l.push(new s({name:"Bing Maps Aerial with Labels",iconUrl:e("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with label overlays \nhttp://www.bing.com/maps",creationFunction:function(){return new i({url:"//dev.virtualearth.net",mapStyle:r.AERIAL_WITH_LABELS})}})),l.push(new s({name:"Bing Maps Roads",iconUrl:e("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps\nhttp://www.bing.com/maps",creationFunction:function(){return new i({url:"//dev.virtualearth.net",mapStyle:r.ROAD})}})),l.push(new s({name:"Mapbox Satellite",tooltip:"Mapbox satellite imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxSatellite.png"),creationFunction:function(){return new a({mapId:"mapbox.satellite"})}})),l.push(new s({name:"Mapbox Streets",tooltip:"Mapbox streets imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxTerrain.png"),creationFunction:function(){return new a({mapId:"mapbox.streets"})}})),l.push(new s({name:"Mapbox Streets Classic",tooltip:"Mapbox streets basic imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxStreets.png"),creationFunction:function(){return new a({mapId:"mapbox.streets-basic"})}})),l.push(new s({name:"ESRI World Imagery",iconUrl:e("Widgets/Images/ImageryProviders/esriWorldImagery.png"),tooltip:"World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes NASA Blue Marble: Next Generation 500m resolution imagery at small scales (above 1:1,000,000), i-cubed 15m eSAT imagery at medium-to-large scales (down to 1:70,000) for the world, and USGS 15m Landsat imagery for Antarctica. The map features 0.3m resolution imagery in the continental United States and 0.6m resolution imagery in parts of Western Europe from DigitalGlobe. In other parts of the world, 1 meter resolution imagery is available from GeoEye IKONOS, i-cubed Nationwide Prime, Getmapping, AeroGRID, IGN Spain, and IGP Portugal. Additionally, imagery at different resolutions has been contributed by the GIS User Community.\nhttp://www.esri.com",creationFunction:function(){return new t({url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",enablePickFeatures:!1})}})),l.push(new s({name:"ESRI World Street Map",iconUrl:e("Widgets/Images/ImageryProviders/esriWorldStreetMap.png"),tooltip:"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; Ghana; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nhttp://www.esri.com",creationFunction:function(){return new t({url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",enablePickFeatures:!1})}})),l.push(new s({name:"ESRI National Geographic",iconUrl:e("Widgets/Images/ImageryProviders/esriNationalGeographic.png"),tooltip:"This web map contains the National Geographic World Map service. This map service is designed to be used as a general reference map for informational and educational purposes as well as a basemap by GIS professionals and other users for creating web maps and web mapping applications.\nhttp://www.esri.com",creationFunction:function(){return new t({url:"//services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/",enablePickFeatures:!1})}})),l.push(new s({name:"Open­Street­Map",iconUrl:e("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:"OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.\nhttp://www.openstreetmap.org",creationFunction:function(){return n({url:"//a.tile.openstreetmap.org/"})}})),l.push(new s({name:"Stamen Watercolor",iconUrl:e("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:"Reminiscent of hand drawn maps, Stamen watercolor maps apply raster effect area washes and organic edges over a paper texture to add warm pop to any map.\nhttp://maps.stamen.com",creationFunction:function(){return n({url:"//stamen-tiles.a.ssl.fastly.net/watercolor/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),l.push(new s({name:"Stamen Toner",iconUrl:e("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:"A high contrast black and white map.\nhttp://maps.stamen.com",creationFunction:function(){return n({url:"//stamen-tiles.a.ssl.fastly.net/toner/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),l.push(new s({name:"MapQuest Open­Street­Map",iconUrl:e("Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png"),tooltip:"OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.\nhttp://www.openstreetmap.org",creationFunction:function(){return n({url:"//otile1-s.mqcdn.com/tiles/1.0.0/osm/"})}})),l.push(new s({name:"The Black Marble",iconUrl:e("Widgets/Images/ImageryProviders/blackMarble.png"),tooltip:"The lights of cities and villages trace the outlines of civilization in this global view of the Earth at night as seen by NASA/NOAA's Suomi NPP satellite.",creationFunction:function(){return o({url:"//cesiumjs.org/blackmarble",maximumLevel:8,credit:"Black Marble imagery courtesy NASA Earth Observatory"})}})),l.push(new s({name:"Natural Earth II",iconUrl:e("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:"Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/",creationFunction:function(){return o({url:e("Assets/Textures/NaturalEarthII")})}})),l}return l}),i("Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels",["../../Core/buildModuleUrl","../../Core/CesiumTerrainProvider","../../Core/EllipsoidTerrainProvider","../BaseLayerPicker/ProviderViewModel"],function(e,t,i,r){"use strict";function n(){var n=[];return n.push(new r({name:"WGS84 Ellipsoid",iconUrl:e("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",creationFunction:function(){return new i}})),n.push(new r({name:"STK World Terrain meshes",iconUrl:e("Widgets/Images/TerrainProviders/STK.png"),tooltip:"High-resolution, mesh-based terrain for the entire globe. Free for use on the Internet. Closed-network options are available.\nhttp://www.agi.com",creationFunction:function(){return new t({url:"//assets.agi.com/stk-terrain/world",requestWaterMask:!0,requestVertexNormals:!0})}})),n}return n}),i("Widgets/CesiumInspector/CesiumInspectorViewModel",["../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Rectangle","../../Core/ScreenSpaceEventHandler","../../Core/ScreenSpaceEventType","../../Scene/DebugModelMatrixPrimitive","../../Scene/PerformanceDisplay","../../Scene/TileCoordinatesImageryProvider","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(e){var i;if(t(e)){i="Command Statistics";var r=e.commandsInFrustums;for(var n in r)if(r.hasOwnProperty(n)){var o,a=parseInt(n,10);if(7===a)o="1, 2 and 3";else{for(var s=[],l=2;l>=0;l--){var u=Math.pow(2,l);a>=u&&(s.push(l+1),a-=u)}o=s.reverse().join(" and ")}i+="<br>    "+r[n]+" in frustum "+o}i+="<br>Total: "+e.totalCommands}return i}function m(e,t,i){var r=Math.min(i,t);return r=Math.max(r,e)}function f(e,i){function r(e){v.removeInputAction(s.LEFT_CLICK),p.pickPrimitiveActive=!1;var i=p._scene.pick({x:e.position.x,y:e.position.y});t(i)&&(p.primitive=t(i.collection)?i.collection:i.primitive)}function n(e){var i,r=g.ellipsoid,n=p._scene.camera.pickEllipsoid({x:e.position.x,y:e.position.y},r);if(t(n))for(var a=r.cartesianToCartographic(n),l=g._surface.tileProvider._tilesToRenderByTextureCount,u=0;!i&&u<l.length;++u){var c=l[u];if(t(c))for(var h=0;!i&&h<c.length;++h){var d=c[h];o.contains(d.rectangle,a)&&(i=d)}}p.tile=i,v.removeInputAction(s.LEFT_CLICK),p.pickTileActive=!1}var p=this,f=e.canvas,v=new a(f);this._eventHandler=v,this._scene=e,this._canvas=f,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=i;var g=this._scene.globe;g.depthTestAgainstTerrain=!0,this.frustums=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.globeDepth=!1,this.pickDepth=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.depthFrustumText="1 of 1",this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText="",this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.generalSwitchText="-",this.primitivesSwitchText="+",this.terrainSwitchText="+",h.track(this,["filterTile","suspendUpdates","dropDownVisible","shaderCacheText","frustums","frustumStatisticText","pickTileActive","pickPrimitiveActive","hasPickedPrimitive","hasPickedTile","tileText","generalVisible","generalSwitchText","primitivesVisible","primitivesSwitchText","terrainVisible","terrainSwitchText","depthFrustumText"]),this._toggleDropDown=d(function(){p.dropDownVisible=!p.dropDownVisible}),this._toggleGeneral=d(function(){p.generalVisible=!p.generalVisible,p.generalSwitchText=p.generalVisible?"-":"+"}),this._togglePrimitives=d(function(){p.primitivesVisible=!p.primitivesVisible,p.primitivesSwitchText=p.primitivesVisible?"-":"+"}),this._toggleTerrain=d(function(){p.terrainVisible=!p.terrainVisible,p.terrainSwitchText=p.terrainVisible?"-":"+"}),this._showFrustums=d(function(){return p.frustums?p._scene.debugShowFrustums=!0:p._scene.debugShowFrustums=!1,!0}),this._showPerformance=d(function(){return p.performance?p._performanceDisplay=new u({container:p._performanceContainer}):p._performanceContainer.innerHTML="",!0}),this._showPrimitiveBoundingSphere=d(function(){return p._primitive.debugShowBoundingVolume=p.primitiveBoundingSphere,!0}),this._showPrimitiveReferenceFrame=d(function(){if(p.primitiveReferenceFrame){var e=p._primitive.modelMatrix;p._modelMatrixPrimitive=new l({modelMatrix:e}),p._scene.primitives.add(p._modelMatrixPrimitive)}else t(p._modelMatrixPrimitive)&&(p._scene.primitives.remove(p._modelMatrixPrimitive),p._modelMatrixPrimitive=void 0);return!0}),this._doFilterPrimitive=d(function(){return p.filterPrimitive?p._scene.debugCommandFilter=function(e){return t(p._modelMatrixPrimitive)&&e.owner===p._modelMatrixPrimitive._primitive?!0:t(p._primitive)?e.owner===p._primitive||e.owner===p._primitive._billboardCollection||e.owner.primitive===p._primitive:!1}:p._scene.debugCommandFilter=void 0,!0}),this._showWireframe=d(function(){return g._surface.tileProvider._debug.wireframe=p.wireframe,!0}),this._showGlobeDepth=d(function(){return p._scene.debugShowGlobeDepth=p.globeDepth,!0}),this._showPickDepth=d(function(){return p._scene.debugShowPickDepth=p.pickDepth,!0}),this._incrementDepthFrustum=d(function(){var e=p.depthFrustum+1;return p.depthFrustum=m(1,p._numberOfFrustums,e),p.scene.debugShowDepthFrustum=p.depthFrustum,!0}),this._decrementDepthFrustum=d(function(){var e=p.depthFrustum-1;return p.depthFrustum=m(1,p._numberOfFrustums,e),p.scene.debugShowDepthFrustum=p.depthFrustum,!0}),this._doSuspendUpdates=d(function(){return g._surface._debug.suspendLodUpdate=p.suspendUpdates,p.suspendUpdates||(p.filterTile=!1),!0});var _;this._showTileCoordinates=d(function(){return p.tileCoordinates&&!t(_)?_=e.imageryLayers.addImageryProvider(new c({tilingScheme:e.terrainProvider.tilingScheme})):!p.tileCoordinates&&t(_)&&(e.imageryLayers.remove(_),_=void 0),!0}),this._showTileBoundingSphere=d(function(){return p.tileBoundingSphere?g._surface.tileProvider._debug.boundingSphereTile=p._tile:g._surface.tileProvider._debug.boundingSphereTile=void 0,!0}),this._doFilterTile=d(function(){return p.filterTile?(p.suspendUpdates=!0,p.doSuspendUpdates(),g._surface._tilesToRender=[],t(p._tile)&&g._surface._tilesToRender.push(p._tile)):(p.suspendUpdates=!1,p.doSuspendUpdates()),!0}),this._pickPrimitive=d(function(){p.pickPrimitiveActive=!p.pickPrimitiveActive,p.pickPrimitiveActive?v.setInputAction(r,s.LEFT_CLICK):v.removeInputAction(s.LEFT_CLICK)}),this._pickTile=d(function(){p.pickTileActive=!p.pickTileActive,p.pickTileActive?v.setInputAction(n,s.LEFT_CLICK):v.removeInputAction(s.LEFT_CLICK)})}return i(f.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showFrustums:{get:function(){return this._showFrustums}},showPerformance:{get:function(){return this._showPerformance}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},showWireframe:{get:function(){return this._showWireframe}},showGlobeDepth:{get:function(){return this._showGlobeDepth}},showPickDepth:{get:function(){return this._showPickDepth}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},doSuspendUpdates:{get:function(){return this._doSuspendUpdates}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){var e=this;return d(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){var e=this;return d(function(){e.tile=e.tile.children[0]})}},selectNE:{get:function(){var e=this;return d(function(){e.tile=e.tile.children[1]})}},selectSW:{get:function(){var e=this;return d(function(){e.tile=e.tile.children[2]})}},selectSE:{get:function(){var e=this;return d(function(){e.tile=e.tile.children[3]})}},primitive:{set:function(e){var i=this._primitive;e!==i&&(this.hasPickedPrimitive=!0,t(i)&&(i.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,t(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())},get:function(){return this._primitive}},tile:{set:function(e){if(t(e)){this.hasPickedTile=!0;var i=this._tile;e!==i&&(this.tileText="L: "+e.level+" X: "+e.x+" Y: "+e.y,this.tileText+="<br>SW corner: "+e.rectangle.west+", "+e.rectangle.south,this.tileText+="<br>NE corner: "+e.rectangle.east+", "+e.rectangle.north,this.tileText+="<br>Min: "+e.data.minimumHeight+" Max: "+e.data.maximumHeight),this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0},get:function(){return this._tile}},update:{get:function(){var e=this;return function(){e.frustums&&(e.frustumStatisticText=p(e._scene.debugFrustumStatistics));var t=e._scene.numberOfFrustums;e._numberOfFrustums=t;var i=m(1,t,e.depthFrustum);e.depthFrustum=i,e.scene.debugShowDepthFrustum=i,e.depthFrustumText=i+" of "+t,e.performance&&e._performanceDisplay.update(),e.primitiveReferenceFrame&&(e._modelMatrixPrimitive.modelMatrix=e._primitive.modelMatrix),e.shaderCacheText="Cached shaders: "+e._scene.context.shaderCache.numberOfShaders}}}}),f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._eventHandler.destroy(),r(this)},f}),i("Widgets/CesiumInspector/CesiumInspector",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./CesiumInspectorViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(t,i){if(!e(t))throw new r("container is required.");if(!e(i))throw new r("scene is required.");t=o(t);var s=document.createElement("div"),l=new a(i,s);this._viewModel=l,this._container=t;var u=document.createElement("div");this._element=u;var c=document.createElement("div");c.textContent="Cesium Inspector",c.className="cesium-cesiumInspector-button",c.setAttribute("data-bind","click: toggleDropDown"),u.appendChild(c),u.className="cesium-cesiumInspector",u.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),t.appendChild(this._element);var h=document.createElement("div");this._panel=h,h.className="cesium-cesiumInspector-dropDown",u.appendChild(h);var d=document.createElement("div");d.className="cesium-cesiumInspector-sectionHeader";var p=document.createElement("span");p.className="cesium-cesiumInspector-toggleSwitch",p.setAttribute("data-bind","click: toggleGeneral, text: generalSwitchText"),d.appendChild(p),d.appendChild(document.createTextNode("General")),h.appendChild(d);var m=document.createElement("div");m.className="cesium-cesiumInspector-section",m.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : generalVisible, "cesium-cesiumInspector-hide" : !generalVisible}'),h.appendChild(m);var f=document.createElement("div");m.appendChild(f);var v=document.createElement("div");v.className="cesium-cesiumInspector-frustumStats",v.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : frustums, "cesium-cesiumInspector-hide" : !frustums}, html: frustumStatisticText');var g=document.createElement("input");g.type="checkbox",g.setAttribute("data-bind","checked: frustums, click: showFrustums"),f.appendChild(g),f.appendChild(document.createTextNode("Show Frustums")),f.appendChild(v);var _=document.createElement("div");m.appendChild(_);var y=document.createElement("input");y.type="checkbox",y.setAttribute("data-bind","checked: performance, click: showPerformance"),_.appendChild(y),_.appendChild(document.createTextNode("Performance Display")),s.className="cesium-cesiumInspector-performanceDisplay",m.appendChild(s);var C=document.createElement("div");C.className="cesium-cesiumInspector-shaderCache",C.setAttribute("data-bind","html: shaderCacheText"),m.appendChild(C);var E=document.createElement("div");m.appendChild(E);var S=document.createElement("input");S.type="checkbox",S.setAttribute("data-bind","checked: globeDepth, click: showGlobeDepth"),E.appendChild(S),E.appendChild(document.createTextNode("Show globe depth"));var w=document.createElement("div");E.appendChild(w);var T=document.createElement("div");m.appendChild(T);var x=document.createElement("input");x.type="checkbox",x.setAttribute("data-bind","checked: pickDepth, click: showPickDepth"),T.appendChild(x),T.appendChild(document.createTextNode("Show pick depth"));var b=document.createElement("div");m.appendChild(b);var A=document.createElement("span");A.setAttribute("data-bind",'html: "     Frustum:"'),b.appendChild(A);var P=document.createElement("span");P.setAttribute("data-bind","text: depthFrustumText"),b.appendChild(P);var I=document.createElement("input");I.type="button",I.value="-",I.className="cesium-cesiumInspector-pickButton",I.setAttribute("data-bind","click: decrementDepthFrustum"),b.appendChild(I);var M=document.createElement("input");M.type="button",M.value="+",M.className="cesium-cesiumInspector-pickButton",M.setAttribute("data-bind","click: incrementDepthFrustum"),b.appendChild(M);var D=document.createElement("div");D.className="cesium-cesiumInspector-sectionHeader",p=document.createElement("span"),p.className="cesium-cesiumInspector-toggleSwitch",p.setAttribute("data-bind","click: togglePrimitives, text: primitivesSwitchText"),D.appendChild(p),D.appendChild(document.createTextNode("Primitives")),h.appendChild(D);var R=document.createElement("div");R.className="cesium-cesiumInspector-section",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : primitivesVisible, "cesium-cesiumInspector-hide" : !primitivesVisible}'),h.appendChild(R);var O=document.createElement("div");O.className="cesium-cesiumInspector-pickSection",R.appendChild(O);var N=document.createElement("input");N.type="button",N.value="Pick a primitive",N.className="cesium-cesiumInspector-pickButton",N.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');var L=document.createElement("div");L.className="cesium-cesiumInspector-center",L.appendChild(N),O.appendChild(L);var F=document.createElement("div");O.appendChild(F);var B=document.createElement("input");B.type="checkbox",B.setAttribute("data-bind","checked: primitiveBoundingSphere, click: showPrimitiveBoundingSphere, enable: hasPickedPrimitive"),F.appendChild(B),F.appendChild(document.createTextNode("Show bounding sphere"));var V=document.createElement("div");O.appendChild(V);var k=document.createElement("input");k.type="checkbox",k.setAttribute("data-bind","checked: primitiveReferenceFrame, click: showPrimitiveReferenceFrame, enable: hasPickedPrimitive"),V.appendChild(k),V.appendChild(document.createTextNode("Show reference frame"));var z=document.createElement("div");this._primitiveOnly=z,O.appendChild(z);var U=document.createElement("input");U.type="checkbox",U.setAttribute("data-bind","checked: filterPrimitive, click: doFilterPrimitive, enable: hasPickedPrimitive"),z.appendChild(U),z.appendChild(document.createTextNode("Show only selected"));var G=document.createElement("div");G.className="cesium-cesiumInspector-sectionHeader",p=document.createElement("span"),p.className="cesium-cesiumInspector-toggleSwitch",p.setAttribute("data-bind","click: toggleTerrain, text: terrainSwitchText"),G.appendChild(p),G.appendChild(document.createTextNode("Terrain")),h.appendChild(G);var W=document.createElement("div");W.className="cesium-cesiumInspector-section",W.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : terrainVisible, "cesium-cesiumInspector-hide" : !terrainVisible}'),h.appendChild(W);var H=document.createElement("div");H.className="cesium-cesiumInspector-pickSection",W.appendChild(H);var q=document.createElement("input");q.type="button",q.value="Pick a tile",q.className="cesium-cesiumInspector-pickButton",q.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),L=document.createElement("div"),L.appendChild(q),L.className="cesium-cesiumInspector-center",H.appendChild(L);var j=document.createElement("div");H.appendChild(j);var Y=document.createElement("input");Y.type="button",Y.value="Parent",Y.className="cesium-cesiumInspector-pickButton",Y.setAttribute("data-bind","click: selectParent");var X=document.createElement("input");X.type="button",X.value="NW",X.className="cesium-cesiumInspector-pickButton",X.setAttribute("data-bind","click: selectNW");var Z=document.createElement("input");Z.type="button",Z.value="NE",Z.className="cesium-cesiumInspector-pickButton",Z.setAttribute("data-bind","click: selectNE");var K=document.createElement("input");K.type="button",K.value="SW",K.className="cesium-cesiumInspector-pickButton",K.setAttribute("data-bind","click: selectSW");var Q=document.createElement("input");Q.type="button",Q.value="SE",Q.className="cesium-cesiumInspector-pickButton",Q.setAttribute("data-bind","click: selectSE");var J=document.createElement("div");J.className="cesium-cesiumInspector-tileText",j.className="cesium-cesiumInspector-frustumStats",j.appendChild(J),j.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : hasPickedTile, "cesium-cesiumInspector-hide" : !hasPickedTile}'),J.setAttribute("data-bind","html: tileText");var $=document.createElement("div");$.className="cesium-cesiumInspector-relativeText",$.textContent="Select relative:",j.appendChild($);var ee=document.createElement("table"),te=document.createElement("tr"),ie=document.createElement("tr"),re=document.createElement("td"); -re.appendChild(Y);var ne=document.createElement("td");ne.appendChild(X);var oe=document.createElement("td");oe.appendChild(Z),te.appendChild(re),te.appendChild(ne),te.appendChild(oe);var ae=document.createElement("td"),se=document.createElement("td");se.appendChild(K);var le=document.createElement("td");le.appendChild(Q),ie.appendChild(ae),ie.appendChild(se),ie.appendChild(le),ee.appendChild(te),ee.appendChild(ie),j.appendChild(ee);var ue=document.createElement("div");H.appendChild(ue);var ce=document.createElement("input");ce.type="checkbox",ce.setAttribute("data-bind","checked: tileBoundingSphere, enable: hasPickedTile, click: showTileBoundingSphere"),ue.appendChild(ce),ue.appendChild(document.createTextNode("Show bounding volume"));var he=document.createElement("div");H.appendChild(he);var de=document.createElement("input");de.type="checkbox",de.setAttribute("data-bind","checked: filterTile, enable: hasPickedTile, click: doFilterTile"),he.appendChild(de),he.appendChild(document.createTextNode("Show only selected"));var pe=document.createElement("div");W.appendChild(pe);var me=document.createElement("input");me.type="checkbox",me.setAttribute("data-bind","checked: wireframe, click: showWireframe"),pe.appendChild(me),pe.appendChild(document.createTextNode("Wireframe"));var fe=document.createElement("div");W.appendChild(fe);var ve=document.createElement("input");ve.type="checkbox",ve.setAttribute("data-bind","checked: suspendUpdates, click: doSuspendUpdates"),fe.appendChild(ve),fe.appendChild(document.createTextNode("Suspend LOD update"));var ge=document.createElement("div");W.appendChild(ge);var _e=document.createElement("input");_e.type="checkbox",_e.setAttribute("data-bind","checked: tileCoordinates, click: showTileCoordinates"),ge.appendChild(_e),ge.appendChild(document.createTextNode("Show tile coordinates")),n.applyBindings(l,this._element)}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return n.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),i(this)},s}),i("Widgets/CesiumWidget/CesiumWidget",["../../Core/buildModuleUrl","../../Core/Cartesian3","../../Core/Clock","../../Core/Credit","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Ellipsoid","../../Core/FeatureDetection","../../Core/formatError","../../Core/requestAnimationFrame","../../Core/ScreenSpaceEventHandler","../../Scene/BingMapsImageryProvider","../../Scene/Globe","../../Scene/Moon","../../Scene/Scene","../../Scene/SceneMode","../../Scene/SkyAtmosphere","../../Scene/SkyBox","../../Scene/Sun","../getElement"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S){"use strict";function w(t){return e("Assets/Textures/SkyBox/tycho2t3_80_"+t+".jpg")}function T(e){function t(r){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{var n=e._targetFrameRate;if(o(n)){var a=1e3/n,s=r-i;s>a&&(e.resize(),e.render(),i=r-s%a),d(t)}else e.resize(),e.render(),d(t)}catch(l){if(e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors){var u="An error occurred while rendering. Rendering has stopped.";e.showErrorPanel(u,void 0,l)}}else e._renderLoopRunning=!1}e._renderLoopRunning=!0;var i=0;d(t)}function x(e){var t=e._canvas,i=t.clientWidth,r=t.clientHeight,o=e._resolutionScale;e._supportsImageRenderingPixelated||(o*=n(window.devicePixelRatio,1)),e._canvasWidth=i,e._canvasHeight=r,i*=o,r*=o,t.width=i,t.height=r,e._canRender=0!==i&&0!==r}function b(e){var t=e._canvas,i=t.width,r=t.height;if(0!==i&&0!==r){var n=e._scene.camera.frustum;o(n.aspectRatio)?n.aspectRatio=i/r:(n.top=n.right*(r/i),n.bottom=-n.top)}}function A(e,a){e=S(e),a=n(a,{});var s=document.createElement("div");s.className="cesium-widget",e.appendChild(s);var l=document.createElement("canvas"),h=c.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=h,h&&(l.style.imageRendering=c.imageRenderingValue()),l.oncontextmenu=function(){return!1},l.onselectstart=function(){return!1},s.appendChild(l);var d=document.createElement("div");d.className="cesium-widget-credits";var T=o(a.creditContainer)?S(a.creditContainer):s;T.appendChild(d);var A=n(a.showRenderLoopErrors,!0);this._element=s,this._container=e,this._canvas=l,this._canvasWidth=0,this._canvasHeight=0,this._creditContainer=d,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=A,this._resolutionScale=1,this._forceResize=!1,this._clock=o(a.clock)?a.clock:new i,x(this);try{var I=new g({canvas:l,contextOptions:a.contextOptions,creditContainer:d,mapProjection:a.mapProjection,orderIndependentTranslucency:a.orderIndependentTranslucency,scene3DOnly:n(a.scene3DOnly,!1),terrainExaggeration:a.terrainExaggeration});this._scene=I,I.camera.constrainedAxis=t.UNIT_Z,b(this);var M=n(I.mapProjection.ellipsoid,u.WGS84),D=I.frameState.creditDisplay,R=new r("Cesium",P,"http://cesiumjs.org/");D.addDefaultCredit(R);var O=a.globe;o(O)||(O=new f(M)),O!==!1&&(I.globe=O);var N=a.skyBox;o(N)||(N=new C({sources:{positiveX:w("px"),negativeX:w("mx"),positiveY:w("py"),negativeY:w("my"),positiveZ:w("pz"),negativeZ:w("mz")}})),N!==!1&&(I.skyBox=N,I.sun=new E,I.moon=new v);var L=a.skyAtmosphere;o(L)||(L=new y(M)),L!==!1&&(I.skyAtmosphere=L);var F=a.globe===!1?!1:a.imageryProvider;o(F)||(F=new m({url:"//dev.virtualearth.net"})),F!==!1&&I.imageryLayers.addImageryProvider(F),o(a.terrainProvider)&&a.globe!==!1&&(I.terrainProvider=a.terrainProvider),this._screenSpaceEventHandler=new p(l,!1),o(a.sceneMode)&&(a.sceneMode===_.SCENE2D&&this._scene.morphTo2D(0),a.sceneMode===_.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=n(a.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=a.targetFrameRate;var B=this;I.renderError.addEventListener(function(e,t){if(B._useDefaultRenderLoop=!1,B._renderLoopRunning=!1,B._showRenderLoopErrors){var i="An error occurred while rendering. Rendering has stopped.";B.showErrorPanel(i,void 0,t)}})}catch(V){if(A){var k="Error constructing CesiumWidget.",z='Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:';this.showErrorPanel(k,z,V)}throw V}}var P="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHYAAAAaCAYAAABikagwAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAN1wAADdcBQiibeAAAAAd0SU1FB9wGGRQyF371QVsAABOHSURBVGje7Vp5cFTHmf91v2Nm3owGnYMuEEJCOBiEjDlsDMYQjGMOOwmXcWxiLywpJ9iuTXZd612corJssFOxi8LerXizxEGUvWsivNxxHHCQ8WYBYSFzmUMCCXQjaUajOd/V+4f6Kc14kI/KZv/xq+p6M/PmO15/9/c1wa0vwpcMQAHgBuAFoPG7mz8jAGwASQBxADFhJQGYACwAjK+vrr/AJQ8jVMqfuwH4AGQByAaQnTNqXGHWqHGFbq8/g1BJsgw9GQ12Bds/qWsxEvEeAEEAfQDCAKKCgPGVcP//BOsIVQHgAZAJIACgsHTqvDvK7150T2bR2DFaZm6W4slwUypR20yaiUg4OtDbcaP36rlPPt6/7f2B3q5mAB0AeriAE18J9y93kVu4X4W73BwAhQBK5v/gZ98ZVXXvDG92IJMx569MQDEoK0tPmOHu1s4L7799sH7vtvcAXAPQCaCfu2qLu+7h+Eh3sS8Bcyt48iVgPos2+4J7jS+BIx2etDBSynfH/Xq46y0CUL70n3/zXMmUuXepWoZHFCQhFIQARCBFJYV6/Nn+QHnVBH9Ovq/51JFWADpfJhcqEzyDcx9ukTTr/xr2VnDpng0nuHR0h1u3wvWF6EspgBIAFYAfQAGAsuU/rfm7kePvvJ0QiTj6QSgBISS9ujEGSikkxaXklIwfK8uK2Xru2HVurWKspZyezGmmWwp/LqVsupPQub4grPQ5YIejKQvPJAGflLLJSBGmxPEqKXhU4XdJEBq7BR5Z+L+DKx3MTTHWEaybx9WCud/btCJQMeX2Qevk+NPoks0YPArF/RUj0NyXxOmO2CAy1a1OmL9yUVfTmatXTx52EildYFQVNlgRmBR1xQJgCBbPBAVUhcw8lTObLz0FVk4RIEmJJyJNZzFBiCTFBRL+f50rriFUATRFiZSU/XYEAw6X5LlIUghZqXvl5p8pfycRZsgjymlKGw1Adm7JbRUVs785nwGghP5pp9mfFMOxWstmuC3gwdcrRqA/buJUWwyKRMAYgydrZNZt9337623njn+ixyN9nAmdM5nBvYOPfxc3mnEmTQ4T5VZv8hfz8aUKnocJd5tvVhxAhOMADzNefleFjRUFa/D/xzi8LQhIEpTG4VXnNBzlZYISufk7juCfqaAoLkHYcZ6HBAEM8O+ObJz3HcFDpJfDJwWYfiHMMTklviocKHv6I3+zRFLdKhEEatmALBFIBIibNhQ6KFyJEjT2JHDoUj/a+nVIVIBhBGOnzptWXzhmTFfT2TZBOH4AgSeeeGJqRUVFqdfr9btcLnVQXwapmqZpJZPJRCgUCh47duzie++9dwWAXl5enrlp06bF0WhUM01TYYwRrmg2vzNKqS3Lsunz+Yy6urpTP//5z09blkVLSkryVq9ePT03NzegqqqbUnqTGyOEMNM0k319fX2///3vz9bW1l4DYD700EPFy5Ytm65pmvbBBx9c2rp166Wnnnqq7MEHH5zAGIu8/vrr+w8ePPgJVwrRO2gAcg8cOLA2mUx62tvbB9avX39s+fLlo++///5JXNiwbXugpqam9tChQ2cEj6NzuQwlsi+//PKSzMzMQtu2qcfjMZqbm09v2LDht4J3sQEQOU2Jo8mKKzt7VEU5lSgFBi3PZkBZrgv3lGbCo1Jc7I7iSGN40JcQgoGkhXdO94ESQJEoGI+1k/M9mDKqQHEv++akl186e45rNAAE3njjjccWLFhwfyAQyJEkiabGbcc7JJNJva2trX3Lli3vvPbaa+eKi4uLV6xY8d10cf5TcZ8x5OXl5b366qs9lFLtrbfeWldVVXW7pmkuxhjS0SSEIJlMGitXrrz2/PPPv1lTU3NtypQp0x955JG/kmVZdrlcR7du3WrOnTt33pIlS+YDwNGjR68ePHiwjVtukm+wI9ichQsXPgUAHR0d3evXr78xc+bMu9asWbOQUjpENz8/v/jQoUP/IiiH40UzAeQvW7Zs1rp16/7a5/NpDr/19fWlGzZsOM4tNsphkc5iPaXTvl6uuDUvY4MZLwNQ4Ffw+LR8+KQQTCuJSQUFcMsEe88FoSkSKCFwyWSISQbg9pEefHdGAJHIdUydVjFecL3K448/Pm3hwoUPBAKBHFGIlmU5pRCRpMGEze12q2PHjh2zatWqeTt37gwODAxkOQIJhUJ6Y2Njn6IojFJqE0KYsGyPx0POnTvXnUgkfGvXrr1j5syZU7iFsKampv5YLBZ34GzbJgAwatSo7MzMTE95eXnZT37yk0dramr+PRQKZSQSCdPn88nBYNADID8UCmkAYBiGGQ6Hna6cksbdZliWZUuSRKPRKAAUBINBfywWM30+n+yEtenTp9+5YsWKGTt37oxwz+a44RwARc8+++xSr9eriQrY398v8311CUncTTHN0Q7Vl1OQJymq4iBwyxQPT8qDVwri1d1/i8ttp/AP39mOBeMn41pQx9mOGFSZ3qT52ZqMR6aMRGvXKfzbgX9Ea3PnSLEdOWXKlK/5/X4/AFy8ePHG6tWr90QikS5VVaOEEIsxRhljngcffLBi8+bNjxBCUFJSMrKkpMRvGIbboXP27Nn+2bNn/3cgEIgSQmKEEAOARQixKKVxRVEioVAoYtu2dMcdd4x24Hbv3t3+ox/96ONoNBqklMa4ppNkMinNnz8///nnn6/y+Xw0mUxaANy6rrsdl28YhguAX9d1F98jwn9TUjJkJ5N1DWV0ti0ByDAMw+PsbzQatX0+Hy0oKMhcvnz5nP3791+IxWJRIUaPfO655+ZVVlaOA4BoNGprmkZ5uJJThZouKyYAqOrWVEKoE7cwszQDlQUK3jr8S5y++iEIIXh55/fwylOH8e3KHHSEdfQnLFBuRbJEsLQyF27Sh3eO/iuudV+EaSuqkJF6MjMzs9xutwIAv/rVr06eOHHiEwCtPBHQOaPaxYsXLxcXF8cKCwtzOzo6+ltbW4OFhYU+h2nDMAgAqbu7W8xkLSEBcsos1bbtocZIIBBQs7Ky5Pb2dkvXdV1wfaipqemsqak5yF1bFABljNEU4Sj87nia1LKHCJWGLLh6AkDhiksAoLq6um/VqlWZWVlZ8gMPPHDHwoULK2tqasJcYJ7y8vKyb33rW/f4/X43YwybNm26vnnz5pIUb0tvVe44maSVjEfizDJtmwFlOS4srczGiQvv4ncnd4ASAkIo+mN92LLrB/j7Vb/GQxOz8Z/1PTDsQXc6p3QEqopU7Dr6S5y8fAiKpCKhs6SQSUqyLKsO4d7e3j4AvbxD1csFQQF4EolEaP369TVCFjuiqKiogG8w5s6dm8sY++ZwcfbZZ5/dvHXr1isnT55scVz+rFmz8urr6xc4Ls22bZZIJExd181oNGr09PREDx06dPmFF144Ho/HTVGIjiE4guECoyl1LYTPcppGEAghDAAikUjixRdfbHnppZfKfD6fa82aNfMOHz7cHgwGbwBwr1ix4u677rqrgsfU4I4dO66lCPZTXSkqpOaMa60e7mjuosw0RmYoWHf3SLT3NOKt91+CbsZBeOlDCcX5luP4rw9fw4wSH+4p9cMlU3xtpAfLJmej/vIR7PnjLyDRwXeKhoxubokWAOYkDXxTLE5brB11oTZMCrWoNQgymJwZhsHC4bAZjUaNaDRqxGIx3VnxeDzJky8TQGLHjh3n9u3bd6ytrS3U2dkZ6e3tjfX398cHBgYS8XjcIIQQr9frKioq8ldWVhb88Ic/vHfbtm3zAXhs25aHUx7uEt1COeXEXM3JfAWLvWnSxRhLbNu2rampqSlMCME3vvGNyXPmzKkCUFZeXn776tWr72WMwbZtvPDCCx+5XK6wo6BcOdhwQ4Chuu/KR39onDGS9T80u9ivkgiqD/0UbT2NcKvelMaEhXfrqlGaPwEPT5qH0lwvqopcaOtpxPb3/gmGmYBEFRBC0HUlfp67tQQALxMKYsaYU+tlcSadNN8NIOO+++4bnZ2d7Q+Hw+zIkSNJxtiQ9TQ1NUW3bNnSmJWVlZBlWaeUWs5SVTUxYsSIRF1dXScAwzTN2MMPP7w3Pz//ZFVVVUFubq7L6/VKmqZRl8ulKIriVlVVmz59ev6cOXMCLpeLLliwYDyAOpGm08SglA659mQy6eHTrwiPtRYXbi6vP2/yjI61AoDL5Ur09vZ2bt++/ezGjRvvppSSjRs3Lti9e/fvnnzyyfHjx48fyRjDwYMHL9TW1jYWFhZ6xfIs3UhUTlPQRwGE9Gv/c/ba9YGi2rPv0FONf/iUUB3Lj8SDqD60GYtmdGBcYSVOnL+K39b9Gp19zVDkwZzBSpLY9Qv9Z3lKHgOgmaYZd9zg1KlTS994441L3G3lcD6oo/1btmxZFwgEctrb27vWrFlzwLIs2cmKW1pa4q+//vp1AbchdIKiPGZHAJDFixcHpk+ffnsoFNLefvvt3ra2Nl0YSDhdt4zy8vLwsWPHsl0ul6ooigSACuEZXKBJwzAMxhhUVZW8Xm8uH5hQ3mCwOf95VVVVYx03yQVhUEpNQbBxADfefPPN6NKlS8dUVlYWVlZW5r344osz1q1bV8IYQzAYjFVXV5+IxWIdkiTlpfDCUgcC6Sw2CqBvw4ZN+7/9d+Wzo1avT5HU9N1tMpj4dfU14z/efxletx9xPYpIPAhVccO2bVBKcf189I/h3mSLkBi5b9y40RWLxZJer9f12GOPTa6oqMjq6enpJYQYlFLGyx21tLQ0MGnSpDGEECQSCZMQIjuNCF6aqI8++mheVlZWJrdYkzcoLEVREj6fL1FfX39x165dzfPnzy/7/ve/v1LXdWvlypVde/bsuRKLxQyn1LEsS2aMeebNm1fs8/lkxhgsy7IAJBRF0Yc2TZZ1AANNTU0djoJt2rRpzqxZs/K6urq6JUnSCSHMMAxZ07SsxYsXV1JKCWMMAwMDMQBhVVWTjtU6gr1y5Yq1d+/ej8aNG5eraZr6zDPPjPV4PBJjDLW1ted27dr1MYCYqqpDcpMkyRIaEyydxToxNgagr7e3t+XEe0rNxPkjnvhTznNr4Sb0KBL6YO9BovJQnRXptTqaPgr9wTLsDgAhTkOurq4+unz58vs1TRvl9/vVuXPnljHGxgqxw2GcEjLYJLlw4cKV06dPd06bNo04+MePH+/ftm3bNNG1iW5KVVVl//79ew4cONC8d+/ey88884ysKIp85513jpo8eXJh2pHX4EUIITh58uRFAN1utzvHcb0ejycGoKuurk5vbW29u7i4ODB69OisJ5988i4xxDhsKIoiEUJgmqZ94MCBOgBdmqaVODxrmhbhiaP+4x//+N2lS5dOmjBhwhiPxyMBQFdXV191dfX7tm23AdBdLtdQzFYUxWmb3iRcmqbh7vQfOz9+v/PdjvP6kcHuE288MJZWuM4Smw1mgkQvHw/v6Wga+BjADY53AEDfmTNnLq9du/Znp06datB13RA3ROwGmaZphcPhgX379v326aefftO27Tafz9fJGGOmadqMMSbLMpEkiaZbjDFommYQQsK1tbWNr7zyymvhcLifEIJbwRBCmGVZ1vHjxz9atGjRLwA0Z2dndzpdHb/fHwTQcuLEiYann3761fPnz3+i67pBCCGUUkoIofwjpZQS27ZZd3f3ja1bt1Zv3LhxL4CrmZmZPYQQkxCCjIyMEIB2AG0Amrdv3/6beDweNwzD1nXdPHXq1Indu3cf48+7MjIyupw98ng8EW4wCWH4kHbQLgsnJ4oAlN332Ji1hbeps6lEaLohQLrhQCJi9zcei77TcLh9H4CrALp4rLN5LBvBE4scAP6JEyfmBQIBL6VUopSCMcYGBgYSly5dCvX19YW5QkQAmD6fz3PvvfeWxmIxr2EYHqFXPBRrKKWWJEmG1+uNtbW1dTU0NNzgz7wA/OXl5bkFBQV+XsYQwVpZMpk0jh8/3snpRQCYo0aN8k6YMCHX5XLRa9euBRsaGnr4Jnp458c7ceLEbK/X6xL5MQzDbGhoCNq2HeO4YgBYWVmZv6KiIkdVVbS0tHQ3NDR0CsORrDlz5oyllHoYY3p9ff31cDjczeGhaVrGkiVLSg3DkLu7u/s+/PDDFn4UKeJYLhnmAJvGs9QCAKOnLMhfNHqSNl/LlHOpTORbWa4et2ORXqv1wgf9NVfO9B7nTYcuPvlICq02t9CJ8ggjOJomodOF0ZQtHNvxCC08pBnbmcIhO53jdA7mpXaKUkOSWGoxYaaKlIa7IozT0uET+XDGehDGhhBGb6bTmBHezeb8OyNPCPQk/ptzeHConCSfcZDNI1hWQXaBVl5254hZmSPVce4MKUdxEQ+VJMnUbcNIWJFoyOzoa02eOX2k+yg/79TFNWkgZchOUobe4vA63WzUEmpYsa+dCoM0Izgz5aQkTUOPpGvUpKFJBaUR8Q03cLdT8NkppyEgPGOCYcnCiNASsn2SwrstDA2Gxnbkc5xSdHGrcmaBWYoqZ+YUe4pcXuqXJCobupWIhaze3vZohzAfdOaKN2mSwPxwR0ZSZ6uptZoIN9yxFCYIiqV5v3THStgwNNPhvtXxFgzDP9K8q52Cj6ZRNnaLffoUDfI5zhVLgrvxCN0Ux5URYXYYF84Wf2qqf4uDV591ZuiLHir7c8F+mZOU5M+Iazg8n3mYjnxORkV3I6dxg6KrMQW3Yaexlq+uv8D1v2IL+t4z3B/NAAAAAElFTkSuQmCC";return a(A.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},camera:{get:function(){return this._scene.camera}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){if(0>=e)throw new l("targetFrameRate must be greater than 0, or undefined.");this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&T(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){if(0>=e)throw new l("resolutionScale must be greater than 0.");this._resolutionScale=e,this._forceResize=!0}}}),A.prototype.showErrorPanel=function(e,t,i){function r(){u.style.maxHeight=Math.max(Math.round(.9*n.clientHeight-100),30)+"px"}var n=this._element,a=document.createElement("div");a.className="cesium-widget-errorPanel";var s=document.createElement("div");s.className="cesium-widget-errorPanel-content",a.appendChild(s);var l=document.createElement("div");l.className="cesium-widget-errorPanel-header",l.appendChild(document.createTextNode(e)),s.appendChild(l);var u=document.createElement("div");if(u.className="cesium-widget-errorPanel-scroll",s.appendChild(u),r(),o(window.addEventListener)&&window.addEventListener("resize",r,!1),o(t)){var c=document.createElement("div");c.className="cesium-widget-errorPanel-message",c.innerHTML="<p>"+t+"</p>",u.appendChild(c)}var d="(no error details available)";o(i)&&(d=h(i));var p=document.createElement("div");p.className="cesium-widget-errorPanel-message",p.appendChild(document.createTextNode(d)),u.appendChild(p);var m=document.createElement("div");m.className="cesium-widget-errorPanel-buttonPanel",s.appendChild(m);var f=document.createElement("button");f.setAttribute("type","button"),f.className="cesium-button",f.appendChild(document.createTextNode("OK")),f.onclick=function(){o(r)&&o(window.removeEventListener)&&window.removeEventListener("resize",r,!1),n.removeChild(a)},m.appendChild(f),n.appendChild(a),"undefined"!=typeof console&&console.error(e+"\n"+t+"\n"+d)},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){this._scene=this._scene&&this._scene.destroy(),this._container.removeChild(this._element),s(this)},A.prototype.resize=function(){var e=this._canvas,t=e.clientWidth,i=e.clientHeight;(this._forceResize||this._canvasWidth!==t||this._canvasHeight!==i)&&(this._forceResize=!1,x(this),b(this))},A.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();var e=this._clock.tick();this._scene.render(e)}else this._clock.tick()},A}),i("Widgets/ClockViewModel",["../Core/Clock","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/EventHelper","../Core/JulianDate","../ThirdParty/knockout"],function(e,t,i,r,n,o,a){"use strict";function s(i){t(i)||(i=new e),this._clock=i,this._eventHelper=new n,this._eventHelper.add(i.onTick,this.synchronize,this);var r=a.observable(i.startTime);r.equalityComparer=o.equals,this.systemTime=a.observable(o.now()),this.systemTime.equalityComparer=o.equals,a.track(this,["systemTime"]),this.startTime=void 0,a.defineProperty(this,"startTime",{get:r,set:function(e){r(e),i.startTime=e}});var s=a.observable(i.stopTime);s.equalityComparer=o.equals,this.stopTime=void 0,a.defineProperty(this,"stopTime",{get:s,set:function(e){i.stopTime=e,s(e)}});var l=a.observable(i.currentTime);l.equalityComparer=o.equals,this.currentTime=void 0,a.defineProperty(this,"currentTime",{get:l,set:function(e){i.currentTime=e,l(e)}});var u=a.observable(i.multiplier);this.multiplier=void 0,a.defineProperty(this,"multiplier",{get:u,set:function(e){i.multiplier=e,u(e)}});var c=a.observable(i.clockStep);c.equalityComparer=function(e,t){return e===t},this.clockStep=void 0,a.defineProperty(this,"clockStep",{get:c,set:function(e){c(e),i.clockStep=e}});var h=a.observable(i.clockRange);h.equalityComparer=function(e,t){return e===t},this.clockRange=void 0,a.defineProperty(this,"clockRange",{get:h,set:function(e){h(e),i.clockRange=e}});var d=a.observable(i.canAnimate);this.canAnimate=void 0,a.defineProperty(this,"canAnimate",{get:d,set:function(e){d(e),i.canAnimate=e}});var p=a.observable(i.shouldAnimate);this.shouldAnimate=void 0,a.defineProperty(this,"shouldAnimate",{get:p,set:function(e){p(e),i.shouldAnimate=e}})}return i(s.prototype,{clock:{get:function(){return this._clock}}}),s.prototype.synchronize=function(){var e=this._clock,t=e.startTime,i=e.stopTime,r=e.currentTime,n=e.multiplier,a=e.clockStep,s=e.clockRange,l=e.canAnimate,u=e.shouldAnimate;this.systemTime=o.now(),this.startTime=t,this.stopTime=i,this.currentTime=r,this.multiplier=n,this.clockStep=a,this.clockRange=s,this.canAnimate=l,this.shouldAnimate=u},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){this._eventHelper.removeAll(),r(this)},s}),i("Widgets/Command",["../Core/DeveloperError"],function(e){"use strict";function t(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,e.throwInstantiationError()}return t}),i("Widgets/FullscreenButton/FullscreenButtonViewModel",["../../Core/defaultValue","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Fullscreen","../../ThirdParty/knockout","../createCommand","../getElement"],function(e,t,i,r,n,o,a,s){"use strict";function l(t){var i=this,r=o.observable(n.fullscreen),l=o.observable(n.enabled);this.isFullscreen=void 0,o.defineProperty(this,"isFullscreen",{get:function(){return r()}}),this.isFullscreenEnabled=void 0,o.defineProperty(this,"isFullscreenEnabled",{get:function(){return l()},set:function(e){l(e&&n.enabled)}}),this.tooltip=void 0,o.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?r()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=a(function(){n.fullscreen?n.exitFullscreen():n.requestFullscreen(i._fullscreenElement)},o.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=e(s(t),document.body),this._callback=function(){r(n.fullscreen)},document.addEventListener(n.changeEventName,this._callback)}return t(l.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){document.removeEventListener(n.changeEventName,this._callback),i(this)},l}),i("Widgets/FullscreenButton/FullscreenButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./FullscreenButtonViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t){e=o(e);var i=new a(t);i._exitFullScreenPath=u,i._enterFullScreenPath=l;var r=document.createElement("button");r.type="button",r.className="cesium-button cesium-fullscreenButton",r.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(r),n.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}var l="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",u="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),i("Widgets/Geocoder/GeocoderViewModel",["../../Core/BingMapsApi","../../Core/Cartesian3","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Event","../../Core/loadJsonp","../../Core/Matrix4","../../Core/Rectangle","../../Scene/SceneMode","../../ThirdParty/knockout","../../ThirdParty/when","../createCommand"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(t){this._url=i(t.url,"//dev.virtualearth.net/"),this._url.length>0&&"/"!==this._url[this._url.length-1]&&(this._url+="/"),this._key=e.getKey(t.key),this._scene=t.scene,this._flightDuration=t.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._geocodeInProgress=void 0,this._complete=new a;var r=this;this._searchCommand=p(function(){r.isSearchInProgress?g(r):v(r)}),h.track(this,["_searchText","_isSearchInProgress"]),this.isSearchInProgress=void 0,h.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,h.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(e){this._searchText=e}}),this.flightDuration=void 0,h.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(e){this._flightDuration=e}})}function f(e,t){e._scene.camera.flyTo({destination:t,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:l.IDENTITY,convert:!1})}function v(e){var i=e.searchText;if(!/^\s*$/.test(i)){var r=i.match(/[^\s,\n]+/g);if(2===r.length||3===r.length){var n=+r[0],o=+r[1],a=3===r.length?+r[2]:300;if(!isNaN(n)&&!isNaN(o)&&!isNaN(a))return void f(e,t.fromDegrees(n,o,a))}e._isSearchInProgress=!0;var l=s(e._url+"REST/v1/Locations",{parameters:{query:i,key:e._key},callbackParameterName:"jsonp"}),c=e._geocodeInProgress=d(l,function(t){if(!c.cancel){if(e._isSearchInProgress=!1,0===t.resourceSets.length)return void(e.searchText=e._searchText+" (not found)");var i=t.resourceSets[0];if(0===i.resources.length)return void(e.searchText=e._searchText+" (not found)");var r=i.resources[0];e._searchText=r.name;var n=r.bbox,o=n[0],a=n[1],s=n[2],l=n[3];f(e,u.fromDegrees(a,o,l,s))}},function(){c.cancel||(e._isSearchInProgress=!1,e.searchText=e._searchText+" (error)")})}}function g(e){e._isSearchInProgress=!1,r(e._geocodeInProgress)&&(e._geocodeInProgress.cancel=!0,e._geocodeInProgress=void 0)}return n(m.prototype,{url:{get:function(){return this._url}},key:{get:function(){return this._key}},complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}}}),m}),i("Widgets/Geocoder/Geocoder",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./GeocoderViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){var t=a(e.container),i=new s(e);i._startSearchPath=u,i._stopSearchPath=c;var r=document.createElement("form");r.setAttribute("data-bind","submit: search");var l=document.createElement("input");l.type="search",l.className="cesium-geocoder-input",l.setAttribute("placeholder","Enter an address or landmark..."),l.setAttribute("data-bind",'value: searchText,valueUpdate: "afterkeydown",disable: isSearchInProgress,css: { "cesium-geocoder-input-wide" : searchText.length > 0 }'),r.appendChild(l);var h=document.createElement("span");h.className="cesium-geocoder-searchButton",h.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),r.appendChild(h),t.appendChild(r),o.applyBindings(i,r),this._container=t,this._viewModel=i,this._form=r,this._onInputBegin=function(e){t.contains(e.target)||l.blur()},this._onInputEnd=function(e){t.contains(e.target)&&l.focus()},n.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),document.addEventListener("pointerup",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),document.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),document.addEventListener("touchend",this._onInputEnd,!0))}var u="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",c="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";return t(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return n.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),document.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),document.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),document.removeEventListener("touchend",this._onInputEnd,!0)),o.cleanNode(this._form),this._container.removeChild(this._form),i(this)},l}),i("Widgets/HomeButton/HomeButtonViewModel",["../../Core/Cartesian3","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Matrix4","../../Core/Rectangle","../../Scene/Camera","../../Scene/SceneMode","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(t,r){var n=t.mode;if(i(t)&&n===l.MORPHING&&t.completeMorph(),n===l.SCENE2D)t.camera.flyTo({destination:a.MAX_VALUE,duration:r,endTransform:o.IDENTITY});else if(n===l.SCENE3D){var u=t.camera.getRectangleCameraCoordinates(s.DEFAULT_VIEW_RECTANGLE),c=e.magnitude(u);c+=c*s.DEFAULT_VIEW_FACTOR,e.normalize(u,u),e.multiplyByScalar(u,c,u),t.camera.flyTo({destination:u,duration:r,endTransform:o.IDENTITY})}else if(n===l.COLUMBUS_VIEW){var h=t.globe.ellipsoid.maximumRadius,d=new e(0,-1,1);d=e.multiplyByScalar(e.normalize(d,d),5*h,d),t.camera.flyTo({destination:d,duration:r,orientation:{heading:0,pitch:-Math.acos(e.normalize(d,p).z),roll:0},endTransform:o.IDENTITY,convert:!1})}}function d(e,t){this._scene=e,this._duration=t;var i=this;this._command=c(function(){h(i._scene,i._duration)}),this.tooltip="View Home",u.track(this,["tooltip"])}var p=new e;return r(d.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}}),d}),i("Widgets/HomeButton/HomeButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./HomeButtonViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,i){e=o(e);var r=new a(t,i);r._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";var s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-home-button",s.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(s),n.applyBindings(r,s),this._container=e,this._viewModel=r,this._element=s}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),i("Widgets/InfoBox/InfoBoxViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/Event","../../ThirdParty/knockout"],function(e,t,i,r){"use strict";function n(){this._cameraClicked=new i,this._closeClicked=new i,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",r.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,r.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?a:o}}),r.defineProperty(this,"_bodyless",{get:function(){return!e(this.description)||0===this.description.length}})}var o="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",a="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z"; -return n.prototype.maxHeightOffset=function(e){return this.maxHeight-e+"px"},t(n.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}}),n}),i("Widgets/InfoBox/InfoBox",["../../Core/buildModuleUrl","../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","../subscribeAndEvaluate","./InfoBoxViewModel"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(r){r=s(r);var n=document.createElement("div");n.className="cesium-infoBox",n.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),r.appendChild(n);var o=document.createElement("div");o.className="cesium-infoBox-title",o.setAttribute("data-bind","text: titleText"),n.appendChild(o);var c=document.createElement("button");c.type="button",c.className="cesium-button cesium-infoBox-camera",c.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),n.appendChild(c);var h=document.createElement("button");h.type="button",h.className="cesium-infoBox-close",h.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),h.innerHTML="×",n.appendChild(h);var d=document.createElement("iframe");d.className="cesium-infoBox-iframe",d.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),d.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),d.setAttribute("allowfullscreen",!0),n.appendChild(d);var p=new u;a.applyBindings(p,n),this._container=r,this._element=n,this._frame=d,this._viewModel=p,this._descriptionSubscription=void 0;var m=this;d.addEventListener("load",function(){var r=d.contentDocument,o=r.createElement("link");o.href=e("Widgets/InfoBox/InfoBoxDescription.css"),o.rel="stylesheet",o.type="text/css";var a=r.createElement("div");a.className="cesium-infoBox-description",r.head.appendChild(o),r.body.appendChild(a),m._descriptionSubscription=l(p,"description",function(e){d.style.height="5px",a.innerHTML=e;var r=null,o=a.firstElementChild;if(null!==o&&1===a.childNodes.length){var s=window.getComputedStyle(o);if(null!==s){var l=s["background-color"],u=t.fromCssColorString(l);i(u)&&0!==u.alpha&&(r=s["background-color"])}}n.style["background-color"]=r;var c=a.getBoundingClientRect().height;d.style.height=c+"px"})}),d.setAttribute("src","about:blank")}return r(c.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}}),c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){var e=this._container;return a.cleanNode(this._element),e.removeChild(this._element),i(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),n(this)},c}),i("Widgets/NavigationHelpButton/NavigationHelpButtonViewModel",["../../Core/defineProperties","../../ThirdParty/knockout","../createCommand"],function(e,t,i){"use strict";function r(){this.showInstructions=!1;var e=this;this._command=i(function(){e.showInstructions=!e.showInstructions}),this._showClick=i(function(){e._touch=!1}),this._showTouch=i(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",t.track(this,["tooltip","showInstructions","_touch"])}return e(r.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}}),r}),i("Widgets/NavigationHelpButton/NavigationHelpButton",["../../Core/buildModuleUrl","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./NavigationHelpButtonViewModel"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(i){var r=l(i.container),n=new u,o=t(i.instructionsInitiallyVisible,!1);n.showInstructions=o,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";var c=document.createElement("span");c.className="cesium-navigationHelpButton-wrapper",r.appendChild(c);var h=document.createElement("button");h.type="button",h.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",h.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),c.appendChild(h);var d=document.createElement("div");d.className="cesium-navigation-help",d.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),c.appendChild(d);var p=document.createElement("button");p.type="button",p.className="cesium-navigation-button cesium-navigation-button-left",p.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');var m=document.createElement("img");m.src=e("Widgets/Images/NavigationHelp/Mouse.svg"),m.className="cesium-navigation-button-icon",m.style.width="25px",m.style.height="25px",p.appendChild(m),p.appendChild(document.createTextNode("Mouse"));var f=document.createElement("button");f.type="button",f.className="cesium-navigation-button cesium-navigation-button-right",f.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');var v=document.createElement("img");v.src=e("Widgets/Images/NavigationHelp/Touch.svg"),v.className="cesium-navigation-button-icon",v.style.width="25px",v.style.height="25px",f.appendChild(v),f.appendChild(document.createTextNode("Touch")),d.appendChild(p),d.appendChild(f);var g=document.createElement("div");g.className="cesium-click-navigation-help cesium-navigation-help-instructions",g.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),g.innerHTML=' <table> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/MouseLeft.svg")+'" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/MouseRight.svg")+'" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/MouseMiddle.svg")+'" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>',d.appendChild(g);var _=document.createElement("div");_.className="cesium-touch-navigation-help cesium-navigation-help-instructions",_.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),_.innerHTML=' <table> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/TouchDrag.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/TouchZoom.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/TouchTilt.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/TouchRotate.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>',d.appendChild(_),s.applyBindings(n,c),this._container=r,this._viewModel=n,this._wrapper=c,this._closeInstructions=function(e){c.contains(e.target)||(n.showInstructions=!1)},a.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}return r(c.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return a.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),s.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),n(this)},c}),i("Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Scene/FrameRateMonitor","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s){"use strict";function l(t){this._scene=t.scene,this.lowFrameRateMessage=e(t.lowFrameRateMessage,"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,a.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);var i=this;this._dismissMessage=s(function(){i.showingLowFrameRateMessage=!1,i.lowFrameRateMessageDismissed=!0});var r=o.fromScene(t.scene);this._unsubscribeLowFrameRate=r.lowFrameRate.addEventListener(function(){i.lowFrameRateMessageDismissed||(i.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=r.nominalFrameRate.addEventListener(function(){i.showingLowFrameRateMessage=!1})}return i(l.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}}),l.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),r(this)},l}),i("Widgets/PerformanceWatchdog/PerformanceWatchdog",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./PerformanceWatchdogViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e){var t=o(e.container),i=new a(e),r=document.createElement("div");r.className="cesium-performance-watchdog-message-area",r.setAttribute("data-bind","visible: showingLowFrameRateMessage");var s=document.createElement("button");s.setAttribute("type","button"),s.className="cesium-performance-watchdog-message-dismiss",s.innerHTML="×",s.setAttribute("data-bind","click: dismissMessage"),r.appendChild(s);var l=document.createElement("div");l.className="cesium-performance-watchdog-message",l.setAttribute("data-bind","html: lowFrameRateMessage"),r.appendChild(l),t.appendChild(r),n.applyBindings(i,r),this._container=t,this._viewModel=i,this._element=r}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),i("Widgets/SceneModePicker/SceneModePickerViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Scene/SceneMode","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,i){this._scene=t;var r=this,n=function(e,t,i,n){r.sceneMode=i,r.dropDownVisible=!1};this._eventHelper=new o,this._eventHelper.add(t.morphStart,n),this._duration=e(i,2),this.sceneMode=t.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",s.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,s.defineProperty(this,"selectedTooltip",function(){var e=r.sceneMode;return e===a.SCENE2D?r.tooltip2D:e===a.SCENE3D?r.tooltip3D:r.tooltipColumbusView}),this._toggleDropDown=l(function(){r.dropDownVisible=!r.dropDownVisible}),this._morphTo2D=l(function(){t.morphTo2D(r._duration)}),this._morphTo3D=l(function(){t.morphTo3D(r._duration)}),this._morphToColumbusView=l(function(){t.morphToColumbusView(r._duration)}),this._sceneMode=a}return i(u.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}}),u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){this._eventHelper.removeAll(),r(this)},u}),i("Widgets/SceneModePicker/SceneModePicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./SceneModePickerViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t,i){e=a(e);var r=new s(t,i);r._globePath=u,r._flatMapPath=c,r._columbusViewPath=h;var l=document.createElement("span");l.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(l);var d=document.createElement("button");d.type="button",d.className="cesium-button cesium-toolbar-button",d.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),d.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',l.appendChild(d);var p=document.createElement("button");p.type="button",p.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",p.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),l.appendChild(p);var m=document.createElement("button");m.type="button",m.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",m.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),l.appendChild(m);var f=document.createElement("button");f.type="button",f.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",f.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),l.appendChild(f),o.applyBindings(r,l),this._viewModel=r,this._container=e,this._wrapper=l,this._closeDropDown=function(e){l.contains(e.target)||(r.dropDownVisible=!1)},n.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}var u="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",c="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",h="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";return t(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._viewModel.destroy(),n.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),o.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),i(this)},l}),i("Widgets/SelectionIndicator/SelectionIndicatorViewModel",["../../Core/Cartesian2","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/EasingFunction","../../Scene/SceneTransforms","../../ThirdParty/knockout"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,r,n){this._scene=e,this._screenPositionX=c,this._screenPositionY=c,this._tweens=e.tweens,this._container=t(n,document.body),this._selectionIndicatorElement=r,this._scale=1,this.position=void 0,this.showSelection=!1,s.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,s.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&i(this.position)}}),s.defineProperty(this,"_transform",{get:function(){return"scale("+this._scale+")"}}),this.computeScreenSpacePosition=function(t,i){return a.wgs84ToWindowCoordinates(e,t,i)}}var u=new e,c="-1000px";return l.prototype.update=function(){if(this.showSelection&&i(this.position)){var e=this.computeScreenSpacePosition(this.position,u);if(i(e)){var t=this._container,r=t.parentNode.clientWidth,n=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,a=.5*o;e.x=Math.min(Math.max(e.x,-o),r+o)-a,e.y=Math.min(Math.max(e.y,-o),n+o)-a,this._screenPositionX=Math.floor(e.x+.25)+"px",this._screenPositionY=Math.floor(e.y+.25)+"px"}else this._screenPositionX=c,this._screenPositionY=c}},l.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:o.EXPONENTIAL_OUT})},l.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:o.EXPONENTIAL_OUT})},r(l.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}}),l}),i("Widgets/SelectionIndicator/SelectionIndicator",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./SelectionIndicatorViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t){e=o(e),this._container=e;var i=document.createElement("div");i.className="cesium-selection-wrapper",i.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(i),this._element=i;var r="http://www.w3.org/2000/svg",s="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",l=document.createElementNS(r,"svg:svg");l.setAttribute("width",160),l.setAttribute("height",160),l.setAttribute("viewBox","0 0 160 160");var u=document.createElementNS(r,"g");u.setAttribute("transform","translate(80,80)"),l.appendChild(u);var c=document.createElementNS(r,"path");c.setAttribute("data-bind","attr: { transform: _transform }"),c.setAttribute("d",s),u.appendChild(c),i.appendChild(l);var h=new a(t,this._element,this._container);this._viewModel=h,n.applyBindings(this._viewModel,this._element)}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){var e=this._container;return n.cleanNode(this._element),e.removeChild(this._element),i(this)},s}),i("Widgets/Timeline/TimelineHighlightRange",["../../Core/defaultValue","../../Core/JulianDate"],function(e,t){"use strict";function i(t,i,r){this._color=t,this._height=i,this._base=e(r,0)}return i.prototype.getHeight=function(){return this._height},i.prototype.getBase=function(){return this._base},i.prototype.getStartTime=function(){return this._start},i.prototype.getStopTime=function(){return this._stop},i.prototype.setRange=function(e,t){this._start=e,this._stop=t},i.prototype.render=function(e){var i="";if(this._start&&this._stop&&this._color){var r=t.secondsDifference(this._start,e.epochJulian),n=Math.round(e.timeBarWidth*e.getAlpha(r)),o=t.secondsDifference(this._stop,e.epochJulian),a=Math.round(e.timeBarWidth*e.getAlpha(o))-n;0>n&&(a+=n,n=0),n+a>e.timeBarWidth&&(a=e.timeBarWidth-n),a>0&&(i='<span class="cesium-timeline-highlight" style="left: '+n.toString()+"px; width: "+a.toString()+"px; bottom: "+this._base.toString()+"px; height: "+this._height+"px; background-color: "+this._color+';"></span>')}return i},i}),i("Widgets/Timeline/TimelineTrack",["../../Core/Color","../../Core/defined","../../Core/JulianDate"],function(e,t,i){"use strict";function r(t,i,r,n){this.interval=t,this.height=i,this.color=r||new e(.5,.5,.5,1),this.backgroundColor=n||new e(0,0,0,0)}return r.prototype.render=function(e,r){var n=this.interval.start,o=this.interval.stop,a=r.startJulian,s=i.addSeconds(r.startJulian,r.duration,new i);if(i.lessThan(n,a)&&i.greaterThan(o,s))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,r.y,r.timeBarWidth,this.height);else if(i.lessThanOrEquals(n,s)&&i.greaterThanOrEquals(o,a)){var l,u,c;for(l=0;l<r.timeBarWidth;++l){var h=i.addSeconds(r.startJulian,l/r.timeBarWidth*r.duration,new i); -!t(u)&&i.greaterThanOrEquals(h,n)?u=l:!t(c)&&i.greaterThanOrEquals(h,o)&&(c=l)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,r.y,r.timeBarWidth,this.height),t(u)&&(t(c)||(c=r.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(u,r.y,Math.max(c-u,1),this.height))}},r}),i("Widgets/Timeline/Timeline",["../../Core/ClockRange","../../Core/defined","../../Core/destroyObject","../../Core/DeveloperError","../../Core/JulianDate","../getElement","./TimelineHighlightRange","./TimelineTrack"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t){e=o(e),this.container=e;var i=document.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=_.none,this._touchMode=y.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=c(this),this._onMouseUp=h(this),this._onMouseMove=d(this),this._onMouseWheel=p(this),this._onTouchStart=m(this),this._onTouchMove=v(this),this._onTouchEnd=f(this);var r=this._timeBarEle;document.addEventListener("mouseup",this._onMouseUp,!1),document.addEventListener("mousemove",this._onMouseMove,!1),r.addEventListener("mousedown",this._onMouseDown,!1),r.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),r.addEventListener("mousewheel",this._onMouseWheel,!1),r.addEventListener("touchstart",this._onTouchStart,!1),r.addEventListener("touchmove",this._onTouchMove,!1),r.addEventListener("touchend",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}function u(e){return 10>e?"0"+e.toString():e.toString()}function c(e){return function(t){e._mouseMode!==_.touchOnly&&(0===t.button?(e._mouseMode=_.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,2===t.button?e._mouseMode=_.zoom:e._mouseMode=_.slide)),t.preventDefault()}}function h(e){return function(t){e._mouseMode=_.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0px 0px"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function d(e){return function(t){var i;if(e._mouseMode===_.scrub){t.preventDefault();var r=t.clientX-e._topDiv.getBoundingClientRect().left;0>r?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):r>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(r,r*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===_.slide){if(i=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==i){var o=i*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(n.addSeconds(e._startJulian,o,new n),n.addSeconds(e._endJulian,o,new n))}}else e._mouseMode===_.zoom&&(i=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==i&&e.zoomFrom(Math.pow(1.01,i)))}}function p(e){return function(t){var i=t.wheelDeltaY||t.wheelDelta||-t.detail;g=Math.max(Math.min(Math.abs(i),g),1),i/=g,e.zoomFrom(Math.pow(1.05,-i))}}function m(e){return function(t){var i,r,o=t.touches.length,a=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=_.touchOnly,1===o?(i=n.secondsDifference(e._scrubJulian,e._startJulian),r=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+a),Math.abs(t.touches[0].clientX-r)<50?(e._touchMode=y.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=1===o?"-16px 0":"0 0")):(e._touchMode=y.singleTap,e._touchState.centerX=t.touches[0].clientX-a)):2===o?(e._touchMode=y.slideZoom,e._touchState.centerX=.5*(t.touches[0].clientX+t.touches[1].clientX)-a,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=y.ignore}}function f(e){return function(t){var i=t.touches.length,r=e._topDiv.getBoundingClientRect().left;e._touchMode===y.singleTap?(e._touchMode=y.scrub,e._handleTouchMove(t)):e._touchMode===y.scrub&&e._handleTouchMove(t),e._mouseMode=_.touchOnly,1!==i?e._touchMode=i>0?y.ignore:y.none:e._touchMode===y.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-r),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function v(e){return function(i){var r,o,a,s,l,u,c=1,h=e._topDiv.getBoundingClientRect().left;e._touchMode===y.singleTap&&(e._touchMode=y.slideZoom),e._mouseMode=_.touchOnly,e._touchMode===y.scrub?(i.preventDefault(),1===i.changedTouches.length&&(o=i.changedTouches[0].clientX-h,o>=0&&o<=e._topDiv.clientWidth&&e._setTimeBarTime(o,o*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===y.slideZoom&&(a=i.touches.length,2===a?(s=.5*(i.touches[0].clientX+i.touches[1].clientX)-h,l=Math.abs(i.touches[0].clientX-i.touches[1].clientX)):1===a&&(s=i.touches[0].clientX-h,l=0),t(s)&&(l>0&&e._touchState.spanX>0?(c=e._touchState.spanX/l,u=n.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-s*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new n)):(r=e._touchState.centerX-s,u=n.addSeconds(e._startJulian,r*e._timeBarSecondsSpan/e._topDiv.clientWidth,new n)),e.zoomTo(u,n.addSeconds(u,e._timeBarSecondsSpan*c,new n)),e._touchState.centerX=s,e._touchState.spanX=l))}}var g=1e12,_={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},y={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},C=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],E=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return l.prototype.addEventListener=function(e,t,i){this._topDiv.addEventListener(e,t,i)},l.prototype.removeEventListener=function(e,t,i){this._topDiv.removeEventListener(e,t,i)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this),document.removeEventListener("mouseup",this._onMouseUp,!1),document.removeEventListener("mousemove",this._onMouseMove,!1);var e=this._timeBarEle;e.removeEventListener("mousedown",this._onMouseDown,!1),e.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),e.removeEventListener("mousewheel",this._onMouseWheel,!1),e.removeEventListener("touchstart",this._onTouchStart,!1),e.removeEventListener("touchmove",this._onTouchMove,!1),e.removeEventListener("touchend",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),i(this)},l.prototype.addHighlightRange=function(e,t,i){var r=new a(e,t,i);return this._highlightRanges.push(r),this.resize(),r},l.prototype.addTrack=function(e,t,i,r){var n=new s(e,t,i,r);return this._trackList.push(n),this._lastHeight=void 0,this.resize(),n},l.prototype.zoomTo=function(t,i){if(this._startJulian=t,this._endJulian=i,this._timeBarSecondsSpan=n.secondsDifference(i,t),this._clock&&this._clock.clockRange!==e.UNBOUNDED){var r=this._clock.startTime,o=this._clock.stopTime,a=n.secondsDifference(o,r),s=n.secondsDifference(r,this._startJulian),l=n.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=a?(this._timeBarSecondsSpan=a,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=n.addSeconds(this._endJulian,s,new n),this._startJulian=r,this._timeBarSecondsSpan=n.secondsDifference(this._endJulian,this._startJulian)):0>l&&(this._startJulian=n.addSeconds(this._startJulian,l,new n),this._endJulian=o,this._timeBarSecondsSpan=n.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();var u=document.createEvent("Event");u.initEvent("setzoom",!0,!0),u.startJulian=this._startJulian,u.endJulian=this._endJulian,u.epochJulian=this._epochJulian,u.totalSpan=this._timeBarSecondsSpan,u.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(u)},l.prototype.zoomFrom=function(e){var t=n.secondsDifference(this._scrubJulian,this._startJulian);e>1||0>t||t>this._timeBarSecondsSpan?t=.5*this._timeBarSecondsSpan:t+=t-.5*this._timeBarSecondsSpan;var i=this._timeBarSecondsSpan-t;this.zoomTo(n.addSeconds(this._startJulian,t-t*e,new n),n.addSeconds(this._endJulian,i*e-i,new n))},l.prototype.makeLabel=function(e){var t=n.toGregorianDate(e),i=t.millisecond,r=" UTC";if(i>0&&this._timeBarSecondsSpan<3600){for(r=Math.floor(i).toString();r.length<3;)r="0"+r;r="."+r}return E[t.month-1]+" "+t.day+" "+t.year+" "+u(t.hour)+":"+u(t.minute)+":"+u(t.second)+r},l.prototype.smallestTicInPixels=7,l.prototype._makeTics=function(){function e(e){return Math.floor(S/e)*e}function t(e,t){return Math.ceil(e/t+.5)*t}function i(e){return(e-S)/v}function r(e,t){return e-t*Math.round(e/t)}var o,a=this._timeBarEle,s=n.secondsDifference(this._scrubJulian,this._startJulian),l=Math.round(s*this._topDiv.clientWidth/this._timeBarSecondsSpan),u=l-8,c=this;this._needleEle.style.left=l.toString()+"px";var h="",d=.01,p=31536e6,m=1e-10,f=0,v=this._timeBarSecondsSpan;d>v?(v=d,this._timeBarSecondsSpan=d,this._endJulian=n.addSeconds(this._startJulian,d,new n)):v>p&&(v=p,this._timeBarSecondsSpan=p,this._endJulian=n.addSeconds(this._startJulian,p,new n));var g=this._timeBarEle.clientWidth;10>g&&(g=10);var _,y=this._startJulian,E=Math.min(v/g*1e-5,.4);_=v>31536e4?n.fromIso8601(n.toDate(y).toISOString().substring(0,2)+"00-01-01T00:00:00Z"):v>31536e3?n.fromIso8601(n.toDate(y).toISOString().substring(0,3)+"0-01-01T00:00:00Z"):v>86400?n.fromIso8601(n.toDate(y).toISOString().substring(0,4)+"-01-01T00:00:00Z"):n.fromIso8601(n.toDate(y).toISOString().substring(0,10)+"T00:00:00Z");var S=n.secondsDifference(this._startJulian,n.addSeconds(_,E,new n)),w=S+v;this._epochJulian=_,this._rulerEle.innerHTML=this.makeLabel(n.addSeconds(this._endJulian,-d,new n));var T=this._rulerEle.offsetWidth+20;30>T&&(T=180);var x=f;f-=m;var b={startTime:S,startJulian:y,epochJulian:_,duration:v,timeBarWidth:g,getAlpha:i};this._highlightRanges.forEach(function(e){h+=e.render(b)});var A=0,P=0,I=0,M=T/g;M>1&&(M=1),M*=this._timeBarSecondsSpan;var D,R=-1,O=-1,N=C.length;for(D=0;N>D;++D){var L=C[D];if(++R,A=L,L>M&&L>f)break;0>O&&g*(L/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(O=R)}if(R>0){for(;R>0;)if(--R,Math.abs(r(A,C[R]))<1e-5){C[R]>=f&&(P=C[R]);break}if(O>=0)for(;R>O;){if(Math.abs(r(P,C[O]))<1e-5&&C[O]>=f){I=C[O];break}++O}}f=x,f>m&&1e-5>I&&Math.abs(f-A)>m&&(I=f,A+m>=f&&(P=0));var F,B=-999999;if(g*(I/this._timeBarSecondsSpan)>=3)for(o=e(I);w>=o;o=t(o,I))h+='<span class="cesium-timeline-ticTiny" style="left: '+Math.round(g*i(o)).toString()+'px;"></span>';if(g*(P/this._timeBarSecondsSpan)>=3)for(o=e(P);w>=o;o=t(o,P))h+='<span class="cesium-timeline-ticSub" style="left: '+Math.round(g*i(o)).toString()+'px;"></span>';if(g*(A/this._timeBarSecondsSpan)>=2){this._mainTicSpan=A,w+=A,o=e(A);for(var V=n.computeTaiMinusUtc(_);w>=o;){var k=n.addSeconds(y,o-S,new n);if(A>2.1){var z=n.computeTaiMinusUtc(k);Math.abs(z-V)>.1&&(o+=z-V,k=n.addSeconds(y,o-S,new n))}var U=Math.round(g*i(o)),G=this.makeLabel(k);this._rulerEle.innerHTML=G,F=this._rulerEle.offsetWidth,10>F&&(F=T);var W=U-(F/2-1);W>B?(B=W+F+5,h+='<span class="cesium-timeline-ticMain" style="left: '+U.toString()+'px;"></span><span class="cesium-timeline-ticLabel" style="left: '+W.toString()+'px;">'+G+"</span>"):h+='<span class="cesium-timeline-ticSub" style="left: '+U.toString()+'px;"></span>',o=t(o,A)}}else this._mainTicSpan=-1;h+='<span class="cesium-timeline-icon16" style="left:'+u+'px;bottom:0;background-position: 0px 0px;"></span>',a.innerHTML=h,this._scrubElement=a.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),b.y=0,this._trackList.forEach(function(e){e.render(c._context,b),b.y+=e.height})},l.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;var e=this._scrubElement;if(t(this._scrubElement)){var i=n.secondsDifference(this._scrubJulian,this._startJulian),r=Math.round(i*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==r&&(this._lastXPos=r,e.style.left=r-8+"px",this._needleEle.style.left=r+"px")}t(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(n.addSeconds(this._startJulian,this._timelineDrag,new n),n.addSeconds(this._endJulian,this._timelineDrag,new n)))},l.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=n.addSeconds(this._startJulian,t,new n),this._scrubElement){var i=e-8;this._scrubElement.style.left=i.toString()+"px",this._needleEle.style.left=e.toString()+"px"}var r=document.createEvent("Event");r.initEvent("settime",!0,!0),r.clientX=e,r.timeSeconds=t,r.timeJulian=this._scrubJulian,r.clock=this._clock,this._topDiv.dispatchEvent(r)},l.prototype.resize=function(){var e=this.container.clientWidth,t=this.container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){this._trackContainer.style.height=t+"px";var i=1;this._trackList.forEach(function(e){i+=e.height}),this._trackListEle.style.height=i.toString()+"px",this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=i,this._makeTics(),this._lastWidth=e,this._lastHeight=t}},l}),i("Widgets/VRButton/VRButtonViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Fullscreen","../../ThirdParty/knockout","../../ThirdParty/NoSleep","../createCommand","../getElement"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e){var i=!1,r=window.screen;return t(r)&&(t(r.lockOrientation)?i=r.lockOrientation(e):t(r.mozLockOrientation)?i=r.mozLockOrientation(e):t(r.msLockOrientation)?i=r.msLockOrientation(e):t(r.orientation&&r.orientation.lock)&&(i=r.orientation.lock(e))),i}function h(){var e=window.screen;t(e)&&(t(e.unlockOrientation)?e.unlockOrientation():t(e.mozUnlockOrientation)?e.mozUnlockOrientation():t(e.msUnlockOrientation)?e.msUnlockOrientation():t(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function d(e,t,i){i()?(t.useWebVR=!1,e._locked&&(h(),e._locked=!1),e._noSleep.disable(),o.exitFullscreen(),i(!1)):(o.fullscreen||o.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=c("landscape")),t.useWebVR=!0,i(!0))}function p(t,i){var r=this,n=a.observable(o.enabled),c=a.observable(!1);this.isVRMode=void 0,a.defineProperty(this,"isVRMode",{get:function(){return c()}}),this.isVREnabled=void 0,a.defineProperty(this,"isVREnabled",{get:function(){return n()},set:function(e){n(e&&o.enabled)}}),this.tooltip=void 0,a.defineProperty(this,"tooltip",function(){return n()?c()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"}),this._locked=!1,this._noSleep=new s,this._command=l(function(){d(r,t,c)},a.getObservable(this,"isVREnabled")),this._vrElement=e(u(i),document.body),this._callback=function(){!o.fullscreen&&c()&&(t.useWebVR=!1,r._locked&&(h(),r._locked=!1),r._noSleep.disable(),c(!1))},document.addEventListener(o.changeEventName,this._callback)}return i(p.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}}),p.prototype.isDestroyed=function(){return!1},p.prototype.destroy=function(){r(this)},p}),i("Widgets/VRButton/VRButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./VRButtonViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,i){e=o(e);var r=new a(t,i);r._exitVRPath=u,r._enterVRPath=l;var s=document.createElement("button");s.type="button",s.className="cesium-button cesium-vrButton",s.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }"),e.appendChild(s),n.applyBindings(r,s),this._container=e,this._viewModel=r,this._element=s}var l="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",u="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),i("Widgets/Viewer/Viewer",["../../Core/BoundingSphere","../../Core/Cartesian3","../../Core/defaultValue","../../Core/defined","../../Core/definedNotNull","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Core/Fullscreen","../../Core/isArray","../../Core/Matrix4","../../Core/ScreenSpaceEventType","../../DataSources/BoundingSphereState","../../DataSources/ConstantPositionProperty","../../DataSources/DataSourceCollection","../../DataSources/DataSourceDisplay","../../DataSources/Entity","../../DataSources/EntityView","../../DataSources/Property","../../Scene/SceneMode","../../ThirdParty/knockout","../../ThirdParty/when","../Animation/Animation","../Animation/AnimationViewModel","../BaseLayerPicker/BaseLayerPicker","../BaseLayerPicker/createDefaultImageryProviderViewModels","../BaseLayerPicker/createDefaultTerrainProviderViewModels","../CesiumWidget/CesiumWidget","../ClockViewModel","../FullscreenButton/FullscreenButton","../Geocoder/Geocoder","../getElement","../HomeButton/HomeButton","../InfoBox/InfoBox","../NavigationHelpButton/NavigationHelpButton","../SceneModePicker/SceneModePicker","../SelectionIndicator/SelectionIndicator","../subscribeAndEvaluate","../Timeline/Timeline","../VRButton/VRButton"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O,N,L,F,B,V,k,z){"use strict";function U(e){var t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function G(e,t){var n=e.scene.pick(t.position);if(r(n)){var o=i(n.id,n.primitive.id);if(o instanceof g)return o}return r(e.scene.globe)?H(e,t.position):void 0}function W(e,t,i){if(r(i)){var n=i.clock;r(n)&&(n.getValue(t),r(e)&&(e.updateFromClock(),e.zoomTo(n.startTime,n.stopTime)))}}function H(e,t){var i=e.scene,n=i.camera.getPickRay(t),o=i.imageryLayers.pickImageryLayerFeatures(n,i);if(r(o)){var a=new g({id:"Loading...",description:"Loading feature information..."});return S(o,function(t){if(e.selectedEntity===a){if(!r(t)||0===t.length)return void(e.selectedEntity=q());var i=t[0],n=new g({id:i.name,description:i.description});if(r(i.position)){var o=e.scene.globe.ellipsoid.cartographicToCartesian(i.position,ee);n.position=new m(o)}e.selectedEntity=n}},function(){e.selectedEntity===a&&(e.selectedEntity=q())}),a}}function q(){return new g({id:"None",description:"No features found."})}function j(e,t){var i=e._geocoder,n=e._homeButton,o=e._sceneModePicker,a=e._baseLayerPicker,s=e._animation,l=e._timeline,u=e._fullscreenButton,c=e._infoBox,h=e._selectionIndicator,d=t?"hidden":"visible";if(r(i)&&(i.container.style.visibility=d),r(n)&&(n.container.style.visibility=d),r(o)&&(o.container.style.visibility=d),r(a)&&(a.container.style.visibility=d),r(s)&&(s.container.style.visibility=d),r(l)&&(l.container.style.visibility=d),r(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=d),r(c)&&(c.container.style.visibility=d),r(h)&&(h.container.style.visibility=d),e._container){var p=t||!r(u)?0:u.container.clientWidth;e._vrButton.container.style.right=p+"px",e.forceResize()}}function Y(e,t){function o(e){var t=G(c,e);r(t)&&(y.getValueOrUndefined(t.position,c.clock.currentTime)?c.trackedEntity=t:c.zoomTo(t))}function a(e){c.selectedEntity=G(c,e)}e=R(e),t=i(t,i.EMPTY_OBJECT);var u=!(r(t.globe)&&t.globe===!1||r(t.baseLayerPicker)&&t.baseLayerPicker===!1),c=this,h=document.createElement("div");h.className="cesium-viewer",e.appendChild(h);var p=document.createElement("div");p.className="cesium-viewer-cesiumWidgetContainer",h.appendChild(p);var m=document.createElement("div");m.className="cesium-viewer-bottom",h.appendChild(m);var g=i(t.scene3DOnly,!1),_=new P(p,{terrainProvider:t.terrainProvider,imageryProvider:u?!1:t.imageryProvider,clock:t.clock,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,creditContainer:r(t.creditContainer)?t.creditContainer:m,scene3DOnly:g,terrainExaggeration:t.terrainExaggeration}),C=t.dataSources,S=!1;r(C)||(C=new f,S=!0);var W=new v({scene:_.scene,dataSourceCollection:C}),H=_.clock,q=new I(H),X=new l;X.add(H.onTick,Y.prototype._onTick,this),X.add(_.scene.morphStart,Y.prototype._clearTrackedObject,this);var Z;if(!r(t.selectionIndicator)||t.selectionIndicator!==!1){var K=document.createElement("div");K.className="cesium-viewer-selectionIndicatorContainer",h.appendChild(K),Z=new B(K,_.scene)}var Q;if(!r(t.infoBox)||t.infoBox!==!1){var J=document.createElement("div");J.className="cesium-viewer-infoBoxContainer",h.appendChild(J),Q=new N(J);var $=Q.viewModel;X.add($.cameraClicked,Y.prototype._onInfoBoxCameraClicked,this),X.add($.closeClicked,Y.prototype._onInfoBoxClockClicked,this)}var ee=document.createElement("div");ee.className="cesium-viewer-toolbar",h.appendChild(ee);var te;if(!r(t.geocoder)||t.geocoder!==!1){var ie=document.createElement("div");ie.className="cesium-viewer-geocoderContainer",ee.appendChild(ie),te=new D({container:ie,scene:_.scene}),X.add(te.viewModel.search.beforeExecute,Y.prototype._clearObjects,this)}var re;if(r(t.homeButton)&&t.homeButton===!1||(re=new O(ee,_.scene),r(te)&&X.add(re.viewModel.command.afterExecute,function(){var e=te.viewModel;e.searchText="",e.isSearchInProgress&&e.search()}),X.add(re.viewModel.command.beforeExecute,Y.prototype._clearTrackedObject,this)),t.sceneModePicker===!0&&g)throw new s("options.sceneModePicker is not available when options.scene3DOnly is set to true.");var ne;g||r(t.sceneModePicker)&&t.sceneModePicker===!1||(ne=new F(ee,_.scene));var oe,ae;if(u){var se=i(t.imageryProviderViewModels,b()),le=i(t.terrainProviderViewModels,A());oe=new x(ee,{globe:_.scene.globe,imageryProviderViewModels:se,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:le,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel});var ue=ee.getElementsByClassName("cesium-baseLayerPicker-dropDown");ae=ue[0]}var ce;if(!r(t.navigationHelpButton)||t.navigationHelpButton!==!1){var he=!0;try{if(n(window.localStorage)){var de=window.localStorage.getItem("cesium-hasSeenNavHelp");r(de)&&Boolean(de)?he=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch(pe){}ce=new L({container:ee,instructionsInitiallyVisible:i(t.navigationInstructionsInitiallyVisible,he)})}var me;if(!r(t.animation)||t.animation!==!1){var fe=document.createElement("div");fe.className="cesium-viewer-animationContainer",h.appendChild(fe),me=new w(fe,new T(q))}var ve;if(!r(t.timeline)||t.timeline!==!1){var ge=document.createElement("div");ge.className="cesium-viewer-timelineContainer",h.appendChild(ge),ve=new k(ge,H),ve.addEventListener("settime",U,!1),ve.zoomTo(H.startTime,H.stopTime)}var _e,ye;if(!r(t.fullscreenButton)||t.fullscreenButton!==!1){var Ce=document.createElement("div");Ce.className="cesium-viewer-fullscreenContainer",h.appendChild(Ce),_e=new M(Ce,t.fullscreenElement),ye=V(_e.viewModel,"isFullscreenEnabled",function(e){Ce.style.display=e?"block":"none",r(ve)&&(ve.container.style.right=Ce.clientWidth+"px",ve.resize())})}var Ee,Se,we;if(t.vrButton){var Te=document.createElement("div");Te.className="cesium-viewer-vrContainer",h.appendChild(Te),Ee=new z(Te,_.scene,t.fullScreenElement),Se=V(Ee.viewModel,"isVREnabled",function(e){Te.style.display=e?"block":"none",r(_e)&&(Te.style.right=Ce.clientWidth+"px"),r(ve)&&(ve.container.style.right=Te.clientWidth+"px",ve.resize())}),we=V(Ee.viewModel,"isVRMode",function(e){j(c,e)})}this._baseLayerPickerDropDown=ae,this._fullscreenSubscription=ye,this._vrSubscription=Se,this._vrModeSubscription=we,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=i(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=m,this._element=h,this._cesiumWidget=_,this._selectionIndicator=Z,this._infoBox=Q,this._dataSourceCollection=C,this._destroyDataSourceCollection=S,this._dataSourceDisplay=W,this._clockViewModel=q,this._toolbar=ee,this._homeButton=re,this._sceneModePicker=ne,this._baseLayerPicker=oe,this._navigationHelpButton=ce,this._animation=me,this._timeline=ve,this._fullscreenButton=_e,this._vrButton=Ee,this._geocoder=te,this._eventHelper=X,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=r(Q)||r(Z),this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._selectedEntity=void 0,this._clockTrackedDataSource=void 0,this._forceResize=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,E.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),X.add(C.dataSourceAdded,Y.prototype._onDataSourceAdded,this),X.add(C.dataSourceRemoved,Y.prototype._onDataSourceRemoved,this),X.add(_.scene.preRender,Y.prototype.resize,this),X.add(_.scene.postRender,Y.prototype._postRender,this);for(var xe=C.length,be=0;xe>be;be++)this._dataSourceAdded(C,C.get(be));this._dataSourceAdded(void 0,W.defaultDataSource),X.add(C.dataSourceAdded,Y.prototype._dataSourceAdded,this),X.add(C.dataSourceRemoved,Y.prototype._dataSourceRemoved,this),_.screenSpaceEventHandler.setInputAction(a,d.LEFT_CLICK),_.screenSpaceEventHandler.setInputAction(o,d.LEFT_DOUBLE_CLICK)}function X(e,t,n,o){K(e);var a=S.defer();return e._zoomPromise=a,e._zoomIsFlight=o,e._zoomOptions=n,S(t,function(t){if(e._zoomPromise===a)if(t.isLoading&&r(t.loadingEvent))var n=t.loadingEvent.addEventListener(function(){n(),e._zoomPromise===a&&(e._zoomTarget=t.entities.values.slice(0))});else t=i(t.values,t),r(t.entities)&&(t=t.entities.values),c(t)?e._zoomTarget=t.slice(0):e._zoomTarget=[t]}),a.promise}function Z(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function K(e){var t=e._zoomPromise;r(t)&&(Z(e),t.resolve(!1))}function Q(t){var n=t._zoomTarget;if(r(n)&&t.scene.mode!==C.MORPHING){for(var o=t._zoomPromise,a=[],s=0,l=n.length;l>s;s++){var u=t._dataSourceDisplay.getBoundingSphere(n[s],!1,$);if(u===p.PENDING)return;u!==p.FAILED&&a.push(e.clone($))}if(0===a.length)return void K(t);t.trackedEntity=void 0;var c=t.scene,d=c.camera,m=e.fromBoundingSpheres(a),f=c.screenSpaceCameraController;if(f.minimumZoomDistance=Math.min(f.minimumZoomDistance,.5*m.radius),t._zoomIsFlight){var v=i(t._zoomOptions,{}),g={duration:v.duration,maximumHeight:v.maximumHeight,complete:function(){o.resolve(!0)},cancel:function(){o.resolve(!1)},offset:v.offset};Z(t),d.flyToBoundingSphere(m,g)}else d.viewBoundingSphere(m,t._zoomOptions),d.lookAtTransform(h.IDENTITY),Z(t),o.resolve(!0)}}function J(e){if(e._needTrackedEntityUpdate){var t=e._trackedEntity,i=e.clock.currentTime,n=y.getValueOrUndefined(t.position,i);if(r(n)){var o=e.scene,a=e._dataSourceDisplay.getBoundingSphere(t,!1,$);if(a!==p.PENDING){var s=o.mode;(s===C.COLUMBUS_VIEW||s===C.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(s===C.COLUMBUS_VIEW||s===C.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);var l=a!==p.FAILED?$:void 0;e._entityView=new _(t,o,o.mapProjection.ellipsoid,l),e._entityView.update(i),e._needTrackedEntityUpdate=!1}}}}var $=new e,ee=new t;return o(Y.prototype,{container:{get:function(){return this._container}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},canvas:{get:function(){return this._cesiumWidget.canvas}},cesiumLogo:{get:function(){return this._cesiumWidget.cesiumLogo}},scene:{get:function(){return this._cesiumWidget.scene; -}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},clock:{get:function(){return this._cesiumWidget.clock}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e,this._forceResize=!0}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,K(this);var t=this.scene,i=t.mode;if(!r(e)||!r(e.position))return this._needTrackedEntityUpdate=!1,(i===C.COLUMBUS_VIEW||i===C.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(i===C.COLUMBUS_VIEW||i===C.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,void this.camera.lookAtTransform(h.IDENTITY);this._needTrackedEntityUpdate=!0}}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;var t=r(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;r(e)?r(t)&&t.animateAppear():r(t)&&t.animateDepart()}}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,W(this._timeline,this.clock,e))}}}),Y.prototype.extend=function(e,t){e(this,t)},Y.prototype.resize=function(){var e=this._cesiumWidget,t=this._container,i=t.clientWidth,n=t.clientHeight,o=r(this._animation),a=r(this._timeline);if(this._forceResize||i!==this._lastWidth||n!==this._lastHeight){e.resize(),this._forceResize=!1;var s=n-125,l=this._baseLayerPickerDropDown;r(l)&&(l.style.maxHeight=s+"px"),r(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);var u,c=this._timeline,h=0,d=0,p=0;if(o&&"hidden"!==window.getComputedStyle(this._animation.container).visibility){var m=this._lastWidth;u=this._animation.container,i>900?(h=169,900>=m&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):i>=600?(h=136,(600>m||m>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(h=106,(m>600||0===m)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),d=h+5}if(a&&"hidden"!==window.getComputedStyle(this._timeline.container).visibility){var f=this._fullscreenButton,v=this._vrButton,g=c.container,_=g.style;p=g.clientHeight+3,_.left=h+"px";var y=0;r(f)&&(y+=f.container.clientWidth),r(v)&&(y+=v.container.clientWidth),_.right=y+"px",c.resize()}this._bottomContainer.style.left=d+"px",this._bottomContainer.style.bottom=p+"px",this._lastWidth=i,this._lastHeight=n}},Y.prototype.forceResize=function(){this._lastWidth=0,this.resize()},Y.prototype.render=function(){this._cesiumWidget.render()},Y.prototype.isDestroyed=function(){return!1},Y.prototype.destroy=function(){var e;this.screenSpaceEventHandler.removeInputAction(d.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(d.LEFT_DOUBLE_CLICK);var t=this.dataSources,i=t.length;for(e=0;i>e;e++)this._dataSourceRemoved(t,t.get(e));return this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),r(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),r(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),r(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),r(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),r(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),r(this._timeline)&&(this._timeline.removeEventListener("settime",U,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),r(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),r(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),r(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),r(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._clockViewModel=this._clockViewModel.destroy(),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),a(this)},Y.prototype._dataSourceAdded=function(e,t){var i=t.entities;i.collectionChanged.addEventListener(Y.prototype._onEntityCollectionChanged,this)},Y.prototype._dataSourceRemoved=function(e,t){var i=t.entities;i.collectionChanged.removeEventListener(Y.prototype._onEntityCollectionChanged,this),r(this.trackedEntity)&&i.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),r(this.selectedEntity)&&i.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)},Y.prototype._onTick=function(e){var n=e.currentTime,o=this._dataSourceDisplay.update(n);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=o);var a=this._entityView;r(a)&&a.update(n);var s,l=!1,u=this.selectedEntity,c=r(u)&&this._enableInfoOrSelection;if(c&&u.isShowing&&u.isAvailable(n)){var h=this._dataSourceDisplay.getBoundingSphere(u,!0,$);h!==p.FAILED?s=$.center:r(u.position)&&(s=u.position.getValue(n,s)),l=r(s)}var d=r(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;r(d)&&(d.position=t.clone(s,d.position),d.showSelection=c&&l,d.update());var m=r(this._infoBox)?this._infoBox.viewModel:void 0;r(m)&&(m.showInfo=c,m.enableCamera=l,m.isCameraTracking=this.trackedEntity===this.selectedEntity,c?(m.titleText=i(u.name,u.id),m.description=y.getValueOrDefault(u.description,n,"")):(m.titleText="",m.description=""))},Y.prototype._onEntityCollectionChanged=function(e,t,i){for(var r=i.length,n=0;r>n;n++){var o=i[n];this.trackedEntity===o&&(this.trackedEntity=void 0),this.selectedEntity===o&&(this.selectedEntity=void 0)}},Y.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{var t=this.selectedEntity,i=t.position;r(i)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}},Y.prototype._clearTrackedObject=function(){this.trackedEntity=void 0},Y.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0},Y.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0},Y.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&W(this.timeline,this.clock,e)},Y.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);var i=t.entities.id,r=this._eventHelper.add(t.changedEvent,Y.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[i]=r},Y.prototype._onDataSourceRemoved=function(e,t){var i=this.clockTrackedDataSource===t,r=t.entities.id;if(this._dataSourceChangedListeners[r](),this._dataSourceChangedListeners[r]=void 0,i){var n=e.length;this._automaticallyTrackDataSourceClocks&&n>0?this.clockTrackedDataSource=e.get(n-1):this.clockTrackedDataSource=void 0}},Y.prototype.zoomTo=function(e,t){return X(this,e,t,!1)},Y.prototype.flyTo=function(e,t){return X(this,e,t,!0)},Y.prototype._postRender=function(){Q(this),J(this)},Y}),i("Widgets/Viewer/viewerCesiumInspectorMixin",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../CesiumInspector/CesiumInspector"],function(e,t,i,r){"use strict";function n(n){if(!e(n))throw new i("viewer is required.");var o=document.createElement("div");o.className="cesium-viewer-cesiumInspectorContainer",n.container.appendChild(o);var a=new r(o,n.scene);t(n,{cesiumInspector:{get:function(){return a}}}),n.scene.postRender.addEventListener(function(){n.cesiumInspector.viewModel.update()})}return n}),i("Widgets/Viewer/viewerDragDropMixin",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Event","../../Core/wrapFunction","../../DataSources/CzmlDataSource","../../DataSources/GeoJsonDataSource","../../DataSources/KmlDataSource","../getElement"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t,r){function a(e){h(e),v&&(t.entities.removeAll(),t.dataSources.removeAll());for(var i=e.dataTransfer.files,r=i.length,n=0;r>n;n++){var o=i[n],a=new FileReader;a.onload=m(t,o,_),a.onerror=f(t,o),a.readAsText(o)}}r=e(r,e.EMPTY_OBJECT);var s=!0,l=!0,c=new n,v=e(r.clearOnDrop,!0),g=e(r.dropTarget,t.container),_=r.proxy;g=u(g),i(t,{dropTarget:{get:function(){return g},set:function(e){d(g,a),g=e,p(g,a)}},dropEnabled:{get:function(){return s},set:function(e){e!==s&&(e?p(g,a):d(g,a),s=e)}},dropError:{get:function(){return c}},clearOnDrop:{get:function(){return v},set:function(e){v=e}},flyToOnDrop:{get:function(){return l},set:function(e){l=e}},proxy:{get:function(){return _},set:function(e){_=e}}}),p(g,a),t.destroy=o(t,t.destroy,function(){t.dropEnabled=!1}),t._handleDrop=a}function h(e){e.stopPropagation(),e.preventDefault()}function d(e,i){var r=e;t(r)&&(r.removeEventListener("drop",i,!1),r.removeEventListener("dragenter",h,!1),r.removeEventListener("dragover",h,!1),r.removeEventListener("dragexit",h,!1))}function p(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",h,!1),e.addEventListener("dragover",h,!1),e.addEventListener("dragexit",h,!1)}function m(e,i,r){return function(n){var o=i.name;try{var u;if(/\.czml$/i.test(o))u=a.load(JSON.parse(n.target.result),{sourceUri:o});else if(/\.geojson$/i.test(o)||/\.json$/i.test(o)||/\.topojson$/i.test(o))u=s.load(JSON.parse(n.target.result),{sourceUri:o});else{if(!/\.(kml|kmz)$/i.test(o))return void e.dropError.raiseEvent(e,o,"Unrecognized file: "+o);u=l.load(i,{sourceUri:o,proxy:r})}t(u)&&e.dataSources.add(u).then(function(t){e.flyToOnDrop&&e.flyTo(t)}).otherwise(function(t){e.dropError.raiseEvent(e,o,t)})}catch(c){e.dropError.raiseEvent(e,o,c)}}}function f(e,t){return function(i){e.dropError.raiseEvent(e,t.name,i.target.error)}}return c}),i("Widgets/Viewer/viewerEntityMixin",["../../Core/Cartesian3","../../Core/defaultValue","../../Core/defined","../../Core/DeveloperError","../../Core/EventHelper","../../Core/Event","../../Core/ScreenSpaceEventType","../../Core/wrapFunction","../../DataSources/ConstantPositionProperty","../../DataSources/Entity","../../DataSources/EntityView","../../Scene/SceneMode","../../ThirdParty/knockout","../../ThirdParty/when","../subscribeAndEvaluate"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e,t){var r=e.scene,n=r.camera.getPickRay(t),o=r.imageryLayers.pickImageryLayerFeatures(n,r);if(i(o)){var a=new u("Loading...");return a.description={getValue:function(){return"Loading feature information..."}},p(o,function(t){if(e.selectedEntity===a){if(!i(t)||0===t.length)return void(e.selectedEntity=v());var r=t[0],n=new u(r.name);if(n.description={getValue:function(){return r.description}},i(r.position)){var o=e.scene.globe.ellipsoid.cartographicToCartesian(r.position,_);n.position=new l(o)}e.selectedEntity=n}},function(){if(e.selectedEntity===a){var t=new u("None");t.description={getValue:function(){return"No features found."}},e.selectedEntity=v()}}),a}}function v(){var e=new u("None");return e.description={getValue:function(){return"No features found."}},e}var g=function(e){function r(){e.trackedEntity=e.selectedEntity}function l(){e.trackedEntity=void 0}function p(){e.selectedEntity=void 0}function v(){e.trackedEntity=void 0,e.selectedEntity=void 0}function g(r){var n=r.currentTime;i(x)&&x.update(n);var o=e.selectedEntity,a=i(o)&&M;if(a){var s,l=i(I)?I.position:void 0,u=!1;o.isAvailable(n)&&i(o.position)&&(s=o.position.getValue(n,l),u=i(s)&&e.trackedEntity!==e.selectedEntity),i(I)&&(I.position=s),i(A)&&(A.enableCamera=u,A.isCameraTracking=e.trackedEntity===e.selectedEntity,i(o.description)?A.descriptionRawHtml=t(o.description.getValue(n),""):A.descriptionRawHtml="")}i(I)&&(I.showSelection=a,I.update()),i(A)&&(A.showInfo=a)}function _(r){var n=e.scene.pick(r.position);if(i(n)){var o=t(n.id,n.primitive.id);if(o instanceof u)return o}return f(e,r.position)}function y(t){i(t)&&i(t.position)&&(e.trackedEntity=t)}function C(e){var t=_(e);i(t)&&y(t)}function E(t){var i=e.selectedEntity;e.selectedEntity=_(t),e.eventSelector.raiseEvent(e.selectedEntity,i)}function S(t,i,r){for(var n=r.length,o=0;n>o;o++){var a=r[o];e.trackedEntity===a&&e.homeButton.viewModel.command(),e.selectedEntity===a&&(e.selectedEntity=void 0)}}function w(e,t){var i=t.entities;i.collectionChanged.addEventListener(S)}function T(t,r){var n=r.entities;n.collectionChanged.removeEventListener(S),i(e.trackedEntity)&&n.getById(e.trackedEntity.id)===e.trackedEntity&&e.homeButton.viewModel.command(),i(e.selectedEntity)&&n.getById(e.selectedEntity.id)===e.selectedEntity&&(e.selectedEntity=void 0)}var x,b=e.infoBox,A=i(b)?b.viewModel:void 0,P=e.selectionIndicator,I=i(P)?P.viewModel:void 0,M=i(b)||i(P),D=new n,R=new o;e.eventSelector=R,i(A)&&(D.add(A.cameraClicked,r),D.add(A.closeClicked,p)),D.add(e.clock.onTick,g),i(e.homeButton)&&D.add(e.homeButton.viewModel.command.beforeExecute,l),i(e.geocoder)&&D.add(e.geocoder.viewModel.search.beforeExecute,v);for(var O=e.dataSources,N=O.length,L=0;N>L;L++)w(O,O.get(L));D.add(e.dataSources.dataSourceAdded,w),D.add(e.dataSources.dataSourceRemoved,T),e.screenSpaceEventHandler.setInputAction(E,a.LEFT_CLICK),e.screenSpaceEventHandler.setInputAction(C,a.LEFT_DOUBLE_CLICK),e.trackedEntity=void 0,e.selectedEntity=void 0,d.track(e,["trackedEntity","selectedEntity"]);var F=[];F.push(m(e,"trackedEntity",function(t){var r=e.scene,n=r.mode,o=i(t);(n===h.COLUMBUS_VIEW||n===h.SCENE2D)&&(r.screenSpaceCameraController.enableTranslate=!o),(n===h.COLUMBUS_VIEW||n===h.SCENE3D)&&(r.screenSpaceCameraController.enableTilt=!o),x=o&&i(t.position)?new c(t,r,e.scene.globe.ellipsoid):void 0})),F.push(m(e,"selectedEntity",function(e){i(e)?(i(A)&&(A.titleText=i(e.name)?e.name:e.id),i(I)&&I.animateAppear()):i(I)&&I.animateDepart()})),e.destroy=s(e,e.destroy,function(){D.removeAll();var t;for(t=0;t<F.length;t++)F[t].dispose();e.screenSpaceEventHandler.removeInputAction(a.LEFT_CLICK),e.screenSpaceEventHandler.removeInputAction(a.LEFT_DOUBLE_CLICK);var i=e.dataSources,r=i.length;for(t=0;r>t;t++)T(i,i.get(t))})},_=new e;return g}),i("Widgets/Viewer/viewerPerformanceWatchdogMixin",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../PerformanceWatchdog/PerformanceWatchdog"],function(e,t,i,r,n){"use strict";function o(o,a){if(!t(o))throw new r("viewer is required.");a=e(a,e.EMPTY_OBJECT);var s=new n({scene:o.scene,container:o.bottomContainer,lowFrameRateMessage:a.lowFrameRateMessage});i(o,{performanceWatchdog:{get:function(){return s}}})}return o}),i("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,i){"use strict";function r(r){var n,o=[],a={id:void 0,result:void 0,error:void 0};return function(s){var l=s.data;o.length=0,a.id=l.id,a.error=void 0,a.result=void 0;try{a.result=r(l.parameters,o)}catch(u){u instanceof Error?a.error={name:u.name,message:u.message,stack:u.stack}:a.error=u}t(n)||(n=e(self.webkitPostMessage,self.postMessage)),l.canTransferArrayBuffer||(o.length=0);try{n(a,o)}catch(u){a.result=void 0,a.error="postMessage failed with error: "+i(u)+"\n with responseMessage: "+JSON.stringify(a),n(a)}}}return r}),i("Cesium",["./Core/appendForwardSlash","./Core/ArcGisImageServerTerrainProvider","./Core/AssociativeArray","./Core/AttributeCompression","./Core/AxisAlignedBoundingBox","./Core/barycentricCoordinates","./Core/binarySearch","./Core/BingMapsApi","./Core/BoundingRectangle","./Core/BoundingSphere","./Core/BoxGeometry","./Core/BoxOutlineGeometry","./Core/buildModuleUrl","./Core/cancelAnimationFrame","./Core/Cartesian2","./Core/Cartesian3","./Core/Cartesian4","./Core/Cartographic","./Core/CatmullRomSpline","./Core/CesiumTerrainProvider","./Core/CircleGeometry","./Core/CircleOutlineGeometry","./Core/Clock","./Core/ClockRange","./Core/ClockStep","./Core/clone","./Core/Color","./Core/ColorGeometryInstanceAttribute","./Core/combine","./Core/ComponentDatatype","./Core/CornerType","./Core/CorridorGeometry","./Core/CorridorGeometryLibrary","./Core/CorridorOutlineGeometry","./Core/createGuid","./Core/Credit","./Core/CubicRealPolynomial","./Core/CylinderGeometry","./Core/CylinderGeometryLibrary","./Core/CylinderOutlineGeometry","./Core/DefaultProxy","./Core/defaultValue","./Core/defined","./Core/definedNotNull","./Core/defineProperties","./Core/deprecationWarning","./Core/destroyObject","./Core/DeveloperError","./Core/EarthOrientationParameters","./Core/EarthOrientationParametersSample","./Core/EasingFunction","./Core/EllipseGeometry","./Core/EllipseGeometryLibrary","./Core/EllipseOutlineGeometry","./Core/Ellipsoid","./Core/EllipsoidalOccluder","./Core/EllipsoidGeodesic","./Core/EllipsoidGeometry","./Core/EllipsoidOutlineGeometry","./Core/EllipsoidTangentPlane","./Core/EllipsoidTerrainProvider","./Core/EncodedCartesian3","./Core/Event","./Core/EventHelper","./Core/ExtrapolationType","./Core/FeatureDetection","./Core/formatError","./Core/freezeObject","./Core/Fullscreen","./Core/GeographicProjection","./Core/GeographicTilingScheme","./Core/Geometry","./Core/GeometryAttribute","./Core/GeometryAttributes","./Core/GeometryInstance","./Core/GeometryInstanceAttribute","./Core/GeometryPipeline","./Core/GeometryType","./Core/getAbsoluteUri","./Core/getBaseUri","./Core/getExtensionFromUri","./Core/getFilenameFromUri","./Core/getImagePixels","./Core/getMagic","./Core/getStringFromTypedArray","./Core/getTimestamp","./Core/GregorianDate","./Core/HeadingPitchRange","./Core/HeightmapTerrainData","./Core/HeightmapTessellator","./Core/HermitePolynomialApproximation","./Core/HermiteSpline","./Core/Iau2000Orientation","./Core/Iau2006XysData","./Core/Iau2006XysSample","./Core/IauOrientationAxes","./Core/IauOrientationParameters","./Core/IndexDatatype","./Core/InterpolationAlgorithm","./Core/Intersect","./Core/Intersections2D","./Core/IntersectionTests","./Core/Interval","./Core/isArray","./Core/isCrossOriginUrl","./Core/isLeapYear","./Core/Iso8601","./Core/joinUrls","./Core/JulianDate","./Core/KeyboardEventModifier","./Core/LagrangePolynomialApproximation","./Core/LeapSecond","./Core/LinearApproximation","./Core/LinearSpline","./Core/loadArrayBuffer","./Core/loadBlob","./Core/loadImage","./Core/loadImageFromTypedArray","./Core/loadImageViaBlob","./Core/loadJson","./Core/loadJsonp","./Core/loadText","./Core/loadWithXhr","./Core/loadXML","./Core/MapboxApi","./Core/MapProjection","./Core/Math","./Core/Matrix2","./Core/Matrix3","./Core/Matrix4","./Core/mergeSort","./Core/NearFarScalar","./Core/objectToQuery","./Core/Occluder","./Core/OrientedBoundingBox","./Core/Packable","./Core/PackableForInterpolation","./Core/parseResponseHeaders","./Core/PinBuilder","./Core/PixelFormat","./Core/Plane","./Core/PointGeometry","./Core/pointInsideTriangle","./Core/PolygonGeometry","./Core/PolygonGeometryLibrary","./Core/PolygonHierarchy","./Core/PolygonOutlineGeometry","./Core/PolygonPipeline","./Core/PolylineGeometry","./Core/PolylinePipeline","./Core/PolylineVolumeGeometry","./Core/PolylineVolumeGeometryLibrary","./Core/PolylineVolumeOutlineGeometry","./Core/PrimitiveType","./Core/QuadraticRealPolynomial","./Core/QuantizedMeshTerrainData","./Core/QuarticRealPolynomial","./Core/Quaternion","./Core/QuaternionSpline","./Core/queryToObject","./Core/Queue","./Core/Ray","./Core/Rectangle","./Core/RectangleGeometry","./Core/RectangleGeometryLibrary","./Core/RectangleOutlineGeometry","./Core/ReferenceFrame","./Core/requestAnimationFrame","./Core/RequestErrorEvent","./Core/RuntimeError","./Core/sampleTerrain","./Core/scaleToGeodeticSurface","./Core/ScreenSpaceEventHandler","./Core/ScreenSpaceEventType","./Core/ShowGeometryInstanceAttribute","./Core/Simon1994PlanetaryPositions","./Core/SimplePolylineGeometry","./Core/SphereGeometry","./Core/SphereOutlineGeometry","./Core/Spherical","./Core/Spline","./Core/subdivideArray","./Core/TaskProcessor","./Core/TerrainData","./Core/TerrainEncoding","./Core/TerrainMesh","./Core/TerrainProvider","./Core/TerrainQuantization","./Core/throttleRequestByServer","./Core/TileProviderError","./Core/TilingScheme","./Core/TimeConstants","./Core/TimeInterval","./Core/TimeIntervalCollection","./Core/TimeStandard","./Core/Tipsify","./Core/Transforms","./Core/TranslationRotationScale","./Core/TridiagonalSystemSolver","./Core/VertexFormat","./Core/VideoSynchronizer","./Core/Visibility","./Core/VRTheWorldTerrainProvider","./Core/WallGeometry","./Core/WallGeometryLibrary","./Core/WallOutlineGeometry","./Core/WebMercatorProjection","./Core/WebMercatorTilingScheme","./Core/WindingOrder","./Core/wrapFunction","./Core/writeTextToCanvas","./DataSources/BillboardGraphics","./DataSources/BillboardVisualizer","./DataSources/BoundingSphereState","./DataSources/BoxGeometryUpdater","./DataSources/BoxGraphics","./DataSources/CallbackProperty","./DataSources/CheckerboardMaterialProperty","./DataSources/ColorMaterialProperty","./DataSources/CompositeEntityCollection","./DataSources/CompositeMaterialProperty","./DataSources/CompositePositionProperty","./DataSources/CompositeProperty","./DataSources/ConstantPositionProperty","./DataSources/ConstantProperty","./DataSources/CorridorGeometryUpdater","./DataSources/CorridorGraphics","./DataSources/createMaterialPropertyDescriptor","./DataSources/createPropertyDescriptor","./DataSources/createRawPropertyDescriptor","./DataSources/CustomDataSource","./DataSources/CylinderGeometryUpdater","./DataSources/CylinderGraphics","./DataSources/CzmlDataSource","./DataSources/DataSource","./DataSources/DataSourceClock","./DataSources/DataSourceCollection","./DataSources/DataSourceDisplay","./DataSources/dynamicGeometryGetBoundingSphere","./DataSources/DynamicGeometryUpdater","./DataSources/EllipseGeometryUpdater","./DataSources/EllipseGraphics","./DataSources/EllipsoidGeometryUpdater","./DataSources/EllipsoidGraphics","./DataSources/Entity","./DataSources/EntityCollection","./DataSources/EntityView","./DataSources/GeoJsonDataSource","./DataSources/GeometryUpdater","./DataSources/GeometryVisualizer","./DataSources/GridMaterialProperty","./DataSources/ImageMaterialProperty","./DataSources/KmlDataSource","./DataSources/LabelGraphics","./DataSources/LabelVisualizer","./DataSources/MaterialProperty","./DataSources/ModelGraphics","./DataSources/ModelVisualizer","./DataSources/NodeTransformationProperty","./DataSources/PathGraphics","./DataSources/PathVisualizer","./DataSources/PointGraphics","./DataSources/PointVisualizer","./DataSources/PolygonGeometryUpdater","./DataSources/PolygonGraphics","./DataSources/PolylineArrowMaterialProperty","./DataSources/PolylineGeometryUpdater","./DataSources/PolylineGlowMaterialProperty","./DataSources/PolylineGraphics","./DataSources/PolylineOutlineMaterialProperty","./DataSources/PolylineVolumeGeometryUpdater","./DataSources/PolylineVolumeGraphics","./DataSources/PositionProperty","./DataSources/PositionPropertyArray","./DataSources/Property","./DataSources/PropertyArray","./DataSources/PropertyBag","./DataSources/RectangleGeometryUpdater","./DataSources/RectangleGraphics","./DataSources/ReferenceProperty","./DataSources/Rotation","./DataSources/SampledPositionProperty","./DataSources/SampledProperty","./DataSources/ScaledPositionProperty","./DataSources/StaticGeometryColorBatch","./DataSources/StaticGeometryPerMaterialBatch","./DataSources/StaticOutlineGeometryBatch","./DataSources/StripeMaterialProperty","./DataSources/StripeOrientation","./DataSources/TimeIntervalCollectionPositionProperty","./DataSources/TimeIntervalCollectionProperty","./DataSources/VelocityOrientationProperty","./DataSources/Visualizer","./DataSources/WallGeometryUpdater","./DataSources/WallGraphics","./Renderer/AutomaticUniforms","./Renderer/Buffer","./Renderer/BufferUsage","./Renderer/ClearCommand","./Renderer/ComputeCommand","./Renderer/ComputeEngine","./Renderer/Context","./Renderer/ContextLimits","./Renderer/createUniform","./Renderer/createUniformArray","./Renderer/CubeMap","./Renderer/CubeMapFace","./Renderer/DrawCommand","./Renderer/Framebuffer","./Renderer/loadCubeMap","./Renderer/MipmapHint","./Renderer/PassState","./Renderer/PickFramebuffer","./Renderer/PixelDatatype","./Renderer/Renderbuffer","./Renderer/RenderbufferFormat","./Renderer/RenderState","./Renderer/Sampler","./Renderer/ShaderCache","./Renderer/ShaderProgram","./Renderer/ShaderSource","./Renderer/Texture","./Renderer/TextureMagnificationFilter","./Renderer/TextureMinificationFilter","./Renderer/TextureWrap","./Renderer/UniformState","./Renderer/VertexArray","./Renderer/VertexArrayFacade","./Renderer/WebGLConstants","./Scene/Appearance","./Scene/ArcGisMapServerImageryProvider","./Scene/Billboard","./Scene/BillboardCollection","./Scene/BingMapsImageryProvider","./Scene/BingMapsStyle","./Scene/BlendEquation","./Scene/BlendFunction","./Scene/BlendingState","./Scene/Camera","./Scene/CameraEventAggregator","./Scene/CameraEventType","./Scene/CameraFlightPath","./Scene/createOpenStreetMapImageryProvider","./Scene/createTangentSpaceDebugPrimitive","./Scene/createTileMapServiceImageryProvider","./Scene/CreditDisplay","./Scene/CullFace","./Scene/CullingVolume","./Scene/DebugAppearance","./Scene/DebugModelMatrixPrimitive","./Scene/DepthFunction","./Scene/DepthPlane","./Scene/DeviceOrientationCameraController","./Scene/DiscardMissingTileImagePolicy","./Scene/EllipsoidPrimitive","./Scene/EllipsoidSurfaceAppearance","./Scene/Fog","./Scene/FrameRateMonitor","./Scene/FrameState","./Scene/FrustumCommands","./Scene/FXAA","./Scene/GetFeatureInfoFormat","./Scene/getModelAccessor","./Scene/Globe","./Scene/GlobeDepth","./Scene/GlobeSurfaceShaderSet","./Scene/GlobeSurfaceTile","./Scene/GlobeSurfaceTileProvider","./Scene/GoogleEarthImageryProvider","./Scene/GridImageryProvider","./Scene/GroundPrimitive","./Scene/HeightReference","./Scene/HorizontalOrigin","./Scene/Imagery","./Scene/ImageryLayer","./Scene/ImageryLayerCollection","./Scene/ImageryLayerFeatureInfo","./Scene/ImageryProvider","./Scene/ImageryState","./Scene/Label","./Scene/LabelCollection","./Scene/LabelStyle","./Scene/MapboxImageryProvider","./Scene/Material","./Scene/MaterialAppearance","./Scene/Model","./Scene/ModelAnimation","./Scene/ModelAnimationCache","./Scene/ModelAnimationCollection","./Scene/ModelAnimationLoop","./Scene/ModelAnimationState","./Scene/ModelMaterial","./Scene/modelMaterialsCommon","./Scene/ModelMesh","./Scene/ModelNode","./Scene/Moon","./Scene/NeverTileDiscardPolicy","./Scene/OIT","./Scene/OpenStreetMapImageryProvider","./Scene/OrthographicFrustum","./Scene/Pass","./Scene/PerformanceDisplay","./Scene/PerInstanceColorAppearance","./Scene/PerspectiveFrustum","./Scene/PerspectiveOffCenterFrustum","./Scene/PickDepth","./Scene/PointAppearance","./Scene/PointPrimitive","./Scene/PointPrimitiveCollection","./Scene/Polyline","./Scene/PolylineCollection","./Scene/PolylineColorAppearance","./Scene/PolylineMaterialAppearance","./Scene/Primitive","./Scene/PrimitiveCollection","./Scene/PrimitivePipeline","./Scene/PrimitiveState","./Scene/QuadtreeOccluders","./Scene/QuadtreePrimitive","./Scene/QuadtreeTile","./Scene/QuadtreeTileLoadState","./Scene/QuadtreeTileProvider","./Scene/Scene","./Scene/SceneMode","./Scene/SceneTransforms","./Scene/SceneTransitioner","./Scene/ScreenSpaceCameraController","./Scene/SingleTileImageryProvider","./Scene/SkyAtmosphere","./Scene/SkyBox","./Scene/StencilFunction","./Scene/StencilOperation","./Scene/Sun","./Scene/SunPostProcess","./Scene/TerrainState","./Scene/TextureAtlas","./Scene/TileBoundingBox","./Scene/TileCoordinatesImageryProvider","./Scene/TileDiscardPolicy","./Scene/TileImagery","./Scene/TileMapServiceImageryProvider","./Scene/TileReplacementQueue","./Scene/TileState","./Scene/TileTerrain","./Scene/TweenCollection","./Scene/UrlTemplateImageryProvider","./Scene/VerticalOrigin","./Scene/ViewportQuad","./Scene/WebMapServiceImageryProvider","./Scene/WebMapTileServiceImageryProvider","./Shaders/AdjustTranslucentFS","./Shaders/Appearances/AllMaterialAppearanceFS","./Shaders/Appearances/AllMaterialAppearanceVS","./Shaders/Appearances/BasicMaterialAppearanceFS","./Shaders/Appearances/BasicMaterialAppearanceVS","./Shaders/Appearances/EllipsoidSurfaceAppearanceFS","./Shaders/Appearances/EllipsoidSurfaceAppearanceVS","./Shaders/Appearances/PerInstanceColorAppearanceFS","./Shaders/Appearances/PerInstanceColorAppearanceVS","./Shaders/Appearances/PerInstanceFlatColorAppearanceFS","./Shaders/Appearances/PerInstanceFlatColorAppearanceVS","./Shaders/Appearances/PointAppearanceFS","./Shaders/Appearances/PointAppearanceVS","./Shaders/Appearances/PolylineColorAppearanceVS","./Shaders/Appearances/PolylineMaterialAppearanceVS","./Shaders/Appearances/TexturedMaterialAppearanceFS","./Shaders/Appearances/TexturedMaterialAppearanceVS","./Shaders/BillboardCollectionFS","./Shaders/BillboardCollectionVS","./Shaders/Builtin/Constants/degreesPerRadian","./Shaders/Builtin/Constants/depthRange","./Shaders/Builtin/Constants/epsilon1","./Shaders/Builtin/Constants/epsilon2","./Shaders/Builtin/Constants/epsilon3","./Shaders/Builtin/Constants/epsilon4","./Shaders/Builtin/Constants/epsilon5","./Shaders/Builtin/Constants/epsilon6","./Shaders/Builtin/Constants/epsilon7","./Shaders/Builtin/Constants/infinity","./Shaders/Builtin/Constants/oneOverPi","./Shaders/Builtin/Constants/oneOverTwoPi","./Shaders/Builtin/Constants/pi","./Shaders/Builtin/Constants/piOverFour","./Shaders/Builtin/Constants/piOverSix","./Shaders/Builtin/Constants/piOverThree","./Shaders/Builtin/Constants/piOverTwo","./Shaders/Builtin/Constants/radiansPerDegree","./Shaders/Builtin/Constants/sceneMode2D","./Shaders/Builtin/Constants/sceneMode3D","./Shaders/Builtin/Constants/sceneModeColumbusView","./Shaders/Builtin/Constants/sceneModeMorphing","./Shaders/Builtin/Constants/solarRadius","./Shaders/Builtin/Constants/threePiOver2","./Shaders/Builtin/Constants/twoPi","./Shaders/Builtin/Constants/webMercatorMaxLatitude","./Shaders/Builtin/CzmBuiltins","./Shaders/Builtin/Functions/alphaWeight","./Shaders/Builtin/Functions/antialias","./Shaders/Builtin/Functions/columbusViewMorph","./Shaders/Builtin/Functions/computePosition","./Shaders/Builtin/Functions/cosineAndSine","./Shaders/Builtin/Functions/decompressTextureCoordinates","./Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates","./Shaders/Builtin/Functions/ellipsoidContainsPoint","./Shaders/Builtin/Functions/ellipsoidNew","./Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates","./Shaders/Builtin/Functions/equalsEpsilon","./Shaders/Builtin/Functions/eyeOffset","./Shaders/Builtin/Functions/eyeToWindowCoordinates","./Shaders/Builtin/Functions/fog","./Shaders/Builtin/Functions/geodeticSurfaceNormal","./Shaders/Builtin/Functions/getDefaultMaterial","./Shaders/Builtin/Functions/getLambertDiffuse","./Shaders/Builtin/Functions/getSpecular","./Shaders/Builtin/Functions/getWaterNoise","./Shaders/Builtin/Functions/getWgs84EllipsoidEC","./Shaders/Builtin/Functions/hue","./Shaders/Builtin/Functions/isEmpty","./Shaders/Builtin/Functions/isFull","./Shaders/Builtin/Functions/latitudeToWebMercatorFraction","./Shaders/Builtin/Functions/luminance","./Shaders/Builtin/Functions/metersPerPixel","./Shaders/Builtin/Functions/modelToWindowCoordinates","./Shaders/Builtin/Functions/multiplyWithColorBalance","./Shaders/Builtin/Functions/nearFarScalar","./Shaders/Builtin/Functions/octDecode","./Shaders/Builtin/Functions/packDepth","./Shaders/Builtin/Functions/phong","./Shaders/Builtin/Functions/pointAlongRay","./Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval","./Shaders/Builtin/Functions/RGBToXYZ","./Shaders/Builtin/Functions/saturation","./Shaders/Builtin/Functions/signNotZero","./Shaders/Builtin/Functions/tangentToEyeSpaceMatrix","./Shaders/Builtin/Functions/translateRelativeToEye","./Shaders/Builtin/Functions/translucentPhong","./Shaders/Builtin/Functions/transpose","./Shaders/Builtin/Functions/unpackDepth","./Shaders/Builtin/Functions/windowToEyeCoordinates","./Shaders/Builtin/Functions/XYZToRGB","./Shaders/Builtin/Structs/depthRangeStruct","./Shaders/Builtin/Structs/ellipsoid","./Shaders/Builtin/Structs/material","./Shaders/Builtin/Structs/materialInput","./Shaders/Builtin/Structs/ray","./Shaders/Builtin/Structs/raySegment","./Shaders/CompositeOITFS","./Shaders/DepthPlaneFS","./Shaders/DepthPlaneVS","./Shaders/EllipsoidFS","./Shaders/EllipsoidVS","./Shaders/GlobeFS","./Shaders/GlobeVS","./Shaders/GroundAtmosphere","./Shaders/Materials/BumpMapMaterial","./Shaders/Materials/CheckerboardMaterial","./Shaders/Materials/DotMaterial","./Shaders/Materials/FadeMaterial","./Shaders/Materials/GridMaterial","./Shaders/Materials/NormalMapMaterial","./Shaders/Materials/PolylineArrowMaterial","./Shaders/Materials/PolylineGlowMaterial","./Shaders/Materials/PolylineOutlineMaterial","./Shaders/Materials/RimLightingMaterial","./Shaders/Materials/StripeMaterial","./Shaders/Materials/Water","./Shaders/PointPrimitiveCollectionFS","./Shaders/PointPrimitiveCollectionVS","./Shaders/PolylineCommon","./Shaders/PolylineFS","./Shaders/PolylineVS","./Shaders/PostProcessFilters/AdditiveBlend","./Shaders/PostProcessFilters/BrightPass","./Shaders/PostProcessFilters/FXAA","./Shaders/PostProcessFilters/GaussianBlur1D","./Shaders/PostProcessFilters/PassThrough","./Shaders/ReprojectWebMercatorFS","./Shaders/ReprojectWebMercatorVS","./Shaders/ShadowVolumeFS","./Shaders/ShadowVolumeVS","./Shaders/SkyAtmosphereFS","./Shaders/SkyAtmosphereVS","./Shaders/SkyBoxFS","./Shaders/SkyBoxVS","./Shaders/SunFS","./Shaders/SunTextureFS","./Shaders/SunVS","./Shaders/ViewportQuadFS","./Shaders/ViewportQuadVS","./ThirdParty/Autolinker","./ThirdParty/gltfDefaults","./ThirdParty/knockout-3.2.0","./ThirdParty/knockout-es5","./ThirdParty/knockout","./ThirdParty/measureText","./ThirdParty/mersenne-twister","./ThirdParty/NoSleep","./ThirdParty/sprintf","./ThirdParty/topojson","./ThirdParty/Tween","./ThirdParty/Uri","./ThirdParty/when","./ThirdParty/zip","./Widgets/Animation/Animation","./Widgets/Animation/AnimationViewModel","./Widgets/BaseLayerPicker/BaseLayerPicker","./Widgets/BaseLayerPicker/BaseLayerPickerViewModel","./Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels","./Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels","./Widgets/BaseLayerPicker/ProviderViewModel","./Widgets/CesiumInspector/CesiumInspector","./Widgets/CesiumInspector/CesiumInspectorViewModel","./Widgets/CesiumWidget/CesiumWidget","./Widgets/ClockViewModel","./Widgets/Command","./Widgets/createCommand","./Widgets/FullscreenButton/FullscreenButton","./Widgets/FullscreenButton/FullscreenButtonViewModel","./Widgets/Geocoder/Geocoder","./Widgets/Geocoder/GeocoderViewModel","./Widgets/getElement","./Widgets/HomeButton/HomeButton","./Widgets/HomeButton/HomeButtonViewModel","./Widgets/InfoBox/InfoBox","./Widgets/InfoBox/InfoBoxViewModel","./Widgets/NavigationHelpButton/NavigationHelpButton","./Widgets/NavigationHelpButton/NavigationHelpButtonViewModel","./Widgets/PerformanceWatchdog/PerformanceWatchdog","./Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel","./Widgets/SceneModePicker/SceneModePicker","./Widgets/SceneModePicker/SceneModePickerViewModel","./Widgets/SelectionIndicator/SelectionIndicator","./Widgets/SelectionIndicator/SelectionIndicatorViewModel","./Widgets/subscribeAndEvaluate","./Widgets/SvgPathBindingHandler","./Widgets/Timeline/Timeline","./Widgets/Timeline/TimelineHighlightRange","./Widgets/Timeline/TimelineTrack","./Widgets/ToggleButtonViewModel","./Widgets/Viewer/Viewer","./Widgets/Viewer/viewerCesiumInspectorMixin","./Widgets/Viewer/viewerDragDropMixin","./Widgets/Viewer/viewerEntityMixin","./Widgets/Viewer/viewerPerformanceWatchdogMixin","./Widgets/VRButton/VRButton","./Widgets/VRButton/VRButtonViewModel","./Workers/createTaskProcessorWorker"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O,N,L,F,B,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,he,de,pe,me,fe,ve,ge,_e,ye,Ce,Ee,Se,we,Te,xe,be,Ae,Pe,Ie,Me,De,Re,Oe,Ne,Le,Fe,Be,Ve,ke,ze,Ue,Ge,We,He,qe,je,Ye,Xe,Ze,Ke,Qe,Je,$e,et,tt,it,rt,nt,ot,at,st,lt,ut,ct,ht,dt,pt,mt,ft,vt,gt,_t,yt,Ct,Et,St,wt,Tt,xt,bt,At,Pt,It,Mt,Dt,Rt,Ot,Nt,Lt,Ft,Bt,Vt,kt,zt,Ut,Gt,Wt,Ht,qt,jt,Yt,Xt,Zt,Kt,Qt,Jt,$t,ei,ti,ii,ri,ni,oi,ai,si,li,ui,ci,hi,di,pi,mi,fi,vi,gi,_i,yi,Ci,Ei,Si,wi,Ti,xi,bi,Ai,Pi,Ii,Mi,Di,Ri,Oi,Ni,Li,Fi,Bi,Vi,ki,zi,Ui,Gi,Wi,Hi,qi,ji,Yi,Xi,Zi,Ki,Qi,Ji,$i,er,tr,ir,rr,nr,or,ar,sr,lr,ur,cr,hr,dr,pr,mr,fr,vr,gr,_r,yr,Cr,Er,Sr,wr,Tr,xr,br,Ar,Pr,Ir,Mr,Dr,Rr,Or,Nr,Lr,Fr,Br,Vr,kr,zr,Ur,Gr,Wr,Hr,qr,jr,Yr,Xr,Zr,Kr,Qr,Jr,$r,en,tn,rn,nn,on,an,sn,ln,un,cn,hn,dn,pn,mn,fn,vn,gn,_n,yn,Cn,En,Sn,wn,Tn,xn,bn,An,Pn,In,Mn,Dn,Rn,On,Nn,Ln,Fn,Bn,Vn,kn,zn,Un,Gn,Wn,Hn,qn,jn,Yn,Xn,Zn,Kn,Qn,Jn,$n,eo,to,io,ro,no,oo,ao,so,lo,uo,co,ho,po,mo,fo,vo,go,_o,yo,Co,Eo,So,wo,To,xo,bo,Ao,Po,Io,Mo,Do,Ro,Oo,No,Lo,Fo,Bo,Vo,ko,zo,Uo,Go,Wo,Ho,qo,jo,Yo,Xo,Zo,Ko,Qo,Jo,$o,ea,ta,ia,ra,na,oa,aa,sa,la,ua,ca,ha,da,pa,ma,fa,va,ga,_a,ya,Ca,Ea,Sa,wa,Ta,xa,ba,Aa,Pa,Ia,Ma,Da,Ra,Oa,Na,La,Fa,Ba,Va,ka,za,Ua,Ga,Wa,Ha,qa,ja,Ya,Xa,Za,Ka,Qa,Ja,$a,es,ts,is,rs,ns,os,as,ss,ls,us,cs,hs,ds,ps,ms,fs,vs,gs,_s,ys,Cs,Es,Ss,ws,Ts,xs,bs,As,Ps,Is,Ms,Ds,Rs,Os,Ns,Ls,Fs,Bs,Vs,ks,zs,Us,Gs,Ws,Hs,qs,js,Ys,Xs,Zs,Ks,Qs,Js,$s,el,tl,il,rl,nl,ol,al,sl,ll,ul,cl,hl,dl,pl,ml,fl,vl,gl,_l,yl,Cl,El,Sl,wl,Tl,xl,bl,Al,Pl,Il,Ml,Dl,Rl,Ol,Nl,Ll,Fl,Bl,Vl,kl,zl,Ul,Gl,Wl,Hl,ql,jl,Yl,Xl,Zl,Kl,Ql,Jl,$l,eu,tu,iu,ru,nu,ou,au,su,lu,uu,cu,hu,du,pu,mu,fu,vu,gu,_u,yu,Cu,Eu,Su,wu,Tu,xu,bu,Au,Pu,Iu,Mu,Du,Ru,Ou,Nu,Lu,Fu,Bu,Vu,ku,zu,Uu,Gu,Wu,Hu,qu,ju,Yu,Xu,Zu,Ku,Qu,Ju,$u,ec,tc,ic,rc,nc,oc,ac,sc,lc,uc,cc,hc,dc,pc,mc,fc,vc,gc,_c,yc,Cc,Ec,Sc,wc,Tc,xc,bc,Ac,Pc,Ic,Mc,Dc,Rc,Oc,Nc,Lc,Fc,Bc,Vc,kc,zc,Uc,Gc,Wc,Hc,qc,jc,Yc,Xc,Zc,Kc,Qc,Jc,$c,eh){ -"use strict";var th={VERSION:"1.18",_shaders:{}};return th.appendForwardSlash=e,th.ArcGisImageServerTerrainProvider=t,th.AssociativeArray=i,th.AttributeCompression=r,th.AxisAlignedBoundingBox=n,th.barycentricCoordinates=o,th.binarySearch=a,th.BingMapsApi=s,th.BoundingRectangle=l,th.BoundingSphere=u,th.BoxGeometry=c,th.BoxOutlineGeometry=h,th.buildModuleUrl=d,th.cancelAnimationFrame=p,th.Cartesian2=m,th.Cartesian3=f,th.Cartesian4=v,th.Cartographic=g,th.CatmullRomSpline=_,th.CesiumTerrainProvider=y,th.CircleGeometry=C,th.CircleOutlineGeometry=E,th.Clock=S,th.ClockRange=w,th.ClockStep=T,th.clone=x,th.Color=b,th.ColorGeometryInstanceAttribute=A,th.combine=P,th.ComponentDatatype=I,th.CornerType=M,th.CorridorGeometry=D,th.CorridorGeometryLibrary=R,th.CorridorOutlineGeometry=O,th.createGuid=N,th.Credit=L,th.CubicRealPolynomial=F,th.CylinderGeometry=B,th.CylinderGeometryLibrary=V,th.CylinderOutlineGeometry=k,th.DefaultProxy=z,th.defaultValue=U,th.defined=G,th.definedNotNull=W,th.defineProperties=H,th.deprecationWarning=q,th.destroyObject=j,th.DeveloperError=Y,th.EarthOrientationParameters=X,th.EarthOrientationParametersSample=Z,th.EasingFunction=K,th.EllipseGeometry=Q,th.EllipseGeometryLibrary=J,th.EllipseOutlineGeometry=$,th.Ellipsoid=ee,th.EllipsoidalOccluder=te,th.EllipsoidGeodesic=ie,th.EllipsoidGeometry=re,th.EllipsoidOutlineGeometry=ne,th.EllipsoidTangentPlane=oe,th.EllipsoidTerrainProvider=ae,th.EncodedCartesian3=se,th.Event=le,th.EventHelper=ue,th.ExtrapolationType=ce,th.FeatureDetection=he,th.formatError=de,th.freezeObject=pe,th.Fullscreen=me,th.GeographicProjection=fe,th.GeographicTilingScheme=ve,th.Geometry=ge,th.GeometryAttribute=_e,th.GeometryAttributes=ye,th.GeometryInstance=Ce,th.GeometryInstanceAttribute=Ee,th.GeometryPipeline=Se,th.GeometryType=we,th.getAbsoluteUri=Te,th.getBaseUri=xe,th.getExtensionFromUri=be,th.getFilenameFromUri=Ae,th.getImagePixels=Pe,th.getMagic=Ie,th.getStringFromTypedArray=Me,th.getTimestamp=De,th.GregorianDate=Re,th.HeadingPitchRange=Oe,th.HeightmapTerrainData=Ne,th.HeightmapTessellator=Le,th.HermitePolynomialApproximation=Fe,th.HermiteSpline=Be,th.Iau2000Orientation=Ve,th.Iau2006XysData=ke,th.Iau2006XysSample=ze,th.IauOrientationAxes=Ue,th.IauOrientationParameters=Ge,th.IndexDatatype=We,th.InterpolationAlgorithm=He,th.Intersect=qe,th.Intersections2D=je,th.IntersectionTests=Ye,th.Interval=Xe,th.isArray=Ze,th.isCrossOriginUrl=Ke,th.isLeapYear=Qe,th.Iso8601=Je,th.joinUrls=$e,th.JulianDate=et,th.KeyboardEventModifier=tt,th.LagrangePolynomialApproximation=it,th.LeapSecond=rt,th.LinearApproximation=nt,th.LinearSpline=ot,th.loadArrayBuffer=at,th.loadBlob=st,th.loadImage=lt,th.loadImageFromTypedArray=ut,th.loadImageViaBlob=ct,th.loadJson=ht,th.loadJsonp=dt,th.loadText=pt,th.loadWithXhr=mt,th.loadXML=ft,th.MapboxApi=vt,th.MapProjection=gt,th.Math=_t,th.Matrix2=yt,th.Matrix3=Ct,th.Matrix4=Et,th.mergeSort=St,th.NearFarScalar=wt,th.objectToQuery=Tt,th.Occluder=xt,th.OrientedBoundingBox=bt,th.Packable=At,th.PackableForInterpolation=Pt,th.parseResponseHeaders=It,th.PinBuilder=Mt,th.PixelFormat=Dt,th.Plane=Rt,th.PointGeometry=Ot,th.pointInsideTriangle=Nt,th.PolygonGeometry=Lt,th.PolygonGeometryLibrary=Ft,th.PolygonHierarchy=Bt,th.PolygonOutlineGeometry=Vt,th.PolygonPipeline=kt,th.PolylineGeometry=zt,th.PolylinePipeline=Ut,th.PolylineVolumeGeometry=Gt,th.PolylineVolumeGeometryLibrary=Wt,th.PolylineVolumeOutlineGeometry=Ht,th.PrimitiveType=qt,th.QuadraticRealPolynomial=jt,th.QuantizedMeshTerrainData=Yt,th.QuarticRealPolynomial=Xt,th.Quaternion=Zt,th.QuaternionSpline=Kt,th.queryToObject=Qt,th.Queue=Jt,th.Ray=$t,th.Rectangle=ei,th.RectangleGeometry=ti,th.RectangleGeometryLibrary=ii,th.RectangleOutlineGeometry=ri,th.ReferenceFrame=ni,th.requestAnimationFrame=oi,th.RequestErrorEvent=ai,th.RuntimeError=si,th.sampleTerrain=li,th.scaleToGeodeticSurface=ui,th.ScreenSpaceEventHandler=ci,th.ScreenSpaceEventType=hi,th.ShowGeometryInstanceAttribute=di,th.Simon1994PlanetaryPositions=pi,th.SimplePolylineGeometry=mi,th.SphereGeometry=fi,th.SphereOutlineGeometry=vi,th.Spherical=gi,th.Spline=_i,th.subdivideArray=yi,th.TaskProcessor=Ci,th.TerrainData=Ei,th.TerrainEncoding=Si,th.TerrainMesh=wi,th.TerrainProvider=Ti,th.TerrainQuantization=xi,th.throttleRequestByServer=bi,th.TileProviderError=Ai,th.TilingScheme=Pi,th.TimeConstants=Ii,th.TimeInterval=Mi,th.TimeIntervalCollection=Di,th.TimeStandard=Ri,th.Tipsify=Oi,th.Transforms=Ni,th.TranslationRotationScale=Li,th.TridiagonalSystemSolver=Fi,th.VertexFormat=Bi,th.VideoSynchronizer=Vi,th.Visibility=ki,th.VRTheWorldTerrainProvider=zi,th.WallGeometry=Ui,th.WallGeometryLibrary=Gi,th.WallOutlineGeometry=Wi,th.WebMercatorProjection=Hi,th.WebMercatorTilingScheme=qi,th.WindingOrder=ji,th.wrapFunction=Yi,th.writeTextToCanvas=Xi,th.BillboardGraphics=Zi,th.BillboardVisualizer=Ki,th.BoundingSphereState=Qi,th.BoxGeometryUpdater=Ji,th.BoxGraphics=$i,th.CallbackProperty=er,th.CheckerboardMaterialProperty=tr,th.ColorMaterialProperty=ir,th.CompositeEntityCollection=rr,th.CompositeMaterialProperty=nr,th.CompositePositionProperty=or,th.CompositeProperty=ar,th.ConstantPositionProperty=sr,th.ConstantProperty=lr,th.CorridorGeometryUpdater=ur,th.CorridorGraphics=cr,th.createMaterialPropertyDescriptor=hr,th.createPropertyDescriptor=dr,th.createRawPropertyDescriptor=pr,th.CustomDataSource=mr,th.CylinderGeometryUpdater=fr,th.CylinderGraphics=vr,th.CzmlDataSource=gr,th.DataSource=_r,th.DataSourceClock=yr,th.DataSourceCollection=Cr,th.DataSourceDisplay=Er,th.dynamicGeometryGetBoundingSphere=Sr,th.DynamicGeometryUpdater=wr,th.EllipseGeometryUpdater=Tr,th.EllipseGraphics=xr,th.EllipsoidGeometryUpdater=br,th.EllipsoidGraphics=Ar,th.Entity=Pr,th.EntityCollection=Ir,th.EntityView=Mr,th.GeoJsonDataSource=Dr,th.GeometryUpdater=Rr,th.GeometryVisualizer=Or,th.GridMaterialProperty=Nr,th.ImageMaterialProperty=Lr,th.KmlDataSource=Fr,th.LabelGraphics=Br,th.LabelVisualizer=Vr,th.MaterialProperty=kr,th.ModelGraphics=zr,th.ModelVisualizer=Ur,th.NodeTransformationProperty=Gr,th.PathGraphics=Wr,th.PathVisualizer=Hr,th.PointGraphics=qr,th.PointVisualizer=jr,th.PolygonGeometryUpdater=Yr,th.PolygonGraphics=Xr,th.PolylineArrowMaterialProperty=Zr,th.PolylineGeometryUpdater=Kr,th.PolylineGlowMaterialProperty=Qr,th.PolylineGraphics=Jr,th.PolylineOutlineMaterialProperty=$r,th.PolylineVolumeGeometryUpdater=en,th.PolylineVolumeGraphics=tn,th.PositionProperty=rn,th.PositionPropertyArray=nn,th.Property=on,th.PropertyArray=an,th.PropertyBag=sn,th.RectangleGeometryUpdater=ln,th.RectangleGraphics=un,th.ReferenceProperty=cn,th.Rotation=hn,th.SampledPositionProperty=dn,th.SampledProperty=pn,th.ScaledPositionProperty=mn,th.StaticGeometryColorBatch=fn,th.StaticGeometryPerMaterialBatch=vn,th.StaticOutlineGeometryBatch=gn,th.StripeMaterialProperty=_n,th.StripeOrientation=yn,th.TimeIntervalCollectionPositionProperty=Cn,th.TimeIntervalCollectionProperty=En,th.VelocityOrientationProperty=Sn,th.Visualizer=wn,th.WallGeometryUpdater=Tn,th.WallGraphics=xn,th.AutomaticUniforms=bn,th.Buffer=An,th.BufferUsage=Pn,th.ClearCommand=In,th.ComputeCommand=Mn,th.ComputeEngine=Dn,th.Context=Rn,th.ContextLimits=On,th.createUniform=Nn,th.createUniformArray=Ln,th.CubeMap=Fn,th.CubeMapFace=Bn,th.DrawCommand=Vn,th.Framebuffer=kn,th.loadCubeMap=zn,th.MipmapHint=Un,th.PassState=Gn,th.PickFramebuffer=Wn,th.PixelDatatype=Hn,th.Renderbuffer=qn,th.RenderbufferFormat=jn,th.RenderState=Yn,th.Sampler=Xn,th.ShaderCache=Zn,th.ShaderProgram=Kn,th.ShaderSource=Qn,th.Texture=Jn,th.TextureMagnificationFilter=$n,th.TextureMinificationFilter=eo,th.TextureWrap=to,th.UniformState=io,th.VertexArray=ro,th.VertexArrayFacade=no,th.WebGLConstants=oo,th.Appearance=ao,th.ArcGisMapServerImageryProvider=so,th.Billboard=lo,th.BillboardCollection=uo,th.BingMapsImageryProvider=co,th.BingMapsStyle=ho,th.BlendEquation=po,th.BlendFunction=mo,th.BlendingState=fo,th.Camera=vo,th.CameraEventAggregator=go,th.CameraEventType=_o,th.CameraFlightPath=yo,th.createOpenStreetMapImageryProvider=Co,th.createTangentSpaceDebugPrimitive=Eo,th.createTileMapServiceImageryProvider=So,th.CreditDisplay=wo,th.CullFace=To,th.CullingVolume=xo,th.DebugAppearance=bo,th.DebugModelMatrixPrimitive=Ao,th.DepthFunction=Po,th.DepthPlane=Io,th.DeviceOrientationCameraController=Mo,th.DiscardMissingTileImagePolicy=Do,th.EllipsoidPrimitive=Ro,th.EllipsoidSurfaceAppearance=Oo,th.Fog=No,th.FrameRateMonitor=Lo,th.FrameState=Fo,th.FrustumCommands=Bo,th.FXAA=Vo,th.GetFeatureInfoFormat=ko,th.getModelAccessor=zo,th.Globe=Uo,th.GlobeDepth=Go,th.GlobeSurfaceShaderSet=Wo,th.GlobeSurfaceTile=Ho,th.GlobeSurfaceTileProvider=qo,th.GoogleEarthImageryProvider=jo,th.GridImageryProvider=Yo,th.GroundPrimitive=Xo,th.HeightReference=Zo,th.HorizontalOrigin=Ko,th.Imagery=Qo,th.ImageryLayer=Jo,th.ImageryLayerCollection=$o,th.ImageryLayerFeatureInfo=ea,th.ImageryProvider=ta,th.ImageryState=ia,th.Label=ra,th.LabelCollection=na,th.LabelStyle=oa,th.MapboxImageryProvider=aa,th.Material=sa,th.MaterialAppearance=la,th.Model=ua,th.ModelAnimation=ca,th.ModelAnimationCache=ha,th.ModelAnimationCollection=da,th.ModelAnimationLoop=pa,th.ModelAnimationState=ma,th.ModelMaterial=fa,th.modelMaterialsCommon=va,th.ModelMesh=ga,th.ModelNode=_a,th.Moon=ya,th.NeverTileDiscardPolicy=Ca,th.OIT=Ea,th.OpenStreetMapImageryProvider=Sa,th.OrthographicFrustum=wa,th.Pass=Ta,th.PerformanceDisplay=xa,th.PerInstanceColorAppearance=ba,th.PerspectiveFrustum=Aa,th.PerspectiveOffCenterFrustum=Pa,th.PickDepth=Ia,th.PointAppearance=Ma,th.PointPrimitive=Da,th.PointPrimitiveCollection=Ra,th.Polyline=Oa,th.PolylineCollection=Na,th.PolylineColorAppearance=La,th.PolylineMaterialAppearance=Fa,th.Primitive=Ba,th.PrimitiveCollection=Va,th.PrimitivePipeline=ka,th.PrimitiveState=za,th.QuadtreeOccluders=Ua,th.QuadtreePrimitive=Ga,th.QuadtreeTile=Wa,th.QuadtreeTileLoadState=Ha,th.QuadtreeTileProvider=qa,th.Scene=ja,th.SceneMode=Ya,th.SceneTransforms=Xa,th.SceneTransitioner=Za,th.ScreenSpaceCameraController=Ka,th.SingleTileImageryProvider=Qa,th.SkyAtmosphere=Ja,th.SkyBox=$a,th.StencilFunction=es,th.StencilOperation=ts,th.Sun=is,th.SunPostProcess=rs,th.TerrainState=ns,th.TextureAtlas=os,th.TileBoundingBox=as,th.TileCoordinatesImageryProvider=ss,th.TileDiscardPolicy=ls,th.TileImagery=us,th.TileMapServiceImageryProvider=cs,th.TileReplacementQueue=hs,th.TileState=ds,th.TileTerrain=ps,th.TweenCollection=ms,th.UrlTemplateImageryProvider=fs,th.VerticalOrigin=vs,th.ViewportQuad=gs,th.WebMapServiceImageryProvider=_s,th.WebMapTileServiceImageryProvider=ys,th._shaders.AdjustTranslucentFS=Cs,th._shaders.AllMaterialAppearanceFS=Es,th._shaders.AllMaterialAppearanceVS=Ss,th._shaders.BasicMaterialAppearanceFS=ws,th._shaders.BasicMaterialAppearanceVS=Ts,th._shaders.EllipsoidSurfaceAppearanceFS=xs,th._shaders.EllipsoidSurfaceAppearanceVS=bs,th._shaders.PerInstanceColorAppearanceFS=As,th._shaders.PerInstanceColorAppearanceVS=Ps,th._shaders.PerInstanceFlatColorAppearanceFS=Is,th._shaders.PerInstanceFlatColorAppearanceVS=Ms,th._shaders.PointAppearanceFS=Ds,th._shaders.PointAppearanceVS=Rs,th._shaders.PolylineColorAppearanceVS=Os,th._shaders.PolylineMaterialAppearanceVS=Ns,th._shaders.TexturedMaterialAppearanceFS=Ls,th._shaders.TexturedMaterialAppearanceVS=Fs,th._shaders.BillboardCollectionFS=Bs,th._shaders.BillboardCollectionVS=Vs,th._shaders.degreesPerRadian=ks,th._shaders.depthRange=zs,th._shaders.epsilon1=Us,th._shaders.epsilon2=Gs,th._shaders.epsilon3=Ws,th._shaders.epsilon4=Hs,th._shaders.epsilon5=qs,th._shaders.epsilon6=js,th._shaders.epsilon7=Ys,th._shaders.infinity=Xs,th._shaders.oneOverPi=Zs,th._shaders.oneOverTwoPi=Ks,th._shaders.pi=Qs,th._shaders.piOverFour=Js,th._shaders.piOverSix=$s,th._shaders.piOverThree=el,th._shaders.piOverTwo=tl,th._shaders.radiansPerDegree=il,th._shaders.sceneMode2D=rl,th._shaders.sceneMode3D=nl,th._shaders.sceneModeColumbusView=ol,th._shaders.sceneModeMorphing=al,th._shaders.solarRadius=sl,th._shaders.threePiOver2=ll,th._shaders.twoPi=ul,th._shaders.webMercatorMaxLatitude=cl,th._shaders.CzmBuiltins=hl,th._shaders.alphaWeight=dl,th._shaders.antialias=pl,th._shaders.columbusViewMorph=ml,th._shaders.computePosition=fl,th._shaders.cosineAndSine=vl,th._shaders.decompressTextureCoordinates=gl,th._shaders.eastNorthUpToEyeCoordinates=_l,th._shaders.ellipsoidContainsPoint=yl,th._shaders.ellipsoidNew=Cl,th._shaders.ellipsoidWgs84TextureCoordinates=El,th._shaders.equalsEpsilon=Sl,th._shaders.eyeOffset=wl,th._shaders.eyeToWindowCoordinates=Tl,th._shaders.fog=xl,th._shaders.geodeticSurfaceNormal=bl,th._shaders.getDefaultMaterial=Al,th._shaders.getLambertDiffuse=Pl,th._shaders.getSpecular=Il,th._shaders.getWaterNoise=Ml,th._shaders.getWgs84EllipsoidEC=Dl,th._shaders.hue=Rl,th._shaders.isEmpty=Ol,th._shaders.isFull=Nl,th._shaders.latitudeToWebMercatorFraction=Ll,th._shaders.luminance=Fl,th._shaders.metersPerPixel=Bl,th._shaders.modelToWindowCoordinates=Vl,th._shaders.multiplyWithColorBalance=kl,th._shaders.nearFarScalar=zl,th._shaders.octDecode=Ul,th._shaders.packDepth=Gl,th._shaders.phong=Wl,th._shaders.pointAlongRay=Hl,th._shaders.rayEllipsoidIntersectionInterval=ql,th._shaders.RGBToXYZ=jl,th._shaders.saturation=Yl,th._shaders.signNotZero=Xl,th._shaders.tangentToEyeSpaceMatrix=Zl,th._shaders.translateRelativeToEye=Kl,th._shaders.translucentPhong=Ql,th._shaders.transpose=Jl,th._shaders.unpackDepth=$l,th._shaders.windowToEyeCoordinates=eu,th._shaders.XYZToRGB=tu,th._shaders.depthRangeStruct=iu,th._shaders.ellipsoid=ru,th._shaders.material=nu,th._shaders.materialInput=ou,th._shaders.ray=au,th._shaders.raySegment=su,th._shaders.CompositeOITFS=lu,th._shaders.DepthPlaneFS=uu,th._shaders.DepthPlaneVS=cu,th._shaders.EllipsoidFS=hu,th._shaders.EllipsoidVS=du,th._shaders.GlobeFS=pu,th._shaders.GlobeVS=mu,th._shaders.GroundAtmosphere=fu,th._shaders.BumpMapMaterial=vu,th._shaders.CheckerboardMaterial=gu,th._shaders.DotMaterial=_u,th._shaders.FadeMaterial=yu,th._shaders.GridMaterial=Cu,th._shaders.NormalMapMaterial=Eu,th._shaders.PolylineArrowMaterial=Su,th._shaders.PolylineGlowMaterial=wu,th._shaders.PolylineOutlineMaterial=Tu,th._shaders.RimLightingMaterial=xu,th._shaders.StripeMaterial=bu,th._shaders.Water=Au,th._shaders.PointPrimitiveCollectionFS=Pu,th._shaders.PointPrimitiveCollectionVS=Iu,th._shaders.PolylineCommon=Mu,th._shaders.PolylineFS=Du,th._shaders.PolylineVS=Ru,th._shaders.AdditiveBlend=Ou,th._shaders.BrightPass=Nu,th._shaders.FXAA=Lu,th._shaders.GaussianBlur1D=Fu,th._shaders.PassThrough=Bu,th._shaders.ReprojectWebMercatorFS=Vu,th._shaders.ReprojectWebMercatorVS=ku,th._shaders.ShadowVolumeFS=zu,th._shaders.ShadowVolumeVS=Uu,th._shaders.SkyAtmosphereFS=Gu,th._shaders.SkyAtmosphereVS=Wu,th._shaders.SkyBoxFS=Hu,th._shaders.SkyBoxVS=qu,th._shaders.SunFS=ju,th._shaders.SunTextureFS=Yu,th._shaders.SunVS=Xu,th._shaders.ViewportQuadFS=Zu,th._shaders.ViewportQuadVS=Ku,th.Autolinker=Qu,th.gltfDefaults=Ju,th["knockout-3.2.0"]=$u,th["knockout-es5"]=ec,th.knockout=tc,th.measureText=ic,th["mersenne-twister"]=rc,th.NoSleep=nc,th.sprintf=oc,th.topojson=ac,th.Tween=sc,th.Uri=lc,th.when=uc,th.zip=cc,th.Animation=hc,th.AnimationViewModel=dc,th.BaseLayerPicker=pc,th.BaseLayerPickerViewModel=mc,th.createDefaultImageryProviderViewModels=fc,th.createDefaultTerrainProviderViewModels=vc,th.ProviderViewModel=gc,th.CesiumInspector=_c,th.CesiumInspectorViewModel=yc,th.CesiumWidget=Cc,th.ClockViewModel=Ec,th.Command=Sc,th.createCommand=wc,th.FullscreenButton=Tc,th.FullscreenButtonViewModel=xc,th.Geocoder=bc,th.GeocoderViewModel=Ac,th.getElement=Pc,th.HomeButton=Ic,th.HomeButtonViewModel=Mc,th.InfoBox=Dc,th.InfoBoxViewModel=Rc,th.NavigationHelpButton=Oc,th.NavigationHelpButtonViewModel=Nc,th.PerformanceWatchdog=Lc,th.PerformanceWatchdogViewModel=Fc,th.SceneModePicker=Bc,th.SceneModePickerViewModel=Vc,th.SelectionIndicator=kc,th.SelectionIndicatorViewModel=zc,th.subscribeAndEvaluate=Uc,th.SvgPathBindingHandler=Gc,th.Timeline=Wc,th.TimelineHighlightRange=Hc,th.TimelineTrack=qc,th.ToggleButtonViewModel=jc,th.Viewer=Yc,th.viewerCesiumInspectorMixin=Xc,th.viewerDragDropMixin=Zc,th.viewerEntityMixin=Kc,th.viewerPerformanceWatchdogMixin=Qc,th.VRButton=Jc,th.VRButtonViewModel=$c,th.createTaskProcessorWorker=eh,th}),t(["Cesium"],function(e){"use strict";var t="undefined"!=typeof window?window:"undefined"!=typeof self?self:{};t.Cesium=e},void 0,!0)}(); \ No newline at end of file +!function(){var e,t,i;!function(r){function n(e,t){return C.call(e,t)}function o(e,t){var i,r,n,o,a,s,l,u,c,h,d,m=t&&t.split("/"),p=_.map,f=p&&p["*"]||{};if(e&&"."===e.charAt(0))if(t){for(e=e.split("/"),a=e.length-1,_.nodeIdCompat&&S.test(e[a])&&(e[a]=e[a].replace(S,"")),e=m.slice(0,m.length-1).concat(e),c=0;c<e.length;c+=1)if(d=e[c],"."===d)e.splice(c,1),c-=1;else if(".."===d){if(1===c&&(".."===e[2]||".."===e[0]))break;c>0&&(e.splice(c-1,2),c-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((m||f)&&p){for(i=e.split("/"),c=i.length;c>0;c-=1){if(r=i.slice(0,c).join("/"),m)for(h=m.length;h>0;h-=1)if(n=p[m.slice(0,h).join("/")],n&&(n=n[r])){o=n,s=c;break}if(o)break;!l&&f&&f[r]&&(l=f[r],u=c)}!o&&l&&(o=l,s=u),o&&(i.splice(0,s,o),e=i.join("/"))}return e}function a(e,t){return function(){var i=E.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),m.apply(r,i.concat([e,t]))}}function s(e){return function(t){return o(t,e)}}function l(e){return function(t){v[e]=t}}function u(e){if(n(g,e)){var t=g[e];delete g[e],y[e]=!0,d.apply(r,t)}if(!n(v,e)&&!n(y,e))throw new Error("No "+e);return v[e]}function c(e){var t,i=e?e.indexOf("!"):-1;return i>-1&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}function h(e){return function(){return _&&_.config&&_.config[e]||{}}}var d,m,p,f,v={},g={},_={},y={},C=Object.prototype.hasOwnProperty,E=[].slice,S=/\.js$/;p=function(e,t){var i,r=c(e),n=r[0];return e=r[1],n&&(n=o(n,t),i=u(n)),n?e=i&&i.normalize?i.normalize(e,s(t)):o(e,t):(e=o(e,t),r=c(e),n=r[0],e=r[1],n&&(i=u(n))),{f:n?n+"!"+e:e,n:e,pr:n,p:i}},f={require:function(e){return a(e)},exports:function(e){var t=v[e];return"undefined"!=typeof t?t:v[e]={}},module:function(e){return{id:e,uri:"",exports:v[e],config:h(e)}}},d=function(e,t,i,o){var s,c,h,d,m,_,C=[],E=typeof i;if(o=o||e,"undefined"===E||"function"===E){for(t=!t.length&&i.length?["require","exports","module"]:t,m=0;m<t.length;m+=1)if(d=p(t[m],o),c=d.f,"require"===c)C[m]=f.require(e);else if("exports"===c)C[m]=f.exports(e),_=!0;else if("module"===c)s=C[m]=f.module(e);else if(n(v,c)||n(g,c)||n(y,c))C[m]=u(c);else{if(!d.p)throw new Error(e+" missing "+c);d.p.load(d.n,a(o,!0),l(c),{}),C[m]=v[c]}h=i?i.apply(v[e],C):void 0,e&&(s&&s.exports!==r&&s.exports!==v[e]?v[e]=s.exports:h===r&&_||(v[e]=h))}else e&&(v[e]=i)},e=t=m=function(e,t,i,n,o){if("string"==typeof e)return f[e]?f[e](t):u(p(e,t).f);if(!e.splice){if(_=e,_.deps&&m(_.deps,_.callback),!t)return;t.splice?(e=t,t=i,i=null):e=r}return t=t||function(){},"function"==typeof i&&(i=n,n=o),n?d(r,e,t,i):setTimeout(function(){d(r,e,t,i)},4),m},m.config=function(e){return m(e)},e._defined=v,i=function(e,t,i){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(i=t,t=[]),n(v,e)||n(g,e)||(g[e]=[e,t,i])},i.amd={jQuery:!0}}(),i("Core/appendForwardSlash",[],function(){"use strict";function e(e){return(0===e.length||"/"!==e[e.length-1])&&(e+="/"),e}return e}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,i,r,n){return t(e).then(i,r,n)}function t(e){var t,i;return e instanceof r?t=e:s(e)?(i=a(),e.then(function(e){i.resolve(e)},function(e){i.reject(e)},function(e){i.progress(e)}),t=i.promise):t=n(e),t}function i(t){return e(t,o)}function r(e){this.then=e}function n(e){var i=new r(function(i){try{return t(i?i(e):e)}catch(r){return o(r)}});return i}function o(e){var i=new r(function(i,r){try{return r?t(r(e)):o(e)}catch(n){return o(n)}});return i}function a(){function e(e,t,i){return d(e,t,i)}function i(e){return p(e)}function n(e){return p(o(e))}function s(e){return m(e)}var l,u,c,h,d,m,p;return u=new r(e),l={then:e,resolve:i,reject:n,progress:s,promise:u,resolver:{resolve:i,reject:n,progress:s}},c=[],h=[],d=function(e,t,i){var r,n;return r=a(),n="function"==typeof i?function(e){try{r.progress(i(e))}catch(t){r.progress(t)}}:function(e){r.progress(e)},c.push(function(i){i.then(e,t).then(r.resolve,r.reject,n)}),h.push(n),r.promise},m=function(e){return f(h,e),e},p=function(e){return e=t(e),d=e.then,p=t,m=g,f(c,e),h=c=E,e},l}function s(e){return e&&"function"==typeof e.then}function l(t,i,r,n,o){return v(2,arguments),e(t,function(t){function s(e){f(e)}function l(e){p(e)}var u,c,h,d,m,p,f,v,_,y;if(_=t.length>>>0,u=Math.max(0,Math.min(i,_)),h=[],c=_-u+1,d=[],m=a(),u)for(v=m.progress,f=function(e){d.push(e),--c||(p=f=g,m.reject(d))},p=function(e){h.push(e),--u||(p=f=g,m.resolve(h))},y=0;_>y;++y)y in t&&e(t[y],l,s,v);else m.resolve(h);return m.then(r,n,o)})}function u(e,t,i,r){function n(e){return t?t(e[0]):e[0]}return l(e,1,n,i,r)}function c(e,t,i,r){return v(1,arguments),d(e,_).then(t,i,r)}function h(){return d(arguments,_)}function d(t,i){return e(t,function(t){var r,n,o,s,l,u;if(o=n=t.length>>>0,r=[],u=a(),o)for(s=function(t,n){e(t,i).then(function(e){r[n]=e,--o||u.resolve(r)},u.reject)},l=0;n>l;l++)l in t?s(t[l],l):--o;else u.resolve(r);return u.promise})}function m(t,i){var r=C.call(arguments,1);return e(t,function(t){var n;return n=t.length,r[0]=function(t,r,o){return e(t,function(t){return e(r,function(e){return i(t,e,o,n)})})},y.apply(t,r)})}function p(t,i,r){var n=arguments.length>2;return e(t,function(e){return e=n?r:e,i.resolve(e),e},function(e){return i.reject(e),o(e)},i.progress)}function f(e,t){for(var i,r=0;i=e[r++];)i(t)}function v(e,t){for(var i,r=t.length;r>e;)if(i=t[--r],null!=i&&"function"!=typeof i)throw new Error("arg "+r+" must be a function")}function g(){}function _(e){return e}var y,C,E;return e.defer=a,e.resolve=t,e.reject=i,e.join=h,e.all=c,e.map=d,e.reduce=m,e.any=u,e.some=l,e.chain=p,e.isPromise=s,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(E,e)},"yield":function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return c(t,function(t){return e.apply(E,t)})})}},C=[].slice,y=[].reduce||function(e){var t,i,r,n,o;if(o=0,t=Object(this),n=t.length>>>0,i=arguments,i.length<=1)for(;;){if(o in t){r=t[o++];break}if(++o>=n)throw new TypeError}else r=i[1];for(;n>o;++o)o in t&&(r=e(r,t[o],o,t));return r},e})}("function"==typeof i&&i.amd?i:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),i("Core/defined",[],function(){"use strict";function e(e){return void 0!==e}return e}),i("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),i=Object.defineProperties;return t&&e(i)||(i=function(e){return e}),i}),i("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(i){t=i.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),i("Core/Credit",["./defined","./defineProperties","./DeveloperError"],function(e,t,i){"use strict";function r(t,i,r){var a=e(r),s=e(i),l=e(t);l||s||(t=r),this._text=t,this._imageUrl=i,this._link=r,this._hasLink=a,this._hasImage=s;var u,c=JSON.stringify([t,i,r]);e(o[c])?u=o[c]:(u=n++,o[c]=u),this._id=u}var n=0,o={};return t(r.prototype,{text:{get:function(){return this._text}},imageUrl:{get:function(){return this._imageUrl}},link:{get:function(){return this._link}},id:{get:function(){return this._id}}}),r.prototype.hasImage=function(){return this._hasImage},r.prototype.hasLink=function(){return this._hasLink},r.equals=function(t,i){return t===i||e(t)&&e(i)&&t._id===i._id},r.prototype.equals=function(e){return r.equals(this,e)},r}),i("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),i("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),i("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var i;for(this.mti==this.N+1&&this.init_genrand(5489),i=0;i<this.N-this.M;i++)e=this.mt[i]&this.UPPER_MASK|this.mt[i+1]&this.LOWER_MASK,this.mt[i]=this.mt[i+this.M]^e>>>1^t[1&e];for(;i<this.N-1;i++)e=this.mt[i]&this.UPPER_MASK|this.mt[i+1]&this.LOWER_MASK,this.mt[i]=this.mt[i+(this.M-this.N)]^e>>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),i("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r){"use strict";var n={};n.EPSILON1=.1,n.EPSILON2=.01,n.EPSILON3=.001,n.EPSILON4=1e-4,n.EPSILON5=1e-5,n.EPSILON6=1e-6,n.EPSILON7=1e-7,n.EPSILON8=1e-8,n.EPSILON9=1e-9,n.EPSILON10=1e-10,n.EPSILON11=1e-11,n.EPSILON12=1e-12,n.EPSILON13=1e-13,n.EPSILON14=1e-14,n.EPSILON15=1e-15,n.EPSILON16=1e-16,n.EPSILON17=1e-17,n.EPSILON18=1e-18,n.EPSILON19=1e-19,n.EPSILON20=1e-20,n.GRAVITATIONALPARAMETER=3986004418e5,n.SOLAR_RADIUS=6955e5,n.LUNAR_RADIUS=1737400,n.SIXTY_FOUR_KILOBYTES=65536,n.sign=function(e){return e>0?1:0>e?-1:0},n.signNotZero=function(e){return 0>e?-1:1},n.toSNorm=function(e){return Math.round(255*(.5*n.clamp(e,-1,1)+.5))},n.fromSNorm=function(e){return n.clamp(e,0,255)/255*2-1},n.sinh=function(e){var t=Math.pow(Math.E,e),i=Math.pow(Math.E,-1*e);return.5*(t-i)},n.cosh=function(e){var t=Math.pow(Math.E,e),i=Math.pow(Math.E,-1*e);return.5*(t+i)},n.lerp=function(e,t,i){return(1-i)*e+i*t},n.PI=Math.PI,n.ONE_OVER_PI=1/Math.PI,n.PI_OVER_TWO=.5*Math.PI,n.PI_OVER_THREE=Math.PI/3,n.PI_OVER_FOUR=Math.PI/4,n.PI_OVER_SIX=Math.PI/6,n.THREE_PI_OVER_TWO=3*Math.PI*.5,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(e){return e*n.RADIANS_PER_DEGREE},n.toDegrees=function(e){return e*n.DEGREES_PER_RADIAN},n.convertLongitudeRange=function(e){var t=n.TWO_PI,i=e-Math.floor(e/t)*t;return i<-Math.PI?i+t:i>=Math.PI?i-t:i},n.negativePiToPi=function(e){return n.zeroToTwoPi(e+n.PI)-n.PI},n.zeroToTwoPi=function(e){var t=n.mod(e,n.TWO_PI);return Math.abs(t)<n.EPSILON14&&Math.abs(e)>n.EPSILON14?n.TWO_PI:t},n.mod=function(e,t){return(e%t+t)%t},n.equalsEpsilon=function(e,i,r,n){n=t(n,r);var o=Math.abs(e-i);return n>=o||o<=r*Math.max(Math.abs(e),Math.abs(i))};var o=[1];n.factorial=function(e){var t=o.length;if(e>=t)for(var i=o[t-1],r=t;e>=r;r++)o.push(i*r);return o[e]},n.incrementWrap=function(e,i,r){return r=t(r,0),++e,e>i&&(e=r),e},n.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},n.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},n.clamp=function(e,t,i){return t>e?t:e>i?i:e};var a=new e;return n.setRandomNumberSeed=function(t){a=new e(t)},n.nextRandomNumber=function(){return a.random()},n.acosClamped=function(e){return Math.acos(n.clamp(e,-1,1))},n.asinClamped=function(e){return Math.asin(n.clamp(e,-1,1))},n.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},n.logBase=function(e,t){return Math.log(e)/Math.log(t)},n.fog=function(e,t){var i=e*t;return 1-Math.exp(-(i*i))},n}),i("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n){"use strict";function o(t,i,r){this.x=e(t,0),this.y=e(i,0),this.z=e(r,0)}o.fromSpherical=function(i,r){t(r)||(r=new o);var n=i.clock,a=i.cone,s=e(i.magnitude,1),l=s*Math.sin(a);return r.x=l*Math.cos(n),r.y=l*Math.sin(n),r.z=s*Math.cos(a),r},o.fromElements=function(e,i,r,n){return t(n)?(n.x=e,n.y=i,n.z=r,n):new o(e,i,r)},o.clone=function(e,i){return t(e)?t(i)?(i.x=e.x,i.y=e.y,i.z=e.z,i):new o(e.x,e.y,e.z):void 0},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,i,r){r=e(r,0),i[r++]=t.x,i[r++]=t.y,i[r]=t.z},o.unpack=function(i,r,n){return r=e(r,0),t(n)||(n=new o),n.x=i[r++],n.y=i[r++],n.z=i[r],n},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,i){return i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i.z=Math.min(e.z,t.z),i},o.maximumByComponent=function(e,t,i){return i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i.z=Math.max(e.z,t.z),i},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var a=new o;o.distance=function(e,t){return o.subtract(e,t,a),o.magnitude(a)},o.distanceSquared=function(e,t){return o.subtract(e,t,a),o.magnitudeSquared(a)},o.normalize=function(e,t){var i=o.magnitude(e);return t.x=e.x/i,t.y=e.y/i,t.z=e.z/i,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,i){return i.x=e.x*t.x,i.y=e.y*t.y,i.z=e.z*t.z,i},o.add=function(e,t,i){return i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i},o.subtract=function(e,t,i){return i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i},o.multiplyByScalar=function(e,t,i){return i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i},o.divideByScalar=function(e,t,i){return i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,i,r){return o.multiplyByScalar(t,i,s),r=o.multiplyByScalar(e,1-i,r),o.add(s,r,r)};var l=new o,u=new o;o.angleBetween=function(e,t){o.normalize(e,l),o.normalize(t,u);var i=o.dot(l,u),r=o.magnitude(o.cross(l,u,l));return Math.atan2(r,i)};var c=new o;o.mostOrthogonalAxis=function(e,t){var i=o.normalize(e,c);return o.abs(i,i),t=i.x<=i.y?i.x<=i.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):i.y<=i.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,i){return e===i||t(e)&&t(i)&&e.x===i.x&&e.y===i.y&&e.z===i.z},o.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]&&e.z===t[i+2]},o.equalsEpsilon=function(e,i,r,o){return e===i||t(e)&&t(i)&&n.equalsEpsilon(e.x,i.x,r,o)&&n.equalsEpsilon(e.y,i.y,r,o)&&n.equalsEpsilon(e.z,i.z,r,o)},o.cross=function(e,t,i){var r=e.x,n=e.y,o=e.z,a=t.x,s=t.y,l=t.z,u=n*l-o*s,c=o*a-r*l,h=r*s-n*a;return i.x=u,i.y=c,i.z=h,i},o.fromDegrees=function(e,t,i,r,a){var s=n.toRadians(e),l=n.toRadians(t);return o.fromRadians(s,l,i,r,a)};var h=new o,d=new o,m=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(i,r,n,a,s){n=e(n,0);var l=t(a)?a.radiiSquared:m,u=Math.cos(r);h.x=u*Math.cos(i),h.y=u*Math.sin(i),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(l,h,d);var c=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,c,d),h=o.multiplyByScalar(h,n,h),t(s)||(s=new o),o.add(d,h,s)},o.fromDegreesArray=function(e,t,i){for(var r=new Array(e.length),a=0;a<e.length;a++)r[a]=n.toRadians(e[a]);return o.fromRadiansArray(r,t,i)},o.fromRadiansArray=function(e,i,r){var n=e.length;t(r)?r.length=n/2:r=new Array(n/2);for(var a=0;n>a;a+=2){var s=e[a],l=e[a+1];r[a/2]=o.fromRadians(s,l,0,i,r[a/2])}return r},o.fromDegreesArrayHeights=function(e,t,i){for(var r=new Array(e.length),a=0;a<e.length;a+=3)r[a]=n.toRadians(e[a]),r[a+1]=n.toRadians(e[a+1]),r[a+2]=e[a+2];return o.fromRadiansArrayHeights(r,t,i)},o.fromRadiansArrayHeights=function(e,i,r){var n=e.length;t(r)?r.length=n/3:r=new Array(n/3);for(var a=0;n>a;a+=3){var s=e[a],l=e[a+1],u=e[a+2];r[a/3]=o.fromRadians(s,l,u,i,r[a/3])}return r},o.ZERO=r(new o(0,0,0)),o.UNIT_X=r(new o(1,0,0)),o.UNIT_Y=r(new o(0,1,0)),o.UNIT_Z=r(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,i){return o.equalsEpsilon(this,e,t,i)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),i("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,i,r){"use strict";function n(i,n,s,l,u){var c=i.x,h=i.y,d=i.z,m=n.x,p=n.y,f=n.z,v=c*c*m*m,g=h*h*p*p,_=d*d*f*f,y=v+g+_,C=Math.sqrt(1/y),E=e.multiplyByScalar(i,C,o);if(l>y)return isFinite(C)?e.clone(E,u):void 0;var S=s.x,w=s.y,T=s.z,x=a;x.x=E.x*S*2,x.y=E.y*w*2,x.z=E.z*T*2;var b,A,P,I,M,D,R,O,N,L,F,B=(1-C)*e.magnitude(i)/(.5*e.magnitude(x)),V=0;do{B-=V,P=1/(1+B*S),I=1/(1+B*w),M=1/(1+B*T),D=P*P,R=I*I,O=M*M,N=D*P,L=R*I,F=O*M,b=v*D+g*R+_*O-1,A=v*N*S+g*L*w+_*F*T;var k=-2*A;V=b/k}while(Math.abs(b)>r.EPSILON12);return t(u)?(u.x=c*P,u.y=h*I,u.z=d*M,u):new e(c*P,h*I,d*M)}var o=new e,a=new e;return n}),i("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,i,r,n,o,a){"use strict";function s(e,i,r){this.longitude=t(e,0),this.latitude=t(i,0),this.height=t(r,0)}s.fromRadians=function(e,r,n,o){return n=t(n,0),i(o)?(o.longitude=e,o.latitude=r,o.height=n,o):new s(e,r,n)},s.fromDegrees=function(e,t,i,r){return e=o.toRadians(e),t=o.toRadians(t),s.fromRadians(e,t,i,r)};var l=new e,u=new e,c=new e,h=new e(1/6378137,1/6378137,1/6356752.314245179),d=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),m=o.EPSILON1;return s.fromCartesian=function(t,r,n){var p=i(r)?r.oneOverRadii:h,f=i(r)?r.oneOverRadiiSquared:d,v=i(r)?r._centerToleranceSquared:m,g=a(t,p,f,v,u);if(i(g)){var _=e.multiplyComponents(t,f,l);_=e.normalize(_,_);var y=e.subtract(t,g,c),C=Math.atan2(_.y,_.x),E=Math.asin(_.z),S=o.sign(e.dot(y,t))*e.magnitude(y);return i(n)?(n.longitude=C,n.latitude=E,n.height=S,n):new s(C,E,S)}},s.clone=function(e,t){return i(e)?i(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new s(e.longitude,e.latitude,e.height):void 0},s.equals=function(e,t){return e===t||i(e)&&i(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},s.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},s.ZERO=n(new s(0,0,0)),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},s}),i("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,r,n,o){r=i(r,0),n=i(n,0),o=i(o,0),t._radii=new e(r,n,o),t._radiiSquared=new e(r*r,n*n,o*o),t._radiiToTheFourth=new e(r*r*r*r,n*n*n*n,o*o*o*o),t._oneOverRadii=new e(0===r?0:1/r,0===n?0:1/n,0===o?0:1/o),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===n?0:1/(n*n),0===o?0:1/(o*o)),t._minimumRadius=Math.min(r,n,o),t._maximumRadius=Math.max(r,n,o),t._centerToleranceSquared=s.EPSILON1}function c(e,t,i){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,u(this,e,t,i)}n(c.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),c.clone=function(t,i){if(r(t)){var n=t._radii;return r(i)?(e.clone(n,i._radii),e.clone(t._radiiSquared,i._radiiSquared),e.clone(t._radiiToTheFourth,i._radiiToTheFourth),e.clone(t._oneOverRadii,i._oneOverRadii),e.clone(t._oneOverRadiiSquared,i._oneOverRadiiSquared),i._minimumRadius=t._minimumRadius,i._maximumRadius=t._maximumRadius,i._centerToleranceSquared=t._centerToleranceSquared,i):new c(n.x,n.y,n.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(u(t,e.x,e.y,e.z),t):t},c.WGS84=a(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=a(new c(1,1,1)),c.MOON=a(new c(s.LUNAR_RADIUS,s.LUNAR_RADIUS,s.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,n){n=i(n,0),e.pack(t._radii,r,n)},c.unpack=function(t,r,n){r=i(r,0);var o=e.unpack(t,r);return c.fromCartesian3(o,n)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,i){var n=t.longitude,o=t.latitude,a=Math.cos(o),s=a*Math.cos(n),l=a*Math.sin(n),u=Math.sin(o);return r(i)||(i=new e),i.x=s,i.y=l,i.z=u,e.normalize(i,i)},c.prototype.geodeticSurfaceNormal=function(t,i){return r(i)||(i=new e),i=e.multiplyComponents(t,this._oneOverRadiiSquared,i),e.normalize(i,i)};var h=new e,d=new e;c.prototype.cartographicToCartesian=function(t,i){var n=h,o=d;this.geodeticSurfaceNormalCartographic(t,n),e.multiplyComponents(this._radiiSquared,n,o);var a=Math.sqrt(e.dot(n,o));return e.divideByScalar(o,a,o),e.multiplyByScalar(n,t.height,n),r(i)||(i=new e),e.add(o,n,i)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var i=e.length;r(t)?t.length=i:t=new Array(i);for(var n=0;i>n;n++)t[n]=this.cartographicToCartesian(e[n],t[n]);return t};var m=new e,p=new e,f=new e;return c.prototype.cartesianToCartographic=function(i,n){var o=this.scaleToGeodeticSurface(i,p);if(r(o)){var a=this.geodeticSurfaceNormal(o,m),l=e.subtract(i,o,f),u=Math.atan2(a.y,a.x),c=Math.asin(a.z),h=s.sign(e.dot(l,i))*e.magnitude(l);return r(n)?(n.longitude=u,n.latitude=c,n.height=h,n):new t(u,c,h)}},c.prototype.cartesianArrayToCartographicArray=function(e,t){var i=e.length;r(t)?t.length=i:t=new Array(i);for(var n=0;i>n;++n)t[n]=this.cartesianToCartographic(e[n],t[n]);return t},c.prototype.scaleToGeodeticSurface=function(e,t){return l(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},c.prototype.scaleToGeocentricSurface=function(t,i){r(i)||(i=new e);var n=t.x,o=t.y,a=t.z,s=this._oneOverRadiiSquared,l=1/Math.sqrt(n*n*s.x+o*o*s.y+a*a*s.z);return e.multiplyByScalar(t,l,i)},c.prototype.transformPositionToScaledSpace=function(t,i){return r(i)||(i=new e),e.multiplyComponents(t,this._oneOverRadii,i)},c.prototype.transformPositionFromScaledSpace=function(t,i){return r(i)||(i=new e),e.multiplyComponents(t,this._radii,i)},c.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c}),i("Core/Event",["./defined","./defineProperties","./DeveloperError"],function(e,t,i){"use strict";function r(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}return t(r.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),r.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);var i=this;return function(){i.removeEventListener(e,t)}},r.prototype.removeEventListener=function(e,t){for(var i=this._listeners,r=this._scopes,n=-1,o=0;o<i.length;o++)if(i[o]===e&&r[o]===t){n=o;break}return-1!==n?(this._insideRaiseEvent?(this._toRemove.push(n),i[n]=void 0,r[n]=void 0):(i.splice(n,1),r.splice(n,1)),!0):!1},r.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;var t,i=this._listeners,r=this._scopes,n=i.length;for(t=0;n>t;t++){var o=i[t];e(o)&&i[t].apply(r[t],arguments)}var a=this._toRemove;for(n=a.length,t=0;n>t;t++){var s=a[t];i.splice(s,1),r.splice(s,1)}a.length=0,this._insideRaiseEvent=!1},r}),i("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n){"use strict";function o(t,i){this.x=e(t,0),this.y=e(i,0)}o.fromElements=function(e,i,r){return t(r)?(r.x=e,r.y=i,r):new o(e,i)},o.clone=function(e,i){return t(e)?t(i)?(i.x=e.x,i.y=e.y,i):new o(e.x,e.y):void 0},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(t,i,r){r=e(r,0),i[r++]=t.x,i[r]=t.y},o.unpack=function(i,r,n){return r=e(r,0),t(n)||(n=new o),n.x=i[r++],n.y=i[r],n},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,i){return i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i},o.maximumByComponent=function(e,t,i){return i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var a=new o;o.distance=function(e,t){return o.subtract(e,t,a),o.magnitude(a)},o.distanceSquared=function(e,t){return o.subtract(e,t,a),o.magnitudeSquared(a)},o.normalize=function(e,t){var i=o.magnitude(e);return t.x=e.x/i,t.y=e.y/i,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,i){return i.x=e.x*t.x,i.y=e.y*t.y,i},o.add=function(e,t,i){return i.x=e.x+t.x,i.y=e.y+t.y,i},o.subtract=function(e,t,i){return i.x=e.x-t.x,i.y=e.y-t.y,i},o.multiplyByScalar=function(e,t,i){return i.x=e.x*t,i.y=e.y*t,i},o.divideByScalar=function(e,t,i){return i.x=e.x/t,i.y=e.y/t,i},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,i,r){return o.multiplyByScalar(t,i,s),r=o.multiplyByScalar(e,1-i,r),o.add(s,r,r)};var l=new o,u=new o;o.angleBetween=function(e,t){return o.normalize(e,l),o.normalize(t,u),n.acosClamped(o.dot(l,u))};var c=new o;return o.mostOrthogonalAxis=function(e,t){var i=o.normalize(e,c);return o.abs(i,i),t=i.x<=i.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,i){return e===i||t(e)&&t(i)&&e.x===i.x&&e.y===i.y},o.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]},o.equalsEpsilon=function(e,i,r,o){return e===i||t(e)&&t(i)&&n.equalsEpsilon(e.x,i.x,r,o)&&n.equalsEpsilon(e.y,i.y,r,o)},o.ZERO=r(new o(0,0)),o.UNIT_X=r(new o(1,0)),o.UNIT_Y=r(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,i){return o.equalsEpsilon(this,e,t,i)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),i("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,i,r,n,o,a){"use strict";function s(e){this._ellipsoid=i(e,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return n(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.prototype.project=function(t,i){var n=this._semimajorAxis,o=t.longitude*n,a=t.latitude*n,s=t.height;return r(i)?(i.x=o,i.y=a,i.z=s,i):new e(o,a,s)},s.prototype.unproject=function(e,i){var n=this._oneOverSemimajorAxis,o=e.x*n,a=e.y*n,s=e.z;return r(i)?(i.longitude=o,i.latitude=a,i.height=s,i):new t(o,a,s)},s}),i("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,i,r,n){this.west=t(e,0),this.south=t(i,0),this.east=t(r,0),this.north=t(n,0)}r(l.prototype,{width:{get:function(){return l.computeWidth(this)}},height:{get:function(){return l.computeHeight(this)}}}),l.packedLength=4,l.pack=function(e,i,r){r=t(r,0),i[r++]=e.west,i[r++]=e.south,i[r++]=e.east,i[r]=e.north},l.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new l),n.west=e[r++],n.south=e[r++],n.east=e[r++],n.north=e[r],n},l.computeWidth=function(e){var t=e.east,i=e.west;return i>t&&(t+=s.TWO_PI),t-i},l.computeHeight=function(e){return e.north-e.south},l.fromDegrees=function(e,r,n,o,a){return e=s.toRadians(t(e,0)),r=s.toRadians(t(r,0)),n=s.toRadians(t(n,0)),o=s.toRadians(t(o,0)),i(a)?(a.west=e,a.south=r,a.east=n,a.north=o,a):new l(e,r,n,o)},l.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,n=-Number.MAX_VALUE,o=Number.MAX_VALUE,a=-Number.MAX_VALUE,u=Number.MAX_VALUE,c=-Number.MAX_VALUE,h=0,d=e.length;d>h;h++){var m=e[h];r=Math.min(r,m.longitude),n=Math.max(n,m.longitude),u=Math.min(u,m.latitude),c=Math.max(c,m.latitude);var p=m.longitude>=0?m.longitude:m.longitude+s.TWO_PI;o=Math.min(o,p),a=Math.max(a,p)}return n-r>a-o&&(r=o,n=a,n>s.PI&&(n-=s.TWO_PI),r>s.PI&&(r-=s.TWO_PI)),i(t)?(t.west=r,t.south=u,t.east=n,t.north=c,t):new l(r,u,n,c)},l.clone=function(e,t){return i(e)?i(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new l(e.west,e.south,e.east,e.north):void 0},l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equals=function(e,t){return e===t||i(e)&&i(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},l.prototype.equalsEpsilon=function(e,t){return i(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},l.validate=function(e){},l.southwest=function(t,r){return i(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},l.northwest=function(t,r){return i(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},l.northeast=function(t,r){return i(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},l.southeast=function(t,r){return i(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},l.center=function(t,r){var n=t.east,o=t.west;o>n&&(n+=s.TWO_PI);var a=s.negativePiToPi(.5*(o+n)),l=.5*(t.south+t.north);return i(r)?(r.longitude=a,r.latitude=l,r.height=0,r):new e(a,l)},l.intersection=function(e,t,r){var n=e.east,o=e.west,a=t.east,u=t.west;o>n&&a>0?n+=s.TWO_PI:u>a&&n>0&&(a+=s.TWO_PI),o>n&&0>u?u+=s.TWO_PI:u>a&&0>o&&(o+=s.TWO_PI);var c=s.negativePiToPi(Math.max(o,u)),h=s.negativePiToPi(Math.min(n,a));if(!((e.west<e.east||t.west<t.east)&&c>=h)){var d=Math.max(e.south,t.south),m=Math.min(e.north,t.north);if(!(d>=m))return i(r)?(r.west=c,r.south=d,r.east=h,r.north=m,r):new l(c,d,h,m)}},l.union=function(e,t,r){return i(r)||(r=new l),r.west=Math.min(e.west,t.west),r.south=Math.min(e.south,t.south),r.east=Math.max(e.east,t.east),r.north=Math.max(e.north,t.north),r},l.expand=function(e,t,r){return i(r)||(r=new l),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},l.contains=function(e,t){var i=t.longitude,r=t.latitude,n=e.west,o=e.east;return n>o&&(o+=s.TWO_PI,0>i&&(i+=s.TWO_PI)),(i>n||s.equalsEpsilon(i,n,s.EPSILON14))&&(o>i||s.equalsEpsilon(i,o,s.EPSILON14))&&r>=e.south&&r<=e.north};var u=new e;return l.subsample=function(e,r,n,a){r=t(r,o.WGS84),n=t(n,0),i(a)||(a=[]);var c=0,h=e.north,d=e.south,m=e.east,p=e.west,f=u;f.height=n,f.longitude=p,f.latitude=h,a[c]=r.cartographicToCartesian(f,a[c]),c++,f.longitude=m,a[c]=r.cartographicToCartesian(f,a[c]),c++,f.latitude=d,a[c]=r.cartographicToCartesian(f,a[c]),c++,f.longitude=p,a[c]=r.cartographicToCartesian(f,a[c]),c++,0>h?f.latitude=h:d>0?f.latitude=d:f.latitude=0;for(var v=1;8>v;++v)f.longitude=-Math.PI+v*s.PI_OVER_TWO,l.contains(e,f)&&(a[c]=r.cartographicToCartesian(f,a[c]),c++);return 0===f.latitude&&(f.longitude=p,a[c]=r.cartographicToCartesian(f,a[c]),c++,f.longitude=m,a[c]=r.cartographicToCartesian(f,a[c]),c++),a.length=c,a},l.MAX_VALUE=a(new l(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),l}),i("Core/GeographicTilingScheme",["./Cartesian2","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./GeographicProjection","./Math","./Rectangle"],function(e,t,i,r,n,o,a,s,l){ +"use strict";function u(e){e=t(e,{}),this._ellipsoid=t(e.ellipsoid,o.WGS84),this._rectangle=t(e.rectangle,l.MAX_VALUE),this._projection=new a(this._ellipsoid),this._numberOfLevelZeroTilesX=t(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=t(e.numberOfLevelZeroTilesY,1)}return r(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),u.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},u.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},u.prototype.rectangleToNativeRectangle=function(e,t){var r=s.toDegrees(e.west),n=s.toDegrees(e.south),o=s.toDegrees(e.east),a=s.toDegrees(e.north);return i(t)?(t.west=r,t.south=n,t.east=o,t.north=a,t):new l(r,n,o,a)},u.prototype.tileXYToNativeRectangle=function(e,t,i,r){var n=this.tileXYToRectangle(e,t,i,r);return n.west=s.toDegrees(n.west),n.south=s.toDegrees(n.south),n.east=s.toDegrees(n.east),n.north=s.toDegrees(n.north),n},u.prototype.tileXYToRectangle=function(e,t,r,n){var o=this._rectangle,a=this.getNumberOfXTilesAtLevel(r),s=this.getNumberOfYTilesAtLevel(r),u=o.width/a,c=e*u+o.west,h=(e+1)*u+o.west,d=o.height/s,m=o.north-t*d,p=o.north-(t+1)*d;return i(n)||(n=new l(c,p,h,m)),n.west=c,n.south=p,n.east=h,n.north=m,n},u.prototype.positionToTileXY=function(t,r,n){var o=this._rectangle;if(l.contains(o,t)){var a=this.getNumberOfXTilesAtLevel(r),u=this.getNumberOfYTilesAtLevel(r),c=o.width/a,h=o.height/u,d=t.longitude;o.east<o.west&&(d+=s.TWO_PI);var m=(d-o.west)/c|0;m>=a&&(m=a-1);var p=(o.north-t.latitude)/h|0;return p>=u&&(p=u-1),i(n)?(n.x=m,n.y=p,n):new e(m,p)}},u}),i("Core/getImagePixels",["./defined"],function(e){"use strict";function t(t,r,n){e(r)||(r=t.width),e(n)||(n=t.height);var o=i[r];e(o)||(o={},i[r]=o);var a=o[n];if(!e(a)){var s=document.createElement("canvas");s.width=r,s.height=n,a=s.getContext("2d"),a.globalCompositeOperation="copy",o[n]=a}return a.drawImage(t,0,0,r,n),a.getImageData(0,0,r,n).data}var i={};return t}),i("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),i("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,i,r,n){"use strict";function o(r,n,o){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(n,e.ZERO)),i(o)?o=e.clone(o):(o=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(o,.5,o)),this.center=o}o.fromPoints=function(t,r){if(i(r)||(r=new o),!i(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var n=t[0].x,a=t[0].y,s=t[0].z,l=t[0].x,u=t[0].y,c=t[0].z,h=t.length,d=1;h>d;d++){var m=t[d],p=m.x,f=m.y,v=m.z;n=Math.min(p,n),l=Math.max(p,l),a=Math.min(f,a),u=Math.max(f,u),s=Math.min(v,s),c=Math.max(v,c)}var g=r.minimum;g.x=n,g.y=a,g.z=s;var _=r.maximum;_.x=l,_.y=u,_.z=c;var y=e.add(g,_,r.center);return e.multiplyByScalar(y,.5,y),r},o.clone=function(t,r){return i(t)?i(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new o(t.minimum,t.maximum):void 0},o.equals=function(t,r){return t===r||i(t)&&i(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var a=new e;return o.intersectPlane=function(t,i){a=e.subtract(t.maximum,t.minimum,a);var r=e.multiplyByScalar(a,.5,a),o=i.normal,s=r.x*Math.abs(o.x)+r.y*Math.abs(o.y)+r.z*Math.abs(o.z),l=e.dot(t.center,o)+i.distance;return l-s>0?n.INSIDE:0>l+s?n.OUTSIDE:n.INTERSECTING},o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.intersectPlane=function(e){return o.intersectPlane(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o}),i("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,i){this.start=e(t,0),this.stop=e(i,0)}return t}),i("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n,o){"use strict";function a(e,i,r,n,o,a,s,l,u){this[0]=t(e,0),this[1]=t(n,0),this[2]=t(s,0),this[3]=t(i,0),this[4]=t(o,0),this[5]=t(l,0),this[6]=t(r,0),this[7]=t(a,0),this[8]=t(u,0)}function s(e){for(var t=0,i=0;9>i;++i){var r=e[i];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,i=0;3>i;++i){var r=e[a.getElementIndex(m[i],d[i])];t+=2*r*r}return Math.sqrt(t)}function u(e,t){for(var i=o.EPSILON15,r=0,n=1,s=0;3>s;++s){var l=Math.abs(e[a.getElementIndex(m[s],d[s])]);l>r&&(n=s,r=l)}var u=1,c=0,h=d[n],p=m[n];if(Math.abs(e[a.getElementIndex(p,h)])>i){var f,v=e[a.getElementIndex(p,p)],g=e[a.getElementIndex(h,h)],_=e[a.getElementIndex(p,h)],y=(v-g)/2/_;f=0>y?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),u=1/Math.sqrt(1+f*f),c=f*u}return t=a.clone(a.IDENTITY,t),t[a.getElementIndex(h,h)]=t[a.getElementIndex(p,p)]=u,t[a.getElementIndex(p,h)]=c,t[a.getElementIndex(h,p)]=-c,t}a.packedLength=9,a.pack=function(e,i,r){r=t(r,0),i[r++]=e[0],i[r++]=e[1],i[r++]=e[2],i[r++]=e[3],i[r++]=e[4],i[r++]=e[5],i[r++]=e[6],i[r++]=e[7],i[r++]=e[8]},a.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new a),n[0]=e[r++],n[1]=e[r++],n[2]=e[r++],n[3]=e[r++],n[4]=e[r++],n[5]=e[r++],n[6]=e[r++],n[7]=e[r++],n[8]=e[r++],n},a.clone=function(e,t){return i(e)?i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new a(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},a.fromArray=function(e,r,n){return r=t(r,0),i(n)||(n=new a),n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],n[8]=e[r+8],n},a.fromColumnMajorArray=function(e,t){return a.clone(e,t)},a.fromRowMajorArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new a(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},a.fromQuaternion=function(e,t){var r=e.x*e.x,n=e.x*e.y,o=e.x*e.z,s=e.x*e.w,l=e.y*e.y,u=e.y*e.z,c=e.y*e.w,h=e.z*e.z,d=e.z*e.w,m=e.w*e.w,p=r-l-h+m,f=2*(n-d),v=2*(o+c),g=2*(n+d),_=-r+l-h+m,y=2*(u-s),C=2*(o-c),E=2*(u+s),S=-r-l+h+m;return i(t)?(t[0]=p,t[1]=g,t[2]=C,t[3]=f,t[4]=_,t[5]=E,t[6]=v,t[7]=y,t[8]=S,t):new a(p,f,v,g,_,y,C,E,S)},a.fromScale=function(e,t){return i(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new a(e.x,0,0,0,e.y,0,0,0,e.z)},a.fromUniformScale=function(e,t){return i(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new a(e,0,0,0,e,0,0,0,e)},a.fromCrossProduct=function(e,t){return i(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new a(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},a.fromRotationX=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=n,t[6]=0,t[7]=-n,t[8]=r,t):new a(1,0,0,0,r,-n,0,n,r)},a.fromRotationY=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=1,t[5]=0,t[6]=n,t[7]=0,t[8]=r,t):new a(r,0,n,0,1,0,-n,0,r)},a.fromRotationZ=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new a(r,-n,0,n,r,0,0,0,1)},a.toArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},a.getElementIndex=function(e,t){return 3*e+t},a.getColumn=function(e,t,i){var r=3*t,n=e[r],o=e[r+1],a=e[r+2];return i.x=n,i.y=o,i.z=a,i},a.setColumn=function(e,t,i,r){r=a.clone(e,r);var n=3*t;return r[n]=i.x,r[n+1]=i.y,r[n+2]=i.z,r},a.getRow=function(e,t,i){var r=e[t],n=e[t+3],o=e[t+6];return i.x=r,i.y=n,i.z=o,i},a.setRow=function(e,t,i,r){return r=a.clone(e,r),r[t]=i.x,r[t+3]=i.y,r[t+6]=i.z,r};var c=new e;a.getScale=function(t,i){return i.x=e.magnitude(e.fromElements(t[0],t[1],t[2],c)),i.y=e.magnitude(e.fromElements(t[3],t[4],t[5],c)),i.z=e.magnitude(e.fromElements(t[6],t[7],t[8],c)),i};var h=new e;a.getMaximumScale=function(t){return a.getScale(t,h),e.maximumComponent(h)},a.multiply=function(e,t,i){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],n=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],o=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],a=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],s=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],l=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],h=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return i[0]=r,i[1]=n,i[2]=o,i[3]=a,i[4]=s,i[5]=l,i[6]=u,i[7]=c,i[8]=h,i},a.add=function(e,t,i){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i[4]=e[4]+t[4],i[5]=e[5]+t[5],i[6]=e[6]+t[6],i[7]=e[7]+t[7],i[8]=e[8]+t[8],i},a.subtract=function(e,t,i){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i[4]=e[4]-t[4],i[5]=e[5]-t[5],i[6]=e[6]-t[6],i[7]=e[7]-t[7],i[8]=e[8]-t[8],i},a.multiplyByVector=function(e,t,i){var r=t.x,n=t.y,o=t.z,a=e[0]*r+e[3]*n+e[6]*o,s=e[1]*r+e[4]*n+e[7]*o,l=e[2]*r+e[5]*n+e[8]*o;return i.x=a,i.y=s,i.z=l,i},a.multiplyByScalar=function(e,t,i){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i[6]=e[6]*t,i[7]=e[7]*t,i[8]=e[8]*t,i},a.multiplyByScale=function(e,t,i){return i[0]=e[0]*t.x,i[1]=e[1]*t.x,i[2]=e[2]*t.x,i[3]=e[3]*t.y,i[4]=e[4]*t.y,i[5]=e[5]*t.y,i[6]=e[6]*t.z,i[7]=e[7]*t.z,i[8]=e[8]*t.z,i},a.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},a.transpose=function(e,t){var i=e[0],r=e[3],n=e[6],o=e[1],a=e[4],s=e[7],l=e[2],u=e[5],c=e[8];return t[0]=i,t[1]=r,t[2]=n,t[3]=o,t[4]=a,t[5]=s,t[6]=l,t[7]=u,t[8]=c,t};var d=[1,0,0],m=[2,2,1],p=new a,f=new a;return a.computeEigenDecomposition=function(e,t){var r=o.EPSILON20,n=10,c=0,h=0;i(t)||(t={});for(var d=t.unitary=a.clone(a.IDENTITY,t.unitary),m=t.diagonal=a.clone(e,t.diagonal),v=r*s(m);n>h&&l(m)>v;)u(m,p),a.transpose(p,f),a.multiply(m,p,m),a.multiply(f,m,m),a.multiply(d,p,d),++c>2&&(++h,c=0);return t},a.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},a.determinant=function(e){var t=e[0],i=e[3],r=e[6],n=e[1],o=e[4],a=e[7],s=e[2],l=e[5],u=e[8];return t*(o*u-l*a)+n*(l*r-i*u)+s*(i*a-o*r)},a.inverse=function(e,t){var i=e[0],n=e[1],s=e[2],l=e[3],u=e[4],c=e[5],h=e[6],d=e[7],m=e[8],p=a.determinant(e);if(Math.abs(p)<=o.EPSILON15)throw new r("matrix is not invertible");t[0]=u*m-d*c,t[1]=d*s-n*m,t[2]=n*c-u*s,t[3]=h*c-l*m,t[4]=i*m-h*s,t[5]=l*s-i*c,t[6]=l*d-h*u,t[7]=h*n-i*d,t[8]=i*u-l*n;var f=1/p;return a.multiplyByScalar(t,f,t)},a.equals=function(e,t){return e===t||i(e)&&i(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},a.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},a.IDENTITY=n(new a(1,0,0,0,1,0,0,0,1)),a.ZERO=n(new a(0,0,0,0,0,0,0,0,0)),a.COLUMN0ROW0=0,a.COLUMN0ROW1=1,a.COLUMN0ROW2=2,a.COLUMN1ROW0=3,a.COLUMN1ROW1=4,a.COLUMN1ROW2=5,a.COLUMN2ROW0=6,a.COLUMN2ROW1=7,a.COLUMN2ROW2=8,a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.equalsArray=function(e,t,i){return e[0]===t[i]&&e[1]===t[i+1]&&e[2]===t[i+2]&&e[3]===t[i+3]&&e[4]===t[i+4]&&e[5]===t[i+5]&&e[6]===t[i+6]&&e[7]===t[i+7]&&e[8]===t[i+8]},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},a}),i("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n){"use strict";function o(t,i,r,n){this.x=e(t,0),this.y=e(i,0),this.z=e(r,0),this.w=e(n,0)}o.fromElements=function(e,i,r,n,a){return t(a)?(a.x=e,a.y=i,a.z=r,a.w=n,a):new o(e,i,r,n)},o.fromColor=function(e,i){return t(i)?(i.x=e.red,i.y=e.green,i.z=e.blue,i.w=e.alpha,i):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,i){return t(e)?t(i)?(i.x=e.x,i.y=e.y,i.z=e.z,i.w=e.w,i):new o(e.x,e.y,e.z,e.w):void 0},o.packedLength=4,o.pack=function(t,i,r){r=e(r,0),i[r++]=t.x,i[r++]=t.y,i[r++]=t.z,i[r]=t.w},o.unpack=function(i,r,n){return r=e(r,0),t(n)||(n=new o),n.x=i[r++],n.y=i[r++],n.z=i[r++],n.w=i[r],n},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,i){return i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i.z=Math.min(e.z,t.z),i.w=Math.min(e.w,t.w),i},o.maximumByComponent=function(e,t,i){return i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i.z=Math.max(e.z,t.z),i.w=Math.max(e.w,t.w),i},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var a=new o;o.distance=function(e,t){return o.subtract(e,t,a),o.magnitude(a)},o.distanceSquared=function(e,t){return o.subtract(e,t,a),o.magnitudeSquared(a)},o.normalize=function(e,t){var i=o.magnitude(e);return t.x=e.x/i,t.y=e.y/i,t.z=e.z/i,t.w=e.w/i,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,i){return i.x=e.x*t.x,i.y=e.y*t.y,i.z=e.z*t.z,i.w=e.w*t.w,i},o.add=function(e,t,i){return i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i.w=e.w+t.w,i},o.subtract=function(e,t,i){return i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i.w=e.w-t.w,i},o.multiplyByScalar=function(e,t,i){return i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i.w=e.w*t,i},o.divideByScalar=function(e,t,i){return i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i.w=e.w/t,i},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,i,r){return o.multiplyByScalar(t,i,s),r=o.multiplyByScalar(e,1-i,r),o.add(s,r,r)};var l=new o;return o.mostOrthogonalAxis=function(e,t){var i=o.normalize(e,l);return o.abs(i,i),t=i.x<=i.y?i.x<=i.z?i.x<=i.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):i.z<=i.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):i.y<=i.z?i.y<=i.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):i.z<=i.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,i){return e===i||t(e)&&t(i)&&e.x===i.x&&e.y===i.y&&e.z===i.z&&e.w===i.w},o.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]&&e.z===t[i+2]&&e.w===t[i+3]},o.equalsEpsilon=function(e,i,r,o){return e===i||t(e)&&t(i)&&n.equalsEpsilon(e.x,i.x,r,o)&&n.equalsEpsilon(e.y,i.y,r,o)&&n.equalsEpsilon(e.z,i.z,r,o)&&n.equalsEpsilon(e.w,i.w,r,o)},o.ZERO=r(new o(0,0,0,0)),o.UNIT_X=r(new o(1,0,0,0)),o.UNIT_Y=r(new o(0,1,0,0)),o.UNIT_Z=r(new o(0,0,1,0)),o.UNIT_W=r(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,i){return o.equalsEpsilon(this,e,t,i)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),i("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(i){t=i.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),i("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e,t,r,n,o,a,s,l,u,c,h,d,m,p,f,v){this[0]=i(e,0),this[1]=i(o,0),this[2]=i(u,0),this[3]=i(m,0),this[4]=i(t,0),this[5]=i(a,0),this[6]=i(c,0),this[7]=i(p,0),this[8]=i(r,0),this[9]=i(s,0),this[10]=i(h,0),this[11]=i(f,0),this[12]=i(n,0),this[13]=i(l,0),this[14]=i(d,0),this[15]=i(v,0)}u.packedLength=16,u.pack=function(e,t,r){r=i(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15]},u.unpack=function(e,t,n){return t=i(t,0),r(n)||(n=new u),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},u.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new u(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15]):void 0},u.fromArray=u.unpack,u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},u.fromRotationTranslation=function(t,n,o){return n=i(n,e.ZERO),r(o)?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=0,o[4]=t[3],o[5]=t[4],o[6]=t[5],o[7]=0,o[8]=t[6],o[9]=t[7],o[10]=t[8],o[11]=0,o[12]=n.x,o[13]=n.y,o[14]=n.z,o[15]=1,o):new u(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},u.fromTranslationQuaternionRotationScale=function(e,t,i,n){r(n)||(n=new u);var o=i.x,a=i.y,s=i.z,l=t.x*t.x,c=t.x*t.y,h=t.x*t.z,d=t.x*t.w,m=t.y*t.y,p=t.y*t.z,f=t.y*t.w,v=t.z*t.z,g=t.z*t.w,_=t.w*t.w,y=l-m-v+_,C=2*(c-g),E=2*(h+f),S=2*(c+g),w=-l+m-v+_,T=2*(p-d),x=2*(h-f),b=2*(p+d),A=-l-m+v+_;return n[0]=y*o,n[1]=S*o,n[2]=x*o,n[3]=0,n[4]=C*a,n[5]=w*a,n[6]=b*a,n[7]=0,n[8]=E*s,n[9]=T*s,n[10]=A*s,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n},u.fromTranslationRotationScale=function(e,t){return u.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},u.fromTranslation=function(e,t){return u.fromRotationTranslation(s.IDENTITY,e,t)},u.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new u(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},u.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new u(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var c=new e,h=new e,d=new e;u.fromCamera=function(t,i){var n=t.eye,o=t.target,a=t.up;e.normalize(e.subtract(o,n,c),c),e.normalize(e.cross(c,a,h),h),e.normalize(e.cross(h,c,d),d);var s=h.x,l=h.y,m=h.z,p=c.x,f=c.y,v=c.z,g=d.x,_=d.y,y=d.z,C=n.x,E=n.y,S=n.z,w=s*-C+l*-E+m*-S,T=g*-C+_*-E+y*-S,x=p*C+f*E+v*S;return r(i)?(i[0]=s,i[1]=g,i[2]=-p,i[3]=0,i[4]=l,i[5]=_,i[6]=-f,i[7]=0,i[8]=m,i[9]=y,i[10]=-v,i[11]=0,i[12]=w,i[13]=T,i[14]=x,i[15]=1,i):new u(s,l,m,w,g,_,y,T,-p,-f,-v,x,0,0,0,1)},u.computePerspectiveFieldOfView=function(e,t,i,r,n){var o=Math.tan(.5*e),a=1/o,s=a/t,l=(r+i)/(i-r),u=2*r*i/(i-r);return n[0]=s,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=a,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=l,n[11]=-1,n[12]=0,n[13]=0,n[14]=u,n[15]=0,n},u.computeOrthographicOffCenter=function(e,t,i,r,n,o,a){var s=1/(t-e),l=1/(r-i),u=1/(o-n),c=-(t+e)*s,h=-(r+i)*l,d=-(o+n)*u;return s*=2,l*=2,u*=-2,a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=u,a[11]=0,a[12]=c,a[13]=h,a[14]=d,a[15]=1,a},u.computePerspectiveOffCenter=function(e,t,i,r,n,o,a){var s=2*n/(t-e),l=2*n/(r-i),u=(t+e)/(t-e),c=(r+i)/(r-i),h=-(o+n)/(o-n),d=-1,m=-2*o*n/(o-n);return a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=u,a[9]=c,a[10]=h,a[11]=d,a[12]=0,a[13]=0,a[14]=m,a[15]=0,a},u.computeInfinitePerspectiveOffCenter=function(e,t,i,r,n,o){var a=2*n/(t-e),s=2*n/(r-i),l=(t+e)/(t-e),u=(r+i)/(r-i),c=-1,h=-1,d=-2*n;return o[0]=a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=l,o[9]=u,o[10]=c,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},u.computeViewportTransformation=function(e,t,r,n){e=i(e,i.EMPTY_OBJECT);var o=i(e.x,0),a=i(e.y,0),s=i(e.width,0),l=i(e.height,0);t=i(t,0),r=i(r,1);var u=.5*s,c=.5*l,h=.5*(r-t),d=u,m=c,p=h,f=o+u,v=a+c,g=t+h,_=1;return n[0]=d,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=m,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=p,n[11]=0,n[12]=f,n[13]=v,n[14]=g,n[15]=_,n},u.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},u.getElementIndex=function(e,t){return 4*e+t},u.getColumn=function(e,t,i){var r=4*t,n=e[r],o=e[r+1],a=e[r+2],s=e[r+3];return i.x=n,i.y=o,i.z=a,i.w=s,i},u.setColumn=function(e,t,i,r){r=u.clone(e,r);var n=4*t;return r[n]=i.x,r[n+1]=i.y,r[n+2]=i.z,r[n+3]=i.w,r},u.setTranslation=function(e,t,i){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=e[15],i},u.getRow=function(e,t,i){var r=e[t],n=e[t+4],o=e[t+8],a=e[t+12];return i.x=r,i.y=n,i.z=o,i.w=a,i},u.setRow=function(e,t,i,r){return r=u.clone(e,r),r[t]=i.x,r[t+4]=i.y,r[t+8]=i.z,r[t+12]=i.w,r};var m=new e;u.getScale=function(t,i){return i.x=e.magnitude(e.fromElements(t[0],t[1],t[2],m)),i.y=e.magnitude(e.fromElements(t[4],t[5],t[6],m)),i.z=e.magnitude(e.fromElements(t[8],t[9],t[10],m)),i};var p=new e;u.getMaximumScale=function(t){return u.getScale(t,p),e.maximumComponent(p)},u.multiply=function(e,t,i){var r=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],d=e[9],m=e[10],p=e[11],f=e[12],v=e[13],g=e[14],_=e[15],y=t[0],C=t[1],E=t[2],S=t[3],w=t[4],T=t[5],x=t[6],b=t[7],A=t[8],P=t[9],I=t[10],M=t[11],D=t[12],R=t[13],O=t[14],N=t[15],L=r*y+s*C+h*E+f*S,F=n*y+l*C+d*E+v*S,B=o*y+u*C+m*E+g*S,V=a*y+c*C+p*E+_*S,k=r*w+s*T+h*x+f*b,z=n*w+l*T+d*x+v*b,U=o*w+u*T+m*x+g*b,G=a*w+c*T+p*x+_*b,W=r*A+s*P+h*I+f*M,H=n*A+l*P+d*I+v*M,q=o*A+u*P+m*I+g*M,j=a*A+c*P+p*I+_*M,Y=r*D+s*R+h*O+f*N,X=n*D+l*R+d*O+v*N,Z=o*D+u*R+m*O+g*N,K=a*D+c*R+p*O+_*N;return i[0]=L,i[1]=F,i[2]=B,i[3]=V,i[4]=k,i[5]=z,i[6]=U,i[7]=G,i[8]=W,i[9]=H,i[10]=q,i[11]=j,i[12]=Y,i[13]=X,i[14]=Z,i[15]=K,i},u.add=function(e,t,i){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i[4]=e[4]+t[4],i[5]=e[5]+t[5],i[6]=e[6]+t[6],i[7]=e[7]+t[7],i[8]=e[8]+t[8],i[9]=e[9]+t[9],i[10]=e[10]+t[10],i[11]=e[11]+t[11],i[12]=e[12]+t[12],i[13]=e[13]+t[13],i[14]=e[14]+t[14],i[15]=e[15]+t[15],i},u.subtract=function(e,t,i){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i[4]=e[4]-t[4],i[5]=e[5]-t[5],i[6]=e[6]-t[6],i[7]=e[7]-t[7],i[8]=e[8]-t[8],i[9]=e[9]-t[9],i[10]=e[10]-t[10],i[11]=e[11]-t[11],i[12]=e[12]-t[12],i[13]=e[13]-t[13],i[14]=e[14]-t[14],i[15]=e[15]-t[15],i},u.multiplyTransformation=function(e,t,i){var r=e[0],n=e[1],o=e[2],a=e[4],s=e[5],l=e[6],u=e[8],c=e[9],h=e[10],d=e[12],m=e[13],p=e[14],f=t[0],v=t[1],g=t[2],_=t[4],y=t[5],C=t[6],E=t[8],S=t[9],w=t[10],T=t[12],x=t[13],b=t[14],A=r*f+a*v+u*g,P=n*f+s*v+c*g,I=o*f+l*v+h*g,M=r*_+a*y+u*C,D=n*_+s*y+c*C,R=o*_+l*y+h*C,O=r*E+a*S+u*w,N=n*E+s*S+c*w,L=o*E+l*S+h*w,F=r*T+a*x+u*b+d,B=n*T+s*x+c*b+m,V=o*T+l*x+h*b+p;return i[0]=A,i[1]=P,i[2]=I,i[3]=0,i[4]=M,i[5]=D,i[6]=R,i[7]=0,i[8]=O,i[9]=N,i[10]=L,i[11]=0,i[12]=F,i[13]=B,i[14]=V,i[15]=1,i},u.multiplyByMatrix3=function(e,t,i){var r=e[0],n=e[1],o=e[2],a=e[4],s=e[5],l=e[6],u=e[8],c=e[9],h=e[10],d=t[0],m=t[1],p=t[2],f=t[3],v=t[4],g=t[5],_=t[6],y=t[7],C=t[8],E=r*d+a*m+u*p,S=n*d+s*m+c*p,w=o*d+l*m+h*p,T=r*f+a*v+u*g,x=n*f+s*v+c*g,b=o*f+l*v+h*g,A=r*_+a*y+u*C,P=n*_+s*y+c*C,I=o*_+l*y+h*C;return i[0]=E,i[1]=S,i[2]=w,i[3]=0,i[4]=T,i[5]=x,i[6]=b,i[7]=0,i[8]=A,i[9]=P,i[10]=I,i[11]=0,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},u.multiplyByTranslation=function(e,t,i){var r=t.x,n=t.y,o=t.z,a=r*e[0]+n*e[4]+o*e[8]+e[12],s=r*e[1]+n*e[5]+o*e[9]+e[13],l=r*e[2]+n*e[6]+o*e[10]+e[14];return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=a,i[13]=s,i[14]=l,i[15]=e[15],i};var f=new e;u.multiplyByUniformScale=function(e,t,i){return f.x=t,f.y=t,f.z=t,u.multiplyByScale(e,f,i)},u.multiplyByScale=function(e,t,i){var r=t.x,n=t.y,o=t.z;return 1===r&&1===n&&1===o?u.clone(e,i):(i[0]=r*e[0],i[1]=r*e[1],i[2]=r*e[2],i[3]=0,i[4]=n*e[4],i[5]=n*e[5],i[6]=n*e[6],i[7]=0,i[8]=o*e[8],i[9]=o*e[9],i[10]=o*e[10],i[11]=0,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=1,i)},u.multiplyByVector=function(e,t,i){var r=t.x,n=t.y,o=t.z,a=t.w,s=e[0]*r+e[4]*n+e[8]*o+e[12]*a,l=e[1]*r+e[5]*n+e[9]*o+e[13]*a,u=e[2]*r+e[6]*n+e[10]*o+e[14]*a,c=e[3]*r+e[7]*n+e[11]*o+e[15]*a;return i.x=s,i.y=l,i.z=u,i.w=c,i},u.multiplyByPointAsVector=function(e,t,i){var r=t.x,n=t.y,o=t.z,a=e[0]*r+e[4]*n+e[8]*o,s=e[1]*r+e[5]*n+e[9]*o,l=e[2]*r+e[6]*n+e[10]*o;return i.x=a,i.y=s,i.z=l,i},u.multiplyByPoint=function(e,t,i){var r=t.x,n=t.y,o=t.z,a=e[0]*r+e[4]*n+e[8]*o+e[12],s=e[1]*r+e[5]*n+e[9]*o+e[13],l=e[2]*r+e[6]*n+e[10]*o+e[14];return i.x=a,i.y=s,i.z=l,i},u.multiplyByScalar=function(e,t,i){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i[6]=e[6]*t,i[7]=e[7]*t,i[8]=e[8]*t,i[9]=e[9]*t,i[10]=e[10]*t,i[11]=e[11]*t,i[12]=e[12]*t,i[13]=e[13]*t,i[14]=e[14]*t,i[15]=e[15]*t,i},u.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},u.transpose=function(e,t){var i=e[1],r=e[2],n=e[3],o=e[6],a=e[7],s=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=i,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[10]=e[10],t[11]=e[14],t[12]=n,t[13]=a,t[14]=s,t[15]=e[15],t},u.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},u.equalsEpsilon=function(e,t,i){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i&&Math.abs(e[4]-t[4])<=i&&Math.abs(e[5]-t[5])<=i&&Math.abs(e[6]-t[6])<=i&&Math.abs(e[7]-t[7])<=i&&Math.abs(e[8]-t[8])<=i&&Math.abs(e[9]-t[9])<=i&&Math.abs(e[10]-t[10])<=i&&Math.abs(e[11]-t[11])<=i&&Math.abs(e[12]-t[12])<=i&&Math.abs(e[13]-t[13])<=i&&Math.abs(e[14]-t[14])<=i&&Math.abs(e[15]-t[15])<=i},u.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},u.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var v=new s,g=new s,_=new t,y=new t(0,0,0,1);return u.inverse=function(e,i){if(s.equalsEpsilon(u.getRotation(e,v),g,a.EPSILON7)&&t.equals(u.getRow(e,3,_),y))return i[0]=0,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=0,i[11]=0,i[12]=-e[12],i[13]=-e[13],i[14]=-e[14],i[15]=1,i;var r=e[0],n=e[4],o=e[8],c=e[12],h=e[1],d=e[5],m=e[9],p=e[13],f=e[2],C=e[6],E=e[10],S=e[14],w=e[3],T=e[7],x=e[11],b=e[15],A=E*b,P=S*x,I=C*b,M=S*T,D=C*x,R=E*T,O=f*b,N=S*w,L=f*x,F=E*w,B=f*T,V=C*w,k=A*d+M*m+D*p-(P*d+I*m+R*p),z=P*h+O*m+F*p-(A*h+N*m+L*p),U=I*h+N*d+B*p-(M*h+O*d+V*p),G=R*h+L*d+V*m-(D*h+F*d+B*m),W=P*n+I*o+R*c-(A*n+M*o+D*c),H=A*r+N*o+L*c-(P*r+O*o+F*c),q=M*r+O*n+V*c-(I*r+N*n+B*c),j=D*r+F*n+B*o-(R*r+L*n+V*o);A=o*p,P=c*m,I=n*p,M=c*d,D=n*m,R=o*d,O=r*p,N=c*h,L=r*m,F=o*h,B=r*d,V=n*h;var Y=A*T+M*x+D*b-(P*T+I*x+R*b),X=P*w+O*x+F*b-(A*w+N*x+L*b),Z=I*w+N*T+B*b-(M*w+O*T+V*b),K=R*w+L*T+V*x-(D*w+F*T+B*x),Q=I*E+R*S+P*C-(D*S+A*C+M*E),J=L*S+A*f+N*E-(O*E+F*S+P*f),$=O*C+V*S+M*f-(B*S+I*f+N*C),ee=B*E+D*f+F*C-(L*C+V*E+R*f),te=r*k+n*z+o*U+c*G;if(Math.abs(te)<a.EPSILON20)throw new l("matrix is not invertible because its determinate is zero.");return te=1/te,i[0]=k*te,i[1]=z*te,i[2]=U*te,i[3]=G*te,i[4]=W*te,i[5]=H*te,i[6]=q*te,i[7]=j*te,i[8]=Y*te,i[9]=X*te,i[10]=Z*te,i[11]=K*te,i[12]=Q*te,i[13]=J*te,i[14]=$*te,i[15]=ee*te,i},u.inverseTransformation=function(e,t){var i=e[0],r=e[1],n=e[2],o=e[4],a=e[5],s=e[6],l=e[8],u=e[9],c=e[10],h=e[12],d=e[13],m=e[14],p=-i*h-r*d-n*m,f=-o*h-a*d-s*m,v=-l*h-u*d-c*m;return t[0]=i,t[1]=o,t[2]=l,t[3]=0,t[4]=r,t[5]=a,t[6]=u,t[7]=0,t[8]=n,t[9]=s,t[10]=c,t[11]=0,t[12]=p,t[13]=f,t[14]=v,t[15]=1,t},u.IDENTITY=o(new u(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),u.ZERO=o(new u(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN0ROW3=3,u.COLUMN1ROW0=4,u.COLUMN1ROW1=5,u.COLUMN1ROW2=6,u.COLUMN1ROW3=7,u.COLUMN2ROW0=8,u.COLUMN2ROW1=9,u.COLUMN2ROW2=10,u.COLUMN2ROW3=11,u.COLUMN3ROW0=12,u.COLUMN3ROW1=13,u.COLUMN3ROW2=14,u.COLUMN3ROW3=15,u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equalsArray=function(e,t,i){return e[0]===t[i]&&e[1]===t[i+1]&&e[2]===t[i+2]&&e[3]===t[i+3]&&e[4]===t[i+4]&&e[5]===t[i+5]&&e[6]===t[i+6]&&e[7]===t[i+7]&&e[8]===t[i+8]&&e[9]===t[i+9]&&e[10]===t[i+10]&&e[11]===t[i+11]&&e[12]===t[i+12]&&e[13]===t[i+13]&&e[14]===t[i+14]&&e[15]===t[i+15]},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},u}),i("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,i,r){"use strict";function n(t,i){this.normal=e.clone(t),this.distance=i}n.fromPointNormal=function(i,r,o){var a=-e.dot(r,i);return t(o)?(e.clone(r,o.normal),o.distance=a,o):new n(r,a)};var o=new e;return n.fromCartesian4=function(i,r){var a=e.fromCartesian4(i,o),s=i.w;return t(r)?(e.clone(a,r.normal),r.distance=s,r):new n(a,s)},n.getPointDistance=function(t,i){return e.dot(t.normal,i)+t.distance},n.ORIGIN_XY_PLANE=r(new n(e.UNIT_Z,0)),n.ORIGIN_YZ_PLANE=r(new n(e.UNIT_X,0)),n.ORIGIN_ZX_PLANE=r(new n(e.UNIT_Y,0)),n}),i("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Plane","./Rectangle"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function m(t,r){this.center=e.clone(i(t,e.ZERO)),this.radius=i(r,0)}var p=new e,f=new e,v=new e,g=new e,_=new e,y=new e,C=new e,E=new e,S=new e,w=new e,T=new e,x=new e;m.fromPoints=function(t,i){if(r(i)||(i=new m),!r(t)||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;for(var n=e.clone(t[0],C),o=e.clone(n,p),a=e.clone(n,f),s=e.clone(n,v),l=e.clone(n,g),u=e.clone(n,_),c=e.clone(n,y),h=t.length,d=1;h>d;d++){e.clone(t[d],n);var b=n.x,A=n.y,P=n.z;b<o.x&&e.clone(n,o),b>l.x&&e.clone(n,l),A<a.y&&e.clone(n,a),A>u.y&&e.clone(n,u),P<s.z&&e.clone(n,s),P>c.z&&e.clone(n,c)}var I=e.magnitudeSquared(e.subtract(l,o,E)),M=e.magnitudeSquared(e.subtract(u,a,E)),D=e.magnitudeSquared(e.subtract(c,s,E)),R=o,O=l,N=I;M>N&&(N=M,R=a,O=u),D>N&&(N=D,R=s,O=c);var L=S;L.x=.5*(R.x+O.x),L.y=.5*(R.y+O.y),L.z=.5*(R.z+O.z);var F=e.magnitudeSquared(e.subtract(O,L,E)),B=Math.sqrt(F),V=w;V.x=o.x,V.y=a.y,V.z=s.z;var k=T;k.x=l.x,k.y=u.y,k.z=c.z;var z=e.multiplyByScalar(e.add(V,k,E),.5,x),U=0;for(d=0;h>d;d++){e.clone(t[d],n);var G=e.magnitude(e.subtract(n,z,E));G>U&&(U=G);var W=e.magnitudeSquared(e.subtract(n,L,E));if(W>F){var H=Math.sqrt(W);B=.5*(B+H),F=B*B;var q=H-B;L.x=(B*L.x+q*n.x)/H,L.y=(B*L.y+q*n.y)/H,L.z=(B*L.z+q*n.z)/H}}return U>B?(e.clone(L,i.center), +i.radius=B):(e.clone(z,i.center),i.radius=U),i};var b=new a,A=new e,P=new e,I=new t,M=new t;m.fromRectangle2D=function(e,t,i){return m.fromRectangleWithHeights2D(e,t,0,0,i)},m.fromRectangleWithHeights2D=function(t,n,o,a,s){if(r(s)||(s=new m),!r(t))return s.center=e.clone(e.ZERO,s.center),s.radius=0,s;n=i(n,b),d.southwest(t,I),I.height=o,d.northeast(t,M),M.height=a;var l=n.project(I,A),u=n.project(M,P),c=u.x-l.x,h=u.y-l.y,p=u.z-l.z;s.radius=.5*Math.sqrt(c*c+h*h+p*p);var f=s.center;return f.x=l.x+.5*c,f.y=l.y+.5*h,f.z=l.z+.5*p,s};var D=[];m.fromRectangle3D=function(e,t,n,a){t=i(t,o.WGS84),n=i(n,0);var s;return r(e)&&(s=d.subsample(e,t,n,D)),m.fromPoints(s,a)},m.fromVertices=function(t,n,o,a){if(r(a)||(a=new m),!r(t)||0===t.length)return a.center=e.clone(e.ZERO,a.center),a.radius=0,a;n=i(n,e.ZERO),o=i(o,3);var s=C;s.x=t[0]+n.x,s.y=t[1]+n.y,s.z=t[2]+n.z;for(var l=e.clone(s,p),u=e.clone(s,f),c=e.clone(s,v),h=e.clone(s,g),d=e.clone(s,_),b=e.clone(s,y),A=t.length,P=0;A>P;P+=o){var I=t[P]+n.x,M=t[P+1]+n.y,D=t[P+2]+n.z;s.x=I,s.y=M,s.z=D,I<l.x&&e.clone(s,l),I>h.x&&e.clone(s,h),M<u.y&&e.clone(s,u),M>d.y&&e.clone(s,d),D<c.z&&e.clone(s,c),D>b.z&&e.clone(s,b)}var R=e.magnitudeSquared(e.subtract(h,l,E)),O=e.magnitudeSquared(e.subtract(d,u,E)),N=e.magnitudeSquared(e.subtract(b,c,E)),L=l,F=h,B=R;O>B&&(B=O,L=u,F=d),N>B&&(B=N,L=c,F=b);var V=S;V.x=.5*(L.x+F.x),V.y=.5*(L.y+F.y),V.z=.5*(L.z+F.z);var k=e.magnitudeSquared(e.subtract(F,V,E)),z=Math.sqrt(k),U=w;U.x=l.x,U.y=u.y,U.z=c.z;var G=T;G.x=h.x,G.y=d.y,G.z=b.z;var W=e.multiplyByScalar(e.add(U,G,E),.5,x),H=0;for(P=0;A>P;P+=o){s.x=t[P]+n.x,s.y=t[P+1]+n.y,s.z=t[P+2]+n.z;var q=e.magnitude(e.subtract(s,W,E));q>H&&(H=q);var j=e.magnitudeSquared(e.subtract(s,V,E));if(j>k){var Y=Math.sqrt(j);z=.5*(z+Y),k=z*z;var X=Y-z;V.x=(z*V.x+X*s.x)/Y,V.y=(z*V.y+X*s.y)/Y,V.z=(z*V.z+X*s.z)/Y}}return H>z?(e.clone(V,a.center),a.radius=z):(e.clone(W,a.center),a.radius=H),a},m.fromEncodedCartesianVertices=function(t,i,n){if(r(n)||(n=new m),!r(t)||!r(i)||t.length!==i.length||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var o=C;o.x=t[0]+i[0],o.y=t[1]+i[1],o.z=t[2]+i[2];for(var a=e.clone(o,p),s=e.clone(o,f),l=e.clone(o,v),u=e.clone(o,g),c=e.clone(o,_),h=e.clone(o,y),d=t.length,b=0;d>b;b+=3){var A=t[b]+i[b],P=t[b+1]+i[b+1],I=t[b+2]+i[b+2];o.x=A,o.y=P,o.z=I,A<a.x&&e.clone(o,a),A>u.x&&e.clone(o,u),P<s.y&&e.clone(o,s),P>c.y&&e.clone(o,c),I<l.z&&e.clone(o,l),I>h.z&&e.clone(o,h)}var M=e.magnitudeSquared(e.subtract(u,a,E)),D=e.magnitudeSquared(e.subtract(c,s,E)),R=e.magnitudeSquared(e.subtract(h,l,E)),O=a,N=u,L=M;D>L&&(L=D,O=s,N=c),R>L&&(L=R,O=l,N=h);var F=S;F.x=.5*(O.x+N.x),F.y=.5*(O.y+N.y),F.z=.5*(O.z+N.z);var B=e.magnitudeSquared(e.subtract(N,F,E)),V=Math.sqrt(B),k=w;k.x=a.x,k.y=s.y,k.z=l.z;var z=T;z.x=u.x,z.y=c.y,z.z=h.z;var U=e.multiplyByScalar(e.add(k,z,E),.5,x),G=0;for(b=0;d>b;b+=3){o.x=t[b]+i[b],o.y=t[b+1]+i[b+1],o.z=t[b+2]+i[b+2];var W=e.magnitude(e.subtract(o,U,E));W>G&&(G=W);var H=e.magnitudeSquared(e.subtract(o,F,E));if(H>B){var q=Math.sqrt(H);V=.5*(V+q),B=V*V;var j=q-V;F.x=(V*F.x+j*o.x)/q,F.y=(V*F.y+j*o.y)/q,F.z=(V*F.z+j*o.z)/q}}return G>V?(e.clone(F,n.center),n.radius=V):(e.clone(U,n.center),n.radius=G),n},m.fromCornerPoints=function(t,i,n){r(n)||(n=new m);var o=n.center;return e.add(t,i,o),e.multiplyByScalar(o,.5,o),n.radius=e.distance(o,i),n},m.fromEllipsoid=function(t,i){return r(i)||(i=new m),e.clone(e.ZERO,i.center),i.radius=t.maximumRadius,i};var R=new e;m.fromBoundingSpheres=function(t,i){if(r(i)||(i=new m),!r(t)||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;var n=t.length;if(1===n)return m.clone(t[0],i);if(2===n)return m.union(t[0],t[1],i);for(var o=[],a=0;n>a;a++)o.push(t[a].center);i=m.fromPoints(o,i);var s=i.center,l=i.radius;for(a=0;n>a;a++){var u=t[a];l=Math.max(l,e.distance(s,u.center,R)+u.radius)}return i.radius=l,i};var O=new e,N=new e,L=new e;m.fromOrientedBoundingBox=function(t,i){r(i)||(i=new m);var n=t.halfAxes,o=u.getColumn(n,0,O),a=u.getColumn(n,1,N),s=u.getColumn(n,2,L),l=e.magnitude(o),c=e.magnitude(a),h=e.magnitude(s);return i.center=e.clone(t.center,i.center),i.radius=Math.max(l,c,h),i},m.clone=function(t,i){return r(t)?r(i)?(i.center=e.clone(t.center,i.center),i.radius=t.radius,i):new m(t.center,t.radius):void 0},m.packedLength=4,m.pack=function(e,t,r){r=i(r,0);var n=e.center;t[r++]=n.x,t[r++]=n.y,t[r++]=n.z,t[r]=e.radius},m.unpack=function(e,t,n){t=i(t,0),r(n)||(n=new m);var o=n.center;return o.x=e[t++],o.y=e[t++],o.z=e[t++],n.radius=e[t],n};var F=new e,B=new e;m.union=function(t,i,n){r(n)||(n=new m);var o=t.center,a=t.radius,s=i.center,l=i.radius,u=e.subtract(s,o,F),c=e.magnitude(u);if(a>=c+l)return t.clone(n),n;if(l>=c+a)return i.clone(n),n;var h=.5*(a+c+l),d=e.multiplyByScalar(u,(-a+h)/c,B);return e.add(d,o,d),e.clone(d,n.center),n.radius=h,n};var V=new e;m.expand=function(t,i,r){r=m.clone(t,r);var n=e.magnitude(e.subtract(i,r.center,V));return n>r.radius&&(r.radius=n),r},m.intersectPlane=function(t,i){var r=t.center,n=t.radius,o=i.normal,a=e.dot(o,r)+i.distance;return-n>a?s.OUTSIDE:n>a?s.INTERSECTING:s.INSIDE},m.transform=function(e,t,i){return r(i)||(i=new m),i.center=c.multiplyByPoint(t,e.center,i.center),i.radius=c.getMaximumScale(t)*e.radius,i};var k=new e;m.distanceSquaredTo=function(t,i){var r=e.subtract(t.center,i,k);return e.magnitudeSquared(r)-t.radius*t.radius},m.transformWithoutScale=function(e,t,i){return r(i)||(i=new m),i.center=c.multiplyByPoint(t,e.center,i.center),i.radius=e.radius,i};var z=new e;m.computePlaneDistances=function(t,i,n,o){r(o)||(o=new l);var a=e.subtract(t.center,i,z),s=e.dot(n,a);return o.start=s-t.radius,o.stop=s+t.radius,o};for(var U=new e,G=new e,W=new e,H=new e,q=new e,j=new t,Y=new Array(8),X=0;8>X;++X)Y[X]=new e;var Z=new a;return m.projectTo2D=function(t,r,n){r=i(r,Z);var o=r.ellipsoid,a=t.center,s=t.radius,l=o.geodeticSurfaceNormal(a,U),u=e.cross(e.UNIT_Z,l,G);e.normalize(u,u);var c=e.cross(l,u,W);e.normalize(c,c),e.multiplyByScalar(l,s,l),e.multiplyByScalar(c,s,c),e.multiplyByScalar(u,s,u);var h=e.negate(c,q),d=e.negate(u,H),p=Y,f=p[0];e.add(l,c,f),e.add(f,u,f),f=p[1],e.add(l,c,f),e.add(f,d,f),f=p[2],e.add(l,h,f),e.add(f,d,f),f=p[3],e.add(l,h,f),e.add(f,u,f),e.negate(l,l),f=p[4],e.add(l,c,f),e.add(f,u,f),f=p[5],e.add(l,c,f),e.add(f,d,f),f=p[6],e.add(l,h,f),e.add(f,d,f),f=p[7],e.add(l,h,f),e.add(f,u,f);for(var v=p.length,g=0;v>g;++g){var _=p[g];e.add(a,_,_);var y=o.cartesianToCartographic(_,j);r.project(y,_)}n=m.fromPoints(p,n),a=n.center;var C=a.x,E=a.y,S=a.z;return a.x=S,a.y=C,a.z=E,n},m.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},m.equals=function(t,i){return t===i||r(t)&&r(i)&&e.equals(t.center,i.center)&&t.radius===i.radius},m.prototype.intersectPlane=function(e){return m.intersectPlane(this,e)},m.prototype.distanceSquaredTo=function(e){return m.distanceSquaredTo(this,e)},m.prototype.computePlaneDistances=function(e,t,i){return m.computePlaneDistances(this,e,t,i)},m.prototype.isOccluded=function(e){return m.isOccluded(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.clone=function(e){return m.clone(this,e)},m}),i("Core/EllipsoidalOccluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Rectangle"],function(e,t,i,r,n,o,a){"use strict";function s(e,i){this._ellipsoid=e,this._cameraPosition=new t,this._cameraPositionInScaledSpace=new t,this._distanceToLimbInScaledSpaceSquared=0,r(i)&&(this.cameraPosition=i)}function l(e,i,r){var n=e.transformPositionToScaledSpace(i,p),o=t.magnitudeSquared(n),a=Math.sqrt(o),s=t.divideByScalar(n,a,f);o=Math.max(1,o),a=Math.max(1,a);var l=t.dot(s,r),u=t.magnitude(t.cross(s,r,s)),c=1/a,h=Math.sqrt(o-1)*c;return 1/(l*c-u*h)}function u(e,i,r){return 0>=i||i===1/0||i!==i?void 0:t.multiplyByScalar(e,i,r)}function c(e,i){return e.transformPositionToScaledSpace(i,v),t.normalize(v,v)}n(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){var i=this._ellipsoid,r=i.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),n=t.magnitudeSquared(r)-1;t.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=r,this._distanceToLimbInScaledSpaceSquared=n}}});var h=new t;s.prototype.isPointVisible=function(e){var t=this._ellipsoid,i=t.transformPositionToScaledSpace(e,h);return this.isScaledSpacePointVisible(i)},s.prototype.isScaledSpacePointVisible=function(e){var i=this._cameraPositionInScaledSpace,r=this._distanceToLimbInScaledSpaceSquared,n=t.subtract(e,i,h),o=-t.dot(n,i),a=0>r?o>0:o>r&&o*o/t.magnitudeSquared(n)>r;return!a},s.prototype.computeHorizonCullingPoint=function(e,i,n){r(n)||(n=new t);for(var o=this._ellipsoid,a=c(o,e),s=0,h=0,d=i.length;d>h;++h){var m=i[h],p=l(o,m,a);s=Math.max(s,p)}return u(a,s,n)};var d=new t;s.prototype.computeHorizonCullingPointFromVertices=function(e,n,o,a,s){r(s)||(s=new t),a=i(a,t.ZERO);for(var h=this._ellipsoid,m=c(h,e),p=0,f=0,v=n.length;v>f;f+=o){d.x=n[f]+a.x,d.y=n[f+1]+a.y,d.z=n[f+2]+a.z;var g=l(h,d,m);p=Math.max(p,g)}return u(m,p,s)},s.prototype.computeHorizonCullingPointFromPoints=function(e,i,n){r(n)||(n=new t);for(var o=this._ellipsoid,a=c(o,e),s=0,h=0,d=i.length;d>h;++h){var m=l(o,i[h],a);s=Math.max(s,m)}return u(a,s,n)};var m=[];s.prototype.computeHorizonCullingPointFromRectangle=function(i,r,n){var o=a.subsample(i,r,0,m),s=e.fromPoints(o);return t.magnitude(s.center)<.1*r.minimumRadius?void 0:this.computeHorizonCullingPoint(s.center,o,n)};var p=new t,f=new t,v=new t;return s}),i("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function i(e,i,r){var n=e+i;return t.sign(e)!==t.sign(i)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(i)))<r?0:n}var r={};return r.computeDiscriminant=function(e,t,i){var r=t*t-4*e*i;return r},r.computeRealRoots=function(e,r,n){var o;if(0===e)return 0===r?[]:[-n/r];if(0===r){if(0===n)return[0,0];var a=Math.abs(n),s=Math.abs(e);if(s>a&&a/s<t.EPSILON14)return[0,0];if(a>s&&s/a<t.EPSILON14)return[];if(o=-n/e,0>o)return[];var l=Math.sqrt(o);return[-l,l]}if(0===n)return o=-r/e,0>o?[o,0]:[0,o];var u=r*r,c=4*e*n,h=i(u,-c,t.EPSILON14);if(0>h)return[];var d=-.5*i(r,t.sign(r)*Math.sqrt(h),t.EPSILON14);return r>0?[d/e,n/d]:[n/d,d/e]},r}),i("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function i(e,t,i,r){var n,o,a=e,s=t/3,l=i/3,u=r,c=a*l,h=s*u,d=s*s,m=l*l,p=a*l-d,f=a*u-s*l,v=s*u-m,g=4*p*v-f*f;if(0>g){var _,y,C;d*h>=c*m?(_=a,y=p,C=-2*s*p+a*f):(_=u,y=v,C=-u*f+2*l*v);var E=0>C?-1:1,S=-E*Math.abs(_)*Math.sqrt(-g);o=-C+S;var w=o/2,T=0>w?-Math.pow(-w,1/3):Math.pow(w,1/3),x=o===S?-T:-y/T;return n=0>=y?T+x:-C/(T*T+x*x+y),d*h>=c*m?[(n-s)/a]:[-u/(n+l)]}var b=p,A=-2*s*p+a*f,P=v,I=-u*f+2*l*v,M=Math.sqrt(g),D=Math.sqrt(3)/2,R=Math.abs(Math.atan2(a*M,-A)/3);n=2*Math.sqrt(-b);var O=Math.cos(R);o=n*O;var N=n*(-O/2-D*Math.sin(R)),L=o+N>2*s?o-s:N-s,F=a,B=L/F;R=Math.abs(Math.atan2(u*M,-I)/3),n=2*Math.sqrt(-P),O=Math.cos(R),o=n*O,N=n*(-O/2-D*Math.sin(R));var V=-u,k=2*l>o+N?o+l:N+l,z=V/k,U=F*k,G=-L*k-F*V,W=L*V,H=(l*G-s*W)/(-s*G+l*U);return H>=B?z>=B?z>=H?[B,H,z]:[B,z,H]:[z,B,H]:z>=B?[H,B,z]:z>=H?[H,z,B]:[z,H,B]}var r={};return r.computeDiscriminant=function(e,t,i,r){var n=e*e,o=t*t,a=i*i,s=r*r,l=18*e*t*i*r+o*a-27*n*s-4*(e*a*i+o*t*r);return l},r.computeRealRoots=function(e,r,n,o){var a,s;if(0===e)return t.computeRealRoots(r,n,o);if(0===r){if(0===n){if(0===o)return[0,0,0];s=-o/e;var l=0>s?-Math.pow(-s,1/3):Math.pow(s,1/3);return[l,l,l]}return 0===o?(a=t.computeRealRoots(e,0,n),0===a.Length?[0]:[a[0],0,a[1]]):i(e,0,n,o)}return 0===n?0===o?(s=-r/e,0>s?[s,0,0]:[0,0,s]):i(e,r,0,o):0===o?(a=t.computeRealRoots(e,r,n),0===a.length?[0]:a[1]<=0?[a[0],a[1],0]:a[0]>=0?[0,a[0],a[1]]:[a[0],0,a[1]]):i(e,r,n,o)},r}),i("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,i,r){"use strict";function n(t,n,o,a){var s=t*t,l=n-3*s/8,u=o-n*t/2+s*t/8,c=a-o*t/4+n*s/16-3*s*s/256,h=e.computeRealRoots(1,2*l,l*l-4*c,-u*u);if(h.length>0){var d=-t/4,m=h[h.length-1];if(Math.abs(m)<i.EPSILON14){var p=r.computeRealRoots(1,l,c);if(2===p.length){var f,v=p[0],g=p[1];if(v>=0&&g>=0){var _=Math.sqrt(v),y=Math.sqrt(g);return[d-y,d-_,d+_,d+y]}if(v>=0&&0>g)return f=Math.sqrt(v),[d-f,d+f];if(0>v&&g>=0)return f=Math.sqrt(g),[d-f,d+f]}return[]}if(m>0){var C=Math.sqrt(m),E=(l+m-u/C)/2,S=(l+m+u/C)/2,w=r.computeRealRoots(1,C,E),T=r.computeRealRoots(1,-C,S);return 0!==w.length?(w[0]+=d,w[1]+=d,0!==T.length?(T[0]+=d,T[1]+=d,w[1]<=T[0]?[w[0],w[1],T[0],T[1]]:T[1]<=w[0]?[T[0],T[1],w[0],w[1]]:w[0]>=T[0]&&w[1]<=T[1]?[T[0],w[0],w[1],T[1]]:T[0]>=w[0]&&T[1]<=w[1]?[w[0],T[0],T[1],w[1]]:w[0]>T[0]&&w[0]<T[1]?[T[0],w[0],T[1],w[1]]:[w[0],T[0],w[1],T[1]]):w):0!==T.length?(T[0]+=d,T[1]+=d,T):[]}}return[]}function o(t,n,o,a){var s=o*o,l=n*n,u=t*t,c=-2*n,h=o*t+l-4*a,d=u*a-o*n*t+s,m=e.computeRealRoots(1,c,h,d);if(m.length>0){var p,f,v=m[0],g=n-v,_=g*g,y=t/2,C=g/2,E=_-4*a,S=_+4*Math.abs(a),w=u-4*v,T=u+4*Math.abs(v);if(0>v||w*S>E*T){var x=Math.sqrt(w);p=x/2,f=0===x?0:(t*C-o)/x}else{var b=Math.sqrt(E);p=0===b?0:(t*C-o)/b,f=b/2}var A,P;0===y&&0===p?(A=0,P=0):i.sign(y)===i.sign(p)?(A=y+p,P=v/A):(P=y-p,A=v/P);var I,M;0===C&&0===f?(I=0,M=0):i.sign(C)===i.sign(f)?(I=C+f,M=a/I):(M=C-f,I=a/M);var D=r.computeRealRoots(1,A,I),R=r.computeRealRoots(1,P,M);if(0!==D.length)return 0!==R.length?D[1]<=R[0]?[D[0],D[1],R[0],R[1]]:R[1]<=D[0]?[R[0],R[1],D[0],D[1]]:D[0]>=R[0]&&D[1]<=R[1]?[R[0],D[0],D[1],R[1]]:R[0]>=D[0]&&R[1]<=D[1]?[D[0],R[0],R[1],D[1]]:D[0]>R[0]&&D[0]<R[1]?[R[0],D[0],R[1],D[1]]:[D[0],R[0],D[1],R[1]]:D;if(0!==R.length)return R}return[]}var a={};return a.computeDiscriminant=function(e,t,i,r,n){var o=e*e,a=o*e,s=t*t,l=s*t,u=i*i,c=u*i,h=r*r,d=h*r,m=n*n,p=m*n,f=s*u*h-4*l*d-4*e*c*h+18*e*t*i*d-27*o*h*h+256*a*p+n*(18*l*i*r-4*s*c+16*e*u*u-80*e*t*u*r-6*e*s*h+144*o*i*h)+m*(144*e*s*i-27*s*s-128*o*u-192*o*t*r);return f},a.computeRealRoots=function(t,r,a,s,l){if(Math.abs(t)<i.EPSILON15)return e.computeRealRoots(r,a,s,l);var u=r/t,c=a/t,h=s/t,d=l/t,m=0>u?1:0;switch(m+=0>c?m+1:m,m+=0>h?m+1:m,m+=0>d?m+1:m){case 0:return n(u,c,h,d);case 1:return o(u,c,h,d);case 2:return o(u,c,h,d);case 3:return n(u,c,h,d);case 4:return n(u,c,h,d);case 5:return o(u,c,h,d);case 6:return n(u,c,h,d);case 7:return n(u,c,h,d);case 8:return o(u,c,h,d);case 9:return n(u,c,h,d);case 10:return n(u,c,h,d);case 11:return o(u,c,h,d);case 12:return n(u,c,h,d);case 13:return n(u,c,h,d);case 14:return n(u,c,h,d);case 15:return n(u,c,h,d);default:return}},a}),i("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r){"use strict";function n(i,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(i,e.ZERO)),this.direction=r}return n.getPoint=function(t,r,n){return i(n)||(n=new e),n=e.multiplyByScalar(t.direction,r,n),e.add(t.origin,n,n)},n}),i("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t,r,n,a,s){s=i(s,!1);var l,u,c,h,d,m=t.origin,p=t.direction,f=e.subtract(n,r,v),E=e.subtract(a,r,g),S=e.cross(p,E,_),w=e.dot(f,S);if(s){if(w<o.EPSILON6)return;if(l=e.subtract(m,r,y),c=e.dot(l,S),0>c||c>w)return;if(u=e.cross(l,f,C),h=e.dot(p,u),0>h||c+h>w)return;d=e.dot(E,u)/w}else{if(Math.abs(w)<o.EPSILON6)return;var T=1/w;if(l=e.subtract(m,r,y),c=e.dot(l,S)*T,0>c||c>1)return;if(u=e.cross(l,f,C),h=e.dot(p,u)*T,0>h||c+h>1)return;d=e.dot(E,u)*T}return d}function h(e,t,i,r){var n=t*t-4*e*i;if(!(0>n)){if(n>0){var o=1/(2*e),a=Math.sqrt(n),s=(-t+a)*o,l=(-t-a)*o;return l>s?(r.root0=s,r.root1=l):(r.root0=l,r.root1=s),r}var u=-t/(2*e);if(0!==u)return r.root0=r.root1=u,r}}function d(t,i,n){r(n)||(n={});var o=t.origin,a=t.direction,s=i.center,l=i.radius*i.radius,u=e.subtract(o,s,_),c=e.dot(a,a),d=2*e.dot(a,u),m=e.magnitudeSquared(u)-l,p=h(c,d,m,S);return r(p)?(n.start=p.root0,n.stop=p.root1,n):void 0}function m(e,t,i){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<i?0:r}function p(t,i,r,n,u){var c,h=n*n,d=u*u,p=(t[a.COLUMN1ROW1]-t[a.COLUMN2ROW2])*d,f=u*(n*m(t[a.COLUMN1ROW0],t[a.COLUMN0ROW1],o.EPSILON15)+i.y),v=t[a.COLUMN0ROW0]*h+t[a.COLUMN2ROW2]*d+n*i.x+r,g=d*m(t[a.COLUMN2ROW1],t[a.COLUMN1ROW2],o.EPSILON15),_=u*(n*m(t[a.COLUMN2ROW0],t[a.COLUMN0ROW2])+i.z),y=[];if(0===_&&0===g){if(c=s.computeRealRoots(p,f,v),0===c.length)return y;var C=c[0],E=Math.sqrt(Math.max(1-C*C,0));if(y.push(new e(n,u*C,u*-E)),y.push(new e(n,u*C,u*E)),2===c.length){var S=c[1],w=Math.sqrt(Math.max(1-S*S,0));y.push(new e(n,u*S,u*-w)),y.push(new e(n,u*S,u*w))}return y}var T=_*_,x=g*g,b=p*p,A=_*g,P=b+x,I=2*(f*p+A),M=2*v*p+f*f-x+T,D=2*(v*f-A),R=v*v-T;if(0===P&&0===I&&0===M&&0===D)return y;c=l.computeRealRoots(P,I,M,D,R);var O=c.length;if(0===O)return y;for(var N=0;O>N;++N){var L,F=c[N],B=F*F,V=Math.max(1-B,0),k=Math.sqrt(V);L=o.sign(p)===o.sign(v)?m(p*B+v,f*F,o.EPSILON12):o.sign(v)===o.sign(f*F)?m(p*B,f*F+v,o.EPSILON12):m(p*B+f*F,v,o.EPSILON12);var z=m(g*F,_,o.EPSILON15),U=L*z;0>U?y.push(new e(n,u*F,u*k)):U>0?y.push(new e(n,u*F,u*-k)):0!==k?(y.push(new e(n,u*F,u*-k)),y.push(new e(n,u*F,u*k)),++N):y.push(new e(n,u*F,u*k))}return y}var f={};f.rayPlane=function(t,i,n){r(n)||(n=new e);var a=t.origin,s=t.direction,l=i.normal,u=e.dot(l,s);if(!(Math.abs(u)<o.EPSILON15)){var c=(-i.distance-e.dot(l,a))/u;if(!(0>c))return n=e.multiplyByScalar(s,c,n),e.add(a,n,n)}};var v=new e,g=new e,_=new e,y=new e,C=new e;f.rayTriangle=function(t,i,n,o,a,s){var l=c(t,i,n,o,a);if(r(l)&&!(0>l))return r(s)||(s=new e),e.multiplyByScalar(t.direction,l,s),e.add(t.origin,s,s)};var E=new u;f.lineSegmentTriangle=function(t,i,n,o,a,s,l){var u=E;e.clone(t,u.origin),e.subtract(i,t,u.direction),e.normalize(u.direction,u.direction);var h=c(u,n,o,a,s);return!r(h)||0>h||h>e.distance(t,i)?void 0:(r(l)||(l=new e),e.multiplyByScalar(u.direction,h,l),e.add(u.origin,l,l))};var S={root0:0,root1:0};f.raySphere=function(e,t,i){return i=d(e,t,i),!r(i)||i.stop<0?void 0:(i.start=Math.max(i.start,0),i)};var w=new u;f.lineSegmentSphere=function(t,i,n,o){var a=w,s=e.subtract(i,t,a.direction),l=e.magnitude(s);return e.normalize(s,s),o=d(a,n,o),!r(o)||o.stop<0||o.start>l?void 0:(o.start=Math.max(o.start,0),o.stop=Math.min(o.stop,l),o)};var T=new e,x=new e;f.rayEllipsoid=function(t,i){var r,n,o,a,s,l=i.oneOverRadii,u=e.multiplyComponents(l,t.origin,T),c=e.multiplyComponents(l,t.direction,x),h=e.magnitudeSquared(u),d=e.dot(u,c);if(h>1){if(d>=0)return;var m=d*d;if(r=h-1,n=e.magnitudeSquared(c),o=n*r,o>m)return;if(m>o){a=d*d-o,s=-d+Math.sqrt(a);var p=s/n,f=r/s;return f>p?{start:p,stop:f}:{start:f,stop:p}}var v=Math.sqrt(r/n);return{start:v,stop:v}}return 1>h?(r=h-1,n=e.magnitudeSquared(c),o=n*r,a=d*d-o,s=-d+Math.sqrt(a),{start:0,stop:s/n}):0>d?(n=e.magnitudeSquared(c),{start:0,stop:-d/n}):void 0};var b=new e,A=new e,P=new e,I=new e,M=new e,D=new a,R=new a,O=new a,N=new a,L=new a,F=new a,B=new a,V=new e,k=new e,z=new t;f.grazingAltitudeLocation=function(t,i){var n=t.origin,s=t.direction,l=i.geodeticSurfaceNormal(n,b);if(e.dot(s,l)>=0)return n;var u=r(this.rayEllipsoid(t,i)),c=i.transformPositionToScaledSpace(s,b),h=e.normalize(c,c),d=e.mostOrthogonalAxis(c,I),m=e.normalize(e.cross(d,h,A),A),f=e.normalize(e.cross(h,m,P),P),v=D;v[0]=h.x,v[1]=h.y,v[2]=h.z,v[3]=m.x,v[4]=m.y,v[5]=m.z,v[6]=f.x,v[7]=f.y,v[8]=f.z;var g=a.transpose(v,R),_=a.fromScale(i.radii,O),y=a.fromScale(i.oneOverRadii,N),C=L;C[0]=0,C[1]=-s.z,C[2]=s.y,C[3]=s.z,C[4]=0,C[5]=-s.x,C[6]=-s.y,C[7]=s.x,C[8]=0;var E,S,w=a.multiply(a.multiply(g,y,F),C,F),T=a.multiply(a.multiply(w,_,B),v,B),x=a.multiplyByVector(w,n,M),U=p(T,e.negate(x,b),0,0,1),G=U.length;if(G>0){for(var W=e.clone(e.ZERO,k),H=Number.NEGATIVE_INFINITY,q=0;G>q;++q){E=a.multiplyByVector(_,a.multiplyByVector(v,U[q],V),V);var j=e.normalize(e.subtract(E,n,I),I),Y=e.dot(j,s);Y>H&&(H=Y,W=e.clone(E,W))}var X=i.cartesianToCartographic(W,z);return H=o.clamp(H,0,1),S=e.magnitude(e.subtract(W,n,I))*Math.sqrt(1-H*H),S=u?-S:S,X.height=S,i.cartographicToCartesian(X,new e)}};var U=new e;return f.lineSegmentPlane=function(t,i,n,a){r(a)||(a=new e);var s=e.subtract(i,t,U),l=n.normal,u=e.dot(l,s);if(!(Math.abs(u)<o.EPSILON6)){var c=e.dot(l,t),h=-(n.distance+c)/u;if(!(0>h||h>1))return e.multiplyByScalar(s,h,a),e.add(t,a,a),a}},f.trianglePlaneIntersection=function(t,i,r,n){var o=n.normal,a=n.distance,s=e.dot(o,t)+a<0,l=e.dot(o,i)+a<0,u=e.dot(o,r)+a<0,c=0;c+=s?1:0,c+=l?1:0,c+=u?1:0;var h,d;if((1===c||2===c)&&(h=new e,d=new e),1===c){if(s)return f.lineSegmentPlane(t,i,n,h),f.lineSegmentPlane(t,r,n,d),{positions:[t,i,r,h,d],indices:[0,3,4,1,2,4,1,4,3]};if(l)return f.lineSegmentPlane(i,r,n,h),f.lineSegmentPlane(i,t,n,d),{positions:[t,i,r,h,d],indices:[1,3,4,2,0,4,2,4,3]};if(u)return f.lineSegmentPlane(r,t,n,h),f.lineSegmentPlane(r,i,n,d),{positions:[t,i,r,h,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===c){if(!s)return f.lineSegmentPlane(i,t,n,h),f.lineSegmentPlane(r,t,n,d),{positions:[t,i,r,h,d],indices:[1,2,4,1,4,3,0,3,4]};if(!l)return f.lineSegmentPlane(r,i,n,h),f.lineSegmentPlane(t,i,n,d),{positions:[t,i,r,h,d],indices:[2,0,4,2,4,3,1,3,4]};if(!u)return f.lineSegmentPlane(t,r,n,h),f.lineSegmentPlane(i,r,n,d),{positions:[t,i,r,h,d],indices:[0,1,4,0,4,3,2,3,4]}}},f}),i("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function i(e,t,i){for(var r,n,o=0,a=e.length-1;a>=o;)if(r=~~((o+a)/2),n=i(e[r],t),0>n)o=r+1;else{if(!(n>0))return r;a=r-1}return~(a+1)}return i}),i("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,i,r,n){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=i,this.yPoleOffset=r,this.ut1MinusUtc=n}return e}),i("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,i=0,r=t[i++],n=function(e,t,i,r){i||(i=" ");var n=e.length>=t?"":Array(1+t-e.length>>>0).join(i);return r?e+n:n+e},o=function(e,t,i,r,o,a){var s=r-e.length;return s>0&&(e=i||!o?n(e,r,a,i):e.slice(0,t.length)+n("",s,"0",!0)+e.slice(t.length)),e},a=function(e,t,i,r,a,s,l){var u=e>>>0;return i=i&&u&&{2:"0b",8:"0",16:"0x"}[t]||"",e=i+n(u.toString(t),s||0,"0",!1),o(e,i,r,a,l)},s=function(e,t,i,r,n,a){return null!=r&&(e=e.slice(0,r)),o(e,"",t,i,n,a)},l=function(e,r,l,u,c,h,d){var m,p,f,v,g;if("%%"==e)return"%";for(var _=!1,y="",C=!1,E=!1,S=" ",w=l.length,T=0;l&&w>T;T++)switch(l.charAt(T)){case" ":y=" ";break;case"+":y="+";break;case"-":_=!0;break;case"'":S=l.charAt(T+1);break;case"0":C=!0;break;case"#":E=!0}if(u=u?"*"==u?+t[i++]:"*"==u.charAt(0)?+t[u.slice(1,-1)]:+u:0,0>u&&(u=-u,_=!0),!isFinite(u))throw new Error("sprintf: (minimum-)width must be finite");switch(h=h?"*"==h?+t[i++]:"*"==h.charAt(0)?+t[h.slice(1,-1)]:+h:"fFeE".indexOf(d)>-1?6:"d"==d?0:void 0,g=r?t[r.slice(0,-1)]:t[i++],d){case"s":return s(String(g),_,u,h,C,S);case"c":return s(String.fromCharCode(+g),_,u,h,C);case"b":return a(g,2,E,_,u,h,C);case"o":return a(g,8,E,_,u,h,C);case"x":return a(g,16,E,_,u,h,C);case"X":return a(g,16,E,_,u,h,C).toUpperCase();case"u":return a(g,10,E,_,u,h,C);case"i":case"d":return m=+g||0,m=Math.round(m-m%1),p=0>m?"-":y,g=p+n(String(Math.abs(m)),h,"0",!1),o(g,p,_,u,C);case"e":case"E":case"f":case"F":case"g":case"G":return m=+g,p=0>m?"-":y,f=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],v=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],g=p+Math.abs(m)[f](h),o(g,p,_,u,C)[v]();default:return e}};return r.replace(e,l)}return e}),i("Core/GregorianDate",[],function(){"use strict";function e(e,t,i,r,n,o,a,s){this.year=e,this.month=t,this.day=i,this.hour=r,this.minute=n,this.second=o,this.millisecond=a,this.isLeapSecond=s}return e}),i("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),i("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),i("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={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};return e(t)}),i("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),i("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,t){return f.compare(e.julianDate,t.julianDate)}function h(e){y.julianDate=e;var i=f.leapSeconds,r=t(i,y,c);0>r&&(r=~r),r>=i.length&&(r=i.length-1);var n=i[r].offset;if(r>0){var o=f.secondsDifference(i[r].julianDate,e);o>n&&(r--,n=i[r].offset)}f.addSeconds(e,n,e)}function d(e,i){y.julianDate=e;var r=f.leapSeconds,n=t(r,y,c);if(0>n&&(n=~n),0===n)return f.addSeconds(e,-r[0].offset,i);if(n>=r.length)return f.addSeconds(e,-r[n-1].offset,i);var o=f.secondsDifference(r[n].julianDate,e);return 0===o?f.addSeconds(e,-r[n].offset,i):1>=o?void 0:f.addSeconds(e,-r[--n].offset,i)}function m(e,t,i){var r=t/l.SECONDS_PER_DAY|0;return e+=r,t-=l.SECONDS_PER_DAY*r,0>t&&(e--,t+=l.SECONDS_PER_DAY),i.dayNumber=e,i.secondsOfDay=t,i}function p(e,t,i,r,n,o,a){var s=(t-14)/12|0,u=e+4800+s,c=(1461*u/4|0)+(367*(t-2-12*s)/12|0)-(3*((u+100)/100|0)/4|0)+i-32075;r-=12,0>r&&(r+=24);var h=o+(r*l.SECONDS_PER_HOUR+n*l.SECONDS_PER_MINUTE+a*l.SECONDS_PER_MILLISECOND);return h>=43200&&(c-=1),[c,h]}function f(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=i(e,0),t=i(t,0),r=i(r,u.UTC);var n=0|e;t+=(e-n)*l.SECONDS_PER_DAY,m(n,t,this),r===u.UTC&&h(this)}var v=new o,g=[31,28,31,30,31,30,31,31,30,31,30,31],_=29,y=new s,C=/^(\d{4})$/,E=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,w=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,T=/^(\d{4})-?(\d{2})-?(\d{2})$/,x=/([Z+\-])?(\d{2})?:?(\d{2})?$/,b=/^(\d{2})(\.\d+)?/.source+x.source,A=/^(\d{2}):?(\d{2})(\.\d+)?/.source+x.source,P=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+x.source,I="Invalid ISO 8601 date.";f.fromDate=function(e,t){var i=p(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(m(i[0],i[1],t),h(t),t):new f(i[0],i[1],u.UTC)},f.fromIso8601=function(e,t){e=e.replace(",",".");var i,o,s,l=e.split("T"),c=1,d=1,v=0,y=0,x=0,M=0,D=l[0],R=l[1];if(!r(D))throw new n(I);var O;if(l=D.match(T),null!==l){if(O=D.split("-").length-1,O>0&&2!==O)throw new n(I);i=+l[1],c=+l[2],d=+l[3]}else if(l=D.match(E),null!==l)i=+l[1],c=+l[2];else if(l=D.match(C),null!==l)i=+l[1];else{var N;if(l=D.match(S),null!==l){if(i=+l[1],N=+l[2],s=a(i),1>N||s&&N>366||!s&&N>365)throw new n(I)}else{if(l=D.match(w),null===l)throw new n(I);i=+l[1];var L=+l[2],F=+l[3]||0;if(O=D.split("-").length-1,O>0&&(!r(l[3])&&1!==O||r(l[3])&&2!==O))throw new n(I);var B=new Date(Date.UTC(i,0,4));N=7*L+F-B.getUTCDay()-3}o=new Date(Date.UTC(i,0,1)),o.setUTCDate(N),c=o.getUTCMonth()+1,d=o.getUTCDate()}if(s=a(i),1>c||c>12||1>d||(2!==c||!s)&&d>g[c-1]||s&&2===c&&d>_)throw new n(I);var V;if(r(R)){if(l=R.match(P),null!==l){if(O=R.split(":").length-1,O>0&&2!==O&&3!==O)throw new n(I);v=+l[1],y=+l[2],x=+l[3],M=1e3*+(l[4]||0),V=5}else if(l=R.match(A),null!==l){if(O=R.split(":").length-1,O>2)throw new n(I);v=+l[1],y=+l[2],x=60*+(l[3]||0),V=4}else{if(l=R.match(b),null===l)throw new n(I);v=+l[1],y=60*+(l[2]||0),V=3}if(y>=60||x>=61||v>24||24===v&&(y>0||x>0||M>0))throw new n(I);var k=l[V],z=+l[V+1],U=+(l[V+2]||0);switch(k){case"+":v-=z,y-=U;break;case"-":v+=z,y+=U;break;case"Z":break;default:y+=new Date(Date.UTC(i,c-1,d,v,y)).getTimezoneOffset()}}else y+=new Date(i,c-1,d).getTimezoneOffset();var G=60===x;for(G&&x--;y>=60;)y-=60,v++;for(;v>=24;)v-=24,d++;for(o=s&&2===c?_:g[c-1];d>o;)d-=o,c++,c>12&&(c-=12,i++),o=s&&2===c?_:g[c-1];for(;0>y;)y+=60,v--;for(;0>v;)v+=24,d--;for(;1>d;)c--,1>c&&(c+=12,i--),o=s&&2===c?_:g[c-1],d+=o;var W=p(i,c,d,v,y,x,M);return r(t)?(m(W[0],W[1],t),h(t)):t=new f(W[0],W[1],u.UTC),G&&f.addSeconds(t,1,t),t},f.now=function(e){return f.fromDate(new Date,e)};var M=new f(0,0,u.TAI);return f.toGregorianDate=function(e,t){var i=!1,n=d(e,M);r(n)||(f.addSeconds(e,-1,M),n=d(M,M),i=!0);var a=n.dayNumber,s=n.secondsOfDay;s>=43200&&(a+=1);var u=a+68569|0,c=4*u/146097|0;u=u-((146097*c+3)/4|0)|0;var h=4e3*(u+1)/1461001|0;u=u-(1461*h/4|0)+31|0;var m=80*u/2447|0,p=u-(2447*m/80|0)|0;u=m/11|0;var v=m+2-12*u|0,g=100*(c-49)+h+u|0,_=s/l.SECONDS_PER_HOUR|0,y=s-_*l.SECONDS_PER_HOUR,C=y/l.SECONDS_PER_MINUTE|0;y-=C*l.SECONDS_PER_MINUTE;var E=0|y,S=(y-E)/l.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),i&&(E+=1),r(t)?(t.year=g,t.month=v,t.day=p,t.hour=_,t.minute=C,t.second=E,t.millisecond=S,t.isLeapSecond=i,t):new o(g,v,p,_,C,E,S,i)},f.toDate=function(e){var t=f.toGregorianDate(e,v),i=t.second;return t.isLeapSecond&&(i-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,i,t.millisecond))},f.toIso8601=function(t,i){var n,o=f.toGregorianDate(t,o);return r(i)||0===o.millisecond?r(i)&&0!==i?(n=(.01*o.millisecond).toFixed(i).replace(".","").slice(0,i),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",o.year,o.month,o.day,o.hour,o.minute,o.second,n)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",o.year,o.month,o.day,o.hour,o.minute,o.second):(n=(.01*o.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",o.year,o.month,o.day,o.hour,o.minute,o.second,n))},f.clone=function(e,t){return r(e)?r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new f(e.dayNumber,e.secondsOfDay,u.TAI):void 0},f.compare=function(e,t){var i=e.dayNumber-t.dayNumber;return 0!==i?i:e.secondsOfDay-t.secondsOfDay},f.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},f.equalsEpsilon=function(e,t,i){return e===t||r(e)&&r(t)&&Math.abs(f.secondsDifference(e,t))<=i},f.totalDays=function(e){return e.dayNumber+e.secondsOfDay/l.SECONDS_PER_DAY},f.secondsDifference=function(e,t){var i=(e.dayNumber-t.dayNumber)*l.SECONDS_PER_DAY;return i+(e.secondsOfDay-t.secondsOfDay)},f.daysDifference=function(e,t){var i=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/l.SECONDS_PER_DAY;return i+r},f.computeTaiMinusUtc=function(e){y.julianDate=e;var i=f.leapSeconds,r=t(i,y,c);return 0>r&&(r=~r,--r,0>r&&(r=0)),i[r].offset},f.addSeconds=function(e,t,i){return m(e.dayNumber,e.secondsOfDay+t,i)},f.addMinutes=function(e,t,i){var r=e.secondsOfDay+t*l.SECONDS_PER_MINUTE;return m(e.dayNumber,r,i)},f.addHours=function(e,t,i){var r=e.secondsOfDay+t*l.SECONDS_PER_HOUR;return m(e.dayNumber,r,i)},f.addDays=function(e,t,i){var r=e.dayNumber+t;return m(r,e.secondsOfDay,i)},f.lessThan=function(e,t){return f.compare(e,t)<0},f.lessThanOrEquals=function(e,t){return f.compare(e,t)<=0},f.greaterThan=function(e,t){return f.compare(e,t)>0},f.greaterThanOrEquals=function(e,t){return f.compare(e,t)>=0},f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.equalsEpsilon=function(e,t){return f.equalsEpsilon(this,e,t)},f.prototype.toString=function(){return f.toIso8601(this)},f.leapSeconds=[new s(new f(2441317,43210,u.TAI),10),new s(new f(2441499,43211,u.TAI),11),new s(new f(2441683,43212,u.TAI),12),new s(new f(2442048,43213,u.TAI),13),new s(new f(2442413,43214,u.TAI),14),new s(new f(2442778,43215,u.TAI),15),new s(new f(2443144,43216,u.TAI),16),new s(new f(2443509,43217,u.TAI),17),new s(new f(2443874,43218,u.TAI),18),new s(new f(2444239,43219,u.TAI),19),new s(new f(2444786,43220,u.TAI),20),new s(new f(2445151,43221,u.TAI),21),new s(new f(2445516,43222,u.TAI),22),new s(new f(2446247,43223,u.TAI),23),new s(new f(2447161,43224,u.TAI),24),new s(new f(2447892,43225,u.TAI),25),new s(new f(2448257,43226,u.TAI),26),new s(new f(2448804,43227,u.TAI),27),new s(new f(2449169,43228,u.TAI),28),new s(new f(2449534,43229,u.TAI),29),new s(new f(2450083,43230,u.TAI),30),new s(new f(2450630,43231,u.TAI),31),new s(new f(2451179,43232,u.TAI),32),new s(new f(2453736,43233,u.TAI),33),new s(new f(2454832,43234,u.TAI),34),new s(new f(2456109,43235,u.TAI),35),new s(new f(2457204,43236,u.TAI),36)], +f}),i("Core/clone",["./defaultValue"],function(e){"use strict";function t(i,r){if(null===i||"object"!=typeof i)return i;r=e(r,!1);var n=new i.constructor;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];r&&(a=t(a,r)),n[o]=a}return n}return t}),i("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var i=e.split("\r\n"),r=0;r<i.length;++r){var n=i[r],o=n.indexOf(": ");if(o>0){var a=n.substring(0,o),s=n.substring(o+2);t[a]=s}}return t}return e}),i("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function i(e,i,r){this.statusCode=e,this.response=i,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return i.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},i}),i("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError"],function(e,t,i,r,n,o){"use strict";function a(i){i=t(i,t.EMPTY_OBJECT);var r=i.responseType,n=t(i.method,"GET"),o=i.data,s=i.headers,l=i.overrideMimeType,u=i.withCredentials;return e(i.url,function(t){var i=e.defer();return a.load(t,r,n,o,s,i,l,u),i.promise})}function s(e,t){var i=decodeURIComponent(t);return e?atob(i):i}function l(e,t){for(var i=s(e,t),r=new ArrayBuffer(i.length),n=new Uint8Array(r),o=0;o<i.length;o++)n[o]=i.charCodeAt(o);return r}function u(e,i){i=t(i,"");var n=e[1],o=!!e[2],a=e[3];switch(i){case"":case"text":return s(o,a);case"arraybuffer":return l(o,a);case"blob":var u=l(o,a);return new Blob([u],{type:n});case"document":var c=new DOMParser;return c.parseFromString(s(o,a),n);case"json":return JSON.parse(s(o,a));default:throw new r("Unhandled responseType: "+i)}}var c=/^data:(.*?)(;base64)?,(.*)$/;return a.load=function(e,t,r,a,s,l,h,d){var m=c.exec(e);if(null!==m)return void l.resolve(u(m,t));var p=new XMLHttpRequest;if(i(h)&&i(p.overrideMimeType)&&p.overrideMimeType(h),p.open(r,e,!0),i(s))for(var f in s)s.hasOwnProperty(f)&&p.setRequestHeader(f,s[f]);i(t)&&(p.responseType=t),i(d)&&(p.withCredentials=d),p.onload=function(){p.status>=200&&p.status<300?i(p.response)?l.resolve(p.response):i(p.responseXML)&&p.responseXML.hasChildNodes()?l.resolve(p.responseXML):i(p.responseText)?l.resolve(p.responseText):l.reject(new o("unknown XMLHttpRequest response type.")):l.reject(new n(p.status,p.response,p.getAllResponseHeaders()))},p.onerror=function(e){l.reject(new n)},p.send(a)},a.defaultLoad=a.load,a}),i("Core/loadText",["./loadWithXhr","./defined"],function(e,t){"use strict";function i(i,r){return e({url:i,headers:t(r)?r.headers:void 0,overrideMimeType:t(r)?r.overrideMimeType:void 0,withCredentials:t(r)?r.withCredentials:void 0})}return i}),i("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,i,r){"use strict";function n(i,n){return t(n)||(n={}),t(n.headers)?t(n.headers.Accept)||(n.headers=e(n.headers),n.headers.Accept=o.Accept):n.headers=o,r(i,n).then(function(e){return JSON.parse(e)})}var o={Accept:"application/json,*/*;q=0.01"};return n}),i("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(t){if(t=i(t,i.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=i(t.addNewLeapSeconds,!0),r(t.data))p(this,t.data);else if(r(t.url)){var n=this;this._downloadPromise=e(l(t.url),function(e){p(n,e)},function(){n._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else p(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function m(e,t){return a.compare(e.julianDate,t)}function p(e,i){if(!r(i.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(i.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var n=i.columnNames.indexOf("modifiedJulianDateUtc"),o=i.columnNames.indexOf("xPoleWanderRadians"),l=i.columnNames.indexOf("yPoleWanderRadians"),u=i.columnNames.indexOf("ut1MinusUtcSeconds"),d=i.columnNames.indexOf("xCelestialPoleOffsetRadians"),p=i.columnNames.indexOf("yCelestialPoleOffsetRadians"),f=i.columnNames.indexOf("taiMinusUtcSeconds");if(0>n||0>o||0>l||0>u||0>d||0>p||0>f)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var v=e._samples=i.samples,g=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=l,e._ut1MinusUtcSecondsColumn=u,e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=p,e._taiMinusUtcSecondsColumn=f,e._columnCount=i.columnNames.length,e._lastIndex=void 0;for(var _,y=e._addNewLeapSeconds,C=0,E=v.length;E>C;C+=e._columnCount){var S=v[C+n],w=v[C+f],T=S+c.MODIFIED_JULIAN_DATE_DIFFERENCE,x=new a(T,w,h.TAI);if(g.push(x),y){if(w!==_&&r(_)){var b=a.leapSeconds,A=t(b,x,m);if(0>A){var P=new s(x,w);b.splice(~A,0,P)}}_=w}}}function f(e,t,i,r,n){var o=i*r;n.xPoleWander=t[o+e._xPoleWanderRadiansColumn],n.yPoleWander=t[o+e._yPoleWanderRadiansColumn],n.xPoleOffset=t[o+e._xCelestialPoleOffsetRadiansColumn],n.yPoleOffset=t[o+e._yCelestialPoleOffsetRadiansColumn],n.ut1MinusUtc=t[o+e._ut1MinusUtcSecondsColumn]}function v(e,t,i){return t+e*(i-t)}function g(e,t,i,r,n,o,s){var l=e._columnCount;if(o>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;var u=t[n],c=t[o];if(u.equals(c)||r.equals(u))return f(e,i,n,l,s),s;if(r.equals(c))return f(e,i,o,l,s),s;var h=a.secondsDifference(r,u)/a.secondsDifference(c,u),d=n*l,m=o*l,p=i[d+e._ut1MinusUtcSecondsColumn],g=i[m+e._ut1MinusUtcSecondsColumn],_=g-p;if(_>.5||-.5>_){var y=i[d+e._taiMinusUtcSecondsColumn],C=i[m+e._taiMinusUtcSecondsColumn];y!==C&&(c.equals(r)?p=g:g-=C-y)}return s.xPoleWander=v(h,i[d+e._xPoleWanderRadiansColumn],i[m+e._xPoleWanderRadiansColumn]),s.yPoleWander=v(h,i[d+e._yPoleWanderRadiansColumn],i[m+e._yPoleWanderRadiansColumn]),s.xPoleOffset=v(h,i[d+e._xCelestialPoleOffsetRadiansColumn],i[m+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=v(h,i[d+e._yCelestialPoleOffsetRadiansColumn],i[m+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=v(h,p,g),s}return d.NONE=o({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new n(0,0,0,0,0),t}}),d.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},d.prototype.compute=function(e,i){if(r(this._samples)){if(r(i)||(i=new n(0,0,0,0,0)),0===this._samples.length)return i.xPoleWander=0,i.yPoleWander=0,i.xPoleOffset=0,i.yPoleOffset=0,i.ut1MinusUtc=0,i;var o=this._dates,s=this._lastIndex,l=0,c=0;if(r(s)){var h=o[s],d=o[s+1],m=a.lessThanOrEquals(h,e),p=!r(d),f=p||a.greaterThanOrEquals(d,e);if(m&&f)return l=s,!p&&d.equals(e)&&++l,c=l+1,g(this,o,this._samples,e,l,c,i),i}var v=t(o,e,a.compare,this._dateColumn);return v>=0?(v<o.length-1&&o[v+1].equals(e)&&++v,l=v,c=v):(c=~v,l=c-1,0>l&&(l=0)),this._lastIndex=l,g(this,o,this._samples,e,l,c,i),i}if(r(this._dataError))throw new u(this._dataError)},d}),i("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var i=r.exec(t);this.scheme=i[1],this.authority=i[2],this.path=i[3],this.query=i[4],this.fragment=i[5]}}function t(e){var t=unescape(e);return o.test(t)?t:e.toUpperCase()}function i(e,t,i,r){return(t||"")+i.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(a,i).replace(n,t)),this.path&&(this.path=this.path.replace(n,t)),this.query&&(this.query=this.query.replace(n,t)),this.fragment&&(this.fragment=this.fragment.replace(n,t))};var n=/%[0-9a-z]{2}/gi,o=/[a-zA-Z0-9\-\._~]/,a=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var i=new e;return this.scheme?(i.scheme=this.scheme,i.authority=this.authority,i.path=this.path,i.query=this.query):(i.scheme=t.scheme,this.authority?(i.authority=this.authority,i.path=this.path,i.query=this.query):(i.authority=t.authority,""==this.path?(i.path=t.path,i.query=this.query||t.query):("/"==this.path.charAt(0)?(i.path=this.path,i.removeDotSegments()):(t.authority&&""==t.path?i.path="/"+this.path:i.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,i.removeDotSegments()),i.query=this.query))),i.fragment=this.fragment,i},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),i=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?i.pop():"."!=e&&i.push(e);("."==e||".."==e)&&i.push(""),r&&i.unshift(""),this.path=i.join("/")},e.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},e}),i("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r){"use strict";function n(i,r){r=t(r,document.location.href);var n=new e(r),o=new e(i);return o.resolve(n).toString()}return n}),i("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","require"],function(e,t,i,r,n){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,i=e.length;i>t;++t){var r=e[t].getAttribute("src"),n=m.exec(r);if(null!==n)return n[1]}}function a(){if(t(c))return c;var n;if(n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),!t(n))throw new i("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return c=new e(r(n))}function s(e){return n.toUrl("../"+e)}function l(t){return new e(t).resolve(a()).toString()}function u(e){t(h)||(h=t(n.toUrl)?s:l),t(d)||(d=document.createElement("a"));var i=h(e);return d.href=i,d.href=d.href,d.href}var c,h,d,m=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return u._cesiumScriptRegex=m,u.setBaseUrl=function(t){c=new e(t).resolve(new e(document.location.href))},u}),i("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,i){this.x=e,this.y=t,this.s=i}return e}),i("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=i(e,i.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=i(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=i(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new o(this._sampleZeroJulianEphemerisDate,0,s.TAI),this._stepSizeDays=i(e.stepSizeDays,1),this._samplesPerXysFile=i(e.samplesPerXysFile,1e3),this._totalSamples=i(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),n=this._xTable=new Array(t+1),a=Math.pow(this._stepSizeDays,t),l=0;t>=l;++l){r[l]=a,n[l]=l*this._stepSizeDays;for(var u=0;t>=u;++u)u!==l&&(r[l]*=l-u);r[l]=1/r[l]}this._work=new Array(t+1),this._coef=new Array(t+1)}function u(e,t,i){var r=h;return r.dayNumber=t,r.secondsOfDay=i,o.daysDifference(r,e._sampleZeroDateTT)}function c(i,n){if(i._chunkDownloadsInProgress[n])return i._chunkDownloadsInProgress[n];var o=e.defer();i._chunkDownloadsInProgress[n]=o;var s,l=i._xysFileUrlTemplate;return s=r(l)?l.replace("{0}",n):t("Assets/IAU2006_XYS/IAU2006_XYS_"+n+".json"),e(a(s),function(e){i._chunkDownloadsInProgress[n]=!1;for(var t=i._samples,r=e.samples,a=n*i._samplesPerXysFile*3,s=0,l=r.length;l>s;++s)t[a+s]=r[s];o.resolve()}),o.promise}var h=new o(0,0,s.TAI);return l.prototype.preload=function(t,i,r,n){var o=u(this,t,i),a=u(this,r,n),s=o/this._stepSizeDays-this._interpolationOrder/2|0;0>s&&(s=0);var l=a/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;l>=this._totalSamples&&(l=this._totalSamples-1);for(var h=s/this._samplesPerXysFile|0,d=l/this._samplesPerXysFile|0,m=[],p=h;d>=p;++p)m.push(c(this,p));return e.all(m)},l.prototype.computeXysRadians=function(e,t,i){var o=u(this,e,t);if(!(0>o)){var a=o/this._stepSizeDays|0;if(!(a>=this._totalSamples)){var s=this._interpolationOrder,l=a-(s/2|0);0>l&&(l=0);var h=l+s;h>=this._totalSamples&&(h=this._totalSamples-1,l=h-s,0>l&&(l=0));var d=!1,m=this._samples;if(r(m[3*l])||(c(this,l/this._samplesPerXysFile|0),d=!0),r(m[3*h])||(c(this,h/this._samplesPerXysFile|0),d=!0),!d){r(i)?(i.x=0,i.y=0,i.s=0):i=new n(0,0,0);var p,f,v=o-l*this._stepSizeDays,g=this._work,_=this._denominators,y=this._coef,C=this._xTable;for(p=0;s>=p;++p)g[p]=v-C[p];for(p=0;s>=p;++p){for(y[p]=1,f=0;s>=f;++f)f!==p&&(y[p]*=g[f]);y[p]*=_[p];var E=3*(l+p);i.x+=y[p]*m[E++],i.y+=y[p]*m[E++],i.s+=y[p]*m[E]}return i}}}},l}),i("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var i,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},n={};return t(n,{element:{get:function(){return n.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return n.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return n.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return n.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return n.supportsFullscreen()?null!==n.element:void 0}}}),n.supportsFullscreen=function(){if(e(i))return i;i=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",i=!0;for(var n,o=["webkit","moz","o","ms","khtml"],a=0,s=o.length;s>a;++a){var l=o[a];n=l+"RequestFullscreen","function"==typeof t[n]?(r.requestFullscreen=n,i=!0):(n=l+"RequestFullScreen","function"==typeof t[n]&&(r.requestFullscreen=n,i=!0)),n=l+"ExitFullscreen","function"==typeof document[n]?r.exitFullscreen=n:(n=l+"CancelFullScreen","function"==typeof document[n]&&(r.exitFullscreen=n)),n=l+"FullscreenEnabled",e(document[n])?r.fullscreenEnabled=n:(n=l+"FullScreenEnabled",e(document[n])&&(r.fullscreenEnabled=n)),n=l+"FullscreenElement",e(document[n])?r.fullscreenElement=n:(n=l+"FullScreenElement",e(document[n])&&(r.fullscreenElement=n)),n=l+"fullscreenchange",e(document["on"+n])&&("ms"===l&&(n="MSFullscreenChange"),r.fullscreenchange=n),n=l+"fullscreenerror",e(document["on"+n])&&("ms"===l&&(n="MSFullscreenError"),r.fullscreenerror=n)}return i},n.requestFullscreen=function(e,t){n.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},n.exitFullscreen=function(){n.supportsFullscreen()&&document[r.exitFullscreen]()},n}),i("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,i){"use strict";function r(e){for(var t=e.split("."),i=0,r=t.length;r>i;++i)t[i]=parseInt(t[i],10);return t}function n(){if(!t(y)){y=!1;var e=/ Chrome\/([\.0-9]+)/.exec(_.userAgent);null!==e&&(y=!0,C=r(e[1]))}return y}function o(){return n()&&C}function a(){if(!t(E)&&(E=!1,!n()&&/ Safari\/[\.0-9]+/.test(_.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(_.userAgent);null!==e&&(E=!0,S=r(e[1]))}return E}function s(){return a()&&S}function l(){if(!t(w)){w=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(_.userAgent);null!==e&&(w=!0,T=r(e[1]),T.isNightly=!!e[2])}return w}function u(){return l()&&T}function c(){if(!t(x)){x=!1;var e;"Microsoft Internet Explorer"===_.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(_.userAgent),null!==e&&(x=!0,b=r(e[1]))):"Netscape"===_.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(_.userAgent),null!==e&&(x=!0,b=r(e[1])))}return x}function h(){return c()&&b}function d(){if(!t(A)){A=!1;var e=/Firefox\/([\.0-9]+)/.exec(_.userAgent);null!==e&&(A=!0,P=r(e[1]))}return A}function m(){return t(I)||(I=/Windows/i.test(_.appVersion)),I}function p(){return d()&&P}function f(){return t(M)||(M="undefined"!=typeof PointerEvent&&(!t(_.pointerEnabled)||_.pointerEnabled)),M}function v(){if(!t(R)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var i=e.style.imageRendering;R=t(i)&&""!==i,R&&(D=i)}return R}function g(){return v()?D:void 0}var _;_="undefined"!=typeof navigator?navigator:{};var y,C,E,S,w,T,x,b,A,P,I,M,D,R,O={isChrome:n,chromeVersion:o,isSafari:a,safariVersion:s,isWebkit:l,webkitVersion:u,isInternetExplorer:c,internetExplorerVersion:h,isFirefox:d,firefoxVersion:p,isWindows:m,hardwareConcurrency:e(_.hardwareConcurrency,3),supportsPointerEvents:f,supportsImageRenderingPixelated:v,imageRenderingValue:g};return O.supportsFullscreen=function(){return i.supportsFullscreen()},O.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},O.supportsWebWorkers=function(){return"undefined"!=typeof Worker},O}),i("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,i,r,n){this.x=t(e,0),this.y=t(i,0),this.z=t(r,0),this.w=t(n,0)}var u=new e;l.fromAxisAngle=function(t,r,n){var o=r/2,a=Math.sin(o);u=e.normalize(t,u);var s=u.x*a,c=u.y*a,h=u.z*a,d=Math.cos(o);return i(n)?(n.x=s,n.y=c,n.z=h,n.w=d,n):new l(s,c,h,d)};var c=[1,2,0],h=new Array(3);l.fromRotationMatrix=function(e,t){var r,n,o,a,u,d=e[s.COLUMN0ROW0],m=e[s.COLUMN1ROW1],p=e[s.COLUMN2ROW2],f=d+m+p;if(f>0)r=Math.sqrt(f+1),u=.5*r,r=.5/r,n=(e[s.COLUMN1ROW2]-e[s.COLUMN2ROW1])*r,o=(e[s.COLUMN2ROW0]-e[s.COLUMN0ROW2])*r,a=(e[s.COLUMN0ROW1]-e[s.COLUMN1ROW0])*r;else{var v=c,g=0;m>d&&(g=1),p>d&&p>m&&(g=2);var _=v[g],y=v[_];r=Math.sqrt(e[s.getElementIndex(g,g)]-e[s.getElementIndex(_,_)]-e[s.getElementIndex(y,y)]+1);var C=h;C[g]=.5*r,r=.5/r,u=(e[s.getElementIndex(y,_)]-e[s.getElementIndex(_,y)])*r,C[_]=(e[s.getElementIndex(_,g)]+e[s.getElementIndex(g,_)])*r,C[y]=(e[s.getElementIndex(y,g)]+e[s.getElementIndex(g,y)])*r,n=-C[0],o=-C[1],a=-C[2]}return i(t)?(t.x=n,t.y=o,t.z=a,t.w=u,t):new l(n,o,a,u)};var d=new l;l.fromHeadingPitchRoll=function(t,i,r,n){var o=l.fromAxisAngle(e.UNIT_X,r,d),a=l.fromAxisAngle(e.UNIT_Y,-i,n);n=l.multiply(a,o,a);var s=l.fromAxisAngle(e.UNIT_Z,-t,d);return l.multiply(s,n,n)};var m=new e,p=new e,f=new l,v=new l,g=new l;l.packedLength=4,l.pack=function(e,i,r){r=t(r,0),i[r++]=e.x,i[r++]=e.y,i[r++]=e.z,i[r]=e.w},l.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new l),n.x=e[r],n.y=e[r+1],n.z=e[r+2],n.w=e[r+3],n},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,i,r){l.unpack(e,4*i,g),l.conjugate(g,g);for(var n=0,o=i-t+1;o>n;n++){var a=3*n;l.unpack(e,4*(t+n),f),l.multiply(f,g,f),f.w<0&&l.negate(f,f),l.computeAxis(f,m);var s=l.computeAngle(f);r[a]=m.x*s,r[a+1]=m.y*s,r[a+2]=m.z*s}},l.unpackInterpolationResult=function(t,r,n,o,a){i(a)||(a=new l),e.fromArray(t,0,p);var s=e.magnitude(p);return l.unpack(r,4*o,v),0===s?l.clone(l.IDENTITY,f):l.fromAxisAngle(p,s,f),l.multiply(f,v,a)},l.clone=function(e,t){return i(e)?i(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w):void 0},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var i=1/l.magnitude(e),r=e.x*i,n=e.y*i,o=e.z*i,a=e.w*i;return t.x=r,t.y=n,t.z=o,t.w=a,t},l.inverse=function(e,t){var i=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/i,t)},l.add=function(e,t,i){return i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i.w=e.w+t.w,i},l.subtract=function(e,t,i){return i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i.w=e.w-t.w,i},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,i){var r=e.x,n=e.y,o=e.z,a=e.w,s=t.x,l=t.y,u=t.z,c=t.w,h=a*s+r*c+n*u-o*l,d=a*l-r*u+n*c+o*s,m=a*u+r*l-n*s+o*c,p=a*c-r*s-n*l-o*u;return i.x=h,i.y=d,i.z=m,i.w=p,i},l.multiplyByScalar=function(e,t,i){return i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i.w=e.w*t,i},l.divideByScalar=function(e,t,i){return i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i.w=e.w/t,i},l.computeAxis=function(e,t){var i=e.w;if(Math.abs(i-1)<a.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-i*i);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},l.computeAngle=function(e){return Math.abs(e.w-1)<a.EPSILON6?0:2*Math.acos(e.w)};var _=new l;l.lerp=function(e,t,i,r){return _=l.multiplyByScalar(t,i,_),r=l.multiplyByScalar(e,1-i,r),l.add(_,r,r)};var y=new l,C=new l,E=new l;l.slerp=function(e,t,i,r){var n=l.dot(e,t),o=t;if(0>n&&(n=-n,o=y=l.negate(t,y)),1-n<a.EPSILON6)return l.lerp(e,o,i,r);var s=Math.acos(n);return C=l.multiplyByScalar(e,Math.sin((1-i)*s),C),E=l.multiplyByScalar(o,Math.sin(i*s),E),r=l.add(C,E,r),l.multiplyByScalar(r,1/Math.sin(s),r)},l.log=function(t,i){var r=a.acosClamped(t.w),n=0;return 0!==r&&(n=r/Math.sin(r)),e.multiplyByScalar(t,n,i)},l.exp=function(t,i){var r=e.magnitude(t),n=0;return 0!==r&&(n=Math.sin(r)/r),i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i.w=Math.cos(r),i};var S=new e,w=new e,T=new l,x=new l;l.computeInnerQuadrangle=function(t,i,r,n){var o=l.conjugate(i,T);l.multiply(o,r,x);var a=l.log(x,S);l.multiply(o,t,x);var s=l.log(x,w);return e.add(a,s,a),e.multiplyByScalar(a,.25,a),e.negate(a,a),l.exp(a,T),l.multiply(i,T,n)},l.squad=function(e,t,i,r,n,o){var a=l.slerp(e,t,n,T),s=l.slerp(i,r,n,x);return l.slerp(a,s,2*n*(1-n),o)};for(var b=new l,A=1.9011074535173003,P=n.supportsTypedArrays()?new Float32Array(8):[],I=n.supportsTypedArrays()?new Float32Array(8):[],M=n.supportsTypedArrays()?new Float32Array(8):[],D=n.supportsTypedArrays()?new Float32Array(8):[],R=0;7>R;++R){var O=R+1,N=2*O+1;P[R]=1/(O*N),I[R]=O/N}return P[7]=A/136,I[7]=8*A/17,l.fastSlerp=function(e,t,i,r){var n,o=l.dot(e,t);o>=0?n=1:(n=-1,o=-o);for(var a=o-1,s=1-i,u=i*i,c=s*s,h=7;h>=0;--h)M[h]=(P[h]*u-I[h])*a,D[h]=(P[h]*c-I[h])*a;var d=n*i*(1+M[0]*(1+M[1]*(1+M[2]*(1+M[3]*(1+M[4]*(1+M[5]*(1+M[6]*(1+M[7])))))))),m=s*(1+D[0]*(1+D[1]*(1+D[2]*(1+D[3]*(1+D[4]*(1+D[5]*(1+D[6]*(1+D[7])))))))),p=l.multiplyByScalar(e,m,b);return l.multiplyByScalar(t,d,r),l.add(p,r,r)},l.fastSquad=function(e,t,i,r,n,o){var a=l.fastSlerp(e,t,n,T),s=l.fastSlerp(i,r,n,x);return l.fastSlerp(a,s,2*n*(1-n),o)},l.equals=function(e,t){return e===t||i(e)&&i(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e.x-t.x)<=r&&Math.abs(e.y-t.y)<=r&&Math.abs(e.z-t.z)<=r&&Math.abs(e.w-t.w)<=r},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),i("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g){"use strict";var _={},y=new i,C=new i,E=new i;_.eastNorthUpToFixedFrame=function(e,t,r){if(m.equalsEpsilon(e.x,0,m.EPSILON14)&&m.equalsEpsilon(e.y,0,m.EPSILON14)){var a=m.sign(e.z);return o(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-a,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new f(0,-a,0,e.x,1,0,0,e.y,0,0,a,e.z,0,0,0,1)}var s=y,l=C,c=E;return t=n(t,u.WGS84),t.geodeticSurfaceNormal(e,s),l.x=-e.y,l.y=e.x,l.z=0,i.normalize(l,l),i.cross(s,l,c),o(r)?(r[0]=l.x,r[1]=l.y,r[2]=l.z,r[3]=0,r[4]=c.x,r[5]=c.y,r[6]=c.z,r[7]=0,r[8]=s.x,r[9]=s.y,r[10]=s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new f(l.x,c.x,s.x,e.x,l.y,c.y,s.y,e.y,l.z,c.z,s.z,e.z,0,0,0,1)};var S=new i,w=new i,T=new i;_.northEastDownToFixedFrame=function(e,t,r){if(m.equalsEpsilon(e.x,0,m.EPSILON14)&&m.equalsEpsilon(e.y,0,m.EPSILON14)){var a=m.sign(e.z);return o(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new f(-a,0,0,e.x,0,1,0,e.y,0,0,-a,e.z,0,0,0,1)}var s=S,l=w,c=T;return t=n(t,u.WGS84),t.geodeticSurfaceNormal(e,s),l.x=-e.y,l.y=e.x,l.z=0,i.normalize(l,l),i.cross(s,l,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=l.x,r[5]=l.y,r[6]=l.z,r[7]=0,r[8]=-s.x,r[9]=-s.y,r[10]=-s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new f(c.x,l.x,-s.x,e.x,c.y,l.y,-s.y,e.y,c.z,l.z,-s.z,e.z,0,0,0,1)},_.northUpEastToFixedFrame=function(e,t,r){if(m.equalsEpsilon(e.x,0,m.EPSILON14)&&m.equalsEpsilon(e.y,0,m.EPSILON14)){var a=m.sign(e.z);return o(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=a,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new f(-a,0,0,e.x,0,0,1,e.y,0,a,0,e.z,0,0,0,1)}var s=y,l=C,c=E;return t=n(t,u.WGS84),t.geodeticSurfaceNormal(e,s),l.x=-e.y,l.y=e.x,l.z=0,i.normalize(l,l),i.cross(s,l,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=s.x,r[5]=s.y,r[6]=s.z,r[7]=0,r[8]=l.x,r[9]=l.y,r[10]=l.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new f(c.x,s.x,l.x,e.x,c.y,s.y,l.y,e.y,c.z,s.z,l.z,e.z,0,0,0,1)};var x=new v,b=new i(1,1,1),A=new f;_.headingPitchRollToFixedFrame=function(e,t,r,n,o,a){var s=v.fromHeadingPitchRoll(t,r,n,x),l=f.fromTranslationQuaternionRotationScale(i.ZERO,s,b,A);return a=_.eastNorthUpToFixedFrame(e,o,a),f.multiply(a,l,a)};var P=new f,I=new p;_.headingPitchRollQuaternion=function(e,t,i,r,n,o){var a=_.headingPitchRollToFixedFrame(e,t,i,r,n,P),s=f.getRotation(a,I);return v.fromRotationMatrix(s,o)};var M=24110.54841,D=8640184.812866,R=.093104,O=-62e-7,N=1.1772758384668e-19,L=72921158553e-15,F=m.TWO_PI/86400,B=new d;_.computeTemeToPseudoFixedMatrix=function(e,t){B=d.addSeconds(e,-d.computeTaiMinusUtc(e),B);var i,r=B.dayNumber,n=B.secondsOfDay,a=r-2451545;i=n>=43200?(a+.5)/g.DAYS_PER_JULIAN_CENTURY:(a-.5)/g.DAYS_PER_JULIAN_CENTURY;var s=M+i*(D+i*(R+i*O)),l=s*F%m.TWO_PI,u=L+N*(r-2451545.5),c=(n+.5*g.SECONDS_PER_DAY)%g.SECONDS_PER_DAY,h=l+u*c,f=Math.cos(h),v=Math.sin(h);return o(t)?(t[0]=f,t[1]=-v,t[2]=0,t[3]=v,t[4]=f,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new p(f,v,0,-v,f,0,0,0,1)},_.iau2006XysData=new c,_.earthOrientationParameters=s.NONE;var V=32.184,k=2451545;_.preloadIcrfFixed=function(t){var i=t.start.dayNumber,r=t.start.secondsOfDay+V,n=t.stop.dayNumber,o=t.stop.secondsOfDay+V,a=_.iau2006XysData.preload(i,r,n,o),s=_.earthOrientationParameters.getPromiseToLoad();return e.all([a,s])},_.computeIcrfToFixedMatrix=function(e,t){o(t)||(t=new p);var i=_.computeFixedToIcrfMatrix(e,t);if(o(i))return p.transpose(i,t)};var z=new h(0,0,0),U=new l(0,0,0,0,0,0),G=new p,W=new p;_.computeFixedToIcrfMatrix=function(e,t){o(t)||(t=new p);var i=_.earthOrientationParameters.compute(e,U);if(o(i)){var r=e.dayNumber,n=e.secondsOfDay+V,a=_.iau2006XysData.computeXysRadians(r,n,z);if(o(a)){var s=a.x+i.xPoleOffset,l=a.y+i.yPoleOffset,u=1/(1+Math.sqrt(1-s*s-l*l)),c=G;c[0]=1-u*s*s,c[3]=-u*s*l,c[6]=s,c[1]=-u*s*l,c[4]=1-u*l*l,c[7]=l,c[2]=-s,c[5]=-l,c[8]=1-u*(s*s+l*l);var h=p.fromRotationZ(-a.s,W),f=p.multiply(c,h,G),v=e.dayNumber,y=e.secondsOfDay-d.computeTaiMinusUtc(e)+i.ut1MinusUtc,C=v-2451545,E=y/g.SECONDS_PER_DAY,S=.779057273264+E+.00273781191135448*(C+E);S=S%1*m.TWO_PI;var w=p.fromRotationZ(S,W),T=p.multiply(f,w,G),x=Math.cos(i.xPoleWander),b=Math.cos(i.yPoleWander),A=Math.sin(i.xPoleWander),P=Math.sin(i.yPoleWander),I=r-k+n/g.SECONDS_PER_DAY;I/=36525;var M=-47e-6*I*m.RADIANS_PER_DEGREE/3600,D=Math.cos(M),R=Math.sin(M),O=W;return O[0]=x*D,O[1]=x*R,O[2]=A,O[3]=-b*R+P*A*D,O[4]=b*D+P*A*R,O[5]=-P*x,O[6]=-P*R-b*A*D,O[7]=P*D-b*A*R,O[8]=b*x,p.multiply(T,O,t)}}};var H=new r;_.pointToWindowCoordinates=function(e,t,i,r){return r=_.pointToGLWindowCoordinates(e,t,i,r),r.y=2*t[5]-r.y,r},_.pointToGLWindowCoordinates=function(e,i,n,a){o(a)||(a=new t);var s=H;return f.multiplyByVector(e,r.fromElements(n.x,n.y,n.z,1,s),s),r.multiplyByScalar(s,1/s.w,s),f.multiplyByVector(i,s,s),t.fromCartesian4(s,a)};var q=new i,j=new i,Y=new i;return _.rotationMatrixFromPositionVelocity=function(e,t,r,a){var s=n(r,u.WGS84).geodeticSurfaceNormal(e,q),l=i.cross(t,s,j);i.equalsEpsilon(l,i.ZERO,m.EPSILON6)&&(l=i.clone(i.UNIT_X,l));var c=i.cross(l,t,Y);return i.cross(t,c,l),i.negate(l,l),o(a)||(a=new p),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=l.x,a[4]=l.y,a[5]=l.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a},_}),i("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix3","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(e,t){t=n(t,l.WGS84),e=t.scaleToGeodeticSurface(e);var r=p.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=i.fromCartesian4(h.getColumn(r,0,v)),this._yAxis=i.fromCartesian4(h.getColumn(r,1,v));var o=i.fromCartesian4(h.getColumn(r,2,v));this._plane=d.fromPointNormal(e,o)}var v=new r;a(f.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var g=new e;f.fromPoints=function(t,i){var r=e.fromPoints(t,g);return new f(r.center,i)};var _=new m,y=new i;f.prototype.projectPointOntoPlane=function(e,r){var n=_;n.origin=e,i.normalize(e,n.direction);var a=u.rayPlane(n,this._plane,y);if(o(a)||(i.negate(n.direction,n.direction),a=u.rayPlane(n,this._plane,y)),o(a)){var s=i.subtract(a,this._origin,a),l=i.dot(this._xAxis,s),c=i.dot(this._yAxis,s);return o(r)?(r.x=l,r.y=c,r):new t(l,c)}},f.prototype.projectPointsOntoPlane=function(e,t){o(t)||(t=[]);for(var i=0,r=e.length,n=0;r>n;n++){var a=this.projectPointOntoPlane(e[n],t[i]);o(a)&&(t[i]=a,i++)}return t.length=i,t},f.prototype.projectPointToNearestOnPlane=function(e,r){ +o(r)||(r=new t);var n=_;n.origin=e,i.clone(this._plane.normal,n.direction);var a=u.rayPlane(n,this._plane,y);o(a)||(i.negate(n.direction,n.direction),a=u.rayPlane(n,this._plane,y));var s=i.subtract(a,this._origin,a),l=i.dot(this._xAxis,s),c=i.dot(this._yAxis,s);return r.x=l,r.y=c,r},f.prototype.projectPointsToNearestOnPlane=function(e,t){o(t)||(t=[]);var i=e.length;t.length=i;for(var r=0;i>r;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var C=new i;return f.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;o(t)?t.length=r:t=new Array(r);for(var n=this._ellipsoid,a=this._origin,s=this._xAxis,l=this._yAxis,u=C,c=0;r>c;++c){var h=e[c];i.multiplyByScalar(s,h.x,u),o(t[c])||(t[c]=new i);var d=i.add(a,u,t[c]);i.multiplyByScalar(l,h.y,u),i.add(d,u,d),n.scaleToGeocentricSurface(d,d)}return t},f}),i("Core/OrientedBoundingBox",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Intersect","./Interval","./Math","./Matrix3","./Plane","./Rectangle"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(e,t){this.center=i.clone(n(e,i.ZERO)),this.halfAxes=d.clone(n(t,d.ZERO))}function v(e,t,r,n,a,s,l,u){o(u)||(u=new f);var c=u.halfAxes;d.setColumn(c,0,e.xAxis,c),d.setColumn(c,1,e.yAxis,c),d.setColumn(c,2,e.zAxis,c);var h=T;h.x=(t+r)/2,h.y=(n+a)/2,h.z=(s+l)/2;var m=x;m.x=(r-t)/2,m.y=(a-n)/2,m.z=(l-s)/2;var p=u.center;return h=d.multiplyByVector(c,h,h),i.add(e.origin,h,p),d.multiplyByScale(c,m,c),u}var g=new i,_=new i,y=new i,C=new i,E=new i,S=new d,w={unitary:new d,diagonal:new d};f.fromPoints=function(e,t){if(o(t)||(t=new f),!o(e)||0===e.length)return t.halfAxes=d.ZERO,t.center=i.ZERO,t;var r,n=e.length,a=i.clone(e[0],g);for(r=1;n>r;r++)i.add(a,e[r],a);var s=1/n;i.multiplyByScalar(a,s,a);var l,u=0,c=0,h=0,m=0,p=0,v=0;for(r=0;n>r;r++)l=i.subtract(e[r],a,_),u+=l.x*l.x,c+=l.x*l.y,h+=l.x*l.z,m+=l.y*l.y,p+=l.y*l.z,v+=l.z*l.z;u*=s,c*=s,h*=s,m*=s,p*=s,v*=s;var T=S;T[0]=u,T[1]=c,T[2]=h,T[3]=c,T[4]=m,T[5]=p,T[6]=h,T[7]=p,T[8]=v;var x=d.computeEigenDecomposition(T,w),b=d.transpose(x.unitary,t.halfAxes);l=i.subtract(e[0],a,_);var A=d.multiplyByVector(b,l,y),P=i.clone(A,C),I=i.clone(A,E);for(r=1;n>r;r++)l=i.subtract(e[r],a,l),d.multiplyByVector(b,l,A),i.minimumByComponent(I,A,I),i.maximumByComponent(P,A,P);var M=i.add(I,P,y);i.multiplyByScalar(M,.5,M),d.multiplyByVector(b,M,M),i.add(a,M,t.center);var D=i.subtract(P,I,y);return i.multiplyByScalar(D,.5,D),d.multiplyByScale(t.halfAxes,D,t.halfAxes),t};var T=new i,x=new i,b=new r,A=new i,P=[new r,new r,new r,new r,new r,new r,new r,new r],I=[new i,new i,new i,new i,new i,new i,new i,new i],M=[new t,new t,new t,new t,new t,new t,new t,new t];f.fromRectangle=function(e,t,i,r,o){t=n(t,0),i=n(i,0),r=n(r,s.WGS84);var a=p.center(e,b),u=r.cartographicToCartesian(a,A),c=new l(u,r),h=c.plane,d=P[0],f=P[1],g=P[2],_=P[3],y=P[4],C=P[5],E=P[6],S=P[7],w=a.longitude,T=e.south<0&&e.north>0?0:a.latitude;E.latitude=C.latitude=y.latitude=e.south,S.latitude=_.latitude=T,d.latitude=f.latitude=g.latitude=e.north,E.longitude=S.longitude=d.longitude=e.west,C.longitude=f.longitude=w,y.longitude=_.longitude=g.longitude=e.east,g.height=f.height=d.height=S.height=E.height=C.height=y.height=_.height=i,r.cartographicArrayToCartesianArray(P,I),c.projectPointsToNearestOnPlane(I,M);var x=Math.min(M[6].x,M[7].x,M[0].x),D=Math.max(M[2].x,M[3].x,M[4].x),R=Math.min(M[4].y,M[5].y,M[6].y),O=Math.max(M[0].y,M[1].y,M[2].y);g.height=d.height=y.height=E.height=t,r.cartographicArrayToCartesianArray(P,I);var N=Math.min(m.getPointDistance(h,I[0]),m.getPointDistance(h,I[2]),m.getPointDistance(h,I[4]),m.getPointDistance(h,I[6])),L=i;return v(c,x,D,R,O,N,L,o)},f.clone=function(e,t){return o(e)?o(t)?(i.clone(e.center,t.center),d.clone(e.halfAxes,t.halfAxes),t):new f(e.center,e.halfAxes):void 0},f.intersectPlane=function(e,t){var r=e.center,n=t.normal,o=e.halfAxes,a=n.x,s=n.y,l=n.z,c=Math.abs(a*o[d.COLUMN0ROW0]+s*o[d.COLUMN0ROW1]+l*o[d.COLUMN0ROW2])+Math.abs(a*o[d.COLUMN1ROW0]+s*o[d.COLUMN1ROW1]+l*o[d.COLUMN1ROW2])+Math.abs(a*o[d.COLUMN2ROW0]+s*o[d.COLUMN2ROW1]+l*o[d.COLUMN2ROW2]),h=i.dot(n,r)+t.distance;return-c>=h?u.OUTSIDE:h>=c?u.INSIDE:u.INTERSECTING};var D=new i,R=new i,O=new i,N=new i;f.distanceSquaredTo=function(e,t){var r=i.subtract(t,e.center,T),n=e.halfAxes,o=d.getColumn(n,0,D),a=d.getColumn(n,1,R),s=d.getColumn(n,2,O),l=i.magnitude(o),u=i.magnitude(a),c=i.magnitude(s);i.normalize(o,o),i.normalize(a,a),i.normalize(s,s);var h=N;h.x=i.dot(r,o),h.y=i.dot(r,a),h.z=i.dot(r,s);var m,p=0;return h.x<-l?(m=h.x+l,p+=m*m):h.x>l&&(m=h.x-l,p+=m*m),h.y<-u?(m=h.y+u,p+=m*m):h.y>u&&(m=h.y-u,p+=m*m),h.z<-c?(m=h.z+c,p+=m*m):h.z>c&&(m=h.z-c,p+=m*m),p};var L=new i,F=new i;f.computePlaneDistances=function(e,t,r,n){o(n)||(n=new c);var a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,l=e.center,u=e.halfAxes,h=d.getColumn(u,0,D),m=d.getColumn(u,1,R),p=d.getColumn(u,2,O),f=i.add(h,m,L);i.add(f,p,f),i.add(f,l,f);var v=i.subtract(f,t,F),g=i.dot(r,v);return a=Math.min(g,a),s=Math.max(g,s),i.add(l,h,f),i.add(f,m,f),i.subtract(f,p,f),i.subtract(f,t,v),g=i.dot(r,v),a=Math.min(g,a),s=Math.max(g,s),i.add(l,h,f),i.subtract(f,m,f),i.add(f,p,f),i.subtract(f,t,v),g=i.dot(r,v),a=Math.min(g,a),s=Math.max(g,s),i.add(l,h,f),i.subtract(f,m,f),i.subtract(f,p,f),i.subtract(f,t,v),g=i.dot(r,v),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,h,f),i.add(f,m,f),i.add(f,p,f),i.subtract(f,t,v),g=i.dot(r,v),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,h,f),i.add(f,m,f),i.subtract(f,p,f),i.subtract(f,t,v),g=i.dot(r,v),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,h,f),i.subtract(f,m,f),i.add(f,p,f),i.subtract(f,t,v),g=i.dot(r,v),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,h,f),i.subtract(f,m,f),i.subtract(f,p,f),i.subtract(f,t,v),g=i.dot(r,v),a=Math.min(g,a),s=Math.max(g,s),n.start=a,n.stop=s,n};var B=new e;return f.isOccluded=function(t,i){var r=e.fromOrientedBoundingBox(t,B);return!i.isBoundingSphereVisible(r)},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,i){return f.computePlaneDistances(this,e,t,i)},f.prototype.isOccluded=function(e){return f.isOccluded(this,e)},f.equals=function(e,t){return e===t||o(e)&&o(t)&&i.equals(e.center,t.center)&&d.equals(e.halfAxes,t.halfAxes)},f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f}),i("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,i,r,n){"use strict";var o={};o.octEncode=function(e,t){if(t.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),t.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var i=t.x,r=t.y;t.x=(1-Math.abs(r))*n.signNotZero(i),t.y=(1-Math.abs(i))*n.signNotZero(r)}return t.x=n.toSNorm(t.x),t.y=n.toSNorm(t.y),t},o.octDecode=function(e,i,r){if(r.x=n.fromSNorm(e),r.y=n.fromSNorm(i),r.z=1-(Math.abs(r.x)+Math.abs(r.y)),r.z<0){var o=r.x;r.x=(1-Math.abs(r.y))*n.signNotZero(o),r.y=(1-Math.abs(o))*n.signNotZero(r.y)}return t.normalize(r,r)},o.octPackFloat=function(e){return 256*e.x+e.y};var a=new e;return o.octEncodeFloat=function(e){return o.octEncode(e,a),o.octPackFloat(a)},o.octDecodeFloat=function(e,t){var i=e/256,r=Math.floor(i),n=256*(i-r);return o.octDecode(r,n,t)},o.octPack=function(e,t,i,r){var n=o.octEncodeFloat(e),s=o.octEncodeFloat(t),l=o.octEncode(i,a);return r.x=65536*l.x+n,r.y=65536*l.y+s,r},o.octUnpack=function(e,t,i,r){var n=e.x/65536,a=Math.floor(n),s=65536*(n-a);n=e.y/65536;var l=Math.floor(n),u=65536*(n-l);o.octDecodeFloat(s,t),o.octDecodeFloat(u,i),o.octDecode(a,l,r)},o.compressTextureCoordinates=function(e){var t=1===e.x?4095:4096*e.x|0,i=1===e.y?4095:4096*e.y|0;return 4096*t+i},o.decompressTextureCoordinates=function(e,t){var i=e/4096;return t.x=Math.floor(i)/4096,t.y=i-Math.floor(i),t},o}),i("Renderer/WebGLConstants",["../Core/freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return e(t)}),i("Core/ComponentDatatype",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,i,r,n,o){"use strict";if(!n.supportsTypedArrays())return{};var a={BYTE:e.BYTE,UNSIGNED_BYTE:e.UNSIGNED_BYTE,SHORT:e.SHORT,UNSIGNED_SHORT:e.UNSIGNED_SHORT,FLOAT:e.FLOAT,DOUBLE:e.DOUBLE};return a.getSizeInBytes=function(e){switch(e){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},a.fromTypedArray=function(e){return e instanceof Int8Array?a.BYTE:e instanceof Uint8Array?a.UNSIGNED_BYTE:e instanceof Int16Array?a.SHORT:e instanceof Uint16Array?a.UNSIGNED_SHORT:e instanceof Float32Array?a.FLOAT:e instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(e){return i(e)&&(e===a.BYTE||e===a.UNSIGNED_BYTE||e===a.SHORT||e===a.UNSIGNED_SHORT||e===a.FLOAT||e===a.DOUBLE)},a.createTypedArray=function(e,t){switch(e){case a.BYTE:return new Int8Array(t);case a.UNSIGNED_BYTE:return new Uint8Array(t);case a.SHORT:return new Int16Array(t);case a.UNSIGNED_SHORT:return new Uint16Array(t);case a.FLOAT:return new Float32Array(t);case a.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},a.createArrayBufferView=function(e,i,n,o){switch(n=t(n,0),o=t(o,(i.byteLength-n)/a.getSizeInBytes(e)),e){case a.BYTE:return new Int8Array(i,n,o);case a.UNSIGNED_BYTE:return new Uint8Array(i,n,o);case a.SHORT:return new Int16Array(i,n,o);case a.UNSIGNED_SHORT:return new Uint16Array(i,n,o);case a.FLOAT:return new Float32Array(i,n,o);case a.DOUBLE:return new Float64Array(i,n,o);default:throw new r("componentDatatype is not a valid value.")}},o(a)}),i("Core/TerrainQuantization",["./freezeObject"],function(e){"use strict";var t={NONE:0,BITS12:1};return e(t)}),i("Core/TerrainEncoding",["./AttributeCompression","./Cartesian2","./Cartesian3","./ComponentDatatype","./defined","./Math","./Matrix3","./Matrix4","./TerrainQuantization"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e,t,r,o,a){var u,d,v,g;if(n(e)&&n(t)&&n(r)&&n(o)){var _=e.minimum,y=e.maximum,C=i.subtract(y,_,h),E=r-t,S=Math.max(i.maximumComponent(C),E);u=f-1>S?l.BITS12:l.NONE,d=e.center,v=s.inverseTransformation(o,new s);var w=i.negate(_,c);s.multiply(s.fromTranslation(w,m),v,v);var T=c;T.x=1/C.x,T.y=1/C.y,T.z=1/C.z,s.multiply(s.fromScale(T,m),v,v),g=s.clone(o),s.setTranslation(g,i.ZERO,g),o=s.clone(o,new s);var x=s.fromTranslation(_,m),b=s.fromScale(C,p),A=s.multiply(x,b,m);s.multiply(o,A,o),s.multiply(g,A,g)}this.quantization=u,this.minimumHeight=t,this.maximumHeight=r,this.center=d,this.toScaledENU=v,this.fromScaledENU=o,this.matrix=g,this.hasVertexNormals=a}var c=new i,h=new i,d=new t,m=new s,p=new s,f=Math.pow(2,12);u.prototype.encode=function(r,n,a,u,h,m){var p=u.x,f=u.y;if(this.quantization===l.BITS12){a=s.multiplyByPoint(this.toScaledENU,a,c),a.x=o.clamp(a.x,0,1),a.y=o.clamp(a.y,0,1),a.z=o.clamp(a.z,0,1);var v=this.maximumHeight-this.minimumHeight,g=o.clamp((h-this.minimumHeight)/v,0,1);t.fromElements(a.x,a.y,d);var _=e.compressTextureCoordinates(d);t.fromElements(a.z,g,d);var y=e.compressTextureCoordinates(d);t.fromElements(p,f,d);var C=e.compressTextureCoordinates(d);r[n++]=_,r[n++]=y,r[n++]=C}else i.subtract(a,this.center,c),r[n++]=c.x,r[n++]=c.y,r[n++]=c.z,r[n++]=h,r[n++]=p,r[n++]=f;return this.hasVertexNormals&&(r[n++]=e.octPackFloat(m)),n},u.prototype.decodePosition=function(t,r,o){if(n(o)||(o=new i),r*=this.getStride(),this.quantization===l.BITS12){var a=e.decompressTextureCoordinates(t[r],d);o.x=a.x,o.y=a.y;var u=e.decompressTextureCoordinates(t[r+1],d);return o.z=u.x,s.multiplyByPoint(this.fromScaledENU,o,o)}return o.x=t[r],o.y=t[r+1],o.z=t[r+2],i.add(o,this.center,o)},u.prototype.decodeTextureCoordinates=function(i,r,o){return n(o)||(o=new t),r*=this.getStride(),this.quantization===l.BITS12?e.decompressTextureCoordinates(i[r+2],o):t.fromElements(i[r+4],i[r+5],o)},u.prototype.decodeHeight=function(t,i){if(i*=this.getStride(),this.quantization===l.BITS12){var r=e.decompressTextureCoordinates(t[i+1],d);return r.y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight}return t[i+3]},u.prototype.getOctEncodedNormal=function(e,i,r){var n=this.getStride();i=(i+1)*n-1;var o=e[i]/256,a=Math.floor(o),s=256*(o-a);return t.fromElements(a,s,r)},u.prototype.getStride=function(){var e;switch(this.quantization){case l.BITS12:e=3;break;default:e=6}return this.hasVertexNormals&&++e,e};var v={position3DAndHeight:0,textureCoordAndEncodedNormals:1},g={compressed:0};return u.prototype.getAttributes=function(e){var t=r.FLOAT;if(this.quantization===l.NONE){var i=r.getSizeInBytes(t),n=4,o=this.hasVertexNormals?3:2,a=(this.hasVertexNormals?7:6)*i;return[{index:v.position3DAndHeight,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:n,offsetInBytes:0,strideInBytes:a},{index:v.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:o,offsetInBytes:n*i,strideInBytes:a}]}var s=3;return s+=this.hasVertexNormals?1:0,[{index:g.compressed,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:s}]},u.prototype.getAttributeLocations=function(){return this.quantization===l.NONE?v:g},u.clone=function(e,t){return n(t)||(t=new u),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=i.clone(e.center),t.toScaledENU=s.clone(e.toScaledENU),t.fromScaledENU=s.clone(e.fromScaledENU),t.matrix=s.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t},u}),i("Core/HeightmapTessellator",["./AxisAlignedBoundingBox","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidalOccluder","./freezeObject","./Math","./Matrix4","./OrientedBoundingBox","./Rectangle","./TerrainEncoding","./Transforms"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f){"use strict";var v={};v.DEFAULT_STRUCTURE=u({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var g=new r,_=new h,y=new r,C=new r;return v.computeVertices=function(a){var u,E,S,w,T=Math.cos,x=Math.sin,b=Math.sqrt,A=Math.atan,P=Math.exp,I=c.PI_OVER_TWO,M=c.toRadians,D=a.heightmap,R=a.width,O=a.height,N=a.skirtHeight,L=n(a.isGeographic,!0),F=n(a.ellipsoid,s.WGS84),B=1/F.maximumRadius,V=a.nativeRectangle,k=a.rectangle;o(k)?(u=k.west,E=k.south,S=k.east,w=k.north):L?(u=M(V.west),E=M(V.south),S=M(V.east),w=M(V.north)):(u=V.west*B,E=I-2*A(P(-V.south*B)),S=V.east*B,w=I-2*A(P(-V.north*B)));var z=n(a.relativeToCenter,r.ZERO),U=n(a.exaggeration,1),G=n(a.structure,v.DEFAULT_STRUCTURE),W=n(G.heightScale,v.DEFAULT_STRUCTURE.heightScale),H=n(G.heightOffset,v.DEFAULT_STRUCTURE.heightOffset),q=n(G.elementsPerHeight,v.DEFAULT_STRUCTURE.elementsPerHeight),j=n(G.stride,v.DEFAULT_STRUCTURE.stride),Y=n(G.elementMultiplier,v.DEFAULT_STRUCTURE.elementMultiplier),X=n(G.isBigEndian,v.DEFAULT_STRUCTURE.isBigEndian),Z=m.computeWidth(V)/(R-1),K=m.computeHeight(V)/(O-1),Q=F.radiiSquared,J=Q.x,$=Q.y,ee=Q.z,te=65536,ie=-65536,re=f.eastNorthUpToFixedFrame(z,F),ne=h.inverseTransformation(re,_),oe=y;oe.x=Number.POSITIVE_INFINITY,oe.y=Number.POSITIVE_INFINITY,oe.z=Number.POSITIVE_INFINITY;var ae=C;ae.x=Number.NEGATIVE_INFINITY,ae.y=Number.NEGATIVE_INFINITY,ae.z=Number.NEGATIVE_INFINITY;var se=Number.POSITIVE_INFINITY,le=R+(N>0?2:0),ue=O+(N>0?2:0),ce=le*ue,he=new Array(ce),de=new Array(ce),me=new Array(ce),pe=0,fe=O,ve=0,ge=R;N>0&&(--pe,++fe,--ve,++ge);for(var _e=0,ye=pe;fe>ye;++ye){var Ce=ye;0>Ce&&(Ce=0),Ce>=O&&(Ce=O-1);var Ee=V.north-K*Ce;Ee=L?M(Ee):I-2*A(P(-Ee*B));var Se=T(Ee),we=x(Ee),Te=ee*we,xe=(Ee-E)/(w-E);xe=c.clamp(xe,0,1);for(var be=ve;ge>be;++be){var Ae=be;0>Ae&&(Ae=0),Ae>=R&&(Ae=R-1);var Pe=V.west+Z*Ae;L?Pe=M(Pe):Pe*=B;var Ie,Me=Ce*(R*j)+Ae*j;if(1===q)Ie=D[Me];else{Ie=0;var De;if(X)for(De=0;q>De;++De)Ie=Ie*Y+D[Me+De];else for(De=q-1;De>=0;--De)Ie=Ie*Y+D[Me+De]}Ie=(Ie*W+H)*U,ie=Math.max(ie,Ie),te=Math.min(te,Ie),(be!==Ae||ye!==Ce)&&(Ie-=N);var Re=Se*T(Pe),Oe=Se*x(Pe),Ne=J*Re,Le=$*Oe,Fe=b(Ne*Re+Le*Oe+Te*we),Be=1/Fe,Ve=Ne*Be,ke=Le*Be,ze=Te*Be,Ue=new r;Ue.x=Ve+Re*Ie,Ue.y=ke+Oe*Ie,Ue.z=ze+we*Ie,he[_e]=Ue,de[_e]=Ie;var Ge=(Pe-u)/(S-u);Ge=c.clamp(Ge,0,1),me[_e]=new i(Ge,xe),_e++,h.multiplyByPoint(ne,Ue,g),r.minimumByComponent(g,oe,oe),r.maximumByComponent(g,ae,ae),se=Math.min(se,Ie)}}var We,He=t.fromPoints(he);o(k)&&k.width<c.PI_OVER_TWO+c.EPSILON5&&(We=d.fromRectangle(k,te,ie,F));var qe,je=a.relativetoCenter;if(o(je)){var Ye=new l(F);qe=Ye.computeHorizonCullingPointFromPoints(je,he)}for(var Xe=new e(oe,ae,z),Ze=new p(Xe,se,ie,re,!1),Ke=new Float32Array(ce*Ze.getStride()),Qe=0,Je=0;ce>Je;++Je)Qe=Ze.encode(Ke,Qe,he[Je],me[Je],de[Je]);return{vertices:Ke,maximumHeight:ie,minimumHeight:te,encoding:Ze,boundingSphere3D:He,orientedBoundingBox:We,occludeePointInScaledSpace:qe}},v}),i("Core/destroyObject",["./defaultValue","./DeveloperError"],function(e,t){"use strict";function i(){return!0}function r(r,n){function o(){throw new t(n)}n=e(n,"This object was destroyed, i.e., destroy() was called.");for(var a in r)"function"==typeof r[a]&&(r[a]=o);r.isDestroyed=i}return r}),i("Core/isCrossOriginUrl",["./defined"],function(e){"use strict";function t(t){e(i)||(i=document.createElement("a")),i.href=window.location.href;var r=i.host,n=i.protocol;return i.href=t,i.href=i.href,n!==i.protocol||r!==i.host}var i;return t}),i("Core/TaskProcessor",["../ThirdParty/Uri","../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./destroyObject","./DeveloperError","./getAbsoluteUri","./isCrossOriginUrl","./RuntimeError","require"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(){if(!n(v._canTransferArrayBuffer)){var e=new Worker(m("Workers/transferTypedArrayTest.js"));e.postMessage=r(e.webkitPostMessage,e.postMessage);var i=99,o=new Int8Array([i]);try{e.postMessage({array:o},[o.buffer])}catch(a){return v._canTransferArrayBuffer=!1,v._canTransferArrayBuffer}var s=t.defer();e.onmessage=function(t){var r=t.data.array,o=n(r)&&r[0]===i;s.resolve(o),e.terminate(),v._canTransferArrayBuffer=o},v._canTransferArrayBuffer=s.promise}return v._canTransferArrayBuffer}function d(e,t){--e._activeTasks;var i=t.id;if(n(i)){var r=e._deferreds,o=r[i];if(n(t.error)){var s=t.error;"RuntimeError"===s.name?(s=new u(t.error.message),s.stack=t.error.stack):"DeveloperError"===s.name&&(s=new a(t.error.message),s.stack=t.error.stack),o.reject(s)}else o.resolve(t.result);delete r[i]}}function m(e){var t=i(e);if(l(t)){var r,n='importScripts("'+t+'");';try{r=new Blob([n],{type:"application/javascript"})}catch(o){var a=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,s=new a;s.append(n),r=s.getBlob("application/javascript")}var u=window.URL||window.webkitURL;t=u.createObjectURL(r)}return t}function p(){ +return n(g)||(g=m("Workers/cesiumWorkerBootstrapper.js")),g}function f(e){var t=new Worker(p());t.postMessage=r(t.webkitPostMessage,t.postMessage);var o={loaderConfig:{},workerModule:v._workerModulePrefix+e._workerName};return n(v._loaderConfig)?o.loaderConfig=v._loaderConfig:n(c.toUrl)?o.loaderConfig.baseUrl=s("..",i("Workers/cesiumWorkerBootstrapper.js")):o.loaderConfig.paths={Workers:i("Workers")},t.postMessage(o),t.onmessage=function(t){d(e,t.data)},t}function v(e,t){this._workerName=e,this._maximumActiveTasks=r(t,5),this._activeTasks=0,this._deferreds={},this._nextID=0}var g,_=[];return v.prototype.scheduleTask=function(e,i){if(n(this._worker)||(this._worker=f(this)),!(this._activeTasks>=this._maximumActiveTasks)){++this._activeTasks;var r=this;return t(h(),function(o){n(i)?o||(i.length=0):i=_;var a=r._nextID++,s=t.defer();return r._deferreds[a]=s,r._worker.postMessage({id:a,parameters:e,canTransferArrayBuffer:o},i),s.promise})}},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){return n(this._worker)&&this._worker.terminate(),o(this)},v._defaultWorkerModulePrefix="Workers/",v._workerModulePrefix=v._defaultWorkerModulePrefix,v._loaderConfig=void 0,v._canTransferArrayBuffer=void 0,v}),i("Core/TerrainMesh",["../Core/defaultValue"],function(e){"use strict";function t(t,i,r,n,o,a,s,l,u,c){this.center=t,this.vertices=i,this.stride=e(l,6),this.indices=r,this.minimumHeight=n,this.maximumHeight=o,this.boundingSphere3D=a,this.occludeePointInScaledSpace=s,this.orientedBoundingBox=u,this.encoding=c}return t}),i("Core/TerrainProvider",["./defined","./defineProperties","./DeveloperError","./Math"],function(e,t,i,r){"use strict";function n(){i.throwInstantiationError()}t(n.prototype,{errorEvent:{get:i.throwInstantiationError},credit:{get:i.throwInstantiationError},tilingScheme:{get:i.throwInstantiationError},ready:{get:i.throwInstantiationError},readyPromise:{get:i.throwInstantiationError},hasWaterMask:{get:i.throwInstantiationError},hasVertexNormals:{get:i.throwInstantiationError}});var o=[];return n.getRegularGridIndices=function(t,i){var r=o[t];e(r)||(o[t]=r=[]);var n=r[i];if(!e(n)){n=r[i]=new Uint16Array((t-1)*(i-1)*6);for(var a=0,s=0,l=0;i-1>l;++l){for(var u=0;t-1>u;++u){var c=a,h=c+t,d=h+1,m=c+1;n[s++]=c,n[s++]=h,n[s++]=m,n[s++]=m,n[s++]=h,n[s++]=d,++a}++a}}return n},n.heightmapTerrainQuality=.25,n.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,i){return 2*e.maximumRadius*Math.PI*n.heightmapTerrainQuality/(t*i)},n.prototype.requestTileGeometry=i.throwInstantiationError,n.prototype.getLevelMaximumGeometricError=i.throwInstantiationError,n.prototype.getTileDataAvailable=i.throwInstantiationError,n}),i("Core/HeightmapTerrainData",["../ThirdParty/when","./defaultValue","./defined","./defineProperties","./DeveloperError","./GeographicTilingScheme","./HeightmapTessellator","./Math","./Rectangle","./TaskProcessor","./TerrainEncoding","./TerrainMesh","./TerrainProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function m(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=t(e.childTileMask,15);var r=a.DEFAULT_STRUCTURE,n=e.structure;i(n)?n!==r&&(n.heightScale=t(n.heightScale,r.heightScale),n.heightOffset=t(n.heightOffset,r.heightOffset),n.elementsPerHeight=t(n.elementsPerHeight,r.elementsPerHeight),n.stride=t(n.stride,r.stride),n.elementMultiplier=t(n.elementMultiplier,r.elementMultiplier),n.isBigEndian=t(n.isBigEndian,r.isBigEndian)):n=r,this._structure=n,this._createdByUpsampling=t(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0}function p(e,t,i,r,n,o,a,s,l,u){var c=(l-o.west)*(a-1)/(o.east-o.west),h=(u-o.south)*(s-1)/(o.north-o.south),d=0|c,m=d+1;m>=a&&(m=a-1,d=a-2);var p=0|h,f=p+1;f>=s&&(f=s-1,p=s-2);var _=c-d,y=h-p;p=s-1-p,f=s-1-f;var C=g(e,t,i,r,n,p*a+d),E=g(e,t,i,r,n,p*a+m),S=g(e,t,i,r,n,f*a+d),w=g(e,t,i,r,n,f*a+m);return v(_,y,C,E,S,w)}function f(e,t,i,r,n,o,a,s,l,u){var c=(l-o.west)*(a-1)/(o.east-o.west),h=(u-o.south)*(s-1)/(o.north-o.south);n>0&&(c+=1,h+=1,a+=2,s+=2);var d=n>0?a-1:a,m=0|c,p=m+1;p>=d&&(p=a-1,m=a-2);var f=n>0?s-1:s,g=0|h,_=g+1;_>=f&&(_=s-1,g=s-2);var y=c-m,C=h-g;g=s-1-g,_=s-1-_;var E=(t.decodeHeight(e,g*a+m)-i)/r,S=(t.decodeHeight(e,g*a+p)-i)/r,w=(t.decodeHeight(e,_*a+m)-i)/r,T=(t.decodeHeight(e,_*a+p)-i)/r;return v(y,C,E,S,w,T)}function v(e,t,i,r,n,o){return e>t?i+e*(r-i)+t*(o-r):i+e*(o-n)+t*(n-i)}function g(e,t,i,r,n,o){o*=r;var a,s=0;if(n)for(a=0;t>a;++a)s=s*i+e[o+a];else for(a=t-1;a>=0;--a)s=s*i+e[o+a];return s}function _(e,t,i,r,n,o,a,s){a*=n;var l;if(o)for(l=0;t>l;++l)e[a+l]=s/r,s-=e[a+l]*r,r/=i;else for(l=t-1;l>=0;--l)e[a+l]=s/r,s-=e[a+l]*r,r/=i}r(m.prototype,{waterMask:{get:function(){return this._waterMask}}});var y=new u("createVerticesFromHeightmap");return m.prototype.createMesh=function(r,n,a,s,u){var m=r.ellipsoid,p=r.tileXYToNativeRectangle(n,a,s),f=r.tileXYToRectangle(n,a,s);u=t(u,1);var v=m.cartographicToCartesian(l.center(f)),g=this._structure,_=d.getEstimatedLevelZeroGeometricErrorForAHeightmap(m,this._width,r.getNumberOfXTilesAtLevel(0)),C=_/(1<<s);this._skirtHeight=Math.min(4*C,1e3);var E=y.scheduleTask({heightmap:this._buffer,structure:g,width:this._width,height:this._height,nativeRectangle:p,rectangle:f,relativeToCenter:v,ellipsoid:m,skirtHeight:this._skirtHeight,isGeographic:r instanceof o,exaggeration:u});if(i(E)){var S=this;return e(E,function(e){return S._mesh=new h(v,new Float32Array(e.vertices),d.getRegularGridIndices(e.gridWidth,e.gridHeight),e.minimumHeight,e.maximumHeight,e.boundingSphere3D,e.occludeePointInScaledSpace,6,e.orientedBoundingBox,c.clone(e.encoding)),S._buffer=void 0,S._mesh})}},m.prototype.interpolateHeight=function(e,t,r){var n,o=this._width,a=this._height,s=this._structure,l=s.stride,u=s.elementsPerHeight,c=s.elementMultiplier,h=s.isBigEndian,d=s.heightOffset,m=s.heightScale;if(i(this._mesh)){var v=this._mesh.vertices,g=this._mesh.encoding,_=this._skirtHeight;n=f(v,g,d,m,_,e,o,a,t,r)}else n=p(this._buffer,u,c,l,h,e,o,a,t,r),n=n*m+d;return n},m.prototype.upsample=function(e,t,r,n,o,a,l){var u=this._width,c=this._height,h=this._structure,d=this._skirtHeight,p=h.stride,v=new this._bufferType(u*c*p),g=this._mesh;if(i(g)){for(var y=g.vertices,C=g.encoding,E=e.tileXYToRectangle(t,r,n),S=e.tileXYToRectangle(o,a,l),w=h.heightOffset,T=h.heightScale,x=h.elementsPerHeight,b=h.elementMultiplier,A=h.isBigEndian,P=Math.pow(b,x-1),I=0;c>I;++I)for(var M=s.lerp(S.north,S.south,I/(c-1)),D=0;u>D;++D){var R=s.lerp(S.west,S.east,D/(u-1)),O=f(y,C,w,T,d,E,u,c,R,M);_(v,x,b,P,p,A,I*u+D,O)}return new m({buffer:v,width:u,height:c,childTileMask:0,structure:this._structure,createdByUpsampling:!0})}},m.prototype.isChildAvailable=function(e,t,i,r){var n=2;return i!==2*e&&++n,r!==2*t&&(n-=2),0!==(this._childTileMask&1<<n)},m.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling},m}),i("Core/loadImage",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./isCrossOriginUrl"],function(e,t,i,r,n){"use strict";function o(i,r){r=t(r,t.EMPTY_OBJECT);var s=t(r.allowCrossOrigin,!0),l=t(r.withCredentials,!1);return e(i,function(t){var i;!a.test(t)&&s&&l!==!0&&(s=n(t));var r=e.defer();return s&&(i=l?"use-credentials":""),o.createImage(t,i,r),r.promise})}var a=/^data:/;return o.createImage=function(e,t,i){var r=new Image;r.onload=function(){i.resolve(r)},r.onerror=function(e){i.reject(e)},r.crossOrigin=t,r.src=e},o.defaultCreateImage=o.createImage,o}),i("Core/throttleRequestByServer",["../ThirdParty/Uri","../ThirdParty/when","./defaultValue"],function(e,t,i){"use strict";function r(t){var i=new e(t).resolve(a);i.normalize();var r=i.authority;return/:/.test(r)||(r=r+":"+("https"===i.scheme?"443":"80")),r}function n(e,a,s){var l=r(e),u=i(o[l],0),c=n.maximumRequestsPerServer;return s.maximumRequests&&(c=s.maximumRequests),u>=c?void 0:(o[l]=u+1,t(a(e,s),function(e){return o[l]--,e}).otherwise(function(e){return o[l]--,t.reject(e)}))}var o={},a="undefined"!=typeof document?new e(document.location.href):new e;return n.maximumRequestsPerServer=6,n}),i("Core/ArcGisImageServerTerrainProvider",["../ThirdParty/when","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Event","./GeographicTilingScheme","./getImagePixels","./HeightmapTerrainData","./loadImage","./Math","./TerrainProvider","./throttleRequestByServer"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(n){this._url=n.url,this._token=n.token,this._tilingScheme=n.tilingScheme,r(this._tilingScheme)||(this._tilingScheme=new l({ellipsoid:i(n.ellipsoid,a.WGS84)})),this._heightmapWidth=65,this._levelZeroMaximumGeometricError=m.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,this._heightmapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._proxy=n.proxy,this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0},this._errorEvent=new s;var o=n.credit;"string"==typeof o&&(o=new t(o)),this._credit=o,this._readyPromise=e.resolve(!0)}return n(f.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),f.prototype.requestTileGeometry=function(t,i,n){var o=this._tilingScheme.tileXYToRectangle(t,i,n),a=(o.east-o.west)/(this._heightmapWidth-1),s=(o.north-o.south)/(this._heightmapWidth-1);o.west-=.5*a,o.east+=.5*a,o.south-=.5*s,o.north+=.5*s;var l=d.toDegrees(o.west)+"%2C"+d.toDegrees(o.south)+"%2C"+d.toDegrees(o.east)+"%2C"+d.toDegrees(o.north),m=this._url+"/exportImage?interpolation=RSP_BilinearInterpolation&format=tiff&f=image&size="+this._heightmapWidth+"%2C"+this._heightmapWidth+"&bboxSR=4326&imageSR=4326&bbox="+l;this._token&&(m+="&token="+this._token);var f=this._proxy;r(f)&&(m=f.getURL(m));var v=p(m,h);if(r(v)){var g=this;return e(v,function(e){return new c({buffer:u(e),width:g._heightmapWidth,height:g._heightmapWidth,childTileMask:15,structure:g._terrainDataStructure})})}},f.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},f.prototype.getTileDataAvailable=function(e,t,i){},f}),i("Core/AssociativeArray",["./defined","./defineProperties","./DeveloperError"],function(e,t,i){"use strict";function r(){this._array=[],this._hash={}}return t(r.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}}),r.prototype.contains=function(t){return e(this._hash[t])},r.prototype.set=function(e,t){var i=this._hash[e];t!==i&&(this.remove(e),this._hash[e]=t,this._array.push(t))},r.prototype.get=function(e){return this._hash[e]},r.prototype.remove=function(t){var i=this._hash[t],r=e(i);if(r){var n=this._array;n.splice(n.indexOf(i),1),delete this._hash[t]}return r},r.prototype.removeAll=function(){var e=this._array;e.length>0&&(this._hash={},e.length=0)},r}),i("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,i,r){"use strict";function n(r,n,l,u,c){i(c)||(c=new t);var h,d,m,p,f,v,g,_;i(n.z)?(h=t.subtract(l,n,o),d=t.subtract(u,n,a),m=t.subtract(r,n,s),p=t.dot(h,h),f=t.dot(h,d),v=t.dot(h,m),g=t.dot(d,d),_=t.dot(d,m)):(h=e.subtract(l,n,o),d=e.subtract(u,n,a),m=e.subtract(r,n,s),p=e.dot(h,h),f=e.dot(h,d),v=e.dot(h,m),g=e.dot(d,d),_=e.dot(d,m));var y=1/(p*g-f*f);return c.y=(g*v-f*_)*y,c.z=(p*_-f*v)*y,c.x=1-c.y-c.z,c}var o=new t,a=new t,s=new t;return n}),i("Core/BingMapsApi",["./defined"],function(e){"use strict";var t={};t.defaultKey=void 0;var i=!1;return t.getKey=function(r){return e(r)?r:e(t.defaultKey)?t.defaultKey:(i||(console.log("This application is using Cesium's default Bing Maps key. Please create a new key for the application as soon as possible and prior to deployment by visiting https://www.bingmapsportal.com/, and provide your key to Cesium by setting the Cesium.BingMapsApi.defaultKey property before constructing the CesiumWidget or any other object that uses the Bing Maps API."),i=!0),"Aj1ony_-Typ-KjG9SJWiKSHY23U1KmK7yAmZa9lDmuF2osXWkcZ22VPsqmCt0TCt")},t}),i("Core/BoundingRectangle",["./Cartesian2","./Cartographic","./defaultValue","./defined","./DeveloperError","./GeographicProjection","./Intersect","./Rectangle"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t,r,n){this.x=i(e,0),this.y=i(t,0),this.width=i(r,0),this.height=i(n,0)}l.fromPoints=function(e,t){if(r(t)||(t=new l),!r(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;for(var i=e.length,n=e[0].x,o=e[0].y,a=e[0].x,s=e[0].y,u=1;i>u;u++){var c=e[u],h=c.x,d=c.y;n=Math.min(h,n),a=Math.max(h,a),o=Math.min(d,o),s=Math.max(d,s)}return t.x=n,t.y=o,t.width=a-n,t.height=s-o,t};var u=new o,c=new t,h=new t;return l.fromRectangle=function(t,n,o){if(r(o)||(o=new l),!r(t))return o.x=0,o.y=0,o.width=0,o.height=0,o;n=i(n,u);var a=n.project(s.southwest(t,c)),d=n.project(s.northeast(t,h));return e.subtract(d,a,d),o.x=a.x,o.y=a.y,o.width=d.x,o.height=d.y,o},l.clone=function(e,t){return r(e)?r(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new l(e.x,e.y,e.width,e.height):void 0},l.union=function(e,t,i){r(i)||(i=new l);var n=Math.min(e.x,t.x),o=Math.min(e.y,t.y),a=Math.max(e.x+e.width,t.x+t.width),s=Math.max(e.y+e.height,t.y+t.height);return i.x=n,i.y=o,i.width=a-n,i.height=s-o,i},l.expand=function(e,t,i){i=l.clone(e,i);var r=t.x-i.x,n=t.y-i.y;return r>i.width?i.width=r:0>r&&(i.width-=r,i.x=t.x),n>i.height?i.height=n:0>n&&(i.height-=n,i.y=t.y),i},l.intersect=function(e,t){var i=e.x,r=e.y,n=t.x,o=t.y;return i>n+t.width||i+e.width<n||r+e.height<o||r>o+t.height?a.OUTSIDE:a.INTERSECTING},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.intersect=function(e){return l.intersect(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l}),i("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),i("Core/PrimitiveType",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"use strict";var i={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(e){return e===i.POINTS||e===i.LINES||e===i.LINE_LOOP||e===i.LINE_STRIP||e===i.TRIANGLES||e===i.TRIANGLE_STRIP||e===i.TRIANGLE_FAN}};return t(i)}),i("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,i,r,n){"use strict";function o(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,n.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=void 0}return o.computeNumberOfVertices=function(e){var r=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var o=e.attributes[n],a=o.values.length/o.componentsPerAttribute;if(r!==a&&-1!==r)throw new i("All attribute lists must have the same number of attributes.");r=a}return r},o}),i("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),i("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color}return t}),i("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,i,r){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.binormal=e(t.binormal,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return n.POSITION_ONLY=r(new n({position:!0})),n.POSITION_AND_NORMAL=r(new n({position:!0,normal:!0})),n.POSITION_NORMAL_AND_ST=r(new n({position:!0,normal:!0,st:!0})),n.POSITION_AND_ST=r(new n({position:!0,st:!0})),n.POSITION_AND_COLOR=r(new n({position:!0,color:!0})),n.ALL=r(new n({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),n.DEFAULT=n.POSITION_NORMAL_AND_ST,n.packedLength=6,n.pack=function(t,i,r){r=e(r,0),i[r++]=t.position?1:0,i[r++]=t.normal?1:0,i[r++]=t.st?1:0,i[r++]=t.binormal?1:0,i[r++]=t.tangent?1:0,i[r++]=t.color?1:0},n.unpack=function(i,r,o){return r=e(r,0),t(o)||(o=new n),o.position=1===i[r++],o.normal=1===i[r++],o.st=1===i[r++],o.binormal=1===i[r++],o.tangent=1===i[r++],o.color=1===i[r++],o},n.clone=function(e,i){return t(e)?(t(i)||(i=new n),i.position=e.position,i.normal=e.normal,i.st=e.st,i.binormal=e.binormal,i.tangent=e.tangent,i.color=e.color,i):void 0},n}),i("Core/BoxGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e){e=r(e,r.EMPTY_OBJECT);var i=e.minimum,n=e.maximum,o=r(e.vertexFormat,c.DEFAULT);this._minimum=t.clone(i),this._maximum=t.clone(n),this._vertexFormat=o,this._workerName="createBoxGeometry"}var d=new t;h.fromDimensions=function(e){e=r(e,r.EMPTY_OBJECT);var i=e.dimensions,n=t.multiplyByScalar(i,.5,new t);return new h({minimum:t.negate(n,new t),maximum:n,vertexFormat:e.vertexFormat})},h.fromAxisAlignedBoundingBox=function(e){if(!n(e))throw new o("boundingBox is required.");return new h({minimum:e.minimum,maximum:e.maximum})},h.fromAxisAlignedBoundingBox=function(e){if(!n(e))throw new o("boundingBox is required.");return new h({minimum:e.minimum,maximum:e.maximum})},h.packedLength=2*t.packedLength+c.packedLength,h.pack=function(e,i,n){n=r(n,0),t.pack(e._minimum,i,n),t.pack(e._maximum,i,n+t.packedLength),c.pack(e._vertexFormat,i,n+2*t.packedLength)};var m=new t,p=new t,f=new c,v={minimum:m,maximum:p,vertexFormat:f};return h.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,m),s=t.unpack(e,i+t.packedLength,p),l=c.unpack(e,i+2*t.packedLength,f);return n(o)?(o._minimum=t.clone(a,o._minimum),o._maximum=t.clone(s,o._maximum),o._vertexFormat=c.clone(l,o._vertexFormat),o):new h(v)},h.createGeometry=function(r){var n,o,c=r._minimum,h=r._maximum,m=r._vertexFormat,p=new l;if(m.position&&(m.st||m.normal||m.binormal||m.tangent)){if(m.position&&(o=new Float64Array(72),o[0]=c.x,o[1]=c.y,o[2]=h.z,o[3]=h.x,o[4]=c.y,o[5]=h.z,o[6]=h.x,o[7]=h.y,o[8]=h.z,o[9]=c.x,o[10]=h.y,o[11]=h.z,o[12]=c.x,o[13]=c.y,o[14]=c.z,o[15]=h.x,o[16]=c.y,o[17]=c.z,o[18]=h.x,o[19]=h.y,o[20]=c.z,o[21]=c.x,o[22]=h.y,o[23]=c.z,o[24]=h.x,o[25]=c.y,o[26]=c.z,o[27]=h.x,o[28]=h.y,o[29]=c.z,o[30]=h.x,o[31]=h.y,o[32]=h.z,o[33]=h.x,o[34]=c.y,o[35]=h.z,o[36]=c.x,o[37]=c.y,o[38]=c.z,o[39]=c.x,o[40]=h.y,o[41]=c.z,o[42]=c.x,o[43]=h.y,o[44]=h.z,o[45]=c.x,o[46]=c.y,o[47]=h.z,o[48]=c.x,o[49]=h.y,o[50]=c.z,o[51]=h.x,o[52]=h.y,o[53]=c.z,o[54]=h.x,o[55]=h.y,o[56]=h.z,o[57]=c.x,o[58]=h.y,o[59]=h.z,o[60]=c.x,o[61]=c.y,o[62]=c.z,o[63]=h.x,o[64]=c.y,o[65]=c.z,o[66]=h.x,o[67]=c.y,o[68]=h.z,o[69]=c.x,o[70]=c.y,o[71]=h.z,p.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:o})),m.normal){var f=new Float32Array(72);f[0]=0,f[1]=0,f[2]=1,f[3]=0,f[4]=0,f[5]=1,f[6]=0,f[7]=0,f[8]=1,f[9]=0,f[10]=0,f[11]=1,f[12]=0,f[13]=0,f[14]=-1,f[15]=0,f[16]=0,f[17]=-1,f[18]=0,f[19]=0,f[20]=-1,f[21]=0,f[22]=0,f[23]=-1,f[24]=1,f[25]=0,f[26]=0,f[27]=1,f[28]=0,f[29]=0,f[30]=1,f[31]=0,f[32]=0,f[33]=1,f[34]=0,f[35]=0,f[36]=-1,f[37]=0,f[38]=0,f[39]=-1,f[40]=0,f[41]=0,f[42]=-1,f[43]=0,f[44]=0,f[45]=-1,f[46]=0,f[47]=0,f[48]=0,f[49]=1,f[50]=0,f[51]=0,f[52]=1,f[53]=0,f[54]=0,f[55]=1,f[56]=0,f[57]=0,f[58]=1,f[59]=0,f[60]=0,f[61]=-1,f[62]=0,f[63]=0,f[64]=-1,f[65]=0,f[66]=0,f[67]=-1,f[68]=0,f[69]=0,f[70]=-1,f[71]=0,p.normal=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:f})}if(m.st){var v=new Float32Array(48);v[0]=0,v[1]=0,v[2]=1,v[3]=0,v[4]=1,v[5]=1,v[6]=0,v[7]=1,v[8]=1,v[9]=0,v[10]=0,v[11]=0,v[12]=0,v[13]=1,v[14]=1,v[15]=1,v[16]=0,v[17]=0,v[18]=1,v[19]=0,v[20]=1,v[21]=1,v[22]=0,v[23]=1,v[24]=1,v[25]=0,v[26]=0,v[27]=0,v[28]=0,v[29]=1,v[30]=1,v[31]=1,v[32]=1,v[33]=0,v[34]=0,v[35]=0,v[36]=0,v[37]=1,v[38]=1,v[39]=1,v[40]=0,v[41]=0,v[42]=1,v[43]=0,v[44]=1,v[45]=1,v[46]=0,v[47]=1,p.st=new s({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:v})}if(m.tangent){var g=new Float32Array(72);g[0]=1,g[1]=0,g[2]=0,g[3]=1,g[4]=0,g[5]=0,g[6]=1,g[7]=0,g[8]=0,g[9]=1,g[10]=0,g[11]=0,g[12]=-1,g[13]=0,g[14]=0,g[15]=-1,g[16]=0,g[17]=0,g[18]=-1,g[19]=0,g[20]=0,g[21]=-1,g[22]=0,g[23]=0,g[24]=0,g[25]=1,g[26]=0,g[27]=0,g[28]=1,g[29]=0,g[30]=0,g[31]=1,g[32]=0,g[33]=0,g[34]=1,g[35]=0,g[36]=0,g[37]=-1,g[38]=0,g[39]=0,g[40]=-1,g[41]=0,g[42]=0,g[43]=-1,g[44]=0,g[45]=0,g[46]=-1,g[47]=0,g[48]=-1,g[49]=0,g[50]=0,g[51]=-1,g[52]=0,g[53]=0,g[54]=-1,g[55]=0,g[56]=0,g[57]=-1,g[58]=0,g[59]=0,g[60]=1,g[61]=0,g[62]=0,g[63]=1,g[64]=0,g[65]=0,g[66]=1,g[67]=0,g[68]=0,g[69]=1,g[70]=0,g[71]=0,p.tangent=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:g})}if(m.binormal){var _=new Float32Array(72);_[0]=0,_[1]=1,_[2]=0,_[3]=0,_[4]=1,_[5]=0,_[6]=0,_[7]=1,_[8]=0,_[9]=0,_[10]=1,_[11]=0,_[12]=0,_[13]=1,_[14]=0,_[15]=0,_[16]=1,_[17]=0,_[18]=0,_[19]=1,_[20]=0,_[21]=0,_[22]=1,_[23]=0,_[24]=0,_[25]=0,_[26]=1,_[27]=0,_[28]=0,_[29]=1,_[30]=0,_[31]=0,_[32]=1,_[33]=0,_[34]=0,_[35]=1,_[36]=0,_[37]=0,_[38]=1,_[39]=0,_[40]=0,_[41]=1,_[42]=0,_[43]=0,_[44]=1,_[45]=0,_[46]=0,_[47]=1,_[48]=0,_[49]=0,_[50]=1,_[51]=0,_[52]=0,_[53]=1,_[54]=0,_[55]=0,_[56]=1,_[57]=0,_[58]=0,_[59]=1,_[60]=0,_[61]=0,_[62]=1,_[63]=0,_[64]=0,_[65]=1,_[66]=0,_[67]=0,_[68]=1,_[69]=0,_[70]=0,_[71]=1,p.binormal=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:_})}n=new Uint16Array(36),n[0]=0,n[1]=1,n[2]=2,n[3]=0,n[4]=2,n[5]=3,n[6]=6,n[7]=5,n[8]=4,n[9]=7,n[10]=6,n[11]=4,n[12]=8,n[13]=9,n[14]=10,n[15]=8,n[16]=10,n[17]=11,n[18]=14,n[19]=13,n[20]=12,n[21]=15,n[22]=14,n[23]=12,n[24]=18,n[25]=17,n[26]=16,n[27]=19,n[28]=18,n[29]=16,n[30]=20,n[31]=21,n[32]=22,n[33]=20,n[34]=22,n[35]=23}else o=new Float64Array(24),o[0]=c.x,o[1]=c.y,o[2]=c.z,o[3]=h.x,o[4]=c.y,o[5]=c.z,o[6]=h.x,o[7]=h.y,o[8]=c.z,o[9]=c.x,o[10]=h.y,o[11]=c.z,o[12]=c.x,o[13]=c.y,o[14]=h.z,o[15]=h.x,o[16]=c.y,o[17]=h.z,o[18]=h.x,o[19]=h.y,o[20]=h.z,o[21]=c.x,o[22]=h.y,o[23]=h.z,p.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:o}),n=new Uint16Array(36),n[0]=4,n[1]=5,n[2]=6,n[3]=4,n[4]=6,n[5]=7,n[6]=1,n[7]=0,n[8]=3,n[9]=1,n[10]=3,n[11]=2,n[12]=1,n[13]=6,n[14]=5,n[15]=1,n[16]=2,n[17]=6,n[18]=2,n[19]=3,n[20]=7,n[21]=2,n[22]=7,n[23]=6,n[24]=3,n[25]=0,n[26]=4,n[27]=3,n[28]=4,n[29]=7,n[30]=0,n[31]=1,n[32]=5,n[33]=0,n[34]=5,n[35]=4;var y=t.subtract(h,c,d),C=.5*t.magnitude(y);return new a({attributes:p,indices:n,primitiveType:u.TRIANGLES,boundingSphere:new e(t.ZERO,C)})},h}),i("Core/BoxOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e){e=r(e,r.EMPTY_OBJECT);var i=e.minimum,n=e.maximum;this._min=t.clone(i),this._max=t.clone(n),this._workerName="createBoxOutlineGeometry"}var h=new t;c.fromDimensions=function(e){e=r(e,r.EMPTY_OBJECT);var i=e.dimensions,n=t.multiplyByScalar(i,.5,new t);return new c({minimum:t.negate(n,new t),maximum:n})},c.fromAxisAlignedBoundingBox=function(e){if(!n(e))throw new o("boundingBox is required.");return new c({minimum:e.minimum,maximum:e.maximum})},c.packedLength=2*t.packedLength,c.pack=function(e,i,n){n=r(n,0),t.pack(e._min,i,n),t.pack(e._max,i,n+t.packedLength)};var d=new t,m=new t,p={minimum:d,maximum:m};return c.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,d),s=t.unpack(e,i+t.packedLength,m);return n(o)?(o._min=t.clone(a,o._min),o._max=t.clone(s,o._max),o):new c(p)},c.createGeometry=function(r){var n=r._min,o=r._max,c=new l,d=new Uint16Array(24),m=new Float64Array(24);m[0]=n.x,m[1]=n.y,m[2]=n.z,m[3]=o.x,m[4]=n.y,m[5]=n.z,m[6]=o.x,m[7]=o.y,m[8]=n.z,m[9]=n.x,m[10]=o.y,m[11]=n.z,m[12]=n.x,m[13]=n.y,m[14]=o.z,m[15]=o.x,m[16]=n.y,m[17]=o.z,m[18]=o.x,m[19]=o.y,m[20]=o.z,m[21]=n.x,m[22]=o.y,m[23]=o.z,c.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:m}),d[0]=4,d[1]=5,d[2]=5,d[3]=6,d[4]=6,d[5]=7,d[6]=7,d[7]=4,d[8]=0,d[9]=1,d[10]=1,d[11]=2,d[12]=2,d[13]=3,d[14]=3,d[15]=0,d[16]=0,d[17]=4,d[18]=1,d[19]=5,d[20]=2,d[21]=6,d[22]=3,d[23]=7;var p=t.subtract(o,n,h),f=.5*t.magnitude(p);return new a({attributes:c,indices:d,primitiveType:u.LINES,boundingSphere:new e(t.ZERO,f)})},c}),i("Core/cancelAnimationFrame",["./defined"],function(e){"use strict";function t(e){i(e)}if("undefined"!=typeof window){var i=window.cancelAnimationFrame;return function(){if(!e(i))for(var t=["webkit","moz","ms","o"],r=0,n=t.length;n>r&&!e(i);)i=window[t[r]+"CancelAnimationFrame"],e(i)||(i=window[t[r]+"CancelRequestAnimationFrame"]),++r;e(i)||(i=clearTimeout)}(),t}}),i("Core/Spline",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(){this.times=void 0,this.points=void 0,i.throwInstantiationError()}return r.prototype.evaluate=i.throwInstantiationError,r.prototype.findTimeInterval=function(t,i){var r=this.times,n=r.length;if(i=e(i,0),t>=r[i]){if(n>i+1&&t<r[i+1])return i;if(n>i+2&&t<r[i+2])return i+1}else if(i-1>=0&&t>=r[i-1])return i-1;var o;if(t>r[i])for(o=i;n-1>o&&!(t>=r[o]&&t<r[o+1]);++o);else for(o=i-1;o>=0&&!(t>=r[o]&&t<r[o+1]);--o);return o===n-1&&(o=n-2),o},r}),i("Core/LinearSpline",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Spline"],function(e,t,i,r,n,o){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT);var i=e.points,r=e.times;this._times=r,this._points=i,this._lastTimeIndex=0}return r(a.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}}),a.prototype.findTimeInterval=o.prototype.findTimeInterval,a.prototype.evaluate=function(t,r){var n=this.points,o=this.times,a=this._lastTimeIndex=this.findTimeInterval(t,this._lastTimeIndex),s=(t-o[a])/(o[a+1]-o[a]);return i(r)||(r=new e),e.lerp(n[a],n[a+1],s,r)},a}),i("Core/TridiagonalSystemSolver",["./Cartesian3","./defined","./DeveloperError"],function(e,t,i){"use strict";var r={};return r.solve=function(t,i,r,n){var o,a=new Array(r.length),s=new Array(n.length),l=new Array(n.length);for(o=0;o<s.length;o++)s[o]=new e,l[o]=new e;a[0]=r[0]/i[0],s[0]=e.multiplyByScalar(n[0],1/i[0],s[0]);var u;for(o=1;o<a.length;++o)u=1/(i[o]-a[o-1]*t[o-1]),a[o]=r[o]*u,s[o]=e.subtract(n[o],e.multiplyByScalar(s[o-1],t[o-1],s[o]),s[o]),s[o]=e.multiplyByScalar(s[o],u,s[o]);for(u=1/(i[o]-a[o-1]*t[o-1]),s[o]=e.subtract(n[o],e.multiplyByScalar(s[o-1],t[o-1],s[o]),s[o]),s[o]=e.multiplyByScalar(s[o],u,s[o]),l[l.length-1]=s[s.length-1],o=l.length-2;o>=0;--o)l[o]=e.subtract(s[o],e.multiplyByScalar(l[o+1],a[o],l[o]),l[o]);return l},r}),i("Core/HermiteSpline",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./LinearSpline","./Matrix4","./Spline","./TridiagonalSystemSolver"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t,i,n){var o=m,a=f,s=p,l=v;o.length=a.length=t.length-1,s.length=l.length=t.length;var c;o[0]=s[0]=1,a[0]=0;var h=l[0];for(r(h)||(h=l[0]=new e),e.clone(i,h),c=1;c<o.length-1;++c)o[c]=a[c]=1,s[c]=4,h=l[c],r(h)||(h=l[c]=new e),e.subtract(t[c+1],t[c-1],h),e.multiplyByScalar(h,3,h);return o[c]=0,a[c]=1,s[c]=4,h=l[c],r(h)||(h=l[c]=new e),e.subtract(t[c+1],t[c-1],h),e.multiplyByScalar(h,3,h),s[c+1]=1,h=l[c+1],r(h)||(h=l[c+1]=new e),e.clone(n,h),u.solve(o,s,a,l)}function h(t){var i=m,n=f,o=p,a=v;i.length=n.length=t.length-1,o.length=a.length=t.length;var s;i[0]=n[0]=1,o[0]=2;var l=a[0];for(r(l)||(l=a[0]=new e),e.subtract(t[1],t[0],l),e.multiplyByScalar(l,3,l),s=1;s<i.length;++s)i[s]=n[s]=1,o[s]=4,l=a[s],r(l)||(l=a[s]=new e),e.subtract(t[s+1],t[s-1],l),e.multiplyByScalar(l,3,l);return o[s]=2,l=a[s],r(l)||(l=a[s]=new e),e.subtract(t[s],t[s-1],l),e.multiplyByScalar(l,3,l),u.solve(i,o,n,a)}function d(e){e=i(e,i.EMPTY_OBJECT);var t=e.points,r=e.times,n=e.inTangents,o=e.outTangents;this._times=r,this._points=t,this._inTangents=n,this._outTangents=o,this._lastTimeIndex=0}var m=[],p=[],f=[],v=[];n(d.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}}),d.createC1=function(e){e=i(e,i.EMPTY_OBJECT);var t=e.times,r=e.points,n=e.tangents,o=n.slice(0,n.length-1),a=n.slice(1,n.length);return new d({times:t,points:r,inTangents:a,outTangents:o})},d.createNaturalCubic=function(e){e=i(e,i.EMPTY_OBJECT);var t=e.times,r=e.points;if(r.length<3)return new a({points:r,times:t});var n=h(r),o=n.slice(0,n.length-1),s=n.slice(1,n.length);return new d({times:t,points:r,inTangents:s,outTangents:o})},d.createClampedCubic=function(e){e=i(e,i.EMPTY_OBJECT);var t=e.times,r=e.points,n=e.firstTangent,o=e.lastTangent;if(r.length<3)return new a({points:r,times:t});var s=c(r,n,o),l=s.slice(0,s.length-1),u=s.slice(1,s.length);return new d({times:t,points:r,inTangents:u,outTangents:l})},d.hermiteCoefficientMatrix=new s(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0),d.prototype.findTimeInterval=l.prototype.findTimeInterval;var g=new t,_=new e;return d.prototype.evaluate=function(t,i){r(i)||(i=new e);var n=this.points,o=this.times,a=this.inTangents,l=this.outTangents,u=this._lastTimeIndex=this.findTimeInterval(t,this._lastTimeIndex),c=(t-o[u])/(o[u+1]-o[u]),h=g;h.z=c,h.y=c*c,h.x=h.y*c,h.w=1;var m=s.multiplyByVector(d.hermiteCoefficientMatrix,h,h);return i=e.multiplyByScalar(n[u],m.x,i),e.multiplyByScalar(n[u+1],m.y,_),e.add(i,_,i),e.multiplyByScalar(l[u],m.z,_),e.add(i,_,i),e.multiplyByScalar(a[u],m.w,_),e.add(i,_,i)},d}),i("Core/CatmullRomSpline",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./HermiteSpline","./Matrix4","./Spline"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t){var i=t.points,n=t.times;if(i.length<3){var o=n[0],l=1/(n[1]-o),u=i[0],p=i[1];return function(t,i){r(i)||(i=new e);var n=(t-o)*l;return e.lerp(u,p,n,i)}}return function(o,l){r(l)||(l=new e);var u=t._lastTimeIndex=t.findTimeInterval(o,t._lastTimeIndex),p=(o-n[u])/(n[u+1]-n[u]),f=h;f.z=p,f.y=p*p,f.x=f.y*p,f.w=1;var v,g,_,y,C;return 0===u?(v=i[0],g=i[1],_=t.firstTangent,y=e.subtract(i[2],v,d),e.multiplyByScalar(y,.5,y),C=s.multiplyByVector(a.hermiteCoefficientMatrix,f,f)):u===i.length-2?(v=i[u],g=i[u+1],y=t.lastTangent,_=e.subtract(g,i[u-1],d),e.multiplyByScalar(_,.5,_),C=s.multiplyByVector(a.hermiteCoefficientMatrix,f,f)):(v=i[u-1],g=i[u],_=i[u+1],y=i[u+2],C=s.multiplyByVector(c.catmullRomCoefficientMatrix,f,f)),l=e.multiplyByScalar(v,C.x,l),e.multiplyByScalar(g,C.y,m),e.add(l,m,l),e.multiplyByScalar(_,C.z,m),e.add(l,m,l),e.multiplyByScalar(y,C.w,m),e.add(l,m,l)}}function c(t){t=i(t,i.EMPTY_OBJECT);var n=t.points,o=t.times,a=t.firstTangent,s=t.lastTangent;if(n.length>2&&(r(a)||(a=p,e.multiplyByScalar(n[1],2,a),e.subtract(a,n[2],a),e.subtract(a,n[0],a),e.multiplyByScalar(a,.5,a)),!r(s))){var l=n.length-1;s=f,e.multiplyByScalar(n[l-1],2,s),e.subtract(n[l],s,s),e.add(s,n[l-2],s),e.multiplyByScalar(s,.5,s)}this._times=o,this._points=n,this._firstTangent=e.clone(a),this._lastTangent=e.clone(s),this._evaluateFunction=u(this),this._lastTimeIndex=0}var h=new t,d=new e,m=new e,p=new e,f=new e;return n(c.prototype,{times:{get:function(){ +return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}}),c.catmullRomCoefficientMatrix=new s(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0),c.prototype.findTimeInterval=l.prototype.findTimeInterval,c.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},c}),i("Core/IndexDatatype",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n){"use strict";var o={UNSIGNED_BYTE:e.UNSIGNED_BYTE,UNSIGNED_SHORT:e.UNSIGNED_SHORT,UNSIGNED_INT:e.UNSIGNED_INT};return o.getSizeInBytes=function(e){switch(e){case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},o.validate=function(e){return t(e)&&(e===o.UNSIGNED_BYTE||e===o.UNSIGNED_SHORT||e===o.UNSIGNED_INT)},o.createTypedArray=function(e,t){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},o.createTypedArrayFromArrayBuffer=function(e,t,i,r){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,i,r):new Uint16Array(t,i,r)},r(o)}),i("Core/definedNotNull",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),i("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./definedNotNull","./DeveloperError"],function(e,t,i,r,n){"use strict";function o(n,o,a){a=t(a,!0),n instanceof e||(n=new e(n)),o instanceof e||(o=new e(o)),r(o.authority)&&!r(o.scheme)&&("undefined"!=typeof document&&i(document.location)&&i(document.location.href)?o.scheme=new e(document.location.href).scheme:o.scheme=n.scheme);var s=n;o.isAbsolute()&&(s=o);var l="";r(s.scheme)&&(l+=s.scheme+":"),r(s.authority)&&(l+="//"+s.authority,""!==s.path&&(l=l.replace(/\/?$/,"/"),s.path=s.path.replace(/^\/?/g,""))),l+=s===n?a?n.path.replace(/\/?$/,"/")+o.path.replace(/^\/?/g,""):n.path+o.path:o.path;var u=r(n.query),c=r(o.query);u&&c?l+="?"+n.query+"&"+o.query:u&&!c?l+="?"+n.query:!u&&c&&(l+="?"+o.query);var h=r(o.fragment);return r(n.fragment)&&!h?l+="#"+n.fragment:h&&(l+="#"+o.fragment),l}return o}),i("Core/loadArrayBuffer",["./loadWithXhr","./defined"],function(e,t){"use strict";function i(i,r){return e({url:i,responseType:"arraybuffer",headers:t(r)?r.headers:void 0,overrideMimeType:t(r)?r.overrideMimeType:void 0,withCredentials:t(r)?r.withCredentials:void 0})}return i}),i("Core/Intersections2D",["./Cartesian3","./defined","./DeveloperError"],function(e,t,i){"use strict";var r={};return r.clipTriangleAtAxisAlignedThreshold=function(e,i,r,n,o,a){t(a)?a.length=0:a=[];var s,l,u;i?(s=e>r,l=e>n,u=e>o):(s=r>e,l=n>e,u=o>e);var c,h,d,m,p,f,v=s+l+u;return 1===v?s?(c=(e-r)/(n-r),h=(e-r)/(o-r),a.push(1),a.push(2),1!==h&&(a.push(-1),a.push(0),a.push(2),a.push(h)),1!==c&&(a.push(-1),a.push(0),a.push(1),a.push(c))):l?(d=(e-n)/(o-n),m=(e-n)/(r-n),a.push(2),a.push(0),1!==m&&(a.push(-1),a.push(1),a.push(0),a.push(m)),1!==d&&(a.push(-1),a.push(1),a.push(2),a.push(d))):u&&(p=(e-o)/(r-o),f=(e-o)/(n-o),a.push(0),a.push(1),1!==f&&(a.push(-1),a.push(2),a.push(1),a.push(f)),1!==p&&(a.push(-1),a.push(2),a.push(0),a.push(p))):2===v?s||r===e?l||n===e?u||o===e||(h=(e-r)/(o-r),d=(e-n)/(o-n),a.push(2),a.push(-1),a.push(0),a.push(2),a.push(h),a.push(-1),a.push(1),a.push(2),a.push(d)):(f=(e-o)/(n-o),c=(e-r)/(n-r),a.push(1),a.push(-1),a.push(2),a.push(1),a.push(f),a.push(-1),a.push(0),a.push(1),a.push(c)):(m=(e-n)/(r-n),p=(e-o)/(r-o),a.push(0),a.push(-1),a.push(1),a.push(0),a.push(m),a.push(-1),a.push(2),a.push(0),a.push(p)):3!==v&&(a.push(0),a.push(1),a.push(2)),a},r.computeBarycentricCoordinates=function(i,r,n,o,a,s,l,u,c){var h=n-l,d=l-a,m=s-u,p=o-u,f=1/(m*h+d*p),v=r-u,g=i-l,_=(m*g+d*v)*f,y=(-p*g+h*v)*f,C=1-_-y;return t(c)?(c.x=_,c.y=y,c.z=C,c):new e(_,y,C)},r}),i("Core/QuantizedMeshTerrainData",["../ThirdParty/when","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./IndexDatatype","./Intersections2D","./Math","./OrientedBoundingBox","./TaskProcessor","./TerrainEncoding","./TerrainMesh"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(e){function t(e,t){return a[e]-a[t]}function i(e,t){return o[e]-o[t]}this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint;var r=this._quantizedVertices.length/3,o=this._uValues=this._quantizedVertices.subarray(0,r),a=this._vValues=this._quantizedVertices.subarray(r,2*r);this._heightValues=this._quantizedVertices.subarray(2*r,3*r),this._westIndices=v(e.westIndices,t,r),this._southIndices=v(e.southIndices,i,r),this._eastIndices=v(e.eastIndices,t,r),this._northIndices=v(e.northIndices,i,r),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=n(e.childTileMask,15),this._createdByUpsampling=n(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}function v(e,t,i){y.length=e.length;for(var r=!1,n=0,o=e.length;o>n;++n)y[n]=e[n],r=r||n>0&&t(e[n-1],e[n])>0;return r?(y.sort(t),l.createTypedArray(i,y)):e}function g(e,t,i){for(var r=e._mesh,n=r.vertices,o=r.encoding,a=r.indices,s=0,l=a.length;l>s;s+=3){var c=a[s],h=a[s+1],d=a[s+2],m=o.decodeTextureCoordinates(n,c,T),p=o.decodeTextureCoordinates(n,h,x),f=o.decodeTextureCoordinates(n,d,b),v=u.computeBarycentricCoordinates(t,i,m.x,m.y,p.x,p.y,f.x,f.y,w);if(v.x>=-1e-15&&v.y>=-1e-15&&v.z>=-1e-15){var g=o.decodeHeight(n,c),_=o.decodeHeight(n,h),y=o.decodeHeight(n,d);return v.x*g+v.y*_+v.z*y}}}function _(e,t,i){for(var r=e._uValues,n=e._vValues,o=e._heightValues,a=e._indices,s=0,l=a.length;l>s;s+=3){var h=a[s],d=a[s+1],m=a[s+2],p=r[h],f=r[d],v=r[m],g=n[h],_=n[d],y=n[m],C=u.computeBarycentricCoordinates(t,i,p,g,f,_,v,y,w);if(C.x>=-1e-15&&C.y>=-1e-15&&C.z>=-1e-15){var E=C.x*o[h]+C.y*o[d]+C.z*o[m];return c.lerp(e._minimumHeight,e._maximumHeight,E/S)}}}a(f.prototype,{waterMask:{get:function(){return this._waterMask}}});var y=[],C=new d("createVerticesFromQuantizedTerrainMesh");f.prototype.createMesh=function(t,i,r,a,s){var u=t.ellipsoid,c=t.tileXYToRectangle(i,r,a);s=n(s,1);var h=C.scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:c,relativeToCenter:this._boundingSphere.center,ellipsoid:u,exaggeration:s});if(o(h)){var d=this;return e(h,function(e){var t=d._quantizedVertices.length/3;t+=d._westIndices.length+d._southIndices.length+d._eastIndices.length+d._northIndices.length;var i=l.createTypedArray(t,e.indices),r=new Float32Array(e.vertices),o=e.center,a=e.minimumHeight,s=e.maximumHeight,u=n(e.boundingSphere,d._boundingSphere),c=n(e.orientedBoundingBox,d._orientedBoundingBox),h=n(e.occludeePointInScaledSpace,d._horizonOcclusionPoint),f=e.vertexStride,v=m.clone(e.encoding);return d._skirtIndex=e.skirtIndex,d._vertexCountWithoutSkirts=d._quantizedVertices.length/3,d._mesh=new p(o,r,i,a,s,u,h,f,c,v),d._quantizedVertices=void 0,d._encodedNormals=void 0,d._indices=void 0,d._uValues=void 0,d._vValues=void 0,d._heightValues=void 0,d._westIndices=void 0,d._southIndices=void 0,d._eastIndices=void 0,d._northIndices=void 0,d._mesh})}};var E=new d("upsampleQuantizedTerrainMesh");f.prototype.upsample=function(i,n,a,s,u,c,d){var m=this._mesh;if(o(this._mesh)){var p=2*n!==u,v=2*a===c,g=i.ellipsoid,_=i.tileXYToRectangle(u,c,d),y=E.scheduleTask({vertices:m.vertices,vertexCountWithoutSkirts:this._vertexCountWithoutSkirts,indices:m.indices,skirtIndex:this._skirtIndex,encoding:m.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:p,isNorthChild:v,childRectangle:_,ellipsoid:g});if(o(y)){var C=Math.min(this._westSkirtHeight,this._eastSkirtHeight);C=Math.min(C,this._southSkirtHeight),C=Math.min(C,this._northSkirtHeight);var S=p?.5*C:this._westSkirtHeight,w=v?.5*C:this._southSkirtHeight,T=p?this._eastSkirtHeight:.5*C,x=v?this._northSkirtHeight:.5*C;return e(y,function(e){var i,n=new Uint16Array(e.vertices),a=l.createTypedArray(n.length/3,e.indices);return o(e.encodedNormals)&&(i=new Uint8Array(e.encodedNormals)),new f({quantizedVertices:n,indices:a,encodedNormals:i,minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,boundingSphere:t.clone(e.boundingSphere),orientedBoundingBox:h.clone(e.orientedBoundingBox),horizonOcclusionPoint:r.clone(e.horizonOcclusionPoint),westIndices:e.westIndices,southIndices:e.southIndices,eastIndices:e.eastIndices,northIndices:e.northIndices,westSkirtHeight:S,southSkirtHeight:w,eastSkirtHeight:T,northSkirtHeight:x,childTileMask:0,createdByUpsampling:!0})})}}};var S=32767,w=new r;f.prototype.interpolateHeight=function(e,t,i){var r=c.clamp((t-e.west)/e.width,0,1);r*=S;var n=c.clamp((i-e.south)/e.height,0,1);return n*=S,o(this._mesh)?void g(this,r,n):_(this,r,n)};var T=new i,x=new i,b=new i;return f.prototype.isChildAvailable=function(e,t,i,r){var n=2;return i!==2*e&&++n,r!==2*t&&(n-=2),0!==(this._childTileMask&1<<n)},f.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling},f}),i("Core/formatError",["./defined"],function(e){"use strict";function t(t){var i,r=t.name,n=t.message;i=e(r)&&e(n)?r+": "+n:t.toString();var o=t.stack;return e(o)&&(i+="\n"+o),i}return t}),i("Core/TileProviderError",["./defaultValue","./defined","./formatError"],function(e,t,i){"use strict";function r(t,i,r,n,o,a,s){this.provider=t,this.message=i,this.x=r,this.y=n,this.level=o,this.timesRetried=e(a,0),this.retry=!1,this.error=s}return r.handleError=function(e,n,o,a,s,l,u,c,h){var d=e;return t(e)?(d.provider=n,d.message=a,d.x=s,d.y=l,d.level=u,d.retry=!1,d.error=h,++d.timesRetried):d=new r(n,a,s,l,u,0,h),o.numberOfListeners>0?o.raiseEvent(d):console.log('An error occurred in "'+n.constructor.name+'": '+i(a)),d.retry&&t(c)&&c(),d},r.handleSuccess=function(e){t(e)&&(e.timesRetried=-1)},r}),i("Core/CesiumTerrainProvider",["../ThirdParty/Uri","../ThirdParty/when","./BoundingSphere","./Cartesian3","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./GeographicTilingScheme","./HeightmapTerrainData","./IndexDatatype","./joinUrls","./loadArrayBuffer","./loadJson","./Math","./Matrix3","./OrientedBoundingBox","./QuantizedMeshTerrainData","./RuntimeError","./TerrainProvider","./throttleRequestByServer","./TileProviderError"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S,w){"use strict";function T(i){function r(t){var i;if(!t.format)return i="The tile format is not specified in the layer.json file.",void(p=w.handleError(p,v,v._errorEvent,i,void 0,void 0,void 0,l));if(!t.tiles||0===t.tiles.length)return i="The layer.json file does not specify any tile URL templates.",void(p=w.handleError(p,v,v._errorEvent,i,void 0,void 0,void 0,l));if("heightmap-1.0"===t.format)v._heightmapStructure={heightScale:.2,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1},v._hasWaterMask=!0,v._requestWaterMask=!0;else if(0!==t.format.indexOf("quantized-mesh-1."))return i='The tile format "'+t.format+'" is invalid or not supported.',void(p=w.handleError(p,v,v._errorEvent,i,void 0,void 0,void 0,l));v._tileUrlTemplates=t.tiles;for(var r=0;r<v._tileUrlTemplates.length;++r){var o=new e(v._tileUrlTemplates[r]),s=new e(v._url);o.authority&&!s.authority&&(s.authority=o.authority,s.scheme=o.scheme),v._tileUrlTemplates[r]=m(s,o).toString().replace("{version}",t.version)}v._availableTiles=t.available,!a(v._credit)&&a(t.attribution)&&null!==t.attribution&&(v._credit=new n(t.attribution)),a(t.extensions)&&-1!==t.extensions.indexOf("octvertexnormals")?v._hasVertexNormals=!0:a(t.extensions)&&-1!==t.extensions.indexOf("vertexnormals")&&(v._hasVertexNormals=!0,v._littleEndianExtensionSize=!1),a(t.extensions)&&-1!==t.extensions.indexOf("watermask")&&(v._hasWaterMask=!0),v._ready=!0,v._readyPromise.resolve(!0)}function s(e){if(a(e)&&404===e.statusCode)return void r({tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]});var t="An error occurred while accessing "+d+".";p=w.handleError(p,v,v._errorEvent,t,void 0,void 0,void 0,l)}function l(){var e=f(d);t(e,r,s)}this._url=i.url,this._proxy=i.proxy,this._tilingScheme=new c({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:i.ellipsoid}),this._heightmapWidth=65,this._levelZeroMaximumGeometricError=E.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,this._heightmapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._requestVertexNormals=o(i.requestVertexNormals,!1),this._littleEndianExtensionSize=!0,this._requestWaterMask=o(i.requestWaterMask,!1),this._errorEvent=new u;var h=i.credit;"string"==typeof h&&(h=new n(h)),this._credit=h,this._ready=!1,this._readyPromise=t.defer();var d=m(this._url,"layer.json");a(this._proxy)&&(d=this._proxy.getURL(d));var p,v=this;l()}function x(e){if(a(e)&&0!==e.length){var t=e.join("-");return{Accept:"application/vnd.quantized-mesh;extensions="+t+",application/octet-stream;q=0.9,*/*;q=0.01"}}return{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}}function b(e,t,i,r,n,o){var a=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new h({buffer:a,childTileMask:new Uint8Array(t,a.byteLength,1)[0],waterMask:new Uint8Array(t,a.byteLength+1,t.byteLength-a.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure})}function A(e,t,n,o,a,s){function l(e){return e>>1^-(1&e)}var u=0,c=3,h=c+1,m=Float64Array.BYTES_PER_ELEMENT*c,p=Float64Array.BYTES_PER_ELEMENT*h,f=3,g=Uint16Array.BYTES_PER_ELEMENT*f,C=3,E=Uint16Array.BYTES_PER_ELEMENT,S=E*C,w=new DataView(t),T=new r(w.getFloat64(u,!0),w.getFloat64(u+8,!0),w.getFloat64(u+16,!0));u+=m;var x=w.getFloat32(u,!0);u+=Float32Array.BYTES_PER_ELEMENT;var b=w.getFloat32(u,!0);u+=Float32Array.BYTES_PER_ELEMENT;var A=new i(new r(w.getFloat64(u,!0),w.getFloat64(u+8,!0),w.getFloat64(u+16,!0)),w.getFloat64(u+m,!0));u+=p;var I=new r(w.getFloat64(u,!0),w.getFloat64(u+8,!0),w.getFloat64(u+16,!0));u+=m;var D=w.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var R=new Uint16Array(t,u,3*D);u+=D*g,D>65536&&(E=Uint32Array.BYTES_PER_ELEMENT,S=E*C);var O,N=R.subarray(0,D),L=R.subarray(D,2*D),F=R.subarray(2*D,3*D),B=0,V=0,k=0;for(O=0;D>O;++O)B+=l(N[O]),V+=l(L[O]),k+=l(F[O]),N[O]=B,L[O]=V,F[O]=k;u%E!==0&&(u+=E-u%E);var z=w.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var U=d.createTypedArrayFromArrayBuffer(D,t,u,z*C);u+=z*S;var G=0;for(O=0;O<U.length;++O){var W=U[O];U[O]=G-W,0===W&&++G}var H=w.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var q=d.createTypedArrayFromArrayBuffer(D,t,u,H);u+=H*E;var j=w.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var Y=d.createTypedArrayFromArrayBuffer(D,t,u,j);u+=j*E;var X=w.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var Z=d.createTypedArrayFromArrayBuffer(D,t,u,X);u+=X*E;var K=w.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var Q=d.createTypedArrayFromArrayBuffer(D,t,u,K);u+=K*E;for(var J,$;u<w.byteLength;){var ee=w.getUint8(u,!0);u+=Uint8Array.BYTES_PER_ELEMENT;var te=w.getUint32(u,e._littleEndianExtensionSize);u+=Uint32Array.BYTES_PER_ELEMENT,ee===M.OCT_VERTEX_NORMALS&&e._requestVertexNormals?J=new Uint8Array(t,u,2*D):ee===M.WATER_MASK&&e._requestWaterMask&&($=new Uint8Array(t,u,te)),u+=te}var ie,re=5*e.getLevelMaximumGeometricError(n),ne=e._tilingScheme.tileXYToRectangle(o,a,n);return ne.width<v.PI_OVER_TWO+v.EPSILON5&&(ie=_.fromRectangle(ne,x,b,e._tilingScheme.ellipsoid)),new y({center:T,minimumHeight:x,maximumHeight:b,boundingSphere:A,orientedBoundingBox:ie,horizonOcclusionPoint:I,quantizedVertices:R,encodedNormals:J,indices:U,westIndices:q,southIndices:Y,eastIndices:Z,northIndices:Q,westSkirtHeight:re,southSkirtHeight:re,eastSkirtHeight:re,northSkirtHeight:re,childTileMask:P(e,n,o,s),waterMask:$})}function P(e,t,i,r){var n=e._availableTiles;if(!n||0===n.length)return 15;var o=t+1;if(o>=n.length)return 0;var a=n[o],s=0;return s|=I(a,2*i,2*r)?1:0,s|=I(a,2*i+1,2*r)?2:0,s|=I(a,2*i,2*r+1)?4:0,s|=I(a,2*i+1,2*r+1)?8:0}function I(e,t,i){for(var r=0,n=e.length;n>r;++r){var o=e[r];if(t>=o.startX&&t<=o.endX&&i>=o.startY&&i<=o.endY)return!0}return!1}var M={OCT_VERTEX_NORMALS:1,WATER_MASK:2};return T.prototype.requestTileGeometry=function(e,i,r,n){function s(e){return p(e,x(f))}var l=this._tileUrlTemplates;if(0!==l.length){var u=this._tilingScheme.getNumberOfYTilesAtLevel(r),c=u-i-1,h=l[(e+c+r)%l.length].replace("{z}",r).replace("{x}",e).replace("{y}",c),d=this._proxy;a(d)&&(h=d.getURL(h));var m,f=[];if(this._requestVertexNormals&&this._hasVertexNormals&&f.push(this._littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),this._requestWaterMask&&this._hasWaterMask&&f.push("watermask"),n=o(n,!0)){if(m=S(h,s),!a(m))return}else m=s(h);var v=this;return t(m,function(t){return a(v._heightmapStructure)?b(v,t,r,e,i,c):A(v,t,r,e,i,c)})}},s(T.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}}}),T.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},T.prototype.getTileDataAvailable=function(e,t,i){var r=this._availableTiles;if(r&&0!==r.length){if(i>=r.length)return!1;var n=r[i],o=this._tilingScheme.getNumberOfYTilesAtLevel(i),a=o-t-1;return I(n,e,a)}},T}),i("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,i,r){"use strict";function n(t,n,o,c,h,d,m,p,f,v){var g=t+n;e.multiplyByScalar(c,Math.cos(g),a),e.multiplyByScalar(o,Math.sin(g),s),e.add(a,s,a);var _=Math.cos(t);_*=_;var y=Math.sin(t);y*=y;var C=d/Math.sqrt(m*_+h*y),E=C/p;return r.fromAxisAngle(a,E,l),i.fromQuaternion(l,u),i.multiplyByVector(u,f,v),e.normalize(v,v),e.multiplyByScalar(v,p,v),v}var o={},a=new e,s=new e,l=new r,u=new i,c=new e,h=new e,d=new e,m=new e;o.raisePositionsToHeight=function(t,i,r){for(var n=i.ellipsoid,o=i.height,a=i.extrudedHeight,s=r?t.length/3*2:t.length/3,l=new Float64Array(3*s),u=t.length,p=r?u:0,f=0;u>f;f+=3){var v=f+1,g=f+2,_=e.fromArray(t,f,c);n.scaleToGeodeticSurface(_,_);var y=e.clone(_,h),C=n.geodeticSurfaceNormal(_,m),E=e.multiplyByScalar(C,o,d);e.add(_,E,_),r&&(e.multiplyByScalar(C,a,E),e.add(y,E,y),l[f+p]=y.x,l[v+p]=y.y,l[g+p]=y.z),l[f]=_.x,l[v]=_.y,l[g]=_.z}return l};var p=new e,f=new e,v=new e;return o.computeEllipsePositions=function(i,r,o){var a=i.semiMinorAxis,s=i.semiMajorAxis,l=i.rotation,u=i.center,m=8*i.granularity,g=a*a,_=s*s,y=s*a,C=e.magnitude(u),E=e.normalize(u,p),S=e.cross(e.UNIT_Z,u,f);S=e.normalize(S,S);var w=e.cross(E,S,v),T=1+Math.ceil(t.PI_OVER_TWO/m),x=t.PI_OVER_TWO/(T-1),b=t.PI_OVER_TWO-T*x;0>b&&(T-=Math.ceil(Math.abs(b)/x));var A,P,I,M,D,R=2*(T*(T+2)),O=r?new Array(3*R):void 0,N=0,L=c,F=h,B=4*T*3,V=B-1,k=0,z=o?new Array(B):void 0;for(b=t.PI_OVER_TWO,L=n(b,l,w,S,g,y,_,C,E,L),r&&(O[N++]=L.x,O[N++]=L.y,O[N++]=L.z),o&&(z[V--]=L.z,z[V--]=L.y,z[V--]=L.x),b=t.PI_OVER_TWO-x,A=1;T+1>A;++A){if(L=n(b,l,w,S,g,y,_,C,E,L),F=n(Math.PI-b,l,w,S,g,y,_,C,E,F),r){for(O[N++]=L.x,O[N++]=L.y,O[N++]=L.z,I=2*A+2,P=1;I-1>P;++P)M=P/(I-1),D=e.lerp(L,F,M,d),O[N++]=D.x,O[N++]=D.y,O[N++]=D.z;O[N++]=F.x,O[N++]=F.y,O[N++]=F.z}o&&(z[V--]=L.z,z[V--]=L.y,z[V--]=L.x,z[k++]=F.x,z[k++]=F.y,z[k++]=F.z),b=t.PI_OVER_TWO-(A+1)*x}for(A=T;A>1;--A){if(b=t.PI_OVER_TWO-(A-1)*x,L=n(-b,l,w,S,g,y,_,C,E,L),F=n(b+Math.PI,l,w,S,g,y,_,C,E,F),r){for(O[N++]=L.x,O[N++]=L.y,O[N++]=L.z,I=2*(A-1)+2,P=1;I-1>P;++P)M=P/(I-1),D=e.lerp(L,F,M,d),O[N++]=D.x,O[N++]=D.y,O[N++]=D.z;O[N++]=F.x,O[N++]=F.y,O[N++]=F.z}o&&(z[V--]=L.z,z[V--]=L.y,z[V--]=L.x,z[k++]=F.x,z[k++]=F.y,z[k++]=F.z)}b=t.PI_OVER_TWO,L=n(-b,l,w,S,g,y,_,C,E,L);var U={};return r&&(O[N++]=L.x,O[N++]=L.y,O[N++]=L.z,U.positions=O,U.numPts=T),o&&(z[V--]=L.z,z[V--]=L.y,z[V--]=L.x,U.outerPositions=z),U},o}),i("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,i,r){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=r.clone(e(t.modelMatrix,r.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return n}),i("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}r.encode=function(e,i){t(i)||(i={high:0,low:0});var r;return e>=0?(r=65536*Math.floor(e/65536),i.high=r,i.low=e-r):(r=65536*Math.floor(-e/65536),i.high=-r,i.low=e+r),i};var n={high:0,low:0};r.fromCartesian=function(e,i){t(i)||(i=new r);var o=i.high,a=i.low;return r.encode(e.x,n),o.x=n.high,a.x=n.low,r.encode(e.y,n),o.y=n.high,a.y=n.low,r.encode(e.z,n),o.z=n.high,a.z=n.low,i};var o=new r;return r.writeElements=function(e,t,i){r.fromCartesian(e,o);var n=o.high,a=o.low;t[i]=n.x,t[i+1]=n.y,t[i+2]=n.z,t[i+3]=a.x,t[i+4]=a.y,t[i+5]=a.z},r}),i("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";var r={};return r.calculateACMR=function(i){i=e(i,e.EMPTY_OBJECT);var r=i.indices,n=i.maximumIndex,o=e(i.cacheSize,24),a=r.length;if(!t(n)){n=0;for(var s=0,l=r[s];a>s;)l>n&&(n=l),++s,l=r[s]}for(var u=[],c=0;n+1>c;c++)u[c]=0;for(var h=o+1,d=0;a>d;++d)h-u[r[d]]>o&&(u[r[d]]=h,++h);return(h-o+1)/(a/3)},r.tipsify=function(i){function r(e,t,i,r){for(;t.length>=1;){var n=t[t.length-1];if(t.splice(t.length-1,1),e[n].numLiveTriangles>0)return n}for(;r>o;){if(e[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function n(e,t,i,n,o,a,s){for(var l,u=-1,c=-1,h=0;h<i.length;){var d=i[h];n[d].numLiveTriangles&&(l=0,o-n[d].timeStamp+2*n[d].numLiveTriangles<=t&&(l=o-n[d].timeStamp),(l>c||-1===c)&&(c=l,u=d)),++h}return-1===u?r(n,a,e,s):u}i=e(i,e.EMPTY_OBJECT);var o,a=i.indices,s=i.maximumIndex,l=e(i.cacheSize,24),u=a.length,c=0,h=0,d=a[h],m=u;if(t(s))c=s+1;else{for(;m>h;)d>c&&(c=d),++h,d=a[h];if(-1===c)return 0;++c}for(var p=[],f=0;c>f;f++)p[f]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};h=0;for(var v=0;m>h;)p[a[h]].vertexTriangles.push(v),++p[a[h]].numLiveTriangles,p[a[h+1]].vertexTriangles.push(v),++p[a[h+1]].numLiveTriangles,p[a[h+2]].vertexTriangles.push(v),++p[a[h+2]].numLiveTriangles,++v,h+=3;var g=0,_=l+1;o=1;var y,C,E=[],S=[],w=0,T=[],x=u/3,b=[];for(f=0;x>f;f++)b[f]=!1;for(var A,P;-1!==g;){E=[],C=p[g],P=C.vertexTriangles.length;for(var I=0;P>I;++I)if(v=C.vertexTriangles[I],!b[v]){b[v]=!0,h=v+v+v;for(var M=0;3>M;++M)A=a[h],E.push(A),S.push(A),T[w]=A,++w,y=p[A],--y.numLiveTriangles,_-y.timeStamp>l&&(y.timeStamp=_,++_),++h}g=n(a,l,E,p,_,S,c)}return T},r}),i("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryInstance","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S,w,T,x){"use strict";function b(e,t,i,r,n){e[t++]=i,e[t++]=r,e[t++]=r,e[t++]=n,e[t++]=n,e[t]=i}function A(e){for(var t=e.length,i=t/3*6,r=g.createTypedArray(t,i),n=0,o=0;t>o;o+=3,n+=6)b(r,n,e[o],e[o+1],e[o+2]);return r}function P(e){var t=e.length;if(t>=3){var i=6*(t-2),r=g.createTypedArray(t,i);b(r,0,e[0],e[1],e[2]);for(var n=6,o=3;t>o;++o,n+=6)b(r,n,e[o-1],e[o],e[o-2]);return r}return new Uint16Array}function I(e){if(e.length>0){for(var t=e.length-1,i=6*(t-1),r=g.createTypedArray(t,i),n=e[0],o=0,a=1;t>a;++a,o+=6)b(r,o,n,e[a],e[a+1]);return r}return new Uint16Array}function M(e){var t={};for(var i in e)if(e.hasOwnProperty(i)&&u(e[i])&&u(e[i].values)){var r=e[i];t[i]=new p({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return t}function D(e,t,i){for(var r in t)if(t.hasOwnProperty(r)&&u(t[r])&&u(t[r].values))for(var n=t[r],o=0;o<n.componentsPerAttribute;++o)e[r].values.push(n.values[i*n.componentsPerAttribute+o])}function R(e,t){if(u(t))for(var i=t.values,r=i.length,o=0;r>o;o+=3)n.unpack(i,o,oe),S.multiplyByPoint(e,oe,oe),n.pack(oe,i,o)}function O(e,t){if(u(t))for(var i=t.values,r=i.length,o=0;r>o;o+=3)n.unpack(i,o,oe),E.multiplyByVector(e,oe,oe),oe=n.normalize(oe,oe),n.pack(oe,i,o)}function N(e,t){var i,r=e.length,n={},o=e[0][t].attributes;for(i in o)if(o.hasOwnProperty(i)&&u(o[i])&&u(o[i].values)){for(var a=o[i],l=a.values.length,c=!0,h=1;r>h;++h){var d=e[h][t].attributes[i];if(!u(d)||a.componentDatatype!==d.componentDatatype||a.componentsPerAttribute!==d.componentsPerAttribute||a.normalize!==d.normalize){c=!1;break}l+=d.values.length}c&&(n[i]=new p({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:s.createTypedArray(a.componentDatatype,l)}))}return n}function L(e,t){var r,o,a,s,l,c,h,d=e.length,p=(e[0].modelMatrix,u(e[0][t].indices)),f=e[0][t].primitiveType,v=N(e,t);for(r in v)if(v.hasOwnProperty(r))for(l=v[r].values,s=0,o=0;d>o;++o)for(c=e[o][t].attributes[r].values,h=c.length,a=0;h>a;++a)l[s++]=c[a];var _;if(p){var y=0;for(o=0;d>o;++o)y+=e[o][t].indices.length;var C=m.computeNumberOfVertices(new m({attributes:v,primitiveType:T.POINTS})),E=g.createTypedArray(C,y),S=0,w=0;for(o=0;d>o;++o){var x=e[o][t].indices,b=x.length;for(s=0;b>s;++s)E[S++]=w+x[s];w+=m.computeNumberOfVertices(e[o][t])}_=E}var A,P=new n,I=0;for(o=0;d>o;++o){if(A=e[o][t].boundingSphere,!u(A)){P=void 0;break}n.add(A.center,P,P)}if(u(P))for(n.divideByScalar(P,d,P),o=0;d>o;++o){A=e[o][t].boundingSphere;var M=n.magnitude(n.subtract(A.center,P,le))+A.radius;M>I&&(I=M)}return new m({attributes:v,indices:_,primitiveType:f,boundingSphere:u(P)?new i(P,I):void 0})}function F(e){if(u(e.indices))return e;for(var t=m.computeNumberOfVertices(e),i=g.createTypedArray(t,t),r=0;t>r;++r)i[r]=r;return e.indices=i,e}function B(e){var t=m.computeNumberOfVertices(e),i=g.createTypedArray(t,3*(t-2));i[0]=1,i[1]=0,i[2]=2;for(var r=3,n=3;t>n;++n)i[r++]=n-1,i[r++]=0,i[r++]=n;return e.indices=i,e.primitiveType=T.TRIANGLES,e}function V(e){var t=m.computeNumberOfVertices(e),i=g.createTypedArray(t,3*(t-2));i[0]=0,i[1]=1,i[2]=2,t>3&&(i[3]=0,i[4]=2,i[5]=3);for(var r=6,n=3;t-1>n;n+=2)i[r++]=n,i[r++]=n-1,i[r++]=n+1,t>n+2&&(i[r++]=n,i[r++]=n+1,i[r++]=n+2);return e.indices=i,e.primitiveType=T.TRIANGLES,e}function k(e){if(u(e.indices))return e;for(var t=m.computeNumberOfVertices(e),i=g.createTypedArray(t,t),r=0;t>r;++r)i[r]=r;return e.indices=i,e}function z(e){var t=m.computeNumberOfVertices(e),i=g.createTypedArray(t,2*(t-1));i[0]=0,i[1]=1;for(var r=2,n=2;t>n;++n)i[r++]=n-1,i[r++]=n;return e.indices=i,e.primitiveType=T.LINES,e}function U(e){var t=m.computeNumberOfVertices(e),i=g.createTypedArray(t,2*t);i[0]=0,i[1]=1;for(var r=2,n=2;t>n;++n)i[r++]=n-1,i[r++]=n;return i[r++]=t-1,i[r]=0,e.indices=i,e.primitiveType=T.LINES,e}function G(e){switch(e.primitiveType){case T.TRIANGLE_FAN:return B(e);case T.TRIANGLE_STRIP:return V(e);case T.TRIANGLES:return F(e);case T.LINE_STRIP:return z(e);case T.LINE_LOOP:return U(e);case T.LINES:return k(e)}return e}function W(e,t){Math.abs(e.y)<C.EPSILON6&&(t?e.y=-C.EPSILON6:e.y=C.EPSILON6)}function H(e,t,i){if(0!==e.y&&0!==t.y&&0!==i.y)return W(e,e.y<0),W(t,t.y<0),void W(i,i.y<0);var r,n=Math.abs(e.y),o=Math.abs(t.y),a=Math.abs(i.y);r=n>o?n>a?C.sign(e.y):C.sign(i.y):o>a?C.sign(t.y):C.sign(i.y);var s=0>r;W(e,s),W(t,s),W(i,s)}function q(e,t,i,r){n.add(e,n.multiplyByScalar(n.subtract(t,e,Ce),e.y/(e.y-t.y),Ce),i),n.clone(i,r),W(i,!0),W(r,!1)}function j(e,t,i){if(!(e.x>=0||t.x>=0||i.x>=0)){H(e,t,i);var r=e.y<0,n=t.y<0,o=i.y<0,a=0;a+=r?1:0,a+=n?1:0,a+=o?1:0;var s=xe.indices;1===a?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,r?(q(e,t,Ee,we),q(e,i,Se,Te),s[0]=0,s[3]=1,s[4]=2,s[6]=1):n?(q(t,i,Ee,we),q(t,e,Se,Te),s[0]=1,s[3]=2,s[4]=0,s[6]=2):o&&(q(i,e,Ee,we),q(i,t,Se,Te),s[0]=2,s[3]=0,s[4]=1,s[6]=0)):2===a&&(s[2]=4,s[4]=4,s[5]=3,s[7]=5,s[8]=6,r?n?o||(q(i,e,Ee,we),q(i,t,Se,Te),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(q(t,i,Ee,we),q(t,e,Se,Te),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(q(e,t,Ee,we),q(e,i,Se,Te),s[0]=1,s[1]=2,s[3]=1,s[6]=0));var l=xe.positions;return l[0]=e,l[1]=t,l[2]=i,l.length=3,(1===a||2===a)&&(l[3]=Ee,l[4]=Se,l[5]=we,l[6]=Te,l.length=7),xe}}function Y(e,t){var r=e.attributes;if(0!==r.position.values.length){for(var n in r)if(r.hasOwnProperty(n)&&u(r[n])&&u(r[n].values)){var o=r[n];o.values=s.createTypedArray(o.componentDatatype,o.values)}var a=m.computeNumberOfVertices(e);return e.indices=g.createTypedArray(a,e.indices),t&&(e.boundingSphere=i.fromVertices(r.position.values)),e}}function X(e){var t=e.attributes,i={};for(var r in t)if(t.hasOwnProperty(r)&&u(t[r])&&u(t[r].values)){var n=t[r];i[r]=new p({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return new m({attributes:i,indices:[],primitiveType:e.primitiveType})}function Z(e,t,i){var r=u(e.geometry.boundingSphere);t=Y(t,r),i=Y(i,r),u(i)&&!u(t)?e.geometry=i:!u(i)&&u(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=i,e.geometry=void 0)}function K(e,i,o,a,s,l,c,h,d,m,p){if(u(l)||u(c)||u(h)||u(d)){var f=n.fromArray(s,3*e,be),v=n.fromArray(s,3*i,Ae),g=n.fromArray(s,3*o,Pe),_=t(a,f,v,g,Ie);if(u(l)){var y=n.fromArray(l,3*e,be),C=n.fromArray(l,3*i,Ae),E=n.fromArray(l,3*o,Pe);n.multiplyByScalar(y,_.x,y),n.multiplyByScalar(C,_.y,C),n.multiplyByScalar(E,_.z,E);var S=n.add(y,C,y);n.add(S,E,S),n.normalize(S,S),n.pack(S,m.normal.values,3*p)}if(u(c)){var w=n.fromArray(c,3*e,be),T=n.fromArray(c,3*i,Ae),x=n.fromArray(c,3*o,Pe);n.multiplyByScalar(w,_.x,w),n.multiplyByScalar(T,_.y,T),n.multiplyByScalar(x,_.z,x);var b=n.add(w,T,w);n.add(b,x,b),n.normalize(b,b),n.pack(b,m.binormal.values,3*p)}if(u(h)){var A=n.fromArray(h,3*e,be),P=n.fromArray(h,3*i,Ae),I=n.fromArray(h,3*o,Pe);n.multiplyByScalar(A,_.x,A),n.multiplyByScalar(P,_.y,P),n.multiplyByScalar(I,_.z,I);var M=n.add(A,P,A);n.add(M,I,M),n.normalize(M,M),n.pack(M,m.tangent.values,3*p)}if(u(d)){var D=r.fromArray(d,2*e,Me),R=r.fromArray(d,2*i,De),O=r.fromArray(d,2*o,Re);r.multiplyByScalar(D,_.x,D),r.multiplyByScalar(R,_.y,R),r.multiplyByScalar(O,_.z,O);var N=r.add(D,R,D);r.add(N,O,N),r.pack(N,m.st.values,2*p)}}}function Q(e,t,i,r,n,o){var a=e.position.values.length/3;if(-1!==n){var s=r[n],l=i[s];return-1===l?(i[s]=a,e.position.values.push(o.x,o.y,o.z),t.push(a),a):(t.push(l),l)}return e.position.values.push(o.x,o.y,o.z),t.push(a),a}function J(e){var t,i,r,o,a,s=e.geometry,l=s.attributes,c=l.position.values,h=u(l.normal)?l.normal.values:void 0,d=u(l.binormal)?l.binormal.values:void 0,m=u(l.tangent)?l.tangent.values:void 0,p=u(l.st)?l.st.values:void 0,f=s.indices,v=X(s),g=X(s),_=[];_.length=c.length/3;var y=[];for(y.length=c.length/3, +a=0;a<_.length;++a)_[a]=-1,y[a]=-1;var C=f.length;for(a=0;C>a;a+=3){var E=f[a],S=f[a+1],w=f[a+2],T=n.fromArray(c,3*E),x=n.fromArray(c,3*S),b=n.fromArray(c,3*w),A=j(T,x,b);if(u(A)&&A.positions.length>3)for(var P=A.positions,I=A.indices,M=I.length,D=0;M>D;++D){var R=I[D],O=P[R];O.y<0?(t=g.attributes,i=g.indices,r=_):(t=v.attributes,i=v.indices,r=y),o=Q(t,i,r,f,3>R?a+R:-1,O),K(E,S,w,O,c,h,d,m,p,t,o)}else u(A)&&(T=A.positions[0],x=A.positions[1],b=A.positions[2]),T.y<0?(t=g.attributes,i=g.indices,r=_):(t=v.attributes,i=v.indices,r=y),o=Q(t,i,r,f,a,T),K(E,S,w,T,c,h,d,m,p,t,o),o=Q(t,i,r,f,a+1,x),K(E,S,w,x,c,h,d,m,p,t,o),o=Q(t,i,r,f,a+2,b),K(E,S,w,b,c,h,d,m,p,t,o)}Z(e,g,v)}function $(e){var t,i=e.geometry,r=i.attributes,o=r.position.values,a=i.indices,s=X(i),l=X(i),c=a.length,h=[];h.length=o.length/3;var d=[];for(d.length=o.length/3,t=0;t<h.length;++t)h[t]=-1,d[t]=-1;for(t=0;c>t;t+=2){var m=a[t],p=a[t+1],f=n.fromArray(o,3*m,be),v=n.fromArray(o,3*p,Ae);Math.abs(f.y)<C.EPSILON6&&(f.y<0?f.y=-C.EPSILON6:f.y=C.EPSILON6),Math.abs(v.y)<C.EPSILON6&&(v.y<0?v.y=-C.EPSILON6:v.y=C.EPSILON6);var g=s.attributes,_=s.indices,E=d,S=l.attributes,w=l.indices,T=h,x=y.lineSegmentPlane(f,v,Oe,Pe);if(u(x)){var b=n.multiplyByScalar(n.UNIT_Y,5*C.EPSILON9,Ne);f.y<0&&(n.negate(b,b),g=l.attributes,_=l.indices,E=h,S=s.attributes,w=s.indices,T=d);var A=n.add(x,b,Le);Q(g,_,E,a,t,f),Q(g,_,E,a,-1,A),n.negate(b,b),n.add(x,b,A),Q(S,w,T,a,-1,A),Q(S,w,T,a,t+1,v)}else{var P,I,M;f.y<0?(P=l.attributes,I=l.indices,M=h):(P=s.attributes,I=s.indices,M=d),Q(P,I,M,a,t,f),Q(P,I,M,a,t+1,v)}}Z(e,l,s)}function ee(e){var t,i,a,s=e.geometry,l=s.attributes,c=l.position.values,h=l.prevPosition.values,d=l.nextPosition.values,m=l.expandAndWidth.values,p=u(l.st)?l.st.values:void 0,f=u(l.color)?l.color.values:void 0,v=X(s),g=X(s),_=c.length/3;for(t=0;_>t;t+=4){var E=t,S=t+1,w=t+2,T=t+3,x=n.fromArray(c,3*E,Ve),b=n.fromArray(c,3*S,ke),A=n.fromArray(c,3*w,ze),P=n.fromArray(c,3*T,Ue);Math.abs(x.y)<C.EPSILON6&&(x.y=C.EPSILON6*(A.y<0?-1:1),b.y=x.y),Math.abs(A.y)<C.EPSILON6&&(A.y=C.EPSILON6*(x.y<0?-1:1),P.y=A.y);var I=v.attributes,M=v.indices,D=g.attributes,R=g.indices,O=y.lineSegmentPlane(x,A,Oe,Ge);if(u(O)){var N=n.multiplyByScalar(n.UNIT_Y,5*C.EPSILON9,We);x.y<0&&(n.negate(N,N),I=g.attributes,M=g.indices,D=v.attributes,R=v.indices);var L=n.add(O,N,He);for(I.position.values.push(x.x,x.y,x.z,b.x,b.y,b.z),I.position.values.push(L.x,L.y,L.z),I.position.values.push(L.x,L.y,L.z),n.negate(N,N),n.add(O,N,L),D.position.values.push(L.x,L.y,L.z),D.position.values.push(L.x,L.y,L.z),D.position.values.push(A.x,A.y,A.z,P.x,P.y,P.z),i=3*E;3*E+6>i;++i)I.prevPosition.values.push(h[i]);for(I.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),D.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),i=3*w;3*w+6>i;++i)D.prevPosition.values.push(h[i]);for(i=3*E;3*E+6>i;++i)I.nextPosition.values.push(d[i]);for(I.nextPosition.values.push(A.x,A.y,A.z,A.x,A.y,A.z),D.nextPosition.values.push(A.x,A.y,A.z,A.x,A.y,A.z),i=3*w;3*w+6>i;++i)D.nextPosition.values.push(d[i]);var F=r.fromArray(m,2*E,Fe),B=Math.abs(F.y);I.expandAndWidth.values.push(-1,B,1,B),I.expandAndWidth.values.push(-1,-B,1,-B),D.expandAndWidth.values.push(-1,B,1,B),D.expandAndWidth.values.push(-1,-B,1,-B);var V=n.magnitudeSquared(n.subtract(O,x,Ue));if(V/=n.magnitudeSquared(n.subtract(A,x,Ue)),u(f)){var k=o.fromArray(f,4*E,qe),z=o.fromArray(f,4*w,qe),U=C.lerp(k.x,z.x,V),G=C.lerp(k.y,z.y,V),W=C.lerp(k.z,z.z,V),H=C.lerp(k.w,z.w,V);for(i=4*E;4*E+8>i;++i)I.color.values.push(f[i]);for(I.color.values.push(U,G,W,H),I.color.values.push(U,G,W,H),D.color.values.push(U,G,W,H),D.color.values.push(U,G,W,H),i=4*w;4*w+8>i;++i)D.color.values.push(f[i])}if(u(p)){var q=r.fromArray(p,2*E,Fe),j=r.fromArray(p,2*(t+3),Be),Y=C.lerp(q.x,j.x,V);for(i=2*E;2*E+4>i;++i)I.st.values.push(p[i]);for(I.st.values.push(Y,q.y),I.st.values.push(Y,j.y),D.st.values.push(Y,q.y),D.st.values.push(Y,j.y),i=2*w;2*w+4>i;++i)D.st.values.push(p[i])}a=I.position.values.length/3-4,M.push(a,a+2,a+1),M.push(a+1,a+2,a+3),a=D.position.values.length/3-4,R.push(a,a+2,a+1),R.push(a+1,a+2,a+3)}else{var K,Q;for(x.y<0?(K=g.attributes,Q=g.indices):(K=v.attributes,Q=v.indices),K.position.values.push(x.x,x.y,x.z),K.position.values.push(b.x,b.y,b.z),K.position.values.push(A.x,A.y,A.z),K.position.values.push(P.x,P.y,P.z),i=3*t;3*t+12>i;++i)K.prevPosition.values.push(h[i]),K.nextPosition.values.push(d[i]);for(i=2*t;2*t+8>i;++i)K.expandAndWidth.values.push(m[i]),u(p)&&K.st.values.push(p[i]);if(u(f))for(i=4*t;4*t+16>i;++i)K.color.values.push(f[i]);a=K.position.values.length/3-4,Q.push(a,a+2,a+1),Q.push(a+1,a+2,a+3)}}Z(e,g,v)}var te={};te.toWireframe=function(e){var t=e.indices;if(u(t)){switch(e.primitiveType){case T.TRIANGLES:e.indices=A(t);break;case T.TRIANGLE_STRIP:e.indices=P(t);break;case T.TRIANGLE_FAN:e.indices=I(t);break;default:throw new c("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=T.LINES}return e},te.createLineSegmentsForVectors=function(e,t,r){t=l(t,"normal"),r=l(r,1e4);for(var n=e.attributes.position.values,o=e.attributes[t].values,a=n.length,c=new Float64Array(2*a),h=0,d=0;a>d;d+=3)c[h++]=n[d],c[h++]=n[d+1],c[h++]=n[d+2],c[h++]=n[d]+o[d]*r,c[h++]=n[d+1]+o[d+1]*r,c[h++]=n[d+2]+o[d+2]*r;var f,v=e.boundingSphere;return u(v)&&(f=new i(v.center,v.radius+r)),new m({attributes:{position:new p({componentDatatype:s.DOUBLE,componentsPerAttribute:3,values:c})},primitiveType:T.LINES,boundingSphere:f})},te.createAttributeLocations=function(e){var t,i=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","binormal","tangent","compressedAttributes"],r=e.attributes,n={},o=0,a=i.length;for(t=0;a>t;++t){var s=i[t];u(r[s])&&(n[s]=o++)}for(var l in r)r.hasOwnProperty(l)&&!u(n[l])&&(n[l]=o++);return n},te.reorderForPreVertexCache=function(e){var t=m.computeNumberOfVertices(e),i=e.indices;if(u(i)){for(var r=new Int32Array(t),n=0;t>n;n++)r[n]=-1;for(var o,a=i,l=a.length,c=g.createTypedArray(t,l),h=0,d=0,p=0;l>h;)o=r[a[h]],-1!==o?c[d]=o:(o=a[h],r[o]=p,c[d]=p,++p),++h,++d;e.indices=c;var f=e.attributes;for(var v in f)if(f.hasOwnProperty(v)&&u(f[v])&&u(f[v].values)){for(var _=f[v],y=_.values,C=0,E=_.componentsPerAttribute,S=s.createTypedArray(_.componentDatatype,p*E);t>C;){var w=r[C];if(-1!==w)for(n=0;E>n;n++)S[E*w+n]=y[E*C+n];++C}_.values=S}}return e},te.reorderForPostVertexCache=function(e,t){var i=e.indices;if(e.primitiveType===T.TRIANGLES&&u(i)){for(var r=i.length,n=0,o=0;r>o;o++)i[o]>n&&(n=i[o]);e.indices=x.tipsify({indices:i,maximumIndex:n,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],i=m.computeNumberOfVertices(e);if(u(e.indices)&&i>=C.SIXTY_FOUR_KILOBYTES){var r,n=[],o=[],a=0,s=M(e.attributes),l=e.indices,c=l.length;e.primitiveType===T.TRIANGLES?r=3:e.primitiveType===T.LINES?r=2:e.primitiveType===T.POINTS&&(r=1);for(var h=0;c>h;h+=r){for(var d=0;r>d;++d){var p=l[h+d],f=n[p];u(f)||(f=a++,n[p]=f,D(s,e.attributes,p)),o.push(f)}a+r>=C.SIXTY_FOUR_KILOBYTES&&(t.push(new m({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),n=[],o=[],a=0,s=M(e.attributes))}0!==o.length&&t.push(new m({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var ie=new n,re=new a;te.projectTo2D=function(e,t,i,r,o){var a=e.attributes[t];o=u(o)?o:new d;for(var l=o.ellipsoid,h=a.values,m=new Float64Array(h.length),f=0,v=0;v<h.length;v+=3){var g=n.fromArray(h,v,ie),_=l.cartesianToCartographic(g,re);if(!u(_))throw new c("Could not project point ("+g.x+", "+g.y+", "+g.z+") to 2D.");var y=o.project(_,ie);m[f++]=y.x,m[f++]=y.y,m[f++]=y.z}return e.attributes[i]=a,e.attributes[r]=new p({componentDatatype:s.DOUBLE,componentsPerAttribute:3,values:m}),delete e.attributes[t],e};var ne={high:0,low:0};te.encodeAttribute=function(e,t,i,r){for(var n=e.attributes[t],o=n.values,a=o.length,l=new Float32Array(a),u=new Float32Array(a),c=0;a>c;++c)h.encode(o[c],ne),l[c]=ne.high,u[c]=ne.low;var d=n.componentsPerAttribute;return e.attributes[i]=new p({componentDatatype:s.FLOAT,componentsPerAttribute:d,values:l}),e.attributes[r]=new p({componentDatatype:s.FLOAT,componentsPerAttribute:d,values:u}),delete e.attributes[t],e};var oe=new n,ae=new S,se=new E;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(S.equals(t,S.IDENTITY))return e;var r=e.geometry.attributes;R(t,r.position),R(t,r.prevPosition),R(t,r.nextPosition),(u(r.normal)||u(r.binormal)||u(r.tangent))&&(S.inverse(t,ae),S.transpose(ae,ae),S.getRotation(ae,se),O(se,r.normal),O(se,r.binormal),O(se,r.tangent));var n=e.geometry.boundingSphere;return u(n)&&(e.geometry.boundingSphere=i.transform(n,t,n)),e.modelMatrix=S.clone(S.IDENTITY),e};var le=new n;te.combineInstances=function(e){for(var t=[],i=[],r=e.length,n=0;r>n;++n){var o=e[n];u(o.geometry)?t.push(o):i.push(o)}var a=[];return t.length>0&&a.push(L(t,"geometry")),i.length>0&&(a.push(L(i,"westHemisphereGeometry")),a.push(L(i,"eastHemisphereGeometry"))),a};var ue=new n,ce=new n,he=new n,de=new n;te.computeNormal=function(e){for(var t=e.indices,i=e.attributes,r=i.position.values,o=i.position.values.length/3,a=t.length,l=new Array(o),u=new Array(a/3),c=new Array(a),h=0;o>h;h++)l[h]={indexOffset:0,count:0,currentCount:0};var d=0;for(h=0;a>h;h+=3){var m=t[h],f=t[h+1],v=t[h+2],g=3*m,_=3*f,y=3*v;ce.x=r[g],ce.y=r[g+1],ce.z=r[g+2],he.x=r[_],he.y=r[_+1],he.z=r[_+2],de.x=r[y],de.y=r[y+1],de.z=r[y+2],l[m].count++,l[f].count++,l[v].count++,n.subtract(he,ce,he),n.subtract(de,ce,de),u[d]=n.cross(he,de,new n),d++}var C=0;for(h=0;o>h;h++)l[h].indexOffset+=C,C+=l[h].count;d=0;var E;for(h=0;a>h;h+=3){E=l[t[h]];var S=E.indexOffset+E.currentCount;c[S]=d,E.currentCount++,E=l[t[h+1]],S=E.indexOffset+E.currentCount,c[S]=d,E.currentCount++,E=l[t[h+2]],S=E.indexOffset+E.currentCount,c[S]=d,E.currentCount++,d++}var w=new Float32Array(3*o);for(h=0;o>h;h++){var T=3*h;if(E=l[h],E.count>0){for(n.clone(n.ZERO,ue),d=0;d<E.count;d++)n.add(ue,u[c[E.indexOffset+d]],ue);n.normalize(ue,ue),w[T]=ue.x,w[T+1]=ue.y,w[T+2]=ue.z}else w[T]=0,w[T+1]=0,w[T+2]=1}return e.attributes.normal=new p({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:w}),e};var me=new n,pe=new n,fe=new n;te.computeBinormalAndTangent=function(e){for(var t=(e.attributes,e.indices),i=e.attributes.position.values,r=e.attributes.normal.values,o=e.attributes.st.values,a=e.attributes.position.values.length/3,l=t.length,u=new Array(3*a),c=0;c<u.length;c++)u[c]=0;var h,d,m;for(c=0;l>c;c+=3){var f=t[c],v=t[c+1],g=t[c+2];h=3*f,d=3*v,m=3*g;var _=2*f,y=2*v,C=2*g,E=i[h],S=i[h+1],w=i[h+2],T=o[_],x=o[_+1],b=o[y+1]-x,A=o[C+1]-x,P=1/((o[y]-T)*A-(o[C]-T)*b),I=(A*(i[d]-E)-b*(i[m]-E))*P,M=(A*(i[d+1]-S)-b*(i[m+1]-S))*P,D=(A*(i[d+2]-w)-b*(i[m+2]-w))*P;u[h]+=I,u[h+1]+=M,u[h+2]+=D,u[d]+=I,u[d+1]+=M,u[d+2]+=D,u[m]+=I,u[m+1]+=M,u[m+2]+=D}var R=new Float32Array(3*a),O=new Float32Array(3*a);for(c=0;a>c;c++){h=3*c,d=h+1,m=h+2;var N=n.fromArray(r,h,me),L=n.fromArray(u,h,fe),F=n.dot(N,L);n.multiplyByScalar(N,F,pe),n.normalize(n.subtract(L,pe,L),L),O[h]=L.x,O[d]=L.y,O[m]=L.z,n.normalize(n.cross(N,L,L),L),R[h]=L.x,R[d]=L.y,R[m]=L.z}return e.attributes.tangent=new p({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:O}),e.attributes.binormal=new p({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:R}),e};var ve=new r,ge=new n,_e=new n,ye=new n;te.compressVertices=function(t){var i=t.attributes.normal,o=t.attributes.st;if(!u(i)&&!u(o))return t;var a,l,c,h,d=t.attributes.tangent,m=t.attributes.binormal;u(i)&&(a=i.values),u(o)&&(l=o.values),u(d)&&(c=d.values),m&&(h=m.values);var f=u(a)?a.length:l.length,v=u(a)?3:2,g=f/v,_=g,y=u(l)&&u(a)?2:1;y+=u(c)||u(h)?1:0,_*=y;for(var C=new Float32Array(_),E=0,S=0;g>S;++S){u(l)&&(r.fromArray(l,2*S,ve),C[E++]=e.compressTextureCoordinates(ve));var w=3*S;u(a)&&u(c)&&u(h)?(n.fromArray(a,w,ge),n.fromArray(c,w,_e),n.fromArray(h,w,ye),e.octPack(ge,_e,ye,ve),C[E++]=ve.x,C[E++]=ve.y):(u(a)&&(n.fromArray(a,w,ge),C[E++]=e.octEncodeFloat(ge)),u(c)&&(n.fromArray(c,w,ge),C[E++]=e.octEncodeFloat(ge)),u(h)&&(n.fromArray(h,w,ge),C[E++]=e.octEncodeFloat(ge)))}return t.attributes.compressedAttributes=new p({componentDatatype:s.FLOAT,componentsPerAttribute:y,values:C}),u(a)&&delete t.attributes.normal,u(l)&&delete t.attributes.st,u(c)&&delete t.attributes.tangent,u(h)&&delete t.attributes.binormal,t};var Ce=new n,Ee=new n,Se=new n,we=new n,Te=new n,xe={positions:new Array(7),indices:new Array(9)},be=new n,Ae=new n,Pe=new n,Ie=new n,Me=new r,De=new r,Re=new r,Oe=w.fromPointNormal(n.ZERO,n.UNIT_Y),Ne=new n,Le=new n,Fe=new r,Be=new r,Ve=new n,ke=new n,ze=new n,Ue=new n,Ge=new n,We=new n,He=new n,qe=new o;return te.splitLongitude=function(e){var t=e.geometry,r=t.boundingSphere;if(u(r)){var n=r.center.x-r.radius;if(n>0||i.intersectPlane(r,w.ORIGIN_ZX_PLANE)!==_.INTERSECTING)return e}if(t.geometryType!==v.NONE)switch(t.geometryType){case v.POLYLINES:ee(e);break;case v.TRIANGLES:J(e);break;case v.LINES:$(e)}else G(t),t.primitiveType===T.TRIANGLES?J(e):t.primitiveType===T.LINES&&$(e);return e},te}),i("Core/EllipseGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PrimitiveType","./Quaternion","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E){"use strict";function S(e,r,o){var a=r.vertexFormat,s=r.center,u=r.semiMajorAxis,h=r.semiMinorAxis,p=r.ellipsoid,f=r.stRotation,v=o?e.length/3*2:e.length/3,g=a.st?new Float32Array(2*v):void 0,y=a.normal?new Float32Array(3*v):void 0,E=a.tangent?new Float32Array(3*v):void 0,S=a.binormal?new Float32Array(3*v):void 0,w=0,T=F,x=B,b=V,A=new c(p),P=A.project(p.cartesianToCartographic(s,k),z),R=p.scaleToGeodeticSurface(s,I);p.geodeticSurfaceNormal(R,R);for(var W=C.fromAxisAngle(R,f,L),H=_.fromQuaternion(W,N),q=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,U),j=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,G),Y=e.length,X=o?Y:0,Z=X/3*2,K=0;Y>K;K+=3){var Q=K+1,J=K+2,$=i.fromArray(e,K,I);if(a.st){var ee=_.multiplyByVector(H,$,M),te=A.project(p.cartesianToCartographic(ee,k),D);i.subtract(te,P,te),O.x=(te.x+u)/(2*u),O.y=(te.y+h)/(2*h),q.x=Math.min(O.x,q.x),q.y=Math.min(O.y,q.y),j.x=Math.max(O.x,j.x),j.y=Math.max(O.y,j.y),o&&(g[w+Z]=O.x,g[w+1+Z]=O.y),g[w++]=O.x,g[w++]=O.y}T=p.geodeticSurfaceNormal($,T),(a.normal||a.tangent||a.binormal)&&((a.tangent||a.binormal)&&(x=i.normalize(i.cross(i.UNIT_Z,T,x),x),_.multiplyByVector(H,x,x)),a.normal&&(y[K]=T.x,y[Q]=T.y,y[J]=T.z,o&&(y[K+X]=-T.x,y[Q+X]=-T.y,y[J+X]=-T.z)),a.tangent&&(E[K]=x.x,E[Q]=x.y,E[J]=x.z,o&&(E[K+X]=-x.x,E[Q+X]=-x.y,E[J+X]=-x.z)),a.binormal&&(b=i.normalize(i.cross(T,x,b),b),S[K]=b.x,S[Q]=b.y,S[J]=b.z,o&&(S[K+X]=b.x,S[Q+X]=b.y,S[J+X]=b.z)))}if(a.st){Y=g.length;for(var ie=0;Y>ie;ie+=2)g[ie]=(g[ie]-q.x)/(j.x-q.x),g[ie+1]=(g[ie+1]-q.y)/(j.y-q.y)}var re=new m;if(a.position){var ne=l.raisePositionsToHeight(e,r,o);re.position=new d({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:ne})}return a.st&&(re.st=new d({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:g})),a.normal&&(re.normal=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:y})),a.tangent&&(re.tangent=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:E})),a.binormal&&(re.binormal=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:S})),re}function w(e){var t,i,r,n,o,a=new Array(12*(e*(e+1))-6),s=0;for(t=0,r=1,n=0;3>n;n++)a[s++]=r++,a[s++]=t,a[s++]=r;for(n=2;e+1>n;++n){for(r=n*(n+1)-1,t=(n-1)*n-1,a[s++]=r++,a[s++]=t,a[s++]=r,i=2*n,o=0;i-1>o;++o)a[s++]=r,a[s++]=t++,a[s++]=t,a[s++]=r++,a[s++]=t,a[s++]=r;a[s++]=r++,a[s++]=t,a[s++]=r}for(i=2*e,++r,++t,n=0;i-1>n;++n)a[s++]=r,a[s++]=t++,a[s++]=t,a[s++]=r++,a[s++]=t,a[s++]=r;for(a[s++]=r,a[s++]=t++,a[s++]=t,a[s++]=r++,a[s++]=t++,a[s++]=t,++t,n=e-1;n>1;--n){for(a[s++]=t++,a[s++]=t,a[s++]=r,i=2*n,o=0;i-1>o;++o)a[s++]=r,a[s++]=t++,a[s++]=t,a[s++]=r++,a[s++]=t,a[s++]=r;a[s++]=t++,a[s++]=t++,a[s++]=r++}for(n=0;3>n;n++)a[s++]=t++,a[s++]=t,a[s++]=r;return a}function T(t){var r=t.center;W=i.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(r,W),t.height,W),W=i.add(r,W,W);var n=new e(W,t.semiMajorAxis),o=l.computeEllipsePositions(t,!0,!1),a=o.positions,s=o.numPts,u=S(a,t,!1),c=w(s);return c=v.createTypedArray(a.length/3,c),{boundingSphere:n,attributes:u,indices:c}}function x(e,r){var o=r.vertexFormat,a=r.center,s=r.semiMajorAxis,l=r.semiMinorAxis,u=r.ellipsoid,h=r.height,p=r.extrudedHeight,f=r.stRotation,v=e.length/3*2,g=new Float64Array(3*v),y=o.st?new Float32Array(2*v):void 0,E=o.normal?new Float32Array(3*v):void 0,S=o.tangent?new Float32Array(3*v):void 0,w=o.binormal?new Float32Array(3*v):void 0,T=0,x=F,b=B,A=V,P=new c(u),W=P.project(u.cartesianToCartographic(a,k),z),H=u.scaleToGeodeticSurface(a,I);u.geodeticSurfaceNormal(H,H);for(var q=C.fromAxisAngle(H,f,L),j=_.fromQuaternion(q,N),Y=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,U),X=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,G),Z=e.length,K=Z/3*2,Q=0;Z>Q;Q+=3){var J,$=Q+1,ee=Q+2,te=i.fromArray(e,Q,I);if(o.st){var ie=_.multiplyByVector(j,te,M),re=P.project(u.cartesianToCartographic(ie,k),D);i.subtract(re,W,re),O.x=(re.x+s)/(2*s),O.y=(re.y+l)/(2*l),Y.x=Math.min(O.x,Y.x),Y.y=Math.min(O.y,Y.y),X.x=Math.max(O.x,X.x),X.y=Math.max(O.y,X.y),y[T+K]=O.x,y[T+1+K]=O.y,y[T++]=O.x,y[T++]=O.y}te=u.scaleToGeodeticSurface(te,te),J=i.clone(te,M),x=u.geodeticSurfaceNormal(te,x);var ne=i.multiplyByScalar(x,h,R);if(te=i.add(te,ne,te),ne=i.multiplyByScalar(x,p,ne),J=i.add(J,ne,J),o.position&&(g[Q+Z]=J.x,g[$+Z]=J.y,g[ee+Z]=J.z,g[Q]=te.x,g[$]=te.y,g[ee]=te.z),o.normal||o.tangent||o.binormal){A=i.clone(x,A);var oe=i.fromArray(e,(Q+3)%Z,R);i.subtract(oe,te,oe);var ae=i.subtract(J,te,D);x=i.normalize(i.cross(ae,oe,x),x),o.normal&&(E[Q]=x.x,E[$]=x.y,E[ee]=x.z,E[Q+Z]=x.x,E[$+Z]=x.y,E[ee+Z]=x.z),o.tangent&&(b=i.normalize(i.cross(A,x,b),b),S[Q]=b.x,S[$]=b.y,S[ee]=b.z,S[Q+Z]=b.x,S[Q+1+Z]=b.y,S[Q+2+Z]=b.z),o.binormal&&(w[Q]=A.x,w[$]=A.y,w[ee]=A.z,w[Q+Z]=A.x,w[$+Z]=A.y,w[ee+Z]=A.z)}}if(o.st){Z=y.length;for(var se=0;Z>se;se+=2)y[se]=(y[se]-Y.x)/(X.x-Y.x),y[se+1]=(y[se+1]-Y.y)/(X.y-Y.y)}var le=new m;return o.position&&(le.position=new d({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:g})),o.st&&(le.st=new d({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:y})),o.normal&&(le.normal=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:E})),o.tangent&&(le.tangent=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:S})),o.binormal&&(le.binormal=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:w})),le}function b(e){for(var t=e.length/3,i=v.createTypedArray(t,6*t),r=0,n=0;t>n;n++){var o=n,a=n+t,s=(o+1)%t,l=s+t;i[r++]=o,i[r++]=a,i[r++]=s,i[r++]=s,i[r++]=a,i[r++]=l}return i}function A(t){var r=t.center,n=t.ellipsoid,o=t.semiMajorAxis,a=i.multiplyByScalar(n.geodeticSurfaceNormal(r,I),t.height,I);H.center=i.add(r,a,H.center),H.radius=o,a=i.multiplyByScalar(n.geodeticSurfaceNormal(r,a),t.extrudedHeight,a),q.center=i.add(r,a,q.center),q.radius=o;var s=l.computeEllipsePositions(t,!0,!0),u=s.positions,c=s.numPts,d=s.outerPositions,m=e.union(H,q),g=S(u,t,!0),_=w(c),C=_.length;_.length=2*C;for(var E=u.length/3,T=0;C>T;T+=3)_[T+C]=_[T+2]+E,_[T+1+C]=_[T+1]+E,_[T+2+C]=_[T]+E;var A=v.createTypedArray(2*E/3,_),P=new h({attributes:g,indices:A,primitiveType:y.TRIANGLES}),M=x(d,t);_=b(d);var D=v.createTypedArray(2*d.length/3,_),R=new h({attributes:M,indices:D,primitiveType:y.TRIANGLES}),O=f.combineInstances([new p({geometry:P}),new p({geometry:R})]);return{boundingSphere:m,attributes:O[0].attributes,indices:O[0].indices}}function P(e){e=o(e,o.EMPTY_OBJECT);var t=e.center,r=o(e.ellipsoid,u.WGS84),n=e.semiMajorAxis,s=e.semiMinorAxis,l=o(e.granularity,g.RADIANS_PER_DEGREE),c=o(e.height,0),h=e.extrudedHeight,d=a(h)&&Math.abs(c-h)>1,m=o(e.vertexFormat,E.DEFAULT);this._center=i.clone(t),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=u.clone(r),this._rotation=o(e.rotation,0),this._stRotation=o(e.stRotation,0),this._height=c,this._granularity=l,this._vertexFormat=E.clone(m),this._extrudedHeight=o(h,c),this._extrude=d,this._workerName="createEllipseGeometry"}var I=new i,M=new i,D=new i,R=new i,O=new t,N=new _,L=new C,F=new i,B=new i,V=new i,k=new r,z=new i,U=new t,G=new t,W=new i,H=new e,q=new e;P.packedLength=i.packedLength+u.packedLength+E.packedLength+8,P.pack=function(e,t,r){r=o(r,0),i.pack(e._center,t,r),r+=i.packedLength,u.pack(e._ellipsoid,t,r),r+=u.packedLength,E.pack(e._vertexFormat,t,r),r+=E.packedLength,t[r++]=e._semiMajorAxis,t[r++]=e._semiMinorAxis,t[r++]=e._rotation,t[r++]=e._stRotation,t[r++]=e._height,t[r++]=e._granularity,t[r++]=e._extrudedHeight,t[r]=e._extrude?1:0};var j=new i,Y=new u,X=new E,Z={center:j,ellipsoid:Y,vertexFormat:X,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0};return P.unpack=function(e,t,r){t=o(t,0);var n=i.unpack(e,t,j);t+=i.packedLength;var s=u.unpack(e,t,Y);t+=u.packedLength;var l=E.unpack(e,t,X);t+=E.packedLength;var c=e[t++],h=e[t++],d=e[t++],m=e[t++],p=e[t++],f=e[t++],v=e[t++],g=1===e[t];return a(r)?(r._center=i.clone(n,r._center),r._ellipsoid=u.clone(s,r._ellipsoid),r._vertexFormat=E.clone(l,r._vertexFormat),r._semiMajorAxis=c,r._semiMinorAxis=h,r._rotation=d,r._stRotation=m,r._height=p,r._granularity=f,r._extrudedHeight=v,r._extrude=g,r):(Z.height=p,Z.extrudedHeight=v,Z.granularity=f,Z.stRotation=m,Z.rotation=d,Z.semiMajorAxis=c,Z.semiMinorAxis=h,new P(Z))},P.createGeometry=function(e){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,i={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation};return e._extrude?(i.extrudedHeight=Math.min(e._extrudedHeight,e._height),i.height=Math.max(e._extrudedHeight,e._height),t=A(i)):t=T(i),new h({attributes:t.attributes,indices:t.indices,primitiveType:y.TRIANGLES,boundingSphere:t.boundingSphere})},P.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new P({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:n,stRotation:e._stRotation,granularity:r,extrudedHeight:o,height:a,vertexFormat:E.POSITION_ONLY})},P}),i("Core/CircleGeometry",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./EllipseGeometry","./Ellipsoid","./Math","./VertexFormat"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=t(e,t.EMPTY_OBJECT);var i=e.radius,r={center:e.center,semiMajorAxis:i,semiMinorAxis:i,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation};this._ellipseGeometry=new n(r),this._workerName="createCircleGeometry"}l.packedLength=n.packedLength,l.pack=function(e,t,i){n.pack(e._ellipseGeometry,t,i)};var u=new n({center:new e,semiMajorAxis:1,semiMinorAxis:1}),c={center:new e,radius:void 0,ellipsoid:o.clone(o.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new s,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};return l.unpack=function(t,r,a){var h=n.unpack(t,r,u);return c.center=e.clone(h._center,c.center),c.ellipsoid=o.clone(h._ellipsoid,c.ellipsoid),c.height=h._height,c.extrudedHeight=h._extrudedHeight,c.granularity=h._granularity,c.vertexFormat=s.clone(h._vertexFormat,c.vertexFormat),c.stRotation=h._stRotation,i(a)?(c.semiMajorAxis=h._semiMajorAxis,c.semiMinorAxis=h._semiMinorAxis,a._ellipseGeometry=new n(c),a):(c.radius=h._semiMajorAxis,new l(c))},l.createGeometry=function(e){return n.createGeometry(e._ellipseGeometry)},l.createShadowVolume=function(e,t,i){var r=e._ellipseGeometry._granularity,n=e._ellipseGeometry._ellipsoid,o=t(r,n),a=i(r,n);return new l({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:n,stRotation:e._ellipseGeometry._stRotation,granularity:r,extrudedHeight:o,height:a,vertexFormat:s.POSITION_ONLY})},l}),i("Core/EllipseOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m){"use strict";function p(r){var n=r.center;_=t.multiplyByScalar(r.ellipsoid.geodeticSurfaceNormal(n,_),r.height,_),_=t.add(n,_,_);for(var o=new e(_,r.semiMajorAxis),s=a.computeEllipsePositions(r,!1,!0).outerPositions,l=new c({position:new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:a.raisePositionsToHeight(s,r,!1)})}),d=s.length/3,m=h.createTypedArray(d,2*d),p=0,f=0;d>f;++f)m[p++]=f,m[p++]=(f+1)%d;return{boundingSphere:o,attributes:l,indices:m}}function f(n){var o=r(n.numberOfVerticalLines,16);o=Math.max(o,0);var s=n.center,l=n.ellipsoid,d=n.semiMajorAxis,m=t.multiplyByScalar(l.geodeticSurfaceNormal(s,g),n.height,g);y.center=t.add(s,m,y.center),y.radius=d,m=t.multiplyByScalar(l.geodeticSurfaceNormal(s,m),n.extrudedHeight,m),C.center=t.add(s,m,C.center),C.radius=d;var p=a.computeEllipsePositions(n,!1,!0).outerPositions,f=new c({position:new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:a.raisePositionsToHeight(p,n,!0)})});p=f.position.values;var v=e.union(y,C),_=p.length/3,E=h.createTypedArray(_,2*_+2*o);_/=2;var S,w=0;for(S=0;_>S;++S)E[w++]=S,E[w++]=(S+1)%_,E[w++]=S+_,E[w++]=(S+1)%_+_;var T;if(o>0){var x=Math.min(o,_);T=Math.round(_/x)}var b=Math.min(T*o,_);if(o>0)for(S=0;b>S;S+=T)E[w++]=S,E[w++]=S+_;return{boundingSphere:v,attributes:f,indices:E}}function v(e){e=r(e,r.EMPTY_OBJECT);var i=e.center,o=r(e.ellipsoid,s.WGS84),a=e.semiMajorAxis,l=e.semiMinorAxis,u=r(e.granularity,d.RADIANS_PER_DEGREE),c=r(e.height,0),h=e.extrudedHeight,m=n(h)&&Math.abs(c-h)>1;this._center=t.clone(i),this._semiMajorAxis=a,this._semiMinorAxis=l,this._ellipsoid=s.clone(o),this._rotation=r(e.rotation,0),this._height=c,this._granularity=u,this._extrudedHeight=h,this._extrude=m,this._numberOfVerticalLines=Math.max(r(e.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"}var g=new t,_=new t,y=new e,C=new e;v.packedLength=t.packedLength+s.packedLength+9,v.pack=function(e,i,o){o=r(o,0),t.pack(e._center,i,o),o+=t.packedLength,s.pack(e._ellipsoid,i,o),o+=s.packedLength,i[o++]=e._semiMajorAxis,i[o++]=e._semiMinorAxis,i[o++]=e._rotation,i[o++]=e._height,i[o++]=e._granularity,i[o++]=n(e._extrudedHeight)?1:0,i[o++]=r(e._extrudedHeight,0),i[o++]=e._extrude?1:0,i[o]=e._numberOfVerticalLines};var E=new t,S=new s,w={center:E,ellipsoid:S,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0};return v.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,E);i+=t.packedLength;var l=s.unpack(e,i,S);i+=s.packedLength;var u=e[i++],c=e[i++],h=e[i++],d=e[i++],m=e[i++],p=e[i++],f=e[i++],g=1===e[i++],_=e[i];return n(o)?(o._center=t.clone(a,o._center),o._ellipsoid=s.clone(l,o._ellipsoid),o._semiMajorAxis=u,o._semiMinorAxis=c,o._rotation=h,o._height=d,o._granularity=m,o._extrudedHeight=p?f:void 0,o._extrude=g,o._numberOfVerticalLines=_,o):(w.height=d,w.extrudedHeight=p?f:void 0,w.granularity=m,w.rotation=h,w.semiMajorAxis=u,w.semiMinorAxis=c,w.numberOfVerticalLines=_,new v(w))},v.createGeometry=function(e){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,i={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};return e._extrude?(i.extrudedHeight=Math.min(e._extrudedHeight,e._height),i.height=Math.max(e._extrudedHeight,e._height),t=f(i)):t=p(i),new l({attributes:t.attributes,indices:t.indices,primitiveType:m.LINES,boundingSphere:t.boundingSphere})},v}),i("Core/CircleOutlineGeometry",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./EllipseOutlineGeometry","./Ellipsoid"],function(e,t,i,r,n,o){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT);var i=e.radius,r={center:e.center,semiMajorAxis:i,semiMinorAxis:i,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new n(r),this._workerName="createCircleOutlineGeometry"}a.packedLength=n.packedLength,a.pack=function(e,t,i){n.pack(e._ellipseGeometry,t,i)};var s=new n({center:new e,semiMajorAxis:1,semiMinorAxis:1}),l={center:new e,radius:void 0,ellipsoid:o.clone(o.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};return a.unpack=function(t,r,u){var c=n.unpack(t,r,s);return l.center=e.clone(c._center,l.center),l.ellipsoid=o.clone(c._ellipsoid,l.ellipsoid),l.height=c._height,l.extrudedHeight=c._extrudedHeight,l.granularity=c._granularity,l.numberOfVerticalLines=c._numberOfVerticalLines,i(u)?(l.semiMajorAxis=c._semiMajorAxis,l.semiMinorAxis=c._semiMinorAxis,u._ellipseGeometry=new n(l),u):(l.radius=c._semiMajorAxis,new a(l))},a.createGeometry=function(e){return n.createGeometry(e._ellipseGeometry)},a}),i("Core/ClockRange",["./freezeObject"],function(e){"use strict";var t={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};return e(t)}),i("Core/ClockStep",["./freezeObject"],function(e){"use strict";var t={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};return e(t)}),i("Core/getTimestamp",["./defined"],function(e){"use strict";var t;return t="undefined"!=typeof performance&&e(performance.now)?function(){return performance.now()}:function(){return Date.now()}}),i("Core/Clock",["./ClockRange","./ClockStep","./defaultValue","./defined","./DeveloperError","./Event","./getTimestamp","./JulianDate"],function(e,t,i,r,n,o,a,s){"use strict";function l(n){n=i(n,i.EMPTY_OBJECT);var l=n.startTime,u=!r(l),c=n.stopTime,h=!r(c),d=n.currentTime,m=!r(d);u&&h&&m?(d=s.now(),l=s.clone(d),c=s.addDays(d,1,new s)):u&&h?(l=s.clone(d),c=s.addDays(d,1,new s)):u&&m?(l=s.addDays(c,-1,new s),d=s.clone(l)):m&&h?(d=s.clone(l),c=s.addDays(l,1,new s)):m?d=s.clone(l):h?c=s.addDays(d,1,new s):u&&(l=s.clone(d)),this.startTime=l,this.stopTime=c,this.currentTime=d,this.multiplier=i(n.multiplier,1),this.clockStep=i(n.clockStep,t.SYSTEM_CLOCK_MULTIPLIER),this.clockRange=i(n.clockRange,e.UNBOUNDED),this.canAnimate=i(n.canAnimate,!0),this.shouldAnimate=i(n.shouldAnimate,!0),this.onTick=new o,this._lastSystemTime=a()}return l.prototype.tick=function(){var i=a(),r=s.clone(this.currentTime),n=this.startTime,o=this.stopTime,l=this.multiplier;if(this.canAnimate&&this.shouldAnimate)if(this.clockStep===t.SYSTEM_CLOCK)r=s.now(r);else{if(this.clockStep===t.TICK_DEPENDENT)r=s.addSeconds(r,l,r);else{var u=i-this._lastSystemTime;r=s.addSeconds(r,l*(u/1e3),r)}if(this.clockRange===e.CLAMPED)s.lessThan(r,n)?r=s.clone(n,r):s.greaterThan(r,o)&&(r=s.clone(o,r));else if(this.clockRange===e.LOOP_STOP)for(s.lessThan(r,n)&&(r=s.clone(n,r));s.greaterThan(r,o);)r=s.addSeconds(n,s.secondsDifference(r,o),r)}return this.currentTime=r,this._lastSystemTime=i,this.onTick.raiseEvent(this),r},l}),i("Core/Color",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math"],function(e,t,i,r,n,o){"use strict";function a(e,t,i){return 0>i&&(i+=1),i>1&&(i-=1),1>6*i?e+6*(t-e)*i:1>2*i?t:2>3*i?e+(t-e)*(2/3-i)*6:e}function s(t,i,r,n){ +this.red=e(t,1),this.green=e(i,1),this.blue=e(r,1),this.alpha=e(n,1)}s.fromCartesian4=function(e,i){return t(i)?(i.red=e.x,i.green=e.y,i.blue=e.z,i.alpha=e.w,i):new s(e.x,e.y,e.z,e.w)},s.fromBytes=function(i,r,n,o,a){return i=s.byteToFloat(e(i,255)),r=s.byteToFloat(e(r,255)),n=s.byteToFloat(e(n,255)),o=s.byteToFloat(e(o,255)),t(a)?(a.red=i,a.green=r,a.blue=n,a.alpha=o,a):new s(i,r,n,o)},s.fromAlpha=function(e,i,r){return t(r)?(r.red=e.red,r.green=e.green,r.blue=e.blue,r.alpha=i,r):new s(e.red,e.green,e.blue,i)};var l,u,c;r.supportsTypedArrays()&&(l=new ArrayBuffer(4),u=new Uint32Array(l),c=new Uint8Array(l)),s.fromRgba=function(e){return u[0]=e,s.fromBytes(c[0],c[1],c[2],c[3])},s.fromHsl=function(t,i,r,n){t=e(t,0)%1,i=e(i,0),r=e(r,0),n=e(n,1);var o=r,l=r,u=r;if(0!==i){var c;c=.5>r?r*(1+i):r+i-r*i;var h=2*r-c;o=a(h,c,t+1/3),l=a(h,c,t),u=a(h,c,t-1/3)}return new s(o,l,u,n)},s.fromRandom=function(i,r){i=e(i,e.EMPTY_OBJECT);var n=i.red;if(!t(n)){var a=e(i.minimumRed,0),l=e(i.maximumRed,1);n=a+o.nextRandomNumber()*(l-a)}var u=i.green;if(!t(u)){var c=e(i.minimumGreen,0),h=e(i.maximumGreen,1);u=c+o.nextRandomNumber()*(h-c)}var d=i.blue;if(!t(d)){var m=e(i.minimumBlue,0),p=e(i.maximumBlue,1);d=m+o.nextRandomNumber()*(p-m)}var f=i.alpha;if(!t(f)){var v=e(i.minimumAlpha,0),g=e(i.maximumAlpha,1);f=v+o.nextRandomNumber()*(g-v)}return t(r)?(r.red=n,r.green=u,r.blue=d,r.alpha=f,r):new s(n,u,d,f)};var h=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,d=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,m=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,p=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return s.fromCssColorString=function(i){var r=s[i.toUpperCase()];if(t(r))return s.clone(r);var n=h.exec(i);return null!==n?new s(parseInt(n[1],16)/15,parseInt(n[2],16)/15,parseInt(n[3],16)/15):(n=d.exec(i),null!==n?new s(parseInt(n[1],16)/255,parseInt(n[2],16)/255,parseInt(n[3],16)/255):(n=m.exec(i),null!==n?new s(parseFloat(n[1])/("%"===n[1].substr(-1)?100:255),parseFloat(n[2])/("%"===n[2].substr(-1)?100:255),parseFloat(n[3])/("%"===n[3].substr(-1)?100:255),parseFloat(e(n[4],"1.0"))):(n=p.exec(i),null!==n?s.fromHsl(parseFloat(n[1])/360,parseFloat(n[2])/100,parseFloat(n[3])/100,parseFloat(e(n[4],"1.0"))):void 0)))},s.packedLength=4,s.pack=function(t,i,r){r=e(r,0),i[r++]=t.red,i[r++]=t.green,i[r++]=t.blue,i[r]=t.alpha},s.unpack=function(i,r,n){return r=e(r,0),t(n)||(n=new s),n.red=i[r++],n.green=i[r++],n.blue=i[r++],n.alpha=i[r],n},s.byteToFloat=function(e){return e/255},s.floatToByte=function(e){return 1===e?255:256*e|0},s.clone=function(e,i){return t(e)?t(i)?(i.red=e.red,i.green=e.green,i.blue=e.blue,i.alpha=e.alpha,i):new s(e.red,e.green,e.blue,e.alpha):void 0},s.equals=function(e,i){return e===i||t(e)&&t(i)&&e.red===i.red&&e.green===i.green&&e.blue===i.blue&&e.alpha===i.alpha},s.equalsArray=function(e,t,i){return e.red===t[i]&&e.green===t[i+1]&&e.blue===t[i+2]&&e.alpha===t[i+3]},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.prototype.equalsEpsilon=function(e,i){return this===e||t(e)&&Math.abs(this.red-e.red)<=i&&Math.abs(this.green-e.green)<=i&&Math.abs(this.blue-e.blue)<=i&&Math.abs(this.alpha-e.alpha)<=i},s.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},s.prototype.toCssColorString=function(){var e=s.floatToByte(this.red),t=s.floatToByte(this.green),i=s.floatToByte(this.blue);return 1===this.alpha?"rgb("+e+","+t+","+i+")":"rgba("+e+","+t+","+i+","+this.alpha+")"},s.prototype.toBytes=function(e){var i=s.floatToByte(this.red),r=s.floatToByte(this.green),n=s.floatToByte(this.blue),o=s.floatToByte(this.alpha);return t(e)?(e[0]=i,e[1]=r,e[2]=n,e[3]=o,e):[i,r,n,o]},s.prototype.toRgba=function(){return c[0]=s.floatToByte(this.red),c[1]=s.floatToByte(this.green),c[2]=s.floatToByte(this.blue),c[3]=s.floatToByte(this.alpha),u[0]},s.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t},s.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t},s.prototype.withAlpha=function(e,t){return s.fromAlpha(this,e,t)},s.ALICEBLUE=n(s.fromCssColorString("#F0F8FF")),s.ANTIQUEWHITE=n(s.fromCssColorString("#FAEBD7")),s.AQUA=n(s.fromCssColorString("#00FFFF")),s.AQUAMARINE=n(s.fromCssColorString("#7FFFD4")),s.AZURE=n(s.fromCssColorString("#F0FFFF")),s.BEIGE=n(s.fromCssColorString("#F5F5DC")),s.BISQUE=n(s.fromCssColorString("#FFE4C4")),s.BLACK=n(s.fromCssColorString("#000000")),s.BLANCHEDALMOND=n(s.fromCssColorString("#FFEBCD")),s.BLUE=n(s.fromCssColorString("#0000FF")),s.BLUEVIOLET=n(s.fromCssColorString("#8A2BE2")),s.BROWN=n(s.fromCssColorString("#A52A2A")),s.BURLYWOOD=n(s.fromCssColorString("#DEB887")),s.CADETBLUE=n(s.fromCssColorString("#5F9EA0")),s.CHARTREUSE=n(s.fromCssColorString("#7FFF00")),s.CHOCOLATE=n(s.fromCssColorString("#D2691E")),s.CORAL=n(s.fromCssColorString("#FF7F50")),s.CORNFLOWERBLUE=n(s.fromCssColorString("#6495ED")),s.CORNSILK=n(s.fromCssColorString("#FFF8DC")),s.CRIMSON=n(s.fromCssColorString("#DC143C")),s.CYAN=n(s.fromCssColorString("#00FFFF")),s.DARKBLUE=n(s.fromCssColorString("#00008B")),s.DARKCYAN=n(s.fromCssColorString("#008B8B")),s.DARKGOLDENROD=n(s.fromCssColorString("#B8860B")),s.DARKGRAY=n(s.fromCssColorString("#A9A9A9")),s.DARKGREEN=n(s.fromCssColorString("#006400")),s.DARKGREY=s.DARKGRAY,s.DARKKHAKI=n(s.fromCssColorString("#BDB76B")),s.DARKMAGENTA=n(s.fromCssColorString("#8B008B")),s.DARKOLIVEGREEN=n(s.fromCssColorString("#556B2F")),s.DARKORANGE=n(s.fromCssColorString("#FF8C00")),s.DARKORCHID=n(s.fromCssColorString("#9932CC")),s.DARKRED=n(s.fromCssColorString("#8B0000")),s.DARKSALMON=n(s.fromCssColorString("#E9967A")),s.DARKSEAGREEN=n(s.fromCssColorString("#8FBC8F")),s.DARKSLATEBLUE=n(s.fromCssColorString("#483D8B")),s.DARKSLATEGRAY=n(s.fromCssColorString("#2F4F4F")),s.DARKSLATEGREY=s.DARKSLATEGRAY,s.DARKTURQUOISE=n(s.fromCssColorString("#00CED1")),s.DARKVIOLET=n(s.fromCssColorString("#9400D3")),s.DEEPPINK=n(s.fromCssColorString("#FF1493")),s.DEEPSKYBLUE=n(s.fromCssColorString("#00BFFF")),s.DIMGRAY=n(s.fromCssColorString("#696969")),s.DIMGREY=s.DIMGRAY,s.DODGERBLUE=n(s.fromCssColorString("#1E90FF")),s.FIREBRICK=n(s.fromCssColorString("#B22222")),s.FLORALWHITE=n(s.fromCssColorString("#FFFAF0")),s.FORESTGREEN=n(s.fromCssColorString("#228B22")),s.FUSCHIA=n(s.fromCssColorString("#FF00FF")),s.GAINSBORO=n(s.fromCssColorString("#DCDCDC")),s.GHOSTWHITE=n(s.fromCssColorString("#F8F8FF")),s.GOLD=n(s.fromCssColorString("#FFD700")),s.GOLDENROD=n(s.fromCssColorString("#DAA520")),s.GRAY=n(s.fromCssColorString("#808080")),s.GREEN=n(s.fromCssColorString("#008000")),s.GREENYELLOW=n(s.fromCssColorString("#ADFF2F")),s.GREY=s.GRAY,s.HONEYDEW=n(s.fromCssColorString("#F0FFF0")),s.HOTPINK=n(s.fromCssColorString("#FF69B4")),s.INDIANRED=n(s.fromCssColorString("#CD5C5C")),s.INDIGO=n(s.fromCssColorString("#4B0082")),s.IVORY=n(s.fromCssColorString("#FFFFF0")),s.KHAKI=n(s.fromCssColorString("#F0E68C")),s.LAVENDER=n(s.fromCssColorString("#E6E6FA")),s.LAVENDAR_BLUSH=n(s.fromCssColorString("#FFF0F5")),s.LAWNGREEN=n(s.fromCssColorString("#7CFC00")),s.LEMONCHIFFON=n(s.fromCssColorString("#FFFACD")),s.LIGHTBLUE=n(s.fromCssColorString("#ADD8E6")),s.LIGHTCORAL=n(s.fromCssColorString("#F08080")),s.LIGHTCYAN=n(s.fromCssColorString("#E0FFFF")),s.LIGHTGOLDENRODYELLOW=n(s.fromCssColorString("#FAFAD2")),s.LIGHTGRAY=n(s.fromCssColorString("#D3D3D3")),s.LIGHTGREEN=n(s.fromCssColorString("#90EE90")),s.LIGHTGREY=s.LIGHTGRAY,s.LIGHTPINK=n(s.fromCssColorString("#FFB6C1")),s.LIGHTSEAGREEN=n(s.fromCssColorString("#20B2AA")),s.LIGHTSKYBLUE=n(s.fromCssColorString("#87CEFA")),s.LIGHTSLATEGRAY=n(s.fromCssColorString("#778899")),s.LIGHTSLATEGREY=s.LIGHTSLATEGRAY,s.LIGHTSTEELBLUE=n(s.fromCssColorString("#B0C4DE")),s.LIGHTYELLOW=n(s.fromCssColorString("#FFFFE0")),s.LIME=n(s.fromCssColorString("#00FF00")),s.LIMEGREEN=n(s.fromCssColorString("#32CD32")),s.LINEN=n(s.fromCssColorString("#FAF0E6")),s.MAGENTA=n(s.fromCssColorString("#FF00FF")),s.MAROON=n(s.fromCssColorString("#800000")),s.MEDIUMAQUAMARINE=n(s.fromCssColorString("#66CDAA")),s.MEDIUMBLUE=n(s.fromCssColorString("#0000CD")),s.MEDIUMORCHID=n(s.fromCssColorString("#BA55D3")),s.MEDIUMPURPLE=n(s.fromCssColorString("#9370DB")),s.MEDIUMSEAGREEN=n(s.fromCssColorString("#3CB371")),s.MEDIUMSLATEBLUE=n(s.fromCssColorString("#7B68EE")),s.MEDIUMSPRINGGREEN=n(s.fromCssColorString("#00FA9A")),s.MEDIUMTURQUOISE=n(s.fromCssColorString("#48D1CC")),s.MEDIUMVIOLETRED=n(s.fromCssColorString("#C71585")),s.MIDNIGHTBLUE=n(s.fromCssColorString("#191970")),s.MINTCREAM=n(s.fromCssColorString("#F5FFFA")),s.MISTYROSE=n(s.fromCssColorString("#FFE4E1")),s.MOCCASIN=n(s.fromCssColorString("#FFE4B5")),s.NAVAJOWHITE=n(s.fromCssColorString("#FFDEAD")),s.NAVY=n(s.fromCssColorString("#000080")),s.OLDLACE=n(s.fromCssColorString("#FDF5E6")),s.OLIVE=n(s.fromCssColorString("#808000")),s.OLIVEDRAB=n(s.fromCssColorString("#6B8E23")),s.ORANGE=n(s.fromCssColorString("#FFA500")),s.ORANGERED=n(s.fromCssColorString("#FF4500")),s.ORCHID=n(s.fromCssColorString("#DA70D6")),s.PALEGOLDENROD=n(s.fromCssColorString("#EEE8AA")),s.PALEGREEN=n(s.fromCssColorString("#98FB98")),s.PALETURQUOISE=n(s.fromCssColorString("#AFEEEE")),s.PALEVIOLETRED=n(s.fromCssColorString("#DB7093")),s.PAPAYAWHIP=n(s.fromCssColorString("#FFEFD5")),s.PEACHPUFF=n(s.fromCssColorString("#FFDAB9")),s.PERU=n(s.fromCssColorString("#CD853F")),s.PINK=n(s.fromCssColorString("#FFC0CB")),s.PLUM=n(s.fromCssColorString("#DDA0DD")),s.POWDERBLUE=n(s.fromCssColorString("#B0E0E6")),s.PURPLE=n(s.fromCssColorString("#800080")),s.RED=n(s.fromCssColorString("#FF0000")),s.ROSYBROWN=n(s.fromCssColorString("#BC8F8F")),s.ROYALBLUE=n(s.fromCssColorString("#4169E1")),s.SADDLEBROWN=n(s.fromCssColorString("#8B4513")),s.SALMON=n(s.fromCssColorString("#FA8072")),s.SANDYBROWN=n(s.fromCssColorString("#F4A460")),s.SEAGREEN=n(s.fromCssColorString("#2E8B57")),s.SEASHELL=n(s.fromCssColorString("#FFF5EE")),s.SIENNA=n(s.fromCssColorString("#A0522D")),s.SILVER=n(s.fromCssColorString("#C0C0C0")),s.SKYBLUE=n(s.fromCssColorString("#87CEEB")),s.SLATEBLUE=n(s.fromCssColorString("#6A5ACD")),s.SLATEGRAY=n(s.fromCssColorString("#708090")),s.SLATEGREY=s.SLATEGRAY,s.SNOW=n(s.fromCssColorString("#FFFAFA")),s.SPRINGGREEN=n(s.fromCssColorString("#00FF7F")),s.STEELBLUE=n(s.fromCssColorString("#4682B4")),s.TAN=n(s.fromCssColorString("#D2B48C")),s.TEAL=n(s.fromCssColorString("#008080")),s.THISTLE=n(s.fromCssColorString("#D8BFD8")),s.TOMATO=n(s.fromCssColorString("#FF6347")),s.TURQUOISE=n(s.fromCssColorString("#40E0D0")),s.VIOLET=n(s.fromCssColorString("#EE82EE")),s.WHEAT=n(s.fromCssColorString("#F5DEB3")),s.WHITE=n(s.fromCssColorString("#FFFFFF")),s.WHITESMOKE=n(s.fromCssColorString("#F5F5F5")),s.YELLOW=n(s.fromCssColorString("#FFFF00")),s.YELLOWGREEN=n(s.fromCssColorString("#9ACD32")),s.TRANSPARENT=n(new s(0,0,0,0)),s}),i("Core/ColorGeometryInstanceAttribute",["./Color","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,i,r,n,o){"use strict";function a(t,r,n,o){t=i(t,1),r=i(r,1),n=i(n,1),o=i(o,1),this.value=new Uint8Array([e.floatToByte(t),e.floatToByte(r),e.floatToByte(n),e.floatToByte(o)])}return n(a.prototype,{componentDatatype:{get:function(){return t.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}}),a.fromColor=function(e){return new a(e.red,e.green,e.blue,e.alpha)},a.toValue=function(e,t){return r(t)?e.toBytes(t):new Uint8Array(e.toBytes())},a.equals=function(e,t){return e===t||r(e)&&r(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]},a}),i("Core/combine",["./defaultValue","./defined"],function(e,t){"use strict";function i(r,n,o){o=e(o,!1);var a,s,l,u={},c=t(r),h=t(n);if(c)for(a in r)r.hasOwnProperty(a)&&(s=r[a],h&&o&&"object"==typeof s&&n.hasOwnProperty(a)?(l=n[a],"object"==typeof l?u[a]=i(s,l,o):u[a]=s):u[a]=s);if(h)for(a in n)n.hasOwnProperty(a)&&!u.hasOwnProperty(a)&&(l=n[a],u[a]=l);return u}return i}),i("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(t)}),i("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),i("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){var t=e._uSquared,i=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,n=(i-r)/i,o=Math.cos(e._startHeading),a=Math.sin(e._startHeading),s=(1-n)*Math.tan(e._start.latitude),l=1/Math.sqrt(1+s*s),u=l*s,c=Math.atan2(s,o),h=l*a,d=h*h,m=1-d,p=Math.sqrt(m),f=t/4,v=f*f,g=v*f,_=v*v,y=1+f-3*v/4+5*g/4-175*_/64,C=1-f+15*v/8-35*g/8,E=1-3*f+35*v/4,S=1-5*f,w=y*c-C*Math.sin(2*c)*f/2-E*Math.sin(4*c)*v/16-S*Math.sin(6*c)*g/48-5*Math.sin(8*c)*_/512,T=e._constants;T.a=i,T.b=r,T.f=n,T.cosineHeading=o,T.sineHeading=a,T.tanU=s,T.cosineU=l,T.sineU=u,T.sigma=c,T.sineAlpha=h,T.sineSquaredAlpha=d,T.cosineSquaredAlpha=m,T.cosineAlpha=p,T.u2Over4=f,T.u4Over16=v,T.u6Over64=g,T.u8Over256=_,T.a0=y,T.a1=C,T.a2=E,T.a3=S,T.distanceRatio=w}function u(e,t){return e*t*(4+e*(4-3*t))/16}function c(e,t,i,r,n,o,a){var s=u(e,i);return(1-s)*e*t*(r+s*n*(a+s*o*(2*a*a-1)))}function h(e,t,i,r,n,o,a){var l,u,h,d,m,p=(t-i)/t,f=o-r,v=Math.atan((1-p)*Math.tan(n)),g=Math.atan((1-p)*Math.tan(a)),_=Math.cos(v),y=Math.sin(v),C=Math.cos(g),E=Math.sin(g),S=_*C,w=_*E,T=y*E,x=y*C,b=f,A=s.TWO_PI,P=Math.cos(b),I=Math.sin(b);do{P=Math.cos(b),I=Math.sin(b);var M=w-x*P;h=Math.sqrt(C*C*I*I+M*M),u=T+S*P,l=Math.atan2(h,u);var D;0===h?(D=0,d=1):(D=S*I/h,d=1-D*D),A=b,m=u-2*T/d,isNaN(m)&&(m=0),b=f+c(p,D,d,l,h,u,m)}while(Math.abs(b-A)>s.EPSILON12);var R=d*(t*t-i*i)/(i*i),O=1+R*(4096+R*(R*(320-175*R)-768))/16384,N=R*(256+R*(R*(74-47*R)-128))/1024,L=m*m,F=N*h*(m+N*(u*(2*L-1)-N*m*(4*h*h-3)*(4*L-3)/6)/4),B=i*O*(l-F),V=Math.atan2(C*I,w-x*P),k=Math.atan2(_*I,w*P-x);e._distance=B,e._startHeading=V,e._endHeading=k,e._uSquared=R}function d(i,r,n,o){e.normalize(o.cartographicToCartesian(r,f),p),e.normalize(o.cartographicToCartesian(n,f),f);h(i,o.maximumRadius,o.minimumRadius,r.longitude,r.latitude,n.longitude,n.latitude),i._start=t.clone(r,i._start),i._end=t.clone(n,i._end),i._start.height=0,i._end.height=0,l(i)}function m(e,n,o){var s=i(o,a.WGS84);this._ellipsoid=s,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(n)&&d(this,e,n,s)}var p=new e,f=new e;return n(m.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),m.prototype.setEndPoints=function(e,t){d(this,e,t,this._ellipsoid)},m.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},m.prototype.interpolateUsingSurfaceDistance=function(e,i){var n=this._constants,o=n.distanceRatio+e/n.b,a=Math.cos(2*o),s=Math.cos(4*o),l=Math.cos(6*o),u=Math.sin(2*o),h=Math.sin(4*o),d=Math.sin(6*o),m=Math.sin(8*o),p=o*o,f=o*p,v=n.u8Over256,g=n.u2Over4,_=n.u6Over64,y=n.u4Over16,C=2*f*v*a/3+o*(1-g+7*y/4-15*_/4+579*v/64-(y-15*_/4+187*v/16)*a-(5*_/4-115*v/16)*s-29*v*l/16)+(g/2-y+71*_/32-85*v/16)*u+(5*y/16-5*_/4+383*v/96)*h-p*((_-11*v/2)*u+5*v*h/2)+(29*_/96-29*v/16)*d+539*v*m/1536,E=Math.asin(Math.sin(C)*n.cosineAlpha),S=Math.atan(n.a/n.b*Math.tan(E));C-=n.sigma;var w=Math.cos(2*n.sigma+C),T=Math.sin(C),x=Math.cos(C),b=n.cosineU*x,A=n.sineU*T,P=Math.atan2(T*n.sineHeading,b-A*n.cosineHeading),I=P-c(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,T,x,w);return r(i)?(i.longitude=this._start.longitude+I,i.latitude=S,i.height=0,i):new t(this._start.longitude+I,S,0)},m}),i("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(e,t,i){var r=T;r.length=e;var n;if(t===i){for(n=0;e>n;n++)r[n]=t;return r}var o=i-t,a=o/e;for(n=0;e>n;n++){var s=t+n*a;r[n]=s}return r}function m(t,i,r,n,o,a,s,l){var u=n.scaleToGeodeticSurface(t,P),c=n.scaleToGeodeticSurface(i,I),h=p.numberOfPoints(t,i,r),m=n.cartesianToCartographic(u,x),f=n.cartesianToCartographic(c,b),v=d(h,o,a);M.setEndPoints(m,f);var g=M.surfaceDistance/h,_=l;m.height=o;var y=n.cartographicToCartesian(m,A);e.pack(y,s,_),_+=3;for(var C=1;h>C;C++){var E=M.interpolateUsingSurfaceDistance(C*g,b);E.height=v[C],y=n.cartographicToCartesian(E,A),e.pack(y,s,_),_+=3}return _}var p={};p.numberOfPoints=function(t,i,r){var n=e.distance(t,i);return Math.ceil(n/r)};var f=new t;p.extractHeights=function(e,t){for(var i=e.length,r=new Array(i),n=0;i>n;n++){var o=e[n];r[n]=t.cartesianToCartographic(o,f).height}return r};var v=new c,g=new e,_=new e,y=new h(e.ZERO,0),C=new e,E=new h(e.ZERO,0),S=new e,w=new e,T=[],x=new t,b=new t,A=new e,P=new e,I=new e,M=new a;p.wrapLongitude=function(t,n){var o=[],a=[];if(r(t)&&t.length>0){n=i(n,c.IDENTITY);var l=c.inverseTransformation(n,v),u=c.multiplyByPoint(l,e.ZERO,g),d=c.multiplyByPointAsVector(l,e.UNIT_Y,_),m=h.fromPointNormal(u,d,y),p=c.multiplyByPointAsVector(l,e.UNIT_X,C),f=h.fromPointNormal(u,p,E),T=1;o.push(e.clone(t[0]));for(var x=o[0],b=t.length,A=1;b>A;++A){var P=t[A];if(h.getPointDistance(f,x)<0||h.getPointDistance(f,P)<0){var I=s.lineSegmentPlane(x,P,m,S);if(r(I)){var M=e.multiplyByScalar(d,5e-9,w);h.getPointDistance(m,x)<0&&e.negate(M,M),o.push(e.add(I,M,new e)),a.push(T+1),e.negate(M,M),o.push(e.add(I,M,new e)),T=1}}o.push(e.clone(t[A])),T++,x=P}a.push(T)}return{positions:o,lengths:a}};var D=u.EPSILON10;return p.removeDuplicates=function(t){var i=t.length;if(2>i)return t;var r,n,o;for(r=1;i>r&&(n=t[r-1],o=t[r],!e.equalsEpsilon(n,o,D));++r);if(r===i)return t;for(var a=t.slice(0,r);i>r;++r)o=t[r],e.equalsEpsilon(n,o,D)||(a.push(e.clone(o)),n=o);return a},p.generateArc=function(t){r(t)||(t={});var n=t.positions,a=n.length,s=i(t.ellipsoid,o.WGS84),c=i(t.height,0);if(1>a)return[];if(1===a){var h=s.scaleToGeodeticSurface(n[0],P);if(0!==c){var d=s.geodeticSurfaceNormal(h,A);e.multiplyByScalar(d,c,d),e.add(h,d,h)}return[h.x,h.y,h.z]}var f=t.minDistance;if(!r(f)){var v=i(t.granularity,u.RADIANS_PER_DEGREE);f=u.chordLength(v,s.maximumRadius)}var g,_=0;for(g=0;a-1>g;g++)_+=p.numberOfPoints(n[g],n[g+1],f);var y=3*(_+1),C=new Array(y),E=0,S=l(c);for(g=0;a-1>g;g++){var w=n[g],b=n[g+1],I=S?c[g]:c,M=S?c[g+1]:c;E=m(w,b,f,s,I,M,C,E)}T.length=0;var D=n[a-1],R=s.cartesianToCartographic(D,x);R.height=S?c[a-1]:c;var O=s.cartographicToCartesian(R,A);return e.pack(O,C,y-3),C},p.generateCartesianArc=function(t){for(var i=p.generateArc(t),r=i.length/3,n=new Array(r),o=0;r>o;o++)n[o]=e.unpack(i,3*o);return n},p}),i("Core/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(e,t){for(var i=new Array(e.length),r=0;r<e.length;r++){var n=e[r];O=t.cartesianToCartographic(n,O),i[r]=O.height,e[r]=t.scaleToGeodeticSurface(n,n)}return i}function m(e,i,r,n){var o,a=e[0],s=e[1],l=t.angleBetween(a,s),u=Math.ceil(l/n),c=new Array(u);if(i===r){for(o=0;u>o;o++)c[o]=i;return c.push(r),c}var h=r-i,d=h/u;for(o=1;u>o;o++){var m=i+o*d;c[o]=m}return c[0]=i,c.push(r),c}function p(i,r,n,a){var s=new o(n,a),l=s.projectPointOntoPlane(t.add(n,i,j),j),u=s.projectPointOntoPlane(t.add(n,r,Y),Y),c=e.angleBetween(l,u);return u.x*l.y-u.y*l.x>=0?-c:c}function f(e,i,r,n,o,a,u,c){var d=k,m=z;L=h.eastNorthUpToFixedFrame(e,o,L),d=l.multiplyByPointAsVector(L,N,d),d=t.normalize(d,d);var f=p(d,i,e,o);B=s.fromRotationZ(f,B),U.z=a,L=l.multiplyTransformation(L,l.fromRotationTranslation(B,U,F),L);var v=V;v[0]=u;for(var g=0;c>g;g++)for(var _=0;_<r.length;_+=3)m=t.fromArray(r,_,m),m=s.multiplyByVector(v,m,m),m=l.multiplyByPoint(L,m,m),n.push(m.x,m.y,m.z);return n}function v(e,i,r,n,o,a,s){for(var l=0;l<e.length;l+=3){var u=t.fromArray(e,l,G);n=f(u,i,r,n,o,a[l/3],s,1)}return n}function g(e,t){var i=e.length,r=new Array(6*i),n=0,o=t.x+t.width/2,a=t.y+t.height/2,s=e[0];r[n++]=s.x-o,r[n++]=0,r[n++]=s.y-a;for(var l=1;i>l;l++){s=e[l];var u=s.x-o,c=s.y-a;r[n++]=u,r[n++]=0,r[n++]=c,r[n++]=u,r[n++]=0,r[n++]=c}return s=e[0],r[n++]=s.x-o,r[n++]=0,r[n++]=s.y-a,r}function _(e,t){for(var i=e.length,r=new Array(3*i),n=0,o=t.x+t.width/2,a=t.y+t.height/2,s=0;i>s;s++)r[n++]=e[s].x-o,r[n++]=0,r[n++]=e[s].y-a;return r}function y(e,i,r,o,l,u,h,d,m,p){var v,g=t.angleBetween(t.subtract(i,e,M),t.subtract(r,e,D)),_=o===n.BEVELED?0:Math.ceil(g/a.toRadians(5));v=l?s.fromQuaternion(c.fromAxisAngle(t.negate(e,M),g/(_+1),W),q):s.fromQuaternion(c.fromAxisAngle(e,g/(_+1),W),q);var y,C;if(i=t.clone(i,H),_>0)for(var E=p?2:1,S=0;_>S;S++)i=s.multiplyByVector(v,i,i),y=t.subtract(i,e,M),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(i,D),h=f(C,y,d,h,u,m,1,E);else y=t.subtract(i,e,M),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(i,D),h=f(C,y,d,h,u,m,1,1),r=t.clone(r,H),y=t.subtract(r,e,M),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(r,D),h=f(C,y,d,h,u,m,1,1);return h}var C=[new t,new t],E=new t,S=new t,w=new t,T=new t,x=new t,b=new t,A=new t,P=new t,I=new t,M=new t,D=new t,R={},O=new r,N=new t(-1,0,0),L=new l,F=new l,B=new s,V=s.IDENTITY.clone(),k=new t,z=new i,U=new t,G=new t,W=new c,H=new t,q=new s;R.removeDuplicatesFromShape=function(t){for(var i=t.length,r=[],n=i-1,o=0;i>o;n=o++){var a=t[n],s=t[o];e.equals(a,s)||r.push(s)}return r};var j=new t,Y=new t;R.angleIsGreaterThanPi=function(e,i,r,n){var a=new o(r,n),s=a.projectPointOntoPlane(t.add(r,e,j),j),l=a.projectPointOntoPlane(t.add(r,i,Y),Y);return l.x*s.y-l.y*s.x>=0};var X=new t,Z=new t;return R.computePositions=function(e,i,r,o,s){var l=o._ellipsoid,c=d(e,l),h=o._granularity,p=o._cornerType,D=s?g(i,r):_(i,r),O=s?_(i,r):void 0,N=r.height/2,L=r.width/2,F=e.length,B=[],V=s?[]:void 0,k=E,z=S,U=w,G=T,W=x,H=b,q=A,j=P,Y=I,K=e[0],Q=e[1];G=l.geodeticSurfaceNormal(K,G),k=t.subtract(Q,K,k),k=t.normalize(k,k),j=t.cross(G,k,j),j=t.normalize(j,j);var J=c[0],$=c[1];s&&(V=f(K,j,O,V,l,J+N,1,1)),Y=t.clone(K,Y),K=Q,z=t.negate(k,z);for(var ee,te,ie=1;F-1>ie;ie++){var re=s?2:1;Q=e[ie+1],k=t.subtract(Q,K,k),k=t.normalize(k,k),U=t.add(k,z,U),U=t.normalize(U,U),G=l.geodeticSurfaceNormal(K,G);var ne=t.multiplyByScalar(G,t.dot(k,G),X);t.subtract(k,ne,ne),t.normalize(ne,ne);var oe=t.multiplyByScalar(G,t.dot(z,G),Z);t.subtract(z,oe,oe),t.normalize(oe,oe);var ae=!a.equalsEpsilon(Math.abs(t.dot(ne,oe)),1,a.EPSILON7);if(ae){U=t.cross(U,G,U),U=t.cross(G,U,U),U=t.normalize(U,U);var se=1/Math.max(.25,t.magnitude(t.cross(U,z,M))),le=R.angleIsGreaterThanPi(k,z,K,l);le?(W=t.add(K,t.multiplyByScalar(U,se*L,U),W),H=t.add(W,t.multiplyByScalar(j,L,H),H),C[0]=t.clone(Y,C[0]),C[1]=t.clone(H,C[1]),ee=m(C,J+N,$+N,h),te=u.generateArc({positions:C,granularity:h,ellipsoid:l}),B=v(te,j,D,B,l,ee,1),j=t.cross(G,k,j),j=t.normalize(j,j),q=t.add(W,t.multiplyByScalar(j,L,q),q),p===n.ROUNDED||p===n.BEVELED?y(W,H,q,p,le,l,B,D,$+N,s):(U=t.negate(U,U),B=f(K,U,D,B,l,$+N,se,re)),Y=t.clone(q,Y)):(W=t.add(K,t.multiplyByScalar(U,se*L,U),W),H=t.add(W,t.multiplyByScalar(j,-L,H),H),C[0]=t.clone(Y,C[0]),C[1]=t.clone(H,C[1]),ee=m(C,J+N,$+N,h),te=u.generateArc({positions:C,granularity:h,ellipsoid:l}),B=v(te,j,D,B,l,ee,1),j=t.cross(G,k,j),j=t.normalize(j,j),q=t.add(W,t.multiplyByScalar(j,-L,q),q),p===n.ROUNDED||p===n.BEVELED?y(W,H,q,p,le,l,B,D,$+N,s):B=f(K,U,D,B,l,$+N,se,re),Y=t.clone(q,Y)),z=t.negate(k,z)}else B=f(Y,j,D,B,l,J+N,1,1),Y=K;J=$,$=c[ie+1],K=Q}C[0]=t.clone(Y,C[0]),C[1]=t.clone(K,C[1]),ee=m(C,J+N,$+N,h),te=u.generateArc({positions:C,granularity:h,ellipsoid:l}),B=v(te,j,D,B,l,ee,1),s&&(V=f(K,j,O,V,l,$+N,1,1)),F=B.length;var ue=s?F+V.length:F,ce=new Float64Array(ue);return ce.set(B),s&&ce.set(V,F),ce},R}),i("Core/CorridorGeometryLibrary",["./Cartesian3","./CornerType","./defined","./isArray","./Math","./Matrix3","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./Quaternion"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(i,r,a,s,u){var c=e.angleBetween(e.subtract(r,i,f),e.subtract(a,i,v)),h=s===t.BEVELED?1:Math.ceil(c/n.toRadians(5))+1,d=3*h,m=new Array(d);m[d-3]=a.x,m[d-2]=a.y,m[d-1]=a.z;var p;p=u?o.fromQuaternion(l.fromAxisAngle(e.negate(i,f),c/h,M),D):o.fromQuaternion(l.fromAxisAngle(i,c/h,M),D);var g=0;r=e.clone(r,f);for(var _=0;h>_;_++)r=o.multiplyByVector(p,r,r),m[g++]=r.x,m[g++]=r.y,m[g++]=r.z;return m}function c(i){var r=C,n=E,o=S,a=i[1];n=e.fromArray(i[1],a.length-3,n),o=e.fromArray(i[0],0,o),r=e.multiplyByScalar(e.add(n,o,r),.5,r);var s=u(r,n,o,t.ROUNDED,!1),l=i.length-1,c=i[l-1];a=i[l],n=e.fromArray(c,c.length-3,n),o=e.fromArray(a,0,o),r=e.multiplyByScalar(e.add(n,o,r),.5,r);var h=u(r,n,o,t.ROUNDED,!1);return[s,h]}function h(t,i,r,n){var o=f;return n?o=e.add(t,i,o):(i=e.negate(i,i),o=e.add(t,i,o)),[o.x,o.y,o.z,r.x,r.y,r.z]}function d(t,i,r,n){for(var o=new Array(t.length),a=new Array(t.length),s=e.multiplyByScalar(i,r,f),l=e.negate(s,v),u=0,c=t.length-1,h=0;h<t.length;h+=3){var d=e.fromArray(t,h,g),m=e.add(d,l,_);o[u++]=m.x,o[u++]=m.y,o[u++]=m.z;var p=e.add(d,s,_);a[c--]=p.z,a[c--]=p.y,a[c--]=p.x}return n.push(o,a),n}function m(e,t){for(var i=0;i<e.length;i++)e[i]=t.scaleToGeodeticSurface(e[i],e[i]);return e}var p={},f=new e,v=new e,g=new e,_=new e,y=[new e,new e],C=new e,E=new e,S=new e,w=new e,T=new e,x=new e,b=new e,A=new e,P=new e,I=new e,M=new l,D=new o;p.addAttribute=function(e,t,r,n){var o=t.x,a=t.y,s=t.z;i(r)&&(e[r]=o,e[r+1]=a,e[r+2]=s),i(n)&&(e[n]=s,e[n-1]=a,e[n-2]=o)};var R=new e,O=new e;p.computePositions=function(i){var r=i.granularity,o=i.positions,l=i.ellipsoid;o=m(o,l);var p=i.width/2,v=i.cornerType,g=i.saveAttributes,_=C,M=E,D=S,N=w,L=T,F=x,B=b,V=A,k=P,z=I,U=[],G=g?[]:void 0,W=g?[]:void 0,H=o[0],q=o[1];M=e.normalize(e.subtract(q,H,M),M),_=l.geodeticSurfaceNormal(H,_),N=e.normalize(e.cross(_,M,N),N),g&&(G.push(N.x,N.y,N.z),W.push(_.x,_.y,_.z)),B=e.clone(H,B),H=q,D=e.negate(M,D);var j,Y,X=[],Z=o.length;for(Y=1;Z-1>Y;Y++){_=l.geodeticSurfaceNormal(H,_),q=o[Y+1],M=e.normalize(e.subtract(q,H,M),M),L=e.normalize(e.add(M,D,L),L);var K=e.multiplyByScalar(_,e.dot(M,_),R);e.subtract(M,K,K),e.normalize(K,K);var Q=e.multiplyByScalar(_,e.dot(D,_),O);e.subtract(D,Q,Q),e.normalize(Q,Q);var J=!n.equalsEpsilon(Math.abs(e.dot(K,Q)),1,n.EPSILON7);if(J){L=e.cross(L,_,L),L=e.cross(_,L,L),L=e.normalize(L,L);var $=p/Math.max(.25,e.magnitude(e.cross(L,D,f))),ee=s.angleIsGreaterThanPi(M,D,H,l);L=e.multiplyByScalar(L,$,L),ee?(V=e.add(H,L,V),z=e.add(V,e.multiplyByScalar(N,p,z),z),k=e.add(V,e.multiplyByScalar(N,2*p,k),k),y[0]=e.clone(B,y[0]),y[1]=e.clone(z,y[1]),j=a.generateArc({positions:y,granularity:r,ellipsoid:l}),U=d(j,N,p,U),g&&(G.push(N.x,N.y,N.z),W.push(_.x,_.y,_.z)),F=e.clone(k,F),N=e.normalize(e.cross(_,M,N),N),k=e.add(V,e.multiplyByScalar(N,2*p,k),k),B=e.add(V,e.multiplyByScalar(N,p,B),B),v===t.ROUNDED||v===t.BEVELED?X.push({leftPositions:u(V,F,k,v,ee)}):X.push({leftPositions:h(H,e.negate(L,L),k,ee)})):(k=e.add(H,L,k),z=e.add(k,e.negate(e.multiplyByScalar(N,p,z),z),z),V=e.add(k,e.negate(e.multiplyByScalar(N,2*p,V),V),V),y[0]=e.clone(B,y[0]),y[1]=e.clone(z,y[1]),j=a.generateArc({positions:y,granularity:r,ellipsoid:l}),U=d(j,N,p,U),g&&(G.push(N.x,N.y,N.z),W.push(_.x,_.y,_.z)),F=e.clone(V,F),N=e.normalize(e.cross(_,M,N),N),V=e.add(k,e.negate(e.multiplyByScalar(N,2*p,V),V),V),B=e.add(k,e.negate(e.multiplyByScalar(N,p,B),B),B),v===t.ROUNDED||v===t.BEVELED?X.push({rightPositions:u(k,F,V,v,ee)}):X.push({rightPositions:h(H,L,V,ee)})),D=e.negate(M,D)}H=q}_=l.geodeticSurfaceNormal(H,_),y[0]=e.clone(B,y[0]),y[1]=e.clone(H,y[1]),j=a.generateArc({positions:y,granularity:r,ellipsoid:l}),U=d(j,N,p,U),g&&(G.push(N.x,N.y,N.z),W.push(_.x,_.y,_.z));var te;return v===t.ROUNDED&&(te=c(U)),{positions:U,corners:X,lefts:G,normals:W,endPositions:te}};var N=new e,L=new e;return p.scaleToGeodeticHeight=function(t,i,n,o){var a=t.length,s=r(o)?o:new Array(t.length);s.length=t.length;for(var l=i,u=0;a>u;u+=3){var c=n.scaleToGeodeticSurface(e.fromArray(t,u,L),L),h=N;0!==i&&(h=n.geodeticSurfaceNormal(c,h),h=e.multiplyByScalar(h,l,h),c=e.add(c,h,c)),s[u]=c.x,s[u+1]=c.y,s[u+2]=c.z}return s},p}),i("Core/CorridorGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v){"use strict";function g(e,i,r,o,a,s){var l=e.normals,u=e.tangents,c=e.binormals,h=t.normalize(t.cross(r,i,I),I);s.normal&&n.addAttribute(l,i,o,a),s.binormal&&n.addAttribute(c,r,o,a),s.tangent&&n.addAttribute(u,h,o,a)}function _(e,r,o){var s,l,u,p=e.positions,f=e.corners,v=e.endPositions,_=e.lefts,y=e.normals,C=new h,E=0,S=0,A=0;for(l=0;l<p.length;l+=2)u=p[l].length-3,E+=u,A+=2*u,S+=p[l+1].length-3;for(E+=3,S+=3,l=0;l<f.length;l++){s=f[l];var D=f[l].leftPositions;a(D)?(u=D.length,E+=u,A+=u):(u=f[l].rightPositions.length,S+=u,A+=u)}var R,O=a(v);O&&(R=v[0].length-3,E+=R,S+=R,R/=3,A+=6*R);var N,L,F,B,V,k,z=E+S,U=new Float64Array(z),G=r.normal?new Float32Array(z):void 0,W=r.tangent?new Float32Array(z):void 0,H=r.binormal?new Float32Array(z):void 0,q={normals:G,tangents:W,binormals:H},j=0,Y=z-1,X=w,Z=T,K=R/2,Q=d.createTypedArray(z/3,A),J=0;if(O){k=x,V=b;var $=v[0];for(X=t.fromArray(y,0,X),Z=t.fromArray(_,0,Z),l=0;K>l;l++)k=t.fromArray($,3*(K-1-l),k),V=t.fromArray($,3*(K+l),V),n.addAttribute(U,V,j),n.addAttribute(U,k,void 0,Y),g(q,X,Z,j,Y,r),L=j/3,B=L+1,N=(Y-2)/3,F=N-1,Q[J++]=N,Q[J++]=L,Q[J++]=F,Q[J++]=F,Q[J++]=L,Q[J++]=B,j+=3,Y-=3}var ee=0,te=0,ie=p[ee++],re=p[ee++];U.set(ie,j),U.set(re,Y-re.length+1),Z=t.fromArray(_,te,Z);var ne,oe;for(u=re.length-3,l=0;u>l;l+=3)ne=o.geodeticSurfaceNormal(t.fromArray(ie,l,I),I),oe=o.geodeticSurfaceNormal(t.fromArray(re,u-l,M),M),X=t.normalize(t.add(ne,oe,X),X),g(q,X,Z,j,Y,r),L=j/3,B=L+1,N=(Y-2)/3,F=N-1,Q[J++]=N,Q[J++]=L,Q[J++]=F,Q[J++]=F,Q[J++]=L,Q[J++]=B,j+=3,Y-=3;for(ne=o.geodeticSurfaceNormal(t.fromArray(ie,u,I),I),oe=o.geodeticSurfaceNormal(t.fromArray(re,u,M),M),X=t.normalize(t.add(ne,oe,X),X),te+=3,l=0;l<f.length;l++){var ae;s=f[l];var se,le,ue=s.leftPositions,ce=s.rightPositions,he=P,de=x,me=b;if(X=t.fromArray(y,te,X),a(ue)){for(g(q,X,Z,void 0,Y,r),Y-=3,se=B,le=F,ae=0;ae<ue.length/3;ae++)he=t.fromArray(ue,3*ae,he),Q[J++]=se,Q[J++]=le-ae-1,Q[J++]=le-ae,n.addAttribute(U,he,void 0,Y),de=t.fromArray(U,3*(le-ae-1),de),me=t.fromArray(U,3*se,me),Z=t.normalize(t.subtract(de,me,Z),Z),g(q,X,Z,void 0,Y,r),Y-=3;he=t.fromArray(U,3*se,he),de=t.subtract(t.fromArray(U,3*le,de),he,de),me=t.subtract(t.fromArray(U,3*(le-ae),me),he,me),Z=t.normalize(t.add(de,me,Z),Z),g(q,X,Z,j,void 0,r),j+=3}else{for(g(q,X,Z,j,void 0,r),j+=3,se=F,le=B,ae=0;ae<ce.length/3;ae++)he=t.fromArray(ce,3*ae,he),Q[J++]=se,Q[J++]=le+ae,Q[J++]=le+ae+1,n.addAttribute(U,he,j),de=t.fromArray(U,3*se,de),me=t.fromArray(U,3*(le+ae),me),Z=t.normalize(t.subtract(de,me,Z),Z),g(q,X,Z,j,void 0,r),j+=3;he=t.fromArray(U,3*se,he),de=t.subtract(t.fromArray(U,3*(le+ae),de),he,de),me=t.subtract(t.fromArray(U,3*le,me),he,me),Z=t.normalize(t.negate(t.add(me,de,Z),Z),Z),g(q,X,Z,void 0,Y,r),Y-=3}for(ie=p[ee++],re=p[ee++],ie.splice(0,3),re.splice(re.length-3,3),U.set(ie,j),U.set(re,Y-re.length+1),u=re.length-3,te+=3,Z=t.fromArray(_,te,Z), +ae=0;ae<re.length;ae+=3)ne=o.geodeticSurfaceNormal(t.fromArray(ie,ae,I),I),oe=o.geodeticSurfaceNormal(t.fromArray(re,u-ae,M),M),X=t.normalize(t.add(ne,oe,X),X),g(q,X,Z,j,Y,r),B=j/3,L=B-1,F=(Y-2)/3,N=F+1,Q[J++]=N,Q[J++]=L,Q[J++]=F,Q[J++]=F,Q[J++]=L,Q[J++]=B,j+=3,Y-=3;j-=3,Y+=3}if(X=t.fromArray(y,y.length-3,X),g(q,X,Z,j,Y,r),O){j+=3,Y-=3,k=x,V=b;var pe=v[1];for(l=0;K>l;l++)k=t.fromArray(pe,3*(R-l-1),k),V=t.fromArray(pe,3*l,V),n.addAttribute(U,k,void 0,Y),n.addAttribute(U,V,j),g(q,X,Z,j,Y,r),B=j/3,L=B-1,F=(Y-2)/3,N=F+1,Q[J++]=N,Q[J++]=L,Q[J++]=F,Q[J++]=F,Q[J++]=L,Q[J++]=B,j+=3,Y-=3}if(C.position=new c({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:U}),r.st){var fe,ve,ge=new Float32Array(z/3*2),_e=0;if(O){E/=3,S/=3;var ye=Math.PI/(R+1);ve=1/(E-R+1),fe=1/(S-R+1);var Ce,Ee=R/2;for(l=Ee+1;R+1>l;l++)Ce=m.PI_OVER_TWO+ye*l,ge[_e++]=fe*(1+Math.cos(Ce)),ge[_e++]=.5*(1+Math.sin(Ce));for(l=1;S-R+1>l;l++)ge[_e++]=l*fe,ge[_e++]=0;for(l=R;l>Ee;l--)Ce=m.PI_OVER_TWO-l*ye,ge[_e++]=1-fe*(1+Math.cos(Ce)),ge[_e++]=.5*(1+Math.sin(Ce));for(l=Ee;l>0;l--)Ce=m.PI_OVER_TWO-ye*l,ge[_e++]=1-ve*(1+Math.cos(Ce)),ge[_e++]=.5*(1+Math.sin(Ce));for(l=E-R;l>0;l--)ge[_e++]=l*ve,ge[_e++]=1;for(l=1;Ee+1>l;l++)Ce=m.PI_OVER_TWO+ye*l,ge[_e++]=ve*(1+Math.cos(Ce)),ge[_e++]=.5*(1+Math.sin(Ce))}else{for(E/=3,S/=3,ve=1/(E-1),fe=1/(S-1),l=0;S>l;l++)ge[_e++]=l*fe,ge[_e++]=0;for(l=E;l>0;l--)ge[_e++]=(l-1)*ve,ge[_e++]=1}C.st=new c({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:ge})}return r.normal&&(C.normal=new c({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:q.normals})),r.tangent&&(C.tangent=new c({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:q.tangents})),r.binormal&&(C.binormal=new c({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:q.binormals})),{attributes:C,indices:Q}}function y(e,i){if(!(i.normal||i.binormal||i.tangent||i.st))return e;var r,o,a=e.position.values;(i.normal||i.binormal)&&(r=e.normal.values,o=e.binormal.values);var s,l=e.position.values.length/18,u=3*l,c=2*l,h=2*u;if(i.normal||i.binormal||i.tangent){var d=i.normal?new Float32Array(6*u):void 0,m=i.binormal?new Float32Array(6*u):void 0,p=i.tangent?new Float32Array(6*u):void 0,f=w,v=T,g=x,_=b,y=A,C=P,E=h;for(s=0;u>s;s+=3){var S=E+h;f=t.fromArray(a,s,f),v=t.fromArray(a,s+u,v),g=t.fromArray(a,(s+3)%u,g),v=t.subtract(v,f,v),g=t.subtract(g,f,g),_=t.normalize(t.cross(v,g,_),_),i.normal&&(n.addAttribute(d,_,S),n.addAttribute(d,_,S+3),n.addAttribute(d,_,E),n.addAttribute(d,_,E+3)),(i.tangent||i.binormal)&&(C=t.fromArray(r,s,C),i.binormal&&(n.addAttribute(m,C,S),n.addAttribute(m,C,S+3),n.addAttribute(m,C,E),n.addAttribute(m,C,E+3)),i.tangent&&(y=t.normalize(t.cross(C,_,y),y),n.addAttribute(p,y,S),n.addAttribute(p,y,S+3),n.addAttribute(p,y,E),n.addAttribute(p,y,E+3))),E+=6}if(i.normal){for(d.set(r),s=0;u>s;s+=3)d[s+u]=-r[s],d[s+u+1]=-r[s+1],d[s+u+2]=-r[s+2];e.normal.values=d}else e.normal=void 0;if(i.binormal?(m.set(o),m.set(o,u),e.binormal.values=m):e.binormal=void 0,i.tangent){var I=e.tangent.values;p.set(I),p.set(I,u),e.tangent.values=p}}if(i.st){var M=e.st.values,D=new Float32Array(6*c);D.set(M),D.set(M,c);for(var R=2*c,O=0;2>O;O++){for(D[R++]=M[0],D[R++]=M[1],s=2;c>s;s+=2){var N=M[s],L=M[s+1];D[R++]=N,D[R++]=L,D[R++]=N,D[R++]=L}D[R++]=M[0],D[R++]=M[1]}e.st.values=D}return e}function C(e,t,i){i[t++]=e[0],i[t++]=e[1],i[t++]=e[2];for(var r=3;r<e.length;r+=3){var n=e[r],o=e[r+1],a=e[r+2];i[t++]=n,i[t++]=o,i[t++]=a,i[t++]=n,i[t++]=o,i[t++]=a}return i[t++]=e[0],i[t++]=e[1],i[t++]=e[2],i}function E(e,t){var i=new v({position:t.positon,normal:t.normal||t.binormal,tangent:t.tangent,binormal:t.normal||t.binormal,st:t.st}),r=e.ellipsoid,o=n.computePositions(e),a=_(o,i,r),s=e.height,l=e.extrudedHeight,u=a.attributes,c=a.indices,h=u.position.values,m=h.length,p=new Float64Array(6*m),f=new Float64Array(m);f.set(h);var g=new Float64Array(4*m);h=n.scaleToGeodeticHeight(h,s,r,h),g=C(h,0,g),f=n.scaleToGeodeticHeight(f,l,r,f),g=C(f,2*m,g),p.set(h),p.set(f,m),p.set(g,2*m),u.position.values=p,m/=3;var E,S=c.length,w=m+m,T=d.createTypedArray(p.length/3,2*S+3*w);T.set(c);var x=S;for(E=0;S>E;E+=3){var b=c[E],A=c[E+1],P=c[E+2];T[x++]=P+m,T[x++]=A+m,T[x++]=b+m}u=y(u,t);var I,M,D,R;for(E=0;w>E;E+=2)I=E+w,M=I+w,D=I+1,R=M+1,T[x++]=I,T[x++]=M,T[x++]=D,T[x++]=D,T[x++]=M,T[x++]=R;return{attributes:u,indices:T}}function S(e){e=o(e,o.EMPTY_OBJECT);var i=e.positions,n=e.width;this._positions=i,this._ellipsoid=l.clone(o(e.ellipsoid,l.WGS84)),this._vertexFormat=v.clone(o(e.vertexFormat,v.DEFAULT)),this._width=n,this._height=o(e.height,0),this._extrudedHeight=o(e.extrudedHeight,this._height),this._cornerType=o(e.cornerType,r.ROUNDED),this._granularity=o(e.granularity,m.RADIANS_PER_DEGREE),this._workerName="createCorridorGeometry",this.packedLength=1+i.length*t.packedLength+l.packedLength+v.packedLength+5}var w=new t,T=new t,x=new t,b=new t,A=new t,P=new t,I=new t,M=new t;S.pack=function(e,i,r){r=o(r,0);var n=e._positions,a=n.length;i[r++]=a;for(var s=0;a>s;++s,r+=t.packedLength)t.pack(n[s],i,r);l.pack(e._ellipsoid,i,r),r+=l.packedLength,v.pack(e._vertexFormat,i,r),r+=v.packedLength,i[r++]=e._width,i[r++]=e._height,i[r++]=e._extrudedHeight,i[r++]=e._cornerType,i[r]=e._granularity};var D=l.clone(l.UNIT_SPHERE),R=new v,O={positions:void 0,ellipsoid:D,vertexFormat:R,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0};return S.unpack=function(e,i,r){i=o(i,0);for(var n=e[i++],s=new Array(n),u=0;n>u;++u,i+=t.packedLength)s[u]=t.unpack(e,i);var c=l.unpack(e,i,D);i+=l.packedLength;var h=v.unpack(e,i,R);i+=v.packedLength;var d=e[i++],m=e[i++],p=e[i++],f=e[i++],g=e[i];return a(r)?(r._positions=s,r._ellipsoid=l.clone(c,r._ellipsoid),r._vertexFormat=v.clone(h,r._vertexFormat),r._width=d,r._height=m,r._extrudedHeight=p,r._cornerType=f,r._granularity=g,r):(O.positions=s,O.width=d,O.height=m,O.extrudedHeight=p,O.cornerType=f,O.granularity=g,new S(O))},S.createGeometry=function(t){var i=t._positions,r=t._height,o=t._extrudedHeight,a=r!==o,s=p.removeDuplicates(i);if(!(s.length<2)){var l,c=t._ellipsoid,h=t._vertexFormat,d={ellipsoid:c,positions:s,width:t._width,cornerType:t._cornerType,granularity:t._granularity,saveAttributes:!0};if(a){var m=Math.max(r,o);o=Math.min(r,o),r=m,d.height=r,d.extrudedHeight=o,l=E(d,h)}else{var v=n.computePositions(d);l=_(v,h,c),l.attributes.position.values=n.scaleToGeodeticHeight(l.attributes.position.values,r,c,l.attributes.position.values)}var g=l.attributes,y=e.fromVertices(g.position.values,void 0,3);return h.position||(l.attributes.position.values=void 0),new u({attributes:g,indices:l.indices,primitiveType:f.TRIANGLES,boundingSphere:y})}},S.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new S({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:n,granularity:r,extrudedHeight:o,height:a,vertexFormat:v.POSITION_ONLY})},S}),i("Core/CorridorOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f){"use strict";function v(e,o){var s,l,u,m=[],p=e.positions,f=e.corners,v=e.endPositions,g=new h,_=0,S=0,w=0;for(l=0;l<p.length;l+=2)u=p[l].length-3,_+=u,w+=u/3*4,S+=p[l+1].length-3;for(_+=3,S+=3,l=0;l<f.length;l++){s=f[l];var T=f[l].leftPositions;a(T)?(u=T.length,_+=u,w+=u/3*2):(u=f[l].rightPositions.length,S+=u,w+=u/3*2)}var x,b=a(v);b&&(x=v[0].length-3,_+=x,S+=x,x/=3,w+=4*x);var A,P,I,M,D,R,O=_+S,N=new Float64Array(O),L=0,F=O-1,B=x/2,V=d.createTypedArray(O/3,w+4),k=0;if(V[k++]=L/3,V[k++]=(F-2)/3,b){m.push(L/3),R=y,D=C;var z=v[0];for(l=0;B>l;l++)R=t.fromArray(z,3*(B-1-l),R),D=t.fromArray(z,3*(B+l),D),n.addAttribute(N,D,L),n.addAttribute(N,R,void 0,F),P=L/3,M=P+1,A=(F-2)/3,I=A-1,V[k++]=A,V[k++]=I,V[k++]=P,V[k++]=M,L+=3,F-=3}var U=0,G=p[U++],W=p[U++];for(N.set(G,L),N.set(W,F-W.length+1),u=W.length-3,m.push(L/3,(F-2)/3),l=0;u>l;l+=3)P=L/3,M=P+1,A=(F-2)/3,I=A-1,V[k++]=A,V[k++]=I,V[k++]=P,V[k++]=M,L+=3,F-=3;for(l=0;l<f.length;l++){var H;s=f[l];var q,j=s.leftPositions,Y=s.rightPositions,X=E;if(a(j)){for(F-=3,q=I,m.push(M),H=0;H<j.length/3;H++)X=t.fromArray(j,3*H,X),V[k++]=q-H-1,V[k++]=q-H,n.addAttribute(N,X,void 0,F),F-=3;m.push(q-Math.floor(j.length/6)),o===r.BEVELED&&m.push((F-2)/3+1),L+=3}else{for(L+=3,q=M,m.push(I),H=0;H<Y.length/3;H++)X=t.fromArray(Y,3*H,X),V[k++]=q+H,V[k++]=q+H+1,n.addAttribute(N,X,L),L+=3;m.push(q+Math.floor(Y.length/6)),o===r.BEVELED&&m.push(L/3-1),F-=3}for(G=p[U++],W=p[U++],G.splice(0,3),W.splice(W.length-3,3),N.set(G,L),N.set(W,F-W.length+1),u=W.length-3,H=0;H<W.length;H+=3)M=L/3,P=M-1,I=(F-2)/3,A=I+1,V[k++]=A,V[k++]=I,V[k++]=P,V[k++]=M,L+=3,F-=3;L-=3,F+=3,m.push(L/3,(F-2)/3)}if(b){L+=3,F-=3,R=y,D=C;var Z=v[1];for(l=0;B>l;l++)R=t.fromArray(Z,3*(x-l-1),R),D=t.fromArray(Z,3*l,D),n.addAttribute(N,R,void 0,F),n.addAttribute(N,D,L),M=L/3,P=M-1,I=(F-2)/3,A=I+1,V[k++]=A,V[k++]=I,V[k++]=P,V[k++]=M,L+=3,F-=3;m.push(L/3)}else m.push(L/3,(F-2)/3);return V[k++]=L/3,V[k++]=(F-2)/3,g.position=new c({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:N}),{attributes:g,indices:V,wallIndices:m}}function g(e){var t=e.ellipsoid,i=n.computePositions(e),r=v(i,e.cornerType),o=r.wallIndices,a=e.height,s=e.extrudedHeight,l=r.attributes,u=r.indices,c=l.position.values,h=c.length,m=new Float64Array(h);m.set(c);var p=new Float64Array(2*h);c=n.scaleToGeodeticHeight(c,a,t,c),m=n.scaleToGeodeticHeight(m,s,t,m),p.set(c),p.set(m,h),l.position.values=p,h/=3;var f,g=u.length,_=d.createTypedArray(p.length/3,2*(g+o.length));_.set(u);var y=g;for(f=0;g>f;f+=2){var C=u[f],E=u[f+1];_[y++]=C+h,_[y++]=E+h}var S,w;for(f=0;f<o.length;f++)S=o[f],w=S+h,_[y++]=S,_[y++]=w;return{attributes:l,indices:_}}function _(e){e=o(e,o.EMPTY_OBJECT);var i=e.positions,n=e.width;this._positions=i,this._ellipsoid=l.clone(o(e.ellipsoid,l.WGS84)),this._width=n,this._height=o(e.height,0),this._extrudedHeight=o(e.extrudedHeight,this._height),this._cornerType=o(e.cornerType,r.ROUNDED),this._granularity=o(e.granularity,m.RADIANS_PER_DEGREE),this._workerName="createCorridorOutlineGeometry",this.packedLength=1+i.length*t.packedLength+l.packedLength+5}var y=new t,C=new t,E=new t;_.pack=function(e,i,r){r=o(r,0);var n=e._positions,a=n.length;i[r++]=a;for(var s=0;a>s;++s,r+=t.packedLength)t.pack(n[s],i,r);l.pack(e._ellipsoid,i,r),r+=l.packedLength,i[r++]=e._width,i[r++]=e._height,i[r++]=e._extrudedHeight,i[r++]=e._cornerType,i[r]=e._granularity};var S=l.clone(l.UNIT_SPHERE),w={positions:void 0,ellipsoid:S,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0};return _.unpack=function(e,i,r){i=o(i,0);for(var n=e[i++],s=new Array(n),u=0;n>u;++u,i+=t.packedLength)s[u]=t.unpack(e,i);var c=l.unpack(e,i,S);i+=l.packedLength;var h=e[i++],d=e[i++],m=e[i++],p=e[i++],f=e[i];return a(r)?(r._positions=s,r._ellipsoid=l.clone(c,r._ellipsoid),r._width=h,r._height=d,r._extrudedHeight=m,r._cornerType=p,r._granularity=f,r):(w.positions=s,w.width=h,w.height=d,w.extrudedHeight=m,w.cornerType=p,w.granularity=f,new _(w))},_.createGeometry=function(t){var i=t._positions,r=t._height,o=t._extrudedHeight,a=r!==o,s=p.removeDuplicates(i);if(!(s.length<2)){var l,c=t._ellipsoid,h={ellipsoid:c,positions:s,width:t._width,cornerType:t._cornerType,granularity:t._granularity,saveAttributes:!1};if(a){var d=Math.max(r,o);o=Math.min(r,o),r=d,h.height=r,h.extrudedHeight=o,l=g(h)}else{var m=n.computePositions(h);l=v(m,h.cornerType),l.attributes.position.values=n.scaleToGeodeticHeight(l.attributes.position.values,r,c,l.attributes.position.values)}var _=l.attributes,y=e.fromVertices(_.position.values,void 0,3);return new u({attributes:_,indices:l.indices,primitiveType:f.LINES,boundingSphere:y})}},_}),i("Core/createGuid",[],function(){"use strict";function e(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,i="x"===e?t:3&t|8;return i.toString(16)})}return e}),i("Core/CylinderGeometryLibrary",["./Math"],function(e){"use strict";var t={};return t.computePositions=function(t,i,r,n,o){var a,s=.5*t,l=-s,u=n+n,c=o?2*u:u,h=new Float64Array(3*c),d=0,m=0,p=o?3*u:0,f=o?3*(u+n):3*n;for(a=0;n>a;a++){var v=a/n*e.TWO_PI,g=Math.cos(v),_=Math.sin(v),y=g*r,C=_*r,E=g*i,S=_*i;h[m+p]=y,h[m+p+1]=C,h[m+p+2]=l,h[m+f]=E,h[m+f+1]=S,h[m+f+2]=s,m+=3,o&&(h[d++]=y,h[d++]=C,h[d++]=l,h[d++]=E,h[d++]=S,h[d++]=s)}return h},t}),i("Core/CylinderGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(e){e=o(e,o.EMPTY_OBJECT);var t=e.length,i=e.topRadius,r=e.bottomRadius,n=o(e.vertexFormat,p.DEFAULT),a=o(e.slices,128);this._length=t,this._topRadius=i,this._bottomRadius=r,this._vertexFormat=p.clone(n),this._slices=a,this._workerName="createCylinderGeometry"}var v=new t,g=new i,_=new i,y=new i,C=new i;f.packedLength=p.packedLength+4,f.pack=function(e,t,i){i=o(i,0),p.pack(e._vertexFormat,t,i),i+=p.packedLength,t[i++]=e._length,t[i++]=e._topRadius,t[i++]=e._bottomRadius,t[i]=e._slices};var E=new p,S={vertexFormat:E,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0};return f.unpack=function(e,t,i){t=o(t,0);var r=p.unpack(e,t,E);t+=p.packedLength;var n=e[t++],s=e[t++],l=e[t++],u=e[t];return a(i)?(i._vertexFormat=p.clone(r,i._vertexFormat),i._length=n,i._topRadius=s,i._bottomRadius=l,i._slices=u,i):(S.length=n,S.topRadius=s,S.bottomRadius=l,S.slices=u,new f(S))},f.createGeometry=function(o){var a,s=o._length,p=o._topRadius,f=o._bottomRadius,E=o._vertexFormat,S=o._slices,w=S+S,T=S+w,x=w+w,b=n.computePositions(s,p,f,S,!0),A=E.st?new Float32Array(2*x):void 0,P=E.normal?new Float32Array(3*x):void 0,I=E.tangent?new Float32Array(3*x):void 0,M=E.binormal?new Float32Array(3*x):void 0,D=E.normal||E.tangent||E.binormal;if(D){var R=E.tangent||E.binormal,O=0,N=0,L=0,F=g;F.z=0;var B=y,V=_;for(a=0;S>a;a++){var k=a/S*d.TWO_PI,z=Math.cos(k),U=Math.sin(k);D&&(F.x=z,F.y=U,R&&(B=i.normalize(i.cross(i.UNIT_Z,F,B),B)),E.normal&&(P[O++]=z,P[O++]=U,P[O++]=0,P[O++]=z,P[O++]=U,P[O++]=0),E.tangent&&(I[N++]=B.x,I[N++]=B.y,I[N++]=B.z,I[N++]=B.x,I[N++]=B.y,I[N++]=B.z),E.binormal&&(V=i.normalize(i.cross(F,B,V),V),M[L++]=V.x,M[L++]=V.y,M[L++]=V.z,M[L++]=V.x,M[L++]=V.y,M[L++]=V.z))}for(a=0;S>a;a++)E.normal&&(P[O++]=0,P[O++]=0,P[O++]=-1),E.tangent&&(I[N++]=1,I[N++]=0,I[N++]=0),E.binormal&&(M[L++]=0,M[L++]=-1,M[L++]=0);for(a=0;S>a;a++)E.normal&&(P[O++]=0,P[O++]=0,P[O++]=1),E.tangent&&(I[N++]=1,I[N++]=0,I[N++]=0),E.binormal&&(M[L++]=0,M[L++]=1,M[L++]=0)}var G=12*S-12,W=h.createTypedArray(x,G),H=0,q=0;for(a=0;S-1>a;a++)W[H++]=q,W[H++]=q+2,W[H++]=q+3,W[H++]=q,W[H++]=q+3,W[H++]=q+1,q+=2;for(W[H++]=w-2,W[H++]=0,W[H++]=1,W[H++]=w-2,W[H++]=1,W[H++]=w-1,a=1;S-1>a;a++)W[H++]=w+a+1,W[H++]=w+a,W[H++]=w;for(a=1;S-1>a;a++)W[H++]=T,W[H++]=T+a,W[H++]=T+a+1;var j=0;if(E.st){var Y=Math.max(p,f);for(a=0;x>a;a++){var X=i.fromArray(b,3*a,C);A[j++]=(X.x+Y)/(2*Y),A[j++]=(X.y+Y)/(2*Y)}}var Z=new c;E.position&&(Z.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:b})),E.normal&&(Z.normal=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:P})),E.tangent&&(Z.tangent=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:I})),E.binormal&&(Z.binormal=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:M})),E.st&&(Z.st=new u({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:A})),v.x=.5*s,v.y=Math.max(f,p);var K=new e(i.ZERO,t.magnitude(v));return new l({attributes:Z,indices:W,primitiveType:m.TRIANGLES,boundingSphere:K})},f}),i("Core/CylinderOutlineGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function m(e){e=o(e,o.EMPTY_OBJECT);var t=e.length,i=e.topRadius,r=e.bottomRadius,n=o(e.slices,128),a=Math.max(o(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=i,this._bottomRadius=r,this._slices=n,this._numberOfVerticalLines=a,this._workerName="createCylinderOutlineGeometry"}var p=new t;m.packedLength=5,m.pack=function(e,t,i){i=o(i,0),t[i++]=e._length,t[i++]=e._topRadius,t[i++]=e._bottomRadius,t[i++]=e._slices,t[i]=e._numberOfVerticalLines};var f={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0};return m.unpack=function(e,t,i){t=o(t,0);var r=e[t++],n=e[t++],s=e[t++],l=e[t++],u=e[t];return a(i)?(i._length=r,i._topRadius=n,i._bottomRadius=s,i._slices=l,i._numberOfVerticalLines=u,i):(f.length=r,f.topRadius=n,f.bottomRadius=s,f.slices=l,f.numberOfVerticalLines=u,new m(f))},m.createGeometry=function(o){var a,s=o._length,m=o._topRadius,f=o._bottomRadius,v=o._slices,g=o._numberOfVerticalLines,_=2*v,y=n.computePositions(s,m,f,v,!1),C=2*v;if(g>0){var E=Math.min(g,v);a=Math.round(v/E),C+=E}for(var S=h.createTypedArray(_,2*C),w=0,T=0;v-1>T;T++)S[w++]=T,S[w++]=T+1,S[w++]=T+v,S[w++]=T+1+v;if(S[w++]=v-1,S[w++]=0,S[w++]=v+v-1,S[w++]=v,g>0)for(T=0;v>T;T+=a)S[w++]=T,S[w++]=T+v;var x=new c;x.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:y}),p.x=.5*s,p.y=Math.max(f,m);var b=new e(i.ZERO,t.magnitude(p));return new l({attributes:x,indices:S,primitiveType:d.LINES,boundingSphere:b})},m}),i("Core/DefaultProxy",[],function(){"use strict";function e(e){this.proxy=e}return e.prototype.getURL=function(e){return this.proxy+"?"+encodeURIComponent(e)},e}),i("Core/deprecationWarning",["./defined","./DeveloperError"],function(e,t){"use strict";function i(t,i){e(r[t])||(r[t]=!0,console.log(i))}var r={};return i}),i("ThirdParty/Tween",[],function(){void 0===Date.now&&(Date.now=function(){return(new Date).valueOf()});var e=e||function(){var e=[];return{REVISION:"13",getAll:function(){return e},removeAll:function(){e=[]},add:function(t){e.push(t)},remove:function(t){var i=e.indexOf(t);-1!==i&&e.splice(i,1)},update:function(t){if(0===e.length)return!1;var i=0;for(t=void 0!==t?t:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?window.performance.now():Date.now();i<e.length;)e[i].update(t)?i++:e.splice(i,1);return!0}}}();return e.Tween=function(t){var i=t,r={},n={},o={},a=1e3,s=0,l=!1,u=!1,c=!1,h=0,d=null,m=e.Easing.Linear.None,p=e.Interpolation.Linear,f=[],v=null,g=!1,_=null,y=null,C=null;for(var E in t)r[E]=parseFloat(t[E],10);this.to=function(e,t){return void 0!==t&&(a=t),n=e,this},this.start=function(t){e.add(this),u=!0,g=!1,d=void 0!==t?t:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?window.performance.now():Date.now(),d+=h;for(var a in n){if(n[a]instanceof Array){if(0===n[a].length)continue;n[a]=[i[a]].concat(n[a])}r[a]=i[a],r[a]instanceof Array==!1&&(r[a]*=1),o[a]=r[a]||0}return this},this.stop=function(){return u?(e.remove(this),u=!1,null!==C&&C.call(i),this.stopChainedTweens(),this):this},this.stopChainedTweens=function(){for(var e=0,t=f.length;t>e;e++)f[e].stop()},this.delay=function(e){return h=e,this},this.repeat=function(e){return s=e,this},this.yoyo=function(e){return l=e,this},this.easing=function(e){return m=e,this},this.interpolation=function(e){return p=e,this},this.chain=function(){return f=arguments,this},this.onStart=function(e){return v=e,this},this.onUpdate=function(e){return _=e,this},this.onComplete=function(e){return y=e,this},this.onStop=function(e){return C=e,this},this.update=function(e){var t;if(d>e)return!0;g===!1&&(null!==v&&v.call(i),g=!0);var u=(e-d)/a;u=u>1?1:u;var C=m(u);for(t in n){var E=r[t]||0,S=n[t];S instanceof Array?i[t]=p(S,C):("string"==typeof S&&(S=E+parseFloat(S,10)),"number"==typeof S&&(i[t]=E+(S-E)*C))}if(null!==_&&_.call(i,C),1==u){if(s>0){isFinite(s)&&s--;for(t in o){if("string"==typeof n[t]&&(o[t]=o[t]+parseFloat(n[t],10)),l){var w=o[t];o[t]=n[t],n[t]=w}r[t]=o[t]}return l&&(c=!c),d=e+h,!0}null!==y&&y.call(i);for(var T=0,x=f.length;x>T;T++)f[T].start(e);return!1}return!0}},e.Easing={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){var t,i=.1,r=.4;return 0===e?0:1===e?1:(!i||1>i?(i=1,t=r/4):t=r*Math.asin(1/i)/(2*Math.PI),-(i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)))},Out:function(e){var t,i=.1,r=.4;return 0===e?0:1===e?1:(!i||1>i?(i=1,t=r/4):t=r*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/r)+1)},InOut:function(e){var t,i=.1,r=.4;return 0===e?0:1===e?1:(!i||1>i?(i=1,t=r/4):t=r*Math.asin(1/i)/(2*Math.PI),(e*=2)<1?-.5*(i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)):i*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)*.5+1)}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(t){return 1-e.Easing.Bounce.Out(1-t)},Out:function(e){return 1/2.75>e?7.5625*e*e:2/2.75>e?7.5625*(e-=1.5/2.75)*e+.75:2.5/2.75>e?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(t){return.5>t?.5*e.Easing.Bounce.In(2*t):.5*e.Easing.Bounce.Out(2*t-1)+.5}}},e.Interpolation={Linear:function(t,i){var r=t.length-1,n=r*i,o=Math.floor(n),a=e.Interpolation.Utils.Linear;return 0>i?a(t[0],t[1],n):i>1?a(t[r],t[r-1],r-n):a(t[o],t[o+1>r?r:o+1],n-o)},Bezier:function(t,i){var r,n=0,o=t.length-1,a=Math.pow,s=e.Interpolation.Utils.Bernstein;for(r=0;o>=r;r++)n+=a(1-i,o-r)*a(i,r)*t[r]*s(o,r);return n},CatmullRom:function(t,i){var r=t.length-1,n=r*i,o=Math.floor(n),a=e.Interpolation.Utils.CatmullRom;return t[0]===t[r]?(0>i&&(o=Math.floor(n=r*(1+i))),a(t[(o-1+r)%r],t[o],t[(o+1)%r],t[(o+2)%r],n-o)):0>i?t[0]-(a(t[0],t[0],t[1],t[1],-n)-t[0]):i>1?t[r]-(a(t[r],t[r],t[r-1],t[r-1],n-r)-t[r]):a(t[o?o-1:0],t[o],t[o+1>r?r:o+1],t[o+2>r?r:o+2],n-o)},Utils:{Linear:function(e,t,i){return(t-e)*i+e},Bernstein:function(t,i){var r=e.Interpolation.Utils.Factorial;return r(t)/r(i)/r(t-i)},Factorial:function(){var e=[1];return function(t){var i,r=1;if(e[t])return e[t];for(i=t;i>1;i--)r*=i;return e[t]=r}}(),CatmullRom:function(e,t,i,r,n){var o=.5*(i-e),a=.5*(r-t),s=n*n,l=n*s;return(2*t-2*i+o+a)*l+(-3*t+3*i-2*o-a)*s+o*n+t}}},e}),i("Core/EasingFunction",["../ThirdParty/Tween","./freezeObject"],function(e,t){"use strict";var i={LINEAR_NONE:e.Easing.Linear.None,QUADRACTIC_IN:e.Easing.Quadratic.In,QUADRACTIC_OUT:e.Easing.Quadratic.Out,QUADRACTIC_IN_OUT:e.Easing.Quadratic.InOut,CUBIC_IN:e.Easing.Cubic.In,CUBIC_OUT:e.Easing.Cubic.Out,CUBIC_IN_OUT:e.Easing.Cubic.InOut,QUARTIC_IN:e.Easing.Quartic.In,QUARTIC_OUT:e.Easing.Quartic.Out,QUARTIC_IN_OUT:e.Easing.Quartic.InOut,QUINTIC_IN:e.Easing.Quintic.In,QUINTIC_OUT:e.Easing.Quintic.Out,QUINTIC_IN_OUT:e.Easing.Quintic.InOut,SINUSOIDAL_IN:e.Easing.Sinusoidal.In,SINUSOIDAL_OUT:e.Easing.Sinusoidal.Out,SINUSOIDAL_IN_OUT:e.Easing.Sinusoidal.InOut,EXPONENTIAL_IN:e.Easing.Exponential.In,EXPONENTIAL_OUT:e.Easing.Exponential.Out,EXPONENTIAL_IN_OUT:e.Easing.Exponential.InOut,CIRCULAR_IN:e.Easing.Circular.In,CIRCULAR_OUT:e.Easing.Circular.Out,CIRCULAR_IN_OUT:e.Easing.Circular.InOut,ELASTIC_IN:e.Easing.Elastic.In,ELASTIC_OUT:e.Easing.Elastic.Out,ELASTIC_IN_OUT:e.Easing.Elastic.InOut,BACK_IN:e.Easing.Back.In,BACK_OUT:e.Easing.Back.Out,BACK_IN_OUT:e.Easing.Back.InOut,BOUNCE_IN:e.Easing.Bounce.In,BOUNCE_OUT:e.Easing.Bounce.Out,BOUNCE_IN_OUT:e.Easing.Bounce.InOut};return t(i)}),i("Core/EllipsoidGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(e){e=n(e,n.EMPTY_OBJECT);var t=n(e.radii,E),r=n(e.stackPartitions,64),o=n(e.slicePartitions,64),a=n(e.vertexFormat,p.DEFAULT);this._radii=i.clone(t),this._stackPartitions=r,this._slicePartitions=o,this._vertexFormat=p.clone(a),this._workerName="createEllipsoidGeometry"}var v=new i,g=new i,_=new i,y=new i,C=new i,E=new i(1,1,1),S=Math.cos,w=Math.sin;f.packedLength=i.packedLength+p.packedLength+2,f.pack=function(e,t,r){r=n(r,0),i.pack(e._radii,t,r),r+=i.packedLength,p.pack(e._vertexFormat,t,r),r+=p.packedLength,t[r++]=e._stackPartitions,t[r]=e._slicePartitions};var T=new i,x=new p,b={radii:T,vertexFormat:x,stackPartitions:void 0,slicePartitions:void 0};return f.unpack=function(e,t,r){t=n(t,0);var a=i.unpack(e,t,T);t+=i.packedLength;var s=p.unpack(e,t,x);t+=p.packedLength;var l=e[t++],u=e[t];return o(r)?(r._radii=i.clone(a,r._radii),r._vertexFormat=p.clone(s,r._vertexFormat),r._stackPartitions=l,r._slicePartitions=u,r):(b.stackPartitions=l,b.slicePartitions=u,new f(b))},f.createGeometry=function(n){var o,a,p=n._radii,f=s.fromCartesian3(p),E=n._vertexFormat,T=n._slicePartitions+1,x=n._stackPartitions+1,b=x*T,A=new Float64Array(3*b),P=6*(T-1)*(x-1),I=h.createTypedArray(b,P),M=E.normal?new Float32Array(3*b):void 0,D=E.tangent?new Float32Array(3*b):void 0,R=E.binormal?new Float32Array(3*b):void 0,O=E.st?new Float32Array(2*b):void 0,N=new Array(T),L=new Array(T),F=0;for(o=0;T>o;o++){var B=d.TWO_PI*o/(T-1);N[o]=S(B),L[o]=w(B),A[F++]=0,A[F++]=0,A[F++]=p.z}for(o=1;x-1>o;o++){var V=Math.PI*o/(x-1),k=w(V),z=p.x*k,U=p.y*k,G=p.z*S(V);for(a=0;T>a;a++)A[F++]=N[a]*z,A[F++]=L[a]*U,A[F++]=G}for(o=0;T>o;o++)A[F++]=0,A[F++]=0,A[F++]=-p.z;var W=new c;E.position&&(W.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:A}));var H=0,q=0,j=0,Y=0;if(E.st||E.normal||E.tangent||E.binormal){for(o=0;b>o;o++){var X=i.fromArray(A,3*o,v),Z=f.geodeticSurfaceNormal(X,g);if(E.st){var K=t.negate(Z,C);t.magnitude(K)<d.EPSILON6&&(F=3*(o+T*Math.floor(.5*x)),F>A.length&&(F=3*(o-T*Math.floor(.5*x))),i.fromArray(A,F,K),f.geodeticSurfaceNormal(K,K),t.negate(K,K)),O[H++]=Math.atan2(K.y,K.x)/d.TWO_PI+.5,O[H++]=Math.asin(Z.z)/Math.PI+.5}if(E.normal&&(M[q++]=Z.x,M[q++]=Z.y,M[q++]=Z.z),E.tangent||E.binormal){var Q=_;if(T>o||o>b-T-1?(i.cross(i.UNIT_X,Z,Q),i.normalize(Q,Q)):(i.cross(i.UNIT_Z,Z,Q),i.normalize(Q,Q)),E.tangent&&(D[j++]=Q.x,D[j++]=Q.y,D[j++]=Q.z),E.binormal){var J=i.cross(Z,Q,y);i.normalize(J,J),R[Y++]=J.x,R[Y++]=J.y,R[Y++]=J.z}}}E.st&&(W.st=new u({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:O})),E.normal&&(W.normal=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:M})),E.tangent&&(W.tangent=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:D})),E.binormal&&(W.binormal=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:R}))}for(F=0,o=0;x>o;o++){var $=o*T,ee=(o+1)*T;for(a=0;T-1>a;a++)I[F++]=ee+a,I[F++]=ee+a+1,I[F++]=$+a+1,I[F++]=ee+a,I[F++]=$+a+1,I[F++]=$+a}return new l({attributes:W,indices:I,primitiveType:m.TRIANGLES,boundingSphere:e.fromEllipsoid(f)})},f}),i("Core/EllipsoidOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function m(e){e=r(e,r.EMPTY_OBJECT);var i=r(e.radii,p),n=r(e.stackPartitions,10),o=r(e.slicePartitions,8),a=r(e.subdivisions,128);this._radii=t.clone(i),this._stackPartitions=n,this._slicePartitions=o,this._subdivisions=a,this._workerName="createEllipsoidOutlineGeometry"}var p=new t(1,1,1),f=Math.cos,v=Math.sin;m.packedLength=t.packedLength+3,m.pack=function(e,i,n){n=r(n,0),t.pack(e._radii,i,n),n+=t.packedLength,i[n++]=e._stackPartitions,i[n++]=e._slicePartitions,i[n]=e._subdivisions};var g=new t,_={radii:g,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return m.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,g);i+=t.packedLength;var s=e[i++],l=e[i++],u=e[i++];return n(o)?(o._radii=t.clone(a,o._radii),o._stackPartitions=s,o._slicePartitions=l,o._subdivisions=u,o):(_.stackPartitions=s,_.slicePartitions=l,_.subdivisions=u,new m(_))},m.createGeometry=function(t){var r,n,o,m,p,g,_=t._radii,y=a.fromCartesian3(_),C=t._stackPartitions,E=t._slicePartitions,S=t._subdivisions,w=S*(C+E-1),T=w-E+2,x=new Float64Array(3*T),b=c.createTypedArray(T,2*w),A=0,P=new Array(S),I=new Array(S);for(r=0;S>r;r++)o=h.TWO_PI*r/S,P[r]=f(o),I[r]=v(o);for(r=1;C>r;r++)for(m=Math.PI*r/C,p=f(m),g=v(m),n=0;S>n;n++)x[A++]=_.x*P[n]*g,x[A++]=_.y*I[n]*g,x[A++]=_.z*p;for(P.length=E,I.length=E,r=0;E>r;r++)o=h.TWO_PI*r/E,P[r]=f(o),I[r]=v(o);for(x[A++]=0,x[A++]=0,x[A++]=_.z,r=1;S>r;r++)for(m=Math.PI*r/S,p=f(m),g=v(m),n=0;E>n;n++)x[A++]=_.x*P[n]*g,x[A++]=_.y*I[n]*g,x[A++]=_.z*p;for(x[A++]=0,x[A++]=0,x[A++]=-_.z,A=0,r=0;C-1>r;++r){var M=r*S;for(n=0;S-1>n;++n)b[A++]=M+n,b[A++]=M+n+1;b[A++]=M+S-1,b[A++]=M}var D=S*(C-1);for(n=1;E+1>n;++n)b[A++]=D,b[A++]=D+n;for(r=0;S-2>r;++r){var R=r*E+1+D,O=(r+1)*E+1+D;for(n=0;E-1>n;++n)b[A++]=O+n,b[A++]=R+n;b[A++]=O+E-1,b[A++]=R+E-1}var N=x.length/3-1;for(n=N-1;n>N-E-1;--n)b[A++]=N,b[A++]=n;var L=new u({position:new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:x})});return new s({attributes:L,indices:b,primitiveType:d.LINES,boundingSphere:e.fromEllipsoid(y)})},m}),i("Core/EllipsoidTerrainProvider",["../ThirdParty/when","./defaultValue","./defined","./defineProperties","./Ellipsoid","./Event","./GeographicTilingScheme","./HeightmapTerrainData","./TerrainProvider"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(r){r=t(r,{}),this._tilingScheme=r.tilingScheme,i(this._tilingScheme)||(this._tilingScheme=new a({ellipsoid:t(r.ellipsoid,n.WGS84)})),this._levelZeroMaximumGeometricError=l.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new o,this._readyPromise=e.resolve(!0)}return r(u.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),u.prototype.requestTileGeometry=function(e,t,i,r){var n=16,o=16;return new s({buffer:new Uint8Array(n*o),width:n,height:o})},u.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},u.prototype.getTileDataAvailable=function(e,t,i){},u}),i("Core/EventHelper",["./defined","./DeveloperError"],function(e,t){"use strict";function i(){this._removalFunctions=[]}return i.prototype.add=function(e,t,i){var r=e.addEventListener(t,i); +this._removalFunctions.push(r);var n=this;return function(){r();var e=n._removalFunctions;e.splice(e.indexOf(r),1)}},i.prototype.removeAll=function(){for(var e=this._removalFunctions,t=0,i=e.length;i>t;++t)e[t]();e.length=0},i}),i("Core/ExtrapolationType",["./freezeObject"],function(e){"use strict";var t={NONE:0,HOLD:1,EXTRAPOLATE:2};return e(t)}),i("Core/GeometryInstanceAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.value=t.value}return r}),i("Core/getBaseUri",["../ThirdParty/Uri","./definedNotNull","./DeveloperError"],function(e,t,i){"use strict";function r(i,r){var n="",o=i.lastIndexOf("/");return-1!==o&&(n=i.substring(0,o+1)),r?(i=new e(i),t(i.query)&&(n+="?"+i.query),t(i.fragment)&&(n+="#"+i.fragment),n):n}return r}),i("Core/getExtensionFromUri",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t){var i=new e(t);i.normalize();var r=i.path,n=r.lastIndexOf("/");return-1!==n&&(r=r.substr(n+1)),n=r.lastIndexOf("."),r=-1===n?"":r.substr(n+1)}return r}),i("Core/getFilenameFromUri",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t){var i=new e(t);i.normalize();var r=i.path,n=r.lastIndexOf("/");return-1!==n&&(r=r.substr(n+1)),r}return r}),i("Core/getStringFromTypedArray",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t,i,n){return i=e(i,0),n=e(n,t.byteLength-i),t=t.subarray(i,i+n),r.decode(t)}return r.decodeWithTextDecoder=function(e){var t=new TextDecoder("utf-8");return t.decode(e)},r.decodeWithFromCharCode=function(e){for(var t="",i=e.length,r=0;i>r;++r)t+=String.fromCharCode(e[r]);return t},"undefined"!=typeof TextDecoder?r.decode=r.decodeWithTextDecoder:r.decode=r.decodeWithFromCharCode,r}),i("Core/getMagic",["../Core/defaultValue","../Core/getStringFromTypedArray"],function(e,t){"use strict";function i(i,r){return r=e(r,0),t(i,r,Math.min(4,i.length))}return i}),i("Core/HeadingPitchRange",["./defaultValue","./defined"],function(e,t){"use strict";function i(t,i,r){this.heading=e(t,0),this.pitch=e(i,0),this.range=e(r,0)}return i.clone=function(e,r){return t(e)?(t(r)||(r=new i),r.heading=e.heading,r.pitch=e.pitch,r.range=e.range,r):void 0},i}),i("Core/HermitePolynomialApproximation",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,i,r){"use strict";function n(e,t,i,r,o,a){var s,l,u,c=0;if(r>0){for(l=0;o>l;l++){for(s=!1,u=0;u<a.length&&!s;u++)l===a[u]&&(s=!0);s||(a.push(l),c+=n(e,t,i,r-1,o,a),a.splice(a.length-1,1))}return c}for(c=1,l=0;o>l;l++){for(s=!1,u=0;u<a.length&&!s;u++)l===a[u]&&(s=!0);s||(c*=e-i[t[l]])}return c}function o(e,t,i,n,o,a){for(var s,l,u=-1,c=t.length,h=c*(c+1)/2,d=0;o>d;d++){var m=Math.floor(d*h);for(s=0;c>s;s++)l=t[s]*o*(a+1)+d,e[m+s]=n[l];for(var p=1;c>p;p++){var f=0,v=Math.floor(p*(1-p)/2)+c*p,g=!1;for(s=0;c-p>s;s++){var _,y,C=i[t[s]],E=i[t[s+p]];if(0>=E-C)l=t[s]*o*(a+1)+o*p+d,_=n[l],y=_/r.factorial(p),e[m+v+f]=y,f++;else{var S=Math.floor((p-1)*(2-p)/2)+c*(p-1);_=e[m+S+s+1]-e[m+S+s],y=_/(E-C),e[m+v+f]=y,f++}g=g||0!==_}g&&(u=Math.max(u,p))}}return u}var a=r.factorial,s={type:"Hermite"};s.getRequiredDataPoints=function(t,i){return i=e(i,0),Math.max(Math.floor((t+1)/(i+1)),2)},s.interpolateOrderZero=function(e,i,r,o,s){t(s)||(s=new Array(o));var l,u,c,h,d,m,p=i.length,f=new Array(o);for(l=0;o>l;l++){s[l]=0;var v=new Array(p);for(f[l]=v,u=0;p>u;u++)v[u]=[]}var g=p,_=new Array(g);for(l=0;g>l;l++)_[l]=l;var y=p-1;for(h=0;o>h;h++){for(u=0;g>u;u++)m=_[u]*o+h,f[h][0].push(r[m]);for(l=1;g>l;l++){var C=!1;for(u=0;g-l>u;u++){var E,S=i[_[u]],w=i[_[u+l]];0>=w-S?(m=_[u]*o+o*l+h,E=r[m],f[h][l].push(E/a(l))):(E=f[h][l-1][u+1]-f[h][l-1][u],f[h][l].push(E/(w-S))),C=C||0!==E}C||(y=l-1)}}for(c=0,d=0;d>=c;c++)for(l=c;y>=l;l++){var T=n(e,_,i,c,l,[]);for(h=0;o>h;h++){var x=f[h][l][0];s[h+c*o]+=x*T}}return s};var l=[];return s.interpolate=function(e,i,r,a,s,u,c){var h=a*(u+1);t(c)||(c=new Array(h));for(var d=0;h>d;d++)c[d]=0;for(var m=i.length,p=new Array(m*(s+1)),f=0;m>f;f++)for(var v=0;s+1>v;v++)p[f*(s+1)+v]=f;for(var g=p.length,_=l,y=o(_,p,i,r,a,s),C=[],E=g*(g+1)/2,S=Math.min(y,u),w=0;S>=w;w++)for(f=w;y>=f;f++){C.length=0;for(var T=n(e,p,i,w,f,C),x=Math.floor(f*(1-f)/2)+g*f,b=0;a>b;b++){var A=Math.floor(b*E),P=_[A+x];c[b+w*a]+=P*T}}return c},s}),i("Core/IauOrientationParameters",[],function(){"use strict";function e(e,t,i,r){this.rightAscension=e,this.declination=t,this.rotation=i,this.rotationRate=r}return e}),i("Core/Iau2000Orientation",["./defined","./IauOrientationParameters","./JulianDate","./Math","./TimeConstants"],function(e,t,i,r,n){"use strict";var o={},a=32.184,s=2451545,l=-.0529921,u=-.1059842,c=13.0120009,h=13.3407154,d=.9856003,m=26.4057084,p=13.064993,f=.3287146,v=1.7484877,g=-.1589763,_=.0036096,y=.1643573,C=12.9590088,E=new i;return o.ComputeMoon=function(o,S){e(o)||(o=i.now()),E=i.addSeconds(o,a,E);var w=i.totalDays(E)-s,T=w/n.DAYS_PER_JULIAN_CENTURY,x=(125.045+l*w)*r.RADIANS_PER_DEGREE,b=(250.089+u*w)*r.RADIANS_PER_DEGREE,A=(260.008+c*w)*r.RADIANS_PER_DEGREE,P=(176.625+h*w)*r.RADIANS_PER_DEGREE,I=(357.529+d*w)*r.RADIANS_PER_DEGREE,M=(311.589+m*w)*r.RADIANS_PER_DEGREE,D=(134.963+p*w)*r.RADIANS_PER_DEGREE,R=(276.617+f*w)*r.RADIANS_PER_DEGREE,O=(34.226+v*w)*r.RADIANS_PER_DEGREE,N=(15.134+g*w)*r.RADIANS_PER_DEGREE,L=(119.743+_*w)*r.RADIANS_PER_DEGREE,F=(239.961+y*w)*r.RADIANS_PER_DEGREE,B=(25.053+C*w)*r.RADIANS_PER_DEGREE,V=Math.sin(x),k=Math.sin(b),z=Math.sin(A),U=Math.sin(P),G=Math.sin(I),W=Math.sin(M),H=Math.sin(D),q=Math.sin(R),j=Math.sin(O),Y=Math.sin(N),X=Math.sin(L),Z=Math.sin(F),K=Math.sin(B),Q=Math.cos(x),J=Math.cos(b),$=Math.cos(A),ee=Math.cos(P),te=Math.cos(I),ie=Math.cos(M),re=Math.cos(D),ne=Math.cos(R),oe=Math.cos(O),ae=Math.cos(N),se=Math.cos(L),le=Math.cos(F),ue=Math.cos(B),ce=(269.9949+.0031*T-3.8787*V-.1204*k+.07*z-.0172*U+.0072*W-.0052*Y+.0043*K)*r.RADIANS_PER_DEGREE,he=(66.5392+.013*T+1.5419*Q+.0239*J-.0278*$+.0068*ee-.0029*ie+9e-4*re+8e-4*ae-9e-4*ue)*r.RADIANS_PER_DEGREE,de=(38.3213+13.17635815*w-1.4e-12*w*w+3.561*V+.1208*k-.0642*z+.0158*U+.0252*G-.0066*W-.0047*H-.0046*q+.0028*j+.0052*Y+.004*X+.0019*Z-.0044*K)*r.RADIANS_PER_DEGREE,me=(13.17635815-1.4e-12*(2*w)+3.561*Q*l+.1208*J*u-.0642*$*c+.0158*ee*h+.0252*te*d-.0066*ie*m-.0047*re*p-.0046*ne*f+.0028*oe*v+.0052*ae*g+.004*se*_+.0019*le*y-.0044*ue*C)/86400*r.RADIANS_PER_DEGREE;return e(S)||(S=new t),S.rightAscension=ce,S.declination=he,S.rotation=de,S.rotationRate=me,S},o}),i("Core/IauOrientationAxes",["./Cartesian3","./defined","./Iau2000Orientation","./JulianDate","./Math","./Matrix3","./Quaternion"],function(e,t,i,r,n,o,a){"use strict";function s(e){t(e)&&"function"==typeof e||(e=i.ComputeMoon),this._computeFunction=e}function l(i,r,a){var s=u;s.x=Math.cos(i+n.PI_OVER_TWO),s.y=Math.sin(i+n.PI_OVER_TWO),s.z=0;var l=Math.cos(r),d=h;d.x=l*Math.cos(i),d.y=l*Math.sin(i),d.z=Math.sin(r);var m=e.cross(d,s,c);return t(a)||(a=new o),a[0]=s.x,a[1]=m.x,a[2]=d.x,a[3]=s.y,a[4]=m.y,a[5]=d.y,a[6]=s.z,a[7]=m.z,a[8]=d.z,a}var u=new e,c=new e,h=new e,d=new o,m=new a;return s.prototype.evaluate=function(i,s){t(i)||(i=r.now());var u=this._computeFunction(i),c=l(u.rightAscension,u.declination,s),h=n.zeroToTwoPi(u.rotation),p=a.fromAxisAngle(e.UNIT_Z,h,m),f=o.fromQuaternion(a.conjugate(p,p),d),v=o.multiply(f,c,c);return v},s}),i("Core/InterpolationAlgorithm",["./DeveloperError"],function(e){"use strict";var t={};return t.type=void 0,t.getRequiredDataPoints=e.throwInstantiationError,t.interpolateOrderZero=e.throwInstantiationError,t.interpolate=e.throwInstantiationError,t}),i("Core/TimeInterval",["./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./JulianDate"],function(e,t,i,r,n,o){"use strict";function a(i){i=e(i,e.EMPTY_OBJECT),this.start=t(i.start)?o.clone(i.start):new o,this.stop=t(i.stop)?o.clone(i.stop):new o,this.data=i.data,this.isStartIncluded=e(i.isStartIncluded,!0),this.isStopIncluded=e(i.isStopIncluded,!0)}i(a.prototype,{isEmpty:{get:function(){var e=o.compare(this.stop,this.start);return 0>e||0===e&&(!this.isStartIncluded||!this.isStopIncluded)}}});var s={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};return a.fromIso8601=function(i,r){var n=i.iso8601.split("/"),l=o.fromIso8601(n[0]),u=o.fromIso8601(n[1]),c=e(i.isStartIncluded,!0),h=e(i.isStopIncluded,!0),d=i.data;return t(r)?(r.start=l,r.stop=u,r.isStartIncluded=c,r.isStopIncluded=h,r.data=d,r):(s.start=l,s.stop=u,s.isStartIncluded=c,s.isStopIncluded=h,s.data=d,new a(s))},a.toIso8601=function(e,t){return o.toIso8601(e.start,t)+"/"+o.toIso8601(e.stop,t)},a.clone=function(e,i){return t(e)?t(i)?(i.start=e.start,i.stop=e.stop,i.isStartIncluded=e.isStartIncluded,i.isStopIncluded=e.isStopIncluded,i.data=e.data,i):new a(e):void 0},a.equals=function(e,i,r){return e===i||t(e)&&t(i)&&(e.isEmpty&&i.isEmpty||e.isStartIncluded===i.isStartIncluded&&e.isStopIncluded===i.isStopIncluded&&o.equals(e.start,i.start)&&o.equals(e.stop,i.stop)&&(e.data===i.data||t(r)&&r(e.data,i.data)))},a.equalsEpsilon=function(e,i,r,n){return e===i||t(e)&&t(i)&&(e.isEmpty&&i.isEmpty||e.isStartIncluded===i.isStartIncluded&&e.isStopIncluded===i.isStopIncluded&&o.equalsEpsilon(e.start,i.start,r)&&o.equalsEpsilon(e.stop,i.stop,r)&&(e.data===i.data||t(n)&&n(e.data,i.data)))},a.intersect=function(e,i,r,n){if(!t(i))return a.clone(a.EMPTY,r);var s=e.start,l=e.stop,u=i.start,c=i.stop,h=o.greaterThanOrEquals(u,s)&&o.greaterThanOrEquals(l,u),d=!h&&o.lessThanOrEquals(u,s)&&o.lessThanOrEquals(s,c);if(!h&&!d)return a.clone(a.EMPTY,r);var m=e.isStartIncluded,p=e.isStopIncluded,f=i.isStartIncluded,v=i.isStopIncluded,g=o.lessThan(l,c);return r.start=h?u:s,r.isStartIncluded=m&&f||!o.equals(u,s)&&(h&&f||d&&m),r.stop=g?l:c,r.isStopIncluded=g?p:p&&v||!o.equals(c,l)&&v,r.data=t(n)?n(e.data,i.data):e.data,r},a.contains=function(e,t){if(e.isEmpty)return!1;var i=o.compare(e.start,t);if(0===i)return e.isStartIncluded;var r=o.compare(t,e.stop);return 0===r?e.isStopIncluded:0>i&&0>r},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e,t){return a.equals(this,e,t)},a.prototype.equalsEpsilon=function(e,t,i){return a.equalsEpsilon(this,e,t,i)},a.prototype.toString=function(){return a.toIso8601(this)},a.EMPTY=n(new a({start:new o,stop:new o,isStartIncluded:!1,isStopIncluded:!1})),a}),i("Core/Iso8601",["./freezeObject","./JulianDate","./TimeInterval"],function(e,t,i){"use strict";var r=e(t.fromIso8601("0000-01-01T00:00:00Z")),n=e(t.fromIso8601("9999-12-31T24:00:00Z")),o=e(new i({start:r,stop:n})),a={MINIMUM_VALUE:r,MAXIMUM_VALUE:n,MAXIMUM_INTERVAL:o};return a}),i("Core/KeyboardEventModifier",["./freezeObject"],function(e){"use strict";var t={SHIFT:0,CTRL:1,ALT:2};return e(t)}),i("Core/LagrangePolynomialApproximation",["./defined"],function(e){"use strict";var t={type:"Lagrange"};return t.getRequiredDataPoints=function(e){return Math.max(e+1,2)},t.interpolateOrderZero=function(t,i,r,n,o){e(o)||(o=new Array(n));var a,s,l=i.length;for(a=0;n>a;a++)o[a]=0;for(a=0;l>a;a++){var u=1;for(s=0;l>s;s++)if(s!==a){var c=i[a]-i[s];u*=(t-i[s])/c}for(s=0;n>s;s++)o[s]+=u*r[a*n+s]}return o},t}),i("Core/LinearApproximation",["./defined","./DeveloperError"],function(e,t){"use strict";var i={type:"Linear"};return i.getRequiredDataPoints=function(e){return 2},i.interpolateOrderZero=function(t,i,r,n,o){e(o)||(o=new Array(n));var a,s,l,u=i[0],c=i[1];for(a=0;n>a;a++)s=r[a],l=r[a+n],o[a]=((l-s)*t+c*s-u*l)/(c-u);return o},i}),i("Core/loadBlob",["./loadWithXhr","./defined"],function(e,t){"use strict";function i(i,r){return e({url:i,responseType:"blob",headers:t(r)?r.headers:void 0,withCredentials:t(r)?r.withCredentials:void 0})}return i}),i("Core/loadImageFromTypedArray",["../ThirdParty/when","./defined","./DeveloperError","./loadImage"],function(e,t,i,r){"use strict";function n(t,i){var n=new Blob([t],{type:i}),o=window.URL.createObjectURL(n);return r(o,{allowCrossOrigin:!1}).then(function(e){return window.URL.revokeObjectURL(o),e},function(t){return window.URL.revokeObjectURL(o),e.reject(t)})}return n}),i("Core/loadImageViaBlob",["../ThirdParty/when","./loadBlob","./loadImage"],function(e,t,i){"use strict";function r(r,o){return n.test(r)?i(r):t(r,o).then(function(t){var r=window.URL.createObjectURL(t);return i(r,{allowCrossOrigin:!1}).then(function(e){return e.blob=t,window.URL.revokeObjectURL(r),e},function(t){return window.URL.revokeObjectURL(r),e.reject(t)})})}var n=/^data:/,o=function(){try{var e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob","blob"===e.responseType}catch(t){return!1}}();return o?r:i}),i("Core/objectToQuery",["./defined","./DeveloperError","./isArray"],function(e,t,i){"use strict";function r(e){var t="";for(var r in e)if(e.hasOwnProperty(r)){var n=e[r],o=encodeURIComponent(r)+"=";if(i(n))for(var a=0,s=n.length;s>a;++a)t+=o+encodeURIComponent(n[a])+"&";else t+=o+encodeURIComponent(n)+"&"}return t=t.slice(0,-1)}return r}),i("Core/queryToObject",["./defined","./DeveloperError","./isArray"],function(e,t,i){"use strict";function r(t){var r={};if(""===t)return r;for(var n=t.replace(/\+/g,"%20").split("&"),o=0,a=n.length;a>o;++o){var s=n[o].split("="),l=decodeURIComponent(s[0]),u=s[1];u=e(u)?decodeURIComponent(u):"";var c=r[l];"string"==typeof c?r[l]=[c,u]:i(c)?c.push(u):r[l]=u}return r}return r}),i("Core/loadJsonp",["../ThirdParty/Uri","../ThirdParty/when","./combine","./defaultValue","./defined","./DeveloperError","./objectToQuery","./queryToObject"],function(e,t,i,r,n,o,a,s){"use strict";function l(o,u){u=r(u,r.EMPTY_OBJECT);var c;do c="loadJsonp"+Math.random().toString().substring(2,8);while(n(window[c]));var h=t.defer();window[c]=function(e){h.resolve(e);try{delete window[c]}catch(t){window[c]=void 0}};var d=new e(o),m=s(r(d.query,""));n(u.parameters)&&(m=i(u.parameters,m));var p=r(u.callbackParameterName,"callback");m[p]=c,d.query=a(m),o=d.toString();var f=u.proxy;return n(f)&&(o=f.getURL(o)),l.loadAndExecuteScript(o,c,h),h.promise}return l.loadAndExecuteScript=function(e,t,i){var r=document.createElement("script");r.async=!0,r.src=e;var n=document.getElementsByTagName("head")[0];r.onload=function(){r.onload=void 0,n.removeChild(r)},r.onerror=function(e){i.reject(e)},n.appendChild(r)},l.defaultLoadAndExecuteScript=l.loadAndExecuteScript,l}),i("Core/loadXML",["./loadWithXhr","./defined"],function(e,t){"use strict";function i(i,r){return e({url:i,responseType:"document",headers:t(r)?r.headers:void 0,overrideMimeType:"text/xml",withCredentials:t(r)?r.withCredentials:void 0})}return i}),i("Core/MapboxApi",["./defined"],function(e){"use strict";var t={};t.defaultAccessToken=void 0;var i=!1;return t.getAccessToken=function(r){return e(r)?r:e(t.defaultAccessToken)?t.defaultAccessToken:(i||(console.log("This application is using Cesium's default Mapbox access token. Please create a new access token for the application as soon as possible and prior to deployment by visiting https://www.mapbox.com/account/apps/, and provide your token to Cesium by setting the Cesium.MapboxApi.defaultAccessToken property before constructing the CesiumWidget or any other object that uses the Mapbox API."),i=!0),"pk.eyJ1IjoiYW5hbHl0aWNhbGdyYXBoaWNzIiwiYSI6IjA2YzBjOTM3YzFlYzljYmQ5NDAxZWI1Y2ZjNzZlM2E1In0.vDZL2SPFEpi_f7ziAIP_yw")},t}),i("Core/MapProjection",["./defineProperties","./DeveloperError"],function(e,t){"use strict";function i(){t.throwInstantiationError()}return e(i.prototype,{ellipsoid:{get:t.throwInstantiationError}}),i.prototype.project=t.throwInstantiationError,i.prototype.unproject=t.throwInstantiationError,i}),i("Core/Matrix2",["./Cartesian2","./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,i,r,n){"use strict";function o(e,i,r,n){this[0]=t(e,0),this[1]=t(r,0),this[2]=t(i,0),this[3]=t(n,0)}o.packedLength=4,o.pack=function(e,i,r){r=t(r,0),i[r++]=e[0],i[r++]=e[1],i[r++]=e[2],i[r++]=e[3]},o.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new o),n[0]=e[r++],n[1]=e[r++],n[2]=e[r++],n[3]=e[r++],n},o.clone=function(e,t){return i(e)?i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new o(e[0],e[2],e[1],e[3]):void 0},o.fromArray=function(e,r,n){return r=t(r,0),i(n)||(n=new o),n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n},o.fromColumnMajorArray=function(e,t){return o.clone(e,t)},o.fromRowMajorArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new o(e[0],e[1],e[2],e[3])},o.fromScale=function(e,t){return i(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new o(e.x,0,0,e.y)},o.fromUniformScale=function(e,t){return i(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new o(e,0,0,e)},o.fromRotation=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t):new o(r,-n,n,r)},o.toArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]},o.getElementIndex=function(e,t){return 2*e+t},o.getColumn=function(e,t,i){var r=2*t,n=e[r],o=e[r+1];return i.x=n,i.y=o,i},o.setColumn=function(e,t,i,r){r=o.clone(e,r);var n=2*t;return r[n]=i.x,r[n+1]=i.y,r},o.getRow=function(e,t,i){var r=e[t],n=e[t+2];return i.x=r,i.y=n,i},o.setRow=function(e,t,i,r){return r=o.clone(e,r),r[t]=i.x,r[t+2]=i.y,r};var a=new e;o.getScale=function(t,i){return i.x=e.magnitude(e.fromElements(t[0],t[1],a)),i.y=e.magnitude(e.fromElements(t[2],t[3],a)),i};var s=new e;return o.getMaximumScale=function(t){return o.getScale(t,s),e.maximumComponent(s)},o.multiply=function(e,t,i){var r=e[0]*t[0]+e[2]*t[1],n=e[0]*t[2]+e[2]*t[3],o=e[1]*t[0]+e[3]*t[1],a=e[1]*t[2]+e[3]*t[3];return i[0]=r,i[1]=o,i[2]=n,i[3]=a,i},o.add=function(e,t,i){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i},o.subtract=function(e,t,i){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i},o.multiplyByVector=function(e,t,i){var r=e[0]*t.x+e[2]*t.y,n=e[1]*t.x+e[3]*t.y;return i.x=r,i.y=n,i},o.multiplyByScalar=function(e,t,i){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i},o.multiplyByScale=function(e,t,i){return i[0]=e[0]*t.x,i[1]=e[1]*t.x,i[2]=e[2]*t.y,i[3]=e[3]*t.y,i},o.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},o.transpose=function(e,t){var i=e[0],r=e[2],n=e[1],o=e[3];return t[0]=i,t[1]=r,t[2]=n,t[3]=o,t},o.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t},o.equals=function(e,t){return e===t||i(e)&&i(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},o.equalsArray=function(e,t,i){return e[0]===t[i]&&e[1]===t[i+1]&&e[2]===t[i+2]&&e[3]===t[i+3]},o.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r},o.IDENTITY=n(new o(1,0,0,1)),o.ZERO=n(new o(0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN1ROW0=2,o.COLUMN1ROW1=3,o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"},o}),i("Core/mergeSort",["./defined","./DeveloperError"],function(e,t){"use strict";function i(e,t,i,r,n,s){var l,u,c=n-r+1,h=s-n,d=o,m=a;for(l=0;c>l;++l)d[l]=e[r+l];for(u=0;h>u;++u)m[u]=e[n+u+1];l=0,u=0;for(var p=r;s>=p;++p){var f=d[l],v=m[u];c>l&&(u>=h||t(f,v,i)<=0)?(e[p]=f,++l):h>u&&(e[p]=v,++u)}}function r(e,t,n,o,a){if(!(o>=a)){var s=Math.floor(.5*(o+a));r(e,t,n,o,s),r(e,t,n,s+1,a),i(e,t,n,o,s,a)}}function n(e,t,i){var n=e.length,s=Math.ceil(.5*n);o.length=s,a.length=s,r(e,t,i,0,n-1),o.length=0,a.length=0}var o=[],a=[];return n}),i("Core/NearFarScalar",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t,i,r,n){this.near=e(t,0),this.nearValue=e(i,0),this.far=e(r,1),this.farValue=e(n,0)}return r.clone=function(e,i){return t(e)?t(i)?(i.near=e.near,i.nearValue=e.nearValue,i.far=e.far,i.farValue=e.farValue,i):new r(e.near,e.nearValue,e.far,e.farValue):void 0},r.packedLength=4,r.pack=function(t,i,r){r=e(r,0),i[r++]=t.near,i[r++]=t.nearValue,i[r++]=t.far,i[r]=t.farValue},r.unpack=function(i,n,o){return n=e(n,0),t(o)||(o=new r),o.near=i[n++],o.nearValue=i[n++],o.far=i[n++],o.farValue=i[n],o},r.equals=function(e,i){return e===i||t(e)&&t(i)&&e.near===i.near&&e.nearValue===i.nearValue&&e.far===i.far&&e.farValue===i.farValue},r.prototype.clone=function(e){return r.clone(this,e)},r.prototype.equals=function(e){return r.equals(this,e)},r}),i("Core/Visibility",["./freezeObject"],function(e){"use strict";var t={NONE:-1,PARTIAL:0,FULL:1};return e(t)}),i("Core/Occluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math","./Rectangle","./Visibility"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,i){this._occluderPosition=t.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=i}var h=new t;n(c.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=t.clone(e,this._cameraPosition);var i,r,n,o=t.subtract(this._occluderPosition,e,h),a=t.magnitudeSquared(o),s=this._occluderRadius*this._occluderRadius;if(a>s){i=Math.sqrt(a-s),a=1/Math.sqrt(a),r=t.multiplyByScalar(o,a,h);var l=i*i*a;n=t.add(e,t.multiplyByScalar(r,l,h),h)}else i=Number.MAX_VALUE;this._horizonDistance=i,this._horizonPlaneNormal=r,this._horizonPlanePosition=n,this._cameraPosition=e}}}),c.fromBoundingSphere=function(e,i,n){if(!r(e))throw new o("occluderBoundingSphere is required.");if(!r(i))throw new o("camera position is required.");return r(n)?(t.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=i,n):new c(e,i)};var d=new t;c.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){var i=t.subtract(e,this._occluderPosition,d),r=this._occluderRadius;if(r=t.magnitudeSquared(i)-r*r,r>0)return r=Math.sqrt(r)+this._horizonDistance,i=t.subtract(e,this._cameraPosition,i),r*r>t.magnitudeSquared(i)}return!1};var m=new t;c.prototype.isBoundingSphereVisible=function(e){var i=t.clone(e.center,m),r=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){var n=t.subtract(i,this._occluderPosition,d),o=this._occluderRadius-r;if(o=t.magnitudeSquared(n)-o*o,r<this._occluderRadius)return o>0?(o=Math.sqrt(o)+this._horizonDistance,n=t.subtract(i,this._cameraPosition,n),o*o+r*r>t.magnitudeSquared(n)):!1;if(o>0){n=t.subtract(i,this._cameraPosition,n);var a=t.magnitudeSquared(n),s=this._occluderRadius*this._occluderRadius,l=r*r;return(this._horizonDistance*this._horizonDistance+s)*l>a*s?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+l>a)}return!0}return!1};var p=new t;c.prototype.computeVisibility=function(e){if(!r(e))throw new o("occludeeBS is required.");var i=t.clone(e.center),n=e.radius;if(n>this._occluderRadius)return u.FULL;if(this._horizonDistance!==Number.MAX_VALUE){var a=t.subtract(i,this._occluderPosition,p),s=this._occluderRadius-n,l=t.magnitudeSquared(a);if(s=l-s*s,s>0){s=Math.sqrt(s)+this._horizonDistance,a=t.subtract(i,this._cameraPosition,a);var c=t.magnitudeSquared(a);return c>s*s+n*n?u.NONE:(s=this._occluderRadius+n,s=l-s*s,s>0?(s=Math.sqrt(s)+this._horizonDistance,s*s+n*n>c?u.FULL:u.PARTIAL):(a=t.subtract(i,this._horizonPlanePosition,a),t.dot(a,this._horizonPlaneNormal)>-n?u.PARTIAL:u.FULL))}}return u.NONE};var f=new t;c.computeOccludeePoint=function(e,i,r){var n=t.clone(i),a=t.clone(e.center),s=e.radius,l=r.length;if(t.equals(a,i))throw new o("occludeePosition must be different than occluderBoundingSphere.center");var u=t.normalize(t.subtract(n,a,f),f),h=-t.dot(u,a),d=c._anyRotationVector(a,u,h),m=c._horizonToPlaneNormalDotProduct(e,u,h,d,r[0]);if(m){for(var p,v=1;l>v;++v){if(p=c._horizonToPlaneNormalDotProduct(e,u,h,d,r[v]),!p)return;m>p&&(m=p)}if(!(.0017453283658983088>m)){var g=s/m;return t.add(a,t.multiplyByScalar(u,g,f),f)}}};var v=[];c.computeOccludeePointFromRectangle=function(r,n){n=i(n,a.WGS84);var o=l.subsample(r,n,0,v),s=e.fromPoints(o),u=t.ZERO;return t.equals(u,s.center)?void 0:c.computeOccludeePoint(new e(u,n.minimumRadius),s.center,o)};var g=new t;c._anyRotationVector=function(e,i,r){var n=t.abs(i,g),o=n.x>n.y?0:1;(0===o&&n.z>n.x||1===o&&n.z>n.y)&&(o=2);var a,s=new t;0===o?(n.x=e.x,n.y=e.y+1,n.z=e.z+1,a=t.UNIT_X):1===o?(n.x=e.x+1,n.y=e.y,n.z=e.z+1,a=t.UNIT_Y):(n.x=e.x+1,n.y=e.y+1,n.z=e.z,a=t.UNIT_Z);var l=(t.dot(i,n)+r)/-t.dot(i,a);return t.normalize(t.subtract(t.add(n,t.multiplyByScalar(a,l,s),n),e,n),n)};var _=new t;c._rotationVector=function(e,i,r,n,o){var a=t.subtract(n,e,_);if(a=t.normalize(a,a),t.dot(i,a)<.9999999847691291){var l=t.cross(i,a,a),u=t.magnitude(l);if(u>s.EPSILON13)return t.normalize(l,new t)}return o};var y=new t,C=new t,E=new t,S=new t;return c._horizonToPlaneNormalDotProduct=function(e,i,r,n,o){var a=t.clone(o,y),s=t.clone(e.center,C),l=e.radius,u=t.subtract(s,a,E),c=t.magnitudeSquared(u),h=l*l;if(h>c)return!1;var d=c-h,m=Math.sqrt(d),p=Math.sqrt(c),f=1/p,v=m*f,g=v*m;u=t.normalize(u,u);var _=t.add(a,t.multiplyByScalar(u,g,S),S),w=Math.sqrt(d-g*g),T=this._rotationVector(s,i,r,a,n),x=t.fromElements(T.x*T.x*u.x+(T.x*T.y-T.z)*u.y+(T.x*T.z+T.y)*u.z,(T.x*T.y+T.z)*u.x+T.y*T.y*u.y+(T.y*T.z-T.x)*u.z,(T.x*T.z-T.y)*u.x+(T.y*T.z+T.x)*u.y+T.z*T.z*u.z,y);x=t.normalize(x,x);var b=t.multiplyByScalar(x,w,y);T=t.normalize(t.subtract(t.add(_,b,E),s,E),E);var A=t.dot(i,T);T=t.normalize(t.subtract(t.subtract(_,b,T),s,T),T);var P=t.dot(i,T);return P>A?A:P},c}),i("Core/Packable",["./DeveloperError"],function(e){"use strict";var t={packedLength:void 0,pack:e.throwInstantiationError,unpack:e.throwInstantiationError};return t}),i("Core/PackableForInterpolation",["./DeveloperError"],function(e){"use strict";var t={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:e.throwInstantiationError,unpackInterpolationResult:e.throwInstantiationError};return t}),i("ThirdParty/measureText",[],function(){var e=function(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)},t=function(t,i,r,n){var o=t.measureText(i),a=e(t.canvas,"font-family"),s=e(t.canvas,"font-size").replace("px",""),l=!/\S/.test(i);o.fontsize=s;var u=document.createElement("div");u.style.position="absolute",u.style.opacity=0,u.style.font=s+"px "+a,u.innerHTML=i+"<br/>"+i,document.body.appendChild(u),o.leading=1.2*s;var c=e(u,"height");if(c=c.replace("px",""),c>=2*s&&(o.leading=c/2|0),document.body.removeChild(u),l)o.ascent=0,o.descent=0,o.bounds={minx:0,maxx:o.width,miny:0,maxy:0},o.height=0;else{var h=document.createElement("canvas"),d=100;h.width=o.width+d,h.height=3*s,h.style.opacity=1,h.style.fontFamily=a,h.style.fontSize=s;var m=h.getContext("2d");m.font=s+"px "+a;var p=h.width,f=h.height,v=f/2;m.fillStyle="white",m.fillRect(-1,-1,p+2,f+2),r&&(m.strokeStyle="black",m.lineWidth=t.lineWidth,m.strokeText(i,d/2,v)),n&&(m.fillStyle="black",m.fillText(i,d/2,v));for(var g=m.getImageData(0,0,p,f).data,_=0,y=4*p,C=g.length;++_<C&&255===g[_];);var E=_/y|0;for(_=C-1;--_>0&&255===g[_];);var S=_/y|0;for(_=0;C>_&&255===g[_];)_+=y,_>=C&&(_=_-C+4);var w=_%y/4|0,T=1;for(_=C-3;_>=0&&255===g[_];)_-=y,0>_&&(_=C-3-4*T++);var x=_%y/4+1|0;o.ascent=v-E,o.descent=S-v,o.bounds={minx:w-d/2,maxx:x-d/2,miny:0,maxy:S-E},o.height=1+(S-E)}return o};return t}),i("Core/writeTextToCanvas",["../ThirdParty/measureText","./Color","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r,n){"use strict";function o(n,o){if(""!==n){o=i(o,i.EMPTY_OBJECT);var s=i(o.font,"10px sans-serif"),l=i(o.stroke,!1),u=i(o.fill,!0),c=i(o.strokeWidth,1),h=document.createElement("canvas");h.width=1,h.height=1,h.style.font=s;var d=h.getContext("2d");r(a)||(r(d.imageSmoothingEnabled)?a="imageSmoothingEnabled":r(d.mozImageSmoothingEnabled)?a="mozImageSmoothingEnabled":r(d.webkitImageSmoothingEnabled)?a="webkitImageSmoothingEnabled":r(d.msImageSmoothingEnabled)&&(a="msImageSmoothingEnabled")),d.font=s,d.lineJoin="round",d.lineWidth=c,d[a]=!1,d.textBaseline=i(o.textBaseline,"bottom"),h.style.visibility="hidden",document.body.appendChild(h);var m=e(d,n,l,u);m.computedWidth=Math.max(m.width,m.bounds.maxx-m.bounds.minx),h.dimensions=m,document.body.removeChild(h),h.style.visibility="";var p=m.height-m.ascent;h.width=m.computedWidth,h.height=m.height;var f=h.height-p;if(d.font=s,d.lineJoin="round",d.lineWidth=c,d[a]=!1,l){var v=i(o.strokeColor,t.BLACK);d.strokeStyle=v.toCssColorString(),d.strokeText(n,0,f)}if(u){var g=i(o.fillColor,t.WHITE);d.fillStyle=g.toCssColorString(),d.fillText(n,0,f)}return h}}var a;return o}),i("Core/PinBuilder",["./buildModuleUrl","./Color","./defined","./DeveloperError","./loadImage","./writeTextToCanvas"],function(e,t,i,r,n,o){"use strict";function a(){this._cache={}}function s(e,t,i){e.save(),e.scale(i/24,i/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,c).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function l(e,i,r){var n=r/2.5,o=n,a=n;i.width>i.height?a=n*(i.height/i.width):i.width<i.height&&(o=n*(i.width/i.height));var s=(r-o)/2,l=7/24*r-a/2;e.globalCompositeOperation="destination-out",e.drawImage(i,s-1,l,o,a),e.drawImage(i,s,l-1,o,a),e.drawImage(i,s+1,l,o,a),e.drawImage(i,s,l+1,o,a),e.globalCompositeOperation="destination-over",e.fillStyle=t.BLACK.toCssColorString(),e.fillRect(s-1,l-1,o+1,a+1),e.globalCompositeOperation="destination-out",e.drawImage(i,s,l,o,a),e.globalCompositeOperation="destination-over",e.fillStyle=t.WHITE.toCssColorString(),e.fillRect(s,l,o,a)}function u(e,t,r,a,u){h[0]=e,h[1]=t,h[2]=r,h[3]=a;var c=JSON.stringify(h),d=u[c];if(i(d))return d;var m=document.createElement("canvas");m.width=a,m.height=a;var p=m.getContext("2d");if(s(p,r,a),i(e)){var f=n(e).then(function(e){return l(p,e,a),u[c]=m,m});return u[c]=f,f}if(i(t)){var v=o(t,{font:"bold "+a+"px sans-serif"});l(p,v,a)}return u[c]=m,m}a.prototype.fromColor=function(e,t){return u(void 0,void 0,e,t,this._cache)},a.prototype.fromUrl=function(e,t,i){return u(e,void 0,t,i,this._cache)},a.prototype.fromMakiIconId=function(t,i,r){return u(e("Assets/Textures/maki/"+encodeURIComponent(t)+".png"),void 0,i,r,this._cache)},a.prototype.fromText=function(e,t,i){return u(void 0,e,t,i,this._cache)};var c=new t,h=new Array(4);return a}),i("Core/PixelFormat",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"use strict";var i={DEPTH_COMPONENT:e.DEPTH_COMPONENT,DEPTH_STENCIL:e.DEPTH_STENCIL,ALPHA:e.ALPHA,RGB:e.RGB,RGBA:e.RGBA,LUMINANCE:e.LUMINANCE,LUMINANCE_ALPHA:e.LUMINANCE_ALPHA,validate:function(e){return e===i.DEPTH_COMPONENT||e===i.DEPTH_STENCIL||e===i.ALPHA||e===i.RGB||e===i.RGBA||e===i.LUMINANCE||e===i.LUMINANCE_ALPHA},isColorFormat:function(e){return e===i.ALPHA||e===i.RGB||e===i.RGBA||e===i.LUMINANCE||e===i.LUMINANCE_ALPHA},isDepthFormat:function(e){return e===i.DEPTH_COMPONENT||e===i.DEPTH_STENCIL}};return t(i)}),i("Core/PointGeometry",["./BoundingSphere","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t){t=i(t,i.EMPTY_OBJECT),this._positionsTypedArray=t.positionsTypedArray,this._colorsTypedArray=t.colorsTypedArray,this._boundingSphere=e.clone(t.boundingSphere),this._workerName="createPointGeometry"}return u.createGeometry=function(i){ +var n=i._positionsTypedArray,u=n.byteLength/n.length,c=4===u?t.FLOAT:t.DOUBLE,h=new s;h.position=new a({componentDatatype:c,componentsPerAttribute:3,values:n}),h.color=new a({componentDatatype:t.UNSIGNED_BYTE,componentsPerAttribute:3,values:i._colorsTypedArray,normalize:!0});var d=i._boundingSphere;return r(d)||(d=e.fromVertices(n)),new o({attributes:h,primitiveType:l.POINTS,boundingSphere:d})},u}),i("Core/pointInsideTriangle",["./barycentricCoordinates","./Cartesian3"],function(e,t){"use strict";function i(t,i,n,o){return e(t,i,n,o,r),r.x>0&&r.y>0&&r.z>0}var r=new t;return i}),i("Core/Queue",["../Core/defineProperties"],function(e){"use strict";function t(){this._array=[],this._offset=0,this._length=0}return e(t.prototype,{length:{get:function(){return this._length}}}),t.prototype.enqueue=function(e){this._array.push(e),this._length++},t.prototype.dequeue=function(){if(0!==this._length){var e=this._array,t=this._offset,i=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,i}},t.prototype.peek=function(){return 0!==this._length?this._array[this._offset]:void 0},t.prototype.contains=function(e){return-1!==this._array.indexOf(e)},t.prototype.clear=function(){this._array.length=this._offset=this._length=0},t.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},t}),i("Core/WindingOrder",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"use strict";var i={CLOCKWISE:e.CW,COUNTER_CLOCKWISE:e.CCW,validate:function(e){return e===i.CLOCKWISE||e===i.COUNTER_CLOCKWISE}};return t(i)}),i("Core/PolygonPipeline",["./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./Math","./pointInsideTriangle","./PolylinePipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f){"use strict";function v(t,i,r){var n=e.subtract(i,t,F),o=e.subtract(r,i,B);return n.x*o.y-n.y*o.x>=0}function g(e){for(var t=e[0].x,i=0,r=0;r<e.length;r++)e[r].x>t&&(t=e[r].x,i=r);return i}function _(e){for(var t=e[0][0].x,i=0,r=0;r<e.length;r++){var n=e[r][g(e[r])].x;n>t&&(t=n,i=r)}return i}function y(e){for(var t=[],i=0;i<e.length;i++){var r=e[(i-1+e.length)%e.length],n=e[i],o=e[(i+1)%e.length];v(r,n,o)||t.push(n)}return t}function C(t,i){for(var r=0;r<t.length;r++)if(e.equals(i,t[r]))return r;return-1}function E(i,n,o){o=r(o,[]);var a=Number.MAX_VALUE,s=g(n),l=new e(n[s].x,i.y);o.push(s),o.push((s+1)%n.length);for(var u=n[0].x,c=u,h=1;h<n.length;++h)n[h].x<u?u=n[h].x:n[h].x>c&&(c=n[h].x);c+=c-u;var d=new t(c,i.y,0);for(h=0;h<n.length;h++){var m=n[h],p=n[(h+1)%n.length];if((m.x>=i.x||p.x>=i.x)&&(m.y>=i.y&&p.y<=i.y||m.y<=i.y&&p.y>=i.y)){var f=(p.y-m.y)*(d.x-i.x)-(p.x-m.x)*(d.y-i.y);if(0!==f){f=1/f;var v=((p.x-m.x)*(i.y-m.y)-(p.y-m.y)*(i.x-m.x))*f,_=((d.x-i.x)*(i.y-m.y)-(d.y-i.y)*(i.x-m.x))*f;if(v>=0&&1>=v&&_>=0&&1>=_){var y=new e(i.x+v*(d.x-i.x),i.y+v*(d.y-i.y)),C=e.subtract(y,i,V);f=e.magnitudeSquared(C),a>f&&(l=y,a=f,o[0]=h,o[1]=(h+1)%n.length)}}}}return l}function S(t,i){var r=_(i),n=i[r],o=g(n),a=n[o],s=[],l=E(a,t,s),u=C(t,l);if(-1!==u)return u;var d=e.magnitudeSquared(e.subtract(t[s[0]],a,k)),m=e.magnitudeSquared(e.subtract(t[s[1]],a,k)),p=m>d?t[s[0]]:t[s[1]],f=y(t),v=f.indexOf(p);-1!==v&&f.splice(v,1);for(var S=[],w=0;w<f.length;w++){var T=f[w];h(T,a,l,p)&&S.push(T)}var x=Number.MAX_VALUE;if(S.length>0){var b=e.fromElements(1,0,k);for(w=0;w<S.length;w++){var A=e.subtract(S[w],a,z),P=e.magnitude(b)*e.magnitudeSquared(A);if(0!==P){var I=Math.abs(c.acosClamped(e.dot(b,A)/P));x>I&&(x=I,p=S[w])}}}return t.indexOf(p)}function w(e,i,r){for(var n=ee.computeWindingOrder2D(e),o=0;o<i.length;o++){var a=i[o];t.equals(a[0],a[a.length-1])||a.push(a[0]);var l=ee.computeWindingOrder2D(a);l===n&&a.reverse()}var u=s.fromPoints(e,r),c=u.projectPointsOntoPlane(e),h=[];for(o=0;o<i.length;o++)h.push(u.projectPointsOntoPlane(i[o]));var d=S(c,h),m=_(h),p=g(h[m]),f=i[m],v=[];for(o=0;o<e.length;o++)v.push(e[o]);var y,C=[];if(0!==p)for(y=0;y<=f.length;y++){var E=(y+p)%f.length;0!==E&&C.push(f[E])}else for(y=0;y<f.length;y++)C.push(f[(y+p)%f.length]);var w=v.lastIndexOf(e[d]);C.push(e[w]);var T=v.slice(0,w+1),x=v.slice(w+1);return v=T.concat(C,x),i.splice(m,1),v}function T(e){var t=c.nextRandomNumber(),i=Math.floor(t*e);return i===e&&i--,i}function x(e,t,i,r){var n=r[e].position,o=r[t].position,a=r[i].position,s=a.x,l=a.y,u=n.x-s,c=n.y-l,h=o.x-s,d=o.y-l;return u*d-c*h}function b(e,t){return e.x*t.y-e.y*t.x}function A(e,t){var i=t.length,r=c.mod(e-1,i),n=c.mod(e+1,i);return 0===x(r,n,e,t)?!1:!0}function P(t,i){return e.magnitudeSquared(i)<e.magnitudeSquared(t)}function I(t,i,r){if(!A(t,r))return t;var n=r[t].position,o=r[i].position,a=r.length,s=c.mod(t-1,a);if(!A(s,r))return s;var l=c.mod(t+1,a);if(!A(l,r))return l;var u=e.subtract(r[s].position,n,W),h=e.subtract(r[l].position,n,H),d=e.subtract(o,n,q),m=b(u,d),p=b(h,d);if(0===m)return P(u,d)?U:G;if(0===p)return P(h,d)?U:G;var f=b(u,h);return 0>f?0>m&&p>0?U:G:f>0?m>0&&0>p?G:U:void 0}function M(e,t,i){return(e>t||e>i)&&(t>e||i>e)||t===i&&t===e}function D(t,i,r,n){var o=e.subtract(r,t,Y),a=i.x*n.y-i.y*n.x,s=a*a,l=e.magnitudeSquared(i),u=e.magnitudeSquared(n);if(s>j*l*u){var c=(o.x*n.y-o.y*n.x)/a;return e.add(t,e.multiplyByScalar(i,c,Y),Y)}}function R(t,i,r){for(var o=e.subtract(i,t,X),a=r.length,s=0;a>s;s++){var l=r[s].position,u=r[c.mod(s+1,a)].position;if(!(e.equals(t,l)||e.equals(i,u)||e.equals(t,u)||e.equals(i,l))){var h=e.subtract(u,l,Z),d=D(t,o,l,h);if(n(d)&&!(e.equals(d,t)||e.equals(d,i)||e.equals(d,l)||e.equals(d,u))){var m=d.x,p=d.y,f=M(m,t.x,i.x)&&M(p,t.y,i.y)&&M(m,l.x,u.x)&&M(p,l.y,u.y);if(f)return!0}}}return!1}function O(t,i,r){var n=I(t,i,r);if(n>=0)return n;var o=I(i,t,r);return o>=0?o:n!==U||o!==U||R(r[t].position,r[i].position,r)||e.equals(r[t].position,r[i].position)?Q:K}function N(e){return 0===x(1,2,0,e)}function L(e){var t=e.length;if(3===t)return N(e)?[]:[e[0].index,e[1].index,e[2].index];if(e.length<3)throw new o("Invalid polygon: must have at least three vertices.");for(var i,r,n=0,a=10*e.length,s=Q;K>s&&n++<a;){for(i=T(e.length),r=i+1;Math.abs(i-r)<2||Math.abs(i-r)>e.length-2;)r=T(e.length);if(i>r){var l=i;i=r,r=l}s=O(i,r,e)}if(s===K){var u=e.splice(i,r-i+1,e[i],e[r]);return L(e).concat(L(u))}return s>=0?(e.splice(s,1),L(e)):[]}var F=new e,B=new e,V=new e,k=new e(1,0),z=new e,U=-1,G=-2,W=new t,H=new t,q=new t,j=c.EPSILON14,Y=new e,X=new e,Z=new e,K=-1,Q=-2,J=new t,$=new t,ee={};ee.removeDuplicates=function(e){var i=d.removeDuplicates(e);return t.equals(i[0],i[i.length-1])?i.slice(1):i},ee.computeArea2D=function(e){for(var t=e.length,i=0,r=t-1,n=0;t>n;r=n++){var o=e[r],a=e[n];i+=o.x*a.y-a.x*o.y}return.5*i},ee.computeWindingOrder2D=function(e){var t=ee.computeArea2D(e);return t>0?f.COUNTER_CLOCKWISE:f.CLOCKWISE},ee.triangulate=function(e){for(var t=e.length,i=[],r=0;t>r;++r)i[r]={position:e[r],index:r};return L(i)};var te=new t,ie=new t,re=new t,ne=new t,oe=new t,ae=new t,se=new t;return ee.computeSubdivision=function(e,o,a,s){s=r(s,c.RADIANS_PER_DEGREE);var h,d=a.slice(0),p=o.length,f=new Array(3*p),v=0;for(h=0;p>h;h++){var g=o[h];f[v++]=g.x,f[v++]=g.y,f[v++]=g.z}for(var _=[],y={},C=e.maximumRadius,E=c.chordLength(s,C),S=E*E;d.length>0;){var w,T,x=d.pop(),b=d.pop(),A=d.pop(),P=t.fromArray(f,3*A,te),I=t.fromArray(f,3*b,ie),M=t.fromArray(f,3*x,re),D=t.multiplyByScalar(t.normalize(P,ne),C,ne),R=t.multiplyByScalar(t.normalize(I,oe),C,oe),O=t.multiplyByScalar(t.normalize(M,ae),C,ae),N=t.magnitudeSquared(t.subtract(D,R,se)),L=t.magnitudeSquared(t.subtract(R,O,se)),F=t.magnitudeSquared(t.subtract(O,D,se)),B=Math.max(N,L,F);B>S?N===B?(w=Math.min(A,b)+" "+Math.max(A,b),h=y[w],n(h)||(T=t.add(P,I,se),t.multiplyByScalar(T,.5,T),f.push(T.x,T.y,T.z),h=f.length/3-1,y[w]=h),d.push(A,h,x),d.push(h,b,x)):L===B?(w=Math.min(b,x)+" "+Math.max(b,x),h=y[w],n(h)||(T=t.add(I,M,se),t.multiplyByScalar(T,.5,T),f.push(T.x,T.y,T.z),h=f.length/3-1,y[w]=h),d.push(b,h,A),d.push(h,x,A)):F===B&&(w=Math.min(x,A)+" "+Math.max(x,A),h=y[w],n(h)||(T=t.add(M,P,se),t.multiplyByScalar(T,.5,T),f.push(T.x,T.y,T.z),h=f.length/3-1,y[w]=h),d.push(x,h,b),d.push(h,A,b)):(_.push(A),_.push(b),_.push(x))}return new l({attributes:{position:new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:f})},indices:_,primitiveType:m.TRIANGLES})},ee.scaleToGeodeticHeight=function(e,i,o,s){o=r(o,a.WGS84);var l=J,u=$;if(i=r(i,0),s=r(s,!0),n(e)&&n(e.attributes)&&n(e.attributes.position))for(var c=e.attributes.position.values,h=c.length,d=0;h>d;d+=3)t.fromArray(c,d,u),s&&(u=o.scaleToGeodeticSurface(u,u)),0!==i&&(l=o.geodeticSurfaceNormal(u,l),t.multiplyByScalar(l,i,l),t.add(u,l,u)),c[d]=u.x,c[d+1]=u.y,c[d+2]=u.z;return e},ee.eliminateHoles=function(e,i,n){n=r(n,a.WGS84);for(var o=[],s=0;s<i.length;s++){for(var l=[],u=0;u<i[s].length;u++)l.push(t.clone(i[s][u]));o.push(l)}for(var c=e;o.length>0;)c=w(c,o,n);return c},ee}),i("Core/PolygonGeometryLibrary",["./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(t,i,r,n){return e.subtract(i,t,g),e.multiplyByScalar(g,r/n,g),e.add(t,g,g),[g.x,g.y,g.z]}var v={};v.computeHierarchyPackedLength=function(t){for(var i=0,n=[t];n.length>0;){var o=n.pop();if(r(o)){i+=2;var a=o.positions,s=o.holes;if(r(a)&&(i+=a.length*e.packedLength),r(s))for(var l=s.length,u=0;l>u;++u)n.push(s[u])}}return i},v.packPolygonHierarchy=function(t,i,n){for(var o=[t];o.length>0;){var a=o.pop();if(r(a)){var s=a.positions,l=a.holes;if(i[n++]=r(s)?s.length:0,i[n++]=r(l)?l.length:0,r(s))for(var u=s.length,c=0;u>c;++c,n+=3)e.pack(s[c],i,n);if(r(l))for(var h=l.length,d=0;h>d;++d)o.push(l[d])}}return n},v.unpackPolygonHierarchy=function(t,i){for(var r=t[i++],n=t[i++],o=new Array(r),a=n>0?new Array(n):void 0,s=0;r>s;++s,i+=e.packedLength)o[s]=e.unpack(t,i);for(var l=0;n>l;++l)a[l]=v.unpackPolygonHierarchy(t,i),i=a[l].startingIndex,delete a[l].startingIndex;return{positions:o,holes:a,startingIndex:i}};var g=new e;v.subdivideLineCount=function(t,i,r){var n=e.distance(t,i),o=n/r,a=Math.max(0,Math.ceil(Math.log(o)/Math.log(2)));return Math.pow(2,a)},v.subdivideLine=function(t,i,n,o){var a=v.subdivideLineCount(t,i,n),s=e.distance(t,i),l=s/a;r(o)||(o=[]);var u=o;u.length=3*a;for(var c=0,h=0;a>h;h++){var d=f(t,i,h*l,s);u[c++]=d[0],u[c++]=d[1],u[c++]=d[2]}return u};var _=new e,y=new e,C=new e,E=new e;v.scaleToGeodeticHeightExtruded=function(t,o,a,s,l){s=i(s,n.WGS84);var u=_,c=y,h=C,d=E;if(r(t)&&r(t.attributes)&&r(t.attributes.position))for(var m=t.attributes.position.values,p=m.length/2,f=0;p>f;f+=3)e.fromArray(m,f,h),s.geodeticSurfaceNormal(h,u),d=s.scaleToGeodeticSurface(h,d),c=e.multiplyByScalar(u,a,c),c=e.add(d,c,c),m[f+p]=c.x,m[f+1+p]=c.y,m[f+2+p]=c.z,l&&(d=e.clone(h,d)),c=e.multiplyByScalar(u,o,c),c=e.add(d,c,c),m[f]=c.x,m[f+1]=c.y,m[f+2]=c.z;return t},v.polygonsFromHierarchy=function(e){var t=[],i=[],n=new m;for(n.enqueue(e);0!==n.length;){var o=n.dequeue(),a=o.positions,s=o.holes;if(a=h.removeDuplicates(a),!(a.length<3)){for(var l=r(s)?s.length:0,u=[],c=0;l>c;c++){var d=s[c];if(d.positions=h.removeDuplicates(d.positions),!(d.positions.length<3)){u.push(d.positions);var p=0;r(d.holes)&&(p=d.holes.length);for(var f=0;p>f;f++)n.enqueue(d.holes[f])}}i.push({outerRing:a,holes:u});var v=u.length>0?h.eliminateHoles(a,u):a;t.push(v)}}return{hierarchy:i,polygons:t}};var S=[];v.createGeometryFromPositions=function(e,i,r,n){var l=o.fromPoints(i,e),u=l.projectPointsOntoPlane(i,S),c=h.computeWindingOrder2D(u);c===p.CLOCKWISE&&(u.reverse(),i=i.slice().reverse());var m=h.triangulate(u);if(m.length<3&&(m=[0,1,2]),n){for(var f=i.length,v=new Array(3*f),g=0,_=0;f>_;_++){var y=i[_];v[g++]=y.x,v[g++]=y.y,v[g++]=y.z}return new a({attributes:{position:new s({componentDatatype:t.DOUBLE,componentsPerAttribute:3,values:v})},indices:m,primitiveType:d.TRIANGLES})}return h.computeSubdivision(e,i,m,r)};var w=[],T=new e,x=new e;return v.computeWallGeometry=function(i,r,n,o){var h,m,p,f,g,_=i.length,y=0;if(o)for(m=3*_*2,h=new Array(2*m),p=0;_>p;p++)f=i[p],g=i[(p+1)%_],h[y]=h[y+m]=f.x,++y,h[y]=h[y+m]=f.y,++y,h[y]=h[y+m]=f.z,++y,h[y]=h[y+m]=g.x,++y,h[y]=h[y+m]=g.y,++y,h[y]=h[y+m]=g.z,++y;else{var C=c.chordLength(n,r.maximumRadius),E=0;for(p=0;_>p;p++)E+=v.subdivideLineCount(i[p],i[(p+1)%_],C);for(m=3*(E+_),h=new Array(2*m),p=0;_>p;p++){f=i[p],g=i[(p+1)%_];for(var S=v.subdivideLine(f,g,C,w),b=S.length,A=0;b>A;++A,++y)h[y]=S[A],h[y+m]=S[A];h[y]=g.x,h[y+m]=g.x,++y,h[y]=g.y,h[y+m]=g.y,++y,h[y]=g.z,h[y+m]=g.z,++y}}_=h.length;var P=u.createTypedArray(_/3,_-6*i.length),I=0;for(_/=6,p=0;_>p;p++){var M=p,D=M+1,R=M+_,O=R+1;f=e.fromArray(h,3*M,T),g=e.fromArray(h,3*D,x),e.equalsEpsilon(f,g,c.EPSILON14)||(P[I++]=M,P[I++]=R,P[I++]=D,P[I++]=D,P[I++]=R,P[I++]=O)}return new a({attributes:new l({position:new s({componentDatatype:t.DOUBLE,componentsPerAttribute:3,values:h})}),indices:P,primitiveType:d.TRIANGLES})},v}),i("Core/PolygonGeometry",["./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PolygonGeometryLibrary","./PolygonPipeline","./Quaternion","./VertexFormat","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S){"use strict";function w(e,t,i,n){for(var o=C.fromAxisAngle(e._plane.normal,i,I),s=g.fromQuaternion(o,M),l=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,c=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,d=t.length,m=0;d>m;++m){var p=r.clone(t[m],P);g.multiplyByVector(s,p,p);var f=e.projectPointOntoPlane(p,A);a(f)&&(l=Math.min(l,f.x),u=Math.max(u,f.x),c=Math.min(c,f.y),h=Math.max(h,f.y))}return n.x=l,n.y=c,n.width=u-l,n.height=h-c,n}function T(e,t,o,a,s,l,c){if(e.st||e.normal||e.tangent||e.binormal){var d=u.fromPoints(o,a),m=w(d,o,s,D),p=V;p.x=m.x,p.y=m.y;var f=t.attributes.position.values,_=f.length,y=e.st?new Float32Array(2*(_/3)):void 0,E=e.normal?new Float32Array(_):void 0,S=e.tangent?new Float32Array(_):void 0,T=e.binormal?new Float32Array(_):void 0,x=0,b=0,A=O,P=N,I=L,M=!0,W=C.fromAxisAngle(d._plane.normal,s,U),H=g.fromQuaternion(W,G),q=_/2,j=_/3;l&&(_/=2);for(var Y=0;_>Y;Y+=3){var X=r.fromArray(f,Y,z);if(e.st){var Z=g.multiplyByVector(H,X,R);Z=a.scaleToGeodeticSurface(Z,Z);var K=d.projectPointOntoPlane(Z,k);i.subtract(K,p,K),l&&(y[x+j]=K.x/m.width,y[x+1+j]=K.y/m.height),y[x]=K.x/m.width,y[x+1]=K.y/m.height,x+=2}if(e.normal||e.tangent||e.binormal){var Q=b+1,J=b+2;if(c){if(_>Y+3){var $=r.fromArray(f,Y+3,F);if(M){var ee=r.fromArray(f,Y+_,B);r.subtract($,X,$),r.subtract(ee,X,ee),A=r.normalize(r.cross(ee,$,A),A),M=!1}r.equalsEpsilon($,X,v.EPSILON10)&&(M=!0)}(e.tangent||e.binormal)&&(I=a.geodeticSurfaceNormal(X,I),e.tangent&&(P=r.normalize(r.cross(I,A,P),P)))}else A=a.geodeticSurfaceNormal(X,A),(e.tangent||e.binormal)&&(P=r.cross(r.UNIT_Z,A,P),P=r.normalize(g.multiplyByVector(H,P,P),P),e.binormal&&(I=r.normalize(r.cross(A,P,I),I)));e.normal&&(l&&!c?(E[b+q]=-A.x,E[Q+q]=-A.y,E[J+q]=-A.z):(E[b+q]=A.x,E[Q+q]=A.y,E[J+q]=A.z),E[b]=A.x,E[Q]=A.y,E[J]=A.z),e.tangent&&(l&&!c?(S[b+q]=-P.x,S[Q+q]=-P.y,S[J+q]=-P.z):(S[b+q]=P.x,S[Q+q]=P.y,S[J+q]=P.z),S[b]=P.x,S[Q]=P.y,S[J]=P.z),e.binormal&&(l&&(T[b+q]=I.x,T[Q+q]=I.y,T[J+q]=I.z),T[b]=I.x,T[Q]=I.y,T[J]=I.z),b+=3}}e.st&&(t.attributes.st=new h({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:y})),e.normal&&(t.attributes.normal=new h({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:E})),e.tangent&&(t.attributes.tangent=new h({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:S})),e.binormal&&(t.attributes.binormal=new h({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:T}))}return t}function x(e,t,i,r,o){var a=_.createGeometryFromPositions(e,t,i,o),s=a.attributes.position.values,l=a.indices,p=s.concat(s),v=p.length/3,g=f.createTypedArray(v,2*l.length);g.set(l);var C,E=l.length,w=v/2;for(C=0;E>C;C+=3){var T=g[C]+w,x=g[C+1]+w,b=g[C+2]+w;g[C+E]=b,g[C+1+E]=x,g[C+2+E]=T}var A=new c({attributes:new d({position:new h({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:p})}),indices:g,primitiveType:a.primitiveType}),P={topAndBottom:new m({geometry:A}),walls:[]},I=r.outerRing,M=u.fromPoints(I,e),D=M.projectPointsOntoPlane(I,W),R=y.computeWindingOrder2D(D);R===S.CLOCKWISE&&(I=I.slice().reverse());var O=_.computeWallGeometry(I,e,i,o);P.walls.push(new m({geometry:O}));var N=r.holes;for(C=0;C<N.length;C++){var L=N[C];M=u.fromPoints(L,e),D=M.projectPointsOntoPlane(L,W),R=y.computeWindingOrder2D(D),R===S.COUNTER_CLOCKWISE&&(L=L.slice().reverse()),O=_.computeWallGeometry(L,e,i),P.walls.push(new m({geometry:O}))}return P}function b(e){var t=e.polygonHierarchy,i=o(e.vertexFormat,E.DEFAULT),r=o(e.ellipsoid,l.WGS84),n=o(e.granularity,v.RADIANS_PER_DEGREE),s=o(e.stRotation,0),u=o(e.height,0),c=o(e.perPositionHeight,!1),h=e.extrudedHeight,d=a(h);if(d&&!c){var m=h;h=Math.min(m,u),u=Math.max(m,u)}this._vertexFormat=E.clone(i),this._ellipsoid=l.clone(r),this._granularity=n,this._stRotation=s,this._height=u,this._extrudedHeight=o(h,0),this._extrude=d,this._polygonHierarchy=t,this._perPositionHeight=c,this._workerName="createPolygonGeometry",this.packedLength=_.computeHierarchyPackedLength(t)+l.packedLength+E.packedLength+7}var A=new i,P=new r,I=new C,M=new g,D=new e,R=new r,O=new r,N=new r,L=new r,F=new r,B=new r,V=new i,k=new i,z=new r,U=new C,G=new g,W=[];b.fromPositions=function(e){e=o(e,o.EMPTY_OBJECT);var t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight};return new b(t)},b.pack=function(e,t,i){i=o(i,0),i=_.packPolygonHierarchy(e._polygonHierarchy,t,i),l.pack(e._ellipsoid,t,i),i+=l.packedLength,E.pack(e._vertexFormat,t,i),i+=E.packedLength,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._granularity,t[i++]=e._stRotation,t[i++]=e._extrude?1:0,t[i++]=e._perPositionHeight?1:0,t[i]=e.packedLength};var H=l.clone(l.UNIT_SPHERE),q=new E,j={polygonHierarchy:{}};return b.unpack=function(e,t,i){t=o(t,0);var r=_.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var n=l.unpack(e,t,H);t+=l.packedLength;var s=E.unpack(e,t,q);t+=E.packedLength;var u=e[t++],c=e[t++],h=e[t++],d=e[t++],m=1===e[t++],p=1===e[t++],f=e[t];return a(i)||(i=new b(j)),i._polygonHierarchy=r,i._ellipsoid=l.clone(n,i._ellipsoid),i._vertexFormat=E.clone(s,i._vertexFormat),i._height=u,i._extrudedHeight=c,i._granularity=h,i._stRotation=d,i._extrude=m,i._perPositionHeight=p,i.packedLength=f,i},b.createGeometry=function(e){var i,r,n,o=e._vertexFormat,a=e._ellipsoid,s=e._granularity,l=e._stRotation,u=e._height,h=e._extrudedHeight,d=e._extrude,v=e._polygonHierarchy,g=e._perPositionHeight,C=_.polygonsFromHierarchy(v),E=C.hierarchy,S=C.polygons;if(0!==S.length){n=S[0];var w,b,A=[];if(d)for(b=0;b<S.length;b++){w=x(a,S[b],s,E[b],g),r=w.topAndBottom,r.geometry=_.scaleToGeodeticHeightExtruded(r.geometry,u,h,a,g),r.geometry=T(o,r.geometry,n,a,l,!0,!1),A.push(r),i=w.walls;for(var P=0;P<i.length;P++){var I=i[P];I.geometry=_.scaleToGeodeticHeightExtruded(I.geometry,u,h,a,g),I.geometry=T(o,I.geometry,n,a,l,!0,!0),A.push(I)}}else for(b=0;b<S.length;b++)w=new m({geometry:_.createGeometryFromPositions(a,S[b],s,g)}),w.geometry=y.scaleToGeodeticHeight(w.geometry,u,a,!g),w.geometry=T(o,w.geometry,n,a,l,!1,!1),A.push(w);w=p.combineInstances(A)[0],w.attributes.position.values=new Float64Array(w.attributes.position.values),w.indices=f.createTypedArray(w.attributes.position.values.length/3,w.indices);var M=w.attributes,D=t.fromVertices(M.position.values);return o.position||delete M.position,new c({attributes:M,indices:w.indices,primitiveType:w.primitiveType,boundingSphere:D})}},b.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new b({polygonHierarchy:e._polygonHierarchy,ellipsoid:n,stRotation:e._stRotation,granularity:r,perPositionHeight:!1,extrudedHeight:o,height:a,vertexFormat:E.POSITION_ONLY})},b}),i("Core/PolygonHierarchy",["./defined"],function(e){"use strict";function t(t,i){this.positions=e(t)?t:[],this.holes=e(i)?i:[]}return t}),i("Core/PolygonOutlineGeometry",["./BoundingSphere","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./PolygonGeometryLibrary","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_){"use strict";function y(e,i,r,n){var o=a.fromPoints(i,e),h=o.projectPointsOntoPlane(i,S),m=f.computeWindingOrder2D(h);m===_.CLOCKWISE&&(h.reverse(),i=i.slice().reverse());var g,y,C=i.length,E=0;if(n)for(g=new Float64Array(2*C*3),y=0;C>y;y++){var T=i[y],x=i[(y+1)%C];g[E++]=T.x,g[E++]=T.y,g[E++]=T.z,g[E++]=x.x,g[E++]=x.y,g[E++]=x.z}else{var b=0;for(y=0;C>y;y++)b+=p.subdivideLineCount(i[y],i[(y+1)%C],r);for(g=new Float64Array(3*b),y=0;C>y;y++)for(var A=p.subdivideLine(i[y],i[(y+1)%C],r,w),P=A.length,I=0;P>I;++I)g[E++]=A[I]}C=g.length/3;var M=2*C,D=d.createTypedArray(C,M);for(E=0,y=0;C-1>y;y++)D[E++]=y,D[E++]=y+1;return D[E++]=C-1,D[E++]=0,new c({geometry:new s({attributes:new u({position:new l({componentDatatype:t.DOUBLE,componentsPerAttribute:3,values:g})}),indices:D,primitiveType:v.LINES})})}function C(e,i,r,n){var o=a.fromPoints(i,e),h=o.projectPointsOntoPlane(i,S),m=f.computeWindingOrder2D(h);m===_.CLOCKWISE&&(h.reverse(),i=i.slice().reverse());var g,y,C=i.length,E=new Array(C),T=0;if(n)for(g=new Float64Array(2*C*3*2),y=0;C>y;++y){E[y]=T/3;var x=i[y],b=i[(y+1)%C];g[T++]=x.x,g[T++]=x.y,g[T++]=x.z,g[T++]=b.x,g[T++]=b.y,g[T++]=b.z}else{var A=0;for(y=0;C>y;y++)A+=p.subdivideLineCount(i[y],i[(y+1)%C],r);for(g=new Float64Array(3*A*2),y=0;C>y;++y){E[y]=T/3;for(var P=p.subdivideLine(i[y],i[(y+1)%C],r,w),I=P.length,M=0;I>M;++M)g[T++]=P[M]}}C=g.length/6;var D=E.length,R=2*(2*C+D),O=d.createTypedArray(C,R);for(T=0,y=0;C>y;++y)O[T++]=y,O[T++]=(y+1)%C,O[T++]=y+C,O[T++]=(y+1)%C+C;for(y=0;D>y;y++){var N=E[y];O[T++]=N,O[T++]=N+C}return new c({geometry:new s({attributes:new u({position:new l({componentDatatype:t.DOUBLE,componentsPerAttribute:3,values:g})}),indices:O,primitiveType:v.LINES})})}function E(e){var t=e.polygonHierarchy,n=i(e.ellipsoid,o.WGS84),a=i(e.granularity,m.RADIANS_PER_DEGREE),s=i(e.height,0),l=i(e.perPositionHeight,!1),u=e.extrudedHeight,c=r(u);if(c&&!l){var h=u;u=Math.min(h,s),s=Math.max(h,s)}this._ellipsoid=o.clone(n),this._granularity=a,this._height=s,this._extrudedHeight=i(u,0),this._extrude=c,this._polygonHierarchy=t,this._perPositionHeight=l,this._workerName="createPolygonOutlineGeometry",this.packedLength=p.computeHierarchyPackedLength(t)+o.packedLength+6}var S=[],w=[];E.pack=function(e,t,r){r=i(r,0),r=p.packPolygonHierarchy(e._polygonHierarchy,t,r),o.pack(e._ellipsoid,t,r),r+=o.packedLength,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._granularity,t[r++]=e._extrude?1:0,t[r++]=e._perPositionHeight?1:0,t[r++]=e.packedLength};var T=o.clone(o.UNIT_SPHERE),x={polygonHierarchy:{}};return E.unpack=function(e,t,n){t=i(t,0);var a=p.unpackPolygonHierarchy(e,t);t=a.startingIndex,delete a.startingIndex;var s=o.unpack(e,t,T);t+=o.packedLength;var l=e[t++],u=e[t++],c=e[t++],h=1===e[t++],d=1===e[t++],m=e[t++];return r(n)||(n=new E(x)),n._polygonHierarchy=a,n._ellipsoid=o.clone(s,n._ellipsoid),n._height=l,n._extrudedHeight=u,n._granularity=c,n._extrude=h,n._perPositionHeight=d,n.packedLength=m,n},E.fromPositions=function(e){e=i(e,i.EMPTY_OBJECT);var t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight};return new E(t)},E.createGeometry=function(t){var i=t._ellipsoid,n=t._granularity,o=t._height,a=t._extrudedHeight,l=t._extrude,u=t._polygonHierarchy,c=t._perPositionHeight,d=[],v=new g;v.enqueue(u);for(var _;0!==v.length;){var E=v.dequeue(),S=E.positions;if(S=f.removeDuplicates(S),!(S.length<3)){var w=E.holes?E.holes.length:0;for(_=0;w>_;_++){var T=E.holes[_];if(T.positions=f.removeDuplicates(T.positions),!(T.positions.length<3)){d.push(T.positions);var x=0;r(T.holes)&&(x=T.holes.length);for(var b=0;x>b;b++)v.enqueue(T.holes[b])}}d.push(S)}}if(0!==d.length){var A,P=[],I=m.chordLength(n,i.maximumRadius);if(l)for(_=0;_<d.length;_++)A=C(i,d[_],I,c),A.geometry=p.scaleToGeodeticHeightExtruded(A.geometry,o,a,i,c),P.push(A);else for(_=0;_<d.length;_++)A=y(i,d[_],I,c),A.geometry=f.scaleToGeodeticHeight(A.geometry,o,i,!c),P.push(A);A=h.combineInstances(P)[0];var M=e.fromVertices(A.attributes.position.values);return new s({attributes:A.attributes,indices:A.indices,primitiveType:A.primitiveType,boundingSphere:M})}},E}),i("Core/PolylineGeometry",["./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryType","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v){"use strict";function g(e,t,r,n,o){var a=y;a.length=o;var s,l=r.red,u=r.green,c=r.blue,h=r.alpha,d=n.red,m=n.green,p=n.blue,f=n.alpha;if(i.equals(r,n)){for(s=0;o>s;s++)a[s]=i.clone(r);return a}var v=(d-l)/o,g=(m-u)/o,_=(p-c)/o,C=(f-h)/o;for(s=0;o>s;s++)a[s]=new i(l+s*v,u+s*g,c+s*_,h+s*C);return a}function _(e){e=n(e,n.EMPTY_OBJECT);var r=e.positions,a=e.colors,l=n(e.width,1),u=n(e.colorsPerVertex,!1);this._positions=r,this._colors=a,this._width=l,this._colorsPerVertex=u,this._vertexFormat=v.clone(n(e.vertexFormat,v.DEFAULT)),this._followSurface=n(e.followSurface,!0),this._granularity=n(e.granularity,m.RADIANS_PER_DEGREE),this._ellipsoid=s.clone(n(e.ellipsoid,s.WGS84)),this._workerName="createPolylineGeometry";var c=1+r.length*t.packedLength;c+=o(a)?1+a.length*i.packedLength:1,this.packedLength=c+s.packedLength+v.packedLength+4}var y=[];_.pack=function(e,r,a){a=n(a,0);var l,u=e._positions,c=u.length;for(r[a++]=c,l=0;c>l;++l,a+=t.packedLength)t.pack(u[l],r,a);var h=e._colors;for(c=o(h)?h.length:0,r[a++]=c,l=0;c>l;++l,a+=i.packedLength)i.pack(h[l],r,a);s.pack(e._ellipsoid,r,a),a+=s.packedLength,v.pack(e._vertexFormat,r,a),a+=v.packedLength,r[a++]=e._width,r[a++]=e._colorsPerVertex?1:0,r[a++]=e._followSurface?1:0,r[a]=e._granularity};var C=s.clone(s.UNIT_SPHERE),E=new v,S={positions:void 0,colors:void 0,ellipsoid:C,vertexFormat:E,width:void 0,colorsPerVertex:void 0,followSurface:void 0,granularity:void 0};_.unpack=function(e,r,a){r=n(r,0);var l,u=e[r++],c=new Array(u);for(l=0;u>l;++l,r+=t.packedLength)c[l]=t.unpack(e,r);u=e[r++];var h=u>0?new Array(u):void 0;for(l=0;u>l;++l,r+=i.packedLength)h[l]=i.unpack(e,r);var d=s.unpack(e,r,C);r+=s.packedLength;var m=v.unpack(e,r,E);r+=v.packedLength;var p=e[r++],f=1===e[r++],g=1===e[r++],y=e[r];return o(a)?(a._positions=c,a._colors=h,a._ellipsoid=s.clone(d,a._ellipsoid),a._vertexFormat=v.clone(m,a._vertexFormat),a._width=p,a._colorsPerVertex=f,a._followSurface=g,a._granularity=y,a):(S.positions=c,S.colors=h,S.width=p,S.colorsPerVertex=f,S.followSurface=g,S.granularity=y,new _(S))};var w=new t,T=new t,x=new t,b=new t;return _.createGeometry=function(n){var a,s,v,_=n._width,C=n._vertexFormat,E=n._colors,S=n._colorsPerVertex,A=n._followSurface,P=n._granularity,I=n._ellipsoid,M=m.chordLength(P,I.maximumRadius),D=p.removeDuplicates(n._positions),R=D.length;if(!(2>R)){if(A){var O=p.extractHeights(D,I);if(o(E)){var N=1;for(a=0;R-1>a;++a)N+=p.numberOfPoints(D[a],D[a+1],M);var L=new Array(N),F=0;for(a=0;R-1>a;++a){var B=D[a],V=D[a+1],k=E[a],z=p.numberOfPoints(B,V,M);if(S&&N>a){var U=E[a+1],G=g(B,V,k,U,z),W=G.length;for(s=0;W>s;++s)L[F++]=G[s]}else for(s=0;z>s;++s)L[F++]=i.clone(k)}L[F]=i.clone(E[E.length-1]),E=L,y.length=0}D=p.generateCartesianArc({positions:D,minDistance:M,ellipsoid:I,height:O})}R=D.length;var H,q=4*R-4,j=new Float64Array(3*q),Y=new Float64Array(3*q),X=new Float64Array(3*q),Z=new Float32Array(2*q),K=C.st?new Float32Array(2*q):void 0,Q=o(E)?new Uint8Array(4*q):void 0,J=0,$=0,ee=0,te=0;for(s=0;R>s;++s){0===s?(H=w,t.subtract(D[0],D[1],H),t.add(D[0],H,H)):H=D[s-1],t.clone(H,x),t.clone(D[s],T),s===R-1?(H=w,t.subtract(D[R-1],D[R-2],H),t.add(D[R-1],H,H)):H=D[s+1],t.clone(H,b);var ie,re;o(Q)&&(ie=0===s||S?E[s]:E[s-1],s!==R-1&&(re=E[s]));var ne=0===s?2:0,oe=s===R-1?2:4;for(v=ne;oe>v;++v){t.pack(T,j,J),t.pack(x,Y,J),t.pack(b,X,J),J+=3;var ae=0>v-2?-1:1;if(Z[$++]=2*(v%2)-1,Z[$++]=ae*_,C.st&&(K[ee++]=s/(R-1),K[ee++]=Math.max(Z[$-2],0)),o(Q)){var se=2>v?ie:re;Q[te++]=i.floatToByte(se.red),Q[te++]=i.floatToByte(se.green),Q[te++]=i.floatToByte(se.blue),Q[te++]=i.floatToByte(se.alpha)}}}var le=new c;le.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:j}),le.prevPosition=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:Y}),le.nextPosition=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:X}),le.expandAndWidth=new u({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:Z}),C.st&&(le.st=new u({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:K})),o(Q)&&(le.color=new u({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:4,values:Q,normalize:!0}));var ue=d.createTypedArray(q,6*R-6),ce=0,he=0,de=R-1;for(s=0;de>s;++s)ue[he++]=ce,ue[he++]=ce+2,ue[he++]=ce+1,ue[he++]=ce+1,ue[he++]=ce+2,ue[he++]=ce+3,ce+=4;return new l({attributes:le,indices:ue,primitiveType:f.TRIANGLES,boundingSphere:e.fromPoints(D),geometryType:h.POLYLINES})}},_}),i("Core/PolylineVolumeGeometry",["./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./PolygonPipeline","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./VertexFormat","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E){"use strict";function S(e,i,r,o){var a=new d;o.position&&(a.position=new h({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:e}));var s,l,u,f,g,_,C=i.length,E=e.length/3,S=(E-2*C)/(2*C),w=v.triangulate(i),T=(S-1)*C*6+2*w.length,x=p.createTypedArray(E,T),b=2*C,A=0;for(s=0;S-1>s;s++){for(l=0;C-1>l;l++)u=2*l+s*C*2,_=u+b,f=u+1,g=f+b,x[A++]=f,x[A++]=u,x[A++]=g,x[A++]=g,x[A++]=u,x[A++]=_;u=2*C-2+s*C*2,f=u+1,g=f+b,_=u+b,x[A++]=f,x[A++]=u,x[A++]=g,x[A++]=g,x[A++]=u,x[A++]=_}if(o.st||o.tangent||o.binormal){var P,I,M=new Float32Array(2*E),D=1/(S-1),R=1/r.height,O=r.height/2,N=0;for(s=0;S>s;s++){for(P=s*D,I=R*(i[0].y+O),M[N++]=P,M[N++]=I,l=1;C>l;l++)I=R*(i[l].y+O),M[N++]=P,M[N++]=I,M[N++]=P,M[N++]=I;I=R*(i[0].y+O),M[N++]=P,M[N++]=I}for(l=0;C>l;l++)P=0,I=R*(i[l].y+O),M[N++]=P,M[N++]=I;for(l=0;C>l;l++)P=(S-1)*D,I=R*(i[l].y+O),M[N++]=P,M[N++]=I;a.st=new h({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:new Float32Array(M)})}var L=E-2*C;for(s=0;s<w.length;s+=3){var F=w[s]+L,B=w[s+1]+L,V=w[s+2]+L;x[A++]=F,x[A++]=B,x[A++]=V,x[A++]=V+C,x[A++]=B+C,x[A++]=F+C}var k=new c({attributes:a,indices:x,boundingSphere:t.fromVertices(e),primitiveType:y.TRIANGLES});return o.normal&&(k=m.computeNormal(k)),(o.tangent||o.binormal)&&(k=m.computeBinormalAndTangent(k),o.tangent||(k.attributes.tangent=void 0),o.binormal||(k.attributes.binormal=void 0),o.st||(k.attributes.st=void 0)),k}function w(e){e=a(e,a.EMPTY_OBJECT);var t=e.polylinePositions,n=e.shapePositions;this._positions=t, +this._shape=n,this._ellipsoid=u.clone(a(e.ellipsoid,u.WGS84)),this._cornerType=a(e.cornerType,o.ROUNDED),this._vertexFormat=C.clone(a(e.vertexFormat,C.DEFAULT)),this._granularity=a(e.granularity,f.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";var s=1+t.length*r.packedLength;s+=1+n.length*i.packedLength,this.packedLength=s+u.packedLength+C.packedLength+2}w.pack=function(e,t,n){n=a(n,0);var o,s=e._positions,l=s.length;for(t[n++]=l,o=0;l>o;++o,n+=r.packedLength)r.pack(s[o],t,n);var c=e._shape;for(l=c.length,t[n++]=l,o=0;l>o;++o,n+=i.packedLength)i.pack(c[o],t,n);u.pack(e._ellipsoid,t,n),n+=u.packedLength,C.pack(e._vertexFormat,t,n),n+=C.packedLength,t[n++]=e._cornerType,t[n]=e._granularity};var T=u.clone(u.UNIT_SPHERE),x=new C,b={polylinePositions:void 0,shapePositions:void 0,ellipsoid:T,vertexFormat:x,cornerType:void 0,granularity:void 0};w.unpack=function(e,t,n){t=a(t,0);var o,l=e[t++],c=new Array(l);for(o=0;l>o;++o,t+=r.packedLength)c[o]=r.unpack(e,t);l=e[t++];var h=new Array(l);for(o=0;l>o;++o,t+=i.packedLength)h[o]=i.unpack(e,t);var d=u.unpack(e,t,T);t+=u.packedLength;var m=C.unpack(e,t,x);t+=C.packedLength;var p=e[t++],f=e[t];return s(n)?(n._positions=c,n._shape=h,n._ellipsoid=u.clone(d,n._ellipsoid),n._vertexFormat=C.clone(m,n._vertexFormat),n._cornerType=p,n._granularity=f,n):(b.polylinePositions=c,b.shapePositions=h,b.cornerType=p,b.granularity=f,new w(b))};var A=new e;return w.createGeometry=function(t){var i=t._positions,r=g.removeDuplicates(i),n=t._shape;if(n=_.removeDuplicatesFromShape(n),!(r.length<2||n.length<3)){v.computeWindingOrder2D(n)===E.CLOCKWISE&&n.reverse();var o=e.fromPoints(n,A),a=_.computePositions(r,n,o,t,!0);return S(a,n,o,t._vertexFormat)}},w}),i("Core/PolylineVolumeOutlineGeometry",["./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y){"use strict";function C(e,i){var r=new d;r.position=new h({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:e});var o,a,s=i.length,l=r.position.values.length/3,u=e.length/3,p=u/s,f=m.createTypedArray(l,2*s*(p+1)),v=0;o=0;var g=o*s;for(a=0;s-1>a;a++)f[v++]=a+g,f[v++]=a+g+1;for(f[v++]=s-1+g,f[v++]=g,o=p-1,g=o*s,a=0;s-1>a;a++)f[v++]=a+g,f[v++]=a+g+1;for(f[v++]=s-1+g,f[v++]=g,o=0;p-1>o;o++){var y=s*o,C=y+s;for(a=0;s>a;a++)f[v++]=a+y,f[v++]=a+C}var E=new c({attributes:r,indices:m.createTypedArray(l,f),boundingSphere:t.fromVertices(e),primitiveType:_.LINES});return E}function E(e){e=a(e,a.EMPTY_OBJECT);var t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=u.clone(a(e.ellipsoid,u.WGS84)),this._cornerType=a(e.cornerType,o.ROUNDED),this._granularity=a(e.granularity,p.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";var s=1+t.length*r.packedLength;s+=1+n.length*i.packedLength,this.packedLength=s+u.packedLength+2}E.pack=function(e,t,n){n=a(n,0);var o,s=e._positions,l=s.length;for(t[n++]=l,o=0;l>o;++o,n+=r.packedLength)r.pack(s[o],t,n);var c=e._shape;for(l=c.length,t[n++]=l,o=0;l>o;++o,n+=i.packedLength)i.pack(c[o],t,n);u.pack(e._ellipsoid,t,n),n+=u.packedLength,t[n++]=e._cornerType,t[n]=e._granularity};var S=u.clone(u.UNIT_SPHERE),w={polylinePositions:void 0,shapePositions:void 0,ellipsoid:S,height:void 0,cornerType:void 0,granularity:void 0};E.unpack=function(e,t,n){t=a(t,0);var o,l=e[t++],c=new Array(l);for(o=0;l>o;++o,t+=r.packedLength)c[o]=r.unpack(e,t);l=e[t++];var h=new Array(l);for(o=0;l>o;++o,t+=i.packedLength)h[o]=i.unpack(e,t);var d=u.unpack(e,t,S);t+=u.packedLength;var m=e[t++],p=e[t];return s(n)?(n._positions=c,n._shape=h,n._ellipsoid=u.clone(d,n._ellipsoid),n._cornerType=m,n._granularity=p,n):(w.polylinePositions=c,w.shapePositions=h,w.cornerType=m,w.granularity=p,new E(w))};var T=new e;return E.createGeometry=function(t){var i=t._positions,r=v.removeDuplicates(i),n=t._shape;if(n=g.removeDuplicatesFromShape(n),!(r.length<2||n.length<3)){f.computeWindingOrder2D(n)===y.CLOCKWISE&&n.reverse();var o=e.fromPoints(n,T),a=g.computePositions(r,n,o,t,!1);return C(a,n)}},E}),i("Core/QuaternionSpline",["./defaultValue","./defined","./defineProperties","./DeveloperError","./Quaternion","./Spline"],function(e,t,i,r,n,o){"use strict";function a(e,i,r){var o=e.length,a=new Array(o);a[0]=t(i)?i:e[0],a[o-1]=t(r)?r:e[o-1];for(var s=1;o-1>s;++s)a[s]=n.computeInnerQuadrangle(e[s-1],e[s],e[s+1],new n);return a}function s(e){var i=e.points,r=e.innerQuadrangles,o=e.times;if(i.length<3){var a=o[0],s=1/(o[1]-a),l=i[0],u=i[1];return function(e,i){t(i)||(i=new n);var r=(e-a)*s;return n.fastSlerp(l,u,r,i)}}return function(a,s){t(s)||(s=new n);var l=e._lastTimeIndex=e.findTimeInterval(a,e._lastTimeIndex),u=(a-o[l])/(o[l+1]-o[l]),c=i[l],h=i[l+1],d=r[l],m=r[l+1];return n.fastSquad(c,h,d,m,u,s)}}function l(t){t=e(t,e.EMPTY_OBJECT);var i=t.points,r=t.times,n=t.firstInnerQuadrangle,o=t.lastInnerQuadrangle,l=a(i,n,o);this._times=r,this._points=i,this._innerQuadrangles=l,this._evaluateFunction=s(this),this._lastTimeIndex=0}return i(l.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},innerQuadrangles:{get:function(){return this._innerQuadrangles}}}),l.prototype.findTimeInterval=o.prototype.findTimeInterval,l.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},l}),i("Core/RectangleGeometryLibrary",["./Cartesian3","./Cartographic","./defined","./DeveloperError","./GeographicProjection","./Math","./Matrix2","./Rectangle"],function(e,t,i,r,n,o,a,s){"use strict";var l=Math.cos,u=Math.sin,c=Math.sqrt,h={};h.computePosition=function(e,t,r,n,o){var s=e.ellipsoid.radiiSquared,h=e.nwCorner,d=e.rectangle,m=h.latitude-e.granYCos*t+r*e.granXSin,p=l(m),f=u(m),v=s.z*f,g=h.longitude+t*e.granYSin+r*e.granXCos,_=p*l(g),y=p*u(g),C=s.x*_,E=s.y*y,S=c(C*_+E*y+v*f);n.x=C/S,n.y=E/S,n.z=v/S,i(e.vertexFormat)&&e.vertexFormat.st&&(o.x=(g-d.west)*e.lonScalar-.5,o.y=(m-d.south)*e.latScalar-.5,a.multiplyByVector(e.textureMatrix,o,o),o.x+=.5,o.y+=.5)};var d=new a,m=new e,p=new t,f=new e,v=new n;return h.computeOptions=function(t,n,l){var u,c,h,g,_,y=t._granularity,C=t._ellipsoid,E=t._surfaceHeight,S=t._rotation,w=t._extrudedHeight,T=n.east,x=n.west,b=n.north,A=n.south,P=b-A;x>T?(_=o.TWO_PI-x+T,u=Math.ceil(_/y)+1,c=Math.ceil(P/y)+1,h=_/(u-1),g=P/(c-1)):(_=T-x,u=Math.ceil(_/y)+1,c=Math.ceil(P/y)+1,h=_/(u-1),g=P/(c-1)),l=s.northwest(n,l);var I=s.center(n,p),M=g,D=h,R=0,O=0;if(i(S)){var N=Math.cos(S);M*=N,D*=N;var L=Math.sin(S);R=g*L,O=h*L,m=v.project(l,m),f=v.project(I,f),m=e.subtract(m,f,m);var F=a.fromRotation(S,d);m=a.multiplyByVector(F,m,m),m=e.add(m,f,m),l=v.unproject(m,l);var B=l.latitude,V=B+(u-1)*O,k=B-M*(c-1),z=B-M*(c-1)+(u-1)*O;b=Math.max(B,V,k,z),A=Math.min(B,V,k,z);var U=l.longitude,G=U+(u-1)*D,W=U+(c-1)*R,H=U+(c-1)*R+(u-1)*D;if(T=Math.max(U,G,W,H),x=Math.min(U,G,W,H),b<-o.PI_OVER_TWO||b>o.PI_OVER_TWO||A<-o.PI_OVER_TWO||A>o.PI_OVER_TWO)throw new r("Rotated rectangle is invalid. It crosses over either the north or south pole.");n.north=b,n.south=A,n.east=T,n.west=x}return{granYCos:M,granYSin:R,granXCos:D,granXSin:O,ellipsoid:C,width:u,height:c,surfaceHeight:E,extrudedHeight:w,nwCorner:l,rectangle:n}},h}),i("Core/RectangleGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix2","./Matrix3","./PolygonPipeline","./PrimitiveType","./Quaternion","./Rectangle","./RectangleGeometryLibrary","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S,w){"use strict";function T(e,t){var i=new u({attributes:new h,primitiveType:y.TRIANGLES});return i.attributes.position=new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(i.attributes.normal=new c({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(i.attributes.tangent=new c({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.binormal&&(i.attributes.binormal=new c({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:t.binormals})),i}function x(e,t,r,n){for(var o=e.length,a=t.normal?new Float32Array(o):void 0,s=t.tangent?new Float32Array(o):void 0,l=t.binormal?new Float32Array(o):void 0,u=0,c=L,h=N,d=O,m=0;o>m;m+=3){var p=i.fromArray(e,m,R),f=u+1,v=u+2;(t.normal||t.tangent||t.binormal)&&(d=r.geodeticSurfaceNormal(p,d),(t.tangent||t.binormal)&&(i.cross(i.UNIT_Z,d,h),g.multiplyByVector(n,h,h),i.normalize(h,h),t.binormal&&i.normalize(i.cross(d,h,c),c)),t.normal&&(a[u]=d.x,a[f]=d.y,a[v]=d.z),t.tangent&&(s[u]=h.x,s[f]=h.y,s[v]=h.z),t.binormal&&(l[u]=c.x,l[f]=c.y,l[v]=c.z)),u+=3}return T(t,{positions:e,normals:a,tangents:s,binormals:l})}function b(e,t,r){for(var n=e.length,o=t.normal?new Float32Array(n):void 0,a=t.tangent?new Float32Array(n):void 0,s=t.binormal?new Float32Array(n):void 0,l=0,u=0,c=0,h=!0,d=L,m=N,p=O,v=0;n>v;v+=6){var g=i.fromArray(e,v,R);if(t.normal||t.tangent||t.binormal){var _=i.fromArray(e,(v+6)%n,z);if(h){var y=i.fromArray(e,(v+3)%n,U);i.subtract(_,g,_),i.subtract(y,g,y),p=i.normalize(i.cross(y,_,p),p),h=!1}i.equalsEpsilon(_,g,f.EPSILON10)&&(h=!0),(t.tangent||t.binormal)&&(d=r.geodeticSurfaceNormal(g,d),t.tangent&&(m=i.normalize(i.cross(d,p,m),m))),t.normal&&(o[l++]=p.x,o[l++]=p.y,o[l++]=p.z,o[l++]=p.x,o[l++]=p.y,o[l++]=p.z),t.tangent&&(a[u++]=m.x,a[u++]=m.y,a[u++]=m.z,a[u++]=m.x,a[u++]=m.y,a[u++]=m.z),t.binormal&&(s[c++]=d.x,s[c++]=d.y,s[c++]=d.z,s[c++]=d.x,s[c++]=d.y,s[c++]=d.z)}}return T(t,{positions:e,normals:o,tangents:a,binormals:s})}function A(e){for(var t=e.vertexFormat,i=e.ellipsoid,r=e.size,o=e.height,a=e.width,s=t.position?new Float64Array(3*r):void 0,l=t.st?new Float32Array(2*r):void 0,u=0,h=0,d=R,m=B,f=Number.MAX_VALUE,v=Number.MAX_VALUE,g=Number.MIN_VALUE,_=Number.MIN_VALUE,y=0;o>y;++y)for(var C=0;a>C;++C)S.computePosition(e,y,C,d,m),s[u++]=d.x,s[u++]=d.y,s[u++]=d.z,t.st&&(l[h++]=m.x,l[h++]=m.y,f=Math.min(f,m.x),v=Math.min(v,m.y),g=Math.max(g,m.x),_=Math.max(_,m.y));if(t.st&&(0>f||0>v||g>1||_>1))for(var E=0;E<l.length;E+=2)l[E]=(l[E]-f)/(g-f),l[E+1]=(l[E+1]-v)/(_-v);for(var w=x(s,t,i,e.tangentRotationMatrix),T=6*(a-1)*(o-1),b=p.createTypedArray(r,T),A=0,P=0,I=0;o-1>I;++I){for(var M=0;a-1>M;++M){var D=A,O=D+a,N=O+1,L=D+1;b[P++]=D,b[P++]=O,b[P++]=L,b[P++]=L,b[P++]=O,b[P++]=N,++A}++A}return w.indices=b,t.st&&(w.attributes.st=new c({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:l})),w}function P(e,t,i,r,n){return e[t++]=r[i],e[t++]=r[i+1],e[t++]=r[i+2],e[t++]=n[i],e[t++]=n[i+1],e[t++]=n[i+2],e}function I(e,t,i,r){return e[t++]=r[i],e[t++]=r[i+1],e[t++]=r[i],e[t++]=r[i+1],e}function M(e){var t,r=e.vertexFormat,o=e.surfaceHeight,a=e.extrudedHeight,s=Math.min(a,o),l=Math.max(a,o),u=e.height,h=e.width,v=e.ellipsoid,g=A(e);if(f.equalsEpsilon(s,l,f.EPSILON10))return g;g=_.scaleToGeodeticHeight(g,l,v,!1);var y=new Float64Array(g.attributes.position.values),C=y.length,E=2*C,S=new Float64Array(E);S.set(y),g=_.scaleToGeodeticHeight(g,s,v);var w=g.attributes.position.values;S.set(w,C),g.attributes.position.values=S;var T,x=r.normal?new Float32Array(E):void 0,M=r.tangent?new Float32Array(E):void 0,D=r.binormal?new Float32Array(E):void 0,R=r.st?new Float32Array(E/3*2):void 0;if(r.normal){var O=g.attributes.normal.values;for(x.set(O),t=0;C>t;t++)O[t]=-O[t];x.set(O,C),g.attributes.normal.values=x}if(r.tangent){var N=g.attributes.tangent.values;for(M.set(N),t=0;C>t;t++)N[t]=-N[t];M.set(N,C),g.attributes.tangent.values=M}if(r.binormal){var L=g.attributes.binormal.values;D.set(L),D.set(L,C),g.attributes.binormal.values=D}r.st&&(T=g.attributes.st.values,R.set(T),R.set(T,C/3*2),g.attributes.st.values=R);var F=g.indices,B=F.length,V=C/3,k=p.createTypedArray(E/3,2*B);for(k.set(F),t=0;B>t;t+=3)k[t+B]=F[t+2]+V,k[t+1+B]=F[t+1]+V,k[t+2+B]=F[t]+V;g.indices=k;var G=2*h+2*u-4,W=2*(G+4),H=new Float64Array(3*W),q=r.st?new Float32Array(2*W):void 0,j=0,Y=0,X=h*u;for(t=0;X>t;t+=h)H=P(H,j,3*t,y,w),j+=6,r.st&&(q=I(q,Y,2*t,T),Y+=4);for(t=X-h;X>t;t++)H=P(H,j,3*t,y,w),j+=6,r.st&&(q=I(q,Y,2*t,T),Y+=4);for(t=X-1;t>0;t-=h)H=P(H,j,3*t,y,w),j+=6,r.st&&(q=I(q,Y,2*t,T),Y+=4);for(t=h-1;t>=0;t--)H=P(H,j,3*t,y,w),j+=6,r.st&&(q=I(q,Y,2*t,T),Y+=4);var Z=b(H,r,v);r.st&&(Z.attributes.st=new c({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:q}));var K,Q,J,$,ee=p.createTypedArray(W,6*G);C=H.length/3;var te=0;for(t=0;C-1>t;t+=2){K=t,$=(K+2)%C;var ie=i.fromArray(H,3*K,z),re=i.fromArray(H,3*$,U);i.equalsEpsilon(ie,re,f.EPSILON10)||(Q=(K+1)%C,J=(Q+2)%C,ee[te++]=K,ee[te++]=Q,ee[te++]=$,ee[te++]=$,ee[te++]=Q,ee[te++]=J)}return Z.indices=ee,Z=m.combineInstances([new d({geometry:g}),new d({geometry:Z})]),Z[0]}function D(e){e=o(e,o.EMPTY_OBJECT);var t=e.rectangle,i=o(e.granularity,f.RADIANS_PER_DEGREE),r=o(e.ellipsoid,l.WGS84),n=o(e.height,0),s=o(e.rotation,0),u=o(e.stRotation,0),c=o(e.vertexFormat,w.DEFAULT),h=e.extrudedHeight,d=a(h),m=o(e.closeTop,!0),p=o(e.closeBottom,!0);this._rectangle=t,this._granularity=i,this._ellipsoid=l.clone(r),this._surfaceHeight=n,this._rotation=s,this._stRotation=u,this._vertexFormat=w.clone(c),this._extrudedHeight=o(h,0),this._extrude=d,this._closeTop=m,this._closeBottom=p,this._workerName="createRectangleGeometry"}var R=new i,O=new i,N=new i,L=new i,F=new E,B=new t,V=new e,k=new e,z=new i,U=new i;D.packedLength=E.packedLength+l.packedLength+w.packedLength+8,D.pack=function(e,t,i){i=o(i,0),E.pack(e._rectangle,t,i),i+=E.packedLength,l.pack(e._ellipsoid,t,i),i+=l.packedLength,w.pack(e._vertexFormat,t,i),i+=w.packedLength,t[i++]=e._granularity,t[i++]=e._surfaceHeight,t[i++]=e._rotation,t[i++]=e._stRotation,t[i++]=e._extrudedHeight,t[i++]=e._extrude?1:0,t[i++]=e._closeTop?1:0,t[i]=e._closeBottom?1:0};var G=new E,W=l.clone(l.UNIT_SPHERE),H=new w,q={rectangle:G,ellipsoid:W,vertexFormat:H,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,closeTop:void 0,closeBottom:void 0};D.unpack=function(e,t,i){t=o(t,0);var r=E.unpack(e,t,G);t+=E.packedLength;var n=l.unpack(e,t,W);t+=l.packedLength;var s=w.unpack(e,t,H);t+=w.packedLength;var u=e[t++],c=e[t++],h=e[t++],d=e[t++],m=e[t++],p=1===e[t++],f=1===e[t++],v=1===e[t];return a(i)?(i._rectangle=E.clone(r,i._rectangle),i._ellipsoid=l.clone(n,i._ellipsoid),i._vertexFormat=w.clone(s,i._vertexFormat),i._granularity=u,i._surfaceHeight=c,i._rotation=h,i._stRotation=d,i._extrudedHeight=p?m:void 0,i._extrude=p,i._closeTop=f,i._closeBottom=v,i):(q.granularity=u,q.height=c,q.rotation=h,q.stRotation=d,q.extrudedHeight=p?m:void 0,q.closeTop=f,q.closeBottom=v,new D(q))};var j=new v,Y=new g,X=new r,Z=new C,K=new r;return D.createGeometry=function(t){var r=E.clone(t._rectangle,F),n=t._ellipsoid,o=t._surfaceHeight,s=t._extrude,l=t._extrudedHeight,c=t._stRotation,d=t._vertexFormat,m=S.computeOptions(t,r,X),p=j,f=Y;if(a(c)){v.fromRotation(-c,p);var y=E.center(r,K),w=n.cartographicToCartesian(y,z);i.normalize(w,w),C.fromAxisAngle(w,-c,Z),g.fromQuaternion(Z,f)}else v.clone(v.IDENTITY,p),g.clone(g.IDENTITY,f);m.lonScalar=1/r.width,m.latScalar=1/r.height,m.vertexFormat=d,m.textureMatrix=p,m.tangentRotationMatrix=f,m.size=m.width*m.height;var T,x;if(r=t._rectangle,s){T=M(m);var b=e.fromRectangle3D(r,n,o,k),P=e.fromRectangle3D(r,n,l,V);x=e.union(b,P)}else T=A(m),T=_.scaleToGeodeticHeight(T,o,n,!1),x=e.fromRectangle3D(r,n,o);return d.position||delete T.attributes.position,new u({attributes:new h(T.attributes),indices:T.indices,primitiveType:T.primitiveType,boundingSphere:x})},D.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new D({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:n,stRotation:e._stRotation,granularity:r,extrudedHeight:a,height:o,closeTop:!0,closeBottom:!0,vertexFormat:w.POSITION_ONLY})},D}),i("Core/RectangleOutlineGeometry",["./BoundingSphere","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Rectangle","./RectangleGeometryLibrary"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v){"use strict";function g(e){var t,i=e.size,n=e.height,o=e.width,a=new Float64Array(3*i),s=0,d=0,m=S;for(t=0;o>t;t++)v.computePosition(e,d,t,m),a[s++]=m.x,a[s++]=m.y,a[s++]=m.z;for(t=o-1,d=1;n>d;d++)v.computePosition(e,d,t,m),a[s++]=m.x,a[s++]=m.y,a[s++]=m.z;for(d=n-1,t=o-2;t>=0;t--)v.computePosition(e,d,t,m),a[s++]=m.x,a[s++]=m.y,a[s++]=m.z;for(t=0,d=n-2;d>0;d--)v.computePosition(e,d,t,m),a[s++]=m.x,a[s++]=m.y,a[s++]=m.z;for(var f=a.length/3*2,g=h.createTypedArray(a.length/3,f),_=0,y=0;y<a.length/3-1;y++)g[_++]=y,g[_++]=y+1;g[_++]=a.length/3-1,g[_++]=0;var C=new l({attributes:new c,primitiveType:p.LINES});return C.attributes.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:a}),C.indices=g,C}function _(e){var t=e.surfaceHeight,i=e.extrudedHeight,r=e.ellipsoid,n=Math.min(i,t),o=Math.max(i,t),a=g(e);if(d.equalsEpsilon(n,o,d.EPSILON10))return a;var s=e.height,l=e.width;a=m.scaleToGeodeticHeight(a,o,r,!1);var u=a.attributes.position.values,c=u.length,p=new Float64Array(2*c);p.set(u),a=m.scaleToGeodeticHeight(a,n,r);var f=a.attributes.position.values;p.set(f,c),a.attributes.position.values=p;var v=p.length/3*2+8,_=h.createTypedArray(p.length/3,v);c=p.length/6;for(var y=0,C=0;c-1>C;C++)_[y++]=C,_[y++]=C+1,_[y++]=C+c,_[y++]=C+c+1;return _[y++]=c-1,_[y++]=0,_[y++]=c+c-1,_[y++]=c,_[y++]=0,_[y++]=c,_[y++]=l-1,_[y++]=c+l-1,_[y++]=l+s-2,_[y++]=l+s-2+c,_[y++]=2*l+s-3,_[y++]=2*l+s-3+c,a.indices=_,a}function y(e){e=n(e,n.EMPTY_OBJECT);var t=e.rectangle,i=n(e.granularity,d.RADIANS_PER_DEGREE),r=n(e.ellipsoid,s.WGS84),o=n(e.height,0),a=n(e.rotation,0),l=e.extrudedHeight;this._rectangle=t,this._granularity=i,this._ellipsoid=r,this._surfaceHeight=o,this._rotation=a,this._extrudedHeight=l,this._workerName="createRectangleOutlineGeometry"}var C=new e,E=new e,S=new t,w=new f;y.packedLength=f.packedLength+s.packedLength+5,y.pack=function(e,t,i){i=n(i,0),f.pack(e._rectangle,t,i),i+=f.packedLength,s.pack(e._ellipsoid,t,i),i+=s.packedLength,t[i++]=e._granularity,t[i++]=e._surfaceHeight,t[i++]=e._rotation,t[i++]=o(e._extrudedHeight)?1:0,t[i]=n(e._extrudedHeight,0)};var T=new f,x=s.clone(s.UNIT_SPHERE),b={rectangle:T,ellipsoid:x,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0};y.unpack=function(e,t,i){t=n(t,0);var r=f.unpack(e,t,T);t+=f.packedLength;var a=s.unpack(e,t,x);t+=s.packedLength;var l=e[t++],u=e[t++],c=e[t++],h=e[t++],d=e[t];return o(i)?(i._rectangle=f.clone(r,i._rectangle),i._ellipsoid=s.clone(a,i._ellipsoid),i._surfaceHeight=u,i._rotation=c,i._extrudedHeight=h?d:void 0,i):(b.granularity=l,b.height=u,b.rotation=c,b.extrudedHeight=h?d:void 0,new y(b))};var A=new i;return y.createGeometry=function(t){var i=f.clone(t._rectangle,w),r=t._ellipsoid,n=t._surfaceHeight,a=t._extrudedHeight,s=v.computeOptions(t,i,A);s.size=2*s.width+2*s.height-4;var u,c;if(i=t._rectangle,o(a)){u=_(s);var h=e.fromRectangle3D(i,r,n,E),d=e.fromRectangle3D(i,r,a,C);c=e.union(h,d)}else u=g(s),u=m.scaleToGeodeticHeight(u,n,r,!1),c=e.fromRectangle3D(i,r,n);return new l({attributes:u.attributes,indices:u.indices,primitiveType:p.LINES,boundingSphere:c})},y}),i("Core/ReferenceFrame",["./freezeObject"],function(e){"use strict";var t={FIXED:0,INERTIAL:1};return e(t)}),i("Core/requestAnimationFrame",["./defined","./getTimestamp"],function(e,t){"use strict";function i(e){return r(e)}if("undefined"!=typeof window){var r=window.requestAnimationFrame;return function(){if(!e(r))for(var i=["webkit","moz","ms","o"],n=0,o=i.length;o>n&&!e(r);)r=window[i[n]+"RequestAnimationFrame"],++n;if(!e(r)){var a=1e3/60,s=0;r=function(e){var i=t(),r=Math.max(a-(i-s),0);return s=i+r,setTimeout(function(){e(s)},r)}}}(),i}}),i("Core/sampleTerrain",["../ThirdParty/when","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t,i,r){function o(){t.ready?e(n(t,i,r),function(e){a.resolve(e)}):setTimeout(o,10)}var a=e.defer();return o(),a.promise}function n(t,i,r){var n,s=t.tilingScheme,l=[],u={};for(n=0;n<r.length;++n){var c=s.positionToTileXY(r[n],i),h=c.toString();if(!u.hasOwnProperty(h)){var d={x:c.x,y:c.y,level:i,tilingScheme:s,terrainProvider:t,positions:[]};u[h]=d,l.push(d)}u[h].positions.push(r[n])}var m=[];for(n=0;n<l.length;++n){var p=l[n],f=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level,!1),v=e(f,o(p),a(p));m.push(v)}return e.all(m,function(){return r})}function o(e){var t=e.positions,i=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(e){for(var r=0;r<t.length;++r){var n=t[r];n.height=e.interpolateHeight(i,n.longitude,n.latitude)}}}function a(e){var t=e.positions;return function(){for(var e=0;e<t.length;++e){var i=t[e];i.height=void 0}}}return r}),i("Core/ScreenSpaceEventType",["./freezeObject"],function(e){"use strict";var t={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,RIGHT_DOUBLE_CLICK:8,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MIDDLE_DOUBLE_CLICK:13,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19};return e(t)}),i("Core/ScreenSpaceEventHandler",["./AssociativeArray","./Cartesian2","./defaultValue","./defined","./destroyObject","./DeveloperError","./FeatureDetection","./KeyboardEventModifier","./ScreenSpaceEventType"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e,t,i){var r=e._element;if(r===document)return i.x=t.clientX,i.y=t.clientY,i;var n=r.getBoundingClientRect();return i.x=t.clientX-n.left,i.y=t.clientY-n.top,i}function c(e,t){var i=e;return r(t)&&(i+="+"+t),i}function h(e){return e.shiftKey?s.SHIFT:e.ctrlKey?s.CTRL:e.altKey?s.ALT:void 0}function d(e,t,i,r){function n(t){r(e,t)}i.addEventListener(t,n,!1),e._removalFunctions.push(function(){i.removeEventListener(t,n,!1)})}function m(e){var t=e._element,i=r(t.disableRootEvents)?t:document;a.supportsPointerEvents()?(d(e,"pointerdown",t,x),d(e,"pointerup",t,b),d(e,"pointermove",t,A)):(d(e,"mousedown",t,f),d(e,"mouseup",i,v),d(e,"mousemove",i,g),d(e,"touchstart",t,C),d(e,"touchend",i,E),d(e,"touchmove",i,w)),d(e,"dblclick",t,_);var n;n="onwheel"in t?"wheel":r(document.onmousewheel)?"mousewheel":"DOMMouseScroll",d(e,n,t,y)}function p(e){for(var t=e._removalFunctions,i=0;i<t.length;++i)t[i]()}function f(e,i){if(!e._seenAnyTouchEvents){var n=i.button;e._buttonDown=n;var o;if(n===I.LEFT)o=l.LEFT_DOWN;else if(n===I.MIDDLE)o=l.MIDDLE_DOWN;else{if(n!==I.RIGHT)return;o=l.RIGHT_DOWN}var a=u(e,i,e._primaryPosition);t.clone(a,e._primaryStartPosition),t.clone(a,e._primaryPreviousPosition);var s=h(i),c=e.getInputAction(o,s);r(c)&&(t.clone(a,M.position),c(M),i.preventDefault())}}function v(e,i){if(!e._seenAnyTouchEvents){var n=i.button;e._buttonDown=void 0;var o,a;if(n===I.LEFT)o=l.LEFT_UP,a=l.LEFT_CLICK;else if(n===I.MIDDLE)o=l.MIDDLE_UP,a=l.MIDDLE_CLICK;else{if(n!==I.RIGHT)return;o=l.RIGHT_UP,a=l.RIGHT_CLICK}var s=h(i),c=e.getInputAction(o,s),d=e.getInputAction(a,s);if(r(c)||r(d)){var m=u(e,i,e._primaryPosition);if(r(c)&&(t.clone(m,D.position),c(D)),r(d)){var p=e._primaryStartPosition,f=p.x-m.x,v=p.y-m.y,g=Math.sqrt(f*f+v*v);g<e._clickPixelTolerance&&(t.clone(m,R.position),d(R))}}}}function g(e,i){if(!e._seenAnyTouchEvents){var n=h(i),o=u(e,i,e._primaryPosition),a=e._primaryPreviousPosition,s=e.getInputAction(l.MOUSE_MOVE,n);r(s)&&(t.clone(a,O.startPosition),t.clone(o,O.endPosition),s(O)),t.clone(o,a),r(e._buttonDown)&&i.preventDefault()}}function _(e,t){var i,n=t.button;if(n===I.LEFT)i=l.LEFT_DOUBLE_CLICK;else if(n===I.MIDDLE)i=l.MIDDLE_DOUBLE_CLICK;else{if(n!==I.RIGHT)return;i=l.RIGHT_DOUBLE_CLICK}var o=h(t),a=e.getInputAction(i,o);r(a)&&(u(e,t,N.position),a(N))}function y(e,t){var i;if(r(t.deltaY)){var n=t.deltaMode;i=n===t.DOM_DELTA_PIXEL?-t.deltaY:n===t.DOM_DELTA_LINE?40*-t.deltaY:120*-t.deltaY}else i=t.detail>0?-120*t.detail:t.wheelDelta;if(r(i)){var o=h(t),a=e.getInputAction(l.WHEEL,o);r(a)&&(a(i),t.preventDefault())}}function C(e,i){e._seenAnyTouchEvents=!0;var r,n,o,a=i.changedTouches,s=a.length,l=e._positions;for(r=0;s>r;++r)n=a[r],o=n.identifier,l.set(o,u(e,n,new t));S(e,i);var c=e._previousPositions;for(r=0;s>r;++r)n=a[r],o=n.identifier,c.set(o,t.clone(l.get(o)))}function E(e,t){e._seenAnyTouchEvents=!0;var i,r,n,o=t.changedTouches,a=o.length,s=e._positions;for(i=0;a>i;++i)r=o[i],n=r.identifier,s.remove(n);S(e,t);var l=e._previousPositions;for(i=0;a>i;++i)r=o[i],n=r.identifier,l.remove(n)}function S(e,i){var n,o,a=h(i),s=e._positions,u=e._previousPositions,c=s.length;if(1!==c&&e._buttonDown===I.LEFT&&(e._buttonDown=void 0,n=e.getInputAction(l.LEFT_UP,a),r(n)&&(t.clone(e._primaryPosition,B.position),n(B)),0===c&&(o=e.getInputAction(l.LEFT_CLICK,a),r(o)))){var d=e._primaryStartPosition,m=u.values[0],p=d.x-m.x,f=d.y-m.y,v=Math.sqrt(p*p+f*f);v<e._clickPixelTolerance&&(t.clone(e._primaryPosition,V.position),o(V))}if(2!==c&&e._isPinching&&(e._isPinching=!1,n=e.getInputAction(l.PINCH_END,a),r(n)&&n()),1===c){var g=s.values[0];t.clone(g,e._primaryPosition),t.clone(g,e._primaryStartPosition),t.clone(g,e._primaryPreviousPosition),e._buttonDown=I.LEFT,n=e.getInputAction(l.LEFT_DOWN,a),r(n)&&(t.clone(g,L.position),n(L)),i.preventDefault()}2===c&&(e._isPinching=!0,n=e.getInputAction(l.PINCH_START,a),r(n)&&(t.clone(s.values[0],F.position1),t.clone(s.values[1],F.position2),n(F)))}function w(e,i){e._seenAnyTouchEvents=!0;var n,o,a,s=i.changedTouches,l=s.length,c=e._positions;for(n=0;l>n;++n){o=s[n],a=o.identifier;var h=c.get(a);r(h)&&u(e,o,h)}T(e,i);var d=e._previousPositions;for(n=0;l>n;++n)o=s[n],a=o.identifier,t.clone(c.get(a),d.get(a))}function T(e,i){var n,o=h(i),a=e._positions,s=e._previousPositions,u=a.length;if(1===u&&e._buttonDown===I.LEFT){var c=a.values[0];t.clone(c,e._primaryPosition);var d=e._primaryPreviousPosition;n=e.getInputAction(l.MOUSE_MOVE,o),r(n)&&(t.clone(d,k.startPosition),t.clone(c,k.endPosition),n(k)),t.clone(c,d),i.preventDefault()}else if(2===u&&e._isPinching&&(n=e.getInputAction(l.PINCH_MOVE,o),r(n))){var m=a.values[0],p=a.values[1],f=s.values[0],v=s.values[1],g=p.x-m.x,_=p.y-m.y,y=.25*Math.sqrt(g*g+_*_),C=v.x-f.x,E=v.y-f.y,S=.25*Math.sqrt(C*C+E*E),w=.125*(p.y+m.y),T=.125*(v.y+f.y),x=Math.atan2(_,g),b=Math.atan2(E,C);t.fromElements(0,S,z.distance.startPosition),t.fromElements(0,y,z.distance.endPosition),t.fromElements(b,T,z.angleAndHeight.startPosition),t.fromElements(x,w,z.angleAndHeight.endPosition),n(z)}}function x(e,i){if(i.target.setPointerCapture(i.pointerId),"touch"===i.pointerType){var r=e._positions,n=i.pointerId;r.set(n,u(e,i,new t)),S(e,i);var o=e._previousPositions;o.set(n,t.clone(r.get(n)))}else f(e,i)}function b(e,t){if("touch"===t.pointerType){var i=e._positions,r=t.pointerId;i.remove(r),S(e,t);var n=e._previousPositions;n.remove(r)}else v(e,t)}function A(e,i){if("touch"===i.pointerType){var r=e._positions,n=i.pointerId;u(e,i,r.get(n)),T(e,i);var o=e._previousPositions;t.clone(r.get(n),o.get(n))}else g(e,i)}function P(r){this._inputEvents={},this._buttonDown=void 0,this._isPinching=!1,this._seenAnyTouchEvents=!1,this._primaryStartPosition=new t,this._primaryPosition=new t,this._primaryPreviousPosition=new t,this._positions=new e,this._previousPositions=new e,this._removalFunctions=[],this._clickPixelTolerance=5,this._element=i(r,document),m(this)}var I={LEFT:0,MIDDLE:1,RIGHT:2},M={position:new t},D={position:new t},R={position:new t},O={startPosition:new t,endPosition:new t},N={position:new t},L={position:new t},F={position1:new t,position2:new t},B={position:new t},V={position:new t},k={startPosition:new t,endPosition:new t},z={distance:{startPosition:new t,endPosition:new t},angleAndHeight:{startPosition:new t,endPosition:new t}};return P.prototype.setInputAction=function(e,t,i){var r=c(t,i);this._inputEvents[r]=e},P.prototype.getInputAction=function(e,t){var i=c(e,t);return this._inputEvents[i]},P.prototype.removeInputAction=function(e,t){var i=c(e,t);delete this._inputEvents[i]},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){return p(this),n(this)},P}),i("Core/ShowGeometryInstanceAttribute",["./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,i,r,n){"use strict";function o(e){e=t(e,!0),this.value=o.toValue(e)}return r(o.prototype,{componentDatatype:{get:function(){return e.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}}),o.toValue=function(e,t){return i(t)?(t[0]=e,t):new Uint8Array([e])},o}),i("Core/Simon1994PlanetaryPositions",["./Cartesian3","./defined","./DeveloperError","./JulianDate","./Math","./Matrix3","./TimeConstants","./TimeStandard"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){var t=6.239996+.0172019696544*e;return.001657*Math.sin(t+.01671*Math.sin(t))}function u(e,t){t=r.addSeconds(e,C,t);var i=r.totalDays(t)-E;return t=r.addSeconds(t,l(i),t)}function c(r,a,s,l,u,c,m,p){if(0>s&&(s=-s,u+=n.PI),0>s||s>n.PI)throw new i("The inclination is out of range. Inclination must be greater than or equal to zero and less than or equal to Pi radians.");var v=r*(1-a),g=l-u,_=u,y=d(c-l,a),C=h(a,0);if("Hyperbolic"===C&&Math.abs(n.negativePiToPi(y))>=Math.acos(-1/a))throw new i("The true anomaly of the hyperbolic orbit lies outside of the bounds of the hyperbola.");f(g,s,_,I);var E=v*(1+a),S=Math.cos(y),w=Math.sin(y),T=1+a*S;if(T<=n.Epsilon10)throw new i("elements cannot be converted to cartesian");var x=E/T;return t(p)?(p.x=x*S,p.y=x*w,p.z=0):p=new e(x*S,x*w,0),o.multiplyByVector(I,p,p)}function h(e,t){if(0>e)throw new i("eccentricity cannot be negative.");return t>=e?"Circular":1-t>e?"Elliptical":1+t>=e?"Parabolic":"Hyperbolic"}function d(e,t){if(0>t||t>=1)throw new i("eccentricity out of range.");var r=m(e,t);return p(r,t)}function m(e,t){if(0>t||t>=1)throw new i("eccentricity out of range.");var r=Math.floor(e/n.TWO_PI);e-=r*n.TWO_PI;var o,a=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),s=Number.MAX_VALUE;for(o=0;M>o&&Math.abs(s-a)>D;++o){s=a;var l=s-t*Math.sin(s)-e,u=1-t*Math.cos(s);a=s-l/u}if(o>=M)throw new i("Kepler equation did not converge");return s=a+r*n.TWO_PI}function p(e,t){if(0>t||t>=1)throw new i("eccentricity out of range.");var r=Math.floor(e/n.TWO_PI);e-=r*n.TWO_PI;var o=Math.cos(e)-t,a=Math.sin(e)*Math.sqrt(1-t*t),s=Math.atan2(a,o);return s=n.zeroToTwoPi(s),0>e&&(s-=n.TWO_PI),s+=r*n.TWO_PI}function f(e,r,a,s){if(0>r||r>n.PI)throw new i("inclination out of range");var l=Math.cos(e),u=Math.sin(e),c=Math.cos(r),h=Math.sin(r),d=Math.cos(a),m=Math.sin(a);return t(s)?(s[0]=d*l-m*u*c,s[1]=m*l+d*u*c,s[2]=u*h,s[3]=-d*u-m*l*c,s[4]=-m*u+d*l*c,s[5]=l*h,s[6]=m*h,s[7]=-d*h,s[8]=c):s=new o(d*l-m*u*c,-d*u-m*l*c,m*h,m*l+d*u*c,-m*u+d*l*c,-d*h,u*h,l*h,c),s}function v(e,t){u(e,Ie);var i=Ie.dayNumber-S.dayNumber+(Ie.secondsOfDay-S.secondsOfDay)/a.SECONDS_PER_DAY,r=i/(10*a.DAYS_PER_JULIAN_CENTURY),n=.3595362*r,o=R+W*Math.cos(L*n)+Q*Math.sin(L*n)+H*Math.cos(F*n)+J*Math.sin(F*n)+q*Math.cos(B*n)+$*Math.sin(B*n)+j*Math.cos(V*n)+ee*Math.sin(V*n)+Y*Math.cos(k*n)+te*Math.sin(k*n)+X*Math.cos(z*n)+ie*Math.sin(z*n)+Z*Math.cos(U*n)+re*Math.sin(U*n)+K*Math.cos(G*n)+ne*Math.sin(G*n),s=O+N*r+me*Math.cos(oe*n)+Ee*Math.sin(oe*n)+pe*Math.cos(ae*n)+Se*Math.sin(ae*n)+fe*Math.cos(se*n)+we*Math.sin(se*n)+ve*Math.cos(le*n)+Te*Math.sin(le*n)+ge*Math.cos(ue*n)+xe*Math.sin(ue*n)+_e*Math.cos(ce*n)+be*Math.sin(ce*n)+ye*Math.cos(he*n)+Ae*Math.sin(he*n)+Ce*Math.cos(de*n)+Pe*Math.sin(de*n),l=.0167086342-.0004203654*r,h=102.93734808*b+11612.3529*A*r,d=469.97289*A*r,m=174.87317577*b-8679.27034*A*r;return c(o,l,d,h,m,s,T,t)}function g(e,t){u(e,Ie);var i=Ie.dayNumber-S.dayNumber+(Ie.secondsOfDay-S.secondsOfDay)/a.SECONDS_PER_DAY,r=i/a.DAYS_PER_JULIAN_CENTURY,n=r*r,o=n*r,s=o*r,l=383397.7725+.004*r,h=.055545526-1.6e-8*r,d=5.15668983*b,m=-8e-5*r+.02966*n-42e-6*o-1.3e-7*s,p=83.35324312*b,f=14643420.2669*r-38.2702*n-.045047*o+21301e-8*s,v=125.04455501*b,g=-6967919.3631*r+6.3602*n+.007625*o-3586e-8*s,_=218.31664563*b,y=1732559343.4847*r-6.391*n+.006588*o-3169e-8*s,C=297.85019547*b+A*(1602961601.209*r-6.3706*n+.006593*o-3169e-8*s),E=93.27209062*b+A*(1739527262.8478*r-12.7512*n-.001037*o+417e-8*s),T=134.96340251*b+A*(1717915923.2178*r+31.8792*n+.051635*o-2447e-7*s),P=357.52910918*b+A*(129596581.0481*r-.5532*n+136e-6*o-1149e-8*s),I=310.17137918*b-A*(6967051.436*r+6.2068*n+.007618*o-3219e-8*s),M=2*C,D=4*C,R=6*C,O=2*T,N=3*T,L=4*T,F=2*E; +l+=3400.4*Math.cos(M)-635.6*Math.cos(M-T)-235.6*Math.cos(T)+218.1*Math.cos(M-P)+181*Math.cos(M+T),h+=.014216*Math.cos(M-T)+.008551*Math.cos(M-O)-.001383*Math.cos(T)+.001356*Math.cos(M+T)-.001147*Math.cos(D-N)-914e-6*Math.cos(D-O)+869e-6*Math.cos(M-P-T)-627e-6*Math.cos(M)-394e-6*Math.cos(D-L)+282e-6*Math.cos(M-P-O)-279e-6*Math.cos(C-T)-236e-6*Math.cos(O)+231e-6*Math.cos(D)+229e-6*Math.cos(R-L)-201e-6*Math.cos(O-F),m+=486.26*Math.cos(M-F)-40.13*Math.cos(M)+37.51*Math.cos(F)+25.73*Math.cos(O-F)+19.97*Math.cos(M-P-F),f+=-55609*Math.sin(M-T)-34711*Math.sin(M-O)-9792*Math.sin(T)+9385*Math.sin(D-N)+7505*Math.sin(D-O)+5318*Math.sin(M+T)+3484*Math.sin(D-L)-3417*Math.sin(M-P-T)-2530*Math.sin(R-L)-2376*Math.sin(M)-2075*Math.sin(M-N)-1883*Math.sin(O)-1736*Math.sin(R-5*T)+1626*Math.sin(P)-1370*Math.sin(R-N),g+=-5392*Math.sin(M-F)-540*Math.sin(P)-441*Math.sin(M)+423*Math.sin(F)-288*Math.sin(O-F),y+=-3332.9*Math.sin(M)+1197.4*Math.sin(M-T)-662.5*Math.sin(P)+396.3*Math.sin(T)-218*Math.sin(M-P);var B=2*I,V=3*I;m+=46.997*Math.cos(I)*r-.614*Math.cos(M-F+I)*r+.614*Math.cos(M-F-I)*r-.0297*Math.cos(B)*n-.0335*Math.cos(I)*n+.0012*Math.cos(M-F+B)*n-16e-5*Math.cos(I)*o+4e-5*Math.cos(V)*o+4e-5*Math.cos(B)*o;var k=2.116*Math.sin(I)*r-.111*Math.sin(M-F-I)*r-.0015*Math.sin(I)*n;f+=k,y+=k,g+=-520.77*Math.sin(I)*r+13.66*Math.sin(M-F+I)*r+1.12*Math.sin(M-I)*r-1.06*Math.sin(F-I)*r+.66*Math.sin(B)*n+.371*Math.sin(I)*n-.035*Math.sin(M-F+B)*n-.015*Math.sin(M-F+I)*n+.0014*Math.sin(I)*o-.0011*Math.sin(V)*o-9e-4*Math.sin(B)*o,l*=x;var z=d+m*A,U=p+f*A,G=_+y*A,W=v+g*A;return c(l,h,z,U,W,G,w,t)}function _(t,i){return i=g(t,i),e.multiplyByScalar(i,De,i)}var y={},C=32.184,E=2451545,S=new r(2451545,0,s.TAI),w=398600435e6,T=1.012300034*w*328900.56,x=1e3,b=n.RADIANS_PER_DEGREE,A=n.RADIANS_PER_ARCSECOND,P=14959787e4,I=new o,M=50,D=n.EPSILON8,R=1.0000010178*P,O=100.46645683*b,N=1295977422.83429*A,L=16002,F=21863,B=32004,V=10931,k=14529,z=16368,U=15318,G=32794,W=64e-7*P,H=-152*1e-7*P,q=62e-7*P,j=-8e-7*P,Y=32e-7*P,X=-41*1e-7*P,Z=19e-7*P,K=-11*1e-7*P,Q=-150*1e-7*P,J=-46*1e-7*P,$=68*1e-7*P,ee=54e-7*P,te=14e-7*P,ie=24e-7*P,re=-28*1e-7*P,ne=22e-7*P,oe=10,ae=16002,se=21863,le=10931,ue=1473,ce=32004,he=4387,de=73,me=-325*1e-7,pe=-322*1e-7,fe=-79*1e-7,ve=232*1e-7,ge=-52*1e-7,_e=97e-7,ye=55e-7,Ce=-41*1e-7,Ee=-105*1e-7,Se=-137*1e-7,we=258e-7,Te=35e-7,xe=-116*1e-7,be=-88*1e-7,Ae=-112*1e-7,Pe=-80*1e-7,Ie=new r(0,0,s.TAI),Me=.012300034,De=Me/(Me+1)*-1,Re=new o(1.0000000000000002,5.619723173785822e-16,4.690511510146299e-19,-5.154129427414611e-16,.9174820620691819,-.39777715593191376,-2.23970096136568e-16,.39777715593191376,.9174820620691819),Oe=new e;return y.computeSunPositionInEarthInertialFrame=function(i,n){return t(i)||(i=r.now()),t(n)||(n=new e),Oe=v(i,Oe),n=e.negate(Oe,n),_(i,Oe),e.subtract(n,Oe,n),o.multiplyByVector(Re,n,n),n},y.computeMoonPositionInEarthInertialFrame=function(e,i){return t(e)||(e=r.now()),i=g(e,i),o.multiplyByVector(Re,i,i),i},y}),i("Core/SimplePolylineGeometry",["./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(e,t,r,n,o,a,s){var l,u=m.numberOfPoints(e,t,o),c=r.red,h=r.green,d=r.blue,p=r.alpha,f=n.red,v=n.green,g=n.blue,_=n.alpha;if(i.equals(r,n)){for(l=0;u>l;l++)a[s++]=i.floatToByte(c),a[s++]=i.floatToByte(h),a[s++]=i.floatToByte(d),a[s++]=i.floatToByte(p);return s}var y=(f-c)/u,C=(v-h)/u,E=(g-d)/u,S=(_-p)/u,w=s;for(l=0;u>l;l++)a[w++]=i.floatToByte(c+l*y),a[w++]=i.floatToByte(h+l*C),a[w++]=i.floatToByte(d+l*E),a[w++]=i.floatToByte(p+l*S);return w}function v(e){e=n(e,n.EMPTY_OBJECT);var r=e.positions,a=e.colors,l=n(e.colorsPerVertex,!1);this._positions=r,this._colors=a,this._colorsPerVertex=l,this._followSurface=n(e.followSurface,!0),this._granularity=n(e.granularity,d.RADIANS_PER_DEGREE),this._ellipsoid=n(e.ellipsoid,s.WGS84),this._workerName="createSimplePolylineGeometry";var u=1+r.length*t.packedLength;u+=o(a)?1+a.length*i.packedLength:1,this.packedLength=u+s.packedLength+3}v.pack=function(e,r,a){a=n(a,0);var l,u=e._positions,c=u.length;for(r[a++]=c,l=0;c>l;++l,a+=t.packedLength)t.pack(u[l],r,a);var h=e._colors;for(c=o(h)?h.length:0,r[a++]=c,l=0;c>l;++l,a+=i.packedLength)i.pack(h[l],r,a);s.pack(e._ellipsoid,r,a),a+=s.packedLength,r[a++]=e._colorsPerVertex?1:0,r[a++]=e._followSurface?1:0,r[a]=e._granularity},v.unpack=function(e,r,a){r=n(r,0);var l,u=e[r++],c=new Array(u);for(l=0;u>l;++l,r+=t.packedLength)c[l]=t.unpack(e,r);u=e[r++];var h=u>0?new Array(u):void 0;for(l=0;u>l;++l,r+=i.packedLength)h[l]=i.unpack(e,r);var d=s.unpack(e,r);r+=s.packedLength;var m=1===e[r++],p=1===e[r++],f=e[r];return o(a)?(a._positions=c,a._colors=h,a._ellipsoid=d,a._colorsPerVertex=m,a._followSurface=p,a._granularity=f,a):new v({positions:c,colors:h,ellipsoid:d,colorsPerVertex:m,followSurface:p,granularity:f})};var g=new Array(2),_=new Array(2),y={positions:g,height:_,ellipsoid:void 0,minDistance:void 0};return v.createGeometry=function(n){var a,s,v,C,E,S=n._positions,w=n._colors,T=n._colorsPerVertex,x=n._followSurface,b=n._granularity,A=n._ellipsoid,P=d.chordLength(b,A.maximumRadius),I=o(w)&&!T,M=S.length,D=0;if(x){var R=m.extractHeights(S,A),O=y;if(O.minDistance=P,O.ellipsoid=A,I){var N=0;for(a=0;M-1>a;a++)N+=m.numberOfPoints(S[a],S[a+1],P)+1;s=new Float64Array(3*N),C=new Uint8Array(4*N),O.positions=g,O.height=_;var L=0;for(a=0;M-1>a;++a){g[0]=S[a],g[1]=S[a+1],_[0]=R[a],_[1]=R[a+1];var F=m.generateArc(O);if(o(w)){var B=F.length/3;E=w[a];for(var V=0;B>V;++V)C[L++]=i.floatToByte(E.red),C[L++]=i.floatToByte(E.green),C[L++]=i.floatToByte(E.blue),C[L++]=i.floatToByte(E.alpha)}s.set(F,D),D+=F.length}}else if(O.positions=S,O.height=R,s=new Float64Array(m.generateArc(O)),o(w)){for(C=new Uint8Array(s.length/3*4),a=0;M-1>a;++a){var k=S[a],z=S[a+1],U=w[a],G=w[a+1];D=f(k,z,U,G,P,C,D)}var W=w[M-1];C[D++]=i.floatToByte(W.red),C[D++]=i.floatToByte(W.green),C[D++]=i.floatToByte(W.blue),C[D++]=i.floatToByte(W.alpha)}}else{v=I?2*M-2:M,s=new Float64Array(3*v),C=o(w)?new Uint8Array(4*v):void 0;var H=0,q=0;for(a=0;M>a;++a){var j=S[a];if(I&&a>0&&(t.pack(j,s,H),H+=3,E=w[a-1],C[q++]=i.floatToByte(E.red),C[q++]=i.floatToByte(E.green),C[q++]=i.floatToByte(E.blue),C[q++]=i.floatToByte(E.alpha)),I&&a===M-1)break;t.pack(j,s,H),H+=3,o(w)&&(E=w[a],C[q++]=i.floatToByte(E.red),C[q++]=i.floatToByte(E.green),C[q++]=i.floatToByte(E.blue),C[q++]=i.floatToByte(E.alpha))}}var Y=new c;Y.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:s}),o(w)&&(Y.color=new u({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:4,values:C,normalize:!0})),v=s.length/3;var X=2*(v-1),Z=h.createTypedArray(v,X),K=0;for(a=0;v-1>a;++a)Z[K++]=a,Z[K++]=a+1;return new l({attributes:Y,indices:Z,primitiveType:p.LINES,boundingSphere:e.fromPoints(S)})},v}),i("Core/SphereGeometry",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./EllipsoidGeometry","./VertexFormat"],function(e,t,i,r,n,o){"use strict";function a(i){var r=t(i.radius,1),o=new e(r,r,r),a={radii:o,stackPartitions:i.stackPartitions,slicePartitions:i.slicePartitions,vertexFormat:i.vertexFormat};this._ellipsoidGeometry=new n(a),this._workerName="createSphereGeometry"}a.packedLength=n.packedLength,a.pack=function(e,t,i){n.pack(e._ellipsoidGeometry,t,i)};var s=new n,l={radius:void 0,radii:new e,vertexFormat:new o,stackPartitions:void 0,slicePartitions:void 0};return a.unpack=function(t,r,u){var c=n.unpack(t,r,s);return l.vertexFormat=o.clone(c._vertexFormat,l.vertexFormat),l.stackPartitions=c._stackPartitions,l.slicePartitions=c._slicePartitions,i(u)?(e.clone(c._radii,l.radii),u._ellipsoidGeometry=new n(l),u):(l.radius=c._radii.x,new a(l))},a.createGeometry=function(e){return n.createGeometry(e._ellipsoidGeometry)},a}),i("Core/SphereOutlineGeometry",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./EllipsoidOutlineGeometry"],function(e,t,i,r,n){"use strict";function o(i){var r=t(i.radius,1),o=new e(r,r,r),a={radii:o,stackPartitions:i.stackPartitions,slicePartitions:i.slicePartitions,subdivisions:i.subdivisions};this._ellipsoidGeometry=new n(a),this._workerName="createSphereOutlineGeometry"}o.packedLength=n.packedLength,o.pack=function(e,t,i){n.pack(e._ellipsoidGeometry,t,i)};var a=new n,s={radius:void 0,radii:new e,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return o.unpack=function(t,r,l){var u=n.unpack(t,r,a);return s.stackPartitions=u._stackPartitions,s.slicePartitions=u._slicePartitions,s.subdivisions=u._subdivisions,i(l)?(e.clone(u._radii,s.radii),l._ellipsoidGeometry=new n(s),l):(s.radius=u._radii.x,new o(s))},o.createGeometry=function(e){return n.createGeometry(e._ellipsoidGeometry)},o}),i("Core/Spherical",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t,i,r){this.clock=e(t,0),this.cone=e(i,0),this.magnitude=e(r,1)}return r.fromCartesian3=function(e,i){var n=e.x,o=e.y,a=e.z,s=n*n+o*o;return t(i)||(i=new r),i.clock=Math.atan2(o,n),i.cone=Math.atan2(Math.sqrt(s),a),i.magnitude=Math.sqrt(s+a*a),i},r.clone=function(e,i){return t(e)?t(i)?(i.clock=e.clock,i.cone=e.cone,i.magnitude=e.magnitude,i):new r(e.clock,e.cone,e.magnitude):void 0},r.normalize=function(e,i){return t(i)?(i.clock=e.clock,i.cone=e.cone,i.magnitude=1,i):new r(e.clock,e.cone,1)},r.equals=function(e,i){return e===i||t(e)&&t(i)&&e.clock===i.clock&&e.cone===i.cone&&e.magnitude===i.magnitude},r.equalsEpsilon=function(i,r,n){return n=e(n,0),i===r||t(i)&&t(r)&&Math.abs(i.clock-r.clock)<=n&&Math.abs(i.cone-r.cone)<=n&&Math.abs(i.magnitude-r.magnitude)<=n},r.prototype.equals=function(e){return r.equals(this,e)},r.prototype.clone=function(e){return r.clone(this,e)},r.prototype.equalsEpsilon=function(e,t){return r.equalsEpsilon(this,e,t)},r.prototype.toString=function(){return"("+this.clock+", "+this.cone+", "+this.magnitude+")"},r}),i("Core/subdivideArray",["./defined","./DeveloperError"],function(e,t){"use strict";function i(e,t){for(var i=[],r=e.length,n=0;r>n;){var o=Math.ceil((r-n)/t--);i.push(e.slice(n,n+o)),n+=o}return i}return i}),i("Core/TerrainData",["./defineProperties","./DeveloperError"],function(e,t){"use strict";function i(){t.throwInstantiationError()}return e(i.prototype,{waterMask:{get:t.throwInstantiationError}}),i.prototype.interpolateHeight=t.throwInstantiationError,i.prototype.isChildAvailable=t.throwInstantiationError,i.prototype.createMesh=t.throwInstantiationError,i.prototype.upsample=t.throwInstantiationError,i.prototype.wasCreatedByUpsampling=t.throwInstantiationError,i}),i("Core/TilingScheme",["./defineProperties","./DeveloperError"],function(e,t){"use strict";function i(e){throw new t("This type should not be instantiated directly. Instead, use WebMercatorTilingScheme or GeographicTilingScheme.")}return e(i.prototype,{ellipsoid:{get:t.throwInstantiationError},rectangle:{get:t.throwInstantiationError},projection:{get:t.throwInstantiationError}}),i.prototype.getNumberOfXTilesAtLevel=t.throwInstantiationError,i.prototype.getNumberOfYTilesAtLevel=t.throwInstantiationError,i.prototype.rectangleToNativeRectangle=t.throwInstantiationError,i.prototype.tileXYToNativeRectangle=t.throwInstantiationError,i.prototype.tileXYToRectangle=t.throwInstantiationError,i.prototype.positionToTileXY=t.throwInstantiationError,i}),i("Core/TimeIntervalCollection",["./binarySearch","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./JulianDate","./TimeInterval"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t){return a.compare(e.start,t.start)}function u(e){if(this._intervals=[],this._changedEvent=new o,i(e))for(var t=e.length,r=0;t>r;r++)this.addInterval(e[r])}r(u.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){var e=this._intervals;return 0===e.length?void 0:e[0].start}},isStartIncluded:{get:function(){var e=this._intervals;return 0===e.length?!1:e[0].isStartIncluded}},stop:{get:function(){var e=this._intervals,t=e.length;return 0===t?void 0:e[t-1].stop}},isStopIncluded:{get:function(){var e=this._intervals,t=e.length;return 0===t?!1:e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return 0===this._intervals.length}}}),u.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof u))return!1;var i=this._intervals,r=e._intervals,n=i.length;if(n!==r.length)return!1;for(var o=0;n>o;o++)if(!s.equals(i[o],r[o],t))return!1;return!0},u.prototype.get=function(e){return this._intervals[e]},u.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))},u.prototype.findIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t]:void 0},u.prototype.findDataForIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0},u.prototype.contains=function(e){return this.indexOf(e)>=0};var c=new s;return u.prototype.indexOf=function(t){var i=this._intervals;c.start=t,c.stop=t;var r=e(i,c,l);return r>=0?i[r].isStartIncluded?r:r>0&&i[r-1].stop.equals(t)&&i[r-1].isStopIncluded?r-1:~r:(r=~r,r>0&&r-1<i.length&&s.contains(i[r-1],t)?r-1:~r)},u.prototype.findInterval=function(e){e=t(e,t.EMPTY_OBJECT);for(var r=e.start,n=e.stop,o=e.isStartIncluded,a=e.isStopIncluded,s=this._intervals,l=0,u=s.length;u>l;l++){var c=s[l];if((!i(r)||c.start.equals(r))&&(!i(n)||c.stop.equals(n))&&(!i(o)||c.isStartIncluded===o)&&(!i(a)||c.isStopIncluded===a))return s[l]}},u.prototype.addInterval=function(t,r){if(!t.isEmpty){var n,o,u=this._intervals;if(0===u.length||a.greaterThan(t.start,u[u.length-1].stop))return u.push(t),void this._changedEvent.raiseEvent(this);for(o=e(u,t,l),0>o?o=~o:o>0&&t.isStartIncluded&&u[o-1].isStartIncluded&&u[o-1].start.equals(t.start)?--o:o<u.length&&!t.isStartIncluded&&u[o].isStartIncluded&&u[o].start.equals(t.start)&&++o,o>0&&(n=a.compare(u[o-1].stop,t.start),(n>0||0===n&&(u[o-1].isStopIncluded||t.isStartIncluded))&&((i(r)?r(u[o-1].data,t.data):u[o-1].data===t.data)?(t=new s(a.greaterThan(t.stop,u[o-1].stop)?{start:u[o-1].start,stop:t.stop,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:t.isStopIncluded,data:t.data}:{start:u[o-1].start,stop:u[o-1].stop,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:u[o-1].isStopIncluded||t.stop.equals(u[o-1].stop)&&t.isStopIncluded,data:t.data}),u.splice(o-1,1),--o):(n=a.compare(u[o-1].stop,t.stop),n>0||0===n&&u[o-1].isStopIncluded&&!t.isStopIncluded?u.splice(o-1,1,new s({start:u[o-1].start,stop:t.start,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:!t.isStartIncluded,data:u[o-1].data}),new s({start:t.stop,stop:u[o-1].stop,isStartIncluded:!t.isStopIncluded,isStopIncluded:u[o-1].isStopIncluded,data:u[o-1].data})):u[o-1]=new s({start:u[o-1].start,stop:t.start,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:!t.isStartIncluded,data:u[o-1].data}))));o<u.length&&(n=a.compare(t.stop,u[o].start),n>0||0===n&&(t.isStopIncluded||u[o].isStartIncluded));)if(i(r)?r(u[o].data,t.data):u[o].data===t.data)t=new s({start:t.start,stop:a.greaterThan(u[o].stop,t.stop)?u[o].stop:t.stop,isStartIncluded:t.isStartIncluded,isStopIncluded:a.greaterThan(u[o].stop,t.stop)?u[o].isStopIncluded:t.isStopIncluded,data:t.data}),u.splice(o,1);else{if(u[o]=new s({start:t.stop,stop:u[o].stop,isStartIncluded:!t.isStopIncluded,isStopIncluded:u[o].isStopIncluded,data:u[o].data}),!u[o].isEmpty)break;u.splice(o,1)}u.splice(o,0,t),this._changedEvent.raiseEvent(this)}},u.prototype.removeInterval=function(t){if(t.isEmpty)return!1;var i=!1,r=this._intervals,n=e(r,t,l);0>n&&(n=~n);var o=t.start,u=t.stop,c=t.isStartIncluded,h=t.isStopIncluded;if(n>0){var d=r[n-1],m=d.stop;(a.greaterThan(m,o)||s.equals(m,o)&&d.isStopIncluded&&c)&&(i=!0,(a.greaterThan(m,u)||d.isStopIncluded&&!h&&s.equals(m,u))&&r.splice(n,0,new s({start:u,stop:m,isStartIncluded:!h,isStopIncluded:d.isStopIncluded,data:d.data})),r[n-1]=new s({start:d.start,stop:o,isStartIncluded:d.isStartIncluded,isStopIncluded:!c,data:d.data}))}var p=r[n];for(n<r.length&&!c&&p.isStartIncluded&&o.equals(p.start)&&(i=!0,r.splice(n,0,new s({start:p.start,stop:p.start,isStartIncluded:!0,isStopIncluded:!0,data:p.data})),++n,p=r[n]);n<r.length&&a.greaterThan(u,p.stop);)i=!0,r.splice(n,1);return n<r.length&&u.equals(p.stop)&&(i=!0,!h&&p.isStopIncluded?(n+1<r.length&&r[n+1].start.equals(u)&&p.data===r[n+1].data?(r.splice(n,1),p=new s({start:p.start,stop:p.stop,isStartIncluded:!0,isStopIncluded:p.isStopIncluded,data:p.data})):p=new s({start:u,stop:u,isStartIncluded:!0,isStopIncluded:!0,data:p.data}),r[n]=p):r.splice(n,1)),n<r.length&&(a.greaterThan(u,p.start)||u.equals(p.start)&&h&&p.isStartIncluded)&&(i=!0,r[n]=new s({start:u,stop:p.stop,isStartIncluded:!h,isStopIncluded:p.isStopIncluded,data:p.data})),i&&this._changedEvent.raiseEvent(this),i},u.prototype.intersect=function(e,t,r){for(var n=0,o=0,l=new u,c=this._intervals,h=e._intervals;n<c.length&&o<h.length;){var d=c[n],m=h[o];if(a.lessThan(d.stop,m.start))++n;else if(a.lessThan(m.stop,d.start))++o;else{if(i(r)||i(t)&&t(d.data,m.data)||!i(t)&&m.data===d.data){var p=s.intersect(d,m,new s,r);p.isEmpty||l.addInterval(p,t)}a.lessThan(d.stop,m.stop)||d.stop.equals(m.stop)&&!d.isStopIncluded&&m.isStopIncluded?++n:++o}}return l},u}),i("Core/TranslationRotationScale",["./Cartesian3","./defaultValue","./defined","./Matrix4","./Quaternion"],function(e,t,i,r,n){"use strict";var o=new e(1,1,1),a=e.ZERO,s=n.IDENTITY,l=function(i,r,l){this.translation=e.clone(t(i,a)),this.rotation=n.clone(t(r,s)),this.scale=e.clone(t(l,o))};return l.prototype.equals=function(t){return this===t||i(t)&&e.equals(this.translation,t.translation)&&n.equals(this.rotation,t.rotation)&&e.equals(this.scale,t.scale)},l}),i("Core/VideoSynchronizer",["./defaultValue","./defined","./defineProperties","./destroyObject","./DeveloperError","./Event","./Iso8601","./JulianDate"],function(e,t,i,r,n,o,a,s){"use strict";function l(t){t=e(t,e.EMPTY_OBJECT),this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this.clock=t.clock,this.element=t.element,this.epoch=e(t.epoch,a.MINIMUM_VALUE),this.tolerance=e(t.tolerance,1),this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}function u(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}return i(l.prototype,{clock:{get:function(){return this._clock},set:function(e){var i=this._clock;i!==e&&(t(i)&&(this._clockSubscription(),this._clockSubscription=void 0),t(e)&&(this._clockSubscription=e.onTick.addEventListener(l.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){var i=this._element;i!==e&&(t(i)&&i.removeEventListener("seeked",this._seekFunction,!1),t(e)&&(this._seeking=!1,this._seekFunction=u(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}}),l.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,r(this)},l.prototype.isDestroyed=function(){return!1},l.prototype._onTick=function(i){var r=this._element;if(t(r)&&!(r.readyState<2)){var n=r.paused,o=i.shouldAnimate;if(o===n&&(o?r.play():r.pause()),this._seeking||this._firstTickAfterSeek)return void(this._firstTickAfterSeek=!1);r.playbackRate=i.multiplier;var l,u=i.currentTime,c=e(this.epoch,a.MINIMUM_VALUE),h=s.secondsDifference(u,c),d=r.duration,m=r.currentTime;r.loop?(h%=d,0>h&&(h=d-h),l=h):l=h>d?d:0>h?0:h;var p=o?e(this.tolerance,1):.001;Math.abs(l-m)>p&&(this._seeking=!0,r.currentTime=l)}},l}),i("Core/VRTheWorldTerrainProvider",["../ThirdParty/when","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Event","./GeographicTilingScheme","./getImagePixels","./HeightmapTerrainData","./loadImage","./loadXML","./Math","./Rectangle","./TerrainProvider","./throttleRequestByServer","./TileProviderError"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g){"use strict";function _(e,t){this.rectangle=e,this.maxLevel=t}function y(n){function u(e){var t=e.getElementsByTagName("SRS")[0].textContent;if("EPSG:4326"!==t)return void c("SRS "+t+" is not supported.");C._tilingScheme=new l({ellipsoid:E});var i=e.getElementsByTagName("TileFormat")[0];C._heightmapWidth=parseInt(i.getAttribute("width"),10),C._heightmapHeight=parseInt(i.getAttribute("height"),10),C._levelZeroMaximumGeometricError=f.getEstimatedLevelZeroGeometricErrorForAHeightmap(E,Math.min(C._heightmapWidth,C._heightmapHeight),C._tilingScheme.getNumberOfXTilesAtLevel(0));for(var r=e.getElementsByTagName("DataExtent"),n=0;n<r.length;++n){var o=r[n],a=m.toRadians(parseFloat(o.getAttribute("minx"))),s=m.toRadians(parseFloat(o.getAttribute("miny"))),u=m.toRadians(parseFloat(o.getAttribute("maxx"))),h=m.toRadians(parseFloat(o.getAttribute("maxy"))),d=parseInt(o.getAttribute("maxlevel"),10);C._rectangles.push(new _(new p(a,s,u,h),d))}C._ready=!0,C._readyPromise.resolve(!0)}function c(e){var t=i(e,"An error occurred while accessing "+C._url+".");y=g.handleError(y,C,C._errorEvent,t,void 0,void 0,void 0,h)}function h(){e(d(C._url),u,c)}if(n=i(n,i.EMPTY_OBJECT),!r(n.url))throw new o("options.url is required.");this._url=n.url,this._url.length>0&&"/"!==this._url[this._url.length-1]&&(this._url+="/"),this._errorEvent=new s,this._ready=!1,this._readyPromise=e.defer(),this._proxy=n.proxy,this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0};var v=n.credit;"string"==typeof v&&(v=new t(v)),this._credit=v,this._tilingScheme=void 0,this._rectangles=[];var y,C=this,E=i(n.ellipsoid,a.WGS84);h()}function C(e,t,i,n){for(var o=e._tilingScheme,a=e._rectangles,s=o.tileXYToRectangle(t,i,n),l=0,u=0;u<a.length&&15!==l;++u){var c=a[u];if(!(c.maxLevel<=n)){var h=c.rectangle,d=p.intersection(h,s,S);r(d)&&(E(o,h,2*t,2*i,n+1)&&(l|=4),E(o,h,2*t+1,2*i,n+1)&&(l|=8),E(o,h,2*t,2*i+1,n+1)&&(l|=1),E(o,h,2*t+1,2*i+1,n+1)&&(l|=2))}}return l}function E(e,t,i,n,o){var a=e.tileXYToRectangle(i,n,o);return r(p.intersection(a,t,S))}n(y.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){if(!this.ready)throw new o("requestTileGeometry must not be called before ready returns true.");return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),y.prototype.requestTileGeometry=function(t,n,a,s){if(!this.ready)throw new o("requestTileGeometry must not be called before ready returns true.");var l=this._tilingScheme.getNumberOfYTilesAtLevel(a),d=this._url+a+"/"+t+"/"+(l-n-1)+".tif?cesium=true",m=this._proxy;r(m)&&(d=m.getURL(d));var p;if(s=i(s,!0)){if(p=v(d,h),!r(p))return}else p=h(d);var f=this;return e(p,function(e){return new c({buffer:u(e),width:f._heightmapWidth,height:f._heightmapHeight,childTileMask:C(f,t,n,a),structure:f._terrainDataStructure})})},y.prototype.getLevelMaximumGeometricError=function(e){if(!this.ready)throw new o("requestTileGeometry must not be called before ready returns true.");return this._levelZeroMaximumGeometricError/(1<<e)};var S=new p;return y.prototype.getTileDataAvailable=function(e,t,i){},y}),i("Core/WallGeometryLibrary",["./Cartographic","./defined","./DeveloperError","./EllipsoidTangentPlane","./Math","./PolygonPipeline","./PolylinePipeline","./WindingOrder"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t){return n.equalsEpsilon(e.latitude,t.latitude,n.EPSILON14)&&n.equalsEpsilon(e.longitude,t.longitude,n.EPSILON14)}function u(i,r,n,o){var a=r.length;if(2>a)return{positions:r};var s=t(o),u=t(n),c=new Array(a),m=new Array(a),p=new Array(a),f=r[0];c[0]=f;var v=i.cartesianToCartographic(f,h);u&&(v.height=n[0]),m[0]=v.height,s?p[0]=o[0]:p[0]=0;for(var g=1,_=1;a>_;++_){var y=r[_],C=i.cartesianToCartographic(y,d);u&&(C.height=n[_]),l(v,C)?v.height<C.height&&(m[g-1]=C.height):(c[g]=y,m[g]=C.height,s?p[g]=o[_]:p[g]=0,e.clone(C,v),++g)}return c.length=g,m.length=g,p.length=g,{positions:c,topHeights:m,bottomHeights:p}}var c={},h=new e,d=new e,m=new Array(2),p=new Array(2),f={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};return c.computePositions=function(e,t,i,l,c,h){var d=u(e,t,i,l);if(t=d.positions,i=d.topHeights,l=d.bottomHeights,!(t.length<2)){if(t.length>=3){var v=r.fromPoints(t,e),g=v.projectPointsOntoPlane(t);o.computeWindingOrder2D(g)===s.CLOCKWISE&&(t.reverse(),i.reverse(),l.reverse())}var _,y,C=t.length,E=n.chordLength(c,e.maximumRadius),S=f;if(S.minDistance=E,S.ellipsoid=e,h){var w,T=0;for(w=0;C-1>w;w++)T+=a.numberOfPoints(t[w],t[w+1],E)+1;_=new Float64Array(3*T),y=new Float64Array(3*T);var x=m,b=p;S.positions=x,S.height=b;var A=0;for(w=0;C-1>w;w++){x[0]=t[w],x[1]=t[w+1],b[0]=i[w],b[1]=i[w+1];var P=a.generateArc(S);_.set(P,A),b[0]=l[w],b[1]=l[w+1],y.set(a.generateArc(S),A),A+=P.length}}else S.positions=t,S.height=i,_=new Float64Array(a.generateArc(S)),S.height=l,y=new Float64Array(a.generateArc(S));return{bottomPositions:y,topPositions:_}}},c}),i("Core/WallGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat","./WallGeometryLibrary"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(e){e=r(e,r.EMPTY_OBJECT);var i=e.positions,o=e.maximumHeights,s=e.minimumHeights,l=r(e.vertexFormat,m.DEFAULT),u=r(e.granularity,h.RADIANS_PER_DEGREE),c=r(e.ellipsoid,a.WGS84);this._positions=i,this._minimumHeights=s,this._maximumHeights=o,this._vertexFormat=m.clone(l),this._granularity=u,this._ellipsoid=a.clone(c),this._workerName="createWallGeometry";var d=1+i.length*t.packedLength+2;n(s)&&(d+=s.length),n(o)&&(d+=o.length),this.packedLength=d+a.packedLength+m.packedLength+1}var v=new t,g=new t,_=new t,y=new t,C=new t,E=new t,S=new t,w=new t;f.pack=function(e,i,o){o=r(o,0);var s,l=e._positions,u=l.length;for(i[o++]=u,s=0;u>s;++s,o+=t.packedLength)t.pack(l[s],i,o);var c=e._minimumHeights;if(u=n(c)?c.length:0,i[o++]=u,n(c))for(s=0;u>s;++s)i[o++]=c[s];var h=e._maximumHeights;if(u=n(h)?h.length:0,i[o++]=u,n(h))for(s=0;u>s;++s)i[o++]=h[s];a.pack(e._ellipsoid,i,o),o+=a.packedLength,m.pack(e._vertexFormat,i,o),o+=m.packedLength,i[o]=e._granularity};var T=a.clone(a.UNIT_SPHERE),x=new m,b={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:T,vertexFormat:x,granularity:void 0};return f.unpack=function(e,i,o){i=r(i,0);var s,l=e[i++],u=new Array(l);for(s=0;l>s;++s,i+=t.packedLength)u[s]=t.unpack(e,i);l=e[i++];var c;if(l>0)for(c=new Array(l),s=0;l>s;++s)c[s]=e[i++];l=e[i++];var h;if(l>0)for(h=new Array(l),s=0;l>s;++s)h[s]=e[i++];var d=a.unpack(e,i,T);i+=a.packedLength;var p=m.unpack(e,i,x);i+=m.packedLength;var v=e[i];return n(o)?(o._positions=u,o._minimumHeights=c,o._maximumHeights=h,o._ellipsoid=a.clone(d,o._ellipsoid),o._vertexFormat=m.clone(p,o._vertexFormat),o._granularity=v,o):(b.positions=u,b.minimumHeights=c,b.maximumHeights=h,b.granularity=v,new f(b))},f.fromConstantHeights=function(e){e=r(e,r.EMPTY_OBJECT);var t,i,o=e.positions,a=e.minimumHeight,s=e.maximumHeight,l=n(a),u=n(s);if(l||u){var c=o.length;t=l?new Array(c):void 0,i=u?new Array(c):void 0;for(var h=0;c>h;++h)l&&(t[h]=a),u&&(i[h]=s)}var d={positions:o,maximumHeights:i,minimumHeights:t,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new f(d)},f.createGeometry=function(r){var o=r._positions,a=r._minimumHeights,m=r._maximumHeights,f=r._vertexFormat,T=r._granularity,x=r._ellipsoid,b=p.computePositions(x,o,m,a,T,!0);if(n(b)){var A=b.bottomPositions,P=b.topPositions,I=P.length,M=2*I,D=f.position?new Float64Array(M):void 0,R=f.normal?new Float32Array(M):void 0,O=f.tangent?new Float32Array(M):void 0,N=f.binormal?new Float32Array(M):void 0,L=f.st?new Float32Array(M/3*2):void 0,F=0,B=0,V=0,k=0,z=0,U=w,G=S,W=E,H=!0;I/=3;var q,j=0,Y=1/(I-o.length+1);for(q=0;I>q;++q){var X=3*q,Z=t.fromArray(P,X,v),K=t.fromArray(A,X,g);if(f.position&&(D[F++]=K.x,D[F++]=K.y,D[F++]=K.z,D[F++]=Z.x,D[F++]=Z.y,D[F++]=Z.z),f.st&&(L[z++]=j,L[z++]=0,L[z++]=j,L[z++]=1),f.normal||f.tangent||f.binormal){var Q,J=t.clone(t.ZERO,C),$=x.scaleToGeodeticSurface(t.fromArray(P,X,g),g);if(I>q+1&&(Q=x.scaleToGeodeticSurface(t.fromArray(P,X+3,_),_),J=t.fromArray(P,X+3,C)),H){var ee=t.subtract(J,Z,y),te=t.subtract($,Z,v);U=t.normalize(t.cross(te,ee,U),U),H=!1}t.equalsEpsilon(Q,$,h.EPSILON10)?H=!0:(j+=Y,f.tangent&&(G=t.normalize(t.subtract(Q,$,G),G)),f.binormal&&(W=t.normalize(t.cross(U,G,W),W))),f.normal&&(R[B++]=U.x,R[B++]=U.y,R[B++]=U.z,R[B++]=U.x,R[B++]=U.y,R[B++]=U.z),f.tangent&&(O[k++]=G.x,O[k++]=G.y,O[k++]=G.z,O[k++]=G.x,O[k++]=G.y,O[k++]=G.z),f.binormal&&(N[V++]=W.x,N[V++]=W.y,N[V++]=W.z,N[V++]=W.x,N[V++]=W.y,N[V++]=W.z)}}var ie=new u;f.position&&(ie.position=new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:D})),f.normal&&(ie.normal=new l({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:R})),f.tangent&&(ie.tangent=new l({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:O})),f.binormal&&(ie.binormal=new l({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:N})),f.st&&(ie.st=new l({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:L}));var re=M/3;M-=6;var ne=c.createTypedArray(re,M),oe=0;for(q=0;re-2>q;q+=2){var ae=q,se=q+2,le=t.fromArray(D,3*ae,v),ue=t.fromArray(D,3*se,g);if(!t.equalsEpsilon(le,ue,h.EPSILON10)){var ce=q+1,he=q+3;ne[oe++]=ce,ne[oe++]=ae,ne[oe++]=he,ne[oe++]=he,ne[oe++]=ae,ne[oe++]=se}}return new s({attributes:ie,indices:ne,primitiveType:d.TRIANGLES,boundingSphere:new e.fromVertices(D)})}},f}),i("Core/WallOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./WallGeometryLibrary"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m){"use strict";function p(e){e=r(e,r.EMPTY_OBJECT);var i=e.positions,o=e.maximumHeights,s=e.minimumHeights,l=r(e.granularity,h.RADIANS_PER_DEGREE),u=r(e.ellipsoid,a.WGS84);this._positions=i,this._minimumHeights=s,this._maximumHeights=o,this._granularity=l,this._ellipsoid=a.clone(u),this._workerName="createWallOutlineGeometry";var c=1+i.length*t.packedLength+2;n(s)&&(c+=s.length),n(o)&&(c+=o.length),this.packedLength=c+a.packedLength+1}var f=new t,v=new t;p.pack=function(e,i,o){o=r(o,0);var s,l=e._positions,u=l.length;for(i[o++]=u,s=0;u>s;++s,o+=t.packedLength)t.pack(l[s],i,o);var c=e._minimumHeights;if(u=n(c)?c.length:0,i[o++]=u,n(c))for(s=0;u>s;++s)i[o++]=c[s];var h=e._maximumHeights;if(u=n(h)?h.length:0,i[o++]=u,n(h))for(s=0;u>s;++s)i[o++]=h[s];a.pack(e._ellipsoid,i,o),o+=a.packedLength,i[o]=e._granularity};var g=a.clone(a.UNIT_SPHERE),_={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:g,granularity:void 0};return p.unpack=function(e,i,o){i=r(i,0);var s,l=e[i++],u=new Array(l);for(s=0;l>s;++s,i+=t.packedLength)u[s]=t.unpack(e,i);l=e[i++];var c;if(l>0)for(c=new Array(l),s=0;l>s;++s)c[s]=e[i++];l=e[i++];var h;if(l>0)for(h=new Array(l),s=0;l>s;++s)h[s]=e[i++];var d=a.unpack(e,i,g);i+=a.packedLength;var m=e[i];return n(o)?(o._positions=u,o._minimumHeights=c,o._maximumHeights=h,o._ellipsoid=a.clone(d,o._ellipsoid),o._granularity=m,o):(_.positions=u,_.minimumHeights=c,_.maximumHeights=h,_.granularity=m,new p(_))},p.fromConstantHeights=function(e){e=r(e,r.EMPTY_OBJECT);var t,i,o=e.positions,a=e.minimumHeight,s=e.maximumHeight,l=n(a),u=n(s);if(l||u){var c=o.length;t=l?new Array(c):void 0,i=u?new Array(c):void 0;for(var h=0;c>h;++h)l&&(t[h]=a),u&&(i[h]=s)}var d={positions:o,maximumHeights:i,minimumHeights:t,ellipsoid:e.ellipsoid};return new p(d)},p.createGeometry=function(r){var o=r._positions,a=r._minimumHeights,p=r._maximumHeights,g=r._granularity,_=r._ellipsoid,y=m.computePositions(_,o,p,a,g,!1); +if(n(y)){var C=y.bottomPositions,E=y.topPositions,S=E.length,w=2*S,T=new Float64Array(w),x=0;S/=3;var b;for(b=0;S>b;++b){var A=3*b,P=t.fromArray(E,A,f),I=t.fromArray(C,A,v);T[x++]=I.x,T[x++]=I.y,T[x++]=I.z,T[x++]=P.x,T[x++]=P.y,T[x++]=P.z}var M=new u({position:new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:T})}),D=w/3;w=2*D-4+D;var R=c.createTypedArray(D,w),O=0;for(b=0;D-2>b;b+=2){var N=b,L=b+2,F=t.fromArray(T,3*N,f),B=t.fromArray(T,3*L,v);if(!t.equalsEpsilon(F,B,h.EPSILON10)){var V=b+1,k=b+3;R[O++]=V,R[O++]=N,R[O++]=V,R[O++]=k,R[O++]=N,R[O++]=L}}return R[O++]=D-2,R[O++]=D-1,new s({attributes:M,indices:R,primitiveType:d.LINES,boundingSphere:new e.fromVertices(T)})}},p}),i("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){this._ellipsoid=i(e,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return n(l.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),l.mercatorAngleToGeodeticLatitude=function(e){return s.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},l.geodeticLatitudeToMercatorAngle=function(e){e>l.MaximumLatitude?e=l.MaximumLatitude:e<-l.MaximumLatitude&&(e=-l.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},l.MaximumLatitude=l.mercatorAngleToGeodeticLatitude(Math.PI),l.prototype.project=function(t,i){var n=this._semimajorAxis,o=t.longitude*n,a=l.geodeticLatitudeToMercatorAngle(t.latitude)*n,s=t.height;return r(i)?(i.x=o,i.y=a,i.z=s,i):new e(o,a,s)},l.prototype.unproject=function(e,i){var n=this._oneOverSemimajorAxis,o=e.x*n,a=l.mercatorAngleToGeodeticLatitude(e.y*n),s=e.z;return r(i)?(i.longitude=o,i.latitude=a,i.height=s,i):new t(o,a,s)},l}),i("Core/WebMercatorTilingScheme",["./Cartesian2","./defaultValue","./defined","./defineProperties","./Ellipsoid","./Rectangle","./WebMercatorProjection"],function(e,t,i,r,n,o,a){"use strict";function s(r){if(r=t(r,{}),this._ellipsoid=t(r.ellipsoid,n.WGS84),this._numberOfLevelZeroTilesX=t(r.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=t(r.numberOfLevelZeroTilesY,1),this._projection=new a(this._ellipsoid),i(r.rectangleSouthwestInMeters)&&i(r.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=r.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=r.rectangleNortheastInMeters;else{var s=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new e(-s,-s),this._rectangleNortheastInMeters=new e(s,s)}var l=this._projection.unproject(this._rectangleSouthwestInMeters),u=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new o(l.longitude,l.latitude,u.longitude,u.latitude)}return r(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),s.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},s.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},s.prototype.rectangleToNativeRectangle=function(e,t){var r=this._projection,n=r.project(o.southwest(e)),a=r.project(o.northeast(e));return i(t)?(t.west=n.x,t.south=n.y,t.east=a.x,t.north=a.y,t):new o(n.x,n.y,a.x,a.y)},s.prototype.tileXYToNativeRectangle=function(e,t,r,n){var a=this.getNumberOfXTilesAtLevel(r),s=this.getNumberOfYTilesAtLevel(r),l=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/a,u=this._rectangleSouthwestInMeters.x+e*l,c=this._rectangleSouthwestInMeters.x+(e+1)*l,h=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/s,d=this._rectangleNortheastInMeters.y-t*h,m=this._rectangleNortheastInMeters.y-(t+1)*h;return i(n)?(n.west=u,n.south=m,n.east=c,n.north=d,n):new o(u,m,c,d)},s.prototype.tileXYToRectangle=function(t,i,r,n){var o=this.tileXYToNativeRectangle(t,i,r,n),a=this._projection,s=a.unproject(new e(o.west,o.south)),l=a.unproject(new e(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=l.longitude,o.north=l.latitude,o},s.prototype.positionToTileXY=function(t,r,n){var a=this._rectangle;if(o.contains(a,t)){var s=this.getNumberOfXTilesAtLevel(r),l=this.getNumberOfYTilesAtLevel(r),u=this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x,c=u/s,h=this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y,d=h/l,m=this._projection,p=m.project(t),f=p.x-this._rectangleSouthwestInMeters.x,v=this._rectangleNortheastInMeters.y-p.y,g=f/c|0;g>=s&&(g=s-1);var _=v/d|0;return _>=l&&(_=l-1),i(n)?(n.x=g,n.y=_,n):new e(g,_)}},s}),i("Core/wrapFunction",["./DeveloperError"],function(e){"use strict";function t(e,t,i){return function(){i.apply(e,arguments),t.apply(e,arguments)}}return t}),i("DataSources/ConstantProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event"],function(e,t,i,r,n){"use strict";function o(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new n,this.setValue(e)}return i(o.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}}),o.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value},o.prototype.setValue=function(e){var i=this._value;if(i!==e){var r=t(e),n=r&&"function"==typeof e.clone,o=r&&"function"==typeof e.equals;this._hasClone=n,this._hasEquals=o;var a=!o||!e.equals(i);a&&(this._value=n?e.clone():e,this._definitionChanged.raiseEvent(this))}},o.prototype.equals=function(e){return this===e||e instanceof o&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))},o}),i("DataSources/createPropertyDescriptor",["../Core/defaultValue","../Core/defined","./ConstantProperty"],function(e,t,i){"use strict";function r(e,i,r,n,o){return{configurable:n,get:function(){return this[i]},set:function(n){var a=this[i],s=this[r];t(s)&&(s(),this[r]=void 0);var l=t(n);l&&!t(n.getValue)&&t(o)&&(n=o(n)),a!==n&&(this[i]=n,this._definitionChanged.raiseEvent(this,e,n,a)),t(n)&&t(n.definitionChanged)&&(this[r]=n.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,n,n)},this))}}}function n(e){return new i(e)}function o(t,i,o){return r(t,"_"+t.toString(),"_"+t.toString()+"Subscription",e(i,!1),e(o,n))}return o}),i("DataSources/BillboardGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,i,r,n,o){"use strict";function a(t){this._image=void 0,this._imageSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},image:o("image"),imageSubRegion:o("imageSubRegion"),scale:o("scale"),rotation:o("rotation"),alignedAxis:o("alignedAxis"),horizontalOrigin:o("horizontalOrigin"),verticalOrigin:o("verticalOrigin"),color:o("color"),eyeOffset:o("eyeOffset"),pixelOffset:o("pixelOffset"),show:o("show"),width:o("width"),height:o("height"),scaleByDistance:o("scaleByDistance"),translucencyByDistance:o("translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance"),sizeInMeters:o("sizeInMeters")}),a.prototype.clone=function(e){return t(e)?(e.color=this._color,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.image=this._image,e.imageSubRegion=this._imageSubRegion,e.pixelOffset=this._pixelOffset,e.scale=this._scale,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.show=this._show,e.verticalOrigin=this._verticalOrigin,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.sizeInMeters=this._sizeInMeters,e):new a(this)},a.prototype.merge=function(t){this.color=e(this._color,t.color),this.eyeOffset=e(this._eyeOffset,t.eyeOffset),this.horizontalOrigin=e(this._horizontalOrigin,t.horizontalOrigin),this.image=e(this._image,t.image),this.imageSubRegion=e(this._imageSubRegion,t.imageSubRegion),this.pixelOffset=e(this._pixelOffset,t.pixelOffset),this.scale=e(this._scale,t.scale),this.rotation=e(this._rotation,t.rotation),this.alignedAxis=e(this._alignedAxis,t.alignedAxis),this.show=e(this._show,t.show),this.verticalOrigin=e(this._verticalOrigin,t.verticalOrigin),this.width=e(this._width,t.width),this.height=e(this._height,t.height),this.scaleByDistance=e(this._scaleByDistance,t.scaleByDistance),this.translucencyByDistance=e(this._translucencyByDistance,t.translucencyByDistance),this.pixelOffsetScaleByDistance=e(this._pixelOffsetScaleByDistance,t.pixelOffsetScaleByDistance),this.sizeInMeters=e(this._sizeInMeters,t.sizeInMeters)},a}),i("Renderer/BufferUsage",["../Core/freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={STREAM_DRAW:t.STREAM_DRAW,STATIC_DRAW:t.STATIC_DRAW,DYNAMIC_DRAW:t.DYNAMIC_DRAW,validate:function(e){return e===i.STREAM_DRAW||e===i.STATIC_DRAW||e===i.DYNAMIC_DRAW}};return e(i)}),i("Renderer/Buffer",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/IndexDatatype","./BufferUsage","./WebGLConstants"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){i=e(i,e.EMPTY_OBJECT);var r=i.context._gl,n=i.bufferTarget,o=i.typedArray,a=i.sizeInBytes,s=i.usage,l=t(o);l&&(a=o.byteLength);var u=r.createBuffer();r.bindBuffer(n,u),r.bufferData(n,l?o:a,s),r.bindBuffer(n,null),this._gl=r,this._bufferTarget=n,this._sizeInBytes=a,this._usage=s,this._buffer=u,this.vertexArrayDestroyable=!0}return l.createVertexBuffer=function(e){return new l({context:e.context,bufferTarget:s.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})},l.createIndexBuffer=function(e){var t=e.context,r=e.indexDatatype,n=o.getSizeInBytes(r),a=new l({context:t,bufferTarget:s.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),u=a.sizeInBytes/n;return i(a,{indexDatatype:{get:function(){return r}},bytesPerIndex:{get:function(){return n}},numberOfIndices:{get:function(){return u}}}),a},i(l.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}}),l.prototype._getBuffer=function(){return this._buffer},l.prototype.copyFromArrayView=function(t,i){i=e(i,0);var r=this._gl,n=this._bufferTarget;r.bindBuffer(n,this._buffer),r.bufferSubData(n,i,t),r.bindBuffer(n,null)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),r(this)},l}),i("Renderer/DrawCommand",["../Core/defaultValue","../Core/PrimitiveType"],function(e,t){"use strict";function i(i){i=e(i,e.EMPTY_OBJECT),this.boundingVolume=i.boundingVolume,this.orientedBoundingBox=i.orientedBoundingBox,this.cull=e(i.cull,!0),this.modelMatrix=i.modelMatrix,this.primitiveType=e(i.primitiveType,t.TRIANGLES),this.vertexArray=i.vertexArray,this.count=i.count,this.offset=e(i.offset,0),this.instanceCount=e(i.instanceCount,0),this.shaderProgram=i.shaderProgram,this.uniformMap=i.uniformMap,this.renderState=i.renderState,this.framebuffer=i.framebuffer,this.pass=i.pass,this.executeInClosestFrustum=e(i.executeInClosestFrustum,!1),this.owner=i.owner,this.debugShowBoundingVolume=e(i.debugShowBoundingVolume,!1),this.debugOverlappingFrustums=0,this.oit=void 0}return i.prototype.execute=function(e,t,i,r){e.draw(this,t,i,r)},i}),i("Renderer/ContextLimits",["../Core/defineProperties"],function(e){"use strict";var t={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_highpFloatSupported:!1,_highpIntSupported:!1};return e(t,{maximumCombinedTextureImageUnits:{get:function(){return t._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return t._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return t._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return t._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return t._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return t._maximumTextureSize}},maximumVaryingVectors:{get:function(){return t._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return t._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return t._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return t._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return t._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return t._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return t._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return t._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return t._maximumViewportWidth}},maximumViewportHeight:{get:function(){return t._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return t._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return t._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return t._maximumColorAttachments}},highpFloatSupported:{get:function(){return t._highpFloatSupported}},highpIntSupported:{get:function(){return t._highpIntSupported}}}),t}),i("Renderer/RenderState",["../Core/BoundingRectangle","../Core/Color","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/RuntimeError","../Core/WindingOrder","./ContextLimits","./WebGLConstants"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(n){var o=i(n,{}),s=i(o.cull,{}),u=i(o.polygonOffset,{}),c=i(o.scissorTest,{}),h=i(c.rectangle,{}),d=i(o.depthRange,{}),m=i(o.depthTest,{}),p=i(o.colorMask,{}),f=i(o.blending,{}),v=i(f.color,{}),g=i(o.stencilTest,{}),_=i(g.frontOperation,{}),y=i(g.backOperation,{}),C=i(o.sampleCoverage,{}),E=o.viewport;this.frontFace=i(o.frontFace,a.COUNTER_CLOCKWISE),this.cull={enabled:i(s.enabled,!1),face:i(s.face,l.BACK)},this.lineWidth=i(o.lineWidth,1),this.polygonOffset={enabled:i(u.enabled,!1),factor:i(u.factor,0),units:i(u.units,0)},this.scissorTest={enabled:i(c.enabled,!1),rectangle:e.clone(h)},this.depthRange={near:i(d.near,0),far:i(d.far,1)},this.depthTest={enabled:i(m.enabled,!1),func:i(m.func,l.LESS)},this.colorMask={red:i(p.red,!0),green:i(p.green,!0),blue:i(p.blue,!0),alpha:i(p.alpha,!0)},this.depthMask=i(o.depthMask,!0),this.stencilMask=i(o.stencilMask,-1),this.blending={enabled:i(f.enabled,!1),color:new t(i(v.red,0),i(v.green,0),i(v.blue,0),i(v.alpha,0)),equationRgb:i(f.equationRgb,l.FUNC_ADD),equationAlpha:i(f.equationAlpha,l.FUNC_ADD),functionSourceRgb:i(f.functionSourceRgb,l.ONE),functionSourceAlpha:i(f.functionSourceAlpha,l.ONE),functionDestinationRgb:i(f.functionDestinationRgb,l.ZERO),functionDestinationAlpha:i(f.functionDestinationAlpha,l.ZERO)},this.stencilTest={enabled:i(g.enabled,!1),frontFunction:i(g.frontFunction,l.ALWAYS),backFunction:i(g.backFunction,l.ALWAYS),reference:i(g.reference,0),mask:i(g.mask,-1),frontOperation:{fail:i(_.fail,l.KEEP),zFail:i(_.zFail,l.KEEP),zPass:i(_.zPass,l.KEEP)},backOperation:{fail:i(y.fail,l.KEEP),zFail:i(y.zFail,l.KEEP),zPass:i(y.zPass,l.KEEP)}},this.sampleCoverage={enabled:i(C.enabled,!1),value:i(C.value,1),invert:i(C.invert,!1)},this.viewport=r(E)?new e(E.x,E.y,E.width,E.height):void 0,this.id=0,this._applyFunctions=[]}function c(e,t,i){i?e.enable(t):e.disable(t)}function h(e,t){e.frontFace(t.frontFace)}function d(e,t){var i=t.cull,r=i.enabled;c(e,e.CULL_FACE,r),r&&e.cullFace(i.face)}function m(e,t){e.lineWidth(t.lineWidth)}function p(e,t){var i=t.polygonOffset,r=i.enabled;c(e,e.POLYGON_OFFSET_FILL,r),r&&e.polygonOffset(i.factor,i.units)}function f(e,t,i){var n=t.scissorTest,o=r(i.scissorTest)?i.scissorTest.enabled:n.enabled;if(c(e,e.SCISSOR_TEST,o),o){var a=r(i.scissorTest)?i.scissorTest.rectangle:n.rectangle;e.scissor(a.x,a.y,a.width,a.height)}}function v(e,t){var i=t.depthRange;e.depthRange(i.near,i.far)}function g(e,t){var i=t.depthTest,r=i.enabled;c(e,e.DEPTH_TEST,r),r&&e.depthFunc(i.func)}function _(e,t){var i=t.colorMask;e.colorMask(i.red,i.green,i.blue,i.alpha)}function y(e,t){e.depthMask(t.depthMask)}function C(e,t){e.stencilMask(t.stencilMask)}function E(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function S(e,t,i){var n=t.blending,o=r(i.blendingEnabled)?i.blendingEnabled:n.enabled;c(e,e.BLEND,o),o&&(E(e,n.color),e.blendEquationSeparate(n.equationRgb,n.equationAlpha),e.blendFuncSeparate(n.functionSourceRgb,n.functionDestinationRgb,n.functionSourceAlpha,n.functionDestinationAlpha))}function w(e,t){var i=t.stencilTest,r=i.enabled;if(c(e,e.STENCIL_TEST,r),r){var n=i.frontFunction,o=i.backFunction,a=i.reference,s=i.mask;e.stencilFunc(i.frontFunction,i.reference,i.mask),e.stencilFuncSeparate(e.BACK,o,a,s),e.stencilFuncSeparate(e.FRONT,n,a,s);var l=i.frontOperation,u=l.fail,h=l.zFail,d=l.zPass;e.stencilOpSeparate(e.FRONT,u,h,d);var m=i.backOperation,p=m.fail,f=m.zFail,v=m.zPass;e.stencilOpSeparate(e.BACK,p,f,v)}}function T(e,t){var i=t.sampleCoverage,r=i.enabled;c(e,e.SAMPLE_COVERAGE,r),r&&e.sampleCoverage(i.value,i.invert)}function x(e,t,n){var o=i(t.viewport,n.viewport);r(o)||(o=I,o.width=n.context.drawingBufferWidth,o.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=o,e.viewport(o.x,o.y,o.width,o.height)}function b(e,t){var i=[];return e.frontFace!==t.frontFace&&i.push(h),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&i.push(d),e.lineWidth!==t.lineWidth&&i.push(m),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&i.push(p),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&i.push(v),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&i.push(g),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&i.push(_),e.depthMask!==t.depthMask&&i.push(y),e.stencilMask!==t.stencilMask&&i.push(C),(e.stencilTest.enabled!==t.stencilTest.enabled||e.stencilTest.frontFunction!==t.stencilTest.frontFunction||e.stencilTest.backFunction!==t.stencilTest.backFunction||e.stencilTest.reference!==t.stencilTest.reference||e.stencilTest.mask!==t.stencilTest.mask||e.stencilTest.frontOperation.fail!==t.stencilTest.frontOperation.fail||e.stencilTest.frontOperation.zFail!==t.stencilTest.frontOperation.zFail||e.stencilTest.backOperation.fail!==t.stencilTest.backOperation.fail||e.stencilTest.backOperation.zFail!==t.stencilTest.backOperation.zFail||e.stencilTest.backOperation.zPass!==t.stencilTest.backOperation.zPass)&&i.push(w),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&i.push(T),i}var A=0,P={};u.fromCache=function(e){var t=JSON.stringify(e),i=P[t];if(r(i))return++i.referenceCount,i.state;var n=new u(e),o=JSON.stringify(n);return i=P[o],r(i)||(n.id=A++,i={referenceCount:0,state:n},P[o]=i),++i.referenceCount,P[t]={referenceCount:1,state:i.state},i.state},u.removeFromCache=function(e){var t=new u(e),i=JSON.stringify(t),n=P[i],o=JSON.stringify(e),a=P[o];r(a)&&(--a.referenceCount,0===a.referenceCount&&(delete P[o],r(n)&&--n.referenceCount)),r(n)&&0===n.referenceCount&&delete P[i]},u.getCache=function(){return P},u.clearCache=function(){P={}};var I=new e;return u.apply=function(e,t,i){h(e,t),d(e,t),m(e,t),p(e,t),v(e,t),g(e,t),_(e,t),y(e,t),C(e,t),w(e,t),T(e,t),f(e,t,i),S(e,t,i),x(e,t,i)},u.partialApply=function(e,t,i,n,o,a){if(t!==i){var s=i._applyFunctions[t.id];r(s)||(s=b(t,i),i._applyFunctions[t.id]=s);for(var l=s.length,u=0;l>u;++u)s[u](e,i)}var c=r(n.scissorTest)?n.scissorTest:t.scissorTest,h=r(o.scissorTest)?o.scissorTest:i.scissorTest;(c!==h||a)&&f(e,i,o);var d=r(n.blendingEnabled)?n.blendingEnabled:t.blending.enabled,m=r(o.blendingEnabled)?o.blendingEnabled:i.blending.enabled;(d!==m||m&&t.blending!==i.blending)&&S(e,i,o),(t!==i||n.context!==o.context)&&x(e,i,o)},u.getState=function(i){return{frontFace:i.frontFace,cull:{enabled:i.cull.enabled,face:i.cull.face},lineWidth:i.lineWidth,polygonOffset:{enabled:i.polygonOffset.enabled,factor:i.polygonOffset.factor,units:i.polygonOffset.units},scissorTest:{enabled:i.scissorTest.enabled,rectangle:e.clone(i.scissorTest.rectangle)},depthRange:{near:i.depthRange.near,far:i.depthRange.far},depthTest:{enabled:i.depthTest.enabled,func:i.depthTest.func},colorMask:{red:i.colorMask.red,green:i.colorMask.green,blue:i.colorMask.blue,alpha:i.colorMask.alpha},depthMask:i.depthMask,stencilMask:i.stencilMask,blending:{enabled:i.blending.enabled,color:t.clone(i.blending.color),equationRgb:i.blending.equationRgb,equationAlpha:i.blending.equationAlpha,functionSourceRgb:i.blending.functionSourceRgb,functionSourceAlpha:i.blending.functionSourceAlpha,functionDestinationRgb:i.blending.functionDestinationRgb,functionDestinationAlpha:i.blending.functionDestinationAlpha},stencilTest:{enabled:i.stencilTest.enabled,frontFunction:i.stencilTest.frontFunction,backFunction:i.stencilTest.backFunction,reference:i.stencilTest.reference,mask:i.stencilTest.mask,frontOperation:{fail:i.stencilTest.frontOperation.fail,zFail:i.stencilTest.frontOperation.zFail,zPass:i.stencilTest.frontOperation.zPass},backOperation:{fail:i.stencilTest.backOperation.fail,zFail:i.stencilTest.backOperation.zFail,zPass:i.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:i.sampleCoverage.enabled,value:i.sampleCoverage.value,invert:i.sampleCoverage.invert},viewport:r(i.viewport)?e.clone(i.viewport):void 0}},u}),i("Renderer/AutomaticUniforms",["../Core/Cartesian3","../Core/Matrix4","./WebGLConstants"],function(e,t,i){"use strict";function r(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var n=new e;if("undefined"==typeof WebGLRenderingContext)return{};var o={};o[i.FLOAT]="float",o[i.FLOAT_VEC2]="vec2",o[i.FLOAT_VEC3]="vec3",o[i.FLOAT_VEC4]="vec4",o[i.INT]="int",o[i.INT_VEC2]="ivec2",o[i.INT_VEC3]="ivec3",o[i.INT_VEC4]="ivec4",o[i.BOOL]="bool",o[i.BOOL_VEC2]="bvec2",o[i.BOOL_VEC3]="bvec3",o[i.BOOL_VEC4]="bvec4",o[i.FLOAT_MAT2]="mat2",o[i.FLOAT_MAT3]="mat3",o[i.FLOAT_MAT4]="mat4",o[i.SAMPLER_2D]="sampler2D",o[i.SAMPLER_CUBE]="samplerCube",r.prototype.getDeclaration=function(e){var t="uniform "+o[this._datatype]+" "+e,i=this._size;return t+=1===i?";":"["+i.toString()+"];"};var a={czm_viewport:new r({size:1,datatype:i.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new r({size:1,datatype:i.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_inverseProjectionOIT:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseProjectionOIT}}),czm_infiniteProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_normal:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight2D:new r({size:1,datatype:i.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_entireFrustum:new r({size:1,datatype:i.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new r({size:1,datatype:i.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new r({size:1,datatype:i.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_sunPositionWC:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_encodedCameraPositionMCHigh:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return t.getTranslation(e.inverseView,n)}}),czm_frameNumber:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_temeToPseudoFixed:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_resolutionScale:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.resolutionScale}}),czm_fogDensity:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.fogDensity}})};return a}),i("Renderer/createUniform",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/defined","../Core/DeveloperError","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/RuntimeError"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,t,i,r){switch(t.type){case e.FLOAT:return new h(e,t,i,r);case e.FLOAT_VEC2:return new d(e,t,i,r);case e.FLOAT_VEC3:return new m(e,t,i,r);case e.FLOAT_VEC4:return new p(e,t,i,r);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new f(e,t,i,r);case e.INT:case e.BOOL:return new v(e,t,i,r);case e.INT_VEC2:case e.BOOL_VEC2:return new g(e,t,i,r);case e.INT_VEC3:case e.BOOL_VEC3:return new _(e,t,i,r);case e.INT_VEC4:case e.BOOL_VEC4:return new y(e,t,i,r);case e.FLOAT_MAT2:return new C(e,t,i,r);case e.FLOAT_MAT3:return new E(e,t,i,r);case e.FLOAT_MAT4:return new S(e,t,i,r);default:throw new u("Unrecognized uniform type: "+t.type+' for uniform "'+i+'".')}}function h(e,t,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=e,this._location=r}function d(t,i,r,n){this.name=r,this.value=void 0,this._value=new e,this._gl=t,this._location=n}function m(e,t,i,r){this.name=i,this.value=void 0,this._value=void 0,this._gl=e,this._location=r}function p(e,t,i,r){this.name=i,this.value=void 0,this._value=void 0,this._gl=e,this._location=r}function f(e,t,i,r){this.name=i,this.value=void 0,this._gl=e,this._location=r,this.textureUnitIndex=void 0}function v(e,t,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=e,this._location=r}function g(t,i,r,n){this.name=r,this.value=void 0,this._value=new e,this._gl=t,this._location=n}function _(e,i,r,n){this.name=r,this.value=void 0,this._value=new t,this._gl=e,this._location=n}function y(e,t,r,n){this.name=r,this.value=void 0,this._value=new i,this._gl=e,this._location=n}function C(e,t,i,r){this.name=i,this.value=void 0,this._value=new Float32Array(4),this._gl=e,this._location=r}function E(e,t,i,r){this.name=i,this.value=void 0,this._value=new Float32Array(9),this._gl=e,this._location=r}function S(e,t,i,r){this.name=i,this.value=void 0,this._value=new Float32Array(16),this._gl=e,this._location=r}return h.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))},d.prototype.set=function(){var t=this.value;e.equals(t,this._value)||(e.clone(t,this._value),this._gl.uniform2f(this._location,t.x,t.y))},m.prototype.set=function(){var e=this.value;if(n(e.red))r.equals(e,this._value)||(this._value=r.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue));else{ +if(!n(e.x))throw new o('Invalid vec3 value for uniform "'+this._activethis.name+'".');t.equals(e,this._value)||(this._value=t.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z))}},p.prototype.set=function(){var e=this.value;if(n(e.red))r.equals(e,this._value)||(this._value=r.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha));else{if(!n(e.x))throw new o('Invalid vec4 value for uniform "'+this._activethis.name+'".');i.equals(e,this._value)||(this._value=i.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w))}},f.prototype.set=function(){var e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);var t=this.value;e.bindTexture(t._target,t._texture)},f.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1},v.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))},g.prototype.set=function(){var t=this.value;e.equals(t,this._value)||(e.clone(t,this._value),this._gl.uniform2i(this._location,t.x,t.y))},_.prototype.set=function(){var e=this.value;t.equals(e,this._value)||(t.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))},y.prototype.set=function(){var e=this.value;i.equals(e,this._value)||(i.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))},C.prototype.set=function(){a.equalsArray(this.value,this._value,0)||(a.toArray(this.value,this._value),this._gl.uniformMatrix2fv(this._location,!1,this._value))},E.prototype.set=function(){s.equalsArray(this.value,this._value,0)||(s.toArray(this.value,this._value),this._gl.uniformMatrix3fv(this._location,!1,this._value))},S.prototype.set=function(){l.equalsArray(this.value,this._value,0)||(l.toArray(this.value,this._value),this._gl.uniformMatrix4fv(this._location,!1,this._value))},c}),i("Renderer/createUniformArray",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/RuntimeError"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e,t,i,r){switch(t.type){case e.FLOAT:return new d(e,t,i,r);case e.FLOAT_VEC2:return new m(e,t,i,r);case e.FLOAT_VEC3:return new p(e,t,i,r);case e.FLOAT_VEC4:return new f(e,t,i,r);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new v(e,t,i,r);case e.INT:case e.BOOL:return new g(e,t,i,r);case e.INT_VEC2:case e.BOOL_VEC2:return new _(e,t,i,r);case e.INT_VEC3:case e.BOOL_VEC3:return new y(e,t,i,r);case e.INT_VEC4:case e.BOOL_VEC4:return new C(e,t,i,r);case e.FLOAT_MAT2:return new E(e,t,i,r);case e.FLOAT_MAT3:return new S(e,t,i,r);case e.FLOAT_MAT4:return new w(e,t,i,r);default:throw new c("Unrecognized uniform type: "+t.type+' for uniform "'+i+'".')}}function d(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(n),this._gl=e,this._location=r[0]}function m(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(2*n),this._gl=e,this._location=r[0]}function p(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(3*n),this._gl=e,this._location=r[0]}function f(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(4*n),this._gl=e,this._location=r[0]}function v(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(n),this._gl=e,this._locations=r,this.textureUnitIndex=void 0}function g(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Int32Array(n),this._gl=e,this._location=r[0]}function _(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Int32Array(2*n),this._gl=e,this._location=r[0]}function y(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Int32Array(3*n),this._gl=e,this._location=r[0]}function C(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Int32Array(4*n),this._gl=e,this._location=r[0]}function E(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(4*n),this._gl=e,this._location=r[0]}function S(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(9*n),this._gl=e,this._location=r[0]}function w(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(16*n),this._gl=e,this._location=r[0]}return d.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0;t>n;++n){var o=e[n];o!==i[n]&&(i[n]=o,r=!0)}r&&this._gl.uniform1fv(this._location,i)},m.prototype.set=function(){for(var t=this.value,i=t.length,r=this._value,n=!1,o=0,a=0;i>a;++a){var s=t[a];e.equalsArray(s,r,o)||(e.pack(s,r,o),n=!0),o+=2}n&&this._gl.uniform2fv(this._location,r)},p.prototype.set=function(){for(var e=this.value,i=e.length,r=this._value,o=!1,s=0,l=0;i>l;++l){var u=e[l];if(n(u.red))(u.red!==r[s]||u.green!==r[s+1]||u.blue!==r[s+2])&&(r[s]=u.red,r[s+1]=u.green,r[s+2]=u.blue,o=!0);else{if(!n(u.x))throw new a("Invalid vec3 value.");t.equalsArray(u,r,s)||(t.pack(u,r,s),o=!0)}s+=3}o&&this._gl.uniform3fv(this._location,r)},f.prototype.set=function(){for(var e=this.value,t=e.length,o=this._value,s=!1,l=0,u=0;t>u;++u){var c=e[u];if(n(c.red))r.equalsArray(c,o,l)||(r.pack(c,o,l),s=!0);else{if(!n(c.x))throw new a("Invalid vec4 value.");i.equalsArray(c,o,l)||(i.pack(c,o,l),s=!0)}l+=4}s&&this._gl.uniform4fv(this._location,o)},v.prototype.set=function(){for(var e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,i=this.value,r=i.length,n=0;r>n;++n){var o=i[n];e.activeTexture(t+n),e.bindTexture(o._target,o._texture)}},v.prototype._setSampler=function(e){this.textureUnitIndex=e;for(var t=this._locations,i=t.length,r=0;i>r;++r){var n=e+r;this._gl.uniform1i(t[r],n)}return e+i},g.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0;t>n;++n){var o=e[n];o!==i[n]&&(i[n]=o,r=!0)}r&&this._gl.uniform1iv(this._location,i)},_.prototype.set=function(){for(var t=this.value,i=t.length,r=this._value,n=!1,o=0,a=0;i>a;++a){var s=t[a];e.equalsArray(s,r,o)||(e.pack(s,r,o),n=!0),o+=2}n&&this._gl.uniform2iv(this._location,r)},y.prototype.set=function(){for(var e=this.value,i=e.length,r=this._value,n=!1,o=0,a=0;i>a;++a){var s=e[a];t.equalsArray(s,r,o)||(t.pack(s,r,o),n=!0),o+=3}n&&this._gl.uniform3iv(this._location,r)},C.prototype.set=function(){for(var e=this.value,t=e.length,r=this._value,n=!1,o=0,a=0;t>a;++a){var s=e[a];i.equalsArray(s,r,o)||(i.pack(s,r,o),n=!0),o+=4}n&&this._gl.uniform4iv(this._location,r)},E.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,o=0;t>o;++o){var a=e[o];s.equalsArray(a,i,n)||(s.pack(a,i,n),r=!0),n+=4}r&&this._gl.uniformMatrix2fv(this._location,!1,i)},S.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,o=0;t>o;++o){var a=e[o];l.equalsArray(a,i,n)||(l.pack(a,i,n),r=!0),n+=9}r&&this._gl.uniformMatrix3fv(this._location,!1,i)},w.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,o=0;t>o;++o){var a=e[o];u.equalsArray(a,i,n)||(u.pack(a,i,n),r=!0),n+=16}r&&this._gl.uniformMatrix4fv(this._location,!1,i)},h}),i("Renderer/ShaderProgram",["../Core/defaultValue","../Core/defined","../Core/definedNotNull","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/RuntimeError","./AutomaticUniforms","./ContextLimits","./createUniform","./createUniformArray"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e){var t=m(e.vertexShaderText,e.fragmentShaderText);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=t.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=t.fragmentShaderText,this.id=C++}function d(e){var t=[],r=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(i(r))for(var n=r.length,o=0;n>o;o++){var a=r[o].trim(),s=a.slice(a.lastIndexOf(" ")+1);t.push(s)}return t}function m(e,t){var i={};if(!l.highpFloatSupported||!l.highpIntSupported){var r,n,o,a,s=d(e),u=d(t),c=s.length,h=u.length;for(r=0;c>r;r++)for(n=0;h>n;n++)if(s[r]===u[n]){o=s[r],a="czm_mediump_"+o;var m=new RegExp(o+"\\b","g");t=t.replace(m,a),i[a]=o}}return{fragmentShaderText:t,duplicateUniformNames:i}}function p(e,i){var r=i._vertexShaderText,n=i._fragmentShaderText,o=e.createShader(e.VERTEX_SHADER);e.shaderSource(o,r),e.compileShader(o);var s=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(s,n),e.compileShader(s);var l=e.createProgram();e.attachShader(l,o),e.attachShader(l,s),e.deleteShader(o),e.deleteShader(s);var u=i._attributeLocations;if(t(u))for(var c in u)u.hasOwnProperty(c)&&e.bindAttribLocation(l,u[c],c);e.linkProgram(l);var h;if(!e.getProgramParameter(l,e.LINK_STATUS)){var d=i._debugShaders;if(!e.getShaderParameter(s,e.COMPILE_STATUS)){if(h=e.getShaderInfoLog(s),console.error(E+"Fragment shader compile log: "+h),t(d)){var m=d.getTranslatedShaderSource(s);""!==m?console.error(E+"Translated fragment shader source:\n"+m):console.error(E+"Fragment shader translation failed.")}throw e.deleteProgram(l),new a("Fragment shader failed to compile. Compile log: "+h)}if(!e.getShaderParameter(o,e.COMPILE_STATUS)){if(h=e.getShaderInfoLog(o),console.error(E+"Vertex shader compile log: "+h),t(d)){var p=d.getTranslatedShaderSource(o);""!==p?console.error(E+"Translated vertex shader source:\n"+p):console.error(E+"Vertex shader translation failed.")}throw e.deleteProgram(l),new a("Vertex shader failed to compile. Compile log: "+h)}throw h=e.getProgramInfoLog(l),console.error(E+"Shader program link log: "+h),t(d)&&(console.error(E+"Translated vertex shader source:\n"+d.getTranslatedShaderSource(o)),console.error(E+"Translated fragment shader source:\n"+d.getTranslatedShaderSource(s))),e.deleteProgram(l),new a("Program failed to link. Link log: "+h)}var f=i._logShaderCompilation;return f&&(h=e.getShaderInfoLog(o),t(h)&&h.length>0&&console.log(E+"Vertex shader compile log: "+h)),f&&(h=e.getShaderInfoLog(s),t(h)&&h.length>0&&console.log(E+"Fragment shader compile log: "+h)),f&&(h=e.getProgramInfoLog(l),t(h)&&h.length>0&&console.log(E+"Shader program link log: "+h)),l}function f(e,t,i){for(var r={},n=0;i>n;++n){var o=e.getActiveAttrib(t,n),a=e.getAttribLocation(t,o.name);r[o.name]={name:o.name,type:o.type,index:a}}return r}function v(e,i){for(var r={},n=[],o=[],a=e.getProgramParameter(i,e.ACTIVE_UNIFORMS),s=0;a>s;++s){var l=e.getActiveUniform(i,s),h="[0]",d=-1!==l.name.indexOf(h,l.name.length-h.length)?l.name.slice(0,l.name.length-3):l.name;if(0!==d.indexOf("gl_"))if(l.name.indexOf("[")<0){var m=e.getUniformLocation(i,d);if(null!==m){var p=u(e,l,d,m);r[d]=p,n.push(p),p._setSampler&&o.push(p)}}else{var f,v,g,_,y=d.indexOf("[");if(y>=0){if(f=r[d.slice(0,y)],!t(f))continue;v=f._locations,v.length<=1&&(g=f.value,_=e.getUniformLocation(i,d),null!==_&&(v.push(_),g.push(e.getUniform(i,_))))}else{v=[];for(var C=0;C<l.size;++C)_=e.getUniformLocation(i,d+"["+C+"]"),null!==_&&v.push(_);f=c(e,l,d,v),r[d]=f,n.push(f),f._setSampler&&o.push(f)}}}return{uniformsByName:r,uniforms:n,samplerUniforms:o}}function g(e,i){var r=[],n=[];for(var o in i)if(i.hasOwnProperty(o)){var a=i[o],l=o,u=e._duplicateUniformNames[l];t(u)&&(a.name=u,l=u);var c=s[l];t(c)?r.push({uniform:a,automaticUniform:c}):n.push(a)}return{automaticUniforms:r,manualUniforms:n}}function _(e,t,i){e.useProgram(t);for(var r=0,n=i.length,o=0;n>o;++o)r=i[o]._setSampler(r);return e.useProgram(null),r}function y(e){if(!t(e._program)){var i=e._gl,r=p(i,e,e._debugShaders),n=i.getProgramParameter(r,i.ACTIVE_ATTRIBUTES),o=v(i,r),a=g(e,o.uniformsByName);e._program=r,e._numberOfVertexAttributes=n,e._vertexAttributes=f(i,r,n),e._uniformsByName=o.uniformsByName,e._uniforms=o.uniforms,e._automaticUniforms=a.automaticUniforms,e._manualUniforms=a.manualUniforms,e.maximumTextureUnitIndex=_(i,r,o.samplerUniforms)}}var C=0;h.fromCache=function(t){return t=e(t,e.EMPTY_OBJECT),t.context.shaderCache.getShaderProgram(t)},h.replaceCache=function(t){return t=e(t,e.EMPTY_OBJECT),t.context.shaderCache.replaceShaderProgram(t)},r(h.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return y(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return y(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return y(this),this._uniformsByName}}});var E="[Cesium WebGL] ";return h.prototype._bind=function(){y(this),this._gl.useProgram(this._program)},h.prototype._setUniforms=function(e,i,r){var n,a;if(t(e)){var s=this._manualUniforms;for(n=s.length,a=0;n>a;++a){var l=s[a];l.value=e[l.name]()}}var u=this._automaticUniforms;for(n=u.length,a=0;n>a;++a){var c=u[a];c.uniform.value=c.automaticUniform.getValue(i)}var h=this._uniforms;for(n=h.length,a=0;n>a;++a)h[a].set();if(r){var d=this._gl,m=this._program;if(d.validateProgram(m),!d.getProgramParameter(m,d.VALIDATE_STATUS))throw new o("Program validation failed. Program info log: "+d.getProgramInfoLog(m))}},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)},h.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),n(this)},h}),i("Shaders/Builtin/Constants/degreesPerRadian",[],function(){"use strict";return"const float czm_degreesPerRadian = 57.29577951308232;\n"}),i("Shaders/Builtin/Constants/depthRange",[],function(){"use strict";return"const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);\n"}),i("Shaders/Builtin/Constants/epsilon1",[],function(){"use strict";return"const float czm_epsilon1 = 0.1;\n"}),i("Shaders/Builtin/Constants/epsilon2",[],function(){"use strict";return"const float czm_epsilon2 = 0.01;\n"}),i("Shaders/Builtin/Constants/epsilon3",[],function(){"use strict";return"const float czm_epsilon3 = 0.001;\n"}),i("Shaders/Builtin/Constants/epsilon4",[],function(){"use strict";return"const float czm_epsilon4 = 0.0001;\n"}),i("Shaders/Builtin/Constants/epsilon5",[],function(){"use strict";return"const float czm_epsilon5 = 0.00001;\n"}),i("Shaders/Builtin/Constants/epsilon6",[],function(){"use strict";return"const float czm_epsilon6 = 0.000001;\n"}),i("Shaders/Builtin/Constants/epsilon7",[],function(){"use strict";return"const float czm_epsilon7 = 0.0000001;\n"}),i("Shaders/Builtin/Constants/infinity",[],function(){"use strict";return"const float czm_infinity = 5906376272000.0;\n"}),i("Shaders/Builtin/Constants/oneOverPi",[],function(){"use strict";return"const float czm_oneOverPi = 0.3183098861837907;\n"}),i("Shaders/Builtin/Constants/oneOverTwoPi",[],function(){"use strict";return"const float czm_oneOverTwoPi = 0.15915494309189535;\n"}),i("Shaders/Builtin/Constants/pi",[],function(){"use strict";return"const float czm_pi = 3.141592653589793;\n"}),i("Shaders/Builtin/Constants/piOverFour",[],function(){"use strict";return"const float czm_piOverFour = 0.7853981633974483;\n"}),i("Shaders/Builtin/Constants/piOverSix",[],function(){"use strict";return"const float czm_piOverSix = 0.5235987755982988;\n"}),i("Shaders/Builtin/Constants/piOverThree",[],function(){"use strict";return"const float czm_piOverThree = 1.0471975511965976;\n"}),i("Shaders/Builtin/Constants/piOverTwo",[],function(){"use strict";return"const float czm_piOverTwo = 1.5707963267948966;\n"}),i("Shaders/Builtin/Constants/radiansPerDegree",[],function(){"use strict";return"const float czm_radiansPerDegree = 0.017453292519943295;\n"}),i("Shaders/Builtin/Constants/sceneMode2D",[],function(){"use strict";return"const float czm_sceneMode2D = 2.0;\n"}),i("Shaders/Builtin/Constants/sceneMode3D",[],function(){"use strict";return"const float czm_sceneMode3D = 3.0;\n"}),i("Shaders/Builtin/Constants/sceneModeColumbusView",[],function(){"use strict";return"const float czm_sceneModeColumbusView = 1.0;\n"}),i("Shaders/Builtin/Constants/sceneModeMorphing",[],function(){"use strict";return"const float czm_sceneModeMorphing = 0.0;\n"}),i("Shaders/Builtin/Constants/solarRadius",[],function(){"use strict";return"const float czm_solarRadius = 695500000.0;\n"}),i("Shaders/Builtin/Constants/threePiOver2",[],function(){"use strict";return"const float czm_threePiOver2 = 4.71238898038469;\n"}),i("Shaders/Builtin/Constants/twoPi",[],function(){"use strict";return"const float czm_twoPi = 6.283185307179586;\n"}),i("Shaders/Builtin/Constants/webMercatorMaxLatitude",[],function(){"use strict";return"const float czm_webMercatorMaxLatitude = 1.4844222297453324;\n"}),i("Shaders/Builtin/Structs/depthRangeStruct",[],function(){"use strict";return"struct czm_depthRangeStruct\n{\nfloat near;\nfloat far;\n};\n"}),i("Shaders/Builtin/Structs/ellipsoid",[],function(){"use strict";return"struct czm_ellipsoid\n{\nvec3 center;\nvec3 radii;\nvec3 inverseRadii;\nvec3 inverseRadiiSquared;\n};\n"}),i("Shaders/Builtin/Structs/material",[],function(){"use strict";return"struct czm_material\n{\nvec3 diffuse;\nfloat specular;\nfloat shininess;\nvec3 normal;\nvec3 emission;\nfloat alpha;\n};\n"}),i("Shaders/Builtin/Structs/materialInput",[],function(){"use strict";return"struct czm_materialInput\n{\nfloat s;\nvec2 st;\nvec3 str;\nvec3 normalEC;\nmat3 tangentToEyeMatrix;\nvec3 positionToEyeEC;\n};\n"}),i("Shaders/Builtin/Structs/ray",[],function(){"use strict";return"struct czm_ray\n{\nvec3 origin;\nvec3 direction;\n};\n"}),i("Shaders/Builtin/Structs/raySegment",[],function(){"use strict";return"struct czm_raySegment\n{\nfloat start;\nfloat stop;\n};\nconst czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity);\nconst czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity);\n"}),i("Shaders/Builtin/Functions/alphaWeight",[],function(){"use strict";return"float czm_alphaWeight(float a)\n{\nfloat z;\nif (czm_sceneMode != czm_sceneMode2D)\n{\nfloat x = 2.0 * (gl_FragCoord.x - czm_viewport.x) / czm_viewport.z - 1.0;\nfloat y = 2.0 * (gl_FragCoord.y - czm_viewport.y) / czm_viewport.w - 1.0;\nz = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\nvec4 q = vec4(x, y, z, 0.0);\nq /= gl_FragCoord.w;\nz = (czm_inverseProjectionOIT * q).z;\n}\nelse\n{\nz = gl_FragCoord.z * (czm_currentFrustum.y - czm_currentFrustum.x) + czm_currentFrustum.x;\n}\nreturn pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 100.0 / (1e-5 + pow(abs(z) / 10.0, 3.0) + pow(abs(z) / 200.0, 6.0))));\n}\n"}),i("Shaders/Builtin/Functions/antialias",[],function(){"use strict";return"vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor)\n{\nfloat val1 = clamp(dist / fuzzFactor, 0.0, 1.0);\nfloat val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0);\nval1 = val1 * (1.0 - val2);\nval1 = val1 * val1 * (3.0 - (2.0 * val1));\nval1 = pow(val1, 0.5);\nvec4 midColor = (color1 + color2) * 0.5;\nreturn mix(midColor, currentColor, val1);\n}\nvec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist)\n{\nreturn czm_antialias(color1, color2, currentColor, dist, 0.1);\n}\n"}),i("Shaders/Builtin/Functions/columbusViewMorph",[],function(){"use strict";return"vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)\n{\nvec3 p = mix(position2D.xyz, position3D.xyz, time);\nreturn vec4(p, 1.0);\n}\n"}),i("Shaders/Builtin/Functions/computePosition",[],function(){"use strict";return"vec4 czm_computePosition();\n"}),i("Shaders/Builtin/Functions/cosineAndSine",[],function(){"use strict";return"vec2 cordic(float angle)\n{\nvec2 vector = vec2(6.0725293500888267e-1, 0.0);\nfloat sense = (angle < 0.0) ? -1.0 : 1.0;\nmat2 rotation = mat2(1.0, sense, -sense, 1.0);\nvector = rotation * vector;\nangle -= sense * 7.8539816339744828e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfloat factor = sense * 5.0e-1;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 4.6364760900080609e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 2.5e-1;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 2.4497866312686414e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.25e-1;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.2435499454676144e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 6.25e-2;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 6.2418809995957350e-2;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.125e-2;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.1239833430268277e-2;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.5625e-2;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.5623728620476831e-2;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 7.8125e-3;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 7.8123410601011111e-3;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.90625e-3;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.9062301319669718e-3;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.953125e-3;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.9531225164788188e-3;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 9.765625e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 9.7656218955931946e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 4.8828125e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 4.8828121119489829e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 2.44140625e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 2.4414062014936177e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.220703125e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.2207031189367021e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 6.103515625e-5;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 6.1035156174208773e-5;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.0517578125e-5;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.0517578115526096e-5;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.52587890625e-5;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.5258789061315762e-5;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 7.62939453125e-6;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 7.6293945311019700e-6;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.814697265625e-6;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.8146972656064961e-6;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.9073486328125e-6;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.9073486328101870e-6;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 9.5367431640625e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 9.5367431640596084e-7;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 4.76837158203125e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 4.7683715820308884e-7;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 2.384185791015625e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 2.3841857910155797e-7;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.1920928955078125e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nreturn vector;\n}\nvec2 czm_cosineAndSine(float angle)\n{\nif (angle < -czm_piOverTwo || angle > czm_piOverTwo)\n{\nif (angle < 0.0)\n{\nreturn -cordic(angle + czm_pi);\n}\nelse\n{\nreturn -cordic(angle - czm_pi);\n}\n}\nelse\n{\nreturn cordic(angle);\n}\n}\n"}),i("Shaders/Builtin/Functions/decompressTextureCoordinates",[],function(){"use strict";return"vec2 czm_decompressTextureCoordinates(float encoded)\n{\nfloat temp = encoded / 4096.0;\nfloat stx = floor(temp) / 4096.0;\nfloat sty = temp - floor(temp);\nreturn vec2(stx, sty);\n}\n"}),i("Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates",[],function(){"use strict";return"mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)\n{\nvec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0));\nvec3 tangentEC = normalize(czm_normal3D * tangentMC);\nvec3 bitangentEC = normalize(cross(normalEC, tangentEC));\nreturn mat3(\ntangentEC.x, tangentEC.y, tangentEC.z,\nbitangentEC.x, bitangentEC.y, bitangentEC.z,\nnormalEC.x, normalEC.y, normalEC.z);\n}\n"}),i("Shaders/Builtin/Functions/ellipsoidContainsPoint",[],function(){"use strict";return"bool czm_ellipsoidContainsPoint(czm_ellipsoid ellipsoid, vec3 point)\n{\nvec3 scaled = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;\nreturn (dot(scaled, scaled) <= 1.0);\n}\n"}),i("Shaders/Builtin/Functions/ellipsoidNew",[],function(){"use strict";return"czm_ellipsoid czm_ellipsoidNew(vec3 center, vec3 radii)\n{\nvec3 inverseRadii = vec3(1.0 / radii.x, 1.0 / radii.y, 1.0 / radii.z);\nvec3 inverseRadiiSquared = inverseRadii * inverseRadii;\nczm_ellipsoid temp = czm_ellipsoid(center, radii, inverseRadii, inverseRadiiSquared);\nreturn temp;\n}\n"}),i("Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates",[],function(){"use strict";return"vec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal)\n{\nreturn vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);\n}\n"}),i("Shaders/Builtin/Functions/equalsEpsilon",[],function(){"use strict";return"bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec4(epsilon)));\n}\nbool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec3(epsilon)));\n}\nbool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec2(epsilon)));\n}\nbool czm_equalsEpsilon(float left, float right, float epsilon) {\nreturn (abs(left - right) <= epsilon);\n}\n"}),i("Shaders/Builtin/Functions/eyeOffset",[],function(){"use strict";return"vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)\n{\nvec4 p = positionEC;\nvec4 zEyeOffset = normalize(p) * eyeOffset.z;\np.xy += eyeOffset.xy + zEyeOffset.xy;\np.z += zEyeOffset.z;\nreturn p;\n}\n"}),i("Shaders/Builtin/Functions/eyeToWindowCoordinates",[],function(){"use strict";return"vec4 czm_eyeToWindowCoordinates(vec4 positionEC)\n{\nvec4 q = czm_projection * positionEC;\nq.xyz /= q.w;\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\nreturn q;\n}\n"}),i("Shaders/Builtin/Functions/fog",[],function(){"use strict";return"vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor)\n{\nfloat scalar = distanceToCamera * czm_fogDensity;\nfloat fog = 1.0 - exp(-(scalar * scalar));\nreturn mix(color, fogColor, fog);\n}\n"}),i("Shaders/Builtin/Functions/geodeticSurfaceNormal",[],function(){"use strict";return"vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)\n{\nreturn normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);\n}\n"}),i("Shaders/Builtin/Functions/getDefaultMaterial",[],function(){"use strict";return"czm_material czm_getDefaultMaterial(czm_materialInput materialInput)\n{\nczm_material material;\nmaterial.diffuse = vec3(0.0);\nmaterial.specular = 0.0;\nmaterial.shininess = 1.0;\nmaterial.normal = materialInput.normalEC;\nmaterial.emission = vec3(0.0);\nmaterial.alpha = 1.0;\nreturn material;\n}\n"}),i("Shaders/Builtin/Functions/getLambertDiffuse",[],function(){"use strict";return"float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)\n{\nreturn max(dot(lightDirectionEC, normalEC), 0.0);\n}\n"}),i("Shaders/Builtin/Functions/getSpecular",[],function(){"use strict";return"float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)\n{\nvec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);\nfloat specular = max(dot(toReflectedLight, toEyeEC), 0.0);\nreturn pow(specular, shininess);\n}\n"}),i("Shaders/Builtin/Functions/getWaterNoise",[],function(){"use strict";return"vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)\n{\nfloat cosAngle = cos(angleInRadians);\nfloat sinAngle = sin(angleInRadians);\nvec2 s0 = vec2(1.0/17.0, 0.0);\nvec2 s1 = vec2(-1.0/29.0, 0.0);\nvec2 s2 = vec2(1.0/101.0, 1.0/59.0);\nvec2 s3 = vec2(-1.0/109.0, -1.0/57.0);\ns0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));\ns1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));\ns2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));\ns3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));\nvec2 uv0 = (uv/103.0) + (time * s0);\nvec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);\nvec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);\nvec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);\nuv0 = fract(uv0);\nuv1 = fract(uv1);\nuv2 = fract(uv2);\nuv3 = fract(uv3);\nvec4 noise = (texture2D(normalMap, uv0)) +\n(texture2D(normalMap, uv1)) +\n(texture2D(normalMap, uv2)) +\n(texture2D(normalMap, uv3));\nreturn ((noise / 4.0) - 0.5) * 2.0;\n}\n"}),i("Shaders/Builtin/Functions/getWgs84EllipsoidEC",[],function(){"use strict";return"czm_ellipsoid czm_getWgs84EllipsoidEC()\n{\nvec3 radii = vec3(6378137.0, 6378137.0, 6356752.314245);\nvec3 inverseRadii = vec3(1.0 / radii.x, 1.0 / radii.y, 1.0 / radii.z);\nvec3 inverseRadiiSquared = inverseRadii * inverseRadii;\nczm_ellipsoid temp = czm_ellipsoid(czm_view[3].xyz, radii, inverseRadii, inverseRadiiSquared);\nreturn temp;\n}\n"}),i("Shaders/Builtin/Functions/hue",[],function(){"use strict";return"vec3 czm_hue(vec3 rgb, float adjustment)\n{\nconst mat3 toYIQ = mat3(0.299, 0.587, 0.114,\n0.595716, -0.274453, -0.321263,\n0.211456, -0.522591, 0.311135);\nconst mat3 toRGB = mat3(1.0, 0.9563, 0.6210,\n1.0, -0.2721, -0.6474,\n1.0, -1.107, 1.7046);\nvec3 yiq = toYIQ * rgb;\nfloat hue = atan(yiq.z, yiq.y) + adjustment;\nfloat chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);\nvec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));\nreturn toRGB * color;\n}\n"}),i("Shaders/Builtin/Functions/isEmpty",[],function(){"use strict";return"bool czm_isEmpty(czm_raySegment interval)\n{\nreturn (interval.stop < 0.0);\n}\n"}),i("Shaders/Builtin/Functions/isFull",[],function(){"use strict";return"bool czm_isFull(czm_raySegment interval)\n{\nreturn (interval.start == 0.0 && interval.stop == czm_infinity);\n}\n"}),i("Shaders/Builtin/Functions/latitudeToWebMercatorFraction",[],function(){"use strict";return"float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight)\n{\nfloat sinLatitude = sin(latitude);\nfloat mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));\nreturn (mercatorY - southMercatorY) * oneOverMercatorHeight;\n}\n"; +}),i("Shaders/Builtin/Functions/luminance",[],function(){"use strict";return"float czm_luminance(vec3 rgb)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nreturn dot(rgb, W);\n}\n"}),i("Shaders/Builtin/Functions/metersPerPixel",[],function(){"use strict";return"float czm_metersPerPixel(vec4 positionEC)\n{\nfloat width = czm_viewport.z;\nfloat height = czm_viewport.w;\nfloat pixelWidth;\nfloat pixelHeight;\nfloat top = czm_frustumPlanes.x;\nfloat bottom = czm_frustumPlanes.y;\nfloat left = czm_frustumPlanes.z;\nfloat right = czm_frustumPlanes.w;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nfloat frustumWidth = right - left;\nfloat frustumHeight = top - bottom;\npixelWidth = frustumWidth / width;\npixelHeight = frustumHeight / height;\n}\nelse\n{\nfloat distanceToPixel = -positionEC.z;\nfloat inverseNear = 1.0 / czm_currentFrustum.x;\nfloat tanTheta = top * inverseNear;\npixelHeight = 2.0 * distanceToPixel * tanTheta / height;\ntanTheta = right * inverseNear;\npixelWidth = 2.0 * distanceToPixel * tanTheta / width;\n}\nreturn max(pixelWidth, pixelHeight);\n}\n"}),i("Shaders/Builtin/Functions/modelToWindowCoordinates",[],function(){"use strict";return"vec4 czm_modelToWindowCoordinates(vec4 position)\n{\nvec4 q = czm_modelViewProjection * position;\nq.xyz /= q.w;\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\nreturn q;\n}\n"}),i("Shaders/Builtin/Functions/multiplyWithColorBalance",[],function(){"use strict";return"vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvec3 target = left * right;\nfloat leftLuminance = dot(left, W);\nfloat rightLuminance = dot(right, W);\nfloat targetLuminance = dot(target, W);\nreturn ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;\n}\n"}),i("Shaders/Builtin/Functions/nearFarScalar",[],function(){"use strict";return"float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq)\n{\nfloat valueAtMin = nearFarScalar.y;\nfloat valueAtMax = nearFarScalar.w;\nfloat nearDistanceSq = nearFarScalar.x * nearFarScalar.x;\nfloat farDistanceSq = nearFarScalar.z * nearFarScalar.z;\nfloat t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);\nt = pow(clamp(t, 0.0, 1.0), 0.2);\nreturn mix(valueAtMin, valueAtMax, t);\n}\n"}),i("Shaders/Builtin/Functions/octDecode",[],function(){"use strict";return"vec3 czm_octDecode(vec2 encoded)\n{\nencoded = encoded / 255.0 * 2.0 - 1.0;\nvec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y));\nif (v.z < 0.0)\n{\nv.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy);\n}\nreturn normalize(v);\n}\nvec3 czm_octDecode(float encoded)\n{\nfloat temp = encoded / 256.0;\nfloat x = floor(temp);\nfloat y = (temp - x) * 256.0;\nreturn czm_octDecode(vec2(x, y));\n}\nvoid czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3)\n{\nfloat temp = encoded.x / 65536.0;\nfloat x = floor(temp);\nfloat encodedFloat1 = (temp - x) * 65536.0;\ntemp = encoded.y / 65536.0;\nfloat y = floor(temp);\nfloat encodedFloat2 = (temp - y) * 65536.0;\nvector1 = czm_octDecode(encodedFloat1);\nvector2 = czm_octDecode(encodedFloat2);\nvector3 = czm_octDecode(vec2(x, y));\n}\n"}),i("Shaders/Builtin/Functions/packDepth",[],function(){"use strict";return"vec4 czm_packDepth(float depth)\n{\nvec4 enc = vec4(1.0, 255.0, 65025.0, 160581375.0) * depth;\nenc = fract(enc);\nenc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\nreturn enc;\n}\n"}),i("Shaders/Builtin/Functions/phong",[],function(){"use strict";return"float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)\n{\nreturn czm_getLambertDiffuse(lightDirectionEC, material.normal);\n}\nfloat czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)\n{\nreturn czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);\n}\nvec4 czm_phong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);\nif (czm_sceneMode == czm_sceneMode3D) {\ndiffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\n}\nfloat specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material) + czm_private_getSpecularOfMaterial(czm_moonDirectionEC, toEye, material);\nvec3 materialDiffuse = material.diffuse * 0.5;\nvec3 ambient = materialDiffuse;\nvec3 color = ambient + material.emission;\ncolor += materialDiffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\nvec4 czm_private_phong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(czm_sunDirectionEC, material);\nfloat specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material);\nvec3 ambient = vec3(0.0);\nvec3 color = ambient + material.emission;\ncolor += material.diffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\n"}),i("Shaders/Builtin/Functions/pointAlongRay",[],function(){"use strict";return"vec3 czm_pointAlongRay(czm_ray ray, float time)\n{\nreturn ray.origin + (time * ray.direction);\n}\n"}),i("Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval",[],function(){"use strict";return"czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, czm_ellipsoid ellipsoid)\n{\nvec3 q = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;\nvec3 w = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;\nq = q - ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ellipsoid.center, 1.0)).xyz;\nfloat q2 = dot(q, q);\nfloat qw = dot(q, w);\nif (q2 > 1.0)\n{\nif (qw >= 0.0)\n{\nreturn czm_emptyRaySegment;\n}\nelse\n{\nfloat qw2 = qw * qw;\nfloat difference = q2 - 1.0;\nfloat w2 = dot(w, w);\nfloat product = w2 * difference;\nif (qw2 < product)\n{\nreturn czm_emptyRaySegment;\n}\nelse if (qw2 > product)\n{\nfloat discriminant = qw * qw - product;\nfloat temp = -qw + sqrt(discriminant);\nfloat root0 = temp / w2;\nfloat root1 = difference / temp;\nif (root0 < root1)\n{\nczm_raySegment i = czm_raySegment(root0, root1);\nreturn i;\n}\nelse\n{\nczm_raySegment i = czm_raySegment(root1, root0);\nreturn i;\n}\n}\nelse\n{\nfloat root = sqrt(difference / w2);\nczm_raySegment i = czm_raySegment(root, root);\nreturn i;\n}\n}\n}\nelse if (q2 < 1.0)\n{\nfloat difference = q2 - 1.0;\nfloat w2 = dot(w, w);\nfloat product = w2 * difference;\nfloat discriminant = qw * qw - product;\nfloat temp = -qw + sqrt(discriminant);\nczm_raySegment i = czm_raySegment(0.0, temp / w2);\nreturn i;\n}\nelse\n{\nif (qw < 0.0)\n{\nfloat w2 = dot(w, w);\nczm_raySegment i = czm_raySegment(0.0, -qw / w2);\nreturn i;\n}\nelse\n{\nreturn czm_emptyRaySegment;\n}\n}\n}\n"}),i("Shaders/Builtin/Functions/RGBToXYZ",[],function(){"use strict";return"vec3 czm_RGBToXYZ(vec3 rgb)\n{\nconst mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,\n0.3576, 0.7152, 0.1192,\n0.1805, 0.0722, 0.9505);\nvec3 xyz = RGB2XYZ * rgb;\nvec3 Yxy;\nYxy.r = xyz.g;\nfloat temp = dot(vec3(1.0), xyz);\nYxy.gb = xyz.rg / temp;\nreturn Yxy;\n}\n"}),i("Shaders/Builtin/Functions/saturation",[],function(){"use strict";return"vec3 czm_saturation(vec3 rgb, float adjustment)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvec3 intensity = vec3(dot(rgb, W));\nreturn mix(intensity, rgb, adjustment);\n}\n"}),i("Shaders/Builtin/Functions/signNotZero",[],function(){"use strict";return"float czm_signNotZero(float value)\n{\nreturn value >= 0.0 ? 1.0 : -1.0;\n}\nvec2 czm_signNotZero(vec2 value)\n{\nreturn vec2(czm_signNotZero(value.x), czm_signNotZero(value.y));\n}\nvec3 czm_signNotZero(vec3 value)\n{\nreturn vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z));\n}\nvec4 czm_signNotZero(vec4 value)\n{\nreturn vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w));\n}\n"}),i("Shaders/Builtin/Functions/tangentToEyeSpaceMatrix",[],function(){"use strict";return"mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 binormalEC)\n{\nvec3 normal = normalize(normalEC);\nvec3 tangent = normalize(tangentEC);\nvec3 binormal = normalize(binormalEC);\nreturn mat3(tangent.x, tangent.y, tangent.z,\nbinormal.x, binormal.y, binormal.z,\nnormal.x, normal.y, normal.z);\n}\n"}),i("Shaders/Builtin/Functions/translateRelativeToEye",[],function(){"use strict";return"vec4 czm_translateRelativeToEye(vec3 high, vec3 low)\n{\nvec3 highDifference = high - czm_encodedCameraPositionMCHigh;\nvec3 lowDifference = low - czm_encodedCameraPositionMCLow;\nreturn vec4(highDifference + lowDifference, 1.0);\n}\n"}),i("Shaders/Builtin/Functions/translucentPhong",[],function(){"use strict";return"vec4 czm_translucentPhong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);\nif (czm_sceneMode == czm_sceneMode3D) {\ndiffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);\n}\ndiffuse = clamp(diffuse, 0.0, 1.0);\nfloat specular = czm_getSpecular(czm_sunDirectionEC, toEye, material.normal, material.shininess);\nspecular += czm_getSpecular(czm_moonDirectionEC, toEye, material.normal, material.shininess);\nvec3 materialDiffuse = material.diffuse * 0.5;\nvec3 ambient = materialDiffuse;\nvec3 color = ambient + material.emission;\ncolor += materialDiffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\n"}),i("Shaders/Builtin/Functions/transpose",[],function(){"use strict";return"mat2 czm_transpose(mat2 matrix)\n{\nreturn mat2(\nmatrix[0][0], matrix[1][0],\nmatrix[0][1], matrix[1][1]);\n}\nmat3 czm_transpose(mat3 matrix)\n{\nreturn mat3(\nmatrix[0][0], matrix[1][0], matrix[2][0],\nmatrix[0][1], matrix[1][1], matrix[2][1],\nmatrix[0][2], matrix[1][2], matrix[2][2]);\n}\nmat4 czm_transpose(mat4 matrix)\n{\nreturn mat4(\nmatrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],\nmatrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],\nmatrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],\nmatrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);\n}\n"}),i("Shaders/Builtin/Functions/unpackDepth",[],function(){"use strict";return"float czm_unpackDepth(vec4 packedDepth)\n{\nreturn dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 160581375.0));\n}\n"}),i("Shaders/Builtin/Functions/windowToEyeCoordinates",[],function(){"use strict";return"vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)\n{\nfloat x = 2.0 * (fragmentCoordinate.x - czm_viewport.x) / czm_viewport.z - 1.0;\nfloat y = 2.0 * (fragmentCoordinate.y - czm_viewport.y) / czm_viewport.w - 1.0;\nfloat z = (fragmentCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\nvec4 q = vec4(x, y, z, 1.0);\nq /= fragmentCoordinate.w;\nq = czm_inverseProjection * q;\nreturn q;\n}\n"}),i("Shaders/Builtin/Functions/XYZToRGB",[],function(){"use strict";return"vec3 czm_XYZToRGB(vec3 Yxy)\n{\nconst mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556,\n-1.5371, 1.8760, -0.2040,\n-0.4985, 0.0416, 1.0572);\nvec3 xyz;\nxyz.r = Yxy.r * Yxy.g / Yxy.b;\nxyz.g = Yxy.r;\nxyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;\nreturn XYZ2RGB * xyz;\n}\n"}),i("Shaders/Builtin/CzmBuiltins",["./Constants/degreesPerRadian","./Constants/depthRange","./Constants/epsilon1","./Constants/epsilon2","./Constants/epsilon3","./Constants/epsilon4","./Constants/epsilon5","./Constants/epsilon6","./Constants/epsilon7","./Constants/infinity","./Constants/oneOverPi","./Constants/oneOverTwoPi","./Constants/pi","./Constants/piOverFour","./Constants/piOverSix","./Constants/piOverThree","./Constants/piOverTwo","./Constants/radiansPerDegree","./Constants/sceneMode2D","./Constants/sceneMode3D","./Constants/sceneModeColumbusView","./Constants/sceneModeMorphing","./Constants/solarRadius","./Constants/threePiOver2","./Constants/twoPi","./Constants/webMercatorMaxLatitude","./Structs/depthRangeStruct","./Structs/ellipsoid","./Structs/material","./Structs/materialInput","./Structs/ray","./Structs/raySegment","./Functions/alphaWeight","./Functions/antialias","./Functions/columbusViewMorph","./Functions/computePosition","./Functions/cosineAndSine","./Functions/decompressTextureCoordinates","./Functions/eastNorthUpToEyeCoordinates","./Functions/ellipsoidContainsPoint","./Functions/ellipsoidNew","./Functions/ellipsoidWgs84TextureCoordinates","./Functions/equalsEpsilon","./Functions/eyeOffset","./Functions/eyeToWindowCoordinates","./Functions/fog","./Functions/geodeticSurfaceNormal","./Functions/getDefaultMaterial","./Functions/getLambertDiffuse","./Functions/getSpecular","./Functions/getWaterNoise","./Functions/getWgs84EllipsoidEC","./Functions/hue","./Functions/isEmpty","./Functions/isFull","./Functions/latitudeToWebMercatorFraction","./Functions/luminance","./Functions/metersPerPixel","./Functions/modelToWindowCoordinates","./Functions/multiplyWithColorBalance","./Functions/nearFarScalar","./Functions/octDecode","./Functions/packDepth","./Functions/phong","./Functions/pointAlongRay","./Functions/rayEllipsoidIntersectionInterval","./Functions/RGBToXYZ","./Functions/saturation","./Functions/signNotZero","./Functions/tangentToEyeSpaceMatrix","./Functions/translateRelativeToEye","./Functions/translucentPhong","./Functions/transpose","./Functions/unpackDepth","./Functions/windowToEyeCoordinates","./Functions/XYZToRGB"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O,N,L,F,B,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,he,de,me,pe,fe,ve,ge,_e,ye,Ce,Ee){"use strict";return{czm_degreesPerRadian:e,czm_depthRange:t,czm_epsilon1:i,czm_epsilon2:r,czm_epsilon3:n,czm_epsilon4:o,czm_epsilon5:a,czm_epsilon6:s,czm_epsilon7:l,czm_infinity:u,czm_oneOverPi:c,czm_oneOverTwoPi:h,czm_pi:d,czm_piOverFour:m,czm_piOverSix:p,czm_piOverThree:f,czm_piOverTwo:v,czm_radiansPerDegree:g,czm_sceneMode2D:_,czm_sceneMode3D:y,czm_sceneModeColumbusView:C,czm_sceneModeMorphing:E,czm_solarRadius:S,czm_threePiOver2:w,czm_twoPi:T,czm_webMercatorMaxLatitude:x,czm_depthRangeStruct:b,czm_ellipsoid:A,czm_material:P,czm_materialInput:I,czm_ray:M,czm_raySegment:D,czm_alphaWeight:R,czm_antialias:O,czm_columbusViewMorph:N,czm_computePosition:L,czm_cosineAndSine:F,czm_decompressTextureCoordinates:B,czm_eastNorthUpToEyeCoordinates:V,czm_ellipsoidContainsPoint:k,czm_ellipsoidNew:z,czm_ellipsoidWgs84TextureCoordinates:U,czm_equalsEpsilon:G,czm_eyeOffset:W,czm_eyeToWindowCoordinates:H,czm_fog:q,czm_geodeticSurfaceNormal:j,czm_getDefaultMaterial:Y,czm_getLambertDiffuse:X,czm_getSpecular:Z,czm_getWaterNoise:K,czm_getWgs84EllipsoidEC:Q,czm_hue:J,czm_isEmpty:$,czm_isFull:ee,czm_latitudeToWebMercatorFraction:te,czm_luminance:ie,czm_metersPerPixel:re,czm_modelToWindowCoordinates:ne,czm_multiplyWithColorBalance:oe,czm_nearFarScalar:ae,czm_octDecode:se,czm_packDepth:le,czm_phong:ue,czm_pointAlongRay:ce,czm_rayEllipsoidIntersectionInterval:he,czm_RGBToXYZ:de,czm_saturation:me,czm_signNotZero:pe,czm_tangentToEyeSpaceMatrix:fe,czm_translateRelativeToEye:ve,czm_translucentPhong:ge,czm_transpose:_e,czm_unpackDepth:ye,czm_windowToEyeCoordinates:Ce,czm_XYZToRGB:Ee}}),i("Renderer/ShaderSource",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Shaders/Builtin/CzmBuiltins","./AutomaticUniforms"],function(e,t,i,r,n){"use strict";function o(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(e){for(var t=e.match(/\n/gm).length,i="",r=0;t>r;++r)i+="\n";return i})}function a(e,i,r){for(var n,a=0;a<r.length;++a)r[a].name===e&&(n=r[a]);return t(n)||(i=o(i),n={name:e,glslSource:i,dependsOn:[],requiredBy:[],evaluated:!1},r.push(n)),n}function s(e,i){if(!e.evaluated){e.evaluated=!0;var r=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);t(r)&&null!==r&&(r=r.filter(function(e,t){return r.indexOf(e)===t}),r.forEach(function(t){if(t!==e.name&&h._czmBuiltinsAndUniforms.hasOwnProperty(t)){var r=a(t,h._czmBuiltinsAndUniforms[t],i);e.dependsOn.push(r),r.requiredBy.push(e),s(r,i)}}))}}function l(e){for(var t=[],r=[];e.length>0;){var n=e.pop();r.push(n),0===n.requiredBy.length&&t.push(n)}for(;t.length>0;){var o=t.shift();e.push(o);for(var a=0;a<o.dependsOn.length;++a){var s=o.dependsOn[a],l=s.requiredBy.indexOf(o);s.requiredBy.splice(l,1),0===s.requiredBy.length&&t.push(s)}}for(var u=[],c=0;c<r.length;++c)0!==r[c].requiredBy.length&&u.push(r[c]);if(0!==u.length){var h="A circular dependency was found in the following built-in functions/structs/constants: \n";for(c=0;c<u.length;++c)h=h+u[c].name+"\n";throw new i(h)}}function u(e){var t=[],i=a("main",e,t);s(i,t),l(t);for(var r="",n=t.length-1;n>=0;--n)r=r+t[n].glslSource+"\n";return r.replace(i.glslSource,"")}function c(e,r){var n,a,s="",l=e.sources;if(t(l))for(n=0,a=l.length;a>n;++n)s+="\n#line 0\n"+l[n];s=o(s);var c;s=s.replace(/#version\s+(.*?)\n/gm,function(e,r){if(t(c)&&c!==r)throw new i("inconsistent versions found: "+c+" and "+r);return c=r,"\n"}),s=s.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");var d=e.pickColorQualifier;t(d)&&(s=h.createPickFragmentShaderSource(s,d));var m="";t(c)&&(m="#version "+c),r&&(m+="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n\n");var p=e.defines;if(t(p))for(n=0,a=p.length;a>n;++n){var f=p[n];0!==f.length&&(m+="#define "+f+"\n")}return e.includeBuiltIns&&(m+=u(s)),m+="\n#line 0\n",m+=s}function h(i){i=e(i,e.EMPTY_OBJECT);var r=i.pickColorQualifier;this.defines=t(i.defines)?i.defines.slice(0):[],this.sources=t(i.sources)?i.sources.slice(0):[],this.pickColorQualifier=r,this.includeBuiltIns=e(i.includeBuiltIns,!0)}h.prototype.clone=function(){return new h({sources:this.sources,defines:this.defines,pickColorQuantifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})},h.replaceMain=function(e,t){return t="void "+t+"()",e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)},h.prototype.createCombinedVertexShader=function(){return c(this,!1)},h.prototype.createCombinedFragmentShader=function(){return c(this,!0)},h._czmBuiltinsAndUniforms={};for(var d in r)r.hasOwnProperty(d)&&(h._czmBuiltinsAndUniforms[d]=r[d]);for(var m in n)if(n.hasOwnProperty(m)){var p=n[m];"function"==typeof p.getDeclaration&&(h._czmBuiltinsAndUniforms[m]=p.getDeclaration(m))}return h.createPickVertexShaderSource=function(e){var t=h.replaceMain(e,"czm_old_main"),i="attribute vec4 pickColor; \nvarying vec4 czm_pickColor; \nvoid main() \n{ \n czm_old_main(); \n czm_pickColor = pickColor; \n}";return t+"\n"+i},h.createPickFragmentShaderSource=function(e,t){var i=h.replaceMain(e,"czm_old_main"),r=t+" vec4 czm_pickColor; \nvoid main() \n{ \n czm_old_main(); \n if (gl_FragColor.a == 0.0) { \n discard; \n } \n gl_FragColor = czm_pickColor; \n}";return i+"\n"+r},h}),i("Renderer/VertexArray",["../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Geometry","../Core/IndexDatatype","../Core/Math","../Core/RuntimeError","./Buffer","./BufferUsage","./ContextLimits"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function m(r,n,o,a){var s=i(n.vertexBuffer),l=i(n.value),u=n.value?n.value.length:n.componentsPerAttribute,c={index:t(n.index,o),enabled:t(n.enabled,!0),vertexBuffer:n.vertexBuffer,value:l?n.value.slice(0):void 0,componentsPerAttribute:u,componentDatatype:t(n.componentDatatype,e.FLOAT),normalize:t(n.normalize,!1),offsetInBytes:t(n.offsetInBytes,0),strideInBytes:t(n.strideInBytes,0),instanceDivisor:t(n.instanceDivisor,0)};if(s)c.vertexAttrib=function(e){var t=this.index;e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),e.vertexAttribPointer(t,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),e.enableVertexAttribArray(t),this.instanceDivisor>0&&(a.glVertexAttribDivisor(t,this.instanceDivisor),a._vertexAttribDivisors[t]=this.instanceDivisor,a._previousDrawInstanced=!0)},c.disableVertexAttribArray=function(e){e.disableVertexAttribArray(this.index),this.instanceDivisor>0&&a.glVertexAttribDivisor(o,0)};else{switch(c.componentsPerAttribute){case 1:c.vertexAttrib=function(e){e.vertexAttrib1fv(this.index,this.value)};break;case 2:c.vertexAttrib=function(e){e.vertexAttrib2fv(this.index,this.value)};break;case 3:c.vertexAttrib=function(e){e.vertexAttrib3fv(this.index,this.value)};break;case 4:c.vertexAttrib=function(e){e.vertexAttrib4fv(this.index,this.value)}}c.disableVertexAttribArray=function(e){}}r.push(c)}function p(e,t,r){for(var n=0;n<t.length;++n){var o=t[n];o.enabled&&o.vertexAttrib(e)}i(r)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,r._getBuffer())}function f(r){r=t(r,t.EMPTY_OBJECT);var n,o=r.context,a=o._gl,s=r.attributes,l=r.indexBuffer,u=[],c=1,h=!1,d=s.length;for(n=0;d>n;++n)m(u,s[n],n,o);for(d=u.length,n=0;d>n;++n){var f=u[n];if(i(f.vertexBuffer)&&0===f.instanceDivisor){var v=f.strideInBytes||f.componentsPerAttribute*e.getSizeInBytes(f.componentDatatype);c=f.vertexBuffer.sizeInBytes/v;break}}for(n=0;d>n;++n)if(u[n].instanceDivisor>0){h=!0;break}var g;o.vertexArrayObject&&(g=o.glCreateVertexArray(),o.glBindVertexArray(g),p(a,u,l),o.glBindVertexArray(null)),this._numberOfVertices=c,this._hasInstancedAttributes=h,this._context=o,this._gl=a,this._vao=g,this._attributes=u,this._indexBuffer=l}function v(e){return e.values.length/e.componentsPerAttribute}function g(t){return e.getSizeInBytes(t.componentDatatype)*t.componentsPerAttribute}function _(t){var r,n,o,a=[];for(n in t)t.hasOwnProperty(n)&&i(t[n])&&i(t[n].values)&&(a.push(n),t[n].componentDatatype===e.DOUBLE&&(t[n].componentDatatype=e.FLOAT,t[n].values=e.createTypedArray(e.FLOAT,t[n].values)));var s,l=a.length;if(l>0)for(s=v(t[a[0]]),r=1;l>r;++r){var c=v(t[a[r]]);if(c!==s)throw new u("Each attribute list must have the same number of vertices. Attribute "+a[r]+" has a different number of vertices ("+c.toString()+") than attribute "+a[0]+" ("+s.toString()+").")}a.sort(function(i,r){return e.getSizeInBytes(t[r].componentDatatype)-e.getSizeInBytes(t[i].componentDatatype)});var h=0,d={};for(r=0;l>r;++r)n=a[r],o=t[n],d[n]=h,h+=g(o);if(h>0){var m=e.getSizeInBytes(t[a[0]].componentDatatype),p=h%m;0!==p&&(h+=m-p);var f=s*h,_=new ArrayBuffer(f),y={};for(r=0;l>r;++r){n=a[r];var C=e.getSizeInBytes(t[n].componentDatatype);y[n]={pointer:e.createTypedArray(t[n].componentDatatype,_),index:d[n]/C,strideInComponentType:h/C}}for(r=0;s>r;++r)for(var E=0;l>E;++E){n=a[E],o=t[n];for(var S=o.values,w=y[n],T=w.pointer,x=o.componentsPerAttribute,b=0;x>b;++b)T[w.index+b]=S[r*x+b];w.index+=w.strideInComponentType}return{buffer:_,offsetsInBytes:d,vertexSizeInBytes:h}}}function y(e){var t=e._context,i=e._hasInstancedAttributes;if(i||t._previousDrawInstanced){t._previousDrawInstanced=i;var r,n=t._vertexAttribDivisors,o=e._attributes,a=d.maximumVertexAttributes;if(i){var s=o.length;for(r=0;s>r;++r){var l=o[r];if(l.enabled){var u=l.instanceDivisor,c=l.index;u!==n[c]&&(t.glVertexAttribDivisor(c,u),n[c]=u)}}}else for(r=0;a>r;++r)n[r]>0&&(t.glVertexAttribDivisor(r,0),n[r]=0)}}return f.fromGeometry=function(r){r=t(r,t.EMPTY_OBJECT);var n,o,u,d=r.context,m=t(r.geometry,t.EMPTY_OBJECT),p=t(r.bufferUsage,h.DYNAMIC_DRAW),v=t(r.attributeLocations,t.EMPTY_OBJECT),g=t(r.interleave,!1),y=r.vertexArrayAttributes,C=i(y)?y:[],E=m.attributes;if(g){var S=_(E);if(i(S)){u=c.createVertexBuffer({context:d,typedArray:S.buffer,usage:p});var w=S.offsetsInBytes,T=S.vertexSizeInBytes;for(n in E)E.hasOwnProperty(n)&&i(E[n])&&(o=E[n],i(o.values)?C.push({index:v[n],vertexBuffer:u,componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,offsetInBytes:w[n],strideInBytes:T}):C.push({index:v[n],value:o.value,componentDatatype:o.componentDatatype,normalize:o.normalize}))}}else for(n in E)if(E.hasOwnProperty(n)&&i(E[n])){o=E[n];var x=o.componentDatatype;x===e.DOUBLE&&(x=e.FLOAT),u=void 0,i(o.values)&&(u=c.createVertexBuffer({context:d,typedArray:e.createTypedArray(x,o.values),usage:p})),C.push({index:v[n],vertexBuffer:u,value:o.value,componentDatatype:x,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize})}var b,A=m.indices;return i(A)&&(b=a.computeNumberOfVertices(m)>=l.SIXTY_FOUR_KILOBYTES&&d.elementIndexUint?c.createIndexBuffer({context:d,typedArray:new Uint32Array(A),usage:p,indexDatatype:s.UNSIGNED_INT}):c.createIndexBuffer({context:d,typedArray:new Uint16Array(A),usage:p,indexDatatype:s.UNSIGNED_SHORT})),new f({context:d,attributes:C,indexBuffer:b})},r(f.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}}),f.prototype.getAttribute=function(e){return this._attributes[e]},f.prototype._bind=function(){i(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&y(this)):p(this._gl,this._attributes,this._indexBuffer)},f.prototype._unBind=function(){if(i(this._vao))this._context.glBindVertexArray(null);else{for(var e=this._attributes,t=this._gl,r=0;r<e.length;++r){var n=e[r];n.enabled&&n.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){for(var e=this._attributes,t=0;t<e.length;++t){var r=e[t].vertexBuffer;i(r)&&!r.isDestroyed()&&r.vertexArrayDestroyable&&r.destroy()}var o=this._indexBuffer;return i(o)&&!o.isDestroyed()&&o.vertexArrayDestroyable&&o.destroy(),i(this._vao)&&this._context.glDeleteVertexArray(this._vao),n(this)},f}),i("Renderer/VertexArrayFacade",["../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Math","./Buffer","./BufferUsage","./VertexArray"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(r,n,o,a){function s(t,i){return e.getSizeInBytes(i.componentDatatype)-e.getSizeInBytes(t.componentDatatype)}var l=u._verifyAttributes(n);o=t(o,0);for(var c,h,d=[],m={},p=l.length,f=0;p>f;++f){var v=l[f];v.vertexBuffer?d.push(v):(h=v.usage,c=m[h],i(c)||(c=m[h]=[]),c.push(v))}this._allBuffers=[];for(h in m)if(m.hasOwnProperty(h)){c=m[h],c.sort(s);var g=u._vertexSizeInBytes(c),_=c[0].usage,y={vertexSizeInBytes:g,vertexBuffer:void 0,usage:_,needsCommit:!1,arrayBuffer:void 0,arrayViews:u._createArrayViews(c,g)};this._allBuffers.push(y)}this._size=0,this._instanced=t(a,!1),this._precreated=d,this._context=r,this.writers=void 0,this.va=void 0,this.resize(o)}function c(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;var r=t.vertexBuffer,n=e._size*t.vertexSizeInBytes,o=i(r);if(!o||r.sizeInBytes<n)return o&&r.destroy(),t.vertexBuffer=a.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}function h(e,t,i){if(e.needsCommit&&e.vertexSizeInBytes>0){var r=e.vertexSizeInBytes*t,n=e.vertexSizeInBytes*i;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,r,n),r)}}function d(e){var t=e.va;if(i(t)){for(var r=t.length,n=0;r>n;++n)t[n].va.destroy();e.va=void 0}}u._verifyAttributes=function(i){for(var r=[],o=0;o<i.length;++o){var a=i[o],l={index:t(a.index,o),enabled:t(a.enabled,!0),componentsPerAttribute:a.componentsPerAttribute,componentDatatype:t(a.componentDatatype,e.FLOAT),normalize:t(a.normalize,!1),vertexBuffer:a.vertexBuffer,usage:t(a.usage,s.STATIC_DRAW)};if(r.push(l),1!==l.componentsPerAttribute&&2!==l.componentsPerAttribute&&3!==l.componentsPerAttribute&&4!==l.componentsPerAttribute)throw new n("attribute.componentsPerAttribute must be in the range [1, 4].");var u=l.componentDatatype;if(!e.validate(u))throw new n("Attribute must have a valid componentDatatype or not specify it.");if(!s.validate(l.usage))throw new n("Attribute must have a valid usage or not specify it.")}for(var c=new Array(r.length),h=0;h<r.length;++h){var d=r[h],m=d.index;if(c[m])throw new n("Index "+m+" is used by more than one attribute.");c[m]=!0}return r},u._vertexSizeInBytes=function(t){for(var i=0,r=t.length,n=0;r>n;++n){var o=t[n];i+=o.componentsPerAttribute*e.getSizeInBytes(o.componentDatatype)}var a=r>0?e.getSizeInBytes(t[0].componentDatatype):0,s=a>0?i%a:0,l=0===s?0:a-s;return i+=l},u._createArrayViews=function(t,i){for(var r=[],n=0,o=t.length,a=0;o>a;++a){var s=t[a],l=s.componentDatatype;r.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:l,normalize:s.normalize,offsetInBytes:n,vertexSizeInComponentType:i/e.getSizeInBytes(l),view:void 0}),n+=s.componentsPerAttribute*e.getSizeInBytes(l)}return r},u.prototype.resize=function(e){this._size=e;var t=this._allBuffers;this.writers=[];for(var i=0,r=t.length;r>i;++i){var n=t[i];u._resize(n,this._size),u._appendWriters(this.writers,n)}d(this)},u._resize=function(t,r){if(t.vertexSizeInBytes>0){var n=new ArrayBuffer(r*t.vertexSizeInBytes);if(i(t.arrayBuffer))for(var o=new Uint8Array(n),a=new Uint8Array(t.arrayBuffer),s=a.length,l=0;s>l;++l)o[l]=a[l];for(var u=t.arrayViews,c=u.length,h=0;c>h;++h){var d=u[h];d.view=e.createArrayBufferView(d.componentDatatype,n,d.offsetInBytes)}t.arrayBuffer=n}};var m=[function(e,t,i){return function(r,n){t[r*i]=n,e.needsCommit=!0}},function(e,t,i){return function(r,n,o){var a=r*i;t[a]=n,t[a+1]=o,e.needsCommit=!0}},function(e,t,i){return function(r,n,o,a){var s=r*i;t[s]=n,t[s+1]=o,t[s+2]=a,e.needsCommit=!0}},function(e,t,i){return function(r,n,o,a,s){var l=r*i;t[l]=n,t[l+1]=o,t[l+2]=a,t[l+3]=s,e.needsCommit=!0}}];return u._appendWriters=function(e,t){for(var i=t.arrayViews,r=i.length,n=0;r>n;++n){var o=i[n];e[o.index]=m[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}},u.prototype.commit=function(e){var t,r,n,a=!1,s=this._allBuffers;for(r=0,n=s.length;n>r;++r)t=s[r],a=c(this,t)||a;if(a||!i(this.va)){d(this);for(var h=this.va=[],m=i(e)?Math.ceil(this._size/(o.SIXTY_FOUR_KILOBYTES-1)):1,p=0;m>p;++p){var f=[];for(r=0,n=s.length;n>r;++r){t=s[r];var v=p*(t.vertexSizeInBytes*(o.SIXTY_FOUR_KILOBYTES-1));u._appendAttributes(f,t,v,this._instanced)}f=f.concat(this._precreated),h.push({va:new l({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(p!==m-1?o.SIXTY_FOUR_KILOBYTES-1:this._size%(o.SIXTY_FOUR_KILOBYTES-1))})}}},u._appendAttributes=function(e,t,i,r){for(var n=t.arrayViews,o=n.length,a=0;o>a;++a){var s=n[a];e.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:s.componentDatatype,normalize:s.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:i+s.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:r?1:0})}},u.prototype.subCommit=function(e,t){for(var i=this._allBuffers,r=0,n=i.length;n>r;++r)h(i[r],e,t)},u.prototype.endSubCommits=function(){for(var e=this._allBuffers,t=0,i=e.length;i>t;++t)e[t].needsCommit=!1},u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){for(var e=this._allBuffers,t=0,i=e.length;i>t;++t){var n=e[t];n.vertexBuffer=n.vertexBuffer&&n.vertexBuffer.destroy()}return d(this),r(this)},u}),i("Shaders/BillboardCollectionFS",[],function(){"use strict";return"uniform sampler2D u_atlas;\nvarying vec2 v_textureCoordinates;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#else\nvarying vec4 v_color;\n#endif\nvoid main()\n{\n#ifdef RENDER_FOR_PICK\nvec4 vertexColor = vec4(1.0, 1.0, 1.0, 1.0);\n#else\nvec4 vertexColor = v_color;\n#endif\nvec4 color = texture2D(u_atlas, v_textureCoordinates) * vertexColor;\nif (color.a == 0.0)\n{\ndiscard;\n}\n#ifdef RENDER_FOR_PICK\ngl_FragColor = v_pickColor;\n#else\ngl_FragColor = color;\n#endif\n}\n"}),i("Shaders/BillboardCollectionVS",[],function(){"use strict";return"#ifdef INSTANCED\nattribute vec2 direction;\n#endif\nattribute vec4 positionHighAndScale;\nattribute vec4 positionLowAndRotation;\nattribute vec4 compressedAttribute0;\nattribute vec4 compressedAttribute1;\nattribute vec4 compressedAttribute2;\nattribute vec4 eyeOffset;\nattribute vec4 scaleByDistance;\nattribute vec4 pixelOffsetScaleByDistance;\nvarying vec2 v_textureCoordinates;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#else\nvarying vec4 v_color;\n#endif\nconst float UPPER_BOUND = 32768.0;\nconst float SHIFT_LEFT16 = 65536.0;\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_LEFT7 = 128.0;\nconst float SHIFT_LEFT5 = 32.0;\nconst float SHIFT_LEFT3 = 8.0;\nconst float SHIFT_LEFT2 = 4.0;\nconst float SHIFT_LEFT1 = 2.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nconst float SHIFT_RIGHT7 = 1.0 / 128.0;\nconst float SHIFT_RIGHT5 = 1.0 / 32.0;\nconst float SHIFT_RIGHT3 = 1.0 / 8.0;\nconst float SHIFT_RIGHT2 = 1.0 / 4.0;\nconst float SHIFT_RIGHT1 = 1.0 / 2.0;\nvec4 computePositionWindowCoordinates(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, float rotation, bool sizeInMeters)\n{\nvec2 halfSize = imageSize * scale * czm_resolutionScale;\nhalfSize *= ((direction * 2.0) - 1.0);\nif (sizeInMeters)\n{\npositionEC.xy += halfSize;\n}\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nif (sizeInMeters)\n{\npositionWC.xy += (origin * abs(halfSize)) / czm_metersPerPixel(positionEC);\n}\nelse\n{\npositionWC.xy += (origin * abs(halfSize));\n}\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\nif (!all(equal(alignedAxis, vec3(0.0))) || rotation != 0.0)\n{\nfloat angle = rotation;\nif (!all(equal(alignedAxis, vec3(0.0))))\n{\nvec3 pos = positionEC.xyz + czm_encodedCameraPositionMCHigh + czm_encodedCameraPositionMCLow;\nvec3 normal = normalize(cross(alignedAxis, pos));\nvec4 tangent = vec4(normalize(cross(pos, normal)), 0.0);\ntangent = czm_modelViewProjection * tangent;\nangle += sign(-tangent.x) * acos(tangent.y / length(tangent.xy));\n}\nfloat cosTheta = cos(angle);\nfloat sinTheta = sin(angle);\nmat2 rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);\nhalfSize = rotationMatrix * halfSize;\n}\n#endif\nif (!sizeInMeters)\n{\npositionWC.xy += halfSize;\n}\npositionWC.xy += translate;\npositionWC.xy += (pixelOffset * czm_resolutionScale);\nreturn positionWC;\n}\nvoid main()\n{\nvec3 positionHigh = positionHighAndScale.xyz;\nvec3 positionLow = positionLowAndRotation.xyz;\nfloat scale = positionHighAndScale.w;\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\nfloat rotation = positionLowAndRotation.w;\n#else\nfloat rotation = 0.0;\n#endif\nfloat compressed = compressedAttribute0.x;\nvec2 pixelOffset;\npixelOffset.x = floor(compressed * SHIFT_RIGHT7);\ncompressed -= pixelOffset.x * SHIFT_LEFT7;\npixelOffset.x -= UPPER_BOUND;\nvec2 origin;\norigin.x = floor(compressed * SHIFT_RIGHT5);\ncompressed -= origin.x * SHIFT_LEFT5;\norigin.y = floor(compressed * SHIFT_RIGHT3);\ncompressed -= origin.y * SHIFT_LEFT3;\norigin -= vec2(1.0);\nfloat show = floor(compressed * SHIFT_RIGHT2);\ncompressed -= show * SHIFT_LEFT2;\n#ifdef INSTANCED\nvec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w);\nvec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w);\nvec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;\n#else\nvec2 direction;\ndirection.x = floor(compressed * SHIFT_RIGHT1);\ndirection.y = compressed - direction.x * SHIFT_LEFT1;\nvec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w);\n#endif\nfloat temp = compressedAttribute0.y * SHIFT_RIGHT8;\npixelOffset.y = -(floor(temp) - UPPER_BOUND);\nvec2 translate;\ntranslate.y = (temp - floor(temp)) * SHIFT_LEFT16;\ntemp = compressedAttribute0.z * SHIFT_RIGHT8;\ntranslate.x = floor(temp) - UPPER_BOUND;\ntranslate.y += (temp - floor(temp)) * SHIFT_LEFT8;\ntranslate.y -= UPPER_BOUND;\ntemp = compressedAttribute1.x * SHIFT_RIGHT8;\nvec2 imageSize = vec2(floor(temp), compressedAttribute2.w);\n#ifdef EYE_DISTANCE_TRANSLUCENCY\nvec4 translucencyByDistance;\ntranslucencyByDistance.x = compressedAttribute1.z;\ntranslucencyByDistance.z = compressedAttribute1.w;\ntranslucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\ntemp = compressedAttribute1.y * SHIFT_RIGHT8;\ntranslucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n#endif\n#ifdef ALIGNED_AXIS\nvec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8));\n#else\nvec3 alignedAxis = vec3(0.0);\n#endif\n#ifdef RENDER_FOR_PICK\ntemp = compressedAttribute2.y;\n#else\ntemp = compressedAttribute2.x;\n#endif\nvec4 color;\ntemp = temp * SHIFT_RIGHT8;\ncolor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\ncolor.g = (temp - floor(temp)) * SHIFT_LEFT8;\ncolor.r = floor(temp);\ntemp = compressedAttribute2.z * SHIFT_RIGHT8;\nbool sizeInMeters = (temp - floor(temp)) * SHIFT_LEFT8 > 0.0;\ntemp = floor(temp) * SHIFT_RIGHT8;\n#ifdef RENDER_FOR_PICK\ncolor.a = (temp - floor(temp)) * SHIFT_LEFT8;\nvec4 pickColor = color / 255.0;\n#else\ncolor.a = floor(temp);\ncolor /= 255.0;\n#endif\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\npositionEC = czm_eyeOffset(positionEC, eyeOffset.xyz);\npositionEC.xyz *= show;\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET)\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\n}\n#endif\n#ifdef EYE_DISTANCE_SCALING\nscale *= czm_nearFarScalar(scaleByDistance, lengthSq);\nif (scale == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nfloat translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\ntranslucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\nif (translucency == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\n#ifdef EYE_DISTANCE_PIXEL_OFFSET\nfloat pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq);\npixelOffset *= pixelOffsetScale;\n#endif\n#ifdef CLAMPED_TO_GROUND\npositionEC.z *= 0.995;\norigin.y = 1.0;\n#endif\nvec4 positionWC = computePositionWindowCoordinates(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, rotation, sizeInMeters);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\nv_textureCoordinates = textureCoordinates;\n#ifdef RENDER_FOR_PICK\nv_pickColor = pickColor;\n#else\nv_color = color;\nv_color.a *= translucency;\n#endif\n}\n"; +}),i("Scene/HeightReference",["../Core/freezeObject"],function(e){"use strict";var t={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2};return e(t)}),i("Scene/HorizontalOrigin",["../Core/freezeObject"],function(e){"use strict";var t={CENTER:0,LEFT:1,RIGHT:-1};return e(t)}),i("Scene/SceneMode",["../Core/freezeObject"],function(e){"use strict";var t={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};return t.getMorphTime=function(e){if(e===t.SCENE3D)return 1;if(e!==t.MORPHING)return 0},e(t)}),i("Scene/SceneTransforms",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defined","../Core/DeveloperError","../Core/Math","../Core/Matrix4","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u){"use strict";var c={},h=new r(0,0,0,1),d=new r,m=new l;c.wgs84ToWindowCoordinates=function(e,t,i){var n=c.computeActualWgs84Position(e.frameState,t,h);if(o(n)){var a=e.camera,s=l.multiply(a.frustum.projectionMatrix,a.viewMatrix,m);if(l.multiplyByVector(s,r.fromElements(n.x,n.y,n.z,1,d),d),!(d.z<0&&e.mode!==u.SCENE2D))return i=c.clipToGLWindowCoordinates(e,d,i),i.y=e.canvas.clientHeight-i.y,i}},c.wgs84ToDrawingBufferCoordinates=function(e,t,i){var n=c.computeActualWgs84Position(e.frameState,t,h);if(o(n)){var a=e.camera,s=l.multiply(a.frustum.projectionMatrix,a.viewMatrix,m);if(l.multiplyByVector(s,r.fromElements(n.x,n.y,n.z,1,d),d),!(d.z<0&&e.mode!==u.SCENE2D))return c.clipToDrawingBufferCoordinates(e,d,i)}};var p=new i,f=new n;c.computeActualWgs84Position=function(e,t,r){var n=e.mode;if(n===u.SCENE3D)return i.clone(t,r);var a=e.mapProjection,l=a.ellipsoid.cartesianToCartographic(t,f);if(o(l)){if(a.project(l,p),n===u.COLUMBUS_VIEW)return i.fromElements(p.z,p.x,p.y,r);if(n===u.SCENE2D)return i.fromElements(0,p.x,p.y,r);var c=e.morphTime;return i.fromElements(s.lerp(p.z,t.x,c),s.lerp(p.x,t.y,c),s.lerp(p.y,t.z,c),r)}};var v=new i,g=new i,_=new e,y=new l;c.clipToGLWindowCoordinates=function(e,r,n){var o=e.canvas;return i.divideByScalar(r,r.w,v),_.width=o.clientWidth,_.height=o.clientHeight,l.computeViewportTransformation(_,0,1,y),l.multiplyByPoint(y,v,g),t.fromCartesian3(g,n)},c.clipToDrawingBufferCoordinates=function(r,n,o){return i.divideByScalar(n,n.w,v),e.clone(r._passState.viewport,_),l.computeViewportTransformation(_,0,1,y),l.multiplyByPoint(y,v,g),t.fromCartesian3(g,o)},c.transformWindowToDrawingBuffer=function(e,i,r){var n=e.canvas,o=e.drawingBufferWidth/n.clientWidth,a=e.drawingBufferHeight/n.clientHeight;return t.fromElements(i.x*o,i.y*a,r)};var C=new r,E=new r;return c.drawingBufferToWgs84Coordinates=function(e,t,n,o){var a=e.context,s=a.uniformState,u=e._passState.viewport,c=r.clone(r.UNIT_W,C);c.x=(t.x-u.x)/u.width*2-1,c.y=(t.y-u.y)/u.height*2-1,c.z=2*n-1,c.w=1;var h=l.multiplyByVector(s.inverseViewProjection,c,E),d=1/h.w;return i.multiplyByScalar(h,d,h),i.fromCartesian4(h,o)},c}),i("Scene/VerticalOrigin",["../Core/freezeObject"],function(e){"use strict";var t={CENTER:0,BOTTOM:1,TOP:-1};return e(t)}),i("Scene/Billboard",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","../Core/NearFarScalar","./HeightReference","./HorizontalOrigin","./SceneMode","./SceneTransforms","./VerticalOrigin"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g){"use strict";function _(e,r){e=s(e,s.EMPTY_OBJECT),this._show=s(e.show,!0),this._position=i.clone(s(e.position,i.ZERO)),this._actualPosition=i.clone(this._position),this._pixelOffset=t.clone(s(e.pixelOffset,t.ZERO)),this._translate=new t(0,0),this._eyeOffset=i.clone(s(e.eyeOffset,i.ZERO)),this._verticalOrigin=s(e.verticalOrigin,g.CENTER),this._horizontalOrigin=s(e.horizontalOrigin,p.CENTER),this._scale=s(e.scale,1),this._color=o.clone(s(e.color,o.WHITE)),this._rotation=s(e.rotation,0),this._alignedAxis=i.clone(s(e.alignedAxis,i.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=e.scaleByDistance,this._translucencyByDistance=e.translucencyByDistance,this._pixelOffsetScaleByDistance=e.pixelOffsetScaleByDistance,this._heightReference=s(e.heightReference,m.NONE),this._sizeInMeters=s(e.sizeInMeters,!1),this._id=e.id,this._collection=s(e.collection,r),this._pickId=void 0,this._pickPrimitive=s(e._pickPrimitive,this),this._billboardCollection=r,this._dirty=!1,this._index=-1,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0;var n=e.image,u=e.imageId;l(n)&&(l(u)||(u="string"==typeof n?n:l(n.src)?n.src:a()),this._imageId=u,this._image=n),l(e.imageSubRegion)&&(this._imageId=u,this._imageSubRegion=e.imageSubRegion),l(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=f.SCENE3D,this._updateClamping()}function y(e,t){var i=e._billboardCollection;l(i)&&(i._updateBillboard(e,t),e._dirty=!0)}var C=_.SHOW_INDEX=0,E=_.POSITION_INDEX=1,S=_.PIXEL_OFFSET_INDEX=2,w=_.EYE_OFFSET_INDEX=3,T=_.HORIZONTAL_ORIGIN_INDEX=4,x=_.VERTICAL_ORIGIN_INDEX=5,b=_.SCALE_INDEX=6,A=_.IMAGE_INDEX_INDEX=7,P=_.COLOR_INDEX=8,I=_.ROTATION_INDEX=9,M=_.ALIGNED_AXIS_INDEX=10,D=_.SCALE_BY_DISTANCE_INDEX=11,R=_.TRANSLUCENCY_BY_DISTANCE_INDEX=12,O=_.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13;_.NUMBER_OF_PROPERTIES=14,u(_.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,y(this,C))}},position:{get:function(){return this._position},set:function(e){var t=this._position;i.equals(t,e)||(i.clone(e,t),i.clone(e,this._actualPosition),this._updateClamping(),y(this,E))}},heightReference:{get:function(){return this._heightReference},set:function(e){var t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),y(this,E))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){var i=this._pixelOffset;t.equals(i,e)||(t.clone(e,i),y(this,S))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;d.equals(t,e)||(this._scaleByDistance=d.clone(e,t),y(this,D))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;d.equals(t,e)||(this._translucencyByDistance=d.clone(e,t),y(this,R))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){var t=this._pixelOffsetScaleByDistance;d.equals(t,e)||(this._pixelOffsetScaleByDistance=d.clone(e,t),y(this,O))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){var t=this._eyeOffset;i.equals(t,e)||(i.clone(e,t),y(this,w))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,y(this,T))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,y(this,x))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,y(this,b))}},color:{get:function(){return this._color},set:function(e){var t=this._color;o.equals(t,e)||(o.clone(e,t),y(this,P))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,y(this,I))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){var t=this._alignedAxis;i.equals(t,e)||(i.clone(e,t),y(this,M))}},width:{get:function(){return s(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,y(this,A))}},height:{get:function(){return s(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,y(this,A))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,y(this,P))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},image:{get:function(){return this._imageId},set:function(e){l(e)?"string"==typeof e?this.setImage(e,e):l(e.src)?this.setImage(e.src,e):this.setImage(a(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,y(this,A))}},ready:{get:function(){return-1!==this._imageIndex}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=i.clone(e,this._actualClampedPosition),y(this,E)}}}),_.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId},_.prototype._updateClamping=function(){_._updateClamping(this._billboardCollection,this)};var N=new n,L=new i;_._updateClamping=function(e,t){function r(e){if(t._heightReference===m.RELATIVE_TO_GROUND)if(t._mode===f.SCENE3D){var r=s.cartesianToCartographic(e,N);r.height+=v.height,s.cartographicToCartesian(r,e)}else e.x+=v.height;t._clampedPosition=i.clone(e,t._clampedPosition)}var o=e._scene;if(l(o)){var a=o.globe,s=a.ellipsoid,u=a._surface,h=o.frameState.mode,d=o.frameState.mapProjection,p=h!==t._mode;if(t._mode=h,(t._heightReference===m.NONE||p)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference!==m.NONE&&l(t._position)){var v=s.cartesianToCartographic(t._position);if(l(v)){l(t._removeCallbackFunc)&&t._removeCallbackFunc(),t._removeCallbackFunc=u.updateHeight(v,r);var g=a.getHeight(v);l(g)&&(n.clone(v,N),N.height=g,t._mode===f.SCENE3D?s.cartographicToCartesian(N,L):(d.project(N,L),i.fromElements(L.z,L.x,L.y,L)),r(L))}}}else if(t._heightReference!==m.NONE)throw new c("Height reference is not supported.")},_.prototype._loadImage=function(){var t,i=this._billboardCollection._textureAtlas,r=this._imageId,n=this._image,o=this._imageSubRegion;if(l(n)&&(t=i.addImage(r,n)),l(o)&&(t=i.addSubRegion(r,o)),this._imageIndexPromise=t,l(t)){var a=this;t.then(function(t){if(a._imageId===r&&a._image===n&&e.equals(a._imageSubRegion,o)){var s=i.textureCoordinates[t];a._imageWidth=i.texture.width*s.width,a._imageHeight=i.texture.height*s.height,a._imageIndex=t,a._ready=!0,a._image=void 0,a._imageIndexPromise=void 0,y(a,A)}}).otherwise(function(e){console.error("Error loading image for billboard: "+e),a._imageIndexPromise=void 0})}},_.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,l(this._billboardCollection._textureAtlas)&&this._loadImage())},_.prototype.setImageSubRegion=function(t,i){this._imageId===t&&e.equals(this._imageSubRegion,i)||(this._imageIndex=-1,this._imageId=t,this._imageSubRegion=e.clone(i),l(this._billboardCollection._textureAtlas)&&this._loadImage())},_.prototype._setTranslate=function(e){var i=this._translate;t.equals(i,e)||(t.clone(e,i),y(this,S))},_.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition},_.prototype._setActualPosition=function(e){l(this._clampedPosition)||i.clone(e,this._actualPosition),y(this,E)};var F=new r;_._computeActualPosition=function(e,t,i,r){return l(e._clampedPosition)?(i.mode!==e._mode&&e._updateClamping(),e._clampedPosition):i.mode===f.SCENE3D?t:(h.multiplyByPoint(r,t,F),v.computeActualWgs84Position(i,F))};var B=new h,V=new r,k=new i,z=new t,U=new t;_._computeScreenSpacePosition=function(e,n,o,a,s,l){var u=s.camera,c=u.viewMatrix,d=u.frustum.projectionMatrix,m=h.multiplyTransformation(c,e,B),p=h.multiplyByVector(m,r.fromElements(n.x,n.y,n.z,1,V),V),f=i.multiplyComponents(o,i.normalize(p,k),k);p.x+=o.x+f.x,p.y+=o.y+f.y,p.z+=f.z;var g=h.multiplyByVector(d,p,V),_=v.clipToGLWindowCoordinates(s,g,l);a=t.clone(a,U),a.y=-a.y;var y=t.multiplyByScalar(a,s.context.uniformState.resolutionScale,z);return _.x+=y.x,_.y+=y.y,_};var G=new t(0,0);return _.prototype.computeScreenSpacePosition=function(e,i){var r=this._billboardCollection;l(i)||(i=new t),t.clone(this._pixelOffset,G),t.add(G,this._translate,G);var n=r.modelMatrix,o=this._getActualPosition(),a=_._computeScreenSpacePosition(n,o,this._eyeOffset,G,e,i);return a.y=e.canvas.clientHeight-a.y,a},_.prototype.equals=function(r){return this===r||l(r)&&this._id===r._id&&i.equals(this._position,r._position)&&this._imageId===r._imageId&&this._show===r._show&&this._scale===r._scale&&this._verticalOrigin===r._verticalOrigin&&this._horizontalOrigin===r._horizontalOrigin&&e.equals(this._imageSubRegion,r._imageSubRegion)&&o.equals(this._color,r._color)&&t.equals(this._pixelOffset,r._pixelOffset)&&t.equals(this._translate,r._translate)&&i.equals(this._eyeOffset,r._eyeOffset)&&d.equals(this._scaleByDistance,r._scaleByDistance)&&d.equals(this._translucencyByDistance,r._translucencyByDistance)&&d.equals(this._pixelOffsetScaleByDistance,r._pixelOffsetScaleByDistance)},_.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0},_}),i("Scene/BlendEquation",["../Core/freezeObject","../Renderer/WebGLConstants"],function(e,t){"use strict";var i={ADD:t.FUNC_ADD,SUBTRACT:t.FUNC_SUBTRACT,REVERSE_SUBTRACT:t.FUNC_REVERSE_SUBTRACT};return e(i)}),i("Scene/BlendFunction",["../Core/freezeObject","../Renderer/WebGLConstants"],function(e,t){"use strict";var i={ZERO:t.ZERO,ONE:t.ONE,SOURCE_COLOR:t.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:t.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:t.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:t.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:t.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:t.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:t.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:t.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:t.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:t.ONE_MINUS_CONSTANT_ALPHA,CONSTANT_ALPHA:t.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:t.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:t.SRC_ALPHA_SATURATE};return e(i)}),i("Scene/BlendingState",["../Core/freezeObject","./BlendEquation","./BlendFunction"],function(e,t,i){"use strict";var r={DISABLED:e({enabled:!1}),ALPHA_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:i.SOURCE_ALPHA,functionSourceAlpha:i.SOURCE_ALPHA,functionDestinationRgb:i.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:i.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:i.ONE,functionSourceAlpha:i.ONE,functionDestinationRgb:i.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:i.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:i.SOURCE_ALPHA,functionSourceAlpha:i.SOURCE_ALPHA,functionDestinationRgb:i.ONE,functionDestinationAlpha:i.ONE})};return e(r)}),i("Scene/Pass",["../Core/freezeObject"],function(e){"use strict";var t={COMPUTE:0,GLOBE:1,GROUND:2,OPAQUE:3,TRANSLUCENT:4,OVERLAY:5,NUMBER_OF_PASSES:6};return e(t)}),i("Renderer/Framebuffer",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/PixelFormat","./ContextLimits"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,i){var r=e._gl;r.framebufferTexture2D(r.FRAMEBUFFER,t,i._target,i._texture,0)}function l(e,t,i){var r=e._gl;r.framebufferRenderbuffer(r.FRAMEBUFFER,t,r.RENDERBUFFER,i._getRenderbuffer())}function u(i){i=e(i,e.EMPTY_OBJECT);var r=i.context._gl;a.maximumColorAttachments;this._gl=r,this._framebuffer=r.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=e(i.destroyAttachments,!0);t(i.depthTexture)||t(i.depthRenderbuffer),t(i.depthStencilTexture)||t(i.depthStencilRenderbuffer);this._bind();var n,o,u,c,h;if(t(i.colorTextures)){var d=i.colorTextures;for(c=this._colorTextures.length=this._activeColorAttachments.length=d.length,u=0;c>u;++u)n=d[u],h=this._gl.COLOR_ATTACHMENT0+u,s(this,h,n),this._activeColorAttachments[u]=h,this._colorTextures[u]=n}if(t(i.colorRenderbuffers)){var m=i.colorRenderbuffers;for(c=this._colorRenderbuffers.length=this._activeColorAttachments.length=m.length,u=0;c>u;++u)o=m[u],h=this._gl.COLOR_ATTACHMENT0+u,l(this,h,o),this._activeColorAttachments[u]=h,this._colorRenderbuffers[u]=o}t(i.depthTexture)&&(n=i.depthTexture,s(this,this._gl.DEPTH_ATTACHMENT,n),this._depthTexture=n),t(i.depthRenderbuffer)&&(o=i.depthRenderbuffer,l(this,this._gl.DEPTH_ATTACHMENT,o),this._depthRenderbuffer=o),t(i.stencilRenderbuffer)&&(o=i.stencilRenderbuffer,l(this,this._gl.STENCIL_ATTACHMENT,o),this._stencilRenderbuffer=o),t(i.depthStencilTexture)&&(n=i.depthStencilTexture,s(this,this._gl.DEPTH_STENCIL_ATTACHMENT,n),this._depthStencilTexture=n),t(i.depthStencilRenderbuffer)&&(o=i.depthStencilRenderbuffer,l(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilRenderbuffer=o),this._unBind()}return i(u.prototype,{status:{get:function(){this._bind();var e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}}),u.prototype._bind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)},u.prototype._unBind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)},u.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments},u.prototype.getColorTexture=function(e){return this._colorTextures[e]},u.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]},u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){if(this.destroyAttachments){for(var e=0,i=this._colorTextures,n=i.length;n>e;++e){var o=i[e];t(o)&&o.destroy()}var a=this._colorRenderbuffers;for(n=a.length,e=0;n>e;++e){var s=a[e];t(s)&&s.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),r(this)},u}),i("Renderer/MipmapHint",["../Core/freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={DONT_CARE:t.DONT_CARE,FASTEST:t.FASTEST,NICEST:t.NICEST,validate:function(e){return e===i.DONT_CARE||e===i.FASTEST||e===i.NICEST}};return e(i)}),i("Renderer/PixelDatatype",["../Core/freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={UNSIGNED_BYTE:t.UNSIGNED_BYTE,UNSIGNED_SHORT:t.UNSIGNED_SHORT,UNSIGNED_INT:t.UNSIGNED_INT,FLOAT:t.FLOAT,UNSIGNED_INT_24_8:t.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:t.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:t.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:t.UNSIGNED_SHORT_5_6_5,validate:function(e){return e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT||e===i.FLOAT||e===i.UNSIGNED_INT_24_8||e===i.UNSIGNED_SHORT_4_4_4_4||e===i.UNSIGNED_SHORT_5_5_5_1||e===i.UNSIGNED_SHORT_5_6_5}};return e(i)}),i("Renderer/TextureMagnificationFilter",["../Core/freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={NEAREST:t.NEAREST,LINEAR:t.LINEAR,validate:function(e){return e===i.NEAREST||e===i.LINEAR}};return e(i)}),i("Renderer/TextureMinificationFilter",["../Core/freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={NEAREST:t.NEAREST,LINEAR:t.LINEAR,NEAREST_MIPMAP_NEAREST:t.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:t.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:t.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:t.LINEAR_MIPMAP_LINEAR,validate:function(e){return e===i.NEAREST||e===i.LINEAR||e===i.NEAREST_MIPMAP_NEAREST||e===i.LINEAR_MIPMAP_NEAREST||e===i.NEAREST_MIPMAP_LINEAR||e===i.LINEAR_MIPMAP_LINEAR}};return e(i)}),i("Renderer/TextureWrap",["../Core/freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={CLAMP_TO_EDGE:t.CLAMP_TO_EDGE,REPEAT:t.REPEAT,MIRRORED_REPEAT:t.MIRRORED_REPEAT,validate:function(e){return e===i.CLAMP_TO_EDGE||e===i.REPEAT||e===i.MIRRORED_REPEAT}};return e(i)}),i("Renderer/Sampler",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap"],function(e,t,i,r,n,o,a){"use strict";function s(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.wrapS,a.CLAMP_TO_EDGE),s=e(i.wrapT,a.CLAMP_TO_EDGE),l=e(i.minificationFilter,o.LINEAR),u=e(i.magnificationFilter,n.LINEAR),c=t(i.maximumAnisotropy)?i.maximumAnisotropy:1;this._wrapS=r,this._wrapT=s,this._minificationFilter=l,this._magnificationFilter=u,this._maximumAnisotropy=c}return i(s.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}}),s}),i("Renderer/Texture",["../Core/Cartesian2","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","./ContextLimits","./MipmapHint","./PixelDatatype","./Sampler","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap","./WebGLConstants"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f){"use strict";function v(r){r=t(r,t.EMPTY_OBJECT);var n=r.context,a=r.width,l=r.height,u=r.source;i(u)&&(i(a)||(a=t(u.videoWidth,u.width)),i(l)||(l=t(u.videoHeight,u.height)));var d=t(r.pixelFormat,s.RGBA),m=t(r.pixelDatatype,c.UNSIGNED_BYTE),p=d;if(n.webgl2&&(d===s.DEPTH_STENCIL?p=f.DEPTH24_STENCIL8:d===s.DEPTH_COMPONENT&&(m===c.UNSIGNED_SHORT?p=f.DEPTH_COMPONENT16:m===c.UNSIGNED_INT&&(p=f.DEPTH_COMPONENT24))),m===c.FLOAT&&!n.floatingPointTexture)throw new o("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension. Check context.floatingPointTexture.");if(s.isDepthFormat(d)&&!n.depthTexture)throw new o("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, this WebGL implementation must support WEBGL_depth_texture. Check context.depthTexture.");var v=r.preMultiplyAlpha||d===s.RGB||d===s.LUMINANCE,g=t(r.flipY,!0),_=n._gl,y=_.TEXTURE_2D,C=_.createTexture();_.activeTexture(_.TEXTURE0),_.bindTexture(y,C),i(u)?(_.pixelStorei(_.UNPACK_PREMULTIPLY_ALPHA_WEBGL,v),_.pixelStorei(_.UNPACK_FLIP_Y_WEBGL,g),i(u.arrayBufferView)?_.texImage2D(y,0,p,a,l,0,d,m,u.arrayBufferView):i(u.framebuffer)?(u.framebuffer!==n.defaultFramebuffer&&u.framebuffer._bind(),_.copyTexImage2D(y,0,p,u.xOffset,u.yOffset,a,l,0),u.framebuffer!==n.defaultFramebuffer&&u.framebuffer._unBind()):_.texImage2D(y,0,p,d,m,u)):_.texImage2D(y,0,p,a,l,0,d,m,null),_.bindTexture(y,null),this._context=n,this._textureFilterAnisotropic=n._textureFilterAnisotropic,this._textureTarget=y,this._texture=C,this._pixelFormat=d,this._pixelDatatype=m,this._width=a,this._height=l,this._dimensions=new e(a,l),this._preMultiplyAlpha=v,this._flipY=g,this._sampler=void 0,this.sampler=i(r.sampler)?r.sampler:new h}return v.fromFramebuffer=function(e){e=t(e,t.EMPTY_OBJECT);var r=e.context,n=r._gl,o=t(e.pixelFormat,s.RGB),a=t(e.framebufferXOffset,0),l=t(e.framebufferYOffset,0),u=t(e.width,n.drawingBufferWidth),c=t(e.height,n.drawingBufferHeight),h=e.framebuffer,d=new v({context:r,width:u,height:c,pixelFormat:o,source:{framebuffer:i(h)?h:r.defaultFramebuffer,xOffset:a,yOffset:l,width:u,height:c}});return d},r(v.prototype,{sampler:{get:function(){return this._sampler},set:function(e){var t=e.minificationFilter,r=e.magnificationFilter,n=t===m.NEAREST_MIPMAP_NEAREST||t===m.NEAREST_MIPMAP_LINEAR||t===m.LINEAR_MIPMAP_NEAREST||t===m.LINEAR_MIPMAP_LINEAR;this._pixelDatatype===c.FLOAT&&(t=n?m.NEAREST_MIPMAP_NEAREST:m.NEAREST,r=d.NEAREST);var o=this._context._gl,a=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(a,this._texture),o.texParameteri(a,o.TEXTURE_MIN_FILTER,t),o.texParameteri(a,o.TEXTURE_MAG_FILTER,r),o.texParameteri(a,o.TEXTURE_WRAP_S,e.wrapS),o.texParameteri(a,o.TEXTURE_WRAP_T,e.wrapT),i(this._textureFilterAnisotropic)&&o.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),o.bindTexture(a,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},_target:{get:function(){return this._textureTarget}}}),v.prototype.copyFrom=function(e,i,r){i=t(i,0),r=t(r,0);var n=this._context._gl,o=this._textureTarget;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._preMultiplyAlpha),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,this._flipY),n.activeTexture(n.TEXTURE0),n.bindTexture(o,this._texture),e.arrayBufferView?n.texSubImage2D(o,0,i,r,e.width,e.height,this._pixelFormat,this._pixelDatatype,e.arrayBufferView):n.texSubImage2D(o,0,i,r,this._pixelFormat,this._pixelDatatype,e),n.bindTexture(o,null)},v.prototype.copyFromFramebuffer=function(e,i,r,n,o,a){e=t(e,0),i=t(i,0),r=t(r,0),n=t(n,0),o=t(o,this._width),a=t(a,this._height);var s=this._context._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.copyTexSubImage2D(l,0,e,i,r,n,o,a),s.bindTexture(l,null)},v.prototype.generateMipmap=function(e){e=t(e,u.DONT_CARE);var i=this._context._gl,r=this._textureTarget;i.hint(i.GENERATE_MIPMAP_HINT,e),i.activeTexture(i.TEXTURE0),i.bindTexture(r,this._texture),i.generateMipmap(r),i.bindTexture(r,null)},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),n(this)},v}),i("Scene/TextureAtlas",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/loadImage","../Core/PixelFormat","../Core/RuntimeError","../Renderer/Framebuffer","../Renderer/RenderState","../Renderer/Texture","../ThirdParty/when"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(e,i,n,o,a){this.bottomLeft=r(e,t.ZERO),this.topRight=r(i,t.ZERO),this.childNode1=n,this.childNode2=o,this.imageIndex=a}function v(e){e=r(e,r.EMPTY_OBJECT);var n=r(e.borderWidthInPixels,1),o=r(e.initialSize,C);this._context=e.context,this._pixelFormat=r(e.pixelFormat,u.RGBA),this._borderWidthInPixels=n,this._textureCoordinates=[],this._guid=i(),this._idHash={},this._texture=new m({context:this._context,width:o.x,height:o.y,pixelFormat:this._pixelFormat}),this._root=new f(new t,new t(o.x,o.y));var a=this,s={u_texture:function(){return a._texture}},l="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n gl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n";this._copyCommand=this._context.createViewportQuadCommand(l,{uniformMap:s})}function g(i,r){var o=i._context,a=i.numberOfImages,s=2;if(a>0){var l=i._texture.width,u=i._texture.height,c=s*(l+r.width+i._borderWidthInPixels),p=s*(u+r.height+i._borderWidthInPixels),v=l/c,g=u/p,_=new f(new t(l+i._borderWidthInPixels,0),new t(c,u)),y=new f(new t,new t(c,u),i._root,_),C=new f(new t(0,u+i._borderWidthInPixels),new t(c,p)),E=new f(new t,new t(c,p),y,C);i._root=E;for(var S=0;S<i._textureCoordinates.length;S++){var w=i._textureCoordinates[S];n(w)&&(w.x*=v,w.y*=g,w.width*=v,w.height*=g)}var T=new m({context:i._context,width:c,height:p,pixelFormat:i._pixelFormat}),x=new h({context:o,colorTextures:[T],destroyAttachments:!1}),b=i._copyCommand,A={viewport:new e(0,0,l,u)};b.renderState=d.fromCache(A),x._bind(),b.execute(i._context),x._unBind(),x.destroy(),i._texture=T,d.removeFromCache(A),b.renderState=void 0}else{var P=s*(r.width+i._borderWidthInPixels),I=s*(r.height+i._borderWidthInPixels);i._texture=i._texture&&i._texture.destroy(),i._texture=new m({context:i._context,width:P,height:I,pixelFormat:i._pixelFormat}),i._root=new f(new t,new t(P,I))}}function _(e,i,r){if(n(i)){if(!n(i.childNode1)&&!n(i.childNode2)){if(n(i.imageIndex))return;var o=i.topRight.x-i.bottomLeft.x,a=i.topRight.y-i.bottomLeft.y,s=o-r.width,l=a-r.height;if(0>s||0>l)return;if(0===s&&0===l)return i;if(s>l){i.childNode1=new f(new t(i.bottomLeft.x,i.bottomLeft.y),new t(i.bottomLeft.x+r.width,i.topRight.y));var u=i.bottomLeft.x+r.width+e._borderWidthInPixels;u<i.topRight.x&&(i.childNode2=new f(new t(u,i.bottomLeft.y),new t(i.topRight.x,i.topRight.y)))}else{i.childNode1=new f(new t(i.bottomLeft.x,i.bottomLeft.y),new t(i.topRight.x,i.bottomLeft.y+r.height));var c=i.bottomLeft.y+r.height+e._borderWidthInPixels;c<i.topRight.y&&(i.childNode2=new f(new t(i.bottomLeft.x,c),new t(i.topRight.x,i.topRight.y)))}return _(e,i.childNode1,r)}return _(e,i.childNode1,r)||_(e,i.childNode2,r)}}function y(t,r,o){var a=_(t,t._root,r);if(n(a)){a.imageIndex=o;var s=t._texture.width,l=t._texture.height,u=a.topRight.x-a.bottomLeft.x,c=a.topRight.y-a.bottomLeft.y,h=a.bottomLeft.x/s,d=a.bottomLeft.y/l,m=u/s,p=c/l;t._textureCoordinates[o]=new e(h,d,m,p),t._texture.copyFrom(r,a.bottomLeft.x,a.bottomLeft.y)}else g(t,r),y(t,r,o);t._guid=i()}var C=new t(16,16);return o(v.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}}),v.prototype.addImage=function(e,t){var i=this._idHash[e];if(n(i))return i;"function"==typeof t?t=t(e):"string"==typeof t&&(t=l(t));var r=this;return i=p(t,function(e){if(r.isDestroyed())return-1;var t=r.numberOfImages;return y(r,e,t),t}),this._idHash[e]=i,i},v.prototype.addSubRegion=function(t,r){var o=this._idHash[t];if(!n(o))throw new c('image with id "'+t+'" not found in the atlas.');var a=this;return p(o,function(t){if(-1===t)return-1;var n=a._texture.width,o=a._texture.height,s=a.numberOfImages,l=a._textureCoordinates[t],u=l.x+r.x/n,c=l.y+r.y/o,h=r.width/n,d=r.height/o;return a._textureCoordinates.push(new e(u,c,h,d)),a._guid=i(),s})},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),a(this)},v}),i("Scene/BillboardCollection",["../Core/AttributeCompression","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/IndexDatatype","../Core/Math","../Core/Matrix4","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArrayFacade","../Shaders/BillboardCollectionFS","../Shaders/BillboardCollectionVS","./Billboard","./BlendingState","./HorizontalOrigin","./Pass","./SceneMode","./TextureAtlas"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I){ +"use strict";function M(e){e=a(e,a.EMPTY_OBJECT),this._scene=e.scene,this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._rs=void 0,this._vaf=void 0,this._spPick=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._compiledShaderRotationPick=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._compiledShaderAlignedAxisPick=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._compiledShaderScaleByDistancePick=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistancePick=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistancePick=!1,this._propertiesChanged=new Uint32Array(ue),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new t,this._baseVolumeWC=new t,this._baseVolume2D=new t,this._boundingVolume=new t,this._boundingVolumeDirty=!1,this._colorCommands=[],this._pickCommands=[],this.modelMatrix=p.clone(a(e.modelMatrix,p.IDENTITY)),this._modelMatrix=p.clone(p.IDENTITY),this.debugShowBoundingVolume=a(e.debugShowBoundingVolume,!1),this._mode=P.SCENE3D,this._buffersUsage=[v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW];var i=this;this._uniforms={u_atlas:function(){return i._textureAtlas.texture}}}function D(e){for(var t=e.length,i=0;t>i;++i)e[i]&&e[i]._destroy()}function R(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;for(var t=[],i=e._billboards,r=i.length,n=0,o=0;r>n;++n){var a=i[n];a&&(a._index=o++,t.push(a))}e._billboards=t}}function O(e){var t=16384,i=e.cache.billboardCollection_indexBufferBatched;if(s(i))return i;for(var r=6*t-6,n=new Uint16Array(r),o=0,a=0;r>o;o+=6,a+=4)n[o]=a,n[o+1]=a+1,n[o+2]=a+2,n[o+3]=a+0,n[o+4]=a+2,n[o+5]=a+3;return i=f.createIndexBuffer({context:e,typedArray:n,usage:v.STATIC_DRAW,indexDatatype:d.UNSIGNED_SHORT}),i.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=i,i}function N(e){var t=e.cache.billboardCollection_indexBufferInstanced;return s(t)?t:(t=f.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:v.STATIC_DRAW,indexDatatype:d.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t,t)}function L(e){var t=e.cache.billboardCollection_vertexBufferInstanced;return s(t)?t:(t=f.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:v.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t,t)}function F(e,t,i,r){var n=[{index:X.positionHighAndScale,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[K]},{index:X.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[K]},{index:X.compressedAttribute0,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[Q]},{index:X.compressedAttribute1,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[se]},{index:X.compressedAttribute2,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[re]},{index:X.eyeOffset,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[J]},{index:X.scaleByDistance,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[ae]},{index:X.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[le]}];r&&n.push({index:X.direction,componentsPerAttribute:2,componentDatatype:o.FLOAT,vertexBuffer:L(e)});var a=r?t:4*t;return new E(e,n,a,r)}function B(e,i,r,n,o){var a,s=n[X.positionHighAndScale],l=n[X.positionLowAndRotation],u=o._getActualPosition();e._mode===P.SCENE3D&&(t.expand(e._baseVolume,u,e._baseVolume),e._boundingVolumeDirty=!0),h.fromCartesian(u,me);var c=o.scale,d=o.rotation;0!==d&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,c);var m=me.high,p=me.low;e._instanced?(a=o._index,s(a,m.x,m.y,m.z,c),l(a,p.x,p.y,p.z,d)):(a=4*o._index,s(a+0,m.x,m.y,m.z,c),s(a+1,m.x,m.y,m.z,c),s(a+2,m.x,m.y,m.z,c),s(a+3,m.x,m.y,m.z,c),l(a+0,p.x,p.y,p.z,d),l(a+1,p.x,p.y,p.z,d),l(a+2,p.x,p.y,p.z,d),l(a+3,p.x,p.y,p.z,d))}function V(t,i,r,n,o){var a,s=n[X.compressedAttribute0],l=o.pixelOffset,u=l.x,c=l.y,h=o._translate,d=h.x,p=h.y;t._maxPixelOffset=Math.max(t._maxPixelOffset,Math.abs(u+d),Math.abs(-c+p));var f=o.horizontalOrigin,v=o.verticalOrigin,g=o.show;0===o.color.alpha&&(g=!1),t._allHorizontalCenter=t._allHorizontalCenter&&f===b.CENTER,t._allVerticalCenter=t._allVerticalCenter&&v===b.CENTER;var _=0,y=0,C=0,E=0,S=o._imageIndex;if(-1!==S){var w=r[S];_=w.x,y=w.y,C=w.width,E=w.height}var T=_+C,x=y+E,A=Math.floor(m.clamp(u,-fe,fe)+fe)*_e;A+=(f+1)*ye,A+=(v+1)*Ce,A+=(g?1:0)*Ee;var P=Math.floor(m.clamp(c,-fe,fe)+fe)*ge,I=Math.floor(m.clamp(d,-fe,fe)+fe)*ge,M=(m.clamp(p,-fe,fe)+fe)*Se,D=Math.floor(M),R=Math.floor((M-D)*ge);P+=D,I+=R,pe.x=_,pe.y=y;var O=e.compressTextureCoordinates(pe);pe.x=T;var N=e.compressTextureCoordinates(pe);pe.y=x;var L=e.compressTextureCoordinates(pe);pe.x=_;var F=e.compressTextureCoordinates(pe);t._instanced?(a=o._index,s(a,A,P,I,O)):(a=4*o._index,s(a+0,A+we,P,I,O),s(a+1,A+Te,P,I,N),s(a+2,A+xe,P,I,L),s(a+3,A+be,P,I,F))}function k(t,i,n,o,l){var u,c=o[X.compressedAttribute1],h=l.alignedAxis;r.equals(h,r.ZERO)||(t._shaderAlignedAxis=!0);var d=0,p=1,f=1,v=1,g=l.translucencyByDistance;s(g)&&(d=g.near,p=g.nearValue,f=g.far,v=g.farValue,(1!==p||1!==v)&&(t._shaderTranslucencyByDistance=!0));var _=0,y=l._imageIndex;if(-1!==y){var C=n[y];_=C.width}var E=t._textureAtlas.texture.width,S=Math.ceil(.5*a(l.width,E*_));t._maxSize=Math.max(t._maxSize,S);var w=m.clamp(S,0,ve),T=0;Math.abs(r.magnitudeSquared(h)-1)<m.EPSILON6&&(T=e.octEncodeFloat(h)),p=m.clamp(p,0,1),p=1===p?255:255*p|0,w=w*ge+p,v=m.clamp(v,0,1),v=1===v?255:255*v|0,T=T*ge+v,t._instanced?(u=l._index,c(u,w,T,d,f)):(u=4*l._index,c(u+0,w,T,d,f),c(u+1,w,T,d,f),c(u+2,w,T,d,f),c(u+3,w,T,d,f))}function z(e,t,i,r,o){var s,l=r[X.compressedAttribute2],u=o.color,c=o.getPickId(t).color,h=o.sizeInMeters?1:0;e._allSizedInMeters=e._allSizedInMeters&&1===h;var d=0,m=o._imageIndex;if(-1!==m){var p=i[m];d=p.height}var f=e._textureAtlas.texture.dimensions,v=Math.ceil(.5*a(o.height,f.y*d));e._maxSize=Math.max(e._maxSize,v);var g=n.floatToByte(u.red),_=n.floatToByte(u.green),y=n.floatToByte(u.blue),C=g*ve+_*ge+y;g=n.floatToByte(c.red),_=n.floatToByte(c.green),y=n.floatToByte(c.blue);var E=g*ve+_*ge+y,S=n.floatToByte(u.alpha)*ve+n.floatToByte(c.alpha)*ge+h;e._instanced?(s=o._index,l(s,C,E,S,v)):(s=4*o._index,l(s+0,C,E,S,v),l(s+1,C,E,S,v),l(s+2,C,E,S,v),l(s+3,C,E,S,v))}function U(t,i,r,n,o){var a,s=n[X.eyeOffset],l=o.eyeOffset;if(t._maxEyeOffset=Math.max(t._maxEyeOffset,Math.abs(l.x),Math.abs(l.y),Math.abs(l.z)),t._instanced){var u=0,c=0,h=o._imageIndex;if(-1!==h){var d=r[h];u=d.width,c=d.height}pe.x=u,pe.y=c;var m=e.compressTextureCoordinates(pe);a=o._index,s(a,l.x,l.y,l.z,m)}else a=4*o._index,s(a+0,l.x,l.y,l.z,0),s(a+1,l.x,l.y,l.z,0),s(a+2,l.x,l.y,l.z,0),s(a+3,l.x,l.y,l.z,0)}function G(e,t,i,r,n){var o,a=r[X.scaleByDistance],l=0,u=1,c=1,h=1,d=n.scaleByDistance;s(d)&&(l=d.near,u=d.nearValue,c=d.far,h=d.farValue,(1!==u||1!==h)&&(e._shaderScaleByDistance=!0)),e._instanced?(o=n._index,a(o,l,u,c,h)):(o=4*n._index,a(o+0,l,u,c,h),a(o+1,l,u,c,h),a(o+2,l,u,c,h),a(o+3,l,u,c,h))}function W(e,t,i,r,n){var o,a=r[X.pixelOffsetScaleByDistance],l=0,u=1,c=1,h=1,d=n.pixelOffsetScaleByDistance;s(d)&&(l=d.near,u=d.nearValue,c=d.far,h=d.farValue,(1!==u||1!==h)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(o=n._index,a(o,l,u,c,h)):(o=4*n._index,a(o+0,l,u,c,h),a(o+1,l,u,c,h),a(o+2,l,u,c,h),a(o+3,l,u,c,h))}function H(e,t,i,r,n){B(e,t,i,r,n),V(e,t,i,r,n),k(e,t,i,r,n),z(e,t,i,r,n),U(e,t,i,r,n),G(e,t,i,r,n),W(e,t,i,r,n)}function q(e,i,r,n,o,a){var l;n.mode===P.SCENE3D?(l=e._baseVolume,e._boundingVolumeDirty=!0):l=e._baseVolume2D;for(var u=[],c=0;r>c;++c){var h=i[c],d=h.position,m=T._computeActualPosition(h,d,n,o);s(m)&&(h._setActualPosition(m),a?u.push(m):t.expand(l,m,l))}a&&t.fromPoints(u,l)}function j(e,t){var i=t.mode,r=e._billboards,n=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==i||i!==P.SCENE3D&&!p.equals(o,e.modelMatrix)?(e._mode=i,p.clone(e.modelMatrix,o),e._createVertexArray=!0,(i===P.SCENE3D||i===P.SCENE2D||i===P.COLUMBUS_VIEW)&&q(e,r,r.length,t,o,!0)):i===P.MORPHING?q(e,r,r.length,t,o,!0):(i===P.SCENE2D||i===P.COLUMBUS_VIEW)&&q(e,n,e._billboardsToUpdateIndex,t,o,!1)}function Y(e,t,i){var r=1;e._allSizedInMeters&&0===e._maxPixelOffset||(r=t.camera.getPixelSize(i,t.context.drawingBufferWidth,t.context.drawingBufferHeight));var n=r*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(n*=.5);var o=r*e._maxPixelOffset+e._maxEyeOffset;i.radius+=n+o}var X,Z=T.SHOW_INDEX,K=T.POSITION_INDEX,Q=T.PIXEL_OFFSET_INDEX,J=T.EYE_OFFSET_INDEX,$=T.HORIZONTAL_ORIGIN_INDEX,ee=T.VERTICAL_ORIGIN_INDEX,te=T.SCALE_INDEX,ie=T.IMAGE_INDEX_INDEX,re=T.COLOR_INDEX,ne=T.ROTATION_INDEX,oe=T.ALIGNED_AXIS_INDEX,ae=T.SCALE_BY_DISTANCE_INDEX,se=T.TRANSLUCENCY_BY_DISTANCE_INDEX,le=T.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,ue=T.NUMBER_OF_PROPERTIES,ce={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7},he={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8};l(M.prototype,{length:{get:function(){return R(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e,this._createVertexArray=!0)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}}}),M.prototype.add=function(e){var t=new T(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t},M.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=null,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1},M.prototype.removeAll=function(){D(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0},M.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]},M.prototype.contains=function(e){return s(e)&&e._billboardCollection===this},M.prototype.get=function(e){return R(this),this._billboards[e]};var de;M.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,i=this._propertiesChanged,r=0;ue>r;++r){var n=0===i[r]?v.STATIC_DRAW:v.STREAM_DRAW;t=t||e[r]!==n,e[r]=n}return t};var me=new h,pe=new i,fe=32768,ve=65536,ge=256,_e=128,ye=32,Ce=8,Ee=4,Se=1/256,we=0,Te=2,xe=3,be=1,Ae=[];return M.prototype.update=function(e){R(this);var i=this._billboards,r=i.length,n=e.context;this._instanced=n.instancedArrays,X=this._instanced?he:ce,de=this._instanced?N:O;var o=this._textureAtlas;if(!s(o)){o=this._textureAtlas=new I({context:n});for(var a=0;r>a;++a)i[a]._loadImage()}var l=o.textureCoordinates;if(0!==l.length){j(this,e),i=this._billboards,r=i.length;var u=this._billboardsToUpdate,c=this._billboardsToUpdateIndex,h=this._propertiesChanged,d=o.guid,m=this._createVertexArray||this._textureAtlasGUID!==d;this._textureAtlasGUID=d;var f,v=e.passes,E=v.pick;if(m||!E&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var T=0;ue>T;++T)h[T]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),r>0){this._vaf=F(n,r,this._buffersUsage,this._instanced),f=this._vaf.writers;for(var b=0;r>b;++b){var M=this._billboards[b];M._dirty=!1,H(this,n,l,f,M)}this._vaf.commit(de(n))}this._billboardsToUpdateIndex=0}else if(c>0){var D=Ae;D.length=0,(h[K]||h[ne]||h[te])&&D.push(B),(h[ie]||h[Q]||h[$]||h[ee]||h[Z])&&(D.push(V),this._instanced&&D.push(U)),(h[ie]||h[oe]||h[se])&&D.push(k),(h[ie]||h[re])&&D.push(z),h[J]&&D.push(U),h[ae]&&D.push(G),h[le]&&D.push(W);var L=D.length;if(f=this._vaf.writers,c/r>.1){for(var q=0;c>q;++q){var me=u[q];me._dirty=!1;for(var pe=0;L>pe;++pe)D[pe](this,n,l,f,me)}this._vaf.commit(de(n))}else{for(var fe=0;c>fe;++fe){var ve=u[fe];ve._dirty=!1;for(var ge=0;L>ge;++ge)D[ge](this,n,l,f,ve);this._instanced?this._vaf.subCommit(ve._index,1):this._vaf.subCommit(4*ve._index,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(c>1.5*r&&(u.length=r),s(this._vaf)&&s(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,t.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var _e,ye=p.IDENTITY;e.mode===P.SCENE3D?(ye=this.modelMatrix,_e=t.clone(this._baseVolumeWC,this._boundingVolume)):_e=t.clone(this._baseVolume2D,this._boundingVolume),Y(this,e,_e);var Ce,Ee,Se,we,Te,xe,be=e.commandList;if(v.render){var Pe=this._colorCommands;for(s(this._rs)||(this._rs=_.fromCache({depthTest:{enabled:!0},blending:x.ALPHA_BLEND})),s(this._sp)&&this._shaderRotation===this._compiledShaderRotation&&this._shaderAlignedAxis===this._compiledShaderAlignedAxis&&this._shaderScaleByDistance===this._compiledShaderScaleByDistance&&this._shaderTranslucencyByDistance===this._compiledShaderTranslucencyByDistance&&this._shaderPixelOffsetScaleByDistance===this._compiledShaderPixelOffsetScaleByDistance||(we=new C({sources:[w]}),this._instanced&&we.defines.push("INSTANCED"),this._shaderRotation&&we.defines.push("ROTATION"),this._shaderAlignedAxis&&we.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&we.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&we.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&we.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),s(this._scene)&&we.defines.push("CLAMPED_TO_GROUND"),this._sp=y.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:we,fragmentShaderSource:S,attributeLocations:X}),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance),Ce=this._vaf.va,Ee=Ce.length,Pe.length=Ee,xe=0;Ee>xe;++xe)Se=Pe[xe],s(Se)||(Se=Pe[xe]=new g({pass:A.OPAQUE,owner:this})),Se.boundingVolume=_e,Se.modelMatrix=ye,Se.count=Ce[xe].indicesCount,Se.shaderProgram=this._sp,Se.uniformMap=this._uniforms,Se.vertexArray=Ce[xe].va,Se.renderState=this._rs,Se.debugShowBoundingVolume=this.debugShowBoundingVolume,this._instanced&&(Se.count=6,Se.instanceCount=r),be.push(Se)}if(E){var Ie=this._pickCommands;for(s(this._spPick)&&this._shaderRotation===this._compiledShaderRotationPick&&this._shaderAlignedAxis===this._compiledShaderAlignedAxisPick&&this._shaderScaleByDistance===this._compiledShaderScaleByDistancePick&&this._shaderTranslucencyByDistance===this._compiledShaderTranslucencyByDistancePick&&this._shaderPixelOffsetScaleByDistance===this._compiledShaderPixelOffsetScaleByDistancePick||(we=new C({defines:["RENDER_FOR_PICK"],sources:[w]}),this._instanced&&we.defines.push("INSTANCED"),this._shaderRotation&&we.defines.push("ROTATION"),this._shaderAlignedAxis&&we.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&we.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&we.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&we.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),s(this._scene)&&we.defines.push("CLAMPED_TO_GROUND"),Te=new C({defines:["RENDER_FOR_PICK"],sources:[S]}),this._spPick=y.replaceCache({context:n,shaderProgram:this._spPick,vertexShaderSource:we,fragmentShaderSource:Te,attributeLocations:X}),this._compiledShaderRotationPick=this._shaderRotation,this._compiledShaderAlignedAxisPick=this._shaderAlignedAxis,this._compiledShaderScaleByDistancePick=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistancePick=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistancePick=this._shaderPixelOffsetScaleByDistance),Ce=this._vaf.va,Ee=Ce.length,Ie.length=Ee,xe=0;Ee>xe;++xe)Se=Ie[xe],s(Se)||(Se=Ie[xe]=new g({pass:A.OPAQUE,owner:this})),Se.boundingVolume=_e,Se.modelMatrix=ye,Se.count=Ce[xe].indicesCount,Se.shaderProgram=this._spPick,Se.uniformMap=this._uniforms,Se.vertexArray=Ce[xe].va,Se.renderState=this._rs,this._instanced&&(Se.count=6,Se.instanceCount=r),be.push(Se)}}}},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){return this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),D(this._billboards),u(this)},M}),i("DataSources/BoundingSphereState",["../Core/freezeObject"],function(e){"use strict";var t={DONE:0,PENDING:1,FAILED:2};return e(t)}),i("DataSources/Property",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Iso8601"],function(e,t,i,r,n){"use strict";function o(){r.throwInstantiationError()}return i(o.prototype,{isConstant:{get:r.throwInstantiationError},definitionChanged:{get:r.throwInstantiationError}}),o.prototype.getValue=r.throwInstantiationError,o.prototype.equals=r.throwInstantiationError,o.equals=function(e,i){return e===i||t(e)&&e.equals(i)},o.arrayEquals=function(e,i){if(e===i)return!0;if(!t(e)||!t(i)||e.length!==i.length)return!1;for(var r=e.length,n=0;r>n;n++)if(!o.equals(e[n],i[n]))return!1;return!0},o.isConstant=function(e){return!t(e)||e.isConstant},o.getValueOrUndefined=function(e,i,r){return t(e)?e.getValue(i,r):void 0},o.getValueOrDefault=function(i,r,n,o){return t(i)?e(i.getValue(r,o),n):n},o.getValueOrClonedDefault=function(e,i,r,n){var o;return t(e)&&(o=e.getValue(i,n)),t(o)||(o=r.clone(o)),o},o}),i("DataSources/BillboardVisualizer",["../Core/AssociativeArray","../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/NearFarScalar","../Scene/BillboardCollection","../Scene/HorizontalOrigin","../Scene/VerticalOrigin","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m){"use strict";function p(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function f(t,i){i.collectionChanged.addEventListener(f.prototype._onCollectionChanged,this),this._scene=t,this._unusedIndexes=[],this._billboardCollection=void 0,this._entityCollection=i,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}function v(e,t){if(o(e)){var i=e.billboard;o(i)&&(e.textureValue=void 0,e.billboard=void 0,i.show=!1,i.image=void 0,t.push(i._index))}}var g=n.WHITE,_=r.ZERO,y=i.ZERO,C=1,E=0,S=r.ZERO,w=c.CENTER,T=h.CENTER,x=!1,b=new r,A=new n,P=new r,I=new i,M=new l,D=new l,R=new l,O=new t;return f.prototype.update=function(e){for(var t=this._items.values,i=this._unusedIndexes,r=0,n=t.length;n>r;r++){var a,s=t[r],l=s.entity,c=l._billboard,h=s.billboard,d=l.isShowing&&l.isAvailable(e)&&m.getValueOrDefault(c._show,e,!0);if(d&&(b=m.getValueOrUndefined(l._position,e,b),a=m.getValueOrUndefined(c._image,e),d=o(b)&&o(a)),d){if(!o(h)){var p=this._billboardCollection;o(p)||(p=new u,this._billboardCollection=p,this._scene.primitives.add(p));var f=i.length;h=f>0?p.get(i.pop()):p.add(),h.id=l,h.image=void 0,s.billboard=h}h.show=d,s.textureValue!==a&&(h.image=a,s.textureValue=a),h.position=b,h.color=m.getValueOrDefault(c._color,e,g,A),h.eyeOffset=m.getValueOrDefault(c._eyeOffset,e,_,P),h.pixelOffset=m.getValueOrDefault(c._pixelOffset,e,y,I),h.scale=m.getValueOrDefault(c._scale,e,C),h.rotation=m.getValueOrDefault(c._rotation,e,E),h.alignedAxis=m.getValueOrDefault(c._alignedAxis,e,S),h.horizontalOrigin=m.getValueOrDefault(c._horizontalOrigin,e,w),h.verticalOrigin=m.getValueOrDefault(c._verticalOrigin,e,T),h.width=m.getValueOrUndefined(c._width,e),h.height=m.getValueOrUndefined(c._height,e),h.scaleByDistance=m.getValueOrUndefined(c._scaleByDistance,e,M),h.translucencyByDistance=m.getValueOrUndefined(c._translucencyByDistance,e,D),h.pixelOffsetScaleByDistance=m.getValueOrUndefined(c._pixelOffsetScaleByDistance,e,R),h.sizeInMeters=m.getValueOrDefault(c._sizeInMeters,x);var N=m.getValueOrUndefined(c._imageSubRegion,e,O);o(N)&&h.setImageSubRegion(h._imageId,N)}else v(s,i)}return!0},f.prototype.getBoundingSphere=function(e,t){var i=this._items.get(e.id);return o(i)&&o(i.billboard)?(t.center=r.clone(i.billboard.position,t.center),t.radius=0,d.DONE):d.FAILED},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._entityCollection.collectionChanged.removeEventListener(f.prototype._onCollectionChanged,this),o(this._billboardCollection)&&this._scene.primitives.remove(this._billboardCollection),a(this)},f.prototype._onCollectionChanged=function(e,t,i,r){var n,a,s=this._unusedIndexes,l=this._items;for(n=t.length-1;n>-1;n--)a=t[n],o(a._billboard)&&o(a._position)&&l.set(a.id,new p(a));for(n=r.length-1;n>-1;n--)a=r[n],o(a._billboard)&&o(a._position)?l.contains(a.id)||l.set(a.id,new p(a)):(v(l.get(a.id),s),l.remove(a.id));for(n=i.length-1;n>-1;n--)a=i[n],v(l.get(a.id),s),l.remove(a.id)},f}),i("Shaders/Appearances/AllMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_binormalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nmat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_binormalEC);\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = tangentToEyeMatrix;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),i("Shaders/Appearances/AllMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec3 tangent;\nattribute vec3 binormal;\nattribute vec2 st;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_binormalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_tangentEC = czm_normal * tangent;\nv_binormalEC = czm_normal * binormal;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Shaders/Appearances/BasicMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),i("Shaders/Appearances/BasicMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Shaders/Appearances/TexturedMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);;\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),i("Shaders/Appearances/TexturedMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec2 st;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Scene/CullFace",["../Core/freezeObject","../Renderer/WebGLConstants"],function(e,t){"use strict";var i={FRONT:t.FRONT,BACK:t.BACK,FRONT_AND_BACK:t.FRONT_AND_BACK};return e(i)}),i("Scene/Appearance",["../Core/clone","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","./BlendingState","./CullFace"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=i(e,i.EMPTY_OBJECT),this.material=e.material,this.translucent=i(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=i(e.closed,!1)}return n(s.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}}),s.prototype.getFragmentShaderSource=function(){var e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),r(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join("\n")},s.prototype.isTranslucent=function(){return r(this.material)&&this.material.isTranslucent()||!r(this.material)&&this.translucent},s.prototype.getRenderState=function(){var t=this.isTranslucent(),i=e(this.renderState,!1);return t?(i.depthMask=!1,i.blending=o.ALPHA_BLEND):i.depthMask=!0,i},s.getDefaultRenderState=function(e,i,n){var s={depthTest:{enabled:!0}};return e&&(s.depthMask=!1,s.blending=o.ALPHA_BLEND),i&&(s.cull={enabled:!0,face:a.BACK}),r(n)&&(s=t(n,s,!0)),s},s}),i("Renderer/CubeMapFace",["../Core/defaultValue","../Core/defineProperties","../Core/DeveloperError","./PixelDatatype"],function(e,t,i,r){"use strict";function n(e,t,i,r,n,o,a,s,l){this._gl=e,this._texture=t,this._textureTarget=i,this._targetFace=r,this._pixelFormat=n,this._pixelDatatype=o,this._size=a,this._preMultiplyAlpha=s,this._flipY=l}return t(n.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}}),n.prototype.copyFrom=function(t,i,r){i=e(i,0),r=e(r,0);var n=this._gl,o=this._textureTarget;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._preMultiplyAlpha),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,this._flipY),n.activeTexture(n.TEXTURE0),n.bindTexture(o,this._texture),t.arrayBufferView?n.texSubImage2D(this._targetFace,0,i,r,t.width,t.height,this._pixelFormat,this._pixelDatatype,t.arrayBufferView):n.texSubImage2D(this._targetFace,0,i,r,this._pixelFormat,this._pixelDatatype,t),n.bindTexture(o,null)},n.prototype.copyFromFramebuffer=function(t,i,r,n,o,a){t=e(t,0),i=e(i,0),r=e(r,0),n=e(n,0),o=e(o,this._size),a=e(a,this._size);var s=this._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.copyTexSubImage2D(this._targetFace,0,t,i,r,n,o,a),s.bindTexture(l,null)},n}),i("Renderer/CubeMap",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","./ContextLimits","./CubeMapFace","./MipmapHint","./PixelDatatype","./Sampler","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(i){function r(e,t){t.arrayBufferView?_.texImage2D(e,0,p,m,m,0,p,f,t.arrayBufferView):_.texImage2D(e,0,p,p,f,t)}i=e(i,e.EMPTY_OBJECT);var n,o,s=i.context,u=i.source;if(t(u)){var d=[u.positiveX,u.negativeX,u.positiveY,u.negativeY,u.positiveZ,u.negativeZ];n=d[0].width,o=d[0].height}else n=i.width,o=i.height;var m=n,p=e(i.pixelFormat,a.RGBA),f=e(i.pixelDatatype,c.UNSIGNED_BYTE),v=i.preMultiplyAlpha||p===a.RGB||p===a.LUMINANCE,g=e(i.flipY,!0),_=s._gl,y=_.TEXTURE_CUBE_MAP,C=_.createTexture();_.activeTexture(_.TEXTURE0),_.bindTexture(y,C),t(u)?(_.pixelStorei(_.UNPACK_PREMULTIPLY_ALPHA_WEBGL,v),_.pixelStorei(_.UNPACK_FLIP_Y_WEBGL,g),r(_.TEXTURE_CUBE_MAP_POSITIVE_X,u.positiveX),r(_.TEXTURE_CUBE_MAP_NEGATIVE_X,u.negativeX),r(_.TEXTURE_CUBE_MAP_POSITIVE_Y,u.positiveY),r(_.TEXTURE_CUBE_MAP_NEGATIVE_Y,u.negativeY),r(_.TEXTURE_CUBE_MAP_POSITIVE_Z,u.positiveZ),r(_.TEXTURE_CUBE_MAP_NEGATIVE_Z,u.negativeZ)):(_.texImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_X,0,p,m,m,0,p,f,null),_.texImage2D(_.TEXTURE_CUBE_MAP_NEGATIVE_X,0,p,m,m,0,p,f,null),_.texImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_Y,0,p,m,m,0,p,f,null),_.texImage2D(_.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,p,m,m,0,p,f,null),_.texImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_Z,0,p,m,m,0,p,f,null),_.texImage2D(_.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,p,m,m,0,p,f,null)),_.bindTexture(y,null),this._gl=_,this._textureFilterAnisotropic=s._textureFilterAnisotropic,this._textureTarget=y,this._texture=C,this._pixelFormat=p,this._pixelDatatype=f,this._size=m,this._preMultiplyAlpha=v,this._flipY=g,this._sampler=void 0,this._positiveX=new l(_,C,y,_.TEXTURE_CUBE_MAP_POSITIVE_X,p,f,m,v,g),this._negativeX=new l(_,C,y,_.TEXTURE_CUBE_MAP_NEGATIVE_X,p,f,m,v,g),this._positiveY=new l(_,C,y,_.TEXTURE_CUBE_MAP_POSITIVE_Y,p,f,m,v,g),this._negativeY=new l(_,C,y,_.TEXTURE_CUBE_MAP_NEGATIVE_Y,p,f,m,v,g),this._positiveZ=new l(_,C,y,_.TEXTURE_CUBE_MAP_POSITIVE_Z,p,f,m,v,g),this._negativeZ=new l(_,C,y,_.TEXTURE_CUBE_MAP_NEGATIVE_Z,p,f,m,v,g),this.sampler=new h}return i(f.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){var i=e.minificationFilter,r=e.magnificationFilter,n=i===m.NEAREST_MIPMAP_NEAREST||i===m.NEAREST_MIPMAP_LINEAR||i===m.LINEAR_MIPMAP_NEAREST||i===m.LINEAR_MIPMAP_LINEAR;this._pixelDatatype===c.FLOAT&&(i=n?m.NEAREST_MIPMAP_NEAREST:m.NEAREST,r=d.NEAREST);var o=this._gl,a=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(a,this._texture),o.texParameteri(a,o.TEXTURE_MIN_FILTER,i),o.texParameteri(a,o.TEXTURE_MAG_FILTER,r),o.texParameteri(a,o.TEXTURE_WRAP_S,e.wrapS),o.texParameteri(a,o.TEXTURE_WRAP_T,e.wrapT),t(this._textureFilterAnisotropic)&&o.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy), +o.bindTexture(a,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}}),f.prototype.generateMipmap=function(t){t=e(t,u.DONT_CARE);var i=this._gl,r=this._textureTarget;i.hint(i.GENERATE_MIPMAP_HINT,t),i.activeTexture(i.TEXTURE0),i.bindTexture(r,this._texture),i.generateMipmap(r),i.bindTexture(r,null)},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._gl.deleteTexture(this._texture),this._positiveX=r(this._positiveX),this._negativeX=r(this._negativeX),this._positiveY=r(this._positiveY),this._negativeY=r(this._negativeY),this._positiveZ=r(this._positiveZ),this._negativeZ=r(this._negativeZ),r(this)},f}),i("Shaders/Materials/BumpMapMaterial",[],function(){"use strict";return"uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nvec2 centerPixel = fract(repeat * st);\nfloat centerBump = texture2D(image, centerPixel).channel;\nfloat imageWidth = float(imageDimensions.x);\nvec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));\nfloat rightBump = texture2D(image, rightPixel).channel;\nfloat imageHeight = float(imageDimensions.y);\nvec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));\nfloat topBump = texture2D(image, leftPixel).channel;\nvec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nmaterial.diffuse = vec3(0.01);\nreturn material;\n}\n"}),i("Shaders/Materials/CheckerboardMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0);\nfloat scaledWidth = fract(repeat.s * st.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(repeat.t * st.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value = min(scaledWidth, scaledHeight);\nvec4 currentColor = mix(lightColor, darkColor, b);\nvec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/DotMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5));\nvec4 color = mix(lightColor, darkColor, b);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/FadeMaterial",[],function(){"use strict";return"uniform vec4 fadeInColor;\nuniform vec4 fadeOutColor;\nuniform float maximumDistance;\nuniform bool repeat;\nuniform vec2 fadeDirection;\nuniform vec2 time;\nfloat getTime(float t, float coord)\n{\nfloat scalar = 1.0 / maximumDistance;\nfloat q = distance(t, coord) * scalar;\nif (repeat)\n{\nfloat r = distance(t, coord + 1.0) * scalar;\nfloat s = distance(t, coord - 1.0) * scalar;\nq = min(min(r, s), q);\n}\nreturn clamp(q, 0.0, 1.0);\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat s = getTime(time.x, st.s) * fadeDirection.s;\nfloat t = getTime(time.y, st.t) * fadeDirection.t;\nfloat u = length(vec2(s, t));\nvec4 color = mix(fadeInColor, fadeOutColor, u);\nmaterial.emission = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/GridMaterial",[],function(){"use strict";return"#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform vec4 color;\nuniform float cellAlpha;\nuniform vec2 lineCount;\nuniform vec2 lineThickness;\nuniform vec2 lineOffset;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat scaledWidth = fract(lineCount.s * st.s - lineOffset.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(lineCount.t * st.t - lineOffset.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value;\n#ifdef GL_OES_standard_derivatives\nconst float fuzz = 1.2;\nvec2 thickness = (lineThickness * czm_resolutionScale) - 1.0;\nvec2 dx = abs(dFdx(st));\nvec2 dy = abs(dFdy(st));\nvec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;\nvalue = min(\nsmoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),\nsmoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));\n#else\nconst float fuzz = 0.05;\nvec2 range = 0.5 - (lineThickness * 0.05);\nvalue = min(\n1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),\n1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));\n#endif\nfloat dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)));\nfloat sRim = smoothstep(0.8, 1.0, dRim);\nvalue *= (1.0 - sRim);\nvec3 halfColor = color.rgb * 0.5;\nmaterial.diffuse = halfColor;\nmaterial.emission = halfColor;\nmaterial.alpha = color.a * (1.0 - ((1.0 - cellAlpha) * value));\nreturn material;\n}\n"}),i("Shaders/Materials/NormalMapMaterial",[],function(){"use strict";return"uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec4 textureValue = texture2D(image, fract(repeat * materialInput.st));\nvec3 normalTangentSpace = textureValue.channels;\nnormalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;\nnormalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);\nnormalTangentSpace = normalize(normalTangentSpace);\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nreturn material;\n}\n"}),i("Shaders/Materials/PolylineArrowMaterial",[],function(){"use strict";return"#extension GL_OES_standard_derivatives : enable\nuniform vec4 color;\nvarying float v_width;\nfloat getPointOnLine(vec2 p0, vec2 p1, float x)\n{\nfloat slope = (p0.y - p1.y) / (p0.x - p1.x);\nreturn slope * (x - p0.x) + p0.y;\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat base = 1.0 - abs(fwidth(st.s)) * 10.0;\nvec2 center = vec2(1.0, 0.5);\nfloat ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);\nfloat ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);\nfloat halfWidth = 0.15;\nfloat s = step(0.5 - halfWidth, st.t);\ns *= 1.0 - step(0.5 + halfWidth, st.t);\ns *= 1.0 - step(base, st.s);\nfloat t = step(base, materialInput.st.s);\nt *= 1.0 - step(ptOnUpperLine, st.t);\nt *= step(ptOnLowerLine, st.t);\nfloat dist;\nif (st.s < base)\n{\nfloat d1 = abs(st.t - (0.5 - halfWidth));\nfloat d2 = abs(st.t - (0.5 + halfWidth));\ndist = min(d1, d2);\n}\nelse\n{\nfloat d1 = czm_infinity;\nif (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)\n{\nd1 = abs(st.s - base);\n}\nfloat d2 = abs(st.t - ptOnUpperLine);\nfloat d3 = abs(st.t - ptOnLowerLine);\ndist = min(min(d1, d2), d3);\n}\nvec4 outsideColor = vec4(0.0);\nvec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));\nvec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n"}),i("Shaders/Materials/PolylineGlowMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform float glowPower;\nvarying float v_width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5);\nmaterial.emission = max(vec3(glow - 1.0 + color.rgb), color.rgb);\nmaterial.alpha = clamp(0.0, 1.0, glow) * color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/PolylineOutlineMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform vec4 outlineColor;\nuniform float outlineWidth;\nvarying float v_width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width;\nfloat b = step(0.5 - halfInteriorWidth, st.t);\nb *= 1.0 - step(0.5 + halfInteriorWidth, st.t);\nfloat d1 = abs(st.t - (0.5 - halfInteriorWidth));\nfloat d2 = abs(st.t - (0.5 + halfInteriorWidth));\nfloat dist = min(d1, d2);\nvec4 currentColor = mix(outlineColor, color, b);\nvec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n"}),i("Shaders/Materials/RimLightingMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform vec4 rimColor;\nuniform float width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));\nfloat s = smoothstep(1.0 - width, 1.0, d);\nmaterial.diffuse = color.rgb;\nmaterial.emission = rimColor.rgb * s;\nmaterial.alpha = mix(color.a, rimColor.a, s);\nreturn material;\n}\n"}),i("Shaders/Materials/StripeMaterial",[],function(){"use strict";return"uniform vec4 evenColor;\nuniform vec4 oddColor;\nuniform float offset;\nuniform float repeat;\nuniform bool horizontal;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));\nfloat value = fract((coord - offset) * (repeat * 0.5));\nfloat dist = min(value, min(abs(value - 0.5), 1.0 - value));\nvec4 currentColor = mix(evenColor, oddColor, step(0.5, value));\nvec4 color = czm_antialias(evenColor, oddColor, currentColor, dist);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/Water",[],function(){"use strict";return"uniform sampler2D specularMap;\nuniform sampler2D normalMap;\nuniform vec4 baseWaterColor;\nuniform vec4 blendColor;\nuniform float frequency;\nuniform float animationSpeed;\nuniform float amplitude;\nuniform float specularIntensity;\nuniform float fadeFactor;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat time = czm_frameNumber * animationSpeed;\nfloat fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);\nfloat specularMapValue = texture2D(specularMap, materialInput.st).r;\nvec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);\nvec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));\nnormalTangentSpace.xy /= fade;\nnormalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);\nnormalTangentSpace = normalize(normalTangentSpace);\nfloat tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);\nmaterial.alpha = specularMapValue;\nmaterial.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);\nmaterial.diffuse += (0.1 * tsPerturbationRatio);\nmaterial.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);\nmaterial.specular = specularIntensity;\nmaterial.shininess = 10.0;\nreturn material;\n}\n"}),i("Scene/Material",["../Core/Cartesian2","../Core/clone","../Core/Color","../Core/combine","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/isArray","../Core/loadImage","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Renderer/CubeMap","../Renderer/Texture","../Shaders/Materials/BumpMapMaterial","../Shaders/Materials/CheckerboardMaterial","../Shaders/Materials/DotMaterial","../Shaders/Materials/FadeMaterial","../Shaders/Materials/GridMaterial","../Shaders/Materials/NormalMapMaterial","../Shaders/Materials/PolylineArrowMaterial","../Shaders/Materials/PolylineGlowMaterial","../Shaders/Materials/PolylineOutlineMaterial","../Shaders/Materials/RimLightingMaterial","../Shaders/Materials/StripeMaterial","../Shaders/Materials/Water","../ThirdParty/when"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I){"use strict";function M(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,D(e,this),s(this,{type:{value:this.type,writable:!1}}),a(M._uniformList[this.type])||(M._uniformList[this.type]=Object.keys(this._uniforms))}function D(e,i){e=o(e,o.EMPTY_OBJECT),i._strict=o(e.strict,!1),i._count=o(e.count,0),i._template=t(o(e.fabric,o.EMPTY_OBJECT)),i._template.uniforms=t(o(i._template.uniforms,o.EMPTY_OBJECT)),i._template.materials=t(o(i._template.materials,o.EMPTY_OBJECT)),i.type=a(i._template.type)?i._template.type:n(),i.shaderSource="",i.materials={},i.uniforms={},i._uniforms={},i._translucentFunctions=[];var s,l=M._materialCache.getMaterial(i.type);if(a(l)){var u=t(l.fabric,!0);i._template=r(i._template,u,!0),s=l.translucent}L(i),a(l)||M._materialCache.addMaterial(i.type,i),F(i),k(i),G(i);var c=0===i._translucentFunctions.length?!0:void 0;if(s=o(s,c),s=o(e.translucent,s),a(s))if("function"==typeof s){var h=function(){return s(i)};i._translucentFunctions.push(h)}else i._translucentFunctions.push(s)}function R(e,t,i,r){if(a(e))for(var n in e)if(e.hasOwnProperty(n)){var o=-1!==t.indexOf(n);(r&&!o||!r&&o)&&i(n,t)}}function O(e,t){for(var i="fabric: property name '"+e+"' is not valid. It should be ",r=0;r<t.length;r++){var n="'"+t[r]+"'";i+=r===t.length-1?"or "+n+".":n+", "}throw new u(i)}function N(e,t){var i="fabric: uniforms and materials cannot share the same property '"+e+"'";throw new u(i)}function L(e){var t=e._template,i=t.uniforms,r=t.materials,n=t.components;if(a(n)&&a(t.source))throw new u("fabric: cannot have source and components in the same template.");R(t,q,O,!0),R(n,j,O,!0);var o=[];for(var s in r)r.hasOwnProperty(s)&&o.push(s);R(i,o,N,!1)}function F(e){var t=e._template.components,i=e._template.source;if(a(i))e.shaderSource+=i+"\n";else{if(e.shaderSource+="czm_material czm_getMaterial(czm_materialInput materialInput)\n{\n",e.shaderSource+="czm_material material = czm_getDefaultMaterial(materialInput);\n",a(t))for(var r in t)t.hasOwnProperty(r)&&(e.shaderSource+="material."+r+" = "+t[r]+";\n");e.shaderSource+="return material;\n}\n"}}function B(e){var t;return function(i,r){var n=i.uniforms,o=n[e],s=t!==o;t=o;var l,u,c=i._textures[e];if(o instanceof HTMLVideoElement)if(o.readyState>=2){if(s&&a(c)&&(c!==r.defaultTexture&&c.destroy(),c=void 0),!a(c)||c===r.defaultTexture)return c=new v({context:r,source:o}),void(i._textures[e]=c);c.copyFrom(o)}else a(c)||(i._textures[e]=r.defaultTexture);else{if(o instanceof v&&o!==c){i._texturePaths[e]=void 0;var d=i._textures[e];return d!==i._defaultTexture&&d.destroy(),i._textures[e]=o,l=e+"Dimensions",void(n.hasOwnProperty(l)&&(u=n[l],u.x=o._width,u.y=o._height))}a(c)||(i._texturePaths[e]=void 0,a(i._defaultTexture)||(i._defaultTexture=r.defaultTexture),c=i._textures[e]=i._defaultTexture,l=e+"Dimensions",n.hasOwnProperty(l)&&(u=n[l],u.x=c._width,u.y=c._height)),o!==M.DefaultImageId&&o!==i._texturePaths[e]&&("string"==typeof o?I(h(o),function(t){i._loadedImages.push({id:e,image:t})}):o instanceof HTMLCanvasElement&&i._loadedImages.push({id:e,image:o}),i._texturePaths[e]=o)}}}function V(e){return function(t,i){var r=t.uniforms[e];if(r instanceof f){var n=t._textures[e];return n!==t._defaultTexture&&n.destroy(),t._texturePaths[e]=void 0,void(t._textures[e]=r)}if(a(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=i.defaultCubeMap),r!==M.DefaultCubeMapId){var o=r.positiveX+r.negativeX+r.positiveY+r.negativeY+r.positiveZ+r.negativeZ;if(o!==t._texturePaths[e]){var s=[h(r.positiveX),h(r.negativeX),h(r.positiveY),h(r.negativeY),h(r.positiveZ),h(r.negativeZ)];I.all(s).then(function(i){t._loadedCubeMaps.push({id:e,images:i})}),t._texturePaths[e]=o}}}}function k(e){var t=e._template.uniforms;for(var i in t)t.hasOwnProperty(i)&&z(e,i)}function z(e,t){var i=e._strict,r=e._template.uniforms,n=r[t],o=U(n);if(!a(o))throw new u("fabric: uniform '"+t+"' has invalid type.");if("channels"===o){if(0===W(e,t,n,!1)&&i)throw new u("strict: shader source does not use channels '"+t+"'.")}else{if("sampler2D"===o){var s=t+"Dimensions";H(e,s)>0&&(r[s]={type:"ivec3",x:1,y:1},z(e,s))}var l=new RegExp("uniform\\s+"+o+"\\s+"+t+"\\s*;");if(!l.test(e.shaderSource)){var c="uniform "+o+" "+t+";";e.shaderSource=c+e.shaderSource}var h=t+"_"+e._count++;if(1===W(e,t,h)&&i)throw new u("strict: shader source does not use uniform '"+t+"'.");if(e.uniforms[t]=n,"sampler2D"===o)e._uniforms[h]=function(){return e._textures[t]},e._updateFunctions.push(B(t));else if("samplerCube"===o)e._uniforms[h]=function(){return e._textures[t]},e._updateFunctions.push(V(t));else if(-1!==o.indexOf("mat")){var d=new Y[o];e._uniforms[h]=function(){return Y[o].fromColumnMajorArray(e.uniforms[t],d)}}else e._uniforms[h]=function(){return e.uniforms[t]}}}function U(e){var t=e.type;if(!a(t)){var i=typeof e;if("number"===i)t="float";else if("boolean"===i)t="bool";else if("string"===i||e instanceof HTMLCanvasElement)t=/^([rgba]){1,4}$/i.test(e)?"channels":e===M.DefaultCubeMapId?"samplerCube":"sampler2D";else if("object"===i)if(c(e))(4===e.length||9===e.length||16===e.length)&&(t="mat"+Math.sqrt(e.length));else{var r=0;for(var n in e)e.hasOwnProperty(n)&&(r+=1);r>=2&&4>=r?t="vec"+r:6===r&&(t="samplerCube")}}return t}function G(e){var t=e._strict,i=e._template.materials;for(var n in i)if(i.hasOwnProperty(n)){var o=new M({strict:t,fabric:i[n],count:e._count});e._count=o._count,e._uniforms=r(e._uniforms,o._uniforms,!0),e.materials[n]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);var a="czm_getMaterial",s=a+"_"+e._count++;W(o,a,s),e.shaderSource=o.shaderSource+e.shaderSource;var l=s+"(materialInput)";if(0===W(e,n,l)&&t)throw new u("strict: shader source does not use material '"+n+"'.")}}function W(e,t,i,r){r=o(r,!0);var n=0,a="([\\w])?",s="([\\w"+(r?".":"")+"])?",l=new RegExp(s+t+a,"g");return e.shaderSource=e.shaderSource.replace(l,function(e,t,r){return t||r?e:(n+=1,i)}),n}function H(e,t,i){return W(e,t,t,i)}M._uniformList={},M.fromType=function(e,t){var i=new M({fabric:{type:e}});if(a(t))for(var r in t)t.hasOwnProperty(r)&&(i.uniforms[r]=t[r]);return i},M.prototype.isTranslucent=function(){if(a(this.translucent))return"function"==typeof this.translucent?this.translucent():this.translucent;for(var e=!0,t=this._translucentFunctions,i=t.length,r=0;i>r;++r){var n=t[r];if(e="function"==typeof n?e&&n():e&&n,!e)break}return e},M.prototype.update=function(e){var t,i,r=this._loadedImages,n=r.length;for(t=0;n>t;++t){var o=r[t];i=o.id;var a=o.image,s=new v({context:e,source:a});this._textures[i]=s;var l=i+"Dimensions";if(this.uniforms.hasOwnProperty(l)){var u=this.uniforms[l];u.x=s._width,u.y=s._height}}r.length=0;var c=this._loadedCubeMaps;for(n=c.length,t=0;n>t;++t){var h=c[t];i=h.id;var d=h.images,m=new f({context:e,source:{positiveX:d[0],negativeX:d[1],positiveY:d[2],negativeY:d[3],positiveZ:d[4],negativeZ:d[5]}});this._textures[i]=m}c.length=0;var p=this._updateFunctions;for(n=p.length,t=0;n>t;++t)p[t](this,e);var g=this.materials;for(var _ in g)g.hasOwnProperty(_)&&g[_].update(e)},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){var e=this._textures;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];i!==this._defaultTexture&&i.destroy()}var r=this.materials;for(var n in r)r.hasOwnProperty(n)&&r[n].destroy();return l(this)};var q=["type","materials","uniforms","components","source"],j=["diffuse","specular","shininess","normal","emission","alpha"],Y={mat2:d,mat3:m,mat4:p};return M._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}},M.DefaultImageId="czm_defaultImage",M.DefaultCubeMapId="czm_defaultCubeMap",M.ColorType="Color",M._materialCache.addMaterial(M.ColorType,{fabric:{type:M.ColorType,uniforms:{color:new i(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),M.ImageType="Image",M._materialCache.addMaterial(M.ImageType,{fabric:{type:M.ImageType,uniforms:{image:M.DefaultImageId,repeat:new e(1,1),alpha:1},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).rgb",alpha:"texture2D(image, fract(repeat * materialInput.st)).a * alpha"}},translucent:function(e){return e.uniforms.alpha<1}}),M.DiffuseMapType="DiffuseMap",M._materialCache.addMaterial(M.DiffuseMapType,{fabric:{type:M.DiffuseMapType,uniforms:{image:M.DefaultImageId,channels:"rgb",repeat:new e(1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),M.AlphaMapType="AlphaMap",M._materialCache.addMaterial(M.AlphaMapType,{fabric:{type:M.AlphaMapType,uniforms:{image:M.DefaultImageId,channel:"a",repeat:new e(1,1)},components:{alpha:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!0}),M.SpecularMapType="SpecularMap",M._materialCache.addMaterial(M.SpecularMapType,{fabric:{type:M.SpecularMapType,uniforms:{image:M.DefaultImageId,channel:"r",repeat:new e(1,1)},components:{specular:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!1}),M.EmissionMapType="EmissionMap",M._materialCache.addMaterial(M.EmissionMapType,{fabric:{type:M.EmissionMapType,uniforms:{image:M.DefaultImageId,channels:"rgb",repeat:new e(1,1)},components:{emission:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),M.BumpMapType="BumpMap",M._materialCache.addMaterial(M.BumpMapType,{fabric:{type:M.BumpMapType,uniforms:{image:M.DefaultImageId,channel:"r",strength:.8,repeat:new e(1,1)},source:g},translucent:!1}),M.NormalMapType="NormalMap",M._materialCache.addMaterial(M.NormalMapType,{fabric:{type:M.NormalMapType,uniforms:{image:M.DefaultImageId,channels:"rgb",strength:.8,repeat:new e(1,1)},source:S},translucent:!1}),M.GridType="Grid",M._materialCache.addMaterial(M.GridType,{fabric:{type:M.GridType,uniforms:{color:new i(0,1,0,1),cellAlpha:.1,lineCount:new e(8,8),lineThickness:new e(1,1),lineOffset:new e(0,0)},source:E},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}}),M.StripeType="Stripe",M._materialCache.addMaterial(M.StripeType,{fabric:{type:M.StripeType,uniforms:{horizontal:!0,evenColor:new i(1,1,1,.5),oddColor:new i(0,0,1,.5),offset:0,repeat:5},source:A},translucent:function(e){var t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<0}}),M.CheckerboardType="Checkerboard",M._materialCache.addMaterial(M.CheckerboardType,{fabric:{type:M.CheckerboardType,uniforms:{lightColor:new i(1,1,1,.5),darkColor:new i(0,0,0,.5),repeat:new e(5,5)},source:_},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<0}}),M.DotType="Dot",M._materialCache.addMaterial(M.DotType,{fabric:{type:M.DotType,uniforms:{lightColor:new i(1,1,0,.75),darkColor:new i(0,1,1,.75),repeat:new e(5,5)},source:y},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<0}}),M.WaterType="Water",M._materialCache.addMaterial(M.WaterType,{fabric:{type:M.WaterType,uniforms:{baseWaterColor:new i(.2,.3,.6,1),blendColor:new i(0,1,.699,1),specularMap:M.DefaultImageId,normalMap:M.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:P},translucent:function(e){var t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<0}}),M.RimLightingType="RimLighting",M._materialCache.addMaterial(M.RimLightingType,{fabric:{type:M.RimLightingType,uniforms:{color:new i(1,0,0,.7),rimColor:new i(1,1,1,.4),width:.3},source:b},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<0}}),M.FadeType="Fade",M._materialCache.addMaterial(M.FadeType,{fabric:{type:M.FadeType,uniforms:{fadeInColor:new i(1,0,0,1),fadeOutColor:new i(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new e(.5,.5)},source:C},translucent:function(e){var t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<0}}),M.PolylineArrowType="PolylineArrow",M._materialCache.addMaterial(M.PolylineArrowType,{fabric:{type:M.PolylineArrowType,uniforms:{color:new i(1,1,1,1)},source:w},translucent:!0}),M.PolylineGlowType="PolylineGlow",M._materialCache.addMaterial(M.PolylineGlowType,{fabric:{type:M.PolylineGlowType,uniforms:{color:new i(0,.5,1,1),glowPower:.25},source:T},translucent:!0}),M.PolylineOutlineType="PolylineOutline",M._materialCache.addMaterial(M.PolylineOutlineType,{fabric:{type:M.PolylineOutlineType,uniforms:{color:new i(1,1,1,1),outlineColor:new i(1,0,0,1),outlineWidth:1},source:x},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}}),M}),i("Scene/MaterialAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/freezeObject","../Core/VertexFormat","../Shaders/Appearances/AllMaterialAppearanceFS","../Shaders/Appearances/AllMaterialAppearanceVS","../Shaders/Appearances/BasicMaterialAppearanceFS","../Shaders/Appearances/BasicMaterialAppearanceVS","../Shaders/Appearances/TexturedMaterialAppearanceFS","../Shaders/Appearances/TexturedMaterialAppearanceVS","./Appearance","./Material"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function m(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.translucent,!0),n=e(i.closed,!1),o=e(i.materialSupport,m.MaterialSupport.TEXTURED);this.material=t(i.material)?i.material:d.fromType(d.ColorType),this.translucent=r,this._vertexShaderSource=e(i.vertexShaderSource,o.vertexShaderSource),this._fragmentShaderSource=e(i.fragmentShaderSource,o.fragmentShaderSource),this._renderState=h.getDefaultRenderState(r,n,i.renderState),this._closed=n,this._materialSupport=o,this._vertexFormat=o.vertexFormat,this._flat=e(i.flat,!1),this._faceForward=e(i.faceForward,!n)}return i(m.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}}),m.prototype.getFragmentShaderSource=h.prototype.getFragmentShaderSource,m.prototype.isTranslucent=h.prototype.isTranslucent,m.prototype.getRenderState=h.prototype.getRenderState,m.MaterialSupport={BASIC:r({vertexFormat:n.POSITION_AND_NORMAL,vertexShaderSource:l,fragmentShaderSource:s}),TEXTURED:r({vertexFormat:n.POSITION_NORMAL_AND_ST,vertexShaderSource:c,fragmentShaderSource:u}),ALL:r({vertexFormat:n.ALL,vertexShaderSource:a,fragmentShaderSource:o})},m}),i("Shaders/Appearances/PerInstanceColorAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getDefaultMaterial(materialInput);\nmaterial.diffuse = v_color.rgb;\nmaterial.alpha = v_color.a;\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n}\n"}),i("Shaders/Appearances/PerInstanceColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec4 color;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Shaders/Appearances/PerInstanceFlatColorAppearanceFS",[],function(){"use strict";return"varying vec4 v_color;\nvoid main()\n{\ngl_FragColor = v_color;\n}\n"}),i("Shaders/Appearances/PerInstanceFlatColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec4 color;\nvarying vec4 v_color;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Scene/PerInstanceColorAppearance",["../Core/defaultValue","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PerInstanceColorAppearanceFS","../Shaders/Appearances/PerInstanceColorAppearanceVS","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS","../Shaders/Appearances/PerInstanceFlatColorAppearanceVS","./Appearance"],function(e,t,i,r,n,o,a,s){"use strict";function l(t){t=e(t,e.EMPTY_OBJECT);var i=e(t.translucent,!0),u=e(t.closed,!1),c=e(t.flat,!1),h=c?a:n,d=c?o:r,m=c?l.FLAT_VERTEX_FORMAT:l.VERTEX_FORMAT;this.material=void 0,this.translucent=i,this._vertexShaderSource=e(t.vertexShaderSource,h),this._fragmentShaderSource=e(t.fragmentShaderSource,d),this._renderState=s.getDefaultRenderState(i,u,t.renderState),this._closed=u,this._vertexFormat=m,this._flat=c,this._faceForward=e(t.faceForward,!u)}return t(l.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}}),l.VERTEX_FORMAT=i.POSITION_AND_NORMAL,l.FLAT_VERTEX_FORMAT=i.POSITION_ONLY,l.prototype.getFragmentShaderSource=s.prototype.getFragmentShaderSource,l.prototype.isTranslucent=s.prototype.isTranslucent,l.prototype.getRenderState=s.prototype.getRenderState,l}),i("Scene/PrimitivePipeline",["../Core/BoundingSphere","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Matrix4","../Core/WebMercatorProjection"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f){"use strict";function v(e,t,i){var r,n=!i,o=e.length;if(!n&&o>1){var a=e[0].modelMatrix;for(r=1;o>r;++r)if(!p.equals(a,e[r].modelMatrix)){n=!0;break}}if(n)for(r=0;o>r;++r)d.transformToWorldCoordinates(e[r]);else p.multiplyTransformation(t,e[0].modelMatrix,t); +}function g(e,r){var n=e.attributes,o=n.position,a=4*(o.values.length/o.componentsPerAttribute);n.pickColor=new c({componentDatatype:i.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0,values:new Uint8Array(a)});for(var s=t.floatToByte(r.red),l=t.floatToByte(r.green),u=t.floatToByte(r.blue),h=t.floatToByte(r.alpha),d=n.pickColor.values,m=0;a>m;m+=4)d[m]=s,d[m+1]=l,d[m+2]=u,d[m+3]=h}function _(e,t){for(var i=e.length,r=0;i>r;++r){var o=e[r],a=t[r];n(o.geometry)?g(o.geometry,a):(g(o.westHemisphereGeometry,a),g(o.eastHemisphereGeometry,a))}}function y(e){var t,i=e.length,r=[],o=e[0].attributes;for(t in o)if(o.hasOwnProperty(t)){for(var a=o[t],s=!0,l=1;i>l;++l){var u=e[l].attributes[t];if(!n(u)||a.componentDatatype!==u.componentDatatype||a.componentsPerAttribute!==u.componentsPerAttribute||a.normalize!==u.normalize){s=!1;break}}s&&r.push(t)}return r}function C(e,t,r){for(var n=u.computeNumberOfVertices(t),o=r.length,a=0;o>a;++a){for(var s=r[a],l=e[s],h=l.componentDatatype,d=l.value,m=d.length,p=i.createTypedArray(h,n*m),f=0;n>f;++f)p.set(d,f*m);t.attributes[s]=new c({componentDatatype:h,componentsPerAttribute:m,normalize:l.normalize,values:p})}}function E(e,t){for(var i=e.length,r=0;i>r;++r){var o=e[r],a=o.attributes;n(o.geometry)?C(a,o.geometry,t):(C(a,o.westHemisphereGeometry,t),C(a,o.eastHemisphereGeometry,t))}}function S(t){var r,o,a=t.instances,s=t.pickIds,l=t.projection,u=t.elementIndexUintSupported,c=t.scene3DOnly,h=t.allowPicking,m=t.vertexCacheOptimize,p=t.compressVertices,f=t.modelMatrix,g=a.length;a[0].geometry.primitiveType;if(v(a,f,c),!c)for(r=0;g>r;++r)d.splitLongitude(a[r]);h&&_(a,s);var C=y(a);if(E(a,C),m)for(r=0;g>r;++r){var S=a[r];n(S.geometry)?(d.reorderForPostVertexCache(S.geometry),d.reorderForPreVertexCache(S.geometry)):(d.reorderForPostVertexCache(S.westHemisphereGeometry),d.reorderForPreVertexCache(S.westHemisphereGeometry),d.reorderForPostVertexCache(S.eastHemisphereGeometry),d.reorderForPreVertexCache(S.eastHemisphereGeometry))}var w=d.combineInstances(a);for(g=w.length,r=0;g>r;++r){o=w[r];var T,x=o.attributes;if(c)for(T in x)x.hasOwnProperty(T)&&x[T].componentDatatype===i.DOUBLE&&d.encodeAttribute(o,T,T+"3DHigh",T+"3DLow");else for(T in x)if(x.hasOwnProperty(T)&&x[T].componentDatatype===i.DOUBLE){var b=T+"3D",A=T+"2D";d.projectTo2D(o,T,b,A,l),n(o.boundingSphere)&&"position"===T&&(o.boundingSphereCV=e.fromVertices(o.attributes.position2D.values)),d.encodeAttribute(o,b,b+"High",b+"Low"),d.encodeAttribute(o,A,A+"High",A+"Low")}p&&d.compressVertices(o)}if(!u){var P=[];for(g=w.length,r=0;g>r;++r)o=w[r],P=P.concat(d.fitToUnsignedShortIndices(o));w=P}return w}function w(e,t,r){for(var n=[],o=e.attributes,a=r.length,s=0;a>s;++s){var l=r[s],u=o[l],c=u.componentDatatype;c===i.DOUBLE&&(c=i.FLOAT);var h=i.createTypedArray(c,u.values);n.push({index:t[l],componentDatatype:c,componentsPerAttribute:u.componentsPerAttribute,normalize:u.normalize,values:h}),delete o[l]}return n}function T(e,t,i,o,a,s,l,c,h){var d=u.computeNumberOfVertices(t);n(l[e])||(l[e]={boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV});for(var m=o.length,p=0;m>p;++p)for(var f=o[p],v=a[f],g=d;g>0;){for(var _,y=r(h[f],0),C=s[y],E=C.length,S=0;E>S&&(_=C[S],_.index!==v);++S);n(l[e][f])||(l[e][f]={dirty:!1,valid:!0,value:i[f].value,indices:[]});var w,T=_.values.length/_.componentsPerAttribute,x=r(c[f],0);T>x+g?(w=g,l[e][f].indices.push({attribute:_,offset:x,count:w}),c[f]=x+g):(w=T-x,l[e][f].indices.push({attribute:_,offset:x,count:w}),c[f]=0,h[f]=y+1),g-=w}}function x(e,t,i,r,o){var a,s,l,u=[],c=e.length,h={},d={};for(a=0;c>a;++a)s=e[a],l=s.attributes,n(s.geometry)&&T(a,s.geometry,l,o,r,i,u,h,d);for(a=0;c>a;++a)s=e[a],l=s.attributes,n(s.westHemisphereGeometry)&&T(a,s.westHemisphereGeometry,l,o,r,i,u,h,d);for(a=0;c>a;++a)s=e[a],l=s.attributes,n(s.eastHemisphereGeometry)&&T(a,s.eastHemisphereGeometry,l,o,r,i,u,h,d);for(c=t.length,a=0;c>a;++a){s=t[a],l=s.attributes;var m={};u.push(m);for(var p=o.length,f=0;p>f;++f){var v=o[f];m[v]={dirty:!1,valid:!1,value:l[v].value,indices:[]}}}return u}function b(e,t,i,r){var o,a,s,l=r.length-1;if(l>=0){var u=r[l];o=u.offset+u.count,s=u.index,a=i[s].indices.length}else o=0,s=0,a=i[s].indices.length;for(var c=e.length,h=0;c>h;++h){var d=e[h],m=d[t];if(n(m)){var p=m.indices.length;o+p>a&&(o=0,a=i[++s].indices.length),r.push({index:s,offset:o,count:p}),o+=p}}}function A(e,t){var i=[];return b(e,"geometry",t,i),b(e,"westHemisphereGeometry",t,i),b(e,"eastHemisphereGeometry",t,i),i}function P(e,t){var i=e.attributes;for(var r in i)if(i.hasOwnProperty(r)){var o=i[r];n(o)&&n(o.values)&&t.push(o.values.buffer)}n(e.indices)&&t.push(e.indices.buffer)}function I(e,t){for(var i=e.length,r=0;i>r;++r)P(e[r],t)}function M(e,t){for(var i=e.length,r=0;i>r;++r)for(var n=e[r],o=n.length,a=0;o>a;++a)t.push(n[a].values.buffer)}function D(t){for(var i=1,r=t.length,o=0;r>o;o++){var a=t[o];if(++i,n(a)){var s=a.attributes;i+=6+2*e.packedLength+(n(a.indices)?a.indices.length:0);for(var l in s)if(s.hasOwnProperty(l)&&n(s[l])){var u=s[l];i+=5+u.values.length}}}return i}function R(e,t){for(var i=e.length,r=new Uint32Array(e.length),n=0;i>n;++n)r[n]=e[n].toRgba();return t.push(r.buffer),r}function O(e){for(var i=e.length,r=new Array(i),n=0;i>n;n++)r[n]=t.fromRgba(e[n]);return r}function N(e){for(var t=e.length,i=1+17*t,r=0;t>r;r++){var o=e[r].attributes;for(var a in o)if(o.hasOwnProperty(a)&&n(o[a])){var s=o[a];i+=5+s.value.length}}return i}function L(e,t){var i=new Float64Array(N(e)),r={},o=[],a=e.length,s=0;i[s++]=a;for(var l=0;a>l;l++){var u=e[l];p.pack(u.modelMatrix,i,s),s+=p.packedLength;var c=u.attributes,h=[];for(var d in c)c.hasOwnProperty(d)&&n(c[d])&&(h.push(d),n(r[d])||(r[d]=o.length,o.push(d)));i[s++]=h.length;for(var m=0;m<h.length;m++){var f=h[m],v=c[f];i[s++]=r[f],i[s++]=v.componentDatatype,i[s++]=v.componentsPerAttribute,i[s++]=v.normalize,i[s++]=v.value.length,i.set(v.value,s),s+=v.value.length}}return t.push(i.buffer),{stringTable:o,packedData:i}}function F(e){for(var t=e.packedData,r=e.stringTable,n=new Array(t[0]),o=0,a=1;a<t.length;){var s=p.unpack(t,a);a+=p.packedLength;for(var l={},u=t[a++],c=0;u>c;c++){for(var h=r[t[a++]],d=t[a++],m=t[a++],f=0!==t[a++],v=t[a++],g=i.createTypedArray(d,v),_=0;v>_;_++)g[_]=t[a++];l[h]={componentDatatype:d,componentsPerAttribute:m,normalize:f,value:g}}n[o++]={attributes:l,modelMatrix:s}}return n}function B(t){for(var i=t.length,r=1+i,o=0;i>o;o++){var a=t[o];r+=2,r+=n(a.boundingSphere)?e.packedLength:0,r+=n(a.boundingSphereCV)?e.packedLength:0;for(var s in a)if(a.hasOwnProperty(s)&&n(a[s])&&"boundingSphere"!==s&&"boundingSphereCV"!==s){var l=a[s];r+=4+3*l.indices.length+l.value.length}}return r}function V(t,i){var r=new Float64Array(B(t)),o=[],a=[],s={},l=t.length,u=0;r[u++]=l;for(var c=0;l>c;c++){var h=t[c],d=h.boundingSphere,m=n(d);r[u++]=m?1:0,m&&(e.pack(d,r,u),u+=e.packedLength),d=h.boundingSphereCV,m=n(d),r[u++]=m?1:0,m&&(e.pack(d,r,u),u+=e.packedLength);var p=[];for(var f in h)h.hasOwnProperty(f)&&n(h[f])&&"boundingSphere"!==f&&"boundingSphereCV"!==f&&(p.push(f),n(s[f])||(s[f]=o.length,o.push(f)));r[u++]=p.length;for(var v=0;v<p.length;v++){var g=p[v],_=h[g];r[u++]=s[g],r[u++]=_.valid?1:0;var y=_.indices,C=y.length;r[u++]=C;for(var E=0;C>E;E++){var S=y[E];r[u++]=S.count,r[u++]=S.offset;var w=a.indexOf(S.attribute);-1===w&&(w=a.length,a.push(S.attribute)),r[u++]=w}r[u++]=_.value.length,r.set(_.value,u),u+=_.value.length}}return i.push(r.buffer),{stringTable:o,packedData:r,attributeTable:a}}function k(t,r){for(var n=t.stringTable,o=t.attributeTable,a=t.packedData,s=new Array(a[0]),l=0,u=1,c=a.length;c>u;){var h={},d=1===a[u++];d&&(h.boundingSphere=e.unpack(a,u),u+=e.packedLength),d=1===a[u++],d&&(h.boundingSphereCV=e.unpack(a,u),u+=e.packedLength);for(var m=a[u++],p=0;m>p;p++){for(var f=n[a[u++]],v=1===a[u++],g=a[u++],_=g>0?new Array(g):void 0,y=0;g>y;y++){var C={};C.count=a[u++],C.offset=a[u++],C.attribute=o[a[u++]],_[y]=C}for(var E=a[u++],S=v?i.createTypedArray(_[0].attribute.componentDatatype,E):new Array(E),w=0;E>w;w++)S[w]=a[u++];h[f]={dirty:!1,valid:v,indices:_,value:S}}s[l++]=h}return s}if(!s.supportsTypedArrays())return{};var z={};return z.combineGeometry=function(e){var t,i,r,o,a,s=e.instances,l=e.invalidInstances;if(s.length>0){t=S(e),i=d.createAttributeLocations(t[0]),o=y(s),r=[],a=t.length;for(var u=0;a>u;++u){var c=t[u];r.push(w(c,i,o))}}o=n(o)?o:y(l);var h,m=x(s,l,r,i,o);return e.createPickOffsets&&n(t)&&(h=A(s,t)),{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:i,vaAttributes:r,vaAttributeLocations:m,validInstancesIndices:e.validInstancesIndices,invalidInstancesIndices:e.invalidInstancesIndices,pickOffsets:h}},z.packCreateGeometryResults=function(t,i){var r=new Float64Array(D(t)),o=[],a={},s=t.length,l=0;r[l++]=s;for(var u=0;s>u;u++){var c=t[u],h=n(c);if(r[l++]=h?1:0,h){r[l++]=c.primitiveType,r[l++]=c.geometryType;var d=n(c.boundingSphere)?1:0;r[l++]=d,d&&e.pack(c.boundingSphere,r,l),l+=e.packedLength;var m=n(c.boundingSphereCV)?1:0;r[l++]=m,m&&e.pack(c.boundingSphereCV,r,l),l+=e.packedLength;var p=c.attributes,f=[];for(var v in p)p.hasOwnProperty(v)&&n(p[v])&&(f.push(v),n(a[v])||(a[v]=o.length,o.push(v)));r[l++]=f.length;for(var g=0;g<f.length;g++){var _=f[g],y=p[_];r[l++]=a[_],r[l++]=y.componentDatatype,r[l++]=y.componentsPerAttribute,r[l++]=y.normalize?1:0,r[l++]=y.values.length,r.set(y.values,l),l+=y.values.length}var C=n(c.indices)?c.indices.length:0;r[l++]=C,C>0&&(r.set(c.indices,l),l+=C)}}return i.push(r.buffer),{stringTable:o,packedData:r}},z.unpackCreateGeometryResults=function(t){for(var r,n=t.stringTable,o=t.packedData,a=new Array(o[0]),s=0,l=1;l<o.length;){var d=1===o[l++];if(d){var p,f,v=o[l++],g=o[l++],_=1===o[l++];_&&(p=e.unpack(o,l)),l+=e.packedLength;var y=1===o[l++];y&&(f=e.unpack(o,l)),l+=e.packedLength;var C,E,S,w=new h,T=o[l++];for(r=0;T>r;r++){var x=n[o[l++]],b=o[l++];S=o[l++];var A=0!==o[l++];C=o[l++],E=i.createTypedArray(b,C);for(var P=0;C>P;P++)E[P]=o[l++];w[x]=new c({componentDatatype:b,componentsPerAttribute:S,normalize:A,values:E})}var I;if(C=o[l++],C>0){var M=E.length/S;for(I=m.createTypedArray(M,C),r=0;C>r;r++)I[r]=o[l++]}a[s++]=new u({primitiveType:v,geometryType:g,boundingSphere:p,indices:I,attributes:w})}else a[s++]=void 0}return a},z.packCombineGeometryParameters=function(e,t){for(var i=e.createGeometryResults,r=i.length,n=0;r>n;n++)t.push(i[n].packedData.buffer);var o;return e.allowPicking&&(o=R(e.pickIds,t)),{createGeometryResults:e.createGeometryResults,packedInstances:L(e.instances,t),packedPickIds:o,ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof l,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,allowPicking:e.allowPicking,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},z.unpackCombineGeometryParameters=function(e){for(var t=F(e.packedInstances),i=e.allowPicking,r=i?O(e.packedPickIds):void 0,o=e.createGeometryResults,s=o.length,u=0,c=[],h=[],d=[],m=[],v=[],g=0;s>g;g++)for(var _=z.unpackCreateGeometryResults(o[g]),y=_.length,C=0;y>C;C++){var E=_[C],S=t[u];n(E)?(S.geometry=E,c.push(S),d.push(u),i&&v.push(r[u])):(h.push(S),m.push(u)),++u}var w=a.clone(e.ellipsoid),T=e.isGeographic?new l(w):new f(w);return{instances:c,invalidInstances:h,validInstancesIndices:d,invalidInstancesIndices:m,pickIds:v,ellipsoid:w,projection:T,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,allowPicking:e.allowPicking,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:p.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},z.packCombineGeometryResults=function(e,t){return n(e.geometries)&&(I(e.geometries,t),M(e.vaAttributes,t)),{geometries:e.geometries,attributeLocations:e.attributeLocations,vaAttributes:e.vaAttributes,packedVaAttributeLocations:V(e.vaAttributeLocations,t),modelMatrix:e.modelMatrix,validInstancesIndices:e.validInstancesIndices,invalidInstancesIndices:e.invalidInstancesIndices,pickOffsets:e.pickOffsets}},z.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,vaAttributes:e.vaAttributes,perInstanceAttributeLocations:k(e.packedVaAttributeLocations,e.vaAttributes),modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets}},z}),i("Scene/PrimitiveState",["../Core/freezeObject"],function(e){"use strict";var t={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6};return e(t)}),i("Scene/Primitive",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/clone","../Core/combine","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryInstance","../Core/GeometryInstanceAttribute","../Core/isArray","../Core/Matrix4","../Core/subdivideArray","../Core/TaskProcessor","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../ThirdParty/when","./CullFace","./Pass","./PrimitivePipeline","./PrimitiveState","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O){"use strict";function N(e){e=a(e,a.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.modelMatrix=_.clone(a(e.modelMatrix,_.IDENTITY)),this._modelMatrix=new _,this.show=a(e.show,!0),this._vertexCacheOptimize=a(e.vertexCacheOptimize,!1),this._interleave=a(e.interleave,!1),this._releaseGeometryInstances=a(e.releaseGeometryInstances,!0),this._allowPicking=a(e.allowPicking,!0),this._asynchronous=a(e.asynchronous,!0),this._compressVertices=a(e.compressVertices,!0),this.cull=a(e.cull,!0),this.debugShowBoundingVolume=a(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,this._modifiedModelView=new _,this._translucent=void 0,this._state=R.READY,this._geometries=[],this._vaAttributes=void 0,this._error=void 0,this._numberOfInstances=0,this._validModelMatrix=!1,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeLocations=void 0,this._perInstanceAttributeCache=[],this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._dirtyAttributes=[],this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._pickRS=void 0,this._pickSP=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._readOnlyInstanceAttributes=e._readOnlyInstanceAttributes,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1,this._readyPromise=P.defer()}function L(e){return new m({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:new e.values.constructor(e.values)})}function F(t){var i=t.attributes,r=new p;for(var n in i)i.hasOwnProperty(n)&&s(i[n])&&(r[n]=L(i[n]));var o;if(s(t.indices)){var a=t.indices;o=new a.constructor(a)}return new d({attributes:r,indices:o,primitiveType:t.primitiveType,boundingSphere:e.clone(t.boundingSphere)})}function B(e){return new v({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,value:new e.value.constructor(e.value)})}function V(e,t){var i=e.attributes,r={};for(var n in i)i.hasOwnProperty(n)&&(r[n]=B(i[n]));return new f({geometry:t,modelMatrix:_.clone(e.modelMatrix),attributes:r,pickPrimitive:e.pickPrimitive,id:e.id})}function k(e,t){if(!e.compressVertices)return t;var i=-1!==t.search(/attribute\s+vec3\s+normal;/g),r=-1!==t.search(/attribute\s+vec2\s+st;/g);if(!i&&!r)return t;var n=-1!==t.search(/attribute\s+vec3\s+tangent;/g),o=-1!==t.search(/attribute\s+vec3\s+binormal;/g),a=r&&i?2:1;a+=n||o?1:0;var s=a>1?"vec"+a:"float",l="compressedAttributes",u="attribute "+s+" "+l+";",c="",h="";if(r){c+="vec2 st;\n";var d=a>1?l+".x":l;h+=" st = czm_decompressTextureCoordinates("+d+");\n"}i&&n&&o?(c+="vec3 normal;\nvec3 tangent;\nvec3 binormal;\n",h+=" czm_octDecode("+l+"."+(r?"yz":"xy")+", normal, tangent, binormal);\n"):(i&&(c+="vec3 normal;\n",h+=" normal = czm_octDecode("+l+(a>1?"."+(r?"y":"x"):"")+");\n"),n&&(c+="vec3 tangent;\n",h+=" tangent = czm_octDecode("+l+"."+(r&&i?"z":"y")+");\n"),o&&(c+="vec3 binormal;\n",h+=" binormal = czm_octDecode("+l+"."+(r&&i?"z":"y")+");\n"));var m=t;m=m.replace(/attribute\s+vec3\s+normal;/g,""),m=m.replace(/attribute\s+vec2\s+st;/g,""),m=m.replace(/attribute\s+vec3\s+tangent;/g,""),m=m.replace(/attribute\s+vec3\s+binormal;/g,""),m=b.replaceMain(m,"czm_non_compressed_main");var p="void main() \n{ \n"+h+" czm_non_compressed_main(); \n}";return[u,c,m,p].join("\n")}function z(e,t){e.vertexAttributes}function U(e,t,i){for(var r=[],n=i.length,o=0;n>o;++o){var l={primitive:a(i[o].pickPrimitive,t)};s(i[o].id)&&(l.id=i[o].id);var u=e.createPickId(l);t._pickIds.push(u),r.push(u.color)}return r}function G(e,t){return function(){return e[t]}}function W(e,t){var i,r,n,o,l=e._instanceIds;if(e._state===R.READY){i=g(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];var u=e._numberOfInstances=i.length,c=[],h=[];for(n=0;u>n;++n)r=i[n].geometry,l.push(i[n].id),h.push({moduleName:r._workerName,geometry:r});if(!s(ie))for(ie=new Array(re),n=0;re>n;n++)ie[n]=new C("createGeometry",Number.POSITIVE_INFINITY);var d;for(h=y(h,re),n=0;n<h.length;n++){var m=0,p=h[n],f=p.length;for(o=0;f>o;++o)d=p[o],r=d.geometry,s(r.constructor.pack)&&(d.offset=m,m+=a(r.constructor.packedLength,r.packedLength));var v;if(m>0){var E=new Float64Array(m);for(v=[E.buffer],o=0;f>o;++o)d=p[o],r=d.geometry,s(r.constructor.pack)&&(r.constructor.pack(r,E,d.offset),d.geometry=E)}c.push(ie[n].scheduleTask({subTasks:h[n]},v))}e._state=R.CREATING,P.all(c,function(t){e._createGeometryResults=t,e._state=R.CREATED}).otherwise(function(i){ee(e,t,R.FAILED,i)})}else if(e._state===R.CREATED){var S=[];i=g(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];var w=e.allowPicking,T=t.scene3DOnly,x=t.mapProjection,b=ne.scheduleTask(D.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:i,pickIds:w?U(t.context,e,i):void 0,ellipsoid:x.ellipsoid,projection:x,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:T,allowPicking:w,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},S),S);e._createGeometryResults=void 0,e._state=R.COMBINING,P(b,function(i){var r=D.unpackCombineGeometryResults(i);e._geometries=r.geometries,e._attributeLocations=r.attributeLocations,e._vaAttributes=r.vaAttributes,e._perInstanceAttributeLocations=r.perInstanceAttributeLocations,e.modelMatrix=_.clone(r.modelMatrix,e.modelMatrix),e._validModelMatrix=!_.equals(e.modelMatrix,_.IDENTITY),e._pickOffsets=r.pickOffsets;for(var n=i.validInstancesIndices,o=i.invalidInstancesIndices,a=e._instanceIds,l=new Array(a.length),u=n.length,c=0;u>c;++c)l[c]=a[n[c]];for(var h=o.length,d=0;h>d;++d)l[u+d]=a[o[d]];e._instanceIds=l,s(e._geometries)?e._state=R.COMBINED:ee(e,t,R.FAILED,void 0)}).otherwise(function(i){ee(e,t,R.FAILED,i)})}}function H(e,t){var i,r,n=g(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],o=e._numberOfInstances=n.length,a=new Array(o),l=new Array(o),u=[],c=e._instanceIds,h=0;for(r=0;o>r;r++){i=n[r];var d,m=i.geometry;d=s(m.attributes)&&s(m.primitiveType)?F(m):m.constructor.createGeometry(m),s(d)?(a[h]=d,l[h++]=V(i,d),c.push(i.id)):u.push(i)}a.length=h,l.length=h;var p=e.allowPicking,f=t.scene3DOnly,v=t.mapProjection,y=D.combineGeometry({instances:l,invalidInstances:u,pickIds:p?U(t.context,e,l):void 0,ellipsoid:v.ellipsoid,projection:v,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:f,allowPicking:p,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});for(e._geometries=y.geometries,e._attributeLocations=y.attributeLocations,e._vaAttributes=y.vaAttributes,e._perInstanceAttributeLocations=y.vaAttributeLocations,e.modelMatrix=_.clone(y.modelMatrix,e.modelMatrix),e._validModelMatrix=!_.equals(e.modelMatrix,_.IDENTITY),e._pickOffsets=y.pickOffsets,r=0;r<u.length;++r)i=u[r],c.push(i.id);s(e._geometries)?e._state=R.COMBINED:ee(e,t,R.FAILED,void 0)}function q(t,i){for(var r=t._attributeLocations,n=t._geometries,o=t._vaAttributes,a=i.scene3DOnly,l=i.context,u=[],c=n.length,h=0;c>h;++h){for(var d=n[h],m=o[h],p=m.length,f=0;p>f;++f){var v=m[f];v.vertexBuffer=E.createVertexBuffer({context:l,typedArray:v.values,usage:S.DYNAMIC_DRAW}),delete v.values}if(u.push(A.fromGeometry({context:l,geometry:d,attributeLocations:r,bufferUsage:S.STATIC_DRAW,interleave:t._interleave,vertexArrayAttributes:m})),s(t._createBoundingVolumeFunction))t._createBoundingVolumeFunction(i,d);else if(t._boundingSpheres.push(e.clone(d.boundingSphere)),t._boundingSphereWC.push(new e),!a){var g=d.boundingSphereCV.center,_=g.x,y=g.y,C=g.z;g.x=C,g.y=_,g.z=y,t._boundingSphereCV.push(e.clone(d.boundingSphereCV)),t._boundingSphere2D.push(new e),t._boundingSphereMorph.push(new e)}}t._va=u,t._primitiveType=n[0].primitiveType,t.releaseGeometryInstances&&(t.geometryInstances=void 0),t._geometries=void 0,ee(t,i,R.COMPLETE,void 0)}function j(e,t,i,n){var o,a=i.getRenderState();n?(o=r(a,!1),o.cull={enabled:!0,face:I.BACK},e._frontFaceRS=T.fromCache(o),o.cull.face=I.FRONT,e._backFaceRS=T.fromCache(o)):(e._frontFaceRS=T.fromCache(a),e._backFaceRS=e._frontFaceRS),e.allowPicking?n?(o=r(a,!1),o.cull={enabled:!1},e._pickRS=T.fromCache(o)):e._pickRS=e._frontFaceRS:(o=r(a,!1),o.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n?(o.cull={enabled:!1},e._pickRS=T.fromCache(o)):e._pickRS=T.fromCache(o))}function Y(e,t,i){var r=t.context,n=N._modifyShaderPosition(e,i.vertexShaderSource,t.scene3DOnly);n=N._appendShowToShader(e,n),n=k(e,n);var o=i.getFragmentShaderSource(),a=e._attributeLocations;if(e._sp=x.replaceCache({context:r,shaderProgram:e._sp,vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:a}),z(e._sp,a),e.allowPicking){var s=new b({sources:[o],pickColorQualifier:"varying"});e._pickSP=x.replaceCache({context:r,shaderProgram:e._pickSP,vertexShaderSource:b.createPickVertexShaderSource(n),fragmentShaderSource:s,attributeLocations:a})}else e._pickSP=x.fromCache({context:r,vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:a});z(e._pickSP,a)}function X(e,t,i,r,o,a,l){var u=s(i)?i._uniforms:void 0,h={},d=t.uniforms;if(s(d))for(var m in d)if(d.hasOwnProperty(m)){if(s(u)&&s(u[m]))throw new c("Appearance and material have a uniform with the same name: "+m);h[m]=G(d,m)}var p=n(h,u);s(e.rtcCenter)&&(p.u_modifiedModelView=function(){return e._modifiedModelView});var f=r?M.TRANSLUCENT:M.OPAQUE;a.length=e._va.length*(o?2:1),l.length=e._va.length;for(var v=a.length,g=0,_=0,y=0;v>y;++y){var C;o&&(C=a[y],s(C)||(C=a[y]=new w({owner:e,primitiveType:e._primitiveType})),C.vertexArray=e._va[_],C.renderState=e._backFaceRS,C.shaderProgram=e._sp,C.uniformMap=p,C.pass=f,++y),C=a[y],s(C)||(C=a[y]=new w({owner:e,primitiveType:e._primitiveType})),C.vertexArray=e._va[_],C.renderState=e._frontFaceRS,C.shaderProgram=e._sp,C.uniformMap=p,C.pass=f;var E=l[g];s(E)||(E=l[g]=new w({owner:e,primitiveType:e._primitiveType})),E.vertexArray=e._va[_],E.renderState=e._pickRS,E.shaderProgram=e._pickSP,E.uniformMap=p,E.pass=f,++g,++_}}function Z(e){if(0!==e._dirtyAttributes.length){for(var t=e._dirtyAttributes,i=t.length,r=0;i>r;++r){for(var n=t[r],a=n.value,s=n.indices,l=s.length,u=0;l>u;++u){for(var c=s[u],h=c.offset,d=c.count,m=c.attribute,p=m.componentDatatype,f=m.componentsPerAttribute,v=o.createTypedArray(p,d*f),g=0;d>g;++g)v.set(a,g*f);var _=h*f*o.getSizeInBytes(p);m.vertexBuffer.copyFromArrayView(v,_)}n.dirty=!1}t.length=0}}function K(e,t){var i=e.appearance.pixelSize;if(s(i))for(var r=e._boundingSpheres.length,n=0;r>n;++n){var o=e._boundingSpheres[n],a=e._boundingSphereWC[n],l=t.camera.getPixelSize(o,t.context.drawingBufferWidth,t.context.drawingBufferHeight),u=l*i;a.radius=o.radius+u}}function Q(t,i,r,n,o,a,l,u){if(K(t,i),!_.equals(o,t._modelMatrix)){_.clone(o,t._modelMatrix);for(var c=t._boundingSpheres.length,h=0;c>h;++h){var d=t._boundingSpheres[h];s(d)&&(t._boundingSphereWC[h]=e.transform(d,o,t._boundingSphereWC[h]),i.scene3DOnly||(t._boundingSphere2D[h]=e.clone(t._boundingSphereCV[h],t._boundingSphere2D[h]),t._boundingSphere2D[h].center.x=0,t._boundingSphereMorph[h]=e.union(t._boundingSphereWC[h],t._boundingSphereCV[h])))}}if(s(t.rtcCenter)){var m=i.camera.viewMatrix;_.multiply(m,t._modelMatrix,t._modifiedModelView),_.multiplyByPoint(t._modifiedModelView,t.rtcCenter,oe),_.setTranslation(t._modifiedModelView,oe,t._modifiedModelView)}var p;i.mode===O.SCENE3D?p=t._boundingSphereWC:i.mode===O.COLUMBUS_VIEW?p=t._boundingSphereCV:i.mode===O.SCENE2D&&s(t._boundingSphere2D)?p=t._boundingSphere2D:s(t._boundingSphereMorph)&&(p=t._boundingSphereMorph);var f=i.commandList,v=i.passes;if(v.render)for(var g=r.length,y=0;g>y;++y){var C=u?Math.floor(y/2):y;r[y].modelMatrix=o,r[y].boundingVolume=p[C],r[y].cull=a,r[y].debugShowBoundingVolume=l,f.push(r[y])}if(v.pick)for(var E=n.length,S=0;E>S;++S)n[S].modelMatrix=o,n[S].boundingVolume=p[S],n[S].cull=a,f.push(n[S])}function J(e,t){var i=t[e];return function(){return s(i)&&s(i.value)?t[e].value:i}}function $(e,t,i){return function(r){var n=t[e];n.value=r,!n.dirty&&n.valid&&(i.push(n),n.dirty=!0)}}function ee(e,t,i,r){e._error=r,e._state=i,t.afterRender.push(function(){e._ready=e._state===R.COMPLETE||e._state===R.FAILED,s(r)?e._readyPromise.reject(r):e._readyPromise.resolve(e)})}l(N.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}}});var te=/attribute\s+vec(?:3|4)\s+(.*)3DHigh;/g;N._modifyShaderPosition=function(e,t,i){for(var r,n="",o="",a="";null!==(r=te.exec(t));){var l=r[1],u="vec4 czm_compute"+l[0].toUpperCase()+l.substr(1)+"()";"vec4 czm_computePosition()"!==u&&(n+=u+";\n"),s(e.rtcCenter)?(t=t.replace(/attribute\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/attribute\s+vec(?:3|4)\s+position3DLow;/g,""),n+="uniform mat4 u_modifiedModelView;\n",o+="attribute vec4 position;\n",a+=u+"\n{\n return u_modifiedModelView * position;\n}\n\n",t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):i?a+=u+"\n{\n return czm_translateRelativeToEye("+l+"3DHigh, "+l+"3DLow);\n}\n\n":(o+="attribute vec3 "+l+"2DHigh;\nattribute vec3 "+l+"2DLow;\n",a+=u+"\n{\n vec4 p;\n if (czm_morphTime == 1.0)\n {\n p = czm_translateRelativeToEye("+l+"3DHigh, "+l+"3DLow);\n }\n else if (czm_morphTime == 0.0)\n {\n p = czm_translateRelativeToEye("+l+"2DHigh.zxy, "+l+"2DLow.zxy);\n }\n else\n {\n p = czm_columbusViewMorph(\n czm_translateRelativeToEye("+l+"2DHigh.zxy, "+l+"2DLow.zxy),\n czm_translateRelativeToEye("+l+"3DHigh, "+l+"3DLow),\n czm_morphTime);\n }\n return p;\n}\n\n")}return[n,o,t,a].join("\n")},N._appendShowToShader=function(e,t){if(!s(e._attributeLocations.show))return t;var i=b.replaceMain(t,"czm_non_show_main"),r="attribute float show;\nvoid main() \n{ \n czm_non_show_main(); \n gl_Position *= show; \n}";return i+"\n"+r};var ie,re=Math.max(h.hardwareConcurrency-1,1),ne=new C("combineGeometry",Number.POSITIVE_INFINITY),oe=new i;N.prototype.update=function(e){if(!(!s(this.geometryInstances)&&0===this._va.length||s(this.geometryInstances)&&g(this.geometryInstances)&&0===this.geometryInstances.length||!s(this.appearance)||e.mode!==O.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)){if(s(this._error))throw this._error;if(s(this.rtcCenter)&&!e.scene3DOnly)throw new c("RTC rendering is only available for 3D only scenes.");if(this._state!==R.FAILED&&(this._state!==R.COMPLETE&&this._state!==R.COMBINED&&(this.asynchronous?W(this,e):H(this,e)),this._state===R.COMBINED&&q(this,e),this.show&&this._state===R.COMPLETE)){var t=this.appearance,i=t.material,r=!1,n=!1;this._appearance!==t?(this._appearance=t,this._material=i,r=!0,n=!0):this._material!==i&&(this._material=i,n=!0);var o=this._appearance.isTranslucent();this._translucent!==o&&(this._translucent=o,r=!0);var l=e.context;s(this._material)&&this._material.update(l);var u=t.closed&&o;if(r){var h=a(this._createRenderStatesFunction,j);h(this,l,t,u)}if(n){var d=a(this._createShaderProgramFunction,Y);d(this,e,t)}if(r||n){var m=a(this._createCommandsFunction,X);m(this,t,i,o,u,this._colorCommands,this._pickCommands)}Z(this);var p=a(this._updateAndQueueCommandsFunction,Q);p(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)}}};var ae=["boundingSphere","boundingSphereCV"];return N.prototype.getGeometryInstanceAttributes=function(e){for(var t=-1,i=this._lastPerInstanceAttributeIndex,r=this._instanceIds,n=r.length,o=0;n>o;++o){var a=(i+o)%n;if(e===r[a]){t=a;break}}if(-1!==t){var u=this._perInstanceAttributeCache[t];if(s(u))return u;var c=this._perInstanceAttributeLocations[t];u={};var h={},d=!1;for(var m in c)if(c.hasOwnProperty(m)){d=!0,h[m]={get:J(m,c)};var p=!0,f=ae;n=f.length;for(var v=0;n>v;++v)if(m===ae[v]){p=!1;break}if(f=this._readOnlyInstanceAttributes,p&&s(f)){n=f.length;for(var g=0;n>g;++g)if(m===f[g]){p=!1;break}}p&&(h[m].set=$(m,c,this._dirtyAttributes))}return d&&l(u,h),this._lastPerInstanceAttributeIndex=t,this._perInstanceAttributeCache[t]=u,u}},N.prototype.isDestroyed=function(){return!1},N.prototype.destroy=function(){var e,t;this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy();var i=this._va;for(e=i.length,t=0;e>t;++t)i[t].destroy();this._va=void 0;var r=this._pickIds;for(e=r.length,t=0;e>t;++t)r[t].destroy();return this._pickIds=void 0,this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._perInstanceAttributeLocations=void 0,this._attributeLocations=void 0,this._dirtyAttributes=void 0,u(this)},N}),i("DataSources/ColorMaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./ConstantProperty","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this.color=e}return i(l.prototype,{isConstant:{get:function(){return s.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:a("color")}),l.prototype.getType=function(e){return"Color"},l.prototype.getValue=function(i,r){return t(r)||(r={}),r.color=s.getValueOrClonedDefault(this._color,i,e.WHITE,r.color),r},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._color,e._color)},l}),i("DataSources/dynamicGeometryGetBoundingSphere",["../Core/BoundingSphere","../Core/defined","../Core/DeveloperError","./BoundingSphereState"],function(e,t,i,r){ +"use strict";function n(i,n,o,a){var s;return t(n)&&n.show&&n.ready&&(s=n.getGeometryInstanceAttributes(i),t(s)&&t(s.boundingSphere))?(e.transform(s.boundingSphere,n.modelMatrix,a),r.DONE):t(o)&&o.show&&o.ready&&(s=o.getGeometryInstanceAttributes(i),t(s)&&t(s.boundingSphere))?(e.transform(s.boundingSphere,o.modelMatrix,a),r.DONE):t(n)&&!n.ready||t(o)&&!o.ready?r.PENDING:r.FAILED}return n}),i("DataSources/MaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Scene/Material"],function(e,t,i,r,n){"use strict";function o(){r.throwInstantiationError()}return i(o.prototype,{isConstant:{get:r.throwInstantiationError},definitionChanged:{get:r.throwInstantiationError}}),o.prototype.getType=r.throwInstantiationError,o.prototype.getValue=r.throwInstantiationError,o.prototype.equals=r.throwInstantiationError,o.getValue=function(i,r,o){var a;return t(r)&&(a=r.getType(i),t(a))?(t(o)&&o.type===a||(o=n.fromType(a)),r.getValue(i,o.uniforms),o):(t(o)&&o.type===n.ColorType||(o=n.fromType(n.ColorType)),e.clone(e.WHITE,o.uniforms.color),o)},o}),i("DataSources/BoxGeometryUpdater",["../Core/BoxGeometry","../Core/BoxOutlineGeometry","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C){"use strict";function E(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0}function S(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(S.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new E(e),this._onEntityPropertyChanged(e,"box",e.box,void 0)}function w(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new E(t._entity)}var T=new v(i.WHITE),x=new g(!0),b=new g(!0),A=new g(!1),P=new g(i.BLACK),I=new i;return a(S,{perInstanceColorAppearanceType:{value:p},materialAppearanceType:{value:m}}),a(S.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!o(this._entity.availability)&&C.isConstant(this._showProperty)&&C.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!o(this._entity.availability)&&C.isConstant(this._showProperty)&&C.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),S.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},S.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},S.prototype.createFillGeometryInstance=function(t){var n,a,s=this._entity,l=s.isAvailable(t),u=new d(l&&s.isShowing&&this._showProperty.getValue(t)&&this._fillProperty.getValue(t));if(this._materialProperty instanceof v){var m=i.WHITE;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(m=this._materialProperty.color.getValue(t)),a=r.fromColor(m),n={show:u,color:a}}else n={show:u};return new c({id:s,geometry:e.fromDimensions(this._options),modelMatrix:s._getModelMatrix(h.MINIMUM_VALUE),attributes:n})},S.prototype.createOutlineGeometryInstance=function(e){var n=this._entity,o=n.isAvailable(e),a=C.getValueOrDefault(this._outlineColorProperty,e,i.BLACK);return new c({id:n,geometry:t.fromDimensions(this._options),modelMatrix:n._getModelMatrix(h.MINIMUM_VALUE),attributes:{show:new d(o&&n.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:r.fromColor(a)}})},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){this._entitySubscription(),s(this)},S.prototype._onEntityPropertyChanged=function(e,t,i,r){if("availability"===t||"position"===t||"orientation"===t||"box"===t){var a=this._entity.box;if(!o(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=o(s)&&s.isConstant?s.getValue(h.MINIMUM_VALUE):!0,u=a.outline,c=o(u);if(c&&u.isConstant&&(c=u.getValue(h.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=a.dimensions,f=e.position,g=a.show;if(!o(d)||!o(f)||o(g)&&g.isConstant&&!g.getValue(h.MINIMUM_VALUE))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var _=n(a.material,T),y=_ instanceof v;this._materialProperty=_,this._fillProperty=n(s,b),this._showProperty=n(g,x),this._showOutlineProperty=n(a.outline,A),this._outlineColorProperty=c?n(a.outlineColor,P):void 0;var E=a.outlineWidth;if(this._fillEnabled=l,this._outlineEnabled=c,f.isConstant&&C.isConstant(e.orientation)&&d.isConstant&&C.isConstant(E)){var S=this._options;S.vertexFormat=y?p.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,S.dimensions=d.getValue(h.MINIMUM_VALUE,S.dimensions),this._outlineWidth=o(E)?E.getValue(h.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},S.prototype.createDynamicUpdater=function(e){return new w(e,this)},w.prototype.update=function(n){var a=this._primitives;a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var s=this._geometryUpdater,l=s._entity,u=l.box;if(l.isShowing&&l.isAvailable(n)&&C.getValueOrDefault(u.show,n,!0)){var h=this._options,d=l._getModelMatrix(n),v=C.getValueOrUndefined(u.dimensions,n,h.dimensions);if(o(d)&&o(v)){if(h.dimensions=v,C.getValueOrDefault(u.fill,n,!0)){var g=y.getValue(n,s.fillMaterialProperty,this._material);this._material=g;var _=new m({material:g,translucent:g.isTranslucent(),closed:!0});h.vertexFormat=_.vertexFormat,this._primitive=a.add(new f({geometryInstances:new c({id:l,geometry:e.fromDimensions(h),modelMatrix:d}),appearance:_,asynchronous:!1}))}if(C.getValueOrDefault(u.outline,n,!1)){h.vertexFormat=p.VERTEX_FORMAT;var E=C.getValueOrClonedDefault(u.outlineColor,n,i.BLACK,I),S=C.getValueOrDefault(u.outlineWidth,n,1),w=1!==E.alpha;this._outlinePrimitive=a.add(new f({geometryInstances:new c({id:l,geometry:t.fromDimensions(h),modelMatrix:d,attributes:{color:r.fromColor(E)}}),appearance:new p({flat:!0,translucent:w,renderState:{lineWidth:s._scene.clampLineWidth(S)}}),asynchronous:!1}))}}}},w.prototype.getBoundingSphere=function(e,t){return _(e,this._primitive,this._outlinePrimitive,t)},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),s(this)},S}),i("DataSources/ImageMaterialProperty",["../Core/Cartesian2","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._alpha=void 0,this._alphaSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.alpha=e.alpha}var l=new e(1,1),u=1;return r(s.prototype,{isConstant:{get:function(){return a.isConstant(this._image)&&a.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:o("image"),repeat:o("repeat"),alpha:o("alpha")}),s.prototype.getType=function(e){return"Image"},s.prototype.getValue=function(e,t){return i(t)||(t={}),t.image=a.getValueOrUndefined(this._image,e),t.repeat=a.getValueOrClonedDefault(this._repeat,e,l,t.repeat),t.alpha=a.getValueOrDefault(this._alpha,e,u),t},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._image,e._image)&&a.equals(this._alpha,e._alpha)&&a.equals(this._repeat,e._repeat)},s}),i("DataSources/createMaterialPropertyDescriptor",["../Core/Color","../Core/DeveloperError","./ColorMaterialProperty","./createPropertyDescriptor","./ImageMaterialProperty"],function(e,t,i,r,n){"use strict";function o(t){if(t instanceof e)return new i(t);if("string"==typeof t||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement){var r=new n;return r.image=t,r}}function a(e,t){return r(e,t,o)}return a}),i("DataSources/BoxGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._dimensions=void 0,this._dimensionsSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),dimensions:a("dimensions"),material:o("material"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth")}),s.prototype.clone=function(e){return t(e)?(e.dimensions=this.dimensions,e.show=this.show,e.material=this.material,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e):new s(this)},s.prototype.merge=function(t){this.dimensions=e(this.dimensions,t.dimensions),this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth)},s}),i("DataSources/CallbackProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event"],function(e,t,i,r){"use strict";function n(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new r,this.setCallback(e,t)}return t(n.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}}),n.prototype.getValue=function(e,t){return this._callback(e,t)},n.prototype.setCallback=function(e,t){var i=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,i&&this._definitionChanged.raiseEvent(this)},n.prototype.equals=function(e){return this===e||e instanceof n&&this._callback===e._callback&&this._isConstant===e._isConstant},n}),i("DataSources/CheckerboardMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=i(e,i.EMPTY_OBJECT),this._definitionChanged=new o,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}var u=t.WHITE,c=t.BLACK,h=new e(2,2);return n(l.prototype,{isConstant:{get:function(){return s.isConstant(this._evenColor)&&s.isConstant(this._oddColor)&&s.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:a("evenColor"),oddColor:a("oddColor"),repeat:a("repeat")}),l.prototype.getType=function(e){return"Checkerboard"},l.prototype.getValue=function(e,t){return r(t)||(t={}),t.lightColor=s.getValueOrClonedDefault(this._evenColor,e,u,t.lightColor),t.darkColor=s.getValueOrClonedDefault(this._oddColor,e,c,t.darkColor),t.repeat=s.getValueOrDefault(this._repeat,e,h),t},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._evenColor,e._evenColor)&&s.equals(this._oddColor,e._oddColor)&&s.equals(this._repeat,e._repeat)},l}),i("DataSources/PositionProperty",["../Core/Cartesian3","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix3","../Core/ReferenceFrame","../Core/Transforms"],function(e,t,i,r,n,o,a){"use strict";function s(){r.throwInstantiationError()}i(s.prototype,{isConstant:{get:r.throwInstantiationError},definitionChanged:{get:r.throwInstantiationError},referenceFrame:{get:r.throwInstantiationError}}),s.prototype.getValue=r.throwInstantiationError,s.prototype.getValueInReferenceFrame=r.throwInstantiationError,s.prototype.equals=r.throwInstantiationError;var l=new n;return s.convertToReferenceFrame=function(i,r,s,u,c){if(!t(r))return r;if(t(c)||(c=new e),s===u)return e.clone(r,c);var h=a.computeIcrfToFixedMatrix(i,l);return t(h)||(h=a.computeTemeToPseudoFixedMatrix(i,l)),s===o.INERTIAL?n.multiplyByVector(h,r,c):s===o.FIXED?n.multiplyByVector(n.transpose(h,l),r,c):void 0},s}),i("DataSources/ConstantPositionProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./PositionProperty"],function(e,t,i,r,n,o,a,s){"use strict";function l(i,r){this._definitionChanged=new o,this._value=e.clone(i),this._referenceFrame=t(r,a.FIXED)}return r(l.prototype,{isConstant:{get:function(){return!i(this._value)||this._referenceFrame===a.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),l.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,a.FIXED,t)},l.prototype.setValue=function(t,r){var n=!1;e.equals(this._value,t)||(n=!0,this._value=e.clone(t)),i(r)&&this._referenceFrame!==r&&(n=!0,this._referenceFrame=r),n&&this._definitionChanged.raiseEvent(this)},l.prototype.getValueInReferenceFrame=function(e,t,i){return s.convertToReferenceFrame(e,this._value,this._referenceFrame,t,i)},l.prototype.equals=function(t){return this===t||t instanceof l&&e.equals(this._value,t._value)&&this._referenceFrame===t._referenceFrame},l}),i("DataSources/CorridorGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),positions:a("positions"),height:a("height"),extrudedHeight:a("extrudedHeight"),granularity:a("granularity"),width:a("width"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),cornerType:a("cornerType")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.positions=this.positions,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.width=this.width,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.cornerType=this.cornerType,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.positions=e(this.positions,t.positions),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.width=e(this.width,t.width),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.cornerType=e(this.cornerType,t.cornerType)},s}),i("DataSources/createRawPropertyDescriptor",["./createPropertyDescriptor"],function(e){"use strict";function t(e){return e}function i(i,r){return e(i,r,t)}return i}),i("DataSources/CylinderGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},length:a("length"),topRadius:a("topRadius"),bottomRadius:a("bottomRadius"),numberOfVerticalLines:a("numberOfVerticalLines"),slices:a("slices"),show:a("show"),material:o("material"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth")}),s.prototype.clone=function(e){return t(e)?(e.bottomRadius=this.bottomRadius,e.length=this.length,e.topRadius=this.topRadius,e.show=this.show,e.material=this.material,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e):new s(this)},s.prototype.merge=function(t){this.bottomRadius=e(this.bottomRadius,t.bottomRadius),this.length=e(this.length,t.length),this.topRadius=e(this.topRadius,t.topRadius),this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.numberOfVerticalLines=e(this.numberOfVerticalLines,t.numberOfVerticalLines),this.slices=e(this.slices,t.slices),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth)},s}),i("DataSources/EllipseGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},semiMajorAxis:a("semiMajorAxis"),semiMinorAxis:a("semiMinorAxis"),rotation:a("rotation"),show:a("show"),material:o("material"),height:a("height"),extrudedHeight:a("extrudedHeight"),granularity:a("granularity"),stRotation:a("stRotation"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),numberOfVerticalLines:a("numberOfVerticalLines")}),s.prototype.clone=function(e){return t(e)?(e.rotation=this.rotation,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.show=this.show,e.material=this.material,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.stRotation=this.stRotation,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e):new s(this)},s.prototype.merge=function(t){this.rotation=e(this.rotation,t.rotation),this.semiMajorAxis=e(this.semiMajorAxis,t.semiMajorAxis),this.semiMinorAxis=e(this.semiMinorAxis,t.semiMinorAxis),this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.stRotation=e(this.stRotation,t.stRotation),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.numberOfVerticalLines=e(this.numberOfVerticalLines,t.numberOfVerticalLines)},s}),i("DataSources/EllipsoidGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),radii:a("radii"),material:o("material"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),stackPartitions:a("stackPartitions"),slicePartitions:a("slicePartitions"),subdivisions:a("subdivisions")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.radii=this.radii,e.material=this.material,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.radii=e(this.radii,t.radii),this.material=e(this.material,t.material),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.stackPartitions=e(this.stackPartitions,t.stackPartitions),this.slicePartitions=e(this.slicePartitions,t.slicePartitions),this.subdivisions=e(this.subdivisions,t.subdivisions)},s}),i("DataSources/LabelGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,i,r,n,o){"use strict";function a(t){this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},text:o("text"),font:o("font"),style:o("style"),fillColor:o("fillColor"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth"),horizontalOrigin:o("horizontalOrigin"),verticalOrigin:o("verticalOrigin"),eyeOffset:o("eyeOffset"),pixelOffset:o("pixelOffset"),scale:o("scale"),show:o("show"),translucencyByDistance:o("translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance")}),a.prototype.clone=function(e){return t(e)?(e.text=this.text,e.font=this.font,e.show=this.show,e.style=this.style,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scale=this.scale,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.eyeOffset=this.eyeOffset,e.pixelOffset=this.pixelOffset,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e):new a(this)},a.prototype.merge=function(t){this.text=e(this.text,t.text),this.font=e(this.font,t.font),this.show=e(this.show,t.show),this.style=e(this.style,t.style),this.fillColor=e(this.fillColor,t.fillColor),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.scale=e(this.scale,t.scale),this.horizontalOrigin=e(this.horizontalOrigin,t.horizontalOrigin),this.verticalOrigin=e(this.verticalOrigin,t.verticalOrigin),this.eyeOffset=e(this.eyeOffset,t.eyeOffset),this.pixelOffset=e(this.pixelOffset,t.pixelOffset),this.translucencyByDistance=e(this._translucencyByDistance,t.translucencyByDistance),this.pixelOffsetScaleByDistance=e(this._pixelOffsetScaleByDistance,t.pixelOffsetScaleByDistance)},a}),i("DataSources/NodeTransformationProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/TranslationRotationScale","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a){"use strict";var s=new n,l=function(t){t=e(t,e.EMPTY_OBJECT),this._definitionChanged=new r,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=t.translation,this.rotation=t.rotation,this.scale=t.scale};return i(l.prototype,{isConstant:{get:function(){return a.isConstant(this._translation)&&a.isConstant(this._rotation)&&a.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:o("translation"),rotation:o("rotation"),scale:o("scale")}),l.prototype.getValue=function(e,i){return t(i)||(i=new n),i.translation=a.getValueOrClonedDefault(this._translation,e,s.translation,i.translation),i.rotation=a.getValueOrClonedDefault(this._rotation,e,s.rotation,i.rotation),i.scale=a.getValueOrClonedDefault(this._scale,e,s.scale,i.scale),i},l.prototype.equals=function(e){return this===e||e instanceof l&&a.equals(this._translation,e._translation)&&a.equals(this._rotation,e._rotation)&&a.equals(this._scale,e._scale)},l}),i("DataSources/PropertyBag",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./ConstantProperty","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){return new o(e)}function u(e,t){var i=e._propertyNames,r=t._propertyNames,n=i.length;if(n!==r.length)return!1;for(var o=0;n>o;++o){var a=i[o],l=r.indexOf(a);if(-1===l)return!1;if(!s.equals(e[a],t[a]))return!1}return!0}var c=function(e,i){this._propertyNames=[],this._definitionChanged=new n,t(e)&&this.merge(e,i)};return i(c.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){for(var e=this._propertyNames,t=0,i=e.length;i>t;t++)if(!s.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),c.prototype.hasProperty=function(e){return-1!==this._propertyNames.indexOf(e)},c.prototype.addProperty=function(i,r,n){var o=this._propertyNames;o.push(i),Object.defineProperty(this,i,a(i,!0,e(n,l))),t(r)&&(this[i]=r),this._definitionChanged.raiseEvent(this)},c.prototype.removeProperty=function(e){var t=this._propertyNames,i=t.indexOf(e);this._propertyNames.splice(i,1),delete this[e],this._definitionChanged.raiseEvent(this)},c.prototype.getValue=function(e,i){t(i)||(i={});for(var r=this._propertyNames,n=0,o=r.length;o>n;n++){var a=r[n];i[a]=s.getValueOrUndefined(this[a],e,i[a])}return i},c.prototype.merge=function(e,i){for(var r=this._propertyNames,n=t(e._propertyNames)?e._propertyNames:Object.keys(e),o=0,a=n.length;a>o;o++){var s=n[o],l=this[s],u=e[s];t(l)||-1!==r.indexOf(s)||this.addProperty(s,void 0,i),t(u)&&(t(l)?t(l.merge)&&l.merge(u):t(u.merge)&&t(u.clone)?this[s]=u.clone():this[s]=u)}},c.prototype.equals=function(e){return this===e||e instanceof c&&u(this,e)},c}),i("DataSources/ModelGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor","./NodeTransformationProperty","./PropertyBag"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){return new a(e)}function u(e){return new s(e,l)}function c(t){this._show=void 0,this._showSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(c.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),scale:o("scale"),minimumPixelSize:o("minimumPixelSize"),maximumScale:o("maximumScale"), +incrementallyLoadTextures:o("incrementallyLoadTextures"),uri:o("uri"),runAnimations:o("runAnimations"),nodeTransformations:o("nodeTransformations",void 0,u)}),c.prototype.clone=function(e){return t(e)?(e.show=this.show,e.scale=this.scale,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.uri=this.uri,e.runAnimations=this.runAnimations,e.nodeTransformations=this.nodeTransformations,e):new c(this)},c.prototype.merge=function(i){this.show=e(this.show,i.show),this.scale=e(this.scale,i.scale),this.minimumPixelSize=e(this.minimumPixelSize,i.minimumPixelSize),this.maximumScale=e(this.maximumScale,i.maximumScale),this.incrementallyLoadTextures=e(this.incrementallyLoadTextures,i.incrementallyLoadTextures),this.uri=e(this.uri,i.uri),this.runAnimations=e(this.runAnimations,i.runAnimations);var r=i.nodeTransformations;if(t(r)){var n=this.nodeTransformations;t(n)?n.merge(r):this.nodeTransformations=new s(r,l)}},c}),i("DataSources/PathGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._material=void 0,this._materialSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),width:a("width"),resolution:a("resolution"),leadTime:a("leadTime"),trailTime:a("trailTime")}),s.prototype.clone=function(e){return t(e)?(e.material=this.material,e.width=this.width,e.resolution=this.resolution,e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e):new s(this)},s.prototype.merge=function(t){this.material=e(this.material,t.material),this.width=e(this.width,t.width),this.resolution=e(this.resolution,t.resolution),this.show=e(this.show,t.show),this.leadTime=e(this.leadTime,t.leadTime),this.trailTime=e(this.trailTime,t.trailTime)},s}),i("DataSources/PointGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,i,r,n,o){"use strict";function a(t){this._color=void 0,this._colorSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),pixelSize:o("pixelSize"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth"),show:o("show"),scaleByDistance:o("scaleByDistance"),translucencyByDistance:o("translucencyByDistance")}),a.prototype.clone=function(e){return t(e)?(e.color=this.color,e.pixelSize=this.pixelSize,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.show=this.show,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e):new a(this)},a.prototype.merge=function(t){this.color=e(this.color,t.color),this.pixelSize=e(this.pixelSize,t.pixelSize),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.show=e(this.show,t.show),this.scaleByDistance=e(this.scaleByDistance,t.scaleByDistance),this.translucencyByDistance=e(this._translucencyByDistance,t.translucencyByDistance)},a}),i("DataSources/PolygonGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._definitionChanged=new n,this._fill=void 0,this._fillSubscription=void 0,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),hierarchy:a("hierarchy"),height:a("height"),extrudedHeight:a("extrudedHeight"),granularity:a("granularity"),stRotation:a("stRotation"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),perPositionHeight:a("perPositionHeight")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.hierarchy=this.hierarchy,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.stRotation=this.stRotation,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.hierarchy=e(this.hierarchy,t.hierarchy),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.stRotation=e(this.stRotation,t.stRotation),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.perPositionHeight=e(this.perPositionHeight,t.perPositionHeight)},s}),i("DataSources/PolylineGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._followSurface=void 0,this._followSurfaceSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._widthSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),positions:a("positions"),width:a("width"),followSurface:a("followSurface"),granularity:a("granularity")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.positions=this.positions,e.width=this.width,e.followSurface=this.followSurface,e.granularity=this.granularity,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.positions=e(this.positions,t.positions),this.width=e(this.width,t.width),this.followSurface=e(this.followSurface,t.followSurface),this.granularity=e(this.granularity,t.granularity)},s}),i("DataSources/PolylineVolumeGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),positions:a("positions"),shape:a("shape"),granularity:a("granularity"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),cornerType:a("cornerType")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.positions=this.positions,e.shape=this.shape,e.granularity=this.granularity,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.cornerType=this.cornerType,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.positions=e(this.positions,t.positions),this.shape=e(this.shape,t.shape),this.granularity=e(this.granularity,t.granularity),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.cornerType=e(this.cornerType,t.cornerType)},s}),i("DataSources/RectangleGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),coordinates:a("coordinates"),material:o("material"),height:a("height"),extrudedHeight:a("extrudedHeight"),granularity:a("granularity"),stRotation:a("stRotation"),rotation:a("rotation"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),closeTop:a("closeTop"),closeBottom:a("closeBottom")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.coordinates=this.coordinates,e.material=this.material,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.stRotation=this.stRotation,e.rotation=this.rotation,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.coordinates=e(this.coordinates,t.coordinates),this.material=e(this.material,t.material),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.stRotation=e(this.stRotation,t.stRotation),this.rotation=e(this.rotation,t.rotation),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.closeTop=e(this.closeTop,t.closeTop),this.closeBottom=e(this.closeBottom,t.closeBottom)},s}),i("DataSources/WallGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),positions:a("positions"),minimumHeights:a("minimumHeights"),maximumHeights:a("maximumHeights"),granularity:a("granularity"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.positions=e(this.positions,t.positions),this.minimumHeights=e(this.minimumHeights,t.minimumHeights),this.maximumHeights=e(this.maximumHeights,t.maximumHeights),this.granularity=e(this.granularity,t.granularity),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth)},s}),i("DataSources/Entity",["../Core/Cartesian3","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/Transforms","./BillboardGraphics","./BoxGraphics","./ConstantPositionProperty","./CorridorGraphics","./createPropertyDescriptor","./createRawPropertyDescriptor","./CylinderGraphics","./EllipseGraphics","./EllipsoidGraphics","./LabelGraphics","./ModelGraphics","./PathGraphics","./PointGraphics","./PolygonGraphics","./PolylineGraphics","./PolylineVolumeGraphics","./Property","./RectangleGraphics","./WallGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I){"use strict";function M(e){return new m(e)}function D(e){return f(e,void 0,M)}function R(e,t){return f(e,void 0,function(e){return e instanceof t?e:new t(e)})}function O(e){e=i(e,i.EMPTY_OBJECT);var n=e.id;r(n)||(n=t()),this._availability=void 0,this._id=n,this._definitionChanged=new a,this._name=e.name,this._show=i(e.show,!0),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","orientation","path","point","polygon","polyline","polylineVolume","position","rectangle","viewFrom","wall"],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function N(e,t,i){for(var r=t.length,n=0;r>n;n++){var o=t[n],a=o._show,s=!i&&a,l=i&&a;s!==l&&N(o,o._children,i)}e._definitionChanged.raiseEvent(e,"isShowing",i,!i)}n(O.prototype,{availability:v("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:v("name"),show:{get:function(){return this._show},set:function(e){if(e!==this._show){var t=this.isShowing;this._show=e;var i=this.isShowing;t!==i&&N(this,this._children,i),this._definitionChanged.raiseEvent(this,"show",e,!e)}}},isShowing:{get:function(){return this._show&&(!r(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){var t=this._parent;if(t!==e){var i=this.isShowing;if(r(t)){var n=t._children.indexOf(this);t._children.splice(n,1)}this._parent=e,r(e)&&e._children.push(this);var o=this.isShowing;i!==o&&N(this,this._children,o),this._definitionChanged.raiseEvent(this,"parent",e,t)}}},propertyNames:{get:function(){return this._propertyNames}},billboard:R("billboard",h),box:R("box",d),corridor:R("corridor",p),cylinder:R("cylinder",g),description:f("description"),ellipse:R("ellipse",_),ellipsoid:R("ellipsoid",y),label:R("label",C),model:R("model",E),orientation:f("orientation"),path:R("path",S),point:R("point",w),polygon:R("polygon",T),polyline:R("polyline",x),polylineVolume:R("polylineVolume",b),position:D("position"),rectangle:R("rectangle",P),viewFrom:f("viewFrom"),wall:R("wall",I)}),O.prototype.isAvailable=function(e){var t=this._availability;return!r(t)||t.contains(e)},O.prototype.addProperty=function(e){var t=this._propertyNames;t.push(e),Object.defineProperty(this,e,v(e,!0))},O.prototype.removeProperty=function(e){var t=this._propertyNames,i=t.indexOf(e);this._propertyNames.splice(i,1),delete this[e]},O.prototype.merge=function(e){this.name=i(this.name,e.name),this.availability=i(e.availability,this.availability);for(var t=this._propertyNames,n=r(e._propertyNames)?e._propertyNames:Object.keys(e),o=n.length,a=0;o>a;a++){var s=n[a];if("parent"!==s){var l=this[s],u=e[s];r(l)||-1!==t.indexOf(s)||this.addProperty(s),r(u)&&(r(l)?r(l.merge)&&l.merge(u):r(u.merge)&&r(u.clone)?this[s]=u.clone():this[s]=u)}}};var L=new s,F=new e,B=new u;return O.prototype._getModelMatrix=function(e,t){var i=A.getValueOrUndefined(this._position,e,F);if(r(i)){var n=A.getValueOrUndefined(this._orientation,e,B);return t=r(n)?l.fromRotationTranslation(s.fromQuaternion(n,L),i,t):c.eastNorthUpToFixedFrame(i,void 0,t)}},O}),i("DataSources/EntityCollection",["../Core/AssociativeArray","../Core/createGuid","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/Iso8601","../Core/JulianDate","../Core/RuntimeError","../Core/TimeInterval","./Entity"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e){if(0===e._suspendCount){var t=e._addedEntities,i=e._removedEntities,r=e._changedEntities;(0!==r.length||0!==t.length||0!==i.length)&&(e._collectionChanged.raiseEvent(e,t.values,i.values,r.values),t.removeAll(),i.removeAll(),r.removeAll())}}function d(i){this._owner=i,this._entities=new e,this._addedEntities=new e,this._removedEntities=new e,this._changedEntities=new e,this._suspendCount=0,this._collectionChanged=new o,this._id=t()}var m={id:void 0};return d.prototype.suspendEvents=function(){this._suspendCount++},d.prototype.resumeEvents=function(){this._suspendCount--,h(this)},d.collectionChangedEventCallback=void 0,r(d.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},owner:{get:function(){return this._owner}}}),d.prototype.computeAvailability=function(){for(var e=a.MAXIMUM_VALUE,t=a.MINIMUM_VALUE,r=this._entities.values,n=0,o=r.length;o>n;n++){var l=r[n],c=l.availability;if(i(c)){var h=c.start,d=c.stop;s.lessThan(h,e)&&!h.equals(a.MINIMUM_VALUE)&&(e=h),s.greaterThan(d,t)&&!d.equals(a.MAXIMUM_VALUE)&&(t=d)}}return a.MAXIMUM_VALUE.equals(e)&&(e=a.MINIMUM_VALUE),a.MINIMUM_VALUE.equals(t)&&(t=a.MAXIMUM_VALUE),new u({start:e,stop:t})},d.prototype.add=function(e){e instanceof c||(e=new c(e));var t=e.id,i=this._entities;if(i.contains(t))throw new l("An entity with id "+t+" already exists in this collection.");return e.entityCollection=this,i.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(d.prototype._onEntityDefinitionChanged,this),h(this),e},d.prototype.remove=function(e){return i(e)?this.removeById(e.id):!1},d.prototype.contains=function(e){return this._entities.get(e.id)===e},d.prototype.removeById=function(e){if(!i(e))return!1;var t=this._entities,r=t.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,r),this._changedEntities.remove(e)),this._entities.remove(e),r.definitionChanged.removeEventListener(d.prototype._onEntityDefinitionChanged,this),h(this),!0):!1},d.prototype.removeAll=function(){for(var e=this._entities,t=e.length,r=e.values,n=this._addedEntities,o=this._removedEntities,a=0;t>a;a++){var s=r[a],l=s.id,u=n.get(l);i(u)||(s.definitionChanged.removeEventListener(d.prototype._onEntityDefinitionChanged,this),o.set(l,s))}e.removeAll(),n.removeAll(),this._changedEntities.removeAll(),h(this)},d.prototype.getById=function(e){return this._entities.get(e)},d.prototype.getOrCreateEntity=function(e){var t=this._entities.get(e);return i(t)||(m.id=e,t=new c(m),this.add(t)),t},d.prototype._onEntityDefinitionChanged=function(e){var t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),h(this)},d}),i("DataSources/CompositeEntityCollection",["../Core/createGuid","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Math","./Entity","./EntityCollection"],function(e,t,i,r,n,o,a){"use strict";function s(e){for(var t=e.propertyNames,i=t.length,r=0;i>r;r++)e[t[r]]=void 0}function l(e,t,i,r){f[0]=i,f[1]=r.id,t[JSON.stringify(f)]=r.definitionChanged.addEventListener(h.prototype._onDefinitionChanged,e)}function u(e,t,i,r){f[0]=i,f[1]=r.id;var n=JSON.stringify(f);t[n](),t[n]=void 0}function c(e){if(e._shouldRecomposite=!0,0===e._suspendCount){var i,r,n,c,d,m,f=e._collections,v=f.length,g=e._collectionsCopy,_=g.length,y=e._composite,C=new a(e),E=e._eventHash;for(i=0;_>i;i++)for(d=g[i],d.collectionChanged.removeEventListener(h.prototype._onCollectionChanged,e),n=d.values,m=d.id,c=n.length-1;c>-1;c--)r=n[c],u(e,E,m,r);for(i=v-1;i>=0;i--)for(d=f[i],d.collectionChanged.addEventListener(h.prototype._onCollectionChanged,e),n=d.values,m=d.id,c=n.length-1;c>-1;c--){r=n[c],l(e,E,m,r);var S=C.getById(r.id);t(S)||(S=y.getById(r.id),t(S)?s(S):(p.id=r.id,S=new o(p)),C.add(S)),S.merge(r)}e._collectionsCopy=f.slice(0),y.suspendEvents(),y.removeAll();var w=C.values;for(i=0;i<w.length;i++)y.add(w[i]);y.resumeEvents()}}function h(i){this._composite=new a(this),this._suspendCount=0,this._collections=t(i)?i.slice():[],this._collectionsCopy=[],this._id=e(),this._eventHash={},c(this),this._shouldRecomposite=!1}function d(e,t){var i=e.indexOf(t);return i}function m(e,t,i){var r=e._collections;if(t=n.clamp(t,0,r.length-1),i=n.clamp(i,0,r.length-1),t!==i){var o=r[t];r[t]=r[i],r[i]=o,c(e)}}var p={id:void 0},f=new Array(2);return i(h.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}}}),h.prototype.addCollection=function(e,i){var r=t(i);r?this._collections.splice(i,0,e):(i=this._collections.length,this._collections.push(e)),c(this)},h.prototype.removeCollection=function(e){var t=this._collections.indexOf(e);return-1!==t?(this._collections.splice(t,1),c(this),!0):!1},h.prototype.removeAllCollections=function(){this._collections.length=0,c(this)},h.prototype.containsCollection=function(e){return-1!==this._collections.indexOf(e)},h.prototype.contains=function(e){return this._composite.contains(e)},h.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)},h.prototype.getCollection=function(e){return this._collections[e]},h.prototype.getCollectionsLength=function(){return this._collections.length},h.prototype.raiseCollection=function(e){var t=d(this._collections,e);m(this,t,t+1)},h.prototype.lowerCollection=function(e){var t=d(this._collections,e);m(this,t,t-1)},h.prototype.raiseCollectionToTop=function(e){var t=d(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),c(this))},h.prototype.lowerCollectionToBottom=function(e){var t=d(this._collections,e);0!==t&&(this._collections.splice(t,1),this._collections.splice(0,0,e),c(this))},h.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()},h.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&0===this._suspendCount&&(c(this),this._shouldRecomposite=!1),this._composite.resumeEvents()},h.prototype.computeAvailability=function(){return this._composite.computeAvailability()},h.prototype.getById=function(e){return this._composite.getById(e)},h.prototype._onCollectionChanged=function(e,i,r){var n=this._collectionsCopy,a=n.length,c=this._composite;c.suspendEvents();var h,d,m,f,v=r.length,g=this._eventHash,_=e.id;for(h=0;v>h;h++){var y=r[h];u(this,g,_,y);var C=y.id;for(d=a-1;d>=0;d--)m=n[d].getById(C),t(m)&&(t(f)||(f=c.getById(C),s(f)),f.merge(m));t(f)||c.removeById(C),f=void 0}var E=i.length;for(h=0;E>h;h++){var S=i[h];l(this,g,_,S);var w=S.id;for(d=a-1;d>=0;d--)m=n[d].getById(w),t(m)&&(t(f)||(f=c.getById(w),t(f)?s(f):(p.id=w,f=new o(p),c.add(f))),f.merge(m));f=void 0}c.resumeEvents()},h.prototype._onDefinitionChanged=function(e,i,r,n){for(var o=this._collections,a=this._composite,s=o.length,l=e.id,u=a.getById(l),c=u[i],h=!t(c),d=!0,m=s-1;m>=0;m--){var p=o[m].getById(e.id);if(t(p)){var f=p[i];if(t(f)){if(d){if(d=!1,!t(f.merge)||!t(f.clone)){c=f;break}c=f.clone(c)}c.merge(f)}}}h&&-1===u.propertyNames.indexOf(i)&&u.addProperty(i),u[i]=c},h}),i("DataSources/CompositeProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/TimeIntervalCollection","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(t,i,r,n){function o(){r.raiseEvent(t)}var a=[];i.removeAll();for(var s=n.length,l=0;s>l;l++){var u=n.get(l);e(u.data)&&-1===a.indexOf(u.data)&&i.add(u.data.definitionChanged,o)}}function l(){this._eventHelper=new n,this._definitionChanged=new r,this._intervals=new o,this._intervals.changedEvent.addEventListener(l.prototype._intervalsChanged,this)}return t(l.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),l.prototype.getValue=function(t,i){var r=this._intervals.findDataForIntervalContainingDate(t);return e(r)?r.getValue(t,i):void 0},l.prototype.equals=function(e){return this===e||e instanceof l&&this._intervals.equals(e._intervals,a.equals)},l.prototype._intervalsChanged=function(){s(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)},l}),i("DataSources/CompositeMaterialProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./CompositeProperty","./Property"],function(e,t,i,r,n,o){"use strict";function a(){this._definitionChanged=new r,this._composite=new n,this._composite.definitionChanged.addEventListener(a.prototype._raiseDefinitionChanged,this)}return t(a.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}}),a.prototype.getType=function(t){var i=this._composite._intervals.findDataForIntervalContainingDate(t);return e(i)?i.getType(t):void 0},a.prototype.getValue=function(t,i){var r=this._composite._intervals.findDataForIntervalContainingDate(t);return e(r)?r.getValue(t,i):void 0},a.prototype.equals=function(e){return this===e||e instanceof a&&this._composite.equals(e._composite,o.equals)},a.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},a}),i("DataSources/CompositePositionProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./CompositeProperty","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(t){this._referenceFrame=e(t,o.FIXED),this._definitionChanged=new n,this._composite=new a,this._composite.definitionChanged.addEventListener(l.prototype._raiseDefinitionChanged,this)}return i(l.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}}),l.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,o.FIXED,t)},l.prototype.getValueInReferenceFrame=function(e,i,r){var n=this._composite._intervals.findDataForIntervalContainingDate(e);return t(n)?n.getValueInReferenceFrame(e,i,r):void 0},l.prototype.equals=function(e){return this===e||e instanceof l&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,s.equals)},l.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},l}),i("DataSources/CorridorGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/CorridorGeometry","../Core/CorridorOutlineGeometry","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C){"use strict";function E(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0}function S(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(S.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new E(e),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}function w(e,t){this._primitives=e, +this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new E(t._entity)}var T=new v(e.WHITE),x=new g(!0),b=new g(!0),A=new g(!1),P=new g(e.BLACK),I=new e;return a(S,{perInstanceColorAppearanceType:{value:p},materialAppearanceType:{value:m}}),a(S.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!o(this._entity.availability)&&C.isConstant(this._showProperty)&&C.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!o(this._entity.availability)&&C.isConstant(this._showProperty)&&C.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},geometryChanged:{get:function(){return this._geometryChanged}}}),S.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},S.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},S.prototype.createFillGeometryInstance=function(r){var n,a,s=this._entity,l=s.isAvailable(r),u=new d(l&&s.isShowing&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r));if(this._materialProperty instanceof v){var h=e.WHITE;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(h=this._materialProperty.color.getValue(r)),a=t.fromColor(h),n={show:u,color:a}}else n={show:u};return new c({id:s,geometry:new i(this._options),attributes:n})},S.prototype.createOutlineGeometryInstance=function(i){var n=this._entity,o=n.isAvailable(i),a=C.getValueOrDefault(this._outlineColorProperty,i,e.BLACK);return new c({id:n,geometry:new r(this._options),attributes:{show:new d(o&&n.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(a)}})},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){this._entitySubscription(),s(this)},S.prototype._onEntityPropertyChanged=function(e,t,i,r){if("availability"===t||"corridor"===t){var a=this._entity.corridor;if(!o(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=o(s)&&s.isConstant?s.getValue(h.MINIMUM_VALUE):!0,u=a.outline,c=o(u);if(c&&u.isConstant&&(c=u.getValue(h.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=a.positions,f=a.show;if(o(f)&&f.isConstant&&!f.getValue(h.MINIMUM_VALUE)||!o(d))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var g=n(a.material,T),_=g instanceof v;this._materialProperty=g,this._fillProperty=n(s,b),this._showProperty=n(f,x),this._showOutlineProperty=n(a.outline,A),this._outlineColorProperty=c?n(a.outlineColor,P):void 0;var y=a.height,E=a.extrudedHeight,S=a.granularity,w=a.width,I=a.outlineWidth,M=a.cornerType;if(this._isClosed=o(E),this._fillEnabled=l,this._outlineEnabled=c,d.isConstant&&C.isConstant(y)&&C.isConstant(E)&&C.isConstant(S)&&C.isConstant(w)&&C.isConstant(I)&&C.isConstant(M)){var D=this._options;D.vertexFormat=_?p.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,D.positions=d.getValue(h.MINIMUM_VALUE,D.positions),D.height=o(y)?y.getValue(h.MINIMUM_VALUE):void 0,D.extrudedHeight=o(E)?E.getValue(h.MINIMUM_VALUE):void 0,D.granularity=o(S)?S.getValue(h.MINIMUM_VALUE):void 0,D.width=o(w)?w.getValue(h.MINIMUM_VALUE):void 0,D.cornerType=o(M)?M.getValue(h.MINIMUM_VALUE):void 0,this._outlineWidth=o(I)?I.getValue(h.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},S.prototype.createDynamicUpdater=function(e){return new w(e,this)},w.prototype.update=function(n){var a=this._primitives;a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var s=this._geometryUpdater,l=s._entity,u=l.corridor;if(l.isShowing&&l.isAvailable(n)&&C.getValueOrDefault(u.show,n,!0)){var h=this._options,d=C.getValueOrUndefined(u.positions,n,h.positions),v=C.getValueOrUndefined(u.width,n);if(o(d)&&o(v)){if(h.positions=d,h.width=v,h.height=C.getValueOrUndefined(u.height,n),h.extrudedHeight=C.getValueOrUndefined(u.extrudedHeight,n),h.granularity=C.getValueOrUndefined(u.granularity,n),h.cornerType=C.getValueOrUndefined(u.cornerType,n),!o(u.fill)||u.fill.getValue(n)){var g=y.getValue(n,s.fillMaterialProperty,this._material);this._material=g;var _=new m({material:g,translucent:g.isTranslucent(),closed:o(h.extrudedHeight)});h.vertexFormat=_.vertexFormat,this._primitive=a.add(new f({geometryInstances:new c({id:l,geometry:new i(h)}),appearance:_,asynchronous:!1}))}if(o(u.outline)&&u.outline.getValue(n)){h.vertexFormat=p.VERTEX_FORMAT;var E=C.getValueOrClonedDefault(u.outlineColor,n,e.BLACK,I),S=C.getValueOrDefault(u.outlineWidth,n,1),w=1!==E.alpha;this._outlinePrimitive=a.add(new f({geometryInstances:new c({id:l,geometry:new r(h),attributes:{color:t.fromColor(E)}}),appearance:new p({flat:!0,translucent:w,renderState:{lineWidth:s._scene.clampLineWidth(S)}}),asynchronous:!1}))}}}},w.prototype.getBoundingSphere=function(e,t){return _(e,this._primitive,this._outlinePrimitive,t)},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),s(this)},S}),i("DataSources/DataSource",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function i(){t.throwInstantiationError()}return e(i.prototype,{name:{get:t.throwInstantiationError},clock:{get:t.throwInstantiationError},entities:{get:t.throwInstantiationError},isLoading:{get:t.throwInstantiationError},changedEvent:{get:t.throwInstantiationError},errorEvent:{get:t.throwInstantiationError},loadingEvent:{get:t.throwInstantiationError}}),i.prototype.update=t.throwInstantiationError,i.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))},i}),i("DataSources/CustomDataSource",["../Core/defineProperties","../Core/Event","./DataSource","./EntityCollection"],function(e,t,i,r){"use strict";function n(e){this._name=e,this._clock=void 0,this._changed=new t,this._error=new t,this._isLoading=!1,this._loading=new t,this._entityCollection=new r(this)}return e(n.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){i.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}}}),n}),i("DataSources/CylinderGeometryUpdater",["../Core/Cartesian3","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/CylinderGeometry","../Core/CylinderOutlineGeometry","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E){"use strict";function S(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0}function w(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(w.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new c,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new S(e),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}function T(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new S(t._entity)}var x=new g(t.WHITE),b=new _(!0),A=new _(!0),P=new _(!1),I=new _(t.BLACK),M=new t;return s(w,{perInstanceColorAppearanceType:{value:f},materialAppearanceType:{value:p}}),s(w.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!a(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!a(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),w.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},w.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},w.prototype.createFillGeometryInstance=function(e){var n,o,s=this._entity,l=s.isAvailable(e),u=new m(l&&s.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e));if(this._materialProperty instanceof g){var c=t.WHITE;a(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(c=this._materialProperty.color.getValue(e)),o=i.fromColor(c),n={show:u,color:o}}else n={show:u};return new h({id:s,geometry:new r(this._options),modelMatrix:s._getModelMatrix(d.MINIMUM_VALUE),attributes:n})},w.prototype.createOutlineGeometryInstance=function(e){var r=this._entity,o=r.isAvailable(e),a=E.getValueOrDefault(this._outlineColorProperty,e,t.BLACK);return new h({id:r,geometry:new n(this._options),modelMatrix:r._getModelMatrix(d.MINIMUM_VALUE),attributes:{show:new m(o&&r.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:i.fromColor(a)}})},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){this._entitySubscription(),l(this)},w.prototype._onEntityPropertyChanged=function(e,t,i,r){if("availability"===t||"position"===t||"orientation"===t||"cylinder"===t){var n=e.cylinder;if(!a(n))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=n.fill,l=a(s)&&s.isConstant?s.getValue(d.MINIMUM_VALUE):!0,u=n.outline,c=a(u);if(c&&u.isConstant&&(c=u.getValue(d.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var h=e.position,m=n.length,v=n.topRadius,_=n.bottomRadius,y=n.show;if(a(y)&&y.isConstant&&!y.getValue(d.MINIMUM_VALUE)||!a(h)||!a(m)||!a(v)||!a(_))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var C=o(n.material,x),S=C instanceof g;this._materialProperty=C,this._fillProperty=o(s,A),this._showProperty=o(y,b),this._showOutlineProperty=o(n.outline,P),this._outlineColorProperty=c?o(n.outlineColor,I):void 0;var w=n.slices,T=n.outlineWidth,M=n.numberOfVerticalLines;if(this._fillEnabled=l,this._outlineEnabled=c,h.isConstant&&E.isConstant(e.orientation)&&m.isConstant&&v.isConstant&&_.isConstant&&E.isConstant(w)&&E.isConstant(T)&&E.isConstant(M)){var D=this._options;D.vertexFormat=S?f.VERTEX_FORMAT:p.MaterialSupport.TEXTURED.vertexFormat,D.length=m.getValue(d.MINIMUM_VALUE),D.topRadius=v.getValue(d.MINIMUM_VALUE),D.bottomRadius=_.getValue(d.MINIMUM_VALUE),D.slices=a(w)?w.getValue(d.MINIMUM_VALUE):void 0,D.numberOfVerticalLines=a(M)?M.getValue(d.MINIMUM_VALUE):void 0,this._outlineWidth=a(T)?T.getValue(d.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},w.prototype.createDynamicUpdater=function(e){return new T(e,this)},T.prototype.update=function(e){var o=this._primitives;o.removeAndDestroy(this._primitive),o.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var s=this._geometryUpdater,l=s._entity,u=l.cylinder;if(l.isShowing&&l.isAvailable(e)&&E.getValueOrDefault(u.show,e,!0)){var c=this._options,d=l._getModelMatrix(e),m=E.getValueOrUndefined(u.length,e),g=E.getValueOrUndefined(u.topRadius,e),_=E.getValueOrUndefined(u.bottomRadius,e);if(a(d)&&a(m)&&a(g)&&a(_)){if(c.length=m,c.topRadius=g,c.bottomRadius=_,c.slices=E.getValueOrUndefined(u.slices,e),c.numberOfVerticalLines=E.getValueOrUndefined(u.numberOfVerticalLines,e),E.getValueOrDefault(u.fill,e,!0)){var y=C.getValue(e,s.fillMaterialProperty,this._material);this._material=y;var S=new p({material:y,translucent:y.isTranslucent(),closed:!0});c.vertexFormat=S.vertexFormat,this._primitive=o.add(new v({geometryInstances:new h({id:l,geometry:new r(c),modelMatrix:d}),appearance:S,asynchronous:!1}))}if(E.getValueOrDefault(u.outline,e,!1)){c.vertexFormat=f.VERTEX_FORMAT;var w=E.getValueOrClonedDefault(u.outlineColor,e,t.BLACK,M),T=E.getValueOrDefault(u.outlineWidth,e,1),x=1!==w.alpha;this._outlinePrimitive=o.add(new v({geometryInstances:new h({id:l,geometry:new n(c),modelMatrix:d,attributes:{color:i.fromColor(w)}}),appearance:new f({flat:!0,translucent:x,renderState:{lineWidth:s._scene.clampLineWidth(T)}}),asynchronous:!1}))}}}},T.prototype.getBoundingSphere=function(e,t){return y(e,this._primitive,this._outlinePrimitive,t)},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),l(this)},w}),i("Scene/LabelStyle",["../Core/freezeObject"],function(e){"use strict";var t={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2};return e(t)}),i("DataSources/DataSourceClock",["../Core/Clock","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","./createRawPropertyDescriptor"],function(e,t,i,r,n,o,a,s){"use strict";function l(){this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0,this._definitionChanged=new o}return r(l.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:s("startTime"),stopTime:s("stopTime"),currentTime:s("currentTime"),clockRange:s("clockRange"),clockStep:s("clockStep"),multiplier:s("multiplier")}),l.prototype.clone=function(e){return i(e)||(e=new l),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e},l.prototype.equals=function(e){return this===e||i(e)&&a.equals(this.startTime,e.startTime)&&a.equals(this.stopTime,e.stopTime)&&a.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier},l.prototype.merge=function(e){this.startTime=t(this.startTime,e.startTime),this.stopTime=t(this.stopTime,e.stopTime),this.currentTime=t(this.currentTime,e.currentTime),this.clockRange=t(this.clockRange,e.clockRange),this.clockStep=t(this.clockStep,e.clockStep),this.multiplier=t(this.multiplier,e.multiplier)},l.prototype.getValue=function(t){return i(t)||(t=new e),t.startTime=this.startTime,t.stopTime=this.stopTime,t.clockRange=this.clockRange,t.clockStep=this.clockStep,t.multiplier=this.multiplier,t.currentTime=this.currentTime,t},l}),i("DataSources/GridMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=i(e,i.EMPTY_OBJECT),this._definitionChanged=new o,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}var u=t.WHITE,c=.1,h=new e(8,8),d=new e(0,0),m=new e(1,1);return n(l.prototype,{isConstant:{get:function(){return s.isConstant(this._color)&&s.isConstant(this._cellAlpha)&&s.isConstant(this._lineCount)&&s.isConstant(this._lineThickness)&&s.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:a("color"),cellAlpha:a("cellAlpha"),lineCount:a("lineCount"),lineThickness:a("lineThickness"),lineOffset:a("lineOffset")}),l.prototype.getType=function(e){return"Grid"},l.prototype.getValue=function(e,t){return r(t)||(t={}),t.color=s.getValueOrClonedDefault(this._color,e,u,t.color),t.cellAlpha=s.getValueOrDefault(this._cellAlpha,e,c),t.lineCount=s.getValueOrClonedDefault(this._lineCount,e,h,t.lineCount),t.lineThickness=s.getValueOrClonedDefault(this._lineThickness,e,m,t.lineThickness),t.lineOffset=s.getValueOrClonedDefault(this._lineOffset,e,d,t.lineOffset),t},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._color,e._color)&&s.equals(this._cellAlpha,e._cellAlpha)&&s.equals(this._lineCount,e._lineCount)&&s.equals(this._lineThickness,e._lineThickness)&&s.equals(this._lineOffset,e._lineOffset)},l}),i("DataSources/PolylineGlowMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower}var l=e.WHITE,u=.25;return r(s.prototype,{isConstant:{get:function(){return a.isConstant(this._color)&&a.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),glowPower:o("glowPower")}),s.prototype.getType=function(e){return"PolylineGlow"},s.prototype.getValue=function(e,t){return i(t)||(t={}),t.color=a.getValueOrClonedDefault(this._color,e,l,t.color),t.glowPower=a.getValueOrDefault(this._glowPower,e,u,t.glowPower),t},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._color,e._color)&&a.equals(this._glowPower,e._glowPower)},s}),i("DataSources/PolylineOutlineMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}var l=e.WHITE,u=e.BLACK,c=1;return r(s.prototype,{isConstant:{get:function(){return a.isConstant(this._color)&&a.isConstant(this._outlineColor)&&a.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth")}),s.prototype.getType=function(e){return"PolylineOutline"},s.prototype.getValue=function(e,t){return i(t)||(t={}),t.color=a.getValueOrClonedDefault(this._color,e,l,t.color),t.outlineColor=a.getValueOrClonedDefault(this._outlineColor,e,u,t.outlineColor),t.outlineWidth=a.getValueOrDefault(this._outlineWidth,e,c),t},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._color,e._color)&&a.equals(this._outlineColor,e._outlineColor)&&a.equals(this._outlineWidth,e._outlineWidth)},s}),i("DataSources/PositionPropertyArray",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/ReferenceFrame","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(t,i){this._value=void 0,this._definitionChanged=new n,this._eventHelper=new o,this._referenceFrame=e(i,a.FIXED),this.setValue(t)}return i(l.prototype,{isConstant:{get:function(){var e=this._value;if(!t(e))return!0;for(var i=e.length,r=0;i>r;r++)if(!s.isConstant(e[r]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),l.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,a.FIXED,t)},l.prototype.getValueInReferenceFrame=function(e,i,r){var n=this._value;if(t(n)){var o=n.length;t(r)||(r=new Array(o));for(var a=0,s=0;o>a;){var l=n[a],u=l.getValueInReferenceFrame(e,i,r[a]);t(u)&&(r[s]=u,s++),a++}return r.length=s,r}},l.prototype.setValue=function(e){var i=this._eventHelper;if(i.removeAll(),t(e)){this._value=e.slice();for(var r=e.length,n=0;r>n;n++){var o=e[n];t(o)&&i.add(o.definitionChanged,l.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)},l.prototype.equals=function(e){return this===e||e instanceof l&&this._referenceFrame===e._referenceFrame&&s.arrayEquals(this._value,e._value)},l.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},l}),i("DataSources/ReferenceProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/RuntimeError","./Property"],function(e,t,i,r,n,o){"use strict";function a(t){var i=!0;if(t._resolveEntity){var r=t._targetCollection.getById(t._targetId);if(e(r)?(r.definitionChanged.addEventListener(l.prototype._onTargetEntityDefinitionChanged,t),t._targetEntity=r,t._resolveEntity=!1):(r=t._targetEntity,i=!1),!e(r))throw new n('target entity "'+t._targetId+'" could not be resolved.')}return i}function s(t){var i=t._targetProperty;if(t._resolveProperty){var r=a(t),o=t._targetPropertyNames;i=t._targetEntity;for(var s=o.length,l=0;s>l&&e(i);l++)i=i[o[l]];if(e(i))t._targetProperty=i,t._resolveProperty=!r;else if(!e(t._targetProperty))throw new n('targetProperty "'+t._targetId+"."+o.join(".")+'" could not be resolved.')}return i}function l(e,t,i){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=i,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new r,this._resolveEntity=!0,this._resolveProperty=!0,e.collectionChanged.addEventListener(l.prototype._onCollectionChanged,this)}return t(l.prototype,{isConstant:{get:function(){return o.isConstant(s(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return s(this).referenceFrame}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return s(this)}}}),l.fromString=function(e,t){for(var i,r=[],n=!0,o=!1,a="",s=0;s<t.length;++s){var u=t.charAt(s);o?(a+=u,o=!1):"\\"===u?o=!0:n&&"#"===u?(i=a,n=!1,a=""):n||"."!==u?a+=u:(r.push(a),a="")}return r.push(a),new l(e,i,r)},l.prototype.getValue=function(e,t){return s(this).getValue(e,t)},l.prototype.getValueInReferenceFrame=function(e,t,i){return s(this).getValueInReferenceFrame(e,t,i)},l.prototype.getType=function(e){return s(this).getType(e)},l.prototype.equals=function(e){if(this===e)return!0;var t=this._targetPropertyNames,i=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==i.length)return!1;for(var r=this._targetPropertyNames.length,n=0;r>n;n++)if(t[n]!==i[n])return!1;return!0},l.prototype._onTargetEntityDefinitionChanged=function(e,t,i,r){this._targetPropertyNames[0]===t&&(this._resolveProperty=!0,this._definitionChanged.raiseEvent(this))},l.prototype._onCollectionChanged=function(t,i,r){var n=this._targetEntity;e(n)&&(-1!==r.indexOf(n)?(n.definitionChanged.removeEventListener(l.prototype._onTargetEntityDefinitionChanged,this),this._resolveEntity=!0,this._resolveProperty=!0):this._resolveEntity&&(s(this),this._resolveEntity||this._definitionChanged.raiseEvent(this)))},l}),i("DataSources/Rotation",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Math"],function(e,t,i,r){"use strict";var n={packedLength:1,pack:function(t,i,r){r=e(r,0),i[r]=t},unpack:function(t,i,r){return i=e(i,0),t[i]},convertPackedArrayForInterpolation:function(t,i,n,o){i=e(i,0),n=e(n,t.length);for(var a,s=0,l=n-i+1;l>s;s++){var u=t[i+s];0===s||Math.abs(a-u)<Math.PI?o[s]=u:o[s]=u-r.TWO_PI,a=u}},unpackInterpolationResult:function(e,t,i,n,o){return o=e[0],0>o?o+r.TWO_PI:o}};return n}),i("DataSources/SampledProperty",["../Core/binarySearch","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ExtrapolationType","../Core/JulianDate","../Core/LinearApproximation"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e,t,i){var r,n=e.length,o=i.length,a=n+o;if(e.length=a,n!==t){var s=n-1;for(r=a-1;r>=t;r--)e[r]=e[s--]}for(r=0;o>r;r++)e[t++]=i[r]}function c(e,t){return e instanceof s?e:"string"==typeof e?s.fromIso8601(e):s.addSeconds(t,e,new s)}function h(t,r,n,o,a){for(var l,h,d,m,v,g,_=0;_<o.length;){v=c(o[_],t),d=e(r,v,s.compare);var y=0,C=0;if(0>d){for(d=~d,m=d*a,h=void 0,g=r[d];_<o.length&&(v=c(o[_],t),!(i(h)&&s.compare(h,v)>=0||i(g)&&s.compare(v,g)>=0));){for(p[y++]=v,_+=1,l=0;a>l;l++)f[C++]=o[_],_+=1;h=v}y>0&&(f.length=C,u(n,m,f),p.length=y,u(r,d,p))}else{for(l=0;a>l;l++)_++,n[d*a+l]=o[_];_++}}}function d(e,r){var n=e;n===Number&&(n=m);var s,u=n.packedLength,c=t(n.packedInterpolationLength,u),h=0;if(i(r)){var d=r.length;s=new Array(d);for(var p=0;d>p;p++){var f=r[p];f===Number&&(f=m);var v=f.packedLength;u+=v,c+=t(f.packedInterpolationLength,v),s[p]=f}h=d}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=l,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=u,this._packedInterpolationLength=c,this._updateTableLength=!0,this._interpolationResult=new Array(c),this._definitionChanged=new o,this._derivativeTypes=r,this._innerDerivativeTypes=s,this._inputOrder=h,this._forwardExtrapolationType=a.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=a.NONE,this._backwardExtrapolationDuration=0}var m={packedLength:1,pack:function(e,i,r){r=t(r,0),i[r]=e},unpack:function(e,i,r){return i=t(i,0),e[i]}},p=[],f=[];return r(d.prototype,{isConstant:{get:function(){return 0===this._values.length}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}}),d.prototype.getValue=function(t,r){var n=this._times,o=n.length;if(0!==o){var l,u=this._innerType,c=this._values,h=e(n,t,s.compare);if(0>h){if(h=~h,0===h){var d=n[h];if(l=this._backwardExtrapolationDuration,this._backwardExtrapolationType===a.NONE||0!==l&&s.secondsDifference(d,t)>l)return;if(this._backwardExtrapolationType===a.HOLD)return u.unpack(c,0,r)}if(h>=o){h=o-1;var m=n[h];if(l=this._forwardExtrapolationDuration,this._forwardExtrapolationType===a.NONE||0!==l&&s.secondsDifference(t,m)>l)return;if(this._forwardExtrapolationType===a.HOLD)return h=o-1,u.unpack(c,h*u.packedLength,r)}var p=this._xTable,f=this._yTable,v=this._interpolationAlgorithm,g=this._packedInterpolationLength,_=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;var y=Math.min(v.getRequiredDataPoints(this._interpolationDegree,_),o);y!==this._numberOfPoints&&(this._numberOfPoints=y,p.length=y,f.length=y*g)}var C=this._numberOfPoints-1;if(1>C)return;var E=0,S=o-1,w=S-E+1;if(w>=C+1){var T=h-(C/2|0)-1;E>T&&(T=E);var x=T+C;x>S&&(x=S,T=x-C,E>T&&(T=E)),E=T,S=x}for(var b=S-E+1,A=0;b>A;++A)p[A]=s.secondsDifference(n[E+A],n[S]);if(i(u.convertPackedArrayForInterpolation))u.convertPackedArrayForInterpolation(c,E,S,f);else for(var P=0,I=this._packedLength,M=E*I,D=(S+1)*I;D>M;)f[P]=c[M],M++,P++;var R,O=s.secondsDifference(t,n[S]);if(0!==_&&i(v.interpolate)){var N=Math.floor(g/(_+1));R=v.interpolate(O,p,f,N,_,_,this._interpolationResult)}else R=v.interpolateOrderZero(O,p,f,g,this._interpolationResult);return i(u.unpackInterpolationResult)?u.unpackInterpolationResult(R,c,E,S,r):u.unpack(R,0,r)}return u.unpack(c,h*this._packedLength,r)}},d.prototype.setInterpolationOptions=function(e){var t=!1,i=e.interpolationAlgorithm,r=e.interpolationDegree;this._interpolationAlgorithm!==i&&(this._interpolationAlgorithm=i,t=!0),this._interpolationDegree!==r&&(this._interpolationDegree=r,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))},d.prototype.addSample=function(e,t,r){var n=this._innerDerivativeTypes,o=i(n),a=this._innerType,s=[];if(s.push(e),a.pack(t,s,s.length),o)for(var l=n.length,u=0;l>u;u++)n[u].pack(r[u],s,s.length);h(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},d.prototype.addSamples=function(e,t,r){for(var n=this._innerDerivativeTypes,o=i(n),a=this._innerType,s=e.length,l=[],u=0;s>u;u++)if(l.push(e[u]),a.pack(t[u],l,l.length),o)for(var c=r[u],d=n.length,m=0;d>m;m++)n[m].pack(c[m],l,l.length);h(void 0,this._times,this._values,l,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},d.prototype.addSamplesPackedArray=function(e,t){h(t,this._times,this._values,e,this._packedLength), +this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},d.prototype.equals=function(e){if(this===e)return!0;if(!i(e))return!1;if(this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;var t=this._derivativeTypes,r=i(t),n=e._derivativeTypes,o=i(n);if(r!==o)return!1;var a,l;if(r){if(l=t.length,l!==n.length)return!1;for(a=0;l>a;a++)if(t[a]!==n[a])return!1}var u=this._times,c=e._times;if(l=u.length,l!==c.length)return!1;for(a=0;l>a;a++)if(!s.equals(u[a],c[a]))return!1;var h=this._values,d=e._values;for(a=0;l>a;a++)if(h[a]!==d[a])return!1;return!0},d._mergeNewSamples=h,d}),i("DataSources/SampledPositionProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./PositionProperty","./Property","./SampledProperty"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(i,r){r=t(r,0);var n;if(r>0){n=new Array(r);for(var s=0;r>s;s++)n[s]=e}this._numberOfDerivatives=r,this._property=new u(e,n),this._definitionChanged=new o,this._referenceFrame=t(i,a.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}return r(c.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}}),c.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,a.FIXED,t)},c.prototype.getValueInReferenceFrame=function(e,t,r){return r=this._property.getValue(e,r),i(r)?s.convertToReferenceFrame(e,r,this._referenceFrame,t,r):void 0},c.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)},c.prototype.addSample=function(e,t,i){this._numberOfDerivatives;this._property.addSample(e,t,i)},c.prototype.addSamples=function(e,t,i){this._property.addSamples(e,t,i)},c.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)},c.prototype.equals=function(e){return this===e||e instanceof c&&l.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame},c}),i("DataSources/StripeOrientation",["../Core/freezeObject"],function(e){"use strict";var t={HORIZONTAL:0,VERTICAL:1};return e(t)}),i("DataSources/StripeMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property","./StripeOrientation"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}var u=s.HORIZONTAL,c=e.WHITE,h=e.BLACK,d=0,m=1;return r(l.prototype,{isConstant:{get:function(){return a.isConstant(this._orientation)&&a.isConstant(this._evenColor)&&a.isConstant(this._oddColor)&&a.isConstant(this._offset)&&a.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:o("orientation"),evenColor:o("evenColor"),oddColor:o("oddColor"),offset:o("offset"),repeat:o("repeat")}),l.prototype.getType=function(e){return"Stripe"},l.prototype.getValue=function(e,t){return i(t)||(t={}),t.horizontal=a.getValueOrDefault(this._orientation,e,u)===s.HORIZONTAL,t.evenColor=a.getValueOrClonedDefault(this._evenColor,e,c,t.evenColor),t.oddColor=a.getValueOrClonedDefault(this._oddColor,e,h,t.oddColor),t.offset=a.getValueOrDefault(this._offset,e,d),t.repeat=a.getValueOrDefault(this._repeat,e,m),t},l.prototype.equals=function(e){return this===e||e instanceof l&&a.equals(this._orientation,e._orientation)&&a.equals(this._evenColor,e._evenColor)&&a.equals(this._oddColor,e._oddColor)&&a.equals(this._offset,e._offset)&&a.equals(this._repeat,e._repeat)},l}),i("DataSources/TimeIntervalCollectionPositionProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","../Core/TimeIntervalCollection","./PositionProperty","./Property"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t){this._definitionChanged=new n,this._intervals=new a,this._intervals.changedEvent.addEventListener(u.prototype._intervalsChanged,this),this._referenceFrame=e(t,o.FIXED)}return i(u.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}}),u.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,o.FIXED,t)},u.prototype.getValueInReferenceFrame=function(e,i,r){var n=this._intervals.findDataForIntervalContainingDate(e);return t(n)?s.convertToReferenceFrame(e,n,this._referenceFrame,i,r):void 0},u.prototype.equals=function(e){return this===e||e instanceof u&&this._intervals.equals(e._intervals,l.equals)&&this._referenceFrame===e._referenceFrame},u.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)},u}),i("DataSources/TimeIntervalCollectionProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/TimeIntervalCollection","./Property"],function(e,t,i,r,n,o){"use strict";function a(){this._definitionChanged=new r,this._intervals=new n,this._intervals.changedEvent.addEventListener(a.prototype._intervalsChanged,this)}return t(a.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),a.prototype.getValue=function(t,i){var r=this._intervals.findDataForIntervalContainingDate(t);return e(r)&&"function"==typeof r.clone?r.clone(i):r},a.prototype.equals=function(e){return this===e||e instanceof a&&this._intervals.equals(e._intervals,o.equals)},a.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)},a}),i("DataSources/CzmlDataSource",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/ClockRange","../Core/ClockStep","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/ExtrapolationType","../Core/getAbsoluteUri","../Core/getFilenameFromUri","../Core/HermitePolynomialApproximation","../Core/isArray","../Core/Iso8601","../Core/JulianDate","../Core/LagrangePolynomialApproximation","../Core/LinearApproximation","../Core/loadJson","../Core/Math","../Core/Quaternion","../Core/Rectangle","../Core/ReferenceFrame","../Core/RuntimeError","../Core/Spherical","../Core/TimeInterval","../Core/TimeIntervalCollection","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/VerticalOrigin","../ThirdParty/Uri","../ThirdParty/when","./BillboardGraphics","./ColorMaterialProperty","./CompositeMaterialProperty","./CompositePositionProperty","./CompositeProperty","./ConstantPositionProperty","./ConstantProperty","./DataSource","./DataSourceClock","./EllipseGraphics","./EllipsoidGraphics","./EntityCollection","./GridMaterialProperty","./ImageMaterialProperty","./LabelGraphics","./ModelGraphics","./NodeTransformationProperty","./PathGraphics","./PointGraphics","./PolygonGraphics","./PolylineGlowMaterialProperty","./PolylineGraphics","./PolylineOutlineMaterialProperty","./PositionPropertyArray","./PropertyBag","./RectangleGraphics","./ReferenceProperty","./Rotation","./SampledPositionProperty","./SampledProperty","./StripeMaterialProperty","./StripeOrientation","./TimeIntervalCollectionPositionProperty","./TimeIntervalCollectionProperty","./WallGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O,N,L,F,B,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,he,de,me,pe,fe,ve){"use strict";function ge(e,t){return"#"===t[0]&&(t=ot+t),le.fromString(e,t)}function _e(e){var t=e.rgbaf;if(l(t))return t;var i=e.rgba;if(l(i)){if(i.length===o.length)return[o.byteToFloat(i[0]),o.byteToFloat(i[1]),o.byteToFloat(i[2]),o.byteToFloat(i[3])];var r=i.length;t=new Array(r);for(var n=0;r>n;n+=5)t[n]=i[n],t[n+1]=o.byteToFloat(i[n+1]),t[n+2]=o.byteToFloat(i[n+2]),t[n+3]=o.byteToFloat(i[n+3]),t[n+4]=o.byteToFloat(i[n+4]);return t}}function ye(e,t){var i=s(e.uri,e);return l(t)&&(i=p(i,p(t))),i}function Ce(e){var t=e.wsenDegrees;if(l(t)){for(var i=t.length,r=0;i>r;r++)t[r]=w.toRadians(t[r]);return t}return e.wsen}function Ee(e){if(l(e.cartesian))return e.cartesian;if(l(e.cartesianVelocity))return e.cartesianVelocity;if(l(e.unitCartesian))return e.unitCartesian;var i,r,n,o=e.unitSpherical;if(l(o)){if(r=o.length,2===r)st.clock=o[0],st.cone=o[1],t.fromSpherical(st,at),n=[at.x,at.y,at.z];else{var a=0;for(n=new Array(r/3*4),i=0;r>i;i+=4)n[i]=o[a++],st.clock=o[a++],st.cone=o[a++],t.fromSpherical(st,at),n[i+1]=at.x,n[i+2]=at.y,n[i+3]=at.z}return n}var s=e.cartographicRadians;if(l(s)){if(3===s.length)lt.longitude=s[0],lt.latitude=s[1],lt.height=s[2],h.WGS84.cartographicToCartesian(lt,at),n=[at.x,at.y,at.z];else for(r=s.length,n=new Array(r),i=0;r>i;i+=4)lt.longitude=s[i+1],lt.latitude=s[i+2],lt.height=s[i+3],h.WGS84.cartographicToCartesian(lt,at),n[i]=s[i],n[i+1]=at.x,n[i+2]=at.y,n[i+3]=at.z;return n}var u=e.cartographicDegrees;if(!l(u))throw new A(JSON.stringify(e)+" is not a valid CZML interval.");if(3===u.length)lt.longitude=w.toRadians(u[0]),lt.latitude=w.toRadians(u[1]),lt.height=u[2],h.WGS84.cartographicToCartesian(lt,at),n=[at.x,at.y,at.z];else for(r=u.length,n=new Array(r),i=0;r>i;i+=4)lt.longitude=w.toRadians(u[i+1]),lt.latitude=w.toRadians(u[i+2]),lt.height=u[i+3],h.WGS84.cartographicToCartesian(lt,at),n[i]=u[i],n[i+1]=at.x,n[i+2]=at.y,n[i+3]=at.z;return n}function Se(e,t){var i=e[t],r=e[t+1],n=e[t+2],o=e[t+3],a=1/Math.sqrt(i*i+r*r+n*n+o*o);e[t]=i*a,e[t+1]=r*a,e[t+2]=n*a,e[t+3]=o*a}function we(e){var t=e.unitQuaternion;if(l(t)){if(4===t.length)return Se(t,0),t;for(var i=1;i<t.length;i+=5)Se(t,i)}return t}function Te(i,r,n){switch(i){case Boolean:return s(r["boolean"],r);case e:return r.cartesian2;case t:return Ee(r);case o:return _e(r);case me:return me[s(r.stripeOrientation,r)];case D:return D[s(r.horizontalOrigin,r)];case Image:return ye(r,n);case y:return y.fromIso8601(s(r.date,r));case R:return R[s(r.labelStyle,r)];case ue:return s(r.number,r);case Number:return s(r.number,r);case String:return s(r.string,r);case Array:return r.array;case T:return we(r);case x:return Ce(r);case N:return ye(r,n);case O:return O[s(r.verticalOrigin,r)];default:throw new A(i)}}function xe(e,t){var i=e.interpolationAlgorithm;(l(i)||l(e.interpolationDegree))&&t.setInterpolationOptions({interpolationAlgorithm:ct[i],interpolationDegree:e.interpolationDegree});var r=e.forwardExtrapolationType;l(r)&&(t.forwardExtrapolationType=m[r]);var n=e.forwardExtrapolationDuration;l(n)&&(t.forwardExtrapolationDuration=n);var o=e.backwardExtrapolationType;l(o)&&(t.backwardExtrapolationType=m[o]);var a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}function be(e,t,i,r,n,o,a){var u,c=r.interval;l(c)?(ht.iso8601=c,u=I.fromIso8601(ht),l(n)&&(u=I.intersect(u,n,ut))):l(n)&&(u=n);var h,d,m,p,f=l(r.reference),v=l(u)&&!u.equals(_.MAXIMUM_INTERVAL);f||(m=Te(e,r,o),h=s(e.packedLength,1),p=s(m.length,1),d=!l(r.array)&&"string"!=typeof m&&p>h);var g="function"==typeof e.unpack&&e!==ue;if(!d&&!v)return void(f?t[i]=ge(a,r.reference):g?t[i]=new G(e.unpack(m,0)):t[i]=new G(m));var C,E=t[i],S=r.epoch;if(l(S)&&(C=y.fromIso8601(S)),d&&!v)return E instanceof he||(E=new he(e),t[i]=E),E.addSamplesPackedArray(m,C),void xe(r,E);var w;if(!d&&v)return u=u.clone(),f?u.data=ge(a,r.reference):g?u.data=e.unpack(m,0):u.data=m,l(E)||(E=f?new z:new fe,t[i]=E),void(!f&&E instanceof fe?E.intervals.addInterval(u):E instanceof z?(u.data=f?u.data:new G(u.data),E.intervals.addInterval(u)):(w=_.MAXIMUM_INTERVAL.clone(),w.data=E,E=new z,t[i]=E,E.intervals.addInterval(w),u.data=f?u.data:new G(u.data),E.intervals.addInterval(u)));l(E)||(E=new z,t[i]=E),E instanceof z||(w=_.MAXIMUM_INTERVAL.clone(),w.data=E,E=new z,t[i]=E,E.intervals.addInterval(w));var T=E.intervals;w=T.findInterval(u),l(w)&&w.data instanceof he||(w=u.clone(),w.data=new he(e),T.addInterval(w)),w.data.addSamplesPackedArray(m,C),xe(r,w.data)}function Ae(e,t,i,r,n,o,a){if(l(r))if(g(r))for(var s=0,u=r.length;u>s;s++)be(e,t,i,r[s],n,o,a);else be(e,t,i,r,n,o,a)}function Pe(e,i,r,n,o,a){var u,c=r.interval;l(c)?(ht.iso8601=c,u=I.fromIso8601(ht),l(n)&&(u=I.intersect(u,n,ut))):l(n)&&(u=n);var h,d,m,p=!1,f=l(r.cartesianVelocity)?1:0,v=t.packedLength*(f+1),g=l(r.reference),C=l(u)&&!u.equals(_.MAXIMUM_INTERVAL);if(g||(l(r.referenceFrame)&&(h=b[r.referenceFrame]),h=s(h,b.FIXED),d=Ee(r),m=s(d.length,1),p=m>v),!p&&!C)return void(g?e[i]=ge(a,r.reference):e[i]=new U(t.unpack(d),h));var E,S=e[i],w=r.epoch;if(l(w)&&(E=y.fromIso8601(w)),p&&!C)return(!(S instanceof ce)||l(h)&&S.referenceFrame!==h)&&(S=new ce(h,f),e[i]=S),S.addSamplesPackedArray(d,E),void xe(r,S);var T;if(!p&&C)return u=u.clone(),g?u.data=ge(a,r.reference):u.data=t.unpack(d),l(S)||(S=g?new k(h):new pe(h),e[i]=S),void(!g&&S instanceof pe&&l(h)&&S.referenceFrame===h?S.intervals.addInterval(u):S instanceof k?(u.data=g?u.data:new U(u.data,h),S.intervals.addInterval(u)):(T=_.MAXIMUM_INTERVAL.clone(),T.data=S,S=new k(S.referenceFrame),e[i]=S,S.intervals.addInterval(T),u.data=g?u.data:new U(u.data,h),S.intervals.addInterval(u)));l(S)?S instanceof k||(T=_.MAXIMUM_INTERVAL.clone(),T.data=S,S=new k(S.referenceFrame),e[i]=S,S.intervals.addInterval(T)):(S=new k(h),e[i]=S);var x=S.intervals;T=x.findInterval(u),l(T)&&T.data instanceof ce&&(!l(h)||T.data.referenceFrame===h)||(T=u.clone(),T.data=new ce(h,f),x.addInterval(T)),T.data.addSamplesPackedArray(d,E),xe(r,T.data)}function Ie(e,t,i,r,n,o){if(l(i))if(g(i))for(var a=0,s=i.length;s>a;a++)Pe(e,t,i[a],r,n,o);else Pe(e,t,i,r,n,o)}function Me(t,i,r,n,a,s){var u,c=r.interval;l(c)?(ht.iso8601=c,u=I.fromIso8601(ht),l(n)&&(u=I.intersect(u,n,ut))):l(n)&&(u=n);var h,d,m=t[i];if(l(u)){m instanceof V||(m=new V,t[i]=m);var p=m.intervals;d=p.findInterval({start:u.start,stop:u.stop}),l(d)?h=d.data:(d=u.clone(),p.addInterval(d))}else h=m;var f;l(r.solidColor)?(h instanceof B||(h=new B),f=r.solidColor,Ae(o,h,"color",f.color,void 0,void 0,s)):l(r.grid)?(h instanceof X||(h=new X),f=r.grid,Ae(o,h,"color",f.color,void 0,a,s),Ae(Number,h,"cellAlpha",f.cellAlpha,void 0,a,s),Ae(e,h,"lineThickness",f.lineThickness,void 0,a,s),Ae(e,h,"lineOffset",f.lineOffset,void 0,a,s),Ae(e,h,"lineCount",f.lineCount,void 0,a,s)):l(r.image)?(h instanceof Z||(h=new Z),f=r.image,Ae(Image,h,"image",f.image,void 0,a,s),Ae(e,h,"repeat",f.repeat,void 0,a,s),Ae(Number,h,"alpha",f.alpha,void 0,a,s)):l(r.stripe)?(h instanceof de||(h=new de),f=r.stripe,Ae(me,h,"orientation",f.orientation,void 0,a,s),Ae(o,h,"evenColor",f.evenColor,void 0,a,s),Ae(o,h,"oddColor",f.oddColor,void 0,a,s),Ae(Number,h,"offset",f.offset,void 0,a,s),Ae(Number,h,"repeat",f.repeat,void 0,a,s)):l(r.polylineOutline)?(h instanceof ne||(h=new ne),f=r.polylineOutline,Ae(o,h,"color",f.color,void 0,a,s),Ae(o,h,"outlineColor",f.outlineColor,void 0,a,s),Ae(Number,h,"outlineWidth",f.outlineWidth,void 0,a,s)):l(r.polylineGlow)&&(h instanceof ie||(h=new ie),f=r.polylineGlow,Ae(o,h,"color",f.color,void 0,a,s),Ae(Number,h,"glowPower",f.glowPower,void 0,a,s)),l(d)?d.data=h:t[i]=h}function De(e,t,i,r,n,o){if(l(i))if(g(i))for(var a=0,s=i.length;s>a;a++)Me(e,t,i[a],r,n,o);else Me(e,t,i,r,n,o)}function Re(e,t,i,r){e.name=s(t.name,e.name)}function Oe(e,t,i,r){var n=t.description;l(n)&&Ae(String,e,"description",n,void 0,r,i)}function Ne(e,t,i,r){var n=t.position;l(n)&&Ie(e,"position",n,void 0,r,i)}function Le(e,i,r,n){var o=i.viewFrom;l(o)&&Ae(t,e,"viewFrom",o,void 0,n,r)}function Fe(e,t,i,r){var n=t.orientation;l(n)&&Ae(T,e,"orientation",n,void 0,r,i)}function Be(e,i,r,n){var o,a,s=r.references;if(l(s)){var u=[];for(o=0,a=s.length;a>o;o++)u.push(ge(n,s[o]));var c=r.interval;if(l(c)){if(c=I.fromIso8601(c),!(e[i]instanceof k)){c.data=new oe(u);var d=new k;d.intervals.addInterval(c),e[i]=d}}else e[i]=new oe(u)}else{var m=[],p=r.cartesian;if(l(p)){for(o=0,a=p.length;a>o;o+=3)m.push(new t(p[o],p[o+1],p[o+2]));r.array=m}else if(p=r.cartographicRadians,l(p)){for(o=0,a=p.length;a>o;o+=3)lt.longitude=p[o],lt.latitude=p[o+1],lt.height=p[o+2],m.push(h.WGS84.cartographicToCartesian(lt));r.array=m}else if(p=r.cartographicDegrees,l(p)){for(o=0,a=p.length;a>o;o+=3)m.push(t.fromDegrees(p[o],p[o+1],p[o+2]));r.array=m}l(r.array)&&Ae(Array,e,i,r,void 0,void 0,n)}}function Ve(e,t,i,r){if(l(i))if(g(i))for(var n=i.length,o=0;n>o;o++)Be(e,t,i[o],r);else Be(e,t,i,r)}function ke(e,t,i,r){var n,o=t.availability;if(l(o)){var a;if(g(o))for(var s=o.length,u=0;s>u;u++)l(a)||(a=new M),ht.iso8601=o[u],n=I.fromIso8601(ht),a.addInterval(n);else ht.iso8601=o,n=I.fromIso8601(ht),a=new M,a.addInterval(n);e.availability=a}}function ze(i,r,n,a){var s=r.billboard;if(l(s)){var u,c=s.interval;l(c)&&(ht.iso8601=c,u=I.fromIso8601(ht));var h=i.billboard;l(h)||(i.billboard=h=new F),Ae(o,h,"color",s.color,u,a,n),Ae(t,h,"eyeOffset",s.eyeOffset,u,a,n),Ae(D,h,"horizontalOrigin",s.horizontalOrigin,u,a,n),Ae(Image,h,"image",s.image,u,a,n),Ae(e,h,"pixelOffset",s.pixelOffset,u,a,n),Ae(Number,h,"scale",s.scale,u,a,n),Ae(ue,h,"rotation",s.rotation,u,a,n),Ae(t,h,"alignedAxis",s.alignedAxis,u,a,n),Ae(Boolean,h,"show",s.show,u,a,n),Ae(O,h,"verticalOrigin",s.verticalOrigin,u,a,n),Ae(Boolean,h,"sizeInMeters",s.sizeInMeters,u,a,n)}}function Ue(e,t){var i=e.version;if(l(i)&&"string"==typeof i){var r=i.split(".");if(2===r.length){if("1"!==r[0])throw new A("Cesium only supports CZML version 1.");t._version=i}}if(!l(t._version))throw new A("CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.");var n=t._documentPacket;l(e.name)&&(n.name=e.name);var o=e.clock;if(l(o)){var a=n.clock;l(a)?(a.interval=s(o.interval,a.interval),a.currentTime=s(o.currentTime,a.currentTime),a.range=s(o.range,a.range),a.step=s(o.step,a.step),a.multiplier=s(o.multiplier,a.multiplier)):n.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function Ge(e,t,i,r){var n=t.ellipse;if(l(n)){var a,s=n.interval;l(s)&&(ht.iso8601=s,a=I.fromIso8601(ht));var u=e.ellipse;l(u)||(e.ellipse=u=new q),Ae(Boolean,u,"show",n.show,a,r,i),Ae(ue,u,"rotation",n.rotation,a,r,i),Ae(Number,u,"semiMajorAxis",n.semiMajorAxis,a,r,i),Ae(Number,u,"semiMinorAxis",n.semiMinorAxis,a,r,i),Ae(Number,u,"height",n.height,a,r,i),Ae(Number,u,"extrudedHeight",n.extrudedHeight,a,r,i),Ae(Number,u,"granularity",n.granularity,a,r,i),Ae(ue,u,"stRotation",n.stRotation,a,r,i),De(u,"material",n.material,a,r,i),Ae(Boolean,u,"fill",n.fill,a,r,i),Ae(Boolean,u,"outline",n.outline,a,r,i),Ae(o,u,"outlineColor",n.outlineColor,a,r,i),Ae(Number,u,"outlineWidth",n.outlineWidth,a,r,i),Ae(Number,u,"numberOfVerticalLines",n.numberOfVerticalLines,a,r,i)}}function We(e,i,r,n){var a=i.ellipsoid;if(l(a)){var s,u=a.interval;l(u)&&(ht.iso8601=u,s=I.fromIso8601(ht));var c=e.ellipsoid;l(c)||(e.ellipsoid=c=new j),Ae(Boolean,c,"show",a.show,s,n,r),Ae(t,c,"radii",a.radii,s,n,r),De(c,"material",a.material,s,n,r),Ae(Boolean,c,"fill",a.fill,s,n,r),Ae(Boolean,c,"outline",a.outline,s,n,r),Ae(o,c,"outlineColor",a.outlineColor,s,n,r),Ae(Number,c,"outlineWidth",a.outlineWidth,s,n,r)}}function He(i,r,n,a){var s=r.label;if(l(s)){var u,c=s.interval;l(c)&&(ht.iso8601=c,u=I.fromIso8601(ht));var h=i.label;l(h)||(i.label=h=new K),Ae(o,h,"fillColor",s.fillColor,u,a,n),Ae(o,h,"outlineColor",s.outlineColor,u,a,n),Ae(Number,h,"outlineWidth",s.outlineWidth,u,a,n),Ae(t,h,"eyeOffset",s.eyeOffset,u,a,n),Ae(D,h,"horizontalOrigin",s.horizontalOrigin,u,a,n),Ae(String,h,"text",s.text,u,a,n),Ae(e,h,"pixelOffset",s.pixelOffset,u,a,n),Ae(Number,h,"scale",s.scale,u,a,n),Ae(Boolean,h,"show",s.show,u,a,n),Ae(O,h,"verticalOrigin",s.verticalOrigin,u,a,n),Ae(String,h,"font",s.font,u,a,n),Ae(R,h,"style",s.style,u,a,n)}}function qe(e,t,i,r){var n=t.model;if(l(n)){var o,a=n.interval;l(a)&&(ht.iso8601=a,o=I.fromIso8601(ht));var s=e.model;l(s)||(e.model=s=new Q),Ae(Boolean,s,"show",n.show,o,r,i),Ae(Number,s,"scale",n.scale,o,r,i),Ae(Number,s,"minimumPixelSize",n.minimumPixelSize,o,r,i),Ae(Boolean,s,"incrementallyLoadTextures",n.incrementallyLoadTextures,o,r,i),Ae(N,s,"uri",n.gltf,o,r,i),Ae(Boolean,s,"runAnimations",n.runAnimations,o,r,i);var u=n.nodeTransformations;if(l(u))if(g(u))for(var c=0,h=u.length;h>c;c++)je(s,u[c],o,r,i);else je(s,u,o,r,i)}}function je(e,i,r,n,o){var a,s=i.interval;l(s)?(ht.iso8601=s,a=I.fromIso8601(ht),l(r)&&(a=I.intersect(a,r,ut))):l(r)&&(a=r);for(var u=e.nodeTransformations,c=Object.keys(i),h=0,d=c.length;d>h;++h){var m=c[h];if("interval"!==m){var p=i[m];if(l(p)){l(u)||(e.nodeTransformations=u=new ae),u.hasProperty(m)||u.addProperty(m);var f=u[m];l(f)||(u[m]=f=new J),Ae(t,f,"translation",p.translation,a,n,o),Ae(T,f,"rotation",p.rotation,a,n,o),Ae(t,f,"scale",p.scale,a,n,o)}}}}function Ye(e,t,i,r){var n=t.path;if(l(n)){var o,a=n.interval;l(a)&&(ht.iso8601=a,o=I.fromIso8601(ht));var s=e.path;l(s)||(e.path=s=new $),Ae(Boolean,s,"show",n.show,o,r,i),Ae(Number,s,"width",n.width,o,r,i),Ae(Number,s,"resolution",n.resolution,o,r,i),Ae(Number,s,"leadTime",n.leadTime,o,r,i),Ae(Number,s,"trailTime",n.trailTime,o,r,i),De(s,"material",n.material,o,r,i)}}function Xe(e,t,i,r){var n=t.point;if(l(n)){var a,s=n.interval;l(s)&&(ht.iso8601=s,a=I.fromIso8601(ht));var u=e.point;l(u)||(e.point=u=new ee),Ae(o,u,"color",n.color,a,r,i),Ae(Number,u,"pixelSize",n.pixelSize,a,r,i),Ae(o,u,"outlineColor",n.outlineColor,a,r,i),Ae(Number,u,"outlineWidth",n.outlineWidth,a,r,i),Ae(Boolean,u,"show",n.show,a,r,i)}}function Ze(e,t,i,r){var n=t.polygon;if(l(n)){var a,s=n.interval;l(s)&&(ht.iso8601=s,a=I.fromIso8601(ht));var u=e.polygon;l(u)||(e.polygon=u=new te),Ae(Boolean,u,"show",n.show,a,r,i),De(u,"material",n.material,a,r,i),Ae(Number,u,"height",n.height,a,r,i),Ae(Number,u,"extrudedHeight",n.extrudedHeight,a,r,i),Ae(Number,u,"granularity",n.granularity,a,r,i),Ae(ue,u,"stRotation",n.stRotation,a,r,i),Ae(Boolean,u,"fill",n.fill,a,r,i),Ae(Boolean,u,"outline",n.outline,a,r,i),Ae(o,u,"outlineColor",n.outlineColor,a,r,i),Ae(Number,u,"outlineWidth",n.outlineWidth,a,r,i),Ae(Boolean,u,"perPositionHeight",n.perPositionHeight,a,r,i),Ve(u,"hierarchy",n.positions,i)}}function Ke(e,t,i,r){var n=t.rectangle;if(l(n)){var a,s=n.interval;l(s)&&(ht.iso8601=s,a=I.fromIso8601(ht));var u=e.rectangle;l(u)||(e.rectangle=u=new se),Ae(Boolean,u,"show",n.show,a,r,i),Ae(x,u,"coordinates",n.coordinates,a,r,i),De(u,"material",n.material,a,r,i),Ae(Number,u,"height",n.height,a,r,i),Ae(Number,u,"extrudedHeight",n.extrudedHeight,a,r,i),Ae(Number,u,"granularity",n.granularity,a,r,i),Ae(ue,u,"rotation",n.rotation,a,r,i),Ae(ue,u,"stRotation",n.stRotation,a,r,i),Ae(Boolean,u,"fill",n.fill,a,r,i),Ae(Boolean,u,"outline",n.outline,a,r,i),Ae(o,u,"outlineColor",n.outlineColor,a,r,i),Ae(Number,u,"outlineWidth",n.outlineWidth,a,r,i),Ae(Boolean,u,"closeBottom",n.closeBottom,a,r,i),Ae(Boolean,u,"closeTop",n.closeTop,a,r,i)}}function Qe(e,t,i,r){var n=t.wall;if(l(n)){var a,s=n.interval;l(s)&&(ht.iso8601=s,a=I.fromIso8601(ht));var u=e.wall;l(u)||(e.wall=u=new ve),Ae(Boolean,u,"show",n.show,a,r,i),De(u,"material",n.material,a,r,i),Ae(Array,u,"minimumHeights",n.minimumHeights,a,r,i),Ae(Array,u,"maximumHeights",n.maximumHeights,a,r,i),Ae(Number,u,"granularity",n.granularity,a,r,i),Ae(Boolean,u,"fill",n.fill,a,r,i),Ae(Boolean,u,"outline",n.outline,a,r,i),Ae(o,u,"outlineColor",n.outlineColor,a,r,i),Ae(Number,u,"outlineWidth",n.outlineWidth,a,r,i),Ve(u,"positions",n.positions,i)}}function Je(e,t,i,r){var n=t.polyline;if(l(n)){var o,a=n.interval;l(a)&&(ht.iso8601=a,o=I.fromIso8601(ht));var s=e.polyline;l(s)||(e.polyline=s=new re),Ae(Boolean,s,"show",n.show,o,r,i),Ae(Number,s,"width",n.width,o,r,i),De(s,"material",n.material,o,r,i),Ae(Boolean,s,"followSurface",n.followSurface,o,r,i),Ae(Number,s,"granularity",n.granularity,o,r,i),Ve(s,"positions",n.positions,i)}}function $e(e,t,i,r,n){var o=e.id;if(l(o)||(o=a()),ot=o,!l(n._version)&&"document"!==o)throw new A("The first CZML packet is required to be the document object.");if(e["delete"]===!0)t.removeById(o);else if("document"===o)Ue(e,n);else{var s=t.getOrCreateEntity(o),u=e.parent;l(u)&&(s.parent=t.getOrCreateEntity(u));for(var c=i.length-1;c>-1;c--)i[c](s,e,t,r)}ot=void 0}function et(e){var t,i=e._documentPacket.clock;if(!l(i)){if(!l(e._clock)){var o=e._entityCollection.computeAvailability();if(!o.start.equals(_.MINIMUM_VALUE)){var a=o.start,u=o.stop,c=y.secondsDifference(u,a),h=Math.round(c/120);return t=new H,t.startTime=y.clone(a),t.stopTime=y.clone(u),t.clockRange=r.LOOP_STOP,t.multiplier=h,t.currentTime=y.clone(a),t.clockStep=n.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}if(l(e._clock)?t=e._clock.clone():(t=new H,t.startTime=_.MINIMUM_VALUE.clone(),t.stopTime=_.MAXIMUM_VALUE.clone(),t.currentTime=_.MINIMUM_VALUE.clone(),t.clockRange=r.LOOP_STOP,t.clockStep=n.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1),l(i.interval)){ht.iso8601=i.interval;var d=I.fromIso8601(ht);t.startTime=d.start,t.stopTime=d.stop}return l(i.currentTime)&&(t.currentTime=y.fromIso8601(i.currentTime)),l(i.range)&&(t.clockRange=s(r[i.range],r.LOOP_STOP)),l(i.step)&&(t.clockStep=s(n[i.step],n.SYSTEM_CLOCK_MULTIPLIER)),l(i.multiplier)&&(t.multiplier=i.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function tt(e,t,i,r){i=s(i,s.EMPTY_OBJECT);var n=t,o=i.sourceUri;return"string"==typeof t&&(n=S(t),o=s(o,t)),W.setLoading(e,!0),L(n,function(t){return it(e,t,o,r)}).otherwise(function(t){return W.setLoading(e,!1),e._error.raiseEvent(e,t),console.log(t),L.reject(t)})}function it(e,t,i,r){W.setLoading(e,!0);var n=e._entityCollection;r&&(e._version=void 0,e._documentPacket=new rt,n.removeAll()),nt._processCzml(t,n,i,void 0,e);var o=et(e),a=e._documentPacket;return l(a.name)&&e._name!==a.name?(e._name=a.name,o=!0):!l(e._name)&&l(i)&&(e._name=f(i),o=!0),W.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function rt(){this.name=void 0,this.clock=void 0}function nt(e){this._name=e,this._changed=new d,this._error=new d,this._isLoading=!1,this._loading=new d,this._clock=void 0,this._documentPacket=new rt,this._version=void 0,this._entityCollection=new Y(this)}var ot,at=new t,st=new P,lt=new i,ut=new I,ct={HERMITE:v,LAGRANGE:C,LINEAR:E},ht={iso8601:void 0};return nt.load=function(e,t){return(new nt).load(e,t)},u(nt.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}}}),nt.updaters=[ze,Ge,We,He,qe,Re,Oe,Ye,Xe,Ze,Je,Ke,Ne,Le,Qe,Fe,ke],nt.prototype.process=function(e,t){return tt(this,e,t,!1)},nt.prototype.load=function(e,t){return tt(this,e,t,!0)},nt.processPacketData=Ae,nt.processPositionPacketData=Ie,nt.processMaterialPacketData=De,nt._processCzml=function(e,t,i,r,n){if(r=l(r)?r:nt.updaters,g(e))for(var o=0,a=e.length;a>o;o++)$e(e[o],t,r,i,n);else $e(e,t,r,i,n)},nt}),i("DataSources/DataSourceCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../ThirdParty/when"],function(e,t,i,r,n,o,a){"use strict";function s(){this._dataSources=[],this._dataSourceAdded=new o,this._dataSourceRemoved=new o}return i(s.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}}}),s.prototype.add=function(e){var t=this,i=this._dataSources;return a(e,function(e){return i===t._dataSources&&(t._dataSources.push(e),t._dataSourceAdded.raiseEvent(t,e)),e})},s.prototype.remove=function(t,i){i=e(i,!1);var r=this._dataSources.indexOf(t);return-1!==r?(this._dataSources.splice(r,1),this._dataSourceRemoved.raiseEvent(this,t),i&&"function"==typeof t.destroy&&t.destroy(),!0):!1},s.prototype.removeAll=function(t){t=e(t,!1);for(var i=this._dataSources,r=0,n=i.length;n>r;++r){var o=i[r];this._dataSourceRemoved.raiseEvent(this,o),t&&"function"==typeof o.destroy&&o.destroy()}this._dataSources=[]},s.prototype.contains=function(e){return-1!==this.indexOf(e)},s.prototype.indexOf=function(e){return this._dataSources.indexOf(e)},s.prototype.get=function(e){return this._dataSources[e]},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this.removeAll(!0),r(this)},s}),i("DataSources/EllipseGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EllipseGeometry","../Core/EllipseOutlineGeometry","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C){"use strict";function E(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0}function S(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(S.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new E(e),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}function w(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new E(t._entity)}var T=new v(e.WHITE),x=new g(!0),b=new g(!0),A=new g(!1),P=new g(e.BLACK),I=new e;return n(S,{perInstanceColorAppearanceType:{value:p},materialAppearanceType:{value:m}}),n(S.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&C.isConstant(this._showProperty)&&C.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){ +return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&C.isConstant(this._showProperty)&&C.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},geometryChanged:{get:function(){return this._geometryChanged}}}),S.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},S.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},S.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,l=a.isAvailable(i),u=new d(l&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i));if(this._materialProperty instanceof v){var h=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(h=this._materialProperty.color.getValue(i)),o=t.fromColor(h),n={show:u,color:o}}else n={show:u};return new c({id:a,geometry:new s(this._options),attributes:n})},S.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=C.getValueOrDefault(this._outlineColorProperty,i,e.BLACK);return new c({id:r,geometry:new l(this._options),attributes:{show:new d(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o)}})},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){this._entitySubscription(),o(this)},S.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"position"===t||"ellipse"===t){var a=this._entity.ellipse;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=r(s)&&s.isConstant?s.getValue(h.MINIMUM_VALUE):!0,u=a.outline,c=r(u);if(c&&u.isConstant&&(c=u.getValue(h.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=this._entity.position,f=a.semiMajorAxis,g=a.semiMinorAxis,_=a.show;if(r(_)&&_.isConstant&&!_.getValue(h.MINIMUM_VALUE)||!r(d)||!r(f)||!r(g))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var y=i(a.material,T),E=y instanceof v;this._materialProperty=y,this._fillProperty=i(s,b),this._showProperty=i(_,x),this._showOutlineProperty=i(a.outline,A),this._outlineColorProperty=c?i(a.outlineColor,P):void 0;var S=a.rotation,w=a.height,I=a.extrudedHeight,M=a.granularity,D=a.stRotation,R=a.outlineWidth,O=a.numberOfVerticalLines;if(this._isClosed=r(I),this._fillEnabled=l,this._outlineEnabled=c,d.isConstant&&f.isConstant&&g.isConstant&&C.isConstant(S)&&C.isConstant(w)&&C.isConstant(I)&&C.isConstant(M)&&C.isConstant(D)&&C.isConstant(R)&&C.isConstant(O)){var N=this._options;N.vertexFormat=E?p.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,N.center=d.getValue(h.MINIMUM_VALUE,N.center),N.semiMajorAxis=f.getValue(h.MINIMUM_VALUE,N.semiMajorAxis),N.semiMinorAxis=g.getValue(h.MINIMUM_VALUE,N.semiMinorAxis),N.rotation=r(S)?S.getValue(h.MINIMUM_VALUE):void 0,N.height=r(w)?w.getValue(h.MINIMUM_VALUE):void 0,N.extrudedHeight=r(I)?I.getValue(h.MINIMUM_VALUE):void 0,N.granularity=r(M)?M.getValue(h.MINIMUM_VALUE):void 0,N.stRotation=r(D)?D.getValue(h.MINIMUM_VALUE):void 0,N.numberOfVerticalLines=r(O)?O.getValue(h.MINIMUM_VALUE):void 0,this._outlineWidth=r(R)?R.getValue(h.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},S.prototype.createDynamicUpdater=function(e){return new w(e,this)},w.prototype.update=function(i){var n=this._primitives;n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var o=this._geometryUpdater,a=o._entity,u=a.ellipse;if(a.isShowing&&a.isAvailable(i)&&C.getValueOrDefault(u.show,i,!0)){var h=this._options,d=C.getValueOrUndefined(a.position,i,h.center),v=C.getValueOrUndefined(u.semiMajorAxis,i),g=C.getValueOrUndefined(u.semiMinorAxis,i);if(r(d)&&r(v)&&r(g)){if(h.center=d,h.semiMajorAxis=v,h.semiMinorAxis=g,h.rotation=C.getValueOrUndefined(u.rotation,i),h.height=C.getValueOrUndefined(u.height,i),h.extrudedHeight=C.getValueOrUndefined(u.extrudedHeight,i),h.granularity=C.getValueOrUndefined(u.granularity,i),h.stRotation=C.getValueOrUndefined(u.stRotation,i),h.numberOfVerticalLines=C.getValueOrUndefined(u.numberOfVerticalLines,i),C.getValueOrDefault(u.fill,i,!0)){var _=y.getValue(i,o.fillMaterialProperty,this._material);this._material=_;var E=new m({material:_,translucent:_.isTranslucent(),closed:r(h.extrudedHeight)});h.vertexFormat=E.vertexFormat,this._primitive=n.add(new f({geometryInstances:new c({id:a,geometry:new s(h)}),appearance:E,asynchronous:!1}))}if(C.getValueOrDefault(u.outline,i,!1)){h.vertexFormat=p.VERTEX_FORMAT;var S=C.getValueOrClonedDefault(u.outlineColor,i,e.BLACK,I),w=C.getValueOrDefault(u.outlineWidth,i,1),T=1!==S.alpha;this._outlinePrimitive=n.add(new f({geometryInstances:new c({id:a,geometry:new l(h),attributes:{color:t.fromColor(S)}}),appearance:new p({flat:!0,translucent:T,renderState:{lineWidth:o._scene.clampLineWidth(w)}}),asynchronous:!1}))}}}},w.prototype.getBoundingSphere=function(e,t){return _(e,this._primitive,this._outlinePrimitive,t)},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},S}),i("DataSources/EllipsoidGeometryUpdater",["../Core/Cartesian3","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EllipsoidGeometry","../Core/EllipsoidOutlineGeometry","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/Matrix4","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/SceneMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S,w){"use strict";function T(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0}function x(e,t){this._scene=t,this._entity=e,this._entitySubscription=e.definitionChanged.addEventListener(x.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new c,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new T(e),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}function b(e,t){this._entity=t._entity,this._scene=t._scene,this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new T(t._entity),this._modelMatrix=new m,this._material=void 0,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0}var A=new y(t.WHITE),P=new C(!0),I=new C(!0),M=new C(!1),D=new C(t.BLACK),R=new e,O=new t,N=new e(1,1,1);return o(x,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:f}}),o(x.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!n(this._entity.availability)&&w.isConstant(this._showProperty)&&w.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!n(this._entity.availability)&&w.isConstant(this._showProperty)&&w.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),x.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},x.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},x.prototype.createFillGeometryInstance=function(e){var r,o,a=this._entity,s=a.isAvailable(e),u=new p(s&&a.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e));if(this._materialProperty instanceof y){var c=t.WHITE;n(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(c=this._materialProperty.color.getValue(e)),o=i.fromColor(c),r={show:u,color:o}}else r={show:u};return new h({id:a,geometry:new l(this._options),modelMatrix:a._getModelMatrix(d.MINIMUM_VALUE),attributes:r})},x.prototype.createOutlineGeometryInstance=function(e){var r=this._entity,n=r.isAvailable(e),o=w.getValueOrDefault(this._outlineColorProperty,e,t.BLACK);return new h({id:r,geometry:new u(this._options),modelMatrix:r._getModelMatrix(d.MINIMUM_VALUE),attributes:{show:new p(n&&r.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:i.fromColor(o)}})},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){this._entitySubscription(),a(this)},x.prototype._onEntityPropertyChanged=function(e,t,i,o){if("availability"===t||"position"===t||"orientation"===t||"ellipsoid"===t){var a=e.ellipsoid;if(!n(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=n(s)&&s.isConstant?s.getValue(d.MINIMUM_VALUE):!0,u=a.outline,c=n(u);if(c&&u.isConstant&&(c=u.getValue(d.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var h=e.position,m=a.radii,p=a.show;if(n(p)&&p.isConstant&&!p.getValue(d.MINIMUM_VALUE)||!n(h)||!n(m))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var g=r(a.material,A),_=g instanceof y;this._materialProperty=g,this._fillProperty=r(s,I),this._showProperty=r(p,P),this._showOutlineProperty=r(a.outline,M),this._outlineColorProperty=c?r(a.outlineColor,D):void 0,this._fillEnabled=l,this._outlineEnabled=c;var C=a.stackPartitions,E=a.slicePartitions,S=a.outlineWidth,T=a.subdivisions;if(h.isConstant&&w.isConstant(e.orientation)&&m.isConstant&&w.isConstant(C)&&w.isConstant(E)&&w.isConstant(S)&&w.isConstant(T)){var x=this._options;x.vertexFormat=_?v.VERTEX_FORMAT:f.MaterialSupport.TEXTURED.vertexFormat,x.radii=m.getValue(d.MINIMUM_VALUE,x.radii),x.stackPartitions=n(C)?C.getValue(d.MINIMUM_VALUE):void 0,x.slicePartitions=n(E)?E.getValue(d.MINIMUM_VALUE):void 0,x.subdivisions=n(T)?T.getValue(d.MINIMUM_VALUE):void 0,this._outlineWidth=n(S)?S.getValue(d.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},x.prototype.createDynamicUpdater=function(e){return new b(e,this)},b.prototype.update=function(e){var o=this._entity,a=o.ellipsoid;if(!o.isShowing||!o.isAvailable(e)||!w.getValueOrDefault(a.show,e,!0))return n(this._primitive)&&(this._primitive.show=!1),void(n(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1));var s=w.getValueOrUndefined(a.radii,e,R),c=o._getModelMatrix(e,this._modelMatrix);if(!n(c)||!n(s))return n(this._primitive)&&(this._primitive.show=!1),void(n(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1));var d,y=w.getValueOrDefault(a.fill,e,!0),C=w.getValueOrDefault(a.outline,e,!1),E=w.getValueOrClonedDefault(a.outlineColor,e,t.BLACK,O),T=S.getValue(e,r(a.material,A),this._material);this._material=T;var x=w.getValueOrUndefined(a.stackPartitions,e),b=w.getValueOrUndefined(a.slicePartitions,e),P=w.getValueOrUndefined(a.subdivisions,e),I=w.getValueOrDefault(a.outlineWidth,e,1),M=this._scene.mode,D=M===_.SCENE3D,L=this._options,F=!D||this._lastSceneMode!==M||!n(this._primitive)||L.stackPartitions!==x||L.slicePartitions!==b||L.subdivisions!==P||this._lastOutlineWidth!==I;if(F){var B=this._primitives;B.removeAndDestroy(this._primitive),B.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=M,this._lastOutlineWidth=I,L.stackPartitions=x,L.slicePartitions=b,L.subdivisions=P,L.radii=D?N:s,d=new f({material:T,translucent:T.isTranslucent(),closed:!0}),L.vertexFormat=d.vertexFormat,this._primitive=B.add(new g({geometryInstances:new h({id:o,geometry:new l(L),modelMatrix:D?void 0:c,attributes:{show:new p(y)}}),appearance:d,asynchronous:!1})),L.vertexFormat=v.VERTEX_FORMAT,this._outlinePrimitive=B.add(new g({geometryInstances:new h({id:o,geometry:new u(L),modelMatrix:D?void 0:c,attributes:{show:new p(C),color:i.fromColor(E)}}),appearance:new v({flat:!0,translucent:1!==E.alpha,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(I)}}),asynchronous:!1})),this._lastShow=y,this._lastOutlineShow=C,this._lastOutlineColor=t.clone(E,this._lastOutlineColor)}else if(this._primitive.ready){var V=this._primitive,k=this._outlinePrimitive;V.show=!0,k.show=!0,d=V.appearance,d.material=T;var z=this._attributes;n(z)||(z=V.getGeometryInstanceAttributes(o),this._attributes=z),y!==this._lastShow&&(z.show=p.toValue(y,z.show),this._lastShow=y);var U=this._outlineAttributes;n(U)||(U=k.getGeometryInstanceAttributes(o),this._outlineAttributes=U),C!==this._lastOutlineShow&&(U.show=p.toValue(C,U.show),this._lastOutlineShow=C),t.equals(E,this._lastOutlineColor)||(U.color=i.toValue(E,U.color),t.clone(E,this._lastOutlineColor))}D&&(s.x=Math.max(s.x,.001),s.y=Math.max(s.y,.001),s.z=Math.max(s.z,.001),c=m.multiplyByScale(c,s,c),this._primitive.modelMatrix=c,this._outlinePrimitive.modelMatrix=c)},b.prototype.getBoundingSphere=function(e,t){return E(e,this._primitive,this._outlinePrimitive,t)},b.prototype.isDestroyed=function(){return!1},b.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),a(this)},x}),i("DataSources/StaticGeometryColorBatch",["../Core/AssociativeArray","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","./BoundingSphereState"],function(e,t,i,r,n,o,a){"use strict";function s(t,i,r,n){this.translucent=i,this.appearanceType=r,this.closed=n,this.primitives=t,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.updaters=new e,this.updatersWithAttributes=new e,this.attributes=new e,this.subscriptions=new e,this.showsUpdated=new e,this.itemsToRemove=[]}function l(e,t,i){this._solidBatch=new s(e,!1,t,i),this._translucentBatch=new s(e,!0,t,i)}var u=new t;return s.prototype.add=function(e,t){var i=e.entity.id;if(this.createPrimitive=!0,this.geometry.set(i,t),this.updaters.set(i,e),e.hasConstantFill&&e.fillMaterialProperty.isConstant){var r=this;this.subscriptions.set(i,e.entity.definitionChanged.addEventListener(function(t,i,n,o){"isShowing"===i&&r.showsUpdated.set(t.id,e)}))}else this.updatersWithAttributes.set(i,e)},s.prototype.remove=function(e){var t=e.entity.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var i=this.subscriptions.get(t);r(i)&&(i(),this.subscriptions.remove(t))}},s.prototype.update=function(e){var a,s,l=!0,c=0,h=this.primitive,d=this.primitives;if(this.createPrimitive){var m=this.geometry.values,p=m.length;if(p>0){for(r(h)&&(r(this.oldPrimitive)?d.remove(h):this.oldPrimitive=h),s=0;p>s;s++){var f=m[s],v=f.attributes;a=this.attributes.get(f.id.id),r(a)&&(r(v.show)&&(v.show.value=a.show),r(v.color)&&(v.color.value=a.color))}h=new o({asynchronous:!0,geometryInstances:m,appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed})}),d.add(h),l=!1}else{r(h)&&(d.remove(h),h=void 0);var g=this.oldPrimitive;r(g)&&(d.remove(g),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=h,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(r(h)&&h.ready){r(this.oldPrimitive)&&(d.remove(this.oldPrimitive),this.oldPrimitive=void 0);var _=this.updatersWithAttributes.values,y=_.length,C=this.waitingOnCreate;for(s=0;y>s;s++){var E=_[s],S=this.geometry.get(E.entity.id);if(a=this.attributes.get(S.id.id),r(a)||(a=h.getGeometryInstanceAttributes(S.id),this.attributes.set(S.id.id,a)),!E.fillMaterialProperty.isConstant||C){var w=E.fillMaterialProperty.color;w.getValue(e,u),t.equals(a._lastColor,u)||(a._lastColor=t.clone(u,a._lastColor),a.color=i.toValue(u,a.color),(this.translucent&&255===a.color[3]||!this.translucent&&255!==a.color[3])&&(this.itemsToRemove[c++]=E))}var T=E.entity.isShowing&&(E.hasConstantFill||E.isFilled(e)),x=1===a.show[0];T!==x&&(a.show=n.toValue(T,a.show))}this.updateShows(h),this.waitingOnCreate=!1}else r(h)&&!h.ready&&(l=!1);return this.itemsToRemove.length=c,l},s.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,o=0;i>o;o++){var a=t[o],s=this.geometry.get(a.entity.id),l=this.attributes.get(s.id.id);r(l)||(l=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,l));var u=a.entity.isShowing,c=1===l.show[0];u!==c&&(l.show=n.toValue(u,l.show))}this.showsUpdated.removeAll()},s.prototype.contains=function(e){return this.updaters.contains(e.id)},s.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return a.PENDING;var n=i.getGeometryInstanceAttributes(e);return!r(n)||!r(n.boundingSphere)||r(n.show)&&0===n.show[0]?a.FAILED:(n.boundingSphere.clone(t),a.DONE)},s.prototype.removeAllPrimitives=function(){var e=this.primitives,t=this.primitive;r(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());var i=this.oldPrimitive;r(i)&&(e.remove(i),this.oldPrimitive=void 0)},l.prototype.add=function(e,t){var i=t.createFillGeometryInstance(e);255===i.attributes.color.value[3]?this._solidBatch.add(t,i):this._translucentBatch.add(t,i)},l.prototype.remove=function(e){this._solidBatch.remove(e)||this._translucentBatch.remove(e)},l.prototype.update=function(e){var t,i,r=this._solidBatch.update(e);r=this._translucentBatch.update(e)&&r;var n=this._solidBatch.itemsToRemove,o=n.length;if(o>0)for(t=0;o>t;t++)i=n[t],this._solidBatch.remove(i),this._translucentBatch.add(i,i.createFillGeometryInstance(e));n=this._translucentBatch.itemsToRemove;var a=n.length;if(a>0)for(t=0;a>t;t++)i=n[t],this._translucentBatch.remove(i),this._solidBatch.add(i,i.createFillGeometryInstance(e));return(o>0||a>0)&&(r=this._solidBatch.update(e)&&r,r=this._translucentBatch.update(e)&&r),r},l.prototype.getBoundingSphere=function(e,t){return this._solidBatch.contains(e)?this._solidBatch.getBoundingSphere(e,t):this._translucentBatch.contains(e)?this._translucentBatch.getBoundingSphere(e,t):a.FAILED},l.prototype.removeAllPrimitives=function(){this._solidBatch.removeAllPrimitives(),this._translucentBatch.removeAllPrimitives()},l}),i("DataSources/StaticGeometryPerMaterialBatch",["../Core/AssociativeArray","../Core/defined","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","./BoundingSphereState","./MaterialProperty"],function(e,t,i,r,n,o){"use strict";function a(t,i,r,n){this.primitives=t,this.appearanceType=i,this.materialProperty=r,this.closed=n,this.updaters=new e,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.material=void 0,this.updatersWithAttributes=new e,this.attributes=new e,this.invalidated=!1,this.removeMaterialSubscription=r.definitionChanged.addEventListener(a.prototype.onMaterialChanged,this),this.subscriptions=new e,this.showsUpdated=new e}function s(e,t,i){this._items=[],this._primitives=e,this._appearanceType=t,this._closed=i}return a.prototype.onMaterialChanged=function(){this.invalidated=!0},a.prototype.isMaterial=function(e){var i=this.materialProperty,r=e.fillMaterialProperty;return r===i?!0:t(i)?i.equals(r):!1},a.prototype.add=function(e,t){var i=t.entity.id;if(this.updaters.set(i,t),this.geometry.set(i,t.createFillGeometryInstance(e)),t.hasConstantFill&&t.fillMaterialProperty.isConstant){var r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(e,i,n,o){"isShowing"===i&&r.showsUpdated.set(e.id,t)}))}else this.updatersWithAttributes.set(i,t);this.createPrimitive=!0},a.prototype.remove=function(e){var i=e.entity.id,r=this.updaters.remove(i);if(r){this.geometry.remove(i),this.updatersWithAttributes.remove(i);var n=this.subscriptions.get(i);t(n)&&(n(),this.subscriptions.remove(i))}return this.createPrimitive=r,r},a.prototype.update=function(e){var n,a,s=!0,l=this.primitive,u=this.primitives,c=this.geometry.values;if(this.createPrimitive){var h=c.length;if(h>0){for(t(l)&&(t(this.oldPrimitive)?u.remove(l):this.oldPrimitive=l),a=0;h>a;a++){var d=c[a],m=d.attributes;n=this.attributes.get(d.id.id),t(n)&&(t(m.show)&&(m.show.value=n.show),t(m.color)&&(m.color.value=n.color))}this.material=o.getValue(e,this.materialProperty,this.material),l=new r({asynchronous:!0,geometryInstances:c,appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed})}),u.add(l),s=!1}else{t(l)&&(u.remove(l),l=void 0);var p=this.oldPrimitive;t(p)&&(u.remove(p),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=l,this.createPrimitive=!1}else if(t(l)&&l.ready){t(this.oldPrimitive)&&(u.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=o.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;var f=this.updatersWithAttributes.values,v=f.length;for(a=0;v>a;a++){var g=f[a],_=g.entity,y=this.geometry.get(_.id);n=this.attributes.get(y.id.id),t(n)||(n=l.getGeometryInstanceAttributes(y.id),this.attributes.set(y.id.id,n));var C=_.isShowing&&(g.hasConstantFill||g.isFilled(e)),E=1===n.show[0];C!==E&&(n.show=i.toValue(C,n.show))}this.updateShows(l)}else t(l)&&!l.ready&&(s=!1);return s},a.prototype.updateShows=function(e){for(var r=this.showsUpdated.values,n=r.length,o=0;n>o;o++){var a=r[o],s=a.entity,l=this.geometry.get(s.id),u=this.attributes.get(l.id.id);t(u)||(u=e.getGeometryInstanceAttributes(l.id),this.attributes.set(l.id.id,u));var c=s.isShowing,h=1===u.show[0];c!==h&&(u.show=i.toValue(c,u.show))}this.showsUpdated.removeAll()},a.prototype.contains=function(e){return this.updaters.contains(e.id)},a.prototype.getBoundingSphere=function(e,i){var r=this.primitive;if(!r.ready)return n.PENDING;var o=r.getGeometryInstanceAttributes(e);return!t(o)||!t(o.boundingSphere)||t(o.show)&&0===o.show[0]?n.FAILED:(o.boundingSphere.clone(i),n.DONE)},a.prototype.destroy=function(e){var i=this.primitive,r=this.primitives;t(i)&&r.remove(i);var n=this.oldPrimitive;t(n)&&r.remove(n),this.removeMaterialSubscription()},s.prototype.add=function(e,t){for(var i=this._items,r=i.length,n=0;r>n;n++){var o=i[n];if(o.isMaterial(t))return void o.add(e,t)}var s=new a(this._primitives,this._appearanceType,t.fillMaterialProperty,this._closed);s.add(e,t),i.push(s)},s.prototype.remove=function(e){for(var t=this._items,i=t.length,r=i-1;r>=0;r--){var n=t[r];if(n.remove(e)){0===n.updaters.length&&(t.splice(r,1),n.destroy());break}}},s.prototype.update=function(e){var t,i=this._items,r=i.length;for(t=r-1;t>=0;t--){var n=i[t];if(n.invalidated){i.splice(t,1);for(var o=n.updaters.values,a=o.length,s=0;a>s;s++)this.add(e,o[s]);n.destroy()}}var l=!0;for(t=0;r>t;t++)l=i[t].update(e)&&l;return l},s.prototype.getBoundingSphere=function(e,t){for(var i=this._items,r=i.length,o=0;r>o;o++){var a=i[o];if(a.contains(e))return a.getBoundingSphere(e,t)}return n.FAILED},s.prototype.removeAllPrimitives=function(){for(var e=this._items,t=e.length,i=0;t>i;i++)e[i].destroy();this._items.length=0},s}),i("DataSources/StaticOutlineGeometryBatch",["../Core/AssociativeArray","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/ShowGeometryInstanceAttribute","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./BoundingSphereState"],function(e,t,i,r,n,o,a,s){"use strict";function l(t,i,r){this.translucent=i,this.primitives=t,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.updaters=new e,this.updatersWithAttributes=new e,this.attributes=new e,this.itemsToRemove=[],this.width=r,this.subscriptions=new e,this.showsUpdated=new e}function u(t,i){this._primitives=t,this._scene=i,this._solidBatches=new e,this._translucentBatches=new e}l.prototype.add=function(e,t){var i=e.entity.id;if(this.createPrimitive=!0,this.geometry.set(i,t),this.updaters.set(i,e),e.hasConstantOutline&&e.outlineColorProperty.isConstant){var r=this;this.subscriptions.set(i,e.entity.definitionChanged.addEventListener(function(t,i,n,o){"isShowing"===i&&r.showsUpdated.set(t.id,e)}))}else this.updatersWithAttributes.set(i,e)},l.prototype.remove=function(e){var t=e.entity.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var i=this.subscriptions.get(t);r(i)&&(i(),this.subscriptions.remove(t))}};var c=new t;return l.prototype.update=function(e){var s,l,u=!0,h=0,d=this.primitive,m=this.primitives;if(this.createPrimitive){var p=this.geometry.values,f=p.length;if(f>0){for(r(d)&&(r(this.oldPrimitive)?m.remove(d):this.oldPrimitive=d),l=0;f>l;l++){var v=p[l],g=v.attributes;s=this.attributes.get(v.id.id),r(s)&&(r(g.show)&&(g.show.value=s.show),r(g.color)&&(g.color.value=s.color))}d=new a({asynchronous:!0,geometryInstances:p,appearance:new o({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}})}),m.add(d),u=!1}else{r(d)&&(m.remove(d),d=void 0);var _=this.oldPrimitive;r(_)&&(m.remove(_),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=d,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(r(d)&&d.ready){r(this.oldPrimitive)&&(m.remove(this.oldPrimitive),this.oldPrimitive=void 0);var y=this.updatersWithAttributes.values,C=y.length,E=this.waitingOnCreate;for(l=0;C>l;l++){var S=y[l],w=this.geometry.get(S.entity.id);if(s=this.attributes.get(w.id.id),r(s)||(s=d.getGeometryInstanceAttributes(w.id),this.attributes.set(w.id.id,s)),!S.outlineColorProperty.isConstant||E){var T=S.outlineColorProperty;T.getValue(e,c),t.equals(s._lastColor,c)||(s._lastColor=t.clone(c,s._lastColor),s.color=i.toValue(c,s.color),(this.translucent&&255===s.color[3]||!this.translucent&&255!==s.color[3])&&(this.itemsToRemove[h++]=S))}var x=S.entity.isShowing&&(S.hasConstantOutline||S.isOutlineVisible(e)),b=1===s.show[0];x!==b&&(s.show=n.toValue(x,s.show))}this.updateShows(d),this.waitingOnCreate=!1}else r(d)&&!d.ready&&(u=!1);return this.itemsToRemove.length=h,u},l.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,o=0;i>o;o++){var a=t[o],s=this.geometry.get(a.entity.id),l=this.attributes.get(s.id.id);r(l)||(l=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,l));var u=a.entity.isShowing,c=1===l.show[0];u!==c&&(l.show=n.toValue(u,l.show))}this.showsUpdated.removeAll()},l.prototype.contains=function(e){return this.updaters.contains(e.id)},l.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return s.PENDING;var n=i.getGeometryInstanceAttributes(e);return!r(n)||!r(n.boundingSphere)||r(n.show)&&0===n.show[0]?s.FAILED:(n.boundingSphere.clone(t),s.DONE)},l.prototype.removeAllPrimitives=function(){var e=this.primitives,t=this.primitive;r(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());var i=this.oldPrimitive;r(i)&&(e.remove(i),this.oldPrimitive=void 0)},u.prototype.add=function(e,t){var i,n,o=t.createOutlineGeometryInstance(e),a=this._scene.clampLineWidth(t.outlineWidth);255===o.attributes.color.value[3]?(i=this._solidBatches,n=i.get(a),r(n)||(n=new l(this._primitives,!1,a),i.set(a,n)),n.add(t,o)):(i=this._translucentBatches,n=i.get(a),r(n)||(n=new l(this._primitives,!0,a),i.set(a,n)),n.add(t,o))},u.prototype.remove=function(e){var t,i=this._solidBatches.values,r=i.length;for(t=0;r>t;t++)if(i[t].remove(e))return;var n=this._translucentBatches.values,o=n.length;for(t=0;o>t;t++)if(n[t].remove(e))return},u.prototype.update=function(e){var t,i,r,n,o,a=this._solidBatches.values,s=a.length,l=this._translucentBatches.values,u=l.length,c=!0,h=!1;do{for(h=!1,i=0;s>i;i++){n=a[i],c=n.update(e),o=n.itemsToRemove;var d=o.length;if(d>0)for(h=!0,t=0;d>t;t++)r=o[t],n.remove(r),this.add(e,r)}for(i=0;u>i;i++){n=l[i],c=n.update(e),o=n.itemsToRemove;var m=o.length;if(m>0)for(h=!0,t=0;m>t;t++)r=o[t],n.remove(r),this.add(e,r)}}while(h);return c},u.prototype.getBoundingSphere=function(e,t){var i,r=this._solidBatches.values,n=r.length;for(i=0;n>i;i++){var o=r[i];if(o.contains(e))return o.getBoundingSphere(e,t)}var a=this._translucentBatches.values,l=a.length;for(i=0;l>i;i++){var u=a[i];if(u.contains(e))return u.getBoundingSphere(e,t)}return s.FAILED},u.prototype.removeAllPrimitives=function(){var e,t=this._solidBatches.values,i=t.length;for(e=0;i>e;e++)t[e].removeAllPrimitives();var r=this._translucentBatches.values,n=r.length;for(e=0;n>e;e++)r[e].removeAllPrimitives()},u}),i("DataSources/GeometryVisualizer",["../Core/AssociativeArray","../Core/BoundingSphere","../Core/defined","../Core/destroyObject","../Core/DeveloperError","./BoundingSphereState","./ColorMaterialProperty","./StaticGeometryColorBatch","./StaticGeometryPerMaterialBatch","./StaticOutlineGeometryBatch"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t){this._primitives=t,this._dynamicUpdaters=new e}function h(e,t){for(var i=e._batches,r=i.length,n=0;r>n;n++)i[n].remove(t)}function d(e,t,i){return i.isDynamic?void e._dynamicBatch.add(t,i):(i.outlineEnabled&&e._outlineBatch.add(t,i),void(i.fillEnabled&&(i.isClosed?i.fillMaterialProperty instanceof a?e._closedColorBatch.add(t,i):e._closedMaterialBatch.add(t,i):i.fillMaterialProperty instanceof a?e._openColorBatch.add(t,i):e._openMaterialBatch.add(t,i))))}function m(t,i,r){this._type=t;var n=i.primitives;this._scene=i,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new e,this._removedObjects=new e,this._changedObjects=new e,this._outlineBatch=new u(n,i),this._closedColorBatch=new s(n,t.perInstanceColorAppearanceType,!0),this._closedMaterialBatch=new l(n,t.materialAppearanceType,!0),this._openColorBatch=new s(n,t.perInstanceColorAppearanceType,!1),this._openMaterialBatch=new l(n,t.materialAppearanceType,!1),this._dynamicBatch=new c(n),this._batches=[this._closedColorBatch,this._closedMaterialBatch,this._openColorBatch,this._openMaterialBatch,this._dynamicBatch,this._outlineBatch],this._subscriptions=new e,this._updaters=new e,this._entityCollection=r,r.collectionChanged.addEventListener(m.prototype._onCollectionChanged,this),this._onCollectionChanged(r,r.values,p)}var p=[];c.prototype.add=function(e,t){this._dynamicUpdaters.set(t.entity.id,t.createDynamicUpdater(this._primitives))},c.prototype.remove=function(e){ +var t=e.entity.id,r=this._dynamicUpdaters.get(t);i(r)&&(this._dynamicUpdaters.remove(t),r.destroy())},c.prototype.update=function(e){for(var t=this._dynamicUpdaters.values,i=0,r=t.length;r>i;i++)t[i].update(e);return!0},c.prototype.removeAllPrimitives=function(){for(var e=this._dynamicUpdaters.values,t=0,i=e.length;i>t;t++)e[t].destroy();this._dynamicUpdaters.removeAll()},c.prototype.getBoundingSphere=function(e,t){var r=this._dynamicUpdaters.get(e.id);return i(r)&&i(r.getBoundingSphere)?r.getBoundingSphere(e,t):o.FAILED},m.prototype.update=function(e){var t,i,r,n,o=this._addedObjects,a=o.values,s=this._removedObjects,l=s.values,u=this._changedObjects,c=u.values;for(t=c.length-1;t>-1;t--)i=c[t],r=i.id,n=this._updaters.get(r),n.entity===i?(h(this,n),d(this,e,n)):(l.push(i),a.push(i));for(t=l.length-1;t>-1;t--)i=l[t],r=i.id,n=this._updaters.get(r),h(this,n),n.destroy(),this._updaters.remove(r),this._subscriptions.get(r)(),this._subscriptions.remove(r);for(t=a.length-1;t>-1;t--)i=a[t],r=i.id,n=new this._type(i,this._scene),this._updaters.set(r,n),d(this,e,n),this._subscriptions.set(r,n.geometryChanged.addEventListener(m._onGeometryChanged,this));o.removeAll(),s.removeAll(),u.removeAll();var p=!0,f=this._batches,v=f.length;for(t=0;v>t;t++)p=f[t].update(e)&&p;return p};var f=[],v=new t;return m.prototype.getBoundingSphere=function(e,i){for(var r=f,n=v,a=0,s=o.DONE,l=this._batches,u=l.length,c=0;u>c;c++){if(s=l[c].getBoundingSphere(e,n),s===o.PENDING)return o.PENDING;s===o.DONE&&(r[a]=t.clone(n,r[a]),a++)}return 0===a?o.FAILED:(r.length=a,t.fromBoundingSpheres(r,i),o.DONE)},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(m.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();var e,t=this._batches,i=t.length;for(e=0;i>e;e++)t[e].removeAllPrimitives();var n=this._subscriptions.values;for(i=n.length,e=0;i>e;e++)n[e]();return this._subscriptions.removeAll(),r(this)},m._onGeometryChanged=function(e){var t=this._removedObjects,r=this._changedObjects,n=e.entity,o=n.id;i(t.get(o))||i(r.get(o))||r.set(o,n)},m.prototype._onCollectionChanged=function(e,t,i){var r,n,o,a=this._addedObjects,s=this._removedObjects,l=this._changedObjects;for(r=i.length-1;r>-1;r--)o=i[r],n=o.id,a.remove(n)||(s.set(n,o),l.remove(n));for(r=t.length-1;r>-1;r--)o=t[r],n=o.id,s.remove(n)?l.set(n,o):a.set(n,o)},m}),i("Scene/Label",["../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/NearFarScalar","./Billboard","./HeightReference","./HorizontalOrigin","./LabelStyle","./VerticalOrigin"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function m(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function p(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function f(n,o){n=r(n,r.EMPTY_OBJECT),this._text=r(n.text,""),this._show=r(n.show,!0),this._font=r(n.font,"30px sans-serif"),this._fillColor=i.clone(r(n.fillColor,i.WHITE)),this._outlineColor=i.clone(r(n.outlineColor,i.BLACK)),this._outlineWidth=r(n.outlineWidth,1),this._style=r(n.style,h.FILL),this._verticalOrigin=r(n.verticalOrigin,d.BOTTOM),this._horizontalOrigin=r(n.horizontalOrigin,c.LEFT),this._pixelOffset=e.clone(r(n.pixelOffset,e.ZERO)),this._eyeOffset=t.clone(r(n.eyeOffset,t.ZERO)),this._position=t.clone(r(n.position,t.ZERO)),this._scale=r(n.scale,1),this._id=n.id,this._translucencyByDistance=n.translucencyByDistance,this._pixelOffsetScaleByDistance=n.pixelOffsetScaleByDistance,this._heightReference=r(n.heightReference,u.NONE),this._labelCollection=o,this._glyphs=[],this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._updateClamping()}return o(f.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(var t=this._glyphs,i=0,r=t.length;r>i;i++){var o=t[i];n(o.billboard)&&(o.billboard.show=e)}}}},position:{get:function(){return this._position},set:function(e){var i=this._position;if(!t.equals(i,e))if(t.clone(e,i),this._heightReference===u.NONE)for(var r=this._glyphs,o=0,a=r.length;a>o;o++){var s=r[o];n(s.billboard)&&(s.billboard.position=e)}else this._updateClamping()}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightReference=e,this._updateClamping())}},text:{get:function(){return this._text},set:function(e){this._text!==e&&(this._text=e,m(this))}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,m(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){var t=this._fillColor;i.equals(t,e)||(i.clone(e,t),m(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){var t=this._outlineColor;i.equals(t,e)||(i.clone(e,t),m(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,m(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,m(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(t){var i=this._pixelOffset;if(!e.equals(i,t)){e.clone(t,i);for(var r=this._glyphs,o=0,a=r.length;a>o;o++){var s=r[o];n(s.billboard)&&(s.billboard.pixelOffset=t)}}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;if(!s.equals(t,e)){this._translucencyByDistance=s.clone(e,t);for(var i=this._glyphs,r=0,o=i.length;o>r;r++){var a=i[r];n(a.billboard)&&(a.billboard.translucencyByDistance=e)}}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){var t=this._pixelOffsetScaleByDistance;if(!s.equals(t,e)){this._pixelOffsetScaleByDistance=s.clone(e,t);for(var i=this._glyphs,r=0,o=i.length;o>r;r++){var a=i[r];n(a.billboard)&&(a.billboard.pixelOffsetScaleByDistance=e)}}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){var i=this._eyeOffset;if(!t.equals(i,e)){t.clone(e,i);for(var r=this._glyphs,o=0,a=r.length;a>o;o++){var s=r[o];n(s.billboard)&&(s.billboard.eyeOffset=e)}}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,p(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;for(var t=this._glyphs,i=0,r=t.length;r>i;i++){var o=t[i];n(o.billboard)&&(o.billboard.verticalOrigin=e)}p(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;for(var t=this._glyphs,i=0,r=t.length;r>i;i++){var o=t[i];n(o.billboard)&&(o.billboard.scale=e)}p(this)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;for(var t=this._glyphs,i=0,r=t.length;r>i;i++){var o=t[i];n(o.billboard)&&(o.billboard.id=e)}}}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=t.clone(e,this._actualClampedPosition);for(var i=this._glyphs,r=0,o=i.length;o>r;r++){var a=i[r];n(a.billboard)&&(a.billboard.position=e)}}}}),f.prototype._updateClamping=function(){l._updateClamping(this._labelCollection,this)},f.prototype.computeScreenSpacePosition=function(t,i){n(i)||(i=new e);var r=this._labelCollection,o=r.modelMatrix,a=l._computeActualPosition(this,this._position,t.frameState,o),s=l._computeScreenSpacePosition(o,a,this._eyeOffset,this._pixelOffset,t,i);return s.y=t.canvas.clientHeight-s.y,s},f.prototype.equals=function(r){return this===r||n(r)&&this._show===r._show&&this._scale===r._scale&&this._style===r._style&&this._verticalOrigin===r._verticalOrigin&&this._horizontalOrigin===r._horizontalOrigin&&this._text===r._text&&this._font===r._font&&t.equals(this._position,r._position)&&i.equals(this._fillColor,r._fillColor)&&i.equals(this._outlineColor,r._outlineColor)&&e.equals(this._pixelOffset,r._pixelOffset)&&t.equals(this._eyeOffset,r._eyeOffset)&&s.equals(this._translucencyByDistance,r._translucencyByDistance)&&s.equals(this._pixelOffsetScaleByDistance,r._pixelOffsetScaleByDistance)&&this._id===r._id},f.prototype.isDestroyed=function(){return!1},f}),i("Scene/LabelCollection",["../Core/Cartesian2","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/writeTextToCanvas","./BillboardCollection","./HorizontalOrigin","./Label","./LabelStyle","./TextureAtlas","./VerticalOrigin"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m){"use strict";function p(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function f(e,t,i){this.labelCollection=e,this.index=t,this.dimensions=i}function v(e,t,i,r,n,o,a){return w.font=t,w.fillColor=i,w.strokeColor=r,w.strokeWidth=n,a===m.BOTTOM?w.textBaseline="bottom":a===m.TOP?w.textBaseline="top":w.textBaseline="middle",w.fill=o===h.FILL||o===h.FILL_AND_OUTLINE,w.stroke=o===h.OUTLINE||o===h.FILL_AND_OUTLINE,s(e,w)}function g(e,t){t.textureInfo=void 0,t.dimensions=void 0;var r=t.billboard;i(r)&&(r.show=!1,r.image=void 0,e._spareBillboards.push(r),t.billboard=void 0)}function _(e,t,i,r){e.addImage(t,i).then(function(e,t){r.index=e})}function y(e,t){var r,n,o,a=t._text,s=a.length,l=t._glyphs,c=l.length;if(c>s)for(n=s;c>n;++n)g(e,l[n]);l.length=s;var h=e._glyphTextureCache;for(o=0;s>o;++o){var d=a.charAt(o),m=t._font,y=t._fillColor,C=t._outlineColor,E=t._outlineWidth,S=t._style,w=t._verticalOrigin,T=JSON.stringify([d,m,y.toRgba(),C.toRgba(),E,+S,+w]),x=h[T];if(!i(x)){var b=v(d,m,y,C,E,S,w);x=new f(e,-1,b.dimensions),h[T]=x,b.width>0&&b.height>0&&_(e._textureAtlas,T,b,x)}if(r=l[o],i(r)?-1===x.index?g(e,r):i(r.textureInfo)&&(r.textureInfo=void 0):(r=new p,l[o]=r),r.textureInfo=x,r.dimensions=x.dimensions,-1!==x.index){var A=r.billboard;i(A)||(A=e._spareBillboards.length>0?e._spareBillboards.pop():e._billboardCollection.add({collection:e}),r.billboard=A),A.show=t._show,A.position=t._position,A.eyeOffset=t._eyeOffset,A.pixelOffset=t._pixelOffset,A.horizontalOrigin=u.LEFT,A.verticalOrigin=t._verticalOrigin,A.scale=t._scale,A.pickPrimitive=t,A.id=t._id,A.image=T,A.translucencyByDistance=t._translucencyByDistance,A.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance}}t._repositionAllGlyphs=!0}function C(e,t){var r,n,o=e._glyphs,a=0,s=0,l=0,c=o.length;for(l=0;c>l;++l)r=o[l],n=r.dimensions,a+=n.computedWidth,s=Math.max(s,n.height);var h=e._scale,d=e._horizontalOrigin,p=0;d===u.CENTER?p-=a/2*h:d===u.RIGHT&&(p-=a*h),T.x=p*t,T.y=0;var f=e._verticalOrigin;for(l=0;c>l;++l)r=o[l],n=r.dimensions,f===m.BOTTOM||n.height===s?T.y=-n.descent*h:f===m.TOP?T.y=-(s-n.height)*h-n.descent*h:f===m.CENTER&&(T.y=-(s-n.height)/2*h-n.descent*h),T.y*=t,i(r.billboard)&&r.billboard._setTranslate(T),T.x+=n.computedWidth*h*t}function E(e,t){for(var r=t._glyphs,o=0,a=r.length;a>o;++o)g(e,r[o]);t._labelCollection=void 0,i(t._removeCallbackFunc)&&t._removeCallbackFunc(),n(t)}function S(e){e=t(e,t.EMPTY_OBJECT),this._scene=e.scene,this._textureAtlas=void 0,this._billboardCollection=new l({scene:this._scene}),this._billboardCollection.destroyTextureAtlas=!1,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._resolutionScale=void 0,this.modelMatrix=a.clone(t(e.modelMatrix,a.IDENTITY)),this.debugShowBoundingVolume=t(e.debugShowBoundingVolume,!1)}var w={},T=new e;return r(S.prototype,{length:{get:function(){return this._labels.length}}}),S.prototype.add=function(e){var t=new c(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t},S.prototype.remove=function(e){if(i(e)&&e._labelCollection===this){var t=this._labels.indexOf(e);if(-1!==t)return this._labels.splice(t,1),E(this,e),!0}return!1},S.prototype.removeAll=function(){for(var e=this._labels,t=0,i=e.length;i>t;++t)E(this,e[t]);e.length=0},S.prototype.contains=function(e){return i(e)&&e._labelCollection===this},S.prototype.get=function(e){return this._labels[e]},S.prototype.update=function(e){var t=this._billboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume;var r=e.context;i(this._textureAtlas)||(this._textureAtlas=new d({context:r}),t.textureAtlas=this._textureAtlas);var n=r.uniformState,o=n.resolutionScale,a=this._resolutionScale!==o;this._resolutionScale=o;var s;s=a?this._labels:this._labelsToUpdate;for(var l=s.length,u=0;l>u;++u){var c=s[u];if(!c.isDestroyed()){var h=c._glyphs.length;c._rebindAllGlyphs&&(y(this,c),c._rebindAllGlyphs=!1),(a||c._repositionAllGlyphs)&&(C(c,o),c._repositionAllGlyphs=!1);var m=c._glyphs.length-h;this._totalGlyphCount+=m}}this._labelsToUpdate.length=0,t.update(e)},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),n(this)},S}),i("DataSources/LabelVisualizer",["../Core/AssociativeArray","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/NearFarScalar","../Scene/HorizontalOrigin","../Scene/LabelCollection","../Scene/LabelStyle","../Scene/VerticalOrigin","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m){"use strict";function p(e){this.entity=e,this.label=void 0,this.index=void 0}function f(t,i){i.collectionChanged.addEventListener(f.prototype._onCollectionChanged,this),this._scene=t,this._unusedIndexes=[],this._labelCollection=void 0,this._entityCollection=i,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}function v(e,t){if(n(e)){var i=e.label;n(i)&&(t.push(e.index),i.show=!1,e.label=void 0,e.index=-1)}}var g=1,_="30px sans-serif",y=c.FILL,C=r.WHITE,E=r.BLACK,S=1,w=t.ZERO,T=i.ZERO,x=l.CENTER,b=h.CENTER,A=new i,P=new r,I=new r,M=new i,D=new t,R=new s,O=new s;return f.prototype.update=function(e){for(var t=this._items.values,i=this._unusedIndexes,r=0,o=t.length;o>r;r++){var a,s=t[r],l=s.entity,c=l._label,h=s.label,d=l.isShowing&&l.isAvailable(e)&&m.getValueOrDefault(c._show,e,!0);if(d&&(A=m.getValueOrUndefined(l._position,e,A),a=m.getValueOrUndefined(c._text,e),d=n(A)&&n(a)),d){if(!n(h)){var p=this._labelCollection;n(p)||(p=new u,this._labelCollection=p,this._scene.primitives.add(p));var f=i.length;if(f>0){var N=i.pop();s.index=N,h=p.get(N)}else h=p.add(),s.index=p.length-1;h.id=l,s.label=h}h.show=!0,h.position=A,h.text=a,h.scale=m.getValueOrDefault(c._scale,e,g),h.font=m.getValueOrDefault(c._font,e,_),h.style=m.getValueOrDefault(c._style,e,y),h.fillColor=m.getValueOrDefault(c._fillColor,e,C,P),h.outlineColor=m.getValueOrDefault(c._outlineColor,e,E,I),h.outlineWidth=m.getValueOrDefault(c._outlineWidth,e,S),h.pixelOffset=m.getValueOrDefault(c._pixelOffset,e,w,D),h.eyeOffset=m.getValueOrDefault(c._eyeOffset,e,T,M),h.horizontalOrigin=m.getValueOrDefault(c._horizontalOrigin,e,x),h.verticalOrigin=m.getValueOrDefault(c._verticalOrigin,e,b),h.translucencyByDistance=m.getValueOrUndefined(c._translucencyByDistance,e,R),h.pixelOffsetScaleByDistance=m.getValueOrUndefined(c._pixelOffsetScaleByDistance,e,O)}else v(s,i)}return!0},f.prototype.getBoundingSphere=function(e,t){var r=this._items.get(e.id);return n(r)&&n(r.label)?(t.center=i.clone(r.label.position,t.center),t.radius=0,d.DONE):d.FAILED},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._entityCollection.collectionChanged.removeEventListener(f.prototype._onCollectionChanged,this),n(this._labelCollection)&&this._scene.primitives.remove(this._labelCollection),o(this)},f.prototype._onCollectionChanged=function(e,t,i,r){var o,a,s=this._unusedIndexes,l=this._items;for(o=t.length-1;o>-1;o--)a=t[o],n(a._label)&&n(a._position)&&l.set(a.id,new p(a));for(o=r.length-1;o>-1;o--)a=r[o],n(a._label)&&n(a._position)?l.contains(a.id)||l.set(a.id,new p(a)):(v(l.get(a.id),s),l.remove(a.id));for(o=i.length-1;o>-1;o--)a=i[o],v(l.get(a.id),s),l.remove(a.id)},f}),i("ThirdParty/gltfDefaults",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/Quaternion","../Renderer/WebGLConstants"],function(e,t,i,r,n){"use strict";function o(e){i(e.accessors)||(e.accessors={});var r=e.accessors;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];o.byteStride=t(o.byteStride,0)}}function a(e){i(e.animations)||(e.animations={});var r=e.animations;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];i(o.channels)||(o.channels=[]),i(o.parameters)||(o.parameters={}),i(o.samplers)||(o.samplers={});var a=r.samplers;for(var s in a)if(a.hasOwnProperty(s)){var l=a[s];l.interpolation=t(l.interpolation,"LINEAR")}}}function s(e){i(e.asset)||(e.asset={});var r=e.asset;i(r.profile)&&"string"!=typeof r.profile||(r.profile={});var n=r.profile;r.premultipliedAlpha=t(r.premultipliedAlpha,!1),n.api=t(n.api,"WebGL"),n.version=t(n.version,"1.0.2"),i(e.version)&&(r.version=t(r.version,e.version),delete e.version),"number"==typeof r.version&&(r.version=r.version.toFixed(1).toString())}function l(e){i(e.buffers)||(e.buffers={});var r=e.buffers;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];o.type=t(o.type,"arraybuffer")}}function u(e){i(e.bufferViews)||(e.bufferViews={})}function c(e){i(e.cameras)||(e.cameras={})}function h(e){i(e.images)||(e.images={})}function d(e){i(e.extensions)||(e.extensions={});var r=e.extensions;i(r.KHR_materials_common)||(r.KHR_materials_common={});var n=r.KHR_materials_common;i(e.lights)?(n.lights=e.lights,delete e.lights):i(n.lights)||(n.lights={});var o=n.lights;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];if("ambient"===s.type){i(s.ambient)||(s.ambient={});var l=s.ambient;i(l.color)||(l.color=[1,1,1])}else if("directional"===s.type){i(s.directional)||(s.directional={});var u=s.directional;i(u.color)||(u.color=[1,1,1])}else if("point"===s.type){i(s.point)||(s.point={});var c=s.point;i(c.color)||(c.color=[1,1,1]),c.constantAttenuation=t(c.constantAttenuation,1),c.linearAttenuation=t(c.linearAttenuation,0),c.quadraticAttenuation=t(c.quadraticAttenuation,0)}else if("spot"===s.type){i(s.spot)||(s.spot={});var h=s.spot;i(h.color)||(h.color=[1,1,1]),h.constantAttenuation=t(h.constantAttenuation,1),h.fallOffAngle=t(h.fallOffAngle,3.14159265),h.fallOffExponent=t(h.fallOffExponent,0),h.linearAttenuation=t(h.linearAttenuation,0),h.quadraticAttenuation=t(h.quadraticAttenuation,0)}}}function m(e){i(e.materials)||(e.materials={});var t=e.materials;for(var r in t)if(t.hasOwnProperty(r)){var o=t[r],a=o.instanceTechnique;if(i(a)&&(o.technique=a.technique,o.values=a.values,delete o.instanceTechnique),!i(o.extensions))if(i(o.technique))i(o.values)||(o.values={});else{delete o.values,o.extensions={KHR_materials_common:{technique:"CONSTANT",transparent:!1,values:{emission:{type:n.FLOAT_VEC4,value:[.5,.5,.5,1]}}}},i(e.extensionsUsed)||(e.extensionsUsed=[]);var s=e.extensionsUsed;-1===s.indexOf("KHR_materials_common")&&s.push("KHR_materials_common")}}}function p(e){i(e.meshes)||(e.meshes={});var r=e.meshes;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];i(a.primitives)||(a.primitives=[]);for(var s=a.primitives.length,l=s.length,u=0;l>u;++u){var c=s[u];i(c.attributes)||(c.attributes={});var h=t(c.primitive,n.TRIANGLES);c.mode=t(c.mode,h)}}}function f(t){i(t.nodes)||(t.nodes={});var n=t.nodes,o=parseFloat(t.asset.version)<1,a=new e,s=new r;for(var l in n)if(n.hasOwnProperty(l)){var u=n[l];if(i(u.children)||(u.children=[]),o&&i(u.rotation)){var c=u.rotation;e.fromArray(c,0,a),r.fromAxisAngle(a,c[3],s),u.rotation=[s.x,s.y,s.z,s.w]}i(u.matrix)||(i(u.translation)||i(u.rotation)||i(u.scale)?(i(u.translation)||(u.translation=[0,0,0]),i(u.rotation)||(u.rotation=[0,0,0,1]),i(u.scale)||(u.scale=[1,1,1])):u.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);var h=u.instanceSkin;i(h)&&(u.skeletons=h.skeletons,u.skin=h.skin,u.meshes=h.meshes,delete u.instanceSkin)}}function v(e){i(e.programs)||(e.programs={});var t=e.programs;for(var r in t)if(t.hasOwnProperty(r)){var n=t[r];i(n.attributes)||(n.attributes=[])}}function g(e){i(e.samplers)||(e.samplers={});var r=e.samplers;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];a.magFilter=t(a.magFilter,n.LINEAR),a.minFilter=t(a.minFilter,n.NEAREST_MIPMAP_LINEAR),a.wrapS=t(a.wrapS,n.REPEAT),a.wrapT=t(a.wrapT,n.REPEAT)}}function _(e){i(e.scenes)||(e.scenes={});var t=e.scenes;for(var r in t)if(t.hasOwnProperty(r)){var n=t[r];i(n.node)||(n.node=[])}}function y(e){i(e.shaders)||(e.shaders={})}function C(e){i(e.skins)||(e.skins={});var t=e.skins;for(var r in t)if(t.hasOwnProperty(r)){var n=t[r];i(n.bindShapeMatrix)&&(n.bindShapeMatrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}}function E(e){i(e.enable)||(e.enable=[]),i(e.disable)||(e.disable=[])}function S(e){i(e.techniques)||(e.techniques={});var r=e.techniques;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];i(o.parameters)||(o.parameters={});var a=o.parameters;for(var s in a){var l=a[s];l.node=t(l.node,l.source),l.source=void 0}var u=o.passes;if(i(u)){var c=t(o.pass,"defaultPass");if(u.hasOwnProperty(c)){var h=u[c],d=h.instanceProgram;o.attributes=t(o.attributes,d.attributes),o.program=t(o.program,d.program),o.uniforms=t(o.uniforms,d.uniforms),o.states=t(o.states,h.states)}o.passes=void 0,o.pass=void 0}i(o.attributes)||(o.attributes={}),i(o.uniforms)||(o.uniforms={}),i(o.states)||(o.states={}),E(o.states)}}function w(e){i(e.textures)||(e.textures={});var r=e.textures;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];a.format=t(a.format,n.RGBA),a.internalFormat=t(a.internalFormat,a.format),a.target=t(a.target,n.TEXTURE_2D),a.type=t(a.type,n.UNSIGNED_BYTE)}}var T=function(e){return i(e)?(i(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,e.allExtensions=void 0),e.extensionsUsed=t(e.extensionsUsed,[]),o(e),a(e),s(e),l(e),u(e),c(e),h(e),d(e),m(e),p(e),f(e),v(e),g(e),_(e),y(e),C(e),S(e),w(e),e):void 0};return T}),i("Scene/getModelAccessor",["../Core/ComponentDatatype"],function(e){"use strict";function t(t){var r=t.componentType,n=i[t.type];return{componentsPerAttribute:n,createArrayBufferView:function(t,i,o){return e.createArrayBufferView(r,t,i,n*o)}}}var i={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16};return t}),i("Scene/ModelAnimationCache",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/LinearSpline","../Core/Matrix4","../Core/Quaternion","../Core/QuaternionSpline","../Renderer/WebGLConstants","./getModelAccessor"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(){}function c(e,i){var r=e.gltf,n=r.buffers,o=r.bufferViews,a=o[i.bufferView],s=n[a.buffer],u=a.byteOffset+i.byteOffset,c=i.count*l(i).componentsPerAttribute;return e.cacheKey+"//"+t(s.path,"")+"/"+u+"/"+c}function h(e,t,i){return e.cacheKey+"//"+t+"/"+i}function d(e){this._value=e}var m={},p=new e;u.getAnimationParameterValues=function(t,r){var n=c(t,r),a=m[n];if(!i(a)){var u,h=t._loadResources,d=t.gltf,f=parseFloat(d.asset.version)<1,v=d.bufferViews,g=v[r.bufferView],_=r.componentType,y=r.type,C=r.count,E=h.getBuffer(g),S=l(r).createArrayBufferView(E.buffer,E.byteOffset+r.byteOffset,C);if(_===s.FLOAT&&"SCALAR"===y)a=S;else if(_===s.FLOAT&&"VEC3"===y)for(a=new Array(C),u=0;C>u;++u)a[u]=e.fromArray(S,3*u);else if(_===s.FLOAT&&"VEC4"===y)for(a=new Array(C),u=0;C>u;++u){var w=4*u;f?a[u]=o.fromAxisAngle(e.fromArray(S,w,p),S[w+3]):a[u]=o.unpack(S,w)}i(t.cacheKey)&&(m[n]=a)}return a};var f={};d.prototype.evaluate=function(e,t){return this._value},u.getAnimationSpline=function(e,t,n,o,l,u){var c=h(e,t,o),m=f[c];if(!i(m)){var p=u[l.input],v=e.gltf.accessors[n.parameters[l.output]],g=u[l.output];if(1===p.length&&1===g.length)m=new d(g[0]);else{var _=v.componentType,y=v.type;"LINEAR"===l.interpolation&&(_===s.FLOAT&&"VEC3"===y?m=new r({times:p,points:g}):_===s.FLOAT&&"VEC4"===y&&(m=new a({times:p,points:g})))}i(e.cacheKey)&&(f[c]=m)}return m};var v={};return u.getSkinInverseBindMatrices=function(e,t){var r=c(e,t),o=v[r];if(!i(o)){var a=e._loadResources,u=e.gltf,h=u.bufferViews,d=h[t.bufferView],m=t.componentType,p=t.type,f=t.count,g=a.getBuffer(d),_=l(t).createArrayBufferView(g.buffer,g.byteOffset+t.byteOffset,f);if(o=new Array(f),m===s.FLOAT&&"MAT4"===p)for(var y=0;f>y;++y)o[y]=n.fromArray(_,16*y);v[r]=o}return o},u}),i("Scene/ModelAnimationLoop",["../Core/freezeObject"],function(e){"use strict";var t={NONE:0,REPEAT:1,MIRRORED_REPEAT:2};return e(t)}),i("Scene/ModelAnimationState",["../Core/freezeObject"],function(e){"use strict";return e({STOPPED:0,ANIMATING:1})}),i("Scene/ModelAnimation",["../Core/defaultValue","../Core/defineProperties","../Core/Event","../Core/JulianDate","./ModelAnimationLoop","./ModelAnimationState"],function(e,t,i,r,n,o){"use strict";function a(t,a,s){this._name=t.name,this._startTime=r.clone(t.startTime),this._delay=e(t.delay,0),this._stopTime=t.stopTime,this.removeOnStop=e(t.removeOnStop,!1),this._speedup=e(t.speedup,1),this._reverse=e(t.reverse,!1),this._loop=e(t.loop,n.NONE),this.start=new i,this.update=new i,this.stop=new i,this._state=o.STOPPED,this._runtimeAnimation=s,this._computedStartTime=void 0,this._duration=void 0;var l=this;this._raiseStartEvent=function(){l.start.raiseEvent(a,l)},this._updateEventTime=0,this._raiseUpdateEvent=function(){l.update.raiseEvent(a,l,l._updateEventTime)},this._raiseStopEvent=function(){l.stop.raiseEvent(a,l)}}return t(a.prototype,{name:{get:function(){return this._name}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},speedup:{get:function(){return this._speedup}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}}}),a}),i("Scene/ModelAnimationCollection",["../Core/clone","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","../Core/Math","./ModelAnimation","./ModelAnimationLoop","./ModelAnimationState"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e){this.animationAdded=new o,this.animationRemoved=new o,this._model=e,this._scheduledAnimations=[],this._previousTime=void 0}function d(e,t){for(var i=e.channelEvaluators,r=i.length,n=0;r>n;++n)i[n](t)}function m(e,t,i){return function(){e.animationRemoved.raiseEvent(t,i)}}r(h.prototype,{length:{get:function(){return this._scheduledAnimations.length}}}),h.prototype.add=function(e){e=t(e,t.EMPTY_OBJECT);var i=this._model,r=i._runtime.animations,n=r[e.name],o=new l(e,i,n);return this._scheduledAnimations.push(o),this.animationAdded.raiseEvent(i,o),o},h.prototype.addAll=function(i){i=t(i,t.EMPTY_OBJECT),i=e(i);for(var r=[],n=this._model._animationIds,o=n.length,a=0;o>a;++a)i.name=n[a],r.push(this.add(i));return r},h.prototype.remove=function(e){if(i(e)){var t=this._scheduledAnimations,r=t.indexOf(e);if(-1!==r)return t.splice(r,1),this.animationRemoved.raiseEvent(this._model,e),!0}return!1},h.prototype.removeAll=function(){var e=this._model,t=this._scheduledAnimations,i=t.length;this._scheduledAnimations=[];for(var r=0;i>r;++r)this.animationRemoved.raiseEvent(e,t[r])},h.prototype.contains=function(e){return i(e)?-1!==this._scheduledAnimations.indexOf(e):!1},h.prototype.get=function(e){return this._scheduledAnimations[e]};var p=[];return h.prototype.update=function(e){var r=this._scheduledAnimations,n=r.length;if(0===n)return this._previousTime=void 0,!1;if(a.equals(e.time,this._previousTime))return!1;this._previousTime=a.clone(e.time,this._previousTime);for(var o=!1,l=e.time,h=this._model,f=0;n>f;++f){var v=r[f],g=v._runtimeAnimation;i(v._computedStartTime)||(v._computedStartTime=a.addSeconds(t(v.startTime,l),v.delay,new a)),i(v._duration)||(v._duration=g.stopTime*(1/v.speedup));var _=v._computedStartTime,y=v._duration,C=v.stopTime,E=0!==y?a.secondsDifference(l,_)/y:0,S=E>=0,w=S&&(1>=E||v.loop===u.REPEAT||v.loop===u.MIRRORED_REPEAT)&&(!i(C)||a.lessThanOrEquals(l,C));if(w){if(v._state===c.STOPPED&&(v._state=c.ANIMATING,v.start.numberOfListeners>0&&e.afterRender.push(v._raiseStartEvent)),v.loop===u.REPEAT)E-=Math.floor(E);else if(v.loop===u.MIRRORED_REPEAT){var T=Math.floor(E),x=E-T;E=T%2===1?1-x:x}v.reverse&&(E=1-E);var b=E*y*v.speedup;b=s.clamp(b,g.startTime,g.stopTime),d(g,b),v.update.numberOfListeners>0&&(v._updateEventTime=b,e.afterRender.push(v._raiseUpdateEvent)),o=!0}else S&&v._state===c.ANIMATING&&(v._state=c.STOPPED,v.stop.numberOfListeners>0&&e.afterRender.push(v._raiseStopEvent),v.removeOnStop&&p.push(v))}n=p.length;for(var A=0;n>A;++A){var P=p[A];r.splice(r.indexOf(P),1),e.afterRender.push(m(this,h,P))}return p.length=0,o},h}),i("Scene/ModelMaterial",["../Core/defined","../Core/defineProperties","../Core/DeveloperError"],function(e,t,i){"use strict";function r(e,t,i){this._name=t.name,this._id=i,this._uniformMap=e._uniformMaps[i]}return t(r.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}}}),r.prototype.setValue=function(e,t){var i=this._uniformMap.values[e];i.value=i.clone(t,i.value)},r.prototype.getValue=function(t){var i=this._uniformMap.values[t];if(e(i))return i.value},r}),i("Scene/modelMaterialsCommon",["../Core/defaultValue","../Core/defined","../Renderer/WebGLConstants"],function(e,t,i){"use strict";function r(e){switch(e){case i.FLOAT:return"float";case i.FLOAT_VEC2:return"vec2";case i.FLOAT_VEC3:return"vec3";case i.FLOAT_VEC4:return"vec4";case i.FLOAT_MAT2:return"mat2";case i.FLOAT_MAT3:return"mat3";case i.FLOAT_MAT4:return"mat4";case i.SAMPLER_2D:return"sampler2D"}}function n(e){var r,n={};if(t(e.extensions)&&t(e.extensions.KHR_materials_common)&&(r=e.extensions.KHR_materials_common.lights),t(r)){var o=e.nodes;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];if(t(s.extensions)&&t(s.extensions.KHR_materials_common)){var l=s.extensions.KHR_materials_common.light;t(l)&&t(r[l])&&(r[l].node=a),delete s.extensions.KHR_materials_common}}var u=0;for(var c in r)if(r.hasOwnProperty(c)){var h=r[c],d=h.type;if("ambient"!==d&&!t(h.node)){delete r[c];continue}var m="light"+u.toString();switch(h.baseName=m,d){case"ambient":var p=h.ambient;n[m+"Color"]={type:i.FLOAT_VEC3,value:p.color};break;case"directional":var f=h.directional;n[m+"Color"]={type:i.FLOAT_VEC3,value:f.color},t(h.node)&&(n[m+"Transform"]={node:h.node,semantic:"MODELVIEW",type:i.FLOAT_MAT4});break;case"point":var v=h.point;n[m+"Color"]={type:i.FLOAT_VEC3,value:v.color},t(h.node)&&(n[m+"Transform"]={node:h.node,semantic:"MODELVIEW",type:i.FLOAT_MAT4}),n[m+"Attenuation"]={type:i.FLOAT_VEC3,value:[v.constantAttenuation,v.linearAttenuation,v.quadraticAttenuation]};break;case"spot":var g=h.spot;n[m+"Color"]={type:i.FLOAT_VEC3,value:g.color},t(h.node)&&(n[m+"Transform"]={node:h.node,semantic:"MODELVIEW",type:i.FLOAT_MAT4},n[m+"InverseTransform"]={node:h.node,semantic:"MODELVIEWINVERSE",type:i.FLOAT_MAT4,useInFragment:!0}),n[m+"Attenuation"]={type:i.FLOAT_VEC3,value:[g.constantAttenuation,g.linearAttenuation,g.quadraticAttenuation]},n[m+"FallOff"]={type:i.FLOAT_VEC2,value:[g.fallOffAngle,g.fallOffExponent]}}++u}}return n}function o(i,r,n){var o,a=e(n,0);do o=r+(a++).toString();while(t(i[o]));return o}function a(n,a,l){var u,p=n.techniques,f=n.shaders,v=n.programs,g=a.technique.toUpperCase();t(n.extensions)&&t(n.extensions.KHR_materials_common)&&(u=n.extensions.KHR_materials_common.lights);var _=e(a.jointCount,0),y=_>0,C=a.values,E="precision highp float;\n",S="precision highp float;\n",w=o(p,"technique",c),T=o(f,"vertexShader",h),x=o(f,"fragmentShader",d),b=o(v,"program",m),A="CONSTANT"!==g,P={modelViewMatrix:{semantic:"MODELVIEW",type:i.FLOAT_MAT4},projectionMatrix:{semantic:"PROJECTION",type:i.FLOAT_MAT4}};A&&(P.normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:i.FLOAT_MAT3}),y&&(P.jointMatrix={count:_,semantic:"JOINTMATRIX",type:i.FLOAT_MAT4});var I,M=!1;for(var D in C)if(C.hasOwnProperty(D)&&"transparent"!==D&&"doubleSided"!==D){ +var R=s(D,C[D]);I=D.toLowerCase(),M||R!==i.SAMPLER_2D||(M=!0),P[I]={type:R}}if(t(l))for(var O in l)l.hasOwnProperty(O)&&(P[O]=l[O]);var N={};for(var L in P)if(P.hasOwnProperty(L)){var F=P[L];N["u_"+L]=L;var B=t(F.count)?"["+F.count+"]":"";F.type!==i.FLOAT_MAT3&&F.type!==i.FLOAT_MAT4||F.useInFragment?(S+="uniform "+r(F.type)+" u_"+L+B+";\n",delete F.useInFragment):E+="uniform "+r(F.type)+" u_"+L+B+";\n"}var V="";y&&(V+=" mat4 skinMat = a_weight.x * u_jointMatrix[int(a_joint.x)];\n",V+=" skinMat += a_weight.y * u_jointMatrix[int(a_joint.y)];\n",V+=" skinMat += a_weight.z * u_jointMatrix[int(a_joint.z)];\n",V+=" skinMat += a_weight.w * u_jointMatrix[int(a_joint.w)];\n");var k={a_position:"position"};P.position={semantic:"POSITION",type:i.FLOAT_VEC3},E+="attribute vec3 a_position;\n",E+="varying vec3 v_positionEC;\n",V+=y?" vec4 pos = u_modelViewMatrix * skinMat * vec4(a_position,1.0);\n":" vec4 pos = u_modelViewMatrix * vec4(a_position,1.0);\n",V+=" v_positionEC = pos.xyz;\n",V+=" gl_Position = u_projectionMatrix * pos;\n",S+="varying vec3 v_positionEC;\n",A&&(k.a_normal="normal",P.normal={semantic:"NORMAL",type:i.FLOAT_VEC3},E+="attribute vec3 a_normal;\n",E+="varying vec3 v_normal;\n",V+=y?" v_normal = u_normalMatrix * mat3(skinMat) * a_normal;\n":" v_normal = u_normalMatrix * a_normal;\n",S+="varying vec3 v_normal;\n");var z;M&&(k.a_texcoord_0="texcoord_0",P.texcoord_0={semantic:"TEXCOORD_0",type:i.FLOAT_VEC2},z="v_texcoord_0",E+="attribute vec2 a_texcoord_0;\n",E+="varying vec2 "+z+";\n",V+=" "+z+" = a_texcoord_0;\n",S+="varying vec2 "+z+";\n"),y&&(k.a_joint="joint",P.joint={semantic:"JOINT",type:i.FLOAT_VEC4},k.a_weight="weight",P.weight={semantic:"WEIGHT",type:i.FLOAT_VEC4},E+="attribute vec4 a_joint;\n",E+="attribute vec4 a_weight;\n");var U=A&&("BLINN"===g||"PHONG"===g)&&t(P.specular)&&t(P.shininess),G=!1,W=!1,H="";for(var q in u)if(u.hasOwnProperty(q)){var j=u[q],Y=j.type.toLowerCase(),X=j.baseName;H+=" {\n";var Z,K,Q="u_"+X+"Color";"ambient"===Y?(W=!0,H+=" ambientLight += "+Q+";\n"):A&&(G=!0,Z="v_"+X+"Direction",K="v_"+X+"Position","point"!==Y&&(E+="varying vec3 "+Z+";\n",S+="varying vec3 "+Z+";\n",V+=" "+Z+" = mat3(u_"+X+"Transform) * vec3(0.,0.,1.);\n","directional"===Y&&(H+=" vec3 l = normalize("+Z+");\n")),"directional"!==Y?(E+="varying vec3 "+K+";\n",S+="varying vec3 "+K+";\n",V+=" "+K+" = u_"+X+"Transform[3].xyz;\n",H+=" vec3 VP = "+K+" - v_positionEC;\n",H+=" vec3 l = normalize(VP);\n",H+=" float range = length(VP);\n",H+=" float attenuation = 1.0 / (u_"+X+"Attenuation.x + ",H+="(u_"+X+"Attenuation.y * range) + ",H+="(u_"+X+"Attenuation.z * range * range));\n"):H+=" float attenuation = 1.0;\n","spot"===Y&&(H+=" float spotDot = dot(l, normalize("+Z+"));\n",H+=" if (spotDot < cos(u_"+X+"FallOff.x * 0.5))\n",H+=" {\n",H+=" attenuation = 0.0;\n",H+=" }\n",H+=" else\n",H+=" {\n",H+=" attenuation *= max(0.0, pow(spotDot, u_"+X+"FallOff.y));\n",H+=" }\n"),H+=" diffuseLight += "+Q+"* max(dot(normal,l), 0.) * attenuation;\n",U&&("BLINN"===g?(H+=" vec3 h = normalize(l + viewDir);\n",H+=" float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess)) * attenuation;\n"):(H+=" vec3 reflectDir = reflect(-l, normal);\n",H+=" float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess)) * attenuation;\n"),H+=" specularLight += "+Q+" * specularIntensity;\n")),H+=" }\n"}W||(H+=" ambientLight += vec3(0.2, 0.2, 0.2);\n"),G||"CONSTANT"===g||(H+=" vec3 l = normalize(czm_sunDirectionEC);\n",H+=" diffuseLight += vec3(1.0, 1.0, 1.0) * max(dot(normal,l), 0.);\n",U&&("BLINN"===g?(H+=" vec3 h = normalize(l + viewDir);\n",H+=" float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess));\n"):(H+=" vec3 reflectDir = reflect(-l, normal);\n",H+=" float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess));\n"),H+=" specularLight += vec3(1.0, 1.0, 1.0) * specularIntensity;\n")),E+="void main(void) {\n",E+=V,E+="}\n",S+="void main(void) {\n";var J=" vec3 color = vec3(0.0, 0.0, 0.0);\n";A&&(S+=" vec3 normal = normalize(v_normal);\n",a.doubleSided&&(S+=" if (gl_FrontFacing == false)\n",S+=" {\n",S+=" normal = -normal;\n",S+=" }\n"));var $;"CONSTANT"!==g?(t(P.diffuse)&&(S+=P.diffuse.type===i.SAMPLER_2D?" vec4 diffuse = texture2D(u_diffuse, "+z+");\n":" vec4 diffuse = u_diffuse;\n",S+=" vec3 diffuseLight = vec3(0.0, 0.0, 0.0);\n",J+=" color += diffuse.rgb * diffuseLight;\n"),U&&(S+=P.specular.type===i.SAMPLER_2D?" vec3 specular = texture2D(u_specular, "+z+").rgb;\n":" vec3 specular = u_specular.rgb;\n",S+=" vec3 specularLight = vec3(0.0, 0.0, 0.0);\n",J+=" color += specular * specularLight;\n"),$=t(P.transparency)?" gl_FragColor = vec4(color * diffuse.a, diffuse.a * u_transparency);\n":" gl_FragColor = vec4(color * diffuse.a, diffuse.a);\n"):$=t(P.transparency)?" gl_FragColor = vec4(color, u_transparency);\n":" gl_FragColor = vec4(color, 1.0);\n",t(P.emission)&&(S+=P.emission.type===i.SAMPLER_2D?" vec3 emission = texture2D(u_emission, "+z+").rgb;\n":" vec3 emission = u_emission.rgb;\n",J+=" color += emission;\n"),(t(P.ambient)||"CONSTANT"!==g)&&(S+=t(P.ambient)?P.ambient.type===i.SAMPLER_2D?" vec3 ambient = texture2D(u_ambient, "+z+").rgb;\n":" vec3 ambient = u_ambient.rgb;\n":" vec3 ambient = diffuse.rgb;\n",J+=" color += ambient * ambientLight;\n"),S+=" vec3 viewDir = -normalize(v_positionEC);\n",S+=" vec3 ambientLight = vec3(0.0, 0.0, 0.0);\n",S+=H,S+=J,S+=$,S+="}\n";var ee;ee=a.transparent?{enable:[i.DEPTH_TEST,i.BLEND],depthMask:!1,functions:{blendEquationSeparate:[i.FUNC_ADD,i.FUNC_ADD],blendFuncSeparate:[i.ONE,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA]}}:a.doubleSided?{enable:[i.DEPTH_TEST]}:{enable:[i.CULL_FACE,i.DEPTH_TEST]},p[w]={attributes:k,parameters:P,program:b,states:ee,uniforms:N},f[T]={type:i.VERTEX_SHADER,uri:"",extras:{source:E}},f[x]={type:i.FRAGMENT_SHADER,uri:"",extras:{source:S}};var te=Object.keys(k);return v[b]={attributes:te,fragmentShader:x,vertexShader:T},w}function s(e,r){var n;switch(n=t(r.value)?r.value:r,e){case"ambient":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"diffuse":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"emission":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"specular":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"shininess":return i.FLOAT;case"transparency":return i.FLOAT;case"transparent":return i.BOOL;case"doubleSided":return i.BOOL}}function l(t){var i="";i+="technique:"+t.technique+";";for(var r=t.values,n=Object.keys(r).sort(),o=n.length,a=0;o>a;++a){var l=n[a];r.hasOwnProperty(l)&&"transparent"!==l&&"doubleSided"!==l&&(i+=l+":"+s(l,r[l]),i+=";")}var u=e(t.doubleSided,!1);i+=u.toString()+";";var c=e(t.transparent,!1);i+=c.toString()+";";var h=e(t.jointCount,0);return i+=h.toString()+";"}function u(e){if(t(e)){var i=!1,r=e.extensionsUsed;if(t(r))for(var o=r.length,s=0;o>s;++s)if("KHR_materials_common"===r[s]){i=!0,r.splice(s,1);break}if(i){t(e.programs)||(e.programs={}),t(e.shaders)||(e.shaders={}),t(e.techniques)||(e.techniques={});var u=n(e),c={},h=e.materials;for(var d in h)if(h.hasOwnProperty(d)){var m=h[d];if(t(m.extensions)&&t(m.extensions.KHR_materials_common)){var p=m.extensions.KHR_materials_common,f=l(p),v=c[f];t(v)||(v=a(e,p,u),c[f]=v),m.values={};var g=p.values;for(var _ in g)if(g.hasOwnProperty(_)){var y=g[_];t(y.value)?m.values[_]=y.value:m.values[_]=y}m.technique=v,delete m.extensions.KHR_materials_common}}t(e.extensions)&&delete e.extensions.KHR_materials_common}return e}}var c=0,h=0,d=0,m=0;return u}),i("Scene/ModelMesh",["../Core/defineProperties"],function(e){"use strict";function t(e,t,i){for(var r=[],n=e.primitives,o=n.length,a=0;o>a;++a){var s=n[a];r[a]=t[s.material]}this._name=e.name,this._materials=r,this._id=i}return e(t.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},materials:{get:function(){return this._materials}}}),t}),i("Scene/ModelNode",["../Core/defaultValue","../Core/defineProperties","../Core/Matrix4"],function(e,t,i){"use strict";function r(e,t,r,n,o){this._model=e,this._runtimeNode=r,this._name=t.name,this._id=n,this.useMatrix=!1,this._show=!0,this._matrix=i.clone(o)}return t(r.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,this._model._perNodeShowDirty=!0)}},matrix:{get:function(){return this._matrix},set:function(e){this._matrix=i.clone(e,this._matrix),this.useMatrix=!0;var t=this._model;t._cesiumAnimationsDirty=!0,this._runtimeNode.dirtyNumber=t._maxDirtyNumber}}}),r.prototype.setMatrix=function(e){i.clone(e,this._matrix)},r}),i("Scene/Model",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/clone","../Core/combine","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/getAbsoluteUri","../Core/getBaseUri","../Core/getMagic","../Core/getStringFromTypedArray","../Core/IndexDatatype","../Core/loadArrayBuffer","../Core/loadImage","../Core/loadImageFromTypedArray","../Core/loadText","../Core/Math","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/PrimitiveType","../Core/Quaternion","../Core/Queue","../Core/RuntimeError","../Core/throttleRequestByServer","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/Sampler","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Renderer/VertexArray","../Renderer/WebGLConstants","../ThirdParty/gltfDefaults","../ThirdParty/Uri","../ThirdParty/when","./getModelAccessor","./ModelAnimationCache","./ModelAnimationCollection","./ModelMaterial","./modelMaterialsCommon","./ModelMesh","./ModelNode","./Pass","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O,N,L,F,B,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee){"use strict";function te(){this.buffersToCreate=new P,this.buffers={},this.pendingBufferLoads=0,this.programsToCreate=new P,this.shaders={},this.pendingShaderLoads=0,this.texturesToCreate=new P,this.pendingTextureLoads=0,this.texturesToCreateFromBufferView=new P,this.pendingBufferViewToImage=0,this.createSamplers=!0,this.createSkins=!0,this.createRuntimeAnimations=!0,this.createVertexArrays=!0,this.createRenderStates=!0,this.createUniformMaps=!0,this.createRuntimeNodes=!0,this.createElementBuffers=!0,this.skinnedNodesIds=[]}function ie(e,t){e._cachedGltf=t,e._animationIds=ne(t)}function re(e){this._gltf=K(W(e.gltf)),this._bgltf=e.bgltf,this.ready=e.ready,this.modelsToLoad=[],this.count=0}function ne(e){var t=[];if(l(e)&&l(e.gltf)){var i=e.gltf.animations;for(var r in i)i.hasOwnProperty(r)&&t.push(r)}return t}function oe(t){t=s(t,s.EMPTY_OBJECT);var i=t.cacheKey;this._cacheKey=i,this._cachedGltf=void 0,this._releaseGltfJson=s(t.releaseGltfJson,!1),this._animationIds=void 0;var r;if(l(i)&&l(It[i])&&It[i].ready)r=It[i],++r.count;else{var n=t.gltf;if(l(n)){if(n instanceof ArrayBuffer&&(n=new Uint8Array(n)),n instanceof Uint8Array){var o=le(n);0!==o.binaryOffset&&(n=n.subarray(o.binaryOffset)),r=new re({gltf:o.glTF,bgltf:n,ready:!0})}else r=new re({gltf:t.gltf,ready:!0});r.count=1,l(i)&&(It[i]=r)}}ie(this,r),this._shaderOverride=t.shaderOverride,this._basePath=s(t.basePath,"");var a=new H(document.location.href),u=new H(this._basePath);this._baseUri=u.resolve(a),this.show=s(t.show,!0),this.modelMatrix=x.clone(s(t.modelMatrix,x.IDENTITY)),this._modelMatrix=x.clone(this.modelMatrix),this.scale=s(t.scale,1),this._scale=this.scale,this.minimumPixelSize=s(t.minimumPixelSize,0),this._minimumPixelSize=this.minimumPixelSize,this.maximumScale=t.maximumScale,this._maximumScale=this.maximumScale,this.id=t.id,this._id=t.id,this.pickPrimitive=t.pickPrimitive,this._allowPicking=s(t.allowPicking,!0),this._ready=!1,this._readyPromise=q.defer(),this.activeAnimations=new X(this),this._defaultTexture=void 0,this._incrementallyLoadTextures=s(t.incrementallyLoadTextures,!0),this._asynchronous=s(t.asynchronous,!0),this.debugShowBoundingVolume=s(t.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=s(t.debugWireframe,!1),this._debugWireframe=!1,this._precreatedAttributes=t.precreatedAttributes,this._vertexShaderLoaded=t.vertexShaderLoaded,this._fragmentShaderLoaded=t.fragmentShaderLoaded,this._uniformMapLoaded=t.uniformMapLoaded,this._pickVertexShaderLoaded=t.pickVertexShaderLoaded,this._pickFragmentShaderLoaded=t.pickFragmentShaderLoaded,this._pickUniformMapLoaded=t.pickUniformMapLoaded,this._ignoreCommands=s(t.ignoreCommands,!1),this.cull=s(t.cull,!0),this._computedModelMatrix=new x,this._initialRadius=void 0,this._boundingSphere=void 0,this._scaledBoundingSphere=new e,this._state=xt.NEEDS_LOAD,this._loadResources=void 0,this._perNodeShowDirty=!1,this._cesiumAnimationsDirty=!1,this._dirty=!1,this._maxDirtyNumber=0,this._runtime={animations:void 0,rootNodes:void 0,nodes:void 0,nodesByName:void 0,skinnedNodes:void 0,meshesByName:void 0,materialsByName:void 0,materialsById:void 0},this._uniformMaps={},this._rendererResources={buffers:{},vertexArrays:{},programs:{},pickPrograms:{},textures:{},samplers:{},renderStates:{}},this._cachedRendererResources=void 0,this._loadRendererResourcesFromCache=!1,this._nodeCommands=[],this._pickIds=[],this._rtcCenter=void 0,this._rtcCenterEye=void 0,this._loadOptions=t.loadOptions}function ae(e,t,i){return e.subarray(t,t+i)}function se(e){var t=f(e);return"glTF"===t}function le(e){if(!se(e))throw new h("bgltf is not a valid Binary glTF file.");var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=0;i+=Mt,i+=Mt,i+=Mt;var r=t.getUint32(i,!0);i+=Mt+Mt;var n=i,o=n+r,a=v(e,n,r);return{glTF:JSON.parse(a),binaryOffset:o}}function ue(e,t,i){return e._runtime[t][i]}function ce(t){for(var r=t.nodes,n=t.meshes,o=t.accessors,a=t.scenes[t.scene].nodes,s=a.length,u=[],c=new i(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),h=new i(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),d=0;s>d;++d){var m=r[a[d]];for(m._transformToRoot=Ce(m),u.push(m);u.length>0;){m=u.pop();var p=m._transformToRoot,f=m.meshes;if(l(f))for(var v=f.length,g=0;v>g;++g)for(var _=n[f[g]].primitives,y=_.length,C=0;y>C;++C){var E=_[C].attributes.POSITION;if(l(E)){var S=o[E],w=i.fromArray(S.min,0,Dt),T=i.fromArray(S.max,0,Rt);l(c)&&l(h)&&(x.multiplyByPoint(p,w,w),x.multiplyByPoint(p,T,T),i.minimumByComponent(c,w,c),i.maximumByComponent(h,T,h))}}for(var b=m.children,A=b.length,P=0;A>P;++P){var I=r[b[P]];I._transformToRoot=Ce(I),x.multiplyTransformation(p,I._transformToRoot,I._transformToRoot),u.push(I)}delete m._transformToRoot}}var M=e.fromCornerPoints(c,h);return e.transformWithoutScale(M,wt,M)}function he(e,t,i){return function(){e._state=xt.FAILED,e._readyPromise.reject(new I("Failed to load "+t+": "+i))}}function de(e,t){return function(i){var r=e._loadResources;r.buffers[t]=new Uint8Array(i),--r.pendingBufferLoads}}function me(e){var t=e.gltf.buffers;for(var i in t)if(t.hasOwnProperty(i)){var r=t[i];if("binary_glTF"===i||"KHR_binary_glTF"===i){var n=e._loadResources;n.buffers[i]=e._cachedGltf.bgltf}else if("arraybuffer"===r.type){++e._loadResources.pendingBufferLoads;var o=new H(r.uri),a=o.resolve(e._baseUri).toString();_(a).then(de(e,i)).otherwise(he(e,"buffer",a))}}}function pe(e){var t=e.gltf.bufferViews;for(var i in t)t.hasOwnProperty(i)&&t[i].target===G.ARRAY_BUFFER&&e._loadResources.buffersToCreate.enqueue(i)}function fe(e,t){return function(i){var r=e._loadResources;r.shaders[t]={source:i,bufferView:void 0},--r.pendingShaderLoads}}function ve(e){var t=e.gltf.shaders;if(!l(e._shaderParser)||!e._shaderParser(t))for(var i in t)if(t.hasOwnProperty(i)){var r=t[i];if(l(r.extras)&&l(r.extras.source))e._loadResources.shaders[i]={source:r.extras.source,bufferView:void 0};else if(l(r.extensions)&&l(r.extensions.KHR_binary_glTF)){var n=r.extensions.KHR_binary_glTF;e._loadResources.shaders[i]={source:void 0,bufferView:n.bufferView}}else{var o;if(e._shaderOverride&&(o=e._shaderOverride(r,i,e.gltf)))++e._loadResources.pendingShaderLoads,fe(e,i)(o);else{++e._loadResources.pendingShaderLoads;var a=new H(r.uri),s=a.resolve(e._baseUri).toString();E(s,e._loadOptions).then(fe(e,i)).otherwise(he(e,"shader",s))}}}}function ge(e){var t=e.gltf.programs;for(var i in t)t.hasOwnProperty(i)&&e._loadResources.programsToCreate.enqueue(i)}function _e(e,t){return function(i){var r=e._loadResources;--r.pendingTextureLoads,r.texturesToCreate.enqueue({id:t,image:i,bufferView:void 0})}}function ye(e){var t=e.gltf.images,i=e.gltf.textures;for(var r in i)if(i.hasOwnProperty(r)){var n=t[i[r].source];if(l(n.extensions)&&l(n.extensions.KHR_binary_glTF)){var o=n.extensions.KHR_binary_glTF;e._loadResources.texturesToCreateFromBufferView.enqueue({id:r,image:void 0,bufferView:o.bufferView,mimeType:o.mimeType})}else{var a=new H(n.uri),s=a.resolve(e._baseUri).toString(),u=At.textures.get(s);if(u)u.ref(),e._rendererResources.textures[r]=u;else{var c=At.images.get(s);++e._loadResources.pendingTextureLoads,l(c)?(c.ref(),c.then(function(e,t){_e(this,e)(t),c=void 0}.bind(e,r))):c=At.images.set(s,y(s).then(function(e,t){return _e(this,e)(t),c=void 0,t}.bind(e,r)).otherwise(he(e,"image",s)))}}}}function Ce(e){return l(e.matrix)?x.fromArray(e.matrix):x.fromTranslationQuaternionRotationScale(i.fromArray(e.translation,0,Ot),A.unpack(e.rotation,0,Nt),i.fromArray(e.scale,0,Lt))}function Ee(e){var t={},i={},r=[],n=e._loadResources.skinnedNodesIds,o=e.gltf.nodes;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a],u={matrix:void 0,translation:void 0,rotation:void 0,scale:void 0,computedShow:!0,transformToRoot:new x,computedMatrix:new x,dirtyNumber:0,commands:[],inverseBindMatrices:void 0,bindShapeMatrix:void 0,joints:[],computedJointMatrices:[],jointName:s.jointName,children:[],parents:[],publicNode:void 0};u.publicNode=new J(e,s,u,a,Ce(s)),t[a]=u,i[s.name]=u,l(s.skin)&&(n.push(a),r.push(u))}e._runtime.nodes=t,e._runtime.nodesByName=i,e._runtime.skinnedNodes=r}function Se(e){var t={},i={},r=e.gltf.materials,n=e._uniformMaps;for(var o in r)if(r.hasOwnProperty(o)){n[o]={uniformMap:void 0,values:void 0,jointMatrixUniformName:void 0};var a=r[o],s=new Z(e,a,o);t[a.name]=s,i[o]=s}e._runtime.materialsByName=t,e._runtime.materialsById=i}function we(e){var t={},i=e._runtime.materialsById,r=e.gltf.meshes;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];t[o.name]=new Q(o,i,n)}e._runtime.meshesByName=t}function Te(e){e._loadRendererResourcesFromCache||(me(e),pe(e),ve(e),ge(e),ye(e)),Se(e),we(e),Ee(e)}function xe(e,t){var i=e._loadResources;if(0===i.pendingBufferLoads){for(var r,n=e.gltf.bufferViews,o=e._rendererResources.buffers;i.buffersToCreate.length>0;){var a=i.buffersToCreate.dequeue();r=n[a];var s=D.createVertexBuffer({context:t,typedArray:i.getBuffer(r),usage:R.STATIC_DRAW});s.vertexArrayDestroyable=!1,o[a]=s}if(i.createElementBuffers){var u=e.gltf.accessors;for(var c in u)if(u.hasOwnProperty(c)){var h=u[c];if(r=n[h.bufferView],r.target===G.ELEMENT_ARRAY_BUFFER&&!l(o[h.bufferView])){var d=D.createIndexBuffer({context:t,typedArray:i.getBuffer(r),usage:R.STATIC_DRAW,indexDatatype:h.componentType});d.vertexArrayDestroyable=!1,o[h.bufferView]=d}}i.createElementBuffers=!1}}}function be(e){for(var t={},i=e.length,r=0;i>r;++r)t[e[r]]=r;return t}function Ae(e,t){if(l(t.source))return t.source;var i=e._loadResources,r=e.gltf,n=r.bufferViews[t.bufferView];return v(i.getBuffer(n))}function Pe(e,t,i){return l(i)&&(e=i(e,t)),e}function Ie(e,t,i){var r=t.gltf.programs,n=t._loadResources.shaders,o=r[e],a=be(o.attributes),s=Ae(t,n[o.vertexShader]),u=Ae(t,n[o.fragmentShader]),c=Pe(s,e,t._vertexShaderLoaded),h=Pe(u,e,t._fragmentShaderLoaded),d=o.attributes.length,m=t._precreatedAttributes;if(l(m))for(var p in m)m.hasOwnProperty(p)&&(a[p]=d++);if(t._rendererResources.programs[e]=F.fromCache({context:i,vertexShaderSource:c,fragmentShaderSource:h,attributeLocations:a}),t.allowPicking){var f=Pe(s,e,t._pickVertexShaderLoaded),v=Pe(u,e,t._pickFragmentShaderLoaded);t._pickFragmentShaderLoaded||(v=B.createPickFragmentShaderSource(u,"uniform")),t._rendererResources.pickPrograms[e]=F.fromCache({context:i,vertexShaderSource:f,fragmentShaderSource:v,attributeLocations:a})}}function Me(e,t){var i,r=e._loadResources;if(0===r.pendingShaderLoads&&0===r.pendingBufferLoads)if(e.asynchronous)r.programsToCreate.length>0&&(i=r.programsToCreate.dequeue(),Ie(i,e,t));else for(;r.programsToCreate.length>0;)i=r.programsToCreate.dequeue(),Ie(i,e,t)}function De(e,t){return function(i){e.texturesToCreate.enqueue({id:t.id,image:i,bufferView:void 0}),--e.pendingBufferViewToImage}}function Re(e){var t=e._loadResources;if(0===t.pendingBufferLoads)for(;t.texturesToCreateFromBufferView.length>0;){var i=t.texturesToCreateFromBufferView.dequeue(),r=e.gltf,n=r.bufferViews[i.bufferView],o=De(t,i),a=he(e,"image","id: "+i.id+", bufferView: "+i.bufferView);C(t.getBuffer(n),i.mimeType).then(o).otherwise(a),++t.pendingBufferViewToImage}}function Oe(e,t){var i=e._loadResources;if(i.createSamplers){i.createSamplers=!1;var r=e._rendererResources.samplers,n=e.gltf.samplers;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];r[o]=new L({wrapS:a.wrapS,wrapT:a.wrapT,minificationFilter:a.minFilter,magnificationFilter:a.magFilter})}}}function Ne(e,t,i){var r=e.image.src,n=At.textures.get(r);if(n)return t._rendererResources.textures[e.id]=n,n.ref(),void At.images.get(r).unref();var o=t.gltf.textures,n=o[e.id],a=t._rendererResources.samplers,s=a[n.sampler],l=s.minificationFilter===k.NEAREST_MIPMAP_NEAREST||s.minificationFilter===k.NEAREST_MIPMAP_LINEAR||s.minificationFilter===k.LINEAR_MIPMAP_NEAREST||s.minificationFilter===k.LINEAR_MIPMAP_LINEAR,u=l||s.wrapS===z.REPEAT||s.wrapS===z.MIRRORED_REPEAT||s.wrapT===z.REPEAT||s.wrapT===z.MIRRORED_REPEAT,c=e.image,h=!S.isPowerOfTwo(c.width)||!S.isPowerOfTwo(c.height);if(u&&h){var d=document.createElement("canvas");d.width=S.nextPowerOfTwo(c.width),d.height=S.nextPowerOfTwo(c.height);var m=d.getContext("2d");m.drawImage(c,0,0,c.width,c.height,0,0,d.width,d.height),c=d}var p;n.target===G.TEXTURE_2D&&(p=new V({context:i,source:c,pixelFormat:n.internalFormat,pixelDatatype:n.type,sampler:s,flipY:!1})),l&&p.generateMipmap(),t._rendererResources.textures[e.id]=p,At.textures.set(r,p),At.images.get(r).unref()}function Le(e,t){var i,r=e._loadResources;if(e.asynchronous)r.texturesToCreate.length>0&&(i=r.texturesToCreate.dequeue(),Ne(i,e,t));else for(;r.texturesToCreate.length>0;)i=r.texturesToCreate.dequeue(),Ne(i,e,t)}function Fe(e,t){var i=e.gltf,r=i.techniques,n=i.materials,o={},a=r[n[t.material].technique],s=a.parameters,u=a.attributes,c=e._rendererResources.programs[a.program].vertexAttributes;for(var h in c)if(c.hasOwnProperty(h)){var d=u[h],m=c[h].index;if(l(d)){var p=s[d];o[p.semantic]=m}else o[h]=m}return o}function Be(e,t,i){for(var r=e.length,n=0;r>n;++n)for(var o=[e[n]];o.length>0;){var a=o.pop(),s=i[a];if(s.jointName===t)return a;for(var l=s.children,u=l.length,c=0;u>c;++c)o.push(l[c])}}function Ve(e,t){for(var i=e.gltf,r=i.skins,n=i.nodes,o=e._runtime.nodes,a=e._loadResources.skinnedNodesIds,s=a.length,l=0;s>l;++l){var u=a[l],c=o[u],h=n[u],d=t[h.skin];c.inverseBindMatrices=d.inverseBindMatrices,c.bindShapeMatrix=d.bindShapeMatrix;for(var m=[],p=h.skeletons,f=p.length,v=0;f>v;++v)m.push(p[v]);for(var g=r[h.skin].jointNames,_=g.length,y=0;_>y;++y){var C=g[y],E=o[Be(m,C,n)];c.joints.push(E)}}}function ke(e){var t=e._loadResources;if(0===t.pendingBufferLoads&&t.createSkins){t.createSkins=!1;var i=e.gltf,r=i.accessors,n=i.skins,o={};for(var a in n)if(n.hasOwnProperty(a)){var s,l=n[a],u=r[l.inverseBindMatrices];x.equals(l.bindShapeMatrix,x.IDENTITY)||(s=x.clone(l.bindShapeMatrix)),o[a]={inverseBindMatrices:Y.getSkinInverseBindMatrices(e,u),bindShapeMatrix:s}}Ve(e,o)}}function ze(e,t,i,r){return function(n){t[i]=r.evaluate(n,t[i]),t.dirtyNumber=e._maxDirtyNumber}}function Ue(e){var t=e._loadResources;if(t.finishedPendingBufferLoads()&&t.createRuntimeAnimations){t.createRuntimeAnimations=!1,e._runtime.animations={};var i=e._runtime.nodes,r=e.gltf.animations,n=e.gltf.accessors;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o],s=a.channels,l=a.parameters,u=a.samplers,c={};for(var h in l)l.hasOwnProperty(h)&&(c[h]=Y.getAnimationParameterValues(e,n[l[h]]));for(var d=Number.MAX_VALUE,m=-Number.MAX_VALUE,p=s.length,f=new Array(p),v=0;p>v;++v){var g=s[v],_=g.target,y=u[g.sampler],C=c[y.input];d=Math.min(d,C[0]),m=Math.max(m,C[C.length-1]);var E=Y.getAnimationSpline(e,o,a,g.sampler,y,c);f[v]=ze(e,i[_.id],_.path,E)}e._runtime.animations[o]={startTime:d,stopTime:m,channelEvaluators:f}}}}function Ge(e,t){var i=e._loadResources;if(i.finishedBuffersCreation()&&i.finishedProgramCreation()&&i.createVertexArrays){i.createVertexArrays=!1;var r=e._rendererResources.buffers,n=e._rendererResources.vertexArrays,o=e.gltf,a=o.accessors,s=o.meshes;for(var u in s)if(s.hasOwnProperty(u))for(var c=s[u].primitives,h=c.length,d=0;h>d;++d){var m,p,f,v=c[d],g=Fe(e,v),_=[],y=v.attributes;for(m in y)if(y.hasOwnProperty(m)&&(p=g[m],l(p))){var C=a[y[m]];_.push({index:p,vertexBuffer:r[C.bufferView],componentsPerAttribute:j(C).componentsPerAttribute,componentDatatype:C.componentType,normalize:!1,offsetInBytes:C.byteOffset,strideInBytes:C.byteStride})}var E=e._precreatedAttributes;if(l(E))for(m in E)E.hasOwnProperty(m)&&(p=g[m],l(p)&&(f=E[m],f.index=p,_.push(f)));var S;if(l(v.indices)){var w=a[v.indices];S=r[w.bufferView]}n[u+".primitive."+d]=new U({context:t,attributes:_,indexBuffer:S})}}}function We(e){var t={};t[G.BLEND]=!1,t[G.CULL_FACE]=!1,t[G.DEPTH_TEST]=!1,t[G.POLYGON_OFFSET_FILL]=!1,t[G.SCISSOR_TEST]=!1;var i,r=e.enable,n=r.length;for(i=0;n>i;++i)t[r[i]]=!0;return t}function He(e,t){var i=e._loadResources;if(i.createRenderStates){i.createRenderStates=!1;var r=e._rendererResources.renderStates,n=e.gltf.techniques;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o],u=a.states,c=We(u),h=s(u.functions,s.EMPTY_OBJECT),d=s(h.blendColor,[0,0,0,0]),m=s(h.blendEquationSeparate,[G.FUNC_ADD,G.FUNC_ADD]),p=s(h.blendFuncSeparate,[G.ONE,G.ONE,G.ZERO,G.ZERO]),f=s(h.colorMask,[!0,!0,!0,!0]),v=s(h.depthRange,[0,1]),g=s(h.polygonOffset,[0,0]),_=s(h.scissor,[0,0,0,0]);r[o]=N.fromCache({frontFace:l(h.frontFace)?h.frontFace[0]:G.CCW,cull:{enabled:c[G.CULL_FACE],face:l(h.cullFace)?h.cullFace[0]:G.BACK},lineWidth:l(h.lineWidth)?h.lineWidth[0]:1,polygonOffset:{enabled:c[G.POLYGON_OFFSET_FILL],factor:g[0],units:g[1]},scissorTest:{enabled:c[G.SCISSOR_TEST],rectangle:{x:_[0],y:_[1],width:_[2],height:_[3]}},depthRange:{near:v[0],far:v[1]},depthTest:{enabled:c[G.DEPTH_TEST],func:l(h.depthFunc)?h.depthFunc[0]:G.LESS},colorMask:{red:f[0],green:f[1],blue:f[2],alpha:f[3]},depthMask:l(h.depthMask)?h.depthMask[0]:!0,blending:{enabled:c[G.BLEND],color:{red:d[0],green:d[1],blue:d[2],alpha:d[3]},equationRgb:m[0],equationAlpha:m[1],functionSourceRgb:p[0],functionSourceAlpha:p[1],functionDestinationRgb:p[2],functionDestinationAlpha:p[3]}})}}}function qe(e,t){var i={value:e,clone:function(e,t){return e},func:function(){return i.value}};return i}function je(e,i){var r={value:t.fromArray(e),clone:t.clone,func:function(){return r.value}};return r}function Ye(e,t){var r={value:i.fromArray(e),clone:i.clone,func:function(){return r.value}};return r}function Xe(e,t){var i={value:r.fromArray(e),clone:r.clone,func:function(){return i.value}};return i}function Ze(e,t){var i={value:w.fromColumnMajorArray(e),clone:w.clone,func:function(){return i.value}};return i}function Ke(e,t){var i={value:T.fromColumnMajorArray(e),clone:T.clone,func:function(){return i.value}};return i}function Qe(e,t){var i={value:x.fromColumnMajorArray(e),clone:x.clone,func:function(){return i.value}};return i}function Je(e,t){this._value=void 0,this._textureId=e,this._model=t}function $e(e,t){var i=new Je(e,t);return i.func=function(){return i.value},i}function et(e,t,i,r){var n=t._runtime.nodes[e];return kt[i](r,t,n)}function tt(e,t){var i=e._loadResources;if(i.finishedProgramCreation()&&i.createUniformMaps){i.createUniformMaps=!1;var r=e.gltf,n=r.materials,o=r.techniques,a=e._uniformMaps;for(var s in n)if(n.hasOwnProperty(s)){var u,c=n[s],h=c.values,d=o[c.technique],m=d.parameters,p=d.uniforms,f={},v={};for(var g in p)if(p.hasOwnProperty(g)){var _=p[g],y=m[_];if(l(h[_])){var C=Vt[y.type](h[_],e);f[g]=C.func,v[_]=C}else if(l(y.node))f[g]=et(y.node,e,y.semantic,t.uniformState);else if(l(y.semantic))"JOINTMATRIX"!==y.semantic?f[g]=Bt[y.semantic](t.uniformState,e):u=g;else if(l(y.value)){var E=Vt[y.type](y.value,e);f[g]=E.func,v[_]=E}}var S=a[s];S.uniformMap=f,S.values=v,S.jointMatrixUniformName=u}}}function it(e){return function(){return e}}function rt(e){return function(){return e.computedJointMatrices}}function nt(t,r,n,u){for(var c=t._nodeCommands,h=t._pickIds,d=t.allowPicking,m=t._runtime.meshesByName,p=t._rendererResources,f=p.vertexArrays,v=p.programs,_=p.pickPrograms,y=p.renderStates,C=t._uniformMaps,E=t.gltf,S=E.accessors,w=E.meshes,T=E.techniques,b=E.materials,A=r.meshes,P=A.length,I=0;P>I;++I)for(var M=A[I],D=w[M],R=D.primitives,N=R.length,L=0;N>L;++L){var F,B=R[L],V=S[B.indices],k=b[B.material],z=T[k.technique],U=z.program,G=B.attributes.POSITION;if(l(G)){var W=S[G];F=e.fromCornerPoints(i.fromArray(W.min),i.fromArray(W.max))}var H,q,Y=f[M+".primitive."+L];if(l(V))q=V.count,H=V.byteOffset/g.getSizeInBytes(V.componentType);else{var X=S[B.attributes.POSITION];q=X.count;var Z=j(X);H=X.byteOffset/(Z.componentsPerAttribute*a.getSizeInBytes(X.componentType))}var K=C[B.material],Q=K.uniformMap;if(l(K.jointMatrixUniformName)){var J={};J[K.jointMatrixUniformName]=rt(n),Q=o(Q,J)}l(t._uniformMapLoaded)&&(Q=t._uniformMapLoaded(Q,U,n));var ee,te=y[k.technique],ie=te.blending.enabled,re={primitive:s(t.pickPrimitive,t),id:t.id,node:n.publicNode,mesh:m[D.name]},ne=new O({boundingVolume:new e,cull:t.cull,modelMatrix:new x,primitiveType:B.mode,vertexArray:Y,count:q,offset:H,shaderProgram:v[z.program],uniformMap:Q,renderState:te,owner:re,pass:ie?$.TRANSLUCENT:$.OPAQUE});if(d){var oe;if(l(t._pickFragmentShaderLoaded))oe=l(t._pickUniformMapLoaded)?t._pickUniformMapLoaded(Q):o(Q);else{var ae=u.createPickId(re);h.push(ae);var se={czm_pickColor:it(ae.color)};oe=o(Q,se)}ee=new O({boundingVolume:new e,cull:t.cull,modelMatrix:new x,primitiveType:B.mode,vertexArray:Y,count:q,offset:H,shaderProgram:_[z.program],uniformMap:oe,renderState:te,owner:re,pass:ie?$.TRANSLUCENT:$.OPAQUE})}var le={show:!0,boundingSphere:F,command:ne,pickCommand:ee};n.commands.push(le),c.push(le)}}function ot(e,t){var r=e._loadResources;if(r.finishedEverythingButTextureCreation()&&r.createRuntimeNodes){r.createRuntimeNodes=!1;for(var n=[],o=e._runtime.nodes,a=e.gltf,s=a.nodes,u=a.scenes[a.scene],c=u.nodes,h=c.length,d=[],m=0;h>m;++m)for(d.push({parentRuntimeNode:void 0,gltfNode:s[c[m]],id:c[m]});d.length>0;){var p=d.pop(),f=p.parentRuntimeNode,v=p.gltfNode,g=o[p.id];if(0===g.parents.length)if(l(v.matrix))g.matrix=x.fromColumnMajorArray(v.matrix);else{var _=v.rotation;g.translation=i.fromArray(v.translation),g.rotation=A.unpack(_),g.scale=i.fromArray(v.scale)}l(f)?(f.children.push(g),g.parents.push(f)):n.push(g),l(v.meshes)&&nt(e,v,g,t);for(var y=v.children,C=y.length,E=0;C>E;++E)d.push({parentRuntimeNode:g,gltfNode:s[y[E]],id:y[E]})}e._runtime.rootNodes=n,e._runtime.nodes=o}}function at(e,t){var i=t.context;if(e._loadRendererResourcesFromCache){var r=e._rendererResources,n=e._cachedRendererResources;n.assign(r),l(e._precreatedAttributes)&&Ge(e,i)}else xe(e,i),Me(e,i),Oe(e,i),Re(e),Le(e,i);ke(e),Ue(e),e._loadRendererResourcesFromCache||(Ge(e,i),He(e,i)),tt(e,i),ot(e,i)}function st(e,t){var i=e.publicNode,r=i.matrix;i.useMatrix&&l(r)?x.clone(r,t):l(e.matrix)?x.clone(e.matrix,t):(x.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t), +i.setMatrix(t))}function lt(t,r,n){for(var o=t._maxDirtyNumber,a=t.allowPicking,s=t._runtime.rootNodes,u=s.length,c=zt,h=t._computedModelMatrix,d=0;u>d;++d){var m=s[d];for(st(m,m.transformToRoot),c.push(m);c.length>0;){m=c.pop();var p=m.transformToRoot,f=m.commands;if(m.dirtyNumber===o||r||n){var v=x.multiplyTransformation(h,p,m.computedMatrix),g=f.length;if(g>0)for(var _=0;g>_;++_){var y=f[_],C=y.command;if(x.clone(v,C.modelMatrix),e.transform(y.boundingSphere,C.modelMatrix,C.boundingVolume),l(t._rtcCenter)&&i.add(t._rtcCenter,C.boundingVolume.center,C.boundingVolume.center),a){var E=y.pickCommand;x.clone(C.modelMatrix,E.modelMatrix),e.clone(C.boundingVolume,E.boundingVolume)}}}for(var S=m.children,w=S.length,T=0;w>T;++T){var b=S[T];b.dirtyNumber=Math.max(b.dirtyNumber,m.dirtyNumber),(b.dirtyNumber===o||n)&&(st(b,b.transformToRoot),x.multiplyTransformation(p,b.transformToRoot,b.transformToRoot)),c.push(b)}}}++t._maxDirtyNumber}function ut(e){for(var t=e._runtime.skinnedNodes,i=t.length,r=0;i>r;++r){var n=t[r];Ut=x.inverseTransformation(n.transformToRoot,Ut);for(var o=n.computedJointMatrices,a=n.joints,s=n.bindShapeMatrix,u=n.inverseBindMatrices,c=u.length,h=0;c>h;++h)l(o[h])||(o[h]=new x),o[h]=x.multiplyTransformation(Ut,a[h].transformToRoot,o[h]),o[h]=x.multiplyTransformation(o[h],u[h],o[h]),l(s)&&(o[h]=x.multiplyTransformation(o[h],s,o[h]))}}function ct(e){for(var t=e._runtime.rootNodes,i=t.length,r=zt,n=0;i>n;++n){var o=t[n];for(o.computedShow=o.publicNode.show,r.push(o);r.length>0;){o=r.pop();for(var a=o.computedShow,s=o.commands,l=s.length,u=0;l>u;++u)s[u].show=a;for(var c=o.children,h=c.length,d=0;h>d;++d){var m=c[d];m.computedShow=a&&m.publicNode.show,r.push(m)}}}}function ht(e,t){var i=e.id;if(e._id!==i){e._id=i;for(var r=e._pickIds,n=r.length,o=0;n>o;++o)r[o].object.id=i}}function dt(e){if(e._debugWireframe!==e.debugWireframe){e._debugWireframe=e.debugWireframe;for(var t=e.debugWireframe?b.LINES:b.TRIANGLES,i=e._nodeCommands,r=i.length,n=0;r>n;++n)i[n].command.primitiveType=t}}function mt(e){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume){e._debugShowBoundingVolume=e.debugShowBoundingVolume;for(var t=e.debugShowBoundingVolume,i=e._nodeCommands,r=i.length,n=0;r>n;n++)i[n].command.debugShowBoundingVolume=t}}function pt(e,t,i){return Gt.center=e,Gt.radius=t,i.camera.getPixelSize(Gt,i.context.drawingBufferWidth,i.context.drawingBufferHeight)}function ft(e,t){var r=e.scale;if(0!==e.minimumPixelSize){var n=t.context,o=Math.max(n.drawingBufferWidth,n.drawingBufferHeight),a=e.modelMatrix;Wt.x=a[12],Wt.y=a[13],Wt.z=a[14],l(e._rtcCenter)&&i.add(e._rtcCenter,Wt,Wt);var s=e.boundingSphere.radius,u=pt(Wt,s,t),c=1/u,h=Math.min(c*(2*s),o);h<e.minimumPixelSize&&(r=e.minimumPixelSize*u/(2*e._initialRadius))}return l(e.maximumScale)?Math.min(e.maximumScale,r):r}function vt(e){l(e._cacheKey)&&l(e._cachedGltf)&&0===--e._cachedGltf.count&&delete It[e._cacheKey],e._cachedGltf=void 0}function gt(e){var t=e.gltf.extensionsUsed;if(l(t))for(var i=t.length,r=0;i>r;++r){var n=t[r];if("CESIUM_RTC"!==n&&"KHR_binary_glTF"!==n&&"KHR_materials_common"!==n)throw new I("Unsupported glTF Extension: "+n)}}function _t(e,t){this.buffers=void 0,this.vertexArrays=void 0,this.programs=void 0,this.pickPrograms=void 0,this.textures=void 0,this.samplers=void 0,this.renderStates=void 0,this.ready=!1,this.context=e,this.cacheKey=t,this.count=0}function yt(e){for(var t in e)e.hasOwnProperty(t)&&(l(e[t].unref)?e[t].unref():e[t].destroy())}function Ct(e){yt(e.buffers),yt(e.vertexArrays),yt(e.programs),yt(e.pickPrograms),yt(e.textures)}function Et(e){for(var t in e)e.hasOwnProperty(t)&&e[t].ref&&e[t].ref()}function St(e){for(var t in e)e.hasOwnProperty(t)&&e[t].unref&&e[t].unref()}if(!d.supportsTypedArrays())return{};var wt=x.fromRotationTranslation(T.fromRotationX(S.PI_OVER_TWO)),Tt=new i,xt={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3},bt=function(e){this.map={},this.name=e};bt.prototype.get=function(e){return this.map[e]},bt.prototype.clear=function(){return this.map={},this},bt.prototype.size=function(){var e=0;for(var t in this.map)this.map.hasOwnProperty(t)&&e++;return e},bt.prototype.set=function(e,t){this.map[e]=t;var i=this;return t._cacheRefCount=1,t.ref=function(){t._cacheRefCount++},t.unref=function(){t._cacheRefCount--,0===t._cacheRefCount&&(delete i.map[e],t.destroy&&t.destroy())},t};var At={textures:new bt("texture"),images:new bt("image")},Pt="model/vnd.gltf.binary,model/vnd.gltf+json,model/gltf.binary,model/gltf+json;q=0.8,application/json;q=0.2,*/*;q=0.01";te.prototype.getBuffer=function(e){return ae(this.buffers[e.buffer],e.byteOffset,e.byteLength)},te.prototype.finishedPendingBufferLoads=function(){return 0===this.pendingBufferLoads},te.prototype.finishedBuffersCreation=function(){return 0===this.pendingBufferLoads&&0===this.buffersToCreate.length},te.prototype.finishedProgramCreation=function(){return 0===this.pendingShaderLoads&&0===this.programsToCreate.length},te.prototype.finishedTextureCreation=function(){var e=0===this.pendingTextureLoads,t=0===this.texturesToCreate.length&&0===this.texturesToCreateFromBufferView.length;return e&&t},te.prototype.finishedEverythingButTextureCreation=function(){var e=0===this.pendingBufferLoads&&0===this.pendingShaderLoads,t=0===this.buffersToCreate.length&&0===this.programsToCreate.length&&0===this.pendingBufferViewToImage;return e&&t},te.prototype.finished=function(){return this.finishedTextureCreation()&&this.finishedEverythingButTextureCreation()},u(re.prototype,{gltf:{set:function(e){this._gltf=K(W(e))},get:function(){return this._gltf}},bgltf:{get:function(){return this._bgltf}}}),re.prototype.makeReady=function(e,t){this.gltf=e,this._bgltf=t;for(var i=this.modelsToLoad,r=i.length,n=0;r>n;++n){var o=i[n];o.isDestroyed()||ie(o,this)}this.modelsToLoad=void 0,this.ready=!0};var It={};u(oe.prototype,{gltf:{get:function(){return l(this._cachedGltf)?this._cachedGltf.gltf:void 0}},releaseGltfJson:{get:function(){return this._releaseGltfJson}},cacheKey:{get:function(){return this._cacheKey}},basePath:{get:function(){return this._basePath}},boundingSphere:{get:function(){var e=x.getScale(this.modelMatrix,Tt),t=l(this.maximumScale)?Math.min(this.maximumScale,this.scale):this.scale;i.multiplyByScalar(e,t,e);var r=this._scaledBoundingSphere;return r.center=i.multiplyComponents(this._boundingSphere.center,e,r.center),r.radius=i.maximumComponent(e)*this._initialRadius,l(this._rtcCenter)&&i.add(this._rtcCenter,r.center,r.center),r}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},asynchronous:{get:function(){return this._asynchronous}},allowPicking:{get:function(){return this._allowPicking}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},pendingTextureLoads:{get:function(){return l(this._loadResources)?this._loadResources.pendingTextureLoads:0}},dirty:{get:function(){return this._dirty}}});var Mt=Uint32Array.BYTES_PER_ELEMENT;oe.fromGltf=function(e){var t=e.url,i=new oe(e);return i.loadGltf(t,e),i},oe.prototype.loadGltf=function(e){var t=e.url,i=s(e.cacheKey,m(t));e=n(e),e.basePath=p(t),e.cacheKey=i,this._basePath=e.basePath,this._cacheKey=e.cacheKey;var r=new H(document.location.href),o=new H(this._basePath);this._baseUri=o.resolve(r),e.headers=l(e.headers)?n(e.headers):{},l(e.headers.Accept)||(e.headers.Accept=Pt);var a=It[i];return l(a)?a.ready||(++a.count,a.modelsToLoad.push(this)):(a=new re({ready:!1}),a.count=1,a.modelsToLoad.push(this),ie(this,a),It[i]=a,_(t,e.headers).then(function(t){var i=new Uint8Array(t);if(se(i)){var r=le(i);0!==r.binaryOffset&&(i=i.subarray(r.binaryOffset)),a.makeReady(r.glTF,i)}else{var n=v(i),o=JSON.parse(n);e.gltfModifier&&(o=e.gltfModifier(o)),a.makeReady(o)}}).otherwise(he(this,"model",t))),this._readyPromise},oe._gltfCache=It,oe.prototype.getNode=function(e){var t=ue(this,"nodesByName",e);return l(t)?t.publicNode:void 0},oe.prototype.getMesh=function(e){return ue(this,"meshesByName",e)},oe.prototype.getMaterial=function(e){return ue(this,"materialsByName",e)},oe.cacheSize=function(){return{textures:At.textures.size(),images:At.images.size()}};var Dt=new i,Rt=new i,Ot=new i,Nt=new A,Lt=new i,Ft=new i,Bt={MODEL:function(e,t){return function(){return e.model}},VIEW:function(e,t){return function(){return e.view}},PROJECTION:function(e,t){return function(){return e.projection}},MODELVIEW:function(e,t){return function(){return e.modelView}},CESIUM_RTC_MODELVIEW:function(e,t){var r=new x;return function(){return x.getTranslation(e.model,Ft),i.add(Ft,t._rtcCenter,Ft),x.multiplyByPoint(e.view,Ft,Ft),x.setTranslation(e.modelView,Ft,r)}},MODELVIEWPROJECTION:function(e,t){return function(){return e.modelViewProjection}},MODELINVERSE:function(e,t){return function(){return e.inverseModel}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t){return function(){return e.inverseModelView}},MODELVIEWPROJECTIONINVERSE:function(e,t){return function(){return e.inverseModelViewProjection}},MODELINVERSETRANSPOSE:function(e,t){return function(){return e.inverseTranposeModel}},MODELVIEWINVERSETRANSPOSE:function(e,t){return function(){return e.normal}},VIEWPORT:function(e,t){return function(){return e.viewportCartesian4}}};u(Je.prototype,{value:{get:function(){if(!l(this._value)){var e=this._model._rendererResources.textures[this._textureId];if(!l(e))return this._model._defaultTexture;this._value=e}return this._value},set:function(e){this._value=e}}}),Je.prototype.clone=function(e,t){return e},Je.prototype.func=void 0;var Vt={};Vt[G.FLOAT]=qe,Vt[G.FLOAT_VEC2]=je,Vt[G.FLOAT_VEC3]=Ye,Vt[G.FLOAT_VEC4]=Xe,Vt[G.INT]=qe,Vt[G.INT_VEC2]=je,Vt[G.INT_VEC3]=Ye,Vt[G.INT_VEC4]=Xe,Vt[G.BOOL]=qe,Vt[G.BOOL_VEC2]=je,Vt[G.BOOL_VEC3]=Ye,Vt[G.BOOL_VEC4]=Xe,Vt[G.FLOAT_MAT2]=Ze,Vt[G.FLOAT_MAT3]=Ke,Vt[G.FLOAT_MAT4]=Qe,Vt[G.SAMPLER_2D]=$e;var kt={MODEL:function(e,t,i){return function(){return i.computedMatrix}},VIEW:function(e,t,i){return function(){return e.view}},PROJECTION:function(e,t,i){return function(){return e.projection}},MODELVIEW:function(e,t,i){var r=new x;return function(){return x.multiplyTransformation(e.view,i.computedMatrix,r)}},CESIUM_RTC_MODELVIEW:function(e,t,i){var r=new x;return function(){return x.multiplyTransformation(e.view,i.computedMatrix,r),x.setTranslation(r,t._rtcCenterEye,r)}},MODELVIEWPROJECTION:function(e,t,i){var r=new x;return function(){return x.multiplyTransformation(e.view,i.computedMatrix,r),x.multiply(e._projection,r,r)}},MODELINVERSE:function(e,t,i){var r=new x;return function(){return x.inverse(i.computedMatrix,r)}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t,i){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t,i){var r=new x,n=new x;return function(){return x.multiplyTransformation(e.view,i.computedMatrix,r),x.inverse(r,n)}},MODELVIEWPROJECTIONINVERSE:function(e,t,i){var r=new x,n=new x;return function(){return x.multiplyTransformation(e.view,i.computedMatrix,r),x.multiply(e._projection,r,r),x.inverse(r,n)}},MODELINVERSETRANSPOSE:function(e,t,i){var r=new x,n=new T;return function(){return x.inverse(i.computedMatrix,r),x.getRotation(r,n),T.transpose(n,n)}},MODELVIEWINVERSETRANSPOSE:function(e,t,i){var r=new x,n=new x,o=new T;return function(){return x.multiplyTransformation(e.view,i.computedMatrix,r),x.inverse(r,n),x.getRotation(n,o),T.transpose(o,o)}},VIEWPORT:function(e,t,i){return function(){return e.viewportCartesian4}}},zt=[],Ut=new x,Gt=new e,Wt=new i;return _t.prototype.release=function(){return 0===--this.count?(l(this.cacheKey)&&delete this.context.cache.modelRendererResourceCache[this.cacheKey],Ct(this),c(this)):void 0},_t.prototype.init=function(e){this.buffers=e.buffers,Et(this.buffers),this.vertexArrays=e.vertexArrays,Et(this.vertexArrays),this.programs=e.programs,Et(this.programs),this.pickPrograms=e.pickPrograms,Et(this.pickPrograms),this.textures=e.textures,Et(this.textures),this.samplers=e.samplers,Et(this.samplers),this.renderStates=e.renderStates,Et(this.renderStates)},_t.prototype.assign=function(e){e.buffers=this.buffers,Et(this.buffers),e.vertexArrays=this.vertexArrays,Et(this.vertexArrays),e.programs=this.programs,Et(this.programs),e.pickPrograms=this.pickPrograms,Et(this.pickPrograms),e.textures=this.textures,Et(this.textures),e.samplers=this.samplers,Et(this.samplers),e.renderStates=this.renderStates,Et(this.renderStates)},oe.prototype.update=function(e){if(e.mode===ee.SCENE3D){var t=e.context;if(this._defaultTexture=t.defaultTexture,this._state===xt.NEEDS_LOAD&&l(this.gltf)){var r,n=this.cacheKey;if(l(n)){t.cache.modelRendererResourceCache=s(t.cache.modelRendererResourceCache,{});var o=t.cache.modelRendererResourceCache;if(r=o[this.cacheKey],l(r)){if(!r.ready)return;++r.count,this._loadRendererResourcesFromCache=!0}else r=new _t(t,n),r.count=1,o[this.cacheKey]=r;this._cachedRendererResources=r}else r=new _t(t),r.count=1,this._cachedRendererResources=r;if(this._state=xt.LOADING,this._boundingSphere=ce(this.gltf),this._initialRadius=this._boundingSphere.radius,gt(this),this._state!==xt.FAILED){var a=this.gltf.extensions;l(a)&&l(a.CESIUM_RTC)&&(this._rtcCenter=i.fromArray(a.CESIUM_RTC.center),this._rtcCenterEye=new i),this._loadResources=new te,Te(this)}}var u=this._loadResources,c=this._incrementallyLoadTextures,h=!1;if(this._state===xt.LOADING&&(at(this,e),(u.finished()||c&&u.finishedEverythingButTextureCreation())&&(this._state=xt.LOADED,h=!0)),l(u)&&this._state===xt.LOADED&&(c&&!h&&at(this,e),u.finished())){this._loadResources=void 0;var d=this._rendererResources,m=this._cachedRendererResources;m.init(d),m.ready=!0,l(this._precreatedAttributes)&&(m.vertexArrays={}),this.releaseGltfJson&&vt(this)}var p=this.show&&0!==this.scale;if(p&&this._state===xt.LOADED||h){var f=this.activeAnimations.update(e)||this._cesiumAnimationsDirty;this._cesiumAnimationsDirty=!1,this._dirty=!1;var v=!x.equals(this._modelMatrix,this.modelMatrix)||this._scale!==this.scale||this._minimumPixelSize!==this.minimumPixelSize||0!==this.minimumPixelSize||this._maximumScale!==this.maximumScale;if(v||h){x.clone(this.modelMatrix,this._modelMatrix),this._scale=this.scale,this._minimumPixelSize=this.minimumPixelSize,this._maximumScale=this.maximumScale;var g=ft(this,e),_=this._computedModelMatrix;x.multiplyByUniformScale(this.modelMatrix,g,_),x.multiplyTransformation(_,wt,_)}(f||v||h)&&(lt(this,v,h),this._dirty=!0,(f||h)&&ut(this)),this._perNodeShowDirty&&(this._perNodeShowDirty=!1,ct(this)),ht(this,t),dt(this),mt(this)}if(h){var y=this;return void e.afterRender.push(function(){y._ready=!0,y._readyPromise.resolve(y)})}if(p&&!this._ignoreCommands){var C,E,S=e.commandList,w=e.passes,T=this._nodeCommands,b=T.length;if(w.render)for(C=0;b>C;++C)E=T[C],E.show&&S.push(E.command);if(w.pick&&this.allowPicking)for(C=0;b>C;++C)E=T[C],E.show&&S.push(E.pickCommand)}}},oe.prototype.isDestroyed=function(){return!1},oe.prototype.destroy=function(){l(this._precreatedAttributes)&&yt(this._rendererResources.vertexArrays);var e=this._rendererResources;St(e.buffers),St(e.vertexArrays),St(e.programs),St(e.pickPrograms),St(e.textures),St(e.samplers),St(e.renderStates);var t;if(this._loadResources)for(var i=this._loadResources.texturesToCreate;i.length;){t=i.dequeue();var r=t.image.src;At.images.get(r).unref()}this._rendererResources=void 0,this._cachedRendererResources=this._cachedRendererResources&&this._cachedRendererResources.release();for(var n=this._pickIds,o=n.length,a=0;o>a;++a)n[a].destroy();return vt(this),c(this)},oe}),i("DataSources/ModelVisualizer",["../Core/AssociativeArray","../Core/BoundingSphere","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Scene/Model","../Scene/ModelAnimationLoop","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t,i){i.collectionChanged.addEventListener(c.prototype._onCollectionChanged,this),this._scene=t,this._primitives=t.primitives,this._entityCollection=i,this._modelHash={},this._entitiesToVisualize=new e,this._onCollectionChanged(i,i.values,[],[])}function h(e,t,r,n){var o=r[t.id];i(o)&&(n.removeAndDestroy(o.modelPrimitive),delete r[t.id])}function d(e,t){var r=t[e.id];i(r)&&(r.nodeTransformationsScratch={})}function m(e){console.error(e)}var p=1,f=0,v=!0,g=new o,_=new o;return c.prototype.update=function(e){for(var t=this._entitiesToVisualize.values,r=this._modelHash,n=this._primitives,l=0,c=t.length;c>l;l++){var h,d,y=t[l],C=y._model,E=r[y.id],S=y.isShowing&&y.isAvailable(e)&&u.getValueOrDefault(C._show,e,!0);if(S&&(d=y._getModelMatrix(e,g),h=u.getValueOrUndefined(C._uri,e),S=i(d)&&i(h)),S){var w=i(E)?E.modelPrimitive:void 0;if(i(w)&&h===E.uri||(i(w)&&(n.removeAndDestroy(w),delete r[y.id]),w=a.fromGltf({url:h,incrementallyLoadTextures:u.getValueOrDefault(C._incrementallyLoadTextures,e,v)}),w.readyPromise.otherwise(m),w.id=y,n.add(w),E={modelPrimitive:w,uri:h,animationsRunning:!1,nodeTransformationsScratch:{},originalNodeMatrixHash:{}},r[y.id]=E),w.show=!0,w.scale=u.getValueOrDefault(C._scale,e,p),w.minimumPixelSize=u.getValueOrDefault(C._minimumPixelSize,e,f),w.maximumScale=u.getValueOrUndefined(C._maximumScale,e),w.modelMatrix=o.clone(d,w.modelMatrix),w.ready){var T=u.getValueOrDefault(C._runAnimations,e,!0);E.animationsRunning!==T&&(T?w.activeAnimations.addAll({loop:s.REPEAT}):w.activeAnimations.removeAll(),E.animationsRunning=T);var x=u.getValueOrUndefined(C._nodeTransformations,e,E.nodeTransformationsScratch);if(i(x))for(var b=E.originalNodeMatrixHash,A=Object.keys(x),P=0,I=A.length;I>P;++P){var M=A[P],D=x[M];if(i(D)){var R=w.getNode(M);if(i(R)){var O=b[M];i(O)||(O=R.matrix.clone(),b[M]=O);var N=o.fromTranslationRotationScale(D,_);R.matrix=o.multiply(O,N,N)}}}}}else i(E)&&(E.modelPrimitive.show=!1)}return!0},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(c.prototype._onCollectionChanged,this);for(var e=this._entitiesToVisualize.values,t=this._modelHash,i=this._primitives,n=e.length-1;n>-1;n--)h(this,e[n],t,i);return r(this)},c.prototype.getBoundingSphere=function(e,r){var n=this._modelHash[e.id];if(!i(n))return l.FAILED;var o=n.modelPrimitive;return i(o)&&o.show?o.ready?(t.transform(o.boundingSphere,o.modelMatrix,r),l.DONE):l.PENDING:l.FAILED},c.prototype._onCollectionChanged=function(e,t,r,n){var o,a,s=this._entitiesToVisualize,l=this._modelHash,u=this._primitives;for(o=t.length-1;o>-1;o--)a=t[o],i(a._model)&&i(a._position)&&s.set(a.id,a);for(o=n.length-1;o>-1;o--)a=n[o],i(a._model)&&i(a._position)?(d(a,l),s.set(a.id,a)):(h(this,a,l,u),s.remove(a.id));for(o=r.length-1;o>-1;o--)a=r[o],h(this,a,l,u),s.remove(a.id)},c}),i("Shaders/PolylineCommon",[],function(){"use strict";return"void clipLineSegmentToNearPlane(\nvec3 p0,\nvec3 p1,\nout vec4 positionWC,\nout bool clipped,\nout bool culledByNearPlane)\n{\nculledByNearPlane = false;\nclipped = false;\nvec3 p1ToP0 = p1 - p0;\nfloat magnitude = length(p1ToP0);\nvec3 direction = normalize(p1ToP0);\nfloat endPoint0Distance = -(czm_currentFrustum.x + p0.z);\nfloat denominator = -direction.z;\nif (endPoint0Distance < 0.0 && abs(denominator) < czm_epsilon7)\n{\nculledByNearPlane = true;\n}\nelse if (endPoint0Distance < 0.0 && abs(denominator) > czm_epsilon7)\n{\nfloat t = (czm_currentFrustum.x + p0.z) / denominator;\nif (t < 0.0 || t > magnitude)\n{\nculledByNearPlane = true;\n}\nelse\n{\np0 = p0 + t * direction;\nclipped = true;\n}\n}\npositionWC = czm_eyeToWindowCoordinates(vec4(p0, 1.0));\n}\nvec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious) {\nvec4 endPointWC, p0, p1;\nbool culledByNearPlane, clipped;\nvec4 positionEC = czm_modelViewRelativeToEye * position;\nvec4 prevEC = czm_modelViewRelativeToEye * previous;\nvec4 nextEC = czm_modelViewRelativeToEye * next;\nclipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, p0, clipped, culledByNearPlane);\nclipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, p1, clipped, culledByNearPlane);\nclipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, endPointWC, clipped, culledByNearPlane);\nif (culledByNearPlane)\n{\nreturn vec4(0.0, 0.0, 0.0, 1.0);\n}\nvec2 prevWC = normalize(p0.xy - endPointWC.xy);\nvec2 nextWC = normalize(p1.xy - endPointWC.xy);\nfloat expandWidth = width * 0.5;\nvec2 direction;\nif (czm_equalsEpsilon(normalize(previous.xyz - position.xyz), vec3(0.0), czm_epsilon1) || czm_equalsEpsilon(prevWC, -nextWC, czm_epsilon1))\n{\ndirection = vec2(-nextWC.y, nextWC.x);\n}\nelse if (czm_equalsEpsilon(normalize(next.xyz - position.xyz), vec3(0.0), czm_epsilon1) || clipped)\n{\ndirection = vec2(prevWC.y, -prevWC.x);\n}\nelse\n{\nvec2 normal = vec2(-nextWC.y, nextWC.x);\ndirection = normalize((nextWC + prevWC) * 0.5);\nif (dot(direction, normal) < 0.0)\n{\ndirection = -direction;\n}\nfloat sinAngle = abs(direction.x * nextWC.y - direction.y * nextWC.x);\nexpandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);\n}\nvec2 offset = direction * expandDirection * expandWidth * czm_resolutionScale;\nreturn vec4(endPointWC.xy + offset, -endPointWC.z, 1.0);\n}\n"}),i("Shaders/PolylineFS",[],function(){"use strict";return"varying vec2 v_st;\nvoid main()\n{\nczm_materialInput materialInput;\nmaterialInput.s = v_st.s;\nmaterialInput.st = v_st;\nmaterialInput.str = vec3(v_st, 0.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n}\n"}),i("Shaders/PolylineVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 position2DHigh;\nattribute vec3 position2DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 prevPosition2DHigh;\nattribute vec3 prevPosition2DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec3 nextPosition2DHigh;\nattribute vec3 nextPosition2DLow;\nattribute vec4 texCoordExpandWidthAndShow;\nattribute vec4 pickColor;\nvarying vec2 v_st;\nvarying float v_width;\nvarying vec4 czm_pickColor;\nvoid main()\n{\nfloat texCoord = texCoordExpandWidthAndShow.x;\nfloat expandDir = texCoordExpandWidthAndShow.y;\nfloat width = abs(texCoordExpandWidthAndShow.z) + 0.5;\nbool usePrev = texCoordExpandWidthAndShow.z < 0.0;\nfloat show = texCoordExpandWidthAndShow.w;\nvec4 p, prev, next;\nif (czm_morphTime == 1.0)\n{\np = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz);\nprev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz);\nnext = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz);\n}\nelse if (czm_morphTime == 0.0)\n{\np = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);\nprev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy);\nnext = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy);\n}\nelse\n{\np = czm_columbusViewMorph(\nczm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),\nczm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz),\nczm_morphTime);\nprev = czm_columbusViewMorph(\nczm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy),\nczm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz),\nczm_morphTime);\nnext = czm_columbusViewMorph(\nczm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),\nczm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),\nczm_morphTime);\n}\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC * show;\nv_st = vec2(texCoord, clamp(expandDir, 0.0, 1.0));\nv_width = width;\nczm_pickColor = pickColor;\n}\n"}),i("Scene/Polyline",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","../Core/PolylinePipeline","./Material"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(o,a){o=r(o,r.EMPTY_OBJECT),this._show=r(o.show,!0),this._width=r(o.width,1),this._loop=r(o.loop,!1),this._material=o.material,n(this._material)||(this._material=u.fromType(u.ColorType,{color:new i(1,1,1,1)}));var c=o.positions;n(c)||(c=[]),this._positions=c,this._actualPositions=l.removeDuplicates(c),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=c.slice()),this._actualPositions.push(t.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=o.id;var h;n(a)&&(h=s.clone(a.modelMatrix)),this._modelMatrix=h,this._segments=l.wrapLongitude(this._actualPositions,h),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(g),this._polylineCollection=a,this._dirty=!1,this._pickId=void 0,this._boundingVolume=e.fromPoints(this._actualPositions),this._boundingVolumeWC=e.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new e}function h(e,t){++e._propertiesChanged[t];var i=e._polylineCollection;n(i)&&(i._updatePolyline(e,t),e._dirty=!0)}var d=c.SHOW_INDEX=0,m=c.WIDTH_INDEX=1,p=c.POSITION_INDEX=2,f=c.MATERIAL_INDEX=3,v=c.POSITION_SIZE_INDEX=4,g=c.NUMBER_OF_PROPERTIES=5;return o(c.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,h(this,d))}},positions:{get:function(){return this._positions},set:function(i){var r=l.removeDuplicates(i);this._loop&&r.length>2&&(r===i&&(r=i.slice()),r.push(t.clone(r[0]))),(this._actualPositions.length!==r.length||this._actualPositions.length!==this._length)&&h(this,v),this._positions=i,this._actualPositions=r,this._length=r.length,this._boundingVolume=e.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=e.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),h(this,p),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,h(this,f))}},width:{get:function(){return this._width},set:function(e){var t=this._width;e!==t&&(this._width=e,h(this,m))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){var i=this._actualPositions;e?i.length>2&&!t.equals(i[0],i[i.length-1])&&(i.length===this._positions.length&&(this._actualPositions=i=this._positions.slice()),i.push(t.clone(i[0]))):i.length>2&&t.equals(i[0],i[i.length-1])&&(i.length-1===this._positions.length?this._actualPositions=this._positions:i.pop()),this._loop=e,h(this,v)}}},id:{get:function(){return this._id},set:function(e){this._id=e,n(this._pickId)&&(this._pickId.object.id=e)}}}),c.prototype.update=function(){var t=s.IDENTITY;n(this._polylineCollection)&&(t=this._polylineCollection.modelMatrix);var i=this._segments.positions.length,r=this._segments.lengths,o=this._propertiesChanged[p]>0||this._propertiesChanged[v]>0;if((!s.equals(t,this._modelMatrix)||o)&&(this._segments=l.wrapLongitude(this._actualPositions,t),this._boundingVolumeWC=e.transform(this._boundingVolume,t,this._boundingVolumeWC)),this._modelMatrix=t,this._segments.positions.length!==i)h(this,v);else for(var a=r.length,u=0;a>u;++u)if(r[u]!==this._segments.lengths[u]){h(this,v);break}},c.prototype.getPickId=function(e){return n(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId},c.prototype._clean=function(){this._dirty=!1;for(var e=this._propertiesChanged,t=0;g-1>t;++t)e[t]=0},c.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0},c}),i("Scene/PolylineCollection",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/IndexDatatype","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/Plane","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/PolylineCommon","../Shaders/PolylineFS","../Shaders/PolylineVS","./BlendingState","./Material","./Pass","./Polyline","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D){"use strict";function R(e){e=a(e,a.EMPTY_OBJECT),this.modelMatrix=f.clone(a(e.modelMatrix,f.IDENTITY)),this._modelMatrix=f.clone(f.IDENTITY),this.debugShowBoundingVolume=a(e.debugShowBoundingVolume,!1),this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._pickCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(Q),this._polylines=[],this._polylineBuckets={},this._buffersUsage=[{bufferUsage:_.STATIC_DRAW,frameCount:0},{bufferUsage:_.STATIC_DRAW,frameCount:0},{bufferUsage:_.STATIC_DRAW,frameCount:0}],this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._pickColorBuffer=void 0,this._texCoordExpandWidthAndShowBuffer=void 0}function O(t,i,r,n,o){for(var a=i.context,l=i.commandList,u=r.length,c=0,h=!0,d=t._vertexArrays,m=t.debugShowBoundingVolume,p=d.length,f=0;p>f;++f)for(var v=d[f],g=v.buckets,_=g.length,C=0;_>C;++C){for(var E,S,w,T=g[C],x=T.offset,b=o?T.bucket.shaderProgram:T.bucket.pickShaderProgram,A=T.bucket.polylines,P=A.length,M=0,R=0;P>R;++R){var O=A[R],N=F(O._material);if(N!==E){if(s(E)&&M>0){var L=S.isTranslucent();c>=u?(w=new y({owner:t}),r.push(w)):w=r[c],++c,w.boundingVolume=e.clone($,w.boundingVolume),w.modelMatrix=n,w.shaderProgram=b,w.vertexArray=v.va,w.renderState=L?t._translucentRS:t._opaqueRS,w.pass=L?I.TRANSLUCENT:I.OPAQUE,w.debugShowBoundingVolume=o?m:!1,w.uniformMap=S._uniforms,w.count=M,w.offset=x,x+=M,M=0,h=!0,l.push(w)}S=O._material,S.update(a),E=N}for(var B=O._locatorBuckets,V=B.length,k=0;V>k;++k){var z=B[k];z.locator===T&&(M+=z.count)}var U;i.mode===D.SCENE3D?U=O._boundingVolumeWC:i.mode===D.COLUMBUS_VIEW?U=O._boundingVolume2D:i.mode===D.SCENE2D?s(O._boundingVolume2D)&&(U=e.clone(O._boundingVolume2D,ee),U.center.x=0):s(O._boundingVolumeWC)&&s(O._boundingVolume2D)&&(U=e.union(O._boundingVolumeWC,O._boundingVolume2D,ee)),h?(h=!1,e.clone(U,$)):e.union(U,$,$)}s(E)&&M>0&&(c>=u?(w=new y({owner:t}),r.push(w)):w=r[c],++c,w.boundingVolume=e.clone($,w.boundingVolume),w.modelMatrix=n,w.shaderProgram=b,w.vertexArray=v.va,w.renderState=S.isTranslucent()?t._translucentRS:t._opaqueRS,w.pass=S.isTranslucent()?I.TRANSLUCENT:I.OPAQUE,w.debugShowBoundingVolume=o?m:!1,w.uniformMap=S._uniforms,w.count=M,w.offset=x,h=!0,l.push(w)),E=void 0}r.length=c}function N(e){for(var t=e._buffersUsage,i=!1,r=e._propertiesChanged,n=0;Q-2>n;++n){var o=t[n];r[n]?o.bufferUsage!==_.STREAM_DRAW?(i=!0,o.bufferUsage=_.STREAM_DRAW,o.frameCount=100):o.frameCount=100:o.bufferUsage!==_.STATIC_DRAW&&(0===o.frameCount?(i=!0,o.bufferUsage=_.STATIC_DRAW):o.frameCount--)}return i}function L(e,t,i){e._createVertexArray=!1,z(e),U(e),B(e);var r,n,a=[[]],l=a[0],u=[0],c=0,h=[[]],m=0,f=e._polylineBuckets;for(r in f)f.hasOwnProperty(r)&&(n=f[r],n.updateShader(t),m+=n.lengthOfPositions);if(m>0){var v,y=e._mode,C=new Float32Array(6*m*3),E=new Uint8Array(4*m),S=new Float32Array(4*m),T=0,x=0,b=0;for(r in f)if(f.hasOwnProperty(r)){n=f[r],n.write(C,E,S,T,x,b,t,i),y===D.MORPHING&&(s(v)||(v=new Float32Array(6*m*3)),n.writeForMorph(v,T));var A=n.lengthOfPositions;T+=6*A*3,x+=4*A,b+=4*A,c=n.updateIndices(a,u,h,c)}var P=e._buffersUsage[X].bufferUsage,I=e._buffersUsage[j].bufferUsage,M=e._buffersUsage[Y].bufferUsage,R=I===_.STREAM_DRAW||M===_.STREAM_DRAW?_.STREAM_DRAW:_.STATIC_DRAW;e._positionBuffer=g.createVertexBuffer({ +context:t,typedArray:C,usage:P});var O;s(v)&&(O=g.createVertexBuffer({context:t,typedArray:v,usage:P})),e._pickColorBuffer=g.createVertexBuffer({context:t,typedArray:E,usage:_.STATIC_DRAW}),e._texCoordExpandWidthAndShowBuffer=g.createVertexBuffer({context:t,typedArray:S,usage:R});for(var N=4*Uint8Array.BYTES_PER_ELEMENT,L=3*Float32Array.BYTES_PER_ELEMENT,F=4*Float32Array.BYTES_PER_ELEMENT,V=0,k=a.length,G=0;k>G;++G)if(l=a[G],l.length>0){var W=new Uint16Array(l),H=g.createIndexBuffer({context:t,typedArray:W,usage:_.STATIC_DRAW,indexDatatype:d.UNSIGNED_SHORT});V+=u[G];var q,Z,K,Q,$=6*(G*(L*p.SIXTY_FOUR_KILOBYTES)-V*L),ee=L+$,ie=L+ee,re=L+ie,ne=L+re,oe=L+ne,ae=G*(N*p.SIXTY_FOUR_KILOBYTES)-V*N,se=G*(F*p.SIXTY_FOUR_KILOBYTES)-V*F,le=[{index:J.position3DHigh,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:$,strideInBytes:6*L},{index:J.position3DLow,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:ee,strideInBytes:6*L},{index:J.position2DHigh,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:$,strideInBytes:6*L},{index:J.position2DLow,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:ee,strideInBytes:6*L},{index:J.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:ie,strideInBytes:6*L},{index:J.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:re,strideInBytes:6*L},{index:J.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:ie,strideInBytes:6*L},{index:J.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:re,strideInBytes:6*L},{index:J.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:ne,strideInBytes:6*L},{index:J.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:oe,strideInBytes:6*L},{index:J.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:ne,strideInBytes:6*L},{index:J.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:oe,strideInBytes:6*L},{index:J.texCoordExpandWidthAndShow,componentsPerAttribute:4,componentDatatype:o.FLOAT,vertexBuffer:e._texCoordExpandWidthAndShowBuffer,offsetInBytes:se},{index:J.pickColor,componentsPerAttribute:4,componentDatatype:o.UNSIGNED_BYTE,vertexBuffer:e._pickColorBuffer,offsetInBytes:ae,normalize:!0}];y===D.SCENE3D?(q=e._positionBuffer,Z="vertexBuffer",K=te,Q="value"):y===D.SCENE2D||y===D.COLUMBUS_VIEW?(q=te,Z="value",K=e._positionBuffer,Q="vertexBuffer"):(q=O,Z="vertexBuffer",K=e._positionBuffer,Q="vertexBuffer"),le[0][Z]=q,le[1][Z]=q,le[2][Q]=K,le[3][Q]=K,le[4][Z]=q,le[5][Z]=q,le[6][Q]=K,le[7][Q]=K,le[8][Z]=q,le[9][Z]=q,le[10][Q]=K,le[11][Q]=K;var ue=new w({context:t,attributes:le,indexBuffer:H});e._vertexArrays.push({va:ue,buckets:h[G]})}}}function F(e){var t=P._uniformList[e.type],i=t.length;ie.length=2*i;for(var r=0,n=0;i>n;++n){var o=t[n];ie[r]=o,ie[r+1]=e._uniforms[o](),r+=2}return e.type+":"+JSON.stringify(ie)}function B(e){for(var t=e._mode,i=e._modelMatrix,r=e._polylineBuckets={},n=e._polylines,o=n.length,a=0;o>a;++a){var l=n[a];if(l._actualPositions.length>1){l.update();var u=l.material,c=r[u.type];s(c)||(c=r[u.type]=new H(u,t,i)),c.addPolyline(l)}}}function V(e,t){var i=t.mode;e._mode===i&&f.equals(e._modelMatrix,e.modelMatrix)||(e._mode=i,e._modelMatrix=f.clone(e.modelMatrix),e._createVertexArray=!0)}function k(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;for(var t=[],i=e._polylines.length,r=0,n=0;i>r;++r){var o=e._polylines[r];s(o)&&(o._index=n++,t.push(o))}e._polylines=t}}function z(e){for(var t=e._polylines,i=t.length,r=0;i>r;++r)if(s(t[r])){var n=t[r]._bucket;s(n)&&(n.shaderProgram=n.shaderProgram&&n.shaderProgram.destroy())}}function U(e){for(var t=e._vertexArrays.length,i=0;t>i;++i)e._vertexArrays[i].va.destroy();e._vertexArrays.length=0}function G(e){for(var t=e._polylines,i=t.length,r=0;i>r;++r)s(t[r])&&t[r]._destroy()}function W(e,t,i){this.count=e,this.offset=t,this.bucket=i}function H(e,t,i){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.pickShaderProgram=void 0,this.mode=t,this.modelMatrix=i}function q(e){return t.dot(t.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(v.ORIGIN_ZX_PLANE)===m.INTERSECTING}var j=M.SHOW_INDEX,Y=M.WIDTH_INDEX,X=M.POSITION_INDEX,Z=M.MATERIAL_INDEX,K=M.POSITION_SIZE_INDEX,Q=M.NUMBER_OF_PROPERTIES,J={texCoordExpandWidthAndShow:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12,pickColor:13};l(R.prototype,{length:{get:function(){return k(this),this._polylines.length}}}),R.prototype.add=function(e){var t=new M(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,t},R.prototype.remove=function(e){if(this.contains(e)){if(this._polylines[e._index]=void 0,this._polylinesRemoved=!0,this._createVertexArray=!0,s(e._bucket)){var t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy(),t.pickShaderProgram=t.pickShaderProgram&&t.pickShaderProgram.destroy()}return e._destroy(),!0}return!1},R.prototype.removeAll=function(){z(this),G(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0},R.prototype.contains=function(e){return s(e)&&e._polylineCollection===this},R.prototype.get=function(e){return k(this),this._polylines[e]},R.prototype.update=function(e,t){if(k(this),0!==this._polylines.length){V(this,e);var i,r=e.context,n=e.mapProjection,o=this._propertiesChanged;if(this._createVertexArray||N(this))L(this,r,n);else if(this._polylinesUpdated){var a=this._polylinesToUpdate;if(this._mode!==D.SCENE3D)for(var l=a.length,u=0;l>u;++u)i=a[u],i.update();if(o[K]||o[Z])L(this,r,n);else for(var c=a.length,h=this._polylineBuckets,d=0;c>d;++d){i=a[d],o=i._propertiesChanged;var m=i._bucket,p=0;for(var v in h)if(h.hasOwnProperty(v)){if(h[v]===m){(o[X]||o[j]||o[Y])&&m.writeUpdate(p,i,this._positionBuffer,this._texCoordExpandWidthAndShowBuffer,n);break}p+=h[v].lengthOfPositions}i._clean()}a.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(var g=0;Q>g;++g)o[g]=0;var _=f.IDENTITY;e.mode===D.SCENE3D&&(_=this.modelMatrix);var y=e.passes,E=0!==e.morphTime;if(s(this._opaqueRS)&&this._opaqueRS.depthTest.enabled===E||(this._opaqueRS=C.fromCache({depthMask:E,depthTest:{enabled:E}})),s(this._translucentRS)&&this._translucentRS.depthTest.enabled===E||(this._translucentRS=C.fromCache({blending:A.ALPHA_BLEND,depthMask:!E,depthTest:{enabled:E}})),y.render){var S=this._colorCommands;O(this,e,S,_,!0)}if(y.pick){var w=this._pickCommands;O(this,e,w,_,!1)}}};var $=new e,ee=new e;R.prototype.isDestroyed=function(){return!1},R.prototype.destroy=function(){return U(this),z(this),G(this),u(this)};var te=[0,0,0],ie=[];R.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,this._polylinesToUpdate.push(e),++this._propertiesChanged[t]},H.prototype.addPolyline=function(e){var t=this.polylines;t.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this},H.prototype.updateShader=function(e){if(!s(this.shaderProgram)){var t=new S({sources:[T,b]}),i=new S({sources:[this.material.shaderSource,x]}),r=new S({sources:i.sources,pickColorQualifier:"varying"});this.shaderProgram=E.fromCache({context:e,vertexShaderSource:t,fragmentShaderSource:i,attributeLocations:J}),this.pickShaderProgram=E.fromCache({context:e,vertexShaderSource:t,fragmentShaderSource:r,attributeLocations:J})}},H.prototype.getPolylinePositionsLength=function(e){var t;if(this.mode===D.SCENE3D||!q(e))return t=e._actualPositions.length,4*t-4;var i=0,r=e._segments.lengths;t=r.length;for(var n=0;t>n;++n)i+=4*r[n]-4;return i};var re=new t,ne=new t,oe=new t,ae=new t;H.prototype.write=function(e,i,r,o,a,s,l,u){for(var c=this.mode,d=this.polylines,m=d.length,p=0;m>p;++p)for(var f,v=d[p],g=v.width,_=v.show&&g>0,y=this.getSegments(v,u),C=y.positions,E=y.lengths,S=C.length,w=v.getPickId(l).color,T=0,x=0,b=0;S>b;++b){0===b?v._loop?f=C[S-2]:(f=ae,t.subtract(C[0],C[1],f),t.add(C[0],f,f)):f=C[b-1],ne.x=f.x,ne.y=f.y,ne.z=c!==D.SCENE2D?f.z:0,f=C[b],re.x=f.x,re.y=f.y,re.z=c!==D.SCENE2D?f.z:0,b===S-1?v._loop?f=C[1]:(f=ae,t.subtract(C[S-1],C[S-2],f),t.add(C[S-1],f,f)):f=C[b+1],oe.x=f.x,oe.y=f.y,oe.z=c!==D.SCENE2D?f.z:0;var A=E[T];b===x+A&&(x+=A,++T);for(var P=b-x===0,I=b===x+E[T]-1,M=P?2:0,R=I?2:4,O=M;R>O;++O){h.writeElements(re,e,o),h.writeElements(ne,e,o+6),h.writeElements(oe,e,o+12),i[a]=n.floatToByte(w.red),i[a+1]=n.floatToByte(w.green),i[a+2]=n.floatToByte(w.blue),i[a+3]=n.floatToByte(w.alpha);var N=0>O-2?-1:1;r[s]=b/(S-1),r[s+1]=2*(O%2)-1,r[s+2]=N*g,r[s+3]=_,o+=18,a+=4,s+=4}}};var se=new t,le=new t,ue=new t,ce=new t;H.prototype.writeForMorph=function(e,i){for(var r=this.modelMatrix,n=this.polylines,o=n.length,a=0;o>a;++a)for(var s=n[a],l=s._segments.positions,u=s._segments.lengths,c=l.length,d=0,m=0,p=0;c>p;++p){var v;0===p?s._loop?v=l[c-2]:(v=ce,t.subtract(l[0],l[1],v),t.add(l[0],v,v)):v=l[p-1],v=f.multiplyByPoint(r,v,le);var g,_=f.multiplyByPoint(r,l[p],se);p===c-1?s._loop?g=l[1]:(g=ce,t.subtract(l[c-1],l[c-2],g),t.add(l[c-1],g,g)):g=l[p+1],g=f.multiplyByPoint(r,g,ue);var y=u[d];p===m+y&&(m+=y,++d);for(var C=p-m===0,E=p===m+u[d]-1,S=C?2:0,w=E?2:4,T=S;w>T;++T)h.writeElements(_,e,i),h.writeElements(v,e,i+6),h.writeElements(g,e,i+12),i+=18}};var he=new Array(1);H.prototype.updateIndices=function(e,t,i,r){var n=i.length-1,o=new W(0,r,this);i[n].push(o);var a=0,s=e[e.length-1],l=0;s.length>0&&(l=s[s.length-1]+1);for(var u=this.polylines,c=u.length,h=0;c>h;++h){var d=u[h];d._locatorBuckets=[];var m;if(this.mode===D.SCENE3D){m=he;var f=d._actualPositions.length;if(!(f>0))continue;m[0]=f}else m=d._segments.lengths;var v=m.length;if(v>0){for(var g=0,_=0;v>_;++_)for(var y=m[_]-1,C=0;y>C;++C)l+4>=p.SIXTY_FOUR_KILOBYTES-2&&(d._locatorBuckets.push({locator:o,count:g}),g=0,t.push(4),s=[],e.push(s),l=0,o.count=a,a=0,r=0,o=new W(0,0,this),i[++n]=[o]),s.push(l,l+2,l+1),s.push(l+1,l+2,l+3),g+=6,a+=6,r+=6,l+=4;d._locatorBuckets.push({locator:o,count:g}),l+4>=p.SIXTY_FOUR_KILOBYTES-2&&(t.push(0),s=[],e.push(s),l=0,o.count=a,r=0,a=0,o=new W(0,0,this),i[++n]=[o])}d._clean()}return o.count=a,r},H.prototype.getPolylineStartIndex=function(e){for(var t=this.polylines,i=0,r=t.length,n=0;r>n;++n){var o=t[n];if(o===e)break;i+=o._actualLength}return i};var de={positions:void 0,lengths:void 0},me=new Array(1),pe=new t,fe=new r;H.prototype.getSegments=function(i,r){var n=i._actualPositions;if(this.mode===D.SCENE3D)return me[0]=n.length,de.positions=n,de.lengths=me,de;q(i)&&(n=i._segments.positions);for(var o,a=r.ellipsoid,s=[],l=this.modelMatrix,u=n.length,c=pe,h=0;u>h;++h)o=n[h],c=f.multiplyByPoint(l,o,c),s.push(r.project(a.cartesianToCartographic(c,fe)));if(s.length>0){i._boundingVolume2D=e.fromPoints(s,i._boundingVolume2D);var d=i._boundingVolume2D.center;i._boundingVolume2D.center=new t(d.z,d.x,d.y)}return de.positions=s,de.lengths=i._segments.lengths,de};var ve,ge;return H.prototype.writeUpdate=function(e,i,r,n,o){var a=this.mode,l=i._actualLength;if(l){e+=this.getPolylineStartIndex(i);var u=ve,c=ge,d=6*l*3;!s(u)||u.length<d?(u=ve=new Float32Array(d),c=ge=new Float32Array(4*l)):u.length>d&&(u=new Float32Array(u.buffer,0,d),c=new Float32Array(c.buffer,0,4*l));var m,p=0,f=0,v=this.getSegments(i,o),g=v.positions,_=v.lengths,y=0,C=0,E=i.width,S=i.show&&E>0;l=g.length;for(var w=0;l>w;++w){0===w?i._loop?m=g[l-2]:(m=ae,t.subtract(g[0],g[1],m),t.add(g[0],m,m)):m=g[w-1],ne.x=m.x,ne.y=m.y,ne.z=a!==D.SCENE2D?m.z:0,m=g[w],re.x=m.x,re.y=m.y,re.z=a!==D.SCENE2D?m.z:0,w===l-1?i._loop?m=g[1]:(m=ae,t.subtract(g[l-1],g[l-2],m),t.add(g[l-1],m,m)):m=g[w+1],oe.x=m.x,oe.y=m.y,oe.z=a!==D.SCENE2D?m.z:0;var T=_[y];w===C+T&&(C+=T,++y);for(var x=w-C===0,b=w===C+_[y]-1,A=x?2:0,P=b?2:4,I=A;P>I;++I){h.writeElements(re,u,p),h.writeElements(ne,u,p+6),h.writeElements(oe,u,p+12);var M=0>I-2?-1:1;c[f]=w/(l-1),c[f+1]=2*(I%2)-1,c[f+2]=M*E,c[f+3]=S,p+=18,f+=4}}r.copyFromArrayView(u,18*Float32Array.BYTES_PER_ELEMENT*e),n.copyFromArrayView(c,4*Float32Array.BYTES_PER_ELEMENT*e)}},R}),i("DataSources/ScaledPositionProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/ReferenceFrame","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(e){this._definitionChanged=new n,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}return t(s.prototype,{isConstant:{get:function(){return a.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return e(this._value)?this._value.referenceFrame:o.FIXED}}}),s.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,o.FIXED,t)},s.prototype.setValue=function(t){this._value!==t&&(this._value=t,e(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),e(t)&&(this._removeSubscription=t.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))},s.prototype.getValueInReferenceFrame=function(t,i,n){return e(this._value)?(n=this._value.getValueInReferenceFrame(t,i,n),e(n)?r.WGS84.scaleToGeodeticSurface(n,n):void 0):void 0},s.prototype.equals=function(e){return this===e||e instanceof s&&this._value===e._value},s.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},s}),i("DataSources/PathVisualizer",["../Core/AssociativeArray","../Core/Cartesian3","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/JulianDate","../Core/Matrix3","../Core/Matrix4","../Core/ReferenceFrame","../Core/TimeInterval","../Core/Transforms","../Scene/PolylineCollection","../Scene/SceneMode","./CompositePositionProperty","./ConstantPositionProperty","./MaterialProperty","./Property","./ReferenceProperty","./SampledPositionProperty","./ScaledPositionProperty","./TimeIntervalCollectionPositionProperty"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C){"use strict";function E(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function S(e,t,r,n,a,s,l,u,c){var h,d=u;h=e.getValueInReferenceFrame(t,s,c[d]),i(h)&&(c[d++]=h);for(var m,p,f,v=!i(a)||o.lessThanOrEquals(a,t)||o.greaterThanOrEquals(a,r),g=0,_=n.length,y=n[g],C=r,E=!1;_>g;){if(!v&&o.greaterThanOrEquals(y,a)&&(h=e.getValueInReferenceFrame(a,s,c[d]),i(h)&&(c[d++]=h),v=!0),o.greaterThan(y,t)&&o.lessThan(y,C)&&!y.equals(a)&&(h=e.getValueInReferenceFrame(y,s,c[d]),i(h)&&(c[d++]=h)),_-1>g){if(l>0&&!E){var S=n[g+1],w=o.secondsDifference(S,y);E=w>l,E&&(m=Math.ceil(w/l),p=0,f=w/Math.max(m,2),m=Math.max(m-1,1))}if(E&&m>p){y=o.addSeconds(y,f,new o),p++;continue}}E=!1,g++,y=n[g]}return h=e.getValueInReferenceFrame(r,s,c[d]),i(h)&&(c[d++]=h),d}function w(e,t,r,n,a,s,l,u){for(var c,h=0,d=l,m=t,p=Math.max(s,60),f=!i(n)||o.lessThanOrEquals(n,t)||o.greaterThanOrEquals(n,r);o.lessThan(m,r);)!f&&o.greaterThanOrEquals(m,n)&&(f=!0,c=e.getValueInReferenceFrame(n,a,u[d]),i(c)&&(u[d]=c,d++)),c=e.getValueInReferenceFrame(m,a,u[d]),i(c)&&(u[d]=c,d++),h++,m=o.addSeconds(t,p*h,new o);return c=e.getValueInReferenceFrame(r,a,u[d]),i(c)&&(u[d]=c,d++),d}function T(e,t,r,n,a,s,l,c){L.start=t,L.stop=r;for(var h=l,d=e.intervals,m=0;m<d.length;m++){var p=d.get(m);if(!u.intersect(p,L,O).isEmpty){var f=p.start;p.isStartIncluded||(f=p.isStopIncluded?p.stop:o.addSeconds(p.start,o.secondsDifference(p.stop,p.start)/2,new o));var v=e.getValueInReferenceFrame(f,a,c[h]);i(v)&&(c[h]=v,h++)}}return h}function x(e,t,r,n,o,a,s,l){var u=e.getValueInReferenceFrame(t,o,l[s]);return i(u)&&(l[s++]=u),s}function b(e,t,i,r,n,a,s,l){N.start=t,N.stop=i;for(var c=s,h=e.intervals,d=0;d<h.length;d++){var m=h.get(d);if(!u.intersect(m,N,O).isEmpty){var p=m.start,f=m.stop,v=t;o.greaterThan(p,v)&&(v=p);var g=i;o.lessThan(f,g)&&(g=f),c=A(m.data,v,g,r,n,a,c,l)}}return c}function A(e,t,i,r,n,o,a,s){for(var l=e;l instanceof g||l instanceof y;)l instanceof g&&(l=l.resolvedProperty),l instanceof y&&(l=l._value);if(l instanceof _){var u=l._property._times;a=S(e,t,i,u,r,n,o,a,s)}else a=l instanceof m?b(e,t,i,r,n,o,a,s):l instanceof C?T(e,t,i,r,n,o,a,s):l instanceof p?x(e,t,i,r,n,o,a,s):w(e,t,i,r,n,o,a,s);return a}function P(e,t,r,n,o,a,s){i(s)||(s=[]);var l=A(e,t,r,n,o,a,0,s);return s.length=l,s}function I(e,t){this._unusedIndexes=[],this._polylineCollection=new h,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}function M(t,i){i.collectionChanged.addEventListener(M.prototype._onCollectionChanged,this),this._scene=t,this._updaters={},this._entityCollection=i,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}var D=60,R=1,O=new u,N=new u,L=new u,F=new a;return I.prototype.update=function(e){if(this._referenceFrame===l.INERTIAL){var r=c.computeIcrfToFixedMatrix(e,F);i(r)||(r=c.computeTemeToPseudoFixedMatrix(e,F)),s.fromRotationTranslation(r,t.ZERO,this._polylineCollection.modelMatrix)}},I.prototype.updateObject=function(e,t){var r,n,a=t.entity,s=a._path,l=a._position,u=s._show,c=t.polyline,h=a.isShowing&&(!i(u)||u.getValue(e));if(h){var d=v.getValueOrUndefined(s._leadTime,e),m=v.getValueOrUndefined(s._trailTime,e),p=a._availability,g=i(p),_=i(d),y=i(m);if(h=g||_&&y){if(y&&(r=o.addSeconds(e,-m,new o)),_&&(n=o.addSeconds(e,d,new o)),g){var C=p.start,E=p.stop;(!y||o.greaterThan(C,r))&&(r=C),(!_||o.lessThan(E,n))&&(n=E)}h=o.lessThan(r,n)}}if(!h)return void(i(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0));if(!i(c)){var S=this._unusedIndexes,w=S.length;if(w>0){var T=S.pop();c=this._polylineCollection.get(T),t.index=T}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=a,t.polyline=c}var x=v.getValueOrDefault(s._resolution,e,D);c.show=!0,c.positions=P(l,r,n,e,this._referenceFrame,x,c.positions.slice()),c.material=f.getValue(e,s._material,c.material),c.width=v.getValueOrDefault(s._width,e,R)},I.prototype.removeObject=function(e){var t=e.polyline;i(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,e.index=void 0)},I.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),r(this)},M.prototype.update=function(e){var t=this._updaters;for(var r in t)t.hasOwnProperty(r)&&t[r].update(e);for(var n=this._items.values,o=0,a=n.length;a>o;o++){var s=n[o],u=s.entity,c=u._position,h=s.updater,m=l.FIXED;this._scene.mode===d.SCENE3D&&(m=c.referenceFrame);var p=this._updaters[m];h===p&&i(p)?p.updateObject(e,s):(i(h)&&h.removeObject(s),i(p)||(p=new I(this._scene,m),p.update(e),this._updaters[m]=p),s.updater=p,i(p)&&p.updateObject(e,s))}return!0},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(M.prototype._onCollectionChanged,this);var e=this._updaters;for(var t in e)e.hasOwnProperty(t)&&e[t].destroy();return r(this)},M.prototype._onCollectionChanged=function(e,t,r,n){var o,a,s,l=this._items;for(o=t.length-1;o>-1;o--)a=t[o],i(a._path)&&i(a._position)&&l.set(a.id,new E(a));for(o=n.length-1;o>-1;o--)a=n[o],i(a._path)&&i(a._position)?l.contains(a.id)||l.set(a.id,new E(a)):(s=l.get(a.id),i(s)&&(s.updater.removeObject(s),l.remove(a.id)));for(o=r.length-1;o>-1;o--)a=r[o],s=l.get(a.id),i(s)&&(s.updater.removeObject(s),l.remove(a.id))},M._subSample=P,M}),i("Shaders/PointPrimitiveCollectionFS",[],function(){"use strict";return"varying vec4 v_color;\nvarying vec4 v_outlineColor;\nvarying float v_innerPercent;\nvarying float v_pixelDistance;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#endif\nvoid main()\n{\nfloat distanceToCenter = length(gl_PointCoord - vec2(0.5));\nfloat maxDistance = max(0.0, 0.5 - v_pixelDistance);\nfloat wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);\nfloat innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter);\nvec4 color = mix(v_outlineColor, v_color, innerAlpha);\ncolor.a *= wholeAlpha;\nif (color.a < 0.005)\n{\ndiscard;\n}\n#ifdef RENDER_FOR_PICK\ngl_FragColor = v_pickColor;\n#else\ngl_FragColor = color;\n#endif\n}\n"}),i("Shaders/PointPrimitiveCollectionVS",[],function(){"use strict";return"uniform float u_maxTotalPointSize;\nattribute vec4 positionHighAndSize;\nattribute vec4 positionLowAndOutline;\nattribute vec4 compressedAttribute0;\nattribute vec4 compressedAttribute1;\nattribute vec4 scaleByDistance;\nvarying vec4 v_color;\nvarying vec4 v_outlineColor;\nvarying float v_innerPercent;\nvarying float v_pixelDistance;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#endif\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nvoid main()\n{\nvec3 positionHigh = positionHighAndSize.xyz;\nvec3 positionLow = positionLowAndOutline.xyz;\nfloat outlineWidthBothSides = 2.0 * positionLowAndOutline.w;\nfloat totalSize = positionHighAndSize.w + outlineWidthBothSides;\nfloat outlinePercent = outlineWidthBothSides / totalSize;\ntotalSize *= czm_resolutionScale;\ntotalSize += 3.0;\nfloat temp = compressedAttribute1.x * SHIFT_RIGHT8;\nfloat show = floor(temp);\n#ifdef EYE_DISTANCE_TRANSLUCENCY\nvec4 translucencyByDistance;\ntranslucencyByDistance.x = compressedAttribute1.z;\ntranslucencyByDistance.z = compressedAttribute1.w;\ntranslucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\ntemp = compressedAttribute1.y * SHIFT_RIGHT8;\ntranslucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n#endif\nvec4 color;\nvec4 outlineColor;\n#ifdef RENDER_FOR_PICK\ncolor = vec4(0.0);\noutlineColor = vec4(0.0);\nvec4 pickColor;\ntemp = compressedAttribute0.z * SHIFT_RIGHT8;\npickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\npickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\npickColor.r = floor(temp);\n#else\ntemp = compressedAttribute0.x * SHIFT_RIGHT8;\ncolor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\ncolor.g = (temp - floor(temp)) * SHIFT_LEFT8;\ncolor.r = floor(temp);\ntemp = compressedAttribute0.y * SHIFT_RIGHT8;\noutlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\noutlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\noutlineColor.r = floor(temp);\n#endif\ntemp = compressedAttribute0.w * SHIFT_RIGHT8;\n#ifdef RENDER_FOR_PICK\npickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\npickColor = pickColor / 255.0;\n#endif\ntemp = floor(temp) * SHIFT_RIGHT8;\noutlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\noutlineColor /= 255.0;\ncolor.a = floor(temp);\ncolor /= 255.0;\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\npositionEC.xyz *= show;\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY)\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\n}\n#endif\n#ifdef EYE_DISTANCE_SCALING\ntotalSize *= czm_nearFarScalar(scaleByDistance, lengthSq);\n#endif\ntotalSize = min(totalSize, u_maxTotalPointSize);\nif (totalSize < 1.0)\n{\npositionEC.xyz = vec3(0.0);\ntotalSize = 1.0;\n}\nfloat translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\ntranslucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\nif (translucency < 0.004)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\nv_color = color;\nv_color.a *= translucency;\nv_outlineColor = outlineColor;\nv_outlineColor.a *= translucency;\nv_innerPercent = 1.0 - outlinePercent;\nv_pixelDistance = 2.0 / totalSize;\ngl_PointSize = totalSize;\n#ifdef RENDER_FOR_PICK\nv_pickColor = pickColor;\n#endif\n}\n"}),i("Scene/PointPrimitive",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","../Core/NearFarScalar","./SceneMode","./SceneTransforms"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(e,i){e=n(e,n.EMPTY_OBJECT),this._show=n(e.show,!0),this._position=t.clone(n(e.position,t.ZERO)),this._actualPosition=t.clone(this._position),this._color=r.clone(n(e.color,r.WHITE)),this._outlineColor=r.clone(n(e.outlineColor,r.TRANSPARENT)),this._outlineWidth=n(e.outlineWidth,0),this._pixelSize=n(e.pixelSize,10),this._scaleByDistance=e.scaleByDistance,this._translucencyByDistance=e.translucencyByDistance,this._id=e.id,this._collection=n(e.collection,i),this._pickId=void 0,this._pointPrimitiveCollection=i,this._dirty=!1,this._index=-1}function m(e,t){var i=e._pointPrimitiveCollection;o(i)&&(i._updatePointPrimitive(e,t),e._dirty=!0)}var p=d.SHOW_INDEX=0,f=d.POSITION_INDEX=1,v=d.COLOR_INDEX=2,g=d.OUTLINE_COLOR_INDEX=3,_=d.OUTLINE_WIDTH_INDEX=4,y=d.PIXEL_SIZE_INDEX=5,C=d.SCALE_BY_DISTANCE_INDEX=6,E=d.TRANSLUCENCY_BY_DISTANCE_INDEX=7;d.NUMBER_OF_PROPERTIES=8,a(d.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,m(this,p))}},position:{get:function(){return this._position},set:function(e){var i=this._position;t.equals(i,e)||(t.clone(e,i),t.clone(e,this._actualPosition),m(this,f))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;u.equals(t,e)||(this._scaleByDistance=u.clone(e,t),m(this,C))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;u.equals(t,e)||(this._translucencyByDistance=u.clone(e,t),m(this,E))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,m(this,y))}},color:{get:function(){return this._color},set:function(e){var t=this._color;r.equals(t,e)||(r.clone(e,t),m(this,v))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){var t=this._outlineColor;r.equals(t,e)||(r.clone(e,t),m(this,g))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,m(this,_))}},id:{get:function(){return this._id},set:function(e){this._id=e,o(this._pickId)&&(this._pickId.object.id=e)}}}),d.prototype.getPickId=function(e){return o(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId},d.prototype._getActualPosition=function(){return this._actualPosition},d.prototype._setActualPosition=function(e){t.clone(e,this._actualPosition),m(this,f)};var S=new i;d._computeActualPosition=function(e,t,i){return t.mode===c.SCENE3D?e:(l.multiplyByPoint(i,e,S),h.computeActualWgs84Position(t,S))};var w=new l,T=new i;return d._computeScreenSpacePosition=function(e,t,r,n){var o=r.camera,a=o.viewMatrix,s=o.frustum.projectionMatrix,u=l.multiplyTransformation(a,e,w),c=l.multiplyByVector(u,i.fromElements(t.x,t.y,t.z,1,T),T),d=l.multiplyByVector(s,c,T),m=h.clipToGLWindowCoordinates(r,d,n);return m},d.prototype.computeScreenSpacePosition=function(t,i){var r=this._pointPrimitiveCollection;o(i)||(i=new e);var n=r.modelMatrix,a=d._computeScreenSpacePosition(n,this._actualPosition,t,i);return a.y=t.canvas.clientHeight-a.y,a},d.prototype.equals=function(e){return this===e||o(e)&&this._id===e._id&&t.equals(this._position,e._position)&&r.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&r.equals(this._outlineColor,e._outlineColor)&&u.equals(this._scaleByDistance,e._scaleByDistance)&&u.equals(this._translucencyByDistance,e._translucencyByDistance)},d.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0},d}),i("Scene/PointPrimitiveCollection",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/Math","../Core/Matrix4","../Core/PrimitiveType","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArrayFacade","../Shaders/PointPrimitiveCollectionFS","../Shaders/PointPrimitiveCollectionVS","./BlendingState","./Pass","./PointPrimitive","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S,w,T,x,b){"use strict";function A(t){t=o(t,o.EMPTY_OBJECT),this._sp=void 0,this._rs=void 0,this._vaf=void 0,this._spPick=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._compiledShaderScaleByDistancePick=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistancePick=!1,this._propertiesChanged=new Uint32Array(Y),this._maxPixelSize=1,this._baseVolume=new e,this._baseVolumeWC=new e,this._baseVolume2D=new e,this._boundingVolume=new e,this._boundingVolumeDirty=!1,this._colorCommands=[],this._pickCommands=[],this.modelMatrix=d.clone(o(t.modelMatrix,d.IDENTITY)),this._modelMatrix=d.clone(d.IDENTITY),this.debugShowBoundingVolume=o(t.debugShowBoundingVolume,!1),this._mode=b.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW];var i=this;this._uniforms={u_maxTotalPointSize:function(){return i._maxTotalPointSize}}}function P(e){for(var t=e.length,i=0;t>i;++i)e[i]&&e[i]._destroy()}function I(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;for(var t=[],i=e._pointPrimitives,r=i.length,n=0,o=0;r>n;++n){var a=i[n];a&&(a._index=o++,t.push(a))}e._pointPrimitives=t}}function M(e,t,i){return new C(e,[{index:X.positionHighAndSize,componentsPerAttribute:4,componentDatatype:n.FLOAT,usage:i[z]},{index:X.positionLowAndShow,componentsPerAttribute:4,componentDatatype:n.FLOAT,usage:i[z]},{index:X.compressedAttribute0,componentsPerAttribute:4,componentDatatype:n.FLOAT,usage:i[U]},{index:X.compressedAttribute1,componentsPerAttribute:4,componentDatatype:n.FLOAT,usage:i[j]},{index:X.scaleByDistance,componentsPerAttribute:4,componentDatatype:n.FLOAT,usage:i[q]}],t)}function D(t,i,r,n){var o=n._index,a=n._getActualPosition();t._mode===b.SCENE3D&&(e.expand(t._baseVolume,a,t._baseVolume),t._boundingVolumeDirty=!0),c.fromCartesian(a,Z);var s=n.pixelSize,l=n.outlineWidth;t._maxPixelSize=Math.max(t._maxPixelSize,s+l);var u=r[X.positionHighAndSize],h=Z.high;u(o,h.x,h.y,h.z,s);var d=r[X.positionLowAndOutline],m=Z.low;d(o,m.x,m.y,m.z,l)}function R(e,t,i,n){var o=n._index,a=n.color,s=n.getPickId(t).color,l=n.outlineColor,u=r.floatToByte(a.red),c=r.floatToByte(a.green),h=r.floatToByte(a.blue),d=u*K+c*Q+h;u=r.floatToByte(l.red),c=r.floatToByte(l.green),h=r.floatToByte(l.blue);var m=u*K+c*Q+h;u=r.floatToByte(s.red),c=r.floatToByte(s.green),h=r.floatToByte(s.blue);var p=u*K+c*Q+h,f=r.floatToByte(a.alpha)*K+r.floatToByte(l.alpha)*Q+r.floatToByte(s.alpha),v=i[X.compressedAttribute0];v(o,d,m,p,f)}function O(e,t,i,r){var n=r._index,o=0,s=1,l=1,u=1,c=r.translucencyByDistance;a(c)&&(o=c.near,s=c.nearValue,l=c.far,u=c.farValue,(1!==s||1!==u)&&(e._shaderTranslucencyByDistance=!0));var d=r.show;0===r.color.alpha&&0===r.outlineColor.alpha&&(d=!1),s=h.clamp(s,0,1),s=1===s?255:255*s|0;var m=(d?1:0)*Q+s;u=h.clamp(u,0,1),u=1===u?255:255*u|0;var p=u,f=i[X.compressedAttribute1];f(n,m,p,o,l)}function N(e,t,i,r){var n=r._index,o=i[X.scaleByDistance],s=0,l=1,u=1,c=1,h=r.scaleByDistance;a(h)&&(s=h.near,l=h.nearValue,u=h.far,c=h.farValue, +(1!==l||1!==c)&&(e._shaderScaleByDistance=!0)),o(n,s,l,u,c)}function L(e,t,i,r){D(e,t,i,r),R(e,t,i,r),O(e,t,i,r),N(e,t,i,r)}function F(t,i,r,n,o,s){var l;n.mode===b.SCENE3D?(l=t._baseVolume,t._boundingVolumeDirty=!0):l=t._baseVolume2D;for(var u=[],c=0;r>c;++c){var h=i[c],d=h.position,m=x._computeActualPosition(d,n,o);a(m)&&(h._setActualPosition(m),s?u.push(m):e.expand(l,m,l))}s&&e.fromPoints(u,l)}function B(e,t){var i=t.mode,r=e._pointPrimitives,n=e._pointPrimitivesToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==i||i!==b.SCENE3D&&!d.equals(o,e.modelMatrix)?(e._mode=i,d.clone(e.modelMatrix,o),e._createVertexArray=!0,(i===b.SCENE3D||i===b.SCENE2D||i===b.COLUMBUS_VIEW)&&F(e,r,r.length,t,o,!0)):i===b.MORPHING?F(e,r,r.length,t,o,!0):(i===b.SCENE2D||i===b.COLUMBUS_VIEW)&&F(e,n,e._pointPrimitivesToUpdateIndex,t,o,!1)}function V(e,t,i){var r=t.camera.getPixelSize(i,t.context.drawingBufferWidth,t.context.drawingBufferHeight),n=r*e._maxPixelSize;i.radius+=n}var k=x.SHOW_INDEX,z=x.POSITION_INDEX,U=x.COLOR_INDEX,G=x.OUTLINE_COLOR_INDEX,W=x.OUTLINE_WIDTH_INDEX,H=x.PIXEL_SIZE_INDEX,q=x.SCALE_BY_DISTANCE_INDEX,j=x.TRANSLUCENCY_BY_DISTANCE_INDEX,Y=x.NUMBER_OF_PROPERTIES,X={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4};s(A.prototype,{length:{get:function(){return I(this),this._pointPrimitives.length}}}),A.prototype.add=function(e){var t=new x(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t},A.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1},A.prototype.removeAll=function(){P(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0},A.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]},A.prototype.contains=function(e){return a(e)&&e._pointPrimitiveCollection===this},A.prototype.get=function(e){return I(this),this._pointPrimitives[e]},A.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,i=this._propertiesChanged,r=0;Y>r;++r){var n=0===i[r]?p.STATIC_DRAW:p.STREAM_DRAW;t=t||e[r]!==n,e[r]=n}return t};var Z=new c,K=65536,Q=256,J=[];return A.prototype.update=function(t){I(this),this._maxTotalPointSize=f.maximumAliasedPointSize,B(this,t);var i,r=this._pointPrimitives,n=r.length,o=this._pointPrimitivesToUpdate,s=this._pointPrimitivesToUpdateIndex,l=this._propertiesChanged,u=this._createVertexArray,c=t.context,h=t.passes,p=h.pick;if(u||!p&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var C=0;Y>C;++C)l[C]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=M(c,n,this._buffersUsage),i=this._vaf.writers;for(var x=0;n>x;++x){var A=this._pointPrimitives[x];A._dirty=!1,L(this,c,i,A)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(s>0){var P=J;P.length=0,(l[z]||l[W]||l[H])&&P.push(D),(l[U]||l[G])&&P.push(R),(l[k]||l[j])&&P.push(O),l[q]&&P.push(N);var F=P.length;if(i=this._vaf.writers,s/n>.1){for(var Z=0;s>Z;++Z){var K=o[Z];K._dirty=!1;for(var Q=0;F>Q;++Q)P[Q](this,c,i,K)}this._vaf.commit()}else{for(var $=0;s>$;++$){var ee=o[$];ee._dirty=!1;for(var te=0;F>te;++te)P[te](this,c,i,ee);this._vaf.subCommit(ee._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(s>1.5*n&&(o.length=n),a(this._vaf)&&a(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,e.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var ie,re=d.IDENTITY;t.mode===b.SCENE3D?(re=this.modelMatrix,ie=e.clone(this._baseVolumeWC,this._boundingVolume)):ie=e.clone(this._baseVolume2D,this._boundingVolume),V(this,t,ie);var ne,oe,ae,se,le,ue,ce=t.commandList;if(h.render){var he=this._colorCommands;for(a(this._rs)||(this._rs=g.fromCache({depthTest:{enabled:!0},blending:w.ALPHA_BLEND})),(!a(this._sp)||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance)&&(le=new y({sources:[S]}),this._shaderScaleByDistance&&le.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&le.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._sp=_.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:le,fragmentShaderSource:E,attributeLocations:X}),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance),ne=this._vaf.va,oe=ne.length,he.length=oe,se=0;oe>se;++se)ae=he[se],a(ae)||(ae=he[se]=new v({primitiveType:m.POINTS,pass:T.OPAQUE,owner:this})),ae.boundingVolume=ie,ae.modelMatrix=re,ae.shaderProgram=this._sp,ae.uniformMap=this._uniforms,ae.vertexArray=ne[se].va,ae.renderState=this._rs,ae.debugShowBoundingVolume=this.debugShowBoundingVolume,ce.push(ae)}if(p){var de=this._pickCommands;for((!a(this._spPick)||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistancePick||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistancePick)&&(le=new y({defines:["RENDER_FOR_PICK"],sources:[S]}),this._shaderScaleByDistance&&le.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&le.defines.push("EYE_DISTANCE_TRANSLUCENCY"),ue=new y({defines:["RENDER_FOR_PICK"],sources:[E]}),this._spPick=_.replaceCache({context:c,shaderProgram:this._spPick,vertexShaderSource:le,fragmentShaderSource:ue,attributeLocations:X}),this._compiledShaderScaleByDistancePick=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistancePick=this._shaderTranslucencyByDistance),ne=this._vaf.va,oe=ne.length,de.length=oe,se=0;oe>se;++se)ae=de[se],a(ae)||(ae=de[se]=new v({primitiveType:m.POINTS,pass:T.OPAQUE,owner:this})),ae.boundingVolume=ie,ae.modelMatrix=re,ae.shaderProgram=this._spPick,ae.uniformMap=this._uniforms,ae.vertexArray=ne[se].va,ae.renderState=this._rs,ce.push(ae)}}},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),P(this._pointPrimitives),l(this)},A}),i("DataSources/PointVisualizer",["../Core/AssociativeArray","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/NearFarScalar","../Scene/PointPrimitiveCollection","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e){this.entity=e,this.pointPrimitive=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function h(t,i){i.collectionChanged.addEventListener(h.prototype._onCollectionChanged,this),this._scene=t,this._unusedIndexes=[],this._entityCollection=i,this._pointPrimitiveCollection=void 0,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}function d(e,t){if(r(e)){var i=e.pointPrimitive;r(i)&&(e.pointPrimitive=void 0,i.show=!1,t.push(i._index))}}var m=i.WHITE,p=i.BLACK,f=0,v=1,g=new i,_=new t,y=new i,C=new a,E=new a;return h.prototype.update=function(e){for(var t=this._items.values,i=this._unusedIndexes,n=0,o=t.length;o>n;n++){var a=t[n],l=a.entity,c=l._point,h=a.pointPrimitive,S=l.isShowing&&l.isAvailable(e)&&u.getValueOrDefault(c._show,e,!0);if(S&&(_=u.getValueOrUndefined(l._position,e,_),S=r(_)),S){if(!r(h)){var w=this._pointPrimitiveCollection;r(w)||(w=new s,this._pointPrimitiveCollection=w,this._scene.primitives.add(w));var T=i.length;h=T>0?w.get(i.pop()):w.add(),h.id=l,a.pointPrimitive=h}h.show=!0,h.position=_,h.scaleByDistance=u.getValueOrUndefined(c._scaleByDistance,e,C),h.translucencyByDistance=u.getValueOrUndefined(c._translucencyByDistance,e,E),h.color=u.getValueOrDefault(c._color,e,m,g),h.outlineColor=u.getValueOrDefault(c._outlineColor,e,p,y),h.outlineWidth=u.getValueOrDefault(c._outlineWidth,e,f),h.pixelSize=u.getValueOrDefault(c._pixelSize,e,v)}else d(a,i)}return!0},h.prototype.getBoundingSphere=function(e,i){var n=this._items.get(e.id);return r(n)&&r(n.pointPrimitive)?(i.center=t.clone(n.pointPrimitive.position,i.center),i.radius=0,l.DONE):l.FAILED},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){return this._entityCollection.collectionChanged.removeEventListener(h.prototype._onCollectionChanged,this),r(this._pointPrimitiveCollection)&&this._scene.primitives.remove(this._pointPrimitiveCollection),n(this)},h.prototype._onCollectionChanged=function(e,t,i,n){var o,a,s=this._unusedIndexes,l=this._items;for(o=t.length-1;o>-1;o--)a=t[o],r(a._point)&&r(a._position)&&l.set(a.id,new c(a));for(o=n.length-1;o>-1;o--)a=n[o],r(a._point)&&r(a._position)?l.contains(a.id)||l.set(a.id,new c(a)):(d(l.get(a.id),s),l.remove(a.id));for(o=i.length-1;o>-1;o--)a=i[o],d(l.get(a.id),s),l.remove(a.id)},h}),i("DataSources/PolygonGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/isArray","../Core/Iso8601","../Core/PolygonGeometry","../Core/PolygonHierarchy","../Core/PolygonOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S){"use strict";function w(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0}function T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new s,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new w(e),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new w(t._entity)}var b=new _(e.WHITE),A=new y(!0),P=new y(!0),I=new y(!1),M=new y(e.BLACK),D=new e;return n(T,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:f}}),n(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&S.isConstant(this._showProperty)&&S.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&S.isConstant(this._showProperty)&&S.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new p(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i));if(this._materialProperty instanceof _){var c=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(c=this._materialProperty.color.getValue(i)),o=t.fromColor(c),n={show:u,color:o}}else n={show:u};return new l({id:a,geometry:new h(this._options),attributes:n})},T.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=S.getValueOrDefault(this._outlineColorProperty,i,e.BLACK);return new l({id:r,geometry:new m(this._options),attributes:{show:new p(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),o(this)},T.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"polygon"===t){var a=this._entity.polygon;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=r(s)&&s.isConstant?s.getValue(c.MINIMUM_VALUE):!0,h=a.outline,m=r(h);if(m&&h.isConstant&&(m=h.getValue(c.MINIMUM_VALUE)),!l&&!m)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var p=a.hierarchy,g=a.show;if(r(g)&&g.isConstant&&!g.getValue(c.MINIMUM_VALUE)||!r(p))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var y=i(a.material,b),C=y instanceof _;this._materialProperty=y,this._fillProperty=i(s,P),this._showProperty=i(g,A),this._showOutlineProperty=i(a.outline,I),this._outlineColorProperty=m?i(a.outlineColor,M):void 0;var E=a.height,w=a.extrudedHeight,T=a.granularity,x=a.stRotation,D=a.outlineWidth,R=a.perPositionHeight;if(this._fillEnabled=l,this._outlineEnabled=m,p.isConstant&&S.isConstant(E)&&S.isConstant(w)&&S.isConstant(T)&&S.isConstant(x)&&S.isConstant(D)&&S.isConstant(R)){var O=this._options;O.vertexFormat=C?v.VERTEX_FORMAT:f.MaterialSupport.TEXTURED.vertexFormat;var N=p.getValue(c.MINIMUM_VALUE);u(N)&&(N=new d(N));var L=r(E)?E.getValue(c.MINIMUM_VALUE):void 0,F=r(w)?w.getValue(c.MINIMUM_VALUE):void 0;O.polygonHierarchy=N,O.height=L,O.extrudedHeight=F,O.granularity=r(T)?T.getValue(c.MINIMUM_VALUE):void 0,O.stRotation=r(x)?x.getValue(c.MINIMUM_VALUE):void 0,O.perPositionHeight=r(R)?R.getValue(c.MINIMUM_VALUE):void 0,this._outlineWidth=r(D)?D.getValue(c.MINIMUM_VALUE):1,this._isClosed=r(F)&&F!==L,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(i){var n=this._primitives;n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var o=this._geometryUpdater,a=o._entity,s=a.polygon;if(a.isShowing&&a.isAvailable(i)&&S.getValueOrDefault(s.show,i,!0)){var c=this._options,p=S.getValueOrUndefined(s.hierarchy,i);if(r(p)){if(u(p)?c.polygonHierarchy=new d(p):c.polygonHierarchy=p,c.height=S.getValueOrUndefined(s.height,i),c.extrudedHeight=S.getValueOrUndefined(s.extrudedHeight,i),c.granularity=S.getValueOrUndefined(s.granularity,i),c.stRotation=S.getValueOrUndefined(s.stRotation,i),c.perPositionHeight=S.getValueOrUndefined(s.perPositionHeight,i),S.getValueOrDefault(s.fill,i,!0)){var _=E.getValue(i,o.fillMaterialProperty,this._material);this._material=_;var y=new f({material:_,translucent:_.isTranslucent(),closed:r(c.extrudedHeight)&&c.extrudedHeight!==c.height});c.vertexFormat=y.vertexFormat,this._primitive=n.add(new g({geometryInstances:new l({id:a,geometry:new h(c)}),appearance:y,asynchronous:!1}))}if(S.getValueOrDefault(s.outline,i,!1)){c.vertexFormat=v.VERTEX_FORMAT;var C=S.getValueOrClonedDefault(s.outlineColor,i,e.BLACK,D),w=S.getValueOrDefault(s.outlineWidth,i,1),T=1!==C.alpha;this._outlinePrimitive=n.add(new g({geometryInstances:new l({id:a,geometry:new m(c),attributes:{color:t.fromColor(C)}}),appearance:new v({flat:!0,translucent:T,renderState:{lineWidth:o._scene.clampLineWidth(w)}}),asynchronous:!1}))}}}},x.prototype.getBoundingSphere=function(e,t){return C(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},T}),i("Shaders/Appearances/PolylineColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec4 color;\nvarying vec4 v_color;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nv_color = color;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n"}),i("Scene/PolylineColorAppearance",["../Core/defaultValue","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS","../Shaders/Appearances/PolylineColorAppearanceVS","../Shaders/PolylineCommon","./Appearance"],function(e,t,i,r,n,o,a){"use strict";function s(t){t=e(t,e.EMPTY_OBJECT);var i=e(t.translucent,!0),r=!1,n=s.VERTEX_FORMAT;this.material=void 0,this.translucent=i,this._vertexShaderSource=e(t.vertexShaderSource,l),this._fragmentShaderSource=e(t.fragmentShaderSource,u),this._renderState=a.getDefaultRenderState(i,r,t.renderState),this._closed=r,this._vertexFormat=n}var l=o+"\n"+n,u=r;return t(s.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),s.VERTEX_FORMAT=i.POSITION_ONLY,s.prototype.getFragmentShaderSource=a.prototype.getFragmentShaderSource,s.prototype.isTranslucent=a.prototype.isTranslucent,s.prototype.getRenderState=a.prototype.getRenderState,s}),i("Shaders/Appearances/PolylineMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec2 st;\nvarying float v_width;\nvarying vec2 v_st;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nv_width = width;\nv_st = st;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n"}),i("Scene/PolylineMaterialAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PolylineMaterialAppearanceVS","../Shaders/PolylineCommon","../Shaders/PolylineFS","./Appearance","./Material"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.translucent,!0),n=!1,o=u.VERTEX_FORMAT;this.material=t(i.material)?i.material:l.fromType(l.ColorType),this.translucent=r,this._vertexShaderSource=e(i.vertexShaderSource,c),this._fragmentShaderSource=e(i.fragmentShaderSource,h),this._renderState=s.getDefaultRenderState(r,n,i.renderState),this._closed=n,this._vertexFormat=o}var c=o+"\n"+n,h=a;return i(u.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),u.VERTEX_FORMAT=r.POSITION_AND_ST,u.prototype.getFragmentShaderSource=s.prototype.getFragmentShaderSource,u.prototype.isTranslucent=s.prototype.isTranslucent,u.prototype.getRenderState=s.prototype.getRenderState,u}),i("DataSources/PolylineGeometryUpdater",["../Core/BoundingSphere","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/PolylineGeometry","../Core/PolylinePipeline","../Core/ShowGeometryInstanceAttribute","../Scene/PolylineCollection","../Scene/PolylineColorAppearance","../Scene/PolylineMaterialAppearance","./BoundingSphereState","./ColorMaterialProperty","./ConstantProperty","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S){"use strict";function w(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.followSurface=void 0,this.granularity=void 0}function T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._options=new w(e),this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}function x(e,t){var i=t._scene.id,r=b[i];!n(r)||r.isDestroyed()?(r=new f,b[i]=r,e.add(r)):e.contains(r)||e.add(r);var o=r.add();o.id=t._entity,this._line=o,this._primitives=e,this._geometryUpdater=t,this._positions=[],I.ellipsoid=t._scene.globe.ellipsoid}var b={},A=new y(t.WHITE),P=new C(!0);o(T,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:g}}),o(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!n(this._entity.availability)&&S.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){return!1},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(e){var r,o,a=this._entity,s=a.isAvailable(e),l=new p(s&&a.isShowing&&this._showProperty.getValue(e));if(this._materialProperty instanceof y){var u=t.WHITE;n(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(u=this._materialProperty.color.getValue(e)),r=i.fromColor(u),o={show:l,color:r}}else o={show:l};return new c({id:a,geometry:new d(this._options),attributes:o})},T.prototype.createOutlineGeometryInstance=function(e){},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),a(this)},T.prototype._onEntityPropertyChanged=function(e,t,i,o){if("availability"===t||"polyline"===t){var a=this._entity.polyline;if(!n(a))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.positions,l=a.show;if(n(l)&&l.isConstant&&!l.getValue(h.MINIMUM_VALUE)||!n(s))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var u=r(a.material,A),c=u instanceof y;this._materialProperty=u,this._showProperty=r(l,P),this._fillEnabled=!0;var d=a.width,m=a.followSurface,p=a.granularity;if(s.isConstant&&S.isConstant(d)&&S.isConstant(m)&&S.isConstant(p)){var f=this._options,_=s.getValue(h.MINIMUM_VALUE,f.positions);if(!n(_)||_.length<2)return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));f.vertexFormat=c?v.VERTEX_FORMAT:g.VERTEX_FORMAT,f.positions=_,f.width=n(d)?d.getValue(h.MINIMUM_VALUE):void 0,f.followSurface=n(m)?m.getValue(h.MINIMUM_VALUE):void 0,f.granularity=n(p)?p.getValue(h.MINIMUM_VALUE):void 0,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)};var I={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};return x.prototype.update=function(e){var t=this._geometryUpdater,i=t._entity,r=i.polyline,o=this._line;if(!i.isShowing||!i.isAvailable(e)||!S.getValueOrDefault(r._show,e,!0))return void(o.show=!1);var a=r.positions,s=S.getValueOrUndefined(a,e,this._positions);if(!n(s)||s.length<2)return void(o.show=!1);var l=S.getValueOrDefault(r._followSurface,e,!0);l&&(I.positions=s,I.granularity=S.getValueOrUndefined(r._granularity,e),I.height=m.extractHeights(s,this._geometryUpdater._scene.globe.ellipsoid),s=m.generateCartesianArc(I)),o.show=!0,o.positions=s.slice(),o.material=E.getValue(e,t.fillMaterialProperty,o.material),o.width=S.getValueOrDefault(r._width,e,1)},x.prototype.getBoundingSphere=function(t,i){var r=this._line;return r.show&&r.positions.length>0?(e.fromPoints(r.positions,i),_.DONE):_.FAILED},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._geometryUpdater,t=e._scene.id,i=b[t];i.remove(this._line),0===i.length&&(this._primitives.removeAndDestroy(i),delete b[t]),a(this)},T}),i("DataSources/PolylineVolumeGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/PolylineVolumeGeometry","../Core/PolylineVolumeOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C){"use strict";function E(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function S(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(S.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new s,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new E(e),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}function w(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new E(t._entity)}var T=new v(e.WHITE),x=new g(!0),b=new g(!0),A=new g(!1),P=new g(e.BLACK),I=new e;return n(S,{perInstanceColorAppearanceType:{value:p},materialAppearanceType:{value:m}}),n(S.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&C.isConstant(this._showProperty)&&C.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&C.isConstant(this._showProperty)&&C.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),S.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},S.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},S.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new d(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i));if(this._materialProperty instanceof v){var h=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(h=this._materialProperty.color.getValue(i)),o=t.fromColor(h),n={show:u,color:o}}else n={show:u};return new l({id:a,geometry:new c(this._options),attributes:n})},S.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=C.getValueOrDefault(this._outlineColorProperty,i,e.BLACK);return new l({id:r,geometry:new h(this._options),attributes:{show:new d(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o)}})},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){this._entitySubscription(),o(this)},S.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"polylineVolume"===t){var a=this._entity.polylineVolume;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=r(s)&&s.isConstant?s.getValue(u.MINIMUM_VALUE):!0,c=a.outline,h=r(c);if(h&&c.isConstant&&(h=c.getValue(u.MINIMUM_VALUE)),!l&&!h)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=a.positions,f=a.shape,g=a.show;if(!r(d)||!r(f)||r(g)&&g.isConstant&&!g.getValue(u.MINIMUM_VALUE))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var _=i(a.material,T),y=_ instanceof v;this._materialProperty=_,this._fillProperty=i(s,b),this._showProperty=i(g,x),this._showOutlineProperty=i(a.outline,A),this._outlineColorProperty=h?i(a.outlineColor,P):void 0;var E=a.granularity,S=a.outlineWidth,w=a.cornerType;if(this._fillEnabled=l,this._outlineEnabled=h,d.isConstant&&f.isConstant&&C.isConstant(E)&&C.isConstant(S)&&C.isConstant(w)){var I=this._options;I.vertexFormat=y?p.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,I.polylinePositions=d.getValue(u.MINIMUM_VALUE,I.polylinePositions),I.shapePositions=f.getValue(u.MINIMUM_VALUE,I.shape),I.granularity=r(E)?E.getValue(u.MINIMUM_VALUE):void 0,I.cornerType=r(w)?w.getValue(u.MINIMUM_VALUE):void 0,this._outlineWidth=r(S)?S.getValue(u.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},S.prototype.createDynamicUpdater=function(e){return new w(e,this)},w.prototype.update=function(i){var n=this._primitives;n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var o=this._geometryUpdater,a=o._entity,s=a.polylineVolume;if(a.isShowing&&a.isAvailable(i)&&C.getValueOrDefault(s.show,i,!0)){var u=this._options,d=C.getValueOrUndefined(s.positions,i,u.polylinePositions),v=C.getValueOrUndefined(s.shape,i);if(r(d)&&r(v)){if(u.polylinePositions=d,u.shapePositions=v,u.granularity=C.getValueOrUndefined(s.granularity,i),u.cornerType=C.getValueOrUndefined(s.cornerType,i),!r(s.fill)||s.fill.getValue(i)){var g=y.getValue(i,o.fillMaterialProperty,this._material); +this._material=g;var _=new m({material:g,translucent:g.isTranslucent(),closed:!0});u.vertexFormat=_.vertexFormat,this._primitive=n.add(new f({geometryInstances:new l({id:a,geometry:new c(u)}),appearance:_,asynchronous:!1}))}if(r(s.outline)&&s.outline.getValue(i)){u.vertexFormat=p.VERTEX_FORMAT;var E=C.getValueOrClonedDefault(s.outlineColor,i,e.BLACK,I),S=C.getValueOrDefault(s.outlineWidth,i,1),w=1!==E.alpha;this._outlinePrimitive=n.add(new f({geometryInstances:new l({id:a,geometry:new h(u),attributes:{color:t.fromColor(E)}}),appearance:new p({flat:!0,translucent:w,renderState:{lineWidth:o._scene.clampLineWidth(S)}}),asynchronous:!1}))}}}},w.prototype.getBoundingSphere=function(e,t){return _(e,this._primitive,this._outlinePrimitive,t)},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},S}),i("DataSources/RectangleGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/RectangleGeometry","../Core/RectangleOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C){"use strict";function E(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.closeBottom=void 0,this.closeTop=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0}function S(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(S.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new s,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new E(e),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}function w(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new E(t._entity)}var T=new v(e.WHITE),x=new g(!0),b=new g(!0),A=new g(!1),P=new g(e.BLACK),I=new e;return n(S,{perInstanceColorAppearanceType:{value:p},materialAppearanceType:{value:m}}),n(S.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&C.isConstant(this._showProperty)&&C.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&C.isConstant(this._showProperty)&&C.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},geometryChanged:{get:function(){return this._geometryChanged}}}),S.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},S.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},S.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new d(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i));if(this._materialProperty instanceof v){var h=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(h=this._materialProperty.color.getValue(i)),o=t.fromColor(h),n={show:u,color:o}}else n={show:u};return new l({id:a,geometry:new c(this._options),attributes:n})},S.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=C.getValueOrDefault(this._outlineColorProperty,i,e.BLACK);return new l({id:r,geometry:new h(this._options),attributes:{show:new d(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o)}})},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){this._entitySubscription(),o(this)},S.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"rectangle"===t){var a=this._entity.rectangle;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=r(s)&&s.isConstant?s.getValue(u.MINIMUM_VALUE):!0,c=a.outline,h=r(c);if(h&&c.isConstant&&(h=c.getValue(u.MINIMUM_VALUE)),!l&&!h)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=a.coordinates,f=a.show;if(r(f)&&f.isConstant&&!f.getValue(u.MINIMUM_VALUE)||!r(d))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var g=i(a.material,T),_=g instanceof v;this._materialProperty=g,this._fillProperty=i(s,b),this._showProperty=i(f,x),this._showOutlineProperty=i(a.outline,A),this._outlineColorProperty=h?i(a.outlineColor,P):void 0;var y=a.height,E=a.extrudedHeight,S=a.granularity,w=a.stRotation,I=a.rotation,M=a.outlineWidth,D=a.closeBottom,R=a.closeTop;if(this._fillEnabled=l,this._outlineEnabled=h,d.isConstant&&C.isConstant(y)&&C.isConstant(E)&&C.isConstant(S)&&C.isConstant(w)&&C.isConstant(I)&&C.isConstant(M)&&C.isConstant(D)&&C.isConstant(R)){var O=this._options;O.vertexFormat=_?p.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,O.rectangle=d.getValue(u.MINIMUM_VALUE,O.rectangle),O.height=r(y)?y.getValue(u.MINIMUM_VALUE):void 0,O.extrudedHeight=r(E)?E.getValue(u.MINIMUM_VALUE):void 0,O.granularity=r(S)?S.getValue(u.MINIMUM_VALUE):void 0,O.stRotation=r(w)?w.getValue(u.MINIMUM_VALUE):void 0,O.rotation=r(I)?I.getValue(u.MINIMUM_VALUE):void 0,O.closeBottom=r(D)?D.getValue(u.MINIMUM_VALUE):void 0,O.closeTop=r(R)?R.getValue(u.MINIMUM_VALUE):void 0,this._isClosed=r(E)&&r(O.closeTop)&&r(O.closeBottom)&&O.closeTop&&O.closeBottom,this._outlineWidth=r(M)?M.getValue(u.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},S.prototype.createDynamicUpdater=function(e){return new w(e,this)},w.prototype.update=function(i){var n=this._primitives;n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var o=this._geometryUpdater,a=o._entity,s=a.rectangle;if(a.isShowing&&a.isAvailable(i)&&C.getValueOrDefault(s.show,i,!0)){var u=this._options,d=C.getValueOrUndefined(s.coordinates,i,u.rectangle);if(r(d)){if(u.rectangle=d,u.height=C.getValueOrUndefined(s.height,i),u.extrudedHeight=C.getValueOrUndefined(s.extrudedHeight,i),u.granularity=C.getValueOrUndefined(s.granularity,i),u.stRotation=C.getValueOrUndefined(s.stRotation,i),u.rotation=C.getValueOrUndefined(s.rotation,i),u.closeBottom=C.getValueOrUndefined(s.closeBottom,i),u.closeTop=C.getValueOrUndefined(s.closeTop,i),C.getValueOrDefault(s.fill,i,!0)){var v=y.getValue(i,o.fillMaterialProperty,this._material);this._material=v;var g=new m({material:v,translucent:v.isTranslucent(),closed:r(u.extrudedHeight)});u.vertexFormat=g.vertexFormat,this._primitive=n.add(new f({geometryInstances:new l({id:a,geometry:new c(u)}),appearance:g,asynchronous:!1}))}if(C.getValueOrDefault(s.outline,i,!1)){u.vertexFormat=p.VERTEX_FORMAT;var _=C.getValueOrClonedDefault(s.outlineColor,i,e.BLACK,I),E=C.getValueOrDefault(s.outlineWidth,i,1),S=1!==_.alpha;this._outlinePrimitive=n.add(new f({geometryInstances:new l({id:a,geometry:new h(u),attributes:{color:t.fromColor(_)}}),appearance:new p({flat:!0,translucent:S,renderState:{lineWidth:o._scene.clampLineWidth(E)}}),asynchronous:!1}))}}}},w.prototype.getBoundingSphere=function(e,t){return _(e,this._primitive,this._outlinePrimitive,t)},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},S}),i("DataSources/WallGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Core/WallGeometry","../Core/WallOutlineGeometry","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C){"use strict";function E(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function S(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(S.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new s,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new E(e),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}function w(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new E(t._entity)}var T=new v(e.WHITE),x=new g(!0),b=new g(!0),A=new g(!1),P=new g(e.BLACK),I=new e;return n(S,{perInstanceColorAppearanceType:{value:p},materialAppearanceType:{value:m}}),n(S.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&C.isConstant(this._showProperty)&&C.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&C.isConstant(this._showProperty)&&C.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return!1}},geometryChanged:{get:function(){return this._geometryChanged}}}),S.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},S.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},S.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new c(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i));if(this._materialProperty instanceof v){var d=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(d=this._materialProperty.color.getValue(i)),o=t.fromColor(d),n={show:u,color:o}}else n={show:u};return new l({id:a,geometry:new h(this._options),attributes:n})},S.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=C.getValueOrDefault(this._outlineColorProperty,i,e.BLACK);return new l({id:r,geometry:new d(this._options),attributes:{show:new c(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o)}})},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){this._entitySubscription(),o(this)},S.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"wall"===t){var a=this._entity.wall;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=r(s)&&s.isConstant?s.getValue(u.MINIMUM_VALUE):!0,c=a.outline,h=r(c);if(h&&c.isConstant&&(h=c.getValue(u.MINIMUM_VALUE)),!l&&!h)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=a.positions,f=a.show;if(r(f)&&f.isConstant&&!f.getValue(u.MINIMUM_VALUE)||!r(d))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var g=i(a.material,T),_=g instanceof v;this._materialProperty=g,this._fillProperty=i(s,b),this._showProperty=i(f,x),this._showOutlineProperty=i(a.outline,A),this._outlineColorProperty=h?i(a.outlineColor,P):void 0;var y=a.minimumHeights,E=a.maximumHeights,S=a.outlineWidth,w=a.granularity;if(this._fillEnabled=l,this._outlineEnabled=h,d.isConstant&&C.isConstant(y)&&C.isConstant(E)&&C.isConstant(S)&&C.isConstant(w)){var I=this._options;I.vertexFormat=_?p.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,I.positions=d.getValue(u.MINIMUM_VALUE,I.positions),I.minimumHeights=r(y)?y.getValue(u.MINIMUM_VALUE,I.minimumHeights):void 0,I.maximumHeights=r(E)?E.getValue(u.MINIMUM_VALUE,I.maximumHeights):void 0,I.granularity=r(w)?w.getValue(u.MINIMUM_VALUE):void 0,this._outlineWidth=r(S)?S.getValue(u.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},S.prototype.createDynamicUpdater=function(e){return new w(e,this)},w.prototype.update=function(i){var n=this._primitives;n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var o=this._geometryUpdater,a=o._entity,s=a.wall;if(a.isShowing&&a.isAvailable(i)&&C.getValueOrDefault(s.show,i,!0)){var u=this._options,c=C.getValueOrUndefined(s.positions,i,u.positions);if(r(c)){if(u.positions=c,u.minimumHeights=C.getValueOrUndefined(s.minimumHeights,i,u.minimumHeights),u.maximumHeights=C.getValueOrUndefined(s.maximumHeights,i,u.maximumHeights),u.granularity=C.getValueOrUndefined(s.granularity,i),C.getValueOrDefault(s.fill,i,!0)){var v=y.getValue(i,o.fillMaterialProperty,this._material);this._material=v;var g=new m({material:v,translucent:v.isTranslucent(),closed:r(u.extrudedHeight)});u.vertexFormat=g.vertexFormat,this._primitive=n.add(new f({geometryInstances:new l({id:a,geometry:new h(u)}),appearance:g,asynchronous:!1}))}if(C.getValueOrDefault(s.outline,i,!1)){u.vertexFormat=p.VERTEX_FORMAT;var _=C.getValueOrClonedDefault(s.outlineColor,i,e.BLACK,I),E=C.getValueOrDefault(s.outlineWidth,i,1),S=1!==_.alpha;this._outlinePrimitive=n.add(new f({geometryInstances:new l({id:a,geometry:new d(u),attributes:{color:t.fromColor(_)}}),appearance:new p({flat:!0,translucent:S,renderState:{lineWidth:o._scene.clampLineWidth(E)}}),asynchronous:!1}))}}}},w.prototype.getBoundingSphere=function(e,t){return _(e,this._primitive,this._outlinePrimitive,t)},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},S}),i("DataSources/DataSourceDisplay",["../Core/BoundingSphere","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EventHelper","./BillboardVisualizer","./BoundingSphereState","./BoxGeometryUpdater","./CorridorGeometryUpdater","./CustomDataSource","./CylinderGeometryUpdater","./EllipseGeometryUpdater","./EllipsoidGeometryUpdater","./GeometryVisualizer","./LabelVisualizer","./ModelVisualizer","./PathVisualizer","./PointVisualizer","./PolygonGeometryUpdater","./PolylineGeometryUpdater","./PolylineVolumeGeometryUpdater","./RectangleGeometryUpdater","./WallGeometryUpdater"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S,w,T){"use strict";function x(e){var i=e.scene,r=e.dataSourceCollection;this._eventHelper=new a,this._eventHelper.add(r.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(r.dataSourceRemoved,this._onDataSourceRemoved,this),this._dataSourceCollection=r,this._scene=i,this._visualizersCallback=t(e.visualizersCallback,x.defaultVisualizersCallback);for(var n=0,o=r.length;o>n;n++)this._onDataSourceAdded(r,r.get(n));var s=new h;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s}x.defaultVisualizersCallback=function(e,t){var i=t.entities;return[new s(e,i),new f(u,e,i),new f(d,e,i),new f(c,e,i),new f(m,e,i),new f(p,e,i),new f(C,e,i),new f(E,e,i),new f(S,e,i),new f(w,e,i),new f(T,e,i),new v(e,i),new g(e,i),new y(e,i),new _(e,i)]},r(x.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}}}),x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){this._eventHelper.removeAll();for(var e=this._dataSourceCollection,t=0,i=e.length;i>t;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),n(this)},x.prototype.update=function(e){var t,r,n,o,a=!0,s=this._dataSourceCollection,l=s.length;for(t=0;l>t;t++){var u=s.get(t);for(i(u.update)&&(a=u.update(e)&&a),n=u._visualizers,o=n.length,r=0;o>r;r++)a=n[r].update(e)&&a}for(n=this._defaultDataSource._visualizers,o=n.length,r=0;o>r;r++)a=n[r].update(e)&&a;return a};var b=[],A=new e;return x.prototype.getBoundingSphere=function(t,r,n){var o,a,s=this._defaultDataSource;if(!s.entities.contains(t)){s=void 0;var u=this._dataSourceCollection;for(a=u.length,o=0;a>o;o++){var c=u.get(o);if(c.entities.contains(t)){s=c;break}}}if(!i(s))return l.FAILED;var h=b,d=A,m=0,p=l.DONE,f=s._visualizers,v=f.length;for(o=0;v>o;o++){var g=f[o];if(i(g.getBoundingSphere)){if(p=f[o].getBoundingSphere(t,d),!r&&p===l.PENDING)return l.PENDING;p===l.DONE&&(h[m]=e.clone(d,h[m]),m++)}}return 0===m?l.FAILED:(h.length=m,e.fromBoundingSpheres(h,n),l.DONE)},x.prototype._onDataSourceAdded=function(e,t){var i=this._visualizersCallback(this._scene,t);t._visualizers=i},x.prototype._onDataSourceRemoved=function(e,t){for(var i=t._visualizers,r=i.length,n=0;r>n;n++)i[n].destroy(),t._visualizers=void 0},x}),i("DataSources/DynamicGeometryUpdater",["../Core/DeveloperError"],function(e){"use strict";function t(){e.throwInstantiationError()}return t.prototype.update=e.throwInstantiationError,t.prototype.getBoundingSphere=e.throwInstantiationError,t.prototype.isDestroyed=e.throwInstantiationError,t.prototype.destroy=e.throwInstantiationError,t}),i("DataSources/EntityView",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/HeadingPitchRange","../Core/JulianDate","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Transforms","../Scene/SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(e,i,r,o,a,s,l){var d=e.scene.mode,f=a.getValue(s,e._lastCartesian);if(n(f)){var v,I,M,D=!1;if(d===p.SCENE3D){A=u.addSeconds(s,.001,A);var R=a.getValue(A,E);if(n(R)){var O,N=m.computeFixedToIcrfMatrix(s,g),L=m.computeFixedToIcrfMatrix(A,_);n(N)&&n(L)?O=h.transpose(N,y):(O=m.computeTemeToPseudoFixedMatrix(s,y),N=h.transpose(O,g),L=m.computeTemeToPseudoFixedMatrix(A,_),h.transpose(L,L));var F=h.multiplyByVector(N,f,x),B=h.multiplyByVector(L,R,b);t.subtract(F,B,T);var V=1e3*t.magnitude(T),k=3986004418e5,z=-k/(V*V-2*k/t.magnitude(F));0>z||z>P*l.maximumRadius?(v=S,t.normalize(f,v),t.negate(v,v),M=t.clone(t.UNIT_Z,w),I=t.cross(M,v,E),t.magnitude(I)>c.EPSILON7&&(t.normalize(v,v),t.normalize(I,I),M=t.cross(v,I,w),t.normalize(M,M),D=!0)):t.equalsEpsilon(f,R,c.EPSILON7)||(M=S,t.normalize(F,M),t.normalize(B,B),I=t.cross(M,B,w),t.equalsEpsilon(I,t.ZERO,c.EPSILON7)||(v=t.cross(I,M,E),h.multiplyByVector(O,v,v),h.multiplyByVector(O,I,I),h.multiplyByVector(O,M,M),t.normalize(v,v),t.normalize(I,I),t.normalize(M,M),D=!0))}}n(e._boundingSphereOffset)&&t.add(e._boundingSphereOffset,f,f);var U,G,W;o&&(U=t.clone(i.position,T),G=t.clone(i.direction,x),W=t.clone(i.up,b));var H=C;D?(H[0]=v.x,H[1]=v.y,H[2]=v.z,H[3]=0,H[4]=I.x,H[5]=I.y,H[6]=I.z,H[7]=0,H[8]=M.x,H[9]=M.y,H[10]=M.z,H[11]=0,H[12]=f.x,H[13]=f.y,H[14]=f.z,H[15]=0):m.eastNorthUpToFixedFrame(f,l,H),i._setTransform(H),o&&(t.clone(U,i.position),t.clone(G,i.direction),t.clone(W,i.up),t.cross(G,W,i.right))}if(r){var q=d===p.SCENE2D||t.equals(e._offset3D,t.ZERO)?void 0:e._offset3D;i.lookAtTransform(i.transform,q)}}function v(i,n,o,a){this.entity=i,this.scene=n,this.ellipsoid=r(o,s.WGS84),this.boundingSphere=e.clone(a),this._boundingSphereOffset=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new t,this._defaultOffset3D=void 0,this._offset3D=new t}var g=new h,_=new h,y=new h,C=new d,E=new t,S=new t,w=new t,T=new t,x=new t,b=new t,A=new u,P=1.25;o(v,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=t.clone(e,new t)}}}),v.defaultOffset3D=new t(-14e3,3500,3500);var I=new l,M=new t;return v.prototype.update=function(e){var i=this.scene,r=this.entity,o=this.ellipsoid,a=i.mode;if(a!==p.MORPHING){var s=r.position,l=r!==this._lastEntity,u=a!==this._mode,h=this._offset3D,d=i.camera,m=l||u,g=!0;if(l){var _=r.viewFrom,y=n(_),C=this.boundingSphere;if(this._boundingSphereOffset=void 0,!y&&n(C)){var E=i.screenSpaceCameraController;E.minimumZoomDistance=Math.min(E.minimumZoomDistance,.5*C.radius),I.pitch=-c.PI_OVER_FOUR,I.range=0;var S=s.getValue(e,M);if(n(S)){var w=2-1/Math.max(1,t.magnitude(S)/o.maximumRadius);I.pitch*=w}d.viewBoundingSphere(C,I),this._boundingSphereOffset=t.subtract(C.center,r.position.getValue(e),new t),m=!1,g=!1}else y&&n(_.getValue(e,h))||t.clone(v._defaultOffset3D,h)}else u||i.mode===p.MORPHING||this._mode===p.SCENE2D||t.clone(d.position,h);this._lastEntity=r,this._mode=i.mode!==p.MORPHING?i.mode:this._mode,i.mode!==p.MORPHING&&f(this,d,m,g,s,e,o)}},v}),!function(){function e(e,t){function i(t){var i,r=e.arcs[0>t?~t:t],n=r[0];return e.transform?(i=[0,0],r.forEach(function(e){i[0]+=e[0],i[1]+=e[1]})):i=r[r.length-1],0>t?[i,n]:[n,i]}function r(e,t){for(var i in e){var r=e[i];delete t[r.start],delete r.start,delete r.end,r.forEach(function(e){n[0>e?~e:e]=1}),s.push(r)}}var n={},o={},a={},s=[],l=-1;return t.forEach(function(i,r){var n,o=e.arcs[0>i?~i:i];o.length<3&&!o[1][0]&&!o[1][1]&&(n=t[++l],t[l]=i,t[r]=n)}),t.forEach(function(e){var t,r,n=i(e),s=n[0],l=n[1];if(t=a[s])if(delete a[t.end],t.push(e),t.end=l,r=o[l]){delete o[r.start];var u=r===t?t:t.concat(r);o[u.start=t.start]=a[u.end=r.end]=u}else o[t.start]=a[t.end]=t;else if(t=o[l])if(delete o[t.start],t.unshift(e),t.start=s,r=a[s]){delete a[r.end];var c=r===t?t:r.concat(t);o[c.start=r.start]=a[c.end=t.end]=c}else o[t.start]=a[t.end]=t;else t=[e],o[t.start=s]=a[t.end=l]=t}),r(a,o),r(o,a),t.forEach(function(e){n[0>e?~e:e]||s.push([e])}),s}function t(t,i,r){function n(e){var t=0>e?~e:e;(c[t]||(c[t]=[])).push({i:e,g:u})}function o(e){e.forEach(n)}function a(e){e.forEach(o)}function s(e){"GeometryCollection"===e.type?e.geometries.forEach(s):e.type in h&&(u=e,h[e.type](e.arcs))}var l=[];if(arguments.length>1){var u,c=[],h={LineString:o,MultiLineString:a,Polygon:a,MultiPolygon:function(e){e.forEach(a)}};s(i),c.forEach(arguments.length<3?function(e){l.push(e[0].i)}:function(e){r(e[0].g,e[e.length-1].g)&&l.push(e[0].i)})}else for(var d=0,m=t.arcs.length;m>d;++d)l.push(d);return{type:"MultiLineString",arcs:e(t,l)}}function r(t,i){function r(e){e.forEach(function(t){t.forEach(function(t){(a[t=0>t?~t:t]||(a[t]=[])).push(e)})}),l.push(e)}function o(e){return d(s(t,{type:"Polygon",arcs:[e]}).coordinates[0])>0}var a={},l=[],u=[];return i.forEach(function(e){"Polygon"===e.type?r(e.arcs):"MultiPolygon"===e.type&&e.arcs.forEach(r)}),l.forEach(function(e){if(!e._){var t=[],i=[e];for(e._=1,u.push(t);e=i.pop();)t.push(e),e.forEach(function(e){e.forEach(function(e){a[0>e?~e:e].forEach(function(e){e._||(e._=1,i.push(e))})})})}}),l.forEach(function(e){delete e._}),{type:"MultiPolygon",arcs:u.map(function(i){var r=[];if(i.forEach(function(e){e.forEach(function(e){e.forEach(function(e){a[0>e?~e:e].length<2&&r.push(e)})})}),r=e(t,r),(n=r.length)>1)for(var s,l=o(i[0][0]),u=0;u<n;++u)if(l===o(r[u])){s=r[0],r[0]=r[u],r[u]=s;break}return r})}}function o(e,t){return"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map(function(t){return a(e,t)})}:a(e,t)}function a(e,t){var i={type:"Feature",id:t.id,properties:t.properties||{},geometry:s(e,t)};return null==t.id&&delete i.id,i}function s(e,t){function i(e,t){t.length&&t.pop();for(var i,r=c[0>e?~e:e],n=0,o=r.length;o>n;++n)t.push(i=r[n].slice()),u(i,n);0>e&&l(t,o)}function r(e){return e=e.slice(),u(e,0),e}function n(e){for(var t=[],r=0,n=e.length;n>r;++r)i(e[r],t);return t.length<2&&t.push(t[0].slice()),t}function o(e){for(var t=n(e);t.length<4;)t.push(t[0].slice());return t}function a(e){return e.map(o)}function s(e){var t=e.type;return"GeometryCollection"===t?{type:t,geometries:e.geometries.map(s)}:t in h?{type:t,coordinates:h[t](e)}:null}var u=v(e.transform),c=e.arcs,h={Point:function(e){return r(e.coordinates)},MultiPoint:function(e){return e.coordinates.map(r)},LineString:function(e){return n(e.arcs)},MultiLineString:function(e){return e.arcs.map(n)},Polygon:function(e){return a(e.arcs)},MultiPolygon:function(e){return e.arcs.map(a)}};return s(t)}function l(e,t){for(var i,r=e.length,n=r-t;n<--r;)i=e[n],e[n++]=e[r],e[r]=i}function u(e,t){for(var i=0,r=e.length;r>i;){var n=i+r>>>1;e[n]<t?i=n+1:r=n}return i}function c(e){function t(e,t){e.forEach(function(e){0>e&&(e=~e);var i=n[e];i?i.push(t):n[e]=[t]})}function i(e,i){e.forEach(function(e){t(e,i)})}function r(e,t){"GeometryCollection"===e.type?e.geometries.forEach(function(e){r(e,t)}):e.type in a&&a[e.type](e.arcs,t)}var n={},o=e.map(function(){return[]}),a={LineString:t,MultiLineString:i,Polygon:i,MultiPolygon:function(e,t){e.forEach(function(e){i(e,t)})}};e.forEach(r);for(var s in n)for(var l=n[s],c=l.length,h=0;c>h;++h)for(var d=h+1;c>d;++d){var m,p=l[h],f=l[d];(m=o[p])[s=u(m,f)]!==f&&m.splice(s,0,f),(m=o[f])[s=u(m,p)]!==p&&m.splice(s,0,p)}return o}function h(e,t){function i(e){o.remove(e),e[1][2]=t(e),o.push(e)}var r=v(e.transform),n=g(e.transform),o=f();return t||(t=m),e.arcs.forEach(function(e){for(var a,s,l=[],u=0,c=0,h=e.length;h>c;++c)s=e[c],r(e[c]=[s[0],s[1],1/0],c);for(var c=1,h=e.length-1;h>c;++c)a=e.slice(c-1,c+2),a[1][2]=t(a),l.push(a),o.push(a);for(var c=0,h=l.length;h>c;++c)a=l[c],a.previous=l[c-1],a.next=l[c+1];for(;a=o.pop();){var d=a.previous,m=a.next;a[1][2]<u?a[1][2]=u:u=a[1][2],d&&(d.next=m,d[2]=a[2],i(d)),m&&(m.previous=d,m[0]=a[0],i(m))}e.forEach(n)}),e}function d(e){for(var t,i=-1,r=e.length,n=e[r-1],o=0;++i<r;)t=n,n=e[i],o+=t[0]*n[1]-t[1]*n[0];return.5*o}function m(e){var t=e[0],i=e[1],r=e[2];return Math.abs((t[0]-r[0])*(i[1]-t[1])-(t[0]-i[0])*(r[1]-t[1]))}function p(e,t){return e[1][2]-t[1][2]}function f(){function e(e,t){for(;t>0;){var i=(t+1>>1)-1,n=r[i];if(p(e,n)>=0)break;r[n._=t]=n,r[e._=t=i]=e}}function t(e,t){for(;;){var i=t+1<<1,o=i-1,a=t,s=r[a];if(n>o&&p(r[o],s)<0&&(s=r[a=o]),n>i&&p(r[i],s)<0&&(s=r[a=i]),a===t)break;r[s._=t]=s,r[e._=t=a]=e}}var i={},r=[],n=0;return i.push=function(t){return e(r[t._=n]=t,n++),n},i.pop=function(){if(!(0>=n)){var e,i=r[0];return--n>0&&(e=r[n],t(r[e._=0]=e,0)),i}},i.remove=function(i){var o,a=i._;if(r[a]===i)return a!==--n&&(o=r[n],(p(o,i)<0?e:t)(r[o._=a]=o,a)),a},i}function v(e){if(!e)return _;var t,i,r=e.scale[0],n=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=i=0),e[0]=(t+=e[0])*r+o,e[1]=(i+=e[1])*n+a}}function g(e){if(!e)return _;var t,i,r=e.scale[0],n=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=i=0);var l=(e[0]-o)/r|0,u=(e[1]-a)/n|0;e[0]=l-t,e[1]=u-i,t=l,i=u}}function _(){}var y={version:"1.6.18",mesh:function(e){return s(e,t.apply(this,arguments))},meshArcs:t,merge:function(e){return s(e,r.apply(this,arguments))},mergeArcs:r,feature:o,neighbors:c,presimplify:h};"function"==typeof i&&i.amd?i("ThirdParty/topojson",y):"object"==typeof module&&module.exports?module.exports=y:this.topojson=y}(),i("DataSources/GeoJsonDataSource",["../Core/Cartesian3","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/definedNotNull","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/getFilenameFromUri","../Core/loadJson","../Core/PinBuilder","../Core/PolygonHierarchy","../Core/RuntimeError","../Scene/VerticalOrigin","../ThirdParty/topojson","../ThirdParty/when","./BillboardGraphics","./CallbackProperty","./ColorMaterialProperty","./ConstantPositionProperty","./ConstantProperty","./DataSource","./EntityCollection","./PolygonGraphics","./PolylineGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S,w,T,x){"use strict";function b(t){return e.fromDegrees(t[0],t[1],t[2])}function A(e,t){var i="";for(var r in e)if(e.hasOwnProperty(r)){if(r===t||-1!==ae.indexOf(r))continue;var n=e[r];o(n)&&(i+="object"==typeof n?"<tr><th>"+r+"</th><td>"+A(n)+"</td></tr>":"<tr><th>"+r+"</th><td>"+n+"</td></tr>")}return i.length>0&&(i='<table class="cesium-infoBox-defaultTable"><tbody>'+i+"</tbody></table>"),i}function P(e,t,i){var r;return function(o,a){return n(r)||(r=e(t,i)),r}}function I(e,t){return new _(P(A,e,t),!0)}function M(e,t,r){var a=e.id;if(o(a)&&"Feature"===e.type){for(var s=2,l=a;n(t.getById(l));)l=a+"_"+s,s++;a=l}else a=i();var u=t.getOrCreateEntity(a),c=e.properties;if(o(c)){u.addProperty("properties"),u.properties=c;var h,d=c.title;if(o(d))u.name=d,h="title";else{var m=Number.MAX_VALUE;for(var p in c)if(c.hasOwnProperty(p)&&c[p]){var f=p.toLowerCase();if(m>1&&"title"===f){m=1,h=p;break}m>2&&"name"===f?(m=2,h=p):m>3&&/title/i.test(p)?(m=3,h=p):m>4&&/name/i.test(p)&&(m=4,h=p)}o(h)&&(u.name=c[h])}var v=c.description;n(v)?null!==v&&(u.description=new E(v)):u.description=r(c,h)}return u}function D(e,t){for(var i=new Array(e.length),r=0;r<e.length;r++)i[r]=t(e[r]);return i}function R(e,t,i,r,a){if(!n(t.geometry))throw new m("feature.geometry is required.");if(null===t.geometry)M(t,e._entityCollection,a.describe);else{var s=t.geometry.type,l=le[s];if(!o(l))throw new m("Unknown geometry type: "+s);l(e,t,t.geometry,r,a)}}function O(e,t,i,r,n){for(var o=t.features,a=0,s=o.length;s>a;a++)R(e,o[a],void 0,r,n)}function N(e,t,i,r,n){for(var a=i.geometries,s=0,l=a.length;l>s;s++){var u=a[s],c=u.type,h=le[c];if(!o(h))throw new m("Unknown geometry type: "+c);h(e,t,u,r,n)}}function L(e,i,a,s,l){var u=l.markerSymbol,c=l.markerColor,h=l.markerSize,d=i.properties;if(o(d)){var m=d["marker-color"];o(m)&&(c=t.fromCssColorString(m)),h=r(oe[d["marker-size"]],h);var f=d["marker-symbol"];o(f)&&(u=f)}var _;_=n(u)?1===u.length?e._pinBuilder.fromText(u.toUpperCase(),c,h):e._pinBuilder.fromMakiIconId(u,c,h):e._pinBuilder.fromColor(c,h),e._promises.push(v(_,function(t){var r=new g;r.verticalOrigin=new E(p.BOTTOM),r.image=new E(t);var n=M(i,e._entityCollection,l.describe);n.billboard=r,n.position=new C(a(s))}))}function F(e,t,i,r,n){L(e,t,r,i.coordinates,n)}function B(e,t,i,r,n){for(var o=i.coordinates,a=0;a<o.length;a++)L(e,t,r,o[a],n)}function V(e,i,r,a,s){ +var l=s.strokeMaterialProperty,u=s.strokeWidthProperty,c=i.properties;if(o(c)){var h=c["stroke-width"];o(h)&&(u=new E(h));var d,m=c.stroke;o(m)&&(d=t.fromCssColorString(m));var p=c["stroke-opacity"];o(p)&&1!==p&&(n(d)||(d=l.color.clone()),d.alpha=p),n(d)&&(l=new y(d))}var f=new x;f.material=l,f.width=u,f.positions=new E(D(a,r));var v=M(i,e._entityCollection,s.describe);v.polyline=f}function k(e,t,i,r,n){V(e,t,r,i.coordinates,n)}function z(e,t,i,r,n){for(var o=i.coordinates,a=0;a<o.length;a++)V(e,t,r,o[a],n)}function U(e,i,r,a,s){if(0!==a.length&&0!==a[0].length){var l=s.strokeMaterialProperty.color,u=s.fillMaterialProperty,c=s.strokeWidthProperty,h=i.properties;if(o(h)){var m=h["stroke-width"];o(m)&&(c=new E(m));var p,f=h.stroke;o(f)&&(p=t.fromCssColorString(f));var v=h["stroke-opacity"];o(v)&&1!==v&&(n(p)||(p=s.strokeMaterialProperty.color.clone()),p.alpha=v),n(p)&&(l=new E(p));var g,_=h.fill;o(_)&&(g=t.fromCssColorString(_),g.alpha=u.color.alpha),v=h["fill-opacity"],o(v)&&v!==u.color.alpha&&(n(g)||(g=u.color.clone()),g.alpha=v),n(g)&&(u=new y(g))}var C=new T;C.outline=new E(!0),C.outlineColor=l,C.outlineWidth=c,C.material=u;for(var S=[],w=1,x=a.length;x>w;w++)S.push(new d(D(a[w],r)));var b=a[0];C.hierarchy=new E(new d(D(b,r),S)),b[0].length>2&&(C.perPositionHeight=new E(!0));var A=M(i,e._entityCollection,s.describe);A.polygon=C}}function G(e,t,i,r,n){U(e,t,r,i.coordinates,n)}function W(e,t,i,r,n){for(var o=i.coordinates,a=0;a<o.length;a++)U(e,t,r,o[a],n)}function H(e,t,i,r,n){for(var o in i.objects)if(i.objects.hasOwnProperty(o)){var a=f.feature(i,i.objects[o]),s=se[a.type];s(e,a,a,r,n)}}function q(e){this._name=e,this._changed=new l,this._error=new l,this._isLoading=!1,this._loading=new l,this._entityCollection=new w(this),this._promises=[],this._pinBuilder=new h}function j(e,t,i,r){var o;n(r)&&(o=u(r)),n(o)&&e._name!==o&&(e._name=o,e._changed.raiseEvent(e));var a=se[t.type];if(!n(a))throw new m("Unsupported GeoJSON object type: "+t.type);var s=b,l=t.crs;if(n(l)){if(null===l)throw new m("crs is null.");if(!n(l.properties))throw new m("crs.properties is undefined.");var c=l.properties;if("name"===l.type){if(s=X[c.name],!n(s))throw new m("Unknown crs name: "+c.name)}else if("link"===l.type){var h=Z[c.href];if(n(h)||(h=K[c.type]),!n(h))throw new m("Unable to resolve crs link: "+JSON.stringify(c));s=h(c)}else{if("EPSG"!==l.type)throw new m("Unknown crs type: "+l.type);if(s=X["EPSG:"+c.code],!n(s))throw new m("Unknown crs EPSG code: "+c.code)}}return v(s,function(r){return e._entityCollection.removeAll(),a(e,t,t,r,i),v.all(e._promises,function(){return e._promises.length=0,S.setLoading(e,!1),e})})}var Y,X={"urn:ogc:def:crs:OGC:1.3:CRS84":b,"EPSG:4326":b},Z={},K={},Q=48,J=t.ROYALBLUE,$=t.YELLOW,ee=2,te=t.fromBytes(255,255,0,100),ie=new E(ee),re=new y($),ne=new y(te),oe={small:24,medium:48,large:64},ae=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"],se={Feature:R,FeatureCollection:O,GeometryCollection:N,LineString:k,MultiLineString:z,MultiPoint:B,MultiPolygon:W,Point:F,Polygon:G,Topology:H},le={GeometryCollection:N,LineString:k,MultiLineString:z,MultiPoint:B,MultiPolygon:W,Point:F,Polygon:G,Topology:H};return q.load=function(e,t){return(new q).load(e,t)},a(q,{markerSize:{get:function(){return Q},set:function(e){Q=e}},markerSymbol:{get:function(){return Y},set:function(e){Y=e}},markerColor:{get:function(){return J},set:function(e){J=e}},stroke:{get:function(){return $},set:function(e){$=e,re.color.setValue(e)}},strokeWidth:{get:function(){return ee},set:function(e){ee=e,ie.setValue(e)}},fill:{get:function(){return te},set:function(e){te=e,ne=new y(te)}},crsNames:{get:function(){return X}},crsLinkHrefs:{get:function(){return Z}},crsLinkTypes:{get:function(){return K}}}),a(q.prototype,{name:{get:function(){return this._name}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}}}),q.prototype.load=function(e,t){S.setLoading(this,!0);var i=e;t=r(t,r.EMPTY_OBJECT);var o=t.sourceUri;"string"==typeof e&&(n(o)||(o=e),i=c(e)),t={describe:r(t.describe,I),markerSize:r(t.markerSize,Q),markerSymbol:r(t.markerSymbol,Y),markerColor:r(t.markerColor,J),strokeWidthProperty:new E(r(t.strokeWidth,ee)),strokeMaterialProperty:new y(r(t.stroke,$)),fillMaterialProperty:new y(r(t.fill,te))};var a=this;return v(i,function(e){return j(a,e,t,o)}).otherwise(function(e){return S.setLoading(a,!1),a._error.raiseEvent(a,e),console.log(e),v.reject(e)})},q}),i("DataSources/GeometryUpdater",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function i(e,i){t.throwInstantiationError()}return e(i,{perInstanceColorAppearanceType:{get:t.throwInstantiationError},materialAppearanceType:{get:t.throwInstantiationError}}),e(i.prototype,{entity:{get:t.throwInstantiationError},fillEnabled:{get:t.throwInstantiationError},hasConstantFill:{get:t.throwInstantiationError},fillMaterialProperty:{get:t.throwInstantiationError},outlineEnabled:{get:t.throwInstantiationError},hasConstantOutline:{get:t.throwInstantiationError},outlineColorProperty:{get:t.throwInstantiationError},outlineWidth:{get:t.throwInstantiationError},isDynamic:{get:t.throwInstantiationError},isClosed:{get:t.throwInstantiationError},geometryChanged:{get:t.throwInstantiationError}}),i.prototype.isOutlineVisible=t.throwInstantiationError,i.prototype.isFilled=t.throwInstantiationError,i.prototype.createFillGeometryInstance=t.throwInstantiationError,i.prototype.createOutlineGeometryInstance=t.throwInstantiationError,i.prototype.isDestroyed=t.throwInstantiationError,i.prototype.destroy=t.throwInstantiationError,i.prototype.createDynamicUpdater=t.throwInstantiationError,i}),function(e,t){"function"==typeof i&&i.amd?i("ThirdParty/Autolinker",[],function(){return e.Autolinker=t()}):"object"==typeof exports?module.exports=t():e.Autolinker=t()}(this,function(){var e=function(t){e.Util.assign(this,t);var i=this.hashtag;if(i!==!1&&"twitter"!==i&&"facebook"!==i)throw new Error("invalid `hashtag` cfg - see docs")};return e.prototype={constructor:e,urls:!0,email:!0,twitter:!0,phone:!0,hashtag:!1,newWindow:!0,stripPrefix:!0,truncate:void 0,className:"",htmlParser:void 0,matchParser:void 0,tagBuilder:void 0,link:function(e){for(var t=this.getHtmlParser(),i=t.parse(e),r=0,n=[],o=0,a=i.length;a>o;o++){var s=i[o],l=s.getType(),u=s.getText();if("element"===l)"a"===s.getTagName()&&(s.isClosing()?r=Math.max(r-1,0):r++),n.push(u);else if("entity"===l||"comment"===l)n.push(u);else if(0===r){var c=this.linkifyStr(u);n.push(c)}else n.push(u)}return n.join("")},linkifyStr:function(e){return this.getMatchParser().replace(e,this.createMatchReturnVal,this)},createMatchReturnVal:function(t){var i;if(this.replaceFn&&(i=this.replaceFn.call(this,this,t)),"string"==typeof i)return i;if(i===!1)return t.getMatchedText();if(i instanceof e.HtmlTag)return i.toAnchorString();var r=this.getTagBuilder(),n=r.build(t);return n.toAnchorString()},getHtmlParser:function(){var t=this.htmlParser;return t||(t=this.htmlParser=new e.htmlParser.HtmlParser),t},getMatchParser:function(){var t=this.matchParser;return t||(t=this.matchParser=new e.matchParser.MatchParser({urls:this.urls,email:this.email,twitter:this.twitter,phone:this.phone,hashtag:this.hashtag,stripPrefix:this.stripPrefix})),t},getTagBuilder:function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new e.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t}},e.link=function(t,i){var r=new e(i);return r.link(t)},e.match={},e.htmlParser={},e.matchParser={},e.Util={abstractMethod:function(){throw"abstract"},trimRegex:/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,assign:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},extend:function(t,i){var r=t.prototype,n=function(){};n.prototype=r;var o;o=i.hasOwnProperty("constructor")?i.constructor:function(){r.constructor.apply(this,arguments)};var a=o.prototype=new n;return a.constructor=o,a.superclass=r,delete i.constructor,e.Util.assign(a,i),o},ellipsis:function(e,t,i){return e.length>t&&(i=null==i?"..":i,e=e.substring(0,t-i.length)+i),e},indexOf:function(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var i=0,r=e.length;r>i;i++)if(e[i]===t)return i;return-1},splitAndCapture:function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var i,r=[],n=0;i=t.exec(e);)r.push(e.substring(n,i.index)),r.push(i[0]),n=i.index+i[0].length;return r.push(e.substring(n)),r},trim:function(e){return e.replace(this.trimRegex,"")}},e.HtmlTag=e.Util.extend(Object,{whitespaceRegex:/\s+/,constructor:function(t){e.Util.assign(this,t),this.innerHtml=this.innerHtml||this.innerHTML},setTagName:function(e){return this.tagName=e,this},getTagName:function(){return this.tagName||""},setAttr:function(e,t){var i=this.getAttrs();return i[e]=t,this},getAttr:function(e){return this.getAttrs()[e]},setAttrs:function(t){var i=this.getAttrs();return e.Util.assign(i,t),this},getAttrs:function(){return this.attrs||(this.attrs={})},setClass:function(e){return this.setAttr("class",e)},addClass:function(t){for(var i,r=this.getClass(),n=this.whitespaceRegex,o=e.Util.indexOf,a=r?r.split(n):[],s=t.split(n);i=s.shift();)-1===o(a,i)&&a.push(i);return this.getAttrs()["class"]=a.join(" "),this},removeClass:function(t){for(var i,r=this.getClass(),n=this.whitespaceRegex,o=e.Util.indexOf,a=r?r.split(n):[],s=t.split(n);a.length&&(i=s.shift());){var l=o(a,i);-1!==l&&a.splice(l,1)}return this.getAttrs()["class"]=a.join(" "),this},getClass:function(){return this.getAttrs()["class"]||""},hasClass:function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},setInnerHtml:function(e){return this.innerHtml=e,this},getInnerHtml:function(){return this.innerHtml||""},toAnchorString:function(){var e=this.getTagName(),t=this.buildAttrsStr();return t=t?" "+t:"",["<",e,t,">",this.getInnerHtml(),"</",e,">"].join("")},buildAttrsStr:function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var i in e)e.hasOwnProperty(i)&&t.push(i+'="'+e[i]+'"');return t.join(" ")}}),e.AnchorTagBuilder=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},build:function(t){var i=new e.HtmlTag({tagName:"a",attrs:this.createAttrs(t.getType(),t.getAnchorHref()),innerHtml:this.processAnchorText(t.getAnchorText())});return i},createAttrs:function(e,t){var i={href:t},r=this.createCssClass(e);return r&&(i["class"]=r),this.newWindow&&(i.target="_blank"),i},createCssClass:function(e){var t=this.className;return t?t+" "+t+"-"+e:""},processAnchorText:function(e){return e=this.doTruncate(e)},doTruncate:function(t){return e.Util.ellipsis(t,this.truncate||Number.POSITIVE_INFINITY)}}),e.htmlParser.HtmlParser=e.Util.extend(Object,{htmlRegex:function(){var e=/!--([\s\S]+?)--/,t=/[0-9a-zA-Z][0-9a-zA-Z:]*/,i=/[^\s\0"'>\/=\x01-\x1F\x7F]+/,r=/(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/,n=i.source+"(?:\\s*=\\s*"+r.source+")?";return new RegExp(["(?:","<(!DOCTYPE)","(?:","\\s+","(?:",n,"|",r.source+")",")*",">",")","|","(?:","<(/)?","(?:",e.source,"|","(?:","("+t.source+")","(?:","\\s+",n,")*","\\s*/?",")",")",">",")"].join(""),"gi")}(),htmlCharacterEntitiesRegex:/( | |<|<|>|>|"|"|')/gi,parse:function(e){for(var t,i,r=this.htmlRegex,n=0,o=[];null!==(t=r.exec(e));){var a=t[0],s=t[3],l=t[1]||t[4],u=!!t[2],c=e.substring(n,t.index);c&&(i=this.parseTextAndEntityNodes(c),o.push.apply(o,i)),s?o.push(this.createCommentNode(a,s)):o.push(this.createElementNode(a,l,u)),n=t.index+a.length}if(n<e.length){var h=e.substring(n);h&&(i=this.parseTextAndEntityNodes(h),o.push.apply(o,i))}return o},parseTextAndEntityNodes:function(t){for(var i=[],r=e.Util.splitAndCapture(t,this.htmlCharacterEntitiesRegex),n=0,o=r.length;o>n;n+=2){var a=r[n],s=r[n+1];a&&i.push(this.createTextNode(a)),s&&i.push(this.createEntityNode(s))}return i},createCommentNode:function(t,i){return new e.htmlParser.CommentNode({text:t,comment:e.Util.trim(i)})},createElementNode:function(t,i,r){return new e.htmlParser.ElementNode({text:t,tagName:i.toLowerCase(),closing:r})},createEntityNode:function(t){return new e.htmlParser.EntityNode({text:t})},createTextNode:function(t){return new e.htmlParser.TextNode({text:t})}}),e.htmlParser.HtmlNode=e.Util.extend(Object,{text:"",constructor:function(t){e.Util.assign(this,t)},getType:e.Util.abstractMethod,getText:function(){return this.text}}),e.htmlParser.CommentNode=e.Util.extend(e.htmlParser.HtmlNode,{comment:"",getType:function(){return"comment"},getComment:function(){return this.comment}}),e.htmlParser.ElementNode=e.Util.extend(e.htmlParser.HtmlNode,{tagName:"",closing:!1,getType:function(){return"element"},getTagName:function(){return this.tagName},isClosing:function(){return this.closing}}),e.htmlParser.EntityNode=e.Util.extend(e.htmlParser.HtmlNode,{getType:function(){return"entity"}}),e.htmlParser.TextNode=e.Util.extend(e.htmlParser.HtmlNode,{getType:function(){return"text"}}),e.matchParser.MatchParser=e.Util.extend(Object,{urls:!0,email:!0,twitter:!0,phone:!0,hashtag:!1,stripPrefix:!0,matcherRegex:function(){var e=/(^|[^\w])@(\w{1,15})/,t=/(^|[^\w])#(\w{1,15})/,i=/(?:[\-;:&=\+\$,\w\.]+@)/,r=/(?:\+?\d{1,3}[-\s.])?\(?\d{3}\)?[-\s.]?\d{3}[-\s.]\d{4}/,n=/(?:[A-Za-z][-.+A-Za-z0-9]+:(?![A-Za-z][-.+A-Za-z0-9]+:\/\/)(?!\d+\/?)(?:\/\/)?)/,o=/(?:www\.)/,a=/[A-Za-z0-9\.\-]*[A-Za-z0-9\-]/,s=/\.(?:international|construction|contractors|enterprises|photography|productions|foundation|immobilien|industries|management|properties|technology|christmas|community|directory|education|equipment|institute|marketing|solutions|vacations|bargains|boutique|builders|catering|cleaning|clothing|computer|democrat|diamonds|graphics|holdings|lighting|partners|plumbing|supplies|training|ventures|academy|careers|company|cruises|domains|exposed|flights|florist|gallery|guitars|holiday|kitchen|neustar|okinawa|recipes|rentals|reviews|shiksha|singles|support|systems|agency|berlin|camera|center|coffee|condos|dating|estate|events|expert|futbol|kaufen|luxury|maison|monash|museum|nagoya|photos|repair|report|social|supply|tattoo|tienda|travel|viajes|villas|vision|voting|voyage|actor|build|cards|cheap|codes|dance|email|glass|house|mango|ninja|parts|photo|shoes|solar|today|tokyo|tools|watch|works|aero|arpa|asia|best|bike|blue|buzz|camp|club|cool|coop|farm|fish|gift|guru|info|jobs|kiwi|kred|land|limo|link|menu|mobi|moda|name|pics|pink|post|qpon|rich|ruhr|sexy|tips|vote|voto|wang|wien|wiki|zone|bar|bid|biz|cab|cat|ceo|com|edu|gov|int|kim|mil|net|onl|org|pro|pub|red|tel|uno|wed|xxx|xyz|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw)\b/,l=/[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]?!:,.;]*[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]]/;return new RegExp(["(",e.source,")","|","(",i.source,a.source,s.source,")","|","(","(?:","(",n.source,a.source,")","|","(?:","(.?//)?",o.source,a.source,")","|","(?:","(.?//)?",a.source,s.source,")",")","(?:"+l.source+")?",")","|","(",r.source,")","|","(",t.source,")"].join(""),"gi")}(),charBeforeProtocolRelMatchRegex:/^(.)?\/\//,constructor:function(t){e.Util.assign(this,t),this.matchValidator=new e.MatchValidator},replace:function(e,t,i){var r=this;return e.replace(this.matcherRegex,function(e,n,o,a,s,l,u,c,h,d,m,p,f){var v=r.processCandidateMatch(e,n,o,a,s,l,u,c,h,d,m,p,f);if(v){var g=t.call(i,v.match);return v.prefixStr+g+v.suffixStr}return e})},processCandidateMatch:function(t,i,r,n,o,a,s,l,u,c,h,d,m){var p,f=l||u,v="",g="";if(a&&!this.urls||o&&!this.email||c&&!this.phone||i&&!this.twitter||h&&!this.hashtag||!this.matchValidator.isValidMatch(a,s,f))return null;if(this.matchHasUnbalancedClosingParen(t)&&(t=t.substr(0,t.length-1),g=")"),o)p=new e.match.Email({matchedText:t,email:o});else if(i)r&&(v=r,t=t.slice(1)),p=new e.match.Twitter({matchedText:t,twitterHandle:n});else if(c){var _=t.replace(/\D/g,"");p=new e.match.Phone({matchedText:t,number:_})}else if(h)d&&(v=d,t=t.slice(1)),p=new e.match.Hashtag({matchedText:t,serviceName:this.hashtag,hashtag:m});else{if(f){var y=f.match(this.charBeforeProtocolRelMatchRegex)[1]||"";y&&(v=y,t=t.slice(1))}p=new e.match.Url({matchedText:t,url:t,protocolUrlMatch:!!s,protocolRelativeMatch:!!f,stripPrefix:this.stripPrefix})}return{prefixStr:v,suffixStr:g,match:p}},matchHasUnbalancedClosingParen:function(e){var t=e.charAt(e.length-1);if(")"===t){var i=e.match(/\(/g),r=e.match(/\)/g),n=i&&i.length||0,o=r&&r.length||0;if(o>n)return!0}return!1}}),e.MatchValidator=e.Util.extend(Object,{invalidProtocolRelMatchRegex:/^[\w]\/\//,hasFullProtocolRegex:/^[A-Za-z][-.+A-Za-z0-9]+:\/\//,uriSchemeRegex:/^[A-Za-z][-.+A-Za-z0-9]+:/,hasWordCharAfterProtocolRegex:/:[^\s]*?[A-Za-z]/,isValidMatch:function(e,t,i){return t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)||this.isInvalidProtocolRelativeMatch(i)?!1:!0},isValidUriScheme:function(e){var t=e.match(this.uriSchemeRegex)[0].toLowerCase();return"javascript:"!==t&&"vbscript:"!==t},urlMatchDoesNotHaveProtocolOrDot:function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||-1!==e.indexOf("."))},urlMatchDoesNotHaveAtLeastOneWordChar:function(e,t){return e&&t?!this.hasWordCharAfterProtocolRegex.test(e):!1},isInvalidProtocolRelativeMatch:function(e){return!!e&&this.invalidProtocolRelMatchRegex.test(e)}}),e.match.Match=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},getType:e.Util.abstractMethod,getMatchedText:function(){return this.matchedText},getAnchorHref:e.Util.abstractMethod,getAnchorText:e.Util.abstractMethod}),e.match.Email=e.Util.extend(e.match.Match,{getType:function(){return"email"},getEmail:function(){return this.email},getAnchorHref:function(){return"mailto:"+this.email},getAnchorText:function(){return this.email}}),e.match.Hashtag=e.Util.extend(e.match.Match,{getType:function(){return"hashtag"},getHashtag:function(){return this.hashtag},getAnchorHref:function(){var e=this.serviceName,t=this.hashtag;switch(e){case"twitter":return"https://twitter.com/hashtag/"+t;case"facebook":return"https://www.facebook.com/hashtag/"+t;default:throw new Error("Unknown service name to point hashtag to: ",e)}},getAnchorText:function(){return"#"+this.hashtag}}),e.match.Phone=e.Util.extend(e.match.Match,{getType:function(){return"phone"},getNumber:function(){return this.number},getAnchorHref:function(){return"tel:"+this.number},getAnchorText:function(){return this.matchedText}}),e.match.Twitter=e.Util.extend(e.match.Match,{getType:function(){return"twitter"},getTwitterHandle:function(){return this.twitterHandle},getAnchorHref:function(){return"https://twitter.com/"+this.twitterHandle},getAnchorText:function(){return"@"+this.twitterHandle}}),e.match.Url=e.Util.extend(e.match.Match,{urlPrefixRegex:/^(https?:\/\/)?(www\.)?/i,protocolRelativeRegex:/^\/\//,protocolPrepended:!1,getType:function(){return"url"},getUrl:function(){var e=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(e=this.url="http://"+e,this.protocolPrepended=!0),e},getAnchorHref:function(){var e=this.getUrl();return e.replace(/&/g,"&")},getAnchorText:function(){var e=this.getUrl();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix&&(e=this.stripUrlPrefix(e)),e=this.removeTrailingSlash(e)},stripUrlPrefix:function(e){return e.replace(this.urlPrefixRegex,"")},stripProtocolRelativePrefix:function(e){return e.replace(this.protocolRelativeRegex,"")},removeTrailingSlash:function(e){return"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e}}),e}),i("ThirdParty/zip",["../Core/buildModuleUrl","../Core/defineProperties"],function(e,t){var i={};return function(i){function r(){var e=-1,t=this;t.append=function(i){var r,n=t.table;for(r=0;r<i.length;r++)e=e>>>8^n[255&(e^i[r])]},t.get=function(){return~e}}function n(e,t,i){return e.slice?e.slice(t,t+i):e.webkitSlice?e.webkitSlice(t,t+i):e.mozSlice?e.mozSlice(t,t+i):e.msSlice?e.msSlice(t,t+i):void 0}function o(e,t){var i,r;return i=new ArrayBuffer(e),r=new Uint8Array(i),t&&r.set(t,0),{buffer:i,array:r,view:new DataView(i)}}function a(){}function s(e){function t(t,i){var o=new Blob([e],{type:z});r=new u(o),r.init(function(){n.size=r.size,t()},i)}function i(e,t,i,n){r.readUint8Array(e,t,i,n)}var r,n=this;n.size=0,n.init=t,n.readUint8Array=i}function l(e){function t(t){for(var i=e.length;"="==e.charAt(i-1);)i--;r=e.indexOf(",")+1,n.size=Math.floor(.75*(i-r)),t()}function i(t,i,n){var a,s=o(i),l=4*Math.floor(t/3),u=4*Math.ceil((t+i)/3),c=window.atob(e.substring(l+r,u+r)),h=t-3*Math.floor(l/4);for(a=h;h+i>a;a++)s.array[a-h]=c.charCodeAt(a);n(s.array)}var r,n=this;n.size=0,n.init=t,n.readUint8Array=i}function u(e){function t(t){this.size=e.size,t()}function i(t,i,r,o){var a=new FileReader;a.onload=function(e){r(new Uint8Array(e.target.result))},a.onerror=o,a.readAsArrayBuffer(n(e,t,i))}var r=this;r.size=0,r.init=t,r.readUint8Array=i}function c(){}function h(e){function t(e){n=new Blob([],{type:z}),e()}function i(e,t){n=new Blob([n,P?e:e.buffer],{type:z}),t()}function r(t,i){var r=new FileReader;r.onload=function(e){t(e.target.result)},r.onerror=i,r.readAsText(n,e)}var n,o=this;o.init=t,o.writeUint8Array=i,o.getData=r}function d(e){function t(t){o+="data:"+(e||"")+";base64,",t()}function i(e,t){var i,r=a.length,n=a;for(a="",i=0;i<3*Math.floor((r+e.length)/3)-r;i++)n+=String.fromCharCode(e[i]);for(;i<e.length;i++)a+=String.fromCharCode(e[i]);n.length>2?o+=window.btoa(n):a=n,t()}function r(e){e(o+window.btoa(a))}var n=this,o="",a="";n.init=t,n.writeUint8Array=i,n.getData=r}function m(e){function t(t){n=new Blob([],{type:e}),t()}function i(t,i){n=new Blob([n,P?t:t.buffer],{type:e}),i()}function r(e){e(n)}var n,o=this;o.init=t,o.writeUint8Array=i,o.getData=r}function p(e,t,i,r,n,o,a,s,l,u){function c(){e.removeEventListener(U,h,!1),s(p)}function h(e){var t=e.data,r=t.data;t.onappend&&(p+=r.length,i.writeUint8Array(r,function(){o(!1,r),d()},u)),t.onflush&&(r?(p+=r.length,i.writeUint8Array(r,function(){o(!1,r),c()},u)):c()),t.progress&&a&&a(m+t.current,n)}function d(){m=f*B,n>m?t.readUint8Array(r+m,Math.min(B,n-m),function(t){e.postMessage({append:!0,data:t}),f++,a&&a(m,n),o(!0,t)},l):e.postMessage({flush:!0})}var m,p,f=0;p=0,e.addEventListener(U,h,!1),d()}function f(e,t,i,r,n,o,a,s,l,u){function c(){var p;h=d*B,n>h?t.readUint8Array(r+h,Math.min(B,n-h),function(t){var s=e.append(t,function(){a&&a(r+h,n)});m+=s.length,o(!0,t),i.writeUint8Array(s,function(){o(!1,s),d++,setTimeout(c,1)},u),a&&a(h,n)},l):(p=e.flush(),p?(m+=p.length,i.writeUint8Array(p,function(){o(!1,p),s(m)},u)):s(m))}var h,d=0,m=0;c()}function v(e,t,n,o,a,s,l,u,c){function h(e,t){a&&!e&&v.append(t)}function d(e){s(e,v.get())}var m,v=new r;return i.zip.useWebWorkers?(m=new Worker(i.zip.workerScriptsPath+V),p(m,e,t,n,o,h,l,d,u,c)):f(new i.zip.Inflater,e,t,n,o,h,l,d,u,c),m}function g(e,t,n,o,a,s,l){function u(e,t){e&&m.append(t)}function c(e){o(e,m.get())}function h(){d.removeEventListener(U,h,!1),p(d,e,t,0,e.size,u,a,c,s,l)}var d,m=new r;return i.zip.useWebWorkers?(d=new Worker(i.zip.workerScriptsPath+k),d.addEventListener(U,h,!1),d.postMessage({init:!0,level:n})):f(new i.zip.Deflater,e,t,0,e.size,u,a,c,s,l),d}function _(e,t,i,n,o,a,s,l,u){function c(){var r=h*B;n>r?e.readUint8Array(i+r,Math.min(B,n-r),function(e){o&&d.append(e),s&&s(r,n,e),t.writeUint8Array(e,function(){h++,c()},u)},l):a(n,d.get())}var h=0,d=new r;c()}function y(e){var t,i,r="",n=["Ç","ü","é","â","ä","à","å","ç","ê","ë","è","ï","î","ì","Ä","Å","É","æ","Æ","ô","ö","ò","û","ù","ÿ","Ö","Ü","ø","£","Ø","×","ƒ","á","í","ó","ú","ñ","Ñ","ª","º","¿","®","¬","½","¼","¡","«","»","_","_","_","¦","¦","Á","Â","À","©","¦","¦","+","+","¢","¥","+","+","-","-","+","-","+","ã","Ã","+","+","-","-","¦","-","+","¤","ð","Ð","Ê","Ë","È","i","Í","Î","Ï","+","+","_","_","¦","Ì","_","Ó","ß","Ô","Ò","õ","Õ","µ","þ","Þ","Ú","Û","Ù","ý","Ý","¯","´","­","±","_","¾","¶","§","÷","¸","°","¨","·","¹","³","²","_"," "];for(t=0;t<e.length;t++)i=255&e.charCodeAt(t),r+=i>127?n[i-128]:String.fromCharCode(i);return r}function C(e){return decodeURIComponent(escape(e))}function E(e){var t,i="";for(t=0;t<e.length;t++)i+=String.fromCharCode(e[t]);return i}function S(e){var t=(4294901760&e)>>16,i=65535&e;try{return new Date(1980+((65024&t)>>9),((480&t)>>5)-1,31&t,(63488&i)>>11,(2016&i)>>5,2*(31&i),0)}catch(r){}}function w(e,t,i,r,n){return e.version=t.view.getUint16(i,!0),e.bitFlag=t.view.getUint16(i+2,!0),e.compressionMethod=t.view.getUint16(i+4,!0),e.lastModDateRaw=t.view.getUint32(i+6,!0),e.lastModDate=S(e.lastModDateRaw),1===(1&e.bitFlag)?void n(M):((r||8!=(8&e.bitFlag))&&(e.crc32=t.view.getUint32(i+10,!0),e.compressedSize=t.view.getUint32(i+14,!0),e.uncompressedSize=t.view.getUint32(i+18,!0)),4294967295===e.compressedSize||4294967295===e.uncompressedSize?void n(D):(e.filenameLength=t.view.getUint16(i+22,!0),void(e.extraFieldLength=t.view.getUint16(i+24,!0))))}function T(e,t){function i(){}function r(i,n){e.readUint8Array(e.size-i,i,function(e){var t=o(e.length,e).view;1347093766!=t.getUint32(0)?r(i+1,n):n(t)},function(){t(R)})}return i.prototype.getData=function(i,r,n,a){function s(e,t){d&&d.terminate(),d=null,e&&e(t)}function l(e){var t=o(4);return t.view.setUint32(0,e),m.crc32==t.view.getUint32(0)}function u(e,t){a&&!l(t)?c():i.getData(function(e){s(r,e)})}function c(){s(t,L)}function h(){s(t,N)}var d,m=this;e.readUint8Array(m.offset,30,function(r){var s,l=o(r.length,r);return 1347093252!=l.view.getUint32(0)?void t(I):(w(m,l,4,!1,t),s=m.offset+30+m.filenameLength+m.extraFieldLength,void i.init(function(){0===m.compressionMethod?_(e,i,s,m.compressedSize,a,u,n,c,h):d=v(e,i,s,m.compressedSize,a,u,n,c,h)},h))},c)},{getEntries:function(n){return e.size<22?void t(I):void r(22,function(r){var a,s;a=r.getUint32(16,!0),s=r.getUint16(8,!0),e.readUint8Array(a,e.size-a,function(e){var r,a,l,u,c=0,h=[],d=o(e.length,e);for(r=0;s>r;r++){if(a=new i,1347092738!=d.view.getUint32(c))return void t(I);w(a,d,c+6,!0,t),a.commentLength=d.view.getUint16(c+32,!0),a.directory=16==(16&d.view.getUint8(c+38)),a.offset=d.view.getUint32(c+42,!0),l=E(d.array.subarray(c+46,c+46+a.filenameLength)),a.filename=2048===(2048&a.bitFlag)?C(l):y(l),a.directory||"/"!=a.filename.charAt(a.filename.length-1)||(a.directory=!0),u=E(d.array.subarray(c+46+a.filenameLength+a.extraFieldLength,c+46+a.filenameLength+a.extraFieldLength+a.commentLength)),a.comment=2048===(2048&a.bitFlag)?C(u):y(u),h.push(a),c+=46+a.filenameLength+a.extraFieldLength+a.commentLength}n(h)},function(){t(R)})})},close:function(e){e&&e()}}}function x(e){return unescape(encodeURIComponent(e))}function b(e){var t,i=[];for(t=0;t<e.length;t++)i.push(e.charCodeAt(t));return i}function A(e,t,i){function r(e,t){s&&s.terminate(),s=null,e&&e(t)}function n(){r(t,O)}function a(){r(t,L)}var s,l={},u=[],c=0;return{add:function(h,d,m,p,f){function v(t){var r;w=f.lastModDate||new Date,E=o(26),l[h]={headerArray:E.array,directory:f.directory,filename:S,offset:c,comment:b(x(f.comment||""))},E.view.setUint32(0,335546376),f.version&&E.view.setUint8(0,f.version),i||0===f.level||f.directory||E.view.setUint16(4,2048),E.view.setUint16(6,(w.getHours()<<6|w.getMinutes())<<5|w.getSeconds()/2,!0),E.view.setUint16(8,(w.getFullYear()-1980<<4|w.getMonth()+1)<<5|w.getDate(),!0),E.view.setUint16(22,S.length,!0),r=o(30+S.length),r.view.setUint32(0,1347093252),r.array.set(E.array,4),r.array.set(S,30),c+=r.array.length,e.writeUint8Array(r.array,t,n)}function y(t,i){var a=o(16);c+=t||0,a.view.setUint32(0,1347094280),"undefined"!=typeof i&&(E.view.setUint32(10,i,!0),a.view.setUint32(4,i,!0)),d&&(a.view.setUint32(8,t,!0),E.view.setUint32(14,t,!0),a.view.setUint32(12,d.size,!0),E.view.setUint32(18,d.size,!0)),e.writeUint8Array(a.array,function(){c+=16,r(m)},n)}function C(){return f=f||{},h=h.trim(),f.directory&&"/"!=h.charAt(h.length-1)&&(h+="/"),l.hasOwnProperty(h)?void t(F):(S=b(x(h)),u.push(h),void v(function(){d?i||0===f.level?_(d,e,0,d.size,!0,y,p,a,n):s=g(d,e,f.level,y,p,a,n):y()},n))}var E,S,w;d?d.init(C,a):C()},close:function(t){var i,a,s,h=0,d=0;for(a=0;a<u.length;a++)s=l[u[a]],h+=46+s.filename.length+s.comment.length;for(i=o(h+22),a=0;a<u.length;a++)s=l[u[a]],i.view.setUint32(d,1347092738),i.view.setUint16(d+4,5120),i.array.set(s.headerArray,d+6),i.view.setUint16(d+32,s.comment.length,!0),s.directory&&i.view.setUint8(d+38,16),i.view.setUint32(d+42,s.offset,!0),i.array.set(s.filename,d+46),i.array.set(s.comment,d+46+s.filename.length),d+=46+s.filename.length+s.comment.length;i.view.setUint32(d,1347093766),i.view.setUint16(d+8,u.length,!0),i.view.setUint16(d+10,u.length,!0),i.view.setUint32(d+12,h,!0),i.view.setUint32(d+16,c,!0),e.writeUint8Array(i.array,function(){r(function(){e.getData(t)})},n)}}}var P,I="File format is not recognized.",M="File contains encrypted entry.",D="File is using Zip64 (4gb+ file size).",R="Error while reading zip file.",O="Error while writing zip file.",N="Error while writing file data.",L="Error while reading file data.",F="File already exists.",B=524288,V="inflate.js",k="deflate.js",z="text/plain",U="message";try{P=0===new Blob([new DataView(new ArrayBuffer(0))]).size}catch(G){}r.prototype.table=function(){var e,t,i,r=[];for(e=0;256>e;e++){for(i=e,t=0;8>t;t++)1&i?i=i>>>1^3988292384:i>>>=1;r[e]=i}return r}(),s.prototype=new a,s.prototype.constructor=s,l.prototype=new a,l.prototype.constructor=l,u.prototype=new a,u.prototype.constructor=u,c.prototype.getData=function(e){e(this.data)},h.prototype=new c,h.prototype.constructor=h,d.prototype=new c,d.prototype.constructor=d,m.prototype=new c,m.prototype.constructor=m,i.zip={Reader:a,Writer:c,BlobReader:u,Data64URIReader:l,TextReader:s,BlobWriter:m,Data64URIWriter:d,TextWriter:h,createReader:function(e,t,i){e.init(function(){t(T(e,i))},i)},createWriter:function(e,t,i,r){e.init(function(){t(A(e,i,r))},i)},useWebWorkers:!0};var W;t(i.zip,{workerScriptsPath:{get:function(){return"undefined"==typeof W&&(W=e("ThirdParty/Workers/")),W}}})}(i),i.zip}),i("DataSources/KmlDataSource",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/ClockRange","../Core/ClockStep","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/definedNotNull","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/getAbsoluteUri","../Core/getExtensionFromUri","../Core/getFilenameFromUri","../Core/Iso8601","../Core/JulianDate","../Core/loadBlob","../Core/loadXML","../Core/Math","../Core/NearFarScalar","../Core/PinBuilder","../Core/PolygonHierarchy","../Core/Rectangle","../Core/RuntimeError","../Core/TimeInterval","../Core/TimeIntervalCollection","../Scene/HorizontalOrigin","../Scene/LabelStyle","../ThirdParty/Autolinker","../ThirdParty/Uri","../ThirdParty/when","../ThirdParty/zip","./BillboardGraphics","./CompositePositionProperty","./ConstantPositionProperty","./DataSource","./DataSourceClock","./Entity","./EntityCollection","./LabelGraphics","./PathGraphics","./PolygonGraphics","./PolylineGraphics","./PositionPropertyArray","./RectangleGraphics","./ReferenceProperty","./SampledPositionProperty","./ScaledPositionProperty","./TimeIntervalCollectionProperty","./WallGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O,N,L,F,B,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J){ +"use strict";function $(e){var t=e.slice(0,Math.min(4,e.size)),i=O.defer(),r=new FileReader;return r.addEventListener("load",function(){i.resolve(1347093252===new DataView(r.result).getUint32(0,!1))}),r.addEventListener("error",function(){i.reject(r.error)}),r.readAsArrayBuffer(t),i.promise}function ee(e){var t=O.defer(),i=new FileReader;return i.addEventListener("load",function(){t.resolve(i.result)}),i.addEventListener("error",function(){t.reject(i.error)}),i.readAsText(e),t.promise}function te(e,t,i,r){t.getData(new N.TextWriter,function(e){i.kml=rt.parseFromString(e,"application/xml"),r.resolve()})}function ie(e,t,i,r){var n=s(it.detectFromFilename(t.filename),"application/octet-stream");t.getData(new N.Data64URIWriter(n),function(e){i[t.filename]=e,r.resolve()})}function re(e,t,i,r){for(var n=r.keys,o=new R("."),a=e.querySelectorAll(t),s=0;s<a.length;s++){var l=a[s],u=l.getAttribute(i),c=new R(u).resolve(o).toString(),h=n.indexOf(c);if(-1!==h){var d=n[h];l.setAttribute(i,r[d]),"a"===t&&null===l.getAttribute("download")&&l.setAttribute("download",d)}}}function ne(e,t){return l(t)&&new R(e).isAbsolute()&&(e=t.getURL(e)),e}function oe(e,t){var i=ce(e,"id");i=l(i)?i:a();var r=t.getOrCreateEntity(i);return l(r.kml)||(r.addProperty("kml"),r.kml=new tt),r}function ae(e,t){return"absolute"===e||"relativeToGround"===e||"relativeToSeaFloor"===t}function se(e){if(!l(e))return i.fromDegrees(0,0,0);var t=e.match(/[^\s,\n]+/g);if(!u(t))return i.fromDegrees(0,0,0);var r=parseFloat(t[0]),n=parseFloat(t[1]),o=parseFloat(t[2]);return r=isNaN(r)?0:r,n=isNaN(n)?0:n,o=isNaN(o)?0:o,i.fromDegrees(r,n,o)}function le(e){if(l(e)){var t=e.textContent.match(/[^\s\n]+/g);if(u(t)){for(var i=t.length,r=new Array(i),n=0,o=0;i>o;o++)r[n++]=se(t[o]);return r}}}function ue(e,t){if(l(e)){var i=e.getAttribute(t);if(null!==i){var r=parseFloat(i);return isNaN(r)?void 0:r}}}function ce(e,t){if(l(e)){var i=e.getAttribute(t);return null!==i?i:void 0}}function he(e,t,i){if(l(e))for(var r=e.childNodes,n=r.length,o=0;n>o;o++){var a=r[o];if(a.localName===t&&-1!==i.indexOf(a.namespaceURI))return a}}function de(e,t,i){if(l(e)){for(var r=[],n=e.getElementsByTagName(t),o=n.length,a=0;o>a;a++){var s=n[a];s.localName===t&&-1!==i.indexOf(s.namespaceURI)&&r.push(s)}return r}}function me(e,t,i){if(!l(e))return[];for(var r=[],n=e.childNodes,o=n.length,a=0;o>a;a++){var s=n[a];s.localName===t&&-1!==i.indexOf(s.namespaceURI)&&r.push(s)}return r}function pe(e,t,i){var r=he(e,t,i);if(l(r)){var n=parseFloat(r.textContent);return isNaN(n)?void 0:n}}function fe(e,t,i){var r=he(e,t,i);return l(r)?r.textContent.trim():void 0}function ve(e,t,i){var r=he(e,t,i);if(l(r)){var n=r.textContent.trim();return"1"===n||/^true$/i.test(n)}}function ge(e,t,i,r){if(l(e)){var n=!1;if(l(r)){var o=r[e];l(o)&&(n=!0,e=o)}return!n&&l(i)&&(e=p(e,p(i)),e=ne(e,t)),e}}function _e(e,t){if(l(e)){"#"===e[0]&&(e=e.substring(1));var i=parseInt(e.substring(0,2),16)/255,r=parseInt(e.substring(2,4),16)/255,n=parseInt(e.substring(4,6),16)/255,a=parseInt(e.substring(6,8),16)/255;return t?(a>0?ct.maximumRed=a:ct.red=0,n>0?ct.maximumGreen=n:ct.green=0,r>0?ct.maximumBlue=r:ct.blue=0,ct.alpha=i,o.fromRandom(ct)):new o(a,n,r,i)}}function ye(e,t,i){var r=fe(e,t,i);if(l(r))return _e(r,"random"===fe(e,"colorMode",i))}function Ce(e){var t=he(e,"TimeStamp",ut.kmlgx),i=fe(t,"when",ut.kmlgx);if(l(t)&&l(i)&&0!==i.length){var r=_.fromIso8601(i),n=new P;return n.addInterval(new A({start:r,stop:g.MAXIMUM_VALUE})),n}}function Ee(e){var t=he(e,"TimeSpan",ut.kmlgx);if(l(t)){var i,r=he(t,"begin",ut.kmlgx),n=l(r)?_.fromIso8601(r.textContent):void 0,o=he(t,"end",ut.kmlgx),a=l(o)?_.fromIso8601(o.textContent):void 0;if(l(n)&&l(a)){if(_.lessThan(a,n)){var s=n;n=a,a=s}i=new P,i.addInterval(new A({start:n,stop:a}))}else l(n)?(i=new P,i.addInterval(new A({start:n,stop:g.MAXIMUM_VALUE}))):l(a)&&(i=new P,i.addInterval(new A({start:g.MINIMUM_VALUE,stop:a})));return i}}function Se(){var e=new L;return e.width=ot,e.height=ot,e.scaleByDistance=new S(2414016,1,16093e3,.1),e}function we(){var e=new H;return e.outline=!0,e.outlineColor=o.WHITE,e}function Te(){var e=new G;return e.translucencyByDistance=new S(3e6,1,5e6,0),e.pixelOffset=new t(17,0),e.horizontalOrigin=I.LEFT,e.font="16px sans-serif",e.style=M.FILL_AND_OUTLINE,e}function xe(r,n,o,a,u){var c=pe(n,"scale",ut.kml),h=pe(n,"heading",ut.kml),d=ye(n,"color",ut.kml),m=he(n,"Icon",ut.kml),p=fe(m,"href",ut.kml),f=ge(p,r._proxy,a,u),v=pe(m,"x",ut.gx),g=pe(m,"y",ut.gx),_=pe(m,"w",ut.gx),y=pe(m,"h",ut.gx),C=he(n,"hotSpot",ut.kml),S=ue(C,"x"),w=ue(C,"y"),T=ce(C,"xunits"),x=ce(C,"yunits"),b=o.billboard;l(b)||(b=Se(r),o.billboard=b),b.image=f,b.scale=c,b.color=d,(l(v)||l(g)||l(_)||l(y))&&(b.imageSubRegion=new e(v,g,_,y)),l(h)&&0!==h&&(b.rotation=E.toRadians(-h),b.alignedAxis=i.UNIT_Z),c=s(c,1);var A,P;l(S)&&("pixels"===T?A=-S*c:"insetPixels"===T?A=(S-ot)*c:"fraction"===T&&(A=-ot*c*S),A+=.5*ot*c),l(w)&&("pixels"===x?P=w:"insetPixels"===x?P=-w:"fraction"===x&&(P=w*ot),P-=.5*ot*c),(l(A)||l(P))&&(b.pixelOffset=new t(A,P))}function be(e,t,i,r,n){for(var a=0,u=t.childNodes.length;u>a;a++){var c=t.childNodes.item(a);if("IconStyle"===c.localName)xe(e,c,i,r,n);else if("LabelStyle"===c.localName){var h=i.label;l(h)||(h=Te(),i.label=h),h.scale=s(pe(c,"scale",ut.kml),h.scale),h.fillColor=s(ye(c,"color",ut.kml),h.fillColor),h.text=i.name}else if("LineStyle"===c.localName){var d=i.polyline;l(d)||(d=new q,i.polyline=d),d.width=pe(c,"width",ut.kml),d.material=ye(c,"color",ut.kml)}else if("PolyStyle"===c.localName){var m=i.polygon;l(m)||(m=we(),i.polygon=m),m.material=s(ye(c,"color",ut.kml),m.material),m.fill=s(ve(c,"fill",ut.kml),m.fill),m.outline=s(ve(c,"outline",ut.kml),m.outline)}else if("BalloonStyle"===c.localName){var p=s(_e(fe(c,"bgColor",ut.kml)),o.WHITE),f=s(_e(fe(c,"textColor",ut.kml)),o.BLACK),v=fe(c,"text",ut.kml);i.addProperty("balloonStyle"),i.balloonStyle={bgColor:p,textColor:f,text:v}}}}function Ae(e,t,i,r,n,o){var a=new z,s=me(i,"Style",ut.kml),u=s.length;u>0&&be(t,s[u-1],a,n,o);var c=fe(i,"styleUrl",ut.kml);if(l(c)){var h=c,d=r.getById(h);l(d)||(d=r.getById("#"+h)),l(d)&&a.merge(d)}return a}function Pe(e,t,i){return O(C(ne(t,e._proxy)),function(r){return Ie(e,r,i,t,!0)})}function Ie(e,t,i,r,n,o){var a,s,u,c,h=de(t,"Style",ut.kml);if(l(h)){var d=h.length;for(a=0;d>a;a++)c=h[a],s=ce(c,"id"),l(s)&&(s="#"+s,n&&l(r)&&(s=r+s),l(i.getById(s))||(u=new z({id:s}),i.add(u),be(e,c,u,r,o)))}var m=de(t,"StyleMap",ut.kml);if(l(m)){var f=m.length;for(a=0;f>a;a++){var v=m[a];if(s=ce(v,"id"),l(s))for(var g=me(v,"Pair",ut.kml),_=0;_<g.length;_++){var y=g[_];if("normal"===fe(y,"key",ut.kml)){if(s="#"+s,n&&l(r)&&(s=r+s),!l(i.getById(s))){u=i.getOrCreateEntity(s);var C=fe(y,"styleUrl",ut.kml);if(l(C)){var E=i.getOrCreateEntity(C);l(E)&&u.merge(E)}else c=he(y,"Style",ut.kml),be(e,c,u,r,o)}break}}}}var S={},w=[],T=t.getElementsByTagName("styleUrl"),x=T.length;for(a=0;x>a;a++){var b=T[a].textContent;if("#"!==b[0]){var A=b.split("#");if(2===A.length){var P=A[0];l(S[P])||(l(r)&&(P=p(P,p(r))),w.push(Pe(e,P,i,r)))}}}return w}function Me(e,t,i){var r=new X(e._entityCollection,t.id,["position"]),n=new K(t.position);t.polyline=l(i.polyline)?i.polyline.clone():new q,t.polyline.positions=new j([r,n])}function De(e,t,i){return"relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t?e:((l(t)&&"clampToGround"!==t||l(i)&&"clampToSeaFloor"!==i)&&console.log("KML - Unknown altitudeMode: "+s(t,i)),new K(e))}function Re(e,t,i){if(l(e)){if("relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t)return e;(l(t)&&"clampToGround"!==t||l(i)&&"clampToSeaFloor"!==i)&&console.log("KML - Unknown altitudeMode: "+s(t,i));for(var r=e.length,n=0;r>n;n++){var o=e[n];d.WGS84.scaleToGeodeticSurface(o,o)}return e}}function Oe(e,i,r){var n=i.label;l(n)||(n=l(r.label)?r.label.clone():Te(),i.label=n),n.text=i.name;var a=i.billboard;if(l(a)||(a=l(r.billboard)?r.billboard.clone():Se(),i.billboard=a),l(a.image)||(a.image=e._pinBuilder.fromColor(o.YELLOW,64)),l(a.scale)){var s=a.scale.getValue();0!==s?n.pixelOffset=new t(16*s+1,0):(n.pixelOffset=void 0,n.horizontalOrigin=void 0)}}function Ne(e,t,i){var r=t.path;l(r)||(r=new W,r.leadTime=0,t.path=r);var n=i.polyline;l(n)&&(r.material=n.material,r.width=n.width)}function Le(e,t,i,r){var n=fe(t,"coordinates",ut.kml),o=fe(t,"altitudeMode",ut.kml),a=fe(t,"altitudeMode",ut.gx),s=ve(t,"extrude",ut.kml),l=se(n);i.position=De(new B(l),o,a),Oe(e,i,r),s&&ae(o,a)&&Me(e,i,r)}function Fe(e,t,i,r){var n=he(t,"coordinates",ut.kml),a=fe(t,"altitudeMode",ut.kml),s=fe(t,"altitudeMode",ut.gx),u=ve(t,"extrude",ut.kml),c=ve(t,"tessellate",ut.kml),h=ae(a,s),d=le(n),m=r.polyline;if(h&&u){var p=new J;i.wall=p,p.positions=d;var f=r.polygon;l(f)&&(p.fill=f.fill,p.outline=f.outline,p.material=f.material),l(m)&&(p.outlineColor=l(m.material)?m.material.color:o.WHITE,p.outlineWidth=m.width)}else m=l(m)?m.clone():new q,i.polyline=m,m.positions=Re(d,a,s),(!c||h)&&(m.followSurface=!1)}function Be(e,t,i,r){var n=he(t,"outerBoundaryIs",ut.kml),a=he(n,"LinearRing",ut.kml),s=he(a,"coordinates",ut.kml),u=le(s),c=ve(t,"extrude",ut.kml),h=fe(t,"altitudeMode",ut.kml),d=fe(t,"altitudeMode",ut.gx),m=ae(h,d),p=l(r.polygon)?r.polygon.clone():we(),f=r.polyline;if(l(f)&&(p.outlineColor=l(f.material)?f.material.color:o.WHITE,p.outlineWidth=f.width),i.polygon=p,m&&(p.perPositionHeight=!0,p.extrudedHeight=c?0:void 0),l(u)){for(var v=new T(u),g=me(t,"innerBoundaryIs",ut.kml),_=0;_<g.length;_++){a=me(g[_],"LinearRing",ut.kml);for(var y=0;y<a.length;y++)s=he(a[y],"coordinates",ut.kml),u=le(s),l(u)&&v.holes.push(new T(u))}p.hierarchy=v}}function Ve(e,t,i,r){for(var n=fe(t,"altitudeMode",ut.kml),o=fe(t,"altitudeMode",ut.gx),a=me(t,"coord",ut.gx),s=me(t,"when",ut.kml),l=ve(t,"extrude",ut.kml),u=ae(n,o),c=Math.min(a.length,s.length),h=[],d=[],m=0;c>m;m++){var p=se(a[m].textContent);h.push(p),d.push(_.fromIso8601(s[m].textContent))}var f=new Z;f.addSamples(d,h),i.position=De(f,n,o),Oe(e,i,r),Ne(e,i,r),i.availability=new P,s.length>0&&i.availability.addInterval(new A({start:d[0],stop:d[d.length-1]})),u&&l&&Me(e,i,r)}function ke(e,t,i,r,n,o,a,s,l){var u=e[0],c=e[e.length-1],h=new Z;h.addSamples(e,t),i.intervals.addInterval(new A({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:De(h,a,s)})),r.addInterval(new A({start:u,stop:c,isStartIncluded:l,isStopIncluded:l})),n.intervals.addInterval(new A({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:o}))}function ze(e,t,i,r){for(var n,o,a,s=ve(t,"interpolate",ut.gx),u=me(t,"Track",ut.gx),c=!1,h=new Q,d=new P,m=new F,p=0,f=u.length;f>p;p++){var v=u[p],g=me(v,"when",ut.kml),y=me(v,"coord",ut.gx),C=fe(v,"altitudeMode",ut.kml),E=fe(v,"altitudeMode",ut.gx),S=ae(C,E),w=ve(v,"extrude",ut.kml),T=Math.min(y.length,g.length),x=[];n=[];for(var b=0;T>b;b++){var A=se(y[b].textContent);x.push(A),n.push(_.fromIso8601(g[b].textContent))}s&&(l(o)&&ke([o,n[0]],[a,x[0]],m,d,h,!1,"absolute",void 0,!1),o=n[T-1],a=x[x.length-1]),ke(n,x,m,d,h,S&&w,C,E,!0),c=c||S&&w}i.availability=d,i.position=m,Oe(e,i,r),Ne(e,i,r),c&&(Me(e,i,r),i.polyline.show=h)}function Ue(e,t,i,r){for(var n=t.childNodes,o=0,a=n.length;a>o;o++){var s=n.item(o),u=dt[s.localName];if(l(u)){var c=oe(s,e._entityCollection);c.parent=i,c.name=i.name,c.availability=i.availability,c.description=i.description,c.kml=i.kml,u(e,s,c,r)}}}function Ge(e,t){var i=he(e,"ExtendedData",ut.kml);if(l(i)){var r={},n=me(i,"Data",ut.kml);if(l(n))for(var o=n.length,a=0;o>a;a++){var s=n[a],u=ce(s,"name");l(u)&&(r[u]={displayName:fe(s,"displayName",ut.kml),value:fe(s,"value",ut.kml)})}t.kml.extendedData=r}}function We(e,t,i,r){var n,a,u,c=t.kml,h=c.extendedData,d=fe(e,"description",ut.kml),m=s(t.balloonStyle,i.balloonStyle),p=o.WHITE,f=o.BLACK,v=d;l(m)&&(p=s(m.bgColor,o.WHITE),f=s(m.textColor,o.BLACK),v=s(m.text,d));var g;if(l(v)){if(v=v.replace("$[name]",s(t.name,"")),v=v.replace("$[description]",s(d,"")),v=v.replace("$[address]",s(c.address,"")),v=v.replace("$[Snippet]",s(c.snippet,"")),v=v.replace("$[id]",t.id),v=v.replace("$[geDirections]",""),l(h)){var _=v.match(/\$\[.+?\]/g);if(null!==_)for(n=0;n<_.length;n++){var y=_[n],C=y.substr(2,y.length-3),E=/\/displayName$/.test(C);C=C.replace(/\/displayName$/,""),g=h[C],l(g)&&(g=E?g.displayName:g.value),l(g)&&(v=v.replace(y,s(g,"")))}}}else if(l(h)&&(u=Object.keys(h),u.length>0)){for(v='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',n=0;n<u.length;n++)a=u[n],g=h[a],v+="<tr><th>"+s(g.displayName,a)+"</th><td>"+s(g.value,"")+"</td></tr>";v+="</tbody></table>"}if(l(v)){v=nt.link(v),ht.innerHTML=v;var S=ht.querySelectorAll("a");for(n=0;n<S.length;n++)S[n].setAttribute("target","_blank");l(r)&&r.keys.length>1&&(re(ht,"a","href",r),re(ht,"img","src",r));var w='<div class="cesium-infoBox-description-lighter" style="';w+="overflow:auto;",w+="word-wrap:break-word;",w+="background-color:"+p.toCssColorString()+";",w+="color:"+f.toCssColorString()+";",w+='">',w+=ht.innerHTML+"</div>",ht.innerHTML="",t.description=w}}function He(e,t,i,r,n,o,a){var u=oe(i,r),c=u.kml,h=Ae(u,e,i,n,o,a),d=fe(i,"name",ut.kml);u.name=d,u.parent=t;var m=Ee(i);l(m)||(m=Ce(i)),u.availability=m;var p=ve(i,"visibility",ut.kml);u.show=s(p,!0);var f=he(i,"author",ut.atom),v=c.author;v.name=fe(f,"name",ut.atom),v.uri=fe(f,"uri",ut.atom),v.email=fe(f,"email",ut.atom);var g=he(i,"link",ut.atom),_=c.link;return _.href=ce(g,"href"),_.hreflang=ce(g,"hreflang"),_.rel=ce(g,"rel"),_.type=ce(g,"type"),_.title=ce(g,"title"),_.length=ce(g,"length"),c.address=fe(i,"address",ut.kml),c.phoneNumber=fe(i,"phoneNumber",ut.kml),c.snippet=fe(i,"Snippet",ut.kml),Ge(i,u),We(i,u,h,a),{entity:u,styleEntity:h}}function qe(e,t,i,r,n,o,a){for(var s=Object.keys(mt),l=s.length,u=0;l>u;u++)for(var c=s[u],h=mt[c],d=i.childNodes,m=d.length,p=0;m>p;p++){var f=d[p];f.localName===c&&-1!==ut.kml.indexOf(f.namespaceURI)&&h(e,t,f,r,n,o,a)}}function je(e,t,i,r,n,o,a){var s=He(e,t,i,r,n,o,a);qe(e,s.entity,i,r,n,o,a)}function Ye(e,t,i,r,n,o,a){for(var s=He(e,t,i,r,n,o,a),u=s.entity,c=s.styleEntity,h=!1,d=i.childNodes,m=0,p=d.length;p>m&&!h;m++){var f=d.item(m),v=dt[f.localName];l(v)&&(v(e,f,u,c),h=!0)}h||(u.merge(c),Oe(e,u,c))}function Xe(e,t,i,r,n,o,a){var s,u=He(e,t,i,r,n,o,a),c=u.entity,h=!1,d=le(he(i,"LatLonQuad",ut.gx));if(l(d))s=we(),s.hierarchy=new T(d),c.polygon=s,h=!0;else{s=new Y,c.rectangle=s;var m=he(i,"LatLonBox",ut.kml);if(l(m)){var p=pe(m,"west",ut.kml),f=pe(m,"south",ut.kml),v=pe(m,"east",ut.kml),g=pe(m,"north",ut.kml);l(p)&&(p=E.negativePiToPi(E.toRadians(p))),l(f)&&(f=E.negativePiToPi(E.toRadians(f))),l(v)&&(v=E.negativePiToPi(E.toRadians(v))),l(g)&&(g=E.negativePiToPi(E.toRadians(g))),s.coordinates=new x(p,f,v,g);var _=pe(m,"rotation",ut.kml);l(_)&&(s.rotation=E.toRadians(_))}}var y=he(i,"Icon",ut.kml),C=fe(y,"href",ut.kml);l(C)?(h&&console.log("KML - gx:LatLonQuad Icon does not support texture projection."),s.material=ge(C,e._proxy,o,a)):s.material=ye(i,"color",ut.kml);var S=fe(i,"altitudeMode",ut.kml);l(S)?"absolute"===S?s.height=pe(i,"altitude",ut.kml):"clampToGround"!==S&&console.log("KML - Unknown altitudeMode: "+S):(S=fe(i,"altitudeMode",ut.gx),"relativeToSeaFloor"===S?(console.log("KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=pe(i,"altitude",ut.kml)):"clampToSeaFloor"===S?console.log("KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(S)&&console.log("KML - Unknown altitudeMode: "+S))}function Ze(e,t,i,r,n,o,a){console.log("KML - Unsupported feature: "+i.localName)}function Ke(e,t,i,r,n,o,a){var s=He(e,t,i,r,n,o,a),u=s.entity,c=he(i,"Link",ut.kml);if(l(c)){var h=fe(c,"href",ut.kml);if(l(h)){h=ge(h,void 0,o,a);var d=new et(e._proxy),m=O(d.load(h),function(){for(var t=d.entities.values,i=0;i<t.length;i++)e._entityCollection.suspendEvents(),t[i].parent=u,e._entityCollection.add(t[i]),e._entityCollection.resumeEvents()});e._promises.push(m)}}}function Qe(e,t,i,r,n,o,a){var s=mt[t.localName];l(s)?s(e,i,t,r,n,o,a):console.log("KML - Unsupported feature node: "+t.localName)}function Je(e,t,i,o){var a=e._entityCollection;e._promises=[],a.removeAll();var s=t.documentElement,u="Document"===s.localName?s:he(s,"Document",ut.kml),c=fe(u,"name",ut.kml);!l(c)&&l(i)&&(c=v(i));var h=new U(e);return O.all(Ie(e,t,h,i,!1,o),function(){var s=t.documentElement;if("kml"===s.localName)for(var u=s.childNodes,d=0;d<u.length;d++){var m=u[d];if(l(mt[m.localName])){s=m;break}}return Qe(e,s,void 0,a,h,i,o),O.all(e._promises,function(){var t,i=a.computeAvailability(),o=i.start,s=i.stop,l=_.equals(o,g.MINIMUM_VALUE),u=_.equals(s,g.MAXIMUM_VALUE);if(!l||!u){var h;l&&(h=new Date,h.setHours(0,0,0,0),o=_.fromDate(h)),u&&(h=new Date,h.setHours(24,0,0,0),s=_.fromDate(h)),t=new k,t.startTime=o,t.stopTime=s,t.currentTime=_.clone(o),t.clockRange=r.LOOP_STOP,t.clockStep=n.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=Math.round(Math.min(Math.max(_.secondsDifference(s,o)/60,1),31556900))}var d=!1;return e._name!==c&&(e._name=c,d=!0),t!==e._clock&&(d=!0,e._clock=t),d&&e._changed.raiseEvent(e),V.setLoading(e,!1),e})})}function $e(e,t,i){var r=O.defer();return N.createReader(new N.BlobReader(t),function(t){t.getEntries(function(n){for(var o=[],a=!1,s={},u=0;u<n.length;u++){var c=n[u];if(!c.directory){var h=O.defer();o.push(h.promise),!a&&/\.kml$/i.test(c.filename)?(a=!0,te(t,c,s,h)):ie(t,c,s,h)}}O.all(o).then(function(){return t.close(),l(s.kml)?(s.keys=Object.keys(s),Je(e,s.kml,i,s)):void r.reject(new b("KMZ file does not contain a KML document."))}).then(r.resolve).otherwise(r.reject)})},function(e){r.reject(e)}),r.promise}function et(e){this._changed=new m,this._error=new m,this._loading=new m,this._clock=void 0,this._entityCollection=new U(this),this._name=void 0,this._isLoading=!1,this._proxy=e,this._pinBuilder=new w,this._promises=[]}function tt(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}if("undefined"==typeof DOMParser)return{};var it={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){var t=e.toLowerCase();return t=f(t),it[t]}},rt=new DOMParser,nt=new D({stripPrefix:!1,twitter:!1,email:!1,replaceFn:function(e,t){return t.protocolUrlMatch?void 0:!1}}),ot=32,at=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],st=["http://www.google.com/kml/ext/2.2"],lt=["http://www.w3.org/2005/Atom"],ut={kml:at,gx:st,atom:lt,kmlgx:at.concat(st)},ct={},ht=document.createElement("div"),dt={Point:Le,LineString:Fe,LinearRing:Fe,Polygon:Be,Track:Ve,MultiTrack:ze,MultiGeometry:Ue},mt={Document:qe,Folder:je,Placemark:Ye,NetworkLink:Ke,GroundOverlay:Xe,PhotoOverlay:Ze,ScreenOverlay:Ze};return et.load=function(e,t){t=s(t,s.EMPTY_OBJECT);var i=new et(t.proxy);return i.load(e,t)},c(et.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}}}),et.prototype.load=function(e,t){V.setLoading(this,!0),t=s(t,s.EMPTY_OBJECT);var i=t.sourceUri,r=e;"string"==typeof e&&(r=y(ne(e,this._proxy)),i=s(i,e));var n=this;return O(r,function(e){return e instanceof Blob?$(e).then(function(t){return t?$e(n,e,i):O(ee(e)).then(function(e){var t,r;try{t=rt.parseFromString(e,"application/xml")}catch(o){r=o.toString()}if(l(r)||t.body||"parsererror"===t.documentElement.tagName){var a=l(r)?r:t.documentElement.firstChild.nodeValue;throw a||(a=t.body.innerText),new b(a)}return Je(n,t,i,void 0)})}):O(Je(n,e,i,void 0))}).otherwise(function(e){return V.setLoading(n,!1),n._error.raiseEvent(n,e),console.log(e),O.reject(e)})},et}),i("DataSources/PolylineArrowMaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./ConstantProperty","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this.color=e}return i(l.prototype,{isConstant:{get:function(){return s.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:a("color")}),l.prototype.getType=function(e){return"PolylineArrow"},l.prototype.getValue=function(i,r){return t(r)||(r={}),r.color=s.getValueOrClonedDefault(this._color,i,e.WHITE,r.color),r},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._color,e._color)},l}),i("DataSources/PropertyArray",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","./Property"],function(e,t,i,r,n,o){"use strict";function a(e){this._value=void 0,this._definitionChanged=new r,this._eventHelper=new n,this.setValue(e)}return t(a.prototype,{isConstant:{get:function(){var t=this._value;if(!e(t))return!0;for(var i=t.length,r=0;i>r;r++)if(!o.isConstant(t[r]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),a.prototype.getValue=function(t,i){var r=this._value;if(e(r)){var n=r.length;e(i)||(i=new Array(n));for(var o=0,a=0;n>o;){var s=this._value[o],l=s.getValue(t,i[o]);e(l)&&(i[a]=l,a++),o++}return i.length=a,i}},a.prototype.setValue=function(t){var i=this._eventHelper;if(i.removeAll(),e(t)){this._value=t.slice();for(var r=t.length,n=0;r>n;n++){var o=t[n];e(o)&&i.add(o.definitionChanged,a.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)},a.prototype.equals=function(e){return this===e||e instanceof a&&o.arrayEquals(this._value,e._value)},a.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},a}),i("DataSources/VelocityOrientationProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/JulianDate","../Core/Matrix3","../Core/Quaternion","../Core/Transforms","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(e,i){this._position=void 0,this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new a,this.position=e,this.ellipsoid=t(i,o.WGS84)}r(d.prototype,{isConstant:{get:function(){return h.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){var t=this._position;t!==e&&(i(t)&&this._subscription(),this._position=e,i(e)&&(this._subscription=e._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)),this._definitionChanged.raiseEvent(this))}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){var t=this._ellipsoid;t!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var m=new e,p=new e,f=new e,v=new s,g=new l,_=1/60;return d.prototype.getValue=function(t,r){var n=this._position;if(!h.isConstant(n)){var o=n.getValue(t,m),a=n.getValue(s.addSeconds(t,_,v),p);if(i(o)&&(i(a)||(a=o,o=n.getValue(s.addSeconds(t,-_,v),p),i(o)))&&!e.equals(o,a)){var l=e.subtract(a,o,f);return e.normalize(l,l),c.rotationMatrixFromPositionVelocity(o,l,this._ellipsoid,g),u.fromRotationMatrix(g,r)}}},d.prototype.equals=function(e){return this===e||e instanceof d&&h.equals(this._position,e._position)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))},d}),i("DataSources/Visualizer",["../Core/DeveloperError"],function(e){"use strict";function t(){e.throwInstantiationError()}return t.prototype.update=e.throwInstantiationError,t.prototype.getBoundingSphere=e.throwInstantiationError,t.prototype.isDestroyed=e.throwInstantiationError,t.prototype.destroy=e.throwInstantiationError,t}),i("Renderer/ClearCommand",["../Core/Color","../Core/defaultValue","../Core/freezeObject"],function(e,t,i){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner}return r.ALL=i(new r({color:new e(0,0,0,0),depth:1,stencil:0})),r.prototype.execute=function(e,t){e.clear(this,t)},r}),i("Renderer/ComputeCommand",["../Core/defaultValue","../Core/PrimitiveType","../Scene/Pass"],function(e,t,i){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.vertexArray=t.vertexArray,this.fragmentShaderSource=t.fragmentShaderSource,this.shaderProgram=t.shaderProgram,this.uniformMap=t.uniformMap,this.outputTexture=t.outputTexture,this.preExecute=t.preExecute,this.postExecute=t.postExecute,this.persists=e(t.persists,!1),this.pass=i.COMPUTE,this.owner=t.owner}return r.prototype.execute=function(e){e.execute(this)},r}),i("Shaders/ViewportQuadVS",[],function(){"use strict";return"attribute vec4 position;\nattribute vec2 textureCoordinates;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_Position = position;\nv_textureCoordinates = textureCoordinates;\n}\n"}),i("Renderer/ComputeEngine",["../Core/BoundingRectangle","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Geometry","../Core/GeometryAttribute","../Core/PrimitiveType","../Shaders/ViewportQuadVS","./BufferUsage","./ClearCommand","./DrawCommand","./Framebuffer","./RenderState","./ShaderProgram"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g){"use strict";function _(e){this._context=e}function y(e,t){return new f({context:e,colorTextures:[t],destroyAttachments:!1})}function C(e,t){return g.fromCache({context:e,vertexShaderSource:h,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function E(t,i){return n(S)&&S.viewport.width===t&&S.viewport.height===i||(S=v.fromCache({viewport:new e(0,0,t,i)})),S}var S,w=new p({primitiveType:c.TRIANGLES}),T=new m({color:new t(0,0,0,0)});return _.prototype.execute=function(e){n(e.preExecute)&&e.preExecute(e);var t=e.outputTexture,i=t.width,r=t.height,o=this._context,a=n(e.vertexArray)?e.vertexArray:o.getViewportQuadVertexArray(),s=n(e.shaderProgram)?e.shaderProgram:C(o,e.fragmentShaderSource),l=y(o,t),u=E(i,r),c=e.uniformMap,h=T;h.framebuffer=l,h.renderState=u,h.execute(o);var d=w;d.vertexArray=a,d.renderState=u,d.shaderProgram=s,d.uniformMap=c,d.framebuffer=l,d.execute(o),l.destroy(),e.persists||(s.destroy(),n(e.vertexArray)&&a.destroy()),n(e.postExecute)&&e.postExecute(t)},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){return a(this)},_}),i("Renderer/PassState",["../Core/BoundingRectangle"],function(e){"use strict";function t(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}return t}),i("Renderer/RenderbufferFormat",["../Core/freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={RGBA4:t.RGBA4,RGB5_A1:t.RGB5_A1,RGB565:t.RGB565,DEPTH_COMPONENT16:t.DEPTH_COMPONENT16,STENCIL_INDEX8:t.STENCIL_INDEX8,DEPTH_STENCIL:t.DEPTH_STENCIL,validate:function(e){return e===i.RGBA4||e===i.RGB5_A1||e===i.RGB565||e===i.DEPTH_COMPONENT16||e===i.STENCIL_INDEX8||e===i.DEPTH_STENCIL}};return e(i)}),i("Renderer/Renderbuffer",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","./ContextLimits","./RenderbufferFormat"],function(e,t,i,r,n,o,a){"use strict";function s(i){i=e(i,e.EMPTY_OBJECT);var r=i.context,n=r._gl,s=(o.maximumRenderbufferSize,e(i.format,a.RGBA4)),l=t(i.width)?i.width:n.drawingBufferWidth,u=t(i.height)?i.height:n.drawingBufferHeight;this._gl=n,this._format=s,this._width=l,this._height=u,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),n.renderbufferStorage(n.RENDERBUFFER,s,l,u),n.bindRenderbuffer(n.RENDERBUFFER,null)}return i(s.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}}),s.prototype._getRenderbuffer=function(){return this._renderbuffer},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),r(this)},s}),i("Renderer/PickFramebuffer",["../Core/BoundingRectangle","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","./Framebuffer","./PassState","./Renderbuffer","./RenderbufferFormat","./Texture"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t){var i=new a(t);i.blendingEnabled=!1,i.scissorTest={enabled:!0,rectangle:new e},i.viewport=new e,this._context=t,this._fb=void 0,this._passState=i,this._width=0,this._height=0}c.prototype.begin=function(t){var i=this._context,n=i.drawingBufferWidth,a=i.drawingBufferHeight;return e.clone(t,this._passState.scissorTest.rectangle),r(this._fb)&&this._width===n&&this._height===a||(this._width=n,this._height=a,this._fb=this._fb&&this._fb.destroy(),this._fb=new o({context:i,colorTextures:[new u({context:i,width:n,height:a})],depthStencilRenderbuffer:new s({context:i,format:l.DEPTH_STENCIL})}),this._passState.framebuffer=this._fb),this._passState.viewport.width=n,this._passState.viewport.height=a,this._passState};var h=new t;return c.prototype.end=function(e){for(var n=i(e.width,1),o=i(e.height,1),a=this._context,s=a.readPixels({x:e.x,y:e.y,width:n,height:o,framebuffer:this._fb}),l=Math.max(n,o),u=l*l,c=Math.floor(.5*n),d=Math.floor(.5*o),m=0,p=0,f=0,v=-1,g=0;u>g;++g){if(m>=-c&&c>=m&&p>=-d&&d>=p){var _=4*((d-p)*n+m+c);h.red=t.byteToFloat(s[_]),h.green=t.byteToFloat(s[_+1]),h.blue=t.byteToFloat(s[_+2]),h.alpha=t.byteToFloat(s[_+3]);var y=a.getObjectByPickColor(h);if(r(y))return y}if(m===p||0>m&&-m===p||m>0&&m===1-p){var C=f;f=-v,v=C}m+=f,p+=v}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this._fb=this._fb&&this._fb.destroy(),n(this)},c}),i("Renderer/ShaderCache",["../Core/defined","../Core/defineProperties","../Core/destroyObject","./ShaderProgram","./ShaderSource"],function(e,t,i,r,n){"use strict";function o(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}return t(o.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}}),o.prototype.replaceShaderProgram=function(t){return e(t.shaderProgram)&&t.shaderProgram.destroy(),this.getShaderProgram(t)},o.prototype.getShaderProgram=function(e){var t=e.vertexShaderSource,i=e.fragmentShaderSource,o=e.attributeLocations;"string"==typeof t&&(t=new n({sources:[t]})),"string"==typeof i&&(i=new n({sources:[i]}));var a,s=t.createCombinedVertexShader(),l=i.createCombinedFragmentShader(),u=s+l+JSON.stringify(o); +if(this._shaders[u])a=this._shaders[u],delete this._shadersToRelease[u];else{var c=this._context,h=new r({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:t,vertexShaderText:s,fragmentShaderSource:i,fragmentShaderText:l,attributeLocations:o});a={cache:this,shaderProgram:h,keyword:u,count:0},h._cachedShader=a,this._shaders[u]=a,++this._numberOfShaders}return++a.count,a.shaderProgram},o.prototype.destroyReleasedShaderPrograms=function(){var e=this._shadersToRelease;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];delete this._shaders[i.keyword],i.shaderProgram.finalDestroy(),--this._numberOfShaders}this._shadersToRelease={}},o.prototype.releaseShaderProgram=function(t){if(e(t)){var i=t._cachedShader;i&&0===--i.count&&(this._shadersToRelease[i.keyword]=i)}},o.prototype.isDestroyed=function(){return!1},o.prototype.destroy=function(){var e=this._shaders;for(var t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return i(this)},o}),i("Renderer/UniformState",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defined","../Core/defineProperties","../Core/EncodedCartesian3","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Simon1994PlanetaryPositions","../Core/Transforms","../Scene/SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m){"use strict";function p(){this.globeDepthTexture=void 0,this._viewport=new e,this._viewportCartesian4=new r,this._viewportDirty=!1,this._viewportOrthographicMatrix=c.clone(c.IDENTITY),this._viewportTransformation=c.clone(c.IDENTITY),this._model=c.clone(c.IDENTITY),this._view=c.clone(c.IDENTITY),this._inverseView=c.clone(c.IDENTITY),this._projection=c.clone(c.IDENTITY),this._infiniteProjection=c.clone(c.IDENTITY),this._entireFrustum=new t,this._currentFrustum=new t,this._frustumPlanes=new r,this._frameState=void 0,this._temeToPseudoFixed=u.clone(c.IDENTITY),this._view3DDirty=!0,this._view3D=new c,this._inverseView3DDirty=!0,this._inverseView3D=new c,this._inverseModelDirty=!0,this._inverseModel=new c,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new u,this._viewRotation=new u,this._inverseViewRotation=new u,this._viewRotation3D=new u,this._inverseViewRotation3D=new u,this._inverseProjectionDirty=!0,this._inverseProjection=new c,this._inverseProjectionOITDirty=!0,this._inverseProjectionOIT=new c,this._modelViewDirty=!0,this._modelView=new c,this._modelView3DDirty=!0,this._modelView3D=new c,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new c,this._inverseModelViewDirty=!0,this._inverseModelView=new c,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new c,this._viewProjectionDirty=!0,this._viewProjection=new c,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new c,this._modelViewProjectionDirty=!0,this._modelViewProjection=new c,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new c,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new c,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new c,this._normalDirty=!0,this._normal=new u,this._normal3DDirty=!0,this._normal3D=new u,this._inverseNormalDirty=!0,this._inverseNormal=new u,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new u,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new s,this._cameraPosition=new i,this._sunPositionWC=new i,this._sunPositionColumbusView=new i,this._sunDirectionWC=new i,this._sunDirectionEC=new i,this._moonDirectionEC=new i,this._mode=void 0,this._mapProjection=void 0,this._cameraDirection=new i,this._cameraRight=new i,this._cameraUp=new i,this._frustum2DWidth=0,this._eyeHeight2D=new t,this._resolutionScale=1,this._fogDensity=void 0}function f(e,t){c.clone(t,e._view),c.getRotation(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function v(e,t){c.clone(t,e._inverseView),c.getRotation(t,e._inverseViewRotation)}function g(e,t){c.clone(t,e._projection),e._inverseProjectionDirty=!0,e._inverseProjectionOITDirty=!0,e._viewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function _(e,t){c.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}function y(e,t){i.clone(t.positionWC,e._cameraPosition),i.clone(t.directionWC,e._cameraDirection),i.clone(t.rightWC,e._cameraRight),i.clone(t.upWC,e._cameraUp),e._encodedCameraPositionMCDirty=!0}function C(e,t){o(d.computeIcrfToFixedMatrix(t.time,W))||(W=d.computeTemeToPseudoFixedMatrix(t.time,W));var r=h.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);u.multiplyByVector(W,r,r),i.normalize(r,e._sunDirectionWC),r=u.multiplyByVector(e.viewRotation3D,r,e._sunDirectionEC),i.normalize(r,r),r=h.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),u.multiplyByVector(W,r,r),u.multiplyByVector(e.viewRotation3D,r,r),i.normalize(r,r);var n=t.mapProjection,a=n.ellipsoid,s=a.cartesianToCartographic(e._sunPositionWC,H);n.project(s,e._sunPositionColumbusView)}function E(e){if(e._viewportDirty){var t=e._viewport;c.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),c.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function S(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,c.inverse(e._projection,e._inverseProjection))}function w(e){e._inverseProjectionOITDirty&&(e._inverseProjectionOITDirty=!1,e._mode!==m.SCENE2D&&e._mode!==m.MORPHING?c.inverse(e._projection,e._inverseProjectionOIT):c.clone(c.IDENTITY,e._inverseProjectionOIT))}function T(e){e._modelViewDirty&&(e._modelViewDirty=!1,c.multiplyTransformation(e._view,e._model,e._modelView))}function x(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,c.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function b(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,c.inverse(e.modelView,e._inverseModelView))}function A(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,c.inverse(e.modelView3D,e._inverseModelView3D))}function P(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,c.multiply(e._projection,e._view,e._viewProjection))}function I(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,c.inverse(e.viewProjection,e._inverseViewProjection))}function M(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,c.multiply(e._projection,e.modelView,e._modelViewProjection))}function D(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;var t=e.modelView,i=e._modelViewRelativeToEye;i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=0,i[13]=0,i[14]=0,i[15]=t[15]}}function R(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,c.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function O(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,c.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function N(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,c.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function L(e){if(e._normalDirty){e._normalDirty=!1;var t=e._normal;c.getRotation(e.inverseModelView,t),u.transpose(t,t)}}function F(e){if(e._normal3DDirty){e._normal3DDirty=!1;var t=e._normal3D;c.getRotation(e.inverseModelView3D,t),u.transpose(t,t)}}function B(e){e._inverseNormalDirty&&(e._inverseNormalDirty=!1,c.getRotation(e.inverseModelView,e._inverseNormal))}function V(e){e._inverseNormal3DDirty&&(e._inverseNormal3DDirty=!1,c.getRotation(e.inverseModelView3D,e._inverseNormal3D))}function k(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,c.multiplyByPoint(e.inverseModel,e._cameraPosition,q),s.fromCartesian(q,e._encodedCameraPositionMC))}function z(e,t,r,n,a,s,u,h){var p=j;p.x=e.y,p.y=e.z,p.z=e.x;var f=Y;f.x=r.y,f.y=r.z,f.z=r.x;var v=X;v.x=n.y,v.y=n.z,v.z=n.x;var g=Z;g.x=t.y,g.y=t.z,g.z=t.x,s===m.SCENE2D&&(p.z=.5*a);var _=u.unproject(p,K);_.longitude=l.clamp(_.longitude,-Math.PI,Math.PI),_.latitude=l.clamp(_.latitude,-l.PI_OVER_TWO,l.PI_OVER_TWO);var y=u.ellipsoid,C=y.cartographicToCartesian(_,Q),E=d.eastNorthUpToFixedFrame(C,y,J);return c.multiplyByPointAsVector(E,f,f),c.multiplyByPointAsVector(E,v,v),c.multiplyByPointAsVector(E,g,g),o(h)||(h=new c),h[0]=f.x,h[1]=v.x,h[2]=-g.x,h[3]=0,h[4]=f.y,h[5]=v.y,h[6]=-g.y,h[7]=0,h[8]=f.z,h[9]=v.z,h[10]=-g.z,h[11]=0,h[12]=-i.dot(f,C),h[13]=-i.dot(v,C),h[14]=i.dot(g,C),h[15]=1,h}function U(e){e._view3DDirty&&(e._mode===m.SCENE3D?c.clone(e._view,e._view3D):z(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),c.getRotation(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function G(e){e._inverseView3DDirty&&(c.inverseTransformation(e.view3D,e._inverseView3D),c.getRotation(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}a(p.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(t){if(!e.equals(t,this._viewport)){e.clone(t,this._viewport);var i=this._viewport,r=this._viewportCartesian4;r.x=i.x,r.y=i.y,r.z=i.width,r.w=i.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return E(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return E(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){c.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._viewProjectionDirty=!0,this._inverseViewProjectionDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,c.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTranposeModel:{get:function(){var e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,c.getRotation(this.inverseModel,e),u.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return U(this),this._view3D}},viewRotation:{get:function(){return U(this),this._viewRotation}},viewRotation3D:{get:function(){return U(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return G(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return G(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return S(this),this._inverseProjection}},inverseProjectionOIT:{get:function(){return w(this),this._inverseProjectionOIT}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return T(this),this._modelView}},modelView3D:{get:function(){return x(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return D(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return b(this),this._inverseModelView}},inverseModelView3D:{get:function(){return A(this),this._inverseModelView3D}},viewProjection:{get:function(){return P(this),this._viewProjection}},inverseViewProjection:{get:function(){return I(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return M(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return R(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return O(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return N(this),this._modelViewInfiniteProjection}},normal:{get:function(){return L(this),this._normal}},normal3D:{get:function(){return F(this),this._normal3D}},inverseNormal:{get:function(){return B(this),this._inverseNormal}},inverseNormal3D:{get:function(){return V(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},encodedCameraPositionMCHigh:{get:function(){return k(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return k(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},resolutionScale:{get:function(){return this._resolutionScale}},fogDensity:{get:function(){return this._fogDensity}}});var W=new u,H=new n;p.prototype.updateFrustum=function(e){g(this,e.projectionMatrix),o(e.infiniteProjectionMatrix)&&_(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,o(e.top)||(e=e._offCenterFrustum),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right},p.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection;var t=e.context._canvas;this._resolutionScale=t.width/t.clientWidth;var i=e.camera;f(this,i.viewMatrix),v(this,i.inverseViewMatrix),y(this,i),e.mode===m.SCENE2D?(this._frustum2DWidth=i.frustum.right-i.frustum.left,this._eyeHeight2D.x=.5*this._frustum2DWidth,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),C(this,e),this._entireFrustum.x=i.frustum.near,this._entireFrustum.y=i.frustum.far,this.updateFrustum(i.frustum),this._fogDensity=e.fog.density,this._frameState=e,this._temeToPseudoFixed=d.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed)};var q=new i,j=new i,Y=new i,X=new i,Z=new i,K=new n,Q=new i,J=new c;return p}),i("Renderer/Context",["../Core/clone","../Core/Color","../Core/ComponentDatatype","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/Geometry","../Core/GeometryAttribute","../Core/Math","../Core/Matrix4","../Core/PrimitiveType","../Core/RuntimeError","../Shaders/ViewportQuadVS","./BufferUsage","./ClearCommand","./ContextLimits","./CubeMap","./DrawCommand","./PassState","./PickFramebuffer","./PixelDatatype","./RenderbufferFormat","./RenderState","./ShaderCache","./ShaderProgram","./Texture","./UniformState","./VertexArray","./WebGLConstants"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R){"use strict";function O(e,t){var i="WebGL Error: ";switch(t){case e.INVALID_ENUM:i+="INVALID_ENUM";break;case e.INVALID_VALUE:i+="INVALID_VALUE";break;case e.INVALID_OPERATION:i+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:i+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:i+="CONTEXT_LOST_WEBGL lost";break;default:i+="Unknown ("+t+")"}return i}function N(e,t,i,r){for(var n=O(e,r)+": "+t.name+"(",o=0;o<i.length;++o)0!==o&&(n+=", "),n+=i[o];return n+=");"}function L(e,t,i){var r=e.getError();if(r!==e.NO_ERROR)throw new f(N(e,t,i,r))}function F(e,t,i){return{get:function(){var r=e[t];return i(e,"get: "+t,r),e[t]},set:function(r){e[t]=r,i(e,"set: "+t,r)}}}function B(e,t){function i(i){return function(){var r=i.apply(e,arguments);return t(e,i,arguments),r}}if(!t)return e;var r={};for(var n in e){var o=e[n];"function"==typeof o?r[n]=i(o):Object.defineProperty(r,n,F(e,n,t))}return r}function V(e,t){for(var i=t.length,r=0;i>r;++r){var n=e.getExtension(t[r]);if(n)return n}}function k(i,a){if("undefined"==typeof WebGLRenderingContext)throw new f("The browser does not support WebGL. Visit http://get.webgl.org.");this._canvas=i,a=e(a,!0),a=n(a,{}),a.allowTextureFilterAnisotropic=n(a.allowTextureFilterAnisotropic,!0);var s=n(a.webgl,{});s.alpha=n(s.alpha,!1);var l,u=!1,c="undefined"!=typeof WebGL2RenderingContext,h=!1;if(u&&c&&(l=i.getContext("webgl2",s)||i.getContext("experimental-webgl2",s)||void 0,o(l)&&(h=!0)),o(l)||(l=i.getContext("webgl",s)||i.getContext("experimental-webgl",s)||void 0),!o(l))throw new f("The browser supports WebGL, but initialization failed.");this._originalGLContext=l,this._webgl2=h,this._id=r(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new A(this);var d=this._gl=this._originalGLContext;this._redBits=d.getParameter(d.RED_BITS),this._greenBits=d.getParameter(d.GREEN_BITS),this._blueBits=d.getParameter(d.BLUE_BITS),this._alphaBits=d.getParameter(d.ALPHA_BITS),this._depthBits=d.getParameter(d.DEPTH_BITS),this._stencilBits=d.getParameter(d.STENCIL_BITS),y._maximumCombinedTextureImageUnits=d.getParameter(d.MAX_COMBINED_TEXTURE_IMAGE_UNITS),y._maximumCubeMapSize=d.getParameter(d.MAX_CUBE_MAP_TEXTURE_SIZE),y._maximumFragmentUniformVectors=d.getParameter(d.MAX_FRAGMENT_UNIFORM_VECTORS),y._maximumTextureImageUnits=d.getParameter(d.MAX_TEXTURE_IMAGE_UNITS),y._maximumRenderbufferSize=d.getParameter(d.MAX_RENDERBUFFER_SIZE),y._maximumTextureSize=d.getParameter(d.MAX_TEXTURE_SIZE),y._maximumVaryingVectors=d.getParameter(d.MAX_VARYING_VECTORS),y._maximumVertexAttributes=d.getParameter(d.MAX_VERTEX_ATTRIBS),y._maximumVertexTextureImageUnits=d.getParameter(d.MAX_VERTEX_TEXTURE_IMAGE_UNITS),y._maximumVertexUniformVectors=d.getParameter(d.MAX_VERTEX_UNIFORM_VECTORS);var m=d.getParameter(d.ALIASED_LINE_WIDTH_RANGE);y._minimumAliasedLineWidth=m[0],y._maximumAliasedLineWidth=m[1];var p=d.getParameter(d.ALIASED_POINT_SIZE_RANGE);y._minimumAliasedPointSize=p[0],y._maximumAliasedPointSize=p[1];var v=d.getParameter(d.MAX_VIEWPORT_DIMS);y._maximumViewportWidth=v[0],y._maximumViewportHeight=v[1];var g=d.getShaderPrecisionFormat(d.FRAGMENT_SHADER,d.HIGH_FLOAT);y._highpFloatSupported=0!==g.precision;var _=d.getShaderPrecisionFormat(d.FRAGMENT_SHADER,d.HIGH_INT);y._highpIntSupported=0!==_.rangeMax,this._antialias=d.getContextAttributes().antialias,this._standardDerivatives=!!V(d,["OES_standard_derivatives"]),this._elementIndexUint=!!V(d,["OES_element_index_uint"]),this._depthTexture=!!V(d,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._textureFloat=!!V(d,["OES_texture_float"]),this._fragDepth=!!V(d,["EXT_frag_depth"]),this._debugShaders=V(d,["WEBGL_debug_shaders"]);var C=a.allowTextureFilterAnisotropic?V(d,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=C,y._maximumTextureFilterAnisotropy=o(C)?d.getParameter(C.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;var E,w,T,x,P,I,D,O,N,L;if(h){var F=this;E=function(){return F._gl.createVertexArray()},w=function(e){F._gl.bindVertexArray(e)},T=function(e){F._gl.deleteVertexArray(e)},x=function(e,t,i,r,n){d.drawElementsInstanced(e,t,i,r,n)},P=function(e,t,i,r){d.drawArraysInstanced(e,t,i,r)},I=function(e,t){d.vertexAttribDivisor(e,t)},D=function(e){d.drawBuffers(e)}}else O=V(d,["OES_vertex_array_object"]),o(O)&&(E=function(){return O.createVertexArrayOES()},w=function(e){O.bindVertexArrayOES(e)},T=function(e){O.deleteVertexArrayOES(e)}),N=V(d,["ANGLE_instanced_arrays"]),o(N)&&(x=function(e,t,i,r,n){N.drawElementsInstancedANGLE(e,t,i,r,n)},P=function(e,t,i,r){N.drawArraysInstancedANGLE(e,t,i,r)},I=function(e,t){N.vertexAttribDivisorANGLE(e,t)}),L=V(d,["WEBGL_draw_buffers"]),o(L)&&(D=function(e){L.drawBuffersWEBGL(e)});this.glCreateVertexArray=E,this.glBindVertexArray=w,this.glDeleteVertexArray=T,this.glDrawElementsInstanced=x,this.glDrawArraysInstanced=P,this.glVertexAttribDivisor=I,this.glDrawBuffers=D,this._vertexArrayObject=!!O,this._instancedArrays=!!N,this._drawBuffers=!!L,y._maximumDrawBuffers=this.drawBuffers?d.getParameter(R.MAX_DRAW_BUFFERS):1,y._maximumColorAttachments=this.drawBuffers?d.getParameter(R.MAX_COLOR_ATTACHMENTS):1;var B=d.getParameter(d.COLOR_CLEAR_VALUE);this._clearColor=new t(B[0],B[1],B[2],B[3]),this._clearDepth=d.getParameter(d.DEPTH_CLEAR_VALUE),this._clearStencil=d.getParameter(d.STENCIL_CLEAR_VALUE);var k=new M,z=new S(this),U=b.fromCache();this._defaultPassState=z,this._defaultRenderState=U,this._defaultTexture=void 0,this._defaultCubeMap=void 0,this._us=k,this._currentRenderState=U,this._currentPassState=z,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(var G=0;G<y._maximumVertexAttributes;G++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options=a,this.cache={},b.apply(d,U,z)}function z(e,t){if(e.validateFramebuffer){var i=e._gl,r=i.checkFramebufferStatus(i.FRAMEBUFFER);if(r!==i.FRAMEBUFFER_COMPLETE){var n;switch(r){case i.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:n="Framebuffer is not complete. Incomplete attachment: at least one attachment point with a renderbuffer or texture attached has its attached object no longer in existence or has an attached image with a width or height of zero, or the color attachment point has a non-color-renderable image attached, or the depth attachment point has a non-depth-renderable image attached, or the stencil attachment point has a non-stencil-renderable image attached. Color-renderable formats include GL_RGBA4, GL_RGB5_A1, and GL_RGB565. GL_DEPTH_COMPONENT16 is the only depth-renderable format. GL_STENCIL_INDEX8 is the only stencil-renderable format.";break;case i.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:n="Framebuffer is not complete. Incomplete dimensions: not all attached images have the same width and height.";break;case i.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:n="Framebuffer is not complete. Missing attachment: no images are attached to the framebuffer.";break;case i.FRAMEBUFFER_UNSUPPORTED:n="Framebuffer is not complete. Unsupported: the combination of internal formats of the attached images violates an implementation-dependent set of restrictions."}throw new l(n)}}}function U(e,t,i,r){var n=e._currentRenderState,o=e._currentPassState;e._currentRenderState=t,e._currentPassState=i,b.partialApply(e._gl,n,t,o,i,r)}function G(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;var i=Y;if(o(t))t._bind(),z(e,t),i=t._getActiveColorAttachments();else{var r=e._gl;r.bindFramebuffer(r.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(i)}}function W(e,t,i,r,o,a){var s=n(n(o,i.renderState),e._defaultRenderState);G(e,t),U(e,s,r,!1);var l=n(a,i.shaderProgram);l._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,l.maximumTextureUnitIndex)}function H(e,t,i){var r=t.primitiveType,a=t.vertexArray,s=t.offset,l=t.count,u=t.instanceCount;e._us.model=n(t.modelMatrix,m.IDENTITY);var c=n(i,t.shaderProgram);c._setUniforms(t.uniformMap,e._us,e.validateShaderProgram),a._bind();var h=a.indexBuffer;o(h)?(s*=h.bytesPerIndex,l=n(l,h.numberOfIndices),0===u?e._gl.drawElements(r,l,h.indexDatatype,s):e.glDrawElementsInstanced(r,l,h.indexDatatype,s,u)):(l=n(l,a.numberOfVertices),0===u?e._gl.drawArrays(r,s,l):e.glDrawArraysInstanced(r,s,l,u)),a._unBind()}function q(e,t,i){this._pickObjects=e,this.key=t,this.color=i}var j={};a(k.prototype,{id:{get:function(){return this._id}},webgl2:{get:function(){return this._webgl2}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},uniformState:{get:function(){return this._us}},redBits:{get:function(){return this._redBits}},greenBits:{get:function(){return this._greenBits}},blueBits:{get:function(){return this._blueBits}},alphaBits:{get:function(){return this._alphaBits}},depthBits:{get:function(){return this._depthBits}},stencilBits:{get:function(){return this._stencilBits}},antialias:{get:function(){return this._antialias}},standardDerivatives:{get:function(){return this._standardDerivatives}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture}},floatingPointTexture:{get:function(){return this._textureFloat}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=B(this._originalGLContext,e?L:null)}},defaultTexture:{get:function(){return void 0===this._defaultTexture&&(this._defaultTexture=new I({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])}})),this._defaultTexture}},defaultCubeMap:{get:function(){if(void 0===this._defaultCubeMap){var e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new C({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e}})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return j}}});var Y;"undefined"!=typeof WebGLRenderingContext&&(Y=[R.BACK]);var X=new _;k.prototype.clear=function(e,i){e=n(e,X),i=n(i,this._defaultPassState);var r=this._gl,a=0,s=e.color,l=e.depth,u=e.stencil;o(s)&&(t.equals(this._clearColor,s)||(t.clone(s,this._clearColor),r.clearColor(s.red,s.green,s.blue,s.alpha)),a|=r.COLOR_BUFFER_BIT),o(l)&&(l!==this._clearDepth&&(this._clearDepth=l,r.clearDepth(l)),a|=r.DEPTH_BUFFER_BIT),o(u)&&(u!==this._clearStencil&&(this._clearStencil=u,r.clearStencil(u)),a|=r.STENCIL_BUFFER_BIT);var c=n(e.renderState,this._defaultRenderState);U(this,c,i,!0);var h=n(e.framebuffer,i.framebuffer);G(this,h),r.clear(a)},k.prototype.draw=function(e,t,i,r){t=n(t,this._defaultPassState);var o=n(e.framebuffer,t.framebuffer);W(this,o,e,t,i,r),H(this,e,r)},k.prototype.endFrame=function(){var e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);var t=Y;this.drawBuffers&&this.glDrawBuffers(t);var i=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(var r=0;i>r;++r)e.activeTexture(e.TEXTURE0+r),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)},k.prototype.readPixels=function(e){var t=this._gl;e=e||{};var i=Math.max(e.x||0,0),r=Math.max(e.y||0,0),n=e.width||t.drawingBufferWidth,o=e.height||t.drawingBufferHeight,a=e.framebuffer,s=new Uint8Array(4*n*o);return G(this,a),t.readPixels(i,r,n,o,t.RGBA,t.UNSIGNED_BYTE,s),s};var Z={position:0,textureCoordinates:1};return k.prototype.getViewportQuadVertexArray=function(){var e=this.cache.viewportQuad_vertexArray;if(!o(e)){var t=new c({attributes:{position:new h({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new h({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:p.TRIANGLES});e=D.fromGeometry({context:this,geometry:t,attributeLocations:Z,bufferUsage:g.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e},k.prototype.createViewportQuadCommand=function(e,t){return t=n(t,n.EMPTY_OBJECT),new E({vertexArray:this.getViewportQuadVertexArray(),primitiveType:p.TRIANGLES,renderState:t.renderState,shaderProgram:P.fromCache({context:this,vertexShaderSource:v,fragmentShaderSource:e,attributeLocations:Z}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer})},k.prototype.createPickFramebuffer=function(){return new w(this)},k.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]},a(q.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}}),q.prototype.destroy=function(){delete this._pickObjects[this.key]},k.prototype.createPickId=function(e){++this._nextPickColor[0];var i=this._nextPickColor[0];if(0===i)throw new f("Out of unique Pick IDs.");return this._pickObjects[i]=e,new q(this._pickObjects,i,t.fromRgba(i))},k.prototype.isDestroyed=function(){return!1},k.prototype.destroy=function(){var e=this.cache;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];o(i.destroy)&&i.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),s(this)},k}),i("Renderer/loadCubeMap",["../Core/defined","../Core/DeveloperError","../Core/loadImage","../ThirdParty/when","./CubeMap"],function(e,t,i,r,n){"use strict";function o(e,t,o){var a=[i(t.positiveX,o),i(t.negativeX,o),i(t.positiveY,o),i(t.negativeY,o),i(t.positiveZ,o),i(t.negativeZ,o)];return r.all(a,function(t){return new n({context:e,source:{positiveX:t[0],negativeX:t[1],positiveY:t[2],negativeY:t[3],positiveZ:t[4],negativeZ:t[5]}})})}return o}),i("Scene/DiscardMissingTileImagePolicy",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/getImagePixels","../Core/loadImageViaBlob","../ThirdParty/when"],function(e,t,i,r,n,o){"use strict";function a(a){function s(e){t(e.blob)&&(u._missingImageByteLength=e.blob.size);var i=r(e);if(a.disableCheckIfAllPixelsAreTransparent){for(var n=!0,o=e.width,s=a.pixelsToCheck,l=0,c=s.length;n&&c>l;++l){var h=s[l],d=4*h.x+h.y*o,m=i[d+3];m>0&&(n=!1)}n&&(i=void 0)}u._missingImagePixels=i,u._isReady=!0}function l(){u._missingImagePixels=void 0,u._isReady=!0}if(a=e(a,e.EMPTY_OBJECT),!t(a.missingImageUrl))throw new i("options.missingImageUrl is required.");if(!t(a.pixelsToCheck))throw new i("options.pixelsToCheck is required.");this._pixelsToCheck=a.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;var u=this;o(n(a.missingImageUrl),s,l)}return a.prototype.isReady=function(){return this._isReady},a.prototype.shouldDiscardImage=function(e){if(!this._isReady)throw new i("shouldDiscardImage must not be called before the discard policy is ready.");var n=this._pixelsToCheck,o=this._missingImagePixels;if(!t(o))return!1;if(t(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;for(var a=r(e),s=e.width,l=0,u=n.length;u>l;++l)for(var c=n[l],h=4*c.x+c.y*s,d=0;4>d;++d){var m=h+d;if(a[m]!==o[m])return!1}return!0},a}),i("Scene/ImageryLayerFeatureInfo",["../Core/defined"],function(e){"use strict";function t(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}return t.prototype.configureNameFromProperties=function(t){var i,r=10;for(var n in t)if(t.hasOwnProperty(n)&&t[n]){var o=n.toLowerCase();r>1&&"name"===o?(r=1,i=n):r>2&&"title"===o?(r=2,i=n):r>3&&/name/i.test(n)?(r=3,i=n):r>4&&/title/i.test(n)&&(r=4, +i=n)}e(i)&&(this.name=t[i])},t.prototype.configureDescriptionFromProperties=function(t){function i(t){var r='<table class="cesium-infoBox-defaultTable">';for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];e(o)&&(r+="object"==typeof o?"<tr><td>"+n+"</td><td>"+i(o)+"</td></tr>":"<tr><td>"+n+"</td><td>"+o+"</td></tr>")}return r+="</table>"}this.description=i(t)},t}),i("Scene/ImageryProvider",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/loadImage","../Core/loadImageViaBlob","../Core/throttleRequestByServer"],function(e,t,i,r,n,o){"use strict";function a(){this.defaultAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,i.throwInstantiationError()}return t(a.prototype,{ready:{get:i.throwInstantiationError},readyPromise:{get:i.throwInstantiationError},rectangle:{get:i.throwInstantiationError},tileWidth:{get:i.throwInstantiationError},tileHeight:{get:i.throwInstantiationError},maximumLevel:{get:i.throwInstantiationError},minimumLevel:{get:i.throwInstantiationError},tilingScheme:{get:i.throwInstantiationError},tileDiscardPolicy:{get:i.throwInstantiationError},errorEvent:{get:i.throwInstantiationError},credit:{get:i.throwInstantiationError},proxy:{get:i.throwInstantiationError},hasAlphaChannel:{get:i.throwInstantiationError}}),a.prototype.getTileCredits=i.throwInstantiationError,a.prototype.requestImage=i.throwInstantiationError,a.prototype.pickFeatures=i.throwInstantiationError,a.loadImage=function(t,i){return e(t.tileDiscardPolicy)?o(i,n,{headers:t.headers,withCredentials:t.withCredentials,maximumRequests:t.maximumRequests}):o(i,r,{headers:t.headers,withCredentials:t.withCredentials,maximumRequests:t.maximumRequests})},a}),i("Scene/ArcGisMapServerImageryProvider",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicProjection","../Core/GeographicTilingScheme","../Core/loadJson","../Core/loadJsonp","../Core/Math","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorProjection","../Core/WebMercatorTilingScheme","../ThirdParty/when","./DiscardMissingTileImagePolicy","./ImageryLayerFeatureInfo","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S){"use strict";function w(t){function i(i){var n=i.tileInfo;if(o(n)){if(h._tileWidth=n.rows,h._tileHeight=n.cols,102100===n.spatialReference.wkid||102113===n.spatialReference.wkid)h._tilingScheme=new _({ellipsoid:t.ellipsoid});else{if(4326!==i.tileInfo.spatialReference.wkid){var a="Tile spatial reference WKID "+i.tileInfo.spatialReference.wkid+" is not supported.";return void(u=v.handleError(u,h,h._errorEvent,a,void 0,void 0,void 0,s))}h._tilingScheme=new c({ellipsoid:t.ellipsoid})}if(h._maximumLevel=i.tileInfo.lods.length-1,o(i.fullExtent)){if(o(i.fullExtent.spatialReference)&&o(i.fullExtent.spatialReference.wkid))if(102100===i.fullExtent.spatialReference.wkid||102113===i.fullExtent.spatialReference.wkid){var l=new g,d=l.unproject(new e(i.fullExtent.xmin,i.fullExtent.ymin)),m=l.unproject(new e(i.fullExtent.xmax,i.fullExtent.ymax));h._rectangle=new p(d.longitude,d.latitude,m.longitude,m.latitude)}else{if(4326!==i.fullExtent.spatialReference.wkid){var f="fullExtent.spatialReference WKID "+i.fullExtent.spatialReference.wkid+" is not supported.";return void(u=v.handleError(u,h,h._errorEvent,f,void 0,void 0,void 0,s))}h._rectangle=p.fromDegrees(i.fullExtent.xmin,i.fullExtent.ymin,i.fullExtent.xmax,i.fullExtent.ymax)}}else h._rectangle=h._tilingScheme.rectangle;o(h._tileDiscardPolicy)||(h._tileDiscardPolicy=new C({missingImageUrl:T(h,0,0,h._maximumLevel),pixelsToCheck:[new e(0,0),new e(200,20),new e(20,200),new e(80,110),new e(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),h._useTiles=!0}else h._useTiles=!1;o(i.copyrightText)&&i.copyrightText.length>0&&(h._credit=new r(i.copyrightText)),h._ready=!0,h._readyPromise.resolve(!0),v.handleSuccess(u)}function a(e){var t="An error occurred while accessing "+h._url+".";u=v.handleError(u,h,h._errorEvent,t,void 0,void 0,void 0,s),h._readyPromise.reject(new f(t))}function s(){var e={f:"json"};o(h._token)&&(e.token=h._token);var t=d(h._url,{parameters:e,proxy:h._proxy});y(t,i,a)}t=n(t,{}),this._url=t.url,this._token=t.token,this._tileDiscardPolicy=t.tileDiscardPolicy,this._proxy=t.proxy,this._tileWidth=n(t.tileWidth,256),this._tileHeight=n(t.tileHeight,256),this._maximumLevel=t.maximumLevel,this._tilingScheme=n(t.tilingScheme,new c({ellipsoid:t.ellipsoid})),this._credit=void 0,this._useTiles=n(t.usePreCachedTilesIfAvailable,!0),this._rectangle=n(t.rectangle,this._tilingScheme.rectangle),this._layers=t.layers,this.enablePickFeatures=n(t.enablePickFeatures,!0),this._errorEvent=new l,this._ready=!1,this._readyPromise=y.defer();var u,h=this;this._useTiles?s():(this._ready=!0,this._readyPromise.resolve(!0))}function T(e,t,i,r){var n;if(e._useTiles)n=e._url+"/tile/"+r+"/"+i+"/"+t;else{var a=e._tilingScheme.tileXYToNativeRectangle(t,i,r),s=a.west+"%2C"+a.south+"%2C"+a.east+"%2C"+a.north;n=e._url+"/export?",n+="bbox="+s,n+=e._tilingScheme instanceof c?"&bboxSR=4326&imageSR=4326":"&bboxSR=3857&imageSR=3857",n+="&size="+e._tileWidth+"%2C"+e._tileHeight,n+="&format=png&transparent=true&f=image",e.layers&&(n+="&layers=show:"+e.layers)}var l=e._token;o(l)&&(-1===n.indexOf("?")&&(n+="?"),"?"!==n[n.length-1]&&(n+="&"),n+="token="+l);var u=e._proxy;return o(u)&&(n=u.getURL(n)),n}return a(w.prototype,{url:{get:function(){return this._url}},token:{get:function(){return this._token}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}}),w.prototype.getTileCredits=function(e,t,i){},w.prototype.requestImage=function(e,t,i){var r=T(this,e,t,i);return S.loadImage(this,r)},w.prototype.pickFeatures=function(e,r,n,a,s){if(this.enablePickFeatures){var l,u,d,p=this._tilingScheme.tileXYToNativeRectangle(e,r,n);if(this._tilingScheme instanceof c)l=m.toDegrees(a),u=m.toDegrees(s),d="4326";else{var f=this._tilingScheme.projection.project(new i(a,s,0));l=f.x,u=f.y,d="3857"}var v=this._url+"/identify?f=json&tolerance=2&geometryType=esriGeometryPoint";return v+="&geometry="+l+","+u,v+="&mapExtent="+p.west+","+p.south+","+p.east+","+p.north,v+="&imageDisplay="+this._tileWidth+","+this._tileHeight+",96",v+="&sr="+d,v+="&layers=visible",o(this._layers)&&(v+=":"+this._layers),o(this._token)&&(v+="&token="+this._token),o(this._proxy)&&(v=this._proxy.getURL(v)),h(v).then(function(e){var r=[],n=e.results;if(!o(n))return r;for(var a=0;a<n.length;++a){var s=n[a],l=new E;if(l.data=s,l.name=s.value,l.properties=s.attributes,l.configureDescriptionFromProperties(s.attributes),"esriGeometryPoint"===s.geometryType&&s.geometry){var u=s.geometry.spatialReference&&s.geometry.spatialReference.wkid?s.geometry.spatialReference.wkid:4326;if(4326===u||4283===u)l.position=i.fromDegrees(s.geometry.x,s.geometry.y,s.geometry.z);else if(102100===u||900913===u||3857===u){var c=new g;l.position=c.unproject(new t(s.geometry.x,s.geometry.y,s.geometry.z))}}r.push(l)}return r})}},w}),i("Scene/BingMapsStyle",["../Core/freezeObject"],function(e){"use strict";var t={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",ROAD:"Road",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"};return e(t)}),i("Scene/BingMapsImageryProvider",["../Core/BingMapsApi","../Core/Cartesian2","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/loadJsonp","../Core/Math","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./BingMapsStyle","./DiscardMissingTileImagePolicy","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g){"use strict";function _(o){function a(e){var r=e.resourceSets[0].resources[0];w._tileWidth=r.imageWidth,w._tileHeight=r.imageHeight,w._maximumLevel=r.zoomMax-1,w._imageUrlSubdomains=r.imageUrlSubdomains,w._imageUrlTemplate=r.imageUrl.replace("{culture}",w._culture);var o=w._tileProtocol;if(!n(o)){var a=document.location.protocol;o=/^http/.test(a)?a:"http:"}w._imageUrlTemplate=w._imageUrlTemplate.replace(/^http:/,o),n(w._tileDiscardPolicy)||(w._tileDiscardPolicy=new v({missingImageUrl:y(w,0,0,w._maximumLevel),pixelsToCheck:[new t(0,0),new t(120,140),new t(130,160),new t(200,50),new t(200,200)],disableCheckIfAllPixelsAreTransparent:!0}));var s=w._attributionList=r.imageryProviders;s||(s=w._attributionList=[]);for(var l=0,h=s.length;h>l;++l){var m=s[l];m.credit=new i(m.attribution);for(var p=m.coverageAreas,f=0,g=m.coverageAreas.length;g>f;++f){var _=p[f],C=_.bbox;_.bbox=new c(u.toRadians(C[1]),u.toRadians(C[0]),u.toRadians(C[3]),u.toRadians(C[2]))}}w._ready=!0,w._readyPromise.resolve(!0),d.handleSuccess(E)}function g(e){var t="An error occurred while accessing "+S+".";E=d.handleError(E,w,w._errorEvent,t,void 0,void 0,void 0,C),w._readyPromise.reject(new h(t))}function C(){var e=l(S,{callbackParameterName:"jsonp",proxy:w._proxy});p(e,a,g)}o=r(o,{}),this._key=e.getKey(o.key),this._url=o.url,this._tileProtocol=o.tileProtocol,this._mapStyle=r(o.mapStyle,f.AERIAL),this._culture=r(o.culture,""),this._tileDiscardPolicy=o.tileDiscardPolicy,this._proxy=o.proxy,this._credit=new i("Bing Imagery",_._logoData,"http://www.bing.com"),this.defaultGamma=1,(this._mapStyle===f.AERIAL||this._mapStyle===f.AERIAL_WITH_LABELS)&&(this.defaultGamma=1.3),this._tilingScheme=new m({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:o.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._errorEvent=new s,this._ready=!1,this._readyPromise=p.defer();var E,S=this._url+"/REST/v1/Imagery/Metadata/"+this._mapStyle+"?incl=ImageryProviders&key="+this._key,w=this;C()}function y(e,t,i,r){var o=e._imageUrlTemplate,a=_.tileXYToQuadKey(t,i,r);o=o.replace("{quadkey}",a);var s=e._imageUrlSubdomains,l=(t+i+r)%s.length;o=o.replace("{subdomain}",s[l]);var u=e._proxy;return n(u)&&(o=u.getURL(o)),o}function C(e,t,i){++t;for(var r=[],o=0,a=e.length;a>o;++o){for(var s=e[o],l=s.coverageAreas,u=!1,h=0,d=s.coverageAreas.length;!u&&d>h;++h){var m=l[h];if(t>=m.zoomMin&&t<=m.zoomMax){var p=c.intersection(i,m.bbox,S);n(p)&&(u=!0)}}u&&r.push(s.credit)}return r}o(_.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});var E=new c;_.prototype.getTileCredits=function(e,t,i){if(!this._ready)throw new a("getTileCredits must not be called before the imagery provider is ready.");var r=this._tilingScheme.tileXYToRectangle(e,t,i,E);return C(this._attributionList,i,r)},_.prototype.requestImage=function(e,t,i){var r=y(this,e,t,i);return g.loadImage(this,r)},_.prototype.pickFeatures=function(){},_._logoData="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD0AAAAaCAYAAAAEy1RnAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH3gIDEgcPTMnXOQAAClZJREFUWMPdWGtsFNcV/u689uH1+sXaONhlWQzBENtxiUFBpBSLd60IpXHSNig4URtSYQUkRJNSi0igViVVVBJBaBsiAgKRQJSG8AgEHCCWU4iBCprY2MSgXfOI16y9D3s9Mzsztz9yB12WNU2i9Ecy0tHOzN4793zn3POdcy7BnRfJ8I7iB3SRDPeEExswLz8Y0DZIAYDIRGAgLQAm+7Xle31J3L3Anp1MZPY+BUBjorN332vgYhpgV1FRUd6TTz45ubq6OtDV1SXpuu5g//Oept9wNwlMyAi8IXDjyF245TsDTdivDMATCATGNDU1/WbhwoWPTZs2bWx1dXWhx+Oxrl+/PqTrus5t9W8KWEzjinTAYhro/xuBStwiIgBnJBLxKIoy1u/3V/r9/krDMMz3339/Z3t7e38ikUgCMDLEt8W+Q0cAI3McYTDDmZxh7DESG5Ni43jg9Gsa+X+OsxWxPSJTSj3JZFK5ZRVJErOzs8e6XC4fgGwALhbzDgAKU1hK28KEA6PMmTMn56233qpevnz5PQDcbJ7EzVUAuMrLy3MBeABkcWOEDELSyFe4y7iMoHkriZZlKYZh8ASHZDKpJJPJHAC5APIA5APIAeBlCjo5TwlpXnbOmTPHP3fu3KZVq1atZKBcDJQ9x7V48WJfc3Pzhp6enj+tXLnyR8w4MjdG4gyVDk7KICMClzKlLUrpbQMNw5AkScppbGz8cWdn57WjR4/2caw+DEBlYjO8wX1foZQWuN3uKZIklQD4G+fhlG0Yl8uVm5WVVW6app6dne0D0G8vnxbjJntHubCUOK/badZICyWanrJuAaeUknTQpmlKkUhEWbx48U8LCwtHhUKha+fPn+85fPhwV0tLyzUACSZx9jvMFhIByNFoVDEMw/qKB5HPvJfkUqBr9+7deklJyZ/j8bi5ffv2OAslieMLsG+m2DybT2QuzEQOsF5SUqJfvXo1yc2l6Xn6rgSRSCSEc+fOhVeuXLmwoqJixvTp0wcWLFgQ7unpudHR0dF97ty5z/fu3XseQJh5adjeerquy5ZlCalUivh8Pt8HH3ywzOPxyD09PZ81NjZ+2NnZaQEQx40b54vFYqaqquEVK1b4a2tr/WvWrDn18ssv144fP36SqqoD69ev371nz57rDLwAwHHkyJGfjRs3rtowDOv06dOnu7q6rs6bN2/s7Nmz9zIjDKenWoFZKg/AlMLCwl82Nzf/m3LX22+/fXb06NF/ALC8u7u7m6ZdkUhksL29/UpLS0vzunXrVgAoBzAaQBGAiY2NjUui0ei1RCLRFwwG/9PX19cVi8WCqqoOdHd3HysrK6sDMCccDl8IBoOtiqIsOnbs2D+i0eiV3t7ez8Ph8GeRSKRT07TB/v7+i1OnTp0HYBqABzs7O/+paVo0Fot1RyKRi/F4/Gp/f39XIpHoZnoUMn6wU+ZtRDaymwmxZFk2AWjvvvvuJ/F4PMn/n5+fn1VeXu6fOXNmbU1NzUOM4Bz8QqIoyg6HwxuLxfq3bdu2a+vWrW/09/dfKy0tffDVV199BEC20+n0ud3uQgBup9Pp83g8JYqieE+ePPnxxo0bt33xxRen8/Ly7n3hhRcWASh47bXX5pWVldWFw+GuXbt27XjzzTd3BoPBDq/XG1AUZRRHmAKPVfqaoKkgCCkA+oYNG84Eg0FHTU1N5ezZs8eWlJQ4CSF8/LvZYhJPQoQQpFKpwcrKyo1su9HBwUF99erVv588eXINgOOmacIwDEopdaZSKUIpxYkTJz6sr68/BMBav379RcMwZk2aNOl+AP+qq6t7xDTNVEVFxR+j0WgSAJk4ceKlTz/9tNzpdHpZvIvpjVW6pykhhBJCbkvwgiAQQogEQL558ybdtGlTsLm5OWJZdxZmlmWll5OUEEJN0zSGhob6GcOrALSzZ8/2apqWcLlc2axGACNRkRAimqaph0Kh68xIwwB0y7IMSZKcABz5+fkl8Xj8y2g0apOb5na7rYGBgS/JV54Q0qpAAoBKaS0jBWClg1ZVFeFw2AlgVF1dXeDpp5+eWVFRUVpcXOzgvQwAbrcbDJhdudlGpKZpGtx6JCcnRxIEQbQsS2PjbjM+AMvlchnMSBaXkr7ymCCIhmEYfMoVRVESBEHI0CaTTNubssUsQRBuubCtra33pZdeCk6YMCGwZs2aipqaGn9paWmuJEl3JP0bN258eeTIkRMABrm0YomiaImiKGVlZeWxLecAgBkzZvgdDkfWjRs3ggA0bpfpoiiahBCqKEqKAy2yULMA6MlkMp6Xl3cP1x2SWCwmFhQU+CmlFhfHNFOevpX4LcvSJUkyAeDQoUOh119//fpTTz01Zf78+UWBQCBHUZQ7yE/TNGPfvn0n33vvvSP79+//BECMeZsCMGRZNgRBgNPpHHXx4sVVDQ0Nf1+wYMGYJ554YikAevDgwUMA4oIgQJZlSggZdDqdBiGEZGdn6ww0tQlJURTT4/EMHz9+/MCjjz7622AwuHbZsmVbiouLvWvXrm1wOp3ZqVRqaKQTIInf1gAMl8ulU0q1CxcuBGOxmL5u3bryQCDgycrKEjORXGtra8eOHTsOHz169OyVK1cuA+hlRYrGlNRkWR7UNO2mYRiaz+cb3dLS8gYhhOi6Hj116tSOVatWHQNALcsaME0zLghClBDSZ9+zQsZ2SoJS2udwOKLPPffcvsrKyrJAIPDQ/v37txiGofX19V3r7e29UlBQMHqEVpjwnrYA6PF4PK6q6s2qqqqpZWVlitvtljOB7enpiWzbtu3wgQMHTre1tV0E0MeKkkGuIhMAqHv37u30er3Px+NxlyiKygMPPOAnhFiXLl0Kbd68uYPNsXbu3Lk6mUwaqqr2btmyZUdtbe3hd955pwvAEFNcO3jw4K/b2tqiqqpGIpGI4/HHH/9rQ0PDCa/XOyoSidDLly8PNTU1PcZ4QuNK1ju6NYHFRAGASXPnzv1Fa2vrxzTDpapqateuXR/Nnz+/SVGUhwFMBzCBFSLZLF75DsrJGpXRAH4EIABgPIBxAEoBFAPwARjFif1sNzZ25+VlOhaxufcCqAFQC+BhAPVLliz5XSqVUkOhUAuAKWnFyR3dlsw+fg+A+8eMGfPzTZs2bY9GozEb8JkzZ9qXLl36l+Li4l8B+AmAyQDGsGrOzfXNPGPawG2l85jksmcPm+vihH+2W1iF3bvZPN+sWbPuGx4eDrW3t+85fvz41o6OjmZN04Y0TYvV19cvYIbN5QqUjG2mwj5YAqDK4XDMe+aZZ55vbW09+sorr2yuqqpqYFatAuBn3uB7XzJCY297XeaUd2RoGzOJmHb6IjFj5D777LP3DQwMfDw8PBxSVbUvkUj0hEKhj1588cXH2O7zMSPdplumoxveMx5Zlj3jx4/39vb26gMDA4MsvgYZo+p8Pr7LqQX5Ds/U7d0jFxUVZS1atKg4Nzc317Isp67rZldXV6y5ufkmI78hFtcmrx8ZweMit6XsUs4+6kmlgbW+peLf9gyMZNCR374G0y/FxEzX8b/8+bkXEBxKFwAAAABJRU5ErkJggg==",_.tileXYToQuadKey=function(e,t,i){for(var r="",n=i;n>=0;--n){var o=1<<n,a=0;0!==(e&o)&&(a|=1),0!==(t&o)&&(a|=2),r+=a}return r},_.quadKeyToTileXY=function(e){for(var t=0,i=0,r=e.length-1,n=r;n>=0;--n){var o=1<<n,a=+e[r-n];0!==(1&a)&&(t|=o),0!==(2&a)&&(i|=o)}return{x:t,y:i,level:r}};var S=new c;return _}),i("Scene/CullingVolume",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Intersect","../Core/Plane"],function(e,t,i,r,n,o){"use strict";function a(e){this.planes=t(e,[])}var s=new o(new e,0);return a.prototype.computeVisibility=function(e){for(var t=this.planes,i=!1,r=0,a=t.length;a>r;++r){var l=e.intersectPlane(o.fromCartesian4(t[r],s));if(l===n.OUTSIDE)return n.OUTSIDE;l===n.INTERSECTING&&(i=!0)}return i?n.INTERSECTING:n.INSIDE},a.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===a.MASK_OUTSIDE||t===a.MASK_INSIDE)return t;for(var i=a.MASK_INSIDE,r=this.planes,l=0,u=r.length;u>l;++l){var c=31>l?1<<l:0;if(!(31>l&&0===(t&c))){var h=e.intersectPlane(o.fromCartesian4(r[l],s));if(h===n.OUTSIDE)return a.MASK_OUTSIDE;h===n.INTERSECTING&&(i|=c)}}return i},a.MASK_OUTSIDE=4294967295,a.MASK_INSIDE=0,a.MASK_INDETERMINATE=2147483647,a}),i("Scene/PerspectiveOffCenterFrustum",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","./CullingVolume"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(){this.left=void 0,this._left=void 0,this.right=void 0,this._right=void 0,this.top=void 0,this._top=void 0,this.bottom=void 0,this._bottom=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far,this._cullingVolume=new l,this._perspectiveMatrix=new s,this._infinitePerspective=new s}function c(e){var t=e.top,i=e.bottom,r=e.right,n=e.left,o=e.near,a=e.far;(t!==e._top||i!==e._bottom||n!==e._left||r!==e._right||o!==e._near||a!==e._far)&&(e._left=n,e._right=r,e._top=t,e._bottom=i,e._near=o,e._far=a,e._perspectiveMatrix=s.computePerspectiveOffCenter(n,r,i,t,o,a,e._perspectiveMatrix),e._infinitePerspective=s.computeInfinitePerspectiveOffCenter(n,r,i,t,o,e._infinitePerspective))}o(u.prototype,{projectionMatrix:{get:function(){return c(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return c(this),this._infinitePerspective}}});var h=new t,d=new t,m=new t,p=new t;return u.prototype.computeCullingVolume=function(e,r,o){var a=this._cullingVolume.planes,s=this.top,l=this.bottom,u=this.right,c=this.left,f=this.near,v=this.far,g=t.cross(r,o,h),_=d;t.multiplyByScalar(r,f,_),t.add(e,_,_);var y=m;t.multiplyByScalar(r,v,y),t.add(e,y,y);var C=p;t.multiplyByScalar(g,c,C),t.add(_,C,C),t.subtract(C,e,C),t.normalize(C,C),t.cross(C,o,C);var E=a[0];return n(E)||(E=a[0]=new i),E.x=C.x,E.y=C.y,E.z=C.z,E.w=-t.dot(C,e),t.multiplyByScalar(g,u,C),t.add(_,C,C),t.subtract(C,e,C),t.normalize(C,C),t.cross(o,C,C),E=a[1],n(E)||(E=a[1]=new i),E.x=C.x,E.y=C.y,E.z=C.z,E.w=-t.dot(C,e),t.multiplyByScalar(o,l,C),t.add(_,C,C),t.subtract(C,e,C),t.normalize(C,C),t.cross(g,C,C),E=a[2],n(E)||(E=a[2]=new i),E.x=C.x,E.y=C.y,E.z=C.z,E.w=-t.dot(C,e),t.multiplyByScalar(o,s,C),t.add(_,C,C),t.subtract(C,e,C),t.normalize(C,C),t.cross(C,g,C),E=a[3],n(E)||(E=a[3]=new i),E.x=C.x,E.y=C.y,E.z=C.z,E.w=-t.dot(C,e),E=a[4],n(E)||(E=a[4]=new i),E.x=r.x,E.y=r.y,E.z=r.z,E.w=-t.dot(r,_),t.negate(r,C),E=a[5],n(E)||(E=a[5]=new i),E.x=C.x,E.y=C.y,E.z=C.z,E.w=-t.dot(C,y),this._cullingVolume},u.prototype.getPixelDimensions=function(e,t,i,r){c(this);var n=1/this.near,o=this.top*n,a=2*i*o/t;o=this.right*n;var s=2*i*o/e;return r.x=s,r.y=a,r},u.prototype.clone=function(e){return n(e)||(e=new u),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e},u.prototype.equals=function(e){return n(e)&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},u}),i("Scene/PerspectiveFrustum",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","./PerspectiveOffCenterFrustum"],function(e,t,i,r){"use strict";function n(){this._offCenterFrustum=new r,this.fov=void 0,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=void 0,this._aspectRatio=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far,this.xOffset=0,this._xOffset=this.xOffset,this.yOffset=0,this._yOffset=this.yOffset}function o(e){var t=e._offCenterFrustum;(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset)&&(e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:2*Math.atan(Math.tan(.5*e.fov)/e.aspectRatio),e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset,t.top=e.near*Math.tan(.5*e._fovy),t.bottom=-t.top,t.right=e.aspectRatio*t.top,t.left=-t.right,t.near=e.near,t.far=e.far,t.right+=e.xOffset,t.left+=e.xOffset,t.top+=e.yOffset,t.bottom+=e.yOffset)}return t(n.prototype,{projectionMatrix:{get:function(){return o(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return o(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return o(this),this._fovy}},sseDenominator:{get:function(){return o(this),this._sseDenominator}}}),n.prototype.computeCullingVolume=function(e,t,i){return o(this),this._offCenterFrustum.computeCullingVolume(e,t,i)},n.prototype.getPixelDimensions=function(e,t,i,r){return o(this),this._offCenterFrustum.getPixelDimensions(e,t,i,r)},n.prototype.clone=function(t){return e(t)||(t=new n),t.aspectRatio=this.aspectRatio,t.fov=this.fov,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._fov=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},n.prototype.equals=function(t){return e(t)?(o(this),o(t),this.fov===t.fov&&this.aspectRatio===t.aspectRatio&&this.near===t.near&&this.far===t.far&&this._offCenterFrustum.equals(t._offCenterFrustum)):!1},n}),i("Scene/CameraFlightPath",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/EasingFunction","../Core/Math","./PerspectiveFrustum","./PerspectiveOffCenterFrustum","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e,t,i){var r,n,o;if(e instanceof l){var a=Math.tan(.5*e.fovy);return r=e.near,n=e.near*a,o=e.aspectRatio*n,Math.max(t*r/o,i*r/n)}return e instanceof u?(r=e.near,n=e.top,o=e.right,Math.max(t*r/o,i*r/n)):Math.max(t,i)}function d(e,i,r,o,a){var l,u=a;if(!n(a)){var c=e.position,d=i,m=e.up,p=e.right,f=e.frustum,v=t.subtract(c,d,C),g=t.magnitude(t.multiplyByScalar(m,t.dot(v,m),E)),_=t.magnitude(t.multiplyByScalar(p,t.dot(v,p),E));l=Math.max(r,o),u=Math.min(.2*h(f,g,_),1e9)}if(n(a)&&u>a||u>l){var y=8,S=1e6,w=-Math.pow((u-r)*S,1/y),T=Math.pow((u-o)*S,1/y);return function(e){var t=e*(T-w)+w;return-Math.pow(t,y)/S+u}}return function(e){return s.lerp(r,o,e)}}function m(e,t){return s.equalsEpsilon(e,s.TWO_PI,s.EPSILON11)&&(e=0),t>e+Math.PI?e+=s.TWO_PI:t<e-Math.PI&&(e-=s.TWO_PI),e}function p(i,r,n,o,a,l,u){function c(t){var i=t.time/r;h.setView({orientation:{heading:s.lerp(v,o,i),pitch:s.lerp(f,a,i),roll:s.lerp(g,l,i)}}),e.lerp(p,n,i,h.position),h.position.z=_(i)}var h=i.camera,p=t.clone(h.position,S),f=h.pitch,v=m(h.heading,o),g=m(h.roll,l),_=d(h,n,p.z,n.z,u);return c}function f(e,r,n,o,a,l,u){function c(e){var i=e.time/r,n=t.fromRadians(s.lerp(v.longitude,C.longitude,i),s.lerp(v.latitude,C.latitude,i),S(i));h.setView({destination:n,orientation:{heading:s.lerp(_,o,i),pitch:s.lerp(g,a,i),roll:s.lerp(y,l,i)}})}var h=e.camera,p=e.mapProjection,f=p.ellipsoid,v=i.clone(h.positionCartographic,w),g=h.pitch,_=m(h.heading,o),y=m(h.roll,l),C=f.cartesianToCartographic(n,T);C.height<=0&&(C.height=v.height),v.longitude=s.zeroToTwoPi(v.longitude),C.longitude=s.zeroToTwoPi(C.longitude);var E=v.longitude-C.longitude;E<-s.PI?v.longitude+=s.TWO_PI:E>s.PI&&(C.longitude+=s.TWO_PI);var S=d(h,n,v.height,C.height,u);return c}function v(i,r,n,o,a,l,u){function c(t){var i=t.time/r;h.setView({orientation:{heading:s.lerp(f,o,i)}}),e.lerp(p,n,i,h.position);var a=g(i),l=h.frustum,u=l.top/l.right,c=.5*(a-(l.right-l.left));l.right+=c,l.left-=c,l.top=u*l.right,l.bottom=-l.top}var h=i.camera,p=t.clone(h.position,S),f=m(h.heading,o),v=h.frustum.right-h.frustum.left,g=d(h,n,v,n.z,u);return c}function g(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function _(e,t){function i(){"function"==typeof t&&t(),e.enableInputs=!0}return i}var y={},C=new t,E=new t,S=new t,w=new i,T=new i,x=new i,b=new t;return y.createTween=function(i,o){o=r(o,r.EMPTY_OBJECT);var l=o.destination,u=i.mode;if(u===c.MORPHING)return g();var h=r(o.convert,!0),d=i.mapProjection,m=d.ellipsoid,y=o.maximumHeight,C=o.easingFunction;h&&u!==c.SCENE3D&&(m.cartesianToCartographic(l,x),l=d.project(x,b));var E=i.camera,S=o.endTransform;n(S)&&E._setTransform(S);var w=o.duration;n(w)||(w=Math.ceil(t.distance(E.position,l)/1e6)+2,w=Math.min(w,3));var T=o.startTime;n(T)||(T=0);var A=r(o.heading,0),P=r(o.pitch,-s.PI_OVER_TWO),I=r(o.roll,0),M=i.screenSpaceCameraController;M.enableInputs=!1;var D=_(M,o.complete),R=_(M,o.cancel),O=E.frustum,N=i.mode===c.SCENE2D;if(N=N&&e.equalsEpsilon(E.position,l,s.EPSILON6),N=N&&s.equalsEpsilon(Math.max(O.right-O.left,O.top-O.bottom),l.z,s.EPSILON6),N=N||i.mode!==c.SCENE2D&&t.equalsEpsilon(l,E.position,s.EPSILON10),N=N&&s.equalsEpsilon(s.negativePiToPi(A),s.negativePiToPi(E.heading),s.EPSILON10)&&s.equalsEpsilon(s.negativePiToPi(P),s.negativePiToPi(E.pitch),s.EPSILON10)&&s.equalsEpsilon(s.negativePiToPi(I),s.negativePiToPi(E.roll),s.EPSILON10))return g(D,R);var L=new Array(4);if(L[c.SCENE2D]=v,L[c.SCENE3D]=f,L[c.COLUMBUS_VIEW]=p,0>=w){var F=function(){var e=L[u](i,1,l,A,P,I,y);e({time:1}),"function"==typeof D&&D()};return g(F,R)}var B=L[u](i,w,l,A,P,I,y);if(!n(C)){var V=E.positionCartographic.height,k=u===c.SCENE3D?m.cartesianToCartographic(l).height:l.z;C=V>k&&V>11500?a.CUBIC_OUT:a.QUINTIC_IN_OUT}return{duration:w,easingFunction:C,startObject:{time:T},stopObject:{time:w},update:B,complete:D,cancel:R}},y}),i("Scene/Camera",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/EasingFunction","../Core/Ellipsoid","../Core/EllipsoidGeodesic","../Core/Event","../Core/HeadingPitchRange","../Core/IntersectionTests","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/Ray","../Core/Rectangle","../Core/Transforms","./CameraFlightPath","./PerspectiveFrustum","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S,w){"use strict";function T(e){this._scene=e,this._transform=v.clone(v.IDENTITY),this._invTransform=v.clone(v.IDENTITY),this._actualTransform=v.clone(v.IDENTITY),this._actualInvTransform=v.clone(v.IDENTITY),this._transformChanged=!1,this.position=new t,this._position=new t,this._positionWC=new t,this._positionCartographic=new r,this.direction=new t,this._direction=new t,this._directionWC=new t,this.up=new t,this._up=new t,this._upWC=new t,this.right=new t,this._right=new t,this._rightWC=new t,this.frustum=new S,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=p.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumTranslateFactor=1.5,this.maximumZoomFactor=2.5,this._moveStart=new h,this._moveEnd=new h,this._viewMatrix=new v,this._invViewMatrix=new v,x(this),this._mode=w.SCENE3D,this._modeChanged=!0;var i=e.mapProjection;this._projection=i,this._maxCoord=i.project(new r(Math.PI,p.PI_OVER_TWO)),this._max2Dfrustum=void 0,W(this,T.DEFAULT_VIEW_RECTANGLE,this.position,!0);var n=t.magnitude(this.position);n+=n*T.DEFAULT_VIEW_FACTOR,t.normalize(this.position,this.position),t.multiplyByScalar(this.position,n,this.position)}function x(e){var i=e._right,r=e._up,n=e._direction,o=e._position,a=e._viewMatrix;a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-t.dot(i,o),a[13]=-t.dot(r,o),a[14]=t.dot(n,o),a[15]=1,v.multiply(a,e._actualInvTransform,e._viewMatrix),v.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function b(e){var r=e._projection,n=r.ellipsoid,o=v.getColumn(e._transform,3,ae),a=n.cartesianToCartographic(o,re),s=r.project(a,ne),l=se;l.x=s.z,l.y=s.x,l.z=s.y,l.w=1;var u=i.add(v.getColumn(e._transform,0,oe),o,oe);n.cartesianToCartographic(u,a),r.project(a,s);var c=le;c.x=s.z,c.y=s.x,c.z=s.y,c.w=0,t.subtract(c,l,c);var h=i.add(v.getColumn(e._transform,1,oe),o,oe);n.cartesianToCartographic(h,a),r.project(a,s);var d=ue;d.x=s.z,d.y=s.x,d.z=s.y,d.w=0,t.subtract(d,l,d);var m=ce;t.cross(c,d,m),t.normalize(m,m),t.cross(d,m,c),t.normalize(c,c),t.cross(m,c,d),t.normalize(d,d),v.setColumn(e._actualTransform,0,c,e._actualTransform),v.setColumn(e._actualTransform,1,d,e._actualTransform),v.setColumn(e._actualTransform,2,m,e._actualTransform),v.setColumn(e._actualTransform,3,l,e._actualTransform)}function A(e){var r=e._projection,n=r.ellipsoid,o=v.getColumn(e._transform,3,ae),a=n.cartesianToCartographic(o,re),s=r.project(a,ne),l=se;l.x=s.z,l.y=s.x,l.z=s.y,l.w=1;var u=i.clone(i.UNIT_X,ce),c=i.add(v.getColumn(e._transform,0,oe),o,oe);n.cartesianToCartographic(c,a),r.project(a,s);var h=le;h.x=s.z,h.y=s.x,h.z=s.y,h.w=0,t.subtract(h,l,h),h.x=0;var d=ue;if(t.magnitudeSquared(h)>p.EPSILON10)t.cross(u,h,d);else{var m=i.add(v.getColumn(e._transform,1,oe),o,oe);n.cartesianToCartographic(m,a),r.project(a,s),d.x=s.z,d.y=s.x,d.z=s.y,d.w=0,t.subtract(d,l,d),d.x=0,t.magnitudeSquared(d)<p.EPSILON10&&(i.clone(i.UNIT_Y,h),i.clone(i.UNIT_Z,d))}t.cross(d,u,h),t.normalize(h,h),t.cross(u,h,d),t.normalize(d,d),v.setColumn(e._actualTransform,0,h,e._actualTransform),v.setColumn(e._actualTransform,1,d,e._actualTransform),v.setColumn(e._actualTransform,2,u,e._actualTransform),v.setColumn(e._actualTransform,3,l,e._actualTransform)}function P(e){var i=e._mode,r=!1,n=0;i===w.SCENE2D&&(n=e.frustum.right-e.frustum.left,r=n!==e._positionCartographic.height);var o=e._position,a=!t.equals(o,e.position)||r;a&&(o=t.clone(e.position,e._position));var s=e._direction,l=!t.equals(s,e.direction);l&&(s=t.clone(e.direction,e._direction));var u=e._up,c=!t.equals(u,e.up);c&&(u=t.clone(e.up,e._up));var h=e._right,d=!t.equals(h,e.right);d&&(h=t.clone(e.right,e._right));var m=e._transformChanged||e._modeChanged;e._transformChanged=!1,m&&(v.inverseTransformation(e._transform,e._invTransform),e._mode===w.COLUMBUS_VIEW||e._mode===w.SCENE2D?v.equals(v.IDENTITY,e._transform)?v.clone(T.TRANSFORM_2D,e._actualTransform):e._mode===w.COLUMBUS_VIEW?b(e):A(e):v.clone(e._transform,e._actualTransform),v.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);var f=e._actualTransform;if(a||m)if(e._positionWC=v.multiplyByPoint(f,o,e._positionWC),i===w.SCENE3D||i===w.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{var g=he;g.x=e._positionWC.y,g.y=e._positionWC.z,g.z=e._positionWC.x,i===w.SCENE2D&&(g.z=n),e._projection.unproject(g,e._positionCartographic)}if(l||c||d){var _=t.dot(s,t.cross(u,h,he));if(Math.abs(1-_)>p.EPSILON2){s=t.normalize(s,e._direction),t.clone(s,e.direction);var y=1/t.magnitudeSquared(u),C=t.dot(u,s)*y,E=t.multiplyByScalar(s,C,he);u=t.normalize(t.subtract(u,E,e._up),e._up),t.clone(u,e.up),h=t.cross(s,u,e._right),t.clone(h,e.right)}}(l||m)&&(e._directionWC=v.multiplyByPointAsVector(f,s,e._directionWC)),(c||m)&&(e._upWC=v.multiplyByPointAsVector(f,u,e._upWC)), +(d||m)&&(e._rightWC=v.multiplyByPointAsVector(f,h,e._rightWC)),(a||l||c||d||m)&&x(e)}function I(e,t){var i;return i=p.equalsEpsilon(Math.abs(e.z),1,p.EPSILON3)?Math.atan2(t.y,t.x)-p.PI_OVER_TWO:Math.atan2(e.y,e.x)-p.PI_OVER_TWO,p.TWO_PI-p.zeroToTwoPi(i)}function M(e){return p.PI_OVER_TWO-p.acosClamped(e.z)}function D(e,t,i){var r=0;return p.equalsEpsilon(Math.abs(e.z),1,p.EPSILON3)||(r=Math.atan2(-i.z,t.z),r=p.zeroToTwoPi(r+p.TWO_PI)),r}function R(e,i,r,n,o){var a=v.clone(e.transform,_e),s=C.eastNorthUpToFixedFrame(i,e._projection.ellipsoid,ye);e._setTransform(s),t.clone(t.ZERO,e.position);var l=g.fromHeadingPitchRoll(r-p.PI_OVER_TWO,n,o,Ce),u=f.fromQuaternion(l,Ee);f.getColumn(u,0,e.direction),f.getColumn(u,2,e.up),t.cross(e.direction,e.up,e.right),e._setTransform(a)}function O(e,i,r,n,o,a){var s=v.clone(e.transform,_e);if(e._setTransform(v.IDENTITY),!t.equals(i,e.positionWC)){if(a){var l=e._projection,u=l.ellipsoid.cartesianToCartographic(i,Se);i=l.project(u,ge)}t.clone(i,e.position)}var c=g.fromHeadingPitchRoll(r-p.PI_OVER_TWO,n,o,Ce),h=f.fromQuaternion(c,Ee);f.getColumn(h,0,e.direction),f.getColumn(h,2,e.up),t.cross(e.direction,e.up,e.right),e._setTransform(s)}function N(i,r,n,o){var a=-p.PI_OVER_TWO,s=0,l=v.clone(i.transform,_e);if(i._setTransform(v.IDENTITY),!t.equals(r,i.positionWC)){if(o){var u=i._projection,c=u.ellipsoid.cartesianToCartographic(r,Se);r=u.project(c,ge)}e.clone(r,i.position);var h=.5*-r.z,d=-h,m=i.frustum;if(d>h){var _=m.top/m.right;m.right=d,m.left=h,m.top=m.right*_,m.bottom=-m.top}}var y=g.fromHeadingPitchRoll(n-p.PI_OVER_TWO,a,s,Ce),C=f.fromQuaternion(y,Ee);f.getColumn(C,2,i.up),t.cross(i.direction,i.up,i.right),i._setTransform(l)}function L(e,i,r,n){var o=t.clone(r.direction,we),a=t.clone(r.up,Te);if(e._scene.mode===w.SCENE3D){var s=e._projection.ellipsoid,l=C.eastNorthUpToFixedFrame(i,s,de),u=v.inverseTransformation(l,me);v.multiplyByPointAsVector(u,o,o),v.multiplyByPointAsVector(u,a,a)}var c=t.cross(o,a,xe);return n.heading=I(o,a),n.pitch=M(o),n.roll=D(o,a,c),n}function F(e,t){var i=e._maxCoord.x*e.maximumTranslateFactor;t.x>i&&(t.x=i),t.x<-i&&(t.x=-i);var r=e._maxCoord.y*e.maximumTranslateFactor;t.y>r&&(t.y=r),t.y<-r&&(t.y=-r)}function B(e,i){var r=e.position,n=t.normalize(r,Re);if(o(e.constrainedAxis)){var a=t.equalsEpsilon(n,e.constrainedAxis,p.EPSILON2),s=t.equalsEpsilon(n,t.negate(e.constrainedAxis,Le),p.EPSILON2);if(a||s)(a&&0>i||s&&i>0)&&e.rotate(e.right,i);else{var l=t.normalize(e.constrainedAxis,Oe),u=t.dot(n,l),c=p.acosClamped(u);i>0&&i>c&&(i=c-p.EPSILON4),u=t.dot(n,t.negate(l,Le)),c=p.acosClamped(u),0>i&&-i>c&&(i=-c+p.EPSILON4);var h=t.cross(l,n,Ne);e.rotate(h,i)}}else e.rotate(e.right,i)}function V(e,t){o(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function k(e,t){var i=e.frustum;t=.5*t;var r=i.right-t,n=i.left+t,o=e._maxCoord.x*e.maximumZoomFactor;r>o&&(r=o,n=-o),n>=r&&(r=1,n=-1);var a=i.top/i.right;i.right=r,i.left=n,i.top=i.right*a,i.bottom=-i.top}function z(e,t){e.move(e.direction,t)}function U(e,i,r){i=p.clamp(i,-p.PI_OVER_TWO,p.PI_OVER_TWO),e=p.zeroToTwoPi(e)-p.PI_OVER_TWO;var n=g.fromAxisAngle(t.UNIT_Y,-i,Ve),o=g.fromAxisAngle(t.UNIT_Z,-e,ke),a=g.multiply(o,n,o),s=f.fromQuaternion(a,ze),l=t.clone(t.UNIT_X,Be);return f.multiplyByVector(s,l,l),t.negate(l,l),t.multiplyByScalar(l,r,l),l}function G(e,i,r,n){var o=Math.abs(t.dot(i,r));return o/n-t.dot(e,r)}function W(e,i,r,n){var a=e._projection.ellipsoid,s=n?e:Je,l=i.north,u=i.south,h=i.east,d=i.west;d>h&&(h+=p.TWO_PI);var m,f=.5*(d+h);if(u<-p.PI_OVER_TWO+p.RADIANS_PER_DEGREE&&l>p.PI_OVER_TWO-p.RADIANS_PER_DEGREE)m=0;else{var v=Ge;v.longitude=f,v.latitude=l,v.height=0;var g=We;g.longitude=f,g.latitude=u,g.height=0;var _=Ue;o(_)&&_.ellipsoid===a||(Ue=_=new c(void 0,void 0,a)),_.setEndPoints(v,g),m=_.interpolateUsingFraction(.5,Ge).latitude}var y=Ge;y.longitude=f,y.latitude=m,y.height=0;var C=a.cartographicToCartesian(y,Ke),E=Ge;E.longitude=h,E.latitude=l;var S=a.cartographicToCartesian(E,He);E.longitude=d;var w=a.cartographicToCartesian(E,je);E.longitude=f;var T=a.cartographicToCartesian(E,Xe);E.latitude=u;var x=a.cartographicToCartesian(E,Ze);E.longitude=h;var b=a.cartographicToCartesian(E,Ye);E.longitude=d;var A=a.cartographicToCartesian(E,qe);t.subtract(w,C,w),t.subtract(b,C,b),t.subtract(S,C,S),t.subtract(A,C,A),t.subtract(T,C,T),t.subtract(x,C,x);var P=a.geodeticSurfaceNormal(C,s.direction);t.negate(P,P);var I=t.cross(P,t.UNIT_Z,s.right);t.normalize(I,I);var M=t.cross(I,P,s.up),D=Math.tan(.5*e.frustum.fovy),R=e.frustum.aspectRatio*D,O=Math.max(G(P,M,w,D),G(P,M,b,D),G(P,M,S,D),G(P,M,A,D),G(P,M,T,D),G(P,M,x,D),G(P,I,w,R),G(P,I,b,R),G(P,I,S,R),G(P,I,A,R),G(P,I,T,R),G(P,I,x,R));if(0>u&&l>0){var N=Ge;N.longitude=d,N.latitude=0,N.height=0;var L=a.cartographicToCartesian(N,Qe);t.subtract(L,C,L),O=Math.max(O,G(P,M,L,D),G(P,I,L,R)),N.longitude=h,L=a.cartographicToCartesian(N,Qe),t.subtract(L,C,L),O=Math.max(O,G(P,M,L,D),G(P,I,L,R))}return t.add(C,t.multiplyByScalar(P,-O,Qe),r)}function H(e,t,i){var r=e._projection;t.west>t.east&&(t=y.MAX_VALUE);var n=e._actualTransform,o=e._actualInvTransform,a=$e;a.longitude=t.east,a.latitude=t.north;var s=r.project(a,et);v.multiplyByPoint(n,s,s),v.multiplyByPoint(o,s,s),a.longitude=t.west,a.latitude=t.south;var l=r.project(a,tt);v.multiplyByPoint(n,l,l),v.multiplyByPoint(o,l,l);var u=Math.tan(.5*e.frustum.fovy),c=e.frustum.aspectRatio*u;return i.x=.5*(s.x-l.x)+l.x,i.y=.5*(s.y-l.y)+l.y,i.z=.5*Math.max((s.x-l.x)/c,(s.y-l.y)/u),i}function q(e,t,i){var r=e._projection;t.west>t.east&&(t=y.MAX_VALUE);var n=it;n.longitude=t.east,n.latitude=t.north;var o=r.project(n,rt);n.longitude=t.west,n.latitude=t.south;var a,s,l=r.project(n,nt),u=.5*Math.abs(o.x-l.x),c=.5*Math.abs(o.y-l.y),h=e.frustum.right/e.frustum.top,d=c*h;return u>d?(a=u,s=a/h):(s=c,a=d),c=Math.max(2*a,2*s),i.x=.5*(o.x-l.x)+l.x,i.y=.5*(o.y-l.y)+l.y,n=r.unproject(i,n),n.height=c,i=r.project(n,i)}function j(e,t,i,r){i=n(i,u.WGS84);var o=e.getPickRay(t,ot),a=m.rayEllipsoid(o,i);if(a){var s=a.start>0?a.start:a.stop;return _.getPoint(o,s,r)}}function Y(e,t,i,r){var n=e.getPickRay(t,at),o=n.origin;o.z=0;var a=i.unproject(o);return a.latitude<-p.PI_OVER_TWO||a.latitude>p.PI_OVER_TWO||a.longitude<-Math.PI||a.longitude>Math.PI?void 0:i.ellipsoid.cartographicToCartesian(a,r)}function X(e,i,r,n){var o=e.getPickRay(i,st),a=-o.origin.x/o.direction.x;_.getPoint(o,a,n);var s=r.unproject(new t(n.y,n.z,0));return s.latitude<-p.PI_OVER_TWO||s.latitude>p.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI?void 0:r.ellipsoid.cartographicToCartesian(s,n)}function Z(e,i,r){var n=e._scene.canvas,o=n.clientWidth,a=n.clientHeight,s=Math.tan(.5*e.frustum.fovy),l=e.frustum.aspectRatio*s,u=e.frustum.near,c=2/o*i.x-1,h=2/a*(a-i.y)-1,d=e.positionWC;t.clone(d,r.origin);var m=t.multiplyByScalar(e.directionWC,u,lt);t.add(d,m,m);var p=t.multiplyByScalar(e.rightWC,c*u*l,ut),f=t.multiplyByScalar(e.upWC,h*u*s,ct),v=t.add(m,p,r.direction);return t.add(v,f,v),t.subtract(v,d,v),t.normalize(v,v),r}function K(e,i,r){var n=e._scene.canvas,o=n.clientWidth,a=n.clientHeight,s=2/o*i.x-1;s*=.5*(e.frustum.right-e.frustum.left);var l=2/a*(a-i.y)-1;l*=.5*(e.frustum.top-e.frustum.bottom);var u=r.origin;return t.clone(e.position,u),t.multiplyByScalar(e.right,s,ht),t.add(ht,u,u),t.multiplyByScalar(e.up,l,ht),t.add(ht,u,u),t.clone(e.directionWC,r.direction),r}function Q(e,i){var r=e.position,n=r.x<-e._maxCoord.x||r.x>e._maxCoord.x,o=r.y<-e._maxCoord.y||r.y>e._maxCoord.y,a=n||o,s=e.frustum,u=s.top,c=s.bottom,h=s.right,d=s.left,m=e._max2Dfrustum,f=h>e._max2Dfrustum.right;if(a||f){var v=t.clone(r);v.x>e._maxCoord.x?v.x=e._maxCoord.x:v.x<-e._maxCoord.x&&(v.x=-e._maxCoord.x),v.y>e._maxCoord.y?v.y=e._maxCoord.y:v.y<-e._maxCoord.y&&(v.y=-e._maxCoord.y);var g=function(i){a&&(e.position=t.lerp(r,v,i.time,e.position)),f&&(e.frustum.top=p.lerp(u,m.top,i.time),e.frustum.bottom=p.lerp(c,m.bottom,i.time),e.frustum.right=p.lerp(h,m.right,i.time),e.frustum.left=p.lerp(d,m.left,i.time))};return{easingFunction:l.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:i,update:g}}}function J(e,i,r,n,o,a){function s(r){var n=t.lerp(i,u,r.time,new t);e.worldToCameraCoordinatesPoint(n,e.position)}var u=t.clone(i);return r.y>n?u.y-=r.y-n:r.y<-n&&(u.y+=-n-r.y),r.z>o?u.z-=r.z-o:r.z<-o&&(u.z+=-o-r.z),{easingFunction:l.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:a,update:s}}function $(e,i){var r=e.position,n=e.direction,o=e.worldToCameraCoordinatesVector(t.UNIT_X,ft),a=-t.dot(o,r)/t.dot(o,n),s=t.add(r,t.multiplyByScalar(n,a,vt),vt);e.cameraToWorldCoordinatesPoint(s,s),r=e.cameraToWorldCoordinatesPoint(e.position,gt);var l=Math.tan(.5*e.frustum.fovy),u=e.frustum.aspectRatio*l,c=t.magnitude(t.subtract(r,s,_t)),h=u*c,d=l*c,m=e._maxCoord.x,p=e._maxCoord.y,f=Math.max(h-m,m),v=Math.max(d-p,p);if(r.z<-f||r.z>f||r.y<-v||r.y>v){var g=s.y<-f||s.y>f,_=s.z<-v||s.z>v;if(g||_)return J(e,r,s,f,v,i)}}function ee(e,t){var i=e.frustum,r=Math.tan(.5*i.fovy),n=i.aspectRatio*r;return Math.max(t/n,t/r)}function te(e,t){var i,r,n=e.frustum,o=n.right/n.top,a=t*o;return t>a?(i=t,r=i/o):(r=t,i=a),1.5*Math.max(i,r)}function ie(e,t,i){o(i)||(i=d.clone(Et));var r=i.range;if(!o(r)||0===r){var n=t.radius;0===n?i.range=St:i.range=e._mode===w.SCENE2D?te(e,n):ee(e,n)}return i}T.TRANSFORM_2D=new v(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),T.TRANSFORM_2D_INVERSE=v.inverseTransformation(T.TRANSFORM_2D,new v),T.DEFAULT_VIEW_RECTANGLE=y.fromDegrees(-95,-20,-70,90),T.DEFAULT_VIEW_FACTOR=.5;var re=new r,ne=new t,oe=new t,ae=new i,se=new i,le=new i,ue=new i,ce=new i,he=new t,de=new v,me=new v;a(T.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return P(this),this._invTransform}},viewMatrix:{get:function(){return P(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return P(this),this._invViewMatrix}},positionCartographic:{get:function(){return P(this),this._positionCartographic}},positionWC:{get:function(){return P(this),this._positionWC}},directionWC:{get:function(){return P(this),this._directionWC}},upWC:{get:function(){return P(this),this._upWC}},rightWC:{get:function(){return P(this),this._rightWC}},heading:{get:function(){if(this._mode!==w.MORPHING){var e=this._projection.ellipsoid,t=v.clone(this._transform,de),i=C.eastNorthUpToFixedFrame(this.positionWC,e,me);this._setTransform(i);var r=I(this.direction,this.up);return this._setTransform(t),r}}},pitch:{get:function(){if(this._mode!==w.MORPHING){var e=this._projection.ellipsoid,t=v.clone(this._transform,de),i=C.eastNorthUpToFixedFrame(this.positionWC,e,me);this._setTransform(i);var r=M(this.direction);return this._setTransform(t),r}}},roll:{get:function(){if(this._mode!==w.MORPHING){var e=this._projection.ellipsoid,t=v.clone(this._transform,de),i=C.eastNorthUpToFixedFrame(this.positionWC,e,me);this._setTransform(i);var r=D(this.direction,this.up,this.right);return this._setTransform(t),r}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}}}),T.prototype.update=function(e){var t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==w.MORPHING,t=this._mode===w.SCENE2D),t){var i=this._max2Dfrustum=this.frustum.clone(),r=2,n=i.top/i.right;i.right=this._maxCoord.x*r,i.left=-i.right,i.top=n*i.right,i.bottom=-i.top}};var pe=new t,fe=new t,ve=new t;T.prototype._setTransform=function(e){var i=t.clone(this.positionWC,pe),r=t.clone(this.upWC,fe),n=t.clone(this.directionWC,ve);v.clone(e,this._transform),this._transformChanged=!0,P(this);var o=this._actualInvTransform;v.multiplyByPoint(o,i,this.position),v.multiplyByPointAsVector(o,n,this.direction),v.multiplyByPointAsVector(o,r,this.up),t.cross(this.direction,this.up,this.right),P(this)};var ge=new t,_e=new v,ye=new v,Ce=new g,Ee=new f,Se=new r,we=new t,Te=new t,xe=new t,be={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},endTransform:void 0};T.prototype.setView=function(e){e=n(e,n.EMPTY_OBJECT);var i=n(e.orientation,n.EMPTY_OBJECT),r=this._mode;if(r!==w.MORPHING){o(e.endTransform)&&this._setTransform(e.endTransform);var a=!0,s=n(e.destination,t.clone(this.positionWC,ge));o(s)&&o(s.west)&&(s=this.getRectangleCameraCoordinates(s,ge),a=!1),o(i.direction)&&(i=L(this,s,i,be.orientation));var l=n(i.heading,0),u=n(i.pitch,-p.PI_OVER_TWO),c=n(i.roll,0);r===w.SCENE3D?R(this,s,l,u,c):r===w.SCENE2D?N(this,s,l,a):O(this,s,l,u,c,a)}},T.prototype.worldToCameraCoordinates=function(e,t){return o(t)||(t=new i),P(this),v.multiplyByVector(this._actualInvTransform,e,t)},T.prototype.worldToCameraCoordinatesPoint=function(e,i){return o(i)||(i=new t),P(this),v.multiplyByPoint(this._actualInvTransform,e,i)},T.prototype.worldToCameraCoordinatesVector=function(e,i){return o(i)||(i=new t),P(this),v.multiplyByPointAsVector(this._actualInvTransform,e,i)},T.prototype.cameraToWorldCoordinates=function(e,t){return o(t)||(t=new i),P(this),v.multiplyByVector(this._actualTransform,e,t)},T.prototype.cameraToWorldCoordinatesPoint=function(e,i){return o(i)||(i=new t),P(this),v.multiplyByPoint(this._actualTransform,e,i)},T.prototype.cameraToWorldCoordinatesVector=function(e,i){return o(i)||(i=new t),P(this),v.multiplyByPointAsVector(this._actualTransform,e,i)};var Ae=new t;T.prototype.move=function(e,i){var r=this.position;t.multiplyByScalar(e,i,Ae),t.add(r,Ae,r),this._mode===w.SCENE2D&&F(this,r)},T.prototype.moveForward=function(e){e=n(e,this.defaultMoveAmount),this.move(this.direction,e)},T.prototype.moveBackward=function(e){e=n(e,this.defaultMoveAmount),this.move(this.direction,-e)},T.prototype.moveUp=function(e){e=n(e,this.defaultMoveAmount),this.move(this.up,e)},T.prototype.moveDown=function(e){e=n(e,this.defaultMoveAmount),this.move(this.up,-e)},T.prototype.moveRight=function(e){e=n(e,this.defaultMoveAmount),this.move(this.right,e)},T.prototype.moveLeft=function(e){e=n(e,this.defaultMoveAmount),this.move(this.right,-e)},T.prototype.lookLeft=function(e){e=n(e,this.defaultLookAmount),this.look(this.up,-e)},T.prototype.lookRight=function(e){e=n(e,this.defaultLookAmount),this.look(this.up,e)},T.prototype.lookUp=function(e){e=n(e,this.defaultLookAmount),this.look(this.right,-e)},T.prototype.lookDown=function(e){e=n(e,this.defaultLookAmount),this.look(this.right,e)};var Pe=new g,Ie=new f;T.prototype.look=function(e,t){var i=n(t,this.defaultLookAmount),r=g.fromAxisAngle(e,-i,Pe),o=f.fromQuaternion(r,Ie),a=this.direction,s=this.up,l=this.right;f.multiplyByVector(o,a,a),f.multiplyByVector(o,s,s),f.multiplyByVector(o,l,l)},T.prototype.twistLeft=function(e){e=n(e,this.defaultLookAmount),this.look(this.direction,e)},T.prototype.twistRight=function(e){e=n(e,this.defaultLookAmount),this.look(this.direction,-e)};var Me=new g,De=new f;T.prototype.rotate=function(e,i){var r=n(i,this.defaultRotateAmount),o=g.fromAxisAngle(e,-r,Me),a=f.fromQuaternion(o,De);f.multiplyByVector(a,this.position,this.position),f.multiplyByVector(a,this.direction,this.direction),f.multiplyByVector(a,this.up,this.up),t.cross(this.direction,this.up,this.right),t.cross(this.right,this.direction,this.up)},T.prototype.rotateDown=function(e){e=n(e,this.defaultRotateAmount),B(this,e)},T.prototype.rotateUp=function(e){e=n(e,this.defaultRotateAmount),B(this,-e)};var Re=new t,Oe=new t,Ne=new t,Le=new t;T.prototype.rotateRight=function(e){e=n(e,this.defaultRotateAmount),V(this,-e)},T.prototype.rotateLeft=function(e){e=n(e,this.defaultRotateAmount),V(this,e)},T.prototype.zoomIn=function(e){e=n(e,this.defaultZoomAmount),this._mode===w.SCENE2D?k(this,e):z(this,e)},T.prototype.zoomOut=function(e){e=n(e,this.defaultZoomAmount),this._mode===w.SCENE2D?k(this,-e):z(this,-e)},T.prototype.getMagnitude=function(){return this._mode===w.SCENE3D?t.magnitude(this.position):this._mode===w.COLUMBUS_VIEW?Math.abs(this.position.z):this._mode===w.SCENE2D?Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom):void 0};var Fe=new v;T.prototype.lookAt=function(e,t){var i=C.eastNorthUpToFixedFrame(e,u.WGS84,Fe);this.lookAtTransform(i,t)};var Be=new t,Ve=new g,ke=new g,ze=new f;T.prototype.lookAtTransform=function(i,r){if(this._setTransform(i),o(r)){var n;if(n=o(r.heading)?U(r.heading,r.pitch,r.range):r,this._mode===w.SCENE2D){e.clone(e.ZERO,this.position),t.negate(n,this.up),this.up.z=0,t.magnitudeSquared(this.up)<p.EPSILON10&&t.clone(t.UNIT_Y,this.up),t.normalize(this.up,this.up),this._setTransform(v.IDENTITY),t.negate(t.UNIT_Z,this.direction),t.cross(this.direction,this.up,this.right),t.normalize(this.right,this.right);var a=this.frustum,s=a.top/a.right;return a.right=.5*t.magnitude(n),a.left=-a.right,a.top=s*a.right,a.bottom=-a.top,void this._setTransform(i)}t.clone(n,this.position),t.negate(this.position,this.direction),t.normalize(this.direction,this.direction),t.cross(this.direction,t.UNIT_Z,this.right),t.magnitudeSquared(this.right)<p.EPSILON10&&t.clone(t.UNIT_X,this.right),t.normalize(this.right,this.right),t.cross(this.right,this.direction,this.up),t.normalize(this.up,this.up)}};var Ue,Ge=new r,We=new r,He=new t,qe=new t,je=new t,Ye=new t,Xe=new t,Ze=new t,Ke=new t,Qe=new t,Je={direction:new t,right:new t,up:new t},$e=new r,et=new t,tt=new t,it=new r,rt=new t,nt=new t;T.prototype.getRectangleCameraCoordinates=function(e,i){var r=this._mode;return o(i)||(i=new t),r===w.SCENE3D?W(this,e,i):r===w.COLUMBUS_VIEW?H(this,e,i):r===w.SCENE2D?q(this,e,i):void 0};var ot=new _,at=new _,st=new _;T.prototype.pickEllipsoid=function(e,i,r){if(o(r)||(r=new t),i=n(i,u.WGS84),this._mode===w.SCENE3D)r=j(this,e,i,r);else if(this._mode===w.SCENE2D)r=Y(this,e,this._projection,r);else{if(this._mode!==w.COLUMBUS_VIEW)return;r=X(this,e,this._projection,r)}return r};var lt=new t,ut=new t,ct=new t,ht=new t;T.prototype.getPickRay=function(e,t){o(t)||(t=new _);var i=this.frustum;return o(i.aspectRatio)&&o(i.fov)&&o(i.near)?Z(this,e,t):K(this,e,t)};var dt=new t,mt=new t;T.prototype.distanceToBoundingSphere=function(e){var i=t.subtract(this.positionWC,e.center,dt),r=t.multiplyByScalar(this.directionWC,t.dot(i,this.directionWC),mt);return Math.max(0,t.magnitude(r)-e.radius)};var pt=new e;T.prototype.getPixelSize=function(e,t,i){var r=this.distanceToBoundingSphere(e),n=this.frustum.getPixelDimensions(t,i,r,pt);return Math.max(n.x,n.y)};var ft=new t,vt=new t,gt=new t,_t=new t;T.prototype.createCorrectPositionTween=function(e){return this._mode===w.SCENE2D?Q(this,e):this._mode===w.COLUMBUS_VIEW?$(this,e):void 0};var yt=new t,Ct={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};T.prototype.flyTo=function(e){e=n(e,n.EMPTY_OBJECT);var t=e.destination,i=this._mode;if(i!==w.MORPHING){var r=n(e.orientation,n.EMPTY_OBJECT);if(o(r.direction)&&(r=L(this,t,r,be.orientation)),o(e.duration)&&e.duration<=0){var a=be;return a.destination=e.destination,a.orientation.heading=r.heading,a.orientation.pitch=r.pitch,a.orientation.roll=r.roll,a.endTransform=e.endTransform,this.setView(a),void("function"==typeof e.complete&&e.complete())}var s=o(t.west);s&&(t=this.getRectangleCameraCoordinates(t,yt)),Ct.destination=t,Ct.heading=r.heading,Ct.pitch=r.pitch,Ct.roll=r.roll,Ct.duration=e.duration,Ct.complete=e.complete,Ct.cancel=e.cancel,Ct.endTransform=e.endTransform,Ct.convert=s?!1:e.convert,Ct.maximumHeight=e.maximumHeight,Ct.easingFunction=e.easingFunction,Ct.startTime=e.startTime;var l=this._scene;return l.tweens.add(E.createTween(l,Ct))}};var Et=new d(0,-p.PI_OVER_FOUR,0),St=100;T.prototype.viewBoundingSphere=function(e,t){if(this._mode===w.MORPHING)throw new s("viewBoundingSphere is not supported while morphing.");t=ie(this,e,t),this.lookAt(e.center,t)};var wt=new v,Tt=new t,xt=new t,bt=new t,At=new t,Pt=new i,It=new g,Mt=new f;return T.prototype.flyToBoundingSphere=function(e,i){i=n(i,n.EMPTY_OBJECT);var r=this._mode===w.SCENE2D||this._mode===w.COLUMBUS_VIEW;this._setTransform(v.IDENTITY);var o,a=ie(this,e,i.offset);o=r?t.multiplyByScalar(t.UNIT_Z,a.range,Tt):U(a.heading,a.pitch,a.range);var s=C.eastNorthUpToFixedFrame(e.center,u.WGS84,wt);v.multiplyByPoint(s,o,o);var l,c;if(!r){if(l=t.subtract(e.center,o,xt),t.normalize(l,l),c=v.multiplyByPointAsVector(s,t.UNIT_Z,bt),1-Math.abs(t.dot(l,c))<p.EPSILON6){var h=g.fromAxisAngle(l,a.heading,It),d=f.fromQuaternion(h,Mt);t.fromCartesian4(v.getColumn(s,1,Pt),c),f.multiplyByVector(d,c,c)}var m=t.cross(l,c,At);t.cross(m,l,c),t.normalize(c,c)}return this.flyTo({destination:o,orientation:{direction:l,up:c},duration:i.duration,complete:i.complete,cancel:i.cancel,endTransform:i.endTransform,maximumHeight:i.maximumHeight,easingFunction:i.easingFunction})},T.clone=function(e,i){return o(i)||(i=new T(e._scene)),t.clone(e.position,i.position),t.clone(e.direction,i.direction),t.clone(e.up,i.up),t.clone(e.right,i.right),v.clone(e._transform,i.transform),i},T}),i("Scene/CameraEventType",["../Core/freezeObject"],function(e){"use strict";var t={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4};return e(t)}),i("Scene/CameraEventAggregator",["../Core/Cartesian2","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/KeyboardEventModifier","../Core/Math","../Core/ScreenSpaceEventHandler","../Core/ScreenSpaceEventType","./CameraEventType"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,i){var r=e;return t(i)&&(r+="+"+i),r}function h(t,i){e.clone(t.distance.startPosition,i.distance.startPosition),e.clone(t.distance.endPosition,i.distance.endPosition),e.clone(t.angleAndHeight.startPosition,i.angleAndHeight.startPosition),e.clone(t.angleAndHeight.endPosition,i.angleAndHeight.endPosition)}function d(i,r,n){var o=c(u.PINCH,r),a=i._update,s=i._isDown,d=i._eventStartPosition,m=i._pressTime,p=i._releaseTime;a[o]=!0,s[o]=!1,d[o]=new e;var f=i._movement[o];t(f)||(f=i._movement[o]={}),f.distance={startPosition:new e,endPosition:new e},f.angleAndHeight={startPosition:new e,endPosition:new e},f.prevAngle=0,i._eventHandler.setInputAction(function(e){i._buttonsDown++,s[o]=!0,m[o]=new Date},l.PINCH_START,r),i._eventHandler.setInputAction(function(){i._buttonsDown=Math.max(i._buttonsDown-1,0),s[o]=!1,p[o]=new Date},l.PINCH_END,r),i._eventHandler.setInputAction(function(t){if(s[o]&&n.clientWidth>0&&n.clientHeight>0){a[o]?(h(t,f),a[o]=!1,f.prevAngle=f.angleAndHeight.startPosition.x):(e.clone(t.distance.endPosition,f.distance.endPosition),e.clone(t.angleAndHeight.endPosition,f.angleAndHeight.endPosition));for(var i=f.angleAndHeight.endPosition.x,r=f.prevAngle,l=2*Math.PI;i>=r+Math.PI;)i-=l;for(;i<r-Math.PI;)i+=l;f.angleAndHeight.endPosition.x=-i*n.clientWidth/12,f.angleAndHeight.startPosition.x=-r*n.clientWidth/12}},l.PINCH_MOVE,r)}function m(i,r){var n=c(u.WHEEL,r),o=i._update;o[n]=!0;var s=i._movement[n];t(s)||(s=i._movement[n]={}),s.startPosition=new e,s.endPosition=new e,i._eventHandler.setInputAction(function(t){var i=15*a.toRadians(t);o[n]?(e.clone(e.ZERO,s.startPosition),s.endPosition.x=0,s.endPosition.y=i,o[n]=!1):s.endPosition.y=s.endPosition.y+i},l.WHEEL,r)}function p(i,r,n){var o=c(n,r),a=i._isDown,s=i._eventStartPosition,h=i._pressTime,d=i._releaseTime;a[o]=!1,s[o]=new e;var m=i._lastMovement[o];t(m)||(m=i._lastMovement[o]={startPosition:new e,endPosition:new e,valid:!1});var p,f;n===u.LEFT_DRAG?(p=l.LEFT_DOWN,f=l.LEFT_UP):n===u.RIGHT_DRAG?(p=l.RIGHT_DOWN,f=l.RIGHT_UP):n===u.MIDDLE_DRAG&&(p=l.MIDDLE_DOWN,f=l.MIDDLE_UP),i._eventHandler.setInputAction(function(t){i._buttonsDown++,m.valid=!1,a[o]=!0,h[o]=new Date,e.clone(t.position,s[o])},p,r),i._eventHandler.setInputAction(function(){i._buttonsDown=Math.max(i._buttonsDown-1,0),a[o]=!1,d[o]=new Date},f,r)}function f(t,i){e.clone(t.startPosition,i.startPosition),e.clone(t.endPosition,i.endPosition)}function v(i,r){var n=i._update,o=i._movement,a=i._lastMovement,s=i._isDown;for(var h in u)if(u.hasOwnProperty(h)){var d=u[h];if(t(d)){var m=c(d,r);n[m]=!0,t(i._lastMovement[m])||(i._lastMovement[m]={startPosition:new e,endPosition:new e,valid:!1}),t(i._movement[m])||(i._movement[m]={startPosition:new e,endPosition:new e})}}i._eventHandler.setInputAction(function(l){for(var h in u)if(u.hasOwnProperty(h)){var d=u[h];if(t(d)){var m=c(d,r);s[m]&&(n[m]?(f(o[m],a[m]),a[m].valid=!0,f(l,o[m]),n[m]=!1):e.clone(l.endPosition,o[m].endPosition))}}e.clone(l.endPosition,i._currentMousePosition)},l.MOUSE_MOVE,r)}function g(i){this._eventHandler=new s(i,!0),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new e,m(this,void 0),d(this,void 0,i),p(this,void 0,u.LEFT_DRAG),p(this,void 0,u.RIGHT_DRAG),p(this,void 0,u.MIDDLE_DRAG),v(this,void 0);for(var r in o)if(o.hasOwnProperty(r)){var n=o[r];t(n)&&(m(this,n),d(this,n,i),p(this,n,u.LEFT_DRAG),p(this,n,u.RIGHT_DRAG),p(this,n,u.MIDDLE_DRAG),v(this,n))}}return i(g.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){var e=!(this._update[c(u.WHEEL)]&&this._update[c(u.WHEEL,o.SHIFT)]&&this._update[c(u.WHEEL,o.CTRL)]&&this._update[c(u.WHEEL,o.ALT)]);return this._buttonsDown>0||e}}}),g.prototype.isMoving=function(e,t){var i=c(e,t);return!this._update[i]},g.prototype.getMovement=function(e,t){var i=c(e,t),r=this._movement[i];return r},g.prototype.getLastMovement=function(e,t){var i=c(e,t),r=this._lastMovement[i];return r.valid?r:void 0},g.prototype.isButtonDown=function(e,t){var i=c(e,t);return this._isDown[i]},g.prototype.getStartMousePosition=function(e,t){if(e===u.WHEEL||e===u.PINCH)return this._currentMousePosition;var i=c(e,t);return this._eventStartPosition[i]},g.prototype.getButtonPressTime=function(e,t){var i=c(e,t);return this._pressTime[i]},g.prototype.getButtonReleaseTime=function(e,t){var i=c(e,t);return this._releaseTime[i]},g.prototype.reset=function(){for(var e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),r(this)},g}),i("Scene/UrlTemplateImageryProvider",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/combine","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/freezeObject","../Core/GeographicTilingScheme","../Core/loadJson","../Core/loadText","../Core/loadWithXhr","../Core/loadXML","../Core/Math","../Core/Rectangle","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E){"use strict";function S(e){this._errorEvent=new u,this._url=void 0,this._pickFeaturesUrl=void 0,this._proxy=void 0,this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._minimumLevel=void 0,this._tilingScheme=void 0,this._rectangle=void 0,this._tileDiscardPolicy=void 0,this._credit=void 0,this._hasAlphaChannel=void 0,this._readyPromise=void 0,this._withCredentials=o(e.withCredentials,void 0),this._headers=o(e.headers,void 0),this.enablePickFeatures=!0,this.reinitialize(e)}function w(e,t,i,r){return re=!1,oe=!1,x(e,e._urlParts,function(n){return n(e,t,i,r)})}function T(e,t,i,r,n,o,a){return re=!1,oe=!1,se=!1,ce=!1,x(e,e._pickFeaturesUrlParts,function(s){return s(e,t,i,r,n,o,a)})}function x(e,t,i){for(var r="",n=0;n<t.length;++n){var o=t[n];r+="string"==typeof o?o:encodeURIComponent(i(o))}var s=e._proxy;return a(s)&&(r=s.getURL(r)),r}function b(e,t){if(a(e)){for(var i,r,n=[],o=0,s=Object.keys(t);o<e.length;){i=Number.MAX_VALUE,r=void 0;for(var l=0;l<s.length;++l){var u=e.indexOf(s[l],o);u>=0&&i>u&&(i=u,r=s[l])}a(r)?(i>o&&n.push(e.substring(o,i)),n.push(t[r]),o=i+r.length):(n.push(e.substring(o)),o=e.length)}return n}}function A(e,t,i,r){return t}function P(e,t,i,r){return e.tilingScheme.getNumberOfXTilesAtLevel(r)-t-1}function I(e,t,i,r){return i}function M(e,t,i,r){return e.tilingScheme.getNumberOfYTilesAtLevel(r)-i-1}function D(e,t,i,r){var n=e.maximumLevel;return a(n)&&n>r?n-r-1:r}function R(e,t,i,r){return r}function O(e,t,i,r){var n=(t+i+r)%e._subdomains.length;return e._subdomains[n]}function N(e,t,i,r){re||(e.tilingScheme.tileXYToRectangle(t,i,r,ne),ne.west=v.toDegrees(ne.west),ne.south=v.toDegrees(ne.south),ne.east=v.toDegrees(ne.east),ne.north=v.toDegrees(ne.north),re=!0)}function L(e,t,i,r){return N(e,t,i,r),ne.west}function F(e,t,i,r){return N(e,t,i,r),ne.south}function B(e,t,i,r){return N(e,t,i,r),ne.east}function V(e,t,i,r){return N(e,t,i,r),ne.north}function k(e,t,i,r){oe||(e.tilingScheme.tileXYToNativeRectangle(t,i,r,ae),oe=!0)}function z(e,t,i,r){return k(e,t,i,r),ae.west}function U(e,t,i,r){return k(e,t,i,r),ae.south}function G(e,t,i,r){return k(e,t,i,r),ae.east}function W(e,t,i,r){return k(e,t,i,r),ae.north}function H(e,t,i,r){return e.tileWidth}function q(e,t,i,r){return e.tileHeight}function j(e,t,i,r,n,o,a){return K(e,t,i,r,n,o),le.x}function Y(e,t,i,r,n,o,a){return K(e,t,i,r,n,o),le.y}function X(e,t,i,r,n,o,a){return K(e,t,i,r,n,o),e.tileWidth-le.x-1}function Z(e,t,i,r,n,o,a){return K(e,t,i,r,n,o),e.tileHeight-le.y-1}function K(e,t,i,r,n,o,a){if(!se){te(e,t,i,r,n,o);var s=he,l=e.tilingScheme.tileXYToNativeRectangle(t,i,r,ue);le.x=e.tileWidth*(s.x-l.west)/l.width|0,le.y=e.tileHeight*(l.north-s.y)/l.height|0,se=!0}}function Q(e,t,i,r,n,o,a){return v.toDegrees(n)}function J(e,t,i,r,n,o,a){return v.toDegrees(o)}function $(e,t,i,r,n,o,a){return te(e,t,i,r,n,o),he.x}function ee(e,t,i,r,n,o,a){return te(e,t,i,r,n,o),he.y}function te(e,t,i,r,n,o,a){if(!ce){var s;if(e.tilingScheme instanceof h)he.x=v.toDegrees(n),he.y=v.toDegrees(o);else{var l=de;l.longitude=n,l.latitude=o,s=e.tilingScheme.projection.project(l,he)}ce=!0}}function ie(e,t,i,r,n,o,a){return a}s(S.prototype,{url:{get:function(){return this._url}},pickFeaturesUrl:{get:function(){return this._pickFeaturesUrl}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return a(this._urlParts)}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}},headers:{get:function(){return this._headers}},withCredentials:{get:function(){return this._withCredentials}},maximumRequests:{get:function(){return this._maximumRequests}}}),S.prototype.reinitialize=function(e){var t=this;t._readyPromise=C(e).then(function(e){t.enablePickFeatures=o(e.enablePickFeatures,t.enablePickFeatures),t._url=e.url,t._pickFeaturesUrl=e.pickFeaturesUrl,t._proxy=e.proxy,t._tileDiscardPolicy=e.tileDiscardPolicy,t._getFeatureInfoFormats=e.getFeatureInfoFormats,t._subdomains=e.subdomains,Array.isArray(t._subdomains)?t._subdomains=t._subdomains.slice():a(t._subdomains)&&t._subdomains.length>0?t._subdomains=t._subdomains.split(""):t._subdomains=["a","b","c"],t._tileWidth=o(e.tileWidth,256),t._tileHeight=o(e.tileHeight,256),t._minimumLevel=o(e.minimumLevel,0),t._maximumRequests=o(e.maximumRequests,6),t._maximumLevel=e.maximumLevel,t._tilingScheme=o(e.tilingScheme,new y({ellipsoid:e.ellipsoid})),t._rectangle=o(e.rectangle,t._tilingScheme.rectangle),t._rectangle=g.intersection(t._rectangle,t._tilingScheme.rectangle),t._hasAlphaChannel=o(e.hasAlphaChannel,!0),t._withCredentials=o(e.withCredentials,void 0),t._headers=o(e.headers,void 0);var i=e.credit;return"string"==typeof i&&(i=new n(i)),t._credit=i,t._urlParts=b(t._url,me),t._pickFeaturesUrlParts=b(t._pickFeaturesUrl,pe),!0})},S.prototype.getTileCredits=function(e,t,i){},S.prototype.requestImage=function(e,t,i){ +var r=w(this,e,t,i);return E.loadImage(this,r)},S.prototype.pickFeatures=function(e,t,i,r,n){function o(e,t){return e.callback(t)}function s(){if(l>=u._getFeatureInfoFormats.length)return C([]);var a=u._getFeatureInfoFormats[l],c=T(u,e,t,i,r,n,a.format),h={headers:u.headers,withCredentials:u.withCredentials};return++l,"json"===a.type?d(c,h).then(a.callback).otherwise(s):"xml"===a.type?f(c,h).then(a.callback).otherwise(s):"text"===a.type||"html"===a.type?m(c,h).then(a.callback).otherwise(s):p({url:c,headers:u.headers,withCredentials:u.withCredentials,responseType:a.format}).then(o.bind(void 0,a)).otherwise(s)}if(this.enablePickFeatures&&a(this._pickFeaturesUrl)&&0!==this._getFeatureInfoFormats.length){var l=0,u=this;return s()}};var re=!1,ne=new g,oe=!1,ae=new g,se=!1,le=new e,ue=new g,ce=!1,he=new t,de=new i,me={"{x}":A,"{y}":I,"{z}":R,"{s}":O,"{reverseX}":P,"{-x}":P,"{reverseY}":M,"{-y}":M,"{reverseZ}":D,"{-z}":D,"{westDegrees}":L,"{southDegrees}":F,"{eastDegrees}":B,"{northDegrees}":V,"{westProjected}":z,"{southProjected}":U,"{eastProjected}":G,"{northProjected}":W,"{width}":H,"{height}":q},pe=r(me,{"{i}":j,"{j}":Y,"{reverseI}":X,"{reverseJ}":Z,"{-i}":X,"{-j}":Z,"{longitudeDegrees}":Q,"{latitudeDegrees}":J,"{longitudeProjected}":$,"{latitudeProjected}":ee,"{format}":ie});return S}),i("Scene/createOpenStreetMapImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/DeveloperError","../Core/Rectangle","../Core/WebMercatorTilingScheme","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o){"use strict";function a(a){a=t(a,{});var u=t(a.url,"//a.tile.openstreetmap.org/");s.test(u)||(u+="/");var c=t(a.fileExtension,"png"),h=new n({ellipsoid:a.ellipsoid}),d=256,m=256,p=t(a.minimumLevel,0),f=a.maximumLevel,v=t(a.rectangle,h.rectangle),g=h.positionToTileXY(r.southwest(v),p),_=h.positionToTileXY(r.northeast(v),p),y=(Math.abs(_.x-g.x)+1)*(Math.abs(_.y-g.y)+1);if(y>4)throw new i("The rectangle and minimumLevel indicate that there are "+y+" tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.");var C=t(a.credit,l);"string"==typeof C&&(C=new e(C));var E=u+"{z}/{x}/{y}."+c;return new o({url:E,proxy:a.proxy,credit:C,tilingScheme:h,tileWidth:d,tileHeight:m,minimumLevel:p,maximumLevel:f,rectangle:v})}var s=/\/$/,l=new e("MapQuest, Open Street Map and contributors, CC-BY-SA");return a}),i("Scene/createTangentSpaceDebugPrimitive",["../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/Matrix4","./PerInstanceColorAppearance","./Primitive"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(r){r=t(r,t.EMPTY_OBJECT);var u=[],c=r.geometry;i(c.attributes)&&i(c.primitiveType)||(c=c.constructor.createGeometry(c));var h=c.attributes,d=a.clone(t(r.modelMatrix,a.IDENTITY)),m=t(r.length,1e4);return i(h.normal)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"normal",m),attributes:{color:new e(1,0,0,1)},modelMatrix:d})),i(h.binormal)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"binormal",m),attributes:{color:new e(0,1,0,1)},modelMatrix:d})),i(h.tangent)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"tangent",m),attributes:{color:new e(0,0,1,1)},modelMatrix:d})),u.length>0?new l({asynchronous:!1,geometryInstances:u,appearance:new s({flat:!0,translucent:!1})}):void 0}return u}),i("Scene/createTileMapServiceImageryProvider",["../Core/Cartesian2","../Core/Cartographic","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/joinUrls","../Core/loadXML","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v){"use strict";function g(i){function o(o){for(var a,c,f,v,E=/tileformat/i,S=/tileset/i,w=/tilesets/i,T=/boundingbox/i,x=/srs/i,b=[],A=o.childNodes[0].childNodes,P=0;P<A.length;P++)if(E.test(A.item(P).nodeName))a=A.item(P);else if(w.test(A.item(P).nodeName)){f=A.item(P);for(var I=A.item(P).childNodes,M=0;M<I.length;M++)S.test(I.item(M).nodeName)&&b.push(I.item(M))}else T.test(A.item(P).nodeName)?c=A.item(P):x.test(A.item(P).nodeName)&&(v=A.item(P).textContent);var D=r(i.fileExtension,a.getAttribute("extension")),R=r(i.tileSchema,"{z}/{x}/{reverseY}"),O=r(i.tileWidth,parseInt(a.getAttribute("width"),10)),N=r(i.tileHeight,parseInt(a.getAttribute("height"),10)),L=r(i.minimumLevel,parseInt(b[0].getAttribute("order"),10)),F=r(i.maximumLevel,parseInt(b[b.length-1].getAttribute("order"),10)),B=f.getAttribute("profile"),V=!1;("geodetic"===B||"mercator"===B)&&(V=!0);var k=i.tilingScheme;if(!n(k))if("geodetic"===B||"global-geodetic"===B)k=new l({ellipsoid:i.ellipsoid});else{if("mercator"!==B&&"global-mercator"!==B){var z=u(_,"tilemapresource.xml")+"specifies an unsupported profile attribute, "+B+".";return g=m.handleError(g,C,C.errorEvent,z,void 0,void 0,void 0,s),void(g.retry||y.reject(new d(z)))}k=new p({ellipsoid:i.ellipsoid})}var U=h.clone(i.rectangle);if(!n(U)){var G,W,H,q;if(V)G=new e(parseFloat(c.getAttribute("miny")),parseFloat(c.getAttribute("minx"))),W=new e(parseFloat(c.getAttribute("maxy")),parseFloat(c.getAttribute("maxx"))),H=t.fromDegrees(G.x,G.y),q=t.fromDegrees(W.x,W.y);else if(G=new e(parseFloat(c.getAttribute("minx")),parseFloat(c.getAttribute("miny"))),W=new e(parseFloat(c.getAttribute("maxx")),parseFloat(c.getAttribute("maxy"))),k instanceof l)H=t.fromDegrees(G.x,G.y),q=t.fromDegrees(W.x,W.y);else{var j=k.projection;H=j.unproject(G),q=j.unproject(W)}U=new h(H.longitude,H.latitude,q.longitude,q.latitude)}U.west<k.rectangle.west&&(U.west=k.rectangle.west),U.east>k.rectangle.east&&(U.east=k.rectangle.east),U.south<k.rectangle.south&&(U.south=k.rectangle.south),U.north>k.rectangle.north&&(U.north=k.rectangle.north);var Y=k.positionToTileXY(h.southwest(U),L),X=k.positionToTileXY(h.northeast(U),L),Z=(Math.abs(X.x-Y.x)+1)*(Math.abs(X.y-Y.y)+1);Z>4&&(L=0);var K=u(_,R);D.length&&(K=u(K,"."+D)),y.resolve({url:K,tilingScheme:k,rectangle:U,tileWidth:O,tileHeight:N,minimumLevel:L,maximumLevel:F,proxy:i.proxy,maximumRequests:i.maximumRequests,tileDiscardPolicy:i.tileDiscardPolicy,credit:i.credit,pickFeaturesUrl:i.pickFeaturesUrl,withCredentials:i.withCredentials,getFeatureInfoFormats:i.getFeatureInfoFormats})}function a(e){var t=r(i.fileExtension,"png"),o=r(i.tileSchema,"{z}/{x}/{reverseY}"),a=r(i.tileWidth,256),s=r(i.tileHeight,256),l=r(i.minimumLevel,0),c=i.maximumLevel,h=n(i.tilingScheme)?i.tilingScheme:new p({ellipsoid:i.ellipsoid}),d=r(i.rectangle,h.rectangle),m=u(_,o);t.length&&(m=u(m,"."+t)),y.resolve({url:m,tilingScheme:h,rectangle:d,tileWidth:a,tileHeight:s,minimumLevel:l,maximumLevel:c,proxy:i.proxy,tileDiscardPolicy:i.tileDiscardPolicy,credit:i.credit,maximumRequests:i.maximumRequests,withCredentials:i.withCredentials,pickFeaturesUrl:i.pickFeaturesUrl,getFeatureInfoFormats:i.getFeatureInfoFormats})}function s(){var e=u(_,"tilemapresource.xml"),t=i.proxy;n(t)&&(e=t.getURL(e)),f(c(e),o,a)}i=r(i,{});var g,_=i.url,y=f.defer(),C=new v(y.promise);return s(),C}return g}),i("Scene/CreditDisplay",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError"],function(e,t,i,r,n){"use strict";function o(e,t,r){if(!i(e.element)){var n=e.text,o=e.link,a=document.createElement("span");if(e.hasLink()){var s=document.createElement("a");s.textContent=n,s.href=o,s.target="_blank",a.appendChild(s)}else a.textContent=n;a.className="cesium-credit-text",e.element=a}if(t.hasChildNodes()){var l=document.createElement("span");l.textContent=r,l.className="cesium-credit-delimiter",t.appendChild(l)}t.appendChild(e.element)}function a(e,t){if(!i(e.element)){var r=e.text,n=e.link,o=document.createElement("span"),a=document.createElement("img");if(a.src=e.imageUrl,a.style["vertical-align"]="bottom",i(r)&&(a.alt=r,a.title=r),e.hasLink()){var s=document.createElement("a");s.appendChild(a),s.href=n,s.target="_blank",o.appendChild(s)}else o.appendChild(a);o.className="cesium-credit-image",e.element=o}t.appendChild(e.element)}function s(t,i){for(var r=t.length,n=0;r>n;n++){var o=t[n];if(e.equals(o,i))return!0}return!1}function l(e){var t=e.element;if(i(t)){var r=t.parentNode;if(!e.hasImage()){var n=t.previousSibling;null===n&&(n=t.nextSibling),null!==n&&r.removeChild(n)}r.removeChild(t)}}function u(e,t){var r,n,a,s=e._displayedCredits.textCredits;for(r=0;r<t.length;r++)a=t[r],i(a)&&(n=s.indexOf(a),-1===n?o(a,e._textContainer,e._delimiter):s.splice(n,1));for(r=0;r<s.length;r++)a=s[r],i(a)&&l(a)}function c(e,t){var r,n,o,s=e._displayedCredits.imageCredits;for(r=0;r<t.length;r++)o=t[r],i(o)&&(n=s.indexOf(o),-1===n?a(o,e._imageContainer):s.splice(n,1));for(r=0;r<s.length;r++)o=s[r],i(o)&&l(o)}function h(e,i){var r=document.createElement("span");r.className="cesium-credit-imageContainer";var n=document.createElement("span");n.className="cesium-credit-textContainer",e.appendChild(r),e.appendChild(n),this._delimiter=t(i," • "),this._textContainer=n,this._imageContainer=r,this._defaultImageCredits=[],this._defaultTextCredits=[],this._displayedCredits={imageCredits:[],textCredits:[]},this._currentFrameCredits={imageCredits:[],textCredits:[]},this.container=e}return h.prototype.addCredit=function(e){if(e.hasImage()){var t=this._currentFrameCredits.imageCredits;s(this._defaultImageCredits,e)||(t[e.id]=e)}else{var i=this._currentFrameCredits.textCredits;s(this._defaultTextCredits,e)||(i[e.id]=e)}},h.prototype.addDefaultCredit=function(e){if(e.hasImage()){var t=this._defaultImageCredits;s(t,e)||t.push(e)}else{var i=this._defaultTextCredits;s(i,e)||i.push(e)}},h.prototype.removeDefaultCredit=function(e){var t;e.hasImage()?(t=this._defaultImageCredits.indexOf(e),-1!==t&&this._defaultImageCredits.splice(t,1)):(t=this._defaultTextCredits.indexOf(e),-1!==t&&this._defaultTextCredits.splice(t,1))},h.prototype.beginFrame=function(){this._currentFrameCredits.imageCredits.length=0,this._currentFrameCredits.textCredits.length=0},h.prototype.endFrame=function(){var e=this._defaultTextCredits.concat(this._currentFrameCredits.textCredits),t=this._defaultImageCredits.concat(this._currentFrameCredits.imageCredits);u(this,e),c(this,t),this._displayedCredits.textCredits=e,this._displayedCredits.imageCredits=t},h.prototype.destroy=function(){return this.container.removeChild(this._textContainer),this.container.removeChild(this._imageContainer),r(this)},h.prototype.isDestroyed=function(){return!1},h}),i("Scene/DebugAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","./Appearance"],function(e,t,i,r,n){"use strict";function o(t){t=e(t,e.EMPTY_OBJECT);var i,o=t.attributeName,a=e(t.glslDatatype,"vec3"),s="v_"+o;if("normal"===o||"binormal"===o|"tangent"===o)i="vec4 getColor() { return vec4(("+s+" + vec3(1.0)) * 0.5, 1.0); }\n";else switch("st"===o&&(a="vec2"),a){case"float":i="vec4 getColor() { return vec4(vec3("+s+"), 1.0); }\n";break;case"vec2":i="vec4 getColor() { return vec4("+s+", 0.0, 1.0); }\n";break;case"vec3":i="vec4 getColor() { return vec4("+s+", 1.0); }\n";break;case"vec4":i="vec4 getColor() { return "+s+"; }\n";break;default:throw new r("options.glslDatatype must be float, vec2, vec3, or vec4.")}var l="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute "+a+" "+o+";\nvarying "+a+" "+s+";\nvoid main()\n{\nvec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);\n"+s+" = "+o+";\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}",u="varying "+a+" "+s+";\n"+i+"\nvoid main()\n{\ngl_FragColor = getColor();\n}";this.material=void 0,this.translucent=e(t.translucent,!1),this._vertexShaderSource=e(t.vertexShaderSource,l),this._fragmentShaderSource=e(t.fragmentShaderSource,u),this._renderState=n.getDefaultRenderState(!1,!1,t.renderState),this._closed=e(t.closed,!1),this._attributeName=o,this._glslDatatype=a}return i(o.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}}),o.prototype.getFragmentShaderSource=n.prototype.getFragmentShaderSource,o.prototype.isTranslucent=n.prototype.isTranslucent,o.prototype.getRenderState=n.prototype.getRenderState,o}),i("Scene/DebugModelMatrixPrimitive",["../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/GeometryInstance","../Core/Matrix4","../Core/PolylineGeometry","./PolylineColorAppearance","./Primitive"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e){e=i(e,i.EMPTY_OBJECT),this.length=i(e.length,1e7),this._length=void 0,this.width=i(e.width,2),this._width=void 0,this.show=i(e.show,!0),this.modelMatrix=a.clone(i(e.modelMatrix,a.IDENTITY)),this._modelMatrix=new a,this.id=e.id,this._id=void 0,this._primitive=void 0}return c.prototype.update=function(i){if(this.show){if(!r(this._primitive)||!a.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=a.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,r(this._primitive)&&this._primitive.destroy(),0===this.modelMatrix[12]&&0===this.modelMatrix[13]&&0===this.modelMatrix[14]&&(this.modelMatrix[14]=.01);var n=new o({geometry:new s({positions:[e.ZERO,e.UNIT_X],width:this.width,vertexFormat:l.VERTEX_FORMAT,colors:[t.RED,t.RED],followSurface:!1}),modelMatrix:a.multiplyByUniformScale(this.modelMatrix,this.length,new a),id:this.id,pickPrimitive:this}),c=new o({geometry:new s({positions:[e.ZERO,e.UNIT_Y],width:this.width,vertexFormat:l.VERTEX_FORMAT,colors:[t.GREEN,t.GREEN],followSurface:!1}),modelMatrix:a.multiplyByUniformScale(this.modelMatrix,this.length,new a),id:this.id,pickPrimitive:this}),h=new o({geometry:new s({positions:[e.ZERO,e.UNIT_Z],width:this.width,vertexFormat:l.VERTEX_FORMAT,colors:[t.BLUE,t.BLUE],followSurface:!1}),modelMatrix:a.multiplyByUniformScale(this.modelMatrix,this.length,new a),id:this.id,pickPrimitive:this});this._primitive=new u({geometryInstances:[n,c,h],appearance:new l,asynchronous:!1})}this._primitive.update(i)}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),n(this)},c}),i("Scene/DepthFunction",["../Core/freezeObject","../Renderer/WebGLConstants"],function(e,t){"use strict";var i={NEVER:t.NEVER,LESS:t.LESS,EQUAL:t.EQUAL,LESS_OR_EQUAL:t.LEQUAL,GREATER:t.GREATER,NOT_EQUAL:t.NOTEQUAL,GREATER_OR_EQUAL:t.GEQUAL,ALWAYS:t.ALWAYS};return e(i)}),i("Shaders/DepthPlaneFS",[],function(){"use strict";return"varying vec4 positionEC;\nvoid main()\n{\nczm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\nvec3 direction = normalize(positionEC.xyz);\nczm_ray ray = czm_ray(vec3(0.0), direction);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\nif (!czm_isEmpty(intersection))\n{\ngl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n}\nelse\n{\ndiscard;\n}\n}\n"}),i("Shaders/DepthPlaneVS",[],function(){"use strict";return"attribute vec4 position;\nvarying vec4 positionEC;\nvoid main()\n{\npositionEC = czm_modelView * position;\ngl_Position = czm_projection * positionEC;\n}\n"}),i("Scene/DepthPlane",["../Core/BoundingSphere","../Core/Cartesian3","../Core/ComponentDatatype","../Core/defined","../Core/FeatureDetection","../Core/Geometry","../Core/GeometryAttribute","../Core/PrimitiveType","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/VertexArray","../Shaders/DepthPlaneFS","../Shaders/DepthPlaneVS","./DepthFunction","./Pass","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g){"use strict";function _(){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0}function y(e,i){var r=e.radii,n=i.camera.positionWC,o=t.multiplyComponents(e.oneOverRadii,n,E),a=t.magnitude(o),s=t.normalize(o,S),l=t.normalize(t.cross(t.UNIT_Z,o,w),w),u=t.normalize(t.cross(s,l,T),T),c=Math.sqrt(t.magnitudeSquared(o)-1),h=t.multiplyByScalar(s,1/a,E),d=c/a,m=t.multiplyByScalar(l,d,S),p=t.multiplyByScalar(u,d,w),f=t.add(h,p,T);t.subtract(f,m,f),t.multiplyComponents(r,f,f),t.pack(f,C,0);var v=t.subtract(h,p,T);t.subtract(v,m,v),t.multiplyComponents(r,v,v),t.pack(v,C,3);var g=t.add(h,p,T);t.add(g,m,g),t.multiplyComponents(r,g,g),t.pack(g,C,6);var _=t.subtract(h,p,T);return t.add(_,m,_),t.multiplyComponents(r,_,_),t.pack(_,C,9),C}var C=n.supportsTypedArrays()?new Float32Array(12):[],E=new t,S=new t,w=new t,T=new t;return _.prototype.update=function(n){if(this._mode=n.mode,n.mode===g.SCENE3D){var _=n.context,C=n.mapProjection.ellipsoid;r(this._command)||(this._rs=c.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:f.ALWAYS},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._sp=h.fromCache({context:_,vertexShaderSource:p,fragmentShaderSource:m,attributeLocations:{position:0}}),this._command=new u({renderState:this._rs,shaderProgram:this._sp,boundingVolume:new e(t.ZERO,C.maximumRadius),pass:v.OPAQUE,owner:this}));var E=y(C,n);if(r(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(E);else{var S=new o({attributes:{position:new a({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:E})},indices:[0,1,2,2,1,3],primitiveType:s.TRIANGLES});this._va=d.fromGeometry({context:_,geometry:S,attributeLocations:{position:0},bufferUsage:l.DYNAMIC_DRAW}),this._command.vertexArray=this._va}}},_.prototype.execute=function(e,t){this._mode===g.SCENE3D&&this._command.execute(e,t)},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()},_}),i("Scene/DeviceOrientationCameraController",["../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/Matrix3","../Core/Quaternion"],function(e,t,i,r,n,o,a){"use strict";function s(t){function i(t){r._alpha=n.toRadians(e(t.alpha,0)),r._beta=n.toRadians(e(t.beta,0)),r._gamma=n.toRadians(e(t.gamma,0))}this._scene=t,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;var r=this;window.addEventListener("deviceorientation",i,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",i,!1)}}function l(e,t,i,r){var n=e.direction,s=e.right,l=e.up,d=a.fromAxisAngle(n,i,c),m=a.fromAxisAngle(s,r,u),p=a.multiply(m,d,m),f=a.fromAxisAngle(l,t,c);a.multiply(f,p,p);var v=o.fromQuaternion(p,h);o.multiplyByVector(v,s,s),o.multiplyByVector(v,l,l),o.multiplyByVector(v,n,n)}var u=new a,c=new a,h=new o;return s.prototype.update=function(){if(t(this._alpha)){t(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);var e=this._lastAlpha-this._alpha,i=this._lastBeta-this._beta,r=this._lastGamma-this._gamma;l(this._scene.camera,-e,i,r),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma}},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._removeListener(),i(this)},s}),i("Shaders/EllipsoidFS",[],function(){"use strict";return"#ifdef WRITE_DEPTH\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#endif\nuniform vec3 u_radii;\nuniform vec3 u_oneOverEllipsoidRadiiSquared;\nvarying vec3 v_positionEC;\nvec4 computeEllipsoidColor(czm_ray ray, float intersection, float side)\n{\nvec3 positionEC = czm_pointAlongRay(ray, intersection);\nvec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz;\nvec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared));\nvec3 sphericalNormal = normalize(positionMC / u_radii);\nvec3 normalMC = geodeticNormal * side;\nvec3 normalEC = normalize(czm_normal * normalMC);\nvec2 st = czm_ellipsoidWgs84TextureCoordinates(sphericalNormal);\nvec3 positionToEyeEC = -positionEC;\nczm_materialInput materialInput;\nmaterialInput.s = st.s;\nmaterialInput.st = st;\nmaterialInput.str = (positionMC + u_radii) / u_radii;\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef ONLY_SUN_LIGHTING\nreturn czm_private_phong(normalize(positionToEyeEC), material);\n#else\nreturn czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\nvoid main()\n{\nfloat maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5;\nvec3 direction = normalize(v_positionEC);\nvec3 ellipsoidCenter = czm_modelView[3].xyz;\nfloat t1 = -1.0;\nfloat t2 = -1.0;\nfloat b = -2.0 * dot(direction, ellipsoidCenter);\nfloat c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius;\nfloat discriminant = b * b - 4.0 * c;\nif (discriminant >= 0.0) {\nt1 = (-b - sqrt(discriminant)) * 0.5;\nt2 = (-b + sqrt(discriminant)) * 0.5;\n}\nif (t1 < 0.0 && t2 < 0.0) {\ndiscard;\n}\nfloat t = min(t1, t2);\nif (t < 0.0) {\nt = 0.0;\n}\nczm_ellipsoid ellipsoid = czm_ellipsoidNew(ellipsoidCenter, u_radii);\nczm_ray ray = czm_ray(t * direction, direction);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\nif (czm_isEmpty(intersection))\n{\ndiscard;\n}\nvec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);\nvec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0);\ngl_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a);\ngl_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a);\n#ifdef WRITE_DEPTH\n#ifdef GL_EXT_frag_depth\nt = (intersection.start != 0.0) ? intersection.start : intersection.stop;\nvec3 positionEC = czm_pointAlongRay(ray, t);\nvec4 positionCC = czm_projection * vec4(positionEC, 1.0);\nfloat z = positionCC.z / positionCC.w;\nfloat n = czm_depthRange.near;\nfloat f = czm_depthRange.far;\ngl_FragDepthEXT = (z * (f - n) + f + n) * 0.5;\n#endif\n#endif\n}\n"}),i("Shaders/EllipsoidVS",[],function(){"use strict";return"attribute vec3 position;\nuniform vec3 u_radii;\nvarying vec3 v_positionEC;\nvoid main()\n{\nvec4 p = vec4(u_radii * position, 1.0);\nv_positionEC = (czm_modelView * p).xyz;\ngl_Position = czm_modelViewProjection * p;\ngl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far);\n}\n"}),i("Scene/EllipsoidPrimitive",["../Core/BoundingSphere","../Core/BoxGeometry","../Core/Cartesian3","../Core/combine","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/EllipsoidFS","../Shaders/EllipsoidVS","./BlendingState","./CullFace","./Material","./Pass","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S){"use strict";function w(t){t=n(t,n.EMPTY_OBJECT),this.center=i.clone(n(t.center,i.ZERO)),this._center=new i,this.radii=i.clone(t.radii),this._radii=new i,this._oneOverEllipsoidRadiiSquared=new i,this._boundingSphere=new e,this.modelMatrix=l.clone(n(t.modelMatrix,l.IDENTITY)),this._modelMatrix=new l,this._computedModelMatrix=new l,this.show=n(t.show,!0),this.material=n(t.material,C.fromType(C.ColorType)),this._material=void 0,this._translucent=void 0,this.id=t.id,this._id=void 0,this.debugShowBoundingVolume=n(t.debugShowBoundingVolume,!1),this.onlySunLighting=n(t.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=n(t.depthTestEnabled,!0),this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new h({owner:n(t._owner,this)}),this._pickCommand=new h({owner:n(t._owner,this)});var r=this;this._uniforms={u_radii:function(){return r.radii},u_oneOverEllipsoidRadiiSquared:function(){return r._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return r._pickId.color}}}function T(e){var r=e.cache.ellipsoidPrimitive_vertexArray;if(o(r))return r;var n=t.createGeometry(t.fromDimensions({dimensions:new i(2,2,2),vertexFormat:u.POSITION_ONLY}));return r=f.fromGeometry({context:e,geometry:n,attributeLocations:x,bufferUsage:c.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=r,r}var x={position:0};return w.prototype.update=function(t){if(this.show&&t.mode===S.SCENE3D&&o(this.center)&&o(this.radii)){var n=t.context,a=this.material.isTranslucent(),s=this._translucent!==a;(!o(this._rs)||s)&&(this._translucent=a,this._rs=d.fromCache({cull:{enabled:!0,face:y.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!a&&n.fragmentDepth,blending:a?_.ALPHA_BLEND:void 0})),o(this._va)||(this._va=T(n));var u=!1,c=this.radii;if(!i.equals(this._radii,c)){i.clone(c,this._radii);var h=this._oneOverEllipsoidRadiiSquared;h.x=1/(c.x*c.x),h.y=1/(c.y*c.y),h.z=1/(c.z*c.z),u=!0}l.equals(this.modelMatrix,this._modelMatrix)&&i.equals(this.center,this._center)||(l.clone(this.modelMatrix,this._modelMatrix),i.clone(this.center,this._center),l.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),u=!0),u&&(i.clone(i.ZERO,this._boundingSphere.center),this._boundingSphere.radius=i.maximumComponent(c),e.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));var f=this._material!==this.material;this._material=this.material,this._material.update(n);var C=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;var w,b=this._colorCommand;(f||C||s)&&(w=new p({sources:[this.material.shaderSource,v]}),this.onlySunLighting&&w.defines.push("ONLY_SUN_LIGHTING"),!a&&n.fragmentDepth&&w.defines.push("WRITE_DEPTH"),this._sp=m.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:g,fragmentShaderSource:w,attributeLocations:x}),b.vertexArray=this._va,b.renderState=this._rs,b.shaderProgram=this._sp,b.uniformMap=r(this._uniforms,this.material._uniforms),b.executeInClosestFrustum=a);var A=t.commandList,P=t.passes;if(P.render&&(b.boundingVolume=this._boundingSphere,b.debugShowBoundingVolume=this.debugShowBoundingVolume,b.modelMatrix=this._computedModelMatrix,b.pass=a?E.TRANSLUCENT:E.OPAQUE,A.push(b)),P.pick){var I=this._pickCommand;o(this._pickId)&&this._id===this.id||(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=n.createPickId({primitive:this,id:this.id})),(f||C||!o(this._pickSP))&&(w=new p({sources:[this.material.shaderSource,v],pickColorQualifier:"uniform"}),this.onlySunLighting&&w.defines.push("ONLY_SUN_LIGHTING"),!a&&n.fragmentDepth&&w.defines.push("WRITE_DEPTH"),this._pickSP=m.replaceCache({context:n,shaderProgram:this._pickSP,vertexShaderSource:g,fragmentShaderSource:w,attributeLocations:x}),I.vertexArray=this._va,I.renderState=this._rs,I.shaderProgram=this._pickSP,I.uniformMap=r(r(this._uniforms,this._pickUniforms),this.material._uniforms),I.executeInClosestFrustum=a),I.boundingVolume=this._boundingSphere,I.modelMatrix=this._computedModelMatrix,I.pass=a?E.TRANSLUCENT:E.OPAQUE,A.push(I)}}},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),a(this)},w}),i("Shaders/Appearances/EllipsoidSurfaceAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\nvoid main()\n{\nczm_materialInput materialInput;\nvec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nmaterialInput.s = v_st.s;\nmaterialInput.st = v_st;\nmaterialInput.str = vec3(v_st, 0.0);\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\nvec3 positionToEyeEC = -v_positionEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),i("Shaders/Appearances/EllipsoidSurfaceAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec2 st;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionMC = position3DHigh + position3DLow;\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Scene/EllipsoidSurfaceAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/EllipsoidSurfaceAppearanceFS","../Shaders/Appearances/EllipsoidSurfaceAppearanceVS","./Appearance","./Material"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.translucent,!0),l=e(i.aboveGround,!1);this.material=t(i.material)?i.material:s.fromType(s.ColorType),this.translucent=e(i.translucent,!0),this._vertexShaderSource=e(i.vertexShaderSource,o),this._fragmentShaderSource=e(i.fragmentShaderSource,n),this._renderState=a.getDefaultRenderState(r,!l,i.renderState),this._closed=!1,this._flat=e(i.flat,!1),this._faceForward=e(i.faceForward,l),this._aboveGround=l}return i(l.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return l.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}}),l.VERTEX_FORMAT=r.POSITION_AND_ST,l.prototype.getFragmentShaderSource=a.prototype.getFragmentShaderSource,l.prototype.isTranslucent=a.prototype.isTranslucent,l.prototype.getRenderState=a.prototype.getRenderState,l}),i("Scene/Fog",["../Core/Cartesian3","../Core/defined","../Core/Math","./SceneMode"],function(e,t,i,r){"use strict";function n(){this.enabled=!0,this.density=2e-4,this.screenSpaceErrorFactor=2}function o(e){var t=a,i=t.length;if(e<t[0])return d=0;if(e>t[i-1])return d=i-2;if(e>=t[d]){if(i>d+1&&e<t[d+1])return d;if(i>d+2&&e<t[d+2])return++d,d}else if(d-1>=0&&e>=t[d-1])return--d,d;var r;for(r=0;i-2>r&&!(e>=t[r]&&e<t[r+1]);++r);return d=r}for(var a=[359.393,800.749,1275.6501,2151.1192,3141.7763,4777.5198,6281.2493,12364.307,15900.765,49889.0549,78026.8259,99260.7344,120036.3873,151011.0158,156091.1953,203849.3112,274866.9803,319916.3149,493552.0528,628733.5874],s=[2e-5,2e-4,1e-4,7e-5,5e-5,4e-5,3e-5,19e-6,1e-5,85e-7,62e-7,58e-7,53e-7,52e-7,51e-7,42e-7,4e-6,34e-7,26e-7,22e-7],l=0;l<s.length;++l)s[l]*=1e6;for(var u=s[1],c=s[s.length-1],h=0;h<s.length;++h)s[h]=(s[h]-c)/(u-c);var d=0,m=new e;return n.prototype.update=function(n){var l=n.fog.enabled=this.enabled;if(l){var h=n.camera,d=h.positionCartographic;if(!t(d)||d.height>8e5||n.mode!==r.SCENE3D)return void(n.fog.enabled=!1);var p=d.height,f=o(p),v=i.clamp((p-a[f])/(a[f+1]-a[f]),0,1),g=i.lerp(s[f],s[f+1],v),_=1e6*this.density,y=_/u*c;g=g*(_-y)*1e-6;var C=e.normalize(h.positionWC,m),E=i.clamp(e.dot(h.directionWC,C),0,1);g*=1-E, +n.fog.density=g,n.fog.sse=this.screenSpaceErrorFactor}},n}),i("Scene/FrameRateMonitor",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/getTimestamp","../Core/TimeConstants"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){function r(){c(n)}this._scene=i.scene,this.samplingWindow=e(i.samplingWindow,l.defaultSettings.samplingWindow),this.quietPeriod=e(i.quietPeriod,l.defaultSettings.quietPeriod),this.warmupPeriod=e(i.warmupPeriod,l.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=e(i.minimumFrameRateDuringWarmup,l.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=e(i.minimumFrameRateAfterWarmup,l.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new o,this._nominalFrameRate=new o,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;var n=this;this._preRenderRemoveListener=this._scene.preRender.addEventListener(function(e,t){u(n,t)}),this._hiddenPropertyName=t(document.hidden)?"hidden":t(document.mozHidden)?"mozHidden":t(document.msHidden)?"msHidden":t(document.webkitHidden)?"webkitHidden":void 0;var a=t(document.hidden)?"visibilitychange":t(document.mozHidden)?"mozvisibilitychange":t(document.msHidden)?"msvisibilitychange":t(document.webkitHidden)?"webkitvisibilitychange":void 0;this._visibilityChangeRemoveListener=void 0,t(a)&&(document.addEventListener(a,r,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(a,r,!1)})}function u(e,t){if(!(e._pauseCount>0)){var i=a();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=i+e.quietPeriod/s.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/s.SECONDS_PER_MILLISECOND;else if(i>=e._quietPeriodEndTime){e._frameTimes.push(i);var r=i-e.samplingWindow/s.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=r){for(;e._frameTimes.length>=2&&e._frameTimes[1]<r;)e._frameTimes.shift();var n=(i-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/n;var o=1e3/(i>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);n>o?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}}function c(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}return l.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8},l.fromScene=function(e){return(!t(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new l({scene:e})),e._frameRateMonitor},i(l.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}}),l.prototype.pause=function(){++this._pauseCount,1===this._pauseCount&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)},l.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._preRenderRemoveListener(),t(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),r(this)},l}),i("Scene/FrameState",["./SceneMode"],function(e){"use strict";function t(t,i){this.context=t,this.commandList=[],this.mode=e.SCENE3D,this.morphTime=e.getMorphTime(e.SCENE3D),this.frameNumber=0,this.time=void 0,this.mapProjection=void 0,this.camera=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.passes={render:!1,pick:!1},this.creditDisplay=i,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,density:void 0,sse:void 0},this.terrainExaggeration=1}return t}),i("Scene/FrustumCommands",["../Core/defaultValue","./Pass"],function(e,t){"use strict";function i(i,r){this.near=e(i,0),this.far=e(r,0);for(var n=t.NUMBER_OF_PASSES,o=new Array(n),a=new Array(n),s=0;n>s;++s)o[s]=[],a[s]=0;this.commands=o,this.indices=a}return i}),i("Shaders/PostProcessFilters/FXAA",[],function(){"use strict";return"#ifndef FXAA_PRESET\n#define FXAA_PRESET 3\n#endif\n#if (FXAA_PRESET == 3)\n#define FXAA_EDGE_THRESHOLD (1.0/8.0)\n#define FXAA_EDGE_THRESHOLD_MIN (1.0/24.0)\n#define FXAA_SEARCH_STEPS 16\n#define FXAA_SEARCH_THRESHOLD (1.0/4.0)\n#define FXAA_SUBPIX_CAP (3.0/4.0)\n#define FXAA_SUBPIX_TRIM (1.0/4.0)\n#endif\n#if (FXAA_PRESET == 4)\n#define FXAA_EDGE_THRESHOLD (1.0/8.0)\n#define FXAA_EDGE_THRESHOLD_MIN (1.0/24.0)\n#define FXAA_SEARCH_STEPS 24\n#define FXAA_SEARCH_THRESHOLD (1.0/4.0)\n#define FXAA_SUBPIX_CAP (3.0/4.0)\n#define FXAA_SUBPIX_TRIM (1.0/4.0)\n#endif\n#if (FXAA_PRESET == 5)\n#define FXAA_EDGE_THRESHOLD (1.0/8.0)\n#define FXAA_EDGE_THRESHOLD_MIN (1.0/24.0)\n#define FXAA_SEARCH_STEPS 32\n#define FXAA_SEARCH_THRESHOLD (1.0/4.0)\n#define FXAA_SUBPIX_CAP (3.0/4.0)\n#define FXAA_SUBPIX_TRIM (1.0/4.0)\n#endif\n#define FXAA_SUBPIX_TRIM_SCALE (1.0/(1.0 - FXAA_SUBPIX_TRIM))\nfloat FxaaLuma(vec3 rgb) {\nreturn rgb.y * (0.587/0.299) + rgb.x;\n}\nvec3 FxaaLerp3(vec3 a, vec3 b, float amountOfA) {\nreturn (vec3(-amountOfA) * b) + ((a * vec3(amountOfA)) + b);\n}\nvec4 FxaaTexOff(sampler2D tex, vec2 pos, ivec2 off, vec2 rcpFrame) {\nfloat x = pos.x + float(off.x) * rcpFrame.x;\nfloat y = pos.y + float(off.y) * rcpFrame.y;\nreturn texture2D(tex, vec2(x, y));\n}\nvec3 FxaaPixelShader(vec2 pos, sampler2D tex, vec2 rcpFrame)\n{\nvec3 rgbN = FxaaTexOff(tex, pos.xy, ivec2( 0,-1), rcpFrame).xyz;\nvec3 rgbW = FxaaTexOff(tex, pos.xy, ivec2(-1, 0), rcpFrame).xyz;\nvec3 rgbM = FxaaTexOff(tex, pos.xy, ivec2( 0, 0), rcpFrame).xyz;\nvec3 rgbE = FxaaTexOff(tex, pos.xy, ivec2( 1, 0), rcpFrame).xyz;\nvec3 rgbS = FxaaTexOff(tex, pos.xy, ivec2( 0, 1), rcpFrame).xyz;\nfloat lumaN = FxaaLuma(rgbN);\nfloat lumaW = FxaaLuma(rgbW);\nfloat lumaM = FxaaLuma(rgbM);\nfloat lumaE = FxaaLuma(rgbE);\nfloat lumaS = FxaaLuma(rgbS);\nfloat rangeMin = min(lumaM, min(min(lumaN, lumaW), min(lumaS, lumaE)));\nfloat rangeMax = max(lumaM, max(max(lumaN, lumaW), max(lumaS, lumaE)));\nfloat range = rangeMax - rangeMin;\nif(range < max(FXAA_EDGE_THRESHOLD_MIN, rangeMax * FXAA_EDGE_THRESHOLD))\n{\nreturn rgbM;\n}\nvec3 rgbL = rgbN + rgbW + rgbM + rgbE + rgbS;\nfloat lumaL = (lumaN + lumaW + lumaE + lumaS) * 0.25;\nfloat rangeL = abs(lumaL - lumaM);\nfloat blendL = max(0.0, (rangeL / range) - FXAA_SUBPIX_TRIM) * FXAA_SUBPIX_TRIM_SCALE;\nblendL = min(FXAA_SUBPIX_CAP, blendL);\nvec3 rgbNW = FxaaTexOff(tex, pos.xy, ivec2(-1,-1), rcpFrame).xyz;\nvec3 rgbNE = FxaaTexOff(tex, pos.xy, ivec2( 1,-1), rcpFrame).xyz;\nvec3 rgbSW = FxaaTexOff(tex, pos.xy, ivec2(-1, 1), rcpFrame).xyz;\nvec3 rgbSE = FxaaTexOff(tex, pos.xy, ivec2( 1, 1), rcpFrame).xyz;\nrgbL += (rgbNW + rgbNE + rgbSW + rgbSE);\nrgbL *= vec3(1.0/9.0);\nfloat lumaNW = FxaaLuma(rgbNW);\nfloat lumaNE = FxaaLuma(rgbNE);\nfloat lumaSW = FxaaLuma(rgbSW);\nfloat lumaSE = FxaaLuma(rgbSE);\nfloat edgeVert =\nabs((0.25 * lumaNW) + (-0.5 * lumaN) + (0.25 * lumaNE)) +\nabs((0.50 * lumaW ) + (-1.0 * lumaM) + (0.50 * lumaE )) +\nabs((0.25 * lumaSW) + (-0.5 * lumaS) + (0.25 * lumaSE));\nfloat edgeHorz =\nabs((0.25 * lumaNW) + (-0.5 * lumaW) + (0.25 * lumaSW)) +\nabs((0.50 * lumaN ) + (-1.0 * lumaM) + (0.50 * lumaS )) +\nabs((0.25 * lumaNE) + (-0.5 * lumaE) + (0.25 * lumaSE));\nbool horzSpan = edgeHorz >= edgeVert;\nfloat lengthSign = horzSpan ? -rcpFrame.y : -rcpFrame.x;\nif(!horzSpan)\n{\nlumaN = lumaW;\nlumaS = lumaE;\n}\nfloat gradientN = abs(lumaN - lumaM);\nfloat gradientS = abs(lumaS - lumaM);\nlumaN = (lumaN + lumaM) * 0.5;\nlumaS = (lumaS + lumaM) * 0.5;\nif (gradientN < gradientS)\n{\nlumaN = lumaS;\nlumaN = lumaS;\ngradientN = gradientS;\nlengthSign *= -1.0;\n}\nvec2 posN;\nposN.x = pos.x + (horzSpan ? 0.0 : lengthSign * 0.5);\nposN.y = pos.y + (horzSpan ? lengthSign * 0.5 : 0.0);\ngradientN *= FXAA_SEARCH_THRESHOLD;\nvec2 posP = posN;\nvec2 offNP = horzSpan ? vec2(rcpFrame.x, 0.0) : vec2(0.0, rcpFrame.y);\nfloat lumaEndN = lumaN;\nfloat lumaEndP = lumaN;\nbool doneN = false;\nbool doneP = false;\nposN += offNP * vec2(-1.0, -1.0);\nposP += offNP * vec2( 1.0, 1.0);\nfor(int i = 0; i < FXAA_SEARCH_STEPS; i++) {\nif(!doneN)\n{\nlumaEndN = FxaaLuma(texture2D(tex, posN.xy).xyz);\n}\nif(!doneP)\n{\nlumaEndP = FxaaLuma(texture2D(tex, posP.xy).xyz);\n}\ndoneN = doneN || (abs(lumaEndN - lumaN) >= gradientN);\ndoneP = doneP || (abs(lumaEndP - lumaN) >= gradientN);\nif(doneN && doneP)\n{\nbreak;\n}\nif(!doneN)\n{\nposN -= offNP;\n}\nif(!doneP)\n{\nposP += offNP;\n}\n}\nfloat dstN = horzSpan ? pos.x - posN.x : pos.y - posN.y;\nfloat dstP = horzSpan ? posP.x - pos.x : posP.y - pos.y;\nbool directionN = dstN < dstP;\nlumaEndN = directionN ? lumaEndN : lumaEndP;\nif(((lumaM - lumaN) < 0.0) == ((lumaEndN - lumaN) < 0.0))\n{\nlengthSign = 0.0;\n}\nfloat spanLength = (dstP + dstN);\ndstN = directionN ? dstN : dstP;\nfloat subPixelOffset = (0.5 + (dstN * (-1.0/spanLength))) * lengthSign;\nvec3 rgbF = texture2D(tex, vec2(\npos.x + (horzSpan ? 0.0 : subPixelOffset),\npos.y + (horzSpan ? subPixelOffset : 0.0))).xyz;\nreturn FxaaLerp3(rgbL, rgbF, blendL);\n}\nuniform sampler2D u_texture;\nuniform vec2 u_step;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = vec4(FxaaPixelShader(v_textureCoordinates, u_texture, u_step), 1.0);\n}\n"}),i("Scene/FXAA",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/FXAA"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m){"use strict";function p(t){this._texture=void 0,this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._fbo=void 0,this._command=void 0,this._viewport=new e,this._rs=void 0;var r=new a({color:new i(0,0,0,0),depth:1,owner:this});this._clearCommand=r}function f(e){e._fbo=e._fbo&&e._fbo.destroy(),e._texture=e._texture&&e._texture.destroy(),e._depthTexture=e._depthTexture&&e._depthTexture.destroy(),e._depthRenderbuffer=e._depthRenderbuffer&&e._depthRenderbuffer.destroy(),e._fbo=void 0,e._texture=void 0,e._depthTexture=void 0,e._depthRenderbuffer=void 0,r(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0)}return p.prototype.update=function(i){var n=i.drawingBufferWidth,a=i.drawingBufferHeight,p=this._texture,f=!r(p)||p.width!==n||p.height!==a;if(f&&(this._texture=this._texture&&this._texture.destroy(),this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._texture=new d({context:i,width:n,height:a,pixelFormat:o.RGBA,pixelDatatype:l.UNSIGNED_BYTE}),i.depthTexture?this._depthTexture=new d({context:i,width:n,height:a,pixelFormat:o.DEPTH_COMPONENT,pixelDatatype:l.UNSIGNED_SHORT}):this._depthRenderbuffer=new u({context:i,width:n,height:a,format:c.DEPTH_COMPONENT16})),(!r(this._fbo)||f)&&(this._fbo=this._fbo&&this._fbo.destroy(),this._fbo=new s({context:i,colorTextures:[this._texture],depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,destroyAttachments:!1})),r(this._command)||(this._command=i.createViewportQuadCommand(m,{owner:this})),this._viewport.width=n,this._viewport.height=a,r(this._rs)&&e.equals(this._rs.viewport,this._viewport)||(this._rs=h.fromCache({viewport:this._viewport})),this._command.renderState=this._rs,f){var v=this,g=new t(1/this._texture.width,1/this._texture.height);this._command.uniformMap={u_texture:function(){return v._texture},u_step:function(){return g}}}},p.prototype.execute=function(e,t){this._command.execute(e,t)},p.prototype.clear=function(e,t,r){var n=t.framebuffer;t.framebuffer=this._fbo,i.clone(r,this._clearCommand.color),this._clearCommand.execute(e,t),t.framebuffer=n},p.prototype.getColorFramebuffer=function(){return this._fbo},p.prototype.isDestroyed=function(){return!1},p.prototype.destroy=function(){return f(this),n(this)},p}),i("Scene/GetFeatureInfoFormat",["../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/definedNotNull","../Core/DeveloperError","../Core/RuntimeError","./ImageryLayerFeatureInfo"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,r){this.type=e,i(t)||("json"===e?t="application/json":"xml"===e?t="text/xml":"html"===e?t="text/html":"text"===e&&(t="text/plain")),this.format=t,i(r)||("json"===e?r=l:"xml"===e?r=u:"html"===e?r=g:"text"===e&&(r=g)),this.callback=r}function l(t){for(var i=[],n=t.features,o=0;o<n.length;++o){var s=n[o],l=new a;if(l.data=s,l.properties=s.properties,l.configureNameFromProperties(s.properties),l.configureDescriptionFromProperties(s.properties),r(s.geometry)&&"Point"===s.geometry.type){var u=s.geometry.coordinates[0],c=s.geometry.coordinates[1];l.position=e.fromDegrees(u,c)}i.push(l)}return i}function u(e){var t=e.documentElement;if("MultiFeatureCollection"===t.localName&&t.namespaceURI===_)return c(e);if("FeatureInfoResponse"===t.localName&&t.namespaceURI===y)return h(e);if("FeatureCollection"===t.localName&&t.namespaceURI===C)return d(e);if("ServiceExceptionReport"===t.localName)throw new o((new XMLSerializer).serializeToString(t));return"msGMLOutput"===t.localName?m(e):v(e)}function c(e){for(var t=[],i=e.documentElement,r=i.getElementsByTagNameNS(_,"Feature"),n=0;n<r.length;++n){for(var o=r[n],s={},l=o.getElementsByTagNameNS(_,"Val"),u=0;u<l.length;++u){var c=l[u];if(c.hasAttribute("ref")){var h=c.getAttribute("ref"),d=c.textContent.trim();s[h]=d}}var m=new a;m.data=o,m.properties=s,m.configureNameFromProperties(s),m.configureDescriptionFromProperties(s),t.push(m)}return t}function h(e){var t,i=e.documentElement,r=[],n=i.getElementsByTagNameNS("*","FIELDS");if(n.length>0)for(var o=0;o<n.length;++o){var a=n[o];t={};for(var s=a.attributes,l=0;l<s.length;++l){var u=s[l];t[u.name]=u.value}r.push(f(a,t))}else for(var c=i.getElementsByTagNameNS("*","FeatureInfo"),h=0;h<c.length;++h){var d=c[h];t={};for(var m=d.childNodes,p=0;p<m.length;++p){var v=m[p];v.nodeType===Node.ELEMENT_NODE&&(t[v.localName]=v.textContent)}r.push(f(d,t))}return r}function d(e){for(var t=[],i=e.documentElement,r=i.getElementsByTagNameNS(E,"featureMember"),n=0;n<r.length;++n){var o=r[n],a={};p(o,a),t.push(f(o,a))}return t}function m(e){for(var t,i=[],r=e.documentElement.childNodes,n=0;n<r.length;n++)if(r[n].nodeType===Node.ELEMENT_NODE){t=r[n];break}for(var o=t.childNodes,a=0;a<o.length;++a){var s=o[a];if(s.nodeType===Node.ELEMENT_NODE){var l={};p(s,l),i.push(f(s,l))}}return i}function p(e,t){for(var i=!0,r=0;r<e.childNodes.length;++r){var n=e.childNodes[r];n.nodeType===Node.ELEMENT_NODE&&(i=!1),"Point"!==n.localName&&"LineString"!==n.localName&&"Polygon"!==n.localName&&"boundedBy"!==n.localName&&n.hasChildNodes()&&p(n,t)&&(t[n.localName]=n.textContent)}return i}function f(e,t){var i=new a;return i.data=e,i.properties=t,i.configureNameFromProperties(t),i.configureDescriptionFromProperties(t),i}function v(e){var t=(new XMLSerializer).serializeToString(e),i=document.createElement("div"),r=document.createElement("pre");r.textContent=t,i.appendChild(r);var n=new a;return n.data=e,n.description=i.innerHTML,[n]}function g(e){if(!S.test(e)&&!w.test(e)){var t,i=T.exec(e);i&&i.length>1&&(t=i[1]);var r=new a;return r.name=t,r.description=e,r.data=e,[r]}}var _="http://www.mapinfo.com/mxp",y="http://www.esri.com/wms",C="http://www.opengis.net/wfs",E="http://www.opengis.net/gml",S=/<body>\s*<\/body>/im,w=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,T=/<title>([\s\S]*)<\/title>/im;return s}),i("Shaders/GlobeFS",[],function(){"use strict";return"uniform vec4 u_initialColor;\n#if TEXTURE_UNITS > 0\nuniform sampler2D u_dayTextures[TEXTURE_UNITS];\nuniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];\n#ifdef APPLY_ALPHA\nuniform float u_dayTextureAlpha[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_BRIGHTNESS\nuniform float u_dayTextureBrightness[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_CONTRAST\nuniform float u_dayTextureContrast[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_HUE\nuniform float u_dayTextureHue[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_SATURATION\nuniform float u_dayTextureSaturation[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_GAMMA\nuniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];\n#endif\nuniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS];\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nuniform sampler2D u_waterMask;\nuniform vec4 u_waterMaskTranslationAndScale;\nuniform float u_zoomedOutOceanSpecularIntensity;\n#endif\n#ifdef SHOW_OCEAN_WAVES\nuniform sampler2D u_oceanNormalMap;\n#endif\n#ifdef ENABLE_DAYNIGHT_SHADING\nuniform vec2 u_lightingFadeDistance;\n#endif\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef FOG\nvarying float v_distance;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\n#endif\nvec4 sampleAndBlend(\nvec4 previousColor,\nsampler2D texture,\nvec2 tileTextureCoordinates,\nvec4 textureCoordinateRectangle,\nvec4 textureCoordinateTranslationAndScale,\nfloat textureAlpha,\nfloat textureBrightness,\nfloat textureContrast,\nfloat textureHue,\nfloat textureSaturation,\nfloat textureOneOverGamma)\n{\nvec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nalphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nvec2 translation = textureCoordinateTranslationAndScale.xy;\nvec2 scale = textureCoordinateTranslationAndScale.zw;\nvec2 textureCoordinates = tileTextureCoordinates * scale + translation;\nvec4 value = texture2D(texture, textureCoordinates);\nvec3 color = value.rgb;\nfloat alpha = value.a;\n#ifdef APPLY_BRIGHTNESS\ncolor = mix(vec3(0.0), color, textureBrightness);\n#endif\n#ifdef APPLY_CONTRAST\ncolor = mix(vec3(0.5), color, textureContrast);\n#endif\n#ifdef APPLY_HUE\ncolor = czm_hue(color, textureHue);\n#endif\n#ifdef APPLY_SATURATION\ncolor = czm_saturation(color, textureSaturation);\n#endif\n#ifdef APPLY_GAMMA\ncolor = pow(color, vec3(textureOneOverGamma));\n#endif\nfloat sourceAlpha = alpha * textureAlpha;\nfloat outAlpha = mix(previousColor.a, 1.0, sourceAlpha);\nvec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;\nreturn vec4(outColor, outAlpha);\n}\nvec4 computeDayColor(vec4 initialColor, vec2 textureCoordinates);\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue);\nvoid main()\n{\nvec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0));\n#ifdef SHOW_TILE_BOUNDARIES\nif (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||\nv_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))\n{\ncolor = vec4(1.0, 0.0, 0.0, 1.0);\n}\n#endif\n#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING)\nvec3 normalMC = normalize(czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\nvec3 normalEC = normalize(czm_normal3D * normalMC);\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nvec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;\nvec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;\nvec2 waterMaskTextureCoordinates = v_textureCoordinates * waterMaskScale + waterMaskTranslation;\nfloat mask = texture2D(u_waterMask, waterMaskTextureCoordinates).r;\nif (mask > 0.0)\n{\nmat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);\nvec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC);\nvec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx);\nvec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z));\ncolor = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask);\n}\n#endif\n#ifdef ENABLE_VERTEX_LIGHTING\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_sunDirectionEC, normalize(v_normalEC)) * 0.9 + 0.3, 0.0, 1.0);\nvec4 finalColor = vec4(color.rgb * diffuseIntensity, color.a);\n#elif defined(ENABLE_DAYNIGHT_SHADING)\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_sunDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);\nfloat cameraDist = length(czm_view[3]);\nfloat fadeOutDist = u_lightingFadeDistance.x;\nfloat fadeInDist = u_lightingFadeDistance.y;\nfloat t = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);\ndiffuseIntensity = mix(1.0, diffuseIntensity, t);\nvec4 finalColor = vec4(color.rgb * diffuseIntensity, color.a);\n#else\nvec4 finalColor = color;\n#endif\n#ifdef FOG\nconst float fExposure = 2.0;\nvec3 fogColor = v_mieColor + finalColor.rgb * v_rayleighColor;\nfogColor = vec3(1.0) - exp(-fExposure * fogColor);\ngl_FragColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor), finalColor.a);\n#else\ngl_FragColor = finalColor;\n#endif\n}\n#ifdef SHOW_REFLECTIVE_OCEAN\nfloat waveFade(float edge0, float edge1, float x)\n{\nfloat y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\nreturn pow(1.0 - y, 5.0);\n}\nfloat linearFade(float edge0, float edge1, float x)\n{\nreturn clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n}\nconst float oceanFrequencyLowAltitude = 825000.0;\nconst float oceanAnimationSpeedLowAltitude = 0.004;\nconst float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;\nconst float oceanSpecularIntensity = 0.5;\nconst float oceanFrequencyHighAltitude = 125000.0;\nconst float oceanAnimationSpeedHighAltitude = 0.008;\nconst float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0;\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue)\n{\nvec3 positionToEyeEC = -positionEyeCoordinates;\nfloat positionToEyeECLength = length(positionToEyeEC);\nvec3 normalizedpositionToEyeEC = normalize(normalize(positionToEyeEC));\nfloat waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);\n#ifdef SHOW_OCEAN_WAVES\nfloat time = czm_frameNumber * oceanAnimationSpeedHighAltitude;\nvec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0);\nvec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude);\ntime = czm_frameNumber * oceanAnimationSpeedLowAltitude;\nnoise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0);\nvec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude);\nfloat highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength);\nfloat lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength);\nvec3 normalTangentSpace =\n(highAltitudeFade * normalTangentSpaceHighAltitude) +\n(lowAltitudeFade * normalTangentSpaceLowAltitude);\nnormalTangentSpace = normalize(normalTangentSpace);\nnormalTangentSpace.xy *= waveIntensity;\nnormalTangentSpace = normalize(normalTangentSpace);\n#else\nvec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);\n#endif\nvec3 normalEC = enuToEye * normalTangentSpace;\nconst vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);\nfloat diffuseIntensity = czm_getLambertDiffuse(czm_sunDirectionEC, normalEC) * maskValue;\nvec3 diffuseHighlight = waveHighlightColor * diffuseIntensity;\n#ifdef SHOW_OCEAN_WAVES\nfloat tsPerturbationRatio = normalTangentSpace.z;\nvec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);\n#else\nvec3 nonDiffuseHighlight = vec3(0.0);\n#endif\nfloat specularIntensity = czm_getSpecular(czm_sunDirectionEC, normalizedpositionToEyeEC, normalEC, 10.0) + 0.25 * czm_getSpecular(czm_moonDirectionEC, normalizedpositionToEyeEC, normalEC, 10.0);\nfloat surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);\nfloat specular = specularIntensity * surfaceReflectance;\nreturn vec4(imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular, imageryColor.a);\n}\n#endif\n"}),i("Shaders/GlobeVS",[],function(){"use strict";return"#ifdef QUANTIZATION_BITS12\nattribute vec4 compressed;\n#else\nattribute vec4 position3DAndHeight;\nattribute vec3 textureCoordAndEncodedNormals;\n#endif\nuniform vec3 u_center3D;\nuniform mat4 u_modifiedModelView;\nuniform vec4 u_tileRectangle;\nuniform vec2 u_southAndNorthLatitude;\nuniform vec2 u_southMercatorYAndOneOverHeight;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef FOG\nvarying float v_distance;\nvarying vec3 v_mieColor;\nvarying vec3 v_rayleighColor;\n#endif\nvec4 getPosition(vec3 position, float height, vec2 textureCoordinates);\nfloat get2DYPositionFraction(vec2 textureCoordinates);\nvec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn czm_projection * (u_modifiedModelView * vec4(position, 1.0));\n}\nfloat get2DMercatorYPositionFraction(vec2 textureCoordinates)\n{\nconst float maxTileWidth = 0.003068;\nfloat positionFraction = textureCoordinates.y;\nfloat southLatitude = u_southAndNorthLatitude.x;\nfloat northLatitude = u_southAndNorthLatitude.y;\nif (northLatitude - southLatitude > maxTileWidth)\n{\nfloat southMercatorY = u_southMercatorYAndOneOverHeight.x;\nfloat oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y;\nfloat currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y);\ncurrentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);\npositionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight);\n}\nreturn positionFraction;\n}\nfloat get2DGeographicYPositionFraction(vec2 textureCoordinates)\n{\nreturn textureCoordinates.y;\n}\nvec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates)\n{\nfloat yPositionFraction = get2DYPositionFraction(textureCoordinates);\nvec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nreturn czm_projection * (u_modifiedModelView * rtcPosition2D);\n}\nvec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn getPositionPlanarEarth(position, 0.0, textureCoordinates);\n}\nvec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn getPositionPlanarEarth(position, height, textureCoordinates);\n}\nvec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates)\n{\nvec3 position3DWC = position + u_center3D;\nfloat yPositionFraction = get2DYPositionFraction(textureCoordinates);\nvec4 position2DWC = vec4(0.0, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nvec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);\nreturn czm_modelViewProjection * morphPosition;\n}\n#ifdef QUANTIZATION_BITS12\nuniform vec2 u_minMaxHeight;\nuniform mat4 u_scaleAndBias;\n#endif\nvoid main()\n{\n#ifdef QUANTIZATION_BITS12\nvec2 xy = czm_decompressTextureCoordinates(compressed.x);\nvec2 zh = czm_decompressTextureCoordinates(compressed.y);\nvec3 position = vec3(xy, zh.x);\nfloat height = zh.y;\nvec2 textureCoordinates = czm_decompressTextureCoordinates(compressed.z);\nfloat encodedNormal = compressed.w;\nheight = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x;\nposition = (u_scaleAndBias * vec4(position, 1.0)).xyz;\n#else\nvec3 position = position3DAndHeight.xyz;\nfloat height = position3DAndHeight.w;\nvec2 textureCoordinates = textureCoordAndEncodedNormals.xy;\nfloat encodedNormal = textureCoordAndEncodedNormals.z;\n#endif\nvec3 position3DWC = position + u_center3D;\ngl_Position = getPosition(position, height, textureCoordinates);\nv_textureCoordinates = textureCoordinates;\n#if defined(ENABLE_VERTEX_LIGHTING)\nv_positionEC = (czm_modelView3D * vec4(position3DWC, 1.0)).xyz;\nv_positionMC = position3DWC;\nv_normalMC = czm_octDecode(encodedNormal);\nv_normalEC = czm_normal3D * v_normalMC;\n#elif defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING)\nv_positionEC = (czm_modelView3D * vec4(position3DWC, 1.0)).xyz;\nv_positionMC = position3DWC;\n#endif\n#ifdef FOG\nAtmosphereColor atmosColor = computeGroundAtmosphereFromSpace(position3DWC);\nv_mieColor = atmosColor.mie;\nv_rayleighColor = atmosColor.rayleigh;\nv_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);\n#endif\n}\n"}),i("Shaders/GroundAtmosphere",[],function(){"use strict";return"const float fInnerRadius = 6378137.0;\nconst float fOuterRadius = 6378137.0 * 1.025;\nconst float fOuterRadius2 = fOuterRadius * fOuterRadius;\nconst float Kr = 0.0025;\nconst float Km = 0.0015;\nconst float ESun = 15.0;\nconst float fKrESun = Kr * ESun;\nconst float fKmESun = Km * ESun;\nconst float fKr4PI = Kr * 4.0 * czm_pi;\nconst float fKm4PI = Km * 4.0 * czm_pi;\nconst float fScale = 1.0 / (fOuterRadius - fInnerRadius);\nconst float fScaleDepth = 0.25;\nconst float fScaleOverScaleDepth = fScale / fScaleDepth;\nstruct AtmosphereColor\n{\nvec3 mie;\nvec3 rayleigh;\n};\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nfloat scale(float fCos)\n{\nfloat x = 1.0 - fCos;\nreturn fScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nAtmosphereColor computeGroundAtmosphereFromSpace(vec3 v3Pos)\n{\nvec3 v3InvWavelength = vec3(1.0 / pow(0.650, 4.0), 1.0 / pow(0.570, 4.0), 1.0 / pow(0.475, 4.0));\nvec3 v3Ray = v3Pos - czm_viewerPositionWC;\nfloat fFar = length(v3Ray);\nv3Ray /= fFar;\nfloat fCameraHeight = length(czm_viewerPositionWC);\nfloat fCameraHeight2 = fCameraHeight * fCameraHeight;\nfloat B = 2.0 * length(czm_viewerPositionWC) * dot(normalize(czm_viewerPositionWC), v3Ray);\nfloat C = fCameraHeight2 - fOuterRadius2;\nfloat fDet = max(0.0, B*B - 4.0 * C);\nfloat fNear = 0.5 * (-B - sqrt(fDet));\nvec3 v3Start = czm_viewerPositionWC + v3Ray * fNear;\nfFar -= fNear;\nfloat fDepth = exp((fInnerRadius - fOuterRadius) / fScaleDepth);\nfloat fLightAngle = 1.0;\nfloat fCameraAngle = dot(-v3Ray, v3Pos) / length(v3Pos);\nfloat fCameraScale = scale(fCameraAngle);\nfloat fLightScale = scale(fLightAngle);\nfloat fCameraOffset = fDepth*fCameraScale;\nfloat fTemp = (fLightScale + fCameraScale);\nfloat fSampleLength = fFar / fSamples;\nfloat fScaledLength = fSampleLength * fScale;\nvec3 v3SampleRay = v3Ray * fSampleLength;\nvec3 v3SamplePoint = v3Start + v3SampleRay * 0.5;\nvec3 v3FrontColor = vec3(0.0);\nvec3 v3Attenuate = vec3(0.0);\nfor(int i=0; i<nSamples; i++)\n{\nfloat fHeight = length(v3SamplePoint);\nfloat fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fHeight));\nfloat fScatter = fDepth*fTemp - fCameraOffset;\nv3Attenuate = exp(-fScatter * (v3InvWavelength * fKr4PI + fKm4PI));\nv3FrontColor += v3Attenuate * (fDepth * fScaledLength);\nv3SamplePoint += v3SampleRay;\n}\nAtmosphereColor color;\ncolor.mie = v3FrontColor * (v3InvWavelength * fKrESun + fKmESun);\ncolor.rayleigh = v3Attenuate;\nreturn color;\n}\n"}),i("Scene/GlobeSurfaceShaderSet",["../Core/defined","../Core/destroyObject","../Core/TerrainQuantization","../Renderer/ShaderProgram","../Scene/SceneMode"],function(e,t,i,r,n){ +"use strict";function o(e,t,i){this.numberOfDayTextures=e,this.flags=t,this.shaderProgram=i}function a(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this._pickShaderPrograms=[]}function s(e){var t,i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",r="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition2DMode(position, height, textureCoordinates); }",o="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",a="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }";switch(e){case n.SCENE3D:t=i;break;case n.SCENE2D:t=r;break;case n.COLUMBUS_VIEW:t=o;break;case n.MORPHING:t=a}return t}function l(e){var t="float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }",i="float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }";return e?i:t}return a.prototype.getShaderProgram=function(t,n,a,u,c,h,d,m,p,f,v,g,_,y,C){var E=0,S="",w=n.pickTerrain.mesh.encoding,T=w.quantization;T===i.BITS12&&(E=1,S="QUANTIZATION_BITS12");var x=t.mode,b=x|u<<2|c<<3|h<<4|d<<5|m<<6|p<<7|f<<8|v<<9|g<<10|_<<11|y<<12|C<<13|E<<14,A=n.surfaceShader;if(e(A)&&A.numberOfDayTextures===a&&A.flags===b)return A.shaderProgram;var P=this._shadersByTexturesFlags[a];if(e(P)||(P=this._shadersByTexturesFlags[a]=[]),A=P[b],!e(A)){var I=this.baseVertexShaderSource.clone(),M=this.baseFragmentShaderSource.clone();I.defines.push(S),M.defines.push("TEXTURE_UNITS "+a),u&&M.defines.push("APPLY_BRIGHTNESS"),c&&M.defines.push("APPLY_CONTRAST"),h&&M.defines.push("APPLY_HUE"),d&&M.defines.push("APPLY_SATURATION"),m&&M.defines.push("APPLY_GAMMA"),p&&M.defines.push("APPLY_ALPHA"),f&&(M.defines.push("SHOW_REFLECTIVE_OCEAN"),I.defines.push("SHOW_REFLECTIVE_OCEAN")),v&&M.defines.push("SHOW_OCEAN_WAVES"),g&&(_?(I.defines.push("ENABLE_VERTEX_LIGHTING"),M.defines.push("ENABLE_VERTEX_LIGHTING")):(I.defines.push("ENABLE_DAYNIGHT_SHADING"),M.defines.push("ENABLE_DAYNIGHT_SHADING"))),C&&(I.defines.push("FOG"),M.defines.push("FOG"));for(var D=" vec4 computeDayColor(vec4 initialColor, vec2 textureCoordinates)\n {\n vec4 color = initialColor;\n",R=0;a>R;++R)D+=" color = sampleAndBlend(\n color,\n u_dayTextures["+R+"],\n textureCoordinates,\n u_dayTextureTexCoordsRectangle["+R+"],\n u_dayTextureTranslationAndScale["+R+"],\n "+(p?"u_dayTextureAlpha["+R+"]":"1.0")+",\n "+(u?"u_dayTextureBrightness["+R+"]":"0.0")+",\n "+(c?"u_dayTextureContrast["+R+"]":"0.0")+",\n "+(h?"u_dayTextureHue["+R+"]":"0.0")+",\n "+(d?"u_dayTextureSaturation["+R+"]":"0.0")+",\n "+(m?"u_dayTextureOneOverGamma["+R+"]":"0.0")+"\n );\n";D+=" return color;\n }",M.sources.push(D),I.sources.push(s(x)),I.sources.push(l(y));var O=r.fromCache({context:t.context,vertexShaderSource:I,fragmentShaderSource:M,attributeLocations:w.getAttributeLocations()});A=P[b]=new o(a,b,O)}return n.surfaceShader=A,A.shaderProgram},a.prototype.getPickShaderProgram=function(t,n,o){var a=0,u="",c=n.pickTerrain.mesh.encoding,h=c.quantization;h===i.BITS12&&(a=1,u="QUANTIZATION_BITS12");var d=t.mode,m=d|o<<2|a<<3,p=this._pickShaderPrograms[m];if(!e(p)){var f=this.baseVertexShaderSource.clone();f.defines.push(u),f.sources.push(s(d)),f.sources.push(l(o));var v="void main()\n{\n gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n}\n";p=this._pickShaderPrograms[m]=r.fromCache({context:t.context,vertexShaderSource:f,fragmentShaderSource:v,attributeLocations:c.getAttributeLocations()})}return p},a.prototype.destroy=function(){var i=this._shadersByTexturesFlags;for(var r in i)if(i.hasOwnProperty(r)){var n=i[r];if(!e(n))continue;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];e(a)&&a.shaderProgram.destroy()}}return t(this)},a}),i("Scene/ImageryState",["../Core/freezeObject"],function(e){"use strict";var t={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7};return e(t)}),i("Scene/QuadtreeTileLoadState",["../Core/freezeObject"],function(e){"use strict";var t={START:0,LOADING:1,DONE:2,FAILED:3};return e(t)}),i("Scene/TerrainState",["../Core/freezeObject"],function(e){"use strict";var t={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6};return e(t)}),i("Scene/TileBoundingBox",["../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/Rectangle","./SceneMode"],function(e,t,i,r,n,o,a,s){"use strict";function l(t,i,r){r.cartographicToCartesian(a.southwest(i),t.southwestCornerCartesian),r.cartographicToCartesian(a.northeast(i),t.northeastCornerCartesian),p.longitude=i.west,p.latitude=.5*(i.south+i.north),p.height=0;var n=r.cartographicToCartesian(p,d),o=e.cross(n,e.UNIT_Z,c);e.normalize(o,t.westNormal),p.longitude=i.east;var s=r.cartographicToCartesian(p,m),l=e.cross(e.UNIT_Z,s,c);e.normalize(l,t.eastNormal);var u=r.geodeticSurfaceNormalCartographic(a.southeast(i),h),f=e.subtract(n,s,c),v=e.cross(u,f,h);e.normalize(v,t.southNormal);var g=r.geodeticSurfaceNormalCartographic(a.northwest(i),h),_=e.cross(f,g,h);e.normalize(_,t.northNormal)}var u=function(t){t=i(t,i.EMPTY_OBJECT),this.rectangle=a.clone(t.rectangle),this.minimumHeight=i(t.minimumHeight,0),this.maximumHeight=i(t.maximumHeight,0),this.southwestCornerCartesian=new e,this.northeastCornerCartesian=new e,this.westNormal=new e,this.southNormal=new e,this.eastNormal=new e,this.northNormal=new e;var r=i(t.ellipsoid,o.WGS84);l(this,t.rectangle,r)},c=new e,h=new e,d=new e,m=new e,p=new t,f=new e,v=new e,g=new e(0,-1,0),_=new e(0,0,-1),y=new e;return u.prototype.distanceToCamera=function(t){var i=t.camera,r=i.positionWC,n=i.positionCartographic,o=0;if(!a.contains(this.rectangle,n)){var l=this.southwestCornerCartesian,u=this.northeastCornerCartesian,c=this.westNormal,h=this.southNormal,d=this.eastNormal,m=this.northNormal;t.mode!==s.SCENE3D&&(l=t.mapProjection.project(a.southwest(this.rectangle),f),l.z=l.y,l.y=l.x,l.x=0,u=t.mapProjection.project(a.northeast(this.rectangle),v),u.z=u.y,u.y=u.x,u.x=0,c=g,d=e.UNIT_Y,h=_,m=e.UNIT_Z);var p=e.subtract(r,l,y),C=e.dot(p,c),E=e.dot(p,h),S=e.subtract(r,u,y),w=e.dot(S,d),T=e.dot(S,m);C>0?o+=C*C:w>0&&(o+=w*w),E>0?o+=E*E:T>0&&(o+=T*T)}var x;x=t.mode===s.SCENE3D?n.height:r.x;var b=t.mode===s.SCENE3D?this.maximumHeight:0,A=x-b;return A>0&&(o+=A*A),Math.sqrt(o)},u}),i("Scene/TileTerrain",["../Core/BoundingSphere","../Core/Cartesian3","../Core/ComponentDatatype","../Core/defined","../Core/DeveloperError","../Core/IndexDatatype","../Core/OrientedBoundingBox","../Core/TileProviderError","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/VertexArray","../ThirdParty/when","./TerrainState","./TileBoundingBox"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m){"use strict";function p(e){this.state=d.UNLOADED,this.data=void 0,this.mesh=void 0,this.vertexArray=void 0,this.upsampleDetails=e}function f(e,t,i,n,o){function a(t){e.data=t,e.state=d.RECEIVED}function l(){e.state=d.FAILED;var r="Failed to obtain terrain tile X: "+i+" Y: "+n+" Level: "+o+".";t._requestError=s.handleError(t._requestError,t,t.errorEvent,r,i,n,o,u)}function u(){e.data=t.requestTileGeometry(i,n,o),r(e.data)?(e.state=d.RECEIVING,h(e.data,a,l)):e.state=d.UNLOADED}u()}function v(e,t,i,n,o,a){var s=i.tilingScheme,l=e.data,u=l.createMesh(s,n,o,a,t.terrainExaggeration);r(u)&&(e.state=d.TRANSFORMING,h(u,function(t){e.mesh=t,e.state=d.TRANSFORMED},function(){e.state=d.FAILED}))}function g(e,t,i,n,a,s){var h=e.mesh.vertices,m=l.createVertexBuffer({context:t,typedArray:h,usage:u.STATIC_DRAW}),p=e.mesh.encoding.getAttributes(m),f=e.mesh.indices.indexBuffers||{},v=f[t.id];if(!r(v)||v.isDestroyed()){var g=e.mesh.indices,_=2===g.BYTES_PER_ELEMENT?o.UNSIGNED_SHORT:o.UNSIGNED_INT;v=l.createIndexBuffer({context:t,typedArray:g,usage:u.STATIC_DRAW,indexDatatype:_}),v.vertexArrayDestroyable=!1,v.referenceCount=1,f[t.id]=v,e.mesh.indices.indexBuffers=f}else++v.referenceCount;e.vertexArray=new c({context:t,attributes:p,indexBuffer:v}),e.state=d.READY}return p.prototype.freeResources=function(){if(this.state=d.UNLOADED,this.data=void 0,this.mesh=void 0,r(this.vertexArray)){var e=this.vertexArray.indexBuffer;this.vertexArray.destroy(),this.vertexArray=void 0,!e.isDestroyed()&&r(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy())}},p.prototype.publishToTile=function(i){var r=i.data,n=this.mesh;t.clone(n.center,r.center),r.minimumHeight=n.minimumHeight,r.maximumHeight=n.maximumHeight,r.boundingSphere3D=e.clone(n.boundingSphere3D,r.boundingSphere3D),r.orientedBoundingBox=a.clone(n.orientedBoundingBox,r.orientedBoundingBox),r.tileBoundingBox=new m({rectangle:i.rectangle,minimumHeight:n.minimumHeight,maximumHeight:n.maximumHeight,ellipsoid:i.tilingScheme.ellipsoid}),i.data.occludeePointInScaledSpace=t.clone(n.occludeePointInScaledSpace,r.occludeePointInScaledSpace),r.freeVertexArray(),r.vertexArray=this.vertexArray,this.vertexArray=void 0},p.prototype.processLoadStateMachine=function(e,t,i,r,n){this.state===d.UNLOADED&&f(this,t,i,r,n),this.state===d.RECEIVED&&v(this,e,t,i,r,n),this.state===d.TRANSFORMED&&g(this,e.context,t,i,r,n)},p.prototype.processUpsampleStateMachine=function(e,t,i,n,o){if(this.state===d.UNLOADED){var a=this.upsampleDetails,s=a.data,l=a.x,u=a.y,c=a.level;if(this.data=s.upsample(t.tilingScheme,l,u,c,i,n,o),!r(this.data))return;this.state=d.RECEIVING;var m=this;h(this.data,function(e){m.data=e,m.state=d.RECEIVED},function(){m.state=d.FAILED})}this.state===d.RECEIVED&&v(this,e,t,i,n,o),this.state===d.TRANSFORMED&&g(this,e.context,t,i,n,o)},p}),i("Scene/GlobeSurfaceTile",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/IntersectionTests","../Core/PixelFormat","../Core/Rectangle","../Renderer/PixelDatatype","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","./ImageryState","./QuadtreeTileLoadState","./SceneMode","./TerrainState","./TileBoundingBox","./TileTerrain"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E){"use strict";function S(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new i(0,0,1,1),this.terrainData=void 0,this.center=new t,this.vertexArray=void 0,this.minimumHeight=0,this.maximumHeight=0,this.boundingSphere3D=new e,this.boundingSphere2D=new e,this.orientedBoundingBox=void 0,this.tileBoundingBox=void 0,this.occludeePointInScaledSpace=new t,this.loadedTerrain=void 0,this.upsampledTerrain=void 0,this.pickBoundingSphere=new e,this.pickTerrain=void 0,this.surfaceShader=void 0}function w(e,i,r,n,a,s){if(e.decodePosition(n,a,s),o(i)&&i!==_.SCENE3D){var l=r.ellipsoid,u=l.cartesianToCartographic(s);r.project(u,s),t.fromElements(s.z,s.x,s.y,s)}return s}function T(e,t,i){var r=e.data,n=b(e);o(n)&&(r.upsampledTerrain=new E(n)),I(e,t)&&(r.loadedTerrain=new E);for(var a=0,s=i.length;s>a;++a){var l=i.get(a);l.show&&l._createTileImagerySkeletons(e,t)}}function x(e,t,i){var r=e.data,a=r.loadedTerrain,s=r.upsampledTerrain,l=!1;o(a)&&(a.processLoadStateMachine(t,i,e.x,e.y,e.level),a.state>=y.RECEIVED&&(r.terrainData!==a.data&&(r.terrainData=a.data,D(t.context,r),P(e)),l=!0),a.state===y.READY?(a.publishToTile(e),r.pickTerrain=n(r.loadedTerrain,r.upsampledTerrain),r.loadedTerrain=void 0,r.upsampledTerrain=void 0):a.state===y.FAILED&&(r.loadedTerrain=void 0)),!l&&o(s)&&(s.processUpsampleStateMachine(t,i,e.x,e.y,e.level),s.state>=y.RECEIVED&&r.terrainData!==s.data&&(r.terrainData=s.data,i.hasWaterMask&&R(e),A(e)),s.state===y.READY?(s.publishToTile(e),r.pickTerrain=r.upsampledTerrain,r.upsampledTerrain=void 0):s.state===y.FAILED&&(r.upsampledTerrain=void 0))}function b(e){for(var t=e.parent;o(t)&&o(t.data)&&!o(t.data.terrainData);)t=t.parent;return o(t)&&o(t.data)?{data:t.data.terrainData,x:t.x,y:t.y,level:t.level}:void 0}function A(e){var t=e.data;if(o(e._children))for(var i=0;4>i;++i){var r=e._children[i];if(r.state!==g.START){var n=r.data;if(o(n.terrainData)&&!n.terrainData.wasCreatedByUpsampling())continue;o(n.upsampledTerrain)&&n.upsampledTerrain.freeResources(),n.upsampledTerrain=new E({data:t.terrainData,x:e.x,y:e.y,level:e.level}),r.state=g.LOADING}}}function P(e){var t=e.data;if(o(e.children))for(var i=0;4>i;++i){var r=e.children[i];if(r.state!==g.START){var n=r.data;if(o(n.terrainData)&&!n.terrainData.wasCreatedByUpsampling())continue;o(n.upsampledTerrain)&&n.upsampledTerrain.freeResources(),n.upsampledTerrain=new E({data:t.terrainData,x:e.x,y:e.y,level:e.level}),t.terrainData.isChildAvailable(e.x,e.y,r.x,r.y)&&(o(n.loadedTerrain)||(n.loadedTerrain=new E)),r.state=g.LOADING}}}function I(e,t){var i=t.getTileDataAvailable(e.x,e.y,e.level);if(o(i))return i;var r=e.parent;return o(r)?o(r.data)&&o(r.data.terrainData)?r.data.terrainData.isChildAvailable(r.x,r.y,e.x,e.y):!1:!0}function M(e){var t=e.cache.tile_waterMaskData;if(!o(t)){var i=new d({context:e,pixelFormat:l.LUMINANCE,pixelDatatype:c.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});i.referenceCount=1;var r=new h({wrapS:f.CLAMP_TO_EDGE,wrapT:f.CLAMP_TO_EDGE,minificationFilter:p.LINEAR,magnificationFilter:m.LINEAR});t={allWaterTexture:i,sampler:r,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function D(e,t){var r=t.waterMaskTexture;o(r)&&(--r.referenceCount,0===r.referenceCount&&r.destroy(),t.waterMaskTexture=void 0);var n=t.terrainData.waterMask;if(o(n)){var a,s=M(e),u=n.length;if(1===u){if(0===n[0])return;a=s.allWaterTexture}else{var h=Math.sqrt(u);a=new d({context:e,pixelFormat:l.LUMINANCE,pixelDatatype:c.UNSIGNED_BYTE,source:{width:h,height:h,arrayBufferView:n},sampler:s.sampler}),a.referenceCount=0}++a.referenceCount,t.waterMaskTexture=a,i.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}}function R(e){for(var t=e.data,i=e.parent;o(i)&&!o(i.data.terrainData)||i.data.terrainData.wasCreatedByUpsampling();)i=i.parent;if(o(i)&&o(i.data.waterMaskTexture)){t.waterMaskTexture=i.data.waterMaskTexture,++t.waterMaskTexture.referenceCount;var r=i.rectangle,n=e.rectangle,a=n.width,s=n.height,l=a/r.width,u=s/r.height;t.waterMaskTranslationAndScale.x=l*(n.west-r.west)/a,t.waterMaskTranslationAndScale.y=u*(n.south-r.south)/s,t.waterMaskTranslationAndScale.z=l,t.waterMaskTranslationAndScale.w=u}}a(S.prototype,{eligibleForUnloading:{get:function(){for(var e=this.loadedTerrain,t=o(e)&&(e.state===y.RECEIVING||e.state===y.TRANSFORMING),i=this.upsampledTerrain,r=o(i)&&(i.state===y.RECEIVING||i.state===y.TRANSFORMING),n=!t&&!r,a=this.imagery,s=0,l=a.length;n&&l>s;++s){var u=a[s];n=!o(u.loadingImagery)||u.loadingImagery.state!==v.TRANSITIONING}return n}}});var O=new t,N=new t,L=new t,F=new t;return S.prototype.pick=function(e,i,r,n,a){var l=this.pickTerrain;if(o(l)){var u=l.mesh;if(o(u))for(var c=u.vertices,h=u.indices,d=u.encoding,m=h.length,p=0;m>p;p+=3){var f=h[p],v=h[p+1],g=h[p+2],_=w(d,i,r,c,f,O),y=w(d,i,r,c,v,N),C=w(d,i,r,c,g,L),E=s.rayTriangle(e,_,y,C,n,F);if(o(E))return t.clone(E,a)}}},S.prototype.freeResources=function(){o(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,o(this.loadedTerrain)&&(this.loadedTerrain.freeResources(),this.loadedTerrain=void 0),o(this.upsampledTerrain)&&(this.upsampledTerrain.freeResources(),this.upsampledTerrain=void 0),o(this.pickTerrain)&&(this.pickTerrain.freeResources(),this.pickTerrain=void 0);var e,t,i=this.imagery;for(e=0,t=i.length;t>e;++e)i[e].freeResources();this.imagery.length=0,this.freeVertexArray()},S.prototype.freeVertexArray=function(){var e;o(this.vertexArray)&&(e=this.vertexArray.indexBuffer,this.vertexArray=this.vertexArray.destroy(),!e.isDestroyed()&&o(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy())),o(this.wireframeVertexArray)&&(e=this.wireframeVertexArray.indexBuffer,this.wireframeVertexArray=this.wireframeVertexArray.destroy(),!e.isDestroyed()&&o(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy()))},S.processStateMachine=function(e,t,i,r){var n=e.data;o(n)||(n=e.data=new S),e.state===g.START&&(T(e,i,r),e.state=g.LOADING),e.state===g.LOADING&&x(e,t,i);for(var a=o(n.vertexArray),s=!o(n.loadedTerrain)&&!o(n.upsampledTerrain),l=o(n.terrainData)&&n.terrainData.wasCreatedByUpsampling(),u=n.imagery,c=0,h=u.length;h>c;++c){var d=u[c];if(o(d.loadingImagery)){if(d.loadingImagery.state===v.PLACEHOLDER){var m=d.loadingImagery.imageryLayer;if(m.imageryProvider.ready){d.freeResources(),u.splice(c,1),m._createTileImagerySkeletons(e,i,c),--c,h=u.length;continue}l=!1}var p=d.processStateMachine(e,t);s=s&&p,a=a&&(p||o(d.readyImagery)),l=l&&o(d.loadingImagery)&&(d.loadingImagery.state===v.FAILED||d.loadingImagery.state===v.INVALID)}else l=!1}e.upsampledFromParent=l,c===h&&(a&&(e.renderable=!0),s&&(e.state=g.DONE))},S}),i("Shaders/ReprojectWebMercatorFS",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),i("Shaders/ReprojectWebMercatorVS",[],function(){"use strict";return"attribute vec4 position;\nattribute float webMercatorT;\nuniform vec2 u_textureDimensions;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nv_textureCoordinates = vec2(position.x, webMercatorT);\ngl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0));\n}\n"}),i("Scene/Imagery",["../Core/defined","../Core/destroyObject","./ImageryState"],function(e,t,i){"use strict";function r(t,r,n,o,a){if(this.imageryLayer=t,this.x=r,this.y=n,this.level=o,0!==o){var s=r/2|0,l=n/2|0,u=o-1;this.parent=t.getImageryFromCache(s,l,u)}if(this.state=i.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.credits=void 0,this.referenceCount=0,!e(a)&&t.imageryProvider.ready){var c=t.imageryProvider.tilingScheme;a=c.tileXYToRectangle(r,n,o)}this.rectangle=a}return r.createPlaceholder=function(e){var t=new r(e,0,0,0);return t.addReference(),t.state=i.PLACEHOLDER,t},r.prototype.addReference=function(){++this.referenceCount},r.prototype.releaseReference=function(){return--this.referenceCount,0===this.referenceCount?(this.imageryLayer.removeImageryFromCache(this),e(this.parent)&&this.parent.releaseReference(),e(this.image)&&e(this.image.destroy)&&this.image.destroy(),e(this.texture)&&this.texture.destroy(),t(this),0):this.referenceCount},r.prototype.processStateMachine=function(e){this.state===i.UNLOADED&&(this.state=i.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===i.RECEIVED&&(this.state=i.TRANSITIONING,this.imageryLayer._createTexture(e.context,this)),this.state===i.TEXTURE_LOADED&&(this.state=i.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this))},r}),i("Scene/TileImagery",["../Core/defined","./ImageryState"],function(e,t){"use strict";function i(e,t){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0}return i.prototype.freeResources=function(){e(this.readyImagery)&&this.readyImagery.releaseReference(),e(this.loadingImagery)&&this.loadingImagery.releaseReference()},i.prototype.processStateMachine=function(i,r){var n=this.loadingImagery,o=n.imageryLayer;if(n.processStateMachine(r),n.state===t.READY)return e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(i,this),!0;for(var a,s=n.parent;e(s)&&s.state!==t.READY;)s.state!==t.FAILED&&s.state!==t.INVALID&&(a=a||s),s=s.parent;return this.readyImagery!==s&&(e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=s,e(s)&&(s.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(i,this))),n.state===t.FAILED||n.state===t.INVALID?e(a)?(a.processStateMachine(r),!1):!0:!1},i}),i("Scene/ImageryLayer",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian4","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/FeatureDetection","../Core/GeographicTilingScheme","../Core/IndexDatatype","../Core/Math","../Core/PixelFormat","../Core/PrimitiveType","../Core/Rectangle","../Core/TerrainProvider","../Core/TileProviderError","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ClearCommand","../Renderer/ComputeCommand","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/MipmapHint","../Renderer/RenderState","../Renderer/Sampler","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Renderer/VertexArray","../Shaders/ReprojectWebMercatorFS","../Shaders/ReprojectWebMercatorVS","../ThirdParty/when","./Imagery","./ImageryState","./TileImagery"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O,N,L,F,B,V,k,z){"use strict";function U(e,t){this._imageryProvider=e,t=o(t,{}),this.alpha=o(t.alpha,o(e.defaultAlpha,1)),this.brightness=o(t.brightness,o(e.defaultBrightness,U.DEFAULT_BRIGHTNESS)),this.contrast=o(t.contrast,o(e.defaultContrast,U.DEFAULT_CONTRAST)),this.hue=o(t.hue,o(e.defaultHue,U.DEFAULT_HUE)),this.saturation=o(t.saturation,o(e.defaultSaturation,U.DEFAULT_SATURATION)),this.gamma=o(t.gamma,o(e.defaultGamma,U.DEFAULT_GAMMA)),this.show=o(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=o(t.rectangle,f.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new z(V.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0}function G(e,t,i,r){if(d.isPowerOfTwo(r.width)&&d.isPowerOfTwo(r.height)){var n=t.cache.imageryLayer_mipmapSampler;if(!a(n)){var s=S.maximumTextureFilterAnisotropy;n=t.cache.imageryLayer_mipmapSampler=new A({wrapS:O.CLAMP_TO_EDGE,wrapT:O.CLAMP_TO_EDGE,minificationFilter:R.LINEAR_MIPMAP_LINEAR,magnificationFilter:D.LINEAR,maximumAnisotropy:Math.min(s,o(e._maximumAnisotropy,s))})}r.generateMipmap(x.NICEST),r.sampler=n}else{var l=t.cache.imageryLayer_nonMipmapSampler;a(l)||(l=t.cache.imageryLayer_nonMipmapSampler=new A({wrapS:O.CLAMP_TO_EDGE,wrapT:O.CLAMP_TO_EDGE,minificationFilter:R.LINEAR,magnificationFilter:D.LINEAR})),r.sampler=l}i.state=k.READY}function W(e,t,i){return JSON.stringify([e,t,i])}function H(e,t,i,r){var n=t.cache.imageryLayer_reproject;if(!a(n)){n=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){a(this.framebuffer)&&this.framebuffer.destroy(),a(this.vertexArray)&&this.vertexArray.destroy(),a(this.shaderProgram)&&this.shaderProgram.destroy()}};for(var o=new Float32Array(256),s=0,l=0;64>l;++l){var u=l/63;o[s++]=0,o[s++]=u,o[s++]=1,o[s++]=u}var c={position:0,webMercatorT:1},m=v.getRegularGridIndices(2,64),p=_.createIndexBuffer({context:t,typedArray:m,usage:y.STATIC_DRAW,indexDatatype:h.UNSIGNED_SHORT});n.vertexArray=new N({context:t,attributes:[{index:c.position,vertexBuffer:_.createVertexBuffer({context:t,typedArray:o,usage:y.STATIC_DRAW}),componentsPerAttribute:2},{index:c.webMercatorT,vertexBuffer:_.createVertexBuffer({context:t,sizeInBytes:512,usage:y.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:p});var f=new I({sources:[F]});n.shaderProgram=P.fromCache({context:t,vertexShaderSource:f,fragmentShaderSource:L,attributeLocations:c}),n.sampler=new A({wrapS:O.CLAMP_TO_EDGE,wrapT:O.CLAMP_TO_EDGE,minificationFilter:R.LINEAR,magnificationFilter:D.LINEAR})}i.sampler=n.sampler;var g=i.width,C=i.height;Z.textureDimensions.x=g,Z.textureDimensions.y=C,Z.texture=i;var E=Math.sin(r.south),S=.5*Math.log((1+E)/(1-E));E=Math.sin(r.north);var w=.5*Math.log((1+E)/(1-E)),T=1/(w-S),b=new M({context:t,width:g,height:C,pixelFormat:i.pixelFormat,pixelDatatype:i.pixelDatatype,preMultiplyAlpha:i.preMultiplyAlpha});d.isPowerOfTwo(g)&&d.isPowerOfTwo(C)&&b.generateMipmap(x.NICEST);for(var B=r.south,V=r.north,k=K,z=0,U=0;64>U;++U){var G=U/63,W=d.lerp(B,V,G);E=Math.sin(W);var H=.5*Math.log((1+E)/(1-E)),q=(H-S)*T;k[z++]=q,k[z++]=q}n.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(k),e.shaderProgram=n.shaderProgram,e.outputTexture=b,e.uniformMap=Z,e.vertexArray=n.vertexArray}function q(e,t,i){var r=e._imageryProvider,n=r.tilingScheme,o=n.ellipsoid,a=e._imageryProvider.tilingScheme instanceof c?1:Math.cos(i),s=n.rectangle,l=o.maximumRadius*s.width*a/(r.tileWidth*n.getNumberOfXTilesAtLevel(0)),u=l/t,h=Math.log(u)/Math.log(2),d=Math.round(h);return 0|d}s(U.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},rectangle:{get:function(){return this._rectangle}}}),U.DEFAULT_BRIGHTNESS=1,U.DEFAULT_CONTRAST=1,U.DEFAULT_HUE=0,U.DEFAULT_SATURATION=1,U.DEFAULT_GAMMA=1,U.prototype.isBaseLayer=function(){return this._isBaseLayer},U.prototype.isDestroyed=function(){return!1},U.prototype.destroy=function(){return l(this)};var j=new f,Y=new f,X=new f;U.prototype.getViewableRectangle=function(){var e=this._imageryProvider,t=this._rectangle;return e.readyPromise.then(function(){return f.intersection(e.rectangle,t)})},U.prototype._createTileImagerySkeletons=function(e,t,r){var n=e.data;if(a(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel)return!1;if(a(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;var o=this._imageryProvider;if(a(r)||(r=n.imagery.length),!o.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),n.imagery.splice(r,0,this._skeletonPlaceholder),!0;var s=f.intersection(o.rectangle,this._rectangle,j),l=f.intersection(e.rectangle,s,Y);if(!a(l)){if(!this.isBaseLayer())return!1;var u=s,c=e.rectangle;l=Y,c.south>=u.north?l.north=l.south=u.north:c.north<=u.south?l.north=l.south=u.south:(l.south=Math.max(c.south,u.south),l.north=Math.min(c.north,u.north)),c.west>=u.east?l.west=l.east=u.east:c.east<=u.west?l.west=l.east=u.west:(l.west=Math.max(c.west,u.west),l.east=Math.min(c.east,u.east))}var h=0;l.south>0?h=l.south:l.north<0&&(h=l.north);var d=1,m=d*t.getLevelMaximumGeometricError(e.level),p=q(this,m,h);p=Math.max(0,p);var v=o.maximumLevel;if(p>v&&(p=v),a(o.minimumLevel)){var g=o.minimumLevel;g>p&&(p=g)}var _=o.tilingScheme,y=_.positionToTileXY(f.northwest(l),p),C=_.positionToTileXY(f.southeast(l),p),E=e.rectangle.height/512,S=e.rectangle.width/512,w=_.tileXYToRectangle(y.x,y.y,p);Math.abs(w.south-e.rectangle.north)<S&&y.y<C.y&&++y.y,Math.abs(w.east-e.rectangle.west)<E&&y.x<C.x&&++y.x;var T=_.tileXYToRectangle(C.x,C.y,p);Math.abs(T.north-e.rectangle.south)<S&&C.y>y.y&&--C.y,Math.abs(T.west-e.rectangle.east)<E&&C.x>y.x&&--C.x;var x,b,A=e.rectangle,P=_.tileXYToRectangle(y.x,y.y,p),I=f.intersection(P,s,X),M=0,D=1;!this.isBaseLayer()&&Math.abs(I.west-e.rectangle.west)>=E&&(M=Math.min(1,(I.west-A.west)/A.width)),!this.isBaseLayer()&&Math.abs(I.north-e.rectangle.north)>=S&&(D=Math.max(0,(I.north-A.south)/A.height));for(var R=D,O=y.x;O<=C.x;O++){x=M,P=_.tileXYToRectangle(O,y.y,p),I=f.intersection(P,s,X),M=Math.min(1,(I.east-A.west)/A.width),O===C.x&&(this.isBaseLayer()||Math.abs(I.east-e.rectangle.east)<E)&&(M=1),D=R;for(var N=y.y;N<=C.y;N++){b=D,P=_.tileXYToRectangle(O,N,p),I=f.intersection(P,s,X),D=Math.max(0,(I.south-A.south)/A.height),N===C.y&&(this.isBaseLayer()||Math.abs(I.south-e.rectangle.south)<S)&&(D=0);var L=new i(x,D,M,b),F=this.getImageryFromCache(O,N,p,P);n.imagery.splice(r,0,new z(F,L)),++r}}return!0},U.prototype._calculateTextureTranslationAndScale=function(e,t){var r=t.readyImagery.rectangle,n=e.rectangle,o=n.width,a=n.height,s=o/r.width,l=a/r.height;return new i(s*(n.west-r.west)/o,l*(n.south-r.south)/a,s,l)},U.prototype._requestImagery=function(e){function t(t){return a(t)?(e.image=t,e.state=k.RECEIVED,void g.handleSuccess(o._requestImageError)):i()}function i(t){e.state=k.FAILED;var i="Failed to obtain image tile X: "+e.x+" Y: "+e.y+" Level: "+e.level+".";o._requestImageError=g.handleError(o._requestImageError,n,n.errorEvent,i,e.x,e.y,e.level,r,t)}function r(){e.state=k.TRANSITIONING;var r=n.requestImage(e.x,e.y,e.level);return a(r)?(a(n.getTileCredits)&&(e.credits=n.getTileCredits(e.x,e.y,e.level)),void B(r,t,i)):void(e.state=k.UNLOADED)}var n=this._imageryProvider,o=this;r()},U.prototype._createTexture=function(e,t){var i=this._imageryProvider;if(a(i.tileDiscardPolicy)){var r=i.tileDiscardPolicy;if(a(r)){if(!r.isReady())return void(t.state=k.RECEIVED);if(r.shouldDiscardImage(t.image))return void(t.state=k.INVALID)}}var n=new M({context:e,source:t.image,pixelFormat:i.hasAlphaChannel?m.RGBA:m.RGB});t.texture=n,t.image=void 0,t.state=k.TEXTURE_LOADED},U.prototype._reprojectTexture=function(e,t){var i=t.texture,r=t.rectangle,n=e.context;if(!(this._imageryProvider.tilingScheme instanceof c)&&r.width/i.width>1e-5){var o=this,a=new E({persists:!0,owner:this,preExecute:function(e){H(e,n,i,t.rectangle)},postExecute:function(e){i.destroy(),t.texture=e,G(o,n,t,e)}});e.commandList.push(a)}else G(this,n,t,i)},U.prototype.getImageryFromCache=function(e,t,i,r){var n=W(e,t,i),o=this._imageryCache[n];return a(o)||(o=new V(this,e,t,i,r),this._imageryCache[n]=o),o.addReference(),o},U.prototype.removeImageryFromCache=function(e){var t=W(e.x,e.y,e.level);delete this._imageryCache[t]};var Z={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new t,texture:void 0},K=u.supportsTypedArrays()?new Float32Array(128):void 0;return U}),i("Scene/GlobeSurfaceTileProvider",["../Core/BoundingSphere","../Core/BoxOutlineGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/FeatureDetection","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/OrientedBoundingBox","../Core/PrimitiveType","../Core/Rectangle","../Core/SphereOutlineGeometry","../Core/TerrainQuantization","../Core/Visibility","../Core/WebMercatorProjection","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/VertexArray","../Scene/BlendingState","../Scene/DepthFunction","../Scene/Pass","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../ThirdParty/when","./GlobeSurfaceTile","./ImageryLayer","./ImageryState","./QuadtreeTileLoadState","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O,N,L,F,B,V,k,z,U,G,W){"use strict";function H(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._pickRenderState=void 0,this._errorEvent=new d,this._imageryLayers.layerAdded.addEventListener(H.prototype._onLayerAdded,this),this._imageryLayers.layerRemoved.addEventListener(H.prototype._onLayerRemoved,this),this._imageryLayers.layerMoved.addEventListener(H.prototype._onLayerMoved,this), +this._imageryLayers.layerShownOrHidden.addEventListener(H.prototype._onLayerShownOrHidden,this),this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._pickCommands=[],this._usedDrawCommands=0,this._usedPickCommands=0,this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new o(0,0,.5,1)}function q(e,t){var i=e.loadingImagery;l(i)||(i=e.readyImagery);var r=t.loadingImagery;return l(r)||(r=t.readyImagery),i.imageryLayer._layerIndex-r.imageryLayer._layerIndex}function j(){var e={u_initialColor:function(){return this.initialColor},u_zoomedOutOceanSpecularIntensity:function(){return this.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.oceanNormalMap},u_lightingFadeDistance:function(){return this.lightingFadeDistance},u_center3D:function(){return this.center3D},u_tileRectangle:function(){return this.tileRectangle},u_modifiedModelView:function(){return this.modifiedModelView},u_dayTextures:function(){return this.dayTextures},u_dayTextureTranslationAndScale:function(){return this.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.dayTextureTexCoordsRectangle},u_dayTextureAlpha:function(){return this.dayTextureAlpha},u_dayTextureBrightness:function(){return this.dayTextureBrightness},u_dayTextureContrast:function(){return this.dayTextureContrast},u_dayTextureHue:function(){return this.dayTextureHue},u_dayTextureSaturation:function(){return this.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.dayTextureOneOverGamma},u_dayIntensity:function(){return this.dayIntensity},u_southAndNorthLatitude:function(){return this.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.waterMask},u_waterMaskTranslationAndScale:function(){return this.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.minMaxHeight},u_scaleAndBias:function(){return this.scaleAndBias},initialColor:new n(0,0,.5,1),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new i(65e5,9e6),center3D:void 0,modifiedModelView:new y,tileRectangle:new n,dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayIntensity:0,southAndNorthLatitude:new i,southMercatorYAndOneOverHeight:new i,waterMask:void 0,waterMaskTranslationAndScale:new n,minMaxHeight:new i,scaleAndBias:new y};return e}function Y(e,t,i){var r=i.data;l(r.wireframeVertexArray)||l(r.terrainData)&&l(r.terrainData._mesh)&&(r.wireframeVertexArray=X(e,r.vertexArray,r.terrainData._mesh))}function X(e,t,i){var r={indices:i.indices,primitiveType:E.TRIANGLES};f.toWireframe(r);var n=r.indices,o=A.createIndexBuffer({context:e,typedArray:n,usage:P.STATIC_DRAW,indexDatatype:v.UNSIGNED_SHORT});return new R({context:e,attributes:t._attributes,indexBuffer:o})}function Z(t,i,a){var s=i.data,u=a.camera.viewMatrix,c=I.maximumTextureImageUnits,h=s.waterMaskTexture,d=t.hasWaterMask&&l(h),m=t.oceanNormalMap,p=d&&l(m),f=t.terrainProvider.ready&&t.terrainProvider.hasVertexNormals,v=a.fog.enabled;d&&--c,p&&--c;var g=s.center,w=s.pickTerrain.mesh.encoding,x=$,A=0,P=0,D=0,R=0,O=!1;if(a.mode!==W.SCENE3D){var N=a.mapProjection,F=N.project(S.southwest(i.rectangle),ie),B=N.project(S.northeast(i.rectangle),re);if(x.x=F.x,x.y=F.y,x.z=B.x,x.w=B.y,a.mode!==W.MORPHING&&(g=ee,g.x=0,g.y=.5*(x.z+x.x),g.z=.5*(x.w+x.y),x.x-=g.y,x.y-=g.z,x.z-=g.y,x.w-=g.z),a.mode===W.SCENE2D&&w.quantization===T.BITS12){var V=1/(Math.pow(2,12)-1)*.5,k=(x.z-x.x)*V,G=(x.w-x.y)*V;x.x-=k,x.y-=G,x.z+=k,x.w+=G}N instanceof b&&(A=i.rectangle.south,P=i.rectangle.north,D=b.geodeticLatitudeToMercatorAngle(A),R=1/(b.geodeticLatitudeToMercatorAngle(P)-D),O=!0)}var H=y.multiplyByPoint(u,g,te);y.setTranslation(u,H,J);var q=s.imagery,X=0,Z=q.length,K=t._renderState,Q=t._blendRenderState,le=K,ue=t._firstPassInitialColor,ce=a.context;l(t._debug.boundingSphereTile)||ae();do{var he,de,me=0;t._drawCommands.length<=t._usedDrawCommands?(he=new M,he.owner=i,he.cull=!1,he.boundingVolume=new e,he.orientedBoundingBox=void 0,de=j(),t._drawCommands.push(he),t._uniformMaps.push(de)):(he=t._drawCommands[t._usedDrawCommands],de=t._uniformMaps[t._usedDrawCommands]),he.owner=i,++t._usedDrawCommands,i===t._debug.boundingSphereTile&&(l(s.orientedBoundingBox)?ne(s.orientedBoundingBox,o.RED).update(a):l(s.boundingSphere3D)&&oe(s.boundingSphere3D,o.RED).update(a)),n.clone(ue,de.initialColor),de.oceanNormalMap=m,de.lightingFadeDistance.x=t.lightingFadeOutDistance,de.lightingFadeDistance.y=t.lightingFadeInDistance,de.zoomedOutOceanSpecularIntensity=t.zoomedOutOceanSpecularIntensity,de.center3D=s.center,n.clone(x,de.tileRectangle),de.southAndNorthLatitude.x=A,de.southAndNorthLatitude.y=P,de.southMercatorYAndOneOverHeight.x=D,de.southMercatorYAndOneOverHeight.y=R,y.clone(J,de.modifiedModelView);for(var pe=v&&_.fog(i._distance,a.fog.density)>_.EPSILON3,fe=!1,ve=!1,ge=!1,_e=!1,ye=!1,Ce=!1;c>me&&Z>X;){var Ee=q[X],Se=Ee.readyImagery;if(++X,l(Se)&&Se.state===U.READY&&0!==Se.imageryLayer.alpha){var we=Se.imageryLayer;if(l(Ee.textureTranslationAndScale)||(Ee.textureTranslationAndScale=we._calculateTextureTranslationAndScale(i,Ee)),de.dayTextures[me]=Se.texture,de.dayTextureTranslationAndScale[me]=Ee.textureTranslationAndScale,de.dayTextureTexCoordsRectangle[me]=Ee.textureCoordinateRectangle,de.dayTextureAlpha[me]=we.alpha,Ce=Ce||1!==de.dayTextureAlpha[me],de.dayTextureBrightness[me]=we.brightness,fe=fe||de.dayTextureBrightness[me]!==z.DEFAULT_BRIGHTNESS,de.dayTextureContrast[me]=we.contrast,ve=ve||de.dayTextureContrast[me]!==z.DEFAULT_CONTRAST,de.dayTextureHue[me]=we.hue,ge=ge||de.dayTextureHue[me]!==z.DEFAULT_HUE,de.dayTextureSaturation[me]=we.saturation,_e=_e||de.dayTextureSaturation[me]!==z.DEFAULT_SATURATION,de.dayTextureOneOverGamma[me]=1/we.gamma,ye=ye||de.dayTextureOneOverGamma[me]!==1/z.DEFAULT_GAMMA,l(Se.credits))for(var Te=a.creditDisplay,xe=Se.credits,be=0,Ae=xe.length;Ae>be;++be)Te.addCredit(xe[be]);++me}}de.dayTextures.length=me,de.waterMask=h,n.clone(s.waterMaskTranslationAndScale,de.waterMaskTranslationAndScale),de.minMaxHeight.x=w.minimumHeight,de.minMaxHeight.y=w.maximumHeight,y.clone(w.matrix,de.scaleAndBias),he.shaderProgram=t._surfaceShaderSet.getShaderProgram(a,s,me,fe,ve,ge,_e,ye,Ce,d,p,t.enableLighting,f,O,pe),he.renderState=le,he.primitiveType=E.TRIANGLES,he.vertexArray=s.vertexArray,he.uniformMap=de,he.pass=L.GLOBE,t._debug.wireframe&&(Y(ce,t,i),l(s.wireframeVertexArray)&&(he.vertexArray=s.wireframeVertexArray,he.primitiveType=E.LINES));var Pe=he.boundingVolume,Ie=he.orientedBoundingBox;a.mode!==W.SCENE3D?(e.fromRectangleWithHeights2D(i.rectangle,a.mapProjection,s.minimumHeight,s.maximumHeight,Pe),r.fromElements(Pe.center.z,Pe.center.x,Pe.center.y,Pe.center),a.mode===W.MORPHING&&(Pe=e.union(s.boundingSphere3D,Pe,Pe))):(he.boundingVolume=e.clone(s.boundingSphere3D,Pe),he.orientedBoundingBox=C.clone(s.orientedBoundingBox,Ie)),a.commandList.push(he),le=Q,ue=se}while(Z>X)}function K(e,t,i){var r;e._pickCommands.length<=e._usedPickCommands?(r=new M,r.cull=!1,e._pickCommands.push(r)):r=e._pickCommands[e._usedPickCommands],++e._usedPickCommands;var n=t.owner.data,o=i.projection instanceof b;r.shaderProgram=e._surfaceShaderSet.getPickShaderProgram(i,n,o),r.renderState=e._pickRenderState,r.owner=t.owner,r.primitiveType=t.primitiveType,r.vertexArray=t.vertexArray,r.uniformMap=t.uniformMap,r.boundingVolume=t.boundingVolume,r.orientedBoundingBox=r.orientedBoundingBox,r.pass=t.pass,i.commandList.push(r)}u(H.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=n.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return this._terrainProvider.ready&&(0===this._imageryLayers.length||this._imageryLayers.get(0).imageryProvider.ready)}},tilingScheme:{get:function(){return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}}}),H.prototype.beginUpdate=function(e){this._imageryLayers._update(),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(e){e.data.imagery.sort(q)}));var t,i,r=this._tilesToRenderByTextureCount;for(t=0,i=r.length;i>t;++t){var n=r[t];l(n)&&(n.length=0)}this._usedDrawCommands=0;var o=e.creditDisplay;this._terrainProvider.ready&&l(this._terrainProvider.credit)&&o.addCredit(this._terrainProvider.credit);var a=this._imageryLayers;for(t=0,i=a.length;i>t;++t){var s=a.get(t).imageryProvider;s.ready&&l(s.credit)&&o.addCredit(s.credit)}},H.prototype.endUpdate=function(e){l(this._renderState)||(this._renderState=D.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:N.LESS}}),this._blendRenderState=D.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:N.LESS_OR_EQUAL},blending:O.ALPHA_BLEND}));for(var t=this._tilesToRenderByTextureCount,i=0,r=t.length;r>i;++i){var n=t[i];if(l(n))for(var o=0,a=n.length;a>o;++o)Z(this,n[o],e)}},H.prototype.updateForPick=function(e){l(this._pickRenderState)||(this._pickRenderState=D.fromCache({colorMask:{red:!1,green:!1,blue:!1,alpha:!1},depthTest:{enabled:!0}})),this._usedPickCommands=0;for(var t=this._drawCommands,i=0,r=this._usedDrawCommands;r>i;++i)K(this,t[i],e)},H.prototype.getLevelMaximumGeometricError=function(e){return this._terrainProvider.getLevelMaximumGeometricError(e)},H.prototype.loadTile=function(e,t){k.processStateMachine(t,e,this._terrainProvider,this._imageryLayers)};var Q=new e;H.prototype.computeTileVisibility=function(t,i,n){var o=this.computeDistanceToTile(t,i);if(t._distance=o,i.fog.enabled&&_.fog(o,i.fog.density)>=1)return x.NONE;var a=t.data,u=i.cullingVolume,c=s(a.orientedBoundingBox,a.boundingSphere3D);i.mode!==W.SCENE3D&&(c=Q,e.fromRectangleWithHeights2D(t.rectangle,i.mapProjection,a.minimumHeight,a.maximumHeight,c),r.fromElements(c.center.z,c.center.x,c.center.y,c.center),i.mode===W.MORPHING&&(c=e.union(a.boundingSphere3D,c,c)));var h=u.computeVisibility(c);if(h===g.OUTSIDE)return x.NONE;if(i.mode===W.SCENE3D){var d=a.occludeePointInScaledSpace;return l(d)?n.ellipsoid.isScaledSpacePointVisible(d)?h:x.NONE:h}return h};var J=new y,$=new n,ee=new r,te=new r,ie=new r,re=new r;H.prototype.showTileThisFrame=function(e,t){for(var i=0,r=e.data.imagery,n=0,o=r.length;o>n;++n){var a=r[n];l(a.readyImagery)&&0!==a.readyImagery.imageryLayer.alpha&&++i}var s=this._tilesToRenderByTextureCount[i];l(s)||(s=[],this._tilesToRenderByTextureCount[i]=s),s.push(e);var u=this._debug;++u.tilesRendered,u.texturesRendered+=i},H.prototype.computeDistanceToTile=function(e,t){var i=e.data,r=i.tileBoundingBox;return r.distanceToCamera(t)},H.prototype.isDestroyed=function(){return!1},H.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),c(this)},H.prototype._onLayerAdded=function(e,t){if(e.show){var i=this._terrainProvider;this._quadtree.forEachLoadedTile(function(t){e._createTileImagerySkeletons(t,i)&&(t.state=G.LOADING)}),this._layerOrderChanged=!0}},H.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(t){for(var i=t.data.imagery,r=-1,n=0,o=0,a=i.length;a>o;++o){var s=i[o],u=s.loadingImagery;if(l(u)||(u=s.readyImagery),u.imageryLayer===e)-1===r&&(r=o),s.freeResources(),++n;else if(-1!==r)break}-1!==r&&i.splice(r,n)})},H.prototype._onLayerMoved=function(e,t,i){this._layerOrderChanged=!0},H.prototype._onLayerShownOrHidden=function(e,t,i){i?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var ne,oe,ae;!function(){function e(e){return new B({geometryInstances:e,appearance:new F({translucent:!1,flat:!0}),asynchronous:!1})}var i,n,o=new p({geometry:t.fromDimensions({dimensions:new r(2,2,2)})}),s=new p({geometry:new w({radius:1})}),u=new y;ne=function(t,r){return t===i?n:(ae(),i=t,u=y.fromRotationTranslation(t.halfAxes,t.center,u),o.modelMatrix=u,o.attributes.color=a.fromColor(r),n=e(o))},oe=function(t,r){return t===i?n:(ae(),i=t,u=y.fromTranslation(t.center,u),u=y.multiplyByUniformScale(u,t.radius,u),s.modelMatrix=u,s.attributes.color=a.fromColor(r),n=e(s))},ae=function(){l(n)&&(n.destroy(),n=void 0,i=void 0)}}();var se=new n(0,0,0,0);return H}),i("Scene/ImageryLayerCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/Math","../Core/Rectangle","../ThirdParty/when","./ImageryLayer"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(){this._layers=[],this.layerAdded=new o,this.layerRemoved=new o,this.layerMoved=new o,this.layerShownOrHidden=new o}function h(e,t){var i=e.indexOf(t);return i}function d(e,t,i){var r=e._layers;if(t=a.clamp(t,0,r.length-1),i=a.clamp(i,0,r.length-1),t!==i){var n=r[t];r[t]=r[i],r[i]=n,e._update(),e.layerMoved.raiseEvent(n,i,t)}}i(c.prototype,{length:{get:function(){return this._layers.length}}}),c.prototype.add=function(e,i){var r=t(i);r?this._layers.splice(i,0,e):(i=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,i)},c.prototype.addImageryProvider=function(e,t){var i=new u(e);return this.add(i,t),i},c.prototype.remove=function(t,i){i=e(i,!0);var r=this._layers.indexOf(t);return-1!==r?(this._layers.splice(r,1),this._update(),this.layerRemoved.raiseEvent(t,r),i&&t.destroy(),!0):!1},c.prototype.removeAll=function(t){t=e(t,!0);for(var i=this._layers,r=0,n=i.length;n>r;r++){var o=i[r];this.layerRemoved.raiseEvent(o,r),t&&o.destroy()}this._layers=[]},c.prototype.contains=function(e){return-1!==this.indexOf(e)},c.prototype.indexOf=function(e){return this._layers.indexOf(e)},c.prototype.get=function(e){return this._layers[e]},c.prototype.raise=function(e){var t=h(this._layers,e);d(this,t,t+1)},c.prototype.lower=function(e){var t=h(this._layers,e);d(this,t,t-1)},c.prototype.raiseToTop=function(e){var t=h(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))},c.prototype.lowerToBottom=function(e){var t=h(this._layers,e);0!==t&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var m=new s;return c.prototype.pickImageryLayerFeatures=function(e,i){var r=i.globe.pick(e,i);if(t(r)){for(var n,o=i.globe.ellipsoid.cartesianToCartographic(r),u=i.globe._surface._tilesToRender,c=0;!t(n)&&c<u.length;++c){var h=u[c];s.contains(h.rectangle,o)&&(n=h)}if(t(n)){for(var d=n.data.imagery,p=[],f=[],v=d.length-1;v>=0;--v){var g=d[v],_=g.readyImagery;if(t(_)){var y=_.imageryLayer.imageryProvider;if(t(y.pickFeatures)&&s.contains(_.rectangle,o)){var C=m,E=1/1024;if(C.west=a.lerp(n.rectangle.west,n.rectangle.east,g.textureCoordinateRectangle.x-E),C.east=a.lerp(n.rectangle.west,n.rectangle.east,g.textureCoordinateRectangle.z+E),C.south=a.lerp(n.rectangle.south,n.rectangle.north,g.textureCoordinateRectangle.y-E),C.north=a.lerp(n.rectangle.south,n.rectangle.north,g.textureCoordinateRectangle.w+E),s.contains(C,o)){var S=y.pickFeatures(_.x,_.y,_.level,o.longitude,o.latitude);t(S)&&(p.push(S),f.push(_.imageryLayer))}}}}if(0!==p.length)return l.all(p,function(e){for(var i=[],r=0;r<e.length;++r){var n=e[r],a=f[r];if(t(n)&&n.length>0)for(var s=0;s<n.length;++s){var l=n[s];l.imageryLayer=a,t(l.position)||(l.position=o),i.push(l)}}return i})}}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this.removeAll(!0),r(this)},c.prototype._update=function(){for(var e,i,r=!0,n=this._layers,o=0,a=n.length;a>o;++o)i=n[o],i._layerIndex=o,i.show?(i._isBaseLayer=r,r=!1):i._isBaseLayer=!1,i.show!==i._show&&(t(i._show)&&(t(e)||(e=[]),e.push(i)),i._show=i.show);if(t(e))for(o=0,a=e.length;a>o;++o)i=e[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)},c}),i("Scene/QuadtreeOccluders",["../Core/Cartesian3","../Core/defineProperties","../Core/EllipsoidalOccluder"],function(e,t,i){"use strict";function r(t){this._ellipsoid=new i(t.ellipsoid,e.ZERO)}return t(r.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),r}),i("Scene/QuadtreeTile",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Rectangle","./QuadtreeTileLoadState"],function(e,t,i,r,n){"use strict";function o(e){this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._children=void 0,this._replacementPrevious=void 0,this._replacementNext=void 0,this._distance=0,this._customData=[],this._frameUpdated=void 0,this._frameRendered=void 0,this.state=n.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}return o.createLevelZeroTiles=function(t){if(!e(t))throw new i("tilingScheme is required.");for(var r=t.getNumberOfXTilesAtLevel(0),n=t.getNumberOfYTilesAtLevel(0),a=new Array(r*n),s=0,l=0;n>l;++l)for(var u=0;r>u;++u)a[s++]=new o({tilingScheme:t,x:u,y:l,level:0});return a},o.prototype._updateCustomData=function(t,i,n){var o,a,s,l=this.customData;if(e(i)&&e(n)){for(o=0;o<n.length;++o){a=n[o];for(var u=0;u<l.length;++u)if(l[u]===a){l.splice(u,1);break}}for(s=this._rectangle,o=0;o<i.length;++o)a=i[o],r.contains(s,a.positionCartographic)&&l.push(a);this._frameUpdated=t}else{var c=this._parent;if(e(c)&&this._frameUpdated!==c._frameUpdated){l.length=0,s=this._rectangle;var h=c.customData;for(o=0;o<h.length;++o)a=h[o],r.contains(s,a.positionCartographic)&&l.push(a);this._frameUpdated=c._frameUpdated}}},t(o.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){if(!e(this._children)){var t=this.tilingScheme,i=this.level+1,r=2*this.x,n=2*this.y;this._children=[new o({tilingScheme:t,x:r,y:n,level:i,parent:this}),new o({tilingScheme:t,x:r+1,y:n,level:i,parent:this}),new o({tilingScheme:t,x:r,y:n+1,level:i,parent:this}),new o({tilingScheme:t,x:r+1,y:n+1,level:i,parent:this})]}return this._children}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<n.DONE}},eligibleForUnloading:{get:function(){var t=!0;return e(this.data)&&(t=this.data.eligibleForUnloading,e(t)||(t=!0)),t}}}),o.prototype.freeResources=function(){if(this.state=n.START,this.renderable=!1,this.upsampledFromParent=!1,e(this.data)&&e(this.data.freeResources)&&(this.data.freeResources(),this.data=void 0),e(this._children)){for(var t=0,i=this._children.length;i>t;++t)this._children[t].freeResources();this._children=void 0}},o}),i("Scene/TileReplacementQueue",["../Core/defined"],function(e){"use strict";function t(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}function i(e,t){var i=t.replacementPrevious,r=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=r),t===e.head?e.head=r:i.replacementNext=r,t===e.tail?e.tail=i:r.replacementPrevious=i,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}return t.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head},t.prototype.trimTiles=function(t){for(var r=this.tail,n=!0;n&&e(this._lastBeforeStartOfFrame)&&this.count>t&&e(r);){n=r!==this._lastBeforeStartOfFrame;var o=r.replacementPrevious;r.eligibleForUnloading&&(r.freeResources(),i(this,r)),r=o}},t.prototype.markTileRendered=function(t){var r=this.head;return r===t?void(t===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=t.replacementNext)):(++this.count,e(r)?((e(t.replacementPrevious)||e(t.replacementNext))&&i(this,t),t.replacementPrevious=void 0,t.replacementNext=r,r.replacementPrevious=t,void(this.head=t)):(t.replacementPrevious=void 0,t.replacementNext=void 0,this.head=t,void(this.tail=t)))},t}),i("Scene/QuadtreePrimitive",["../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/getTimestamp","../Core/Math","../Core/Queue","../Core/Ray","../Core/Rectangle","../Core/Visibility","./QuadtreeOccluders","./QuadtreeTile","./QuadtreeTileLoadState","./SceneMode","./TileReplacementQueue"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g){"use strict";function _(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};var t=this._tileProvider.tilingScheme,r=t.ellipsoid;this._tilesToRender=[],this._tileTraversalQueue=new u,this._tileLoadQueue=[],this._tileReplacementQueue=new g,this._levelZeroTiles=void 0,this._levelZeroTilesReady=!1,this._loadQueueTimeSlice=5,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this.maximumScreenSpaceError=i(e.maximumScreenSpaceError,2),this.tileCacheSize=i(e.tileCacheSize,100),this._occluders=new m({ellipsoid:r}),this._tileLoadProgressEvent=new a,this._lastTileLoadQueueLength=0}function y(e,t){var i=e._debug;if(!i.suspendLodUpdate){var n,o,a=e._tilesToRender;a.length=0;var s=e._tileTraversalQueue;if(s.clear(),i.maxDepth=0,i.tilesVisited=0,i.tilesCulled=0,i.tilesRendered=0,i.tilesWaitingForChildren=0,e._tileLoadQueue.length=0,e._tileReplacementQueue.markStartOfRenderFrame(),!r(e._levelZeroTiles)){if(!e._tileProvider.ready)return;var l=e._tileProvider.tilingScheme;e._levelZeroTiles=p.createLevelZeroTiles(l)}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;var u,c=e._tileProvider,h=e._occluders,m=e._levelZeroTiles,f=e._addHeightCallbacks,v=e._removeHeightCallbacks,g=t.frameNumber;if(f.length>0||v.length>0){for(n=0,o=m.length;o>n;++n)u=m[n],u._updateCustomData(g,f,v);f.length=0,v.length=0}for(n=0,o=m.length;o>n;++n)u=m[n],e._tileReplacementQueue.markTileRendered(u),u.needsLoading&&x(e,u),u.renderable&&c.computeTileVisibility(u,t,h)!==d.NONE?s.enqueue(u):(++i.tilesCulled,u.renderable||++i.tilesWaitingForChildren);for(;r(u=s.dequeue());)if(++i.tilesVisited,e._tileReplacementQueue.markTileRendered(u),u._updateCustomData(g),u.level>i.maxDepth&&(i.maxDepth=u.level),E(e,t,u)<e.maximumScreenSpaceError)w(e,u);else if(T(e,u)){var _=u.children;for(n=0,o=_.length;o>n;++n)c.computeTileVisibility(_[n],t,h)!==d.NONE?s.enqueue(_[n]):++i.tilesCulled}else w(e,u);C(e),i.enableDebugOutput&&(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren)&&(console.log("Visited "+i.tilesVisited+", Rendered: "+i.tilesRendered+", Culled: "+i.tilesCulled+", Max Depth: "+i.maxDepth+", Waiting for children: "+i.tilesWaitingForChildren),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren)}}function C(e){var t=e._tileLoadQueue.length;t!==e._lastTileLoadQueueLength&&(e._tileLoadProgressEvent.raiseEvent(t),e._lastTileLoadQueueLength=t)}function E(e,t,i){if(t.mode===v.SCENE2D)return S(e,t,i);var r=e._tileProvider.getLevelMaximumGeometricError(i.level),n=i._distance,o=t.context.drawingBufferHeight,a=t.camera.frustum.sseDenominator,s=r*o/(n*a);return t.fog.enabled&&(s-=l.fog(n,t.fog.density)*t.fog.sse),s}function S(e,t,i){var r=t.camera,n=r.frustum,o=t.context,a=o.drawingBufferWidth,s=o.drawingBufferHeight,l=e._tileProvider.getLevelMaximumGeometricError(i.level),u=Math.max(n.top-n.bottom,n.right-n.left)/Math.max(a,s);return l/u}function w(e,t){e._tilesToRender.push(t),++e._debug.tilesRendered}function T(e,t){for(var i=!0,r=!0,n=t.children,o=0,a=n.length;a>o;++o){var s=n[o];e._tileReplacementQueue.markTileRendered(s),r=r&&s.upsampledFromParent,i=i&&s.renderable,s.needsLoading&&x(e,s)}return i||++e._debug.tilesWaitingForChildren,i&&!r}function x(e,t){e._tileLoadQueue.push(t)}function b(e,t){var i=e._tileLoadQueue,r=e._tileProvider;if(0!==i.length){e._tileReplacementQueue.trimTiles(e.tileCacheSize);for(var n=s(),o=e._loadQueueTimeSlice,a=n+o,l=i.length-1;l>=0;--l){var u=i[l];if(e._tileReplacementQueue.markTileRendered(u),r.loadTile(t,u),s()>=a)break}}}function A(i,n){for(var o=i._tileToUpdateHeights,a=i._tileProvider.terrainProvider,l=s(),u=i._updateHeightsTimeSlice,c=l+u,d=n.mode,m=n.mapProjection,p=m.ellipsoid;o.length>0;){var f=o[o.length-1];f!==i._lastTileUpdated&&(i._lastTileIndex=0);for(var g=f.customData,_=g.length,y=!1,C=i._lastTileIndex;_>C;++C){var E=g[C];if(f.level>E.level){r(E.position)||(E.position=p.cartographicToCartesian(E.positionCartographic)),d===v.SCENE3D?(e.clone(e.ZERO,M.origin),e.normalize(E.position,M.direction)):(t.clone(E.positionCartographic,D),D.height=-11500,m.project(D,R),e.fromElements(R.z,R.x,R.y,R),e.clone(R,M.origin),e.clone(e.UNIT_X,M.direction));var S=f.data.pick(M,d,m,!1,R);r(S)&&E.callback(S),E.level=f.level}else if(f.level===E.level){for(var w,T=f.children,x=T.length,b=0;x>b&&(w=T[b],!h.contains(w.rectangle,E.positionCartographic));++b);var A=a.getTileDataAvailable(w.x,w.y,w.level);(r(A)&&!A||r(parent)&&r(parent.data)&&r(parent.data.terrainData)&&!parent.data.terrainData.isChildAvailable(parent.x,parent.y,w.x,w.y))&&E.removeFunc()}if(s()>=c){y=!0;break}}if(y){i._lastTileUpdated=f,i._lastTileIndex=C;break}o.pop()}}function P(e,t){return e._distance-t._distance}function I(e,t){var i=e._tileProvider,r=e._tilesToRender,n=e._tileToUpdateHeights;r.sort(P);for(var o=0,a=r.length;a>o;++o){var s=r[o];i.showTileThisFrame(s,t),s._frameRendered!==t.frameNumber-1&&n.push(s),s._frameRendered=t.frameNumber}A(e,t)}n(_.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}}}),_.prototype.invalidateAllTiles=function(){var e=this._tileReplacementQueue;e.head=void 0,e.tail=void 0,e.count=0;var t=this._levelZeroTiles;if(r(t))for(var i=0;i<t.length;++i){for(var n=t[i],o=n.customData,a=o.length,s=0;a>s;++s){var l=o[s];l.level=0,this._addHeightCallbacks.push(l)}t[i].freeResources()}this._levelZeroTiles=void 0},_.prototype.forEachLoadedTile=function(e){for(var t=this._tileReplacementQueue.head;r(t);)t.state!==f.START&&e(t),t=t.replacementNext},_.prototype.forEachRenderedTile=function(e){for(var t=this._tilesToRender,i=0,r=t.length;r>i;++i)e(t[i])},_.prototype.updateHeight=function(e,t){var i=this,r={position:void 0,positionCartographic:e,level:-1,callback:t};return r.removeFunc=function(){i._removeHeightCallbacks.push(r)},i._addHeightCallbacks.push(r),r.removeFunc},_.prototype.update=function(e){var t=e.passes;t.render&&(this._tileProvider.beginUpdate(e),y(this,e),b(this,e),I(this,e),this._tileProvider.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&this._tileProvider.updateForPick(e)},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var M=new c,D=new t,R=new e;return _}),i("Scene/Globe",["../Core/BoundingSphere","../Core/buildModuleUrl","../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/EllipsoidTerrainProvider","../Core/GeographicProjection","../Core/IntersectionTests","../Core/loadImage","../Core/Ray","../Core/Rectangle","../Renderer/ShaderSource","../Renderer/Texture","../Shaders/GlobeFS","../Shaders/GlobeVS","../Shaders/GroundAtmosphere","../ThirdParty/when","./GlobeSurfaceShaderSet","./GlobeSurfaceTileProvider","./ImageryLayerCollection","./QuadtreePrimitive","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S,w,T,x,b){"use strict";function A(e){e=n(e,u.WGS84);var i=new c({ellipsoid:e}),r=new T;this._ellipsoid=e,this._imageryLayerCollection=r,this._surfaceShaderSet=new S,this._surfaceShaderSet.baseVertexShaderSource=new v({sources:[C,y]}),this._surfaceShaderSet.baseFragmentShaderSource=new v({sources:[_]}),this._surface=new x({tileProvider:new w({terrainProvider:i,imageryLayers:r,surfaceShaderSet:this._surfaceShaderSet})}),this.terrainProvider=i,this.show=!0,this.oceanNormalMapUrl=t("Assets/Textures/waterNormalsSmall.jpg"),this._oceanNormalMapUrl=void 0,this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.enableLighting=!1,this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=.5}function P(t){return function(i,r){var n=e.distanceSquaredTo(i.pickBoundingSphere,t),o=e.distanceSquaredTo(r.pickBoundingSphere,t);return n-o}}a(A.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}}});var I=[],M={start:0,stop:0};A.prototype.pick=function(t,r,n){var a=r.mode,s=r.mapProjection,l=I;l.length=0;var u,c,h=this._surface._tilesToRender,m=h.length;for(c=0;m>c;++c){u=h[c];var p=u.data;if(o(p)){var f=p.pickBoundingSphere;a!==b.SCENE3D?(e.fromRectangleWithHeights2D(u.rectangle,s,p.minimumHeight,p.maximumHeight,f),i.fromElements(f.center.z,f.center.x,f.center.y,f.center)):e.clone(p.boundingSphere3D,f);var v=d.raySphere(t,f,M);o(v)&&l.push(p)}}l.sort(P(t.origin));var g;for(m=l.length,c=0;m>c&&(g=l[c].pick(t,r.mode,r.mapProjection,!0,n),!o(g));++c);return g};var D=new i,R=new i,O=new r,N=new p;return A.prototype.getHeight=function(e){var t=this._surface._levelZeroTiles;if(o(t)){var r,n,a=t.length;for(n=0;a>n&&(r=t[n],!f.contains(r.rectangle,e));++n);if(o(r)&&f.contains(r.rectangle,e)){for(;r.renderable;){var s=r.children;for(a=s.length,n=0;a>n&&(r=s[n],!f.contains(r.rectangle,e));++n);}for(;o(r)&&(!o(r.data)||!o(r.data.pickTerrain));)r=r.parent;if(o(r)){var l=this._surface._tileProvider.tilingScheme.ellipsoid,u=l.cartographicToCartesian(e,D),c=N;i.normalize(u,c.direction);var h=r.data.pick(c,void 0,void 0,!1,R);if(o(h))return l.cartesianToCartographic(h,O).height}}}},A.prototype.update=function(e){if(this.show){var t=e.context,i=t.drawingBufferWidth,r=t.drawingBufferHeight;if(0!==i&&0!==r){var n=this._surface,a=n.tileProvider,s=this.terrainProvider,l=this.showWaterEffect&&s.ready&&s.hasWaterMask;if(l&&this.oceanNormalMapUrl!==this._oceanNormalMapUrl){var u=this.oceanNormalMapUrl;if(this._oceanNormalMapUrl=u,o(u)){var c=this;E(m(u),function(e){u===c.oceanNormalMapUrl&&(c._oceanNormalMap=c._oceanNormalMap&&c._oceanNormalMap.destroy(),c._oceanNormalMap=new g({context:t,source:e}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}var h=e.mode,d=e.passes;d.render&&(h===b.SCENE3D?this._zoomedOutOceanSpecularIntensity=.5:this._zoomedOutOceanSpecularIntensity=0,n.maximumScreenSpaceError=this.maximumScreenSpaceError,n.tileCacheSize=this.tileCacheSize,a.terrainProvider=this.terrainProvider,a.lightingFadeOutDistance=this.lightingFadeOutDistance,a.lightingFadeInDistance=this.lightingFadeInDistance,a.zoomedOutOceanSpecularIntensity=this._zoomedOutOceanSpecularIntensity,a.hasWaterMask=l,a.oceanNormalMap=this._oceanNormalMap,a.enableLighting=this.enableLighting,n.update(e)),d.pick&&n.update(e); +}}},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),s(this)},A}),i("Shaders/PostProcessFilters/PassThrough",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),i("Scene/GlobeDepth",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/PassThrough"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(){this._colorTexture=void 0,this._depthStencilTexture=void 0,this._globeDepthTexture=void 0,this.framebuffer=void 0,this._copyDepthFramebuffer=void 0,this._clearColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._viewport=new e,this._rs=void 0,this._debugGlobeDepthViewportCommand=void 0}function m(e,t,r){if(!i(e._debugGlobeDepthViewportCommand)){var n="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n float z_window = czm_unpackDepth(texture2D(u_texture, v_textureCoordinates));\n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n float scale = pow(z_ndc * 0.5 + 0.5, 8.0);\n gl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n}\n";e._debugGlobeDepthViewportCommand=t.createViewportQuadCommand(n,{uniformMap:{u_texture:function(){return e._globeDepthTexture}},owner:e})}e._debugGlobeDepthViewportCommand.execute(t,r)}function p(e){e._colorTexture=e._colorTexture&&!e._colorTexture.isDestroyed()&&e._colorTexture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&!e._depthStencilTexture.isDestroyed()&&e._depthStencilTexture.destroy(),e._globeDepthTexture=e._globeDepthTexture&&!e._globeDepthTexture.isDestroyed()&&e._globeDepthTexture.destroy()}function f(e){e.framebuffer=e.framebuffer&&!e.framebuffer.isDestroyed()&&e.framebuffer.destroy(),e._copyDepthFramebuffer=e._copyDepthFramebuffer&&!e._copyDepthFramebuffer.isDestroyed()&&e._copyDepthFramebuffer.destroy()}function v(e,t,i,r){e._colorTexture=new c({context:t,width:i,height:r,pixelFormat:o.RGBA,pixelDatatype:l.UNSIGNED_BYTE}),e._depthStencilTexture=new c({context:t,width:i,height:r,pixelFormat:o.DEPTH_STENCIL,pixelDatatype:l.UNSIGNED_INT_24_8}),e._globeDepthTexture=new c({context:t,width:i,height:r,pixelFormat:o.RGBA,pixelDatatype:l.UNSIGNED_BYTE})}function g(e,t,i,r){p(e),f(e),v(e,t,i,r),e.framebuffer=new s({context:t,colorTextures:[e._colorTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._copyDepthFramebuffer=new s({context:t,colorTextures:[e._globeDepthTexture],destroyAttachments:!1})}function _(e,t,r,n){var o=e._colorTexture,a=!i(o)||o.width!==r||o.height!==n;(!i(e.framebuffer)||a)&&g(e,t,r,n)}function y(r,n,o,s){if(r._viewport.width=o,r._viewport.height=s,i(r._rs)&&e.equals(r._viewport,r._rs.viewport)||(r._rs=u.fromCache({viewport:r._viewport})),!i(r._copyDepthCommand)){var l="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n";r._copyDepthCommand=n.createViewportQuadCommand(l,{uniformMap:{u_texture:function(){return r._depthStencilTexture}},owner:r})}r._copyDepthCommand.framebuffer=r._copyDepthFramebuffer,i(r._copyColorCommand)||(r._copyColorCommand=n.createViewportQuadCommand(h,{uniformMap:{u_texture:function(){return r._colorTexture}},owner:r})),r._copyDepthCommand.renderState=r._rs,r._copyColorCommand.renderState=r._rs,i(r._clearColorCommand)||(r._clearColorCommand=new a({color:new t(0,0,0,0),stencil:0,owner:r})),r._clearColorCommand.framebuffer=r.framebuffer}return d.prototype.executeDebugGlobeDepth=function(e,t){m(this,e,t)},d.prototype.update=function(e){var t=e.drawingBufferWidth,i=e.drawingBufferHeight;_(this,e,t,i),y(this,e,t,i),e.uniformState.globeDepthTexture=void 0},d.prototype.executeCopyDepth=function(e,t){i(this._copyDepthCommand)&&(this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._globeDepthTexture)},d.prototype.executeCopyColor=function(e,t){i(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)},d.prototype.clear=function(e,r,n){var o=this._clearColorCommand;i(o)&&(t.clone(n,o.color),o.execute(e,r))},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){p(this),f(this),i(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),i(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy());var e=this._debugGlobeDepthViewportCommand;return i(e)&&(e.shaderProgram=e.shaderProgram.destroy()),n(this)},d}),i("Scene/GoogleEarthImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadText","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m){"use strict";function p(r){function n(e){var t;try{t=JSON.parse(e)}catch(n){t=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}for(var o,s=0;s<t.layers.length;s++)if(t.layers[s].id===_._channel){o=t.layers[s];break}var d;if(!i(o))throw d="Could not find layer with channel (id) of "+_._channel+".",v=c.handleError(v,_,_._errorEvent,d,void 0,void 0,void 0,f),new u(d);if(!i(o.version))throw d="Could not find a version in channel (id) "+_._channel+".",v=c.handleError(v,_,_._errorEvent,d,void 0,void 0,void 0,f),new u(d);if(_._version=o.version,i(t.projection)&&"flat"===t.projection)_._tilingScheme=new a({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new l(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:r.ellipsoid});else{if(i(t.projection)&&"mercator"!==t.projection)throw d="Unsupported projection "+t.projection+".",v=c.handleError(v,_,_._errorEvent,d,void 0,void 0,void 0,f),new u(d);_._tilingScheme=new h({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:r.ellipsoid})}_._imageUrlTemplate=_._imageUrlTemplate.replace("{request}",_._requestType).replace("{channel}",_._channel).replace("{version}",_._version),_._ready=!0,_._readyPromise.resolve(!0),c.handleSuccess(v)}function m(e){var t="An error occurred while accessing "+g+".";v=c.handleError(v,_,_._errorEvent,t,void 0,void 0,void 0,f),_._readyPromise.reject(new u(t))}function f(){var e=i(_._proxy)?_._proxy.getURL(g):g,t=s(e);d(t,n,m)}r=t(r,{}),this._url=r.url,this._path=t(r.path,"/default_map"),this._tileDiscardPolicy=r.tileDiscardPolicy,this._proxy=r.proxy,this._channel=r.channel,this._requestType="ImageryMaps",this._credit=new e("Google Imagery",p._logoData,"http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"),this.defaultGamma=1.9,this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=r.maximumLevel,this._imageUrlTemplate=this._url+this._path+"/query?request={request}&channel={channel}&version={version}&x={x}&y={y}&z={zoom}",this._errorEvent=new o,this._ready=!1,this._readyPromise=d.defer();var v,g=this._url+this._path+"/query?request=Json&vars=geeServerDefs&is2d=t",_=this;f()}function f(e,t,r,n){var o=e._imageUrlTemplate;o=o.replace("{x}",t),o=o.replace("{y}",r),o=o.replace("{zoom}",n+1);var a=e._proxy;return i(a)&&(o=a.getURL(o)),o}return r(p.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),p.prototype.getTileCredits=function(e,t,i){},p.prototype.requestImage=function(e,t,i){var r=f(this,e,t,i);return m.loadImage(this,r)},p.prototype.pickFeatures=function(){},p._logoData="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAAnCAYAAACmP2LfAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAHdElNRQfcDB4TJDr1mp5kAAAAGnRFWHRTb2Z0d2FyZQBQYWludC5ORVQgdjMuNS4xMDD0cqEAAB1zSURBVHhe7ZwHeFTFFsf/u+l9N70npOxuSAKEFFIhCSH0qhEQUHkgKCgWUFGBB6IoCAoo0ntooaRvEkIIBBBpoYSa3nvvfd+5u4sQUigPfMX8v2/Y3Tkzs3fv/d0z58zcgF69Ql1SY+MM1wQJem44ZeiJk8beEOqPwG6uC7ZqyElb9eo/JZEIkH2nRQkBIlNMauuPCS3uGN/kjkmNDghoskBAgzrZ2NLmf1+JwIKQpYsoxdmIV9+N07onCegzBPM9bOdmYKnazF6g/1N6UySPqSJzvCaaiLHtP8G/Phq+FRfgU5ogKWUXMLT6Mvzqr2BE40mMadqO8c3zMabBC6PqDDC8SlY60t9HByCLVTKu+ERmHr5TWI9wjVxEaOZivWo1pil8D1tZeWnLXv1l8iZ3PF2kjymiWRgvCoJv5U243IyAXcQq8A9Mg9W+4bDe6wv+kVGwCZkL+4Sf4ZR+BZ5VGQR3EkbWn8Hopm3wq54Lz2JD6ah/P21XGopQ9Qoc16jGSqVyTJWbQbUsibFXf42mihTwZpsvAtp3k0dOhFOSEH1+ngaDefrgjFCgFkxY8fCisCBvKgODzxRh9qslBFGfYmDGLbiV5mBwRRo8KtPhVBgPu8teMP7u73chD6kMRYRGBY5xqrFKqQwz5SdTbS/Qf5mmUYw8rf01CjHC4VP7AHZxO6E3qy9ZZCQNnio2rE/4o9/tkxiQUYp+KRXgx8XC5FsXcLz/hkCrDUU4pxLHuDVYpdwL9F+qqSJZKlPwenskfOoI5tN7YPCJGVme7wKYr5EBXzgYfW+mwTI0Gjrznaj2WW+I/y8dVPdDGLcKRzXrsEqlHO8oTKHaXqAZWe9hQXCi63NhHWYI3ilfWIW/YLjqL2JRiOFBJRz+LffhcPs09D+0J8vzn3zXdBnYnp8Mi6NboTWzH9X8fVc+DhDQodxqAroe36lU9AJNWr4cEAjNwI8OAC9cT1rbUfzwGeCfKiL7dGnNc+q1NiO80b4BY1oT4V6WDcsdc6j2xbyq4wMWrA9rQmeWFn36ey/jBaoPQ4hmLYI0G/AtAf22fC/QDols8ITrIYi/Bl6knbS2o3gRbxHQxQQ0k0S/gCa2v4OJovPwacqAQ1ICjL40klr+UrWoQbFBETo18jCpZsOoFODkvuCNJYoHW3QKXFEM7ETRcKfiQe8d6NVIFImXvg4skhY40mxnQYVRIIeA1qrHEc1GrFSpxFtP99AiFbDbNKDZpAzzGkVYVcvBuBJQEo/9/6C+dyjPitwLwak74D8V6Bfw0P5VShjXFoTR7TfhUZkL29M/wfATJan1lauWC3aDOgyaVDCuTgbf1bFkfmtkye1ogsK2asivLYfCglIoD8qCknI2NHuG4QSVGMgQyMbt0fioRYh9VYcRU7QX55uDcaHtFOJEsThMtmWtQgxsDodsWaC0c3ea3MzGBJEqxrfbYmzr6xjfPAeTmt5HQPO7eK1xDibUz8eY+k8xtHYJPCtXwvHOu7AXMrMTsF/TH8HajTis1YwVqpWY0TXQDKy1OpBr5EJA52Fukxx+bmKxtjWx2DuaWawNlZD5qhzyo9KhpHAbKpJO/6t65UCPbPHA2PYrGNacgkElabCJJDev/MpDhUKKnuq44LRoYEK1IiswkS1zYCfk5y+F0qjvoTwqBOof34dGeAnUL1ZCLboEnJ9zoe0QD/Nuj00UBVXRabzVLETM3S0ICfwA8yc7Y6C3ANYbZsA7aQ1W1xzEfZEQ6dT2BkG9pP4ouo7jGE1u42JS20QMrzkCr4xwuN4+AM+cYII3EaNar2J86zmMrP8DHulCON4NhU3YWuhOYy6SZENpH9cfx7WacFC7BSvUqjBDsRPQIiugURvazeqYVaqAw6dYrJ9WQy7gayj4nYDy3HtQOVQGpYRqKEWXQf2HdGha/AFdae9Xr4czz0ubISRA75ECbSut7agegO75OLxpahze8j5GtifBpzEDLiV30Dd2mNT6StWiCbVmLt5rUkBQCEt2zWzIMSA8HgrIBkLD+Sp0jhHISYXQ/KMYukfvQ3fQxq68XCTBHId/tMTg7LV1CFs4BszJ6hBarBgHlcRv8H7tbuSKQpFPYGe0BmND+nZ0npECaPKf0r4UIxsuoF/IMpitsAVnrA4s15uh3x8fwLXkLobUZGJIXTqcUzbDaJE5FAVq0t4S7dEcjqMEc6B2K5arVWN6Z6AbdOmm5mJelQKOHWSxF44Cy4CqxW0s6RwchCovFRohdGNfLgX3WiZ0N4aD++y7jfwYJUrAPCle/ZjKV+BFTSegrGAZIm3QjXhBytTWB3zhByzryMUU986jz16wD+96ijCNUIAgmkc3tS6G7GERjCbgR82B4OTbEESqIiCIcqsIYzoGGyrBEMSmgh8xBoIIAR2fAHZhj8Z9DOhl9FHeKkSDvn809fuc+iyCddRYaiOZBTvIt1YJfs0b4N+WDO+GHPLQN2Ab7S61vjJV60C9SRPvNSqzTpxlyQfS1dGUmjppK7gW16B/LhN6abnQu5cDwzO3YNhhqqK4WJY887sEdGzWFpxfOxmDpKZOOvgWFB8sx9L6nShvP4FyUQjKGg5gScpGKEqbUE7RxiGYv6QQ4zIG/r4D2m88sjEy/EIW/a6+TQ4gHe5VhXCvy4JL7gLYnesI2i6t4Tii04r92u1YKt767gB0ozrkGzmY26zEOh7Hkt+kAKhLTX9qOVVdg9aoNOjcToR+wUVKLYKgN0Zq7l7884wn9CKgr4AfWw/B6SwqKQRKOdXVghe9CpbherASSjtIpGpxRIHFjwygNreoXy0lb+lU7lHJBP9kPcGXQnBNghUB/Lh44fbUp5JA+5Hs71LbPPLCVRDEJZDNGIJgeQI6mG6KegKzldq1U7tGKjQmHR8vwl86kgRoAQN0xBw6ztn0nQ/ocxEdQ7L4d/BjG6g+m8aZTL/xsXPuW82Fb8t+DG1Ox5D6XAwqvQ67OA+p9ZWoUQPsei78mjSwNU9GLmEzVGZJTd3qFPTn3YZhXgYMMjNhlHsDxms/hNWfoUdrNPgEc2h7BG5d/Bo7Blt0BuNxXf4MVmXrkdRyEHWiY6hr2oc7mevRX2wc18gioEeI1+N9a+/CNnImVAZ0mhEoNOPAJT8MHjUF8KTiWhqHgbfMpVaJdhLQh3XasU9bJAZ6ekeg6zQwgEKuLSWysmd3QGmatLqD8qDNug3dCX/AIPk4jGr2wDB/JXTmkan70IvmZTY/rB9BdZlKLkG0lG0d5klAObKsw1+jzyFiWPnRawiaDrMYwTyMwMwh220WP2IWFVfqN4CKO8E3n0C6R/ZUej9Y2kUiMdDRFTRePH3nA3q/m7xpAEtAXl0QrkTwscnmS/3eptdzNEYevZLnZ5booqk8tuYs9tAny+n1LL1mghezlcULH0VtHamOZhvhIvoNOXQsd2EZIbluYnlWaMO75TCFG9kYXJ8H14o76H/10Z3yClSrCm6jGtbWK7LC7kIlYRfUmY2XHnUa+mbXYRSfCuNCptyE6b1jMBD/EPKwchQPLxGdxOWWI8iKXYBPqLozgI8pfA5YBWvxbfMeNLUfRmPTLjRnr8YKsdGvRQ5j2zZTSSRQ78H+7GhxfScFAINypsG9ukDspZ0LKKE+O0pqlGi71ggcIqD3dga6RhFKjSqYT+VEFkvu/E9Q+HNWKaE2VVDgVkPFqwAaay5CN3En9M59BM2vfKDs7AvljjPGE5LlharQdL+LoCmhOHU0rIUyD+NgVTOa+q2iVQiIcAKpHtbhXuJOjPqeVCRYThNE6VTvKNs3hM3cHGIxntxKyCbP7Erj1lHZJbVIJAG6iiCroZCAPGukvOyASJbvCgoaAoKoAQ1kHcGC7nmZDkmhBR2PfSQLtkcl4zCSAE2eO6qExYuYxrE4KqdvelBiM4+ncYQy1IY8d0wbhUSLJAZGbsUceNYdwJCGPAyuy4NbZToG3JoO1Qk9AvHvqF4ejo0KCKlisyl04Jw+AE1ma71HRUJP+QqM1t2HcVEyTEoSYVYQCuN3HenCt4XDhGA+KorAnYZ9KIj5ELOl3XpU/k/wrt+OmraDaG7cjpacbxFvYAAZDG5Vw/DWCxjRdp+ATsWAS6+D69H1+XDNsoVb1T06b0VwzCmBIOYdqUWibTojcFBH1CXQctBtUcA6Oh/RmVC4sBmKA5j6erC1qqE4sRpqG25A43QIOHuXgvOmP5R4ZH6m5UY2L9SSLjZ5sKjjsI/o8olH8ngjCZoSgmw9DMIl3t42Up0g+pq89/sEjLK47knZhSkSuDepJP4JOyNJyEFAR8VQKMOR1nbWM69yxNJYwh+VLE90ffPyxLE3EwL9Jq0huWQqwL1iA7zq8+FVl0+epgBO6T+gb2TH+OglqgastxtZrNNlkLt8E5oJx6HZdab7mFZBk3UZRjMewCT7HkzLfodZxREYr5sBjiIBPYiAPt8ehvSGPSg5vwjzpd16VNkmmDTswp22QDTXbkJrxhJkzHGDFoUQmvBpvo2hrZl0TnLhlLIYfUO7nt7dSg3hURcP1/JiDEgphuXBqVKLRFsfA3oJAf3mI6Cr2OjTwGYdqWGzzmZD6WoYVCfehdqsZKjuuwS1oB1Q+5piHac3oaxBzZ9vLZ4nHEeesoXg6niDPSYWP9yUgD5PHu48eKE64krHcErchHIEuRysTpAXjObQWIYEHiV4EQYEojp5aEoyY+IIpOQugKYYOnIdJXrdJ63PtWwXMQM6m6SVT4gfZkbHV0XHsVtaQ3K8yoJr0YfwoHDDq5ZiQSqDik/B4Q9taYtn18gyNia1qGJsmTrGlUjK2FJ1jCjRwOASDnkxDvN95ZD/og5yl0qgfCMJ2leDoeksHaFHXYOJVyrMkm/DrPwMzGr2wmjnLGipthyHL0W7t9pDkduwF2U3lmGFtvbTdyirt0OreT+iWwPRUrUBbSkLkT/fCUZwKVYikBMwpDlPXNzLwuAQ2rWX8KzUh2dDDJyLSmB7/S5Mf3WRWiR6CPSezkCXQs6qBnLCKsheyoXqnTCoL9oOFd9/Qtl9KJT6UJMX3/zhCz8iuCjhiviSYtMx3ZTJBN8lCE7eIRgF0p6krRRaRBDskTTGySBKws5SuUjJHYUiMQdpzCUE0Q3y5MnSDhJJQg5JUvjSgO5hHZofaioGmvc40IycMgbRtJktjgOZ5Ma9irzSg46xYHcaVEZevkgBHqUWGFK+FENKQ+BdGAq/wiMYWbwHI6h4FwTDOes0BMKFMHxPNg9qn1dANakYanfuQSs5FJoTpaP1qBswsSGgb9+EeUU0Af0LDH4dBhXlmv3wajuOpPYQFDcEojxtNQ6sn9ZzUsiofjfUWg/iYOt+tJatRtvN95DqZgxNuKTKwLV4Jdyqc8Wz1uCGTLjmDIVDQqewQ8anwpJi6GsYkF4Ey2O/QvsfXKlJIgboAwT07s5AZ0G1TylUIsuhdKMI6vcuQ3PVAqg+9UZ8JvGEywiuNoIwD4IzaV2X+HSa1otgE3+NwJImVkycG0kx8snfyUZJW+QFApeSu+hN9BpIn6n+ZBp9bqDv+C8Fum+8IpzzJNOmR3UhTaGFcC07iAHXmamuZw28C/S/aIt+CcthF7+ToN0EQdhqOFzcBu/Sm/ApvAGX3DzYXIiF9jtWTJf74L6ZC83UfGg8SId2xnloSZKxp+gWjC0J6KSrMK8KhmnlSugtInpkCzaBV78Hl5oPoaLpECrLt+Bi4jfgS7t1q+YDUGsPwj5KDFsLlqD97JuIpmpZmP+TftM1ezjlxsOllM4H3eReDWHwKrOBW84jqMeK5OBTv4Bu6HxxgqU1s/N3MkAHSoH+ioCe+gjoJHB0s8ENLID6/UJo3E+GVlwoNEwY278tXhR50RhmeexzgmM8JXjdF36MHwEoiXn70Csv6gxBm8PiRc6gJFD1HDzFpq1cP0omo5QJZAfqQzH0f6uHZjQgeR4cC/IJZCnUtSkYVPAWBiX2/CdU/S7Ql+9TgtFCTaiP0qAEXA2yRsqwuzECziWZcM4tgv2DSljF7ID+l+JNh9+hY38HuvcYmLOhk5EEnVPfQOmpW+33YGaXhj53E2BWuxvGebOh5cPUX/sWSgXrsa9mB2qaDqCK4C7I2IA3jn8u7tat2g6D034MIbWb0fZgHlr2DscXUhNNuYdkYRPrg/7JiXDMLYBrZS6GNEZgVJM/JjWY4I16G4xr/BCDq2nKjjoAvY+Zpwo7eXBskQK9Swr0lEdAn4a2wk3o/DMNWmn54KYUQIuZsebGQuXFQ42H4kfNk4QckSOkNZ1lGkGAUoInOKkAm2jJsVtH+om9Nj9ytZxNcNdhljXByo+JJXj/i4G2u2xM02YInPJLxFB7VudTPH0ZHkWu0hbPpwHpfnAszoFDVgVsb1fDMmoL9L8S7wTFQE/1AvR33oB+QSp0czKgl34B2iO9uwJCKib5SGaZjbqLPlkhMG1YDr1gQyioSs24vQTDitagsnIL6loCUVu9C2EJK9FjYtsWBNP2Q7hb9A155zdwY5mTeGexo0w32hEcy2F7JQaOqZfgk38KY6rDMKFBiGHNt+iGPgCNYd0/s/sbAb2fgN5JQC9Wq8bkR0AzioOOx3Xo30mGbnY+tNMKoJOQCm03qfnFxRf6E1yUFAqZJcyuZRWuQmB+TWHJcgJfkjPxImcSSIUsXviMx/O9DvqfALrPDjb6nhuBAWkZ5JFKKTYuIqhz4FUdAo9CGwzO7Ra2LjUg0w9OxdlwyKxAXzHQm8lDi4HeAT1WMPSHnYXR7aswKE6Gfl4K9PdfgZ6+uG8XSmMbKyXD/LsEmFduglH2NHA7rA3Hvg+Ve1/gYO4KNFRvQUPLQVRU7MG4yn1dJ4eiULAo3JhW9xsa77+Hml8GY8FQ425uAM5wRRivNoPlTjs4XhoH35oLGFZ/S/wglyDkbWmrrsUAvY+A3kHlSwJ6ihKzCvLnuQyElmIs9LdfhmHxA+jn5kI3jcrRFOjxU6DTbTx9DybsOBh0f034EeYEVyaFD0IYhnQ9y1pTIsiPvU5AnKYkUBL78yKmQhDLgDRPSWtPp/HFkFtHqFCfRBr73wX67qsD+qFsEubCnqKBAZllcCkkT12RjSHVMfApH0bJXfcH+aQGZg6FU1EWeeoK2NwgoMM3Q++zP/fq/Smf2g392ZEwzk2Acfl9GBHURmuSYPyn132oHBizH8B8wjX0SadQI2cWtOZZQbHTdEgRn8XN93EiczFayn5GU3Mg7lJMPab5SEeoCWZZ0TF4Ne/A/ZSPUbXdDz9Qdddrrk/KtcwR7jX34VXDzGCFGFT0GzyLu922x069kdiv145tOu34jlOHBWoz4arUAZQt0LYOhmFcHJ2H6zAsYnZDc2FwKhv60+m9UQrLUJ4hSYQAVhpM1O6jj30EDD33Q6frZyoY8cMVaWZZR560kuB5V9H6iVUas+Py5L1/IHsT2ZldR4nEkMdkUd8Y8tYd43mLIMhYhenDWvgjQSQiGFOkiEv0rEAzK2u8yG10M2WwBWFdb6q9NKDNd6rCOuYD9L2VI/57QMfcEniU5cCnJgG+lR9haAnz4MzT5ZjmA4e8HBqnGtYXamF+nK7bpx0uwHxoqGyE3sKD5HHjYVJ1C6Z5qTD5Ph2G1hnQEV/0LBhxU2E+4yYsbgTCJGsuNBfYQrnjA0CPxDo2CRYJ0xGesgD1ZWvQ3LQbKeSJ54uC0UcUDVVRGExFR/FB2y7cSf4C+Zv9sXSUeQ9P2z2pQdnmBHQsPKqKqFCyWJsM75o1GMw8O/iEhFZs/KK9CD9wRfhCTYTP1dqwnBOHrQYz8IuuH5ZxxI/MLQZH5kfoeu6D4cVQGNecgXHFbRgXZsD4Xg5MjqfDeE0KTBbRDLXsLiwOR8HkxCJoOs+Eavdr08ZBBGdYP7rYzAZILsH3LYUYtgSsAXlYRwLqW0r8Ksl2id4/Onaz47IE+kayUfwddYhsgwkqXRrLgOpHEuyhVF9B7ytoTAL//qNjeFagGfGEi5nvYPEifqOx/ek4p1J/8aKBWC8N6Icy2+oL6zOhECTmw46SuoHZpXBn/pK7/DK8K1bCp3Q0vAv7wqfIBD55OuS9teFVYASPfAFccseThw+E4Ho5LOMqYB6ZCeOdK6H1bleJH2sOOPZradqlC3otDqY5F2GafQmmCZdgFnMBZteEML2yCnprh0CZWVp66gbDuD5Q2uSLUacm43jSB0gq+h55JeuRX7wRqUUbkJL8DS4GTcPqCdZgduZ6XiZjgvcp9fIY3aAH/yY+3KvcMDBjLSXQBXDML4VbaQG8a9PgUxcOzyIneKY/Or6FHDO8q7INY+RiMFJaJijE4i2VeEylej/FDs99TAPH8Dvofv8bDK/vhVHxMRhX0W+vOgXTijiY5UXANGkNnYeRUGN2VrsPNx6XVaQNgRNM03sBgUjeOKJJ/Cr+LNzFsg61YB5/elyKtic0qM031CaZAG0gqJnVEuYBIoI49gy9D6DXrQR3GoU2j3YE+WE2FI9TGBG1FLywnhNbPt1Y/OhY+o5iGqsGNmdLaVxfqZUB+g0Iztwi2AOkNZ3FCzOm30bHeHK9tKYHKfPZMFhlAtM9c2EpjALv93zY3qlE/8xyOOUVUTiSBrfy83CvDIdbRZC4uJSGwzHzd0qgkmEVfRnGW/dC79vPobtkFLRmm0HDpVt43MnrzoOm/dfQeeOf0P3wB+guJogXrIDuhHfAsdOFbKdQ5GkaYQbNNYNht2c8/AOnYNKB6Ri//Q14zRwIuohdPC76pCbWKGFCkx9GNC7B0NZD8CiJh8Odi7A59zud7EuwvU4hVUYZBhUXwqsqA56V0RiUM1Dam36UoiyFuprQhc6fRZuKKhV5+rcLKD2hrPQ+NPsvgNb0j6C9eCG0v/kU2l9/BK0ZM8EdRJQ833noG8Qib6lDkA0lYD6i8GIJlffZ/IhhbJtQjW4TP164EiWWztTnH9T+a4L/MxpjAn02hWWYDAQnefSZzm7Io7zDOpiSzGh3grwPwd3zDccPZdH4phBEkXcWBrD4wlE07qObw5pmBUGsK43T/YPfgmAFWEe5U2EeCXhGcV5nQ3u2KrTf6w+jdTNhtud7mB/ZC4vg43QAwbAMDYLF0e3os+8HGP80D7oLx0F9dD+oj9AGZ4Y85K0Yj/Vs3kQiFgeybFPIySiDzdwAz9O3JzHjPNtYk8gjv948FOOatlGodR0Dk07Bau9n0F8wFBp+luBO1CXeuDD51Q3830PRP7UIzgUlcC0vhHPRSdic6eI53ecT3W0sKyjI2EFRxhzyz3sOO8voBkEUTclYhAyshCwr642PR79diwlbBOEs8vLMFjgbbuelhpeoz5rEDxsNNl/+9ON5RWJOLsXCysQdh5IhWWbzhUmoel6v/l/RxGpZTKgbh3EtEZQMp5AX2ASd2f3AVu7695ky/7nOuc2U/BZSCFIGp+I82F/rfprsVa/+Mk0sZ2F0tTvGNZ+gRO8B7C/HQ92beWine+/IDWDBbJUmbBN/hUNOGRyyStH34vfQeP3ZV4R61atXIu9Kefg1rIB/XRJciwso9nymLXmxbP+wxcCsVAxIKwfv1AZoDH96jN6rXr1SuVeowKsuFINrs+BSXATbc59JLU/XwCwdDMw7B/vUEpgHfQYZ7v9HCNar/2E55ynDpSwYrhXF4uKUeQiY0/Oy3kM555nCITcJgmvp0F30Yo8L9KpXL1X9E2XhkPoVBuYWwbmolKDOhmv+WHiXyGNkgbTRE1pOublXkRycCz+AfUoRzPdsgKJN1w/19KpXf7n6xlnCPikE/SkWdswrozDkNoZUfIWhFTYYWaPy4a6NkgSR2XAZXSOLIWUWcCv7FP1T7sH8wFZwp7ycxz971auXIm4AG+b77MFLEKLv7ULJMy0FefCsPAOv0t0YUrIMg0s+gVfxYrgVbIJLUSzsrl2F2ZZl4L7J/Pdp/956ca969UrEna0O41/HwSJ4F3in42Fz5Trsbt5Bv3u30e9uImyvnoV15GGY/LIA6kOZP1966pZ8r3r1n5eqhwZ0F/aB4ToHGK9zh/FPHjD60RE6H1tDaaA2cdy7mvFfI+BffksPNrEksu0AAAAASUVORK5CYII=",p}),i("Scene/GridImageryProvider",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/GeographicTilingScheme","../ThirdParty/when"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._tilingScheme=i(e.tilingScheme)?e.tilingScheme:new o({ellipsoid:e.ellipsoid}),this._cells=t(e.cells,8),this._color=t(e.color,l),this._glowColor=t(e.glowColor,u),this._glowWidth=t(e.glowWidth,6),this._backgroundColor=t(e.backgroundColor,c),this._errorEvent=new n,this._tileWidth=t(e.tileWidth,256),this._tileHeight=t(e.tileHeight,256),this._canvasSize=t(e.canvasSize,256),this._canvas=this._createGridCanvas(),this._readyPromise=a.resolve(!0)}var l=new e(1,1,1,.4),u=new e(0,1,0,.05),c=new e(0,.5,0,.2);return r(s.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}}),s.prototype._drawGrid=function(e){for(var t=0,i=this._canvasSize,r=0;r<=this._cells;++r){var n=r/this._cells,o=1+n*(i-1);e.moveTo(o,t),e.lineTo(o,i),e.moveTo(t,o),e.lineTo(i,o)}e.stroke()},s.prototype._createGridCanvas=function(){var e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;var t=0,i=this._canvasSize,r=e.getContext("2d"),n=this._backgroundColor.toCssColorString();r.fillStyle=n,r.fillRect(t,t,i,i);var o=this._glowColor.toCssColorString();r.strokeStyle=o,r.lineWidth=this._glowWidth,r.strokeRect(t,t,i,i),this._drawGrid(r),r.lineWidth=.5*this._glowWidth,r.strokeRect(t,t,i,i),this._drawGrid(r);var a=this._color.toCssColorString();return r.strokeStyle=a,r.lineWidth=2,r.strokeRect(t,t,i,i),r.lineWidth=1,this._drawGrid(r),e},s.prototype.getTileCredits=function(e,t,i){},s.prototype.requestImage=function(e,t,i){return this._canvas},s.prototype.pickFeatures=function(){},s}),i("Shaders/ShadowVolumeFS",[],function(){"use strict";return"#extension GL_EXT_frag_depth : enable\nvarying float v_WindowZ;\nvarying vec4 v_color;\nvoid writeDepthClampedToFarPlane()\n{\ngl_FragDepthEXT = min(v_WindowZ * gl_FragCoord.w, 1.0);\n}\nvoid main(void)\n{\ngl_FragColor = v_color;\nwriteDepthClampedToFarPlane();\n}\n"}),i("Shaders/ShadowVolumeVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec4 color;\nvarying float v_WindowZ;\nvarying vec4 v_color;\nvec4 depthClampFarPlane(vec4 vertexInClipCoordinates)\n{\nv_WindowZ = (0.5 * (vertexInClipCoordinates.z / vertexInClipCoordinates.w) + 0.5) * vertexInClipCoordinates.w;\nvertexInClipCoordinates.z = min(vertexInClipCoordinates.z, vertexInClipCoordinates.w);\nreturn vertexInClipCoordinates;\n}\nvoid main()\n{\nv_color = color;\nvec4 position = czm_computePosition();\ngl_Position = depthClampFarPlane(czm_modelViewProjectionRelativeToEye * position);\n}\n"}),i("Scene/StencilFunction",["../Core/freezeObject","../Renderer/WebGLConstants"],function(e,t){"use strict";var i={NEVER:t.NEVER,LESS:t.LESS,EQUAL:t.EQUAL,LESS_OR_EQUAL:t.LEQUAL,GREATER:t.GREATER,NOT_EQUAL:t.NOTEQUAL,GREATER_OR_EQUAL:t.GEQUAL,ALWAYS:t.ALWAYS};return e(i)}),i("Scene/StencilOperation",["../Core/freezeObject","../Renderer/WebGLConstants"],function(e,t){"use strict";var i={ZERO:t.ZERO,KEEP:t.KEEP,REPLACE:t.REPLACE,INCREMENT:t.INCR,DECREMENT:t.DECR,INVERT:t.INVERT,INCREMENT_WRAP:t.INCR_WRAP,DECREMENT_WRAP:t.DECR_WRAP};return e(i)}),i("Scene/GroundPrimitive",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartographic","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/destroyObject","../Core/DeveloperError","../Core/GeometryInstance","../Core/isArray","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/OrientedBoundingBox","../Core/Rectangle","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Shaders/ShadowVolumeFS","../Shaders/ShadowVolumeVS","../ThirdParty/when","./BlendingState","./DepthFunction","./Pass","./PerInstanceColorAppearance","./Primitive","./SceneMode","./StencilFunction","./StencilOperation"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D){"use strict";function R(e){e=n(e,n.EMPTY_OBJECT),o(e.geometryInstance)&&s("GroundPrimitive.geometryInstance","GroundPrimitive.geometryInstance is deprecated in version 1.18 and will be removed in version 1.20. Please use GroundPrimitive.geometryInstances."),this.geometryInstance=e.geometryInstance,this.geometryInstances=e.geometryInstances,this.show=n(e.show,!0),this.debugShowBoundingVolume=n(e.debugShowBoundingVolume,!1),this._sp=void 0,this._spPick=void 0,this._rsStencilPreloadPass=void 0,this._rsStencilDepthPass=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._uniformMap={},this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._readyPromise=w.defer(),this._primitive=void 0;var t,i=new A({flat:!0});o(this.geometryInstances)&&h(this.geometryInstances)&&this.geometryInstances.length>1&&(t=G),this._primitiveOptions={geometryInstances:void 0,appearance:i,vertexCacheOptimize:n(e.vertexCacheOptimize,!1),interleave:n(e.interleave,!1),releaseGeometryInstances:n(e.releaseGeometryInstances,!0),allowPicking:n(e.allowPicking,!0),asynchronous:n(e.asynchronous,!0),compressVertices:n(e.compressVertices,!0),_readOnlyInstanceAttributes:t,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_createPickOffsets:!0}}function O(e,t){var i=t.maximumRadius,r=i/Math.cos(.5*e)-i;return R._maxHeight+r}function N(e,t){return R._minHeight}function L(i,r,n){for(var o=n.attributes.position3DHigh.values,a=n.attributes.position3DLow.values,s=o.length,l=r.mapProjection.ellipsoid,u=Number.POSITIVE_INFINITY,c=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,m=Number.NEGATIVE_INFINITY,p=0;s>p;p+=3){var v=t.unpack(o,p,Y),g=t.unpack(a,p,X),_=t.add(v,g,Z),y=l.cartesianToCartographic(_,K),C=y.latitude,E=y.longitude;u=Math.min(u,C),c=Math.min(c,E),h=Math.max(h,C),m=Math.max(m,E)}var S=Q;if(S.north=h,S.south=u,S.east=m,S.west=c,S.width<d.PI){var w=f.fromRectangle(S,R._maxHeight,R._minOBBHeight,l);i._boundingVolumes.push(w)}else i._boundingVolumes.push(e.fromEncodedCartesianVertices(o,a));if(!r.scene3DOnly){var T=r.mapProjection,x=e.fromRectangleWithHeights2D(S,T,R._maxHeight,R._minOBBHeight);t.fromElements(x.center.z,x.center.x,x.center.y,x.center),i._boundingVolumes2D.push(x)}}function F(e,t,i,r){o(e._rsStencilPreloadPass)||(e._rsStencilPreloadPass=_.fromCache(W),e._rsStencilDepthPass=_.fromCache(H),e._rsColorPass=_.fromCache(q),e._rsPickPass=_.fromCache(j))}function B(e,t,i){if(!o(e._sp)){var r=t.context,n=S;n=P._modifyShaderPosition(e,n,t.scene3DOnly),n=P._appendShowToShader(e._primitive,n);var a=E,s=e._primitive._attributeLocations;if(e._sp=y.replaceCache({context:r,shaderProgram:e._sp,vertexShaderSource:n,fragmentShaderSource:a,attributeLocations:s}),e._primitive.allowPicking){var l=new C({sources:[a],pickColorQualifier:"varying"});e._spPick=y.replaceCache({context:r,shaderProgram:e._spPick,vertexShaderSource:C.createPickVertexShaderSource(n),fragmentShaderSource:l,attributeLocations:s})}else e._spPick=y.fromCache({context:r,vertexShaderSource:n,fragmentShaderSource:a,attributeLocations:s})}}function V(e,t){var i=e._primitive,r=3*i._va.length;t.length=r;for(var n=0,a=0;r>a;a+=3){var s=i._va[n++],l=t[a];o(l)||(l=t[a]=new g({owner:e,primitiveType:i._primitiveType})),l.vertexArray=s,l.renderState=e._rsStencilPreloadPass,l.shaderProgram=e._sp,l.uniformMap=e._uniformMap,l.pass=b.GROUND,l=t[a+1],o(l)||(l=t[a+1]=new g({owner:e,primitiveType:i._primitiveType})),l.vertexArray=s,l.renderState=e._rsStencilDepthPass,l.shaderProgram=e._sp,l.uniformMap=e._uniformMap,l.pass=b.GROUND,l=t[a+2],o(l)||(l=t[a+2]=new g({owner:e,primitiveType:i._primitiveType})),l.vertexArray=s,l.renderState=e._rsColorPass,l.shaderProgram=e._sp,l.uniformMap=e._uniformMap,l.pass=b.GROUND}}function k(e,t){var i=e._primitive,r=i._pickOffsets,n=3*r.length;t.length=n;for(var a=0,s=0;n>s;s+=3){var l=r[a++],u=l.offset,c=l.count,h=i._va[l.index],d=t[s];o(d)||(d=t[s]=new g({owner:e,primitiveType:i._primitiveType})),d.vertexArray=h,d.offset=u,d.count=c,d.renderState=e._rsStencilPreloadPass,d.shaderProgram=e._sp,d.uniformMap=e._uniformMap,d.pass=b.GROUND,d=t[s+1],o(d)||(d=t[s+1]=new g({owner:e,primitiveType:i._primitiveType})),d.vertexArray=h,d.offset=u,d.count=c,d.renderState=e._rsStencilDepthPass,d.shaderProgram=e._sp,d.uniformMap=e._uniformMap,d.pass=b.GROUND,d=t[s+2],o(d)||(d=t[s+2]=new g({owner:e,primitiveType:i._primitiveType})),d.vertexArray=h,d.offset=u,d.count=c,d.renderState=e._rsPickPass,d.shaderProgram=e._spPick,d.uniformMap=e._uniformMap,d.pass=b.GROUND}}function z(e,t,i,r,n,o,a){V(e,o),k(e,a)}function U(e,t,i,r,n,a,s,l){var u;t.mode===I.SCENE3D?u=e._boundingVolumes:t.mode!==I.SCENE3D&&o(e._boundingVolumes2D)&&(u=e._boundingVolumes2D);var c=t.commandList,h=t.passes;if(h.render)for(var d=i.length,m=0;d>m;++m)i[m].modelMatrix=n,i[m].boundingVolume=u[Math.floor(m/3)],i[m].cull=a,i[m].debugShowBoundingVolume=s,c.push(i[m]);if(h.pick){var p=e._primitive,f=p._pickOffsets,v=3*f.length;r.length=v;for(var g=0,_=0;v>_;_+=3){var y=f[g++],C=u[y.index];r[_].modelMatrix=n,r[_].boundingVolume=C,r[_].cull=a,r[_+1].modelMatrix=n,r[_+1].boundingVolume=C,r[_+1].cull=a,r[_+2].modelMatrix=n,r[_+2].boundingVolume=C,r[_+2].cull=a,c.push(r[_],r[_+1],r[_+2])}}}var G=["color"];a(R.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}}}),R.isSupported=function(e){return e.context.fragmentDepth},R._maxHeight=void 0,R._minHeight=void 0,R._minOBBHeight=void 0,R._maxTerrainHeight=9e3,R._minTerrainHeight=-1e5,R._minOBBTerrainHeight=-11500;var W={colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:M.ALWAYS,frontOperation:{fail:D.KEEP,zFail:D.DECREMENT_WRAP,zPass:D.DECREMENT_WRAP},backFunction:M.ALWAYS,backOperation:{fail:D.KEEP,zFail:D.INCREMENT_WRAP,zPass:D.INCREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!1},depthMask:!1},H={colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:M.ALWAYS,frontOperation:{fail:D.KEEP,zFail:D.KEEP,zPass:D.INCREMENT_WRAP},backFunction:M.ALWAYS,backOperation:{fail:D.KEEP,zFail:D.KEEP,zPass:D.DECREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!0,func:x.LESS_OR_EQUAL},depthMask:!1},q={stencilTest:{enabled:!0,frontFunction:M.NOT_EQUAL,frontOperation:{fail:D.KEEP,zFail:D.KEEP,zPass:D.DECREMENT_WRAP},backFunction:M.NOT_EQUAL,backOperation:{fail:D.KEEP,zFail:D.KEEP,zPass:D.DECREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!1},depthMask:!1,blending:T.ALPHA_BLEND},j={stencilTest:{enabled:!0,frontFunction:M.NOT_EQUAL,frontOperation:{fail:D.KEEP,zFail:D.KEEP,zPass:D.DECREMENT_WRAP},backFunction:M.NOT_EQUAL,backOperation:{fail:D.KEEP,zFail:D.KEEP,zPass:D.DECREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!1},depthMask:!1},Y=new t,X=new t,Z=new t,K=new i,Q=new v;return R.prototype.update=function(e){var t=e.context;if(t.fragmentDepth&&this.show&&(o(this._primitive)||o(this.geometryInstance)||o(this.geometryInstances))){if(!o(R._maxHeight)){var i=e.terrainExaggeration;R._maxHeight=R._maxTerrainHeight*i,R._minHeight=R._minTerrainHeight*i,R._minOBBHeight=R._minOBBTerrainHeight*i}if(!o(this._primitive)){var r,n,a,s=this._primitiveOptions;if(o(this.geometryInstance))r=this.geometryInstance,n=r.geometry,a=n.constructor,o(a)&&o(a.createShadowVolume)&&(r=new c({geometry:a.createShadowVolume(n,N,O),attributes:r.attributes,id:r.id,pickPrimitive:this})),s.geometryInstances=r;else{for(var l=h(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],u=l.length,d=new Array(u),m=0;u>m;++m)if(r=l[m], +n=r.geometry,a=n.constructor,o(a)&&o(a.createShadowVolume)){var p=r.attributes;d[m]=new c({geometry:a.createShadowVolume(n,N,O),attributes:p,id:r.id,pickPrimitive:this})}s.geometryInstances=d}var f=this;s._createBoundingVolumeFunction=function(e,t){L(f,e,t)},s._createRenderStatesFunction=function(e,t,i,r){F(f,t)},s._createShaderProgramFunction=function(e,t,i){B(f,t)},s._createCommandsFunction=function(e,t,i,r,n,o,a){z(f,void 0,void 0,!0,!1,o,a)},s._updateAndQueueCommandsFunction=function(e,t,i,r,n,o,a,s){U(f,t,i,r,n,o,a,s)},this._primitive=new P(s),this._primitive.readyPromise.then(function(e){f._ready=!0,f.releaseGeometryInstances&&(f.geometryInstance=void 0,f.geometryInstances=void 0);var t=e._error;o(t)?f._readyPromise.reject(t):f._readyPromise.resolve(f)})}this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e)}},R.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)},R.prototype.isDestroyed=function(){return!1},R.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),l(this)},R}),i("Scene/MapboxImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/MapboxApi","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o,a){"use strict";function s(r){r=t(r,t.EMPTY_OBJECT);var n=r.mapId,s=t(r.url,"//api.mapbox.com/v4/");this._url=s,this._mapId=n,this._accessToken=o.getAccessToken(r.accessToken);var h=t(r.format,"png");this._format=h.replace(".","");var d=s;if(l.test(s)||(d+="/"),d+=n+"/{z}/{x}/{y}."+this._format,i(this._accessToken)&&(d+="?access_token="+this._accessToken),i(r.credit)){var m=r.credit;"string"==typeof m&&(m=new e(m)),u=m,c.length=0}this._imageryProvider=new a({url:d,proxy:r.proxy,credit:u,ellipsoid:r.ellipsoid,minimumLevel:r.minimumLevel,maximumLevel:r.maximumLevel,rectangle:r.rectangle})}var l=/\/$/,u=new e("© Mapbox © OpenStreetMap",void 0,"https://www.mapbox.com/about/maps/"),c=[new e("Improve this map",void 0,"https://www.mapbox.com/map-feedback/")];return r(s.prototype,{url:{get:function(){return this._url}},ready:{get:function(){return this._imageryProvider.ready}},readyPromise:{get:function(){return this._imageryProvider.readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}}),s.prototype.getTileCredits=function(e,t,i){return c},s.prototype.requestImage=function(e,t,i){return this._imageryProvider.requestImage(e,t,i)},s.prototype.pickFeatures=function(e,t,i,r,n){return this._imageryProvider.pickFeatures(e,t,i,r,n)},s}),i("Scene/Moon",["../Core/buildModuleUrl","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Ellipsoid","../Core/IauOrientationAxes","../Core/Matrix3","../Core/Matrix4","../Core/Simon1994PlanetaryPositions","../Core/Transforms","./EllipsoidPrimitive","./Material"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m){"use strict";function p(t){t=i(t,i.EMPTY_OBJECT);var n=t.textureUrl;r(n)||(n=e("Assets/Textures/moonSmall.jpg")),this.show=i(t.show,!0),this.textureUrl=n,this._ellipsoid=i(t.ellipsoid,a.MOON),this.onlySunLighting=i(t.onlySunLighting,!0),this._ellipsoidPrimitive=new d({radii:this.ellipsoid.radii,material:m.fromType(m.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new s}n(p.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var f=new l,v=new l,g=new t,_=[];return p.prototype.update=function(e){if(this.show){var t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;var i=e.time;r(h.computeIcrfToFixedMatrix(i,f))||h.computeTemeToPseudoFixedMatrix(i,f);var n=this._axes.evaluate(i,v);l.transpose(n,n),l.multiply(f,n,n);var o=c.computeMoonPositionInEarthInertialFrame(i,g);l.multiplyByVector(f,o,o),u.fromRotationTranslation(n,o,t.modelMatrix);var a=e.commandList;return e.commandList=_,_.length=0,t.update(e),e.commandList=a,1===_.length?_[0]:void 0}},p.prototype.isDestroyed=function(){return!1},p.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),o(this)},p}),i("Scene/NeverTileDiscardPolicy",[],function(){"use strict";function e(e){}return e.prototype.isReady=function(){return!0},e.prototype.shouldDiscardImage=function(e){return!1},e}),i("Shaders/AdjustTranslucentFS",[],function(){"use strict";return"#ifdef MRT\n#extension GL_EXT_draw_buffers : enable\n#endif\nuniform vec4 u_bgColor;\nuniform sampler2D u_depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nif (texture2D(u_depthTexture, v_textureCoordinates).r < 1.0)\n{\n#ifdef MRT\ngl_FragData[0] = u_bgColor;\ngl_FragData[1] = vec4(u_bgColor.a);\n#else\ngl_FragColor = u_bgColor;\n#endif\nreturn;\n}\ndiscard;\n}\n"}),i("Shaders/CompositeOITFS",[],function(){"use strict";return"uniform sampler2D u_opaque;\nuniform sampler2D u_accumulation;\nuniform sampler2D u_revealage;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 opaque = texture2D(u_opaque, v_textureCoordinates);\nvec4 accum = texture2D(u_accumulation, v_textureCoordinates);\nfloat r = texture2D(u_revealage, v_textureCoordinates).r;\n#ifdef MRT\nvec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a);\n#else\nvec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r);\n#endif\ngl_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque;\n}\n"}),i("Scene/OIT",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/WebGLConstants","../Shaders/AdjustTranslucentFS","../Shaders/CompositeOITFS","./BlendEquation","./BlendFunction"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v){"use strict";function g(i){this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;var r=i.floatingPointTexture&&i.depthTexture;this._translucentMRTSupport=i.drawBuffers&&r,this._translucentMultipassSupport=!this._translucentMRTSupport&&r,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=void 0,this._alphaFBO=void 0,this._adjustTranslucentFBO=void 0,this._adjustAlphaFBO=void 0,this._opaqueClearCommand=new o({color:new t(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new o({color:new t(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new o({color:new t(0,0,0,0),owner:this}),this._alphaClearCommand=new o({color:new t(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._translucentShaderCache={},this._alphaShaderCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new e,this._rs=void 0}function _(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function y(e){e._translucentFBO=e._translucentFBO&&!e._translucentFBO.isDestroyed()&&e._translucentFBO.destroy(),e._alphaFBO=e._alphaFBO&&!e._alphaFBO.isDestroyed()&&e._alphaFBO.destroy(),e._adjustTranslucentFBO=e._adjustTranslucentFBO&&!e._adjustTranslucentFBO.isDestroyed()&&e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO=e._adjustAlphaFBO&&!e._adjustAlphaFBO.isDestroyed()&&e._adjustAlphaFBO.destroy()}function C(e){_(e),y(e)}function E(e,t,i,r){_(e),e._accumulationTexture=new h({context:t,width:i,height:r,pixelFormat:n.RGBA,pixelDatatype:s.FLOAT}),e._revealageTexture=new h({context:t,width:i,height:r,pixelFormat:n.RGBA,pixelDatatype:s.FLOAT})}function S(e,t){y(e);var i=d.FRAMEBUFFER_COMPLETE,r=!0;if(e._translucentMRTSupport&&(e._translucentFBO=new a({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new a({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],destroyAttachments:!1}),(e._translucentFBO.status!==i||e._adjustTranslucentFBO.status!==i)&&(y(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO=new a({context:t,colorTextures:[e._accumulationTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._alphaFBO=new a({context:t,colorTextures:[e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new a({context:t,colorTextures:[e._accumulationTexture],destroyAttachments:!1}),e._adjustAlphaFBO=new a({context:t,colorTextures:[e._revealageTexture],destroyAttachments:!1});var n=e._translucentFBO.status===i,o=e._alphaFBO.status===i,s=e._adjustTranslucentFBO.status===i,l=e._adjustAlphaFBO.status===i;n&&o&&s&&l||(C(e),e._translucentMultipassSupport=!1,r=!1)}return r}function w(e,t,r,n){var o=r[n.id];if(!i(o)){var a=l.getState(n);a.depthMask=!1,a.blending=t,o=l.fromCache(a),r[n.id]=o}return o}function T(e,t,i){return w(t,O,e._translucentRenderStateCache,i)}function x(e,t,i){return w(t,N,e._translucentRenderStateCache,i)}function b(e,t,i){return w(t,L,e._alphaRenderStateCache,i)}function A(e,t,r,n){var o=t.id,a=r[o];if(!i(a)){var s=t._attributeLocations,l=t.fragmentShaderSource.clone();l.sources=l.sources.map(function(e){return e=c.replaceMain(e,"czm_translucent_main"),e=e.replace(/gl_FragColor/g,"czm_gl_FragColor"),e=e.replace(/\bdiscard\b/g,"czm_discard = true"),e=e.replace(/czm_phong/g,"czm_translucentPhong")}),l.sources.splice(0,0,(-1!==n.indexOf("gl_FragData")?"#extension GL_EXT_draw_buffers : enable \n":"")+"vec4 czm_gl_FragColor;\nbool czm_discard = false;\n"),l.sources.push("void main()\n{\n czm_translucent_main();\n if (czm_discard)\n {\n discard;\n }\n"+n+"}\n"),a=u.fromCache({context:e,vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:l,attributeLocations:s}),r[o]=a}return a}function P(e,t,i){return A(t,i,e._translucentShaderCache,F)}function I(e,t,i){return A(t,i,e._translucentShaderCache,B)}function M(e,t,i){return A(t,i,e._alphaShaderCache,V)}function D(e,t,r,n,o){var a,s,l,u,c=t.context,h=n.framebuffer,d=o.length;n.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(c,n),n.framebuffer=e._adjustAlphaFBO,e._adjustAlphaCommand.execute(c,n);var m=e._opaqueFBO;for(n.framebuffer=e._translucentFBO,u=0;d>u;++u)a=o[u],i(a.oit)&&a.shaderProgram.id===a.oit.shaderProgramId||(a.oit={colorRenderState:x(e,c,a.renderState),alphaRenderState:b(e,c,a.renderState),colorShaderProgram:I(e,c,a.shaderProgram),alphaShaderProgram:M(e,c,a.shaderProgram),shaderProgramId:a.shaderProgram.id}),s=a.oit.colorRenderState,l=a.oit.colorShaderProgram,r(a,t,c,n,s,l,m);for(n.framebuffer=e._alphaFBO,u=0;d>u;++u)a=o[u],s=a.oit.alphaRenderState,l=a.oit.alphaShaderProgram,r(a,t,c,n,s,l,m);n.framebuffer=h}function R(e,t,r,n,o){var a=t.context,s=n.framebuffer,l=o.length;n.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(a,n);var u=e._opaqueFBO;n.framebuffer=e._translucentFBO;for(var c=0;l>c;++c){var h=o[c];i(h.oit)&&h.shaderProgram.id===h.oit.shaderProgramId||(h.oit={translucentRenderState:T(e,a,h.renderState),translucentShaderProgram:P(e,a,h.shaderProgram),shaderProgramId:h.shaderProgram.id});var d=h.oit.translucentRenderState,m=h.oit.translucentShaderProgram;r(h,t,a,n,d,m,u)}n.framebuffer=s}g.prototype.update=function(t,r){if(this.isSupported()){this._opaqueFBO=r,this._opaqueTexture=r.getColorTexture(0),this._depthStencilTexture=r.depthStencilTexture;var n=this._opaqueTexture.width,o=this._opaqueTexture.height,a=this._accumulationTexture,s=!i(a)||a.width!==n||a.height!==o;if(s&&E(this,t,n,o),i(this._translucentFBO)&&!s||S(this,t)){var u,h,d=this;i(this._compositeCommand)||(u=new c({sources:[p]}),this._translucentMRTSupport&&u.defines.push("MRT"),h={u_opaque:function(){return d._opaqueTexture},u_accumulation:function(){return d._accumulationTexture},u_revealage:function(){return d._revealageTexture}},this._compositeCommand=t.createViewportQuadCommand(u,{uniformMap:h,owner:this})),i(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(u=new c({defines:["MRT"],sources:[m]}),h={u_bgColor:function(){return d._translucentMRTClearCommand.color},u_depthTexture:function(){return d._depthStencilTexture}},this._adjustTranslucentCommand=t.createViewportQuadCommand(u,{uniformMap:h,owner:this})):this._translucentMultipassSupport&&(u=new c({sources:[m]}),h={u_bgColor:function(){return d._translucentMultipassClearCommand.color},u_depthTexture:function(){return d._depthStencilTexture}},this._adjustTranslucentCommand=t.createViewportQuadCommand(u,{uniformMap:h,owner:this}),h={u_bgColor:function(){return d._alphaClearCommand.color},u_depthTexture:function(){return d._depthStencilTexture}},this._adjustAlphaCommand=t.createViewportQuadCommand(u,{uniformMap:h,owner:this}))),this._viewport.width=n,this._viewport.height=o,i(this._rs)&&e.equals(this._viewport,this._rs.viewport)||(this._rs=l.fromCache({viewport:this._viewport})),i(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderstate=this._rs),i(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)}}};var O={enabled:!0,color:new t(0,0,0,0),equationRgb:f.ADD,equationAlpha:f.ADD,functionSourceRgb:v.ONE,functionDestinationRgb:v.ONE,functionSourceAlpha:v.ZERO,functionDestinationAlpha:v.ONE_MINUS_SOURCE_ALPHA},N={enabled:!0,color:new t(0,0,0,0),equationRgb:f.ADD,equationAlpha:f.ADD,functionSourceRgb:v.ONE,functionDestinationRgb:v.ONE,functionSourceAlpha:v.ONE,functionDestinationAlpha:v.ONE},L={enabled:!0,color:new t(0,0,0,0),equationRgb:f.ADD,equationAlpha:f.ADD,functionSourceRgb:v.ZERO,functionDestinationRgb:v.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:v.ZERO,functionDestinationAlpha:v.ONE_MINUS_SOURCE_ALPHA},F=" vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n float ai = czm_gl_FragColor.a;\n float wzi = czm_alphaWeight(ai);\n gl_FragData[0] = vec4(Ci * wzi, ai);\n gl_FragData[1] = vec4(ai * wzi);\n",B=" vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n float ai = czm_gl_FragColor.a;\n float wzi = czm_alphaWeight(ai);\n gl_FragColor = vec4(Ci, ai) * wzi;\n",V=" float ai = czm_gl_FragColor.a;\n gl_FragColor = vec4(ai);\n";return g.prototype.executeCommands=function(e,t,i,r){return this._translucentMRTSupport?void R(this,e,t,i,r):void D(this,e,t,i,r)},g.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)},g.prototype.clear=function(e,i,r){var n=i.framebuffer;i.framebuffer=this._opaqueFBO,t.clone(r,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,i),i.framebuffer=this._translucentFBO;var o=this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand;o.execute(e,i),this._translucentMultipassSupport&&(i.framebuffer=this._alphaFBO,this._alphaClearCommand.execute(e,i)),i.framebuffer=n},g.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){C(this),i(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),i(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),i(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy());var e,t=this._translucentShaderCache;for(e in t)t.hasOwnProperty(e)&&i(t[e])&&t[e].destroy();this._translucentShaderCache={},t=this._alphaShaderCache;for(e in t)t.hasOwnProperty(e)&&i(t[e])&&t[e].destroy();return this._alphaShaderCache={},r(this)},g}),i("Scene/OpenStreetMapImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/DeveloperError","../Core/Event","../Core/Rectangle","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(i){n("OpenStreetMapImageryProvider","OpenStreetMapImageryProvider is deprecated. It will be removed in Cesium 1.18. Use createOpenStreetMapImageryProvider instead."),i=t(i,{});var r=t(i.url,"//a.tile.openstreetmap.org/");m.test(r)||(r+="/"),this._url=r,this._fileExtension=t(i.fileExtension,"png"),this._proxy=i.proxy,this._tileDiscardPolicy=i.tileDiscardPolicy,this._tilingScheme=new l({ellipsoid:i.ellipsoid}),this._tileWidth=256,this._tileHeight=256,this._minimumLevel=t(i.minimumLevel,0),this._maximumLevel=i.maximumLevel,this._rectangle=t(i.rectangle,this._tilingScheme.rectangle);var c=this._tilingScheme.positionToTileXY(s.southwest(this._rectangle),this._minimumLevel),h=this._tilingScheme.positionToTileXY(s.northeast(this._rectangle),this._minimumLevel),d=(Math.abs(h.x-c.x)+1)*(Math.abs(h.y-c.y)+1);if(d>4)throw new o("The imagery provider's rectangle and minimumLevel indicate that there are "+d+" tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.");this._errorEvent=new a,this._ready=!0,this._readyPromise=u.resolve(!0);var f=t(i.credit,p);"string"==typeof f&&(f=new e(f)),this._credit=f}function d(e,t,r,n){var o=e._url+n+"/"+t+"/"+r+"."+e._fileExtension,a=e._proxy;return i(a)&&(o=a.getURL(o)),o}var m=/\/$/,p=new e("MapQuest, Open Street Map and contributors, CC-BY-SA");return r(h.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),h.prototype.getTileCredits=function(e,t,i){},h.prototype.requestImage=function(e,t,i){var r=d(this,e,t,i);return c.loadImage(this,r)},h.prototype.pickFeatures=function(){},h}),i("Scene/OrthographicFrustum",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","./CullingVolume"],function(e,t,i,r,n,o,a,s){"use strict";function l(){this.left=void 0,this._left=void 0,this.right=void 0,this._right=void 0,this.top=void 0,this._top=void 0,this.bottom=void 0,this._bottom=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far,this._cullingVolume=new s,this._orthographicMatrix=new a}function u(e){(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far)&&(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=a.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}n(l.prototype,{projectionMatrix:{get:function(){return u(this),this._orthographicMatrix}}});var c=new t,h=new t,d=new t,m=new t;return l.prototype.computeCullingVolume=function(e,n,o){var a=this._cullingVolume.planes,s=this.top,l=this.bottom,u=this.right,p=this.left,f=this.near,v=this.far,g=t.cross(n,o,c),_=h;t.multiplyByScalar(n,f,_),t.add(e,_,_);var y=d;t.multiplyByScalar(g,p,y),t.add(_,y,y);var C=a[0];return r(C)||(C=a[0]=new i),C.x=g.x,C.y=g.y,C.z=g.z,C.w=-t.dot(g,y),t.multiplyByScalar(g,u,y),t.add(_,y,y),C=a[1],r(C)||(C=a[1]=new i),C.x=-g.x,C.y=-g.y,C.z=-g.z,C.w=-t.dot(t.negate(g,m),y),t.multiplyByScalar(o,l,y),t.add(_,y,y),C=a[2],r(C)||(C=a[2]=new i),C.x=o.x,C.y=o.y,C.z=o.z,C.w=-t.dot(o,y),t.multiplyByScalar(o,s,y),t.add(_,y,y),C=a[3],r(C)||(C=a[3]=new i),C.x=-o.x,C.y=-o.y,C.z=-o.z,C.w=-t.dot(t.negate(o,m),y),C=a[4],r(C)||(C=a[4]=new i),C.x=n.x,C.y=n.y,C.z=n.z,C.w=-t.dot(n,_),t.multiplyByScalar(n,v,y),t.add(e,y,y),C=a[5],r(C)||(C=a[5]=new i),C.x=-n.x,C.y=-n.y,C.z=-n.z,C.w=-t.dot(t.negate(n,m),y),this._cullingVolume},l.prototype.getPixelDimensions=function(e,t,i,r){u(this);var n=this.right-this.left,o=this.top-this.bottom,a=n/e,s=o/t;return r.x=a,r.y=s,r},l.prototype.clone=function(e){return r(e)||(e=new l),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e},l.prototype.equals=function(e){return r(e)&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},l}),i("Widgets/getElement",["../Core/DeveloperError"],function(e){"use strict";function t(e){if("string"==typeof e){var t=document.getElementById(e);e=t}return e}return t}),i("Scene/PerformanceDisplay",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/getTimestamp","../Widgets/getElement"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT);var r=a(e.container);if(!i(r))throw new n("container is required");this._container=r;var o=document.createElement("div");o.className="cesium-performanceDisplay";var s=document.createElement("div");s.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),s.appendChild(this._fpsText);var l=document.createElement("div");l.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),l.appendChild(this._msText),o.appendChild(l),o.appendChild(s),this._container.appendChild(o),this._lastFpsSampleTime=void 0,this._frameCount=0,this._time=void 0,this._fps=0,this._frameTime=0}return s.prototype.update=function(){if(!i(this._time))return this._lastFpsSampleTime=o(),void(this._time=o());var e=this._time,t=o();this._time=t;var r=t-e;this._frameCount++;var n=this._fps,a=t-this._lastFpsSampleTime;a>1e3&&(n=1e3*this._frameCount/a|0,this._lastFpsSampleTime=t,this._frameCount=0),n!==this._fps&&(this._fpsText.nodeValue=n+" FPS",this._fps=n),r!==this._frameTime&&(this._msText.nodeValue=r.toFixed(2)+" MS",this._frameTime=r)},s.prototype.destroy=function(){return r(this)},s}),i("Scene/PickDepth",["../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/PixelFormat","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/PassThrough"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(){this.framebuffer=void 0,this._depthTexture=void 0,this._textureToCopy=void 0,this._copyDepthCommand=void 0,this._debugPickDepthViewportCommand=void 0}function c(t,i,r){if(!e(t._debugPickDepthViewportCommand)){var n="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n float z_window = czm_unpackDepth(texture2D(u_texture, v_textureCoordinates));\n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n float scale = pow(z_ndc * 0.5 + 0.5, 8.0);\n gl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n}\n";t._debugPickDepthViewportCommand=i.createViewportQuadCommand(n,{uniformMap:{u_texture:function(){return t._depthTexture}},owner:t})}t._debugPickDepthViewportCommand.execute(i,r)}function h(e){e._depthTexture=e._depthTexture&&!e._depthTexture.isDestroyed()&&e._depthTexture.destroy()}function d(e){e.framebuffer=e.framebuffer&&!e.framebuffer.isDestroyed()&&e.framebuffer.destroy()}function m(e,t,i,n){e._depthTexture=new s({context:t,width:i,height:n,pixelFormat:r.RGBA,pixelDatatype:o.UNSIGNED_BYTE})}function p(e,t,i,r){h(e),d(e),m(e,t,i,r),e.framebuffer=new n({context:t,colorTextures:[e._depthTexture],destroyAttachments:!1})}function f(t,i,r){var n=r.width,o=r.height,a=t._depthTexture,s=!e(a)||a.width!==n||a.height!==o;(!e(t.framebuffer)||s)&&p(t,i,n,o)}function v(t,i,r){if(!e(t._copyDepthCommand)){var n="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n";t._copyDepthCommand=i.createViewportQuadCommand(n,{renderState:a.fromCache(),uniformMap:{u_texture:function(){return t._textureToCopy}},owner:t})}t._textureToCopy=r,t._copyDepthCommand.framebuffer=t.framebuffer}return u.prototype.executeDebugPickDepth=function(e,t){c(this,e,t)},u.prototype.update=function(e,t){f(this,e,t),v(this,e,t)},u.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)},u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){return h(this),d(this),this._copyDepthCommand.shaderProgram=e(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy(),i(this)},u}),i("Shaders/Appearances/PointAppearanceFS",[],function(){"use strict";return"uniform vec4 highlightColor;\nvarying vec3 v_color;\nvoid main()\n{\ngl_FragColor = vec4(v_color * highlightColor.rgb, highlightColor.a);\n}\n"}),i("Shaders/Appearances/PointAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 color;\nuniform float pointSize;\nvarying vec3 v_positionEC;\nvarying vec3 v_color;\nvoid main()\n{\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * czm_computePosition();\ngl_PointSize = pointSize;\n}\n"}),i("Scene/PointAppearance",["../Core/clone","../Core/Color","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PointAppearanceFS","../Shaders/Appearances/PointAppearanceVS","./Appearance"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e){e=r(e,r.EMPTY_OBJECT),this._vertexShaderSource=r(e.vertexShaderSource,l),this._fragmentShaderSource=r(e.fragmentShaderSource,s),this._renderState=u.getDefaultRenderState(!1,!1,e.renderState),this._pointSize=r(e.pointSize,2),this._highlightColor=n(e.highlightColor)?e.highlightColor:new t,this.material=void 0,this.translucent=r(e.translucent,!1),this.uniforms={highlightColor:this._highlightColor,pointSize:this._pointSize};var o=e.uniforms;this.uniforms=i(this.uniforms,o,!0)}return o(c.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return!1}},vertexFormat:{get:function(){return c.VERTEX_FORMAT}},pixelSize:{get:function(){return this._pointSize}}}),c.VERTEX_FORMAT=a.POSITION_AND_COLOR,c.prototype.getFragmentShaderSource=u.prototype.getFragmentShaderSource,c.prototype.isTranslucent=u.prototype.isTranslucent,c.prototype.getRenderState=u.prototype.getRenderState,c}),i("Scene/PrimitiveCollection",["../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError"],function(e,t,i,r,n,o){"use strict";function a(i){i=t(i,t.EMPTY_OBJECT),this._primitives=[],this._guid=e(),this.show=t(i.show,!0),this.destroyPrimitives=t(i.destroyPrimitives,!0)}function s(e,t){return e._primitives.indexOf(t)}return r(a.prototype,{length:{get:function(){return this._primitives.length}}}),a.prototype.add=function(e){var t=e._external=e._external||{},i=t._composites=t._composites||{};return i[this._guid]={collection:this},this._primitives.push(e),e},a.prototype.remove=function(e){if(this.contains(e)){var t=this._primitives.indexOf(e);if(-1!==t)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),!0}return!1},a.prototype.removeAndDestroy=function(e){var t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t},a.prototype.removeAll=function(){if(this.destroyPrimitives)for(var e=this._primitives,t=e.length,i=0;t>i;++i)e[i].destroy();this._primitives=[]},a.prototype.contains=function(e){return!!(i(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])},a.prototype.raise=function(e){if(i(e)){var t=s(this,e),r=this._primitives;if(t!==r.length-1){var n=r[t];r[t]=r[t+1],r[t+1]=n}}},a.prototype.raiseToTop=function(e){if(i(e)){var t=s(this,e),r=this._primitives;t!==r.length-1&&(r.splice(t,1),r.push(e))}},a.prototype.lower=function(e){if(i(e)){var t=s(this,e),r=this._primitives;if(0!==t){var n=r[t];r[t]=r[t-1],r[t-1]=n}}},a.prototype.lowerToBottom=function(e){if(i(e)){var t=s(this,e),r=this._primitives;0!==t&&(r.splice(t,1),r.unshift(e))}},a.prototype.get=function(e){return this._primitives[e]},a.prototype.update=function(e){if(this.show)for(var t=this._primitives,i=0;i<t.length;++i)t[i].update(e)},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this.removeAll(),n(this)},a}),i("Scene/QuadtreeTileProvider",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function i(){t.throwInstantiationError()}return i.computeDefaultLevelZeroMaximumGeometricError=function(e){return 2*e.ellipsoid.maximumRadius*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))},e(i.prototype,{quadtree:{get:t.throwInstantiationError,set:t.throwInstantiationError},ready:{get:t.throwInstantiationError},tilingScheme:{get:t.throwInstantiationError},errorEvent:{get:t.throwInstantiationError}}),i.prototype.beginUpdate=t.throwInstantiationError,i.prototype.endUpdate=t.throwInstantiationError,i.prototype.getLevelMaximumGeometricError=t.throwInstantiationError,i.prototype.loadTile=t.throwInstantiationError,i.prototype.computeTileVisibility=t.throwInstantiationError,i.prototype.showTileThisFrame=t.throwInstantiationError,i.prototype.computeDistanceToTile=t.throwInstantiationError,i.prototype.isDestroyed=t.throwInstantiationError,i.prototype.destroy=t.throwInstantiationError,i}),i("Scene/SceneTransitioner",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/EasingFunction","../Core/Ellipsoid","../Core/Math","../Core/Matrix4","../Core/ScreenSpaceEventHandler","../Core/ScreenSpaceEventType","./Camera","./OrthographicFrustum","./PerspectiveFrustum","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(i,r){this._scene=i,r=t(r,a.WGS84);var n=r.maximumRadius,o=new e(0,0,2*n),u=new e;u=e.normalize(e.negate(o,u),u);var c=e.clone(e.UNIT_Y),p=l.multiplyByPoint(h.TRANSFORM_2D,o,new e),f=l.multiplyByPointAsVector(h.TRANSFORM_2D,u,new e),v=l.multiplyByPointAsVector(h.TRANSFORM_2D,c,new e),g=new d;g.right=n*Math.PI,g.left=-g.right,g.top=g.right*(i.drawingBufferHeight/i.drawingBufferWidth),g.bottom=-g.top, +this._camera2D={position:o,direction:u,up:c,position2D:p,direction2D:f,up2D:v,frustum:g},o=new e(0,-1,1),o=e.multiplyByScalar(e.normalize(o,o),5*n,o),u=new e,u=e.normalize(e.subtract(e.ZERO,o,u),u);var _=new e;_=e.normalize(e.cross(u,e.UNIT_Z,_),_),c=new e,c=e.normalize(e.cross(_,u,c),c),p=l.multiplyByPoint(h.TRANSFORM_2D,o,new e),f=l.multiplyByPointAsVector(h.TRANSFORM_2D,u,new e);var y=l.multiplyByPointAsVector(h.TRANSFORM_2D,_,new e);v=new e,v=e.normalize(e.cross(y,f,v),v),g=new m,g.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,g.fov=s.toRadians(60),this._cameraCV={position:o,direction:u,up:c,position2D:p,direction2D:f,up2D:v,frustum:g},o=new e,o=e.multiplyByScalar(e.normalize(new e(0,-2,1),o),2*n,o),u=new e,u=e.normalize(e.subtract(e.ZERO,o,u),u),_=new e,_=e.normalize(e.cross(u,e.UNIT_Z,_),_),c=new e,c=e.normalize(e.cross(_,u,c),c),this._camera3D={position:o,direction:u,up:c,frustum:g},this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0}function v(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new u(e._scene.canvas,!1);var i=function(){e._morphCancelled=!0,t(e)};e._completeMorph=i,e._morphHandler.setInputAction(i,c.LEFT_DOWN),e._morphHandler.setInputAction(i,c.MIDDLE_DOWN),e._morphHandler.setInputAction(i,c.RIGHT_DOWN),e._morphHandler.setInputAction(i,c.WHEEL)}}function g(e){for(var t=e._currentTweens,i=0;i<t.length;++i)t[i].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}function _(t,i,r,n){function a(t){u.position=C(c,m,t.time),u.direction=C(h,p,t.time),u.up=C(d,f,t.time),u.right=e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right)}var s=t._scene,u=s.camera;u._setTransform(l.IDENTITY);var c=u.position,h=u.direction,d=u.up,m=e.clone(t._camera2D.position),p=e.clone(t._camera2D.direction),f=e.clone(t._camera2D.up),v=s.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a});t._currentTweens.push(v),A(t,s,0,1,i,n)}function y(e,t,i,r){t*=.5;var n=e._scene.camera;n._setTransform(l.IDENTITY),T(e,t,i,function(){n.frustum=e._cameraCV.frustum.clone(),_(e,t,i,r)})}function C(t,i,r){return e.lerp(t,i,r,new e)}function E(t,i,r){function n(t){l.frustum.fov=s.lerp(c,h,t.time);var i=d/Math.tan(.5*l.frustum.fov),r=new e;l.position=e.multiplyByScalar(e.normalize(l.position,r),i,r)}var a=t._scene,l=a.camera,u=l.position,c=l.frustum.fov,h=.5*s.RADIANS_PER_DEGREE,d=e.magnitude(u)*Math.tan(.5*c);l.frustum.far=d/Math.tan(.5*h)+1e7;var m=a.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){l.frustum=t._camera2D.frustum.clone(),r(t)}});t._currentTweens.push(m)}function S(t,i,r,n){function a(t){u.position=C(h,g,t.time),u.direction=C(d,_,t.time),u.up=C(m,y,t.time),u.right=e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right)}var s=t._scene,u=s.camera;u._setTransform(l.IDENTITY);var c=r.maximumRadius,h=e.clone(u.position),d=e.clone(u.direction),m=e.clone(u.up),p=Math.tan(.5*t._cameraCV.frustum.fovy),f=t._cameraCV.frustum.aspectRatio*p,v=c*Math.PI/f,g=new e;g=e.multiplyByScalar(e.normalize(t._camera2D.position,g),v,g);var _=e.clone(t._camera2D.direction),y=e.clone(t._camera2D.up);i*=.5;var S=s.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a,complete:function(){E(t,i,n)}});t._currentTweens.push(S)}function w(t,i,r,n){function o(){E(t,i,n)}i*=.5;var a=r.maximumRadius,s=Math.tan(.5*t._camera3D.frustum.fovy),l=t._camera3D.frustum.aspectRatio*s,u=a*Math.PI/l,c={},h=new e;c.position2D=e.multiplyByScalar(e.normalize(t._camera2D.position2D,h),u,h),c.direction2D=e.clone(t._camera2D.direction2D),c.up2D=e.clone(t._camera2D.up2D),b(t,i,c,o)}function T(t,i,r,n){function a(e){u.position=C(S,p,e.time),u.frustum.top=s.lerp(f,y.top,e.time),u.frustum.bottom=s.lerp(v,y.bottom,e.time),u.frustum.right=s.lerp(g,y.right,e.time),u.frustum.left=s.lerp(_,y.left,e.time)}var l=t._scene,u=l.camera,c=r.maximumRadius,h=Math.tan(.5*t._cameraCV.frustum.fovy),d=t._cameraCV.frustum.aspectRatio*h,m=c*Math.PI/d,p=new e;p=e.multiplyByScalar(e.normalize(t._camera2D.position,p),m,p);var f=u.frustum.top,v=u.frustum.bottom,g=u.frustum.right,_=u.frustum.left,y=t._camera2D.frustum,E=t._cameraCV.frustum,S=e.clone(u.position),w=(g-_)/(2*c*Math.PI),T=1;w>T&&(w=0);var x=(T-w)*i;if(x<s.EPSILON6){if(e.equalsEpsilon(S,p,s.EPSILON6))return u.position=p,u.frustum=E.clone(),void n(t);x=i,w=0,T=1}var b=l.tweens.add({easingFunction:o.QUARTIC_OUT,duration:x,startObject:{time:w},stopObject:{time:T},update:a,complete:function(){u.frustum=E.clone(),n(t)}});t._currentTweens.push(b)}function x(t,i,r,n){function a(){function r(t){u.position=C(a,h,t.time),u.direction=C(l,d,t.time),u.up=C(c,m,t.time),u.right=e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right)}var a=e.clone(u.position),l=e.clone(u.direction),c=e.clone(u.up),h=e.clone(t._cameraCV.position),d=e.clone(t._cameraCV.direction),m=e.clone(t._cameraCV.up),p=s.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:r,complete:function(){n(t)}});t._currentTweens.push(p)}var s=t._scene,u=s.camera;u._setTransform(l.IDENTITY),i*=.5,T(t,i,r,a)}function b(t,i,r,n){function a(t){u.position=C(c,m,t.time),u.direction=C(h,p,t.time),u.up=C(d,f,t.time),u.right=e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right)}var s=t._scene,u=s.camera;u._setTransform(l.IDENTITY);var c=e.clone(u.position),h=e.clone(u.direction),d=e.clone(u.up),m=e.clone(r.position2D),p=e.clone(r.direction2D),f=e.clone(r.up2D),v=s.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a,complete:function(){u.position=m,u.direction=p,u.up=f,u.right=e.cross(p,f,u.right),e.normalize(u.right,u.right)}});t._currentTweens.push(v),A(t,s,1,0,i,n)}function A(e,t,r,n,a,s){var l={object:t,property:"morphTime",startValue:r,stopValue:n,duration:a,easingFunction:o.QUARTIC_OUT};i(s)&&(l.complete=function(){s(e)});var u=t.tweens.addProperty(l);e._currentTweens.push(u)}function P(e){var t=e._scene,i=t.drawingBufferHeight/t.drawingBufferWidth,r=e._camera2D.frustum;r.top=r.right*i,r.bottom=-r.top,i=1/i,r=e._cameraCV.frustum,r.aspectRatio=i,r=e._camera3D.frustum,r.aspectRatio=i;var n=t.camera;switch(t.mode){case p.SCENE3D:n.frustum=e._camera3D.frustum.clone();break;case p.COLUMBUS_VIEW:n.frustum=e._cameraCV.frustum.clone();break;case p.SCENE2D:n.frustum=e._camera2D.frustum.clone()}}function I(t){var r=t._scene;if(r._mode=p.SCENE3D,r.morphTime=p.getMorphTime(p.SCENE3D),g(t),P(t),t._previousMode!==p.MORPHING||t._morphCancelled){t._morphCancelled=!1;var n=r.camera;n.position=e.clone(t._camera3D.position),n.direction=e.clone(t._camera3D.direction),n.up=e.clone(t._camera3D.up),n.right=e.cross(n.direction,n.up,n.right),e.normalize(n.right,n.right)}var o=i(t._completeMorph);t._completeMorph=void 0,r.camera.update(r.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,p.SCENE3D,o)}function M(t){var r=t._scene;r._mode=p.SCENE2D,r.morphTime=p.getMorphTime(p.SCENE2D),g(t),P(t);var n=r.camera;e.clone(t._camera2D.position,n.position),e.clone(t._camera2D.direction,n.direction),e.clone(t._camera2D.up,n.up),e.cross(n.direction,n.up,n.right),e.normalize(n.right,n.right);var o=i(t._completeMorph);t._completeMorph=void 0,r.camera.update(r.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,p.SCENE2D,o)}function D(t){var r=t._scene;if(r._mode=p.COLUMBUS_VIEW,r.morphTime=p.getMorphTime(p.COLUMBUS_VIEW),g(t),P(t),t._previousModeMode!==p.MORPHING||t._morphCancelled){t._morphCancelled=!1;var n=r.camera;e.clone(t._cameraCV.position,n.position),e.clone(t._cameraCV.direction,n.direction),e.clone(t._cameraCV.up,n.up),e.cross(n.direction,n.up,n.right),e.normalize(n.right,n.right)}var o=i(t._completeMorph);t._completeMorph=void 0,r.camera.update(r.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,p.COLUMBUS_VIEW,o)}return f.prototype.completeMorph=function(){i(this._completeMorph)&&this._completeMorph()},f.prototype.morphTo2D=function(e,t){i(this._completeMorph)&&this._completeMorph();var r=this._scene;this._previousMode=r.mode,this._previousMode!==p.SCENE2D&&this._previousMode!==p.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,p.SCENE2D,!0),P(this),r._mode=p.MORPHING,v(this,M),this._previousMode===p.COLUMBUS_VIEW?S(this,e,t,M):w(this,e,t,M),0===e&&i(this._completeMorph)&&this._completeMorph())},f.prototype.morphToColumbusView=function(e,t){i(this._completeMorph)&&this._completeMorph();var r=this._scene;this._previousMode=r.mode,this._previousMode!==p.COLUMBUS_VIEW&&this._previousMode!==p.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,p.COLUMBUS_VIEW,!0),P(this),r._mode=p.MORPHING,v(this,D),this._previousMode===p.SCENE2D?x(this,e,t,D):b(this,e,this._cameraCV,D),0===e&&i(this._completeMorph)&&this._completeMorph())},f.prototype.morphTo3D=function(e,t){i(this._completeMorph)&&this._completeMorph();var r=this._scene;this._previousMode=r.mode,this._previousMode!==p.SCENE3D&&this._previousMode!==p.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,p.SCENE3D,!0),P(this),r._mode=p.MORPHING,v(this,I),this._previousMode===p.SCENE2D?y(this,e,t,I):_(this,e,t,I),0===e&&i(this._completeMorph)&&this._completeMorph())},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return g(this),r(this)},f}),i("Scene/TweenCollection",["../Core/clone","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/EasingFunction","../Core/getTimestamp","../Core/TimeConstants","../ThirdParty/Tween"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,i,r,n,o,a,s,l,u,c){this._tweens=t,this._tweenjs=i,this._startObject=e(r),this._stopObject=e(n),this._duration=o,this._delay=a,this._easingFunction=s,this._update=l,this._complete=u,this.cancel=c,this.needsStart=!0}function c(){this._tweens=[]}return r(u.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}}),u.prototype.cancelTween=function(){this._tweens.remove(this)},r(c.prototype,{length:{get:function(){return this._tweens.length}}}),c.prototype.add=function(r){if(r=t(r,t.EMPTY_OBJECT),0===r.duration)return i(r.complete)&&r.complete(),new u(this);var n=r.duration/s.SECONDS_PER_MILLISECOND,a=t(r.delay,0),c=a/s.SECONDS_PER_MILLISECOND,h=t(r.easingFunction,o.LINEAR_NONE),d=r.startObject,m=new l.Tween(d);m.to(e(r.stopObject),n),m.delay(c),m.easing(h),i(r.update)&&m.onUpdate(function(){r.update(d)}),m.onComplete(t(r.complete,null)),m.repeat(t(r._repeat,0));var p=new u(this,m,r.startObject,r.stopObject,r.duration,a,h,r.update,r.complete,r.cancel);return this._tweens.push(p),p},c.prototype.addProperty=function(e){function i(e){r[n]=e.value}e=t(e,t.EMPTY_OBJECT);var r=e.object,n=e.property,o=e.startValue,a=e.stopValue;return this.add({startObject:{value:o},stopObject:{value:a},duration:t(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})},c.prototype.addAlpha=function(e){function r(e){for(var t=o.length,i=0;t>i;++i)n.uniforms[o[i]].alpha=e.alpha}e=t(e,t.EMPTY_OBJECT);var n=e.material,o=[];for(var a in n.uniforms)n.uniforms.hasOwnProperty(a)&&i(n.uniforms[a])&&i(n.uniforms[a].alpha)&&o.push(a);return this.add({startObject:{alpha:t(e.startValue,0)},stopObject:{alpha:t(e.stopValue,1)},duration:t(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel})},c.prototype.addOffsetIncrement=function(e){e=t(e,t.EMPTY_OBJECT);var i=e.material,r=i.uniforms;return this.addProperty({object:r,property:"offset",startValue:r.offset,stopValue:r.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})},c.prototype.remove=function(e){if(!i(e))return!1;var t=this._tweens.indexOf(e);return-1!==t?(e.tweenjs.stop(),i(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1},c.prototype.removeAll=function(){for(var e=this._tweens,t=0;t<e.length;++t){var r=e[t];r.tweenjs.stop(),i(r.cancel)&&r.cancel()}e.length=0},c.prototype.contains=function(e){return i(e)&&-1!==this._tweens.indexOf(e)},c.prototype.get=function(e){return this._tweens[e]},c.prototype.update=function(e){var t=this._tweens,r=0;for(e=i(e)?e/s.SECONDS_PER_MILLISECOND:a();r<t.length;){var n=t[r],o=n.tweenjs;n.needsStart?(n.needsStart=!1,o.start(e)):o.update(e)?r++:(o.stop(),t.splice(r,1))}},c}),i("Scene/ScreenSpaceCameraController",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/IntersectionTests","../Core/isArray","../Core/KeyboardEventModifier","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Plane","../Core/Quaternion","../Core/Ray","../Core/Transforms","./CameraEventAggregator","./CameraEventType","./SceneMode","./SceneTransforms","./TweenCollection"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S,w){"use strict";function T(i){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.translateEventTypes=C.LEFT_DRAG,this.zoomEventTypes=[C.RIGHT_DRAG,C.WHEEL,C.PINCH],this.rotateEventTypes=C.LEFT_DRAG,this.tiltEventTypes=[C.MIDDLE_DRAG,C.PINCH,{eventType:C.LEFT_DRAG,modifier:h.CTRL},{eventType:C.RIGHT_DRAG,modifier:h.CTRL}],this.lookEventTypes={eventType:C.LEFT_DRAG,modifier:h.SHIFT},this.minimumPickingTerrainHeight=15e4,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumCollisionTerrainHeight=15e3,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=75e5,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this._scene=i,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new y(i.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._tweens=new w,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new e(-1,-1),this._tiltCenter=new t,this._rotateMousePosition=new e(-1,-1),this._rotateStartPosition=new t,this._strafeStartPosition=new t,this._zoomMouseStart=new e,this._zoomWorldPosition=new t,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._rotatingZoom=!1;var n=i.mapProjection;this._maxCoord=n.project(new r(Math.PI,d.PI_OVER_TWO)),this._zoomFactor=5,this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=2e-4,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3}function x(e,t){if(0>e)return 0;var i=25*(1-t);return Math.exp(-i*e)}function b(t){return e.equalsEpsilon(t.startPosition,t.endPosition,d.EPSILON14)}function A(t,i,r,n,a,s,l){var u=s[l];o(u)||(u=s[l]={startPosition:new e,endPosition:new e,motion:new e,active:!1});var c=t.getButtonPressTime(i,r),h=t.getButtonReleaseTime(i,r),d=c&&h&&(h.getTime()-c.getTime())/1e3,m=new Date,p=h&&(m.getTime()-h.getTime())/1e3;if(c&&h&&$>d){var f=x(p,n);if(u.active)u.startPosition=e.clone(u.endPosition,u.startPosition),u.endPosition=e.multiplyByScalar(u.motion,f,u.endPosition),u.endPosition=e.add(u.startPosition,u.endPosition,u.endPosition),u.motion=e.clone(e.ZERO,u.motion);else{var v=t.getLastMovement(i,r);if(!o(v)||b(v))return;u.motion.x=.5*(v.endPosition.x-v.startPosition.x),u.motion.y=.5*(v.endPosition.y-v.startPosition.y),u.startPosition=e.clone(v.startPosition,u.startPosition),u.endPosition=e.multiplyByScalar(u.motion,f,u.endPosition),u.endPosition=e.add(u.startPosition,u.endPosition,u.endPosition),u.active=!0}if(isNaN(u.endPosition.x)||isNaN(u.endPosition.y)||e.distance(u.startPosition,u.endPosition)<.5)return void(u.active=!1);if(!t.isButtonDown(i,r)){var g=t.getStartMousePosition(i,r);a(s,g,u)}}else u.active=!1}function P(e,t,i,r,n,a){if(o(i)){var s=e._aggregator;c(i)||(ee[0]=i,i=ee);for(var l=i.length,u=0;l>u;++u){var h=i[u],d=o(h.eventType)?h.eventType:h,m=h.modifier,p=s.isMoving(d,m)&&s.getMovement(d,m),f=s.getStartMousePosition(d,m);e.enableInputs&&t&&(p?r(e,f,p):1>n&&A(s,d,m,n,r,e,a))}}}function I(i,r,n,a,s,l){var u=1;o(l)&&(u=d.clamp(Math.abs(l),.25,1));var c=i.minimumZoomDistance*u,h=i.maximumZoomDistance,m=s-c,p=a*m;p=d.clamp(p,i._minimumZoomRate,i._maximumZoomRate);var f=n.endPosition.y-n.startPosition.y,v=f/i._scene.canvas.clientHeight;v=Math.min(v,i.maximumMovementRatio);var g=p*v;if(!(g>0&&Math.abs(s-c)<1||0>g&&Math.abs(s-h)<1)){c>s-g?g=s-c-1:s-g>h&&(g=s-h);var _,y=i._scene,C=y.camera,w=y.mode;if(o(i._globe)&&(_=w!==E.SCENE2D?L(i,r,ie):C.getPickRay(r,te).origin),!o(_))return void C.zoomIn(g);var T=e.equals(r,i._zoomMouseStart),x=i._zoomingOnVector,b=i._rotatingZoom;T||(i._zoomMouseStart=e.clone(r,i._zoomMouseStart),i._zoomWorldPosition=t.clone(_,i._zoomWorldPosition),x=i._zoomingOnVector=!1,b=i._rotatingZoom=!1);var A=w===E.COLUMBUS_VIEW;if(!T||b){if(w===E.SCENE2D){var P=i._zoomWorldPosition,I=C.position;if(!t.equals(P,I)){var M=t.subtract(P,I,ne);t.normalize(M,M);var D=t.distance(P,I)*g/(.5*C.getMagnitude());C.move(M,.5*D)}}else if(w===E.SCENE3D){var R=t.normalize(C.position,ce);if(C.positionCartographic.height<3e3&&Math.abs(t.dot(C.direction,R))<.6)A=!0;else{var O=y.canvas,N=oe;N.x=O.clientWidth/2,N.y=O.clientHeight/2;var F=L(i,N,ae);if(o(F)){var B=t.normalize(F,se),V=t.normalize(i._zoomWorldPosition,le),k=t.dot(V,B);if(k>0){var z=d.acosClamped(k),U=t.cross(V,B,ue),G=Math.abs(z)>d.toRadians(20)?.75*C.positionCartographic.height:C.positionCartographic.height-g,W=g/G;C.rotate(U,z*W)}}else A=!0}}i._rotatingZoom=!A}if(!T&&A||x){var H,q=S.wgs84ToWindowCoordinates(y,i._zoomWorldPosition,re);H=w!==E.COLUMBUS_VIEW&&e.equals(r,i._zoomMouseStart)&&o(q)?C.getPickRay(q,te):C.getPickRay(r,te);var j=H.direction;w===E.COLUMBUS_VIEW&&t.fromElements(j.y,j.z,j.x,j),C.move(j,g),i._zoomingOnVector=!0}else C.zoomIn(g)}}function M(e,i,r){var n=e._scene,o=n.camera,a=o.getPickRay(r.startPosition,he).origin,s=o.getPickRay(r.endPosition,de).origin,l=t.subtract(a,s,me),u=t.magnitude(l);u>0&&(t.normalize(l,l),o.move(l,u))}function D(e,t,i){o(i.distance)&&(i=i.distance);var r=e._scene,n=r.camera;I(e,t,i,e._zoomFactor,n.getMagnitude())}function R(t,i,r){if(o(r.angleAndHeight))return void O(t,i,r.angleAndHeight);var n=t._scene,a=n.camera,s=n.canvas,l=s.clientWidth,u=s.clientHeight,c=pe;c.x=2/l*r.startPosition.x-1,c.y=2/u*(u-r.startPosition.y)-1,c=e.normalize(c,c);var h=fe;h.x=2/l*r.endPosition.x-1,h.y=2/u*(u-r.endPosition.y)-1,h=e.normalize(h,h);var m=d.acosClamped(c.x);c.y<0&&(m=d.TWO_PI-m);var p=d.acosClamped(h.x);h.y<0&&(p=d.TWO_PI-p);var f=p-m;a.twistRight(f)}function O(e,t,i){var r=e._rotateFactor*e._rotateRateRangeAdjustment;r>e._maximumRotateRate&&(r=e._maximumRotateRate),r<e._minimumRotateRate&&(r=e._minimumRotateRate);var n=e._scene,o=n.camera,a=n.canvas,s=(i.endPosition.x-i.startPosition.x)/a.clientWidth;s=Math.min(s,e.maximumMovementRatio);var l=r*s*Math.PI*4;o.twistRight(l)}function N(e){var t=e._tweens;e._aggregator.anyButtonDown&&t.removeAll();var i=e._scene,r=i.camera;if(t.contains(e._tween)||(p.equals(p.IDENTITY,r.transform)?(P(e,e.enableTranslate,e.translateEventTypes,M,e.inertiaTranslate,"_lastInertiaTranslateMovement"),P(e,e.enableZoom,e.zoomEventTypes,D,e.inertiaZoom,"_lastInertiaZoomMovement"),P(e,e.enableRotate,e.tiltEventTypes,R,e.inertiaSpin,"_lastInertiaTiltMovement")):(P(e,e.enableRotate,e.translateEventTypes,R,e.inertiaSpin,"_lastInertiaSpinMovement"),P(e,e.enableZoom,e.zoomEventTypes,D,e.inertiaZoom,"_lastInertiaZoomMovement"))),!(e._aggregator.anyButtonDown||o(e._lastInertiaZoomMovement)&&e._lastInertiaZoomMovement.active||o(e._lastInertiaTranslateMovement)&&e._lastInertiaTranslateMovement.active||t.contains(e._tween))){var n=r.createCorrectPositionTween(e.bounceAnimationTime);o(n)&&(e._tween=t.add(n))}t.update()}function L(e,i,r){var n=e._scene,a=e._globe,s=n.camera;if(o(a)){var l;n.pickPositionSupported&&(l=n.pickPosition(i,ge));var u=s.getPickRay(i,ve),c=a.pick(u,n,_e),h=o(l)?t.distance(l,s.positionWC):Number.POSITIVE_INFINITY,d=o(c)?t.distance(c,s.positionWC):Number.POSITIVE_INFINITY;return d>h?t.clone(l,r):t.clone(c,r)}}function F(i,r,n){if(t.equals(r,i._translateMousePosition)||(i._looking=!1),t.equals(r,i._strafeMousePosition)||(i._strafing=!1),i._looking)return void K(i,r,n);if(i._strafing)return void G(i,r,n);var a,s=i._scene,l=s.camera,c=e.clone(n.startPosition,be),h=e.clone(n.endPosition,Ae),m=l.getPickRay(c,ye),p=t.clone(t.ZERO,Te),v=t.UNIT_X;if(l.position.z<i._minimumPickingTerrainHeight&&(a=L(i,c,Ee),o(a)&&(p.x=a.x)),p.x>l.position.z&&o(a))return t.clone(a,i._strafeStartPosition),i._strafing=!0,G(i,r,n),void(i._strafeMousePosition=e.clone(r,i._strafeMousePosition));var g=f.fromPointNormal(p,v,xe);m=l.getPickRay(c,ye);var _=u.rayPlane(m,g,Ee),y=l.getPickRay(h,Ce),C=u.rayPlane(y,g,Se);if(!o(_)||!o(C))return i._looking=!0,K(i,r,n),void e.clone(r,i._translateMousePosition);var E=t.subtract(_,C,we),S=E.x;E.x=E.y,E.y=E.z,E.z=S;var w=t.magnitude(E);w>d.EPSILON6&&(t.normalize(E,E),l.move(E,w))}function B(t,i,r){if(o(r.angleAndHeight)&&(r=r.angleAndHeight),e.equals(i,t._tiltCenterMousePosition)||(t._tiltCVOffMap=!1,t._looking=!1),t._looking)return void K(t,i,r);var n=t._scene,a=n.camera,s=t._maxCoord,l=Math.abs(a.position.x)-s.x<0&&Math.abs(a.position.y)-s.y<0;t._tiltCVOffMap||!l||a.position.z>t._minimumPickingTerrainHeight?(t._tiltCVOffMap=!0,V(t,i,r)):k(t,i,r)}function V(i,r,n){var a=i._scene,s=a.camera,u=a.canvas,c=Pe;c.x=u.clientWidth/2,c.y=u.clientHeight/2;var h,m=s.getPickRay(c,Ie),f=t.UNIT_X,v=m.origin,g=m.direction,y=t.dot(f,g);if(Math.abs(y)>d.EPSILON6&&(h=-t.dot(f,v)/y),!o(h)||0>=h)return i._looking=!0,K(i,r,n),void e.clone(r,i._tiltCenterMousePosition);var C=t.multiplyByScalar(g,h,Me);t.add(v,C,C);var E=a.mapProjection,S=E.ellipsoid;t.fromElements(C.y,C.z,C.x,C);var w=E.unproject(C,Be);S.cartographicToCartesian(w,C);var T=_.eastNorthUpToFixedFrame(C,S,Re),x=i._globe,b=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var A=p.clone(s.transform,Ve);s._setTransform(T),H(i,r,n,t.UNIT_Z),s._setTransform(A),i._globe=x,i._ellipsoid=b;var P=b.maximumRadius;i._rotateFactor=1/P,i._rotateRateRangeAdjustment=P}function k(i,r,n){var a,s,c=i._ellipsoid,h=i._scene,g=h.camera,y=t.UNIT_X;if(e.equals(r,i._tiltCenterMousePosition))a=t.clone(i._tiltCenter,Me);else{if(g.position.z<i._minimumPickingTerrainHeight&&(a=L(i,r,Me)),!o(a)){s=g.getPickRay(r,Ie);var C,E=s.origin,S=s.direction,w=t.dot(y,S);if(Math.abs(w)>d.EPSILON6&&(C=-t.dot(y,E)/w),!o(C)||0>=C)return i._looking=!0,K(i,r,n),void e.clone(r,i._tiltCenterMousePosition);a=t.multiplyByScalar(S,C,Me),t.add(E,a,a)}e.clone(r,i._tiltCenterMousePosition),t.clone(a,i._tiltCenter)}var T=h.canvas,x=Pe;x.x=T.clientWidth/2,x.y=i._tiltCenterMousePosition.y,s=g.getPickRay(x,Ie);var b=t.clone(t.ZERO,Ne);b.x=a.x;var A=f.fromPointNormal(b,y,Le),P=u.rayPlane(s,A,De),I=g._projection;c=I.ellipsoid,t.fromElements(a.y,a.z,a.x,a);var M=I.unproject(a,Be);c.cartographicToCartesian(M,a);var D,R=_.eastNorthUpToFixedFrame(a,c,Re);o(P)?(t.fromElements(P.y,P.z,P.x,P),M=I.unproject(P,Be),c.cartographicToCartesian(M,P),D=_.eastNorthUpToFixedFrame(P,c,Oe)):D=R;var O=i._globe,N=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var F=t.UNIT_Z,B=p.clone(g.transform,Ve);g._setTransform(R);var V=t.cross(t.UNIT_Z,t.normalize(g.position,Fe),Fe),k=t.dot(g.right,V);if(H(i,r,n,F,!1,!0),g._setTransform(D),0>k){n.startPosition.y>n.endPosition.y&&(F=void 0);var z=g.constrainedAxis;g.constrainedAxis=void 0,H(i,r,n,F,!0,!1),g.constrainedAxis=z}else H(i,r,n,F,!0,!1);if(o(g.constrainedAxis)){var U=t.cross(g.direction,g.constrainedAxis,vt);t.equalsEpsilon(U,t.ZERO,d.EPSILON6)||(t.dot(U,g.right)<0&&t.negate(U,U),t.cross(U,g.direction,g.up),t.cross(g.direction,g.up,g.right),t.normalize(g.up,g.up),t.normalize(g.right,g.right))}g._setTransform(B),i._globe=O,i._ellipsoid=N;var G=N.maximumRadius;i._rotateFactor=1/G,i._rotateRateRangeAdjustment=G;var W=t.clone(g.positionWC,Fe);if(J(i),!t.equals(g.positionWC,W)){g._setTransform(D),g.worldToCameraCoordinatesPoint(W,W);var q=t.magnitudeSquared(W);t.magnitudeSquared(g.position)>q&&(t.normalize(g.position,g.position),t.multiplyByScalar(g.position,Math.sqrt(q),g.position));var j=t.angleBetween(W,g.position),Y=t.cross(W,g.position,W);t.normalize(Y,Y);var X=v.fromAxisAngle(Y,j,ke),Z=m.fromQuaternion(X,ze);m.multiplyByVector(Z,g.direction,g.direction),m.multiplyByVector(Z,g.up,g.up),t.cross(g.direction,g.up,g.right),t.cross(g.right,g.direction,g.up),g._setTransform(B)}}function z(e,i,r){o(r.distance)&&(r=r.distance);var n=e._scene,a=n.camera,s=n.canvas,l=Ue;l.x=s.clientWidth/2,l.y=s.clientHeight/2;var u,c=a.getPickRay(l,Ge);a.position.z<e._minimumPickingTerrainHeight&&(u=L(e,l,We));var h;if(o(u))h=t.distance(c.origin,u);else{var d=t.UNIT_X,m=c.origin,p=c.direction;h=-t.dot(d,m)/t.dot(d,p)}I(e,i,r,e._zoomFactor,h)}function U(e){var t=e._scene,i=t.camera;if(p.equals(p.IDENTITY,i.transform)){var r=e._tweens;if(e._aggregator.anyButtonDown&&r.removeAll(),P(e,e.enableTilt,e.tiltEventTypes,B,e.inertiaSpin,"_lastInertiaTiltMovement"),P(e,e.enableTranslate,e.translateEventTypes,F,e.inertiaTranslate,"_lastInertiaTranslateMovement"),P(e,e.enableZoom,e.zoomEventTypes,z,e.inertiaZoom,"_lastInertiaZoomMovement"),P(e,e.enableLook,e.lookEventTypes,K),!(e._aggregator.anyButtonDown||o(e._lastInertiaZoomMovement)&&e._lastInertiaZoomMovement.active||o(e._lastInertiaTranslateMovement)&&e._lastInertiaTranslateMovement.active||r.contains(e._tween))){var n=i.createCorrectPositionTween(e.bounceAnimationTime);o(n)&&(e._tween=r.add(n))}r.update()}else P(e,e.enableRotate,e.rotateEventTypes,H,e.inertiaSpin,"_lastInertiaSpinMovement"),P(e,e.enableZoom,e.zoomEventTypes,j,e.inertiaZoom,"_lastInertiaZoomMovement")}function G(e,i,r){var n=e._scene,a=n.camera,s=L(e,r.startPosition,Ke);if(o(s)){var l=r.endPosition,c=a.getPickRay(l,He),h=t.clone(a.direction,Ye);n.mode===E.COLUMBUS_VIEW&&t.fromElements(h.z,h.x,h.y,h);var d=f.fromPointNormal(s,h,qe),m=u.rayPlane(c,d,je);o(m)&&(h=t.subtract(s,m,h),n.mode===E.COLUMBUS_VIEW&&t.fromElements(h.y,h.z,h.x,h),t.add(a.position,h,a.position))}}function W(i,r,n){var a=i._scene,s=a.camera;if(!p.equals(s.transform,p.IDENTITY))return void H(i,r,n);var u,c,h,d,m=i._ellipsoid.geodeticSurfaceNormal(s.position,$e),f=i._ellipsoid.cartesianToCartographic(s.positionWC,Ze).height,v=i._globe,g=!1;if(o(v)&&f<i._minimumPickingTerrainHeight&&(d=L(i,n.startPosition,Ke),o(d))){var _=s.getPickRay(n.startPosition,ve),y=i._ellipsoid.geodeticSurfaceNormal(d);g=Math.abs(t.dot(_.direction,y))<.05,g&&!i._looking&&(i._rotating=!1,i._strafing=!0)}return e.equals(r,i._rotateMousePosition)?void(i._looking?K(i,r,n,m):i._rotating?H(i,r,n):i._strafing?(t.clone(d,i._strafeStartPosition),G(i,r,n)):(u=t.magnitude(i._rotateStartPosition),c=Qe,c.x=c.y=c.z=u,h=l.fromCartesian3(c,Je),q(i,r,n,h))):(i._looking=!1,i._rotating=!1,i._strafing=!1,o(v)&&f<i._minimumPickingTerrainHeight?o(d)?t.magnitude(s.position)<t.magnitude(d)?(t.clone(d,i._strafeStartPosition),i._strafing=!0,G(i,r,n)):(u=t.magnitude(d),c=Qe,c.x=c.y=c.z=u,h=l.fromCartesian3(c,Je),q(i,r,n,h),t.clone(d,i._rotateStartPosition)):(i._looking=!0,K(i,r,n,m)):o(s.pickEllipsoid(n.startPosition,i._ellipsoid,Xe))?(q(i,r,n,i._ellipsoid),t.clone(Xe,i._rotateStartPosition)):f>i._minimumTrackBallHeight?(i._rotating=!0,H(i,r,n)):(i._looking=!0,K(i,r,n,m)),void e.clone(r,i._rotateMousePosition))}function H(e,i,r,a,s,l){s=n(s,!1),l=n(l,!1);var u=e._scene,c=u.camera,h=u.canvas,d=c.constrainedAxis;o(a)&&(c.constrainedAxis=a);var m=t.magnitude(c.position),p=e._rotateFactor*(m-e._rotateRateRangeAdjustment);p>e._maximumRotateRate&&(p=e._maximumRotateRate),p<e._minimumRotateRate&&(p=e._minimumRotateRate);var f=(r.startPosition.x-r.endPosition.x)/h.clientWidth,v=(r.startPosition.y-r.endPosition.y)/h.clientHeight;f=Math.min(f,e.maximumMovementRatio),v=Math.min(v,e.maximumMovementRatio);var g=p*f*Math.PI*2,_=p*v*Math.PI;s||c.rotateRight(g),l||c.rotateUp(_),c.constrainedAxis=d}function q(i,r,n,a){var s=i._scene,l=s.camera,u=e.clone(n.startPosition,at),c=e.clone(n.endPosition,st),h=l.pickEllipsoid(u,a,et),m=l.pickEllipsoid(c,a,tt);if(!o(h)||!o(m))return i._rotating=!0,void H(i,r,n);if(h=l.worldToCameraCoordinates(h,h),m=l.worldToCameraCoordinates(m,m),o(l.constrainedAxis)){var p=l.constrainedAxis,f=t.mostOrthogonalAxis(p,it);t.cross(f,p,f),t.normalize(f,f);var v=t.cross(p,f,rt),g=t.magnitude(h),_=t.dot(p,h),y=Math.acos(_/g),C=t.multiplyByScalar(p,_,nt);t.subtract(h,C,C),t.normalize(C,C);var E=t.magnitude(m),S=t.dot(p,m),w=Math.acos(S/E),T=t.multiplyByScalar(p,S,ot);t.subtract(m,T,T),t.normalize(T,T);var x=Math.acos(t.dot(C,f));t.dot(C,v)<0&&(x=d.TWO_PI-x);var b=Math.acos(t.dot(T,f));t.dot(T,v)<0&&(b=d.TWO_PI-b);var A,P=x-b;A=t.equalsEpsilon(p,l.position,d.EPSILON2)?l.right:t.cross(p,l.position,it);var I,M=t.cross(p,A,it),D=t.dot(M,t.subtract(h,p,rt)),R=t.dot(M,t.subtract(m,p,rt));I=D>0&&R>0?w-y:D>0&&0>=R?t.dot(l.position,p)>0?-y-w:y+w:y-w,l.rotateRight(P),l.rotateUp(I)}else{t.normalize(h,h),t.normalize(m,m);var O=t.dot(h,m),N=t.cross(h,m,it);if(1>O&&!t.equalsEpsilon(N,t.ZERO,d.EPSILON14)){var L=Math.acos(O);l.rotate(N,L)}}}function j(e,i,r){o(r.distance)&&(r=r.distance);var n=e._ellipsoid,a=e._scene,s=a.camera,l=a.canvas,u=Ue;u.x=l.clientWidth/2,u.y=l.clientHeight/2;var c,h=s.getPickRay(u,Ge),d=n.cartesianToCartographic(s.position,ut).height;d<e._minimumPickingTerrainHeight&&(c=L(e,u,We));var m;m=o(c)?t.distance(h.origin,c):d;var p=t.normalize(s.position,lt);I(e,i,r,e._zoomFactor,m,t.dot(p,s.direction))}function Y(t,i,r){var n=t._scene,a=n.camera;if(p.equals(a.transform,p.IDENTITY)){if(o(r.angleAndHeight)&&(r=r.angleAndHeight),e.equals(i,t._tiltCenterMousePosition)||(t._tiltOnEllipsoid=!1,t._looking=!1),t._looking){var s=t._ellipsoid.geodeticSurfaceNormal(a.position,Et);return void K(t,i,r,s)}var l=t._ellipsoid,u=l.cartesianToCartographic(a.position,Ct);t._tiltOnEllipsoid||u.height>t._minimumCollisionTerrainHeight?(t._tiltOnEllipsoid=!0,X(t,i,r)):Z(t,i,r)}}function X(i,r,n){var a=i._ellipsoid,s=i._scene,c=s.camera,h=.25*i.minimumZoomDistance,m=a.cartesianToCartographic(c.positionWC,St).height;if(!(m-h-1<d.EPSILON3&&n.endPosition.y-n.startPosition.y<0)){var f=s.canvas,v=ct;v.x=f.clientWidth/2,v.y=f.clientHeight/2;var y,C=c.getPickRay(v,ht),E=u.rayEllipsoid(C,a);if(o(E))y=g.getPoint(C,E.start,dt);else{if(!(m>i._minimumTrackBallHeight)){i._looking=!0;var S=i._ellipsoid.geodeticSurfaceNormal(c.position,Et);return K(i,r,n,S),void e.clone(r,i._tiltCenterMousePosition)}var w=u.grazingAltitudeLocation(C,a);if(!o(w))return;var T=a.cartesianToCartographic(w,Ct);T.height=0,y=a.cartographicToCartesian(T,dt)}var x=_.eastNorthUpToFixedFrame(y,a,pt),b=i._globe,A=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var P=p.clone(c.transform,gt);c._setTransform(x),H(i,r,n,t.UNIT_Z),c._setTransform(P),i._globe=b,i._ellipsoid=A;var I=A.maximumRadius;i._rotateFactor=1/I,i._rotateRateRangeAdjustment=I}}function Z(i,r,n){var a,s,c,h=i._ellipsoid,f=i._scene,y=f.camera;if(e.equals(r,i._tiltCenterMousePosition))a=t.clone(i._tiltCenter,dt);else{ +if(a=L(i,r,dt),!o(a)){if(s=y.getPickRay(r,ht),c=u.rayEllipsoid(s,h),!o(c)){var C=h.cartesianToCartographic(y.position,Ct);if(C.height<=i._minimumTrackBallHeight){i._looking=!0;var E=i._ellipsoid.geodeticSurfaceNormal(y.position,Et);K(i,r,n,E),e.clone(r,i._tiltCenterMousePosition)}return}a=g.getPoint(s,c.start,dt)}e.clone(r,i._tiltCenterMousePosition),t.clone(a,i._tiltCenter)}var S=f.canvas,w=ct;w.x=S.clientWidth/2,w.y=i._tiltCenterMousePosition.y,s=y.getPickRay(w,ht);var T=t.magnitude(a),x=t.fromElements(T,T,T,Qe),b=l.fromCartesian3(x,Je);if(c=u.rayEllipsoid(s,b),o(c)){var A=t.magnitude(s.origin)>T?c.start:c.stop,P=g.getPoint(s,A,mt),I=_.eastNorthUpToFixedFrame(a,h,pt),M=_.eastNorthUpToFixedFrame(P,b,ft),D=i._globe,R=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var O=t.UNIT_Z,N=p.clone(y.transform,gt);y._setTransform(I);var F=t.cross(P,y.positionWC,vt),B=t.dot(y.rightWC,F);if(H(i,r,n,O,!1,!0),y._setTransform(M),0>B){n.startPosition.y>n.endPosition.y&&(O=void 0);var V=y.constrainedAxis;y.constrainedAxis=void 0,H(i,r,n,O,!0,!1),y.constrainedAxis=V}else H(i,r,n,O,!0,!1);if(o(y.constrainedAxis)){var k=t.cross(y.direction,y.constrainedAxis,vt);t.equalsEpsilon(k,t.ZERO,d.EPSILON6)||(t.dot(k,y.right)<0&&t.negate(k,k),t.cross(k,y.direction,y.up),t.cross(y.direction,y.up,y.right),t.normalize(y.up,y.up),t.normalize(y.right,y.right))}y._setTransform(N),i._globe=D,i._ellipsoid=R;var z=R.maximumRadius;i._rotateFactor=1/z,i._rotateRateRangeAdjustment=z;var U=t.clone(y.positionWC,vt);if(J(i),!t.equals(y.positionWC,U)){y._setTransform(M),y.worldToCameraCoordinatesPoint(U,U);var G=t.magnitudeSquared(U);t.magnitudeSquared(y.position)>G&&(t.normalize(y.position,y.position),t.multiplyByScalar(y.position,Math.sqrt(G),y.position));var W=t.angleBetween(U,y.position),q=t.cross(U,y.position,U);t.normalize(q,q);var j=v.fromAxisAngle(q,W,_t),Y=m.fromQuaternion(j,yt);m.multiplyByVector(Y,y.direction,y.direction),m.multiplyByVector(Y,y.up,y.up),t.cross(y.direction,y.up,y.right),t.cross(y.right,y.direction,y.up),y._setTransform(N)}}}function K(e,i,r,a){var s=e._scene,l=s.camera,u=wt;u.x=r.startPosition.x,u.y=0;var c=Tt;c.x=r.endPosition.x,c.y=0;var h=l.getPickRay(u,xt).direction,m=l.getPickRay(c,bt).direction,p=0,f=t.dot(h,m);1>f&&(p=Math.acos(f)),p=r.startPosition.x>r.endPosition.x?-p:p;var v=e._horizontalRotationAxis;if(o(a)?l.look(a,-p):o(v)?l.look(v,-p):l.lookLeft(p),u.x=0,u.y=r.startPosition.y,c.x=0,c.y=r.endPosition.y,h=l.getPickRay(u,xt).direction,m=l.getPickRay(c,bt).direction,p=0,f=t.dot(h,m),1>f&&(p=Math.acos(f)),p=r.startPosition.y>r.endPosition.y?-p:p,a=n(a,v),o(a)){var g=l.direction,_=t.negate(a,At),y=t.equalsEpsilon(g,a,d.EPSILON2),C=t.equalsEpsilon(g,_,d.EPSILON2);if(y||C)(y&&0>p||C&&p>0)&&l.look(l.right,-p);else{f=t.dot(g,a);var E=d.acosClamped(f);p>0&&p>E&&(p=E-d.EPSILON4),f=t.dot(g,_),E=d.acosClamped(f),0>p&&-p>E&&(p=-E+d.EPSILON4);var S=t.cross(a,g,Pt);l.look(S,p)}}else l.lookUp(p)}function Q(e){P(e,e.enableRotate,e.rotateEventTypes,W,e.inertiaSpin,"_lastInertiaSpinMovement"),P(e,e.enableZoom,e.zoomEventTypes,j,e.inertiaZoom,"_lastInertiaZoomMovement"),P(e,e.enableTilt,e.tiltEventTypes,Y,e.inertiaSpin,"_lastInertiaTiltMovement"),P(e,e.enableLook,e.lookEventTypes,K)}function J(e){if(e.enableCollisionDetection){var i=e._scene,r=i.mode,n=i.globe;if(o(n)&&r!==E.SCENE2D&&r!==E.MORPHING){var a,s,l=i.camera,u=n.ellipsoid,c=i.mapProjection;p.equals(l.transform,p.IDENTITY)||(a=p.clone(l.transform),s=t.magnitude(l.position),l._setTransform(p.IDENTITY));var h=It;r===E.SCENE3D?u.cartesianToCartographic(l.position,h):c.unproject(l.position,h);var d=!1;if(h.height<e._minimumCollisionTerrainHeight){var m=n.getHeight(h);o(m)&&(m+=e.minimumZoomDistance,h.height<m&&(h.height=m,r===E.SCENE3D?u.cartographicToCartesian(h,l.position):c.project(h,l.position),d=!0))}o(a)&&(l._setTransform(a),d&&(t.normalize(l.position,l.position),t.negate(l.position,l.direction),t.multiplyByScalar(l.position,Math.max(s,e.minimumZoomDistance),l.position),t.normalize(l.direction,l.direction),t.cross(l.direction,l.up,l.right),t.cross(l.right,l.direction,l.up)))}}}var $=.4,ee=[],te=new g,ie=new t,re=new e,ne=new t,oe=new e,ae=new t,se=new t,le=new t,ue=new t,ce=new t,he=new g,de=new g,me=new t,pe=new e,fe=new e,ve=new g,ge=new t,_e=new t,ye=new g,Ce=new g,Ee=new t,Se=new t,we=new t,Te=new t,xe=new f(t.ZERO,0),be=new e,Ae=new e,Pe=new e,Ie=new g,Me=new t,De=new t,Re=new p,Oe=new p,Ne=new t,Le=new f(t.ZERO,0),Fe=new t,Be=new r,Ve=new p,ke=new v,ze=new m,Ue=new e,Ge=new g,We=new t,He=new g,qe=new f(t.ZERO,0),je=new t,Ye=new t,Xe=new t,Ze=new r,Ke=new t,Qe=new t,Je=new l,$e=new t,et=i.clone(i.UNIT_W),tt=i.clone(i.UNIT_W),it=new t,rt=new t,nt=new t,ot=new t,at=new e,st=new e,lt=new t,ut=new r,ct=new e,ht=new g,dt=new t,mt=new t,pt=new p,ft=new p,vt=new t,gt=new p,_t=new v,yt=new m,Ct=new r,Et=new t,St=new r,wt=new e,Tt=new e,xt=new g,bt=new g,At=new t,Pt=new t,It=new r;return T.prototype.update=function(){p.equals(this._scene.camera.transform,p.IDENTITY)?(this._globe=this._scene.globe,this._ellipsoid=o(this._globe)?this._globe.ellipsoid:this._scene.mapProjection.ellipsoid):(this._globe=void 0,this._ellipsoid=l.UNIT_SPHERE),this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight*this._scene.terrainExaggeration,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight*this._scene.terrainExaggeration,this._minimumTrackBallHeight=this.minimumTrackBallHeight*this._scene.terrainExaggeration;var e=this._ellipsoid.maximumRadius;this._rotateFactor=1/e,this._rotateRateRangeAdjustment=e;var i=this._scene,r=i.mode;r===E.SCENE2D?N(this):r===E.COLUMBUS_VIEW?(this._horizontalRotationAxis=t.UNIT_Z,U(this)):r===E.SCENE3D&&(this._horizontalRotationAxis=void 0,Q(this)),J(this),this._aggregator.reset()},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),a(this)},T}),i("Shaders/PostProcessFilters/AdditiveBlend",[],function(){"use strict";return"uniform sampler2D u_texture0;\nuniform sampler2D u_texture1;\nuniform vec2 u_center;\nuniform float u_radius;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 color0 = texture2D(u_texture0, v_textureCoordinates);\nvec4 color1 = texture2D(u_texture1, v_textureCoordinates);\nfloat x = length(gl_FragCoord.xy - u_center) / u_radius;\nfloat t = smoothstep(0.5, 0.8, x);\ngl_FragColor = mix(color0 + color1, color0, t);\n}\n"}),i("Shaders/PostProcessFilters/BrightPass",[],function(){"use strict";return"uniform sampler2D u_texture;\nuniform float u_avgLuminance;\nuniform float u_threshold;\nuniform float u_offset;\nvarying vec2 v_textureCoordinates;\nfloat key(float avg)\n{\nfloat guess = 1.5 - (1.5 / (avg * 0.1 + 1.0));\nreturn max(0.0, guess) + 0.1;\n}\nvoid main()\n{\nvec4 color = texture2D(u_texture, v_textureCoordinates);\nvec3 xyz = czm_RGBToXYZ(color.rgb);\nfloat luminance = xyz.r;\nfloat scaledLum = key(u_avgLuminance) * luminance / u_avgLuminance;\nfloat brightLum = max(scaledLum - u_threshold, 0.0);\nfloat brightness = brightLum / (u_offset + brightLum);\nxyz.r = brightness;\ngl_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);\n}\n"}),i("Shaders/PostProcessFilters/GaussianBlur1D",[],function(){"use strict";return"#define SAMPLES 8\nuniform float delta;\nuniform float sigma;\nuniform float direction;\nuniform sampler2D u_texture;\nuniform vec2 u_step;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec2 st = v_textureCoordinates;\nvec2 dir = vec2(1.0 - direction, direction);\nvec3 g;\ng.x = 1.0 / (sqrt(czm_twoPi) * sigma);\ng.y = exp((-0.5 * delta * delta) / (sigma * sigma));\ng.z = g.y * g.y;\nvec4 result = texture2D(u_texture, st) * g.x;\nfor (int i = 1; i < SAMPLES; ++i)\n{\ng.xy *= g.yz;\nvec2 offset = float(i) * dir * u_step;\nresult += texture2D(u_texture, st - offset) * g.x;\nresult += texture2D(u_texture, st + offset) * g.x;\n}\ngl_FragColor = result;\n}\n"}),i("Scene/SunPostProcess",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian4","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/Transforms","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PassState","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/AdditiveBlend","../Shaders/PostProcessFilters/BrightPass","../Shaders/PostProcessFilters/GaussianBlur1D","../Shaders/PostProcessFilters/PassThrough"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S){"use strict";function w(){this._fbo=void 0,this._downSampleFBO1=void 0,this._downSampleFBO2=void 0,this._clearFBO1Command=void 0,this._clearFBO2Command=void 0,this._downSampleCommand=void 0,this._brightPassCommand=void 0,this._blurXCommand=void 0,this._blurYCommand=void 0,this._blendCommand=void 0,this._fullScreenCommand=void 0,this._downSamplePassState=new m,this._downSamplePassState.scissorTest={enable:!0,rectangle:new e},this._upSamplePassState=new m,this._upSamplePassState.scissorTest={enabled:!0,rectangle:new e},this._uCenter=new t,this._uRadius=void 0,this._blurStep=new t}w.prototype.clear=function(e,t){var i=this._clearFBO1Command;r.clone(n(t,r.BLACK),i.color),i.execute(e),i=this._clearFBO2Command,r.clone(n(t,r.BLACK),i.color),i.execute(e)},w.prototype.execute=function(e,t){this._downSampleCommand.execute(e,this._downSamplePassState),this._brightPassCommand.execute(e,this._downSamplePassState),this._blurXCommand.execute(e,this._downSamplePassState),this._blurYCommand.execute(e,this._downSamplePassState),this._fullScreenCommand.framebuffer=t,this._blendCommand.framebuffer=t,this._fullScreenCommand.execute(e),this._blendCommand.execute(e,this._upSamplePassState)};var T=new e,x=new e,b=new i,A=new t,P=new t,I=new l;return w.prototype.update=function(e){var i=e.context,n=e.viewport,a=i.drawingBufferWidth,m=i.drawingBufferHeight,w=this;if(!o(this._downSampleCommand)){this._clearFBO1Command=new h({color:new r}),this._clearFBO2Command=new h({color:new r});var M={};this._downSampleCommand=i.createViewportQuadCommand(S,{uniformMap:M,owner:this}),M={u_avgLuminance:function(){return.5},u_threshold:function(){return.25},u_offset:function(){return.1}},this._brightPassCommand=i.createViewportQuadCommand(C,{uniformMap:M,owner:this});var D=1,R=2;M={delta:function(){return D},sigma:function(){return R},direction:function(){return 0}},this._blurXCommand=i.createViewportQuadCommand(E,{uniformMap:M,owner:this}),M={delta:function(){return D},sigma:function(){return R},direction:function(){return 1}},this._blurYCommand=i.createViewportQuadCommand(E,{uniformMap:M,owner:this}),M={u_center:function(){return w._uCenter},u_radius:function(){return w._uRadius}},this._blendCommand=i.createViewportQuadCommand(y,{uniformMap:M,owner:this}),M={},this._fullScreenCommand=i.createViewportQuadCommand(S,{uniformMap:M,owner:this})}var O=Math.pow(2,Math.ceil(Math.log(a)/Math.log(2))-2),N=Math.pow(2,Math.ceil(Math.log(m)/Math.log(2))-2),L=Math.max(O,N),F=x;F.width=L,F.height=L;var B=this._fbo,V=o(B)&&B.getColorTexture(0)||void 0;if(!o(V)||V.width!==a||V.height!==m){B=B&&B.destroy(),this._downSampleFBO1=this._downSampleFBO1&&this._downSampleFBO1.destroy(),this._downSampleFBO2=this._downSampleFBO2&&this._downSampleFBO2.destroy(),this._blurStep.x=this._blurStep.y=1/L;var k=[new _({context:i,width:a,height:m})];B=i.depthTexture?this._fbo=new d({context:i,colorTextures:k,depthTexture:new _({context:i,width:a,height:m,pixelFormat:u.DEPTH_COMPONENT,pixelDatatype:p.UNSIGNED_SHORT})}):this._fbo=new d({context:i,colorTextures:k,depthRenderbuffer:new f({context:i,format:v.DEPTH_COMPONENT16})}),this._downSampleFBO1=new d({context:i,colorTextures:[new _({context:i,width:L,height:L})]}),this._downSampleFBO2=new d({context:i,colorTextures:[new _({context:i,width:L,height:L})]}),this._clearFBO1Command.framebuffer=this._downSampleFBO1,this._clearFBO2Command.framebuffer=this._downSampleFBO2,this._downSampleCommand.framebuffer=this._downSampleFBO1,this._brightPassCommand.framebuffer=this._downSampleFBO2,this._blurXCommand.framebuffer=this._downSampleFBO1,this._blurYCommand.framebuffer=this._downSampleFBO2;var z=g.fromCache({viewport:F});this._downSampleCommand.uniformMap.u_texture=function(){return B.getColorTexture(0)},this._downSampleCommand.renderState=z,this._brightPassCommand.uniformMap.u_texture=function(){return w._downSampleFBO1.getColorTexture(0)},this._brightPassCommand.renderState=z,this._blurXCommand.uniformMap.u_texture=function(){return w._downSampleFBO2.getColorTexture(0)},this._blurXCommand.uniformMap.u_step=function(){return w._blurStep},this._blurXCommand.renderState=z,this._blurYCommand.uniformMap.u_texture=function(){return w._downSampleFBO1.getColorTexture(0)},this._blurYCommand.uniformMap.u_step=function(){return w._blurStep},this._blurYCommand.renderState=z;var U=T;U.width=a,U.height=m;var G=g.fromCache({viewport:U});this._blendCommand.uniformMap.u_texture0=function(){return B.getColorTexture(0)},this._blendCommand.uniformMap.u_texture1=function(){return w._downSampleFBO2.getColorTexture(0)},this._blendCommand.renderState=G,this._fullScreenCommand.uniformMap.u_texture=function(){return B.getColorTexture(0)},this._fullScreenCommand.renderState=G}var W=i.uniformState,H=W.sunPositionWC,q=W.view,j=W.viewProjection,Y=W.projection,X=l.computeViewportTransformation(n,0,1,I),Z=l.multiplyByPoint(q,H,b),K=c.pointToGLWindowCoordinates(j,X,H,A);Z.x+=s.SOLAR_RADIUS;var Q=c.pointToGLWindowCoordinates(Y,X,Z,Z),J=30*t.magnitude(t.subtract(Q,K,Q))*2,$=P;$.x=J,$.y=J;var ee=this._upSamplePassState.scissorTest.rectangle;return ee.x=Math.max(K.x-.5*$.x,0),ee.y=Math.max(K.y-.5*$.y,0),ee.width=Math.min($.x,a),ee.height=Math.min($.y,m),this._uCenter=t.clone(K,this._uCenter),this._uRadius=.5*Math.max($.x,$.y),X=l.computeViewportTransformation(F,0,1,I),K=c.pointToGLWindowCoordinates(j,X,H,A),$.x*=O/a,$.y*=N/m,ee=this._downSamplePassState.scissorTest.rectangle,ee.x=Math.max(K.x-.5*$.x,0),ee.y=Math.max(K.y-.5*$.y,0),ee.width=Math.min($.x,a),ee.height=Math.min($.y,m),this._downSamplePassState.context=i,this._upSamplePassState.context=i,this._fbo},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){return this._fbo=this._fbo&&this._fbo.destroy(),this._downSampleFBO1=this._downSampleFBO1&&this._downSampleFBO1.destroy(),this._downSampleFBO2=this._downSampleFBO2&&this._downSampleFBO2.destroy(),this._downSampleCommand=this._downSampleCommand&&this._downSampleCommand.shaderProgram&&this._downSampleCommand.shaderProgram.destroy(),this._brightPassCommand=this._brightPassCommand&&this._brightPassCommand.shaderProgram&&this._brightPassCommand.shaderProgram.destroy(),this._blurXCommand=this._blurXCommand&&this._blurXCommand.shaderProgram&&this._blurXCommand.shaderProgram.destroy(),this._blurYCommand=this._blurYCommand&&this._blurYCommand.shaderProgram&&this._blurYCommand.shaderProgram.destroy(),this._blendCommand=this._blendCommand&&this._blendCommand.shaderProgram&&this._blendCommand.shaderProgram.destroy(),this._fullScreenCommand=this._fullScreenCommand&&this._fullScreenCommand.shaderProgram&&this._fullScreenCommand.shaderProgram.destroy(),a(this)},w}),i("Scene/Scene",["../Core/BoundingRectangle","../Core/BoundingSphere","../Core/BoxGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EllipsoidGeometry","../Core/Event","../Core/GeographicProjection","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/getTimestamp","../Core/Intersect","../Core/Interval","../Core/JulianDate","../Core/Math","../Core/Matrix4","../Core/mergeSort","../Core/Occluder","../Core/ShowGeometryInstanceAttribute","../Renderer/ClearCommand","../Renderer/ComputeEngine","../Renderer/Context","../Renderer/ContextLimits","../Renderer/PassState","../Renderer/ShaderProgram","../Renderer/ShaderSource","./Camera","./CreditDisplay","./CullingVolume","./DepthPlane","./DeviceOrientationCameraController","./Fog","./FrameState","./FrustumCommands","./FXAA","./GlobeDepth","./OIT","./OrthographicFrustum","./Pass","./PerformanceDisplay","./PerInstanceColorAppearance","./PerspectiveFrustum","./PerspectiveOffCenterFrustum","./PickDepth","./Primitive","./PrimitiveCollection","./SceneMode","./SceneTransforms","./SceneTransitioner","./ScreenSpaceCameraController","./SunPostProcess","./TweenCollection"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O,N,L,F,B,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae){"use strict";function se(t){t=u(t,u.EMPTY_OBJECT);var i=t.canvas,r=t.contextOptions,n=t.creditContainer,o=new M(i,r);c(n)||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0px 0px 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",i.parentNode.appendChild(n)),this._id=l(),this._frameState=new U(o,new F(n)),this._frameState.scene3DOnly=u(t.scene3DOnly,!1);var s=new R(o);s.viewport=new e,s.viewport.x=0,s.viewport.y=0,s.viewport.width=o.drawingBufferWidth,s.viewport.height=o.drawingBufferHeight,this._passState=s,this._canvas=i,this._context=o,this._computeEngine=new I(o),this._globe=void 0,this._primitives=new ee,this._groundPrimitives=new ee,this._tweens=new ae,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._frustumCommandsList=[],this._overlayCommandList=[],this._pickFramebuffer=void 0,this._useOIT=u(t.orderIndependentTranslucency,!0),this._executeOITFunction=void 0;var h;o.depthTexture&&(h=new H);var d;this._useOIT&&c(h)&&(d=new q(o)),this._globeDepth=h,this._depthPlane=new V,this._oit=d,this._fxaa=new W,this._clearColorCommand=new P({color:new a,stencil:0,owner:this}),this._depthClearCommand=new P({depth:1,owner:this}),this._pickDepths=[],this._debugGlobeDepths=[],this._transitioner=new re(this),this._renderError=new f,this._preRender=new f,this._postRender=new f,this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new f,this.morphComplete=new f,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=a.clone(a.BLACK),this._mode=te.SCENE3D,this._mapProjection=c(t.mapProjection)?t.mapProjection:new v,this._transitioner=new re(this,this._mapProjection.ellipsoid),this.morphTime=1,this.farToNearRatio=1e3,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this._debugFrustumStatistics=void 0,this.debugShowFramesPerSecond=!1,this.debugShowGlobeDepth=!1,this.debugShowDepthFrustum=1,this.fxaa=!0,this.useDepthPicking=!0,this.cameraEventWaitTime=500,this.copyGlobeDepth=!1,this.fog=new z,this._terrainExaggeration=u(t.terrainExaggeration,1),this._performanceDisplay=void 0,this._debugVolume=void 0;var m=new L(this);this._camera=m,this._cameraClone=L.clone(m),this._screenSpaceCameraController=new ne(this),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useFXAA:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0;var p=m.frustum.near,g=m.frustum.far,_=Math.ceil(Math.log(g/p)/Math.log(this.farToNearRatio));me(p,g,this.farToNearRatio,_,this._frustumCommandsList),de(this,0,S.now()),this.initializeFrame()}function le(e,t){var i=Math.max(Math.abs(e.x),Math.abs(t.x)),r=Math.max(Math.abs(e.y),Math.abs(t.y)),n=Math.max(Math.abs(e.z),Math.abs(t.z));return Math.max(Math.max(i,r),n)}function ue(e,t,i){var r=1/Math.max(1,le(e.position,t.position));return n.multiplyByScalar(e.position,r,ze),n.multiplyByScalar(t.position,r,Ue),n.equalsEpsilon(ze,Ue,i)&&n.equalsEpsilon(e.direction,t.direction,i)&&n.equalsEpsilon(e.up,t.up,i)&&n.equalsEpsilon(e.right,t.right,i)&&T.equalsEpsilon(e.transform,t.transform,i)}function ce(e){var t=e.globe;if(e._mode===te.SCENE3D&&c(t)){var i=t.ellipsoid;return Ge.radius=i.minimumRadius,ke=b.fromBoundingSphere(Ge,e._camera.positionWC,ke)}}function he(e){e.render=!1,e.pick=!1}function de(e,t,i){var r=e._camera,n=e._frameState;n.commandList.length=0,n.mode=e._mode,n.morphTime=e.morphTime,n.mapProjection=e.mapProjection,n.frameNumber=t,n.time=S.clone(i,n.time),n.camera=r,n.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.occluder=ce(e),n.terrainExaggeration=e._terrainExaggeration,he(n.passes)}function me(e,t,i,r,n){n.length=r;for(var o=0;r>o;++o){var a=Math.max(e,Math.pow(i,o)*e),s=Math.min(t,i*a),l=n[o];c(l)?(l.near=a,l.far=s):l=n[o]=new G(a,s)}}function pe(e,t,i){e.debugShowFrustums&&(t.debugOverlappingFrustums=0);for(var r=e._frustumCommandsList,n=r.length,o=0;n>o;++o){var a=r[o],s=a.near,l=a.far;if(!(i.start>l)){if(i.stop<s)break;var u=t instanceof P?Y.OPAQUE:t.pass,h=a.indices[u]++;if(a.commands[u][h]=t,e.debugShowFrustums&&(t.debugOverlappingFrustums|=1<<o),t.executeInClosestFrustum)break}}if(e.debugShowFrustums){var d=e._debugFrustumStatistics.commandsInFrustums;d[t.debugOverlappingFrustums]=c(d[t.debugOverlappingFrustums])?d[t.debugOverlappingFrustums]+1:1,++e._debugFrustumStatistics.totalCommands}}function fe(e,t,i){return c(e)&&(!c(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==C.OUTSIDE&&(!c(i)||!e.boundingVolume.isOccluded(i)))}function ve(e){var t=e._frameState,i=t.camera,r=i.directionWC,n=i.positionWC,o=e._computeCommandList,a=e._overlayCommandList,s=t.commandList;e.debugShowFrustums&&(e._debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});for(var l=e._frustumCommandsList,u=l.length,h=Y.NUMBER_OF_PASSES,d=0;u>d;++d)for(var m=0;h>m;++m)l[d].indices[m]=0;o.length=0,a.length=0;for(var p=Number.MAX_VALUE,f=Number.MIN_VALUE,v=!1,g=t.mode===te.SCENE3D?t.occluder:void 0,_=t.cullingVolume,y=We.planes,C=0;5>C;++C)y[C]=_.planes[C];_=We;var E=e._environmentState;E.isSkyAtmosphereVisible=c(E.skyAtmosphereCommand)&&c(e.globe)&&e.globe._surface._tilesToRender.length>0,E.isSunVisible=fe(E.sunDrawCommand,_,g),E.isMoonVisible=fe(E.moonCommand,_,g);for(var S=s.length,w=0;S>w;++w){var T=s[w],x=T.pass;if(x===Y.COMPUTE)o.push(T);else if(x===Y.OVERLAY)a.push(T);else{var b=T.boundingVolume;if(c(b)){if(!fe(T,_,g))continue;He=b.computePlaneDistances(n,r,He),p=Math.min(p,He.start),f=Math.max(f,He.stop)}else He.start=i.frustum.near,He.stop=i.frustum.far,v=!(T instanceof P);pe(e,T,He)}}v?(p=i.frustum.near,f=i.frustum.far):(p=Math.min(Math.max(p,i.frustum.near),i.frustum.far),f=Math.max(Math.min(f,i.frustum.far),p));var A=e.farToNearRatio,I=Math.ceil(Math.log(f/p)/Math.log(A));p!==Number.MAX_VALUE&&(I!==u||0!==l.length&&(p<l[0].near||f>l[u-1].far))&&(me(p,f,A,I,l),ve(e))}function ge(e){var t={},i=e.vertexAttributes;for(var r in i)i.hasOwnProperty(r)&&(t[r]=i[r].index);return t}function _e(e,t,i){var r=t.context,n=u(i,e.shaderProgram),o=n.fragmentShaderSource.clone();o.sources=o.sources.map(function(e){return e=N.replaceMain(e,"czm_Debug_main")});var s="void main() \n{ \n czm_Debug_main(); \n";if(t.debugShowCommands){c(e._debugColor)||(e._debugColor=a.fromRandom());var l=e._debugColor;s+=" gl_FragColor.rgb *= vec3("+l.red+", "+l.green+", "+l.blue+"); \n"}if(t.debugShowFrustums){var h=1&e.debugOverlappingFrustums?"1.0":"0.0",d=2&e.debugOverlappingFrustums?"1.0":"0.0",m=4&e.debugOverlappingFrustums?"1.0":"0.0";s+=" gl_FragColor.rgb *= vec3("+h+", "+d+", "+m+"); \n"}s+="}",o.sources.push(s);var p=ge(n);return O.fromCache({context:r,vertexShaderSource:n.vertexShaderSource,fragmentShaderSource:o,attributeLocations:p})}function ye(e,t,i,r,n){if(c(e.shaderProgram)||c(n)){var o=_e(e,t,n);e.execute(t.context,i,r,o),o.destroy()}}function Ce(e,t,r,o,a,l,u){if((!c(t.debugCommandFilter)||t.debugCommandFilter(e))&&(t.debugShowCommands||t.debugShowFrustums?ye(e,t,o,a,l):e.execute(r,o,a,l),e.debugShowBoundingVolume&&c(e.boundingVolume))){var h=t._frameState,d=e.boundingVolume;c(t._debugVolume)&&t._debugVolume.destroy();var m,f=n.clone(d.center);if(h.mode!==te.SCENE3D){f=T.multiplyByPoint(qe,f,f);var v=h.mapProjection,y=v.unproject(f);f=v.ellipsoid.cartographicToCartesian(y)}if(c(d.radius)){var C=d.radius;m=_.toWireframe(p.createGeometry(new p({radii:new n(C,C,C),vertexFormat:Z.FLAT_VERTEX_FORMAT}))),t._debugVolume=new $({geometryInstances:new g({geometry:m,modelMatrix:T.multiplyByTranslation(T.IDENTITY,f,new T),attributes:{color:new s(1,0,0,1)}}),appearance:new Z({flat:!0,translucent:!1}),asynchronous:!1})}else{var E=d.halfAxes;m=_.toWireframe(i.createGeometry(i.fromDimensions({dimensions:new n(2,2,2),vertexFormat:Z.FLAT_VERTEX_FORMAT}))),t._debugVolume=new $({geometryInstances:new g({geometry:m,modelMatrix:T.fromRotationTranslation(E,f,new T),attributes:{color:new s(1,0,0,1)}}),appearance:new Z({flat:!0,translucent:!1}),asynchronous:!1})}var S=h.commandList,w=h.commandList=[];t._debugVolume.update(h);var x;c(u)&&(x=o.framebuffer,o.framebuffer=u),w[0].execute(r,o),c(x)&&(o.framebuffer=x),h.commandList=S}}function Ee(e,t,i){return t.boundingVolume.distanceSquaredTo(i)-e.boundingVolume.distanceSquaredTo(i)}function Se(e,t,i,r){var n=e.context;x(r,Ee,e._camera.positionWC);for(var o=r.length,a=0;o>a;++a)t(r[a],e,n,i)}function we(e,t){var i=e._debugGlobeDepths[t];return!c(i)&&e.context.depthTexture&&(i=new H,e._debugGlobeDepths[t]=i),i}function Te(e,t){var i=e._pickDepths[t];return c(i)||(i=new J,e._pickDepths[t]=i),i}function xe(e,t){var i,r=e._camera,n=e.context,o=n.uniformState;i=c(r.frustum.fov)?r.frustum.clone(je):c(r.frustum.infiniteProjectionMatrix)?r.frustum.clone(Ye):r.frustum.clone(Xe),i.near=r.frustum.near,i.far=r.frustum.far,o.updateFrustum(i);var a=e._environmentState,s=a.skyBoxCommand;if(c(s)&&Ce(s,e,n,t),a.isSkyAtmosphereVisible&&Ce(a.skyAtmosphereCommand,e,n,t),a.isSunVisible&&(a.sunDrawCommand.execute(n,t),e.sunBloom&&!e._useWebVR)){var l;l=a.useGlobeDepthFramebuffer?e._globeDepth.framebuffer:a.useFXAA?e._fxaa.getColorFramebuffer():a.originalFramebuffer,e._sunPostProcess.execute(n,l),t.framebuffer=l}a.isMoonVisible&&a.moonCommand.execute(n,t);var u;a.useOIT?(c(e._executeOITFunction)||(e._executeOITFunction=function(e,t,i,r){e._oit.executeCommands(e,t,i,r)}),u=e._executeOITFunction):u=Se;for(var h,d=a.clearGlobeDepth,m=a.clearGlobeDepth,p=e._depthClearCommand,f=e._depthPlane,v=e._frustumCommandsList,g=v.length,_=0;g>_;++_){var y=g-_-1,C=v[y];i.near=0!==y?C.near*Ve:C.near,i.far=C.far;var E,S=e.debugShowGlobeDepth?we(e,y):e._globeDepth;e.debugShowGlobeDepth&&c(S)&&a.useGlobeDepthFramebuffer&&(E=t.framebuffer,t.framebuffer=S.framebuffer),o.updateFrustum(i),p.execute(n,t);var w=C.commands[Y.GLOBE],T=C.indices[Y.GLOBE];for(h=0;T>h;++h)Ce(w[h],e,n,t);for(c(S)&&a.useGlobeDepthFramebuffer&&(e.copyGlobeDepth||e.debugShowGlobeDepth)&&(S.update(n),S.executeCopyDepth(n,t)),e.debugShowGlobeDepth&&c(S)&&a.useGlobeDepthFramebuffer&&(t.framebuffer=E),w=C.commands[Y.GROUND],T=C.indices[Y.GROUND],h=0;T>h;++h)Ce(w[h],e,n,t);d&&(p.execute(n,t),m&&f.execute(n,t));for(var x=Y.GROUND+1,b=Y.TRANSLUCENT,A=x;b>A;++A)for(w=C.commands[A],T=C.indices[A],h=0;T>h;++h)Ce(w[h],e,n,t);if(0!==y&&(i.near=C.near,o.updateFrustum(i)),w=C.commands[Y.TRANSLUCENT],w.length=C.indices[Y.TRANSLUCENT],u(e,Ce,t,w),c(S)&&a.useGlobeDepthFramebuffer&&e.useDepthPicking){var P=Te(e,y);P.update(n,S.framebuffer.depthStencilTexture),P.executeCopyDepth(n,t)}}}function be(e){var t=e._environmentState.sunComputeCommand;c(t)&&t.execute(e._computeEngine);for(var i=e._computeCommandList,r=i.length,n=0;r>n;++n)i[n].execute(e._computeEngine)}function Ae(e,t){for(var i=e.context,r=e._overlayCommandList,n=r.length,o=0;n>o;++o)r[o].execute(i,t)}function Pe(e,t){var i=e._context,r=t.viewport,o=e._frameState,a=o.camera;if(e._useWebVR)if(o.mode!==te.SCENE2D){r.x=0,r.y=0,r.width=.5*i.drawingBufferWidth,r.height=i.drawingBufferHeight;var s=L.clone(a,e._cameraVR),l=a.frustum.near,u=5*l,c=u/30,h=n.multiplyByScalar(s.right,.5*c,Ze);a.frustum.aspectRatio=r.width/r.height;var d=.5*c*l/u;n.add(s.position,h,a.position),a.frustum.xOffset=d,xe(e,t),r.x=t.viewport.width,n.subtract(s.position,h,a.position),a.frustum.xOffset=-d,xe(e,t),L.clone(s,a)}else{r.x=0,r.y=0,r.width=.5*i.drawingBufferWidth,r.height=i.drawingBufferHeight;var m=a.frustum.top;a.frustum.top=a.frustum.right*(r.height/r.width),a.frustum.bottom=-a.frustum.top,xe(e,t),r.x=t.viewport.width,xe(e,t),a.frustum.top=m,a.frustum.bottom=-m}else r.x=0,r.y=0,r.width=i.drawingBufferWidth,r.height=i.drawingBufferHeight,xe(e,t)}function Ie(e){var t=e._frameState,i=e._environmentState,r=t.passes.render;i.skyBoxCommand=r&&c(e.skyBox)?e.skyBox.update(t):void 0,i.skyAtmosphereCommand=r&&c(e.skyAtmosphere)?e.skyAtmosphere.update(t):void 0;var n=r&&c(e.sun)?e.sun.update(e):void 0;i.sunDrawCommand=c(n)?n.drawCommand:void 0,i.sunComputeCommand=c(n)?n.computeCommand:void 0,i.moonCommand=r&&c(e.moon)?e.moon.update(t):void 0;var o=i.clearGlobeDepth=c(e.globe)&&(!e.globe.depthTestAgainstTerrain||e.mode===te.SCENE2D),a=i.useDepthPlane=o&&e.mode===te.SCENE3D;a&&e._depthPlane.update(t)}function Me(e){var t=e._frameState;e._globe&&e._globe.update(t),e._groundPrimitives.update(t),e._primitives.update(t)}function De(e,t,i,r){var n=e._context,o=e._environmentState;o.originalFramebuffer=t.framebuffer,c(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!e._useWebVR?e._sunPostProcess=new oe:c(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!c(e.sun)&&c(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);var s=e._clearColorCommand;a.clone(i,s.color),s.execute(n,t);var l=o.useGlobeDepthFramebuffer=!r&&c(e._globeDepth);l&&(e._globeDepth.update(n),e._globeDepth.clear(n,t,i));for(var u=!1,h=e._frustumCommandsList,d=h.length,m=0;d>m;++m)if(h[m].indices[Y.TRANSLUCENT]>0){u=!0;break}var p=o.useOIT=!r&&u&&c(e._oit)&&e._oit.isSupported();p&&(e._oit.update(n,e._globeDepth.framebuffer),e._oit.clear(n,t,i),o.useOIT=e._oit.isSupported());var f=o.useFXAA=!r&&e.fxaa;f&&(e._fxaa.update(n),e._fxaa.clear(n,t,i)),o.isSunVisible&&e.sunBloom&&!e._useWebVR?t.framebuffer=e._sunPostProcess.update(t):l?t.framebuffer=e._globeDepth.framebuffer:f&&(t.framebuffer=e._fxaa.getColorFramebuffer()),c(t.framebuffer)&&s.execute(n,t)}function Re(e,t){var i=e._context,r=e._environmentState,n=r.useGlobeDepthFramebuffer;if(e.debugShowGlobeDepth&&n){var o=we(e,e.debugShowDepthFrustum-1);o.executeDebugGlobeDepth(i,t)}if(e.debugShowPickDepth&&n){var a=Te(e,e.debugShowDepthFrustum-1);a.executeDebugPickDepth(i,t)}var s=r.useOIT,l=r.useFXAA;s&&(t.framebuffer=l?e._fxaa.getColorFramebuffer():void 0,e._oit.execute(i,t)),l&&(!s&&n&&(t.framebuffer=e._fxaa.getColorFramebuffer(),e._globeDepth.executeCopyColor(i,t)),t.framebuffer=r.originalFramebuffer,e._fxaa.execute(i,t)),s||l||!n||(t.framebuffer=r.originalFramebuffer,e._globeDepth.executeCopyColor(i,t))}function Oe(e){for(var t=e.afterRender,i=0,r=t.length;r>i;++i)t[i]();t.length=0}function Ne(e,t){c(t)||(t=S.now());var i=e._camera;ue(i,e._cameraClone,w.EPSILON6)?e._cameraStartFired&&y()-e._cameraMovedTime>e.cameraEventWaitTime&&(i.moveEnd.raiseEvent(),e._cameraStartFired=!1):(e._cameraStartFired||(i.moveStart.raiseEvent(),e._cameraStartFired=!0),e._cameraMovedTime=y(),L.clone(i,e._cameraClone)),e._preRender.raiseEvent(e,t);var r=e.context,n=r.uniformState,o=e._frameState,s=w.incrementWrap(o.frameNumber,15e6,1);de(e,s,t),o.passes.render=!0,o.creditDisplay.beginFrame(),e.fog.update(o),n.update(o),e._computeCommandList.length=0,e._overlayCommandList.length=0;var l=e._passState;l.framebuffer=void 0,l.blendingEnabled=void 0,l.scissorTest=void 0; +var h=l.viewport;if(h.x=0,h.y=0,h.width=r.drawingBufferWidth,h.height=r.drawingBufferHeight,Ie(e),Me(e),ve(e),De(e,l,u(e.backgroundColor,a.BLACK)),be(e),Pe(e,l),Re(e,l),Ae(e,l),o.creditDisplay.endFrame(),e.debugShowFramesPerSecond){if(!c(e._performanceDisplay)){var d=document.createElement("div");d.className="cesium-performanceDisplay-defaultContainer";var m=e._canvas.parentNode;m.appendChild(d);var p=new X({container:d});e._performanceDisplay=p,e._performanceContainer=d}e._performanceDisplay.update()}else c(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer));r.endFrame(),Oe(o),e._postRender.raiseEvent(e,t)}function Le(e,t,i,r){var o=e._camera,a=o.frustum,s=e._passState.viewport,l=2*(t.x-s.x)/s.width-1;l*=.5*(a.right-a.left);var u=2*(s.height-t.y-s.y)/s.height-1;u*=.5*(a.top-a.bottom);var c=T.clone(o.transform,et);o._setTransform(T.IDENTITY);var h=n.clone(o.position,Qe);n.multiplyByScalar(o.right,l,Je),n.add(Je,h,h),n.multiplyByScalar(o.up,u,Je),n.add(Je,h,h),o._setTransform(c),n.fromElements(h.z,h.x,h.y,h);var d=a.getPixelDimensions(s.width,s.height,1,$e),m=Ke;return m.right=.5*d.x,m.left=-m.right,m.top=.5*d.y,m.bottom=-m.top,m.near=a.near,m.far=a.far,m.computeCullingVolume(h,o.directionWC,o.upWC)}function Fe(e,t,i,r){var n=e._camera,o=n.frustum,a=o.near,s=Math.tan(.5*o.fovy),l=o.aspectRatio*s,u=e._passState.viewport,c=2*(t.x-u.x)/u.width-1,h=2*(u.height-t.y-u.y)/u.height-1,d=c*a*l,m=h*a*s,p=o.getPixelDimensions(u.width,u.height,1,$e),f=p.x*i*.5,v=p.y*r*.5,g=tt;return g.top=m+v,g.bottom=m-v,g.right=d+f,g.left=d-f,g.near=a,g.far=o.far,g.computeCullingVolume(n.positionWC,n.directionWC,n.upWC)}function Be(e,t,i,r){return e._mode===te.SCENE2D?Le(e,t,i,r):Fe(e,t,i,r)}var Ve=.99;h(se.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return D.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return D.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._camera}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},frameState:{get:function(){return this._frameState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){return this.globe.imageryLayers}},terrainProvider:{get:function(){return this.globe.terrainProvider},set:function(e){this.globe.terrainProvider=e}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return c(this._oit)}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===te.SCENE2D?this.morphTo2D(0):e===te.SCENE3D?this.morphTo3D(0):e===te.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},numberOfFrustums:{get:function(){return this._frustumCommandsList.length}},terrainExaggeration:{get:function(){return this._terrainExaggeration}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new L(this),c(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new k(this)),this._aspectRatioVR=this._camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._camera.frustum.aspectRatio=this._aspectRatioVR,this._camera.frustum.xOffset=0)}}});var ke,ze=new n,Ue=new n,Ge=new t,We=new B,He=new E,qe=new T(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);qe=T.inverseTransformation(qe,qe);var je=new K,Ye=new Q,Xe=new j;se.prototype.initializeFrame=function(){120===this._shaderFrameCount++&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms()),this._tweens.update(),this._camera.update(this._mode),this._screenSpaceCameraController.update(),c(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update()};var Ze=new n;se.prototype.render=function(e){try{Ne(this,e)}catch(t){if(this._renderError.raiseEvent(this,t),this.rethrowRenderErrors)throw t}},se.prototype.clampLineWidth=function(e){return Math.max(D.minimumAliasedLineWidth,Math.min(e,D.maximumAliasedLineWidth))};var Ke=new j,Qe=new n,Je=new n,$e=new r,et=new T,tt=new Q,it=3,rt=3,nt=new e(0,0,it,rt),ot=new a(0,0,0,0),at=new r;se.prototype.pick=function(e){var t=this._context,i=t.uniformState,r=this._frameState,n=ie.transformWindowToDrawingBuffer(this,e,at);c(this._pickFramebuffer)||(this._pickFramebuffer=t.createPickFramebuffer()),de(this,r.frameNumber,r.time),r.cullingVolume=Be(this,n,it,rt),r.passes.pick=!0,i.update(r),nt.x=n.x-.5*(it-1),nt.y=this.drawingBufferHeight-n.y-.5*(rt-1);var o=this._pickFramebuffer.begin(nt);Me(this),ve(this),De(this,o,ot,!0),xe(this,o),Re(this,o);var a=this._pickFramebuffer.end(nt);return t.endFrame(),Oe(r),a};var st=new o,lt=new o(1,1/255,1/65025,1/160581375);return se.prototype.pickPosition=function(e,t){if(this.useDepthPicking){var i=this._context,r=i.uniformState,n=ie.transformWindowToDrawingBuffer(this,e,at);n.y=this.drawingBufferHeight-n.y;var a,s=this._camera;c(s.frustum.fov)?a=s.frustum.clone(je):c(s.frustum.infiniteProjectionMatrix)&&(a=s.frustum.clone(Ye));for(var l=this.numberOfFrustums,u=0;l>u;++u){var h=Te(this,u),d=i.readPixels({x:n.x,y:n.y,width:1,height:1,framebuffer:h.framebuffer}),m=o.unpack(d,0,st);o.divideByScalar(m,255,m);var p=o.dot(m,lt);if(p>0&&1>p){var f=this._frustumCommandsList[u];return a.near=f.near*(0!==u?Ve:1),a.far=f.far,r.updateFrustum(a),ie.drawingBufferToWgs84Coordinates(this,n,p,t)}}}},se.prototype.drillPick=function(e,t){var i,r,n=[],o=[],a=[];c(t)||(t=Number.MAX_VALUE);for(var s=this.pick(e);c(s)&&c(s.primitive)&&(n.push(s),!(0>=--t));){var l=s.primitive,u=!1;"function"==typeof l.getGeometryInstanceAttributes&&c(s.id)&&(r=l.getGeometryInstanceAttributes(s.id),c(r)&&c(r.show)&&(u=!0,r.show=A.toValue(!1,r.show),a.push(r))),u||(l.show=!1,o.push(l)),s=this.pick(e)}for(i=0;i<o.length;++i)o[i].show=!0;for(i=0;i<a.length;++i)r=a[i],r.show=A.toValue(!0,r.show);return n},se.prototype.completeMorph=function(){this._transitioner.completeMorph()},se.prototype.morphTo2D=function(e){var t,i=this.globe;t=c(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=u(e,2),this._transitioner.morphTo2D(e,t)},se.prototype.morphToColumbusView=function(e){var t,i=this.globe;t=c(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=u(e,2),this._transitioner.morphToColumbusView(e,t)},se.prototype.morphTo3D=function(e){var t,i=this.globe;t=c(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=u(e,2),this._transitioner.morphTo3D(e,t)},se.prototype.isDestroyed=function(){return!1},se.prototype.destroy=function(){return this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._pickFramebuffer=this._pickFramebuffer&&this._pickFramebuffer.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner.destroy(),c(this._globeDepth)&&this._globeDepth.destroy(),c(this._oit)&&this._oit.destroy(),this._fxaa.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay.destroy(),c(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),d(this)},se}),i("Scene/SingleTileImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadImage","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../ThirdParty/when"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(r){function n(e){E._image=e,E._tileWidth=e.width,E._tileHeight=e.height,E._ready=!0,E._readyPromise.resolve(!0),c.handleSuccess(E._errorEvent)}function d(e){var t="Failed to load image "+_+".";C=c.handleError(C,E,E._errorEvent,t,0,0,0,m,e),E._readyPromise.reject(new u(t))}function m(){h(s(_),n,d)}r=t(r,{});var p=r.url;this._url=p;var f=r.proxy;this._proxy=f;var v=t(r.rectangle,l.MAX_VALUE),g=new a({rectangle:v,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:r.ellipsoid});this._tilingScheme=g,this._image=void 0,this._texture=void 0,this._tileWidth=0,this._tileHeight=0,this._errorEvent=new o,this._ready=!1,this._readyPromise=h.defer();var _=p;i(f)&&(_=f.getURL(_));var y=r.credit;"string"==typeof y&&(y=new e(y)),this._credit=y;var C,E=this;m()}return r(d.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),d.prototype.getTileCredits=function(e,t,i){},d.prototype.requestImage=function(e,t,i){return this._image},d.prototype.pickFeatures=function(){},d}),i("Shaders/SkyAtmosphereFS",[],function(){"use strict";return"const float g = -0.95;\nconst float g2 = g * g;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\nvarying vec3 v_toCamera;\nvarying vec3 v_positionEC;\nvoid main (void)\n{\nfloat fCos = dot(czm_sunDirectionWC, normalize(v_toCamera)) / length(v_toCamera);\nfloat fRayleighPhase = 0.75 * (1.0 + fCos * fCos);\nfloat fMiePhase = 1.5 * ((1.0 - g2) / (2.0 + g2)) * (1.0 + fCos * fCos) / pow(1.0 + g2 - 2.0 * g * fCos, 1.5);\nconst float fExposure = 2.0;\nvec3 rgb = fRayleighPhase * v_rayleighColor + fMiePhase * v_mieColor;\nrgb = vec3(1.0) - exp(-fExposure * rgb);\nfloat l = czm_luminance(rgb);\ngl_FragColor = vec4(rgb, min(smoothstep(0.0, 0.1, l), 1.0) * smoothstep(0.0, 1.0, czm_morphTime));\n}\n"}),i("Shaders/SkyAtmosphereVS",[],function(){"use strict";return"attribute vec4 position;\nuniform float fCameraHeight;\nuniform float fCameraHeight2;\nuniform float fOuterRadius;\nuniform float fOuterRadius2;\nuniform float fInnerRadius;\nuniform float fScale;\nuniform float fScaleDepth;\nuniform float fScaleOverScaleDepth;\nconst float Kr = 0.0025;\nconst float fKr4PI = Kr * 4.0 * czm_pi;\nconst float Km = 0.0015;\nconst float fKm4PI = Km * 4.0 * czm_pi;\nconst float ESun = 15.0;\nconst float fKmESun = Km * ESun;\nconst float fKrESun = Kr * ESun;\nconst vec3 v3InvWavelength = vec3(\n5.60204474633241,\n9.473284437923038,\n19.643802610477206);\nconst float rayleighScaleDepth = 0.25;\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\nvarying vec3 v_toCamera;\nfloat scale(float fCos)\n{\nfloat x = 1.0 - fCos;\nreturn fScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nvoid main(void)\n{\nvec3 v3Pos = position.xyz;\nvec3 v3Ray = v3Pos - czm_viewerPositionWC;\nfloat fFar = length(v3Ray);\nv3Ray /= fFar;\n#ifdef SKY_FROM_SPACE\nfloat B = 2.0 * dot(czm_viewerPositionWC, v3Ray);\nfloat C = fCameraHeight2 - fOuterRadius2;\nfloat fDet = max(0.0, B*B - 4.0 * C);\nfloat fNear = 0.5 * (-B - sqrt(fDet));\nvec3 v3Start = czm_viewerPositionWC + v3Ray * fNear;\nfFar -= fNear;\nfloat fStartAngle = dot(v3Ray, v3Start) / fOuterRadius;\nfloat fStartDepth = exp(-1.0 / fScaleDepth);\nfloat fStartOffset = fStartDepth*scale(fStartAngle);\n#else\nvec3 v3Start = czm_viewerPositionWC;\nfloat fHeight = length(v3Start);\nfloat fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fCameraHeight));\nfloat fStartAngle = dot(v3Ray, v3Start) / fHeight;\nfloat fStartOffset = fDepth*scale(fStartAngle);\n#endif\nfloat fSampleLength = fFar / fSamples;\nfloat fScaledLength = fSampleLength * fScale;\nvec3 v3SampleRay = v3Ray * fSampleLength;\nvec3 v3SamplePoint = v3Start + v3SampleRay * 0.5;\nvec3 v3FrontColor = vec3(0.0, 0.0, 0.0);\nfor(int i=0; i<nSamples; i++)\n{\nfloat fHeight = length(v3SamplePoint);\nfloat fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fHeight));\nvec3 lightPosition = normalize(czm_viewerPositionWC);\nfloat fLightAngle = dot(lightPosition, v3SamplePoint) / fHeight;\nfloat fCameraAngle = dot(v3Ray, v3SamplePoint) / fHeight;\nfloat fScatter = (fStartOffset + fDepth*(scale(fLightAngle) - scale(fCameraAngle)));\nvec3 v3Attenuate = exp(-fScatter * (v3InvWavelength * fKr4PI + fKm4PI));\nv3FrontColor += v3Attenuate * (fDepth * fScaledLength);\nv3SamplePoint += v3SampleRay;\n}\nv_mieColor = v3FrontColor * fKmESun;\nv_rayleighColor = v3FrontColor * (v3InvWavelength * fKrESun);\nv_toCamera = czm_viewerPositionWC - v3Pos;\ngl_Position = czm_modelViewProjection * position;\n}\n"}),i("Scene/SkyAtmosphere",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Ellipsoid","../Core/EllipsoidGeometry","../Core/GeometryPipeline","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/SkyAtmosphereFS","../Shaders/SkyAtmosphereVS","./BlendingState","./CullFace","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y){"use strict";function C(i){i=t(i,o.WGS84),this.show=!0,this._ellipsoid=i,this._command=new c({owner:this}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._fCameraHeight=void 0,this._fCameraHeight2=void 0,this._outerRadius=e.maximumComponent(e.multiplyByScalar(i.radii,1.025,new e));var r=i.maximumRadius,n=.25,a=this;this._command.uniformMap={fCameraHeight:function(){return a._fCameraHeight},fCameraHeight2:function(){return a._fCameraHeight2},fOuterRadius:function(){return a._outerRadius},fOuterRadius2:function(){return a._outerRadius*a._outerRadius},fInnerRadius:function(){return r},fScale:function(){return 1/(a._outerRadius-r)},fScaleDepth:function(){return n},fScaleOverScaleDepth:function(){return 1/(a._outerRadius-r)/n}}}return r(C.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),C.prototype.update=function(t){if(this.show&&(t.mode===y.SCENE3D||t.mode===y.MORPHING)&&t.passes.render){var r=this._command;if(!i(r.vertexArray)){var n=t.context,o=a.createGeometry(new a({radii:e.multiplyByScalar(this._ellipsoid.radii,1.025,new e),slicePartitions:256,stackPartitions:256,vertexFormat:l.POSITION_ONLY}));r.vertexArray=p.fromGeometry({context:n,geometry:o,attributeLocations:s.createAttributeLocations(o),bufferUsage:u.STATIC_DRAW}),r.renderState=h.fromCache({cull:{enabled:!0,face:_.FRONT},blending:g.ALPHA_BLEND});var c=new m({defines:["SKY_FROM_SPACE"],sources:[v]});this._spSkyFromSpace=d.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:f}),c=new m({defines:["SKY_FROM_ATMOSPHERE"],sources:[v]}),this._spSkyFromAtmosphere=d.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:f})}var C=t.camera.positionWC;return this._fCameraHeight2=e.magnitudeSquared(C),this._fCameraHeight=Math.sqrt(this._fCameraHeight2),this._fCameraHeight>this._outerRadius?r.shaderProgram=this._spSkyFromSpace:r.shaderProgram=this._spSkyFromAtmosphere,r}},C.prototype.isDestroyed=function(){return!1},C.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyFromSpace=this._spSkyFromSpace&&this._spSkyFromSpace.destroy(),this._spSkyFromAtmosphere=this._spSkyFromAtmosphere&&this._spSkyFromAtmosphere.destroy(),n(this)},C}),i("Shaders/SkyBoxFS",[],function(){"use strict";return"uniform samplerCube u_cubeMap;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 rgb = textureCube(u_cubeMap, normalize(v_texCoord)).rgb;\ngl_FragColor = vec4(rgb, czm_morphTime);\n}\n"}),i("Shaders/SkyBoxVS",[],function(){"use strict";return"attribute vec3 position;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\ngl_Position = czm_projection * vec4(p, 1.0);\nv_texCoord = position.xyz;\n}\n"}),i("Scene/SkyBox",["../Core/BoxGeometry","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/GeometryPipeline","../Core/Matrix4","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/CubeMap","../Renderer/DrawCommand","../Renderer/loadCubeMap","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/VertexArray","../Shaders/SkyBoxFS","../Shaders/SkyBoxVS","./BlendingState","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y){"use strict";function C(e){this.sources=e.sources,this._sources=void 0,this.show=i(e.show,!0),this._command=new h({modelMatrix:s.clone(s.IDENTITY),owner:this}),this._cubeMap=void 0}return C.prototype.update=function(i){if(this.show&&(i.mode===y.SCENE3D||i.mode===y.MORPHING)&&i.passes.render){var n=i.context;if(this._sources!==this.sources){this._sources=this.sources;var o=this.sources;"string"==typeof o.positiveX?d(n,this._sources).then(function(e){h._cubeMap=h._cubeMap&&h._cubeMap.destroy(),h._cubeMap=e}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new c({context:n,source:o}))}var s=this._command;if(!r(s.vertexArray)){var h=this;s.uniformMap={u_cubeMap:function(){return h._cubeMap}};var C=e.createGeometry(e.fromDimensions({dimensions:new t(2,2,2),vertexFormat:l.POSITION_ONLY})),E=a.createAttributeLocations(C);s.vertexArray=f.fromGeometry({context:n,geometry:C,attributeLocations:E,bufferUsage:u.STATIC_DRAW}),s.shaderProgram=p.fromCache({context:n,vertexShaderSource:g,fragmentShaderSource:v,attributeLocations:E}),s.renderState=m.fromCache({blending:_.ALPHA_BLEND})}if(r(this._cubeMap))return s}},C.prototype.isDestroyed=function(){return!1},C.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),n(this)},C}),i("Shaders/SunFS",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),i("Shaders/SunTextureFS",[],function(){"use strict";return"uniform float u_glowLengthTS;\nuniform float u_radiusTS;\nvarying vec2 v_textureCoordinates;\nvec2 rotate(vec2 p, vec2 direction)\n{\nreturn vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x);\n}\nvec4 addBurst(vec2 position, vec2 direction)\n{\nvec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);\nfloat radius = length(rotatedPosition);\nfloat burst = 1.0 - smoothstep(0.0, 0.55, radius);\nreturn vec4(burst);\n}\nvoid main()\n{\nvec2 position = v_textureCoordinates - vec2(0.5);\nfloat radius = length(position);\nfloat surface = step(radius, u_radiusTS);\nvec4 color = vec4(1.0, 1.0, surface + 0.2, surface);\nfloat glow = 1.0 - smoothstep(0.0, 0.55, radius);\ncolor.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75;\nvec4 burst = vec4(0.0);\nburst += 0.4 * addBurst(position, vec2(0.38942, 0.92106));\nburst += 0.4 * addBurst(position, vec2(0.99235, 0.12348));\nburst += 0.4 * addBurst(position, vec2(0.60327, -0.79754));\nburst += 0.3 * addBurst(position, vec2(0.31457, 0.94924));\nburst += 0.3 * addBurst(position, vec2(0.97931, 0.20239));\nburst += 0.3 * addBurst(position, vec2(0.66507, -0.74678));\ncolor += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;\ngl_FragColor = clamp(color, vec4(0.0), vec4(1.0));\n}\n"}),i("Shaders/SunVS",[],function(){"use strict";return"attribute vec2 direction;\nuniform float u_size;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 position;\nif (czm_morphTime == 1.0)\n{\nposition = vec4(czm_sunPositionWC, 1.0);\n}\nelse\n{\nposition = vec4(czm_sunPositionColumbusView.zxy, 1.0);\n}\nvec4 positionEC = czm_view * position;\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nvec2 halfSize = vec2(u_size * 0.5);\nhalfSize *= ((direction * 2.0) - 1.0);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);\nv_textureCoordinates = direction;\n}\n"}),i("Scene/Sun",["../Core/BoundingRectangle","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/ComponentDatatype","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/IndexDatatype","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/PrimitiveType","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ClearCommand","../Renderer/ComputeCommand","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/Texture","../Renderer/VertexArray","../Shaders/SunFS","../Shaders/SunTextureFS","../Shaders/SunVS","./BlendingState","./SceneMode","./SceneTransforms"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M){"use strict";function D(){this.show=!0,this._drawCommand=new y({primitiveType:p.TRIANGLES,boundingVolume:new t,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new t,this._boundingVolume2D=new t,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1;var e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}l(D.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var R=new i,O=new i,N=new n,L=new n;return D.prototype.update=function(e){var n=e._passState,o=e.frameState,l=e.context;if(this.show){var u=o.mode;if(u!==I.SCENE2D&&u!==I.MORPHING&&o.passes.render){var p=n.viewport.width,g=n.viewport.height;if(!s(this._texture)||p!==this._drawingBufferWidth||g!==this._drawingBufferHeight||this._glowFactorDirty){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=p,this._drawingBufferHeight=g,this._glowFactorDirty=!1;var y=Math.max(p,g);y=Math.pow(2,Math.ceil(Math.log(y)/Math.log(2))-2),this._texture=new w({context:l,width:y,height:y,pixelFormat:m.RGBA}),this._glowLengthTS=5*this._glowFactor,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;var C=this,D={u_glowLengthTS:function(){return C._glowLengthTS},u_radiusTS:function(){return C._radiusTS}};this._commands.computeCommand=new _({fragmentShaderSource:b,outputTexture:this._texture,uniformMap:D,persists:!1,owner:this,postExecute:function(){C._commands.computeCommand=void 0}})}var F=this._drawCommand;if(!s(F.vertexArray)){var B={direction:0},V=new Uint8Array(8);V[0]=0,V[1]=0,V[2]=255,V[3]=0,V[4]=255,V[5]=255,V[6]=0,V[7]=255;var k=f.createVertexBuffer({context:l,typedArray:V,usage:v.STATIC_DRAW}),z=[{index:B.direction,vertexBuffer:k,componentsPerAttribute:2,normalize:!0,componentDatatype:a.UNSIGNED_BYTE}],U=f.createIndexBuffer({context:l,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:v.STATIC_DRAW,indexDatatype:c.UNSIGNED_SHORT});F.vertexArray=new T({context:l,attributes:z,indexBuffer:U}),F.shaderProgram=S.fromCache({context:l,vertexShaderSource:A,fragmentShaderSource:x,attributeLocations:B}),F.renderState=E.fromCache({blending:P.ALPHA_BLEND}),F.uniformMap=this._uniformMap}var G=l.uniformState.sunPositionWC,W=l.uniformState.sunPositionColumbusView,H=this._boundingVolume,q=this._boundingVolume2D;r.clone(G,H.center),q.center.x=W.z,q.center.y=W.x,q.center.z=W.y,H.radius=h.SOLAR_RADIUS+h.SOLAR_RADIUS*this._glowLengthTS,q.radius=H.radius,u===I.SCENE3D?t.clone(H,F.boundingVolume):u===I.COLUMBUS_VIEW&&t.clone(q,F.boundingVolume);var j=M.computeActualWgs84Position(o,G,L),Y=r.magnitude(r.subtract(j,e.camera.position,L)),X=l.uniformState.projection,Z=N;Z.x=0,Z.y=0,Z.z=-Y,Z.w=1;var K=d.multiplyByVector(X,Z,L),Q=M.clipToDrawingBufferCoordinates(e,K,R);Z.x=h.SOLAR_RADIUS;var J=d.multiplyByVector(X,Z,L),$=M.clipToDrawingBufferCoordinates(e,J,O);return this._size=Math.ceil(i.magnitude(i.subtract($,Q,L))),this._size=2*this._size*(1+2*this._glowLengthTS),this._commands}}},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){var e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),u(this)},D}),i("Scene/TileCoordinatesImageryProvider",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/GeographicTilingScheme","../ThirdParty/when"],function(e,t,i,r,n,o,a){"use strict";function s(r){r=t(r,t.EMPTY_OBJECT),this._tilingScheme=i(r.tilingScheme)?r.tilingScheme:new o({ellipsoid:r.ellipsoid}),this._color=t(r.color,e.YELLOW),this._errorEvent=new n,this._tileWidth=t(r.tileWidth,256),this._tileHeight=t(r.tileHeight,256),this._readyPromise=a.resolve(!0)}return r(s.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}}),s.prototype.getTileCredits=function(e,t,i){},s.prototype.requestImage=function(e,t,i){var r=document.createElement("canvas");r.width=256,r.height=256;var n=r.getContext("2d"),o=this._color.toCssColorString();n.strokeStyle=o,n.lineWidth=2,n.strokeRect(1,1,255,255);var a="L"+i+"X"+e+"Y"+t;return n.font="bold 25px Arial",n.textAlign="center",n.fillStyle="black",n.fillText(a,127,127),n.fillStyle=o,n.fillText(a,124,124),r},s.prototype.pickFeatures=function(){},s}),i("Scene/TileDiscardPolicy",["../Core/DeveloperError"],function(e){"use strict";function t(t){e.throwInstantiationError()}return t.prototype.isReady=e.throwInstantiationError,t.prototype.shouldDiscardImage=e.throwInstantiationError,t}),i("Scene/TileMapServiceImageryProvider",["../Core/Cartesian2","../Core/Cartographic","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/joinUrls","../Core/loadXML","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g){"use strict";function _(o){function s(i){for(var a,s,l,h,v=/tileformat/i,g=/tileset/i,C=/tilesets/i,w=/boundingbox/i,T=/srs/i,x=[],b=i.childNodes[0].childNodes,A=0;A<b.length;A++)if(v.test(b.item(A).nodeName))a=b.item(A);else if(C.test(b.item(A).nodeName)){l=b.item(A);for(var P=b.item(A).childNodes,I=0;I<P.length;I++)g.test(P.item(I).nodeName)&&x.push(P.item(I))}else w.test(b.item(A).nodeName)?s=b.item(A):T.test(b.item(A).nodeName)&&(h=b.item(A).textContent);S._fileExtension=r(S._fileExtension,a.getAttribute("extension")),S._tileWidth=r(S._tileWidth,parseInt(a.getAttribute("width"),10)),S._tileHeight=r(S._tileHeight,parseInt(a.getAttribute("height"),10)),S._minimumLevel=r(S._minimumLevel,parseInt(x[0].getAttribute("order"),10)),S._maximumLevel=r(S._maximumLevel,parseInt(x[x.length-1].getAttribute("order"),10));var M=l.getAttribute("profile"),D=!1;if(("geodetic"===M||"mercator"===M)&&(D=!0),!n(S._tilingScheme))if("geodetic"===M||"global-geodetic"===M)S._tilingScheme=new u({ellipsoid:o.ellipsoid});else{if("mercator"!==M&&"global-mercator"!==M){var R=c(y,"tilemapresource.xml")+"specifies an unsupported profile attribute, "+M+".";return E=p.handleError(E,S,S._errorEvent,R,void 0,void 0,void 0,_),void S._readyPromise.reject(new m(R))}S._tilingScheme=new f({ellipsoid:o.ellipsoid})}var O=S._tilingScheme;if(!n(S._rectangle)){var N,L,F,B;if(D)N=new e(parseFloat(s.getAttribute("miny")),parseFloat(s.getAttribute("minx"))),L=new e(parseFloat(s.getAttribute("maxy")),parseFloat(s.getAttribute("maxx"))),F=t.fromDegrees(N.x,N.y),B=t.fromDegrees(L.x,L.y);else if(N=new e(parseFloat(s.getAttribute("minx")),parseFloat(s.getAttribute("miny"))),L=new e(parseFloat(s.getAttribute("maxx")),parseFloat(s.getAttribute("maxy"))),S._tilingScheme instanceof u)F=t.fromDegrees(N.x,N.y),B=t.fromDegrees(L.x,L.y);else{var V=S._tilingScheme.projection;F=V.unproject(N),B=V.unproject(L)}S._rectangle=new d(F.longitude,F.latitude,B.longitude,B.latitude)}S._rectangle.west<O.rectangle.west&&(S._rectangle.west=O.rectangle.west),S._rectangle.east>O.rectangle.east&&(S._rectangle.east=O.rectangle.east),S._rectangle.south<O.rectangle.south&&(S._rectangle.south=O.rectangle.south),S._rectangle.north>O.rectangle.north&&(S._rectangle.north=O.rectangle.north);var k=O.positionToTileXY(d.southwest(S._rectangle),S._minimumLevel),z=O.positionToTileXY(d.northeast(S._rectangle),S._minimumLevel),U=(Math.abs(z.x-k.x)+1)*(Math.abs(z.y-k.y)+1);U>4&&(S._minimumLevel=0),S._tilingScheme=O,S._ready=!0,S._readyPromise.resolve(!0)}function g(e){S._fileExtension=r(o.fileExtension,"png"),S._tileWidth=r(o.tileWidth,256),S._tileHeight=r(o.tileHeight,256),S._minimumLevel=r(o.minimumLevel,0),S._maximumLevel=o.maximumLevel,S._tilingScheme=n(o.tilingScheme)?o.tilingScheme:new f({ellipsoid:o.ellipsoid}),S._rectangle=r(o.rectangle,S._tilingScheme.rectangle),S._ready=!0,S._readyPromise.resolve(!0)}function _(){var e=c(y,"tilemapresource.xml"),t=S._proxy;n(t)&&(e=t.getURL(e)),v(h(e),s,g)}a("TileMapServiceImageryProvider","Scene/TileMapServiceImageryProvider is deprecated. Use Scene/createTileMapServiceImageryProvider instead."),o=r(o,{});var y=o.url;this._url=y,this._ready=!1,this._readyPromise=v.defer(),this._proxy=o.proxy,this._tileDiscardPolicy=o.tileDiscardPolicy,this._errorEvent=new l,this._fileExtension=o.fileExtension,this._tileWidth=o.tileWidth,this._tileHeight=o.tileHeight, +this._minimumLevel=o.minimumLevel,this._maximumLevel=o.maximumLevel,this._rectangle=d.clone(o.rectangle),this._tilingScheme=o.tilingScheme;var C=o.credit;"string"==typeof C&&(C=new i(C)),this._credit=C;var E,S=this;_()}function y(e,t,i,r){var o=e._tilingScheme.getNumberOfYTilesAtLevel(r),a=c(e._url,r+"/"+t+"/"+(o-i-1)+"."+e._fileExtension),s=e._proxy;return n(s)&&(a=s.getURL(a)),a}return o(_.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),_.prototype.getTileCredits=function(e,t,i){},_.prototype.requestImage=function(e,t,i){var r=y(this,e,t,i);return g.loadImage(this,r)},_.prototype.pickFeatures=function(){},_}),i("Scene/TileState",["../Core/freezeObject"],function(e){"use strict";var t={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};return e(t)}),i("Shaders/ViewportQuadFS",[],function(){"use strict";return"varying vec2 v_textureCoordinates;\nvoid main()\n{\nczm_materialInput materialInput;\nmaterialInput.s = v_textureCoordinates.s;\nmaterialInput.st = v_textureCoordinates;\nmaterialInput.str = vec3(v_textureCoordinates, 0.0);\nmaterialInput.normalEC = vec3(0.0, 0.0, -1.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n}\n"}),i("Scene/ViewportQuad",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Renderer/RenderState","../Renderer/ShaderSource","../Shaders/ViewportQuadFS","./BlendingState","./Material","./Pass"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(r,n){this.show=!0,i(r)||(r=new e),this.rectangle=e.clone(r),i(n)||(n=u.fromType(u.ColorType,{color:new t(1,1,1,1)})),this.material=n,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}return h.prototype.update=function(t){if(this.show){var r=this._rs;i(r)&&e.equals(r.viewport,this.rectangle)||(this._rs=o.fromCache({blending:l.ALPHA_BLEND,viewport:this.rectangle}));var n=t.passes;if(n.render){var u=t.context;if(this._material!==this.material||!i(this._overlayCommand)){this._material=this.material,i(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();var h=new a({sources:[this._material.shaderSource,s]});this._overlayCommand=u.createViewportQuadCommand(h,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=c.OVERLAY}this._material.update(u),this._overlayCommand.uniformMap=this._material._uniforms,t.commandList.push(this._overlayCommand)}}},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){return i(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),r(this)},h}),i("Scene/WebMapServiceImageryProvider",["../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/freezeObject","../Core/GeographicTilingScheme","../Core/objectToQuery","../Core/queryToObject","../Core/WebMercatorTilingScheme","../ThirdParty/Uri","./GetFeatureInfoFormat","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function m(r){function n(e,t){i(f[e])||(f[e]=t),i(_)&&!i(_[e])&&(_[e]=t)}r=t(r,t.EMPTY_OBJECT),this._url=r.url,this._layers=r.layers;var o=t(r.getFeatureInfoFormats,m.DefaultGetFeatureInfoFormats),h=new c(r.url),f=l(t(h.query,"")),v=e(p(t(r.parameters,t.EMPTY_OBJECT)),m.DefaultParameters);f=e(v,f);var g,_;g=new c(r.url),_=l(t(g.query,""));var y=e(p(t(r.getFeatureInfoParameters,t.EMPTY_OBJECT)),m.GetFeatureInfoDefaultParameters);_=e(y,_),n("layers",r.layers),n("srs",r.tilingScheme instanceof u?"EPSG:3857":"EPSG:4326"),n("bbox","{westProjected},{southProjected},{eastProjected},{northProjected}"),n("width","{width}"),n("height","{height}"),h.query=s(f);var C,E=h.toString().replace(/%7B/g,"{").replace(/%7D/g,"}");i(_)&&(i(_.query_layers)||(_.query_layers=r.layers),i(_.x)||(_.x="{i}"),i(_.y)||(_.y="{j}"),i(_.info_format)||(_.info_format="{format}"),g.query=s(_),C=g.toString().replace(/%7B/g,"{").replace(/%7D/g,"}")),this._tileProvider=new d({url:E,pickFeaturesUrl:C,tilingScheme:t(r.tilingScheme,new a({ellipsoid:r.ellipsoid})),rectangle:r.rectangle,tileWidth:r.tileWidth,tileHeight:r.tileHeight,minimumLevel:r.minimumLevel,maximumLevel:r.maximumLevel,proxy:r.proxy,subdomains:r.subdomains,tileDiscardPolicy:r.tileDiscardPolicy,credit:r.credit,getFeatureInfoFormats:o,enablePickFeatures:r.enablePickFeatures,withCredentials:r.withCredentials,headers:r.headers})}function p(e){var t={};for(var i in e)e.hasOwnProperty(i)&&(t[i.toLowerCase()]=e[i]);return t}return r(m.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._tileProvider.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},ready:{get:function(){return this._tileProvider.ready}},readyPromise:{get:function(){return this._tileProvider.readyPromise}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}}}),m.prototype.getTileCredits=function(e,t,i){return this._tileProvider.getTileCredits(e,t,i)},m.prototype.requestImage=function(e,t,i){return this._tileProvider.requestImage(e,t,i)},m.prototype.pickFeatures=function(e,t,i,r,n){return this._tileProvider.pickFeatures(e,t,i,r,n)},m.DefaultParameters=o({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"}),m.GetFeatureInfoDefaultParameters=o({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"}),m.DefaultGetFeatureInfoFormats=o([o(new h("json","application/json")),o(new h("xml","text/xml")),o(new h("text","text/html"))]),m}),i("Scene/WebMapTileServiceImageryProvider",["../Core/combine","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/freezeObject","../Core/objectToQuery","../Core/queryToObject","../Core/Rectangle","../Core/WebMercatorTilingScheme","../ThirdParty/Uri","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(e){if(e=i(e,i.EMPTY_OBJECT),!r(e.url))throw new o("options.url is required.");if(!r(e.layer))throw new o("options.layer is required.");if(!r(e.style))throw new o("options.style is required.");if(!r(e.tileMatrixSetID))throw new o("options.tileMatrixSetID is required.");this._url=e.url,this._layer=e.layer,this._style=e.style,this._tileMatrixSetID=e.tileMatrixSetID,this._tileMatrixLabels=e.tileMatrixLabels,this._format=i(e.format,"image/jpeg"),this._proxy=e.proxy,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=r(e.tilingScheme)?e.tilingScheme:new h({ellipsoid:e.ellipsoid}),this._tileWidth=i(e.tileWidth,256),this._tileHeight=i(e.tileHeight,256),this._minimumLevel=i(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=i(e.rectangle,this._tilingScheme.rectangle),this._readyPromise=m.resolve(!0),this._headers=i(e.headers,void 0),this._withCredentials=i(e.withCredentials,void 0);var n=this._tilingScheme.positionToTileXY(c.southwest(this._rectangle),this._minimumLevel),s=this._tilingScheme.positionToTileXY(c.northeast(this._rectangle),this._minimumLevel),l=(Math.abs(s.x-n.x)+1)*(Math.abs(s.y-n.y)+1);if(l>4)throw new o("The imagery provider's rectangle and minimumLevel indicate that there are "+l+" tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.");this._errorEvent=new a;var u=e.credit;this._credit="string"==typeof u?new t(u):u,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():r(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function v(t,n,o,a){var s,c=t._tileMatrixLabels,h=r(c)?c[a]:a.toString(),m=t._subdomains;if(t._url.indexOf("{")>=0)s=t._url.replace("{style}",t._style).replace("{Style}",t._style).replace("{TileMatrixSet}",t._tileMatrixSetID).replace("{TileMatrix}",h).replace("{TileRow}",o.toString()).replace("{TileCol}",n.toString()).replace("{s}",m[(n+o+a)%m.length]);else{var p=new d(t._url),f=u(i(p.query,""));f=e(g,f),f.tilematrix=h,f.layer=t._layer,f.style=t._style,f.tilerow=o,f.tilecol=n,f.tilematrixset=t._tileMatrixSetID,f.format=t._format,p.query=l(f),s=p.toString()}var v=t._proxy;return r(v)&&(s=v.getURL(s)),s}var g=s({service:"WMTS",version:"1.0.0",request:"GetTile"});return n(f.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},ready:{value:!0},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},headers:{get:function(){return this._headers}},withCredentials:{get:function(){return this._withCredentials}}}),f.prototype.getTileCredits=function(e,t,i){},f.prototype.requestImage=function(e,t,i){var r=v(this,e,t,i);return p.loadImage(this,r)},f.prototype.pickFeatures=function(){},f}),function(){!function(e){var r=this||(0,eval)("this"),n=r.document,o=r.navigator,a=r.jQuery,s=r.JSON;!function(e){"function"==typeof t&&"object"==typeof exports&&"object"==typeof module?e(module.exports||exports,t):"function"==typeof i&&i.amd?i("ThirdParty/knockout-3.2.0",["exports","require"],e):e(r.ko={})}(function(t,i){function l(e,t){return null===e||typeof e in m?e===t:!1}function u(t,i){var r;return function(){r||(r=setTimeout(function(){r=e,t()},i))}}function c(e,t){var i;return function(){clearTimeout(i),i=setTimeout(e,t)}}function h(e,t,i,r){d.d[e]={init:function(e,n,o,a,s){var l,u;return d.s(function(){var o=d.a.c(n()),a=!i!=!o,c=!u;(c||t||a!==l)&&(c&&d.Y.la()&&(u=d.a.ia(d.f.childNodes(e),!0)),a?(c||d.f.T(e,d.a.ia(u)),d.Ca(r?r(s,o):s,e)):d.f.ja(e),l=a)},null,{o:e}),{controlsDescendantBindings:!0}}},d.h.ha[e]=!1,d.f.Q[e]=!0}var d="undefined"!=typeof t?t:{};d.b=function(e,t){for(var i=e.split("."),r=d,n=0;n<i.length-1;n++)r=r[i[n]];r[i[i.length-1]]=t},d.A=function(e,t,i){e[t]=i},d.version="3.2.0",d.b("version",d.version),d.a=function(){function t(e,t){for(var i in e)e.hasOwnProperty(i)&&t(i,e[i])}function i(e,t){if(t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function l(e,t){return e.__proto__=t,e}var u={__proto__:[]}instanceof Array,c={},h={};c[o&&/Firefox\/2/i.test(o.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],c.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),t(c,function(e,t){if(t.length)for(var i=0,r=t.length;r>i;i++)h[t[i]]=e});var m={propertychange:!0},p=n&&function(){for(var t=3,i=n.createElement("div"),r=i.getElementsByTagName("i");i.innerHTML="<!--[if gt IE "+ ++t+"]><i></i><![endif]-->",r[0];);return t>4?t:e}();return{vb:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],u:function(e,t){for(var i=0,r=e.length;r>i;i++)t(e[i],i)},m:function(e,t){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(e,t);for(var i=0,r=e.length;r>i;i++)if(e[i]===t)return i;return-1},qb:function(e,t,i){for(var r=0,n=e.length;n>r;r++)if(t.call(i,e[r],r))return e[r];return null},ua:function(e,t){var i=d.a.m(e,t);i>0?e.splice(i,1):0===i&&e.shift()},rb:function(e){e=e||[];for(var t=[],i=0,r=e.length;r>i;i++)0>d.a.m(t,e[i])&&t.push(e[i]);return t},Da:function(e,t){e=e||[];for(var i=[],r=0,n=e.length;n>r;r++)i.push(t(e[r],r));return i},ta:function(e,t){e=e||[];for(var i=[],r=0,n=e.length;n>r;r++)t(e[r],r)&&i.push(e[r]);return i},ga:function(e,t){if(t instanceof Array)e.push.apply(e,t);else for(var i=0,r=t.length;r>i;i++)e.push(t[i]);return e},ea:function(e,t,i){var r=d.a.m(d.a.Xa(e),t);0>r?i&&e.push(t):i||e.splice(r,1)},xa:u,extend:i,za:l,Aa:u?l:i,G:t,na:function(e,t){if(!e)return e;var i,r={};for(i in e)e.hasOwnProperty(i)&&(r[i]=t(e[i],i,e));return r},Ka:function(e){for(;e.firstChild;)d.removeNode(e.firstChild)},oc:function(e){e=d.a.S(e);for(var t=n.createElement("div"),i=0,r=e.length;r>i;i++)t.appendChild(d.R(e[i]));return t},ia:function(e,t){for(var i=0,r=e.length,n=[];r>i;i++){var o=e[i].cloneNode(!0);n.push(t?d.R(o):o)}return n},T:function(e,t){if(d.a.Ka(e),t)for(var i=0,r=t.length;r>i;i++)e.appendChild(t[i])},Lb:function(e,t){var i=e.nodeType?[e]:e;if(0<i.length){for(var r=i[0],n=r.parentNode,o=0,a=t.length;a>o;o++)n.insertBefore(t[o],r);for(o=0,a=i.length;a>o;o++)d.removeNode(i[o])}},ka:function(e,t){if(e.length){for(t=8===t.nodeType&&t.parentNode||t;e.length&&e[0].parentNode!==t;)e.shift();if(1<e.length){var i=e[0],r=e[e.length-1];for(e.length=0;i!==r;)if(e.push(i),i=i.nextSibling,!i)return;e.push(r)}}return e},Nb:function(e,t){7>p?e.setAttribute("selected",t):e.selected=t},cb:function(t){return null===t||t===e?"":t.trim?t.trim():t.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},vc:function(e,t){return e=e||"",t.length>e.length?!1:e.substring(0,t.length)===t},cc:function(e,t){if(e===t)return!0;if(11===e.nodeType)return!1;if(t.contains)return t.contains(3===e.nodeType?e.parentNode:e);if(t.compareDocumentPosition)return 16==(16&t.compareDocumentPosition(e));for(;e&&e!=t;)e=e.parentNode;return!!e},Ja:function(e){return d.a.cc(e,e.ownerDocument.documentElement)},ob:function(e){return!!d.a.qb(e,d.a.Ja)},t:function(e){return e&&e.tagName&&e.tagName.toLowerCase()},n:function(e,t,i){var r=p&&m[t];if(!r&&a)a(e).bind(t,i);else if(r||"function"!=typeof e.addEventListener){if("undefined"==typeof e.attachEvent)throw Error("Browser doesn't support addEventListener or attachEvent");var n=function(t){i.call(e,t)},o="on"+t;e.attachEvent(o,n),d.a.w.da(e,function(){e.detachEvent(o,n)})}else e.addEventListener(t,i,!1)},oa:function(e,t){if(!e||!e.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var i;if("input"===d.a.t(e)&&e.type&&"click"==t.toLowerCase()?(i=e.type,i="checkbox"==i||"radio"==i):i=!1,a&&!i)a(e).trigger(t);else if("function"==typeof n.createEvent){if("function"!=typeof e.dispatchEvent)throw Error("The supplied element doesn't support dispatchEvent");i=n.createEvent(h[t]||"HTMLEvents"),i.initEvent(t,!0,!0,r,0,0,0,0,0,!1,!1,!1,!1,0,e),e.dispatchEvent(i)}else if(i&&e.click)e.click();else{if("undefined"==typeof e.fireEvent)throw Error("Browser doesn't support triggering events");e.fireEvent("on"+t)}},c:function(e){return d.C(e)?e():e},Xa:function(e){return d.C(e)?e.v():e},Ba:function(e,t,i){if(t){var r=/\S+/g,n=e.className.match(r)||[];d.a.u(t.match(r),function(e){d.a.ea(n,e,i)}),e.className=n.join(" ")}},bb:function(t,i){var r=d.a.c(i);(null===r||r===e)&&(r="");var n=d.f.firstChild(t);!n||3!=n.nodeType||d.f.nextSibling(n)?d.f.T(t,[t.ownerDocument.createTextNode(r)]):n.data=r,d.a.fc(t)},Mb:function(e,t){if(e.name=t,7>=p)try{e.mergeAttributes(n.createElement("<input name='"+e.name+"'/>"),!1)}catch(i){}},fc:function(e){p>=9&&(e=1==e.nodeType?e:e.parentNode,e.style&&(e.style.zoom=e.style.zoom))},dc:function(e){if(p){var t=e.style.width;e.style.width=0,e.style.width=t}},sc:function(e,t){e=d.a.c(e),t=d.a.c(t);for(var i=[],r=e;t>=r;r++)i.push(r);return i},S:function(e){for(var t=[],i=0,r=e.length;r>i;i++)t.push(e[i]);return t},yc:6===p,zc:7===p,L:p,xb:function(e,t){for(var i=d.a.S(e.getElementsByTagName("input")).concat(d.a.S(e.getElementsByTagName("textarea"))),r="string"==typeof t?function(e){return e.name===t}:function(e){return t.test(e.name)},n=[],o=i.length-1;o>=0;o--)r(i[o])&&n.push(i[o]);return n},pc:function(e){return"string"==typeof e&&(e=d.a.cb(e))?s&&s.parse?s.parse(e):new Function("return "+e)():null},eb:function(e,t,i){if(!s||!s.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return s.stringify(d.a.c(e),t,i)},qc:function(e,i,r){r=r||{};var o=r.params||{},a=r.includeFields||this.vb,s=e;if("object"==typeof e&&"form"===d.a.t(e))for(var s=e.action,l=a.length-1;l>=0;l--)for(var u=d.a.xb(e,a[l]),c=u.length-1;c>=0;c--)o[u[c].name]=u[c].value;i=d.a.c(i);var h=n.createElement("form");h.style.display="none",h.action=s,h.method="post";for(var m in i)e=n.createElement("input"),e.type="hidden",e.name=m,e.value=d.a.eb(d.a.c(i[m])),h.appendChild(e);t(o,function(e,t){var i=n.createElement("input");i.type="hidden",i.name=e,i.value=t,h.appendChild(i)}),n.body.appendChild(h),r.submitter?r.submitter(h):h.submit(),setTimeout(function(){h.parentNode.removeChild(h)},0)}}}(),d.b("utils",d.a),d.b("utils.arrayForEach",d.a.u),d.b("utils.arrayFirst",d.a.qb),d.b("utils.arrayFilter",d.a.ta),d.b("utils.arrayGetDistinctValues",d.a.rb),d.b("utils.arrayIndexOf",d.a.m),d.b("utils.arrayMap",d.a.Da),d.b("utils.arrayPushAll",d.a.ga),d.b("utils.arrayRemoveItem",d.a.ua),d.b("utils.extend",d.a.extend),d.b("utils.fieldsIncludedWithJsonPost",d.a.vb),d.b("utils.getFormFields",d.a.xb),d.b("utils.peekObservable",d.a.Xa),d.b("utils.postJson",d.a.qc),d.b("utils.parseJson",d.a.pc),d.b("utils.registerEventHandler",d.a.n),d.b("utils.stringifyJson",d.a.eb),d.b("utils.range",d.a.sc),d.b("utils.toggleDomNodeCssClass",d.a.Ba),d.b("utils.triggerEvent",d.a.oa),d.b("utils.unwrapObservable",d.a.c),d.b("utils.objectForEach",d.a.G),d.b("utils.addOrRemoveItem",d.a.ea),d.b("unwrap",d.a.c),Function.prototype.bind||(Function.prototype.bind=function(e){var t=this,i=Array.prototype.slice.call(arguments);return e=i.shift(),function(){return t.apply(e,i.concat(Array.prototype.slice.call(arguments)))}}),d.a.e=new function(){function t(t,o){var a=t[r];if(!a||"null"===a||!n[a]){if(!o)return e;a=t[r]="ko"+i++,n[a]={}}return n[a]}var i=0,r="__ko__"+(new Date).getTime(),n={};return{get:function(i,r){var n=t(i,!1);return n===e?e:n[r]},set:function(i,r,n){(n!==e||t(i,!1)!==e)&&(t(i,!0)[r]=n)},clear:function(e){var t=e[r];return t?(delete n[t],e[r]=null,!0):!1},F:function(){return i++ +r}}},d.b("utils.domData",d.a.e),d.b("utils.domData.clear",d.a.e.clear),d.a.w=new function(){function t(t,i){var n=d.a.e.get(t,r);return n===e&&i&&(n=[],d.a.e.set(t,r,n)),n}function i(e){var r=t(e,!1);if(r)for(var r=r.slice(0),n=0;n<r.length;n++)r[n](e);if(d.a.e.clear(e),d.a.w.cleanExternalData(e),o[e.nodeType])for(r=e.firstChild;e=r;)r=e.nextSibling,8===e.nodeType&&i(e)}var r=d.a.e.F(),n={1:!0,8:!0,9:!0},o={1:!0,9:!0};return{da:function(e,i){if("function"!=typeof i)throw Error("Callback must be a function");t(e,!0).push(i)},Kb:function(i,n){var o=t(i,!1);o&&(d.a.ua(o,n),0==o.length&&d.a.e.set(i,r,e))},R:function(e){if(n[e.nodeType]&&(i(e),o[e.nodeType])){var t=[];d.a.ga(t,e.getElementsByTagName("*"));for(var r=0,a=t.length;a>r;r++)i(t[r])}return e},removeNode:function(e){d.R(e),e.parentNode&&e.parentNode.removeChild(e)},cleanExternalData:function(e){a&&"function"==typeof a.cleanData&&a.cleanData([e])}}},d.R=d.a.w.R,d.removeNode=d.a.w.removeNode,d.b("cleanNode",d.R),d.b("removeNode",d.removeNode),d.b("utils.domNodeDisposal",d.a.w),d.b("utils.domNodeDisposal.addDisposeCallback",d.a.w.da),d.b("utils.domNodeDisposal.removeDisposeCallback",d.a.w.Kb),function(){d.a.ba=function(e){var t;if(a){if(a.parseHTML)t=a.parseHTML(e)||[];else if((t=a.clean([e]))&&t[0]){for(e=t[0];e.parentNode&&11!==e.parentNode.nodeType;)e=e.parentNode;e.parentNode&&e.parentNode.removeChild(e)}}else{var i=d.a.cb(e).toLowerCase();for(t=n.createElement("div"),i=i.match(/^<(thead|tbody|tfoot)/)&&[1,"<table>","</table>"]||!i.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!i.indexOf("<td")||!i.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||[0,"",""],e="ignored<div>"+i[1]+e+i[2]+"</div>","function"==typeof r.innerShiv?t.appendChild(r.innerShiv(e)):t.innerHTML=e;i[0]--;)t=t.lastChild;t=d.a.S(t.lastChild.childNodes)}return t},d.a.$a=function(t,i){if(d.a.Ka(t),i=d.a.c(i),null!==i&&i!==e)if("string"!=typeof i&&(i=i.toString()),a)a(t).html(i);else for(var r=d.a.ba(i),n=0;n<r.length;n++)t.appendChild(r[n])}}(),d.b("utils.parseHtmlFragment",d.a.ba),d.b("utils.setHtml",d.a.$a),d.D=function(){function t(e,i){if(e)if(8==e.nodeType){var r=d.D.Gb(e.nodeValue);null!=r&&i.push({bc:e,mc:r})}else if(1==e.nodeType)for(var r=0,n=e.childNodes,o=n.length;o>r;r++)t(n[r],i)}var i={};return{Ua:function(e){if("function"!=typeof e)throw Error("You can only pass a function to ko.memoization.memoize()");var t=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return i[t]=e,"<!--[ko_memo:"+t+"]-->"},Rb:function(t,r){var n=i[t];if(n===e)throw Error("Couldn't find any memo with ID "+t+". Perhaps it's already been unmemoized.");try{return n.apply(null,r||[]),!0}finally{delete i[t]}},Sb:function(e,i){var r=[];t(e,r);for(var n=0,o=r.length;o>n;n++){var a=r[n].bc,s=[a];i&&d.a.ga(s,i),d.D.Rb(r[n].mc,s),a.nodeValue="",a.parentNode&&a.parentNode.removeChild(a)}},Gb:function(e){return(e=e.match(/^\[ko_memo\:(.*?)\]$/))?e[1]:null}}}(),d.b("memoization",d.D),d.b("memoization.memoize",d.D.Ua),d.b("memoization.unmemoize",d.D.Rb),d.b("memoization.parseMemoText",d.D.Gb),d.b("memoization.unmemoizeDomNodeAndDescendants",d.D.Sb),d.La={throttle:function(e,t){e.throttleEvaluation=t;var i=null;return d.j({read:e,write:function(r){clearTimeout(i),i=setTimeout(function(){e(r)},t)}})},rateLimit:function(e,t){var i,r,n;"number"==typeof t?i=t:(i=t.timeout,r=t.method),n="notifyWhenChangesStop"==r?c:u,e.Ta(function(e){return n(e,i)})},notify:function(e,t){e.equalityComparer="always"==t?null:l}};var m={undefined:1,"boolean":1,number:1,string:1};d.b("extenders",d.La),d.Pb=function(e,t,i){this.target=e,this.wa=t,this.ac=i,this.Cb=!1,d.A(this,"dispose",this.K)},d.Pb.prototype.K=function(){this.Cb=!0,this.ac()},d.P=function(){d.a.Aa(this,d.P.fn),this.M={}};var p="change",f={U:function(e,t,i){var r=this;i=i||p;var n=new d.Pb(r,t?e.bind(t):e,function(){d.a.ua(r.M[i],n),r.nb&&r.nb()});return r.va&&r.va(i),r.M[i]||(r.M[i]=[]),r.M[i].push(n),n},notifySubscribers:function(e,t){if(t=t||p,this.Ab(t))try{d.k.Ea();for(var i,r=this.M[t].slice(0),n=0;i=r[n];++n)i.Cb||i.wa(e)}finally{d.k.end()}},Ta:function(e){var t,i,r,n=this,o=d.C(n);n.qa||(n.qa=n.notifySubscribers,n.notifySubscribers=function(e,t){t&&t!==p?"beforeChange"===t?n.kb(e):n.qa(e,t):n.lb(e)});var a=e(function(){o&&r===n&&(r=n()),t=!1,n.Pa(i,r)&&n.qa(i=r)});n.lb=function(e){t=!0,r=e,a()},n.kb=function(e){t||(i=e,n.qa(e,"beforeChange"))}},Ab:function(e){return this.M[e]&&this.M[e].length},yb:function(){var e=0;return d.a.G(this.M,function(t,i){e+=i.length}),e},Pa:function(e,t){return!this.equalityComparer||!this.equalityComparer(e,t)},extend:function(e){var t=this;return e&&d.a.G(e,function(e,i){var r=d.La[e];"function"==typeof r&&(t=r(t,i)||t)}),t}};d.A(f,"subscribe",f.U),d.A(f,"extend",f.extend),d.A(f,"getSubscriptionsCount",f.yb),d.a.xa&&d.a.za(f,Function.prototype),d.P.fn=f,d.Db=function(e){return null!=e&&"function"==typeof e.U&&"function"==typeof e.notifySubscribers},d.b("subscribable",d.P),d.b("isSubscribable",d.Db),d.Y=d.k=function(){function e(e){r.push(i),i=e}function t(){i=r.pop()}var i,r=[],n=0;return{Ea:e,end:t,Jb:function(e){if(i){if(!d.Db(e))throw Error("Only subscribable things can act as dependencies");i.wa(e,e.Vb||(e.Vb=++n))}},B:function(i,r,n){try{return e(),i.apply(r,n||[])}finally{t()}},la:function(){return i?i.s.la():void 0},ma:function(){return i?i.ma:void 0}}}(),d.b("computedContext",d.Y),d.b("computedContext.getDependenciesCount",d.Y.la),d.b("computedContext.isInitial",d.Y.ma),d.b("computedContext.isSleeping",d.Y.Ac),d.p=function(e){function t(){return 0<arguments.length?(t.Pa(i,arguments[0])&&(t.X(),i=arguments[0],t.W()),this):(d.k.Jb(t),i)}var i=e;return d.P.call(t),d.a.Aa(t,d.p.fn),t.v=function(){return i},t.W=function(){t.notifySubscribers(i)},t.X=function(){t.notifySubscribers(i,"beforeChange")},d.A(t,"peek",t.v),d.A(t,"valueHasMutated",t.W),d.A(t,"valueWillMutate",t.X),t},d.p.fn={equalityComparer:l};var v=d.p.rc="__ko_proto__";d.p.fn[v]=d.p,d.a.xa&&d.a.za(d.p.fn,d.P.fn),d.Ma=function(t,i){return null===t||t===e||t[v]===e?!1:t[v]===i?!0:d.Ma(t[v],i)},d.C=function(e){return d.Ma(e,d.p)},d.Ra=function(e){return"function"==typeof e&&e[v]===d.p||"function"==typeof e&&e[v]===d.j&&e.hc?!0:!1},d.b("observable",d.p),d.b("isObservable",d.C),d.b("isWriteableObservable",d.Ra),d.b("isWritableObservable",d.Ra),d.aa=function(e){if(e=e||[],"object"!=typeof e||!("length"in e))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return e=d.p(e),d.a.Aa(e,d.aa.fn),e.extend({trackArrayChanges:!0})},d.aa.fn={remove:function(e){for(var t=this.v(),i=[],r="function"!=typeof e||d.C(e)?function(t){return t===e}:e,n=0;n<t.length;n++){var o=t[n];r(o)&&(0===i.length&&this.X(),i.push(o),t.splice(n,1),n--)}return i.length&&this.W(),i},removeAll:function(t){if(t===e){var i=this.v(),r=i.slice(0);return this.X(),i.splice(0,i.length),this.W(),r}return t?this.remove(function(e){return 0<=d.a.m(t,e)}):[]},destroy:function(e){var t=this.v(),i="function"!=typeof e||d.C(e)?function(t){return t===e}:e;this.X();for(var r=t.length-1;r>=0;r--)i(t[r])&&(t[r]._destroy=!0);this.W()},destroyAll:function(t){return t===e?this.destroy(function(){return!0}):t?this.destroy(function(e){return 0<=d.a.m(t,e)}):[]},indexOf:function(e){var t=this();return d.a.m(t,e)},replace:function(e,t){var i=this.indexOf(e);i>=0&&(this.X(),this.v()[i]=t,this.W())}},d.a.u("pop push reverse shift sort splice unshift".split(" "),function(e){d.aa.fn[e]=function(){var t=this.v();return this.X(),this.sb(t,e,arguments),t=t[e].apply(t,arguments),this.W(),t}}),d.a.u(["slice"],function(e){d.aa.fn[e]=function(){var t=this();return t[e].apply(t,arguments)}}),d.a.xa&&d.a.za(d.aa.fn,d.p.fn),d.b("observableArray",d.aa);var g="arrayChange";d.La.trackArrayChanges=function(e){function t(){if(!i){i=!0;var t=e.notifySubscribers;e.notifySubscribers=function(e,i){return i&&i!==p||++n,t.apply(this,arguments)};var o=[].concat(e.v()||[]);r=null,e.U(function(t){if(t=[].concat(t||[]),e.Ab(g)){var i;(!r||n>1)&&(r=d.a.Fa(o,t,{sparse:!0})),i=r,i.length&&e.notifySubscribers(i,g)}o=t,r=null,n=0})}}if(!e.sb){var i=!1,r=null,n=0,o=e.U;e.U=e.subscribe=function(e,i,r){return r===g&&t(),o.apply(this,arguments)},e.sb=function(e,t,o){function a(e,t,i){return s[s.length]={status:e,value:t,index:i}}if(i&&!n){var s=[],l=e.length,u=o.length,c=0;switch(t){case"push":c=l;case"unshift":for(t=0;u>t;t++)a("added",o[t],c+t);break;case"pop":c=l-1;case"shift":l&&a("deleted",e[c],c);break;case"splice":t=Math.min(Math.max(0,0>o[0]?l+o[0]:o[0]),l);for(var l=1===u?l:Math.min(t+(o[1]||0),l),u=t+u-2,c=Math.max(l,u),h=[],m=[],p=2;c>t;++t,++p)l>t&&m.push(a("deleted",e[t],t)),u>t&&h.push(a("added",o[p],t));d.a.wb(m,h);break;default:return}r=s}}}},d.s=d.j=function(t,i,r){function n(){d.a.G(x,function(e,t){t.K()}),x={}}function o(){n(),b=0,v=!0,m=!1}function a(){var e=l.throttleEvaluation;e&&e>=0?(clearTimeout(A),A=setTimeout(s,e)):l.ib?l.ib():s()}function s(t){if(p){if(_)throw Error("A 'pure' computed must not be called recursively")}else if(!v){if(w&&w()){if(!f)return void T()}else f=!1;if(p=!0,y)try{var r={};d.k.Ea({wa:function(e,t){r[t]||(r[t]=1,++b)},s:l,ma:e}),b=0,h=g.call(i)}finally{d.k.end(),p=!1}else try{var n=x,o=b;d.k.Ea({wa:function(e,t){v||(o&&n[t]?(x[t]=n[t],++b,delete n[t],--o):x[t]||(x[t]=e.U(a),++b))},s:l,ma:_?e:!b}),x={},b=0;try{var s=i?g.call(i):g()}finally{d.k.end(),o&&d.a.G(n,function(e,t){t.K()}),m=!1}l.Pa(h,s)&&(l.notifySubscribers(h,"beforeChange"),h=s,!0!==t&&l.notifySubscribers(h))}finally{p=!1}b||T()}}function l(){if(0<arguments.length){if("function"!=typeof C)throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return C.apply(i,arguments),this}return d.k.Jb(l),m&&s(!0),h}function u(){return m&&!b&&s(!0),h}function c(){return m||b>0}var h,m=!0,p=!1,f=!1,v=!1,g=t,_=!1,y=!1;if(g&&"object"==typeof g?(r=g,g=r.read):(r=r||{},g||(g=r.read)),"function"!=typeof g)throw Error("Pass a function that returns the value of the ko.computed");var C=r.write,E=r.disposeWhenNodeIsRemoved||r.o||null,S=r.disposeWhen||r.Ia,w=S,T=o,x={},b=0,A=null;i||(i=r.owner),d.P.call(l),d.a.Aa(l,d.j.fn),l.v=u,l.la=function(){return b},l.hc="function"==typeof r.write,l.K=function(){T()},l.Z=c;var P=l.Ta;return l.Ta=function(e){P.call(l,e),l.ib=function(){l.kb(h),m=!0,l.lb(l)}},r.pure?(y=_=!0,l.va=function(){y&&(y=!1,s(!0))},l.nb=function(){l.yb()||(n(),y=m=!0)}):r.deferEvaluation&&(l.va=function(){u(),delete l.va}),d.A(l,"peek",l.v),d.A(l,"dispose",l.K),d.A(l,"isActive",l.Z),d.A(l,"getDependenciesCount",l.la),E&&(f=!0,E.nodeType&&(w=function(){return!d.a.Ja(E)||S&&S()})),y||r.deferEvaluation||s(),E&&c()&&E.nodeType&&(T=function(){d.a.w.Kb(E,T),o()},d.a.w.da(E,T)),l},d.jc=function(e){return d.Ma(e,d.j)},f=d.p.rc,d.j[f]=d.p,d.j.fn={equalityComparer:l},d.j.fn[f]=d.j,d.a.xa&&d.a.za(d.j.fn,d.P.fn),d.b("dependentObservable",d.j),d.b("computed",d.j),d.b("isComputed",d.jc),d.Ib=function(e,t){return"function"==typeof e?d.s(e,t,{pure:!0}):(e=d.a.extend({},e),e.pure=!0,d.s(e,t))},d.b("pureComputed",d.Ib),function(){function t(n,o,a){if(a=a||new r,n=o(n),"object"!=typeof n||null===n||n===e||n instanceof Date||n instanceof String||n instanceof Number||n instanceof Boolean)return n;var s=n instanceof Array?[]:{};return a.save(n,s),i(n,function(i){var r=o(n[i]);switch(typeof r){case"boolean":case"number":case"string":case"function":s[i]=r;break;case"object":case"undefined":var l=a.get(r);s[i]=l!==e?l:t(r,o,a)}}),s}function i(e,t){if(e instanceof Array){for(var i=0;i<e.length;i++)t(i);"function"==typeof e.toJSON&&t("toJSON")}else for(i in e)t(i)}function r(){this.keys=[],this.hb=[]}d.Qb=function(e){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return t(e,function(e){for(var t=0;d.C(e)&&10>t;t++)e=e();return e})},d.toJSON=function(e,t,i){return e=d.Qb(e),d.a.eb(e,t,i)},r.prototype={save:function(e,t){var i=d.a.m(this.keys,e);i>=0?this.hb[i]=t:(this.keys.push(e),this.hb.push(t))},get:function(t){return t=d.a.m(this.keys,t),t>=0?this.hb[t]:e}}}(),d.b("toJS",d.Qb),d.b("toJSON",d.toJSON),function(){d.i={q:function(t){switch(d.a.t(t)){case"option":return!0===t.__ko__hasDomDataOptionValue__?d.a.e.get(t,d.d.options.Va):7>=d.a.L?t.getAttributeNode("value")&&t.getAttributeNode("value").specified?t.value:t.text:t.value; +case"select":return 0<=t.selectedIndex?d.i.q(t.options[t.selectedIndex]):e;default:return t.value}},ca:function(t,i,r){switch(d.a.t(t)){case"option":switch(typeof i){case"string":d.a.e.set(t,d.d.options.Va,e),"__ko__hasDomDataOptionValue__"in t&&delete t.__ko__hasDomDataOptionValue__,t.value=i;break;default:d.a.e.set(t,d.d.options.Va,i),t.__ko__hasDomDataOptionValue__=!0,t.value="number"==typeof i?i:""}break;case"select":(""===i||null===i)&&(i=e);for(var n,o=-1,a=0,s=t.options.length;s>a;++a)if(n=d.i.q(t.options[a]),n==i||""==n&&i===e){o=a;break}(r||o>=0||i===e&&1<t.size)&&(t.selectedIndex=o);break;default:(null===i||i===e)&&(i=""),t.value=i}}}}(),d.b("selectExtensions",d.i),d.b("selectExtensions.readValue",d.i.q),d.b("selectExtensions.writeValue",d.i.ca),d.h=function(){function e(e){e=d.a.cb(e),123===e.charCodeAt(0)&&(e=e.slice(1,-1));var t,i,a=[],s=e.match(r),l=0;if(s){s.push(",");for(var u,c=0;u=s[c];++c){var h=u.charCodeAt(0);if(44===h){if(0>=l){t&&a.push(i?{key:t,value:i.join("")}:{unknown:t}),t=i=l=0;continue}}else if(58===h){if(!i)continue}else if(47===h&&c&&1<u.length)(h=s[c-1].match(n))&&!o[h[0]]&&(e=e.substr(e.indexOf(u)+1),s=e.match(r),s.push(","),c=-1,u="/");else if(40===h||123===h||91===h)++l;else if(41===h||125===h||93===h)--l;else if(!t&&!i){t=34===h||39===h?u.slice(1,-1):u;continue}i?i.push(u):i=[u]}}return a}var t=["true","false","null","undefined"],i=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,r=RegExp("\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|/(?:[^/\\\\]|\\\\.)*/w*|[^\\s:,/][^,\"'{}()/:[\\]]*[^\\s,\"'{}()/:[\\]]|[^\\s]","g"),n=/[\])"'A-Za-z0-9_$]+$/,o={"in":1,"return":1,"typeof":1},a={};return{ha:[],V:a,Wa:e,ya:function(r,n){function o(e,r){var n;if(!c){var h=d.getBindingHandler(e);if(h&&h.preprocess&&!(r=h.preprocess(r,e,o)))return;(h=a[e])&&(n=r,0<=d.a.m(t,n)?n=!1:(h=n.match(i),n=null===h?!1:h[1]?"Object("+h[1]+")"+h[2]:n),h=n),h&&l.push("'"+e+"':function(_z){"+n+"=_z}")}u&&(r="function(){return "+r+" }"),s.push("'"+e+"':"+r)}n=n||{};var s=[],l=[],u=n.valueAccessors,c=n.bindingParams,h="string"==typeof r?e(r):r;return d.a.u(h,function(e){o(e.key||e.unknown,e.value)}),l.length&&o("_ko_property_writers","{"+l.join(",")+" }"),s.join(",")},lc:function(e,t){for(var i=0;i<e.length;i++)if(e[i].key==t)return!0;return!1},pa:function(e,t,i,r,n){e&&d.C(e)?!d.Ra(e)||n&&e.v()===r||e(r):(e=t.get("_ko_property_writers"))&&e[i]&&e[i](r)}}}(),d.b("expressionRewriting",d.h),d.b("expressionRewriting.bindingRewriteValidators",d.h.ha),d.b("expressionRewriting.parseObjectLiteral",d.h.Wa),d.b("expressionRewriting.preProcessBindings",d.h.ya),d.b("expressionRewriting._twoWayBindings",d.h.V),d.b("jsonExpressionRewriting",d.h),d.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",d.h.ya),function(){function e(e){return 8==e.nodeType&&a.test(o?e.text:e.nodeValue)}function t(e){return 8==e.nodeType&&s.test(o?e.text:e.nodeValue)}function i(i,r){for(var n=i,o=1,a=[];n=n.nextSibling;){if(t(n)&&(o--,0===o))return a;a.push(n),e(n)&&o++}if(!r)throw Error("Cannot find closing comment tag to match: "+i.nodeValue);return null}function r(e,t){var r=i(e,t);return r?0<r.length?r[r.length-1].nextSibling:e.nextSibling:null}var o=n&&"<!--test-->"===n.createComment("test").text,a=o?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,s=o?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,l={ul:!0,ol:!0};d.f={Q:{},childNodes:function(t){return e(t)?i(t):t.childNodes},ja:function(t){if(e(t)){t=d.f.childNodes(t);for(var i=0,r=t.length;r>i;i++)d.removeNode(t[i])}else d.a.Ka(t)},T:function(t,i){if(e(t)){d.f.ja(t);for(var r=t.nextSibling,n=0,o=i.length;o>n;n++)r.parentNode.insertBefore(i[n],r)}else d.a.T(t,i)},Hb:function(t,i){e(t)?t.parentNode.insertBefore(i,t.nextSibling):t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i)},Bb:function(t,i,r){r?e(t)?t.parentNode.insertBefore(i,r.nextSibling):r.nextSibling?t.insertBefore(i,r.nextSibling):t.appendChild(i):d.f.Hb(t,i)},firstChild:function(i){return e(i)?!i.nextSibling||t(i.nextSibling)?null:i.nextSibling:i.firstChild},nextSibling:function(i){return e(i)&&(i=r(i)),i.nextSibling&&t(i.nextSibling)?null:i.nextSibling},gc:e,xc:function(e){return(e=(o?e.text:e.nodeValue).match(a))?e[1]:null},Fb:function(i){if(l[d.a.t(i)]){var n=i.firstChild;if(n)do if(1===n.nodeType){var o;o=n.firstChild;var a=null;if(o)do if(a)a.push(o);else if(e(o)){var s=r(o,!0);s?o=s:a=[o]}else t(o)&&(a=[o]);while(o=o.nextSibling);if(o=a)for(a=n.nextSibling,s=0;s<o.length;s++)a?i.insertBefore(o[s],a):i.appendChild(o[s])}while(n=n.nextSibling)}}}}(),d.b("virtualElements",d.f),d.b("virtualElements.allowedBindings",d.f.Q),d.b("virtualElements.emptyNode",d.f.ja),d.b("virtualElements.insertAfter",d.f.Bb),d.b("virtualElements.prepend",d.f.Hb),d.b("virtualElements.setDomNodeChildren",d.f.T),function(){d.J=function(){this.Yb={}},d.a.extend(d.J.prototype,{nodeHasBindings:function(e){switch(e.nodeType){case 1:return null!=e.getAttribute("data-bind")||d.g.getComponentNameForNode(e);case 8:return d.f.gc(e);default:return!1}},getBindings:function(e,t){var i=this.getBindingsString(e,t),i=i?this.parseBindingsString(i,t,e):null;return d.g.mb(i,e,t,!1)},getBindingAccessors:function(e,t){var i=this.getBindingsString(e,t),i=i?this.parseBindingsString(i,t,e,{valueAccessors:!0}):null;return d.g.mb(i,e,t,!0)},getBindingsString:function(e){switch(e.nodeType){case 1:return e.getAttribute("data-bind");case 8:return d.f.xc(e);default:return null}},parseBindingsString:function(e,t,i,r){try{var n,o=this.Yb,a=e+(r&&r.valueAccessors||"");if(!(n=o[a])){var s,l="with($context){with($data||{}){return{"+d.h.ya(e,r)+"}}}";s=new Function("$context","$element",l),n=o[a]=s}return n(t,i)}catch(u){throw u.message="Unable to parse bindings.\nBindings value: "+e+"\nMessage: "+u.message,u}}}),d.J.instance=new d.J}(),d.b("bindingProvider",d.J),function(){function t(e){return function(){return e}}function i(e){return e()}function n(e){return d.a.na(d.k.B(e),function(t,i){return function(){return e()[i]}})}function o(e,t){return n(this.getBindings.bind(this,e,t))}function s(e,t,i){var r,n=d.f.firstChild(t),o=d.J.instance,a=o.preprocessNode;if(a){for(;r=n;)n=d.f.nextSibling(r),a.call(o,r);n=d.f.firstChild(t)}for(;r=n;)n=d.f.nextSibling(r),l(e,r,i)}function l(e,t,i){var r=!0,n=1===t.nodeType;n&&d.f.Fb(t),(n&&i||d.J.instance.nodeHasBindings(t))&&(r=c(t,null,e,i).shouldBindDescendants),r&&!m[d.a.t(t)]&&s(e,t,!n)}function u(e){var t=[],i={},r=[];return d.a.G(e,function n(o){if(!i[o]){var a=d.getBindingHandler(o);a&&(a.after&&(r.push(o),d.a.u(a.after,function(t){if(e[t]){if(-1!==d.a.m(r,t))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+r.join(", "));n(t)}}),r.length--),t.push({key:o,zb:a})),i[o]=!0}}),t}function c(t,r,n,a){var s=d.a.e.get(t,p);if(!r){if(s)throw Error("You cannot apply bindings multiple times to the same element.");d.a.e.set(t,p,!0)}!s&&a&&d.Ob(t,n);var l;if(r&&"function"!=typeof r)l=r;else{var c=d.J.instance,h=c.getBindingAccessors||o,m=d.j(function(){return(l=r?r(n,t):h.call(c,t,n))&&n.I&&n.I(),l},null,{o:t});l&&m.Z()||(m=null)}var f;if(l){var v=m?function(e){return function(){return i(m()[e])}}:function(e){return l[e]},g=function(){return d.a.na(m?m():l,i)};g.get=function(e){return l[e]&&i(v(e))},g.has=function(e){return e in l},a=u(l),d.a.u(a,function(i){var r=i.zb.init,o=i.zb.update,a=i.key;if(8===t.nodeType&&!d.f.Q[a])throw Error("The binding '"+a+"' cannot be used with virtual elements");try{"function"==typeof r&&d.k.B(function(){var i=r(t,v(a),g,n.$data,n);if(i&&i.controlsDescendantBindings){if(f!==e)throw Error("Multiple bindings ("+f+" and "+a+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");f=a}}),"function"==typeof o&&d.j(function(){o(t,v(a),g,n.$data,n)},null,{o:t})}catch(s){throw s.message='Unable to process binding "'+a+": "+l[a]+'"\nMessage: '+s.message,s}})}return{shouldBindDescendants:f===e}}function h(e){return e&&e instanceof d.N?e:new d.N(e)}d.d={};var m={script:!0};d.getBindingHandler=function(e){return d.d[e]},d.N=function(t,i,r,n){var o,a=this,s="function"==typeof t&&!d.C(t),l=d.j(function(){var e=s?t():t,o=d.a.c(e);return i?(i.I&&i.I(),d.a.extend(a,i),l&&(a.I=l)):(a.$parents=[],a.$root=o,a.ko=d),a.$rawData=e,a.$data=o,r&&(a[r]=o),n&&n(a,i,o),a.$data},null,{Ia:function(){return o&&!d.a.ob(o)},o:!0});l.Z()&&(a.I=l,l.equalityComparer=null,o=[],l.Tb=function(t){o.push(t),d.a.w.da(t,function(t){d.a.ua(o,t),o.length||(l.K(),a.I=l=e)})})},d.N.prototype.createChildContext=function(e,t,i){return new d.N(e,this,t,function(e,t){e.$parentContext=t,e.$parent=t.$data,e.$parents=(t.$parents||[]).slice(0),e.$parents.unshift(e.$parent),i&&i(e)})},d.N.prototype.extend=function(e){return new d.N(this.I||this.$data,this,null,function(t,i){t.$rawData=i.$rawData,d.a.extend(t,"function"==typeof e?e():e)})};var p=d.a.e.F(),f=d.a.e.F();d.Ob=function(e,t){return 2!=arguments.length?d.a.e.get(e,f):(d.a.e.set(e,f,t),void(t.I&&t.I.Tb(e)))},d.ra=function(e,t,i){return 1===e.nodeType&&d.f.Fb(e),c(e,t,h(i),!0)},d.Wb=function(e,i,r){return r=h(r),d.ra(e,"function"==typeof i?n(i.bind(null,r,e)):d.a.na(i,t),r)},d.Ca=function(e,t){1!==t.nodeType&&8!==t.nodeType||s(h(e),t,!0)},d.pb=function(e,t){if(!a&&r.jQuery&&(a=r.jQuery),t&&1!==t.nodeType&&8!==t.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");t=t||r.document.body,l(h(e),t,!0)},d.Ha=function(t){switch(t.nodeType){case 1:case 8:var i=d.Ob(t);if(i)return i;if(t.parentNode)return d.Ha(t.parentNode)}return e},d.$b=function(t){return(t=d.Ha(t))?t.$data:e},d.b("bindingHandlers",d.d),d.b("applyBindings",d.pb),d.b("applyBindingsToDescendants",d.Ca),d.b("applyBindingAccessorsToNode",d.ra),d.b("applyBindingsToNode",d.Wb),d.b("contextFor",d.Ha),d.b("dataFor",d.$b)}(),function(e){function t(t,r){var a,s=n.hasOwnProperty(t)?n[t]:e;s||(s=n[t]=new d.P,i(t,function(e){o[t]=e,delete n[t],a?s.notifySubscribers(e):setTimeout(function(){s.notifySubscribers(e)},0)}),a=!0),s.U(r)}function i(e,t){r("getConfig",[e],function(i){i?r("loadComponent",[e,i],function(e){t(e)}):t(null)})}function r(t,i,n,o){o||(o=d.g.loaders.slice(0));var a=o.shift();if(a){var s=a[t];if(s){var l=!1;if(s.apply(a,i.concat(function(e){l?n(null):null!==e?n(e):r(t,i,n,o)}))!==e&&(l=!0,!a.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else r(t,i,n,o)}else n(null)}var n={},o={};d.g={get:function(i,r){var n=o.hasOwnProperty(i)?o[i]:e;n?setTimeout(function(){r(n)},0):t(i,r)},tb:function(e){delete o[e]},jb:r},d.g.loaders=[],d.b("components",d.g),d.b("components.get",d.g.get),d.b("components.clearCachedDefinition",d.g.tb)}(),function(){function e(e,t,i,r){function n(){0===--a&&r(o)}var o={},a=2,l=i.template;i=i.viewModel,l?s(t,l,function(t){d.g.jb("loadTemplate",[e,t],function(e){o.template=e,n()})}):n(),i?s(t,i,function(t){d.g.jb("loadViewModel",[e,t],function(e){o[c]=e,n()})}):n()}function t(e,i,r){if("function"==typeof i)r(function(e){return new i(e)});else if("function"==typeof i[c])r(i[c]);else if("instance"in i){var n=i.instance;r(function(){return n})}else"viewModel"in i?t(e,i.viewModel,r):e("Unknown viewModel value: "+i)}function o(e){switch(d.a.t(e)){case"script":return d.a.ba(e.text);case"textarea":return d.a.ba(e.value);case"template":if(a(e.content))return d.a.ia(e.content.childNodes)}return d.a.ia(e.childNodes)}function a(e){return r.DocumentFragment?e instanceof DocumentFragment:e&&11===e.nodeType}function s(e,t,n){"string"==typeof t.require?i||r.require?(i||r.require)([t.require],n):e("Uses require, but no AMD loader is present"):n(t)}function l(e){return function(t){throw Error("Component '"+e+"': "+t)}}var u={};d.g.tc=function(e,t){if(!t)throw Error("Invalid configuration for "+e);if(d.g.Qa(e))throw Error("Component "+e+" is already registered");u[e]=t},d.g.Qa=function(e){return e in u},d.g.wc=function(e){delete u[e],d.g.tb(e)},d.g.ub={getConfig:function(e,t){t(u.hasOwnProperty(e)?u[e]:null)},loadComponent:function(t,i,r){var n=l(t);s(n,i,function(i){e(t,n,i,r)})},loadTemplate:function(e,t,i){if(e=l(e),"string"==typeof t)i(d.a.ba(t));else if(t instanceof Array)i(t);else if(a(t))i(d.a.S(t.childNodes));else if(t.element)if(t=t.element,r.HTMLElement?t instanceof HTMLElement:t&&t.tagName&&1===t.nodeType)i(o(t));else if("string"==typeof t){var s=n.getElementById(t);s?i(o(s)):e("Cannot find element with ID "+t)}else e("Unknown element type: "+t);else e("Unknown template value: "+t)},loadViewModel:function(e,i,r){t(l(e),i,r)}};var c="createViewModel";d.b("components.register",d.g.tc),d.b("components.isRegistered",d.g.Qa),d.b("components.unregister",d.g.wc),d.b("components.defaultLoader",d.g.ub),d.g.loaders.push(d.g.ub),d.g.Ub=u}(),function(){function e(e,i){var r=e.getAttribute("params");if(r){var r=t.parseBindingsString(r,i,e,{valueAccessors:!0,bindingParams:!0}),r=d.a.na(r,function(t){return d.s(t,null,{o:e})}),n=d.a.na(r,function(t){return t.Z()?d.s(function(){return d.a.c(t())},null,{o:e}):t.v()});return n.hasOwnProperty("$raw")||(n.$raw=r),n}return{$raw:{}}}d.g.getComponentNameForNode=function(e){return e=d.a.t(e),d.g.Qa(e)&&e},d.g.mb=function(t,i,r,n){if(1===i.nodeType){var o=d.g.getComponentNameForNode(i);if(o){if(t=t||{},t.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var a={name:o,params:e(i,r)};t.component=n?function(){return a}:a}}return t};var t=new d.J;9>d.a.L&&(d.g.register=function(e){return function(t){return n.createElement(t),e.apply(this,arguments)}}(d.g.register),n.createDocumentFragment=function(e){return function(){var t,i=e(),r=d.g.Ub;for(t in r)r.hasOwnProperty(t)&&i.createElement(t);return i}}(n.createDocumentFragment))}(),function(){var e=0;d.d.component={init:function(t,i,r,n,o){function a(){var e=s&&s.dispose;"function"==typeof e&&e.call(s),l=null}var s,l;return d.a.w.da(t,a),d.s(function(){var r,n,u=d.a.c(i());if("string"==typeof u?r=u:(r=d.a.c(u.name),n=d.a.c(u.params)),!r)throw Error("No component name specified");var c=l=++e;d.g.get(r,function(e){if(l===c){if(a(),!e)throw Error("Unknown component '"+r+"'");var i=e.template;if(!i)throw Error("Component '"+r+"' has no template");i=d.a.ia(i),d.f.T(t,i);var i=n,u=e.createViewModel;e=u?u.call(e,i,{element:t}):i,i=o.createChildContext(e),s=e,d.Ca(i,t)}})},null,{o:t}),{controlsDescendantBindings:!0}}},d.f.Q.component=!0}();var _={"class":"className","for":"htmlFor"};d.d.attr={update:function(t,i){var r=d.a.c(i())||{};d.a.G(r,function(i,r){r=d.a.c(r);var n=!1===r||null===r||r===e;n&&t.removeAttribute(i),8>=d.a.L&&i in _?(i=_[i],n?t.removeAttribute(i):t[i]=r):n||t.setAttribute(i,r.toString()),"name"===i&&d.a.Mb(t,n?"":r.toString())})}},function(){d.d.checked={after:["value","attr"],init:function(t,i,r){function n(){var e=t.checked,n=h?a():e;if(!d.Y.ma()&&(!l||e)){var o=d.k.B(i);u?c!==n?(e&&(d.a.ea(o,n,!0),d.a.ea(o,c,!1)),c=n):d.a.ea(o,n,e):d.h.pa(o,r,"checked",n,!0)}}function o(){var e=d.a.c(i());t.checked=u?0<=d.a.m(e,a()):s?e:a()===e}var a=d.Ib(function(){return r.has("checkedValue")?d.a.c(r.get("checkedValue")):r.has("value")?d.a.c(r.get("value")):t.value}),s="checkbox"==t.type,l="radio"==t.type;if(s||l){var u=s&&d.a.c(i())instanceof Array,c=u?a():e,h=l||u;l&&!t.name&&d.d.uniqueName.init(t,function(){return!0}),d.s(n,null,{o:t}),d.a.n(t,"click",n),d.s(o,null,{o:t})}}},d.h.V.checked=!0,d.d.checkedValue={update:function(e,t){e.value=d.a.c(t())}}}(),d.d.css={update:function(e,t){var i=d.a.c(t());"object"==typeof i?d.a.G(i,function(t,i){i=d.a.c(i),d.a.Ba(e,t,i)}):(i=String(i||""),d.a.Ba(e,e.__ko__cssValue,!1),e.__ko__cssValue=i,d.a.Ba(e,i,!0))}},d.d.enable={update:function(e,t){var i=d.a.c(t());i&&e.disabled?e.removeAttribute("disabled"):i||e.disabled||(e.disabled=!0)}},d.d.disable={update:function(e,t){d.d.enable.update(e,function(){return!d.a.c(t())})}},d.d.event={init:function(e,t,i,r,n){var o=t()||{};d.a.G(o,function(o){"string"==typeof o&&d.a.n(e,o,function(e){var a,s=t()[o];if(s){try{var l=d.a.S(arguments);r=n.$data,l.unshift(r),a=s.apply(r,l)}finally{!0!==a&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}!1===i.get(o+"Bubble")&&(e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation())}})})}},d.d.foreach={Eb:function(e){return function(){var t=e(),i=d.a.Xa(t);return i&&"number"!=typeof i.length?(d.a.c(t),{foreach:i.data,as:i.as,includeDestroyed:i.includeDestroyed,afterAdd:i.afterAdd,beforeRemove:i.beforeRemove,afterRender:i.afterRender,beforeMove:i.beforeMove,afterMove:i.afterMove,templateEngine:d.O.Oa}):{foreach:t,templateEngine:d.O.Oa}}},init:function(e,t){return d.d.template.init(e,d.d.foreach.Eb(t))},update:function(e,t,i,r,n){return d.d.template.update(e,d.d.foreach.Eb(t),i,r,n)}},d.h.ha.foreach=!1,d.f.Q.foreach=!0,d.d.hasfocus={init:function(e,t,i){function r(r){e.__ko_hasfocusUpdating=!0;var n=e.ownerDocument;if("activeElement"in n){var o;try{o=n.activeElement}catch(a){o=n.body}r=o===e}n=t(),d.h.pa(n,i,"hasfocus",r,!0),e.__ko_hasfocusLastValue=r,e.__ko_hasfocusUpdating=!1}var n=r.bind(null,!0),o=r.bind(null,!1);d.a.n(e,"focus",n),d.a.n(e,"focusin",n),d.a.n(e,"blur",o),d.a.n(e,"focusout",o)},update:function(e,t){var i=!!d.a.c(t());e.__ko_hasfocusUpdating||e.__ko_hasfocusLastValue===i||(i?e.focus():e.blur(),d.k.B(d.a.oa,null,[e,i?"focusin":"focusout"]))}},d.h.V.hasfocus=!0,d.d.hasFocus=d.d.hasfocus,d.h.V.hasFocus=!0,d.d.html={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){d.a.$a(e,t())}},h("if"),h("ifnot",!1,!0),h("with",!0,!1,function(e,t){return e.createChildContext(t)});var y={};d.d.options={init:function(e){if("select"!==d.a.t(e))throw Error("options binding applies only to SELECT elements");for(;0<e.length;)e.remove(0);return{controlsDescendantBindings:!0}},update:function(t,i,r){function n(){return d.a.ta(t.options,function(e){return e.selected})}function o(e,t,i){var r=typeof t;return"function"==r?t(e):"string"==r?e[t]:i}function a(e,i){if(h.length){var r=0<=d.a.m(h,d.i.q(i[0]));d.a.Nb(i[0],r),m&&!r&&d.k.B(d.a.oa,null,[t,"change"])}}var s=0!=t.length&&t.multiple?t.scrollTop:null,l=d.a.c(i()),u=r.get("optionsIncludeDestroyed");i={};var c,h;h=t.multiple?d.a.Da(n(),d.i.q):0<=t.selectedIndex?[d.i.q(t.options[t.selectedIndex])]:[],l&&("undefined"==typeof l.length&&(l=[l]),c=d.a.ta(l,function(t){return u||t===e||null===t||!d.a.c(t._destroy)}),r.has("optionsCaption")&&(l=d.a.c(r.get("optionsCaption")),null!==l&&l!==e&&c.unshift(y)));var m=!1;i.beforeRemove=function(e){t.removeChild(e)},l=a,r.has("optionsAfterRender")&&(l=function(t,i){a(0,i),d.k.B(r.get("optionsAfterRender"),null,[i[0],t!==y?t:e])}),d.a.Za(t,c,function(i,n,a){return a.length&&(h=a[0].selected?[d.i.q(a[0])]:[],m=!0),n=t.ownerDocument.createElement("option"),i===y?(d.a.bb(n,r.get("optionsCaption")),d.i.ca(n,e)):(a=o(i,r.get("optionsValue"),i),d.i.ca(n,d.a.c(a)),i=o(i,r.get("optionsText"),a),d.a.bb(n,i)),[n]},i,l),d.k.B(function(){r.get("valueAllowUnset")&&r.has("value")?d.i.ca(t,d.a.c(r.get("value")),!0):(t.multiple?h.length&&n().length<h.length:h.length&&0<=t.selectedIndex?d.i.q(t.options[t.selectedIndex])!==h[0]:h.length||0<=t.selectedIndex)&&d.a.oa(t,"change")}),d.a.dc(t),s&&20<Math.abs(s-t.scrollTop)&&(t.scrollTop=s)}},d.d.options.Va=d.a.e.F(),d.d.selectedOptions={after:["options","foreach"],init:function(e,t,i){d.a.n(e,"change",function(){var r=t(),n=[];d.a.u(e.getElementsByTagName("option"),function(e){e.selected&&n.push(d.i.q(e))}),d.h.pa(r,i,"selectedOptions",n)})},update:function(e,t){if("select"!=d.a.t(e))throw Error("values binding applies only to SELECT elements");var i=d.a.c(t());i&&"number"==typeof i.length&&d.a.u(e.getElementsByTagName("option"),function(e){var t=0<=d.a.m(i,d.i.q(e));d.a.Nb(e,t)})}},d.h.V.selectedOptions=!0,d.d.style={update:function(t,i){var r=d.a.c(i()||{});d.a.G(r,function(i,r){r=d.a.c(r),(null===r||r===e||!1===r)&&(r=""),t.style[i]=r})}},d.d.submit={init:function(e,t,i,r,n){if("function"!=typeof t())throw Error("The value for a submit binding must be a function");d.a.n(e,"submit",function(i){var r,o=t();try{r=o.call(n.$data,e)}finally{!0!==r&&(i.preventDefault?i.preventDefault():i.returnValue=!1)}})}},d.d.text={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){d.a.bb(e,t())}},d.f.Q.text=!0,function(){if(r&&r.navigator)var t=function(e){return e?parseFloat(e[1]):void 0},i=r.opera&&r.opera.version&&parseInt(r.opera.version()),n=r.navigator.userAgent,o=t(n.match(/^(?:(?!chrome).)*version\/([^ ]*) safari/i)),a=t(n.match(/Firefox\/([^ ]*)/));if(10>d.a.L)var s=d.a.e.F(),l=d.a.e.F(),u=function(e){var t=this.activeElement;(t=t&&d.a.e.get(t,l))&&t(e)},c=function(e,t){var i=e.ownerDocument;d.a.e.get(i,s)||(d.a.e.set(i,s,!0),d.a.n(i,"selectionchange",u)),d.a.e.set(e,l,t)};d.d.textInput={init:function(t,r,n){function s(e,i){d.a.n(t,e,i)}function l(){var i=d.a.c(r());(null===i||i===e)&&(i=""),p!==e&&i===p?setTimeout(l,4):t.value!==i&&(f=i,t.value=i)}function u(){m||(p=t.value,m=setTimeout(h,4))}function h(){clearTimeout(m),p=m=e;var i=t.value;f!==i&&(f=i,d.h.pa(r(),n,"textInput",i))}var m,p,f=t.value;10>d.a.L?(s("propertychange",function(e){"value"===e.propertyName&&h()}),8==d.a.L&&(s("keyup",h),s("keydown",h)),8<=d.a.L&&(c(t,h),s("dragend",u))):(s("input",h),5>o&&"textarea"===d.a.t(t)?(s("keydown",u),s("paste",u),s("cut",u)):11>i?s("keydown",u):4>a&&(s("DOMAutoComplete",h),s("dragdrop",h),s("drop",h))),s("change",h),d.s(l,null,{o:t})}},d.h.V.textInput=!0,d.d.textinput={preprocess:function(e,t,i){i("textInput",e)}}}(),d.d.uniqueName={init:function(e,t){if(t()){var i="ko_unique_"+ ++d.d.uniqueName.Zb;d.a.Mb(e,i)}}},d.d.uniqueName.Zb=0,d.d.value={after:["options","foreach"],init:function(e,t,i){if("input"!=e.tagName.toLowerCase()||"checkbox"!=e.type&&"radio"!=e.type){var r=["change"],n=i.get("valueUpdate"),o=!1,a=null;n&&("string"==typeof n&&(n=[n]),d.a.ga(r,n),r=d.a.rb(r));var s=function(){a=null,o=!1;var r=t(),n=d.i.q(e);d.h.pa(r,i,"value",n)};!d.a.L||"input"!=e.tagName.toLowerCase()||"text"!=e.type||"off"==e.autocomplete||e.form&&"off"==e.form.autocomplete||-1!=d.a.m(r,"propertychange")||(d.a.n(e,"propertychange",function(){o=!0}),d.a.n(e,"focus",function(){o=!1}),d.a.n(e,"blur",function(){o&&s()})),d.a.u(r,function(t){var i=s;d.a.vc(t,"after")&&(i=function(){a=d.i.q(e),setTimeout(s,0)},t=t.substring(5)),d.a.n(e,t,i)});var l=function(){var r=d.a.c(t()),n=d.i.q(e);if(null!==a&&r===a)setTimeout(l,0);else if(r!==n)if("select"===d.a.t(e)){var o=i.get("valueAllowUnset"),n=function(){d.i.ca(e,r,o)};n(),o||r===d.i.q(e)?setTimeout(n,0):d.k.B(d.a.oa,null,[e,"change"])}else d.i.ca(e,r)};d.s(l,null,{o:e})}else d.ra(e,{checkedValue:t})},update:function(){}},d.h.V.value=!0,d.d.visible={update:function(e,t){var i=d.a.c(t()),r="none"!=e.style.display;i&&!r?e.style.display="":!i&&r&&(e.style.display="none")}},function(e){d.d[e]={init:function(t,i,r,n,o){return d.d.event.init.call(this,t,function(){var t={};return t[e]=i(),t},r,n,o)}}}("click"),d.H=function(){},d.H.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},d.H.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},d.H.prototype.makeTemplateSource=function(e,t){if("string"==typeof e){t=t||n;var i=t.getElementById(e);if(!i)throw Error("Cannot find template with ID "+e);return new d.r.l(i)}if(1==e.nodeType||8==e.nodeType)return new d.r.fa(e);throw Error("Unknown template type: "+e)},d.H.prototype.renderTemplate=function(e,t,i,r){return e=this.makeTemplateSource(e,r),this.renderTemplateSource(e,t,i)},d.H.prototype.isTemplateRewritten=function(e,t){return!1===this.allowTemplateRewriting?!0:this.makeTemplateSource(e,t).data("isRewritten")},d.H.prototype.rewriteTemplate=function(e,t,i){e=this.makeTemplateSource(e,i),t=t(e.text()),e.text(t),e.data("isRewritten",!0)},d.b("templateEngine",d.H),d.fb=function(){function e(e,t,i,r){e=d.h.Wa(e);for(var n=d.h.ha,o=0;o<e.length;o++){var a=e[o].key;if(n.hasOwnProperty(a)){var s=n[a];if("function"==typeof s){if(a=s(e[o].value))throw Error(a)}else if(!s)throw Error("This template engine does not support the '"+a+"' binding within its templates")}}return i="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+d.h.ya(e,{valueAccessors:!0})+" } })()},'"+i.toLowerCase()+"')",r.createJavaScriptEvaluatorBlock(i)+t}var t=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,i=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{ec:function(e,t,i){t.isTemplateRewritten(e,i)||t.rewriteTemplate(e,function(e){return d.fb.nc(e,t)},i)},nc:function(r,n){return r.replace(t,function(t,i,r,o,a){return e(a,i,r,n)}).replace(i,function(t,i){return e(i,"<!-- ko -->","#comment",n)})},Xb:function(e,t){return d.D.Ua(function(i,r){var n=i.nextSibling;n&&n.nodeName.toLowerCase()===t&&d.ra(n,e,r)})}}}(),d.b("__tr_ambtns",d.fb.Xb),function(){d.r={},d.r.l=function(e){this.l=e},d.r.l.prototype.text=function(){var e=d.a.t(this.l),e="script"===e?"text":"textarea"===e?"value":"innerHTML";if(0==arguments.length)return this.l[e];var t=arguments[0];"innerHTML"===e?d.a.$a(this.l,t):this.l[e]=t};var t=d.a.e.F()+"_";d.r.l.prototype.data=function(e){return 1===arguments.length?d.a.e.get(this.l,t+e):void d.a.e.set(this.l,t+e,arguments[1])};var i=d.a.e.F();d.r.fa=function(e){this.l=e},d.r.fa.prototype=new d.r.l,d.r.fa.prototype.text=function(){if(0==arguments.length){var t=d.a.e.get(this.l,i)||{};return t.gb===e&&t.Ga&&(t.gb=t.Ga.innerHTML),t.gb}d.a.e.set(this.l,i,{gb:arguments[0]})},d.r.l.prototype.nodes=function(){return 0==arguments.length?(d.a.e.get(this.l,i)||{}).Ga:void d.a.e.set(this.l,i,{Ga:arguments[0]})},d.b("templateSources",d.r),d.b("templateSources.domElement",d.r.l),d.b("templateSources.anonymousTemplate",d.r.fa)}(),function(){function t(e,t,i){var r;for(t=d.f.nextSibling(t);e&&(r=e)!==t;)e=d.f.nextSibling(r),i(r,e)}function i(e,i){if(e.length){var r=e[0],n=e[e.length-1],o=r.parentNode,a=d.J.instance,s=a.preprocessNode;if(s){if(t(r,n,function(e,t){var i=e.previousSibling,o=s.call(a,e);o&&(e===r&&(r=o[0]||t),e===n&&(n=o[o.length-1]||i))}),e.length=0,!r)return;r===n?e.push(r):(e.push(r,n),d.a.ka(e,o))}t(r,n,function(e){1!==e.nodeType&&8!==e.nodeType||d.pb(i,e)}),t(r,n,function(e){1!==e.nodeType&&8!==e.nodeType||d.D.Sb(e,[i])}),d.a.ka(e,o)}}function r(e){return e.nodeType?e:0<e.length?e[0]:null}function n(e,t,n,a,s){s=s||{};var l=e&&r(e),l=l&&l.ownerDocument,u=s.templateEngine||o;if(d.fb.ec(n,u,l),n=u.renderTemplate(n,a,s,l),"number"!=typeof n.length||0<n.length&&"number"!=typeof n[0].nodeType)throw Error("Template engine must return an array of DOM nodes");switch(l=!1,t){case"replaceChildren":d.f.T(e,n),l=!0;break;case"replaceNode":d.a.Lb(e,n),l=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+t)}return l&&(i(n,a),s.afterRender&&d.k.B(s.afterRender,null,[n,a.$data])),n}var o;d.ab=function(t){if(t!=e&&!(t instanceof d.H))throw Error("templateEngine must inherit from ko.templateEngine");o=t},d.Ya=function(t,i,a,s,l){if(a=a||{},(a.templateEngine||o)==e)throw Error("Set a template engine before calling renderTemplate");if(l=l||"replaceChildren",s){var u=r(s);return d.j(function(){var e=i&&i instanceof d.N?i:new d.N(d.a.c(i)),o=d.C(t)?t():"function"==typeof t?t(e.$data,e):t,e=n(s,l,o,e,a);"replaceNode"==l&&(s=e,u=r(s))},null,{Ia:function(){return!u||!d.a.Ja(u)},o:u&&"replaceNode"==l?u.parentNode:u})}return d.D.Ua(function(e){d.Ya(t,i,a,e,"replaceNode")})},d.uc=function(t,r,o,a,s){function l(e,t){i(t,c),o.afterRender&&o.afterRender(t,e)}function u(e,i){c=s.createChildContext(e,o.as,function(e){e.$index=i});var r=d.C(t)?t():"function"==typeof t?t(e,c):t;return n(null,"ignoreTargetNode",r,c,o)}var c;return d.j(function(){var t=d.a.c(r)||[];"undefined"==typeof t.length&&(t=[t]),t=d.a.ta(t,function(t){return o.includeDestroyed||t===e||null===t||!d.a.c(t._destroy)}),d.k.B(d.a.Za,null,[a,t,u,o,l])},null,{o:a})};var a=d.a.e.F();d.d.template={init:function(e,t){var i=d.a.c(t());return"string"==typeof i||i.name?d.f.ja(e):(i=d.f.childNodes(e),i=d.a.oc(i),new d.r.fa(e).nodes(i)),{controlsDescendantBindings:!0}},update:function(t,i,r,n,o){var s,l=i();i=d.a.c(l),r=!0,n=null,"string"==typeof i?i={}:(l=i.name,"if"in i&&(r=d.a.c(i["if"])),r&&"ifnot"in i&&(r=!d.a.c(i.ifnot)),s=d.a.c(i.data)),"foreach"in i?n=d.uc(l||t,r&&i.foreach||[],i,t,o):r?(o="data"in i?o.createChildContext(s,i.as):o,n=d.Ya(l||t,o,i,t)):d.f.ja(t),o=n,(s=d.a.e.get(t,a))&&"function"==typeof s.K&&s.K(),d.a.e.set(t,a,o&&o.Z()?o:e)}},d.h.ha.template=function(e){return e=d.h.Wa(e),1==e.length&&e[0].unknown||d.h.lc(e,"name")?null:"This template engine does not support anonymous templates nested within its templates"},d.f.Q.template=!0}(),d.b("setTemplateEngine",d.ab),d.b("renderTemplate",d.Ya),d.a.wb=function(e,t,i){if(e.length&&t.length){var r,n,o,a,s;for(r=n=0;(!i||i>r)&&(a=e[n]);++n){for(o=0;s=t[o];++o)if(a.value===s.value){a.moved=s.index,s.moved=a.index,t.splice(o,1),r=o=0;break}r+=o}}},d.a.Fa=function(){function e(e,t,i,r,n){var o,a,s,l,u,c=Math.min,h=Math.max,m=[],p=e.length,f=t.length,v=f-p||1,g=p+f+1;for(o=0;p>=o;o++)for(l=s,m.push(s=[]),u=c(f,o+v),a=h(0,o-1);u>=a;a++)s[a]=a?o?e[o-1]===t[a-1]?l[a-1]:c(l[a]||g,s[a-1]||g)+1:a+1:o+1;for(c=[],h=[],v=[],o=p,a=f;o||a;)f=m[o][a]-1,a&&f===m[o][a-1]?h.push(c[c.length]={status:i,value:t[--a],index:a}):o&&f===m[o-1][a]?v.push(c[c.length]={status:r,value:e[--o],index:o}):(--a,--o,n.sparse||c.push({status:"retained",value:t[a]}));return d.a.wb(h,v,10*p),c.reverse()}return function(t,i,r){return r="boolean"==typeof r?{dontLimitMoves:r}:r||{},t=t||[],i=i||[],t.length<=i.length?e(t,i,"added","deleted",r):e(i,t,"deleted","added",r)}}(),d.b("utils.compareArrays",d.a.Fa),function(){function t(t,i,r,n,o){var a=[],s=d.j(function(){var e=i(r,o,d.a.ka(a,t))||[];0<a.length&&(d.a.Lb(a,e),n&&d.k.B(n,null,[r,e,o])),a.length=0,d.a.ga(a,e)},null,{o:t,Ia:function(){return!d.a.ob(a)}});return{$:a,j:s.Z()?s:e}}var i=d.a.e.F();d.a.Za=function(r,n,o,a,s){function l(e,t){C=h[t],g!==t&&(w[e]=C),C.Na(g++),d.a.ka(C.$,r),f.push(C),y.push(C)}function u(e,t){if(e)for(var i=0,r=t.length;r>i;i++)t[i]&&d.a.u(t[i].$,function(r){e(r,i,t[i].sa)})}n=n||[],a=a||{};var c=d.a.e.get(r,i)===e,h=d.a.e.get(r,i)||[],m=d.a.Da(h,function(e){return e.sa}),p=d.a.Fa(m,n,a.dontLimitMoves),f=[],v=0,g=0,_=[],y=[];n=[];for(var C,E,S,w=[],m=[],T=0;E=p[T];T++)switch(S=E.moved,E.status){case"deleted":S===e&&(C=h[v],C.j&&C.j.K(),_.push.apply(_,d.a.ka(C.$,r)),a.beforeRemove&&(n[T]=C,y.push(C))),v++;break;case"retained":l(T,v++);break;case"added":S!==e?l(T,S):(C={sa:E.value,Na:d.p(g++)},f.push(C),y.push(C),c||(m[T]=C))}u(a.beforeMove,w),d.a.u(_,a.beforeRemove?d.R:d.removeNode);for(var x,T=0,c=d.f.firstChild(r);C=y[T];T++){for(C.$||d.a.extend(C,t(r,o,C.sa,s,C.Na)),v=0;p=C.$[v];c=p.nextSibling,x=p,v++)p!==c&&d.f.Bb(r,p,x);!C.ic&&s&&(s(C.sa,C.$,C.Na),C.ic=!0)}u(a.beforeRemove,n),u(a.afterMove,w),u(a.afterAdd,m),d.a.e.set(r,i,f)}}(),d.b("utils.setDomNodeChildrenFromArrayMapping",d.a.Za),d.O=function(){this.allowTemplateRewriting=!1},d.O.prototype=new d.H,d.O.prototype.renderTemplateSource=function(e){var t=(9>d.a.L?0:e.nodes)?e.nodes():null;return t?d.a.S(t.cloneNode(!0).childNodes):(e=e.text(),d.a.ba(e))},d.O.Oa=new d.O,d.ab(d.O.Oa),d.b("nativeTemplateEngine",d.O),function(){d.Sa=function(){var e=this.kc=function(){if(!a||!a.tmpl)return 0;try{if(0<=a.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(e){}return 1}();this.renderTemplateSource=function(t,i,r){if(r=r||{},2>e)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var o=t.data("precompiled");return o||(o=t.text()||"",o=a.template(null,"{{ko_with $item.koBindingContext}}"+o+"{{/ko_with}}"),t.data("precompiled",o)),t=[i.$data],i=a.extend({koBindingContext:i},r.templateOptions),i=a.tmpl(o,t,i),i.appendTo(n.createElement("div")), +a.fragments={},i},this.createJavaScriptEvaluatorBlock=function(e){return"{{ko_code ((function() { return "+e+" })()) }}"},this.addTemplate=function(e,t){n.write("<script type='text/html' id='"+e+"'>"+t+"</script>")},e>0&&(a.tmpl.tag.ko_code={open:"__.push($1 || '');"},a.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},d.Sa.prototype=new d.H;var e=new d.Sa;0<e.kc&&d.ab(e),d.b("jqueryTmplTemplateEngine",d.Sa)}()})}()}(),i("ThirdParty/knockout-es5",[],function(){"use strict";function e(e,i){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,o=t(e,!0);return i=i||Object.getOwnPropertyNames(e),i.forEach(function(t){if(t!==h&&t!==d&&!(t in o)){var i=e[t],a=i instanceof Array,s=n.isObservable(i)?i:a?n.observableArray(i):n.observable(i);Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:s,set:n.isWriteableObservable(s)?s:void 0}),o[t]=s,a&&r(n,s)}}),e}function t(e,t){var i=e[h];return!i&&t&&(i={},Object.defineProperty(e,h,{value:i})),i}function i(t,i,r){var n=this,o={owner:t,deferEvaluation:!0};if("function"==typeof r)o.read=r;else{if("value"in r)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if("function"!=typeof r.get)throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');o.read=r.get,o.write=r.set}return t[i]=n.computed(o),e.call(n,t,[i]),t}function r(e,t){var i=null;e.computed(function(){i&&(i.dispose(),i=null);var r=t();r instanceof Array&&(i=n(e,t,r))})}function n(e,t,i){var r=o(e,i);return r.subscribe(t)}function o(e,t){var i=t[d];if(!i){i=new e.subscribable,Object.defineProperty(t,d,{value:i});var r={};a(t,i,r),s(e,t,i,r)}return i}function a(e,t,i){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(r){var n=e[r];e[r]=function(){var e=n.apply(this,arguments);return i.pause!==!0&&t.notifySubscribers(this),e}})}function s(e,t,i,r){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(n){Object.defineProperty(t,n,{enumerable:!1,value:function(){var o;r.pause=!0;try{o=e.observableArray.fn[n].apply(e.observableArray(t),arguments)}finally{r.pause=!1}return i.notifySubscribers(t),o}})})}function l(e,i){if(!e)return null;var r=t(e,!1);return r&&r[i]||null}function u(e,t){var i=l(e,t);i&&i.valueHasMutated()}function c(t){t.track=e,t.getObservable=l,t.valueHasMutated=u,t.defineProperty=i}var h="__knockoutObservables",d="__knockoutSubscribable";return{attachToKo:c}}),i("Widgets/SvgPathBindingHandler",[],function(){"use strict";var e="http://www.w3.org/2000/svg",t="cesium-svgPath-svg",i={register:function(i){i.bindingHandlers.cesiumSvgPath={init:function(r,n){var o=document.createElementNS(e,"svg:svg");o.setAttribute("class",t);var a=document.createElementNS(e,"path");return o.appendChild(a),i.virtualElements.setDomNodeChildren(r,[o]),i.computed({read:function(){var e=i.unwrap(n());a.setAttribute("d",i.unwrap(e.path));var r=i.unwrap(e.width),s=i.unwrap(e.height);o.setAttribute("width",r),o.setAttribute("height",s),o.setAttribute("viewBox","0 0 "+r+" "+s),e.css&&o.setAttribute("class",t+" "+i.unwrap(e.css))},disposeWhenNodeIsRemoved:r}),{controlsDescendantBindings:!0}}},i.virtualElements.allowedBindings.cesiumSvgPath=!0}};return i}),i("ThirdParty/knockout",["./knockout-3.2.0","./knockout-es5","../Widgets/SvgPathBindingHandler"],function(e,t,i){"use strict";return t.attachToKo(e),i.register(e),e}),i("ThirdParty/NoSleep",[],function(){"use strict";function e(e,t,i){var r=document.createElement("source");r.src=i,r.type="video/"+t,e.appendChild(r)}var t={Android:/Android/gi.test(navigator.userAgent),iOS:/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent)},i={WebM:"data:video/webm;base64,GkXfo0AgQoaBAUL3gQFC8oEEQvOBCEKCQAR3ZWJtQoeBAkKFgQIYU4BnQI0VSalmQCgq17FAAw9CQE2AQAZ3aGFtbXlXQUAGd2hhbW15RIlACECPQAAAAAAAFlSua0AxrkAu14EBY8WBAZyBACK1nEADdW5khkAFVl9WUDglhohAA1ZQOIOBAeBABrCBCLqBCB9DtnVAIueBAKNAHIEAAIAwAQCdASoIAAgAAUAmJaQAA3AA/vz0AAA=",MP4:"data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAAAhmcmVlAAAAG21kYXQAAAGzABAHAAABthADAowdbb9/AAAC6W1vb3YAAABsbXZoZAAAAAB8JbCAfCWwgAAAA+gAAAAAAAEAAAEAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIVdHJhawAAAFx0a2hkAAAAD3wlsIB8JbCAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAIAAAACAAAAAABsW1kaWEAAAAgbWRoZAAAAAB8JbCAfCWwgAAAA+gAAAAAVcQAAAAAAC1oZGxyAAAAAAAAAAB2aWRlAAAAAAAAAAAAAAAAVmlkZW9IYW5kbGVyAAAAAVxtaW5mAAAAFHZtaGQAAAABAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAEcc3RibAAAALhzdHNkAAAAAAAAAAEAAACobXA0dgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAIAAgASAAAAEgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABj//wAAAFJlc2RzAAAAAANEAAEABDwgEQAAAAADDUAAAAAABS0AAAGwAQAAAbWJEwAAAQAAAAEgAMSNiB9FAEQBFGMAAAGyTGF2YzUyLjg3LjQGAQIAAAAYc3R0cwAAAAAAAAABAAAAAQAAAAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAAFHN0c3oAAAAAAAAAEwAAAAEAAAAUc3RjbwAAAAAAAAABAAAALAAAAGB1ZHRhAAAAWG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAK2lsc3QAAAAjqXRvbwAAABtkYXRhAAAAAQAAAABMYXZmNTIuNzguMw=="},r=function(){return t.iOS?this.noSleepTimer=null:t.Android&&(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("loop",""),e(this.noSleepVideo,"webm",i.WebM),e(this.noSleepVideo,"mp4",i.MP4)),this};return r.prototype.enable=function(e){t.iOS?(this.disable(),this.noSleepTimer=window.setInterval(function(){window.location=window.location,window.setTimeout(window.stop,0)},e||15e3)):t.Android&&this.noSleepVideo.play()},r.prototype.disable=function(){t.iOS?this.noSleepTimer&&(window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):t.Android&&this.noSleepVideo.pause()},r}),i("Widgets/subscribeAndEvaluate",["../ThirdParty/knockout"],function(e){"use strict";function t(t,i,r,n,o){return r.call(n,t[i]),e.getObservable(t,i).subscribe(r,n,o)}return t}),i("Widgets/Animation/Animation",["../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../getElement","../subscribeAndEvaluate"],function(e,t,i,r,n,o,a){"use strict";function s(t){return e.fromCssColorString(window.getComputedStyle(t).getPropertyValue("color"))}function l(e){var t=document.createElementNS(_,e.tagName);for(var i in e)if(e.hasOwnProperty(i)&&"tagName"!==i)if("children"===i){var r,n=e.children.length;for(r=0;n>r;++r)t.appendChild(l(e.children[r]))}else 0===i.indexOf("xlink:")?t.setAttributeNS(y,i.substring(6),e[i]):"textContent"===i?t.textContent=e[i]:t.setAttribute(i,e[i]);return t}function u(e,t,i){var r=document.createElementNS(_,"text");r.setAttribute("x",e),r.setAttribute("y",t),r.setAttribute("class","cesium-animation-svgText");var n=document.createElementNS(_,"tspan");return n.textContent=i,r.appendChild(n),r}function c(e,t,i){e.setAttribute("transform","translate(100,100) rotate("+i+")"),t.setAttribute("transform","rotate("+i+")")}function h(e,t){var i=t.alpha,r=1-i;return P.red=e.red*r+t.red*i,P.green=e.green*r+t.green*i,P.blue=e.blue*r+t.blue*i,P.toCssColorString()}function d(e,t,i){var r={tagName:"g","class":"cesium-animation-rectButton",transform:"translate("+e+","+t+")",children:[{tagName:"rect","class":"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect","class":"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{tagName:"use","class":"cesium-animation-buttonPath","xlink:href":i},{tagName:"title",textContent:""}]};return l(r)}function m(e,t,i){var r={tagName:"g","class":"cesium-animation-rectButton",transform:"translate("+e+","+t+")",children:[{tagName:"use","class":"cesium-animation-buttonGlow","xlink:href":"#animation_pathWingButton"},{tagName:"use","class":"cesium-animation-buttonMain","xlink:href":"#animation_pathWingButton"},{tagName:"use","class":"cesium-animation-buttonPath","xlink:href":i},{tagName:"title",textContent:""}]};return l(r)}function p(e,t){var i=e._viewModel,r=i.shuttleRingDragging;if(!r||g===e)if("mousedown"===t.type||r&&"mousemove"===t.type||"touchstart"===t.type&&1===t.touches.length||r&&"touchmove"===t.type&&1===t.touches.length){var n,o,a=e._centerX,s=e._centerY,l=e._svgNode,u=l.getBoundingClientRect();if("touchstart"===t.type||"touchmove"===t.type?(n=t.touches[0].clientX,o=t.touches[0].clientY):(n=t.clientX,o=t.clientY),!r&&(n>u.right||n<u.left||o<u.top||o>u.bottom))return;var c=e._shuttleRingPointer.getBoundingClientRect(),h=n-a-u.left,d=o-s-u.top,m=180*Math.atan2(d,h)/Math.PI+90;m>180&&(m-=360);var p=i.shuttleRingAngle;r||n<c.right&&n>c.left&&o>c.top&&o<c.bottom?(g=e,i.shuttleRingDragging=!0,i.shuttleRingAngle=m):p>m?i.slower():m>p&&i.faster(),t.preventDefault()}else e===g&&(g=void 0),i.shuttleRingDragging=!1}function f(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;var i=this;this._clickFunction=function(){var e=i._viewModel.command;e.canExecute&&e()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[a(t,"toggled",this.setToggled,this),a(t,"tooltip",this.setTooltip,this),a(t.command,"canExecute",this.setEnabled,this)]}function v(e,t){function i(e){p(b,e)}e=o(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;var r=document.createElement("style");r.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",document.head.insertBefore(r,document.head.childNodes[0]);var n=document.createElement("div");n.className="cesium-animation-theme",n.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=n,this._themeNormal=n.childNodes[0],this._themeHover=n.childNodes[1],this._themeSelect=n.childNodes[2],this._themeDisabled=n.childNodes[3],this._themeKnob=n.childNodes[4],this._themePointer=n.childNodes[5],this._themeSwoosh=n.childNodes[6],this._themeSwooshHover=n.childNodes[7];var s=document.createElementNS(_,"svg:svg");this._svgNode=s,s.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",y);var h=document.createElementNS(_,"g");this._topG=h,this._realtimeSVG=new f(m(3,4,"#animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new f(d(44,99,"#animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new f(d(124,99,"#animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new f(d(84,99,"#animation_pathPause"),t.pauseViewModel);var v=document.createElementNS(_,"g");v.appendChild(this._realtimeSVG.svgElement),v.appendChild(this._playReverseSVG.svgElement),v.appendChild(this._playForwardSVG.svgElement),v.appendChild(this._pauseSVG.svgElement);var g=l({tagName:"circle","class":"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=g;var C=l({tagName:"g","class":"cesium-animation-shuttleRingSwoosh",children:[{tagName:"use",transform:"translate(100,97) scale(-1,1)","xlink:href":"#animation_pathSwooshFX"},{tagName:"use",transform:"translate(100,97)","xlink:href":"#animation_pathSwooshFX"},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=C,this._shuttleRingPointer=l({tagName:"use","class":"cesium-animation-shuttleRingPointer","xlink:href":"#animation_pathPointer"});var E=l({tagName:"g",transform:"translate(100,100)"});this._knobOuter=l({tagName:"circle","class":"cesium-animation-knobOuter",cx:0,cy:0,r:71});var S=61,w=l({tagName:"circle","class":"cesium-animation-knobInner",cx:0,cy:0,r:S});this._knobDate=u(0,-24,""),this._knobTime=u(0,-7,""),this._knobStatus=u(0,-41,"");var T=l({tagName:"circle","class":"cesium-animation-blank",cx:0,cy:0,r:S}),x=document.createElementNS(_,"g");x.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(n),h.appendChild(x),h.appendChild(E),h.appendChild(v),x.appendChild(g),x.appendChild(C),x.appendChild(this._shuttleRingPointer),E.appendChild(this._knobOuter),E.appendChild(w),E.appendChild(this._knobDate),E.appendChild(this._knobTime),E.appendChild(this._knobStatus),E.appendChild(T),s.appendChild(h),e.appendChild(s);var b=this;this._mouseCallback=i,g.addEventListener("mousedown",i,!0),g.addEventListener("touchstart",i,!0),C.addEventListener("mousedown",i,!0),C.addEventListener("touchstart",i,!0),document.addEventListener("mousemove",i,!0),document.addEventListener("touchmove",i,!0),document.addEventListener("mouseup",i,!0),document.addEventListener("touchend",i,!0),this._shuttleRingPointer.addEventListener("mousedown",i,!0),this._shuttleRingPointer.addEventListener("touchstart",i,!0),this._knobOuter.addEventListener("mousedown",i,!0),this._knobOuter.addEventListener("touchstart",i,!0);var A,P=this._knobTime.childNodes[0],I=this._knobDate.childNodes[0],M=this._knobStatus.childNodes[0];this._subscriptions=[a(t.pauseViewModel,"toggled",function(e){A!==e&&(A=e,A?b._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):b._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),a(t,"shuttleRingAngle",function(e){c(b._shuttleRingPointer,b._knobOuter,e)}),a(t,"dateLabel",function(e){I.textContent!==e&&(I.textContent=e)}),a(t,"timeLabel",function(e){P.textContent!==e&&(P.textContent=e)}),a(t,"multiplierLabel",function(e){M.textContent!==e&&(M.textContent=e)})],this.applyThemeChanges(),this.resize()}var g,_="http://www.w3.org/2000/svg",y="http://www.w3.org/1999/xlink",C=e.fromCssColorString("rgba(247,250,255,0.384)"),E=e.fromCssColorString("rgba(143,191,255,0.216)"),S=e.fromCssColorString("rgba(153,197,255,0.098)"),w=e.fromCssColorString("rgba(255,255,255,0.086)"),T=e.fromCssColorString("rgba(255,255,255,0.267)"),x=e.fromCssColorString("rgba(255,255,255,0)"),b=e.fromCssColorString("rgba(66,67,68,0.3)"),A=e.fromCssColorString("rgba(0,0,0,0.5)"),P=new e;return f.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);for(var e=this._subscriptions,t=0,i=e.length;i>t;t++)e[t].dispose();r(this)},f.prototype.isDestroyed=function(){return!1},f.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e)return void this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");if(this._toggled)return void this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");this.svgElement.setAttribute("class","cesium-animation-rectButton")}},f.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))},f.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e},i(v.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){var e=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",e,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",e,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",e,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",e,!0),document.removeEventListener("mousemove",e,!0),document.removeEventListener("touchmove",e,!0),document.removeEventListener("mouseup",e,!0),document.removeEventListener("touchend",e,!0),this._shuttleRingPointer.removeEventListener("mousedown",e,!0),this._shuttleRingPointer.removeEventListener("touchstart",e,!0),this._knobOuter.removeEventListener("mousedown",e,!0),this._knobOuter.removeEventListener("touchstart",e,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();for(var t=this._subscriptions,i=0,n=t.length;n>i;i++)t[i].dispose();return r(this)},v.prototype.resize=function(){var e=this._container.clientWidth,t=this._container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){var i=this._svgNode,r=200,n=132,o=e,a=t;0===e&&0===t?(o=r,a=n):0===e?(a=t,o=r*(t/n)):0===t&&(o=e,a=n*(e/r));var s=o/r,l=a/n;i.style.cssText="width: "+o+"px; height: "+a+"px; position: absolute; bottom: 0; left: 0; overflow: hidden;",i.setAttribute("width",o),i.setAttribute("height",a),i.setAttribute("viewBox","0 0 "+o+" "+a),this._topG.setAttribute("transform","scale("+s+","+l+")"),this._centerX=Math.max(1,100*s),this._centerY=Math.max(1,100*l),this._lastHeight=e,this._lastWidth=t}},v.prototype.applyThemeChanges=function(){var e=s(this._themeNormal),i=s(this._themeHover),r=s(this._themeSelect),n=s(this._themeDisabled),o=s(this._themeKnob),a=s(this._themePointer),u=s(this._themeSwoosh),c=s(this._themeSwooshHover),d=l({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(e,C)},{tagName:"stop",offset:"12%","stop-color":h(e,E)},{tagName:"stop",offset:"46%","stop-color":h(e,S)},{tagName:"stop",offset:"81%","stop-color":h(e,w)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(i,C)},{tagName:"stop",offset:"12%","stop-color":h(i,E)},{tagName:"stop",offset:"46%","stop-color":h(i,S)},{tagName:"stop",offset:"81%","stop-color":h(i,w)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(r,C)},{tagName:"stop",offset:"12%","stop-color":h(r,E)},{tagName:"stop",offset:"46%","stop-color":h(r,S)},{tagName:"stop",offset:"81%","stop-color":h(r,w)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(n,T)},{tagName:"stop",offset:"75%","stop-color":h(n,x)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,"in":"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":u.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":u.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":u.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":h(a,A)},{tagName:"stop",offset:"100%","stop-color":h(a,A)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":h(o,C)},{tagName:"stop",offset:"60%","stop-color":h(o,b)},{tagName:"stop",offset:"85%","stop-color":h(o,E)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":h(o,b)},{tagName:"stop",offset:"60%","stop-color":h(o,C)},{tagName:"stop",offset:"85%","stop-color":h(o,w)}]},{id:"animation_pathReset",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},{id:"animation_pathPause",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},{id:"animation_pathPlay",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},{id:"animation_pathPlayReverse",tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},{id:"animation_pathLoop",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},{id:"animation_pathClock",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},{id:"animation_pathWingButton",tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},{id:"animation_pathPointer",tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},{id:"animation_pathSwooshFX",tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}]});t(this._defsElement)?this._svgNode.replaceChild(d,this._defsElement):this._svgNode.appendChild(d),this._defsElement=d},v}),i("Widgets/createCommand",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../ThirdParty/knockout"],function(e,t,i,r,n,o){"use strict";function a(t,r){function a(){var e,i={args:arguments,cancel:!1};return s.raiseEvent(i),i.cancel||(e=t.apply(null,arguments),l.raiseEvent(e)),e}r=e(r,!0);var s=new n,l=new n;return a.canExecute=r,o.track(a,["canExecute"]),i(a,{beforeExecute:{value:s},afterExecute:{value:l}}),a}return a}),i("Widgets/ToggleButtonViewModel",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../ThirdParty/knockout"],function(e,t,i,r,n){"use strict";function o(t,i){this._command=t,i=e(i,e.EMPTY_OBJECT),this.toggled=e(i.toggled,!1),this.tooltip=e(i.tooltip,""),n.track(this,["toggled","tooltip"])}return i(o.prototype,{command:{get:function(){return this._command}}}),o}),i("Widgets/Animation/AnimationViewModel",["../../Core/binarySearch","../../Core/ClockRange","../../Core/ClockStep","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/JulianDate","../../ThirdParty/knockout","../../ThirdParty/sprintf","../createCommand","../ToggleButtonViewModel"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e){e.clockStep===i.SYSTEM_CLOCK&&(e.clockStep=i.SYSTEM_CLOCK_MULTIPLIER,e.multiplier=1)}function d(e){h(e),e.shouldAnimate=!0}function m(e,t){return e-t}function p(t,i){var r=e(i,t,m);return 0>r?~r:r}function f(e,t){if(Math.abs(e)<=y)return e/y;var i,r,n=y,o=C,a=0;return e>0?(i=Math.log(t[t.length-1]),r=(i-a)/(o-n),Math.exp(a+r*(e-n))):(i=Math.log(-t[0]),r=(i-a)/(o-n),-Math.exp(a+r*(Math.abs(e)-n)))}function v(e,t,r){if(r.clockStep===i.SYSTEM_CLOCK)return y;if(Math.abs(e)<=1)return e*y;var n=t[t.length-1];e>n?e=n:-n>e&&(e=-n);var o,a,s=y,l=C,u=0;return e>0?(o=Math.log(n),a=(o-u)/(l-s),(Math.log(e)-u)/a+s):(o=Math.log(-t[0]),a=(o-u)/(l-s),-((Math.log(Math.abs(e))-u)/a+s))}function g(e){var r=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=g.defaultDateFormatter,this._timeFormatter=g.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,s.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(g.defaultTicks),this.timeLabel=void 0,s.defineProperty(this,"timeLabel",function(){return r._timeFormatter(r._clockViewModel.currentTime,r)}),this.dateLabel=void 0,s.defineProperty(this,"dateLabel",function(){return r._dateFormatter(r._clockViewModel.currentTime,r)}),this.multiplierLabel=void 0,s.defineProperty(this,"multiplierLabel",function(){var e=r._clockViewModel;if(e.clockStep===i.SYSTEM_CLOCK)return"Today";var t=e.multiplier;return t%1===0?t.toFixed(0)+"x":t.toFixed(3).replace(/0{0,3}$/,"")+"x"}),this.shuttleRingAngle=void 0,s.defineProperty(this,"shuttleRingAngle",{get:function(){return v(e.multiplier,r._allShuttleRingTicks,e)},set:function(e){e=Math.max(Math.min(e,C),-C);var t=r._allShuttleRingTicks,n=r._clockViewModel;if(n.clockStep=i.SYSTEM_CLOCK_MULTIPLIER,Math.abs(e)===C)return void(n.multiplier=e>0?t[t.length-1]:t[0]);var o=f(e,t);if(r.snapToTicks)o=t[p(o,t)];else if(0!==o){var a=Math.abs(o);if(a>100){var s=a.toFixed(0).length-2,l=Math.pow(10,s);o=Math.round(o/l)*l|0}else a>y?o=Math.round(o):a>1?o=+o.toFixed(1):a>0&&(o=+o.toFixed(2))}n.multiplier=o}}),this._canAnimate=void 0,s.defineProperty(this,"_canAnimate",function(){var e=r._clockViewModel,i=e.clockRange;if(r.shuttleRingDragging||i===t.UNBOUNDED)return!0;var n=e.multiplier,o=e.currentTime,s=e.startTime,l=!1;if(i===t.LOOP_STOP)l=a.greaterThan(o,s)||o.equals(s)&&n>0;else{var u=e.stopTime;l=a.greaterThan(o,s)&&a.lessThan(o,u)||o.equals(s)&&n>0||o.equals(u)&&0>n}return l||(e.shouldAnimate=!1),l}),this._isSystemTimeAvailable=void 0,s.defineProperty(this,"_isSystemTimeAvailable",function(){var e=r._clockViewModel,i=e.clockRange;if(i===t.UNBOUNDED)return!0;var n=e.systemTime;return a.greaterThanOrEquals(n,e.startTime)&&a.lessThanOrEquals(n,e.stopTime)}),this._isAnimating=void 0,s.defineProperty(this,"_isAnimating",function(){return r._clockViewModel.shouldAnimate&&(r._canAnimate||r.shuttleRingDragging)});var n=u(function(){var e=r._clockViewModel;e.shouldAnimate?(h(e),e.shouldAnimate=!1):r._canAnimate&&d(e)});this._pauseViewModel=new c(n,{toggled:s.computed(function(){return!r._isAnimating}),tooltip:"Pause"});var o=u(function(){var e=r._clockViewModel;h(e);var t=e.multiplier;t>0&&(e.multiplier=-t),e.shouldAnimate=!0});this._playReverseViewModel=new c(o,{toggled:s.computed(function(){return r._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});var l=u(function(){var e=r._clockViewModel;h(e);var t=e.multiplier;0>t&&(e.multiplier=-t),e.shouldAnimate=!0});this._playForwardViewModel=new c(l,{toggled:s.computed(function(){return r._isAnimating&&e.multiplier>0&&e.clockStep!==i.SYSTEM_CLOCK}),tooltip:"Play Forward"});var m=u(function(){var e=r._clockViewModel;e.clockStep=i.SYSTEM_CLOCK,e.multiplier=1,e.shouldAnimate=!0},s.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new c(m,{toggled:s.computed(function(){return e.shouldAnimate&&e.clockStep===i.SYSTEM_CLOCK}),tooltip:s.computed(function(){return r._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=u(function(){var e=r._clockViewModel;h(e);var t=r._allShuttleRingTicks,i=e.multiplier,n=p(i,t)-1;n>=0&&(e.multiplier=t[n])}),this._faster=u(function(){var e=r._clockViewModel;h(e);var t=r._allShuttleRingTicks,i=e.multiplier,n=p(i,t)+1;n<t.length&&(e.multiplier=t[n])})}var _=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],y=15,C=105;return g.defaultDateFormatter=function(e,t){var i=a.toGregorianDate(e);return _[i.month-1]+" "+i.day+" "+i.year},g.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800],g.defaultTimeFormatter=function(e,t){var i=a.toGregorianDate(e),r=Math.round(i.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?l("%02d:%02d:%02d.%03d",i.hour,i.minute,i.second,r):l("%02d:%02d:%02d UTC",i.hour,i.minute,i.second)},g.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)},g.prototype.setShuttleRingTicks=function(e){var t,i,r,n={},o=this._sortedFilteredPositiveTicks; +for(o.length=0,t=0,i=e.length;i>t;++t)r=e[t],n.hasOwnProperty(r)||(n[r]=!0,o.push(r));o.sort(m);var a=[];for(i=o.length,t=i-1;t>=0;--t)r=o[t],0!==r&&a.push(-r);Array.prototype.push.apply(a,o),this._allShuttleRingTicks=a},n(g.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}}),g._maxShuttleRingAngle=C,g._realtimeShuttleRingAngle=y,g}),i("Widgets/BaseLayerPicker/BaseLayerPickerViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/EllipsoidTerrainProvider","../../Core/isArray","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){i=e(i,e.EMPTY_OBJECT);var r=i.globe,l=e(i.imageryProviderViewModels,[]),u=e(i.terrainProviderViewModels,[]);this._globe=r,this.imageryProviderViewModels=l.slice(0),this.terrainProviderViewModels=u.slice(0),this.dropDownVisible=!1,a.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]),this.buttonTooltip=void 0,a.defineProperty(this,"buttonTooltip",function(){var e=this.selectedImagery,i=this.selectedTerrain,r=t(e)?e.name:void 0,n=t(i)?i.name:void 0;return t(r)&&t(n)?r+"\n"+n:t(r)?r:n}),this.buttonImageUrl=void 0,a.defineProperty(this,"buttonImageUrl",function(){var e=this.selectedImagery;return t(e)?e.iconUrl:void 0}),this.selectedImagery=void 0;var c=a.observable();this._currentImageryProviders=[],a.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(e){if(c()===e)return void(this.dropDownVisible=!1);var i,r=this._currentImageryProviders,n=r.length,a=this._globe.imageryLayers;for(i=0;n>i;i++)for(var s=a.length,l=0;s>l;l++){var u=a.get(l);if(u.imageryProvider===r[i]){a.remove(u);break}}if(t(e)){var h=e.creationCommand();if(o(h)){var d=h.length;for(i=d-1;i>=0;i--)a.addImageryProvider(h[i],0);this._currentImageryProviders=h.slice(0)}else this._currentImageryProviders=[h],a.addImageryProvider(h,0)}c(e),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;var h=a.observable();a.defineProperty(this,"selectedTerrain",{get:function(){return h()},set:function(e){if(h()===e)return void(this.dropDownVisible=!1);var i;t(e)&&(i=e.creationCommand()),this._globe.depthTestAgainstTerrain=!(i instanceof n),this._globe.terrainProvider=i,h(e),this.dropDownVisible=!1}});var d=this;this._toggleDropDown=s(function(){d.dropDownVisible=!d.dropDownVisible}),this.selectedImagery=e(i.selectedImageryProviderViewModel,l[0]),this.selectedTerrain=e(i.selectedTerrainProviderViewModel,u[0])}return i(l.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}}),l}),i("Widgets/BaseLayerPicker/BaseLayerPicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./BaseLayerPickerViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t){e=a(e);var i=new s(t),r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(r);var l=document.createElement("img");l.setAttribute("draggable","false"),l.className="cesium-baseLayerPicker-selected",l.setAttribute("data-bind","attr: { src: buttonImageUrl }"),r.appendChild(l);var u=document.createElement("div");u.className="cesium-baseLayerPicker-dropDown",u.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(u);var c=document.createElement("div");c.className="cesium-baseLayerPicker-sectionTitle",c.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),c.innerHTML="Imagery",u.appendChild(c);var h=document.createElement("div");h.className="cesium-baseLayerPicker-choices",h.setAttribute("data-bind","foreach: imageryProviderViewModels"),u.appendChild(h);var d=document.createElement("div");d.className="cesium-baseLayerPicker-item",d.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parent.selectedImagery = $data; }'),h.appendChild(d);var m=document.createElement("img");m.className="cesium-baseLayerPicker-itemIcon",m.setAttribute("data-bind","attr: { src: iconUrl }"),m.setAttribute("draggable","false"),d.appendChild(m);var p=document.createElement("div");p.className="cesium-baseLayerPicker-itemLabel",p.setAttribute("data-bind","text: name"),d.appendChild(p);var f=document.createElement("div");f.className="cesium-baseLayerPicker-sectionTitle",f.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),f.innerHTML="Terrain",u.appendChild(f);var v=document.createElement("div");v.className="cesium-baseLayerPicker-choices",v.setAttribute("data-bind","foreach: terrainProviderViewModels"),u.appendChild(v);var g=document.createElement("div");g.className="cesium-baseLayerPicker-item",g.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parent.selectedTerrain = $data; }'),v.appendChild(g);var _=document.createElement("img");_.className="cesium-baseLayerPicker-itemIcon",_.setAttribute("data-bind","attr: { src: iconUrl }"),_.setAttribute("draggable","false"),g.appendChild(_);var y=document.createElement("div");y.className="cesium-baseLayerPicker-itemLabel",y.setAttribute("data-bind","text: name"),g.appendChild(y),o.applyBindings(i,r),o.applyBindings(i,u),this._viewModel=i,this._container=e,this._element=r,this._dropPanel=u,this._closeDropDown=function(e){r.contains(e.target)||u.contains(e.target)||(i.dropDownVisible=!1)},n.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}return t(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return n.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),o.cleanNode(this._element),o.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),i(this)},l}),i("Widgets/BaseLayerPicker/ProviderViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n){"use strict";function o(t){var i=t.creationFunction;e(i.canExecute)||(i=n(i)),this._creationCommand=i,this.name=t.name,this.tooltip=t.tooltip,this.iconUrl=t.iconUrl,r.track(this,["name","tooltip","iconUrl"])}return t(o.prototype,{creationCommand:{get:function(){return this._creationCommand}}}),o}),i("Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels",["../../Core/buildModuleUrl","../../Scene/ArcGisMapServerImageryProvider","../../Scene/BingMapsImageryProvider","../../Scene/BingMapsStyle","../../Scene/createOpenStreetMapImageryProvider","../../Scene/createTileMapServiceImageryProvider","../../Scene/MapboxImageryProvider","../BaseLayerPicker/ProviderViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(){var l=[];return l.push(new s({name:"Bing Maps Aerial",iconUrl:e("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery \nhttp://www.bing.com/maps",creationFunction:function(){return new i({url:"//dev.virtualearth.net",mapStyle:r.AERIAL})}})),l.push(new s({name:"Bing Maps Aerial with Labels",iconUrl:e("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with label overlays \nhttp://www.bing.com/maps",creationFunction:function(){return new i({url:"//dev.virtualearth.net",mapStyle:r.AERIAL_WITH_LABELS})}})),l.push(new s({name:"Bing Maps Roads",iconUrl:e("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps\nhttp://www.bing.com/maps",creationFunction:function(){return new i({url:"//dev.virtualearth.net",mapStyle:r.ROAD})}})),l.push(new s({name:"Mapbox Satellite",tooltip:"Mapbox satellite imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxSatellite.png"),creationFunction:function(){return new a({mapId:"mapbox.satellite"})}})),l.push(new s({name:"Mapbox Streets",tooltip:"Mapbox streets imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxTerrain.png"),creationFunction:function(){return new a({mapId:"mapbox.streets"})}})),l.push(new s({name:"Mapbox Streets Classic",tooltip:"Mapbox streets basic imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxStreets.png"),creationFunction:function(){return new a({mapId:"mapbox.streets-basic"})}})),l.push(new s({name:"ESRI World Imagery",iconUrl:e("Widgets/Images/ImageryProviders/esriWorldImagery.png"),tooltip:"World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes NASA Blue Marble: Next Generation 500m resolution imagery at small scales (above 1:1,000,000), i-cubed 15m eSAT imagery at medium-to-large scales (down to 1:70,000) for the world, and USGS 15m Landsat imagery for Antarctica. The map features 0.3m resolution imagery in the continental United States and 0.6m resolution imagery in parts of Western Europe from DigitalGlobe. In other parts of the world, 1 meter resolution imagery is available from GeoEye IKONOS, i-cubed Nationwide Prime, Getmapping, AeroGRID, IGN Spain, and IGP Portugal. Additionally, imagery at different resolutions has been contributed by the GIS User Community.\nhttp://www.esri.com",creationFunction:function(){return new t({url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",enablePickFeatures:!1})}})),l.push(new s({name:"ESRI World Street Map",iconUrl:e("Widgets/Images/ImageryProviders/esriWorldStreetMap.png"),tooltip:"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; Ghana; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nhttp://www.esri.com",creationFunction:function(){return new t({url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",enablePickFeatures:!1})}})),l.push(new s({name:"ESRI National Geographic",iconUrl:e("Widgets/Images/ImageryProviders/esriNationalGeographic.png"),tooltip:"This web map contains the National Geographic World Map service. This map service is designed to be used as a general reference map for informational and educational purposes as well as a basemap by GIS professionals and other users for creating web maps and web mapping applications.\nhttp://www.esri.com",creationFunction:function(){return new t({url:"//services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/",enablePickFeatures:!1})}})),l.push(new s({name:"Open­Street­Map",iconUrl:e("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:"OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.\nhttp://www.openstreetmap.org",creationFunction:function(){return n({url:"//a.tile.openstreetmap.org/"})}})),l.push(new s({name:"Stamen Watercolor",iconUrl:e("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:"Reminiscent of hand drawn maps, Stamen watercolor maps apply raster effect area washes and organic edges over a paper texture to add warm pop to any map.\nhttp://maps.stamen.com",creationFunction:function(){return n({url:"//stamen-tiles.a.ssl.fastly.net/watercolor/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),l.push(new s({name:"Stamen Toner",iconUrl:e("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:"A high contrast black and white map.\nhttp://maps.stamen.com",creationFunction:function(){return n({url:"//stamen-tiles.a.ssl.fastly.net/toner/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),l.push(new s({name:"MapQuest Open­Street­Map",iconUrl:e("Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png"),tooltip:"OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.\nhttp://www.openstreetmap.org",creationFunction:function(){return n({url:"//otile1-s.mqcdn.com/tiles/1.0.0/osm/"})}})),l.push(new s({name:"The Black Marble",iconUrl:e("Widgets/Images/ImageryProviders/blackMarble.png"),tooltip:"The lights of cities and villages trace the outlines of civilization in this global view of the Earth at night as seen by NASA/NOAA's Suomi NPP satellite.",creationFunction:function(){return o({url:"//cesiumjs.org/blackmarble",maximumLevel:8,credit:"Black Marble imagery courtesy NASA Earth Observatory"})}})),l.push(new s({name:"Natural Earth II",iconUrl:e("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:"Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/",creationFunction:function(){return o({url:e("Assets/Textures/NaturalEarthII")})}})),l}return l}),i("Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels",["../../Core/buildModuleUrl","../../Core/CesiumTerrainProvider","../../Core/EllipsoidTerrainProvider","../BaseLayerPicker/ProviderViewModel"],function(e,t,i,r){"use strict";function n(){var n=[];return n.push(new r({name:"WGS84 Ellipsoid",iconUrl:e("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",creationFunction:function(){return new i}})),n.push(new r({name:"STK World Terrain meshes",iconUrl:e("Widgets/Images/TerrainProviders/STK.png"),tooltip:"High-resolution, mesh-based terrain for the entire globe. Free for use on the Internet. Closed-network options are available.\nhttp://www.agi.com",creationFunction:function(){return new t({url:"//assets.agi.com/stk-terrain/world",requestWaterMask:!0,requestVertexNormals:!0})}})),n}return n}),i("Widgets/CesiumInspector/CesiumInspectorViewModel",["../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Rectangle","../../Core/ScreenSpaceEventHandler","../../Core/ScreenSpaceEventType","../../Scene/DebugModelMatrixPrimitive","../../Scene/PerformanceDisplay","../../Scene/TileCoordinatesImageryProvider","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function m(e){var i;if(t(e)){i="Command Statistics";var r=e.commandsInFrustums;for(var n in r)if(r.hasOwnProperty(n)){var o,a=parseInt(n,10);if(7===a)o="1, 2 and 3";else{for(var s=[],l=2;l>=0;l--){var u=Math.pow(2,l);a>=u&&(s.push(l+1),a-=u)}o=s.reverse().join(" and ")}i+="<br>    "+r[n]+" in frustum "+o}i+="<br>Total: "+e.totalCommands}return i}function p(e,t,i){var r=Math.min(i,t);return r=Math.max(r,e)}function f(e,i){function r(e){v.removeInputAction(s.LEFT_CLICK),m.pickPrimitiveActive=!1;var i=m._scene.pick({x:e.position.x,y:e.position.y});t(i)&&(m.primitive=t(i.collection)?i.collection:i.primitive)}function n(e){var i,r=g.ellipsoid,n=m._scene.camera.pickEllipsoid({x:e.position.x,y:e.position.y},r);if(t(n))for(var a=r.cartesianToCartographic(n),l=g._surface.tileProvider._tilesToRenderByTextureCount,u=0;!i&&u<l.length;++u){var c=l[u];if(t(c))for(var h=0;!i&&h<c.length;++h){var d=c[h];o.contains(d.rectangle,a)&&(i=d)}}m.tile=i,v.removeInputAction(s.LEFT_CLICK),m.pickTileActive=!1}var m=this,f=e.canvas,v=new a(f);this._eventHandler=v,this._scene=e,this._canvas=f,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=i;var g=this._scene.globe;g.depthTestAgainstTerrain=!0,this.frustums=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.globeDepth=!1,this.pickDepth=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.depthFrustumText="1 of 1",this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText="",this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.generalSwitchText="-",this.primitivesSwitchText="+",this.terrainSwitchText="+",h.track(this,["filterTile","suspendUpdates","dropDownVisible","shaderCacheText","frustums","frustumStatisticText","pickTileActive","pickPrimitiveActive","hasPickedPrimitive","hasPickedTile","tileText","generalVisible","generalSwitchText","primitivesVisible","primitivesSwitchText","terrainVisible","terrainSwitchText","depthFrustumText"]),this._toggleDropDown=d(function(){m.dropDownVisible=!m.dropDownVisible}),this._toggleGeneral=d(function(){m.generalVisible=!m.generalVisible,m.generalSwitchText=m.generalVisible?"-":"+"}),this._togglePrimitives=d(function(){m.primitivesVisible=!m.primitivesVisible,m.primitivesSwitchText=m.primitivesVisible?"-":"+"}),this._toggleTerrain=d(function(){m.terrainVisible=!m.terrainVisible,m.terrainSwitchText=m.terrainVisible?"-":"+"}),this._showFrustums=d(function(){return m.frustums?m._scene.debugShowFrustums=!0:m._scene.debugShowFrustums=!1,!0}),this._showPerformance=d(function(){return m.performance?m._performanceDisplay=new u({container:m._performanceContainer}):m._performanceContainer.innerHTML="",!0}),this._showPrimitiveBoundingSphere=d(function(){return m._primitive.debugShowBoundingVolume=m.primitiveBoundingSphere,!0}),this._showPrimitiveReferenceFrame=d(function(){if(m.primitiveReferenceFrame){var e=m._primitive.modelMatrix;m._modelMatrixPrimitive=new l({modelMatrix:e}),m._scene.primitives.add(m._modelMatrixPrimitive)}else t(m._modelMatrixPrimitive)&&(m._scene.primitives.remove(m._modelMatrixPrimitive),m._modelMatrixPrimitive=void 0);return!0}),this._doFilterPrimitive=d(function(){return m.filterPrimitive?m._scene.debugCommandFilter=function(e){return t(m._modelMatrixPrimitive)&&e.owner===m._modelMatrixPrimitive._primitive?!0:t(m._primitive)?e.owner===m._primitive||e.owner===m._primitive._billboardCollection||e.owner.primitive===m._primitive:!1}:m._scene.debugCommandFilter=void 0,!0}),this._showWireframe=d(function(){return g._surface.tileProvider._debug.wireframe=m.wireframe,!0}),this._showGlobeDepth=d(function(){return m._scene.debugShowGlobeDepth=m.globeDepth,!0}),this._showPickDepth=d(function(){return m._scene.debugShowPickDepth=m.pickDepth,!0}),this._incrementDepthFrustum=d(function(){var e=m.depthFrustum+1;return m.depthFrustum=p(1,m._numberOfFrustums,e),m.scene.debugShowDepthFrustum=m.depthFrustum,!0}),this._decrementDepthFrustum=d(function(){var e=m.depthFrustum-1;return m.depthFrustum=p(1,m._numberOfFrustums,e),m.scene.debugShowDepthFrustum=m.depthFrustum,!0}),this._doSuspendUpdates=d(function(){return g._surface._debug.suspendLodUpdate=m.suspendUpdates,m.suspendUpdates||(m.filterTile=!1),!0});var _;this._showTileCoordinates=d(function(){return m.tileCoordinates&&!t(_)?_=e.imageryLayers.addImageryProvider(new c({tilingScheme:e.terrainProvider.tilingScheme})):!m.tileCoordinates&&t(_)&&(e.imageryLayers.remove(_),_=void 0),!0}),this._showTileBoundingSphere=d(function(){return m.tileBoundingSphere?g._surface.tileProvider._debug.boundingSphereTile=m._tile:g._surface.tileProvider._debug.boundingSphereTile=void 0,!0}),this._doFilterTile=d(function(){return m.filterTile?(m.suspendUpdates=!0,m.doSuspendUpdates(),g._surface._tilesToRender=[],t(m._tile)&&g._surface._tilesToRender.push(m._tile)):(m.suspendUpdates=!1,m.doSuspendUpdates()),!0}),this._pickPrimitive=d(function(){m.pickPrimitiveActive=!m.pickPrimitiveActive,m.pickPrimitiveActive?v.setInputAction(r,s.LEFT_CLICK):v.removeInputAction(s.LEFT_CLICK)}),this._pickTile=d(function(){m.pickTileActive=!m.pickTileActive,m.pickTileActive?v.setInputAction(n,s.LEFT_CLICK):v.removeInputAction(s.LEFT_CLICK)})}return i(f.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showFrustums:{get:function(){return this._showFrustums}},showPerformance:{get:function(){return this._showPerformance}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},showWireframe:{get:function(){return this._showWireframe}},showGlobeDepth:{get:function(){return this._showGlobeDepth}},showPickDepth:{get:function(){return this._showPickDepth}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},doSuspendUpdates:{get:function(){return this._doSuspendUpdates}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){var e=this;return d(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){var e=this;return d(function(){e.tile=e.tile.children[0]})}},selectNE:{get:function(){var e=this;return d(function(){e.tile=e.tile.children[1]})}},selectSW:{get:function(){var e=this;return d(function(){e.tile=e.tile.children[2]})}},selectSE:{get:function(){var e=this;return d(function(){e.tile=e.tile.children[3]})}},primitive:{set:function(e){var i=this._primitive;e!==i&&(this.hasPickedPrimitive=!0,t(i)&&(i.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,t(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())},get:function(){return this._primitive}},tile:{set:function(e){if(t(e)){this.hasPickedTile=!0;var i=this._tile;e!==i&&(this.tileText="L: "+e.level+" X: "+e.x+" Y: "+e.y,this.tileText+="<br>SW corner: "+e.rectangle.west+", "+e.rectangle.south,this.tileText+="<br>NE corner: "+e.rectangle.east+", "+e.rectangle.north,this.tileText+="<br>Min: "+e.data.minimumHeight+" Max: "+e.data.maximumHeight),this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0},get:function(){return this._tile}},update:{get:function(){var e=this;return function(){e.frustums&&(e.frustumStatisticText=m(e._scene.debugFrustumStatistics));var t=e._scene.numberOfFrustums;e._numberOfFrustums=t;var i=p(1,t,e.depthFrustum);e.depthFrustum=i,e.scene.debugShowDepthFrustum=i,e.depthFrustumText=i+" of "+t,e.performance&&e._performanceDisplay.update(),e.primitiveReferenceFrame&&(e._modelMatrixPrimitive.modelMatrix=e._primitive.modelMatrix),e.shaderCacheText="Cached shaders: "+e._scene.context.shaderCache.numberOfShaders}}}}),f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._eventHandler.destroy(),r(this)},f}),i("Widgets/CesiumInspector/CesiumInspector",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./CesiumInspectorViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(t,i){if(!e(t))throw new r("container is required.");if(!e(i))throw new r("scene is required.");t=o(t);var s=document.createElement("div"),l=new a(i,s);this._viewModel=l,this._container=t;var u=document.createElement("div");this._element=u;var c=document.createElement("div");c.textContent="Cesium Inspector",c.className="cesium-cesiumInspector-button",c.setAttribute("data-bind","click: toggleDropDown"),u.appendChild(c),u.className="cesium-cesiumInspector",u.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),t.appendChild(this._element);var h=document.createElement("div");this._panel=h,h.className="cesium-cesiumInspector-dropDown",u.appendChild(h);var d=document.createElement("div");d.className="cesium-cesiumInspector-sectionHeader";var m=document.createElement("span");m.className="cesium-cesiumInspector-toggleSwitch",m.setAttribute("data-bind","click: toggleGeneral, text: generalSwitchText"),d.appendChild(m),d.appendChild(document.createTextNode("General")),h.appendChild(d);var p=document.createElement("div");p.className="cesium-cesiumInspector-section",p.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : generalVisible, "cesium-cesiumInspector-hide" : !generalVisible}'),h.appendChild(p);var f=document.createElement("div");p.appendChild(f);var v=document.createElement("div");v.className="cesium-cesiumInspector-frustumStats",v.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : frustums, "cesium-cesiumInspector-hide" : !frustums}, html: frustumStatisticText');var g=document.createElement("input");g.type="checkbox",g.setAttribute("data-bind","checked: frustums, click: showFrustums"),f.appendChild(g),f.appendChild(document.createTextNode("Show Frustums")),f.appendChild(v);var _=document.createElement("div");p.appendChild(_);var y=document.createElement("input");y.type="checkbox",y.setAttribute("data-bind","checked: performance, click: showPerformance"),_.appendChild(y),_.appendChild(document.createTextNode("Performance Display")),s.className="cesium-cesiumInspector-performanceDisplay",p.appendChild(s);var C=document.createElement("div");C.className="cesium-cesiumInspector-shaderCache",C.setAttribute("data-bind","html: shaderCacheText"),p.appendChild(C);var E=document.createElement("div");p.appendChild(E);var S=document.createElement("input");S.type="checkbox",S.setAttribute("data-bind","checked: globeDepth, click: showGlobeDepth"),E.appendChild(S),E.appendChild(document.createTextNode("Show globe depth"));var w=document.createElement("div");E.appendChild(w);var T=document.createElement("div");p.appendChild(T);var x=document.createElement("input");x.type="checkbox",x.setAttribute("data-bind","checked: pickDepth, click: showPickDepth"),T.appendChild(x),T.appendChild(document.createTextNode("Show pick depth"));var b=document.createElement("div");p.appendChild(b);var A=document.createElement("span");A.setAttribute("data-bind",'html: "     Frustum:"'),b.appendChild(A);var P=document.createElement("span");P.setAttribute("data-bind","text: depthFrustumText"),b.appendChild(P);var I=document.createElement("input");I.type="button",I.value="-",I.className="cesium-cesiumInspector-pickButton",I.setAttribute("data-bind","click: decrementDepthFrustum"),b.appendChild(I);var M=document.createElement("input");M.type="button",M.value="+",M.className="cesium-cesiumInspector-pickButton",M.setAttribute("data-bind","click: incrementDepthFrustum"),b.appendChild(M);var D=document.createElement("div");D.className="cesium-cesiumInspector-sectionHeader",m=document.createElement("span"),m.className="cesium-cesiumInspector-toggleSwitch",m.setAttribute("data-bind","click: togglePrimitives, text: primitivesSwitchText"),D.appendChild(m),D.appendChild(document.createTextNode("Primitives")),h.appendChild(D);var R=document.createElement("div");R.className="cesium-cesiumInspector-section",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : primitivesVisible, "cesium-cesiumInspector-hide" : !primitivesVisible}'),h.appendChild(R);var O=document.createElement("div");O.className="cesium-cesiumInspector-pickSection",R.appendChild(O);var N=document.createElement("input");N.type="button",N.value="Pick a primitive",N.className="cesium-cesiumInspector-pickButton",N.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');var L=document.createElement("div");L.className="cesium-cesiumInspector-center",L.appendChild(N),O.appendChild(L);var F=document.createElement("div");O.appendChild(F);var B=document.createElement("input");B.type="checkbox",B.setAttribute("data-bind","checked: primitiveBoundingSphere, click: showPrimitiveBoundingSphere, enable: hasPickedPrimitive"),F.appendChild(B),F.appendChild(document.createTextNode("Show bounding sphere"));var V=document.createElement("div");O.appendChild(V);var k=document.createElement("input");k.type="checkbox",k.setAttribute("data-bind","checked: primitiveReferenceFrame, click: showPrimitiveReferenceFrame, enable: hasPickedPrimitive"),V.appendChild(k),V.appendChild(document.createTextNode("Show reference frame"));var z=document.createElement("div");this._primitiveOnly=z,O.appendChild(z);var U=document.createElement("input");U.type="checkbox",U.setAttribute("data-bind","checked: filterPrimitive, click: doFilterPrimitive, enable: hasPickedPrimitive"),z.appendChild(U),z.appendChild(document.createTextNode("Show only selected"));var G=document.createElement("div");G.className="cesium-cesiumInspector-sectionHeader",m=document.createElement("span"),m.className="cesium-cesiumInspector-toggleSwitch",m.setAttribute("data-bind","click: toggleTerrain, text: terrainSwitchText"),G.appendChild(m),G.appendChild(document.createTextNode("Terrain")),h.appendChild(G);var W=document.createElement("div");W.className="cesium-cesiumInspector-section",W.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : terrainVisible, "cesium-cesiumInspector-hide" : !terrainVisible}'),h.appendChild(W);var H=document.createElement("div");H.className="cesium-cesiumInspector-pickSection",W.appendChild(H);var q=document.createElement("input");q.type="button",q.value="Pick a tile",q.className="cesium-cesiumInspector-pickButton",q.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),L=document.createElement("div"),L.appendChild(q),L.className="cesium-cesiumInspector-center",H.appendChild(L);var j=document.createElement("div");H.appendChild(j);var Y=document.createElement("input");Y.type="button",Y.value="Parent",Y.className="cesium-cesiumInspector-pickButton",Y.setAttribute("data-bind","click: selectParent");var X=document.createElement("input");X.type="button",X.value="NW",X.className="cesium-cesiumInspector-pickButton",X.setAttribute("data-bind","click: selectNW");var Z=document.createElement("input");Z.type="button",Z.value="NE",Z.className="cesium-cesiumInspector-pickButton",Z.setAttribute("data-bind","click: selectNE");var K=document.createElement("input"); +K.type="button",K.value="SW",K.className="cesium-cesiumInspector-pickButton",K.setAttribute("data-bind","click: selectSW");var Q=document.createElement("input");Q.type="button",Q.value="SE",Q.className="cesium-cesiumInspector-pickButton",Q.setAttribute("data-bind","click: selectSE");var J=document.createElement("div");J.className="cesium-cesiumInspector-tileText",j.className="cesium-cesiumInspector-frustumStats",j.appendChild(J),j.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : hasPickedTile, "cesium-cesiumInspector-hide" : !hasPickedTile}'),J.setAttribute("data-bind","html: tileText");var $=document.createElement("div");$.className="cesium-cesiumInspector-relativeText",$.textContent="Select relative:",j.appendChild($);var ee=document.createElement("table"),te=document.createElement("tr"),ie=document.createElement("tr"),re=document.createElement("td");re.appendChild(Y);var ne=document.createElement("td");ne.appendChild(X);var oe=document.createElement("td");oe.appendChild(Z),te.appendChild(re),te.appendChild(ne),te.appendChild(oe);var ae=document.createElement("td"),se=document.createElement("td");se.appendChild(K);var le=document.createElement("td");le.appendChild(Q),ie.appendChild(ae),ie.appendChild(se),ie.appendChild(le),ee.appendChild(te),ee.appendChild(ie),j.appendChild(ee);var ue=document.createElement("div");H.appendChild(ue);var ce=document.createElement("input");ce.type="checkbox",ce.setAttribute("data-bind","checked: tileBoundingSphere, enable: hasPickedTile, click: showTileBoundingSphere"),ue.appendChild(ce),ue.appendChild(document.createTextNode("Show bounding volume"));var he=document.createElement("div");H.appendChild(he);var de=document.createElement("input");de.type="checkbox",de.setAttribute("data-bind","checked: filterTile, enable: hasPickedTile, click: doFilterTile"),he.appendChild(de),he.appendChild(document.createTextNode("Show only selected"));var me=document.createElement("div");W.appendChild(me);var pe=document.createElement("input");pe.type="checkbox",pe.setAttribute("data-bind","checked: wireframe, click: showWireframe"),me.appendChild(pe),me.appendChild(document.createTextNode("Wireframe"));var fe=document.createElement("div");W.appendChild(fe);var ve=document.createElement("input");ve.type="checkbox",ve.setAttribute("data-bind","checked: suspendUpdates, click: doSuspendUpdates"),fe.appendChild(ve),fe.appendChild(document.createTextNode("Suspend LOD update"));var ge=document.createElement("div");W.appendChild(ge);var _e=document.createElement("input");_e.type="checkbox",_e.setAttribute("data-bind","checked: tileCoordinates, click: showTileCoordinates"),ge.appendChild(_e),ge.appendChild(document.createTextNode("Show tile coordinates")),n.applyBindings(l,this._element)}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return n.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),i(this)},s}),i("Widgets/CesiumWidget/CesiumWidget",["../../Core/buildModuleUrl","../../Core/Cartesian3","../../Core/Clock","../../Core/Credit","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Ellipsoid","../../Core/FeatureDetection","../../Core/formatError","../../Core/requestAnimationFrame","../../Core/ScreenSpaceEventHandler","../../Scene/BingMapsImageryProvider","../../Scene/Globe","../../Scene/Moon","../../Scene/Scene","../../Scene/SceneMode","../../Scene/SkyAtmosphere","../../Scene/SkyBox","../../Scene/Sun","../getElement"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S){"use strict";function w(t){return e("Assets/Textures/SkyBox/tycho2t3_80_"+t+".jpg")}function T(e){function t(r){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{var n=e._targetFrameRate;if(o(n)){var a=1e3/n,s=r-i;s>a&&(e.resize(),e.render(),i=r-s%a),d(t)}else e.resize(),e.render(),d(t)}catch(l){if(e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors){var u="An error occurred while rendering. Rendering has stopped.";e.showErrorPanel(u,void 0,l)}}else e._renderLoopRunning=!1}e._renderLoopRunning=!0;var i=0;d(t)}function x(e){var t=e._canvas,i=t.clientWidth,r=t.clientHeight,o=e._resolutionScale;e._supportsImageRenderingPixelated||(o*=n(window.devicePixelRatio,1)),e._canvasWidth=i,e._canvasHeight=r,i*=o,r*=o,t.width=i,t.height=r,e._canRender=0!==i&&0!==r}function b(e){var t=e._canvas,i=t.width,r=t.height;if(0!==i&&0!==r){var n=e._scene.camera.frustum;o(n.aspectRatio)?n.aspectRatio=i/r:(n.top=n.right*(r/i),n.bottom=-n.top)}}function A(e,a){e=S(e),a=n(a,{});var s=document.createElement("div");s.className="cesium-widget",e.appendChild(s);var l=document.createElement("canvas"),h=c.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=h,h&&(l.style.imageRendering=c.imageRenderingValue()),l.oncontextmenu=function(){return!1},l.onselectstart=function(){return!1},s.appendChild(l);var d=document.createElement("div");d.className="cesium-widget-credits";var T=o(a.creditContainer)?S(a.creditContainer):s;T.appendChild(d);var A=n(a.showRenderLoopErrors,!0);this._element=s,this._container=e,this._canvas=l,this._canvasWidth=0,this._canvasHeight=0,this._creditContainer=d,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=A,this._resolutionScale=1,this._forceResize=!1,this._clock=o(a.clock)?a.clock:new i,x(this);try{var I=new g({canvas:l,contextOptions:a.contextOptions,creditContainer:d,mapProjection:a.mapProjection,orderIndependentTranslucency:a.orderIndependentTranslucency,scene3DOnly:n(a.scene3DOnly,!1),terrainExaggeration:a.terrainExaggeration});this._scene=I,I.camera.constrainedAxis=t.UNIT_Z,b(this);var M=n(I.mapProjection.ellipsoid,u.WGS84),D=I.frameState.creditDisplay,R=new r("Cesium",P,"http://cesiumjs.org/");D.addDefaultCredit(R);var O=a.globe;o(O)||(O=new f(M)),O!==!1&&(I.globe=O);var N=a.skyBox;o(N)||(N=new C({sources:{positiveX:w("px"),negativeX:w("mx"),positiveY:w("py"),negativeY:w("my"),positiveZ:w("pz"),negativeZ:w("mz")}})),N!==!1&&(I.skyBox=N,I.sun=new E,I.moon=new v);var L=a.skyAtmosphere;o(L)||(L=new y(M)),L!==!1&&(I.skyAtmosphere=L);var F=a.globe===!1?!1:a.imageryProvider;o(F)||(F=new p({url:"//dev.virtualearth.net"})),F!==!1&&I.imageryLayers.addImageryProvider(F),o(a.terrainProvider)&&a.globe!==!1&&(I.terrainProvider=a.terrainProvider),this._screenSpaceEventHandler=new m(l,!1),o(a.sceneMode)&&(a.sceneMode===_.SCENE2D&&this._scene.morphTo2D(0),a.sceneMode===_.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=n(a.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=a.targetFrameRate;var B=this;I.renderError.addEventListener(function(e,t){if(B._useDefaultRenderLoop=!1,B._renderLoopRunning=!1,B._showRenderLoopErrors){var i="An error occurred while rendering. Rendering has stopped.";B.showErrorPanel(i,void 0,t)}})}catch(V){if(A){var k="Error constructing CesiumWidget.",z='Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:';this.showErrorPanel(k,z,V)}throw V}}var P="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHYAAAAaCAYAAABikagwAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAN1wAADdcBQiibeAAAAAd0SU1FB9wGGRQyF371QVsAABOHSURBVGje7Vp5cFTHmf91v2Nm3owGnYMuEEJCOBiEjDlsDMYQjGMOOwmXcWxiLywpJ9iuTXZd612corJssFOxi8LerXizxEGUvWsivNxxHHCQ8WYBYSFzmUMCCXQjaUajOd/V+4f6Kc14kI/KZv/xq+p6M/PmO15/9/c1wa0vwpcMQAHgBuAFoPG7mz8jAGwASQBxADFhJQGYACwAjK+vrr/AJQ8jVMqfuwH4AGQByAaQnTNqXGHWqHGFbq8/g1BJsgw9GQ12Bds/qWsxEvEeAEEAfQDCAKKCgPGVcP//BOsIVQHgAZAJIACgsHTqvDvK7150T2bR2DFaZm6W4slwUypR20yaiUg4OtDbcaP36rlPPt6/7f2B3q5mAB0AeriAE18J9y93kVu4X4W73BwAhQBK5v/gZ98ZVXXvDG92IJMx569MQDEoK0tPmOHu1s4L7799sH7vtvcAXAPQCaCfu2qLu+7h+Eh3sS8Bcyt48iVgPos2+4J7jS+BIx2etDBSynfH/Xq46y0CUL70n3/zXMmUuXepWoZHFCQhFIQARCBFJYV6/Nn+QHnVBH9Ovq/51JFWADpfJhcqEzyDcx9ukTTr/xr2VnDpng0nuHR0h1u3wvWF6EspgBIAFYAfQAGAsuU/rfm7kePvvJ0QiTj6QSgBISS9ujEGSikkxaXklIwfK8uK2Xru2HVurWKspZyezGmmWwp/LqVsupPQub4grPQ5YIejKQvPJAGflLLJSBGmxPEqKXhU4XdJEBq7BR5Z+L+DKx3MTTHWEaybx9WCud/btCJQMeX2Qevk+NPoks0YPArF/RUj0NyXxOmO2CAy1a1OmL9yUVfTmatXTx52EildYFQVNlgRmBR1xQJgCBbPBAVUhcw8lTObLz0FVk4RIEmJJyJNZzFBiCTFBRL+f50rriFUATRFiZSU/XYEAw6X5LlIUghZqXvl5p8pfycRZsgjymlKGw1Adm7JbRUVs785nwGghP5pp9mfFMOxWstmuC3gwdcrRqA/buJUWwyKRMAYgydrZNZt9337623njn+ixyN9nAmdM5nBvYOPfxc3mnEmTQ4T5VZv8hfz8aUKnocJd5tvVhxAhOMADzNefleFjRUFa/D/xzi8LQhIEpTG4VXnNBzlZYISufk7juCfqaAoLkHYcZ6HBAEM8O+ObJz3HcFDpJfDJwWYfiHMMTklviocKHv6I3+zRFLdKhEEatmALBFIBIibNhQ6KFyJEjT2JHDoUj/a+nVIVIBhBGOnzptWXzhmTFfT2TZBOH4AgSeeeGJqRUVFqdfr9btcLnVQXwapmqZpJZPJRCgUCh47duzie++9dwWAXl5enrlp06bF0WhUM01TYYwRrmg2vzNKqS3Lsunz+Yy6urpTP//5z09blkVLSkryVq9ePT03NzegqqqbUnqTGyOEMNM0k319fX2///3vz9bW1l4DYD700EPFy5Ytm65pmvbBBx9c2rp166Wnnnqq7MEHH5zAGIu8/vrr+w8ePPgJVwrRO2gAcg8cOLA2mUx62tvbB9avX39s+fLlo++///5JXNiwbXugpqam9tChQ2cEj6NzuQwlsi+//PKSzMzMQtu2qcfjMZqbm09v2LDht4J3sQEQOU2Jo8mKKzt7VEU5lSgFBi3PZkBZrgv3lGbCo1Jc7I7iSGN40JcQgoGkhXdO94ESQJEoGI+1k/M9mDKqQHEv++akl186e45rNAAE3njjjccWLFhwfyAQyJEkiabGbcc7JJNJva2trX3Lli3vvPbaa+eKi4uLV6xY8d10cf5TcZ8x5OXl5b366qs9lFLtrbfeWldVVXW7pmkuxhjS0SSEIJlMGitXrrz2/PPPv1lTU3NtypQp0x955JG/kmVZdrlcR7du3WrOnTt33pIlS+YDwNGjR68ePHiwjVtukm+wI9ichQsXPgUAHR0d3evXr78xc+bMu9asWbOQUjpENz8/v/jQoUP/IiiH40UzAeQvW7Zs1rp16/7a5/NpDr/19fWlGzZsOM4tNsphkc5iPaXTvl6uuDUvY4MZLwNQ4Ffw+LR8+KQQTCuJSQUFcMsEe88FoSkSKCFwyWSISQbg9pEefHdGAJHIdUydVjFecL3K448/Pm3hwoUPBAKBHFGIlmU5pRCRpMGEze12q2PHjh2zatWqeTt37gwODAxkOQIJhUJ6Y2Njn6IojFJqE0KYsGyPx0POnTvXnUgkfGvXrr1j5syZU7iFsKampv5YLBZ34GzbJgAwatSo7MzMTE95eXnZT37yk0dramr+PRQKZSQSCdPn88nBYNADID8UCmkAYBiGGQ6Hna6cksbdZliWZUuSRKPRKAAUBINBfywWM30+n+yEtenTp9+5YsWKGTt37oxwz+a44RwARc8+++xSr9eriQrY398v8311CUncTTHN0Q7Vl1OQJymq4iBwyxQPT8qDVwri1d1/i8ttp/AP39mOBeMn41pQx9mOGFSZ3qT52ZqMR6aMRGvXKfzbgX9Ea3PnSLEdOWXKlK/5/X4/AFy8ePHG6tWr90QikS5VVaOEEIsxRhljngcffLBi8+bNjxBCUFJSMrKkpMRvGIbboXP27Nn+2bNn/3cgEIgSQmKEEAOARQixKKVxRVEioVAoYtu2dMcdd4x24Hbv3t3+ox/96ONoNBqklMa4ppNkMinNnz8///nnn6/y+Xw0mUxaANy6rrsdl28YhguAX9d1F98jwn9TUjJkJ5N1DWV0ti0ByDAMw+PsbzQatX0+Hy0oKMhcvnz5nP3791+IxWJRIUaPfO655+ZVVlaOA4BoNGprmkZ5uJJThZouKyYAqOrWVEKoE7cwszQDlQUK3jr8S5y++iEIIXh55/fwylOH8e3KHHSEdfQnLFBuRbJEsLQyF27Sh3eO/iuudV+EaSuqkJF6MjMzs9xutwIAv/rVr06eOHHiEwCtPBHQOaPaxYsXLxcXF8cKCwtzOzo6+ltbW4OFhYU+h2nDMAgAqbu7W8xkLSEBcsos1bbtocZIIBBQs7Ky5Pb2dkvXdV1wfaipqemsqak5yF1bFABljNEU4Sj87nia1LKHCJWGLLh6AkDhiksAoLq6um/VqlWZWVlZ8gMPPHDHwoULK2tqasJcYJ7y8vKyb33rW/f4/X43YwybNm26vnnz5pIUb0tvVe44maSVjEfizDJtmwFlOS4srczGiQvv4ncnd4ASAkIo+mN92LLrB/j7Vb/GQxOz8Z/1PTDsQXc6p3QEqopU7Dr6S5y8fAiKpCKhs6SQSUqyLKsO4d7e3j4AvbxD1csFQQF4EolEaP369TVCFjuiqKiogG8w5s6dm8sY++ZwcfbZZ5/dvHXr1isnT55scVz+rFmz8urr6xc4Ls22bZZIJExd181oNGr09PREDx06dPmFF144Ho/HTVGIjiE4guECoyl1LYTPcppGEAghDAAikUjixRdfbHnppZfKfD6fa82aNfMOHz7cHgwGbwBwr1ix4u677rqrgsfU4I4dO66lCPZTXSkqpOaMa60e7mjuosw0RmYoWHf3SLT3NOKt91+CbsZBeOlDCcX5luP4rw9fw4wSH+4p9cMlU3xtpAfLJmej/vIR7PnjLyDRwXeKhoxubokWAOYkDXxTLE5brB11oTZMCrWoNQgymJwZhsHC4bAZjUaNaDRqxGIx3VnxeDzJky8TQGLHjh3n9u3bd6ytrS3U2dkZ6e3tjfX398cHBgYS8XjcIIQQr9frKioq8ldWVhb88Ic/vHfbtm3zAXhs25aHUx7uEt1COeXEXM3JfAWLvWnSxRhLbNu2rampqSlMCME3vvGNyXPmzKkCUFZeXn776tWr72WMwbZtvPDCCx+5XK6wo6BcOdhwQ4Chuu/KR39onDGS9T80u9ivkgiqD/0UbT2NcKvelMaEhXfrqlGaPwEPT5qH0lwvqopcaOtpxPb3/gmGmYBEFRBC0HUlfp67tQQALxMKYsaYU+tlcSadNN8NIOO+++4bnZ2d7Q+Hw+zIkSNJxtiQ9TQ1NUW3bNnSmJWVlZBlWaeUWs5SVTUxYsSIRF1dXScAwzTN2MMPP7w3Pz//ZFVVVUFubq7L6/VKmqZRl8ulKIriVlVVmz59ev6cOXMCLpeLLliwYDyAOpGm08SglA659mQy6eHTrwiPtRYXbi6vP2/yjI61AoDL5Ur09vZ2bt++/ezGjRvvppSSjRs3Lti9e/fvnnzyyfHjx48fyRjDwYMHL9TW1jYWFhZ6xfIs3UhUTlPQRwGE9Gv/c/ba9YGi2rPv0FONf/iUUB3Lj8SDqD60GYtmdGBcYSVOnL+K39b9Gp19zVDkwZzBSpLY9Qv9Z3lKHgOgmaYZd9zg1KlTS994441L3G3lcD6oo/1btmxZFwgEctrb27vWrFlzwLIs2cmKW1pa4q+//vp1AbchdIKiPGZHAJDFixcHpk+ffnsoFNLefvvt3ra2Nl0YSDhdt4zy8vLwsWPHsl0ul6ooigSACuEZXKBJwzAMxhhUVZW8Xm8uH5hQ3mCwOf95VVVVYx03yQVhUEpNQbBxADfefPPN6NKlS8dUVlYWVlZW5r344osz1q1bV8IYQzAYjFVXV5+IxWIdkiTlpfDCUgcC6Sw2CqBvw4ZN+7/9d+Wzo1avT5HU9N1tMpj4dfU14z/efxletx9xPYpIPAhVccO2bVBKcf189I/h3mSLkBi5b9y40RWLxZJer9f12GOPTa6oqMjq6enpJYQYlFLGyx21tLQ0MGnSpDGEECQSCZMQIjuNCF6aqI8++mheVlZWJrdYkzcoLEVREj6fL1FfX39x165dzfPnzy/7/ve/v1LXdWvlypVde/bsuRKLxQyn1LEsS2aMeebNm1fs8/lkxhgsy7IAJBRF0Yc2TZZ1AANNTU0djoJt2rRpzqxZs/K6urq6JUnSCSHMMAxZ07SsxYsXV1JKCWMMAwMDMQBhVVWTjtU6gr1y5Yq1d+/ej8aNG5eraZr6zDPPjPV4PBJjDLW1ted27dr1MYCYqqpDcpMkyRIaEyydxToxNgagr7e3t+XEe0rNxPkjnvhTznNr4Sb0KBL6YO9BovJQnRXptTqaPgr9wTLsDgAhTkOurq4+unz58vs1TRvl9/vVuXPnljHGxgqxw2GcEjLYJLlw4cKV06dPd06bNo04+MePH+/ftm3bNNG1iW5KVVVl//79ew4cONC8d+/ey88884ysKIp85513jpo8eXJh2pHX4EUIITh58uRFAN1utzvHcb0ejycGoKuurk5vbW29u7i4ODB69OisJ5988i4xxDhsKIoiEUJgmqZ94MCBOgBdmqaVODxrmhbhiaP+4x//+N2lS5dOmjBhwhiPxyMBQFdXV191dfX7tm23AdBdLtdQzFYUxWmb3iRcmqbh7vQfOz9+v/PdjvP6kcHuE288MJZWuM4Smw1mgkQvHw/v6Wga+BjADY53AEDfmTNnLq9du/Znp06datB13RA3ROwGmaZphcPhgX379v326aefftO27Tafz9fJGGOmadqMMSbLMpEkiaZbjDFommYQQsK1tbWNr7zyymvhcLifEIJbwRBCmGVZ1vHjxz9atGjRLwA0Z2dndzpdHb/fHwTQcuLEiYann3761fPnz3+i67pBCCGUUkoIofwjpZQS27ZZd3f3ja1bt1Zv3LhxL4CrmZmZPYQQkxCCjIyMEIB2AG0Amrdv3/6beDweNwzD1nXdPHXq1Indu3cf48+7MjIyupw98ng8EW4wCWH4kHbQLgsnJ4oAlN332Ji1hbeps6lEaLohQLrhQCJi9zcei77TcLh9H4CrALp4rLN5LBvBE4scAP6JEyfmBQIBL6VUopSCMcYGBgYSly5dCvX19YW5QkQAmD6fz3PvvfeWxmIxr2EYHqFXPBRrKKWWJEmG1+uNtbW1dTU0NNzgz7wA/OXl5bkFBQV+XsYQwVpZMpk0jh8/3snpRQCYo0aN8k6YMCHX5XLRa9euBRsaGnr4Jnp458c7ceLEbK/X6xL5MQzDbGhoCNq2HeO4YgBYWVmZv6KiIkdVVbS0tHQ3NDR0CsORrDlz5oyllHoYY3p9ff31cDjczeGhaVrGkiVLSg3DkLu7u/s+/PDDFn4UKeJYLhnmAJvGs9QCAKOnLMhfNHqSNl/LlHOpTORbWa4et2ORXqv1wgf9NVfO9B7nTYcuPvlICq02t9CJ8ggjOJomodOF0ZQtHNvxCC08pBnbmcIhO53jdA7mpXaKUkOSWGoxYaaKlIa7IozT0uET+XDGehDGhhBGb6bTmBHezeb8OyNPCPQk/ptzeHConCSfcZDNI1hWQXaBVl5254hZmSPVce4MKUdxEQ+VJMnUbcNIWJFoyOzoa02eOX2k+yg/79TFNWkgZchOUobe4vA63WzUEmpYsa+dCoM0Izgz5aQkTUOPpGvUpKFJBaUR8Q03cLdT8NkppyEgPGOCYcnCiNASsn2SwrstDA2Gxnbkc5xSdHGrcmaBWYoqZ+YUe4pcXuqXJCobupWIhaze3vZohzAfdOaKN2mSwPxwR0ZSZ6uptZoIN9yxFCYIiqV5v3THStgwNNPhvtXxFgzDP9K8q52Cj6ZRNnaLffoUDfI5zhVLgrvxCN0Ux5URYXYYF84Wf2qqf4uDV591ZuiLHir7c8F+mZOU5M+Iazg8n3mYjnxORkV3I6dxg6KrMQW3Yaexlq+uv8D1v2IL+t4z3B/NAAAAAElFTkSuQmCC";return a(A.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},camera:{get:function(){return this._scene.camera}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){if(0>=e)throw new l("targetFrameRate must be greater than 0, or undefined.");this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&T(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){if(0>=e)throw new l("resolutionScale must be greater than 0.");this._resolutionScale=e,this._forceResize=!0}}}),A.prototype.showErrorPanel=function(e,t,i){function r(){u.style.maxHeight=Math.max(Math.round(.9*n.clientHeight-100),30)+"px"}var n=this._element,a=document.createElement("div");a.className="cesium-widget-errorPanel";var s=document.createElement("div");s.className="cesium-widget-errorPanel-content",a.appendChild(s);var l=document.createElement("div");l.className="cesium-widget-errorPanel-header",l.appendChild(document.createTextNode(e)),s.appendChild(l);var u=document.createElement("div");if(u.className="cesium-widget-errorPanel-scroll",s.appendChild(u),r(),o(window.addEventListener)&&window.addEventListener("resize",r,!1),o(t)){var c=document.createElement("div");c.className="cesium-widget-errorPanel-message",c.innerHTML="<p>"+t+"</p>",u.appendChild(c)}var d="(no error details available)";o(i)&&(d=h(i));var m=document.createElement("div");m.className="cesium-widget-errorPanel-message",m.appendChild(document.createTextNode(d)),u.appendChild(m);var p=document.createElement("div");p.className="cesium-widget-errorPanel-buttonPanel",s.appendChild(p);var f=document.createElement("button");f.setAttribute("type","button"),f.className="cesium-button",f.appendChild(document.createTextNode("OK")),f.onclick=function(){o(r)&&o(window.removeEventListener)&&window.removeEventListener("resize",r,!1),n.removeChild(a)},p.appendChild(f),n.appendChild(a),"undefined"!=typeof console&&console.error(e+"\n"+t+"\n"+d)},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){this._scene=this._scene&&this._scene.destroy(),this._container.removeChild(this._element),s(this)},A.prototype.resize=function(){var e=this._canvas,t=e.clientWidth,i=e.clientHeight;(this._forceResize||this._canvasWidth!==t||this._canvasHeight!==i)&&(this._forceResize=!1,x(this),b(this))},A.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();var e=this._clock.tick();this._scene.render(e)}else this._clock.tick()},A}),i("Widgets/ClockViewModel",["../Core/Clock","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/EventHelper","../Core/JulianDate","../ThirdParty/knockout"],function(e,t,i,r,n,o,a){"use strict";function s(i){t(i)||(i=new e),this._clock=i,this._eventHelper=new n,this._eventHelper.add(i.onTick,this.synchronize,this);var r=a.observable(i.startTime);r.equalityComparer=o.equals,this.systemTime=a.observable(o.now()),this.systemTime.equalityComparer=o.equals,a.track(this,["systemTime"]),this.startTime=void 0,a.defineProperty(this,"startTime",{get:r,set:function(e){r(e),i.startTime=e}});var s=a.observable(i.stopTime);s.equalityComparer=o.equals,this.stopTime=void 0,a.defineProperty(this,"stopTime",{get:s,set:function(e){i.stopTime=e,s(e)}});var l=a.observable(i.currentTime);l.equalityComparer=o.equals,this.currentTime=void 0,a.defineProperty(this,"currentTime",{get:l,set:function(e){i.currentTime=e,l(e)}});var u=a.observable(i.multiplier);this.multiplier=void 0,a.defineProperty(this,"multiplier",{get:u,set:function(e){i.multiplier=e,u(e)}});var c=a.observable(i.clockStep);c.equalityComparer=function(e,t){return e===t},this.clockStep=void 0,a.defineProperty(this,"clockStep",{get:c,set:function(e){c(e),i.clockStep=e}});var h=a.observable(i.clockRange);h.equalityComparer=function(e,t){return e===t},this.clockRange=void 0,a.defineProperty(this,"clockRange",{get:h,set:function(e){h(e),i.clockRange=e}});var d=a.observable(i.canAnimate);this.canAnimate=void 0,a.defineProperty(this,"canAnimate",{get:d,set:function(e){d(e),i.canAnimate=e}});var m=a.observable(i.shouldAnimate);this.shouldAnimate=void 0,a.defineProperty(this,"shouldAnimate",{get:m,set:function(e){m(e),i.shouldAnimate=e}})}return i(s.prototype,{clock:{get:function(){return this._clock}}}),s.prototype.synchronize=function(){var e=this._clock,t=e.startTime,i=e.stopTime,r=e.currentTime,n=e.multiplier,a=e.clockStep,s=e.clockRange,l=e.canAnimate,u=e.shouldAnimate;this.systemTime=o.now(),this.startTime=t,this.stopTime=i,this.currentTime=r,this.multiplier=n,this.clockStep=a,this.clockRange=s,this.canAnimate=l,this.shouldAnimate=u},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){this._eventHelper.removeAll(),r(this)},s}),i("Widgets/Command",["../Core/DeveloperError"],function(e){"use strict";function t(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,e.throwInstantiationError()}return t}),i("Widgets/FullscreenButton/FullscreenButtonViewModel",["../../Core/defaultValue","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Fullscreen","../../ThirdParty/knockout","../createCommand","../getElement"],function(e,t,i,r,n,o,a,s){"use strict";function l(t){var i=this,r=o.observable(n.fullscreen),l=o.observable(n.enabled);this.isFullscreen=void 0,o.defineProperty(this,"isFullscreen",{get:function(){return r()}}),this.isFullscreenEnabled=void 0,o.defineProperty(this,"isFullscreenEnabled",{get:function(){return l()},set:function(e){l(e&&n.enabled)}}),this.tooltip=void 0,o.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?r()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=a(function(){n.fullscreen?n.exitFullscreen():n.requestFullscreen(i._fullscreenElement)},o.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=e(s(t),document.body),this._callback=function(){r(n.fullscreen)},document.addEventListener(n.changeEventName,this._callback)}return t(l.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){document.removeEventListener(n.changeEventName,this._callback),i(this)},l}),i("Widgets/FullscreenButton/FullscreenButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./FullscreenButtonViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t){e=o(e);var i=new a(t);i._exitFullScreenPath=u,i._enterFullScreenPath=l;var r=document.createElement("button");r.type="button",r.className="cesium-button cesium-fullscreenButton",r.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(r),n.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}var l="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",u="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),i("Widgets/Geocoder/GeocoderViewModel",["../../Core/BingMapsApi","../../Core/Cartesian3","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Event","../../Core/loadJsonp","../../Core/Matrix4","../../Core/Rectangle","../../Scene/SceneMode","../../ThirdParty/knockout","../../ThirdParty/when","../createCommand"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m){"use strict";function p(t){this._url=i(t.url,"//dev.virtualearth.net/"),this._url.length>0&&"/"!==this._url[this._url.length-1]&&(this._url+="/"),this._key=e.getKey(t.key),this._scene=t.scene,this._flightDuration=t.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._geocodeInProgress=void 0,this._complete=new a;var r=this;this._searchCommand=m(function(){r.isSearchInProgress?g(r):v(r)}),h.track(this,["_searchText","_isSearchInProgress"]),this.isSearchInProgress=void 0,h.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,h.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(e){this._searchText=e}}),this.flightDuration=void 0,h.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(e){this._flightDuration=e}})}function f(e,t){e._scene.camera.flyTo({destination:t,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:l.IDENTITY,convert:!1})}function v(e){var i=e.searchText;if(!/^\s*$/.test(i)){var r=i.match(/[^\s,\n]+/g);if(2===r.length||3===r.length){var n=+r[0],o=+r[1],a=3===r.length?+r[2]:300;if(!isNaN(n)&&!isNaN(o)&&!isNaN(a))return void f(e,t.fromDegrees(n,o,a))}e._isSearchInProgress=!0;var l=s(e._url+"REST/v1/Locations",{parameters:{query:i,key:e._key},callbackParameterName:"jsonp"}),c=e._geocodeInProgress=d(l,function(t){if(!c.cancel){if(e._isSearchInProgress=!1,0===t.resourceSets.length)return void(e.searchText=e._searchText+" (not found)");var i=t.resourceSets[0];if(0===i.resources.length)return void(e.searchText=e._searchText+" (not found)");var r=i.resources[0];e._searchText=r.name;var n=r.bbox,o=n[0],a=n[1],s=n[2],l=n[3];f(e,u.fromDegrees(a,o,l,s))}},function(){c.cancel||(e._isSearchInProgress=!1,e.searchText=e._searchText+" (error)")})}}function g(e){e._isSearchInProgress=!1,r(e._geocodeInProgress)&&(e._geocodeInProgress.cancel=!0,e._geocodeInProgress=void 0)}return n(p.prototype,{url:{get:function(){return this._url}},key:{get:function(){return this._key}},complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}}}),p}),i("Widgets/Geocoder/Geocoder",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./GeocoderViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){var t=a(e.container),i=new s(e);i._startSearchPath=u,i._stopSearchPath=c;var r=document.createElement("form");r.setAttribute("data-bind","submit: search");var l=document.createElement("input");l.type="search",l.className="cesium-geocoder-input",l.setAttribute("placeholder","Enter an address or landmark..."),l.setAttribute("data-bind",'value: searchText,valueUpdate: "afterkeydown",disable: isSearchInProgress,css: { "cesium-geocoder-input-wide" : searchText.length > 0 }'),r.appendChild(l);var h=document.createElement("span");h.className="cesium-geocoder-searchButton",h.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),r.appendChild(h),t.appendChild(r),o.applyBindings(i,r),this._container=t,this._viewModel=i,this._form=r,this._onInputBegin=function(e){t.contains(e.target)||l.blur()},this._onInputEnd=function(e){t.contains(e.target)&&l.focus()},n.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),document.addEventListener("pointerup",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),document.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),document.addEventListener("touchend",this._onInputEnd,!0))}var u="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",c="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";return t(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return n.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),document.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),document.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),document.removeEventListener("touchend",this._onInputEnd,!0)),o.cleanNode(this._form),this._container.removeChild(this._form),i(this)},l}),i("Widgets/HomeButton/HomeButtonViewModel",["../../Core/Cartesian3","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Matrix4","../../Core/Rectangle","../../Scene/Camera","../../Scene/SceneMode","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(t,r){var n=t.mode;if(i(t)&&n===l.MORPHING&&t.completeMorph(),n===l.SCENE2D)t.camera.flyTo({destination:a.MAX_VALUE,duration:r,endTransform:o.IDENTITY});else if(n===l.SCENE3D){var u=t.camera.getRectangleCameraCoordinates(s.DEFAULT_VIEW_RECTANGLE),c=e.magnitude(u);c+=c*s.DEFAULT_VIEW_FACTOR,e.normalize(u,u),e.multiplyByScalar(u,c,u),t.camera.flyTo({destination:u,duration:r,endTransform:o.IDENTITY})}else if(n===l.COLUMBUS_VIEW){var h=t.globe.ellipsoid.maximumRadius,d=new e(0,-1,1);d=e.multiplyByScalar(e.normalize(d,d),5*h,d),t.camera.flyTo({destination:d,duration:r,orientation:{heading:0,pitch:-Math.acos(e.normalize(d,m).z),roll:0},endTransform:o.IDENTITY,convert:!1})}}function d(e,t){this._scene=e,this._duration=t;var i=this;this._command=c(function(){h(i._scene,i._duration)}),this.tooltip="View Home",u.track(this,["tooltip"])}var m=new e;return r(d.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}}),d}),i("Widgets/HomeButton/HomeButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./HomeButtonViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,i){e=o(e);var r=new a(t,i);r._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";var s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-home-button",s.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(s),n.applyBindings(r,s),this._container=e,this._viewModel=r,this._element=s}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),i("Widgets/InfoBox/InfoBoxViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/Event","../../ThirdParty/knockout"],function(e,t,i,r){ +"use strict";function n(){this._cameraClicked=new i,this._closeClicked=new i,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",r.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,r.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?a:o}}),r.defineProperty(this,"_bodyless",{get:function(){return!e(this.description)||0===this.description.length}})}var o="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",a="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";return n.prototype.maxHeightOffset=function(e){return this.maxHeight-e+"px"},t(n.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}}),n}),i("Widgets/InfoBox/InfoBox",["../../Core/buildModuleUrl","../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","../subscribeAndEvaluate","./InfoBoxViewModel"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(r){r=s(r);var n=document.createElement("div");n.className="cesium-infoBox",n.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),r.appendChild(n);var o=document.createElement("div");o.className="cesium-infoBox-title",o.setAttribute("data-bind","text: titleText"),n.appendChild(o);var c=document.createElement("button");c.type="button",c.className="cesium-button cesium-infoBox-camera",c.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),n.appendChild(c);var h=document.createElement("button");h.type="button",h.className="cesium-infoBox-close",h.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),h.innerHTML="×",n.appendChild(h);var d=document.createElement("iframe");d.className="cesium-infoBox-iframe",d.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),d.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),d.setAttribute("allowfullscreen",!0),n.appendChild(d);var m=new u;a.applyBindings(m,n),this._container=r,this._element=n,this._frame=d,this._viewModel=m,this._descriptionSubscription=void 0;var p=this;d.addEventListener("load",function(){var r=d.contentDocument,o=r.createElement("link");o.href=e("Widgets/InfoBox/InfoBoxDescription.css"),o.rel="stylesheet",o.type="text/css";var a=r.createElement("div");a.className="cesium-infoBox-description",r.head.appendChild(o),r.body.appendChild(a),p._descriptionSubscription=l(m,"description",function(e){d.style.height="5px",a.innerHTML=e;var r=null,o=a.firstElementChild;if(null!==o&&1===a.childNodes.length){var s=window.getComputedStyle(o);if(null!==s){var l=s["background-color"],u=t.fromCssColorString(l);i(u)&&0!==u.alpha&&(r=s["background-color"])}}n.style["background-color"]=r;var c=a.getBoundingClientRect().height;d.style.height=c+"px"})}),d.setAttribute("src","about:blank")}return r(c.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}}),c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){var e=this._container;return a.cleanNode(this._element),e.removeChild(this._element),i(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),n(this)},c}),i("Widgets/NavigationHelpButton/NavigationHelpButtonViewModel",["../../Core/defineProperties","../../ThirdParty/knockout","../createCommand"],function(e,t,i){"use strict";function r(){this.showInstructions=!1;var e=this;this._command=i(function(){e.showInstructions=!e.showInstructions}),this._showClick=i(function(){e._touch=!1}),this._showTouch=i(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",t.track(this,["tooltip","showInstructions","_touch"])}return e(r.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}}),r}),i("Widgets/NavigationHelpButton/NavigationHelpButton",["../../Core/buildModuleUrl","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./NavigationHelpButtonViewModel"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(i){var r=l(i.container),n=new u,o=t(i.instructionsInitiallyVisible,!1);n.showInstructions=o,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";var c=document.createElement("span");c.className="cesium-navigationHelpButton-wrapper",r.appendChild(c);var h=document.createElement("button");h.type="button",h.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",h.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),c.appendChild(h);var d=document.createElement("div");d.className="cesium-navigation-help",d.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),c.appendChild(d);var m=document.createElement("button");m.type="button",m.className="cesium-navigation-button cesium-navigation-button-left",m.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');var p=document.createElement("img");p.src=e("Widgets/Images/NavigationHelp/Mouse.svg"),p.className="cesium-navigation-button-icon",p.style.width="25px",p.style.height="25px",m.appendChild(p),m.appendChild(document.createTextNode("Mouse"));var f=document.createElement("button");f.type="button",f.className="cesium-navigation-button cesium-navigation-button-right",f.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');var v=document.createElement("img");v.src=e("Widgets/Images/NavigationHelp/Touch.svg"),v.className="cesium-navigation-button-icon",v.style.width="25px",v.style.height="25px",f.appendChild(v),f.appendChild(document.createTextNode("Touch")),d.appendChild(m),d.appendChild(f);var g=document.createElement("div");g.className="cesium-click-navigation-help cesium-navigation-help-instructions",g.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),g.innerHTML=' <table> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/MouseLeft.svg")+'" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/MouseRight.svg")+'" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/MouseMiddle.svg")+'" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>',d.appendChild(g);var _=document.createElement("div");_.className="cesium-touch-navigation-help cesium-navigation-help-instructions",_.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),_.innerHTML=' <table> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/TouchDrag.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/TouchZoom.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/TouchTilt.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/TouchRotate.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>',d.appendChild(_),s.applyBindings(n,c),this._container=r,this._viewModel=n,this._wrapper=c,this._closeInstructions=function(e){c.contains(e.target)||(n.showInstructions=!1)},a.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}return r(c.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return a.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),s.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),n(this)},c}),i("Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Scene/FrameRateMonitor","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s){"use strict";function l(t){this._scene=t.scene,this.lowFrameRateMessage=e(t.lowFrameRateMessage,"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,a.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);var i=this;this._dismissMessage=s(function(){i.showingLowFrameRateMessage=!1,i.lowFrameRateMessageDismissed=!0});var r=o.fromScene(t.scene);this._unsubscribeLowFrameRate=r.lowFrameRate.addEventListener(function(){i.lowFrameRateMessageDismissed||(i.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=r.nominalFrameRate.addEventListener(function(){i.showingLowFrameRateMessage=!1})}return i(l.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}}),l.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),r(this)},l}),i("Widgets/PerformanceWatchdog/PerformanceWatchdog",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./PerformanceWatchdogViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e){var t=o(e.container),i=new a(e),r=document.createElement("div");r.className="cesium-performance-watchdog-message-area",r.setAttribute("data-bind","visible: showingLowFrameRateMessage");var s=document.createElement("button");s.setAttribute("type","button"),s.className="cesium-performance-watchdog-message-dismiss",s.innerHTML="×",s.setAttribute("data-bind","click: dismissMessage"),r.appendChild(s);var l=document.createElement("div");l.className="cesium-performance-watchdog-message",l.setAttribute("data-bind","html: lowFrameRateMessage"),r.appendChild(l),t.appendChild(r),n.applyBindings(i,r),this._container=t,this._viewModel=i,this._element=r}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),i("Widgets/SceneModePicker/SceneModePickerViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Scene/SceneMode","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,i){this._scene=t;var r=this,n=function(e,t,i,n){r.sceneMode=i,r.dropDownVisible=!1};this._eventHelper=new o,this._eventHelper.add(t.morphStart,n),this._duration=e(i,2),this.sceneMode=t.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",s.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,s.defineProperty(this,"selectedTooltip",function(){var e=r.sceneMode;return e===a.SCENE2D?r.tooltip2D:e===a.SCENE3D?r.tooltip3D:r.tooltipColumbusView}),this._toggleDropDown=l(function(){r.dropDownVisible=!r.dropDownVisible}),this._morphTo2D=l(function(){t.morphTo2D(r._duration)}),this._morphTo3D=l(function(){t.morphTo3D(r._duration)}),this._morphToColumbusView=l(function(){t.morphToColumbusView(r._duration)}),this._sceneMode=a}return i(u.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}}),u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){this._eventHelper.removeAll(),r(this)},u}),i("Widgets/SceneModePicker/SceneModePicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./SceneModePickerViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t,i){e=a(e);var r=new s(t,i);r._globePath=u,r._flatMapPath=c,r._columbusViewPath=h;var l=document.createElement("span");l.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(l);var d=document.createElement("button");d.type="button",d.className="cesium-button cesium-toolbar-button",d.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),d.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',l.appendChild(d);var m=document.createElement("button");m.type="button",m.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",m.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),l.appendChild(m);var p=document.createElement("button");p.type="button",p.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",p.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),l.appendChild(p);var f=document.createElement("button");f.type="button",f.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",f.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),l.appendChild(f),o.applyBindings(r,l),this._viewModel=r,this._container=e,this._wrapper=l,this._closeDropDown=function(e){l.contains(e.target)||(r.dropDownVisible=!1)},n.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}var u="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",c="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",h="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";return t(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._viewModel.destroy(),n.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),o.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),i(this)},l}),i("Widgets/SelectionIndicator/SelectionIndicatorViewModel",["../../Core/Cartesian2","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/EasingFunction","../../Scene/SceneTransforms","../../ThirdParty/knockout"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,r,n){this._scene=e,this._screenPositionX=c,this._screenPositionY=c,this._tweens=e.tweens,this._container=t(n,document.body),this._selectionIndicatorElement=r,this._scale=1,this.position=void 0,this.showSelection=!1,s.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,s.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&i(this.position)}}),s.defineProperty(this,"_transform",{get:function(){return"scale("+this._scale+")"}}),this.computeScreenSpacePosition=function(t,i){return a.wgs84ToWindowCoordinates(e,t,i)}}var u=new e,c="-1000px";return l.prototype.update=function(){if(this.showSelection&&i(this.position)){var e=this.computeScreenSpacePosition(this.position,u);if(i(e)){var t=this._container,r=t.parentNode.clientWidth,n=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,a=.5*o;e.x=Math.min(Math.max(e.x,-o),r+o)-a,e.y=Math.min(Math.max(e.y,-o),n+o)-a,this._screenPositionX=Math.floor(e.x+.25)+"px",this._screenPositionY=Math.floor(e.y+.25)+"px"}else this._screenPositionX=c,this._screenPositionY=c}},l.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:o.EXPONENTIAL_OUT})},l.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:o.EXPONENTIAL_OUT})},r(l.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}}),l}),i("Widgets/SelectionIndicator/SelectionIndicator",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./SelectionIndicatorViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t){e=o(e),this._container=e;var i=document.createElement("div");i.className="cesium-selection-wrapper",i.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(i),this._element=i;var r="http://www.w3.org/2000/svg",s="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",l=document.createElementNS(r,"svg:svg");l.setAttribute("width",160),l.setAttribute("height",160),l.setAttribute("viewBox","0 0 160 160");var u=document.createElementNS(r,"g");u.setAttribute("transform","translate(80,80)"),l.appendChild(u);var c=document.createElementNS(r,"path");c.setAttribute("data-bind","attr: { transform: _transform }"),c.setAttribute("d",s),u.appendChild(c),i.appendChild(l);var h=new a(t,this._element,this._container);this._viewModel=h,n.applyBindings(this._viewModel,this._element)}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){var e=this._container;return n.cleanNode(this._element),e.removeChild(this._element),i(this)},s}),i("Widgets/Timeline/TimelineHighlightRange",["../../Core/defaultValue","../../Core/JulianDate"],function(e,t){"use strict";function i(t,i,r){this._color=t, +this._height=i,this._base=e(r,0)}return i.prototype.getHeight=function(){return this._height},i.prototype.getBase=function(){return this._base},i.prototype.getStartTime=function(){return this._start},i.prototype.getStopTime=function(){return this._stop},i.prototype.setRange=function(e,t){this._start=e,this._stop=t},i.prototype.render=function(e){var i="";if(this._start&&this._stop&&this._color){var r=t.secondsDifference(this._start,e.epochJulian),n=Math.round(e.timeBarWidth*e.getAlpha(r)),o=t.secondsDifference(this._stop,e.epochJulian),a=Math.round(e.timeBarWidth*e.getAlpha(o))-n;0>n&&(a+=n,n=0),n+a>e.timeBarWidth&&(a=e.timeBarWidth-n),a>0&&(i='<span class="cesium-timeline-highlight" style="left: '+n.toString()+"px; width: "+a.toString()+"px; bottom: "+this._base.toString()+"px; height: "+this._height+"px; background-color: "+this._color+';"></span>')}return i},i}),i("Widgets/Timeline/TimelineTrack",["../../Core/Color","../../Core/defined","../../Core/JulianDate"],function(e,t,i){"use strict";function r(t,i,r,n){this.interval=t,this.height=i,this.color=r||new e(.5,.5,.5,1),this.backgroundColor=n||new e(0,0,0,0)}return r.prototype.render=function(e,r){var n=this.interval.start,o=this.interval.stop,a=r.startJulian,s=i.addSeconds(r.startJulian,r.duration,new i);if(i.lessThan(n,a)&&i.greaterThan(o,s))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,r.y,r.timeBarWidth,this.height);else if(i.lessThanOrEquals(n,s)&&i.greaterThanOrEquals(o,a)){var l,u,c;for(l=0;l<r.timeBarWidth;++l){var h=i.addSeconds(r.startJulian,l/r.timeBarWidth*r.duration,new i);!t(u)&&i.greaterThanOrEquals(h,n)?u=l:!t(c)&&i.greaterThanOrEquals(h,o)&&(c=l)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,r.y,r.timeBarWidth,this.height),t(u)&&(t(c)||(c=r.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(u,r.y,Math.max(c-u,1),this.height))}},r}),i("Widgets/Timeline/Timeline",["../../Core/ClockRange","../../Core/defined","../../Core/destroyObject","../../Core/DeveloperError","../../Core/JulianDate","../getElement","./TimelineHighlightRange","./TimelineTrack"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t){e=o(e),this.container=e;var i=document.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=_.none,this._touchMode=y.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=c(this),this._onMouseUp=h(this),this._onMouseMove=d(this),this._onMouseWheel=m(this),this._onTouchStart=p(this),this._onTouchMove=v(this),this._onTouchEnd=f(this);var r=this._timeBarEle;document.addEventListener("mouseup",this._onMouseUp,!1),document.addEventListener("mousemove",this._onMouseMove,!1),r.addEventListener("mousedown",this._onMouseDown,!1),r.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),r.addEventListener("mousewheel",this._onMouseWheel,!1),r.addEventListener("touchstart",this._onTouchStart,!1),r.addEventListener("touchmove",this._onTouchMove,!1),r.addEventListener("touchend",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}function u(e){return 10>e?"0"+e.toString():e.toString()}function c(e){return function(t){e._mouseMode!==_.touchOnly&&(0===t.button?(e._mouseMode=_.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,2===t.button?e._mouseMode=_.zoom:e._mouseMode=_.slide)),t.preventDefault()}}function h(e){return function(t){e._mouseMode=_.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0px 0px"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function d(e){return function(t){var i;if(e._mouseMode===_.scrub){t.preventDefault();var r=t.clientX-e._topDiv.getBoundingClientRect().left;0>r?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):r>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(r,r*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===_.slide){if(i=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==i){var o=i*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(n.addSeconds(e._startJulian,o,new n),n.addSeconds(e._endJulian,o,new n))}}else e._mouseMode===_.zoom&&(i=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==i&&e.zoomFrom(Math.pow(1.01,i)))}}function m(e){return function(t){var i=t.wheelDeltaY||t.wheelDelta||-t.detail;g=Math.max(Math.min(Math.abs(i),g),1),i/=g,e.zoomFrom(Math.pow(1.05,-i))}}function p(e){return function(t){var i,r,o=t.touches.length,a=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=_.touchOnly,1===o?(i=n.secondsDifference(e._scrubJulian,e._startJulian),r=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+a),Math.abs(t.touches[0].clientX-r)<50?(e._touchMode=y.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=1===o?"-16px 0":"0 0")):(e._touchMode=y.singleTap,e._touchState.centerX=t.touches[0].clientX-a)):2===o?(e._touchMode=y.slideZoom,e._touchState.centerX=.5*(t.touches[0].clientX+t.touches[1].clientX)-a,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=y.ignore}}function f(e){return function(t){var i=t.touches.length,r=e._topDiv.getBoundingClientRect().left;e._touchMode===y.singleTap?(e._touchMode=y.scrub,e._handleTouchMove(t)):e._touchMode===y.scrub&&e._handleTouchMove(t),e._mouseMode=_.touchOnly,1!==i?e._touchMode=i>0?y.ignore:y.none:e._touchMode===y.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-r),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function v(e){return function(i){var r,o,a,s,l,u,c=1,h=e._topDiv.getBoundingClientRect().left;e._touchMode===y.singleTap&&(e._touchMode=y.slideZoom),e._mouseMode=_.touchOnly,e._touchMode===y.scrub?(i.preventDefault(),1===i.changedTouches.length&&(o=i.changedTouches[0].clientX-h,o>=0&&o<=e._topDiv.clientWidth&&e._setTimeBarTime(o,o*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===y.slideZoom&&(a=i.touches.length,2===a?(s=.5*(i.touches[0].clientX+i.touches[1].clientX)-h,l=Math.abs(i.touches[0].clientX-i.touches[1].clientX)):1===a&&(s=i.touches[0].clientX-h,l=0),t(s)&&(l>0&&e._touchState.spanX>0?(c=e._touchState.spanX/l,u=n.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-s*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new n)):(r=e._touchState.centerX-s,u=n.addSeconds(e._startJulian,r*e._timeBarSecondsSpan/e._topDiv.clientWidth,new n)),e.zoomTo(u,n.addSeconds(u,e._timeBarSecondsSpan*c,new n)),e._touchState.centerX=s,e._touchState.spanX=l))}}var g=1e12,_={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},y={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},C=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],E=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return l.prototype.addEventListener=function(e,t,i){this._topDiv.addEventListener(e,t,i)},l.prototype.removeEventListener=function(e,t,i){this._topDiv.removeEventListener(e,t,i)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this),document.removeEventListener("mouseup",this._onMouseUp,!1),document.removeEventListener("mousemove",this._onMouseMove,!1);var e=this._timeBarEle;e.removeEventListener("mousedown",this._onMouseDown,!1),e.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),e.removeEventListener("mousewheel",this._onMouseWheel,!1),e.removeEventListener("touchstart",this._onTouchStart,!1),e.removeEventListener("touchmove",this._onTouchMove,!1),e.removeEventListener("touchend",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),i(this)},l.prototype.addHighlightRange=function(e,t,i){var r=new a(e,t,i);return this._highlightRanges.push(r),this.resize(),r},l.prototype.addTrack=function(e,t,i,r){var n=new s(e,t,i,r);return this._trackList.push(n),this._lastHeight=void 0,this.resize(),n},l.prototype.zoomTo=function(t,i){if(this._startJulian=t,this._endJulian=i,this._timeBarSecondsSpan=n.secondsDifference(i,t),this._clock&&this._clock.clockRange!==e.UNBOUNDED){var r=this._clock.startTime,o=this._clock.stopTime,a=n.secondsDifference(o,r),s=n.secondsDifference(r,this._startJulian),l=n.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=a?(this._timeBarSecondsSpan=a,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=n.addSeconds(this._endJulian,s,new n),this._startJulian=r,this._timeBarSecondsSpan=n.secondsDifference(this._endJulian,this._startJulian)):0>l&&(this._startJulian=n.addSeconds(this._startJulian,l,new n),this._endJulian=o,this._timeBarSecondsSpan=n.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();var u=document.createEvent("Event");u.initEvent("setzoom",!0,!0),u.startJulian=this._startJulian,u.endJulian=this._endJulian,u.epochJulian=this._epochJulian,u.totalSpan=this._timeBarSecondsSpan,u.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(u)},l.prototype.zoomFrom=function(e){var t=n.secondsDifference(this._scrubJulian,this._startJulian);e>1||0>t||t>this._timeBarSecondsSpan?t=.5*this._timeBarSecondsSpan:t+=t-.5*this._timeBarSecondsSpan;var i=this._timeBarSecondsSpan-t;this.zoomTo(n.addSeconds(this._startJulian,t-t*e,new n),n.addSeconds(this._endJulian,i*e-i,new n))},l.prototype.makeLabel=function(e){var t=n.toGregorianDate(e),i=t.millisecond,r=" UTC";if(i>0&&this._timeBarSecondsSpan<3600){for(r=Math.floor(i).toString();r.length<3;)r="0"+r;r="."+r}return E[t.month-1]+" "+t.day+" "+t.year+" "+u(t.hour)+":"+u(t.minute)+":"+u(t.second)+r},l.prototype.smallestTicInPixels=7,l.prototype._makeTics=function(){function e(e){return Math.floor(S/e)*e}function t(e,t){return Math.ceil(e/t+.5)*t}function i(e){return(e-S)/v}function r(e,t){return e-t*Math.round(e/t)}var o,a=this._timeBarEle,s=n.secondsDifference(this._scrubJulian,this._startJulian),l=Math.round(s*this._topDiv.clientWidth/this._timeBarSecondsSpan),u=l-8,c=this;this._needleEle.style.left=l.toString()+"px";var h="",d=.01,m=31536e6,p=1e-10,f=0,v=this._timeBarSecondsSpan;d>v?(v=d,this._timeBarSecondsSpan=d,this._endJulian=n.addSeconds(this._startJulian,d,new n)):v>m&&(v=m,this._timeBarSecondsSpan=m,this._endJulian=n.addSeconds(this._startJulian,m,new n));var g=this._timeBarEle.clientWidth;10>g&&(g=10);var _,y=this._startJulian,E=Math.min(v/g*1e-5,.4);_=v>31536e4?n.fromIso8601(n.toDate(y).toISOString().substring(0,2)+"00-01-01T00:00:00Z"):v>31536e3?n.fromIso8601(n.toDate(y).toISOString().substring(0,3)+"0-01-01T00:00:00Z"):v>86400?n.fromIso8601(n.toDate(y).toISOString().substring(0,4)+"-01-01T00:00:00Z"):n.fromIso8601(n.toDate(y).toISOString().substring(0,10)+"T00:00:00Z");var S=n.secondsDifference(this._startJulian,n.addSeconds(_,E,new n)),w=S+v;this._epochJulian=_,this._rulerEle.innerHTML=this.makeLabel(n.addSeconds(this._endJulian,-d,new n));var T=this._rulerEle.offsetWidth+20;30>T&&(T=180);var x=f;f-=p;var b={startTime:S,startJulian:y,epochJulian:_,duration:v,timeBarWidth:g,getAlpha:i};this._highlightRanges.forEach(function(e){h+=e.render(b)});var A=0,P=0,I=0,M=T/g;M>1&&(M=1),M*=this._timeBarSecondsSpan;var D,R=-1,O=-1,N=C.length;for(D=0;N>D;++D){var L=C[D];if(++R,A=L,L>M&&L>f)break;0>O&&g*(L/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(O=R)}if(R>0){for(;R>0;)if(--R,Math.abs(r(A,C[R]))<1e-5){C[R]>=f&&(P=C[R]);break}if(O>=0)for(;R>O;){if(Math.abs(r(P,C[O]))<1e-5&&C[O]>=f){I=C[O];break}++O}}f=x,f>p&&1e-5>I&&Math.abs(f-A)>p&&(I=f,A+p>=f&&(P=0));var F,B=-999999;if(g*(I/this._timeBarSecondsSpan)>=3)for(o=e(I);w>=o;o=t(o,I))h+='<span class="cesium-timeline-ticTiny" style="left: '+Math.round(g*i(o)).toString()+'px;"></span>';if(g*(P/this._timeBarSecondsSpan)>=3)for(o=e(P);w>=o;o=t(o,P))h+='<span class="cesium-timeline-ticSub" style="left: '+Math.round(g*i(o)).toString()+'px;"></span>';if(g*(A/this._timeBarSecondsSpan)>=2){this._mainTicSpan=A,w+=A,o=e(A);for(var V=n.computeTaiMinusUtc(_);w>=o;){var k=n.addSeconds(y,o-S,new n);if(A>2.1){var z=n.computeTaiMinusUtc(k);Math.abs(z-V)>.1&&(o+=z-V,k=n.addSeconds(y,o-S,new n))}var U=Math.round(g*i(o)),G=this.makeLabel(k);this._rulerEle.innerHTML=G,F=this._rulerEle.offsetWidth,10>F&&(F=T);var W=U-(F/2-1);W>B?(B=W+F+5,h+='<span class="cesium-timeline-ticMain" style="left: '+U.toString()+'px;"></span><span class="cesium-timeline-ticLabel" style="left: '+W.toString()+'px;">'+G+"</span>"):h+='<span class="cesium-timeline-ticSub" style="left: '+U.toString()+'px;"></span>',o=t(o,A)}}else this._mainTicSpan=-1;h+='<span class="cesium-timeline-icon16" style="left:'+u+'px;bottom:0;background-position: 0px 0px;"></span>',a.innerHTML=h,this._scrubElement=a.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),b.y=0,this._trackList.forEach(function(e){e.render(c._context,b),b.y+=e.height})},l.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;var e=this._scrubElement;if(t(this._scrubElement)){var i=n.secondsDifference(this._scrubJulian,this._startJulian),r=Math.round(i*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==r&&(this._lastXPos=r,e.style.left=r-8+"px",this._needleEle.style.left=r+"px")}t(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(n.addSeconds(this._startJulian,this._timelineDrag,new n),n.addSeconds(this._endJulian,this._timelineDrag,new n)))},l.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=n.addSeconds(this._startJulian,t,new n),this._scrubElement){var i=e-8;this._scrubElement.style.left=i.toString()+"px",this._needleEle.style.left=e.toString()+"px"}var r=document.createEvent("Event");r.initEvent("settime",!0,!0),r.clientX=e,r.timeSeconds=t,r.timeJulian=this._scrubJulian,r.clock=this._clock,this._topDiv.dispatchEvent(r)},l.prototype.resize=function(){var e=this.container.clientWidth,t=this.container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){this._trackContainer.style.height=t+"px";var i=1;this._trackList.forEach(function(e){i+=e.height}),this._trackListEle.style.height=i.toString()+"px",this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=i,this._makeTics(),this._lastWidth=e,this._lastHeight=t}},l}),i("Widgets/VRButton/VRButtonViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Fullscreen","../../ThirdParty/knockout","../../ThirdParty/NoSleep","../createCommand","../getElement"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e){var i=!1,r=window.screen;return t(r)&&(t(r.lockOrientation)?i=r.lockOrientation(e):t(r.mozLockOrientation)?i=r.mozLockOrientation(e):t(r.msLockOrientation)?i=r.msLockOrientation(e):t(r.orientation&&r.orientation.lock)&&(i=r.orientation.lock(e))),i}function h(){var e=window.screen;t(e)&&(t(e.unlockOrientation)?e.unlockOrientation():t(e.mozUnlockOrientation)?e.mozUnlockOrientation():t(e.msUnlockOrientation)?e.msUnlockOrientation():t(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function d(e,t,i){i()?(t.useWebVR=!1,e._locked&&(h(),e._locked=!1),e._noSleep.disable(),o.exitFullscreen(),i(!1)):(o.fullscreen||o.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=c("landscape")),t.useWebVR=!0,i(!0))}function m(t,i){var r=this,n=a.observable(o.enabled),c=a.observable(!1);this.isVRMode=void 0,a.defineProperty(this,"isVRMode",{get:function(){return c()}}),this.isVREnabled=void 0,a.defineProperty(this,"isVREnabled",{get:function(){return n()},set:function(e){n(e&&o.enabled)}}),this.tooltip=void 0,a.defineProperty(this,"tooltip",function(){return n()?c()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"}),this._locked=!1,this._noSleep=new s,this._command=l(function(){d(r,t,c)},a.getObservable(this,"isVREnabled")),this._vrElement=e(u(i),document.body),this._callback=function(){!o.fullscreen&&c()&&(t.useWebVR=!1,r._locked&&(h(),r._locked=!1),r._noSleep.disable(),c(!1))},document.addEventListener(o.changeEventName,this._callback)}return i(m.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}}),m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){r(this)},m}),i("Widgets/VRButton/VRButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./VRButtonViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,i){e=o(e);var r=new a(t,i);r._exitVRPath=u,r._enterVRPath=l;var s=document.createElement("button");s.type="button",s.className="cesium-button cesium-vrButton",s.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }"),e.appendChild(s),n.applyBindings(r,s),this._container=e,this._viewModel=r,this._element=s}var l="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",u="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),i("Widgets/Viewer/Viewer",["../../Core/BoundingSphere","../../Core/Cartesian3","../../Core/defaultValue","../../Core/defined","../../Core/definedNotNull","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Core/Fullscreen","../../Core/isArray","../../Core/Matrix4","../../Core/ScreenSpaceEventType","../../DataSources/BoundingSphereState","../../DataSources/ConstantPositionProperty","../../DataSources/DataSourceCollection","../../DataSources/DataSourceDisplay","../../DataSources/Entity","../../DataSources/EntityView","../../DataSources/Property","../../Scene/SceneMode","../../ThirdParty/knockout","../../ThirdParty/when","../Animation/Animation","../Animation/AnimationViewModel","../BaseLayerPicker/BaseLayerPicker","../BaseLayerPicker/createDefaultImageryProviderViewModels","../BaseLayerPicker/createDefaultTerrainProviderViewModels","../CesiumWidget/CesiumWidget","../ClockViewModel","../FullscreenButton/FullscreenButton","../Geocoder/Geocoder","../getElement","../HomeButton/HomeButton","../InfoBox/InfoBox","../NavigationHelpButton/NavigationHelpButton","../SceneModePicker/SceneModePicker","../SelectionIndicator/SelectionIndicator","../subscribeAndEvaluate","../Timeline/Timeline","../VRButton/VRButton"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O,N,L,F,B,V,k,z){"use strict";function U(e){var t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function G(e,t){var n=e.scene.pick(t.position);if(r(n)){var o=i(n.id,n.primitive.id);if(o instanceof g)return o}return r(e.scene.globe)?H(e,t.position):void 0}function W(e,t,i){if(r(i)){var n=i.clock;r(n)&&(n.getValue(t),r(e)&&(e.updateFromClock(),e.zoomTo(n.startTime,n.stopTime)))}}function H(e,t){var i=e.scene,n=i.camera.getPickRay(t),o=i.imageryLayers.pickImageryLayerFeatures(n,i);if(r(o)){var a=new g({id:"Loading...",description:"Loading feature information..."});return S(o,function(t){if(e.selectedEntity===a){if(!r(t)||0===t.length)return void(e.selectedEntity=q());var i=t[0],n=new g({id:i.name,description:i.description});if(r(i.position)){var o=e.scene.globe.ellipsoid.cartographicToCartesian(i.position,ee);n.position=new p(o)}e.selectedEntity=n}},function(){e.selectedEntity===a&&(e.selectedEntity=q())}),a}}function q(){return new g({id:"None",description:"No features found."})}function j(e,t){var i=e._geocoder,n=e._homeButton,o=e._sceneModePicker,a=e._baseLayerPicker,s=e._animation,l=e._timeline,u=e._fullscreenButton,c=e._infoBox,h=e._selectionIndicator,d=t?"hidden":"visible";if(r(i)&&(i.container.style.visibility=d),r(n)&&(n.container.style.visibility=d),r(o)&&(o.container.style.visibility=d),r(a)&&(a.container.style.visibility=d),r(s)&&(s.container.style.visibility=d),r(l)&&(l.container.style.visibility=d),r(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=d),r(c)&&(c.container.style.visibility=d),r(h)&&(h.container.style.visibility=d),e._container){var m=t||!r(u)?0:u.container.clientWidth;e._vrButton.container.style.right=m+"px",e.forceResize()}}function Y(e,t){function o(e){var t=G(c,e);r(t)&&(y.getValueOrUndefined(t.position,c.clock.currentTime)?c.trackedEntity=t:c.zoomTo(t))}function a(e){c.selectedEntity=G(c,e)}e=R(e),t=i(t,i.EMPTY_OBJECT);var u=!(r(t.globe)&&t.globe===!1||r(t.baseLayerPicker)&&t.baseLayerPicker===!1),c=this,h=document.createElement("div");h.className="cesium-viewer",e.appendChild(h);var m=document.createElement("div");m.className="cesium-viewer-cesiumWidgetContainer",h.appendChild(m);var p=document.createElement("div");p.className="cesium-viewer-bottom",h.appendChild(p);var g=i(t.scene3DOnly,!1),_=new P(m,{terrainProvider:t.terrainProvider,imageryProvider:u?!1:t.imageryProvider,clock:t.clock,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,creditContainer:r(t.creditContainer)?t.creditContainer:p,scene3DOnly:g,terrainExaggeration:t.terrainExaggeration}),C=t.dataSources,S=!1;r(C)||(C=new f,S=!0);var W=new v({scene:_.scene,dataSourceCollection:C}),H=_.clock,q=new I(H),X=new l;X.add(H.onTick,Y.prototype._onTick,this),X.add(_.scene.morphStart,Y.prototype._clearTrackedObject,this);var Z;if(!r(t.selectionIndicator)||t.selectionIndicator!==!1){var K=document.createElement("div");K.className="cesium-viewer-selectionIndicatorContainer",h.appendChild(K),Z=new B(K,_.scene)}var Q;if(!r(t.infoBox)||t.infoBox!==!1){var J=document.createElement("div");J.className="cesium-viewer-infoBoxContainer",h.appendChild(J),Q=new N(J);var $=Q.viewModel;X.add($.cameraClicked,Y.prototype._onInfoBoxCameraClicked,this),X.add($.closeClicked,Y.prototype._onInfoBoxClockClicked,this)}var ee=document.createElement("div");ee.className="cesium-viewer-toolbar",h.appendChild(ee);var te;if(!r(t.geocoder)||t.geocoder!==!1){var ie=document.createElement("div");ie.className="cesium-viewer-geocoderContainer",ee.appendChild(ie),te=new D({container:ie,scene:_.scene}),X.add(te.viewModel.search.beforeExecute,Y.prototype._clearObjects,this)}var re;if(r(t.homeButton)&&t.homeButton===!1||(re=new O(ee,_.scene),r(te)&&X.add(re.viewModel.command.afterExecute,function(){var e=te.viewModel;e.searchText="",e.isSearchInProgress&&e.search()}),X.add(re.viewModel.command.beforeExecute,Y.prototype._clearTrackedObject,this)),t.sceneModePicker===!0&&g)throw new s("options.sceneModePicker is not available when options.scene3DOnly is set to true.");var ne;g||r(t.sceneModePicker)&&t.sceneModePicker===!1||(ne=new F(ee,_.scene));var oe,ae;if(u){var se=i(t.imageryProviderViewModels,b()),le=i(t.terrainProviderViewModels,A());oe=new x(ee,{globe:_.scene.globe,imageryProviderViewModels:se,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:le,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel});var ue=ee.getElementsByClassName("cesium-baseLayerPicker-dropDown");ae=ue[0]}var ce;if(!r(t.navigationHelpButton)||t.navigationHelpButton!==!1){var he=!0;try{if(n(window.localStorage)){var de=window.localStorage.getItem("cesium-hasSeenNavHelp");r(de)&&Boolean(de)?he=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch(me){}ce=new L({container:ee,instructionsInitiallyVisible:i(t.navigationInstructionsInitiallyVisible,he)})}var pe;if(!r(t.animation)||t.animation!==!1){var fe=document.createElement("div");fe.className="cesium-viewer-animationContainer",h.appendChild(fe),pe=new w(fe,new T(q))}var ve;if(!r(t.timeline)||t.timeline!==!1){var ge=document.createElement("div");ge.className="cesium-viewer-timelineContainer",h.appendChild(ge),ve=new k(ge,H),ve.addEventListener("settime",U,!1),ve.zoomTo(H.startTime,H.stopTime)}var _e,ye;if(!r(t.fullscreenButton)||t.fullscreenButton!==!1){var Ce=document.createElement("div");Ce.className="cesium-viewer-fullscreenContainer",h.appendChild(Ce),_e=new M(Ce,t.fullscreenElement),ye=V(_e.viewModel,"isFullscreenEnabled",function(e){Ce.style.display=e?"block":"none",r(ve)&&(ve.container.style.right=Ce.clientWidth+"px",ve.resize())})}var Ee,Se,we;if(t.vrButton){var Te=document.createElement("div");Te.className="cesium-viewer-vrContainer",h.appendChild(Te),Ee=new z(Te,_.scene,t.fullScreenElement),Se=V(Ee.viewModel,"isVREnabled",function(e){Te.style.display=e?"block":"none",r(_e)&&(Te.style.right=Ce.clientWidth+"px"),r(ve)&&(ve.container.style.right=Te.clientWidth+"px",ve.resize())}),we=V(Ee.viewModel,"isVRMode",function(e){j(c,e)})}this._baseLayerPickerDropDown=ae,this._fullscreenSubscription=ye,this._vrSubscription=Se,this._vrModeSubscription=we,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=i(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=p,this._element=h,this._cesiumWidget=_,this._selectionIndicator=Z,this._infoBox=Q,this._dataSourceCollection=C,this._destroyDataSourceCollection=S,this._dataSourceDisplay=W,this._clockViewModel=q,this._toolbar=ee,this._homeButton=re,this._sceneModePicker=ne,this._baseLayerPicker=oe,this._navigationHelpButton=ce,this._animation=pe,this._timeline=ve,this._fullscreenButton=_e,this._vrButton=Ee,this._geocoder=te,this._eventHelper=X,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=r(Q)||r(Z),this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._selectedEntity=void 0,this._clockTrackedDataSource=void 0,this._forceResize=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,E.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),X.add(C.dataSourceAdded,Y.prototype._onDataSourceAdded,this),X.add(C.dataSourceRemoved,Y.prototype._onDataSourceRemoved,this),X.add(_.scene.preRender,Y.prototype.resize,this),X.add(_.scene.postRender,Y.prototype._postRender,this);for(var xe=C.length,be=0;xe>be;be++)this._dataSourceAdded(C,C.get(be));this._dataSourceAdded(void 0,W.defaultDataSource),X.add(C.dataSourceAdded,Y.prototype._dataSourceAdded,this),X.add(C.dataSourceRemoved,Y.prototype._dataSourceRemoved,this),_.screenSpaceEventHandler.setInputAction(a,d.LEFT_CLICK),_.screenSpaceEventHandler.setInputAction(o,d.LEFT_DOUBLE_CLICK)}function X(e,t,n,o){K(e);var a=S.defer();return e._zoomPromise=a,e._zoomIsFlight=o,e._zoomOptions=n,S(t,function(t){if(e._zoomPromise===a)if(t.isLoading&&r(t.loadingEvent))var n=t.loadingEvent.addEventListener(function(){n(),e._zoomPromise===a&&(e._zoomTarget=t.entities.values.slice(0))});else t=i(t.values,t),r(t.entities)&&(t=t.entities.values),c(t)?e._zoomTarget=t.slice(0):e._zoomTarget=[t]}),a.promise}function Z(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function K(e){var t=e._zoomPromise;r(t)&&(Z(e),t.resolve(!1))}function Q(t){var n=t._zoomTarget;if(r(n)&&t.scene.mode!==C.MORPHING){for(var o=t._zoomPromise,a=[],s=0,l=n.length;l>s;s++){var u=t._dataSourceDisplay.getBoundingSphere(n[s],!1,$);if(u===m.PENDING)return;u!==m.FAILED&&a.push(e.clone($))}if(0===a.length)return void K(t);t.trackedEntity=void 0;var c=t.scene,d=c.camera,p=e.fromBoundingSpheres(a),f=c.screenSpaceCameraController;if(f.minimumZoomDistance=Math.min(f.minimumZoomDistance,.5*p.radius),t._zoomIsFlight){var v=i(t._zoomOptions,{}),g={duration:v.duration,maximumHeight:v.maximumHeight,complete:function(){o.resolve(!0)},cancel:function(){o.resolve(!1)},offset:v.offset};Z(t),d.flyToBoundingSphere(p,g)}else d.viewBoundingSphere(p,t._zoomOptions),d.lookAtTransform(h.IDENTITY),Z(t),o.resolve(!0)}}function J(e){if(e._needTrackedEntityUpdate){var t=e._trackedEntity,i=e.clock.currentTime,n=y.getValueOrUndefined(t.position,i);if(r(n)){var o=e.scene,a=e._dataSourceDisplay.getBoundingSphere(t,!1,$); +if(a!==m.PENDING){var s=o.mode;(s===C.COLUMBUS_VIEW||s===C.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(s===C.COLUMBUS_VIEW||s===C.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);var l=a!==m.FAILED?$:void 0;e._entityView=new _(t,o,o.mapProjection.ellipsoid,l),e._entityView.update(i),e._needTrackedEntityUpdate=!1}}}}var $=new e,ee=new t;return o(Y.prototype,{container:{get:function(){return this._container}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},canvas:{get:function(){return this._cesiumWidget.canvas}},cesiumLogo:{get:function(){return this._cesiumWidget.cesiumLogo}},scene:{get:function(){return this._cesiumWidget.scene}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},clock:{get:function(){return this._cesiumWidget.clock}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e,this._forceResize=!0}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,K(this);var t=this.scene,i=t.mode;if(!r(e)||!r(e.position))return this._needTrackedEntityUpdate=!1,(i===C.COLUMBUS_VIEW||i===C.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(i===C.COLUMBUS_VIEW||i===C.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,void this.camera.lookAtTransform(h.IDENTITY);this._needTrackedEntityUpdate=!0}}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;var t=r(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;r(e)?r(t)&&t.animateAppear():r(t)&&t.animateDepart()}}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,W(this._timeline,this.clock,e))}}}),Y.prototype.extend=function(e,t){e(this,t)},Y.prototype.resize=function(){var e=this._cesiumWidget,t=this._container,i=t.clientWidth,n=t.clientHeight,o=r(this._animation),a=r(this._timeline);if(this._forceResize||i!==this._lastWidth||n!==this._lastHeight){e.resize(),this._forceResize=!1;var s=n-125,l=this._baseLayerPickerDropDown;r(l)&&(l.style.maxHeight=s+"px"),r(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);var u,c=this._timeline,h=0,d=0,m=0;if(o&&"hidden"!==window.getComputedStyle(this._animation.container).visibility){var p=this._lastWidth;u=this._animation.container,i>900?(h=169,900>=p&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):i>=600?(h=136,(600>p||p>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(h=106,(p>600||0===p)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),d=h+5}if(a&&"hidden"!==window.getComputedStyle(this._timeline.container).visibility){var f=this._fullscreenButton,v=this._vrButton,g=c.container,_=g.style;m=g.clientHeight+3,_.left=h+"px";var y=0;r(f)&&(y+=f.container.clientWidth),r(v)&&(y+=v.container.clientWidth),_.right=y+"px",c.resize()}this._bottomContainer.style.left=d+"px",this._bottomContainer.style.bottom=m+"px",this._lastWidth=i,this._lastHeight=n}},Y.prototype.forceResize=function(){this._lastWidth=0,this.resize()},Y.prototype.render=function(){this._cesiumWidget.render()},Y.prototype.isDestroyed=function(){return!1},Y.prototype.destroy=function(){var e;this.screenSpaceEventHandler.removeInputAction(d.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(d.LEFT_DOUBLE_CLICK);var t=this.dataSources,i=t.length;for(e=0;i>e;e++)this._dataSourceRemoved(t,t.get(e));return this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),r(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),r(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),r(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),r(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),r(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),r(this._timeline)&&(this._timeline.removeEventListener("settime",U,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),r(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),r(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),r(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),r(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._clockViewModel=this._clockViewModel.destroy(),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),a(this)},Y.prototype._dataSourceAdded=function(e,t){var i=t.entities;i.collectionChanged.addEventListener(Y.prototype._onEntityCollectionChanged,this)},Y.prototype._dataSourceRemoved=function(e,t){var i=t.entities;i.collectionChanged.removeEventListener(Y.prototype._onEntityCollectionChanged,this),r(this.trackedEntity)&&i.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),r(this.selectedEntity)&&i.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)},Y.prototype._onTick=function(e){var n=e.currentTime,o=this._dataSourceDisplay.update(n);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=o);var a=this._entityView;r(a)&&a.update(n);var s,l=!1,u=this.selectedEntity,c=r(u)&&this._enableInfoOrSelection;if(c&&u.isShowing&&u.isAvailable(n)){var h=this._dataSourceDisplay.getBoundingSphere(u,!0,$);h!==m.FAILED?s=$.center:r(u.position)&&(s=u.position.getValue(n,s)),l=r(s)}var d=r(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;r(d)&&(d.position=t.clone(s,d.position),d.showSelection=c&&l,d.update());var p=r(this._infoBox)?this._infoBox.viewModel:void 0;r(p)&&(p.showInfo=c,p.enableCamera=l,p.isCameraTracking=this.trackedEntity===this.selectedEntity,c?(p.titleText=i(u.name,u.id),p.description=y.getValueOrDefault(u.description,n,"")):(p.titleText="",p.description=""))},Y.prototype._onEntityCollectionChanged=function(e,t,i){for(var r=i.length,n=0;r>n;n++){var o=i[n];this.trackedEntity===o&&(this.trackedEntity=void 0),this.selectedEntity===o&&(this.selectedEntity=void 0)}},Y.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{var t=this.selectedEntity,i=t.position;r(i)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}},Y.prototype._clearTrackedObject=function(){this.trackedEntity=void 0},Y.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0},Y.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0},Y.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&W(this.timeline,this.clock,e)},Y.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);var i=t.entities.id,r=this._eventHelper.add(t.changedEvent,Y.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[i]=r},Y.prototype._onDataSourceRemoved=function(e,t){var i=this.clockTrackedDataSource===t,r=t.entities.id;if(this._dataSourceChangedListeners[r](),this._dataSourceChangedListeners[r]=void 0,i){var n=e.length;this._automaticallyTrackDataSourceClocks&&n>0?this.clockTrackedDataSource=e.get(n-1):this.clockTrackedDataSource=void 0}},Y.prototype.zoomTo=function(e,t){return X(this,e,t,!1)},Y.prototype.flyTo=function(e,t){return X(this,e,t,!0)},Y.prototype._postRender=function(){Q(this),J(this)},Y}),i("Widgets/Viewer/viewerCesiumInspectorMixin",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../CesiumInspector/CesiumInspector"],function(e,t,i,r){"use strict";function n(n){if(!e(n))throw new i("viewer is required.");var o=document.createElement("div");o.className="cesium-viewer-cesiumInspectorContainer",n.container.appendChild(o);var a=new r(o,n.scene);t(n,{cesiumInspector:{get:function(){return a}}}),n.scene.postRender.addEventListener(function(){n.cesiumInspector.viewModel.update()})}return n}),i("Widgets/Viewer/viewerDragDropMixin",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Event","../../Core/wrapFunction","../../DataSources/CzmlDataSource","../../DataSources/GeoJsonDataSource","../../DataSources/KmlDataSource","../getElement"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t,r){function a(e){h(e),v&&(t.entities.removeAll(),t.dataSources.removeAll());for(var i=e.dataTransfer.files,r=i.length,n=0;r>n;n++){var o=i[n],a=new FileReader;a.onload=p(t,o,_),a.onerror=f(t,o),a.readAsText(o)}}r=e(r,e.EMPTY_OBJECT);var s=!0,l=!0,c=new n,v=e(r.clearOnDrop,!0),g=e(r.dropTarget,t.container),_=r.proxy;g=u(g),i(t,{dropTarget:{get:function(){return g},set:function(e){d(g,a),g=e,m(g,a)}},dropEnabled:{get:function(){return s},set:function(e){e!==s&&(e?m(g,a):d(g,a),s=e)}},dropError:{get:function(){return c}},clearOnDrop:{get:function(){return v},set:function(e){v=e}},flyToOnDrop:{get:function(){return l},set:function(e){l=e}},proxy:{get:function(){return _},set:function(e){_=e}}}),m(g,a),t.destroy=o(t,t.destroy,function(){t.dropEnabled=!1}),t._handleDrop=a}function h(e){e.stopPropagation(),e.preventDefault()}function d(e,i){var r=e;t(r)&&(r.removeEventListener("drop",i,!1),r.removeEventListener("dragenter",h,!1),r.removeEventListener("dragover",h,!1),r.removeEventListener("dragexit",h,!1))}function m(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",h,!1),e.addEventListener("dragover",h,!1),e.addEventListener("dragexit",h,!1)}function p(e,i,r){return function(n){var o=i.name;try{var u;if(/\.czml$/i.test(o))u=a.load(JSON.parse(n.target.result),{sourceUri:o});else if(/\.geojson$/i.test(o)||/\.json$/i.test(o)||/\.topojson$/i.test(o))u=s.load(JSON.parse(n.target.result),{sourceUri:o});else{if(!/\.(kml|kmz)$/i.test(o))return void e.dropError.raiseEvent(e,o,"Unrecognized file: "+o);u=l.load(i,{sourceUri:o,proxy:r})}t(u)&&e.dataSources.add(u).then(function(t){e.flyToOnDrop&&e.flyTo(t)}).otherwise(function(t){e.dropError.raiseEvent(e,o,t)})}catch(c){e.dropError.raiseEvent(e,o,c)}}}function f(e,t){return function(i){e.dropError.raiseEvent(e,t.name,i.target.error)}}return c}),i("Widgets/Viewer/viewerEntityMixin",["../../Core/Cartesian3","../../Core/defaultValue","../../Core/defined","../../Core/DeveloperError","../../Core/EventHelper","../../Core/Event","../../Core/ScreenSpaceEventType","../../Core/wrapFunction","../../DataSources/ConstantPositionProperty","../../DataSources/Entity","../../DataSources/EntityView","../../Scene/SceneMode","../../ThirdParty/knockout","../../ThirdParty/when","../subscribeAndEvaluate"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(e,t){var r=e.scene,n=r.camera.getPickRay(t),o=r.imageryLayers.pickImageryLayerFeatures(n,r);if(i(o)){var a=new u("Loading...");return a.description={getValue:function(){return"Loading feature information..."}},m(o,function(t){if(e.selectedEntity===a){if(!i(t)||0===t.length)return void(e.selectedEntity=v());var r=t[0],n=new u(r.name);if(n.description={getValue:function(){return r.description}},i(r.position)){var o=e.scene.globe.ellipsoid.cartographicToCartesian(r.position,_);n.position=new l(o)}e.selectedEntity=n}},function(){if(e.selectedEntity===a){var t=new u("None");t.description={getValue:function(){return"No features found."}},e.selectedEntity=v()}}),a}}function v(){var e=new u("None");return e.description={getValue:function(){return"No features found."}},e}var g=function(e){function r(){e.trackedEntity=e.selectedEntity}function l(){e.trackedEntity=void 0}function m(){e.selectedEntity=void 0}function v(){e.trackedEntity=void 0,e.selectedEntity=void 0}function g(r){var n=r.currentTime;i(x)&&x.update(n);var o=e.selectedEntity,a=i(o)&&M;if(a){var s,l=i(I)?I.position:void 0,u=!1;o.isAvailable(n)&&i(o.position)&&(s=o.position.getValue(n,l),u=i(s)&&e.trackedEntity!==e.selectedEntity),i(I)&&(I.position=s),i(A)&&(A.enableCamera=u,A.isCameraTracking=e.trackedEntity===e.selectedEntity,i(o.description)?A.descriptionRawHtml=t(o.description.getValue(n),""):A.descriptionRawHtml="")}i(I)&&(I.showSelection=a,I.update()),i(A)&&(A.showInfo=a)}function _(r){var n=e.scene.pick(r.position);if(i(n)){var o=t(n.id,n.primitive.id);if(o instanceof u)return o}return f(e,r.position)}function y(t){i(t)&&i(t.position)&&(e.trackedEntity=t)}function C(e){var t=_(e);i(t)&&y(t)}function E(t){var i=e.selectedEntity;e.selectedEntity=_(t),e.eventSelector.raiseEvent(e.selectedEntity,i)}function S(t,i,r){for(var n=r.length,o=0;n>o;o++){var a=r[o];e.trackedEntity===a&&e.homeButton.viewModel.command(),e.selectedEntity===a&&(e.selectedEntity=void 0)}}function w(e,t){var i=t.entities;i.collectionChanged.addEventListener(S)}function T(t,r){var n=r.entities;n.collectionChanged.removeEventListener(S),i(e.trackedEntity)&&n.getById(e.trackedEntity.id)===e.trackedEntity&&e.homeButton.viewModel.command(),i(e.selectedEntity)&&n.getById(e.selectedEntity.id)===e.selectedEntity&&(e.selectedEntity=void 0)}var x,b=e.infoBox,A=i(b)?b.viewModel:void 0,P=e.selectionIndicator,I=i(P)?P.viewModel:void 0,M=i(b)||i(P),D=new n,R=new o;e.eventSelector=R,i(A)&&(D.add(A.cameraClicked,r),D.add(A.closeClicked,m)),D.add(e.clock.onTick,g),i(e.homeButton)&&D.add(e.homeButton.viewModel.command.beforeExecute,l),i(e.geocoder)&&D.add(e.geocoder.viewModel.search.beforeExecute,v);for(var O=e.dataSources,N=O.length,L=0;N>L;L++)w(O,O.get(L));D.add(e.dataSources.dataSourceAdded,w),D.add(e.dataSources.dataSourceRemoved,T),e.screenSpaceEventHandler.setInputAction(E,a.LEFT_CLICK),e.screenSpaceEventHandler.setInputAction(C,a.LEFT_DOUBLE_CLICK),e.trackedEntity=void 0,e.selectedEntity=void 0,d.track(e,["trackedEntity","selectedEntity"]);var F=[];F.push(p(e,"trackedEntity",function(t){var r=e.scene,n=r.mode,o=i(t);(n===h.COLUMBUS_VIEW||n===h.SCENE2D)&&(r.screenSpaceCameraController.enableTranslate=!o),(n===h.COLUMBUS_VIEW||n===h.SCENE3D)&&(r.screenSpaceCameraController.enableTilt=!o),x=o&&i(t.position)?new c(t,r,e.scene.globe.ellipsoid):void 0})),F.push(p(e,"selectedEntity",function(e){i(e)?(i(A)&&(A.titleText=i(e.name)?e.name:e.id),i(I)&&I.animateAppear()):i(I)&&I.animateDepart()})),e.destroy=s(e,e.destroy,function(){D.removeAll();var t;for(t=0;t<F.length;t++)F[t].dispose();e.screenSpaceEventHandler.removeInputAction(a.LEFT_CLICK),e.screenSpaceEventHandler.removeInputAction(a.LEFT_DOUBLE_CLICK);var i=e.dataSources,r=i.length;for(t=0;r>t;t++)T(i,i.get(t))})},_=new e;return g}),i("Widgets/Viewer/viewerPerformanceWatchdogMixin",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../PerformanceWatchdog/PerformanceWatchdog"],function(e,t,i,r,n){"use strict";function o(o,a){if(!t(o))throw new r("viewer is required.");a=e(a,e.EMPTY_OBJECT);var s=new n({scene:o.scene,container:o.bottomContainer,lowFrameRateMessage:a.lowFrameRateMessage});i(o,{performanceWatchdog:{get:function(){return s}}})}return o}),i("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,i){"use strict";function r(r){var n,o=[],a={id:void 0,result:void 0,error:void 0};return function(s){var l=s.data;o.length=0,a.id=l.id,a.error=void 0,a.result=void 0;try{a.result=r(l.parameters,o)}catch(u){u instanceof Error?a.error={name:u.name,message:u.message,stack:u.stack}:a.error=u}t(n)||(n=e(self.webkitPostMessage,self.postMessage)),l.canTransferArrayBuffer||(o.length=0);try{n(a,o)}catch(u){a.result=void 0,a.error="postMessage failed with error: "+i(u)+"\n with responseMessage: "+JSON.stringify(a),n(a)}}}return r}),i("Cesium",["./Core/appendForwardSlash","./Core/ArcGisImageServerTerrainProvider","./Core/AssociativeArray","./Core/AttributeCompression","./Core/AxisAlignedBoundingBox","./Core/barycentricCoordinates","./Core/binarySearch","./Core/BingMapsApi","./Core/BoundingRectangle","./Core/BoundingSphere","./Core/BoxGeometry","./Core/BoxOutlineGeometry","./Core/buildModuleUrl","./Core/cancelAnimationFrame","./Core/Cartesian2","./Core/Cartesian3","./Core/Cartesian4","./Core/Cartographic","./Core/CatmullRomSpline","./Core/CesiumTerrainProvider","./Core/CircleGeometry","./Core/CircleOutlineGeometry","./Core/Clock","./Core/ClockRange","./Core/ClockStep","./Core/clone","./Core/Color","./Core/ColorGeometryInstanceAttribute","./Core/combine","./Core/ComponentDatatype","./Core/CornerType","./Core/CorridorGeometry","./Core/CorridorGeometryLibrary","./Core/CorridorOutlineGeometry","./Core/createGuid","./Core/Credit","./Core/CubicRealPolynomial","./Core/CylinderGeometry","./Core/CylinderGeometryLibrary","./Core/CylinderOutlineGeometry","./Core/DefaultProxy","./Core/defaultValue","./Core/defined","./Core/definedNotNull","./Core/defineProperties","./Core/deprecationWarning","./Core/destroyObject","./Core/DeveloperError","./Core/EarthOrientationParameters","./Core/EarthOrientationParametersSample","./Core/EasingFunction","./Core/EllipseGeometry","./Core/EllipseGeometryLibrary","./Core/EllipseOutlineGeometry","./Core/Ellipsoid","./Core/EllipsoidalOccluder","./Core/EllipsoidGeodesic","./Core/EllipsoidGeometry","./Core/EllipsoidOutlineGeometry","./Core/EllipsoidTangentPlane","./Core/EllipsoidTerrainProvider","./Core/EncodedCartesian3","./Core/Event","./Core/EventHelper","./Core/ExtrapolationType","./Core/FeatureDetection","./Core/formatError","./Core/freezeObject","./Core/Fullscreen","./Core/GeographicProjection","./Core/GeographicTilingScheme","./Core/Geometry","./Core/GeometryAttribute","./Core/GeometryAttributes","./Core/GeometryInstance","./Core/GeometryInstanceAttribute","./Core/GeometryPipeline","./Core/GeometryType","./Core/getAbsoluteUri","./Core/getBaseUri","./Core/getExtensionFromUri","./Core/getFilenameFromUri","./Core/getImagePixels","./Core/getMagic","./Core/getStringFromTypedArray","./Core/getTimestamp","./Core/GregorianDate","./Core/HeadingPitchRange","./Core/HeightmapTerrainData","./Core/HeightmapTessellator","./Core/HermitePolynomialApproximation","./Core/HermiteSpline","./Core/Iau2000Orientation","./Core/Iau2006XysData","./Core/Iau2006XysSample","./Core/IauOrientationAxes","./Core/IauOrientationParameters","./Core/IndexDatatype","./Core/InterpolationAlgorithm","./Core/Intersect","./Core/Intersections2D","./Core/IntersectionTests","./Core/Interval","./Core/isArray","./Core/isCrossOriginUrl","./Core/isLeapYear","./Core/Iso8601","./Core/joinUrls","./Core/JulianDate","./Core/KeyboardEventModifier","./Core/LagrangePolynomialApproximation","./Core/LeapSecond","./Core/LinearApproximation","./Core/LinearSpline","./Core/loadArrayBuffer","./Core/loadBlob","./Core/loadImage","./Core/loadImageFromTypedArray","./Core/loadImageViaBlob","./Core/loadJson","./Core/loadJsonp","./Core/loadText","./Core/loadWithXhr","./Core/loadXML","./Core/MapboxApi","./Core/MapProjection","./Core/Math","./Core/Matrix2","./Core/Matrix3","./Core/Matrix4","./Core/mergeSort","./Core/NearFarScalar","./Core/objectToQuery","./Core/Occluder","./Core/OrientedBoundingBox","./Core/Packable","./Core/PackableForInterpolation","./Core/parseResponseHeaders","./Core/PinBuilder","./Core/PixelFormat","./Core/Plane","./Core/PointGeometry","./Core/pointInsideTriangle","./Core/PolygonGeometry","./Core/PolygonGeometryLibrary","./Core/PolygonHierarchy","./Core/PolygonOutlineGeometry","./Core/PolygonPipeline","./Core/PolylineGeometry","./Core/PolylinePipeline","./Core/PolylineVolumeGeometry","./Core/PolylineVolumeGeometryLibrary","./Core/PolylineVolumeOutlineGeometry","./Core/PrimitiveType","./Core/QuadraticRealPolynomial","./Core/QuantizedMeshTerrainData","./Core/QuarticRealPolynomial","./Core/Quaternion","./Core/QuaternionSpline","./Core/queryToObject","./Core/Queue","./Core/Ray","./Core/Rectangle","./Core/RectangleGeometry","./Core/RectangleGeometryLibrary","./Core/RectangleOutlineGeometry","./Core/ReferenceFrame","./Core/requestAnimationFrame","./Core/RequestErrorEvent","./Core/RuntimeError","./Core/sampleTerrain","./Core/scaleToGeodeticSurface","./Core/ScreenSpaceEventHandler","./Core/ScreenSpaceEventType","./Core/ShowGeometryInstanceAttribute","./Core/Simon1994PlanetaryPositions","./Core/SimplePolylineGeometry","./Core/SphereGeometry","./Core/SphereOutlineGeometry","./Core/Spherical","./Core/Spline","./Core/subdivideArray","./Core/TaskProcessor","./Core/TerrainData","./Core/TerrainEncoding","./Core/TerrainMesh","./Core/TerrainProvider","./Core/TerrainQuantization","./Core/throttleRequestByServer","./Core/TileProviderError","./Core/TilingScheme","./Core/TimeConstants","./Core/TimeInterval","./Core/TimeIntervalCollection","./Core/TimeStandard","./Core/Tipsify","./Core/Transforms","./Core/TranslationRotationScale","./Core/TridiagonalSystemSolver","./Core/VertexFormat","./Core/VideoSynchronizer","./Core/Visibility","./Core/VRTheWorldTerrainProvider","./Core/WallGeometry","./Core/WallGeometryLibrary","./Core/WallOutlineGeometry","./Core/WebMercatorProjection","./Core/WebMercatorTilingScheme","./Core/WindingOrder","./Core/wrapFunction","./Core/writeTextToCanvas","./DataSources/BillboardGraphics","./DataSources/BillboardVisualizer","./DataSources/BoundingSphereState","./DataSources/BoxGeometryUpdater","./DataSources/BoxGraphics","./DataSources/CallbackProperty","./DataSources/CheckerboardMaterialProperty","./DataSources/ColorMaterialProperty","./DataSources/CompositeEntityCollection","./DataSources/CompositeMaterialProperty","./DataSources/CompositePositionProperty","./DataSources/CompositeProperty","./DataSources/ConstantPositionProperty","./DataSources/ConstantProperty","./DataSources/CorridorGeometryUpdater","./DataSources/CorridorGraphics","./DataSources/createMaterialPropertyDescriptor","./DataSources/createPropertyDescriptor","./DataSources/createRawPropertyDescriptor","./DataSources/CustomDataSource","./DataSources/CylinderGeometryUpdater","./DataSources/CylinderGraphics","./DataSources/CzmlDataSource","./DataSources/DataSource","./DataSources/DataSourceClock","./DataSources/DataSourceCollection","./DataSources/DataSourceDisplay","./DataSources/dynamicGeometryGetBoundingSphere","./DataSources/DynamicGeometryUpdater","./DataSources/EllipseGeometryUpdater","./DataSources/EllipseGraphics","./DataSources/EllipsoidGeometryUpdater","./DataSources/EllipsoidGraphics","./DataSources/Entity","./DataSources/EntityCollection","./DataSources/EntityView","./DataSources/GeoJsonDataSource","./DataSources/GeometryUpdater","./DataSources/GeometryVisualizer","./DataSources/GridMaterialProperty","./DataSources/ImageMaterialProperty","./DataSources/KmlDataSource","./DataSources/LabelGraphics","./DataSources/LabelVisualizer","./DataSources/MaterialProperty","./DataSources/ModelGraphics","./DataSources/ModelVisualizer","./DataSources/NodeTransformationProperty","./DataSources/PathGraphics","./DataSources/PathVisualizer","./DataSources/PointGraphics","./DataSources/PointVisualizer","./DataSources/PolygonGeometryUpdater","./DataSources/PolygonGraphics","./DataSources/PolylineArrowMaterialProperty","./DataSources/PolylineGeometryUpdater","./DataSources/PolylineGlowMaterialProperty","./DataSources/PolylineGraphics","./DataSources/PolylineOutlineMaterialProperty","./DataSources/PolylineVolumeGeometryUpdater","./DataSources/PolylineVolumeGraphics","./DataSources/PositionProperty","./DataSources/PositionPropertyArray","./DataSources/Property","./DataSources/PropertyArray","./DataSources/PropertyBag","./DataSources/RectangleGeometryUpdater","./DataSources/RectangleGraphics","./DataSources/ReferenceProperty","./DataSources/Rotation","./DataSources/SampledPositionProperty","./DataSources/SampledProperty","./DataSources/ScaledPositionProperty","./DataSources/StaticGeometryColorBatch","./DataSources/StaticGeometryPerMaterialBatch","./DataSources/StaticOutlineGeometryBatch","./DataSources/StripeMaterialProperty","./DataSources/StripeOrientation","./DataSources/TimeIntervalCollectionPositionProperty","./DataSources/TimeIntervalCollectionProperty","./DataSources/VelocityOrientationProperty","./DataSources/Visualizer","./DataSources/WallGeometryUpdater","./DataSources/WallGraphics","./Renderer/AutomaticUniforms","./Renderer/Buffer","./Renderer/BufferUsage","./Renderer/ClearCommand","./Renderer/ComputeCommand","./Renderer/ComputeEngine","./Renderer/Context","./Renderer/ContextLimits","./Renderer/createUniform","./Renderer/createUniformArray","./Renderer/CubeMap","./Renderer/CubeMapFace","./Renderer/DrawCommand","./Renderer/Framebuffer","./Renderer/loadCubeMap","./Renderer/MipmapHint","./Renderer/PassState","./Renderer/PickFramebuffer","./Renderer/PixelDatatype","./Renderer/Renderbuffer","./Renderer/RenderbufferFormat","./Renderer/RenderState","./Renderer/Sampler","./Renderer/ShaderCache","./Renderer/ShaderProgram","./Renderer/ShaderSource","./Renderer/Texture","./Renderer/TextureMagnificationFilter","./Renderer/TextureMinificationFilter","./Renderer/TextureWrap","./Renderer/UniformState","./Renderer/VertexArray","./Renderer/VertexArrayFacade","./Renderer/WebGLConstants","./Scene/Appearance","./Scene/ArcGisMapServerImageryProvider","./Scene/Billboard","./Scene/BillboardCollection","./Scene/BingMapsImageryProvider","./Scene/BingMapsStyle","./Scene/BlendEquation","./Scene/BlendFunction","./Scene/BlendingState","./Scene/Camera","./Scene/CameraEventAggregator","./Scene/CameraEventType","./Scene/CameraFlightPath","./Scene/createOpenStreetMapImageryProvider","./Scene/createTangentSpaceDebugPrimitive","./Scene/createTileMapServiceImageryProvider","./Scene/CreditDisplay","./Scene/CullFace","./Scene/CullingVolume","./Scene/DebugAppearance","./Scene/DebugModelMatrixPrimitive","./Scene/DepthFunction","./Scene/DepthPlane","./Scene/DeviceOrientationCameraController","./Scene/DiscardMissingTileImagePolicy","./Scene/EllipsoidPrimitive","./Scene/EllipsoidSurfaceAppearance","./Scene/Fog","./Scene/FrameRateMonitor","./Scene/FrameState","./Scene/FrustumCommands","./Scene/FXAA","./Scene/GetFeatureInfoFormat","./Scene/getModelAccessor","./Scene/Globe","./Scene/GlobeDepth","./Scene/GlobeSurfaceShaderSet","./Scene/GlobeSurfaceTile","./Scene/GlobeSurfaceTileProvider","./Scene/GoogleEarthImageryProvider","./Scene/GridImageryProvider","./Scene/GroundPrimitive","./Scene/HeightReference","./Scene/HorizontalOrigin","./Scene/Imagery","./Scene/ImageryLayer","./Scene/ImageryLayerCollection","./Scene/ImageryLayerFeatureInfo","./Scene/ImageryProvider","./Scene/ImageryState","./Scene/Label","./Scene/LabelCollection","./Scene/LabelStyle","./Scene/MapboxImageryProvider","./Scene/Material","./Scene/MaterialAppearance","./Scene/Model","./Scene/ModelAnimation","./Scene/ModelAnimationCache","./Scene/ModelAnimationCollection","./Scene/ModelAnimationLoop","./Scene/ModelAnimationState","./Scene/ModelMaterial","./Scene/modelMaterialsCommon","./Scene/ModelMesh","./Scene/ModelNode","./Scene/Moon","./Scene/NeverTileDiscardPolicy","./Scene/OIT","./Scene/OpenStreetMapImageryProvider","./Scene/OrthographicFrustum","./Scene/Pass","./Scene/PerformanceDisplay","./Scene/PerInstanceColorAppearance","./Scene/PerspectiveFrustum","./Scene/PerspectiveOffCenterFrustum","./Scene/PickDepth","./Scene/PointAppearance","./Scene/PointPrimitive","./Scene/PointPrimitiveCollection","./Scene/Polyline","./Scene/PolylineCollection","./Scene/PolylineColorAppearance","./Scene/PolylineMaterialAppearance","./Scene/Primitive","./Scene/PrimitiveCollection","./Scene/PrimitivePipeline","./Scene/PrimitiveState","./Scene/QuadtreeOccluders","./Scene/QuadtreePrimitive","./Scene/QuadtreeTile","./Scene/QuadtreeTileLoadState","./Scene/QuadtreeTileProvider","./Scene/Scene","./Scene/SceneMode","./Scene/SceneTransforms","./Scene/SceneTransitioner","./Scene/ScreenSpaceCameraController","./Scene/SingleTileImageryProvider","./Scene/SkyAtmosphere","./Scene/SkyBox","./Scene/StencilFunction","./Scene/StencilOperation","./Scene/Sun","./Scene/SunPostProcess","./Scene/TerrainState","./Scene/TextureAtlas","./Scene/TileBoundingBox","./Scene/TileCoordinatesImageryProvider","./Scene/TileDiscardPolicy","./Scene/TileImagery","./Scene/TileMapServiceImageryProvider","./Scene/TileReplacementQueue","./Scene/TileState","./Scene/TileTerrain","./Scene/TweenCollection","./Scene/UrlTemplateImageryProvider","./Scene/VerticalOrigin","./Scene/ViewportQuad","./Scene/WebMapServiceImageryProvider","./Scene/WebMapTileServiceImageryProvider","./Shaders/AdjustTranslucentFS","./Shaders/Appearances/AllMaterialAppearanceFS","./Shaders/Appearances/AllMaterialAppearanceVS","./Shaders/Appearances/BasicMaterialAppearanceFS","./Shaders/Appearances/BasicMaterialAppearanceVS","./Shaders/Appearances/EllipsoidSurfaceAppearanceFS","./Shaders/Appearances/EllipsoidSurfaceAppearanceVS","./Shaders/Appearances/PerInstanceColorAppearanceFS","./Shaders/Appearances/PerInstanceColorAppearanceVS","./Shaders/Appearances/PerInstanceFlatColorAppearanceFS","./Shaders/Appearances/PerInstanceFlatColorAppearanceVS","./Shaders/Appearances/PointAppearanceFS","./Shaders/Appearances/PointAppearanceVS","./Shaders/Appearances/PolylineColorAppearanceVS","./Shaders/Appearances/PolylineMaterialAppearanceVS","./Shaders/Appearances/TexturedMaterialAppearanceFS","./Shaders/Appearances/TexturedMaterialAppearanceVS","./Shaders/BillboardCollectionFS","./Shaders/BillboardCollectionVS","./Shaders/Builtin/Constants/degreesPerRadian","./Shaders/Builtin/Constants/depthRange","./Shaders/Builtin/Constants/epsilon1","./Shaders/Builtin/Constants/epsilon2","./Shaders/Builtin/Constants/epsilon3","./Shaders/Builtin/Constants/epsilon4","./Shaders/Builtin/Constants/epsilon5","./Shaders/Builtin/Constants/epsilon6","./Shaders/Builtin/Constants/epsilon7","./Shaders/Builtin/Constants/infinity","./Shaders/Builtin/Constants/oneOverPi","./Shaders/Builtin/Constants/oneOverTwoPi","./Shaders/Builtin/Constants/pi","./Shaders/Builtin/Constants/piOverFour","./Shaders/Builtin/Constants/piOverSix","./Shaders/Builtin/Constants/piOverThree","./Shaders/Builtin/Constants/piOverTwo","./Shaders/Builtin/Constants/radiansPerDegree","./Shaders/Builtin/Constants/sceneMode2D","./Shaders/Builtin/Constants/sceneMode3D","./Shaders/Builtin/Constants/sceneModeColumbusView","./Shaders/Builtin/Constants/sceneModeMorphing","./Shaders/Builtin/Constants/solarRadius","./Shaders/Builtin/Constants/threePiOver2","./Shaders/Builtin/Constants/twoPi","./Shaders/Builtin/Constants/webMercatorMaxLatitude","./Shaders/Builtin/CzmBuiltins","./Shaders/Builtin/Functions/alphaWeight","./Shaders/Builtin/Functions/antialias","./Shaders/Builtin/Functions/columbusViewMorph","./Shaders/Builtin/Functions/computePosition","./Shaders/Builtin/Functions/cosineAndSine","./Shaders/Builtin/Functions/decompressTextureCoordinates","./Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates","./Shaders/Builtin/Functions/ellipsoidContainsPoint","./Shaders/Builtin/Functions/ellipsoidNew","./Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates","./Shaders/Builtin/Functions/equalsEpsilon","./Shaders/Builtin/Functions/eyeOffset","./Shaders/Builtin/Functions/eyeToWindowCoordinates","./Shaders/Builtin/Functions/fog","./Shaders/Builtin/Functions/geodeticSurfaceNormal","./Shaders/Builtin/Functions/getDefaultMaterial","./Shaders/Builtin/Functions/getLambertDiffuse","./Shaders/Builtin/Functions/getSpecular","./Shaders/Builtin/Functions/getWaterNoise","./Shaders/Builtin/Functions/getWgs84EllipsoidEC","./Shaders/Builtin/Functions/hue","./Shaders/Builtin/Functions/isEmpty","./Shaders/Builtin/Functions/isFull","./Shaders/Builtin/Functions/latitudeToWebMercatorFraction","./Shaders/Builtin/Functions/luminance","./Shaders/Builtin/Functions/metersPerPixel","./Shaders/Builtin/Functions/modelToWindowCoordinates","./Shaders/Builtin/Functions/multiplyWithColorBalance","./Shaders/Builtin/Functions/nearFarScalar","./Shaders/Builtin/Functions/octDecode","./Shaders/Builtin/Functions/packDepth","./Shaders/Builtin/Functions/phong","./Shaders/Builtin/Functions/pointAlongRay","./Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval","./Shaders/Builtin/Functions/RGBToXYZ","./Shaders/Builtin/Functions/saturation","./Shaders/Builtin/Functions/signNotZero","./Shaders/Builtin/Functions/tangentToEyeSpaceMatrix","./Shaders/Builtin/Functions/translateRelativeToEye","./Shaders/Builtin/Functions/translucentPhong","./Shaders/Builtin/Functions/transpose","./Shaders/Builtin/Functions/unpackDepth","./Shaders/Builtin/Functions/windowToEyeCoordinates","./Shaders/Builtin/Functions/XYZToRGB","./Shaders/Builtin/Structs/depthRangeStruct","./Shaders/Builtin/Structs/ellipsoid","./Shaders/Builtin/Structs/material","./Shaders/Builtin/Structs/materialInput","./Shaders/Builtin/Structs/ray","./Shaders/Builtin/Structs/raySegment","./Shaders/CompositeOITFS","./Shaders/DepthPlaneFS","./Shaders/DepthPlaneVS","./Shaders/EllipsoidFS","./Shaders/EllipsoidVS","./Shaders/GlobeFS","./Shaders/GlobeVS","./Shaders/GroundAtmosphere","./Shaders/Materials/BumpMapMaterial","./Shaders/Materials/CheckerboardMaterial","./Shaders/Materials/DotMaterial","./Shaders/Materials/FadeMaterial","./Shaders/Materials/GridMaterial","./Shaders/Materials/NormalMapMaterial","./Shaders/Materials/PolylineArrowMaterial","./Shaders/Materials/PolylineGlowMaterial","./Shaders/Materials/PolylineOutlineMaterial","./Shaders/Materials/RimLightingMaterial","./Shaders/Materials/StripeMaterial","./Shaders/Materials/Water","./Shaders/PointPrimitiveCollectionFS","./Shaders/PointPrimitiveCollectionVS","./Shaders/PolylineCommon","./Shaders/PolylineFS","./Shaders/PolylineVS","./Shaders/PostProcessFilters/AdditiveBlend","./Shaders/PostProcessFilters/BrightPass","./Shaders/PostProcessFilters/FXAA","./Shaders/PostProcessFilters/GaussianBlur1D","./Shaders/PostProcessFilters/PassThrough","./Shaders/ReprojectWebMercatorFS","./Shaders/ReprojectWebMercatorVS","./Shaders/ShadowVolumeFS","./Shaders/ShadowVolumeVS","./Shaders/SkyAtmosphereFS","./Shaders/SkyAtmosphereVS","./Shaders/SkyBoxFS","./Shaders/SkyBoxVS","./Shaders/SunFS","./Shaders/SunTextureFS","./Shaders/SunVS","./Shaders/ViewportQuadFS","./Shaders/ViewportQuadVS","./ThirdParty/Autolinker","./ThirdParty/gltfDefaults","./ThirdParty/knockout-3.2.0","./ThirdParty/knockout-es5","./ThirdParty/knockout","./ThirdParty/measureText","./ThirdParty/mersenne-twister","./ThirdParty/NoSleep","./ThirdParty/sprintf","./ThirdParty/topojson","./ThirdParty/Tween","./ThirdParty/Uri","./ThirdParty/when","./ThirdParty/zip","./Widgets/Animation/Animation","./Widgets/Animation/AnimationViewModel","./Widgets/BaseLayerPicker/BaseLayerPicker","./Widgets/BaseLayerPicker/BaseLayerPickerViewModel","./Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels","./Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels","./Widgets/BaseLayerPicker/ProviderViewModel","./Widgets/CesiumInspector/CesiumInspector","./Widgets/CesiumInspector/CesiumInspectorViewModel","./Widgets/CesiumWidget/CesiumWidget","./Widgets/ClockViewModel","./Widgets/Command","./Widgets/createCommand","./Widgets/FullscreenButton/FullscreenButton","./Widgets/FullscreenButton/FullscreenButtonViewModel","./Widgets/Geocoder/Geocoder","./Widgets/Geocoder/GeocoderViewModel","./Widgets/getElement","./Widgets/HomeButton/HomeButton","./Widgets/HomeButton/HomeButtonViewModel","./Widgets/InfoBox/InfoBox","./Widgets/InfoBox/InfoBoxViewModel","./Widgets/NavigationHelpButton/NavigationHelpButton","./Widgets/NavigationHelpButton/NavigationHelpButtonViewModel","./Widgets/PerformanceWatchdog/PerformanceWatchdog","./Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel","./Widgets/SceneModePicker/SceneModePicker","./Widgets/SceneModePicker/SceneModePickerViewModel","./Widgets/SelectionIndicator/SelectionIndicator","./Widgets/SelectionIndicator/SelectionIndicatorViewModel","./Widgets/subscribeAndEvaluate","./Widgets/SvgPathBindingHandler","./Widgets/Timeline/Timeline","./Widgets/Timeline/TimelineHighlightRange","./Widgets/Timeline/TimelineTrack","./Widgets/ToggleButtonViewModel","./Widgets/Viewer/Viewer","./Widgets/Viewer/viewerCesiumInspectorMixin","./Widgets/Viewer/viewerDragDropMixin","./Widgets/Viewer/viewerEntityMixin","./Widgets/Viewer/viewerPerformanceWatchdogMixin","./Widgets/VRButton/VRButton","./Widgets/VRButton/VRButtonViewModel","./Workers/createTaskProcessorWorker"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O,N,L,F,B,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,he,de,me,pe,fe,ve,ge,_e,ye,Ce,Ee,Se,we,Te,xe,be,Ae,Pe,Ie,Me,De,Re,Oe,Ne,Le,Fe,Be,Ve,ke,ze,Ue,Ge,We,He,qe,je,Ye,Xe,Ze,Ke,Qe,Je,$e,et,tt,it,rt,nt,ot,at,st,lt,ut,ct,ht,dt,mt,pt,ft,vt,gt,_t,yt,Ct,Et,St,wt,Tt,xt,bt,At,Pt,It,Mt,Dt,Rt,Ot,Nt,Lt,Ft,Bt,Vt,kt,zt,Ut,Gt,Wt,Ht,qt,jt,Yt,Xt,Zt,Kt,Qt,Jt,$t,ei,ti,ii,ri,ni,oi,ai,si,li,ui,ci,hi,di,mi,pi,fi,vi,gi,_i,yi,Ci,Ei,Si,wi,Ti,xi,bi,Ai,Pi,Ii,Mi,Di,Ri,Oi,Ni,Li,Fi,Bi,Vi,ki,zi,Ui,Gi,Wi,Hi,qi,ji,Yi,Xi,Zi,Ki,Qi,Ji,$i,er,tr,ir,rr,nr,or,ar,sr,lr,ur,cr,hr,dr,mr,pr,fr,vr,gr,_r,yr,Cr,Er,Sr,wr,Tr,xr,br,Ar,Pr,Ir,Mr,Dr,Rr,Or,Nr,Lr,Fr,Br,Vr,kr,zr,Ur,Gr,Wr,Hr,qr,jr,Yr,Xr,Zr,Kr,Qr,Jr,$r,en,tn,rn,nn,on,an,sn,ln,un,cn,hn,dn,mn,pn,fn,vn,gn,_n,yn,Cn,En,Sn,wn,Tn,xn,bn,An,Pn,In,Mn,Dn,Rn,On,Nn,Ln,Fn,Bn,Vn,kn,zn,Un,Gn,Wn,Hn,qn,jn,Yn,Xn,Zn,Kn,Qn,Jn,$n,eo,to,io,ro,no,oo,ao,so,lo,uo,co,ho,mo,po,fo,vo,go,_o,yo,Co,Eo,So,wo,To,xo,bo,Ao,Po,Io,Mo,Do,Ro,Oo,No,Lo,Fo,Bo,Vo,ko,zo,Uo,Go,Wo,Ho,qo,jo,Yo,Xo,Zo,Ko,Qo,Jo,$o,ea,ta,ia,ra,na,oa,aa,sa,la,ua,ca,ha,da,ma,pa,fa,va,ga,_a,ya,Ca,Ea,Sa,wa,Ta,xa,ba,Aa,Pa,Ia,Ma,Da,Ra,Oa,Na,La,Fa,Ba,Va,ka,za,Ua,Ga,Wa,Ha,qa,ja,Ya,Xa,Za,Ka,Qa,Ja,$a,es,ts,is,rs,ns,os,as,ss,ls,us,cs,hs,ds,ms,ps,fs,vs,gs,_s,ys,Cs,Es,Ss,ws,Ts,xs,bs,As,Ps,Is,Ms,Ds,Rs,Os,Ns,Ls,Fs,Bs,Vs,ks,zs,Us,Gs,Ws,Hs,qs,js,Ys,Xs,Zs,Ks,Qs,Js,$s,el,tl,il,rl,nl,ol,al,sl,ll,ul,cl,hl,dl,ml,pl,fl,vl,gl,_l,yl,Cl,El,Sl,wl,Tl,xl,bl,Al,Pl,Il,Ml,Dl,Rl,Ol,Nl,Ll,Fl,Bl,Vl,kl,zl,Ul,Gl,Wl,Hl,ql,jl,Yl,Xl,Zl,Kl,Ql,Jl,$l,eu,tu,iu,ru,nu,ou,au,su,lu,uu,cu,hu,du,mu,pu,fu,vu,gu,_u,yu,Cu,Eu,Su,wu,Tu,xu,bu,Au,Pu,Iu,Mu,Du,Ru,Ou,Nu,Lu,Fu,Bu,Vu,ku,zu,Uu,Gu,Wu,Hu,qu,ju,Yu,Xu,Zu,Ku,Qu,Ju,$u,ec,tc,ic,rc,nc,oc,ac,sc,lc,uc,cc,hc,dc,mc,pc,fc,vc,gc,_c,yc,Cc,Ec,Sc,wc,Tc,xc,bc,Ac,Pc,Ic,Mc,Dc,Rc,Oc,Nc,Lc,Fc,Bc,Vc,kc,zc,Uc,Gc,Wc,Hc,qc,jc,Yc,Xc,Zc,Kc,Qc,Jc,$c,eh){ +"use strict";var th={VERSION:"1.18",_shaders:{}};return th.appendForwardSlash=e,th.ArcGisImageServerTerrainProvider=t,th.AssociativeArray=i,th.AttributeCompression=r,th.AxisAlignedBoundingBox=n,th.barycentricCoordinates=o,th.binarySearch=a,th.BingMapsApi=s,th.BoundingRectangle=l,th.BoundingSphere=u,th.BoxGeometry=c,th.BoxOutlineGeometry=h,th.buildModuleUrl=d,th.cancelAnimationFrame=m,th.Cartesian2=p,th.Cartesian3=f,th.Cartesian4=v,th.Cartographic=g,th.CatmullRomSpline=_,th.CesiumTerrainProvider=y,th.CircleGeometry=C,th.CircleOutlineGeometry=E,th.Clock=S,th.ClockRange=w,th.ClockStep=T,th.clone=x,th.Color=b,th.ColorGeometryInstanceAttribute=A,th.combine=P,th.ComponentDatatype=I,th.CornerType=M,th.CorridorGeometry=D,th.CorridorGeometryLibrary=R,th.CorridorOutlineGeometry=O,th.createGuid=N,th.Credit=L,th.CubicRealPolynomial=F,th.CylinderGeometry=B,th.CylinderGeometryLibrary=V,th.CylinderOutlineGeometry=k,th.DefaultProxy=z,th.defaultValue=U,th.defined=G,th.definedNotNull=W,th.defineProperties=H,th.deprecationWarning=q,th.destroyObject=j,th.DeveloperError=Y,th.EarthOrientationParameters=X,th.EarthOrientationParametersSample=Z,th.EasingFunction=K,th.EllipseGeometry=Q,th.EllipseGeometryLibrary=J,th.EllipseOutlineGeometry=$,th.Ellipsoid=ee,th.EllipsoidalOccluder=te,th.EllipsoidGeodesic=ie,th.EllipsoidGeometry=re,th.EllipsoidOutlineGeometry=ne,th.EllipsoidTangentPlane=oe,th.EllipsoidTerrainProvider=ae,th.EncodedCartesian3=se,th.Event=le,th.EventHelper=ue,th.ExtrapolationType=ce,th.FeatureDetection=he,th.formatError=de,th.freezeObject=me,th.Fullscreen=pe,th.GeographicProjection=fe,th.GeographicTilingScheme=ve,th.Geometry=ge,th.GeometryAttribute=_e,th.GeometryAttributes=ye,th.GeometryInstance=Ce,th.GeometryInstanceAttribute=Ee,th.GeometryPipeline=Se,th.GeometryType=we,th.getAbsoluteUri=Te,th.getBaseUri=xe,th.getExtensionFromUri=be,th.getFilenameFromUri=Ae,th.getImagePixels=Pe,th.getMagic=Ie,th.getStringFromTypedArray=Me,th.getTimestamp=De,th.GregorianDate=Re,th.HeadingPitchRange=Oe,th.HeightmapTerrainData=Ne,th.HeightmapTessellator=Le,th.HermitePolynomialApproximation=Fe,th.HermiteSpline=Be,th.Iau2000Orientation=Ve,th.Iau2006XysData=ke,th.Iau2006XysSample=ze,th.IauOrientationAxes=Ue,th.IauOrientationParameters=Ge,th.IndexDatatype=We,th.InterpolationAlgorithm=He,th.Intersect=qe,th.Intersections2D=je,th.IntersectionTests=Ye,th.Interval=Xe,th.isArray=Ze,th.isCrossOriginUrl=Ke,th.isLeapYear=Qe,th.Iso8601=Je,th.joinUrls=$e,th.JulianDate=et,th.KeyboardEventModifier=tt,th.LagrangePolynomialApproximation=it,th.LeapSecond=rt,th.LinearApproximation=nt,th.LinearSpline=ot,th.loadArrayBuffer=at,th.loadBlob=st,th.loadImage=lt,th.loadImageFromTypedArray=ut,th.loadImageViaBlob=ct,th.loadJson=ht,th.loadJsonp=dt,th.loadText=mt,th.loadWithXhr=pt,th.loadXML=ft,th.MapboxApi=vt,th.MapProjection=gt,th.Math=_t,th.Matrix2=yt,th.Matrix3=Ct,th.Matrix4=Et,th.mergeSort=St,th.NearFarScalar=wt,th.objectToQuery=Tt,th.Occluder=xt,th.OrientedBoundingBox=bt,th.Packable=At,th.PackableForInterpolation=Pt,th.parseResponseHeaders=It,th.PinBuilder=Mt,th.PixelFormat=Dt,th.Plane=Rt,th.PointGeometry=Ot,th.pointInsideTriangle=Nt,th.PolygonGeometry=Lt,th.PolygonGeometryLibrary=Ft,th.PolygonHierarchy=Bt,th.PolygonOutlineGeometry=Vt,th.PolygonPipeline=kt,th.PolylineGeometry=zt,th.PolylinePipeline=Ut,th.PolylineVolumeGeometry=Gt,th.PolylineVolumeGeometryLibrary=Wt,th.PolylineVolumeOutlineGeometry=Ht,th.PrimitiveType=qt,th.QuadraticRealPolynomial=jt,th.QuantizedMeshTerrainData=Yt,th.QuarticRealPolynomial=Xt,th.Quaternion=Zt,th.QuaternionSpline=Kt,th.queryToObject=Qt,th.Queue=Jt,th.Ray=$t,th.Rectangle=ei,th.RectangleGeometry=ti,th.RectangleGeometryLibrary=ii,th.RectangleOutlineGeometry=ri,th.ReferenceFrame=ni,th.requestAnimationFrame=oi,th.RequestErrorEvent=ai,th.RuntimeError=si,th.sampleTerrain=li,th.scaleToGeodeticSurface=ui,th.ScreenSpaceEventHandler=ci,th.ScreenSpaceEventType=hi,th.ShowGeometryInstanceAttribute=di,th.Simon1994PlanetaryPositions=mi,th.SimplePolylineGeometry=pi,th.SphereGeometry=fi,th.SphereOutlineGeometry=vi,th.Spherical=gi,th.Spline=_i,th.subdivideArray=yi,th.TaskProcessor=Ci,th.TerrainData=Ei,th.TerrainEncoding=Si,th.TerrainMesh=wi,th.TerrainProvider=Ti,th.TerrainQuantization=xi,th.throttleRequestByServer=bi,th.TileProviderError=Ai,th.TilingScheme=Pi,th.TimeConstants=Ii,th.TimeInterval=Mi,th.TimeIntervalCollection=Di,th.TimeStandard=Ri,th.Tipsify=Oi,th.Transforms=Ni,th.TranslationRotationScale=Li,th.TridiagonalSystemSolver=Fi,th.VertexFormat=Bi,th.VideoSynchronizer=Vi,th.Visibility=ki,th.VRTheWorldTerrainProvider=zi,th.WallGeometry=Ui,th.WallGeometryLibrary=Gi,th.WallOutlineGeometry=Wi,th.WebMercatorProjection=Hi,th.WebMercatorTilingScheme=qi,th.WindingOrder=ji,th.wrapFunction=Yi,th.writeTextToCanvas=Xi,th.BillboardGraphics=Zi,th.BillboardVisualizer=Ki,th.BoundingSphereState=Qi,th.BoxGeometryUpdater=Ji,th.BoxGraphics=$i,th.CallbackProperty=er,th.CheckerboardMaterialProperty=tr,th.ColorMaterialProperty=ir,th.CompositeEntityCollection=rr,th.CompositeMaterialProperty=nr,th.CompositePositionProperty=or,th.CompositeProperty=ar,th.ConstantPositionProperty=sr,th.ConstantProperty=lr,th.CorridorGeometryUpdater=ur,th.CorridorGraphics=cr,th.createMaterialPropertyDescriptor=hr,th.createPropertyDescriptor=dr,th.createRawPropertyDescriptor=mr,th.CustomDataSource=pr,th.CylinderGeometryUpdater=fr,th.CylinderGraphics=vr,th.CzmlDataSource=gr,th.DataSource=_r,th.DataSourceClock=yr,th.DataSourceCollection=Cr,th.DataSourceDisplay=Er,th.dynamicGeometryGetBoundingSphere=Sr,th.DynamicGeometryUpdater=wr,th.EllipseGeometryUpdater=Tr,th.EllipseGraphics=xr,th.EllipsoidGeometryUpdater=br,th.EllipsoidGraphics=Ar,th.Entity=Pr,th.EntityCollection=Ir,th.EntityView=Mr,th.GeoJsonDataSource=Dr,th.GeometryUpdater=Rr,th.GeometryVisualizer=Or,th.GridMaterialProperty=Nr,th.ImageMaterialProperty=Lr,th.KmlDataSource=Fr,th.LabelGraphics=Br,th.LabelVisualizer=Vr,th.MaterialProperty=kr,th.ModelGraphics=zr,th.ModelVisualizer=Ur,th.NodeTransformationProperty=Gr,th.PathGraphics=Wr,th.PathVisualizer=Hr,th.PointGraphics=qr,th.PointVisualizer=jr,th.PolygonGeometryUpdater=Yr,th.PolygonGraphics=Xr,th.PolylineArrowMaterialProperty=Zr,th.PolylineGeometryUpdater=Kr,th.PolylineGlowMaterialProperty=Qr,th.PolylineGraphics=Jr,th.PolylineOutlineMaterialProperty=$r,th.PolylineVolumeGeometryUpdater=en,th.PolylineVolumeGraphics=tn,th.PositionProperty=rn,th.PositionPropertyArray=nn,th.Property=on,th.PropertyArray=an,th.PropertyBag=sn,th.RectangleGeometryUpdater=ln,th.RectangleGraphics=un,th.ReferenceProperty=cn,th.Rotation=hn,th.SampledPositionProperty=dn,th.SampledProperty=mn,th.ScaledPositionProperty=pn,th.StaticGeometryColorBatch=fn,th.StaticGeometryPerMaterialBatch=vn,th.StaticOutlineGeometryBatch=gn,th.StripeMaterialProperty=_n,th.StripeOrientation=yn,th.TimeIntervalCollectionPositionProperty=Cn,th.TimeIntervalCollectionProperty=En,th.VelocityOrientationProperty=Sn,th.Visualizer=wn,th.WallGeometryUpdater=Tn,th.WallGraphics=xn,th.AutomaticUniforms=bn,th.Buffer=An,th.BufferUsage=Pn,th.ClearCommand=In,th.ComputeCommand=Mn,th.ComputeEngine=Dn,th.Context=Rn,th.ContextLimits=On,th.createUniform=Nn,th.createUniformArray=Ln,th.CubeMap=Fn,th.CubeMapFace=Bn,th.DrawCommand=Vn,th.Framebuffer=kn,th.loadCubeMap=zn,th.MipmapHint=Un,th.PassState=Gn,th.PickFramebuffer=Wn,th.PixelDatatype=Hn,th.Renderbuffer=qn,th.RenderbufferFormat=jn,th.RenderState=Yn,th.Sampler=Xn,th.ShaderCache=Zn,th.ShaderProgram=Kn,th.ShaderSource=Qn,th.Texture=Jn,th.TextureMagnificationFilter=$n,th.TextureMinificationFilter=eo,th.TextureWrap=to,th.UniformState=io,th.VertexArray=ro,th.VertexArrayFacade=no,th.WebGLConstants=oo,th.Appearance=ao,th.ArcGisMapServerImageryProvider=so,th.Billboard=lo,th.BillboardCollection=uo,th.BingMapsImageryProvider=co,th.BingMapsStyle=ho,th.BlendEquation=mo,th.BlendFunction=po,th.BlendingState=fo,th.Camera=vo,th.CameraEventAggregator=go,th.CameraEventType=_o,th.CameraFlightPath=yo,th.createOpenStreetMapImageryProvider=Co,th.createTangentSpaceDebugPrimitive=Eo,th.createTileMapServiceImageryProvider=So,th.CreditDisplay=wo,th.CullFace=To,th.CullingVolume=xo,th.DebugAppearance=bo,th.DebugModelMatrixPrimitive=Ao,th.DepthFunction=Po,th.DepthPlane=Io,th.DeviceOrientationCameraController=Mo,th.DiscardMissingTileImagePolicy=Do,th.EllipsoidPrimitive=Ro,th.EllipsoidSurfaceAppearance=Oo,th.Fog=No,th.FrameRateMonitor=Lo,th.FrameState=Fo,th.FrustumCommands=Bo,th.FXAA=Vo,th.GetFeatureInfoFormat=ko,th.getModelAccessor=zo,th.Globe=Uo,th.GlobeDepth=Go,th.GlobeSurfaceShaderSet=Wo,th.GlobeSurfaceTile=Ho,th.GlobeSurfaceTileProvider=qo,th.GoogleEarthImageryProvider=jo,th.GridImageryProvider=Yo,th.GroundPrimitive=Xo,th.HeightReference=Zo,th.HorizontalOrigin=Ko,th.Imagery=Qo,th.ImageryLayer=Jo,th.ImageryLayerCollection=$o,th.ImageryLayerFeatureInfo=ea,th.ImageryProvider=ta,th.ImageryState=ia,th.Label=ra,th.LabelCollection=na,th.LabelStyle=oa,th.MapboxImageryProvider=aa,th.Material=sa,th.MaterialAppearance=la,th.Model=ua,th.ModelAnimation=ca,th.ModelAnimationCache=ha,th.ModelAnimationCollection=da,th.ModelAnimationLoop=ma,th.ModelAnimationState=pa,th.ModelMaterial=fa,th.modelMaterialsCommon=va,th.ModelMesh=ga,th.ModelNode=_a,th.Moon=ya,th.NeverTileDiscardPolicy=Ca,th.OIT=Ea,th.OpenStreetMapImageryProvider=Sa,th.OrthographicFrustum=wa,th.Pass=Ta,th.PerformanceDisplay=xa,th.PerInstanceColorAppearance=ba,th.PerspectiveFrustum=Aa,th.PerspectiveOffCenterFrustum=Pa,th.PickDepth=Ia,th.PointAppearance=Ma,th.PointPrimitive=Da,th.PointPrimitiveCollection=Ra,th.Polyline=Oa,th.PolylineCollection=Na,th.PolylineColorAppearance=La,th.PolylineMaterialAppearance=Fa,th.Primitive=Ba,th.PrimitiveCollection=Va,th.PrimitivePipeline=ka,th.PrimitiveState=za,th.QuadtreeOccluders=Ua,th.QuadtreePrimitive=Ga,th.QuadtreeTile=Wa,th.QuadtreeTileLoadState=Ha,th.QuadtreeTileProvider=qa,th.Scene=ja,th.SceneMode=Ya,th.SceneTransforms=Xa,th.SceneTransitioner=Za,th.ScreenSpaceCameraController=Ka,th.SingleTileImageryProvider=Qa,th.SkyAtmosphere=Ja,th.SkyBox=$a,th.StencilFunction=es,th.StencilOperation=ts,th.Sun=is,th.SunPostProcess=rs,th.TerrainState=ns,th.TextureAtlas=os,th.TileBoundingBox=as,th.TileCoordinatesImageryProvider=ss,th.TileDiscardPolicy=ls,th.TileImagery=us,th.TileMapServiceImageryProvider=cs,th.TileReplacementQueue=hs,th.TileState=ds,th.TileTerrain=ms,th.TweenCollection=ps,th.UrlTemplateImageryProvider=fs,th.VerticalOrigin=vs,th.ViewportQuad=gs,th.WebMapServiceImageryProvider=_s,th.WebMapTileServiceImageryProvider=ys,th._shaders.AdjustTranslucentFS=Cs,th._shaders.AllMaterialAppearanceFS=Es,th._shaders.AllMaterialAppearanceVS=Ss,th._shaders.BasicMaterialAppearanceFS=ws,th._shaders.BasicMaterialAppearanceVS=Ts,th._shaders.EllipsoidSurfaceAppearanceFS=xs,th._shaders.EllipsoidSurfaceAppearanceVS=bs,th._shaders.PerInstanceColorAppearanceFS=As,th._shaders.PerInstanceColorAppearanceVS=Ps,th._shaders.PerInstanceFlatColorAppearanceFS=Is,th._shaders.PerInstanceFlatColorAppearanceVS=Ms,th._shaders.PointAppearanceFS=Ds,th._shaders.PointAppearanceVS=Rs,th._shaders.PolylineColorAppearanceVS=Os,th._shaders.PolylineMaterialAppearanceVS=Ns,th._shaders.TexturedMaterialAppearanceFS=Ls,th._shaders.TexturedMaterialAppearanceVS=Fs,th._shaders.BillboardCollectionFS=Bs,th._shaders.BillboardCollectionVS=Vs,th._shaders.degreesPerRadian=ks,th._shaders.depthRange=zs,th._shaders.epsilon1=Us,th._shaders.epsilon2=Gs,th._shaders.epsilon3=Ws,th._shaders.epsilon4=Hs,th._shaders.epsilon5=qs,th._shaders.epsilon6=js,th._shaders.epsilon7=Ys,th._shaders.infinity=Xs,th._shaders.oneOverPi=Zs,th._shaders.oneOverTwoPi=Ks,th._shaders.pi=Qs,th._shaders.piOverFour=Js,th._shaders.piOverSix=$s,th._shaders.piOverThree=el,th._shaders.piOverTwo=tl,th._shaders.radiansPerDegree=il,th._shaders.sceneMode2D=rl,th._shaders.sceneMode3D=nl,th._shaders.sceneModeColumbusView=ol,th._shaders.sceneModeMorphing=al,th._shaders.solarRadius=sl,th._shaders.threePiOver2=ll,th._shaders.twoPi=ul,th._shaders.webMercatorMaxLatitude=cl,th._shaders.CzmBuiltins=hl,th._shaders.alphaWeight=dl,th._shaders.antialias=ml,th._shaders.columbusViewMorph=pl,th._shaders.computePosition=fl,th._shaders.cosineAndSine=vl,th._shaders.decompressTextureCoordinates=gl,th._shaders.eastNorthUpToEyeCoordinates=_l,th._shaders.ellipsoidContainsPoint=yl,th._shaders.ellipsoidNew=Cl,th._shaders.ellipsoidWgs84TextureCoordinates=El,th._shaders.equalsEpsilon=Sl,th._shaders.eyeOffset=wl,th._shaders.eyeToWindowCoordinates=Tl,th._shaders.fog=xl,th._shaders.geodeticSurfaceNormal=bl,th._shaders.getDefaultMaterial=Al,th._shaders.getLambertDiffuse=Pl,th._shaders.getSpecular=Il,th._shaders.getWaterNoise=Ml,th._shaders.getWgs84EllipsoidEC=Dl,th._shaders.hue=Rl,th._shaders.isEmpty=Ol,th._shaders.isFull=Nl,th._shaders.latitudeToWebMercatorFraction=Ll,th._shaders.luminance=Fl,th._shaders.metersPerPixel=Bl,th._shaders.modelToWindowCoordinates=Vl,th._shaders.multiplyWithColorBalance=kl,th._shaders.nearFarScalar=zl,th._shaders.octDecode=Ul,th._shaders.packDepth=Gl,th._shaders.phong=Wl,th._shaders.pointAlongRay=Hl,th._shaders.rayEllipsoidIntersectionInterval=ql,th._shaders.RGBToXYZ=jl,th._shaders.saturation=Yl,th._shaders.signNotZero=Xl,th._shaders.tangentToEyeSpaceMatrix=Zl,th._shaders.translateRelativeToEye=Kl,th._shaders.translucentPhong=Ql,th._shaders.transpose=Jl,th._shaders.unpackDepth=$l,th._shaders.windowToEyeCoordinates=eu,th._shaders.XYZToRGB=tu,th._shaders.depthRangeStruct=iu,th._shaders.ellipsoid=ru,th._shaders.material=nu,th._shaders.materialInput=ou,th._shaders.ray=au,th._shaders.raySegment=su,th._shaders.CompositeOITFS=lu,th._shaders.DepthPlaneFS=uu,th._shaders.DepthPlaneVS=cu,th._shaders.EllipsoidFS=hu,th._shaders.EllipsoidVS=du,th._shaders.GlobeFS=mu,th._shaders.GlobeVS=pu,th._shaders.GroundAtmosphere=fu,th._shaders.BumpMapMaterial=vu,th._shaders.CheckerboardMaterial=gu,th._shaders.DotMaterial=_u,th._shaders.FadeMaterial=yu,th._shaders.GridMaterial=Cu,th._shaders.NormalMapMaterial=Eu,th._shaders.PolylineArrowMaterial=Su,th._shaders.PolylineGlowMaterial=wu,th._shaders.PolylineOutlineMaterial=Tu,th._shaders.RimLightingMaterial=xu,th._shaders.StripeMaterial=bu,th._shaders.Water=Au,th._shaders.PointPrimitiveCollectionFS=Pu,th._shaders.PointPrimitiveCollectionVS=Iu,th._shaders.PolylineCommon=Mu,th._shaders.PolylineFS=Du,th._shaders.PolylineVS=Ru,th._shaders.AdditiveBlend=Ou,th._shaders.BrightPass=Nu,th._shaders.FXAA=Lu,th._shaders.GaussianBlur1D=Fu,th._shaders.PassThrough=Bu,th._shaders.ReprojectWebMercatorFS=Vu,th._shaders.ReprojectWebMercatorVS=ku,th._shaders.ShadowVolumeFS=zu,th._shaders.ShadowVolumeVS=Uu,th._shaders.SkyAtmosphereFS=Gu,th._shaders.SkyAtmosphereVS=Wu,th._shaders.SkyBoxFS=Hu,th._shaders.SkyBoxVS=qu,th._shaders.SunFS=ju,th._shaders.SunTextureFS=Yu,th._shaders.SunVS=Xu,th._shaders.ViewportQuadFS=Zu,th._shaders.ViewportQuadVS=Ku,th.Autolinker=Qu,th.gltfDefaults=Ju,th["knockout-3.2.0"]=$u,th["knockout-es5"]=ec,th.knockout=tc,th.measureText=ic,th["mersenne-twister"]=rc,th.NoSleep=nc,th.sprintf=oc,th.topojson=ac,th.Tween=sc,th.Uri=lc,th.when=uc,th.zip=cc,th.Animation=hc,th.AnimationViewModel=dc,th.BaseLayerPicker=mc,th.BaseLayerPickerViewModel=pc,th.createDefaultImageryProviderViewModels=fc,th.createDefaultTerrainProviderViewModels=vc,th.ProviderViewModel=gc,th.CesiumInspector=_c,th.CesiumInspectorViewModel=yc,th.CesiumWidget=Cc,th.ClockViewModel=Ec,th.Command=Sc,th.createCommand=wc,th.FullscreenButton=Tc,th.FullscreenButtonViewModel=xc,th.Geocoder=bc,th.GeocoderViewModel=Ac,th.getElement=Pc,th.HomeButton=Ic,th.HomeButtonViewModel=Mc,th.InfoBox=Dc,th.InfoBoxViewModel=Rc,th.NavigationHelpButton=Oc,th.NavigationHelpButtonViewModel=Nc,th.PerformanceWatchdog=Lc,th.PerformanceWatchdogViewModel=Fc,th.SceneModePicker=Bc,th.SceneModePickerViewModel=Vc,th.SelectionIndicator=kc,th.SelectionIndicatorViewModel=zc,th.subscribeAndEvaluate=Uc,th.SvgPathBindingHandler=Gc,th.Timeline=Wc,th.TimelineHighlightRange=Hc,th.TimelineTrack=qc,th.ToggleButtonViewModel=jc,th.Viewer=Yc,th.viewerCesiumInspectorMixin=Xc,th.viewerDragDropMixin=Zc,th.viewerEntityMixin=Kc,th.viewerPerformanceWatchdogMixin=Qc,th.VRButton=Jc,th.VRButtonViewModel=$c,th.createTaskProcessorWorker=eh,th}),t(["Cesium"],function(e){"use strict";var t="undefined"!=typeof window?window:"undefined"!=typeof self?self:{};t.Cesium=e},void 0,!0)}(); \ No newline at end of file diff --git a/bower.json b/bower.json index 0d99981..5eb770c 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "cesium-bower", - "version": "1.18.2", + "version": "1.18.3", "description": "Cesium JS", "ignore": [ ]