hi-ucs/front/public/leaflet/libs/iClientfor3D/Workers/createBoxGeometry.js

61 lines
107 KiB
Vue

/**
* Cesium - https://github.com/AnalyticalGraphicsInc/cesium
*
* Copyright 2011-2017 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md for full licensing details.
*/
/**
@license
mersenne-twister.js - https://gist.github.com/banksean/300494
Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The names of its contributors may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(n){t=n.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),r>=n)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),r>n)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a.typeOf.number.equals=function(e,n,r,i){if(a.typeOf.number(e,r),a.typeOf.number(n,i),r!==i)throw new t(e+" must be equal to "+n+", the actual values are "+r+" and "+i)},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e&&null!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>1^t[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}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var a={};a.Radious=6378137,a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:0>e?-1:0},a.signNotZero=function(e){return 0>e?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){if(!n(e))throw new r("degrees is required.");return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){if(!n(e))throw new r("radians is required.");return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){if(!n(e))throw new r("angle is required.");var t=a.TWO_PI,i=e-Math.floor(e/t)*t;return i<-Math.PI?i+t:i>=Math.PI?i-t:i},a.clampToLatitudeRange=function(e){if(!n(e))throw new r("angle is required.");return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){if(!n(e))throw new r("angle is required.");return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){if(!n(e))throw new r("angle is required.");var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){if(!n(e))throw new r("m is required.");if(!n(t))throw new r("n is required.");return(e%t+t)%t},a.equalsEpsilon=function(e,a,i,o){if(!n(e))throw new r("left is required.");if(!n(a))throw new r("right is required.");if(!n(i))throw new r("relativeEpsilon is required.");o=t(o,i);var u=Math.abs(e-a);return o>=u||u<=i*Math.max(Math.abs(e),Math.abs(a))};var i=[1];a.factorial=function(e){if("number"!=typeof e||0>e)throw new r("A number greater than or equal to 0 is required.");var t=i.length;if(e>=t)for(var n=i[t-1],a=t;e>=a;a++)i.push(n*a);return i[e]},a.incrementWrap=function(e,a,i){if(i=t(i,0),!n(e))throw new r("n is required.");if(i>=a)throw new r("maximumValue must be greater than minimumValue.");return++e,e>a&&(e=i),e},a.isPowerOfTwo=function(e){if("number"!=typeof e||0>e)throw new r("A number greater than or equal to 0 is required.");return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){if("number"!=typeof e||0>e)throw new r("A number greater than or equal to 0 is required.");return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,a){if(!n(e))throw new r("value is required");if(!n(t))throw new r("min is required.");if(!n(a))throw new r("max is required.");return t>e?t:e>a?a:e};var o=new e;return a.setRandomNumberSeed=function(t){if(!n(t))throw new r("seed is required.");o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.randomBetween=function(e,t){return a.nextRandomNumber()*(t-e)+e},a.acosClamped=function(e){if(!n(e))throw new r("value is required.");return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){if(!n(e))throw new r("value is required.");return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){if(!n(e))throw new r("angle is required.");if(!n(t))throw new r("radius is required.");return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){if(!n(e))throw new r("number is required.");if(!n(t))throw new r("base is required.");return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(r,a){e.typeOf.object("spherical",r),n(a)||(a=new o);var i=r.clock,u=r.cone,s=t(r.magnitude,1),c=s*Math.sin(u);return a.x=c*Math.cos(i),a.y=c*Math.sin(i),a.z=s*Math.cos(u),a},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){return n(e)?n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z):void 0},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(n,r,a){return e.typeOf.object("value",n),e.defined("array",r),a=t(a,0),r[a++]=n.x,r[a++]=n.y,r[a]=n.z,r},o.unpack=function(r,a,i){return e.defined("array",r),a=t(a,0),n(i)||(i=new o),i.x=r[a++],i.y=r[a++],i.z=r[a],i},o.packArray=function(t,r){e.defined("array",t);var a=t.length;n(r)?r.length=3*a:r=new Array(3*a);for(var i=0;a>i;++i)o.pack(t[i],r,3*i);return r},o.unpackArray=function(t,a){if(e.defined("array",t),e.typeOf.number.greaterThanOrEquals("array.length",t.length,3),t.length%3!==0)throw new r("array length must be a multiple of 3.");var i=t.length;n(a)?a.length=i/3:a=new Array(i/3);for(var u=0;i>u;u+=3){var s=u/3;a[s]=o.unpack(t,u,a[s])}return a},o.fromArray=o.unpack,o.maximumComponent=function(t){return e.typeOf.object("cartesian",t),Math.max(t.x,t.y,t.z)},o.minimumComponent=function(t){return e.typeOf.object("cartesian",t),Math.min(t.x,t.y,t.z)},o.minimumByComponent=function(t,n,r){return e.typeOf.object("first",t),e.typeOf.object("second",n),e.typeOf.object("result",r),r.x=Math.min(t.x,n.x),r.y=Math.min(t.y,n.y),r.z=Math.min(t.z,n.z),r},o.maximumByComponent=function(t,n,r){return e.typeOf.object("first",t),e.typeOf.object("second",n),e.typeOf.object("result",r),r.x=Math.max(t.x,n.x),r.y=Math.max(t.y,n.y),r.z=Math.max(t.z,n.z),r},o.magnitudeSquared=function(t){return e.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y+t.z*t.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(t,n){return e.typeOf.object("left",t),e.typeOf.object("right",n),o.subtract(t,n,u),o.magnitude(u)},o.distanceSquared=function(t,n){return e.typeOf.object("left",t),e.typeOf.object("right",n),o.subtract(t,n,u),o.magnitudeSquared(u)},o.normalize=function(t,n){e.typeOf.object("cartesian",t),e.typeOf.object("result",n);var a=o.magnitude(t);if(n.x=t.x/a,n.y=t.y/a,n.z=t.z/a,isNaN(n.x)||isNaN(n.y)||isNaN(n.z))throw new r("normalized result is not a number");return n},o.dot=function(t,n){return e.typeOf.object("left",t),e.typeOf.object("right",n),t.x*n.x+t.y*n.y+t.z*n.z},o.multiplyComponents=function(t,n,r){return e.typeOf.object("left",t),e.typeOf.object("right",n),e.typeOf.object("result",r),r.x=t.x*n.x,r.y=t.y*n.y,r.z=t.z*n.z,r},o.divideComponents=function(t,n,r){return e.typeOf.object("left",t),e.typeOf.object("right",n),e.typeOf.object("result",r),r.x=t.x/n.x,r.y=t.y/n.y,r.z=t.z/n.z,r},o.add=function(t,n,r){return e.typeOf.object("left",t),e.typeOf.object("right",n),e.typeOf.object("result",r),r.x=t.x+n.x,r.y=t.y+n.y,r.z=t.z+n.z,r},o.subtract=function(t,n,r){return e.typeOf.object("left",t),e.typeOf.object("right",n),e.typeOf.object("result",r),r.x=t.x-n.x,r.y=t.y-n.y,r.z=t.z-n.z,r},o.multiplyByScalar=function(t,n,r){return e.typeOf.object("cartesian",t),e.typeOf.number("scalar",n),e.typeOf.object("result",r),r.x=t.x*n,r.y=t.y*n,r.z=t.z*n,r},o.divideByScalar=function(t,n,r){return e.typeOf.object("cartesian",t),e.typeOf.number("scalar",n),e.typeOf.object("result",r),r.x=t.x/n,r.y=t.y/n,r.z=t.z/n,r},o.negate=function(t,n){return e.typeOf.object("cartesian",t),e.typeOf.object("result",n),n.x=-t.x,n.y=-t.y,n.z=-t.z,n},o.abs=function(t,n){return e.typeOf.object("cartesian",t),e.typeOf.object("result",n),n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n};var s=new o;o.lerp=function(t,n,r,a){return e.typeOf.object("start",t),e.typeOf.object("end",n),e.typeOf.number("t",r),e.typeOf.object("result",a),o.multiplyByScalar(n,r,s),a=o.multiplyByScalar(t,1-r,a),o.add(s,a,a)};var c=new o,E=new o;o.angleBetween=function(t,n){e.typeOf.object("left",t),e.typeOf.object("right",n),o.normalize(t,c),o.normalize(n,E);var r=o.dot(c,E),a=o.magnitude(o.cross(c,E,c));return Math.atan2(a,r)};var f=new o;o.mostOrthogonalAxis=function(t,n){e.typeOf.object("cartesian",t),e.typeOf.object("result",n);var r=o.normalize(t,f);return o.abs(r,r),n=r.x<=r.y?r.x<=r.z?o.clone(o.UNIT_X,n):o.clone(o.UNIT_Z,n):r.y<=r.z?o.clone(o.UNIT_Y,n):o.clone(o.UNIT_Z,n)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(t,n,r){e.typeOf.object("left",t),e.typeOf.object("right",n),e.typeOf.object("result",r);var a=t.x,i=t.y,o=t.z,u=n.x,s=n.y,c=n.z,E=i*c-o*s,f=o*u-a*c,l=a*s-i*u;return r.x=E,r.y=f,r.z=l,r},o.fromDegrees=function(t,n,r,a,u){return e.typeOf.number("longitude",t),e.typeOf.number("latitude",n),t=i.toRadians(t),n=i.toRadians(n),o.fromRadians(t,n,r,a,u)};var l=new o,_=new o,O=new o(40680631590769,40680631590769,40408299984661.445),T=new o(40680631590769,40680631590769,40680631590769);return o.fromRadians=function(r,a,u,s,c){e.typeOf.number("longitude",r),e.typeOf.number("latitude",a),u=t(u,0);var E=n(s)?s.radiiSquared:O;i.Radious>6356753&&(E=n(s)?s.radiiSquared:T);var f=Math.cos(a);l.x=f*Math.cos(r),l.y=f*Math.sin(r),l.z=Math.sin(a),l=o.normalize(l,l),o.multiplyComponents(E,l,_);var R=Math.sqrt(o.dot(l,_));return _=o.divideByScalar(_,R,_),l=o.multiplyByScalar(l,u,l),n(c)||(c=new o),o.add(_,l,c)},o.fromDegreesArray=function(t,a,i){if(e.defined("coordinates",t),t.length<2||t.length%2!==0)throw new r("the number of coordinates must be a multiple of 2 and at least 2");var u=t.length;n(i)?i.length=u/2:i=new Array(u/2);for(var s=0;u>s;s+=2){var c=t[s],E=t[s+1],f=s/2;i[f]=o.fromDegrees(c,E,0,a,i[f])}return i},o.fromRadiansArray=function(t,a,i){if(e.defined("coordinates",t),t.length<2||t.length%2!==0)throw new r("the number of coordinates must be a multiple of 2 and at least 2");var u=t.length;n(i)?i.length=u/2:i=new Array(u/2);for(var s=0;u>s;s+=2){var c=t[s],E=t[s+1],f=s/2;i[f]=o.fromRadians(c,E,0,a,i[f])}return i},o.fromDegreesArrayHeights=function(t,a,i){if(e.defined("coordinates",t),t.length<3||t.length%3!==0)throw new r("the number of coordinates must be a multiple of 3 and at least 3");var u=t.length;n(i)?i.length=u/3:i=new Array(u/3);for(var s=0;u>s;s+=3){var c=t[s],E=t[s+1],f=t[s+2],l=s/3;i[l]=o.fromDegrees(c,E,f,a,i[l])}return i},o.fromRadiansArrayHeights=function(t,a,i){if(e.defined("coordinates",t),t.length<3||t.length%3!==0)throw new r("the number of coordinates must be a multiple of 3 and at least 3");var u=t.length;n(i)?i.length=u/3:i=new Array(u/3);for(var s=0;u>s;s+=3){var c=t[s],E=t[s+1],f=t[s+2],l=s/3;i[l]=o.fromRadians(c,E,f,a,i[l])}return i},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(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,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(a,u,s,c,E){if(!t(a))throw new n("cartesian is required.");if(!t(u))throw new n("oneOverRadii is required.");if(!t(s))throw new n("oneOverRadiiSquared is required.");if(!t(c))throw new n("centerToleranceSquared is required.");var f=a.x,l=a.y,_=a.z,O=u.x,T=u.y,R=u.z,p=f*f*O*O,y=l*l*T*T,h=_*_*R*R,d=p+y+h,m=Math.sqrt(1/d),A=e.multiplyByScalar(a,m,i);if(c>d)return isFinite(m)?e.clone(A,E):void 0;var N=s.x,I=s.y,S=s.z,M=o;M.x=A.x*N*2,M.y=A.y*I*2,M.z=A.z*S*2;var b,w,g,C,L,x,U,P,v,F,D,B=(1-m)*e.magnitude(a)/(.5*e.magnitude(M)),j=0;do{B-=j,g=1/(1+B*N),C=1/(1+B*I),L=1/(1+B*S),x=g*g,U=C*C,P=L*L,v=x*g,F=U*C,D=P*L,b=p*x+y*U+h*P-1,w=p*v*N+y*F*I+h*D*S;var z=-2*w;j=b/z}while(Math.abs(b)>r.EPSILON12);return t(E)?(E.x=f*g,E.y=l*C,E.z=_*L,E):new e(f*g,l*C,_*L)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,t,r){this.longitude=n(e,0),this.latitude=n(t,0),this.height=n(r,0)}u.fromRadians=function(e,a,i,o){return t.typeOf.number("longitude",e),t.typeOf.number("latitude",a),i=n(i,0),r(o)?(o.longitude=e,o.latitude=a,o.height=i,o):new u(e,a,i)},u.fromDegrees=function(e,n,r,a){return t.typeOf.number("longitude",e),t.typeOf.number("latitude",n),e=i.toRadians(e),n=i.toRadians(n),u.fromRadians(e,n,r,a)};var s=new e,c=new e,E=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),l=new e(1/6378137,1/6378137,1/6378137),_=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),O=new e(1/40680631590769,1/40680631590769,1/40680631590769),T=i.EPSILON1;return u.fromCartesian=function(t,n,a){var R=r(n)?n.oneOverRadii:f,p=r(n)?n.oneOverRadiiSquared:_,y=r(n)?n._centerToleranceSquared:T;i.Radious>6356753&&(R=r(n)?n.oneOverRadii:l,p=r(n)?n.oneOverRadiiSquared:O);var h=o(t,R,p,y,c);if(r(h)){var d=e.multiplyComponents(h,p,s);d=e.normalize(d,d);var m=e.subtract(t,h,E),A=Math.atan2(d.y,d.x),N=Math.asin(d.z),I=i.sign(e.dot(m,t))*e.magnitude(m);return r(a)?(a.longitude=A,a.latitude=N,a.height=I,a):new u(A,N,I)}},u.clone=function(e,t){return r(e)?r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height):void 0},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,n,a){return t.typeOf.number("epsilon",a),e===n||r(e)&&r(n)&&Math.abs(e.longitude-n.longitude)<=a&&Math.abs(e.latitude-n.latitude)<=a&&Math.abs(e.height-n.height)<=a},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u.sphericalDistance=function(e,t,n,a){if(!r(e)||!r(n))throw new DeveloperError("longitude is required.");if(!r(t)||!r(a))throw new DeveloperError("latitude is required.");if(e===n&&t===a)return 0;var o=i.toRadians(t),u=i.toRadians(a),s=i.toRadians(e),c=i.toRadians(n),E=s*s+o*o,f=c*c+u*u,l=(s-c)*(s-c)+(o-u)*(o-u),_=(E+f-l)/(2*Math.sqrt(E)*Math.sqrt(f));return _=i.clamp(_,-1,1),Math.acos(_)*i.Radious},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function E(t,a,i,o){a=r(a,0),i=r(i,0),o=r(o,0),s.equalsEpsilon(o,6378137,s.EPSILON10)&&(s.Radious=o),n.typeOf.number.greaterThanOrEquals("x",a,0),n.typeOf.number.greaterThanOrEquals("y",i,0),n.typeOf.number.greaterThanOrEquals("z",o,0),t._radii=new e(a,i,o),t._radiiSquared=new e(a*a,i*i,o*o),t._radiiToTheFourth=new e(a*a*a*a,i*i*i*i,o*o*o*o),t._oneOverRadii=new e(0===a?0:1/a,0===i?0:1/i,0===o?0:1/o),t._oneOverRadiiSquared=new e(0===a?0:1/(a*a),0===i?0:1/(i*i),0===o?0:1/(o*o)),t._minimumRadius=Math.min(a,i,o),t._maximumRadius=Math.max(a,i,o),t._centerToleranceSquared=s.EPSILON1,0!==t._radiiSquared.z&&(t._squaredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function f(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,E(this,e,t,n)}i(f.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}}}),f.clone=function(t,n){if(a(t)){var r=t._radii;return a(n)?(e.clone(r,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new f(r.x,r.y,r.z)}},f.fromCartesian3=function(e,t){return a(t)||(t=new f),a(e)?(E(t,e.x,e.y,e.z),t):t},f.WGS84=u(new f(6378137,6378137,s.Radious)),f.UNIT_SPHERE=u(new f(1,1,1)),f.MOON=u(new f(s.LUNAR_RADIUS,s.LUNAR_RADIUS,s.LUNAR_RADIUS)),f.prototype.clone=function(e){return f.clone(this,e)},f.packedLength=e.packedLength,f.pack=function(t,a,i){return n.typeOf.object("value",t),n.defined("array",a),i=r(i,0),e.pack(t._radii,a,i),a},f.unpack=function(t,a,i){n.defined("array",t),a=r(a,0);var o=e.unpack(t,a);return f.fromCartesian3(o,i)},f.prototype.geocentricSurfaceNormal=e.normalize,f.prototype.geodeticSurfaceNormalCartographic=function(t,r){n.typeOf.object("cartographic",t);var i=t.longitude,o=t.latitude,u=Math.cos(o),s=u*Math.cos(i),c=u*Math.sin(i),E=Math.sin(o);return a(r)||(r=new e),r.x=s,r.y=c,r.z=E,e.normalize(r,r)},f.prototype.geodeticSurfaceNormal=function(t,n){return a(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var l=new e,_=new e;f.prototype.cartographicToCartesian=function(t,n){var r=l,i=_;this.geodeticSurfaceNormalCartographic(t,r),e.multiplyComponents(this._radiiSquared,r,i);var o=Math.sqrt(e.dot(r,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(r,t.height,r),a(n)||(n=new e),e.add(i,r,n)},f.prototype.cartographicArrayToCartesianArray=function(e,t){n.defined("cartographics",e);var r=e.length;a(t)?t.length=r:t=new Array(r);for(var i=0;r>i;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var O=new e,T=new e,R=new e;return f.prototype.cartesianToCartographic=function(n,r){var i=this.scaleToGeodeticSurface(n,T);if(a(i)){var o=this.geodeticSurfaceNormal(i,O),u=e.subtract(n,i,R),c=Math.atan2(o.y,o.x),E=Math.asin(o.z),f=s.sign(e.dot(u,n))*e.magnitude(u);return a(r)?(r.longitude=c,r.latitude=E,r.height=f,r):new t(c,E,f)}},f.prototype.cartesianArrayToCartographicArray=function(e,t){n.defined("cartesians",e);var r=e.length;a(t)?t.length=r:t=new Array(r);for(var i=0;r>i;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},f.prototype.scaleToGeodeticSurface=function(e,t){return c(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},f.prototype.scaleToGeocentricSurface=function(t,r){n.typeOf.object("cartesian",t),a(r)||(r=new e);var i=t.x,o=t.y,u=t.z,s=this._oneOverRadiiSquared,c=1/Math.sqrt(i*i*s.x+o*o*s.y+u*u*s.z);return e.multiplyByScalar(t,c,r)},f.prototype.transformPositionToScaledSpace=function(t,n){return a(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},f.prototype.transformPositionFromScaledSpace=function(t,n){return a(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},f.prototype.equals=function(t){return this===t||a(t)&&e.equals(this._radii,t._radii)},f.prototype.toString=function(){return this._radii.toString()},f.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,u){if(n.typeOf.object("position",t),!s.equalsEpsilon(this._radii.x,this._radii.y,s.EPSILON15))throw new o("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");n.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),i=r(i,0);var c=this._squaredXOverSquaredZ;return a(u)||(u=new e),u.x=0,u.y=0,u.z=t.z*(1-c),Math.abs(u.z)>=this._radii.z-i?void 0:u},f}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){if(!r(e))throw new i("cartesian is required");var a=this._oneOverSemimajorAxis,o=e.x*a,u=e.y*a,s=e.z;return r(n)?(n.longitude=o,n.latitude=u,n.height=s,n):new t(o,u,s)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;9>n;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function E(e){for(var t=0,n=0;3>n;++n){var r=e[s.getElementIndex(T[n],O[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;3>i;++i){var o=Math.abs(e[s.getElementIndex(T[i],O[i])]);o>r&&(a=i,r=o)}var c=1,E=0,f=O[a],l=T[a];if(Math.abs(e[s.getElementIndex(l,f)])>n){var _,R=e[s.getElementIndex(l,l)],p=e[s.getElementIndex(f,f)],y=e[s.getElementIndex(l,f)],h=(R-p)/2/y;_=0>h?-1/(-h+Math.sqrt(1+h*h)):1/(h+Math.sqrt(1+h*h)),c=1/Math.sqrt(1+_*_),E=_*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(l,l)]=c,t[s.getElementIndex(l,f)]=E,t[s.getElementIndex(f,l)]=-E,t}s.packedLength=9,s.pack=function(e,r,a){return t.typeOf.object("value",e),t.defined("array",r),a=n(a,0),r[a++]=e[0],r[a++]=e[1],r[a++]=e[2],r[a++]=e[3],r[a++]=e[4],r[a++]=e[5],r[a++]=e[6],r[a++]=e[7],r[a++]=e[8],r},s.unpack=function(e,a,i){return t.defined("array",e),a=n(a,0),r(i)||(i=new s),i[0]=e[a++],i[1]=e[a++],i[2]=e[a++],i[3]=e[a++],i[4]=e[a++],i[5]=e[a++],i[6]=e[a++],i[7]=e[a++],i[8]=e[a++],i},s.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):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},s.fromArray=function(e,a,i){return t.defined("array",e),a=n(a,0),r(i)||(i=new s),i[0]=e[a],i[1]=e[a+1],i[2]=e[a+2],i[3]=e[a+3],i[4]=e[a+4],i[5]=e[a+5],i[6]=e[a+6],i[7]=e[a+7],i[8]=e[a+8],i},s.fromColumnMajorArray=function(e,n){return t.defined("values",e),s.clone(e,n)},s.fromRowMajorArray=function(e,n){return t.defined("values",e),r(n)?(n[0]=e[0],n[1]=e[3],n[2]=e[6],n[3]=e[1],n[4]=e[4],n[5]=e[7],n[6]=e[2],n[7]=e[5],n[8]=e[8],n):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,n){t.typeOf.object("quaternion",e);var a=e.x*e.x,i=e.x*e.y,o=e.x*e.z,u=e.x*e.w,c=e.y*e.y,E=e.y*e.z,f=e.y*e.w,l=e.z*e.z,_=e.z*e.w,O=e.w*e.w,T=a-c-l+O,R=2*(i-_),p=2*(o+f),y=2*(i+_),h=-a+c-l+O,d=2*(E-u),m=2*(o-f),A=2*(E+u),N=-a-c+l+O;return r(n)?(n[0]=T,n[1]=y,n[2]=m,n[3]=R,n[4]=h,n[5]=A,n[6]=p,n[7]=d,n[8]=N,n):new s(T,R,p,y,h,d,m,A,N)},s.fromHeadingPitchRoll=function(e,n){t.typeOf.object("headingPitchRoll",e);var a=Math.cos(-e.pitch),i=Math.cos(-e.heading),o=Math.cos(e.roll),u=Math.sin(-e.pitch),c=Math.sin(-e.heading),E=Math.sin(e.roll),f=a*i,l=-o*c+E*u*i,_=E*c+o*u*i,O=a*c,T=o*i+E*u*c,R=-E*i+o*u*c,p=-u,y=E*a,h=o*a;return r(n)?(n[0]=f,n[1]=O,n[2]=p,n[3]=l,n[4]=T,n[5]=y,n[6]=_,n[7]=R,n[8]=h,n):new s(f,l,_,O,T,R,p,y,h)},s.fromScale=function(e,n){return t.typeOf.object("scale",e),r(n)?(n[0]=e.x,n[1]=0,n[2]=0,n[3]=0,n[4]=e.y,n[5]=0,n[6]=0,n[7]=0,n[8]=e.z,n):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,n){return t.typeOf.number("scale",e),r(n)?(n[0]=e,n[1]=0,n[2]=0,n[3]=0,n[4]=e,n[5]=0,n[6]=0,n[7]=0,n[8]=e,n):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,n){return t.typeOf.object("vector",e),r(n)?(n[0]=0,n[1]=e.z,n[2]=-e.y,n[3]=-e.z,n[4]=0,n[5]=e.x,n[6]=e.y,n[7]=-e.x,n[8]=0,n):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,n){t.typeOf.number("angle",e);var a=Math.cos(e),i=Math.sin(e);return r(n)?(n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=a,n[5]=i,n[6]=0,n[7]=-i,n[8]=a,n):new s(1,0,0,0,a,-i,0,i,a)},s.fromRotationY=function(e,n){t.typeOf.number("angle",e);var a=Math.cos(e),i=Math.sin(e);return r(n)?(n[0]=a,n[1]=0,n[2]=-i,n[3]=0,n[4]=1,n[5]=0,n[6]=i,n[7]=0,n[8]=a,n):new s(a,0,i,0,1,0,-i,0,a)},s.fromRotationZ=function(e,n){t.typeOf.number("angle",e);var a=Math.cos(e),i=Math.sin(e);return r(n)?(n[0]=a,n[1]=i,n[2]=0,n[3]=-i,n[4]=a,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n):new s(a,-i,0,i,a,0,0,0,1)},s.toArray=function(e,n){return t.typeOf.object("matrix",e),r(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,n){return t.typeOf.number.greaterThanOrEquals("row",n,0),t.typeOf.number.lessThanOrEquals("row",n,2),t.typeOf.number.greaterThanOrEquals("column",e,0),t.typeOf.number.lessThanOrEquals("column",e,2),3*e+n},s.getColumn=function(e,n,r){t.typeOf.object("matrix",e),t.typeOf.number.greaterThanOrEquals("index",n,0),t.typeOf.number.lessThanOrEquals("index",n,2),t.typeOf.object("result",r);var a=3*n,i=e[a],o=e[a+1],u=e[a+2];return r.x=i,r.y=o,r.z=u,r},s.setColumn=function(e,n,r,a){t.typeOf.object("matrix",e),t.typeOf.number.greaterThanOrEquals("index",n,0),t.typeOf.number.lessThanOrEquals("index",n,2),t.typeOf.object("cartesian",r),t.typeOf.object("result",a),a=s.clone(e,a);var i=3*n;return a[i]=r.x,a[i+1]=r.y,a[i+2]=r.z,a},s.getRow=function(e,n,r){t.typeOf.object("matrix",e),t.typeOf.number.greaterThanOrEquals("index",n,0),t.typeOf.number.lessThanOrEquals("index",n,2),t.typeOf.object("result",r);var a=e[n],i=e[n+3],o=e[n+6];return r.x=a,r.y=i,r.z=o,r},s.setRow=function(e,n,r,a){return t.typeOf.object("matrix",e),t.typeOf.number.greaterThanOrEquals("index",n,0),t.typeOf.number.lessThanOrEquals("index",n,2),t.typeOf.object("cartesian",r),t.typeOf.object("result",a),a=s.clone(e,a),a[n]=r.x,a[n+3]=r.y,a[n+6]=r.z,a};var l=new e;s.getScale=function(n,r){return t.typeOf.object("matrix",n),t.typeOf.object("result",r),r.x=e.magnitude(e.fromElements(n[0],n[1],n[2],l)),r.y=e.magnitude(e.fromElements(n[3],n[4],n[5],l)),r.z=e.magnitude(e.fromElements(n[6],n[7],n[8],l)),r};var _=new e;s.getMaximumScale=function(t){return s.getScale(t,_),e.maximumComponent(_)},s.multiply=function(e,n,r){t.typeOf.object("left",e),t.typeOf.object("right",n),t.typeOf.object("result",r);var a=e[0]*n[0]+e[3]*n[1]+e[6]*n[2],i=e[1]*n[0]+e[4]*n[1]+e[7]*n[2],o=e[2]*n[0]+e[5]*n[1]+e[8]*n[2],u=e[0]*n[3]+e[3]*n[4]+e[6]*n[5],s=e[1]*n[3]+e[4]*n[4]+e[7]*n[5],c=e[2]*n[3]+e[5]*n[4]+e[8]*n[5],E=e[0]*n[6]+e[3]*n[7]+e[6]*n[8],f=e[1]*n[6]+e[4]*n[7]+e[7]*n[8],l=e[2]*n[6]+e[5]*n[7]+e[8]*n[8];return r[0]=a,r[1]=i,r[2]=o,r[3]=u,r[4]=s,r[5]=c,r[6]=E,r[7]=f,r[8]=l,r},s.add=function(e,n,r){return t.typeOf.object("left",e),t.typeOf.object("right",n),t.typeOf.object("result",r),r[0]=e[0]+n[0],r[1]=e[1]+n[1],r[2]=e[2]+n[2],r[3]=e[3]+n[3],r[4]=e[4]+n[4],r[5]=e[5]+n[5],r[6]=e[6]+n[6],r[7]=e[7]+n[7],r[8]=e[8]+n[8],r},s.subtract=function(e,n,r){return t.typeOf.object("left",e),t.typeOf.object("right",n),t.typeOf.object("result",r),r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],r[3]=e[3]-n[3],r[4]=e[4]-n[4],r[5]=e[5]-n[5],r[6]=e[6]-n[6],r[7]=e[7]-n[7],r[8]=e[8]-n[8],r},s.multiplyByVector=function(e,n,r){t.typeOf.object("matrix",e),t.typeOf.object("cartesian",n),
t.typeOf.object("result",r);var a=n.x,i=n.y,o=n.z,u=e[0]*a+e[3]*i+e[6]*o,s=e[1]*a+e[4]*i+e[7]*o,c=e[2]*a+e[5]*i+e[8]*o;return r.x=u,r.y=s,r.z=c,r},s.multiplyByScalar=function(e,n,r){return t.typeOf.object("matrix",e),t.typeOf.number("scalar",n),t.typeOf.object("result",r),r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r[4]=e[4]*n,r[5]=e[5]*n,r[6]=e[6]*n,r[7]=e[7]*n,r[8]=e[8]*n,r},s.multiplyByScale=function(e,n,r){return t.typeOf.object("matrix",e),t.typeOf.object("scale",n),t.typeOf.object("result",r),r[0]=e[0]*n.x,r[1]=e[1]*n.x,r[2]=e[2]*n.x,r[3]=e[3]*n.y,r[4]=e[4]*n.y,r[5]=e[5]*n.y,r[6]=e[6]*n.z,r[7]=e[7]*n.z,r[8]=e[8]*n.z,r},s.negate=function(e,n){return t.typeOf.object("matrix",e),t.typeOf.object("result",n),n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=-e[3],n[4]=-e[4],n[5]=-e[5],n[6]=-e[6],n[7]=-e[7],n[8]=-e[8],n},s.transpose=function(e,n){t.typeOf.object("matrix",e),t.typeOf.object("result",n);var r=e[0],a=e[3],i=e[6],o=e[1],u=e[4],s=e[7],c=e[2],E=e[5],f=e[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=E,n[8]=f,n};var O=[1,0,0],T=[2,2,1],R=new s,p=new s;return s.computeEigenDecomposition=function(e,n){t.typeOf.object("matrix",e);var a=u.EPSILON20,i=10,o=0,l=0;r(n)||(n={});for(var _=n.unitary=s.clone(s.IDENTITY,n.unitary),O=n.diagonal=s.clone(e,n.diagonal),T=a*c(O);i>l&&E(O)>T;)f(O,R),s.transpose(R,p),s.multiply(O,R,O),s.multiply(p,O,O),s.multiply(_,R,_),++o>2&&(++l,o=0);return n},s.abs=function(e,n){return t.typeOf.object("matrix",e),t.typeOf.object("result",n),n[0]=Math.abs(e[0]),n[1]=Math.abs(e[1]),n[2]=Math.abs(e[2]),n[3]=Math.abs(e[3]),n[4]=Math.abs(e[4]),n[5]=Math.abs(e[5]),n[6]=Math.abs(e[6]),n[7]=Math.abs(e[7]),n[8]=Math.abs(e[8]),n},s.determinant=function(e){t.typeOf.object("matrix",e);var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],E=e[8];return n*(o*E-c*u)+i*(c*a-r*E)+s*(r*u-o*a)},s.inverse=function(e,n){t.typeOf.object("matrix",e),t.typeOf.object("result",n);var r=e[0],a=e[1],o=e[2],c=e[3],E=e[4],f=e[5],l=e[6],_=e[7],O=e[8],T=s.determinant(e);if(Math.abs(T)<=u.EPSILON15)throw new i("matrix is not invertible");n[0]=E*O-_*f,n[1]=_*o-a*O,n[2]=a*f-E*o,n[3]=l*f-c*O,n[4]=r*O-l*o,n[5]=c*o-r*f,n[6]=c*_-l*E,n[7]=l*a-r*_,n[8]=r*E-c*a;var R=1/T;return s.multiplyByScalar(n,R,n)},s.equals=function(e,t){return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,n,a){return t.typeOf.number("epsilon",a),e===n||r(e)&&r(n)&&Math.abs(e[0]-n[0])<=a&&Math.abs(e[1]-n[1])<=a&&Math.abs(e[2]-n[2])<=a&&Math.abs(e[3]-n[3])<=a&&Math.abs(e[4]-n[4])<=a&&Math.abs(e[5]-n[5])<=a&&Math.abs(e[6]-n[6])<=a&&Math.abs(e[7]-n[7])<=a&&Math.abs(e[8]-n[8])<=a},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(t,r){return e.typeOf.object("color",t),n(r)?(r.x=t.red,r.y=t.green,r.z=t.blue,r.w=t.alpha,r):new o(t.red,t.green,t.blue,t.alpha)},o.clone=function(e,t){return n(e)?n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w):void 0},o.packedLength=4,o.pack=function(n,r,a){return e.typeOf.object("value",n),e.defined("array",r),a=t(a,0),r[a++]=n.x,r[a++]=n.y,r[a++]=n.z,r[a]=n.w,r},o.unpack=function(r,a,i){return e.defined("array",r),a=t(a,0),n(i)||(i=new o),i.x=r[a++],i.y=r[a++],i.z=r[a++],i.w=r[a],i},o.packArray=function(t,r){e.defined("array",t);var a=t.length;n(r)?r.length=4*a:r=new Array(4*a);for(var i=0;a>i;++i)o.pack(t[i],r,4*i);return r},o.unpackArray=function(t,r){e.defined("array",t);var a=t.length;n(r)?r.length=a/4:r=new Array(a/4);for(var i=0;a>i;i+=4){var u=i/4;r[u]=o.unpack(t,i,r[u])}return r},o.fromArray=o.unpack,o.maximumComponent=function(t){return e.typeOf.object("cartesian",t),Math.max(t.x,t.y,t.z,t.w)},o.minimumComponent=function(t){return e.typeOf.object("cartesian",t),Math.min(t.x,t.y,t.z,t.w)},o.minimumByComponent=function(t,n,r){return e.typeOf.object("first",t),e.typeOf.object("second",n),e.typeOf.object("result",r),r.x=Math.min(t.x,n.x),r.y=Math.min(t.y,n.y),r.z=Math.min(t.z,n.z),r.w=Math.min(t.w,n.w),r},o.maximumByComponent=function(t,n,r){return e.typeOf.object("first",t),e.typeOf.object("second",n),e.typeOf.object("result",r),r.x=Math.max(t.x,n.x),r.y=Math.max(t.y,n.y),r.z=Math.max(t.z,n.z),r.w=Math.max(t.w,n.w),r},o.magnitudeSquared=function(t){return e.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(t,n){return e.typeOf.object("left",t),e.typeOf.object("right",n),o.subtract(t,n,u),o.magnitude(u)},o.distanceSquared=function(t,n){return e.typeOf.object("left",t),e.typeOf.object("right",n),o.subtract(t,n,u),o.magnitudeSquared(u)},o.normalize=function(t,n){e.typeOf.object("cartesian",t),e.typeOf.object("result",n);var a=o.magnitude(t);if(n.x=t.x/a,n.y=t.y/a,n.z=t.z/a,n.w=t.w/a,isNaN(n.x)||isNaN(n.y)||isNaN(n.z)||isNaN(n.w))throw new r("normalized result is not a number");return n},o.dot=function(t,n){return e.typeOf.object("left",t),e.typeOf.object("right",n),t.x*n.x+t.y*n.y+t.z*n.z+t.w*n.w},o.multiplyComponents=function(t,n,r){return e.typeOf.object("left",t),e.typeOf.object("right",n),e.typeOf.object("result",r),r.x=t.x*n.x,r.y=t.y*n.y,r.z=t.z*n.z,r.w=t.w*n.w,r},o.divideComponents=function(t,n,r){return e.typeOf.object("left",t),e.typeOf.object("right",n),e.typeOf.object("result",r),r.x=t.x/n.x,r.y=t.y/n.y,r.z=t.z/n.z,r.w=t.w/n.w,r},o.add=function(t,n,r){return e.typeOf.object("left",t),e.typeOf.object("right",n),e.typeOf.object("result",r),r.x=t.x+n.x,r.y=t.y+n.y,r.z=t.z+n.z,r.w=t.w+n.w,r},o.subtract=function(t,n,r){return e.typeOf.object("left",t),e.typeOf.object("right",n),e.typeOf.object("result",r),r.x=t.x-n.x,r.y=t.y-n.y,r.z=t.z-n.z,r.w=t.w-n.w,r},o.multiplyByScalar=function(t,n,r){return e.typeOf.object("cartesian",t),e.typeOf.number("scalar",n),e.typeOf.object("result",r),r.x=t.x*n,r.y=t.y*n,r.z=t.z*n,r.w=t.w*n,r},o.divideByScalar=function(t,n,r){return e.typeOf.object("cartesian",t),e.typeOf.number("scalar",n),e.typeOf.object("result",r),r.x=t.x/n,r.y=t.y/n,r.z=t.z/n,r.w=t.w/n,r},o.negate=function(t,n){return e.typeOf.object("cartesian",t),e.typeOf.object("result",n),n.x=-t.x,n.y=-t.y,n.z=-t.z,n.w=-t.w,n},o.abs=function(t,n){return e.typeOf.object("cartesian",t),e.typeOf.object("result",n),n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n.w=Math.abs(t.w),n};var s=new o;o.lerp=function(t,n,r,a){return e.typeOf.object("start",t),e.typeOf.object("end",n),e.typeOf.number("t",r),e.typeOf.object("result",a),o.multiplyByScalar(n,r,s),a=o.multiplyByScalar(t,1-r,a),o.add(s,a,a)};var c=new o;return o.mostOrthogonalAxis=function(t,n){e.typeOf.object("cartesian",t),e.typeOf.object("result",n);var r=o.normalize(t,c);return o.abs(r,r),n=r.x<=r.y?r.x<=r.z?r.x<=r.w?o.clone(o.UNIT_X,n):o.clone(o.UNIT_W,n):r.z<=r.w?o.clone(o.UNIT_Z,n):o.clone(o.UNIT_W,n):r.y<=r.z?r.y<=r.w?o.clone(o.UNIT_Y,n):o.clone(o.UNIT_W,n):r.z<=r.w?o.clone(o.UNIT_Z,n):o.clone(o.UNIT_W,n)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(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,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(n){t=n.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function E(e,t,n,a,i,o,u,s,c,E,f,l,_,O,T,R){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(_,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(E,0),this[7]=r(O,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(T,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(l,0),this[15]=r(R,0)}E.packedLength=16,E.pack=function(e,t,a){return n.typeOf.object("value",e),n.defined("array",t),a=r(a,0),t[a++]=e[0],t[a++]=e[1],t[a++]=e[2],t[a++]=e[3],t[a++]=e[4],t[a++]=e[5],t[a++]=e[6],t[a++]=e[7],t[a++]=e[8],t[a++]=e[9],t[a++]=e[10],t[a++]=e[11],t[a++]=e[12],t[a++]=e[13],t[a++]=e[14],t[a]=e[15],t},E.unpack=function(e,t,i){return n.defined("array",e),t=r(t,0),a(i)||(i=new E),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i[9]=e[t++],i[10]=e[t++],i[11]=e[t++],i[12]=e[t++],i[13]=e[t++],i[14]=e[t++],i[15]=e[t],i},E.clone=function(e,t){return a(e)?a(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 E(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},E.fromArray=E.unpack,E.fromColumnMajorArray=function(e,t){return n.defined("values",e),E.clone(e,t)},E.fromRowMajorArray=function(e,t){return n.defined("values",e),a(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 E(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])},E.fromRotationTranslation=function(t,i,o){return n.typeOf.object("rotation",t),i=r(i,e.ZERO),a(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]=i.x,o[13]=i.y,o[14]=i.z,o[15]=1,o):new E(t[0],t[3],t[6],i.x,t[1],t[4],t[7],i.y,t[2],t[5],t[8],i.z,0,0,0,1)},E.fromTranslationQuaternionRotationScale=function(e,t,r,i){n.typeOf.object("translation",e),n.typeOf.object("rotation",t),n.typeOf.object("scale",r),a(i)||(i=new E);var o=r.x,u=r.y,s=r.z,c=t.x*t.x,f=t.x*t.y,l=t.x*t.z,_=t.x*t.w,O=t.y*t.y,T=t.y*t.z,R=t.y*t.w,p=t.z*t.z,y=t.z*t.w,h=t.w*t.w,d=c-O-p+h,m=2*(f-y),A=2*(l+R),N=2*(f+y),I=-c+O-p+h,S=2*(T-_),M=2*(l-R),b=2*(T+_),w=-c-O+p+h;return i[0]=d*o,i[1]=N*o,i[2]=M*o,i[3]=0,i[4]=m*u,i[5]=I*u,i[6]=b*u,i[7]=0,i[8]=A*s,i[9]=S*s,i[10]=w*s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},E.fromTranslationRotationScale=function(e,t){return n.typeOf.object("translationRotationScale",e),E.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},E.fromTranslation=function(e,t){return n.typeOf.object("translation",e),E.fromRotationTranslation(s.IDENTITY,e,t)},E.fromScale=function(e,t){return n.typeOf.object("scale",e),a(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 E(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},E.fromUniformScale=function(e,t){return n.typeOf.number("scale",e),a(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 E(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,l=new e,_=new e;E.fromCamera=function(t,r){n.typeOf.object("camera",t);var i=t.position,o=t.direction,u=t.up;n.typeOf.object("camera.position",i),n.typeOf.object("camera.direction",o),n.typeOf.object("camera.up",u),e.normalize(o,f),e.normalize(e.cross(f,u,l),l),e.normalize(e.cross(l,f,_),_);var s=l.x,c=l.y,O=l.z,T=f.x,R=f.y,p=f.z,y=_.x,h=_.y,d=_.z,m=i.x,A=i.y,N=i.z,I=s*-m+c*-A+O*-N,S=y*-m+h*-A+d*-N,M=T*m+R*A+p*N;return a(r)?(r[0]=s,r[1]=y,r[2]=-T,r[3]=0,r[4]=c,r[5]=h,r[6]=-R,r[7]=0,r[8]=O,r[9]=d,r[10]=-p,r[11]=0,r[12]=I,r[13]=S,r[14]=M,r[15]=1,r):new E(s,c,O,I,y,h,d,S,-T,-R,-p,M,0,0,0,1)},E.computePerspectiveFieldOfView=function(e,t,r,a,i){n.typeOf.number.greaterThan("fovY",e,0),n.typeOf.number.lessThan("fovY",e,Math.PI),n.typeOf.number.greaterThan("near",r,0),n.typeOf.number.greaterThan("far",a,0),n.typeOf.object("result",i);var o=Math.tan(.5*e),u=1/o,s=u/t,c=(a+r)/(r-a),E=2*a*r/(r-a);return i[0]=s,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=c,i[11]=-1,i[12]=0,i[13]=0,i[14]=E,i[15]=0,i},E.computeOrthographicOffCenter=function(e,t,r,a,i,o,u){n.typeOf.number("left",e),n.typeOf.number("right",t),n.typeOf.number("bottom",r),n.typeOf.number("top",a),n.typeOf.number("near",i),n.typeOf.number("far",o),n.typeOf.object("result",u);var s=1/(t-e),c=1/(a-r),E=1/(o-i),f=-(t+e)*s,l=-(a+r)*c,_=-(o+i)*E;return s*=2,c*=2,E*=-2,u[0]=s,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=c,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[10]=E,u[11]=0,u[12]=f,u[13]=l,u[14]=_,u[15]=1,u},E.computePerspectiveOffCenter=function(e,t,r,a,i,o,u){n.typeOf.number("left",e),n.typeOf.number("right",t),n.typeOf.number("bottom",r),n.typeOf.number("top",a),n.typeOf.number("near",i),n.typeOf.number("far",o),n.typeOf.object("result",u);var s=2*i/(t-e),c=2*i/(a-r),E=(t+e)/(t-e),f=(a+r)/(a-r),l=-(o+i)/(o-i),_=-1,O=-2*o*i/(o-i);return u[0]=s,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=c,u[6]=0,u[7]=0,u[8]=E,u[9]=f,u[10]=l,u[11]=_,u[12]=0,u[13]=0,u[14]=O,u[15]=0,u},E.computeInfinitePerspectiveOffCenter=function(e,t,r,a,i,o){n.typeOf.number("left",e),n.typeOf.number("right",t),n.typeOf.number("bottom",r),n.typeOf.number("top",a),n.typeOf.number("near",i),n.typeOf.object("result",o);var u=2*i/(t-e),s=2*i/(a-r),c=(t+e)/(t-e),E=(a+r)/(a-r),f=-1,l=-1,_=-2*i;return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=E,o[10]=f,o[11]=l,o[12]=0,o[13]=0,o[14]=_,o[15]=0,o},E.computeViewportTransformation=function(e,t,a,i){n.typeOf.object("result",i),e=r(e,r.EMPTY_OBJECT);var o=r(e.x,0),u=r(e.y,0),s=r(e.width,0),c=r(e.height,0);t=r(t,0),a=r(a,1);var E=.5*s,f=.5*c,l=.5*(a-t),_=E,O=f,T=l,R=o+E,p=u+f,y=t+l,h=1;return i[0]=_,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=O,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=T,i[11]=0,i[12]=R,i[13]=p,i[14]=y,i[15]=h,i},E.computeView=function(t,r,a,i,o){return n.typeOf.object("position",t),n.typeOf.object("direction",r),n.typeOf.object("up",a),n.typeOf.object("right",i),n.typeOf.object("result",o),o[0]=i.x,o[1]=a.x,o[2]=-r.x,o[3]=0,o[4]=i.y,o[5]=a.y,o[6]=-r.y,o[7]=0,o[8]=i.z,o[9]=a.z,o[10]=-r.z,o[11]=0,o[12]=-e.dot(i,t),o[13]=-e.dot(a,t),o[14]=e.dot(r,t),o[15]=1,o},E.toArray=function(e,t){return n.typeOf.object("matrix",e),a(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]]},E.getElementIndex=function(e,t){return n.typeOf.number.greaterThanOrEquals("row",t,0),n.typeOf.number.lessThanOrEquals("row",t,3),n.typeOf.number.greaterThanOrEquals("column",e,0),n.typeOf.number.lessThanOrEquals("column",e,3),4*e+t},E.getColumn=function(e,t,r){n.typeOf.object("matrix",e),n.typeOf.number.greaterThanOrEquals("index",t,0),n.typeOf.number.lessThanOrEquals("index",t,3),n.typeOf.object("result",r);var a=4*t,i=e[a],o=e[a+1],u=e[a+2],s=e[a+3];return r.x=i,r.y=o,r.z=u,r.w=s,r},E.setColumn=function(e,t,r,a){n.typeOf.object("matrix",e),n.typeOf.number.greaterThanOrEquals("index",t,0),n.typeOf.number.lessThanOrEquals("index",t,3),n.typeOf.object("cartesian",r),n.typeOf.object("result",a),a=E.clone(e,a);var i=4*t;return a[i]=r.x,a[i+1]=r.y,a[i+2]=r.z,a[i+3]=r.w,a},E.setTranslation=function(e,t,r){return n.typeOf.object("matrix",e),n.typeOf.object("translation",t),n.typeOf.object("result",r),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r},E.getRow=function(e,t,r){n.typeOf.object("matrix",e),n.typeOf.number.greaterThanOrEquals("index",t,0),n.typeOf.number.lessThanOrEquals("index",t,3),n.typeOf.object("result",r);var a=e[t],i=e[t+4],o=e[t+8],u=e[t+12];return r.x=a,r.y=i,r.z=o,r.w=u,r},E.setRow=function(e,t,r,a){return n.typeOf.object("matrix",e),n.typeOf.number.greaterThanOrEquals("index",t,0),n.typeOf.number.lessThanOrEquals("index",t,3),n.typeOf.object("cartesian",r),n.typeOf.object("result",a),a=E.clone(e,a),a[t]=r.x,a[t+4]=r.y,a[t+8]=r.z,a[t+12]=r.w,a};var O=new e;E.getScale=function(t,r){return n.typeOf.object("matrix",t),n.typeOf.object("result",r),r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],O)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],O)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],O)),r};var T=new e;E.getMaximumScale=function(t){return E.getScale(t,T),e.maximumComponent(T)},E.multiply=function(e,t,r){n.typeOf.object("left",e),n.typeOf.object("right",t),n.typeOf.object("result",r);var a=e[0],i=e[1],o=e[2],u=e[3],s=e[4],c=e[5],E=e[6],f=e[7],l=e[8],_=e[9],O=e[10],T=e[11],R=e[12],p=e[13],y=e[14],h=e[15],d=t[0],m=t[1],A=t[2],N=t[3],I=t[4],S=t[5],M=t[6],b=t[7],w=t[8],g=t[9],C=t[10],L=t[11],x=t[12],U=t[13],P=t[14],v=t[15],F=a*d+s*m+l*A+R*N,D=i*d+c*m+_*A+p*N,B=o*d+E*m+O*A+y*N,j=u*d+f*m+T*A+h*N,z=a*I+s*S+l*M+R*b,G=i*I+c*S+_*M+p*b,q=o*I+E*S+O*M+y*b,X=u*I+f*S+T*M+h*b,V=a*w+s*g+l*C+R*L,W=i*w+c*g+_*C+p*L,H=o*w+E*g+O*C+y*L,Y=u*w+f*g+T*C+h*L,k=a*x+s*U+l*P+R*v,K=i*x+c*U+_*P+p*v,Z=o*x+E*U+O*P+y*v,Q=u*x+f*U+T*P+h*v;return r[0]=F,r[1]=D,r[2]=B,r[3]=j,r[4]=z,r[5]=G,r[6]=q,r[7]=X,r[8]=V,r[9]=W,r[10]=H,r[11]=Y,r[12]=k,r[13]=K,r[14]=Z,r[15]=Q,r},E.add=function(e,t,r){return n.typeOf.object("left",e),n.typeOf.object("right",t),n.typeOf.object("result",r),r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r[9]=e[9]+t[9],r[10]=e[10]+t[10],r[11]=e[11]+t[11],r[12]=e[12]+t[12],r[13]=e[13]+t[13],r[14]=e[14]+t[14],r[15]=e[15]+t[15],r},E.subtract=function(e,t,r){return n.typeOf.object("left",e),n.typeOf.object("right",t),n.typeOf.object("result",r),r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r[9]=e[9]-t[9],r[10]=e[10]-t[10],r[11]=e[11]-t[11],r[12]=e[12]-t[12],r[13]=e[13]-t[13],r[14]=e[14]-t[14],r[15]=e[15]-t[15],r},E.multiplyTransformation=function(e,t,r){n.typeOf.object("left",e),n.typeOf.object("right",t),n.typeOf.object("result",r);var a=e[0],i=e[1],o=e[2],u=e[4],s=e[5],c=e[6],E=e[8],f=e[9],l=e[10],_=e[12],O=e[13],T=e[14],R=t[0],p=t[1],y=t[2],h=t[4],d=t[5],m=t[6],A=t[8],N=t[9],I=t[10],S=t[12],M=t[13],b=t[14],w=a*R+u*p+E*y,g=i*R+s*p+f*y,C=o*R+c*p+l*y,L=a*h+u*d+E*m,x=i*h+s*d+f*m,U=o*h+c*d+l*m,P=a*A+u*N+E*I,v=i*A+s*N+f*I,F=o*A+c*N+l*I,D=a*S+u*M+E*b+_,B=i*S+s*M+f*b+O,j=o*S+c*M+l*b+T;return r[0]=w,r[1]=g,r[2]=C,r[3]=0,r[4]=L,r[5]=x,r[6]=U,r[7]=0,r[8]=P,r[9]=v,r[10]=F,r[11]=0,r[12]=D,r[13]=B,r[14]=j,r[15]=1,r},E.multiplyByMatrix3=function(e,t,r){n.typeOf.object("matrix",e),n.typeOf.object("rotation",t),n.typeOf.object("result",r);var a=e[0],i=e[1],o=e[2],u=e[4],s=e[5],c=e[6],E=e[8],f=e[9],l=e[10],_=t[0],O=t[1],T=t[2],R=t[3],p=t[4],y=t[5],h=t[6],d=t[7],m=t[8],A=a*_+u*O+E*T,N=i*_+s*O+f*T,I=o*_+c*O+l*T,S=a*R+u*p+E*y,M=i*R+s*p+f*y,b=o*R+c*p+l*y,w=a*h+u*d+E*m,g=i*h+s*d+f*m,C=o*h+c*d+l*m;return r[0]=A,r[1]=N,r[2]=I,r[3]=0,r[4]=S,r[5]=M,r[6]=b,r[7]=0,r[8]=w,r[9]=g,r[10]=C,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},E.multiplyByTranslation=function(e,t,r){n.typeOf.object("matrix",e),n.typeOf.object("translation",t),n.typeOf.object("result",r);var a=t.x,i=t.y,o=t.z,u=a*e[0]+i*e[4]+o*e[8]+e[12],s=a*e[1]+i*e[5]+o*e[9]+e[13],c=a*e[2]+i*e[6]+o*e[10]+e[14];return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=u,r[13]=s,r[14]=c,r[15]=e[15],r};var R=new e;E.multiplyByUniformScale=function(e,t,r){return n.typeOf.object("matrix",e),n.typeOf.number("scale",t),n.typeOf.object("result",r),R.x=t,R.y=t,R.z=t,E.multiplyByScale(e,R,r)},E.multiplyByScale=function(e,t,r){n.typeOf.object("matrix",e),n.typeOf.object("scale",t),n.typeOf.object("result",r);var a=t.x,i=t.y,o=t.z;return 1===a&&1===i&&1===o?E.clone(e,r):(r[0]=a*e[0],r[1]=a*e[1],r[2]=a*e[2],r[3]=0,r[4]=i*e[4],r[5]=i*e[5],r[6]=i*e[6],r[7]=0,r[8]=o*e[8],r[9]=o*e[9],r[10]=o*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},E.multiplyByVector=function(e,t,r){n.typeOf.object("matrix",e),n.typeOf.object("cartesian",t),n.typeOf.object("result",r);var a=t.x,i=t.y,o=t.z,u=t.w,s=e[0]*a+e[4]*i+e[8]*o+e[12]*u,c=e[1]*a+e[5]*i+e[9]*o+e[13]*u,E=e[2]*a+e[6]*i+e[10]*o+e[14]*u,f=e[3]*a+e[7]*i+e[11]*o+e[15]*u;return r.x=s,r.y=c,r.z=E,r.w=f,r},E.multiplyByPointAsVector=function(e,t,r){n.typeOf.object("matrix",e),n.typeOf.object("cartesian",t),n.typeOf.object("result",r);var a=t.x,i=t.y,o=t.z,u=e[0]*a+e[4]*i+e[8]*o,s=e[1]*a+e[5]*i+e[9]*o,c=e[2]*a+e[6]*i+e[10]*o;return r.x=u,r.y=s,r.z=c,r},E.multiplyByPoint=function(e,t,r){n.typeOf.object("matrix",e),n.typeOf.object("cartesian",t),n.typeOf.object("result",r);var a=t.x,i=t.y,o=t.z,u=e[0]*a+e[4]*i+e[8]*o+e[12],s=e[1]*a+e[5]*i+e[9]*o+e[13],c=e[2]*a+e[6]*i+e[10]*o+e[14];return r.x=u,r.y=s,r.z=c,r},E.multiplyByScalar=function(e,t,r){return n.typeOf.object("matrix",e),n.typeOf.number("scalar",t),n.typeOf.object("result",r),r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r},E.negate=function(e,t){return n.typeOf.object("matrix",e),n.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},E.transpose=function(e,t){n.typeOf.object("matrix",e),n.typeOf.object("result",t);var r=e[1],a=e[2],i=e[3],o=e[6],u=e[7],s=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=a,t[9]=o,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=u,t[14]=s,t[15]=e[15],t},E.abs=function(e,t){return n.typeOf.object("matrix",e),n.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},E.equals=function(e,t){return e===t||a(e)&&a(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]},E.equalsEpsilon=function(e,t,r){return n.typeOf.number("epsilon",r),e===t||a(e)&&a(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&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},E.getTranslation=function(e,t){return n.typeOf.object("matrix",e),n.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t},E.getRotation=function(e,t){return n.typeOf.object("matrix",e),n.typeOf.object("result",t),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var p=new s,y=new s,h=new t,d=new t(0,0,0,1);return E.inverse=function(e,r){if(n.typeOf.object("matrix",e),n.typeOf.object("result",r),s.equalsEpsilon(E.getRotation(e,p),y,u.EPSILON7)&&t.equals(E.getRow(e,3,h),d))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=1,r;var a=e[0],i=e[4],o=e[8],f=e[12],l=e[1],_=e[5],O=e[9],T=e[13],R=e[2],m=e[6],A=e[10],N=e[14],I=e[3],S=e[7],M=e[11],b=e[15],w=A*b,g=N*M,C=m*b,L=N*S,x=m*M,U=A*S,P=R*b,v=N*I,F=R*M,D=A*I,B=R*S,j=m*I,z=w*_+L*O+x*T-(g*_+C*O+U*T),G=g*l+P*O+D*T-(w*l+v*O+F*T),q=C*l+v*_+B*T-(L*l+P*_+j*T),X=U*l+F*_+j*O-(x*l+D*_+B*O),V=g*i+C*o+U*f-(w*i+L*o+x*f),W=w*a+v*o+F*f-(g*a+P*o+D*f),H=L*a+P*i+j*f-(C*a+v*i+B*f),Y=x*a+D*i+B*o-(U*a+F*i+j*o);w=o*T,g=f*O,C=i*T,L=f*_,x=i*O,U=o*_,P=a*T,v=f*l,F=a*O,D=o*l,B=a*_,j=i*l;var k=w*S+L*M+x*b-(g*S+C*M+U*b),K=g*I+P*M+D*b-(w*I+v*M+F*b),Z=C*I+v*S+B*b-(L*I+P*S+j*b),Q=U*I+F*S+j*M-(x*I+D*S+B*M),J=C*A+U*N+g*m-(x*N+w*m+L*A),$=F*N+w*R+v*A-(P*A+D*N+g*R),ee=P*m+j*N+L*R-(B*N+C*R+v*m),te=B*A+x*R+D*m-(F*m+j*A+U*R),ne=a*z+i*G+o*q+f*X;if(Math.abs(ne)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return ne=1/ne,r[0]=z*ne,r[1]=G*ne,r[2]=q*ne,r[3]=X*ne,r[4]=V*ne,r[5]=W*ne,r[6]=H*ne,r[7]=Y*ne,r[8]=k*ne,r[9]=K*ne,r[10]=Z*ne,r[11]=Q*ne,r[12]=J*ne,r[13]=$*ne,r[14]=ee*ne,r[15]=te*ne,r},E.inverseTransformation=function(e,t){n.typeOf.object("matrix",e),n.typeOf.object("result",t);var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],E=e[9],f=e[10],l=e[12],_=e[13],O=e[14],T=-r*l-a*_-i*O,R=-o*l-u*_-s*O,p=-c*l-E*_-f*O;return t[0]=r,t[1]=o,t[2]=c,t[3]=0,t[4]=a,t[5]=u,t[6]=E,t[7]=0,t[8]=i,t[9]=s,t[10]=f,t[11]=0,t[12]=T,t[13]=R,t[14]=p,t[15]=1,t},E.IDENTITY=o(new E(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),E.ZERO=o(new E(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN0ROW3=3,E.COLUMN1ROW0=4,E.COLUMN1ROW1=5,E.COLUMN1ROW2=6,E.COLUMN1ROW3=7,E.COLUMN2ROW0=8,E.COLUMN2ROW1=9,E.COLUMN2ROW2=10,E.COLUMN2ROW3=11,E.COLUMN3ROW0=12,E.COLUMN3ROW1=13,E.COLUMN3ROW2=14,E.COLUMN3ROW3=15,i(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},E.prototype.equalsEpsilon=function(e,t){return E.equalsEpsilon(this,e,t)},E.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]+")"},E}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,r,a){return t.typeOf.object("value",e),t.defined("array",r),a=n(a,0),r[a++]=e.west,r[a++]=e.south,r[a++]=e.east,r[a]=e.north,r},s.unpack=function(e,a,i){return t.defined("array",e),a=n(a,0),r(i)||(i=new s),i.west=e[a++],i.south=e[a++],i.east=e[a++],i.north=e[a],i},s.computeWidth=function(e){t.typeOf.object("rectangle",e);var n=e.east,r=e.west;return r>n&&(n+=u.TWO_PI),n-r},s.computeHeight=function(e){return t.typeOf.object("rectangle",e),e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,n){t.defined("cartographics",e);for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,E=Number.MAX_VALUE,f=-Number.MAX_VALUE,l=0,_=e.length;_>l;l++){var O=e[l];a=Math.min(a,O.longitude),i=Math.max(i,O.longitude),E=Math.min(E,O.latitude),f=Math.max(f,O.latitude);var T=O.longitude>=0?O.longitude:O.longitude+u.TWO_PI;o=Math.min(o,T),c=Math.max(c,T)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=E,n.east=i,n.north=f,n):new s(a,E,i,f)},s.fromCartesianArray=function(e,a,o){t.defined("cartesians",e),a=n(a,i.WGS84);for(var c=Number.MAX_VALUE,E=-Number.MAX_VALUE,f=Number.MAX_VALUE,l=-Number.MAX_VALUE,_=Number.MAX_VALUE,O=-Number.MAX_VALUE,T=0,R=e.length;R>T;T++){var p=a.cartesianToCartographic(e[T]);c=Math.min(c,p.longitude),E=Math.max(E,p.longitude),_=Math.min(_,p.latitude),O=Math.max(O,p.latitude);var y=p.longitude>=0?p.longitude:p.longitude+u.TWO_PI;f=Math.min(f,y),l=Math.max(l,y)}return E-c>l-f&&(c=f,E=l,E>u.PI&&(E-=u.TWO_PI),c>u.PI&&(c-=u.TWO_PI)),r(o)?(o.west=c,o.south=_,o.east=E,o.north=O,o):new s(c,_,E,O)},s.clone=function(e,t){return r(e)?r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north):void 0},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,n){return t.typeOf.number("epsilon",n),r(e)&&Math.abs(this.west-e.west)<=n&&Math.abs(this.south-e.south)<=n&&Math.abs(this.east-e.east)<=n&&Math.abs(this.north-e.north)<=n},s.validate=function(e){t.typeOf.object("rectangle",e);var n=e.north;t.typeOf.number.greaterThanOrEquals("north",n,-u.PI_OVER_TWO),t.typeOf.number.lessThanOrEquals("north",n,u.PI_OVER_TWO);var r=e.south;t.typeOf.number.greaterThanOrEquals("south",r,-u.PI_OVER_TWO),t.typeOf.number.lessThanOrEquals("south",r,u.PI_OVER_TWO);var a=e.west;t.typeOf.number.greaterThanOrEquals("west",a,-Math.PI),t.typeOf.number.lessThanOrEquals("west",a,Math.PI);var i=e.east;t.typeOf.number.greaterThanOrEquals("east",i,-Math.PI),t.typeOf.number.lessThanOrEquals("east",i,Math.PI)},s.southwest=function(n,a){return t.typeOf.object("rectangle",n),r(a)?(a.longitude=n.west,a.latitude=n.south,a.height=0,a):new e(n.west,n.south)},s.northwest=function(n,a){return t.typeOf.object("rectangle",n),r(a)?(a.longitude=n.west,a.latitude=n.north,a.height=0,a):new e(n.west,n.north)},s.northeast=function(n,a){return t.typeOf.object("rectangle",n),r(a)?(a.longitude=n.east,a.latitude=n.north,a.height=0,a):new e(n.east,n.north)},s.southeast=function(n,a){return t.typeOf.object("rectangle",n),r(a)?(a.longitude=n.east,a.latitude=n.south,a.height=0,a):new e(n.east,n.south)},s.center=function(n,a){t.typeOf.object("rectangle",n);var i=n.east,o=n.west;o>i&&(i+=u.TWO_PI);var s=u.negativePiToPi(.5*(o+i)),c=.5*(n.south+n.north);return r(a)?(a.longitude=s,a.latitude=c,a.height=0,a):new e(s,c);
},s.intersection=function(e,n,a){t.typeOf.object("rectangle",e),t.typeOf.object("otherRectangle",n);var i=e.east,o=e.west,c=n.east,E=n.west;o>i&&c>0?i+=u.TWO_PI:E>c&&i>0&&(c+=u.TWO_PI),o>i&&0>E?E+=u.TWO_PI:E>c&&0>o&&(o+=u.TWO_PI);var f=u.negativePiToPi(Math.max(o,E)),l=u.negativePiToPi(Math.min(i,c));if(!((e.west<e.east||n.west<n.east)&&f>=l)){var _=Math.max(e.south,n.south),O=Math.min(e.north,n.north);if(!(_>=O))return r(a)?(a.west=f,a.south=_,a.east=l,a.north=O,a):new s(f,_,l,O)}},s.simpleIntersection=function(e,n,a){t.typeOf.object("rectangle",e),t.typeOf.object("otherRectangle",n);var i=Math.max(e.west,n.west),o=Math.max(e.south,n.south),u=Math.min(e.east,n.east),c=Math.min(e.north,n.north);return o>=c||i>=u?void 0:r(a)?(a.west=i,a.south=o,a.east=u,a.north=c,a):new s(i,o,u,c)},s.union=function(e,n,a){t.typeOf.object("rectangle",e),t.typeOf.object("otherRectangle",n),r(a)||(a=new s);var i=e.east,o=e.west,c=n.east,E=n.west;o>i&&c>0?i+=u.TWO_PI:E>c&&i>0&&(c+=u.TWO_PI),o>i&&0>E?E+=u.TWO_PI:E>c&&0>o&&(o+=u.TWO_PI);var f=u.convertLongitudeRange(Math.min(o,E)),l=u.convertLongitudeRange(Math.max(i,c));return a.west=f,a.south=Math.min(e.south,n.south),a.east=l,a.north=Math.max(e.north,n.north),a},s.expand=function(e,n,a){return t.typeOf.object("rectangle",e),t.typeOf.object("cartographic",n),r(a)||(a=new s),a.west=Math.min(e.west,n.longitude),a.south=Math.min(e.south,n.latitude),a.east=Math.max(e.east,n.longitude),a.north=Math.max(e.north,n.latitude),a},s.contains=function(e,n){t.typeOf.object("rectangle",e),t.typeOf.object("cartographic",n);var r=n.longitude,a=n.latitude,i=e.west,o=e.east;return i>o&&(o+=u.TWO_PI,0>r&&(r+=u.TWO_PI)),(r>i||u.equalsEpsilon(r,i,u.EPSILON14))&&(o>r||u.equalsEpsilon(r,o,u.EPSILON14))&&a>=e.south&&a<=e.north};var c=new e;return s.subsample=function(e,a,o,E){t.typeOf.object("rectangle",e),a=n(a,i.WGS84),o=n(o,0),r(E)||(E=[]);var f=0,l=e.north,_=e.south,O=e.east,T=e.west,R=c;R.height=o,R.longitude=T,R.latitude=l,E[f]=a.cartographicToCartesian(R,E[f]),f++,R.longitude=O,E[f]=a.cartographicToCartesian(R,E[f]),f++,R.latitude=_,E[f]=a.cartographicToCartesian(R,E[f]),f++,R.longitude=T,E[f]=a.cartographicToCartesian(R,E[f]),f++,0>l?R.latitude=l:_>0?R.latitude=_:R.latitude=0;for(var p=1;8>p;++p)R.longitude=-Math.PI+p*u.PI_OVER_TWO,s.contains(e,R)&&(E[f]=a.cartographicToCartesian(R,E[f]),f++);return 0===R.latitude&&(R.longitude=T,E[f]=a.cartographicToCartesian(R,E[f]),f++,R.longitude=O,E[f]=a.cartographicToCartesian(R,E[f]),f++),E.length=f,E},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,E,f){"use strict";function l(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var _=new e,O=new e,T=new e,R=new e,p=new e,y=new e,h=new e,d=new e,m=new e,A=new e,N=new e,I=new e;l.fromPoints=function(t,n){if(a(n)||(n=new l),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r,i=e.clone(t[0],h),o=e.clone(i,_),u=e.clone(i,O),s=e.clone(i,T),c=e.clone(i,R),E=e.clone(i,p),f=e.clone(i,y),S=t.length;for(r=1;S>r;r++){e.clone(t[r],i);var M=i.x,b=i.y,w=i.z;M<o.x&&e.clone(i,o),M>c.x&&e.clone(i,c),b<u.y&&e.clone(i,u),b>E.y&&e.clone(i,E),w<s.z&&e.clone(i,s),w>f.z&&e.clone(i,f)}var g=e.magnitudeSquared(e.subtract(c,o,d)),C=e.magnitudeSquared(e.subtract(E,u,d)),L=e.magnitudeSquared(e.subtract(f,s,d)),x=o,U=c,P=g;C>P&&(P=C,x=u,U=E),L>P&&(P=L,x=s,U=f);var v=m;v.x=.5*(x.x+U.x),v.y=.5*(x.y+U.y),v.z=.5*(x.z+U.z);var F=e.magnitudeSquared(e.subtract(U,v,d)),D=Math.sqrt(F),B=A;B.x=o.x,B.y=u.y,B.z=s.z;var j=N;j.x=c.x,j.y=E.y,j.z=f.z;var z=e.multiplyByScalar(e.add(B,j,d),.5,I),G=0;for(r=0;S>r;r++){e.clone(t[r],i);var q=e.magnitude(e.subtract(i,z,d));q>G&&(G=q);var X=e.magnitudeSquared(e.subtract(i,v,d));if(X>F){var V=Math.sqrt(X);D=.5*(D+V),F=D*D;var W=V-D;v.x=(D*v.x+W*i.x)/V,v.y=(D*v.y+W*i.y)/V,v.z=(D*v.z+W*i.z)/V}}return G>D?(e.clone(v,n.center),n.radius=D):(e.clone(z,n.center),n.radius=G),n};var S=new o,M=new e,b=new e,w=new t,g=new t;l.fromRectangle2D=function(e,t,n){return l.fromRectangleWithHeights2D(e,t,0,0,n)},l.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new l),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,S),f.southwest(t,w),w.height=i,f.northeast(t,g),g.height=o;var s=n.project(w,M),c=n.project(g,b),E=c.x-s.x,_=c.y-s.y,O=c.z-s.z;u.radius=.5*Math.sqrt(E*E+_*_+O*O);var T=u.center;return T.x=s.x+.5*E,T.y=s.y+.5*_,T.z=s.z+.5*O,u};var C=[];l.fromRectangle3D=function(t,n,o,u){if(n=r(n,i.WGS84),o=r(o,0),a(u)||(u=new l),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;var s=f.subsample(t,n,o,C);return l.fromPoints(s,u)},l.fromVertices=function(t,i,o,u){if(a(u)||(u=new l),!a(t)||0===t.length)return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;i=r(i,e.ZERO),o=r(o,3),n.typeOf.number.greaterThanOrEquals("stride",o,3);var s=h;s.x=t[0]+i.x,s.y=t[1]+i.y,s.z=t[2]+i.z;var c,E=e.clone(s,_),f=e.clone(s,O),S=e.clone(s,T),M=e.clone(s,R),b=e.clone(s,p),w=e.clone(s,y),g=t.length;for(c=0;g>c;c+=o){var C=t[c]+i.x,L=t[c+1]+i.y,x=t[c+2]+i.z;s.x=C,s.y=L,s.z=x,C<E.x&&e.clone(s,E),C>M.x&&e.clone(s,M),L<f.y&&e.clone(s,f),L>b.y&&e.clone(s,b),x<S.z&&e.clone(s,S),x>w.z&&e.clone(s,w)}var U=e.magnitudeSquared(e.subtract(M,E,d)),P=e.magnitudeSquared(e.subtract(b,f,d)),v=e.magnitudeSquared(e.subtract(w,S,d)),F=E,D=M,B=U;P>B&&(B=P,F=f,D=b),v>B&&(B=v,F=S,D=w);var j=m;j.x=.5*(F.x+D.x),j.y=.5*(F.y+D.y),j.z=.5*(F.z+D.z);var z=e.magnitudeSquared(e.subtract(D,j,d)),G=Math.sqrt(z),q=A;q.x=E.x,q.y=f.y,q.z=S.z;var X=N;X.x=M.x,X.y=b.y,X.z=w.z;var V=e.multiplyByScalar(e.add(q,X,d),.5,I),W=0;for(c=0;g>c;c+=o){s.x=t[c]+i.x,s.y=t[c+1]+i.y,s.z=t[c+2]+i.z;var H=e.magnitude(e.subtract(s,V,d));H>W&&(W=H);var Y=e.magnitudeSquared(e.subtract(s,j,d));if(Y>z){var k=Math.sqrt(Y);G=.5*(G+k),z=G*G;var K=k-G;j.x=(G*j.x+K*s.x)/k,j.y=(G*j.y+K*s.y)/k,j.z=(G*j.z+K*s.z)/k}}return W>G?(e.clone(j,u.center),u.radius=G):(e.clone(V,u.center),u.radius=W),u},l.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new l),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=h;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];var o,u=e.clone(i,_),s=e.clone(i,O),c=e.clone(i,T),E=e.clone(i,R),f=e.clone(i,p),S=e.clone(i,y),M=t.length;for(o=0;M>o;o+=3){var b=t[o]+n[o],w=t[o+1]+n[o+1],g=t[o+2]+n[o+2];i.x=b,i.y=w,i.z=g,b<u.x&&e.clone(i,u),b>E.x&&e.clone(i,E),w<s.y&&e.clone(i,s),w>f.y&&e.clone(i,f),g<c.z&&e.clone(i,c),g>S.z&&e.clone(i,S)}var C=e.magnitudeSquared(e.subtract(E,u,d)),L=e.magnitudeSquared(e.subtract(f,s,d)),x=e.magnitudeSquared(e.subtract(S,c,d)),U=u,P=E,v=C;L>v&&(v=L,U=s,P=f),x>v&&(v=x,U=c,P=S);var F=m;F.x=.5*(U.x+P.x),F.y=.5*(U.y+P.y),F.z=.5*(U.z+P.z);var D=e.magnitudeSquared(e.subtract(P,F,d)),B=Math.sqrt(D),j=A;j.x=u.x,j.y=s.y,j.z=c.z;var z=N;z.x=E.x,z.y=f.y,z.z=S.z;var G=e.multiplyByScalar(e.add(j,z,d),.5,I),q=0;for(o=0;M>o;o+=3){i.x=t[o]+n[o],i.y=t[o+1]+n[o+1],i.z=t[o+2]+n[o+2];var X=e.magnitude(e.subtract(i,G,d));X>q&&(q=X);var V=e.magnitudeSquared(e.subtract(i,F,d));if(V>D){var W=Math.sqrt(V);B=.5*(B+W),D=B*B;var H=W-B;F.x=(B*F.x+H*i.x)/W,F.y=(B*F.y+H*i.y)/W,F.z=(B*F.z+H*i.z)/W}}return q>B?(e.clone(F,r.center),r.radius=B):(e.clone(G,r.center),r.radius=q),r},l.fromCornerPoints=function(t,r,i){n.typeOf.object("corner",t),n.typeOf.object("oppositeCorner",r),a(i)||(i=new l);var o=i.center;return e.add(t,r,o),e.multiplyByScalar(o,.5,o),i.radius=e.distance(o,r),i},l.fromEllipsoid=function(t,r){return n.typeOf.object("ellipsoid",t),a(r)||(r=new l),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var L=new e;l.fromBoundingSpheres=function(t,n){if(a(n)||(n=new l),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return l.clone(t[0],n);if(2===r)return l.union(t[0],t[1],n);var i,o=[];for(i=0;r>i;i++)o.push(t[i].center);n=l.fromPoints(o,n);var u=n.center,s=n.radius;for(i=0;r>i;i++){var c=t[i];s=Math.max(s,e.distance(u,c.center,L)+c.radius)}return n.radius=s,n};var x=new e,U=new e,P=new e;l.fromOrientedBoundingBox=function(t,r){n.defined("orientedBoundingBox",t),a(r)||(r=new l);var i=t.halfAxes,o=c.getColumn(i,0,x),u=c.getColumn(i,1,U),s=c.getColumn(i,2,P);return e.add(o,u,o),e.add(o,s,o),r.center=e.clone(t.center,r.center),r.radius=e.magnitude(o),r},l.clone=function(t,n){return a(t)?a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new l(t.center,t.radius):void 0},l.packedLength=4,l.pack=function(e,t,a){n.typeOf.object("value",e),n.defined("array",t),a=r(a,0);var i=e.center;return t[a++]=i.x,t[a++]=i.y,t[a++]=i.z,t[a]=e.radius,t},l.unpack=function(e,t,i){n.defined("array",e),t=r(t,0),a(i)||(i=new l);var o=i.center;return o.x=e[t++],o.y=e[t++],o.z=e[t++],i.radius=e[t],i};var v=new e,F=new e;l.union=function(t,r,i){n.typeOf.object("left",t),n.typeOf.object("right",r),a(i)||(i=new l);var o=t.center,u=t.radius,s=r.center,c=r.radius,E=e.subtract(s,o,v),f=e.magnitude(E);if(u>=f+c)return t.clone(i),i;if(c>=f+u)return r.clone(i),i;var _=.5*(u+f+c),O=e.multiplyByScalar(E,(-u+_)/f,F);return e.add(O,o,O),e.clone(O,i.center),i.radius=_,i};var D=new e;l.expand=function(t,r,a){n.typeOf.object("sphere",t),n.typeOf.object("point",r),a=l.clone(t,a);var i=e.magnitude(e.subtract(r,a.center,D));return i>a.radius&&(a.radius=i),a},l.intersectPlane=function(t,r){n.typeOf.object("sphere",t),n.typeOf.object("plane",r);var a=t.center,i=t.radius,o=r.normal,s=e.dot(o,a)+r.distance;return-i>s?u.OUTSIDE:i>s?u.INTERSECTING:u.INSIDE},l.transform=function(e,t,r){return n.typeOf.object("sphere",e),n.typeOf.object("transform",t),a(r)||(r=new l),r.center=E.multiplyByPoint(t,e.center,r.center),r.radius=E.getMaximumScale(t)*e.radius,r};var B=new e;l.distanceSquaredTo=function(t,r){n.typeOf.object("sphere",t),n.typeOf.object("cartesian",r);var a=e.subtract(t.center,r,B);return e.magnitudeSquared(a)-t.radius*t.radius},l.transformWithoutScale=function(e,t,r){return n.typeOf.object("sphere",e),n.typeOf.object("transform",t),a(r)||(r=new l),r.center=E.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var j=new e;l.computePlaneDistances=function(t,r,i,o){n.typeOf.object("sphere",t),n.typeOf.object("position",r),n.typeOf.object("direction",i),a(o)||(o=new s);var u=e.subtract(t.center,r,j),c=e.dot(i,u);return o.start=c-t.radius,o.stop=c+t.radius,o};for(var z=new e,G=new e,q=new e,X=new e,V=new e,W=new t,H=new Array(8),Y=0;8>Y;++Y)H[Y]=new e;var k=new o;return l.projectTo2D=function(t,a,i){n.typeOf.object("sphere",t),a=r(a,k);var o=a.ellipsoid,u=t.center,s=t.radius,c=o.geodeticSurfaceNormal(u,z),E=e.cross(e.UNIT_Z,c,G);e.normalize(E,E);var f=e.cross(c,E,q);e.normalize(f,f),e.multiplyByScalar(c,s,c),e.multiplyByScalar(f,s,f),e.multiplyByScalar(E,s,E);var _=e.negate(f,V),O=e.negate(E,X),T=H,R=T[0];e.add(c,f,R),e.add(R,E,R),R=T[1],e.add(c,f,R),e.add(R,O,R),R=T[2],e.add(c,_,R),e.add(R,O,R),R=T[3],e.add(c,_,R),e.add(R,E,R),e.negate(c,c),R=T[4],e.add(c,f,R),e.add(R,E,R),R=T[5],e.add(c,f,R),e.add(R,O,R),R=T[6],e.add(c,_,R),e.add(R,O,R),R=T[7],e.add(c,_,R),e.add(R,E,R);for(var p=T.length,y=0;p>y;++y){var h=T[y];e.add(u,h,h);var d=o.cartesianToCartographic(h,W);a.project(d,h)}i=l.fromPoints(T,i),u=i.center;var m=u.x,A=u.y,N=u.z;return u.x=N,u.y=m,u.z=A,i},l.isOccluded=function(e,t){return n.typeOf.object("sphere",e),n.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)},l.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},l.prototype.intersectPlane=function(e){return l.intersectPlane(this,e)},l.prototype.distanceSquaredTo=function(e){return l.distanceSquaredTo(this,e)},l.prototype.computePlaneDistances=function(e,t,n){return l.computePlaneDistances(this,e,t,n)},l.prototype.isOccluded=function(e){return l.isOccluded(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.clone=function(e){return l.clone(this,e)},l}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){return a.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return a.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return a.supportsFullscreen()?null!==a.element:void 0}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!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",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;u>o;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;r>n;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!l())){var e=/ Chrome\/([\.0-9]+)/.exec(m.userAgent);null!==e&&(A=!0,N=r(e[1]))}return A}function i(){return a()&&N}function o(){if(!t(I)&&(I=!1,!a()&&!l()&&/ Safari\/[\.0-9]+/.test(m.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(m.userAgent);null!==e&&(I=!0,S=r(e[1]))}return I}function u(){return o()&&S}function s(){if(!t(M)){M=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(m.userAgent);null!==e&&(M=!0,b=r(e[1]),b.isNightly=!!e[2])}return M}function c(){return s()&&b}function E(){if(!t(w)){w=!1;var e;"Microsoft Internet Explorer"===m.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(m.userAgent),null!==e&&(w=!0,g=r(e[1]))):"Netscape"===m.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(m.userAgent),null!==e&&(w=!0,g=r(e[1])))}return w}function f(){return E()&&g}function l(){if(!t(C)){C=!1;var e=/ Edge\/([\.0-9]+)/.exec(m.userAgent);null!==e&&(C=!0,L=r(e[1]))}return C}function _(){return l()&&L}function O(){if(!t(x)){x=!1;var e=/Firefox\/([\.0-9]+)/.exec(m.userAgent);null!==e&&(x=!0,U=r(e[1]))}return x}function T(){return t(P)||(P=/Windows/i.test(m.appVersion)),P}function R(){return O()&&U}function p(){return t(v)||(v="undefined"!=typeof PointerEvent&&(!t(m.pointerEnabled)||m.pointerEnabled)),v}function y(){if(!t(D)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;D=t(n)&&""!==n,D&&(F=n)}return D}function h(){return y()?F:void 0}function d(){var e=window.navigator.userAgent.toLowerCase(),t="ipad"==e.match(/ipad/i),n="iphone os"==e.match(/iphone os/i),r="midp"==e.match(/midp/i),a="rv:1.2.3.4"==e.match(/rv:1.2.3.4/i),i="ucweb"==e.match(/ucweb/i),o="android"==e.match(/android/i),u="windows ce"==e.match(/windows ce/i),s="windows mobile"==e.match(/windows mobile/i);return t||n||r||a||i||o||u||s?!1:!0}var m;m="undefined"!=typeof navigator?navigator:{};var A,N,I,S,M,b,w,g,C,L,x,U,P,v,F,D,B={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:E,internetExplorerVersion:f,isEdge:l,edgeVersion:_,isFirefox:O,firefoxVersion:R,isWindows:T,hardwareConcurrency:e(m.hardwareConcurrency,3),supportsPointerEvents:p,supportsImageRenderingPixelated:y,imageRenderingValue:h,isPCBroswer:d};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./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,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,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,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){if(!t(e))throw new n("value is required.");switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new n("componentDatatype is not a valid value.")}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,r){if(!t(e))throw new n("componentDatatype is required.");if(!t(r))throw new n("valuesOrLength is required.");switch(e){case o.BYTE:return new Int8Array(r);case o.UNSIGNED_BYTE:return new Uint8Array(r);case o.SHORT:return new Int16Array(r);case o.UNSIGNED_SHORT:return new Uint16Array(r);case o.INT:return new Int32Array(r);
case o.UNSIGNED_INT:return new Uint32Array(r);case o.FLOAT:return new Float32Array(r);case o.DOUBLE:return new Float64Array(r);default:throw new n("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(r,a,i,u){if(!t(r))throw new n("componentDatatype is required.");if(!t(a))throw new n("buffer is required.");switch(i=e(i,0),u=e(u,(a.byteLength-i)/o.getSizeInBytes(r)),r){case o.BYTE:return new Int8Array(a,i,u);case o.UNSIGNED_BYTE:return new Uint8Array(a,i,u);case o.SHORT:return new Int16Array(a,i,u);case o.UNSIGNED_SHORT:return new Uint16Array(a,i,u);case o.INT:return new Int32Array(a,i,u);case o.UNSIGNED_INT:return new Uint32Array(a,i,u);case o.FLOAT:return new Float32Array(a,i,u);case o.DOUBLE:return new Float64Array(a,i,u);default:throw new n("componentDatatype is not a valid value.")}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE;default:throw new n("name is not a valid value.")}},a(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./Check","./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a,i){"use strict";function o(n){n=t(n,t.EMPTY_OBJECT),e.typeOf.object("options.attributes",n.attributes),this.attributes=n.attributes,this.indices=n.indices,this.primitiveType=t(n.primitiveType,i.TRIANGLES),this.boundingSphere=n.boundingSphere,this.geometryType=t(n.geometryType,a.NONE),this.boundingSphereCV=n.boundingSphereCV}return o.computeNumberOfVertices=function(t){e.typeOf.object("geometry",t);var a=-1;for(var i in t.attributes)if(t.attributes.hasOwnProperty(i)&&n(t.attributes[i])&&n(t.attributes[i].values)){var o=t.attributes[i],u=o.values.length/o.componentsPerAttribute;if(a!==u&&-1!==a)throw new r("All attribute lists must have the same number of attributes.");a=u}return a},o}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(r){if(r=e(r,e.EMPTY_OBJECT),!t(r.componentDatatype))throw new n("options.componentDatatype is required.");if(!t(r.componentsPerAttribute))throw new n("options.componentsPerAttribute is required.");if(r.componentsPerAttribute<1||r.componentsPerAttribute>4)throw new n("options.componentsPerAttribute must be between 1 and 4.");if(!t(r.values))throw new n("options.values is required.");this.componentDatatype=r.componentDatatype,this.componentsPerAttribute=r.componentsPerAttribute,this.normalize=e(r.normalize,!1),this.values=r.values}return r}),define("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.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(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.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return a.POSITION_ONLY=r(new a({position:!0})),a.POSITION_AND_NORMAL=r(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=r(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=r(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=r(new a({position:!0,color:!0})),a.ALL=r(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(r,a,i){if(!t(r))throw new n("value is required");if(!t(a))throw new n("array is required");return i=e(i,0),a[i++]=r.position?1:0,a[i++]=r.normal?1:0,a[i++]=r.st?1:0,a[i++]=r.tangent?1:0,a[i++]=r.bitangent?1:0,a[i]=r.color?1:0,a},a.unpack=function(r,i,o){if(!t(r))throw new n("array is required");return i=e(i,0),t(o)||(o=new a),o.position=1===r[i++],o.normal=1===r[i++],o.st=1===r[i++],o.tangent=1===r[i++],o.bitangent=1===r[i++],o.color=1===r[i],o},a.clone=function(e,n){return t(e)?(t(n)||(n=new a),n.position=e.position,n.normal=e.normal,n.st=e.st,n.tangent=e.tangent,n.bitangent=e.bitangent,n.color=e.color,n):void 0},a}),define("Core/BoxGeometry",["./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType","./VertexFormat"],function(e,t,n,r,a,i,o,u,s,c,E){"use strict";function f(e){e=a(e,a.EMPTY_OBJECT);var r=e.minimum,i=e.maximum;n.typeOf.object("min",r),n.typeOf.object("max",i);var o=a(e.vertexFormat,E.DEFAULT);this._minimum=t.clone(r),this._maximum=t.clone(i),this._vertexFormat=o,this._workerName="createBoxGeometry"}var l=new t;f.fromDimensions=function(e){e=a(e,a.EMPTY_OBJECT);var r=e.dimensions;n.typeOf.object("dimensions",r),n.typeOf.number.greaterThanOrEquals("dimensions.x",r.x,0),n.typeOf.number.greaterThanOrEquals("dimensions.y",r.y,0),n.typeOf.number.greaterThanOrEquals("dimensions.z",r.z,0);var i=t.multiplyByScalar(r,.5,new t);return new f({minimum:t.negate(i,new t),maximum:i,vertexFormat:e.vertexFormat})},f.fromAxisAlignedBoundingBox=function(e){return n.typeOf.object("boundingBox",e),new f({minimum:e.minimum,maximum:e.maximum})},f.packedLength=2*t.packedLength+E.packedLength,f.pack=function(e,r,i){return n.typeOf.object("value",e),n.defined("array",r),i=a(i,0),t.pack(e._minimum,r,i),t.pack(e._maximum,r,i+t.packedLength),E.pack(e._vertexFormat,r,i+2*t.packedLength),r};var _=new t,O=new t,T=new E,R={minimum:_,maximum:O,vertexFormat:T};return f.unpack=function(e,r,o){n.defined("array",e),r=a(r,0);var u=t.unpack(e,r,_),s=t.unpack(e,r+t.packedLength,O),c=E.unpack(e,r+2*t.packedLength,T);return i(o)?(o._minimum=t.clone(u,o._minimum),o._maximum=t.clone(s,o._maximum),o._vertexFormat=E.clone(c,o._vertexFormat),o):new f(R)},f.createGeometry=function(n){var a=n._minimum,i=n._maximum,E=n._vertexFormat;if(!t.equals(a,i)){var f,_,O=new s;if(E.position&&(E.st||E.normal||E.tangent||E.bitangent)){if(E.position&&(_=new Float64Array(72),_[0]=a.x,_[1]=a.y,_[2]=i.z,_[3]=i.x,_[4]=a.y,_[5]=i.z,_[6]=i.x,_[7]=i.y,_[8]=i.z,_[9]=a.x,_[10]=i.y,_[11]=i.z,_[12]=a.x,_[13]=a.y,_[14]=a.z,_[15]=i.x,_[16]=a.y,_[17]=a.z,_[18]=i.x,_[19]=i.y,_[20]=a.z,_[21]=a.x,_[22]=i.y,_[23]=a.z,_[24]=i.x,_[25]=a.y,_[26]=a.z,_[27]=i.x,_[28]=i.y,_[29]=a.z,_[30]=i.x,_[31]=i.y,_[32]=i.z,_[33]=i.x,_[34]=a.y,_[35]=i.z,_[36]=a.x,_[37]=a.y,_[38]=a.z,_[39]=a.x,_[40]=i.y,_[41]=a.z,_[42]=a.x,_[43]=i.y,_[44]=i.z,_[45]=a.x,_[46]=a.y,_[47]=i.z,_[48]=a.x,_[49]=i.y,_[50]=a.z,_[51]=i.x,_[52]=i.y,_[53]=a.z,_[54]=i.x,_[55]=i.y,_[56]=i.z,_[57]=a.x,_[58]=i.y,_[59]=i.z,_[60]=a.x,_[61]=a.y,_[62]=a.z,_[63]=i.x,_[64]=a.y,_[65]=a.z,_[66]=i.x,_[67]=a.y,_[68]=i.z,_[69]=a.x,_[70]=a.y,_[71]=i.z,O.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:_})),E.normal){var T=new Float32Array(72);T[0]=0,T[1]=0,T[2]=1,T[3]=0,T[4]=0,T[5]=1,T[6]=0,T[7]=0,T[8]=1,T[9]=0,T[10]=0,T[11]=1,T[12]=0,T[13]=0,T[14]=-1,T[15]=0,T[16]=0,T[17]=-1,T[18]=0,T[19]=0,T[20]=-1,T[21]=0,T[22]=0,T[23]=-1,T[24]=1,T[25]=0,T[26]=0,T[27]=1,T[28]=0,T[29]=0,T[30]=1,T[31]=0,T[32]=0,T[33]=1,T[34]=0,T[35]=0,T[36]=-1,T[37]=0,T[38]=0,T[39]=-1,T[40]=0,T[41]=0,T[42]=-1,T[43]=0,T[44]=0,T[45]=-1,T[46]=0,T[47]=0,T[48]=0,T[49]=1,T[50]=0,T[51]=0,T[52]=1,T[53]=0,T[54]=0,T[55]=1,T[56]=0,T[57]=0,T[58]=1,T[59]=0,T[60]=0,T[61]=-1,T[62]=0,T[63]=0,T[64]=-1,T[65]=0,T[66]=0,T[67]=-1,T[68]=0,T[69]=0,T[70]=-1,T[71]=0,O.normal=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:T})}if(E.st){var R=new Float32Array(48);R[0]=0,R[1]=0,R[2]=1,R[3]=0,R[4]=1,R[5]=1,R[6]=0,R[7]=1,R[8]=1,R[9]=0,R[10]=0,R[11]=0,R[12]=0,R[13]=1,R[14]=1,R[15]=1,R[16]=0,R[17]=0,R[18]=1,R[19]=0,R[20]=1,R[21]=1,R[22]=0,R[23]=1,R[24]=1,R[25]=0,R[26]=0,R[27]=0,R[28]=0,R[29]=1,R[30]=1,R[31]=1,R[32]=1,R[33]=0,R[34]=0,R[35]=0,R[36]=0,R[37]=1,R[38]=1,R[39]=1,R[40]=0,R[41]=0,R[42]=1,R[43]=0,R[44]=1,R[45]=1,R[46]=0,R[47]=1,O.st=new u({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:R})}if(E.tangent){var p=new Float32Array(72);p[0]=1,p[1]=0,p[2]=0,p[3]=1,p[4]=0,p[5]=0,p[6]=1,p[7]=0,p[8]=0,p[9]=1,p[10]=0,p[11]=0,p[12]=-1,p[13]=0,p[14]=0,p[15]=-1,p[16]=0,p[17]=0,p[18]=-1,p[19]=0,p[20]=0,p[21]=-1,p[22]=0,p[23]=0,p[24]=0,p[25]=1,p[26]=0,p[27]=0,p[28]=1,p[29]=0,p[30]=0,p[31]=1,p[32]=0,p[33]=0,p[34]=1,p[35]=0,p[36]=0,p[37]=-1,p[38]=0,p[39]=0,p[40]=-1,p[41]=0,p[42]=0,p[43]=-1,p[44]=0,p[45]=0,p[46]=-1,p[47]=0,p[48]=-1,p[49]=0,p[50]=0,p[51]=-1,p[52]=0,p[53]=0,p[54]=-1,p[55]=0,p[56]=0,p[57]=-1,p[58]=0,p[59]=0,p[60]=1,p[61]=0,p[62]=0,p[63]=1,p[64]=0,p[65]=0,p[66]=1,p[67]=0,p[68]=0,p[69]=1,p[70]=0,p[71]=0,O.tangent=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:p})}if(E.bitangent){var y=new Float32Array(72);y[0]=0,y[1]=1,y[2]=0,y[3]=0,y[4]=1,y[5]=0,y[6]=0,y[7]=1,y[8]=0,y[9]=0,y[10]=1,y[11]=0,y[12]=0,y[13]=1,y[14]=0,y[15]=0,y[16]=1,y[17]=0,y[18]=0,y[19]=1,y[20]=0,y[21]=0,y[22]=1,y[23]=0,y[24]=0,y[25]=0,y[26]=1,y[27]=0,y[28]=0,y[29]=1,y[30]=0,y[31]=0,y[32]=1,y[33]=0,y[34]=0,y[35]=1,y[36]=0,y[37]=0,y[38]=1,y[39]=0,y[40]=0,y[41]=1,y[42]=0,y[43]=0,y[44]=1,y[45]=0,y[46]=0,y[47]=1,y[48]=0,y[49]=0,y[50]=1,y[51]=0,y[52]=0,y[53]=1,y[54]=0,y[55]=0,y[56]=1,y[57]=0,y[58]=0,y[59]=1,y[60]=0,y[61]=0,y[62]=1,y[63]=0,y[64]=0,y[65]=1,y[66]=0,y[67]=0,y[68]=1,y[69]=0,y[70]=0,y[71]=1,O.bitangent=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:y})}f=new Uint16Array(36),f[0]=0,f[1]=1,f[2]=2,f[3]=0,f[4]=2,f[5]=3,f[6]=6,f[7]=5,f[8]=4,f[9]=7,f[10]=6,f[11]=4,f[12]=8,f[13]=9,f[14]=10,f[15]=8,f[16]=10,f[17]=11,f[18]=14,f[19]=13,f[20]=12,f[21]=15,f[22]=14,f[23]=12,f[24]=18,f[25]=17,f[26]=16,f[27]=19,f[28]=18,f[29]=16,f[30]=20,f[31]=21,f[32]=22,f[33]=20,f[34]=22,f[35]=23}else _=new Float64Array(24),_[0]=a.x,_[1]=a.y,_[2]=a.z,_[3]=i.x,_[4]=a.y,_[5]=a.z,_[6]=i.x,_[7]=i.y,_[8]=a.z,_[9]=a.x,_[10]=i.y,_[11]=a.z,_[12]=a.x,_[13]=a.y,_[14]=i.z,_[15]=i.x,_[16]=a.y,_[17]=i.z,_[18]=i.x,_[19]=i.y,_[20]=i.z,_[21]=a.x,_[22]=i.y,_[23]=i.z,O.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:_}),f=new Uint16Array(36),f[0]=4,f[1]=5,f[2]=6,f[3]=4,f[4]=6,f[5]=7,f[6]=1,f[7]=0,f[8]=3,f[9]=1,f[10]=3,f[11]=2,f[12]=1,f[13]=6,f[14]=5,f[15]=1,f[16]=2,f[17]=6,f[18]=2,f[19]=3,f[20]=7,f[21]=2,f[22]=7,f[23]=6,f[24]=3,f[25]=0,f[26]=4,f[27]=3,f[28]=4,f[29]=7,f[30]=0,f[31]=1,f[32]=5,f[33]=0,f[34]=5,f[35]=4;var h=t.subtract(i,a,l),d=.5*t.magnitude(h);return new o({attributes:O,indices:f,primitiveType:c.TRIANGLES,boundingSphere:new e(t.ZERO,d)})}},f}),define("Workers/createBoxGeometry",["../Core/BoxGeometry","../Core/defined"],function(e,t){"use strict";return function(n,r){return t(r)&&(n=e.unpack(n,r)),e.createGeometry(n)}})}();